Skip to contentSkip to conversation

Device tree for new desktop platform in arch/powerpc

RFC Gerhard Pircher 5 participants 34 messages Jun 18, 2007 – Jun 22, 2007

lore
Share & tools
lore
#0 lore raw

Hi,

I'm working on support for the AmigaOne and started to write a device tree source file for use with the cuboot bootwrapper. Additionally to the booting-without-of.txt document and other dts files I found some OpenFirmware related documents on http://playground.sun.com/1275/ and tried to follow their guidelines. Note that I didn't try to compile the dts file yet, as it is not yet complete.

Some questions arose during the implementation, which I hope some of you can answer:

1. The AmigaOne makes use of different G3 (750Cx, 750GL, 750GX) and G4 (7400, 7450, 7455, 7457) CPUs. The current dts file defines a cpu node with the name "PowerPC,7xxx@0" and the bootwrapper just fills in the cpu-, bus- and timebase frequencies. Is this the recommended way, or should the bootwrapper create a fresh cpu node with the correct name of the CPU (e.g. "PowerPC,7455@ 0" - I guess this would require a table with all PVR values and their corresponding CPU name. Or is there a function in the kernel that do this?).

2. I tried to define all ISA devices, which are integrated in the southbridge (VT82C686B). Currently these are child nodes of the device tree root. Should they be child nodes of the southbridge's PCI-to-ISA device node? If so, where should I specify the register address ranges (reg property)? In the PCI device node or in the ISA device nodes, as it is now?

3. The dts files define the device_type of a serial port as "serial", whereas the OF spec says "pnpPNP,501". What's the difference between the two?

4. I couldn't find any information for a device tree representation of the i8259 interrupt controller in the booting-without-of.txt file. Is my implementation correct (inspired by the OF documents)?

I would be grateful, if you could take a look at my dts file and comment on every line that doesn't meet your views.

Thanks in advance!

regards,

Gerhard

Signature · 2 lines
GMX FreeMail: 1 GB Postfach, 5 E-Mail-Adressen, 10 Free SMS.
Alle Infos und kostenlose Anmeldung: http://www.gmx.net/de/go/freemail
#1 lore raw
Quoted 1 line · Gerhard Pircher

1. The AmigaOne makes use of different G3 (750Cx, 750GL, 750GX) and G4 (7400, 7450, 7455, 7457) CPUs. The current dts file defines a cpu node with the name "PowerPC,7xxx@0" and the bootwrapper just fills in the cpu-, bus- and timebase frequencies. Is this the recommended way, or should the bootwrapper create a fresh cpu node with the correct name of the CPU (e.g. "PowerPC,7455@ 0" - I guess this would require a table with all PVR values and their corresponding CPU name. Or is there a function in the kernel that do this?).

I'm far from an authoritative figure on this but making a reasonable default (in your dts file) then updating in the bootwrapper makes sense to me. That's what I did for several properties in the prpmc2800's dts.

Quoted 1 line

2. I tried to define all ISA devices, which are integrated in the southbridge (VT82C686B). Currently these are child nodes of the device tree root. Should they be child nodes of the southbridge's PCI-to-ISA device node?

I would think so.

Quoted 1 line

If so, where should I specify the register address ranges (reg property)? In the PCI device node or in the ISA device nodes, as it is now?

Each device's node should have a reg property for its registers. You'll need a ranges property for the pci-isa bridge as well.

Mark

P.S. You should change email clients of fix the one you're using to
break lines up so they don't wrap in a std 80 char line window.

#2 lore raw

-------- Original-Nachricht --------
Datum: Mon, 18 Jun 2007 12:15:29 -0700
Von: "Mark A. Greer" <[email protected]>
An: Gerhard Pircher <[email protected]>
CC: [email protected], "list <linuxppc-dev"@ozlabs.org
Betreff: Re: [RFC] Device tree for new desktop platform in arch/powerpc

Quoted 8 lines · Gerhard Pircher
Quoted 2 lines

1. The AmigaOne makes use of different G3...

I'm far from an authoritative figure on this but making a reasonable default (in your dts file) then updating in the bootwrapper makes sense to me. That's what I did for several properties in the prpmc2800's dts.

So, the bootwrapper should update the name property of the CPU node. Is the cpu node name used somewhere?

Quoted 6 lines
Quoted 3 lines

If so, where should I specify the register address ranges (reg property)? In the PCI device node or in the ISA device nodes, as it is now?

Each device's node should have a reg property for its registers. You'll need a ranges property for the pci-isa bridge as well.

Ah yes, didn't think about that.

Quoted 3 lines

P.S. You should change email clients of fix the one you're using to break lines up so they don't wrap in a std 80 char line window.

Yeah, sorry. Forgot about that when writing the mail.

Gerhard

Signature · 2 lines
Ist Ihr Browser Vista-kompatibel? Jetzt die neuesten 
Browser-Versionen downloaden: http://www.gmx.net/de/go/browser
#3 lore raw
Quoted 10 lines · Gerhard Pircher

Von: "Mark A. Greer" <[email protected]>

Quoted 8 lines · Gerhard Pircher
Quoted 2 lines

1. The AmigaOne makes use of different G3...

I'm far from an authoritative figure on this but making a reasonable default (in your dts file) then updating in the bootwrapper makes sense to me. That's what I did for several properties in the prpmc2800's dts.

So, the bootwrapper should update the name property of the CPU node. Is the cpu node name used somewhere?

Oh, sorry I really talking about the cpu frequencies, etc. I don't think the name of the cpu node matters but I'd have to check. Others probably know off the top of their heads.

Mark

#4 lore raw
Quoted 10 lines · Mark A. Greer
Quoted 9 lines · Gerhard Pircher

Von: "Mark A. Greer" <[email protected]>

Quoted 8 lines · Gerhard Pircher
Quoted 2 lines

1. The AmigaOne makes use of different G3...

I'm far from an authoritative figure on this but making a reasonable default (in your dts file) then updating in the bootwrapper makes sense to me. That's what I did for several properties in the prpmc2800's dts.

Quoted 5 lines
Quoted 1 line

So, the bootwrapper should update the name property of the CPU node. Is the cpu node name used somewhere?

Oh, sorry I really talking about the cpu frequencies, etc. I don't think the name of the cpu node matters but I'd have to check. Others probably know off the top of their heads.

I don't believe the name is actually used. It would be nice to get it right, though - I think it can be considered option for the first cut, though.

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
#5 lore raw
In reply to Gerhard Pircher
Quoted 15 lines · Gerhard Pircher

Hi,

I'm working on support for the AmigaOne and started to write a device tree source file for use with the cuboot bootwrapper. Additionally to the booting-without-of.txt document and other dts files I found some OpenFirmware related documents on http://playground.sun.com/1275/ and tried to follow their guidelines. Note that I didn't try to compile the dts file yet, as it is not yet complete.

Some questions arose during the implementation, which I hope some of you can answer:

1. The AmigaOne makes use of different G3 (750Cx, 750GL, 750GX) and G4 (7400, 7450, 7455, 7457) CPUs. The current dts file defines a cpu node with the name "PowerPC,7xxx@0" and the bootwrapper just fills in the cpu-, bus- and timebase frequencies. Is this the recommended way, or should the bootwrapper create a fresh cpu node with the correct name of the CPU (e.g. "PowerPC,7455@ 0" - I guess this would require a table with all PVR values and their corresponding CPU name. Or is there a function in the kernel that do this?).

Quoted 6 lines

2. I tried to define all ISA devices, which are integrated in the southbridge (VT82C686B). Currently these are child nodes of the device tree root. Should they be child nodes of the southbridge's PCI-to-ISA device node? If so, where should I specify the register address ranges (reg property)? In the PCI device node or in the ISA device nodes, as it is now?

They should be children of the PCI<->ISA bridge. They should specify there own address ranges in their reg properties - but those address ranges are in the address space of the ISA bus. The PCI<->ISA bridge will need a correct ranges property to map that into the PCI address space, and the PCI host bridge will need a ranges which maps that into the processor's

Quoted 3 lines

3. The dts files define the device_type of a serial port as "serial", whereas the OF spec says "pnpPNP,501". What's the difference between the two?

Err... device_type == "pnpPNP,501", or compatible == "pnpPNP,501"?

Quoted 40 lines

4. I couldn't find any information for a device tree representation of the i8259 interrupt controller in the booting-without-of.txt file. Is my implementation correct (inspired by the OF documents)?

I would be grateful, if you could take a look at my dts file and comment on every line that doesn't meet your views.

/*
* AmigaOne Device Tree Source
*
* Copyright 2007 Gerhard Pircher ([email protected])
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation; either version 2 of the License, or (at your
* option) any later version.
*/

/ {
	model = "Eyetech,AmigaOne";
	compatible = "Eyetech,AmigaOne" "MAI,Teron";
	#address-cells = <1>;
	#size-cells = <1>;

	cpus {
		#address-cells = <1>;
		#size-cells = <0>;

		PowerPC,7xxx@0 {			// Can be 75x or 745x?
			device_type = "cpu";
			reg = <0>;
			d-cache-line-size = <20>;	// 32 bytes
			i-cache-line-size = <20>;	// 32 bytes
			d-cache-size = <8000>;		// L1, 32K
			i-cache-size = <8000>;		// L1, 32K
			timebase-frequency = <0>;	// 33.3 MHz, from U-boot
			clock-frequency = <0>;		// From U-boot
			bus-frequency = <0>;		// From U-boot
			32-bit;
		};
Quoted 8 lines
	};

	memory {
		device_type = "memory";
		reg = <0 0>;				// From U-boot
	};

	// Should the following nodes be childs of a ISA bus node?

If they're ISA devices, then yes, they should.

Quoted 10 lines
	dma-controller {
		device_type = "dma-controller";
		compatible = "chrp,dma";
		reg = <0 10 80 10 c0 20>;
		/* Channel 4 reserverd, cascade mode, 2x32k transfer/counter
		 * widths and bus master capability. Is this really necessary?
		 */
/*		dma = <4 4 20 20 1>; */
		#address-cells = <1>;
		#size-cells = <0>;			// No physical address.

This node has no children, so #address-cells and #size-cells values are meaningless.

Quoted 5 lines
	};
  	interrupt-controller {
		device_type = "interrupt-controller";
		compatible = "chrp,iic";

Is there a device binding defined somewhere for "chrp,iic"?

Quoted 6 lines
		interrupt-controller;
		reg = <20 2 a0 2 4d0 2>;
		reserved-interrupts = <2>;
		#address-cells = <1>;
		#size-cells = <0>;
		#interrupt-cells = <2>;
Quoted 8 lines
	};

	8042@60 {
		device_type = "8042";
		compatible = "chrp,8042";
		reg = <60 10>;
		interrupts = <1 3 c 3>;			// IRQ1, IRQ12 (rising edge)
		interrupt-parent = <&interrupt-controller>;

This should cause a dtc error. Either you want &/interrupt-controller or give the interrupt-controller node a label and refer to that. It's either '&/some/full/path' or '&label'.

Quoted 2 lines
		#address-cells = <1>;
		#size-cells = <0>;			// No physical address.

Comment is arguably incorrect.

Quoted 7 lines
		keyboard {
			device_type = "keyboard";
			compatible = "pnpPNP,303";
			reg = <0>;
		};

		mouse {
Quoted 8 lines
			device_type = "mouse";
			compatible = "pnpPNP,f03";
			reg = <1>;
		};
	};

	timer@40 {
		device_type = "timer";

For flat device trees we're generally avoiding setting the device_type property unless there is a clearly defined "class binding" which applies. There are a number of cases here where I'm not sure if that's true.

Quoted 3 lines
		reg = <40 20>
		#address-cells = <1>;
		#size-cells = <0>;

No children, so #a and #s are pointless.

Quoted 9 lines
	};

	rtc@70 {
		device_type = "rtc";
		compatible = <ds1385-rtc>;
		reg = <70 2>;
		interrupts = <8 3>;
		#address-cells = <1>;
		#size-cells = <0>;

Ditto

Quoted 10 lines
	};

	serial@3f8 {
		device_type = "serial";
/*		compatible = "pnpPNP,501";*/
		compatible = "ns16550";
		reg = <3f8 8>;
		interrupts = <4 3>;			// IRQ4 (rising edge)
		interrupt-parent = <&interrupt-controller>;
		clock-frequency = <0>;			// Not necessary?

Probably necessary, but may need to be filled in from the bootwrapper.

Quoted 2 lines
		#address-cells = <1>;
		#size-cells = <0>;

Ditto.

Quoted 31 lines
	};

	serial@2f8 {
		device_type = "serial";
/*		compatible = "pnpPNP,501";*/
		compatible = "ns16550";
		reg = <2f8 8>;
		interrupts = <3 3>;			// IRQ3 (rising edge)
		interrupt-parent = <&interrupt-controller>;
		clock-frequency = <0>;			// Not necessary?
		#address-cells = <1>;
		#size-cells = <0>;
	};

	parallel@378 {
		device_type = "parallel";
		compatible = "chrp,ecp";
		reg = <378 3 778 3>;
/*		interrupts = <7>;*/			// No IRQ free on AmigaOne!
		interrupt-parent = <&interrupt-controller>;
/*		dma = <3 0 0 0>;*/			// Parallel port DMA mode?
		#address-cells = <1>;
		#size-cells = <0>;
	};

	fdc@3f0 {
		device_type = "fdc";
		compatible = "pnpPNP,700";
		reg = <3f0 8>;
		interrupts = <6 3>;			// IRQ6 (rising edge)
		interrupt-parent = <&interrupt-controller>;
Quoted 8 lines

/* dma = < >;*/ // Floppy DMA mode?

		#address-cells = <1>;
		#size-cells = <0>;

		disk {
			device_type = "block";
			reg = <0>;
		};

Don't think you need this subnode.

Quoted 16 lines
	};	
  	pci@80000000 {
		device_type = "pci";
		bus-frequency = <01fca055>;		// 33.3MHz
		bus-range = <0 f>;
		reg = <80000000 7f000000>;			// Whole PCI space.
		ranges = <01000000 0 0 fe000000 0 00c00000	// PCI I/O
			  02000000 0 0 80000000 0 7d000000	// PCI memory
			  02000000 0 0 fd000000 0 01000000	// PCI alias memory
			  00000000 0 0 fec00000 0 00300000>;	// PCI config
		8259-interrupt-acknowledge = <fef00000>;
		#address-cells = <3>;
		#size-cells = <2>;
	};
};
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
#6 lore raw
Quoted 5 lines
Quoted 3 lines
  	interrupt-controller {
		device_type = "interrupt-controller";
		compatible = "chrp,iic";

Is there a device binding defined somewhere for "chrp,iic"?

In the CHRP platform binding, which doesn't apply here.

Quoted 13 lines
Quoted 12 lines
		keyboard {
			device_type = "keyboard";
			compatible = "pnpPNP,303";
			reg = <0>;
		};

		mouse {
			device_type = "mouse";
			compatible = "pnpPNP,f03";
			reg = <1>;
		};
	};
Quoted 7 lines
Quoted 2 lines
	timer@40 {
		device_type = "timer";

For flat device trees we're generally avoiding setting the device_type property unless there is a clearly defined "class binding" which applies. There are a number of cases here where I'm not sure if that's true.

Keyboard and mouse have defined "device_type"s. Timer I don't think so.

Either way, I'd leave out the device_type here, the OS isn't supposed to use it anyway.

Quoted 10 lines
Quoted 8 lines
	serial@3f8 {
		device_type = "serial";
/*		compatible = "pnpPNP,501";*/
		compatible = "ns16550";
		reg = <3f8 8>;
		interrupts = <4 3>;			// IRQ4 (rising edge)
		interrupt-parent = <&interrupt-controller>;
		clock-frequency = <0>;			// Not necessary?

Probably necessary, but may need to be filled in from the bootwrapper.

If absent, "clock-frequency" should be taken to be the default thing. Actually, for pnpPNP (PC-style) serial, the clock frequency is fixed.

Quoted 3 lines
Quoted 3 lines
  	pci@80000000 {
		device_type = "pci";
		bus-frequency = <01fca055>;		// 33.3MHz

So write it in decimal...

Segher

#7 lore raw
In reply to David Gibson

-------- Original-Nachricht --------
Datum: Tue, 19 Jun 2007 15:42:32 +1000
Von: David Gibson <[email protected]>
An: Gerhard Pircher <[email protected]>
CC: [email protected], "list <linuxppc-dev"@ozlabs.org
Betreff: Re: [RFC] Device tree for new desktop platform in arch/powerpc

Quoted 5 lines
Quoted 3 lines

3. The dts files define the device_type of a serial port as "serial", whereas the OF spec says "pnpPNP,501". What's the difference between the two?

Err... device_type == "pnpPNP,501", or compatible == "pnpPNP,501"?

Sorry, I meant compatible = "ns16550" and compatible = "pnpPNP,501".

Quoted 2 lines

This node has no children, so #address-cells and #size-cells values are meaningless.

Ah, I thought these properties are always necessary, if a ranges or reg property is defined.

Quoted 5 lines
Quoted 3 lines
  	interrupt-controller {
		device_type = "interrupt-controller";
		compatible = "chrp,iic";

Is there a device binding defined somewhere for "chrp,iic"?

Dunno. :-) It's based on these document here:
http://playground.sun.com/1275/bindings/devices/html/isa-pic-1_1d.html
http://playground.sun.com/1275/bindings/pci/pci2_1.pdf

Quoted 3 lines

This should cause a dtc error. Either you want &/interrupt-controller or give the interrupt-controller node a label and refer to that. It's either '&/some/full/path' or '&label'.

That makes sense.

Quoted 7 lines
Quoted 2 lines
	timer@40 {
		device_type = "timer";

For flat device trees we're generally avoiding setting the device_type property unless there is a clearly defined "class binding" which applies. There are a number of cases here where I'm not sure if that's true.

What about platforms that provide a real OF device tree? Do they define device nodes for timers?

Quoted 3 lines
Quoted 1 line
		clock-frequency = <0>;			// Not necessary?

Probably necessary, but may need to be filled in from the bootwrapper.

This should be a constant anyway, so I can define it here.

Quoted 10 lines
Quoted 10 lines
	fdc@3f0 {
		device_type = "fdc";
		compatible = "pnpPNP,700";
		reg = <3f0 8>;
		interrupts = <6 3>;
		interrupt-parent = <&interrupt-controller>;
/*		dma = < >;*/
		#address-cells = <1>;
		#size-cells = <0>;
Quoted 6 lines
Quoted 5 lines
		disk {
			device_type = "block";
			reg = <0>;
		};

Don't think you need this subnode.

It's mentioned here (if I interpreted it correctly):
http://playground.sun.com/1275/bindings/devices/html/fdc.html
Not sure, if the Linux kernel needs it.

Thanks!

regards,

Gerhard

Signature · 2 lines
GMX FreeMail: 1 GB Postfach, 5 E-Mail-Adressen, 10 Free SMS.
Alle Infos und kostenlose Anmeldung: http://www.gmx.net/de/go/freemail
#8 lore raw
Quoted 6 lines
Quoted 5 lines
Quoted 3 lines

3. The dts files define the device_type of a serial port as "serial", whereas the OF spec says "pnpPNP,501". What's the difference between the two?

Err... device_type == "pnpPNP,501", or compatible == "pnpPNP,501"?

Sorry, I meant compatible = "ns16550" and compatible = "pnpPNP,501".

"pnpPNP,501" says that the device is a 16550A-compatible UART compatible with how that is used in a PC (using the same base clock, and some other minor things).

"ns16550" simply says the device is compatible with the NS16550. Also note the lack of "A".

Quoted 4 lines
Quoted 2 lines

This node has no children, so #address-cells and #size-cells values are meaningless.

Ah, I thought these properties are always necessary, if a ranges or reg property is defined.

They are necessary if one of the children has a "reg" or "ranges" or similar, or if this node has a "ranges" property. "#xxx-cells" defines the number of cells for the bus that this node is the controller for. So, for "reg", the relevant #xxx-cells entry is that in your parent; for "ranges" you need both the "#address-cells" entry in your parent and your own #xxx-cells values (since "ranges" uses parent bus address, child bus address, child bus size).

Quoted 8 lines
Quoted 5 lines
Quoted 3 lines
  	interrupt-controller {
		device_type = "interrupt-controller";
		compatible = "chrp,iic";

Is there a device binding defined somewhere for "chrp,iic"?

Dunno. :-) It's based on these document here:
http://playground.sun.com/1275/bindings/devices/html/isa-pic-1_1d.html
http://playground.sun.com/1275/bindings/pci/pci2_1.pdf

How does PCI come into the picture here?

Quoted 9 lines
Quoted 7 lines
Quoted 2 lines
	timer@40 {
		device_type = "timer";

For flat device trees we're generally avoiding setting the device_type property unless there is a clearly defined "class binding" which applies. There are a number of cases here where I'm not sure if that's true.

What about platforms that provide a real OF device tree? Do they define device nodes for timers?

Sure. There typically is a device node for every (addressable) device on the system. There is no defined binding for timer devices though, so there shouldn't be a "device_type" in a timer node.

Quoted 1 line
Quoted 1 line
Quoted 1 line
		clock-frequency = <0>;			// Not necessary?

Since this is an AT timer, you should use "compatible" = "pnpPNP,100", and the clock frequency is implicit.

Quoted 10 lines
Quoted 8 lines
Quoted 7 lines
	fdc@3f0 {

		disk {
			device_type = "block";
			reg = <0>;
		};

Don't think you need this subnode.

It's mentioned here (if I interpreted it correctly):
http://playground.sun.com/1275/bindings/devices/html/fdc.html

"disk" subnodes describe the floppy disk _drives_ actually. You should have a disk@0 and/or a disk@1, if you have any floppy disk drives at all that is.

Quoted 1 line

Not sure, if the Linux kernel needs it.

The linux floppy driver will do its own probing, so no it won't care. Can't hurt to include it though.

In real OF these nodes are very necessary of course, since without device node you cannot use it to read files from.

Segher

#9 lore raw

-------- Original-Nachricht --------
Datum: Tue, 19 Jun 2007 11:14:44 +0200
Von: Segher Boessenkool <[email protected]>
An: "Gerhard Pircher" <[email protected]>
CC: [email protected], David Gibson <[email protected]>
Betreff: Re: [RFC] Device tree for new desktop platform in arch/powerpc

Quoted 6 lines

"pnpPNP,501" says that the device is a 16550A-compatible UART compatible with how that is used in a PC (using the same base clock, and some other minor things).

"ns16550" simply says the device is compatible with the NS16550. Also note the lack of "A".

I guess I can define both of them or do they conflict (IIRC the two hardware revision should be compatible)?

Quoted 6 lines
Quoted 4 lines
Quoted 1 line

Is there a device binding defined somewhere for "chrp,iic"?

Dunno. :-) It's based on these document here:
http://playground.sun.com/1275/bindings/devices/html/isa-pic-1_1d.html
http://playground.sun.com/1275/bindings/pci/pci2_1.pdf

How does PCI come into the picture here?

I just added it, because it defines how the interrupts property should be specfied.

Quoted 4 lines

Sure. There typically is a device node for every (addressable) device on the system. There is no defined binding for timer devices though, so there shouldn't be a "device_type" in a timer node.

Okay, I'll remove the device_type property.

Quoted 4 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
		clock-frequency = <0>;			// Not necessary?

Since this is an AT timer, you should use "compatible" = "pnpPNP,100", and the clock frequency is implicit.

Where are all this "pnpPNP,xxx" identifiers specified (except for serial parallel, fdc, keyboard, mouse)?

Quoted 3 lines

"disk" subnodes describe the floppy disk _drives_ actually. You should have a disk@0 and/or a disk@1, if you have any floppy disk drives at all that is.

Ah yes, I may have forgotten the "@0" by mistake.

Quoted 2 lines

The linux floppy driver will do its own probing, so no it won't care. Can't hurt to include it though.

That was my intention.

Gerhard

Signature · 2 lines
Der GMX SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen! 
Ideal für Modem und ISDN: http://www.gmx.net/de/go/smartsurfer
#10 lore raw
Quoted 8 lines
Quoted 6 lines

"pnpPNP,501" says that the device is a 16550A-compatible UART compatible with how that is used in a PC (using the same base clock, and some other minor things).

"ns16550" simply says the device is compatible with the NS16550. Also note the lack of "A".

I guess I can define both of them or do they conflict (IIRC the two hardware revision should be compatible)?

Use one or the other, not both. Perhaps you'll need to add the pnpPNP,500 and pnpPNP,501 entries to the generic OF serial code, should be trivial to do.

The 16550A supports something the 16550 doesn't (don't ask me what, I forgot :-) ), so don't say it is an A when it isn't; the other way around is fine though.

And it doesn't matter much for Linux anyway currently, the "generic" kernel driver will do its own wacky probing.

Quoted 5 lines
Quoted 3 lines
Quoted 1 line

http://playground.sun.com/1275/bindings/pci/pci2_1.pdf

How does PCI come into the picture here?

I just added it, because it defines how the interrupts property should be specfied.

"interrupts" is defined by the base OF spec. The specific format for any interrupt domain is defined by the binding for that domain, notably by the bindings for interrupt controllers.

Quoted 2 lines

Where are all this "pnpPNP,xxx" identifiers specified (except for serial parallel, fdc, keyboard, mouse)?

They are defined by the vendor of the devices; for vendor "PNP", i.e. legacy non-PNP PC devices, that is MicroSoft.

Segher

#11 lore raw

-------- Original-Nachricht --------
Datum: Tue, 19 Jun 2007 12:08:06 +0200
Von: Segher Boessenkool <[email protected]>
An: "Gerhard Pircher" <[email protected]>
CC: [email protected], [email protected]
Betreff: Re: [RFC] Device tree for new desktop platform in arch/powerpc

Quoted 6 lines
Quoted 2 lines

I guess I can define both of them or do they conflict (IIRC the two hardware revision should be compatible)?

Use one or the other, not both. Perhaps you'll need to add the pnpPNP,500 and pnpPNP,501 entries to the generic OF serial code, should be trivial to do.

I guess I stick with compatible = "serial" for now, as it should also work with the generic serial console support code.

Quoted 6 lines

The 16550A supports something the 16550 doesn't (don't ask me what, I forgot :-) ), so don't say it is an A when it isn't; the other way around is fine though.

And it doesn't matter much for Linux anyway currently, the "generic" kernel driver will do its own wacky probing.

Yes, that's why the current AmigaOne kernels (2.6.16) detect 3 serial ports, whereas there should be only 2 (the first two are detected by probing for the VIA southbridge and the last one IIRC is registered by request_region()). I hope the device tree fixes this.

Quoted 6 lines
Quoted 2 lines

Where are all this "pnpPNP,xxx" identifiers specified (except for serial parallel, fdc, keyboard, mouse)?

They are defined by the vendor of the devices; for vendor "PNP", i.e. legacy non-PNP PC devices, that is MicroSoft.

Downloaded the file you pointed to and the OF generic names document. I thought the OF core specification defines them, but it's not available freely.

Thanks a lot!

Gerhard

Signature · 2 lines
Der GMX SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen! 
Ideal für Modem und ISDN: http://www.gmx.net/de/go/smartsurfer
#12 lore raw
Quoted 8 lines
Quoted 6 lines
Quoted 2 lines

I guess I can define both of them or do they conflict (IIRC the two hardware revision should be compatible)?

Use one or the other, not both. Perhaps you'll need to add the pnpPNP,500 and pnpPNP,501 entries to the generic OF serial code, should be trivial to do.

I guess I stick with compatible = "serial" for now, as it should also work with the generic serial console support code.

"compatible" = "serial" is completely wrong -- it is a generic name and should never be matched on.

Quoted 10 lines
Quoted 6 lines

The 16550A supports something the 16550 doesn't (don't ask me what, I forgot :-) ), so don't say it is an A when it isn't; the other way around is fine though.

And it doesn't matter much for Linux anyway currently, the "generic" kernel driver will do its own wacky probing.

Yes, that's why the current AmigaOne kernels (2.6.16) detect 3 serial ports, whereas there should be only 2 (the first two are detected by probing for the VIA southbridge and the last one IIRC is registered by request_region()). I hope the device tree fixes this.

It should, yes.

Quoted 9 lines
Quoted 6 lines
Quoted 2 lines

Where are all this "pnpPNP,xxx" identifiers specified (except for serial parallel, fdc, keyboard, mouse)?

They are defined by the vendor of the devices; for vendor "PNP", i.e. legacy non-PNP PC devices, that is MicroSoft.

Downloaded the file you pointed to and the OF generic names document. I thought the OF core specification defines them, but it's not available freely.

That's a common misconception :-)

<ftp://playground.sun.com/pub/p1275/coredoc/1275-1994/1275.ps.gz>

Segher

#13 lore raw

-------- Original-Nachricht --------
Datum: Tue, 19 Jun 2007 15:15:33 +0200
Von: Segher Boessenkool <[email protected]>
An: "Gerhard Pircher" <[email protected]>
CC: [email protected], [email protected]
Betreff: Re: [RFC] Device tree for new desktop platform in arch/powerpc

Quoted 2 lines

"compatible" = "serial" is completely wrong -- it is a generic name and should never be matched on.

Doh again! Looks like I'm absent-minded today.

Quoted 7 lines
Quoted 3 lines

Downloaded the file you pointed to and the OF generic names document. I thought the OF core specification defines them, but it's not available freely.

That's a common misconception :-)

<ftp://playground.sun.com/pub/p1275/coredoc/1275-1994/1275.ps.gz>

So much for "available commercially". :-) Thanks!

Gerhard

Signature · 2 lines
Der GMX SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen! 
Ideal für Modem und ISDN: http://www.gmx.net/de/go/smartsurfer
#14 lore raw
In reply to David Gibson
Quoted 2 lines · David Gibson

Is there a device binding defined somewhere for "chrp,iic"?

Yes, it's the standard for 8259 on chrp and chrp-like platforms.

Quoted 3 lines
Quoted 3 lines
              interrupt-controller;
              reg = <20 2 a0 2 4d0 2>;
              reserved-interrupts = <2>;

I'm currious about the above though, what is it ?

Quoted 1 line
Quoted 1 line
              #address-cells = <1>;

Why #address-cells set to 1 ? In a PIC node, in fact, I would expect it to be 0 to avoid any spurrious "reg" matching for interrupts.

Quoted 11 lines
Quoted 9 lines
              #size-cells = <0>;
              #interrupt-cells = <2>;
      };

      8042@60 {
              device_type = "8042";
              compatible = "chrp,8042";
              reg = <60 10>;
              interrupts = <1 3 c 3>;                 // IRQ1, IRQ12

(rising edge)

Quoted 1 line
              interrupt-parent = <&interrupt-controller>;

Just put the interrupt-parent pointer once in the isa bridge and all isa devices below the bridge.

Quoted 9 lines

This should cause a dtc error. Either you want &/interrupt-controller or give the interrupt-controller node a label and refer to that. It's either '&/some/full/path' or '&label'.

Quoted 2 lines

#address-cells = <1>;
#size-cells = <0>; // No physical

address.

Comment is arguably incorrect.

Yeah, not sure what that is supposed to be.

Ben.

#15 lore raw

-------- Original-Nachricht --------
Datum: Thu, 21 Jun 2007 22:42:13 +1000
Von: Benjamin Herrenschmidt <[email protected]>
An: David Gibson <[email protected]>
CC: Gerhard Pircher <[email protected]>, [email protected], list <[email protected]>
Betreff: Re: [RFC] Device tree for new desktop platform in arch/powerpc

Quoted 5 lines
Quoted 3 lines
Quoted 3 lines
              interrupt-controller;
              reg = <20 2 a0 2 4d0 2>;
              reserved-interrupts = <2>;

I'm currious about the above though, what is it ?

Quote from the CHRP ISA interrupt controller device binding document:
“reserved-interrupts”
Standard property name to define reserved interrupts.
prop-encoded-array: An integer array, encoded with encode-int. The value of this property shall be a list of ISA interrupts which cannot be assigned due to cascading, wiring, or other reasons. Only the irq# part of the property is pertinent to this use.
- End -

Quoted 4 lines
Quoted 1 line
Quoted 1 line
              #address-cells = <1>;

Why #address-cells set to 1 ? In a PIC node, in fact, I would expect it to be 0 to avoid any spurrious "reg" matching for interrupts.

Yeah, I got them wrong almost everywhere.

regards,

Gerhard

Signature · 2 lines
GMX FreeMail: 1 GB Postfach, 5 E-Mail-Adressen, 10 Free SMS.
Alle Infos und kostenlose Anmeldung: http://www.gmx.net/de/go/freemail
#16 lore raw
Quoted 12 lines
Quoted 3 lines
Quoted 1 line
Quoted 1 line
              reserved-interrupts =3D <2>;

I'm currious about the above though, what is it ?

Quote from the CHRP ISA interrupt controller device binding document:
=93reserved-interrupts=94
Standard property name to define reserved interrupts.
prop-encoded-array: An integer array, encoded with encode-int. The value of this property shall be a list of ISA interrupts which=20 cannot
be assigned due to cascading, wiring, or other reasons. Only the irq#=20=

Quoted 2 lines

part
of the property is pertinent to this use.

I never found any situation where this property is useful (you need a lot more information to do anything but static IRQ routing on ISA anyway), but it doesn't harm anything either.

Segher

#17 lore raw
In reply to Benjamin Herrenschmidt
Quoted 4 lines
Quoted 1 line
Quoted 1 line
              #address-cells = <1>;

Why #address-cells set to 1 ? In a PIC node, in fact, I would expect it to be 0 to avoid any spurrious "reg" matching for interrupts.

The "#address-cells" property should be completely absent, even; for interrupt matching, that means "treat as 0, no unit address used in interrupt mapping, just the interrupt number", and for the "normal" purpose (defining the format of devices on the bus rooted at / represented by this node) it means "there is no such bus" -- this is different from #address-cells = 0.

Quoted 2 lines

Just put the interrupt-parent pointer once in the isa bridge and all isa devices below the bridge.

Definitely.

Quoted 7 lines
Quoted 5 lines
Quoted 2 lines

#address-cells = <1>;
#size-cells = <0>; // No physical

address.

Comment is arguably incorrect.

Yeah, not sure what that is supposed to be.

#size-cells = 0 means the addressing scheme on this bus is not directly related to the mechanism (if any) by which registers on a device on the bus are addressed.

Segher

#18 lore raw
Quoted 8 lines

The "#address-cells" property should be completely absent, even; for interrupt matching, that means "treat as 0, no unit address used in interrupt mapping, just the interrupt number", and for the "normal" purpose (defining the format of devices on the bus rooted at / represented by this node) it means "there is no such bus" -- this is different from #address-cells = 0.

I'd rather have it present and explicitely set to 0, which happens to be what both Apple and IBM OF implementations also do. Have you verified if the linux parser behaves properly if it's absent ?

Ben.

#19 lore raw
Quoted 9 lines
Quoted 7 lines

The "#address-cells" property should be completely absent, even; for interrupt matching, that means "treat as 0, no unit address used in interrupt mapping, just the interrupt number", and for the "normal" purpose (defining the format of devices on the bus rooted at / represented by this node) it means "there is no such bus" -- this is different from #address-cells = 0.

I'd rather have it present and explicitely set to 0,

It is not the "right thing" to do, but should be harmless in most situations.

Quoted 3 lines

which happens to be
what both Apple and IBM OF implementations also do. Have you verified if the linux parser behaves properly if it's absent ?

No, I haven't. I prefer following the standard instead of simply making the code work with one or two implementations; I hope you did the same :-)

If it doesn't work, it's simply a bug in Linux.

Segher

#20 lore raw
Quoted 8 lines · Segher Boessenkool
Quoted 8 lines
Quoted 7 lines

The "#address-cells" property should be completely absent, even; for interrupt matching, that means "treat as 0, no unit address used in interrupt mapping, just the interrupt number", and for the "normal" purpose (defining the format of devices on the bus rooted at / represented by this node) it means "there is no such bus" -- this is different from #address-cells = 0.

Quoted 4 lines
Quoted 1 line

I'd rather have it present and explicitely set to 0,

It is not the "right thing" to do, but should be harmless in most situations.

It's pretty much the right thing to do in that case imho... based on the assumption that a common practice is worth 10 standards :-)

(I think I could even quote Linus on that one, let's just say that I totally agree with him on those matters, I'd rather have people "standardize" around existing common practices that happen to also work well with existing code rather than doing differently because that's what a 10 yrs old unmaintained piece of pdf says should be done :-)

Ben.

#21 lore raw
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 7 lines

The "#address-cells" property should be completely absent, even; for interrupt matching, that means "treat as 0, no unit address used in interrupt mapping, just the interrupt number", and for the "normal" purpose (defining the format of devices on the bus rooted at / represented by this node) it means "there is no such bus" -- this is different from #address-cells = 0.

Quoted 7 lines
Quoted 4 lines
Quoted 1 line

I'd rather have it present and explicitely set to 0,

It is not the "right thing" to do, but should be harmless in most situations.

It's pretty much the right thing to do in that case imho... based on the assumption that a common practice is worth 10 standards :-)

It is of course "defensive programming", in that a device tree like that also works with badly broken OS code.

So perhaps we should indeed recommend this for Linux flat device trees.

Which is not to say that the Linux parsing code shouldn't be fixed (if it is broken at all, who knows).

Quoted 5 lines

(I think I could even quote Linus on that one, let's just say that I totally agree with him on those matters, I'd rather have people "standardize" around existing common practices that happen to also work well with existing code rather than doing differently because that's what a 10 yrs old unmaintained piece of pdf says should be done :-)

OTOH, you need a few people doing the "interesting" cases, so you can find and fix the flaws in your OS code :-)

Segher

#22 lore raw
In reply to Gerhard Pircher

[Your "To:" header was broken...]

Quoted 1 line

1. The AmigaOne makes use of different G3 (750Cx, 750GL, 750GX) and G4 (7400, 7450, 7455, 7457) CPUs. The current dts file defines a cpu node with the name "PowerPC,7xxx@0" and the bootwrapper just fills in the cpu-, bus- and timebase frequencies. Is this the recommended way, or should the bootwrapper create a fresh cpu node with the correct name of the CPU (e.g. "PowerPC,7455@ 0" - I guess this would require a table with all PVR values and their corresponding CPU name. Or is there a function in the kernel that do this?).

Just name the cpu nodes "cpu@0" etc. The "generic names" recommended practice wants this, and the node names here aren't actually used by anything anyway, except they look nice to the user. The PowerPC ISA binding predates the generic names r.p. btw.

Quoted 1 line

2. I tried to define all ISA devices, which are integrated in the southbridge (VT82C686B). Currently these are child nodes of the device tree root.

This cannot work on PowerPC since PowerPC doesn't have legacy I/O on the system bus.

Quoted 1 line

Should they be child nodes of the southbridge's PCI-to-ISA device node?

Yes.

Quoted 1 line

If so, where should I specify the register address ranges (reg property)? In the PCI device node or in the ISA device nodes, as it is now?

Both. Each device has a "reg" property that describes that device's registers relative to the addressing on the bus it sits on. All busses that do a direct one-to-one mapping of some address range (perhaps with a translation) have a "ranges" property describing that.

Quoted 1 line

3. The dts files define the device_type of a serial port as "serial", whereas the OF spec says "pnpPNP,501". What's the difference between the two?

"device_type" is "serial", "compatible" is "pnpPNP,whatever".

Where in the OF specs did you find this pnpPNP thing btw?

Quoted 1 line

4. I couldn't find any information for a device tree representation of the i8259 interrupt controller in the booting-without-of.txt file. Is my implementation correct (inspired by the OF documents)?

"name" = "device_type" = "interrupt-controller". "compatible" is one of those pnpPNP things.

Quoted 1 line

I would be grateful, if you could take a look at my dts file and comment on every line that doesn't meet your views.

Please send the thing inline, not as an attachment.

Segher

#23 lore raw

-------- Original-Nachricht --------
Datum: Tue, 19 Jun 2007 08:08:42 +0200
Von: Segher Boessenkool <[email protected]>
An: "Gerhard Pircher" <[email protected]>
CC: ppcdev list <[email protected]>
Betreff: Re: [RFC] Device tree for new desktop platform in arch/powerpc

Quoted 5 lines

Just name the cpu nodes "cpu@0" etc. The "generic names" recommended practice wants this, and the node names here aren't actually used by anything anyway, except they look nice to the user. The PowerPC ISA binding predates the generic names r.p. btw.

Good! That simplifies the (yet to be written) amigaone-cuboot.c bootwrapper code a lot.

Quoted 5 lines
Quoted 3 lines

3. The dts files define the device_type of a serial port as "serial", whereas the OF spec says "pnpPNP,501". What's the difference between the two?

"device_type" is "serial", "compatible" is "pnpPNP,whatever".

Sorry, I was thinking about compatible = "ns16550" and compatible = "pnp..", but wrote device_type = "serial". What's the difference between "ns16550" and "pnpPNP,501"?

Quoted 1 line

Where in the OF specs did you find this pnpPNP thing btw?

See here:
http://playground.sun.com/1275/bindings/devices/html/serial.html

or

Quote from the document:

Quoted 4 lines

"compatible" S
Standard property name, specifies device names with which this device is compatible.

Quoted 8 lines

The meaning of this property is as defined in Open Firmware, as modified by the Generic Names Recommended Practice [7]. As described in those documents, the entries are a list of device names with which this device is compatible, starting with the name of the device itself and progressing through successively less precise and possibly less functional compatible devices.

For this device, the compatible property shall include "pnpPNP,501."

- End -

Quoted 2 lines

"name" = "device_type" = "interrupt-controller".
"compatible" is one of those pnpPNP things.

Quote from the "CHRP(TM) ISA Interrupt Controller Device Binding" document:

Quoted 5 lines

"compatible" S
Standard property name, specifies device names with which this device is compatible.
....
The compatible property shall include "chrp,iic."

- End -

I couldn't find any reference about a "pnp..." value for an i8259 interrupt controller. Is there already a generic function within the kernel that can setup the interrupt controller based solely on the information in the device tree?

Quoted 1 line

Please send the thing inline, not as an attachment.

Okay, will do so next time.

Thanks!

regards,

Gerhard

Signature · 2 lines
Psssst! Schon vom neuen GMX MultiMessenger gehört?
Der kanns mit allen: http://www.gmx.net/de/go/multimessenger
#24 lore raw
Quoted 3 lines
Quoted 1 line

Where in the OF specs did you find this pnpPNP thing btw?

See here:
http://playground.sun.com/1275/bindings/devices/html/serial.html

Ah, the CHRP stuff I so happily ignore.

The generic pnpPNP thing is described in the ISA binding, 4.1.1 "name". You should put this into "compatible" though, since generic names are preferred.

Quoted 4 lines
Quoted 1 line

"compatible" is one of those pnpPNP things.

Quote from the "CHRP(TM) ISA Interrupt Controller Device Binding" document:

But you're not CHRP. This is an ISA device however, so you should follow the ISA binding.

Quoted 2 lines

I couldn't find any reference about a "pnp..." value for an i8259 interrupt controller.

pnpPNP,0 for AT-style, pnpPNP,1 for EISA-style.

It is quite hard to find a list of the standard PNP device code. Here's a link, grab it before the file disappears forever:

<http://download.microsoft.com/download/1/6/1/161ba512-40e2-4cc9-843a-923143f3456c/devids.txt>

Quoted 3 lines

Is there already a generic function within the
kernel that can setup the interrupt controller based solely on the information in the device tree?

Probably not. There are bits and pieces though, your job is to glue it all together. You can handle this in your platform code, if people want to make it more generic they can always refactor the code ;-)

Segher

#25 lore raw
In reply to Gerhard Pircher
Quoted 7 lines

2. I tried to define all ISA devices, which are integrated in the southbridge (VT82C686B). Currently these are child nodes of the device tree root. Should they be child nodes of the southbridge's PCI-to-ISA device node? If so, where should I specify the register address ranges (reg property)? In the PCI device node or in the ISA device nodes, as it is now?

You should have /pci/isa <--- this is the PCI2ISA bridge

and the ISA devices below that. Best is I send you an example of a CHRP or pSeries devie-tree with ISA stuff on it tomorrow. Ping me if I forget.

Quoted 3 lines

3. The dts files define the device_type of a serial port as "serial", whereas the OF spec says "pnpPNP,501". What's the difference between the two?

Use the pnp stuff for "compatible", you can mostly ignore device_type or set it to the same as name.

Quoted 3 lines

4. I couldn't find any information for a device tree representation of the i8259 interrupt controller in the booting-without-of.txt file. Is my implementation correct (inspired by the OF documents)?

Haven't looked at your .dts yet but it should be "interrupt-controller", compatible "chrp,iic" or "i8259", with a #interrupt-cells of 2 and interrupts following the standard ISA encoding. You probably also want an interrupt-parent property in the isa bridge node pointing back to the 8259 so it becomes the default for all ISA devices.

Quoted 2 lines

I would be grateful, if you could take a look at my dts file and comment on every line that doesn't meet your views.

Will do as soon as I find some time...

Ben.

#26 lore raw

-------- Original-Nachricht --------
Datum: Thu, 21 Jun 2007 22:36:46 +1000
Von: Benjamin Herrenschmidt <[email protected]>
An: Gerhard Pircher <[email protected]>
CC: [email protected], list <[email protected]>
Betreff: Re: [RFC] Device tree for new desktop platform in arch/powerpc

Quoted 5 lines

You should have /pci/isa <--- this is the PCI2ISA bridge

and the ISA devices below that. Best is I send you an example of a CHRP or pSeries devie-tree with ISA stuff on it tomorrow. Ping me if I forget.

That would help a lot. Thank you!

Quoted 5 lines

Haven't looked at your .dts yet but it should be "interrupt-controller", compatible "chrp,iic" or "i8259", with a #interrupt-cells of 2 and interrupts following the standard ISA encoding. You probably also want an interrupt-parent property in the isa bridge node pointing back to the 8259 so it becomes the default for all ISA devices.

What about PCI devices? Wouldn't it better to define the interrupt-parent property in the PCI bus node?

Gerhard

Signature · 2 lines
GMX FreeMail: 1 GB Postfach, 5 E-Mail-Adressen, 10 Free SMS.
Alle Infos und kostenlose Anmeldung: http://www.gmx.net/de/go/freemail
#27 lore raw
Quoted 4 lines
Quoted 3 lines

You probably also want
an interrupt-parent property in the isa bridge node pointing back to the 8259 so it becomes the default for all ISA devices.

What about PCI devices? Wouldn't it better to define the interrupt-parent property in the PCI bus node?

Devices on an ISA bus have their interrupts encoded according to the ISA bus binding; this is exactly the format that the ISA interrupt controller (the 8259) expects, so by setting the interrupt-parent on the bus node to point to the 8259 (and not doing interrupt mapping in the ISA child nodes) all works exactly as planned.

Devices on a PCI bus have their interrupts encoded according to the PCI bus binding; this is a very much different format so you better have a real mapping (probably in the PCI host bridge) translating it to ISA interrupts (and pointing it there), if that's how the interrupts are routed on your box.

I hope this helps, it's a bit hard to explain without whiteboard :-)

Segher

#28 lore raw

-------- Original-Nachricht --------
Datum: Thu, 21 Jun 2007 16:38:49 +0200
Von: Segher Boessenkool <[email protected]>
An: "Gerhard Pircher" <[email protected]>
CC: [email protected], Benjamin Herrenschmidt <[email protected]>
Betreff: Re: [RFC] Device tree for new desktop platform in arch/powerpc

Quoted 5 lines

Devices on a PCI bus have their interrupts encoded according to the PCI bus binding; this is a very much different format so you better have a real mapping (probably in the PCI host bridge) translating it to ISA interrupts (and pointing it there), if that's how the interrupts are routed on your box.

Ah, right. I have already seen that in a dts file, but didn't remember it.

Quoted 1 line

I hope this helps, it's a bit hard to explain without whiteboard :-)

For sure it helps!

Gerhard

Signature · 2 lines
Psssst! Schon vom neuen GMX MultiMessenger gehört?
Der kanns mit allen: http://www.gmx.net/de/go/multimessenger
#29 lore raw
In reply to Gerhard Pircher
Quoted 8 lines
Quoted 6 lines

Haven't looked at your .dts yet but it should be "interrupt-controller", compatible "chrp,iic" or "i8259", with a #interrupt-cells of 2 and interrupts following the standard ISA encoding. You probably also want an interrupt-parent property in the isa bridge node pointing back to the 8259 so it becomes the default for all ISA devices.

What about PCI devices? Wouldn't it better to define the interrupt-parent property in the PCI bus node?

PCI devices generally have their interrupts specified by an interrupt-map in the PCI bridge.

Do you have the recommended practice "interrupt mapping" standard ?

It also allowed to make it optional to have nodes for the PCI devices in slots, you can provide the mapping of all 4 INT# lines in the bridge node and linux can use it when probing for devices, so your bootwrapper doesn't have to know what's in the slots and doesn't have to create device nodes for those.

Ben.

#30 lore raw

-------- Original-Nachricht --------
Datum: Fri, 22 Jun 2007 09:22:49 +1000
Von: Benjamin Herrenschmidt <[email protected]>
An: Gerhard Pircher <[email protected]>
CC: [email protected]
Betreff: Re: [RFC] Device tree for new desktop platform in arch/powerpc

Quoted 1 line

Do you have the recommended practice "interrupt mapping" standard ?

Yes, downloaded it right now.

Quoted 5 lines

It also allowed to make it optional to have nodes for the PCI devices in slots, you can provide the mapping of all 4 INT# lines in the bridge node and linux can use it when probing for devices, so your bootwrapper doesn't have to know what's in the slots and doesn't have to create device nodes for those.

I would like to have PCI nodes only for the PCI host and PCI2ISA bridge. The interrupt mapping of the INT# lines can be configured within U-boot, thus I would avoid to specify it somewhere in the device tree, if it isn't really necessary.

Gerhard

Signature · 2 lines
Psssst! Schon vom neuen GMX MultiMessenger gehört?
Der kanns mit allen: http://www.gmx.net/de/go/multimessenger
#31 lore raw
Quoted 7 lines · Gerhard Pircher

I would like to have PCI nodes only for the PCI host and PCI2ISA bridge.
The interrupt mapping of the INT# lines can be configured within U-boot,
thus I would avoid to specify it somewhere in the device tree, if it isn't
really necessary.

You still need to provide the IRQ mapping for the PCI slots, but you can do that from the interrupt-map property of the PCI host bridge node.

Ben.

#32 lore raw
In reply to Benjamin Herrenschmidt
Quoted 6 lines
Quoted 3 lines

3. The dts files define the device_type of a serial port as "serial", whereas the OF spec says "pnpPNP,501". What's the difference between the two?

Use the pnp stuff for "compatible", you can mostly ignore device_type or set it to the same as name.

Only if the name is indeed the correct, defined, device_type for that device, and you implement the whole binding for that device_type (I recommend you do, for serial; it makes it easier to use that device as an early console).

Quoted 9 lines
Quoted 3 lines

4. I couldn't find any information for a device tree representation of the i8259 interrupt controller in the booting-without-of.txt file. Is my implementation correct (inspired by the OF documents)?

Haven't looked at your .dts yet but it should be "interrupt-controller", compatible "chrp,iic" or "i8259", with a #interrupt-cells of 2 and interrupts following the standard ISA encoding. You probably also want an interrupt-parent property in the isa bridge node pointing back to the 8259 so it becomes the default for all ISA devices.

Yeah. You can also use the "pnpPNP," name for the 8259 if it is hooked up like on a PC.

Quoted 2 lines
Quoted 2 lines

I would be grateful, if you could take a look at my dts file and comment on every line that doesn't meet your views.

Please send a new .dts based on the comments you've had so far?

Segher

#33 lore raw

-------- Original-Nachricht --------
Datum: Thu, 21 Jun 2007 16:24:17 +0200
Von: Segher Boessenkool <[email protected]>
An: Benjamin Herrenschmidt <[email protected]>
CC: Gerhard Pircher <[email protected]>, list <[email protected]>
Betreff: Re: [RFC] Device tree for new desktop platform in arch/powerpc

Quoted 2 lines

Yeah. You can also use the "pnpPNP," name for the 8259 if it is hooked up like on a PC.

Yes, it is hooked up like on a PC (or on the Pegasos 1).

Quoted 1 line

Please send a new .dts based on the comments you've had so far?

Yes, I'll do so.

Gerhard

Signature · 2 lines
GMX FreeMail: 1 GB Postfach, 5 E-Mail-Adressen, 10 Free SMS.
Alle Infos und kostenlose Anmeldung: http://www.gmx.net/de/go/freemail