LinuxPPC-Dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* Re: [PATCH 2/4] mpc8313erdb: Add NAND to device tree, and call of_platform_bus_probe().
From: Olof Johansson @ 2007-12-13 21:40 UTC (permalink / raw)
  To: Scott Wood; +Cc: linuxppc-dev
In-Reply-To: <20071213171714.GA4510@loki.buserror.net>

On Thu, Dec 13, 2007 at 11:17:14AM -0600, Scott Wood wrote:
> Signed-off-by: Scott Wood <scottwood@freescale.com>
> diff --git a/arch/powerpc/platforms/83xx/mpc8313_rdb.c b/arch/powerpc/platforms/83xx/mpc8313_rdb.c
> index 6fb8299..3ad482a 100644
> --- a/arch/powerpc/platforms/83xx/mpc8313_rdb.c
> +++ b/arch/powerpc/platforms/83xx/mpc8313_rdb.c
> @@ -14,6 +14,7 @@
>   */
>  
>  #include <linux/pci.h>
> +#include <linux/of_platform.h>
>  
>  #include <asm/time.h>
>  #include <asm/ipic.h>
> @@ -75,6 +76,22 @@ static int __init mpc8313_rdb_probe(void)
>  	return of_flat_dt_is_compatible(root, "MPC8313ERDB");
>  }
>  
> +static struct of_device_id __initdata of_bus_ids[] = {
> +	{ .name = "soc8313", },
> +	{ .name = "localbus", },

Please probe based on compatible instead of name properties.


Thanks,

Olof

^ permalink raw reply

* RE: [ofa-general] Re: [ewg] Re: [PATCH] IB/ehca: Serialize HCA-related hCalls on POWER5
From: Joachim Fenkes @ 2007-12-13 21:35 UTC (permalink / raw)
  To: Caitlin Bestler
  Cc: Arnd Bergmann, Roland Dreier, LKML, Or Gerlitz, linuxppc-dev,
	OF-General, Stefan Roscher
In-Reply-To: <78C9135A3D2ECE4B8162EBDCE82CAD7702B14004@nekter>

"Caitlin Bestler" <Caitlin.Bestler@neterion.com> wrote on 13.12.2007 
22:08:34:

> To clarify, an FMR Work Request is simply posted to the SendQ like
> any other Work Request (of course the QP has to be privileged, or
> it will complete in error). An SQ Post should never block.

This would require hardware support, wouldn't it? eHCA2 doesn't have this 
kind of support, so FMR WRs are not an option here.

J.

^ permalink raw reply

* Re: [PATCH 19/20] [POWERPC] pci32: 4xx embedded platforms want to reassign all PCI resources
From: Benjamin Herrenschmidt @ 2007-12-13 21:37 UTC (permalink / raw)
  To: Josh Boyer; +Cc: linuxppc-dev
In-Reply-To: <20071213151138.02db0cd8@weaponx>


On Thu, 2007-12-13 at 15:11 -0600, Josh Boyer wrote:
> Well, there is physical PCI hardware on the boards, yes.  But what if
> people have no intention of using it?  E.g. they have no devices, etc.
> Now we're requiring PCI support to be built into the kernel.
> 
> I'm just being pedantic about keeping embedded tiny.

Keeping your embedded design tiny (and thus your own BSP) is one thing,
but adding ifdef's all over the place so that somebody can tinify an
eval board, I'm less sure about this... but if you want, you can fixup
my patches.

Ben.

^ permalink raw reply

* Re: [PATCH 19/20] [POWERPC] pci32: 4xx embedded platforms want to reassign all PCI resources
From: Josh Boyer @ 2007-12-13 21:59 UTC (permalink / raw)
  To: benh; +Cc: linuxppc-dev
In-Reply-To: <1197581846.15741.183.camel@pasglop>

On Fri, 14 Dec 2007 08:37:26 +1100
Benjamin Herrenschmidt <benh@kernel.crashing.org> wrote:

> 
> On Thu, 2007-12-13 at 15:11 -0600, Josh Boyer wrote:
> > Well, there is physical PCI hardware on the boards, yes.  But what if
> > people have no intention of using it?  E.g. they have no devices, etc.
> > Now we're requiring PCI support to be built into the kernel.
> > 
> > I'm just being pedantic about keeping embedded tiny.
> 
> Keeping your embedded design tiny (and thus your own BSP) is one thing,
> but adding ifdef's all over the place so that somebody can tinify an
> eval board, I'm less sure about this... but if you want, you can fixup
> my patches.

I'm not really advocating for ifdefs.  If it annoys me enough (which I
doubt it will), then I'd try to come up with some way to avoid those
too.  For now, I think selecting PCI in Kconfig for those boards is OK.

josh

^ permalink raw reply

* RE: [ofa-general] Re: [ewg] Re: [PATCH] IB/ehca: SerializeHCA-related hCalls on POWER5
From: Sean Hefty @ 2007-12-13 21:48 UTC (permalink / raw)
  To: 'Caitlin Bestler', Joachim Fenkes
  Cc: Arnd Bergmann, Roland Dreier, LKML, linuxppc-dev, OF-General,
	Stefan Roscher
In-Reply-To: <78C9135A3D2ECE4B8162EBDCE82CAD7702B14004@nekter>

>To clarify, an FMR Work Request is simply posted to the SendQ like
>any other Work Request (of course the QP has to be privileged, or
>it will complete in error). An SQ Post should never block.

FMR's as defined by the IB spec and that created by Mellanox are not the same.
They, unfortunately, use the same name and acronym only.  Mellanox FMRs use an
API that is more like that of standard MRs. 

- Sean

^ permalink raw reply

* Device Tree updates for xilinx.
From: Stephen Neuendorffer @ 2007-12-13 23:41 UTC (permalink / raw)
  To: Stephen Neuendorffer, Grant Likely, Michal Simek, John Williams
  Cc: linuxppc-dev, git
In-Reply-To: <20071204012811.AD70CEF004D@mail134-dub.bigfish.com>

These patches synchronize all the in-kernel drivers to use the
compatible names generated by the UBoot BSP generator.
(at git://git.xilinx.com/gen-mhs-devtree.git)

The patches to make this work are coming shortly:

patches 1-2 are provided for context only...  They're not ready for
mainline.  They provide 'raw' boot support and port some initialization
code from ARCH=3Dppc.
patches 3-7 are the interesting patches, which I think could be taken
for 2.6.25.

I've also pushed the working tree up to git.xilinx.com containing these
patches.  This tree also includes updates for ps2, gpio, etc.
The ll_temac currently doesn't work because I haven't gone back and
fixed the mechanism by which it finds out about the DMA that it is
connected to.

If you want output from the boot loader, you'll need something like:
		linux,stdout-path =3D "/plb_v34/opb_v20/serial@40400000";=20
This seems to work with uartlite, but I wasn't able to get it working
with a UART design.

Currently, you'll need to add, by hand the following labels:

mem_size_cells, on the toplevel #address-cells attribue, e,g. :
	mem_size_cells: #address-cells =3D <1>;

timebase, on the processors timebase-frequency attribute, e.g. :
			timebase: timebase-frequency =3D <11e1a300>;

memsize, on the memory's size, e.g.:
	DDR_256MB_32MX64_rank1_row13_col10_cl2_5: memory@0 {
		device_type =3D "memory";
		reg =3D < 0 memsize:10000000 >;
	} ;

In addition, if you're using uartlite, you'll have to specify
'console=3DttyUL0' as boot args.

For reference, below is the device tree for a Virtex2Pro design.  Except
for the changes noted above, this is entirely automatically generated.

Steve

/ {
	mem_size_cells: #address-cells =3D <1>;
	#size-cells =3D <1>;
	compatible =3D "xlnx,virtex";
	model =3D "testing";
	DDR_256MB_32MX64_rank1_row13_col10_cl2_5: memory@0 {
		device_type =3D "memory";
		reg =3D < 0 memsize:10000000 >;
	} ;
	chosen {
		bootargs =3D "root=3D/dev/nfs
nfsroot=3D172.19.221.221:/exports/xup/ydl41 ip=3Ddhcp console=3DttyUL0";
	} ;
	cpus {
		#address-cells =3D <1>;
		#cpus =3D <1>;
		#size-cells =3D <0>;
		PowerPC,405@0 {
			clock-frequency =3D <11e1a300>;
			d-cache-line-size =3D <20>;
			d-cache-size =3D <4000>;
			device_type =3D "cpu";
			i-cache-line-size =3D <20>;
			i-cache-size =3D <4000>;
			reg =3D <0>;
			timebase: timebase-frequency =3D <11e1a300>;
			xlnx,dcr-resync =3D <0>;
			xlnx,deterministic-mult =3D <0>;
			xlnx,disable-operand-forwarding =3D <1>;
			xlnx,mmu-enable =3D <1>;
		} ;
	} ;
	plb_v34 {
		#address-cells =3D <1>;
		#size-cells =3D <1>;
		compatible =3D "xlnx,plb-v34-1.02.a";
		ranges ;
		Ethernet_MAC: ethernet@80400000 {
			compatible =3D "xlnx,plb-ethernet-1.01.a";
			device_type =3D "network";
			interrupt-parent =3D <&opb_intc_0>;
			interrupts =3D < 2 0 >;
			local-mac-address =3D [ 00 00 00 00 00 00 ];
			reg =3D < 80400000 10000 >;
			xlnx,dev-blk-id =3D <0>;
			xlnx,dev-mir-enable =3D <1>;
			xlnx,dma-intr-coalesce =3D <1>;
			xlnx,dma-present =3D <1>;
			xlnx,err-count-exist =3D <1>;
			xlnx,fcs-insert-exist =3D <1>;
			xlnx,half-duplex-exist =3D <1>;
			xlnx,include-dev-pencoder =3D <1>;
			xlnx,ipif-fifo-depth =3D <8000>;
			xlnx,mac-fifo-depth =3D <40>;
			xlnx,mii-exist =3D <1>;
			xlnx,miim-clkdvd =3D <13>;
			xlnx,pad-insert-exist =3D <1>;
			xlnx,reset-present =3D <1>;
			xlnx,source-addr-insert-exist =3D <1>;
		} ;
		opb_v20 {
			#address-cells =3D <1>;
			#size-cells =3D <1>;
			compatible =3D "xlnx,opb-v20-1.10.c";
			ranges ;
			Audio_Codec: opb-ac97@7d400000 {
				compatible =3D "xlnx,opb-ac97-2.00.a";
				interrupt-parent =3D <&opb_intc_0>;
				interrupts =3D < 1 0 >;
				reg =3D < 7d400000 10000 >;
				xlnx,intr-level =3D <1>;
				xlnx,playback =3D <1>;
				xlnx,record =3D <1>;
				xlnx,use-bram =3D <1>;
			} ;
			DIPSWs_4Bit: opb-gpio@40020000 {
				compatible =3D "xlnx,opb-gpio-3.01.b";
				reg =3D < 40020000 10000 >;
				xlnx,all-inputs =3D <1>;
				xlnx,all-inputs-2 =3D <0>;
				xlnx,dout-default =3D <0>;
				xlnx,dout-default-2 =3D <0>;
				xlnx,gpio-width =3D <4>;
				xlnx,interrupt-present =3D <0>;
				xlnx,is-bidir =3D <1>;
				xlnx,is-bidir-2 =3D <1>;
				xlnx,is-dual =3D <0>;
				xlnx,tri-default =3D <ffffffff>;
				xlnx,tri-default-2 =3D <ffffffff>;
				xlnx,user-id-code =3D <3>;
			} ;
			LEDs_4Bit: opb-gpio@40000000 {
				compatible =3D "xlnx,opb-gpio-3.01.b";
				reg =3D < 40000000 10000 >;
				xlnx,all-inputs =3D <0>;
				xlnx,all-inputs-2 =3D <0>;
				xlnx,dout-default =3D <0>;
				xlnx,dout-default-2 =3D <0>;
				xlnx,gpio-width =3D <4>;
				xlnx,interrupt-present =3D <0>;
				xlnx,is-bidir =3D <0>;
				xlnx,is-bidir-2 =3D <1>;
				xlnx,is-dual =3D <0>;
				xlnx,tri-default =3D <ffffffff>;
				xlnx,tri-default-2 =3D <ffffffff>;
				xlnx,user-id-code =3D <3>;
			} ;
			PS2_Ports: opb-ps2-dual-ref@7a400000 {
				#address-cells =3D <1>;
				#size-cells =3D <1>;
				compatible =3D "xlnx,compound";
				ranges =3D < 0 7a400000 10000 >;
				opb-ps2-dual-ref@0 {
					compatible =3D
"xlnx,opb-ps2-dual-ref-1.00.a";
					interrupt-parent =3D
<&opb_intc_0>;
					interrupts =3D < 6 0 >;
					reg =3D < 0 40 >;
				} ;
				opb-ps2-dual-ref@1000 {
					compatible =3D
"xlnx,opb-ps2-dual-ref-1.00.a";
					interrupt-parent =3D
<&opb_intc_0>;
					interrupts =3D < 5 0 >;
					reg =3D < 1000 40 >;
				} ;
			} ;
			PushButtons_5Bit: opb-gpio@40040000 {
				compatible =3D "xlnx,opb-gpio-3.01.b";
				reg =3D < 40040000 10000 >;
				xlnx,all-inputs =3D <1>;
				xlnx,all-inputs-2 =3D <0>;
				xlnx,dout-default =3D <0>;
				xlnx,dout-default-2 =3D <0>;
				xlnx,gpio-width =3D <5>;
				xlnx,interrupt-present =3D <0>;
				xlnx,is-bidir =3D <1>;
				xlnx,is-bidir-2 =3D <1>;
				xlnx,is-dual =3D <0>;
				xlnx,tri-default =3D <ffffffff>;
				xlnx,tri-default-2 =3D <ffffffff>;
				xlnx,user-id-code =3D <3>;
			} ;
			RS232_Uart_1: serial@40400000 {
				compatible =3D "xlnx,opb-uartlite-1.00.b";
				device_type =3D "serial";
				interrupt-parent =3D <&opb_intc_0>;
				interrupts =3D < 4 0 >;
				port-number =3D <0>;
				reg =3D < 40400000 10000 >;
				xlnx,baudrate =3D <2580>;
				xlnx,clk-freq =3D <5f5e100>;
				xlnx,data-bits =3D <8>;
				xlnx,odd-parity =3D <0>;
				xlnx,use-parity =3D <0>;
			} ;
			SysACE_CompactFlash: opb-sysace@41800000 {
				compatible =3D "xlnx,opb-sysace-1.00.c";
				interrupt-parent =3D <&opb_intc_0>;
				interrupts =3D < 3 0 >;
				reg =3D < 41800000 10000 >;
				xlnx,mem-width =3D <10>;
			} ;
			dcr_v29 {
				#address-cells =3D <1>;
				#size-cells =3D <1>;
				compatible =3D "xlnx,dcr-v29-1.00.a";
				ranges =3D < 0 40700000 1000 >;
				VGA_FrameBuffer: plb-tft-cntlr-ref@200 {
					compatible =3D
"xlnx,plb-tft-cntlr-ref-1.00.a";
					reg =3D < 200 8 >;
					xlnx,default-tft-base-addr =3D
<7f>;
					xlnx,dps-init =3D <1>;
					xlnx,on-init =3D <1>;
					xlnx,pixclk-is-busclk-divby4 =3D
<1>;
				} ;
			} ;
			onewire_0: opb-onewire@7a200000 {
				compatible =3D "xlnx,opb-onewire-1.00.a";
				reg =3D < 7a200000 10000 >;
				xlnx,add-pullup =3D "true";
				xlnx,checkcrc =3D "true";
				xlnx,clk-div =3D <f>;
			} ;
			opb_hwicap_0: opb-hwicap@41300000 {
				compatible =3D "xlnx,opb-hwicap-1.00.b";
				reg =3D < 41300000 10000 >;
			} ;
			opb_intc_0: interrupt-controller@41200000 {
				#interrupt-cells =3D <2>;
				compatible =3D "xlnx,opb-intc-1.00.c";
				interrupt-controller ;
				reg =3D < 41200000 10000 >;
				xlnx,num-intr-inputs =3D <7>;
			} ;
			opb_timer_0: opb-timer@40800000 {
				compatible =3D "xlnx,opb-timer-1.00.b";
				interrupt-parent =3D <&opb_intc_0>;
				interrupts =3D < 0 0 >;
				reg =3D < 40800000 100 >;
				xlnx,count-width =3D <20>;
				xlnx,gen0-assert =3D <1>;
				xlnx,gen1-assert =3D <1>;
				xlnx,one-timer-only =3D <0>;
				xlnx,trig0-assert =3D <1>;
				xlnx,trig1-assert =3D <1>;
			} ;
		} ;
	} ;
}  ;

^ permalink raw reply

* [PATCH 1/7] bootwrapper: Add a firmware-independent "raw" target.
From: Stephen Neuendorffer @ 2007-12-13 23:43 UTC (permalink / raw)
  To: grant.likely, simekm2, jwilliams, linuxppc-dev

From: Grant Likely <grant.likely@secretlab.ca>

This target produces a flat binary rather than an ELF file,
fixes the entry point at the beginning of the image, and takes
a complete device tree with no fixups needed.

The device tree must have labels on /#address-cells, the timebase
frequency, and the memory size.

Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
---
 arch/powerpc/Kconfig             |   12 +++++++++++
 arch/powerpc/boot/Makefile       |    6 ++++-
 arch/powerpc/boot/io.h           |    7 ++++++
 arch/powerpc/boot/raw-platform.c |   41 ++++++++++++++++++++++++++++++++++++++
 arch/powerpc/boot/wrapper        |   15 +++++++++----
 5 files changed, 75 insertions(+), 6 deletions(-)
 create mode 100644 arch/powerpc/boot/raw-platform.c

diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
index 232c298..4a60ec4 100644
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
@@ -394,6 +394,18 @@ config WANT_DEVICE_TREE
 	bool
 	default n
 
+config BUILD_RAW_IMAGE
+	bool "Build firmware-independent image"
+	select WANT_DEVICE_TREE
+	help
+	  If this is enabled, a firmware independent "raw" image will be
+	  built, as zImage.raw.  This requires a completely filled-in
+	  device tree, with the following labels:
+
+	  mem_size_cells: on /#address-cells
+	  memsize: on the size portion of /memory/reg
+	  timebase: on the boot CPU's timebase property
+
 config DEVICE_TREE
 	string "Static device tree source file"
 	depends on WANT_DEVICE_TREE
diff --git a/arch/powerpc/boot/Makefile b/arch/powerpc/boot/Makefile
index 18e3271..975e1f5 100644
--- a/arch/powerpc/boot/Makefile
+++ b/arch/powerpc/boot/Makefile
@@ -56,7 +56,7 @@ src-plat := of.c cuboot-52xx.c cuboot-83xx.c cuboot-85xx.c holly.c \
 		cuboot-ebony.c treeboot-ebony.c prpmc2800.c \
 		ps3-head.S ps3-hvcall.S ps3.c treeboot-bamboo.c cuboot-8xx.c \
 		cuboot-pq2.c cuboot-sequoia.c treeboot-walnut.c cuboot-bamboo.c \
-		fixed-head.S ep88xc.c cuboot-hpc2.c
+		fixed-head.S ep88xc.c cuboot-hpc2.c raw-platform.c
 src-boot := $(src-wlib) $(src-plat) empty.c
 
 src-boot := $(addprefix $(obj)/, $(src-boot))
@@ -159,6 +159,7 @@ image-$(CONFIG_EBONY)			+= treeImage.ebony cuImage.ebony
 image-$(CONFIG_BAMBOO)			+= treeImage.bamboo cuImage.bamboo
 image-$(CONFIG_SEQUOIA)			+= cuImage.sequoia
 image-$(CONFIG_WALNUT)			+= treeImage.walnut
+image-$(CONFIG_BUILD_RAW_IMAGE)		+= zImage.raw
 endif
 
 # For 32-bit powermacs, build the COFF and miboot images
@@ -221,6 +222,9 @@ $(obj)/treeImage.initrd.%: vmlinux $(dts) $(wrapperbits)
 $(obj)/treeImage.%: vmlinux $(dts) $(wrapperbits)
 	$(call if_changed,wrap,treeboot-$*,$(dts))
 
+$(obj)/zImage.raw: vmlinux $(dts) $(wrapperbits)
+	$(call if_changed,wrap,raw,$(dts))
+
 # If there isn't a platform selected then just strip the vmlinux.
 ifeq (,$(image-y))
 image-y := vmlinux.strip
diff --git a/arch/powerpc/boot/io.h b/arch/powerpc/boot/io.h
index ccaedae..ec57ec9 100644
--- a/arch/powerpc/boot/io.h
+++ b/arch/powerpc/boot/io.h
@@ -99,4 +99,11 @@ static inline void barrier(void)
 	asm volatile("" : : : "memory");
 }
 
+static inline void disable_irq(void)
+{
+	int dummy;
+	asm volatile("mfmsr %0; rlwinm %0, %0, 0, ~(1<<15); mtmsr %0" :
+	             "=r" (dummy) : : "memory");
+}
+
 #endif /* _IO_H */
diff --git a/arch/powerpc/boot/raw-platform.c b/arch/powerpc/boot/raw-platform.c
new file mode 100644
index 0000000..b9caeee
--- /dev/null
+++ b/arch/powerpc/boot/raw-platform.c
@@ -0,0 +1,41 @@
+/*
+ * The "raw" platform -- for booting from a complete dtb without
+ * any fixups.
+ *
+ * Author: Scott Wood <scottwood@freescale.com>
+ *
+ * Copyright (c) 2007 Freescale Semiconductor, Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 as published
+ * by the Free Software Foundation.
+ */
+
+#include "ops.h"
+#include "types.h"
+#include "io.h"
+
+BSS_STACK(4096);
+
+/* These are labels in the device tree. */
+extern u32 memsize[2], timebase, mem_size_cells;
+
+void platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
+                   unsigned long r6, unsigned long r7)
+{
+	u64 memsize64 = memsize[0];
+
+	if (mem_size_cells == 2) {
+		memsize64 <<= 32;
+		memsize64 |= memsize[1];
+	}
+
+	if (sizeof(void *) == 4 && memsize64 >= 0x100000000ULL)
+		memsize64 = 0xffffffff;
+
+	disable_irq();
+	timebase_period_ns = 1000000000 / timebase;
+	simple_alloc_init(_end, memsize64 - (unsigned long)_end, 32, 64);
+	ft_init(_dtb_start, _dtb_end - _dtb_start, 32);
+	serial_console_init();
+}
diff --git a/arch/powerpc/boot/wrapper b/arch/powerpc/boot/wrapper
index 31147a0..716cd44 100755
--- a/arch/powerpc/boot/wrapper
+++ b/arch/powerpc/boot/wrapper
@@ -116,10 +116,11 @@ while [ "$#" -gt 0 ]; do
 done
 
 if [ -n "$dts" ]; then
-    if [ -z "$dtb" ]; then
-	dtb="$platform.dtb"
-    fi
-    dtc -O dtb -o "$dtb" -b 0 -V 16 "$dts"
+    dtasm="$object/$platform.dtb.S"
+    dto="$object/$platform.dtb.o"
+    echo '.section .kernel:dtb,"a"' > "$dtasm"
+    dtc -O asm -b 0 -V 16 "$dts" >> "$dtasm"
+    ${CROSS}gcc "$dtasm" -c -o "$dto"
 fi
 
 if [ -z "$kernel" ]; then
@@ -167,6 +168,10 @@ ep88xc)
     platformo="$object/fixed-head.o $object/$platform.o"
     binary=y
     ;;
+raw)
+    platformo="$object/fixed-head.o $object/raw-platform.o"
+    binary=y
+    ;;
 esac
 
 vmz="$tmpdir/`basename \"$kernel\"`.$ext"
@@ -230,7 +235,7 @@ fi
 
 if [ "$platform" != "miboot" ]; then
     ${CROSS}ld -m elf32ppc -T $lds -o "$ofile" \
-	$platformo $tmp $object/wrapper.a
+	$platformo $tmp $dto $object/wrapper.a
     rm $tmp
 fi
 
-- 
1.5.3.4

^ permalink raw reply related

* [PATCH 2/7] [POWERPC] Xilinx: clear data caches.
From: Stephen Neuendorffer @ 2007-12-13 23:43 UTC (permalink / raw)
  To: grant.likely, simekm2, jwilliams, linuxppc-dev
In-Reply-To: <1197589413-5965-1-git-send-email-stephen.neuendorffer@xilinx.com>

This code is needed to boot without a boot loader.

Grant:  I'm not sure where the right place to put this is.  I'm assuming we'll actually need some boot code that is not generic?  Also, note that there is a V4FX errata workaround in arch/ppc/boot/head.S, which probably also needs to get pulled to powerpc.

Signed-off-by: Stephen Neuendorffer <stephen.neuendorffer@xilinx.com>
---
 arch/powerpc/boot/raw-platform.c |   22 ++++++++++++++++++++++
 1 files changed, 22 insertions(+), 0 deletions(-)

diff --git a/arch/powerpc/boot/raw-platform.c b/arch/powerpc/boot/raw-platform.c
index b9caeee..2a5e493 100644
--- a/arch/powerpc/boot/raw-platform.c
+++ b/arch/powerpc/boot/raw-platform.c
@@ -24,6 +24,28 @@ void platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
                    unsigned long r6, unsigned long r7)
 {
 	u64 memsize64 = memsize[0];
+	static const unsigned long line_size = 32;
+	static const unsigned long congruence_classes = 256;
+	unsigned long addr;
+	unsigned long dccr;
+
+	/*
+	 * Invalidate the data cache if the data cache is turned off.
+	 * - The 405 core does not invalidate the data cache on power-up
+	 *   or reset but does turn off the data cache. We cannot assume
+	 *   that the cache contents are valid.
+	 * - If the data cache is turned on this must have been done by
+	 *   a bootloader and we assume that the cache contents are
+	 *   valid.
+	 */
+	__asm__("mfdccr %0": "=r" (dccr));
+	if (dccr == 0) {
+		for (addr = 0;
+		     addr < (congruence_classes * line_size);
+		     addr += line_size) {
+			__asm__("dccci 0,%0": :"b"(addr));
+		}
+	}
 
 	if (mem_size_cells == 2) {
 		memsize64 <<= 32;
-- 
1.5.3.4

^ permalink raw reply related

* [PATCH 6/7] [POWERPC] Xilinx: Add correct compatible list for device tree bus bindings.
From: Stephen Neuendorffer @ 2007-12-13 23:43 UTC (permalink / raw)
  To: grant.likely, simekm2, jwilliams, linuxppc-dev
In-Reply-To: <1197589413-5965-5-git-send-email-stephen.neuendorffer@xilinx.com>

Includes both flavors of plb, opb, dcr, and a pseudo 'compound' bus
for representing compound peripherals containing more than one logical
device.

Signed-off-by: Stephen Neuendorffer <stephen.neuendorffer@xilinx.com>
---
 arch/powerpc/platforms/40x/virtex.c |   12 +++++++++++-
 1 files changed, 11 insertions(+), 1 deletions(-)

diff --git a/arch/powerpc/platforms/40x/virtex.c b/arch/powerpc/platforms/40x/virtex.c
index 859ba1d..7590fa5 100644
--- a/arch/powerpc/platforms/40x/virtex.c
+++ b/arch/powerpc/platforms/40x/virtex.c
@@ -15,12 +15,22 @@
 #include <asm/time.h>
 #include <asm/xilinx_intc.h>
 
+static struct of_device_id xilinx_of_bus_ids[] = {
+	{ .compatible = "xlnx,plb-v46-1.00.a", },
+	{ .compatible = "xlnx,plb-v34-1.01.a", },
+	{ .compatible = "xlnx,plb-v34-1.02.a", },
+	{ .compatible = "xlnx,opb-v20-1.10.c", },
+	{ .compatible = "xlnx,dcr-v29-1.00.a", },
+	{ .compatible = "xlnx,compound", },
+	{},
+};
+
 static int __init virtex_device_probe(void)
 {
 	if (!machine_is(virtex))
 		return 0;
 
-	of_platform_bus_probe(NULL, NULL, NULL);
+	of_platform_bus_probe(NULL, xilinx_of_bus_ids, NULL);
 
 	return 0;
 }
-- 
1.5.3.4

^ permalink raw reply related

* [PATCH 3/7] [POWERPC] Xilinx: Uartlite: Make console output actually work.
From: Stephen Neuendorffer @ 2007-12-13 23:43 UTC (permalink / raw)
  To: grant.likely, simekm2, jwilliams, linuxppc-dev
In-Reply-To: <1197589413-5965-2-git-send-email-stephen.neuendorffer@xilinx.com>

From: Grant Likely <grant.likely@secretlab.ca>

Signed-off-by: Grant Likely <grant.likely@secretlab.ca>

Fixed to apply against 2.6.24-rc5, and remove DEBUG information.

Signed-off-by: Stephen Neuendorffer <stephen.neuendorffer@xilinx.com>
---
 drivers/serial/uartlite.c |  121 +++++++++++++++++++++++++++++----------------
 1 files changed, 79 insertions(+), 42 deletions(-)

diff --git a/drivers/serial/uartlite.c b/drivers/serial/uartlite.c
index 3f59324..5ec42f3 100644
--- a/drivers/serial/uartlite.c
+++ b/drivers/serial/uartlite.c
@@ -9,6 +9,8 @@
  * kind, whether express or implied.
  */
 
+#undef DEBUG
+
 #include <linux/platform_device.h>
 #include <linux/module.h>
 #include <linux/console.h>
@@ -321,6 +323,49 @@ static struct uart_ops ulite_ops = {
 	.verify_port	= ulite_verify_port
 };
 
+/**
+ * ulite_get_port: Get the uart_port for a given port number and base addr
+ */
+static struct uart_port * ulite_get_port(int id)
+{
+	struct uart_port *port;
+
+	/* if id = -1; then scan for a free id and use that */
+	if (id < 0) {
+		for (id = 0; id < ULITE_NR_UARTS; id++)
+			if (ulite_ports[id].mapbase == 0)
+				break;
+	}
+
+	if ((id < 0) || (id >= ULITE_NR_UARTS)) {
+		printk(KERN_WARNING "uartlite: invalid id: %i\n", id);
+		return NULL;
+	}
+
+	/* The ID is valid, so get the address of the uart_port structure */
+	port = &ulite_ports[id];
+
+	/* Is the structure is already initialized? */
+	if (port->mapbase)
+		return port;
+
+	/* At this point, we've got an empty uart_port struct, initialize it */
+	spin_lock_init(&port->lock);
+	port->membase = NULL;
+	port->fifosize = 16;
+	port->regshift = 2;
+	port->iotype = UPIO_MEM;
+	port->iobase = 1; /* mark port in use */
+	port->ops = &ulite_ops;
+	port->irq = NO_IRQ;
+	port->flags = UPF_BOOT_AUTOCONF;
+	port->dev = NULL;
+	port->type = PORT_UNKNOWN;
+	port->line = id;
+
+	return port;
+}
+
 /* ---------------------------------------------------------------------
  * Console driver operations
  */
@@ -376,7 +421,7 @@ static void ulite_console_write(struct console *co, const char *s,
 }
 
 #if defined(CONFIG_OF)
-static inline void __init ulite_console_of_find_device(int id)
+static inline u32 __init ulite_console_of_find_device(int id)
 {
 	struct device_node *np;
 	struct resource res;
@@ -392,13 +437,14 @@ static inline void __init ulite_console_of_find_device(int id)
 		if (rc)
 			continue;
 
-		ulite_ports[id].mapbase = res.start;
 		of_node_put(np);
-		return;
+		return res.start+3;
 	}
+
+	return 0;
 }
 #else /* CONFIG_OF */
-static inline void __init ulite_console_of_find_device(int id) { /* do nothing */ }
+static inline u32 __init ulite_console_of_find_device(int id) { return 0; }
 #endif /* CONFIG_OF */
 
 static int __init ulite_console_setup(struct console *co, char *options)
@@ -408,25 +454,33 @@ static int __init ulite_console_setup(struct console *co, char *options)
 	int bits = 8;
 	int parity = 'n';
 	int flow = 'n';
+	u32 base;
 
-	if (co->index < 0 || co->index >= ULITE_NR_UARTS)
-		return -EINVAL;
+	/* Find a matching uart port in the device tree */
+	base = ulite_console_of_find_device(co->index);
 
-	port = &ulite_ports[co->index];
+	/* Get the port structure */
+	port = ulite_get_port(co->index);
+	if (!port)
+		return -ENODEV;
 
-	/* Check if it is an OF device */
-	if (!port->mapbase)
-		ulite_console_of_find_device(co->index);
+	/* was it initialized for this device? */
+	if (base) {
+		if ((port->mapbase) && (port->mapbase != base)) {
+			pr_debug(KERN_DEBUG "ulite: addr mismatch; %x != %x\n",
+				 port->mapbase, base);
+			return -ENODEV; /* port used by another device; bail */
+		}
+		port->mapbase = base;
+	}
 
-	/* Do we have a device now? */
-	if (!port->mapbase) {
-		pr_debug("console on ttyUL%i not present\n", co->index);
+	if (!port->mapbase)
 		return -ENODEV;
-	}
 
-	/* not initialized yet? */
+	/* registers mapped yet? */
 	if (!port->membase) {
-		if (ulite_request_port(port))
+		port->membase = ioremap(port->mapbase, ULITE_REGION);
+		if (!port->membase)
 			return -ENODEV;
 	}
 
@@ -488,39 +542,22 @@ static int __devinit ulite_assign(struct device *dev, int id, u32 base, int irq)
 	struct uart_port *port;
 	int rc;
 
-	/* if id = -1; then scan for a free id and use that */
-	if (id < 0) {
-		for (id = 0; id < ULITE_NR_UARTS; id++)
-			if (ulite_ports[id].mapbase == 0)
-				break;
-	}
-	if (id < 0 || id >= ULITE_NR_UARTS) {
-		dev_err(dev, "%s%i too large\n", ULITE_NAME, id);
-		return -EINVAL;
+	port = ulite_get_port(id);
+	if (!port) {
+		dev_err(dev, "Cannot get uart_port structure\n");
+		return -ENODEV;
 	}
 
-	if ((ulite_ports[id].mapbase) && (ulite_ports[id].mapbase != base)) {
-		dev_err(dev, "cannot assign to %s%i; it is already in use\n",
-			ULITE_NAME, id);
-		return -EBUSY;
+	/* was it initialized for this device? */
+	if ((port->mapbase) && (port->mapbase != base)) {
+		pr_debug(KERN_DEBUG "ulite: addr mismatch; %x != %x\n",
+			 port->mapbase, base);
+		return -ENODEV;
 	}
 
-	port = &ulite_ports[id];
-
-	spin_lock_init(&port->lock);
-	port->fifosize = 16;
-	port->regshift = 2;
-	port->iotype = UPIO_MEM;
-	port->iobase = 1; /* mark port in use */
 	port->mapbase = base;
-	port->membase = NULL;
-	port->ops = &ulite_ops;
 	port->irq = irq;
-	port->flags = UPF_BOOT_AUTOCONF;
 	port->dev = dev;
-	port->type = PORT_UNKNOWN;
-	port->line = id;
-
 	dev_set_drvdata(dev, port);
 
 	/* Register the port */
-- 
1.5.3.4

^ permalink raw reply related

* [PATCH 4/7] [POWERPC] Xilinx: update compatible list for interrupt controller
From: Stephen Neuendorffer @ 2007-12-13 23:43 UTC (permalink / raw)
  To: grant.likely, simekm2, jwilliams, linuxppc-dev
In-Reply-To: <1197589413-5965-3-git-send-email-stephen.neuendorffer@xilinx.com>

These values now match what is generated by the uboot BSP generator.

Signed-off-by: Stephen Neuendorffer <stephen.neuendorffer@xilinx.com>
---
 arch/powerpc/sysdev/xilinx_intc.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/arch/powerpc/sysdev/xilinx_intc.c b/arch/powerpc/sysdev/xilinx_intc.c
index c2f17cc..10345dd 100644
--- a/arch/powerpc/sysdev/xilinx_intc.c
+++ b/arch/powerpc/sysdev/xilinx_intc.c
@@ -135,10 +135,16 @@ void __init xilinx_intc_init_tree(void)
 	struct device_node *np;
 
 	/* find top level interrupt controller */
-	for_each_compatible_node(np, NULL, "xilinx,intc") {
+	for_each_compatible_node(np, NULL, "xlnx,opb-intc-1.00.c") {
 		if (!of_get_property(np, "interrupts", NULL))
 			break;
 	}
+        if(!np) {
+		for_each_compatible_node(np, NULL, "xlnx,xps-intc-1.00.a") {
+			if (!of_get_property(np, "interrupts", NULL))
+				break;
+		}
+        }
 
 	/* xilinx interrupt controller needs to be top level */
 	BUG_ON(!np);
-- 
1.5.3.4

^ permalink raw reply related

* [PATCH 5/7] [POWERPC] Xilinx: Update compatible to use values generated by BSP generator.
From: Stephen Neuendorffer @ 2007-12-13 23:43 UTC (permalink / raw)
  To: grant.likely, simekm2, jwilliams, linuxppc-dev
In-Reply-To: <1197589413-5965-4-git-send-email-stephen.neuendorffer@xilinx.com>

Mainly, this involves two changes:
1) xilinx->xlnx (recognized standard is to use the stock ticker)
2) In order to have the device tree focus on describing what the hardware is as exactly as possible, the compatible strings contain the full IP name and IP version.

Signed-off-by: Stephen Neuendorffer <stephen.neuendorffer@xilinx.com>
---
 arch/powerpc/platforms/40x/virtex.c |    2 +-
 drivers/block/xsysace.c             |    4 ++-
 drivers/serial/uartlite.c           |   42 +++++++++++++++++++++-------------
 drivers/video/xilinxfb.c            |    2 +-
 4 files changed, 31 insertions(+), 19 deletions(-)

diff --git a/arch/powerpc/platforms/40x/virtex.c b/arch/powerpc/platforms/40x/virtex.c
index 14bbc32..859ba1d 100644
--- a/arch/powerpc/platforms/40x/virtex.c
+++ b/arch/powerpc/platforms/40x/virtex.c
@@ -30,7 +30,7 @@ static int __init virtex_probe(void)
 {
 	unsigned long root = of_get_flat_dt_root();
 
-	if (!of_flat_dt_is_compatible(root, "xilinx,virtex"))
+	if (!of_flat_dt_is_compatible(root, "xlnx,virtex"))
 		return 0;
 
 	return 1;
diff --git a/drivers/block/xsysace.c b/drivers/block/xsysace.c
index 82effce..45bc51b 100644
--- a/drivers/block/xsysace.c
+++ b/drivers/block/xsysace.c
@@ -1208,7 +1208,9 @@ static int __devexit ace_of_remove(struct of_device *op)
 
 /* Match table for of_platform binding */
 static struct of_device_id __devinit ace_of_match[] = {
-	{ .compatible = "xilinx,xsysace", },
+	{ .compatible = "xlnx,opb-sysace-1.00.b", },
+	{ .compatible = "xlnx,opb-sysace-1.00.c", },
+	{ .compatible = "xlnx,xps-sysace-1.00.a", },
 	{},
 };
 MODULE_DEVICE_TABLE(of, ace_of_match);
diff --git a/drivers/serial/uartlite.c b/drivers/serial/uartlite.c
index 5ec42f3..6536cc7 100644
--- a/drivers/serial/uartlite.c
+++ b/drivers/serial/uartlite.c
@@ -21,8 +21,18 @@
 #include <linux/interrupt.h>
 #include <asm/io.h>
 #if defined(CONFIG_OF)
+#include <linux/of.h>
 #include <linux/of_device.h>
 #include <linux/of_platform.h>
+
+/* Match table for of_platform binding */
+static struct of_device_id __devinit ulite_of_match[] = {
+	{ .type = "serial", .compatible = "xlnx,opb-uartlite-1.00.b", },
+	{ .type = "serial", .compatible = "xlnx,xps-uartlite-1.00.a", },
+	{},
+};
+MODULE_DEVICE_TABLE(of, ulite_of_match);
+
 #endif
 
 #define ULITE_NAME		"ttyUL"
@@ -427,18 +437,25 @@ static inline u32 __init ulite_console_of_find_device(int id)
 	struct resource res;
 	const unsigned int *of_id;
 	int rc;
+        const struct of_device_id *matches = ulite_of_match;
+
+	while (matches->compatible[0]) {
+		for_each_compatible_node(np, NULL, matches->compatible) {
+			if (!of_match_node(matches, np))
+				continue;
 
-	for_each_compatible_node(np, NULL, "xilinx,uartlite") {
-		of_id = of_get_property(np, "port-number", NULL);
-		if ((!of_id) || (*of_id != id))
-			continue;
+			of_id = of_get_property(np, "port-number", NULL);
+			if ((!of_id) || (*of_id != id))
+				continue;
 
-		rc = of_address_to_resource(np, 0, &res);
-		if (rc)
-			continue;
+			rc = of_address_to_resource(np, 0, &res);
+			if (rc)
+				continue;
 
-		of_node_put(np);
-		return res.start+3;
+                        of_node_put(np);
+                        return res.start+3;
+		}
+		matches++;
 	}
 
 	return 0;
@@ -654,13 +671,6 @@ static int __devexit ulite_of_remove(struct of_device *op)
 	return ulite_release(&op->dev);
 }
 
-/* Match table for of_platform binding */
-static struct of_device_id __devinit ulite_of_match[] = {
-	{ .type = "serial", .compatible = "xilinx,uartlite", },
-	{},
-};
-MODULE_DEVICE_TABLE(of, ulite_of_match);
-
 static struct of_platform_driver ulite_of_driver = {
 	.owner = THIS_MODULE,
 	.name = "uartlite",
diff --git a/drivers/video/xilinxfb.c b/drivers/video/xilinxfb.c
index e38d3b7..9b426d3 100644
--- a/drivers/video/xilinxfb.c
+++ b/drivers/video/xilinxfb.c
@@ -460,7 +460,7 @@ static int __devexit xilinxfb_of_remove(struct of_device *op)
 
 /* Match table for of_platform binding */
 static struct of_device_id __devinit xilinxfb_of_match[] = {
-	{ .compatible = "xilinx,ml300-fb", },
+	{ .compatible = "xlnx,plb-tft-cntlr-ref-1.00.a", },
 	{},
 };
 MODULE_DEVICE_TABLE(of, xilinxfb_of_match);
-- 
1.5.3.4

^ permalink raw reply related

* [PATCH 7/7] [POWERPC] Xilinx: Update booting-without-of.
From: Stephen Neuendorffer @ 2007-12-13 23:43 UTC (permalink / raw)
  To: grant.likely, simekm2, jwilliams, linuxppc-dev
In-Reply-To: <1197589413-5965-6-git-send-email-stephen.neuendorffer@xilinx.com>

This now better describes what the UBoot device tree generator actually does.  In particular:

1) Nodes have a label derived from the device name, and a node name
derived from the device type.
2) Usage of compound nodes (representing more than one device in the same IP) which actually works.  This requires having a valid compatible node, and all the other things that a bus normally has.  I've chosen 'xlnx,compound' as the bus name to describe these compound nodes.
3) Uartlite requires a port-number property for the console to work.

In addition, I've clarified some of the language relating to how mhs
nodes should be represent in the device tree.
---
 Documentation/powerpc/booting-without-of.txt |   61 +++++++++++++++-----------
 1 files changed, 36 insertions(+), 25 deletions(-)

diff --git a/Documentation/powerpc/booting-without-of.txt b/Documentation/powerpc/booting-without-of.txt
index e9a3cb1..5e2b85a 100644
--- a/Documentation/powerpc/booting-without-of.txt
+++ b/Documentation/powerpc/booting-without-of.txt
@@ -2276,7 +2276,7 @@ platforms are moved over to use the flattened-device-tree model.
    properties of the device node.  In general, device nodes for IP-cores
    will take the following form:
 
-	(name)@(base-address) {
+	(name): (ip-core-name)@(base-address) {
 		compatible = "xlnx,(ip-core-name)-(HW_VER)"
 			     [, (list of compatible devices), ...];
 		reg = <(baseaddr) (size)>;
@@ -2294,9 +2294,9 @@ platforms are moved over to use the flattened-device-tree model.
 			dropped from the parameter name, the name is converted
 			to lowercase and all underscore '_' characters are
 			converted to dashes '-'.
-	(baseaddr):	the C_BASEADDR parameter.
+	(baseaddr):	the baseaddr parameter value (often named C_BASEADDR).
 	(HW_VER):	from the HW_VER parameter.
-	(size):		equals C_HIGHADDR - C_BASEADDR + 1
+	(size):		the address range size (often 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
@@ -2326,12 +2326,13 @@ platforms are moved over to use the flattened-device-tree model.
 
    becomes the following device tree node:
 
-	opb-uartlite-0@ec100000 {
+	opb_uartlite_0: serial@ec100000 {
 		device_type = "serial";
 		compatible = "xlnx,opb-uartlite-1.00.b";
 		reg = <ec100000 10000>;
-		interrupt-parent = <&opb-intc>;
+		interrupt-parent = <&opb_intc_0>;
 		interrupts = <1 0>; // got this from the opb_intc parameters
+		port-number = <0>;
 		current-speed = <d#115200>;	// standard serial device prop
 		clock-frequency = <d#50000000>;	// standard serial device prop
 		xlnx,data-bits = <8>;
@@ -2339,16 +2340,19 @@ platforms are moved over to use the flattened-device-tree model.
 		xlnx,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.
+   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.  In addition, the parent node should be
+   compatible with the bus type 'xlnx,compound', and should contain
+   #address-cells and #size-cells, as with any other bus.  (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
@@ -2370,21 +2374,24 @@ platforms are moved over to use the flattened-device-tree model.
 
    It would result in the following device tree nodes:
 
-	opb_ps2_dual_ref_0@a9000000 {
+	opb_ps2_dual_ref_0: opb-ps2-dual-ref@a9000000 {
+		#address-cells = <1>;
+		#size-cells = <1>;
+		compatible = "xlnx,compound";
 		ranges = <0 a9000000 2000>;
 		// If this device had extra parameters, then they would
 		// go here.
-		ps2@0 {
+		opb-ps2-dual-ref@0 {
 			compatible = "xlnx,opb-ps2-dual-ref-1.00.a";
 			reg = <0 40>;
-			interrupt-parent = <&opb-intc>;
+			interrupt-parent = <&opb_intc_0>;
 			interrupts = <3 0>;
 			cell-index = <0>;
 		};
-		ps2@1000 {
+		opb-ps2-dual-ref@1000 {
 			compatible = "xlnx,opb-ps2-dual-ref-1.00.a";
 			reg = <1000 40>;
-			interrupt-parent = <&opb-intc>;
+			interrupt-parent = <&opb_intc_0>;
 			interrupts = <3 0>;
 			cell-index = <0>;
 		};
@@ -2447,17 +2454,18 @@ platforms are moved over to use the flattened-device-tree model.
 
    Gives this device tree (some properties removed for clarity):
 
-	plb-v34-0 {
+	plb_v34 {
 		#address-cells = <1>;
 		#size-cells = <1>;
+		compatible = "xlnx,plb-v34-1.02.a";
 		device_type = "ibm,plb";
 		ranges; // 1:1 translation
 
-		plb-bram-if-cntrl-0@ffff0000 {
+		plb_bram_if_cntrl_0: plb-bram-if-cntrl@ffff0000 {
 			reg = <ffff0000 10000>;
 		}
 
-		opb-v20-0 {
+		opb_v20 {
 			#address-cells = <1>;
 			#size-cells = <1>;
 			ranges = <20000000 20000000 20000000
@@ -2465,11 +2473,11 @@ platforms are moved over to use the flattened-device-tree model.
 				  80000000 80000000 40000000
 				  c0000000 c0000000 20000000>;
 
-			opb-uart16550-0@a0000000 {
+			opb_uart16550_0: opb-uart16550@a0000000 {
 				reg = <a00000000 2000>;
 			};
 
-			opb-intc-0@d1000fc0 {
+			opb_intc_0: opb-intc@d1000fc0 {
 				reg = <d1000fc0 20>;
 			};
 		};
@@ -2513,6 +2521,9 @@ platforms are moved over to use the flattened-device-tree model.
 
       Requred properties:
        - current-speed : Baud rate of uartlite
+		Optional properties:
+       - port-number : unique ordinal index of the device. This
+         property is required for a console on uartlite.
 
    More devices will be defined as this spec matures.
 
-- 
1.5.3.4

^ permalink raw reply related

* Re: apm_emulation regression
From: Benjamin Herrenschmidt @ 2007-12-14  0:05 UTC (permalink / raw)
  To: Rafael J. Wysocki; +Cc: linuxppc-dev list, Johannes Berg, linux-pm, ralf
In-Reply-To: <1197590675.15741.195.camel@pasglop>


On Fri, 2007-12-14 at 11:04 +1100, Benjamin Herrenschmidt wrote:
> On Fri, 2007-12-14 at 01:10 +0100, Rafael J. Wysocki wrote:
> > 
> > Hmm.
> > 
> > I'm not that familiar with the APM emulation code, but the description
> > of the
> > problem above suggests that the APM emulation can install a suspend
> > notifier for this purpose.
> 
> It can use the new notifier that happens before freezing yes. Johannes,
> I think that's pretty much what my old powermac implementation did
> (using my private notifier scheme I had there), might be worth reviving
> that bit and sticking it into the generic apm_emu ...

Note that you may want to improve on it with a timeout in case userspace
doesn't ack...

Ben.

^ permalink raw reply

* Re: apm_emulation regression
From: Benjamin Herrenschmidt @ 2007-12-14  0:04 UTC (permalink / raw)
  To: Rafael J. Wysocki; +Cc: linuxppc-dev list, Johannes Berg, linux-pm, ralf
In-Reply-To: <200712140110.44406.rjw@sisk.pl>


On Fri, 2007-12-14 at 01:10 +0100, Rafael J. Wysocki wrote:
> 
> Hmm.
> 
> I'm not that familiar with the APM emulation code, but the description
> of the
> problem above suggests that the APM emulation can install a suspend
> notifier for this purpose.

It can use the new notifier that happens before freezing yes. Johannes,
I think that's pretty much what my old powermac implementation did
(using my private notifier scheme I had there), might be worth reviving
that bit and sticking it into the generic apm_emu ...

Ben.

^ permalink raw reply

* Re: [PATCH 2/7] [POWERPC] Xilinx: clear data caches.
From: Benjamin Herrenschmidt @ 2007-12-14  0:07 UTC (permalink / raw)
  To: Stephen Neuendorffer; +Cc: linuxppc-dev, simekm2
In-Reply-To: <20071213234240.F3CC3AD805D@mail122-sin.bigfish.com>


On Thu, 2007-12-13 at 15:43 -0800, Stephen Neuendorffer wrote:
> This code is needed to boot without a boot loader.
> 
> Grant:  I'm not sure where the right place to put this is.  I'm assuming we'll actually need some boot code that is not generic?  Also, note that there is a V4FX errata workaround in arch/ppc/boot/head.S, which probably also needs to get pulled to powerpc.
> 
> Signed-off-by: Stephen Neuendorffer <stephen.neuendorffer@xilinx.com>
> ---
>  arch/powerpc/boot/raw-platform.c |   22 ++++++++++++++++++++++
>  1 files changed, 22 insertions(+), 0 deletions(-)

This raw-platform.c file doesn't seem like a good place for code that is
totally platform specific ...

Ben.

> diff --git a/arch/powerpc/boot/raw-platform.c b/arch/powerpc/boot/raw-platform.c
> index b9caeee..2a5e493 100644
> --- a/arch/powerpc/boot/raw-platform.c
> +++ b/arch/powerpc/boot/raw-platform.c
> @@ -24,6 +24,28 @@ void platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
>                     unsigned long r6, unsigned long r7)
>  {
>  	u64 memsize64 = memsize[0];
> +	static const unsigned long line_size = 32;
> +	static const unsigned long congruence_classes = 256;
> +	unsigned long addr;
> +	unsigned long dccr;
> +
> +	/*
> +	 * Invalidate the data cache if the data cache is turned off.
> +	 * - The 405 core does not invalidate the data cache on power-up
> +	 *   or reset but does turn off the data cache. We cannot assume
> +	 *   that the cache contents are valid.
> +	 * - If the data cache is turned on this must have been done by
> +	 *   a bootloader and we assume that the cache contents are
> +	 *   valid.
> +	 */
> +	__asm__("mfdccr %0": "=r" (dccr));
> +	if (dccr == 0) {
> +		for (addr = 0;
> +		     addr < (congruence_classes * line_size);
> +		     addr += line_size) {
> +			__asm__("dccci 0,%0": :"b"(addr));
> +		}
> +	}
>  
>  	if (mem_size_cells == 2) {
>  		memsize64 <<= 32;

^ permalink raw reply

* Re: apm_emulation regression
From: Rafael J. Wysocki @ 2007-12-14  0:10 UTC (permalink / raw)
  To: Johannes Berg; +Cc: linux-pm, ralf, linuxppc-dev list
In-Reply-To: <1197482587.6558.145.camel@johannes.berg>

On Wednesday, 12 of December 2007, Johannes Berg wrote:
> 
> On Wed, 2007-12-12 at 13:45 +1100, Benjamin Herrenschmidt wrote:
> > I only just noticed a huge regression that was introduced when we moved
> > PowerPC to the generic APM emulation code instead of our own. I'm in
> > large part to blame since I acked the patch...
> > 
> > Basically, what we lost is the mechanism for notifying user applications
> > and waiting for their ACK before proceeding to system suspend. The new
> > generic code will still do that ... only when the actual suspend request
> > initiates from an APM suspend ioctl.
> 
> Indeed.
> 
> > For any other suspend (via our private PMU ioctl or via the sysfs
> > interface), userspace will -not- be notified.
> 
> Right.
> 
> > That basically means X will break. That's why X broke on the latest
> > ubuntu until I whacked some new scripts in them to force console
> > switching, among other things. Possibly other apps that relied
> > on /dev/apm_bios to be notified of system suspend/resume broke as well.
> 
> Ah. I guess I never noticed because I had the scripts to do console
> switching all along.
> 
> > Now the question is that is it still work trying to fix it ? That would
> > probably require APM emulation hooking at a fairly high level into the
> > generic PM code to trigger the signaling & waiting of processes before
> > freeze & device suspend among others...
> 
> Yeah, bit icky... but doable. Rafael, any ideas?

Hmm.

I'm not that familiar with the APM emulation code, but the description of the
problem above suggests that the APM emulation can install a suspend
notifier for this purpose.

Greetings,
Rafael

^ permalink raw reply

* Re: [PATCH 2/7] [POWERPC] Xilinx: clear data caches.
From: Benjamin Herrenschmidt @ 2007-12-14  0:09 UTC (permalink / raw)
  To: Stephen Neuendorffer; +Cc: linuxppc-dev, simekm2
In-Reply-To: <1197590848.15741.199.camel@pasglop>


On Fri, 2007-12-14 at 11:07 +1100, Benjamin Herrenschmidt wrote:
> On Thu, 2007-12-13 at 15:43 -0800, Stephen Neuendorffer wrote:
> > This code is needed to boot without a boot loader.
> > 
> > Grant:  I'm not sure where the right place to put this is.  I'm assuming we'll actually need some boot code that is not generic?  Also, note that there is a V4FX errata workaround in arch/ppc/boot/head.S, which probably also needs to get pulled to powerpc.
> > 
> > Signed-off-by: Stephen Neuendorffer <stephen.neuendorffer@xilinx.com>
> > ---
> >  arch/powerpc/boot/raw-platform.c |   22 ++++++++++++++++++++++
> >  1 files changed, 22 insertions(+), 0 deletions(-)
> 
> This raw-platform.c file doesn't seem like a good place for code that is
> totally platform specific ...

Maybe best is to do that in asm ? The problem when you are in C code is
that you may already have hit stale cache entries. "raw" platforms
probably need to perform various CPU-specific initializations anyway,
prior to entering C code, in a custom crt0.S, so that's probably the
best place to do the cache clearing.

Ben.

^ permalink raw reply

* How is a device tree used to specifiy flash?
From: Bruce_Leonard @ 2007-12-13 23:28 UTC (permalink / raw)
  To: linuxppc-embedded

Okay I just don't get it, but that's not a surprise.  I'm booting a 2.6.23 
kernel on an MPC8347 using u-boot 1.3.0.  I'm trying to use the device 
tree to spec my single Spansion/AMD NOR flash part and I can't get the 
kernel to recognize the part.  Or maybe I just don't know how to tell if 
the kernel is recognizing the part.  It's possible that everything is fine 
and I'm just to dumb to know it.

So I've got a Spansion S29GL128N flash part and the following entry in my 
device tree:

flash@ff000000 {
                compatible = "amd,s29g128n", "cfi-flash";
                reg = <ff000000 01000000>;
                bank-width = <2>;
                device-width = <1>;
                #address-cells = <1>;
                #size-cells = <1>;
                bit@200000 {
                        label = "bit";
                        reg = <200000 a0000>;
                };
                kernel@400000 {
                        label = "kernel";
                        reg = <400000 140000>;
                };
                blob@600000 {
                        label = "blob";
                        reg = <600000 20000>;
                };
                uboot@f00000 {
                        label = "uboot";
                        reg = <f00000 60000>;
                        read-only;
                };
        };

I've got the following in my .config for the kernel (I think this is all 
that's relavent but I'm not sure);


#
# Device Drivers
#

#
# Generic Driver Options
#
CONFIG_STANDALONE=y
CONFIG_PREVENT_FIRMWARE_BUILD=y
# CONFIG_FW_LOADER is not set
# CONFIG_DEBUG_DRIVER is not set
# CONFIG_DEBUG_DEVRES is not set
# CONFIG_SYS_HYPERVISOR is not set
# CONFIG_CONNECTOR is not set
CONFIG_MTD=y
CONFIG_MTD_DEBUG=y
CONFIG_MTD_DEBUG_VERBOSE=3
# CONFIG_MTD_CONCAT is not set
CONFIG_MTD_PARTITIONS=y
# CONFIG_MTD_REDBOOT_PARTS is not set
CONFIG_MTD_CMDLINE_PARTS=y

#
# User Modules And Translation Layers
#
CONFIG_MTD_CHAR=y
# CONFIG_MTD_BLKDEVS is not set
# CONFIG_MTD_BLOCK is not set
# CONFIG_MTD_BLOCK_RO is not set
# CONFIG_FTL is not set
# CONFIG_NFTL is not set
# CONFIG_INFTL is not set
# CONFIG_RFD_FTL is not set
# CONFIG_SSFDC is not set

#
# RAM/ROM/Flash chip drivers
#
CONFIG_MTD_CFI=y
# CONFIG_MTD_JEDECPROBE is not set
CONFIG_MTD_GEN_PROBE=y
# CONFIG_MTD_CFI_ADV_OPTIONS is not set
CONFIG_MTD_MAP_BANK_WIDTH_1=y
CONFIG_MTD_MAP_BANK_WIDTH_2=y
CONFIG_MTD_MAP_BANK_WIDTH_4=y
# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
CONFIG_MTD_CFI_I1=y
CONFIG_MTD_CFI_I2=y
# CONFIG_MTD_CFI_I4 is not set
# CONFIG_MTD_CFI_I8 is not set
# CONFIG_MTD_CFI_INTELEXT is not set
CONFIG_MTD_CFI_AMDSTD=y
# CONFIG_MTD_CFI_STAA is not set
CONFIG_MTD_CFI_UTIL=y
# CONFIG_MTD_RAM is not set
# CONFIG_MTD_ROM is not set
# CONFIG_MTD_ABSENT is not set

#
# Mapping drivers for chip access
#
# CONFIG_MTD_COMPLEX_MAPPINGS is not set
# CONFIG_MTD_PHYSMAP is not set
CONFIG_MTD_PHYSMAP_OF=y
# CONFIG_MTD_PLATRAM is not set

#
# Self-contained MTD device drivers
#
# CONFIG_MTD_PMC551 is not set
# CONFIG_MTD_SLRAM is not set
# CONFIG_MTD_PHRAM is not set
# CONFIG_MTD_MTDRAM is not set
# CONFIG_MTD_BLOCK2MTD is not set

#
# Disk-On-Chip Device Drivers
#
# CONFIG_MTD_DOC2000 is not set
# CONFIG_MTD_DOC2001 is not set
# CONFIG_MTD_DOC2001PLUS is not set
# CONFIG_MTD_NAND is not set
# CONFIG_MTD_ONENAND is not set

#
# UBI - Unsorted block images
#
# CONFIG_MTD_UBI is not set
CONFIG_OF_DEVICE=y
# CONFIG_PARPORT is not set
CONFIG_BLK_DEV=y
# CONFIG_BLK_DEV_FD is not set
# CONFIG_BLK_CPQ_DA is not set
# CONFIG_BLK_CPQ_CISS_DA is not set
# CONFIG_BLK_DEV_DAC960 is not set
# CONFIG_BLK_DEV_UMEM is not set
# CONFIG_BLK_DEV_COW_COMMON is not set
# CONFIG_BLK_DEV_LOOP is not set
CONFIG_BLK_DEV_NBD=y
# CONFIG_BLK_DEV_SX8 is not set
# CONFIG_BLK_DEV_UB is not set
# CONFIG_BLK_DEV_RAM is not set
# CONFIG_CDROM_PKTCDVD is not set
# CONFIG_ATA_OVER_ETH is not set
# CONFIG_MISC_DEVICES is not set
# CONFIG_IDE is not set

With this device tree and this .config the kernel never probes the flash 
part and 'cat /dev/mtd1' says the device doesn't exist.  If I then use 
Kconfig to specify the start of flash, the size of flash, and the bank 
width, dmesg shows that the part has been probed and 'cat /dev/mtd' spews 
out all sorts of stuff.

What black magic is there that doesn't showup in booting-without-of.txt 
that I'm missing?

Thanks for any feedback.

Bruce

^ permalink raw reply

* RE: [PATCH 2/7] [POWERPC] Xilinx: clear data caches.
From: Stephen Neuendorffer @ 2007-12-14  0:36 UTC (permalink / raw)
  To: benh; +Cc: linuxppc-dev, simekm2
In-Reply-To: <1197590981.15741.201.camel@pasglop>


Unfortunately, I think your right... The asm code seems so clean at the
moment, I don't really want be the one to start tarnishing it with a
bunch of little fixups.. :)

Steve

> -----Original Message-----
> From: Benjamin Herrenschmidt [mailto:benh@kernel.crashing.org]=20
> Sent: Thursday, December 13, 2007 4:10 PM
> To: Stephen Neuendorffer
> Cc: grant.likely@secretlab.ca; simekm2@fel.cvut.cz;=20
> jwilliams@itee.uq.edu.au; linuxppc-dev@ozlabs.org
> Subject: Re: [PATCH 2/7] [POWERPC] Xilinx: clear data caches.
>=20
>=20
> On Fri, 2007-12-14 at 11:07 +1100, Benjamin Herrenschmidt wrote:
> > On Thu, 2007-12-13 at 15:43 -0800, Stephen Neuendorffer wrote:
> > > This code is needed to boot without a boot loader.
> > >=20
> > > Grant:  I'm not sure where the right place to put this=20
> is.  I'm assuming we'll actually need some boot code that is=20
> not generic?  Also, note that there is a V4FX errata=20
> workaround in arch/ppc/boot/head.S, which probably also needs=20
> to get pulled to powerpc.
> > >=20
> > > Signed-off-by: Stephen Neuendorffer=20
> <stephen.neuendorffer@xilinx.com>
> > > ---
> > >  arch/powerpc/boot/raw-platform.c |   22 ++++++++++++++++++++++
> > >  1 files changed, 22 insertions(+), 0 deletions(-)
> >=20
> > This raw-platform.c file doesn't seem like a good place for=20
> code that is
> > totally platform specific ...
>=20
> Maybe best is to do that in asm ? The problem when you are in=20
> C code is
> that you may already have hit stale cache entries. "raw" platforms
> probably need to perform various CPU-specific initializations anyway,
> prior to entering C code, in a custom crt0.S, so that's probably the
> best place to do the cache clearing.
>=20
> Ben.
>=20
>=20
>=20

^ permalink raw reply

* Re: How is a device tree used to specifiy flash?
From: Josh Boyer @ 2007-12-14  1:57 UTC (permalink / raw)
  To: Bruce_Leonard; +Cc: linuxppc-embedded
In-Reply-To: <OFE841AC61.3D44C925-ON882573B0.007FA29F-882573B0.0080F67D@selinc.com>

On Thu, 13 Dec 2007 15:28:37 -0800
Bruce_Leonard@selinc.com wrote:

> Okay I just don't get it, but that's not a surprise.  I'm booting a 2.6.23 
> kernel on an MPC8347 using u-boot 1.3.0.  I'm trying to use the device 
> tree to spec my single Spansion/AMD NOR flash part and I can't get the 
> kernel to recognize the part.  Or maybe I just don't know how to tell if 
> the kernel is recognizing the part.  It's possible that everything is fine 
> and I'm just to dumb to know it.
> 
> So I've got a Spansion S29GL128N flash part and the following entry in my 
> device tree:
> 
> flash@ff000000 {

What bus is this node under in your DTS file?  Make sure that bus is
getting probed in the platform code.

josh

^ permalink raw reply

* Re: How is a device tree used to specifiy flash?
From: Bruce_Leonard @ 2007-12-14  2:27 UTC (permalink / raw)
  To: Josh Boyer; +Cc: linuxppc-embedded
In-Reply-To: <20071213195759.0de2a917@vader.jdub.homelinux.org>

> > 
> > flash@ff000000 {
> 
> What bus is this node under in your DTS file?  Make sure that bus is
> getting probed in the platform code.
> 

Well, I was starting to wonder about that.  This node isn't under any bus 
in the DTS file.  It's at the same level as the CPU node.  Does it need to 
be under a localbus node like the pq2fads.dts?  I've attached the entire 
DTS this time which may help.

Bruce

/ {
        model = "MPC8349EMITX";
        compatible = "MPC8349EMITX", "MPC834xMITX", "MPC83xxMITX";
        #address-cells = <1>;
        #size-cells = <1>;

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

                PowerPC,8349@0 {
                        device_type = "cpu";
                        reg = <0>;
                        d-cache-line-size = <20>;
                        i-cache-line-size = <20>;
                        d-cache-size = <8000>;
                        i-cache-size = <8000>;
                        timebase-frequency = <0>;       // from bootloader
                        bus-frequency = <0>;            // from bootloader
                        clock-frequency = <0>;          // from bootloader
                        32-bit;
                };
        };

        memory {
                device_type = "memory";
                reg = <00000000 20000000>;
        };

        flash@ff000000 {
                compatible = "amd,s29g128n", "cfi-flash";
                reg = <ff000000 01000000>;
                bank-width = <2>;
                device-width = <1>;
                #address-cells = <1>;
                #size-cells = <1>;
                bit@200000 {
                        label = "bit";
                        reg = <200000 a0000>;
                };
                kernel@400000 {
                        label = "kernel";
                        reg = <400000 140000>;
                };
                blob@600000 {
                        label = "blob";
                        reg = <600000 20000>;
                };
                uboot@f00000 {
                        label = "uboot";
                        reg = <f00000 60000>;
                        read-only;
                };
        };

        soc8349@e0000000 {
                #address-cells = <1>;
                #size-cells = <1>;
                #interrupt-cells = <2>;
                device_type = "soc";
                ranges = <0 e0000000 00100000>;
                reg = <e0000000 00000200>;
                bus-frequency = <0>;                    // from bootloader

                wdt@200 {
                        device_type = "watchdog";
                        compatible = "mpc83xx_wdt";
                        reg = <200 100>;
                };

                i2c@3000 {
                        device_type = "i2c";
                        compatible = "fsl-i2c";
                        reg = <3000 100>;
                        interrupts = <e 8>;
                        interrupt-parent = < &ipic >;
                        dfsrr;

                        rtc@68 {
                                #address-cells = <1>;
                                #size-cells = <0>;
                                device_type = "rtc";
                                compatible = "stm,m41t00";
                                reg = <68 8>;
                        };
                };

                i2c@3100 {
                        device_type = "i2c";
                        compatible = "fsl-i2c";
                        reg = <3100 100>;
                        interrupts = <f 8>;
                        interrupt-parent = < &ipic >;
                        dfsrr;
                };

                spi@7000 {
                        device_type = "spi";
                        compatible = "mpc83xx_spi";
                        reg = <7000 1000>;
                        interrupts = <10 8>;
                        interrupt-parent = < &ipic >;
                        mode = <0>;
                };

                usb@22000 {
                        device_type = "usb";
                        compatible = "fsl-usb2-mph";
                        reg = <22000 1000>;
                        #address-cells = <1>;
                        #size-cells = <0>;
                        interrupt-parent = < &ipic >;
                        interrupts = <27 8>;
                        phy_type = "ulpi";
//                      port1;
                        port0;
                };

//              usb@23000 {
//                      device_type = "usb";
//                      compatible = "fsl-usb2-dr";
//                      reg = <23000 1000>;
//                      #address-cells = <1>;
//                      #size-cells = <0>;
//                      interrupt-parent = < &ipic >;
//                      interrupts = <26 8>;
//                      phy_type = "ulpi";
//              };

                mdio@24520 {
                        device_type = "mdio";
                        compatible = "gianfar";
                        reg = <24520 20>;
                        #address-cells = <1>;
                        #size-cells = <0>;

                        /* Vitesse 8201 */
                        phy0: ethernet-phy@1c {
                                interrupt-parent = < &ipic >;
                                interrupts = <12 8>;
                                reg = <0>;
                                device_type = "ethernet-phy";
                        };

                        /* Vitesse 7385 */
                        phy1: ethernet-phy@1f {
                                interrupt-parent = < &ipic >;
                                interrupts = <12 8>;
                                reg = <1>;
                                device_type = "ethernet-phy";
                        };
                };

                ethernet@24000 {
                        device_type = "network";
                        model = "TSEC";
                        compatible = "gianfar";
                        reg = <24000 1000>;
                        address = [ 00 00 00 00 00 00 ];
                        local-mac-address = [ 00 00 00 00 00 00 ];
                        interrupts = <20 8 21 8 22 8>;
                        interrupt-parent = < &ipic >;
                        phy-handle = < &phy0 >;
                };

                ethernet@25000 {
                        #address-cells = <1>;
                        #size-cells = <0>;
                        device_type = "network";
                        model = "TSEC";
                        compatible = "gianfar";
                        reg = <25000 1000>;
                        address = [ 00 00 00 00 00 00 ];
                        local-mac-address = [ 00 00 00 00 00 00 ];
                        interrupts = <23 8 24 8 25 8>;
                        interrupt-parent = < &ipic >;
                        phy-handle = < &phy1 >;
                };

                serial@4500 {
                        device_type = "serial";
                        compatible = "ns16550";
                        reg = <4500 100>;
                        clock-frequency = <0>;          // from bootloader
                        interrupts = <9 8>;
                        interrupt-parent = < &ipic >;
                };

                serial@4600 {
                        device_type = "serial";
                        compatible = "ns16550";
                        reg = <4600 100>;
                        clock-frequency = <0>;          // from bootloader
                        interrupts = <a 8>;
                        interrupt-parent = < &ipic >;
                };

                pci@8500 {
                        interrupt-map-mask = <f800 0 0 7>;
                        interrupt-map = <
                                        // IDSEL 0x12 - FPGA
                                        9000 0 0 1 &ipic 15 8 // INTA - 
UARTS
                                        9000 0 0 2 &ipic 16 8 // INTB - 
IRIG

                                        // IDSEL 0x13 - PCI Enet
                                        9800 0 0 1 &ipic 14 8 // INTA

                                        // IDSEL 0x14 - PCI104 Slot 1
                                        a000 0 0 1 &ipic 12 8 // INTA
                                        a000 0 0 2 &ipic 13 8 // INTB
                                        a000 0 0 3 &ipic 15 8 // INTC
                                        a000 0 0 4 &ipic 16 8 // INTD

                                        // IDSEL 0x15 - PCI104 Slot 2
                                        a800 0 0 1 &ipic 13 8 // INTA
                                        a800 0 0 2 &ipic 15 8 // INTB
                                        a800 0 0 3 &ipic 16 8 // INTC
                                        a800 0 0 4 &ipic 12 8 // INTD

                                        // IDSEL 0x16 - PCI104 Slot 3
                                        b000 0 0 1 &ipic 15 8 // INTA
                                        b000 0 0 2 &ipic 16 8 // INTB
                                        b000 0 0 3 &ipic 12 8 // INTC
                                        b000 0 0 4 &ipic 13 8 // INTD
                                        >;
                        interrupt-parent = < &ipic >;
                        interrupts = <42 8>;
                        bus-range = <0 0>;
                        ranges = <42000000 0 80000000 80000000 0 10000000
                                  02000000 0 90000000 90000000 0 08000000
                                  01000000 0 98000000 98000000 0 
08000000>;
                        clock-frequency = <1f78a40>;
                        #interrupt-cells = <1>;
                        #size-cells = <2>;
                        #address-cells = <3>;
                        reg = <8500 100>;
                        compatible = "83xx";
                        device_type = "pci";
                };

                crypto@30000 {
                        device_type = "crypto";
                        model = "SEC2";
                        compatible = "talitos";
                        reg = <30000 10000>;
                        interrupts = <b 8>;
                        interrupt-parent = < &ipic >;
                        num-channels = <4>;
                        channel-fifo-len = <18>;
                        exec-units-mask = <0000007e>;
                        descriptor-types-mask = <01010ebf>;
                };

                ipic: pic@700 {
                        interrupt-controller;
                        #address-cells = <0>;
                        #interrupt-cells = <2>;
                        reg = <700 100>;
                        built-in;
                        device_type = "ipic";
                };
        };
};

^ permalink raw reply

* Re: How is a device tree used to specifiy flash?
From: Jon Smirl @ 2007-12-14  2:28 UTC (permalink / raw)
  To: Bruce_Leonard@selinc.com; +Cc: linuxppc-embedded
In-Reply-To: <OFE841AC61.3D44C925-ON882573B0.007FA29F-882573B0.0080F67D@selinc.com>

To get this working on the mpc5200 I had to add the localbus node
above the flash.

	lpb@ff000000 {
		compatible = "fsl,lpb";
		ranges = <0 ff000000 01000000>;
		
		flash@00000000 {
			compatible = "cfi-flash";
			reg = <00000000 01000000>;
			bank-width = <2>;
			#size-cells = <1>;
			#address-cells = <1>;
			partition@0 {
				label = "ubootl";
				reg = <00000000 00040000>;
			};
			partition@40000 {
				label = "kernel";
				reg = <00040000 001c0000>;
			};
			partition@200000 {
				label = "jffs2";
				reg = <00200000 00D00000>;
			};
			partition@f00000 {
				label = "uboot";
				reg = <00f00000 00040000>;
			};
			partition@f40000 {
				label = "oftree";
				reg = <00f40000 00040000>;
			};
			partition@f80000 {
				label = "space";
				reg = <00f80000 00080000>;
			};
		};
	};


-- 
Jon Smirl
jonsmirl@gmail.com

^ permalink raw reply

* Re: How is a device tree used to specifiy flash?
From: Bruce_Leonard @ 2007-12-14  2:48 UTC (permalink / raw)
  To: Jon Smirl; +Cc: linuxppc-embedded
In-Reply-To: <9e4733910712131828v532e6aaep316c72e14d92c921@mail.gmail.com>

"Jon Smirl" <jonsmirl@gmail.com> wrote on 12/13/2007 06:28:28 PM:

> To get this working on the mpc5200 I had to add the localbus node
> above the flash.
> 
>    lpb@ff000000 {
>       compatible = "fsl,lpb";
>       ranges = <0 ff000000 01000000>;
> 

Thanks.  I'll give it a try.  Do you know if the "fsl,lpb" compaibility 
extends to the 83xx code?

Bruce

^ permalink raw reply

* Re: [PATCH] ipic: ack only for edge interrupts
From: Kumar Gala @ 2007-12-14  4:29 UTC (permalink / raw)
  To: Li Yang; +Cc: linuxppc-dev
In-Reply-To: <1196766100-7411-1-git-send-email-leoli@freescale.com>


On Dec 4, 2007, at 5:01 AM, Li Yang wrote:

> Only external interrupts in edge detect mode support ack operation.
> Therefore, in most cases ack is not needed.  The patch makes ipic
> ack only when it's needed.  This could boost over all system  
> performance.
>
> Signed-off-by: Li Yang <leoli@freescale.com>
> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> ---
> Update to use different irq_chip for level and edge interrupts as Ben
> suggested.
> Supercedes [PATCH] ipic: change ack operation that register is  
> accessed
> only when needed
>
> arch/powerpc/sysdev/ipic.c |  113 ++++++++++++++++ 
> +---------------------------
> arch/powerpc/sysdev/ipic.h |    6 +--
> 2 files changed, 45 insertions(+), 74 deletions(-)

applied.

- k

^ permalink raw reply


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox