From 105630314887e63e95590ec4db07ed3b00e77aa1 Mon Sep 17 00:00:00 2001 From: Patrice Chotard Date: Thu, 6 Dec 2018 11:59:42 +0100 Subject: [PATCH] ARM: dts: Migrate U-boot nodes to U-boot DT files for stm32h7 In order to prepare and ease future DT synchronization with kernel DT, migrate all U-boot specific nodes/properties/addons to U-boot DT files. As sdmmc is not yet supported on kernel side, sdmmc nodes are located in eval-u-boot and disco-u-boot DT files. Signed-off-by: Patrice Chotard --- arch/arm/dts/stm32h7-u-boot.dtsi | 167 ++++++++++++++++++++-- arch/arm/dts/stm32h743-pinctrl.dtsi | 97 +------------ arch/arm/dts/stm32h743.dtsi | 18 --- arch/arm/dts/stm32h743i-disco-u-boot.dtsi | 11 ++ arch/arm/dts/stm32h743i-disco.dts | 39 ----- arch/arm/dts/stm32h743i-eval-u-boot.dtsi | 12 ++ arch/arm/dts/stm32h743i-eval.dts | 40 ------ 7 files changed, 183 insertions(+), 201 deletions(-) create mode 100644 arch/arm/dts/stm32h743i-disco-u-boot.dtsi create mode 100644 arch/arm/dts/stm32h743i-eval-u-boot.dtsi diff --git a/arch/arm/dts/stm32h7-u-boot.dtsi b/arch/arm/dts/stm32h7-u-boot.dtsi index 2525035da1..6e5b805a97 100644 --- a/arch/arm/dts/stm32h7-u-boot.dtsi +++ b/arch/arm/dts/stm32h7-u-boot.dtsi @@ -1,13 +1,66 @@ +// SPDX-License-Identifier: GPL-2.0+ + +#include + /{ clocks { u-boot,dm-pre-reloc; }; + aliases { + gpio0 = &gpioa; + gpio1 = &gpiob; + gpio2 = &gpioc; + gpio3 = &gpiod; + gpio4 = &gpioe; + gpio5 = &gpiof; + gpio6 = &gpiog; + gpio7 = &gpioh; + gpio8 = &gpioi; + gpio9 = &gpioj; + gpio10 = &gpiok; + mmc0 = &sdmmc1; + }; + soc { u-boot,dm-pre-reloc; pin-controller { u-boot,dm-pre-reloc; }; + + fmc: fmc@52004000 { + compatible = "st,stm32h7-fmc"; + reg = <0x52004000 0x1000>; + clocks = <&rcc FMC_CK>; + + pinctrl-0 = <&fmc_pins>; + pinctrl-names = "default"; + status = "okay"; + + /* + * Memory configuration from sdram datasheet IS42S32800G-6BLI + * firsct bank is bank@0 + * second bank is bank@1 + */ + bank1: bank@1 { + st,sdram-control = /bits/ 8 ; + st,sdram-timing = /bits/ 8 ; + st,sdram-refcount = <1539>; + }; + }; + + sdmmc1: sdmmc@52007000 { + compatible = "st,stm32-sdmmc2"; + reg = <0x52007000 0x1000>; + interrupts = <49>; + clocks = <&rcc SDMMC1_CK>; + resets = <&rcc STM32H7_AHB3_RESET(SDMMC1)>; + st,idma = <1>; + cap-sd-highspeed; + cap-mmc-highspeed; + }; }; }; @@ -15,21 +68,14 @@ u-boot,dm-pre-reloc; }; -&clk_lse { - u-boot,dm-pre-reloc; -}; - &clk_i2s { u-boot,dm-pre-reloc; }; -&pwrcfg { +&clk_lse { u-boot,dm-pre-reloc; }; -&rcc { - u-boot,dm-pre-reloc; -}; &fmc { u-boot,dm-pre-reloc; @@ -86,3 +132,108 @@ &gpiok { u-boot,dm-pre-reloc; }; + +&pinctrl { + fmc_pins: fmc@0 { + pins { + pinmux = , + , + , + , + , + , + , + + , + , + , + , + , + , + , + , + , + , + , + + , + , + , + , + , + , + , + , + , + , + , + + , + , + , + , + , + , + , + + , + , + , + , + , + , + , + , + , + , + , + + , + , + , + , + , + , + , + , + , + ; + + slew-rate = <3>; + }; + }; + + pinctrl_sdmmc1_level_shifter: sdmmc0_ls@0 { + pins { + pinmux = , + , + , + ; + drive-push-pull; + slew-rate = <3>; + }; + }; + + sdmmc1_pins: sdmmc@0 { + pins { + pinmux = , + , + , + , + , + ; + + slew-rate = <3>; + drive-push-pull; + bias-disable; + }; + }; +}; + +&pwrcfg { + u-boot,dm-pre-reloc; +}; + +&rcc { + u-boot,dm-pre-reloc; +}; diff --git a/arch/arm/dts/stm32h743-pinctrl.dtsi b/arch/arm/dts/stm32h743-pinctrl.dtsi index e4f4aa579b..85b96be99b 100644 --- a/arch/arm/dts/stm32h743-pinctrl.dtsi +++ b/arch/arm/dts/stm32h743-pinctrl.dtsi @@ -44,7 +44,7 @@ / { soc { - pin-controller { + pinctrl: pin-controller { #address-cells = <1>; #size-cells = <1>; compatible = "st,stm32h743-pinctrl"; @@ -175,101 +175,6 @@ bias-disable; }; }; - - fmc_pins: fmc@0 { - pins { - pinmux = , - , - , - , - , - , - , - - , - , - , - , - , - , - , - , - , - , - , - - , - , - , - , - , - , - , - , - , - , - , - - , - , - , - , - , - , - , - - , - , - , - , - , - , - , - , - , - , - , - - , - , - , - , - , - , - , - , - , - ; - - slew-rate = <3>; - }; - }; - - sdmmc1_pins: sdmmc@0 { - pins { - pinmux = , - , - , - , - , - ; - - slew-rate = <3>; - drive-push-pull; - bias-disable; - }; - }; - - pinctrl_sdmmc1_level_shifter: sdmmc0_ls@0 { - pins { - pinmux = , - , - , - ; - drive-push-pull; - slew-rate = <3>; - }; - }; }; }; }; diff --git a/arch/arm/dts/stm32h743.dtsi b/arch/arm/dts/stm32h743.dtsi index d5b8d879ee..23e185cf11 100644 --- a/arch/arm/dts/stm32h743.dtsi +++ b/arch/arm/dts/stm32h743.dtsi @@ -104,12 +104,6 @@ reg = <0x58024800 0x400>; }; - fmc: fmc@52004000 { - compatible = "st,stm32h7-fmc"; - reg = <0x52004000 0x1000>; - clocks = <&rcc FMC_CK>; - }; - clk_hsi: clk-hsi { #clock-cells = <0>; compatible = "fixed-clock"; @@ -121,18 +115,6 @@ compatible = "fixed-clock"; clock-frequency = <4000000>; }; - - sdmmc1: sdmmc@52007000 { - compatible = "st,stm32-sdmmc2"; - reg = <0x52007000 0x1000>; - interrupts = <49>; - clocks = <&rcc SDMMC1_CK>; - resets = <&rcc STM32H7_AHB3_RESET(SDMMC1)>; - st,idma = <1>; - cap-sd-highspeed; - cap-mmc-highspeed; - status = "disabled"; - }; }; }; diff --git a/arch/arm/dts/stm32h743i-disco-u-boot.dtsi b/arch/arm/dts/stm32h743i-disco-u-boot.dtsi new file mode 100644 index 0000000000..2d6b41bfb9 --- /dev/null +++ b/arch/arm/dts/stm32h743i-disco-u-boot.dtsi @@ -0,0 +1,11 @@ +// SPDX-License-Identifier: GPL-2.0+ + +#include + +&sdmmc1 { + status = "okay"; + pinctrl-0 = <&sdmmc1_pins>; + pinctrl-names = "default"; + bus-width = <4>; + cd-gpios = <&gpioi 8 1>; +}; diff --git a/arch/arm/dts/stm32h743i-disco.dts b/arch/arm/dts/stm32h743i-disco.dts index 917a859a09..1237a814a4 100644 --- a/arch/arm/dts/stm32h743i-disco.dts +++ b/arch/arm/dts/stm32h743i-disco.dts @@ -43,7 +43,6 @@ /dts-v1/; #include "stm32h743.dtsi" #include "stm32h743-pinctrl.dtsi" -#include / { model = "STMicroelectronics STM32H743i-Discovery board"; @@ -60,18 +59,6 @@ aliases { serial0 = &usart2; - mmc0 = &sdmmc1; - gpio0 = &gpioa; - gpio1 = &gpiob; - gpio2 = &gpioc; - gpio3 = &gpiod; - gpio4 = &gpioe; - gpio5 = &gpiof; - gpio6 = &gpiog; - gpio7 = &gpioh; - gpio8 = &gpioi; - gpio9 = &gpioj; - gpio10 = &gpiok; }; }; @@ -81,29 +68,3 @@ status = "okay"; }; -&fmc { - pinctrl-0 = <&fmc_pins>; - pinctrl-names = "default"; - status = "okay"; - - /* - * Memory configuration from sdram datasheet IS42S32800G-6BLI - * firsct bank is bank@0 - * second bank is bank@1 - */ - bank1: bank@1 { - st,sdram-control = /bits/ 8 ; - st,sdram-timing = /bits/ 8 ; - st,sdram-refcount = <1539>; - }; -}; - -&sdmmc1 { - status = "okay"; - pinctrl-0 = <&sdmmc1_pins>; - pinctrl-names = "default"; - bus-width = <4>; - cd-gpios = <&gpioi 8 1>; -}; diff --git a/arch/arm/dts/stm32h743i-eval-u-boot.dtsi b/arch/arm/dts/stm32h743i-eval-u-boot.dtsi new file mode 100644 index 0000000000..220a2d706c --- /dev/null +++ b/arch/arm/dts/stm32h743i-eval-u-boot.dtsi @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: GPL-2.0+ + +#include + +&sdmmc1 { + status = "okay"; + pinctrl-0 = <&sdmmc1_pins>, + <&pinctrl_sdmmc1_level_shifter>; + pinctrl-names = "default"; + bus-width = <4>; + st,dirpol; +}; diff --git a/arch/arm/dts/stm32h743i-eval.dts b/arch/arm/dts/stm32h743i-eval.dts index 28c876be27..c8b6dfbdd3 100644 --- a/arch/arm/dts/stm32h743i-eval.dts +++ b/arch/arm/dts/stm32h743i-eval.dts @@ -43,7 +43,6 @@ /dts-v1/; #include "stm32h743.dtsi" #include "stm32h743-pinctrl.dtsi" -#include / { model = "STMicroelectronics STM32H743i-EVAL board"; @@ -60,17 +59,6 @@ aliases { serial0 = &usart1; - gpio0 = &gpioa; - gpio1 = &gpiob; - gpio2 = &gpioc; - gpio3 = &gpiod; - gpio4 = &gpioe; - gpio5 = &gpiof; - gpio6 = &gpiog; - gpio7 = &gpioh; - gpio8 = &gpioi; - gpio9 = &gpioj; - gpio10 = &gpiok; }; }; @@ -79,31 +67,3 @@ pinctrl-names = "default"; status = "okay"; }; - -&fmc { - pinctrl-0 = <&fmc_pins>; - pinctrl-names = "default"; - status = "okay"; - - /* - * Memory configuration from sdram datasheet IS42S32800G-6BLI - * firsct bank is bank@0 - * second bank is bank@1 - */ - bank2: bank@1 { - st,sdram-control = /bits/ 8 ; - st,sdram-timing = /bits/ 8 ; - st,sdram-refcount = <1539>; - }; -}; - -&sdmmc1 { - status = "okay"; - pinctrl-0 = <&sdmmc1_pins>, - <&pinctrl_sdmmc1_level_shifter>; - pinctrl-names = "default"; - bus-width = <4>; - st,dirpol; -}; -- 2.25.1