linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: "Gerhard Pircher" <gerhard_pircher@gmx.net>
To: linuxppc-dev list <linuxppc-dev@ozlabs.org
Subject: [RFC] Device tree for new desktop platform in arch/powerpc
Date: Mon, 18 Jun 2007 20:57:15 +0200	[thread overview]
Message-ID: <20070618185715.321010@gmx.net> (raw)

[-- Attachment #1: Type: text/plain, Size: 2014 bytes --]

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
-- 
GMX FreeMail: 1 GB Postfach, 5 E-Mail-Adressen, 10 Free SMS.
Alle Infos und kostenlose Anmeldung: http://www.gmx.net/de/go/freemail

[-- Attachment #2: amigaone.dts --]
[-- Type: application/octet-stream, Size: 4047 bytes --]

/*
 * AmigaOne Device Tree Source
 *
 * Copyright 2007 Gerhard Pircher (gerhard_pircher@gmx.net)
 *
 * 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;
		};
	};

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

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

	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.
	};

  	interrupt-controller {
		device_type = "interrupt-controller";
		compatible = "chrp,iic";
		interrupt-controller;
		reg = <20 2 a0 2 4d0 2>;
		reserved-interrupts = <2>;
		#address-cells = <1>;
		#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)
		interrupt-parent = <&interrupt-controller>;
		#address-cells = <1>;
		#size-cells = <0>;			// No physical address.

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

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

	timer@40 {
		device_type = "timer";
		reg = <40 20>
		#address-cells = <1>;
		#size-cells = <0>;
	};

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

	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?
		#address-cells = <1>;
		#size-cells = <0>;
	};

	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>;
/*		dma = < >;*/				// Floppy DMA mode?
		#address-cells = <1>;
		#size-cells = <0>;

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

  	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>;
	};
};

[-- Attachment #3: ioports --]
[-- Type: application/octet-stream, Size: 1190 bytes --]

00000000-00bfffff : PCI host bridge
  00000000-0000001f : dma1
  00000020-00000021 : 8259 (master)
  00000040-0000005f : timer
  00000060-0000006f : i8042
  00000080-0000008f : dma page reg
  000000a0-000000a1 : 8259 (slave)
  000000c0-000000df : dma2
  00000170-00000177 : ide1
  000001f0-000001f7 : ide0
  000002f8-000002ff : serial
  00000376-00000376 : ide1
  00000378-0000037a : parport0
  000003c0-000003df : vga+
  000003e8-000003ef : serial
  000003f6-000003f6 : ide0
  000003f8-000003ff : serial
  000004d0-000004d1 : 8259 edge control
  00002000-00002fff : PCI Bus #01
    00002000-000020ff : 0000:01:00.0
  0000cc00-0000cc0f : 0000:00:07.1
    0000cc00-0000cc07 : ide0
    0000cc08-0000cc0f : ide1
  00802000-0080207f : 0000:00:06.0
  00802080-0080209f : 0000:00:07.2
    00802080-0080209f : uhci_hcd
  008020a0-008020bf : 0000:00:07.3
    008020a0-008020bf : uhci_hcd
  00802100-008021ff : 0000:00:07.5
  00802200-00802203 : 0000:00:07.5
  00802204-00802207 : 0000:00:07.5
  00802300-008023ff : 0000:00:07.6
  00802400-0080241f : 0000:00:09.0
    00802400-0080241f : EMU10K1
  00802420-00802427 : 0000:00:09.1
    00802420-00802427 : emu10k1-gp
e100e000-e100e07f : 0000:00:06.0

             reply	other threads:[~2007-06-18 18:57 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-06-18 18:57 Gerhard Pircher [this message]
2007-06-18 19:15 ` [RFC] Device tree for new desktop platform in arch/powerpc Mark A. Greer
2007-06-18 19:43   ` Gerhard Pircher
2007-06-18 20:25     ` Mark A. Greer
2007-06-19  5:08       ` David Gibson
2007-06-19  5:42 ` David Gibson
2007-06-19  6:16   ` Segher Boessenkool
2007-06-19  8:40   ` Gerhard Pircher
2007-06-19  9:14     ` Segher Boessenkool
2007-06-19  9:52       ` Gerhard Pircher
2007-06-19 10:08         ` Segher Boessenkool
2007-06-19 12:37           ` Gerhard Pircher
2007-06-19 13:15             ` Segher Boessenkool
2007-06-19 13:29               ` Gerhard Pircher
2007-06-21 12:42   ` Benjamin Herrenschmidt
2007-06-21 13:28     ` Gerhard Pircher
2007-06-21 14:59       ` Segher Boessenkool
2007-06-21 14:29     ` Segher Boessenkool
2007-06-21 23:25       ` Benjamin Herrenschmidt
2007-06-22  7:52         ` Segher Boessenkool
2007-06-22  8:16           ` Benjamin Herrenschmidt
2007-06-22  9:10             ` Segher Boessenkool
2007-06-19  6:08 ` Segher Boessenkool
2007-06-19  9:08   ` Gerhard Pircher
2007-06-19  9:28     ` Segher Boessenkool
2007-06-21 12:36 ` Benjamin Herrenschmidt
2007-06-21 13:20   ` Gerhard Pircher
2007-06-21 14:38     ` Segher Boessenkool
2007-06-21 16:27       ` Gerhard Pircher
2007-06-21 23:22     ` Benjamin Herrenschmidt
2007-06-22 13:12       ` Gerhard Pircher
2007-06-22 13:40         ` Benjamin Herrenschmidt
2007-06-21 14:24   ` Segher Boessenkool
2007-06-21 16:21     ` Gerhard Pircher

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20070618185715.321010@gmx.net \
    --to=gerhard_pircher@gmx.net \
    --cc=linuxppc-dev@ozlabs.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).