diff mbox

[RFC,PATCHv3,2/2] ARM: socfpga: Add DTS bindings for Altera's SOCFPGA

Message ID 20120718101316.GB7607@elf.ucw.cz (mailing list archive)
State New, archived
Headers show

Commit Message

Pavel Machek July 18, 2012, 10:13 a.m. UTC
Hi!

> > +	soc {
> > +		amba {
> > +			compatible = "arm,amba-bus";
> > +			#address-cells = <1>;
> > +			#size-cells = <1>;
> > +			ranges;
> > +
> > +			pdma: pdma@ffe01000 {
> > +				compatible = "arm,pl330", "arm,primecell";
> > +				reg = <0xffe01000 0x1000>;
> > +				interrupts = <0 180 4>;
> > +			};
> > +		};
> > +
> > +		apb_periphs {
> > +			compatible = "simple-bus";
> > +			#address-cells = <1>;
> > +			#size-cells = <1>;
> > +			ranges;
> > +
> > +			gmac0: stmmac@ff700000 {
> > +				compatible = "st,spear600-gmac";
> > +				reg = <0xff700000 0x2000>;
> > +				interrupts = <0 115 4>;
> > +				interrupt-names = "macirq";
> > +				mac-address = [00 00 00 00 00 00];/* Filled in by U-Boot */
> > +				phy-mode = "gmii";
> > +			};
> > +		};
> 
> Are the pdma and gmac0 really specific to the cyclone board? Aren't
> they similar to the uarts and timers in that they are part of the SoC
> itself?

I guess they are not. I'm not dts expert, but would something like
this be suitable? It boots :-). 

									Pavel

Comments

Thomas Petazzoni July 18, 2012, 11:19 a.m. UTC | #1
Le Wed, 18 Jul 2012 12:13:16 +0200,
Pavel Machek <pavel@denx.de> a écrit :

> > Are the pdma and gmac0 really specific to the cyclone board? Aren't
> > they similar to the uarts and timers in that they are part of the SoC
> > itself?
> 
> I guess they are not. I'm not dts expert, but would something like
> this be suitable? It boots :-). 

Well, basically, .dtsi files define what is SoC-specific, and the .dts
files defined what is board-specific.

So, things like the internal SoC peripherals will always be same on all
boards that use this SoC (UARTs, timers, Ethernet controllers, I2C
controllers, USB controllers, etc.). These belong to the .dtsi.

Things like external peripherals (devices on I2C/SPI busses) or
additional properties (how the SoC is wired on the board, which pin is
used for this or that). These belong to the .dts.

I don't have the datasheet for your socfpga, so I can't see which
peripherals are internal to the SoC and which are not, especially with
those combined SoC/FPGA designs in which some peripherals can be
synthesized into the FPGA and therefore would probably not belong to
the .dtsi.

So, assuming your Ethernet controller and DMA controller are part of
the SoC itself and will therefore be present on all boards using your
SoC, then the fix you provided looks good.

Best regards,

Thomas
diff mbox

Patch

diff --git a/arch/arm/boot/dts/socfpga.dtsi b/arch/arm/boot/dts/socfpga.dtsi
index 903d4bb..ee13a3e 100644
--- a/arch/arm/boot/dts/socfpga.dtsi
+++ b/arch/arm/boot/dts/socfpga.dtsi
@@ -115,5 +115,27 @@ 
 			reg-shift = <2>;
 			reg-io-width = <4>;
 		};
+
+		gmac0: stmmac@ff700000 {
+			compatible = "st,spear600-gmac";
+			reg = <0xff700000 0x2000>;
+			interrupts = <0 115 4>;
+			interrupt-names = "macirq";
+			mac-address = [00 00 00 00 00 00];/* Filled in by U-Boot */
+			phy-mode = "gmii";
+		};
+
+		amba {
+			compatible = "arm,amba-bus";
+			#address-cells = <1>;
+			#size-cells = <1>;
+			ranges;
+
+			pdma: pdma@ffe01000 {
+				compatible = "arm,pl330", "arm,primecell";
+				reg = <0xffe01000 0x1000>;
+				interrupts = <0 180 4>;
+			};
+		};
 	};
 };
diff --git a/arch/arm/boot/dts/socfpga_cyclone5.dts b/arch/arm/boot/dts/socfpga_cyclone5.dts
index 3433ee3..683d035 100644
--- a/arch/arm/boot/dts/socfpga_cyclone5.dts
+++ b/arch/arm/boot/dts/socfpga_cyclone5.dts
@@ -37,35 +37,4 @@ 
 		device_type = "memory";
 		reg = <0x0 0x10000000>; /* 256MB */
 	};
-
-	soc {
-		amba {
-			compatible = "arm,amba-bus";
-			#address-cells = <1>;
-			#size-cells = <1>;
-			ranges;
-
-			pdma: pdma@ffe01000 {
-				compatible = "arm,pl330", "arm,primecell";
-				reg = <0xffe01000 0x1000>;
-				interrupts = <0 180 4>;
-			};
-		};
-
-		apb_periphs {
-			compatible = "simple-bus";
-			#address-cells = <1>;
-			#size-cells = <1>;
-			ranges;
-
-			gmac0: stmmac@ff700000 {
-				compatible = "st,spear600-gmac";
-				reg = <0xff700000 0x2000>;
-				interrupts = <0 115 4>;
-				interrupt-names = "macirq";
-				mac-address = [00 00 00 00 00 00];/* Filled in by U-Boot */
-				phy-mode = "gmii";
-			};
-		};
-	};
 };