Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f90203e0 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge master.kernel.org:/pub/scm/linux/kernel/git/paulus/powerpc

* master.kernel.org:/pub/scm/linux/kernel/git/paulus/powerpc: (61 commits)
  [POWERPC] Use udbg_early_init() on ppc32
  [POWERPC] Open Firmware serial port driver
  [POWERPC] Move MPIC smp routines into mpic.c
  [POWERPC] Cleanup pseries kexec code
  [POWERPC] Cleanup pseries smp initialisation code
  [POWERPC] Consolidate pseries platform header files into pseries.h
  [POWERPC] 85xx: Drop use of SYNC macro in head_fsl_booke.S
  [POWERPC] cell: pm_rtas_activat_signals routine cleanup
  [POWERPC] cell: PPU Oprofile cleanup patch
  [POWERPC] spufs: avoid accessing kernel memory through mmapped /mem node
  [POWERPC] spu sched: static timeslicing for SCHED_RR contexts
  [POWERPC] spu sched: use DECLARE_BITMAP
  [POWERPC] spu sched: forced preemption at execution
  [POWERPC] spu sched: update some comments
  [POWERPC] spu sched: simplity spu_remove_from_active_list
  [POWERPC] spufs: optimize spu_run
  [POWERPC] spufs: runqueue simplification
  [POWERPC] spufs: move prio to spu_context
  [POWERPC] spufs: state_mutex cleanup
  [POWERPC] spufs: simplify state_mutex
  ...
parents 33e563c1 719c91cc
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -1334,6 +1334,9 @@ platforms are moved over to use the flattened-device-tree model.
      fsl-usb2-mph compatible controllers.  Either this property or
      "port0" (or both) must be defined for "fsl-usb2-mph" compatible 
      controllers.
    - dr_mode : indicates the working mode for "fsl-usb2-dr" compatible
      controllers.  Can be "host", "peripheral", or "otg".  Default to
      "host" if not defined for backward compatibility.

   Recommended properties :
    - interrupts : <a b> where a is the interrupt number and b is a
@@ -1367,6 +1370,7 @@ platforms are moved over to use the flattened-device-tree model.
		#size-cells = <0>;
		interrupt-parent = <700>;
		interrupts = <26 1>;
		dr_mode = "otg";
		phy = "ulpi";
	};

+121 −62
Original line number Diff line number Diff line
MPC52xx Device Tree Bindings
MPC5200 Device Tree Bindings
----------------------------

(c) 2006 Secret Lab Technologies Ltd
(c) 2006-2007 Secret Lab Technologies Ltd
Grant Likely <grant.likely at secretlab.ca>

********** DRAFT ***********
@@ -20,11 +20,11 @@ described in Documentation/powerpc/booting-without-of.txt), or passed
by Open Firmare (IEEE 1275) compatible firmware using an OF compatible
client interface API.

This document specifies the requirements on the device-tree for mpc52xx
This document specifies the requirements on the device-tree for mpc5200
based boards.  These requirements are above and beyond the details
specified in either the OpenFirmware spec or booting-without-of.txt

All new mpc52xx-based boards are expected to match this document.  In
All new mpc5200-based boards are expected to match this document.  In
cases where this document is not sufficient to support a new board port,
this document should be updated as part of adding the new board support.

@@ -32,26 +32,26 @@ II - Philosophy
===============
The core of this document is naming convention.  The whole point of
defining this convention is to reduce or eliminate the number of
special cases required to support a 52xx board.  If all 52xx boards
follow the same convention, then generic 52xx support code will work
special cases required to support a 5200 board.  If all 5200 boards
follow the same convention, then generic 5200 support code will work
rather than coding special cases for each new board.

This section tries to capture the thought process behind why the naming
convention is what it is.

1. Node names
-------------
1.  names
---------
There is strong convention/requirements already established for children
of the root node.  'cpus' describes the processor cores, 'memory'
describes memory, and 'chosen' provides boot configuration.  Other nodes
are added to describe devices attached to the processor local bus.

Following convention already established with other system-on-chip
processors, MPC52xx boards must have an 'soc5200' node as a child of the
root node.
processors, 5200 device trees should use the name 'soc5200' for the
parent node of on chip devices, and the root node should be its parent.

The soc5200 node holds child nodes for all on chip devices.  Child nodes
are typically named after the configured function.  ie. the FEC node is
named 'ethernet', and a PSC in uart mode is named 'serial'.
Child nodes are typically named after the configured function.  ie.
the FEC node is named 'ethernet', and a PSC in uart mode is named 'serial'.

2. device_type property
-----------------------
@@ -66,28 +66,47 @@ exactly.
Since device_type isn't enough to match devices to drivers, there also
needs to be a naming convention for the compatible property.  Compatible
is an list of device descriptions sorted from specific to generic.  For
the mpc52xx, the required format for each compatible value is
<chip>-<device>[-<mode>].  At the minimum, the list shall contain two
items; the first specifying the exact chip, and the second specifying
mpc52xx for the chip.

ie. ethernet on mpc5200b: compatible = "mpc5200b-ethernet\0mpc52xx-ethernet"

The idea here is that most drivers will match to the most generic field
in the compatible list (mpc52xx-*), but can also test the more specific
field for enabling bug fixes or extra features.
the mpc5200, the required format for each compatible value is
<chip>-<device>[-<mode>].  The OS should be able to match a device driver
to the device based solely on the compatible value.  If two drivers
match on the compatible list; the 'most compatible' driver should be
selected.

The split between the MPC5200 and the MPC5200B leaves a bit of a
connundrum.  How should the compatible property be set up to provide
maximum compatability information; but still acurately describe the
chip?  For the MPC5200; the answer is easy.  Most of the SoC devices
originally appeared on the MPC5200.  Since they didn't exist anywhere
else; the 5200 compatible properties will contain only one item;
"mpc5200-<device>".

The 5200B is almost the same as the 5200, but not quite.  It fixes
silicon bugs and it adds a small number of enhancements.  Most of the
devices either provide exactly the same interface as on the 5200.  A few
devices have extra functions but still have a backwards compatible mode.
To express this infomation as completely as possible, 5200B device trees
should have two items in the compatible list;
"mpc5200b-<device>\0mpc5200-<device>".  It is *strongly* recommended
that 5200B device trees follow this convention (instead of only listing
the base mpc5200 item).

If another chip appear on the market with one of the mpc5200 SoC
devices, then the compatible list should include mpc5200-<device>.

ie. ethernet on mpc5200: compatible = "mpc5200-ethernet"
    ethernet on mpc5200b: compatible = "mpc5200b-ethernet\0mpc5200-ethernet"

Modal devices, like PSCs, also append the configured function to the
end of the compatible field.  ie. A PSC in i2s mode would specify
"mpc52xx-psc-i2s", not "mpc52xx-i2s".  This convention is chosen to
"mpc5200-psc-i2s", not "mpc5200-i2s".  This convention is chosen to
avoid naming conflicts with non-psc devices providing the same
function.  For example, "mpc52xx-spi" and "mpc52xx-psc-spi" describe
function.  For example, "mpc5200-spi" and "mpc5200-psc-spi" describe
the mpc5200 simple spi device and a PSC spi mode respectively.

If the soc device is more generic and present on other SOCs, the
compatible property can specify the more generic device type also.

ie. mscan: compatible = "mpc5200-mscan\0mpc52xx-mscan\0fsl,mscan";
ie. mscan: compatible = "mpc5200-mscan\0fsl,mscan";

At the time of writing, exact chip may be either 'mpc5200' or
'mpc5200b'.
@@ -96,7 +115,7 @@ Device drivers should always try to match as generically as possible.

III - Structure
===============
The device tree for an mpc52xx board follows the structure defined in
The device tree for an mpc5200 board follows the structure defined in
booting-without-of.txt with the following additional notes:

0) the root node
@@ -115,7 +134,7 @@ Typical memory description node; see booting-without-of.

3) The soc5200 node
-------------------
This node describes the on chip SOC peripherals.  Every mpc52xx based
This node describes the on chip SOC peripherals.  Every mpc5200 based
board will have this node, and as such there is a common naming
convention for SOC devices.

@@ -125,71 +144,111 @@ name type description
device_type		string		must be "soc"
ranges			int		should be <0 baseaddr baseaddr+10000>
reg			int		must be <baseaddr 10000>
compatible		string		mpc5200: "mpc5200-soc"
					mpc5200b: "mpc5200b-soc\0mpc5200-soc"
system-frequency	int		Fsystem frequency; source of all
					other clocks.
bus-frequency		int		IPB bus frequency in HZ.  Clock rate
					used by most of the soc devices.
#interrupt-cells	int		must be <3>.

Recommended properties:
name			type		description
----			----		-----------
compatible		string		should be "<chip>-soc\0mpc52xx-soc"
					ie. "mpc5200b-soc\0mpc52xx-soc"
#interrupt-cells	int		must be <3>.  If it is not defined
					here then it must be defined in every
					soc device node.
bus-frequency		int		IPB bus frequency in HZ.  Clock rate
					used by most of the soc devices.
					Defining it here avoids needing it
					added to every device node.
model			string		Exact model of the chip;
					ie: model="fsl,mpc5200"
revision		string		Silicon revision of chip
					ie: revision="M08A"

The 'model' and 'revision' properties are *strongly* recommended.  Having
them presence acts as a bit of a safety net for working around as yet
undiscovered bugs on one version of silicon.  For example, device drivers
can use the model and revision properties to decide if a bug fix should
be turned on.

4) soc5200 child nodes
----------------------
Any on chip SOC devices available to Linux must appear as soc5200 child nodes.

Note: in the tables below, '*' matches all <chip> values.  ie.
*-pic would translate to "mpc5200-pic\0mpc52xx-pic"
Note: The tables below show the value for the mpc5200.  A mpc5200b device
tree should use the "mpc5200b-<device>\0mpc5200-<device> form.

Required soc5200 child nodes:
name		device_type		compatible	Description
----		-----------		----------	-----------
cdm@<addr>	cdm			*-cmd		Clock Distribution
pic@<addr>	interrupt-controller	*-pic		need an interrupt
cdm@<addr>	cdm			mpc5200-cmd	Clock Distribution
pic@<addr>	interrupt-controller	mpc5200-pic	need an interrupt
							controller to boot
bestcomm@<addr>	dma-controller		*-bestcomm	52xx pic also requires
bestcomm@<addr>	dma-controller		mpc5200-bestcomm 5200 pic also requires
							 the bestcomm device

Recommended soc5200 child nodes; populate as needed for your board
name		device_type	compatible	  Description
----		-----------	----------	  -----------
gpt@<addr>	gpt		*-gpt		General purpose timers
rtc@<addr>	rtc		*-rtc		Real time clock
mscan@<addr>	mscan		*-mscan		CAN bus controller
pci@<addr>	pci		*-pci		PCI bridge
serial@<addr>	serial		*-psc-uart	PSC in serial mode
i2s@<addr>	sound		*-psc-i2s	PSC in i2s mode
ac97@<addr>	sound		*-psc-ac97	PSC in ac97 mode
spi@<addr>	spi		*-psc-spi	PSC in spi mode
irda@<addr>	irda		*-psc-irda	PSC in IrDA mode
spi@<addr>	spi		*-spi		MPC52xx spi device
ethernet@<addr>	network		*-fec		MPC52xx ethernet device
ata@<addr>	ata		*-ata		IDE ATA interface
i2c@<addr>	i2c		*-i2c		I2C controller
usb@<addr>	usb-ohci-be	*-ohci,ohci-be	USB controller
xlb@<addr>	xlb		*-xlb		XLB arbritrator
gpt@<addr>	gpt		mpc5200-gpt	  General purpose timers
rtc@<addr>	rtc		mpc5200-rtc	  Real time clock
mscan@<addr>	mscan		mpc5200-mscan	  CAN bus controller
pci@<addr>	pci		mpc5200-pci	  PCI bridge
serial@<addr>	serial		mpc5200-psc-uart  PSC in serial mode
i2s@<addr>	sound		mpc5200-psc-i2s	  PSC in i2s mode
ac97@<addr>	sound		mpc5200-psc-ac97  PSC in ac97 mode
spi@<addr>	spi		mpc5200-psc-spi	  PSC in spi mode
irda@<addr>	irda		mpc5200-psc-irda  PSC in IrDA mode
spi@<addr>	spi		mpc5200-spi	  MPC5200 spi device
ethernet@<addr>	network		mpc5200-fec	  MPC5200 ethernet device
ata@<addr>	ata		mpc5200-ata	  IDE ATA interface
i2c@<addr>	i2c		mpc5200-i2c	  I2C controller
usb@<addr>	usb-ohci-be	mpc5200-ohci,ohci-be	USB controller
xlb@<addr>	xlb		mpc5200-xlb	  XLB arbritrator

Important child node properties
name		type		description
----		----		-----------
cell-index	int		When multiple devices are present, is the
				index of the device in the hardware (ie. There
				are 6 PSC on the 5200 numbered PSC1 to PSC6)
				    PSC1 has 'cell-index = <0>'
				    PSC4 has 'cell-index = <3>'

5) General Purpose Timer nodes (child of soc5200 node)
On the mpc5200 and 5200b, GPT0 has a watchdog timer function.  If the board
design supports the internal wdt, then the device node for GPT0 should
include the empty property 'has-wdt'.

6) PSC nodes (child of soc5200 node)
PSC nodes can define the optional 'port-number' property to force assignment
order of serial ports.  For example, PSC5 might be physically connected to
the port labeled 'COM1' and PSC1 wired to 'COM1'.  In this case, PSC5 would
have a "port-number = <0>" property, and PSC1 would have "port-number = <1>".

PSC in i2s mode:  The mpc5200 and mpc5200b PSCs are not compatible when in
i2s mode.  An 'mpc5200b-psc-i2s' node cannot include 'mpc5200-psc-i2s' in the
compatible field.

IV - Extra Notes
================

1. Interrupt mapping
--------------------
The mpc52xx pic driver splits hardware IRQ numbers into two levels.  The
The mpc5200 pic driver splits hardware IRQ numbers into two levels.  The
split reflects the layout of the PIC hardware itself, which groups
interrupts into one of three groups; CRIT, MAIN or PERP.  Also, the
Bestcomm dma engine has it's own set of interrupt sources which are
cascaded off of peripheral interrupt 0, which the driver interprets as a
fourth group, SDMA.

The interrupts property for device nodes using the mpc52xx pic consists
The interrupts property for device nodes using the mpc5200 pic consists
of three cells; <L1 L2 level>

    L1 := [CRIT=0, MAIN=1, PERP=2, SDMA=3]
    L2 := interrupt number; directly mapped from the value in the
          "ICTL PerStat, MainStat, CritStat Encoded Register"
    level := [LEVEL_HIGH=0, EDGE_RISING=1, EDGE_FALLING=2, LEVEL_LOW=3]

2. Shared registers
-------------------
Some SoC devices share registers between them.  ie. the i2c devices use
a single clock control register, and almost all device are affected by
the port_config register.  Devices which need to manipulate shared regs
should look to the parent SoC node.  The soc node is responsible
for arbitrating all shared register access.
+1 −1
Original line number Diff line number Diff line
@@ -876,7 +876,7 @@ config ARCH_SPARSEMEM_ENABLE

config ARCH_SPARSEMEM_DEFAULT
	def_bool y
	depends on (SMP && PPC_PSERIES) || PPC_CELL
	depends on (SMP && PPC_PSERIES) || PPC_PS3

config ARCH_POPULATES_NODE_MAP
	def_bool y
+148 −0
Original line number Diff line number Diff line
/*
 * Device Tree Souce for Buffalo KuroboxHD
 *
 * Choose CONFIG_LINKSTATION to build a kernel for KuroboxHD, or use
 * the default configuration linkstation_defconfig.
 *
 * Based on sandpoint.dts
 *
 * 2006 (c) G. Liakhovetski <g.liakhovetski@gmx.de>
 *
 * This file is licensed under
 * the terms of the GNU General Public License version 2.  This program
 * is licensed "as is" without any warranty of any kind, whether express
 * or implied.

XXXX add flash parts, rtc, ??

build with: "dtc -f -I dts -O dtb -o kuroboxHD.dtb -V 16 kuroboxHD.dts"


 */

/ {
	linux,phandle = <1000>;
	model = "KuroboxHD";
	compatible = "linkstation";
	#address-cells = <1>;
	#size-cells = <1>;

	cpus {
		linux,phandle = <2000>;
		#cpus = <1>;
		#address-cells = <1>;
		#size-cells = <0>;

		PowerPC,603e { /* Really 8241 */
			linux,phandle = <2100>;
			linux,boot-cpu;
			device_type = "cpu";
			reg = <0>;
			clock-frequency = <bebc200>;	/* Fixed by bootwrapper */
			timebase-frequency = <1743000>; /* Fixed by bootwrapper */
			bus-frequency = <0>;		/* From bootloader */
			/* Following required by dtc but not used */
			i-cache-line-size = <0>;
			d-cache-line-size = <0>;
			i-cache-size = <4000>;
			d-cache-size = <4000>;
		};
	};

	memory {
		linux,phandle = <3000>;
		device_type = "memory";
		reg = <00000000 04000000>;
	};

	soc10x { /* AFAICT need to make soc for 8245's uarts to be defined */
		linux,phandle = <4000>;
		#address-cells = <1>;
		#size-cells = <1>;
		#interrupt-cells = <2>;
		device_type = "soc";
		compatible = "mpc10x";
		store-gathering = <0>; /* 0 == off, !0 == on */
		reg = <80000000 00100000>;
		ranges = <80000000 80000000 70000000	/* pci mem space */
			  fc000000 fc000000 00100000	/* EUMB */
			  fe000000 fe000000 00c00000	/* pci i/o space */
			  fec00000 fec00000 00300000	/* pci cfg regs */
			  fef00000 fef00000 00100000>;	/* pci iack */

		i2c@80003000 {
			linux,phandle = <4300>;
			device_type = "i2c";
			compatible = "fsl-i2c";
			reg = <80003000 1000>;
			interrupts = <5 2>;
			interrupt-parent = <4400>;
		};

		serial@80004500 {
			linux,phandle = <4511>;
			device_type = "serial";
			compatible = "ns16550";
			reg = <80004500 8>;
			clock-frequency = <5d08d88>;
			current-speed = <2580>;
			interrupts = <9 2>;
			interrupt-parent = <4400>;
		};

		serial@80004600 {
			linux,phandle = <4512>;
			device_type = "serial";
			compatible = "ns16550";
			reg = <80004600 8>;
			clock-frequency = <5d08d88>;
			current-speed = <e100>;
			interrupts = <a 0>;
			interrupt-parent = <4400>;
		};

		pic@80040000 {
			linux,phandle = <4400>;
			#interrupt-cells = <2>;
			#address-cells = <0>;
			device_type = "open-pic";
			compatible = "chrp,open-pic";
			interrupt-controller;
			reg = <80040000 40000>;
			built-in;
		};

		pci@fec00000 {
			linux,phandle = <4500>;
			#address-cells = <3>;
			#size-cells = <2>;
			#interrupt-cells = <1>;
			device_type = "pci";
			compatible = "mpc10x-pci";
			reg = <fec00000 400000>;
			ranges = <01000000 0        0 fe000000 0 00c00000
				  02000000 0 80000000 80000000 0 70000000>;
			bus-range = <0 ff>;
			clock-frequency = <7f28155>;
			interrupt-parent = <4400>;
			interrupt-map-mask = <f800 0 0 7>;
			interrupt-map = <
				/* IDSEL 0x11 - IRQ0 ETH */
				5800 0 0 1 4400 0 1
				5800 0 0 2 4400 1 1
				5800 0 0 3 4400 2 1
				5800 0 0 4 4400 3 1
				/* IDSEL 0x12 - IRQ1 IDE0 */
				6000 0 0 1 4400 1 1
				6000 0 0 2 4400 2 1
				6000 0 0 3 4400 3 1
				6000 0 0 4 4400 0 1
				/* IDSEL 0x14 - IRQ3 USB2.0 */
				7000 0 0 1 4400 3 1
				7000 0 0 2 4400 3 1
				7000 0 0 3 4400 3 1
				7000 0 0 4 4400 3 1
			>;
		};
	};
};
+79 −56

File changed.

Preview size limit exceeded, changes collapsed.

Loading