|
16 | 16 | */ |
17 | 17 | #define SPI_NOR_DEFAULT_PAGE_SIZE 256 |
18 | 18 | #define SPI_NOR_DEFAULT_N_BANKS 1 |
| 19 | +#define SPI_NOR_DEFAULT_SECTOR_SIZE SZ_64K |
19 | 20 |
|
20 | 21 | /* Standard SPI NOR flash operations. */ |
21 | 22 | #define SPI_NOR_READID_OP(naddr, ndummy, buf, len) \ |
@@ -452,8 +453,9 @@ struct spi_nor_fixups { |
452 | 453 | * JEDIC ID. JEDEC ID zero means "no ID" (mostly older chips). |
453 | 454 | * @id_len: the number of bytes of ID. |
454 | 455 | * @size: the size of the flash in bytes. |
455 | | - * @sector_size: the size listed here is what works with SPINOR_OP_SE, which |
456 | | - * isn't necessarily called a "sector" by the vendor. |
| 456 | + * @sector_size: (optional) the size listed here is what works with |
| 457 | + * SPINOR_OP_SE, which isn't necessarily called a "sector" by |
| 458 | + * the vendor. Defaults to 64k. |
457 | 459 | * @n_banks: (optional) the number of banks. Defaults to 1. |
458 | 460 | * @page_size: (optional) the flash's page size. Defaults to 256. |
459 | 461 | * @addr_nbytes: number of address bytes to send. |
@@ -565,7 +567,7 @@ struct flash_info { |
565 | 567 |
|
566 | 568 | #define SPI_NOR_GEOMETRY(_sector_size, _n_sectors, _n_banks) \ |
567 | 569 | .size = (_sector_size) * (_n_sectors), \ |
568 | | - .sector_size = (_sector_size), \ |
| 570 | + .sector_size = (_sector_size == SZ_64K) ? 0 : (_sector_size), \ |
569 | 571 | .n_banks = (_n_banks) |
570 | 572 |
|
571 | 573 | /* Used when the "_ext_id" is two bytes at most */ |
|
0 commit comments