Skip to contentSkip to conversation

Device tree bindings for Xilinx devices

PATCH In review Grant Likely 4 participants 19 messages Oct 18, 2007 – Oct 24, 2007 Documentation

lore
Share & tools
lore
#0 lore raw

PATCH v3 1/1 Device tree bindings for Xilinx devices

From: Grant Likely <[email protected]>

---

 Documentation/powerpc/booting-without-of.txt |  264 ++++++++++++++++++++++++++
 1 files changed, 264 insertions(+), 0 deletions(-)
Documentation/powerpc/booting-without-of.txt +264 -0
index a96e853..d4dedf4 100644
@@ -52,6 +52,7 @@ Table of Contents
       i) Freescale QUICC Engine module (QE)
       j) CFI or JEDEC memory-mapped NOR flash
       k) Global Utilities Block
+      l) Xilinx IP cores
 
   VII - Specifying interrupt information for devices
     1) interrupts property
@@ -2242,6 +2243,269 @@ platforms are moved over to use the flattened-device-tree model.
 			   available.
 			   For Axon: 0x0000012a
 
+   l) Xilinx IP cores
+
+   The Xilinx EDK toolchain ships with a set of IP cores (devices) for use
+   in Xilinx Spartan and Virtex FPGAs.  The devices cover the whole range
+   of standard device types (network, serial, etc.) and miscellanious
+   devices (gpio, LCD, spi, etc).  Also, since these devices are
+   implemented within the fpga fabric every instance of the device can be
+   synthesised with different options that change the behaviour.
+
+   Each IP-core has a set of parameters which the FPGA designer can use to
+   control how the core is synthesized.  Historically, the EDK tool would
+   extract the device parameters relevant to device drivers and copy them
+   into an 'xparameters.h' in the form of #define symbols.  This tells the
+   device drivers how the IP cores are configured, but it requres the kernel
+   to be recompiled every time the FPGA bitstream is resynthesized.
+
+   The new approach is to export the parameters into the device tree and
+   generate a new device tree each time the FPGA bitstream changes.  The
+   parameters which used to be exported as #defines will now become
+   properties of the device node.  In general, device nodes for IP-cores
+   will take the following form:
+
+	(name)@(base-address) {
+		compatible = "xilinx,(ip-core-name)-(HW_VER)"
+			     [, (list of compatible devices), ...];
+		reg = <(baseaddr) (size)>;
+		interrupt-parent = <&interrupt-controller-phandle>;
+		interrupts = < ... >;
+		xilinx,(parameter1) = "(string-value)";
+		xilinx,(parameter2) = <(int-value)>;
+	};
+
+	(ip-core-name):	the name of the ip block (given after the BEGIN
+			directive in system.mhs).  Should be in lowercase
+			and all underscores '_' converted to dashes '-'.
+	(name):		is derived from the "PARAMETER INSTANCE" value.
+	(parameter#):	C_* parameters from system.mhs.  The C_ prefix is
+			dropped from the parameter name, the name is converted
+			to lowercase and all underscore '_' characters are
+			converted to dashes '-'.
+	(baseaddr):	the C_BASEADDR parameter.
+	(HW_VER):	from the HW_VER parameter.
+	(size):		equals C_HIGHADDR - C_BASEADDR + 1
+
+   Typically, the compatible list will include the exact IP core version
+   followed by an older IP core version which implements the same
+   interface or any other device with the same interface.
+
+   'reg', 'interrupt-parent' and 'interrupts' are all optional properties.
+
+   For example, the following block from system.mhs:
+
+	BEGIN opb_uartlite
+		PARAMETER INSTANCE = opb_uartlite_0
+		PARAMETER HW_VER = 1.00.b
+		PARAMETER C_BAUDRATE = 115200
+		PARAMETER C_DATA_BITS = 8
+		PARAMETER C_ODD_PARITY = 0
+		PARAMETER C_USE_PARITY = 0
+		PARAMETER C_CLK_FREQ = 50000000
+		PARAMETER C_BASEADDR = 0xEC100000
+		PARAMETER C_HIGHADDR = 0xEC10FFFF
+		BUS_INTERFACE SOPB = opb_7
+		PORT OPB_Clk = CLK_50MHz
+		PORT Interrupt = opb_uartlite_0_Interrupt
+		PORT RX = opb_uartlite_0_RX
+		PORT TX = opb_uartlite_0_TX
+		PORT OPB_Rst = sys_bus_reset_0
+	END
+
+   becomes the following device tree node:
+
+	opb-uartlite-0@ec100000 {
+		device_type = "serial";
+		compatible = "xilinx,opb-uartlite-1.00.b";
+		reg = <ec100000 10000>;
+		interrupt-parent = <&opb-intc>;
+		interrupts = <1 0>; // got this from the opb_intc parameters
+		current-speed = <d#115200>;	// standard serial device prop
+		clock-frequency = <d#50000000>;	// standard serial device prop
+		xilinx,data-bits = <8>;
+		xilinx,odd-parity = <0>;
+		xilinx,use-parity = <0>;
+	};
+
+   Some IP cores actually implement 2 or more logical devices.  In this case,
+   the device should still describe the whole IP core with a single node
+   and add a child node for each logical device.  The ranges property can
+   be used to translate from parent IP-core to the registers of each device.
+   (Note: this makes the assumption that both logical devices have the same
+   bus binding.  If this is not true, then separate nodes should be used for
+   each logical device).  The 'cell-index' property can be used to enumerate
+   logical devices within an IP core.  For example, the following is the
+   system.mhs entry for the dual ps2 controller found on the ml403 reference
+   design.
+
+	BEGIN opb_ps2_dual_ref
+		PARAMETER INSTANCE = opb_ps2_dual_ref_0
+		PARAMETER HW_VER = 1.00.a
+		PARAMETER C_BASEADDR = 0xA9000000
+		PARAMETER C_HIGHADDR = 0xA9001FFF
+		BUS_INTERFACE SOPB = opb_v20_0
+		PORT Sys_Intr1 = ps2_1_intr
+		PORT Sys_Intr2 = ps2_2_intr
+		PORT Clkin1 = ps2_clk_rx_1
+		PORT Clkin2 = ps2_clk_rx_2
+		PORT Clkpd1 = ps2_clk_tx_1
+		PORT Clkpd2 = ps2_clk_tx_2
+		PORT Rx1 = ps2_d_rx_1
+		PORT Rx2 = ps2_d_rx_2
+		PORT Txpd1 = ps2_d_tx_1
+		PORT Txpd2 = ps2_d_tx_2
+	END
+
+   It would result in the following device tree nodes:
+
+	opb_ps2_dual_ref_0@a9000000 {
+		ranges = <0 a9000000 2000>;
+		// If this device had extra parameters, then they would
+		// go here.
+		ps2@0 {
+			compatible = "xilinx,opb-ps2-dual-ref-1.00.a";
+			reg = <0 40>;
+			interrupt-parent = <&opb-intc>;
+			interrupts = <3 0>;
+			cell-index = <0>;
+		};
+		ps2@1000 {
+			compatible = "xilinx,opb-ps2-dual-ref-1.00.a";
+			reg = <1000 40>;
+			interrupt-parent = <&opb-intc>;
+			interrupts = <3 0>;
+			cell-index = <0>;
+		};
+	};
+
+   Also, the system.mhs file defines bus attachments from the processor
+   to the devices.  The device tree structure should reflect the bus
+   attachments.  Again an example; this system.mhs fragment:
+
+	BEGIN ppc405_virtex4
+		PARAMETER INSTANCE = ppc405_0
+		PARAMETER HW_VER = 1.01.a
+		BUS_INTERFACE DPLB = plb_v34_0
+		BUS_INTERFACE IPLB = plb_v34_0
+	END
+
+	BEGIN opb_intc
+		PARAMETER INSTANCE = opb_intc_0
+		PARAMETER HW_VER = 1.00.c
+		PARAMETER C_BASEADDR = 0xD1000FC0
+		PARAMETER C_HIGHADDR = 0xD1000FDF
+		BUS_INTERFACE SOPB = opb_v20_0
+	END
+
+	BEGIN opb_uart16550
+		PARAMETER INSTANCE = opb_uart16550_0
+		PARAMETER HW_VER = 1.00.d
+		PARAMETER C_BASEADDR = 0xa0000000
+		PARAMETER C_HIGHADDR = 0xa0001FFF
+		BUS_INTERFACE SOPB = opb_v20_0
+	END
+
+	BEGIN plb_v34
+		PARAMETER INSTANCE = plb_v34_0
+		PARAMETER HW_VER = 1.02.a
+	END
+
+	BEGIN plb_bram_if_cntlr
+		PARAMETER INSTANCE = plb_bram_if_cntlr_0
+		PARAMETER HW_VER = 1.00.b
+		PARAMETER C_BASEADDR = 0xFFFF0000
+		PARAMETER C_HIGHADDR = 0xFFFFFFFF
+		BUS_INTERFACE SPLB = plb_v34_0
+	END
+
+	BEGIN plb2opb_bridge
+		PARAMETER INSTANCE = plb2opb_bridge_0
+		PARAMETER HW_VER = 1.01.a
+		PARAMETER C_RNG0_BASEADDR = 0x20000000
+		PARAMETER C_RNG0_HIGHADDR = 0x3FFFFFFF
+		PARAMETER C_RNG1_BASEADDR = 0x60000000
+		PARAMETER C_RNG1_HIGHADDR = 0x7FFFFFFF
+		PARAMETER C_RNG2_BASEADDR = 0x80000000
+		PARAMETER C_RNG2_HIGHADDR = 0xBFFFFFFF
+		PARAMETER C_RNG3_BASEADDR = 0xC0000000
+		PARAMETER C_RNG3_HIGHADDR = 0xDFFFFFFF
+		BUS_INTERFACE SPLB = plb_v34_0
+		BUS_INTERFACE MOPB = opb_v20_0
+	END
+
+   Gives this device tree (some properties removed for clarity):
+
+	plb-v34-0 {
+		#address-cells = <1>;
+		#size-cells = <1>;
+		device_type = "ibm,plb";
+		ranges; // 1:1 translation
+
+		plb-bram-if-cntrl-0@ffff0000 {
+			reg = <ffff0000 10000>;
+		}
+
+		opb-v20-0 {
+			#address-cells = <1>;
+			#size-cells = <1>;
+			ranges = <20000000 20000000 20000000
+				  60000000 60000000 20000000
+				  80000000 80000000 40000000
+				  c0000000 c0000000 20000000>;
+
+			opb-uart16550-0@a0000000 {
+				reg = <a00000000 2000>;
+			};
+
+			opb-intc-0@d1000fc0 {
+				reg = <d1000fc0 20>;
+			};
+		};
+	};
+
+   That covers the general approach to binding xilinx IP cores into the
+   device tree.  The following are bindings for specific devices:
+
+      i) Xilinx ML300 Framebuffer
+
+      Simple framebuffer device from the ML300 reference design (also on the
+      ML403 reference design as well as others).
+
+      Optional properties:
+       - resolution : <xres yres> pixel resolution of framebuffer.  Some
+                      implementations use a different resolution.  Default
+                      is <d#640 d#480>
+       - virt-resolution : <xvirt yvirt> Size of framebuffer in memory.
+                           Default is <d#1024 d#480>.
+       - rotate-display (empty) : rotate display 180 degrees.
+
+      ii) Xilinx SystemACE
+
+      The Xilinx SystemACE device is used to program FPGAs from an FPGA
+      bitstream stored on a CF card.  It can also be used as a generic CF
+      interface device.
+
+      Required properties:
+       - compatible : Should include "xilinx,sysace" in the list
+
+      Optional properties:
+       - 8-bit (empty) : Set this property for SystemACE in 8 bit mode
+
+      iii) Xilinx EMAC and Xilinx TEMAC
+
+      Xilinx Ethernet devices.  In addition to general xilinx properties
+      listed above, nodes for these devices should include a phy-handle
+      property, and may include other common network device properties
+      like local-mac-address.
+      
+      iv) Xilinx Uartlite
+
+      Xilinx uartlite devices are simple fixed speed serial ports.
+
+      Requred properties:
+       - current-speed : Baud rate of uartlite
+
    More devices will be defined as this spec matures.
 
 VII - Specifying interrupt information for devices
Acked-by on v3 1/1
#1 lore raw

=20

Quoted 11 lines

-----Original Message-----
From: Grant Likely [mailto:[email protected]]=20
Sent: Thursday, October 18, 2007 10:23 AM
To: [email protected]; Stephen Neuendorffer; Wolfgang=20 Reissnegger; Leonid; [email protected]; Josh=20 Boyer; Arnd Bergmann
Subject: [PATCH v3] Device tree bindings for Xilinx devices =20
From: Grant Likely <[email protected]>
=20

This is good enough for the moment, and it reflects the best we can do right now... But:

Documentation/powerpc/booting-without-of.txt platforms are moved over to use the flattened-device-tree model. · line 2285

Quoted 7 lines
(quoted diff) +1 -0
+	(parameter#):	C_* parameters from system.mhs.  The C_=20

prefix is

(quoted diff) +1 -0
+			dropped from the parameter name, the=20

name is converted

(quoted diff) +1 -0
+			to lowercase and all underscore '_'=20

characters are

Documentation/powerpc/booting-without-of.txt +1 -0
+			converted to dashes '-'.

Unfortunately, xparameters don't follow this exactly, particularly for the 'multiple logical devices' case... Maybe it's worth adding something like: "For simple devices, the parameter name can be formed by:"

In any event, this should essentially document what the mechanism for generating the device trees actually does... Have you updated gen_mhs_devtree.py to reflect all this?

Documentation/powerpc/booting-without-of.txt platforms are moved over to use the flattened-device-tree model. · line 2292

Quoted 4 lines

+ Typically, the compatible list will include the exact IP=20
core version

Documentation/powerpc/booting-without-of.txt +2 -0
+   followed by an older IP core version which implements the same
+   interface or any other device with the same interface.

This seems to be awkward, since it means that the tree *and* the driver will likely have long lists of compatible types. In the driver, this is hard to maintain, and in the device tree we don't have an easy way of knowing exactly what is compatible and what isn't anyway... It seems better to me to have the
compatible list include the exact type (e.g. xilinx,opb-uartlite-1.00.b) and
a generic compatibility class (e.g. xilinx,uartlite), and for the drivers
to essentially define the gross compatibility classes. Then the driver only has an of_match with:

.compatible =3D "xilinx,uartlite"

Steve

#2 lore raw
Quoted 26 lines · Stephen Neuendorffer
Quoted 9 lines

-----Original Message-----
From: Grant Likely [mailto:[email protected]]
Sent: Thursday, October 18, 2007 10:23 AM
To: [email protected]; Stephen Neuendorffer; Wolfgang Reissnegger; Leonid; [email protected]; Josh Boyer; Arnd Bergmann
Subject: [PATCH v3] Device tree bindings for Xilinx devices

Quoted 3 lines

From: Grant Likely <[email protected]>

This is good enough for the moment, and it reflects the best we can do right now... But:

Quoted 7 lines

+ (parameter#): C_* parameters from system.mhs. The C_
prefix is
+ dropped from the parameter name, the
name is converted
+ to lowercase and all underscore '_'
characters are
+ converted to dashes '-'.

Quoted 4 lines

Unfortunately, xparameters don't follow this exactly, particularly for the 'multiple logical devices' case... Maybe it's worth adding something like: "For simple devices, the parameter name can be formed by:"

What specific parts of this are you concerned about? Examples?

Quoted 4 lines

In any event, this should essentially document what the mechanism for generating the device trees actually does... Have you updated gen_mhs_devtree.py to reflect all this?

No; I'm looking at this as a line in the sand that we can use as a starting point and discuss the issues.

Quoted 18 lines

Documentation/powerpc/booting-without-of.txt platforms are moved over to use the flattened-device-tree model. · line 2292

Quoted 5 lines

+ Typically, the compatible list will include the exact IP
core version

Documentation/powerpc/booting-without-of.txt +2 -0
+   followed by an older IP core version which implements the same
+   interface or any other device with the same interface.

This seems to be awkward, since it means that the tree *and* the driver will likely have long lists of compatible types. In the driver, this is hard to maintain, and in the device tree we don't have an easy way of knowing exactly what is compatible and what isn't anyway... It seems better to me to have the
compatible list include the exact type (e.g. xilinx,opb-uartlite-1.00.b) and
a generic compatibility class (e.g. xilinx,uartlite), and for the drivers
to essentially define the gross compatibility classes. Then the driver only has an of_match with:

Quoted 1 line

.compatible = "xilinx,uartlite"

The problem with this is how do you define what "xilinx,uartlite" is? For example; there have been 3 major versions of the plb_temac, and IIRC v2 and v3 are *not* compatible. Which one is xilinx,temac?

However, this does not need to result in a long list. Basically, the list should include the exact version of the device plus the first version that implemented that interface. (hence it is "compatible" with the earlier version of the device). If there are no prior devices implementing the same device, then the compatible list has exactly one instance. This document should probably include a list of the well-known compatible values for each of the xilinx devices.

I used to try and come up with generic values for compatible, but it just ends up causing problems in the long run. The concept of what is generic changes over time, but a specific version is a known quantity.

Cheers,
g.

Signature · 4 lines
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.
[email protected]
(403) 399-0195
#3 lore raw

=20

Quoted 38 lines

-----Original Message-----
From: [email protected] [mailto:[email protected]] On=20 Behalf Of Grant Likely
Sent: Thursday, October 18, 2007 11:13 AM
To: Stephen Neuendorffer
Cc: [email protected]; Wolfgang Reissnegger; Leonid;=20 [email protected]; Josh Boyer; Arnd Bergmann
Subject: Re: [PATCH v3] Device tree bindings for Xilinx devices =20

Quoted 9 lines · On 10/18/07, Stephen Neuendorffer=20 <[email protected]> wrote:
Quoted 9 lines

-----Original Message-----
From: Grant Likely [mailto:[email protected]]
Sent: Thursday, October 18, 2007 10:23 AM
To: [email protected]; Stephen Neuendorffer; Wolfgang Reissnegger; Leonid; [email protected]; Josh Boyer; Arnd Bergmann
Subject: [PATCH v3] Device tree bindings for Xilinx devices

Quoted 7 lines
Quoted 3 lines

From: Grant Likely <[email protected]>

This is good enough for the moment, and it reflects the=20

best we can do

Quoted 10 lines

right now... But:

Quoted 7 lines

+ (parameter#): C_* parameters from system.mhs. The C_
prefix is
+ dropped from the parameter name, the
name is converted
+ to lowercase and all underscore '_'
characters are
+ converted to dashes '-'.

Quoted 8 lines
Quoted 1 line

Unfortunately, xparameters don't follow this exactly,=20

particularly for

Quoted 2 lines

the 'multiple logical devices' case... Maybe it's worth adding something like: "For simple devices, the parameter name can=20

be formed

Quoted 1 line

by:"

=20
What specific parts of this are you concerned about? Examples?

Imagine if the ps2 adapter had a parameter "FOO" for each logical device, In the core, one would be named C_PORT_0_FOO and another C_PORT_1_FOO. But, of course, you would want the FOO parameters to be unmangled in the correct way for each port (as your hierarchical example shows, but without any parameters). In the xparameters, this unmangling has been done, and the xparameters would look something like XPAR_PS2_0_FOO and XPAR_PS2_1_FOO.

In other cases, xparameters for one core might be extracted from another core that it is connected to, and in fact might reflect how the two are connected. This is how some cores under development will work (in EDK 9.2).

In short, I think its better to think about this all relative to xparameters, rather than relative to the .mhs file. In all current cases, this is (I think) the same, but in the (very near future) it won't be.

Quoted 7 lines
Quoted 1 line

In any event, this should essentially document what the=20

mechanism for

Quoted 2 lines

generating the device trees actually does... Have you updated gen_mhs_devtree.py to reflect all this?

=20
No; I'm looking at this as a line in the sand that we can use as a starting point and discuss the issues.

OK... Well, as far as I'm concerned it looks good enough that we should
try it out... :) I'll hack up gen_mhs_devtree and see how far we get.

Quoted 24 lines
Quoted 6 lines

Documentation/powerpc/booting-without-of.txt platforms are moved over to use the flattened-device-tree model. · line 2292

Quoted 4 lines

+ Typically, the compatible list will include the exact IP
core version

Documentation/powerpc/booting-without-of.txt +2 -0
+   followed by an older IP core version which implements the same
+   interface or any other device with the same interface.

This seems to be awkward, since it means that the tree=20

*and* the driver

Quoted 1 line

will likely have long lists of compatible types. In the=20

driver, this is

Quoted 1 line

hard to maintain, and in the device tree we don't have an=20

easy way of

Quoted 1 line

knowing exactly what is compatible and what isn't anyway...=20

It seems

Quoted 2 lines

better to me to have the
compatible list include the exact type (e.g.=20

xilinx,opb-uartlite-1.00.b)

Quoted 4 lines

and
a generic compatibility class (e.g. xilinx,uartlite), and for the drivers
to essentially define the gross compatibility classes. =20

Then the driver

Quoted 3 lines

only has an of_match with:

.compatible =3D "xilinx,uartlite"

Quoted 16 lines

=20
The problem with this is how do you define what "xilinx,uartlite" is? For example; there have been 3 major versions of the plb_temac, and IIRC v2 and v3 are *not* compatible. Which one is xilinx,temac? =20
However, this does not need to result in a long list. Basically, the list should include the exact version of the device plus the first version that implemented that interface. (hence it is "compatible" with the earlier version of the device). If there are no prior devices implementing the same device, then the compatible list has exactly one instance. This document should probably include a list of the well-known compatible values for each of the xilinx devices. =20
I used to try and come up with generic values for compatible, but it just ends up causing problems in the long run. The concept of what is generic changes over time, but a specific version is a known quantity.

OK... I'll buy it... :) I missed the emphasis on the 'sparseness'... And I agree about the versions being really canonical: we just need to make sure that the actual versions that are critical get back in at some point.

Steve

#4 lore raw

Here's a full .dts generated using an updated version of gen_mhs_devtree.py, following the proposal.
It happens to be a microblaze system, but you get the idea.

Grant: Is this pretty what you intend?

Steve

/ {
	#address-cells =3D <1>;
	#size-cells =3D <1>;
	compatible =3D "ibm,plb4";
	model =3D "system.mhs";
	Ethernet_MAC {
		compatible =3D
"xilinx,opb-ethernet-1.04.a\0xilinx,opb-ethernet";
		device_type =3D "opb_ethernet";
		interrupt-parent =3D <101>;
		interrupts =3D < 1 0 >;
		reg =3D < 40c00000 10000 >;
		xilinx,cam-exist =3D <0>;
		xilinx,dev-blk-id =3D <0>;
		xilinx,dev-mir-enable =3D <0>;
		xilinx,dma-present =3D <1>;
		xilinx,include-dev-pencoder =3D <0>;
		xilinx,ipif-rdfifo-depth =3D <4000>;
		xilinx,ipif-wrfifo-depth =3D <4000>;
		xilinx,jumbo-exist =3D <0>;
		xilinx,mac-fifo-depth =3D <10>;
		xilinx,mii-exist =3D <1>;
		xilinx,opb-clk-period-ps =3D <2710>;
		xilinx,reset-present =3D <1>;
		xilinx,rx-dre-type =3D <0>;
		xilinx,rx-include-csum =3D <0>;
		xilinx,tx-dre-type =3D <0>;
		xilinx,tx-include-csum =3D <0>;
	} ;
	IIC_EEPROM {
		compatible =3D "xilinx,opb-iic-1.02.a\0xilinx,opb-iic";
		device_type =3D "opb_iic";
		interrupt-parent =3D <101>;
		interrupts =3D < 2 0 >;
		reg =3D < 40800000 10000 >;
		xilinx,clk-freq =3D <5f5e100>;
		xilinx,iic-freq =3D <186a0>;
		xilinx,ten-bit-adr =3D <0>;
	} ;
	RS232_Uart_1 {
		compatible =3D
"xilinx,opb-uartlite-1.00.b\0xilinx,opb-uartlite";
		device_type =3D "opb_uartlite";
		interrupt-parent =3D <101>;
		interrupts =3D < 3 0 >;
		reg =3D < 40600000 10000 >;
		xilinx,baudrate =3D <2580>;
		xilinx,clk-freq =3D <5f5e100>;
		xilinx,data-bits =3D <8>;
		xilinx,odd-parity =3D <0>;
		xilinx,use-parity =3D <0>;
	} ;
	chosen {
		bootargs =3D "root=3D/dev/xsysace/disc0/part2";
		interrupt-controller =3D <101>;
		linux,platform =3D <600>;
	} ;
	cpus {
		#address-cells =3D <1>;
		#cpus =3D <1>;
		#size-cells =3D <0>;
		microblaze_0,6.00. {
			32-bit;
			clock-frequency =3D <5f5e1000>;
			d-cache-line-size =3D <10>;
			d-cache-size =3D <4000>;
			device_type =3D "cpu";
			i-cache-line-size =3D <10>;
			i-cache-size =3D <4000>;
			linux,boot-cpu;
			reg =3D <0>;
			timebase-frequency =3D <1fca055>;
			xilinx,cache-byte-size =3D <4000>;
			xilinx,dcache-baseaddr =3D <50000000>;
			xilinx,dcache-byte-size =3D <4000>;
			xilinx,dcache-highaddr =3D <5fffffff>;
			xilinx,debug-enabled =3D <1>;
			xilinx,div-zero-exception =3D <1>;
			xilinx,dopb-bus-exception =3D <1>;
			xilinx,fpu-exception =3D <1>;
			xilinx,icache-baseaddr =3D <50000000>;
			xilinx,icache-highaddr =3D <5fffffff>;
			xilinx,ill-opcode-exception =3D <1>;
			xilinx,iopb-bus-exception =3D <1>;
			xilinx,number-of-pc-brk =3D <2>;
			xilinx,pvr =3D <2>;
			xilinx,unaligned-exceptions =3D <1>;
			xilinx,use-barrel =3D <1>;
			xilinx,use-dcache =3D <1>;
			xilinx,use-div =3D <1>;
			xilinx,use-fpu =3D <1>;
			xilinx,use-icache =3D <1>;
			xilinx,use-msr-instr =3D <1>;
			xilinx,use-pcmp-instr =3D <1>;
		} ;
	} ;
	debug_module {
		compatible =3D "xilinx,opb-mdm-2.00.a\0xilinx,opb-mdm";
		device_type =3D "opb_mdm";
		reg =3D < 41400000 10000 >;
		xilinx,mb-dbg-ports =3D <1>;
		xilinx,uart-width =3D <8>;
		xilinx,use-uart =3D <1>;
	} ;
	memory@50000000 {
		device_type =3D "memory";
		edk_name =3D "DDR2_SDRAM_32Mx32";
		memreg:reg =3D < 50000000 10000000 >;
	} ;
	opb_hwicap_0 {
		compatible =3D
"xilinx,opb-hwicap-1.10.a\0xilinx,opb-hwicap";
		device_type =3D "opb_hwicap";
		reg =3D < 41300000 10000 >;
	} ;
	opb_intc_0 {
		#interrupt-cells =3D <2>;
		compatible =3D "xilinx,opb-intc-1.00.c\0xilinx,opb-intc";
		device_type =3D "opb_intc";
		interrupt-controller;
		linux,phandle =3D <101>;
		reg =3D < 41200000 10000 >;
	} ;
	opb_timer_1 {
		compatible =3D
"xilinx,opb-timer-1.00.b\0xilinx,opb-timer";
		device_type =3D "opb_timer";
		interrupt-parent =3D <101>;
		interrupts =3D < 0 0 >;
		reg =3D < 41c00000 10000 >;
		xilinx,count-width =3D <20>;
		xilinx,one-timer-only =3D <1>;
	} ;
} ;=20
#5 lore raw

Hi Steve and all,

Quoted 3 lines

Here's a full .dts generated using an updated version of gen_mhs_devtree.py, following the proposal.
It happens to be a microblaze system, but you get the idea.

I think that is no good idea generate dts with all information. Especially information about PVR - number 2 means - Full PVR and you can obtain information directly from PVR. It is waste of memory space.

			xilinx,pvr = <2>;

In my opinion will be better generate only parameters which you want not all. That smells with unusable parameters.

Michal Simek

#15 lore raw
In reply to Stephen Neuendorffer
Quoted 6 lines · Stephen Neuendorffer

Here's a full .dts generated using an updated version of gen_mhs_devtree.py, following the proposal.
It happens to be a microblaze system, but you get the idea.

Grant: Is this pretty what you intend?

Pretty close; comments below on how we still need to change gen_mhs_devtree.py

BTW, thanks for doing this.

Cheers,
g.

Quoted 7 lines

Steve

/ {
        #address-cells = <1>;
        #size-cells = <1>;
        compatible = "ibm,plb4";

Not quite; the bus itself needs to be one level deeper. Compatible here is refering to the platform itself, not the bus and so should be the actual board name or something similar. Maybe something like:
"xlnx,ml403","xlnx,generic-virtex4";

All devices should be children or grandchildren of a 'plb' node.

Quoted 1 line
        model = "system.mhs";

Should be the model name of the board in the form "<mfg>,<model>". It might be appropriate to also have a property which describes the version of the FPGA build or some other way to identify where this FPGA bitstream came from. I'll need to think about this some more.

Quoted 3 lines
        Ethernet_MAC {
                compatible =

"xilinx,opb-ethernet-1.04.a\0xilinx,opb-ethernet";

Yes; this is the idea; but I don't like "xilinx,opb-ethernet". I think we should always specify specific versions and not try to guess what the 'generic' device compatible interface is.

Also, dtc now accepts the form "string1","string2". the embedded '\0' is no longer needed.

Quoted 1 line
                device_type = "opb_ethernet";

device_type = "network";

Quoted 1 line
                interrupt-parent = <101>;

interrupt-parent = <&opb_intc0>; (and a label needs to be added to
the interrupt node).

Quoted 10 lines
                interrupts = < 1 0 >;
                reg = < 40c00000 10000 >;
                xilinx,cam-exist = <0>;
                xilinx,dev-blk-id = <0>;
                xilinx,dev-mir-enable = <0>;
                xilinx,dma-present = <1>;
                xilinx,include-dev-pencoder = <0>;
                xilinx,ipif-rdfifo-depth = <4000>;
                xilinx,ipif-wrfifo-depth = <4000>;
                xilinx,jumbo-exist = <0>;
Quoted 8 lines
                xilinx,mac-fifo-depth = <10>;
                xilinx,mii-exist = <1>;
                xilinx,opb-clk-period-ps = <2710>;
                xilinx,reset-present = <1>;
                xilinx,rx-dre-type = <0>;
                xilinx,rx-include-csum = <0>;
                xilinx,tx-dre-type = <0>;
                xilinx,tx-include-csum = <0>;

I got a comment from one of the ppc folks that we should use the stock ticker abbreviation 'xlnx,' here instead of 'xilinx,'

Quoted 2 lines
        } ;
        IIC_EEPROM {

Node name needs to be unique. Convention is to use the form device@address. We could either use the instance name or the IP core name here; I'm not sure which is best.

Quoted 2 lines
                compatible = "xilinx,opb-iic-1.02.a\0xilinx,opb-iic";
                device_type = "opb_iic";

device_type needs to be dropped from this node because i2c is not a standard device type.

Quoted 6 lines
                interrupt-parent = <101>;
                interrupts = < 2 0 >;
                reg = < 40800000 10000 >;
                xilinx,clk-freq = <5f5e100>;
                xilinx,iic-freq = <186a0>;
                xilinx,ten-bit-adr = <0>;

i2c devices can optionally be listed as sub-nodes here; but of course gen-mhs-devtree doesn't know about these.

Quoted 5 lines
        } ;
        RS232_Uart_1 {
                compatible =
"xilinx,opb-uartlite-1.00.b\0xilinx,opb-uartlite";
                device_type = "opb_uartlite";

device_type = serial;

Quoted 4 lines
                interrupt-parent = <101>;
                interrupts = < 3 0 >;
                reg = < 40600000 10000 >;
                xilinx,baudrate = <2580>;

should be 'current-speed = <2580>' because this is standard device type 'serial'.

Quoted 1 line
                xilinx,clk-freq = <5f5e100>;

It might be better for this to be 'clock-frequency'; one of the standard properties in serial devices

Quoted 7 lines
                xilinx,data-bits = <8>;
                xilinx,odd-parity = <0>;
                xilinx,use-parity = <0>;
        } ;
        chosen {
                bootargs = "root=/dev/xsysace/disc0/part2";
                interrupt-controller = <101>;

interrupt-controller doesn't belong here.

Quoted 1 line
                linux,platform = <600>;

What's 'linux,platform' for?

Quoted 4 lines
        } ;
        cpus {
                #address-cells = <1>;
                #cpus = <1>;

I don't think this property is necessary.

Quoted 4 lines
                #size-cells = <0>;
                microblaze_0,6.00. {
                        32-bit;
                        clock-frequency = <5f5e1000>;

dtc now accepts the form <d#value> for decimal values; might be better for readability here.

Quoted 35 lines
                        d-cache-line-size = <10>;
                        d-cache-size = <4000>;
                        device_type = "cpu";
                        i-cache-line-size = <10>;
                        i-cache-size = <4000>;
                        linux,boot-cpu;
                        reg = <0>;
                        timebase-frequency = <1fca055>;
                        xilinx,cache-byte-size = <4000>;
                        xilinx,dcache-baseaddr = <50000000>;
                        xilinx,dcache-byte-size = <4000>;
                        xilinx,dcache-highaddr = <5fffffff>;
                        xilinx,debug-enabled = <1>;
                        xilinx,div-zero-exception = <1>;
                        xilinx,dopb-bus-exception = <1>;
                        xilinx,fpu-exception = <1>;
                        xilinx,icache-baseaddr = <50000000>;
                        xilinx,icache-highaddr = <5fffffff>;
                        xilinx,ill-opcode-exception = <1>;
                        xilinx,iopb-bus-exception = <1>;
                        xilinx,number-of-pc-brk = <2>;
                        xilinx,pvr = <2>;
                        xilinx,unaligned-exceptions = <1>;
                        xilinx,use-barrel = <1>;
                        xilinx,use-dcache = <1>;
                        xilinx,use-div = <1>;
                        xilinx,use-fpu = <1>;
                        xilinx,use-icache = <1>;
                        xilinx,use-msr-instr = <1>;
                        xilinx,use-pcmp-instr = <1>;
                } ;
        } ;
        debug_module {
                compatible = "xilinx,opb-mdm-2.00.a\0xilinx,opb-mdm";
                device_type = "opb_mdm";
Quoted 8 lines
                reg = < 41400000 10000 >;
                xilinx,mb-dbg-ports = <1>;
                xilinx,uart-width = <8>;
                xilinx,use-uart = <1>;
        } ;
        memory@50000000 {
                device_type = "memory";
                edk_name = "DDR2_SDRAM_32Mx32";

xlnx,edk_name perhaps? Might be better to embed this in the node name.

Quoted 6 lines
                memreg:reg = < 50000000 10000000 >;
        } ;
        opb_hwicap_0 {
                compatible =
"xilinx,opb-hwicap-1.10.a\0xilinx,opb-hwicap";
                device_type = "opb_hwicap";

Drop device type for this node; it's non-standard.

Quoted 8 lines
                reg = < 41300000 10000 >;
        } ;
        opb_intc_0 {
                #interrupt-cells = <2>;
                compatible = "xilinx,opb-intc-1.00.c\0xilinx,opb-intc";
                device_type = "opb_intc";
                interrupt-controller;
                linux,phandle = <101>;

You can drop this property and add the label 'opb_intc_0' to this node instead.

Quoted 6 lines
                reg = < 41200000 10000 >;
        } ;
        opb_timer_1 {
                compatible =
"xilinx,opb-timer-1.00.b\0xilinx,opb-timer";
                device_type = "opb_timer";

Again, device_type needs to be dropped

Quoted 8 lines
                interrupt-parent = <101>;
                interrupts = < 0 0 >;
                reg = < 41c00000 10000 >;
                xilinx,count-width = <20>;
                xilinx,one-timer-only = <1>;
        } ;
} ;
Signature · 4 lines
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.
[email protected]
(403) 399-0195
#6 lore raw
In reply to Michal Simek
Quoted 5 lines · Michal Simek

Hi Steve and all,

Quoted 3 lines

Here's a full .dts generated using an updated version of gen_mhs_devtree.py, following the proposal.
It happens to be a microblaze system, but you get the idea.

Quoted 7 lines

I think that is no good idea generate dts with all information. Especially information about PVR - number 2 means - Full PVR and you can obtain information directly from PVR. It is waste of memory space.

                        xilinx,pvr = <2>;

In my opinion will be better generate only parameters which you want not all. That smells with unusable parameters.

That is the hard part about crafting the dts; deciding which parameters the OS is going to care about and which ones are irrelevant. The goal is to sufficiently and uniquely describe the board so that the OS can easily figure out what exactly what it needs to do to drive the board, but not to try and describe every aspect which it knows about. Anything that is pollable (ie. USB devices) doesn't need to be in the tree.

It's also important to remember that the device tree will *never* be perfect. Eventually something will come up that the device tree doesn't describe well(a bug/quirk, something described poorly, etc). In this case, as long as the device tree is specific enough to identify which version of the board it is running on; we can alwasy add platform specific fixups for that unique system.

Signature · 4 lines
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.
[email protected]
(403) 399-0195
#7 lore raw

Hi Grant,

Quoted 21 lines
Quoted 5 lines

Hi Steve and all,

Quoted 3 lines

Here's a full .dts generated using an updated version of gen_mhs_devtree.py, following the proposal.
It happens to be a microblaze system, but you get the idea.

Quoted 7 lines

I think that is no good idea generate dts with all information. Especially information about PVR - number 2 means - Full PVR and you can obtain information directly from PVR. It is waste of memory space.

                        xilinx,pvr = <2>;

In my opinion will be better generate only parameters which you want not all. That smells with unusable parameters.

That is the hard part about crafting the dts; deciding which parameters the OS is going to care about and which ones are irrelevant. The goal is to sufficiently and uniquely describe the board so that the OS can easily figure out what exactly what it needs to do to drive the board, but not to try and describe every aspect which it knows about. Anything that is pollable (ie. USB devices) doesn't need to be in the tree.

Quoted 7 lines

It's also important to remember that the device tree will *never* be perfect. Eventually something will come up that the device tree doesn't describe well(a bug/quirk, something described poorly, etc). In this case, as long as the device tree is specific enough to identify which version of the board it is running on; we can alwasy add platform specific fixups for that unique system.

yes, but I think that is the right time to specify which parameters are relevant. I will focus on in EDK renerator.

Michal Simek

#16 lore raw
In reply to Stephen Neuendorffer
Quoted 7 lines · Stephen Neuendorffer

Here's a full .dts generated using an updated version of gen_mhs_devtree.py, following the proposal.
It happens to be a microblaze system, but you get the idea.

Grant: Is this pretty what you intend?

Quoted 7 lines

Steve

/ {
	#address-cells = <1>;
	#size-cells = <1>;
	compatible = "ibm,plb4";
	model = "system.mhs";

Although strictly speaking the root node can represent the top-level system bus, to match the other 4xx chips it would be beter, as Grant says, to make a /plb node and put the devices under that.

Quoted 1 line
	Ethernet_MAC {

Node names should be lower case, and must include a unit address derived from the reg property. Furthermore, the generic names convention means this should be called just "ethernet@...".

Quoted 16 lines

compatible =

"xilinx,opb-ethernet-1.04.a\0xilinx,opb-ethernet";
		device_type = "opb_ethernet";
		interrupt-parent = <101>;
		interrupts = < 1 0 >;
		reg = < 40c00000 10000 >;
		xilinx,cam-exist = <0>;
		xilinx,dev-blk-id = <0>;
		xilinx,dev-mir-enable = <0>;
		xilinx,dma-present = <1>;
		xilinx,include-dev-pencoder = <0>;
		xilinx,ipif-rdfifo-depth = <4000>;
		xilinx,ipif-wrfifo-depth = <4000>;
		xilinx,jumbo-exist = <0>;
		xilinx,mac-fifo-depth = <10>;
		xilinx,mii-exist = <1>;
Quoted 8 lines
		xilinx,opb-clk-period-ps = <2710>;
		xilinx,reset-present = <1>;
		xilinx,rx-dre-type = <0>;
		xilinx,rx-include-csum = <0>;
		xilinx,tx-dre-type = <0>;
		xilinx,tx-include-csum = <0>;
	} ;
	IIC_EEPROM {

Apart from the fact that it should be "eeprom@..." this doesn't look right. Surely there must be an i2c bridge, then an eeprom device behind it?

Quoted 10 lines
		compatible = "xilinx,opb-iic-1.02.a\0xilinx,opb-iic";
		device_type = "opb_iic";
		interrupt-parent = <101>;
		interrupts = < 2 0 >;
		reg = < 40800000 10000 >;
		xilinx,clk-freq = <5f5e100>;
		xilinx,iic-freq = <186a0>;
		xilinx,ten-bit-adr = <0>;
	} ;
	RS232_Uart_1 {

"serial@...."

Quoted 3 lines

compatible =

"xilinx,opb-uartlite-1.00.b\0xilinx,opb-uartlite";
		device_type = "opb_uartlite";

device_type = "serial"

Quoted 11 lines
		interrupt-parent = <101>;
		interrupts = < 3 0 >;
		reg = < 40600000 10000 >;
		xilinx,baudrate = <2580>;
		xilinx,clk-freq = <5f5e100>;
		xilinx,data-bits = <8>;
		xilinx,odd-parity = <0>;
		xilinx,use-parity = <0>;
	} ;
	chosen {
		bootargs = "root=/dev/xsysace/disc0/part2";
Quoted 8 lines
		interrupt-controller = <101>;
		linux,platform = <600>;
	} ;
	cpus {
		#address-cells = <1>;
		#cpus = <1>;
		#size-cells = <0>;
		microblaze_0,6.00. {

Should be "cpu@0".

Quoted 29 lines
			32-bit;
			clock-frequency = <5f5e1000>;
			d-cache-line-size = <10>;
			d-cache-size = <4000>;
			device_type = "cpu";
			i-cache-line-size = <10>;
			i-cache-size = <4000>;
			linux,boot-cpu;
			reg = <0>;
			timebase-frequency = <1fca055>;
			xilinx,cache-byte-size = <4000>;
			xilinx,dcache-baseaddr = <50000000>;
			xilinx,dcache-byte-size = <4000>;
			xilinx,dcache-highaddr = <5fffffff>;
			xilinx,debug-enabled = <1>;
			xilinx,div-zero-exception = <1>;
			xilinx,dopb-bus-exception = <1>;
			xilinx,fpu-exception = <1>;
			xilinx,icache-baseaddr = <50000000>;
			xilinx,icache-highaddr = <5fffffff>;
			xilinx,ill-opcode-exception = <1>;
			xilinx,iopb-bus-exception = <1>;
			xilinx,number-of-pc-brk = <2>;
			xilinx,pvr = <2>;
			xilinx,unaligned-exceptions = <1>;
			xilinx,use-barrel = <1>;
			xilinx,use-dcache = <1>;
			xilinx,use-div = <1>;
			xilinx,use-fpu = <1>;
Quoted 8 lines
			xilinx,use-icache = <1>;
			xilinx,use-msr-instr = <1>;
			xilinx,use-pcmp-instr = <1>;
		} ;
	} ;
	debug_module {
		compatible = "xilinx,opb-mdm-2.00.a\0xilinx,opb-mdm";
		device_type = "opb_mdm";

No device_type here.

Quoted 9 lines
		reg = < 41400000 10000 >;
		xilinx,mb-dbg-ports = <1>;
		xilinx,uart-width = <8>;
		xilinx,use-uart = <1>;
	} ;
	memory@50000000 {
		device_type = "memory";
		edk_name = "DDR2_SDRAM_32Mx32";
		memreg:reg = < 50000000 10000000 >;

Unless you're actually using the memreg: label, it shouldn't be there.

Quoted 5 lines
	} ;
	opb_hwicap_0 {
		compatible =
"xilinx,opb-hwicap-1.10.a\0xilinx,opb-hwicap";
		device_type = "opb_hwicap";

No device_type.

Quoted 3 lines
		reg = < 41300000 10000 >;
	} ;
	opb_intc_0 {

Should be interrupt-controller@...

Quoted 3 lines
		#interrupt-cells = <2>;
		compatible = "xilinx,opb-intc-1.00.c\0xilinx,opb-intc";
		device_type = "opb_intc";

No device_type.

Quoted 5 lines
		interrupt-controller;
		linux,phandle = <101>;
		reg = < 41200000 10000 >;
	} ;
	opb_timer_1 {

Needs unit address

Quoted 3 lines

compatible =

"xilinx,opb-timer-1.00.b\0xilinx,opb-timer";
		device_type = "opb_timer";

No device_type here.

Quoted 14 lines
		interrupt-parent = <101>;
		interrupts = < 0 0 >;
		reg = < 41c00000 10000 >;
		xilinx,count-width = <20>;
		xilinx,one-timer-only = <1>;
	} ;
} ; 

_______________________________________________
Linuxppc-dev mailing list
[email protected]
https://ozlabs.org/mailman/listinfo/linuxppc-dev

Signature · 4 lines
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson
#8 lore raw
In reply to Michal Simek
Quoted 15 lines

-----Original Message-----
From: [email protected]=20 [mailto:[email protected]] On Behalf Of=20 Michal Simek
Sent: Friday, October 19, 2007 7:28 PM
To: [email protected]
Cc: Stephen Neuendorffer; Grant Likely; Leonid; Arnd=20 Bergmann; [email protected]; Wolfgang Reissnegger
Subject: [microblaze-uclinux] Re: [microblaze-uclinux] RE:=20 [PATCH v3] Device tree bindings for Xilinx devices
=20
Hi Steve and all,

Quoted 3 lines

Here's a full .dts generated using an updated version of gen_mhs_devtree.py, following the proposal.
It happens to be a microblaze system, but you get the idea.

Quoted 6 lines

=20
I think that is no good idea generate dts with all information. Especially information about PVR - number 2 means - Full PVR=20 and you can
obtain information directly from PVR. It is waste of memory space.

			xilinx,pvr =3D <2>;

PowerPC does something with the powerpc equivalent of the PVR. We should just do what they do...
=20

Quoted 3 lines

In my opinion will be better generate only parameters which=20 you want not all.
That smells with unusable parameters.

In the long term, this may be true. In the short term:
1) dtb size is not the key problem
2) making sure that everything works is a key problem.
3) The code that generates the dts should be as simple as possible, so that we can easily document what it does.

In the long term, I'm all for optimizing the device tree that gets built,
assuming that it appears to be a problem in real systems.

Steve

#9 lore raw
Quoted 6 lines
Quoted 3 lines

In my opinion will be better generate only parameters which you want not all.
That smells with unusable parameters.

In the long term, this may be true. In the short term:
1) dtb size is not the key problem

Yes of course

Quoted 3 lines

2) making sure that everything works is a key problem.
3) The code that generates the dts should be as simple as possible, so that we can easily document what it does.

Yes but you must document every parameter which your generate do. The better way is document only parameters which you want use.

Quoted 3 lines

In the long term, I'm all for optimizing the device tree that gets built,
assuming that it appears to be a problem in real systems.

We can optimize now. I made new version of my generator u-boot_v3_00_a (monstr.eu) where you can simply add parameter which you want to use.

If you want use any parameter add it.
For microblaze cpu - line 1184.
And for others peripherals lines 926-980. (The last parameter of function call).

Which parameters do you want for PPC405, Grant?

Regards,
Michal Simek

This is example of generator.

/ {
	model = "mONStR";
	chosen {
		linux,platform = <600>;
		bootargs = "root=/dev/xsysace/disc0/part2";
	} ;
	cpus {
		#size-cells = <0>;
		#cpus = < 0 >;
		#address-cells = <1>;
		microblaze_0,5.00.c {
			32-bit;
			linux,boot-cpu;
			device_type = "cpu";
			reg = <0>;
			clock-frequency = <5f5e1000>;
			timebase-frequency = <1FCA055>;
			i-cache-line-size = <2000>;
			i-cache-size = <10>;
			d-cache-line-size = <2000>;
			d-cache-size = <10>;
			xilinx,pvr = <0>;
			xilinx,debug-enabled = <1>;
			xilinx,fsl-links = <0>;
		} ;
	} ;

	opb_mdm@41400000 {
		compatible = "opb_mdm_2.00.a\0opb_mdm";
		name = "debug_module";
		reg = < 41400000 10000 >;
		device_type = "opb_mdm";
		xilinx,mb-dbg-ports = <1>;
		xilinx,uart-width = <8>;
		xilinx,use-uart = <1>;
	} ;
	opb_uartlite@40600000 {
		compatible = "opb_uartlite_1.00.b\0opb_uartlite";
		name = "RS232_Uart_1";
		interrupts = < 4 0 >;
		reg = < 40600000 10000 >;
		device_type = "opb_uartlite";
		xilinx,baudrate = <2580>;
		xilinx,data-bits = <8>;
		xilinx,clk-freq = <5f5e100>;
		xilinx,odd-parity = <0>;
		xilinx,use-parity = <0>;
	} ;
	opb_ethernet@40c00000 {
		compatible = "opb_ethernet_1.04.a\0opb_ethernet";
		name = "Ethernet_MAC";
		interrupts = < 3 0 >;
		reg = < 40c00000 10000 >;
		device_type = "opb_ethernet";
		xilinx,cam-exist = <0>;
		xilinx,dev-blk-id = <1>;
		xilinx,dev-mir-enable = <1>;
		xilinx,dma-present = <1>;
		xilinx,include-dev-pencoder = <1>;
		xilinx,ipif-rdfifo-depth = <8000>;
		xilinx,ipif-wrfifo-depth = <8000>;
		xilinx,mii-exist = <1>;
	} ;
	opb_sysace@41820000 {
		compatible = "opb_sysace_1.00.c\0opb_sysace";
		name = "SysACE_CompactFlash";
		reg = < 41820000 10000 >;
		device_type = "opb_sysace";
		xilinx,mem-width = <10>;
	} ;
	opb_gpio@40000000 {
		compatible = "opb_gpio_3.01.b\0opb_gpio";
		name = "LEDs_4Bit";
		reg = < 40000000 10000 >;
		device_type = "opb_gpio";
		xilinx,gpio-width = <4>;
		xilinx,is-dual = <0>;
	} ;
	memory@30000000 {
		edk_name = "DDR_256MB_32MX64_rank1_row13_col10_cl2_5";
		compatible = "opb_ddr";
		memreg:reg = < 30000000 10000000 >;
		device_type = "memory";
	} ;
	opb_ps2_dual_ref@7a400000 {
		compatible = "opb_ps2_dual_ref_1.00.a\0opb_ps2_dual_ref";
		name = "PS2_Ports";
		interrupts = < 2 0 >;
		interrupts = < 1 0 >;
		reg = < 7a400000 10000 >;
		device_type = "opb_ps2_dual_ref";
	} ;
	opb_timer@41c00000 {
		compatible = "opb_timer_1.00.b\0opb_timer";
		name = "opb_timer_1";
		interrupts = < 0 0 >;
		reg = < 41c00000 10000 >;
		device_type = "opb_timer";
		xilinx,count-width = <20>;
		xilinx,one-timer-only = <0>;
	} ;
	opb_intc@41200000 {
		compatible = "opb_intc_1.00.c\0opb_intc";
		name = "opb_intc_0";
		reg = < 41200000 10000 >;
		device_type = "opb_intc";
	} ;
	opb_uart16550@40400000 {
		compatible = "opb_uart16550_1.00.d\0opb_uart16550";
		name = "opb_uart16550_0";
		reg = < 40400000 10000 >;
		device_type = "opb_uart16550";
	} ;
	opb_sysace@41800000 {
		compatible = "opb_sysace_1.00.c\0opb_sysace";
		name = "opb_sysace_0";
		reg = < 41800000 10000 >;
		device_type = "opb_sysace";
		xilinx,mem-width = <10>;
	} ;
} ;
#10 lore raw
Quoted 28 lines · Michal Simek
Quoted 6 lines
Quoted 3 lines

In my opinion will be better generate only parameters which you want not all.
That smells with unusable parameters.

In the long term, this may be true. In the short term:
1) dtb size is not the key problem

Yes of course

Quoted 3 lines

2) making sure that everything works is a key problem.
3) The code that generates the dts should be as simple as possible, so that we can easily document what it does.

Yes but you must document every parameter which your generate do. The better way is document only parameters which you want use.

Quoted 3 lines

In the long term, I'm all for optimizing the device tree that gets built,
assuming that it appears to be a problem in real systems.

We can optimize now. I made new version of my generator u-boot_v3_00_a (monstr.eu) where you can simply add parameter which you want to use.

If you want use any parameter add it.
For microblaze cpu - line 1184.
And for others peripherals lines 926-980. (The last parameter of function call).

Which parameters do you want for PPC405, Grant?

Regards,
Michal Simek

Quoted 7 lines

This is example of generator.

/ {
	model = "mONStR";

	chosen {
		linux,platform = <600>;

linux,platform is long obsolete. Kill it.

Quoted 7 lines
		bootargs = "root=/dev/xsysace/disc0/part2";
	} ;
	cpus {
		#size-cells = <0>;
		#cpus = < 0 >;
		#address-cells = <1>;
		microblaze_0,5.00.c {

Still missing an @0 here.

Quoted 2 lines
			32-bit;
			linux,boot-cpu;

32-bit and linux,boot-cpu are both obsolete (the first was never specified anywhere) and should be removed.

Quoted 8 lines
			device_type = "cpu";
			reg = <0>;
			clock-frequency = <5f5e1000>;
			timebase-frequency = <1FCA055>;
			i-cache-line-size = <2000>;
			i-cache-size = <10>;
			d-cache-line-size = <2000>;
			d-cache-size = <10>;
Quoted 8 lines
			xilinx,pvr = <0>;
			xilinx,debug-enabled = <1>;
			xilinx,fsl-links = <0>;
		} ;
	} ;

	opb_mdm@41400000 {
		compatible = "opb_mdm_2.00.a\0opb_mdm";

Please use the new "opb_mdm_2.00.a", "opb_mdm" syntax.

Quoted 1 line
		name = "debug_module";

Don't create properties called 'name'. In real OF the 'name' property is a synonym for the node name without the @address part. Although it's possible to encode a name property in a flattened tree with a different value, it's a bad idea since it will clash with the OF notion of this property. In Linux this will cause a collision when the tree is unflattened.

We should probably fix dtc to reject this, in fact.

Quoted 2 lines
		reg = < 41400000 10000 >;
		device_type = "opb_mdm";

Get rid of all your device_type values, they're all bogus. The only devices which should have device_type at all are the ethernets and maybe the uarts, and in these cases the values should be "network" and "serial" respectively.

Quoted 9 lines
		xilinx,mb-dbg-ports = <1>;
		xilinx,uart-width = <8>;
		xilinx,use-uart = <1>;
	} ;
	opb_uartlite@40600000 {
		compatible = "opb_uartlite_1.00.b\0opb_uartlite";
		name = "RS232_Uart_1";
		interrupts = < 4 0 >;
		reg = < 40600000 10000 >;
Quoted 8 lines
		device_type = "opb_uartlite";
		xilinx,baudrate = <2580>;
		xilinx,data-bits = <8>;
		xilinx,clk-freq = <5f5e100>;
		xilinx,odd-parity = <0>;
		xilinx,use-parity = <0>;
	} ;
	opb_ethernet@40c00000 {

The generic names convention means this should be called "ethernet@40c00000"

Quoted 24 lines
		compatible = "opb_ethernet_1.04.a\0opb_ethernet";
		name = "Ethernet_MAC";
		interrupts = < 3 0 >;
		reg = < 40c00000 10000 >;
		device_type = "opb_ethernet";
		xilinx,cam-exist = <0>;
		xilinx,dev-blk-id = <1>;
		xilinx,dev-mir-enable = <1>;
		xilinx,dma-present = <1>;
		xilinx,include-dev-pencoder = <1>;
		xilinx,ipif-rdfifo-depth = <8000>;
		xilinx,ipif-wrfifo-depth = <8000>;
		xilinx,mii-exist = <1>;
	} ;
	opb_sysace@41820000 {
		compatible = "opb_sysace_1.00.c\0opb_sysace";
		name = "SysACE_CompactFlash";
		reg = < 41820000 10000 >;
		device_type = "opb_sysace";
		xilinx,mem-width = <10>;
	} ;
	opb_gpio@40000000 {
		compatible = "opb_gpio_3.01.b\0opb_gpio";
		name = "LEDs_4Bit";
Quoted 8 lines
		reg = < 40000000 10000 >;
		device_type = "opb_gpio";
		xilinx,gpio-width = <4>;
		xilinx,is-dual = <0>;
	} ;
	memory@30000000 {
		edk_name = "DDR_256MB_32MX64_rank1_row13_col10_cl2_5";
		compatible = "opb_ddr";

The memory node shouldn't generally need a compatible property. Note that the RAM itself probably needs to be separate from the RAM controller node, if such a thing exists.

Quoted 19 lines
		memreg:reg = < 30000000 10000000 >;
		device_type = "memory";
	} ;
	opb_ps2_dual_ref@7a400000 {
		compatible = "opb_ps2_dual_ref_1.00.a\0opb_ps2_dual_ref";
		name = "PS2_Ports";
		interrupts = < 2 0 >;
		interrupts = < 1 0 >;
		reg = < 7a400000 10000 >;
		device_type = "opb_ps2_dual_ref";
	} ;
	opb_timer@41c00000 {
		compatible = "opb_timer_1.00.b\0opb_timer";
		name = "opb_timer_1";
		interrupts = < 0 0 >;
		reg = < 41c00000 10000 >;
		device_type = "opb_timer";
		xilinx,count-width = <20>;
		xilinx,one-timer-only = <0>;
Quoted 8 lines
	} ;
	opb_intc@41200000 {
		compatible = "opb_intc_1.00.c\0opb_intc";
		name = "opb_intc_0";
		reg = < 41200000 10000 >;
		device_type = "opb_intc";
	} ;
	opb_uart16550@40400000 {

Should be named "serial@..."

Quoted 13 lines
		compatible = "opb_uart16550_1.00.d\0opb_uart16550";
		name = "opb_uart16550_0";
		reg = < 40400000 10000 >;
		device_type = "opb_uart16550";
	} ;
	opb_sysace@41800000 {
		compatible = "opb_sysace_1.00.c\0opb_sysace";
		name = "opb_sysace_0";
		reg = < 41800000 10000 >;
		device_type = "opb_sysace";
		xilinx,mem-width = <10>;
	} ;
} ;
Signature · 4 lines
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson
#11 lore raw

Hi David,
I remove some labels from my generator. I created fake system with some peripherals. There are 3 buses and 3 bridges.
Can you check it and tell me what is wrong?

Thanks,
Michal Simek

/ {
	model = "mONStR";
	chosen {
		bootargs = "root=/dev/xsysace/disc0/part2";
	} ;
	cpus {
		#size-cells = <0>;
		#cpus = < 0 >;
		#address-cells = <1>;
		microblaze_0,5.00.c@0 {
			device_type = "cpu";
			reg = <0>;
			clock-frequency = <5f5e1000>;
			timebase-frequency = <1FCA055>;
			i-cache-line-size = <2000>;
			i-cache-size = <10>;
			d-cache-line-size = <2000>;
			d-cache-size = <10>;
			xilinx,pvr = <0>;
			xilinx,debug-enabled = <1>;
			xilinx,fsl-links = <0>;
		} ;
	} ;

	ethernet@10060000 {
		compatible = "opb_ethernet_1.04.a","opb_ethernet";
		interrupts = < 3 0 >;
		reg = < 10060000 10000 >;
		device_type = "network";
		xilinx,cam-exist = <0>;
		xilinx,dev-blk-id = <1>;
		xilinx,dev-mir-enable = <1>;
		xilinx,dma-present = <1>;
		xilinx,include-dev-pencoder = <1>;
		xilinx,ipif-rdfifo-depth = <8000>;
		xilinx,ipif-wrfifo-depth = <8000>;
		xilinx,mii-exist = <1>;
	} ;
	memory@20000000 {
		memreg:reg = < 20000000 10000000 >;
		device_type = "memory";
	} ;
	serial@10030000 {
		compatible = "opb_uart16550_1.00.d","opb_uart16550";
		reg = < 10030000 10000 >;
		device_type = "serial";
	} ;
	opb_timer@10020000 {
		compatible = "opb_timer_1.00.b","opb_timer";
		interrupts = < 0 0 >;
		reg = < 10020000 10000 >;
		xilinx,count-width = <20>;
		xilinx,one-timer-only = <0>;
	} ;
	opb_opb_lite@30000000 {
		ranges = < 0 30000000 10000000 >;
		opb_gpio@30020000 {
			compatible = "opb_gpio_3.01.b","opb_gpio";
			reg = < 30020000 10000 >;
			xilinx,gpio-width = <4>;
			xilinx,is-dual = <0>;
		} ;
		i2c@30030000 {
			compatible = "opb_iic_1.02.a","opb_iic";
			reg = < 30030000 10000 >;
			device_type = "i2c";
		} ;

		opb_gpio@30010000 {
			compatible = "opb_gpio_3.01.b","opb_gpio";
			reg = < 30010000 10000 >;
			xilinx,gpio-width = <20>;
			xilinx,is-dual = <0>;
		} ;
		ethernet@30040000 {
			compatible = "opb_ethernetlite_1.01.b","opb_ethernetlite";
			reg = < 30040000 10000 >;
			device_type = "network";
			xilinx,duplex = <1>;
			xilinx,rx-ping-pong = <0>;
			xilinx,tx-ping-pong = <0>;
		} ;
		opb_sysace@30050000 {
			compatible = "opb_sysace_1.00.c","opb_sysace";
			reg = < 30050000 10000 >;
			xilinx,mem-width = <10>;
		} ;
		opb_ps2_dual_ref@30060000 {
			compatible = "opb_ps2_dual_ref_1.00.a","opb_ps2_dual_ref";
			interrupts = < 2 0 >;
			interrupts = < 1 0 >;
			reg = < 30060000 10000 >;
		} ;
	};
	opb_intc@10010000 {
		compatible = "opb_intc_1.00.c","opb_intc";
		reg = < 10010000 10000 >;
	} ;
	opb_mdm@10050000 {
		compatible = "opb_mdm_2.00.a","opb_mdm";
		reg = < 10050000 10000 >;
		xilinx,mb-dbg-ports = <1>;
		xilinx,uart-width = <8>;
		xilinx,use-uart = <1>;
	} ;
	serial@10040000 {
		compatible = "opb_uartlite_1.00.b","opb_uartlite";
		interrupts = < 4 0 >;
		reg = < 10040000 10000 >;
		device_type = "serial";
		xilinx,baudrate = <2580>;
		xilinx,data-bits = <8>;
		xilinx,clk-freq = <5f5e100>;
		xilinx,odd-parity = <0>;
		xilinx,use-parity = <0>;
	} ;
	opb2plb_bridge@80000000 {
		ranges = < 0 80000000 80000000 >;
		serial@a0020000 {
			compatible = "plb_uart16550_1.00.c","plb_uart16550";
			reg = < a0020000 10000 >;
			device_type = "serial";
		} ;
		plb_gpio@a0010000 {
			compatible = "plb_gpio_1.00.b","plb_gpio";
			reg = < a0010000 10000 >;
			xilinx,gpio-width = <20>;
			xilinx,is-dual = <0>;
		} ;
		ethernet@a0000000 {
			compatible = "plb_ethernet_1.01.a","plb_ethernet";
			reg = < a0000000 10000 >;
			device_type = "network";
		} ;
		plb2opb_bridge@10000000 {
			ranges = < 0 10000000 10000000 >;
			ranges = < 1 20000000 10000000 >;
		};
		cpus {
			#size-cells = <0>;
			#cpus = < 1 >;
			#address-cells = <1>;
			ppc405_0,405@1 {
				device_type = "cpu";
				reg = <0>;
				clock-frequency = <5f5e1000>;
				timebase-frequency = <1FCA055>;
			} ;
		} ;
	};
} ;
#12 lore raw
Quoted 10 lines · Michal Simek

Hi David,
I remove some labels from my generator. I created fake system with some peripherals. There are 3 buses and 3 bridges.
Can you check it and tell me what is wrong?

Thanks,
Michal Simek

/ {
        model = "mONStR";

You should have a board-level compatible property here

Quoted 8 lines
        chosen {
                bootargs = "root=/dev/xsysace/disc0/part2";
        } ;
        cpus {
                #size-cells = <0>;
                #cpus = < 0 >;
                #address-cells = <1>;
                microblaze_0,5.00.c@0 {

Simply microblaze@0 will do.

Quoted 9 lines
                        device_type = "cpu";
                        reg = <0>;
                        clock-frequency = <5f5e1000>;
                        timebase-frequency = <1FCA055>;
                        i-cache-line-size = <2000>;
                        i-cache-size = <10>;
                        d-cache-line-size = <2000>;
                        d-cache-size = <10>;
                        xilinx,pvr = <0>;

use 'xlnx,' for the prefix; this is a comment that I received on the binding document that the stock ticker is an appropriate appreviation.

Quoted 5 lines
                        xilinx,debug-enabled = <1>;
                        xilinx,fsl-links = <0>;
                } ;
        } ;

You should have a parent 'plb' bus node for all these devices to be children of.

Quoted 2 lines
        ethernet@10060000 {
                compatible = "opb_ethernet_1.04.a","opb_ethernet";

- add manufacture prefix
- convert underscores to dashes
- drop "opb_ethernet"; there's no such thing

Just "xlnx,opb-ethernet-1.04.a" will do; or something like "xlnx,opb-ethernet-1.04b","xlnx,opb-ethernet-1.04a" works too.

Quoted 11 lines
                interrupts = < 3 0 >;
                reg = < 10060000 10000 >;
                device_type = "network";
                xilinx,cam-exist = <0>;
                xilinx,dev-blk-id = <1>;
                xilinx,dev-mir-enable = <1>;
                xilinx,dma-present = <1>;
                xilinx,include-dev-pencoder = <1>;
                xilinx,ipif-rdfifo-depth = <8000>;
                xilinx,ipif-wrfifo-depth = <8000>;
                xilinx,mii-exist = <1>;

use 'xlnx,' for prefix.

Quoted 7 lines
        } ;
        memory@20000000 {
                memreg:reg = < 20000000 10000000 >;
                device_type = "memory";
        } ;
        serial@10030000 {
                compatible = "opb_uart16550_1.00.d","opb_uart16550";

'opb_uart16550' is bogus non-device; Always specify a version for IP core compatible fields. There was some talk about defining a 'sparse16550' or some such value to reflect things that were almost a 16550 but had a different register layout; but in the mean time leave it out.

- change '_' to '-', add 'xlnx,'; etc.

Quoted 5 lines
                reg = < 10030000 10000 >;
                device_type = "serial";
        } ;
        opb_timer@10020000 {
                compatible = "opb_timer_1.00.b","opb_timer";

ditto

Quoted 6 lines
                interrupts = < 0 0 >;
                reg = < 10020000 10000 >;
                xilinx,count-width = <20>;
                xilinx,one-timer-only = <0>;
        } ;
        opb_opb_lite@30000000 {

- change '_' to '-'

Quoted 2 lines
                ranges = < 0 30000000 10000000 >;
                opb_gpio@30020000 {

Since you're bus uses the ranges property value to translate; the device address should reflect the offset off the base of the bus:
opb_gpio@20000

If instead your ranges property was empty then the full address still works. Address translation makes sense for the opb-opb-lite because it's only got one translation range. However, the plb-opb bridge covers multiple ranges so it's probably easier to leave out the translation.

Quoted 2 lines
                        compatible = "opb_gpio_3.01.b","opb_gpio";
                        reg = < 30020000 10000 >;

Same comment as above; reg = <20000 10000>; These comments go for all the nodes below.

Quoted 48 lines
                        xilinx,gpio-width = <4>;
                        xilinx,is-dual = <0>;
                } ;
                i2c@30030000 {
                        compatible = "opb_iic_1.02.a","opb_iic";
                        reg = < 30030000 10000 >;
                        device_type = "i2c";
                } ;

                opb_gpio@30010000 {
                        compatible = "opb_gpio_3.01.b","opb_gpio";
                        reg = < 30010000 10000 >;
                        xilinx,gpio-width = <20>;
                        xilinx,is-dual = <0>;
                } ;
                ethernet@30040000 {
                        compatible = "opb_ethernetlite_1.01.b","opb_ethernetlite";
                        reg = < 30040000 10000 >;
                        device_type = "network";
                        xilinx,duplex = <1>;
                        xilinx,rx-ping-pong = <0>;
                        xilinx,tx-ping-pong = <0>;
                } ;
                opb_sysace@30050000 {
                        compatible = "opb_sysace_1.00.c","opb_sysace";
                        reg = < 30050000 10000 >;
                        xilinx,mem-width = <10>;
                } ;
                opb_ps2_dual_ref@30060000 {
                        compatible = "opb_ps2_dual_ref_1.00.a","opb_ps2_dual_ref";
                        interrupts = < 2 0 >;
                        interrupts = < 1 0 >;
                        reg = < 30060000 10000 >;
                } ;
        };
        opb_intc@10010000 {
                compatible = "opb_intc_1.00.c","opb_intc";
                reg = < 10010000 10000 >;
        } ;
        opb_mdm@10050000 {
                compatible = "opb_mdm_2.00.a","opb_mdm";
                reg = < 10050000 10000 >;
                xilinx,mb-dbg-ports = <1>;
                xilinx,uart-width = <8>;
                xilinx,use-uart = <1>;
        } ;
        serial@10040000 {
                compatible = "opb_uartlite_1.00.b","opb_uartlite";
Quoted 8 lines
                interrupts = < 4 0 >;
                reg = < 10040000 10000 >;
                device_type = "serial";
                xilinx,baudrate = <2580>;
                xilinx,data-bits = <8>;
                xilinx,clk-freq = <5f5e100>;
                xilinx,odd-parity = <0>;
                xilinx,use-parity = <0>;

My patch to booting-without-of says that you should have a 'current-speed' property (instead of xlnx,baudrate) because it's a standard property; but 'xlnx,baudrate' might be a suitable alternative because this is a fixed speed device. Segher, David; what say you?

Quoted 15 lines
        } ;
        opb2plb_bridge@80000000 {
                ranges = < 0 80000000 80000000 >;
                serial@a0020000 {
                        compatible = "plb_uart16550_1.00.c","plb_uart16550";
                        reg = < a0020000 10000 >;
                        device_type = "serial";
                } ;
                plb_gpio@a0010000 {
                        compatible = "plb_gpio_1.00.b","plb_gpio";
                        reg = < a0010000 10000 >;
                        xilinx,gpio-width = <20>;
                        xilinx,is-dual = <0>;
                } ;
                ethernet@a0000000 {
Quoted 8 lines
                        compatible = "plb_ethernet_1.01.a","plb_ethernet";
                        reg = < a0000000 10000 >;
                        device_type = "network";
                } ;
                plb2opb_bridge@10000000 {
                        ranges = < 0 10000000 10000000 >;
                        ranges = < 1 20000000 10000000 >;
                };

There are no nodes on this bus. What is the intended usage? Also, you cannot have two properties with the same name, I think the syntax you want is:
ranges = <0 10000000 10000000 2 20000000 10000000>;

Also, these values won't work. They state that you've got two address range translations. The first translates from address 10000000 to address 0 (which makes sense). The second translates from address 20000000 to address 1 (which overlaps the first region, only offset by 1 byte).

Quoted 11 lines
                cpus {
                        #size-cells = <0>;
                        #cpus = < 1 >;
                        #address-cells = <1>;
                        ppc405_0,405@1 {
                                device_type = "cpu";
                                reg = <0>;
                                clock-frequency = <5f5e1000>;
                                timebase-frequency = <1FCA055>;
                        } ;
                } ;

This is weird. Is this representing a design with both a ppc and a microblaze? If so; I would generate 2 device trees. One for each processor.

Quoted 3 lines
        };
} ;

BTW, Thanks for all this work
g.

Signature · 4 lines
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.
[email protected]
(403) 399-0195
#14 lore raw
In reply to Michal Simek

=20

Quoted 5 lines

-----Original Message-----
From:=20 [email protected] g=20 [mailto:linuxppc-dev-bounces+stephen.neuendorffer=3Dxilinx.com@o

zlabs.org] On Behalf Of Michal Simek

Quoted 13 lines

Sent: Monday, October 22, 2007 9:08 PM
To: [email protected]
Cc: Leonid; Wolfgang Reissnegger; Arnd Bergmann;=20 [email protected]
Subject: RE: [microblaze-uclinux] Re: [microblaze-uclinux]=20
RE: [PATCH v3] Device tree bindings for Xilinx devices =20

Quoted 6 lines
Quoted 3 lines

In my opinion will be better generate only parameters which=20 you want not all.
That smells with unusable parameters.

In the long term, this may be true. In the short term:
1) dtb size is not the key problem

Quoted 7 lines

Yes of course

Quoted 3 lines

2) making sure that everything works is a key problem.
3) The code that generates the dts should be as simple as possible, so that we can easily document what it does.

Yes but you must document every parameter which your generate=20 do. The better way is=20
document only parameters which you want use.

No, that's exactly my point. The generator should document what it *does*
i.e. When there is a parameter in the EDK file, then such and such corresponding parameter will be generated in the dts. The devices and drivers
will inevitably change over time: your proposal would result in an unnecessary maintenance headache... The documentation of what the individual
parameters are should be unambiguous from the EDK documentation.

The only things that the generator should handle 'specially', in my opinion
are parameters that need to be munged to be standard names.

Steve

#13 lore raw
In reply to Michal Simek
Quoted 4 lines · Michal Simek

Hi David,
I remove some labels from my generator. I created fake system with some peripherals. There are 3 buses and 3 bridges.
Can you check it and tell me what is wrong?

Grant's comments all seem reasonable, apologies if I've duplicated some of them below.

Quoted 6 lines

Thanks,
Michal Simek

/ {
	model = "mONStR";

You should have #address-cells and #size-cells properties.

Quoted 8 lines
	chosen {
		bootargs = "root=/dev/xsysace/disc0/part2";
	} ;
	cpus {
		#size-cells = <0>;
		#cpus = < 0 >;
		#address-cells = <1>;
		microblaze_0,5.00.c@0 {

That name is acceptable, but I think just cpu@0 would be better. The generic names convention seems to be frequently ignored for cpus, but I don't see a good reason to.

Quoted 26 lines
			device_type = "cpu";
			reg = <0>;
			clock-frequency = <5f5e1000>;
			timebase-frequency = <1FCA055>;
			i-cache-line-size = <2000>;
			i-cache-size = <10>;
			d-cache-line-size = <2000>;
			d-cache-size = <10>;
			xilinx,pvr = <0>;
			xilinx,debug-enabled = <1>;
			xilinx,fsl-links = <0>;
		} ;
	} ;

	ethernet@10060000 {
		compatible = "opb_ethernet_1.04.a","opb_ethernet";
		interrupts = < 3 0 >;
		reg = < 10060000 10000 >;
		device_type = "network";
		xilinx,cam-exist = <0>;
		xilinx,dev-blk-id = <1>;
		xilinx,dev-mir-enable = <1>;
		xilinx,dma-present = <1>;
		xilinx,include-dev-pencoder = <1>;
		xilinx,ipif-rdfifo-depth = <8000>;
		xilinx,ipif-wrfifo-depth = <8000>;
Quoted 8 lines
		xilinx,mii-exist = <1>;
	} ;
	memory@20000000 {
		memreg:reg = < 20000000 10000000 >;
		device_type = "memory";
	} ;
	serial@10030000 {
		compatible = "opb_uart16550_1.00.d","opb_uart16550";

Is this serial port actually 16550 compatible? If so it should have "ns16550" in the compatible list.

Quoted 11 lines
		reg = < 10030000 10000 >;
		device_type = "serial";
	} ;
	opb_timer@10020000 {
		compatible = "opb_timer_1.00.b","opb_timer";
		interrupts = < 0 0 >;
		reg = < 10020000 10000 >;
		xilinx,count-width = <20>;
		xilinx,one-timer-only = <0>;
	} ;
	opb_opb_lite@30000000 {

This is a bus bridge, and so needs #address-cells and #size-cells properties. It should also have a compatible property to describe the type of bridge.

Quoted 4 lines
		ranges = < 0 30000000 10000000 >;
		opb_gpio@30020000 {
			compatible = "opb_gpio_3.01.b","opb_gpio";
			reg = < 30020000 10000 >;

This doesn't look quite right. The reg property is translated by the parent's ranges property. So shouldn't this be just reg = <20000 10000>, with the 30000000 added by the parent?

Quoted 7 lines
			xilinx,gpio-width = <4>;
			xilinx,is-dual = <0>;
		} ;
		i2c@30030000 {
			compatible = "opb_iic_1.02.a","opb_iic";
			reg = < 30030000 10000 >;
			device_type = "i2c";

There was talk of an i2c device_type, but I don't think it ever actually happened. I think we should drop this.

Quoted 17 lines
		} ;

		opb_gpio@30010000 {
			compatible = "opb_gpio_3.01.b","opb_gpio";
			reg = < 30010000 10000 >;
			xilinx,gpio-width = <20>;
			xilinx,is-dual = <0>;
		} ;
		ethernet@30040000 {
			compatible = "opb_ethernetlite_1.01.b","opb_ethernetlite";
			reg = < 30040000 10000 >;
			device_type = "network";
			xilinx,duplex = <1>;
			xilinx,rx-ping-pong = <0>;
			xilinx,tx-ping-pong = <0>;
		} ;
		opb_sysace@30050000 {
Quoted 8 lines
			compatible = "opb_sysace_1.00.c","opb_sysace";
			reg = < 30050000 10000 >;
			xilinx,mem-width = <10>;
		} ;
		opb_ps2_dual_ref@30060000 {
			compatible = "opb_ps2_dual_ref_1.00.a","opb_ps2_dual_ref";
			interrupts = < 2 0 >;
			interrupts = < 1 0 >;

Uh... duplicate property names here. Should be

	interrupts = <2 0 1 0>;

Also you need an interrupt-parent property somewhere. Either here, or in one of the ancestor bridges.

Quoted 6 lines
			reg = < 30060000 10000 >;
		} ;
	};
	opb_intc@10010000 {
		compatible = "opb_intc_1.00.c","opb_intc";
		reg = < 10010000 10000 >;

Is this an interrupt controller? If so it should have the interrupt-controller and #interrupt-cells properties.

Quoted 13 lines
	} ;
	opb_mdm@10050000 {
		compatible = "opb_mdm_2.00.a","opb_mdm";
		reg = < 10050000 10000 >;
		xilinx,mb-dbg-ports = <1>;
		xilinx,uart-width = <8>;
		xilinx,use-uart = <1>;
	} ;
	serial@10040000 {
		compatible = "opb_uartlite_1.00.b","opb_uartlite";
		interrupts = < 4 0 >;
		reg = < 10040000 10000 >;
		device_type = "serial";
Quoted 8 lines
		xilinx,baudrate = <2580>;
		xilinx,data-bits = <8>;
		xilinx,clk-freq = <5f5e100>;
		xilinx,odd-parity = <0>;
		xilinx,use-parity = <0>;
	} ;
	opb2plb_bridge@80000000 {
		ranges = < 0 80000000 80000000 >;

Missing #address-cells and #size-cells again.

Quoted 11 lines
		serial@a0020000 {
			compatible = "plb_uart16550_1.00.c","plb_uart16550";
			reg = < a0020000 10000 >;
			device_type = "serial";
		} ;
		plb_gpio@a0010000 {
			compatible = "plb_gpio_1.00.b","plb_gpio";
			reg = < a0010000 10000 >;
			xilinx,gpio-width = <20>;
			xilinx,is-dual = <0>;
		} ;
Quoted 8 lines
		ethernet@a0000000 {
			compatible = "plb_ethernet_1.01.a","plb_ethernet";
			reg = < a0000000 10000 >;
			device_type = "network";
		} ;
		plb2opb_bridge@10000000 {
			ranges = < 0 10000000 10000000 >;
			ranges = < 1 20000000 10000000 >;

Duplicate properties again.

Quoted 2 lines
		};
		cpus {

This really doesn't look right. I don't think it's technically forbidden, but almost nothing is going to look for cpus anywhere other than /cpus. If this dt is for some sort of daughter card, and these entries represent the cpu of the containing system, we'll need to work out a different representation (that won't have device_type="cpu"). Although it may be a cpu, it's not *the* cpu from the prespective of something running on the microblaze.

Quoted 17 lines
			#size-cells = <0>;
			#cpus = < 1 >;
			#address-cells = <1>;
			ppc405_0,405@1 {
				device_type = "cpu";
				reg = <0>;
				clock-frequency = <5f5e1000>;
				timebase-frequency = <1FCA055>;
			} ;
		} ;
	};
} ;

_______________________________________________
Linuxppc-dev mailing list
[email protected]
https://ozlabs.org/mailman/listinfo/linuxppc-dev

Signature · 4 lines
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson
#17 lore raw
In reply to Stephen Neuendorffer

I've incorporated a good portion of the combined feedback and pushed the gen_mhs_devtree patches back to Grant.
The few things I haven't done are relatively cosmetic (like getting rid of linux,phandle references, decimal vs. hex, and the 'embedded \0') ,=20
The one significant problem that I'm not sure how to deal with pertains to multiple memory nodes, which often happens. Should they all be exported at the toplevel (which dtc seems to require), or only the main memory which is used by Linux?

Some specific responses below:

Quoted 8 lines
Quoted 7 lines

Steve

/ {
        #address-cells =3D <1>;
        #size-cells =3D <1>;
        compatible =3D "ibm,plb4";
Quoted 4 lines

Not quite; the bus itself needs to be one level deeper. Compatible here is refering to the platform itself, not the bus and so should be the actual board name or something similar. Maybe something like:
"xlnx,ml403","xlnx,generic-virtex4";

perhaps the toplevel compatible node should contain a SHA1 hash of system.mhs?

Quoted 7 lines
Quoted 3 lines
        Ethernet_MAC {
                compatible =3D

"xilinx,opb-ethernet-1.04.a\0xilinx,opb-ethernet";

Yes; this is the idea; but I don't like "xilinx,opb-ethernet". I think we should always specify specific versions and not try to guess what the 'generic' device compatible interface is.

I've left this in, until we can come up with canonical compatible versions.
(perhaps just truncating the minor version?)

I've attached one more generated test tree, in the hopes that gen-mhs-devtree can be put to bed and used to validate Michel's BSP oriented version. Again, the goal is not to make it perfect, but to make it good enough that it can be a temporary bridge between the EDK-integrated generator and those writing device drivers.

Steve

/ {
	#address-cells =3D <1>;
	#size-cells =3D <1>;
	model =3D "system.mhs";
	chosen {
		bootargs =3D "root=3D/dev/xsysace/disc0/part2";
		interrupt-controller =3D <101>;
	} ;
	cpus {
		#address-cells =3D <1>;
		#cpus =3D <1>;
		#size-cells =3D <0>;
		microblaze,6.00.b@0 {
			32-bit;
			clock-frequency =3D <5f5e1000>;
			d-cache-line-size =3D <10>;
			d-cache-size =3D <4000>;
			device_type =3D "cpu";
			i-cache-line-size =3D <10>;
			i-cache-size =3D <4000>;
			linux,boot-cpu;
			reg =3D <0>;
			timebase-frequency =3D <1fca055>;
			xlnx,cache-byte-size =3D <4000>;
			xlnx,dcache-baseaddr =3D <50000000>;
			xlnx,dcache-byte-size =3D <4000>;
			xlnx,dcache-highaddr =3D <5fffffff>;
			xlnx,debug-enabled =3D <1>;
			xlnx,div-zero-exception =3D <1>;
			xlnx,dopb-bus-exception =3D <1>;
			xlnx,fpu-exception =3D <1>;
			xlnx,icache-baseaddr =3D <50000000>;
			xlnx,icache-highaddr =3D <5fffffff>;
			xlnx,ill-opcode-exception =3D <1>;
			xlnx,iopb-bus-exception =3D <1>;
			xlnx,number-of-pc-brk =3D <2>;
			xlnx,pvr =3D <2>;
			xlnx,unaligned-exceptions =3D <1>;
			xlnx,use-barrel =3D <1>;
			xlnx,use-dcache =3D <1>;
			xlnx,use-div =3D <1>;
			xlnx,use-fpu =3D <1>;
			xlnx,use-icache =3D <1>;
			xlnx,use-msr-instr =3D <1>;
			xlnx,use-pcmp-instr =3D <1>;
		} ;
	} ;
	memory {
		device_type =3D "memory";
		reg =3D < 50000000 10000000 >;
	} ;
	opb_v20 {
		compatible =3D
"xlnx,opb-v20-1.10.c\0xlnx,opb-v20\0ibm,opb";
		ethernet@40c00000 {
			compatible =3D
"xlnx,opb-ethernet-1.04.a\0xlnx,opb-ethernet";
			device_type =3D "network";
			interrupt-parent =3D <101>;
			interrupts =3D < 1 0 >;
			reg =3D < 40c00000 10000 >;
			xlnx,cam-exist =3D <0>;
			xlnx,dev-blk-id =3D <0>;
			xlnx,dev-mir-enable =3D <0>;
			xlnx,dma-present =3D <1>;
			xlnx,edk-name =3D "Ethernet_MAC";
			xlnx,include-dev-pencoder =3D <0>;
			xlnx,ipif-rdfifo-depth =3D <4000>;
			xlnx,ipif-wrfifo-depth =3D <4000>;
			xlnx,jumbo-exist =3D <0>;
			xlnx,mac-fifo-depth =3D <10>;
			xlnx,mii-exist =3D <1>;
			xlnx,opb-clk-period-ps =3D <2710>;
			xlnx,reset-present =3D <1>;
			xlnx,rx-dre-type =3D <0>;
			xlnx,rx-include-csum =3D <0>;
			xlnx,tx-dre-type =3D <0>;
			xlnx,tx-include-csum =3D <0>;
		} ;
		interrupt-controller@41200000 {
			#interrupt-cells =3D <2>;
			compatible =3D
"xlnx,opb-intc-1.00.c\0xlnx,opb-intc";
			interrupt-controller;
			linux,phandle =3D <101>;
			reg =3D < 41200000 10000 >;
			xlnx,edk-name =3D "opb_intc_0";
		} ;
		memory@50000000 {
			compatible =3D
"xlnx,mch-opb-ddr2-1.02.a\0xlnx,mch-opb-ddr2";
			device_type =3D "memory";
			reg =3D < 50000000 10000000 >;
			xlnx,ddr-async-support =3D <1>;
			xlnx,ddr-awidth =3D <d>;
			xlnx,ddr-bank-awidth =3D <2>;
			xlnx,ddr-cas-lat =3D <3>;
			xlnx,ddr-col-awidth =3D <a>;
			xlnx,ddr-dwidth =3D <20>;
			xlnx,ddr-tfaw =3D <c350>;
			xlnx,ddr-tmrd =3D <61a8>;
			xlnx,ddr-tras =3D <15f90>;
			xlnx,ddr-trc =3D <fde8>;
			xlnx,ddr-trcd =3D <61a8>;
			xlnx,ddr-trefi =3D <7704c0>;
			xlnx,ddr-trfc =3D <1c138>;
			xlnx,ddr-trp =3D <4e20>;
			xlnx,ddr-trrd =3D <3a98>;
			xlnx,ddr-twr =3D <3a98>;
			xlnx,ddr-twtr =3D <1>;
			xlnx,edk-name =3D "DDR2_SDRAM_32Mx32";
			xlnx,extra-tsu =3D <0>;
			xlnx,idelayctrl-loc =3D
"IDELAYCTRL_X0Y5-IDELAYCTRL_X0Y4-IDELAYCTRL_X0Y1-IDELAYCTRL_X0Y0";
			xlnx,include-opb-burst-support =3D <1>;
			xlnx,include-opb-ipif =3D <1>;
			xlnx,mch0-accessbuf-depth =3D <4>;
			xlnx,mch1-accessbuf-depth =3D <8>;
			xlnx,num-banks-mem =3D <1>;
			xlnx,num-channels =3D <2>;
			xlnx,num-clk-pairs =3D <2>;
			xlnx,num-idelayctrl =3D <4>;
			xlnx,reg-dimm =3D <0>;
			xlnx,xcl0-writexfer =3D <0>;
		} ;
		opb_hwicap@41300000 {
			compatible =3D
"xlnx,opb-hwicap-1.10.a\0xlnx,opb-hwicap";
			reg =3D < 41300000 10000 >;
			xlnx,edk-name =3D "opb_hwicap_0";
		} ;
		opb_iic@40800000 {
			compatible =3D
"xlnx,opb-iic-1.02.a\0xlnx,opb-iic";
			interrupt-parent =3D <101>;
			interrupts =3D < 2 0 >;
			reg =3D < 40800000 10000 >;
			xlnx,clk-freq =3D <5f5e100>;
			xlnx,edk-name =3D "IIC_EEPROM";
			xlnx,iic-freq =3D <186a0>;
			xlnx,ten-bit-adr =3D <0>;
		} ;
		opb_mdm@41400000 {
			compatible =3D
"xlnx,opb-mdm-2.00.a\0xlnx,opb-mdm";
			reg =3D < 41400000 10000 >;
			xlnx,edk-name =3D "debug_module";
			xlnx,mb-dbg-ports =3D <1>;
			xlnx,uart-width =3D <8>;
			xlnx,use-uart =3D <1>;
		} ;
		opb_timer@41c00000 {
			compatible =3D
"xlnx,opb-timer-1.00.b\0xlnx,opb-timer";
			interrupt-parent =3D <101>;
			interrupts =3D < 0 0 >;
			reg =3D < 41c00000 10000 >;
			xlnx,count-width =3D <20>;
			xlnx,edk-name =3D "opb_timer_1";
			xlnx,one-timer-only =3D <1>;
		} ;
		serial@40600000 {
			compatible =3D
"xlnx,opb-uartlite-1.00.b\0xlnx,opb-uartlite";
			device_type =3D "serial";
			interrupt-parent =3D <101>;
			interrupts =3D < 3 0 >;
			reg =3D < 40600000 10000 >;
			xlnx,baudrate =3D <2580>;
			xlnx,clk-freq =3D <5f5e100>;
			xlnx,data-bits =3D <8>;
			xlnx,edk-name =3D "RS232_Uart_1";
			xlnx,odd-parity =3D <0>;
			xlnx,use-parity =3D <0>;
		} ;
	} ;
} ;
Quoted 167 lines

-----Original Message-----
From: [email protected]=20 [mailto:[email protected]] On Behalf Of=20 Stephen Neuendorffer
Sent: Friday, October 19, 2007 4:43 PM
To: Stephen Neuendorffer; Grant Likely
Cc: Leonid; Arnd Bergmann; [email protected];=20 [email protected]; Wolfgang Reissnegger
Subject: [microblaze-uclinux] RE: [PATCH v3] Device tree=20 bindings for Xilinx devices
=20
=20
Here's a full .dts generated using an updated version of gen_mhs_devtree.py, following the proposal.
It happens to be a microblaze system, but you get the idea. =20
Grant: Is this pretty what you intend?
=20
Steve
=20

/ {
	#address-cells =3D <1>;
	#size-cells =3D <1>;
	compatible =3D "ibm,plb4";
	model =3D "system.mhs";
	Ethernet_MAC {
		compatible =3D
"xilinx,opb-ethernet-1.04.a\0xilinx,opb-ethernet";
		device_type =3D "opb_ethernet";
		interrupt-parent =3D <101>;
		interrupts =3D < 1 0 >;
		reg =3D < 40c00000 10000 >;
		xilinx,cam-exist =3D <0>;
		xilinx,dev-blk-id =3D <0>;
		xilinx,dev-mir-enable =3D <0>;
		xilinx,dma-present =3D <1>;
		xilinx,include-dev-pencoder =3D <0>;
		xilinx,ipif-rdfifo-depth =3D <4000>;
		xilinx,ipif-wrfifo-depth =3D <4000>;
		xilinx,jumbo-exist =3D <0>;
		xilinx,mac-fifo-depth =3D <10>;
		xilinx,mii-exist =3D <1>;
		xilinx,opb-clk-period-ps =3D <2710>;
		xilinx,reset-present =3D <1>;
		xilinx,rx-dre-type =3D <0>;
		xilinx,rx-include-csum =3D <0>;
		xilinx,tx-dre-type =3D <0>;
		xilinx,tx-include-csum =3D <0>;
	} ;
	IIC_EEPROM {
		compatible =3D "xilinx,opb-iic-1.02.a\0xilinx,opb-iic";
		device_type =3D "opb_iic";
		interrupt-parent =3D <101>;
		interrupts =3D < 2 0 >;
		reg =3D < 40800000 10000 >;
		xilinx,clk-freq =3D <5f5e100>;
		xilinx,iic-freq =3D <186a0>;
		xilinx,ten-bit-adr =3D <0>;
	} ;
	RS232_Uart_1 {
		compatible =3D
"xilinx,opb-uartlite-1.00.b\0xilinx,opb-uartlite";
		device_type =3D "opb_uartlite";
		interrupt-parent =3D <101>;
		interrupts =3D < 3 0 >;
		reg =3D < 40600000 10000 >;
		xilinx,baudrate =3D <2580>;
		xilinx,clk-freq =3D <5f5e100>;
		xilinx,data-bits =3D <8>;
		xilinx,odd-parity =3D <0>;
		xilinx,use-parity =3D <0>;
	} ;
	chosen {
		bootargs =3D "root=3D/dev/xsysace/disc0/part2";
		interrupt-controller =3D <101>;
		linux,platform =3D <600>;
	} ;
	cpus {
		#address-cells =3D <1>;
		#cpus =3D <1>;
		#size-cells =3D <0>;
		microblaze_0,6.00. {
			32-bit;
			clock-frequency =3D <5f5e1000>;
			d-cache-line-size =3D <10>;
			d-cache-size =3D <4000>;
			device_type =3D "cpu";
			i-cache-line-size =3D <10>;
			i-cache-size =3D <4000>;
			linux,boot-cpu;
			reg =3D <0>;
			timebase-frequency =3D <1fca055>;
			xilinx,cache-byte-size =3D <4000>;
			xilinx,dcache-baseaddr =3D <50000000>;
			xilinx,dcache-byte-size =3D <4000>;
			xilinx,dcache-highaddr =3D <5fffffff>;
			xilinx,debug-enabled =3D <1>;
			xilinx,div-zero-exception =3D <1>;
			xilinx,dopb-bus-exception =3D <1>;
			xilinx,fpu-exception =3D <1>;
			xilinx,icache-baseaddr =3D <50000000>;
			xilinx,icache-highaddr =3D <5fffffff>;
			xilinx,ill-opcode-exception =3D <1>;
			xilinx,iopb-bus-exception =3D <1>;
			xilinx,number-of-pc-brk =3D <2>;
			xilinx,pvr =3D <2>;
			xilinx,unaligned-exceptions =3D <1>;
			xilinx,use-barrel =3D <1>;
			xilinx,use-dcache =3D <1>;
			xilinx,use-div =3D <1>;
			xilinx,use-fpu =3D <1>;
			xilinx,use-icache =3D <1>;
			xilinx,use-msr-instr =3D <1>;
			xilinx,use-pcmp-instr =3D <1>;
		} ;
	} ;
	debug_module {
		compatible =3D "xilinx,opb-mdm-2.00.a\0xilinx,opb-mdm";
		device_type =3D "opb_mdm";
		reg =3D < 41400000 10000 >;
		xilinx,mb-dbg-ports =3D <1>;
		xilinx,uart-width =3D <8>;
		xilinx,use-uart =3D <1>;
	} ;
	memory@50000000 {
		device_type =3D "memory";
		edk_name =3D "DDR2_SDRAM_32Mx32";
		memreg:reg =3D < 50000000 10000000 >;
	} ;
	opb_hwicap_0 {
		compatible =3D
"xilinx,opb-hwicap-1.10.a\0xilinx,opb-hwicap";
		device_type =3D "opb_hwicap";
		reg =3D < 41300000 10000 >;
	} ;
	opb_intc_0 {
		#interrupt-cells =3D <2>;
		compatible =3D "xilinx,opb-intc-1.00.c\0xilinx,opb-intc";
		device_type =3D "opb_intc";
		interrupt-controller;
		linux,phandle =3D <101>;
		reg =3D < 41200000 10000 >;
	} ;
	opb_timer_1 {
		compatible =3D
"xilinx,opb-timer-1.00.b\0xilinx,opb-timer";
		device_type =3D "opb_timer";
		interrupt-parent =3D <101>;
		interrupts =3D < 0 0 >;
		reg =3D < 41c00000 10000 >;
		xilinx,count-width =3D <20>;
		xilinx,one-timer-only =3D <1>;
	} ;
} ;=20

=20
=20
=20
___________________________
microblaze-uclinux mailing list
[email protected]
Project Home Page :=20
http://www.itee.uq.edu.au/~jwilliams/mblaze-uclinux
Mailing List Archive :=20
http://www.itee.uq.edu.au/~listarch/microblaze-uclinux/
=20
=20
=20

#18 lore raw

On Tue, Oct 23, 2007 at 06:15:22PM -0700, Stephen Neuendorffer wrote:
[snip]

Quoted 7 lines
/ {
	#address-cells = <1>;
	#size-cells = <1>;
	model = "system.mhs";
	chosen {
		bootargs = "root=/dev/xsysace/disc0/part2";
		interrupt-controller = <101>;

interrupt-controller in /chosen is obsolete. Drop it.

Quoted 7 lines
	} ;
	cpus {
		#address-cells = <1>;
		#cpus = <1>;
		#size-cells = <0>;
		microblaze,6.00.b@0 {
			32-bit;

32-bit was never a specified property. Drop.

Quoted 7 lines
			clock-frequency = <5f5e1000>;
			d-cache-line-size = <10>;
			d-cache-size = <4000>;
			device_type = "cpu";
			i-cache-line-size = <10>;
			i-cache-size = <4000>;
			linux,boot-cpu;

linux,boot-cpu is long obsolete. Drop.

Quoted 23 lines
			reg = <0>;
			timebase-frequency = <1fca055>;
			xlnx,cache-byte-size = <4000>;
			xlnx,dcache-baseaddr = <50000000>;
			xlnx,dcache-byte-size = <4000>;
			xlnx,dcache-highaddr = <5fffffff>;
			xlnx,debug-enabled = <1>;
			xlnx,div-zero-exception = <1>;
			xlnx,dopb-bus-exception = <1>;
			xlnx,fpu-exception = <1>;
			xlnx,icache-baseaddr = <50000000>;
			xlnx,icache-highaddr = <5fffffff>;
			xlnx,ill-opcode-exception = <1>;
			xlnx,iopb-bus-exception = <1>;
			xlnx,number-of-pc-brk = <2>;
			xlnx,pvr = <2>;
			xlnx,unaligned-exceptions = <1>;
			xlnx,use-barrel = <1>;
			xlnx,use-dcache = <1>;
			xlnx,use-div = <1>;
			xlnx,use-fpu = <1>;
			xlnx,use-icache = <1>;
			xlnx,use-msr-instr = <1>;
Quoted 8 lines
			xlnx,use-pcmp-instr = <1>;
		} ;
	} ;
	memory {
		device_type = "memory";
		reg = < 50000000 10000000 >;
	} ;
	opb_v20 {

Any node with children must have #address-cells and #size-cells properties. This one almost certainly needs 'ranges' too. If it has any bridge control registers, it should have 'reg' also.

Quoted 7 lines

compatible =

"xlnx,opb-v20-1.10.c\0xlnx,opb-v20\0ibm,opb";
		ethernet@40c00000 {
			compatible =
"xlnx,opb-ethernet-1.04.a\0xlnx,opb-ethernet";
			device_type = "network";
			interrupt-parent = <101>;

It would be kind of neat if you could get this to generate labels and references, rather than explicit phandles for the interrupt tree.

Quoted 22 lines
			interrupts = < 1 0 >;
			reg = < 40c00000 10000 >;
			xlnx,cam-exist = <0>;
			xlnx,dev-blk-id = <0>;
			xlnx,dev-mir-enable = <0>;
			xlnx,dma-present = <1>;
			xlnx,edk-name = "Ethernet_MAC";
			xlnx,include-dev-pencoder = <0>;
			xlnx,ipif-rdfifo-depth = <4000>;
			xlnx,ipif-wrfifo-depth = <4000>;
			xlnx,jumbo-exist = <0>;
			xlnx,mac-fifo-depth = <10>;
			xlnx,mii-exist = <1>;
			xlnx,opb-clk-period-ps = <2710>;
			xlnx,reset-present = <1>;
			xlnx,rx-dre-type = <0>;
			xlnx,rx-include-csum = <0>;
			xlnx,tx-dre-type = <0>;
			xlnx,tx-include-csum = <0>;
		} ;
		interrupt-controller@41200000 {
			#interrupt-cells = <2>;
Quoted 8 lines
			compatible =
"xlnx,opb-intc-1.00.c\0xlnx,opb-intc";
			interrupt-controller;
			linux,phandle = <101>;
			reg = < 41200000 10000 >;
			xlnx,edk-name = "opb_intc_0";
		} ;
		memory@50000000 {

Ok, I don't really understand why the memory node is duplicated here. It seems to be covering the same range as the top-level /memory node.

Quoted 72 lines

compatible =

"xlnx,mch-opb-ddr2-1.02.a\0xlnx,mch-opb-ddr2";
			device_type = "memory";
			reg = < 50000000 10000000 >;
			xlnx,ddr-async-support = <1>;
			xlnx,ddr-awidth = <d>;
			xlnx,ddr-bank-awidth = <2>;
			xlnx,ddr-cas-lat = <3>;
			xlnx,ddr-col-awidth = <a>;
			xlnx,ddr-dwidth = <20>;
			xlnx,ddr-tfaw = <c350>;
			xlnx,ddr-tmrd = <61a8>;
			xlnx,ddr-tras = <15f90>;
			xlnx,ddr-trc = <fde8>;
			xlnx,ddr-trcd = <61a8>;
			xlnx,ddr-trefi = <7704c0>;
			xlnx,ddr-trfc = <1c138>;
			xlnx,ddr-trp = <4e20>;
			xlnx,ddr-trrd = <3a98>;
			xlnx,ddr-twr = <3a98>;
			xlnx,ddr-twtr = <1>;
			xlnx,edk-name = "DDR2_SDRAM_32Mx32";
			xlnx,extra-tsu = <0>;
			xlnx,idelayctrl-loc =
"IDELAYCTRL_X0Y5-IDELAYCTRL_X0Y4-IDELAYCTRL_X0Y1-IDELAYCTRL_X0Y0";
			xlnx,include-opb-burst-support = <1>;
			xlnx,include-opb-ipif = <1>;
			xlnx,mch0-accessbuf-depth = <4>;
			xlnx,mch1-accessbuf-depth = <8>;
			xlnx,num-banks-mem = <1>;
			xlnx,num-channels = <2>;
			xlnx,num-clk-pairs = <2>;
			xlnx,num-idelayctrl = <4>;
			xlnx,reg-dimm = <0>;
			xlnx,xcl0-writexfer = <0>;
		} ;
		opb_hwicap@41300000 {
			compatible =
"xlnx,opb-hwicap-1.10.a\0xlnx,opb-hwicap";
			reg = < 41300000 10000 >;
			xlnx,edk-name = "opb_hwicap_0";
		} ;
		opb_iic@40800000 {
			compatible =
"xlnx,opb-iic-1.02.a\0xlnx,opb-iic";
			interrupt-parent = <101>;
			interrupts = < 2 0 >;
			reg = < 40800000 10000 >;
			xlnx,clk-freq = <5f5e100>;
			xlnx,edk-name = "IIC_EEPROM";
			xlnx,iic-freq = <186a0>;
			xlnx,ten-bit-adr = <0>;
		} ;
		opb_mdm@41400000 {
			compatible =
"xlnx,opb-mdm-2.00.a\0xlnx,opb-mdm";
			reg = < 41400000 10000 >;
			xlnx,edk-name = "debug_module";
			xlnx,mb-dbg-ports = <1>;
			xlnx,uart-width = <8>;
			xlnx,use-uart = <1>;
		} ;
		opb_timer@41c00000 {
			compatible =
"xlnx,opb-timer-1.00.b\0xlnx,opb-timer";
			interrupt-parent = <101>;
			interrupts = < 0 0 >;
			reg = < 41c00000 10000 >;
			xlnx,count-width = <20>;
			xlnx,edk-name = "opb_timer_1";
			xlnx,one-timer-only = <1>;
		} ;
Quoted 8 lines
		serial@40600000 {
			compatible =
"xlnx,opb-uartlite-1.00.b\0xlnx,opb-uartlite";
			device_type = "serial";
			interrupt-parent = <101>;
			interrupts = < 3 0 >;
			reg = < 40600000 10000 >;
			xlnx,baudrate = <2580>;

Possibly this should be current-speed, in analogy with ns16550 devices.

Quoted 8 lines
			xlnx,clk-freq = <5f5e100>;
			xlnx,data-bits = <8>;
			xlnx,edk-name = "RS232_Uart_1";
			xlnx,odd-parity = <0>;
			xlnx,use-parity = <0>;
		} ;
	} ;
} ;
Signature · 4 lines
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson