]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
mtd: spi-nor: macronix: Drop the redundant flash info fields
authorCheng Ming Lin <chengminglin@mxic.com.tw>
Mon, 7 Apr 2025 07:53:58 +0000 (15:53 +0800)
committerPratyush Yadav <pratyush@kernel.org>
Tue, 8 Apr 2025 15:00:51 +0000 (15:00 +0000)
Many flash devices share the same ID but have different part numbers.
To avoid confusion, the part number field is removed.

Additionally, since SFDP already provides size information and
functionality covered by no_sfdp_flags, these fields are also removed.

Furthermore, when 4-byte address instruction table is available,
the SPI_NOR_4B_OPCODES flag is no longer needed and is removed.

Signed-off-by: Cheng Ming Lin <chengminglin@mxic.com.tw>
Acked-by: Tudor Ambarus <tudor.ambarus@linaro.org>
Signed-off-by: Pratyush Yadav <pratyush@kernel.org>
Link: https://lore.kernel.org/r/20250407075400.1113177-2-linchengming884@gmail.com
drivers/mtd/spi-nor/macronix.c

index 55644a3cd88c2b4cf584fea25ba9c6f28b9523c2..7dbe1686b56d98003459046eda39acc954f369e9 100644 (file)
@@ -88,10 +88,8 @@ static const struct flash_info macronix_nor_parts[] = {
                .name = "mx25l8005",
                .size = SZ_1M,
        }, {
+               /* MX25L1606E */
                .id = SNOR_ID(0xc2, 0x20, 0x15),
-               .name = "mx25l1606e",
-               .size = SZ_2M,
-               .no_sfdp_flags = SECT_4K,
        }, {
                .id = SNOR_ID(0xc2, 0x20, 0x16),
                .name = "mx25l3205d",
@@ -103,29 +101,21 @@ static const struct flash_info macronix_nor_parts[] = {
                .size = SZ_8M,
                .no_sfdp_flags = SECT_4K,
        }, {
+               /* MX25L12805D */
                .id = SNOR_ID(0xc2, 0x20, 0x18),
-               .name = "mx25l12805d",
-               .size = SZ_16M,
                .flags = SPI_NOR_HAS_LOCK | SPI_NOR_4BIT_BP,
-               .no_sfdp_flags = SECT_4K,
        }, {
+               /* MX25L25635E, MX25L25645G */
                .id = SNOR_ID(0xc2, 0x20, 0x19),
-               .name = "mx25l25635e",
-               .size = SZ_32M,
-               .no_sfdp_flags = SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ,
                .fixups = &mx25l25635_fixups
        }, {
+               /* MX66L51235F */
                .id = SNOR_ID(0xc2, 0x20, 0x1a),
-               .name = "mx66l51235f",
-               .size = SZ_64M,
-               .no_sfdp_flags = SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ,
                .fixup_flags = SPI_NOR_4B_OPCODES,
                .fixups = &macronix_qpp4b_fixups,
        }, {
+               /* MX66L1G45G */
                .id = SNOR_ID(0xc2, 0x20, 0x1b),
-               .name = "mx66l1g45g",
-               .size = SZ_128M,
-               .no_sfdp_flags = SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ,
                .fixups = &macronix_qpp4b_fixups,
        }, {
                /* MX66L2G45G */
@@ -167,11 +157,8 @@ static const struct flash_info macronix_nor_parts[] = {
                .size = SZ_16M,
                .no_sfdp_flags = SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ,
        }, {
+               /* MX25U51245G */
                .id = SNOR_ID(0xc2, 0x25, 0x3a),
-               .name = "mx25u51245g",
-               .size = SZ_64M,
-               .no_sfdp_flags = SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ,
-               .fixup_flags = SPI_NOR_4B_OPCODES,
                .fixups = &macronix_qpp4b_fixups,
        }, {
                .id = SNOR_ID(0xc2, 0x25, 0x3a),
@@ -185,11 +172,8 @@ static const struct flash_info macronix_nor_parts[] = {
                .id = SNOR_ID(0xc2, 0x25, 0x3b),
                .fixups = &macronix_qpp4b_fixups,
        }, {
+               /* MX66U2G45G */
                .id = SNOR_ID(0xc2, 0x25, 0x3c),
-               .name = "mx66u2g45g",
-               .size = SZ_256M,
-               .no_sfdp_flags = SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ,
-               .fixup_flags = SPI_NOR_4B_OPCODES,
                .fixups = &macronix_qpp4b_fixups,
        }, {
                .id = SNOR_ID(0xc2, 0x26, 0x18),
@@ -215,15 +199,13 @@ static const struct flash_info macronix_nor_parts[] = {
                .size = SZ_4M,
                .no_sfdp_flags = SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ,
        }, {
+               /* MX25UW51245G */
                .id = SNOR_ID(0xc2, 0x81, 0x3a),
-               .name = "mx25uw51245g",
                .n_banks = 4,
                .flags = SPI_NOR_RWW,
        }, {
+               /* MX25L3255E */
                .id = SNOR_ID(0xc2, 0x9e, 0x16),
-               .name = "mx25l3255e",
-               .size = SZ_4M,
-               .no_sfdp_flags = SECT_4K,
        },
        /*
         * This spares us of adding new flash entries for flashes that can be