[U-Boot,01/16] dts: Create a dtsi for BCM2835/6/7 specific configuration
diff mbox series

Message ID 20190716133803.1174-2-andrei@gherzan.ro
State Superseded
Delegated to: Matthias Brugger
Headers show
Series
  • Raspberry Pi 32/64 support
Related show

Commit Message

Andrei Gherzan July 16, 2019, 1:37 p.m. UTC
From: Andrei Gherzan <andrei@gherzan.ro>

This follows a similar change in kernel[1]. The change moves
configuration that was not applicable for all bcm2835/6/7/8 out of
bcm283x.dtsi. The new file is bcm2835-common.dtsi and contains
conifguration that is common for bcm2835/6/7 (not bcm2838).

[1] https://github.com/raspberrypi/linux/commit/769a7330aa5bebcc98b1ff12ecb767db4e5c644d#diff-5979fba23a5bab2cf66dde09db872dfc

Signed-off-by: Andrei Gherzan <andrei@gherzan.ro>
---
 arch/arm/dts/bcm2835-common.dtsi | 53 ++++++++++++++++++++++++++++++++
 arch/arm/dts/bcm2835.dtsi        |  1 +
 arch/arm/dts/bcm2836.dtsi        |  1 +
 arch/arm/dts/bcm2837.dtsi        |  1 +
 arch/arm/dts/bcm283x.dtsi        | 45 +--------------------------
 5 files changed, 57 insertions(+), 44 deletions(-)
 create mode 100644 arch/arm/dts/bcm2835-common.dtsi

Comments

Matthias Brugger July 16, 2019, 2:20 p.m. UTC | #1
On 16/07/2019 15:37, andrei@gherzan.ro wrote:
> From: Andrei Gherzan <andrei@gherzan.ro>
> 
> This follows a similar change in kernel[1]. The change moves
> configuration that was not applicable for all bcm2835/6/7/8 out of
> bcm283x.dtsi. The new file is bcm2835-common.dtsi and contains
> conifguration that is common for bcm2835/6/7 (not bcm2838).
> 
> [1] https://github.com/raspberrypi/linux/commit/769a7330aa5bebcc98b1ff12ecb767db4e5c644d#diff-5979fba23a5bab2cf66dde09db872dfc
> 
> Signed-off-by: Andrei Gherzan <andrei@gherzan.ro>

My opinion is that we should wait for official dts instead of using some
work-in-progress ones. So my opinion is to use the DTB from the FW for now until
we have something stable.

> ---
>  arch/arm/dts/bcm2835-common.dtsi | 53 ++++++++++++++++++++++++++++++++
>  arch/arm/dts/bcm2835.dtsi        |  1 +
>  arch/arm/dts/bcm2836.dtsi        |  1 +
>  arch/arm/dts/bcm2837.dtsi        |  1 +
>  arch/arm/dts/bcm283x.dtsi        | 45 +--------------------------
>  5 files changed, 57 insertions(+), 44 deletions(-)
>  create mode 100644 arch/arm/dts/bcm2835-common.dtsi
> 
> diff --git a/arch/arm/dts/bcm2835-common.dtsi b/arch/arm/dts/bcm2835-common.dtsi
> new file mode 100644
> index 0000000000..17771730a3
> --- /dev/null
> +++ b/arch/arm/dts/bcm2835-common.dtsi
> @@ -0,0 +1,53 @@
> +// SPDX-License-Identifier: GPL-2.0
> +
> +/* This include file covers the common peripherals and configuration between
> + * bcm2835, bcm2836 and bcm2837 implementations.
> + */
> +
> +/ {
> +	soc {
> +		timer@7e003000 {
> +			compatible = "brcm,bcm2835-system-timer";
> +			reg = <0x7e003000 0x1000>;
> +			interrupts = <1 0>, <1 1>, <1 2>, <1 3>;
> +			/* This could be a reference to BCM2835_CLOCK_TIMER,
> +			 * but we don't have the driver using the common clock
> +			 * support yet.
> +			 */
> +			clock-frequency = <1000000>;
> +		};
> +
> +		intc: interrupt-controller@7e00b200 {
> +			compatible = "brcm,bcm2835-armctrl-ic";
> +			reg = <0x7e00b200 0x200>;
> +			interrupt-controller;
> +			#interrupt-cells = <2>;
> +		};
> +
> +		thermal: thermal@7e212000 {
> +			compatible = "brcm,bcm2835-thermal";
> +			reg = <0x7e212000 0x8>;
> +			clocks = <&clocks BCM2835_CLOCK_TSENS>;
> +			#thermal-sensor-cells = <0>;
> +			status = "disabled";
> +		};
> +
> +		v3d: v3d@7ec00000 {
> +			compatible = "brcm,bcm2835-v3d";
> +			reg = <0x7ec00000 0x1000>;
> +			interrupts = <1 10>;
> +		};
> +	};
> +};
> +
> +&gpio {
> +	i2c_slave_gpio18: i2c_slave_gpio18 {
> +		brcm,pins = <18 19 20 21>;
> +		brcm,function = <BCM2835_FSEL_ALT3>;
> +	};
> +
> +	jtag_gpio4: jtag_gpio4 {
> +		brcm,pins = <4 5 6 12 13>;
> +		brcm,function = <BCM2835_FSEL_ALT5>;
> +	};
> +};
> diff --git a/arch/arm/dts/bcm2835.dtsi b/arch/arm/dts/bcm2835.dtsi
> index a5c3824c80..53bf4579cc 100644
> --- a/arch/arm/dts/bcm2835.dtsi
> +++ b/arch/arm/dts/bcm2835.dtsi
> @@ -1,5 +1,6 @@
>  // SPDX-License-Identifier: GPL-2.0
>  #include "bcm283x.dtsi"
> +#include "bcm2835-common.dtsi"
>  
>  / {
>  	compatible = "brcm,bcm2835";
> diff --git a/arch/arm/dts/bcm2836.dtsi b/arch/arm/dts/bcm2836.dtsi
> index c933e84138..82d6c4662a 100644
> --- a/arch/arm/dts/bcm2836.dtsi
> +++ b/arch/arm/dts/bcm2836.dtsi
> @@ -1,5 +1,6 @@
>  // SPDX-License-Identifier: GPL-2.0
>  #include "bcm283x.dtsi"
> +#include "bcm2835-common.dtsi"
>  
>  / {
>  	compatible = "brcm,bcm2836";
> diff --git a/arch/arm/dts/bcm2837.dtsi b/arch/arm/dts/bcm2837.dtsi
> index beb6c502da..9e95fee78e 100644
> --- a/arch/arm/dts/bcm2837.dtsi
> +++ b/arch/arm/dts/bcm2837.dtsi
> @@ -1,4 +1,5 @@
>  #include "bcm283x.dtsi"
> +#include "bcm2835-common.dtsi"
>  
>  / {
>  	compatible = "brcm,bcm2837";
> diff --git a/arch/arm/dts/bcm283x.dtsi b/arch/arm/dts/bcm283x.dtsi
> index 9777644c6c..a024727e4d 100644
> --- a/arch/arm/dts/bcm283x.dtsi
> +++ b/arch/arm/dts/bcm283x.dtsi
> @@ -56,17 +56,6 @@
>  		#address-cells = <1>;
>  		#size-cells = <1>;
>  
> -		timer@7e003000 {
> -			compatible = "brcm,bcm2835-system-timer";
> -			reg = <0x7e003000 0x1000>;
> -			interrupts = <1 0>, <1 1>, <1 2>, <1 3>;
> -			/* This could be a reference to BCM2835_CLOCK_TIMER,
> -			 * but we don't have the driver using the common clock
> -			 * support yet.
> -			 */
> -			clock-frequency = <1000000>;
> -		};
> -
>  		txp@7e004000 {
>  			compatible = "brcm,bcm2835-txp";
>  			reg = <0x7e004000 0x20>;
> @@ -114,13 +103,6 @@
>  			brcm,dma-channel-mask = <0x7f35>;
>  		};
>  
> -		intc: interrupt-controller@7e00b200 {
> -			compatible = "brcm,bcm2835-armctrl-ic";
> -			reg = <0x7e00b200 0x200>;
> -			interrupt-controller;
> -			#interrupt-cells = <2>;
> -		};
> -
>  		pm: watchdog@7e100000 {
>  			compatible = "brcm,bcm2835-pm", "brcm,bcm2835-pm-wdt";
>  			#power-domain-cells = <1>;
> @@ -184,8 +166,7 @@
>  			interrupt-controller;
>  			#interrupt-cells = <2>;
>  
> -			/* Defines pin muxing groups according to
> -			 * BCM2835-ARM-Peripherals.pdf page 102.
> +			/* Defines common pin muxing groups
>  			 *
>  			 * While each pin can have its mux selected
>  			 * for various functions individually, some
> @@ -263,15 +244,6 @@
>  				brcm,pins = <44 45>;
>  				brcm,function = <BCM2835_FSEL_ALT2>;
>  			};
> -			i2c_slave_gpio18: i2c_slave_gpio18 {
> -				brcm,pins = <18 19 20 21>;
> -				brcm,function = <BCM2835_FSEL_ALT3>;
> -			};
> -
> -			jtag_gpio4: jtag_gpio4 {
> -				brcm,pins = <4 5 6 12 13>;
> -				brcm,function = <BCM2835_FSEL_ALT5>;
> -			};
>  			jtag_gpio22: jtag_gpio22 {
>  				brcm,pins = <22 23 24 25 26 27>;
>  				brcm,function = <BCM2835_FSEL_ALT4>;
> @@ -488,14 +460,6 @@
>  
>  		};
>  
> -		thermal: thermal@7e212000 {
> -			compatible = "brcm,bcm2835-thermal";
> -			reg = <0x7e212000 0x8>;
> -			clocks = <&clocks BCM2835_CLOCK_TSENS>;
> -			#thermal-sensor-cells = <0>;
> -			status = "disabled";
> -		};
> -
>  		aux: aux@7e215000 {
>  			compatible = "brcm,bcm2835-aux";
>  			#clock-cells = <1>;
> @@ -635,13 +599,6 @@
>  			phy-names = "usb2-phy";
>  		};
>  
> -		v3d: v3d@7ec00000 {
> -			compatible = "brcm,bcm2835-v3d";
> -			reg = <0x7ec00000 0x1000>;
> -			interrupts = <1 10>;
> -			power-domains = <&pm BCM2835_POWER_DOMAIN_GRAFX_V3D>;
> -		};
> -
>  		vc4: gpu {
>  			compatible = "brcm,bcm2835-vc4";
>  		};
>

Patch
diff mbox series

diff --git a/arch/arm/dts/bcm2835-common.dtsi b/arch/arm/dts/bcm2835-common.dtsi
new file mode 100644
index 0000000000..17771730a3
--- /dev/null
+++ b/arch/arm/dts/bcm2835-common.dtsi
@@ -0,0 +1,53 @@ 
+// SPDX-License-Identifier: GPL-2.0
+
+/* This include file covers the common peripherals and configuration between
+ * bcm2835, bcm2836 and bcm2837 implementations.
+ */
+
+/ {
+	soc {
+		timer@7e003000 {
+			compatible = "brcm,bcm2835-system-timer";
+			reg = <0x7e003000 0x1000>;
+			interrupts = <1 0>, <1 1>, <1 2>, <1 3>;
+			/* This could be a reference to BCM2835_CLOCK_TIMER,
+			 * but we don't have the driver using the common clock
+			 * support yet.
+			 */
+			clock-frequency = <1000000>;
+		};
+
+		intc: interrupt-controller@7e00b200 {
+			compatible = "brcm,bcm2835-armctrl-ic";
+			reg = <0x7e00b200 0x200>;
+			interrupt-controller;
+			#interrupt-cells = <2>;
+		};
+
+		thermal: thermal@7e212000 {
+			compatible = "brcm,bcm2835-thermal";
+			reg = <0x7e212000 0x8>;
+			clocks = <&clocks BCM2835_CLOCK_TSENS>;
+			#thermal-sensor-cells = <0>;
+			status = "disabled";
+		};
+
+		v3d: v3d@7ec00000 {
+			compatible = "brcm,bcm2835-v3d";
+			reg = <0x7ec00000 0x1000>;
+			interrupts = <1 10>;
+		};
+	};
+};
+
+&gpio {
+	i2c_slave_gpio18: i2c_slave_gpio18 {
+		brcm,pins = <18 19 20 21>;
+		brcm,function = <BCM2835_FSEL_ALT3>;
+	};
+
+	jtag_gpio4: jtag_gpio4 {
+		brcm,pins = <4 5 6 12 13>;
+		brcm,function = <BCM2835_FSEL_ALT5>;
+	};
+};
diff --git a/arch/arm/dts/bcm2835.dtsi b/arch/arm/dts/bcm2835.dtsi
index a5c3824c80..53bf4579cc 100644
--- a/arch/arm/dts/bcm2835.dtsi
+++ b/arch/arm/dts/bcm2835.dtsi
@@ -1,5 +1,6 @@ 
 // SPDX-License-Identifier: GPL-2.0
 #include "bcm283x.dtsi"
+#include "bcm2835-common.dtsi"
 
 / {
 	compatible = "brcm,bcm2835";
diff --git a/arch/arm/dts/bcm2836.dtsi b/arch/arm/dts/bcm2836.dtsi
index c933e84138..82d6c4662a 100644
--- a/arch/arm/dts/bcm2836.dtsi
+++ b/arch/arm/dts/bcm2836.dtsi
@@ -1,5 +1,6 @@ 
 // SPDX-License-Identifier: GPL-2.0
 #include "bcm283x.dtsi"
+#include "bcm2835-common.dtsi"
 
 / {
 	compatible = "brcm,bcm2836";
diff --git a/arch/arm/dts/bcm2837.dtsi b/arch/arm/dts/bcm2837.dtsi
index beb6c502da..9e95fee78e 100644
--- a/arch/arm/dts/bcm2837.dtsi
+++ b/arch/arm/dts/bcm2837.dtsi
@@ -1,4 +1,5 @@ 
 #include "bcm283x.dtsi"
+#include "bcm2835-common.dtsi"
 
 / {
 	compatible = "brcm,bcm2837";
diff --git a/arch/arm/dts/bcm283x.dtsi b/arch/arm/dts/bcm283x.dtsi
index 9777644c6c..a024727e4d 100644
--- a/arch/arm/dts/bcm283x.dtsi
+++ b/arch/arm/dts/bcm283x.dtsi
@@ -56,17 +56,6 @@ 
 		#address-cells = <1>;
 		#size-cells = <1>;
 
-		timer@7e003000 {
-			compatible = "brcm,bcm2835-system-timer";
-			reg = <0x7e003000 0x1000>;
-			interrupts = <1 0>, <1 1>, <1 2>, <1 3>;
-			/* This could be a reference to BCM2835_CLOCK_TIMER,
-			 * but we don't have the driver using the common clock
-			 * support yet.
-			 */
-			clock-frequency = <1000000>;
-		};
-
 		txp@7e004000 {
 			compatible = "brcm,bcm2835-txp";
 			reg = <0x7e004000 0x20>;
@@ -114,13 +103,6 @@ 
 			brcm,dma-channel-mask = <0x7f35>;
 		};
 
-		intc: interrupt-controller@7e00b200 {
-			compatible = "brcm,bcm2835-armctrl-ic";
-			reg = <0x7e00b200 0x200>;
-			interrupt-controller;
-			#interrupt-cells = <2>;
-		};
-
 		pm: watchdog@7e100000 {
 			compatible = "brcm,bcm2835-pm", "brcm,bcm2835-pm-wdt";
 			#power-domain-cells = <1>;
@@ -184,8 +166,7 @@ 
 			interrupt-controller;
 			#interrupt-cells = <2>;
 
-			/* Defines pin muxing groups according to
-			 * BCM2835-ARM-Peripherals.pdf page 102.
+			/* Defines common pin muxing groups
 			 *
 			 * While each pin can have its mux selected
 			 * for various functions individually, some
@@ -263,15 +244,6 @@ 
 				brcm,pins = <44 45>;
 				brcm,function = <BCM2835_FSEL_ALT2>;
 			};
-			i2c_slave_gpio18: i2c_slave_gpio18 {
-				brcm,pins = <18 19 20 21>;
-				brcm,function = <BCM2835_FSEL_ALT3>;
-			};
-
-			jtag_gpio4: jtag_gpio4 {
-				brcm,pins = <4 5 6 12 13>;
-				brcm,function = <BCM2835_FSEL_ALT5>;
-			};
 			jtag_gpio22: jtag_gpio22 {
 				brcm,pins = <22 23 24 25 26 27>;
 				brcm,function = <BCM2835_FSEL_ALT4>;
@@ -488,14 +460,6 @@ 
 
 		};
 
-		thermal: thermal@7e212000 {
-			compatible = "brcm,bcm2835-thermal";
-			reg = <0x7e212000 0x8>;
-			clocks = <&clocks BCM2835_CLOCK_TSENS>;
-			#thermal-sensor-cells = <0>;
-			status = "disabled";
-		};
-
 		aux: aux@7e215000 {
 			compatible = "brcm,bcm2835-aux";
 			#clock-cells = <1>;
@@ -635,13 +599,6 @@ 
 			phy-names = "usb2-phy";
 		};
 
-		v3d: v3d@7ec00000 {
-			compatible = "brcm,bcm2835-v3d";
-			reg = <0x7ec00000 0x1000>;
-			interrupts = <1 10>;
-			power-domains = <&pm BCM2835_POWER_DOMAIN_GRAFX_V3D>;
-		};
-
 		vc4: gpu {
 			compatible = "brcm,bcm2835-vc4";
 		};