From dfebc1b9087d003eea39fe2e641b75d1cbd23e89 Mon Sep 17 00:00:00 2001 From: Pali Rohár Date: Tue, 2 Aug 2022 11:55:19 +0200 Subject: arm: mvebu: spl: Always fallback to BootROM boot method BootROM boot method should always work so always add it as fallback method to spl_boot_list. In case U-Boot SPI driver fails it is better to try using BootROM than hanging as by default only one boot method is specified. Signed-off-by: Pali Rohár Tested-by: Tony Dinh Reviewed-by: Stefan Roese --- arch/arm/mach-mvebu/spl.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'arch/arm') diff --git a/arch/arm/mach-mvebu/spl.c b/arch/arm/mach-mvebu/spl.c index 13c99913c38..bfcba2e73ba 100644 --- a/arch/arm/mach-mvebu/spl.c +++ b/arch/arm/mach-mvebu/spl.c @@ -271,6 +271,13 @@ u32 spl_boot_device(void) } } +void board_boot_order(u32 *spl_boot_list) +{ + spl_boot_list[0] = spl_boot_device(); + if (spl_boot_list[0] != BOOT_DEVICE_BOOTROM) + spl_boot_list[1] = BOOT_DEVICE_BOOTROM; +} + #else u32 spl_boot_device(void) -- cgit v1.2.3 From 0e8b74addcde54ef154297d3bebd3d21f86c2199 Mon Sep 17 00:00:00 2001 From: Pali Rohár Date: Fri, 5 Aug 2022 13:37:25 +0200 Subject: arm: mvebu: dts: Build only arch-compatible dts files 64-bit Armada DTS files are not build correctly during compilation of 32-bit Armada boards and vice versa. So fix makefile build system to compile only those dts files which are compatible for the current build (64-bit Armada DTS files only for 64-bit builds and 32-bit Armada DTS files only for 32-bit builds). Signed-off-by: Pali Rohár Reviewed-by: Stefan Roese --- arch/arm/dts/Makefile | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) (limited to 'arch/arm') diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile index ceaa39e4b4d..7330121dbab 100644 --- a/arch/arm/dts/Makefile +++ b/arch/arm/dts/Makefile @@ -232,12 +232,8 @@ dtb-$(CONFIG_ARCH_TEGRA) += tegra20-harmony.dtb \ tegra210-p2571.dtb \ tegra210-p3450-0000.dtb +ifdef CONFIG_ARMADA_32BIT dtb-$(CONFIG_ARCH_MVEBU) += \ - armada-3720-db.dtb \ - armada-3720-espressobin.dtb \ - armada-3720-turris-mox.dtb \ - armada-3720-eDPU.dtb \ - armada-3720-uDPU.dtb \ armada-375-db.dtb \ armada-385-atl-x530.dtb \ armada-385-atl-x530DP.dtb \ @@ -247,12 +243,6 @@ dtb-$(CONFIG_ARCH_MVEBU) += \ armada-388-gp.dtb \ armada-388-helios4.dtb \ armada-38x-controlcenterdc.dtb \ - armada-7040-db-nand.dtb \ - armada-7040-db.dtb \ - armada-8040-clearfog-gt-8k.dtb \ - armada-8040-db.dtb \ - armada-8040-mcbin.dtb \ - armada-8040-puzzle-m801.dtb \ armada-xp-crs305-1g-4s.dtb \ armada-xp-crs305-1g-4s-bit.dtb \ armada-xp-crs326-24g-2s.dtb \ @@ -263,7 +253,20 @@ dtb-$(CONFIG_ARCH_MVEBU) += \ armada-xp-gp.dtb \ armada-xp-maxbcm.dtb \ armada-xp-synology-ds414.dtb \ - armada-xp-theadorable.dtb \ + armada-xp-theadorable.dtb +else +dtb-$(CONFIG_ARCH_MVEBU) += \ + armada-3720-db.dtb \ + armada-3720-espressobin.dtb \ + armada-3720-turris-mox.dtb \ + armada-3720-eDPU.dtb \ + armada-3720-uDPU.dtb \ + armada-7040-db-nand.dtb \ + armada-7040-db.dtb \ + armada-8040-clearfog-gt-8k.dtb \ + armada-8040-db.dtb \ + armada-8040-mcbin.dtb \ + armada-8040-puzzle-m801.dtb \ cn9130-db-A.dtb \ cn9130-db-B.dtb \ cn9131-db-A.dtb \ @@ -272,6 +275,7 @@ dtb-$(CONFIG_ARCH_MVEBU) += \ cn9132-db-B.dtb \ cn9130-crb-A.dtb \ cn9130-crb-B.dtb +endif dtb-$(CONFIG_ARCH_SYNQUACER) += synquacer-sc2a11-developerbox.dtb dtb-$(CONFIG_ARCH_UNIPHIER_LD11) += \ -- cgit v1.2.3 From 8879258ec0d6856ee9af802c79bb906feff6a032 Mon Sep 17 00:00:00 2001 From: Pali Rohár Date: Wed, 3 Aug 2022 13:00:50 +0200 Subject: arm: mvebu: Introduce mvebu-u-boot.dtsi for 32-bit Armada SoCs Set u-boot,dm-pre-reloc for /soc/, /soc/internal-regs/ and &uart0 nodes as it is required on every 32-bit Armada SoCs. And set also u-boot,dm-pre-reloc for &spi0 when going to boot from SPI because otherwise SPL SPI drivers do not load. Signed-off-by: Pali Rohár Reviewed-by: Stefan Roese Tested-by: Stefan Roese --- arch/arm/dts/mvebu-u-boot.dtsi | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 arch/arm/dts/mvebu-u-boot.dtsi (limited to 'arch/arm') diff --git a/arch/arm/dts/mvebu-u-boot.dtsi b/arch/arm/dts/mvebu-u-boot.dtsi new file mode 100644 index 00000000000..5538f95148d --- /dev/null +++ b/arch/arm/dts/mvebu-u-boot.dtsi @@ -0,0 +1,24 @@ +#include + +#ifdef CONFIG_ARMADA_32BIT + +/ { + soc { + u-boot,dm-pre-reloc; + internal-regs { + u-boot,dm-pre-reloc; + }; + }; +}; + +&uart0 { + u-boot,dm-pre-reloc; +}; + +#ifdef CONFIG_SPL_SPI +&spi0 { + u-boot,dm-pre-reloc; +}; +#endif + +#endif -- cgit v1.2.3 From 5d4d1212f7a9bd179bad1774156ce5500316b2c6 Mon Sep 17 00:00:00 2001 From: Pali Rohár Date: Wed, 3 Aug 2022 13:00:51 +0200 Subject: arm: mvebu: Remove redundant u-boot, dm-pre-reloc from all 32-bit Armada SoCs Replace it by including of mvebu-u-boot.dtsi file. When board does not use -u-boot.dtsi then mvebu-u-boot.dtsi is included automatically by makefile scripts/Makefile.lib. Signed-off-by: Pali Rohár Reviewed-by: Stefan Roese Tested-by: Stefan Roese --- arch/arm/dts/armada-370-xp.dtsi | 1 - arch/arm/dts/armada-375-db.dts | 3 --- arch/arm/dts/armada-375.dtsi | 2 -- arch/arm/dts/armada-385-atl-x530-u-boot.dtsi | 14 ++------------ arch/arm/dts/armada-385-db-88f6820-amc.dts | 3 --- arch/arm/dts/armada-385-turris-omnia-u-boot.dtsi | 8 +------- arch/arm/dts/armada-388-clearfog-u-boot.dtsi | 2 ++ arch/arm/dts/armada-388-gp.dts | 3 --- arch/arm/dts/armada-388-helios4-u-boot.dtsi | 2 ++ arch/arm/dts/armada-38x-controlcenterdc.dts | 4 ---- arch/arm/dts/armada-38x-solidrun-microsom.dtsi | 1 - arch/arm/dts/armada-38x.dtsi | 2 -- arch/arm/dts/armada-xp-crs305-1g-4s-u-boot.dtsi | 13 ------------- arch/arm/dts/armada-xp-crs305-1g-4s.dtsi | 1 - arch/arm/dts/armada-xp-crs326-24g-2s-u-boot.dtsi | 13 ------------- arch/arm/dts/armada-xp-crs326-24g-2s.dtsi | 1 - arch/arm/dts/armada-xp-crs328-4c-20s-4s-u-boot.dtsi | 13 ------------- arch/arm/dts/armada-xp-crs328-4c-20s-4s.dtsi | 1 - arch/arm/dts/armada-xp-db-xc3-24g4xg-u-boot.dtsi | 12 +----------- arch/arm/dts/armada-xp-gp-u-boot.dtsi | 19 ------------------- arch/arm/dts/armada-xp-maxbcm.dts | 1 - arch/arm/dts/armada-xp-synology-ds414-u-boot.dtsi | 9 --------- arch/arm/dts/armada-xp-synology-ds414.dts | 1 - arch/arm/dts/armada-xp-theadorable.dts | 3 --- arch/arm/dts/armada-xp.dtsi | 1 - 25 files changed, 8 insertions(+), 125 deletions(-) delete mode 100644 arch/arm/dts/armada-xp-crs305-1g-4s-u-boot.dtsi delete mode 100644 arch/arm/dts/armada-xp-crs326-24g-2s-u-boot.dtsi delete mode 100644 arch/arm/dts/armada-xp-crs328-4c-20s-4s-u-boot.dtsi delete mode 100644 arch/arm/dts/armada-xp-gp-u-boot.dtsi delete mode 100644 arch/arm/dts/armada-xp-synology-ds414-u-boot.dtsi (limited to 'arch/arm') diff --git a/arch/arm/dts/armada-370-xp.dtsi b/arch/arm/dts/armada-370-xp.dtsi index 4cd168c9578..310f159cd5d 100644 --- a/arch/arm/dts/armada-370-xp.dtsi +++ b/arch/arm/dts/armada-370-xp.dtsi @@ -102,7 +102,6 @@ #address-cells = <1>; #size-cells = <1>; ranges = <0 MBUS_ID(0xf0, 0x01) 0 0x100000>; - u-boot,dm-pre-reloc; rtc: rtc@10300 { compatible = "marvell,orion-rtc"; diff --git a/arch/arm/dts/armada-375-db.dts b/arch/arm/dts/armada-375-db.dts index 343349b8fd6..d7788390064 100644 --- a/arch/arm/dts/armada-375-db.dts +++ b/arch/arm/dts/armada-375-db.dts @@ -86,10 +86,8 @@ * by default. */ status = "okay"; - u-boot,dm-pre-reloc; spi-flash@0 { - u-boot,dm-pre-reloc; #address-cells = <1>; #size-cells = <1>; compatible = "n25q128a13", "jedec,spi-nor"; @@ -113,7 +111,6 @@ }; serial@12000 { - u-boot,dm-pre-reloc; status = "okay"; }; diff --git a/arch/arm/dts/armada-375.dtsi b/arch/arm/dts/armada-375.dtsi index fcb9245fd49..20a8c352b2f 100644 --- a/arch/arm/dts/armada-375.dtsi +++ b/arch/arm/dts/armada-375.dtsi @@ -103,7 +103,6 @@ soc { compatible = "marvell,armada375-mbus", "simple-bus"; - u-boot,dm-pre-reloc; #address-cells = <2>; #size-cells = <1>; controller = <&mbusc>; @@ -168,7 +167,6 @@ internal-regs { compatible = "simple-bus"; - u-boot,dm-pre-reloc; #address-cells = <1>; #size-cells = <1>; ranges = <0 MBUS_ID(0xf0, 0x01) 0 0x100000>; diff --git a/arch/arm/dts/armada-385-atl-x530-u-boot.dtsi b/arch/arm/dts/armada-385-atl-x530-u-boot.dtsi index 79b694cb84b..4a3fb2ce408 100644 --- a/arch/arm/dts/armada-385-atl-x530-u-boot.dtsi +++ b/arch/arm/dts/armada-385-atl-x530-u-boot.dtsi @@ -1,17 +1,7 @@ // SPDX-License-Identifier: GPL-2.0 -&spi1 { - u-boot,dm-pre-reloc; - - spi-flash@0 { - u-boot,dm-pre-reloc; - }; -}; - -&uart0 { - u-boot,dm-pre-reloc; -}; - &watchdog { u-boot,dm-pre-reloc; }; + +#include "mvebu-u-boot.dtsi" diff --git a/arch/arm/dts/armada-385-db-88f6820-amc.dts b/arch/arm/dts/armada-385-db-88f6820-amc.dts index 59a425f6b15..1a2d79d7582 100644 --- a/arch/arm/dts/armada-385-db-88f6820-amc.dts +++ b/arch/arm/dts/armada-385-db-88f6820-amc.dts @@ -53,7 +53,6 @@ pinctrl-names = "default"; pinctrl-0 = <&uart0_pins>; status = "okay"; - u-boot,dm-pre-reloc; }; @@ -114,10 +113,8 @@ pinctrl-names = "default"; pinctrl-0 = <&spi1_pins>; status = "okay"; - u-boot,dm-pre-reloc; spi-flash@0 { - u-boot,dm-pre-reloc; #address-cells = <1>; #size-cells = <1>; compatible = "jedec,spi-nor"; diff --git a/arch/arm/dts/armada-385-turris-omnia-u-boot.dtsi b/arch/arm/dts/armada-385-turris-omnia-u-boot.dtsi index ec12298fd40..3f1e761a954 100644 --- a/arch/arm/dts/armada-385-turris-omnia-u-boot.dtsi +++ b/arch/arm/dts/armada-385-turris-omnia-u-boot.dtsi @@ -37,11 +37,7 @@ #ifdef CONFIG_ENV_IS_IN_SPI_FLASH &spi0 { - u-boot,dm-pre-reloc; - flash@0 { - u-boot,dm-pre-reloc; - partitions { partition@0 { reg = <0x0 CONFIG_ENV_OFFSET>; @@ -56,6 +52,4 @@ }; #endif -&uart0 { - u-boot,dm-pre-reloc; -}; +#include "mvebu-u-boot.dtsi" diff --git a/arch/arm/dts/armada-388-clearfog-u-boot.dtsi b/arch/arm/dts/armada-388-clearfog-u-boot.dtsi index 20f5c8fb8ce..96629294be4 100644 --- a/arch/arm/dts/armada-388-clearfog-u-boot.dtsi +++ b/arch/arm/dts/armada-388-clearfog-u-boot.dtsi @@ -35,3 +35,5 @@ u-boot,dm-spl; }; }; + +#include "mvebu-u-boot.dtsi" diff --git a/arch/arm/dts/armada-388-gp.dts b/arch/arm/dts/armada-388-gp.dts index d59aa5f232d..f5345fb1aa1 100644 --- a/arch/arm/dts/armada-388-gp.dts +++ b/arch/arm/dts/armada-388-gp.dts @@ -71,12 +71,10 @@ pinctrl-names = "default"; pinctrl-0 = <&spi0_pins>; status = "okay"; - u-boot,dm-pre-reloc; #address-cells = <1>; #size-cells = <0>; spi-flash@0 { - u-boot,dm-pre-reloc; #address-cells = <1>; #size-cells = <1>; compatible = "st,m25p128", "jedec,spi-nor"; @@ -132,7 +130,6 @@ pinctrl-names = "default"; pinctrl-0 = <&uart0_pins>; status = "okay"; - u-boot,dm-pre-reloc; }; /* GE1 CON15 */ diff --git a/arch/arm/dts/armada-388-helios4-u-boot.dtsi b/arch/arm/dts/armada-388-helios4-u-boot.dtsi index 1047c1af233..bac4b060589 100644 --- a/arch/arm/dts/armada-388-helios4-u-boot.dtsi +++ b/arch/arm/dts/armada-388-helios4-u-boot.dtsi @@ -42,3 +42,5 @@ u-boot,dm-spl; }; }; + +#include "mvebu-u-boot.dtsi" diff --git a/arch/arm/dts/armada-38x-controlcenterdc.dts b/arch/arm/dts/armada-38x-controlcenterdc.dts index 5063a798df7..b5d76f8b22d 100644 --- a/arch/arm/dts/armada-38x-controlcenterdc.dts +++ b/arch/arm/dts/armada-38x-controlcenterdc.dts @@ -24,10 +24,6 @@ u-boot,dm-pre-reloc; }; -&uart0 { - u-boot,dm-pre-reloc; -}; - &uart1 { u-boot,dm-pre-reloc; }; diff --git a/arch/arm/dts/armada-38x-solidrun-microsom.dtsi b/arch/arm/dts/armada-38x-solidrun-microsom.dtsi index 9bbeafc53bf..f6ae784bed4 100644 --- a/arch/arm/dts/armada-38x-solidrun-microsom.dtsi +++ b/arch/arm/dts/armada-38x-solidrun-microsom.dtsi @@ -96,7 +96,6 @@ pinctrl-0 = <&uart0_pins>; pinctrl-names = "default"; status = "okay"; - u-boot,dm-pre-reloc; }; &i2c0 { diff --git a/arch/arm/dts/armada-38x.dtsi b/arch/arm/dts/armada-38x.dtsi index 3e970097c89..cf7ac4a90c6 100644 --- a/arch/arm/dts/armada-38x.dtsi +++ b/arch/arm/dts/armada-38x.dtsi @@ -35,7 +35,6 @@ soc { compatible = "marvell,armada380-mbus", "simple-bus"; - u-boot,dm-pre-reloc; #address-cells = <2>; #size-cells = <1>; controller = <&mbusc>; @@ -100,7 +99,6 @@ internal-regs { compatible = "simple-bus"; - u-boot,dm-pre-reloc; #address-cells = <1>; #size-cells = <1>; ranges = <0 MBUS_ID(0xf0, 0x01) 0 0x100000>; diff --git a/arch/arm/dts/armada-xp-crs305-1g-4s-u-boot.dtsi b/arch/arm/dts/armada-xp-crs305-1g-4s-u-boot.dtsi deleted file mode 100644 index 8576a027300..00000000000 --- a/arch/arm/dts/armada-xp-crs305-1g-4s-u-boot.dtsi +++ /dev/null @@ -1,13 +0,0 @@ -// SPDX-License-Identifier: (GPL-2.0+ OR MIT) - -&uart0 { - u-boot,dm-pre-reloc; -}; - -&spi0 { - u-boot,dm-pre-reloc; - - spi-flash@0 { - u-boot,dm-pre-reloc; - }; -}; diff --git a/arch/arm/dts/armada-xp-crs305-1g-4s.dtsi b/arch/arm/dts/armada-xp-crs305-1g-4s.dtsi index 1a74ecd5b52..d09cd477424 100644 --- a/arch/arm/dts/armada-xp-crs305-1g-4s.dtsi +++ b/arch/arm/dts/armada-xp-crs305-1g-4s.dtsi @@ -19,7 +19,6 @@ /dts-v1/; #include "armada-xp-98dx3236.dtsi" -#include "armada-xp-crs305-1g-4s-u-boot.dtsi" / { model = "CRS305-1G-4S+"; diff --git a/arch/arm/dts/armada-xp-crs326-24g-2s-u-boot.dtsi b/arch/arm/dts/armada-xp-crs326-24g-2s-u-boot.dtsi deleted file mode 100644 index 8576a027300..00000000000 --- a/arch/arm/dts/armada-xp-crs326-24g-2s-u-boot.dtsi +++ /dev/null @@ -1,13 +0,0 @@ -// SPDX-License-Identifier: (GPL-2.0+ OR MIT) - -&uart0 { - u-boot,dm-pre-reloc; -}; - -&spi0 { - u-boot,dm-pre-reloc; - - spi-flash@0 { - u-boot,dm-pre-reloc; - }; -}; diff --git a/arch/arm/dts/armada-xp-crs326-24g-2s.dtsi b/arch/arm/dts/armada-xp-crs326-24g-2s.dtsi index e50f3ead13b..35b432ffb5f 100644 --- a/arch/arm/dts/armada-xp-crs326-24g-2s.dtsi +++ b/arch/arm/dts/armada-xp-crs326-24g-2s.dtsi @@ -19,7 +19,6 @@ /dts-v1/; #include "armada-xp-98dx3236.dtsi" -#include "armada-xp-crs326-24g-2s-u-boot.dtsi" / { model = "CRS326-24G-2S+"; diff --git a/arch/arm/dts/armada-xp-crs328-4c-20s-4s-u-boot.dtsi b/arch/arm/dts/armada-xp-crs328-4c-20s-4s-u-boot.dtsi deleted file mode 100644 index 8576a027300..00000000000 --- a/arch/arm/dts/armada-xp-crs328-4c-20s-4s-u-boot.dtsi +++ /dev/null @@ -1,13 +0,0 @@ -// SPDX-License-Identifier: (GPL-2.0+ OR MIT) - -&uart0 { - u-boot,dm-pre-reloc; -}; - -&spi0 { - u-boot,dm-pre-reloc; - - spi-flash@0 { - u-boot,dm-pre-reloc; - }; -}; diff --git a/arch/arm/dts/armada-xp-crs328-4c-20s-4s.dtsi b/arch/arm/dts/armada-xp-crs328-4c-20s-4s.dtsi index daff1af2a24..63586b63a8b 100644 --- a/arch/arm/dts/armada-xp-crs328-4c-20s-4s.dtsi +++ b/arch/arm/dts/armada-xp-crs328-4c-20s-4s.dtsi @@ -19,7 +19,6 @@ /dts-v1/; #include "armada-xp-98dx3236.dtsi" -#include "armada-xp-crs328-4c-20s-4s-u-boot.dtsi" / { model = "CRS328-4C-20S-4S+"; diff --git a/arch/arm/dts/armada-xp-db-xc3-24g4xg-u-boot.dtsi b/arch/arm/dts/armada-xp-db-xc3-24g4xg-u-boot.dtsi index fdbe168a873..dc20643bfa3 100644 --- a/arch/arm/dts/armada-xp-db-xc3-24g4xg-u-boot.dtsi +++ b/arch/arm/dts/armada-xp-db-xc3-24g4xg-u-boot.dtsi @@ -1,9 +1,5 @@ // SPDX-License-Identifier: (GPL-2.0+ OR MIT) -&uart0 { - u-boot,dm-pre-reloc; -}; - &nand_controller { compatible="marvell,armada370-nand-controller"; status = "okay"; @@ -15,10 +11,4 @@ nand-ecc-step-size = <512>; }; -&spi0 { - u-boot,dm-pre-reloc; - - spi-flash@0 { - u-boot,dm-pre-reloc; - }; -}; +#include "mvebu-u-boot.dtsi" diff --git a/arch/arm/dts/armada-xp-gp-u-boot.dtsi b/arch/arm/dts/armada-xp-gp-u-boot.dtsi deleted file mode 100644 index 2422856616a..00000000000 --- a/arch/arm/dts/armada-xp-gp-u-boot.dtsi +++ /dev/null @@ -1,19 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0+ - -/ { - soc { - internal-regs { - serial@12000 { - u-boot,dm-pre-reloc; - }; - }; - }; -}; - -&spi0 { - u-boot,dm-pre-reloc; - - spi-flash@0 { - u-boot,dm-pre-reloc; - }; -}; diff --git a/arch/arm/dts/armada-xp-maxbcm.dts b/arch/arm/dts/armada-xp-maxbcm.dts index d2b07f74cf5..b0b04842cc5 100644 --- a/arch/arm/dts/armada-xp-maxbcm.dts +++ b/arch/arm/dts/armada-xp-maxbcm.dts @@ -151,7 +151,6 @@ internal-regs { serial@12000 { status = "okay"; - u-boot,dm-pre-reloc; }; serial@12100 { status = "okay"; diff --git a/arch/arm/dts/armada-xp-synology-ds414-u-boot.dtsi b/arch/arm/dts/armada-xp-synology-ds414-u-boot.dtsi deleted file mode 100644 index 22fae16c9d0..00000000000 --- a/arch/arm/dts/armada-xp-synology-ds414-u-boot.dtsi +++ /dev/null @@ -1,9 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0+ - -&spi0 { - u-boot,dm-pre-reloc; - - spi-flash@0 { - u-boot,dm-pre-reloc; - }; -}; diff --git a/arch/arm/dts/armada-xp-synology-ds414.dts b/arch/arm/dts/armada-xp-synology-ds414.dts index 35909e3c69c..fdc9b47bdd7 100644 --- a/arch/arm/dts/armada-xp-synology-ds414.dts +++ b/arch/arm/dts/armada-xp-synology-ds414.dts @@ -78,7 +78,6 @@ */ serial@12000 { status = "okay"; - u-boot,dm-pre-reloc; }; /* Connected to a Microchip PIC16F883 for power control */ diff --git a/arch/arm/dts/armada-xp-theadorable.dts b/arch/arm/dts/armada-xp-theadorable.dts index a06a65af158..2f6aa194cf0 100644 --- a/arch/arm/dts/armada-xp-theadorable.dts +++ b/arch/arm/dts/armada-xp-theadorable.dts @@ -88,7 +88,6 @@ internal-regs { serial@12000 { status = "okay"; - u-boot,dm-pre-reloc; }; serial@12100 { @@ -170,10 +169,8 @@ &spi0 { status = "okay"; - u-boot,dm-pre-reloc; spi-flash@0 { - u-boot,dm-pre-reloc; #address-cells = <1>; #size-cells = <1>; compatible = "n25q128a13", "jedec,spi-nor"; diff --git a/arch/arm/dts/armada-xp.dtsi b/arch/arm/dts/armada-xp.dtsi index fb5640bbd93..3bd72f17390 100644 --- a/arch/arm/dts/armada-xp.dtsi +++ b/arch/arm/dts/armada-xp.dtsi @@ -29,7 +29,6 @@ soc { compatible = "marvell,armadaxp-mbus", "simple-bus"; - u-boot,dm-pre-reloc; bootrom { compatible = "marvell,bootrom"; -- cgit v1.2.3 From e49a55af8b6ad632520b4d625330ad8797ae98ca Mon Sep 17 00:00:00 2001 From: Pali Rohár Date: Wed, 3 Aug 2022 13:00:52 +0200 Subject: arm: mvebu: armada-xp-theadorable.dts: Move u-boot, dm-pre-reloc to -u-boot.dtsi Move U-Boot specific device tree property u-boot,dm-pre-reloc into U-Boot specific device tree include file armada-xp-theadorable-u-boot.dtsi. Signed-off-by: Pali Rohár Reviewed-by: Stefan Roese Tested-by: Stefan Roese --- arch/arm/dts/armada-xp-theadorable-u-boot.dtsi | 5 +++++ arch/arm/dts/armada-xp-theadorable.dts | 1 - 2 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 arch/arm/dts/armada-xp-theadorable-u-boot.dtsi (limited to 'arch/arm') diff --git a/arch/arm/dts/armada-xp-theadorable-u-boot.dtsi b/arch/arm/dts/armada-xp-theadorable-u-boot.dtsi new file mode 100644 index 00000000000..c98bfa1e18d --- /dev/null +++ b/arch/arm/dts/armada-xp-theadorable-u-boot.dtsi @@ -0,0 +1,5 @@ +&lcd0 { + u-boot,dm-pre-reloc; +}; + +#include "mvebu-u-boot.dtsi" diff --git a/arch/arm/dts/armada-xp-theadorable.dts b/arch/arm/dts/armada-xp-theadorable.dts index 2f6aa194cf0..ba73386d4f0 100644 --- a/arch/arm/dts/armada-xp-theadorable.dts +++ b/arch/arm/dts/armada-xp-theadorable.dts @@ -134,7 +134,6 @@ compatible = "marvell,armada-xp-lcd"; reg = <0xe0000 0x10000>; status = "okay"; - u-boot,dm-pre-reloc; display-timings { native-mode = <&timing0>; -- cgit v1.2.3 From c8ef618ae1ab00bb491c14449f44c92047ede3d7 Mon Sep 17 00:00:00 2001 From: Pali Rohár Date: Wed, 3 Aug 2022 13:00:53 +0200 Subject: arm: mvebu: armada-38x-controlcenterdc.dts: Move u-boot, dm-pre-reloc to -u-boot.dtsi Move U-Boot specific device tree property u-boot,dm-pre-reloc into U-Boot specific device tree include file armada-38x-controlcenterdc-u-boot.dtsi. Signed-off-by: Pali Rohár Reviewed-by: Stefan Roese --- .../arm/dts/armada-38x-controlcenterdc-u-boot.dtsi | 25 ++++++++++++++++++++++ arch/arm/dts/armada-38x-controlcenterdc.dts | 16 -------------- 2 files changed, 25 insertions(+), 16 deletions(-) create mode 100644 arch/arm/dts/armada-38x-controlcenterdc-u-boot.dtsi (limited to 'arch/arm') diff --git a/arch/arm/dts/armada-38x-controlcenterdc-u-boot.dtsi b/arch/arm/dts/armada-38x-controlcenterdc-u-boot.dtsi new file mode 100644 index 00000000000..0a94df92305 --- /dev/null +++ b/arch/arm/dts/armada-38x-controlcenterdc-u-boot.dtsi @@ -0,0 +1,25 @@ +&gpio0 { + u-boot,dm-pre-reloc; +}; + +&gpio1 { + u-boot,dm-pre-reloc; +}; + +&uart1 { + u-boot,dm-pre-reloc; +}; + +&spi1 { + u-boot,dm-pre-reloc; +}; + +&I2C0 { + u-boot,dm-pre-reloc; +}; + +&PCA22 { + u-boot,dm-pre-reloc; +}; + +#include "mvebu-u-boot.dtsi" diff --git a/arch/arm/dts/armada-38x-controlcenterdc.dts b/arch/arm/dts/armada-38x-controlcenterdc.dts index b5d76f8b22d..79ea6f09095 100644 --- a/arch/arm/dts/armada-38x-controlcenterdc.dts +++ b/arch/arm/dts/armada-38x-controlcenterdc.dts @@ -16,18 +16,6 @@ #include "armada-388.dtsi" -&gpio0 { - u-boot,dm-pre-reloc; -}; - -&gpio1 { - u-boot,dm-pre-reloc; -}; - -&uart1 { - u-boot,dm-pre-reloc; -}; - / { model = "Controlcenter Digital Compact"; compatible = "marvell,a385-db", "marvell,armada388", @@ -71,7 +59,6 @@ I2C0: i2c@11000 { status = "okay"; clock-frequency = <1000000>; - u-boot,dm-pre-reloc; PCA21: pca9698@21 { compatible = "nxp,pca9698"; reg = <0x21>; @@ -80,7 +67,6 @@ }; PCA22: pca9698@22 { compatible = "nxp,pca9698"; - u-boot,dm-pre-reloc; reg = <0x22>; #gpio-cells = <2>; gpio-controller; @@ -565,7 +551,6 @@ &spi1 { status = "okay"; - u-boot,dm-pre-reloc; spi-flash@0 { #address-cells = <1>; #size-cells = <1>; @@ -579,6 +564,5 @@ compatible = "n25q128a11", "jedec,spi-nor"; reg = <1>; /* Chip select 1 */ spi-max-frequency = <108000000>; - u-boot,dm-pre-reloc; }; }; -- cgit v1.2.3 From d1471948f336be8cd754cdc2d826e47e8d3e6c2c Mon Sep 17 00:00:00 2001 From: Chris Packham Date: Thu, 4 Aug 2022 21:06:23 +1200 Subject: ARM: kirkwood: SBx81LIFKW: remove direct access of GPIO registers Replace code that accessed the GPIO registers directly with code that makes use of the LED_GPIO driver. Signed-off-by: Chris Packham Reviewed-by: Stefan Roese --- arch/arm/dts/kirkwood-atl-sbx81lifkw.dts | 14 ++++++++ board/alliedtelesis/SBx81LIFKW/sbx81lifkw.c | 50 +++++++---------------------- configs/SBx81LIFKW_defconfig | 2 ++ 3 files changed, 27 insertions(+), 39 deletions(-) (limited to 'arch/arm') diff --git a/arch/arm/dts/kirkwood-atl-sbx81lifkw.dts b/arch/arm/dts/kirkwood-atl-sbx81lifkw.dts index 4ae74f4316e..3837c8f77fe 100644 --- a/arch/arm/dts/kirkwood-atl-sbx81lifkw.dts +++ b/arch/arm/dts/kirkwood-atl-sbx81lifkw.dts @@ -70,6 +70,20 @@ }; }; }; + + gpio-leds { + compatible = "gpio-leds"; + + ledn { + label = "status:ledn"; + gpios = <&gpio0 10 GPIO_ACTIVE_HIGH>; + }; + + ledp { + label = "status:ledp"; + gpios = <&gpio0 18 GPIO_ACTIVE_HIGH>; + }; + }; }; &spi0 { diff --git a/board/alliedtelesis/SBx81LIFKW/sbx81lifkw.c b/board/alliedtelesis/SBx81LIFKW/sbx81lifkw.c index d8b9fdfe356..feb8b6b83f0 100644 --- a/board/alliedtelesis/SBx81LIFKW/sbx81lifkw.c +++ b/board/alliedtelesis/SBx81LIFKW/sbx81lifkw.c @@ -13,7 +13,7 @@ #include #include #include -#include +#include #include #include #include @@ -41,41 +41,6 @@ DECLARE_GLOBAL_DATA_PTR; -struct led { - u32 reg; - u32 value; - u32 mask; -}; - -struct led amber_solid = { - MVEBU_GPIO0_BASE, - BIT(10), - BIT(18) | BIT(10) -}; - -struct led green_solid = { - MVEBU_GPIO0_BASE, - BIT(18) | BIT(10), - BIT(18) | BIT(10) -}; - -struct led amber_flash = { - MVEBU_GPIO0_BASE, - 0, - BIT(18) | BIT(10) -}; - -struct led green_flash = { - MVEBU_GPIO0_BASE, - BIT(18), - BIT(18) | BIT(10) -}; - -static void status_led_set(struct led *led) -{ - clrsetbits_le32(led->reg, led->mask, led->value); -} - int board_early_init_f(void) { /* @@ -165,8 +130,6 @@ int board_init(void) /* address of boot parameters */ gd->bd->bi_boot_params = mvebu_sdram_bar(0) + 0x100; - status_led_set(&amber_solid); - return 0; } @@ -196,7 +159,16 @@ int mv88e61xx_hw_reset(struct phy_device *phydev) #ifdef CONFIG_MISC_INIT_R int misc_init_r(void) { - status_led_set(&green_flash); + struct udevice *dev; + int ret; + + ret = led_get_by_label("status:ledp", &dev); + if (!ret) + led_set_state(dev, LEDST_ON); + + ret = led_get_by_label("status:ledn", &dev); + if (!ret) + led_set_state(dev, LEDST_OFF); return 0; } diff --git a/configs/SBx81LIFKW_defconfig b/configs/SBx81LIFKW_defconfig index f186f247eb6..90800e2dd3e 100644 --- a/configs/SBx81LIFKW_defconfig +++ b/configs/SBx81LIFKW_defconfig @@ -46,6 +46,8 @@ CONFIG_DM_I2C=y CONFIG_SYS_I2C_MVTWSI=y CONFIG_I2C_MUX=y CONFIG_I2C_MUX_PCA954x=y +CONFIG_LED=y +CONFIG_LED_GPIO=y # CONFIG_MMC is not set CONFIG_MTD=y CONFIG_DM_SPI_FLASH=y -- cgit v1.2.3