From fa10a9640b3acd79f9cf7e150f540c2ef1cb2459 Mon Sep 17 00:00:00 2001 From: "Peter A. Bigot" Date: Mon, 22 Jul 2019 05:42:00 -0500 Subject: [PATCH] dts/spi-nor: use bytestring for JEDEC ID This was always intended to be a bytestring rather than an array, but full support was missing. Since that has been addressed switch it to the preferred format. Signed-off-by: Peter A. Bigot --- boards/arm/bl654_dvk/bl654_dvk.dts | 2 +- boards/arm/mimxrt1015_evk/mimxrt1015_evk.dts | 2 +- boards/arm/mimxrt1020_evk/mimxrt1020_evk.dts | 2 +- boards/arm/mimxrt1050_evk/mimxrt1050_evk_qspi.dts | 2 +- boards/arm/mimxrt1060_evk/mimxrt1060_evk.dts | 2 +- boards/arm/nrf52840_pca10056/nrf52840_pca10056.dts | 2 +- boards/arm/particle_argon/dts/mesh_feather.dtsi | 2 +- boards/arm/particle_boron/dts/mesh_feather.dtsi | 2 +- boards/arm/particle_xenon/dts/mesh_feather.dtsi | 2 +- boards/riscv32/hifive1/hifive1.dts | 2 +- boards/riscv32/hifive1_revb/hifive1_revb.dts | 2 +- boards/riscv32/qemu_riscv32/qemu_riscv32.dts | 2 +- boards/xtensa/intel_s1000_crb/intel_s1000_crb.dts | 2 +- drivers/flash/spi_nor.c | 6 +----- dts/arm/nxp/nxp_rt1064.dtsi | 2 +- dts/bindings/mtd/jedec,spi-nor.yaml | 2 +- 16 files changed, 16 insertions(+), 20 deletions(-) diff --git a/boards/arm/bl654_dvk/bl654_dvk.dts b/boards/arm/bl654_dvk/bl654_dvk.dts index 3223c103a5c..def9fd7c79d 100644 --- a/boards/arm/bl654_dvk/bl654_dvk.dts +++ b/boards/arm/bl654_dvk/bl654_dvk.dts @@ -132,7 +132,7 @@ reg = <0>; spi-max-frequency = <80000000>; label = "MX25R64"; - jedec-id = <0xc2 0x28 0x17>; + jedec-id = [c2 28 17]; size = <67108864>; wp-gpios = <&gpio0 22 0>; hold-gpios = <&gpio0 23 0>; diff --git a/boards/arm/mimxrt1015_evk/mimxrt1015_evk.dts b/boards/arm/mimxrt1015_evk/mimxrt1015_evk.dts index c0e077b50b7..8f6262e5d52 100644 --- a/boards/arm/mimxrt1015_evk/mimxrt1015_evk.dts +++ b/boards/arm/mimxrt1015_evk/mimxrt1015_evk.dts @@ -57,7 +57,7 @@ arduino_serial: &uart4 {}; reg = <0>; spi-max-frequency = <133000000>; status = "okay"; - jedec-id = <0x1f 0x89 0x01>; + jedec-id = [1f 89 01]; }; }; diff --git a/boards/arm/mimxrt1020_evk/mimxrt1020_evk.dts b/boards/arm/mimxrt1020_evk/mimxrt1020_evk.dts index 56cf4e43d09..bb46a60de7f 100644 --- a/boards/arm/mimxrt1020_evk/mimxrt1020_evk.dts +++ b/boards/arm/mimxrt1020_evk/mimxrt1020_evk.dts @@ -65,7 +65,7 @@ arduino_serial: &uart2 {}; reg = <0>; spi-max-frequency = <133000000>; status = "okay"; - jedec-id = <0x9d 0x70 0x17>; + jedec-id = [9d 70 17]; }; }; diff --git a/boards/arm/mimxrt1050_evk/mimxrt1050_evk_qspi.dts b/boards/arm/mimxrt1050_evk/mimxrt1050_evk_qspi.dts index 71a679dea02..ebf5d33eaad 100644 --- a/boards/arm/mimxrt1050_evk/mimxrt1050_evk_qspi.dts +++ b/boards/arm/mimxrt1050_evk/mimxrt1050_evk_qspi.dts @@ -16,6 +16,6 @@ reg = <0>; spi-max-frequency = <133000000>; status = "okay"; - jedec-id = <0x9d 0x70 0x17>; + jedec-id = [9d 70 17]; }; }; diff --git a/boards/arm/mimxrt1060_evk/mimxrt1060_evk.dts b/boards/arm/mimxrt1060_evk/mimxrt1060_evk.dts index acbabe56406..d1d52fe66ae 100644 --- a/boards/arm/mimxrt1060_evk/mimxrt1060_evk.dts +++ b/boards/arm/mimxrt1060_evk/mimxrt1060_evk.dts @@ -71,7 +71,7 @@ arduino_serial: &uart3 {}; reg = <0>; spi-max-frequency = <133000000>; status = "okay"; - jedec-id = <0x9d 0x70 0x17>; + jedec-id = [9d 70 17]; }; }; diff --git a/boards/arm/nrf52840_pca10056/nrf52840_pca10056.dts b/boards/arm/nrf52840_pca10056/nrf52840_pca10056.dts index d687da6d89b..d90b1dd6845 100644 --- a/boards/arm/nrf52840_pca10056/nrf52840_pca10056.dts +++ b/boards/arm/nrf52840_pca10056/nrf52840_pca10056.dts @@ -181,7 +181,7 @@ arduino_i2c: &i2c0 { reg = <0>; spi-max-frequency = <80000000>; label = "MX25R64"; - jedec-id = <0xc2 0x28 0x17>; + jedec-id = [c2 28 17]; size = <67108864>; has-be32k; wp-gpios = <&gpio0 22 0>; diff --git a/boards/arm/particle_argon/dts/mesh_feather.dtsi b/boards/arm/particle_argon/dts/mesh_feather.dtsi index 0c9a1381bb4..5288cc93201 100644 --- a/boards/arm/particle_argon/dts/mesh_feather.dtsi +++ b/boards/arm/particle_argon/dts/mesh_feather.dtsi @@ -140,7 +140,7 @@ hold-gpios = <&gpio0 23 0>; size = <0x2000000>; has-be32k; - jedec-id = <0xc2 0x20 0x16>; + jedec-id = [c2 20 16]; }; }; diff --git a/boards/arm/particle_boron/dts/mesh_feather.dtsi b/boards/arm/particle_boron/dts/mesh_feather.dtsi index 0c9a1381bb4..5288cc93201 100644 --- a/boards/arm/particle_boron/dts/mesh_feather.dtsi +++ b/boards/arm/particle_boron/dts/mesh_feather.dtsi @@ -140,7 +140,7 @@ hold-gpios = <&gpio0 23 0>; size = <0x2000000>; has-be32k; - jedec-id = <0xc2 0x20 0x16>; + jedec-id = [c2 20 16]; }; }; diff --git a/boards/arm/particle_xenon/dts/mesh_feather.dtsi b/boards/arm/particle_xenon/dts/mesh_feather.dtsi index 0c9a1381bb4..5288cc93201 100644 --- a/boards/arm/particle_xenon/dts/mesh_feather.dtsi +++ b/boards/arm/particle_xenon/dts/mesh_feather.dtsi @@ -140,7 +140,7 @@ hold-gpios = <&gpio0 23 0>; size = <0x2000000>; has-be32k; - jedec-id = <0xc2 0x20 0x16>; + jedec-id = [c2 20 16]; }; }; diff --git a/boards/riscv32/hifive1/hifive1.dts b/boards/riscv32/hifive1/hifive1.dts index c4f88d16c2f..ecd7eeb5ff8 100644 --- a/boards/riscv32/hifive1/hifive1.dts +++ b/boards/riscv32/hifive1/hifive1.dts @@ -64,7 +64,7 @@ flash0: flash@0 { compatible = "issi,is25lp128", "jedec,spi-nor"; label = "FLASH0"; - jedec-id = <0x96 0x60 0x18>; + jedec-id = [96 60 18]; reg = <0>; spi-max-frequency = <133000000>; }; diff --git a/boards/riscv32/hifive1_revb/hifive1_revb.dts b/boards/riscv32/hifive1_revb/hifive1_revb.dts index 246e451f464..ecadd8d3d96 100644 --- a/boards/riscv32/hifive1_revb/hifive1_revb.dts +++ b/boards/riscv32/hifive1_revb/hifive1_revb.dts @@ -62,7 +62,7 @@ flash0: flash@0 { compatible = "issi,is25lp128", "jedec,spi-nor"; label = "FLASH0"; - jedec-id = <0x96 0x60 0x18>; + jedec-id = [96 60 18]; reg = <0>; spi-max-frequency = <133000000>; }; diff --git a/boards/riscv32/qemu_riscv32/qemu_riscv32.dts b/boards/riscv32/qemu_riscv32/qemu_riscv32.dts index c463db6deaf..f34a8d226cd 100644 --- a/boards/riscv32/qemu_riscv32/qemu_riscv32.dts +++ b/boards/riscv32/qemu_riscv32/qemu_riscv32.dts @@ -40,7 +40,7 @@ flash0: flash@0 { compatible = "issi,is25lp128", "jedec,spi-nor"; label = "FLASH0"; - jedec-id = <0x96 0x60 0x18>; + jedec-id = [96 60 18]; reg = <0>; // Dummy entry spi-max-frequency = <0>; diff --git a/boards/xtensa/intel_s1000_crb/intel_s1000_crb.dts b/boards/xtensa/intel_s1000_crb/intel_s1000_crb.dts index 650be5fd5e2..4f9dd32883b 100644 --- a/boards/xtensa/intel_s1000_crb/intel_s1000_crb.dts +++ b/boards/xtensa/intel_s1000_crb/intel_s1000_crb.dts @@ -53,7 +53,7 @@ reg = <0>; spi-max-frequency = <2000000>; label = "MX25UM512"; - jedec-id = <0xc2 0x80 0x3a>; + jedec-id = [c2 80 3a]; size = <0x2000000>; }; }; diff --git a/drivers/flash/spi_nor.c b/drivers/flash/spi_nor.c index 08cc0ff6532..02f6cbd9168 100644 --- a/drivers/flash/spi_nor.c +++ b/drivers/flash/spi_nor.c @@ -396,11 +396,7 @@ static const struct flash_driver_api spi_nor_api = { }; static const struct spi_nor_config flash_id = { - .id = { - DT_INST_0_JEDEC_SPI_NOR_JEDEC_ID_0, - DT_INST_0_JEDEC_SPI_NOR_JEDEC_ID_1, - DT_INST_0_JEDEC_SPI_NOR_JEDEC_ID_2, - }, + .id = DT_INST_0_JEDEC_SPI_NOR_JEDEC_ID, #ifdef DT_INST_0_JEDEC_SPI_NOR_HAS_BE32K .has_be32k = true, #endif /* DT_INST_0_JEDEC_SPI_NOR_HAS_BE32K */ diff --git a/dts/arm/nxp/nxp_rt1064.dtsi b/dts/arm/nxp/nxp_rt1064.dtsi index 3eb7b936ae6..a22f9a75abf 100644 --- a/dts/arm/nxp/nxp_rt1064.dtsi +++ b/dts/arm/nxp/nxp_rt1064.dtsi @@ -15,6 +15,6 @@ reg = <0>; spi-max-frequency = <133000000>; status = "okay"; - jedec-id = <0xef 0x40 0x16>; + jedec-id = [ef 40 16]; }; }; diff --git a/dts/bindings/mtd/jedec,spi-nor.yaml b/dts/bindings/mtd/jedec,spi-nor.yaml index e6b75301050..87649f94033 100644 --- a/dts/bindings/mtd/jedec,spi-nor.yaml +++ b/dts/bindings/mtd/jedec,spi-nor.yaml @@ -17,7 +17,7 @@ properties: constraint: "jedec,spi-nor" jedec-id: - type: array + type: uint8-array category: required description: JEDEC ID as manufacturer ID, memory type, memory density