Skip to content

Commit 8770a6a

Browse files
mwalleambarus
authored andcommitted
mtd: spi-nor: spansion: sort flash_info database
The flash ID is the new primary key into our database. Sort the entry by it. Keep the most specific ones first, because there might be ID collisions between shorter and longer ones. Signed-off-by: Michael Walle <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Tudor Ambarus <[email protected]>
1 parent 9df3c9a commit 8770a6a

File tree

1 file changed

+87
-87
lines changed

1 file changed

+87
-87
lines changed

drivers/mtd/spi-nor/spansion.c

Lines changed: 87 additions & 87 deletions
Original file line numberDiff line numberDiff line change
@@ -757,28 +757,35 @@ static const struct spi_nor_fixups s25fs_s_nor_fixups = {
757757

758758
static const struct flash_info spansion_nor_parts[] = {
759759
{
760+
.id = SNOR_ID(0x01, 0x02, 0x12),
761+
.name = "s25sl004a",
762+
.size = SZ_512K,
763+
}, {
764+
.id = SNOR_ID(0x01, 0x02, 0x13),
765+
.name = "s25sl008a",
766+
.size = SZ_1M,
767+
}, {
768+
.id = SNOR_ID(0x01, 0x02, 0x14),
769+
.name = "s25sl016a",
770+
.size = SZ_2M,
771+
}, {
760772
.id = SNOR_ID(0x01, 0x02, 0x15, 0x4d, 0x00),
761773
.name = "s25sl032p",
762774
.size = SZ_4M,
763775
.no_sfdp_flags = SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ,
776+
}, {
777+
.id = SNOR_ID(0x01, 0x02, 0x15),
778+
.name = "s25sl032a",
779+
.size = SZ_4M,
764780
}, {
765781
.id = SNOR_ID(0x01, 0x02, 0x16, 0x4d, 0x00),
766782
.name = "s25sl064p",
767783
.size = SZ_8M,
768784
.no_sfdp_flags = SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ,
769785
}, {
770-
.id = SNOR_ID(0x01, 0x20, 0x18, 0x4d, 0x00, 0x80),
771-
.name = "s25fl128s0",
772-
.size = SZ_16M,
773-
.sector_size = SZ_256K,
774-
.no_sfdp_flags = SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ,
775-
.mfr_flags = USE_CLSR,
776-
}, {
777-
.id = SNOR_ID(0x01, 0x20, 0x18, 0x4d, 0x01, 0x80),
778-
.name = "s25fl128s1",
779-
.size = SZ_16M,
780-
.no_sfdp_flags = SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ,
781-
.mfr_flags = USE_CLSR,
786+
.id = SNOR_ID(0x01, 0x02, 0x16),
787+
.name = "s25sl064a",
788+
.size = SZ_8M,
782789
}, {
783790
.id = SNOR_ID(0x01, 0x02, 0x19, 0x4d, 0x00, 0x80),
784791
.name = "s25fl256s0",
@@ -787,31 +794,16 @@ static const struct flash_info spansion_nor_parts[] = {
787794
.no_sfdp_flags = SPI_NOR_SKIP_SFDP | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ,
788795
.mfr_flags = USE_CLSR,
789796
}, {
790-
.id = SNOR_ID(0x01, 0x02, 0x19, 0x4d, 0x01, 0x80),
791-
.name = "s25fl256s1",
797+
.id = SNOR_ID(0x01, 0x02, 0x19, 0x4d, 0x00, 0x81),
798+
.name = "s25fs256s0",
792799
.size = SZ_32M,
793-
.no_sfdp_flags = SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ,
794-
.mfr_flags = USE_CLSR,
795-
}, {
796-
.id = SNOR_ID(0x01, 0x02, 0x20, 0x4d, 0x00, 0x80),
797-
.name = "s25fl512s",
798-
.size = SZ_64M,
799800
.sector_size = SZ_256K,
800-
.flags = SPI_NOR_HAS_LOCK,
801801
.no_sfdp_flags = SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ,
802802
.mfr_flags = USE_CLSR,
803803
}, {
804-
.id = SNOR_ID(0x01, 0x20, 0x18, 0x4d, 0x01, 0x81),
805-
.name = "s25fs128s1",
806-
.size = SZ_16M,
807-
.no_sfdp_flags = SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ,
808-
.mfr_flags = USE_CLSR,
809-
.fixups = &s25fs_s_nor_fixups,
810-
}, {
811-
.id = SNOR_ID(0x01, 0x02, 0x19, 0x4d, 0x00, 0x81),
812-
.name = "s25fs256s0",
804+
.id = SNOR_ID(0x01, 0x02, 0x19, 0x4d, 0x01, 0x80),
805+
.name = "s25fl256s1",
813806
.size = SZ_32M,
814-
.sector_size = SZ_256K,
815807
.no_sfdp_flags = SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ,
816808
.mfr_flags = USE_CLSR,
817809
}, {
@@ -820,6 +812,14 @@ static const struct flash_info spansion_nor_parts[] = {
820812
.size = SZ_32M,
821813
.no_sfdp_flags = SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ,
822814
.mfr_flags = USE_CLSR,
815+
}, {
816+
.id = SNOR_ID(0x01, 0x02, 0x20, 0x4d, 0x00, 0x80),
817+
.name = "s25fl512s",
818+
.size = SZ_64M,
819+
.sector_size = SZ_256K,
820+
.flags = SPI_NOR_HAS_LOCK,
821+
.no_sfdp_flags = SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ,
822+
.mfr_flags = USE_CLSR,
823823
}, {
824824
.id = SNOR_ID(0x01, 0x02, 0x20, 0x4d, 0x00, 0x81),
825825
.name = "s25fs512s",
@@ -837,6 +837,13 @@ static const struct flash_info spansion_nor_parts[] = {
837837
.id = SNOR_ID(0x01, 0x20, 0x18, 0x03, 0x01),
838838
.name = "s25sl12801",
839839
.size = SZ_16M,
840+
}, {
841+
.id = SNOR_ID(0x01, 0x20, 0x18, 0x4d, 0x00, 0x80),
842+
.name = "s25fl128s0",
843+
.size = SZ_16M,
844+
.sector_size = SZ_256K,
845+
.no_sfdp_flags = SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ,
846+
.mfr_flags = USE_CLSR,
840847
}, {
841848
.id = SNOR_ID(0x01, 0x20, 0x18, 0x4d, 0x00),
842849
.name = "s25fl129p0",
@@ -845,51 +852,34 @@ static const struct flash_info spansion_nor_parts[] = {
845852
.no_sfdp_flags = SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ,
846853
.mfr_flags = USE_CLSR,
847854
}, {
848-
.id = SNOR_ID(0x01, 0x20, 0x18, 0x4d, 0x01),
849-
.name = "s25fl129p1",
855+
.id = SNOR_ID(0x01, 0x20, 0x18, 0x4d, 0x01, 0x80),
856+
.name = "s25fl128s1",
850857
.size = SZ_16M,
851858
.no_sfdp_flags = SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ,
852859
.mfr_flags = USE_CLSR,
853860
}, {
854-
.id = SNOR_ID(0x01, 0x02, 0x12),
855-
.name = "s25sl004a",
856-
.size = SZ_512K,
857-
}, {
858-
.id = SNOR_ID(0x01, 0x02, 0x13),
859-
.name = "s25sl008a",
860-
.size = SZ_1M,
861-
}, {
862-
.id = SNOR_ID(0x01, 0x02, 0x14),
863-
.name = "s25sl016a",
864-
.size = SZ_2M,
865-
}, {
866-
.id = SNOR_ID(0x01, 0x02, 0x15),
867-
.name = "s25sl032a",
868-
.size = SZ_4M,
861+
.id = SNOR_ID(0x01, 0x20, 0x18, 0x4d, 0x01, 0x81),
862+
.name = "s25fs128s1",
863+
.size = SZ_16M,
864+
.no_sfdp_flags = SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ,
865+
.mfr_flags = USE_CLSR,
866+
.fixups = &s25fs_s_nor_fixups,
869867
}, {
870-
.id = SNOR_ID(0x01, 0x02, 0x16),
871-
.name = "s25sl064a",
872-
.size = SZ_8M,
868+
.id = SNOR_ID(0x01, 0x20, 0x18, 0x4d, 0x01),
869+
.name = "s25fl129p1",
870+
.size = SZ_16M,
871+
.no_sfdp_flags = SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ,
872+
.mfr_flags = USE_CLSR,
873873
}, {
874-
.id = SNOR_ID(0xef, 0x40, 0x13),
875-
.name = "s25fl004k",
874+
.id = SNOR_ID(0x01, 0x40, 0x13),
875+
.name = "s25fl204k",
876876
.size = SZ_512K,
877-
.no_sfdp_flags = SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ,
877+
.no_sfdp_flags = SECT_4K | SPI_NOR_DUAL_READ,
878878
}, {
879-
.id = SNOR_ID(0xef, 0x40, 0x14),
880-
.name = "s25fl008k",
879+
.id = SNOR_ID(0x01, 0x40, 0x14),
880+
.name = "s25fl208k",
881881
.size = SZ_1M,
882-
.no_sfdp_flags = SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ,
883-
}, {
884-
.id = SNOR_ID(0xef, 0x40, 0x15),
885-
.name = "s25fl016k",
886-
.size = SZ_2M,
887-
.no_sfdp_flags = SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ,
888-
}, {
889-
.id = SNOR_ID(0xef, 0x40, 0x17),
890-
.name = "s25fl064k",
891-
.size = SZ_8M,
892-
.no_sfdp_flags = SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ,
882+
.no_sfdp_flags = SECT_4K | SPI_NOR_DUAL_READ,
893883
}, {
894884
.id = SNOR_ID(0x01, 0x40, 0x15),
895885
.name = "s25fl116k",
@@ -905,16 +895,6 @@ static const struct flash_info spansion_nor_parts[] = {
905895
.name = "s25fl164k",
906896
.size = SZ_8M,
907897
.no_sfdp_flags = SECT_4K,
908-
}, {
909-
.id = SNOR_ID(0x01, 0x40, 0x13),
910-
.name = "s25fl204k",
911-
.size = SZ_512K,
912-
.no_sfdp_flags = SECT_4K | SPI_NOR_DUAL_READ,
913-
}, {
914-
.id = SNOR_ID(0x01, 0x40, 0x14),
915-
.name = "s25fl208k",
916-
.size = SZ_1M,
917-
.no_sfdp_flags = SECT_4K | SPI_NOR_DUAL_READ,
918898
}, {
919899
.id = SNOR_ID(0x01, 0x60, 0x17),
920900
.name = "s25fl064l",
@@ -934,10 +914,11 @@ static const struct flash_info spansion_nor_parts[] = {
934914
.no_sfdp_flags = SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ,
935915
.fixup_flags = SPI_NOR_4B_OPCODES,
936916
}, {
937-
.id = SNOR_ID(0x34, 0x2b, 0x19, 0x0f, 0x08, 0x90),
938-
.name = "s25fs256t",
939-
.mfr_flags = USE_CLPEF,
940-
.fixups = &s25fs256t_fixups
917+
.id = SNOR_ID(0x04, 0x2c, 0xc2, 0x7f, 0x7f, 0x7f),
918+
.name = "cy15x104q",
919+
.size = SZ_512K,
920+
.sector_size = SZ_512K,
921+
.flags = SPI_NOR_NO_ERASE,
941922
}, {
942923
.id = SNOR_ID(0x34, 0x2a, 0x1a, 0x0f, 0x03, 0x90),
943924
.name = "s25hl512t",
@@ -954,6 +935,11 @@ static const struct flash_info spansion_nor_parts[] = {
954935
.mfr_flags = USE_CLPEF,
955936
.flags = NO_CHIP_ERASE,
956937
.fixups = &s25hx_t_fixups
938+
}, {
939+
.id = SNOR_ID(0x34, 0x2b, 0x19, 0x0f, 0x08, 0x90),
940+
.name = "s25fs256t",
941+
.mfr_flags = USE_CLPEF,
942+
.fixups = &s25fs256t_fixups
957943
}, {
958944
.id = SNOR_ID(0x34, 0x2b, 0x1a, 0x0f, 0x03, 0x90),
959945
.name = "s25hs512t",
@@ -970,12 +956,6 @@ static const struct flash_info spansion_nor_parts[] = {
970956
.mfr_flags = USE_CLPEF,
971957
.flags = NO_CHIP_ERASE,
972958
.fixups = &s25hx_t_fixups
973-
}, {
974-
.id = SNOR_ID(0x04, 0x2c, 0xc2, 0x7f, 0x7f, 0x7f),
975-
.name = "cy15x104q",
976-
.size = SZ_512K,
977-
.sector_size = SZ_512K,
978-
.flags = SPI_NOR_NO_ERASE,
979959
}, {
980960
.id = SNOR_ID(0x34, 0x5a, 0x1a),
981961
.name = "s28hl512t",
@@ -1001,6 +981,26 @@ static const struct flash_info spansion_nor_parts[] = {
1001981
.name = "s28hs02gt",
1002982
.mfr_flags = USE_CLPEF,
1003983
.fixups = &s28hx_t_fixups,
984+
}, {
985+
.id = SNOR_ID(0xef, 0x40, 0x13),
986+
.name = "s25fl004k",
987+
.size = SZ_512K,
988+
.no_sfdp_flags = SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ,
989+
}, {
990+
.id = SNOR_ID(0xef, 0x40, 0x14),
991+
.name = "s25fl008k",
992+
.size = SZ_1M,
993+
.no_sfdp_flags = SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ,
994+
}, {
995+
.id = SNOR_ID(0xef, 0x40, 0x15),
996+
.name = "s25fl016k",
997+
.size = SZ_2M,
998+
.no_sfdp_flags = SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ,
999+
}, {
1000+
.id = SNOR_ID(0xef, 0x40, 0x17),
1001+
.name = "s25fl064k",
1002+
.size = SZ_8M,
1003+
.no_sfdp_flags = SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ,
10041004
}
10051005
};
10061006

0 commit comments

Comments
 (0)