Skip to content

Commit 652c021

Browse files
jaz1-nordicmasz-nordic
authored andcommitted
drivers: mspi: Mode and structures
added mode support for SINGLE,QUAD,QUAD_1_4_4,QUAD_1_1_4 and custom Ipc mspi structures Signed-off-by: Michal Frankiewicz <[email protected]> Signed-off-by: Jakub Zymelka <[email protected]>
1 parent e730ad8 commit 652c021

File tree

2 files changed

+29
-19
lines changed

2 files changed

+29
-19
lines changed

drivers/mspi/mspi_nrfe.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -386,15 +386,13 @@ static int api_config(const struct mspi_dt_spec *spec)
386386
}
387387

388388
/* Send pinout configuration to FLPR */
389-
ret = send_config(NRFE_MSPI_CONFIG_PINS, (const void *)pins_cfg.pin,
390-
sizeof(pins_cfg));
389+
ret = send_config(NRFE_MSPI_CONFIG_PINS, (const void *)pins_cfg.pin, sizeof(pins_cfg));
391390
if (ret < 0) {
392391
return ret;
393392
}
394393

395394
/* Send controller configuration to FLPR */
396-
return send_config(NRFE_MSPI_CONFIG_CTRL, (const void *)config,
397-
sizeof(struct mspi_cfg));
395+
return send_config(NRFE_MSPI_CONFIG_CTRL, (const void *)config, sizeof(struct mspi_cfg));
398396
}
399397

400398
static int check_io_mode(enum mspi_io_mode io_mode)

include/drivers/mspi/nrfe_mspi.h

Lines changed: 27 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -8,42 +8,34 @@
88
#define DRIVERS_MSPI_NRFE_MSPI_H
99

1010
#include <zephyr/drivers/pinctrl.h>
11+
#include <zephyr/drivers/mspi.h>
1112

1213
#ifdef __cplusplus
1314
extern "C" {
1415
#endif
1516

1617
#ifdef CONFIG_SOC_NRF54L15
17-
#define NRFE_MSPI_PORT_NUMBER 2 /* Physical port number */
18+
19+
#define NRFE_MSPI_PORT_NUMBER 2 /* Physical port number */
1820
#define NRFE_MSPI_SCK_PIN_NUMBER 1 /* Physical pins number on port 2 */
1921
#define NRFE_MSPI_DQ0_PIN_NUMBER 2
2022
#define NRFE_MSPI_DQ1_PIN_NUMBER 4
2123
#define NRFE_MSPI_DQ2_PIN_NUMBER 3
2224
#define NRFE_MSPI_DQ3_PIN_NUMBER 0
2325
#define NRFE_MSPI_CS0_PIN_NUMBER 5
24-
#define NRFE_MSPI_PINS_MAX 6
25-
26-
#define NRFE_MSPI_SCK_PIN_NUMBER_VIO 0 /* FLPR VIO SCLK pin number */
27-
#define NRFE_MSPI_DQ0_PIN_NUMBER_VIO 1
28-
#define NRFE_MSPI_DQ1_PIN_NUMBER_VIO 2
29-
#define NRFE_MSPI_DQ2_PIN_NUMBER_VIO 3
30-
#define NRFE_MSPI_DQ3_PIN_NUMBER_VIO 4
31-
#define NRFE_MSPI_CS0_PIN_NUMBER_VIO 5
26+
#define NRFE_MSPI_PINS_MAX 6
3227

33-
#define VIO(_pin_) _pin_##_VIO
3428
#else
3529
#error "Unsupported SoC for SDP MSPI"
3630
#endif
3731

38-
#define NRFE_MSPI_MAX_CE_PINS_COUNT 5 /* Ex. CE0 CE1 CE2 CE3 CE4 */
39-
4032
/** @brief eMSPI opcodes. */
4133
enum nrfe_mspi_opcode {
4234
NRFE_MSPI_EP_BOUNDED = 0,
4335
NRFE_MSPI_CONFIG_PINS,
44-
NRFE_MSPI_CONFIG_CTRL, /* struct mspi_cfg */
45-
NRFE_MSPI_CONFIG_DEV, /* struct mspi_dev_cfg */
46-
NRFE_MSPI_CONFIG_XFER, /* struct mspi_xfer */
36+
NRFE_MSPI_CONFIG_CTRL, /* struct mspi_cfg */
37+
NRFE_MSPI_CONFIG_DEV, /* struct mspi_dev_cfg */
38+
NRFE_MSPI_CONFIG_XFER, /* struct mspi_xfer */
4739
NRFE_MSPI_TX,
4840
NRFE_MSPI_TXRX,
4941
NRFE_MSPI_WRONG_OPCODE,
@@ -60,6 +52,26 @@ typedef struct __packed {
6052
uint8_t data;
6153
} nrfe_mspi_flpr_response_t;
6254

55+
typedef struct __packed {
56+
uint8_t opcode;
57+
struct mspi_cfg cfg;
58+
} nrfe_mspi_cfg_t;
59+
60+
typedef struct __packed {
61+
uint8_t opcode;
62+
struct mspi_dev_cfg cfg;
63+
} nrfe_mspi_dev_cfg_t;
64+
65+
typedef struct __packed {
66+
uint8_t opcode;
67+
struct mspi_xfer xfer;
68+
} nrfe_mspi_xfer_t;
69+
70+
typedef struct __packed {
71+
uint8_t opcode;
72+
struct mspi_xfer_packet packet;
73+
} nrfe_mspi_xfer_packet_t;
74+
6375
#ifdef __cplusplus
6476
}
6577
#endif

0 commit comments

Comments
 (0)