LinuxPPC-Dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* Re: zImage.elf loads but does not start
From: Adrian Craine @ 2007-05-08 21:50 UTC (permalink / raw)
  To: Leonid; +Cc: linuxppc-embedded, Mirek23
In-Reply-To: <406A31B117F2734987636D6CCC93EE3C017019FD@ehost011-3.exch011.intermedia.net>

Leonid wrote:
> rootpath=
> [    9.130834] Looking up port of RPC 100003/2 on 129.129.130.106
> [    9.207363] Looking up port of RPC 100005/1 on 129.129.130.106
> [    9.303794] VFS: Mounted root (nfs filesystem).
> [    9.359316] Freeing unused kernel memory: 96k init
> [    9.422162] Warning: unable to open an initial console.
>
>   
The exact device node this requires is /dev/console c 5 1
That should solve your issue.

Cheers,
             Adrian.

^ permalink raw reply

* Re: [PATCH] TurboStation support (Properly)
From: Øyvind Repvik @ 2007-05-08 21:56 UTC (permalink / raw)
  To: linuxppc-embedded
In-Reply-To: <200705061446.05491.repvik@kynisk.com>

On Sunday 06 May 2007 14:46:05 =D8yvind Repvik wrote:
> Hi,
>=20
> 	This patch adds support for the QNAP TurboStation TS-101 and TS-201 devi=
ces.=20

Of course, it probably helps if my mail client doesn't break the patch comp=
letely.

=20
Signed-off-by: =D8yvind Repvik <nail@nslu2-linux.org>=20
Signed-off-by: Alessandro Zummo <a.zummo@towertech.it>

=2D-- linux-2.6.21.1/arch/powerpc/boot/dts/qnap-ts101.dts	1970-01-01 01:00:=
00.000000000 +0100
+++ linux-2.6.21.1.ts/arch/powerpc/boot/dts/qnap-ts101.dts	2007-05-03 22:44=
:59.000000000 +0200
@@ -0,0 +1,166 @@
+/*
+ * Device Tree Souce for QNAP Turbostation 101/201
+ *
+ * Choose CONFIG_TURBOSTATION to build a kernel for turbostation
+ *=20
+ *
+ * Based on kuroboxHD.dts by G. Liakhovetski
+ *
+ * 2007 (c) Oyvind Repvik <nail@nslu2-linux.org>
+ *
+ * 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.
+ *
+ * build with: "dtc -f -I dts -O dtb -o qnap-ts101.dtb -V 16 qnap-ts101.dt=
s"
+ *
+ *
+ */
+
+/ {
+	linux,phandle =3D <1000>;
+	model =3D "TurboStation TSx01";
+	compatible =3D "turbostation";
+	#address-cells =3D <1>;
+	#size-cells =3D <1>;
+
+	cpus {
+		linux,phandle =3D <2000>;
+		#cpus =3D <1>;
+		#address-cells =3D <1>;
+		#size-cells =3D <0>;
+
+		PowerPC,603e { /* Really 8241 */
+			linux,phandle =3D <2100>;
+			device_type =3D "cpu";
+			reg =3D <0>;
+			clock-frequency =3D <fdad680>;	/* 266 MHz */
+			timebase-frequency =3D <1fca055>;	/* 33.3333333 MHz */
+			bus-frequency =3D <0>;
+			/* Following required by dtc but not used */
+			i-cache-line-size =3D <0>;
+			d-cache-line-size =3D <0>;
+			i-cache-size =3D <4000>;
+			d-cache-size =3D <4000>;
+		};
+	};
+
+	/* 64MB @ 0x0 */
+	memory {
+		linux,phandle =3D <3000>;
+		device_type =3D "memory";
+		reg =3D <00000000 04000000>;
+	};
+
+	flash@ff000000 {
+		linux,phandle =3D <3100>;
+		device_type =3D "rom";
+		compatible =3D "direct-mapped";
+		probe-type =3D "CFI";
+		reg =3D <ff000000 01000000>;
+		bank-width =3D <1>;
+		partitions =3D <
+				00000000 00200000
+				00200000 00d00000
+				00f00000 00040001
+				00f40000 00020000
+				00f60000 00040000
+				00fa0000 00020000
+				00fc0000 00040000
+		>;
+		partition-names =3D "kernel\0rootfs\0uboot1\0uboot1-env\0uboot2\0uboot2-=
env\0SysConf";
+	};
+
+
+	soc10x { /* AFAICT need to make soc for 8245's uarts to be defined */
+		linux,phandle =3D <4000>;
+		#address-cells =3D <1>;
+		#size-cells =3D <1>;
+		#interrupt-cells =3D <2>;
+		device_type =3D "soc";
+		compatible =3D "mpc10x";
+		store-gathering =3D <0>; /* 0 =3D=3D off, !0 =3D=3D on */
+		reg =3D <80000000 00100000>;
+		ranges =3D <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@fc003000 {
+			linux,phandle =3D <4300>;
+			device_type =3D "i2c";
+			compatible =3D "fsl-i2c";
+			reg =3D <fc003000 1000>;
+			interrupts =3D <5 2>;
+			interrupt-parent =3D <4400>;
+		};
+
+		serial@fc004500 {
+			linux,phandle =3D <4511>;
+			device_type =3D "serial";
+			compatible =3D "ns16550";
+			reg =3D <fc004500 8>;
+			clock-frequency =3D <7ed6b40>;	/* 133 MHz */
+			current-speed =3D <1c200>;	/* 115200 */
+			interrupts =3D <9 2>;
+			interrupt-parent =3D <4400>;
+		};
+
+		serial@fc004600 {
+			linux,phandle =3D <4512>;
+			device_type =3D "serial";
+			compatible =3D "ns16550";
+			reg =3D <fc004600 8>;
+			clock-frequency =3D <7ed6b40>;
+			current-speed =3D <4b00>;		/* 19200 */
+			interrupts =3D <a 2>;
+			interrupt-parent =3D <4400>;
+		};
+
+		pic@fc040000 {
+			linux,phandle =3D <4400>;
+			#interrupt-cells =3D <2>;
+			#address-cells =3D <0>;
+			device_type =3D "open-pic";
+			compatible =3D "chrp,open-pic";
+			interrupt-controller;
+			reg =3D <fc040000 40000>;
+			built-in;
+		};
+
+		pci@fe800000 {
+			linux,phandle =3D <4500>;
+			#address-cells =3D <3>;
+			#size-cells =3D <2>;
+			#interrupt-cells =3D <1>;
+			device_type =3D "pci";
+			compatible =3D "mpc10x-pci";
+			reg =3D <fc000000 400000>;
+			ranges =3D <01000000 0        0 fe000000 0 00c00000
+				  02000000 0 80000000 80000000 0 70000000>;
+			bus-range =3D <0 ff>;
+			clock-frequency =3D <7ed6b40>;	/* 133 MHz */
+			interrupt-parent =3D <4400>;
+			interrupt-map-mask =3D <f800 0 0 7>;
+			interrupt-map =3D <
+				/* IDSEL 0x13 - SATA*/
+				6800 0 0 1 4400 0 1
+				6800 0 0 2 4400 0 1
+				6800 0 0 3 4400 0 1
+				6800 0 0 4 4400 0 1
+				/* IDSEL 0x14 - USB */
+				7000 0 0 1 4400 1 1
+				7000 0 0 2 4400 1 1
+				7000 0 0 3 4400 1 1
+				7000 0 0 4 4400 1 1
+				/* IDSEL 0x15 - ETH */
+				7800 0 0 1 4400 2 1
+				7800 0 0 2 4400 2 1
+				7800 0 0 3 4400 2 1
+				7800 0 0 4 4400 2 1
+			>;
+		};
+	};
+};
Binary files linux-2.6.21.1/arch/powerpc/boot/dts/storcenter.dtb and linux-=
2.6.21.1.ts/arch/powerpc/boot/dts/storcenter.dtb differ
=2D-- linux-2.6.21.1/arch/powerpc/platforms/embedded6xx/Kconfig	2007-04-27 =
23:49:26.000000000 +0200
+++ linux-2.6.21.1.ts/arch/powerpc/platforms/embedded6xx/Kconfig	2007-05-06=
 14:31:55.000000000 +0200
@@ -87,6 +87,13 @@
 	  Linkstation-I HD-HLAN and HD-HGLAN versions, and PPC-based
 	  Terastation systems should be supported too.
=20
+config TURBOSTATION
+	bool "QNap TS-101/TS-102 TurboStation"
+	select MPIC
+	select FSL_SOC
+	select PPC_UDBG_16550 if SERIAL_8250
+	select DEFAULT_UIMAGE
+
 config MPC7448HPC2
 	bool "Freescale MPC7448HPC2(Taiga)"
 	select TSI108_BRIDGE
@@ -200,7 +207,7 @@
 	depends on SANDPOINT || SPRUCE || PPLUS || \
 		PRPMC750 || PRPMC800 || LOPEC || \
 		(EV64260 && !SERIAL_MPSC) || CHESTNUT || RADSTONE_PPC7D || \
=2D		83xx || LINKSTATION
+		83xx || LINKSTATION || TURBOSTATION=20
 	default y
=20
 config FORCE
@@ -274,13 +281,15 @@
=20
 config MPC10X_BRIDGE
 	bool
=2D	depends on POWERPMC250 || LOPEC || SANDPOINT || LINKSTATION
+	depends on POWERPMC250 || LOPEC || SANDPOINT || LINKSTATION || \
+	TURBOSTATION=20
 	select PPC_INDIRECT_PCI
 	default y
=20
 config MPC10X_OPENPIC
 	bool
=2D	depends on POWERPMC250 || LOPEC || SANDPOINT || LINKSTATION
+	depends on POWERPMC250 || LOPEC || SANDPOINT || LINKSTATION || \
+	TURBOSTATION=20
 	default y
=20
 config MPC10X_STORE_GATHERING
=2D-- linux-2.6.21.1/arch/powerpc/platforms/embedded6xx/Makefile	2007-04-27=
 23:49:26.000000000 +0200
+++ linux-2.6.21.1.ts/arch/powerpc/platforms/embedded6xx/Makefile	2007-05-0=
6 14:30:58.000000000 +0200
@@ -3,3 +3,4 @@
 #
 obj-$(CONFIG_MPC7448HPC2)	+=3D mpc7448_hpc2.o
 obj-$(CONFIG_LINKSTATION)	+=3D linkstation.o ls_uart.o
+obj-$(CONFIG_TURBOSTATION)	+=3D turbostation.o
=2D-- linux-2.6.21.1/arch/powerpc/platforms/embedded6xx/turbostation.c	1970=
=2D01-01 01:00:00.000000000 +0100
+++ linux-2.6.21.1.ts/arch/powerpc/platforms/embedded6xx/turbostation.c	200=
7-05-03 22:45:03.000000000 +0200
@@ -0,0 +1,141 @@
+/*
+ * Board setup routines for the QNAP Turbostation platform (TS-101/TS-201)
+ *
+ * Copyright (C) 2007 Oyvind Repvik (nail@nslu2-linux.org)
+ *
+ * Based on linkstation.c by G. Liakhovetski
+ *
+ * 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.
+ */
+
+#include <linux/kernel.h>
+#include <linux/pci.h>
+#include <linux/initrd.h>
+#include <linux/mtd/physmap.h>
+
+#include <asm/time.h>
+#include <asm/prom.h>
+#include <asm/mpic.h>
+#include <asm/mpc10x.h>
+#include <asm/pci-bridge.h>
+
+static int __init add_bridge(struct device_node *dev)
+{
+	int len;
+	struct pci_controller *hose;
+	int *bus_range;
+
+	printk("Adding PCI host bridge %s\n", dev->full_name);
+
+	bus_range =3D (int *) get_property(dev, "bus-range", &len);
+	if (bus_range =3D=3D NULL || len < 2 * sizeof(int))
+		printk(KERN_WARNING "Can't get bus-range for %s, assume"
+				" bus 0\n", dev->full_name);
+
+	hose =3D pcibios_alloc_controller();
+	if (hose =3D=3D NULL)
+		return -ENOMEM;
+	hose->first_busno =3D bus_range ? bus_range[0] : 0;
+	hose->last_busno =3D bus_range ? bus_range[1] : 0xff;
+	hose->arch_data =3D dev;
+	setup_indirect_pci(hose, 0xfec00000, 0xfee00000);
+
+	/* Interpret the "ranges" property */
+	/* This also maps the I/O region and sets isa_io/mem_base */
+	pci_process_bridge_OF_ranges(hose, dev, 1);
+
+	return 0;
+}
+
+static void __init turbostation_setup_arch(void)
+{
+	struct device_node *np;
+
+	/* Lookup PCI host bridges */
+	for (np =3D NULL; (np =3D of_find_node_by_type(np, "pci")) !=3D NULL;)
+		add_bridge(np);
+
+	printk(KERN_INFO "QNAP Turbostation series\n");
+}
+
+/*
+ * Interrupt setup and service.  Interrrupts on the turbostation come
+ * from the four PCI slots plus onboard 8241 devices: I2C, DUART.
+ */
+static void __init turbostation_init_IRQ(void)
+{
+	struct mpic *mpic;
+	struct device_node *dnp;
+	void *prop;
+	int size;
+	phys_addr_t paddr;
+
+	dnp =3D of_find_node_by_type(NULL, "open-pic");
+	if (dnp =3D=3D NULL)
+		return;
+
+	prop =3D (struct device_node *)get_property(dnp, "reg", &size);
+	paddr =3D (phys_addr_t)of_translate_address(dnp, prop);
+
+	mpic =3D mpic_alloc(dnp, paddr, MPIC_PRIMARY | MPIC_WANTS_RESET,
+			4, 32, " EPIC     ");
+	BUG_ON(mpic =3D=3D NULL);
+
+	/* PCI IRQs */
+	mpic_assign_isu(mpic, 0, paddr + 0x10200);
+
+	/* I2C */
+	mpic_assign_isu(mpic, 1, paddr + 0x11000);
+
+	/* ttyS0, ttyS1 */
+	mpic_assign_isu(mpic, 2, paddr + 0x11100);
+
+	mpic_init(mpic);
+}
+
+static void turbostation_restart(char *cmd)
+{
+	/* Insert restart-stuff */
+}
+
+static void turbostation_power_off(void)
+{
+	/* Insert powerdown-stuff */
+}
+
+static void turbostation_halt(void)
+{
+	turbostation_power_off();
+}
+
+static void turbostation_show_cpuinfo(struct seq_file *m)
+{
+	seq_printf(m, "vendor\t\t: QNAP Systems Inc.\n");
+	seq_printf(m, "machine\t\t: Turbostation TS-101/TS-201\n");
+}
+
+static int __init turbostation_probe(void)
+{
+	unsigned long root;
+
+	root =3D of_get_flat_dt_root();
+
+	if (!of_flat_dt_is_compatible(root, "turbostation"))
+		return 0;
+	return 1;
+}
+
+define_machine(turbostation){
+	.name 			=3D "QNAP Turbostation",
+	.probe 			=3D turbostation_probe,
+	.setup_arch 		=3D turbostation_setup_arch,
+	.init_IRQ 		=3D turbostation_init_IRQ,
+	.show_cpuinfo 		=3D turbostation_show_cpuinfo,
+	.get_irq 		=3D mpic_get_irq,
+	.restart 		=3D turbostation_restart,
+	.power_off 		=3D turbostation_power_off,
+	.halt	 		=3D turbostation_halt,
+	.calibrate_decr 	=3D generic_calibrate_decr,
+};

^ permalink raw reply

* RE: zImage.elf loads but does not start
From: Leonid @ 2007-05-08 21:46 UTC (permalink / raw)
  To: Mirek23, linuxppc-embedded
In-Reply-To: <10372619.post@talk.nabble.com>

Read this
http://www.denx.de/wiki/view/DULG/ELDKMountingTargetComponentsViaNFS.

-----Original Message-----
From: linuxppc-embedded-bounces+leonid=3Da-k-a.net@ozlabs.org
[mailto:linuxppc-embedded-bounces+leonid=3Da-k-a.net@ozlabs.org] On =
Behalf
Of Mirek23
Sent: Tuesday, May 08, 2007 2:46 AM
To: linuxppc-embedded@ozlabs.org
Subject: Re: zImage.elf loads but does not start


Thank you Andrei for your hint. I have hard-coded the mac address in the

arch/ppc/boot/simple/embed_config.c. Maybe it is not the most elegant
solution but it works.

Right now I was able to mount the root file system via nfs but it seems
to
be still somthing missing:

[    0.000000] Kernel command line: console=3DttyUL0,9600 =
root=3D/dev/nfs rw
nfsroot
=3D129.129.130.106:/opt/eldk41/ppc_4xx,tcp macaddr=3D00:50:c2:46:d8:01
ip=3D129.129.10
7.50:129.129.130.106:129.129.107.1:255.255.255.0:ml403-mirek:eth0:off
panic=3D1
[    0.000000] Xilinx INTC #0 at 0x41200000 mapped to 0xFDFFF000
[    0.000000] PID hash table entries: 256 (order: 8, 1024 bytes)
[    0.000424] Console: colour dummy device 80x25
[    0.001483] Dentry cache hash table entries: 8192 (order: 3, 32768
bytes)
[    0.003209] Inode-cache hash table entries: 4096 (order: 2, 16384
bytes)
[    0.034369] Memory: 62720k available (1572k kernel code, 508k data,
96k
init,
 0k highmem)
[    0.121167] Mount-cache hash table entries: 512
[    0.129517] NET: Registered protocol family 16
[    0.166530] NET: Registered protocol family 2
[    0.204693] IP route cache hash table entries: 1024 (order: 0, 4096
bytes)
[    0.205867] TCP established hash table entries: 2048 (order: 2, 16384
bytes)
[    0.206574] TCP bind hash table entries: 2048 (order: 1, 8192 bytes)
[    0.207009] TCP: Hash tables configured (established 2048 bind 2048)
.
.
.
[    2.670863] XTemac: using FIFO direct interrupt driven mode.
[    2.739134] eth%d: XTemac: PHY detected at address 3.
[    2.802585] eth0: Xilinx TEMAC #0 at 0x81200000 mapped to 0xC5040000,
irq=3D1
[    2.886290] eth0: XTemac id 1.0f, block id 5, type 8
[    2.947439] mice: PS/2 mouse device common for all mice
[    3.010300] TCP cubic registered
[    3.049323] NET: Registered protocol family 1
[    3.101718] NET: Registered protocol family 17
[    3.661970] eth0: XTemac: Options: 0xb8f2
[    7.693861] eth0: XTemac: We renegotiated the speed to: 100
[    7.760541] eth0: XTemac: speed set to 100Mb/s
[    8.830367] IP-Config: Complete:
[    8.867105]       device=3Deth0, addr=3D129.129.107.50,
mask=3D255.255.255.0,
gw=3D129.129.107.1,
[    8.964390]      host=3Dml403-mirek, domain=3D, nis-domain=3D(none),
[    9.034414]      bootserver=3D129.129.130.106,
rootserver=3D129.129.130.106,
rootpath=3D
[    9.130834] Looking up port of RPC 100003/2 on 129.129.130.106
[    9.207363] Looking up port of RPC 100005/1 on 129.129.130.106
[    9.303794] VFS: Mounted root (nfs filesystem).
[    9.359316] Freeing unused kernel memory: 96k init
[    9.422162] Warning: unable to open an initial console.


To satisfy last problem "unable to open an initial console" I have
created
an entry in the /opt/eldk41/ppc_4xx/dev directory:

mknod ttyUL0 c 204 187
ln -s ttyUL0 console

I have rebooted the kernel once again and this time kernel has reached
the
point as listed below.:
 [    8.964390]      host=3Dml403-mirek, domain=3D, nis-domain=3D(none),
[    9.034414]      bootserver=3D129.129.130.106,
rootserver=3D129.129.130.106,
rootpath=3D
[    9.130834] Looking up port of RPC 100003/2 on 129.129.130.106
[    9.207363] Looking up port of RPC 100005/1 on 129.129.130.106
[    9.303794] VFS: Mounted root (nfs filesystem).
[    9.359316] Freeing unused kernel memory: 96k init

I do not know if the console was taken into account or not (the warning
has
disapeared but I am not able to ping
to my board nor telnet to it).

Any idea what could be wrong?

I use the root file system from eldk4.1:
/opt/eldk41/ppc_4xx/etc/inittab:
------------------------------------------------------------------------
-------------------------------
id:3:initdefault:

# System initialization.
si::sysinit:/etc/rc.d/rc.sysinit

l0:0:wait:/etc/rc.d/rc 0
l1:1:wait:/etc/rc.d/rc 1
l2:2:wait:/etc/rc.d/rc 2
l3:3:wait:/etc/rc.d/rc 3
l4:4:wait:/etc/rc.d/rc 4
l5:5:wait:/etc/rc.d/rc 5
l6:6:wait:/etc/rc.d/rc 6

# Trap CTRL-ALT-DELETE
ca::ctrlaltdel:/sbin/shutdown -t3 -r now

# UPS connected and working correctly. =20
pf::powerfail:/sbin/shutdown -f -h +2 "Power Failure; System Shutting
Down"

# If power was restored before the shutdown kicked in, cancel it.
pr:12345:powerokwait:/sbin/shutdown -c "Power Restored; Shutdown
Cancelled"

# Run gettys in standard runlevels
3:2345:respawn:/sbin/mingetty --noclear console
------------------------------------------------------------------------
-----------------------------------------------------------------
The contents of the /opt/eldk41/ppc_4xx/etc/rc3.d/ is as following:

K15appWeb                K80random         S12syslog     =20
_S30mouse-emulation
K70mouse-emulation  K90network        _S20random    S56xinetd
K75netfs                      S10network        S25netfs
S99local
--=20
View this message in context:
http://www.nabble.com/zImage.elf-loads-but-not-starts-tf3607582.html#a10
372619
Sent from the linuxppc-embedded mailing list archive at Nabble.com.

_______________________________________________
Linuxppc-embedded mailing list
Linuxppc-embedded@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-embedded

^ permalink raw reply

* Re: [PATCH 1/3] [POWERPC] 8xx: mpc885ads pcmcia support
From: Vitaly Bordug @ 2007-05-08 21:19 UTC (permalink / raw)
  To: Kumar Gala; +Cc: linuxppc-dev, linux-pcmcia, linux-kernel
In-Reply-To: <774F0168-051E-4C6B-9292-8EE731E6D889@kernel.crashing.org>

On Tue, 8 May 2007 09:04:22 -0500
Kumar Gala wrote:

> > +			device_type = "pcmcia";
> > +			reg = <80 80>;
> > +			clock-frequency = <2faf080>;  
> 
> is the clock-freq fixed?
As I see now, that field is not really required as never extracted or used. The intention was to
use dts value iirc, later it was switched to ppc_proc_freq, but never removed from dts.

Hence I'll do that now.
-- 
Sincerely, Vitaly

^ permalink raw reply

* Re: [PATCH 5/5] powerpc: Don't use SLAB/SLUB for PTE pages
From: Benjamin Herrenschmidt @ 2007-05-08 21:17 UTC (permalink / raw)
  To: Hugh Dickins; +Cc: linuxppc-dev, Paul Mackerras
In-Reply-To: <Pine.LNX.4.64.0705082035430.17227@blonde.wat.veritas.com>

On Tue, 2007-05-08 at 20:50 +0100, Hugh Dickins wrote:
> On Tue, 8 May 2007, Benjamin Herrenschmidt wrote:
> > From: Hugh Dickins <hugh@veritas.com>
> > 
> > The SLUB allocator relies on struct page fields first_page and slab,
> > overwritten by ptl when SPLIT_PTLOCK: so the SLUB allocator cannot then
> > be used for the lowest level of pagetable pages.  This was obstructing
> > SLUB on PowerPC, which uses kmem_caches for its pagetables.  So convert
> > its pte level to use normal gfp pages (whereas pmd, pud and 64k-page pgd
> > want partpages, so continue to use kmem_caches for pmd, pud and pgd).
> > 
> > Signed-off-by: Hugh Dickins <hugh@veritas.com>
> > Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> > ---
> 
> Looks and runs fine for me (though would have seemed nicer to use
> __GFP_ZERO than clear_page - or does that subvert your fast zeroing?).

Nah, you are right, I'll respin. Forgot about __GFP_ZERO. It just called
clear_highpage on the returned pages right ? This is the same as calling
clear_page from my code.

> But you also need to undo the ARCH_USES_SLAB_PAGE_STRUCT from
> arch/powerpc/Kconfig now that's gone into Linus' tree: patch
> I added in testing below (either append to this one or add a 6/5).

I was thinking about adding a new patch.

> For some people that interim disablement was working, for other
> people it wasn't: mysterious, and the sooner it's got rid of the
> better.  I'm sorry to find that oldconfig doesn't actually offer
> the SLAB or SLUB menu (to me anyway) when moving from SLUB disabled
> to SLUB enabled: so again, the sooner we get rid of that interim
> disablement the better for SLUB exposure.

Ok. I'll post a new patch along with the final serie after I've done some
testing later today.

Cheers,
Ben.

^ permalink raw reply

* Time generation MPC8xx
From: DI BACCO ANTONIO - technolabs @ 2007-05-08 21:11 UTC (permalink / raw)
  To: linuxppc-embedded

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

Anyone knows how the time() function works on Linux on MPC8xx? I don't have an external RTC circuit but I think is emulated.
I thought that it used /dev/rtc but it doesn't seem so, furthermore /dev/rtc is really too fast. It gains 5-6 seconds per minute.

Any help is appreciated.

Bye,
Antonio.

[-- Attachment #2: Type: text/html, Size: 690 bytes --]

^ permalink raw reply

* Re: [PATCH 5/5] powerpc: Don't use SLAB/SLUB for PTE pages
From: Hugh Dickins @ 2007-05-08 19:50 UTC (permalink / raw)
  To: Benjamin Herrenschmidt; +Cc: linuxppc-dev, Paul Mackerras
In-Reply-To: <20070508062750.A5CBBDDE42@ozlabs.org>

On Tue, 8 May 2007, Benjamin Herrenschmidt wrote:
> From: Hugh Dickins <hugh@veritas.com>
> 
> The SLUB allocator relies on struct page fields first_page and slab,
> overwritten by ptl when SPLIT_PTLOCK: so the SLUB allocator cannot then
> be used for the lowest level of pagetable pages.  This was obstructing
> SLUB on PowerPC, which uses kmem_caches for its pagetables.  So convert
> its pte level to use normal gfp pages (whereas pmd, pud and 64k-page pgd
> want partpages, so continue to use kmem_caches for pmd, pud and pgd).
> 
> Signed-off-by: Hugh Dickins <hugh@veritas.com>
> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> ---

Looks and runs fine for me (though would have seemed nicer to use
__GFP_ZERO than clear_page - or does that subvert your fast zeroing?).

But you also need to undo the ARCH_USES_SLAB_PAGE_STRUCT from
arch/powerpc/Kconfig now that's gone into Linus' tree: patch
I added in testing below (either append to this one or add a 6/5).

For some people that interim disablement was working, for other
people it wasn't: mysterious, and the sooner it's got rid of the
better.  I'm sorry to find that oldconfig doesn't actually offer
the SLAB or SLUB menu (to me anyway) when moving from SLUB disabled
to SLUB enabled: so again, the sooner we get rid of that interim
disablement the better for SLUB exposure.

Thanks,
Hugh

> 
>  arch/powerpc/mm/init_64.c     |   17 ++++++-----------
>  include/asm-powerpc/pgalloc.h |   34 ++++++++++++++++------------------
>  2 files changed, 22 insertions(+), 29 deletions(-)
> 
> Index: linux-cell/arch/powerpc/mm/init_64.c
> ===================================================================
> --- linux-cell.orig/arch/powerpc/mm/init_64.c	2007-05-08 11:46:50.000000000 +1000
> +++ linux-cell/arch/powerpc/mm/init_64.c	2007-05-08 15:45:46.000000000 +1000
> @@ -146,21 +146,16 @@ static void zero_ctor(void *addr, struct
>  	memset(addr, 0, kmem_cache_size(cache));
>  }
>  
> -#ifdef CONFIG_PPC_64K_PAGES
> -static const unsigned int pgtable_cache_size[3] = {
> -	PTE_TABLE_SIZE, PMD_TABLE_SIZE, PGD_TABLE_SIZE
> -};
> -static const char *pgtable_cache_name[ARRAY_SIZE(pgtable_cache_size)] = {
> -	"pte_pmd_cache", "pmd_cache", "pgd_cache",
> -};
> -#else
>  static const unsigned int pgtable_cache_size[2] = {
> -	PTE_TABLE_SIZE, PMD_TABLE_SIZE
> +	PGD_TABLE_SIZE, PMD_TABLE_SIZE
>  };
>  static const char *pgtable_cache_name[ARRAY_SIZE(pgtable_cache_size)] = {
> -	"pgd_pte_cache", "pud_pmd_cache",
> -};
> +#ifdef CONFIG_PPC_64K_PAGES
> +	"pgd_cache", "pmd_cache",
> +#else
> +	"pgd_cache", "pud_pmd_cache",
>  #endif /* CONFIG_PPC_64K_PAGES */
> +};
>  
>  #ifdef CONFIG_HUGETLB_PAGE
>  /* Hugepages need one extra cache, initialized in hugetlbpage.c.  We
> Index: linux-cell/include/asm-powerpc/pgalloc.h
> ===================================================================
> --- linux-cell.orig/include/asm-powerpc/pgalloc.h	2007-04-27 14:13:24.000000000 +1000
> +++ linux-cell/include/asm-powerpc/pgalloc.h	2007-05-08 16:01:00.000000000 +1000
> @@ -13,18 +13,11 @@
>  
>  extern struct kmem_cache *pgtable_cache[];
>  
> -#ifdef CONFIG_PPC_64K_PAGES
> -#define PTE_CACHE_NUM	0
> -#define PMD_CACHE_NUM	1
> -#define PGD_CACHE_NUM	2
> -#define HUGEPTE_CACHE_NUM 3
> -#else
> -#define PTE_CACHE_NUM	0
> -#define PMD_CACHE_NUM	1
> -#define PUD_CACHE_NUM	1
> -#define PGD_CACHE_NUM	0
> -#define HUGEPTE_CACHE_NUM 2
> -#endif
> +#define PGD_CACHE_NUM		0
> +#define PUD_CACHE_NUM		1
> +#define PMD_CACHE_NUM		1
> +#define HUGEPTE_CACHE_NUM	2
> +#define PTE_NONCACHE_NUM	3  /* from GFP rather than kmem_cache */
>  
>  /*
>   * This program is free software; you can redistribute it and/or
> @@ -97,8 +90,10 @@ static inline void pmd_free(pmd_t *pmd)
>  static inline pte_t *pte_alloc_one_kernel(struct mm_struct *mm,
>  					  unsigned long address)
>  {
> -	return kmem_cache_alloc(pgtable_cache[PTE_CACHE_NUM],
> -				GFP_KERNEL|__GFP_REPEAT);
> +	pte_t *ptepage = (pte_t *)__get_free_page(GFP_KERNEL | __GFP_REPEAT);
> +	if (ptepage)
> +		clear_page(ptepage);
> +	return ptepage;
>  }
>  
>  static inline struct page *pte_alloc_one(struct mm_struct *mm,
> @@ -109,12 +104,12 @@ static inline struct page *pte_alloc_one
>  		
>  static inline void pte_free_kernel(pte_t *pte)
>  {
> -	kmem_cache_free(pgtable_cache[PTE_CACHE_NUM], pte);
> +	free_page((unsigned long)pte);
>  }
>  
>  static inline void pte_free(struct page *ptepage)
>  {
> -	pte_free_kernel(page_address(ptepage));
> +	__free_page(ptepage);
>  }
>  
>  #define PGF_CACHENUM_MASK	0x3
> @@ -136,14 +131,17 @@ static inline void pgtable_free(pgtable_
>  	void *p = (void *)(pgf.val & ~PGF_CACHENUM_MASK);
>  	int cachenum = pgf.val & PGF_CACHENUM_MASK;
>  
> -	kmem_cache_free(pgtable_cache[cachenum], p);
> +	if (cachenum == PTE_NONCACHE_NUM)
> +		free_page((unsigned long)p);
> +	else
> +		kmem_cache_free(pgtable_cache[cachenum], p);
>  }
>  
>  extern void pgtable_free_tlb(struct mmu_gather *tlb, pgtable_free_t pgf);
>  
>  #define __pte_free_tlb(tlb, ptepage)	\
>  	pgtable_free_tlb(tlb, pgtable_free_cache(page_address(ptepage), \
> -		PTE_CACHE_NUM, PTE_TABLE_SIZE-1))
> +		PTE_NONCACHE_NUM, PTE_TABLE_SIZE-1))
>  #define __pmd_free_tlb(tlb, pmd) 	\
>  	pgtable_free_tlb(tlb, pgtable_free_cache(pmd, \
>  		PMD_CACHE_NUM, PMD_TABLE_SIZE-1))

--- 2.6.21-git9/arch/powerpc/Kconfig	2007-05-08 12:32:33.000000000 +0100
+++ linux/arch/powerpc/Kconfig	2007-05-08 13:30:51.000000000 +0100
@@ -117,19 +117,6 @@ config GENERIC_BUG
 	default y
 	depends on BUG
 
-#
-# Powerpc uses the slab allocator to manage its ptes and the
-# page structs of ptes are used for splitting the page table
-# lock for configurations supporting more than SPLIT_PTLOCK_CPUS.
-#
-# In that special configuration the page structs of slabs are modified.
-# This setting disables the selection of SLUB as a slab allocator.
-#
-config ARCH_USES_SLAB_PAGE_STRUCT
-	bool
-	default y
-	depends on SPLIT_PTLOCK_CPUS <= NR_CPUS
-
 config DEFAULT_UIMAGE
 	bool
 	help

^ permalink raw reply

* Re: Current powerpc.git build failures
From: Kumar Gala @ 2007-05-08 20:38 UTC (permalink / raw)
  To: Timur Tabi; +Cc: Olof Johansson, linuxppc-dev, jdl, paulus, arnd
In-Reply-To: <4640DDD8.4040001@freescale.com>


On May 8, 2007, at 3:30 PM, Timur Tabi wrote:

> Olof Johansson wrote:
>
>> powerpc.mpc8641_hpcn_defconfig:
>> In file included from include/asm-generic/pgtable-nopmd.h:6,
>>                  from include/asm/pgtable-ppc32.h:4,
>>                  from include/asm/pgtable.h:8,
>>                  from arch/powerpc/platforms/86xx/mpc86xx_smp.c:18:
>> include/asm-generic/pgtable-nopud.h:13: error: expected specifier- 
>> qualifier-list before 'pgd_t'
>
> This must have occurred in the past 24 hours because I built the  
> latest 8641 yesterday
> morning and it worked fine.  mpc86xx_smp.c has not changed since  
> February, so I'm guessing
> that some header file that mpc86xx_smp.c includes no longer  
> includes some other header.

I'm guessing this is from david gibson's  4level-fixup.h for ppc32  
patch.

- k

^ permalink raw reply

* Re: Current powerpc.git build failures
From: Timur Tabi @ 2007-05-08 20:30 UTC (permalink / raw)
  To: Olof Johansson; +Cc: linuxppc-dev, jdl, paulus, arnd
In-Reply-To: <20070508191758.GA26879@lixom.net>

Olof Johansson wrote:

> powerpc.mpc8641_hpcn_defconfig:
> In file included from include/asm-generic/pgtable-nopmd.h:6,
>                  from include/asm/pgtable-ppc32.h:4,
>                  from include/asm/pgtable.h:8,
>                  from arch/powerpc/platforms/86xx/mpc86xx_smp.c:18:
> include/asm-generic/pgtable-nopud.h:13: error: expected specifier-qualifier-list before 'pgd_t'

This must have occurred in the past 24 hours because I built the latest 8641 yesterday 
morning and it worked fine.  mpc86xx_smp.c has not changed since February, so I'm guessing 
that some header file that mpc86xx_smp.c includes no longer includes some other header.

-- 
Timur Tabi
Linux Kernel Developer @ Freescale

^ permalink raw reply

* [PATCH v4] powerpc: change rheap functions to use ulongs instead of pointers
From: Timur Tabi @ 2007-05-08 19:46 UTC (permalink / raw)
  To: galak, linuxppc-dev, netdev; +Cc: Timur Tabi

The rheap allocation functions return a pointer, but the actual value is based
on how the heap was initialized, and so it can be anything, e.g. an offset
into a buffer.  A ulong is a better representation of the value returned by
the allocation functions.

This patch changes all of the relevant rheap functions to use a unsigned long
integers instead of a pointer.  In case of an error, the value returned is
a negative error code that has been cast to an unsigned long.  The caller can
use the IS_ERR_VALUE() macro to check for this.

All code which calls the rheap functions is updated accordingly.  Macros
IS_MURAM_ERR() and IS_DPERR(), have been deleted in favor of IS_ERR_VALUE().

Also added error checking to rh_attach_region().

Signed-off-by: Timur Tabi <timur@freescale.com>
---

Updated for Paul's latest tree.  Even though this patch changes powerpc,
netdev, and serial drivers, it cannot be split up.  The powerpc side deletes
a function and changes prototypes of other functions, so if the netdev and
serial drivers are not updated at the same time, they won't compile.

 arch/powerpc/lib/rheap.c                |  117 ++++++++++++++++++-------------
 arch/powerpc/sysdev/commproc.c          |   20 +++---
 arch/powerpc/sysdev/cpm2_common.c       |   21 +++---
 arch/powerpc/sysdev/qe_lib/qe.c         |   29 ++++----
 arch/powerpc/sysdev/qe_lib/ucc_fast.c   |    5 +-
 arch/powerpc/sysdev/qe_lib/ucc_slow.c   |    7 +-
 arch/ppc/8xx_io/commproc.c              |   22 +++---
 arch/ppc/lib/rheap.c                    |   95 +++++++++++++------------
 arch/ppc/syslib/cpm2_common.c           |   23 +++---
 drivers/net/fs_enet/mac-scc.c           |    2 +-
 drivers/net/ucc_geth.c                  |   30 ++++----
 drivers/serial/cpm_uart/cpm_uart_cpm1.c |    4 +-
 drivers/serial/cpm_uart/cpm_uart_cpm2.c |    4 +-
 include/asm-powerpc/qe.h                |   13 +---
 include/asm-ppc/commproc.h              |   13 +---
 include/asm-ppc/cpm2.h                  |   13 +---
 include/asm-ppc/rheap.h                 |   20 +++---
 17 files changed, 221 insertions(+), 217 deletions(-)

diff --git a/arch/powerpc/lib/rheap.c b/arch/powerpc/lib/rheap.c
index 6c5c5dd..b2f6dcc 100644
--- a/arch/powerpc/lib/rheap.c
+++ b/arch/powerpc/lib/rheap.c
@@ -133,7 +133,7 @@ static rh_block_t *get_slot(rh_info_t * info)
 	info->empty_slots--;

 	/* Initialize */
-	blk->start = NULL;
+	blk->start = 0;
 	blk->size = 0;
 	blk->owner = NULL;

@@ -158,7 +158,7 @@ static void attach_free_block(rh_info_t * info, rh_block_t * blkn)

 	/* We assume that they are aligned properly */
 	size = blkn->size;
-	s = (unsigned long)blkn->start;
+	s = blkn->start;
 	e = s + size;

 	/* Find the blocks immediately before and after the given one
@@ -170,7 +170,7 @@ static void attach_free_block(rh_info_t * info, rh_block_t * blkn)
 	list_for_each(l, &info->free_list) {
 		blk = list_entry(l, rh_block_t, list);

-		bs = (unsigned long)blk->start;
+		bs = blk->start;
 		be = bs + blk->size;

 		if (next == NULL && s >= bs)
@@ -188,10 +188,10 @@ static void attach_free_block(rh_info_t * info, rh_block_t * blkn)
 	}

 	/* Now check if they are really adjacent */
-	if (before != NULL && s != (unsigned long)before->start + before->size)
+	if (before && s != (before->start + before->size))
 		before = NULL;

-	if (after != NULL && e != (unsigned long)after->start)
+	if (after && e != after->start)
 		after = NULL;

 	/* No coalescing; list insert and return */
@@ -216,7 +216,7 @@ static void attach_free_block(rh_info_t * info, rh_block_t * blkn)

 	/* Grow the after block backwards */
 	if (before == NULL && after != NULL) {
-		after->start = (int8_t *)after->start - size;
+		after->start -= size;
 		after->size += size;
 		return;
 	}
@@ -321,14 +321,14 @@ void rh_init(rh_info_t * info, unsigned int alignment, int max_blocks,
 }

 /* Attach a free memory region, coalesces regions if adjuscent */
-int rh_attach_region(rh_info_t * info, void *start, int size)
+int rh_attach_region(rh_info_t * info, unsigned long start, int size)
 {
 	rh_block_t *blk;
 	unsigned long s, e, m;
 	int r;

 	/* The region must be aligned */
-	s = (unsigned long)start;
+	s = start;
 	e = s + size;
 	m = info->alignment - 1;

@@ -338,9 +338,12 @@ int rh_attach_region(rh_info_t * info, void *start, int size)
 	/* Round end down */
 	e = e & ~m;

+	if (IS_ERR_VALUE(e) || (e < s))
+		return -ERANGE;
+
 	/* Take final values */
-	start = (void *)s;
-	size = (int)(e - s);
+	start = s;
+	size = e - s;

 	/* Grow the blocks, if needed */
 	r = assure_empty(info, 1);
@@ -358,7 +361,7 @@ int rh_attach_region(rh_info_t * info, void *start, int size)
 }

 /* Detatch given address range, splits free block if needed. */
-void *rh_detach_region(rh_info_t * info, void *start, int size)
+unsigned long rh_detach_region(rh_info_t * info, unsigned long start, int size)
 {
 	struct list_head *l;
 	rh_block_t *blk, *newblk;
@@ -366,10 +369,10 @@ void *rh_detach_region(rh_info_t * info, void *start, int size)

 	/* Validate size */
 	if (size <= 0)
-		return ERR_PTR(-EINVAL);
+		return (unsigned long) -EINVAL;

 	/* The region must be aligned */
-	s = (unsigned long)start;
+	s = start;
 	e = s + size;
 	m = info->alignment - 1;

@@ -380,34 +383,34 @@ void *rh_detach_region(rh_info_t * info, void *start, int size)
 	e = e & ~m;

 	if (assure_empty(info, 1) < 0)
-		return ERR_PTR(-ENOMEM);
+		return (unsigned long) -ENOMEM;

 	blk = NULL;
 	list_for_each(l, &info->free_list) {
 		blk = list_entry(l, rh_block_t, list);
 		/* The range must lie entirely inside one free block */
-		bs = (unsigned long)blk->start;
-		be = (unsigned long)blk->start + blk->size;
+		bs = blk->start;
+		be = blk->start + blk->size;
 		if (s >= bs && e <= be)
 			break;
 		blk = NULL;
 	}

 	if (blk == NULL)
-		return ERR_PTR(-ENOMEM);
+		return (unsigned long) -ENOMEM;

 	/* Perfect fit */
 	if (bs == s && be == e) {
 		/* Delete from free list, release slot */
 		list_del(&blk->list);
 		release_slot(info, blk);
-		return (void *)s;
+		return s;
 	}

 	/* blk still in free list, with updated start and/or size */
 	if (bs == s || be == e) {
 		if (bs == s)
-			blk->start = (int8_t *)blk->start + size;
+			blk->start += size;
 		blk->size -= size;

 	} else {
@@ -416,25 +419,29 @@ void *rh_detach_region(rh_info_t * info, void *start, int size)

 		/* the back free fragment */
 		newblk = get_slot(info);
-		newblk->start = (void *)e;
+		newblk->start = e;
 		newblk->size = be - e;

 		list_add(&newblk->list, &blk->list);
 	}

-	return (void *)s;
+	return s;
 }

-void *rh_alloc_align(rh_info_t * info, int size, int alignment, const char *owner)
+/* Allocate a block of memory at the specified alignment.  The value returned
+ * is an offset into the buffer initialized by rh_init(), or a negative number
+ * if there is an error.
+ */
+unsigned long rh_alloc_align(rh_info_t * info, int size, int alignment, const char *owner)
 {
 	struct list_head *l;
 	rh_block_t *blk;
 	rh_block_t *newblk;
-	void *start;
+	unsigned long start;

-	/* Validate size, (must be power of two) */
+	/* Validate size, and alignment must be power of two */
 	if (size <= 0 || (alignment & (alignment - 1)) != 0)
-		return ERR_PTR(-EINVAL);
+		return (unsigned long) -EINVAL;

 	/* given alignment larger that default rheap alignment */
 	if (alignment > info->alignment)
@@ -444,7 +451,7 @@ void *rh_alloc_align(rh_info_t * info, int size, int alignment, const char *owne
 	size = (size + (info->alignment - 1)) & ~(info->alignment - 1);

 	if (assure_empty(info, 1) < 0)
-		return ERR_PTR(-ENOMEM);
+		return (unsigned long) -ENOMEM;

 	blk = NULL;
 	list_for_each(l, &info->free_list) {
@@ -455,7 +462,7 @@ void *rh_alloc_align(rh_info_t * info, int size, int alignment, const char *owne
 	}

 	if (blk == NULL)
-		return ERR_PTR(-ENOMEM);
+		return (unsigned long) -ENOMEM;

 	/* Just fits */
 	if (blk->size == size) {
@@ -475,7 +482,7 @@ void *rh_alloc_align(rh_info_t * info, int size, int alignment, const char *owne
 	newblk->owner = owner;

 	/* blk still in free list, with updated start, size */
-	blk->start = (int8_t *)blk->start + size;
+	blk->start += size;
 	blk->size -= size;

 	start = newblk->start;
@@ -486,19 +493,25 @@ void *rh_alloc_align(rh_info_t * info, int size, int alignment, const char *owne
 	/* this is no problem with the deallocator since */
 	/* we scan for pointers that lie in the blocks   */
 	if (alignment > info->alignment)
-		start = (void *)(((unsigned long)start + alignment - 1) &
-				~(alignment - 1));
+		start = (start + alignment - 1) & ~(alignment - 1);

 	return start;
 }

-void *rh_alloc(rh_info_t * info, int size, const char *owner)
+/* Allocate a block of memory at the default alignment.  The value returned is
+ * an offset into the buffer initialized by rh_init(), or a negative number if
+ * there is an error.
+ */
+unsigned long rh_alloc(rh_info_t * info, int size, const char *owner)
 {
 	return rh_alloc_align(info, size, info->alignment, owner);
 }

-/* allocate at precisely the given address */
-void *rh_alloc_fixed(rh_info_t * info, void *start, int size, const char *owner)
+/* Allocate a block of memory at the given offset, rounded up to the default
+ * alignment.  The value returned is an offset into the buffer initialized by
+ * rh_init(), or a negative number if there is an error.
+ */
+unsigned long rh_alloc_fixed(rh_info_t * info, unsigned long start, int size, const char *owner)
 {
 	struct list_head *l;
 	rh_block_t *blk, *newblk1, *newblk2;
@@ -506,10 +519,10 @@ void *rh_alloc_fixed(rh_info_t * info, void *start, int size, const char *owner)

 	/* Validate size */
 	if (size <= 0)
-		return ERR_PTR(-EINVAL);
+		return (unsigned long) -EINVAL;

 	/* The region must be aligned */
-	s = (unsigned long)start;
+	s = start;
 	e = s + size;
 	m = info->alignment - 1;

@@ -520,20 +533,20 @@ void *rh_alloc_fixed(rh_info_t * info, void *start, int size, const char *owner)
 	e = e & ~m;

 	if (assure_empty(info, 2) < 0)
-		return ERR_PTR(-ENOMEM);
+		return (unsigned long) -ENOMEM;

 	blk = NULL;
 	list_for_each(l, &info->free_list) {
 		blk = list_entry(l, rh_block_t, list);
 		/* The range must lie entirely inside one free block */
-		bs = (unsigned long)blk->start;
-		be = (unsigned long)blk->start + blk->size;
+		bs = blk->start;
+		be = blk->start + blk->size;
 		if (s >= bs && e <= be)
 			break;
 	}

 	if (blk == NULL)
-		return ERR_PTR(-ENOMEM);
+		return (unsigned long) -ENOMEM;

 	/* Perfect fit */
 	if (bs == s && be == e) {
@@ -551,7 +564,7 @@ void *rh_alloc_fixed(rh_info_t * info, void *start, int size, const char *owner)
 	/* blk still in free list, with updated start and/or size */
 	if (bs == s || be == e) {
 		if (bs == s)
-			blk->start = (int8_t *)blk->start + size;
+			blk->start += size;
 		blk->size -= size;

 	} else {
@@ -560,14 +573,14 @@ void *rh_alloc_fixed(rh_info_t * info, void *start, int size, const char *owner)

 		/* The back free fragment */
 		newblk2 = get_slot(info);
-		newblk2->start = (void *)e;
+		newblk2->start = e;
 		newblk2->size = be - e;

 		list_add(&newblk2->list, &blk->list);
 	}

 	newblk1 = get_slot(info);
-	newblk1->start = (void *)s;
+	newblk1->start = s;
 	newblk1->size = e - s;
 	newblk1->owner = owner;

@@ -577,7 +590,11 @@ void *rh_alloc_fixed(rh_info_t * info, void *start, int size, const char *owner)
 	return start;
 }

-int rh_free(rh_info_t * info, void *start)
+/* Deallocate the memory previously allocated by one of the rh_alloc functions.
+ * The return value is the size of the deallocated block, or a negative number
+ * if there is an error.
+ */
+int rh_free(rh_info_t * info, unsigned long start)
 {
 	rh_block_t *blk, *blk2;
 	struct list_head *l;
@@ -642,7 +659,7 @@ int rh_get_stats(rh_info_t * info, int what, int max_stats, rh_stats_t * stats)
 	return nr;
 }

-int rh_set_owner(rh_info_t * info, void *start, const char *owner)
+int rh_set_owner(rh_info_t * info, unsigned long start, const char *owner)
 {
 	rh_block_t *blk, *blk2;
 	struct list_head *l;
@@ -684,8 +701,8 @@ void rh_dump(rh_info_t * info)
 		nr = maxnr;
 	for (i = 0; i < nr; i++)
 		printk(KERN_INFO
-		       "    0x%p-0x%p (%u)\n",
-		       st[i].start, (int8_t *) st[i].start + st[i].size,
+		       "    0x%lx-0x%lx (%u)\n",
+		       st[i].start, st[i].start + st[i].size,
 		       st[i].size);
 	printk(KERN_INFO "\n");

@@ -695,8 +712,8 @@ void rh_dump(rh_info_t * info)
 		nr = maxnr;
 	for (i = 0; i < nr; i++)
 		printk(KERN_INFO
-		       "    0x%p-0x%p (%u) %s\n",
-		       st[i].start, (int8_t *) st[i].start + st[i].size,
+		       "    0x%lx-0x%lx (%u) %s\n",
+		       st[i].start, st[i].start + st[i].size,
 		       st[i].size, st[i].owner != NULL ? st[i].owner : "");
 	printk(KERN_INFO "\n");
 }
@@ -704,6 +721,6 @@ void rh_dump(rh_info_t * info)
 void rh_dump_blk(rh_info_t * info, rh_block_t * blk)
 {
 	printk(KERN_INFO
-	       "blk @0x%p: 0x%p-0x%p (%u)\n",
-	       blk, blk->start, (int8_t *) blk->start + blk->size, blk->size);
+	       "blk @0x%p: 0x%lx-0x%lx (%u)\n",
+	       blk, blk->start, blk->start + blk->size, blk->size);
 }
diff --git a/arch/powerpc/sysdev/commproc.c b/arch/powerpc/sysdev/commproc.c
index 9b4fafd..4f67b89 100644
--- a/arch/powerpc/sysdev/commproc.c
+++ b/arch/powerpc/sysdev/commproc.c
@@ -330,7 +330,7 @@ void m8xx_cpm_dpinit(void)
 	 * with the processor and the microcode patches applied / activated.
 	 * But the following should be at least safe.
 	 */
-	rh_attach_region(&cpm_dpmem_info, (void *)CPM_DATAONLY_BASE, CPM_DATAONLY_SIZE);
+	rh_attach_region(&cpm_dpmem_info, CPM_DATAONLY_BASE, CPM_DATAONLY_SIZE);
 }

 /*
@@ -338,9 +338,9 @@ void m8xx_cpm_dpinit(void)
  * This function returns an offset into the DPRAM area.
  * Use cpm_dpram_addr() to get the virtual address of the area.
  */
-uint cpm_dpalloc(uint size, uint align)
+unsigned long cpm_dpalloc(uint size, uint align)
 {
-	void *start;
+	unsigned long start;
 	unsigned long flags;

 	spin_lock_irqsave(&cpm_dpmem_lock, flags);
@@ -352,30 +352,30 @@ uint cpm_dpalloc(uint size, uint align)
 }
 EXPORT_SYMBOL(cpm_dpalloc);

-int cpm_dpfree(uint offset)
+int cpm_dpfree(unsigned long offset)
 {
 	int ret;
 	unsigned long flags;

 	spin_lock_irqsave(&cpm_dpmem_lock, flags);
-	ret = rh_free(&cpm_dpmem_info, (void *)offset);
+	ret = rh_free(&cpm_dpmem_info, offset);
 	spin_unlock_irqrestore(&cpm_dpmem_lock, flags);

 	return ret;
 }
 EXPORT_SYMBOL(cpm_dpfree);

-uint cpm_dpalloc_fixed(uint offset, uint size, uint align)
+unsigned long cpm_dpalloc_fixed(unsigned long offset, uint size, uint align)
 {
-	void *start;
+	unsigned long start;
 	unsigned long flags;

 	spin_lock_irqsave(&cpm_dpmem_lock, flags);
 	cpm_dpmem_info.alignment = align;
-	start = rh_alloc_fixed(&cpm_dpmem_info, (void *)offset, size, "commproc");
+	start = rh_alloc_fixed(&cpm_dpmem_info, offset, size, "commproc");
 	spin_unlock_irqrestore(&cpm_dpmem_lock, flags);

-	return (uint)start;
+	return start;
 }
 EXPORT_SYMBOL(cpm_dpalloc_fixed);

@@ -385,7 +385,7 @@ void cpm_dpdump(void)
 }
 EXPORT_SYMBOL(cpm_dpdump);

-void *cpm_dpram_addr(uint offset)
+void *cpm_dpram_addr(unsigned long offset)
 {
 	return (void *)(dpram_vbase + offset);
 }
diff --git a/arch/powerpc/sysdev/cpm2_common.c b/arch/powerpc/sysdev/cpm2_common.c
index ec26599..9244129 100644
--- a/arch/powerpc/sysdev/cpm2_common.c
+++ b/arch/powerpc/sysdev/cpm2_common.c
@@ -248,15 +248,14 @@ static void cpm2_dpinit(void)
 	 * varies with the processor and the microcode patches activated.
 	 * But the following should be at least safe.
 	 */
-	rh_attach_region(&cpm_dpmem_info, (void *)CPM_DATAONLY_BASE,
-			CPM_DATAONLY_SIZE);
+	rh_attach_region(&cpm_dpmem_info, CPM_DATAONLY_BASE, CPM_DATAONLY_SIZE);
 }

 /* This function returns an index into the DPRAM area.
  */
-uint cpm_dpalloc(uint size, uint align)
+unsigned long cpm_dpalloc(uint size, uint align)
 {
-	void *start;
+	unsigned long start;
 	unsigned long flags;

 	spin_lock_irqsave(&cpm_dpmem_lock, flags);
@@ -268,13 +267,13 @@ uint cpm_dpalloc(uint size, uint align)
 }
 EXPORT_SYMBOL(cpm_dpalloc);

-int cpm_dpfree(uint offset)
+int cpm_dpfree(unsigned long offset)
 {
 	int ret;
 	unsigned long flags;

 	spin_lock_irqsave(&cpm_dpmem_lock, flags);
-	ret = rh_free(&cpm_dpmem_info, (void *)offset);
+	ret = rh_free(&cpm_dpmem_info, offset);
 	spin_unlock_irqrestore(&cpm_dpmem_lock, flags);

 	return ret;
@@ -282,17 +281,17 @@ int cpm_dpfree(uint offset)
 EXPORT_SYMBOL(cpm_dpfree);

 /* not sure if this is ever needed */
-uint cpm_dpalloc_fixed(uint offset, uint size, uint align)
+unsigned long cpm_dpalloc_fixed(unsigned long offset, uint size, uint align)
 {
-	void *start;
+	unsigned long start;
 	unsigned long flags;

 	spin_lock_irqsave(&cpm_dpmem_lock, flags);
 	cpm_dpmem_info.alignment = align;
-	start = rh_alloc_fixed(&cpm_dpmem_info, (void *)offset, size, "commproc");
+	start = rh_alloc_fixed(&cpm_dpmem_info, offset, size, "commproc");
 	spin_unlock_irqrestore(&cpm_dpmem_lock, flags);

-	return (uint)start;
+	return start;
 }
 EXPORT_SYMBOL(cpm_dpalloc_fixed);

@@ -302,7 +301,7 @@ void cpm_dpdump(void)
 }
 EXPORT_SYMBOL(cpm_dpdump);

-void *cpm_dpram_addr(uint offset)
+void *cpm_dpram_addr(unsigned long offset)
 {
 	return (void *)(im_dprambase + offset);
 }
diff --git a/arch/powerpc/sysdev/qe_lib/qe.c b/arch/powerpc/sysdev/qe_lib/qe.c
index 7f4c075..90f8740 100644
--- a/arch/powerpc/sysdev/qe_lib/qe.c
+++ b/arch/powerpc/sysdev/qe_lib/qe.c
@@ -244,7 +244,7 @@ EXPORT_SYMBOL(qe_put_snum);
 static int qe_sdma_init(void)
 {
 	struct sdma *sdma = &qe_immr->sdma;
-	u32 sdma_buf_offset;
+	unsigned long sdma_buf_offset;

 	if (!sdma)
 		return -ENODEV;
@@ -252,10 +252,10 @@ static int qe_sdma_init(void)
 	/* allocate 2 internal temporary buffers (512 bytes size each) for
 	 * the SDMA */
  	sdma_buf_offset = qe_muram_alloc(512 * 2, 4096);
-	if (IS_MURAM_ERR(sdma_buf_offset))
+	if (IS_ERR_VALUE(sdma_buf_offset))
 		return -ENOMEM;

-	out_be32(&sdma->sdebcr, sdma_buf_offset & QE_SDEBCR_BA_MASK);
+	out_be32(&sdma->sdebcr, (u32) sdma_buf_offset & QE_SDEBCR_BA_MASK);
  	out_be32(&sdma->sdmr, (QE_SDMR_GLB_1_MSK |
  					(0x1 << QE_SDMR_CEN_SHIFT)));

@@ -291,33 +291,32 @@ static void qe_muram_init(void)
 	if ((np = of_find_node_by_name(NULL, "data-only")) != NULL) {
 		address = *of_get_address(np, 0, &size, &flags);
 		of_node_put(np);
-		rh_attach_region(&qe_muram_info,
-			(void *)address, (int)size);
+		rh_attach_region(&qe_muram_info, address, (int) size);
 	}
 }

 /* This function returns an index into the MURAM area.
  */
-u32 qe_muram_alloc(u32 size, u32 align)
+unsigned long qe_muram_alloc(int size, int align)
 {
-	void *start;
+	unsigned long start;
 	unsigned long flags;

 	spin_lock_irqsave(&qe_muram_lock, flags);
 	start = rh_alloc_align(&qe_muram_info, size, align, "QE");
 	spin_unlock_irqrestore(&qe_muram_lock, flags);

-	return (u32) start;
+	return start;
 }
 EXPORT_SYMBOL(qe_muram_alloc);

-int qe_muram_free(u32 offset)
+int qe_muram_free(unsigned long offset)
 {
 	int ret;
 	unsigned long flags;

 	spin_lock_irqsave(&qe_muram_lock, flags);
-	ret = rh_free(&qe_muram_info, (void *)offset);
+	ret = rh_free(&qe_muram_info, offset);
 	spin_unlock_irqrestore(&qe_muram_lock, flags);

 	return ret;
@@ -325,16 +324,16 @@ int qe_muram_free(u32 offset)
 EXPORT_SYMBOL(qe_muram_free);

 /* not sure if this is ever needed */
-u32 qe_muram_alloc_fixed(u32 offset, u32 size)
+unsigned long qe_muram_alloc_fixed(unsigned long offset, int size)
 {
-	void *start;
+	unsigned long start;
 	unsigned long flags;

 	spin_lock_irqsave(&qe_muram_lock, flags);
-	start = rh_alloc_fixed(&qe_muram_info, (void *)offset, size, "commproc");
+	start = rh_alloc_fixed(&qe_muram_info, offset, size, "commproc");
 	spin_unlock_irqrestore(&qe_muram_lock, flags);

-	return (u32) start;
+	return start;
 }
 EXPORT_SYMBOL(qe_muram_alloc_fixed);

@@ -344,7 +343,7 @@ void qe_muram_dump(void)
 }
 EXPORT_SYMBOL(qe_muram_dump);

-void *qe_muram_addr(u32 offset)
+void *qe_muram_addr(unsigned long offset)
 {
 	return (void *)&qe_immr->muram[offset];
 }
diff --git a/arch/powerpc/sysdev/qe_lib/ucc_fast.c b/arch/powerpc/sysdev/qe_lib/ucc_fast.c
index 66137bf..9143236 100644
--- a/arch/powerpc/sysdev/qe_lib/ucc_fast.c
+++ b/arch/powerpc/sysdev/qe_lib/ucc_fast.c
@@ -18,6 +18,7 @@
 #include <linux/slab.h>
 #include <linux/stddef.h>
 #include <linux/interrupt.h>
+#include <linux/err.h>

 #include <asm/io.h>
 #include <asm/immap_qe.h>
@@ -268,7 +269,7 @@ int ucc_fast_init(struct ucc_fast_info * uf_info, struct ucc_fast_private ** ucc
 	/* Allocate memory for Tx Virtual Fifo */
 	uccf->ucc_fast_tx_virtual_fifo_base_offset =
 	    qe_muram_alloc(uf_info->utfs, UCC_FAST_VIRT_FIFO_REGS_ALIGNMENT);
-	if (IS_MURAM_ERR(uccf->ucc_fast_tx_virtual_fifo_base_offset)) {
+	if (IS_ERR_VALUE(uccf->ucc_fast_tx_virtual_fifo_base_offset)) {
 		printk(KERN_ERR "%s: cannot allocate MURAM for TX FIFO", __FUNCTION__);
 		uccf->ucc_fast_tx_virtual_fifo_base_offset = 0;
 		ucc_fast_free(uccf);
@@ -280,7 +281,7 @@ int ucc_fast_init(struct ucc_fast_info * uf_info, struct ucc_fast_private ** ucc
 		qe_muram_alloc(uf_info->urfs +
 			   UCC_FAST_RECEIVE_VIRTUAL_FIFO_SIZE_FUDGE_FACTOR,
 			   UCC_FAST_VIRT_FIFO_REGS_ALIGNMENT);
-	if (IS_MURAM_ERR(uccf->ucc_fast_rx_virtual_fifo_base_offset)) {
+	if (IS_ERR_VALUE(uccf->ucc_fast_rx_virtual_fifo_base_offset)) {
 		printk(KERN_ERR "%s: cannot allocate MURAM for RX FIFO", __FUNCTION__);
 		uccf->ucc_fast_rx_virtual_fifo_base_offset = 0;
 		ucc_fast_free(uccf);
diff --git a/arch/powerpc/sysdev/qe_lib/ucc_slow.c b/arch/powerpc/sysdev/qe_lib/ucc_slow.c
index b930d68..1f65c26 100644
--- a/arch/powerpc/sysdev/qe_lib/ucc_slow.c
+++ b/arch/powerpc/sysdev/qe_lib/ucc_slow.c
@@ -18,6 +18,7 @@
 #include <linux/slab.h>
 #include <linux/stddef.h>
 #include <linux/interrupt.h>
+#include <linux/err.h>

 #include <asm/io.h>
 #include <asm/immap_qe.h>
@@ -175,7 +176,7 @@ int ucc_slow_init(struct ucc_slow_info * us_info, struct ucc_slow_private ** ucc
 	/* Get PRAM base */
 	uccs->us_pram_offset =
 		qe_muram_alloc(UCC_SLOW_PRAM_SIZE, ALIGNMENT_OF_UCC_SLOW_PRAM);
-	if (IS_MURAM_ERR(uccs->us_pram_offset)) {
+	if (IS_ERR_VALUE(uccs->us_pram_offset)) {
 		printk(KERN_ERR "%s: cannot allocate MURAM for PRAM", __FUNCTION__);
 		ucc_slow_free(uccs);
 		return -ENOMEM;
@@ -210,7 +211,7 @@ int ucc_slow_init(struct ucc_slow_info * us_info, struct ucc_slow_private ** ucc
 	uccs->rx_base_offset =
 		qe_muram_alloc(us_info->rx_bd_ring_len * sizeof(struct qe_bd),
 				QE_ALIGNMENT_OF_BD);
-	if (IS_MURAM_ERR(uccs->rx_base_offset)) {
+	if (IS_ERR_VALUE(uccs->rx_base_offset)) {
 		printk(KERN_ERR "%s: cannot allocate RX BDs", __FUNCTION__);
 		uccs->rx_base_offset = 0;
 		ucc_slow_free(uccs);
@@ -220,7 +221,7 @@ int ucc_slow_init(struct ucc_slow_info * us_info, struct ucc_slow_private ** ucc
 	uccs->tx_base_offset =
 		qe_muram_alloc(us_info->tx_bd_ring_len * sizeof(struct qe_bd),
 			QE_ALIGNMENT_OF_BD);
-	if (IS_MURAM_ERR(uccs->tx_base_offset)) {
+	if (IS_ERR_VALUE(uccs->tx_base_offset)) {
 		printk(KERN_ERR "%s: cannot allocate TX BDs", __FUNCTION__);
 		uccs->tx_base_offset = 0;
 		ucc_slow_free(uccs);
diff --git a/arch/ppc/8xx_io/commproc.c b/arch/ppc/8xx_io/commproc.c
index 7a8722b..e2c6210 100644
--- a/arch/ppc/8xx_io/commproc.c
+++ b/arch/ppc/8xx_io/commproc.c
@@ -402,7 +402,7 @@ void m8xx_cpm_dpinit(void)
 	 * with the processor and the microcode patches applied / activated.
 	 * But the following should be at least safe.
 	 */
-	rh_attach_region(&cpm_dpmem_info, (void *)CPM_DATAONLY_BASE, CPM_DATAONLY_SIZE);
+	rh_attach_region(&cpm_dpmem_info, CPM_DATAONLY_BASE, CPM_DATAONLY_SIZE);
 }

 /*
@@ -410,9 +410,9 @@ void m8xx_cpm_dpinit(void)
  * This function returns an offset into the DPRAM area.
  * Use cpm_dpram_addr() to get the virtual address of the area.
  */
-uint cpm_dpalloc(uint size, uint align)
+unsigned long cpm_dpalloc(uint size, uint align)
 {
-	void *start;
+	unsigned long start;
 	unsigned long flags;

 	spin_lock_irqsave(&cpm_dpmem_lock, flags);
@@ -420,34 +420,34 @@ uint cpm_dpalloc(uint size, uint align)
 	start = rh_alloc(&cpm_dpmem_info, size, "commproc");
 	spin_unlock_irqrestore(&cpm_dpmem_lock, flags);

-	return (uint)start;
+	return start;
 }
 EXPORT_SYMBOL(cpm_dpalloc);

-int cpm_dpfree(uint offset)
+int cpm_dpfree(unsigned long offset)
 {
 	int ret;
 	unsigned long flags;

 	spin_lock_irqsave(&cpm_dpmem_lock, flags);
-	ret = rh_free(&cpm_dpmem_info, (void *)offset);
+	ret = rh_free(&cpm_dpmem_info, offset);
 	spin_unlock_irqrestore(&cpm_dpmem_lock, flags);

 	return ret;
 }
 EXPORT_SYMBOL(cpm_dpfree);

-uint cpm_dpalloc_fixed(uint offset, uint size, uint align)
+unsigned long cpm_dpalloc_fixed(unsigned long offset, uint size, uint align)
 {
-	void *start;
+	unsigned long start;
 	unsigned long flags;

 	spin_lock_irqsave(&cpm_dpmem_lock, flags);
 	cpm_dpmem_info.alignment = align;
-	start = rh_alloc_fixed(&cpm_dpmem_info, (void *)offset, size, "commproc");
+	start = rh_alloc_fixed(&cpm_dpmem_info, offset, size, "commproc");
 	spin_unlock_irqrestore(&cpm_dpmem_lock, flags);

-	return (uint)start;
+	return start;
 }
 EXPORT_SYMBOL(cpm_dpalloc_fixed);

@@ -457,7 +457,7 @@ void cpm_dpdump(void)
 }
 EXPORT_SYMBOL(cpm_dpdump);

-void *cpm_dpram_addr(uint offset)
+void *cpm_dpram_addr(unsigned long offset)
 {
 	return ((immap_t *)IMAP_ADDR)->im_cpm.cp_dpmem + offset;
 }
diff --git a/arch/ppc/lib/rheap.c b/arch/ppc/lib/rheap.c
index d407007..9dc2f34 100644
--- a/arch/ppc/lib/rheap.c
+++ b/arch/ppc/lib/rheap.c
@@ -132,7 +132,7 @@ static rh_block_t *get_slot(rh_info_t * info)
 	info->empty_slots--;

 	/* Initialize */
-	blk->start = NULL;
+	blk->start = 0;
 	blk->size = 0;
 	blk->owner = NULL;

@@ -157,7 +157,7 @@ static void attach_free_block(rh_info_t * info, rh_block_t * blkn)

 	/* We assume that they are aligned properly */
 	size = blkn->size;
-	s = (unsigned long)blkn->start;
+	s = blkn->start;
 	e = s + size;

 	/* Find the blocks immediately before and after the given one
@@ -169,7 +169,7 @@ static void attach_free_block(rh_info_t * info, rh_block_t * blkn)
 	list_for_each(l, &info->free_list) {
 		blk = list_entry(l, rh_block_t, list);

-		bs = (unsigned long)blk->start;
+		bs = blk->start;
 		be = bs + blk->size;

 		if (next == NULL && s >= bs)
@@ -187,10 +187,10 @@ static void attach_free_block(rh_info_t * info, rh_block_t * blkn)
 	}

 	/* Now check if they are really adjacent */
-	if (before != NULL && s != (unsigned long)before->start + before->size)
+	if (before && s != (before->start + before->size))
 		before = NULL;

-	if (after != NULL && e != (unsigned long)after->start)
+	if (after && e != after->start)
 		after = NULL;

 	/* No coalescing; list insert and return */
@@ -215,7 +215,7 @@ static void attach_free_block(rh_info_t * info, rh_block_t * blkn)

 	/* Grow the after block backwards */
 	if (before == NULL && after != NULL) {
-		after->start = (int8_t *)after->start - size;
+		after->start -= size;
 		after->size += size;
 		return;
 	}
@@ -320,14 +320,14 @@ void rh_init(rh_info_t * info, unsigned int alignment, int max_blocks,
 }

 /* Attach a free memory region, coalesces regions if adjuscent */
-int rh_attach_region(rh_info_t * info, void *start, int size)
+int rh_attach_region(rh_info_t * info, unsigned long start, int size)
 {
 	rh_block_t *blk;
 	unsigned long s, e, m;
 	int r;

 	/* The region must be aligned */
-	s = (unsigned long)start;
+	s = start;
 	e = s + size;
 	m = info->alignment - 1;

@@ -337,9 +337,12 @@ int rh_attach_region(rh_info_t * info, void *start, int size)
 	/* Round end down */
 	e = e & ~m;

+	if (IS_ERR_VALUE(e) || (e < s))
+		return -ERANGE;
+
 	/* Take final values */
-	start = (void *)s;
-	size = (int)(e - s);
+	start = s;
+	size = e - s;

 	/* Grow the blocks, if needed */
 	r = assure_empty(info, 1);
@@ -357,7 +360,7 @@ int rh_attach_region(rh_info_t * info, void *start, int size)
 }

 /* Detatch given address range, splits free block if needed. */
-void *rh_detach_region(rh_info_t * info, void *start, int size)
+unsigned long rh_detach_region(rh_info_t * info, unsigned long start, int size)
 {
 	struct list_head *l;
 	rh_block_t *blk, *newblk;
@@ -365,10 +368,10 @@ void *rh_detach_region(rh_info_t * info, void *start, int size)

 	/* Validate size */
 	if (size <= 0)
-		return ERR_PTR(-EINVAL);
+		return (unsigned long) -EINVAL;

 	/* The region must be aligned */
-	s = (unsigned long)start;
+	s = start;
 	e = s + size;
 	m = info->alignment - 1;

@@ -379,34 +382,34 @@ void *rh_detach_region(rh_info_t * info, void *start, int size)
 	e = e & ~m;

 	if (assure_empty(info, 1) < 0)
-		return ERR_PTR(-ENOMEM);
+		return (unsigned long) -ENOMEM;

 	blk = NULL;
 	list_for_each(l, &info->free_list) {
 		blk = list_entry(l, rh_block_t, list);
 		/* The range must lie entirely inside one free block */
-		bs = (unsigned long)blk->start;
-		be = (unsigned long)blk->start + blk->size;
+		bs = blk->start;
+		be = blk->start + blk->size;
 		if (s >= bs && e <= be)
 			break;
 		blk = NULL;
 	}

 	if (blk == NULL)
-		return ERR_PTR(-ENOMEM);
+		return (unsigned long) -ENOMEM;

 	/* Perfect fit */
 	if (bs == s && be == e) {
 		/* Delete from free list, release slot */
 		list_del(&blk->list);
 		release_slot(info, blk);
-		return (void *)s;
+		return s;
 	}

 	/* blk still in free list, with updated start and/or size */
 	if (bs == s || be == e) {
 		if (bs == s)
-			blk->start = (int8_t *)blk->start + size;
+			blk->start += size;
 		blk->size -= size;

 	} else {
@@ -415,31 +418,31 @@ void *rh_detach_region(rh_info_t * info, void *start, int size)

 		/* the back free fragment */
 		newblk = get_slot(info);
-		newblk->start = (void *)e;
+		newblk->start = e;
 		newblk->size = be - e;

 		list_add(&newblk->list, &blk->list);
 	}

-	return (void *)s;
+	return s;
 }

-void *rh_alloc(rh_info_t * info, int size, const char *owner)
+unsigned long rh_alloc(rh_info_t * info, int size, const char *owner)
 {
 	struct list_head *l;
 	rh_block_t *blk;
 	rh_block_t *newblk;
-	void *start;
+	unsigned long start;

 	/* Validate size */
 	if (size <= 0)
-		return ERR_PTR(-EINVAL);
+		return (unsigned long) -EINVAL;

 	/* Align to configured alignment */
 	size = (size + (info->alignment - 1)) & ~(info->alignment - 1);

 	if (assure_empty(info, 1) < 0)
-		return ERR_PTR(-ENOMEM);
+		return (unsigned long) -ENOMEM;

 	blk = NULL;
 	list_for_each(l, &info->free_list) {
@@ -450,7 +453,7 @@ void *rh_alloc(rh_info_t * info, int size, const char *owner)
 	}

 	if (blk == NULL)
-		return ERR_PTR(-ENOMEM);
+		return (unsigned long) -ENOMEM;

 	/* Just fits */
 	if (blk->size == size) {
@@ -470,7 +473,7 @@ void *rh_alloc(rh_info_t * info, int size, const char *owner)
 	newblk->owner = owner;

 	/* blk still in free list, with updated start, size */
-	blk->start = (int8_t *)blk->start + size;
+	blk->start += size;
 	blk->size -= size;

 	start = newblk->start;
@@ -481,18 +484,18 @@ void *rh_alloc(rh_info_t * info, int size, const char *owner)
 }

 /* allocate at precisely the given address */
-void *rh_alloc_fixed(rh_info_t * info, void *start, int size, const char *owner)
+unsigned long rh_alloc_fixed(rh_info_t * info, unsigned long start, int size, const char *owner)
 {
 	struct list_head *l;
 	rh_block_t *blk, *newblk1, *newblk2;
-	unsigned long s, e, m, bs, be;
+	unsigned long s, e, m, bs=0, be=0;

 	/* Validate size */
 	if (size <= 0)
-		return ERR_PTR(-EINVAL);
+		return (unsigned long) -EINVAL;

 	/* The region must be aligned */
-	s = (unsigned long)start;
+	s = start;
 	e = s + size;
 	m = info->alignment - 1;

@@ -503,20 +506,20 @@ void *rh_alloc_fixed(rh_info_t * info, void *start, int size, const char *owner)
 	e = e & ~m;

 	if (assure_empty(info, 2) < 0)
-		return ERR_PTR(-ENOMEM);
+		return (unsigned long) -ENOMEM;

 	blk = NULL;
 	list_for_each(l, &info->free_list) {
 		blk = list_entry(l, rh_block_t, list);
 		/* The range must lie entirely inside one free block */
-		bs = (unsigned long)blk->start;
-		be = (unsigned long)blk->start + blk->size;
+		bs = blk->start;
+		be = blk->start + blk->size;
 		if (s >= bs && e <= be)
 			break;
 	}

 	if (blk == NULL)
-		return ERR_PTR(-ENOMEM);
+		return (unsigned long) -ENOMEM;

 	/* Perfect fit */
 	if (bs == s && be == e) {
@@ -534,7 +537,7 @@ void *rh_alloc_fixed(rh_info_t * info, void *start, int size, const char *owner)
 	/* blk still in free list, with updated start and/or size */
 	if (bs == s || be == e) {
 		if (bs == s)
-			blk->start = (int8_t *)blk->start + size;
+			blk->start += size;
 		blk->size -= size;

 	} else {
@@ -543,14 +546,14 @@ void *rh_alloc_fixed(rh_info_t * info, void *start, int size, const char *owner)

 		/* The back free fragment */
 		newblk2 = get_slot(info);
-		newblk2->start = (void *)e;
+		newblk2->start = e;
 		newblk2->size = be - e;

 		list_add(&newblk2->list, &blk->list);
 	}

 	newblk1 = get_slot(info);
-	newblk1->start = (void *)s;
+	newblk1->start = s;
 	newblk1->size = e - s;
 	newblk1->owner = owner;

@@ -560,7 +563,7 @@ void *rh_alloc_fixed(rh_info_t * info, void *start, int size, const char *owner)
 	return start;
 }

-int rh_free(rh_info_t * info, void *start)
+int rh_free(rh_info_t * info, unsigned long start)
 {
 	rh_block_t *blk, *blk2;
 	struct list_head *l;
@@ -625,7 +628,7 @@ int rh_get_stats(rh_info_t * info, int what, int max_stats, rh_stats_t * stats)
 	return nr;
 }

-int rh_set_owner(rh_info_t * info, void *start, const char *owner)
+int rh_set_owner(rh_info_t * info, unsigned long start, const char *owner)
 {
 	rh_block_t *blk, *blk2;
 	struct list_head *l;
@@ -667,8 +670,8 @@ void rh_dump(rh_info_t * info)
 		nr = maxnr;
 	for (i = 0; i < nr; i++)
 		printk(KERN_INFO
-		       "    0x%p-0x%p (%u)\n",
-		       st[i].start, (int8_t *) st[i].start + st[i].size,
+		       "    0x%lx-0x%lx (%u)\n",
+		       st[i].start, st[i].start + st[i].size,
 		       st[i].size);
 	printk(KERN_INFO "\n");

@@ -678,8 +681,8 @@ void rh_dump(rh_info_t * info)
 		nr = maxnr;
 	for (i = 0; i < nr; i++)
 		printk(KERN_INFO
-		       "    0x%p-0x%p (%u) %s\n",
-		       st[i].start, (int8_t *) st[i].start + st[i].size,
+		       "    0x%lx-0x%lx (%u) %s\n",
+		       st[i].start, st[i].start + st[i].size,
 		       st[i].size, st[i].owner != NULL ? st[i].owner : "");
 	printk(KERN_INFO "\n");
 }
@@ -687,6 +690,6 @@ void rh_dump(rh_info_t * info)
 void rh_dump_blk(rh_info_t * info, rh_block_t * blk)
 {
 	printk(KERN_INFO
-	       "blk @0x%p: 0x%p-0x%p (%u)\n",
-	       blk, blk->start, (int8_t *) blk->start + blk->size, blk->size);
+	       "blk @0x%p: 0x%lx-0x%lx (%u)\n",
+	       blk, blk->start, blk->start + blk->size, blk->size);
 }
diff --git a/arch/ppc/syslib/cpm2_common.c b/arch/ppc/syslib/cpm2_common.c
index cbac44b..6cd859d 100644
--- a/arch/ppc/syslib/cpm2_common.c
+++ b/arch/ppc/syslib/cpm2_common.c
@@ -136,15 +136,14 @@ static void cpm2_dpinit(void)
 	 * varies with the processor and the microcode patches activated.
 	 * But the following should be at least safe.
 	 */
-	rh_attach_region(&cpm_dpmem_info, (void *)CPM_DATAONLY_BASE,
-			CPM_DATAONLY_SIZE);
+	rh_attach_region(&cpm_dpmem_info, CPM_DATAONLY_BASE, CPM_DATAONLY_SIZE);
 }

 /* This function returns an index into the DPRAM area.
  */
-uint cpm_dpalloc(uint size, uint align)
+unsigned long cpm_dpalloc(uint size, uint align)
 {
-	void *start;
+	unsigned long start;
 	unsigned long flags;

 	spin_lock_irqsave(&cpm_dpmem_lock, flags);
@@ -152,17 +151,17 @@ uint cpm_dpalloc(uint size, uint align)
 	start = rh_alloc(&cpm_dpmem_info, size, "commproc");
 	spin_unlock_irqrestore(&cpm_dpmem_lock, flags);

-	return (uint)start;
+	return start;
 }
 EXPORT_SYMBOL(cpm_dpalloc);

-int cpm_dpfree(uint offset)
+int cpm_dpfree(unsigned long offset)
 {
 	int ret;
 	unsigned long flags;

 	spin_lock_irqsave(&cpm_dpmem_lock, flags);
-	ret = rh_free(&cpm_dpmem_info, (void *)offset);
+	ret = rh_free(&cpm_dpmem_info, offset);
 	spin_unlock_irqrestore(&cpm_dpmem_lock, flags);

 	return ret;
@@ -170,17 +169,17 @@ int cpm_dpfree(uint offset)
 EXPORT_SYMBOL(cpm_dpfree);

 /* not sure if this is ever needed */
-uint cpm_dpalloc_fixed(uint offset, uint size, uint align)
+unsigned long cpm_dpalloc_fixed(unsigned long offset, uint size, uint align)
 {
-	void *start;
+	unsigned long start;
 	unsigned long flags;

 	spin_lock_irqsave(&cpm_dpmem_lock, flags);
 	cpm_dpmem_info.alignment = align;
-	start = rh_alloc_fixed(&cpm_dpmem_info, (void *)offset, size, "commproc");
+	start = rh_alloc_fixed(&cpm_dpmem_info, offset, size, "commproc");
 	spin_unlock_irqrestore(&cpm_dpmem_lock, flags);

-	return (uint)start;
+	return start;
 }
 EXPORT_SYMBOL(cpm_dpalloc_fixed);

@@ -190,7 +189,7 @@ void cpm_dpdump(void)
 }
 EXPORT_SYMBOL(cpm_dpdump);

-void *cpm_dpram_addr(uint offset)
+void *cpm_dpram_addr(unsigned long offset)
 {
 	return (void *)&cpm2_immr->im_dprambase[offset];
 }
diff --git a/drivers/net/fs_enet/mac-scc.c b/drivers/net/fs_enet/mac-scc.c
index d0f2898..7540966 100644
--- a/drivers/net/fs_enet/mac-scc.c
+++ b/drivers/net/fs_enet/mac-scc.c
@@ -167,7 +167,7 @@ static int allocate_bd(struct net_device *dev)

 	fep->ring_mem_addr = cpm_dpalloc((fpi->tx_ring + fpi->rx_ring) *
 					 sizeof(cbd_t), 8);
-	if (IS_DPERR(fep->ring_mem_addr))
+	if (IS_ERR_VALUE(fep->ring_mem_addr))
 		return -ENOMEM;

 	fep->ring_base = cpm_dpram_addr(fep->ring_mem_addr);
diff --git a/drivers/net/ucc_geth.c b/drivers/net/ucc_geth.c
index d7aff81..0f66765 100644
--- a/drivers/net/ucc_geth.c
+++ b/drivers/net/ucc_geth.c
@@ -293,7 +293,7 @@ static int fill_init_enet_entries(struct ucc_geth_private *ugeth,
 		else {
 			init_enet_offset =
 			    qe_muram_alloc(thread_size, thread_alignment);
-			if (IS_MURAM_ERR(init_enet_offset)) {
+			if (IS_ERR_VALUE(init_enet_offset)) {
 				ugeth_err
 		("fill_init_enet_entries: Can not allocate DPRAM memory.");
 				qe_put_snum((u8) snum);
@@ -2594,7 +2594,7 @@ static int ucc_geth_startup(struct ucc_geth_private *ugeth)
 			ugeth->tx_bd_ring_offset[j] =
 			    qe_muram_alloc(length,
 					   UCC_GETH_TX_BD_RING_ALIGNMENT);
-			if (!IS_MURAM_ERR(ugeth->tx_bd_ring_offset[j]))
+			if (!IS_ERR_VALUE(ugeth->tx_bd_ring_offset[j]))
 				ugeth->p_tx_bd_ring[j] =
 				    (u8 *) qe_muram_addr(ugeth->
 							 tx_bd_ring_offset[j]);
@@ -2629,7 +2629,7 @@ static int ucc_geth_startup(struct ucc_geth_private *ugeth)
 			ugeth->rx_bd_ring_offset[j] =
 			    qe_muram_alloc(length,
 					   UCC_GETH_RX_BD_RING_ALIGNMENT);
-			if (!IS_MURAM_ERR(ugeth->rx_bd_ring_offset[j]))
+			if (!IS_ERR_VALUE(ugeth->rx_bd_ring_offset[j]))
 				ugeth->p_rx_bd_ring[j] =
 				    (u8 *) qe_muram_addr(ugeth->
 							 rx_bd_ring_offset[j]);
@@ -2713,7 +2713,7 @@ static int ucc_geth_startup(struct ucc_geth_private *ugeth)
 	ugeth->tx_glbl_pram_offset =
 	    qe_muram_alloc(sizeof(struct ucc_geth_tx_global_pram),
 			   UCC_GETH_TX_GLOBAL_PRAM_ALIGNMENT);
-	if (IS_MURAM_ERR(ugeth->tx_glbl_pram_offset)) {
+	if (IS_ERR_VALUE(ugeth->tx_glbl_pram_offset)) {
 		ugeth_err
 		    ("%s: Can not allocate DPRAM memory for p_tx_glbl_pram.",
 		     __FUNCTION__);
@@ -2735,7 +2735,7 @@ static int ucc_geth_startup(struct ucc_geth_private *ugeth)
 			   sizeof(struct ucc_geth_thread_data_tx) +
 			   32 * (numThreadsTxNumerical == 1),
 			   UCC_GETH_THREAD_DATA_ALIGNMENT);
-	if (IS_MURAM_ERR(ugeth->thread_dat_tx_offset)) {
+	if (IS_ERR_VALUE(ugeth->thread_dat_tx_offset)) {
 		ugeth_err
 		    ("%s: Can not allocate DPRAM memory for p_thread_data_tx.",
 		     __FUNCTION__);
@@ -2763,7 +2763,7 @@ static int ucc_geth_startup(struct ucc_geth_private *ugeth)
 	    qe_muram_alloc(ug_info->numQueuesTx *
 			   sizeof(struct ucc_geth_send_queue_qd),
 			   UCC_GETH_SEND_QUEUE_QUEUE_DESCRIPTOR_ALIGNMENT);
-	if (IS_MURAM_ERR(ugeth->send_q_mem_reg_offset)) {
+	if (IS_ERR_VALUE(ugeth->send_q_mem_reg_offset)) {
 		ugeth_err
 		    ("%s: Can not allocate DPRAM memory for p_send_q_mem_reg.",
 		     __FUNCTION__);
@@ -2806,7 +2806,7 @@ static int ucc_geth_startup(struct ucc_geth_private *ugeth)
 		ugeth->scheduler_offset =
 		    qe_muram_alloc(sizeof(struct ucc_geth_scheduler),
 				   UCC_GETH_SCHEDULER_ALIGNMENT);
-		if (IS_MURAM_ERR(ugeth->scheduler_offset)) {
+		if (IS_ERR_VALUE(ugeth->scheduler_offset)) {
 			ugeth_err
 			 ("%s: Can not allocate DPRAM memory for p_scheduler.",
 			     __FUNCTION__);
@@ -2854,7 +2854,7 @@ static int ucc_geth_startup(struct ucc_geth_private *ugeth)
 		    qe_muram_alloc(sizeof
 				   (struct ucc_geth_tx_firmware_statistics_pram),
 				   UCC_GETH_TX_STATISTICS_ALIGNMENT);
-		if (IS_MURAM_ERR(ugeth->tx_fw_statistics_pram_offset)) {
+		if (IS_ERR_VALUE(ugeth->tx_fw_statistics_pram_offset)) {
 			ugeth_err
 			    ("%s: Can not allocate DPRAM memory for"
 				" p_tx_fw_statistics_pram.", __FUNCTION__);
@@ -2893,7 +2893,7 @@ static int ucc_geth_startup(struct ucc_geth_private *ugeth)
 	ugeth->rx_glbl_pram_offset =
 	    qe_muram_alloc(sizeof(struct ucc_geth_rx_global_pram),
 			   UCC_GETH_RX_GLOBAL_PRAM_ALIGNMENT);
-	if (IS_MURAM_ERR(ugeth->rx_glbl_pram_offset)) {
+	if (IS_ERR_VALUE(ugeth->rx_glbl_pram_offset)) {
 		ugeth_err
 		    ("%s: Can not allocate DPRAM memory for p_rx_glbl_pram.",
 		     __FUNCTION__);
@@ -2914,7 +2914,7 @@ static int ucc_geth_startup(struct ucc_geth_private *ugeth)
 	    qe_muram_alloc(numThreadsRxNumerical *
 			   sizeof(struct ucc_geth_thread_data_rx),
 			   UCC_GETH_THREAD_DATA_ALIGNMENT);
-	if (IS_MURAM_ERR(ugeth->thread_dat_rx_offset)) {
+	if (IS_ERR_VALUE(ugeth->thread_dat_rx_offset)) {
 		ugeth_err
 		    ("%s: Can not allocate DPRAM memory for p_thread_data_rx.",
 		     __FUNCTION__);
@@ -2937,7 +2937,7 @@ static int ucc_geth_startup(struct ucc_geth_private *ugeth)
 		    qe_muram_alloc(sizeof
 				   (struct ucc_geth_rx_firmware_statistics_pram),
 				   UCC_GETH_RX_STATISTICS_ALIGNMENT);
-		if (IS_MURAM_ERR(ugeth->rx_fw_statistics_pram_offset)) {
+		if (IS_ERR_VALUE(ugeth->rx_fw_statistics_pram_offset)) {
 			ugeth_err
 				("%s: Can not allocate DPRAM memory for"
 				" p_rx_fw_statistics_pram.", __FUNCTION__);
@@ -2959,7 +2959,7 @@ static int ucc_geth_startup(struct ucc_geth_private *ugeth)
 	    qe_muram_alloc(ug_info->numQueuesRx *
 			   sizeof(struct ucc_geth_rx_interrupt_coalescing_entry)
 			   + 4, UCC_GETH_RX_INTERRUPT_COALESCING_ALIGNMENT);
-	if (IS_MURAM_ERR(ugeth->rx_irq_coalescing_tbl_offset)) {
+	if (IS_ERR_VALUE(ugeth->rx_irq_coalescing_tbl_offset)) {
 		ugeth_err
 		    ("%s: Can not allocate DPRAM memory for"
 			" p_rx_irq_coalescing_tbl.", __FUNCTION__);
@@ -3027,7 +3027,7 @@ static int ucc_geth_startup(struct ucc_geth_private *ugeth)
 			   (sizeof(struct ucc_geth_rx_bd_queues_entry) +
 			    sizeof(struct ucc_geth_rx_prefetched_bds)),
 			   UCC_GETH_RX_BD_QUEUES_ALIGNMENT);
-	if (IS_MURAM_ERR(ugeth->rx_bd_qs_tbl_offset)) {
+	if (IS_ERR_VALUE(ugeth->rx_bd_qs_tbl_offset)) {
 		ugeth_err
 		    ("%s: Can not allocate DPRAM memory for p_rx_bd_qs_tbl.",
 		     __FUNCTION__);
@@ -3116,7 +3116,7 @@ static int ucc_geth_startup(struct ucc_geth_private *ugeth)
 		ugeth->exf_glbl_param_offset =
 		    qe_muram_alloc(sizeof(struct ucc_geth_exf_global_pram),
 		UCC_GETH_RX_EXTENDED_FILTERING_GLOBAL_PARAMETERS_ALIGNMENT);
-		if (IS_MURAM_ERR(ugeth->exf_glbl_param_offset)) {
+		if (IS_ERR_VALUE(ugeth->exf_glbl_param_offset)) {
 			ugeth_err
 				("%s: Can not allocate DPRAM memory for"
 				" p_exf_glbl_param.", __FUNCTION__);
@@ -3258,7 +3258,7 @@ static int ucc_geth_startup(struct ucc_geth_private *ugeth)

 	/* Allocate InitEnet command parameter structure */
 	init_enet_pram_offset = qe_muram_alloc(sizeof(struct ucc_geth_init_pram), 4);
-	if (IS_MURAM_ERR(init_enet_pram_offset)) {
+	if (IS_ERR_VALUE(init_enet_pram_offset)) {
 		ugeth_err
 		    ("%s: Can not allocate DPRAM memory for p_init_enet_pram.",
 		     __FUNCTION__);
diff --git a/drivers/serial/cpm_uart/cpm_uart_cpm1.c b/drivers/serial/cpm_uart/cpm_uart_cpm1.c
index 925fb60..bb7afe9 100644
--- a/drivers/serial/cpm_uart/cpm_uart_cpm1.c
+++ b/drivers/serial/cpm_uart/cpm_uart_cpm1.c
@@ -125,7 +125,7 @@ int cpm_uart_allocbuf(struct uart_cpm_port *pinfo, unsigned int is_con)
 {
 	int dpmemsz, memsz;
 	u8 *dp_mem;
-	uint dp_offset;
+	unsigned long dp_offset;
 	u8 *mem_addr;
 	dma_addr_t dma_addr = 0;

@@ -133,7 +133,7 @@ int cpm_uart_allocbuf(struct uart_cpm_port *pinfo, unsigned int is_con)

 	dpmemsz = sizeof(cbd_t) * (pinfo->rx_nrfifos + pinfo->tx_nrfifos);
 	dp_offset = cpm_dpalloc(dpmemsz, 8);
-	if (IS_DPERR(dp_offset)) {
+	if (IS_ERR_VALUE(dp_offset)) {
 		printk(KERN_ERR
 		       "cpm_uart_cpm1.c: could not allocate buffer descriptors\n");
 		return -ENOMEM;
diff --git a/drivers/serial/cpm_uart/cpm_uart_cpm2.c b/drivers/serial/cpm_uart/cpm_uart_cpm2.c
index fa45599..1eeea36 100644
--- a/drivers/serial/cpm_uart/cpm_uart_cpm2.c
+++ b/drivers/serial/cpm_uart/cpm_uart_cpm2.c
@@ -222,7 +222,7 @@ int cpm_uart_allocbuf(struct uart_cpm_port *pinfo, unsigned int is_con)
 {
 	int dpmemsz, memsz;
 	u8 *dp_mem;
-	uint dp_offset;
+	unsigned long dp_offset;
 	u8 *mem_addr;
 	dma_addr_t dma_addr = 0;

@@ -230,7 +230,7 @@ int cpm_uart_allocbuf(struct uart_cpm_port *pinfo, unsigned int is_con)

 	dpmemsz = sizeof(cbd_t) * (pinfo->rx_nrfifos + pinfo->tx_nrfifos);
 	dp_offset = cpm_dpalloc(dpmemsz, 8);
-	if (IS_DPERR(dp_offset)) {
+	if (IS_ERR_VALUE(dp_offset)) {
 		printk(KERN_ERR
 		       "cpm_uart_cpm.c: could not allocate buffer descriptors\n");
 		return -ENOMEM;
diff --git a/include/asm-powerpc/qe.h b/include/asm-powerpc/qe.h
index a62168e..9d304b1 100644
--- a/include/asm-powerpc/qe.h
+++ b/include/asm-powerpc/qe.h
@@ -38,11 +38,11 @@ int qe_issue_cmd(u32 cmd, u32 device, u8 mcn_protocol, u32 cmd_input);
 void qe_setbrg(u32 brg, u32 rate);
 int qe_get_snum(void);
 void qe_put_snum(u8 snum);
-u32 qe_muram_alloc(u32 size, u32 align);
-int qe_muram_free(u32 offset);
-u32 qe_muram_alloc_fixed(u32 offset, u32 size);
+unsigned long qe_muram_alloc(int size, int align);
+int qe_muram_free(unsigned long offset);
+unsigned long qe_muram_alloc_fixed(unsigned long offset, int size);
 void qe_muram_dump(void);
-void *qe_muram_addr(u32 offset);
+void *qe_muram_addr(unsigned long offset);

 /* Buffer descriptors */
 struct qe_bd {
@@ -448,10 +448,5 @@ struct ucc_slow_pram {
 #define UCC_FAST_FUNCTION_CODE_DTB_LCL	0x02
 #define UCC_FAST_FUNCTION_CODE_BDB_LCL	0x01

-static inline long IS_MURAM_ERR(const u32 offset)
-{
-	return offset > (u32) - 1000L;
-}
-
 #endif /* __KERNEL__ */
 #endif /* _ASM_POWERPC_QE_H */
diff --git a/include/asm-ppc/commproc.h b/include/asm-ppc/commproc.h
index 4f99df1..3972487 100644
--- a/include/asm-ppc/commproc.h
+++ b/include/asm-ppc/commproc.h
@@ -63,20 +63,15 @@
 #define CPM_DATAONLY_SIZE	((uint)0x0700)
 #define CPM_DP_NOSPACE		((uint)0x7fffffff)

-static inline long IS_DPERR(const uint offset)
-{
-	return (uint)offset > (uint)-1000L;
-}
-
 /* Export the base address of the communication processor registers
  * and dual port ram.
  */
 extern	cpm8xx_t	*cpmp;		/* Pointer to comm processor */
-extern uint cpm_dpalloc(uint size, uint align);
-extern int cpm_dpfree(uint offset);
-extern uint cpm_dpalloc_fixed(uint offset, uint size, uint align);
+extern unsigned long cpm_dpalloc(uint size, uint align);
+extern int cpm_dpfree(unsigned long offset);
+extern unsigned long cpm_dpalloc_fixed(unsigned long offset, uint size, uint align);
 extern void cpm_dpdump(void);
-extern void *cpm_dpram_addr(uint offset);
+extern void *cpm_dpram_addr(unsigned long offset);
 extern uint cpm_dpram_phys(u8* addr);
 extern void cpm_setbrg(uint brg, uint rate);

diff --git a/include/asm-ppc/cpm2.h b/include/asm-ppc/cpm2.h
index 220cc2d..12a2860 100644
--- a/include/asm-ppc/cpm2.h
+++ b/include/asm-ppc/cpm2.h
@@ -104,21 +104,16 @@
  */
 #define NUM_CPM_HOST_PAGES	2

-static inline long IS_DPERR(const uint offset)
-{
-	return (uint)offset > (uint)-1000L;
-}
-
 /* Export the base address of the communication processor registers
  * and dual port ram.
  */
 extern		cpm_cpm2_t	*cpmp;	 /* Pointer to comm processor */

-extern uint cpm_dpalloc(uint size, uint align);
-extern int cpm_dpfree(uint offset);
-extern uint cpm_dpalloc_fixed(uint offset, uint size, uint align);
+extern unsigned long cpm_dpalloc(uint size, uint align);
+extern int cpm_dpfree(unsigned long offset);
+extern unsigned long cpm_dpalloc_fixed(unsigned long offset, uint size, uint align);
 extern void cpm_dpdump(void);
-extern void *cpm_dpram_addr(uint offset);
+extern void *cpm_dpram_addr(unsigned long offset);
 extern void cpm_setbrg(uint brg, uint rate);
 extern void cpm2_fastbrg(uint brg, uint rate, int div16);
 extern void cpm2_reset(void);
diff --git a/include/asm-ppc/rheap.h b/include/asm-ppc/rheap.h
index 39a10d8..1723817 100644
--- a/include/asm-ppc/rheap.h
+++ b/include/asm-ppc/rheap.h
@@ -18,7 +18,7 @@

 typedef struct _rh_block {
 	struct list_head list;
-	void *start;
+	unsigned long start;
 	int size;
 	const char *owner;
 } rh_block_t;
@@ -37,8 +37,8 @@ typedef struct _rh_info {
 #define RHIF_STATIC_INFO	0x1
 #define RHIF_STATIC_BLOCK	0x2

-typedef struct rh_stats_t {
-	void *start;
+typedef struct _rh_stats {
+	unsigned long start;
 	int size;
 	const char *owner;
 } rh_stats_t;
@@ -57,24 +57,24 @@ extern void rh_init(rh_info_t * info, unsigned int alignment, int max_blocks,
 		    rh_block_t * block);

 /* Attach a free region to manage */
-extern int rh_attach_region(rh_info_t * info, void *start, int size);
+extern int rh_attach_region(rh_info_t * info, unsigned long start, int size);

 /* Detach a free region */
-extern void *rh_detach_region(rh_info_t * info, void *start, int size);
+extern unsigned long rh_detach_region(rh_info_t * info, unsigned long start, int size);

 /* Allocate the given size from the remote heap (with alignment) */
-extern void *rh_alloc_align(rh_info_t * info, int size, int alignment,
+extern unsigned long rh_alloc_align(rh_info_t * info, int size, int alignment,
 		const char *owner);

 /* Allocate the given size from the remote heap */
-extern void *rh_alloc(rh_info_t * info, int size, const char *owner);
+extern unsigned long rh_alloc(rh_info_t * info, int size, const char *owner);

 /* Allocate the given size from the given address */
-extern void *rh_alloc_fixed(rh_info_t * info, void *start, int size,
+extern unsigned long rh_alloc_fixed(rh_info_t * info, unsigned long start, int size,
 			    const char *owner);

 /* Free the allocated area */
-extern int rh_free(rh_info_t * info, void *start);
+extern int rh_free(rh_info_t * info, unsigned long start);

 /* Get stats for debugging purposes */
 extern int rh_get_stats(rh_info_t * info, int what, int max_stats,
@@ -84,6 +84,6 @@ extern int rh_get_stats(rh_info_t * info, int what, int max_stats,
 extern void rh_dump(rh_info_t * info);

 /* Set owner of taken block */
-extern int rh_set_owner(rh_info_t * info, void *start, const char *owner);
+extern int rh_set_owner(rh_info_t * info, unsigned long start, const char *owner);

 #endif				/* __ASM_PPC_RHEAP_H__ */
--
1.5.0.2.260.g2eb065

^ permalink raw reply related

* Re: [PATCH] Performance Stats: Kernel patch
From: Andrew Morton @ 2007-05-08 19:32 UTC (permalink / raw)
  To: Maxim Uvarov; +Cc: linuxppc-dev, wli, pavel, dada1
In-Reply-To: <20070508162650.704.83752.stgit@localhost.localdomain>

On Tue, 08 May 2007 16:26:51 +0000
Maxim Uvarov <muvarov@ru.mvista.com> wrote:

> From: Maxim Uvarov <muvarov@ru.mvista.com>
> To: Andrew Morton <akpm@linux-foundation.org>
> Cc: pavel@ucw.cz
> Cc: linuxppc-dev@ozlabs.org
> Cc: wli@holomorphy.com
> Cc: dada1@cosmosbay.com
> Cc: pavel@ucw.cz

Strange that linux-ppc was the only mailing list you copied?

> Subject: [PATCH] Performance Stats: Kernel patch
> Date: Tue, 08 May 2007 16:26:51 +0000
> User-Agent: StGIT/0.12.1
> 
> 
> Patch makes available to the user the following
> task and process performance statistics:
> 	* Involuntary Context Switches (task_struct->nivcsw)
> 	* Voluntary Context Switches (task_struct->nvcsw)
> 	* Number of system calls (added new counter
> 	  thread_info->sysall_count)
> 	           
> Statistics information is available from:
>         1. taskstats interface (Documentation/accounting/)
> 	2. /proc/PID/status (task only).
> 
> This data is useful for detecting hyperactivity
> patterns between processes.

syscall entry is a super-hotpath and there will be a developer revolt
if we go adding an incl to that path, sorry.

(Did that incl also cover the int 80 entry?)

^ permalink raw reply

* Current powerpc.git build failures
From: Olof Johansson @ 2007-05-08 19:17 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: paulus, jdl, arnd

Hi,

Just for fun I tried building all powerpc defconfigs. Fallout as below.


powerpc.cell_defconfig:
ERROR: ".cpufreq_set_policy" [arch/powerpc/platforms/cell/cbe_cpufreq.ko] undefined!
(Should cell move to similar Kconfig options as the other platforms for cpufreq?)

powerpc.mpc8641_hpcn_defconfig:
In file included from include/asm-generic/pgtable-nopmd.h:6,
                 from include/asm/pgtable-ppc32.h:4,
                 from include/asm/pgtable.h:8,
                 from arch/powerpc/platforms/86xx/mpc86xx_smp.c:18:
include/asm-generic/pgtable-nopud.h:13: error: expected specifier-qualifier-list before 'pgd_t'
include/asm-generic/pgtable-nopud.h:25: error: expected ')' before 'pgd'
include/asm-generic/pgtable-nopud.h:26: error: expected ')' before 'pgd'
include/asm-generic/pgtable-nopud.h:27: error: expected ')' before 'pgd'
include/asm-generic/pgtable-nopud.h:28: error: expected ')' before '*' token
include/asm-generic/pgtable-nopud.h:38: error: expected ')' before '*' token
  CC      init/calibrate.o
In file included from include/asm/pgtable.h:12,
                 from arch/powerpc/platforms/86xx/mpc86xx_smp.c:18:
include/asm-generic/pgtable.h: In function 'pgd_none_or_clear_bad':
include/asm-generic/pgtable.h:243: warning: implicit declaration of function 'pgd_none'
include/asm-generic/pgtable.h:245: warning: implicit declaration of function 'pgd_bad'
include/asm-generic/pgtable.h: In function 'pmd_none_or_clear_bad':
include/asm-generic/pgtable.h:265: error: 'pud_t' has no member named 'pgd'
include/asm-generic/pgtable.h:267: error: 'pud_t' has no member named 'pgd'
In file included from include/asm/dma-mapping.h:14,
                 from include/linux/dma-mapping.h:34,
                 from include/asm/pci.h:15,
                 from include/linux/pci.h:755,
                 from include/asm-ppc/pci-bridge.h:6,
                 from include/asm/pci-bridge.h:6,
                 from arch/powerpc/platforms/86xx/mpc86xx_smp.c:20:
include/linux/mm.h: In function 'pud_alloc':
include/linux/mm.h:906: warning: implicit declaration of function 'pud_offset'
include/linux/mm.h:906: warning: pointer/integer type mismatch in conditional expression
arch/powerpc/mm/ppc_mmu_32.c: In function 'hash_preload':
arch/powerpc/mm/ppc_mmu_32.c:188: warning: passing argument 1 of 'pmd_offset' from incompatible pointer type
(Maybe this is already fixed by some of the 32-bit mmu patches posted the last few days)

powerpc.mpc866_ads_defconfig:
arch/powerpc/sysdev/mpc8xx_pic.c:98: error: static declaration of 'mpc8xx_pic' follows non-static declaration
arch/powerpc/sysdev/mpc8xx_pic.h:7: error: previous declaration of 'mpc8xx_pic' was here

powerpc.mpc885_ads_defconfig:
arch/powerpc/sysdev/mpc8xx_pic.c:98: error: static declaration of 'mpc8xx_pic' follows non-static declaration
arch/powerpc/sysdev/mpc8xx_pic.h:7: error: previous declaration of 'mpc8xx_pic' was here

powerpc.ppc64_defconfig:
drivers/pci/hotplug/rpadlpar_sysfs.c:132: error: unknown field 'subsys' specified in initializer
drivers/pci/hotplug/rpadlpar_sysfs.c:132: warning: initialization from incompatible pointer type

powerpc.pseries_defconfig:
drivers/net/ehea/ehea_main.c: In function 'ehea_hash_skb':
drivers/net/ehea/ehea_main.c:1806: error: 'struct sk_buff' has no member named 'nh'
drivers/net/ehea/ehea_main.c:1807: error: 'struct sk_buff' has no member named 'nh'
drivers/net/ehea/ehea_main.c:1807: error: 'struct sk_buff' has no member named 'nh'
drivers/net/ehea/ehea_main.c:1809: error: 'struct sk_buff' has no member named 'nh'
(I believe a fix for this is already on it's way in through jgarzik)

^ permalink raw reply

* Re: PowerPC 440EPx Sequoia port
From: Josh Boyer @ 2007-05-08 18:57 UTC (permalink / raw)
  To: Valentine Barshak; +Cc: linuxppc-dev
In-Reply-To: <4640A5CB.1050006@ru.mvista.com>

On Tue, 2007-05-08 at 20:31 +0400, Valentine Barshak wrote:
> Hi All!
> I'm working on the PowerPC 440EPx Sequoia port. There've been patches by 
> David Gibson for Ebony support.
> Does anyone know if anybody is working on the Sequoia 440EPx support?

Not that I'm aware of.  I have some patches for Bamboo that will
eventually make their way to the list.

josh

^ permalink raw reply

* Re: [PATCH 1/3] [POWERPC] 8xx: mpc885ads pcmcia support
From: Vitaly Bordug @ 2007-05-08 17:31 UTC (permalink / raw)
  To: Kumar Gala; +Cc: linuxppc-dev, linux-pcmcia, linux-kernel
In-Reply-To: <774F0168-051E-4C6B-9292-8EE731E6D889@kernel.crashing.org>

On Tue, 8 May 2007 09:04:22 -0500
Kumar Gala wrote:

> 
> On May 8, 2007, at 4:50 AM, Vitaly Bordug wrote:
> 
> >
> > Adds support for PowerQuicc on-chip PCMCIA. The driver is  
> > implemented as
> > of_device, so only arch/powerpc stuff is capable to use it, which
> > now implies only mpc885ads reference board.
> >
> > To cope with the code that should be hooked inside driver, but is  
> > really
> > board specific (like set_voltage), global structure
> > mpc8xx_pcmcia_ops holds necessary function pointers that are filled
> > in the BSP code.
> >
> > Signed-off-by: Vitaly Bordug <vitb@kernel.crashing.org>
> > Acked-by: Arnd Bergmann <arnd@arndb.de>
> > Acked-by: Olof Johansson <olof@lixom.net>
> >
> > ---
> >
> >  arch/powerpc/boot/dts/mpc885ads.dts          |   12 +
> >  arch/powerpc/platforms/8xx/m8xx_setup.c      |    5
> >  arch/powerpc/platforms/8xx/mpc885ads.h       |    8 +
> >  arch/powerpc/platforms/8xx/mpc885ads_setup.c |   72 +++++
> >  arch/powerpc/sysdev/fsl_soc.c                |   13 +
> >  arch/powerpc/sysdev/mpc8xx_pic.h             |    2
> >  drivers/pcmcia/Kconfig                       |    1
> >  drivers/pcmcia/m8xx_pcmcia.c                 |  351 +++++++++++ 
> > +--------------
> >  include/asm-powerpc/mpc8xx.h                 |    4
> >  include/linux/fsl_devices.h                  |    5
> >  10 files changed, 287 insertions(+), 186 deletions(-)
> >
> > diff --git a/arch/powerpc/boot/dts/mpc885ads.dts b/arch/powerpc/ 
> > boot/dts/mpc885ads.dts
> > index 110bf61..0786ac1 100644
> > --- a/arch/powerpc/boot/dts/mpc885ads.dts
> > +++ b/arch/powerpc/boot/dts/mpc885ads.dts
> > @@ -112,6 +112,18 @@
> >  			compatible = "CPM";
> >  		};
> >
> > +		pcmcia@0080 {
> > +			#address-cells = <3>;
> > +			#interrupt-cells = <1>;
> > +			#size-cells = <2>;
> > +			compatible = "fsl,pq-pcmcia";
> 
> should this be fsl,pq1-pcmcia or fsl,8xx-pcmcia?
>

there were a note that eventually fsl may create some 8xx that is not cpm...
I really think pq and pq1 is the same, for pq2, 3 etc number passed explicitly. 
> > +			device_type = "pcmcia";
> > +			reg = <80 80>;
> > +			clock-frequency = <2faf080>;
> 
> is the clock-freq fixed?
> 
gotta check, will follow-up.

> > +			interrupt-parent = <&mpc8xx-pic>;
> > +			interrupts = <d 1>;
> > +		};
> > +
> >  		cpm@ff000000 {
> >  			linux,phandle = <ff000000>;
> >  			#address-cells = <1>;
> > diff --git a/arch/powerpc/platforms/8xx/m8xx_setup.c
> > b/arch/powerpc/ platforms/8xx/m8xx_setup.c
> > index 0901dba..f169355 100644
> > --- a/arch/powerpc/platforms/8xx/m8xx_setup.c
> > +++ b/arch/powerpc/platforms/8xx/m8xx_setup.c
> > @@ -32,6 +32,7 @@
> >  #include <linux/root_dev.h>
> >  #include <linux/time.h>
> >  #include <linux/rtc.h>
> > +#include <linux/fsl_devices.h>
> >
> >  #include <asm/mmu.h>
> >  #include <asm/reg.h>
> > @@ -49,6 +50,10 @@
> >
> >  #include "sysdev/mpc8xx_pic.h"
> >
> > +#ifdef CONFIG_PCMCIA_M8XX
> > +struct mpc8xx_pcmcia_ops m8xx_pcmcia_ops;
> > +#endif
> > +
> >  void m8xx_calibrate_decr(void);
> >  extern void m8xx_wdt_handler_install(bd_t *bp);
> >  extern int cpm_pic_init(void);
> > diff --git a/arch/powerpc/platforms/8xx/mpc885ads.h b/arch/powerpc/ 
> > platforms/8xx/mpc885ads.h
> > index 7c31aec..932b59a 100644
> > --- a/arch/powerpc/platforms/8xx/mpc885ads.h
> > +++ b/arch/powerpc/platforms/8xx/mpc885ads.h
> > @@ -91,5 +91,13 @@
> >  #define SICR_ENET_MASK	((uint)0x00ff0000)
> >  #define SICR_ENET_CLKRT	((uint)0x002c0000)
> >
> > +/*
> > + * Some internal interrupt registers use an 8-bit mask for the  
> > interrupt
> > + * level instead of a number.
> > + */
> > +static inline uint mk_int_int_mask(uint mask) {
> > +	return (1 << (7 - (mask/2)));
> > +}
> 
> would this be better off in sysdev/mpc8xx_pic.h?
> 
hmm, maybe.
> > +
> >  #endif /* __ASM_MPC885ADS_H__ */
> >  #endif /* __KERNEL__ */
> > diff --git a/arch/powerpc/platforms/8xx/mpc885ads_setup.c b/arch/ 
> > powerpc/platforms/8xx/mpc885ads_setup.c
> > index a57b577..80e7214 100644
> > --- a/arch/powerpc/platforms/8xx/mpc885ads_setup.c
> > +++ b/arch/powerpc/platforms/8xx/mpc885ads_setup.c
> > @@ -22,6 +22,7 @@
> >
> >  #include <linux/fs_enet_pd.h>
> >  #include <linux/fs_uart_pd.h>
> > +#include <linux/fsl_devices.h>
> >  #include <linux/mii.h>
> >
> >  #include <asm/delay.h>
> > @@ -51,6 +52,70 @@ static void init_smc1_uart_ioports(struct  
> > fs_uart_platform_info* fpi);
> >  static void init_smc2_uart_ioports(struct fs_uart_platform_info*  
> > fpi);
> >  static void init_scc3_ioports(struct fs_platform_info* ptr);
> >
> > +#ifdef CONFIG_PCMCIA_M8XX
> > +static void pcmcia_hw_setup(int slot, int enable)
> > +{
> > +	unsigned *bcsr_io;
> > +
> > +	bcsr_io = ioremap(BCSR1, sizeof(unsigned long));
> > +	if (enable)
> > +		clrbits32(bcsr_io, BCSR1_PCCEN);
> > +	else
> > +		setbits32(bcsr_io, BCSR1_PCCEN);
> > +
> > +	iounmap(bcsr_io);
> > +}
> > +
> > +static int pcmcia_set_voltage(int slot, int vcc, int vpp)
> > +{
> > +	u32 reg = 0;
> > +	unsigned *bcsr_io;
> > +
> > +	bcsr_io = ioremap(BCSR1, sizeof(unsigned long));
> > +
> > +	switch(vcc) {
> > +	case 0:
> > +		break;
> > +	case 33:
> > +		reg |= BCSR1_PCCVCC0;
> > +		break;
> > +	case 50:
> > +		reg |= BCSR1_PCCVCC1;
> > +		break;
> > +	default:
> > +		return 1;
> > +	}
> > +
> > +	switch(vpp) {
> > +	case 0:
> > +		break;
> > +	case 33:
> > +	case 50:
> > +	if(vcc == vpp)
> > +			reg |= BCSR1_PCCVPP1;
> > +		else
> > +			return 1;
> > +		break;
> > +	case 120:
> > +	if ((vcc == 33) || (vcc == 50))
> > +		reg |= BCSR1_PCCVPP0;
> > +	else
> > +		return 1;
> > +	default:
> > +		return 1;
> > +	}
> > +
> 
> seems like formatting is of (but that could just me my email reader)
> 

darn it, I'll better Lindent this whole file too in 2-nd patch. plenty of whitespace, spacetabs, formatting issues...

> > +	/* first, turn off all power */
> > +	clrbits32(bcsr_io, 0x00610000);
> > +
> > +	/* enable new powersettings */
> > +	setbits32(bcsr_io, reg);
> > +
> > +	iounmap(bcsr_io);
> > +	return 0;
> > +}
> > +#endif
> > +
> >  void __init mpc885ads_board_setup(void)
> >  {
> >  	cpm8xx_t *cp;
> > @@ -115,6 +180,12 @@ void __init mpc885ads_board_setup(void)
> >  	immr_unmap(io_port);
> >
> >  #endif
> > +
> > +#ifdef CONFIG_PCMCIA_M8XX
> > +	/*Set up board specific hook-ups*/
> > +	m8xx_pcmcia_ops.hw_ctrl = pcmcia_hw_setup;
> > +	m8xx_pcmcia_ops.voltage_set = pcmcia_set_voltage;
> > +#endif
> >  }
> >
> >
> > @@ -322,6 +393,7 @@ void init_smc_ioports(struct  
> > fs_uart_platform_info *data)
> >  	}
> >  }
> >
> > +
> 
> extra whitespace?
yes, ok.

[snip]
-- 
Sincerely, Vitaly

^ permalink raw reply

* Re: [PATCH] powerpc: add dts entries to 85xx for EDAC
From: Dave Jiang @ 2007-05-08 17:34 UTC (permalink / raw)
  To: Olof Johansson; +Cc: linuxppc-dev, paulus
In-Reply-To: <20070508034247.GA13409@lixom.net>

Olof Johansson wrote:
> Hi,
> 
>> diff --git a/arch/powerpc/boot/dts/mpc8540ads.dts b/arch/powerpc/boot/dts/mpc8540ads.dts
>> index f261d64..f411bc1 100644
>> --- a/arch/powerpc/boot/dts/mpc8540ads.dts
>> +++ b/arch/powerpc/boot/dts/mpc8540ads.dts
>> @@ -48,6 +48,22 @@
>>  		reg = <e0000000 00100000>;	// CCSRBAR 1M
>>  		bus-frequency = <0>;
>>  
>> +		memory-controller@2000 {
>> +			compatible = "fsl,85xx-memory-controller";
>> +			reg = <2000 1000>;
>> +			interrupt-parent = <&mpic>;
>> +			interrupts = <2 2>;
>> +		};
>> +
>> +		l2-cache-controller@20000 {
>> +			compatible = "fsl,85xx-memory-controller";
> 
> Interesting. Is the programming model really the same for the memory and cache controller?
> 
> 
> -Olof

That's an oops on my part. Thanks for pointing it out.


---

-= Dave =-

^ permalink raw reply

* [PATCH] cpm_uart: cpm_uart_set_termios should take ktermios, not termios
From: Scott Wood @ 2007-05-08 17:19 UTC (permalink / raw)
  To: galak; +Cc: linuxppc-dev

This eliminates some warnings.

Signed-off-by: Scott Wood <scottwood@freescale.com>
---
 drivers/serial/cpm_uart/cpm_uart_core.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/drivers/serial/cpm_uart/cpm_uart_core.c b/drivers/serial/cpm_uart/cpm_uart_core.c
index 7a3b97f..6823b8b 100644
--- a/drivers/serial/cpm_uart/cpm_uart_core.c
+++ b/drivers/serial/cpm_uart/cpm_uart_core.c
@@ -482,7 +482,8 @@ static void cpm_uart_shutdown(struct uart_port *port)
 }
 
 static void cpm_uart_set_termios(struct uart_port *port,
-				 struct termios *termios, struct termios *old)
+                                 struct ktermios *termios,
+                                 struct ktermios *old)
 {
 	int baud;
 	unsigned long flags;
-- 
1.5.0.3

^ permalink raw reply related

* [PATCH] fsl_soc: Make mac_addr const in fs_enet_of_init().
From: Scott Wood @ 2007-05-08 17:15 UTC (permalink / raw)
  To: paulus; +Cc: linuxppc-dev

of_get_mac_address() returns a const pointer, so the result
should be stored in a const pointer.

Signed-off-by: Scott Wood <scottwood@freescale.com>
---
 arch/powerpc/sysdev/fsl_soc.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/powerpc/sysdev/fsl_soc.c b/arch/powerpc/sysdev/fsl_soc.c
index 8a123c7..cad1757 100644
--- a/arch/powerpc/sysdev/fsl_soc.c
+++ b/arch/powerpc/sysdev/fsl_soc.c
@@ -907,7 +907,7 @@ static int __init fs_enet_of_init(void)
 		struct fs_platform_info fs_enet_data;
 		const unsigned int *id;
 		const unsigned int *phy_addr;
-		void *mac_addr;
+		const void *mac_addr;
 		const phandle *ph;
 		const char *model;
 
-- 
1.5.0.3

^ permalink raw reply related

* [PATCH] Mark prop unused in early_init_dt_scan_chosen().
From: Scott Wood @ 2007-05-08 17:14 UTC (permalink / raw)
  To: paulus; +Cc: linuxppc-dev

The prop variable is only referenced when initrd support is
turned on.

Signed-off-by: Scott Wood <scottwood@freescale.com>
---
 arch/powerpc/kernel/prom.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/powerpc/kernel/prom.c b/arch/powerpc/kernel/prom.c
index caef555..6705459 100644
--- a/arch/powerpc/kernel/prom.c
+++ b/arch/powerpc/kernel/prom.c
@@ -720,7 +720,7 @@ static int __init early_init_dt_scan_chosen(unsigned long node,
 					    const char *uname, int depth, void *data)
 {
 	unsigned long *lprop;
-	u32 *prop;
+	u32 __attribute__((unused)) *prop;
 	unsigned long l;
 	char *p;
 
-- 
1.5.0.3

^ permalink raw reply related

* Re: [PATCH v4 4/7] Add support for 750CL Holly board
From: Josh Boyer @ 2007-05-08 17:01 UTC (permalink / raw)
  To: Nathan Lynch; +Cc: linuxppc-dev, paulus
In-Reply-To: <20070508164513.GD19780@localdomain>

On Tue, 2007-05-08 at 11:45 -0500, Nathan Lynch wrote:
> Hi Josh-
> 
> I see this has been picked up by Paul already, but there are a couple
> minor things I noticed as I was reading the patch.

That's fine.  Comments are still welcome since I do plan on adding a bit
more a bit down the road.  I'll make sure to note them and fix them up.

> > +int holly_exclude_device(u_char bus, u_char devfn)
> > +{
> > +	if (bus == 0 && PCI_SLOT(devfn) == 0)
> > +		return PCIBIOS_DEVICE_NOT_FOUND;
> > +	else
> > +		return PCIBIOS_SUCCESSFUL;
> > +}
> 
> This function could be static, I think?  Looks like it's assigned to
> ppc_md.pci_exclude_device and called through that.

Yes, could be I think.

> > +static void __init holly_init_IRQ(void)
> > +{
> > +	struct mpic *mpic;
> > +	phys_addr_t mpic_paddr = 0;
> > +	struct device_node *tsi_pic;
> > +#ifdef CONFIG_PCI
> > +	unsigned int cascade_pci_irq;
> > +	struct device_node *tsi_pci;
> > +	struct device_node *cascade_node = NULL;
> > +#endif
> > +
> > +	tsi_pic = of_find_node_by_type(NULL, "open-pic");
> > +	if (tsi_pic) {
> > +		unsigned int size;
> > +		const void *prop = of_get_property(tsi_pic, "reg", &size);
> > +		mpic_paddr = of_translate_address(tsi_pic, prop);
> > +	}
> 
> You don't actually need 'size' there; it's legal to pass NULL to
> of_get_property.

Yep.

josh

^ permalink raw reply

* Re: [PATCH] powerpc: add dts entries to 85xx for EDAC
From: Dave Jiang @ 2007-05-08 17:08 UTC (permalink / raw)
  To: Kumar Gala; +Cc: linuxppc-dev, paulus
In-Reply-To: <3EF891D2-F973-43D6-B43B-B8BBC4269C60@kernel.crashing.org>

Kumar Gala wrote:
> On May 7, 2007, at 6:26 PM, Dave Jiang wrote:
> 
>> Adding memory-controller and l2-cache-controller entries to be used  
>> by EDAC as
>> of_devices.
> 
> we should distinguish the memory controllers on 8540/8560 (DDR1) from  
> the one on 8548 (DDR1 & DDR2).

Do you mean something like:

8540/8560
compatible = "fsl,85xx-ddr-controller"

8548
compatible = "fsl,85xx-ddr2-controller"

--
-= Dave =-

^ permalink raw reply

* PowerPC 440EPx Sequoia port
From: Valentine Barshak @ 2007-05-08 16:31 UTC (permalink / raw)
  To: linuxppc-dev

Hi All!
I'm working on the PowerPC 440EPx Sequoia port. There've been patches by 
David Gibson for Ebony support.
Does anyone know if anybody is working on the Sequoia 440EPx support?
Thanks.

^ permalink raw reply

* RE: [PATCH v2 6/7] Holly DTS
From: Loeliger Jon-LOELIGER @ 2007-05-07 17:50 UTC (permalink / raw)
  To: Segher Boessenkool, Olof Johansson; +Cc: linuxppc-dev
In-Reply-To: <cbcd7823ea9b0f17f998670915719a05@kernel.crashing.org>

=20
> >
>=20
> > Other dts'es are similar. Could be nice
> > to have a comment next to it if that's the case.
>=20
> Yeah.  There's also this ?? syntax now I believe.

Not quite yet.  We didn't really get a 2/3 majority
Ratification from The Syndicate yet.  The debate
Is ongoing, I suspect.

Let's listen in...

Jdl

^ permalink raw reply

* [PATCH] Performance Stats: Kernel patch
From: Maxim Uvarov @ 2007-05-08 16:26 UTC (permalink / raw)
  To: Andrew Morton; +Cc: linuxppc-dev, wli, pavel, dada1


Patch makes available to the user the following
task and process performance statistics:
	* Involuntary Context Switches (task_struct->nivcsw)
	* Voluntary Context Switches (task_struct->nvcsw)
	* Number of system calls (added new counter
	  thread_info->sysall_count)
	           
Statistics information is available from:
        1. taskstats interface (Documentation/accounting/)
	2. /proc/PID/status (task only).

This data is useful for detecting hyperactivity
patterns between processes.

Signed-off-by: Maxim Uvarov <muvarov@ru.mvista.com>

Signed-off-by: Maxim Uvarov <muvarov@ru.mvista.com>                                                                                  
---

 Documentation/accounting/getdelays.c          |   20 ++++++++++++++++++--
 Documentation/accounting/taskstats-struct.txt |    7 +++++++
 arch/i386/kernel/asm-offsets.c                |    1 +
 arch/i386/kernel/entry.S                      |    1 +
 arch/powerpc/kernel/asm-offsets.c             |    2 ++
 arch/powerpc/kernel/entry_32.S                |    5 +++++
 arch/powerpc/kernel/entry_64.S                |    5 +++++
 arch/x86_64/kernel/asm-offsets.c              |    1 +
 arch/x86_64/kernel/entry.S                    |    1 +
 fs/proc/array.c                               |   14 ++++++++++++++
 include/asm-i386/thread_info.h                |    1 +
 include/asm-powerpc/thread_info.h             |    1 +
 include/asm-x86_64/thread_info.h              |    1 +
 include/linux/taskstats.h                     |    6 +++++-
 kernel/fork.c                                 |    3 +++
 kernel/taskstats.c                            |    6 ++++++
 16 files changed, 72 insertions(+), 3 deletions(-)

diff --git a/Documentation/accounting/getdelays.c b/Documentation/accounting/getdelays.c
index e9126e7..1be7d65 100644
--- a/Documentation/accounting/getdelays.c
+++ b/Documentation/accounting/getdelays.c
@@ -49,6 +49,7 @@ char name[100];
 int dbg;
 int print_delays;
 int print_io_accounting;
+int print_task_stats;
 __u64 stime, utime;
 
 #define PRINTF(fmt, arg...) {			\
@@ -187,7 +188,7 @@ void print_delayacct(struct taskstats *t)
 	       "IO    %15s%15s\n"
 	       "      %15llu%15llu\n"
 	       "MEM   %15s%15s\n"
-	       "      %15llu%15llu\n\n",
+	       "      %15llu%15llu\n"
 	       "count", "real total", "virtual total", "delay total",
 	       t->cpu_count, t->cpu_run_real_total, t->cpu_run_virtual_total,
 	       t->cpu_delay_total,
@@ -196,6 +197,15 @@ void print_delayacct(struct taskstats *t)
 	       "count", "delay total", t->swapin_count, t->swapin_delay_total);
 }
 
+void print_taskstats(struct taskstats *t)
+{
+	printf("\n\nTask  %15s%15s%15s\n"
+	       "      %15lu%15lu%15lu\n",
+	       "syscalls", "voluntary", "nonvoluntary",
+	       t->syscall_counter, t->nvcsw, t->nivcsw);
+
+}
+
 void print_ioacct(struct taskstats *t)
 {
 	printf("%s: read=%llu, write=%llu, cancelled_write=%llu\n",
@@ -227,7 +237,7 @@ int main(int argc, char *argv[])
 	struct msgtemplate msg;
 
 	while (1) {
-		c = getopt(argc, argv, "diw:r:m:t:p:v:l");
+		c = getopt(argc, argv, "qdiw:r:m:t:p:v:l");
 		if (c < 0)
 			break;
 
@@ -240,6 +250,10 @@ int main(int argc, char *argv[])
 			printf("printing IO accounting\n");
 			print_io_accounting = 1;
 			break;
+		case 'q':
+			printf("printing task/process stasistics:\n");
+			print_task_stats = 1;
+			break;
 		case 'w':
 			strncpy(logfile, optarg, MAX_FILENAME);
 			printf("write to file %s\n", logfile);
@@ -381,6 +395,8 @@ int main(int argc, char *argv[])
 							print_delayacct((struct taskstats *) NLA_DATA(na));
 						if (print_io_accounting)
 							print_ioacct((struct taskstats *) NLA_DATA(na));
+						if (print_task_stats)
+							print_taskstats((struct taskstats *) NLA_DATA(na));
 						if (fd) {
 							if (write(fd, NLA_DATA(na), na->nla_len) < 0) {
 								err(1,"write error\n");
diff --git a/Documentation/accounting/taskstats-struct.txt b/Documentation/accounting/taskstats-struct.txt
index 661c797..5dac173 100644
--- a/Documentation/accounting/taskstats-struct.txt
+++ b/Documentation/accounting/taskstats-struct.txt
@@ -22,6 +22,8 @@ There are three different groups of fields in the struct taskstats:
     /* Extended accounting fields end */
     Their values are collected if CONFIG_TASK_XACCT is set.
 
+4) Per-task and per-thread statistics
+
 Future extension should add fields to the end of the taskstats struct, and
 should not change the relative position of each field within the struct.
 
@@ -158,4 +160,9 @@ struct taskstats {
 
 	/* Extended accounting fields end */
 
+4) Per-task and per-thread statiscits
+	__u32	syscall_counter;	/* Syscall counter */
+	__u32	nvcsw;			/* Context voluntary switch counter */
+	__u32	nivcsw;			/* Context involuntary switch counter */
+
 }
diff --git a/arch/i386/kernel/asm-offsets.c b/arch/i386/kernel/asm-offsets.c
index 1b2f3cd..4ad49d2 100644
--- a/arch/i386/kernel/asm-offsets.c
+++ b/arch/i386/kernel/asm-offsets.c
@@ -56,6 +56,7 @@ void foo(void)
 	OFFSET(TI_addr_limit, thread_info, addr_limit);
 	OFFSET(TI_restart_block, thread_info, restart_block);
 	OFFSET(TI_sysenter_return, thread_info, sysenter_return);
+	OFFSET(TI_syscall_count, thread_info, syscall_count);
 	BLANK();
 
 	OFFSET(GDS_size, Xgt_desc_struct, size);
diff --git a/arch/i386/kernel/entry.S b/arch/i386/kernel/entry.S
index 5e47683..26f0cc0 100644
--- a/arch/i386/kernel/entry.S
+++ b/arch/i386/kernel/entry.S
@@ -331,6 +331,7 @@ sysenter_past_esp:
 	CFI_ADJUST_CFA_OFFSET 4
 	SAVE_ALL
 	GET_THREAD_INFO(%ebp)
+	incl	TI_syscall_count(%ebp)	# Increment syscalls counter
 
 	/* Note, _TIF_SECCOMP is bit number 8, and so it needs testw and not testb */
 	testw $(_TIF_SYSCALL_EMU|_TIF_SYSCALL_TRACE|_TIF_SECCOMP|_TIF_SYSCALL_AUDIT),TI_flags(%ebp)
diff --git a/arch/powerpc/kernel/asm-offsets.c b/arch/powerpc/kernel/asm-offsets.c
index 030d300..b640039 100644
--- a/arch/powerpc/kernel/asm-offsets.c
+++ b/arch/powerpc/kernel/asm-offsets.c
@@ -94,6 +94,8 @@ int main(void)
 	DEFINE(TI_LOCAL_FLAGS, offsetof(struct thread_info, local_flags));
 	DEFINE(TI_PREEMPT, offsetof(struct thread_info, preempt_count));
 	DEFINE(TI_TASK, offsetof(struct thread_info, task));
+	DEFINE(TI_SYSCALL_COUNT, offsetof(struct thread_info, syscall_count));
+
 #ifdef CONFIG_PPC32
 	DEFINE(TI_EXECDOMAIN, offsetof(struct thread_info, exec_domain));
 	DEFINE(TI_CPU, offsetof(struct thread_info, cpu));
diff --git a/arch/powerpc/kernel/entry_32.S b/arch/powerpc/kernel/entry_32.S
index c03e829..329c2f8 100644
--- a/arch/powerpc/kernel/entry_32.S
+++ b/arch/powerpc/kernel/entry_32.S
@@ -202,6 +202,11 @@ _GLOBAL(DoSyscall)
 	bl	do_show_syscall
 #endif /* SHOW_SYSCALLS */
 	rlwinm	r10,r1,0,0,(31-THREAD_SHIFT)	/* current_thread_info() */
+#ifdef CONFIG_THREAD_PERF_STAT_SYSC
+	lwz r11,TI_SYSC_CNT(r10)
+	addi r11,r11,1
+	stw r11,TI_SYSC_CNT(r10)
+#endif /* CONFIG_THREAD_PERF_STAT_SYSC */
 	lwz	r11,TI_FLAGS(r10)
 	andi.	r11,r11,_TIF_SYSCALL_T_OR_A
 	bne-	syscall_dotrace
diff --git a/arch/powerpc/kernel/entry_64.S b/arch/powerpc/kernel/entry_64.S
index 2551c08..5907f76 100644
--- a/arch/powerpc/kernel/entry_64.S
+++ b/arch/powerpc/kernel/entry_64.S
@@ -115,6 +115,11 @@ END_FW_FTR_SECTION_IFSET(FW_FEATURE_ISERIES)
 	addi	r9,r1,STACK_FRAME_OVERHEAD
 #endif
 	clrrdi	r11,r1,THREAD_SHIFT
+#ifdef CONFIG_TASKSTATS
+	ld r10,TI_SYSCALL_COUNT(r11)
+	addi r10,r10,1
+	std r10,TI_SYSCALL_COUNT(r11)
+#endif
 	ld	r10,TI_FLAGS(r11)
 	andi.	r11,r10,_TIF_SYSCALL_T_OR_A
 	bne-	syscall_dotrace
diff --git a/arch/x86_64/kernel/asm-offsets.c b/arch/x86_64/kernel/asm-offsets.c
index 96687e2..da57356 100644
--- a/arch/x86_64/kernel/asm-offsets.c
+++ b/arch/x86_64/kernel/asm-offsets.c
@@ -35,6 +35,7 @@ int main(void)
 	ENTRY(addr_limit);
 	ENTRY(preempt_count);
 	ENTRY(status);
+	ENTRY(syscall_count);
 	BLANK();
 #undef ENTRY
 #define ENTRY(entry) DEFINE(pda_ ## entry, offsetof(struct x8664_pda, entry))
diff --git a/arch/x86_64/kernel/entry.S b/arch/x86_64/kernel/entry.S
index 9f5dac6..9fd97df 100644
--- a/arch/x86_64/kernel/entry.S
+++ b/arch/x86_64/kernel/entry.S
@@ -229,6 +229,7 @@ ENTRY(system_call)
 	movq  %rcx,RIP-ARGOFFSET(%rsp)
 	CFI_REL_OFFSET rip,RIP-ARGOFFSET
 	GET_THREAD_INFO(%rcx)
+	addq $1, threadinfo_syscall_count(%rcx)   # Increment syscalls counter
 	testl $(_TIF_SYSCALL_TRACE|_TIF_SYSCALL_AUDIT|_TIF_SECCOMP),threadinfo_flags(%rcx)
 	jnz tracesys
 	cmpq $__NR_syscall_max,%rax
diff --git a/fs/proc/array.c b/fs/proc/array.c
index 70e4fab..30f6fd5 100644
--- a/fs/proc/array.c
+++ b/fs/proc/array.c
@@ -290,6 +290,19 @@ static inline char *task_cap(struct task_struct *p, char *buffer)
 			    cap_t(p->cap_permitted),
 			    cap_t(p->cap_effective));
 }
+static inline char *task_perf(struct task_struct *p, char *buffer)
+{
+	/* Syscall counter adds 1 line overhead on each syscall execution
+	 * in entry.S, so probably it is the leave this stuff under ifdefs.
+	 */
+#ifdef CONFIG_TASKSTATS
+	buffer += sprintf(buffer, "Syscalls:\t%lu\n", p->thread_info->syscall_count);
+#endif
+	return buffer + sprintf(buffer, "Nvcsw:\t%lu\n"
+                           "Nivcsw:\t%lu\n",
+                           p->nvcsw,
+                           p->nivcsw);
+}
 
 int proc_pid_status(struct task_struct *task, char * buffer)
 {
@@ -309,6 +322,7 @@ int proc_pid_status(struct task_struct *task, char * buffer)
 #if defined(CONFIG_S390)
 	buffer = task_show_regs(task, buffer);
 #endif
+	buffer = task_perf(task, buffer);
 	return buffer - orig;
 }
 
diff --git a/include/asm-i386/thread_info.h b/include/asm-i386/thread_info.h
index 4b187bb..bccfd6a 100644
--- a/include/asm-i386/thread_info.h
+++ b/include/asm-i386/thread_info.h
@@ -33,6 +33,7 @@ struct thread_info {
 	int			preempt_count;	/* 0 => preemptable, <0 => BUG */
 
 
+	unsigned long		syscall_count;	/* Syscall counter */
 	mm_segment_t		addr_limit;	/* thread address space:
 					 	   0-0xBFFFFFFF for user-thead
 						   0-0xFFFFFFFF for kernel-thread
diff --git a/include/asm-powerpc/thread_info.h b/include/asm-powerpc/thread_info.h
index 3f32ca8..5306ac2 100644
--- a/include/asm-powerpc/thread_info.h
+++ b/include/asm-powerpc/thread_info.h
@@ -35,6 +35,7 @@ struct thread_info {
 	int		cpu;			/* cpu we're on */
 	int		preempt_count;		/* 0 => preemptable,
 						   <0 => BUG */
+	unsigned long	syscall_count;		/* Syscall counter */
 	struct restart_block restart_block;
 	unsigned long	local_flags;		/* private flags for thread */
 
diff --git a/include/asm-x86_64/thread_info.h b/include/asm-x86_64/thread_info.h
index 74a6c74..e53022d 100644
--- a/include/asm-x86_64/thread_info.h
+++ b/include/asm-x86_64/thread_info.h
@@ -31,6 +31,7 @@ struct thread_info {
 	__u32			cpu;		/* current CPU */
 	int 			preempt_count;	/* 0 => preemptable, <0 => BUG */
 
+	unsigned long		syscall_count;	/* Syscall counter */
 	mm_segment_t		addr_limit;	
 	struct restart_block    restart_block;
 };
diff --git a/include/linux/taskstats.h b/include/linux/taskstats.h
index 3fced47..e3341b6 100644
--- a/include/linux/taskstats.h
+++ b/include/linux/taskstats.h
@@ -31,7 +31,7 @@
  */
 
 
-#define TASKSTATS_VERSION	3
+#define TASKSTATS_VERSION	4
 #define TS_COMM_LEN		32	/* should be >= TASK_COMM_LEN
 					 * in linux/sched.h */
 
@@ -141,6 +141,10 @@ struct taskstats {
 	__u64	write_syscalls;		/* write syscalls */
 	/* Extended accounting fields end */
 
+	__u32  syscall_counter;   /* Syscall counter */
+	__u32  nvcsw;
+	__u32  nivcsw;
+
 #define TASKSTATS_HAS_IO_ACCOUNTING
 	/* Per-task storage I/O accounting starts */
 	__u64	read_bytes;		/* bytes of read I/O */
diff --git a/kernel/fork.c b/kernel/fork.c
index fc723e5..5213738 100644
--- a/kernel/fork.c
+++ b/kernel/fork.c
@@ -1042,6 +1042,9 @@ static struct task_struct *copy_process(unsigned long clone_flags,
 	p->wchar = 0;		/* I/O counter: bytes written */
 	p->syscr = 0;		/* I/O counter: read syscalls */
 	p->syscw = 0;		/* I/O counter: write syscalls */
+#ifdef CONFIG_TASKSTATS
+	p->thread_info->syscall_count = 0; /* Syscall counter: total numbers of syscalls */
+#endif
 	task_io_accounting_init(p);
 	acct_clear_integrals(p);
 
diff --git a/kernel/taskstats.c b/kernel/taskstats.c
index 4c3476f..d7bf33f 100644
--- a/kernel/taskstats.c
+++ b/kernel/taskstats.c
@@ -196,6 +196,9 @@ static int fill_pid(pid_t pid, struct task_struct *tsk,
 
 	/* fill in basic acct fields */
 	stats->version = TASKSTATS_VERSION;
+	stats->syscall_counter = tsk->thread_info->syscall_count;
+	stats->nvcsw = tsk->nvcsw;
+	stats->nivcsw = tsk->nivcsw;
 	bacct_add_tsk(stats, tsk);
 
 	/* fill in extended acct fields */
@@ -242,6 +245,9 @@ static int fill_tgid(pid_t tgid, struct task_struct *first,
 		 */
 		delayacct_add_tsk(stats, tsk);
 
+		stats->syscall_counter += tsk->thread_info->syscall_count;
+		stats->nvcsw += tsk->nvcsw;
+		stats->nivcsw += tsk->nivcsw;
 	} while_each_thread(first, tsk);
 
 	unlock_task_sighand(first, &flags);

^ permalink raw reply related

* Re: [PATCH v4 4/7] Add support for 750CL Holly board
From: Nathan Lynch @ 2007-05-08 16:45 UTC (permalink / raw)
  To: Josh Boyer; +Cc: linuxppc-dev, paulus
In-Reply-To: <1178573318.2990.206.camel@zod.rchland.ibm.com>

Hi Josh-

I see this has been picked up by Paul already, but there are a couple
minor things I noticed as I was reading the patch.


> +int holly_exclude_device(u_char bus, u_char devfn)
> +{
> +	if (bus == 0 && PCI_SLOT(devfn) == 0)
> +		return PCIBIOS_DEVICE_NOT_FOUND;
> +	else
> +		return PCIBIOS_SUCCESSFUL;
> +}

This function could be static, I think?  Looks like it's assigned to
ppc_md.pci_exclude_device and called through that.


> +static void __init holly_init_IRQ(void)
> +{
> +	struct mpic *mpic;
> +	phys_addr_t mpic_paddr = 0;
> +	struct device_node *tsi_pic;
> +#ifdef CONFIG_PCI
> +	unsigned int cascade_pci_irq;
> +	struct device_node *tsi_pci;
> +	struct device_node *cascade_node = NULL;
> +#endif
> +
> +	tsi_pic = of_find_node_by_type(NULL, "open-pic");
> +	if (tsi_pic) {
> +		unsigned int size;
> +		const void *prop = of_get_property(tsi_pic, "reg", &size);
> +		mpic_paddr = of_translate_address(tsi_pic, prop);
> +	}

You don't actually need 'size' there; it's legal to pass NULL to
of_get_property.

^ permalink raw reply

* Re: [PATCH 3/3] [POWERPC] dts: kill hardcoded phandles
From: Vitaly Bordug @ 2007-05-08 16:26 UTC (permalink / raw)
  To: Loeliger Jon-LOELIGER
  Cc: linuxppc-dev, linux-pcmcia, linux-kernel, David Gibson
In-Reply-To: <AF0367BA48C55940A43CCF08DF35553C012AA472@az33exm24.fsl.freescale.net>

On Tue, 8 May 2007 07:29:20 -0700
"Loeliger Jon-LOELIGER" <jdl@freescale.com> wrote:

> 
> > > -       interrupt-controller@f8200000 {
> > > -               linux,phandle = <f8200000>;
> > > +		pci_pic:interrupt-controller@f8200000 {
> > 
> > I'd like to establish a convention of putting a space after the : and
> > using capitals for labels unless there's a strong reason not to in a
> > particular case.  It makes them easier to visually distinguish next to
> > the node name.
> 
> Colon-space is easy and I'll buy it.
> I'm not big on uppercase shouting, though.
> 
> Perhaps something more like case or goto labels:?
> 
>     pci_pic:
>         interrupt-contoller@f8200000 {
> 
> if needed?
> 
I used middle solution 
	Pci_pic: interrupt-contoller@f8200000 {
so first letter of the label should be uppercase.
It makes them easily distinguishable and at the same time, not "shouting" manner.


-- 
Sincerely, 
Vitaly

^ 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