@@ -75,6 +75,7 @@ struct flash_flexspi_nor_data {
75
75
flexspi_device_config_t config ;
76
76
flexspi_port_t port ;
77
77
bool legacy_poll ;
78
+ uint64_t size ;
78
79
struct flash_pages_layout layout ;
79
80
struct flash_parameters flash_parameters ;
80
81
};
@@ -456,6 +457,15 @@ static const struct flash_parameters *flash_flexspi_nor_get_parameters(
456
457
return & data -> flash_parameters ;
457
458
}
458
459
460
+ static int flash_flexspi_nor_get_size (const struct device * dev , uint64_t * size )
461
+ {
462
+ struct flash_flexspi_nor_data * data = dev -> data ;
463
+
464
+ * size = (uint64_t )data -> size ;
465
+
466
+ return 0 ;
467
+ }
468
+
459
469
#if defined(CONFIG_FLASH_PAGE_LAYOUT )
460
470
static void flash_flexspi_nor_pages_layout (const struct device * dev ,
461
471
const struct flash_pages_layout * * layout , size_t * layout_size )
@@ -1259,6 +1269,7 @@ static const struct flash_driver_api flash_flexspi_nor_api = {
1259
1269
.write = flash_flexspi_nor_write ,
1260
1270
.read = flash_flexspi_nor_read ,
1261
1271
.get_parameters = flash_flexspi_nor_get_parameters ,
1272
+ .get_size = flash_flexspi_nor_get_size ,
1262
1273
#if defined(CONFIG_FLASH_PAGE_LAYOUT )
1263
1274
.page_layout = flash_flexspi_nor_pages_layout ,
1264
1275
#endif
@@ -1309,6 +1320,7 @@ static const struct flash_driver_api flash_flexspi_nor_api = {
1309
1320
flash_flexspi_nor_data_##n = { \
1310
1321
.config = FLASH_FLEXSPI_DEVICE_CONFIG(n), \
1311
1322
.port = DT_INST_REG_ADDR(n), \
1323
+ .size = DT_INST_PROP(n, size) / 8, \
1312
1324
.layout = { \
1313
1325
.pages_count = DT_INST_PROP(n, size) / 8 \
1314
1326
/ SPI_NOR_SECTOR_SIZE, \
0 commit comments