|
21 | 21 | #elif defined(CONFIG_BOARD_NPCX9M6F_EVB) || \
|
22 | 22 | defined(CONFIG_BOARD_NPCX7M6FB_EVB)
|
23 | 23 | #define SPI_FLASH_TEST_REGION_OFFSET 0x7F000
|
| 24 | +#elif defined(CONFIG_BOARD_EK_RA8M1) || defined(CONFIG_BOARD_EK_RA8D1) |
| 25 | +#define SPI_FLASH_TEST_REGION_OFFSET 0x40000 |
24 | 26 | #else
|
25 | 27 | #define SPI_FLASH_TEST_REGION_OFFSET 0xff000
|
26 | 28 | #endif
|
| 29 | +#if defined(CONFIG_BOARD_EK_RA8M1) || defined(CONFIG_BOARD_EK_RA8D1) |
| 30 | +#define SPI_FLASH_SECTOR_SIZE 262144 |
| 31 | +#else |
27 | 32 | #define SPI_FLASH_SECTOR_SIZE 4096
|
| 33 | +#endif |
| 34 | + |
| 35 | +#if defined(CONFIG_FLASH_STM32_OSPI) || defined(CONFIG_FLASH_STM32_QSPI) || \ |
| 36 | + defined(CONFIG_FLASH_STM32_XSPI) || defined(CONFIG_FLASH_RENESAS_RA_OSPI_B) |
28 | 37 |
|
29 |
| -#if defined(CONFIG_FLASH_STM32_OSPI) || \ |
30 |
| - defined(CONFIG_FLASH_STM32_QSPI) || \ |
31 |
| - defined(CONFIG_FLASH_STM32_XSPI) |
32 | 38 | #define SPI_FLASH_MULTI_SECTOR_TEST
|
33 | 39 | #endif
|
34 | 40 |
|
|
44 | 50 | #define SPI_FLASH_COMPAT st_stm32_xspi_nor
|
45 | 51 | #elif DT_HAS_COMPAT_STATUS_OKAY(nordic_qspi_nor)
|
46 | 52 | #define SPI_FLASH_COMPAT nordic_qspi_nor
|
| 53 | +#elif DT_HAS_COMPAT_STATUS_OKAY(renesas_ra_ospi_b_nor) |
| 54 | +#define SPI_FLASH_COMPAT renesas_ra_ospi_b_nor |
47 | 55 | #else
|
48 | 56 | #define SPI_FLASH_COMPAT invalid
|
49 | 57 | #endif
|
50 | 58 |
|
| 59 | +#if defined(CONFIG_FLASH_RENESAS_RA_OSPI_B) |
| 60 | +const uint8_t erased[] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff}; |
| 61 | +#else |
51 | 62 | const uint8_t erased[] = { 0xff, 0xff, 0xff, 0xff };
|
| 63 | +#endif |
52 | 64 |
|
53 | 65 | void single_sector_test(const struct device *flash_dev)
|
54 | 66 | {
|
| 67 | +#if defined(CONFIG_FLASH_RENESAS_RA_OSPI_B) |
| 68 | + const uint8_t expected[] = {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07}; |
| 69 | +#else |
55 | 70 | const uint8_t expected[] = { 0x55, 0xaa, 0x66, 0x99 };
|
| 71 | +#endif |
56 | 72 | const size_t len = sizeof(expected);
|
57 | 73 | uint8_t buf[sizeof(expected)];
|
58 | 74 | int rc;
|
@@ -124,7 +140,11 @@ void single_sector_test(const struct device *flash_dev)
|
124 | 140 | #if defined SPI_FLASH_MULTI_SECTOR_TEST
|
125 | 141 | void multi_sector_test(const struct device *flash_dev)
|
126 | 142 | {
|
| 143 | +#if defined(CONFIG_FLASH_RENESAS_RA_OSPI_B) |
| 144 | + const uint8_t expected[] = {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07}; |
| 145 | +#else |
127 | 146 | const uint8_t expected[] = { 0x55, 0xaa, 0x66, 0x99 };
|
| 147 | +#endif |
128 | 148 | const size_t len = sizeof(expected);
|
129 | 149 | uint8_t buf[sizeof(expected)];
|
130 | 150 | int rc;
|
|
0 commit comments