From benh at kernel.crashing.org Mon Jan 2 13:04:44 2006 From: benh at kernel.crashing.org (Benjamin Herrenschmidt) Date: Mon, 02 Jan 2006 13:04:44 +1100 Subject: [PATCH] powerpc: more g5 overtemp problem fix Message-ID: <1136167484.24205.8.camel@localhost.localdomain> Some G5s still occasionally experience shutdowns due to overtemp conditions despite the recent fix. After analyzing logs from such machines, it appears that the overtemp code is a bit too quick at shutting the machine down when reaching the critical temperature (tmax + 8) and doesn't leave the fan enough time to actually cool it down. This happens if the temperature of a CPU suddenly rises too high in a very short period of time, or occasionally on boot (that is the CPUs are already overtemp by the time the driver loads). This patches makes the code a bit more relaxed, leaving a few seconds to the fans to do their job before kicking the machine shutown. Signed-off-by: Benjamin Herrenschmidt --- linux-work.orig/drivers/macintosh/therm_pm72.c 2005-09-26 11:48:36.000000000 +1000 +++ linux-work/drivers/macintosh/therm_pm72.c 2005-10-07 11:03:41.000000000 +1000 @@ -923,7 +923,7 @@ if (temp_combi >= ((state0->mpu.tmax + 8) << 16)) { printk(KERN_WARNING "Warning ! Temperature way above maximum (%d) !\n", temp_combi >> 16); - state0->overtemp = CPU_MAX_OVERTEMP; + state0->overtemp += CPU_MAX_OVERTEMP / 4; } else if (temp_combi > (state0->mpu.tmax << 16)) state0->overtemp++; else @@ -998,7 +998,7 @@ printk(KERN_WARNING "Warning ! CPU %d temperature way above maximum" " (%d) !\n", state->index, temp >> 16); - state->overtemp = CPU_MAX_OVERTEMP; + state->overtemp += CPU_MAX_OVERTEMP / 4; } else if (temp > (state->mpu.tmax << 16)) state->overtemp++; else @@ -1060,7 +1060,7 @@ printk(KERN_WARNING "Warning ! CPU %d temperature way above maximum" " (%d) !\n", state->index, temp >> 16); - state->overtemp = CPU_MAX_OVERTEMP; + state->overtemp = CPU_MAX_OVERTEMP / 4; } else if (temp > (state->mpu.tmax << 16)) state->overtemp++; else From miltonm at bga.com Mon Jan 2 17:51:23 2006 From: miltonm at bga.com (Milton Miller) Date: Mon, 2 Jan 2006 00:51:23 -0600 (CST) Subject: UP FP restore fastpath missing Message-ID: <200601020651.k026pNMi011016@sullivan.realtime.net> I was reading the current powerpc process.c and noticed that __switch_to !CONFIG_SMP has code to avoid talking altivec and spe exceptions but not fp exceptions. milton From maule at sgi.com Tue Jan 3 14:22:49 2006 From: maule at sgi.com (Mark Maule) Date: Mon, 2 Jan 2006 21:22:49 -0600 Subject: [PATCH 0/3] msi abstractions and support for altix In-Reply-To: <20051222205023.GK2361@parisc-linux.org> References: <20051222201651.2019.37913.96422@lnx-maule.americas.sgi.com> <20051222202259.GA4959@suse.de> <20051222202627.GI17552@sgi.com> <20051222203415.GA28240@suse.de> <20051222203824.GJ17552@sgi.com> <20051222205023.GK2361@parisc-linux.org> Message-ID: <20060103032249.GA4957@sgi.com> On Thu, Dec 22, 2005 at 01:50:23PM -0700, Matthew Wilcox wrote: > On Thu, Dec 22, 2005 at 02:38:24PM -0600, Mark Maule wrote: > > Because on ia64 IA64_FIRST_DEVICE_VECTOR and IA64_LAST_DEVICE_VECTOR > > (from which MSI FIRST_DEVICE_VECTOR/LAST_DEVICE_VECTOR are derived) are not > > constants. The are now global variables (see change to asm-ia64/hw_irq.h) > > to allow the platform to override them. Altix uses a reduced range of > > vectors for devices, and this change was necessary to make assign_irq_vector() > > to work on altix. > > To be honest, I think this is just adding a third layer of paper over > the crack in the wall. The original code assumed x86; the ia64 port > added enough emulation to make it look like x86 and now altix fixes a > couple of assumptions. I say: bleh. > > What we actually need is an interface provided by the architecture that > allocates a new irq. I have a hankering to implement MSI on PA-RISC but > haven't found the time ... Matt, Greg, et. al: Did you guys have something in mind for a vector allocation interface? It seems to me that assign_irq_vector() more or less does what we want, but what is missing is a way for the platform to prime which vectors are available to choose from. One possibly better solution would be to call something in the init_IRQ path that would set up the vector pool available to assign_irq_vector(). Any opinions on this? I would maintain that this effort should be done independently of this patchset. thanks Mark From gregkh at suse.de Tue Jan 3 17:07:19 2006 From: gregkh at suse.de (Greg KH) Date: Mon, 2 Jan 2006 22:07:19 -0800 Subject: [PATCH 0/3] msi abstractions and support for altix In-Reply-To: <20060103032249.GA4957@sgi.com> References: <20051222201651.2019.37913.96422@lnx-maule.americas.sgi.com> <20051222202259.GA4959@suse.de> <20051222202627.GI17552@sgi.com> <20051222203415.GA28240@suse.de> <20051222203824.GJ17552@sgi.com> <20051222205023.GK2361@parisc-linux.org> <20060103032249.GA4957@sgi.com> Message-ID: <20060103060719.GA1845@suse.de> On Mon, Jan 02, 2006 at 09:22:49PM -0600, Mark Maule wrote: > On Thu, Dec 22, 2005 at 01:50:23PM -0700, Matthew Wilcox wrote: > > On Thu, Dec 22, 2005 at 02:38:24PM -0600, Mark Maule wrote: > > > Because on ia64 IA64_FIRST_DEVICE_VECTOR and IA64_LAST_DEVICE_VECTOR > > > (from which MSI FIRST_DEVICE_VECTOR/LAST_DEVICE_VECTOR are derived) are not > > > constants. The are now global variables (see change to asm-ia64/hw_irq.h) > > > to allow the platform to override them. Altix uses a reduced range of > > > vectors for devices, and this change was necessary to make assign_irq_vector() > > > to work on altix. > > > > To be honest, I think this is just adding a third layer of paper over > > the crack in the wall. The original code assumed x86; the ia64 port > > added enough emulation to make it look like x86 and now altix fixes a > > couple of assumptions. I say: bleh. > > > > What we actually need is an interface provided by the architecture that > > allocates a new irq. I have a hankering to implement MSI on PA-RISC but > > haven't found the time ... > > Matt, Greg, et. al: > > Did you guys have something in mind for a vector allocation interface? It > seems to me that assign_irq_vector() more or less does what we want, > but what is missing is a way for the platform to prime which vectors > are available to choose from. > > One possibly better solution would be to call something in the init_IRQ path > that would set up the vector pool available to assign_irq_vector(). > > Any opinions on this? I would maintain that this effort should be done > independently of this patchset. Care to write a patch showing how this would work? And why would this be independant of your other changes? thanks, greg k-h From olh at suse.de Wed Jan 4 06:58:31 2006 From: olh at suse.de (Olaf Hering) Date: Tue, 3 Jan 2006 20:58:31 +0100 Subject: [PATCH 4/11] powerpc: Add CONFIG_CRASH_DUMP In-Reply-To: <20051205003942.A65C468851@ozlabs.org> References: <1133743149.268607.418162138937.qpush@concordia> <20051205003942.A65C468851@ozlabs.org> Message-ID: <20060103195831.GA2898@suse.de> On Sun, Dec 04, Michael Ellerman wrote: > This patch adds a Kconfig variable, CONFIG_CRASH_DUMP, which configures the > built kernel for use as a Kdump kernel. > > Currently "all" this involves is changing the value of KERNELBASE to 32 MB. > +++ kexec/include/asm-powerpc/page.h > @@ -37,8 +37,15 @@ > */ > #define PAGE_MASK (~((1 << PAGE_SHIFT) - 1)) > > +#ifdef CONFIG_CRASH_DUMP > +/* Kdump kernel runs at 32 MB, change at your peril. */ > +#define PHYSICAL_START 0x2000000 > +#else > +#define PHYSICAL_START 0x0 > +#endif > + > #define PAGE_OFFSET ASM_CONST(CONFIG_KERNEL_START) > -#define KERNELBASE PAGE_OFFSET > +#define KERNELBASE (PAGE_OFFSET + PHYSICAL_START) This changes the vmlinux entry point, and breaks some assumptions in yaboot. It wont load an initrd anymore, flat_vmlinux is always false. It means also that a SLES9 installation cant load a SLES10 kernel+initrd via yaboot. Fixing it now in my tree. -- short story of a lazy sysadmin: alias appserv=wotan From jschopp at austin.ibm.com Wed Jan 4 05:51:22 2006 From: jschopp at austin.ibm.com (Joel Schopp) Date: Tue, 03 Jan 2006 12:51:22 -0600 Subject: [PATCH] ppc64: htab_initialize_secondary cannot be marked __init In-Reply-To: <20051228234629.GA18479@krispykreme> References: <20051228234629.GA18479@krispykreme> Message-ID: <43BAC7AA.6010101@austin.ibm.com> > -void __init htab_initialize_secondary(void) > +void htab_initialize_secondary(void) Wouldn't __devinit be the right thing to do? From ak at suse.de Wed Jan 4 08:57:52 2006 From: ak at suse.de (Andi Kleen) Date: Tue, 3 Jan 2006 22:57:52 +0100 Subject: [ANNOUNCE] numactl 0.9 released Message-ID: <200601032257.53039.ak@suse.de> A new release of the numactl / libnuma package has been released ftp://ftp.suse.com/pub/people/ak/numa/numactl-0.9.tar.gz af9f10f1f65a88b3368c02157718aa58 numactl-0.9.tar.gz It consists of a numactl program to run other programs with a specific NUMA policy and a libnuma shared library ("NUMA API") to set NUMA policy in applications and some additional tools. The 0.8 release had some problems (in fact it didn't even build on !x86-64 without tweaks) so I did 0.9 early. I fixed all the known bugs, added some patches that were reported after releases and added some minor new features. The compile flags can be now changed with the standard CFLAGS=.. argument, no need anymore for OPT_CFLAGS (thanks Ian!) I tweaked numademo a bit and it should be more useful now. It has more stable measurements now and reports the the results in MB/s instead of the weird units used before. There is a new random test that tests the memory performance with randomized accesses to defeat any hardware prefetching. And ppc64 support should really work now (I hope at least) And numastat now knows how to wrap the display for a large number of nodes (a killer feature!) I hope to declare this numactl 1.0 soon unless any bad bugs are reported. Any feedback appreciated. -Andi Detailed changes since 0.8: - Get rid of bogus distance.o that broke compilation on !x86-64 (sorry) - Handle CFLAGS overriding without OPT_CFLAGS (Ian Wienand) - Fix up section of get/set_mempolicy (Ian Wienand) - When no NUMA available fall back to one global node instead of one node per CPU (Samuel Thibault) - Don't rely on architecture symbols for dependency generation - Use __powerpc__ to detect PPC/PPC64 - numastat: * wrap display properly with many nodes * display nodes in forward order * install manpage in `make install'. - remove bogus numamemcpy.c - numademo: * allow standalone compile, make streamlib optional * clean up output * change output unit to standard MB/s * compile with more optimization * add random pass to fool any prefetching (slow) - make numademo compileable outside source tree - use gettimeofday instead of time stamp counters in benchmarks - support valgrind in testsuite - other minor changes From galak at gate.crashing.org Wed Jan 4 09:15:21 2006 From: galak at gate.crashing.org (Kumar Gala) Date: Tue, 3 Jan 2006 16:15:21 -0600 (CST) Subject: [PATCH] powerpc: fixing compile issue with !CONFIG_PCI in legacy_serial.c Message-ID: Only build in support for ISA and PCI cases if we have enabled CONFIG_ISA and CONFIG_PCI. Additionally, isa_bridge is a global so we shouldn't use it a parameter name since it gets redefined to NULL when !CONFIG_PCI. Signed-off-by: Kumar Gala --- commit 010d770e4b04e159ce9841b4572224579b26ae22 tree a04b75607365053bf289edc0b76923bb86b06b5c parent 8e80181ef9bf122ea5053e90cf9d9d0277c6e7ab author Kumar Gala Tue, 03 Jan 2006 16:19:45 -0600 committer Kumar Gala Tue, 03 Jan 2006 16:19:45 -0600 arch/powerpc/kernel/legacy_serial.c | 12 +++++++++++- 1 files changed, 11 insertions(+), 1 deletions(-) diff --git a/arch/powerpc/kernel/legacy_serial.c b/arch/powerpc/kernel/legacy_serial.c index 59164ba..f970ace 100644 --- a/arch/powerpc/kernel/legacy_serial.c +++ b/arch/powerpc/kernel/legacy_serial.c @@ -134,8 +134,9 @@ static int __init add_legacy_soc_port(st return add_legacy_port(np, -1, UPIO_MEM, addr, addr, NO_IRQ, flags); } +#ifdef CONFIG_ISA static int __init add_legacy_isa_port(struct device_node *np, - struct device_node *isa_bridge) + struct device_node *isa_brg) { u32 *reg; char *typep; @@ -167,7 +168,9 @@ static int __init add_legacy_isa_port(st return add_legacy_port(np, index, UPIO_PORT, reg[1], taddr, NO_IRQ, UPF_BOOT_AUTOCONF); } +#endif +#ifdef CONFIG_PCI static int __init add_legacy_pci_port(struct device_node *np, struct device_node *pci_dev) { @@ -233,6 +236,7 @@ static int __init add_legacy_pci_port(st */ return add_legacy_port(np, index, iotype, base, addr, NO_IRQ, UPF_BOOT_AUTOCONF); } +#endif /* * This is called very early, as part of setup_system() or eventually @@ -272,6 +276,7 @@ void __init find_legacy_serial_ports(voi of_node_put(soc); } +#ifdef CONFIG_ISA /* First fill our array with ISA ports */ for (np = NULL; (np = of_find_node_by_type(np, "serial"));) { struct device_node *isa = of_get_parent(np); @@ -282,7 +287,9 @@ void __init find_legacy_serial_ports(voi } of_node_put(isa); } +#endif +#ifdef CONFIG_PCI /* Next, try to locate PCI ports */ for (np = NULL; (np = of_find_all_nodes(np));) { struct device_node *pci, *parent = of_get_parent(np); @@ -312,6 +319,7 @@ void __init find_legacy_serial_ports(voi legacy_serial_console = index; of_node_put(parent); } +#endif DBG("legacy_serial_console = %d\n", legacy_serial_console); @@ -375,6 +383,7 @@ static void __init fixup_port_pio(int in struct device_node *np, struct plat_serial8250_port *port) { +#ifdef CONFIG_PCI struct pci_controller *hose; DBG("fixup_port_pio(%d)\n", index); @@ -391,6 +400,7 @@ static void __init fixup_port_pio(int in index, port->iobase, port->iobase + offset); port->iobase += offset; } +#endif } static void __init fixup_port_mmio(int index, From olof at lixom.net Wed Jan 4 09:20:12 2006 From: olof at lixom.net (Olof Johansson) Date: Tue, 3 Jan 2006 16:20:12 -0600 Subject: [PATCH] ppc64: htab_initialize_secondary cannot be marked __init In-Reply-To: <43BAC7AA.6010101@austin.ibm.com> References: <20051228234629.GA18479@krispykreme> <43BAC7AA.6010101@austin.ibm.com> Message-ID: <20060103222012.GB16278@pb15.lixom.net> On Tue, Jan 03, 2006 at 12:51:22PM -0600, Joel Schopp wrote: > >-void __init htab_initialize_secondary(void) > >+void htab_initialize_secondary(void) > > Wouldn't __devinit be the right thing to do? If anything it should be __cpuinit, but noone's gone through and marked up arch/powerpc for that at all yet so just marking a single function doesn't make much sense. -Olof From olh at suse.de Wed Jan 4 10:41:52 2006 From: olh at suse.de (Olaf Hering) Date: Wed, 4 Jan 2006 00:41:52 +0100 Subject: [PATCH 4/11] powerpc: Add CONFIG_CRASH_DUMP In-Reply-To: <43BB013F.6060403@us.ibm.com> References: <1133743149.268607.418162138937.qpush@concordia> <20051205003942.A65C468851@ozlabs.org> <20060103195831.GA2898@suse.de> <43BB013F.6060403@us.ibm.com> Message-ID: <20060103234152.GA9642@suse.de> On Tue, Jan 03, Haren Myneni wrote: > Yes, it could be a problem if we do OF boot at 32MB (CONFIG_CRASH_DUMP) > since the the initrd's location is set at 36MB by the yaboot. However, > in the kdump boot, the initrd location is not at fixed location and > changed by the kexec-tool. > > But, we found an issue (Oops) when we load the second kernel in to the > crash kernel region. During the first boot, the crash kernel region is > reserved (32M - 160M for crashkernel=128M at 32M) and the initrd is at 36M. > But, after loading the initrd, free_initrd() is freed initrd region even > though it is part of crash kernel reserved region. When we load the > second kernel using kexec-tool, we are copying into unallocated memory. > Thus caused panic. Why are all these values hardcoded? Cant this be probed at runtime somehow? I hope the only fixed address is the entry point of the inital bootloader (yaboot or zImage). I will finally change yaboot this week to not use hardcoded values anymore. -- short story of a lazy sysadmin: alias appserv=wotan From maule at sgi.com Wed Jan 4 10:50:24 2006 From: maule at sgi.com (Mark Maule) Date: Tue, 3 Jan 2006 17:50:24 -0600 Subject: [PATCH 1/3] msi vector targeting abstractions In-Reply-To: <20060103223918.GB13841@esmail.cup.hp.com> References: <20051222201651.2019.37913.96422@lnx-maule.americas.sgi.com> <20051222201657.2019.69251.48815@lnx-maule.americas.sgi.com> <20060103223918.GB13841@esmail.cup.hp.com> Message-ID: <20060103235024.GC16827@sgi.com> On Tue, Jan 03, 2006 at 02:39:18PM -0800, Grant Grundler wrote: > On Thu, Dec 22, 2005 at 02:15:49PM -0600, Mark Maule wrote: > > Abstract portions of the MSI core for platforms that do not use standard > > APIC interrupt controllers. This is implemented through a new arch-specific > > msi setup routine, and a set of msi ops which can be set on a per platform > > basis. > > ... > > + > > + msi_ops->target(vector, dest_cpu, &address_hi, &address_lo); > > + > > + pci_write_config_dword(entry->dev, msi_upper_address_reg(pos), > > + address_hi); > > pci_write_config_dword(entry->dev, msi_lower_address_reg(pos), > > - address.lo_address.value); > > + address_lo); > > set_native_irq_info(irq, cpu_mask); > > break; > > } > ... > > --- /dev/null 1970-01-01 00:00:00.000000000 +0000 > > +++ msi/drivers/pci/msi-apic.c 2005-12-22 11:09:37.022232088 -0600 > ... > > +struct msi_ops msi_apic_ops = { > > + .setup = msi_setup_apic, > > + .teardown = msi_teardown_apic, > > +#ifdef CONFIG_SMP > > + .target = msi_target_apic, > > +#endif > > Mark, > msi_target_apic() initializes address_lo parameter. > Even on a UP machine, we need inialize this value. Not sure what you mean here. target is used to retarget an existing MSI vector to a different processor. In the case of apic, this appears to be accomplished by swizzling the cpu in the low 32 bits of the msi address. Nothing needs to change in the upper 32 bits. > > If target is called unconditionally, wouldn't it be better > for msi_target_apic() always be called? target is called through the msi_ops->target vector. SN does not use msi_target_apic(), it uses sn_msi_target(). Other platforms can implement target however they need to. > > It would also be good for msi_target_apic to validate the 'dest_cpu' is online. > Maybe a BUG_ON or something like that. That wasn't a check in the original code flow ... the main protection appears to be in the upper levels in irq_affinity_write_proc(). > > grant > > ps. not done looking through this...and still curious to see where > other discussion about generic vector assignment leads. From iod00d at hp.com Wed Jan 4 09:39:18 2006 From: iod00d at hp.com (Grant Grundler) Date: Tue, 3 Jan 2006 14:39:18 -0800 Subject: [PATCH 1/3] msi vector targeting abstractions In-Reply-To: <20051222201657.2019.69251.48815@lnx-maule.americas.sgi.com> References: <20051222201651.2019.37913.96422@lnx-maule.americas.sgi.com> <20051222201657.2019.69251.48815@lnx-maule.americas.sgi.com> Message-ID: <20060103223918.GB13841@esmail.cup.hp.com> On Thu, Dec 22, 2005 at 02:15:49PM -0600, Mark Maule wrote: > Abstract portions of the MSI core for platforms that do not use standard > APIC interrupt controllers. This is implemented through a new arch-specific > msi setup routine, and a set of msi ops which can be set on a per platform > basis. ... > + > + msi_ops->target(vector, dest_cpu, &address_hi, &address_lo); > + > + pci_write_config_dword(entry->dev, msi_upper_address_reg(pos), > + address_hi); > pci_write_config_dword(entry->dev, msi_lower_address_reg(pos), > - address.lo_address.value); > + address_lo); > set_native_irq_info(irq, cpu_mask); > break; > } ... > --- /dev/null 1970-01-01 00:00:00.000000000 +0000 > +++ msi/drivers/pci/msi-apic.c 2005-12-22 11:09:37.022232088 -0600 ... > +struct msi_ops msi_apic_ops = { > + .setup = msi_setup_apic, > + .teardown = msi_teardown_apic, > +#ifdef CONFIG_SMP > + .target = msi_target_apic, > +#endif Mark, msi_target_apic() initializes address_lo parameter. Even on a UP machine, we need inialize this value. If target is called unconditionally, wouldn't it be better for msi_target_apic() always be called? It would also be good for msi_target_apic to validate the 'dest_cpu' is online. Maybe a BUG_ON or something like that. grant ps. not done looking through this...and still curious to see where other discussion about generic vector assignment leads. From iod00d at hp.com Wed Jan 4 11:01:41 2006 From: iod00d at hp.com (Grant Grundler) Date: Tue, 3 Jan 2006 16:01:41 -0800 Subject: [PATCH 2/3] per-platform IA64_{FIRST, LAST}_DEVICE_VECTOR definitions In-Reply-To: <20051222201705.2019.59377.24060@lnx-maule.americas.sgi.com> References: <20051222201651.2019.37913.96422@lnx-maule.americas.sgi.com> <20051222201705.2019.59377.24060@lnx-maule.americas.sgi.com> Message-ID: <20060104000141.GC13841@esmail.cup.hp.com> On Thu, Dec 22, 2005 at 02:15:57PM -0600, Mark Maule wrote: > Abstract IA64_FIRST_DEVICE_VECTOR/IA64_LAST_DEVICE_VECTOR since SN platforms > use a subset of the IA64 range. Implement this by making the above macros > global variables which the platform can override in it setup code. ... > Index: msi/arch/ia64/sn/kernel/irq.c > =================================================================== > --- msi.orig/arch/ia64/sn/kernel/irq.c 2005-12-21 22:59:09.199823700 -0600 > +++ msi/arch/ia64/sn/kernel/irq.c 2005-12-22 14:10:01.024578027 -0600 > @@ -203,6 +203,9 @@ > int i; > irq_desc_t *base_desc = irq_desc; > > + ia64_first_device_vector = IA64_SN2_FIRST_DEVICE_VECTOR; > + ia64_last_device_vector = IA64_SN2_LAST_DEVICE_VECTOR; Shouldn't this chunk of diff go in "PATCH [2/3] altix: msi support"? (typo: that should have been "3/3" in the original mail) thanks, grant From iod00d at hp.com Wed Jan 4 11:20:47 2006 From: iod00d at hp.com (Grant Grundler) Date: Tue, 3 Jan 2006 16:20:47 -0800 Subject: [PATCH 1/3] msi vector targeting abstractions In-Reply-To: <20060103235024.GC16827@sgi.com> References: <20051222201651.2019.37913.96422@lnx-maule.americas.sgi.com> <20051222201657.2019.69251.48815@lnx-maule.americas.sgi.com> <20060103223918.GB13841@esmail.cup.hp.com> <20060103235024.GC16827@sgi.com> Message-ID: <20060104002047.GA14810@esmail.cup.hp.com> On Tue, Jan 03, 2006 at 05:50:24PM -0600, Mark Maule wrote: > > > +struct msi_ops msi_apic_ops = { > > > + .setup = msi_setup_apic, > > > + .teardown = msi_teardown_apic, > > > +#ifdef CONFIG_SMP > > > + .target = msi_target_apic, > > > +#endif > > > > Mark, > > msi_target_apic() initializes address_lo parameter. > > Even on a UP machine, we need inialize this value. > > Not sure what you mean here. target is used to retarget an existing > MSI vector to a different processor. Right - I didn't realize the caller, set_msi_affinity(), was surrounded by "#ifdef CONFIG_SMP". But set_msi_affinity() appears to be dead code. I couldn't find any calls to set_msi_affinity() in 2.6.14 or 2.6.15. Greg, you want a patch to remove that? thanks, grant From gregkh at suse.de Wed Jan 4 11:27:38 2006 From: gregkh at suse.de (Greg KH) Date: Tue, 3 Jan 2006 16:27:38 -0800 Subject: [PATCH 1/3] msi vector targeting abstractions In-Reply-To: <20060104002047.GA14810@esmail.cup.hp.com> References: <20051222201651.2019.37913.96422@lnx-maule.americas.sgi.com> <20051222201657.2019.69251.48815@lnx-maule.americas.sgi.com> <20060103223918.GB13841@esmail.cup.hp.com> <20060103235024.GC16827@sgi.com> <20060104002047.GA14810@esmail.cup.hp.com> Message-ID: <20060104002737.GA18963@suse.de> On Tue, Jan 03, 2006 at 04:20:47PM -0800, Grant Grundler wrote: > On Tue, Jan 03, 2006 at 05:50:24PM -0600, Mark Maule wrote: > > > > +struct msi_ops msi_apic_ops = { > > > > + .setup = msi_setup_apic, > > > > + .teardown = msi_teardown_apic, > > > > +#ifdef CONFIG_SMP > > > > + .target = msi_target_apic, > > > > +#endif > > > > > > Mark, > > > msi_target_apic() initializes address_lo parameter. > > > Even on a UP machine, we need inialize this value. > > > > Not sure what you mean here. target is used to retarget an existing > > MSI vector to a different processor. > > Right - I didn't realize the caller, set_msi_affinity(), was surrounded by > "#ifdef CONFIG_SMP". > > But set_msi_affinity() appears to be dead code. > I couldn't find any calls to set_msi_affinity() in 2.6.14 or 2.6.15. > Greg, you want a patch to remove that? Yes please, that would be great to have. thanks, greg k-h From haren at us.ibm.com Wed Jan 4 09:57:03 2006 From: haren at us.ibm.com (Haren Myneni) Date: Tue, 03 Jan 2006 14:57:03 -0800 Subject: [PATCH 4/11] powerpc: Add CONFIG_CRASH_DUMP In-Reply-To: <20060103195831.GA2898@suse.de> References: <1133743149.268607.418162138937.qpush@concordia> <20051205003942.A65C468851@ozlabs.org> <20060103195831.GA2898@suse.de> Message-ID: <43BB013F.6060403@us.ibm.com> Olaf Hering wrote: > On Sun, Dec 04, Michael Ellerman wrote: > > > >>This patch adds a Kconfig variable, CONFIG_CRASH_DUMP, which configures the >>built kernel for use as a Kdump kernel. >> >>Currently "all" this involves is changing the value of KERNELBASE to 32 MB. >> >> > > > >>+++ kexec/include/asm-powerpc/page.h >>@@ -37,8 +37,15 @@ >> */ >> #define PAGE_MASK (~((1 << PAGE_SHIFT) - 1)) >> >>+#ifdef CONFIG_CRASH_DUMP >>+/* Kdump kernel runs at 32 MB, change at your peril. */ >>+#define PHYSICAL_START 0x2000000 >>+#else >>+#define PHYSICAL_START 0x0 >>+#endif >>+ >> #define PAGE_OFFSET ASM_CONST(CONFIG_KERNEL_START) >>-#define KERNELBASE PAGE_OFFSET >>+#define KERNELBASE (PAGE_OFFSET + PHYSICAL_START) >> >> > >This changes the vmlinux entry point, and breaks some assumptions in >yaboot. It wont load an initrd anymore, flat_vmlinux is always false. > >It means also that a SLES9 installation cant load a SLES10 kernel+initrd via yaboot. >Fixing it now in my tree. > > > Yes, it could be a problem if we do OF boot at 32MB (CONFIG_CRASH_DUMP) since the the initrd's location is set at 36MB by the yaboot. However, in the kdump boot, the initrd location is not at fixed location and changed by the kexec-tool. But, we found an issue (Oops) when we load the second kernel in to the crash kernel region. During the first boot, the crash kernel region is reserved (32M - 160M for crashkernel=128M at 32M) and the initrd is at 36M. But, after loading the initrd, free_initrd() is freed initrd region even though it is part of crash kernel reserved region. When we load the second kernel using kexec-tool, we are copying into unallocated memory. Thus caused panic. One solution is move the initrd during prom_init. But, prom_claim is failed if try to claim outside of first memory node (> rmo_top) on my P5 machine. The other one could be move the initrd later. Since we are freeing the initrd anyway during early boot (before we load the second kernel), it will be an extra step of moving initrd (allocating memory and copy). The following patch could fix this issue - free only regions that are not part of crash region. As this issue may also exists on other archs, made changes in the init/initramfs.c. Is there any better way to fix this problem? Thanks Haren -------------- next part -------------- A non-text attachment was scrubbed... Name: initrd_kdump_fix.patch Type: text/x-patch Size: 1708 bytes Desc: not available Url : http://ozlabs.org/pipermail/linuxppc64-dev/attachments/20060103/0260d115/attachment.bin From maule at sgi.com Wed Jan 4 14:52:16 2006 From: maule at sgi.com (Mark Maule) Date: Tue, 3 Jan 2006 21:52:16 -0600 Subject: [PATCH 1/3] msi vector targeting abstractions In-Reply-To: <20060104002737.GA18963@suse.de> References: <20051222201651.2019.37913.96422@lnx-maule.americas.sgi.com> <20051222201657.2019.69251.48815@lnx-maule.americas.sgi.com> <20060103223918.GB13841@esmail.cup.hp.com> <20060103235024.GC16827@sgi.com> <20060104002047.GA14810@esmail.cup.hp.com> <20060104002737.GA18963@suse.de> Message-ID: <20060104035216.GD16827@sgi.com> On Tue, Jan 03, 2006 at 04:27:38PM -0800, Greg KH wrote: > On Tue, Jan 03, 2006 at 04:20:47PM -0800, Grant Grundler wrote: > > On Tue, Jan 03, 2006 at 05:50:24PM -0600, Mark Maule wrote: > > > > > +struct msi_ops msi_apic_ops = { > > > > > + .setup = msi_setup_apic, > > > > > + .teardown = msi_teardown_apic, > > > > > +#ifdef CONFIG_SMP > > > > > + .target = msi_target_apic, > > > > > +#endif > > > > > > > > Mark, > > > > msi_target_apic() initializes address_lo parameter. > > > > Even on a UP machine, we need inialize this value. > > > > > > Not sure what you mean here. target is used to retarget an existing > > > MSI vector to a different processor. > > > > Right - I didn't realize the caller, set_msi_affinity(), was surrounded by > > "#ifdef CONFIG_SMP". > > > > But set_msi_affinity() appears to be dead code. > > I couldn't find any calls to set_msi_affinity() in 2.6.14 or 2.6.15. > > Greg, you want a patch to remove that? > > Yes please, that would be great to have. > > thanks, > > greg k-h Is that really dead code? From msi.h: #ifdef CONFIG_SMP #define set_msi_irq_affinity set_msi_affinity #else #define set_msi_irq_affinity NULL #endif Mark From haren at us.ibm.com Wed Jan 4 16:06:31 2006 From: haren at us.ibm.com (Haren Myneni) Date: Tue, 03 Jan 2006 21:06:31 -0800 Subject: [PATCH 4/11] powerpc: Add CONFIG_CRASH_DUMP In-Reply-To: <20060103234152.GA9642@suse.de> References: <1133743149.268607.418162138937.qpush@concordia> <20051205003942.A65C468851@ozlabs.org> <20060103195831.GA2898@suse.de> <43BB013F.6060403@us.ibm.com> <20060103234152.GA9642@suse.de> Message-ID: <43BB57D7.1050004@us.ibm.com> Olaf Hering wrote: > On Tue, Jan 03, Haren Myneni wrote: > > > >>Yes, it could be a problem if we do OF boot at 32MB (CONFIG_CRASH_DUMP) >>since the the initrd's location is set at 36MB by the yaboot. However, >>in the kdump boot, the initrd location is not at fixed location and >>changed by the kexec-tool. >> >>But, we found an issue (Oops) when we load the second kernel in to the >>crash kernel region. During the first boot, the crash kernel region is >>reserved (32M - 160M for crashkernel=128M at 32M) and the initrd is at 36M. >>But, after loading the initrd, free_initrd() is freed initrd region even >>though it is part of crash kernel reserved region. When we load the >>second kernel using kexec-tool, we are copying into unallocated memory. >>Thus caused panic. >> >> > >Why are all these values hardcoded? Cant this be probed at runtime >somehow? I hope the only fixed address is the entry point of the inital >bootloader (yaboot or zImage). >I will finally change yaboot this week to not use hardcoded values >anymore. > > > > I am not sure whether yaboot can find the initrd location at runtime. If the yaboot can probe and find the crashkernel end at run time, then we might be considering 2 issues: - At present, alloc_bottom is moved after initrd_end. But it has to be before rmo_top. Hence, need changes in prom_init.c. we also need to make sure that sufficient memory is available before rmo_top for RTAS and reserve map. Otherwise prom_claim() will get failed. Right? - As you pointed out before (minor one), the existing yaboot will not work with the new kernel. Ex: SLES9's yaboot for SLES10 kernel. From rsa at us.ibm.com Wed Jan 4 17:32:17 2006 From: rsa at us.ibm.com (Ryan Arnold) Date: Wed, 04 Jan 2006 00:32:17 -0600 Subject: [RFC PATCH 1/1] fix get_ & put_ chars in hvc_vio to fix IN/OUT _BUF assumptions In-Reply-To: <858c3c666b9ac1fd8ffd01709426114e@bga.com> References: <20051217001031.456315000@localhost> <20051217002255.601962000@localhost> <858c3c666b9ac1fd8ffd01709426114e@bga.com> Message-ID: <1136356337.9010.20.camel@localhost.localdomain> Greetings Milton, et al. On Fri, 2005-12-16 at 23:02 -0600, Milton Miller wrote: > > + > > +/* > > + * This is a design shortcoming, the number '16' is a vio required > > buffer > > + * size. This should be changeable per architecture, but hvc_struct > > relies > > + * upon it and that struct is used by all hvc_console backend > > drivers. This > > + * needs to be fixed. > > + */ > > This is a bit strong. vio requires inbuf to be at least 16, and will > process upto 16 in outbound. They could be bigger, it will only cause > the hvc_driver to loop. Outbound couuld be smaller, but it would > reduce the efficency. I wrote this comment. In retrospect it is definitely too strong. None-the-less I feel the need to address a few dangerous assumptions in the hvc_vio code based upon the size of N_INBUF and N_OUTBUF. The firmware function plpar_hcall_norets(H_PUT_TERM_CHAR, ...) will not gracefully accept a 'count' parameter exceeding '16'. It will generate an H_Parameter error. The current hvconsole.c hvc_put_chars() function does not account for this and is prone to breakage should N_OUTBUF have a size greater than '16'. Furthermore, the hvc_console driver asks its back-ends to read 'count' number of characters based upon the amount of room left in the flip buffer. This value is less-than-or-equal-to the size of N_INBUF. Presently the hvc_vio driver makes an erroneous assumption that it can forward this request directly to vio firmware and ask for a particular number of bytes to be read into its recv buffer. This is not how plpar_hcall(H_GET_TERM_CHAR,...) works. You don't ask it to read a number of bytes. After is invoked it tells you how many bytes it read, up to the firmware specified maximum of 16. Should the amount requested (count) be less than the number read from firmware we'd over-write the flip buffer. We've not noticed any problems thus-far because we currently allow the tty to drain the flip buffer before it gets too full (after every 64 bytes read). Draining after 64 bytes is unnecessary considering that the flip buffer is 512 bytes so I've removed it. To fix the back-end problem I've directed the back-end drivers to return -EAGAIN if they can't satisfy the get request size-constraint. This signals the hvc_console driver front-end that it should allow the tty to clear the flip buffer to make room for a larger 'get'. This allows us to pack the flip buffer to be nearly full. As requested, I've also removed the front-end function __hvc_write_kernel() because it is no longer necessary. The following patch is against powerpc.git Ryan S. Arnold IBM Linux Technology Center Signed-off-by: "Ryan S. Arnold" -------------- next part -------------- A non-text attachment was scrubbed... Name: powerpc.git.hvc_console.patch Type: text/x-patch Size: 4325 bytes Desc: not available Url : http://ozlabs.org/pipermail/linuxppc64-dev/attachments/20060104/bd56f19f/attachment.bin From msdemlei at cl.uni-heidelberg.de Thu Jan 5 01:20:06 2006 From: msdemlei at cl.uni-heidelberg.de (Markus Demleitner) Date: Wed, 4 Jan 2006 15:20:06 +0100 Subject: Phantom pain with windfarm on diskless iMac G5 Message-ID: <20060104142006.GA8782@victor.cl.uni-heidelberg.de> Hi, I tried 2.6.15 on my diskless iMac G5 clients today, resulting in 747 emulation mode (vrooom...!). It turns out windfarm was querying the hard disk temperature sensor, which usually is mounted on the mounting bracket Apple uses. We made the mistake of removing these (from about 30 machines:-(), which in turn made windfarm_lm75_sensor.c:wf_lm75_get return ffff, which translates into about 255 degrees celsius. No wonder windfarm pumped like there's no tomorrow. I've "fixed" this by returning some fixed low temperature if I see ffff in wf_lm75_get for now, but I *guess* it would be nice to have some way to detect the absence of the sensor (and tell it from a simple failure). However, the OF device trees still list the sensor and even the hard disk itself even on the diskless machines. Even if there were a way to detect the absence of the sensor, there's still the problem that windfarm_pm81.c insists on having a hd temp sensor to work, so a fix would probably require spoiling that wonderful if (sensor_cpu_power && sensor_cpu_temp && sensor_hd_temp) in there and replacing it with something like if (sensor_cpu_power && sensor_cpu_temp && (machine_has_hd() && sensor_hd_temp)) where I have no idea how to implement machine_has_hd(). A further similar hack would spoil wf_smu_sys_fans_tick, and uglyness prevails. In short: Am I doomed to hack the kernels of my diskless clients to eternity (or retrofit the sensors)? Or is there a sane way to treat that kind of problem? Thanks, Markus From arnd at arndb.de Thu Jan 5 06:55:53 2006 From: arnd at arndb.de (Arnd Bergmann) Date: Wed, 4 Jan 2006 19:55:53 +0000 Subject: [PATCH, version 7] cell: enable pause(0) in cpu_idle In-Reply-To: <200512201314.12932.arnd@arndb.de> References: <200512171228.21578.arnd@arndb.de> <200512201314.12932.arnd@arndb.de> Message-ID: <200601041955.53577.arnd@arndb.de> This patch enables support for pause(0) power management state for the Cell Broadband Processor, which is import for power efficient operation. The pervasive infrastructure will in the future enable us to introduce more functionality specific to the Cell's pervasive unit. From: Maximino Aguilar Signed-off-by: Arnd Bergmann --- The only comment I got for version 6 was about formatting of C style comments and I fixed those up, so let's hope this is the final version of the patch. Please apply to powerpc.git. diffstat: arch/powerpc/kernel/cputable.c | 2 arch/powerpc/kernel/traps.c | 6 arch/powerpc/platforms/cell/Makefile | 2 arch/powerpc/platforms/cell/pervasive.c | 229 ++++++++++++++++++++++ arch/powerpc/platforms/cell/pervasive.h | 62 +++++ arch/powerpc/platforms/cell/setup.c | 2 arch/powerpc/platforms/pseries/ras.c | 5 arch/powerpc/platforms/pseries/ras.h | 9 arch/powerpc/platforms/pseries/setup.c | 4 include/asm-powerpc/cputable.h | 4 include/asm-powerpc/machdep.h | 2 include/asm-powerpc/reg.h | 22 +- 12 files changed, 335 insertions(+), 14 deletions(-) Arnd <>< Index: linux-2.6.15-rc/arch/powerpc/platforms/cell/Makefile =================================================================== --- linux-2.6.15-rc.orig/arch/powerpc/platforms/cell/Makefile +++ linux-2.6.15-rc/arch/powerpc/platforms/cell/Makefile @@ -1,4 +1,6 @@ obj-y += interrupt.o iommu.o setup.o spider-pic.o +obj-y += pervasive.o + obj-$(CONFIG_SMP) += smp.o obj-$(CONFIG_SPU_FS) += spufs/ spu_base.o builtin-spufs-$(CONFIG_SPU_FS) += spu_syscalls.o Index: linux-2.6.15-rc/arch/powerpc/platforms/cell/pervasive.c =================================================================== --- /dev/null +++ linux-2.6.15-rc/arch/powerpc/platforms/cell/pervasive.c @@ -0,0 +1,229 @@ +/* + * CBE Pervasive Monitor and Debug + * + * (C) Copyright IBM Corporation 2005 + * + * Authors: Maximino Aguilar (maguilar at us.ibm.com) + * Michael N. Day (mnday at us.ibm.com) + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#undef DEBUG + +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +#include "pervasive.h" + +static DEFINE_SPINLOCK(cbe_pervasive_lock); +struct cbe_pervasive { + struct pmd_regs __iomem *regs; + unsigned int thread; +}; + +/* can't use per_cpu from setup_arch */ +static struct cbe_pervasive cbe_pervasive[NR_CPUS]; + +static void __init cbe_enable_pause_zero(void) +{ + unsigned long thread_switch_control; + unsigned long temp_register; + struct cbe_pervasive *p; + int thread; + + spin_lock_irq(&cbe_pervasive_lock); + p = &cbe_pervasive[smp_processor_id()]; + + if (!cbe_pervasive->regs) + goto out; + + pr_debug("Power Management: CPU %d\n", smp_processor_id()); + + /* Enable Pause(0) control bit */ + temp_register = in_be64(&p->regs->pm_control); + + out_be64(&p->regs->pm_control, + temp_register|PMD_PAUSE_ZERO_CONTROL); + + /* Enable DEC and EE interrupt request */ + thread_switch_control = mfspr(SPRN_TSC_CELL); + thread_switch_control |= TSC_CELL_EE_ENABLE | TSC_CELL_EE_BOOST; + + switch ((mfspr(SPRN_CTRLF) & CTRL_CT)) { + case CTRL_CT0: + thread_switch_control |= TSC_CELL_DEC_ENABLE_0; + thread = 0; + break; + case CTRL_CT1: + thread_switch_control |= TSC_CELL_DEC_ENABLE_1; + thread = 1; + break; + default: + printk(KERN_WARNING "%s: unknown configuration\n", + __FUNCTION__); + thread = -1; + break; + } + + if (p->thread != thread) + printk(KERN_WARNING "%s: device tree inconsistant, " + "cpu %i: %d/%d\n", __FUNCTION__, + smp_processor_id(), + p->thread, thread); + + mtspr(SPRN_TSC_CELL, thread_switch_control); + +out: + spin_unlock_irq(&cbe_pervasive_lock); +} + +static void cbe_idle(void) +{ + unsigned long ctrl; + + cbe_enable_pause_zero(); + + while (1) { + if (!need_resched()) { + local_irq_disable(); + while (!need_resched()) { + /* go into low thread priority */ + HMT_low(); + + /* + * atomically disable thread execution + * and runlatch. + * External and Decrementer exceptions + * are still handled when the thread + * is disabled but now enter in + * cbe_system_reset_exception() + */ + ctrl = mfspr(SPRN_CTRLF); + ctrl &= ~(CTRL_RUNLATCH | CTRL_TE); + mtspr(SPRN_CTRLT, ctrl); + } + /* restore thread prio */ + HMT_medium(); + local_irq_enable(); + } + + /* + * turn runlatch on again before scheduling the + * process we just woke up + */ + ppc64_runlatch_on(); + + preempt_enable_no_resched(); + schedule(); + preempt_disable(); + } +} + +int cbe_system_reset_exception(struct pt_regs *regs) +{ + switch (regs->msr & SRR1_WAKEMASK) { + case SRR1_WAKEEE: + do_IRQ(regs); + break; + case SRR1_WAKEDEC: + timer_interrupt(regs); + break; + case SRR1_WAKEMT: + /* no action required */ + break; + default: + /* do system reset */ + return 0; + } + /* everything handled */ + return 1; +} + +static int __init cbe_find_pmd_mmio(int cpu, struct cbe_pervasive *p) +{ + struct device_node *node; + unsigned int *int_servers; + char *addr; + unsigned long real_address; + unsigned int size; + + struct pmd_regs __iomem *pmd_mmio_area; + int hardid, thread; + int proplen; + + pmd_mmio_area = NULL; + hardid = get_hard_smp_processor_id(cpu); + for (node = NULL; (node = of_find_node_by_type(node, "cpu"));) { + int_servers = (void *) get_property(node, + "ibm,ppc-interrupt-server#s", &proplen); + if (!int_servers) { + printk(KERN_WARNING "%s misses " + "ibm,ppc-interrupt-server#s property", + node->full_name); + continue; + } + for (thread = 0; thread < proplen / sizeof (int); thread++) { + if (hardid == int_servers[thread]) { + addr = get_property(node, "pervasive", NULL); + goto found; + } + } + } + + printk(KERN_WARNING "%s: CPU %d not found\n", __FUNCTION__, cpu); + return -EINVAL; + +found: + real_address = *(unsigned long*) addr; + addr += sizeof (unsigned long); + size = *(unsigned int*) addr; + + pr_debug("pervasive area for CPU %d at %lx, size %x\n", + cpu, real_address, size); + p->regs = __ioremap(real_address, size, _PAGE_NO_CACHE); + p->thread = thread; + return 0; +} + +void __init cell_pervasive_init(void) +{ + struct cbe_pervasive *p; + int cpu; + int ret; + + if (!cpu_has_feature(CPU_FTR_PAUSE_ZERO)) + return; + + for_each_cpu(cpu) { + p = &cbe_pervasive[cpu]; + ret = cbe_find_pmd_mmio(cpu, p); + if (ret) + return; + } + + ppc_md.idle_loop = cbe_idle; + ppc_md.system_reset_exception = cbe_system_reset_exception; +} Index: linux-2.6.15-rc/arch/powerpc/platforms/cell/pervasive.h =================================================================== --- /dev/null +++ linux-2.6.15-rc/arch/powerpc/platforms/cell/pervasive.h @@ -0,0 +1,62 @@ +/* + * Cell Pervasive Monitor and Debug interface and HW structures + * + * (C) Copyright IBM Corporation 2005 + * + * Authors: Maximino Aguilar (maguilar at us.ibm.com) + * David J. Erb (djerb at us.ibm.com) + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + + +#ifndef PERVASIVE_H +#define PERVASIVE_H + +struct pmd_regs { + u8 pad_0x0000_0x0800[0x0800 - 0x0000]; /* 0x0000 */ + + /* Thermal Sensor Registers */ + u64 ts_ctsr1; /* 0x0800 */ + u64 ts_ctsr2; /* 0x0808 */ + u64 ts_mtsr1; /* 0x0810 */ + u64 ts_mtsr2; /* 0x0818 */ + u64 ts_itr1; /* 0x0820 */ + u64 ts_itr2; /* 0x0828 */ + u64 ts_gitr; /* 0x0830 */ + u64 ts_isr; /* 0x0838 */ + u64 ts_imr; /* 0x0840 */ + u64 tm_cr1; /* 0x0848 */ + u64 tm_cr2; /* 0x0850 */ + u64 tm_simr; /* 0x0858 */ + u64 tm_tpr; /* 0x0860 */ + u64 tm_str1; /* 0x0868 */ + u64 tm_str2; /* 0x0870 */ + u64 tm_tsr; /* 0x0878 */ + + /* Power Management */ + u64 pm_control; /* 0x0880 */ +#define PMD_PAUSE_ZERO_CONTROL 0x10000 + u64 pm_status; /* 0x0888 */ + + /* Time Base Register */ + u64 tbr; /* 0x0890 */ + + u8 pad_0x0898_0x1000 [0x1000 - 0x0898]; /* 0x0898 */ +}; + +void __init cell_pervasive_init(void); + +#endif Index: linux-2.6.15-rc/arch/powerpc/platforms/cell/setup.c =================================================================== --- linux-2.6.15-rc.orig/arch/powerpc/platforms/cell/setup.c +++ linux-2.6.15-rc/arch/powerpc/platforms/cell/setup.c @@ -49,6 +49,7 @@ #include "interrupt.h" #include "iommu.h" +#include "pervasive.h" #ifdef DEBUG #define DBG(fmt...) udbg_printf(fmt) @@ -165,6 +166,7 @@ static void __init cell_setup_arch(void) init_pci_config_tokens(); find_and_init_phbs(); spider_init_IRQ(); + cell_pervasive_init(); #ifdef CONFIG_DUMMY_CONSOLE conswitchp = &dummy_con; #endif Index: linux-2.6.15-rc/include/asm-powerpc/cputable.h =================================================================== --- linux-2.6.15-rc.orig/include/asm-powerpc/cputable.h +++ linux-2.6.15-rc/include/asm-powerpc/cputable.h @@ -105,6 +105,7 @@ extern void do_cpu_ftr_fixups(unsigned l #define CPU_FTR_LOCKLESS_TLBIE ASM_CONST(0x0000040000000000) #define CPU_FTR_MMCRA_SIHV ASM_CONST(0x0000080000000000) #define CPU_FTR_CI_LARGE_PAGE ASM_CONST(0x0000100000000000) +#define CPU_FTR_PAUSE_ZERO ASM_CONST(0x0000200000000000) #else /* ensure on 32b processors the flags are available for compiling but * don't do anything */ @@ -304,7 +305,8 @@ enum { CPU_FTR_MMCRA_SIHV, CPU_FTRS_CELL = CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | CPU_FTR_HPTE_TABLE | CPU_FTR_PPCAS_ARCH_V2 | - CPU_FTR_ALTIVEC_COMP | CPU_FTR_MMCRA | CPU_FTR_SMT, + CPU_FTR_ALTIVEC_COMP | CPU_FTR_MMCRA | CPU_FTR_SMT | + CPU_FTR_CTRL | CPU_FTR_PAUSE_ZERO, CPU_FTRS_COMPATIBLE = CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | CPU_FTR_HPTE_TABLE | CPU_FTR_PPCAS_ARCH_V2, #endif Index: linux-2.6.15-rc/include/asm-powerpc/reg.h =================================================================== --- linux-2.6.15-rc.orig/include/asm-powerpc/reg.h +++ linux-2.6.15-rc/include/asm-powerpc/reg.h @@ -145,6 +145,10 @@ #define SPRN_CTR 0x009 /* Count Register */ #define SPRN_CTRLF 0x088 #define SPRN_CTRLT 0x098 +#define CTRL_CT 0xc0000000 /* current thread */ +#define CTRL_CT0 0x80000000 /* thread 0 */ +#define CTRL_CT1 0x40000000 /* thread 1 */ +#define CTRL_TE 0x00c00000 /* thread enable */ #define CTRL_RUNLATCH 0x1 #define SPRN_DABR 0x3F5 /* Data Address Breakpoint Register */ #define DABR_TRANSLATION (1UL << 2) @@ -257,11 +261,11 @@ #define SPRN_HID6 0x3F9 /* BE HID 6 */ #define HID6_LB (0x0F<<12) /* Concurrent Large Page Modes */ #define HID6_DLP (1<<20) /* Disable all large page modes (4K only) */ -#define SPRN_TSCR 0x399 /* Thread switch control on BE */ -#define SPRN_TTR 0x39A /* Thread switch timeout on BE */ -#define TSCR_DEC_ENABLE 0x200000 /* Decrementer Interrupt */ -#define TSCR_EE_ENABLE 0x100000 /* External Interrupt */ -#define TSCR_EE_BOOST 0x080000 /* External Interrupt Boost */ +#define SPRN_TSC_CELL 0x399 /* Thread switch control on Cell */ +#define TSC_CELL_DEC_ENABLE_0 0x400000 /* Decrementer Interrupt */ +#define TSC_CELL_DEC_ENABLE_1 0x200000 /* Decrementer Interrupt */ +#define TSC_CELL_EE_ENABLE 0x100000 /* External Interrupt */ +#define TSC_CELL_EE_BOOST 0x080000 /* External Interrupt Boost */ #define SPRN_TSC 0x3FD /* Thread switch control on others */ #define SPRN_TST 0x3FC /* Thread switch timeout on others */ #if !defined(SPRN_IAC1) && !defined(SPRN_IAC2) @@ -375,6 +379,14 @@ #define SPRN_SPRG7 0x117 /* Special Purpose Register General 7 */ #define SPRN_SRR0 0x01A /* Save/Restore Register 0 */ #define SPRN_SRR1 0x01B /* Save/Restore Register 1 */ +#define SRR1_WAKEMASK 0x00380000 /* reason for wakeup */ +#define SRR1_WAKERESET 0x00380000 /* System reset */ +#define SRR1_WAKESYSERR 0x00300000 /* System error */ +#define SRR1_WAKEEE 0x00200000 /* External interrupt */ +#define SRR1_WAKEMT 0x00280000 /* mtctrl */ +#define SRR1_WAKEDEC 0x00180000 /* Decrementer interrupt */ +#define SRR1_WAKETHERM 0x00100000 /* Thermal management interrupt */ + #ifndef SPRN_SVR #define SPRN_SVR 0x11E /* System Version Register */ #endif Index: linux-2.6.15-rc/arch/powerpc/kernel/cputable.c =================================================================== --- linux-2.6.15-rc.orig/arch/powerpc/kernel/cputable.c +++ linux-2.6.15-rc/arch/powerpc/kernel/cputable.c @@ -273,7 +273,7 @@ struct cpu_spec cpu_specs[] = { .oprofile_model = &op_model_power4, #endif }, - { /* BE DD1.x */ + { /* Cell Broadband Engine */ .pvr_mask = 0xffff0000, .pvr_value = 0x00700000, .cpu_name = "Cell Broadband Engine", Index: linux-2.6.15-rc/arch/powerpc/kernel/traps.c =================================================================== --- linux-2.6.15-rc.orig/arch/powerpc/kernel/traps.c +++ linux-2.6.15-rc/arch/powerpc/kernel/traps.c @@ -230,8 +230,10 @@ void _exception(int signr, struct pt_reg void system_reset_exception(struct pt_regs *regs) { /* See if any machine dependent calls */ - if (ppc_md.system_reset_exception) - ppc_md.system_reset_exception(regs); + if (ppc_md.system_reset_exception) { + if (ppc_md.system_reset_exception(regs)) + return; + } die("System Reset", regs, SIGABRT); Index: linux-2.6.15-rc/arch/powerpc/platforms/pseries/ras.h =================================================================== --- /dev/null +++ linux-2.6.15-rc/arch/powerpc/platforms/pseries/ras.h @@ -0,0 +1,9 @@ +#ifndef _PSERIES_RAS_H +#define _PSERIES_RAS_H + +struct pt_regs; + +extern int pSeries_system_reset_exception(struct pt_regs *regs); +extern int pSeries_machine_check_exception(struct pt_regs *regs); + +#endif /* _PSERIES_RAS_H */ Index: linux-2.6.15-rc/arch/powerpc/platforms/pseries/setup.c =================================================================== --- linux-2.6.15-rc.orig/arch/powerpc/platforms/pseries/setup.c +++ linux-2.6.15-rc/arch/powerpc/platforms/pseries/setup.c @@ -69,6 +69,7 @@ #include #include "plpar_wrappers.h" +#include "ras.h" #ifdef DEBUG #define DBG(fmt...) udbg_printf(fmt) @@ -80,9 +81,6 @@ extern void find_udbg_vterm(void); int fwnmi_active; /* TRUE if an FWNMI handler is present */ -extern void pSeries_system_reset_exception(struct pt_regs *regs); -extern int pSeries_machine_check_exception(struct pt_regs *regs); - static void pseries_shared_idle(void); static void pseries_dedicated_idle(void); Index: linux-2.6.15-rc/arch/powerpc/platforms/pseries/ras.c =================================================================== --- linux-2.6.15-rc.orig/arch/powerpc/platforms/pseries/ras.c +++ linux-2.6.15-rc/arch/powerpc/platforms/pseries/ras.c @@ -51,6 +51,8 @@ #include #include +#include "ras.h" + static unsigned char ras_log_buf[RTAS_ERROR_LOG_MAX]; static DEFINE_SPINLOCK(ras_log_buf_lock); @@ -278,7 +280,7 @@ static void fwnmi_release_errinfo(void) printk("FWNMI: nmi-interlock failed: %d\n", ret); } -void pSeries_system_reset_exception(struct pt_regs *regs) +int pSeries_system_reset_exception(struct pt_regs *regs) { if (fwnmi_active) { struct rtas_error_log *errhdr = fwnmi_get_errinfo(regs); @@ -287,6 +289,7 @@ void pSeries_system_reset_exception(stru } fwnmi_release_errinfo(); } + return 0; /* need to perform reset */ } /* Index: linux-2.6.15-rc/include/asm-powerpc/machdep.h =================================================================== --- linux-2.6.15-rc.orig/include/asm-powerpc/machdep.h +++ linux-2.6.15-rc/include/asm-powerpc/machdep.h @@ -134,7 +134,7 @@ struct machdep_calls { void (*nvram_sync)(void); /* Exception handlers */ - void (*system_reset_exception)(struct pt_regs *regs); + int (*system_reset_exception)(struct pt_regs *regs); int (*machine_check_exception)(struct pt_regs *regs); /* Motherboard/chipset features. This is a kind of general purpose From arnd at arndb.de Thu Jan 5 06:31:24 2006 From: arnd at arndb.de (Arnd Bergmann) Date: Wed, 04 Jan 2006 20:31:24 +0100 Subject: [PATCH 04/13] spufs: serialize sys_spu_run per spu References: <20060104193120.050539000@localhost> Message-ID: <20060104194500.696404000@localhost> An embedded and charset-unspecified text was scrubbed... Name: spufs-serialize-spu-run.diff Url: http://ozlabs.org/pipermail/linuxppc64-dev/attachments/20060104/33e07b1e/attachment.txt From arnd at arndb.de Thu Jan 5 06:31:22 2006 From: arnd at arndb.de (Arnd Bergmann) Date: Wed, 04 Jan 2006 20:31:22 +0100 Subject: [PATCH 02/13] spufs: dont hold root->isem in spu_forget References: <20060104193120.050539000@localhost> Message-ID: <20060104194500.352612000@localhost> An embedded and charset-unspecified text was scrubbed... Name: spufs-final-iput.diff Url: http://ozlabs.org/pipermail/linuxppc64-dev/attachments/20060104/9d59f488/attachment.txt From arnd at arndb.de Thu Jan 5 06:31:21 2006 From: arnd at arndb.de (Arnd Bergmann) Date: Wed, 04 Jan 2006 20:31:21 +0100 Subject: [PATCH 01/13] spufs: fix locking in spu_acquire_runnable References: <20060104193120.050539000@localhost> Message-ID: <20060104194500.180477000@localhost> An embedded and charset-unspecified text was scrubbed... Name: spufs-lock.diff Url: http://ozlabs.org/pipermail/linuxppc64-dev/attachments/20060104/9c37eded/attachment.txt From arnd at arndb.de Thu Jan 5 06:31:28 2006 From: arnd at arndb.de (Arnd Bergmann) Date: Wed, 04 Jan 2006 20:31:28 +0100 Subject: [PATCH 08/13] spufs: clean up use of bitops References: <20060104193120.050539000@localhost> Message-ID: <20060104194501.381895000@localhost> An embedded and charset-unspecified text was scrubbed... Name: spufs-test-bit-cleanup.diff Url: http://ozlabs.org/pipermail/linuxppc64-dev/attachments/20060104/c6c77042/attachment.txt From arnd at arndb.de Thu Jan 5 06:31:27 2006 From: arnd at arndb.de (Arnd Bergmann) Date: Wed, 04 Jan 2006 20:31:27 +0100 Subject: [PATCH 07/13] spufs: fix spufs_fill_dir error path References: <20060104193120.050539000@localhost> Message-ID: <20060104194501.210484000@localhost> An embedded and charset-unspecified text was scrubbed... Name: spufs-fill-dir-leak.diff Url: http://ozlabs.org/pipermail/linuxppc64-dev/attachments/20060104/18b6b5d0/attachment.txt From arnd at arndb.de Thu Jan 5 06:31:26 2006 From: arnd at arndb.de (Arnd Bergmann) Date: Wed, 04 Jan 2006 20:31:26 +0100 Subject: [PATCH 06/13] spufs: dont leak directories in failed spu_create References: <20060104193120.050539000@localhost> Message-ID: <20060104194501.041011000@localhost> An embedded and charset-unspecified text was scrubbed... Name: spufs-create-fix-leak.diff Url: http://ozlabs.org/pipermail/linuxppc64-dev/attachments/20060104/251ae601/attachment.txt From arnd at arndb.de Thu Jan 5 06:31:30 2006 From: arnd at arndb.de (Arnd Bergmann) Date: Wed, 04 Jan 2006 20:31:30 +0100 Subject: [PATCH 10/13] spufs: abstract priv1 register access. References: <20060104193120.050539000@localhost> Message-ID: <20060104194501.737741000@localhost> An embedded and charset-unspecified text was scrubbed... Name: spufs-priv1-hvcall.diff Url: http://ozlabs.org/pipermail/linuxppc64-dev/attachments/20060104/6115452f/attachment.txt From arnd at arndb.de Thu Jan 5 06:31:23 2006 From: arnd at arndb.de (Arnd Bergmann) Date: Wed, 04 Jan 2006 20:31:23 +0100 Subject: [PATCH 03/13] spufs: check for proper file pointer in sys_spu_run References: <20060104193120.050539000@localhost> Message-ID: <20060104194500.522025000@localhost> An embedded and charset-unspecified text was scrubbed... Name: spufs-run-check-fd.diff Url: http://ozlabs.org/pipermail/linuxppc64-dev/attachments/20060104/cbc9a713/attachment.txt From arnd at arndb.de Thu Jan 5 06:31:29 2006 From: arnd at arndb.de (Arnd Bergmann) Date: Wed, 04 Jan 2006 20:31:29 +0100 Subject: [PATCH 09/13] spufs: move spu_run call to its own file References: <20060104193120.050539000@localhost> Message-ID: <20060104194501.555900000@localhost> An embedded and charset-unspecified text was scrubbed... Name: spufs-run-c-2.diff Url: http://ozlabs.org/pipermail/linuxppc64-dev/attachments/20060104/4dbafa57/attachment.txt From arnd at arndb.de Thu Jan 5 06:31:25 2006 From: arnd at arndb.de (Arnd Bergmann) Date: Wed, 04 Jan 2006 20:31:25 +0100 Subject: [PATCH 05/13] spufs fix spu_acquire_runnable error path References: <20060104193120.050539000@localhost> Message-ID: <20060104194500.870361000@localhost> An embedded and charset-unspecified text was scrubbed... Name: spufs-aquire-runnable-fix.diff Url: http://ozlabs.org/pipermail/linuxppc64-dev/attachments/20060104/adb56348/attachment.txt From arnd at arndb.de Thu Jan 5 06:31:32 2006 From: arnd at arndb.de (Arnd Bergmann) Date: Wed, 04 Jan 2006 20:31:32 +0100 Subject: [PATCH 12/13] spufs: fix allocation on 64k pages References: <20060104193120.050539000@localhost> Message-ID: <20060104194502.080544000@localhost> An embedded and charset-unspecified text was scrubbed... Name: spufs-64k-page.diff Url: http://ozlabs.org/pipermail/linuxppc64-dev/attachments/20060104/6557d08c/attachment.txt From arnd at arndb.de Thu Jan 5 06:31:33 2006 From: arnd at arndb.de (Arnd Bergmann) Date: Wed, 04 Jan 2006 20:31:33 +0100 Subject: [PATCH 13/13] spufs: set irq affinity for running threads References: <20060104193120.050539000@localhost> Message-ID: <20060104194502.253418000@localhost> An embedded and charset-unspecified text was scrubbed... Name: spu-irq-affinity.diff Url: http://ozlabs.org/pipermail/linuxppc64-dev/attachments/20060104/5d14f103/attachment.txt From arnd at arndb.de Thu Jan 5 06:31:20 2006 From: arnd at arndb.de (Arnd Bergmann) Date: Wed, 04 Jan 2006 20:31:20 +0100 Subject: [PATCH 00/13] spufs fixes and cleanups Message-ID: <20060104193120.050539000@localhost> In a review almost a month ago, Al Viro found numerous problems in the current spufs code. I now finally found some time to go through those and attempt to fix them. There are also a few other changes in this series that should also help, in particular improved interrupt sending and an abstraction for priviledged register access (as suggested by Masato Noguchi and Geoff Levand). Please apply to powerpc.git before sending spufs upstream. Al, could you have a look over this to see if it addresses all the concerns you had and if I broke it in new ways? Arnd <>< arch/powerpc/platforms/cell/Makefile | 5 arch/powerpc/platforms/cell/interrupt.c | 42 ++-- arch/powerpc/platforms/cell/interrupt.h | 1 arch/powerpc/platforms/cell/spu_base.c | 67 +++---- arch/powerpc/platforms/cell/spu_priv1.c | 133 ++++++++++++++ arch/powerpc/platforms/cell/spufs/Makefile | 2 arch/powerpc/platforms/cell/spufs/file.c | 167 +---------------- arch/powerpc/platforms/cell/spufs/hw_ops.c | 19 -- arch/powerpc/platforms/cell/spufs/inode.c | 156 ++++++++------- arch/powerpc/platforms/cell/spufs/run.c | 131 ++++++++++++++ arch/powerpc/platforms/cell/spufs/sched.c | 13 + arch/powerpc/platforms/cell/spufs/spufs.h | 35 +++ arch/powerpc/platforms/cell/spufs/switch.c | 139 +++++---------- arch/powerpc/platforms/cell/spufs/syscalls.c | 5 arch/powerpc/platforms/cell/spufs/context.c | 11 - include/asm-powerpc/spu.h | 42 +++- 20 files changed, 565 insertions(+), 407 deletions(-) From arnd at arndb.de Thu Jan 5 06:31:31 2006 From: arnd at arndb.de (Arnd Bergmann) Date: Wed, 04 Jan 2006 20:31:31 +0100 Subject: [PATCH 11/13] spufs: fix sparse warnings References: <20060104193120.050539000@localhost> Message-ID: <20060104194501.915556000@localhost> An embedded and charset-unspecified text was scrubbed... Name: spufs-sparse-fixes.diff Url: http://ozlabs.org/pipermail/linuxppc64-dev/attachments/20060104/fcedcd1f/attachment.txt From benh at kernel.crashing.org Thu Jan 5 10:41:29 2006 From: benh at kernel.crashing.org (Benjamin Herrenschmidt) Date: Thu, 05 Jan 2006 10:41:29 +1100 Subject: Phantom pain with windfarm on diskless iMac G5 In-Reply-To: <20060104142006.GA8782@victor.cl.uni-heidelberg.de> References: <20060104142006.GA8782@victor.cl.uni-heidelberg.de> Message-ID: <1136418090.4840.21.camel@localhost.localdomain> On Wed, 2006-01-04 at 15:20 +0100, Markus Demleitner wrote: > Hi, > > I tried 2.6.15 on my diskless iMac G5 clients today, resulting in > 747 emulation mode (vrooom...!). It turns out windfarm was > querying the hard disk temperature sensor, which usually is mounted > on the mounting bracket Apple uses. We made the mistake of removing > these (from about 30 machines:-(), which in turn made > windfarm_lm75_sensor.c:wf_lm75_get return ffff, which translates into > about 255 degrees celsius. No wonder windfarm pumped like there's no > tomorrow. > > I've "fixed" this by returning some fixed low temperature if I see > ffff in wf_lm75_get for now, but I *guess* it would be nice to have > some way to detect the absence of the sensor (and tell it from a > simple failure). However, the OF device trees still list the sensor > and even the hard disk itself even on the diskless machines. The problem is to differenciate between a diskless machine and a defective sensor. In the later case, you _want_ to pump the fans. > Even if there were a way to detect the absence of the sensor, there's > still the problem that windfarm_pm81.c insists on having a hd temp > sensor to work, so a fix would probably require spoiling that > wonderful > if (sensor_cpu_power && sensor_cpu_temp && sensor_hd_temp) > in there and replacing it with something like > if (sensor_cpu_power && sensor_cpu_temp && (machine_has_hd() > && sensor_hd_temp)) > where I have no idea how to implement machine_has_hd(). A further > similar hack would spoil wf_smu_sys_fans_tick, and uglyness prevails. > > In short: Am I doomed to hack the kernels of my diskless clients to > eternity (or retrofit the sensors)? Or is there a sane way to treat > that kind of problem? Hrm... That isn't trivial as I don't see a clean way to detect that the HD is not there from windfarm without doing gross hacks, unless we can somewhat rely on the device-tree there... What we could do is: - Make pm81 start the control loops regardless of the presence of the sensor, and have the control loop itself set the disk fan to an arbitrary low value if the sensor is not there. If the sensor kicks in "later" (because lm75 loads later), it will automatically start using the full control loop. That is easy. - In lm75 itself, in case of failure, add a little hack that tests if the disk is present by looking in the device-tree, provided again that there is a node for it that can be detected... If not, then return an arbitrarily low temperature instead of a failure. Either that or a module/kernel command line option... The later is easier but less "neat" :) Ben. From ntl at pobox.com Thu Jan 5 15:42:27 2006 From: ntl at pobox.com (Nathan Lynch) Date: Wed, 4 Jan 2006 22:42:27 -0600 Subject: [PATCH 13/13] spufs: set irq affinity for running threads In-Reply-To: <20060104194502.253418000@localhost> References: <20060104193120.050539000@localhost> <20060104194502.253418000@localhost> Message-ID: <20060105044227.GD16729@localhost.localdomain> Arnd Bergmann wrote: > For far, all SPU triggered interrupts always end up on > the first SMT thread, which is a bad solution. > > This patch implements setting the affinity to the > CPU that was running last when entering execution on > an SPU. This should result in a significant reduction > in IPI calls and better cache locality for SPE thread > specific data. ... > --- linux-2.6.15-rc.orig/arch/powerpc/platforms/cell/spufs/sched.c > +++ linux-2.6.15-rc/arch/powerpc/platforms/cell/spufs/sched.c > @@ -357,6 +357,11 @@ int spu_activate(struct spu_context *ctx > if (!spu) > return (signal_pending(current)) ? -ERESTARTSYS : -EAGAIN; > bind_context(spu, ctx); > + /* > + * We're likely to wait for interrupts on the same > + * CPU that we are now on, so send them here. > + */ > + spu_irq_setaffinity(spu, smp_processor_id()); With CONFIG_DEBUG_PREEMPT this will give a warning about using smp_processor_id in pre-emptible context if I'm reading the code correctly. Maybe use raw_smp_processor_id, since setting the affinity to this cpu isn't a hard requirement? From benh at kernel.crashing.org Thu Jan 5 16:39:44 2006 From: benh at kernel.crashing.org (Benjamin Herrenschmidt) Date: Thu, 05 Jan 2006 16:39:44 +1100 Subject: [PATCH] powerpc: Add PowerMac platform function interpreter Message-ID: <1136439584.4840.48.camel@localhost.localdomain> (Preliminary, still need a little bit of work, but I would greatly appreciate some regression testing with ARCH=powerpc, this code doesn't affect ARCH=ppc, especially on any laptop or desktop released in the past 3 or 4 years). This patch adds an interpreter for the PowerMac "platform-do-*" scripts found in the device-tree, along with some of the backends to be able to execute the primitives in there. For now, the backends for uninorth/u3, the macio chip, the gpios and some devices hanging off keywest i2c. In order to do so, I had to significantly rework the PowerMac "low_i2c" layer, this work isn't complete yet as you can see. Ultimately, it will be able to help in matching device nodes to i2c interfaces. I also might kill the existing i2c-keywest and i2c-pmac-smu drivers and just do a single "stub" driver that layers on top of the low i2c. Right now, it only provides keywest platform functions of the i2c hwclock, some more work will be needed to properly do some of the manipulations needed with the hwclock hanging off the PMU bus, on some windtunnel machines for example. Currently, the code for matching with i2c_adpater isn't working as none of the "high level" drivers is calling the necessary hooks, I'll fix that in a future version of that patch. I removed the clock spreading hacks in feature.c too, since they should now be entirely done by the platform functions, but I couldn't test properly as I don't have access to one of the laptops that has those... It's a bit difficult to "veryfiy" if it works now that bogomips are gone on powerpc, since the consequence of it not working is the CPU running about 20% slower than it should, thus I'll have to write a small test program that attempts to "measure" the processor frequency... I also changed the SMP code for newer G5s (multi core) to use the platform function when available for the timebase freeze, that appears to work properly on my Quad. Anyway, here it is, comments welcome... Signed-off-by: Benjamin Herrenschmidt Index: linux-work/include/asm-powerpc/pmac_pfunc.h =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 +++ linux-work/include/asm-powerpc/pmac_pfunc.h 2006-01-04 18:35:10.000000000 +1100 @@ -0,0 +1,253 @@ +#ifndef __PMAC_PFUNC_H__ +#define __PMAC_PFUNC_H__ + +#include +#include + +/* Flags in command lists */ +#define PMF_FLAGS_ON_INIT 0x80000000u +#define PMF_FLGAS_ON_TERM 0x40000000u +#define PMF_FLAGS_ON_SLEEP 0x20000000u +#define PMF_FLAGS_ON_WAKE 0x10000000u +#define PMF_FLAGS_ON_DEMAND 0x08000000u +#define PMF_FLAGS_INT_GEN 0x04000000u +#define PMF_FLAGS_HIGH_SPEED 0x02000000u +#define PMF_FLAGS_LOW_SPEED 0x01000000u +#define PMF_FLAGS_SIDE_EFFECTS 0x00800000u + +/* + * Arguments to a platform function call. + * + * NOTE: By convention, pointer arguments point to an u32 + */ +struct pmf_args { + union { + u32 v; + u32 *p; + } u[4]; + unsigned int count; +}; + +/* + * A driver capable of interpreting commands provides a handlers + * structure filled with whatever handlers are implemented by this + * driver. Non implemented handlers are left NULL. + * + * PMF_STD_ARGS are the same arguments that are passed to the parser + * and that gets passed back to the various handlers. + * + * Interpreting a given function always start with a begin() call which + * returns an instance data to be passed around subsequent calls, and + * ends with an end() call. This allows the low level driver to implement + * locking policy or per-function instance data. + * + * For interrupt capable functions, irq_enable() is called when a client + * registers, and irq_disable() is called when the last client unregisters + * Note that irq_enable & irq_disable are called within a semaphore held + * by the core, thus you should not try to register yourself to some other + * pmf interrupt during those calls. + */ + +#define PMF_STD_ARGS struct pmf_function *func, void *instdata, \ + struct pmf_args *args + +struct pmf_function; + +struct pmf_handlers { + void * (*begin)(struct pmf_function *func, struct pmf_args *args); + void (*end)(struct pmf_function *func, void *instdata); + + int (*irq_enable)(struct pmf_function *func); + int (*irq_disable)(struct pmf_function *func); + + int (*write_gpio)(PMF_STD_ARGS, u8 value, u8 mask); + int (*read_gpio)(PMF_STD_ARGS, u8 mask, int rshift, u8 xor); + + int (*write_reg32)(PMF_STD_ARGS, u32 offset, u32 value, u32 mask); + int (*read_reg32)(PMF_STD_ARGS, u32 offset); + int (*write_reg16)(PMF_STD_ARGS, u32 offset, u16 value, u16 mask); + int (*read_reg16)(PMF_STD_ARGS, u32 offset); + int (*write_reg8)(PMF_STD_ARGS, u32 offset, u8 value, u8 mask); + int (*read_reg8)(PMF_STD_ARGS, u32 offset); + + int (*delay)(PMF_STD_ARGS, u32 duration); + + int (*wait_reg32)(PMF_STD_ARGS, u32 offset, u32 value, u32 mask); + int (*wait_reg16)(PMF_STD_ARGS, u32 offset, u16 value, u16 mask); + int (*wait_reg8)(PMF_STD_ARGS, u32 offset, u8 value, u8 mask); + + int (*read_i2c)(PMF_STD_ARGS, u32 len); + int (*write_i2c)(PMF_STD_ARGS, u32 len, const u8 *data); + int (*rmw_i2c)(PMF_STD_ARGS, u32 masklen, u32 valuelen, u32 totallen, + const u8 *maskdata, const u8 *valuedata); + + int (*read_cfg)(PMF_STD_ARGS, u32 offset, u32 len); + int (*write_cfg)(PMF_STD_ARGS, u32 offset, u32 len, const u8 *data); + int (*rmw_cfg)(PMF_STD_ARGS, u32 offset, u32 masklen, u32 valuelen, + u32 totallen, const u8 *maskdata, const u8 *valuedata); + + int (*read_i2c_sub)(PMF_STD_ARGS, u8 subaddr, u32 len); + int (*write_i2c_sub)(PMF_STD_ARGS, u8 subaddr, u32 len, const u8 *data); + int (*set_i2c_mode)(PMF_STD_ARGS, int mode); + int (*rmw_i2c_sub)(PMF_STD_ARGS, u8 subaddr, u32 masklen, u32 valuelen, + u32 totallen, const u8 *maskdata, + const u8 *valuedata); + + int (*read_reg32_msrx)(PMF_STD_ARGS, u32 offset, u32 mask, u32 shift, + u32 xor); + int (*read_reg16_msrx)(PMF_STD_ARGS, u32 offset, u32 mask, u32 shift, + u32 xor); + int (*read_reg8_msrx)(PMF_STD_ARGS, u32 offset, u32 mask, u32 shift, + u32 xor); + + int (*write_reg32_slm)(PMF_STD_ARGS, u32 offset, u32 shift, u32 mask); + int (*write_reg16_slm)(PMF_STD_ARGS, u32 offset, u32 shift, u32 mask); + int (*write_reg8_slm)(PMF_STD_ARGS, u32 offset, u32 shift, u32 mask); + + int (*mask_and_compare)(PMF_STD_ARGS, u32 len, const u8 *maskdata, + const u8 *valuedata); + + struct module *owner; +}; + + +/* + * Drivers who expose platform functions register at init time, this + * causes the platform functions for that device node to be parsed in + * advance and associated with the device. The data structures are + * partially public so a driver can walk the list of platform functions + * and eventually inspect the flags + */ +struct pmf_device; + +struct pmf_function { + /* All functions for a given driver are linked */ + struct list_head link; + + /* Function node & driver data */ + struct device_node *node; + void *driver_data; + + /* For internal use by core */ + struct pmf_device *dev; + + /* The name is the "xxx" in "platform-do-xxx", this is how + * platform functions are identified by this code. Some functions + * only operate for a given target, in which case the phandle is + * here (or 0 if the filter doesn't apply) + */ + const char *name; + u32 phandle; + + /* The flags for that function. You can have several functions + * with the same name and different flag + */ + u32 flags; + + /* The actual tokenized function blob */ + const void *data; + unsigned int length; + + /* Interrupt clients */ + struct list_head irq_clients; + + /* Refcounting */ + struct kref ref; +}; + +/* + * For platform functions that are interrupts, one can register + * irq_client structures. You canNOT use the same structure twice + * as it contains a link member. Also, the callback is called with + * a spinlock held, you must not call back into any of the pmf_* functions + * from within that callback + */ +struct pmf_irq_client { + void (*handler)(void *data); + void *data; + struct module *owner; + struct list_head link; +}; + + +/* + * Register/Unregister a function-capable driver and its handlers + */ +extern int pmf_register_driver(struct device_node *np, + struct pmf_handlers *handlers, + void *driverdata); + +extern void pmf_unregister_driver(struct device_node *np); + + +/* + * Register/Unregister interrupt clients + */ +extern int pmf_register_irq_client(struct device_node *np, + const char *name, + struct pmf_irq_client *client); + +extern void pmf_unregister_irq_client(struct device_node *np, + const char *name, + struct pmf_irq_client *client); + +/* + * Called by the handlers when an irq happens + */ +extern void pmf_do_irq(struct pmf_function *func); + + +/* + * Low level call to platform functions. + * + * The phandle can filter on the target object for functions that have + * multiple targets, the flags allow you to restrict the call to a given + * combination of flags. + * + * The args array contains as many arguments as is required by the function, + * this is dependent on the function you are calling, unfortunately Apple + * mecanism provides no way to encode that so you have to get it right at + * the call site. Some functions require no args, in which case, you can + * pass NULL. + * + * You can also pass NULL to the name. This will match any function that has + * the appropriate combination of flags & phandle or you can pass 0 to the + * phandle to match any + */ +extern int pmf_do_functions(struct device_node *np, const char *name, + u32 phandle, u32 flags, struct pmf_args *args); + + + +/* + * High level call to a platform function. + * + * This one looks for the platform-xxx first so you should call it to the + * actual target if any. It will fallback to platform-do-xxx if it can't + * find one. It will also exclusively target functions that have + * the "OnDemand" flag. + */ + +extern int pmf_call_function(struct device_node *target, const char *name, + struct pmf_args *args); + + +/* + * For low latency interrupt usage, you can lookup for on-demand functions + * using the functions below + */ + +extern struct pmf_function *pmf_find_function(struct device_node *target, + const char *name); + +extern struct pmf_function * pmf_get_function(struct pmf_function *func); +extern void pmf_put_function(struct pmf_function *func); + +extern int pmf_call_one(struct pmf_function *func, struct pmf_args *args); + + +/* Suspend/resume code called by via-pmu directly for now */ +extern void pmac_pfunc_base_suspend(void); +extern void pmac_pfunc_base_resume(void); + +#endif /* __PMAC_PFUNC_H__ */ Index: linux-work/arch/powerpc/platforms/powermac/Makefile =================================================================== --- linux-work.orig/arch/powerpc/platforms/powermac/Makefile 2006-01-04 11:55:10.000000000 +1100 +++ linux-work/arch/powerpc/platforms/powermac/Makefile 2006-01-04 11:55:25.000000000 +1100 @@ -1,7 +1,8 @@ CFLAGS_bootx_init.o += -fPIC obj-y += pic.o setup.o time.o feature.o pci.o \ - sleep.o low_i2c.o cache.o + sleep.o low_i2c.o cache.o pfunc_core.o \ + pfunc_base.o obj-$(CONFIG_PMAC_BACKLIGHT) += backlight.o obj-$(CONFIG_CPU_FREQ_PMAC) += cpufreq_32.o obj-$(CONFIG_CPU_FREQ_PMAC64) += cpufreq_64.o Index: linux-work/arch/powerpc/platforms/powermac/feature.c =================================================================== --- linux-work.orig/arch/powerpc/platforms/powermac/feature.c 2006-01-04 11:55:10.000000000 +1100 +++ linux-work/arch/powerpc/platforms/powermac/feature.c 2006-01-04 16:36:11.000000000 +1100 @@ -58,12 +58,11 @@ extern int powersave_nap; extern struct device_node *k2_skiplist[2]; - /* * We use a single global lock to protect accesses. Each driver has * to take care of its own locking */ -static DEFINE_SPINLOCK(feature_lock); +DEFINE_SPINLOCK(feature_lock); #define LOCK(flags) spin_lock_irqsave(&feature_lock, flags); #define UNLOCK(flags) spin_unlock_irqrestore(&feature_lock, flags); @@ -106,22 +105,12 @@ }; +struct device_node *uninorth_node; +u32 __iomem *uninorth_base; -/* - * Uninorth reg. access. Note that Uni-N regs are big endian - */ - -#define UN_REG(r) (uninorth_base + ((r) >> 2)) -#define UN_IN(r) (in_be32(UN_REG(r))) -#define UN_OUT(r,v) (out_be32(UN_REG(r), (v))) -#define UN_BIS(r,v) (UN_OUT((r), UN_IN(r) | (v))) -#define UN_BIC(r,v) (UN_OUT((r), UN_IN(r) & ~(v))) - -static struct device_node *uninorth_node; -static u32 __iomem *uninorth_base; static u32 uninorth_rev; static int uninorth_maj; -static void __iomem *u3_ht; +static void __iomem *u3_ht_base; /* * For each motherboard family, we have a table of functions pointers @@ -1560,8 +1549,10 @@ #ifndef CONFIG_POWER4 -static void -keylargo_shutdown(struct macio_chip *macio, int sleep_mode) + +#ifdef CONFIG_PM + +static void keylargo_shutdown(struct macio_chip *macio, int sleep_mode) { u32 temp; @@ -1614,8 +1605,7 @@ (void)MACIO_IN32(KEYLARGO_FCR0); mdelay(1); } -static void -pangea_shutdown(struct macio_chip *macio, int sleep_mode) +static void pangea_shutdown(struct macio_chip *macio, int sleep_mode) { u32 temp; @@ -1648,8 +1638,7 @@ (void)MACIO_IN32(KEYLARGO_FCR0); mdelay(1); } -static void -intrepid_shutdown(struct macio_chip *macio, int sleep_mode) +static void intrepid_shutdown(struct macio_chip *macio, int sleep_mode) { u32 temp; @@ -1676,125 +1665,6 @@ mdelay(10); } - -void pmac_tweak_clock_spreading(int enable) -{ - struct macio_chip *macio = &macio_chips[0]; - - /* Hack for doing clock spreading on some machines PowerBooks and - * iBooks. This implements the "platform-do-clockspreading" OF - * property as decoded manually on various models. For safety, we also - * check the product ID in the device-tree in cases we'll whack the i2c - * chip to make reasonably sure we won't set wrong values in there - * - * Of course, ultimately, we have to implement a real parser for - * the platform-do-* stuff... - */ - - if (macio->type == macio_intrepid) { - struct device_node *clock = - of_find_node_by_path("/uni-n at f8000000/hw-clock"); - if (clock && get_property(clock, "platform-do-clockspreading", - NULL)) { - printk(KERN_INFO "%sabling clock spreading on Intrepid" - " ASIC\n", enable ? "En" : "Dis"); - if (enable) - UN_OUT(UNI_N_CLOCK_SPREADING, 2); - else - UN_OUT(UNI_N_CLOCK_SPREADING, 0); - mdelay(40); - } - of_node_put(clock); - } - - while (machine_is_compatible("PowerBook5,2") || - machine_is_compatible("PowerBook5,3") || - machine_is_compatible("PowerBook6,2") || - machine_is_compatible("PowerBook6,3")) { - struct device_node *ui2c = of_find_node_by_type(NULL, "i2c"); - struct device_node *dt = of_find_node_by_name(NULL, "device-tree"); - u8 buffer[9]; - u32 *productID; - int i, rc, changed = 0; - - if (dt == NULL) - break; - productID = (u32 *)get_property(dt, "pid#", NULL); - if (productID == NULL) - break; - while(ui2c) { - struct device_node *p = of_get_parent(ui2c); - if (p && !strcmp(p->name, "uni-n")) - break; - ui2c = of_find_node_by_type(ui2c, "i2c"); - } - if (ui2c == NULL) - break; - DBG("Trying to bump clock speed for PID: %08x...\n", *productID); - rc = pmac_low_i2c_open(ui2c, 1); - if (rc != 0) - break; - pmac_low_i2c_setmode(ui2c, pmac_low_i2c_mode_combined); - rc = pmac_low_i2c_xfer(ui2c, 0xd2 | pmac_low_i2c_read, 0x80, buffer, 9); - DBG("read result: %d,", rc); - if (rc != 0) { - pmac_low_i2c_close(ui2c); - break; - } - for (i=0; i<9; i++) - DBG(" %02x", buffer[i]); - DBG("\n"); - - switch(*productID) { - case 0x1182: /* AlBook 12" rev 2 */ - case 0x1183: /* iBook G4 12" */ - buffer[0] = (buffer[0] & 0x8f) | 0x70; - buffer[2] = (buffer[2] & 0x7f) | 0x00; - buffer[5] = (buffer[5] & 0x80) | 0x31; - buffer[6] = (buffer[6] & 0x40) | 0xb0; - buffer[7] = (buffer[7] & 0x00) | (enable ? 0xc0 : 0xba); - buffer[8] = (buffer[8] & 0x00) | 0x30; - changed = 1; - break; - case 0x3142: /* AlBook 15" (ATI M10) */ - case 0x3143: /* AlBook 17" (ATI M10) */ - buffer[0] = (buffer[0] & 0xaf) | 0x50; - buffer[2] = (buffer[2] & 0x7f) | 0x00; - buffer[5] = (buffer[5] & 0x80) | 0x31; - buffer[6] = (buffer[6] & 0x40) | 0xb0; - buffer[7] = (buffer[7] & 0x00) | (enable ? 0xd0 : 0xc0); - buffer[8] = (buffer[8] & 0x00) | 0x30; - changed = 1; - break; - default: - DBG("i2c-hwclock: Machine model not handled\n"); - break; - } - if (!changed) { - pmac_low_i2c_close(ui2c); - break; - } - printk(KERN_INFO "%sabling clock spreading on i2c clock chip\n", - enable ? "En" : "Dis"); - - pmac_low_i2c_setmode(ui2c, pmac_low_i2c_mode_stdsub); - rc = pmac_low_i2c_xfer(ui2c, 0xd2 | pmac_low_i2c_write, 0x80, buffer, 9); - DBG("write result: %d,", rc); - pmac_low_i2c_setmode(ui2c, pmac_low_i2c_mode_combined); - rc = pmac_low_i2c_xfer(ui2c, 0xd2 | pmac_low_i2c_read, 0x80, buffer, 9); - DBG("read result: %d,", rc); - if (rc != 0) { - pmac_low_i2c_close(ui2c); - break; - } - for (i=0; i<9; i++) - DBG(" %02x", buffer[i]); - pmac_low_i2c_close(ui2c); - break; - } -} - - static int core99_sleep(void) { @@ -1951,6 +1821,8 @@ return 0; } +#endif /* CONFIG_PM */ + static long core99_sleep_state(struct device_node *node, long param, long value) { @@ -1972,10 +1844,13 @@ if ((pmac_mb.board_flags & PMAC_MB_CAN_SLEEP) == 0) return -EPERM; +#ifdef CONFIG_PM if (value == 1) return core99_sleep(); else if (value == 0) return core99_wake_up(); + +#endif /* CONFIG_PM */ return 0; } @@ -2099,7 +1974,9 @@ { PMAC_FTR_USB_ENABLE, core99_usb_enable }, { PMAC_FTR_1394_ENABLE, core99_firewire_enable }, { PMAC_FTR_1394_CABLE_POWER, core99_firewire_cable_power }, +#ifdef CONFIG_PM { PMAC_FTR_SLEEP_STATE, core99_sleep_state }, +#endif #ifdef CONFIG_SMP { PMAC_FTR_RESET_CPU, core99_reset_cpu }, #endif /* CONFIG_SMP */ @@ -2690,7 +2567,7 @@ uninorth_base = ioremap(address, 0x40000); uninorth_rev = in_be32(UN_REG(UNI_N_VERSION)); if (uninorth_maj == 3 || uninorth_maj == 4) - u3_ht = ioremap(address + U3_HT_CONFIG_BASE, 0x1000); + u3_ht_base = ioremap(address + U3_HT_CONFIG_BASE, 0x1000); printk(KERN_INFO "Found %s memory controller & host bridge" " @ 0x%08x revision: 0x%02x\n", uninorth_maj == 3 ? "U3" : @@ -2980,12 +2857,6 @@ MACIO_BIC(HEATHROW_FCR, HRW_SOUND_POWER_N); } - /* Some machine models need the clock chip to be properly setup for - * clock spreading now. This should be a platform function but we - * don't do these at the moment - */ - pmac_tweak_clock_spreading(1); - #endif /* CONFIG_POWER4 */ /* On all machines, switch modem & serial ports off */ @@ -3013,9 +2884,6 @@ return; } - /* Setup low-level i2c stuffs */ - pmac_init_low_i2c(); - /* Probe machine type */ if (probe_motherboard()) printk(KERN_WARNING "Unknown PowerMac !\n"); @@ -3048,9 +2916,9 @@ u8 px_bus, px_devfn; struct pci_controller *px_hose; - (void)in_be32(u3_ht + U3_HT_LINK_COMMAND); - ucfg = cfg = in_be32(u3_ht + U3_HT_LINK_CONFIG); - ufreq = freq = in_be32(u3_ht + U3_HT_LINK_FREQ); + (void)in_be32(u3_ht_base + U3_HT_LINK_COMMAND); + ucfg = cfg = in_be32(u3_ht_base + U3_HT_LINK_CONFIG); + ufreq = freq = in_be32(u3_ht_base + U3_HT_LINK_FREQ); dump_HT_speeds("U3 HyperTransport", cfg, freq); pcix_node = of_find_compatible_node(NULL, "pci", "pci-x"); Index: linux-work/arch/powerpc/platforms/powermac/pfunc_base.c =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 +++ linux-work/arch/powerpc/platforms/powermac/pfunc_base.c 2006-01-04 17:51:17.000000000 +1100 @@ -0,0 +1,405 @@ +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#define DBG(fmt...) printk(fmt) + +static irqreturn_t macio_gpio_irq(int irq, void *data, struct pt_regs *regs) +{ + pmf_do_irq(data); + + return IRQ_HANDLED; +} + +static int macio_do_gpio_irq_enable(struct pmf_function *func) +{ + if (func->node->n_intrs < 1) + return -EINVAL; + + return request_irq(func->node->intrs[0].line, macio_gpio_irq, 0, + func->node->name, func); +} + +static int macio_do_gpio_irq_disable(struct pmf_function *func) +{ + if (func->node->n_intrs < 1) + return -EINVAL; + + free_irq(func->node->intrs[0].line, func); + return 0; +} + +static int macio_do_gpio_write(PMF_STD_ARGS, u8 value, u8 mask) +{ + u8 __iomem *addr = (u8 __iomem *)func->driver_data; + unsigned long flags; + u8 tmp; + + /* Check polarity */ + if (args && args->count && !args->u[0].v) + value = ~value; + + /* Toggle the GPIO */ + spin_lock_irqsave(&feature_lock, flags); + tmp = readb(addr); + tmp = (tmp & ~mask) | (value & mask); + DBG("Do write 0x%02x to GPIO %s (%p)\n", + tmp, func->node->full_name, addr); + writeb(tmp, addr); + spin_unlock_irqrestore(&feature_lock, flags); + + return 0; +} + +static int macio_do_gpio_read(PMF_STD_ARGS, u8 mask, int rshift, u8 xor) +{ + u8 __iomem *addr = (u8 __iomem *)func->driver_data; + u32 value; + + /* Check if we have room for reply */ + if (args == NULL || args->count == 0 || args->u[0].p == NULL) + return -EINVAL; + + value = readb(addr); + *args->u[0].p = ((value & mask) >> rshift) ^ xor; + + return 0; +} + +static int macio_do_delay(PMF_STD_ARGS, u32 duration) +{ + /* assume we can sleep ! */ + msleep((duration + 999) / 1000); + return 0; +} + +static struct pmf_handlers macio_gpio_handlers = { + .irq_enable = macio_do_gpio_irq_enable, + .irq_disable = macio_do_gpio_irq_disable, + .write_gpio = macio_do_gpio_write, + .read_gpio = macio_do_gpio_read, + .delay = macio_do_delay, +}; + +static void macio_gpio_init_one(struct macio_chip *macio) +{ + struct device_node *gparent, *gp; + + /* + * Find the "gpio" parent node + */ + + for (gparent = NULL; + (gparent = of_get_next_child(macio->of_node, gparent)) != NULL;) + if (strcmp(gparent->name, "gpio") == 0) + break; + if (gparent == NULL) + return; + + DBG("Installing GPIO functions for macio %s\n", + macio->of_node->full_name); + + /* + * Ok, got one, we dont need anything special to track them down, so + * we just create them all + */ + for (gp = NULL; (gp = of_get_next_child(gparent, gp)) != NULL;) { + u32 *reg = (u32 *)get_property(gp, "reg", NULL); + unsigned long offset; + if (reg == NULL) + continue; + offset = *reg; + /* Deal with old style device-tree. We can safely hard code the + * offset for now too even if it's a bit gross ... + */ + if (offset < 0x50) + offset += 0x50; + offset += (unsigned long)macio->base; + pmf_register_driver(gp, &macio_gpio_handlers, (void *)offset); + } + + DBG("Calling initial GPIO functions for macio %s\n", + macio->of_node->full_name); + + /* And now we run all the init ones */ + for (gp = NULL; (gp = of_get_next_child(gparent, gp)) != NULL;) + pmf_do_functions(gp, NULL, 0, PMF_FLAGS_ON_INIT, NULL); + + /* Note: We do not at this point implement the "at sleep" or "at wake" + * functions. I yet to find any for GPIOs anyway + */ +} + +static int macio_do_write_reg32(PMF_STD_ARGS, u32 offset, u32 value, u32 mask) +{ + struct macio_chip *macio = func->driver_data; + unsigned long flags; + + spin_lock_irqsave(&feature_lock, flags); + MACIO_OUT32(offset, (MACIO_IN32(offset) & ~mask) | (value & mask)); + spin_unlock_irqrestore(&feature_lock, flags); + return 0; +} + +static int macio_do_read_reg32(PMF_STD_ARGS, u32 offset) +{ + struct macio_chip *macio = func->driver_data; + + /* Check if we have room for reply */ + if (args == NULL || args->count == 0 || args->u[0].p == NULL) + return -EINVAL; + + *args->u[0].p = MACIO_IN32(offset); + return 0; +} + +static int macio_do_write_reg8(PMF_STD_ARGS, u32 offset, u8 value, u8 mask) +{ + struct macio_chip *macio = func->driver_data; + unsigned long flags; + + spin_lock_irqsave(&feature_lock, flags); + MACIO_OUT8(offset, (MACIO_IN8(offset) & ~mask) | (value & mask)); + spin_unlock_irqrestore(&feature_lock, flags); + return 0; +} + +static int macio_do_read_reg8(PMF_STD_ARGS, u32 offset) +{ + struct macio_chip *macio = func->driver_data; + + /* Check if we have room for reply */ + if (args == NULL || args->count == 0 || args->u[0].p == NULL) + return -EINVAL; + + *((u8 *)(args->u[0].p)) = MACIO_IN8(offset); + return 0; +} + +static int macio_do_read_reg32_msrx(PMF_STD_ARGS, u32 offset, u32 mask, + u32 shift, u32 xor) +{ + struct macio_chip *macio = func->driver_data; + + /* Check if we have room for reply */ + if (args == NULL || args->count == 0 || args->u[0].p == NULL) + return -EINVAL; + + *args->u[0].p = ((MACIO_IN32(offset) & mask) >> shift) ^ xor; + return 0; +} + +static int macio_do_read_reg8_msrx(PMF_STD_ARGS, u32 offset, u32 mask, + u32 shift, u32 xor) +{ + struct macio_chip *macio = func->driver_data; + + /* Check if we have room for reply */ + if (args == NULL || args->count == 0 || args->u[0].p == NULL) + return -EINVAL; + + *((u8 *)(args->u[0].p)) = ((MACIO_IN8(offset) & mask) >> shift) ^ xor; + return 0; +} + +static int macio_do_write_reg32_slm(PMF_STD_ARGS, u32 offset, u32 shift, + u32 mask) +{ + struct macio_chip *macio = func->driver_data; + unsigned long flags; + u32 tmp, val; + + /* Check args */ + if (args == NULL || args->count == 0) + return -EINVAL; + + spin_lock_irqsave(&feature_lock, flags); + tmp = MACIO_IN32(offset); + val = args->u[0].v << shift; + tmp = (tmp & ~mask) | (val & mask); + MACIO_OUT32(offset, tmp); + spin_unlock_irqrestore(&feature_lock, flags); + return 0; +} + +static int macio_do_write_reg8_slm(PMF_STD_ARGS, u32 offset, u32 shift, + u32 mask) +{ + struct macio_chip *macio = func->driver_data; + unsigned long flags; + u32 tmp, val; + + /* Check args */ + if (args == NULL || args->count == 0) + return -EINVAL; + + spin_lock_irqsave(&feature_lock, flags); + tmp = MACIO_IN8(offset); + val = args->u[0].v << shift; + tmp = (tmp & ~mask) | (val & mask); + MACIO_OUT8(offset, tmp); + spin_unlock_irqrestore(&feature_lock, flags); + return 0; +} + +static struct pmf_handlers macio_mmio_handlers = { + .write_reg32 = macio_do_write_reg32, + .read_reg32 = macio_do_read_reg32, + .write_reg8 = macio_do_write_reg8, + .read_reg32 = macio_do_read_reg8, + .read_reg32_msrx = macio_do_read_reg32_msrx, + .read_reg8_msrx = macio_do_read_reg8_msrx, + .write_reg32_slm = macio_do_write_reg32_slm, + .write_reg8_slm = macio_do_write_reg8_slm, + .delay = macio_do_delay, +}; + +static void macio_mmio_init_one(struct macio_chip *macio) +{ + DBG("Installing MMIO functions for macio %s\n", + macio->of_node->full_name); + + pmf_register_driver(macio->of_node, &macio_mmio_handlers, macio); +} + +static struct device_node *unin_hwclock; + +static int unin_do_write_reg32(PMF_STD_ARGS, u32 offset, u32 value, u32 mask) +{ + unsigned long flags; + + spin_lock_irqsave(&feature_lock, flags); + /* This is fairly bogus in darwin, but it should work for our needs + * implemeted that way: + */ + UN_OUT(offset, (UN_IN(offset) & ~mask) | (value & mask)); + spin_unlock_irqrestore(&feature_lock, flags); + return 0; +} + + +static struct pmf_handlers unin_mmio_handlers = { + .write_reg32 = unin_do_write_reg32, + .delay = macio_do_delay, +}; + +static void uninorth_install_pfunc(void) +{ + struct device_node *np; + + DBG("Installing functions for UniN %s\n", + uninorth_node->full_name); + + /* + * Install handlers for the bridge itself + */ + pmf_register_driver(uninorth_node, &unin_mmio_handlers, NULL); + pmf_do_functions(uninorth_node, NULL, 0, PMF_FLAGS_ON_INIT, NULL); + + + /* + * Install handlers for the hwclock child if any + */ + for (np = NULL; (np = of_get_next_child(uninorth_node, np)) != NULL;) + if (strcmp(np->name, "hw-clock") == 0) { + unin_hwclock = np; + break; + } + if (unin_hwclock) { + DBG("Installing functions for UniN clock %s\n", + unin_hwclock->full_name); + pmf_register_driver(unin_hwclock, &unin_mmio_handlers, NULL); + pmf_do_functions(unin_hwclock, NULL, 0, PMF_FLAGS_ON_INIT, + NULL); + } +} + +/* We export this as the SMP code might init us early */ +int __init pmac_pfunc_base_install(void) +{ + static int pfbase_inited; + int i; + + if (pfbase_inited) + return 0; + pfbase_inited = 1; + + + DBG("Installing base platform functions...\n"); + + /* + * Locate mac-io chips and install handlers + */ + for (i = 0 ; i < MAX_MACIO_CHIPS; i++) { + if (macio_chips[i].of_node) { + macio_mmio_init_one(&macio_chips[i]); + macio_gpio_init_one(&macio_chips[i]); + } + } + + /* + * Install handlers for northbridge and direct mapped hwclock + * if any. We do not implement the config space access callback + * which is only ever used for functions that we do not call in + * the current driver (enabling/disabling cells in U2, mostly used + * to restore the PCI settings, we do that differently) + */ + if (uninorth_node && uninorth_base) + uninorth_install_pfunc(); + + DBG("All base functions installed\n"); + + return 0; +} + +arch_initcall(pmac_pfunc_base_install); + +#ifdef CONFIG_PM + +/* Those can be called by pmac_feature. Ultimately, I should use a sysdev + * or a device, but for now, that's good enough until I sort out some + * ordering issues. Also, we do not bother with GPIOs, as so far I yet have + * to see a case where a GPIO function has the on-suspend or on-resume bit + */ +void pmac_pfunc_base_suspend(void) +{ + int i; + + for (i = 0 ; i < MAX_MACIO_CHIPS; i++) { + if (macio_chips[i].of_node) + pmf_do_functions(macio_chips[i].of_node, NULL, 0, + PMF_FLAGS_ON_SLEEP, NULL); + } + if (uninorth_node) + pmf_do_functions(uninorth_node, NULL, 0, + PMF_FLAGS_ON_SLEEP, NULL); + if (unin_hwclock) + pmf_do_functions(unin_hwclock, NULL, 0, + PMF_FLAGS_ON_SLEEP, NULL); +} + +void pmac_pfunc_base_resume(void) +{ + int i; + + if (unin_hwclock) + pmf_do_functions(unin_hwclock, NULL, 0, + PMF_FLAGS_ON_WAKE, NULL); + if (uninorth_node) + pmf_do_functions(uninorth_node, NULL, 0, + PMF_FLAGS_ON_WAKE, NULL); + for (i = 0 ; i < MAX_MACIO_CHIPS; i++) { + if (macio_chips[i].of_node) + pmf_do_functions(macio_chips[i].of_node, NULL, 0, + PMF_FLAGS_ON_WAKE, NULL); + } +} + +#endif /* CONFIG_PM */ Index: linux-work/arch/powerpc/platforms/powermac/pfunc_core.c =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 +++ linux-work/arch/powerpc/platforms/powermac/pfunc_core.c 2006-01-05 14:56:32.000000000 +1100 @@ -0,0 +1,989 @@ +/* + * + * FIXME: Properly make this race free with refcounting etc... + * + * FIXME: LOCKING !!! + */ + +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +/* Debug */ +#define LOG_PARSE(fmt...) +#define LOG_ERROR(fmt...) printk(fmt) +#define LOG_BLOB(t,b,c) +#define DBG(fmt...) printk(fmt) + +/* Command numbers */ +#define PMF_CMD_LIST 0 +#define PMF_CMD_WRITE_GPIO 1 +#define PMF_CMD_READ_GPIO 2 +#define PMF_CMD_WRITE_REG32 3 +#define PMF_CMD_READ_REG32 4 +#define PMF_CMD_WRITE_REG16 5 +#define PMF_CMD_READ_REG16 6 +#define PMF_CMD_WRITE_REG8 7 +#define PMF_CMD_READ_REG8 8 +#define PMF_CMD_DELAY 9 +#define PMF_CMD_WAIT_REG32 10 +#define PMF_CMD_WAIT_REG16 11 +#define PMF_CMD_WAIT_REG8 12 +#define PMF_CMD_READ_I2C 13 +#define PMF_CMD_WRITE_I2C 14 +#define PMF_CMD_RMW_I2C 15 +#define PMF_CMD_GEN_I2C 16 +#define PMF_CMD_SHIFT_BYTES_RIGHT 17 +#define PMF_CMD_SHIFT_BYTES_LEFT 18 +#define PMF_CMD_READ_CFG 19 +#define PMF_CMD_WRITE_CFG 20 +#define PMF_CMD_RMW_CFG 21 +#define PMF_CMD_READ_I2C_SUBADDR 22 +#define PMF_CMD_WRITE_I2C_SUBADDR 23 +#define PMF_CMD_SET_I2C_MODE 24 +#define PMF_CMD_RMW_I2C_SUBADDR 25 +#define PMF_CMD_READ_REG32_MASK_SHR_XOR 26 +#define PMF_CMD_READ_REG16_MASK_SHR_XOR 27 +#define PMF_CMD_READ_REG8_MASK_SHR_XOR 28 +#define PMF_CMD_WRITE_REG32_SHL_MASK 29 +#define PMF_CMD_WRITE_REG16_SHL_MASK 30 +#define PMF_CMD_WRITE_REG8_SHL_MASK 31 +#define PMF_CMD_MASK_AND_COMPARE 32 +#define PMF_CMD_COUNT 33 + +/* This structure holds the state of the parser while walking through + * a function definition + */ +struct pmf_cmd { + const void *cmdptr; + const void *cmdend; + struct pmf_function *func; + void *instdata; + struct pmf_args *args; + int error; +}; + +#if 0 +/* Debug output */ +static void print_blob(const char *title, const void *blob, int bytes) +{ + printk("%s", title); + while(bytes--) { + printk("%02x ", *((u8 *)blob)); + blob += 1; + } + printk("\n"); +} +#endif + +/* + * Parser helpers + */ + +static u32 pmf_next32(struct pmf_cmd *cmd) +{ + u32 value; + if ((cmd->cmdend - cmd->cmdptr) < 4) { + cmd->error = 1; + return 0; + } + value = *((u32 *)cmd->cmdptr); + cmd->cmdptr += 4; + return value; +} + +static const void* pmf_next_blob(struct pmf_cmd *cmd, int count) +{ + const void *value; + if ((cmd->cmdend - cmd->cmdptr) < count) { + cmd->error = 1; + return NULL; + } + value = cmd->cmdptr; + cmd->cmdptr += count; + return value; +} + +/* + * Individual command parsers + */ + +#define PMF_PARSE_CALL(name, cmd, handlers, p...) \ + do { \ + if (cmd->error) \ + return -ENXIO; \ + if (handlers == NULL) \ + return 0; \ + if (handlers->name) \ + return handlers->name(cmd->func, cmd->instdata, \ + cmd->args, p); \ + return -1; \ + } while(0) \ + + +static int pmf_parser_write_gpio(struct pmf_cmd *cmd, struct pmf_handlers *h) +{ + u8 value = (u8)pmf_next32(cmd); + u8 mask = (u8)pmf_next32(cmd); + + LOG_PARSE("pmf: write_gpio(value: %02x, mask: %02x)\n", value, mask); + + PMF_PARSE_CALL(write_gpio, cmd, h, value, mask); +} + +static int pmf_parser_read_gpio(struct pmf_cmd *cmd, struct pmf_handlers *h) +{ + u8 mask = (u8)pmf_next32(cmd); + int rshift = (int)pmf_next32(cmd); + u8 xor = (u8)pmf_next32(cmd); + + LOG_PARSE("pmf: read_gpio(mask: %02x, rshift: %d, xor: %02x)\n", + mask, rshift, xor); + + PMF_PARSE_CALL(read_gpio, cmd, h, mask, rshift, xor); +} + +static int pmf_parser_write_reg32(struct pmf_cmd *cmd, struct pmf_handlers *h) +{ + u32 offset = pmf_next32(cmd); + u32 value = pmf_next32(cmd); + u32 mask = pmf_next32(cmd); + + LOG_PARSE("pmf: write_reg32(offset: %08x, value: %08x, mask: %08x)\n", + offset, value, mask); + + PMF_PARSE_CALL(write_reg32, cmd, h, offset, value, mask); +} + +static int pmf_parser_read_reg32(struct pmf_cmd *cmd, struct pmf_handlers *h) +{ + u32 offset = pmf_next32(cmd); + + LOG_PARSE("pmf: read_reg32(offset: %08x)\n", offset); + + PMF_PARSE_CALL(read_reg32, cmd, h, offset); +} + + +static int pmf_parser_write_reg16(struct pmf_cmd *cmd, struct pmf_handlers *h) +{ + u32 offset = pmf_next32(cmd); + u16 value = (u16)pmf_next32(cmd); + u16 mask = (u16)pmf_next32(cmd); + + LOG_PARSE("pmf: write_reg16(offset: %08x, value: %04x, mask: %04x)\n", + offset, value, mask); + + PMF_PARSE_CALL(write_reg16, cmd, h, offset, value, mask); +} + +static int pmf_parser_read_reg16(struct pmf_cmd *cmd, struct pmf_handlers *h) +{ + u32 offset = pmf_next32(cmd); + + LOG_PARSE("pmf: read_reg16(offset: %08x)\n", offset); + + PMF_PARSE_CALL(read_reg16, cmd, h, offset); +} + + +static int pmf_parser_write_reg8(struct pmf_cmd *cmd, struct pmf_handlers *h) +{ + u32 offset = pmf_next32(cmd); + u8 value = (u16)pmf_next32(cmd); + u8 mask = (u16)pmf_next32(cmd); + + LOG_PARSE("pmf: write_reg8(offset: %08x, value: %02x, mask: %02x)\n", + offset, value, mask); + + PMF_PARSE_CALL(write_reg8, cmd, h, offset, value, mask); +} + +static int pmf_parser_read_reg8(struct pmf_cmd *cmd, struct pmf_handlers *h) +{ + u32 offset = pmf_next32(cmd); + + LOG_PARSE("pmf: read_reg8(offset: %08x)\n", offset); + + PMF_PARSE_CALL(read_reg8, cmd, h, offset); +} + +static int pmf_parser_delay(struct pmf_cmd *cmd, struct pmf_handlers *h) +{ + u32 duration = pmf_next32(cmd); + + LOG_PARSE("pmf: delay(duration: %d us)\n", duration); + + PMF_PARSE_CALL(delay, cmd, h, duration); +} + +static int pmf_parser_wait_reg32(struct pmf_cmd *cmd, struct pmf_handlers *h) +{ + u32 offset = pmf_next32(cmd); + u32 value = pmf_next32(cmd); + u32 mask = pmf_next32(cmd); + + LOG_PARSE("pmf: wait_reg32(offset: %08x, comp_value: %08x,mask: %08x)\n", + offset, value, mask); + + PMF_PARSE_CALL(wait_reg32, cmd, h, offset, value, mask); +} + +static int pmf_parser_wait_reg16(struct pmf_cmd *cmd, struct pmf_handlers *h) +{ + u32 offset = pmf_next32(cmd); + u16 value = (u16)pmf_next32(cmd); + u16 mask = (u16)pmf_next32(cmd); + + LOG_PARSE("pmf: wait_reg16(offset: %08x, comp_value: %04x,mask: %04x)\n", + offset, value, mask); + + PMF_PARSE_CALL(wait_reg16, cmd, h, offset, value, mask); +} + +static int pmf_parser_wait_reg8(struct pmf_cmd *cmd, struct pmf_handlers *h) +{ + u32 offset = pmf_next32(cmd); + u8 value = (u8)pmf_next32(cmd); + u8 mask = (u8)pmf_next32(cmd); + + LOG_PARSE("pmf: wait_reg8(offset: %08x, comp_value: %02x,mask: %02x)\n", + offset, value, mask); + + PMF_PARSE_CALL(wait_reg8, cmd, h, offset, value, mask); +} + +static int pmf_parser_read_i2c(struct pmf_cmd *cmd, struct pmf_handlers *h) +{ + u32 bytes = pmf_next32(cmd); + + LOG_PARSE("pmf: read_i2c(bytes: %ud)\n", bytes); + + PMF_PARSE_CALL(read_i2c, cmd, h, bytes); +} + +static int pmf_parser_write_i2c(struct pmf_cmd *cmd, struct pmf_handlers *h) +{ + u32 bytes = pmf_next32(cmd); + const void *blob = pmf_next_blob(cmd, bytes); + + LOG_PARSE("pmf: write_i2c(bytes: %ud) ...\n", bytes); + LOG_BLOB("pmf: data: \n", blob, bytes); + + PMF_PARSE_CALL(write_i2c, cmd, h, bytes, blob); +} + + +static int pmf_parser_rmw_i2c(struct pmf_cmd *cmd, struct pmf_handlers *h) +{ + u32 maskbytes = pmf_next32(cmd); + u32 valuesbytes = pmf_next32(cmd); + u32 totalbytes = pmf_next32(cmd); + const void *maskblob = pmf_next_blob(cmd, maskbytes); + const void *valuesblob = pmf_next_blob(cmd, valuesbytes); + + LOG_PARSE("pmf: rmw_i2c(maskbytes: %ud, valuebytes: %ud, " + "totalbytes: %d) ...\n", + maskbytes, valuesbytes, totalbytes); + LOG_BLOB("pmf: mask data: \n", maskblob, maskbytes); + LOG_BLOB("pmf: values data: \n", valuesblob, valuesbytes); + + PMF_PARSE_CALL(rmw_i2c, cmd, h, maskbytes, valuesbytes, totalbytes, + maskblob, valuesblob); +} + +static int pmf_parser_read_cfg(struct pmf_cmd *cmd, struct pmf_handlers *h) +{ + u32 offset = pmf_next32(cmd); + u32 bytes = pmf_next32(cmd); + + LOG_PARSE("pmf: read_cfg(offset: %x, bytes: %ud)\n", offset, bytes); + + PMF_PARSE_CALL(read_cfg, cmd, h, offset, bytes); +} + + +static int pmf_parser_write_cfg(struct pmf_cmd *cmd, struct pmf_handlers *h) +{ + u32 offset = pmf_next32(cmd); + u32 bytes = pmf_next32(cmd); + const void *blob = pmf_next_blob(cmd, bytes); + + LOG_PARSE("pmf: write_cfg(offset: %x, bytes: %ud)\n", offset, bytes); + LOG_BLOB("pmf: data: \n", blob, bytes); + + PMF_PARSE_CALL(write_cfg, cmd, h, offset, bytes, blob); +} + +static int pmf_parser_rmw_cfg(struct pmf_cmd *cmd, struct pmf_handlers *h) +{ + u32 offset = pmf_next32(cmd); + u32 maskbytes = pmf_next32(cmd); + u32 valuesbytes = pmf_next32(cmd); + u32 totalbytes = pmf_next32(cmd); + const void *maskblob = pmf_next_blob(cmd, maskbytes); + const void *valuesblob = pmf_next_blob(cmd, valuesbytes); + + LOG_PARSE("pmf: rmw_cfg(maskbytes: %ud, valuebytes: %ud," + " totalbytes: %d) ...\n", + maskbytes, valuesbytes, totalbytes); + LOG_BLOB("pmf: mask data: \n", maskblob, maskbytes); + LOG_BLOB("pmf: values data: \n", valuesblob, valuesbytes); + + PMF_PARSE_CALL(rmw_cfg, cmd, h, offset, maskbytes, valuesbytes, + totalbytes, maskblob, valuesblob); +} + + +static int pmf_parser_read_i2c_sub(struct pmf_cmd *cmd, struct pmf_handlers *h) +{ + u8 subaddr = (u8)pmf_next32(cmd); + u32 bytes = pmf_next32(cmd); + + LOG_PARSE("pmf: read_i2c_sub(subaddr: %x, bytes: %ud)\n", + subaddr, bytes); + + PMF_PARSE_CALL(read_i2c_sub, cmd, h, subaddr, bytes); +} + +static int pmf_parser_write_i2c_sub(struct pmf_cmd *cmd, struct pmf_handlers *h) +{ + u8 subaddr = (u8)pmf_next32(cmd); + u32 bytes = pmf_next32(cmd); + const void *blob = pmf_next_blob(cmd, bytes); + + LOG_PARSE("pmf: write_i2c_sub(subaddr: %x, bytes: %ud) ...\n", + subaddr, bytes); + LOG_BLOB("pmf: data: \n", blob, bytes); + + PMF_PARSE_CALL(write_i2c_sub, cmd, h, subaddr, bytes, blob); +} + +static int pmf_parser_set_i2c_mode(struct pmf_cmd *cmd, struct pmf_handlers *h) +{ + u32 mode = pmf_next32(cmd); + + LOG_PARSE("pmf: set_i2c_mode(mode: %d)\n", mode); + + PMF_PARSE_CALL(set_i2c_mode, cmd, h, mode); +} + + +static int pmf_parser_rmw_i2c_sub(struct pmf_cmd *cmd, struct pmf_handlers *h) +{ + u8 subaddr = (u8)pmf_next32(cmd); + u32 maskbytes = pmf_next32(cmd); + u32 valuesbytes = pmf_next32(cmd); + u32 totalbytes = pmf_next32(cmd); + const void *maskblob = pmf_next_blob(cmd, maskbytes); + const void *valuesblob = pmf_next_blob(cmd, valuesbytes); + + LOG_PARSE("pmf: rmw_i2c_sub(subaddr: %x, maskbytes: %ud, valuebytes: %ud" + ", totalbytes: %d) ...\n", + subaddr, maskbytes, valuesbytes, totalbytes); + LOG_BLOB("pmf: mask data: \n", maskblob, maskbytes); + LOG_BLOB("pmf: values data: \n", valuesblob, valuesbytes); + + PMF_PARSE_CALL(rmw_i2c_sub, cmd, h, subaddr, maskbytes, valuesbytes, + totalbytes, maskblob, valuesblob); +} + +static int pmf_parser_read_reg32_msrx(struct pmf_cmd *cmd, + struct pmf_handlers *h) +{ + u32 offset = pmf_next32(cmd); + u32 mask = pmf_next32(cmd); + u32 shift = pmf_next32(cmd); + u32 xor = pmf_next32(cmd); + + LOG_PARSE("pmf: read_reg32_msrx(offset: %x, mask: %x, shift: %x," + " xor: %x\n", offset, mask, shift, xor); + + PMF_PARSE_CALL(read_reg32_msrx, cmd, h, offset, mask, shift, xor); +} + +static int pmf_parser_read_reg16_msrx(struct pmf_cmd *cmd, + struct pmf_handlers *h) +{ + u32 offset = pmf_next32(cmd); + u32 mask = pmf_next32(cmd); + u32 shift = pmf_next32(cmd); + u32 xor = pmf_next32(cmd); + + LOG_PARSE("pmf: read_reg16_msrx(offset: %x, mask: %x, shift: %x," + " xor: %x\n", offset, mask, shift, xor); + + PMF_PARSE_CALL(read_reg16_msrx, cmd, h, offset, mask, shift, xor); +} +static int pmf_parser_read_reg8_msrx(struct pmf_cmd *cmd, + struct pmf_handlers *h) +{ + u32 offset = pmf_next32(cmd); + u32 mask = pmf_next32(cmd); + u32 shift = pmf_next32(cmd); + u32 xor = pmf_next32(cmd); + + LOG_PARSE("pmf: read_reg8_msrx(offset: %x, mask: %x, shift: %x," + " xor: %x\n", offset, mask, shift, xor); + + PMF_PARSE_CALL(read_reg8_msrx, cmd, h, offset, mask, shift, xor); +} + +static int pmf_parser_write_reg32_slm(struct pmf_cmd *cmd, + struct pmf_handlers *h) +{ + u32 offset = pmf_next32(cmd); + u32 shift = pmf_next32(cmd); + u32 mask = pmf_next32(cmd); + + LOG_PARSE("pmf: write_reg32_slm(offset: %x, shift: %x, mask: %x\n", + offset, shift, mask); + + PMF_PARSE_CALL(write_reg32_slm, cmd, h, offset, shift, mask); +} + +static int pmf_parser_write_reg16_slm(struct pmf_cmd *cmd, + struct pmf_handlers *h) +{ + u32 offset = pmf_next32(cmd); + u32 shift = pmf_next32(cmd); + u32 mask = pmf_next32(cmd); + + LOG_PARSE("pmf: write_reg16_slm(offset: %x, shift: %x, mask: %x\n", + offset, shift, mask); + + PMF_PARSE_CALL(write_reg16_slm, cmd, h, offset, shift, mask); +} + +static int pmf_parser_write_reg8_slm(struct pmf_cmd *cmd, + struct pmf_handlers *h) +{ + u32 offset = pmf_next32(cmd); + u32 shift = pmf_next32(cmd); + u32 mask = pmf_next32(cmd); + + LOG_PARSE("pmf: write_reg8_slm(offset: %x, shift: %x, mask: %x\n", + offset, shift, mask); + + PMF_PARSE_CALL(write_reg8_slm, cmd, h, offset, shift, mask); +} + +static int pmf_parser_mask_and_compare(struct pmf_cmd *cmd, + struct pmf_handlers *h) +{ + u32 bytes = pmf_next32(cmd); + const void *maskblob = pmf_next_blob(cmd, bytes); + const void *valuesblob = pmf_next_blob(cmd, bytes); + + LOG_PARSE("pmf: mask_and_compare(length: %ud ...\n", bytes); + LOG_BLOB("pmf: mask data: \n", maskblob, bytes); + LOG_BLOB("pmf: values data: \n", valuesblob, bytes); + + PMF_PARSE_CALL(mask_and_compare, cmd, h, + bytes, maskblob, valuesblob); +} + + +typedef int (*pmf_cmd_parser_t)(struct pmf_cmd *cmd, struct pmf_handlers *h); + +static pmf_cmd_parser_t pmf_parsers[PMF_CMD_COUNT] = +{ + NULL, + pmf_parser_write_gpio, + pmf_parser_read_gpio, + pmf_parser_write_reg32, + pmf_parser_read_reg32, + pmf_parser_write_reg16, + pmf_parser_read_reg16, + pmf_parser_write_reg8, + pmf_parser_read_reg8, + pmf_parser_delay, + pmf_parser_wait_reg32, + pmf_parser_wait_reg16, + pmf_parser_wait_reg8, + pmf_parser_read_i2c, + pmf_parser_write_i2c, + pmf_parser_rmw_i2c, + NULL, /* Bogus command */ + NULL, /* Shift bytes right: NYI */ + NULL, /* Shift bytes left: NYI */ + pmf_parser_read_cfg, + pmf_parser_write_cfg, + pmf_parser_rmw_cfg, + pmf_parser_read_i2c_sub, + pmf_parser_write_i2c_sub, + pmf_parser_set_i2c_mode, + pmf_parser_rmw_i2c_sub, + pmf_parser_read_reg32_msrx, + pmf_parser_read_reg16_msrx, + pmf_parser_read_reg8_msrx, + pmf_parser_write_reg32_slm, + pmf_parser_write_reg16_slm, + pmf_parser_write_reg8_slm, + pmf_parser_mask_and_compare, +}; + +struct pmf_device { + struct list_head link; + struct device_node *node; + struct pmf_handlers *handlers; + struct list_head functions; + struct kref ref; +}; + +static LIST_HEAD(pmf_devices); +static spinlock_t pmf_lock = SPIN_LOCK_UNLOCKED; + +static void pmf_release_device(struct kref *kref) +{ + struct pmf_device *dev = container_of(kref, struct pmf_device, ref); + kfree(dev); +} + +static inline void pmf_put_device(struct pmf_device *dev) +{ + kref_put(&dev->ref, pmf_release_device); +} + +static inline struct pmf_device *pmf_get_device(struct pmf_device *dev) +{ + kref_get(&dev->ref); + return dev; +} + +static inline struct pmf_device *pmf_find_device(struct device_node *np) +{ + struct pmf_device *dev; + + list_for_each_entry(dev, &pmf_devices, link) { + if (dev->node == np) + return pmf_get_device(dev); + } + return NULL; +} + +static int pmf_parse_one(struct pmf_function *func, + struct pmf_handlers *handlers, + void *instdata, struct pmf_args *args) +{ + struct pmf_cmd cmd; + u32 ccode; + int count, rc; + + cmd.cmdptr = func->data; + cmd.cmdend = func->data + func->length; + cmd.func = func; + cmd.instdata = instdata; + cmd.args = args; + cmd.error = 0; + + LOG_PARSE("pmf: func %s, %d bytes, %s...\n", + func->name, func->length, + handlers ? "executing" : "parsing"); + + /* One subcommand to parse for now */ + count = 1; + + while(count-- && cmd.cmdptr < cmd.cmdend) { + /* Get opcode */ + ccode = pmf_next32(&cmd); + /* Check if we are hitting a command list, fetch new count */ + if (ccode == 0) { + count = pmf_next32(&cmd) - 1; + ccode = pmf_next32(&cmd); + } + if (cmd.error) { + LOG_ERROR("pmf: parse error, not enough data\n"); + return -ENXIO; + } + if (ccode >= PMF_CMD_COUNT) { + LOG_ERROR("pmf: command code %d unknown !\n", ccode); + return -ENXIO; + } + if (pmf_parsers[ccode] == NULL) { + LOG_ERROR("pmf: no parser for command %d !\n", ccode); + return -ENXIO; + } + rc = pmf_parsers[ccode](&cmd, handlers); + if (rc != 0) { + LOG_ERROR("pmf: parser for command %d returned" + " error %d\n", ccode, rc); + return rc; + } + } + + /* We are doing an initial parse pass, we need to adjust the size */ + if (handlers == NULL) + func->length = cmd.cmdptr - func->data; + + return 0; +} + +static int pmf_add_function_prop(struct pmf_device *dev, void *driverdata, + const char *name, u32 *data, + unsigned int length) +{ + int count = 0; + struct pmf_function *func = NULL; + + DBG("pmf: Adding functions for platform-do-%s\n", name); + + while (length >= 12) { + /* Allocate a structure */ + func = kzalloc(sizeof(struct pmf_function), GFP_KERNEL); + if (func == NULL) + goto bail; + kref_init(&func->ref); + INIT_LIST_HEAD(&func->irq_clients); + func->node = dev->node; + func->driver_data = driverdata; + func->name = name; + func->phandle = data[0]; + func->flags = data[1]; + data += 2; + length -= 8; + func->data = data; + func->length = length; + func->dev = dev; + DBG("pmf: idx %d: flags=%08x, phandle=%08x " + " %d bytes remaining, parsing...\n", + count+1, func->flags, func->phandle, length); + if (pmf_parse_one(func, NULL, NULL, NULL)) { + kfree(func); + goto bail; + } + length -= func->length; + data = (u32 *)(((u8 *)data) + func->length); + list_add(&func->link, &dev->functions); + pmf_get_device(dev); + count++; + } + bail: + DBG("pmf: Added %d functions\n", count); + + return count; +} + +static int pmf_add_functions(struct pmf_device *dev, void *driverdata) +{ + struct property *pp; +#define PP_PREFIX "platform-do-" + const int plen = strlen(PP_PREFIX); + int count = 0; + + for (pp = dev->node->properties; pp != 0; pp = pp->next) { + char *name; + if (strncmp(pp->name, PP_PREFIX, plen) != 0) + continue; + name = pp->name + plen; + if (strlen(name) && pp->length >= 12) + count += pmf_add_function_prop(dev, driverdata, name, + (u32 *)pp->value, + pp->length); + } + return count; +} + + +int pmf_register_driver(struct device_node *np, + struct pmf_handlers *handlers, + void *driverdata) +{ + struct pmf_device *dev; + unsigned long flags; + int rc = 0; + + if (handlers == NULL) + return -EINVAL; + + DBG("pmf: registering driver for node %s\n", np->full_name); + + spin_lock_irqsave(&pmf_lock, flags); + dev = pmf_find_device(np); + spin_unlock_irqrestore(&pmf_lock, flags); + if (dev != NULL) { + DBG("pmf: already there !\n"); + pmf_put_device(dev); + return -EBUSY; + } + + dev = kzalloc(sizeof(struct pmf_device), GFP_KERNEL); + if (dev == NULL) { + DBG("pmf: no memory !\n"); + return -ENOMEM; + } + kref_init(&dev->ref); + dev->node = of_node_get(np); + dev->handlers = handlers; + INIT_LIST_HEAD(&dev->functions); + + rc = pmf_add_functions(dev, driverdata); + if (rc == 0) { + DBG("pmf: no functions, disposing.. \n"); + of_node_put(np); + kfree(dev); + return -ENODEV; + } + + spin_lock_irqsave(&pmf_lock, flags); + list_add(&dev->link, &pmf_devices); + spin_unlock_irqrestore(&pmf_lock, flags); + + return 0; +} +EXPORT_SYMBOL_GPL(pmf_register_driver); + +struct pmf_function *pmf_get_function(struct pmf_function *func) +{ + if (!try_module_get(func->dev->handlers->owner)) + return NULL; + kref_get(&func->ref); + return func; +} +EXPORT_SYMBOL_GPL(pmf_get_function); + +static void pmf_release_function(struct kref *kref) +{ + struct pmf_function *func = + container_of(kref, struct pmf_function, ref); + pmf_put_device(func->dev); + kfree(func); +} + +static inline void __pmf_put_function(struct pmf_function *func) +{ + kref_put(&func->ref, pmf_release_function); +} + +void pmf_put_function(struct pmf_function *func) +{ + if (func == NULL) + return; + module_put(func->dev->handlers->owner); + __pmf_put_function(func); +} +EXPORT_SYMBOL_GPL(pmf_put_function); + +void pmf_unregister_driver(struct device_node *np) +{ + struct pmf_device *dev; + unsigned long flags; + + DBG("pmf: unregistering driver for node %s\n", np->full_name); + + spin_lock_irqsave(&pmf_lock, flags); + dev = pmf_find_device(np); + if (dev == NULL) { + DBG("pmf: not such driver !\n"); + spin_unlock_irqrestore(&pmf_lock, flags); + return; + } + list_del(&dev->link); + + while(!list_empty(&dev->functions)) { + struct pmf_function *func = + list_entry(dev->functions.next, typeof(*func), link); + list_del(&func->link); + __pmf_put_function(func); + } + + pmf_put_device(dev); + spin_unlock_irqrestore(&pmf_lock, flags); +} +EXPORT_SYMBOL_GPL(pmf_unregister_driver); + +struct pmf_function *__pmf_find_function(struct device_node *target, + const char *name, u32 flags) +{ + struct device_node *actor = of_node_get(target); + struct pmf_device *dev; + struct pmf_function *func, *result = NULL; + char fname[64]; + u32 *prop, ph; + + /* + * Look for a "platform-*" function reference. If we can't find + * one, then we fallback to a direct call attempt + */ + snprintf(fname, 63, "platform-%s", name); + prop = (u32 *)get_property(target, fname, NULL); + if (prop == NULL) + goto find_it; + ph = *prop; + if (ph == 0) + goto find_it; + + /* + * Ok, now try to find the actor. If we can't find it, we fail, + * there is no point in falling back there + */ + of_node_put(actor); + actor = of_find_node_by_phandle(ph); + if (actor == NULL) + return NULL; + find_it: + dev = pmf_find_device(actor); + if (dev == NULL) + return NULL; + + list_for_each_entry(func, &dev->functions, link) { + if (name && strcmp(name, func->name)) + continue; + if (func->phandle && target->node != func->phandle) + continue; + if ((func->flags & flags) == 0) + continue; + result = func; + break; + } + of_node_put(actor); + pmf_put_device(dev); + return result; +} + + +int pmf_register_irq_client(struct device_node *target, + const char *name, + struct pmf_irq_client *client) +{ + struct pmf_function *func; + unsigned long flags; + + spin_lock_irqsave(&pmf_lock, flags); + func = __pmf_find_function(target, name, PMF_FLAGS_INT_GEN); + if (func == NULL) { + spin_unlock_irqrestore(&pmf_lock, flags); + return -ENODEV; + } + list_add(&client->link, &func->irq_clients); + spin_unlock_irqrestore(&pmf_lock, flags); + + return 0; +} +EXPORT_SYMBOL_GPL(pmf_register_irq_client); + +void pmf_unregister_irq_client(struct device_node *np, + const char *name, + struct pmf_irq_client *client) +{ + unsigned long flags; + + spin_lock_irqsave(&pmf_lock, flags); + list_del(&client->link); + spin_unlock_irqrestore(&pmf_lock, flags); +} +EXPORT_SYMBOL_GPL(pmf_unregister_irq_client); + + +void pmf_do_irq(struct pmf_function *func) +{ + unsigned long flags; + struct pmf_irq_client *client; + + /* For now, using a spinlock over the whole function. Can be made + * to drop the lock using 2 lists if necessary + */ + spin_lock_irqsave(&pmf_lock, flags); + list_for_each_entry(client, &func->irq_clients, link) { + if (!try_module_get(client->owner)) + continue; + client->handler(client->data); + module_put(client->owner); + } + spin_unlock_irqrestore(&pmf_lock, flags); +} +EXPORT_SYMBOL_GPL(pmf_do_irq); + + +int pmf_call_one(struct pmf_function *func, struct pmf_args *args) +{ + struct pmf_device *dev = func->dev; + void *instdata = NULL; + int rc = 0; + + DBG(" ** pmf_call_one(%s/%s) **\n", dev->node->full_name, func->name); + + if (dev->handlers->begin) + instdata = dev->handlers->begin(func, args); + rc = pmf_parse_one(func, dev->handlers, instdata, args); + if (dev->handlers->end) + dev->handlers->end(func, instdata); + + return rc; +} +EXPORT_SYMBOL_GPL(pmf_call_one); + +int pmf_do_functions(struct device_node *np, const char *name, + u32 phandle, u32 fflags, struct pmf_args *args) +{ + struct pmf_device *dev; + struct pmf_function *func, *tmp; + unsigned long flags; + int rc = -ENODEV; + + spin_lock_irqsave(&pmf_lock, flags); + + dev = pmf_find_device(np); + if (dev == NULL) { + spin_unlock_irqrestore(&pmf_lock, flags); + return -ENODEV; + } + list_for_each_entry_safe(func, tmp, &dev->functions, link) { + if (name && strcmp(name, func->name)) + continue; + if (phandle && func->phandle && phandle != func->phandle) + continue; + if ((func->flags & fflags) == 0) + continue; + if (pmf_get_function(func) == NULL) + continue; + spin_unlock_irqrestore(&pmf_lock, flags); + rc = pmf_call_one(func, args); + pmf_put_function(func); + spin_lock_irqsave(&pmf_lock, flags); + } + pmf_put_device(dev); + spin_unlock_irqrestore(&pmf_lock, flags); + + return rc; +} +EXPORT_SYMBOL_GPL(pmf_do_functions); + + +struct pmf_function *pmf_find_function(struct device_node *target, + const char *name) +{ + struct pmf_function *func; + unsigned long flags; + + spin_lock_irqsave(&pmf_lock, flags); + func = __pmf_find_function(target, name, PMF_FLAGS_ON_DEMAND); + if (func) + func = pmf_get_function(func); + spin_unlock_irqrestore(&pmf_lock, flags); + return func; +} +EXPORT_SYMBOL_GPL(pmf_find_function); + +int pmf_call_function(struct device_node *target, const char *name, + struct pmf_args *args) +{ + struct pmf_function *func = pmf_find_function(target, name); + int rc; + + if (func == NULL) + return -ENODEV; + + rc = pmf_call_one(func, args); + pmf_put_function(func); + return rc; +} +EXPORT_SYMBOL_GPL(pmf_call_function); + Index: linux-work/include/asm-powerpc/pmac_feature.h =================================================================== --- linux-work.orig/include/asm-powerpc/pmac_feature.h 2006-01-04 11:55:10.000000000 +1100 +++ linux-work/include/asm-powerpc/pmac_feature.h 2006-01-04 16:34:13.000000000 +1100 @@ -318,10 +318,6 @@ extern void pmac_suspend_agp_for_card(struct pci_dev *dev); extern void pmac_resume_agp_for_card(struct pci_dev *dev); -/* Used by the via-pmu driver for suspend/resume - */ -extern void pmac_tweak_clock_spreading(int enable); - /* * The part below is for use by macio_asic.c only, do not rely * on the data structures or constants below in a normal driver @@ -378,5 +374,24 @@ #define MACIO_IN8(r) (in_8(MACIO_FCR8(macio,r))) #define MACIO_OUT8(r,v) (out_8(MACIO_FCR8(macio,r), (v))) +/* + * Those are exported by pmac feature for internal use by arch code + * only like the platform function callbacks, do not use directly in drivers + */ +extern spinlock_t feature_lock; +extern struct device_node *uninorth_node; +extern u32 __iomem *uninorth_base; + +/* + * Uninorth reg. access. Note that Uni-N regs are big endian + */ + +#define UN_REG(r) (uninorth_base + ((r) >> 2)) +#define UN_IN(r) (in_be32(UN_REG(r))) +#define UN_OUT(r,v) (out_be32(UN_REG(r), (v))) +#define UN_BIS(r,v) (UN_OUT((r), UN_IN(r) | (v))) +#define UN_BIC(r,v) (UN_OUT((r), UN_IN(r) & ~(v))) + + #endif /* __PPC_ASM_PMAC_FEATURE_H */ #endif /* __KERNEL__ */ Index: linux-work/arch/powerpc/platforms/powermac/smp.c =================================================================== --- linux-work.orig/arch/powerpc/platforms/powermac/smp.c 2006-01-04 11:55:10.000000000 +1100 +++ linux-work/arch/powerpc/platforms/powermac/smp.c 2006-01-05 11:54:05.000000000 +1100 @@ -52,8 +52,9 @@ #include #include #include +#include -#undef DEBUG +#define DEBUG #ifdef DEBUG #define DBG(fmt...) udbg_printf(fmt) @@ -62,6 +63,7 @@ #endif extern void __secondary_start_pmac_0(void); +extern int pmac_pfunc_base_install(void); #ifdef CONFIG_PPC32 @@ -482,7 +484,7 @@ /* * G5s enable/disable the timebase via an i2c-connected clock chip. */ -static struct device_node *pmac_tb_clock_chip_host; +static struct pmac_i2c_bus *pmac_tb_clock_chip_host; static u8 pmac_tb_pulsar_addr; static void smp_core99_cypress_tb_freeze(int freeze) @@ -493,20 +495,20 @@ /* Strangely, the device-tree says address is 0xd2, but darwin * accesses 0xd0 ... */ - pmac_low_i2c_setmode(pmac_tb_clock_chip_host, - pmac_low_i2c_mode_combined); - rc = pmac_low_i2c_xfer(pmac_tb_clock_chip_host, - 0xd0 | pmac_low_i2c_read, - 0x81, &data, 1); + pmac_i2c_setmode(pmac_tb_clock_chip_host, + pmac_i2c_mode_combined); + rc = pmac_i2c_xfer(pmac_tb_clock_chip_host, + 0xd0 | pmac_i2c_read, + 1, 0x81, &data, 1); if (rc != 0) goto bail; data = (data & 0xf3) | (freeze ? 0x00 : 0x0c); - pmac_low_i2c_setmode(pmac_tb_clock_chip_host, pmac_low_i2c_mode_stdsub); - rc = pmac_low_i2c_xfer(pmac_tb_clock_chip_host, - 0xd0 | pmac_low_i2c_write, - 0x81, &data, 1); + pmac_i2c_setmode(pmac_tb_clock_chip_host, pmac_i2c_mode_stdsub); + rc = pmac_i2c_xfer(pmac_tb_clock_chip_host, + 0xd0 | pmac_i2c_write, + 1, 0x81, &data, 1); bail: if (rc != 0) { @@ -522,20 +524,20 @@ u8 data; int rc; - pmac_low_i2c_setmode(pmac_tb_clock_chip_host, - pmac_low_i2c_mode_combined); - rc = pmac_low_i2c_xfer(pmac_tb_clock_chip_host, - pmac_tb_pulsar_addr | pmac_low_i2c_read, - 0x2e, &data, 1); + pmac_i2c_setmode(pmac_tb_clock_chip_host, + pmac_i2c_mode_combined); + rc = pmac_i2c_xfer(pmac_tb_clock_chip_host, + pmac_tb_pulsar_addr | pmac_i2c_read, + 1, 0x2e, &data, 1); if (rc != 0) goto bail; data = (data & 0x88) | (freeze ? 0x11 : 0x22); - pmac_low_i2c_setmode(pmac_tb_clock_chip_host, pmac_low_i2c_mode_stdsub); - rc = pmac_low_i2c_xfer(pmac_tb_clock_chip_host, - pmac_tb_pulsar_addr | pmac_low_i2c_write, - 0x2e, &data, 1); + pmac_i2c_setmode(pmac_tb_clock_chip_host, pmac_i2c_mode_stdsub); + rc = pmac_i2c_xfer(pmac_tb_clock_chip_host, + pmac_tb_pulsar_addr | pmac_i2c_write, + 1, 0x2e, &data, 1); bail: if (rc != 0) { printk(KERN_ERR "Pulsar Timebase %s rc: %d\n", @@ -560,13 +562,15 @@ if (!ok) continue; + pmac_tb_clock_chip_host = pmac_i2c_find_bus(cc); + if (pmac_tb_clock_chip_host == NULL) + continue; reg = (u32 *)get_property(cc, "reg", NULL); if (reg == NULL) continue; - switch (*reg) { case 0xd2: - if (device_is_compatible(cc, "pulsar-legacy-slewing")) { + if (device_is_compatible(cc,"pulsar-legacy-slewing")) { pmac_tb_freeze = smp_core99_pulsar_tb_freeze; pmac_tb_pulsar_addr = 0xd2; name = "Pulsar"; @@ -585,37 +589,44 @@ break; } if (pmac_tb_freeze != NULL) { - struct device_node *p = of_get_parent(cc); - of_node_put(cc); - while(p && strcmp(p->type, "i2c")) { - cc = of_get_parent(p); - of_node_put(p); - p = cc; - } - if (p == NULL) - goto no_i2c_sync; /* Open i2c bus for synchronous access */ - if (pmac_low_i2c_open(p, 0)) { - printk(KERN_ERR "Failed top open i2c bus %s for clock" - " sync, fallback to software sync !\n", - p->full_name); - of_node_put(p); + if (pmac_i2c_open(pmac_tb_clock_chip_host, 1)) { + printk(KERN_ERR "Failed top open i2c bus for clock" + " sync, fallback to software sync !\n"); goto no_i2c_sync; } - pmac_tb_clock_chip_host = p; printk(KERN_INFO "Processor timebase sync using %s i2c clock\n", name); return; } no_i2c_sync: pmac_tb_freeze = NULL; + pmac_tb_clock_chip_host = NULL; } -#endif /* CONFIG_PPC64 */ /* - * SMP G4 and newer G5 use a GPIO to enable/disable the timebase. + * Newer G5s uses a platform function + */ + +static void smp_core99_pfunc_tb_freeze(int freeze) +{ + struct device_node *cpus; + struct pmf_args args; + + cpus = of_find_node_by_path("/cpus"); + BUG_ON(cpus == NULL); + args.count = 1; + args.u[0].v = !freeze; + pmf_call_function(cpus, "cpu-timebase", &args); + of_node_put(cpus); +} + +#else /* CONFIG_PPC64 */ + +/* + * SMP G4 use a GPIO to enable/disable the timebase. */ static unsigned int core99_tb_gpio; /* Timebase freeze GPIO */ @@ -629,6 +640,9 @@ pmac_call_feature(PMAC_FTR_READ_GPIO, NULL, core99_tb_gpio, 0); } + +#endif /* !CONFIG_PPC64 */ + /* L2 and L3 cache settings to pass from CPU0 to CPU1 on G4 cpus */ volatile static long int core99_l2_cache; volatile static long int core99_l3_cache; @@ -674,19 +688,15 @@ machine_is_compatible("RackMac3,1")) smp_core99_setup_i2c_hwsync(ncpus); - /* GPIO based HW sync on recent G5s */ + /* pfunc based HW sync on recent G5s */ if (pmac_tb_freeze == NULL) { - struct device_node *np = - of_find_node_by_name(NULL, "timebase-enable"); - u32 *reg = (u32 *)get_property(np, "reg", NULL); - - if (np && reg && !strcmp(np->type, "gpio")) { - core99_tb_gpio = *reg; - if (core99_tb_gpio < 0x50) - core99_tb_gpio += 0x50; - pmac_tb_freeze = smp_core99_gpio_tb_freeze; + struct device_node *cpus = + of_find_node_by_path("/cpus"); + if (cpus && + get_property(cpus, "platform-cpu-timebase", NULL)) { + pmac_tb_freeze = smp_core99_pfunc_tb_freeze; printk(KERN_INFO "Processor timebase sync using" - " GPIO 0x%02x\n", core99_tb_gpio); + " platform function\n"); } } @@ -752,8 +762,19 @@ if (ncpus <= 1) return 1; + /* We need to perform some early initialisations before we can start + * setting up SMP as we are running before initcalls + */ + pmac_pfunc_base_install(); + pmac_i2c_init(); + + /* Setup various bits like timebase sync method, ability to nap, ... */ smp_core99_setup(ncpus); + + /* Install IPIs */ mpic_request_ipis(); + + /* Collect l2cr and l3cr values from CPU 0 */ core99_init_caches(0); return ncpus; @@ -817,7 +838,7 @@ /* Close i2c bus if it was used for tb sync */ if (pmac_tb_clock_chip_host) { - pmac_low_i2c_close(pmac_tb_clock_chip_host); + pmac_i2c_close(pmac_tb_clock_chip_host); pmac_tb_clock_chip_host = NULL; } Index: linux-work/arch/powerpc/platforms/powermac/low_i2c.c =================================================================== --- linux-work.orig/arch/powerpc/platforms/powermac/low_i2c.c 2005-11-24 17:21:41.000000000 +1100 +++ linux-work/arch/powerpc/platforms/powermac/low_i2c.c 2006-01-05 15:11:37.000000000 +1100 @@ -1,22 +1,34 @@ /* - * arch/ppc/platforms/pmac_low_i2c.c + * arch/powerpc/platforms/powermac/low_i2c.c * - * Copyright (C) 2003 Ben. Herrenschmidt (benh at kernel.crashing.org) + * Copyright (C) 2003-2005 Ben. Herrenschmidt (benh at kernel.crashing.org) * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version * 2 of the License, or (at your option) any later version. * - * This file contains some low-level i2c access routines that - * need to be used by various bits of the PowerMac platform code - * at times where the real asynchronous & interrupt driven driver - * cannot be used. The API borrows some semantics from the darwin - * driver in order to ease the implementation of the platform - * properties parser + * The linux i2c layer isn't completely suitable for our needs for various + * reasons ranging from too late initialisation to semantics not perfectly + * matching some requirements of the apple platform functions etc... + * + * This file thus provides a simple low level unified i2c interface for + * powermac that covers the various types of i2c busses used in Apple machines. + * For now, keywest, PMU and SMU, though we could add Cuda, or other bit + * banging busses found on older chipstes in earlier machines if we ever need + * one of them. + * + * The drivers in this file are synchronous/blocking. In addition, the + * keywest one is fairly slow due to the use of msleep instead of interrupts + * as the interrupt is currently used by i2c-keywest. In the long run, we + * might want to get rid of those high-level interfaces to linux i2c layer + * either completely (converting all drivers) or replacing them all with a + * single stub driver on top of this one. Once done, the interrupt will be + * available for our use. */ -#undef DEBUG +#define DEBUG +#undef DEBUG_LOW #include #include @@ -25,15 +37,16 @@ #include #include #include +#include #include #include #include #include #include +#include +#include #include -#define MAX_LOW_I2C_HOST 4 - #ifdef DEBUG #define DBG(x...) do {\ printk(KERN_DEBUG "low_i2c:" x); \ @@ -42,49 +55,54 @@ #define DBG(x...) #endif -struct low_i2c_host; - -typedef int (*low_i2c_func_t)(struct low_i2c_host *host, u8 addr, u8 sub, u8 *data, int len); +#ifdef DEBUG_LOW +#define DBG_LOW(x...) do {\ + printk(KERN_DEBUG "low_i2c:" x); \ + } while(0) +#else +#define DBG_LOW(x...) +#endif -struct low_i2c_host +/* + * A bus structure. Each bus in the system has such a structure associated. + */ +struct pmac_i2c_bus { - struct device_node *np; /* OF device node */ - struct semaphore mutex; /* Access mutex for use by i2c-keywest */ - low_i2c_func_t func; /* Access function */ - unsigned int is_open : 1; /* Poor man's access control */ - int mode; /* Current mode */ - int channel; /* Current channel */ - int num_channels; /* Number of channels */ - void __iomem *base; /* For keywest-i2c, base address */ - int bsteps; /* And register stepping */ - int speed; /* And speed */ + struct list_head link; + struct device_node *controller; + struct device_node *busnode; + int type; + int flags; + struct i2c_adapter *adapter; + void *hostdata; + int channel; /* some hosts have multiple */ + int mode; /* current mode */ + struct semaphore sem; + int opened; + int polled; /* open mode */ + + /* ops */ + int (*open)(struct pmac_i2c_bus *bus); + void (*close)(struct pmac_i2c_bus *bus); + int (*xfer)(struct pmac_i2c_bus *bus, u8 addrdir, int subsize, + u32 subaddr, u8 *data, int len); }; -static struct low_i2c_host low_i2c_hosts[MAX_LOW_I2C_HOST]; - -/* No locking is necessary on allocation, we are running way before - * anything can race with us - */ -static struct low_i2c_host *find_low_i2c_host(struct device_node *np) -{ - int i; - - for (i = 0; i < MAX_LOW_I2C_HOST; i++) - if (low_i2c_hosts[i].np == np) - return &low_i2c_hosts[i]; - return NULL; -} +static LIST_HEAD(pmac_i2c_busses); /* - * - * i2c-keywest implementation (UniNorth, U2, U3, Keylargo's) - * + * Keywest implementation */ -/* - * Keywest i2c definitions borrowed from drivers/i2c/i2c-keywest.h, - * should be moved somewhere in include/asm-ppc/ - */ +struct pmac_i2c_host_kw +{ + struct semaphore mutex; /* Access mutex for use by + * i2c-keywest */ + void __iomem *base; /* register base address */ + int bsteps; /* register stepping */ + int speed; /* speed */ +}; + /* Register indices */ typedef enum { reg_mode = 0, @@ -153,52 +171,56 @@ "state_dead" }; -static inline u8 __kw_read_reg(struct low_i2c_host *host, reg_t reg) +static inline u8 __kw_read_reg(struct pmac_i2c_bus *bus, reg_t reg) { + struct pmac_i2c_host_kw *host = bus->hostdata; return readb(host->base + (((unsigned int)reg) << host->bsteps)); } -static inline void __kw_write_reg(struct low_i2c_host *host, reg_t reg, u8 val) +static inline void __kw_write_reg(struct pmac_i2c_bus *bus, reg_t reg, u8 val) { + struct pmac_i2c_host_kw *host = bus->hostdata; writeb(val, host->base + (((unsigned)reg) << host->bsteps)); - (void)__kw_read_reg(host, reg_subaddr); + (void)__kw_read_reg(bus, reg_subaddr); } -#define kw_write_reg(reg, val) __kw_write_reg(host, reg, val) -#define kw_read_reg(reg) __kw_read_reg(host, reg) - +#define kw_write_reg(reg, val) __kw_write_reg(bus, reg, val) +#define kw_read_reg(reg) __kw_read_reg(bus, reg) -/* Don't schedule, the g5 fan controller is too - * timing sensitive - */ -static u8 kw_wait_interrupt(struct low_i2c_host* host) +static u8 kw_i2c_wait_interrupt(struct pmac_i2c_bus* bus) { int i, j; u8 isr; - for (i = 0; i < 100000; i++) { + for (i = 0; i < 1000; i++) { isr = kw_read_reg(reg_isr) & KW_I2C_IRQ_MASK; if (isr != 0) return isr; /* This code is used with the timebase frozen, we cannot rely - * on udelay ! For now, just use a bogus loop + * on udelay nor schedule when in polled mode ! + * For now, just use a bogus loop.... */ - for (j = 1; j < 10000; j++) - mb(); + if (bus->polled) { + for (j = 1; j < 1000000; j++) + mb(); + } else + msleep(1); } return isr; } -static int kw_handle_interrupt(struct low_i2c_host *host, int state, int rw, int *rc, u8 **data, int *len, u8 isr) +static int kw_i2c_handle_interrupt(struct pmac_i2c_bus *bus, int state, int rw, + int *rc, u8 **data, int *len, u8 isr) { u8 ack; - DBG("kw_handle_interrupt(%s, isr: %x)\n", __kw_state_names[state], isr); + DBG_LOW("kw_handle_interrupt(%s, isr: %x)\n", + __kw_state_names[state], isr); if (isr == 0) { if (state != state_stop) { - DBG("KW: Timeout !\n"); + DBG_LOW("KW: Timeout !\n"); *rc = -EIO; goto stop; } @@ -220,15 +242,16 @@ *rc = -EIO; goto stop; } - if ((ack & KW_I2C_STAT_LAST_AAK) == 0) { + if ((ack & KW_I2C_STAT_LAST_AAK) == 0) { *rc = -ENODEV; - DBG("KW: NAK on address\n"); + DBG_LOW("KW: NAK on address\n"); return state_stop; } else { if (rw) { state = state_read; if (*len > 1) - kw_write_reg(reg_control, KW_I2C_CTL_AAK); + kw_write_reg(reg_control, + KW_I2C_CTL_AAK); } else { state = state_write; kw_write_reg(reg_data, **data); @@ -250,7 +273,7 @@ } else if (state == state_write) { ack = kw_read_reg(reg_status); if ((ack & KW_I2C_STAT_LAST_AAK) == 0) { - DBG("KW: nack on data write\n"); + DBG_LOW("KW: nack on data write\n"); *rc = -EIO; goto stop; } else if (*len) { @@ -291,35 +314,57 @@ return state_stop; } -static int keywest_low_i2c_func(struct low_i2c_host *host, u8 addr, u8 subaddr, u8 *data, int len) +static int kw_i2c_open(struct pmac_i2c_bus *bus) { + struct pmac_i2c_host_kw *host = bus->hostdata; + down(&host->mutex); + return 0; +} + +static void kw_i2c_close(struct pmac_i2c_bus *bus) +{ + struct pmac_i2c_host_kw *host = bus->hostdata; + up(&host->mutex); +} + +static int kw_i2c_xfer(struct pmac_i2c_bus *bus, u8 addrdir, int subsize, + u32 subaddr, u8 *data, int len) +{ + struct pmac_i2c_host_kw *host = bus->hostdata; u8 mode_reg = host->speed; int state = state_addr; int rc = 0; /* Setup mode & subaddress if any */ - switch(host->mode) { - case pmac_low_i2c_mode_dumb: - printk(KERN_ERR "low_i2c: Dumb mode not supported !\n"); + switch(bus->mode) { + case pmac_i2c_mode_dumb: return -EINVAL; - case pmac_low_i2c_mode_std: + case pmac_i2c_mode_std: mode_reg |= KW_I2C_MODE_STANDARD; + if (subsize != 0) + return -EINVAL; break; - case pmac_low_i2c_mode_stdsub: + case pmac_i2c_mode_stdsub: mode_reg |= KW_I2C_MODE_STANDARDSUB; + if (subsize != 1) + return -EINVAL; break; - case pmac_low_i2c_mode_combined: + case pmac_i2c_mode_combined: mode_reg |= KW_I2C_MODE_COMBINED; + if (subsize != 1) + return -EINVAL; break; } /* Setup channel & clear pending irqs */ kw_write_reg(reg_isr, kw_read_reg(reg_isr)); - kw_write_reg(reg_mode, mode_reg | (host->channel << 4)); + kw_write_reg(reg_mode, mode_reg | (bus->channel << 4)); kw_write_reg(reg_status, 0); - /* Set up address and r/w bit */ - kw_write_reg(reg_addr, addr); + /* Set up address and r/w bit, strip possible stale bus number from + * address top bits + */ + kw_write_reg(reg_addr, addrdir & 0xff); /* Set up the sub address */ if ((mode_reg & KW_I2C_MODE_MODE_MASK) == KW_I2C_MODE_STANDARDSUB @@ -330,27 +375,27 @@ kw_write_reg(reg_ier, 0 /*KW_I2C_IRQ_MASK*/); kw_write_reg(reg_control, KW_I2C_CTL_XADDR); - /* State machine, to turn into an interrupt handler */ + /* State machine, to turn into an interrupt handler in the future */ while(state != state_idle) { - u8 isr = kw_wait_interrupt(host); - state = kw_handle_interrupt(host, state, addr & 1, &rc, &data, &len, isr); + u8 isr = kw_i2c_wait_interrupt(bus); + state = kw_i2c_handle_interrupt(bus, state, addrdir & 1, &rc, + &data, &len, isr); } return rc; } -static void keywest_low_i2c_add(struct device_node *np) +static struct pmac_i2c_host_kw *__init kw_i2c_host_init(struct device_node *np) { - struct low_i2c_host *host = find_low_i2c_host(NULL); + struct pmac_i2c_host_kw *host; u32 *psteps, *prate, *addrp, steps; - struct device_node *parent; + host = kzalloc(sizeof(struct pmac_i2c_host_kw), GFP_KERNEL); if (host == NULL) { printk(KERN_ERR "low_i2c: Can't allocate host for %s\n", np->full_name); - return; + return NULL; } - memset(host, 0, sizeof(*host)); /* Apple is kind enough to provide a valid AAPL,address property * on all i2c keywest nodes so far ... we would have to fallback @@ -360,18 +405,14 @@ if (addrp == NULL) { printk(KERN_ERR "low_i2c: Can't find address for %s\n", np->full_name); - return; + kfree(host); + return NULL; } init_MUTEX(&host->mutex); - host->np = of_node_get(np); psteps = (u32 *)get_property(np, "AAPL,address-step", NULL); steps = psteps ? (*psteps) : 0x10; for (host->bsteps = 0; (steps & 0x01) == 0; host->bsteps++) steps >>= 1; - parent = of_get_parent(np); - host->num_channels = 1; - if (parent && parent->name[0] == 'u') - host->num_channels = 2; /* Select interface rate */ host->speed = KW_I2C_MODE_25KHZ; prate = (u32 *)get_property(np, "AAPL,i2c-rate", NULL); @@ -387,15 +428,92 @@ break; } - printk(KERN_INFO "low_i2c: Bus %s found at 0x%08x, %d channels," - " speed = %d KHz\n", - np->full_name, *addrp, host->num_channels, prate ? *prate : 25); - - host->mode = pmac_low_i2c_mode_std; + printk(KERN_INFO "KeyWest i2c @0x%08x %s\n", *addrp, np->full_name); host->base = ioremap((*addrp), 0x1000); - host->func = keywest_low_i2c_func; + + return host; +} + + +static void __init kw_i2c_add(struct pmac_i2c_host_kw *host, + struct device_node *controller, + struct device_node *busnode, + int channel) +{ + struct pmac_i2c_bus *bus; + + bus = kzalloc(sizeof(struct pmac_i2c_bus), GFP_KERNEL); + if (bus == NULL) + return; + + bus->controller = of_node_get(controller); + bus->busnode = of_node_get(busnode); + bus->type = pmac_i2c_bus_keywest; + bus->hostdata = host; + bus->channel = channel; + bus->mode = pmac_i2c_mode_std; + bus->open = kw_i2c_open; + bus->close = kw_i2c_close; + bus->xfer = kw_i2c_xfer; + init_MUTEX(&bus->sem); + if (controller == busnode) + bus->flags = pmac_i2c_multibus; + list_add(&bus->link, &pmac_i2c_busses); + + printk(KERN_INFO " channel %d bus %s\n", channel, + (controller == busnode) ? "" : busnode->full_name); +} + +static void __init kw_i2c_probe(void) +{ + struct device_node *np, *child, *parent; + + /* Probe keywest-i2c busses */ + for (np = NULL; + (np = of_find_compatible_node(np, "i2c","keywest-i2c")) != NULL;){ + struct pmac_i2c_host_kw *host; + int multibus, chans, i; + + /* Found one, init a host structure */ + host = kw_i2c_host_init(np); + if (host == NULL) + continue; + + /* Now check if we have a multibus setup (old style) or if we + * have proper bus nodes. Note that the "new" way (proper bus + * nodes) might cause us to not create some busses that are + * kept hidden in the device-tree. In the future, we might + * want to work around that by creating busses without a node + * but not for now + */ + child = of_get_next_child(np, NULL); + multibus = !child || strcmp(child->name, "i2c-bus"); + of_node_put(child); + + /* For a multibus setup, we get the bus count based on the + * parent type + */ + if (multibus) { + parent = of_get_parent(np); + if (parent == NULL) + continue; + chans = parent->name[0] == 'u' ? 2 : 1; + for (i = 0; i < chans; i++) + kw_i2c_add(host, np, np, i); + } else { + for (child = NULL; + (child = of_get_next_child(np, child)) != NULL;) { + u32 *reg = + (u32 *)get_property(child, "reg", NULL); + if (reg == NULL) + continue; + kw_i2c_add(host, np, child, *reg); + } + } + } } + /* * * PMU implementation @@ -403,7 +521,7 @@ */ -#ifdef CONFIG_ADB_PMU +#ifdef CONFIG_ADB_PMU__disabled static int pmu_low_i2c_func(struct low_i2c_host *host, u8 addr, u8 sub, u8 *data, int len) { @@ -431,104 +549,509 @@ #endif /* CONFIG_ADB_PMU */ -void __init pmac_init_low_i2c(void) -{ - struct device_node *np; +/* + * + * Core code + * + */ - /* Probe keywest-i2c busses */ - np = of_find_compatible_node(NULL, "i2c", "keywest-i2c"); - while(np) { - keywest_low_i2c_add(np); - np = of_find_compatible_node(np, "i2c", "keywest-i2c"); + +struct pmac_i2c_bus *pmac_i2c_find_bus(struct device_node *node) +{ + struct device_node *p = of_node_get(node); + struct device_node *prev = NULL; + struct pmac_i2c_bus *bus; + + while(p) { + list_for_each_entry(bus, &pmac_i2c_busses, link) { + if (p == bus->busnode) { + if (prev && bus->flags & pmac_i2c_multibus) { + u32 *reg; + reg = (u32 *)get_property(prev, "reg", + NULL); + if (!reg) + continue; + if (((*reg) >> 8) != bus->channel) + continue; + } + of_node_put(p); + of_node_put(prev); + return bus; + } + } + of_node_put(prev); + prev = p; + p = of_get_parent(p); } + return NULL; +} +EXPORT_SYMBOL_GPL(pmac_i2c_find_bus); -#ifdef CONFIG_ADB_PMU - /* Probe PMU busses */ - np = of_find_node_by_name(NULL, "via-pmu"); - if (np) - pmu_low_i2c_add(np); -#endif /* CONFIG_ADB_PMU */ +u8 pmac_i2c_get_dev_addr(struct device_node *device) +{ + u32 *reg = (u32 *)get_property(device, "reg", NULL); - /* TODO: Add CUDA support as well */ + if (reg == NULL) + return 0; + + return (*reg) & 0xff; } +EXPORT_SYMBOL_GPL(pmac_i2c_get_dev_addr); + +struct device_node *pmac_i2c_get_controller(struct pmac_i2c_bus *bus) +{ + return bus->controller; +} +EXPORT_SYMBOL_GPL(pmac_i2c_get_controller); + +struct device_node *pmac_i2c_get_bus_node(struct pmac_i2c_bus *bus) +{ + return bus->busnode; +} +EXPORT_SYMBOL_GPL(pmac_i2c_get_bus_node); + +int pmac_i2c_get_type(struct pmac_i2c_bus *bus) +{ + return bus->type; +} +EXPORT_SYMBOL_GPL(pmac_i2c_get_type); + +int pmac_i2c_get_flags(struct pmac_i2c_bus *bus) +{ + return bus->flags; +} +EXPORT_SYMBOL_GPL(pmac_i2c_get_flags); + +void pmac_i2c_attach_adapter(struct pmac_i2c_bus *bus, + struct i2c_adapter *adapter) +{ + WARN_ON(bus->adapter != NULL); + bus->adapter = adapter; +} +EXPORT_SYMBOL_GPL(pmac_i2c_attach_adapter); + +void pmac_i2c_detach_adapter(struct pmac_i2c_bus *bus, + struct i2c_adapter *adapter) +{ + WARN_ON(bus->adapter != adapter); + bus->adapter = NULL; +} +EXPORT_SYMBOL_GPL(pmac_i2c_detach_adapter); + +struct i2c_adapter *pmac_i2c_get_adapter(struct pmac_i2c_bus *bus) +{ + return bus->adapter; +} +EXPORT_SYMBOL_GPL(pmac_i2c_get_adapter); + +extern int pmac_i2c_match_adapter(struct device_node *dev, + struct i2c_adapter *adapter) +{ + struct pmac_i2c_bus *bus = pmac_i2c_find_bus(dev); + + if (bus == NULL) + return 0; + return (bus->adapter == adapter); +} +EXPORT_SYMBOL_GPL(pmac_i2c_match_adapter); int pmac_low_i2c_lock(struct device_node *np) { - struct low_i2c_host *host = find_low_i2c_host(np); + struct pmac_i2c_bus *bus, *found = NULL; - if (!host) + list_for_each_entry(bus, &pmac_i2c_busses, link) { + if (np == bus->controller) { + found = bus; + break; + } + } + if (!found) return -ENODEV; - down(&host->mutex); - return 0; + return pmac_i2c_open(bus, 0); } -EXPORT_SYMBOL(pmac_low_i2c_lock); +EXPORT_SYMBOL_GPL(pmac_low_i2c_lock); int pmac_low_i2c_unlock(struct device_node *np) { - struct low_i2c_host *host = find_low_i2c_host(np); + struct pmac_i2c_bus *bus, *found = NULL; - if (!host) + list_for_each_entry(bus, &pmac_i2c_busses, link) { + if (np == bus->controller) { + found = bus; + break; + } + } + if (!found) return -ENODEV; - up(&host->mutex); + pmac_i2c_close(bus); return 0; } -EXPORT_SYMBOL(pmac_low_i2c_unlock); +EXPORT_SYMBOL_GPL(pmac_low_i2c_unlock); -int pmac_low_i2c_open(struct device_node *np, int channel) +int pmac_i2c_open(struct pmac_i2c_bus *bus, int polled) { - struct low_i2c_host *host = find_low_i2c_host(np); + int rc; - if (!host) - return -ENODEV; + down(&bus->sem); + bus->polled = polled; + bus->opened = 1; + bus->mode = pmac_i2c_mode_std; + if (bus->open && (rc = bus->open(bus)) != 0) { + bus->opened = 0; + up(&bus->sem); + return rc; + } + return 0; +} +EXPORT_SYMBOL_GPL(pmac_i2c_open); - if (channel >= host->num_channels) - return -EINVAL; +void pmac_i2c_close(struct pmac_i2c_bus *bus) +{ + WARN_ON(!bus->opened); + if (bus->close) + bus->close(bus); + bus->opened = 0; + up(&bus->sem); +} +EXPORT_SYMBOL_GPL(pmac_i2c_close); - down(&host->mutex); - host->is_open = 1; - host->channel = channel; +int pmac_i2c_setmode(struct pmac_i2c_bus *bus, int mode) +{ + WARN_ON(!bus->opened); + bus->mode = mode; return 0; } -EXPORT_SYMBOL(pmac_low_i2c_open); +EXPORT_SYMBOL_GPL(pmac_i2c_setmode); -int pmac_low_i2c_close(struct device_node *np) +int pmac_i2c_xfer(struct pmac_i2c_bus *bus, u8 addrdir, int subsize, + u32 subaddr, u8 *data, int len) { - struct low_i2c_host *host = find_low_i2c_host(np); + int rc; - if (!host) - return -ENODEV; + WARN_ON(!bus->opened); - host->is_open = 0; - up(&host->mutex); + DBG("xfer() chan=%d, addrdir=0x%x, mode=%d, subsize=%d, subaddr=0x%x," + " %d bytes, bus %s\n", bus->channel, addrdir, bus->mode, subsize, + subaddr, len, bus->busnode->full_name); - return 0; + rc = bus->xfer(bus, addrdir, subsize, subaddr, data, len); + +#ifdef DEBUG + if (rc) + DBG("xfer error %d\n", rc); +#endif + return rc; } -EXPORT_SYMBOL(pmac_low_i2c_close); +EXPORT_SYMBOL_GPL(pmac_i2c_xfer); + +/* some quirks for platform function decoding */ +enum { + pmac_i2c_quirk_invmask = 0x00000001u, +}; -int pmac_low_i2c_setmode(struct device_node *np, int mode) +static void pmac_i2c_devscan(void (*callback)(struct device_node *dev, + int quirks)) { - struct low_i2c_host *host = find_low_i2c_host(np); + struct pmac_i2c_bus *bus; + struct device_node *np; + static struct whitelist_ent { + char *name; + char *compatible; + int quirks; + } whitelist[] = { + /* XXX Study device-tree's & apple drivers are get the quirks + * right ! + */ + { "i2c-hwclock", NULL, pmac_i2c_quirk_invmask }, + { "i2c-cpu-voltage", NULL, 0}, + { "temp-monitor", NULL, 0 }, + { "supply-monitor", NULL, 0 }, + { NULL, NULL, 0 }, + }; + + /* Only some devices need to have platform functions instanciated + * here. For now, we have a table. Others, like 9554 i2c GPIOs used + * on Xserve, if we ever do a driver for them, will use their own + * platform function instance + */ + list_for_each_entry(bus, &pmac_i2c_busses, link) { + for (np = NULL; + (np = of_get_next_child(bus->busnode, np)) != NULL;) { + struct whitelist_ent *p; + /* If multibus, check if device is on that bus */ + if (bus->flags & pmac_i2c_multibus) + if (bus != pmac_i2c_find_bus(np)) + continue; + for (p = whitelist; p->name != NULL; p++) { + if (strcmp(np->name, p->name)) + continue; + if (p->compatible && + !device_is_compatible(np, p->compatible)) + continue; + callback(np, p->quirks); + break; + } + } + } +} - if (!host) - return -ENODEV; - WARN_ON(!host->is_open); - host->mode = mode; +#define MAX_I2C_DATA 64 + +struct pmac_i2c_pf_inst +{ + struct pmac_i2c_bus *bus; + u8 addr; + u8 buffer[MAX_I2C_DATA]; + u8 scratch[MAX_I2C_DATA]; + int bytes; + int quirks; +}; + +static void* pmac_i2c_do_begin(struct pmf_function *func, struct pmf_args *args) +{ + struct pmac_i2c_pf_inst *inst; + struct pmac_i2c_bus *bus; + + bus = pmac_i2c_find_bus(func->node); + if (bus == NULL) { + printk(KERN_ERR "low_i2c: Can't find bus for %s (pfunc)\n", + func->node->full_name); + return NULL; + } + if (pmac_i2c_open(bus, 0)) { + printk(KERN_ERR "low_i2c: Can't open i2c bus for %s (pfunc)\n", + func->node->full_name); + return NULL; + } + + /* XXX might need GFP_ATOMIC when called during the suspend process, + * but then, there are already lots of issues with suspending when + * near OOM that need to be resolved, the allocator itself should + * probably make GFP_NOIO implicit during suspend + */ + inst = kzalloc(sizeof(struct pmac_i2c_pf_inst), GFP_KERNEL); + if (inst == NULL) { + pmac_i2c_close(bus); + return NULL; + } + inst->bus = bus; + inst->addr = pmac_i2c_get_dev_addr(func->node); + inst->quirks = (int)(long)func->driver_data; + return inst; +} +static void pmac_i2c_do_end(struct pmf_function *func, void *instdata) +{ + struct pmac_i2c_pf_inst *inst = instdata; + + if (inst == NULL) + return; + pmac_i2c_close(inst->bus); + if (inst) + kfree(inst); +} + +static int pmac_i2c_do_read(PMF_STD_ARGS, u32 len) +{ + struct pmac_i2c_pf_inst *inst = instdata; + + inst->bytes = len; + return pmac_i2c_xfer(inst->bus, inst->addr | pmac_i2c_read, 0, 0, + inst->buffer, len); +} + +static int pmac_i2c_do_write(PMF_STD_ARGS, u32 len, const u8 *data) +{ + struct pmac_i2c_pf_inst *inst = instdata; + + return pmac_i2c_xfer(inst->bus, inst->addr | pmac_i2c_write, 0, 0, + (u8 *)data, len); +} + +/* This function is used to do the masking & OR'ing for the "rmw" type + * callbacks. Ze should apply the mask and OR in the values in the + * buffer before writing back. The problem is that it seems that + * various darwin drivers implement the mask/or differently, thus + * we need to check the quirks first + */ +static void pmac_i2c_do_apply_rmw(struct pmac_i2c_pf_inst *inst, + u32 len, const u8 *mask, const u8 *val) +{ + int i; + + if (inst->quirks & pmac_i2c_quirk_invmask) { + for (i = 0; i < len; i ++) + inst->scratch[i] = (inst->buffer[i] & mask[i]) | val[i]; + } else { + for (i = 0; i < len; i ++) + inst->scratch[i] = (inst->buffer[i] & ~mask[i]) + | (val[i] & mask[i]); + } +} + +static int pmac_i2c_do_rmw(PMF_STD_ARGS, u32 masklen, u32 valuelen, + u32 totallen, const u8 *maskdata, + const u8 *valuedata) +{ + struct pmac_i2c_pf_inst *inst = instdata; + + if (masklen > inst->bytes || valuelen > inst->bytes || + totallen > inst->bytes || valuelen > masklen) + return -EINVAL; + + pmac_i2c_do_apply_rmw(inst, masklen, maskdata, valuedata); + + return pmac_i2c_xfer(inst->bus, inst->addr | pmac_i2c_write, 0, 0, + inst->scratch, totallen); +} + +static int pmac_i2c_do_read_sub(PMF_STD_ARGS, u8 subaddr, u32 len) +{ + struct pmac_i2c_pf_inst *inst = instdata; + + inst->bytes = len; + return pmac_i2c_xfer(inst->bus, inst->addr | pmac_i2c_read, 1, subaddr, + inst->buffer, len); +} + +static int pmac_i2c_do_write_sub(PMF_STD_ARGS, u8 subaddr, u32 len, + const u8 *data) +{ + struct pmac_i2c_pf_inst *inst = instdata; + + return pmac_i2c_xfer(inst->bus, inst->addr | pmac_i2c_write, 1, + subaddr, (u8 *)data, len); +} + +static int pmac_i2c_do_set_mode(PMF_STD_ARGS, int mode) +{ + struct pmac_i2c_pf_inst *inst = instdata; + + return pmac_i2c_setmode(inst->bus, mode); +} + +static int pmac_i2c_do_rmw_sub(PMF_STD_ARGS, u8 subaddr, u32 masklen, + u32 valuelen, u32 totallen, const u8 *maskdata, + const u8 *valuedata) +{ + struct pmac_i2c_pf_inst *inst = instdata; + + if (masklen > inst->bytes || valuelen > inst->bytes || + totallen > inst->bytes || valuelen > masklen) + return -EINVAL; + + pmac_i2c_do_apply_rmw(inst, masklen, maskdata, valuedata); + + return pmac_i2c_xfer(inst->bus, inst->addr | pmac_i2c_write, 1, + subaddr, inst->scratch, totallen); +} + +static int pmac_i2c_do_mask_and_comp(PMF_STD_ARGS, u32 len, + const u8 *maskdata, + const u8 *valuedata) +{ + struct pmac_i2c_pf_inst *inst = instdata; + int i, match; + + /* Get return value pointer, it's assumed to be a u32 */ + if (!args || !args->count || !args->u[0].p) + return -EINVAL; + + /* Check buffer */ + if (len > inst->bytes) + return -EINVAL; + + for (i = 0, match = 1; match && i < len; i ++) + if ((inst->buffer[i] & maskdata[i]) != valuedata[i]) + match = 0; + *args->u[0].p = match; return 0; } -EXPORT_SYMBOL(pmac_low_i2c_setmode); -int pmac_low_i2c_xfer(struct device_node *np, u8 addrdir, u8 subaddr, u8 *data, int len) +static int pmac_i2c_do_delay(PMF_STD_ARGS, u32 duration) { - struct low_i2c_host *host = find_low_i2c_host(np); + msleep((duration + 999) / 1000); + return 0; +} - if (!host) - return -ENODEV; - WARN_ON(!host->is_open); - return host->func(host, addrdir, subaddr, data, len); +static struct pmf_handlers pmac_i2c_pfunc_handlers = { + .begin = pmac_i2c_do_begin, + .end = pmac_i2c_do_end, + .read_i2c = pmac_i2c_do_read, + .write_i2c = pmac_i2c_do_write, + .rmw_i2c = pmac_i2c_do_rmw, + .read_i2c_sub = pmac_i2c_do_read_sub, + .write_i2c_sub = pmac_i2c_do_write_sub, + .rmw_i2c_sub = pmac_i2c_do_rmw_sub, + .set_i2c_mode = pmac_i2c_do_set_mode, + .mask_and_compare = pmac_i2c_do_mask_and_comp, + .delay = pmac_i2c_do_delay, +}; + + +static void __init pmac_i2c_dev_init(struct device_node *np, int quirks) +{ + DBG("low_i2c: dev_init(%s)\n", np->full_name); + + pmf_register_driver(np, &pmac_i2c_pfunc_handlers, + (void *)(long)quirks); + pmf_do_functions(np, NULL, 0, PMF_FLAGS_ON_INIT, NULL); +} + +static void pmac_i2c_dev_suspend(struct device_node *np, int quirks) +{ + DBG("low_i2c: dev_suspend(%s)\n", np->full_name); + pmf_do_functions(np, NULL, 0, PMF_FLAGS_ON_SLEEP, NULL); +} + +static void pmac_i2c_dev_resume(struct device_node *np, int quirks) +{ + DBG("low_i2c: dev_resume(%s)\n", np->full_name); + pmf_do_functions(np, NULL, 0, PMF_FLAGS_ON_WAKE, NULL); +} + +void pmac_pfunc_i2c_suspend(void) +{ + pmac_i2c_devscan(pmac_i2c_dev_suspend); +} + +void pmac_pfunc_i2c_resume(void) +{ + pmac_i2c_devscan(pmac_i2c_dev_resume); +} + +/* + * Initialize us: probe all i2c busses on the machine, instantiate + * busses and platform functions as needed. + */ +/* This is non-static as it might be called early by smp code */ +int __init pmac_i2c_init(void) +{ + static int i2c_inited; + + if (i2c_inited) + return 0; + i2c_inited = 1; + + /* Probe keywest-i2c busses */ + kw_i2c_probe(); + +#ifdef CONFIG_ADB_PMU__disabled + /* Probe PMU busses */ + np = of_find_node_by_name(NULL, "via-pmu"); + if (np) + pmu_low_i2c_add(np); +#endif /* CONFIG_ADB_PMU */ + + /* TODO: Add others... */ + + /* Now add plaform functions for some known devices */ + pmac_i2c_devscan(pmac_i2c_dev_init); + + return 0; } -EXPORT_SYMBOL(pmac_low_i2c_xfer); +arch_initcall(pmac_i2c_init); Index: linux-work/include/asm-powerpc/pmac_low_i2c.h =================================================================== --- linux-work.orig/include/asm-powerpc/pmac_low_i2c.h 2005-12-21 10:24:46.000000000 +1100 +++ linux-work/include/asm-powerpc/pmac_low_i2c.h 2006-01-04 16:53:13.000000000 +1100 @@ -15,31 +15,91 @@ /* i2c mode (based on the platform functions format) */ enum { - pmac_low_i2c_mode_dumb = 1, - pmac_low_i2c_mode_std = 2, - pmac_low_i2c_mode_stdsub = 3, - pmac_low_i2c_mode_combined = 4, + pmac_i2c_mode_dumb = 1, + pmac_i2c_mode_std = 2, + pmac_i2c_mode_stdsub = 3, + pmac_i2c_mode_combined = 4, }; /* RW bit in address */ enum { - pmac_low_i2c_read = 0x01, - pmac_low_i2c_write = 0x00 + pmac_i2c_read = 0x01, + pmac_i2c_write = 0x00 }; +/* i2c bus type */ +enum { + pmac_i2c_bus_keywest = 0, + pmac_i2c_bus_pmu = 1, + pmac_i2c_bus_smu = 2, +}; + +/* i2c bus features */ +enum { + /* can_largesub : supports >1 byte subaddresses (SMU only) */ + pmac_i2c_can_largesub = 0x00000001u, + + /* multibus : device node holds multiple busses, bus number is + * encoded in bits 0xff00 of "reg" of a given device + */ + pmac_i2c_multibus = 0x00000002u, +}; + +/* i2c busses in the system */ +struct pmac_i2c_bus; +struct i2c_adapter; + /* Init, called early during boot */ -extern void pmac_init_low_i2c(void); +extern int pmac_i2c_init(void); -/* Locking functions exposed to i2c-keywest */ -int pmac_low_i2c_lock(struct device_node *np); -int pmac_low_i2c_unlock(struct device_node *np); +/* Lookup an i2c bus for a device-node. The node can be either the bus + * node itself or a device below it. In the case of a multibus, the bus + * node itself is the controller node, else, it's a child of the controller + * node + */ +extern struct pmac_i2c_bus *pmac_i2c_find_bus(struct device_node *node); + +/* Get the address for an i2c device. This strips the bus number if + * necessary. The 7 bits address is returned 1 bit right shifted so that the + * direction can be directly ored in + */ +extern u8 pmac_i2c_get_dev_addr(struct device_node *device); + +/* Get infos about a bus */ +extern struct device_node *pmac_i2c_get_controller(struct pmac_i2c_bus *bus); +extern struct device_node *pmac_i2c_get_bus_node(struct pmac_i2c_bus *bus); +extern int pmac_i2c_get_type(struct pmac_i2c_bus *bus); +extern int pmac_i2c_get_flags(struct pmac_i2c_bus *bus); + +/* i2c layer adapter attach/detach */ +extern void pmac_i2c_attach_adapter(struct pmac_i2c_bus *bus, + struct i2c_adapter *adapter); +extern void pmac_i2c_detach_adapter(struct pmac_i2c_bus *bus, + struct i2c_adapter *adapter); +extern struct i2c_adapter *pmac_i2c_get_adapter(struct pmac_i2c_bus *bus); + +/* March a device or bus with an i2c adapter structure, to be used by drivers + * to match device-tree nodes with i2c adapters during adapter discovery + * callbacks + */ +extern int pmac_i2c_match_adapter(struct device_node *dev, + struct i2c_adapter *adapter); + + +/* (legacy) Locking functions exposed to i2c-keywest */ +extern int pmac_low_i2c_lock(struct device_node *np); +extern int pmac_low_i2c_unlock(struct device_node *np); /* Access functions for platform code */ -int pmac_low_i2c_open(struct device_node *np, int channel); -int pmac_low_i2c_close(struct device_node *np); -int pmac_low_i2c_setmode(struct device_node *np, int mode); -int pmac_low_i2c_xfer(struct device_node *np, u8 addrdir, u8 subaddr, u8 *data, int len); - +extern int pmac_i2c_open(struct pmac_i2c_bus *bus, int polled); +extern void pmac_i2c_close(struct pmac_i2c_bus *bus); +extern int pmac_i2c_setmode(struct pmac_i2c_bus *bus, int mode); +extern int pmac_i2c_xfer(struct pmac_i2c_bus *bus, u8 addrdir, int subsize, + u32 subaddr, u8 *data, int len); + +/* Suspend/resume code called by via-pmu directly for now */ +extern void pmac_pfunc_i2c_suspend(void); +extern void pmac_pfunc_i2c_resume(void); #endif /* __KERNEL__ */ #endif /* __PMAC_LOW_I2C_H__ */ Index: linux-work/drivers/macintosh/via-pmu.c =================================================================== --- linux-work.orig/drivers/macintosh/via-pmu.c 2005-12-19 16:13:42.000000000 +1100 +++ linux-work/drivers/macintosh/via-pmu.c 2006-01-04 16:53:54.000000000 +1100 @@ -2358,8 +2358,9 @@ return -EBUSY; } - /* Disable clock spreading on some machines */ - pmac_tweak_clock_spreading(0); + /* Call platform functions marked "on sleep" */ + pmac_pfunc_i2c_suspend(; + pmac_pfunc_base_suspend(); /* Stop preemption */ preempt_disable(); @@ -2431,8 +2432,9 @@ mdelay(10); preempt_enable(); - /* Re-enable clock spreading on some machines */ - pmac_tweak_clock_spreading(1); + /* Call platform functions marked "on wake" */ + pmac_pfunc_base_resume(); + pmac_pfunc_i2c_resume(); /* Resume devices */ device_resume(); From benh at kernel.crashing.org Thu Jan 5 16:47:18 2006 From: benh at kernel.crashing.org (Benjamin Herrenschmidt) Date: Thu, 05 Jan 2006 16:47:18 +1100 Subject: [PATCH] powerpc: Add cpufreq for various G5 machines Message-ID: <1136440038.4840.55.camel@localhost.localdomain> This patch uses the platform function patch posted earlier to implement cpu frequency switching on various G5 models. For now, this should work with all PowerMac7,2 and 7,3 (in addition to the code that was already there for iMac G5 and PowerMac9,1), that is desktop modeles with an AGP slot (not the newest PCI Express ones yet, that will be next). I tested it on the dual 2.5 Ghz here (pulsar clock chip) but I haven't had a chance to test it on other models using other frequencies or other clock chips. It's also not hooked to the thermal control code at all yet, this will happen once I port therm_pm72 to the windfarm architecture. I didn't found a nice & clear way to "know" what the low frequency value is (I only know how to tell the clock chip to slew to "low speed", not what "low speed" really is). I think I found a way to figure it out, but it might not work on all models, thus you might end up with a slightly incorrect value when running low speed in /proc/cpuinfo, though that should have no other effect since the kernel doesn't rely on the CPU core frequency for it's timekeeping. If you want to verify, you can use the little hack at http://gate.crashing.org/~benh/cpufreq_g5.c which attempts to "measure" the cpu frequency (970 only). Signed-off-by: Benjamin Herrenschmidt Index: linux-work/arch/powerpc/platforms/powermac/cpufreq_64.c =================================================================== --- linux-work.orig/arch/powerpc/platforms/powermac/cpufreq_64.c 2006-01-05 15:11:16.000000000 +1100 +++ linux-work/arch/powerpc/platforms/powermac/cpufreq_64.c 2006-01-05 16:18:23.000000000 +1100 @@ -28,6 +28,7 @@ #include #include #include +#include #undef DEBUG @@ -85,6 +86,10 @@ static int g5_pmode_max; static int g5_pmode_cur; +static void (*g5_switch_volt)(int speed_mode); +static int (*g5_switch_freq)(int speed_mode); +static int (*g5_query_freq)(void); + static DECLARE_MUTEX(g5_switch_mutex); @@ -92,9 +97,12 @@ static int g5_fvt_count; /* number of op. points */ static int g5_fvt_cur; /* current op. point */ -/* ----------------- real hardware interface */ -static void g5_switch_volt(int speed_mode) +/* + * SMU based voltage switching for Neo2 platforms + */ + +static void g5_smu_switch_volt(int speed_mode) { struct smu_simple_cmd cmd; @@ -105,26 +113,20 @@ wait_for_completion(&comp); } -static int g5_switch_freq(int speed_mode) +/* + * SCOM based frequency switching for 970FX rev3 + */ +static int g5_scom_switch_freq(int speed_mode) { - struct cpufreq_freqs freqs; + unsigned long flags; int to; - if (g5_pmode_cur == speed_mode) - return 0; - - down(&g5_switch_mutex); - - freqs.old = g5_cpu_freqs[g5_pmode_cur].frequency; - freqs.new = g5_cpu_freqs[speed_mode].frequency; - freqs.cpu = 0; - - cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE); - /* If frequency is going up, first ramp up the voltage */ if (speed_mode < g5_pmode_cur) g5_switch_volt(speed_mode); + local_irq_save(flags); + /* Clear PCR high */ scom970_write(SCOM_PCR, 0); /* Clear PCR low */ @@ -147,6 +149,8 @@ udelay(100); } + local_irq_restore(flags); + /* If frequency is going down, last ramp the voltage */ if (speed_mode > g5_pmode_cur) g5_switch_volt(speed_mode); @@ -154,14 +158,10 @@ g5_pmode_cur = speed_mode; ppc_proc_freq = g5_cpu_freqs[speed_mode].frequency * 1000ul; - cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE); - - up(&g5_switch_mutex); - return 0; } -static int g5_query_freq(void) +static int g5_scom_query_freq(void) { unsigned long psr = scom970_read(SCOM_PSR); int i; @@ -173,7 +173,97 @@ return i; } -/* ----------------- cpufreq bookkeeping */ +/* + * Platform function based voltage switching for PowerMac7,2 & 7,3 + */ + +static struct pmf_function *pfunc_cpu0_volt_high; +static struct pmf_function *pfunc_cpu0_volt_low; +static struct pmf_function *pfunc_cpu1_volt_high; +static struct pmf_function *pfunc_cpu1_volt_low; + +static void g5_pfunc_switch_volt(int speed_mode) +{ + if (speed_mode == CPUFREQ_HIGH) { + if (pfunc_cpu0_volt_high) + pmf_call_one(pfunc_cpu0_volt_high, NULL); + if (pfunc_cpu1_volt_high) + pmf_call_one(pfunc_cpu1_volt_high, NULL); + } else { + if (pfunc_cpu0_volt_low) + pmf_call_one(pfunc_cpu0_volt_low, NULL); + if (pfunc_cpu1_volt_low) + pmf_call_one(pfunc_cpu1_volt_low, NULL); + } + msleep(10); /* should be faster , to fix */ +} + +/* + * Platform function based frequency switching for PowerMac7,2 & 7,3 + */ + +static struct pmf_function *pfunc_cpu_setfreq_high; +static struct pmf_function *pfunc_cpu_setfreq_low; +static struct pmf_function *pfunc_cpu_getfreq; +static struct pmf_function *pfunc_slewing_done;; + +static int g5_pfunc_switch_freq(int speed_mode) +{ + struct pmf_args args; + u32 done = 0; + unsigned long timeout; + + /* If frequency is going up, first ramp up the voltage */ + if (speed_mode < g5_pmode_cur) + g5_switch_volt(speed_mode); + + /* Do it */ + if (speed_mode == CPUFREQ_HIGH) + pmf_call_one(pfunc_cpu_setfreq_high, NULL); + else + pmf_call_one(pfunc_cpu_setfreq_low, NULL); + + /* It's an irq GPIO so we should be able to just block here, + * I'll do that later after I've properly tested the IRQ code for + * platform functions + */ + timeout = jiffies + HZ/10; + while(!time_after(jiffies, timeout)) { + done = 0; + args.count = 1; + args.u[0].p = &done; + pmf_call_one(pfunc_slewing_done, &args); + if (done) + break; + msleep(1); + } + if (done == 0) + printk(KERN_WARNING "cpufreq: Timeout in clock slewing !\n"); + + /* If frequency is going down, last ramp the voltage */ + if (speed_mode > g5_pmode_cur) + g5_switch_volt(speed_mode); + + g5_pmode_cur = speed_mode; + ppc_proc_freq = g5_cpu_freqs[speed_mode].frequency * 1000ul; + + return 0; +} + +static int g5_pfunc_query_freq(void) +{ + struct pmf_args args; + u32 val = 0; + + args.count = 1; + args.u[0].p = &val; + pmf_call_one(pfunc_cpu_getfreq, &args); + return val ? CPUFREQ_HIGH : CPUFREQ_LOW; +} + +/* + * Common interface to the cpufreq core + */ static int g5_cpufreq_verify(struct cpufreq_policy *policy) { @@ -183,13 +273,30 @@ static int g5_cpufreq_target(struct cpufreq_policy *policy, unsigned int target_freq, unsigned int relation) { - unsigned int newstate = 0; + unsigned int newstate = 0; + struct cpufreq_freqs freqs; + int rc; if (cpufreq_frequency_table_target(policy, g5_cpu_freqs, target_freq, relation, &newstate)) return -EINVAL; - return g5_switch_freq(newstate); + if (g5_pmode_cur == newstate) + return 0; + + down(&g5_switch_mutex); + + freqs.old = g5_cpu_freqs[g5_pmode_cur].frequency; + freqs.new = g5_cpu_freqs[newstate].frequency; + freqs.cpu = 0; + + cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE); + rc = g5_switch_freq(newstate); + cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE); + + up(&g5_switch_mutex); + + return rc; } static unsigned int g5_cpufreq_get_speed(unsigned int cpu) @@ -205,6 +312,7 @@ policy->governor = CPUFREQ_DEFAULT_GOVERNOR; policy->cpuinfo.transition_latency = CPUFREQ_ETERNAL; policy->cur = g5_cpu_freqs[g5_query_freq()].frequency; + policy->cpus = cpu_possible_map; cpufreq_frequency_table_get_attr(g5_cpu_freqs, policy->cpu); return cpufreq_frequency_table_cpuinfo(policy, @@ -224,19 +332,24 @@ }; -static int __init g5_cpufreq_init(void) +static int __init g5_neo2_cpufreq_init(struct device_node *cpus) { struct device_node *cpunode; unsigned int psize, ssize; struct smu_sdbp_header *shdr; unsigned long max_freq; + char *freq_method, *volt_method; u32 *valp; int rc = -ENODEV; - /* Look for CPU and SMU nodes */ - cpunode = of_find_node_by_type(NULL, "cpu"); - if (!cpunode) { - DBG("No CPU node !\n"); + /* Get first CPU node */ + for (cpunode = NULL; + (cpunode = of_get_next_child(cpus, cpunode)) != NULL;) { + if (!strcmp(cpunode->type, "cpu")) + break; + } + if (cpunode == NULL) { + printk(KERN_ERR "cpufreq: Can't find any CPU node\n"); return -ENODEV; } @@ -286,19 +399,23 @@ g5_cpu_freqs[0].frequency = max_freq; g5_cpu_freqs[1].frequency = max_freq/2; - /* Check current frequency */ - g5_pmode_cur = g5_query_freq(); - if (g5_pmode_cur > 1) - /* We don't support anything but 1:1 and 1:2, fixup ... */ - g5_pmode_cur = 1; + /* Set callbacks */ + g5_switch_volt = g5_smu_switch_volt; + g5_switch_freq = g5_scom_switch_freq; + g5_query_freq = g5_scom_query_freq; + freq_method = "SCOM"; + volt_method = "SMU"; /* Force apply current frequency to make sure everything is in * sync (voltage is right for example). Firmware may leave us with * a strange setting ... */ - g5_switch_freq(g5_pmode_cur); + g5_pmode_cur = -1; + g5_switch_freq(g5_query_freq()); printk(KERN_INFO "Registering G5 CPU frequency driver\n"); + printk(KERN_INFO "Frequency method: %s, Voltage method: %s\n", + freq_method, volt_method); printk(KERN_INFO "Low: %d Mhz, High: %d Mhz, Cur: %d MHz\n", g5_cpu_freqs[1].frequency/1000, g5_cpu_freqs[0].frequency/1000, @@ -317,6 +434,199 @@ return rc; } +static int __init g5_pm72_cpufreq_init(struct device_node *cpus) +{ + struct device_node *cpuid = NULL, *hwclock = NULL, *cpunode = NULL; + u8 *eeprom = NULL; + u32 *valp; + u64 max_freq, min_freq, ih, il; + int has_volt = 1, rc = 0; + + /* Get first CPU node */ + for (cpunode = NULL; + (cpunode = of_get_next_child(cpus, cpunode)) != NULL;) { + if (!strcmp(cpunode->type, "cpu")) + break; + } + if (cpunode == NULL) { + printk(KERN_ERR "cpufreq: Can't find any CPU node\n"); + return -ENODEV; + } + + /* Lookup the cpuid eeprom node */ + cpuid = of_find_node_by_path("/u3 at 0,f8000000/i2c at f8001000/cpuid at a0"); + if (cpuid != NULL) + eeprom = (u8 *)get_property(cpuid, "cpuid", NULL); + if (eeprom == NULL) { + printk(KERN_ERR "cpufreq: Can't find cpuid EEPROM !\n"); + rc = -ENODEV; + goto bail; + } + + /* Lookup the i2c hwclock */ + for (hwclock = NULL; + (hwclock = of_find_node_by_name(hwclock, "i2c-hwclock")) != NULL;){ + char *loc = get_property(hwclock, "hwctrl-location", NULL); + if (loc == NULL) + continue; + if (strcmp(loc, "CPU CLOCK")) + continue; + if (!get_property(hwclock, "platform-get-frequency", NULL)) + continue; + break; + } + if (hwclock == NULL) { + printk(KERN_ERR "cpufreq: Can't find i2c clock chip !\n"); + rc = -ENODEV; + goto bail; + } + + DBG("cpufreq: i2c clock chip found: %s\n", hwclock->full_name); + + /* Now get all the platform functions */ + pfunc_cpu_getfreq = + pmf_find_function(hwclock, "get-frequency"); + pfunc_cpu_setfreq_high = + pmf_find_function(hwclock, "set-frequency-high"); + pfunc_cpu_setfreq_low = + pmf_find_function(hwclock, "set-frequency-low"); + pfunc_slewing_done = + pmf_find_function(hwclock, "slewing-done"); + pfunc_cpu0_volt_high = + pmf_find_function(hwclock, "set-voltage-high-0"); + pfunc_cpu0_volt_low = + pmf_find_function(hwclock, "set-voltage-low-0"); + pfunc_cpu1_volt_high = + pmf_find_function(hwclock, "set-voltage-high-1"); + pfunc_cpu1_volt_low = + pmf_find_function(hwclock, "set-voltage-low-1"); + + /* Check we have minimum requirements */ + if (pfunc_cpu_getfreq == NULL || pfunc_cpu_setfreq_high == NULL || + pfunc_cpu_setfreq_low == NULL || pfunc_slewing_done == NULL) { + printk(KERN_ERR "cpufreq: Can't find platform functions !\n"); + rc = -ENODEV; + goto bail; + } + + /* Check that we have complete sets */ + if (pfunc_cpu0_volt_high == NULL || pfunc_cpu0_volt_low == NULL) { + pmf_put_function(pfunc_cpu0_volt_high); + pmf_put_function(pfunc_cpu0_volt_low); + pfunc_cpu0_volt_high = pfunc_cpu0_volt_low = NULL; + has_volt = 0; + } + if (!has_volt || + pfunc_cpu1_volt_high == NULL || pfunc_cpu1_volt_low == NULL) { + pmf_put_function(pfunc_cpu1_volt_high); + pmf_put_function(pfunc_cpu1_volt_low); + pfunc_cpu1_volt_high = pfunc_cpu1_volt_low = NULL; + } + + /* Note: The device tree also contains a "platform-set-values" + * function for which I haven't quite figured out the usage. It + * might have to be called on init and/or wakeup, I'm not too sure + * but things seem to work fine without it so far ... + */ + + /* Get max frequency from device-tree */ + valp = (u32 *)get_property(cpunode, "clock-frequency", NULL); + if (!valp) { + printk(KERN_ERR "cpufreq: Can't find CPU frequency !\n"); + rc = -ENODEV; + goto bail; + } + + max_freq = (*valp)/1000; + + /* Now calculate reduced frequency by using the cpuid input freq + * ratio. This requires 64 bits math unless we are willing to lose + * some precision + */ + + ih = *((u32 *)(eeprom + 0x10)); + il = *((u32 *)(eeprom + 0x20)); + min_freq = 0; + if (ih != 0 && il != 0) + min_freq = (max_freq * il) / ih; + + /* Sanity check */ + if (min_freq >= max_freq || min_freq < 1000) { + printk(KERN_ERR "cpufreq: Can't calculate low frequency !\n"); + rc = -ENODEV; + goto bail; + } + g5_cpu_freqs[0].frequency = max_freq; + g5_cpu_freqs[1].frequency = min_freq; + + /* Set callbacks */ + g5_switch_volt = g5_pfunc_switch_volt; + g5_switch_freq = g5_pfunc_switch_freq; + g5_query_freq = g5_pfunc_query_freq; + + /* Force apply current frequency to make sure everything is in + * sync (voltage is right for example). Firmware may leave us with + * a strange setting ... + */ + g5_pmode_cur = -1; + g5_switch_freq(g5_query_freq()); + + printk(KERN_INFO "Registering G5 CPU frequency driver\n"); + printk(KERN_INFO "Frequency method: i2c/pfunc, " + "Voltage method: %s\n", has_volt ? "i2c/pfunc" : "none"); + printk(KERN_INFO "Low: %d Mhz, High: %d Mhz, Cur: %d MHz\n", + g5_cpu_freqs[1].frequency/1000, + g5_cpu_freqs[0].frequency/1000, + g5_cpu_freqs[g5_pmode_cur].frequency/1000); + + rc = cpufreq_register_driver(&g5_cpufreq_driver); + bail: + if (rc != 0) { + pmf_put_function(pfunc_cpu_getfreq); + pmf_put_function(pfunc_cpu_setfreq_high); + pmf_put_function(pfunc_cpu_setfreq_low); + pmf_put_function(pfunc_slewing_done); + pmf_put_function(pfunc_cpu0_volt_high); + pmf_put_function(pfunc_cpu0_volt_low); + pmf_put_function(pfunc_cpu1_volt_high); + pmf_put_function(pfunc_cpu1_volt_low); + } + of_node_put(hwclock); + of_node_put(cpuid); + of_node_put(cpunode); + + return rc; +} + +static int __init g5_rm31_cpufreq_init(struct device_node *cpus) +{ + /* NYI */ + return 0; +} + +static int __init g5_cpufreq_init(void) +{ + struct device_node *cpus; + int rc; + + cpus = of_find_node_by_path("/cpus"); + if (cpus == NULL) { + DBG("No /cpus node !\n"); + return -ENODEV; + } + + if (machine_is_compatible("PowerMac7,2") || + machine_is_compatible("PowerMac7,3")) + rc = g5_pm72_cpufreq_init(cpus); + else if (machine_is_compatible("RackMac3,1")) + rc = g5_rm31_cpufreq_init(cpus); + else + rc = g5_neo2_cpufreq_init(cpus); + + of_node_put(cpus); + return rc; +} + module_init(g5_cpufreq_init); From benh at kernel.crashing.org Thu Jan 5 18:03:14 2006 From: benh at kernel.crashing.org (Benjamin Herrenschmidt) Date: Thu, 05 Jan 2006 18:03:14 +1100 Subject: [PATCH] powerpc: Add cpufreq for various G5 machines (#2) Message-ID: <1136444594.4840.69.camel@localhost.localdomain> This patch uses the platform function patch posted earlier to implement cpu frequency switching on various G5 models. For now, this should work with all PowerMac7,2 and 7,3 (in addition to the code that was already there for iMac G5 and PowerMac9,1), that is desktop modeles with an AGP slot and the desktop PCI Express ones (like the Quad G5). At this point, the only models still not supported are the iMac G5 iSight (PowerMac12,1) and the Xserve G5 (RackMac3,1) I tested it on the dual 2.5 Ghz here (pulsar clock chip) and the Quad g5 but I haven't had a chance to test it on other models using other frequencies or other clock chips. It's also not hooked to the thermal control code at all yet, this will happen once I port therm_pm72 to the windfarm architecture. I didn't found a nice & clear way to "know" what the low frequency value is on the PowerMac7,2 and 7,3 models. (I only know how to tell the clock chip to slew to "low speed", not what "low speed" really is). I think I found a way to figure it out, but it might not work on all models, thus you might end up with a slightly incorrect value when running low speed in /proc/cpuinfo, though that should have no other effect since the kernel doesn't rely on the CPU core frequency for it's timekeeping. If you want to verify, you can use the little hack at http://gate.crashing.org/~benh/cpufreq_g5.c which attempts to "measure" the cpu frequency (970 only). Signed-off-by: Benjamin Herrenschmidt Index: linux-work/arch/powerpc/platforms/powermac/cpufreq_64.c =================================================================== --- linux-work.orig/arch/powerpc/platforms/powermac/cpufreq_64.c 2006-01-05 15:11:16.000000000 +1100 +++ linux-work/arch/powerpc/platforms/powermac/cpufreq_64.c 2006-01-05 17:49:33.000000000 +1100 @@ -28,6 +28,7 @@ #include #include #include +#include #undef DEBUG @@ -85,6 +86,10 @@ static int g5_pmode_max; static int g5_pmode_cur; +static void (*g5_switch_volt)(int speed_mode); +static int (*g5_switch_freq)(int speed_mode); +static int (*g5_query_freq)(void); + static DECLARE_MUTEX(g5_switch_mutex); @@ -92,9 +97,11 @@ static int g5_fvt_count; /* number of op. points */ static int g5_fvt_cur; /* current op. point */ -/* ----------------- real hardware interface */ +/* + * SMU based voltage switching for Neo2 platforms + */ -static void g5_switch_volt(int speed_mode) +static void g5_smu_switch_volt(int speed_mode) { struct smu_simple_cmd cmd; @@ -105,26 +112,57 @@ wait_for_completion(&comp); } -static int g5_switch_freq(int speed_mode) -{ - struct cpufreq_freqs freqs; - int to; +/* + * Platform function based voltage/vdnap switching for Neo2 + */ - if (g5_pmode_cur == speed_mode) - return 0; +static struct pmf_function *pfunc_set_vdnap0; +static struct pmf_function *pfunc_vdnap0_complete; - down(&g5_switch_mutex); +static void g5_vdnap_switch_volt(int speed_mode) +{ + struct pmf_args args; + u32 slew, done = 0; + unsigned long timeout; + + slew = (speed_mode == CPUFREQ_LOW) ? 1 : 0; + args.count = 1; + args.u[0].p = &slew; + + pmf_call_one(pfunc_set_vdnap0, &args); + + /* It's an irq GPIO so we should be able to just block here, + * I'll do that later after I've properly tested the IRQ code for + * platform functions + */ + timeout = jiffies + HZ/10; + while(!time_after(jiffies, timeout)) { + args.count = 1; + args.u[0].p = &done; + pmf_call_one(pfunc_vdnap0_complete, &args); + if (done) + break; + msleep(1); + } + if (done == 0) + printk(KERN_WARNING "cpufreq: Timeout in clock slewing !\n"); +} - freqs.old = g5_cpu_freqs[g5_pmode_cur].frequency; - freqs.new = g5_cpu_freqs[speed_mode].frequency; - freqs.cpu = 0; - cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE); +/* + * SCOM based frequency switching for 970FX rev3 + */ +static int g5_scom_switch_freq(int speed_mode) +{ + unsigned long flags; + int to; /* If frequency is going up, first ramp up the voltage */ if (speed_mode < g5_pmode_cur) g5_switch_volt(speed_mode); + local_irq_save(flags); + /* Clear PCR high */ scom970_write(SCOM_PCR, 0); /* Clear PCR low */ @@ -147,6 +185,8 @@ udelay(100); } + local_irq_restore(flags); + /* If frequency is going down, last ramp the voltage */ if (speed_mode > g5_pmode_cur) g5_switch_volt(speed_mode); @@ -154,14 +194,10 @@ g5_pmode_cur = speed_mode; ppc_proc_freq = g5_cpu_freqs[speed_mode].frequency * 1000ul; - cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE); - - up(&g5_switch_mutex); - return 0; } -static int g5_query_freq(void) +static int g5_scom_query_freq(void) { unsigned long psr = scom970_read(SCOM_PSR); int i; @@ -173,7 +209,104 @@ return i; } -/* ----------------- cpufreq bookkeeping */ +/* + * Platform function based voltage switching for PowerMac7,2 & 7,3 + */ + +static struct pmf_function *pfunc_cpu0_volt_high; +static struct pmf_function *pfunc_cpu0_volt_low; +static struct pmf_function *pfunc_cpu1_volt_high; +static struct pmf_function *pfunc_cpu1_volt_low; + +static void g5_pfunc_switch_volt(int speed_mode) +{ + if (speed_mode == CPUFREQ_HIGH) { + if (pfunc_cpu0_volt_high) + pmf_call_one(pfunc_cpu0_volt_high, NULL); + if (pfunc_cpu1_volt_high) + pmf_call_one(pfunc_cpu1_volt_high, NULL); + } else { + if (pfunc_cpu0_volt_low) + pmf_call_one(pfunc_cpu0_volt_low, NULL); + if (pfunc_cpu1_volt_low) + pmf_call_one(pfunc_cpu1_volt_low, NULL); + } + msleep(10); /* should be faster , to fix */ +} + +/* + * Platform function based frequency switching for PowerMac7,2 & 7,3 + */ + +static struct pmf_function *pfunc_cpu_setfreq_high; +static struct pmf_function *pfunc_cpu_setfreq_low; +static struct pmf_function *pfunc_cpu_getfreq; +static struct pmf_function *pfunc_slewing_done;; + +static int g5_pfunc_switch_freq(int speed_mode) +{ + struct pmf_args args; + u32 done = 0; + unsigned long timeout; + + /* If frequency is going up, first ramp up the voltage */ + if (speed_mode < g5_pmode_cur) + g5_switch_volt(speed_mode); + + /* Do it */ + if (speed_mode == CPUFREQ_HIGH) + pmf_call_one(pfunc_cpu_setfreq_high, NULL); + else + pmf_call_one(pfunc_cpu_setfreq_low, NULL); + + /* It's an irq GPIO so we should be able to just block here, + * I'll do that later after I've properly tested the IRQ code for + * platform functions + */ + timeout = jiffies + HZ/10; + while(!time_after(jiffies, timeout)) { + args.count = 1; + args.u[0].p = &done; + pmf_call_one(pfunc_slewing_done, &args); + if (done) + break; + msleep(1); + } + if (done == 0) + printk(KERN_WARNING "cpufreq: Timeout in clock slewing !\n"); + + /* If frequency is going down, last ramp the voltage */ + if (speed_mode > g5_pmode_cur) + g5_switch_volt(speed_mode); + + g5_pmode_cur = speed_mode; + ppc_proc_freq = g5_cpu_freqs[speed_mode].frequency * 1000ul; + + return 0; +} + +static int g5_pfunc_query_freq(void) +{ + struct pmf_args args; + u32 val = 0; + + args.count = 1; + args.u[0].p = &val; + pmf_call_one(pfunc_cpu_getfreq, &args); + return val ? CPUFREQ_HIGH : CPUFREQ_LOW; +} + +/* + * Fake voltage switching for platforms with missing support + */ + +static void g5_dummy_switch_volt(int speed_mode) +{ +} + +/* + * Common interface to the cpufreq core + */ static int g5_cpufreq_verify(struct cpufreq_policy *policy) { @@ -183,13 +316,30 @@ static int g5_cpufreq_target(struct cpufreq_policy *policy, unsigned int target_freq, unsigned int relation) { - unsigned int newstate = 0; + unsigned int newstate = 0; + struct cpufreq_freqs freqs; + int rc; if (cpufreq_frequency_table_target(policy, g5_cpu_freqs, target_freq, relation, &newstate)) return -EINVAL; - return g5_switch_freq(newstate); + if (g5_pmode_cur == newstate) + return 0; + + down(&g5_switch_mutex); + + freqs.old = g5_cpu_freqs[g5_pmode_cur].frequency; + freqs.new = g5_cpu_freqs[newstate].frequency; + freqs.cpu = 0; + + cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE); + rc = g5_switch_freq(newstate); + cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE); + + up(&g5_switch_mutex); + + return rc; } static unsigned int g5_cpufreq_get_speed(unsigned int cpu) @@ -205,6 +355,7 @@ policy->governor = CPUFREQ_DEFAULT_GOVERNOR; policy->cpuinfo.transition_latency = CPUFREQ_ETERNAL; policy->cur = g5_cpu_freqs[g5_query_freq()].frequency; + policy->cpus = cpu_possible_map; cpufreq_frequency_table_get_attr(g5_cpu_freqs, policy->cpu); return cpufreq_frequency_table_cpuinfo(policy, @@ -224,19 +375,39 @@ }; -static int __init g5_cpufreq_init(void) +static int __init g5_neo2_cpufreq_init(struct device_node *cpus) { struct device_node *cpunode; unsigned int psize, ssize; - struct smu_sdbp_header *shdr; unsigned long max_freq; - u32 *valp; + char *freq_method, *volt_method; + u32 *valp, pvr_hi; + int use_volts_vdnap = 0; + int use_volts_smu = 0; int rc = -ENODEV; - /* Look for CPU and SMU nodes */ - cpunode = of_find_node_by_type(NULL, "cpu"); - if (!cpunode) { - DBG("No CPU node !\n"); + /* Check supported platforms */ + if (machine_is_compatible("PowerMac8,1") || + machine_is_compatible("PowerMac8,2") || + machine_is_compatible("PowerMac9,1")) + use_volts_smu = 1; + else if (machine_is_compatible("PowerMac11,2")) + use_volts_vdnap = 1; + else + return -ENODEV; + + /* Get first CPU node */ + for (cpunode = NULL; + (cpunode = of_get_next_child(cpus, cpunode)) != NULL;) { + u32 *reg = + (u32 *)get_property(cpunode, "reg", NULL); + if (reg == NULL || (*reg) != 0) + continue; + if (!strcmp(cpunode->type, "cpu")) + break; + } + if (cpunode == NULL) { + printk(KERN_ERR "cpufreq: Can't find any CPU 0 node\n"); return -ENODEV; } @@ -246,8 +417,9 @@ DBG("No cpu-version property !\n"); goto bail_noprops; } - if (((*valp) >> 16) != 0x3c) { - DBG("Wrong CPU version: %08x\n", *valp); + pvr_hi = (*valp) >> 16; + if (pvr_hi != 0x3c && pvr_hi != 0x44) { + printk(KERN_ERR "cpufreq: Unsupported CPU version\n"); goto bail_noprops; } @@ -259,18 +431,50 @@ } g5_pmode_max = psize / sizeof(u32) - 1; - /* Look for the FVT table */ - shdr = smu_get_sdb_partition(SMU_SDB_FVT_ID, NULL); - if (!shdr) - goto bail_noprops; - g5_fvt_table = (struct smu_sdbp_fvt *)&shdr[1]; - ssize = (shdr->len * sizeof(u32)) - sizeof(struct smu_sdbp_header); - g5_fvt_count = ssize / sizeof(struct smu_sdbp_fvt); - g5_fvt_cur = 0; + if (use_volts_smu) { + struct smu_sdbp_header *shdr; - /* Sanity checking */ - if (g5_fvt_count < 1 || g5_pmode_max < 1) - goto bail_noprops; + /* Look for the FVT table */ + shdr = smu_get_sdb_partition(SMU_SDB_FVT_ID, NULL); + if (!shdr) + goto bail_noprops; + g5_fvt_table = (struct smu_sdbp_fvt *)&shdr[1]; + ssize = (shdr->len * sizeof(u32)) - + sizeof(struct smu_sdbp_header); + g5_fvt_count = ssize / sizeof(struct smu_sdbp_fvt); + g5_fvt_cur = 0; + + /* Sanity checking */ + if (g5_fvt_count < 1 || g5_pmode_max < 1) + goto bail_noprops; + + g5_switch_volt = g5_smu_switch_volt; + volt_method = "SMU"; + } else if (use_volts_vdnap) { + struct device_node *root; + + root = of_find_node_by_path("/"); + if (root == NULL) { + printk(KERN_ERR "cpufreq: Can't find root of " + "device tree\n"); + goto bail_noprops; + } + pfunc_set_vdnap0 = pmf_find_function(root, "set-vdnap0"); + pfunc_vdnap0_complete = + pmf_find_function(root, "slewing-done"); + if (pfunc_set_vdnap0 == NULL || + pfunc_vdnap0_complete == NULL) { + printk(KERN_ERR "cpufreq: Can't find required " + "platform function\n"); + goto bail_noprops; + } + + g5_switch_volt = g5_vdnap_switch_volt; + volt_method = "GPIO"; + } else { + g5_switch_volt = g5_dummy_switch_volt; + volt_method = "none"; + } /* * From what I see, clock-frequency is always the maximal frequency. @@ -286,19 +490,23 @@ g5_cpu_freqs[0].frequency = max_freq; g5_cpu_freqs[1].frequency = max_freq/2; - /* Check current frequency */ - g5_pmode_cur = g5_query_freq(); - if (g5_pmode_cur > 1) - /* We don't support anything but 1:1 and 1:2, fixup ... */ - g5_pmode_cur = 1; + /* Set callbacks */ + g5_switch_freq = g5_scom_switch_freq; + g5_query_freq = g5_scom_query_freq; + freq_method = "SCOM"; /* Force apply current frequency to make sure everything is in * sync (voltage is right for example). Firmware may leave us with * a strange setting ... */ - g5_switch_freq(g5_pmode_cur); + g5_switch_volt(CPUFREQ_HIGH); + msleep(10); + g5_pmode_cur = -1; + g5_switch_freq(g5_query_freq()); printk(KERN_INFO "Registering G5 CPU frequency driver\n"); + printk(KERN_INFO "Frequency method: %s, Voltage method: %s\n", + freq_method, volt_method); printk(KERN_INFO "Low: %d Mhz, High: %d Mhz, Cur: %d MHz\n", g5_cpu_freqs[1].frequency/1000, g5_cpu_freqs[0].frequency/1000, @@ -317,6 +525,201 @@ return rc; } +static int __init g5_pm72_cpufreq_init(struct device_node *cpus) +{ + struct device_node *cpuid = NULL, *hwclock = NULL, *cpunode = NULL; + u8 *eeprom = NULL; + u32 *valp; + u64 max_freq, min_freq, ih, il; + int has_volt = 1, rc = 0; + + /* Get first CPU node */ + for (cpunode = NULL; + (cpunode = of_get_next_child(cpus, cpunode)) != NULL;) { + if (!strcmp(cpunode->type, "cpu")) + break; + } + if (cpunode == NULL) { + printk(KERN_ERR "cpufreq: Can't find any CPU node\n"); + return -ENODEV; + } + + /* Lookup the cpuid eeprom node */ + cpuid = of_find_node_by_path("/u3 at 0,f8000000/i2c at f8001000/cpuid at a0"); + if (cpuid != NULL) + eeprom = (u8 *)get_property(cpuid, "cpuid", NULL); + if (eeprom == NULL) { + printk(KERN_ERR "cpufreq: Can't find cpuid EEPROM !\n"); + rc = -ENODEV; + goto bail; + } + + /* Lookup the i2c hwclock */ + for (hwclock = NULL; + (hwclock = of_find_node_by_name(hwclock, "i2c-hwclock")) != NULL;){ + char *loc = get_property(hwclock, "hwctrl-location", NULL); + if (loc == NULL) + continue; + if (strcmp(loc, "CPU CLOCK")) + continue; + if (!get_property(hwclock, "platform-get-frequency", NULL)) + continue; + break; + } + if (hwclock == NULL) { + printk(KERN_ERR "cpufreq: Can't find i2c clock chip !\n"); + rc = -ENODEV; + goto bail; + } + + DBG("cpufreq: i2c clock chip found: %s\n", hwclock->full_name); + + /* Now get all the platform functions */ + pfunc_cpu_getfreq = + pmf_find_function(hwclock, "get-frequency"); + pfunc_cpu_setfreq_high = + pmf_find_function(hwclock, "set-frequency-high"); + pfunc_cpu_setfreq_low = + pmf_find_function(hwclock, "set-frequency-low"); + pfunc_slewing_done = + pmf_find_function(hwclock, "slewing-done"); + pfunc_cpu0_volt_high = + pmf_find_function(hwclock, "set-voltage-high-0"); + pfunc_cpu0_volt_low = + pmf_find_function(hwclock, "set-voltage-low-0"); + pfunc_cpu1_volt_high = + pmf_find_function(hwclock, "set-voltage-high-1"); + pfunc_cpu1_volt_low = + pmf_find_function(hwclock, "set-voltage-low-1"); + + /* Check we have minimum requirements */ + if (pfunc_cpu_getfreq == NULL || pfunc_cpu_setfreq_high == NULL || + pfunc_cpu_setfreq_low == NULL || pfunc_slewing_done == NULL) { + printk(KERN_ERR "cpufreq: Can't find platform functions !\n"); + rc = -ENODEV; + goto bail; + } + + /* Check that we have complete sets */ + if (pfunc_cpu0_volt_high == NULL || pfunc_cpu0_volt_low == NULL) { + pmf_put_function(pfunc_cpu0_volt_high); + pmf_put_function(pfunc_cpu0_volt_low); + pfunc_cpu0_volt_high = pfunc_cpu0_volt_low = NULL; + has_volt = 0; + } + if (!has_volt || + pfunc_cpu1_volt_high == NULL || pfunc_cpu1_volt_low == NULL) { + pmf_put_function(pfunc_cpu1_volt_high); + pmf_put_function(pfunc_cpu1_volt_low); + pfunc_cpu1_volt_high = pfunc_cpu1_volt_low = NULL; + } + + /* Note: The device tree also contains a "platform-set-values" + * function for which I haven't quite figured out the usage. It + * might have to be called on init and/or wakeup, I'm not too sure + * but things seem to work fine without it so far ... + */ + + /* Get max frequency from device-tree */ + valp = (u32 *)get_property(cpunode, "clock-frequency", NULL); + if (!valp) { + printk(KERN_ERR "cpufreq: Can't find CPU frequency !\n"); + rc = -ENODEV; + goto bail; + } + + max_freq = (*valp)/1000; + + /* Now calculate reduced frequency by using the cpuid input freq + * ratio. This requires 64 bits math unless we are willing to lose + * some precision + */ + + ih = *((u32 *)(eeprom + 0x10)); + il = *((u32 *)(eeprom + 0x20)); + min_freq = 0; + if (ih != 0 && il != 0) + min_freq = (max_freq * il) / ih; + + /* Sanity check */ + if (min_freq >= max_freq || min_freq < 1000) { + printk(KERN_ERR "cpufreq: Can't calculate low frequency !\n"); + rc = -ENODEV; + goto bail; + } + g5_cpu_freqs[0].frequency = max_freq; + g5_cpu_freqs[1].frequency = min_freq; + + /* Set callbacks */ + g5_switch_volt = g5_pfunc_switch_volt; + g5_switch_freq = g5_pfunc_switch_freq; + g5_query_freq = g5_pfunc_query_freq; + + /* Force apply current frequency to make sure everything is in + * sync (voltage is right for example). Firmware may leave us with + * a strange setting ... + */ + g5_switch_volt(CPUFREQ_HIGH); + msleep(10); + g5_pmode_cur = -1; + g5_switch_freq(g5_query_freq()); + + printk(KERN_INFO "Registering G5 CPU frequency driver\n"); + printk(KERN_INFO "Frequency method: i2c/pfunc, " + "Voltage method: %s\n", has_volt ? "i2c/pfunc" : "none"); + printk(KERN_INFO "Low: %d Mhz, High: %d Mhz, Cur: %d MHz\n", + g5_cpu_freqs[1].frequency/1000, + g5_cpu_freqs[0].frequency/1000, + g5_cpu_freqs[g5_pmode_cur].frequency/1000); + + rc = cpufreq_register_driver(&g5_cpufreq_driver); + bail: + if (rc != 0) { + pmf_put_function(pfunc_cpu_getfreq); + pmf_put_function(pfunc_cpu_setfreq_high); + pmf_put_function(pfunc_cpu_setfreq_low); + pmf_put_function(pfunc_slewing_done); + pmf_put_function(pfunc_cpu0_volt_high); + pmf_put_function(pfunc_cpu0_volt_low); + pmf_put_function(pfunc_cpu1_volt_high); + pmf_put_function(pfunc_cpu1_volt_low); + } + of_node_put(hwclock); + of_node_put(cpuid); + of_node_put(cpunode); + + return rc; +} + +static int __init g5_rm31_cpufreq_init(struct device_node *cpus) +{ + /* NYI */ + return 0; +} + +static int __init g5_cpufreq_init(void) +{ + struct device_node *cpus; + int rc; + + cpus = of_find_node_by_path("/cpus"); + if (cpus == NULL) { + DBG("No /cpus node !\n"); + return -ENODEV; + } + + if (machine_is_compatible("PowerMac7,2") || + machine_is_compatible("PowerMac7,3")) + rc = g5_pm72_cpufreq_init(cpus); + else if (machine_is_compatible("RackMac3,1")) + rc = g5_rm31_cpufreq_init(cpus); + else + rc = g5_neo2_cpufreq_init(cpus); + + of_node_put(cpus); + return rc; +} + module_init(g5_cpufreq_init); From msdemlei at cl.uni-heidelberg.de Thu Jan 5 22:47:51 2006 From: msdemlei at cl.uni-heidelberg.de (Markus Demleitner) Date: Thu, 5 Jan 2006 12:47:51 +0100 Subject: Phantom pain with windfarm on diskless iMac G5 In-Reply-To: <1136418090.4840.21.camel@localhost.localdomain> References: <20060104142006.GA8782@victor.cl.uni-heidelberg.de> <1136418090.4840.21.camel@localhost.localdomain> Message-ID: <20060105114751.GB8959@victor.cl.uni-heidelberg.de> On Thu, Jan 05, 2006 at 10:41:29AM +1100, Benjamin Herrenschmidt wrote: > On Wed, 2006-01-04 at 15:20 +0100, Markus Demleitner wrote: > > Hi, > > > > I tried 2.6.15 on my diskless iMac G5 clients today, resulting in > > 747 emulation mode (vrooom...!). It turns out windfarm was > > querying the hard disk temperature sensor, which usually is mounted > > on the mounting bracket Apple uses. We made the mistake of removing > > these (from about 30 machines:-(), which in turn made > > some way to detect the absence of the sensor (and tell it from a > > simple failure). However, the OF device trees still list the sensor [...] > > Even if there were a way to detect the absence of the sensor, there's > > still the problem that windfarm_pm81.c insists on having a hd temp > > sensor to work, so a fix would probably require spoiling that > > wonderful [...] > > In short: Am I doomed to hack the kernels of my diskless clients to > > eternity (or retrofit the sensors)? Or is there a sane way to treat > > that kind of problem? > > Hrm... That isn't trivial as I don't see a clean way to detect that the > HD is not there from windfarm without doing gross hacks, unless we can > somewhat rely on the device-tree there... > > What we could do is: > > - Make pm81 start the control loops regardless of the presence of the > sensor, and have the control loop itself set the disk fan to an > arbitrary low value if the sensor is not there. If the sensor kicks in > "later" (because lm75 loads later), it will automatically start using > the full control loop. That is easy. If that works out, fine -- I could simply keep lm75 from loading and I'd be happy. However, I can see issues here of not detecting sensor or other failures. Worse, this isn't an issue of the disk fan (which my machines don't have anyway) alone, but also of the main fan (right now, we get an overtemp condition on top of that, with all consequences). > - In lm75 itself, in case of failure, add a little hack that tests if > the disk is present by looking in the device-tree, provided again that > there is a node for it that can be detected... If not, then return an > arbitrarily low temperature instead of a failure. I'd like that (it's basically what I'm doing now, except that I don't actually sense hd presence but just run the crippled kernels on machines without disks). Trouble is, as I said, that the dev tree doesn't reflect disk absence. Asking other parts of the kernel introduces more trouble (the ata interface may not be compiled in and in fact isn't on my client machines). > Either that or a module/kernel command line option... The later is > easier but less "neat" :) Since I have no idea how to solve the problem with the other "solutions", that's probably the best idea. What do you think of a parameter "debug_values" for windfarm_lm75_sensor.c that is either 0 (default) for returning actual sensor readings or some other value that's then returned (which might also help with debugging, and the naming of the parameter should make clear that you're not supposed to use it unless you know what you're doing)? While I'm about this: Did you resolve the issues with windfarm as modules? Thanks, Markus From schwab at suse.de Fri Jan 6 00:23:13 2006 From: schwab at suse.de (Andreas Schwab) Date: Thu, 05 Jan 2006 14:23:13 +0100 Subject: [PATCH] powerpc: Add PowerMac platform function interpreter In-Reply-To: <1136439584.4840.48.camel@localhost.localdomain> (Benjamin Herrenschmidt's message of "Thu, 05 Jan 2006 16:39:44 +1100") References: <1136439584.4840.48.camel@localhost.localdomain> Message-ID: Benjamin Herrenschmidt writes: > Anyway, here it is, comments welcome... To which tree is this relative? Neither 2.6.15 nor Linus' tree matches. Andreas. -- Andreas Schwab, SuSE Labs, schwab at suse.de SuSE Linux Products GmbH, Maxfeldstra?e 5, 90409 N?rnberg, Germany PGP key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different." From arnd at arndb.de Fri Jan 6 01:05:29 2006 From: arnd at arndb.de (Arnd Bergmann) Date: Thu, 5 Jan 2006 14:05:29 +0000 Subject: [PATCH 13/13] spufs: set irq affinity for running threads In-Reply-To: <20060105044227.GD16729@localhost.localdomain> References: <20060104193120.050539000@localhost> <20060104194502.253418000@localhost> <20060105044227.GD16729@localhost.localdomain> Message-ID: <200601051405.30015.arnd@arndb.de> For far, all SPU triggered interrupts always end up on the first SMT thread, which is a bad solution. This patch implements setting the affinity to the CPU that was running last when entering execution on an SPU. This should result in a significant reduction in IPI calls and better cache locality for SPE thread specific data. Signed-off-by: Arnd Bergmann --- On Thursday 05 January 2006 04:42, Nathan Lynch wrote: > > + spu_irq_setaffinity(spu, smp_processor_id()); > > With CONFIG_DEBUG_PREEMPT this will give a warning about using > smp_processor_id in pre-emptible context if I'm reading the code > correctly. > > Maybe use raw_smp_processor_id, since setting the affinity to this cpu > isn't a hard requirement? Good point. Please use this version instead. Arnd <>< Index: linux-2.6.15-rc/include/asm-powerpc/spu.h =================================================================== --- linux-2.6.15-rc.orig/include/asm-powerpc/spu.h +++ linux-2.6.15-rc/include/asm-powerpc/spu.h @@ -147,6 +147,7 @@ struct spu *spu_alloc(void); void spu_free(struct spu *spu); int spu_irq_class_0_bottom(struct spu *spu); int spu_irq_class_1_bottom(struct spu *spu); +void spu_irq_setaffinity(struct spu *spu, int cpu); extern struct spufs_calls { asmlinkage long (*create_thread)(const char __user *name, Index: linux-2.6.15-rc/arch/powerpc/platforms/cell/interrupt.c =================================================================== --- linux-2.6.15-rc.orig/arch/powerpc/platforms/cell/interrupt.c +++ linux-2.6.15-rc/arch/powerpc/platforms/cell/interrupt.c @@ -23,6 +23,7 @@ #include #include #include +#include #include #include @@ -55,6 +56,7 @@ struct iic_regs { struct iic { struct iic_regs __iomem *regs; + u8 target_id; }; static DEFINE_PER_CPU(struct iic, iic); @@ -172,12 +174,11 @@ int iic_get_irq(struct pt_regs *regs) return irq; } -static struct iic_regs __iomem *find_iic(int cpu) +static int setup_iic(int cpu, struct iic *iic) { struct device_node *np; int nodeid = cpu / 2; unsigned long regs; - struct iic_regs __iomem *iic_regs; for (np = of_find_node_by_type(NULL, "cpu"); np; @@ -188,20 +189,23 @@ static struct iic_regs __iomem *find_iic if (!np) { printk(KERN_WARNING "IIC: CPU %d not found\n", cpu); - iic_regs = NULL; - } else { - regs = *(long *)get_property(np, "iic", NULL); - - /* hack until we have decided on the devtree info */ - regs += 0x400; - if (cpu & 1) - regs += 0x20; - - printk(KERN_DEBUG "IIC for CPU %d at %lx\n", cpu, regs); - iic_regs = __ioremap(regs, sizeof(struct iic_regs), - _PAGE_NO_CACHE); + iic->regs = NULL; + iic->target_id = 0xff; + return -ENODEV; } - return iic_regs; + + regs = *(long *)get_property(np, "iic", NULL); + + /* hack until we have decided on the devtree info */ + regs += 0x400; + if (cpu & 1) + regs += 0x20; + + printk(KERN_DEBUG "IIC for CPU %d at %lx\n", cpu, regs); + iic->regs = __ioremap(regs, sizeof(struct iic_regs), + _PAGE_NO_CACHE); + iic->target_id = (nodeid << 4) + ((cpu & 1) ? 0xf : 0xe); + return 0; } #ifdef CONFIG_SMP @@ -227,6 +231,12 @@ void iic_cause_IPI(int cpu, int mesg) out_be64(&per_cpu(iic, cpu).regs->generate, (IIC_NUM_IPIS - 1 - mesg) << 4); } +u8 iic_get_target_id(int cpu) +{ + return per_cpu(iic, cpu).target_id; +} +EXPORT_SYMBOL_GPL(iic_get_target_id); + static irqreturn_t iic_ipi_action(int irq, void *dev_id, struct pt_regs *regs) { smp_message_recv(iic_irq_to_ipi(irq), regs); @@ -276,7 +286,7 @@ void iic_init_IRQ(void) irq_offset = 0; for_each_cpu(cpu) { iic = &per_cpu(iic, cpu); - iic->regs = find_iic(cpu); + setup_iic(cpu, iic); if (iic->regs) out_be64(&iic->regs->prio, 0xff); } Index: linux-2.6.15-rc/arch/powerpc/platforms/cell/interrupt.h =================================================================== --- linux-2.6.15-rc.orig/arch/powerpc/platforms/cell/interrupt.h +++ linux-2.6.15-rc/arch/powerpc/platforms/cell/interrupt.h @@ -54,6 +54,7 @@ extern void iic_setup_cpu(void); extern void iic_local_enable(void); extern void iic_local_disable(void); +extern u8 iic_get_target_id(int cpu); extern void spider_init_IRQ(void); extern int spider_get_irq(unsigned long int_pending); Index: linux-2.6.15-rc/arch/powerpc/platforms/cell/spu_base.c =================================================================== --- linux-2.6.15-rc.orig/arch/powerpc/platforms/cell/spu_base.c +++ linux-2.6.15-rc/arch/powerpc/platforms/cell/spu_base.c @@ -507,6 +507,14 @@ int spu_irq_class_1_bottom(struct spu *s return ret; } +void spu_irq_setaffinity(struct spu *spu, int cpu) +{ + u64 target = iic_get_target_id(cpu); + u64 route = target << 48 | target << 32 | target << 16; + spu_int_route_set(spu, route); +} +EXPORT_SYMBOL_GPL(spu_irq_setaffinity); + static void __iomem * __init map_spe_prop(struct device_node *n, const char *name) { Index: linux-2.6.15-rc/arch/powerpc/platforms/cell/spufs/sched.c =================================================================== --- linux-2.6.15-rc.orig/arch/powerpc/platforms/cell/spufs/sched.c +++ linux-2.6.15-rc/arch/powerpc/platforms/cell/spufs/sched.c @@ -357,6 +357,11 @@ int spu_activate(struct spu_context *ctx if (!spu) return (signal_pending(current)) ? -ERESTARTSYS : -EAGAIN; bind_context(spu, ctx); + /* + * We're likely to wait for interrupts on the same + * CPU that we are now on, so send them here. + */ + spu_irq_setaffinity(spu, raw_smp_processor_id()); put_active_spu(spu); return 0; } From benh at kernel.crashing.org Fri Jan 6 09:19:54 2006 From: benh at kernel.crashing.org (Benjamin Herrenschmidt) Date: Fri, 06 Jan 2006 09:19:54 +1100 Subject: [PATCH] powerpc: Add PowerMac platform function interpreter In-Reply-To: References: <1136439584.4840.48.camel@localhost.localdomain> Message-ID: <1136499595.4840.86.camel@localhost.localdomain> On Thu, 2006-01-05 at 14:23 +0100, Andreas Schwab wrote: > Benjamin Herrenschmidt writes: > > > Anyway, here it is, comments welcome... > > To which tree is this relative? Neither 2.6.15 nor Linus' tree matches. powerpc.git Ben. From torvalds at osdl.org Fri Jan 6 10:26:24 2006 From: torvalds at osdl.org (Linus Torvalds) Date: Thu, 5 Jan 2006 15:26:24 -0800 (PST) Subject: [patch 00/21] mutex subsystem, -V14 In-Reply-To: <43BDA672.4090704@austin.ibm.com> References: <20060104144151.GA27646@elte.hu> <43BC5E15.207@austin.ibm.com> <20060105143502.GA16816@elte.hu> <43BD4C66.60001@austin.ibm.com> <20060105222106.GA26474@elte.hu> <43BDA672.4090704@austin.ibm.com> Message-ID: On Thu, 5 Jan 2006, Joel Schopp wrote: > > Here is a first pass at a powerpc file for the fast paths just as an FYI/RFC. > It is completely untested, but compiles. Shouldn't you make that "isync" dependent on SMP too? UP doesn't need it, since DMA will never matter, and interrupts are precise. Linus From jschopp at austin.ibm.com Fri Jan 6 10:36:42 2006 From: jschopp at austin.ibm.com (Joel Schopp) Date: Thu, 05 Jan 2006 17:36:42 -0600 Subject: [patch 00/21] mutex subsystem, -V14 In-Reply-To: References: <20060104144151.GA27646@elte.hu> <43BC5E15.207@austin.ibm.com> <20060105143502.GA16816@elte.hu> <43BD4C66.60001@austin.ibm.com> <20060105222106.GA26474@elte.hu> <43BDA672.4090704@austin.ibm.com> Message-ID: <43BDAD8A.60108@austin.ibm.com> >>Here is a first pass at a powerpc file for the fast paths just as an FYI/RFC. >>It is completely untested, but compiles. > > > Shouldn't you make that "isync" dependent on SMP too? UP doesn't need it, > since DMA will never matter, and interrupts are precise. > > Linus > I think the isync is necessary to keep heavily out of order processors from getting ahead of themselves even on UP. Scanning back through the powerpc spinlock code they seem to take the same view there as well. From benh at kernel.crashing.org Fri Jan 6 11:18:56 2006 From: benh at kernel.crashing.org (Benjamin Herrenschmidt) Date: Fri, 06 Jan 2006 11:18:56 +1100 Subject: Phantom pain with windfarm on diskless iMac G5 In-Reply-To: <20060105114751.GB8959@victor.cl.uni-heidelberg.de> References: <20060104142006.GA8782@victor.cl.uni-heidelberg.de> <1136418090.4840.21.camel@localhost.localdomain> <20060105114751.GB8959@victor.cl.uni-heidelberg.de> Message-ID: <1136506736.4840.108.camel@localhost.localdomain> On Thu, 2006-01-05 at 12:47 +0100, Markus Demleitner wrote: > If that works out, fine -- I could simply keep lm75 from loading and > I'd be happy. However, I can see issues here of not detecting sensor > or other failures. Worse, this isn't an issue of the disk fan (which > my machines don't have anyway) alone, but also of the main fan (right > now, we get an overtemp condition on top of that, with all > consequences). What overtemp condition ? You mean that you get _really_ overtemp when the disk is missing and the disk fan not blowing ? That's pretty bad... > Since I have no idea how to solve the problem with the other > "solutions", that's probably the best idea. What do you think of a > parameter "debug_values" for windfarm_lm75_sensor.c that is either 0 > (default) for returning actual sensor readings or some other value > that's then returned (which might also help with debugging, and the > naming of the parameter should make clear that you're not supposed to > use it unless you know what you're doing)? > > While I'm about this: Did you resolve the issues with windfarm as > modules? Not yet. Ben. From benh at kernel.crashing.org Fri Jan 6 11:21:26 2006 From: benh at kernel.crashing.org (Benjamin Herrenschmidt) Date: Fri, 06 Jan 2006 11:21:26 +1100 Subject: Phantom pain with windfarm on diskless iMac G5 In-Reply-To: <20060105114751.GB8959@victor.cl.uni-heidelberg.de> References: <20060104142006.GA8782@victor.cl.uni-heidelberg.de> <1136418090.4840.21.camel@localhost.localdomain> <20060105114751.GB8959@victor.cl.uni-heidelberg.de> Message-ID: <1136506887.4840.110.camel@localhost.localdomain> Can you send me a tarball of /proc/device-tree taken on one of those machines without the hard disk ? Thanks... Ben. From olof at lixom.net Fri Jan 6 11:29:19 2006 From: olof at lixom.net (Olof Johansson) Date: Thu, 5 Jan 2006 18:29:19 -0600 Subject: [patch 00/21] mutex subsystem, -V14 In-Reply-To: <43BDA672.4090704@austin.ibm.com> References: <20060104144151.GA27646@elte.hu> <43BC5E15.207@austin.ibm.com> <20060105143502.GA16816@elte.hu> <43BD4C66.60001@austin.ibm.com> <20060105222106.GA26474@elte.hu> <43BDA672.4090704@austin.ibm.com> Message-ID: <20060106002919.GA29190@pb15.lixom.net> On Thu, Jan 05, 2006 at 05:06:26PM -0600, Joel Schopp wrote: > Here is a first pass at a powerpc file for the fast paths just as an > FYI/RFC. It is completely untested, but compiles. You really should test it, it saves reviewers time. It's not that hard to at least try booting it. Besides the isync comments earlier, there's a bunch of whitespace issues going on. Did you copy and paste the code from somewhere? If so, you should move the original copyright over too. All your macros use spaces instead of tabs up to the \, should be changed. All tmp variables should be ints, since the atomic_t counter is a 32-bit variable. If you use longs, and lwarx (loads 32-bit without sign extend), the comparison with < 0 will never be true. > Index: 2.6.15-mutex14/include/asm-powerpc/mutex.h > =================================================================== > --- 2.6.15-mutex14.orig/include/asm-powerpc/mutex.h 2006-01-04 14:46:31.%N -0600 > +++ 2.6.15-mutex14/include/asm-powerpc/mutex.h 2006-01-05 16:25:41.%N -0600 > @@ -1,9 +1,83 @@ > /* > - * Pull in the generic implementation for the mutex fastpath. > + * include/asm-powerpc/mutex.h No need to keep filenames in files. > * > - * TODO: implement optimized primitives instead, or leave the generic > - * implementation in place, or pick the atomic_xchg() based generic > - * implementation. (see asm-generic/mutex-xchg.h for details) > + * PowerPC optimized mutex locking primitives > + * > + * Please look into asm-generic/mutex-xchg.h for a formal definition. > + * Copyright (C) 2006 Joel Schopp , IBM > */ > +#ifndef _ASM_MUTEX_H > +#define _ASM_MUTEX_H > +#define __mutex_fastpath_lock(count, fail_fn)\ > +do{ \ > + long tmp; \ > + __asm__ __volatile__( \ > +"1: lwarx %0,0,%1\n" \ > +" addic %0,%0,-1\n" \ > +" stwcx. %0,0,%1\n" \ > +" bne- 1b\n" \ > +" isync \n" \ > + : "=&r" (tmp) \ > + : "r" (&(count)->counter) \ > + : "cr0", "memory"); \ > + if (unlikely(tmp < 0)) \ > + fail_fn(count); \ > +} while (0) trailing whitespace > + > +#define __mutex_fastpath_unlock(count, fail_fn)\ > +do{ \ > + long tmp; \ > + __asm__ __volatile__(SYNC_ON_SMP \ > +"1: lwarx %0,0,%1\n" \ > +" addic %0,%0,1\n" \ > +" stwcx. %0,0,%1\n" \ > +" bne- 1b\n" \ space vs tab > + : "=&r" (tmp) \ > + : "r" (&(count)->counter) \ > + : "cr0", "memory"); \ > + if (unlikely(tmp <= 0)) \ > + fail_fn(count); \ > +} while (0) > + > + > +static inline int trailing whitespace > +__mutex_fastpath_trylock(atomic_t* count, int (*fail_fn)(atomic_t*)) atomic_t *count > +{ > + long tmp; > + __asm__ __volatile__( > +"1: lwarx %0,0,%1\n" > +" cmpwi 0,%0,1\n" > +" bne- 2f\n" > +" stwcx. %0,0,%1\n" space vs tab on the above 4 lines Shouldn't you decrement the counter before the store? > +" bne- 1b\n" > +" isync\n" > +"2:" > + : "=&r" (tmp) > + : "r" (&(count)->counter) > + : "cr0", "memory"); > + > + return (int)tmp; > + > +} > + > +#define __mutex_slowpath_needs_to_unlock() 1 > > -#include > +static inline int trailing whitespace > +__mutex_fastpath_lock_retval(atomic_t* count, int (*fail_fn)(atomic_t *)) atomic_t *count > +{ > + long tmp; counter is a 32-bit variable, so should tmp be otherwise the < 0 comparison can never be true. > + __asm__ __volatile__( > +"1: lwarx %0,0,%1\n" > +" addic %0,%0,-1\n" > +" stwcx. %0,0,%1\n" > +" bne- 1b\n" > +" isync \n" > + : "=&r" (tmp) > + : "r" (&(count)->counter) > + : "cr0", "memory"); > + if (unlikely(tmp < 0)) > + return fail_fn(count); > + else > + return 0; > +} > +#endif From jschopp at austin.ibm.com Fri Jan 6 10:06:26 2006 From: jschopp at austin.ibm.com (Joel Schopp) Date: Thu, 05 Jan 2006 17:06:26 -0600 Subject: [patch 00/21] mutex subsystem, -V14 In-Reply-To: <20060105222106.GA26474@elte.hu> References: <20060104144151.GA27646@elte.hu> <43BC5E15.207@austin.ibm.com> <20060105143502.GA16816@elte.hu> <43BD4C66.60001@austin.ibm.com> <20060105222106.GA26474@elte.hu> Message-ID: <43BDA672.4090704@austin.ibm.com> > ISYNC_ON_SMP flushes all speculative reads currently in the queue - and > is hence a smp_rmb_backwards() primitive [per my previous mail] - but > does not affect writes - correct? > > if that's the case, what prevents a store from within the critical > section going up to right after the EIEIO_ON_SMP, but before the > atomic-dec instructions? Does any of those instructions imply some > barrier perhaps? Are writes always ordered perhaps (like on x86 CPUs), > and hence the store before the bne is an effective write-barrier? It really makes more sense after reading PowerPC Book II, which you can find at this link, it was written by people who explain this for a living: http://www-128.ibm.com/developerworks/eserver/articles/archguide.html While isync technically doesn't order stores it does order instructions. The previous bne- must complete, that bne- is dependent on the previous stwcx being complete. So no stores are slipping up. To get a better explanation you will have to read the document yourself. Here is a first pass at a powerpc file for the fast paths just as an FYI/RFC. It is completely untested, but compiles. Signed-off-by: Joel Schopp -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: powerpcmutex.patch Url: http://ozlabs.org/pipermail/linuxppc64-dev/attachments/20060105/e2d51f53/attachment.txt From mingo at elte.hu Fri Jan 6 10:42:22 2006 From: mingo at elte.hu (Ingo Molnar) Date: Fri, 6 Jan 2006 00:42:22 +0100 Subject: [patch 00/21] mutex subsystem, -V14 In-Reply-To: <43BDAD8A.60108@austin.ibm.com> References: <20060104144151.GA27646@elte.hu> <43BC5E15.207@austin.ibm.com> <20060105143502.GA16816@elte.hu> <43BD4C66.60001@austin.ibm.com> <20060105222106.GA26474@elte.hu> <43BDA672.4090704@austin.ibm.com> <43BDAD8A.60108@austin.ibm.com> Message-ID: <20060105234222.GA11474@elte.hu> * Joel Schopp wrote: > > Shouldn't you make that "isync" dependent on SMP too? UP doesn't > > need it, since DMA will never matter, and interrupts are precise. > > I think the isync is necessary to keep heavily out of order processors > from getting ahead of themselves even on UP. Scanning back through > the powerpc spinlock code they seem to take the same view there as > well. the asm/spinlock.h ops are only built on SMP kernels. mutex.h is for both UP and SMP. On UP you should need no synchronization, because the only way another context could interfere with your critical section is by getting interrupted, and interrupts are fully synchronizing, right? On UP the only synchronization needed is when a device reads/writes memory in parallel to the CPU. Ingo From miltonm at bga.com Fri Jan 6 19:00:16 2006 From: miltonm at bga.com (Milton Miller) Date: Fri, 6 Jan 2006 02:00:16 -0600 Subject: [PATCH, version 7] cell: enable pause(0) in cpu_idle In-Reply-To: <200601041955.53577.arnd@arndb.de> References: <200512171228.21578.arnd@arndb.de> <200512201314.12932.arnd@arndb.de> <200601041955.53577.arnd@arndb.de> Message-ID: <8f3b7d3eddbe59eecea11d8eecebda68@bga.com> > The only comment I got for version 6 was about formatting of > C style comments and I fixed those up, so let's hope this is > the final version of the patch. > You know, that just sounds like a challange :-) > + > +int cbe_system_reset_exception(struct pt_ static (used in cbe_pervasive_init at the bottom of the same file). Ok I should have seen that last time. milton From anton at samba.org Sat Jan 7 00:49:49 2006 From: anton at samba.org (Anton Blanchard) Date: Sat, 7 Jan 2006 00:49:49 +1100 Subject: [PATCH] ppc64: fix time syscall Message-ID: <20060106134948.GI26499@krispykreme> ppc64 has its own version of sys_time. It looks pretty scary, touching a whole bunch of variables without any locking or memory ordering. In fact, a recent bugreport has shown it can actually go backwards. Time to remove it and just use the generic sys_time, which is implemented on top of do_gettimeofday. Signed-off-by: Anton Blanchard --- Index: build/arch/powerpc/kernel/syscalls.c =================================================================== --- build.orig/arch/powerpc/kernel/syscalls.c 2005-12-20 19:08:01.000000000 +1100 +++ build/arch/powerpc/kernel/syscalls.c 2006-01-07 00:37:26.000000000 +1100 @@ -43,9 +43,6 @@ #include #include -extern unsigned long wall_jiffies; - - /* * sys_ipc() is the de-multiplexer for the SysV IPC calls.. * @@ -311,31 +308,6 @@ return error? -EFAULT: 0; } -#ifdef CONFIG_PPC64 -time_t sys64_time(time_t __user * tloc) -{ - time_t secs; - time_t usecs; - - long tb_delta = tb_ticks_since(tb_last_stamp); - tb_delta += (jiffies - wall_jiffies) * tb_ticks_per_jiffy; - - secs = xtime.tv_sec; - usecs = (xtime.tv_nsec/1000) + tb_delta / tb_ticks_per_usec; - while (usecs >= USEC_PER_SEC) { - ++secs; - usecs -= USEC_PER_SEC; - } - - if (tloc) { - if (put_user(secs,tloc)) - secs = -EFAULT; - } - - return secs; -} -#endif - long ppc_fadvise64_64(int fd, int advice, u32 offset_high, u32 offset_low, u32 len_high, u32 len_low) { Index: build/arch/powerpc/kernel/systbl.S =================================================================== --- build.orig/arch/powerpc/kernel/systbl.S 2005-11-05 20:51:08.000000000 +1100 +++ build/arch/powerpc/kernel/systbl.S 2006-01-07 00:37:26.000000000 +1100 @@ -54,7 +54,7 @@ SYSCALL(unlink) COMPAT_SYS(execve) SYSCALL(chdir) -SYSX(sys64_time,compat_sys_time,sys_time) +COMPAT_SYS(time) SYSCALL(mknod) SYSCALL(chmod) SYSCALL(lchown) From clameter at engr.sgi.com Sat Jan 7 07:24:25 2006 From: clameter at engr.sgi.com (Christoph Lameter) Date: Fri, 6 Jan 2006 12:24:25 -0800 (PST) Subject: [ANNOUNCE] numactl 0.9 released In-Reply-To: <200601032257.53039.ak@suse.de> References: <200601032257.53039.ak@suse.de> Message-ID: Here is a patch in order to make numactl support page migration. Comments welcome. Index: numactl-0.9/mbind.2 =================================================================== --- numactl-0.9.orig/mbind.2 2004-06-06 07:12:13.000000000 -0700 +++ numactl-0.9/mbind.2 2006-01-06 10:17:49.000000000 -0800 @@ -67,6 +67,30 @@ parameter will be returned when the existing pages in the mapping don't follow the policy. +When +.B MPOL_MF_MOVE +is passed in the +.B flags +then attempts will be made to move all the pages in the mapping +so that they follow the policy. Pages that are shared with other +processes are not moved. If +.B MPOL_MF_STRICT +is also specified then +.I EIO +will be returned if some pages could not be moved. + +When +.B MPOL_MF_MOVE_ALL +is passed in the +.B flags +then all pages in the mapping will be moved regardless of whether +other processes use the pages. The process specifying this flag must +have administrative priviledges. If +.B MPOL_MF_STRICT +is also specified then +.I EIO +will be returned if some pages could not be moved. + The .I MPOL_DEFAULT policy is the default and means to use the underlying process policy @@ -133,6 +157,9 @@ header. is ignored on huge page mappings right now. For preferred and interleave mappings it will only accept the first choice node. +.I MPOL_MF_MOVE_* +is only available on Linux 2.6.16 and later. + For .I MPOL_INTERLEAVE mode the interleaving is changed at fault time. The final layout of Index: numactl-0.9/numaif.h =================================================================== --- numactl-0.9.orig/numaif.h 2005-02-11 02:26:47.000000000 -0800 +++ numactl-0.9/numaif.h 2006-01-06 10:59:12.000000000 -0800 @@ -15,6 +15,8 @@ extern long mbind(void *start, unsigned const unsigned long *nmask, unsigned long maxnode, unsigned flags); extern long set_mempolicy(int mode, const unsigned long *nmask, unsigned long maxnode); +extern long migratepages(int pid, unsigned long maxnode, unsigned long *fromnode, + unsigned long *tonode); /* Policies */ #define MPOL_DEFAULT 0 @@ -30,6 +32,8 @@ extern long set_mempolicy(int mode, cons /* Flags for mbind */ #define MPOL_MF_STRICT (1<<0) /* Verify existing pages in the mapping */ +#define MPOL_MF_MOVE (1<<1) /* Move pages owned by this process to conform to mapping */ +#define MPOL_MF_MOVE_ALL (1<<2) /* Move every page to conform to mapping */ #ifdef __cplusplus } Index: numactl-0.9/Makefile =================================================================== --- numactl-0.9.orig/Makefile 2006-01-03 12:36:13.000000000 -0800 +++ numactl-0.9/Makefile 2006-01-06 12:12:14.000000000 -0800 @@ -25,12 +25,14 @@ prefix := /usr libdir := ${prefix}$(shell if [ -d /usr/lib64 ] ; then echo "/lib64" ; else echo "/lib" ; fi) docdir := ${prefix}/share/doc -all: numactl libnuma.so numademo numamon memhog test/tshared stream \ +all: numactl migratepages libnuma.so numademo numamon memhog test/tshared stream \ test/mynode test/pagesize test/ftok test/prefered test/randmap \ test/nodemap test/distance numactl: numactl.o util.o shm.o bitops.o libnuma.so +migratepages: migratepages.c util.o bitops.o libnuma.so + util.o: util.c memhog: util.o memhog.o libnuma.so @@ -94,10 +96,11 @@ set_membind set_preferred set_strict set tonodemask_memory distance MANPAGES := numa.3 numactl.8 mbind.2 set_mempolicy.2 get_mempolicy.2 \ - numastat.8 + numastat.8 migratepages.8 -install: numactl numademo.c numamon memhog libnuma.so.1 numa.h numaif.h numastat ${MANPAGES} +install: numactl migratepages numademo.c numamon memhog libnuma.so.1 numa.h numaif.h numastat ${MANPAGES} cp numactl ${prefix}/bin + cp migratepages ${prefix}/bin cp numademo ${prefix}/bin cp memhog ${prefix}/bin cp set_mempolicy.2 ${prefix}/share/man/man2 Index: numactl-0.9/migratepages.c =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 +++ numactl-0.9/migratepages.c 2006-01-06 12:20:11.000000000 -0800 @@ -0,0 +1,97 @@ +/* + * Copyright (C) 2005 Christoph Lameter, Silicon Graphics, Incorporated. + * based on Andi Kleen's numactl.c. + * + * Manual process migration + * + * migratepages is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public + * License as published by the Free Software Foundation; version 2. + * + * migratepages is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should find a copy of v2 of the GNU General Public License somewhere + * on your Linux system; if not, write to the Free Software Foundation, + * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#define _GNU_SOURCE +#include +#include +#include +#include +#include +#include +#include +#include "numaif.h" +#include "numa.h" +#include "numaint.h" +#include "util.h" + +struct option opts[] = { + {"help", 0, 0, 'h' }, + { 0 } +}; + +void usage(void) +{ + fprintf(stderr, + "usage: migratepages pid from-nodes to-nodes\n" + "\n" + "nodes is a comma delimited list of node numbers or A-B ranges or none/all.\n" +); + exit(1); +} + +void checknuma(void) +{ + static int numa = -1; + if (numa < 0) { + if (numa_available() < 0) + complain("This system does not support NUMA functionality"); + } + numa = 0; +} + +int main(int argc, char *argv[]) +{ + int c; + char *end; + int rc; + int pid; + nodemask_t fromnodes; + nodemask_t tonodes; + + while ((c = getopt_long(argc,argv,"h", opts, NULL)) != -1) { + switch (c) { + default: + usage(); + } + } + + argv += optind; + argc -= optind; + + if (argc != 4) + usage(); + + checknuma(); + + pid = strtoul(argv[1], &end, 0); + if (*end) + usage(); + + fromnodes = nodemask(argv[2]); + tonodes = nodemask(argv[3]); + + rc = numa_migrate_pages(pid, &fromnodes, &tonodes); + + if (rc) { + perror("migrate_pages"); + return 1; + } + return 0; +} Index: numactl-0.9/syscall.c =================================================================== --- numactl-0.9.orig/syscall.c 2006-01-03 10:49:17.000000000 -0800 +++ numactl-0.9/syscall.c 2006-01-06 11:55:36.000000000 -0800 @@ -35,10 +35,12 @@ #define __NR_mbind 237 #define __NR_set_mempolicy 238 #define __NR_get_mempolicy 239 +#define __NR_migrate_pages 256 #elif defined(__ia64__) #define __NR_sched_setaffinity 1231 #define __NR_sched_getaffinity 1232 +#define __NR_migrate_pages 1280 /* Official allocation */ @@ -51,12 +53,14 @@ #define __NR_mbind 274 #define __NR_get_mempolicy 275 #define __NR_set_mempolicy 276 +#define __NR_migrate_pages 294 #elif defined(__powerpc__) #define __NR_mbind 259 #define __NR_get_mempolicy 260 #define __NR_set_mempolicy 261 +#define __NR_migrate_pages 280 #elif !defined(DEPS_RUN) #error "Add syscalls for your architecture or update kernel headers" @@ -141,6 +145,12 @@ long WEAK set_mempolicy(int mode, const return syscall(__NR_set_mempolicy,mode,nmask,maxnode); } +long WEAK migrate_pages(int pid, unsigned long maxnode, + const unsigned long *frommask, const unsigned long *tomask) +{ + return syscall(__NR_migrate_pages, pid, maxnode, frommask, tomask); +} + /* SLES8 glibc doesn't define those */ int numa_sched_setaffinity(pid_t pid, unsigned len, const unsigned long *mask) @@ -159,3 +169,5 @@ make_internal_alias(numa_sched_setaffini make_internal_alias(get_mempolicy); make_internal_alias(set_mempolicy); make_internal_alias(mbind); +make_internal_alias(migrate_pages); + Index: numactl-0.9/numa.h =================================================================== --- numactl-0.9.orig/numa.h 2005-12-25 14:20:34.000000000 -0800 +++ numactl-0.9/numa.h 2006-01-06 11:40:25.000000000 -0800 @@ -176,6 +176,8 @@ extern int numa_exit_on_error; once. */ void numa_warn(int num, char *fmt, ...); +int numa_migrate_pages(int pid, const nodemask_t *from, const nodemask_t *to); + #ifdef __cplusplus } #endif Index: numactl-0.9/libnuma.c =================================================================== --- numactl-0.9.orig/libnuma.c 2005-12-19 04:11:51.000000000 -0800 +++ numactl-0.9/libnuma.c 2006-01-06 12:00:03.000000000 -0800 @@ -600,6 +600,19 @@ nodemask_t numa_get_run_node_mask(void) return mask; } +int numa_migrate_pages(int pid, const nodemask_t *fromnodes, const nodemask_t *tonodes) +{ + int err; + + err = migrate_pages(pid, NUMA_NUM_NODES + 1, &fromnodes->n[0], &tonodes->n[0]); + + if (err < 0) { + errno = -err; + return -1; + } + return err; +} + int numa_run_on_node(int node) { int ncpus = number_of_cpus(); Index: numactl-0.9/numaint.h =================================================================== --- numactl-0.9.orig/numaint.h 2005-04-28 04:40:38.000000000 -0700 +++ numactl-0.9/numaint.h 2006-01-06 11:56:36.000000000 -0800 @@ -11,7 +11,9 @@ extern long mbind_int(void *start, unsig const unsigned long *nmask, unsigned long maxnode, unsigned flags); extern long set_mempolicy_int(int mode, const unsigned long *nmask, unsigned long maxnode); - +extern long migrate_pages(int pid, unsigned long maxnode, const unsigned long *frommask, + const unsigned long *tomask); + #define SHM_HUGETLB 04000 /* segment will use huge TLB pages */ #define CPU_BYTES(x) (round_up(x, BITS_PER_LONG)/8) Index: numactl-0.9/migratepages.8 =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 +++ numactl-0.9/migratepages.8 2006-01-06 12:18:03.000000000 -0800 @@ -0,0 +1,63 @@ +.\" t +.\" Copyright 2005 Christoph Lameter, Silicon Graphics, Inc. +.\" +.\" based on Andi Kleen's numactl manpage +.\" +.TH MIGRATEPAGES 8 "Jan 2005" "SGI" "Linux Administrator's Manual" +.SH NAME +migratepages \- Migrate the physical location of pages of a process +.SH SYNOPSIS +.B migratepages +pid from-nodes to-nodes +.SH DESCRIPTION +.B migratepages +moves the physical localtion of a processes pages without any changes of the +virtual address space of the process. This is usually done to optimize +the performance of a process by moving the pages near to the processor +executing a process. +.TP +Valid node specifiers +.TS +tab(:); +l l. +all:All nodes +number:Node number +number1{,number2}:Node number1 and Node number2 +number1-number2:Nodes from number1 to number2 +! nodes:Invert selection of the following specification. +.TE +.SH NOTES +Requires an NUMA policy aware kernel. + +migratepages will only move pages that are not shared with other +processes if called by a user without administrative priviledges (but +with the right to modify the process). + +migratepages will move all pages if invoked from root (or a user with +administrative priviledges). + +.SH FILES +.I /proc//numastat +for information about the NUMA memory use of a process. +.SH COPYRIGHT +Copyright 2005 Christoph Lameter, Silicon Graphics, Inc. +migratepages is under the GNU General Public License, v.2 + +.SH SEE ALSO +.I numactl(8) +, +.I set_mempolicy(2) +, +.I get_mempolicy(2) +, +.I mbind(2) +, +.I sched_setaffinity(2) +, +.I sched_getaffinity(2) +, +.I proc(5) +, +.I ftok(3) +, +.I shmat(2) Index: numactl-0.9/numactl.8 =================================================================== --- numactl-0.9.orig/numactl.8 2005-12-16 04:13:19.000000000 -0800 +++ numactl-0.9/numactl.8 2006-01-06 12:11:31.000000000 -0800 @@ -271,3 +271,6 @@ numactl and the demo programs are under .I ftok(3) , .I shmat(2) +, +.I migratepages(8) + From ak at suse.de Sat Jan 7 08:10:30 2006 From: ak at suse.de (Andi Kleen) Date: Fri, 6 Jan 2006 22:10:30 +0100 Subject: [ANNOUNCE] numactl 0.9 released In-Reply-To: References: <200601032257.53039.ak@suse.de> Message-ID: <200601062210.31154.ak@suse.de> On Friday 06 January 2006 21:24, Christoph Lameter wrote: > Here is a patch in order to make numactl support page migration. Thanks, Did migrate_pages make it into Linus' tree yet? I don't see it there yet. I think the name of the command is a bit unintuitive - how about calling it changenodemem or movenodemem ? (better suggestions welcome) At least some words in the manpage what happens when you specify multiple nodes in from/to might be a good idea. > + pid = strtoul(argv[1], &end, 0); > + if (*end) || end == argv[1] > +moves the physical localtion of a processes pages without any changes of the typo. > +.SH COPYRIGHT > +Copyright 2005 Christoph Lameter, Silicon Graphics, Inc. > +migratepages is under the GNU General Public License, v.2 I can only warn you of putting your name visibly into the manpages - it will give you a constant stream of mails from confused users for many years ;-) > +, > +.I shmat(2) Refer to taskset too? (or alternatively add a option to set the CPU affinity using cpus or nodes too - taskset has the disadvantage that you cannot specify nodes so a user would need to know the cpu<->node mapping) -Andi From benh at kernel.crashing.org Sat Jan 7 11:24:30 2006 From: benh at kernel.crashing.org (Benjamin Herrenschmidt) Date: Sat, 07 Jan 2006 11:24:30 +1100 Subject: [PATCH] 0/5 powerpc: Platform & i2c updates & cpufreq Message-ID: <1136593470.4840.154.camel@localhost.localdomain> Hi ! This serie of patch replaces the 2 I posted recently for platform functions & g5 cpufreq. It's not a 100% finished job yet but it's getting closer. Ben. From benh at kernel.crashing.org Sat Jan 7 11:30:44 2006 From: benh at kernel.crashing.org (Benjamin Herrenschmidt) Date: Sat, 07 Jan 2006 11:30:44 +1100 Subject: [PATCH] 1/5 powerpc: Rework PowerMac i2c part 1 Message-ID: <1136593845.4840.161.camel@localhost.localdomain> This is the first part of a rework of the PowerMac i2c code. It completely reworks the "low_i2c" layer. It is now more flexible, supports KeyWest, SMU and PMU i2c busses, and provides functions to match device nodes to i2c busses and adapters. This patch also extends & fix some bugs in the SMU driver related to i2c support and removes the clock spreading hacks from the pmac feature code rather than adapting them to the new API since they'll be replaced by the platform function code completely in patch 3/5 Signed-off-by: Benjamin Herrenschmidt Index: linux-work/arch/powerpc/platforms/powermac/feature.c =================================================================== --- linux-work.orig/arch/powerpc/platforms/powermac/feature.c 2006-01-06 19:39:44.000000000 +1100 +++ linux-work/arch/powerpc/platforms/powermac/feature.c 2006-01-07 11:25:16.000000000 +1100 @@ -1677,124 +1677,6 @@ intrepid_shutdown(struct macio_chip *mac } -void pmac_tweak_clock_spreading(int enable) -{ - struct macio_chip *macio = &macio_chips[0]; - - /* Hack for doing clock spreading on some machines PowerBooks and - * iBooks. This implements the "platform-do-clockspreading" OF - * property as decoded manually on various models. For safety, we also - * check the product ID in the device-tree in cases we'll whack the i2c - * chip to make reasonably sure we won't set wrong values in there - * - * Of course, ultimately, we have to implement a real parser for - * the platform-do-* stuff... - */ - - if (macio->type == macio_intrepid) { - struct device_node *clock = - of_find_node_by_path("/uni-n at f8000000/hw-clock"); - if (clock && get_property(clock, "platform-do-clockspreading", - NULL)) { - printk(KERN_INFO "%sabling clock spreading on Intrepid" - " ASIC\n", enable ? "En" : "Dis"); - if (enable) - UN_OUT(UNI_N_CLOCK_SPREADING, 2); - else - UN_OUT(UNI_N_CLOCK_SPREADING, 0); - mdelay(40); - } - of_node_put(clock); - } - - while (machine_is_compatible("PowerBook5,2") || - machine_is_compatible("PowerBook5,3") || - machine_is_compatible("PowerBook6,2") || - machine_is_compatible("PowerBook6,3")) { - struct device_node *ui2c = of_find_node_by_type(NULL, "i2c"); - struct device_node *dt = of_find_node_by_name(NULL, "device-tree"); - u8 buffer[9]; - u32 *productID; - int i, rc, changed = 0; - - if (dt == NULL) - break; - productID = (u32 *)get_property(dt, "pid#", NULL); - if (productID == NULL) - break; - while(ui2c) { - struct device_node *p = of_get_parent(ui2c); - if (p && !strcmp(p->name, "uni-n")) - break; - ui2c = of_find_node_by_type(ui2c, "i2c"); - } - if (ui2c == NULL) - break; - DBG("Trying to bump clock speed for PID: %08x...\n", *productID); - rc = pmac_low_i2c_open(ui2c, 1); - if (rc != 0) - break; - pmac_low_i2c_setmode(ui2c, pmac_low_i2c_mode_combined); - rc = pmac_low_i2c_xfer(ui2c, 0xd2 | pmac_low_i2c_read, 0x80, buffer, 9); - DBG("read result: %d,", rc); - if (rc != 0) { - pmac_low_i2c_close(ui2c); - break; - } - for (i=0; i<9; i++) - DBG(" %02x", buffer[i]); - DBG("\n"); - - switch(*productID) { - case 0x1182: /* AlBook 12" rev 2 */ - case 0x1183: /* iBook G4 12" */ - buffer[0] = (buffer[0] & 0x8f) | 0x70; - buffer[2] = (buffer[2] & 0x7f) | 0x00; - buffer[5] = (buffer[5] & 0x80) | 0x31; - buffer[6] = (buffer[6] & 0x40) | 0xb0; - buffer[7] = (buffer[7] & 0x00) | (enable ? 0xc0 : 0xba); - buffer[8] = (buffer[8] & 0x00) | 0x30; - changed = 1; - break; - case 0x3142: /* AlBook 15" (ATI M10) */ - case 0x3143: /* AlBook 17" (ATI M10) */ - buffer[0] = (buffer[0] & 0xaf) | 0x50; - buffer[2] = (buffer[2] & 0x7f) | 0x00; - buffer[5] = (buffer[5] & 0x80) | 0x31; - buffer[6] = (buffer[6] & 0x40) | 0xb0; - buffer[7] = (buffer[7] & 0x00) | (enable ? 0xd0 : 0xc0); - buffer[8] = (buffer[8] & 0x00) | 0x30; - changed = 1; - break; - default: - DBG("i2c-hwclock: Machine model not handled\n"); - break; - } - if (!changed) { - pmac_low_i2c_close(ui2c); - break; - } - printk(KERN_INFO "%sabling clock spreading on i2c clock chip\n", - enable ? "En" : "Dis"); - - pmac_low_i2c_setmode(ui2c, pmac_low_i2c_mode_stdsub); - rc = pmac_low_i2c_xfer(ui2c, 0xd2 | pmac_low_i2c_write, 0x80, buffer, 9); - DBG("write result: %d,", rc); - pmac_low_i2c_setmode(ui2c, pmac_low_i2c_mode_combined); - rc = pmac_low_i2c_xfer(ui2c, 0xd2 | pmac_low_i2c_read, 0x80, buffer, 9); - DBG("read result: %d,", rc); - if (rc != 0) { - pmac_low_i2c_close(ui2c); - break; - } - for (i=0; i<9; i++) - DBG(" %02x", buffer[i]); - pmac_low_i2c_close(ui2c); - break; - } -} - - static int core99_sleep(void) { @@ -2980,12 +2862,6 @@ set_initial_features(void) MACIO_BIC(HEATHROW_FCR, HRW_SOUND_POWER_N); } - /* Some machine models need the clock chip to be properly setup for - * clock spreading now. This should be a platform function but we - * don't do these at the moment - */ - pmac_tweak_clock_spreading(1); - #endif /* CONFIG_POWER4 */ /* On all machines, switch modem & serial ports off */ @@ -3013,9 +2889,6 @@ pmac_feature_init(void) return; } - /* Setup low-level i2c stuffs */ - pmac_init_low_i2c(); - /* Probe machine type */ if (probe_motherboard()) printk(KERN_WARNING "Unknown PowerMac !\n"); Index: linux-work/arch/powerpc/platforms/powermac/low_i2c.c =================================================================== --- linux-work.orig/arch/powerpc/platforms/powermac/low_i2c.c 2006-01-06 19:39:44.000000000 +1100 +++ linux-work/arch/powerpc/platforms/powermac/low_i2c.c 2006-01-07 11:25:18.000000000 +1100 @@ -1,22 +1,34 @@ /* - * arch/ppc/platforms/pmac_low_i2c.c + * arch/powerpc/platforms/powermac/low_i2c.c * - * Copyright (C) 2003 Ben. Herrenschmidt (benh at kernel.crashing.org) + * Copyright (C) 2003-2005 Ben. Herrenschmidt (benh at kernel.crashing.org) * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version * 2 of the License, or (at your option) any later version. * - * This file contains some low-level i2c access routines that - * need to be used by various bits of the PowerMac platform code - * at times where the real asynchronous & interrupt driven driver - * cannot be used. The API borrows some semantics from the darwin - * driver in order to ease the implementation of the platform - * properties parser + * The linux i2c layer isn't completely suitable for our needs for various + * reasons ranging from too late initialisation to semantics not perfectly + * matching some requirements of the apple platform functions etc... + * + * This file thus provides a simple low level unified i2c interface for + * powermac that covers the various types of i2c busses used in Apple machines. + * For now, keywest, PMU and SMU, though we could add Cuda, or other bit + * banging busses found on older chipstes in earlier machines if we ever need + * one of them. + * + * The drivers in this file are synchronous/blocking. In addition, the + * keywest one is fairly slow due to the use of msleep instead of interrupts + * as the interrupt is currently used by i2c-keywest. In the long run, we + * might want to get rid of those high-level interfaces to linux i2c layer + * either completely (converting all drivers) or replacing them all with a + * single stub driver on top of this one. Once done, the interrupt will be + * available for our use. */ #undef DEBUG +#undef DEBUG_LOW #include #include @@ -25,15 +37,16 @@ #include #include #include +#include +#include #include #include #include #include #include +#include #include -#define MAX_LOW_I2C_HOST 4 - #ifdef DEBUG #define DBG(x...) do {\ printk(KERN_DEBUG "low_i2c:" x); \ @@ -42,49 +55,54 @@ #define DBG(x...) #endif -struct low_i2c_host; - -typedef int (*low_i2c_func_t)(struct low_i2c_host *host, u8 addr, u8 sub, u8 *data, int len); - -struct low_i2c_host -{ - struct device_node *np; /* OF device node */ - struct semaphore mutex; /* Access mutex for use by i2c-keywest */ - low_i2c_func_t func; /* Access function */ - unsigned int is_open : 1; /* Poor man's access control */ - int mode; /* Current mode */ - int channel; /* Current channel */ - int num_channels; /* Number of channels */ - void __iomem *base; /* For keywest-i2c, base address */ - int bsteps; /* And register stepping */ - int speed; /* And speed */ -}; - -static struct low_i2c_host low_i2c_hosts[MAX_LOW_I2C_HOST]; +#ifdef DEBUG_LOW +#define DBG_LOW(x...) do {\ + printk(KERN_DEBUG "low_i2c:" x); \ + } while(0) +#else +#define DBG_LOW(x...) +#endif -/* No locking is necessary on allocation, we are running way before - * anything can race with us +/* + * A bus structure. Each bus in the system has such a structure associated. */ -static struct low_i2c_host *find_low_i2c_host(struct device_node *np) +struct pmac_i2c_bus { - int i; + struct list_head link; + struct device_node *controller; + struct device_node *busnode; + int type; + int flags; + struct i2c_adapter *adapter; + void *hostdata; + int channel; /* some hosts have multiple */ + int mode; /* current mode */ + struct semaphore sem; + int opened; + int polled; /* open mode */ + + /* ops */ + int (*open)(struct pmac_i2c_bus *bus); + void (*close)(struct pmac_i2c_bus *bus); + int (*xfer)(struct pmac_i2c_bus *bus, u8 addrdir, int subsize, + u32 subaddr, u8 *data, int len); +}; - for (i = 0; i < MAX_LOW_I2C_HOST; i++) - if (low_i2c_hosts[i].np == np) - return &low_i2c_hosts[i]; - return NULL; -} +static LIST_HEAD(pmac_i2c_busses); /* - * - * i2c-keywest implementation (UniNorth, U2, U3, Keylargo's) - * + * Keywest implementation */ -/* - * Keywest i2c definitions borrowed from drivers/i2c/i2c-keywest.h, - * should be moved somewhere in include/asm-ppc/ - */ +struct pmac_i2c_host_kw +{ + struct semaphore mutex; /* Access mutex for use by + * i2c-keywest */ + void __iomem *base; /* register base address */ + int bsteps; /* register stepping */ + int speed; /* speed */ +}; + /* Register indices */ typedef enum { reg_mode = 0, @@ -153,52 +171,56 @@ static const char *__kw_state_names[] = "state_dead" }; -static inline u8 __kw_read_reg(struct low_i2c_host *host, reg_t reg) +static inline u8 __kw_read_reg(struct pmac_i2c_bus *bus, reg_t reg) { + struct pmac_i2c_host_kw *host = bus->hostdata; return readb(host->base + (((unsigned int)reg) << host->bsteps)); } -static inline void __kw_write_reg(struct low_i2c_host *host, reg_t reg, u8 val) +static inline void __kw_write_reg(struct pmac_i2c_bus *bus, reg_t reg, u8 val) { + struct pmac_i2c_host_kw *host = bus->hostdata; writeb(val, host->base + (((unsigned)reg) << host->bsteps)); - (void)__kw_read_reg(host, reg_subaddr); + (void)__kw_read_reg(bus, reg_subaddr); } -#define kw_write_reg(reg, val) __kw_write_reg(host, reg, val) -#define kw_read_reg(reg) __kw_read_reg(host, reg) +#define kw_write_reg(reg, val) __kw_write_reg(bus, reg, val) +#define kw_read_reg(reg) __kw_read_reg(bus, reg) - -/* Don't schedule, the g5 fan controller is too - * timing sensitive - */ -static u8 kw_wait_interrupt(struct low_i2c_host* host) +static u8 kw_i2c_wait_interrupt(struct pmac_i2c_bus* bus) { int i, j; u8 isr; - for (i = 0; i < 100000; i++) { + for (i = 0; i < 1000; i++) { isr = kw_read_reg(reg_isr) & KW_I2C_IRQ_MASK; if (isr != 0) return isr; /* This code is used with the timebase frozen, we cannot rely - * on udelay ! For now, just use a bogus loop + * on udelay nor schedule when in polled mode ! + * For now, just use a bogus loop.... */ - for (j = 1; j < 10000; j++) - mb(); + if (bus->polled) { + for (j = 1; j < 1000000; j++) + mb(); + } else + msleep(1); } return isr; } -static int kw_handle_interrupt(struct low_i2c_host *host, int state, int rw, int *rc, u8 **data, int *len, u8 isr) +static int kw_i2c_handle_interrupt(struct pmac_i2c_bus *bus, int state, int rw, + int *rc, u8 **data, int *len, u8 isr) { u8 ack; - DBG("kw_handle_interrupt(%s, isr: %x)\n", __kw_state_names[state], isr); + DBG_LOW("kw_handle_interrupt(%s, isr: %x)\n", + __kw_state_names[state], isr); if (isr == 0) { if (state != state_stop) { - DBG("KW: Timeout !\n"); + DBG_LOW("KW: Timeout !\n"); *rc = -EIO; goto stop; } @@ -220,15 +242,16 @@ static int kw_handle_interrupt(struct lo *rc = -EIO; goto stop; } - if ((ack & KW_I2C_STAT_LAST_AAK) == 0) { + if ((ack & KW_I2C_STAT_LAST_AAK) == 0) { *rc = -ENODEV; - DBG("KW: NAK on address\n"); + DBG_LOW("KW: NAK on address\n"); return state_stop; } else { if (rw) { state = state_read; if (*len > 1) - kw_write_reg(reg_control, KW_I2C_CTL_AAK); + kw_write_reg(reg_control, + KW_I2C_CTL_AAK); } else { state = state_write; kw_write_reg(reg_data, **data); @@ -250,7 +273,7 @@ static int kw_handle_interrupt(struct lo } else if (state == state_write) { ack = kw_read_reg(reg_status); if ((ack & KW_I2C_STAT_LAST_AAK) == 0) { - DBG("KW: nack on data write\n"); + DBG_LOW("KW: nack on data write\n"); *rc = -EIO; goto stop; } else if (*len) { @@ -291,35 +314,57 @@ static int kw_handle_interrupt(struct lo return state_stop; } -static int keywest_low_i2c_func(struct low_i2c_host *host, u8 addr, u8 subaddr, u8 *data, int len) +static int kw_i2c_open(struct pmac_i2c_bus *bus) +{ + struct pmac_i2c_host_kw *host = bus->hostdata; + down(&host->mutex); + return 0; +} + +static void kw_i2c_close(struct pmac_i2c_bus *bus) { + struct pmac_i2c_host_kw *host = bus->hostdata; + up(&host->mutex); +} + +static int kw_i2c_xfer(struct pmac_i2c_bus *bus, u8 addrdir, int subsize, + u32 subaddr, u8 *data, int len) +{ + struct pmac_i2c_host_kw *host = bus->hostdata; u8 mode_reg = host->speed; int state = state_addr; int rc = 0; /* Setup mode & subaddress if any */ - switch(host->mode) { - case pmac_low_i2c_mode_dumb: - printk(KERN_ERR "low_i2c: Dumb mode not supported !\n"); + switch(bus->mode) { + case pmac_i2c_mode_dumb: return -EINVAL; - case pmac_low_i2c_mode_std: + case pmac_i2c_mode_std: mode_reg |= KW_I2C_MODE_STANDARD; + if (subsize != 0) + return -EINVAL; break; - case pmac_low_i2c_mode_stdsub: + case pmac_i2c_mode_stdsub: mode_reg |= KW_I2C_MODE_STANDARDSUB; + if (subsize != 1) + return -EINVAL; break; - case pmac_low_i2c_mode_combined: + case pmac_i2c_mode_combined: mode_reg |= KW_I2C_MODE_COMBINED; + if (subsize != 1) + return -EINVAL; break; } /* Setup channel & clear pending irqs */ kw_write_reg(reg_isr, kw_read_reg(reg_isr)); - kw_write_reg(reg_mode, mode_reg | (host->channel << 4)); + kw_write_reg(reg_mode, mode_reg | (bus->channel << 4)); kw_write_reg(reg_status, 0); - /* Set up address and r/w bit */ - kw_write_reg(reg_addr, addr); + /* Set up address and r/w bit, strip possible stale bus number from + * address top bits + */ + kw_write_reg(reg_addr, addrdir & 0xff); /* Set up the sub address */ if ((mode_reg & KW_I2C_MODE_MODE_MASK) == KW_I2C_MODE_STANDARDSUB @@ -330,27 +375,27 @@ static int keywest_low_i2c_func(struct l kw_write_reg(reg_ier, 0 /*KW_I2C_IRQ_MASK*/); kw_write_reg(reg_control, KW_I2C_CTL_XADDR); - /* State machine, to turn into an interrupt handler */ + /* State machine, to turn into an interrupt handler in the future */ while(state != state_idle) { - u8 isr = kw_wait_interrupt(host); - state = kw_handle_interrupt(host, state, addr & 1, &rc, &data, &len, isr); + u8 isr = kw_i2c_wait_interrupt(bus); + state = kw_i2c_handle_interrupt(bus, state, addrdir & 1, &rc, + &data, &len, isr); } return rc; } -static void keywest_low_i2c_add(struct device_node *np) +static struct pmac_i2c_host_kw *__init kw_i2c_host_init(struct device_node *np) { - struct low_i2c_host *host = find_low_i2c_host(NULL); + struct pmac_i2c_host_kw *host; u32 *psteps, *prate, *addrp, steps; - struct device_node *parent; + host = kzalloc(sizeof(struct pmac_i2c_host_kw), GFP_KERNEL); if (host == NULL) { printk(KERN_ERR "low_i2c: Can't allocate host for %s\n", np->full_name); - return; + return NULL; } - memset(host, 0, sizeof(*host)); /* Apple is kind enough to provide a valid AAPL,address property * on all i2c keywest nodes so far ... we would have to fallback @@ -360,18 +405,14 @@ static void keywest_low_i2c_add(struct d if (addrp == NULL) { printk(KERN_ERR "low_i2c: Can't find address for %s\n", np->full_name); - return; + kfree(host); + return NULL; } init_MUTEX(&host->mutex); - host->np = of_node_get(np); psteps = (u32 *)get_property(np, "AAPL,address-step", NULL); steps = psteps ? (*psteps) : 0x10; for (host->bsteps = 0; (steps & 0x01) == 0; host->bsteps++) steps >>= 1; - parent = of_get_parent(np); - host->num_channels = 1; - if (parent && parent->name[0] == 'u') - host->num_channels = 2; /* Select interface rate */ host->speed = KW_I2C_MODE_25KHZ; prate = (u32 *)get_property(np, "AAPL,i2c-rate", NULL); @@ -387,148 +428,620 @@ static void keywest_low_i2c_add(struct d break; } - printk(KERN_INFO "low_i2c: Bus %s found at 0x%08x, %d channels," - " speed = %d KHz\n", - np->full_name, *addrp, host->num_channels, prate ? *prate : 25); - - host->mode = pmac_low_i2c_mode_std; + printk(KERN_INFO "KeyWest i2c @0x%08x %s\n", *addrp, np->full_name); host->base = ioremap((*addrp), 0x1000); - host->func = keywest_low_i2c_func; + + return host; +} + + +static void __init kw_i2c_add(struct pmac_i2c_host_kw *host, + struct device_node *controller, + struct device_node *busnode, + int channel) +{ + struct pmac_i2c_bus *bus; + + bus = kzalloc(sizeof(struct pmac_i2c_bus), GFP_KERNEL); + if (bus == NULL) + return; + + bus->controller = of_node_get(controller); + bus->busnode = of_node_get(busnode); + bus->type = pmac_i2c_bus_keywest; + bus->hostdata = host; + bus->channel = channel; + bus->mode = pmac_i2c_mode_std; + bus->open = kw_i2c_open; + bus->close = kw_i2c_close; + bus->xfer = kw_i2c_xfer; + init_MUTEX(&bus->sem); + if (controller == busnode) + bus->flags = pmac_i2c_multibus; + list_add(&bus->link, &pmac_i2c_busses); + + printk(KERN_INFO " channel %d bus %s\n", channel, + (controller == busnode) ? "" : busnode->full_name); +} + +static void __init kw_i2c_probe(void) +{ + struct device_node *np, *child, *parent; + + /* Probe keywest-i2c busses */ + for (np = NULL; + (np = of_find_compatible_node(np, "i2c","keywest-i2c")) != NULL;){ + struct pmac_i2c_host_kw *host; + int multibus, chans, i; + + /* Found one, init a host structure */ + host = kw_i2c_host_init(np); + if (host == NULL) + continue; + + /* Now check if we have a multibus setup (old style) or if we + * have proper bus nodes. Note that the "new" way (proper bus + * nodes) might cause us to not create some busses that are + * kept hidden in the device-tree. In the future, we might + * want to work around that by creating busses without a node + * but not for now + */ + child = of_get_next_child(np, NULL); + multibus = !child || strcmp(child->name, "i2c-bus"); + of_node_put(child); + + /* For a multibus setup, we get the bus count based on the + * parent type + */ + if (multibus) { + parent = of_get_parent(np); + if (parent == NULL) + continue; + chans = parent->name[0] == 'u' ? 2 : 1; + for (i = 0; i < chans; i++) + kw_i2c_add(host, np, np, i); + } else { + for (child = NULL; + (child = of_get_next_child(np, child)) != NULL;) { + u32 *reg = + (u32 *)get_property(child, "reg", NULL); + if (reg == NULL) + continue; + kw_i2c_add(host, np, child, *reg); + } + } + } } + /* * * PMU implementation * */ - #ifdef CONFIG_ADB_PMU -static int pmu_low_i2c_func(struct low_i2c_host *host, u8 addr, u8 sub, u8 *data, int len) +/* + * i2c command block to the PMU + */ +struct pmu_i2c_hdr { + u8 bus; + u8 mode; + u8 bus2; + u8 address; + u8 sub_addr; + u8 comb_addr; + u8 count; + u8 data[]; +}; + +static void pmu_i2c_complete(struct adb_request *req) { - // TODO - return -ENODEV; + complete(req->arg); } -static void pmu_low_i2c_add(struct device_node *np) +static int pmu_i2c_xfer(struct pmac_i2c_bus *bus, u8 addrdir, int subsize, + u32 subaddr, u8 *data, int len) { - struct low_i2c_host *host = find_low_i2c_host(NULL); + struct adb_request *req = bus->hostdata; + struct pmu_i2c_hdr *hdr = (struct pmu_i2c_hdr *)&req->data[1]; + struct completion comp; + int read = addrdir & 1; + int retry; + int rc = 0; - if (host == NULL) { - printk(KERN_ERR "low_i2c: Can't allocate host for %s\n", - np->full_name); - return; + /* For now, limit ourselves to 16 bytes transfers */ + if (len > 16) + return -EINVAL; + + init_completion(&comp); + + for (retry = 0; retry < 16; retry++) { + memset(req, 0, sizeof(struct adb_request)); + hdr->bus = bus->channel; + hdr->count = len; + + switch(bus->mode) { + case pmac_i2c_mode_std: + if (subsize != 0) + return -EINVAL; + hdr->address = addrdir; + hdr->mode = PMU_I2C_MODE_SIMPLE; + break; + case pmac_i2c_mode_stdsub: + case pmac_i2c_mode_combined: + if (subsize != 1) + return -EINVAL; + hdr->address = addrdir & 0xfe; + hdr->comb_addr = addrdir; + hdr->sub_addr = subaddr; + if (bus->mode == pmac_i2c_mode_stdsub) + hdr->mode = PMU_I2C_MODE_STDSUB; + else + hdr->mode = PMU_I2C_MODE_COMBINED; + break; + default: + return -EINVAL; + } + + INIT_COMPLETION(comp); + req->data[0] = PMU_I2C_CMD; + req->reply[0] = 0xff; + req->nbytes = sizeof(struct pmu_i2c_hdr) + 1; + req->done = pmu_i2c_complete; + req->arg = ∁ + if (!read) { + memcpy(hdr->data, data, len); + req->nbytes += len; + } + rc = pmu_queue_request(req); + if (rc) + return rc; + wait_for_completion(&comp); + if (req->reply[0] == PMU_I2C_STATUS_OK) + break; + msleep(15); } - memset(host, 0, sizeof(*host)); + if (req->reply[0] != PMU_I2C_STATUS_OK) + return -EIO; - init_MUTEX(&host->mutex); - host->np = of_node_get(np); - host->num_channels = 3; - host->mode = pmac_low_i2c_mode_std; - host->func = pmu_low_i2c_func; + for (retry = 0; retry < 16; retry++) { + memset(req, 0, sizeof(struct adb_request)); + + /* I know that looks like a lot, slow as hell, but darwin + * does it so let's be on the safe side for now + */ + msleep(15); + + hdr->bus = PMU_I2C_BUS_STATUS; + + INIT_COMPLETION(comp); + req->data[0] = PMU_I2C_CMD; + req->reply[0] = 0xff; + req->nbytes = 2; + req->done = pmu_i2c_complete; + req->arg = ∁ + rc = pmu_queue_request(req); + if (rc) + return rc; + wait_for_completion(&comp); + + if (req->reply[0] == PMU_I2C_STATUS_OK && !read) + return 0; + if (req->reply[0] == PMU_I2C_STATUS_DATAREAD && read) { + int rlen = req->reply_len - 1; + + if (rlen != len) { + printk(KERN_WARNING "low_i2c: PMU returned %d" + " bytes, expected %d !\n", rlen, len); + return -EIO; + } + memcpy(data, &req->reply[1], len); + return 0; + } + } + return -EIO; +} + +static void __init pmu_i2c_probe(void) +{ + struct pmac_i2c_bus *bus; + struct device_node *busnode; + int channel, sz; + + if (!pmu_present()) + return; + + /* There might or might not be a "pmu-i2c" node, we use that + * or via-pmu itself, whatever we find. I haven't seen a machine + * with separate bus nodes, so we assume a multibus setup + */ + busnode = of_find_node_by_name(NULL, "pmu-i2c"); + if (busnode == NULL) + busnode = of_find_node_by_name(NULL, "via-pmu"); + if (busnode == NULL) + return; + + printk(KERN_INFO "PMU i2c %s\n", busnode->full_name); + + /* + * We add bus 1 and 2 only for now, bus 0 is "special" + */ + for (channel = 1; channel <= 2; channel++) { + sz = sizeof(struct pmac_i2c_bus) + sizeof(struct adb_request); + bus = kzalloc(sz, GFP_KERNEL); + if (bus == NULL) + return; + + bus->controller = busnode; + bus->busnode = busnode; + bus->type = pmac_i2c_bus_pmu; + bus->channel = channel; + bus->mode = pmac_i2c_mode_std; + bus->hostdata = bus + 1; + bus->xfer = pmu_i2c_xfer; + init_MUTEX(&bus->sem); + bus->flags = pmac_i2c_multibus; + list_add(&bus->link, &pmac_i2c_busses); + + printk(KERN_INFO " channel %d bus \n", channel); + } } #endif /* CONFIG_ADB_PMU */ -void __init pmac_init_low_i2c(void) + +/* + * + * SMU implementation + * + */ + +#ifdef CONFIG_PMAC_SMU + +static void smu_i2c_complete(struct smu_i2c_cmd *cmd, void *misc) { - struct device_node *np; + complete(misc); +} - /* Probe keywest-i2c busses */ - np = of_find_compatible_node(NULL, "i2c", "keywest-i2c"); - while(np) { - keywest_low_i2c_add(np); - np = of_find_compatible_node(np, "i2c", "keywest-i2c"); +static int smu_i2c_xfer(struct pmac_i2c_bus *bus, u8 addrdir, int subsize, + u32 subaddr, u8 *data, int len) +{ + struct smu_i2c_cmd *cmd = bus->hostdata; + struct completion comp; + int read = addrdir & 1; + int rc = 0; + + memset(cmd, 0, sizeof(struct smu_i2c_cmd)); + cmd->info.bus = bus->channel; + cmd->info.devaddr = addrdir; + cmd->info.datalen = len; + + switch(bus->mode) { + case pmac_i2c_mode_std: + if (subsize != 0) + return -EINVAL; + cmd->info.type = SMU_I2C_TRANSFER_SIMPLE; + break; + case pmac_i2c_mode_stdsub: + case pmac_i2c_mode_combined: + if (subsize > 3 || subsize < 1) + return -EINVAL; + cmd->info.sublen = subsize; + /* that's big-endian only but heh ! */ + memcpy(&cmd->info.subaddr, ((char *)&subaddr) + (4 - subsize), + subsize); + if (bus->mode == pmac_i2c_mode_stdsub) + cmd->info.type = SMU_I2C_TRANSFER_STDSUB; + else + cmd->info.type = SMU_I2C_TRANSFER_COMBINED; + break; + default: + return -EINVAL; } + if (!read) + memcpy(cmd->info.data, data, len); -#ifdef CONFIG_ADB_PMU - /* Probe PMU busses */ - np = of_find_node_by_name(NULL, "via-pmu"); - if (np) - pmu_low_i2c_add(np); -#endif /* CONFIG_ADB_PMU */ + init_completion(&comp); + cmd->done = smu_i2c_complete; + cmd->misc = ∁ + rc = smu_queue_i2c(cmd); + if (rc < 0) + return rc; + wait_for_completion(&comp); + rc = cmd->status; + + if (read) + memcpy(data, cmd->info.data, len); + return rc < 0 ? rc : 0; +} + +static void __init smu_i2c_probe(void) +{ + struct device_node *controller, *busnode; + struct pmac_i2c_bus *bus; + u32 *reg; + int sz; + + if (!smu_present()) + return; + + controller = of_find_node_by_name(NULL, "smu_i2c_control"); + if (controller == NULL) + controller = of_find_node_by_name(NULL, "smu"); + if (controller == NULL) + return; + + printk(KERN_INFO "SMU i2c %s\n", controller->full_name); + + /* Look for childs, note that they might not be of the right + * type as older device trees mix i2c busses and other thigns + * at the same level + */ + for (busnode = NULL; + (busnode = of_get_next_child(controller, busnode)) != NULL;) { + if (strcmp(busnode->type, "i2c") && + strcmp(busnode->type, "i2c-bus")) + continue; + reg = (u32 *)get_property(busnode, "reg", NULL); + if (reg == NULL) + continue; + + sz = sizeof(struct pmac_i2c_bus) + sizeof(struct smu_i2c_cmd); + bus = kzalloc(sz, GFP_KERNEL); + if (bus == NULL) + return; + + bus->controller = controller; + bus->busnode = of_node_get(busnode); + bus->type = pmac_i2c_bus_smu; + bus->channel = *reg; + bus->mode = pmac_i2c_mode_std; + bus->hostdata = bus + 1; + bus->xfer = smu_i2c_xfer; + init_MUTEX(&bus->sem); + bus->flags = 0; + list_add(&bus->link, &pmac_i2c_busses); + + printk(KERN_INFO " channel %x bus %s\n", + bus->channel, busnode->full_name); + } +} + +#endif /* CONFIG_PMAC_SMU */ + +/* + * + * Core code + * + */ + + +struct pmac_i2c_bus *pmac_i2c_find_bus(struct device_node *node) +{ + struct device_node *p = of_node_get(node); + struct device_node *prev = NULL; + struct pmac_i2c_bus *bus; + + while(p) { + list_for_each_entry(bus, &pmac_i2c_busses, link) { + if (p == bus->busnode) { + if (prev && bus->flags & pmac_i2c_multibus) { + u32 *reg; + reg = (u32 *)get_property(prev, "reg", + NULL); + if (!reg) + continue; + if (((*reg) >> 8) != bus->channel) + continue; + } + of_node_put(p); + of_node_put(prev); + return bus; + } + } + of_node_put(prev); + prev = p; + p = of_get_parent(p); + } + return NULL; +} +EXPORT_SYMBOL_GPL(pmac_i2c_find_bus); + +u8 pmac_i2c_get_dev_addr(struct device_node *device) +{ + u32 *reg = (u32 *)get_property(device, "reg", NULL); + + if (reg == NULL) + return 0; + + return (*reg) & 0xff; +} +EXPORT_SYMBOL_GPL(pmac_i2c_get_dev_addr); + +struct device_node *pmac_i2c_get_controller(struct pmac_i2c_bus *bus) +{ + return bus->controller; +} +EXPORT_SYMBOL_GPL(pmac_i2c_get_controller); + +struct device_node *pmac_i2c_get_bus_node(struct pmac_i2c_bus *bus) +{ + return bus->busnode; +} +EXPORT_SYMBOL_GPL(pmac_i2c_get_bus_node); + +int pmac_i2c_get_type(struct pmac_i2c_bus *bus) +{ + return bus->type; +} +EXPORT_SYMBOL_GPL(pmac_i2c_get_type); + +int pmac_i2c_get_flags(struct pmac_i2c_bus *bus) +{ + return bus->flags; +} +EXPORT_SYMBOL_GPL(pmac_i2c_get_flags); + +void pmac_i2c_attach_adapter(struct pmac_i2c_bus *bus, + struct i2c_adapter *adapter) +{ + WARN_ON(bus->adapter != NULL); + bus->adapter = adapter; +} +EXPORT_SYMBOL_GPL(pmac_i2c_attach_adapter); + +void pmac_i2c_detach_adapter(struct pmac_i2c_bus *bus, + struct i2c_adapter *adapter) +{ + WARN_ON(bus->adapter != adapter); + bus->adapter = NULL; +} +EXPORT_SYMBOL_GPL(pmac_i2c_detach_adapter); + +struct i2c_adapter *pmac_i2c_get_adapter(struct pmac_i2c_bus *bus) +{ + return bus->adapter; +} +EXPORT_SYMBOL_GPL(pmac_i2c_get_adapter); + +extern int pmac_i2c_match_adapter(struct device_node *dev, + struct i2c_adapter *adapter) +{ + struct pmac_i2c_bus *bus = pmac_i2c_find_bus(dev); - /* TODO: Add CUDA support as well */ + if (bus == NULL) + return 0; + return (bus->adapter == adapter); } +EXPORT_SYMBOL_GPL(pmac_i2c_match_adapter); int pmac_low_i2c_lock(struct device_node *np) { - struct low_i2c_host *host = find_low_i2c_host(np); + struct pmac_i2c_bus *bus, *found = NULL; - if (!host) + list_for_each_entry(bus, &pmac_i2c_busses, link) { + if (np == bus->controller) { + found = bus; + break; + } + } + if (!found) return -ENODEV; - down(&host->mutex); - return 0; + return pmac_i2c_open(bus, 0); } -EXPORT_SYMBOL(pmac_low_i2c_lock); +EXPORT_SYMBOL_GPL(pmac_low_i2c_lock); int pmac_low_i2c_unlock(struct device_node *np) { - struct low_i2c_host *host = find_low_i2c_host(np); + struct pmac_i2c_bus *bus, *found = NULL; - if (!host) + list_for_each_entry(bus, &pmac_i2c_busses, link) { + if (np == bus->controller) { + found = bus; + break; + } + } + if (!found) return -ENODEV; - up(&host->mutex); + pmac_i2c_close(bus); return 0; } -EXPORT_SYMBOL(pmac_low_i2c_unlock); +EXPORT_SYMBOL_GPL(pmac_low_i2c_unlock); -int pmac_low_i2c_open(struct device_node *np, int channel) +int pmac_i2c_open(struct pmac_i2c_bus *bus, int polled) { - struct low_i2c_host *host = find_low_i2c_host(np); - - if (!host) - return -ENODEV; - - if (channel >= host->num_channels) - return -EINVAL; - - down(&host->mutex); - host->is_open = 1; - host->channel = channel; + int rc; + down(&bus->sem); + bus->polled = polled; + bus->opened = 1; + bus->mode = pmac_i2c_mode_std; + if (bus->open && (rc = bus->open(bus)) != 0) { + bus->opened = 0; + up(&bus->sem); + return rc; + } return 0; } -EXPORT_SYMBOL(pmac_low_i2c_open); +EXPORT_SYMBOL_GPL(pmac_i2c_open); -int pmac_low_i2c_close(struct device_node *np) +void pmac_i2c_close(struct pmac_i2c_bus *bus) { - struct low_i2c_host *host = find_low_i2c_host(np); + WARN_ON(!bus->opened); + if (bus->close) + bus->close(bus); + bus->opened = 0; + up(&bus->sem); +} +EXPORT_SYMBOL_GPL(pmac_i2c_close); - if (!host) - return -ENODEV; +int pmac_i2c_setmode(struct pmac_i2c_bus *bus, int mode) +{ + WARN_ON(!bus->opened); - host->is_open = 0; - up(&host->mutex); + /* Report me if you see the error below as there might be a new + * "combined4" mode that I need to implement for the SMU bus + */ + if (mode < pmac_i2c_mode_dumb || mode > pmac_i2c_mode_combined) { + printk(KERN_ERR "low_i2c: Invalid mode %d requested on" + " bus %s !\n", mode, bus->busnode->full_name); + return -EINVAL; + } + bus->mode = mode; return 0; } -EXPORT_SYMBOL(pmac_low_i2c_close); +EXPORT_SYMBOL_GPL(pmac_i2c_setmode); -int pmac_low_i2c_setmode(struct device_node *np, int mode) +int pmac_i2c_xfer(struct pmac_i2c_bus *bus, u8 addrdir, int subsize, + u32 subaddr, u8 *data, int len) { - struct low_i2c_host *host = find_low_i2c_host(np); + int rc; - if (!host) - return -ENODEV; - WARN_ON(!host->is_open); - host->mode = mode; + WARN_ON(!bus->opened); - return 0; + DBG("xfer() chan=%d, addrdir=0x%x, mode=%d, subsize=%d, subaddr=0x%x," + " %d bytes, bus %s\n", bus->channel, addrdir, bus->mode, subsize, + subaddr, len, bus->busnode->full_name); + + rc = bus->xfer(bus, addrdir, subsize, subaddr, data, len); + +#ifdef DEBUG + if (rc) + DBG("xfer error %d\n", rc); +#endif + return rc; } -EXPORT_SYMBOL(pmac_low_i2c_setmode); +EXPORT_SYMBOL_GPL(pmac_i2c_xfer); -int pmac_low_i2c_xfer(struct device_node *np, u8 addrdir, u8 subaddr, u8 *data, int len) +/* + * Initialize us: probe all i2c busses on the machine and instantiate + * busses. + */ +/* This is non-static as it might be called early by smp code */ +int __init pmac_i2c_init(void) { - struct low_i2c_host *host = find_low_i2c_host(np); + static int i2c_inited; - if (!host) - return -ENODEV; - WARN_ON(!host->is_open); + if (i2c_inited) + return 0; + i2c_inited = 1; + + /* Probe keywest-i2c busses */ + kw_i2c_probe(); - return host->func(host, addrdir, subaddr, data, len); +#ifdef CONFIG_ADB_PMU + pmu_i2c_probe(); +#endif + +#ifdef CONFIG_PMAC_SMU + smu_i2c_probe(); +#endif + + return 0; } -EXPORT_SYMBOL(pmac_low_i2c_xfer); +arch_initcall(pmac_i2c_init); Index: linux-work/include/asm-powerpc/pmac_low_i2c.h =================================================================== --- linux-work.orig/include/asm-powerpc/pmac_low_i2c.h 2006-01-06 19:39:44.000000000 +1100 +++ linux-work/include/asm-powerpc/pmac_low_i2c.h 2006-01-07 11:25:18.000000000 +1100 @@ -15,30 +15,87 @@ /* i2c mode (based on the platform functions format) */ enum { - pmac_low_i2c_mode_dumb = 1, - pmac_low_i2c_mode_std = 2, - pmac_low_i2c_mode_stdsub = 3, - pmac_low_i2c_mode_combined = 4, + pmac_i2c_mode_dumb = 1, + pmac_i2c_mode_std = 2, + pmac_i2c_mode_stdsub = 3, + pmac_i2c_mode_combined = 4, }; /* RW bit in address */ enum { - pmac_low_i2c_read = 0x01, - pmac_low_i2c_write = 0x00 + pmac_i2c_read = 0x01, + pmac_i2c_write = 0x00 }; +/* i2c bus type */ +enum { + pmac_i2c_bus_keywest = 0, + pmac_i2c_bus_pmu = 1, + pmac_i2c_bus_smu = 2, +}; + +/* i2c bus features */ +enum { + /* can_largesub : supports >1 byte subaddresses (SMU only) */ + pmac_i2c_can_largesub = 0x00000001u, + + /* multibus : device node holds multiple busses, bus number is + * encoded in bits 0xff00 of "reg" of a given device + */ + pmac_i2c_multibus = 0x00000002u, +}; + +/* i2c busses in the system */ +struct pmac_i2c_bus; +struct i2c_adapter; + /* Init, called early during boot */ -extern void pmac_init_low_i2c(void); +extern int pmac_i2c_init(void); -/* Locking functions exposed to i2c-keywest */ -int pmac_low_i2c_lock(struct device_node *np); -int pmac_low_i2c_unlock(struct device_node *np); +/* Lookup an i2c bus for a device-node. The node can be either the bus + * node itself or a device below it. In the case of a multibus, the bus + * node itself is the controller node, else, it's a child of the controller + * node + */ +extern struct pmac_i2c_bus *pmac_i2c_find_bus(struct device_node *node); + +/* Get the address for an i2c device. This strips the bus number if + * necessary. The 7 bits address is returned 1 bit right shifted so that the + * direction can be directly ored in + */ +extern u8 pmac_i2c_get_dev_addr(struct device_node *device); + +/* Get infos about a bus */ +extern struct device_node *pmac_i2c_get_controller(struct pmac_i2c_bus *bus); +extern struct device_node *pmac_i2c_get_bus_node(struct pmac_i2c_bus *bus); +extern int pmac_i2c_get_type(struct pmac_i2c_bus *bus); +extern int pmac_i2c_get_flags(struct pmac_i2c_bus *bus); + +/* i2c layer adapter attach/detach */ +extern void pmac_i2c_attach_adapter(struct pmac_i2c_bus *bus, + struct i2c_adapter *adapter); +extern void pmac_i2c_detach_adapter(struct pmac_i2c_bus *bus, + struct i2c_adapter *adapter); +extern struct i2c_adapter *pmac_i2c_get_adapter(struct pmac_i2c_bus *bus); + +/* March a device or bus with an i2c adapter structure, to be used by drivers + * to match device-tree nodes with i2c adapters during adapter discovery + * callbacks + */ +extern int pmac_i2c_match_adapter(struct device_node *dev, + struct i2c_adapter *adapter); + + +/* (legacy) Locking functions exposed to i2c-keywest */ +extern int pmac_low_i2c_lock(struct device_node *np); +extern int pmac_low_i2c_unlock(struct device_node *np); /* Access functions for platform code */ -int pmac_low_i2c_open(struct device_node *np, int channel); -int pmac_low_i2c_close(struct device_node *np); -int pmac_low_i2c_setmode(struct device_node *np, int mode); -int pmac_low_i2c_xfer(struct device_node *np, u8 addrdir, u8 subaddr, u8 *data, int len); +extern int pmac_i2c_open(struct pmac_i2c_bus *bus, int polled); +extern void pmac_i2c_close(struct pmac_i2c_bus *bus); +extern int pmac_i2c_setmode(struct pmac_i2c_bus *bus, int mode); +extern int pmac_i2c_xfer(struct pmac_i2c_bus *bus, u8 addrdir, int subsize, + u32 subaddr, u8 *data, int len); #endif /* __KERNEL__ */ Index: linux-work/arch/powerpc/platforms/powermac/smp.c =================================================================== --- linux-work.orig/arch/powerpc/platforms/powermac/smp.c 2006-01-06 19:39:44.000000000 +1100 +++ linux-work/arch/powerpc/platforms/powermac/smp.c 2006-01-07 11:25:16.000000000 +1100 @@ -482,7 +482,7 @@ static void __devinit smp_core99_take_ti /* * G5s enable/disable the timebase via an i2c-connected clock chip. */ -static struct device_node *pmac_tb_clock_chip_host; +static struct pmac_i2c_bus *pmac_tb_clock_chip_host; static u8 pmac_tb_pulsar_addr; static void smp_core99_cypress_tb_freeze(int freeze) @@ -493,20 +493,20 @@ static void smp_core99_cypress_tb_freeze /* Strangely, the device-tree says address is 0xd2, but darwin * accesses 0xd0 ... */ - pmac_low_i2c_setmode(pmac_tb_clock_chip_host, - pmac_low_i2c_mode_combined); - rc = pmac_low_i2c_xfer(pmac_tb_clock_chip_host, - 0xd0 | pmac_low_i2c_read, - 0x81, &data, 1); + pmac_i2c_setmode(pmac_tb_clock_chip_host, + pmac_i2c_mode_combined); + rc = pmac_i2c_xfer(pmac_tb_clock_chip_host, + 0xd0 | pmac_i2c_read, + 1, 0x81, &data, 1); if (rc != 0) goto bail; data = (data & 0xf3) | (freeze ? 0x00 : 0x0c); - pmac_low_i2c_setmode(pmac_tb_clock_chip_host, pmac_low_i2c_mode_stdsub); - rc = pmac_low_i2c_xfer(pmac_tb_clock_chip_host, - 0xd0 | pmac_low_i2c_write, - 0x81, &data, 1); + pmac_i2c_setmode(pmac_tb_clock_chip_host, pmac_i2c_mode_stdsub); + rc = pmac_i2c_xfer(pmac_tb_clock_chip_host, + 0xd0 | pmac_i2c_write, + 1, 0x81, &data, 1); bail: if (rc != 0) { @@ -522,20 +522,20 @@ static void smp_core99_pulsar_tb_freeze( u8 data; int rc; - pmac_low_i2c_setmode(pmac_tb_clock_chip_host, - pmac_low_i2c_mode_combined); - rc = pmac_low_i2c_xfer(pmac_tb_clock_chip_host, - pmac_tb_pulsar_addr | pmac_low_i2c_read, - 0x2e, &data, 1); + pmac_i2c_setmode(pmac_tb_clock_chip_host, + pmac_i2c_mode_combined); + rc = pmac_i2c_xfer(pmac_tb_clock_chip_host, + pmac_tb_pulsar_addr | pmac_i2c_read, + 1, 0x2e, &data, 1); if (rc != 0) goto bail; data = (data & 0x88) | (freeze ? 0x11 : 0x22); - pmac_low_i2c_setmode(pmac_tb_clock_chip_host, pmac_low_i2c_mode_stdsub); - rc = pmac_low_i2c_xfer(pmac_tb_clock_chip_host, - pmac_tb_pulsar_addr | pmac_low_i2c_write, - 0x2e, &data, 1); + pmac_i2c_setmode(pmac_tb_clock_chip_host, pmac_i2c_mode_stdsub); + rc = pmac_i2c_xfer(pmac_tb_clock_chip_host, + pmac_tb_pulsar_addr | pmac_i2c_write, + 1, 0x2e, &data, 1); bail: if (rc != 0) { printk(KERN_ERR "Pulsar Timebase %s rc: %d\n", @@ -560,13 +560,15 @@ static void __init smp_core99_setup_i2c_ if (!ok) continue; + pmac_tb_clock_chip_host = pmac_i2c_find_bus(cc); + if (pmac_tb_clock_chip_host == NULL) + continue; reg = (u32 *)get_property(cc, "reg", NULL); if (reg == NULL) continue; - switch (*reg) { case 0xd2: - if (device_is_compatible(cc, "pulsar-legacy-slewing")) { + if (device_is_compatible(cc,"pulsar-legacy-slewing")) { pmac_tb_freeze = smp_core99_pulsar_tb_freeze; pmac_tb_pulsar_addr = 0xd2; name = "Pulsar"; @@ -585,30 +587,19 @@ static void __init smp_core99_setup_i2c_ break; } if (pmac_tb_freeze != NULL) { - struct device_node *p = of_get_parent(cc); - of_node_put(cc); - while(p && strcmp(p->type, "i2c")) { - cc = of_get_parent(p); - of_node_put(p); - p = cc; - } - if (p == NULL) - goto no_i2c_sync; /* Open i2c bus for synchronous access */ - if (pmac_low_i2c_open(p, 0)) { - printk(KERN_ERR "Failed top open i2c bus %s for clock" - " sync, fallback to software sync !\n", - p->full_name); - of_node_put(p); + if (pmac_i2c_open(pmac_tb_clock_chip_host, 1)) { + printk(KERN_ERR "Failed top open i2c bus for clock" + " sync, fallback to software sync !\n"); goto no_i2c_sync; } - pmac_tb_clock_chip_host = p; printk(KERN_INFO "Processor timebase sync using %s i2c clock\n", name); return; } no_i2c_sync: pmac_tb_freeze = NULL; + pmac_tb_clock_chip_host = NULL; } #endif /* CONFIG_PPC64 */ @@ -752,8 +743,18 @@ static int __init smp_core99_probe(void) if (ncpus <= 1) return 1; + /* We need to perform some early initialisations before we can start + * setting up SMP as we are running before initcalls + */ + pmac_i2c_init(); + + /* Setup various bits like timebase sync method, ability to nap, ... */ smp_core99_setup(ncpus); + + /* Install IPIs */ mpic_request_ipis(); + + /* Collect l2cr and l3cr values from CPU 0 */ core99_init_caches(0); return ncpus; @@ -817,7 +818,7 @@ static void __devinit smp_core99_setup_c /* Close i2c bus if it was used for tb sync */ if (pmac_tb_clock_chip_host) { - pmac_low_i2c_close(pmac_tb_clock_chip_host); + pmac_i2c_close(pmac_tb_clock_chip_host); pmac_tb_clock_chip_host = NULL; } Index: linux-work/drivers/macintosh/via-pmu.c =================================================================== --- linux-work.orig/drivers/macintosh/via-pmu.c 2006-01-06 19:39:44.000000000 +1100 +++ linux-work/drivers/macintosh/via-pmu.c 2006-01-07 11:25:16.000000000 +1100 @@ -197,7 +197,6 @@ static int pmu_adb_reset_bus(void); #endif /* CONFIG_ADB */ static int init_pmu(void); -static int pmu_queue_request(struct adb_request *req); static void pmu_start(void); static irqreturn_t via_pmu_interrupt(int irq, void *arg, struct pt_regs *regs); static irqreturn_t gpio1_interrupt(int irq, void *arg, struct pt_regs *regs); @@ -1802,258 +1801,6 @@ pmu_present(void) return via != 0; } -struct pmu_i2c_hdr { - u8 bus; - u8 mode; - u8 bus2; - u8 address; - u8 sub_addr; - u8 comb_addr; - u8 count; -}; - -int -pmu_i2c_combined_read(int bus, int addr, int subaddr, u8* data, int len) -{ - struct adb_request req; - struct pmu_i2c_hdr *hdr = (struct pmu_i2c_hdr *)&req.data[1]; - int retry; - int rc; - - for (retry=0; retry<16; retry++) { - memset(&req, 0, sizeof(req)); - - hdr->bus = bus; - hdr->address = addr & 0xfe; - hdr->mode = PMU_I2C_MODE_COMBINED; - hdr->bus2 = 0; - hdr->sub_addr = subaddr; - hdr->comb_addr = addr | 1; - hdr->count = len; - - req.nbytes = sizeof(struct pmu_i2c_hdr) + 1; - req.reply_expected = 0; - req.reply_len = 0; - req.data[0] = PMU_I2C_CMD; - req.reply[0] = 0xff; - rc = pmu_queue_request(&req); - if (rc) - return rc; - while(!req.complete) - pmu_poll(); - if (req.reply[0] == PMU_I2C_STATUS_OK) - break; - mdelay(15); - } - if (req.reply[0] != PMU_I2C_STATUS_OK) - return -1; - - for (retry=0; retry<16; retry++) { - memset(&req, 0, sizeof(req)); - - mdelay(15); - - hdr->bus = PMU_I2C_BUS_STATUS; - req.reply[0] = 0xff; - - req.nbytes = 2; - req.reply_expected = 0; - req.reply_len = 0; - req.data[0] = PMU_I2C_CMD; - rc = pmu_queue_request(&req); - if (rc) - return rc; - while(!req.complete) - pmu_poll(); - if (req.reply[0] == PMU_I2C_STATUS_DATAREAD) { - memcpy(data, &req.reply[1], req.reply_len - 1); - return req.reply_len - 1; - } - } - return -1; -} - -int -pmu_i2c_stdsub_write(int bus, int addr, int subaddr, u8* data, int len) -{ - struct adb_request req; - struct pmu_i2c_hdr *hdr = (struct pmu_i2c_hdr *)&req.data[1]; - int retry; - int rc; - - for (retry=0; retry<16; retry++) { - memset(&req, 0, sizeof(req)); - - hdr->bus = bus; - hdr->address = addr & 0xfe; - hdr->mode = PMU_I2C_MODE_STDSUB; - hdr->bus2 = 0; - hdr->sub_addr = subaddr; - hdr->comb_addr = addr & 0xfe; - hdr->count = len; - - req.data[0] = PMU_I2C_CMD; - memcpy(&req.data[sizeof(struct pmu_i2c_hdr) + 1], data, len); - req.nbytes = sizeof(struct pmu_i2c_hdr) + len + 1; - req.reply_expected = 0; - req.reply_len = 0; - req.reply[0] = 0xff; - rc = pmu_queue_request(&req); - if (rc) - return rc; - while(!req.complete) - pmu_poll(); - if (req.reply[0] == PMU_I2C_STATUS_OK) - break; - mdelay(15); - } - if (req.reply[0] != PMU_I2C_STATUS_OK) - return -1; - - for (retry=0; retry<16; retry++) { - memset(&req, 0, sizeof(req)); - - mdelay(15); - - hdr->bus = PMU_I2C_BUS_STATUS; - req.reply[0] = 0xff; - - req.nbytes = 2; - req.reply_expected = 0; - req.reply_len = 0; - req.data[0] = PMU_I2C_CMD; - rc = pmu_queue_request(&req); - if (rc) - return rc; - while(!req.complete) - pmu_poll(); - if (req.reply[0] == PMU_I2C_STATUS_OK) - return len; - } - return -1; -} - -int -pmu_i2c_simple_read(int bus, int addr, u8* data, int len) -{ - struct adb_request req; - struct pmu_i2c_hdr *hdr = (struct pmu_i2c_hdr *)&req.data[1]; - int retry; - int rc; - - for (retry=0; retry<16; retry++) { - memset(&req, 0, sizeof(req)); - - hdr->bus = bus; - hdr->address = addr | 1; - hdr->mode = PMU_I2C_MODE_SIMPLE; - hdr->bus2 = 0; - hdr->sub_addr = 0; - hdr->comb_addr = 0; - hdr->count = len; - - req.data[0] = PMU_I2C_CMD; - req.nbytes = sizeof(struct pmu_i2c_hdr) + 1; - req.reply_expected = 0; - req.reply_len = 0; - req.reply[0] = 0xff; - rc = pmu_queue_request(&req); - if (rc) - return rc; - while(!req.complete) - pmu_poll(); - if (req.reply[0] == PMU_I2C_STATUS_OK) - break; - mdelay(15); - } - if (req.reply[0] != PMU_I2C_STATUS_OK) - return -1; - - for (retry=0; retry<16; retry++) { - memset(&req, 0, sizeof(req)); - - mdelay(15); - - hdr->bus = PMU_I2C_BUS_STATUS; - req.reply[0] = 0xff; - - req.nbytes = 2; - req.reply_expected = 0; - req.reply_len = 0; - req.data[0] = PMU_I2C_CMD; - rc = pmu_queue_request(&req); - if (rc) - return rc; - while(!req.complete) - pmu_poll(); - if (req.reply[0] == PMU_I2C_STATUS_DATAREAD) { - memcpy(data, &req.reply[1], req.reply_len - 1); - return req.reply_len - 1; - } - } - return -1; -} - -int -pmu_i2c_simple_write(int bus, int addr, u8* data, int len) -{ - struct adb_request req; - struct pmu_i2c_hdr *hdr = (struct pmu_i2c_hdr *)&req.data[1]; - int retry; - int rc; - - for (retry=0; retry<16; retry++) { - memset(&req, 0, sizeof(req)); - - hdr->bus = bus; - hdr->address = addr & 0xfe; - hdr->mode = PMU_I2C_MODE_SIMPLE; - hdr->bus2 = 0; - hdr->sub_addr = 0; - hdr->comb_addr = 0; - hdr->count = len; - - req.data[0] = PMU_I2C_CMD; - memcpy(&req.data[sizeof(struct pmu_i2c_hdr) + 1], data, len); - req.nbytes = sizeof(struct pmu_i2c_hdr) + len + 1; - req.reply_expected = 0; - req.reply_len = 0; - req.reply[0] = 0xff; - rc = pmu_queue_request(&req); - if (rc) - return rc; - while(!req.complete) - pmu_poll(); - if (req.reply[0] == PMU_I2C_STATUS_OK) - break; - mdelay(15); - } - if (req.reply[0] != PMU_I2C_STATUS_OK) - return -1; - - for (retry=0; retry<16; retry++) { - memset(&req, 0, sizeof(req)); - - mdelay(15); - - hdr->bus = PMU_I2C_BUS_STATUS; - req.reply[0] = 0xff; - - req.nbytes = 2; - req.reply_expected = 0; - req.reply_len = 0; - req.data[0] = PMU_I2C_CMD; - rc = pmu_queue_request(&req); - if (rc) - return rc; - while(!req.complete) - pmu_poll(); - if (req.reply[0] == PMU_I2C_STATUS_OK) - return len; - } - return -1; -} - #ifdef CONFIG_PM static LIST_HEAD(sleep_notifiers); @@ -2358,9 +2105,6 @@ pmac_suspend_devices(void) return -EBUSY; } - /* Disable clock spreading on some machines */ - pmac_tweak_clock_spreading(0); - /* Stop preemption */ preempt_disable(); @@ -2431,9 +2175,6 @@ pmac_wakeup_devices(void) mdelay(10); preempt_enable(); - /* Re-enable clock spreading on some machines */ - pmac_tweak_clock_spreading(1); - /* Resume devices */ device_resume(); @@ -3150,16 +2891,13 @@ static int __init init_pmu_sysfs(void) subsys_initcall(init_pmu_sysfs); EXPORT_SYMBOL(pmu_request); +EXPORT_SYMBOL(pmu_queue_request); EXPORT_SYMBOL(pmu_poll); EXPORT_SYMBOL(pmu_poll_adb); EXPORT_SYMBOL(pmu_wait_complete); EXPORT_SYMBOL(pmu_suspend); EXPORT_SYMBOL(pmu_resume); EXPORT_SYMBOL(pmu_unlock); -EXPORT_SYMBOL(pmu_i2c_combined_read); -EXPORT_SYMBOL(pmu_i2c_stdsub_write); -EXPORT_SYMBOL(pmu_i2c_simple_read); -EXPORT_SYMBOL(pmu_i2c_simple_write); #if defined(CONFIG_PM) && defined(CONFIG_PPC32) EXPORT_SYMBOL(pmu_enable_irled); EXPORT_SYMBOL(pmu_battery_count); Index: linux-work/include/asm-powerpc/pmac_feature.h =================================================================== --- linux-work.orig/include/asm-powerpc/pmac_feature.h 2006-01-06 19:39:44.000000000 +1100 +++ linux-work/include/asm-powerpc/pmac_feature.h 2006-01-07 11:25:16.000000000 +1100 @@ -318,10 +318,6 @@ extern void pmac_register_agp_pm(struct extern void pmac_suspend_agp_for_card(struct pci_dev *dev); extern void pmac_resume_agp_for_card(struct pci_dev *dev); -/* Used by the via-pmu driver for suspend/resume - */ -extern void pmac_tweak_clock_spreading(int enable); - /* * The part below is for use by macio_asic.c only, do not rely * on the data structures or constants below in a normal driver Index: linux-work/include/linux/pmu.h =================================================================== --- linux-work.orig/include/linux/pmu.h 2006-01-06 19:39:44.000000000 +1100 +++ linux-work/include/linux/pmu.h 2006-01-06 19:39:47.000000000 +1100 @@ -140,7 +140,7 @@ extern int find_via_pmu(void); extern int pmu_request(struct adb_request *req, void (*done)(struct adb_request *), int nbytes, ...); - +extern int pmu_queue_request(struct adb_request *req); extern void pmu_poll(void); extern void pmu_poll_adb(void); /* For use by xmon */ extern void pmu_wait_complete(struct adb_request *req); @@ -160,12 +160,6 @@ extern void pmu_unlock(void); extern int pmu_present(void); extern int pmu_get_model(void); -extern int pmu_i2c_combined_read(int bus, int addr, int subaddr, u8* data, int len); -extern int pmu_i2c_stdsub_write(int bus, int addr, int subaddr, u8* data, int len); -extern int pmu_i2c_simple_read(int bus, int addr, u8* data, int len); -extern int pmu_i2c_simple_write(int bus, int addr, u8* data, int len); - - #ifdef CONFIG_PM /* * Stuff for putting the powerbook to sleep and waking it again. Index: linux-work/arch/powerpc/platforms/powermac/setup.c =================================================================== --- linux-work.orig/arch/powerpc/platforms/powermac/setup.c 2006-01-06 19:39:44.000000000 +1100 +++ linux-work/arch/powerpc/platforms/powermac/setup.c 2006-01-07 11:25:18.000000000 +1100 @@ -658,27 +658,22 @@ static int __init pmac_declare_of_platfo { struct device_node *np, *npp; - np = find_devices("uni-n"); - if (np) { - for (np = np->child; np != NULL; np = np->sibling) - if (strncmp(np->name, "i2c", 3) == 0) { - of_platform_device_create(np, "uni-n-i2c", - NULL); - break; - } - } - np = find_devices("valkyrie"); + np = of_find_node_by_name(NULL, "valkyrie"); if (np) of_platform_device_create(np, "valkyrie", NULL); - np = find_devices("platinum"); + np = of_find_node_by_name(NULL, "platinum"); if (np) of_platform_device_create(np, "platinum", NULL); - - npp = of_find_node_by_name(NULL, "u3"); + npp = of_find_node_by_name(NULL, "uni-n"); + if (npp == NULL) + npp = of_find_node_by_name(NULL, "u3"); + if (npp == NULL) + npp = of_find_node_by_name(NULL, "u4"); if (npp) { for (np = NULL; (np = of_get_next_child(npp, np)) != NULL;) { if (strncmp(np->name, "i2c", 3) == 0) { - of_platform_device_create(np, "u3-i2c", NULL); + of_platform_device_create(np, "uni-n-i2c", + NULL); of_node_put(np); break; } Index: linux-work/drivers/i2c/busses/i2c-pmac-smu.c =================================================================== --- linux-work.orig/drivers/i2c/busses/i2c-pmac-smu.c 2006-01-06 19:39:44.000000000 +1100 +++ linux-work/drivers/i2c/busses/i2c-pmac-smu.c 2006-01-07 11:25:18.000000000 +1100 @@ -103,8 +103,8 @@ static s32 smu_smbus_xfer( struct i2c_ad cmd.info.subaddr[1] = 0; cmd.info.subaddr[2] = 0; if (!read) { - cmd.info.data[0] = data->byte & 0xff; - cmd.info.data[1] = (data->byte >> 8) & 0xff; + cmd.info.data[0] = data->word & 0xff; + cmd.info.data[1] = (data->word >> 8) & 0xff; } break; /* Note that these are broken vs. the expected smbus API where @@ -116,7 +116,7 @@ static s32 smu_smbus_xfer( struct i2c_ad case I2C_SMBUS_BLOCK_DATA: cmd.info.type = SMU_I2C_TRANSFER_STDSUB; cmd.info.datalen = data->block[0] + 1; - if (cmd.info.datalen > 6) + if (cmd.info.datalen > (SMU_I2C_WRITE_MAX + 1)) return -EINVAL; if (!read) memcpy(cmd.info.data, data->block, cmd.info.datalen); @@ -273,7 +273,13 @@ static int dispose_iface(struct device * static int create_iface_of_platform(struct of_device* dev, const struct of_device_id *match) { - return create_iface(dev->node, &dev->dev); + struct device_node *node = dev->node; + + if (device_is_compatible(node, "smu-i2c") || + (node->parent != NULL && + device_is_compatible(node->parent, "smu-i2c-control"))) + return create_iface(node, &dev->dev); + return -ENODEV; } @@ -288,6 +294,9 @@ static struct of_device_id i2c_smu_match { .compatible = "smu-i2c", }, + { + .compatible = "i2c-bus", + }, {}, }; static struct of_platform_driver i2c_smu_of_platform_driver = Index: linux-work/drivers/macintosh/smu.c =================================================================== --- linux-work.orig/drivers/macintosh/smu.c 2006-01-06 19:39:44.000000000 +1100 +++ linux-work/drivers/macintosh/smu.c 2006-01-07 11:25:18.000000000 +1100 @@ -94,6 +94,8 @@ struct smu_device { static struct smu_device *smu; static DECLARE_MUTEX(smu_part_access); +static void smu_i2c_retry(unsigned long data); + /* * SMU driver low level stuff */ @@ -469,7 +471,6 @@ int __init smu_init (void) smu->of_node = np; smu->db_irq = NO_IRQ; smu->msg_irq = NO_IRQ; - init_timer(&smu->i2c_timer); /* smu_cmdbuf_abs is in the low 2G of RAM, can be converted to a * 32 bits value safely @@ -544,6 +545,10 @@ static int smu_late_init(void) if (!smu) return 0; + init_timer(&smu->i2c_timer); + smu->i2c_timer.function = smu_i2c_retry; + smu->i2c_timer.data = (unsigned long)smu; + /* * Try to request the interrupts */ @@ -570,28 +575,41 @@ static int smu_late_init(void) return 0; } -arch_initcall(smu_late_init); +/* This has to be before arch_initcall as the low i2c stuff relies on the + * above having been done before we reach arch_initcalls + */ +core_initcall(smu_late_init); /* * sysfs visibility */ +static void smu_create_i2c(struct device_node *np) +{ + char name[32]; + u32 *reg = (u32 *)get_property(np, "reg", NULL); + + if (reg != NULL) { + sprintf(name, "smu-i2c-%02x", *reg); + of_platform_device_create(np, name, &smu->of_dev->dev); + } +} + static void smu_expose_childs(void *unused) { - struct device_node *np; + struct device_node *np, *gp; for (np = NULL; (np = of_get_next_child(smu->of_node, np)) != NULL;) { - if (device_is_compatible(np, "smu-i2c")) { - char name[32]; - u32 *reg = (u32 *)get_property(np, "reg", NULL); - - if (reg == NULL) - continue; - sprintf(name, "smu-i2c-%02x", *reg); - of_platform_device_create(np, name, &smu->of_dev->dev); - } + if (device_is_compatible(np, "smu-i2c-control")) { + gp = NULL; + while ((gp = of_get_next_child(np, gp)) != NULL) + if (device_is_compatible(gp, "i2c-bus")) + smu_create_i2c(gp); + } else if (device_is_compatible(np, "smu-i2c")) + smu_create_i2c(np); if (device_is_compatible(np, "smu-sensors")) - of_platform_device_create(np, "smu-sensors", &smu->of_dev->dev); + of_platform_device_create(np, "smu-sensors", + &smu->of_dev->dev); } } @@ -712,13 +730,13 @@ static void smu_i2c_complete_command(str static void smu_i2c_retry(unsigned long data) { - struct smu_i2c_cmd *cmd = (struct smu_i2c_cmd *)data; + struct smu_i2c_cmd *cmd = smu->cmd_i2c_cur; DPRINTK("SMU: i2c failure, requeuing...\n"); /* requeue command simply by resetting reply_len */ cmd->pdata[0] = 0xff; - cmd->scmd.reply_len = 0x10; + cmd->scmd.reply_len = sizeof(cmd->pdata); smu_queue_cmd(&cmd->scmd); } @@ -747,10 +765,8 @@ static void smu_i2c_low_completion(struc */ if (fail && --cmd->retries > 0) { DPRINTK("SMU: i2c failure, starting timer...\n"); - smu->i2c_timer.function = smu_i2c_retry; - smu->i2c_timer.data = (unsigned long)cmd; - smu->i2c_timer.expires = jiffies + msecs_to_jiffies(5); - add_timer(&smu->i2c_timer); + BUG_ON(cmd != smu->cmd_i2c_cur); + mod_timer(&smu->i2c_timer, jiffies + msecs_to_jiffies(5)); return; } @@ -764,7 +780,7 @@ static void smu_i2c_low_completion(struc /* Ok, initial command complete, now poll status */ scmd->reply_buf = cmd->pdata; - scmd->reply_len = 0x10; + scmd->reply_len = sizeof(cmd->pdata); scmd->data_buf = cmd->pdata; scmd->data_len = 1; cmd->pdata[0] = 0; @@ -786,7 +802,7 @@ int smu_queue_i2c(struct smu_i2c_cmd *cm cmd->scmd.done = smu_i2c_low_completion; cmd->scmd.misc = cmd; cmd->scmd.reply_buf = cmd->pdata; - cmd->scmd.reply_len = 0x10; + cmd->scmd.reply_len = sizeof(cmd->pdata); cmd->scmd.data_buf = (u8 *)(char *)&cmd->info; cmd->scmd.status = 1; cmd->stage = 0; Index: linux-work/include/asm-powerpc/smu.h =================================================================== --- linux-work.orig/include/asm-powerpc/smu.h 2006-01-06 19:39:44.000000000 +1100 +++ linux-work/include/asm-powerpc/smu.h 2006-01-07 11:25:37.000000000 +1100 @@ -358,6 +358,9 @@ extern unsigned long smu_cmdbuf_abs; * Kenrel asynchronous i2c interface */ +#define SMU_I2C_READ_MAX 0x1d +#define SMU_I2C_WRITE_MAX 0x15 + /* SMU i2c header, exactly matches i2c header on wire */ struct smu_i2c_param { @@ -368,12 +371,9 @@ struct smu_i2c_param u8 subaddr[3]; /* subaddress */ u8 caddr; /* combined address, filled by SMU driver */ u8 datalen; /* length of transfer */ - u8 data[7]; /* data */ + u8 data[SMU_I2C_READ_MAX]; /* data */ }; -#define SMU_I2C_READ_MAX 0x0d -#define SMU_I2C_WRITE_MAX 0x05 - struct smu_i2c_cmd { /* public */ @@ -387,7 +387,7 @@ struct smu_i2c_cmd int read; int stage; int retries; - u8 pdata[0x10]; + u8 pdata[32]; struct list_head link; }; @@ -519,7 +519,7 @@ struct smu_sdbp_cpupiddata { * if not found. The data format is described below */ extern struct smu_sdbp_header *smu_get_sdb_partition(int id, - unsigned int *size); + unsigned int *size); #endif /* __KERNEL__ */ From benh at kernel.crashing.org Sat Jan 7 11:35:26 2006 From: benh at kernel.crashing.org (Benjamin Herrenschmidt) Date: Sat, 07 Jan 2006 11:35:26 +1100 Subject: [PATCH] 2/5 powerpc: Rework PowerMac i2c part 2 Message-ID: <1136594126.4840.167.camel@localhost.localdomain> This is the continuation of the previous patch. This one removes the old PowerMac i2c drivers (i2c-keywest and i2c-pmac-smu) and replaces them both with a single stub driver that uses the new PowerMac low i2c layer. Now that i2c-keywest is gone, the low-i2c code is extended to support interrupt driver transfers. All i2c busses now appear as platform devices. Compatibility with existing drivers should be maintained as the i2c bus names have been kept identical, except for the SMU bus but in that later case, all users has been fixed. With that patch added, matching a device node to an i2c_adapter becomes trivial. Signed-off-by: Benjamin Herrenschmidt Index: linux-work/drivers/i2c/busses/Kconfig =================================================================== --- linux-work.orig/drivers/i2c/busses/Kconfig 2006-01-06 19:42:48.000000000 +1100 +++ linux-work/drivers/i2c/busses/Kconfig 2006-01-06 19:43:28.000000000 +1100 @@ -236,27 +236,17 @@ config I2C_IXP2000 This support is also available as a module. If so, the module will be called i2c-ixp2000. -config I2C_KEYWEST - tristate "Powermac Keywest I2C interface" +config I2C_POWERMAC + tristate "Powermac I2C interface" depends on I2C && PPC_PMAC + default y help - This supports the use of the I2C interface in the combo-I/O - chip on recent Apple machines. Say Y if you have such a machine. - - This support is also available as a module. If so, the module - will be called i2c-keywest. - -config I2C_PMAC_SMU - tristate "Powermac SMU I2C interface" - depends on I2C && PMAC_SMU - help - This supports the use of the I2C interface in the SMU - chip on recent Apple machines like the iMac G5. It is used - among others by the thermal control driver for those machines. - Say Y if you have such a machine. + This exposes the various PowerMac i2c interfaces to the linux i2c + layer and to userland. It is used by various drivers on the powemac + platform, thus should generally be enabled. This support is also available as a module. If so, the module - will be called i2c-pmac-smu. + will be called i2c-powermac. config I2C_MPC tristate "MPC107/824x/85xx/52xx" Index: linux-work/drivers/i2c/busses/Makefile =================================================================== --- linux-work.orig/drivers/i2c/busses/Makefile 2006-01-06 19:42:48.000000000 +1100 +++ linux-work/drivers/i2c/busses/Makefile 2006-01-06 19:43:28.000000000 +1100 @@ -19,8 +19,7 @@ obj-$(CONFIG_I2C_ISA) += i2c-isa.o obj-$(CONFIG_I2C_ITE) += i2c-ite.o obj-$(CONFIG_I2C_IXP2000) += i2c-ixp2000.o obj-$(CONFIG_I2C_IXP4XX) += i2c-ixp4xx.o -obj-$(CONFIG_I2C_KEYWEST) += i2c-keywest.o -obj-$(CONFIG_I2C_PMAC_SMU) += i2c-pmac-smu.o +obj-$(CONFIG_I2C_POWERMAC) += i2c-powermac.o obj-$(CONFIG_I2C_MPC) += i2c-mpc.o obj-$(CONFIG_I2C_MV64XXX) += i2c-mv64xxx.o obj-$(CONFIG_I2C_NFORCE2) += i2c-nforce2.o Index: linux-work/drivers/i2c/busses/i2c-keywest.c =================================================================== --- linux-work.orig/drivers/i2c/busses/i2c-keywest.c 2006-01-06 19:42:48.000000000 +1100 +++ /dev/null 1970-01-01 00:00:00.000000000 +0000 @@ -1,754 +0,0 @@ -/* - i2c Support for Apple Keywest I2C Bus Controller - - Copyright (c) 2001 Benjamin Herrenschmidt - - Original work by - - Copyright (c) 2000 Philip Edelbrock - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - - Changes: - - 2001/12/13 BenH New implementation - 2001/12/15 BenH Add support for "byte" and "quick" - transfers. Add i2c_xfer routine. - 2003/09/21 BenH Rework state machine with Paulus help - 2004/01/21 BenH Merge in Greg KH changes, polled mode is back - 2004/02/05 BenH Merge 64 bits fixes from the g5 ppc64 tree - - My understanding of the various modes supported by keywest are: - - - Dumb mode : not implemented, probably direct tweaking of lines - - Standard mode : simple i2c transaction of type - S Addr R/W A Data A Data ... T - - Standard sub mode : combined 8 bit subaddr write with data read - S Addr R/W A SubAddr A Data A Data ... T - - Combined mode : Subaddress and Data sequences appended with no stop - S Addr R/W A SubAddr S Addr R/W A Data A Data ... T - - Currently, this driver uses only Standard mode for i2c xfer, and - smbus byte & quick transfers ; and uses StandardSub mode for - other smbus transfers instead of combined as we need that for the - sound driver to be happy -*/ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include - -#include "i2c-keywest.h" - -#undef POLLED_MODE - -/* Some debug macros */ -#define WRONG_STATE(name) do {\ - pr_debug("KW: wrong state. Got %s, state: %s (isr: %02x)\n", \ - name, __kw_state_names[iface->state], isr); \ - } while(0) - -#ifdef DEBUG -static const char *__kw_state_names[] = { - "state_idle", - "state_addr", - "state_read", - "state_write", - "state_stop", - "state_dead" -}; -#endif /* DEBUG */ - -MODULE_AUTHOR("Benjamin Herrenschmidt "); -MODULE_DESCRIPTION("I2C driver for Apple's Keywest"); -MODULE_LICENSE("GPL"); - -#ifdef POLLED_MODE -/* Don't schedule, the g5 fan controller is too - * timing sensitive - */ -static u8 -wait_interrupt(struct keywest_iface* iface) -{ - int i; - u8 isr; - - for (i = 0; i < 200000; i++) { - isr = read_reg(reg_isr) & KW_I2C_IRQ_MASK; - if (isr != 0) - return isr; - udelay(10); - } - return isr; -} -#endif /* POLLED_MODE */ - -static void -do_stop(struct keywest_iface* iface, int result) -{ - write_reg(reg_control, KW_I2C_CTL_STOP); - iface->state = state_stop; - iface->result = result; -} - -/* Main state machine for standard & standard sub mode */ -static void -handle_interrupt(struct keywest_iface *iface, u8 isr) -{ - int ack; - - if (isr == 0) { - if (iface->state != state_stop) { - pr_debug("KW: Timeout !\n"); - do_stop(iface, -EIO); - } - if (iface->state == state_stop) { - ack = read_reg(reg_status); - if (!(ack & KW_I2C_STAT_BUSY)) { - iface->state = state_idle; - write_reg(reg_ier, 0x00); -#ifndef POLLED_MODE - complete(&iface->complete); -#endif /* POLLED_MODE */ - } - } - return; - } - - if (isr & KW_I2C_IRQ_ADDR) { - ack = read_reg(reg_status); - if (iface->state != state_addr) { - write_reg(reg_isr, KW_I2C_IRQ_ADDR); - WRONG_STATE("KW_I2C_IRQ_ADDR"); - do_stop(iface, -EIO); - return; - } - if ((ack & KW_I2C_STAT_LAST_AAK) == 0) { - iface->state = state_stop; - iface->result = -ENODEV; - pr_debug("KW: NAK on address\n"); - } else { - /* Handle rw "quick" mode */ - if (iface->datalen == 0) { - do_stop(iface, 0); - } else if (iface->read_write == I2C_SMBUS_READ) { - iface->state = state_read; - if (iface->datalen > 1) - write_reg(reg_control, KW_I2C_CTL_AAK); - } else { - iface->state = state_write; - write_reg(reg_data, *(iface->data++)); - iface->datalen--; - } - } - write_reg(reg_isr, KW_I2C_IRQ_ADDR); - } - - if (isr & KW_I2C_IRQ_DATA) { - if (iface->state == state_read) { - *(iface->data++) = read_reg(reg_data); - write_reg(reg_isr, KW_I2C_IRQ_DATA); - iface->datalen--; - if (iface->datalen == 0) - iface->state = state_stop; - else if (iface->datalen == 1) - write_reg(reg_control, 0); - } else if (iface->state == state_write) { - /* Check ack status */ - ack = read_reg(reg_status); - if ((ack & KW_I2C_STAT_LAST_AAK) == 0) { - pr_debug("KW: nack on data write (%x): %x\n", - iface->data[-1], ack); - do_stop(iface, -EIO); - } else if (iface->datalen) { - write_reg(reg_data, *(iface->data++)); - iface->datalen--; - } else { - write_reg(reg_control, KW_I2C_CTL_STOP); - iface->state = state_stop; - iface->result = 0; - } - write_reg(reg_isr, KW_I2C_IRQ_DATA); - } else { - write_reg(reg_isr, KW_I2C_IRQ_DATA); - WRONG_STATE("KW_I2C_IRQ_DATA"); - if (iface->state != state_stop) - do_stop(iface, -EIO); - } - } - - if (isr & KW_I2C_IRQ_STOP) { - write_reg(reg_isr, KW_I2C_IRQ_STOP); - if (iface->state != state_stop) { - WRONG_STATE("KW_I2C_IRQ_STOP"); - iface->result = -EIO; - } - iface->state = state_idle; - write_reg(reg_ier, 0x00); -#ifndef POLLED_MODE - complete(&iface->complete); -#endif /* POLLED_MODE */ - } - - if (isr & KW_I2C_IRQ_START) - write_reg(reg_isr, KW_I2C_IRQ_START); -} - -#ifndef POLLED_MODE - -/* Interrupt handler */ -static irqreturn_t -keywest_irq(int irq, void *dev_id, struct pt_regs *regs) -{ - struct keywest_iface *iface = (struct keywest_iface *)dev_id; - unsigned long flags; - - spin_lock_irqsave(&iface->lock, flags); - del_timer(&iface->timeout_timer); - handle_interrupt(iface, read_reg(reg_isr)); - if (iface->state != state_idle) { - iface->timeout_timer.expires = jiffies + POLL_TIMEOUT; - add_timer(&iface->timeout_timer); - } - spin_unlock_irqrestore(&iface->lock, flags); - return IRQ_HANDLED; -} - -static void -keywest_timeout(unsigned long data) -{ - struct keywest_iface *iface = (struct keywest_iface *)data; - unsigned long flags; - - pr_debug("timeout !\n"); - spin_lock_irqsave(&iface->lock, flags); - handle_interrupt(iface, read_reg(reg_isr)); - if (iface->state != state_idle) { - iface->timeout_timer.expires = jiffies + POLL_TIMEOUT; - add_timer(&iface->timeout_timer); - } - spin_unlock_irqrestore(&iface->lock, flags); -} - -#endif /* POLLED_MODE */ - -/* - * SMBUS-type transfer entrypoint - */ -static s32 -keywest_smbus_xfer( struct i2c_adapter* adap, - u16 addr, - unsigned short flags, - char read_write, - u8 command, - int size, - union i2c_smbus_data* data) -{ - struct keywest_chan* chan = i2c_get_adapdata(adap); - struct keywest_iface* iface = chan->iface; - int len; - u8* buffer; - u16 cur_word; - int rc = 0; - - if (iface->state == state_dead) - return -ENXIO; - - /* Prepare datas & select mode */ - iface->cur_mode &= ~KW_I2C_MODE_MODE_MASK; - switch (size) { - case I2C_SMBUS_QUICK: - len = 0; - buffer = NULL; - iface->cur_mode |= KW_I2C_MODE_STANDARD; - break; - case I2C_SMBUS_BYTE: - len = 1; - buffer = &data->byte; - iface->cur_mode |= KW_I2C_MODE_STANDARD; - break; - case I2C_SMBUS_BYTE_DATA: - len = 1; - buffer = &data->byte; - iface->cur_mode |= KW_I2C_MODE_STANDARDSUB; - break; - case I2C_SMBUS_WORD_DATA: - len = 2; - cur_word = cpu_to_le16(data->word); - buffer = (u8 *)&cur_word; - iface->cur_mode |= KW_I2C_MODE_STANDARDSUB; - break; - case I2C_SMBUS_BLOCK_DATA: - len = data->block[0]; - buffer = &data->block[1]; - iface->cur_mode |= KW_I2C_MODE_STANDARDSUB; - break; - default: - return -1; - } - - /* Turn a standardsub read into a combined mode access */ - if (read_write == I2C_SMBUS_READ - && (iface->cur_mode & KW_I2C_MODE_MODE_MASK) == KW_I2C_MODE_STANDARDSUB) { - iface->cur_mode &= ~KW_I2C_MODE_MODE_MASK; - iface->cur_mode |= KW_I2C_MODE_COMBINED; - } - - /* Original driver had this limitation */ - if (len > 32) - len = 32; - - if (pmac_low_i2c_lock(iface->node)) - return -ENXIO; - - pr_debug("chan: %d, addr: 0x%x, transfer len: %d, read: %d\n", - chan->chan_no, addr, len, read_write == I2C_SMBUS_READ); - - iface->data = buffer; - iface->datalen = len; - iface->state = state_addr; - iface->result = 0; - iface->read_write = read_write; - - /* Setup channel & clear pending irqs */ - write_reg(reg_isr, read_reg(reg_isr)); - write_reg(reg_mode, iface->cur_mode | (chan->chan_no << 4)); - write_reg(reg_status, 0); - - /* Set up address and r/w bit */ - write_reg(reg_addr, - (addr << 1) | ((read_write == I2C_SMBUS_READ) ? 0x01 : 0x00)); - - /* Set up the sub address */ - if ((iface->cur_mode & KW_I2C_MODE_MODE_MASK) == KW_I2C_MODE_STANDARDSUB - || (iface->cur_mode & KW_I2C_MODE_MODE_MASK) == KW_I2C_MODE_COMBINED) - write_reg(reg_subaddr, command); - -#ifndef POLLED_MODE - /* Arm timeout */ - iface->timeout_timer.expires = jiffies + POLL_TIMEOUT; - add_timer(&iface->timeout_timer); -#endif - - /* Start sending address & enable interrupt*/ - write_reg(reg_control, KW_I2C_CTL_XADDR); - write_reg(reg_ier, KW_I2C_IRQ_MASK); - -#ifdef POLLED_MODE - pr_debug("using polled mode...\n"); - /* State machine, to turn into an interrupt handler */ - while(iface->state != state_idle) { - unsigned long flags; - - u8 isr = wait_interrupt(iface); - spin_lock_irqsave(&iface->lock, flags); - handle_interrupt(iface, isr); - spin_unlock_irqrestore(&iface->lock, flags); - } -#else /* POLLED_MODE */ - pr_debug("using interrupt mode...\n"); - wait_for_completion(&iface->complete); -#endif /* POLLED_MODE */ - - rc = iface->result; - pr_debug("transfer done, result: %d\n", rc); - - if (rc == 0 && size == I2C_SMBUS_WORD_DATA && read_write == I2C_SMBUS_READ) - data->word = le16_to_cpu(cur_word); - - /* Release sem */ - pmac_low_i2c_unlock(iface->node); - - return rc; -} - -/* - * Generic i2c master transfer entrypoint - */ -static int -keywest_xfer( struct i2c_adapter *adap, - struct i2c_msg *msgs, - int num) -{ - struct keywest_chan* chan = i2c_get_adapdata(adap); - struct keywest_iface* iface = chan->iface; - struct i2c_msg *pmsg; - int i, completed; - int rc = 0; - - if (iface->state == state_dead) - return -ENXIO; - - if (pmac_low_i2c_lock(iface->node)) - return -ENXIO; - - /* Set adapter to standard mode */ - iface->cur_mode &= ~KW_I2C_MODE_MODE_MASK; - iface->cur_mode |= KW_I2C_MODE_STANDARD; - - completed = 0; - for (i = 0; rc >= 0 && i < num;) { - u8 addr; - - pmsg = &msgs[i++]; - addr = pmsg->addr; - if (pmsg->flags & I2C_M_TEN) { - printk(KERN_ERR "i2c-keywest: 10 bits addr not supported !\n"); - rc = -EINVAL; - break; - } - pr_debug("xfer: chan: %d, doing %s %d bytes to 0x%02x - %d of %d messages\n", - chan->chan_no, - pmsg->flags & I2C_M_RD ? "read" : "write", - pmsg->len, addr, i, num); - - /* Setup channel & clear pending irqs */ - write_reg(reg_mode, iface->cur_mode | (chan->chan_no << 4)); - write_reg(reg_isr, read_reg(reg_isr)); - write_reg(reg_status, 0); - - iface->data = pmsg->buf; - iface->datalen = pmsg->len; - iface->state = state_addr; - iface->result = 0; - if (pmsg->flags & I2C_M_RD) - iface->read_write = I2C_SMBUS_READ; - else - iface->read_write = I2C_SMBUS_WRITE; - - /* Set up address and r/w bit */ - if (pmsg->flags & I2C_M_REV_DIR_ADDR) - addr ^= 1; - write_reg(reg_addr, - (addr << 1) | - ((iface->read_write == I2C_SMBUS_READ) ? 0x01 : 0x00)); - -#ifndef POLLED_MODE - /* Arm timeout */ - iface->timeout_timer.expires = jiffies + POLL_TIMEOUT; - add_timer(&iface->timeout_timer); -#endif - - /* Start sending address & enable interrupt*/ - write_reg(reg_ier, KW_I2C_IRQ_MASK); - write_reg(reg_control, KW_I2C_CTL_XADDR); - -#ifdef POLLED_MODE - pr_debug("using polled mode...\n"); - /* State machine, to turn into an interrupt handler */ - while(iface->state != state_idle) { - u8 isr = wait_interrupt(iface); - handle_interrupt(iface, isr); - } -#else /* POLLED_MODE */ - pr_debug("using interrupt mode...\n"); - wait_for_completion(&iface->complete); -#endif /* POLLED_MODE */ - - rc = iface->result; - if (rc == 0) - completed++; - pr_debug("transfer done, result: %d\n", rc); - } - - /* Release sem */ - pmac_low_i2c_unlock(iface->node); - - return completed; -} - -static u32 -keywest_func(struct i2c_adapter * adapter) -{ - return I2C_FUNC_SMBUS_QUICK | I2C_FUNC_SMBUS_BYTE | - I2C_FUNC_SMBUS_BYTE_DATA | I2C_FUNC_SMBUS_WORD_DATA | - I2C_FUNC_SMBUS_BLOCK_DATA; -} - -/* For now, we only handle combined mode (smbus) */ -static struct i2c_algorithm keywest_algorithm = { - .smbus_xfer = keywest_smbus_xfer, - .master_xfer = keywest_xfer, - .functionality = keywest_func, -}; - - -static int -create_iface(struct device_node *np, struct device *dev) -{ - unsigned long steps; - unsigned bsteps, tsize, i, nchan; - struct keywest_iface* iface; - u32 *psteps, *prate, *addrp; - int rc; - - if (np->n_intrs < 1) { - printk(KERN_ERR "%s: Missing interrupt !\n", - np->full_name); - return -ENODEV; - } - addrp = (u32 *)get_property(np, "AAPL,address", NULL); - if (addrp == NULL) { - printk(KERN_ERR "%s: Can't find address !\n", - np->full_name); - return -ENODEV; - } - - if (pmac_low_i2c_lock(np)) - return -ENODEV; - - psteps = (u32 *)get_property(np, "AAPL,address-step", NULL); - steps = psteps ? (*psteps) : 0x10; - - /* Hrm... maybe we can be smarter here */ - for (bsteps = 0; (steps & 0x01) == 0; bsteps++) - steps >>= 1; - - if (np->parent->name[0] == 'u') - nchan = 2; - else - nchan = 1; - - tsize = sizeof(struct keywest_iface) + - (sizeof(struct keywest_chan) + 4) * nchan; - iface = kzalloc(tsize, GFP_KERNEL); - if (iface == NULL) { - printk(KERN_ERR "i2c-keywest: can't allocate inteface !\n"); - pmac_low_i2c_unlock(np); - return -ENOMEM; - } - spin_lock_init(&iface->lock); - init_completion(&iface->complete); - iface->node = of_node_get(np); - iface->bsteps = bsteps; - iface->chan_count = nchan; - iface->state = state_idle; - iface->irq = np->intrs[0].line; - iface->channels = (struct keywest_chan *) - (((unsigned long)(iface + 1) + 3UL) & ~3UL); - iface->base = ioremap(*addrp, 0x1000); - if (!iface->base) { - printk(KERN_ERR "i2c-keywest: can't map inteface !\n"); - kfree(iface); - pmac_low_i2c_unlock(np); - return -ENOMEM; - } - -#ifndef POLLED_MODE - init_timer(&iface->timeout_timer); - iface->timeout_timer.function = keywest_timeout; - iface->timeout_timer.data = (unsigned long)iface; -#endif - - /* Select interface rate */ - iface->cur_mode = KW_I2C_MODE_100KHZ; - prate = (u32 *)get_property(np, "AAPL,i2c-rate", NULL); - if (prate) switch(*prate) { - case 100: - iface->cur_mode = KW_I2C_MODE_100KHZ; - break; - case 50: - iface->cur_mode = KW_I2C_MODE_50KHZ; - break; - case 25: - iface->cur_mode = KW_I2C_MODE_25KHZ; - break; - default: - printk(KERN_WARNING "i2c-keywest: unknown rate %ldKhz, using 100KHz\n", - (long)*prate); - } - - /* Select standard mode by default */ - iface->cur_mode |= KW_I2C_MODE_STANDARD; - - /* Write mode */ - write_reg(reg_mode, iface->cur_mode); - - /* Switch interrupts off & clear them*/ - write_reg(reg_ier, 0x00); - write_reg(reg_isr, KW_I2C_IRQ_MASK); - -#ifndef POLLED_MODE - /* Request chip interrupt */ - rc = request_irq(iface->irq, keywest_irq, SA_INTERRUPT, "keywest i2c", iface); - if (rc) { - printk(KERN_ERR "i2c-keywest: can't get IRQ %d !\n", iface->irq); - iounmap(iface->base); - kfree(iface); - pmac_low_i2c_unlock(np); - return -ENODEV; - } -#endif /* POLLED_MODE */ - - pmac_low_i2c_unlock(np); - dev_set_drvdata(dev, iface); - - for (i=0; ichannels[i]; - - sprintf(chan->adapter.name, "%s %d", np->parent->name, i); - chan->iface = iface; - chan->chan_no = i; - chan->adapter.algo = &keywest_algorithm; - chan->adapter.algo_data = NULL; - chan->adapter.client_register = NULL; - chan->adapter.client_unregister = NULL; - i2c_set_adapdata(&chan->adapter, chan); - chan->adapter.dev.parent = dev; - - rc = i2c_add_adapter(&chan->adapter); - if (rc) { - printk("i2c-keywest.c: Adapter %s registration failed\n", - chan->adapter.name); - i2c_set_adapdata(&chan->adapter, NULL); - } - } - - printk(KERN_INFO "Found KeyWest i2c on \"%s\", %d channel%s, stepping: %d bits\n", - np->parent->name, nchan, nchan > 1 ? "s" : "", bsteps); - - return 0; -} - -static int -dispose_iface(struct device *dev) -{ - struct keywest_iface *iface = dev_get_drvdata(dev); - int i, rc; - - /* Make sure we stop all activity */ - if (pmac_low_i2c_lock(iface->node)) - return -ENODEV; - -#ifndef POLLED_MODE - spin_lock_irq(&iface->lock); - while (iface->state != state_idle) { - spin_unlock_irq(&iface->lock); - msleep(100); - spin_lock_irq(&iface->lock); - } -#endif /* POLLED_MODE */ - iface->state = state_dead; -#ifndef POLLED_MODE - spin_unlock_irq(&iface->lock); - free_irq(iface->irq, iface); -#endif /* POLLED_MODE */ - - pmac_low_i2c_unlock(iface->node); - - /* Release all channels */ - for (i=0; ichan_count; i++) { - struct keywest_chan* chan = &iface->channels[i]; - if (i2c_get_adapdata(&chan->adapter) == NULL) - continue; - rc = i2c_del_adapter(&chan->adapter); - i2c_set_adapdata(&chan->adapter, NULL); - /* We aren't that prepared to deal with this... */ - if (rc) - printk("i2c-keywest.c: i2c_del_adapter failed, that's bad !\n"); - } - iounmap(iface->base); - dev_set_drvdata(dev, NULL); - of_node_put(iface->node); - kfree(iface); - - return 0; -} - -static int -create_iface_macio(struct macio_dev* dev, const struct of_device_id *match) -{ - return create_iface(dev->ofdev.node, &dev->ofdev.dev); -} - -static int -dispose_iface_macio(struct macio_dev* dev) -{ - return dispose_iface(&dev->ofdev.dev); -} - -static int -create_iface_of_platform(struct of_device* dev, const struct of_device_id *match) -{ - return create_iface(dev->node, &dev->dev); -} - -static int -dispose_iface_of_platform(struct of_device* dev) -{ - return dispose_iface(&dev->dev); -} - -static struct of_device_id i2c_keywest_match[] = -{ - { - .type = "i2c", - .compatible = "keywest" - }, - {}, -}; - -static struct macio_driver i2c_keywest_macio_driver = -{ - .owner = THIS_MODULE, - .name = "i2c-keywest", - .match_table = i2c_keywest_match, - .probe = create_iface_macio, - .remove = dispose_iface_macio -}; - -static struct of_platform_driver i2c_keywest_of_platform_driver = -{ - .owner = THIS_MODULE, - .name = "i2c-keywest", - .match_table = i2c_keywest_match, - .probe = create_iface_of_platform, - .remove = dispose_iface_of_platform -}; - -static int __init -i2c_keywest_init(void) -{ - of_register_driver(&i2c_keywest_of_platform_driver); - macio_register_driver(&i2c_keywest_macio_driver); - - return 0; -} - -static void __exit -i2c_keywest_cleanup(void) -{ - of_unregister_driver(&i2c_keywest_of_platform_driver); - macio_unregister_driver(&i2c_keywest_macio_driver); -} - -module_init(i2c_keywest_init); -module_exit(i2c_keywest_cleanup); Index: linux-work/drivers/i2c/busses/i2c-keywest.h =================================================================== --- linux-work.orig/drivers/i2c/busses/i2c-keywest.h 2006-01-06 19:42:48.000000000 +1100 +++ /dev/null 1970-01-01 00:00:00.000000000 +0000 @@ -1,108 +0,0 @@ -#ifndef __I2C_KEYWEST_H__ -#define __I2C_KEYWEST_H__ - -/* The Tumbler audio equalizer can be really slow sometimes */ -#define POLL_TIMEOUT (2*HZ) - -/* Register indices */ -typedef enum { - reg_mode = 0, - reg_control, - reg_status, - reg_isr, - reg_ier, - reg_addr, - reg_subaddr, - reg_data -} reg_t; - - -/* Mode register */ -#define KW_I2C_MODE_100KHZ 0x00 -#define KW_I2C_MODE_50KHZ 0x01 -#define KW_I2C_MODE_25KHZ 0x02 -#define KW_I2C_MODE_DUMB 0x00 -#define KW_I2C_MODE_STANDARD 0x04 -#define KW_I2C_MODE_STANDARDSUB 0x08 -#define KW_I2C_MODE_COMBINED 0x0C -#define KW_I2C_MODE_MODE_MASK 0x0C -#define KW_I2C_MODE_CHAN_MASK 0xF0 - -/* Control register */ -#define KW_I2C_CTL_AAK 0x01 -#define KW_I2C_CTL_XADDR 0x02 -#define KW_I2C_CTL_STOP 0x04 -#define KW_I2C_CTL_START 0x08 - -/* Status register */ -#define KW_I2C_STAT_BUSY 0x01 -#define KW_I2C_STAT_LAST_AAK 0x02 -#define KW_I2C_STAT_LAST_RW 0x04 -#define KW_I2C_STAT_SDA 0x08 -#define KW_I2C_STAT_SCL 0x10 - -/* IER & ISR registers */ -#define KW_I2C_IRQ_DATA 0x01 -#define KW_I2C_IRQ_ADDR 0x02 -#define KW_I2C_IRQ_STOP 0x04 -#define KW_I2C_IRQ_START 0x08 -#define KW_I2C_IRQ_MASK 0x0F - -/* Physical interface */ -struct keywest_iface -{ - struct device_node *node; - void __iomem * base; - unsigned bsteps; - int irq; - spinlock_t lock; - struct keywest_chan *channels; - unsigned chan_count; - u8 cur_mode; - char read_write; - u8 *data; - unsigned datalen; - int state; - int result; - struct timer_list timeout_timer; - struct completion complete; -}; - -enum { - state_idle, - state_addr, - state_read, - state_write, - state_stop, - state_dead -}; - -/* Channel on an interface */ -struct keywest_chan -{ - struct i2c_adapter adapter; - struct keywest_iface* iface; - unsigned chan_no; -}; - -/* Register access */ - -static inline u8 __read_reg(struct keywest_iface *iface, reg_t reg) -{ - return in_8(iface->base - + (((unsigned)reg) << iface->bsteps)); -} - -static inline void __write_reg(struct keywest_iface *iface, reg_t reg, u8 val) -{ - out_8(iface->base - + (((unsigned)reg) << iface->bsteps), val); - (void)__read_reg(iface, reg_subaddr); -} - -#define write_reg(reg, val) __write_reg(iface, reg, val) -#define read_reg(reg) __read_reg(iface, reg) - - - -#endif /* __I2C_KEYWEST_H__ */ Index: linux-work/drivers/i2c/busses/i2c-pmac-smu.c =================================================================== --- linux-work.orig/drivers/i2c/busses/i2c-pmac-smu.c 2006-01-06 19:42:48.000000000 +1100 +++ /dev/null 1970-01-01 00:00:00.000000000 +0000 @@ -1,324 +0,0 @@ -/* - i2c Support for Apple SMU Controller - - Copyright (c) 2005 Benjamin Herrenschmidt, IBM Corp. - - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - -*/ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -static int probe; - -MODULE_AUTHOR("Benjamin Herrenschmidt "); -MODULE_DESCRIPTION("I2C driver for Apple's SMU"); -MODULE_LICENSE("GPL"); -module_param(probe, bool, 0); - - -/* Physical interface */ -struct smu_iface -{ - struct i2c_adapter adapter; - struct completion complete; - u32 busid; -}; - -static void smu_i2c_done(struct smu_i2c_cmd *cmd, void *misc) -{ - struct smu_iface *iface = misc; - complete(&iface->complete); -} - -/* - * SMBUS-type transfer entrypoint - */ -static s32 smu_smbus_xfer( struct i2c_adapter* adap, - u16 addr, - unsigned short flags, - char read_write, - u8 command, - int size, - union i2c_smbus_data* data) -{ - struct smu_iface *iface = i2c_get_adapdata(adap); - struct smu_i2c_cmd cmd; - int rc = 0; - int read = (read_write == I2C_SMBUS_READ); - - cmd.info.bus = iface->busid; - cmd.info.devaddr = (addr << 1) | (read ? 0x01 : 0x00); - - /* Prepare datas & select mode */ - switch (size) { - case I2C_SMBUS_QUICK: - cmd.info.type = SMU_I2C_TRANSFER_SIMPLE; - cmd.info.datalen = 0; - break; - case I2C_SMBUS_BYTE: - cmd.info.type = SMU_I2C_TRANSFER_SIMPLE; - cmd.info.datalen = 1; - if (!read) - cmd.info.data[0] = data->byte; - break; - case I2C_SMBUS_BYTE_DATA: - cmd.info.type = SMU_I2C_TRANSFER_STDSUB; - cmd.info.datalen = 1; - cmd.info.sublen = 1; - cmd.info.subaddr[0] = command; - cmd.info.subaddr[1] = 0; - cmd.info.subaddr[2] = 0; - if (!read) - cmd.info.data[0] = data->byte; - break; - case I2C_SMBUS_WORD_DATA: - cmd.info.type = SMU_I2C_TRANSFER_STDSUB; - cmd.info.datalen = 2; - cmd.info.sublen = 1; - cmd.info.subaddr[0] = command; - cmd.info.subaddr[1] = 0; - cmd.info.subaddr[2] = 0; - if (!read) { - cmd.info.data[0] = data->word & 0xff; - cmd.info.data[1] = (data->word >> 8) & 0xff; - } - break; - /* Note that these are broken vs. the expected smbus API where - * on reads, the lenght is actually returned from the function, - * but I think the current API makes no sense and I don't want - * any driver that I haven't verified for correctness to go - * anywhere near a pmac i2c bus anyway ... - */ - case I2C_SMBUS_BLOCK_DATA: - cmd.info.type = SMU_I2C_TRANSFER_STDSUB; - cmd.info.datalen = data->block[0] + 1; - if (cmd.info.datalen > (SMU_I2C_WRITE_MAX + 1)) - return -EINVAL; - if (!read) - memcpy(cmd.info.data, data->block, cmd.info.datalen); - cmd.info.sublen = 1; - cmd.info.subaddr[0] = command; - cmd.info.subaddr[1] = 0; - cmd.info.subaddr[2] = 0; - break; - case I2C_SMBUS_I2C_BLOCK_DATA: - cmd.info.type = SMU_I2C_TRANSFER_STDSUB; - cmd.info.datalen = data->block[0]; - if (cmd.info.datalen > 7) - return -EINVAL; - if (!read) - memcpy(cmd.info.data, &data->block[1], - cmd.info.datalen); - cmd.info.sublen = 1; - cmd.info.subaddr[0] = command; - cmd.info.subaddr[1] = 0; - cmd.info.subaddr[2] = 0; - break; - - default: - return -EINVAL; - } - - /* Turn a standardsub read into a combined mode access */ - if (read_write == I2C_SMBUS_READ && - cmd.info.type == SMU_I2C_TRANSFER_STDSUB) - cmd.info.type = SMU_I2C_TRANSFER_COMBINED; - - /* Finish filling command and submit it */ - cmd.done = smu_i2c_done; - cmd.misc = iface; - rc = smu_queue_i2c(&cmd); - if (rc < 0) - return rc; - wait_for_completion(&iface->complete); - rc = cmd.status; - - if (!read || rc < 0) - return rc; - - switch (size) { - case I2C_SMBUS_BYTE: - case I2C_SMBUS_BYTE_DATA: - data->byte = cmd.info.data[0]; - break; - case I2C_SMBUS_WORD_DATA: - data->word = ((u16)cmd.info.data[1]) << 8; - data->word |= cmd.info.data[0]; - break; - /* Note that these are broken vs. the expected smbus API where - * on reads, the lenght is actually returned from the function, - * but I think the current API makes no sense and I don't want - * any driver that I haven't verified for correctness to go - * anywhere near a pmac i2c bus anyway ... - */ - case I2C_SMBUS_BLOCK_DATA: - case I2C_SMBUS_I2C_BLOCK_DATA: - memcpy(&data->block[0], cmd.info.data, cmd.info.datalen); - break; - } - - return rc; -} - -static u32 -smu_smbus_func(struct i2c_adapter * adapter) -{ - return I2C_FUNC_SMBUS_QUICK | I2C_FUNC_SMBUS_BYTE | - I2C_FUNC_SMBUS_BYTE_DATA | I2C_FUNC_SMBUS_WORD_DATA | - I2C_FUNC_SMBUS_BLOCK_DATA; -} - -/* For now, we only handle combined mode (smbus) */ -static struct i2c_algorithm smu_algorithm = { - .smbus_xfer = smu_smbus_xfer, - .functionality = smu_smbus_func, -}; - -static int create_iface(struct device_node *np, struct device *dev) -{ - struct smu_iface* iface; - u32 *reg, busid; - int rc; - - reg = (u32 *)get_property(np, "reg", NULL); - if (reg == NULL) { - printk(KERN_ERR "i2c-pmac-smu: can't find bus number !\n"); - return -ENXIO; - } - busid = *reg; - - iface = kzalloc(sizeof(struct smu_iface), GFP_KERNEL); - if (iface == NULL) { - printk(KERN_ERR "i2c-pmac-smu: can't allocate inteface !\n"); - return -ENOMEM; - } - init_completion(&iface->complete); - iface->busid = busid; - - dev_set_drvdata(dev, iface); - - sprintf(iface->adapter.name, "smu-i2c-%02x", busid); - iface->adapter.algo = &smu_algorithm; - iface->adapter.algo_data = NULL; - iface->adapter.client_register = NULL; - iface->adapter.client_unregister = NULL; - i2c_set_adapdata(&iface->adapter, iface); - iface->adapter.dev.parent = dev; - - rc = i2c_add_adapter(&iface->adapter); - if (rc) { - printk(KERN_ERR "i2c-pamc-smu.c: Adapter %s registration " - "failed\n", iface->adapter.name); - i2c_set_adapdata(&iface->adapter, NULL); - } - - if (probe) { - unsigned char addr; - printk("Probe: "); - for (addr = 0x00; addr <= 0x7f; addr++) { - if (i2c_smbus_xfer(&iface->adapter,addr, - 0,0,0,I2C_SMBUS_QUICK,NULL) >= 0) - printk("%02x ", addr); - } - printk("\n"); - } - - printk(KERN_INFO "SMU i2c bus %x registered\n", busid); - - return 0; -} - -static int dispose_iface(struct device *dev) -{ - struct smu_iface *iface = dev_get_drvdata(dev); - int rc; - - rc = i2c_del_adapter(&iface->adapter); - i2c_set_adapdata(&iface->adapter, NULL); - /* We aren't that prepared to deal with this... */ - if (rc) - printk("i2c-pmac-smu.c: Failed to remove bus %s !\n", - iface->adapter.name); - dev_set_drvdata(dev, NULL); - kfree(iface); - - return 0; -} - - -static int create_iface_of_platform(struct of_device* dev, - const struct of_device_id *match) -{ - struct device_node *node = dev->node; - - if (device_is_compatible(node, "smu-i2c") || - (node->parent != NULL && - device_is_compatible(node->parent, "smu-i2c-control"))) - return create_iface(node, &dev->dev); - return -ENODEV; -} - - -static int dispose_iface_of_platform(struct of_device* dev) -{ - return dispose_iface(&dev->dev); -} - - -static struct of_device_id i2c_smu_match[] = -{ - { - .compatible = "smu-i2c", - }, - { - .compatible = "i2c-bus", - }, - {}, -}; -static struct of_platform_driver i2c_smu_of_platform_driver = -{ - .name = "i2c-smu", - .match_table = i2c_smu_match, - .probe = create_iface_of_platform, - .remove = dispose_iface_of_platform -}; - - -static int __init i2c_pmac_smu_init(void) -{ - of_register_driver(&i2c_smu_of_platform_driver); - return 0; -} - - -static void __exit i2c_pmac_smu_cleanup(void) -{ - of_unregister_driver(&i2c_smu_of_platform_driver); -} - -module_init(i2c_pmac_smu_init); -module_exit(i2c_pmac_smu_cleanup); Index: linux-work/drivers/i2c/busses/i2c-powermac.c =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 +++ linux-work/drivers/i2c/busses/i2c-powermac.c 2006-01-07 10:53:57.000000000 +1100 @@ -0,0 +1,290 @@ +/* + i2c Support for Apple SMU Controller + + Copyright (c) 2005 Benjamin Herrenschmidt, IBM Corp. + + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +MODULE_AUTHOR("Benjamin Herrenschmidt "); +MODULE_DESCRIPTION("I2C driver for Apple PowerMac"); +MODULE_LICENSE("GPL"); + +/* + * SMBUS-type transfer entrypoint + */ +static s32 i2c_powermac_smbus_xfer( struct i2c_adapter* adap, + u16 addr, + unsigned short flags, + char read_write, + u8 command, + int size, + union i2c_smbus_data* data) +{ + struct pmac_i2c_bus *bus = i2c_get_adapdata(adap); + int rc = 0; + int read = (read_write == I2C_SMBUS_READ); + int addrdir = (addr << 1) | read; + u8 local[2]; + + rc = pmac_i2c_open(bus, 0); + if (rc) + return rc; + + switch (size) { + case I2C_SMBUS_QUICK: + rc = pmac_i2c_setmode(bus, pmac_i2c_mode_std); + if (rc) + goto bail; + rc = pmac_i2c_xfer(bus, addrdir, 0, 0, NULL, 0); + break; + case I2C_SMBUS_BYTE: + rc = pmac_i2c_setmode(bus, pmac_i2c_mode_std); + if (rc) + goto bail; + rc = pmac_i2c_xfer(bus, addrdir, 0, 0, &data->byte, 1); + break; + case I2C_SMBUS_BYTE_DATA: + rc = pmac_i2c_setmode(bus, read ? + pmac_i2c_mode_combined : + pmac_i2c_mode_stdsub); + if (rc) + goto bail; + rc = pmac_i2c_xfer(bus, addrdir, 1, command, &data->byte, 1); + break; + case I2C_SMBUS_WORD_DATA: + rc = pmac_i2c_setmode(bus, read ? + pmac_i2c_mode_combined : + pmac_i2c_mode_stdsub); + if (rc) + goto bail; + if (!read) { + local[0] = data->word & 0xff; + local[1] = (data->word >> 8) & 0xff; + } + rc = pmac_i2c_xfer(bus, addrdir, 1, command, local, 2); + if (rc == 0 && read) { + data->word = ((u16)local[1]) << 8; + data->word |= local[0]; + } + break; + + /* Note that these are broken vs. the expected smbus API where + * on reads, the lenght is actually returned from the function, + * but I think the current API makes no sense and I don't want + * any driver that I haven't verified for correctness to go + * anywhere near a pmac i2c bus anyway ... + * + * I'm also not completely sure what kind of phases to do between + * the actual command and the data (what I am _supposed_ to do that + * is). For now, I assume writes are a single stream and reads have + * a repeat start/addr phase (but not stop in between) + */ + case I2C_SMBUS_BLOCK_DATA: + rc = pmac_i2c_setmode(bus, read ? + pmac_i2c_mode_combined : + pmac_i2c_mode_stdsub); + if (rc) + goto bail; + rc = pmac_i2c_xfer(bus, addrdir, 1, command, data->block, + data->block[0] + 1); + + break; + case I2C_SMBUS_I2C_BLOCK_DATA: + rc = pmac_i2c_setmode(bus, read ? + pmac_i2c_mode_combined : + pmac_i2c_mode_stdsub); + if (rc) + goto bail; + rc = pmac_i2c_xfer(bus, addrdir, 1, command, + read ? data->block : &data->block[1], + data->block[0]); + break; + + default: + rc = -EINVAL; + } + bail: + pmac_i2c_close(bus); + return rc; +} + +/* + * Generic i2c master transfer entrypoint. This driver only support single + * messages (for "lame i2c" transfers). Anything else should use the smbus + * entry point + */ +static int i2c_powermac_master_xfer( struct i2c_adapter *adap, + struct i2c_msg *msgs, + int num) +{ + struct pmac_i2c_bus *bus = i2c_get_adapdata(adap); + int rc = 0; + int read; + int addrdir; + + if (num != 1) + return -EINVAL; + if (msgs->flags & I2C_M_TEN) + return -EINVAL; + read = (msgs->flags & I2C_M_RD) != 0; + addrdir = (msgs->addr << 1) | read; + if (msgs->flags & I2C_M_REV_DIR_ADDR) + addrdir ^= 1; + + rc = pmac_i2c_open(bus, 0); + if (rc) + return rc; + rc = pmac_i2c_setmode(bus, pmac_i2c_mode_std); + if (rc) + goto bail; + rc = pmac_i2c_xfer(bus, addrdir, 0, 0, msgs->buf, msgs->len); + bail: + pmac_i2c_close(bus); + return rc < 0 ? rc : msgs->len; +} + +static u32 i2c_powermac_func(struct i2c_adapter * adapter) +{ + return I2C_FUNC_SMBUS_QUICK | I2C_FUNC_SMBUS_BYTE | + I2C_FUNC_SMBUS_BYTE_DATA | I2C_FUNC_SMBUS_WORD_DATA | + I2C_FUNC_SMBUS_BLOCK_DATA | I2C_FUNC_I2C; +} + +/* For now, we only handle smbus */ +static struct i2c_algorithm i2c_powermac_algorithm = { + .smbus_xfer = i2c_powermac_smbus_xfer, + .master_xfer = i2c_powermac_master_xfer, + .functionality = i2c_powermac_func, +}; + + +static int i2c_powermac_remove(struct device *dev) +{ + struct i2c_adapter *adapter = dev_get_drvdata(dev); + struct pmac_i2c_bus *bus = i2c_get_adapdata(adapter); + int rc; + + rc = i2c_del_adapter(adapter); + pmac_i2c_detach_adapter(bus, adapter); + i2c_set_adapdata(adapter, NULL); + /* We aren't that prepared to deal with this... */ + if (rc) + printk("i2c-powermac.c: Failed to remove bus %s !\n", + adapter->name); + dev_set_drvdata(dev, NULL); + kfree(adapter); + + return 0; +} + + +static int i2c_powermac_probe(struct device *dev) +{ + struct pmac_i2c_bus *bus = dev->platform_data; + struct device_node *parent = NULL; + struct i2c_adapter *adapter; + char name[32], *basename; + int rc; + + if (bus == NULL) + return -EINVAL; + + /* Ok, now we need to make up a name for the interface that will + * match what we used to do in the past, that is basically the + * controller's parent device node for keywest. PMU didn't have a + * naming convention and SMU has a different one + */ + switch(pmac_i2c_get_type(bus)) { + case pmac_i2c_bus_keywest: + parent = of_get_parent(pmac_i2c_get_controller(bus)); + if (parent == NULL) + return -EINVAL; + basename = parent->name; + break; + case pmac_i2c_bus_pmu: + basename = "pmu"; + break; + case pmac_i2c_bus_smu: + /* This is not what we used to do but I'm fixing drivers at + * the same time as this change + */ + basename = "smu"; + break; + default: + return -EINVAL; + } + snprintf(name, 32, "%s %d", basename, pmac_i2c_get_channel(bus)); + of_node_put(parent); + + adapter = kzalloc(sizeof(struct i2c_adapter), GFP_KERNEL); + if (adapter == NULL) { + printk(KERN_ERR "i2c-powermac: can't allocate inteface !\n"); + return -ENOMEM; + } + dev_set_drvdata(dev, adapter); + strcpy(adapter->name, name); + adapter->algo = &i2c_powermac_algorithm; + i2c_set_adapdata(adapter, bus); + adapter->dev.parent = dev; + pmac_i2c_attach_adapter(bus, adapter); + rc = i2c_add_adapter(adapter); + if (rc) { + printk(KERN_ERR "i2c-powermac: Adapter %s registration " + "failed\n", name); + i2c_set_adapdata(adapter, NULL); + pmac_i2c_detach_adapter(bus, adapter); + } + + printk(KERN_INFO "PowerMac i2c bus %s registered\n", name); + return rc; +} + + +static struct device_driver i2c_powermac_driver = { + .name = "i2c-powermac", + .bus = &platform_bus_type, + .probe = i2c_powermac_probe, + .remove = i2c_powermac_remove, +}; + +static int __init i2c_powermac_init(void) +{ + driver_register(&i2c_powermac_driver); + return 0; +} + + +static void __exit i2c_powermac_cleanup(void) +{ + driver_unregister(&i2c_powermac_driver); +} + +module_init(i2c_powermac_init); +module_exit(i2c_powermac_cleanup); Index: linux-work/arch/powerpc/platforms/powermac/low_i2c.c =================================================================== --- linux-work.orig/arch/powerpc/platforms/powermac/low_i2c.c 2006-01-06 19:43:21.000000000 +1100 +++ linux-work/arch/powerpc/platforms/powermac/low_i2c.c 2006-01-07 10:53:21.000000000 +1100 @@ -39,6 +39,10 @@ #include #include #include +#include +#include +#include +#include #include #include #include @@ -63,6 +67,9 @@ #define DBG_LOW(x...) #endif + +static int pmac_i2c_force_poll = 1; + /* * A bus structure. Each bus in the system has such a structure associated. */ @@ -80,6 +87,7 @@ struct pmac_i2c_bus struct semaphore sem; int opened; int polled; /* open mode */ + struct platform_device *platform_dev; /* ops */ int (*open)(struct pmac_i2c_bus *bus); @@ -101,6 +109,16 @@ struct pmac_i2c_host_kw void __iomem *base; /* register base address */ int bsteps; /* register stepping */ int speed; /* speed */ + int irq; + u8 *data; + unsigned len; + int state; + int rw; + int polled; + int result; + struct completion complete; + spinlock_t lock; + struct timer_list timeout_timer; }; /* Register indices */ @@ -115,6 +133,8 @@ typedef enum { reg_data } reg_t; +/* The Tumbler audio equalizer can be really slow sometimes */ +#define KW_POLL_TIMEOUT (2*HZ) /* Mode register */ #define KW_I2C_MODE_100KHZ 0x00 @@ -158,8 +178,9 @@ enum { }; #define WRONG_STATE(name) do {\ - printk(KERN_DEBUG "KW: wrong state. Got %s, state: %s (isr: %02x)\n", \ - name, __kw_state_names[state], isr); \ + printk(KERN_DEBUG "KW: wrong state. Got %s, state: %s " \ + "(isr: %02x)\n", \ + name, __kw_state_names[host->state], isr); \ } while(0) static const char *__kw_state_names[] = { @@ -171,23 +192,22 @@ static const char *__kw_state_names[] = "state_dead" }; -static inline u8 __kw_read_reg(struct pmac_i2c_bus *bus, reg_t reg) +static inline u8 __kw_read_reg(struct pmac_i2c_host_kw *host, reg_t reg) { - struct pmac_i2c_host_kw *host = bus->hostdata; return readb(host->base + (((unsigned int)reg) << host->bsteps)); } -static inline void __kw_write_reg(struct pmac_i2c_bus *bus, reg_t reg, u8 val) +static inline void __kw_write_reg(struct pmac_i2c_host_kw *host, + reg_t reg, u8 val) { - struct pmac_i2c_host_kw *host = bus->hostdata; writeb(val, host->base + (((unsigned)reg) << host->bsteps)); - (void)__kw_read_reg(bus, reg_subaddr); + (void)__kw_read_reg(host, reg_subaddr); } -#define kw_write_reg(reg, val) __kw_write_reg(bus, reg, val) -#define kw_read_reg(reg) __kw_read_reg(bus, reg) +#define kw_write_reg(reg, val) __kw_write_reg(host, reg, val) +#define kw_read_reg(reg) __kw_read_reg(host, reg) -static u8 kw_i2c_wait_interrupt(struct pmac_i2c_bus* bus) +static u8 kw_i2c_wait_interrupt(struct pmac_i2c_host_kw *host) { int i, j; u8 isr; @@ -201,8 +221,8 @@ static u8 kw_i2c_wait_interrupt(struct p * on udelay nor schedule when in polled mode ! * For now, just use a bogus loop.... */ - if (bus->polled) { - for (j = 1; j < 1000000; j++) + if (host->polled) { + for (j = 1; j < 100000; j++) mb(); } else msleep(1); @@ -210,86 +230,99 @@ static u8 kw_i2c_wait_interrupt(struct p return isr; } -static int kw_i2c_handle_interrupt(struct pmac_i2c_bus *bus, int state, int rw, - int *rc, u8 **data, int *len, u8 isr) +static void kw_i2c_handle_interrupt(struct pmac_i2c_host_kw *host, u8 isr) { u8 ack; DBG_LOW("kw_handle_interrupt(%s, isr: %x)\n", - __kw_state_names[state], isr); + __kw_state_names[host->state], isr); + + if (host->state == state_idle) { + printk(KERN_WARNING "low_i2c: Keywest got an out of state" + " interrupt, ignoring\n"); + kw_write_reg(reg_isr, isr); + return; + } if (isr == 0) { - if (state != state_stop) { + if (host->state != state_stop) { DBG_LOW("KW: Timeout !\n"); - *rc = -EIO; + host->result = -EIO; goto stop; } - if (state == state_stop) { + if (host->state == state_stop) { ack = kw_read_reg(reg_status); - if (!(ack & KW_I2C_STAT_BUSY)) { - state = state_idle; - kw_write_reg(reg_ier, 0x00); - } + if (ack & KW_I2C_STAT_BUSY) + kw_write_reg(reg_status, 0); + host->state = state_idle; + kw_write_reg(reg_ier, 0x00); + if (!host->polled) + complete(&host->complete); } - return state; + return; } if (isr & KW_I2C_IRQ_ADDR) { ack = kw_read_reg(reg_status); - if (state != state_addr) { + if (host->state != state_addr) { kw_write_reg(reg_isr, KW_I2C_IRQ_ADDR); WRONG_STATE("KW_I2C_IRQ_ADDR"); - *rc = -EIO; + host->result = -EIO; goto stop; } if ((ack & KW_I2C_STAT_LAST_AAK) == 0) { - *rc = -ENODEV; + host->result = -ENODEV; DBG_LOW("KW: NAK on address\n"); - return state_stop; + host->state = state_stop; + return; } else { - if (rw) { - state = state_read; - if (*len > 1) + if (host->len == 0) { + kw_write_reg(reg_isr, KW_I2C_IRQ_ADDR); + goto stop; + } + if (host->rw) { + host->state = state_read; + if (host->len > 1) kw_write_reg(reg_control, KW_I2C_CTL_AAK); } else { - state = state_write; - kw_write_reg(reg_data, **data); - (*data)++; (*len)--; + host->state = state_write; + kw_write_reg(reg_data, *(host->data++)); + host->len--; } } kw_write_reg(reg_isr, KW_I2C_IRQ_ADDR); } if (isr & KW_I2C_IRQ_DATA) { - if (state == state_read) { - **data = kw_read_reg(reg_data); - (*data)++; (*len)--; + if (host->state == state_read) { + *(host->data++) = kw_read_reg(reg_data); + host->len--; kw_write_reg(reg_isr, KW_I2C_IRQ_DATA); - if ((*len) == 0) - state = state_stop; - else if ((*len) == 1) + if (host->len == 0) + host->state = state_stop; + else if (host->len == 1) kw_write_reg(reg_control, 0); - } else if (state == state_write) { + } else if (host->state == state_write) { ack = kw_read_reg(reg_status); if ((ack & KW_I2C_STAT_LAST_AAK) == 0) { DBG_LOW("KW: nack on data write\n"); - *rc = -EIO; + host->result = -EIO; goto stop; - } else if (*len) { - kw_write_reg(reg_data, **data); - (*data)++; (*len)--; + } else if (host->len) { + kw_write_reg(reg_data, *(host->data++)); + host->len--; } else { kw_write_reg(reg_control, KW_I2C_CTL_STOP); - state = state_stop; - *rc = 0; + host->state = state_stop; + host->result = 0; } kw_write_reg(reg_isr, KW_I2C_IRQ_DATA); } else { kw_write_reg(reg_isr, KW_I2C_IRQ_DATA); WRONG_STATE("KW_I2C_IRQ_DATA"); - if (state != state_stop) { - *rc = -EIO; + if (host->state != state_stop) { + host->result = -EIO; goto stop; } } @@ -297,21 +330,54 @@ static int kw_i2c_handle_interrupt(struc if (isr & KW_I2C_IRQ_STOP) { kw_write_reg(reg_isr, KW_I2C_IRQ_STOP); - if (state != state_stop) { + if (host->state != state_stop) { WRONG_STATE("KW_I2C_IRQ_STOP"); - *rc = -EIO; + host->result = -EIO; } - return state_idle; + host->state = state_idle; + if (!host->polled) + complete(&host->complete); } if (isr & KW_I2C_IRQ_START) kw_write_reg(reg_isr, KW_I2C_IRQ_START); - return state; - + return; stop: kw_write_reg(reg_control, KW_I2C_CTL_STOP); - return state_stop; + host->state = state_stop; + return; +} + +/* Interrupt handler */ +static irqreturn_t kw_i2c_irq(int irq, void *dev_id, struct pt_regs *regs) +{ + struct pmac_i2c_host_kw *host = dev_id; + unsigned long flags; + + spin_lock_irqsave(&host->lock, flags); + del_timer(&host->timeout_timer); + kw_i2c_handle_interrupt(host, kw_read_reg(reg_isr)); + if (host->state != state_idle) { + host->timeout_timer.expires = jiffies + KW_POLL_TIMEOUT; + add_timer(&host->timeout_timer); + } + spin_unlock_irqrestore(&host->lock, flags); + return IRQ_HANDLED; +} + +static void kw_i2c_timeout(unsigned long data) +{ + struct pmac_i2c_host_kw *host = (struct pmac_i2c_host_kw *)data; + unsigned long flags; + + spin_lock_irqsave(&host->lock, flags); + kw_i2c_handle_interrupt(host, kw_read_reg(reg_isr)); + if (host->state != state_idle) { + host->timeout_timer.expires = jiffies + KW_POLL_TIMEOUT; + add_timer(&host->timeout_timer); + } + spin_unlock_irqrestore(&host->lock, flags); } static int kw_i2c_open(struct pmac_i2c_bus *bus) @@ -332,8 +398,7 @@ static int kw_i2c_xfer(struct pmac_i2c_b { struct pmac_i2c_host_kw *host = bus->hostdata; u8 mode_reg = host->speed; - int state = state_addr; - int rc = 0; + int use_irq = host->irq != NO_IRQ && !bus->polled; /* Setup mode & subaddress if any */ switch(bus->mode) { @@ -371,18 +436,50 @@ static int kw_i2c_xfer(struct pmac_i2c_b || (mode_reg & KW_I2C_MODE_MODE_MASK) == KW_I2C_MODE_COMBINED) kw_write_reg(reg_subaddr, subaddr); - /* Start sending address & disable interrupt*/ - kw_write_reg(reg_ier, 0 /*KW_I2C_IRQ_MASK*/); + /* Prepare for async operations */ + host->data = data; + host->len = len; + host->state = state_addr; + host->result = 0; + host->rw = (addrdir & 1); + host->polled = bus->polled; + + /* Enable interrupt if not using polled mode and interrupt is + * available + */ + if (use_irq) { + /* Clear completion */ + INIT_COMPLETION(host->complete); + /* Ack stale interrupts */ + kw_write_reg(reg_isr, kw_read_reg(reg_isr)); + /* Arm timeout */ + host->timeout_timer.expires = jiffies + KW_POLL_TIMEOUT; + add_timer(&host->timeout_timer); + /* Enable emission */ + kw_write_reg(reg_ier, KW_I2C_IRQ_MASK); + } + + /* Start sending address */ kw_write_reg(reg_control, KW_I2C_CTL_XADDR); - /* State machine, to turn into an interrupt handler in the future */ - while(state != state_idle) { - u8 isr = kw_i2c_wait_interrupt(bus); - state = kw_i2c_handle_interrupt(bus, state, addrdir & 1, &rc, - &data, &len, isr); + /* Wait for completion */ + if (use_irq) + wait_for_completion(&host->complete); + else { + while(host->state != state_idle) { + unsigned long flags; + + u8 isr = kw_i2c_wait_interrupt(host); + spin_lock_irqsave(&host->lock, flags); + kw_i2c_handle_interrupt(host, isr); + spin_unlock_irqrestore(&host->lock, flags); + } } - return rc; + /* Disable emission */ + kw_write_reg(reg_ier, 0); + + return host->result; } static struct pmac_i2c_host_kw *__init kw_i2c_host_init(struct device_node *np) @@ -409,6 +506,12 @@ static struct pmac_i2c_host_kw *__init k return NULL; } init_MUTEX(&host->mutex); + init_completion(&host->complete); + spin_lock_init(&host->lock); + init_timer(&host->timeout_timer); + host->timeout_timer.function = kw_i2c_timeout; + host->timeout_timer.data = (unsigned long)host; + psteps = (u32 *)get_property(np, "AAPL,address-step", NULL); steps = psteps ? (*psteps) : 0x10; for (host->bsteps = 0; (steps & 0x01) == 0; host->bsteps++) @@ -427,9 +530,28 @@ static struct pmac_i2c_host_kw *__init k host->speed = KW_I2C_MODE_25KHZ; break; } + if (np->n_intrs > 0) + host->irq = np->intrs[0].line; + else + host->irq = NO_IRQ; - printk(KERN_INFO "KeyWest i2c @0x%08x %s\n", *addrp, np->full_name); host->base = ioremap((*addrp), 0x1000); + if (host->base == NULL) { + printk(KERN_ERR "low_i2c: Can't map registers for %s\n", + np->full_name); + kfree(host); + return NULL; + } + + /* Make sure IRA is disabled */ + kw_write_reg(reg_ier, 0); + + /* Request chip interrupt */ + if (request_irq(host->irq, kw_i2c_irq, SA_SHIRQ, "keywest i2c", host)) + host->irq = NO_IRQ; + + printk(KERN_INFO "KeyWest i2c @0x%08x irq %d %s\n", + *addrp, host->irq, np->full_name); return host; } @@ -591,7 +713,7 @@ static int pmu_i2c_xfer(struct pmac_i2c_ req->nbytes = sizeof(struct pmu_i2c_hdr) + 1; req->done = pmu_i2c_complete; req->arg = ∁ - if (!read) { + if (!read && len) { memcpy(hdr->data, data, len); req->nbytes += len; } @@ -637,7 +759,8 @@ static int pmu_i2c_xfer(struct pmac_i2c_ " bytes, expected %d !\n", rlen, len); return -EIO; } - memcpy(data, &req->reply[1], len); + if (len) + memcpy(data, &req->reply[1], len); return 0; } } @@ -713,6 +836,10 @@ static int smu_i2c_xfer(struct pmac_i2c_ int read = addrdir & 1; int rc = 0; + if ((read && len > SMU_I2C_READ_MAX) || + ((!read) && len > SMU_I2C_WRITE_MAX)) + return -EINVAL; + memset(cmd, 0, sizeof(struct smu_i2c_cmd)); cmd->info.bus = bus->channel; cmd->info.devaddr = addrdir; @@ -740,7 +867,7 @@ static int smu_i2c_xfer(struct pmac_i2c_ default: return -EINVAL; } - if (!read) + if (!read && len) memcpy(cmd->info.data, data, len); init_completion(&comp); @@ -752,7 +879,7 @@ static int smu_i2c_xfer(struct pmac_i2c_ wait_for_completion(&comp); rc = cmd->status; - if (read) + if (read && len) memcpy(data, cmd->info.data, len); return rc < 0 ? rc : 0; } @@ -767,7 +894,7 @@ static void __init smu_i2c_probe(void) if (!smu_present()) return; - controller = of_find_node_by_name(NULL, "smu_i2c_control"); + controller = of_find_node_by_name(NULL, "smu-i2c-control"); if (controller == NULL) controller = of_find_node_by_name(NULL, "smu"); if (controller == NULL) @@ -884,6 +1011,13 @@ int pmac_i2c_get_flags(struct pmac_i2c_b } EXPORT_SYMBOL_GPL(pmac_i2c_get_flags); +int pmac_i2c_get_channel(struct pmac_i2c_bus *bus) +{ + return bus->channel; +} +EXPORT_SYMBOL_GPL(pmac_i2c_get_channel); + + void pmac_i2c_attach_adapter(struct pmac_i2c_bus *bus, struct i2c_adapter *adapter) { @@ -906,6 +1040,17 @@ struct i2c_adapter *pmac_i2c_get_adapter } EXPORT_SYMBOL_GPL(pmac_i2c_get_adapter); +struct pmac_i2c_bus *pmac_i2c_adapter_to_bus(struct i2c_adapter *adapter) +{ + struct pmac_i2c_bus *bus; + + list_for_each_entry(bus, &pmac_i2c_busses, link) + if (bus->adapter == adapter) + return bus; + return NULL; +} +EXPORT_SYMBOL_GPL(pmac_i2c_adapter_to_bus); + extern int pmac_i2c_match_adapter(struct device_node *dev, struct i2c_adapter *adapter) { @@ -956,7 +1101,7 @@ int pmac_i2c_open(struct pmac_i2c_bus *b int rc; down(&bus->sem); - bus->polled = polled; + bus->polled = polled || pmac_i2c_force_poll; bus->opened = 1; bus->mode = pmac_i2c_mode_std; if (bus->open && (rc = bus->open(bus)) != 0) { @@ -1034,14 +1179,43 @@ int __init pmac_i2c_init(void) kw_i2c_probe(); #ifdef CONFIG_ADB_PMU + /* Probe PMU i2c busses */ pmu_i2c_probe(); #endif #ifdef CONFIG_PMAC_SMU + /* Probe SMU i2c busses */ smu_i2c_probe(); #endif - return 0; } arch_initcall(pmac_i2c_init); +/* Since pmac_i2c_init can be called too early for the platform device + * registration, we need to do it at a later time. In our case, subsys + * happens to fit well, though I agree it's a bit of a hack... + */ +static int __init pmac_i2c_create_platform_devices(void) +{ + struct pmac_i2c_bus *bus; + int i = 0; + + /* In the case where we are initialized from smp_init(), we must + * not use the timer (and thus the irq). It's safe from now on + * though + */ + pmac_i2c_force_poll = 0; + + /* Create platform devices */ + list_for_each_entry(bus, &pmac_i2c_busses, link) { + bus->platform_dev = + platform_device_alloc("i2c-powermac", i++); + if (bus->platform_dev == NULL) + return -ENOMEM; + bus->platform_dev->dev.platform_data = bus; + platform_device_add(bus->platform_dev); + } + + return 0; +} +subsys_initcall(pmac_i2c_create_platform_devices); Index: linux-work/include/asm-powerpc/pmac_low_i2c.h =================================================================== --- linux-work.orig/include/asm-powerpc/pmac_low_i2c.h 2006-01-06 19:42:48.000000000 +1100 +++ linux-work/include/asm-powerpc/pmac_low_i2c.h 2006-01-07 10:53:21.000000000 +1100 @@ -70,6 +70,7 @@ extern struct device_node *pmac_i2c_get_ extern struct device_node *pmac_i2c_get_bus_node(struct pmac_i2c_bus *bus); extern int pmac_i2c_get_type(struct pmac_i2c_bus *bus); extern int pmac_i2c_get_flags(struct pmac_i2c_bus *bus); +extern int pmac_i2c_get_channel(struct pmac_i2c_bus *bus); /* i2c layer adapter attach/detach */ extern void pmac_i2c_attach_adapter(struct pmac_i2c_bus *bus, @@ -77,6 +78,7 @@ extern void pmac_i2c_attach_adapter(stru extern void pmac_i2c_detach_adapter(struct pmac_i2c_bus *bus, struct i2c_adapter *adapter); extern struct i2c_adapter *pmac_i2c_get_adapter(struct pmac_i2c_bus *bus); +extern struct pmac_i2c_bus *pmac_i2c_adapter_to_bus(struct i2c_adapter *adapter); /* March a device or bus with an i2c adapter structure, to be used by drivers * to match device-tree nodes with i2c adapters during adapter discovery Index: linux-work/drivers/macintosh/smu.c =================================================================== --- linux-work.orig/drivers/macintosh/smu.c 2006-01-06 19:42:48.000000000 +1100 +++ linux-work/drivers/macintosh/smu.c 2006-01-06 19:43:28.000000000 +1100 @@ -584,34 +584,14 @@ core_initcall(smu_late_init); * sysfs visibility */ -static void smu_create_i2c(struct device_node *np) -{ - char name[32]; - u32 *reg = (u32 *)get_property(np, "reg", NULL); - - if (reg != NULL) { - sprintf(name, "smu-i2c-%02x", *reg); - of_platform_device_create(np, name, &smu->of_dev->dev); - } -} - static void smu_expose_childs(void *unused) { - struct device_node *np, *gp; + struct device_node *np; - for (np = NULL; (np = of_get_next_child(smu->of_node, np)) != NULL;) { - if (device_is_compatible(np, "smu-i2c-control")) { - gp = NULL; - while ((gp = of_get_next_child(np, gp)) != NULL) - if (device_is_compatible(gp, "i2c-bus")) - smu_create_i2c(gp); - } else if (device_is_compatible(np, "smu-i2c")) - smu_create_i2c(np); + for (np = NULL; (np = of_get_next_child(smu->of_node, np)) != NULL;) if (device_is_compatible(np, "smu-sensors")) of_platform_device_create(np, "smu-sensors", &smu->of_dev->dev); - } - } static DECLARE_WORK(smu_expose_childs_work, smu_expose_childs, NULL); Index: linux-work/drivers/macintosh/windfarm_lm75_sensor.c =================================================================== --- linux-work.orig/drivers/macintosh/windfarm_lm75_sensor.c 2006-01-06 19:42:48.000000000 +1100 +++ linux-work/drivers/macintosh/windfarm_lm75_sensor.c 2006-01-06 19:43:28.000000000 +1100 @@ -21,6 +21,7 @@ #include #include #include +#include #include "windfarm.h" @@ -157,53 +158,21 @@ static struct wf_lm75_sensor *wf_lm75_cr static int wf_lm75_attach(struct i2c_adapter *adapter) { - u8 bus_id; - struct device_node *smu, *bus, *dev; - - /* We currently only deal with LM75's hanging off the SMU - * i2c busses. If we extend that driver to other/older - * machines, we should split this function into SMU-i2c, - * keywest-i2c, PMU-i2c, ... - */ + struct device_node *busnode, *dev; + struct pmac_i2c_bus *bus; DBG("wf_lm75: adapter %s detected\n", adapter->name); - if (strncmp(adapter->name, "smu-i2c-", 8) != 0) - return 0; - smu = of_find_node_by_type(NULL, "smu"); - if (smu == NULL) - return 0; - - /* Look for the bus in the device-tree */ - bus_id = (u8)simple_strtoul(adapter->name + 8, NULL, 16); - - DBG("wf_lm75: bus ID is %x\n", bus_id); - - /* Look for sensors subdir */ - for (bus = NULL; - (bus = of_get_next_child(smu, bus)) != NULL;) { - u32 *reg; - - if (strcmp(bus->name, "i2c")) - continue; - reg = (u32 *)get_property(bus, "reg", NULL); - if (reg == NULL) - continue; - if (bus_id == *reg) - break; - } - of_node_put(smu); - if (bus == NULL) { - printk(KERN_WARNING "windfarm: SMU i2c bus 0x%x not found" - " in device-tree !\n", bus_id); - return 0; - } + bus = pmac_i2c_adapter_to_bus(adapter); + if (bus == NULL) + return -ENODEV; + busnode = pmac_i2c_get_bus_node(bus); DBG("wf_lm75: bus found, looking for device...\n"); /* Now look for lm75(s) in there */ for (dev = NULL; - (dev = of_get_next_child(bus, dev)) != NULL;) { + (dev = of_get_next_child(busnode, dev)) != NULL;) { const char *loc = get_property(dev, "hwsensor-location", NULL); u32 *reg = (u32 *)get_property(dev, "reg", NULL); @@ -217,9 +186,6 @@ static int wf_lm75_attach(struct i2c_ada else if (device_is_compatible(dev, "ds1775")) wf_lm75_create(adapter, *reg, 1, loc); } - - of_node_put(bus); - return 0; } Index: linux-work/drivers/macintosh/Kconfig =================================================================== --- linux-work.orig/drivers/macintosh/Kconfig 2006-01-06 19:42:48.000000000 +1100 +++ linux-work/drivers/macintosh/Kconfig 2006-01-07 10:53:19.000000000 +1100 @@ -149,14 +149,14 @@ config MAC_EMUMOUSEBTN config THERM_WINDTUNNEL tristate "Support for thermal management on Windtunnel G4s" - depends on I2C && I2C_KEYWEST && PPC_PMAC && !PPC_PMAC64 + depends on I2C && I2C_POWERMAC && PPC_PMAC && !PPC_PMAC64 help This driver provides some thermostat and fan control for the desktop G4 "Windtunnel" config THERM_ADT746X tristate "Support for thermal mgmnt on laptops with ADT 746x chipset" - depends on I2C && I2C_KEYWEST && PPC_PMAC && !PPC_PMAC64 + depends on I2C && I2C_POWERMAC && PPC_PMAC && !PPC_PMAC64 help This driver provides some thermostat and fan control for the iBook G4, and the ATI based aluminium PowerBooks, allowing slighlty @@ -164,7 +164,7 @@ config THERM_ADT746X config THERM_PM72 tristate "Support for thermal management on PowerMac G5" - depends on I2C && I2C_KEYWEST && PPC_PMAC64 + depends on I2C && I2C_POWERMAC && PPC_PMAC64 help This driver provides thermostat and fan control for the desktop G5 machines. @@ -175,14 +175,14 @@ config WINDFARM config WINDFARM_PM81 tristate "Support for thermal management on iMac G5" depends on WINDFARM && I2C && CPU_FREQ_PMAC64 && PMAC_SMU - select I2C_PMAC_SMU + select I2C_POWERMAC help This driver provides thermal control for the iMacG5 config WINDFARM_PM91 tristate "Support for thermal management on PowerMac9,1" depends on WINDFARM && I2C && CPU_FREQ_PMAC64 && PMAC_SMU - select I2C_PMAC_SMU + select I2C_POWERMAC help This driver provides thermal control for the PowerMac9,1 which is the recent (SMU based) single CPU desktop G5 Index: linux-work/arch/powerpc/platforms/powermac/setup.c =================================================================== --- linux-work.orig/arch/powerpc/platforms/powermac/setup.c 2006-01-06 19:42:48.000000000 +1100 +++ linux-work/arch/powerpc/platforms/powermac/setup.c 2006-01-06 19:43:28.000000000 +1100 @@ -656,7 +656,7 @@ static int pmac_check_legacy_ioport(unsi static int __init pmac_declare_of_platform_devices(void) { - struct device_node *np, *npp; + struct device_node *np; np = of_find_node_by_name(NULL, "valkyrie"); if (np) @@ -664,22 +664,6 @@ static int __init pmac_declare_of_platfo np = of_find_node_by_name(NULL, "platinum"); if (np) of_platform_device_create(np, "platinum", NULL); - npp = of_find_node_by_name(NULL, "uni-n"); - if (npp == NULL) - npp = of_find_node_by_name(NULL, "u3"); - if (npp == NULL) - npp = of_find_node_by_name(NULL, "u4"); - if (npp) { - for (np = NULL; (np = of_get_next_child(npp, np)) != NULL;) { - if (strncmp(np->name, "i2c", 3) == 0) { - of_platform_device_create(np, "uni-n-i2c", - NULL); - of_node_put(np); - break; - } - } - of_node_put(npp); - } np = of_find_node_by_type(NULL, "smu"); if (np) { of_platform_device_create(np, "smu", NULL); From benh at kernel.crashing.org Sat Jan 7 11:41:02 2006 From: benh at kernel.crashing.org (Benjamin Herrenschmidt) Date: Sat, 07 Jan 2006 11:41:02 +1100 Subject: [PATCH] 3/5 powerpc: Add platform functions interpreter Message-ID: <1136594462.4840.174.camel@localhost.localdomain> This is the platform function interpreter itself along with the backends for UniN/U3/U4, mac-io, GPIOs and i2c. It adds the ability to execute those do-platform-* scripts in the device-tree (at least for most devices for which a backend is provided). This should replace the clock spreading hacks properly. It might also have an impact on all sort of machines since some of the scripts marked "at init" will now be executed on boot (or some other on sleep/wakeup), those will possibly do things that the kernel didn't do at all, like setting some values into some i2c devices (changing thermal sensor calibration or conversion rate) etc... Thus regression testing is MUCH welcome. Also loook for errors in dmesg. That's also why I've left rather verbose debugging enabled in this version of the patch. (I do expect some Windtunnel G4s to show some errors as they have an i2c clock chip on the PMU bus that uses some primitives that the i2c backend doesn't implement yet. I really need users that have one of those machine to come back to me so we can get that done right, though the errors themselves should be harmless, I suspect the machine might not run at full speed). Signed-off-by: Benjamin Herrenschmidt Index: linux-work/include/asm-powerpc/pmac_pfunc.h =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 +++ linux-work/include/asm-powerpc/pmac_pfunc.h 2006-01-07 10:54:03.000000000 +1100 @@ -0,0 +1,253 @@ +#ifndef __PMAC_PFUNC_H__ +#define __PMAC_PFUNC_H__ + +#include +#include + +/* Flags in command lists */ +#define PMF_FLAGS_ON_INIT 0x80000000u +#define PMF_FLGAS_ON_TERM 0x40000000u +#define PMF_FLAGS_ON_SLEEP 0x20000000u +#define PMF_FLAGS_ON_WAKE 0x10000000u +#define PMF_FLAGS_ON_DEMAND 0x08000000u +#define PMF_FLAGS_INT_GEN 0x04000000u +#define PMF_FLAGS_HIGH_SPEED 0x02000000u +#define PMF_FLAGS_LOW_SPEED 0x01000000u +#define PMF_FLAGS_SIDE_EFFECTS 0x00800000u + +/* + * Arguments to a platform function call. + * + * NOTE: By convention, pointer arguments point to an u32 + */ +struct pmf_args { + union { + u32 v; + u32 *p; + } u[4]; + unsigned int count; +}; + +/* + * A driver capable of interpreting commands provides a handlers + * structure filled with whatever handlers are implemented by this + * driver. Non implemented handlers are left NULL. + * + * PMF_STD_ARGS are the same arguments that are passed to the parser + * and that gets passed back to the various handlers. + * + * Interpreting a given function always start with a begin() call which + * returns an instance data to be passed around subsequent calls, and + * ends with an end() call. This allows the low level driver to implement + * locking policy or per-function instance data. + * + * For interrupt capable functions, irq_enable() is called when a client + * registers, and irq_disable() is called when the last client unregisters + * Note that irq_enable & irq_disable are called within a semaphore held + * by the core, thus you should not try to register yourself to some other + * pmf interrupt during those calls. + */ + +#define PMF_STD_ARGS struct pmf_function *func, void *instdata, \ + struct pmf_args *args + +struct pmf_function; + +struct pmf_handlers { + void * (*begin)(struct pmf_function *func, struct pmf_args *args); + void (*end)(struct pmf_function *func, void *instdata); + + int (*irq_enable)(struct pmf_function *func); + int (*irq_disable)(struct pmf_function *func); + + int (*write_gpio)(PMF_STD_ARGS, u8 value, u8 mask); + int (*read_gpio)(PMF_STD_ARGS, u8 mask, int rshift, u8 xor); + + int (*write_reg32)(PMF_STD_ARGS, u32 offset, u32 value, u32 mask); + int (*read_reg32)(PMF_STD_ARGS, u32 offset); + int (*write_reg16)(PMF_STD_ARGS, u32 offset, u16 value, u16 mask); + int (*read_reg16)(PMF_STD_ARGS, u32 offset); + int (*write_reg8)(PMF_STD_ARGS, u32 offset, u8 value, u8 mask); + int (*read_reg8)(PMF_STD_ARGS, u32 offset); + + int (*delay)(PMF_STD_ARGS, u32 duration); + + int (*wait_reg32)(PMF_STD_ARGS, u32 offset, u32 value, u32 mask); + int (*wait_reg16)(PMF_STD_ARGS, u32 offset, u16 value, u16 mask); + int (*wait_reg8)(PMF_STD_ARGS, u32 offset, u8 value, u8 mask); + + int (*read_i2c)(PMF_STD_ARGS, u32 len); + int (*write_i2c)(PMF_STD_ARGS, u32 len, const u8 *data); + int (*rmw_i2c)(PMF_STD_ARGS, u32 masklen, u32 valuelen, u32 totallen, + const u8 *maskdata, const u8 *valuedata); + + int (*read_cfg)(PMF_STD_ARGS, u32 offset, u32 len); + int (*write_cfg)(PMF_STD_ARGS, u32 offset, u32 len, const u8 *data); + int (*rmw_cfg)(PMF_STD_ARGS, u32 offset, u32 masklen, u32 valuelen, + u32 totallen, const u8 *maskdata, const u8 *valuedata); + + int (*read_i2c_sub)(PMF_STD_ARGS, u8 subaddr, u32 len); + int (*write_i2c_sub)(PMF_STD_ARGS, u8 subaddr, u32 len, const u8 *data); + int (*set_i2c_mode)(PMF_STD_ARGS, int mode); + int (*rmw_i2c_sub)(PMF_STD_ARGS, u8 subaddr, u32 masklen, u32 valuelen, + u32 totallen, const u8 *maskdata, + const u8 *valuedata); + + int (*read_reg32_msrx)(PMF_STD_ARGS, u32 offset, u32 mask, u32 shift, + u32 xor); + int (*read_reg16_msrx)(PMF_STD_ARGS, u32 offset, u32 mask, u32 shift, + u32 xor); + int (*read_reg8_msrx)(PMF_STD_ARGS, u32 offset, u32 mask, u32 shift, + u32 xor); + + int (*write_reg32_slm)(PMF_STD_ARGS, u32 offset, u32 shift, u32 mask); + int (*write_reg16_slm)(PMF_STD_ARGS, u32 offset, u32 shift, u32 mask); + int (*write_reg8_slm)(PMF_STD_ARGS, u32 offset, u32 shift, u32 mask); + + int (*mask_and_compare)(PMF_STD_ARGS, u32 len, const u8 *maskdata, + const u8 *valuedata); + + struct module *owner; +}; + + +/* + * Drivers who expose platform functions register at init time, this + * causes the platform functions for that device node to be parsed in + * advance and associated with the device. The data structures are + * partially public so a driver can walk the list of platform functions + * and eventually inspect the flags + */ +struct pmf_device; + +struct pmf_function { + /* All functions for a given driver are linked */ + struct list_head link; + + /* Function node & driver data */ + struct device_node *node; + void *driver_data; + + /* For internal use by core */ + struct pmf_device *dev; + + /* The name is the "xxx" in "platform-do-xxx", this is how + * platform functions are identified by this code. Some functions + * only operate for a given target, in which case the phandle is + * here (or 0 if the filter doesn't apply) + */ + const char *name; + u32 phandle; + + /* The flags for that function. You can have several functions + * with the same name and different flag + */ + u32 flags; + + /* The actual tokenized function blob */ + const void *data; + unsigned int length; + + /* Interrupt clients */ + struct list_head irq_clients; + + /* Refcounting */ + struct kref ref; +}; + +/* + * For platform functions that are interrupts, one can register + * irq_client structures. You canNOT use the same structure twice + * as it contains a link member. Also, the callback is called with + * a spinlock held, you must not call back into any of the pmf_* functions + * from within that callback + */ +struct pmf_irq_client { + void (*handler)(void *data); + void *data; + struct module *owner; + struct list_head link; +}; + + +/* + * Register/Unregister a function-capable driver and its handlers + */ +extern int pmf_register_driver(struct device_node *np, + struct pmf_handlers *handlers, + void *driverdata); + +extern void pmf_unregister_driver(struct device_node *np); + + +/* + * Register/Unregister interrupt clients + */ +extern int pmf_register_irq_client(struct device_node *np, + const char *name, + struct pmf_irq_client *client); + +extern void pmf_unregister_irq_client(struct device_node *np, + const char *name, + struct pmf_irq_client *client); + +/* + * Called by the handlers when an irq happens + */ +extern void pmf_do_irq(struct pmf_function *func); + + +/* + * Low level call to platform functions. + * + * The phandle can filter on the target object for functions that have + * multiple targets, the flags allow you to restrict the call to a given + * combination of flags. + * + * The args array contains as many arguments as is required by the function, + * this is dependent on the function you are calling, unfortunately Apple + * mecanism provides no way to encode that so you have to get it right at + * the call site. Some functions require no args, in which case, you can + * pass NULL. + * + * You can also pass NULL to the name. This will match any function that has + * the appropriate combination of flags & phandle or you can pass 0 to the + * phandle to match any + */ +extern int pmf_do_functions(struct device_node *np, const char *name, + u32 phandle, u32 flags, struct pmf_args *args); + + + +/* + * High level call to a platform function. + * + * This one looks for the platform-xxx first so you should call it to the + * actual target if any. It will fallback to platform-do-xxx if it can't + * find one. It will also exclusively target functions that have + * the "OnDemand" flag. + */ + +extern int pmf_call_function(struct device_node *target, const char *name, + struct pmf_args *args); + + +/* + * For low latency interrupt usage, you can lookup for on-demand functions + * using the functions below + */ + +extern struct pmf_function *pmf_find_function(struct device_node *target, + const char *name); + +extern struct pmf_function * pmf_get_function(struct pmf_function *func); +extern void pmf_put_function(struct pmf_function *func); + +extern int pmf_call_one(struct pmf_function *func, struct pmf_args *args); + + +/* Suspend/resume code called by via-pmu directly for now */ +extern void pmac_pfunc_base_suspend(void); +extern void pmac_pfunc_base_resume(void); + +#endif /* __PMAC_PFUNC_H__ */ Index: linux-work/arch/powerpc/platforms/powermac/Makefile =================================================================== --- linux-work.orig/arch/powerpc/platforms/powermac/Makefile 2006-01-07 10:53:21.000000000 +1100 +++ linux-work/arch/powerpc/platforms/powermac/Makefile 2006-01-07 10:54:03.000000000 +1100 @@ -1,7 +1,8 @@ CFLAGS_bootx_init.o += -fPIC obj-y += pic.o setup.o time.o feature.o pci.o \ - sleep.o low_i2c.o cache.o + sleep.o low_i2c.o cache.o pfunc_core.o \ + pfunc_base.o obj-$(CONFIG_PMAC_BACKLIGHT) += backlight.o obj-$(CONFIG_CPU_FREQ_PMAC) += cpufreq_32.o obj-$(CONFIG_CPU_FREQ_PMAC64) += cpufreq_64.o Index: linux-work/arch/powerpc/platforms/powermac/feature.c =================================================================== --- linux-work.orig/arch/powerpc/platforms/powermac/feature.c 2006-01-07 10:53:21.000000000 +1100 +++ linux-work/arch/powerpc/platforms/powermac/feature.c 2006-01-07 10:54:03.000000000 +1100 @@ -58,12 +58,11 @@ extern int powersave_lowspeed; extern int powersave_nap; extern struct device_node *k2_skiplist[2]; - /* * We use a single global lock to protect accesses. Each driver has * to take care of its own locking */ -static DEFINE_SPINLOCK(feature_lock); +DEFINE_SPINLOCK(feature_lock); #define LOCK(flags) spin_lock_irqsave(&feature_lock, flags); #define UNLOCK(flags) spin_unlock_irqrestore(&feature_lock, flags); @@ -106,22 +105,12 @@ static const char *macio_names[] = }; +struct device_node *uninorth_node; +u32 __iomem *uninorth_base; -/* - * Uninorth reg. access. Note that Uni-N regs are big endian - */ - -#define UN_REG(r) (uninorth_base + ((r) >> 2)) -#define UN_IN(r) (in_be32(UN_REG(r))) -#define UN_OUT(r,v) (out_be32(UN_REG(r), (v))) -#define UN_BIS(r,v) (UN_OUT((r), UN_IN(r) | (v))) -#define UN_BIC(r,v) (UN_OUT((r), UN_IN(r) & ~(v))) - -static struct device_node *uninorth_node; -static u32 __iomem *uninorth_base; static u32 uninorth_rev; static int uninorth_maj; -static void __iomem *u3_ht; +static void __iomem *u3_ht_base; /* * For each motherboard family, we have a table of functions pointers @@ -1560,8 +1549,10 @@ void g5_phy_disable_cpu1(void) #ifndef CONFIG_POWER4 -static void -keylargo_shutdown(struct macio_chip *macio, int sleep_mode) + +#ifdef CONFIG_PM + +static void keylargo_shutdown(struct macio_chip *macio, int sleep_mode) { u32 temp; @@ -1614,8 +1605,7 @@ keylargo_shutdown(struct macio_chip *mac (void)MACIO_IN32(KEYLARGO_FCR0); mdelay(1); } -static void -pangea_shutdown(struct macio_chip *macio, int sleep_mode) +static void pangea_shutdown(struct macio_chip *macio, int sleep_mode) { u32 temp; @@ -1648,8 +1638,7 @@ pangea_shutdown(struct macio_chip *macio (void)MACIO_IN32(KEYLARGO_FCR0); mdelay(1); } -static void -intrepid_shutdown(struct macio_chip *macio, int sleep_mode) +static void intrepid_shutdown(struct macio_chip *macio, int sleep_mode) { u32 temp; @@ -1833,6 +1822,8 @@ core99_wake_up(void) return 0; } +#endif /* CONFIG_PM */ + static long core99_sleep_state(struct device_node *node, long param, long value) { @@ -1854,10 +1845,13 @@ core99_sleep_state(struct device_node *n if ((pmac_mb.board_flags & PMAC_MB_CAN_SLEEP) == 0) return -EPERM; +#ifdef CONFIG_PM if (value == 1) return core99_sleep(); else if (value == 0) return core99_wake_up(); + +#endif /* CONFIG_PM */ return 0; } @@ -1981,7 +1975,9 @@ static struct feature_table_entry core99 { PMAC_FTR_USB_ENABLE, core99_usb_enable }, { PMAC_FTR_1394_ENABLE, core99_firewire_enable }, { PMAC_FTR_1394_CABLE_POWER, core99_firewire_cable_power }, +#ifdef CONFIG_PM { PMAC_FTR_SLEEP_STATE, core99_sleep_state }, +#endif #ifdef CONFIG_SMP { PMAC_FTR_RESET_CPU, core99_reset_cpu }, #endif /* CONFIG_SMP */ @@ -2572,7 +2568,7 @@ static void __init probe_uninorth(void) uninorth_base = ioremap(address, 0x40000); uninorth_rev = in_be32(UN_REG(UNI_N_VERSION)); if (uninorth_maj == 3 || uninorth_maj == 4) - u3_ht = ioremap(address + U3_HT_CONFIG_BASE, 0x1000); + u3_ht_base = ioremap(address + U3_HT_CONFIG_BASE, 0x1000); printk(KERN_INFO "Found %s memory controller & host bridge" " @ 0x%08x revision: 0x%02x\n", uninorth_maj == 3 ? "U3" : @@ -2921,9 +2917,9 @@ void __init pmac_check_ht_link(void) u8 px_bus, px_devfn; struct pci_controller *px_hose; - (void)in_be32(u3_ht + U3_HT_LINK_COMMAND); - ucfg = cfg = in_be32(u3_ht + U3_HT_LINK_CONFIG); - ufreq = freq = in_be32(u3_ht + U3_HT_LINK_FREQ); + (void)in_be32(u3_ht_base + U3_HT_LINK_COMMAND); + ucfg = cfg = in_be32(u3_ht_base + U3_HT_LINK_CONFIG); + ufreq = freq = in_be32(u3_ht_base + U3_HT_LINK_FREQ); dump_HT_speeds("U3 HyperTransport", cfg, freq); pcix_node = of_find_compatible_node(NULL, "pci", "pci-x"); Index: linux-work/arch/powerpc/platforms/powermac/pfunc_base.c =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 +++ linux-work/arch/powerpc/platforms/powermac/pfunc_base.c 2006-01-07 10:54:03.000000000 +1100 @@ -0,0 +1,405 @@ +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#define DBG(fmt...) printk(fmt) + +static irqreturn_t macio_gpio_irq(int irq, void *data, struct pt_regs *regs) +{ + pmf_do_irq(data); + + return IRQ_HANDLED; +} + +static int macio_do_gpio_irq_enable(struct pmf_function *func) +{ + if (func->node->n_intrs < 1) + return -EINVAL; + + return request_irq(func->node->intrs[0].line, macio_gpio_irq, 0, + func->node->name, func); +} + +static int macio_do_gpio_irq_disable(struct pmf_function *func) +{ + if (func->node->n_intrs < 1) + return -EINVAL; + + free_irq(func->node->intrs[0].line, func); + return 0; +} + +static int macio_do_gpio_write(PMF_STD_ARGS, u8 value, u8 mask) +{ + u8 __iomem *addr = (u8 __iomem *)func->driver_data; + unsigned long flags; + u8 tmp; + + /* Check polarity */ + if (args && args->count && !args->u[0].v) + value = ~value; + + /* Toggle the GPIO */ + spin_lock_irqsave(&feature_lock, flags); + tmp = readb(addr); + tmp = (tmp & ~mask) | (value & mask); + DBG("Do write 0x%02x to GPIO %s (%p)\n", + tmp, func->node->full_name, addr); + writeb(tmp, addr); + spin_unlock_irqrestore(&feature_lock, flags); + + return 0; +} + +static int macio_do_gpio_read(PMF_STD_ARGS, u8 mask, int rshift, u8 xor) +{ + u8 __iomem *addr = (u8 __iomem *)func->driver_data; + u32 value; + + /* Check if we have room for reply */ + if (args == NULL || args->count == 0 || args->u[0].p == NULL) + return -EINVAL; + + value = readb(addr); + *args->u[0].p = ((value & mask) >> rshift) ^ xor; + + return 0; +} + +static int macio_do_delay(PMF_STD_ARGS, u32 duration) +{ + /* assume we can sleep ! */ + msleep((duration + 999) / 1000); + return 0; +} + +static struct pmf_handlers macio_gpio_handlers = { + .irq_enable = macio_do_gpio_irq_enable, + .irq_disable = macio_do_gpio_irq_disable, + .write_gpio = macio_do_gpio_write, + .read_gpio = macio_do_gpio_read, + .delay = macio_do_delay, +}; + +static void macio_gpio_init_one(struct macio_chip *macio) +{ + struct device_node *gparent, *gp; + + /* + * Find the "gpio" parent node + */ + + for (gparent = NULL; + (gparent = of_get_next_child(macio->of_node, gparent)) != NULL;) + if (strcmp(gparent->name, "gpio") == 0) + break; + if (gparent == NULL) + return; + + DBG("Installing GPIO functions for macio %s\n", + macio->of_node->full_name); + + /* + * Ok, got one, we dont need anything special to track them down, so + * we just create them all + */ + for (gp = NULL; (gp = of_get_next_child(gparent, gp)) != NULL;) { + u32 *reg = (u32 *)get_property(gp, "reg", NULL); + unsigned long offset; + if (reg == NULL) + continue; + offset = *reg; + /* Deal with old style device-tree. We can safely hard code the + * offset for now too even if it's a bit gross ... + */ + if (offset < 0x50) + offset += 0x50; + offset += (unsigned long)macio->base; + pmf_register_driver(gp, &macio_gpio_handlers, (void *)offset); + } + + DBG("Calling initial GPIO functions for macio %s\n", + macio->of_node->full_name); + + /* And now we run all the init ones */ + for (gp = NULL; (gp = of_get_next_child(gparent, gp)) != NULL;) + pmf_do_functions(gp, NULL, 0, PMF_FLAGS_ON_INIT, NULL); + + /* Note: We do not at this point implement the "at sleep" or "at wake" + * functions. I yet to find any for GPIOs anyway + */ +} + +static int macio_do_write_reg32(PMF_STD_ARGS, u32 offset, u32 value, u32 mask) +{ + struct macio_chip *macio = func->driver_data; + unsigned long flags; + + spin_lock_irqsave(&feature_lock, flags); + MACIO_OUT32(offset, (MACIO_IN32(offset) & ~mask) | (value & mask)); + spin_unlock_irqrestore(&feature_lock, flags); + return 0; +} + +static int macio_do_read_reg32(PMF_STD_ARGS, u32 offset) +{ + struct macio_chip *macio = func->driver_data; + + /* Check if we have room for reply */ + if (args == NULL || args->count == 0 || args->u[0].p == NULL) + return -EINVAL; + + *args->u[0].p = MACIO_IN32(offset); + return 0; +} + +static int macio_do_write_reg8(PMF_STD_ARGS, u32 offset, u8 value, u8 mask) +{ + struct macio_chip *macio = func->driver_data; + unsigned long flags; + + spin_lock_irqsave(&feature_lock, flags); + MACIO_OUT8(offset, (MACIO_IN8(offset) & ~mask) | (value & mask)); + spin_unlock_irqrestore(&feature_lock, flags); + return 0; +} + +static int macio_do_read_reg8(PMF_STD_ARGS, u32 offset) +{ + struct macio_chip *macio = func->driver_data; + + /* Check if we have room for reply */ + if (args == NULL || args->count == 0 || args->u[0].p == NULL) + return -EINVAL; + + *((u8 *)(args->u[0].p)) = MACIO_IN8(offset); + return 0; +} + +static int macio_do_read_reg32_msrx(PMF_STD_ARGS, u32 offset, u32 mask, + u32 shift, u32 xor) +{ + struct macio_chip *macio = func->driver_data; + + /* Check if we have room for reply */ + if (args == NULL || args->count == 0 || args->u[0].p == NULL) + return -EINVAL; + + *args->u[0].p = ((MACIO_IN32(offset) & mask) >> shift) ^ xor; + return 0; +} + +static int macio_do_read_reg8_msrx(PMF_STD_ARGS, u32 offset, u32 mask, + u32 shift, u32 xor) +{ + struct macio_chip *macio = func->driver_data; + + /* Check if we have room for reply */ + if (args == NULL || args->count == 0 || args->u[0].p == NULL) + return -EINVAL; + + *((u8 *)(args->u[0].p)) = ((MACIO_IN8(offset) & mask) >> shift) ^ xor; + return 0; +} + +static int macio_do_write_reg32_slm(PMF_STD_ARGS, u32 offset, u32 shift, + u32 mask) +{ + struct macio_chip *macio = func->driver_data; + unsigned long flags; + u32 tmp, val; + + /* Check args */ + if (args == NULL || args->count == 0) + return -EINVAL; + + spin_lock_irqsave(&feature_lock, flags); + tmp = MACIO_IN32(offset); + val = args->u[0].v << shift; + tmp = (tmp & ~mask) | (val & mask); + MACIO_OUT32(offset, tmp); + spin_unlock_irqrestore(&feature_lock, flags); + return 0; +} + +static int macio_do_write_reg8_slm(PMF_STD_ARGS, u32 offset, u32 shift, + u32 mask) +{ + struct macio_chip *macio = func->driver_data; + unsigned long flags; + u32 tmp, val; + + /* Check args */ + if (args == NULL || args->count == 0) + return -EINVAL; + + spin_lock_irqsave(&feature_lock, flags); + tmp = MACIO_IN8(offset); + val = args->u[0].v << shift; + tmp = (tmp & ~mask) | (val & mask); + MACIO_OUT8(offset, tmp); + spin_unlock_irqrestore(&feature_lock, flags); + return 0; +} + +static struct pmf_handlers macio_mmio_handlers = { + .write_reg32 = macio_do_write_reg32, + .read_reg32 = macio_do_read_reg32, + .write_reg8 = macio_do_write_reg8, + .read_reg32 = macio_do_read_reg8, + .read_reg32_msrx = macio_do_read_reg32_msrx, + .read_reg8_msrx = macio_do_read_reg8_msrx, + .write_reg32_slm = macio_do_write_reg32_slm, + .write_reg8_slm = macio_do_write_reg8_slm, + .delay = macio_do_delay, +}; + +static void macio_mmio_init_one(struct macio_chip *macio) +{ + DBG("Installing MMIO functions for macio %s\n", + macio->of_node->full_name); + + pmf_register_driver(macio->of_node, &macio_mmio_handlers, macio); +} + +static struct device_node *unin_hwclock; + +static int unin_do_write_reg32(PMF_STD_ARGS, u32 offset, u32 value, u32 mask) +{ + unsigned long flags; + + spin_lock_irqsave(&feature_lock, flags); + /* This is fairly bogus in darwin, but it should work for our needs + * implemeted that way: + */ + UN_OUT(offset, (UN_IN(offset) & ~mask) | (value & mask)); + spin_unlock_irqrestore(&feature_lock, flags); + return 0; +} + + +static struct pmf_handlers unin_mmio_handlers = { + .write_reg32 = unin_do_write_reg32, + .delay = macio_do_delay, +}; + +static void uninorth_install_pfunc(void) +{ + struct device_node *np; + + DBG("Installing functions for UniN %s\n", + uninorth_node->full_name); + + /* + * Install handlers for the bridge itself + */ + pmf_register_driver(uninorth_node, &unin_mmio_handlers, NULL); + pmf_do_functions(uninorth_node, NULL, 0, PMF_FLAGS_ON_INIT, NULL); + + + /* + * Install handlers for the hwclock child if any + */ + for (np = NULL; (np = of_get_next_child(uninorth_node, np)) != NULL;) + if (strcmp(np->name, "hw-clock") == 0) { + unin_hwclock = np; + break; + } + if (unin_hwclock) { + DBG("Installing functions for UniN clock %s\n", + unin_hwclock->full_name); + pmf_register_driver(unin_hwclock, &unin_mmio_handlers, NULL); + pmf_do_functions(unin_hwclock, NULL, 0, PMF_FLAGS_ON_INIT, + NULL); + } +} + +/* We export this as the SMP code might init us early */ +int __init pmac_pfunc_base_install(void) +{ + static int pfbase_inited; + int i; + + if (pfbase_inited) + return 0; + pfbase_inited = 1; + + + DBG("Installing base platform functions...\n"); + + /* + * Locate mac-io chips and install handlers + */ + for (i = 0 ; i < MAX_MACIO_CHIPS; i++) { + if (macio_chips[i].of_node) { + macio_mmio_init_one(&macio_chips[i]); + macio_gpio_init_one(&macio_chips[i]); + } + } + + /* + * Install handlers for northbridge and direct mapped hwclock + * if any. We do not implement the config space access callback + * which is only ever used for functions that we do not call in + * the current driver (enabling/disabling cells in U2, mostly used + * to restore the PCI settings, we do that differently) + */ + if (uninorth_node && uninorth_base) + uninorth_install_pfunc(); + + DBG("All base functions installed\n"); + + return 0; +} + +arch_initcall(pmac_pfunc_base_install); + +#ifdef CONFIG_PM + +/* Those can be called by pmac_feature. Ultimately, I should use a sysdev + * or a device, but for now, that's good enough until I sort out some + * ordering issues. Also, we do not bother with GPIOs, as so far I yet have + * to see a case where a GPIO function has the on-suspend or on-resume bit + */ +void pmac_pfunc_base_suspend(void) +{ + int i; + + for (i = 0 ; i < MAX_MACIO_CHIPS; i++) { + if (macio_chips[i].of_node) + pmf_do_functions(macio_chips[i].of_node, NULL, 0, + PMF_FLAGS_ON_SLEEP, NULL); + } + if (uninorth_node) + pmf_do_functions(uninorth_node, NULL, 0, + PMF_FLAGS_ON_SLEEP, NULL); + if (unin_hwclock) + pmf_do_functions(unin_hwclock, NULL, 0, + PMF_FLAGS_ON_SLEEP, NULL); +} + +void pmac_pfunc_base_resume(void) +{ + int i; + + if (unin_hwclock) + pmf_do_functions(unin_hwclock, NULL, 0, + PMF_FLAGS_ON_WAKE, NULL); + if (uninorth_node) + pmf_do_functions(uninorth_node, NULL, 0, + PMF_FLAGS_ON_WAKE, NULL); + for (i = 0 ; i < MAX_MACIO_CHIPS; i++) { + if (macio_chips[i].of_node) + pmf_do_functions(macio_chips[i].of_node, NULL, 0, + PMF_FLAGS_ON_WAKE, NULL); + } +} + +#endif /* CONFIG_PM */ Index: linux-work/arch/powerpc/platforms/powermac/pfunc_core.c =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 +++ linux-work/arch/powerpc/platforms/powermac/pfunc_core.c 2006-01-07 10:54:03.000000000 +1100 @@ -0,0 +1,989 @@ +/* + * + * FIXME: Properly make this race free with refcounting etc... + * + * FIXME: LOCKING !!! + */ + +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +/* Debug */ +#define LOG_PARSE(fmt...) +#define LOG_ERROR(fmt...) printk(fmt) +#define LOG_BLOB(t,b,c) +#define DBG(fmt...) printk(fmt) + +/* Command numbers */ +#define PMF_CMD_LIST 0 +#define PMF_CMD_WRITE_GPIO 1 +#define PMF_CMD_READ_GPIO 2 +#define PMF_CMD_WRITE_REG32 3 +#define PMF_CMD_READ_REG32 4 +#define PMF_CMD_WRITE_REG16 5 +#define PMF_CMD_READ_REG16 6 +#define PMF_CMD_WRITE_REG8 7 +#define PMF_CMD_READ_REG8 8 +#define PMF_CMD_DELAY 9 +#define PMF_CMD_WAIT_REG32 10 +#define PMF_CMD_WAIT_REG16 11 +#define PMF_CMD_WAIT_REG8 12 +#define PMF_CMD_READ_I2C 13 +#define PMF_CMD_WRITE_I2C 14 +#define PMF_CMD_RMW_I2C 15 +#define PMF_CMD_GEN_I2C 16 +#define PMF_CMD_SHIFT_BYTES_RIGHT 17 +#define PMF_CMD_SHIFT_BYTES_LEFT 18 +#define PMF_CMD_READ_CFG 19 +#define PMF_CMD_WRITE_CFG 20 +#define PMF_CMD_RMW_CFG 21 +#define PMF_CMD_READ_I2C_SUBADDR 22 +#define PMF_CMD_WRITE_I2C_SUBADDR 23 +#define PMF_CMD_SET_I2C_MODE 24 +#define PMF_CMD_RMW_I2C_SUBADDR 25 +#define PMF_CMD_READ_REG32_MASK_SHR_XOR 26 +#define PMF_CMD_READ_REG16_MASK_SHR_XOR 27 +#define PMF_CMD_READ_REG8_MASK_SHR_XOR 28 +#define PMF_CMD_WRITE_REG32_SHL_MASK 29 +#define PMF_CMD_WRITE_REG16_SHL_MASK 30 +#define PMF_CMD_WRITE_REG8_SHL_MASK 31 +#define PMF_CMD_MASK_AND_COMPARE 32 +#define PMF_CMD_COUNT 33 + +/* This structure holds the state of the parser while walking through + * a function definition + */ +struct pmf_cmd { + const void *cmdptr; + const void *cmdend; + struct pmf_function *func; + void *instdata; + struct pmf_args *args; + int error; +}; + +#if 0 +/* Debug output */ +static void print_blob(const char *title, const void *blob, int bytes) +{ + printk("%s", title); + while(bytes--) { + printk("%02x ", *((u8 *)blob)); + blob += 1; + } + printk("\n"); +} +#endif + +/* + * Parser helpers + */ + +static u32 pmf_next32(struct pmf_cmd *cmd) +{ + u32 value; + if ((cmd->cmdend - cmd->cmdptr) < 4) { + cmd->error = 1; + return 0; + } + value = *((u32 *)cmd->cmdptr); + cmd->cmdptr += 4; + return value; +} + +static const void* pmf_next_blob(struct pmf_cmd *cmd, int count) +{ + const void *value; + if ((cmd->cmdend - cmd->cmdptr) < count) { + cmd->error = 1; + return NULL; + } + value = cmd->cmdptr; + cmd->cmdptr += count; + return value; +} + +/* + * Individual command parsers + */ + +#define PMF_PARSE_CALL(name, cmd, handlers, p...) \ + do { \ + if (cmd->error) \ + return -ENXIO; \ + if (handlers == NULL) \ + return 0; \ + if (handlers->name) \ + return handlers->name(cmd->func, cmd->instdata, \ + cmd->args, p); \ + return -1; \ + } while(0) \ + + +static int pmf_parser_write_gpio(struct pmf_cmd *cmd, struct pmf_handlers *h) +{ + u8 value = (u8)pmf_next32(cmd); + u8 mask = (u8)pmf_next32(cmd); + + LOG_PARSE("pmf: write_gpio(value: %02x, mask: %02x)\n", value, mask); + + PMF_PARSE_CALL(write_gpio, cmd, h, value, mask); +} + +static int pmf_parser_read_gpio(struct pmf_cmd *cmd, struct pmf_handlers *h) +{ + u8 mask = (u8)pmf_next32(cmd); + int rshift = (int)pmf_next32(cmd); + u8 xor = (u8)pmf_next32(cmd); + + LOG_PARSE("pmf: read_gpio(mask: %02x, rshift: %d, xor: %02x)\n", + mask, rshift, xor); + + PMF_PARSE_CALL(read_gpio, cmd, h, mask, rshift, xor); +} + +static int pmf_parser_write_reg32(struct pmf_cmd *cmd, struct pmf_handlers *h) +{ + u32 offset = pmf_next32(cmd); + u32 value = pmf_next32(cmd); + u32 mask = pmf_next32(cmd); + + LOG_PARSE("pmf: write_reg32(offset: %08x, value: %08x, mask: %08x)\n", + offset, value, mask); + + PMF_PARSE_CALL(write_reg32, cmd, h, offset, value, mask); +} + +static int pmf_parser_read_reg32(struct pmf_cmd *cmd, struct pmf_handlers *h) +{ + u32 offset = pmf_next32(cmd); + + LOG_PARSE("pmf: read_reg32(offset: %08x)\n", offset); + + PMF_PARSE_CALL(read_reg32, cmd, h, offset); +} + + +static int pmf_parser_write_reg16(struct pmf_cmd *cmd, struct pmf_handlers *h) +{ + u32 offset = pmf_next32(cmd); + u16 value = (u16)pmf_next32(cmd); + u16 mask = (u16)pmf_next32(cmd); + + LOG_PARSE("pmf: write_reg16(offset: %08x, value: %04x, mask: %04x)\n", + offset, value, mask); + + PMF_PARSE_CALL(write_reg16, cmd, h, offset, value, mask); +} + +static int pmf_parser_read_reg16(struct pmf_cmd *cmd, struct pmf_handlers *h) +{ + u32 offset = pmf_next32(cmd); + + LOG_PARSE("pmf: read_reg16(offset: %08x)\n", offset); + + PMF_PARSE_CALL(read_reg16, cmd, h, offset); +} + + +static int pmf_parser_write_reg8(struct pmf_cmd *cmd, struct pmf_handlers *h) +{ + u32 offset = pmf_next32(cmd); + u8 value = (u16)pmf_next32(cmd); + u8 mask = (u16)pmf_next32(cmd); + + LOG_PARSE("pmf: write_reg8(offset: %08x, value: %02x, mask: %02x)\n", + offset, value, mask); + + PMF_PARSE_CALL(write_reg8, cmd, h, offset, value, mask); +} + +static int pmf_parser_read_reg8(struct pmf_cmd *cmd, struct pmf_handlers *h) +{ + u32 offset = pmf_next32(cmd); + + LOG_PARSE("pmf: read_reg8(offset: %08x)\n", offset); + + PMF_PARSE_CALL(read_reg8, cmd, h, offset); +} + +static int pmf_parser_delay(struct pmf_cmd *cmd, struct pmf_handlers *h) +{ + u32 duration = pmf_next32(cmd); + + LOG_PARSE("pmf: delay(duration: %d us)\n", duration); + + PMF_PARSE_CALL(delay, cmd, h, duration); +} + +static int pmf_parser_wait_reg32(struct pmf_cmd *cmd, struct pmf_handlers *h) +{ + u32 offset = pmf_next32(cmd); + u32 value = pmf_next32(cmd); + u32 mask = pmf_next32(cmd); + + LOG_PARSE("pmf: wait_reg32(offset: %08x, comp_value: %08x,mask: %08x)\n", + offset, value, mask); + + PMF_PARSE_CALL(wait_reg32, cmd, h, offset, value, mask); +} + +static int pmf_parser_wait_reg16(struct pmf_cmd *cmd, struct pmf_handlers *h) +{ + u32 offset = pmf_next32(cmd); + u16 value = (u16)pmf_next32(cmd); + u16 mask = (u16)pmf_next32(cmd); + + LOG_PARSE("pmf: wait_reg16(offset: %08x, comp_value: %04x,mask: %04x)\n", + offset, value, mask); + + PMF_PARSE_CALL(wait_reg16, cmd, h, offset, value, mask); +} + +static int pmf_parser_wait_reg8(struct pmf_cmd *cmd, struct pmf_handlers *h) +{ + u32 offset = pmf_next32(cmd); + u8 value = (u8)pmf_next32(cmd); + u8 mask = (u8)pmf_next32(cmd); + + LOG_PARSE("pmf: wait_reg8(offset: %08x, comp_value: %02x,mask: %02x)\n", + offset, value, mask); + + PMF_PARSE_CALL(wait_reg8, cmd, h, offset, value, mask); +} + +static int pmf_parser_read_i2c(struct pmf_cmd *cmd, struct pmf_handlers *h) +{ + u32 bytes = pmf_next32(cmd); + + LOG_PARSE("pmf: read_i2c(bytes: %ud)\n", bytes); + + PMF_PARSE_CALL(read_i2c, cmd, h, bytes); +} + +static int pmf_parser_write_i2c(struct pmf_cmd *cmd, struct pmf_handlers *h) +{ + u32 bytes = pmf_next32(cmd); + const void *blob = pmf_next_blob(cmd, bytes); + + LOG_PARSE("pmf: write_i2c(bytes: %ud) ...\n", bytes); + LOG_BLOB("pmf: data: \n", blob, bytes); + + PMF_PARSE_CALL(write_i2c, cmd, h, bytes, blob); +} + + +static int pmf_parser_rmw_i2c(struct pmf_cmd *cmd, struct pmf_handlers *h) +{ + u32 maskbytes = pmf_next32(cmd); + u32 valuesbytes = pmf_next32(cmd); + u32 totalbytes = pmf_next32(cmd); + const void *maskblob = pmf_next_blob(cmd, maskbytes); + const void *valuesblob = pmf_next_blob(cmd, valuesbytes); + + LOG_PARSE("pmf: rmw_i2c(maskbytes: %ud, valuebytes: %ud, " + "totalbytes: %d) ...\n", + maskbytes, valuesbytes, totalbytes); + LOG_BLOB("pmf: mask data: \n", maskblob, maskbytes); + LOG_BLOB("pmf: values data: \n", valuesblob, valuesbytes); + + PMF_PARSE_CALL(rmw_i2c, cmd, h, maskbytes, valuesbytes, totalbytes, + maskblob, valuesblob); +} + +static int pmf_parser_read_cfg(struct pmf_cmd *cmd, struct pmf_handlers *h) +{ + u32 offset = pmf_next32(cmd); + u32 bytes = pmf_next32(cmd); + + LOG_PARSE("pmf: read_cfg(offset: %x, bytes: %ud)\n", offset, bytes); + + PMF_PARSE_CALL(read_cfg, cmd, h, offset, bytes); +} + + +static int pmf_parser_write_cfg(struct pmf_cmd *cmd, struct pmf_handlers *h) +{ + u32 offset = pmf_next32(cmd); + u32 bytes = pmf_next32(cmd); + const void *blob = pmf_next_blob(cmd, bytes); + + LOG_PARSE("pmf: write_cfg(offset: %x, bytes: %ud)\n", offset, bytes); + LOG_BLOB("pmf: data: \n", blob, bytes); + + PMF_PARSE_CALL(write_cfg, cmd, h, offset, bytes, blob); +} + +static int pmf_parser_rmw_cfg(struct pmf_cmd *cmd, struct pmf_handlers *h) +{ + u32 offset = pmf_next32(cmd); + u32 maskbytes = pmf_next32(cmd); + u32 valuesbytes = pmf_next32(cmd); + u32 totalbytes = pmf_next32(cmd); + const void *maskblob = pmf_next_blob(cmd, maskbytes); + const void *valuesblob = pmf_next_blob(cmd, valuesbytes); + + LOG_PARSE("pmf: rmw_cfg(maskbytes: %ud, valuebytes: %ud," + " totalbytes: %d) ...\n", + maskbytes, valuesbytes, totalbytes); + LOG_BLOB("pmf: mask data: \n", maskblob, maskbytes); + LOG_BLOB("pmf: values data: \n", valuesblob, valuesbytes); + + PMF_PARSE_CALL(rmw_cfg, cmd, h, offset, maskbytes, valuesbytes, + totalbytes, maskblob, valuesblob); +} + + +static int pmf_parser_read_i2c_sub(struct pmf_cmd *cmd, struct pmf_handlers *h) +{ + u8 subaddr = (u8)pmf_next32(cmd); + u32 bytes = pmf_next32(cmd); + + LOG_PARSE("pmf: read_i2c_sub(subaddr: %x, bytes: %ud)\n", + subaddr, bytes); + + PMF_PARSE_CALL(read_i2c_sub, cmd, h, subaddr, bytes); +} + +static int pmf_parser_write_i2c_sub(struct pmf_cmd *cmd, struct pmf_handlers *h) +{ + u8 subaddr = (u8)pmf_next32(cmd); + u32 bytes = pmf_next32(cmd); + const void *blob = pmf_next_blob(cmd, bytes); + + LOG_PARSE("pmf: write_i2c_sub(subaddr: %x, bytes: %ud) ...\n", + subaddr, bytes); + LOG_BLOB("pmf: data: \n", blob, bytes); + + PMF_PARSE_CALL(write_i2c_sub, cmd, h, subaddr, bytes, blob); +} + +static int pmf_parser_set_i2c_mode(struct pmf_cmd *cmd, struct pmf_handlers *h) +{ + u32 mode = pmf_next32(cmd); + + LOG_PARSE("pmf: set_i2c_mode(mode: %d)\n", mode); + + PMF_PARSE_CALL(set_i2c_mode, cmd, h, mode); +} + + +static int pmf_parser_rmw_i2c_sub(struct pmf_cmd *cmd, struct pmf_handlers *h) +{ + u8 subaddr = (u8)pmf_next32(cmd); + u32 maskbytes = pmf_next32(cmd); + u32 valuesbytes = pmf_next32(cmd); + u32 totalbytes = pmf_next32(cmd); + const void *maskblob = pmf_next_blob(cmd, maskbytes); + const void *valuesblob = pmf_next_blob(cmd, valuesbytes); + + LOG_PARSE("pmf: rmw_i2c_sub(subaddr: %x, maskbytes: %ud, valuebytes: %ud" + ", totalbytes: %d) ...\n", + subaddr, maskbytes, valuesbytes, totalbytes); + LOG_BLOB("pmf: mask data: \n", maskblob, maskbytes); + LOG_BLOB("pmf: values data: \n", valuesblob, valuesbytes); + + PMF_PARSE_CALL(rmw_i2c_sub, cmd, h, subaddr, maskbytes, valuesbytes, + totalbytes, maskblob, valuesblob); +} + +static int pmf_parser_read_reg32_msrx(struct pmf_cmd *cmd, + struct pmf_handlers *h) +{ + u32 offset = pmf_next32(cmd); + u32 mask = pmf_next32(cmd); + u32 shift = pmf_next32(cmd); + u32 xor = pmf_next32(cmd); + + LOG_PARSE("pmf: read_reg32_msrx(offset: %x, mask: %x, shift: %x," + " xor: %x\n", offset, mask, shift, xor); + + PMF_PARSE_CALL(read_reg32_msrx, cmd, h, offset, mask, shift, xor); +} + +static int pmf_parser_read_reg16_msrx(struct pmf_cmd *cmd, + struct pmf_handlers *h) +{ + u32 offset = pmf_next32(cmd); + u32 mask = pmf_next32(cmd); + u32 shift = pmf_next32(cmd); + u32 xor = pmf_next32(cmd); + + LOG_PARSE("pmf: read_reg16_msrx(offset: %x, mask: %x, shift: %x," + " xor: %x\n", offset, mask, shift, xor); + + PMF_PARSE_CALL(read_reg16_msrx, cmd, h, offset, mask, shift, xor); +} +static int pmf_parser_read_reg8_msrx(struct pmf_cmd *cmd, + struct pmf_handlers *h) +{ + u32 offset = pmf_next32(cmd); + u32 mask = pmf_next32(cmd); + u32 shift = pmf_next32(cmd); + u32 xor = pmf_next32(cmd); + + LOG_PARSE("pmf: read_reg8_msrx(offset: %x, mask: %x, shift: %x," + " xor: %x\n", offset, mask, shift, xor); + + PMF_PARSE_CALL(read_reg8_msrx, cmd, h, offset, mask, shift, xor); +} + +static int pmf_parser_write_reg32_slm(struct pmf_cmd *cmd, + struct pmf_handlers *h) +{ + u32 offset = pmf_next32(cmd); + u32 shift = pmf_next32(cmd); + u32 mask = pmf_next32(cmd); + + LOG_PARSE("pmf: write_reg32_slm(offset: %x, shift: %x, mask: %x\n", + offset, shift, mask); + + PMF_PARSE_CALL(write_reg32_slm, cmd, h, offset, shift, mask); +} + +static int pmf_parser_write_reg16_slm(struct pmf_cmd *cmd, + struct pmf_handlers *h) +{ + u32 offset = pmf_next32(cmd); + u32 shift = pmf_next32(cmd); + u32 mask = pmf_next32(cmd); + + LOG_PARSE("pmf: write_reg16_slm(offset: %x, shift: %x, mask: %x\n", + offset, shift, mask); + + PMF_PARSE_CALL(write_reg16_slm, cmd, h, offset, shift, mask); +} + +static int pmf_parser_write_reg8_slm(struct pmf_cmd *cmd, + struct pmf_handlers *h) +{ + u32 offset = pmf_next32(cmd); + u32 shift = pmf_next32(cmd); + u32 mask = pmf_next32(cmd); + + LOG_PARSE("pmf: write_reg8_slm(offset: %x, shift: %x, mask: %x\n", + offset, shift, mask); + + PMF_PARSE_CALL(write_reg8_slm, cmd, h, offset, shift, mask); +} + +static int pmf_parser_mask_and_compare(struct pmf_cmd *cmd, + struct pmf_handlers *h) +{ + u32 bytes = pmf_next32(cmd); + const void *maskblob = pmf_next_blob(cmd, bytes); + const void *valuesblob = pmf_next_blob(cmd, bytes); + + LOG_PARSE("pmf: mask_and_compare(length: %ud ...\n", bytes); + LOG_BLOB("pmf: mask data: \n", maskblob, bytes); + LOG_BLOB("pmf: values data: \n", valuesblob, bytes); + + PMF_PARSE_CALL(mask_and_compare, cmd, h, + bytes, maskblob, valuesblob); +} + + +typedef int (*pmf_cmd_parser_t)(struct pmf_cmd *cmd, struct pmf_handlers *h); + +static pmf_cmd_parser_t pmf_parsers[PMF_CMD_COUNT] = +{ + NULL, + pmf_parser_write_gpio, + pmf_parser_read_gpio, + pmf_parser_write_reg32, + pmf_parser_read_reg32, + pmf_parser_write_reg16, + pmf_parser_read_reg16, + pmf_parser_write_reg8, + pmf_parser_read_reg8, + pmf_parser_delay, + pmf_parser_wait_reg32, + pmf_parser_wait_reg16, + pmf_parser_wait_reg8, + pmf_parser_read_i2c, + pmf_parser_write_i2c, + pmf_parser_rmw_i2c, + NULL, /* Bogus command */ + NULL, /* Shift bytes right: NYI */ + NULL, /* Shift bytes left: NYI */ + pmf_parser_read_cfg, + pmf_parser_write_cfg, + pmf_parser_rmw_cfg, + pmf_parser_read_i2c_sub, + pmf_parser_write_i2c_sub, + pmf_parser_set_i2c_mode, + pmf_parser_rmw_i2c_sub, + pmf_parser_read_reg32_msrx, + pmf_parser_read_reg16_msrx, + pmf_parser_read_reg8_msrx, + pmf_parser_write_reg32_slm, + pmf_parser_write_reg16_slm, + pmf_parser_write_reg8_slm, + pmf_parser_mask_and_compare, +}; + +struct pmf_device { + struct list_head link; + struct device_node *node; + struct pmf_handlers *handlers; + struct list_head functions; + struct kref ref; +}; + +static LIST_HEAD(pmf_devices); +static spinlock_t pmf_lock = SPIN_LOCK_UNLOCKED; + +static void pmf_release_device(struct kref *kref) +{ + struct pmf_device *dev = container_of(kref, struct pmf_device, ref); + kfree(dev); +} + +static inline void pmf_put_device(struct pmf_device *dev) +{ + kref_put(&dev->ref, pmf_release_device); +} + +static inline struct pmf_device *pmf_get_device(struct pmf_device *dev) +{ + kref_get(&dev->ref); + return dev; +} + +static inline struct pmf_device *pmf_find_device(struct device_node *np) +{ + struct pmf_device *dev; + + list_for_each_entry(dev, &pmf_devices, link) { + if (dev->node == np) + return pmf_get_device(dev); + } + return NULL; +} + +static int pmf_parse_one(struct pmf_function *func, + struct pmf_handlers *handlers, + void *instdata, struct pmf_args *args) +{ + struct pmf_cmd cmd; + u32 ccode; + int count, rc; + + cmd.cmdptr = func->data; + cmd.cmdend = func->data + func->length; + cmd.func = func; + cmd.instdata = instdata; + cmd.args = args; + cmd.error = 0; + + LOG_PARSE("pmf: func %s, %d bytes, %s...\n", + func->name, func->length, + handlers ? "executing" : "parsing"); + + /* One subcommand to parse for now */ + count = 1; + + while(count-- && cmd.cmdptr < cmd.cmdend) { + /* Get opcode */ + ccode = pmf_next32(&cmd); + /* Check if we are hitting a command list, fetch new count */ + if (ccode == 0) { + count = pmf_next32(&cmd) - 1; + ccode = pmf_next32(&cmd); + } + if (cmd.error) { + LOG_ERROR("pmf: parse error, not enough data\n"); + return -ENXIO; + } + if (ccode >= PMF_CMD_COUNT) { + LOG_ERROR("pmf: command code %d unknown !\n", ccode); + return -ENXIO; + } + if (pmf_parsers[ccode] == NULL) { + LOG_ERROR("pmf: no parser for command %d !\n", ccode); + return -ENXIO; + } + rc = pmf_parsers[ccode](&cmd, handlers); + if (rc != 0) { + LOG_ERROR("pmf: parser for command %d returned" + " error %d\n", ccode, rc); + return rc; + } + } + + /* We are doing an initial parse pass, we need to adjust the size */ + if (handlers == NULL) + func->length = cmd.cmdptr - func->data; + + return 0; +} + +static int pmf_add_function_prop(struct pmf_device *dev, void *driverdata, + const char *name, u32 *data, + unsigned int length) +{ + int count = 0; + struct pmf_function *func = NULL; + + DBG("pmf: Adding functions for platform-do-%s\n", name); + + while (length >= 12) { + /* Allocate a structure */ + func = kzalloc(sizeof(struct pmf_function), GFP_KERNEL); + if (func == NULL) + goto bail; + kref_init(&func->ref); + INIT_LIST_HEAD(&func->irq_clients); + func->node = dev->node; + func->driver_data = driverdata; + func->name = name; + func->phandle = data[0]; + func->flags = data[1]; + data += 2; + length -= 8; + func->data = data; + func->length = length; + func->dev = dev; + DBG("pmf: idx %d: flags=%08x, phandle=%08x " + " %d bytes remaining, parsing...\n", + count+1, func->flags, func->phandle, length); + if (pmf_parse_one(func, NULL, NULL, NULL)) { + kfree(func); + goto bail; + } + length -= func->length; + data = (u32 *)(((u8 *)data) + func->length); + list_add(&func->link, &dev->functions); + pmf_get_device(dev); + count++; + } + bail: + DBG("pmf: Added %d functions\n", count); + + return count; +} + +static int pmf_add_functions(struct pmf_device *dev, void *driverdata) +{ + struct property *pp; +#define PP_PREFIX "platform-do-" + const int plen = strlen(PP_PREFIX); + int count = 0; + + for (pp = dev->node->properties; pp != 0; pp = pp->next) { + char *name; + if (strncmp(pp->name, PP_PREFIX, plen) != 0) + continue; + name = pp->name + plen; + if (strlen(name) && pp->length >= 12) + count += pmf_add_function_prop(dev, driverdata, name, + (u32 *)pp->value, + pp->length); + } + return count; +} + + +int pmf_register_driver(struct device_node *np, + struct pmf_handlers *handlers, + void *driverdata) +{ + struct pmf_device *dev; + unsigned long flags; + int rc = 0; + + if (handlers == NULL) + return -EINVAL; + + DBG("pmf: registering driver for node %s\n", np->full_name); + + spin_lock_irqsave(&pmf_lock, flags); + dev = pmf_find_device(np); + spin_unlock_irqrestore(&pmf_lock, flags); + if (dev != NULL) { + DBG("pmf: already there !\n"); + pmf_put_device(dev); + return -EBUSY; + } + + dev = kzalloc(sizeof(struct pmf_device), GFP_KERNEL); + if (dev == NULL) { + DBG("pmf: no memory !\n"); + return -ENOMEM; + } + kref_init(&dev->ref); + dev->node = of_node_get(np); + dev->handlers = handlers; + INIT_LIST_HEAD(&dev->functions); + + rc = pmf_add_functions(dev, driverdata); + if (rc == 0) { + DBG("pmf: no functions, disposing.. \n"); + of_node_put(np); + kfree(dev); + return -ENODEV; + } + + spin_lock_irqsave(&pmf_lock, flags); + list_add(&dev->link, &pmf_devices); + spin_unlock_irqrestore(&pmf_lock, flags); + + return 0; +} +EXPORT_SYMBOL_GPL(pmf_register_driver); + +struct pmf_function *pmf_get_function(struct pmf_function *func) +{ + if (!try_module_get(func->dev->handlers->owner)) + return NULL; + kref_get(&func->ref); + return func; +} +EXPORT_SYMBOL_GPL(pmf_get_function); + +static void pmf_release_function(struct kref *kref) +{ + struct pmf_function *func = + container_of(kref, struct pmf_function, ref); + pmf_put_device(func->dev); + kfree(func); +} + +static inline void __pmf_put_function(struct pmf_function *func) +{ + kref_put(&func->ref, pmf_release_function); +} + +void pmf_put_function(struct pmf_function *func) +{ + if (func == NULL) + return; + module_put(func->dev->handlers->owner); + __pmf_put_function(func); +} +EXPORT_SYMBOL_GPL(pmf_put_function); + +void pmf_unregister_driver(struct device_node *np) +{ + struct pmf_device *dev; + unsigned long flags; + + DBG("pmf: unregistering driver for node %s\n", np->full_name); + + spin_lock_irqsave(&pmf_lock, flags); + dev = pmf_find_device(np); + if (dev == NULL) { + DBG("pmf: not such driver !\n"); + spin_unlock_irqrestore(&pmf_lock, flags); + return; + } + list_del(&dev->link); + + while(!list_empty(&dev->functions)) { + struct pmf_function *func = + list_entry(dev->functions.next, typeof(*func), link); + list_del(&func->link); + __pmf_put_function(func); + } + + pmf_put_device(dev); + spin_unlock_irqrestore(&pmf_lock, flags); +} +EXPORT_SYMBOL_GPL(pmf_unregister_driver); + +struct pmf_function *__pmf_find_function(struct device_node *target, + const char *name, u32 flags) +{ + struct device_node *actor = of_node_get(target); + struct pmf_device *dev; + struct pmf_function *func, *result = NULL; + char fname[64]; + u32 *prop, ph; + + /* + * Look for a "platform-*" function reference. If we can't find + * one, then we fallback to a direct call attempt + */ + snprintf(fname, 63, "platform-%s", name); + prop = (u32 *)get_property(target, fname, NULL); + if (prop == NULL) + goto find_it; + ph = *prop; + if (ph == 0) + goto find_it; + + /* + * Ok, now try to find the actor. If we can't find it, we fail, + * there is no point in falling back there + */ + of_node_put(actor); + actor = of_find_node_by_phandle(ph); + if (actor == NULL) + return NULL; + find_it: + dev = pmf_find_device(actor); + if (dev == NULL) + return NULL; + + list_for_each_entry(func, &dev->functions, link) { + if (name && strcmp(name, func->name)) + continue; + if (func->phandle && target->node != func->phandle) + continue; + if ((func->flags & flags) == 0) + continue; + result = func; + break; + } + of_node_put(actor); + pmf_put_device(dev); + return result; +} + + +int pmf_register_irq_client(struct device_node *target, + const char *name, + struct pmf_irq_client *client) +{ + struct pmf_function *func; + unsigned long flags; + + spin_lock_irqsave(&pmf_lock, flags); + func = __pmf_find_function(target, name, PMF_FLAGS_INT_GEN); + if (func == NULL) { + spin_unlock_irqrestore(&pmf_lock, flags); + return -ENODEV; + } + list_add(&client->link, &func->irq_clients); + spin_unlock_irqrestore(&pmf_lock, flags); + + return 0; +} +EXPORT_SYMBOL_GPL(pmf_register_irq_client); + +void pmf_unregister_irq_client(struct device_node *np, + const char *name, + struct pmf_irq_client *client) +{ + unsigned long flags; + + spin_lock_irqsave(&pmf_lock, flags); + list_del(&client->link); + spin_unlock_irqrestore(&pmf_lock, flags); +} +EXPORT_SYMBOL_GPL(pmf_unregister_irq_client); + + +void pmf_do_irq(struct pmf_function *func) +{ + unsigned long flags; + struct pmf_irq_client *client; + + /* For now, using a spinlock over the whole function. Can be made + * to drop the lock using 2 lists if necessary + */ + spin_lock_irqsave(&pmf_lock, flags); + list_for_each_entry(client, &func->irq_clients, link) { + if (!try_module_get(client->owner)) + continue; + client->handler(client->data); + module_put(client->owner); + } + spin_unlock_irqrestore(&pmf_lock, flags); +} +EXPORT_SYMBOL_GPL(pmf_do_irq); + + +int pmf_call_one(struct pmf_function *func, struct pmf_args *args) +{ + struct pmf_device *dev = func->dev; + void *instdata = NULL; + int rc = 0; + + DBG(" ** pmf_call_one(%s/%s) **\n", dev->node->full_name, func->name); + + if (dev->handlers->begin) + instdata = dev->handlers->begin(func, args); + rc = pmf_parse_one(func, dev->handlers, instdata, args); + if (dev->handlers->end) + dev->handlers->end(func, instdata); + + return rc; +} +EXPORT_SYMBOL_GPL(pmf_call_one); + +int pmf_do_functions(struct device_node *np, const char *name, + u32 phandle, u32 fflags, struct pmf_args *args) +{ + struct pmf_device *dev; + struct pmf_function *func, *tmp; + unsigned long flags; + int rc = -ENODEV; + + spin_lock_irqsave(&pmf_lock, flags); + + dev = pmf_find_device(np); + if (dev == NULL) { + spin_unlock_irqrestore(&pmf_lock, flags); + return -ENODEV; + } + list_for_each_entry_safe(func, tmp, &dev->functions, link) { + if (name && strcmp(name, func->name)) + continue; + if (phandle && func->phandle && phandle != func->phandle) + continue; + if ((func->flags & fflags) == 0) + continue; + if (pmf_get_function(func) == NULL) + continue; + spin_unlock_irqrestore(&pmf_lock, flags); + rc = pmf_call_one(func, args); + pmf_put_function(func); + spin_lock_irqsave(&pmf_lock, flags); + } + pmf_put_device(dev); + spin_unlock_irqrestore(&pmf_lock, flags); + + return rc; +} +EXPORT_SYMBOL_GPL(pmf_do_functions); + + +struct pmf_function *pmf_find_function(struct device_node *target, + const char *name) +{ + struct pmf_function *func; + unsigned long flags; + + spin_lock_irqsave(&pmf_lock, flags); + func = __pmf_find_function(target, name, PMF_FLAGS_ON_DEMAND); + if (func) + func = pmf_get_function(func); + spin_unlock_irqrestore(&pmf_lock, flags); + return func; +} +EXPORT_SYMBOL_GPL(pmf_find_function); + +int pmf_call_function(struct device_node *target, const char *name, + struct pmf_args *args) +{ + struct pmf_function *func = pmf_find_function(target, name); + int rc; + + if (func == NULL) + return -ENODEV; + + rc = pmf_call_one(func, args); + pmf_put_function(func); + return rc; +} +EXPORT_SYMBOL_GPL(pmf_call_function); + Index: linux-work/include/asm-powerpc/pmac_feature.h =================================================================== --- linux-work.orig/include/asm-powerpc/pmac_feature.h 2006-01-07 10:53:21.000000000 +1100 +++ linux-work/include/asm-powerpc/pmac_feature.h 2006-01-07 10:54:03.000000000 +1100 @@ -374,5 +374,24 @@ extern struct macio_chip* macio_find(str #define MACIO_IN8(r) (in_8(MACIO_FCR8(macio,r))) #define MACIO_OUT8(r,v) (out_8(MACIO_FCR8(macio,r), (v))) +/* + * Those are exported by pmac feature for internal use by arch code + * only like the platform function callbacks, do not use directly in drivers + */ +extern spinlock_t feature_lock; +extern struct device_node *uninorth_node; +extern u32 __iomem *uninorth_base; + +/* + * Uninorth reg. access. Note that Uni-N regs are big endian + */ + +#define UN_REG(r) (uninorth_base + ((r) >> 2)) +#define UN_IN(r) (in_be32(UN_REG(r))) +#define UN_OUT(r,v) (out_be32(UN_REG(r), (v))) +#define UN_BIS(r,v) (UN_OUT((r), UN_IN(r) | (v))) +#define UN_BIC(r,v) (UN_OUT((r), UN_IN(r) & ~(v))) + + #endif /* __PPC_ASM_PMAC_FEATURE_H */ #endif /* __KERNEL__ */ Index: linux-work/arch/powerpc/platforms/powermac/smp.c =================================================================== --- linux-work.orig/arch/powerpc/platforms/powermac/smp.c 2006-01-07 10:53:21.000000000 +1100 +++ linux-work/arch/powerpc/platforms/powermac/smp.c 2006-01-07 10:54:03.000000000 +1100 @@ -52,8 +52,9 @@ #include #include #include +#include -#undef DEBUG +#define DEBUG #ifdef DEBUG #define DBG(fmt...) udbg_printf(fmt) @@ -62,6 +63,7 @@ #endif extern void __secondary_start_pmac_0(void); +extern int pmac_pfunc_base_install(void); #ifdef CONFIG_PPC32 @@ -602,11 +604,29 @@ static void __init smp_core99_setup_i2c_ pmac_tb_clock_chip_host = NULL; } -#endif /* CONFIG_PPC64 */ /* - * SMP G4 and newer G5 use a GPIO to enable/disable the timebase. + * Newer G5s uses a platform function + */ + +static void smp_core99_pfunc_tb_freeze(int freeze) +{ + struct device_node *cpus; + struct pmf_args args; + + cpus = of_find_node_by_path("/cpus"); + BUG_ON(cpus == NULL); + args.count = 1; + args.u[0].v = !freeze; + pmf_call_function(cpus, "cpu-timebase", &args); + of_node_put(cpus); +} + +#else /* CONFIG_PPC64 */ + +/* + * SMP G4 use a GPIO to enable/disable the timebase. */ static unsigned int core99_tb_gpio; /* Timebase freeze GPIO */ @@ -620,6 +640,9 @@ static void smp_core99_gpio_tb_freeze(in pmac_call_feature(PMAC_FTR_READ_GPIO, NULL, core99_tb_gpio, 0); } + +#endif /* !CONFIG_PPC64 */ + /* L2 and L3 cache settings to pass from CPU0 to CPU1 on G4 cpus */ volatile static long int core99_l2_cache; volatile static long int core99_l3_cache; @@ -665,19 +688,15 @@ static void __init smp_core99_setup(int machine_is_compatible("RackMac3,1")) smp_core99_setup_i2c_hwsync(ncpus); - /* GPIO based HW sync on recent G5s */ + /* pfunc based HW sync on recent G5s */ if (pmac_tb_freeze == NULL) { - struct device_node *np = - of_find_node_by_name(NULL, "timebase-enable"); - u32 *reg = (u32 *)get_property(np, "reg", NULL); - - if (np && reg && !strcmp(np->type, "gpio")) { - core99_tb_gpio = *reg; - if (core99_tb_gpio < 0x50) - core99_tb_gpio += 0x50; - pmac_tb_freeze = smp_core99_gpio_tb_freeze; + struct device_node *cpus = + of_find_node_by_path("/cpus"); + if (cpus && + get_property(cpus, "platform-cpu-timebase", NULL)) { + pmac_tb_freeze = smp_core99_pfunc_tb_freeze; printk(KERN_INFO "Processor timebase sync using" - " GPIO 0x%02x\n", core99_tb_gpio); + " platform function\n"); } } @@ -746,6 +765,7 @@ static int __init smp_core99_probe(void) /* We need to perform some early initialisations before we can start * setting up SMP as we are running before initcalls */ + pmac_pfunc_base_install(); pmac_i2c_init(); /* Setup various bits like timebase sync method, ability to nap, ... */ Index: linux-work/arch/powerpc/platforms/powermac/low_i2c.c =================================================================== --- linux-work.orig/arch/powerpc/platforms/powermac/low_i2c.c 2006-01-07 10:53:21.000000000 +1100 +++ linux-work/arch/powerpc/platforms/powermac/low_i2c.c 2006-01-07 10:54:03.000000000 +1100 @@ -49,6 +49,7 @@ #include #include #include +#include #include #ifdef DEBUG @@ -1162,9 +1163,291 @@ int pmac_i2c_xfer(struct pmac_i2c_bus *b } EXPORT_SYMBOL_GPL(pmac_i2c_xfer); +/* some quirks for platform function decoding */ +enum { + pmac_i2c_quirk_invmask = 0x00000001u, +}; + +static void pmac_i2c_devscan(void (*callback)(struct device_node *dev, + int quirks)) +{ + struct pmac_i2c_bus *bus; + struct device_node *np; + static struct whitelist_ent { + char *name; + char *compatible; + int quirks; + } whitelist[] = { + /* XXX Study device-tree's & apple drivers are get the quirks + * right ! + */ + { "i2c-hwclock", NULL, pmac_i2c_quirk_invmask }, + { "i2c-cpu-voltage", NULL, 0}, + { "temp-monitor", NULL, 0 }, + { "supply-monitor", NULL, 0 }, + { NULL, NULL, 0 }, + }; + + /* Only some devices need to have platform functions instanciated + * here. For now, we have a table. Others, like 9554 i2c GPIOs used + * on Xserve, if we ever do a driver for them, will use their own + * platform function instance + */ + list_for_each_entry(bus, &pmac_i2c_busses, link) { + for (np = NULL; + (np = of_get_next_child(bus->busnode, np)) != NULL;) { + struct whitelist_ent *p; + /* If multibus, check if device is on that bus */ + if (bus->flags & pmac_i2c_multibus) + if (bus != pmac_i2c_find_bus(np)) + continue; + for (p = whitelist; p->name != NULL; p++) { + if (strcmp(np->name, p->name)) + continue; + if (p->compatible && + !device_is_compatible(np, p->compatible)) + continue; + callback(np, p->quirks); + break; + } + } + } +} + +#define MAX_I2C_DATA 64 + +struct pmac_i2c_pf_inst +{ + struct pmac_i2c_bus *bus; + u8 addr; + u8 buffer[MAX_I2C_DATA]; + u8 scratch[MAX_I2C_DATA]; + int bytes; + int quirks; +}; + +static void* pmac_i2c_do_begin(struct pmf_function *func, struct pmf_args *args) +{ + struct pmac_i2c_pf_inst *inst; + struct pmac_i2c_bus *bus; + + bus = pmac_i2c_find_bus(func->node); + if (bus == NULL) { + printk(KERN_ERR "low_i2c: Can't find bus for %s (pfunc)\n", + func->node->full_name); + return NULL; + } + if (pmac_i2c_open(bus, 0)) { + printk(KERN_ERR "low_i2c: Can't open i2c bus for %s (pfunc)\n", + func->node->full_name); + return NULL; + } + + /* XXX might need GFP_ATOMIC when called during the suspend process, + * but then, there are already lots of issues with suspending when + * near OOM that need to be resolved, the allocator itself should + * probably make GFP_NOIO implicit during suspend + */ + inst = kzalloc(sizeof(struct pmac_i2c_pf_inst), GFP_KERNEL); + if (inst == NULL) { + pmac_i2c_close(bus); + return NULL; + } + inst->bus = bus; + inst->addr = pmac_i2c_get_dev_addr(func->node); + inst->quirks = (int)(long)func->driver_data; + return inst; +} + +static void pmac_i2c_do_end(struct pmf_function *func, void *instdata) +{ + struct pmac_i2c_pf_inst *inst = instdata; + + if (inst == NULL) + return; + pmac_i2c_close(inst->bus); + if (inst) + kfree(inst); +} + +static int pmac_i2c_do_read(PMF_STD_ARGS, u32 len) +{ + struct pmac_i2c_pf_inst *inst = instdata; + + inst->bytes = len; + return pmac_i2c_xfer(inst->bus, inst->addr | pmac_i2c_read, 0, 0, + inst->buffer, len); +} + +static int pmac_i2c_do_write(PMF_STD_ARGS, u32 len, const u8 *data) +{ + struct pmac_i2c_pf_inst *inst = instdata; + + return pmac_i2c_xfer(inst->bus, inst->addr | pmac_i2c_write, 0, 0, + (u8 *)data, len); +} + +/* This function is used to do the masking & OR'ing for the "rmw" type + * callbacks. Ze should apply the mask and OR in the values in the + * buffer before writing back. The problem is that it seems that + * various darwin drivers implement the mask/or differently, thus + * we need to check the quirks first + */ +static void pmac_i2c_do_apply_rmw(struct pmac_i2c_pf_inst *inst, + u32 len, const u8 *mask, const u8 *val) +{ + int i; + + if (inst->quirks & pmac_i2c_quirk_invmask) { + for (i = 0; i < len; i ++) + inst->scratch[i] = (inst->buffer[i] & mask[i]) | val[i]; + } else { + for (i = 0; i < len; i ++) + inst->scratch[i] = (inst->buffer[i] & ~mask[i]) + | (val[i] & mask[i]); + } +} + +static int pmac_i2c_do_rmw(PMF_STD_ARGS, u32 masklen, u32 valuelen, + u32 totallen, const u8 *maskdata, + const u8 *valuedata) +{ + struct pmac_i2c_pf_inst *inst = instdata; + + if (masklen > inst->bytes || valuelen > inst->bytes || + totallen > inst->bytes || valuelen > masklen) + return -EINVAL; + + pmac_i2c_do_apply_rmw(inst, masklen, maskdata, valuedata); + + return pmac_i2c_xfer(inst->bus, inst->addr | pmac_i2c_write, 0, 0, + inst->scratch, totallen); +} + +static int pmac_i2c_do_read_sub(PMF_STD_ARGS, u8 subaddr, u32 len) +{ + struct pmac_i2c_pf_inst *inst = instdata; + + inst->bytes = len; + return pmac_i2c_xfer(inst->bus, inst->addr | pmac_i2c_read, 1, subaddr, + inst->buffer, len); +} + +static int pmac_i2c_do_write_sub(PMF_STD_ARGS, u8 subaddr, u32 len, + const u8 *data) +{ + struct pmac_i2c_pf_inst *inst = instdata; + + return pmac_i2c_xfer(inst->bus, inst->addr | pmac_i2c_write, 1, + subaddr, (u8 *)data, len); +} + +static int pmac_i2c_do_set_mode(PMF_STD_ARGS, int mode) +{ + struct pmac_i2c_pf_inst *inst = instdata; + + return pmac_i2c_setmode(inst->bus, mode); +} + +static int pmac_i2c_do_rmw_sub(PMF_STD_ARGS, u8 subaddr, u32 masklen, + u32 valuelen, u32 totallen, const u8 *maskdata, + const u8 *valuedata) +{ + struct pmac_i2c_pf_inst *inst = instdata; + + if (masklen > inst->bytes || valuelen > inst->bytes || + totallen > inst->bytes || valuelen > masklen) + return -EINVAL; + + pmac_i2c_do_apply_rmw(inst, masklen, maskdata, valuedata); + + return pmac_i2c_xfer(inst->bus, inst->addr | pmac_i2c_write, 1, + subaddr, inst->scratch, totallen); +} + +static int pmac_i2c_do_mask_and_comp(PMF_STD_ARGS, u32 len, + const u8 *maskdata, + const u8 *valuedata) +{ + struct pmac_i2c_pf_inst *inst = instdata; + int i, match; + + /* Get return value pointer, it's assumed to be a u32 */ + if (!args || !args->count || !args->u[0].p) + return -EINVAL; + + /* Check buffer */ + if (len > inst->bytes) + return -EINVAL; + + for (i = 0, match = 1; match && i < len; i ++) + if ((inst->buffer[i] & maskdata[i]) != valuedata[i]) + match = 0; + *args->u[0].p = match; + return 0; +} + +static int pmac_i2c_do_delay(PMF_STD_ARGS, u32 duration) +{ + msleep((duration + 999) / 1000); + return 0; +} + + +static struct pmf_handlers pmac_i2c_pfunc_handlers = { + .begin = pmac_i2c_do_begin, + .end = pmac_i2c_do_end, + .read_i2c = pmac_i2c_do_read, + .write_i2c = pmac_i2c_do_write, + .rmw_i2c = pmac_i2c_do_rmw, + .read_i2c_sub = pmac_i2c_do_read_sub, + .write_i2c_sub = pmac_i2c_do_write_sub, + .rmw_i2c_sub = pmac_i2c_do_rmw_sub, + .set_i2c_mode = pmac_i2c_do_set_mode, + .mask_and_compare = pmac_i2c_do_mask_and_comp, + .delay = pmac_i2c_do_delay, +}; + +static void __init pmac_i2c_dev_create(struct device_node *np, int quirks) +{ + DBG("dev_create(%s)\n", np->full_name); + + pmf_register_driver(np, &pmac_i2c_pfunc_handlers, + (void *)(long)quirks); +} + +static void __init pmac_i2c_dev_init(struct device_node *np, int quirks) +{ + DBG("dev_create(%s)\n", np->full_name); + + pmf_do_functions(np, NULL, 0, PMF_FLAGS_ON_INIT, NULL); +} + +static void pmac_i2c_dev_suspend(struct device_node *np, int quirks) +{ + DBG("dev_suspend(%s)\n", np->full_name); + pmf_do_functions(np, NULL, 0, PMF_FLAGS_ON_SLEEP, NULL); +} + +static void pmac_i2c_dev_resume(struct device_node *np, int quirks) +{ + DBG("dev_resume(%s)\n", np->full_name); + pmf_do_functions(np, NULL, 0, PMF_FLAGS_ON_WAKE, NULL); +} + +void pmac_pfunc_i2c_suspend(void) +{ + pmac_i2c_devscan(pmac_i2c_dev_suspend); +} + +void pmac_pfunc_i2c_resume(void) +{ + pmac_i2c_devscan(pmac_i2c_dev_resume); +} + /* - * Initialize us: probe all i2c busses on the machine and instantiate - * busses. + * Initialize us: probe all i2c busses on the machine, instantiate + * busses and platform functions as needed. */ /* This is non-static as it might be called early by smp code */ int __init pmac_i2c_init(void) @@ -1187,6 +1470,10 @@ int __init pmac_i2c_init(void) /* Probe SMU i2c busses */ smu_i2c_probe(); #endif + + /* Now add plaform functions for some known devices */ + pmac_i2c_devscan(pmac_i2c_dev_create); + return 0; } arch_initcall(pmac_i2c_init); @@ -1216,6 +1503,9 @@ static int __init pmac_i2c_create_platfo platform_device_add(bus->platform_dev); } + /* Now call platform "init" functions */ + pmac_i2c_devscan(pmac_i2c_dev_init); + return 0; } subsys_initcall(pmac_i2c_create_platform_devices); Index: linux-work/drivers/macintosh/via-pmu.c =================================================================== --- linux-work.orig/drivers/macintosh/via-pmu.c 2006-01-07 10:53:21.000000000 +1100 +++ linux-work/drivers/macintosh/via-pmu.c 2006-01-07 10:54:03.000000000 +1100 @@ -55,6 +55,8 @@ #include #include #include +#include +#include #include #include #include @@ -2105,6 +2107,10 @@ pmac_suspend_devices(void) return -EBUSY; } + /* Call platform functions marked "on sleep" */ + pmac_pfunc_i2c_suspend(); + pmac_pfunc_base_suspend(); + /* Stop preemption */ preempt_disable(); @@ -2175,6 +2181,10 @@ pmac_wakeup_devices(void) mdelay(10); preempt_enable(); + /* Call platform functions marked "on wake" */ + pmac_pfunc_base_resume(); + pmac_pfunc_i2c_resume(); + /* Resume devices */ device_resume(); Index: linux-work/include/asm-powerpc/pmac_low_i2c.h =================================================================== --- linux-work.orig/include/asm-powerpc/pmac_low_i2c.h 2006-01-07 10:53:21.000000000 +1100 +++ linux-work/include/asm-powerpc/pmac_low_i2c.h 2006-01-07 10:54:03.000000000 +1100 @@ -99,6 +99,9 @@ extern int pmac_i2c_setmode(struct pmac_ extern int pmac_i2c_xfer(struct pmac_i2c_bus *bus, u8 addrdir, int subsize, u32 subaddr, u8 *data, int len); +/* Suspend/resume code called by via-pmu directly for now */ +extern void pmac_pfunc_i2c_suspend(void); +extern void pmac_pfunc_i2c_resume(void); #endif /* __KERNEL__ */ #endif /* __PMAC_LOW_I2C_H__ */ From benh at kernel.crashing.org Sat Jan 7 11:45:28 2006 From: benh at kernel.crashing.org (Benjamin Herrenschmidt) Date: Sat, 07 Jan 2006 11:45:28 +1100 Subject: [PATCH] 4/5 powerpc: Add cpufreq support for all desktop G5 Message-ID: <1136594728.4840.180.camel@localhost.localdomain> This patch adds cpufreq support for all desktop "tower" G5 models. The only G5 models still lacking cpufreq support at this point are the Xserve and possibly the new iMac iSight (not tested). I'll have those added soon. That patch uses the new platform functions interpreter to implement frequency and voltage switching on most models. Note that in order to find the low frequency value, I had to hack something that might now work properly on all models, so if the frequency value reported when running low speed looks bogus to you, please report it to me. (Appart from a bogus reported value, things should work fine). Signed-off-by: Benjamin Herrenschmidt Index: linux-work/arch/powerpc/platforms/powermac/cpufreq_64.c =================================================================== --- linux-work.orig/arch/powerpc/platforms/powermac/cpufreq_64.c 2006-01-07 10:53:19.000000000 +1100 +++ linux-work/arch/powerpc/platforms/powermac/cpufreq_64.c 2006-01-07 10:54:25.000000000 +1100 @@ -28,6 +28,7 @@ #include #include #include +#include #undef DEBUG @@ -85,6 +86,10 @@ static u32 *g5_pmode_data; static int g5_pmode_max; static int g5_pmode_cur; +static void (*g5_switch_volt)(int speed_mode); +static int (*g5_switch_freq)(int speed_mode); +static int (*g5_query_freq)(void); + static DECLARE_MUTEX(g5_switch_mutex); @@ -92,9 +97,11 @@ static struct smu_sdbp_fvt *g5_fvt_table static int g5_fvt_count; /* number of op. points */ static int g5_fvt_cur; /* current op. point */ -/* ----------------- real hardware interface */ +/* + * SMU based voltage switching for Neo2 platforms + */ -static void g5_switch_volt(int speed_mode) +static void g5_smu_switch_volt(int speed_mode) { struct smu_simple_cmd cmd; @@ -105,26 +112,57 @@ static void g5_switch_volt(int speed_mod wait_for_completion(&comp); } -static int g5_switch_freq(int speed_mode) -{ - struct cpufreq_freqs freqs; - int to; +/* + * Platform function based voltage/vdnap switching for Neo2 + */ - if (g5_pmode_cur == speed_mode) - return 0; +static struct pmf_function *pfunc_set_vdnap0; +static struct pmf_function *pfunc_vdnap0_complete; - down(&g5_switch_mutex); +static void g5_vdnap_switch_volt(int speed_mode) +{ + struct pmf_args args; + u32 slew, done = 0; + unsigned long timeout; + + slew = (speed_mode == CPUFREQ_LOW) ? 1 : 0; + args.count = 1; + args.u[0].p = &slew; + + pmf_call_one(pfunc_set_vdnap0, &args); + + /* It's an irq GPIO so we should be able to just block here, + * I'll do that later after I've properly tested the IRQ code for + * platform functions + */ + timeout = jiffies + HZ/10; + while(!time_after(jiffies, timeout)) { + args.count = 1; + args.u[0].p = &done; + pmf_call_one(pfunc_vdnap0_complete, &args); + if (done) + break; + msleep(1); + } + if (done == 0) + printk(KERN_WARNING "cpufreq: Timeout in clock slewing !\n"); +} - freqs.old = g5_cpu_freqs[g5_pmode_cur].frequency; - freqs.new = g5_cpu_freqs[speed_mode].frequency; - freqs.cpu = 0; - cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE); +/* + * SCOM based frequency switching for 970FX rev3 + */ +static int g5_scom_switch_freq(int speed_mode) +{ + unsigned long flags; + int to; /* If frequency is going up, first ramp up the voltage */ if (speed_mode < g5_pmode_cur) g5_switch_volt(speed_mode); + local_irq_save(flags); + /* Clear PCR high */ scom970_write(SCOM_PCR, 0); /* Clear PCR low */ @@ -147,6 +185,8 @@ static int g5_switch_freq(int speed_mode udelay(100); } + local_irq_restore(flags); + /* If frequency is going down, last ramp the voltage */ if (speed_mode > g5_pmode_cur) g5_switch_volt(speed_mode); @@ -154,14 +194,10 @@ static int g5_switch_freq(int speed_mode g5_pmode_cur = speed_mode; ppc_proc_freq = g5_cpu_freqs[speed_mode].frequency * 1000ul; - cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE); - - up(&g5_switch_mutex); - return 0; } -static int g5_query_freq(void) +static int g5_scom_query_freq(void) { unsigned long psr = scom970_read(SCOM_PSR); int i; @@ -173,7 +209,104 @@ static int g5_query_freq(void) return i; } -/* ----------------- cpufreq bookkeeping */ +/* + * Platform function based voltage switching for PowerMac7,2 & 7,3 + */ + +static struct pmf_function *pfunc_cpu0_volt_high; +static struct pmf_function *pfunc_cpu0_volt_low; +static struct pmf_function *pfunc_cpu1_volt_high; +static struct pmf_function *pfunc_cpu1_volt_low; + +static void g5_pfunc_switch_volt(int speed_mode) +{ + if (speed_mode == CPUFREQ_HIGH) { + if (pfunc_cpu0_volt_high) + pmf_call_one(pfunc_cpu0_volt_high, NULL); + if (pfunc_cpu1_volt_high) + pmf_call_one(pfunc_cpu1_volt_high, NULL); + } else { + if (pfunc_cpu0_volt_low) + pmf_call_one(pfunc_cpu0_volt_low, NULL); + if (pfunc_cpu1_volt_low) + pmf_call_one(pfunc_cpu1_volt_low, NULL); + } + msleep(10); /* should be faster , to fix */ +} + +/* + * Platform function based frequency switching for PowerMac7,2 & 7,3 + */ + +static struct pmf_function *pfunc_cpu_setfreq_high; +static struct pmf_function *pfunc_cpu_setfreq_low; +static struct pmf_function *pfunc_cpu_getfreq; +static struct pmf_function *pfunc_slewing_done;; + +static int g5_pfunc_switch_freq(int speed_mode) +{ + struct pmf_args args; + u32 done = 0; + unsigned long timeout; + + /* If frequency is going up, first ramp up the voltage */ + if (speed_mode < g5_pmode_cur) + g5_switch_volt(speed_mode); + + /* Do it */ + if (speed_mode == CPUFREQ_HIGH) + pmf_call_one(pfunc_cpu_setfreq_high, NULL); + else + pmf_call_one(pfunc_cpu_setfreq_low, NULL); + + /* It's an irq GPIO so we should be able to just block here, + * I'll do that later after I've properly tested the IRQ code for + * platform functions + */ + timeout = jiffies + HZ/10; + while(!time_after(jiffies, timeout)) { + args.count = 1; + args.u[0].p = &done; + pmf_call_one(pfunc_slewing_done, &args); + if (done) + break; + msleep(1); + } + if (done == 0) + printk(KERN_WARNING "cpufreq: Timeout in clock slewing !\n"); + + /* If frequency is going down, last ramp the voltage */ + if (speed_mode > g5_pmode_cur) + g5_switch_volt(speed_mode); + + g5_pmode_cur = speed_mode; + ppc_proc_freq = g5_cpu_freqs[speed_mode].frequency * 1000ul; + + return 0; +} + +static int g5_pfunc_query_freq(void) +{ + struct pmf_args args; + u32 val = 0; + + args.count = 1; + args.u[0].p = &val; + pmf_call_one(pfunc_cpu_getfreq, &args); + return val ? CPUFREQ_HIGH : CPUFREQ_LOW; +} + +/* + * Fake voltage switching for platforms with missing support + */ + +static void g5_dummy_switch_volt(int speed_mode) +{ +} + +/* + * Common interface to the cpufreq core + */ static int g5_cpufreq_verify(struct cpufreq_policy *policy) { @@ -183,13 +316,30 @@ static int g5_cpufreq_verify(struct cpuf static int g5_cpufreq_target(struct cpufreq_policy *policy, unsigned int target_freq, unsigned int relation) { - unsigned int newstate = 0; + unsigned int newstate = 0; + struct cpufreq_freqs freqs; + int rc; if (cpufreq_frequency_table_target(policy, g5_cpu_freqs, target_freq, relation, &newstate)) return -EINVAL; - return g5_switch_freq(newstate); + if (g5_pmode_cur == newstate) + return 0; + + down(&g5_switch_mutex); + + freqs.old = g5_cpu_freqs[g5_pmode_cur].frequency; + freqs.new = g5_cpu_freqs[newstate].frequency; + freqs.cpu = 0; + + cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE); + rc = g5_switch_freq(newstate); + cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE); + + up(&g5_switch_mutex); + + return rc; } static unsigned int g5_cpufreq_get_speed(unsigned int cpu) @@ -205,6 +355,7 @@ static int g5_cpufreq_cpu_init(struct cp policy->governor = CPUFREQ_DEFAULT_GOVERNOR; policy->cpuinfo.transition_latency = CPUFREQ_ETERNAL; policy->cur = g5_cpu_freqs[g5_query_freq()].frequency; + policy->cpus = cpu_possible_map; cpufreq_frequency_table_get_attr(g5_cpu_freqs, policy->cpu); return cpufreq_frequency_table_cpuinfo(policy, @@ -224,19 +375,39 @@ static struct cpufreq_driver g5_cpufreq_ }; -static int __init g5_cpufreq_init(void) +static int __init g5_neo2_cpufreq_init(struct device_node *cpus) { struct device_node *cpunode; unsigned int psize, ssize; - struct smu_sdbp_header *shdr; unsigned long max_freq; - u32 *valp; + char *freq_method, *volt_method; + u32 *valp, pvr_hi; + int use_volts_vdnap = 0; + int use_volts_smu = 0; int rc = -ENODEV; - /* Look for CPU and SMU nodes */ - cpunode = of_find_node_by_type(NULL, "cpu"); - if (!cpunode) { - DBG("No CPU node !\n"); + /* Check supported platforms */ + if (machine_is_compatible("PowerMac8,1") || + machine_is_compatible("PowerMac8,2") || + machine_is_compatible("PowerMac9,1")) + use_volts_smu = 1; + else if (machine_is_compatible("PowerMac11,2")) + use_volts_vdnap = 1; + else + return -ENODEV; + + /* Get first CPU node */ + for (cpunode = NULL; + (cpunode = of_get_next_child(cpus, cpunode)) != NULL;) { + u32 *reg = + (u32 *)get_property(cpunode, "reg", NULL); + if (reg == NULL || (*reg) != 0) + continue; + if (!strcmp(cpunode->type, "cpu")) + break; + } + if (cpunode == NULL) { + printk(KERN_ERR "cpufreq: Can't find any CPU 0 node\n"); return -ENODEV; } @@ -246,8 +417,9 @@ static int __init g5_cpufreq_init(void) DBG("No cpu-version property !\n"); goto bail_noprops; } - if (((*valp) >> 16) != 0x3c) { - DBG("Wrong CPU version: %08x\n", *valp); + pvr_hi = (*valp) >> 16; + if (pvr_hi != 0x3c && pvr_hi != 0x44) { + printk(KERN_ERR "cpufreq: Unsupported CPU version\n"); goto bail_noprops; } @@ -259,18 +431,50 @@ static int __init g5_cpufreq_init(void) } g5_pmode_max = psize / sizeof(u32) - 1; - /* Look for the FVT table */ - shdr = smu_get_sdb_partition(SMU_SDB_FVT_ID, NULL); - if (!shdr) - goto bail_noprops; - g5_fvt_table = (struct smu_sdbp_fvt *)&shdr[1]; - ssize = (shdr->len * sizeof(u32)) - sizeof(struct smu_sdbp_header); - g5_fvt_count = ssize / sizeof(struct smu_sdbp_fvt); - g5_fvt_cur = 0; + if (use_volts_smu) { + struct smu_sdbp_header *shdr; - /* Sanity checking */ - if (g5_fvt_count < 1 || g5_pmode_max < 1) - goto bail_noprops; + /* Look for the FVT table */ + shdr = smu_get_sdb_partition(SMU_SDB_FVT_ID, NULL); + if (!shdr) + goto bail_noprops; + g5_fvt_table = (struct smu_sdbp_fvt *)&shdr[1]; + ssize = (shdr->len * sizeof(u32)) - + sizeof(struct smu_sdbp_header); + g5_fvt_count = ssize / sizeof(struct smu_sdbp_fvt); + g5_fvt_cur = 0; + + /* Sanity checking */ + if (g5_fvt_count < 1 || g5_pmode_max < 1) + goto bail_noprops; + + g5_switch_volt = g5_smu_switch_volt; + volt_method = "SMU"; + } else if (use_volts_vdnap) { + struct device_node *root; + + root = of_find_node_by_path("/"); + if (root == NULL) { + printk(KERN_ERR "cpufreq: Can't find root of " + "device tree\n"); + goto bail_noprops; + } + pfunc_set_vdnap0 = pmf_find_function(root, "set-vdnap0"); + pfunc_vdnap0_complete = + pmf_find_function(root, "slewing-done"); + if (pfunc_set_vdnap0 == NULL || + pfunc_vdnap0_complete == NULL) { + printk(KERN_ERR "cpufreq: Can't find required " + "platform function\n"); + goto bail_noprops; + } + + g5_switch_volt = g5_vdnap_switch_volt; + volt_method = "GPIO"; + } else { + g5_switch_volt = g5_dummy_switch_volt; + volt_method = "none"; + } /* * From what I see, clock-frequency is always the maximal frequency. @@ -286,19 +490,23 @@ static int __init g5_cpufreq_init(void) g5_cpu_freqs[0].frequency = max_freq; g5_cpu_freqs[1].frequency = max_freq/2; - /* Check current frequency */ - g5_pmode_cur = g5_query_freq(); - if (g5_pmode_cur > 1) - /* We don't support anything but 1:1 and 1:2, fixup ... */ - g5_pmode_cur = 1; + /* Set callbacks */ + g5_switch_freq = g5_scom_switch_freq; + g5_query_freq = g5_scom_query_freq; + freq_method = "SCOM"; /* Force apply current frequency to make sure everything is in * sync (voltage is right for example). Firmware may leave us with * a strange setting ... */ - g5_switch_freq(g5_pmode_cur); + g5_switch_volt(CPUFREQ_HIGH); + msleep(10); + g5_pmode_cur = -1; + g5_switch_freq(g5_query_freq()); printk(KERN_INFO "Registering G5 CPU frequency driver\n"); + printk(KERN_INFO "Frequency method: %s, Voltage method: %s\n", + freq_method, volt_method); printk(KERN_INFO "Low: %d Mhz, High: %d Mhz, Cur: %d MHz\n", g5_cpu_freqs[1].frequency/1000, g5_cpu_freqs[0].frequency/1000, @@ -317,6 +525,200 @@ static int __init g5_cpufreq_init(void) return rc; } +static int __init g5_pm72_cpufreq_init(struct device_node *cpus) +{ + struct device_node *cpuid = NULL, *hwclock = NULL, *cpunode = NULL; + u8 *eeprom = NULL; + u32 *valp; + u64 max_freq, min_freq, ih, il; + int has_volt = 1, rc = 0; + + /* Get first CPU node */ + for (cpunode = NULL; + (cpunode = of_get_next_child(cpus, cpunode)) != NULL;) { + if (!strcmp(cpunode->type, "cpu")) + break; + } + if (cpunode == NULL) { + printk(KERN_ERR "cpufreq: Can't find any CPU node\n"); + return -ENODEV; + } + + /* Lookup the cpuid eeprom node */ + cpuid = of_find_node_by_path("/u3 at 0,f8000000/i2c at f8001000/cpuid at a0"); + if (cpuid != NULL) + eeprom = (u8 *)get_property(cpuid, "cpuid", NULL); + if (eeprom == NULL) { + printk(KERN_ERR "cpufreq: Can't find cpuid EEPROM !\n"); + rc = -ENODEV; + goto bail; + } + + /* Lookup the i2c hwclock */ + for (hwclock = NULL; + (hwclock = of_find_node_by_name(hwclock, "i2c-hwclock")) != NULL;){ + char *loc = get_property(hwclock, "hwctrl-location", NULL); + if (loc == NULL) + continue; + if (strcmp(loc, "CPU CLOCK")) + continue; + if (!get_property(hwclock, "platform-get-frequency", NULL)) + continue; + break; + } + if (hwclock == NULL) { + printk(KERN_ERR "cpufreq: Can't find i2c clock chip !\n"); + rc = -ENODEV; + goto bail; + } + + DBG("cpufreq: i2c clock chip found: %s\n", hwclock->full_name); + + /* Now get all the platform functions */ + pfunc_cpu_getfreq = + pmf_find_function(hwclock, "get-frequency"); + pfunc_cpu_setfreq_high = + pmf_find_function(hwclock, "set-frequency-high"); + pfunc_cpu_setfreq_low = + pmf_find_function(hwclock, "set-frequency-low"); + pfunc_slewing_done = + pmf_find_function(hwclock, "slewing-done"); + pfunc_cpu0_volt_high = + pmf_find_function(hwclock, "set-voltage-high-0"); + pfunc_cpu0_volt_low = + pmf_find_function(hwclock, "set-voltage-low-0"); + pfunc_cpu1_volt_high = + pmf_find_function(hwclock, "set-voltage-high-1"); + pfunc_cpu1_volt_low = + pmf_find_function(hwclock, "set-voltage-low-1"); + + /* Check we have minimum requirements */ + if (pfunc_cpu_getfreq == NULL || pfunc_cpu_setfreq_high == NULL || + pfunc_cpu_setfreq_low == NULL || pfunc_slewing_done == NULL) { + printk(KERN_ERR "cpufreq: Can't find platform functions !\n"); + rc = -ENODEV; + goto bail; + } + + /* Check that we have complete sets */ + if (pfunc_cpu0_volt_high == NULL || pfunc_cpu0_volt_low == NULL) { + pmf_put_function(pfunc_cpu0_volt_high); + pmf_put_function(pfunc_cpu0_volt_low); + pfunc_cpu0_volt_high = pfunc_cpu0_volt_low = NULL; + has_volt = 0; + } + if (!has_volt || + pfunc_cpu1_volt_high == NULL || pfunc_cpu1_volt_low == NULL) { + pmf_put_function(pfunc_cpu1_volt_high); + pmf_put_function(pfunc_cpu1_volt_low); + pfunc_cpu1_volt_high = pfunc_cpu1_volt_low = NULL; + } + + /* Note: The device tree also contains a "platform-set-values" + * function for which I haven't quite figured out the usage. It + * might have to be called on init and/or wakeup, I'm not too sure + * but things seem to work fine without it so far ... + */ + + /* Get max frequency from device-tree */ + valp = (u32 *)get_property(cpunode, "clock-frequency", NULL); + if (!valp) { + printk(KERN_ERR "cpufreq: Can't find CPU frequency !\n"); + rc = -ENODEV; + goto bail; + } + + max_freq = (*valp)/1000; + + /* Now calculate reduced frequency by using the cpuid input freq + * ratio. This requires 64 bits math unless we are willing to lose + * some precision + */ + ih = *((u32 *)(eeprom + 0x10)); + il = *((u32 *)(eeprom + 0x20)); + min_freq = 0; + if (ih != 0 && il != 0) + min_freq = (max_freq * il) / ih; + + /* Sanity check */ + if (min_freq >= max_freq || min_freq < 1000) { + printk(KERN_ERR "cpufreq: Can't calculate low frequency !\n"); + rc = -ENODEV; + goto bail; + } + g5_cpu_freqs[0].frequency = max_freq; + g5_cpu_freqs[1].frequency = min_freq; + + /* Set callbacks */ + g5_switch_volt = g5_pfunc_switch_volt; + g5_switch_freq = g5_pfunc_switch_freq; + g5_query_freq = g5_pfunc_query_freq; + + /* Force apply current frequency to make sure everything is in + * sync (voltage is right for example). Firmware may leave us with + * a strange setting ... + */ + g5_switch_volt(CPUFREQ_HIGH); + msleep(10); + g5_pmode_cur = -1; + g5_switch_freq(g5_query_freq()); + + printk(KERN_INFO "Registering G5 CPU frequency driver\n"); + printk(KERN_INFO "Frequency method: i2c/pfunc, " + "Voltage method: %s\n", has_volt ? "i2c/pfunc" : "none"); + printk(KERN_INFO "Low: %d Mhz, High: %d Mhz, Cur: %d MHz\n", + g5_cpu_freqs[1].frequency/1000, + g5_cpu_freqs[0].frequency/1000, + g5_cpu_freqs[g5_pmode_cur].frequency/1000); + + rc = cpufreq_register_driver(&g5_cpufreq_driver); + bail: + if (rc != 0) { + pmf_put_function(pfunc_cpu_getfreq); + pmf_put_function(pfunc_cpu_setfreq_high); + pmf_put_function(pfunc_cpu_setfreq_low); + pmf_put_function(pfunc_slewing_done); + pmf_put_function(pfunc_cpu0_volt_high); + pmf_put_function(pfunc_cpu0_volt_low); + pmf_put_function(pfunc_cpu1_volt_high); + pmf_put_function(pfunc_cpu1_volt_low); + } + of_node_put(hwclock); + of_node_put(cpuid); + of_node_put(cpunode); + + return rc; +} + +static int __init g5_rm31_cpufreq_init(struct device_node *cpus) +{ + /* NYI */ + return 0; +} + +static int __init g5_cpufreq_init(void) +{ + struct device_node *cpus; + int rc; + + cpus = of_find_node_by_path("/cpus"); + if (cpus == NULL) { + DBG("No /cpus node !\n"); + return -ENODEV; + } + + if (machine_is_compatible("PowerMac7,2") || + machine_is_compatible("PowerMac7,3")) + rc = g5_pm72_cpufreq_init(cpus); + else if (machine_is_compatible("RackMac3,1")) + rc = g5_rm31_cpufreq_init(cpus); + else + rc = g5_neo2_cpufreq_init(cpus); + + of_node_put(cpus); + return rc; +} + module_init(g5_cpufreq_init); From benh at kernel.crashing.org Sat Jan 7 11:46:37 2006 From: benh at kernel.crashing.org (Benjamin Herrenschmidt) Date: Sat, 07 Jan 2006 11:46:37 +1100 Subject: [PATCH] 5/5 powerpc: Update g5 defconfig Message-ID: <1136594797.4840.183.camel@localhost.localdomain> This is just a deconfig update so that the Quad G5 works better with the default config. Signed-off-by: Benjamin Herrenschmidt Index: linux-work/arch/powerpc/configs/g5_defconfig =================================================================== --- linux-work.orig/arch/powerpc/configs/g5_defconfig 2005-11-24 17:18:42.000000000 +1100 +++ linux-work/arch/powerpc/configs/g5_defconfig 2006-01-06 15:03:26.000000000 +1100 @@ -1,7 +1,7 @@ # # Automatically generated make config: don't edit -# Linux kernel version: 2.6.15-rc1 -# Tue Nov 15 14:39:20 2005 +# Linux kernel version: 2.6.15-rc6 +# Fri Jan 6 15:03:09 2006 # CONFIG_PPC64=y CONFIG_64BIT=y @@ -26,7 +26,7 @@ CONFIG_PPC_FPU=y CONFIG_ALTIVEC=y CONFIG_PPC_STD_MMU=y CONFIG_SMP=y -CONFIG_NR_CPUS=2 +CONFIG_NR_CPUS=4 # # Code maturity level options @@ -53,6 +53,7 @@ CONFIG_IKCONFIG=y CONFIG_IKCONFIG_PROC=y # CONFIG_CPUSETS is not set CONFIG_INITRAMFS_SOURCE="" +CONFIG_CC_OPTIMIZE_FOR_SIZE=y # CONFIG_EMBEDDED is not set CONFIG_KALLSYMS=y # CONFIG_KALLSYMS_ALL is not set @@ -116,6 +117,8 @@ CONFIG_U3_DART=y CONFIG_MPIC=y # CONFIG_PPC_RTAS is not set # CONFIG_MMIO_NVRAM is not set +CONFIG_MPIC_BROKEN_U3=y +# CONFIG_CRASH_DUMP is not set # CONFIG_PPC_MPC106 is not set CONFIG_GENERIC_TBSYNC=y CONFIG_CPU_FREQ=y @@ -162,7 +165,7 @@ CONFIG_FLATMEM_MANUAL=y CONFIG_FLATMEM=y CONFIG_FLAT_NODE_MEM_MAP=y # CONFIG_SPARSEMEM_STATIC is not set -CONFIG_SPLIT_PTLOCK_CPUS=4096 +CONFIG_SPLIT_PTLOCK_CPUS=4 # CONFIG_PPC_64K_PAGES is not set # CONFIG_SCHED_SMT is not set CONFIG_PROC_DEVICETREE=y @@ -629,6 +632,7 @@ CONFIG_THERM_PM72=y CONFIG_WINDFARM=y CONFIG_WINDFARM_PM81=y CONFIG_WINDFARM_PM91=y +CONFIG_WINDFARM_PM112=y # # Network device support @@ -681,7 +685,7 @@ CONFIG_E1000=y # CONFIG_SIS190 is not set # CONFIG_SKGE is not set # CONFIG_SK98LIN is not set -CONFIG_TIGON3=m +CONFIG_TIGON3=y # CONFIG_BNX2 is not set # CONFIG_MV643XX_ETH is not set @@ -1141,6 +1145,7 @@ CONFIG_USB_STORAGE_JUMPSHOT=y # CONFIG_USB_HID=y CONFIG_USB_HIDINPUT=y +# CONFIG_USB_HIDINPUT_POWERBOOK is not set CONFIG_HID_FF=y CONFIG_HID_PID=y CONFIG_LOGITECH_FF=y @@ -1203,6 +1208,7 @@ CONFIG_USB_MON=y CONFIG_USB_SERIAL=m CONFIG_USB_SERIAL_GENERIC=y # CONFIG_USB_SERIAL_AIRPRIME is not set +# CONFIG_USB_SERIAL_ANYDATA is not set CONFIG_USB_SERIAL_BELKIN=m CONFIG_USB_SERIAL_DIGI_ACCELEPORT=m # CONFIG_USB_SERIAL_CP2101 is not set @@ -1233,7 +1239,6 @@ CONFIG_USB_SERIAL_KEYSPAN_USA49WLC=y CONFIG_USB_SERIAL_KLSI=m CONFIG_USB_SERIAL_KOBIL_SCT=m CONFIG_USB_SERIAL_MCT_U232=m -# CONFIG_USB_SERIAL_NOKIA_DKU2 is not set CONFIG_USB_SERIAL_PL2303=m # CONFIG_USB_SERIAL_HP4X is not set CONFIG_USB_SERIAL_SAFE=m From arnd at arndb.de Sat Jan 7 13:02:29 2006 From: arnd at arndb.de (Arnd Bergmann) Date: Sat, 7 Jan 2006 02:02:29 +0000 Subject: Support for Bogus Net In-Reply-To: References: Message-ID: <200601070202.29680.arnd@arndb.de> [added linuxppc64-dev to Cc:] On Friday 06 January 2006 23:49, Eric V Van hensbergen wrote: > Okay, I'll merge it up to 2.6.15, remove the bogus halt and console stuff > and send it out to this list. ?We can either merge it with the other > "stuff" (the console stuff with systemsim.h in it), or submit it after that > patch gets submitted mainline. How about if we make an extra patch for the systemsim.h file? I find it hard to tell which of the patches (console or the others) is more likely to go in soon, so maybe it works best to have patches like this: [patches from eric] systemsim-add-systemsim.h.diff systemsim-add-bogusdisk.diff systemsim-add-bogusnet.diff [patches from ryan] hvc-cleanups.diff hvc-more-changes.diff hvc-add-rtas.diff hvc-add-systemsim.diff with the hvc-add-systemsim.diff depending on systemsim-add-systemsim.h.diff to be applied first. For reference, I've added my last version of that patch this mail, so we have the same base (and can get comments on it). Arnd <>< Index: linux-2.6.15-rc/include/asm-powerpc/systemsim.h =================================================================== --- /dev/null +++ linux-2.6.15-rc/include/asm-powerpc/systemsim.h @@ -0,0 +1,132 @@ +/* + * + * Copyright (C) 2001, 2005 IBM + * + * Filename : systemsim.h + * + * Originator : Patrick Bohrer and Charles Lefurgy + * Modified By : Eric Van Hensbegren + * + * Purpose : + * + * This file is compiled with programs that are run under the + * PowerPC Full System simulator. For example, stand-alone programs + * or operating systems. The programs call the callthru wrapper + * functions which use an illegal PowerPC instruction to signal the + * simulator to emulate special support. + * + */ + +#ifndef _SYSTEMSIM_CONFIG_H_ +#define _SYSTEMSIM_CONFIG_H_ +#ifdef __KERNEL__ + +/* The functions callthru0 to callthru5 setup up the arguments for the + * simulator callthru and then use the callthru instruction. Note that + * 0-5 specify the number of arguments after the command */ + +/* Note: Arguments are cast as void* to prevent casting by the + compiler. This way, you can pass pointers, integers, etc. in + machine register and have the simulator interpret what the + register is supposed to be. To help with typing errors when using + callthrus, we provide wrapper functions for each callthru. The + wrappers cast all arguments to void*. Unfortunately, this results + in a lot of compiler warnings that I do not know how to remove. If + you modify this code, be aware that we are trying to pick a type + that is the size of the registers (32-bit or 64-bit) and that is + why are choosing to cast to a void* (it should be the size of a + machine register) */ + +static inline int callthru0(int command) +{ + register int c asm("r3") = command; + asm volatile (".long 0x000eaeb0":"=r" (c):"r"(c)); + return (c); +} +static inline int callthru1(int command, unsigned long arg1) +{ + register int c asm("r3") = command; + register unsigned long a1 asm("r4") = arg1; + asm volatile (".long 0x000eaeb0":"=r" (c):"r"(c), "r"(a1)); + return c; +} +static inline int callthru2(int command, unsigned long arg1, unsigned long arg2) +{ + register int c asm("r3") = command; + register unsigned long a1 asm("r4") = arg1; + register unsigned long a2 asm("r5") = arg2; + asm volatile (".long 0x000eaeb0":"=r" (c):"r"(c), "r"(a1), "r"(a2)); + return c; +} +static inline int callthru3(int command, unsigned long arg1, unsigned long arg2, + unsigned long arg3) +{ + register int c asm("r3") = command; + register unsigned long a1 asm("r4") = arg1; + register unsigned long a2 asm("r5") = arg2; + register unsigned long a3 asm("r6") = arg3; + asm volatile (".long 0x000eaeb0":"=r" (c):"r"(c), "r"(a1), "r"(a2), + "r"(a3)); + return c; +} +static inline int callthru4(int command, unsigned long arg1, unsigned long arg2, + unsigned long arg3, unsigned long arg4) +{ + register int c asm("r3") = command; + register unsigned long a1 asm("r4") = arg1; + register unsigned long a2 asm("r5") = arg2; + register unsigned long a3 asm("r6") = arg3; + register unsigned long a4 asm("r7") = arg4; + asm volatile (".long 0x000eaeb0":"=r" (c):"r"(c), "r"(a1), "r"(a2), + "r"(a3), "r"(a4)); + return c; +} +static inline int callthru5(int command, unsigned long arg1, unsigned long arg2, + unsigned long arg3, unsigned long arg4, + unsigned long arg5) +{ + register int c asm("r3") = command; + register unsigned long a1 asm("r4") = arg1; + register unsigned long a2 asm("r5") = arg2; + register unsigned long a3 asm("r6") = arg3; + register unsigned long a4 asm("r7") = arg4; + register unsigned long a5 asm("r8") = arg5; + asm volatile (".long 0x000eaeb0":"=r" (c):"r"(c), "r"(a1), "r"(a2), + "r"(a3), "r"(a4), "r"(a5)); + return c; +} +static inline int callthru6(int command, unsigned long arg1, unsigned long arg2, + unsigned long arg3, unsigned long arg4, + unsigned long arg5, unsigned long arg6) +{ + register int c asm("r3") = command; + register unsigned long a1 asm("r4") = arg1; + register unsigned long a2 asm("r5") = arg2; + register unsigned long a3 asm("r6") = arg3; + register unsigned long a4 asm("r7") = arg4; + register unsigned long a5 asm("r8") = arg5; + register unsigned long a6 asm("r9") = arg6; + asm volatile (".long 0x000eaeb0":"=r" (c):"r"(c), "r"(a1), "r"(a2), + "r"(a3), "r"(a4), "r"(a5), "r"(a6)); + return c; +} +static inline int callthru7(int command, unsigned long arg1, unsigned long arg2, + unsigned long arg3, unsigned long arg4, + unsigned long arg5, unsigned long arg6, + unsigned long arg7) +{ + register int c asm("r3") = command; + register unsigned long a1 asm("r4") = arg1; + register unsigned long a2 asm("r5") = arg2; + register unsigned long a3 asm("r6") = arg3; + register unsigned long a4 asm("r7") = arg4; + register unsigned long a5 asm("r8") = arg5; + register unsigned long a6 asm("r9") = arg6; + register unsigned long a7 asm("r10") = arg7; + asm volatile (".long 0x000eaeb0":"=r" (c):"r"(c), "r"(a1), "r"(a2), + "r"(a3), "r"(a4), "r"(a5), "r"(a6), "r"(a7)); + return c; +} + +#endif /* __KERNEL__ */ +#endif/* _SYSTEMSIM_CONFIG_H_ */ From arnd at arndb.de Sat Jan 7 14:56:59 2006 From: arnd at arndb.de (Arnd Bergmann) Date: Sat, 7 Jan 2006 04:56:59 +0100 Subject: Support for Bogus Net In-Reply-To: References: Message-ID: <200601070456.59887.arnd@arndb.de> Am Samstag, 7. Januar 2006 04:20 schrieb Mike Kistler: > Regarding the systemsim-add-systemsim.h patch, I notice that the XLC forms > (which are available in callthru_config.h) are not in the proposed > systemsim.h file. ?It would be nice to have these, protected by the > appropriate ifdefs of course, to enable application development with XLC. > Otherwise, we'll need to continue to ship callthru_config.h with Mambo and > point users to this if they want to use XLC. Would that be for compiling the kernel with XLC or for user space applications running in the simulated linux environment? If I understand you correctly that this is about applications using the callthru inlines, then they should use a differrent header file anyway. Note that the version I posted has everything wrapped inside '#ifdef __KERNEL__', so user applications can not use it. That is absolutely intentional, as user applications should never directly include kernel header files anyway. The correct solution would be to either include a copy of the header file in the application using it or to provide a separate package that installs a header file for user space into $PREFIX/include. Shipping the file with mambo should be ok as well, but I would suggest to make a clear separation of header files for use on the host side (the one running the simulator binary) and header files for the target side. Arnd <>< From mkistler at us.ibm.com Sat Jan 7 14:20:04 2006 From: mkistler at us.ibm.com (Mike Kistler) Date: Fri, 6 Jan 2006 21:20:04 -0600 Subject: Support for Bogus Net In-Reply-To: <200601070202.29680.arnd@arndb.de> Message-ID: I like this approach because it seems like we should be able to quickly finalize and publish the systemsim-add-bogusnet patch (which is currently my main focus). Regarding the systemsim-add-systemsim.h patch, I notice that the XLC forms (which are available in callthru_config.h) are not in the proposed systemsim.h file. It would be nice to have these, protected by the appropriate ifdefs of course, to enable application development with XLC. Otherwise, we'll need to continue to ship callthru_config.h with Mambo and point users to this if they want to use XLC. Regards, Mike Arnd Bergmann 01/06/2006 08:02 PM To: Eric V Van hensbergen/Austin/IBM at IBMUS cc: David Woodhouse , Mike Kistler/Austin/IBM at IBMUS, Patrick Bohrer/Austin/IBM at IBMUS, rsa at us.ltcfwd.linux.ibm.com, linuxppc64-dev at ozlabs.org, ericvh at gmail.com Subject: Re: Support for Bogus Net [added linuxppc64-dev to Cc:] On Friday 06 January 2006 23:49, Eric V Van hensbergen wrote: > Okay, I'll merge it up to 2.6.15, remove the bogus halt and console stuff > and send it out to this list. We can either merge it with the other > "stuff" (the console stuff with systemsim.h in it), or submit it after that > patch gets submitted mainline. How about if we make an extra patch for the systemsim.h file? I find it hard to tell which of the patches (console or the others) is more likely to go in soon, so maybe it works best to have patches like this: [patches from eric] systemsim-add-systemsim.h.diff systemsim-add-bogusdisk.diff systemsim-add-bogusnet.diff [patches from ryan] hvc-cleanups.diff hvc-more-changes.diff hvc-add-rtas.diff hvc-add-systemsim.diff with the hvc-add-systemsim.diff depending on systemsim-add-systemsim.h.diff to be applied first. For reference, I've added my last version of that patch this mail, so we have the same base (and can get comments on it). Arnd <>< Index: linux-2.6.15-rc/include/asm-powerpc/systemsim.h =================================================================== --- /dev/null +++ linux-2.6.15-rc/include/asm-powerpc/systemsim.h @@ -0,0 +1,132 @@ +/* + * + * Copyright (C) 2001, 2005 IBM + * + * Filename : systemsim.h + * + * Originator : Patrick Bohrer and Charles Lefurgy + * Modified By : Eric Van Hensbegren + * + * Purpose : + * + * This file is compiled with programs that are run under the + * PowerPC Full System simulator. For example, stand-alone programs + * or operating systems. The programs call the callthru wrapper + * functions which use an illegal PowerPC instruction to signal the + * simulator to emulate special support. + * + */ + +#ifndef _SYSTEMSIM_CONFIG_H_ +#define _SYSTEMSIM_CONFIG_H_ +#ifdef __KERNEL__ + +/* The functions callthru0 to callthru5 setup up the arguments for the + * simulator callthru and then use the callthru instruction. Note that + * 0-5 specify the number of arguments after the command */ + +/* Note: Arguments are cast as void* to prevent casting by the + compiler. This way, you can pass pointers, integers, etc. in + machine register and have the simulator interpret what the + register is supposed to be. To help with typing errors when using + callthrus, we provide wrapper functions for each callthru. The + wrappers cast all arguments to void*. Unfortunately, this results + in a lot of compiler warnings that I do not know how to remove. If + you modify this code, be aware that we are trying to pick a type + that is the size of the registers (32-bit or 64-bit) and that is + why are choosing to cast to a void* (it should be the size of a + machine register) */ + +static inline int callthru0(int command) +{ + register int c asm("r3") = command; + asm volatile (".long 0x000eaeb0":"=r" (c):"r"(c)); + return (c); +} +static inline int callthru1(int command, unsigned long arg1) +{ + register int c asm("r3") = command; + register unsigned long a1 asm("r4") = arg1; + asm volatile (".long 0x000eaeb0":"=r" (c):"r"(c), "r"(a1)); + return c; +} +static inline int callthru2(int command, unsigned long arg1, unsigned long arg2) +{ + register int c asm("r3") = command; + register unsigned long a1 asm("r4") = arg1; + register unsigned long a2 asm("r5") = arg2; + asm volatile (".long 0x000eaeb0":"=r" (c):"r"(c), "r"(a1), "r"(a2)); + return c; +} +static inline int callthru3(int command, unsigned long arg1, unsigned long arg2, + unsigned long arg3) +{ + register int c asm("r3") = command; + register unsigned long a1 asm("r4") = arg1; + register unsigned long a2 asm("r5") = arg2; + register unsigned long a3 asm("r6") = arg3; + asm volatile (".long 0x000eaeb0":"=r" (c):"r"(c), "r"(a1), "r"(a2), + "r"(a3)); + return c; +} +static inline int callthru4(int command, unsigned long arg1, unsigned long arg2, + unsigned long arg3, unsigned long arg4) +{ + register int c asm("r3") = command; + register unsigned long a1 asm("r4") = arg1; + register unsigned long a2 asm("r5") = arg2; + register unsigned long a3 asm("r6") = arg3; + register unsigned long a4 asm("r7") = arg4; + asm volatile (".long 0x000eaeb0":"=r" (c):"r"(c), "r"(a1), "r"(a2), + "r"(a3), "r"(a4)); + return c; +} +static inline int callthru5(int command, unsigned long arg1, unsigned long arg2, + unsigned long arg3, unsigned long arg4, + unsigned long arg5) +{ + register int c asm("r3") = command; + register unsigned long a1 asm("r4") = arg1; + register unsigned long a2 asm("r5") = arg2; + register unsigned long a3 asm("r6") = arg3; + register unsigned long a4 asm("r7") = arg4; + register unsigned long a5 asm("r8") = arg5; + asm volatile (".long 0x000eaeb0":"=r" (c):"r"(c), "r"(a1), "r"(a2), + "r"(a3), "r"(a4), "r"(a5)); + return c; +} +static inline int callthru6(int command, unsigned long arg1, unsigned long arg2, + unsigned long arg3, unsigned long arg4, + unsigned long arg5, unsigned long arg6) +{ + register int c asm("r3") = command; + register unsigned long a1 asm("r4") = arg1; + register unsigned long a2 asm("r5") = arg2; + register unsigned long a3 asm("r6") = arg3; + register unsigned long a4 asm("r7") = arg4; + register unsigned long a5 asm("r8") = arg5; + register unsigned long a6 asm("r9") = arg6; + asm volatile (".long 0x000eaeb0":"=r" (c):"r"(c), "r"(a1), "r"(a2), + "r"(a3), "r"(a4), "r"(a5), "r"(a6)); + return c; +} +static inline int callthru7(int command, unsigned long arg1, unsigned long arg2, + unsigned long arg3, unsigned long arg4, + unsigned long arg5, unsigned long arg6, + unsigned long arg7) +{ + register int c asm("r3") = command; + register unsigned long a1 asm("r4") = arg1; + register unsigned long a2 asm("r5") = arg2; + register unsigned long a3 asm("r6") = arg3; + register unsigned long a4 asm("r7") = arg4; + register unsigned long a5 asm("r8") = arg5; + register unsigned long a6 asm("r9") = arg6; + register unsigned long a7 asm("r10") = arg7; + asm volatile (".long 0x000eaeb0":"=r" (c):"r"(c), "r"(a1), "r"(a2), + "r"(a3), "r"(a4), "r"(a5), "r"(a6), "r"(a7)); + return c; +} + +#endif /* __KERNEL__ */ +#endif/* _SYSTEMSIM_CONFIG_H_ */ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://ozlabs.org/pipermail/linuxppc64-dev/attachments/20060106/d0befdf0/attachment.htm From clameter at engr.sgi.com Sat Jan 7 17:35:08 2006 From: clameter at engr.sgi.com (Christoph Lameter) Date: Fri, 6 Jan 2006 22:35:08 -0800 (PST) Subject: [ANNOUNCE] numactl 0.9 released In-Reply-To: <200601062210.31154.ak@suse.de> References: <200601032257.53039.ak@suse.de> <200601062210.31154.ak@suse.de> Message-ID: On Fri, 6 Jan 2006, Andi Kleen wrote: > Did migrate_pages make it into Linus' tree yet? I don't see it there yet. Not yet but I would expect it for 2.6.16. There is also an open suse RFE for inclusion of migrate_pages into SLES10. > I think the name of the command is a bit unintuitive - how > about calling it changenodemem or movenodemem ? (better suggestions > welcome) The name is a bit unintuitive but its named the same way as the kernel function. It moves pages of a process so I guess the name is good enough unless someone comes up with a better name. Here is a patch to fix the various issues you pointed out. Thank you: Index: numactl-0.9/migratepages.8 =================================================================== --- numactl-0.9.orig/migratepages.8 2006-01-06 12:18:03.000000000 -0800 +++ numactl-0.9/migratepages.8 2006-01-06 22:29:25.000000000 -0800 @@ -11,10 +11,16 @@ migratepages \- Migrate the physical loc pid from-nodes to-nodes .SH DESCRIPTION .B migratepages -moves the physical localtion of a processes pages without any changes of the +moves the physical location of a processes pages without any changes of the virtual address space of the process. This is usually done to optimize the performance of a process by moving the pages near to the processor executing a process. + +If multiple nodes are specified for from-nodes or to-nodes then +an attempt is made to preserve the relative location of +each page in each nodeset. F.e. if we move from nodes 2-5 to +7,9,12-13 then the preferred mode of transfer is to move pages from +2->7, 3->9, 4->12 and 5->13. .TP Valid node specifiers .TS @@ -61,3 +67,6 @@ migratepages is under the GNU General Pu .I ftok(3) , .I shmat(2) +, +.I taskset(1) + Index: numactl-0.9/migratepages.c =================================================================== --- numactl-0.9.orig/migratepages.c 2006-01-06 22:29:44.000000000 -0800 +++ numactl-0.9/migratepages.c 2006-01-06 22:29:47.000000000 -0800 @@ -81,7 +81,7 @@ int main(int argc, char *argv[]) checknuma(); pid = strtoul(argv[1], &end, 0); - if (*end) + if (*end || end == argv[1]) usage(); fromnodes = nodemask(argv[2]); From mkistler at us.ibm.com Sun Jan 8 01:07:49 2006 From: mkistler at us.ibm.com (Mike Kistler) Date: Sat, 7 Jan 2006 08:07:49 -0600 Subject: Support for Bogus Net In-Reply-To: <200601070456.59887.arnd@arndb.de> Message-ID: Thanks Arnd .... I understand now. This looks good to me. Regards, Mike Arnd Bergmann 01/06/2006 09:56 PM To: Mike Kistler/Austin/IBM at IBMUS cc: David Woodhouse , Eric V Van hensbergen/Austin/IBM at IBMUS, ericvh at gmail.com, linuxppc64-dev at ozlabs.org, Patrick Bohrer/Austin/IBM at IBMUS, rsa at us.ltcfwd.linux.ibm.com Subject: Re: Support for Bogus Net Am Samstag, 7. Januar 2006 04:20 schrieb Mike Kistler: > Regarding the systemsim-add-systemsim.h patch, I notice that the XLC forms > (which are available in callthru_config.h) are not in the proposed > systemsim.h file. It would be nice to have these, protected by the > appropriate ifdefs of course, to enable application development with XLC. > Otherwise, we'll need to continue to ship callthru_config.h with Mambo and > point users to this if they want to use XLC. Would that be for compiling the kernel with XLC or for user space applications running in the simulated linux environment? If I understand you correctly that this is about applications using the callthru inlines, then they should use a differrent header file anyway. Note that the version I posted has everything wrapped inside '#ifdef __KERNEL__', so user applications can not use it. That is absolutely intentional, as user applications should never directly include kernel header files anyway. The correct solution would be to either include a copy of the header file in the application using it or to provide a separate package that installs a header file for user space into $PREFIX/include. Shipping the file with mambo should be ok as well, but I would suggest to make a clear separation of header files for use on the host side (the one running the simulator binary) and header files for the target side. Arnd <>< -------------- next part -------------- An HTML attachment was scrubbed... URL: http://ozlabs.org/pipermail/linuxppc64-dev/attachments/20060107/0f6d4c13/attachment.htm From schwab at suse.de Sun Jan 8 01:34:33 2006 From: schwab at suse.de (Andreas Schwab) Date: Sat, 07 Jan 2006 15:34:33 +0100 Subject: [PATCH] 0/5 powerpc: Platform & i2c updates & cpufreq In-Reply-To: <1136593470.4840.154.camel@localhost.localdomain> (Benjamin Herrenschmidt's message of "Sat, 07 Jan 2006 11:24:30 +1100") References: <1136593470.4840.154.camel@localhost.localdomain> Message-ID: Benjamin Herrenschmidt writes: > This serie of patch replaces the 2 I posted recently for platform > functions & g5 cpufreq. It's not a 100% finished job yet but it's > getting closer. The patch appears to break ALSA on PowerMac Dual 1.8GHz. The volume control is going wild, and I'm getting distorted sound. Andreas. -- Andreas Schwab, SuSE Labs, schwab at suse.de SuSE Linux Products GmbH, Maxfeldstra?e 5, 90409 N?rnberg, Germany PGP key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different." From jschopp at austin.ibm.com Sun Jan 8 04:49:17 2006 From: jschopp at austin.ibm.com (Joel Schopp) Date: Sat, 07 Jan 2006 11:49:17 -0600 Subject: PowerPC fastpaths for mutex subsystem In-Reply-To: <20060106002919.GA29190@pb15.lixom.net> References: <20060104144151.GA27646@elte.hu> <43BC5E15.207@austin.ibm.com> <20060105143502.GA16816@elte.hu> <43BD4C66.60001@austin.ibm.com> <20060105222106.GA26474@elte.hu> <43BDA672.4090704@austin.ibm.com> <20060106002919.GA29190@pb15.lixom.net> Message-ID: <43BFFF1D.7030007@austin.ibm.com> This is the second pass at optimizing the fastpath for the new mutex subsystem on PowerPC. I think it is ready to be included in the series with the other mutex patches now. Tested on a 4 core (2 SMT threads/core) Power5 machine with gcc 3.3.2. Test results from synchro-test.ko: All tests run for default 5 seconds Threads semaphores mutexes mutexes+attached 1 63,465,364 58,404,630 62,109,571 4 58,424,282 35,541,297 37,820,794 8 40,731,668 35,541,297 40,281,768 16 38,372,769 37,256,298 41,751,764 32 38,406,895 36,933,675 38,731,571 64 37,232,017 36,222,480 40,766,379 Signed-off-by: Joel Schopp -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: powerpcmutex.patch Url: http://ozlabs.org/pipermail/linuxppc64-dev/attachments/20060107/510b7134/attachment.txt From olh at suse.de Sun Jan 8 08:28:51 2006 From: olh at suse.de (Olaf Hering) Date: Sat, 7 Jan 2006 22:28:51 +0100 Subject: [PATCH 14/22] ppc64: RPA PHP to EEH code movement In-Reply-To: <20051006234624.GO29826@austin.ibm.com> References: <20051006232032.GA29826@austin.ibm.com> <20051006234624.GO29826@austin.ibm.com> Message-ID: <20060107212851.GA31731@suse.de> On Thu, Oct 06, Linas Vepstas wrote: > > 14-rpaphp-migrate.patch > > This patch moves some pci device add & remove code from the PCI > hotplug directory to the arch/ppc64/kernel directory, and cleans > it up a tad. The primary reason for this is that the code performs > some fairly generic operations that are shared with the PCI error > recovery code (living in the arch/ppc64/kernel directory). > +++ linux-2.6.14-rc2-git6/arch/ppc64/kernel/pci_dlpar.c 2005-10-06 17:54:00.306445890 -0500 > +pcibios_add_pci_devices(struct pci_bus * bus) > + eeh_add_device_tree_early(dn); eeh_add_device_tree_early is in eeh.c, which depends on CONFIG_EEH. but pci_dlpar.c is compiled unconditionally. Current powerpc.git gives: arch/powerpc/platforms/built-in.o(.text+0x99b8): In function `.pcibios_add_pci_devices': : undefined reference to `.eeh_add_device_tree_early' arch/powerpc/platforms/built-in.o(.text+0x9b40): In function `.pcibios_remove_pci_devices': : undefined reference to `.eeh_remove_bus_device' -- short story of a lazy sysadmin: alias appserv=wotan From benh at kernel.crashing.org Sun Jan 8 09:04:53 2006 From: benh at kernel.crashing.org (Benjamin Herrenschmidt) Date: Sun, 08 Jan 2006 09:04:53 +1100 Subject: [PATCH] 0/5 powerpc: Platform & i2c updates & cpufreq In-Reply-To: References: <1136593470.4840.154.camel@localhost.localdomain> Message-ID: <1136671493.30123.2.camel@localhost.localdomain> On Sat, 2006-01-07 at 15:34 +0100, Andreas Schwab wrote: > Benjamin Herrenschmidt writes: > > > This serie of patch replaces the 2 I posted recently for platform > > functions & g5 cpufreq. It's not a 100% finished job yet but it's > > getting closer. > > The patch appears to break ALSA on PowerMac Dual 1.8GHz. The volume > control is going wild, and I'm getting distorted sound. Which patch specifically ? I suspect a problem with the keywest i2c code, I 'll have a look today or tomorrow. Ben. From benh at kernel.crashing.org Sun Jan 8 09:09:01 2006 From: benh at kernel.crashing.org (Benjamin Herrenschmidt) Date: Sun, 08 Jan 2006 09:09:01 +1100 Subject: [PATCH] 0/5 powerpc: Platform & i2c updates & cpufreq In-Reply-To: References: <1136593470.4840.154.camel@localhost.localdomain> Message-ID: <1136671741.30123.6.camel@localhost.localdomain> On Sat, 2006-01-07 at 15:34 +0100, Andreas Schwab wrote: > Benjamin Herrenschmidt writes: > > > This serie of patch replaces the 2 I posted recently for platform > > functions & g5 cpufreq. It's not a 100% finished job yet but it's > > getting closer. > > The patch appears to break ALSA on PowerMac Dual 1.8GHz. The volume > control is going wild, and I'm getting distorted sound. Ok, I think it's the sound driver's i2c code relied on a bug in i2c-keywest that has been fixed by the new i2c driver. I'll post a fix later today. Ben. From akpm at osdl.org Sun Jan 8 09:37:22 2006 From: akpm at osdl.org (Andrew Morton) Date: Sat, 7 Jan 2006 14:37:22 -0800 Subject: PowerPC fastpaths for mutex subsystem In-Reply-To: <43BFFF1D.7030007@austin.ibm.com> References: <20060104144151.GA27646@elte.hu> <43BC5E15.207@austin.ibm.com> <20060105143502.GA16816@elte.hu> <43BD4C66.60001@austin.ibm.com> <20060105222106.GA26474@elte.hu> <43BDA672.4090704@austin.ibm.com> <20060106002919.GA29190@pb15.lixom.net> <43BFFF1D.7030007@austin.ibm.com> Message-ID: <20060107143722.25afd85d.akpm@osdl.org> Joel Schopp wrote: > > This is the second pass at optimizing the fastpath for the new mutex subsystem > on PowerPC. I think it is ready to be included in the series with the other > mutex patches now. Tested on a 4 core (2 SMT threads/core) Power5 machine with > gcc 3.3.2. > > Test results from synchro-test.ko: > > All tests run for default 5 seconds > Threads semaphores mutexes mutexes+attached > 1 63,465,364 58,404,630 62,109,571 > 4 58,424,282 35,541,297 37,820,794 > 8 40,731,668 35,541,297 40,281,768 > 16 38,372,769 37,256,298 41,751,764 > 32 38,406,895 36,933,675 38,731,571 > 64 37,232,017 36,222,480 40,766,379 > Doens't this mean that the sped-up mutexes are still slower than semaphores? From benh at kernel.crashing.org Sun Jan 8 15:52:36 2006 From: benh at kernel.crashing.org (Benjamin Herrenschmidt) Date: Sun, 08 Jan 2006 15:52:36 +1100 Subject: [PATCH] powerpc: Fix PowerMac sound i2c Message-ID: <1136695956.30123.44.camel@localhost.localdomain> My patch reworking the PowerMac i2c code break the sound drivers as they used to rely on some broken behaviour of i2c-keywest that is gone now. This patch should fix them (tested on a g5 with alsa only). It might also fix an oops if the alsa driver hits an unsupported chip. Signed-off-by: Benjamin Herrenschmidt Index: linux-work/sound/ppc/tumbler.c =================================================================== --- linux-work.orig/sound/ppc/tumbler.c 2005-11-24 17:19:14.000000000 +1100 +++ linux-work/sound/ppc/tumbler.c 2006-01-08 15:18:09.000000000 +1100 @@ -137,6 +137,22 @@ static int send_init_client(pmac_keywest return 0; } +static int tumbler_write_block(struct i2c_client *client, u8 reg, int len, + u8 *values) +{ + union i2c_smbus_data data; + int err; + + data.block[0] = len; + memcpy(&data.block[1], values, len); + err = i2c_smbus_xfer(client->adapter, client->addr, client->flags, + I2C_SMBUS_WRITE, reg, I2C_SMBUS_I2C_BLOCK_DATA, + &data); + return err; +} + + + static int tumbler_init_client(pmac_keywest_t *i2c) { @@ -239,8 +255,7 @@ static int tumbler_set_master_volume(pma block[4] = (right_vol >> 8) & 0xff; block[5] = (right_vol >> 0) & 0xff; - if (i2c_smbus_write_block_data(mix->i2c.client, TAS_REG_VOL, - 6, block) < 0) { + if (tumbler_write_block(mix->i2c.client, TAS_REG_VOL, 6, block) < 0) { snd_printk("failed to set volume \n"); return -EINVAL; } @@ -340,8 +355,7 @@ static int tumbler_set_drc(pmac_tumbler_ val[1] = 0; } - if (i2c_smbus_write_block_data(mix->i2c.client, TAS_REG_DRC, - 2, val) < 0) { + if (tumbler_write_block(mix->i2c.client, TAS_REG_DRC, 2, val) < 0) { snd_printk("failed to set DRC\n"); return -EINVAL; } @@ -376,8 +390,7 @@ static int snapper_set_drc(pmac_tumbler_ val[4] = 0x60; val[5] = 0xa0; - if (i2c_smbus_write_block_data(mix->i2c.client, TAS_REG_DRC, - 6, val) < 0) { + if (tumbler_write_block(mix->i2c.client, TAS_REG_DRC, 6, val) < 0) { snd_printk("failed to set DRC\n"); return -EINVAL; } @@ -481,8 +494,8 @@ static int tumbler_set_mono_volume(pmac_ vol = info->table[vol]; for (i = 0; i < info->bytes; i++) block[i] = (vol >> ((info->bytes - i - 1) * 8)) & 0xff; - if (i2c_smbus_write_block_data(mix->i2c.client, info->reg, - info->bytes, block) < 0) { + if (tumbler_write_block(mix->i2c.client, info->reg, + info->bytes, block) < 0) { snd_printk("failed to set mono volume %d\n", info->index); return -EINVAL; } @@ -611,7 +624,7 @@ static int snapper_set_mix_vol1(pmac_tum for (j = 0; j < 3; j++) block[i * 3 + j] = (vol >> ((2 - j) * 8)) & 0xff; } - if (i2c_smbus_write_block_data(mix->i2c.client, reg, 9, block) < 0) { + if (tumbler_write_block(mix->i2c.client, reg, 9, block) < 0) { snd_printk("failed to set mono volume %d\n", reg); return -EINVAL; } Index: linux-work/sound/oss/dmasound/tas_common.h =================================================================== --- linux-work.orig/sound/oss/dmasound/tas_common.h 2005-11-24 17:19:14.000000000 +1100 +++ linux-work/sound/oss/dmasound/tas_common.h 2006-01-08 15:33:29.000000000 +1100 @@ -157,6 +157,21 @@ tas_mono_to_stereo(uint mono) return mono | (mono<<8); } +static int tas_write_block(struct i2c_client *client, u8 reg, int len, u8 *vals) +{ + union i2c_smbus_data data; + int err; + + data.block[0] = len; + memcpy(&data.block[1], vals, len); + err = i2c_smbus_xfer(client->adapter, client->addr, client->flags, + I2C_SMBUS_WRITE, reg, I2C_SMBUS_I2C_BLOCK_DATA, + &data); + return err; +} + + + /* * Todo: make these functions a bit more efficient ! */ @@ -178,10 +193,8 @@ tas_write_register( struct tas_data_t *s if (write_mode & WRITE_SHADOW) memcpy(self->shadow[reg_num],data,reg_width); if (write_mode & WRITE_HW) { - rc=i2c_smbus_write_block_data(self->client, - reg_num, - reg_width, - data); + rc = tas_write_block(self->client, reg_num, + reg_width, data); if (rc < 0) { printk("tas: I2C block write failed \n"); return rc; @@ -199,10 +212,8 @@ tas_sync_register( struct tas_data_t *se if (reg_width==0 || self==NULL) return -EINVAL; - rc=i2c_smbus_write_block_data(self->client, - reg_num, - reg_width, - self->shadow[reg_num]); + rc = tas_write_block(self->client, reg_num, + reg_width, self->shadow[reg_num]); if (rc < 0) { printk("tas: I2C block write failed \n"); return rc; Index: linux-work/sound/ppc/pmac.c =================================================================== --- linux-work.orig/sound/ppc/pmac.c 2005-12-19 16:13:48.000000000 +1100 +++ linux-work/sound/ppc/pmac.c 2006-01-08 15:37:10.000000000 +1100 @@ -74,7 +74,7 @@ static int snd_pmac_dbdma_alloc(pmac_t * static void snd_pmac_dbdma_free(pmac_t *chip, pmac_dbdma_t *rec) { - if (rec) { + if (rec->space) { unsigned int rsize = sizeof(struct dbdma_cmd) * (rec->size + 1); dma_free_coherent(&chip->pdev->dev, rsize, rec->space, rec->dma_base); @@ -895,6 +895,7 @@ static int __init snd_pmac_detect(pmac_t chip->can_capture = 1; chip->num_freqs = ARRAY_SIZE(awacs_freqs); chip->freq_table = awacs_freqs; + chip->pdev = NULL; chip->control_mask = MASK_IEPC | MASK_IEE | 0x11; /* default */ From hollis at penguinppc.org Sun Jan 8 15:55:48 2006 From: hollis at penguinppc.org (Hollis Blanchard) Date: Sat, 7 Jan 2006 22:55:48 -0600 Subject: [PATCH] powerpc: Fix PowerMac sound i2c In-Reply-To: <1136695956.30123.44.camel@localhost.localdomain> References: <1136695956.30123.44.camel@localhost.localdomain> Message-ID: On Jan 7, 2006, at 10:52 PM, Benjamin Herrenschmidt wrote: > + data.block[0] = len; > + memcpy(&data.block[1], values, len); Seem to be mixing tabs and spaces here (in both *_write_block functions). -Hollis From benh at kernel.crashing.org Sun Jan 8 17:22:59 2006 From: benh at kernel.crashing.org (Benjamin Herrenschmidt) Date: Sun, 08 Jan 2006 17:22:59 +1100 Subject: [PATCH] powerpc: Fix PowerMac sound i2c In-Reply-To: References: <1136695956.30123.44.camel@localhost.localdomain> Message-ID: <1136701380.30123.46.camel@localhost.localdomain> On Sat, 2006-01-07 at 22:55 -0600, Hollis Blanchard wrote: > On Jan 7, 2006, at 10:52 PM, Benjamin Herrenschmidt wrote: > > > + data.block[0] = len; > > + memcpy(&data.block[1], values, len); > > Seem to be mixing tabs and spaces here (in both *_write_block > functions). You mean the patch got mangled or the code is mixing tab/spaces ? I think the driver was pretty mixed up in the first place, I'll have to check. Ben. From anton at samba.org Sun Jan 8 18:43:57 2006 From: anton at samba.org (Anton Blanchard) Date: Sun, 8 Jan 2006 18:43:57 +1100 Subject: PowerPC fastpaths for mutex subsystem In-Reply-To: <20060107143722.25afd85d.akpm@osdl.org> References: <20060104144151.GA27646@elte.hu> <43BC5E15.207@austin.ibm.com> <20060105143502.GA16816@elte.hu> <43BD4C66.60001@austin.ibm.com> <20060105222106.GA26474@elte.hu> <43BDA672.4090704@austin.ibm.com> <20060106002919.GA29190@pb15.lixom.net> <43BFFF1D.7030007@austin.ibm.com> <20060107143722.25afd85d.akpm@osdl.org> Message-ID: <20060108074356.GM26499@krispykreme> > Doens't this mean that the sped-up mutexes are still slower than semaphores? Wasnt most of the x86 mutex gain a result of going from fair to unfair operation? The current ppc64 semaphores are unfair. Anton From akpm at osdl.org Sun Jan 8 19:00:21 2006 From: akpm at osdl.org (Andrew Morton) Date: Sun, 8 Jan 2006 00:00:21 -0800 Subject: PowerPC fastpaths for mutex subsystem In-Reply-To: <20060108074356.GM26499@krispykreme> References: <20060104144151.GA27646@elte.hu> <43BC5E15.207@austin.ibm.com> <20060105143502.GA16816@elte.hu> <43BD4C66.60001@austin.ibm.com> <20060105222106.GA26474@elte.hu> <43BDA672.4090704@austin.ibm.com> <20060106002919.GA29190@pb15.lixom.net> <43BFFF1D.7030007@austin.ibm.com> <20060107143722.25afd85d.akpm@osdl.org> <20060108074356.GM26499@krispykreme> Message-ID: <20060108000021.588c6f5f.akpm@osdl.org> Anton Blanchard wrote: > > > > Doens't this mean that the sped-up mutexes are still slower than semaphores? > > Wasnt most of the x86 mutex gain a result of going from fair to unfair > operation? The current ppc64 semaphores are unfair. > What's "unfair"? Mutexes are FIFO, as are x86 semaphores. From anton at samba.org Sun Jan 8 19:23:01 2006 From: anton at samba.org (Anton Blanchard) Date: Sun, 8 Jan 2006 19:23:01 +1100 Subject: PowerPC fastpaths for mutex subsystem In-Reply-To: <20060108000021.588c6f5f.akpm@osdl.org> References: <43BC5E15.207@austin.ibm.com> <20060105143502.GA16816@elte.hu> <43BD4C66.60001@austin.ibm.com> <20060105222106.GA26474@elte.hu> <43BDA672.4090704@austin.ibm.com> <20060106002919.GA29190@pb15.lixom.net> <43BFFF1D.7030007@austin.ibm.com> <20060107143722.25afd85d.akpm@osdl.org> <20060108074356.GM26499@krispykreme> <20060108000021.588c6f5f.akpm@osdl.org> Message-ID: <20060108082301.GN26499@krispykreme> > What's "unfair"? Mutexes are FIFO, as are x86 semaphores. The ppc64 semaphores dont force everyone into the slow path under contention. So you could drop and pick up the semaphore even with someone waiting. I thought thats how the new mutex code worked. Anton From mingo at elte.hu Sun Jan 8 20:48:39 2006 From: mingo at elte.hu (Ingo Molnar) Date: Sun, 8 Jan 2006 10:48:39 +0100 Subject: PowerPC fastpaths for mutex subsystem In-Reply-To: <43BFFF1D.7030007@austin.ibm.com> References: <20060104144151.GA27646@elte.hu> <43BC5E15.207@austin.ibm.com> <20060105143502.GA16816@elte.hu> <43BD4C66.60001@austin.ibm.com> <20060105222106.GA26474@elte.hu> <43BDA672.4090704@austin.ibm.com> <20060106002919.GA29190@pb15.lixom.net> <43BFFF1D.7030007@austin.ibm.com> Message-ID: <20060108094839.GA16887@elte.hu> * Joel Schopp wrote: > Tested on a 4 core (2 SMT threads/core) Power5 machine with gcc 3.3.2. > Test results from synchro-test.ko: > > All tests run for default 5 seconds > Threads semaphores mutexes mutexes+attached > 1 63,465,364 58,404,630 62,109,571 > 4 58,424,282 35,541,297 37,820,794 > 8 40,731,668 35,541,297 40,281,768 > 16 38,372,769 37,256,298 41,751,764 > 32 38,406,895 36,933,675 38,731,571 > 64 37,232,017 36,222,480 40,766,379 interesting. Could you try two things? Firstly, could you add some minimal delays to the lock/unlock path, of at least 1 usec? E.g. "synchro-test.ko load=1 interval=1". [but you could try longer delays too, 10 usecs is still realistic.] secondly, could you try the VFS creat+unlink test via the test-mutex.c code below, with something like: ./test-mutex V 16 10 (this tests with 16 tasks, for 10 seconds.) You'll get a useful ops/sec number out of this test, but the other stats will only be calculated if you implement the rdtsc() macro to read cycles - right now it defaults to 'always 0' on ppc, i386 and ia64 has it implemented. Also, beware that the default atomic_inc()/dec() is unsafe (only i386 and ia64 has the real thing implemented), you might want to add a safe PPC implementation. thirdly, could you run 'vmstat 1' during the tests, and post those lines too? Here i'm curious about two things: the average runqueue length (whether we have overscheduling), and CPU utilization and idle time left (how efficiently cycles are preserved in contention). [btw., does ppc have an idle=poll equivalent mode of idling?] also, there seems to be some fluctuation in the numbers - could you try to run a few more to see how stable the numbers are? Ingo ------------ /* * Copyright (C) 2005, Ingo Molnar */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #ifdef __ia64__ #include #include "mmtimer.h" int mmtimer_fd; unsigned long __mm_timer_clock_res; unsigned long *__mm_clock_dev; unsigned long __mm_clock_offset; #endif unsigned long *shared; #define mutex_lock() gettimeofday((void *)0, (void *)10) #define mutex_unlock() gettimeofday((void *)0, (void *)20) #define down() gettimeofday((void *)0, (void *)100) #define up() gettimeofday((void *)0, (void *)200) #define down_write() gettimeofday((void *)0, (void *)1000) #define up_write() gettimeofday((void *)0, (void *)2000) #define down_read() gettimeofday((void *)0, (void *)10000) #define up_read() gettimeofday((void *)0, (void *)20000) /* * Shared locks and variables between the test tasks: */ #define CACHELINE_SIZE (128/sizeof(long)) enum { SHARED_DELTA_SUM = 0*CACHELINE_SIZE, SHARED_DELTA_MAX = 1*CACHELINE_SIZE, SHARED_DELTA2_SUM = 2*CACHELINE_SIZE, SHARED_DELTA2_MAX = 3*CACHELINE_SIZE, SHARED_DELTA3_SUM = 4*CACHELINE_SIZE, SHARED_DELTA3_MAX = 5*CACHELINE_SIZE, SHARED_DELTA_DELTA_SUM = 6*CACHELINE_SIZE, SHARED_COUNT = 7*CACHELINE_SIZE, SHARED_SUM = 8*CACHELINE_SIZE, SHARED_LOCK = 9*CACHELINE_SIZE, SHARED_END = 10*CACHELINE_SIZE, }; #define SHARED(x) (*(shared + SHARED_##x)) #define SHARED_LL(x) (*(unsigned long long *)(shared + SHARED_##x)) #define BUG_ON(c) assert(!(c)) static unsigned long *setup_shared_var(void) { char zerobuff [4096] = { 0, }; int ret, fd; unsigned long *buf; char tmpfile[100]; sprintf(tmpfile, ".tmp_mmap-%d", getpid()); fd = creat(tmpfile, 0700); BUG_ON(fd == -1); close(fd); fd = open(tmpfile, O_RDWR|O_CREAT|O_TRUNC); unlink(tmpfile); BUG_ON(fd == -1); ret = write(fd, zerobuff, 4096); BUG_ON(ret != 4096); buf = (void *)mmap(0, 4096, PROT_READ|PROT_WRITE, MAP_SHARED, fd, 0); BUG_ON(buf == (void *)-1); close(fd); return buf; } #define LOOPS 10000 #ifdef __ia64__ static int setup_mmtimer(void) { unsigned long regoff; int fd, _t; size_t pagesize; if ((fd = open ("/dev/mmtimer", O_RDONLY)) == -1) perror("missing /dev/mmtimer"); else { pagesize = getpagesize(); __mm_clock_dev = mmap(0, pagesize, PROT_READ, MAP_SHARED, fd, 0); if (__mm_clock_dev != MAP_FAILED) { regoff = ioctl(fd, MMTIMER_GETOFFSET, 0); if (regoff >= 0) { __mm_clock_dev += regoff; __mm_clock_offset = *__mm_clock_dev; } else perror("reg offset ioctl failed"); _t = ioctl(fd, MMTIMER_GETFREQ, &__mm_timer_clock_res); if (_t) perror("get freq ioctl fail"); } } } #define ia64_fetchadd8_rel(p, inc) \ ({ \ __u64 ia64_intri_res; \ asm volatile ("fetchadd8.rel %0=[%1],%2" \ : "=r"(ia64_intri_res) : "r"(p), "i" (inc) \ : "memory"); \ \ ia64_intri_res; \ }) static inline void atomic_inc(unsigned long *flag) { ia64_fetchadd8_rel(flag, 1); } static inline void atomic_dec(unsigned long *flag) { ia64_fetchadd8_rel(flag, -1); } #elif defined(__i386__) static inline void atomic_inc(unsigned long *flag) { __asm__ __volatile__( "lock; incl %0\n" : "=g"(*flag) : : "memory"); } static inline void atomic_dec(unsigned long *flag) { __asm__ __volatile__( "lock; decl %0\n" : "=g"(*flag) : : "memory"); } #else static inline void atomic_inc(unsigned long *flag) { ++*flag; } static inline void atomic_dec(unsigned long *flag) { --*flag; } #endif static void LOCK(unsigned long *shared) { for (;;) { atomic_inc(&SHARED(LOCK)); if (SHARED(LOCK) == 1) break; atomic_dec(&SHARED(LOCK)); usleep(1); } } static void UNLOCK(unsigned long *shared) { atomic_dec(&SHARED(LOCK)); } static void sigint(int sig) { atomic_inc(&SHARED(END)); } static void print_status(unsigned long *shared) { unsigned long count; count = SHARED(COUNT); SHARED(COUNT) = 0; SHARED_LL(SUM) += count; printf("\r| loops/sec: %ld \r", count); fflush(stdout); } enum { TYPE_MUTEX, TYPE_SEM, TYPE_RSEM, TYPE_WSEM, TYPE_VFS, NR_TYPES }; const char * type_names[NR_TYPES] = { "Mutex", "Semaphore", "RW-semaphore Read", "RW-semaphore Write", "VFS" }; typedef unsigned long long cycles_t; typedef unsigned long long usecs_t; #ifdef __ia64__ # define rdtscll(val) \ do { \ val = *__mm_clock_dev; \ } while (0) #elif defined(__i386__) # define rdtscll(val) \ do { \ __asm__ __volatile__("rdtsc" : "=A" (val)); \ } while (0) #else # define rdtscll(val) \ do { (val) = 0LL; } while (0) #endif #define rdtod(val) \ do { \ struct timeval tv; \ \ gettimeofday(&tv, NULL); \ (val) = tv.tv_sec * 1000000ULL + tv.tv_usec; \ } while (0) #define max(x,y) ({ \ typeof(x) _x = (x); \ typeof(y) _y = (y); \ (void) (&_x == &_y); \ _x > _y ? _x : _y; }) #define unlikely(x) __builtin_expect(!!(x), 0) int main(int argc, char **argv) { int i, parent, me, first = 1; unsigned long cpus, tasks, seconds = 0; cycles_t t0, t01, t1, delta, delta2, delta3, delta_sum = 0, delta2_sum = 0, delta3_sum = 0, delta_delta, delta_delta_sum = 0, prev_delta, delta_max = 0, delta2_max = 0, delta3_max = 0; char str[100]; double freq; int type; if (argc <= 1 || argc > 4) { usage: fprintf(stderr, "usage: test-mutex [Mutex|Sem|Rsem|Wsem|Vfs creat+unlink] \n"); exit(-1); usage2: fprintf(stderr, "the Mutex/Sem/Rsem/Wsem tests are not available.\n"); goto usage; } switch (argv[1][0]) { case 'M': type = TYPE_MUTEX; goto usage2; break; case 'S': type = TYPE_SEM; goto usage2; break; case 'R': type = TYPE_RSEM; goto usage2; break; case 'W': type = TYPE_WSEM; goto usage2; break; case 'V': type = TYPE_VFS; break; default: goto usage; } system("rm -f /tmp/* 2>/dev/null >/dev/null"); cpus = system("exit `grep processor /proc/cpuinfo | wc -l`"); cpus = WEXITSTATUS(cpus); tasks = cpus; if (argc >= 3) { tasks = atol(argv[2]); if (!tasks) goto usage; } if (argc >= 4) seconds = atol(argv[3]); else seconds = -1; #ifdef __ia64__ setup_mmtimer(); #endif printf("%ld CPUs, running %ld parallel test-tasks.\n", cpus, tasks); printf("checking %s performance.\n", type_names[type]); shared = setup_shared_var(); signal(SIGINT, sigint); signal(SIGHUP, sigint); parent = getpid(); for (i = 0; i < tasks; i++) if (!fork()) break; sleep(1); me = getpid(); sprintf(str, "/tmp/tmp-%d", me); if (me == parent) { unsigned long long total_count; int i = 0, j; for (;;) { sleep(1); if (i == seconds || SHARED(END)) break; i++; print_status(shared); } atomic_inc(&SHARED(END)); total_count = SHARED(SUM); for (j = 0; j < tasks; j++) wait(NULL); if (i) printf("\navg ops/sec: %Ld\n", total_count / i); LOCK(shared); // printf("delta_sum: %Ld\n", SHARED_LL(DELTA_SUM)); // printf("delta_delta_sum: %Ld\n", SHARED_LL(DELTA_DELTA_SUM)); #ifdef __ia64__ freq = 25.0; #else freq = 700.0; #endif printf("average cost per op: %.2f usecs\n", (double)SHARED_LL(DELTA_SUM)/total_count/freq); printf("average cost per lock: %.2f usecs\n", (double)SHARED_LL(DELTA2_SUM)/total_count/freq); printf("average cost per unlock: %.2f usecs\n", (double)SHARED_LL(DELTA3_SUM)/total_count/freq); printf("max cost per op: %.2f usecs\n", (double)SHARED_LL(DELTA_MAX)/freq); printf("max cost per lock: %.2f usecs\n", (double)SHARED_LL(DELTA2_MAX)/freq); printf("max cost per unlock: %.2f usecs\n", (double)SHARED_LL(DELTA3_MAX)/freq); printf("average deviance per op: %.2f usecs\n", (double)SHARED_LL(DELTA_DELTA_SUM)/total_count/freq/2.0); UNLOCK(shared); exit(0); } for (;;) { rdtscll(t0); switch (type) { case TYPE_MUTEX: mutex_lock(); rdtscll(t01); mutex_unlock(); break; case TYPE_SEM: down(); rdtscll(t01); up(); break; case TYPE_RSEM: down_read(); rdtscll(t01); up_read(); break; case TYPE_WSEM: down_write(); rdtscll(t01); up_write(); break; case TYPE_VFS: { int fd; fd = creat(str, S_IRWXU); rdtscll(t01); close(fd); break; } } rdtscll(t1); delta = t1-t0; if (unlikely(delta > delta_max)) delta_max = delta; delta_sum += delta; delta2 = t01-t0; if (unlikely(delta2 > delta2_max)) delta2_max = delta2; delta2_sum += delta2; delta3 = t1-t01; if (unlikely(delta3 > delta3_max)) delta3_max = delta3; delta3_sum += delta3; if (!first) { if (prev_delta < delta) delta_delta = delta - prev_delta; else delta_delta = prev_delta - delta; delta_delta_sum += delta_delta; #if 0 printf("%Ld-%Ld {%Ld} prev: {%Ld} / [%Ld]\n", t0, t1, delta, prev_delta, delta_delta); printf(" {%Ld} - {%Ld}\n", delta_sum, delta_delta_sum); #endif } else first = 0; prev_delta = delta; atomic_inc(&SHARED(COUNT)); if (unlikely(SHARED(END))) { LOCK(shared); SHARED_LL(DELTA_SUM) += delta_sum; SHARED_LL(DELTA_MAX) = max(SHARED_LL(DELTA_MAX), delta_max); SHARED_LL(DELTA2_SUM) += delta2_sum; SHARED_LL(DELTA2_MAX) = max(SHARED_LL(DELTA2_MAX), delta2_max); SHARED_LL(DELTA3_SUM) += delta3_sum; SHARED_LL(DELTA3_MAX) = max(SHARED_LL(DELTA3_MAX), delta3_max); SHARED_LL(DELTA_DELTA_SUM) += delta_delta_sum; #if 0 printf("delta_sum: %Ld\n", delta_sum); printf("delta_delta_sum: %Ld\n", delta_delta_sum); printf("DELTA_SUM: %Ld\n", SHARED_LL(DELTA_SUM)); printf("DELTA_DELTA_SUM: %Ld\n", SHARED_LL(DELTA_DELTA_SUM)); #endif UNLOCK(shared); exit(0); } } return 0; } From schwab at suse.de Sun Jan 8 21:37:12 2006 From: schwab at suse.de (Andreas Schwab) Date: Sun, 08 Jan 2006 11:37:12 +0100 Subject: [PATCH] powerpc: Fix PowerMac sound i2c In-Reply-To: <1136695956.30123.44.camel@localhost.localdomain> (Benjamin Herrenschmidt's message of "Sun, 08 Jan 2006 15:52:36 +1100") References: <1136695956.30123.44.camel@localhost.localdomain> Message-ID: Benjamin Herrenschmidt writes: > My patch reworking the PowerMac i2c code break the sound drivers as they > used to rely on some broken behaviour of i2c-keywest that is gone now. I'm not sure, but from looking at the other i2c drivers I'd rather think that the old behaviour of i2c-keywest was correct. There are only a few that implement both I2C_SMBUS_BLOCK_DATA and I2C_SMBUS_I2C_BLOCK_DATA, but none of them write the length byte together with the data. The commands are ony different in behaviour when reading: with I2C_SMBUS_I2C_BLOCK_DATA a fixed sized block is read from the bus, whereas with I2C_SMBUS_BLOCK_DATA the size of the block is variable. At least that's how i2c-nforce2, i2c-viapro and i2c-amd8111 implement the commands. Andreas. -- Andreas Schwab, SuSE Labs, schwab at suse.de SuSE Linux Products GmbH, Maxfeldstra?e 5, 90409 N?rnberg, Germany PGP key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different." From mingo at elte.hu Sun Jan 8 21:43:57 2006 From: mingo at elte.hu (Ingo Molnar) Date: Sun, 8 Jan 2006 11:43:57 +0100 Subject: PowerPC fastpaths for mutex subsystem In-Reply-To: <43BFFF1D.7030007@austin.ibm.com> References: <20060104144151.GA27646@elte.hu> <43BC5E15.207@austin.ibm.com> <20060105143502.GA16816@elte.hu> <43BD4C66.60001@austin.ibm.com> <20060105222106.GA26474@elte.hu> <43BDA672.4090704@austin.ibm.com> <20060106002919.GA29190@pb15.lixom.net> <43BFFF1D.7030007@austin.ibm.com> Message-ID: <20060108104357.GB31359@elte.hu> looks good to me. Minor nit: > +" isync\n" > +" isync \n" shouldnt these two be ISYNC_ON_SMP? Ingo From schwab at suse.de Mon Jan 9 00:30:36 2006 From: schwab at suse.de (Andreas Schwab) Date: Sun, 08 Jan 2006 14:30:36 +0100 Subject: [PATCH] powerpc: Fix PowerMac sound i2c In-Reply-To: (Andreas Schwab's message of "Sun, 08 Jan 2006 11:37:12 +0100") References: <1136695956.30123.44.camel@localhost.localdomain> Message-ID: Andreas Schwab writes: > Benjamin Herrenschmidt writes: > >> My patch reworking the PowerMac i2c code break the sound drivers as they >> used to rely on some broken behaviour of i2c-keywest that is gone now. > > I'm not sure, but from looking at the other i2c drivers I'd rather think > that the old behaviour of i2c-keywest was correct. I have now read the thread on linux-kernel@ and I have to revise my opinion. I think I now understand better the difference between smbus and i2c bus. Andreas. -- Andreas Schwab, SuSE Labs, schwab at suse.de SuSE Linux Products GmbH, Maxfeldstra?e 5, 90409 N?rnberg, Germany PGP key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different." From benh at kernel.crashing.org Mon Jan 9 08:03:33 2006 From: benh at kernel.crashing.org (Benjamin Herrenschmidt) Date: Mon, 09 Jan 2006 08:03:33 +1100 Subject: [PATCH] powerpc: Fix PowerMac sound i2c In-Reply-To: References: <1136695956.30123.44.camel@localhost.localdomain> Message-ID: <1136754214.30123.50.camel@localhost.localdomain> On Sun, 2006-01-08 at 11:37 +0100, Andreas Schwab wrote: > Benjamin Herrenschmidt writes: > > > My patch reworking the PowerMac i2c code break the sound drivers as they > > used to rely on some broken behaviour of i2c-keywest that is gone now. > > I'm not sure, but from looking at the other i2c drivers I'd rather think > that the old behaviour of i2c-keywest was correct. There are only a few > that implement both I2C_SMBUS_BLOCK_DATA and I2C_SMBUS_I2C_BLOCK_DATA, but > none of them write the length byte together with the data. The commands > are ony different in behaviour when reading: with I2C_SMBUS_I2C_BLOCK_DATA > a fixed sized block is read from the bus, whereas with > I2C_SMBUS_BLOCK_DATA the size of the block is variable. At least that's > how i2c-nforce2, i2c-viapro and i2c-amd8111 implement the commands. They are probably all wrong :) Look at the fallback implementation of smbus using base i2c in i2c-core.c .. I also checked the smbus spec and indeed, an smbus block transfer has the lenght on the wire. Ben From benh at kernel.crashing.org Mon Jan 9 10:37:56 2006 From: benh at kernel.crashing.org (Benjamin Herrenschmidt) Date: Mon, 09 Jan 2006 10:37:56 +1100 Subject: [PATCH] powerpc: Fix PowerMac sound i2c In-Reply-To: <1136701380.30123.46.camel@localhost.localdomain> References: <1136695956.30123.44.camel@localhost.localdomain> <1136701380.30123.46.camel@localhost.localdomain> Message-ID: <1136763476.30123.98.camel@localhost.localdomain> Ok, here's another version that uses the proper wrapper in the i2c layer, that was removed but is coming back... Index: linux-work/sound/ppc/tumbler.c =================================================================== --- linux-work.orig/sound/ppc/tumbler.c 2006-01-09 10:29:54.000000000 +1100 +++ linux-work/sound/ppc/tumbler.c 2006-01-09 10:30:14.000000000 +1100 @@ -137,7 +137,6 @@ static int send_init_client(pmac_keywest return 0; } - static int tumbler_init_client(pmac_keywest_t *i2c) { static unsigned int regs[] = { @@ -239,8 +238,8 @@ static int tumbler_set_master_volume(pma block[4] = (right_vol >> 8) & 0xff; block[5] = (right_vol >> 0) & 0xff; - if (i2c_smbus_write_block_data(mix->i2c.client, TAS_REG_VOL, - 6, block) < 0) { + if (i2c_smbus_write_i2c_block_data(mix->i2c.client, TAS_REG_VOL, 6, + block) < 0) { snd_printk("failed to set volume \n"); return -EINVAL; } @@ -340,8 +339,8 @@ static int tumbler_set_drc(pmac_tumbler_ val[1] = 0; } - if (i2c_smbus_write_block_data(mix->i2c.client, TAS_REG_DRC, - 2, val) < 0) { + if (i2c_smbus_write_i2c_block_data(mix->i2c.client, TAS_REG_DRC, + 2, val) < 0) { snd_printk("failed to set DRC\n"); return -EINVAL; } @@ -376,8 +375,8 @@ static int snapper_set_drc(pmac_tumbler_ val[4] = 0x60; val[5] = 0xa0; - if (i2c_smbus_write_block_data(mix->i2c.client, TAS_REG_DRC, - 6, val) < 0) { + if (i2c_smbus_write_i2c_block_data(mix->i2c.client, TAS_REG_DRC, + 6, val) < 0) { snd_printk("failed to set DRC\n"); return -EINVAL; } @@ -481,8 +480,8 @@ static int tumbler_set_mono_volume(pmac_ vol = info->table[vol]; for (i = 0; i < info->bytes; i++) block[i] = (vol >> ((info->bytes - i - 1) * 8)) & 0xff; - if (i2c_smbus_write_block_data(mix->i2c.client, info->reg, - info->bytes, block) < 0) { + if (i2c_smbus_write_i2c_block_data(mix->i2c.client, info->reg, + info->bytes, block) < 0) { snd_printk("failed to set mono volume %d\n", info->index); return -EINVAL; } @@ -611,7 +610,8 @@ static int snapper_set_mix_vol1(pmac_tum for (j = 0; j < 3; j++) block[i * 3 + j] = (vol >> ((2 - j) * 8)) & 0xff; } - if (i2c_smbus_write_block_data(mix->i2c.client, reg, 9, block) < 0) { + if (i2c_smbus_write_i2c_block_data(mix->i2c.client, reg, + 9, block) < 0) { snd_printk("failed to set mono volume %d\n", reg); return -EINVAL; } Index: linux-work/sound/ppc/pmac.c =================================================================== --- linux-work.orig/sound/ppc/pmac.c 2006-01-09 10:29:54.000000000 +1100 +++ linux-work/sound/ppc/pmac.c 2006-01-09 10:30:14.000000000 +1100 @@ -74,7 +74,7 @@ static int snd_pmac_dbdma_alloc(pmac_t * static void snd_pmac_dbdma_free(pmac_t *chip, pmac_dbdma_t *rec) { - if (rec) { + if (rec->space) { unsigned int rsize = sizeof(struct dbdma_cmd) * (rec->size + 1); dma_free_coherent(&chip->pdev->dev, rsize, rec->space, rec->dma_base); @@ -895,6 +895,7 @@ static int __init snd_pmac_detect(pmac_t chip->can_capture = 1; chip->num_freqs = ARRAY_SIZE(awacs_freqs); chip->freq_table = awacs_freqs; + chip->pdev = NULL; chip->control_mask = MASK_IEPC | MASK_IEE | 0x11; /* default */ Index: linux-work/sound/oss/dmasound/tas_common.h =================================================================== --- linux-work.orig/sound/oss/dmasound/tas_common.h 2006-01-09 10:29:54.000000000 +1100 +++ linux-work/sound/oss/dmasound/tas_common.h 2006-01-09 10:31:09.000000000 +1100 @@ -178,10 +178,10 @@ tas_write_register( struct tas_data_t *s if (write_mode & WRITE_SHADOW) memcpy(self->shadow[reg_num],data,reg_width); if (write_mode & WRITE_HW) { - rc=i2c_smbus_write_block_data(self->client, - reg_num, - reg_width, - data); + rc=i2c_smbus_write_i2c_block_data(self->client, + reg_num, + reg_width, + data); if (rc < 0) { printk("tas: I2C block write failed \n"); return rc; @@ -199,10 +199,10 @@ tas_sync_register( struct tas_data_t *se if (reg_width==0 || self==NULL) return -EINVAL; - rc=i2c_smbus_write_block_data(self->client, - reg_num, - reg_width, - self->shadow[reg_num]); + rc=i2c_smbus_write_i2c_block_data(self->client, + reg_num, + reg_width, + self->shadow[reg_num]); if (rc < 0) { printk("tas: I2C block write failed \n"); return rc; From anton at samba.org Mon Jan 9 15:41:31 2006 From: anton at samba.org (Anton Blanchard) Date: Mon, 9 Jan 2006 15:41:31 +1100 Subject: [PATCH] ppc64: Fix oprofile when compiled as a module In-Reply-To: <20051229105131.GC18479@krispykreme> References: <20051229105131.GC18479@krispykreme> Message-ID: <20060109044131.GP26499@krispykreme> My recent changes to oprofile broke it when built as a module. Fix it by using an enum instead of a function pointer. This way we still retain the oprofile configuration in the cputable. Signed-off-by: Anton Blanchard --- updated for current powerpc git tree. Index: build/arch/powerpc/kernel/cputable.c =================================================================== --- build.orig/arch/powerpc/kernel/cputable.c 2006-01-09 13:31:50.000000000 +1100 +++ build/arch/powerpc/kernel/cputable.c 2006-01-09 14:27:19.000000000 +1100 @@ -78,10 +78,8 @@ .dcache_bsize = 128, .num_pmcs = 8, .cpu_setup = __setup_cpu_power3, -#ifdef CONFIG_OPROFILE .oprofile_cpu_type = "ppc64/power3", - .oprofile_model = &op_model_rs64, -#endif + .oprofile_type = RS64, }, { /* Power3+ */ .pvr_mask = 0xffff0000, @@ -93,10 +91,8 @@ .dcache_bsize = 128, .num_pmcs = 8, .cpu_setup = __setup_cpu_power3, -#ifdef CONFIG_OPROFILE .oprofile_cpu_type = "ppc64/power3", - .oprofile_model = &op_model_rs64, -#endif + .oprofile_type = RS64, }, { /* Northstar */ .pvr_mask = 0xffff0000, @@ -108,10 +104,8 @@ .dcache_bsize = 128, .num_pmcs = 8, .cpu_setup = __setup_cpu_power3, -#ifdef CONFIG_OPROFILE .oprofile_cpu_type = "ppc64/rs64", - .oprofile_model = &op_model_rs64, -#endif + .oprofile_type = RS64, }, { /* Pulsar */ .pvr_mask = 0xffff0000, @@ -123,10 +117,8 @@ .dcache_bsize = 128, .num_pmcs = 8, .cpu_setup = __setup_cpu_power3, -#ifdef CONFIG_OPROFILE .oprofile_cpu_type = "ppc64/rs64", - .oprofile_model = &op_model_rs64, -#endif + .oprofile_type = RS64, }, { /* I-star */ .pvr_mask = 0xffff0000, @@ -138,10 +130,8 @@ .dcache_bsize = 128, .num_pmcs = 8, .cpu_setup = __setup_cpu_power3, -#ifdef CONFIG_OPROFILE .oprofile_cpu_type = "ppc64/rs64", - .oprofile_model = &op_model_rs64, -#endif + .oprofile_type = RS64, }, { /* S-star */ .pvr_mask = 0xffff0000, @@ -153,10 +143,8 @@ .dcache_bsize = 128, .num_pmcs = 8, .cpu_setup = __setup_cpu_power3, -#ifdef CONFIG_OPROFILE .oprofile_cpu_type = "ppc64/rs64", - .oprofile_model = &op_model_rs64, -#endif + .oprofile_type = RS64, }, { /* Power4 */ .pvr_mask = 0xffff0000, @@ -168,10 +156,8 @@ .dcache_bsize = 128, .num_pmcs = 8, .cpu_setup = __setup_cpu_power4, -#ifdef CONFIG_OPROFILE .oprofile_cpu_type = "ppc64/power4", - .oprofile_model = &op_model_rs64, -#endif + .oprofile_type = POWER4, }, { /* Power4+ */ .pvr_mask = 0xffff0000, @@ -183,10 +169,8 @@ .dcache_bsize = 128, .num_pmcs = 8, .cpu_setup = __setup_cpu_power4, -#ifdef CONFIG_OPROFILE .oprofile_cpu_type = "ppc64/power4", - .oprofile_model = &op_model_power4, -#endif + .oprofile_type = POWER4, }, { /* PPC970 */ .pvr_mask = 0xffff0000, @@ -199,10 +183,8 @@ .dcache_bsize = 128, .num_pmcs = 8, .cpu_setup = __setup_cpu_ppc970, -#ifdef CONFIG_OPROFILE .oprofile_cpu_type = "ppc64/970", - .oprofile_model = &op_model_power4, -#endif + .oprofile_type = POWER4, }, #endif /* CONFIG_PPC64 */ #if defined(CONFIG_PPC64) || defined(CONFIG_POWER4) @@ -221,10 +203,8 @@ .dcache_bsize = 128, .num_pmcs = 8, .cpu_setup = __setup_cpu_ppc970, -#ifdef CONFIG_OPROFILE .oprofile_cpu_type = "ppc64/970", - .oprofile_model = &op_model_power4, -#endif + .oprofile_type = POWER4, }, #endif /* defined(CONFIG_PPC64) || defined(CONFIG_POWER4) */ #ifdef CONFIG_PPC64 @@ -238,10 +218,8 @@ .icache_bsize = 128, .dcache_bsize = 128, .cpu_setup = __setup_cpu_ppc970, -#ifdef CONFIG_OPROFILE .oprofile_cpu_type = "ppc64/970", - .oprofile_model = &op_model_power4, -#endif + .oprofile_type = POWER4, }, { /* Power5 GR */ .pvr_mask = 0xffff0000, @@ -253,10 +231,8 @@ .dcache_bsize = 128, .num_pmcs = 6, .cpu_setup = __setup_cpu_power4, -#ifdef CONFIG_OPROFILE .oprofile_cpu_type = "ppc64/power5", - .oprofile_model = &op_model_power4, -#endif + .oprofile_type = POWER4, }, { /* Power5 GS */ .pvr_mask = 0xffff0000, @@ -268,10 +244,8 @@ .dcache_bsize = 128, .num_pmcs = 6, .cpu_setup = __setup_cpu_power4, -#ifdef CONFIG_OPROFILE .oprofile_cpu_type = "ppc64/power5", - .oprofile_model = &op_model_power4, -#endif + .oprofile_type = POWER4, }, { /* BE DD1.x */ .pvr_mask = 0xffff0000, @@ -546,10 +520,8 @@ .dcache_bsize = 32, .num_pmcs = 6, .cpu_setup = __setup_cpu_745x, -#ifdef CONFIG_OPROFILE .oprofile_cpu_type = "ppc/7450", - .oprofile_model = &op_model_7450, -#endif + .oprofile_type = G4, }, { /* 7450 2.1 */ .pvr_mask = 0xffffffff, @@ -561,10 +533,8 @@ .dcache_bsize = 32, .num_pmcs = 6, .cpu_setup = __setup_cpu_745x, -#ifdef CONFIG_OPROFILE .oprofile_cpu_type = "ppc/7450", - .oprofile_model = &op_model_7450, -#endif + .oprofile_type = G4, }, { /* 7450 2.3 and newer */ .pvr_mask = 0xffff0000, @@ -576,10 +546,8 @@ .dcache_bsize = 32, .num_pmcs = 6, .cpu_setup = __setup_cpu_745x, -#ifdef CONFIG_OPROFILE .oprofile_cpu_type = "ppc/7450", - .oprofile_model = &op_model_7450, -#endif + .oprofile_type = G4, }, { /* 7455 rev 1.x */ .pvr_mask = 0xffffff00, @@ -591,10 +559,8 @@ .dcache_bsize = 32, .num_pmcs = 6, .cpu_setup = __setup_cpu_745x, -#ifdef CONFIG_OPROFILE .oprofile_cpu_type = "ppc/7450", - .oprofile_model = &op_model_7450, -#endif + .oprofile_type = G4, }, { /* 7455 rev 2.0 */ .pvr_mask = 0xffffffff, @@ -606,10 +572,8 @@ .dcache_bsize = 32, .num_pmcs = 6, .cpu_setup = __setup_cpu_745x, -#ifdef CONFIG_OPROFILE .oprofile_cpu_type = "ppc/7450", - .oprofile_model = &op_model_7450, -#endif + .oprofile_type = G4, }, { /* 7455 others */ .pvr_mask = 0xffff0000, @@ -621,10 +585,8 @@ .dcache_bsize = 32, .num_pmcs = 6, .cpu_setup = __setup_cpu_745x, -#ifdef CONFIG_OPROFILE .oprofile_cpu_type = "ppc/7450", - .oprofile_model = &op_model_7450, -#endif + .oprofile_type = G4, }, { /* 7447/7457 Rev 1.0 */ .pvr_mask = 0xffffffff, @@ -636,10 +598,8 @@ .dcache_bsize = 32, .num_pmcs = 6, .cpu_setup = __setup_cpu_745x, -#ifdef CONFIG_OPROFILE .oprofile_cpu_type = "ppc/7450", - .oprofile_model = &op_model_7450, -#endif + .oprofile_type = G4, }, { /* 7447/7457 Rev 1.1 */ .pvr_mask = 0xffffffff, @@ -651,10 +611,8 @@ .dcache_bsize = 32, .num_pmcs = 6, .cpu_setup = __setup_cpu_745x, -#ifdef CONFIG_OPROFILE .oprofile_cpu_type = "ppc/7450", - .oprofile_model = &op_model_7450, -#endif + .oprofile_type = G4, }, { /* 7447/7457 Rev 1.2 and later */ .pvr_mask = 0xffff0000, @@ -666,10 +624,8 @@ .dcache_bsize = 32, .num_pmcs = 6, .cpu_setup = __setup_cpu_745x, -#ifdef CONFIG_OPROFILE .oprofile_cpu_type = "ppc/7450", - .oprofile_model = &op_model_7450, -#endif + .oprofile_type = G4, }, { /* 7447A */ .pvr_mask = 0xffff0000, @@ -681,10 +637,8 @@ .dcache_bsize = 32, .num_pmcs = 6, .cpu_setup = __setup_cpu_745x, -#ifdef CONFIG_OPROFILE .oprofile_cpu_type = "ppc/7450", - .oprofile_model = &op_model_7450, -#endif + .oprofile_type = G4, }, { /* 7448 */ .pvr_mask = 0xffff0000, @@ -696,10 +650,8 @@ .dcache_bsize = 32, .num_pmcs = 6, .cpu_setup = __setup_cpu_745x, -#ifdef CONFIG_OPROFILE .oprofile_cpu_type = "ppc/7450", - .oprofile_model = &op_model_7450, -#endif + .oprofile_type = G4, }, { /* 82xx (8240, 8245, 8260 are all 603e cores) */ .pvr_mask = 0x7fff0000, @@ -1023,10 +975,8 @@ .icache_bsize = 32, .dcache_bsize = 32, .num_pmcs = 4, -#ifdef CONFIG_OPROFILE .oprofile_cpu_type = "ppc/e500", - .oprofile_model = &op_model_fsl_booke, -#endif + .oprofile_type = BOOKE, }, { /* e500v2 */ .pvr_mask = 0xffff0000, @@ -1040,10 +990,8 @@ .icache_bsize = 32, .dcache_bsize = 32, .num_pmcs = 4, -#ifdef CONFIG_OPROFILE .oprofile_cpu_type = "ppc/e500", - .oprofile_model = &op_model_fsl_booke, -#endif + .oprofile_type = BOOKE, }, #endif #if !CLASSIC_PPC Index: build/arch/powerpc/oprofile/common.c =================================================================== --- build.orig/arch/powerpc/oprofile/common.c 2006-01-09 13:31:50.000000000 +1100 +++ build/arch/powerpc/oprofile/common.c 2006-01-09 14:30:47.000000000 +1100 @@ -135,9 +135,31 @@ int __init oprofile_arch_init(struct oprofile_operations *ops) { - if (!cur_cpu_spec->oprofile_model || !cur_cpu_spec->oprofile_cpu_type) + if (!cur_cpu_spec->oprofile_cpu_type) return -ENODEV; - model = cur_cpu_spec->oprofile_model; + + switch (cur_cpu_spec->oprofile_type) { +#ifdef CONFIG_PPC64 + case RS64: + model = &op_model_rs64; + break; + case POWER4: + model = &op_model_power4; + break; +#else + case G4: + model = &op_model_7450; + break; +#endif +#ifdef CONFIG_FSL_BOOKE + case BOOKE: + model = &op_model_fsl_booke; + break; +#endif + default: + return -ENODEV; + } + model->num_counters = cur_cpu_spec->num_pmcs; ops->cpu_type = cur_cpu_spec->oprofile_cpu_type; Index: build/include/asm-powerpc/cputable.h =================================================================== --- build.orig/include/asm-powerpc/cputable.h 2006-01-09 13:31:51.000000000 +1100 +++ build/include/asm-powerpc/cputable.h 2006-01-09 14:29:50.000000000 +1100 @@ -27,10 +27,17 @@ * via the mkdefs mechanism. */ struct cpu_spec; -struct op_powerpc_model; typedef void (*cpu_setup_t)(unsigned long offset, struct cpu_spec* spec); +enum powerpc_oprofile_type { + INVALID = 0, + RS64 = 1, + POWER4 = 2, + G4 = 3, + BOOKE = 4, +}; + struct cpu_spec { /* CPU is matched via (PVR & pvr_mask) == pvr_value */ unsigned int pvr_mask; @@ -56,7 +63,7 @@ char *oprofile_cpu_type; /* Processor specific oprofile operations */ - struct op_powerpc_model *oprofile_model; + enum powerpc_oprofile_type oprofile_type; }; extern struct cpu_spec *cur_cpu_spec; From anton at samba.org Mon Jan 9 15:42:30 2006 From: anton at samba.org (Anton Blanchard) Date: Mon, 9 Jan 2006 15:42:30 +1100 Subject: [PATCH] ppc64: POWER5+ oprofile support In-Reply-To: <20051229110911.GD18479@krispykreme> References: <20051229110911.GD18479@krispykreme> Message-ID: <20060109044230.GQ26499@krispykreme> POWER5+ adds new PMU groups and as such needs to be treated differently by oprofile userspace. Change it to report itself as power5+. Signed-off-by: Anton Blanchard --- updated for current powerpc git tree. Index: build/arch/powerpc/kernel/cputable.c =================================================================== --- build.orig/arch/powerpc/kernel/cputable.c 2006-01-09 14:27:19.000000000 +1100 +++ build/arch/powerpc/kernel/cputable.c 2006-01-09 14:32:12.000000000 +1100 @@ -237,14 +237,14 @@ { /* Power5 GS */ .pvr_mask = 0xffff0000, .pvr_value = 0x003b0000, - .cpu_name = "POWER5 (gs)", + .cpu_name = "POWER5+ (gs)", .cpu_features = CPU_FTRS_POWER5, .cpu_user_features = COMMON_USER_POWER5_PLUS, .icache_bsize = 128, .dcache_bsize = 128, .num_pmcs = 6, .cpu_setup = __setup_cpu_power4, - .oprofile_cpu_type = "ppc64/power5", + .oprofile_cpu_type = "ppc64/power5+", .oprofile_type = POWER4, }, { /* BE DD1.x */ From michael at ellerman.id.au Mon Jan 9 18:19:49 2006 From: michael at ellerman.id.au (Michael Ellerman) Date: Mon, 09 Jan 2006 18:19:49 +1100 Subject: [PATCH] powerpc: Don't use KERNELBASE in add_memory() Message-ID: <20060109072001.7B47A689DE@ozlabs.org> In add_memory() we should be using __va() to get a virtual address. Spotted by Mike Kravetz. Signed-off-by: Michael Ellerman --- arch/powerpc/mm/mem.c | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: linux/arch/powerpc/mm/mem.c =================================================================== --- linux.orig/arch/powerpc/mm/mem.c +++ linux/arch/powerpc/mm/mem.c @@ -125,7 +125,7 @@ int __devinit add_memory(u64 start, u64 nid = hot_add_scn_to_nid(start); pgdata = NODE_DATA(nid); - start += KERNELBASE; + start = __va(start); create_section_mapping(start, start + size); /* this should work for most non-highmem platforms */ From paulus at samba.org Mon Jan 9 22:08:02 2006 From: paulus at samba.org (Paul Mackerras) Date: Mon, 9 Jan 2006 22:08:02 +1100 Subject: please pull powerpc-merge.git Message-ID: <17346.17426.677698.569267@cargo.ozlabs.ibm.com> Linus, Please pull git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc-merge.git This has most of the changes that have been accumulating in the powerpc.git tree. I have left out a series of changes relating to PCI error recovery because they depend on a change to include/linux/pci.h that Greg KH is (hopefully) going to send to you shortly. Once you have that change I'll send you the remaining changes. Thanks, Paul. Documentation/filesystems/spufs.txt | 521 +++++ Documentation/powerpc/00-INDEX | 10 arch/powerpc/Kconfig | 30 arch/powerpc/Makefile | 2 arch/powerpc/boot/Makefile | 30 arch/powerpc/configs/pmac32_defconfig | 1729 ++++++++++++++++ arch/powerpc/kernel/Makefile | 22 arch/powerpc/kernel/asm-offsets.c | 6 arch/powerpc/kernel/btext.c | 138 + arch/powerpc/kernel/cputable.c | 106 - arch/powerpc/kernel/crash.c | 264 ++ arch/powerpc/kernel/crash_dump.c | 109 + arch/powerpc/kernel/dma_64.c | 9 arch/powerpc/kernel/entry_32.S | 167 +- arch/powerpc/kernel/entry_64.S | 218 +- arch/powerpc/kernel/head_32.S | 56 - arch/powerpc/kernel/head_64.S | 41 arch/powerpc/kernel/ibmebus.c | 396 ++++ arch/powerpc/kernel/irq.c | 81 - arch/powerpc/kernel/legacy_serial.c | 557 +++++ arch/powerpc/kernel/lparmap.c | 12 arch/powerpc/kernel/machine_kexec.c | 67 + arch/powerpc/kernel/machine_kexec_32.c | 65 + arch/powerpc/kernel/machine_kexec_64.c | 43 arch/powerpc/kernel/misc_32.S | 113 + arch/powerpc/kernel/nvram_64.c | 114 - arch/powerpc/kernel/paca.c | 11 arch/powerpc/kernel/pci_64.c | 87 + arch/powerpc/kernel/pmc.c | 5 arch/powerpc/kernel/ppc_ksyms.c | 5 arch/powerpc/kernel/prom.c | 468 ---- arch/powerpc/kernel/prom_init.c | 60 + arch/powerpc/kernel/prom_parse.c | 547 +++++ arch/powerpc/kernel/rtas_pci.c | 49 arch/powerpc/kernel/setup-common.c | 129 - arch/powerpc/kernel/setup_32.c | 34 arch/powerpc/kernel/setup_64.c | 207 -- arch/powerpc/kernel/signal_32.c | 68 - arch/powerpc/kernel/signal_64.c | 23 arch/powerpc/kernel/smp.c | 29 arch/powerpc/kernel/syscalls.c | 28 arch/powerpc/kernel/systbl.S | 14 arch/powerpc/kernel/time.c | 4 arch/powerpc/kernel/traps.c | 25 arch/powerpc/kernel/udbg.c | 27 arch/powerpc/kernel/udbg_16550.c | 69 + arch/powerpc/kernel/udbg_scc.c | 135 - arch/powerpc/mm/fault.c | 7 arch/powerpc/mm/hash_utils_64.c | 7 arch/powerpc/mm/hugetlbpage.c | 42 arch/powerpc/mm/imalloc.c | 2 arch/powerpc/mm/init_32.c | 5 arch/powerpc/mm/mem.c | 13 arch/powerpc/mm/numa.c | 139 + arch/powerpc/mm/slb.c | 16 arch/powerpc/mm/slb_low.S | 6 arch/powerpc/mm/stab.c | 16 arch/powerpc/mm/tlb_64.c | 2 arch/powerpc/oprofile/Makefile | 1 arch/powerpc/oprofile/common.c | 83 - arch/powerpc/oprofile/op_model_7450.c | 206 ++ arch/powerpc/oprofile/op_model_power4.c | 4 arch/powerpc/oprofile/op_model_rs64.c | 3 arch/powerpc/platforms/cell/Kconfig | 13 arch/powerpc/platforms/cell/Makefile | 8 arch/powerpc/platforms/cell/interrupt.c | 42 arch/powerpc/platforms/cell/interrupt.h | 1 arch/powerpc/platforms/cell/iommu.c | 225 ++ arch/powerpc/platforms/cell/pervasive.c | 229 ++ arch/powerpc/platforms/cell/pervasive.h | 62 + arch/powerpc/platforms/cell/setup.c | 93 + arch/powerpc/platforms/cell/spu_base.c | 711 +++++++ arch/powerpc/platforms/cell/spu_priv1.c | 133 + arch/powerpc/platforms/cell/spu_syscalls.c | 88 + arch/powerpc/platforms/cell/spufs/Makefile | 54 arch/powerpc/platforms/cell/spufs/backing_ops.c | 308 +++ arch/powerpc/platforms/cell/spufs/context.c | 167 ++ arch/powerpc/platforms/cell/spufs/file.c | 794 +++++++ arch/powerpc/platforms/cell/spufs/hw_ops.c | 255 ++ arch/powerpc/platforms/cell/spufs/inode.c | 486 ++++ arch/powerpc/platforms/cell/spufs/run.c | 131 + arch/powerpc/platforms/cell/spufs/sched.c | 461 ++++ arch/powerpc/platforms/cell/spufs/spu_restore.c | 336 +++ .../platforms/cell/spufs/spu_restore_crt0.S | 116 + .../cell/spufs/spu_restore_dump.h_shipped | 231 ++ arch/powerpc/platforms/cell/spufs/spu_save.c | 195 ++ arch/powerpc/platforms/cell/spufs/spu_save_crt0.S | 102 + .../platforms/cell/spufs/spu_save_dump.h_shipped | 191 ++ arch/powerpc/platforms/cell/spufs/spu_utils.h | 160 + arch/powerpc/platforms/cell/spufs/spufs.h | 163 + arch/powerpc/platforms/cell/spufs/switch.c | 2180 ++++++++++++++++++++ arch/powerpc/platforms/cell/spufs/syscalls.c | 101 + arch/powerpc/platforms/chrp/setup.c | 16 arch/powerpc/platforms/iseries/irq.c | 335 ++- arch/powerpc/platforms/iseries/irq.h | 1 arch/powerpc/platforms/iseries/lpardata.c | 7 arch/powerpc/platforms/iseries/setup.c | 10 arch/powerpc/platforms/maple/setup.c | 24 arch/powerpc/platforms/powermac/Makefile | 7 arch/powerpc/platforms/powermac/bootx_init.c | 547 +++++ arch/powerpc/platforms/powermac/cpufreq_64.c | 496 ++++- arch/powerpc/platforms/powermac/feature.c | 363 +-- arch/powerpc/platforms/powermac/low_i2c.c | 1414 +++++++++++-- arch/powerpc/platforms/powermac/nvram.c | 53 arch/powerpc/platforms/powermac/pci.c | 299 ++- arch/powerpc/platforms/powermac/pfunc_base.c | 405 ++++ arch/powerpc/platforms/powermac/pfunc_core.c | 989 +++++++++ arch/powerpc/platforms/powermac/pic.c | 474 ++-- arch/powerpc/platforms/powermac/pmac.h | 6 arch/powerpc/platforms/powermac/setup.c | 105 - arch/powerpc/platforms/powermac/smp.c | 382 ++-- arch/powerpc/platforms/powermac/time.c | 15 arch/powerpc/platforms/powermac/udbg_adb.c | 221 ++ arch/powerpc/platforms/powermac/udbg_scc.c | 165 ++ arch/powerpc/platforms/pseries/Makefile | 2 arch/powerpc/platforms/pseries/eeh.c | 26 arch/powerpc/platforms/pseries/iommu.c | 12 arch/powerpc/platforms/pseries/lpar.c | 76 - arch/powerpc/platforms/pseries/pci_dlpar.c | 174 ++ arch/powerpc/platforms/pseries/ras.c | 11 arch/powerpc/platforms/pseries/ras.h | 9 arch/powerpc/platforms/pseries/setup.c | 55 - arch/powerpc/platforms/pseries/xics.c | 2 arch/powerpc/sysdev/Makefile | 3 arch/powerpc/sysdev/dart.h | 41 arch/powerpc/sysdev/dart_iommu.c | 173 +- arch/powerpc/sysdev/ipic.c | 0 arch/powerpc/sysdev/ipic.h | 0 arch/powerpc/sysdev/mpic.c | 247 ++ arch/powerpc/xmon/Makefile | 8 arch/powerpc/xmon/start.c | 0 arch/powerpc/xmon/start_32.c | 441 ---- arch/powerpc/xmon/start_8xx.c | 44 arch/powerpc/xmon/xmon.c | 8 arch/ppc/boot/common/util.S | 6 arch/ppc/boot/images/Makefile | 2 arch/ppc/configs/TQM8540_defconfig | 973 +++++++++ arch/ppc/configs/TQM8541_defconfig | 986 +++++++++ arch/ppc/configs/TQM8555_defconfig | 983 +++++++++ arch/ppc/configs/TQM8560_defconfig | 992 +++++++++ arch/ppc/kernel/Makefile | 1 arch/ppc/kernel/asm-offsets.c | 2 arch/ppc/kernel/entry.S | 167 +- arch/ppc/kernel/misc.S | 6 arch/ppc/kernel/pci.c | 28 arch/ppc/kernel/ppc_ksyms.c | 5 arch/ppc/kernel/setup.c | 3 arch/ppc/platforms/85xx/Kconfig | 28 arch/ppc/platforms/85xx/Makefile | 4 arch/ppc/platforms/85xx/tqm85xx.c | 419 ++++ arch/ppc/platforms/85xx/tqm85xx.h | 56 + arch/ppc/platforms/chrp_setup.c | 1 arch/ppc/platforms/prep_setup.c | 2 arch/ppc/syslib/Makefile | 2 arch/ppc/syslib/m8xx_setup.c | 15 arch/ppc/syslib/m8xx_wdt.c | 92 + arch/ppc/syslib/m8xx_wdt.h | 4 drivers/block/swim3.c | 38 drivers/char/watchdog/mpc8xx_wdt.c | 20 drivers/i2c/busses/Kconfig | 24 drivers/i2c/busses/Makefile | 3 drivers/i2c/busses/i2c-keywest.c | 751 ------- drivers/i2c/busses/i2c-keywest.h | 108 - drivers/i2c/busses/i2c-pmac-smu.c | 315 --- drivers/i2c/busses/i2c-powermac.c | 290 +++ drivers/ide/ppc/pmac.c | 6 drivers/macintosh/Kconfig | 10 drivers/macintosh/macio_asic.c | 254 +- drivers/macintosh/mediabay.c | 8 drivers/macintosh/smu.c | 50 drivers/macintosh/via-cuda.c | 52 drivers/macintosh/via-pmu.c | 364 +-- drivers/macintosh/windfarm_lm75_sensor.c | 50 drivers/scsi/mac53c94.c | 22 drivers/scsi/mesh.c | 3 drivers/serial/cpm_uart/cpm_uart_core.c | 2 drivers/serial/pmac_zilog.c | 15 drivers/video/controlfb.c | 114 - drivers/video/offb.c | 122 + drivers/video/platinumfb.c | 98 - drivers/video/platinumfb.h | 4 drivers/video/valkyriefb.c | 12 include/asm-powerpc/abs_addr.h | 2 include/asm-powerpc/agp.h | 2 include/asm-powerpc/asm-compat.h | 3 include/asm-powerpc/bootx.h | 171 ++ include/asm-powerpc/btext.h | 19 include/asm-powerpc/bug.h | 2 include/asm-powerpc/checksum.h | 2 include/asm-powerpc/compat.h | 2 include/asm-powerpc/cputable.h | 36 include/asm-powerpc/current.h | 2 include/asm-powerpc/delay.h | 2 include/asm-powerpc/dma-mapping.h | 2 include/asm-powerpc/dma.h | 2 include/asm-powerpc/eeh.h | 15 include/asm-powerpc/eeh_event.h | 2 include/asm-powerpc/elf.h | 3 include/asm-powerpc/firmware.h | 6 include/asm-powerpc/floppy.h | 2 include/asm-powerpc/grackle.h | 5 include/asm-powerpc/hardirq.h | 2 include/asm-powerpc/heathrow.h | 5 include/asm-powerpc/hvcall.h | 2 include/asm-powerpc/hvconsole.h | 2 include/asm-powerpc/hvcserver.h | 2 include/asm-powerpc/i8259.h | 2 include/asm-powerpc/ibmebus.h | 85 + include/asm-powerpc/io.h | 6 include/asm-powerpc/iommu.h | 8 include/asm-powerpc/ipic.h | 0 include/asm-powerpc/iseries/it_lp_reg_save.h | 2 include/asm-powerpc/kdebug.h | 2 include/asm-powerpc/kdump.h | 13 include/asm-powerpc/kexec.h | 19 include/asm-powerpc/keylargo.h | 15 include/asm-powerpc/kprobes.h | 2 include/asm-powerpc/lmb.h | 2 include/asm-powerpc/lppaca.h | 2 include/asm-powerpc/machdep.h | 12 include/asm-powerpc/macio.h | 2 include/asm-powerpc/mmu.h | 9 include/asm-powerpc/mmu_context.h | 2 include/asm-powerpc/mmzone.h | 2 include/asm-powerpc/module.h | 2 include/asm-powerpc/mpic.h | 6 include/asm-powerpc/numnodes.h | 2 include/asm-powerpc/nvram.h | 4 include/asm-powerpc/of_device.h | 2 include/asm-powerpc/ohare.h | 6 include/asm-powerpc/oprofile_impl.h | 33 include/asm-powerpc/pSeries_reconfig.h | 2 include/asm-powerpc/paca.h | 21 include/asm-powerpc/page.h | 32 include/asm-powerpc/page_32.h | 2 include/asm-powerpc/page_64.h | 12 include/asm-powerpc/param.h | 2 include/asm-powerpc/parport.h | 2 include/asm-powerpc/pci-bridge.h | 24 include/asm-powerpc/pci.h | 2 include/asm-powerpc/pgalloc.h | 2 include/asm-powerpc/pgtable-64k.h | 6 include/asm-powerpc/pgtable.h | 13 include/asm-powerpc/pmac_feature.h | 25 include/asm-powerpc/pmac_low_i2c.h | 94 + include/asm-powerpc/pmac_pfunc.h | 253 ++ include/asm-powerpc/pmc.h | 2 include/asm-powerpc/ppc-pci.h | 2 include/asm-powerpc/ppc_asm.h | 3 include/asm-powerpc/processor.h | 5 include/asm-powerpc/prom.h | 71 - include/asm-powerpc/ptrace.h | 2 include/asm-powerpc/reg.h | 58 - include/asm-powerpc/rtas.h | 2 include/asm-powerpc/seccomp.h | 4 include/asm-powerpc/sections.h | 2 include/asm-powerpc/serial.h | 2 include/asm-powerpc/signal.h | 7 include/asm-powerpc/smu.h | 34 include/asm-powerpc/sparsemem.h | 10 include/asm-powerpc/spinlock.h | 2 include/asm-powerpc/spu.h | 600 ++++++ include/asm-powerpc/spu_csa.h | 255 ++ include/asm-powerpc/synch.h | 4 include/asm-powerpc/system.h | 3 include/asm-powerpc/tce.h | 2 include/asm-powerpc/thread_info.h | 12 include/asm-powerpc/tlb.h | 2 include/asm-powerpc/topology.h | 6 include/asm-powerpc/udbg.h | 17 include/asm-powerpc/unistd.h | 4 include/asm-powerpc/vdso_datapage.h | 2 include/asm-powerpc/vio.h | 2 include/asm-ppc/bseip.h | 38 include/asm-ppc/btext.h | 2 include/asm-ppc/machdep.h | 4 include/asm-ppc/mpc85xx.h | 4 include/asm-ppc/pci-bridge.h | 9 include/asm-ppc/prom.h | 32 include/linux/pci_regs.h | 1 include/linux/pmu.h | 8 include/linux/syscalls.h | 5 kernel/crash_dump.c | 3 kernel/sys_ni.c | 2 mm/memory.c | 2 sound/oss/dmasound/dmasound_awacs.c | 81 - sound/ppc/pmac.c | 100 + sound/ppc/pmac.h | 3 288 files changed, 27137 insertions(+), 5993 deletions(-) create mode 100644 Documentation/filesystems/spufs.txt create mode 100644 arch/powerpc/configs/pmac32_defconfig create mode 100644 arch/powerpc/kernel/crash.c create mode 100644 arch/powerpc/kernel/crash_dump.c create mode 100644 arch/powerpc/kernel/ibmebus.c create mode 100644 arch/powerpc/kernel/legacy_serial.c create mode 100644 arch/powerpc/kernel/machine_kexec.c create mode 100644 arch/powerpc/kernel/machine_kexec_32.c create mode 100644 arch/powerpc/kernel/prom_parse.c delete mode 100644 arch/powerpc/kernel/udbg_scc.c create mode 100644 arch/powerpc/oprofile/op_model_7450.c create mode 100644 arch/powerpc/platforms/cell/Kconfig create mode 100644 arch/powerpc/platforms/cell/pervasive.c create mode 100644 arch/powerpc/platforms/cell/pervasive.h create mode 100644 arch/powerpc/platforms/cell/spu_base.c create mode 100644 arch/powerpc/platforms/cell/spu_priv1.c create mode 100644 arch/powerpc/platforms/cell/spu_syscalls.c create mode 100644 arch/powerpc/platforms/cell/spufs/Makefile create mode 100644 arch/powerpc/platforms/cell/spufs/backing_ops.c create mode 100644 arch/powerpc/platforms/cell/spufs/context.c create mode 100644 arch/powerpc/platforms/cell/spufs/file.c create mode 100644 arch/powerpc/platforms/cell/spufs/hw_ops.c create mode 100644 arch/powerpc/platforms/cell/spufs/inode.c create mode 100644 arch/powerpc/platforms/cell/spufs/run.c create mode 100644 arch/powerpc/platforms/cell/spufs/sched.c create mode 100644 arch/powerpc/platforms/cell/spufs/spu_restore.c create mode 100644 arch/powerpc/platforms/cell/spufs/spu_restore_crt0.S create mode 100644 arch/powerpc/platforms/cell/spufs/spu_restore_dump.h_shipped create mode 100644 arch/powerpc/platforms/cell/spufs/spu_save.c create mode 100644 arch/powerpc/platforms/cell/spufs/spu_save_crt0.S create mode 100644 arch/powerpc/platforms/cell/spufs/spu_save_dump.h_shipped create mode 100644 arch/powerpc/platforms/cell/spufs/spu_utils.h create mode 100644 arch/powerpc/platforms/cell/spufs/spufs.h create mode 100644 arch/powerpc/platforms/cell/spufs/switch.c create mode 100644 arch/powerpc/platforms/cell/spufs/syscalls.c create mode 100644 arch/powerpc/platforms/powermac/bootx_init.c create mode 100644 arch/powerpc/platforms/powermac/pfunc_base.c create mode 100644 arch/powerpc/platforms/powermac/pfunc_core.c create mode 100644 arch/powerpc/platforms/powermac/udbg_adb.c create mode 100644 arch/powerpc/platforms/powermac/udbg_scc.c create mode 100644 arch/powerpc/platforms/pseries/pci_dlpar.c create mode 100644 arch/powerpc/platforms/pseries/ras.h rename arch/powerpc/sysdev/{u3_iommu.c => dart_iommu.c} (64%) rename arch/{ppc/syslib/ipic.c => powerpc/sysdev/ipic.c} (100%) rename arch/{ppc/syslib/ipic.h => powerpc/sysdev/ipic.h} (100%) rename arch/powerpc/xmon/{start_64.c => start.c} (100%) delete mode 100644 arch/powerpc/xmon/start_32.c delete mode 100644 arch/powerpc/xmon/start_8xx.c create mode 100644 arch/ppc/configs/TQM8540_defconfig create mode 100644 arch/ppc/configs/TQM8541_defconfig create mode 100644 arch/ppc/configs/TQM8555_defconfig create mode 100644 arch/ppc/configs/TQM8560_defconfig create mode 100644 arch/ppc/platforms/85xx/tqm85xx.c create mode 100644 arch/ppc/platforms/85xx/tqm85xx.h delete mode 100644 drivers/i2c/busses/i2c-keywest.c delete mode 100644 drivers/i2c/busses/i2c-keywest.h delete mode 100644 drivers/i2c/busses/i2c-pmac-smu.c create mode 100644 drivers/i2c/busses/i2c-powermac.c create mode 100644 include/asm-powerpc/bootx.h create mode 100644 include/asm-powerpc/ibmebus.h rename include/{asm-ppc/ipic.h => asm-powerpc/ipic.h} (100%) create mode 100644 include/asm-powerpc/kdump.h create mode 100644 include/asm-powerpc/pmac_pfunc.h create mode 100644 include/asm-powerpc/spu.h create mode 100644 include/asm-powerpc/spu_csa.h delete mode 100644 include/asm-ppc/bseip.h Adrian Bunk: PPC_PREP: remove unneeded exports Andy Fleming: powerpc: G4+ oprofile support Andy Whitcroft: powerpc: powermac adb fix dependency on btext_drawchar powerpc: powermac adb fix udbg_adb_use_btext warning powerpc32: clean up available memory models powerpc32: fix definition of distribute_irqs Anton Blanchard: ppc64: Add NUMA cpu summary at boot powerpc: Dont set 32bit cputable bits on 64bit powerpc: Remove old comment in head.S ppc64: fix time syscall ppc64: Fix oprofile when compiled as a module ppc64: POWER5+ oprofile support powerpc: DABR exceptions should report the address not the PC Aristeu Sergio Rozanski Filho: ppc32: cpm_uart: fix xchar sending Arnd Bergmann: spufs: The SPU file system, base spufs: cooperative scheduler support spufs: Make all exports GPL-only spufs: fix local store page refcounting spufs: Fix oops when spufs module is not loaded spufs: Turn off debugging output spufs: Improved SPU preemptability. spufs: Improved SPU preemptability [part 2]. spufs: fix mailbox polling cell: add platform detection code spufs: fix module refcount race spufs: trivial compile fix spufs: fix hexdump format spufs: clear dsisr on CLASS1[Mf] exception powerpc: fix large nvram access powerpc: sanitize header files for user space includes powerpc: fix two build warnings cell: enable pause(0) in cpu_idle spufs: fix locking in spu_acquire_runnable spufs: dont hold root->isem in spu_forget spufs: check for proper file pointer in sys_spu_run spufs: serialize sys_spu_run per spu spufs fix spu_acquire_runnable error path spufs: dont leak directories in failed spu_create spufs: fix spufs_fill_dir error path spufs: clean up use of bitops spufs: move spu_run call to its own file spufs: abstract priv1 register access. spufs: fix sparse warnings spufs: fix allocation on 64k pages spufs: set irq affinity for running threads Benjamin Herrenschmidt: powerpc: Add OF address parsing code (#2) powerpc: serial port discovery (#2) powerpc: Unify udbg (#2) powerpc: Add back support for booting from BootX (#2) powerpc: convert macio_asic to use prom_parse powerpc: Fix g5 build with xmon powerpc: More serial probe fixes (#2) powerpc: udbg updates powerpc: Update OF address parsers powerpc: Add pmac32 defconfig for ARCH=powerpc powerpc: Fix platinumfb for some modes powerpc: Remove device_node addrs/n_addr powerpc: Experimental support for new G5 Macs (#2) powerpc: Fix g5 DART init powerpc: pci_address_to_pio fix 1/5 powerpc: Rework PowerMac i2c part 1 2/5 powerpc: Rework PowerMac i2c part 2 3/5 powerpc: Add platform functions interpreter 4/5 powerpc: Add cpufreq support for all desktop G5 David Gibson: powerpc: Make hugepage mappings respect hint addresses powerpc: Remove ItLpRegSave area from the paca powerpc: Remove some unneeded fields from the paca powerpc: Replace VMALLOCBASE with VMALLOC_START powerpc: Fix iSeries bug in VMALLOCBASE/VMALLOC_START consolidation David Woodhouse: syscall entry/exit revamp ppc64 syscall_exit_work: call the save_nvgprs function, not its descriptor. powerpc: serial port discovery: cope with broken firmware Save NVGPRS in 32-bit signal frame Fix code that saves NVGPRS in 32-bit signal frame ppc: Make ARCH=ppc build again with new syscall path powerpc/cell: disable legacy i/o area Haren Myneni: powerpc: Fix search for the main interrupt controller Small fix in eeh definitions when CONFIG_EEH not enabled Heiko J Schick: powerpc: IBMEBUS bus support Jens.Osterkamp at de.ibm.com: powerpc/cell: add iommu support for larger memory Kristian Mueller: via-pmu: compile without Power Management support Kumar Gala: powerpc: moved ipic code to arch/powerpc powerpc: Add support for building uImages powerpc: Fix suboptimal uImage target ppc32: Add TQM85xx (8540/8541/8555/8560) board support powerpc: Detect prefetchable windows in pci_process_bridge_OF_ranges powerpc: Fix compile problem in pci.c for ppc32 powerpc: Loosen udbg_probe_uart_speed sanity checking powerpc: Add the ability to handle SOC ports in legacy_serial powerpc: added a udbg_progress powerpc: Call find_legacy_serial_ports() if we enable CONFIG_SERIAL_8250 powerpc: fixing compile issue with !CONFIG_PCI in legacy_serial.c linas: powerpc: minor cleanup of void ptr deref powerpc: export PCI fixup routine Linas Vepstas: powerpc: PCI hotplug common code elimination powerpc: make pcibios_claim_one_bus available to other code powerpc: migrate common PCI hotplug code Marcelo Tosatti: ppc32: m8xx watchdog update powerpc/8xx: Fix m8xx_wdt issues Mark Nutter: spufs: switchable spu contexts kernel-side context switch code for spufs spufs: add spu-side context switch code Michael Ellerman: powerpc: Merge kexec powerpc: Propagate regs through to machine_crash_shutdown powerpc: Add a is_kernel_addr() macro powerpc: Separate usage of KERNELBASE and PAGE_OFFSET powerpc: Add CONFIG_CRASH_DUMP powerpc: Create a trampoline for the fwnmi vectors powerpc: Reroute interrupts from 0 + offset to PHYSICAL_START + offset powerpc: Fixups for kernel linked at 32 MB powerpc: Add arch dependent basic infrastructure for Kdump. powerpc: Parse crashkernel= parameter in first kernel powerpc: Add arch-dependent copy_oldmem_page powerpc: Add support for "linux,usable-memory" on memory nodes powerpc: Don't use KERNELBASE in add_memory() Mike Kravetz: powerpc: Minor numa memory code cleanup powerpc: Minor numa memory code cleanup powerpc: numa placement for dynamically added memory powerpc: don't add memory to empty node/zone Nicolas Kaiser: Documentation/powerpc: index update Otavio Salvador: ppc: removed unused variable i from code. Paul Janzen: ppc32: Put cache flush routines back into .relocate_code section Paul Mackerras: powerpc: Update __NR_syscalls to account for SPU syscalls ppc: remove duplicate bseip.h Revert "powerpc: Minor numa memory code cleanup" powerpc: Fix typo in head_64.S powerpc: Fix some #ifndef __KERNEL__ that should be #ifdef powerpc: set CONFIG_PPC_OF=y always for ARCH=powerpc powerpc: unbreak iSeries compilation again Segher Boessenkool: powerpc: Update MPIC workarounds Stephen Rothwell: powerpc: cleanup iseries irq.c powerpc: use end_IRQ for iseries irqs powerpc: partly merge iseries do_IRQ powerpc: reduce include in irq.c powerpc: more iseries irq work powerpc: fix for "Update OF address parsers" From dhowells at redhat.com Mon Jan 9 22:13:52 2006 From: dhowells at redhat.com (David Howells) Date: Mon, 09 Jan 2006 11:13:52 +0000 Subject: PowerPC fastpaths for mutex subsystem In-Reply-To: <20060108000021.588c6f5f.akpm@osdl.org> References: <20060108000021.588c6f5f.akpm@osdl.org> <20060104144151.GA27646@elte.hu> <43BC5E15.207@austin.ibm.com> <20060105143502.GA16816@elte.hu> <43BD4C66.60001@austin.ibm.com> <20060105222106.GA26474@elte.hu> <43BDA672.4090704@austin.ibm.com> <20060106002919.GA29190@pb15.lixom.net> <43BFFF1D.7030007@austin.ibm.com> <20060107143722.25afd85d.akpm@osdl.org> <20060108074356.GM26499@krispykreme> Message-ID: <923.1136805232@warthog.cambridge.redhat.com> Andrew Morton wrote: > > Wasnt most of the x86 mutex gain a result of going from fair to unfair > > operation? The current ppc64 semaphores are unfair. > > > > What's "unfair"? Mutexes are FIFO, as are x86 semaphores. No, strictly Ingo's mutexes are neither completely fair nor completely FIFO. It's possible for a process to jump the queue because unlock() always sets the counter back to 1 before waking up the process at the front of the queue. This means that the lock() fastpath in another process may steal the mutex out of sequence before the wakee has a chance to grab it. I'm not 100% convinced that x86 counting semaphores are completely fair or completely FIFO. It's possible that they are because up() never arbitrarily sets the count back to >0. R/W semaphores are completely fair, but only as completely FIFO as the unfair spinlocks permit. This is because it's much easier to guarantee their behaviour (writer-starvation is a real problem with unfair rwsems). I have a simple implementation of totally fair spinlocks for x86 which would also work on anything that can emulate XADD, but I don't think it's worth the trouble. However, for Ingo's mutexes, I suspect this queue-jumping feature is sufficiently low probability that we can ignore it. It is theoretically possible to induce livelock, but in reality I think it extremely unlikely to happen for any significant length of time. David From olh at suse.de Tue Jan 10 03:13:48 2006 From: olh at suse.de (Olaf Hering) Date: Mon, 9 Jan 2006 17:13:48 +0100 Subject: time runs too slow on maple Message-ID: <20060109161348.GA1267@suse.de> The maple board I have cant keep the time, even with ntpd running. According to this script, it loses 0.05 seconds each second. This happens with 2.6.15 and also 2.6.13. processor : 0 cpu : PPC970FX, altivec supported clock : 2000.000000MHz revision : 3.0 (pvr 003c 0300) processor : 1 cpu : PPC970FX, altivec supported clock : 2000.000000MHz revision : 3.0 (pvr 003c 0300) timebase : 250000000 #!/bin/bash echo 0 > /tmp/t while sleep 1 do t=`/usr/sbin/ntpdate -qs ntp | awk '{ print $6 }' | sed 's@[,.]@@g'` case "$t" in 0*) continue ;; esac read ot < /tmp/t echo "t $t , ot $ot ; 0.0$(( $t - $ot))" echo $t > /tmp/t done t 54802627 , ot 0 ; 0.054802627 t 54854375 , ot 54802627 ; 0.051748 t 54906475 , ot 54854375 ; 0.052100 t 54958231 , ot 54906475 ; 0.051756 t 55010576 , ot 54958231 ; 0.052345 t 55062834 , ot 55010576 ; 0.052258 t 55115168 , ot 55062834 ; 0.052334 t 55166862 , ot 55115168 ; 0.051694 t 55219300 , ot 55166862 ; 0.052438 t 55271672 , ot 55219300 ; 0.052372 t 55324382 , ot 55271672 ; 0.052710 t 55376786 , ot 55324382 ; 0.052404 t 55429167 , ot 55376786 ; 0.052381 t 55481677 , ot 55429167 ; 0.052510 t 55534112 , ot 55481677 ; 0.052435 t 55586615 , ot 55534112 ; 0.052503 t 55639258 , ot 55586615 ; 0.052643 t 55691674 , ot 55639258 ; 0.052416 t 55744325 , ot 55691674 ; 0.052651 t 55796758 , ot 55744325 ; 0.052433 t 55849369 , ot 55796758 ; 0.052611 t 55901745 , ot 55849369 ; 0.052376 t 55954273 , ot 55901745 ; 0.052528 t 56006806 , ot 55954273 ; 0.052533 t 56059376 , ot 56006806 ; 0.052570 -- short story of a lazy sysadmin: alias appserv=wotan From olh at suse.de Tue Jan 10 03:42:57 2006 From: olh at suse.de (Olaf Hering) Date: Mon, 9 Jan 2006 17:42:57 +0100 Subject: time runs too slow on maple In-Reply-To: <79F6C29BCA618049A39405881A1C200804B908@ad-email2.ad.mc.com> References: <79F6C29BCA618049A39405881A1C200804B908@ad-email2.ad.mc.com> Message-ID: <20060109164257.GA2457@suse.de> On Mon, Jan 09, Tranchemontagne, Denis wrote: > This is a know problem with the "Maple Boards", it is described in the > 970FX BSP release notes > > System clock on some of the board might not be 100% > accurate. Actual system clock can be up to 1.5% off. > This will cause the time base to run either too fast > or too slow. Hmm, that makes the board almost useless for me. I would hope that ntpd can fix it up. tickadj did not change it. -- short story of a lazy sysadmin: alias appserv=wotan From linas at austin.ibm.com Tue Jan 10 03:53:28 2006 From: linas at austin.ibm.com (linas) Date: Mon, 9 Jan 2006 10:53:28 -0600 Subject: time runs too slow on maple In-Reply-To: <20060109161348.GA1267@suse.de> References: <20060109161348.GA1267@suse.de> Message-ID: <20060109165328.GG26221@austin.ibm.com> On Mon, Jan 09, 2006 at 05:13:48PM +0100, Olaf Hering was heard to remark: > The maple board I have cant keep the time, even with ntpd running. > According to this script, it loses 0.05 seconds each second. > This happens with 2.6.15 and also 2.6.13. > > cpu : PPC970FX, altivec supported I don't understand timekeeping in the kernel, but consistently loosing the same amount with every tick sounds like some sort of mis-calibration during boot. I don't entirely understand how ntpd works, but I thought it tracked clock slew and adjusted for it. i.e. if a clock runs consistently fast, or slow, ntpd is supposed to handle that trivially. --linas From dtranche at mc.com Tue Jan 10 03:40:06 2006 From: dtranche at mc.com (Tranchemontagne, Denis) Date: Mon, 9 Jan 2006 11:40:06 -0500 Subject: time runs too slow on maple Message-ID: <79F6C29BCA618049A39405881A1C200804B908@ad-email2.ad.mc.com> This is a know problem with the "Maple Boards", it is described in the 970FX BSP release notes System clock on some of the board might not be 100% accurate. Actual system clock can be up to 1.5% off. This will cause the time base to run either too fast or too slow. My understanding it has to do with the choice of clocks. Denis -----Original Message----- From: linuxppc64-dev-bounces at ozlabs.org [mailto:linuxppc64-dev-bounces at ozlabs.org] On Behalf Of Olaf Hering Sent: Monday, January 09, 2006 11:14 AM To: linuxppc64-dev at ozlabs.org Subject: time runs too slow on maple The maple board I have cant keep the time, even with ntpd running. According to this script, it loses 0.05 seconds each second. This happens with 2.6.15 and also 2.6.13. processor : 0 cpu : PPC970FX, altivec supported clock : 2000.000000MHz revision : 3.0 (pvr 003c 0300) processor : 1 cpu : PPC970FX, altivec supported clock : 2000.000000MHz revision : 3.0 (pvr 003c 0300) timebase : 250000000 #!/bin/bash echo 0 > /tmp/t while sleep 1 do t=`/usr/sbin/ntpdate -qs ntp | awk '{ print $6 }' | sed 's@[,.]@@g'` case "$t" in 0*) continue ;; esac read ot < /tmp/t echo "t $t , ot $ot ; 0.0$(( $t - $ot))" echo $t > /tmp/t done t 54802627 , ot 0 ; 0.054802627 t 54854375 , ot 54802627 ; 0.051748 t 54906475 , ot 54854375 ; 0.052100 t 54958231 , ot 54906475 ; 0.051756 t 55010576 , ot 54958231 ; 0.052345 t 55062834 , ot 55010576 ; 0.052258 t 55115168 , ot 55062834 ; 0.052334 t 55166862 , ot 55115168 ; 0.051694 t 55219300 , ot 55166862 ; 0.052438 t 55271672 , ot 55219300 ; 0.052372 t 55324382 , ot 55271672 ; 0.052710 t 55376786 , ot 55324382 ; 0.052404 t 55429167 , ot 55376786 ; 0.052381 t 55481677 , ot 55429167 ; 0.052510 t 55534112 , ot 55481677 ; 0.052435 t 55586615 , ot 55534112 ; 0.052503 t 55639258 , ot 55586615 ; 0.052643 t 55691674 , ot 55639258 ; 0.052416 t 55744325 , ot 55691674 ; 0.052651 t 55796758 , ot 55744325 ; 0.052433 t 55849369 , ot 55796758 ; 0.052611 t 55901745 , ot 55849369 ; 0.052376 t 55954273 , ot 55901745 ; 0.052528 t 56006806 , ot 55954273 ; 0.052533 t 56059376 , ot 56006806 ; 0.052570 -- short story of a lazy sysadmin: alias appserv=wotan _______________________________________________ Linuxppc64-dev mailing list Linuxppc64-dev at ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc64-dev From olh at suse.de Tue Jan 10 04:12:04 2006 From: olh at suse.de (Olaf Hering) Date: Mon, 9 Jan 2006 18:12:04 +0100 Subject: time runs too slow on maple In-Reply-To: <20060109165328.GG26221@austin.ibm.com> References: <20060109161348.GA1267@suse.de> <20060109165328.GG26221@austin.ibm.com> Message-ID: <20060109171204.GA3608@suse.de> On Mon, Jan 09, Linas Vepstas wrote: > On Mon, Jan 09, 2006 at 05:13:48PM +0100, Olaf Hering was heard to remark: > > The maple board I have cant keep the time, even with ntpd running. > > According to this script, it loses 0.05 seconds each second. > > This happens with 2.6.15 and also 2.6.13. > > > > cpu : PPC970FX, altivec supported > > I don't understand timekeeping in the kernel, but consistently loosing > the same amount with every tick sounds like some sort of mis-calibration > during boot. It uses the generic function. Maybe it needs some tweaking. /var/log/boot.msg-<4>Synchronizing timebase /var/log/boot.msg-<4>Got ack /var/log/boot.msg-<4>score 299, offset 1000 /var/log/boot.msg-<4>score 299, offset 500 /var/log/boot.msg-<4>score 299, offset 250 /var/log/boot.msg-<4>score 55, offset 125 /var/log/boot.msg-<4>score -223, offset 62 /var/log/boot.msg-<4>score -59, offset 93 /var/log/boot.msg-<4>score -77, offset 109 /var/log/boot.msg-<4>score 45, offset 117 /var/log/boot.msg-<4>score 107, offset 113 /var/log/boot.msg-<4>score -35, offset 111 /var/log/boot.msg-<4>score 41, offset 112 /var/log/boot.msg-<4>score 65, offset 111 /var/log/boot.msg-<4>Min 111 (score 79), Max 111 (score -61) /var/log/boot.msg:<4>Final offset: 111 (9/300) /var/log/boot.omsg-<4>Processor 1 found. /var/log/boot.omsg-<4>Synchronizing timebase /var/log/boot.omsg-<4>Got ack /var/log/boot.omsg-<4>score 299, offset 1000 /var/log/boot.omsg-<4>score 299, offset 500 /var/log/boot.omsg-<4>score 299, offset 250 /var/log/boot.omsg-<4>score 135, offset 125 /var/log/boot.omsg-<4>score -291, offset 62 /var/log/boot.omsg-<4>score -9, offset 93 /var/log/boot.omsg-<4>score 189, offset 109 /var/log/boot.omsg-<4>score 17, offset 101 /var/log/boot.omsg-<4>score -5, offset 97 /var/log/boot.omsg-<4>score 13, offset 99 /var/log/boot.omsg-<4>score -45, offset 98 /var/log/boot.omsg-<4>Min 98 (score -41), Max 99 (score -9) /var/log/boot.omsg:<4>Final offset: 99 (29/300) -- short story of a lazy sysadmin: alias appserv=wotan From millman at us.ibm.com Tue Jan 10 05:21:38 2006 From: millman at us.ibm.com (Steve Millman) Date: Mon, 9 Jan 2006 13:21:38 -0500 Subject: JS-20 and generic kernel 2.6.13.3 Message-ID: Hi, I have downloaded and compiled the generic Linux kernel 2.6.13.3 for my JS-20 PPC IBM BladeServer. When I attempt to boot the new kernel I get the following output. Has anyone successfully tried to run the generic 2.6.13.3 kernel on a JS-20 or have any idea what I am doing wrong? As a word of caution, I am a Kernel newbie, so I might have done, or omitted something stupid. boot: newlinux Please wait, loading kernel... Elf64 kernel loaded... Loading ramdisk... ramdisk loaded at 02300000, size: 1563 Kbytes OF stdout device is: /vdevice/vty at 0 Hypertas detected, assuming LPAR ! command line: root=/dev/VolGroup00/LogVol00 ro console=hvc0 rhgb quiet memory layout at init: memory_limit : 0000000000000000 (16 MB aligned) alloc_bottom : 0000000002487000 alloc_top : 0000000008000000 alloc_top_hi : 000000001e000000 rmo_top : 0000000008000000 ram_top : 000000001e000000 Looking for displays instantiating rtas at 0x0000000007a70000 ...rtas_ram_size = 2c8000 fixed_base_addr = 7a70000 code_base_addr = 7afa000 Code Image Load Complete. registered vars: name addr size hash align -------------------------------- ---------------- ---- ---- ----- glob_rtas_trace_buf : 0000000007ab9100 65552 7 0 prtas_was_interrupted : 0000000007aca100 4 9 1 callperf : 0000000007aca400 12496 9 1 pglob_os_term_state : 0000000007acd700 4 12 1 hypStopWatch : 0000000007ac9400 1800 14 8 prtas_in_progress : 0000000007ac9e00 4 20 1 last_error_log : 0000000007acdc00 1024 30 0 nmi_work_buffer : 0000000007ace000 4096 31 12 done 0000000000000000 : boot cpu 0000000000000000 0000000000000001 : starting cpu hw idx 0000000000000001... done copying OF device tree ... Building dt strings... Building dt structure... Device tree strings 0x0000000002788000 -> 0x0000000002788e7b Device tree struct 0x0000000002789000 -> 0x000000000278f000 Calling quiesce ... returning from prom_init Found initrd at 0xc000000002300000:0xc000000002486c00 firmware_features = 0x55f Starting Linux PPC64 2.6.13.3 ----------------------------------------------------- ppc64_pft_size = 0x17 ppc64_debug_switch = 0x0 ppc64_interrupt_controller = 0x2 systemcfg = 0xc0000000003d0000 systemcfg->platform = 0x101 systemcfg->processorCount = 0x2 systemcfg->physicalMemorySize = 0x1e000000 ppc64_caches.dcache_line_size = 0x80 ppc64_caches.icache_line_size = 0x80 htab_address = 0x0000000000000000 htab_hash_mask = 0xffff ----------------------------------------------------- [boot]0100 MM Init [boot]0100 MM Init Done Linux version 2.6.13.3 (root at dyn9002211199.watson.ibm.com) (gcc version 3.4.3 20 041212 (Red Hat 3.4.3-9.EL4)) #1 SMP Wed Jan 4 14:50:45 EST 2006 [boot]0012 Setup Arch Top of RAM: 0x1e000000, Total RAM: 0x1e000000 Memory hole size: 0MB Syscall map setup, 246 32 bits and 222 64 bits syscalls PPC64 nvram contains 16384 bytes Using default idle loop [boot]0015 Setup Done Built 1 zonelists Kernel command line: root=/dev/VolGroup00/LogVol00 ro console=hvc0 rhgb quiet scan-log-dump not implemented on this system Red Hat nash version 4.1.18 starting Unable to find device-mapper major/minor File descriptor 3 left open Reading all physical volumes. This may take a while... File descriptor 3 left open File descriptor 3 left open Found volume group "VolGroup00" using metadata type lvm2 /dev/mapper/control: open failed: No such file or directorymount: error 6 moun ting ext3 mount: error 2 mountin system:blade[7]> Connection to host lost. Thanks, Steve Millman -------------- next part -------------- An HTML attachment was scrubbed... URL: http://ozlabs.org/pipermail/linuxppc64-dev/attachments/20060109/72f3e036/attachment.htm From arnd at arndb.de Tue Jan 10 06:29:18 2006 From: arnd at arndb.de (Arnd Bergmann) Date: Mon, 9 Jan 2006 19:29:18 +0000 Subject: [PATCH] spufs: fix build with shrunk struct dcache Message-ID: <200601091929.18760.arnd@arndb.de> spufs was merged at about the same time as Eric's "shrink dcache struct" patch, so we need to fix up the newly introduced reference to dentry->d_child. Signed-off-by: Arnd Bergmann --- linux-2.6.16-rc.orig/arch/powerpc/platforms/cell/spufs/inode.c +++ linux-2.6.16-rc/arch/powerpc/platforms/cell/spufs/inode.c @@ -138,7 +138,7 @@ static void spufs_prune_dir(struct dentr { struct dentry *dentry, *tmp; down(&dir->d_inode->i_sem); - list_for_each_entry_safe(dentry, tmp, &dir->d_subdirs, d_child) { + list_for_each_entry_safe(dentry, tmp, &dir->d_subdirs, d_u.d_child) { spin_lock(&dcache_lock); spin_lock(&dentry->d_lock); if (!(d_unhashed(dentry)) && dentry->d_inode) { From linas at austin.ibm.com Tue Jan 10 06:58:53 2006 From: linas at austin.ibm.com (linas) Date: Mon, 9 Jan 2006 13:58:53 -0600 Subject: [PATCH]: ppowerpc: fix compile-time failure when EEH disabled. In-Reply-To: <20060107212851.GA31731@suse.de> References: <20051006232032.GA29826@austin.ibm.com> <20051006234624.GO29826@austin.ibm.com> <20060107212851.GA31731@suse.de> Message-ID: <20060109195853.GH26221@austin.ibm.com> Paul, please apply and fwd upstream. --linas Patch to fix compile problem reported by Olaf Herring: Kernel fails to compile when CONFIG_EMBEDDED is enabled, but CONFIG_EEH disabled. Signed-off-by: Linas Vepstas Index: linux-2.6.15-mm1/include/asm-powerpc/eeh.h =================================================================== --- linux-2.6.15-mm1.orig/include/asm-powerpc/eeh.h 2006-01-09 12:23:39.698773976 -0600 +++ linux-2.6.15-mm1/include/asm-powerpc/eeh.h 2006-01-09 12:28:44.404818949 -0600 @@ -113,12 +113,11 @@ } static inline void pci_addr_cache_build(void) { } - static inline void eeh_add_device_early(struct device_node *dn) { } - static inline void eeh_add_device_late(struct pci_dev *dev) { } - static inline void eeh_remove_device(struct pci_dev *dev) { } +static inline void eeh_remove_bus_device(struct pci_dev *dev) { } +static inline void eeh_add_device_tree_early(struct device_node *dn) { } #define EEH_POSSIBLE_ERROR(val, type) (0) #define EEH_IO_ERROR_VALUE(size) (-1UL) From millman at us.ibm.com Tue Jan 10 06:57:41 2006 From: millman at us.ibm.com (Steve Millman) Date: Mon, 9 Jan 2006 14:57:41 -0500 Subject: JS-20 and generic kernel 2.6.13.3 In-Reply-To: <200601091927.k09JRxo9024799@falcon30.maxeymade.com> Message-ID: Hi Doug, I tried running both mkinitrd -f /boot/initrd-2.6.13.3.img 2.6.13.3 and mkinitrd -f --omit-scsi-modules /boot/initrd-2.6.13.3.img 2.6.13.3 . I'm not sure why I had to run either of these when I had previously run make install to install the kernel and it already built a initrd file, but I did it anyway to experiment. Thanks, Steve Millman Doug Maxey 01/09/2006 02:27 PM To: Steve Millman/Watson/IBM at IBMUS cc: linuxppc64-dev at ozlabs.org Subject: Re: JS-20 and generic kernel 2.6.13.3 On Mon, 09 Jan 2006 13:21:38 EST, Steve Millman wrote: >Hi, >I have downloaded and compiled the generic Linux kernel 2.6.13.3 for my >JS-20 PPC IBM BladeServer. When I attempt to boot the new kernel I get >the following output. Has anyone successfully tried to run the generic >2.6.13.3 kernel on a JS-20 or have any idea what I am doing wrong? As a >word of caution, I am a Kernel newbie, so I might have done, or omitted >something stupid. > >boot: newlinux >Please wait, loading kernel... > Elf64 kernel loaded... >Loading ramdisk... >ramdisk loaded at 02300000, size: 1563 Kbytes >OF stdout device is: /vdevice/vty at 0 >Hypertas detected, assuming LPAR ! >command line: root=/dev/VolGroup00/LogVol00 ro console=hvc0 rhgb quiet >memory layout at init: > memory_limit : 0000000000000000 (16 MB aligned) > alloc_bottom : 0000000002487000 > alloc_top : 0000000008000000 > alloc_top_hi : 000000001e000000 > rmo_top : 0000000008000000 > ram_top : 000000001e000000 >Looking for displays >instantiating rtas at 0x0000000007a70000 ...rtas_ram_size = 2c8000 >fixed_base_addr = 7a70000 >code_base_addr = 7afa000 >Code Image Load Complete. >registered vars: >name addr size hash align >-------------------------------- ---------------- ---- ---- ----- >glob_rtas_trace_buf : 0000000007ab9100 65552 7 0 >prtas_was_interrupted : 0000000007aca100 4 9 1 >callperf : 0000000007aca400 12496 9 1 >pglob_os_term_state : 0000000007acd700 4 12 1 >hypStopWatch : 0000000007ac9400 1800 14 8 >prtas_in_progress : 0000000007ac9e00 4 20 1 >last_error_log : 0000000007acdc00 1024 30 0 >nmi_work_buffer : 0000000007ace000 4096 31 12 > done >0000000000000000 : boot cpu 0000000000000000 >0000000000000001 : starting cpu hw idx 0000000000000001... done >copying OF device tree ... >Building dt strings... >Building dt structure... >Device tree strings 0x0000000002788000 -> 0x0000000002788e7b >Device tree struct 0x0000000002789000 -> 0x000000000278f000 >Calling quiesce ... >returning from prom_init >Found initrd at 0xc000000002300000:0xc000000002486c00 >firmware_features = 0x55f >Starting Linux PPC64 2.6.13.3 >----------------------------------------------------- >ppc64_pft_size = 0x17 >ppc64_debug_switch = 0x0 >ppc64_interrupt_controller = 0x2 >systemcfg = 0xc0000000003d0000 >systemcfg->platform = 0x101 >systemcfg->processorCount = 0x2 >systemcfg->physicalMemorySize = 0x1e000000 >ppc64_caches.dcache_line_size = 0x80 >ppc64_caches.icache_line_size = 0x80 >htab_address = 0x0000000000000000 >htab_hash_mask = 0xffff >----------------------------------------------------- >[boot]0100 MM Init >[boot]0100 MM Init Done >Linux version 2.6.13.3 (root at dyn9002211199.watson.ibm.com) (gcc version >3.4.3 20 >041212 (Red Hat 3.4.3-9.EL4)) #1 SMP Wed Jan 4 14:50:45 EST 2006 >[boot]0012 Setup Arch >Top of RAM: 0x1e000000, Total RAM: 0x1e000000 >Memory hole size: 0MB >Syscall map setup, 246 32 bits and 222 64 bits syscalls >PPC64 nvram contains 16384 bytes >Using default idle loop >[boot]0015 Setup Done >Built 1 zonelists >Kernel command line: root=/dev/VolGroup00/LogVol00 ro console=hvc0 rhgb >quiet >scan-log-dump not implemented on this system >Red Hat nash version 4.1.18 starting >Unable to find device-mapper major/minor >File descriptor 3 left open > Reading all physical volumes. This may take a while... >File descriptor 3 left open >File descriptor 3 left open > Found volume group "VolGroup00" using metadata type lvm2 > /dev/mapper/control: open failed: No such file or directorymount: error >6 moun >ting ext3 >mount: error 2 mountin >system:blade[7]> You did run mkinitrd after installing the kernel, correct? ++doug -------------- next part -------------- An HTML attachment was scrubbed... URL: http://ozlabs.org/pipermail/linuxppc64-dev/attachments/20060109/a2c81754/attachment.htm From dwm at maxeymade.com Tue Jan 10 06:27:59 2006 From: dwm at maxeymade.com (Doug Maxey) Date: Mon, 09 Jan 2006 13:27:59 -0600 Subject: JS-20 and generic kernel 2.6.13.3 In-Reply-To: Message-ID: <200601091927.k09JRxo9024799@falcon30.maxeymade.com> On Mon, 09 Jan 2006 13:21:38 EST, Steve Millman wrote: >Hi, >I have downloaded and compiled the generic Linux kernel 2.6.13.3 for my >JS-20 PPC IBM BladeServer. When I attempt to boot the new kernel I get >the following output. Has anyone successfully tried to run the generic >2.6.13.3 kernel on a JS-20 or have any idea what I am doing wrong? As a >word of caution, I am a Kernel newbie, so I might have done, or omitted >something stupid. > >boot: newlinux >Please wait, loading kernel... > Elf64 kernel loaded... >Loading ramdisk... >ramdisk loaded at 02300000, size: 1563 Kbytes >OF stdout device is: /vdevice/vty at 0 >Hypertas detected, assuming LPAR ! >command line: root=/dev/VolGroup00/LogVol00 ro console=hvc0 rhgb quiet >memory layout at init: > memory_limit : 0000000000000000 (16 MB aligned) > alloc_bottom : 0000000002487000 > alloc_top : 0000000008000000 > alloc_top_hi : 000000001e000000 > rmo_top : 0000000008000000 > ram_top : 000000001e000000 >Looking for displays >instantiating rtas at 0x0000000007a70000 ...rtas_ram_size = 2c8000 >fixed_base_addr = 7a70000 >code_base_addr = 7afa000 >Code Image Load Complete. >registered vars: >name addr size hash align >-------------------------------- ---------------- ---- ---- ----- >glob_rtas_trace_buf : 0000000007ab9100 65552 7 0 >prtas_was_interrupted : 0000000007aca100 4 9 1 >callperf : 0000000007aca400 12496 9 1 >pglob_os_term_state : 0000000007acd700 4 12 1 >hypStopWatch : 0000000007ac9400 1800 14 8 >prtas_in_progress : 0000000007ac9e00 4 20 1 >last_error_log : 0000000007acdc00 1024 30 0 >nmi_work_buffer : 0000000007ace000 4096 31 12 > done >0000000000000000 : boot cpu 0000000000000000 >0000000000000001 : starting cpu hw idx 0000000000000001... done >copying OF device tree ... >Building dt strings... >Building dt structure... >Device tree strings 0x0000000002788000 -> 0x0000000002788e7b >Device tree struct 0x0000000002789000 -> 0x000000000278f000 >Calling quiesce ... >returning from prom_init >Found initrd at 0xc000000002300000:0xc000000002486c00 >firmware_features = 0x55f >Starting Linux PPC64 2.6.13.3 >----------------------------------------------------- >ppc64_pft_size = 0x17 >ppc64_debug_switch = 0x0 >ppc64_interrupt_controller = 0x2 >systemcfg = 0xc0000000003d0000 >systemcfg->platform = 0x101 >systemcfg->processorCount = 0x2 >systemcfg->physicalMemorySize = 0x1e000000 >ppc64_caches.dcache_line_size = 0x80 >ppc64_caches.icache_line_size = 0x80 >htab_address = 0x0000000000000000 >htab_hash_mask = 0xffff >----------------------------------------------------- >[boot]0100 MM Init >[boot]0100 MM Init Done >Linux version 2.6.13.3 (root at dyn9002211199.watson.ibm.com) (gcc version >3.4.3 20 >041212 (Red Hat 3.4.3-9.EL4)) #1 SMP Wed Jan 4 14:50:45 EST 2006 >[boot]0012 Setup Arch >Top of RAM: 0x1e000000, Total RAM: 0x1e000000 >Memory hole size: 0MB >Syscall map setup, 246 32 bits and 222 64 bits syscalls >PPC64 nvram contains 16384 bytes >Using default idle loop >[boot]0015 Setup Done >Built 1 zonelists >Kernel command line: root=/dev/VolGroup00/LogVol00 ro console=hvc0 rhgb >quiet >scan-log-dump not implemented on this system >Red Hat nash version 4.1.18 starting >Unable to find device-mapper major/minor >File descriptor 3 left open > Reading all physical volumes. This may take a while... >File descriptor 3 left open >File descriptor 3 left open > Found volume group "VolGroup00" using metadata type lvm2 > /dev/mapper/control: open failed: No such file or directorymount: error >6 moun >ting ext3 >mount: error 2 mountin >system:blade[7]> You did run mkinitrd after installing the kernel, correct? ++doug From paulus at samba.org Tue Jan 10 09:31:22 2006 From: paulus at samba.org (Paul Mackerras) Date: Tue, 10 Jan 2006 09:31:22 +1100 Subject: time runs too slow on maple In-Reply-To: <20060109161348.GA1267@suse.de> References: <20060109161348.GA1267@suse.de> Message-ID: <17346.58426.286786.528477@cargo.ozlabs.ibm.com> Olaf Hering writes: > The maple board I have cant keep the time, even with ntpd running. > According to this script, it loses 0.05 seconds each second. Ouch! Does the RTC keep reasonable time? Paul. From linas at austin.ibm.com Tue Jan 10 09:33:43 2006 From: linas at austin.ibm.com (linas) Date: Mon, 9 Jan 2006 16:33:43 -0600 Subject: [PATCH]: powerpc janitorial: remove lint warning message Message-ID: <20060109223343.GK26221@austin.ibm.com> Remove annoying compile-time warning. Signed-off-by: Linas Vepstas Index: linux-2.6.15-mm1/drivers/char/hvcs.c =================================================================== --- linux-2.6.15-mm1.orig/drivers/char/hvcs.c 2006-01-05 16:44:04.000000000 -0600 +++ linux-2.6.15-mm1/drivers/char/hvcs.c 2006-01-09 16:17:36.454497065 -0600 @@ -438,7 +438,6 @@ char buf[HVCS_BUFF_LEN] __ALIGNED__; unsigned long flags; int got = 0; - int i; spin_lock_irqsave(&hvcsd->lock, flags); From olh at suse.de Tue Jan 10 09:38:14 2006 From: olh at suse.de (Olaf Hering) Date: Mon, 9 Jan 2006 23:38:14 +0100 Subject: time runs too slow on maple In-Reply-To: <17346.58426.286786.528477@cargo.ozlabs.ibm.com> References: <20060109161348.GA1267@suse.de> <17346.58426.286786.528477@cargo.ozlabs.ibm.com> Message-ID: <20060109223814.GB15984@suse.de> On Tue, Jan 10, Paul Mackeras wrote: > Olaf Hering writes: > > > The maple board I have cant keep the time, even with ntpd running. > > According to this script, it loses 0.05 seconds each second. > > Ouch! Does the RTC keep reasonable time? I have to double check. But when booting into the installer, it complains about wrong time. It looks like the time just stops in RTC when the board is powered off, according the the logs. -- short story of a lazy sysadmin: alias appserv=wotan From linas at austin.ibm.com Tue Jan 10 09:44:20 2006 From: linas at austin.ibm.com (linas) Date: Mon, 9 Jan 2006 16:44:20 -0600 Subject: time runs too slow on maple In-Reply-To: <20060109171204.GA3608@suse.de> References: <20060109161348.GA1267@suse.de> <20060109165328.GG26221@austin.ibm.com> <20060109171204.GA3608@suse.de> Message-ID: <20060109224420.GL26221@austin.ibm.com> On Mon, Jan 09, 2006 at 06:12:04PM +0100, Olaf Hering was heard to remark: > On Mon, Jan 09, Linas Vepstas wrote: > > > I don't understand timekeeping in the kernel, but consistently loosing > > the same amount with every tick sounds like some sort of mis-calibration > > during boot. > > It uses the generic function. Maybe it needs some tweaking. > > /var/log/boot.msg-<4>Synchronizing timebase > /var/log/boot.msg-<4>Got ack > /var/log/boot.msg-<4>score 299, offset 1000 > /var/log/boot.msg-<4>score 299, offset 500 > /var/log/boot.msg-<4>score 299, offset 250 > /var/log/boot.msg-<4>score 55, offset 125 > /var/log/boot.msg-<4>score -223, offset 62 > /var/log/boot.msg-<4>score -59, offset 93 > /var/log/boot.msg-<4>score -77, offset 109 > /var/log/boot.msg-<4>score 45, offset 117 > /var/log/boot.msg-<4>score 107, offset 113 > /var/log/boot.msg-<4>score -35, offset 111 > /var/log/boot.msg-<4>score 41, offset 112 > /var/log/boot.msg-<4>score 65, offset 111 > /var/log/boot.msg-<4>Min 111 (score 79), Max 111 (score -61) > /var/log/boot.msg:<4>Final offset: 111 (9/300) A very quick skim of the code, in arch/powerpc/kernel/smp-tbsync.c: smp_generic_give_timebase() leads me to think that the maple board has a clock with a huge amount of jitter, its bouncing all over the place. However, the smp_generic_give_timebase() isn't taking any averages that would smooth out the jitter; instead, it locks onto some random value and uses that. I might be able to hack some averaging into that chunk of code, but I don't know this stuff, not sure if that would be the right fix. --linas > alias appserv=wotan ? like, Wagner ? From olh at suse.de Tue Jan 10 10:30:47 2006 From: olh at suse.de (Olaf Hering) Date: Tue, 10 Jan 2006 00:30:47 +0100 Subject: time runs too slow on maple In-Reply-To: <17346.58426.286786.528477@cargo.ozlabs.ibm.com> References: <20060109161348.GA1267@suse.de> <17346.58426.286786.528477@cargo.ozlabs.ibm.com> Message-ID: <20060109233047.GA17597@suse.de> On Tue, Jan 10, Paul Mackeras wrote: > Olaf Hering writes: > > > The maple board I have cant keep the time, even with ntpd running. > > According to this script, it loses 0.05 seconds each second. > > Ouch! Does the RTC keep reasonable time? Yes, RTC seems to work ok. sometimes ntp probably syncs system time with RTC: maple:~ # while sleep 1 ; do /usr/sbin/ntpdate -qs ntp ; date ; hwclock ; done server 195.135.220.2, stratum 2, offset 32.608087, delay 0.02615 Tue Jan 10 00:27:39 CET 2006 Tue Jan 10 00:28:13 2006 -0.572528 seconds server 195.135.220.2, stratum 2, offset 32.689348, delay 0.02621 Tue Jan 10 00:27:41 CET 2006 Tue Jan 10 00:28:15 2006 -0.766481 seconds server 195.135.220.2, stratum 2, offset 32.781137, delay 0.02614 Tue Jan 10 00:27:43 CET 2006 Tue Jan 10 00:28:17 2006 -0.765355 seconds server 195.135.220.2, stratum 2, offset 32.872565, delay 0.02615 Tue Jan 10 00:27:45 CET 2006 Tue Jan 10 00:28:19 2006 -0.763836 seconds server 195.135.220.2, stratum 2, offset 32.964229, delay 0.02615 Tue Jan 10 00:27:47 CET 2006 Tue Jan 10 00:28:21 2006 -0.767184 seconds server 195.135.220.2, stratum 2, offset 33.056369, delay 0.02614 Tue Jan 10 00:27:49 CET 2006 Tue Jan 10 00:28:23 2006 -0.760217 seconds server 195.135.220.2, stratum 2, offset 33.147633, delay 0.02614 Tue Jan 10 00:27:51 CET 2006 Tue Jan 10 00:28:25 2006 -0.773483 seconds server 195.135.220.2, stratum 2, offset 33.239591, delay 0.02614 Tue Jan 10 00:27:53 CET 2006 Tue Jan 10 00:28:27 2006 -0.771131 seconds server 195.135.220.2, stratum 2, offset 33.331641, delay 0.02614 Tue Jan 10 00:27:54 CET 2006 Tue Jan 10 00:28:29 2006 -0.768826 seconds server 195.135.220.2, stratum 2, offset 33.423449, delay 0.02612 Tue Jan 10 00:27:56 CET 2006 Tue Jan 10 00:28:31 2006 -0.767866 seconds server 195.135.220.2, stratum 2, offset 33.515708, delay 0.02614 Tue Jan 10 00:27:58 CET 2006 Tue Jan 10 00:28:33 2006 -0.760823 seconds server 195.135.220.2, stratum 2, offset 33.607123, delay 0.02614 Tue Jan 10 00:28:00 CET 2006 Tue Jan 10 00:28:35 2006 -0.773621 seconds server 195.135.220.2, stratum 2, offset 33.699374, delay 0.02614 Tue Jan 10 00:28:02 CET 2006 Tue Jan 10 00:28:37 2006 -0.767083 seconds server 195.135.220.2, stratum 2, offset 33.790244, delay 0.02614 Tue Jan 10 00:28:04 CET 2006 Tue Jan 10 00:28:39 2006 -0.771400 seconds server 195.135.220.2, stratum 2, offset 33.880961, delay 0.02615 Tue Jan 10 00:28:06 CET 2006 Tue Jan 10 00:28:08 2006 -0.770181 seconds server 195.135.220.2, stratum 2, offset 33.972368, delay 0.02614 Tue Jan 10 00:28:08 CET 2006 Tue Jan 10 00:28:10 2006 -0.764428 seconds server 195.135.220.2, stratum 2, offset 34.062557, delay 0.02615 Tue Jan 10 00:28:10 CET 2006 Tue Jan 10 00:28:12 2006 -0.764004 seconds server 195.135.220.2, stratum 2, offset 34.153711, delay 0.02614 Tue Jan 10 00:28:12 CET 2006 Tue Jan 10 00:28:14 2006 -0.743031 seconds server 195.135.220.2, stratum 2, offset 34.243755, delay 0.02614 Tue Jan 10 00:28:14 CET 2006 Tue Jan 10 00:28:16 2006 -0.762338 seconds server 195.135.220.2, stratum 2, offset 34.334527, delay 0.02618 Tue Jan 10 00:28:15 CET 2006 Tue Jan 10 00:28:18 2006 -0.761979 seconds server 195.135.220.2, stratum 2, offset 34.424818, delay 0.02618 Tue Jan 10 00:28:17 CET 2006 Tue Jan 10 00:28:20 2006 -0.761000 seconds server 195.135.220.2, stratum 2, offset 34.514786, delay 0.02617 Tue Jan 10 00:28:19 CET 2006 Tue Jan 10 00:28:22 2006 -0.776019 seconds server 195.135.220.2, stratum 2, offset 34.605888, delay 0.02612 Tue Jan 10 00:28:21 CET 2006 Tue Jan 10 00:28:24 2006 -0.770221 seconds server 195.135.220.2, stratum 2, offset 34.695758, delay 0.02614 Tue Jan 10 00:28:23 CET 2006 Tue Jan 10 00:28:26 2006 -0.774996 seconds server 195.135.220.2, stratum 2, offset 34.786565, delay 0.02614 Tue Jan 10 00:28:25 CET 2006 Tue Jan 10 00:28:28 2006 -0.773076 seconds server 195.135.220.2, stratum 2, offset 34.877303, delay 0.02617 Tue Jan 10 00:28:27 CET 2006 Tue Jan 10 00:28:30 2006 -0.768670 seconds -- short story of a lazy sysadmin: alias appserv=wotan From sfr at canb.auug.org.au Tue Jan 10 10:36:14 2006 From: sfr at canb.auug.org.au (Stephen Rothwell) Date: Tue, 10 Jan 2006 10:36:14 +1100 Subject: Subject: [PATCH] powerpc: remove compat_sys_pciconfig_* In-Reply-To: <20060109162718.GP19769@parisc-linux.org> References: <20060109162718.GP19769@parisc-linux.org> Message-ID: <20060110103614.45571f62.sfr@canb.auug.org.au> Matthew Wilcox wondered why we need these functions. We don't. Remove them and just use the "normnal" versions. Signed-off-by: Stephen Rothwell --- arch/powerpc/kernel/sys_ppc32.c | 24 ------------------------ arch/powerpc/kernel/systbl.S | 6 +++--- 2 files changed, 3 insertions(+), 27 deletions(-) -- Cheers, Stephen Rothwell sfr at canb.auug.org.au http://www.canb.auug.org.au/~sfr/ a588565777a0563a1997e2d515db43f9882cb628 diff --git a/arch/powerpc/kernel/sys_ppc32.c b/arch/powerpc/kernel/sys_ppc32.c index 9c921d1..9b6d965 100644 --- a/arch/powerpc/kernel/sys_ppc32.c +++ b/arch/powerpc/kernel/sys_ppc32.c @@ -552,30 +552,6 @@ asmlinkage long compat_sys_sched_rr_get_ return ret; } -asmlinkage int compat_sys_pciconfig_read(u32 bus, u32 dfn, u32 off, u32 len, u32 ubuf) -{ - return sys_pciconfig_read((unsigned long) bus, - (unsigned long) dfn, - (unsigned long) off, - (unsigned long) len, - compat_ptr(ubuf)); -} - -asmlinkage int compat_sys_pciconfig_write(u32 bus, u32 dfn, u32 off, u32 len, u32 ubuf) -{ - return sys_pciconfig_write((unsigned long) bus, - (unsigned long) dfn, - (unsigned long) off, - (unsigned long) len, - compat_ptr(ubuf)); -} - -asmlinkage int compat_sys_pciconfig_iobase(u32 which, u32 in_bus, u32 in_devfn) -{ - return sys_pciconfig_iobase(which, in_bus, in_devfn); -} - - /* Note: it is necessary to treat mode as an unsigned int, * with the corresponding cast to a signed int to insure that the * proper conversion (sign extension) between the register representation of a signed int (msr in 32-bit mode) diff --git a/arch/powerpc/kernel/systbl.S b/arch/powerpc/kernel/systbl.S index 65463a1..c3ae74b 100644 --- a/arch/powerpc/kernel/systbl.S +++ b/arch/powerpc/kernel/systbl.S @@ -239,9 +239,9 @@ SYS32ONLY(ftruncate64) SYSX(sys_ni_syscall,sys_stat64,sys_stat64) SYSX(sys_ni_syscall,sys_lstat64,sys_lstat64) SYSX(sys_ni_syscall,sys_fstat64,sys_fstat64) -COMPAT_SYS(pciconfig_read) -COMPAT_SYS(pciconfig_write) -COMPAT_SYS(pciconfig_iobase) +SYSCALL(pciconfig_read) +SYSCALL(pciconfig_write) +SYSCALL(pciconfig_iobase) SYSCALL(ni_syscall) SYSCALL(getdents64) SYSCALL(pivot_root) -- 1.0.6 From michael at ellerman.id.au Tue Jan 10 11:36:30 2006 From: michael at ellerman.id.au (Michael Ellerman) Date: Tue, 10 Jan 2006 11:36:30 +1100 Subject: [PATCH] powerpc: Don't use KERNELBASE in add_memory(), and don't introduce a compiler warning In-Reply-To: <20060109072001.7B47A689DE@ozlabs.org> Message-ID: <20060110003641.8FA1E68962@ozlabs.org> In add_memory() we should be using __va() to get a virtual address. Spotted by Mike Kravetz. Signed-off-by: Michael Ellerman --- arch/powerpc/mm/mem.c | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: linux/arch/powerpc/mm/mem.c =================================================================== --- linux.orig/arch/powerpc/mm/mem.c +++ linux/arch/powerpc/mm/mem.c @@ -125,7 +125,7 @@ int __devinit add_memory(u64 start, u64 nid = hot_add_scn_to_nid(start); pgdata = NODE_DATA(nid); - start += KERNELBASE; + start = (unsigned long)__va(start); create_section_mapping(start, start + size); /* this should work for most non-highmem platforms */ From michael at ellerman.id.au Tue Jan 10 13:58:57 2006 From: michael at ellerman.id.au (Michael Ellerman) Date: Tue, 10 Jan 2006 13:58:57 +1100 Subject: [PATCH 1/2] powerpc: Early debugging support for iSeries Message-ID: <1136861937.131795.531173522750.qpush@concordia> Connect iSeries up to the standard early debugging infrastructure. To actually use this you need to enable the iSeries early debugging in setup_64.c. Then after the messages are logged hit Ctrl-x Ctrl-x on your console to dump the Hypervisor console buffer. Signed-off-by: Michael Ellerman --- arch/powerpc/kernel/setup_64.c | 14 +++++++++----- arch/powerpc/platforms/iseries/setup.c | 18 +++++++++++++++--- drivers/char/viocons.c | 4 ++-- 3 files changed, 26 insertions(+), 10 deletions(-) Index: linux/arch/powerpc/kernel/setup_64.c =================================================================== --- linux.orig/arch/powerpc/kernel/setup_64.c +++ linux/arch/powerpc/kernel/setup_64.c @@ -75,22 +75,26 @@ * but your kernel will not boot on anything else if you do so */ -/* This one is for use on LPAR machines that support an HVC console - * on vterm 0 - */ +/* For use on LPAR machines that support an HVC console on vterm 0 */ extern void udbg_init_debug_lpar(void); -/* This one is for use on Apple G5 machines - */ + +/* This one is for use on Apple G5 machines */ extern void udbg_init_pmac_realmode(void); + /* That's RTAS panel debug */ extern void call_rtas_display_status_delay(unsigned char c); + /* Here's maple real mode debug */ extern void udbg_init_maple_realmode(void); +/* For iSeries - hit Ctrl-x Ctrl-x to see the output */ +extern void udbg_init_iseries(void); + #define EARLY_DEBUG_INIT() do {} while(0) #if 0 #define EARLY_DEBUG_INIT() udbg_init_debug_lpar() +#define EARLY_DEBUG_INIT() udbg_init_iseries() #define EARLY_DEBUG_INIT() udbg_init_maple_realmode() #define EARLY_DEBUG_INIT() udbg_init_pmac_realmode() #define EARLY_DEBUG_INIT() \ Index: linux/arch/powerpc/platforms/iseries/setup.c =================================================================== --- linux.orig/arch/powerpc/platforms/iseries/setup.c +++ linux/arch/powerpc/platforms/iseries/setup.c @@ -52,6 +52,7 @@ #include #include #include +#include #include "naca.h" #include "setup.h" @@ -62,10 +63,8 @@ #include "call_sm.h" #include "call_hpt.h" -extern void hvlog(char *fmt, ...); - #ifdef DEBUG -#define DBG(fmt...) hvlog(fmt) +#define DBG(fmt...) udbg_printf(fmt) #else #define DBG(fmt...) #endif @@ -984,3 +983,16 @@ static int __init early_parsemem(char *p return 0; } early_param("mem", early_parsemem); + +static void hvputc(unsigned char c) +{ + if (c == '\n') + hvputc('\r'); + + HvCall_writeLogBuffer(&c, 1); +} + +void udbg_init_iseries(void) +{ + udbg_putc = hvputc; +} Index: linux/drivers/char/viocons.c =================================================================== --- linux.orig/drivers/char/viocons.c +++ linux/drivers/char/viocons.c @@ -131,7 +131,7 @@ static void initDataEvent(struct viochar static struct tty_driver *viotty_driver; -void hvlog(char *fmt, ...) +static void hvlog(char *fmt, ...) { int i; unsigned long flags; @@ -147,7 +147,7 @@ void hvlog(char *fmt, ...) spin_unlock_irqrestore(&consoleloglock, flags); } -void hvlogOutput(const char *buf, int count) +static void hvlogOutput(const char *buf, int count) { unsigned long flags; int begin; From michael at ellerman.id.au Tue Jan 10 13:59:02 2006 From: michael at ellerman.id.au (Michael Ellerman) Date: Tue, 10 Jan 2006 13:59:02 +1100 Subject: [PATCH 2/2] powerpc: Make early debugging configurable via Kconfig In-Reply-To: <1136861937.131795.531173522750.qpush@concordia> Message-ID: <20060110025919.DCF11689C5@ozlabs.org> This patch adds Kconfig entries to control the early debugging options, currently in setup_64.c. Doing this via Kconfig rather than #defines means you can have one source tree, which is buildable for multiple platforms - and you can enable the correct early debug option for each platform via .config. I made udbg_early_init() a static inline because otherwise GCC is to daft to optimise it away when debugging is off. Now that we have udbg_init_rtas() we can make call_rtas_display_status* static. Signed-off-by: Michael Ellerman --- arch/powerpc/Kconfig.debug | 42 +++++++++++++++++++++++++++++++++++++++++ arch/powerpc/kernel/rtas.c | 10 +++++++-- arch/powerpc/kernel/setup_64.c | 38 +------------------------------------ arch/powerpc/kernel/udbg.c | 1 include/asm-powerpc/rtas.h | 1 include/asm-powerpc/udbg.h | 41 +++++++++++++++++++++++++++++++++++++++- 6 files changed, 93 insertions(+), 40 deletions(-) Index: linux/arch/powerpc/Kconfig.debug =================================================================== --- linux.orig/arch/powerpc/Kconfig.debug +++ linux/arch/powerpc/Kconfig.debug @@ -115,4 +115,46 @@ config PPC_OCP depends on IBM_OCP || XILINX_OCP default y +choice + prompt "Early debugging (dangerous)" + bool + optional + help + Enable early debugging. Careful, if you enable debugging for the + wrong type of machine your kernel _will not boot_. + +config PPC_EARLY_DEBUG_LPAR + bool "LPAR HV Console" + depends on PPC_PSERIES + help + Select this to enable early debugging for a machine with a HVC + console on vterm 0. + +config PPC_EARLY_DEBUG_G5 + bool "Apple G5" + depends on PPC_PMAC64 + help + Select this to enable early debugging for Apple G5 machines. + +config PPC_EARLY_DEBUG_RTAS + bool "RTAS Panel" + depends on PPC_RTAS + help + Select this to enable early debugging via the RTAS panel. + +config PPC_EARLY_DEBUG_MAPLE + bool "Maple real mode" + depends on PPC_MAPLE + help + Select this to enable early debugging for Maple. + +config PPC_EARLY_DEBUG_ISERIES + bool "iSeries HV Console" + depends on PPC_ISERIES + help + Select this to enable early debugging for legacy iSeries. You need + to hit "Ctrl-x Ctrl-x" to see the messages on the console. + +endchoice + endmenu Index: linux/arch/powerpc/kernel/rtas.c =================================================================== --- linux.orig/arch/powerpc/kernel/rtas.c +++ linux/arch/powerpc/kernel/rtas.c @@ -29,6 +29,7 @@ #include #include #include +#include struct rtas_t rtas = { .lock = SPIN_LOCK_UNLOCKED @@ -52,7 +53,7 @@ EXPORT_SYMBOL(rtas_flash_term_hook); * are designed only for very early low-level debugging, which * is why the token is hard-coded to 10. */ -void call_rtas_display_status(unsigned char c) +static void call_rtas_display_status(char c) { struct rtas_args *args = &rtas.args; unsigned long s; @@ -72,7 +73,7 @@ void call_rtas_display_status(unsigned c spin_unlock_irqrestore(&rtas.lock, s); } -void call_rtas_display_status_delay(unsigned char c) +static void call_rtas_display_status_delay(char c) { static int pending_newline = 0; /* did last write end with unprinted newline? */ static int width = 16; @@ -96,6 +97,11 @@ void call_rtas_display_status_delay(unsi } } +void udbg_init_rtas(void) +{ + udbg_putc = call_rtas_display_status_delay; +} + void rtas_progress(char *s, unsigned short hex) { struct device_node *root; Index: linux/arch/powerpc/kernel/setup_64.c =================================================================== --- linux.orig/arch/powerpc/kernel/setup_64.c +++ linux/arch/powerpc/kernel/setup_64.c @@ -70,37 +70,6 @@ #define DBG(fmt...) #endif -/* - * Here are some early debugging facilities. You can enable one - * but your kernel will not boot on anything else if you do so - */ - -/* For use on LPAR machines that support an HVC console on vterm 0 */ -extern void udbg_init_debug_lpar(void); - -/* This one is for use on Apple G5 machines */ -extern void udbg_init_pmac_realmode(void); - -/* That's RTAS panel debug */ -extern void call_rtas_display_status_delay(unsigned char c); - -/* Here's maple real mode debug */ -extern void udbg_init_maple_realmode(void); - -/* For iSeries - hit Ctrl-x Ctrl-x to see the output */ -extern void udbg_init_iseries(void); - -#define EARLY_DEBUG_INIT() do {} while(0) - -#if 0 -#define EARLY_DEBUG_INIT() udbg_init_debug_lpar() -#define EARLY_DEBUG_INIT() udbg_init_iseries() -#define EARLY_DEBUG_INIT() udbg_init_maple_realmode() -#define EARLY_DEBUG_INIT() udbg_init_pmac_realmode() -#define EARLY_DEBUG_INIT() \ - do { udbg_putc = call_rtas_display_status_delay; } while(0) -#endif - int have_of = 1; int boot_cpuid = 0; int boot_cpuid_phys = 0; @@ -241,11 +210,8 @@ void __init early_setup(unsigned long dt struct paca_struct *lpaca = get_paca(); static struct machdep_calls **mach; - /* - * Enable early debugging if any specified (see top of - * this file) - */ - EARLY_DEBUG_INIT(); + /* Enable early debugging if any specified (see udbg.h) */ + udbg_early_init(); DBG(" -> early_setup()\n"); Index: linux/arch/powerpc/kernel/udbg.c =================================================================== --- linux.orig/arch/powerpc/kernel/udbg.c +++ linux/arch/powerpc/kernel/udbg.c @@ -15,6 +15,7 @@ #include #include #include +#include void (*udbg_putc)(char c); int (*udbg_getc)(void); Index: linux/include/asm-powerpc/udbg.h =================================================================== --- linux.orig/include/asm-powerpc/udbg.h +++ linux/include/asm-powerpc/udbg.h @@ -1,5 +1,5 @@ /* - * c 2001 PPC 64 Team, IBM Corp + * (c) 2001, 2006 IBM Corporation. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -35,5 +35,44 @@ extern void udbg_scc_init(int force_scc) extern int udbg_adb_init(int force_btext); extern void udbg_adb_init_early(void); +extern void udbg_init_debug_lpar(void); +extern void udbg_init_pmac_realmode(void); +extern void udbg_init_maple_realmode(void); +extern void udbg_init_iseries(void); +extern void udbg_init_rtas(void); + +/* + * Early debugging facilities. You can enable _one_ of these, but if you do so + * your kernel _will not boot_ on anything else. Be careful. + */ +static inline void udbg_early_init(void) +{ +#if defined(CONFIG_PPC_EARLY_DEBUG_LPAR) + + /* For LPAR machines that have an HVC console on vterm 0 */ + udbg_init_debug_lpar(); + +#elif defined(CONFIG_PPC_EARLY_DEBUG_G5) + + /* For use on Apple G5 machines */ + udbg_init_pmac_realmode(); + +#elif defined(CONFIG_PPC_EARLY_DEBUG_RTAS) + + /* RTAS panel debug */ + udbg_init_rtas(); + +#elif defined(CONFIG_PPC_EARLY_DEBUG_MAPLE) + + /* Maple real mode debug */ + udbg_init_maple_realmode(); + +#elif defined(CONFIG_PPC_EARLY_DEBUG_ISERIES) + + /* For iSeries - hit Ctrl-x Ctrl-x to see the output */ + udbg_init_iseries(); +#endif +} + #endif /* __KERNEL__ */ #endif /* _ASM_POWERPC_UDBG_H */ Index: linux/include/asm-powerpc/rtas.h =================================================================== --- linux.orig/include/asm-powerpc/rtas.h +++ linux/include/asm-powerpc/rtas.h @@ -161,7 +161,6 @@ extern struct rtas_t rtas; extern void enter_rtas(unsigned long); extern int rtas_token(const char *service); extern int rtas_call(int token, int, int, int *, ...); -extern void call_rtas_display_status(unsigned char); extern void rtas_restart(char *cmd); extern void rtas_power_off(void); extern void rtas_halt(void); From benh at kernel.crashing.org Tue Jan 10 14:50:37 2006 From: benh at kernel.crashing.org (Benjamin Herrenschmidt) Date: Tue, 10 Jan 2006 14:50:37 +1100 Subject: [PATCH] powerpc: Extended PCI config space Message-ID: <1136865037.5069.9.camel@localhost.localdomain> This adds back the call to pci_cfg_space_size() when building the PCI tree from OF nodes that was commented out due to the function not being exported by the PCI code. It's now exported, so let's use it. Signed-off-by: Benjamin Herrenschmidt diff -urN linux-2.6/arch/powerpc/kernel/pci_64.c linux-work/arch/powerpc/kernel/pci_64.c --- linux-2.6/arch/powerpc/kernel/pci_64.c 2006-01-10 11:40:15.000000000 +1100 +++ linux-work/arch/powerpc/kernel/pci_64.c 2005-12-19 16:13:38.000000000 +1100 @@ -381,7 +381,7 @@ dev->subsystem_vendor = get_int_prop(node, "subsystem-vendor-id", 0); dev->subsystem_device = get_int_prop(node, "subsystem-id", 0); - dev->cfg_size = 256; /*pci_cfg_space_size(dev);*/ + dev->cfg_size = pci_cfg_space_size(dev); sprintf(pci_name(dev), "%04x:%02x:%02x.%d", pci_domain_nr(bus), dev->bus->number, PCI_SLOT(devfn), PCI_FUNC(devfn)); From paulus at samba.org Tue Jan 10 16:14:50 2006 From: paulus at samba.org (Paul Mackerras) Date: Tue, 10 Jan 2006 16:14:50 +1100 Subject: [PATCH]: powerpc janitorial: remove lint warning message In-Reply-To: <20060109223343.GK26221@austin.ibm.com> References: <20060109223343.GK26221@austin.ibm.com> Message-ID: <17347.17098.780201.391204@cargo.ozlabs.ibm.com> linas writes: > Remove annoying compile-time warning. > > Signed-off-by: Linas Vepstas > > Index: linux-2.6.15-mm1/drivers/char/hvcs.c > =================================================================== > --- linux-2.6.15-mm1.orig/drivers/char/hvcs.c 2006-01-05 16:44:04.000000000 -0600 > +++ linux-2.6.15-mm1/drivers/char/hvcs.c 2006-01-09 16:17:36.454497065 -0600 > @@ -438,7 +438,6 @@ > char buf[HVCS_BUFF_LEN] __ALIGNED__; > unsigned long flags; > int got = 0; > - int i; AFAICS the i variable is used on line 463... Paul. From paulus at samba.org Tue Jan 10 16:56:32 2006 From: paulus at samba.org (Paul Mackerras) Date: Tue, 10 Jan 2006 16:56:32 +1100 Subject: please pull powerpc-merge.git Message-ID: <17347.19600.717149.791505@cargo.ozlabs.ibm.com> Linus, Please pull git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc-merge.git The main thing in there this time is the series of patches from Linas Vepstas implementing PCI error recovery on recent pSeries machines using the "Extended Error Handling" (EEH) infrastructure provided by the platform. Thanks, Paul. arch/powerpc/Kconfig | 11 + arch/powerpc/kernel/Makefile | 2 arch/powerpc/kernel/pci_64.c | 2 arch/powerpc/kernel/ppc_ksyms.c | 1 arch/powerpc/kernel/rtas_pci.c | 2 arch/powerpc/kernel/setup_32.c | 2 arch/powerpc/kernel/setup_64.c | 2 arch/powerpc/kernel/sys_ppc32.c | 24 - arch/powerpc/kernel/systbl.S | 6 arch/powerpc/mm/pgtable_64.c | 2 arch/powerpc/platforms/maple/setup.c | 3 arch/powerpc/platforms/pseries/Makefile | 2 arch/powerpc/platforms/pseries/eeh.c | 489 +++++++-------------------- arch/powerpc/platforms/pseries/eeh_cache.c | 316 +++++++++++++++++ arch/powerpc/platforms/pseries/eeh_driver.c | 376 +++++++++++++++++++++ arch/powerpc/platforms/pseries/eeh_event.c | 39 +- drivers/ide/pci/via82cxxx.c | 2 include/asm-powerpc/eeh.h | 8 include/asm-powerpc/eeh_event.h | 7 include/asm-powerpc/pci-bridge.h | 9 include/asm-powerpc/ppc-pci.h | 23 + include/asm-powerpc/serial.h | 4 22 files changed, 896 insertions(+), 436 deletions(-) create mode 100644 arch/powerpc/platforms/pseries/eeh_cache.c create mode 100644 arch/powerpc/platforms/pseries/eeh_driver.c Benjamin Herrenschmidt: powerpc: Extended PCI config space David Woodhouse: powerpc: Some ppc compile fixes... linas: powerpc/pseries: dlpar-add crash on null pointer deref Linas Vepstas: powerpc: PCI Error Recovery: PPC64 core recovery routines powerpc: Split out PCI address cache to its own file powerpc: Add "partitionable endpoint" support powerpc: remove bogus printk powerpc: Remove duplicate code powerpc: bugfix: fill in uninitialized field powerpc: Use PE configuration address consistently powerpc: set up the RTAS token just like the rest of them. powerpc: Don't continue with PCI Error recovery if slot reset failed. powerpc: handle multifunction PCI devices properly powerpc: IOMMU: don't ioremap null addresses powerpc: Save device BARs much earlier in the boot sequence powerpc: get rid of per_cpu EEH counters Paul Mackerras: powerpc: Fix up some compile errors in the PCI error recovery code powerpc: Introduce a new config symbol to control 16550 early debug code Stephen Rothwell: powerpc: remove compat_sys_pciconfig_* From benh at kernel.crashing.org Tue Jan 10 17:08:20 2006 From: benh at kernel.crashing.org (Benjamin Herrenschmidt) Date: Tue, 10 Jan 2006 17:08:20 +1100 Subject: time runs too slow on maple In-Reply-To: <20060109224420.GL26221@austin.ibm.com> References: <20060109161348.GA1267@suse.de> <20060109165328.GG26221@austin.ibm.com> <20060109171204.GA3608@suse.de> <20060109224420.GL26221@austin.ibm.com> Message-ID: <1136873300.5069.25.camel@localhost.localdomain> On Mon, 2006-01-09 at 16:44 -0600, linas wrote: > arch/powerpc/kernel/smp-tbsync.c: smp_generic_give_timebase() > > leads me to think that the maple board has a clock with a > huge amount of jitter, its bouncing all over the place. > However, the smp_generic_give_timebase() isn't taking any > averages that would smooth out the jitter; instead, it locks > onto some random value and uses that. > > I might be able to hack some averaging into that chunk of code, > but I don't know this stuff, not sure if that would be the right fix. We don't know if the problem has anything to do with the SMP tbsync. You are certainly welcome to improve that code, but the root of the problem is probably that the timebase calibration that we obtain from Open Firmware is not precise. Either that, or the clock is indeed not very stable (that would be bad). The first one could be worked around by doing some proper calibration and updating PIBS I suppose. ben. From olh at suse.de Tue Jan 10 18:17:02 2006 From: olh at suse.de (Olaf Hering) Date: Tue, 10 Jan 2006 08:17:02 +0100 Subject: time runs too slow on maple In-Reply-To: <1136873300.5069.25.camel@localhost.localdomain> References: <20060109161348.GA1267@suse.de> <20060109165328.GG26221@austin.ibm.com> <20060109171204.GA3608@suse.de> <20060109224420.GL26221@austin.ibm.com> <1136873300.5069.25.camel@localhost.localdomain> Message-ID: <20060110071702.GA28621@suse.de> On Tue, Jan 10, Benjamin Herrenschmidt wrote: > We don't know if the problem has anything to do with the SMP tbsync. You > are certainly welcome to improve that code, but the root of the problem > is probably that the timebase calibration that we obtain from Open > Firmware is not precise. Either that, or the clock is indeed not very > stable (that would be bad). The first one could be worked around by > doing some proper calibration and updating PIBS I suppose. It has firmware 1.06. Does it really work on your board? Just wondering if only my board goes slower. -- short story of a lazy sysadmin: alias appserv=wotan From benh at kernel.crashing.org Tue Jan 10 23:17:53 2006 From: benh at kernel.crashing.org (Benjamin Herrenschmidt) Date: Tue, 10 Jan 2006 23:17:53 +1100 Subject: time runs too slow on maple In-Reply-To: <20060110071702.GA28621@suse.de> References: <20060109161348.GA1267@suse.de> <20060109165328.GG26221@austin.ibm.com> <20060109171204.GA3608@suse.de> <20060109224420.GL26221@austin.ibm.com> <1136873300.5069.25.camel@localhost.localdomain> <20060110071702.GA28621@suse.de> Message-ID: <1136895474.10235.10.camel@localhost.localdomain> On Tue, 2006-01-10 at 08:17 +0100, Olaf Hering wrote: > On Tue, Jan 10, Benjamin Herrenschmidt wrote: > > > We don't know if the problem has anything to do with the SMP tbsync. You > > are certainly welcome to improve that code, but the root of the problem > > is probably that the timebase calibration that we obtain from Open > > Firmware is not precise. Either that, or the clock is indeed not very > > stable (that would be bad). The first one could be worked around by > > doing some proper calibration and updating PIBS I suppose. > > It has firmware 1.06. Does it really work on your board? Just wondering > if only my board goes slower. Dunno, my board seems dead unfortunatly :( Ben. From vgoyal at in.ibm.com Tue Jan 10 18:04:22 2006 From: vgoyal at in.ibm.com (Vivek Goyal) Date: Tue, 10 Jan 2006 12:34:22 +0530 Subject: [PATCH] kdump: vmcore compilation warning fix Message-ID: <20060110070422.GB5003@in.ibm.com> o fs/proc/vmcore.c compilation gives warnings on ppc64. The reason being that u64 is defined as unsigned long hence u64* is not same as loff_t* and compiler cribs. o Changed the parameter type to u64* instead of loff_t* to resolve the conflict. Signed-off-by: Vivek Goyal --- diff -puN fs/proc/vmcore.c~ppc64-vmcore-compilation-warning-fix fs/proc/vmcore.c --- linux-2.6.15-mm2-1M/fs/proc/vmcore.c~ppc64-vmcore-compilation-warning-fix 2006-01-09 06:59:06.000000000 -0800 +++ linux-2.6.15-mm2-1M-root/fs/proc/vmcore.c 2006-01-09 07:37:06.000000000 -0800 @@ -42,7 +42,7 @@ struct proc_dir_entry *proc_vmcore = NUL /* Reads a page from the oldmem device from given offset. */ static ssize_t read_from_oldmem(char *buf, size_t count, - loff_t *ppos, int userbuf) + u64 *ppos, int userbuf) { unsigned long pfn, offset; size_t nr_bytes; _ From millman at us.ibm.com Wed Jan 11 00:59:46 2006 From: millman at us.ibm.com (Steve Millman) Date: Tue, 10 Jan 2006 08:59:46 -0500 Subject: JS-20 and generic kernel 2.6.13.3 In-Reply-To: <200601091927.k09JRxo9024799@falcon30.maxeymade.com> Message-ID: Hi Doug, I didn't see this post make the mailing list, so I'm mailing it again. Apologies to all who have already seen it. I tried running both mkinitrd -f /boot/initrd-2.6.13.3.img 2.6.13.3 and mkinitrd -f --omit-scsi-modules /boot/initrd-2.6.13.3.img 2.6.13.3 . I'm not sure why I had to run either of these when I had previously run make install to install the kernel and it already built a initrd file, but I did it anyway to experiment. Thanks, Steve Millman Doug Maxey 01/09/2006 02:27 PM To: Steve Millman/Watson/IBM at IBMUS cc: linuxppc64-dev at ozlabs.org Subject: Re: JS-20 and generic kernel 2.6.13.3 On Mon, 09 Jan 2006 13:21:38 EST, Steve Millman wrote: >Hi, >I have downloaded and compiled the generic Linux kernel 2.6.13.3 for my >JS-20 PPC IBM BladeServer. When I attempt to boot the new kernel I get >the following output. Has anyone successfully tried to run the generic >2.6.13.3 kernel on a JS-20 or have any idea what I am doing wrong? As a >word of caution, I am a Kernel newbie, so I might have done, or omitted >something stupid. > >boot: newlinux >Please wait, loading kernel... > Elf64 kernel loaded... >Loading ramdisk... >ramdisk loaded at 02300000, size: 1563 Kbytes >OF stdout device is: /vdevice/vty at 0 >Hypertas detected, assuming LPAR ! >command line: root=/dev/VolGroup00/LogVol00 ro console=hvc0 rhgb quiet >memory layout at init: > memory_limit : 0000000000000000 (16 MB aligned) > alloc_bottom : 0000000002487000 > alloc_top : 0000000008000000 > alloc_top_hi : 000000001e000000 > rmo_top : 0000000008000000 > ram_top : 000000001e000000 >Looking for displays >instantiating rtas at 0x0000000007a70000 ...rtas_ram_size = 2c8000 >fixed_base_addr = 7a70000 >code_base_addr = 7afa000 >Code Image Load Complete. >registered vars: >name addr size hash align >-------------------------------- ---------------- ---- ---- ----- >glob_rtas_trace_buf : 0000000007ab9100 65552 7 0 >prtas_was_interrupted : 0000000007aca100 4 9 1 >callperf : 0000000007aca400 12496 9 1 >pglob_os_term_state : 0000000007acd700 4 12 1 >hypStopWatch : 0000000007ac9400 1800 14 8 >prtas_in_progress : 0000000007ac9e00 4 20 1 >last_error_log : 0000000007acdc00 1024 30 0 >nmi_work_buffer : 0000000007ace000 4096 31 12 > done >0000000000000000 : boot cpu 0000000000000000 >0000000000000001 : starting cpu hw idx 0000000000000001... done >copying OF device tree ... >Building dt strings... >Building dt structure... >Device tree strings 0x0000000002788000 -> 0x0000000002788e7b >Device tree struct 0x0000000002789000 -> 0x000000000278f000 >Calling quiesce ... >returning from prom_init >Found initrd at 0xc000000002300000:0xc000000002486c00 >firmware_features = 0x55f >Starting Linux PPC64 2.6.13.3 >----------------------------------------------------- >ppc64_pft_size = 0x17 >ppc64_debug_switch = 0x0 >ppc64_interrupt_controller = 0x2 >systemcfg = 0xc0000000003d0000 >systemcfg->platform = 0x101 >systemcfg->processorCount = 0x2 >systemcfg->physicalMemorySize = 0x1e000000 >ppc64_caches.dcache_line_size = 0x80 >ppc64_caches.icache_line_size = 0x80 >htab_address = 0x0000000000000000 >htab_hash_mask = 0xffff >----------------------------------------------------- >[boot]0100 MM Init >[boot]0100 MM Init Done >Linux version 2.6.13.3 (root at dyn9002211199.watson.ibm.com) (gcc version >3.4.3 20 >041212 (Red Hat 3.4.3-9.EL4)) #1 SMP Wed Jan 4 14:50:45 EST 2006 >[boot]0012 Setup Arch >Top of RAM: 0x1e000000, Total RAM: 0x1e000000 >Memory hole size: 0MB >Syscall map setup, 246 32 bits and 222 64 bits syscalls >PPC64 nvram contains 16384 bytes >Using default idle loop >[boot]0015 Setup Done >Built 1 zonelists >Kernel command line: root=/dev/VolGroup00/LogVol00 ro console=hvc0 rhgb >quiet >scan-log-dump not implemented on this system >Red Hat nash version 4.1.18 starting >Unable to find device-mapper major/minor >File descriptor 3 left open > Reading all physical volumes. This may take a while... >File descriptor 3 left open >File descriptor 3 left open > Found volume group "VolGroup00" using metadata type lvm2 > /dev/mapper/control: open failed: No such file or directorymount: error >6 moun >ting ext3 >mount: error 2 mountin >system:blade[7]> You did run mkinitrd after installing the kernel, correct? ++doug -------------- next part -------------- An HTML attachment was scrubbed... URL: http://ozlabs.org/pipermail/linuxppc64-dev/attachments/20060110/e7851763/attachment.htm From olh at suse.de Wed Jan 11 01:19:25 2006 From: olh at suse.de (Olaf Hering) Date: Tue, 10 Jan 2006 15:19:25 +0100 Subject: [PATCH 2/2] PCI Hotplug/powerpc: more removal of duplicated code In-Reply-To: <20051202005957.GP31651@austin.ibm.com> References: <20051202005614.GO31651@austin.ibm.com> <20051202005957.GP31651@austin.ibm.com> Message-ID: <20060110141925.GA10052@suse.de> On Thu, Dec 01, Linas Vepstas wrote: > The RPAPHP code contains two routines that appear to be gratuitous copies > of very similar pci code. In particular, > > rpaphp_claim_resource ~~ pci_claim_resource > (there is a minor, non-functional difference) > > rpadlpar_claim_one_bus == pcibios_claim_one_bus > (the code is identical) > > This patch removes the rpaphp versions of the code. The generic functions are not exported. Current Linus tree gives, with arch/powerpc/configs/ppc64_defconfig: 2.6.15-git6/kernel/drivers/pci/hotplug/rpaphp.ko needs unknown symbol pci_claim_resource 2.6.15-git6/kernel/drivers/pci/hotplug/rpadlpar_io.ko needs unknown symbol pcibios_claim_one_bus -- short story of a lazy sysadmin: alias appserv=wotan From brian.jewell at themis.com Wed Jan 11 03:04:58 2006 From: brian.jewell at themis.com (brian jewell) Date: Tue, 10 Jan 2006 08:04:58 -0800 Subject: time runs too slow on maple In-Reply-To: <20060110071702.GA28621@suse.de> Message-ID: FYI: I have seen the real-time clock issue on the Maple board I am using for development. As was pointed out in a previous email on this subject, it almost as if the clock stops running when the board is powered off. But, the loss of clock accuracy is also noticeable if the Maple board is left to run for extended periods of time. --Brian -----Original Message----- From: linuxppc64-dev-bounces at ozlabs.org [mailto:linuxppc64-dev-bounces at ozlabs.org]On Behalf Of Olaf Hering Sent: Monday, January 09, 2006 11:17 PM To: Benjamin Herrenschmidt Cc: linuxppc64-dev at ozlabs.org Subject: Re: time runs too slow on maple On Tue, Jan 10, Benjamin Herrenschmidt wrote: > We don't know if the problem has anything to do with the SMP tbsync. You > are certainly welcome to improve that code, but the root of the problem > is probably that the timebase calibration that we obtain from Open > Firmware is not precise. Either that, or the clock is indeed not very > stable (that would be bad). The first one could be worked around by > doing some proper calibration and updating PIBS I suppose. It has firmware 1.06. Does it really work on your board? Just wondering if only my board goes slower. -- short story of a lazy sysadmin: alias appserv=wotan _______________________________________________ Linuxppc64-dev mailing list Linuxppc64-dev at ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc64-dev From olh at suse.de Wed Jan 11 03:26:17 2006 From: olh at suse.de (Olaf Hering) Date: Tue, 10 Jan 2006 17:26:17 +0100 Subject: time runs too slow on maple In-Reply-To: References: <20060110071702.GA28621@suse.de> Message-ID: <20060110162617.GA13815@suse.de> On Tue, Jan 10, brian jewell wrote: > > FYI: I have seen the real-time clock issue on the Maple board I am using for development. As was pointed out in a previous email on this subject, it almost as if the clock stops running when the board is powered off. But, the loss of clock accuracy is also noticeable if the Maple board is left to run for extended periods of time. Can you verify this by stopping ntpd and run while true ; do ntpdate time.apple.com ; date ; hwclock ; done hwclock will likely continue normal date will show the loss of time and ntpdate will show the increasing difference. I wonder why noone else has seen that. -- short story of a lazy sysadmin: alias appserv=wotan From maule at sgi.com Wed Jan 11 04:00:32 2006 From: maule at sgi.com (Mark Maule) Date: Tue, 10 Jan 2006 11:00:32 -0600 Subject: [PATCH 0/3] msi abstractions and support for altix In-Reply-To: <20060103060719.GA1845@suse.de> References: <20051222201651.2019.37913.96422@lnx-maule.americas.sgi.com> <20051222202259.GA4959@suse.de> <20051222202627.GI17552@sgi.com> <20051222203415.GA28240@suse.de> <20051222203824.GJ17552@sgi.com> <20051222205023.GK2361@parisc-linux.org> <20060103032249.GA4957@sgi.com> <20060103060719.GA1845@suse.de> Message-ID: <20060110170032.GC18399@sgi.com> On Mon, Jan 02, 2006 at 10:07:19PM -0800, Greg KH wrote: > On Mon, Jan 02, 2006 at 09:22:49PM -0600, Mark Maule wrote: > > On Thu, Dec 22, 2005 at 01:50:23PM -0700, Matthew Wilcox wrote: > > > On Thu, Dec 22, 2005 at 02:38:24PM -0600, Mark Maule wrote: > > > > Because on ia64 IA64_FIRST_DEVICE_VECTOR and IA64_LAST_DEVICE_VECTOR > > > > (from which MSI FIRST_DEVICE_VECTOR/LAST_DEVICE_VECTOR are derived) are not > > > > constants. The are now global variables (see change to asm-ia64/hw_irq.h) > > > > to allow the platform to override them. Altix uses a reduced range of > > > > vectors for devices, and this change was necessary to make assign_irq_vector() > > > > to work on altix. > > > > > > To be honest, I think this is just adding a third layer of paper over > > > the crack in the wall. The original code assumed x86; the ia64 port > > > added enough emulation to make it look like x86 and now altix fixes a > > > couple of assumptions. I say: bleh. > > > > > > What we actually need is an interface provided by the architecture that > > > allocates a new irq. I have a hankering to implement MSI on PA-RISC but > > > haven't found the time ... > > > > Matt, Greg, et. al: > > > > Did you guys have something in mind for a vector allocation interface? It > > seems to me that assign_irq_vector() more or less does what we want, > > but what is missing is a way for the platform to prime which vectors > > are available to choose from. > > > > One possibly better solution would be to call something in the init_IRQ path > > that would set up the vector pool available to assign_irq_vector(). > > > > Any opinions on this? I would maintain that this effort should be done > > independently of this patchset. > > Care to write a patch showing how this would work? > > And why would this be independant of your other changes? > > thanks, > > greg k-h Ok, looks like it's going to be a bit until I have time to work on the vector allocation stuff. In the mean time, would folks be recepteive to taking this portion of the initial patchset: [PATCH 1/4] msi archetecture init hook http://lkml.org/lkml/2005/12/21/168 This would at least give us a graceful pci_enable_msi() failure on altix until I find the time to work on the other stuff. Mark From hch at infradead.org Wed Jan 11 04:03:39 2006 From: hch at infradead.org (Christoph Hellwig) Date: Tue, 10 Jan 2006 17:03:39 +0000 Subject: [PATCH 0/3] msi abstractions and support for altix In-Reply-To: <20060110170032.GC18399@sgi.com> References: <20051222201651.2019.37913.96422@lnx-maule.americas.sgi.com> <20051222202259.GA4959@suse.de> <20051222202627.GI17552@sgi.com> <20051222203415.GA28240@suse.de> <20051222203824.GJ17552@sgi.com> <20051222205023.GK2361@parisc-linux.org> <20060103032249.GA4957@sgi.com> <20060103060719.GA1845@suse.de> <20060110170032.GC18399@sgi.com> Message-ID: <20060110170339.GA2567@infradead.org> > Ok, looks like it's going to be a bit until I have time to work on the > vector allocation stuff. > > In the mean time, would folks be recepteive to taking this portion of the > initial patchset: > > [PATCH 1/4] msi archetecture init hook > http://lkml.org/lkml/2005/12/21/168 > > This would at least give us a graceful pci_enable_msi() failure on altix > until I find the time to work on the other stuff. Personally I think your patchkit should just go in after all the other comments have addresses [1]. It's a huge improvement over the mess that's there currently. [1] I don't remember if you posted a patchkit addressing everything else yet, so maybe it's been done already. From greg at kroah.com Wed Jan 11 04:11:02 2006 From: greg at kroah.com (Greg KH) Date: Tue, 10 Jan 2006 09:11:02 -0800 Subject: [PATCH 0/3] msi abstractions and support for altix In-Reply-To: <20060110170339.GA2567@infradead.org> References: <20051222201651.2019.37913.96422@lnx-maule.americas.sgi.com> <20051222202259.GA4959@suse.de> <20051222202627.GI17552@sgi.com> <20051222203415.GA28240@suse.de> <20051222203824.GJ17552@sgi.com> <20051222205023.GK2361@parisc-linux.org> <20060103032249.GA4957@sgi.com> <20060103060719.GA1845@suse.de> <20060110170032.GC18399@sgi.com> <20060110170339.GA2567@infradead.org> Message-ID: <20060110171102.GA13239@kroah.com> On Tue, Jan 10, 2006 at 05:03:39PM +0000, Christoph Hellwig wrote: > > Ok, looks like it's going to be a bit until I have time to work on the > > vector allocation stuff. > > > > In the mean time, would folks be recepteive to taking this portion of the > > initial patchset: > > > > [PATCH 1/4] msi archetecture init hook > > http://lkml.org/lkml/2005/12/21/168 > > > > This would at least give us a graceful pci_enable_msi() failure on altix > > until I find the time to work on the other stuff. > > Personally I think your patchkit should just go in after all the other > comments have addresses [1]. It's a huge improvement over the mess that's > there currently. Yes, please repost your patches with all of the comments addressed and we can look at it from there... thanks, greg k-h From brian.jewell at themis.com Wed Jan 11 07:15:45 2006 From: brian.jewell at themis.com (brian jewell) Date: Tue, 10 Jan 2006 12:15:45 -0800 Subject: time runs too slow on maple In-Reply-To: <20060110162617.GA13815@suse.de> Message-ID: Olaf, When I run ntpdate, I get the following: > ntpdate time.apple.com 16 Jan 00:31:56 ntpdate[1177]: Can't adjust the time of day: Invalid argument Any ideas? Thanks. --Brian -----Original Message----- From: Olaf Hering [mailto:olh at suse.de] Sent: Tuesday, January 10, 2006 8:26 AM To: brian jewell Cc: Benjamin Herrenschmidt; linuxppc64-dev at ozlabs.org Subject: Re: time runs too slow on maple On Tue, Jan 10, brian jewell wrote: > > FYI: I have seen the real-time clock issue on the Maple board I am using for development. As was pointed out in a previous email on this subject, it almost as if the clock stops running when the board is powered off. But, the loss of clock accuracy is also noticeable if the Maple board is left to run for extended periods of time. Can you verify this by stopping ntpd and run while true ; do ntpdate time.apple.com ; date ; hwclock ; done hwclock will likely continue normal date will show the loss of time and ntpdate will show the increasing difference. I wonder why noone else has seen that. -- short story of a lazy sysadmin: alias appserv=wotan From linas at austin.ibm.com Wed Jan 11 08:15:47 2006 From: linas at austin.ibm.com (linas) Date: Tue, 10 Jan 2006 15:15:47 -0600 Subject: [PATCH 1/2] PCI Hotplug/powerpc: module build break In-Reply-To: <20060110141925.GA10052@suse.de> References: <20051202005614.GO31651@austin.ibm.com> <20051202005957.GP31651@austin.ibm.com> <20060110141925.GA10052@suse.de> Message-ID: <20060110211547.GM26221@austin.ibm.com> Greg, please apply and forward upstream; --linas The RPAPHP hoplug driver will not build as a module, because it calls on pci_claim_resource(), which is not exported. This exports the symbol. Problem reported by Olaf Hering A grep indicates that building drivers/parisc/lba_pci.c would have trouble building as a module for the same reason. Signed-off-by: Linas Vepstas Index: linux-2.6.15-git6/drivers/pci/setup-res.c =================================================================== --- linux-2.6.15-git6.orig/drivers/pci/setup-res.c 2006-01-10 15:02:48.000000000 -0600 +++ linux-2.6.15-git6/drivers/pci/setup-res.c 2006-01-10 15:09:45.547803640 -0600 @@ -112,6 +112,7 @@ return err; } +EXPORT_SYMBOL_GPL(pci_claim_resource); int pci_assign_resource(struct pci_dev *dev, int resno) { From linas at austin.ibm.com Wed Jan 11 08:18:16 2006 From: linas at austin.ibm.com (linas) Date: Tue, 10 Jan 2006 15:18:16 -0600 Subject: [PATCH 2/2] PCI Hotplug/powerpc: module build break In-Reply-To: <20060110141925.GA10052@suse.de> References: <20051202005614.GO31651@austin.ibm.com> <20051202005957.GP31651@austin.ibm.com> <20060110141925.GA10052@suse.de> Message-ID: <20060110211816.GN26221@austin.ibm.com> Paul, Please apply and send upsteam --linas The RPAPHP hoplug driver will not build as a module, because it calls on a pcibios routine which is not exported. This exports the symbol. Problem reported by Olaf Hering Signed-off-by: Linas Vepstas Index: linux-2.6.15-git6/arch/powerpc/kernel/pci_64.c =================================================================== --- linux-2.6.15-git6.orig/arch/powerpc/kernel/pci_64.c 2006-01-10 14:48:21.992353213 -0600 +++ linux-2.6.15-git6/arch/powerpc/kernel/pci_64.c 2006-01-10 15:05:22.751996060 -0600 @@ -271,6 +271,9 @@ list_for_each_entry(child_bus, &b->children, node) pcibios_claim_one_bus(child_bus); } +#ifdef CONFIG_HOTPLUG +EXPORT_SYMBOL_GPL(pcibios_claim_one_bus); +#endif #ifndef CONFIG_PPC_ISERIES static void __init pcibios_claim_of_setup(void) From matthew at wil.cx Wed Jan 11 08:37:37 2006 From: matthew at wil.cx (Matthew Wilcox) Date: Tue, 10 Jan 2006 14:37:37 -0700 Subject: [PATCH 1/2] PCI Hotplug/powerpc: module build break In-Reply-To: <20060110211547.GM26221@austin.ibm.com> References: <20051202005614.GO31651@austin.ibm.com> <20051202005957.GP31651@austin.ibm.com> <20060110141925.GA10052@suse.de> <20060110211547.GM26221@austin.ibm.com> Message-ID: <20060110213737.GA19769@parisc-linux.org> On Tue, Jan 10, 2006 at 03:15:47PM -0600, linas wrote: > A grep indicates that building drivers/parisc/lba_pci.c > would have trouble building as a module for the same reason. That's OK -- lba_pci is the driver for the PCI root bridge on a certain class of box. I suppose with an initrd it could theoretically be a module, but it's never been tested with that configuration. Kconfig has it as a bool. From linas at austin.ibm.com Wed Jan 11 08:51:56 2006 From: linas at austin.ibm.com (linas) Date: Tue, 10 Jan 2006 15:51:56 -0600 Subject: [PATCH]: powerpc janitorial: remove lint warning message In-Reply-To: <17347.17098.780201.391204@cargo.ozlabs.ibm.com> References: <20060109223343.GK26221@austin.ibm.com> <17347.17098.780201.391204@cargo.ozlabs.ibm.com> Message-ID: <20060110215156.GP26221@austin.ibm.com> On Tue, Jan 10, 2006 at 04:14:50PM +1100, Paul Mackerras was heard to remark: > linas writes: > > > Remove annoying compile-time warning. > > > > Index: linux-2.6.15-mm1/drivers/char/hvcs.c > > - int i; > > AFAICS the i variable is used on line 463... I now see that it is in the -git6 tree, but not in the -mm1 tree. Not sure whch is supposed to be the latest. --linas From jschopp at austin.ibm.com Wed Jan 11 09:31:21 2006 From: jschopp at austin.ibm.com (Joel Schopp) Date: Tue, 10 Jan 2006 16:31:21 -0600 Subject: PowerPC fastpaths for mutex subsystem In-Reply-To: <20060108094839.GA16887@elte.hu> References: <20060104144151.GA27646@elte.hu> <43BC5E15.207@austin.ibm.com> <20060105143502.GA16816@elte.hu> <43BD4C66.60001@austin.ibm.com> <20060105222106.GA26474@elte.hu> <43BDA672.4090704@austin.ibm.com> <20060106002919.GA29190@pb15.lixom.net> <43BFFF1D.7030007@austin.ibm.com> <20060108094839.GA16887@elte.hu> Message-ID: <43C435B9.5080409@austin.ibm.com> > interesting. Could you try two things? Firstly, could you add some > minimal delays to the lock/unlock path, of at least 1 usec? E.g. > "synchro-test.ko load=1 interval=1". [but you could try longer delays > too, 10 usecs is still realistic.] Graphs attached. The summary for those who don't like to look at attachments is that the mutex fastpath (threads 1) that I sent the optimized patch for is comparable within the margin of error to semaphores. The mutex common path (threads > 1) gets embarrassed by semaphores. So mutexes common paths are not yet ready as far as ppc64 is concerned. > > secondly, could you try the VFS creat+unlink test via the test-mutex.c > code below, with something like: > > ./test-mutex V 16 10 Queued into my todo list. > > thirdly, could you run 'vmstat 1' during the tests, and post those lines > too? Here i'm curious about two things: the average runqueue length > (whether we have overscheduling), and CPU utilization and idle time left > (how efficiently cycles are preserved in contention). [btw., does ppc > have an idle=poll equivalent mode of idling?] Also queued in my todo list. > > also, there seems to be some fluctuation in the numbers - could you try > to run a few more to see how stable the numbers are? For the graphs the line is the average of 5 runs, and the 5 runs are scatter plotted as well. -------------- next part -------------- A non-text attachment was scrubbed... Name: semvsmux2.png Type: image/png Size: 4536 bytes Desc: not available Url : http://ozlabs.org/pipermail/linuxppc64-dev/attachments/20060110/7582cd09/attachment.png -------------- next part -------------- A non-text attachment was scrubbed... Name: semvsmux3.png Type: image/png Size: 4471 bytes Desc: not available Url : http://ozlabs.org/pipermail/linuxppc64-dev/attachments/20060110/7582cd09/attachment-0001.png -------------- next part -------------- A non-text attachment was scrubbed... Name: semvsmux.png Type: image/png Size: 4805 bytes Desc: not available Url : http://ozlabs.org/pipermail/linuxppc64-dev/attachments/20060110/7582cd09/attachment-0002.png From arnd at arndb.de Wed Jan 11 10:48:46 2006 From: arnd at arndb.de (Arnd Bergmann) Date: Wed, 11 Jan 2006 00:48:46 +0100 Subject: [PATCH 00/13] spufs fixes and cleanups In-Reply-To: <43C416D4.9020500@am.sony.com> References: <20060104193120.050539000@localhost> <43C416D4.9020500@am.sony.com> Message-ID: <200601110048.46621.arnd@arndb.de> Am Dienstag, 10. Januar 2006 21:19 schrieb Geoff Levand: > I didn't see the fix I sent you (also below) to stop > DMA at spu context save in your latest patches. ?You > mentioned that Mark may cover that fix in his > preemptive scheduler work. ?Did he put it in a > routine called earlier? ?Please let me know. The preemptive scheduler is merged into mainline now and evidently did not fix this bug. I think I confused it with some other problem that is now fixed, thanks for reminding me. Paul, please apply this. > spufs: stop dma at context save. > > There is no code to suspend dma queue on context save. > SPE Book4 shows that context save's step8 is required to suspend dma > and save MFC_CNTL. > > Signed-off-by: Masato Noguchi > Signed-off-by: Geoff Levand Acked-by: Arnd Bergmann From michael at ellerman.id.au Wed Jan 11 11:54:08 2006 From: michael at ellerman.id.au (Michael Ellerman) Date: Wed, 11 Jan 2006 11:54:08 +1100 Subject: [PATCH 1/2] powerpc: Early debugging support for iSeries Message-ID: <1136940848.640959.661243623476.qpush@concordia> Connect iSeries up to the standard early debugging infrastructure. To actually use this you need to enable the iSeries early debugging in setup_64.c. Then after the messages are logged hit Ctrl-x Ctrl-x on your console to dump the Hypervisor console buffer. Signed-off-by: Michael Ellerman --- arch/powerpc/kernel/setup_64.c | 14 +++++++++----- arch/powerpc/platforms/iseries/setup.c | 18 +++++++++++++++--- drivers/char/viocons.c | 4 ++-- 3 files changed, 26 insertions(+), 10 deletions(-) Index: linux/arch/powerpc/kernel/setup_64.c =================================================================== --- linux.orig/arch/powerpc/kernel/setup_64.c +++ linux/arch/powerpc/kernel/setup_64.c @@ -75,22 +75,26 @@ * but your kernel will not boot on anything else if you do so */ -/* This one is for use on LPAR machines that support an HVC console - * on vterm 0 - */ +/* For use on LPAR machines that support an HVC console on vterm 0 */ extern void udbg_init_debug_lpar(void); -/* This one is for use on Apple G5 machines - */ + +/* This one is for use on Apple G5 machines */ extern void udbg_init_pmac_realmode(void); + /* That's RTAS panel debug */ extern void call_rtas_display_status_delay(unsigned char c); + /* Here's maple real mode debug */ extern void udbg_init_maple_realmode(void); +/* For iSeries - hit Ctrl-x Ctrl-x to see the output */ +extern void udbg_init_iseries(void); + #define EARLY_DEBUG_INIT() do {} while(0) #if 0 #define EARLY_DEBUG_INIT() udbg_init_debug_lpar() +#define EARLY_DEBUG_INIT() udbg_init_iseries() #define EARLY_DEBUG_INIT() udbg_init_maple_realmode() #define EARLY_DEBUG_INIT() udbg_init_pmac_realmode() #define EARLY_DEBUG_INIT() \ Index: linux/arch/powerpc/platforms/iseries/setup.c =================================================================== --- linux.orig/arch/powerpc/platforms/iseries/setup.c +++ linux/arch/powerpc/platforms/iseries/setup.c @@ -52,6 +52,7 @@ #include #include #include +#include #include "naca.h" #include "setup.h" @@ -62,10 +63,8 @@ #include "call_sm.h" #include "call_hpt.h" -extern void hvlog(char *fmt, ...); - #ifdef DEBUG -#define DBG(fmt...) hvlog(fmt) +#define DBG(fmt...) udbg_printf(fmt) #else #define DBG(fmt...) #endif @@ -984,3 +983,16 @@ static int __init early_parsemem(char *p return 0; } early_param("mem", early_parsemem); + +static void hvputc(char c) +{ + if (c == '\n') + hvputc('\r'); + + HvCall_writeLogBuffer(&c, 1); +} + +void __init udbg_init_iseries(void) +{ + udbg_putc = hvputc; +} Index: linux/drivers/char/viocons.c =================================================================== --- linux.orig/drivers/char/viocons.c +++ linux/drivers/char/viocons.c @@ -131,7 +131,7 @@ static void initDataEvent(struct viochar static struct tty_driver *viotty_driver; -void hvlog(char *fmt, ...) +static void hvlog(char *fmt, ...) { int i; unsigned long flags; @@ -147,7 +147,7 @@ void hvlog(char *fmt, ...) spin_unlock_irqrestore(&consoleloglock, flags); } -void hvlogOutput(const char *buf, int count) +static void hvlogOutput(const char *buf, int count) { unsigned long flags; int begin; From michael at ellerman.id.au Wed Jan 11 11:54:09 2006 From: michael at ellerman.id.au (Michael Ellerman) Date: Wed, 11 Jan 2006 11:54:09 +1100 Subject: [PATCH 2/2] powerpc: Make early debugging configurable via Kconfig In-Reply-To: <1136940848.640959.661243623476.qpush@concordia> Message-ID: <20060111005419.462DD689DF@ozlabs.org> This patch adds Kconfig entries to control the early debugging options, currently in setup_64.c. Doing this via Kconfig rather than #defines means you can have one source tree, which is buildable for multiple platforms - and you can enable the correct early debug option for each platform via .config. I made udbg_early_init() a static inline because otherwise GCC is to daft to optimise it away when debugging is off. Now that we have udbg_init_rtas() we can make call_rtas_display_status* static. Signed-off-by: Michael Ellerman --- arch/powerpc/Kconfig.debug | 42 +++++++++++++++++++++++++++++ arch/powerpc/kernel/rtas.c | 12 ++++++-- arch/powerpc/kernel/setup_64.c | 38 +------------------------- arch/powerpc/kernel/udbg.c | 25 +++++++++++++++++ arch/powerpc/kernel/udbg_16550.c | 2 - arch/powerpc/platforms/powermac/udbg_scc.c | 2 - include/asm-powerpc/rtas.h | 1 include/asm-powerpc/udbg.h | 9 +++++- 8 files changed, 88 insertions(+), 43 deletions(-) Index: linux/arch/powerpc/Kconfig.debug =================================================================== --- linux.orig/arch/powerpc/Kconfig.debug +++ linux/arch/powerpc/Kconfig.debug @@ -115,4 +115,46 @@ config PPC_OCP depends on IBM_OCP || XILINX_OCP default y +choice + prompt "Early debugging (dangerous)" + bool + optional + help + Enable early debugging. Careful, if you enable debugging for the + wrong type of machine your kernel _will not boot_. + +config PPC_EARLY_DEBUG_LPAR + bool "LPAR HV Console" + depends on PPC_PSERIES + help + Select this to enable early debugging for a machine with a HVC + console on vterm 0. + +config PPC_EARLY_DEBUG_G5 + bool "Apple G5" + depends on PPC_PMAC64 + help + Select this to enable early debugging for Apple G5 machines. + +config PPC_EARLY_DEBUG_RTAS + bool "RTAS Panel" + depends on PPC_RTAS + help + Select this to enable early debugging via the RTAS panel. + +config PPC_EARLY_DEBUG_MAPLE + bool "Maple real mode" + depends on PPC_MAPLE + help + Select this to enable early debugging for Maple. + +config PPC_EARLY_DEBUG_ISERIES + bool "iSeries HV Console" + depends on PPC_ISERIES + help + Select this to enable early debugging for legacy iSeries. You need + to hit "Ctrl-x Ctrl-x" to see the messages on the console. + +endchoice + endmenu Index: linux/arch/powerpc/kernel/rtas.c =================================================================== --- linux.orig/arch/powerpc/kernel/rtas.c +++ linux/arch/powerpc/kernel/rtas.c @@ -29,6 +29,7 @@ #include #include #include +#include struct rtas_t rtas = { .lock = SPIN_LOCK_UNLOCKED @@ -52,7 +53,7 @@ EXPORT_SYMBOL(rtas_flash_term_hook); * are designed only for very early low-level debugging, which * is why the token is hard-coded to 10. */ -void call_rtas_display_status(unsigned char c) +static void call_rtas_display_status(char c) { struct rtas_args *args = &rtas.args; unsigned long s; @@ -65,14 +66,14 @@ void call_rtas_display_status(unsigned c args->nargs = 1; args->nret = 1; args->rets = (rtas_arg_t *)&(args->args[1]); - args->args[0] = (int)c; + args->args[0] = (unsigned char)c; enter_rtas(__pa(args)); spin_unlock_irqrestore(&rtas.lock, s); } -void call_rtas_display_status_delay(unsigned char c) +static void call_rtas_display_status_delay(char c) { static int pending_newline = 0; /* did last write end with unprinted newline? */ static int width = 16; @@ -96,6 +97,11 @@ void call_rtas_display_status_delay(unsi } } +void __init udbg_init_rtas(void) +{ + udbg_putc = call_rtas_display_status_delay; +} + void rtas_progress(char *s, unsigned short hex) { struct device_node *root; Index: linux/arch/powerpc/kernel/setup_64.c =================================================================== --- linux.orig/arch/powerpc/kernel/setup_64.c +++ linux/arch/powerpc/kernel/setup_64.c @@ -70,37 +70,6 @@ #define DBG(fmt...) #endif -/* - * Here are some early debugging facilities. You can enable one - * but your kernel will not boot on anything else if you do so - */ - -/* For use on LPAR machines that support an HVC console on vterm 0 */ -extern void udbg_init_debug_lpar(void); - -/* This one is for use on Apple G5 machines */ -extern void udbg_init_pmac_realmode(void); - -/* That's RTAS panel debug */ -extern void call_rtas_display_status_delay(unsigned char c); - -/* Here's maple real mode debug */ -extern void udbg_init_maple_realmode(void); - -/* For iSeries - hit Ctrl-x Ctrl-x to see the output */ -extern void udbg_init_iseries(void); - -#define EARLY_DEBUG_INIT() do {} while(0) - -#if 0 -#define EARLY_DEBUG_INIT() udbg_init_debug_lpar() -#define EARLY_DEBUG_INIT() udbg_init_iseries() -#define EARLY_DEBUG_INIT() udbg_init_maple_realmode() -#define EARLY_DEBUG_INIT() udbg_init_pmac_realmode() -#define EARLY_DEBUG_INIT() \ - do { udbg_putc = call_rtas_display_status_delay; } while(0) -#endif - int have_of = 1; int boot_cpuid = 0; int boot_cpuid_phys = 0; @@ -241,11 +210,8 @@ void __init early_setup(unsigned long dt struct paca_struct *lpaca = get_paca(); static struct machdep_calls **mach; - /* - * Enable early debugging if any specified (see top of - * this file) - */ - EARLY_DEBUG_INIT(); + /* Enable early debugging if any specified (see udbg.h) */ + udbg_early_init(); DBG(" -> early_setup()\n"); Index: linux/arch/powerpc/kernel/udbg.c =================================================================== --- linux.orig/arch/powerpc/kernel/udbg.c +++ linux/arch/powerpc/kernel/udbg.c @@ -15,11 +15,36 @@ #include #include #include +#include void (*udbg_putc)(char c); int (*udbg_getc)(void); int (*udbg_getc_poll)(void); +/* + * Early debugging facilities. You can enable _one_ of these via .config, + * if you do so your kernel _will not boot_ on anything else. Be careful. + */ +void __init udbg_early_init(void) +{ +#if defined(CONFIG_PPC_EARLY_DEBUG_LPAR) + /* For LPAR machines that have an HVC console on vterm 0 */ + udbg_init_debug_lpar(); +#elif defined(CONFIG_PPC_EARLY_DEBUG_G5) + /* For use on Apple G5 machines */ + udbg_init_pmac_realmode(); +#elif defined(CONFIG_PPC_EARLY_DEBUG_RTAS) + /* RTAS panel debug */ + udbg_init_rtas(); +#elif defined(CONFIG_PPC_EARLY_DEBUG_MAPLE) + /* Maple real mode debug */ + udbg_init_maple_realmode(); +#elif defined(CONFIG_PPC_EARLY_DEBUG_ISERIES) + /* For iSeries - hit Ctrl-x Ctrl-x to see the output */ + udbg_init_iseries(); +#endif +} + /* udbg library, used by xmon et al */ void udbg_puts(const char *s) { Index: linux/include/asm-powerpc/udbg.h =================================================================== --- linux.orig/include/asm-powerpc/udbg.h +++ linux/include/asm-powerpc/udbg.h @@ -1,5 +1,5 @@ /* - * c 2001 PPC 64 Team, IBM Corp + * (c) 2001, 2006 IBM Corporation. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -36,5 +36,12 @@ extern void udbg_scc_init(int force_scc) extern int udbg_adb_init(int force_btext); extern void udbg_adb_init_early(void); +extern void __init udbg_early_init(void); +extern void __init udbg_init_debug_lpar(void); +extern void __init udbg_init_pmac_realmode(void); +extern void __init udbg_init_maple_realmode(void); +extern void __init udbg_init_iseries(void); +extern void __init udbg_init_rtas(void); + #endif /* __KERNEL__ */ #endif /* _ASM_POWERPC_UDBG_H */ Index: linux/include/asm-powerpc/rtas.h =================================================================== --- linux.orig/include/asm-powerpc/rtas.h +++ linux/include/asm-powerpc/rtas.h @@ -161,7 +161,6 @@ extern struct rtas_t rtas; extern void enter_rtas(unsigned long); extern int rtas_token(const char *service); extern int rtas_call(int token, int, int, int *, ...); -extern void call_rtas_display_status(unsigned char); extern void rtas_restart(char *cmd); extern void rtas_power_off(void); extern void rtas_halt(void); Index: linux/arch/powerpc/kernel/udbg_16550.c =================================================================== --- linux.orig/arch/powerpc/kernel/udbg_16550.c +++ linux/arch/powerpc/kernel/udbg_16550.c @@ -155,7 +155,7 @@ void udbg_maple_real_putc(unsigned char } } -void udbg_init_maple_realmode(void) +void __init udbg_init_maple_realmode(void) { udbg_comport = (volatile struct NS16550 __iomem *)0xf40003f8; Index: linux/arch/powerpc/platforms/powermac/udbg_scc.c =================================================================== --- linux.orig/arch/powerpc/platforms/powermac/udbg_scc.c +++ linux/arch/powerpc/platforms/powermac/udbg_scc.c @@ -153,7 +153,7 @@ static void udbg_real_scc_putc(char c) udbg_real_scc_putc('\r'); } -void udbg_init_pmac_realmode(void) +void __init udbg_init_pmac_realmode(void) { sccc = (volatile u8 __iomem *)0x80013020ul; sccd = (volatile u8 __iomem *)0x80013030ul; From paulus at samba.org Wed Jan 11 12:08:35 2006 From: paulus at samba.org (Paul Mackerras) Date: Wed, 11 Jan 2006 12:08:35 +1100 Subject: [PATCH 00/13] spufs fixes and cleanups In-Reply-To: <200601110048.46621.arnd@arndb.de> References: <20060104193120.050539000@localhost> <43C416D4.9020500@am.sony.com> <200601110048.46621.arnd@arndb.de> Message-ID: <17348.23187.239279.13132@cargo.ozlabs.ibm.com> Arnd Bergmann writes: > Am Dienstag, 10. Januar 2006 21:19 schrieb Geoff Levand: > > I didn't see the fix I sent you (also below) to stop > > DMA at spu context save in your latest patches. ?You > > mentioned that Mark may cover that fix in his > > preemptive scheduler work. ?Did he put it in a > > routine called earlier? ?Please let me know. > > The preemptive scheduler is merged into mainline now and evidently did > not fix this bug. I think I confused it with some other problem that is now > fixed, thanks for reminding me. > > Paul, please apply this. I don't recall seeing it; Geoff, could you send it to me again with a nice explanation and signed-off-by? Thanks, Paul. From mikey at neuling.org Wed Jan 11 12:08:56 2006 From: mikey at neuling.org (Michael Neuling) Date: Wed, 11 Jan 2006 12:08:56 +1100 Subject: [PATCH] parallel port init fix Message-ID: <20060111120856.d7a62add.mikey@neuling.org> Paulus, Please merge. The Cell guys have been reporting crashes without this patch. It's also needed when we merge Anton's remove_io_page mask patch. We'll also eventually need dwmw2 patch for parallel ports which are partially configured in the SuperIO registers, but the attached patch can go in without it. His patch is here: http://patchwork.ozlabs.org/linuxppc64/patch?id=3669 Mikey --- Signed-off-by: Michael Neuling Patch stops parport from accessing non existant ports. include/asm-powerpc/parport.h | 28 ++++++++++++++++++++++++++-- 1 files changed, 26 insertions(+), 2 deletions(-) Index: linux-2.6-powerpc-latest.nobackup/include/asm-powerpc/parport.h =================================================================== --- linux-2.6-powerpc-latest.nobackup.orig/include/asm-powerpc/parport.h +++ linux-2.6-powerpc-latest.nobackup/include/asm-powerpc/parport.h @@ -10,10 +10,34 @@ #define _ASM_POWERPC_PARPORT_H #ifdef __KERNEL__ -static int __devinit parport_pc_find_isa_ports (int autoirq, int autodma); +#include + +extern struct parport *parport_pc_probe_port (unsigned long int base, + unsigned long int base_hi, + int irq, int dma, + struct pci_dev *dev); + static int __devinit parport_pc_find_nonpci_ports (int autoirq, int autodma) { - return parport_pc_find_isa_ports (autoirq, autodma); + struct device_node *np; + u32 *prop; + u32 io1, io2; + int propsize; + int count = 0; + for (np = NULL; (np = of_find_compatible_node(np, + "parallel", + "pnpPNP,400")) != NULL;) { + prop = (u32 *)get_property(np, "reg", &propsize); + if (!prop || propsize > 6*sizeof(u32)) + continue; + io1 = prop[1]; io2 = prop[2]; + prop = (u32 *)get_property(np, "interrupts", NULL); + if (!prop) + continue; + if (parport_pc_probe_port(io1, io2, prop[0], autodma, NULL) != NULL) + count++; + } + return count; } #endif /* __KERNEL__ */ From anton at samba.org Wed Jan 11 13:16:44 2006 From: anton at samba.org (Anton Blanchard) Date: Wed, 11 Jan 2006 13:16:44 +1100 Subject: [PATCH] ppc64: per cpu data optimisations Message-ID: <20060111021644.GC4767@krispykreme> Hi, The current ppc64 per cpu data implementation is quite slow. eg: lhz 11,18(13) /* smp_processor_id() */ ld 9,.LC63-.LCTOC1(30) /* per_cpu__variable_name */ ld 8,.LC61-.LCTOC1(30) /* __per_cpu_offset */ sldi 11,11,3 /* form index into __per_cpu_offset */ mr 10,9 ldx 9,11,8 /* __per_cpu_offset[smp_processor_id()] */ ldx 0,10,9 /* load per cpu data */ 5 loads for something that is supposed to be fast, pretty awful. One reason for the large number of loads is that we have to synthesize 2 64bit constants (per_cpu__variable_name and __per_cpu_offset). By putting __per_cpu_offset into the paca we can avoid the 2 loads associated with it: ld 11,56(13) /* paca->data_offset */ ld 9,.LC59-.LCTOC1(30) /* per_cpu__variable_name */ ldx 0,9,11 /* load per cpu data Longer term we can should be able to do even better than 3 loads. If per_cpu__variable_name wasnt a 64bit constant and paca->data_offset was in a register we could cut it down to one load. A suggestion from Rusty is to use gcc's __thread extension here. In order to do this we would need to free up r13 (the __thread register and where the paca currently is). So far Ive had a few unsuccessful attempts at doing that :) The patch also allocates per cpu memory node local on NUMA machines. This patch from Rusty has been sitting in my queue _forever_ but stalled when I hit the compiler bug. Sorry about that. Finally I also only allocate per cpu data for possible cpus, which comes straight out of the x86-64 port. On a pseries kernel (with NR_CPUS == 128) and 4 possible cpus we see some nice gains: total used free shared buffers cached Mem: 4012228 212860 3799368 0 0 162424 total used free shared buffers cached Mem: 4016200 212984 3803216 0 0 162424 A saving of 3.75MB. Quite nice for smaller machines. Note: we now have to be careful of per cpu users that touch data for !possible cpus. At this stage it might be worth making the NUMA and possible cpu optimisations generic, but per cpu init is done so early we have to be careful that all architectures have their possible map setup correctly. Signed-off-by: Anton Blanchard --- The fix to RELOC_HIDE is now upstream, so we should be OK to merge this. Index: build/arch/powerpc/kernel/setup_64.c =================================================================== --- build.orig/arch/powerpc/kernel/setup_64.c 2006-01-11 11:50:31.000000000 +1100 +++ build/arch/powerpc/kernel/setup_64.c 2006-01-11 11:50:40.000000000 +1100 @@ -33,6 +33,7 @@ #include #include #include +#include #include #include #include @@ -686,3 +687,28 @@ if (ppc_md.cpu_die) ppc_md.cpu_die(); } + +#ifdef CONFIG_SMP +void __init setup_per_cpu_areas(void) +{ + int i; + unsigned long size; + char *ptr; + + /* Copy section for each CPU (we discard the original) */ + size = ALIGN(__per_cpu_end - __per_cpu_start, SMP_CACHE_BYTES); +#ifdef CONFIG_MODULES + if (size < PERCPU_ENOUGH_ROOM) + size = PERCPU_ENOUGH_ROOM; +#endif + + for_each_cpu(i) { + ptr = alloc_bootmem_node(NODE_DATA(cpu_to_node(i)), size); + if (!ptr) + panic("Cannot allocate cpu data for CPU %d\n", i); + + paca[i].data_offset = ptr - __per_cpu_start; + memcpy(ptr, __per_cpu_start, __per_cpu_end - __per_cpu_start); + } +} +#endif Index: build/include/asm-powerpc/paca.h =================================================================== --- build.orig/include/asm-powerpc/paca.h 2006-01-11 11:50:31.000000000 +1100 +++ build/include/asm-powerpc/paca.h 2006-01-11 11:50:40.000000000 +1100 @@ -65,6 +65,7 @@ u64 stab_real; /* Absolute address of segment table */ u64 stab_addr; /* Virtual address of segment table */ void *emergency_sp; /* pointer to emergency stack */ + u64 data_offset; /* per cpu data offset */ s16 hw_cpu_id; /* Physical processor number */ u8 cpu_start; /* At startup, processor spins until */ /* this becomes non-zero. */ Index: build/include/asm-powerpc/percpu.h =================================================================== --- build.orig/include/asm-powerpc/percpu.h 2006-01-11 11:50:31.000000000 +1100 +++ build/include/asm-powerpc/percpu.h 2006-01-11 11:50:40.000000000 +1100 @@ -1 +1,57 @@ +#ifndef _ASM_POWERPC_PERCPU_H_ +#define _ASM_POWERPC_PERCPU_H_ +#ifdef __powerpc64__ +#include + +/* + * Same as asm-generic/percpu.h, except that we store the per cpu offset + * in the paca. Based on the x86-64 implementation. + */ + +#ifdef CONFIG_SMP + +#include + +#define __per_cpu_offset(cpu) (paca[cpu].data_offset) +#define __my_cpu_offset() get_paca()->data_offset + +/* Separate out the type, so (int[3], foo) works. */ +#define DEFINE_PER_CPU(type, name) \ + __attribute__((__section__(".data.percpu"))) __typeof__(type) per_cpu__##name + +/* var is in discarded region: offset to particular copy we want */ +#define per_cpu(var, cpu) (*RELOC_HIDE(&per_cpu__##var, __per_cpu_offset(cpu))) +#define __get_cpu_var(var) (*RELOC_HIDE(&per_cpu__##var, __my_cpu_offset())) + +/* A macro to avoid #include hell... */ +#define percpu_modcopy(pcpudst, src, size) \ +do { \ + unsigned int __i; \ + for (__i = 0; __i < NR_CPUS; __i++) \ + if (cpu_possible(__i)) \ + memcpy((pcpudst)+__per_cpu_offset(__i), \ + (src), (size)); \ +} while (0) + +extern void setup_per_cpu_areas(void); + +#else /* ! SMP */ + +#define DEFINE_PER_CPU(type, name) \ + __typeof__(type) per_cpu__##name + +#define per_cpu(var, cpu) (*((void)(cpu), &per_cpu__##var)) +#define __get_cpu_var(var) per_cpu__##var + +#endif /* SMP */ + +#define DECLARE_PER_CPU(type, name) extern __typeof__(type) per_cpu__##name + +#define EXPORT_PER_CPU_SYMBOL(var) EXPORT_SYMBOL(per_cpu__##var) +#define EXPORT_PER_CPU_SYMBOL_GPL(var) EXPORT_SYMBOL_GPL(per_cpu__##var) + +#else #include +#endif + +#endif /* _ASM_POWERPC_PERCPU_H_ */ From ntl at pobox.com Wed Jan 11 13:36:55 2006 From: ntl at pobox.com (Nathan Lynch) Date: Tue, 10 Jan 2006 20:36:55 -0600 Subject: [PATCH] ppc64: per cpu data optimisations In-Reply-To: <20060111021644.GC4767@krispykreme> References: <20060111021644.GC4767@krispykreme> Message-ID: <20060111023654.GB2846@localhost.localdomain> Anton Blanchard wrote: > +#define percpu_modcopy(pcpudst, src, size) \ > +do { \ > + unsigned int __i; \ > + for (__i = 0; __i < NR_CPUS; __i++) \ > + if (cpu_possible(__i)) \ Nitpick - could be for_each_cpu(__i)? Or am I missing something subtle? From sfr at canb.auug.org.au Wed Jan 11 13:51:22 2006 From: sfr at canb.auug.org.au (Stephen Rothwell) Date: Wed, 11 Jan 2006 13:51:22 +1100 Subject: [PATCH] powerpc: fix up iSeries console after TTY layer buffering revamp Message-ID: <20060111135122.0e5a3009.sfr@canb.auug.org.au> Signed-off-by: Stephen Rothwell --- drivers/char/viocons.c | 7 ++++--- 1 files changed, 4 insertions(+), 3 deletions(-) Paulus, can you please appply and send upstream, thanks? -- Cheers, Stephen Rothwell sfr at canb.auug.org.au http://www.canb.auug.org.au/~sfr/ 15482eeb8f78fca3b6256d7ac340aabe9c787270 diff --git a/drivers/char/viocons.c b/drivers/char/viocons.c index cb82ebf..f33edb2 100644 --- a/drivers/char/viocons.c +++ b/drivers/char/viocons.c @@ -904,6 +904,7 @@ static void vioHandleData(struct HvLpEve struct viocharlpevent *cevent = (struct viocharlpevent *)event; struct port_info *pi; int index; + int num_pushed; u8 port = cevent->virtual_device; if (port >= VTTY_PORTS) { @@ -964,6 +965,7 @@ static void vioHandleData(struct HvLpEve * functionality will only work if built into the kernel and * then only if sysrq is enabled through the proc filesystem. */ + num_pushed = 0; for (index = 0; index < cevent->len; index++) { #ifdef CONFIG_MAGIC_SYSRQ if (sysrq_enabled) { @@ -997,11 +999,10 @@ static void vioHandleData(struct HvLpEve printk(VIOCONS_KERN_WARN "input buffer overflow!\n"); break; } + num_pushed++; } - /* if cevent->len == 0 then no data was added to the buffer and flip.count == 0 */ - if (tty->flip.count) - /* The next call resets flip.count when the data is flushed. */ + if (num_pushed) tty_flip_buffer_push(tty); } -- 1.0.6 From geoffrey.levand at am.sony.com Wed Jan 11 07:19:32 2006 From: geoffrey.levand at am.sony.com (Geoff Levand) Date: Tue, 10 Jan 2006 12:19:32 -0800 Subject: [PATCH 00/13] spufs fixes and cleanups In-Reply-To: <20060104193120.050539000@localhost> References: <20060104193120.050539000@localhost> Message-ID: <43C416D4.9020500@am.sony.com> Arnd Bergmann wrote: > In a review almost a month ago, Al Viro found numerous > problems in the current spufs code. I now finally found > some time to go through those and attempt to fix them. > > There are also a few other changes in this series that > should also help, in particular improved interrupt > sending and an abstraction for priviledged register > access (as suggested by Masato Noguchi and Geoff Levand). > > Please apply to powerpc.git before sending spufs upstream. > > Al, could you have a look over this to see if it addresses > all the concerns you had and if I broke it in new ways? > > Arnd <>< > > arch/powerpc/platforms/cell/Makefile | 5 > arch/powerpc/platforms/cell/interrupt.c | 42 ++-- > arch/powerpc/platforms/cell/interrupt.h | 1 > arch/powerpc/platforms/cell/spu_base.c | 67 +++---- > arch/powerpc/platforms/cell/spu_priv1.c | 133 ++++++++++++++ > arch/powerpc/platforms/cell/spufs/Makefile | 2 > arch/powerpc/platforms/cell/spufs/file.c | 167 +---------------- > arch/powerpc/platforms/cell/spufs/hw_ops.c | 19 -- > arch/powerpc/platforms/cell/spufs/inode.c | 156 ++++++++------- > arch/powerpc/platforms/cell/spufs/run.c | 131 ++++++++++++++ > arch/powerpc/platforms/cell/spufs/sched.c | 13 + > arch/powerpc/platforms/cell/spufs/spufs.h | 35 +++ > arch/powerpc/platforms/cell/spufs/switch.c | 139 +++++---------- > arch/powerpc/platforms/cell/spufs/syscalls.c | 5 > arch/powerpc/platforms/cell/spufs/context.c | 11 - > include/asm-powerpc/spu.h | 42 +++- > 20 files changed, 565 insertions(+), 407 deletions(-) > > Arnd, I didn't see the fix I sent you (also below) to stop DMA at spu context save in your latest patches. You mentioned that Mark may cover that fix in his preemptive scheduler work. Did he put it in a routine called earlier? Please let me know. -Geoff spufs: stop dma at context save. There is no code to suspend dma queue on context save. SPE Book4 shows that context save's step8 is required to suspend dma and save MFC_CNTL. Signed-off-by: Masato Noguchi Signed-off-by: Geoff Levand Index: linux-2.6.15-cell/arch/powerpc/platforms/cell/spufs/switch.c =================================================================== --- linux-2.6.15-cell.orig/arch/powerpc/platforms/cell/spufs/switch.c 2005-12-02 15:59:28.000000000 -0800 +++ linux-2.6.15-cell/arch/powerpc/platforms/cell/spufs/switch.c 2005-12-02 16:06:11.000000000 -0800 @@ -174,11 +174,33 @@ struct spu_priv2 __iomem *priv2 = spu->priv2; /* Save, Step 8: - * Read and save MFC_CNTL[Ss]. + * Suspend DMA and save MFC_CNTL. */ - if (csa) { - csa->priv2.mfc_control_RW = in_be64(&priv2->mfc_control_RW) & - MFC_CNTL_SUSPEND_DMA_STATUS_MASK; + switch (in_be64(&priv2->mfc_control_RW) & + MFC_CNTL_SUSPEND_DMA_STATUS_MASK) { + case MFC_CNTL_SUSPEND_IN_PROGRESS: + POLL_WHILE_FALSE((in_be64(&priv2->mfc_control_RW) & + MFC_CNTL_SUSPEND_DMA_STATUS_MASK) == + MFC_CNTL_SUSPEND_COMPLETE); + /* fall through */ + case MFC_CNTL_SUSPEND_COMPLETE: + if (csa) { + csa->priv2.mfc_control_RW = + in_be64(&priv2->mfc_control_RW) | + MFC_CNTL_SUSPEND_DMA_QUEUE; + } + break; + case MFC_CNTL_NORMAL_DMA_QUEUE_OPERATION: + out_be64(&priv2->mfc_control_RW, MFC_CNTL_SUSPEND_DMA_QUEUE); + POLL_WHILE_FALSE((in_be64(&priv2->mfc_control_RW) & + MFC_CNTL_SUSPEND_DMA_STATUS_MASK) == + MFC_CNTL_SUSPEND_COMPLETE); + if (csa) { + csa->priv2.mfc_control_RW = + in_be64(&priv2->mfc_control_RW) & + ~MFC_CNTL_SUSPEND_DMA_QUEUE; + } + break; } } @@ -244,6 +266,8 @@ eieio(); csa->spu_chnldata_RW[7] = in_be64(&priv2->spu_chnldata_RW); eieio(); + } else { + csa->priv2.mfc_control_RW &= ~MFC_CNTL_DECREMENTER_RUNNING; } } From sfr at canb.auug.org.au Wed Jan 11 14:20:48 2006 From: sfr at canb.auug.org.au (Stephen Rothwell) Date: Wed, 11 Jan 2006 14:20:48 +1100 Subject: [PATCH 1/2] powerpc: Early debugging support for iSeries In-Reply-To: <1136940848.640959.661243623476.qpush@concordia> References: <1136940848.640959.661243623476.qpush@concordia> Message-ID: <20060111142048.5a81351f.sfr@canb.auug.org.au> On Wed, 11 Jan 2006 11:54:08 +1100 Michael Ellerman wrote: > > Connect iSeries up to the standard early debugging infrastructure. > > To actually use this you need to enable the iSeries early debugging > in setup_64.c. Then after the messages are logged hit Ctrl-x Ctrl-x on > your console to dump the Hypervisor console buffer. > > Signed-off-by: Michael Ellerman Acked-by: Stephen Rothwell -- Cheers, Stephen Rothwell sfr at canb.auug.org.au http://www.canb.auug.org.au/~sfr/ -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: not available Url : http://ozlabs.org/pipermail/linuxppc64-dev/attachments/20060111/28811221/attachment.pgp From haren at us.ibm.com Wed Jan 11 14:25:25 2006 From: haren at us.ibm.com (Haren Myneni) Date: Tue, 10 Jan 2006 19:25:25 -0800 Subject: [PATCH] fix for compile problem in kdump code when SMP disabled Message-ID: <43C47AA5.6060301@us.ibm.com> Paul, Please apply and forward upstream. Thanks Haren This patch fixes the compilation error (shown below) when CONFIG_SMP=n. arch/powerpc/kernel/crash.c: In function `crash_kexec_prepare_cpus': arch/powerpc/kernel/crash.c:236: error: implicit declaration of function `smp_release_cpus' Signed-off-by: Haren Myneni -------------- next part -------------- A non-text attachment was scrubbed... Name: kdump_build_fix.patch Type: text/x-patch Size: 510 bytes Desc: not available Url : http://ozlabs.org/pipermail/linuxppc64-dev/attachments/20060110/0729d825/attachment.bin From sfr at canb.auug.org.au Wed Jan 11 14:28:46 2006 From: sfr at canb.auug.org.au (Stephen Rothwell) Date: Wed, 11 Jan 2006 14:28:46 +1100 Subject: [PATCH 2/2] powerpc: Make early debugging configurable via Kconfig In-Reply-To: <20060111005419.462DD689DF@ozlabs.org> References: <1136940848.640959.661243623476.qpush@concordia> <20060111005419.462DD689DF@ozlabs.org> Message-ID: <20060111142846.798ce33f.sfr@canb.auug.org.au> On Wed, 11 Jan 2006 11:54:09 +1100 Michael Ellerman wrote: > > This patch adds Kconfig entries to control the early debugging options, > currently in setup_64.c. > > Doing this via Kconfig rather than #defines means you can have one source tree, > which is buildable for multiple platforms - and you can enable the correct > early debug option for each platform via .config. > > I made udbg_early_init() a static inline because otherwise GCC is to daft to > optimise it away when debugging is off. The above sentence is no longer relevant (in this revised patch). > Now that we have udbg_init_rtas() we can make call_rtas_display_status* static. > > Signed-off-by: Michael Ellerman Acked-by: Stephen Rothwell -- Cheers, Stephen Rothwell sfr at canb.auug.org.au http://www.canb.auug.org.au/~sfr/ -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: not available Url : http://ozlabs.org/pipermail/linuxppc64-dev/attachments/20060111/b1e44f1a/attachment.pgp From geoffrey.levand at am.sony.com Wed Jan 11 14:47:37 2006 From: geoffrey.levand at am.sony.com (Geoff Levand) Date: Tue, 10 Jan 2006 19:47:37 -0800 Subject: [PATCH 00/13] spufs fixes and cleanups In-Reply-To: <17348.23187.239279.13132@cargo.ozlabs.ibm.com> References: <20060104193120.050539000@localhost> <43C416D4.9020500@am.sony.com> <200601110048.46621.arnd@arndb.de> <17348.23187.239279.13132@cargo.ozlabs.ibm.com> Message-ID: <43C47FD9.8000602@am.sony.com> Paul Mackerras wrote: > Arnd Bergmann writes: > > >>Am Dienstag, 10. Januar 2006 21:19 schrieb Geoff Levand: >> >>>I didn't see the fix I sent you (also below) to stop >>>DMA at spu context save in your latest patches. ?You >>>mentioned that Mark may cover that fix in his >>>preemptive scheduler work. ?Did he put it in a >>>routine called earlier? ?Please let me know. >> >>The preemptive scheduler is merged into mainline now and evidently did >>not fix this bug. I think I confused it with some other problem that is now >>fixed, thanks for reminding me. >> >>Paul, please apply this. > > > I don't recall seeing it; Geoff, could you send it to me again with a > nice explanation and signed-off-by? > > Thanks, > Paul. > spufs: Suspend/restore MFC DMA operations at SPU context switch. The SPE Book IV indicates that MFC DMA operations must be suspended and restored on SPU context switch (in Step 8). This patch adds that operation, which is missing from the current spufs implementation. Signed-off-by: Masato Noguchi Signed-off-by: Geoff Levand Acked-by: Arnd Bergmann Index: linux-2.6.15-cell/arch/powerpc/platforms/cell/spufs/switch.c =================================================================== --- linux-2.6.15-cell.orig/arch/powerpc/platforms/cell/spufs/switch.c 2005-12-02 15:59:28.000000000 -0800 +++ linux-2.6.15-cell/arch/powerpc/platforms/cell/spufs/switch.c 2005-12-02 16:06:11.000000000 -0800 @@ -174,11 +174,33 @@ struct spu_priv2 __iomem *priv2 = spu->priv2; /* Save, Step 8: - * Read and save MFC_CNTL[Ss]. + * Suspend DMA and save MFC_CNTL. */ - if (csa) { - csa->priv2.mfc_control_RW = in_be64(&priv2->mfc_control_RW) & - MFC_CNTL_SUSPEND_DMA_STATUS_MASK; + switch (in_be64(&priv2->mfc_control_RW) & + MFC_CNTL_SUSPEND_DMA_STATUS_MASK) { + case MFC_CNTL_SUSPEND_IN_PROGRESS: + POLL_WHILE_FALSE((in_be64(&priv2->mfc_control_RW) & + MFC_CNTL_SUSPEND_DMA_STATUS_MASK) == + MFC_CNTL_SUSPEND_COMPLETE); + /* fall through */ + case MFC_CNTL_SUSPEND_COMPLETE: + if (csa) { + csa->priv2.mfc_control_RW = + in_be64(&priv2->mfc_control_RW) | + MFC_CNTL_SUSPEND_DMA_QUEUE; + } + break; + case MFC_CNTL_NORMAL_DMA_QUEUE_OPERATION: + out_be64(&priv2->mfc_control_RW, MFC_CNTL_SUSPEND_DMA_QUEUE); + POLL_WHILE_FALSE((in_be64(&priv2->mfc_control_RW) & + MFC_CNTL_SUSPEND_DMA_STATUS_MASK) == + MFC_CNTL_SUSPEND_COMPLETE); + if (csa) { + csa->priv2.mfc_control_RW = + in_be64(&priv2->mfc_control_RW) & + ~MFC_CNTL_SUSPEND_DMA_QUEUE; + } + break; } } @@ -244,6 +266,8 @@ eieio(); csa->spu_chnldata_RW[7] = in_be64(&priv2->spu_chnldata_RW); eieio(); + } else { + csa->priv2.mfc_control_RW &= ~MFC_CNTL_DECREMENTER_RUNNING; } } From galak at gate.crashing.org Wed Jan 11 14:43:56 2006 From: galak at gate.crashing.org (Kumar Gala) Date: Tue, 10 Jan 2006 21:43:56 -0600 (CST) Subject: [PATCH] powerpc: Updated Kconfig and Makefiles for 83xx support Message-ID: Updated Kconfig & Makefiles in prep for adding support for the Freescale MPC83xx family of processors to arch/powerpc. Moved around some config options that are more globally applicable to other PowerPC processors. Added a temporary config option (83xx) to match existh arch/ppc support for the MPC83xx line. Signed-off-by: Kumar Gala --- commit 2c80aa14abcccdfdef2998ba78c299c33999c621 tree 980e516b488d408d93402dbdbe3749e48996bb81 parent 6d26108d8631afcb31faa6d63cab7bee8d35871c author Kumar Gala Tue, 10 Jan 2006 21:49:06 -0600 committer Kumar Gala Tue, 10 Jan 2006 21:49:06 -0600 arch/powerpc/Kconfig | 83 +++++++++++++++++----------- arch/powerpc/platforms/83xx/Kconfig | 26 +++++++++ arch/powerpc/platforms/83xx/Makefile | 4 + arch/powerpc/platforms/Makefile | 1 arch/powerpc/platforms/embedded6xx/Kconfig | 18 ------ arch/powerpc/sysdev/Makefile | 2 - arch/ppc/Kconfig | 4 + 7 files changed, 85 insertions(+), 53 deletions(-) diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig index 935d965..01feed0 100644 --- a/arch/powerpc/Kconfig +++ b/arch/powerpc/Kconfig @@ -71,15 +71,39 @@ config ARCH_MAY_HAVE_PC_FDC bool default y +config PPC_OF + def_bool y + +config PPC_UDBG_16550 + bool + default n + +config CRASH_DUMP + bool "kernel crash dumps (EXPERIMENTAL)" + depends on PPC_MULTIPLATFORM + depends on EXPERIMENTAL + help + Build a kernel suitable for use as a kdump capture kernel. + The kernel will be linked at a different address than normal, and + so can only be used for Kdump. + + Don't change this unless you know what you are doing. + +config GENERIC_TBSYNC + bool + default y if PPC32 && SMP + default n + menu "Processor support" choice prompt "Processor Type" depends on PPC32 default 6xx -config 6xx +config CLASSIC32 bool "6xx/7xx/74xx" select PPC_FPU + select 6xx help There are four families of PowerPC chips supported. The more common types (601, 603, 604, 740, 750, 7400), the Motorola embedded @@ -93,12 +117,20 @@ config 6xx config PPC_52xx bool "Freescale 52xx" + select 6xx + select PPC_FPU config PPC_82xx bool "Freescale 82xx" + select 6xx + select PPC_FPU config PPC_83xx bool "Freescale 83xx" + select 6xx + select FSL_SOC + select 83xx + select PPC_FPU config 40x bool "AMCC 40x" @@ -134,6 +166,13 @@ config POWER4 depends on PPC64 def_bool y +config 6xx + bool + +# this is temp to handle compat with arch=ppc +config 83xx + bool + config PPC_FPU bool default y if PPC64 @@ -166,7 +205,7 @@ config PHYS_64BIT config ALTIVEC bool "AltiVec Support" - depends on 6xx || POWER4 + depends on CLASSIC32 || POWER4 ---help--- This option enables kernel support for the Altivec extensions to the PowerPC processor. The kernel currently supports saving and restoring @@ -239,7 +278,7 @@ endmenu source "init/Kconfig" menu "Platform support" - depends on PPC64 || 6xx + depends on PPC64 || CLASSIC32 choice prompt "Machine type" @@ -330,9 +369,6 @@ config PPC_CELL select MMIO_NVRAM select PPC_UDBG_16550 -config PPC_OF - def_bool y - config XICS depends on PPC_PSERIES bool @@ -375,26 +411,11 @@ config MPIC_BROKEN_U3 depends on PPC_MAPLE default y -config PPC_UDBG_16550 - bool - default n - config CELL_IIC depends on PPC_CELL bool default y -config CRASH_DUMP - bool "kernel crash dumps (EXPERIMENTAL)" - depends on PPC_MULTIPLATFORM - depends on EXPERIMENTAL - help - Build a kernel suitable for use as a kdump capture kernel. - The kernel will be linked at a different address than normal, and - so can only be used for Kdump. - - Don't change this unless you know what you are doing. - config IBMVIO depends on PPC_PSERIES || PPC_ISERIES bool @@ -410,11 +431,6 @@ config PPC_MPC106 bool default n -config GENERIC_TBSYNC - bool - default y if PPC32 && SMP - default n - source "drivers/cpufreq/Kconfig" config CPU_FREQ_PMAC @@ -495,6 +511,7 @@ endmenu source arch/powerpc/platforms/embedded6xx/Kconfig source arch/powerpc/platforms/4xx/Kconfig +source arch/powerpc/platforms/83xx/Kconfig source arch/powerpc/platforms/85xx/Kconfig source arch/powerpc/platforms/8xx/Kconfig source arch/powerpc/platforms/cell/Kconfig @@ -718,7 +735,7 @@ config PPC_I8259 config PPC_INDIRECT_PCI bool depends on PCI - default y if 40x || 44x || 85xx || 83xx + default y if 40x || 44x || 85xx default n config EISA @@ -727,13 +744,16 @@ config EISA config SBUS bool +config FSL_SOC + bool + # Yes MCA RS/6000s exist but Linux-PPC does not currently support any config MCA bool config PCI - bool "PCI support" if 40x || CPM2 || 83xx || 85xx || PPC_MPC52xx || (EMBEDDED && PPC_ISERIES) - default y if !40x && !CPM2 && !8xx && !APUS && !83xx && !85xx + bool "PCI support" if 40x || CPM2 || PPC_83xx || 85xx || PPC_MPC52xx || (EMBEDDED && PPC_ISERIES) + default y if !40x && !CPM2 && !8xx && !APUS && !PPC_83xx && !85xx default PCI_PERMEDIA if !4xx && !CPM2 && !8xx && APUS default PCI_QSPAN if !4xx && !CPM2 && 8xx help @@ -746,11 +766,6 @@ config PCI_DOMAINS bool default PCI -config MPC83xx_PCI2 - bool " Supprt for 2nd PCI host controller" - depends on PCI && MPC834x - default y if MPC834x_SYS - config PCI_QSPAN bool "QSpan PCI" depends on !4xx && !CPM2 && 8xx diff --git a/arch/powerpc/platforms/83xx/Kconfig b/arch/powerpc/platforms/83xx/Kconfig new file mode 100644 index 0000000..b20812d --- /dev/null +++ b/arch/powerpc/platforms/83xx/Kconfig @@ -0,0 +1,26 @@ +menu "Platform support" + depends on PPC_83xx + +choice + prompt "Machine Type" + default MPC834x_SYS + +config MPC834x_SYS + bool "Freescale MPC834x SYS" + help + This option enables support for the MPC 834x SYS evaluation board. + + Be aware that PCI buses can only function when SYS board is plugged + into the PIB (Platform IO Board) board from Freescale which provide + 3 PCI slots. The PIBs PCI initialization is the bootloader's + responsiblilty. + +endchoice + +config MPC834x + bool + select PPC_UDBG_16550 + select PPC_INDIRECT_PCI + default y if MPC834x_SYS + +endmenu diff --git a/arch/powerpc/platforms/83xx/Makefile b/arch/powerpc/platforms/83xx/Makefile new file mode 100644 index 0000000..9d8b28e --- /dev/null +++ b/arch/powerpc/platforms/83xx/Makefile @@ -0,0 +1,4 @@ +# +# Makefile for the PowerPC 83xx linux kernel. +# +obj-$(CONFIG_MPC834x_SYS) += mpc834x_sys.o pci.o diff --git a/arch/powerpc/platforms/Makefile b/arch/powerpc/platforms/Makefile index 8836b3a..04073fd 100644 --- a/arch/powerpc/platforms/Makefile +++ b/arch/powerpc/platforms/Makefile @@ -7,6 +7,7 @@ endif endif obj-$(CONFIG_PPC_CHRP) += chrp/ obj-$(CONFIG_4xx) += 4xx/ +obj-$(CONFIG_PPC_83xx) += 83xx/ obj-$(CONFIG_85xx) += 85xx/ obj-$(CONFIG_PPC_PSERIES) += pseries/ obj-$(CONFIG_PPC_ISERIES) += iseries/ diff --git a/arch/powerpc/platforms/embedded6xx/Kconfig b/arch/powerpc/platforms/embedded6xx/Kconfig index 8125009..4fdbc9a 100644 --- a/arch/powerpc/platforms/embedded6xx/Kconfig +++ b/arch/powerpc/platforms/embedded6xx/Kconfig @@ -144,16 +144,6 @@ config LITE5200 much but it's only been tested on this board version. I think this board is also known as IceCube. -config MPC834x_SYS - bool "Freescale MPC834x SYS" - help - This option enables support for the MPC 834x SYS evaluation board. - - Be aware that PCI buses can only function when SYS board is plugged - into the PIB (Platform IO Board) board from Freescale which provide - 3 PCI slots. The PIBs PCI initialization is the bootloader's - responsiblilty. - config EV64360 bool "Marvell-EV64360BP" help @@ -192,14 +182,6 @@ config 8272 The MPC8272 CPM has a different internal dpram setup than other CPM2 devices -config 83xx - bool - default y if MPC834x_SYS - -config MPC834x - bool - default y if MPC834x_SYS - config CPM2 bool depends on 8260 || MPC8560 || MPC8555 diff --git a/arch/powerpc/sysdev/Makefile b/arch/powerpc/sysdev/Makefile index 14b9abd..0ae8413 100644 --- a/arch/powerpc/sysdev/Makefile +++ b/arch/powerpc/sysdev/Makefile @@ -6,4 +6,4 @@ obj-$(CONFIG_BOOKE) += dcr.o obj-$(CONFIG_40x) += dcr.o obj-$(CONFIG_U3_DART) += dart_iommu.o obj-$(CONFIG_MMIO_NVRAM) += mmio_nvram.o -obj-$(CONFIG_83xx) += ipic.o +obj-$(CONFIG_PPC_83xx) += ipic.o diff --git a/arch/ppc/Kconfig b/arch/ppc/Kconfig index e396f45..d658101 100644 --- a/arch/ppc/Kconfig +++ b/arch/ppc/Kconfig @@ -743,6 +743,10 @@ config MPC834x bool default y if MPC834x_SYS +config PPC_83xx + bool + default y if 83xx + config CPM1 bool depends on 8xx From mingo at elte.hu Wed Jan 11 10:09:17 2006 From: mingo at elte.hu (Ingo Molnar) Date: Wed, 11 Jan 2006 00:09:17 +0100 Subject: PowerPC fastpaths for mutex subsystem In-Reply-To: <43C435B9.5080409@austin.ibm.com> References: <20060104144151.GA27646@elte.hu> <43BC5E15.207@austin.ibm.com> <20060105143502.GA16816@elte.hu> <43BD4C66.60001@austin.ibm.com> <20060105222106.GA26474@elte.hu> <43BDA672.4090704@austin.ibm.com> <20060106002919.GA29190@pb15.lixom.net> <43BFFF1D.7030007@austin.ibm.com> <20060108094839.GA16887@elte.hu> <43C435B9.5080409@austin.ibm.com> Message-ID: <20060110230917.GA25285@elte.hu> * Joel Schopp wrote: > >interesting. Could you try two things? Firstly, could you add some > >minimal delays to the lock/unlock path, of at least 1 usec? E.g. > >"synchro-test.ko load=1 interval=1". [but you could try longer delays > >too, 10 usecs is still realistic.] > > Graphs attached. The summary for those who don't like to look at > attachments is that the mutex fastpath (threads 1) that I sent the > optimized patch for is comparable within the margin of error to > semaphores. The mutex common path (threads > 1) gets embarrassed by > semaphores. So mutexes common paths are not yet ready as far as ppc64 > is concerned. ok. I'll really need to look at "vmstat" output from these. We could easily make the mutex slowpath behave like ppc64 semaphores, via the attached (untested) patch, but i really think it's the wrong thing to do, because it overloads the system with runnable tasks in an essentially unlimited fashion [== overscheduling] - they'll all contend for the same single mutex. in synthetic workloads on idle systems it such overscheduling can help, because the 'luck factor' of the 'thundering herd' of tasks can generate a higher total throughput - at the expense of system efficiency. At 8 CPUs i already measured a net performance loss at 3 tasks! So i think the current 'at most 2 tasks runnable' approach of mutexes is the right one on a broad range of hardware. still, i'll try a different patch tomorrow, to keep the number of 'in flight' tasks within a certain limit (say at 2) - i suspect that would close the performance gap too, on this test. but i really think the current 'at most one task in flight' logic is the correct approach. I'm also curious about the VFS-test numbers (already on your todo). > >thirdly, could you run 'vmstat 1' during the tests, and post those lines > >too? Here i'm curious about two things: the average runqueue length > >(whether we have overscheduling), and CPU utilization and idle time left > >(how efficiently cycles are preserved in contention). [btw., does ppc > >have an idle=poll equivalent mode of idling?] > > Also queued in my todo list. thanks! > >also, there seems to be some fluctuation in the numbers - could you try > >to run a few more to see how stable the numbers are? > > For the graphs the line is the average of 5 runs, and the 5 runs are > scatter plotted as well. ok, that should be more than enough. Ingo --- kernel/mutex.c.orig +++ kernel/mutex.c @@ -226,6 +226,9 @@ __mutex_unlock_slowpath(atomic_t *lock_c debug_mutex_wake_waiter(lock, waiter); + /* be (much) more agressive about wakeups: */ + list_move_tail(&waiter.list, &lock->wait_list); + wake_up_process(waiter->task); } From galak at gate.crashing.org Wed Jan 11 15:12:23 2006 From: galak at gate.crashing.org (Kumar Gala) Date: Tue, 10 Jan 2006 22:12:23 -0600 (CST) Subject: [PATCH] powerpc: Add some missing .gitignore's Message-ID: ignore generated files under arch/powerpc Signed-off-by: Kumar Gala --- commit 4ef3ebb801e686338c5a8c87863887c54b2af02e tree 384eb9502d8d4ef5d5452cfe7f43906366230454 parent 2c80aa14abcccdfdef2998ba78c299c33999c621 author Kumar Gala Tue, 10 Jan 2006 22:17:28 -0600 committer Kumar Gala Tue, 10 Jan 2006 22:17:28 -0600 arch/powerpc/boot/.gitignore | 20 ++++++++++++++++++++ arch/powerpc/kernel/vdso32/.gitignore | 1 + arch/powerpc/kernel/vdso64/.gitignore | 1 + 3 files changed, 22 insertions(+), 0 deletions(-) diff --git a/arch/powerpc/boot/.gitignore b/arch/powerpc/boot/.gitignore new file mode 100644 index 0000000..45c9ad2 --- /dev/null +++ b/arch/powerpc/boot/.gitignore @@ -0,0 +1,20 @@ +addnote +infblock.c +infblock.h +infcodes.c +infcodes.h +inffast.c +inffast.h +inflate.c +inftrees.c +inftrees.h +infutil.c +infutil.h +kernel-vmlinux.strip.c +kernel-vmlinux.strip.gz +uImage +zImage +zImage.vmode +zconf.h +zlib.h +zutil.h diff --git a/arch/powerpc/kernel/vdso32/.gitignore b/arch/powerpc/kernel/vdso32/.gitignore new file mode 100644 index 0000000..e45fba9 --- /dev/null +++ b/arch/powerpc/kernel/vdso32/.gitignore @@ -0,0 +1 @@ +vdso32.lds diff --git a/arch/powerpc/kernel/vdso64/.gitignore b/arch/powerpc/kernel/vdso64/.gitignore new file mode 100644 index 0000000..3fd18cf --- /dev/null +++ b/arch/powerpc/kernel/vdso64/.gitignore @@ -0,0 +1 @@ +vdso64.lds From michael at ellerman.id.au Wed Jan 11 15:27:24 2006 From: michael at ellerman.id.au (Michael Ellerman) Date: Wed, 11 Jan 2006 15:27:24 +1100 Subject: [PATCH 1/2] powerpc: Add ibm,pft-size to iSeries device tree Message-ID: <1136953644.458556.280731280882.qpush@concordia> To make iSeries just a teensy bit less special, create ibm,pft-size properties in the iSeries device tree. We can then rely on htab_dt_scan_pftsize() to set ppc64_pft_size for us. Signed-off-by: Michael Ellerman --- arch/powerpc/platforms/iseries/setup.c | 13 +++++++++++-- 1 files changed, 11 insertions(+), 2 deletions(-) Index: linux/arch/powerpc/platforms/iseries/setup.c =================================================================== --- linux.orig/arch/powerpc/platforms/iseries/setup.c +++ linux/arch/powerpc/platforms/iseries/setup.c @@ -474,8 +474,6 @@ static unsigned long __init build_iSerie printk("HPT absolute addr = %016lx, size = %dK\n", chunk_to_addr(hptFirstChunk), hptSizeChunks * 256); - ppc64_pft_size = __ilog2(hptSizePages * HW_PAGE_SIZE); - /* * The actual hashed page table is in the hypervisor, * we have no direct access @@ -861,6 +859,11 @@ void dt_prop_u64_list(struct iseries_fla dt_prop(dt, name, (char *)data, sizeof(u64) * n); } +void dt_prop_u32_list(struct iseries_flat_dt *dt, char *name, u32 *data, int n) +{ + dt_prop(dt, name, (char *)data, sizeof(u32) * n); +} + void dt_prop_empty(struct iseries_flat_dt *dt, char *name) { dt_prop(dt, name, NULL, 0); @@ -872,6 +875,7 @@ void dt_cpus(struct iseries_flat_dt *dt) unsigned char *p; unsigned int i, index; struct IoHriProcessorVpd *d; + u32 pft_size[2]; /* yuck */ snprintf(buf, 32, "PowerPC,%s", cur_cpu_spec->cpu_name); @@ -882,6 +886,9 @@ void dt_cpus(struct iseries_flat_dt *dt) dt_prop_u32(dt, "#address-cells", 1); dt_prop_u32(dt, "#size-cells", 0); + pft_size[0] = 0; /* NUMA CEC cookie, 0 for non NUMA */ + pft_size[1] = __ilog2(HvCallHpt_getHptPages() * HW_PAGE_SIZE); + for (i = 0; i < NR_CPUS; i++) { if (paca[i].lppaca.dyn_proc_status >= 2) continue; @@ -908,6 +915,8 @@ void dt_cpus(struct iseries_flat_dt *dt) dt_prop_u32(dt, "reg", i); + dt_prop_u32_list(dt, "ibm,pft-size", pft_size, 2); + dt_end_node(dt); } From michael at ellerman.id.au Wed Jan 11 15:27:25 2006 From: michael at ellerman.id.au (Michael Ellerman) Date: Wed, 11 Jan 2006 15:27:25 +1100 Subject: [PATCH 2/2] powerpc: Remove redundant setting of htab_address In-Reply-To: <1136953644.458556.280731280882.qpush@concordia> Message-ID: <20060111042735.70B13689DD@ozlabs.org> iSeries doesn't need to set the htab_address explicitly, htab_initialize() will do it for us later. Signed-off-by: Michael Ellerman --- arch/powerpc/platforms/iseries/setup.c | 6 ------ 1 files changed, 6 deletions(-) Index: linux/arch/powerpc/platforms/iseries/setup.c =================================================================== --- linux.orig/arch/powerpc/platforms/iseries/setup.c +++ linux/arch/powerpc/platforms/iseries/setup.c @@ -475,12 +475,6 @@ static unsigned long __init build_iSerie chunk_to_addr(hptFirstChunk), hptSizeChunks * 256); /* - * The actual hashed page table is in the hypervisor, - * we have no direct access - */ - htab_address = NULL; - - /* * Determine if absolute memory has any * holes so that we can interpret the * access map we get back from the hypervisor From paulus at samba.org Wed Jan 11 15:27:28 2006 From: paulus at samba.org (Paul Mackerras) Date: Wed, 11 Jan 2006 15:27:28 +1100 Subject: [PATCH] implement AT_PLATFORM for powerpc Message-ID: <17348.35120.840409.283964@cargo.ozlabs.ibm.com> The patch below makes powerpc kernels supply a value for the AT_PLATFORM aux table entry which is intended to indicate what class of processor the program is running on, so that glibc can optionally choose shared library objects which are optimized for the processor. The patch also adds a PPC_FEATURE_BOOKE bit to the AT_HWCAP value to indicate processors which conform to the Book E specification (as far as usermode is concerned), e.g. which have the isel, mbar and msync instructions. The set of AT_PLATFORM values is: "cell", "power3", "power4", "power5", "power5+", "powerpc", "ppc403", "ppc405", "ppc440", "ppc601", "ppc603", "ppc604", "ppc7400", "ppc7450", "ppc750", "ppc823", "ppc8540", "ppc970", "rs64". Note that the "powerpc" value is only used for the case where the PVR value is unrecognized. Comments? Paul. diff --git a/arch/powerpc/kernel/cputable.c b/arch/powerpc/kernel/cputable.c index 43c74a6..c37ed06 100644 --- a/arch/powerpc/kernel/cputable.c +++ b/arch/powerpc/kernel/cputable.c @@ -80,6 +80,7 @@ struct cpu_spec cpu_specs[] = { .cpu_setup = __setup_cpu_power3, .oprofile_cpu_type = "ppc64/power3", .oprofile_type = RS64, + .platform = "power3", }, { /* Power3+ */ .pvr_mask = 0xffff0000, @@ -93,6 +94,7 @@ struct cpu_spec cpu_specs[] = { .cpu_setup = __setup_cpu_power3, .oprofile_cpu_type = "ppc64/power3", .oprofile_type = RS64, + .platform = "power3", }, { /* Northstar */ .pvr_mask = 0xffff0000, @@ -106,6 +108,7 @@ struct cpu_spec cpu_specs[] = { .cpu_setup = __setup_cpu_power3, .oprofile_cpu_type = "ppc64/rs64", .oprofile_type = RS64, + .platform = "rs64", }, { /* Pulsar */ .pvr_mask = 0xffff0000, @@ -119,6 +122,7 @@ struct cpu_spec cpu_specs[] = { .cpu_setup = __setup_cpu_power3, .oprofile_cpu_type = "ppc64/rs64", .oprofile_type = RS64, + .platform = "rs64", }, { /* I-star */ .pvr_mask = 0xffff0000, @@ -132,6 +136,7 @@ struct cpu_spec cpu_specs[] = { .cpu_setup = __setup_cpu_power3, .oprofile_cpu_type = "ppc64/rs64", .oprofile_type = RS64, + .platform = "rs64", }, { /* S-star */ .pvr_mask = 0xffff0000, @@ -145,6 +150,7 @@ struct cpu_spec cpu_specs[] = { .cpu_setup = __setup_cpu_power3, .oprofile_cpu_type = "ppc64/rs64", .oprofile_type = RS64, + .platform = "rs64", }, { /* Power4 */ .pvr_mask = 0xffff0000, @@ -158,6 +164,7 @@ struct cpu_spec cpu_specs[] = { .cpu_setup = __setup_cpu_power4, .oprofile_cpu_type = "ppc64/power4", .oprofile_type = POWER4, + .platform = "power4", }, { /* Power4+ */ .pvr_mask = 0xffff0000, @@ -171,6 +178,7 @@ struct cpu_spec cpu_specs[] = { .cpu_setup = __setup_cpu_power4, .oprofile_cpu_type = "ppc64/power4", .oprofile_type = POWER4, + .platform = "power4", }, { /* PPC970 */ .pvr_mask = 0xffff0000, @@ -185,6 +193,7 @@ struct cpu_spec cpu_specs[] = { .cpu_setup = __setup_cpu_ppc970, .oprofile_cpu_type = "ppc64/970", .oprofile_type = POWER4, + .platform = "ppc970", }, #endif /* CONFIG_PPC64 */ #if defined(CONFIG_PPC64) || defined(CONFIG_POWER4) @@ -205,6 +214,7 @@ struct cpu_spec cpu_specs[] = { .cpu_setup = __setup_cpu_ppc970, .oprofile_cpu_type = "ppc64/970", .oprofile_type = POWER4, + .platform = "ppc970", }, #endif /* defined(CONFIG_PPC64) || defined(CONFIG_POWER4) */ #ifdef CONFIG_PPC64 @@ -220,6 +230,7 @@ struct cpu_spec cpu_specs[] = { .cpu_setup = __setup_cpu_ppc970, .oprofile_cpu_type = "ppc64/970", .oprofile_type = POWER4, + .platform = "ppc970", }, { /* Power5 GR */ .pvr_mask = 0xffff0000, @@ -233,6 +244,7 @@ struct cpu_spec cpu_specs[] = { .cpu_setup = __setup_cpu_power4, .oprofile_cpu_type = "ppc64/power5", .oprofile_type = POWER4, + .platform = "power5", }, { /* Power5 GS */ .pvr_mask = 0xffff0000, @@ -246,6 +258,7 @@ struct cpu_spec cpu_specs[] = { .cpu_setup = __setup_cpu_power4, .oprofile_cpu_type = "ppc64/power5+", .oprofile_type = POWER4, + .platform = "power5+", }, { /* Cell Broadband Engine */ .pvr_mask = 0xffff0000, @@ -257,6 +270,7 @@ struct cpu_spec cpu_specs[] = { .icache_bsize = 128, .dcache_bsize = 128, .cpu_setup = __setup_cpu_be, + .platform = "cell", }, { /* default match */ .pvr_mask = 0x00000000, @@ -268,6 +282,7 @@ struct cpu_spec cpu_specs[] = { .dcache_bsize = 128, .num_pmcs = 6, .cpu_setup = __setup_cpu_power4, + .platform = "power4", } #endif /* CONFIG_PPC64 */ #ifdef CONFIG_PPC32 @@ -281,6 +296,7 @@ struct cpu_spec cpu_specs[] = { PPC_FEATURE_UNIFIED_CACHE | PPC_FEATURE_NO_TB, .icache_bsize = 32, .dcache_bsize = 32, + .platform = "ppc601", }, { /* 603 */ .pvr_mask = 0xffff0000, @@ -290,7 +306,8 @@ struct cpu_spec cpu_specs[] = { .cpu_user_features = COMMON_USER, .icache_bsize = 32, .dcache_bsize = 32, - .cpu_setup = __setup_cpu_603 + .cpu_setup = __setup_cpu_603, + .platform = "ppc603", }, { /* 603e */ .pvr_mask = 0xffff0000, @@ -300,7 +317,8 @@ struct cpu_spec cpu_specs[] = { .cpu_user_features = COMMON_USER, .icache_bsize = 32, .dcache_bsize = 32, - .cpu_setup = __setup_cpu_603 + .cpu_setup = __setup_cpu_603, + .platform = "ppc603", }, { /* 603ev */ .pvr_mask = 0xffff0000, @@ -310,7 +328,8 @@ struct cpu_spec cpu_specs[] = { .cpu_user_features = COMMON_USER, .icache_bsize = 32, .dcache_bsize = 32, - .cpu_setup = __setup_cpu_603 + .cpu_setup = __setup_cpu_603, + .platform = "ppc603", }, { /* 604 */ .pvr_mask = 0xffff0000, @@ -321,7 +340,8 @@ struct cpu_spec cpu_specs[] = { .icache_bsize = 32, .dcache_bsize = 32, .num_pmcs = 2, - .cpu_setup = __setup_cpu_604 + .cpu_setup = __setup_cpu_604, + .platform = "ppc604", }, { /* 604e */ .pvr_mask = 0xfffff000, @@ -332,7 +352,8 @@ struct cpu_spec cpu_specs[] = { .icache_bsize = 32, .dcache_bsize = 32, .num_pmcs = 4, - .cpu_setup = __setup_cpu_604 + .cpu_setup = __setup_cpu_604, + .platform = "ppc604", }, { /* 604r */ .pvr_mask = 0xffff0000, @@ -343,7 +364,8 @@ struct cpu_spec cpu_specs[] = { .icache_bsize = 32, .dcache_bsize = 32, .num_pmcs = 4, - .cpu_setup = __setup_cpu_604 + .cpu_setup = __setup_cpu_604, + .platform = "ppc604", }, { /* 604ev */ .pvr_mask = 0xffff0000, @@ -354,7 +376,8 @@ struct cpu_spec cpu_specs[] = { .icache_bsize = 32, .dcache_bsize = 32, .num_pmcs = 4, - .cpu_setup = __setup_cpu_604 + .cpu_setup = __setup_cpu_604, + .platform = "ppc604", }, { /* 740/750 (0x4202, don't support TAU ?) */ .pvr_mask = 0xffffffff, @@ -365,7 +388,8 @@ struct cpu_spec cpu_specs[] = { .icache_bsize = 32, .dcache_bsize = 32, .num_pmcs = 4, - .cpu_setup = __setup_cpu_750 + .cpu_setup = __setup_cpu_750, + .platform = "ppc750", }, { /* 750CX (80100 and 8010x?) */ .pvr_mask = 0xfffffff0, @@ -376,7 +400,8 @@ struct cpu_spec cpu_specs[] = { .icache_bsize = 32, .dcache_bsize = 32, .num_pmcs = 4, - .cpu_setup = __setup_cpu_750cx + .cpu_setup = __setup_cpu_750cx, + .platform = "ppc750", }, { /* 750CX (82201 and 82202) */ .pvr_mask = 0xfffffff0, @@ -387,7 +412,8 @@ struct cpu_spec cpu_specs[] = { .icache_bsize = 32, .dcache_bsize = 32, .num_pmcs = 4, - .cpu_setup = __setup_cpu_750cx + .cpu_setup = __setup_cpu_750cx, + .platform = "ppc750", }, { /* 750CXe (82214) */ .pvr_mask = 0xfffffff0, @@ -398,7 +424,8 @@ struct cpu_spec cpu_specs[] = { .icache_bsize = 32, .dcache_bsize = 32, .num_pmcs = 4, - .cpu_setup = __setup_cpu_750cx + .cpu_setup = __setup_cpu_750cx, + .platform = "ppc750", }, { /* 750CXe "Gekko" (83214) */ .pvr_mask = 0xffffffff, @@ -409,7 +436,8 @@ struct cpu_spec cpu_specs[] = { .icache_bsize = 32, .dcache_bsize = 32, .num_pmcs = 4, - .cpu_setup = __setup_cpu_750cx + .cpu_setup = __setup_cpu_750cx, + .platform = "ppc750", }, { /* 745/755 */ .pvr_mask = 0xfffff000, @@ -420,7 +448,8 @@ struct cpu_spec cpu_specs[] = { .icache_bsize = 32, .dcache_bsize = 32, .num_pmcs = 4, - .cpu_setup = __setup_cpu_750 + .cpu_setup = __setup_cpu_750, + .platform = "ppc750", }, { /* 750FX rev 1.x */ .pvr_mask = 0xffffff00, @@ -431,7 +460,8 @@ struct cpu_spec cpu_specs[] = { .icache_bsize = 32, .dcache_bsize = 32, .num_pmcs = 4, - .cpu_setup = __setup_cpu_750 + .cpu_setup = __setup_cpu_750, + .platform = "ppc750", }, { /* 750FX rev 2.0 must disable HID0[DPM] */ .pvr_mask = 0xffffffff, @@ -442,7 +472,8 @@ struct cpu_spec cpu_specs[] = { .icache_bsize = 32, .dcache_bsize = 32, .num_pmcs = 4, - .cpu_setup = __setup_cpu_750 + .cpu_setup = __setup_cpu_750, + .platform = "ppc750", }, { /* 750FX (All revs except 2.0) */ .pvr_mask = 0xffff0000, @@ -453,7 +484,8 @@ struct cpu_spec cpu_specs[] = { .icache_bsize = 32, .dcache_bsize = 32, .num_pmcs = 4, - .cpu_setup = __setup_cpu_750fx + .cpu_setup = __setup_cpu_750fx, + .platform = "ppc750", }, { /* 750GX */ .pvr_mask = 0xffff0000, @@ -464,7 +496,8 @@ struct cpu_spec cpu_specs[] = { .icache_bsize = 32, .dcache_bsize = 32, .num_pmcs = 4, - .cpu_setup = __setup_cpu_750fx + .cpu_setup = __setup_cpu_750fx, + .platform = "ppc750", }, { /* 740/750 (L2CR bit need fixup for 740) */ .pvr_mask = 0xffff0000, @@ -475,7 +508,8 @@ struct cpu_spec cpu_specs[] = { .icache_bsize = 32, .dcache_bsize = 32, .num_pmcs = 4, - .cpu_setup = __setup_cpu_750 + .cpu_setup = __setup_cpu_750, + .platform = "ppc750", }, { /* 7400 rev 1.1 ? (no TAU) */ .pvr_mask = 0xffffffff, @@ -486,7 +520,8 @@ struct cpu_spec cpu_specs[] = { .icache_bsize = 32, .dcache_bsize = 32, .num_pmcs = 4, - .cpu_setup = __setup_cpu_7400 + .cpu_setup = __setup_cpu_7400, + .platform = "ppc7400", }, { /* 7400 */ .pvr_mask = 0xffff0000, @@ -497,7 +532,8 @@ struct cpu_spec cpu_specs[] = { .icache_bsize = 32, .dcache_bsize = 32, .num_pmcs = 4, - .cpu_setup = __setup_cpu_7400 + .cpu_setup = __setup_cpu_7400, + .platform = "ppc7400", }, { /* 7410 */ .pvr_mask = 0xffff0000, @@ -508,7 +544,8 @@ struct cpu_spec cpu_specs[] = { .icache_bsize = 32, .dcache_bsize = 32, .num_pmcs = 4, - .cpu_setup = __setup_cpu_7410 + .cpu_setup = __setup_cpu_7410, + .platform = "ppc7400", }, { /* 7450 2.0 - no doze/nap */ .pvr_mask = 0xffffffff, @@ -522,6 +559,7 @@ struct cpu_spec cpu_specs[] = { .cpu_setup = __setup_cpu_745x, .oprofile_cpu_type = "ppc/7450", .oprofile_type = G4, + .platform = "ppc7450", }, { /* 7450 2.1 */ .pvr_mask = 0xffffffff, @@ -535,6 +573,7 @@ struct cpu_spec cpu_specs[] = { .cpu_setup = __setup_cpu_745x, .oprofile_cpu_type = "ppc/7450", .oprofile_type = G4, + .platform = "ppc7450", }, { /* 7450 2.3 and newer */ .pvr_mask = 0xffff0000, @@ -548,6 +587,7 @@ struct cpu_spec cpu_specs[] = { .cpu_setup = __setup_cpu_745x, .oprofile_cpu_type = "ppc/7450", .oprofile_type = G4, + .platform = "ppc7450", }, { /* 7455 rev 1.x */ .pvr_mask = 0xffffff00, @@ -561,6 +601,7 @@ struct cpu_spec cpu_specs[] = { .cpu_setup = __setup_cpu_745x, .oprofile_cpu_type = "ppc/7450", .oprofile_type = G4, + .platform = "ppc7450", }, { /* 7455 rev 2.0 */ .pvr_mask = 0xffffffff, @@ -574,6 +615,7 @@ struct cpu_spec cpu_specs[] = { .cpu_setup = __setup_cpu_745x, .oprofile_cpu_type = "ppc/7450", .oprofile_type = G4, + .platform = "ppc7450", }, { /* 7455 others */ .pvr_mask = 0xffff0000, @@ -587,6 +629,7 @@ struct cpu_spec cpu_specs[] = { .cpu_setup = __setup_cpu_745x, .oprofile_cpu_type = "ppc/7450", .oprofile_type = G4, + .platform = "ppc7450", }, { /* 7447/7457 Rev 1.0 */ .pvr_mask = 0xffffffff, @@ -600,6 +643,7 @@ struct cpu_spec cpu_specs[] = { .cpu_setup = __setup_cpu_745x, .oprofile_cpu_type = "ppc/7450", .oprofile_type = G4, + .platform = "ppc7450", }, { /* 7447/7457 Rev 1.1 */ .pvr_mask = 0xffffffff, @@ -613,6 +657,7 @@ struct cpu_spec cpu_specs[] = { .cpu_setup = __setup_cpu_745x, .oprofile_cpu_type = "ppc/7450", .oprofile_type = G4, + .platform = "ppc7450", }, { /* 7447/7457 Rev 1.2 and later */ .pvr_mask = 0xffff0000, @@ -626,6 +671,7 @@ struct cpu_spec cpu_specs[] = { .cpu_setup = __setup_cpu_745x, .oprofile_cpu_type = "ppc/7450", .oprofile_type = G4, + .platform = "ppc7450", }, { /* 7447A */ .pvr_mask = 0xffff0000, @@ -639,6 +685,7 @@ struct cpu_spec cpu_specs[] = { .cpu_setup = __setup_cpu_745x, .oprofile_cpu_type = "ppc/7450", .oprofile_type = G4, + .platform = "ppc7450", }, { /* 7448 */ .pvr_mask = 0xffff0000, @@ -652,6 +699,7 @@ struct cpu_spec cpu_specs[] = { .cpu_setup = __setup_cpu_745x, .oprofile_cpu_type = "ppc/7450", .oprofile_type = G4, + .platform = "ppc7450", }, { /* 82xx (8240, 8245, 8260 are all 603e cores) */ .pvr_mask = 0x7fff0000, @@ -661,7 +709,8 @@ struct cpu_spec cpu_specs[] = { .cpu_user_features = COMMON_USER, .icache_bsize = 32, .dcache_bsize = 32, - .cpu_setup = __setup_cpu_603 + .cpu_setup = __setup_cpu_603, + .platform = "ppc603", }, { /* All G2_LE (603e core, plus some) have the same pvr */ .pvr_mask = 0x7fff0000, @@ -671,7 +720,8 @@ struct cpu_spec cpu_specs[] = { .cpu_user_features = COMMON_USER, .icache_bsize = 32, .dcache_bsize = 32, - .cpu_setup = __setup_cpu_603 + .cpu_setup = __setup_cpu_603, + .platform = "ppc603", }, { /* e300 (a 603e core, plus some) on 83xx */ .pvr_mask = 0x7fff0000, @@ -681,7 +731,8 @@ struct cpu_spec cpu_specs[] = { .cpu_user_features = COMMON_USER, .icache_bsize = 32, .dcache_bsize = 32, - .cpu_setup = __setup_cpu_603 + .cpu_setup = __setup_cpu_603, + .platform = "ppc603", }, { /* default match, we assume split I/D cache & TB (non-601)... */ .pvr_mask = 0x00000000, @@ -691,6 +742,7 @@ struct cpu_spec cpu_specs[] = { .cpu_user_features = COMMON_USER, .icache_bsize = 32, .dcache_bsize = 32, + .platform = "ppc603", }, #endif /* CLASSIC_PPC */ #ifdef CONFIG_8xx @@ -704,6 +756,7 @@ struct cpu_spec cpu_specs[] = { .cpu_user_features = PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU, .icache_bsize = 16, .dcache_bsize = 16, + .platform = "ppc823", }, #endif /* CONFIG_8xx */ #ifdef CONFIG_40x @@ -715,6 +768,7 @@ struct cpu_spec cpu_specs[] = { .cpu_user_features = PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU, .icache_bsize = 16, .dcache_bsize = 16, + .platform = "ppc403", }, { /* 403GCX */ .pvr_mask = 0xffffff00, @@ -725,6 +779,7 @@ struct cpu_spec cpu_specs[] = { PPC_FEATURE_HAS_MMU | PPC_FEATURE_NO_TB, .icache_bsize = 16, .dcache_bsize = 16, + .platform = "ppc403", }, { /* 403G ?? */ .pvr_mask = 0xffff0000, @@ -734,6 +789,7 @@ struct cpu_spec cpu_specs[] = { .cpu_user_features = PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU, .icache_bsize = 16, .dcache_bsize = 16, + .platform = "ppc403", }, { /* 405GP */ .pvr_mask = 0xffff0000, @@ -744,6 +800,7 @@ struct cpu_spec cpu_specs[] = { PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC, .icache_bsize = 32, .dcache_bsize = 32, + .platform = "ppc405", }, { /* STB 03xxx */ .pvr_mask = 0xffff0000, @@ -754,6 +811,7 @@ struct cpu_spec cpu_specs[] = { PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC, .icache_bsize = 32, .dcache_bsize = 32, + .platform = "ppc405", }, { /* STB 04xxx */ .pvr_mask = 0xffff0000, @@ -764,6 +822,7 @@ struct cpu_spec cpu_specs[] = { PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC, .icache_bsize = 32, .dcache_bsize = 32, + .platform = "ppc405", }, { /* NP405L */ .pvr_mask = 0xffff0000, @@ -774,6 +833,7 @@ struct cpu_spec cpu_specs[] = { PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC, .icache_bsize = 32, .dcache_bsize = 32, + .platform = "ppc405", }, { /* NP4GS3 */ .pvr_mask = 0xffff0000, @@ -784,6 +844,7 @@ struct cpu_spec cpu_specs[] = { PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC, .icache_bsize = 32, .dcache_bsize = 32, + .platform = "ppc405", }, { /* NP405H */ .pvr_mask = 0xffff0000, @@ -794,6 +855,7 @@ struct cpu_spec cpu_specs[] = { PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC, .icache_bsize = 32, .dcache_bsize = 32, + .platform = "ppc405", }, { /* 405GPr */ .pvr_mask = 0xffff0000, @@ -804,6 +866,7 @@ struct cpu_spec cpu_specs[] = { PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC, .icache_bsize = 32, .dcache_bsize = 32, + .platform = "ppc405", }, { /* STBx25xx */ .pvr_mask = 0xffff0000, @@ -814,6 +877,7 @@ struct cpu_spec cpu_specs[] = { PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC, .icache_bsize = 32, .dcache_bsize = 32, + .platform = "ppc405", }, { /* 405LP */ .pvr_mask = 0xffff0000, @@ -823,6 +887,7 @@ struct cpu_spec cpu_specs[] = { .cpu_user_features = PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU, .icache_bsize = 32, .dcache_bsize = 32, + .platform = "ppc405", }, { /* Xilinx Virtex-II Pro */ .pvr_mask = 0xffff0000, @@ -833,6 +898,7 @@ struct cpu_spec cpu_specs[] = { PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC, .icache_bsize = 32, .dcache_bsize = 32, + .platform = "ppc405", }, { /* 405EP */ .pvr_mask = 0xffff0000, @@ -843,6 +909,7 @@ struct cpu_spec cpu_specs[] = { PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC, .icache_bsize = 32, .dcache_bsize = 32, + .platform = "ppc405", }, #endif /* CONFIG_40x */ @@ -855,6 +922,7 @@ struct cpu_spec cpu_specs[] = { .cpu_user_features = COMMON_USER, /* 440EP has an FPU */ .icache_bsize = 32, .dcache_bsize = 32, + .platform = "ppc440", }, { .pvr_mask = 0xf0000fff, @@ -864,6 +932,7 @@ struct cpu_spec cpu_specs[] = { .cpu_user_features = COMMON_USER, /* 440EP has an FPU */ .icache_bsize = 32, .dcache_bsize = 32, + .platform = "ppc440", }, { /* 440GP Rev. B */ .pvr_mask = 0xf0000fff, @@ -873,6 +942,7 @@ struct cpu_spec cpu_specs[] = { .cpu_user_features = PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU, .icache_bsize = 32, .dcache_bsize = 32, + .platform = "ppc440", }, { /* 440GP Rev. C */ .pvr_mask = 0xf0000fff, @@ -882,6 +952,7 @@ struct cpu_spec cpu_specs[] = { .cpu_user_features = PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU, .icache_bsize = 32, .dcache_bsize = 32, + .platform = "ppc440", }, { /* 440GX Rev. A */ .pvr_mask = 0xf0000fff, @@ -891,6 +962,7 @@ struct cpu_spec cpu_specs[] = { .cpu_user_features = PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU, .icache_bsize = 32, .dcache_bsize = 32, + .platform = "ppc440", }, { /* 440GX Rev. B */ .pvr_mask = 0xf0000fff, @@ -900,6 +972,7 @@ struct cpu_spec cpu_specs[] = { .cpu_user_features = PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU, .icache_bsize = 32, .dcache_bsize = 32, + .platform = "ppc440", }, { /* 440GX Rev. C */ .pvr_mask = 0xf0000fff, @@ -909,6 +982,7 @@ struct cpu_spec cpu_specs[] = { .cpu_user_features = PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU, .icache_bsize = 32, .dcache_bsize = 32, + .platform = "ppc440", }, { /* 440GX Rev. F */ .pvr_mask = 0xf0000fff, @@ -918,6 +992,7 @@ struct cpu_spec cpu_specs[] = { .cpu_user_features = PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU, .icache_bsize = 32, .dcache_bsize = 32, + .platform = "ppc440", }, { /* 440SP Rev. A */ .pvr_mask = 0xff000fff, @@ -927,6 +1002,7 @@ struct cpu_spec cpu_specs[] = { .cpu_user_features = PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU, .icache_bsize = 32, .dcache_bsize = 32, + .platform = "ppc440", }, { /* 440SPe Rev. A */ .pvr_mask = 0xff000fff, @@ -937,6 +1013,7 @@ struct cpu_spec cpu_specs[] = { .cpu_user_features = PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU, .icache_bsize = 32, .dcache_bsize = 32, + .platform = "ppc440", }, #endif /* CONFIG_44x */ #ifdef CONFIG_FSL_BOOKE @@ -950,6 +1027,7 @@ struct cpu_spec cpu_specs[] = { PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_EFP_SINGLE | PPC_FEATURE_UNIFIED_CACHE, .dcache_bsize = 32, + .platform = "ppc8540", }, { /* e200z6 */ .pvr_mask = 0xfff00000, @@ -962,6 +1040,7 @@ struct cpu_spec cpu_specs[] = { PPC_FEATURE_HAS_EFP_SINGLE | PPC_FEATURE_UNIFIED_CACHE, .dcache_bsize = 32, + .platform = "ppc8540", }, { /* e500 */ .pvr_mask = 0xffff0000, @@ -977,6 +1056,7 @@ struct cpu_spec cpu_specs[] = { .num_pmcs = 4, .oprofile_cpu_type = "ppc/e500", .oprofile_type = BOOKE, + .platform = "ppc8540", }, { /* e500v2 */ .pvr_mask = 0xffff0000, @@ -992,6 +1072,7 @@ struct cpu_spec cpu_specs[] = { .num_pmcs = 4, .oprofile_cpu_type = "ppc/e500", .oprofile_type = BOOKE, + .platform = "ppc8540", }, #endif #if !CLASSIC_PPC @@ -1003,6 +1084,7 @@ struct cpu_spec cpu_specs[] = { .cpu_user_features = PPC_FEATURE_32, .icache_bsize = 32, .dcache_bsize = 32, + .platform = "powerpc", } #endif /* !CLASSIC_PPC */ #endif /* CONFIG_PPC32 */ diff --git a/include/asm-powerpc/cputable.h b/include/asm-powerpc/cputable.h index ef6ead3..03017d9 100644 --- a/include/asm-powerpc/cputable.h +++ b/include/asm-powerpc/cputable.h @@ -19,6 +19,7 @@ #define PPC_FEATURE_POWER5 0x00040000 #define PPC_FEATURE_POWER5_PLUS 0x00020000 #define PPC_FEATURE_CELL 0x00010000 +#define PPC_FEATURE_BOOKE 0x00008000 #ifdef __KERNEL__ #ifndef __ASSEMBLY__ @@ -64,6 +65,9 @@ struct cpu_spec { /* Processor specific oprofile operations */ enum powerpc_oprofile_type oprofile_type; + + /* Name of processor class, for the ELF AT_PLATFORM entry */ + char *platform; }; extern struct cpu_spec *cur_cpu_spec; diff --git a/include/asm-powerpc/elf.h b/include/asm-powerpc/elf.h index c5a635d..a75e975 100644 --- a/include/asm-powerpc/elf.h +++ b/include/asm-powerpc/elf.h @@ -222,20 +222,18 @@ extern int dump_task_fpu(struct task_str instruction set this cpu supports. This could be done in userspace, but it's not easy, and we've already done it here. */ # define ELF_HWCAP (cur_cpu_spec->cpu_user_features) -#ifdef __powerpc64__ -# define ELF_PLAT_INIT(_r, load_addr) do { \ - _r->gpr[2] = load_addr; \ -} while (0) -#endif /* __powerpc64__ */ /* This yields a string that ld.so will use to load implementation specific libraries for optimization. This is more specific in - intent than poking at uname or /proc/cpuinfo. + intent than poking at uname or /proc/cpuinfo. */ - For the moment, we have only optimizations for the Intel generations, - but that could change... */ +#define ELF_PLATFORM (cur_cpu_spec->platform) -#define ELF_PLATFORM (NULL) +#ifdef __powerpc64__ +# define ELF_PLAT_INIT(_r, load_addr) do { \ + _r->gpr[2] = load_addr; \ +} while (0) +#endif /* __powerpc64__ */ #ifdef __KERNEL__ From anton at samba.org Wed Jan 11 15:19:11 2006 From: anton at samba.org (Anton Blanchard) Date: Wed, 11 Jan 2006 15:19:11 +1100 Subject: [PATCH] ppc64: per cpu data optimisations In-Reply-To: <20060111023654.GB2846@localhost.localdomain> References: <20060111021644.GC4767@krispykreme> <20060111023654.GB2846@localhost.localdomain> Message-ID: <20060111041911.GA26421@krispykreme> Hi Nathan, > Anton Blanchard wrote: > > +#define percpu_modcopy(pcpudst, src, size) \ > > +do { \ > > + unsigned int __i; \ > > + for (__i = 0; __i < NR_CPUS; __i++) \ > > + if (cpu_possible(__i)) \ > > Nitpick - could be for_each_cpu(__i)? Or am I missing something > subtle? Makes sense, although this is straight out of the asm-generic percpu code. Might be worth a patch to attack the 5 versions of percpu_modcopy that all do the above :) Anton From galak at gate.crashing.org Wed Jan 11 15:48:59 2006 From: galak at gate.crashing.org (Kumar Gala) Date: Tue, 10 Jan 2006 22:48:59 -0600 (CST) Subject: [PATCH] implement AT_PLATFORM for powerpc In-Reply-To: <17348.35120.840409.283964@cargo.ozlabs.ibm.com> Message-ID: We should probably add two new AT_PLATFORM: "ppc8548" and "ppc5554". "ppc8548" should be used for e500v2, and "ppc5554" for "e200z6". You aren't seeting PPC_FEATURE_BOOKE for anything. We need to be a little careful since 'isel' isn't implemented in the very first 440's. - kumar On Wed, 11 Jan 2006, Paul Mackerras wrote: > The patch below makes powerpc kernels supply a value for the > AT_PLATFORM aux table entry which is intended to indicate what class > of processor the program is running on, so that glibc can optionally > choose shared library objects which are optimized for the processor. > > The patch also adds a PPC_FEATURE_BOOKE bit to the AT_HWCAP value to > indicate processors which conform to the Book E specification (as far > as usermode is concerned), e.g. which have the isel, mbar and msync > instructions. > > The set of AT_PLATFORM values is: "cell", "power3", "power4", > "power5", "power5+", "powerpc", "ppc403", "ppc405", "ppc440", > "ppc601", "ppc603", "ppc604", "ppc7400", "ppc7450", "ppc750", > "ppc823", "ppc8540", "ppc970", "rs64". > > Note that the "powerpc" value is only used for the case where the PVR > value is unrecognized. > > Comments? > > Paul. > > diff --git a/arch/powerpc/kernel/cputable.c b/arch/powerpc/kernel/cputable.c > index 43c74a6..c37ed06 100644 > --- a/arch/powerpc/kernel/cputable.c > +++ b/arch/powerpc/kernel/cputable.c > @@ -80,6 +80,7 @@ struct cpu_spec cpu_specs[] = { > .cpu_setup = __setup_cpu_power3, > .oprofile_cpu_type = "ppc64/power3", > .oprofile_type = RS64, > + .platform = "power3", > }, > { /* Power3+ */ > .pvr_mask = 0xffff0000, > @@ -93,6 +94,7 @@ struct cpu_spec cpu_specs[] = { > .cpu_setup = __setup_cpu_power3, > .oprofile_cpu_type = "ppc64/power3", > .oprofile_type = RS64, > + .platform = "power3", > }, > { /* Northstar */ > .pvr_mask = 0xffff0000, > @@ -106,6 +108,7 @@ struct cpu_spec cpu_specs[] = { > .cpu_setup = __setup_cpu_power3, > .oprofile_cpu_type = "ppc64/rs64", > .oprofile_type = RS64, > + .platform = "rs64", > }, > { /* Pulsar */ > .pvr_mask = 0xffff0000, > @@ -119,6 +122,7 @@ struct cpu_spec cpu_specs[] = { > .cpu_setup = __setup_cpu_power3, > .oprofile_cpu_type = "ppc64/rs64", > .oprofile_type = RS64, > + .platform = "rs64", > }, > { /* I-star */ > .pvr_mask = 0xffff0000, > @@ -132,6 +136,7 @@ struct cpu_spec cpu_specs[] = { > .cpu_setup = __setup_cpu_power3, > .oprofile_cpu_type = "ppc64/rs64", > .oprofile_type = RS64, > + .platform = "rs64", > }, > { /* S-star */ > .pvr_mask = 0xffff0000, > @@ -145,6 +150,7 @@ struct cpu_spec cpu_specs[] = { > .cpu_setup = __setup_cpu_power3, > .oprofile_cpu_type = "ppc64/rs64", > .oprofile_type = RS64, > + .platform = "rs64", > }, > { /* Power4 */ > .pvr_mask = 0xffff0000, > @@ -158,6 +164,7 @@ struct cpu_spec cpu_specs[] = { > .cpu_setup = __setup_cpu_power4, > .oprofile_cpu_type = "ppc64/power4", > .oprofile_type = POWER4, > + .platform = "power4", > }, > { /* Power4+ */ > .pvr_mask = 0xffff0000, > @@ -171,6 +178,7 @@ struct cpu_spec cpu_specs[] = { > .cpu_setup = __setup_cpu_power4, > .oprofile_cpu_type = "ppc64/power4", > .oprofile_type = POWER4, > + .platform = "power4", > }, > { /* PPC970 */ > .pvr_mask = 0xffff0000, > @@ -185,6 +193,7 @@ struct cpu_spec cpu_specs[] = { > .cpu_setup = __setup_cpu_ppc970, > .oprofile_cpu_type = "ppc64/970", > .oprofile_type = POWER4, > + .platform = "ppc970", > }, > #endif /* CONFIG_PPC64 */ > #if defined(CONFIG_PPC64) || defined(CONFIG_POWER4) > @@ -205,6 +214,7 @@ struct cpu_spec cpu_specs[] = { > .cpu_setup = __setup_cpu_ppc970, > .oprofile_cpu_type = "ppc64/970", > .oprofile_type = POWER4, > + .platform = "ppc970", > }, > #endif /* defined(CONFIG_PPC64) || defined(CONFIG_POWER4) */ > #ifdef CONFIG_PPC64 > @@ -220,6 +230,7 @@ struct cpu_spec cpu_specs[] = { > .cpu_setup = __setup_cpu_ppc970, > .oprofile_cpu_type = "ppc64/970", > .oprofile_type = POWER4, > + .platform = "ppc970", > }, > { /* Power5 GR */ > .pvr_mask = 0xffff0000, > @@ -233,6 +244,7 @@ struct cpu_spec cpu_specs[] = { > .cpu_setup = __setup_cpu_power4, > .oprofile_cpu_type = "ppc64/power5", > .oprofile_type = POWER4, > + .platform = "power5", > }, > { /* Power5 GS */ > .pvr_mask = 0xffff0000, > @@ -246,6 +258,7 @@ struct cpu_spec cpu_specs[] = { > .cpu_setup = __setup_cpu_power4, > .oprofile_cpu_type = "ppc64/power5+", > .oprofile_type = POWER4, > + .platform = "power5+", > }, > { /* Cell Broadband Engine */ > .pvr_mask = 0xffff0000, > @@ -257,6 +270,7 @@ struct cpu_spec cpu_specs[] = { > .icache_bsize = 128, > .dcache_bsize = 128, > .cpu_setup = __setup_cpu_be, > + .platform = "cell", > }, > { /* default match */ > .pvr_mask = 0x00000000, > @@ -268,6 +282,7 @@ struct cpu_spec cpu_specs[] = { > .dcache_bsize = 128, > .num_pmcs = 6, > .cpu_setup = __setup_cpu_power4, > + .platform = "power4", > } > #endif /* CONFIG_PPC64 */ > #ifdef CONFIG_PPC32 > @@ -281,6 +296,7 @@ struct cpu_spec cpu_specs[] = { > PPC_FEATURE_UNIFIED_CACHE | PPC_FEATURE_NO_TB, > .icache_bsize = 32, > .dcache_bsize = 32, > + .platform = "ppc601", > }, > { /* 603 */ > .pvr_mask = 0xffff0000, > @@ -290,7 +306,8 @@ struct cpu_spec cpu_specs[] = { > .cpu_user_features = COMMON_USER, > .icache_bsize = 32, > .dcache_bsize = 32, > - .cpu_setup = __setup_cpu_603 > + .cpu_setup = __setup_cpu_603, > + .platform = "ppc603", > }, > { /* 603e */ > .pvr_mask = 0xffff0000, > @@ -300,7 +317,8 @@ struct cpu_spec cpu_specs[] = { > .cpu_user_features = COMMON_USER, > .icache_bsize = 32, > .dcache_bsize = 32, > - .cpu_setup = __setup_cpu_603 > + .cpu_setup = __setup_cpu_603, > + .platform = "ppc603", > }, > { /* 603ev */ > .pvr_mask = 0xffff0000, > @@ -310,7 +328,8 @@ struct cpu_spec cpu_specs[] = { > .cpu_user_features = COMMON_USER, > .icache_bsize = 32, > .dcache_bsize = 32, > - .cpu_setup = __setup_cpu_603 > + .cpu_setup = __setup_cpu_603, > + .platform = "ppc603", > }, > { /* 604 */ > .pvr_mask = 0xffff0000, > @@ -321,7 +340,8 @@ struct cpu_spec cpu_specs[] = { > .icache_bsize = 32, > .dcache_bsize = 32, > .num_pmcs = 2, > - .cpu_setup = __setup_cpu_604 > + .cpu_setup = __setup_cpu_604, > + .platform = "ppc604", > }, > { /* 604e */ > .pvr_mask = 0xfffff000, > @@ -332,7 +352,8 @@ struct cpu_spec cpu_specs[] = { > .icache_bsize = 32, > .dcache_bsize = 32, > .num_pmcs = 4, > - .cpu_setup = __setup_cpu_604 > + .cpu_setup = __setup_cpu_604, > + .platform = "ppc604", > }, > { /* 604r */ > .pvr_mask = 0xffff0000, > @@ -343,7 +364,8 @@ struct cpu_spec cpu_specs[] = { > .icache_bsize = 32, > .dcache_bsize = 32, > .num_pmcs = 4, > - .cpu_setup = __setup_cpu_604 > + .cpu_setup = __setup_cpu_604, > + .platform = "ppc604", > }, > { /* 604ev */ > .pvr_mask = 0xffff0000, > @@ -354,7 +376,8 @@ struct cpu_spec cpu_specs[] = { > .icache_bsize = 32, > .dcache_bsize = 32, > .num_pmcs = 4, > - .cpu_setup = __setup_cpu_604 > + .cpu_setup = __setup_cpu_604, > + .platform = "ppc604", > }, > { /* 740/750 (0x4202, don't support TAU ?) */ > .pvr_mask = 0xffffffff, > @@ -365,7 +388,8 @@ struct cpu_spec cpu_specs[] = { > .icache_bsize = 32, > .dcache_bsize = 32, > .num_pmcs = 4, > - .cpu_setup = __setup_cpu_750 > + .cpu_setup = __setup_cpu_750, > + .platform = "ppc750", > }, > { /* 750CX (80100 and 8010x?) */ > .pvr_mask = 0xfffffff0, > @@ -376,7 +400,8 @@ struct cpu_spec cpu_specs[] = { > .icache_bsize = 32, > .dcache_bsize = 32, > .num_pmcs = 4, > - .cpu_setup = __setup_cpu_750cx > + .cpu_setup = __setup_cpu_750cx, > + .platform = "ppc750", > }, > { /* 750CX (82201 and 82202) */ > .pvr_mask = 0xfffffff0, > @@ -387,7 +412,8 @@ struct cpu_spec cpu_specs[] = { > .icache_bsize = 32, > .dcache_bsize = 32, > .num_pmcs = 4, > - .cpu_setup = __setup_cpu_750cx > + .cpu_setup = __setup_cpu_750cx, > + .platform = "ppc750", > }, > { /* 750CXe (82214) */ > .pvr_mask = 0xfffffff0, > @@ -398,7 +424,8 @@ struct cpu_spec cpu_specs[] = { > .icache_bsize = 32, > .dcache_bsize = 32, > .num_pmcs = 4, > - .cpu_setup = __setup_cpu_750cx > + .cpu_setup = __setup_cpu_750cx, > + .platform = "ppc750", > }, > { /* 750CXe "Gekko" (83214) */ > .pvr_mask = 0xffffffff, > @@ -409,7 +436,8 @@ struct cpu_spec cpu_specs[] = { > .icache_bsize = 32, > .dcache_bsize = 32, > .num_pmcs = 4, > - .cpu_setup = __setup_cpu_750cx > + .cpu_setup = __setup_cpu_750cx, > + .platform = "ppc750", > }, > { /* 745/755 */ > .pvr_mask = 0xfffff000, > @@ -420,7 +448,8 @@ struct cpu_spec cpu_specs[] = { > .icache_bsize = 32, > .dcache_bsize = 32, > .num_pmcs = 4, > - .cpu_setup = __setup_cpu_750 > + .cpu_setup = __setup_cpu_750, > + .platform = "ppc750", > }, > { /* 750FX rev 1.x */ > .pvr_mask = 0xffffff00, > @@ -431,7 +460,8 @@ struct cpu_spec cpu_specs[] = { > .icache_bsize = 32, > .dcache_bsize = 32, > .num_pmcs = 4, > - .cpu_setup = __setup_cpu_750 > + .cpu_setup = __setup_cpu_750, > + .platform = "ppc750", > }, > { /* 750FX rev 2.0 must disable HID0[DPM] */ > .pvr_mask = 0xffffffff, > @@ -442,7 +472,8 @@ struct cpu_spec cpu_specs[] = { > .icache_bsize = 32, > .dcache_bsize = 32, > .num_pmcs = 4, > - .cpu_setup = __setup_cpu_750 > + .cpu_setup = __setup_cpu_750, > + .platform = "ppc750", > }, > { /* 750FX (All revs except 2.0) */ > .pvr_mask = 0xffff0000, > @@ -453,7 +484,8 @@ struct cpu_spec cpu_specs[] = { > .icache_bsize = 32, > .dcache_bsize = 32, > .num_pmcs = 4, > - .cpu_setup = __setup_cpu_750fx > + .cpu_setup = __setup_cpu_750fx, > + .platform = "ppc750", > }, > { /* 750GX */ > .pvr_mask = 0xffff0000, > @@ -464,7 +496,8 @@ struct cpu_spec cpu_specs[] = { > .icache_bsize = 32, > .dcache_bsize = 32, > .num_pmcs = 4, > - .cpu_setup = __setup_cpu_750fx > + .cpu_setup = __setup_cpu_750fx, > + .platform = "ppc750", > }, > { /* 740/750 (L2CR bit need fixup for 740) */ > .pvr_mask = 0xffff0000, > @@ -475,7 +508,8 @@ struct cpu_spec cpu_specs[] = { > .icache_bsize = 32, > .dcache_bsize = 32, > .num_pmcs = 4, > - .cpu_setup = __setup_cpu_750 > + .cpu_setup = __setup_cpu_750, > + .platform = "ppc750", > }, > { /* 7400 rev 1.1 ? (no TAU) */ > .pvr_mask = 0xffffffff, > @@ -486,7 +520,8 @@ struct cpu_spec cpu_specs[] = { > .icache_bsize = 32, > .dcache_bsize = 32, > .num_pmcs = 4, > - .cpu_setup = __setup_cpu_7400 > + .cpu_setup = __setup_cpu_7400, > + .platform = "ppc7400", > }, > { /* 7400 */ > .pvr_mask = 0xffff0000, > @@ -497,7 +532,8 @@ struct cpu_spec cpu_specs[] = { > .icache_bsize = 32, > .dcache_bsize = 32, > .num_pmcs = 4, > - .cpu_setup = __setup_cpu_7400 > + .cpu_setup = __setup_cpu_7400, > + .platform = "ppc7400", > }, > { /* 7410 */ > .pvr_mask = 0xffff0000, > @@ -508,7 +544,8 @@ struct cpu_spec cpu_specs[] = { > .icache_bsize = 32, > .dcache_bsize = 32, > .num_pmcs = 4, > - .cpu_setup = __setup_cpu_7410 > + .cpu_setup = __setup_cpu_7410, > + .platform = "ppc7400", > }, > { /* 7450 2.0 - no doze/nap */ > .pvr_mask = 0xffffffff, > @@ -522,6 +559,7 @@ struct cpu_spec cpu_specs[] = { > .cpu_setup = __setup_cpu_745x, > .oprofile_cpu_type = "ppc/7450", > .oprofile_type = G4, > + .platform = "ppc7450", > }, > { /* 7450 2.1 */ > .pvr_mask = 0xffffffff, > @@ -535,6 +573,7 @@ struct cpu_spec cpu_specs[] = { > .cpu_setup = __setup_cpu_745x, > .oprofile_cpu_type = "ppc/7450", > .oprofile_type = G4, > + .platform = "ppc7450", > }, > { /* 7450 2.3 and newer */ > .pvr_mask = 0xffff0000, > @@ -548,6 +587,7 @@ struct cpu_spec cpu_specs[] = { > .cpu_setup = __setup_cpu_745x, > .oprofile_cpu_type = "ppc/7450", > .oprofile_type = G4, > + .platform = "ppc7450", > }, > { /* 7455 rev 1.x */ > .pvr_mask = 0xffffff00, > @@ -561,6 +601,7 @@ struct cpu_spec cpu_specs[] = { > .cpu_setup = __setup_cpu_745x, > .oprofile_cpu_type = "ppc/7450", > .oprofile_type = G4, > + .platform = "ppc7450", > }, > { /* 7455 rev 2.0 */ > .pvr_mask = 0xffffffff, > @@ -574,6 +615,7 @@ struct cpu_spec cpu_specs[] = { > .cpu_setup = __setup_cpu_745x, > .oprofile_cpu_type = "ppc/7450", > .oprofile_type = G4, > + .platform = "ppc7450", > }, > { /* 7455 others */ > .pvr_mask = 0xffff0000, > @@ -587,6 +629,7 @@ struct cpu_spec cpu_specs[] = { > .cpu_setup = __setup_cpu_745x, > .oprofile_cpu_type = "ppc/7450", > .oprofile_type = G4, > + .platform = "ppc7450", > }, > { /* 7447/7457 Rev 1.0 */ > .pvr_mask = 0xffffffff, > @@ -600,6 +643,7 @@ struct cpu_spec cpu_specs[] = { > .cpu_setup = __setup_cpu_745x, > .oprofile_cpu_type = "ppc/7450", > .oprofile_type = G4, > + .platform = "ppc7450", > }, > { /* 7447/7457 Rev 1.1 */ > .pvr_mask = 0xffffffff, > @@ -613,6 +657,7 @@ struct cpu_spec cpu_specs[] = { > .cpu_setup = __setup_cpu_745x, > .oprofile_cpu_type = "ppc/7450", > .oprofile_type = G4, > + .platform = "ppc7450", > }, > { /* 7447/7457 Rev 1.2 and later */ > .pvr_mask = 0xffff0000, > @@ -626,6 +671,7 @@ struct cpu_spec cpu_specs[] = { > .cpu_setup = __setup_cpu_745x, > .oprofile_cpu_type = "ppc/7450", > .oprofile_type = G4, > + .platform = "ppc7450", > }, > { /* 7447A */ > .pvr_mask = 0xffff0000, > @@ -639,6 +685,7 @@ struct cpu_spec cpu_specs[] = { > .cpu_setup = __setup_cpu_745x, > .oprofile_cpu_type = "ppc/7450", > .oprofile_type = G4, > + .platform = "ppc7450", > }, > { /* 7448 */ > .pvr_mask = 0xffff0000, > @@ -652,6 +699,7 @@ struct cpu_spec cpu_specs[] = { > .cpu_setup = __setup_cpu_745x, > .oprofile_cpu_type = "ppc/7450", > .oprofile_type = G4, > + .platform = "ppc7450", > }, > { /* 82xx (8240, 8245, 8260 are all 603e cores) */ > .pvr_mask = 0x7fff0000, > @@ -661,7 +709,8 @@ struct cpu_spec cpu_specs[] = { > .cpu_user_features = COMMON_USER, > .icache_bsize = 32, > .dcache_bsize = 32, > - .cpu_setup = __setup_cpu_603 > + .cpu_setup = __setup_cpu_603, > + .platform = "ppc603", > }, > { /* All G2_LE (603e core, plus some) have the same pvr */ > .pvr_mask = 0x7fff0000, > @@ -671,7 +720,8 @@ struct cpu_spec cpu_specs[] = { > .cpu_user_features = COMMON_USER, > .icache_bsize = 32, > .dcache_bsize = 32, > - .cpu_setup = __setup_cpu_603 > + .cpu_setup = __setup_cpu_603, > + .platform = "ppc603", > }, > { /* e300 (a 603e core, plus some) on 83xx */ > .pvr_mask = 0x7fff0000, > @@ -681,7 +731,8 @@ struct cpu_spec cpu_specs[] = { > .cpu_user_features = COMMON_USER, > .icache_bsize = 32, > .dcache_bsize = 32, > - .cpu_setup = __setup_cpu_603 > + .cpu_setup = __setup_cpu_603, > + .platform = "ppc603", > }, > { /* default match, we assume split I/D cache & TB (non-601)... */ > .pvr_mask = 0x00000000, > @@ -691,6 +742,7 @@ struct cpu_spec cpu_specs[] = { > .cpu_user_features = COMMON_USER, > .icache_bsize = 32, > .dcache_bsize = 32, > + .platform = "ppc603", > }, > #endif /* CLASSIC_PPC */ > #ifdef CONFIG_8xx > @@ -704,6 +756,7 @@ struct cpu_spec cpu_specs[] = { > .cpu_user_features = PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU, > .icache_bsize = 16, > .dcache_bsize = 16, > + .platform = "ppc823", > }, > #endif /* CONFIG_8xx */ > #ifdef CONFIG_40x > @@ -715,6 +768,7 @@ struct cpu_spec cpu_specs[] = { > .cpu_user_features = PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU, > .icache_bsize = 16, > .dcache_bsize = 16, > + .platform = "ppc403", > }, > { /* 403GCX */ > .pvr_mask = 0xffffff00, > @@ -725,6 +779,7 @@ struct cpu_spec cpu_specs[] = { > PPC_FEATURE_HAS_MMU | PPC_FEATURE_NO_TB, > .icache_bsize = 16, > .dcache_bsize = 16, > + .platform = "ppc403", > }, > { /* 403G ?? */ > .pvr_mask = 0xffff0000, > @@ -734,6 +789,7 @@ struct cpu_spec cpu_specs[] = { > .cpu_user_features = PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU, > .icache_bsize = 16, > .dcache_bsize = 16, > + .platform = "ppc403", > }, > { /* 405GP */ > .pvr_mask = 0xffff0000, > @@ -744,6 +800,7 @@ struct cpu_spec cpu_specs[] = { > PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC, > .icache_bsize = 32, > .dcache_bsize = 32, > + .platform = "ppc405", > }, > { /* STB 03xxx */ > .pvr_mask = 0xffff0000, > @@ -754,6 +811,7 @@ struct cpu_spec cpu_specs[] = { > PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC, > .icache_bsize = 32, > .dcache_bsize = 32, > + .platform = "ppc405", > }, > { /* STB 04xxx */ > .pvr_mask = 0xffff0000, > @@ -764,6 +822,7 @@ struct cpu_spec cpu_specs[] = { > PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC, > .icache_bsize = 32, > .dcache_bsize = 32, > + .platform = "ppc405", > }, > { /* NP405L */ > .pvr_mask = 0xffff0000, > @@ -774,6 +833,7 @@ struct cpu_spec cpu_specs[] = { > PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC, > .icache_bsize = 32, > .dcache_bsize = 32, > + .platform = "ppc405", > }, > { /* NP4GS3 */ > .pvr_mask = 0xffff0000, > @@ -784,6 +844,7 @@ struct cpu_spec cpu_specs[] = { > PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC, > .icache_bsize = 32, > .dcache_bsize = 32, > + .platform = "ppc405", > }, > { /* NP405H */ > .pvr_mask = 0xffff0000, > @@ -794,6 +855,7 @@ struct cpu_spec cpu_specs[] = { > PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC, > .icache_bsize = 32, > .dcache_bsize = 32, > + .platform = "ppc405", > }, > { /* 405GPr */ > .pvr_mask = 0xffff0000, > @@ -804,6 +866,7 @@ struct cpu_spec cpu_specs[] = { > PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC, > .icache_bsize = 32, > .dcache_bsize = 32, > + .platform = "ppc405", > }, > { /* STBx25xx */ > .pvr_mask = 0xffff0000, > @@ -814,6 +877,7 @@ struct cpu_spec cpu_specs[] = { > PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC, > .icache_bsize = 32, > .dcache_bsize = 32, > + .platform = "ppc405", > }, > { /* 405LP */ > .pvr_mask = 0xffff0000, > @@ -823,6 +887,7 @@ struct cpu_spec cpu_specs[] = { > .cpu_user_features = PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU, > .icache_bsize = 32, > .dcache_bsize = 32, > + .platform = "ppc405", > }, > { /* Xilinx Virtex-II Pro */ > .pvr_mask = 0xffff0000, > @@ -833,6 +898,7 @@ struct cpu_spec cpu_specs[] = { > PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC, > .icache_bsize = 32, > .dcache_bsize = 32, > + .platform = "ppc405", > }, > { /* 405EP */ > .pvr_mask = 0xffff0000, > @@ -843,6 +909,7 @@ struct cpu_spec cpu_specs[] = { > PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC, > .icache_bsize = 32, > .dcache_bsize = 32, > + .platform = "ppc405", > }, > > #endif /* CONFIG_40x */ > @@ -855,6 +922,7 @@ struct cpu_spec cpu_specs[] = { > .cpu_user_features = COMMON_USER, /* 440EP has an FPU */ > .icache_bsize = 32, > .dcache_bsize = 32, > + .platform = "ppc440", > }, > { > .pvr_mask = 0xf0000fff, > @@ -864,6 +932,7 @@ struct cpu_spec cpu_specs[] = { > .cpu_user_features = COMMON_USER, /* 440EP has an FPU */ > .icache_bsize = 32, > .dcache_bsize = 32, > + .platform = "ppc440", > }, > { /* 440GP Rev. B */ > .pvr_mask = 0xf0000fff, > @@ -873,6 +942,7 @@ struct cpu_spec cpu_specs[] = { > .cpu_user_features = PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU, > .icache_bsize = 32, > .dcache_bsize = 32, > + .platform = "ppc440", > }, > { /* 440GP Rev. C */ > .pvr_mask = 0xf0000fff, > @@ -882,6 +952,7 @@ struct cpu_spec cpu_specs[] = { > .cpu_user_features = PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU, > .icache_bsize = 32, > .dcache_bsize = 32, > + .platform = "ppc440", > }, > { /* 440GX Rev. A */ > .pvr_mask = 0xf0000fff, > @@ -891,6 +962,7 @@ struct cpu_spec cpu_specs[] = { > .cpu_user_features = PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU, > .icache_bsize = 32, > .dcache_bsize = 32, > + .platform = "ppc440", > }, > { /* 440GX Rev. B */ > .pvr_mask = 0xf0000fff, > @@ -900,6 +972,7 @@ struct cpu_spec cpu_specs[] = { > .cpu_user_features = PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU, > .icache_bsize = 32, > .dcache_bsize = 32, > + .platform = "ppc440", > }, > { /* 440GX Rev. C */ > .pvr_mask = 0xf0000fff, > @@ -909,6 +982,7 @@ struct cpu_spec cpu_specs[] = { > .cpu_user_features = PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU, > .icache_bsize = 32, > .dcache_bsize = 32, > + .platform = "ppc440", > }, > { /* 440GX Rev. F */ > .pvr_mask = 0xf0000fff, > @@ -918,6 +992,7 @@ struct cpu_spec cpu_specs[] = { > .cpu_user_features = PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU, > .icache_bsize = 32, > .dcache_bsize = 32, > + .platform = "ppc440", > }, > { /* 440SP Rev. A */ > .pvr_mask = 0xff000fff, > @@ -927,6 +1002,7 @@ struct cpu_spec cpu_specs[] = { > .cpu_user_features = PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU, > .icache_bsize = 32, > .dcache_bsize = 32, > + .platform = "ppc440", > }, > { /* 440SPe Rev. A */ > .pvr_mask = 0xff000fff, > @@ -937,6 +1013,7 @@ struct cpu_spec cpu_specs[] = { > .cpu_user_features = PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU, > .icache_bsize = 32, > .dcache_bsize = 32, > + .platform = "ppc440", > }, > #endif /* CONFIG_44x */ > #ifdef CONFIG_FSL_BOOKE > @@ -950,6 +1027,7 @@ struct cpu_spec cpu_specs[] = { > PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_EFP_SINGLE | > PPC_FEATURE_UNIFIED_CACHE, > .dcache_bsize = 32, > + .platform = "ppc8540", > }, > { /* e200z6 */ > .pvr_mask = 0xfff00000, > @@ -962,6 +1040,7 @@ struct cpu_spec cpu_specs[] = { > PPC_FEATURE_HAS_EFP_SINGLE | > PPC_FEATURE_UNIFIED_CACHE, > .dcache_bsize = 32, > + .platform = "ppc8540", > }, > { /* e500 */ > .pvr_mask = 0xffff0000, > @@ -977,6 +1056,7 @@ struct cpu_spec cpu_specs[] = { > .num_pmcs = 4, > .oprofile_cpu_type = "ppc/e500", > .oprofile_type = BOOKE, > + .platform = "ppc8540", > }, > { /* e500v2 */ > .pvr_mask = 0xffff0000, > @@ -992,6 +1072,7 @@ struct cpu_spec cpu_specs[] = { > .num_pmcs = 4, > .oprofile_cpu_type = "ppc/e500", > .oprofile_type = BOOKE, > + .platform = "ppc8540", > }, > #endif > #if !CLASSIC_PPC > @@ -1003,6 +1084,7 @@ struct cpu_spec cpu_specs[] = { > .cpu_user_features = PPC_FEATURE_32, > .icache_bsize = 32, > .dcache_bsize = 32, > + .platform = "powerpc", > } > #endif /* !CLASSIC_PPC */ > #endif /* CONFIG_PPC32 */ > diff --git a/include/asm-powerpc/cputable.h b/include/asm-powerpc/cputable.h > index ef6ead3..03017d9 100644 > --- a/include/asm-powerpc/cputable.h > +++ b/include/asm-powerpc/cputable.h > @@ -19,6 +19,7 @@ > #define PPC_FEATURE_POWER5 0x00040000 > #define PPC_FEATURE_POWER5_PLUS 0x00020000 > #define PPC_FEATURE_CELL 0x00010000 > +#define PPC_FEATURE_BOOKE 0x00008000 > > #ifdef __KERNEL__ > #ifndef __ASSEMBLY__ > @@ -64,6 +65,9 @@ struct cpu_spec { > > /* Processor specific oprofile operations */ > enum powerpc_oprofile_type oprofile_type; > + > + /* Name of processor class, for the ELF AT_PLATFORM entry */ > + char *platform; > }; > > extern struct cpu_spec *cur_cpu_spec; > diff --git a/include/asm-powerpc/elf.h b/include/asm-powerpc/elf.h > index c5a635d..a75e975 100644 > --- a/include/asm-powerpc/elf.h > +++ b/include/asm-powerpc/elf.h > @@ -222,20 +222,18 @@ extern int dump_task_fpu(struct task_str > instruction set this cpu supports. This could be done in userspace, > but it's not easy, and we've already done it here. */ > # define ELF_HWCAP (cur_cpu_spec->cpu_user_features) > -#ifdef __powerpc64__ > -# define ELF_PLAT_INIT(_r, load_addr) do { \ > - _r->gpr[2] = load_addr; \ > -} while (0) > -#endif /* __powerpc64__ */ > > /* This yields a string that ld.so will use to load implementation > specific libraries for optimization. This is more specific in > - intent than poking at uname or /proc/cpuinfo. > + intent than poking at uname or /proc/cpuinfo. */ > > - For the moment, we have only optimizations for the Intel generations, > - but that could change... */ > +#define ELF_PLATFORM (cur_cpu_spec->platform) > > -#define ELF_PLATFORM (NULL) > +#ifdef __powerpc64__ > +# define ELF_PLAT_INIT(_r, load_addr) do { \ > + _r->gpr[2] = load_addr; \ > +} while (0) > +#endif /* __powerpc64__ */ > > #ifdef __KERNEL__ > > _______________________________________________ > Linuxppc64-dev mailing list > Linuxppc64-dev at ozlabs.org > https://ozlabs.org/mailman/listinfo/linuxppc64-dev > From paulus at samba.org Wed Jan 11 16:08:06 2006 From: paulus at samba.org (Paul Mackerras) Date: Wed, 11 Jan 2006 16:08:06 +1100 Subject: [PATCH] implement AT_PLATFORM for powerpc In-Reply-To: References: <17348.35120.840409.283964@cargo.ozlabs.ibm.com> Message-ID: <17348.37558.434652.697604@cargo.ozlabs.ibm.com> Kumar Gala writes: > We should probably add two new AT_PLATFORM: "ppc8548" and "ppc5554". > "ppc8548" should be used for e500v2, and "ppc5554" for "e200z6". How different are they in user-level ISA or in instruction scheduling requirements? > You aren't seeting PPC_FEATURE_BOOKE for anything. We need to be a little > careful since 'isel' isn't implemented in the very first 440's. Oops, I must have sent the wrong version of the patch. Do we know which 440s have or don't have isel? Paul. From michael at ellerman.id.au Wed Jan 11 16:41:29 2006 From: michael at ellerman.id.au (Michael Ellerman) Date: Wed, 11 Jan 2006 16:41:29 +1100 Subject: [PATCH] powerpc: Don't build crash.c for PPC32 Message-ID: <1136958089.403410.882614449674.qpush@concordia> arch/powerpc/kernel/crash.c isn't safe for PPC32 (yet?), so don't build it. Built with CONFIG_KEXEC=y for pmac32_defconfig, pseries_defconfig, and g5_defconfig. Signed-off-by: Michael Ellerman --- arch/powerpc/kernel/Makefile | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) Index: linux/arch/powerpc/kernel/Makefile =================================================================== --- linux.orig/arch/powerpc/kernel/Makefile +++ linux/arch/powerpc/kernel/Makefile @@ -62,9 +62,9 @@ obj-$(CONFIG_MODULES) += $(module-y) pci64-$(CONFIG_PPC64) += pci_64.o pci_dn.o pci_iommu.o \ pci_direct_iommu.o iomap.o obj-$(CONFIG_PCI) += $(pci64-y) -kexec-$(CONFIG_PPC64) := machine_kexec_64.o +kexec-$(CONFIG_PPC64) := machine_kexec_64.o crash.o kexec-$(CONFIG_PPC32) := machine_kexec_32.o -obj-$(CONFIG_KEXEC) += machine_kexec.o crash.o $(kexec-y) +obj-$(CONFIG_KEXEC) += machine_kexec.o $(kexec-y) ifeq ($(CONFIG_PPC_ISERIES),y) $(obj)/head_64.o: $(obj)/lparmap.s From galak at kernel.crashing.org Wed Jan 11 17:10:02 2006 From: galak at kernel.crashing.org (Kumar Gala) Date: Wed, 11 Jan 2006 00:10:02 -0600 Subject: [PATCH] implement AT_PLATFORM for powerpc In-Reply-To: <17348.37558.434652.697604@cargo.ozlabs.ibm.com> References: <17348.35120.840409.283964@cargo.ozlabs.ibm.com> <17348.37558.434652.697604@cargo.ozlabs.ibm.com> Message-ID: On Jan 10, 2006, at 11:08 PM, Paul Mackerras wrote: > Kumar Gala writes: > >> We should probably add two new AT_PLATFORM: "ppc8548" and "ppc5554". >> "ppc8548" should be used for e500v2, and "ppc5554" for "e200z6". > > How different are they in user-level ISA or in instruction scheduling > requirements? 8548 adds embedded double precision instructions. e200/e500 are hugely different from a scheduling point of view. >> You aren't seeting PPC_FEATURE_BOOKE for anything. We need to be >> a little >> careful since 'isel' isn't implemented in the very first 440's. > > Oops, I must have sent the wrong version of the patch. Do we know > which 440s have or don't have isel? Not 100% sure, hopefully Matt Porter or someone else a bit more familiar with the 440's will chime in. - k From ebs at ebshome.net Wed Jan 11 18:10:32 2006 From: ebs at ebshome.net (Eugene Surovegin) Date: Tue, 10 Jan 2006 23:10:32 -0800 Subject: [PATCH] implement AT_PLATFORM for powerpc In-Reply-To: <17348.37558.434652.697604@cargo.ozlabs.ibm.com> References: <17348.35120.840409.283964@cargo.ozlabs.ibm.com> <17348.37558.434652.697604@cargo.ozlabs.ibm.com> Message-ID: <20060111071032.GA28843@gate.ebshome.net> On Wed, Jan 11, 2006 at 04:08:06PM +1100, Paul Mackerras wrote: > Oops, I must have sent the wrong version of the patch. Do we know > which 440s have or don't have isel? I checked 44x user manuals I have: 440GP doesn't have isel 440GX, 440EP, 440SP, 440SPe, 440GR have it. -- Eugene From paulus at samba.org Wed Jan 11 19:50:41 2006 From: paulus at samba.org (Paul Mackerras) Date: Wed, 11 Jan 2006 19:50:41 +1100 Subject: [PATCH] implement AT_PLATFORM for powerpc In-Reply-To: <20060111071032.GA28843@gate.ebshome.net> References: <17348.35120.840409.283964@cargo.ozlabs.ibm.com> <17348.37558.434652.697604@cargo.ozlabs.ibm.com> <20060111071032.GA28843@gate.ebshome.net> Message-ID: <17348.50913.414568.263736@cargo.ozlabs.ibm.com> Eugene Surovegin writes: > I checked 44x user manuals I have: > > 440GP doesn't have isel > 440GX, 440EP, 440SP, 440SPe, 440GR have it. Thanks, that's helpful. Do you know if 440{GX,EP,SP,SPe,GR} implement all of the 32-bit user-mode instructions in Book E? How do mbar and msync work on those processors? As mbar and msync (as defined in Book E) or as eieio and sync? Do the 440* processors in fact claim Book E compliance? Thanks, Paul. From ebs at ebshome.net Wed Jan 11 20:19:39 2006 From: ebs at ebshome.net (Eugene Surovegin) Date: Wed, 11 Jan 2006 01:19:39 -0800 Subject: [PATCH] implement AT_PLATFORM for powerpc In-Reply-To: <17348.50913.414568.263736@cargo.ozlabs.ibm.com> References: <17348.35120.840409.283964@cargo.ozlabs.ibm.com> <17348.37558.434652.697604@cargo.ozlabs.ibm.com> <20060111071032.GA28843@gate.ebshome.net> <17348.50913.414568.263736@cargo.ozlabs.ibm.com> Message-ID: <20060111091939.GD28843@gate.ebshome.net> On Wed, Jan 11, 2006 at 07:50:41PM +1100, Paul Mackerras wrote: > Eugene Surovegin writes: > > > I checked 44x user manuals I have: > > > > 440GP doesn't have isel > > 440GX, 440EP, 440SP, 440SPe, 440GR have it. > > Thanks, that's helpful. Do you know if 440{GX,EP,SP,SPe,GR} implement > all of the 32-bit user-mode instructions in Book E? Manuals claim that the following processors implement "... the full, 32-bit fixed-point subset of the Book-E Enhanced PowerPC Architecture": 440GP, 440GX, 440EP, 440GR, 440SP. I failed to find similar claim in 440SPe manual, though. > How do mbar and msync work on those processors? As mbar and msync (as > defined in Book E) or as eieio and sync? Here is an excerpt from user manual (I checked 440GP, 440GX, 440SP, 440SPe, 440EP, 440GR manuals and they all contain the same text): Programming Notes The msync instruction is execution synchronizing, and guarantees that all storage accesses initiated by instructions executed prior to the msync have completed before any instructions after the msync begin execution. On the other hand, architecturally the mbar instruction merely orders storage accesses, and does not perform execution synchronization. Therefore, non-storage access instructions after mbar could complete before the storage access instructions which were executed prior to mbar have actually completed their storage accesses. However, the PPC440xx implements the mbar instruction identically to the msync instruction, and thus both are execution synchronizing. Architecture Note mbar replaces the PowerPC eieio instruction. mbar uses the same opcode as eieio; PowerPC applications which used eieio will get the function of mbar when executed on a PowerPC Book-E implementation. mbar is architecturally "stronger" than eieio, in that eieio forced separate ordering amongst different categories of storage accesses, while mbar forces such ordering amongst all storage accesses as a single category. msync replaces the PowerPC sync instruction. msync uses the same opcode as sync; PowerPC applications which used sync get the function of msync when executed on a PowerPC Book-E implementation. msync is architecturally identical to the version of sync specified by an earlier version of the PowerPC architecture. > Do the 440* processors in fact claim Book E compliance? Hmm, cannot tell :). -- Eugene From sleddog at us.ibm.com Wed Jan 11 20:56:33 2006 From: sleddog at us.ibm.com (Dave C Boutcher) Date: Wed, 11 Jan 2006 03:56:33 -0600 Subject: [PATCH] powerpc: add ibm,suspend-me rtas interface Message-ID: <20060111095633.GB30507@cs.umn.edu> Create a proc file that lets us call the ibm,suspend-me RTAS call. This call has to be wrapped in some hypervisor calls that synchronize all the CPUs, so it can't be done from userland. This depends on a prior patch to add additional hypervisor call constants. Signed-off-by: Dave Boutcher arch/powerpc/platforms/pseries/Makefile | 2 arch/powerpc/platforms/pseries/sysstate.c | 157 ++++++++++++++++++++++++++++++ 2 files changed, 158 insertions(+), 1 deletion(-) diff -uNr -X exclude-files linux-2.6.15/arch/powerpc/platforms/pseries/Makefile linux-2.6.15-vpm/arch/powerpc/platforms/pseries/Makefile --- linux-2.6.15/arch/powerpc/platforms/pseries/Makefile 2006-01-02 21:21:10.000000000 -0600 +++ linux-2.6.15-vpm/arch/powerpc/platforms/pseries/Makefile 2006-01-10 14:32:56.000000000 -0600 @@ -1,5 +1,5 @@ obj-y := pci.o lpar.o hvCall.o nvram.o reconfig.o \ - setup.o iommu.o ras.o rtasd.o + setup.o iommu.o ras.o rtasd.o sysstate.o obj-$(CONFIG_SMP) += smp.o obj-$(CONFIG_IBMVIO) += vio.o obj-$(CONFIG_XICS) += xics.o diff -uNr -X exclude-files linux-2.6.15/arch/powerpc/platforms/pseries/sysstate.c linux-2.6.15-vpm/arch/powerpc/platforms/pseries/sysstate.c --- linux-2.6.15/arch/powerpc/platforms/pseries/sysstate.c 1969-12-31 18:00:00.000000000 -0600 +++ linux-2.6.15-vpm/arch/powerpc/platforms/pseries/sysstate.c 2006-01-11 02:17:22.000000000 -0600 @@ -0,0 +1,157 @@ +/* + * arch/ppc64/sys-state.c - Logical Partition State + * + * Copyright (c) 2005 Dave Boutcher + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + *************************************************************************** + * This file handles the pSeries firmware supported "ibm,suspend-me" RTAS + * call. It can't be done from userland, since all of the CPUs must be first + * synchronized using the H_JOIN hypervisor call prior to making the + * ibm,suspend-me RTAS call. + *************************************************************************** + */ + +#include +#include +#include +#include +#include +#include +#include + +#include + +static int suspend_me_tok = -1; + +/* + * We use "waiting" to indicate our state. As long + * as it is >0, we are still trying to all join up. + * If it goes to 0, we have successfully joined up and + * one thread got H_Continue. If any error happens, + * we set it to <0; + */ +static void cpu_suspend(void *info) +{ + long rc; + long flags; + long *waiting = (long *)info; + int status; + + local_irq_save(flags); + do { + rc = plpar_hcall_norets(H_JOIN); + mb(); + } while ((rc == H_Success) && (*waiting > 0)); + if (rc == H_Success) + goto out; + + if (rc == H_Continue) { + *waiting = 0; + if (suspend_me_tok != RTAS_UNKNOWN_SERVICE) { + status = rtas_call(suspend_me_tok, 0, 1, NULL); + if (status != 0) + printk(KERN_ERR + "RTAS ibm,suspend-me failed: %i\n", + status); + } + } else { + *waiting = -EBUSY; + printk(KERN_ERR "Error on H_Join hypervisor call\n"); + } + + out: + local_irq_restore(flags); + return; +} + +static int do_suspend(void) +{ + int i; + long waiting = 1; + + smp_rmb(); + + /* Call function on all other CPUs */ + if (on_each_cpu(cpu_suspend, + &waiting, + 1, 0)) { + printk(KERN_ERR "Error calling on_each_cpu!\n"); + /* TODO: Prod everyone here */ + return -EINVAL; + } + + if (waiting != 0) { + printk(KERN_ERR "Error doing global join!\n"); + } + + /* Prod each CPU. This won't hurt, and will wake + * anyone we successfully put to sleep with H_Join + */ + for_each_cpu(i) + plpar_hcall_norets(H_PROD,i); + + return 0; +} + +static int read_proc(char *page, char **start, off_t off, + int count, int *eof, void *data) +{ + int len; + + len = sprintf(page, "%d\n", + 0); + + return len; +} + +static int write_proc(struct file *file, const char __user *buffer, + unsigned long count, void *data) +{ + char command[32]; + + if (count > sizeof(command)) + count = sizeof(command); + + if (copy_from_user(command, buffer, count)) + return -EFAULT; + + if (strncmp(command, "suspend", sizeof(command)) == 0) { + do_suspend(); + } + return count; +} + +static int __init sys_state_init(void) +{ + struct proc_dir_entry *entry; + suspend_me_tok = rtas_token("ibm,suspend-me"); + if (suspend_me_tok == RTAS_UNKNOWN_SERVICE) + return 0; + + entry = create_proc_entry("ppc64/rtas/platform_state", S_IWUSR, NULL); + if (!entry) { + printk(KERN_ERR "Failed to create platform_state proc entry\n"); + return 0; + } + + entry->read_proc = read_proc; + entry->write_proc = write_proc; + + return 0; +} + +arch_initcall(sys_state_init); -- Dave Boutcher From sleddog at us.ibm.com Wed Jan 11 20:59:21 2006 From: sleddog at us.ibm.com (Dave C Boutcher) Date: Wed, 11 Jan 2006 03:59:21 -0600 Subject: [PATCH 0/5] powerpc: add device tree property updates Message-ID: <20060111095921.GC30507@cs.umn.edu> The following set of patches add support for updating device tree properties on the fly. pseries is adding some awfull^h^h^h^h^h^h helpful RTAS calls named "ibm,update-nodes" and "ibm,update-properties". We can call those from userland, but we need the interfaces to update the device trees. -- Dave Boutcher From sleddog at us.ibm.com Wed Jan 11 20:54:18 2006 From: sleddog at us.ibm.com (Dave C Boutcher) Date: Wed, 11 Jan 2006 03:54:18 -0600 Subject: [PATCH] powerpc: add new hypervisor constants Message-ID: <20060111095418.GA30507@cs.umn.edu> Adds a few more hypervisor call constants. Signed-off-by: Dave Boutcher diff -uNr -X exclude-files linux-2.6.15/include/asm-powerpc/hvcall.h linux-2.6.15-vpm/include/asm-powerpc/hvcall.h --- linux-2.6.15/include/asm-powerpc/hvcall.h 2006-01-02 21:21:10.000000000 -0600 +++ linux-2.6.15-vpm/include/asm-powerpc/hvcall.h 2006-01-10 22:53:13.000000000 -0600 @@ -5,7 +5,10 @@ #define H_Success 0 #define H_Busy 1 /* Hardware busy -- retry later */ +#define H_Closed 2 /* Resource closed */ #define H_Constrained 4 /* Resource request constrained to max allowed */ +#define H_InProgress 14 /* Kind of like busy */ +#define H_Continue 18 /* Returned from H_Join on success */ #define H_LongBusyStartRange 9900 /* Start of long busy range */ #define H_LongBusyOrder1msec 9900 /* Long busy, hint that 1msec is a good time to retry */ #define H_LongBusyOrder10msec 9901 /* Long busy, hint that 10msec is a good time to retry */ @@ -113,6 +116,8 @@ #define H_REGISTER_VTERM 0x154 #define H_FREE_VTERM 0x158 #define H_POLL_PENDING 0x1D8 +#define H_JOIN 0x298 +#define H_ENABLE_CRQ 0x2B0 #ifndef __ASSEMBLY__ -- Dave Boutcher From sleddog at us.ibm.com Wed Jan 11 21:04:44 2006 From: sleddog at us.ibm.com (Dave C Boutcher) Date: Wed, 11 Jan 2006 04:04:44 -0600 Subject: [PATCH 5/5] powerpc: add reconfigure intefaces for updating properties Message-ID: <20060111100444.GH30507@cs.umn.edu> Add support to reconfigure the device tree through the existing proc filesystem interface. Add "add_property", "remove_property", and "update_property" interfaces. Signed-off-by: Dave Boutcher arch/powerpc/platforms/pseries/reconfig.c | 101 ++++++++++++++++++++++++++++++ 1 file changed, 101 insertions(+) Files linux-2.6.15-patched/arch/powerpc/boot/zImage.vmode and linux-2.6.15-patched2/arch/powerpc/boot/zImage.vmode differ diff -uNr -X exclude-files linux-2.6.15-patched/arch/powerpc/platforms/pseries/reconfig.c linux-2.6.15-patched2/arch/powerpc/platforms/pseries/reconfig.c --- linux-2.6.15-patched/arch/powerpc/platforms/pseries/reconfig.c 2006-01-11 01:52:07.000000000 -0600 +++ linux-2.6.15-patched2/arch/powerpc/platforms/pseries/reconfig.c 2006-01-11 03:17:19.000000000 -0600 @@ -350,6 +350,101 @@ return rv; } +static char *parse_node(char *buf, size_t bufsize, struct device_node **npp) +{ + char *handle_str; + phandle handle; + *npp = NULL; + + handle_str = buf; + + buf = strchr(buf, ' '); + if (!buf) + return NULL; + *buf = '\0'; + buf++; + + handle = simple_strtoul(handle_str, NULL, 10); + + *npp = of_find_node_by_phandle(handle); + return buf; +} + +static int do_add_property(char *buf, size_t bufsize) +{ + struct property *prop = NULL; + struct device_node *np; + unsigned char* value; + char *name, *end; + int length; + end = buf + bufsize; + buf = parse_node(buf,bufsize,&np); + + if (!np) + return -ENODEV; + + if (parse_next_property(buf, end, &name, &length, &value) == NULL) + return -EINVAL; + + prop = new_property(name, length, value, NULL); + if (!prop) + return -ENOMEM; + + prom_add_property(np, + prop); + + return 0; +} + +static int do_remove_property(char *buf, size_t bufsize) +{ + struct device_node *np; + char *tmp; + struct property *prop; + buf = parse_node(buf,bufsize,&np); + + if (!np) + return -ENODEV; + + tmp = strchr(buf,' '); + if (tmp) + *tmp = '\0'; + + if (strlen(buf) == 0) + return -EINVAL; + + prop = of_find_property(np, buf, NULL); + + return prom_remove_property(np, prop); +} + +static int do_update_property(char *buf, size_t bufsize) +{ + struct device_node *np; + unsigned char* value; + char *name, *end; + int length; + struct property *newprop, *oldprop; + buf = parse_node(buf,bufsize,&np); + end = buf + bufsize; + + if (!np) + return -ENODEV; + + if (parse_next_property(buf, end, &name, &length, &value) == NULL) + return -EINVAL; + + newprop = new_property(name, length, value, NULL); + if (!newprop) + return -ENOMEM; + + oldprop = of_find_property(np, name,NULL); + if (!oldprop) + return -ENODEV; + + return prom_update_property(np, newprop, oldprop); +} + /** * ofdt_write - perform operations on the Open Firmware device tree * @@ -392,6 +487,12 @@ rv = do_add_node(tmp, count - (tmp - kbuf)); else if (!strcmp(kbuf, "remove_node")) rv = do_remove_node(tmp); + else if (!strcmp(kbuf, "add_property")) + rv = do_add_property(tmp, count - (tmp - kbuf)); + else if (!strcmp(kbuf, "remove_property")) + rv = do_remove_property(tmp, count - (tmp - kbuf)); + else if (!strcmp(kbuf, "update_property")) + rv = do_update_property(tmp, count - (tmp - kbuf)); else rv = -EINVAL; out: -- Dave Boutcher From sleddog at us.ibm.com Wed Jan 11 21:03:45 2006 From: sleddog at us.ibm.com (Dave C Boutcher) Date: Wed, 11 Jan 2006 04:03:45 -0600 Subject: [PATCH 4/5] powerpc: add of_find_property function Message-ID: <20060111100345.GG30507@cs.umn.edu> Add an of_find_property function that returns a struct property given a property name. Then change the get_property function to use that routine internally. Signed-off-by: Dave Boutcher arch/powerpc/kernel/prom.c | 19 +++++++++++++------ include/asm-powerpc/prom.h | 3 +++ 2 files changed, 16 insertions(+), 6 deletions(-) Files linux-2.6.15-patched/arch/powerpc/boot/zImage.vmode and linux-2.6.15-patched2/arch/powerpc/boot/zImage.vmode differ diff -uNr -X exclude-files linux-2.6.15-patched/arch/powerpc/kernel/prom.c linux-2.6.15-patched2/arch/powerpc/kernel/prom.c --- linux-2.6.15-patched/arch/powerpc/kernel/prom.c 2006-01-11 03:01:45.000000000 -0600 +++ linux-2.6.15-patched2/arch/powerpc/kernel/prom.c 2006-01-11 03:08:00.000000000 -0600 @@ -1953,12 +1953,8 @@ __initcall(prom_reconfig_setup); #endif -/* - * Find a property with a given name for a given node - * and return the value. - */ -unsigned char *get_property(struct device_node *np, const char *name, - int *lenp) +struct property *of_find_property(struct device_node *np, const char *name, + int *lenp) { struct property *pp; @@ -1970,7 +1966,18 @@ break; } read_unlock(&devtree_lock); + + return pp; +} +/* + * Find a property with a given name for a given node + * and return the value. + */ +unsigned char *get_property(struct device_node *np, const char *name, + int *lenp) +{ + struct property *pp = of_find_property(np,name,lenp); return pp ? pp->value : NULL; } EXPORT_SYMBOL(get_property); diff -uNr -X exclude-files linux-2.6.15-patched/include/asm-powerpc/prom.h linux-2.6.15-patched2/include/asm-powerpc/prom.h --- linux-2.6.15-patched/include/asm-powerpc/prom.h 2006-01-11 03:01:45.000000000 -0600 +++ linux-2.6.15-patched2/include/asm-powerpc/prom.h 2006-01-11 03:07:04.000000000 -0600 @@ -176,6 +176,9 @@ extern struct device_node *of_get_parent(const struct device_node *node); extern struct device_node *of_get_next_child(const struct device_node *node, struct device_node *prev); +extern struct property *of_find_property(struct device_node *np, + const char *name, + int *lenp); extern struct device_node *of_node_get(struct device_node *node); extern void of_node_put(struct device_node *node); -- Dave Boutcher From sleddog at us.ibm.com Wed Jan 11 21:01:28 2006 From: sleddog at us.ibm.com (Dave C Boutcher) Date: Wed, 11 Jan 2006 04:01:28 -0600 Subject: [PATCH 2/5] powerpc: proc_device_tree remove and update functions Message-ID: <20060111100128.GE30507@cs.umn.edu> Add support to the proc_device_tree file for removing and updating properties. Remove just removes the proc file, update changes the data pointer within the proc file. The remainder of the device-tree changes occur elsewhere. Signed-off-by: Dave Boutcher fs/proc/proc_devtree.c | 24 ++++++++++++++++++++++++ include/linux/proc_fs.h | 5 +++++ 2 files changed, 29 insertions(+) diff -uNr -X exclude-files linux-2.6.15-patched/fs/proc/proc_devtree.c linux-2.6.15-patched2/fs/proc/proc_devtree.c --- linux-2.6.15-patched/fs/proc/proc_devtree.c 2006-01-11 01:52:08.000000000 -0600 +++ linux-2.6.15-patched2/fs/proc/proc_devtree.c 2006-01-11 02:49:58.000000000 -0600 @@ -81,6 +81,30 @@ __proc_device_tree_add_prop(pde, prop); } +void proc_device_tree_remove_prop(struct proc_dir_entry *pde, + struct property *prop) +{ + remove_proc_entry(prop->name, pde); +} + +void proc_device_tree_update_prop(struct proc_dir_entry *pde, + struct property *newprop, + struct property *oldprop) +{ + struct proc_dir_entry *ent; + + for (ent = pde->subdir; ent != NULL; ent = ent->next) + if (ent->data == oldprop) + break; + if (ent == NULL) { + printk(KERN_WARNING "device-tree: property \"%s\" " + " does not exist\n", oldprop->name); + } else { + ent->data = newprop; + ent->size = newprop->length; + } +} + /* * Process a node, adding entries for its children and its properties. */ diff -uNr -X exclude-files linux-2.6.15-patched/include/linux/proc_fs.h linux-2.6.15-patched2/include/linux/proc_fs.h --- linux-2.6.15-patched/include/linux/proc_fs.h 2006-01-11 01:52:09.000000000 -0600 +++ linux-2.6.15-patched2/include/linux/proc_fs.h 2006-01-11 02:49:58.000000000 -0600 @@ -146,6 +146,11 @@ extern void proc_device_tree_init(void); extern void proc_device_tree_add_node(struct device_node *, struct proc_dir_entry *); extern void proc_device_tree_add_prop(struct proc_dir_entry *pde, struct property *prop); +extern void proc_device_tree_remove_prop(struct proc_dir_entry *pde, + struct property *prop); +extern void proc_device_tree_update_prop(struct proc_dir_entry *pde, + struct property *newprop, + struct property *oldprop); #endif /* CONFIG_PROC_DEVICETREE */ extern struct proc_dir_entry *proc_symlink(const char *, -- Dave Boutcher From sleddog at us.ibm.com Wed Jan 11 21:00:23 2006 From: sleddog at us.ibm.com (Dave C Boutcher) Date: Wed, 11 Jan 2006 04:00:23 -0600 Subject: [PATCH 1/5] powerpc: null pointer check Message-ID: <20060111100023.GD30507@cs.umn.edu> There should never be a device-tree node without a name property. But if one ever shows up, the panic is not pretty. Add a quick check to make the name pointer is not null before we use it. Signed-off-by: Dave Boutcher diff -uNr -X exclude-files linux-2.6.15/arch/powerpc/kernel/prom.c linux-2.6.15-vpm/arch/powerpc/kernel/prom.c --- linux-2.6.15/arch/powerpc/kernel/prom.c 2006-01-02 21:21:10.000000000 -0600 +++ linux-2.6.15-vpm/arch/powerpc/kernel/prom.c 2006-01-11 00:06:40.000000000 -0600 @@ -613,7 +613,8 @@ if (ip != NULL) nsizec = *ip; - if (!strcmp(np->name, "device-tree") || np->parent == NULL) + if ((np->name && !strcmp(np->name, "device-tree")) + || (np->parent == NULL)) ifunc = interpret_root_props; else if (np->type == 0) ifunc = NULL; -- Dave Boutcher From sleddog at us.ibm.com Wed Jan 11 21:02:46 2006 From: sleddog at us.ibm.com (Dave C Boutcher) Date: Wed, 11 Jan 2006 04:02:46 -0600 Subject: [PATCH 3/5] powerpc: prom.c support for updating and removing device tree entries Message-ID: <20060111100246.GF30507@cs.umn.edu> Add support for updating and removing device tree properties. Since we hand out pointers to properties with gay abandon, we can't just free the property storage. Instead we move deleted, or the old copy of an updated property, to a "dead properties" list. Also note, its not feasable to kref device tree properties. we call get_property() all over the kernel in a wild variety of contexts. One consequence of this change is that we now take a read_lock(&devtree_lock) when doing get_property(). Signed-off-by: Dave Boutcher arch/powerpc/kernel/prom.c | 93 ++++++++++++++++++++++++++++++++++++++++++++- include/asm-powerpc/prom.h | 5 ++ 2 files changed, 96 insertions(+), 2 deletions(-) diff -uNr -X exclude-files linux-2.6.15-patched/include/asm-powerpc/prom.h linux-2.6.15-patched2/include/asm-powerpc/prom.h --- linux-2.6.15-patched/include/asm-powerpc/prom.h 2006-01-11 01:52:09.000000000 -0600 +++ linux-2.6.15-patched2/include/asm-powerpc/prom.h 2006-01-11 02:59:48.000000000 -0600 @@ -127,6 +127,7 @@ char *full_name; struct property *properties; + struct property *deadprops; /* removed properties */ struct device_node *parent; struct device_node *child; struct device_node *sibling; @@ -204,6 +205,10 @@ extern int prom_n_intr_cells(struct device_node* np); extern void prom_get_irq_senses(unsigned char *senses, int off, int max); extern int prom_add_property(struct device_node* np, struct property* prop); +extern int prom_remove_property(struct device_node* np, struct property* prop); +extern int prom_update_property(struct device_node* np, + struct property* newprop, + struct property *oldprop); #ifdef CONFIG_PPC32 /* diff -uNr -X exclude-files linux-2.6.15-patched/arch/powerpc/kernel/prom.c linux-2.6.15-patched2/arch/powerpc/kernel/prom.c --- linux-2.6.15-patched/arch/powerpc/kernel/prom.c 2006-01-11 02:40:12.000000000 -0600 +++ linux-2.6.15-patched2/arch/powerpc/kernel/prom.c 2006-01-11 02:59:49.000000000 -0600 @@ -1801,6 +1801,11 @@ kfree(prop->value); kfree(prop); prop = next; + + if (!prop) { + prop = node->deadprops; + node->deadprops = NULL; + } } kfree(node->intrs); kfree(node->addrs); @@ -1957,13 +1962,16 @@ { struct property *pp; + read_lock(&devtree_lock); for (pp = np->properties; pp != 0; pp = pp->next) if (strcmp(pp->name, name) == 0) { if (lenp != 0) *lenp = pp->length; - return pp->value; + break; } - return NULL; + read_unlock(&devtree_lock); + + return pp ? pp->value : NULL; } EXPORT_SYMBOL(get_property); @@ -1997,6 +2005,87 @@ return 0; } +/* + * Remove a property from a node. Note that we don't actually + * remove it, since we have given out who-knows-how-many pointers + * to the data using get-property. Instead we just move the property + * to the "dead properties" list, so it won't be found any more. + */ +int prom_remove_property(struct device_node* np, struct property* prop) +{ + struct property **next; + int found = 0; + + write_lock(&devtree_lock); + next = &np->properties; + while (*next) { + if (*next == prop) { + /* found the node */ + *next = prop->next; + prop->next = np->deadprops; + np->deadprops = prop; + found = 1; + break; + } + next = &(*next)->next; + } + write_unlock(&devtree_lock); + + if (!found) + return -ENODEV; + +#ifdef CONFIG_PROC_DEVICETREE + /* try to remove the proc node as well */ + if (np->pde) + proc_device_tree_remove_prop(np->pde, prop); +#endif /* CONFIG_PROC_DEVICETREE */ + + return 0; +} + +/* + * Update a property in a node. Note that we don't actually + * remove it, since we have given out who-knows-how-many pointers + * to the data using get-property. Instead we just move the property + * to the "dead properties" list, and add the new property to the + * property list + */ +int prom_update_property(struct device_node* np, + struct property* newprop, + struct property *oldprop) +{ + struct property **next; + int found = 0; + + write_lock(&devtree_lock); + next = &np->properties; + while (*next) { + if (*next == oldprop) { + /* found the node */ + newprop->next = oldprop->next; + *next = newprop; + oldprop->next = np->deadprops; + np->deadprops = oldprop; + found = 1; + break; + } + next = &(*next)->next; + } + write_unlock(&devtree_lock); + + if (!found) + return -ENODEV; + +#ifdef CONFIG_PROC_DEVICETREE + /* try to add to proc as well if it was initialized */ + if (np->pde) + proc_device_tree_update_prop(np->pde, newprop, + oldprop); +#endif /* CONFIG_PROC_DEVICETREE */ + + return 0; +} + /* I quickly hacked that one, check against spec ! */ static inline unsigned long bus_space_to_resource_flags(unsigned int bus_space) -- Dave Boutcher From mingo at elte.hu Wed Jan 11 21:52:13 2006 From: mingo at elte.hu (Ingo Molnar) Date: Wed, 11 Jan 2006 11:52:13 +0100 Subject: PowerPC fastpaths for mutex subsystem In-Reply-To: <20060110230917.GA25285@elte.hu> References: <43BC5E15.207@austin.ibm.com> <20060105143502.GA16816@elte.hu> <43BD4C66.60001@austin.ibm.com> <20060105222106.GA26474@elte.hu> <43BDA672.4090704@austin.ibm.com> <20060106002919.GA29190@pb15.lixom.net> <43BFFF1D.7030007@austin.ibm.com> <20060108094839.GA16887@elte.hu> <43C435B9.5080409@austin.ibm.com> <20060110230917.GA25285@elte.hu> Message-ID: <20060111105213.GA3717@elte.hu> * Ingo Molnar wrote: > ok. I'll really need to look at "vmstat" output from these. We could > easily make the mutex slowpath behave like ppc64 semaphores, via the > attached (untested) patch, but i really think it's the wrong thing to > do, because it overloads the system with runnable tasks in an > essentially unlimited fashion [== overscheduling] - they'll all > contend for the same single mutex. find the working patch below. (the previous one had a syntax error) Ingo Index: linux/kernel/mutex.c =================================================================== --- linux.orig/kernel/mutex.c +++ linux/kernel/mutex.c @@ -227,6 +227,9 @@ __mutex_unlock_slowpath(atomic_t *lock_c debug_mutex_wake_waiter(lock, waiter); wake_up_process(waiter->task); + + /* be (much) more agressive about wakeups: */ + list_move_tail(&waiter->list, &lock->wait_list); } debug_mutex_clear_owner(lock); From paulus at samba.org Wed Jan 11 20:46:00 2006 From: paulus at samba.org (Paul Mackerras) Date: Wed, 11 Jan 2006 20:46:00 +1100 Subject: please pull powerpc-merge.git Message-ID: <17348.54232.914877.675904@cargo.ozlabs.ibm.com> Linus, Please pull git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc-merge.git There's a collection of various commits in there, the majority of which are bug-fixes. When do you think you will close the merge window? The glibc guys want us to set AT_PLATFORM to something useful on powerpc, so I'd like to get that in. I have a patch to do that, but it will take a couple of days to get consensus that we have the right set of strings exported. Thanks, Paul. arch/powerpc/Kconfig | 83 +++++++++++++++++----------- arch/powerpc/Kconfig.debug | 42 ++++++++++++++ arch/powerpc/boot/.gitignore | 20 +++++++ arch/powerpc/boot/Makefile | 2 - arch/powerpc/configs/ppc64_defconfig | 2 - arch/powerpc/kernel/Makefile | 4 + arch/powerpc/kernel/crash.c | 2 - arch/powerpc/kernel/crash_dump.c | 2 + arch/powerpc/kernel/machine_kexec.c | 6 -- arch/powerpc/kernel/pci_64.c | 3 + arch/powerpc/kernel/rtas.c | 12 +++- arch/powerpc/kernel/setup_64.c | 60 +++++++++----------- arch/powerpc/kernel/udbg.c | 25 ++++++++ arch/powerpc/kernel/udbg_16550.c | 2 - arch/powerpc/kernel/vdso32/.gitignore | 1 arch/powerpc/kernel/vdso64/.gitignore | 1 arch/powerpc/platforms/83xx/Kconfig | 26 +++++++++ arch/powerpc/platforms/83xx/Makefile | 4 + arch/powerpc/platforms/Makefile | 1 arch/powerpc/platforms/cell/spufs/switch.c | 32 +++++++++-- arch/powerpc/platforms/embedded6xx/Kconfig | 18 ------ arch/powerpc/platforms/iseries/setup.c | 37 +++++++++--- arch/powerpc/platforms/powermac/udbg_scc.c | 2 - arch/powerpc/sysdev/Makefile | 2 - arch/ppc/Kconfig | 4 + drivers/char/viocons.c | 11 ++-- include/asm-powerpc/paca.h | 1 include/asm-powerpc/page.h | 2 - include/asm-powerpc/parport.h | 28 +++++++++ include/asm-powerpc/percpu.h | 56 +++++++++++++++++++ include/asm-powerpc/rtas.h | 1 include/asm-powerpc/udbg.h | 9 +++ 32 files changed, 375 insertions(+), 126 deletions(-) create mode 100644 arch/powerpc/boot/.gitignore create mode 100644 arch/powerpc/kernel/vdso32/.gitignore create mode 100644 arch/powerpc/kernel/vdso64/.gitignore create mode 100644 arch/powerpc/platforms/83xx/Kconfig create mode 100644 arch/powerpc/platforms/83xx/Makefile Anton Blanchard: powerpc/64: per cpu data optimisations Geoff Levand: spufs: Suspend/restore MFC DMA operations at SPU context switch. Haren Myneni: powerpc: fix for compile problem in kdump code when SMP disabled Kumar Gala: powerpc: Updated Kconfig and Makefiles for 83xx support powerpc: Add some missing .gitignore's powerpc: Fix clean_files in arch/powerpc/boot Makefile linas: PCI Hotplug/powerpc: module build break Michael Ellerman: powerpc: Early debugging support for iSeries powerpc: Make early debugging configurable via Kconfig powerpc: Add ibm,pft-size to iSeries device tree powerpc: Remove redundant setting of htab_address powerpc: Don't build crash.c for PPC32 Michael Neuling: powerpc: parallel port init fix Olaf Hering: enable the RTC driver in ppc64_defconfig powerpc: remove remaining crash_notes variable from machine_kexec.c Paul Mackerras: powerpc: Fix compile error when CONFIG_PROC_VMCORE is not defined powerpc/32: Fix compile error caused by pud_t/pgt_t confusion Stephen Rothwell: powerpc: fix up iSeries console after TTY layer buffering revamp From paulus at samba.org Wed Jan 11 22:24:07 2006 From: paulus at samba.org (Paul Mackerras) Date: Wed, 11 Jan 2006 22:24:07 +1100 Subject: powerpc.git tree Message-ID: <17348.60119.801379.127209@cargo.ozlabs.ibm.com> All of the patches in the powerpc.git tree have now been either sent upstream to Linus' tree, or reverted. For various reasons I didn't just ask Linus to pull the powerpc.git tree, but instead cherry-picked the commits into the powerpc-merge.git tree and asked Linus to pull that. That means that there are now commits in the powerpc.git tree that are superseded by commits in Linus' tree. In future I'd like to be able to ask Linus to pull the powerpc.git tree, without cluttering up his tree with those superseded commits. That means I need to reset the powerpc.git tree to be the same as Linus' tree now. That means that anyone who is following the powerpc.git tree by doing pulls periodically will need to reset their tree too. Otherwise each pull will do an unnecessary merge. If that would cause people serious heartburn, I can instead abandon the powerpc.git tree and start a new development tree (powerpc-devel.git perhaps). Comments? Paul. From paulus at samba.org Wed Jan 11 22:11:39 2006 From: paulus at samba.org (Paul Mackerras) Date: Wed, 11 Jan 2006 22:11:39 +1100 Subject: restore_user_regs and fpu In-Reply-To: <43BC15A9.7010009@cs.helsinki.fi> References: <43BC15A9.7010009@cs.helsinki.fi> Message-ID: <17348.59371.543311.793437@cargo.ozlabs.ibm.com> Heikki Lindholm writes: > I haven't really confirmed this can happen, but I was wondering whether > the following would be possible. Looking at restore_user_regs in > ppc/kernel/signal_32.c and assuming: > * last_task_used_math == current, eg. a signal handler used fpu > * fpu state is still what the sig handler left there > If after the fpu state is restored to current->thread.fpr (copy_user) > somebody preempts this task and uses fpu, wouldn't it cause the fpu > state (of the sig handler) to be saved to > last_task_used_math->thread.fpr overwriting the just restored state. > Should the last_task_used_math nullifying, etc. be moved to the front of > the function instead, or am I overlooking something? I think you are correct, and that the same problem exists for 64-bit processes. This patch should fix it. Can anyone see any problem with this patch? Paul. diff --git a/arch/powerpc/kernel/process.c b/arch/powerpc/kernel/process.c index 105d560..913f906 100644 --- a/arch/powerpc/kernel/process.c +++ b/arch/powerpc/kernel/process.c @@ -201,13 +201,13 @@ int dump_spe(struct pt_regs *regs, elf_v } #endif /* CONFIG_SPE */ +#ifndef CONFIG_SMP /* * If we are doing lazy switching of CPU state (FP, altivec or SPE), * and the current task has some state, discard it. */ -static inline void discard_lazy_cpu_state(void) +void discard_lazy_cpu_state(void) { -#ifndef CONFIG_SMP preempt_disable(); if (last_task_used_math == current) last_task_used_math = NULL; @@ -220,8 +220,8 @@ static inline void discard_lazy_cpu_stat last_task_used_spe = NULL; #endif preempt_enable(); -#endif /* CONFIG_SMP */ } +#endif /* CONFIG_SMP */ int set_dabr(unsigned long dabr) { diff --git a/arch/powerpc/kernel/signal_32.c b/arch/powerpc/kernel/signal_32.c index d3f0b6d..177bba7 100644 --- a/arch/powerpc/kernel/signal_32.c +++ b/arch/powerpc/kernel/signal_32.c @@ -497,6 +497,15 @@ static long restore_user_regs(struct pt_ if (err) return 1; + /* + * Do this before updating the thread state in + * current->thread.fpr/vr/evr. That way, if we get preempted + * and another task grabs the FPU/Altivec/SPE, it won't be + * tempted to save the current CPU state into the thread_struct + * and corrupt what we are writing there. + */ + discard_lazy_cpu_state(); + /* force the process to reload the FP registers from current->thread when it next does FP instructions */ regs->msr &= ~(MSR_FP | MSR_FE0 | MSR_FE1); @@ -538,18 +547,6 @@ static long restore_user_regs(struct pt_ return 1; #endif /* CONFIG_SPE */ -#ifndef CONFIG_SMP - preempt_disable(); - if (last_task_used_math == current) - last_task_used_math = NULL; - if (last_task_used_altivec == current) - last_task_used_altivec = NULL; -#ifdef CONFIG_SPE - if (last_task_used_spe == current) - last_task_used_spe = NULL; -#endif - preempt_enable(); -#endif return 0; } diff --git a/arch/powerpc/kernel/signal_64.c b/arch/powerpc/kernel/signal_64.c index 5462bef..7b9d999 100644 --- a/arch/powerpc/kernel/signal_64.c +++ b/arch/powerpc/kernel/signal_64.c @@ -207,10 +207,20 @@ static long restore_sigcontext(struct pt if (!sig) regs->gpr[13] = save_r13; - err |= __copy_from_user(¤t->thread.fpr, &sc->fp_regs, FP_REGS_SIZE); if (set != NULL) err |= __get_user(set->sig[0], &sc->oldmask); + /* + * Do this before updating the thread state in + * current->thread.fpr/vr. That way, if we get preempted + * and another task grabs the FPU/Altivec, it won't be + * tempted to save the current CPU state into the thread_struct + * and corrupt what we are writing there. + */ + discard_lazy_cpu_state(); + + err |= __copy_from_user(¤t->thread.fpr, &sc->fp_regs, FP_REGS_SIZE); + #ifdef CONFIG_ALTIVEC err |= __get_user(v_regs, &sc->v_regs); err |= __get_user(msr, &sc->gp_regs[PT_MSR]); @@ -229,14 +239,6 @@ static long restore_sigcontext(struct pt current->thread.vrsave = 0; #endif /* CONFIG_ALTIVEC */ -#ifndef CONFIG_SMP - preempt_disable(); - if (last_task_used_math == current) - last_task_used_math = NULL; - if (last_task_used_altivec == current) - last_task_used_altivec = NULL; - preempt_enable(); -#endif /* Force reload of FP/VEC */ regs->msr &= ~(MSR_FP | MSR_FE0 | MSR_FE1 | MSR_VEC); diff --git a/include/asm-powerpc/system.h b/include/asm-powerpc/system.h index 0c58e32..4c88830 100644 --- a/include/asm-powerpc/system.h +++ b/include/asm-powerpc/system.h @@ -133,6 +133,14 @@ extern int fix_alignment(struct pt_regs extern void cvt_fd(float *from, double *to, struct thread_struct *thread); extern void cvt_df(double *from, float *to, struct thread_struct *thread); +#ifndef CONFIG_SMP +extern void discard_lazy_cpu_state(void); +#else +static inline void discard_lazy_cpu_state(void) +{ +} +#endif + #ifdef CONFIG_ALTIVEC extern void flush_altivec_to_thread(struct task_struct *); #else From galak at kernel.crashing.org Thu Jan 12 01:43:04 2006 From: galak at kernel.crashing.org (Kumar Gala) Date: Wed, 11 Jan 2006 08:43:04 -0600 Subject: [PATCH] implement AT_PLATFORM for powerpc In-Reply-To: <17348.50913.414568.263736@cargo.ozlabs.ibm.com> References: <17348.35120.840409.283964@cargo.ozlabs.ibm.com> <17348.37558.434652.697604@cargo.ozlabs.ibm.com> <20060111071032.GA28843@gate.ebshome.net> <17348.50913.414568.263736@cargo.ozlabs.ibm.com> Message-ID: Paul, This reminds me do we have a bit for having/not having the load/store string instructions. If memory serves me there were some discussions of looking at "depreciating" the instructions from the architecture. Freescale Book-E implementations already do NOT implement them. I doubt that Freescale will over implement these instructions ever again. -k On Jan 11, 2006, at 2:50 AM, Paul Mackerras wrote: > Eugene Surovegin writes: > >> I checked 44x user manuals I have: >> >> 440GP doesn't have isel >> 440GX, 440EP, 440SP, 440SPe, 440GR have it. > > Thanks, that's helpful. Do you know if 440{GX,EP,SP,SPe,GR} implement > all of the 32-bit user-mode instructions in Book E? > > How do mbar and msync work on those processors? As mbar and msync (as > defined in Book E) or as eieio and sync? > > Do the 440* processors in fact claim Book E compliance? > > Thanks, > Paul. > _______________________________________________ > Linuxppc64-dev mailing list > Linuxppc64-dev at ozlabs.org > https://ozlabs.org/mailman/listinfo/linuxppc64-dev From jdl at freescale.com Thu Jan 12 02:26:07 2006 From: jdl at freescale.com (Jon Loeliger) Date: Wed, 11 Jan 2006 09:26:07 -0600 Subject: powerpc.git tree In-Reply-To: <17348.60119.801379.127209@cargo.ozlabs.ibm.com> References: <17348.60119.801379.127209@cargo.ozlabs.ibm.com> Message-ID: <1136993167.29751.123.camel@cashmere.sps.mot.com> On Wed, 2006-01-11 at 05:24, Paul Mackerras wrote: > All of the patches in the powerpc.git tree have now been either sent > upstream to Linus' tree, or reverted. Yeah! > In future I'd like to be able to ask Linus to pull the powerpc.git > tree, without cluttering up his tree with those superseded commits. Can you give us a work-flow statement that covers the powerpc.git and powerpc-merge.git trees? When do patches hit on-or-the-other tree? What is the purpose of the two trees, especially given that "merge" work is also "development" work. When will the two trees be slated for upstream Linus pullage? That sort of thing. :-) > That means I need to reset the powerpc.git tree to be the same as > Linus' tree now. Oh boy! One shoe... > That means that anyone who is following the powerpc.git tree by doing > pulls periodically will need to reset their tree too. Otherwise each > pull will do an unnecessary merge. Two shoe... > If that would cause people serious heartburn, I can instead abandon > the powerpc.git tree and start a new development tree > (powerpc-devel.git perhaps). 'S ok with me either way. Just give us a "I did this, you now need to do that" statement as needed! Now, what we really need is a U-Boot tree in which we can dump the corresponding OF bits. Any chance we could get one set up at kernel.org that might later be pulled into WD's tree and simplify his life too? Thanks! jdl From dan at embeddededge.com Thu Jan 12 02:24:57 2006 From: dan at embeddededge.com (Dan Malek) Date: Wed, 11 Jan 2006 10:24:57 -0500 Subject: powerpc.git tree In-Reply-To: <17348.60119.801379.127209@cargo.ozlabs.ibm.com> References: <17348.60119.801379.127209@cargo.ozlabs.ibm.com> Message-ID: <76faf56ea70a1f2fe254367cda836c5f@embeddededge.com> On Jan 11, 2006, at 6:24 AM, Paul Mackerras wrote: > If that would cause people serious heartburn, I can instead abandon > the powerpc.git tree and start a new development tree > (powerpc-devel.git perhaps). From past experience, creating another tree, especially something called "devel" only caused more problems :-) Please, just do what you think is best for the powerpc.git tree and we'll just move forward. Thanks. -- Dan From maule at sgi.com Thu Jan 12 02:52:51 2006 From: maule at sgi.com (Mark Maule) Date: Wed, 11 Jan 2006 09:52:51 -0600 (CST) Subject: [PATCH 0/3] msi abstractions and support for altix Message-ID: <20060111155251.12460.71269.12163@attica.americas.sgi.com> Resend #3: misc fixups Patch set to abstract portions of the MSI core so that it can be used on architectures which don't use standard interrupt controllers. Changes from Resend #2 to Resend #3: + Cleanup the ia64 platform_msi_init macro so it works on non-altix ia64 Changes from initial version to Resend #2: + Change uintXX_t to uXX + Change _callouts to _ops + Renamed the _generic routines to _apic and moved them to a new file msi-apic.c + Have each msi_arch_init() routine call msi_register() with the desired msi ops for that platform. + Moved msi_address, msi_data, and related defs out of msi.h and into msi-apic.c, replaced by shifts/masks. + Rolled msi-arch-init.patch and msi-callouts.patch into a single msi-ops.patch Mark 1/3 msi-ops.patch Add an msi_arch_init() hook which can be used to perform platform specific setup prior to msi use. Define a set of msi ops to implement the platform-specific tasks: setup - set up plumbing to get a vector directed at a default cpu, and return the corresponding MSI bus address and data. teardown - inverse of msi_setup target - retarget a vector to a given cpu Define the routine msi_register() called from msi_arch_init() to set the desired ops. Move a bunch of apic-specific code out of the msi core .h/.c and into a new msi-apic.c file. 2/3 ia64-per-platform-device-vector.patch For the ia64 arch, allow per-platform definitions of IA64_FIRST_DEVICE_VECTOR and IA64_LAST_DEVICE_VECTOR. 3/3 msi-altix.patch Altix specific callouts to implement MSI. From maule at sgi.com Thu Jan 12 02:53:06 2006 From: maule at sgi.com (Mark Maule) Date: Wed, 11 Jan 2006 09:53:06 -0600 (CST) Subject: [PATCH 2/3] altix: msi support In-Reply-To: <20060111155251.12460.71269.12163@attica.americas.sgi.com> References: <20060111155251.12460.71269.12163@attica.americas.sgi.com> Message-ID: <20060111155306.12460.99670.84191@attica.americas.sgi.com> MSI callouts for altix. Involves a fair amount of code reorg in sn irq.c code as well as adding some extensions to the altix PCI provider abstaction. Signed-off-by: Mark Maule Index: linux-2.6.14/arch/ia64/sn/pci/msi.c =================================================================== --- linux-2.6.14.orig/arch/ia64/sn/pci/msi.c 2005-12-21 22:37:02.978262311 -0600 +++ linux-2.6.14/arch/ia64/sn/pci/msi.c 2005-12-21 22:38:24.090685912 -0600 @@ -6,13 +6,205 @@ * Copyright (C) 2005 Silicon Graphics, Inc. All Rights Reserved. */ -#include +#include +#include +#include + +#include + +#include +#include +#include +#include +#include + +struct sn_msi_info { + u64 pci_addr; + struct sn_irq_info *sn_irq_info; +}; + +static struct sn_msi_info *sn_msi_info; + +static void +sn_msi_teardown(unsigned int vector) +{ + nasid_t nasid; + int widget; + struct pci_dev *pdev; + struct pcidev_info *sn_pdev; + struct sn_irq_info *sn_irq_info; + struct pcibus_bussoft *bussoft; + struct sn_pcibus_provider *provider; + + sn_irq_info = sn_msi_info[vector].sn_irq_info; + if (sn_irq_info == NULL || sn_irq_info->irq_int_bit >= 0) + return; + + sn_pdev = (struct pcidev_info *)sn_irq_info->irq_pciioinfo; + pdev = sn_pdev->pdi_linux_pcidev; + provider = SN_PCIDEV_BUSPROVIDER(pdev); + + (*provider->dma_unmap)(pdev, + sn_msi_info[vector].pci_addr, + PCI_DMA_FROMDEVICE); + sn_msi_info[vector].pci_addr = 0; + + bussoft = SN_PCIDEV_BUSSOFT(pdev); + nasid = NASID_GET(bussoft->bs_base); + widget = (nasid & 1) ? + TIO_SWIN_WIDGETNUM(bussoft->bs_base) : + SWIN_WIDGETNUM(bussoft->bs_base); + + sn_intr_free(nasid, widget, sn_irq_info); + sn_msi_info[vector].sn_irq_info = NULL; + + return; +} int -sn_msi_init(void) +sn_msi_setup(struct pci_dev *pdev, unsigned int vector, + u32 *addr_hi, u32 *addr_lo, u32 *data) { + int widget; + int status; + nasid_t nasid; + u64 bus_addr; + struct sn_irq_info *sn_irq_info; + struct pcibus_bussoft *bussoft = SN_PCIDEV_BUSSOFT(pdev); + struct sn_pcibus_provider *provider = SN_PCIDEV_BUSPROVIDER(pdev); + + if (bussoft == NULL) + return -EINVAL; + + if (provider == NULL || provider->dma_map_consistent == NULL) + return -EINVAL; + + /* + * Set up the vector plumbing. Let the prom (via sn_intr_alloc) + * decide which cpu to direct this msi at by default. + */ + + nasid = NASID_GET(bussoft->bs_base); + widget = (nasid & 1) ? + TIO_SWIN_WIDGETNUM(bussoft->bs_base) : + SWIN_WIDGETNUM(bussoft->bs_base); + + sn_irq_info = kzalloc(sizeof(struct sn_irq_info), GFP_KERNEL); + if (! sn_irq_info) + return -ENOMEM; + + status = sn_intr_alloc(nasid, widget, sn_irq_info, vector, -1, -1); + if (status) { + kfree(sn_irq_info); + return -ENOMEM; + } + + sn_irq_info->irq_int_bit = -1; /* mark this as an MSI irq */ + sn_irq_fixup(pdev, sn_irq_info); + + /* Prom probably should fill these in, but doesn't ... */ + sn_irq_info->irq_bridge_type = bussoft->bs_asic_type; + sn_irq_info->irq_bridge = (void *)bussoft->bs_base; + /* - * return error until MSI is supported on altix platforms + * Map the xio address into bus space */ - return -EINVAL; + bus_addr = (*provider->dma_map_consistent)(pdev, + sn_irq_info->irq_xtalkaddr, + sizeof(sn_irq_info->irq_xtalkaddr), + SN_DMA_MSI|SN_DMA_ADDR_XIO); + if (! bus_addr) { + sn_intr_free(nasid, widget, sn_irq_info); + kfree(sn_irq_info); + return -ENOMEM; + } + + sn_msi_info[vector].sn_irq_info = sn_irq_info; + sn_msi_info[vector].pci_addr = bus_addr; + + *addr_hi = (u32)(bus_addr >> 32); + *addr_lo = (u32)(bus_addr & 0x00000000ffffffff); + + /* + * In the SN platform, bit 16 is a "send vector" bit which + * must be present in order to move the vector through the system. + */ + *data = 0x100 + (unsigned int)vector; + +#ifdef CONFIG_SMP + set_irq_affinity_info((vector & 0xff), sn_irq_info->irq_cpuid, 0); +#endif + + return 0; +} + +static void +sn_msi_target(unsigned int vector, unsigned int cpu, + u32 *addr_hi, u32 *addr_lo) +{ + int slice; + nasid_t nasid; + u64 bus_addr; + struct pci_dev *pdev; + struct pcidev_info *sn_pdev; + struct sn_irq_info *sn_irq_info; + struct sn_irq_info *new_irq_info; + struct sn_pcibus_provider *provider; + + sn_irq_info = sn_msi_info[vector].sn_irq_info; + if (sn_irq_info == NULL || sn_irq_info->irq_int_bit >= 0) + return; + + /* + * Release XIO resources for the old MSI PCI address + */ + + sn_pdev = (struct pcidev_info *)sn_irq_info->irq_pciioinfo; + pdev = sn_pdev->pdi_linux_pcidev; + provider = SN_PCIDEV_BUSPROVIDER(pdev); + + bus_addr = (u64)(*addr_hi) << 32 | (u64)(*addr_lo); + (*provider->dma_unmap)(pdev, bus_addr, PCI_DMA_FROMDEVICE); + sn_msi_info[vector].pci_addr = 0; + + nasid = cpuid_to_nasid(cpu); + slice = cpuid_to_slice(cpu); + + new_irq_info = sn_retarget_vector(sn_irq_info, nasid, slice); + sn_msi_info[vector].sn_irq_info = new_irq_info; + if (new_irq_info == NULL) + return; + + /* + * Map the xio address into bus space + */ + + bus_addr = (*provider->dma_map_consistent)(pdev, + new_irq_info->irq_xtalkaddr, + sizeof(new_irq_info->irq_xtalkaddr), + SN_DMA_MSI|SN_DMA_ADDR_XIO); + + sn_msi_info[vector].pci_addr = bus_addr; + *addr_hi = (u32)(bus_addr >> 32); + *addr_lo = (u32)(bus_addr & 0x00000000ffffffff); +} + +struct msi_ops sn_msi_ops = { + .setup = sn_msi_setup, + .teardown = sn_msi_teardown, +#ifdef CONFIG_SMP + .target = sn_msi_target, +#endif +}; + +int +sn_msi_init(void) +{ + sn_msi_info = + kzalloc(sizeof(struct sn_msi_info) * NR_VECTORS, GFP_KERNEL); + if (! sn_msi_info) + return -ENOMEM; + + msi_register(&sn_msi_ops); + return 0; } Index: linux-2.6.14/arch/ia64/sn/kernel/io_init.c =================================================================== --- linux-2.6.14.orig/arch/ia64/sn/kernel/io_init.c 2005-12-21 22:35:23.436286704 -0600 +++ linux-2.6.14/arch/ia64/sn/kernel/io_init.c 2005-12-21 22:38:24.091685671 -0600 @@ -51,7 +51,7 @@ */ static dma_addr_t -sn_default_pci_map(struct pci_dev *pdev, unsigned long paddr, size_t size) +sn_default_pci_map(struct pci_dev *pdev, unsigned long paddr, size_t size, int type) { return 0; } Index: linux-2.6.14/arch/ia64/sn/kernel/irq.c =================================================================== --- linux-2.6.14.orig/arch/ia64/sn/kernel/irq.c 2005-12-21 22:37:58.120953676 -0600 +++ linux-2.6.14/arch/ia64/sn/kernel/irq.c 2005-12-21 22:38:24.092685429 -0600 @@ -25,11 +25,11 @@ int sn_force_interrupt_flag = 1; extern int sn_ioif_inited; -static struct list_head **sn_irq_lh; +struct list_head **sn_irq_lh; static spinlock_t sn_irq_info_lock = SPIN_LOCK_UNLOCKED; /* non-IRQ lock */ -static inline uint64_t sn_intr_alloc(nasid_t local_nasid, int local_widget, - u64 sn_irq_info, +uint64_t sn_intr_alloc(nasid_t local_nasid, int local_widget, + struct sn_irq_info *sn_irq_info, int req_irq, nasid_t req_nasid, int req_slice) { @@ -39,12 +39,13 @@ SAL_CALL_NOLOCK(ret_stuff, (u64) SN_SAL_IOIF_INTERRUPT, (u64) SAL_INTR_ALLOC, (u64) local_nasid, - (u64) local_widget, (u64) sn_irq_info, (u64) req_irq, + (u64) local_widget, __pa(sn_irq_info), (u64) req_irq, (u64) req_nasid, (u64) req_slice); + return ret_stuff.status; } -static inline void sn_intr_free(nasid_t local_nasid, int local_widget, +void sn_intr_free(nasid_t local_nasid, int local_widget, struct sn_irq_info *sn_irq_info) { struct ia64_sal_retval ret_stuff; @@ -113,73 +114,91 @@ static void sn_irq_info_free(struct rcu_head *head); -static void sn_set_affinity_irq(unsigned int irq, cpumask_t mask) +struct sn_irq_info *sn_retarget_vector(struct sn_irq_info *sn_irq_info, + nasid_t nasid, int slice) { - struct sn_irq_info *sn_irq_info, *sn_irq_info_safe; - int cpuid, cpuphys; + int vector; + int cpuphys; + int64_t bridge; + int local_widget, status; + nasid_t local_nasid; + struct sn_irq_info *new_irq_info; + struct sn_pcibus_provider *pci_provider; - cpuid = first_cpu(mask); - cpuphys = cpu_physical_id(cpuid); + new_irq_info = kmalloc(sizeof(struct sn_irq_info), GFP_ATOMIC); + if (new_irq_info == NULL) + return NULL; - list_for_each_entry_safe(sn_irq_info, sn_irq_info_safe, - sn_irq_lh[irq], list) { - uint64_t bridge; - int local_widget, status; - nasid_t local_nasid; - struct sn_irq_info *new_irq_info; - struct sn_pcibus_provider *pci_provider; - - new_irq_info = kmalloc(sizeof(struct sn_irq_info), GFP_ATOMIC); - if (new_irq_info == NULL) - break; - memcpy(new_irq_info, sn_irq_info, sizeof(struct sn_irq_info)); - - bridge = (uint64_t) new_irq_info->irq_bridge; - if (!bridge) { - kfree(new_irq_info); - break; /* irq is not a device interrupt */ - } + memcpy(new_irq_info, sn_irq_info, sizeof(struct sn_irq_info)); - local_nasid = NASID_GET(bridge); + bridge = (uint64_t) new_irq_info->irq_bridge; + if (!bridge) { + kfree(new_irq_info); + return NULL; /* irq is not a device interrupt */ + } - if (local_nasid & 1) - local_widget = TIO_SWIN_WIDGETNUM(bridge); - else - local_widget = SWIN_WIDGETNUM(bridge); - - /* Free the old PROM new_irq_info structure */ - sn_intr_free(local_nasid, local_widget, new_irq_info); - /* Update kernels new_irq_info with new target info */ - unregister_intr_pda(new_irq_info); - - /* allocate a new PROM new_irq_info struct */ - status = sn_intr_alloc(local_nasid, local_widget, - __pa(new_irq_info), irq, - cpuid_to_nasid(cpuid), - cpuid_to_slice(cpuid)); - - /* SAL call failed */ - if (status) { - kfree(new_irq_info); - break; - } + local_nasid = NASID_GET(bridge); - new_irq_info->irq_cpuid = cpuid; - register_intr_pda(new_irq_info); + if (local_nasid & 1) + local_widget = TIO_SWIN_WIDGETNUM(bridge); + else + local_widget = SWIN_WIDGETNUM(bridge); - pci_provider = sn_pci_provider[new_irq_info->irq_bridge_type]; - if (pci_provider && pci_provider->target_interrupt) - (pci_provider->target_interrupt)(new_irq_info); - - spin_lock(&sn_irq_info_lock); - list_replace_rcu(&sn_irq_info->list, &new_irq_info->list); - spin_unlock(&sn_irq_info_lock); - call_rcu(&sn_irq_info->rcu, sn_irq_info_free); + vector = sn_irq_info->irq_irq; + /* Free the old PROM new_irq_info structure */ + sn_intr_free(local_nasid, local_widget, new_irq_info); + /* Update kernels new_irq_info with new target info */ + unregister_intr_pda(new_irq_info); + + /* allocate a new PROM new_irq_info struct */ + status = sn_intr_alloc(local_nasid, local_widget, + new_irq_info, vector, + nasid, slice); + + /* SAL call failed */ + if (status) { + kfree(new_irq_info); + return NULL; + } + + cpuphys = nasid_slice_to_cpuid(nasid, slice); + new_irq_info->irq_cpuid = cpuphys; + register_intr_pda(new_irq_info); + + pci_provider = sn_pci_provider[new_irq_info->irq_bridge_type]; + + /* + * If this represents a line interrupt, target it. If it's + * an msi (irq_int_bit < 0), it's already targeted. + */ + if (new_irq_info->irq_int_bit >= 0 && + pci_provider && pci_provider->target_interrupt) + (pci_provider->target_interrupt)(new_irq_info); + + spin_lock(&sn_irq_info_lock); + list_replace_rcu(&sn_irq_info->list, &new_irq_info->list); + spin_unlock(&sn_irq_info_lock); + call_rcu(&sn_irq_info->rcu, sn_irq_info_free); #ifdef CONFIG_SMP - set_irq_affinity_info((irq & 0xff), cpuphys, 0); + set_irq_affinity_info((vector & 0xff), cpuphys, 0); #endif - } + + return new_irq_info; +} + +static void sn_set_affinity_irq(unsigned int irq, cpumask_t mask) +{ + struct sn_irq_info *sn_irq_info, *sn_irq_info_safe; + nasid_t nasid; + int slice; + + nasid = cpuid_to_nasid(first_cpu(mask)); + slice = cpuid_to_slice(first_cpu(mask)); + + list_for_each_entry_safe(sn_irq_info, sn_irq_info_safe, + sn_irq_lh[irq], list) + (void)sn_retarget_vector(sn_irq_info, nasid, slice); } struct hw_interrupt_type irq_type_sn = { @@ -441,5 +460,4 @@ INIT_LIST_HEAD(sn_irq_lh[i]); } - } Index: linux-2.6.14/arch/ia64/sn/pci/pci_dma.c =================================================================== --- linux-2.6.14.orig/arch/ia64/sn/pci/pci_dma.c 2005-12-21 22:35:23.446284291 -0600 +++ linux-2.6.14/arch/ia64/sn/pci/pci_dma.c 2005-12-21 22:38:24.092685429 -0600 @@ -11,7 +11,7 @@ #include #include -#include +#include #include #include #include @@ -113,7 +113,8 @@ * resources. */ - *dma_handle = provider->dma_map_consistent(pdev, phys_addr, size); + *dma_handle = provider->dma_map_consistent(pdev, phys_addr, size, + SN_DMA_ADDR_PHYS); if (!*dma_handle) { printk(KERN_ERR "%s: out of ATEs\n", __FUNCTION__); free_pages((unsigned long)cpuaddr, get_order(size)); @@ -176,7 +177,7 @@ BUG_ON(dev->bus != &pci_bus_type); phys_addr = __pa(cpu_addr); - dma_addr = provider->dma_map(pdev, phys_addr, size); + dma_addr = provider->dma_map(pdev, phys_addr, size, SN_DMA_ADDR_PHYS); if (!dma_addr) { printk(KERN_ERR "%s: out of ATEs\n", __FUNCTION__); return 0; @@ -260,7 +261,8 @@ for (i = 0; i < nhwentries; i++, sg++) { phys_addr = SG_ENT_PHYS_ADDRESS(sg); sg->dma_address = provider->dma_map(pdev, - phys_addr, sg->length); + phys_addr, sg->length, + SN_DMA_ADDR_PHYS); if (!sg->dma_address) { printk(KERN_ERR "%s: out of ATEs\n", __FUNCTION__); Index: linux-2.6.14/arch/ia64/sn/pci/pcibr/pcibr_dma.c =================================================================== --- linux-2.6.14.orig/arch/ia64/sn/pci/pcibr/pcibr_dma.c 2005-12-21 22:35:23.445284532 -0600 +++ linux-2.6.14/arch/ia64/sn/pci/pcibr/pcibr_dma.c 2005-12-21 22:38:24.093685188 -0600 @@ -41,7 +41,7 @@ static dma_addr_t pcibr_dmamap_ate32(struct pcidev_info *info, - uint64_t paddr, size_t req_size, uint64_t flags) + uint64_t paddr, size_t req_size, uint64_t flags, int dma_flags) { struct pcidev_info *pcidev_info = info->pdi_host_pcidev_info; @@ -81,9 +81,12 @@ if (IS_PCIX(pcibus_info)) ate_flags &= ~(PCI32_ATE_PREF); - xio_addr = - IS_PIC_SOFT(pcibus_info) ? PHYS_TO_DMA(paddr) : - PHYS_TO_TIODMA(paddr); + if (SN_DMA_ADDRTYPE(dma_flags == SN_DMA_ADDR_PHYS)) + xio_addr = IS_PIC_SOFT(pcibus_info) ? PHYS_TO_DMA(paddr) : + PHYS_TO_TIODMA(paddr); + else + xio_addr = paddr; + offset = IOPGOFF(xio_addr); ate = ate_flags | (xio_addr - offset); @@ -91,6 +94,13 @@ if (IS_PIC_SOFT(pcibus_info)) { ate |= (pcibus_info->pbi_hub_xid << PIC_ATE_TARGETID_SHFT); } + + /* + * If we're mapping for MSI, set the MSI bit in the ATE + */ + if (dma_flags & SN_DMA_MSI) + ate |= PCI32_ATE_MSI; + ate_write(pcibus_info, ate_index, ate_count, ate); /* @@ -105,20 +115,27 @@ if (pcibus_info->pbi_devreg[internal_device] & PCIBR_DEV_SWAP_DIR) ATE_SWAP_ON(pci_addr); + return pci_addr; } static dma_addr_t pcibr_dmatrans_direct64(struct pcidev_info * info, uint64_t paddr, - uint64_t dma_attributes) + uint64_t dma_attributes, int dma_flags) { struct pcibus_info *pcibus_info = (struct pcibus_info *) ((info->pdi_host_pcidev_info)->pdi_pcibus_info); uint64_t pci_addr; /* Translate to Crosstalk View of Physical Address */ - pci_addr = (IS_PIC_SOFT(pcibus_info) ? PHYS_TO_DMA(paddr) : - PHYS_TO_TIODMA(paddr)) | dma_attributes; + if (SN_DMA_ADDRTYPE(dma_flags) == SN_DMA_ADDR_PHYS) + pci_addr = IS_PIC_SOFT(pcibus_info) ? + PHYS_TO_DMA(paddr) : + PHYS_TO_TIODMA(paddr) | dma_attributes; + else + pci_addr = IS_PIC_SOFT(pcibus_info) ? + paddr : + paddr | dma_attributes; /* Handle Bus mode */ if (IS_PCIX(pcibus_info)) @@ -130,7 +147,9 @@ ((uint64_t) pcibus_info-> pbi_hub_xid << PIC_PCI64_ATTR_TARG_SHFT); } else - pci_addr |= TIOCP_PCI64_CMDTYPE_MEM; + pci_addr |= (dma_flags & SN_DMA_MSI) ? + TIOCP_PCI64_CMDTYPE_MSI : + TIOCP_PCI64_CMDTYPE_MEM; /* If PCI mode, func zero uses VCHAN0, every other func uses VCHAN1 */ if (!IS_PCIX(pcibus_info) && PCI_FUNC(info->pdi_linux_pcidev->devfn)) @@ -142,7 +161,7 @@ static dma_addr_t pcibr_dmatrans_direct32(struct pcidev_info * info, - uint64_t paddr, size_t req_size, uint64_t flags) + uint64_t paddr, size_t req_size, uint64_t flags, int dma_flags) { struct pcidev_info *pcidev_info = info->pdi_host_pcidev_info; @@ -158,8 +177,14 @@ return 0; } - xio_addr = IS_PIC_SOFT(pcibus_info) ? PHYS_TO_DMA(paddr) : - PHYS_TO_TIODMA(paddr); + if (dma_flags & SN_DMA_MSI) + return 0; + + if (SN_DMA_ADDRTYPE(dma_flags) == SN_DMA_ADDR_PHYS) + xio_addr = IS_PIC_SOFT(pcibus_info) ? PHYS_TO_DMA(paddr) : + PHYS_TO_TIODMA(paddr); + else + xio_addr = paddr; xio_base = pcibus_info->pbi_dir_xbase; offset = xio_addr - xio_base; @@ -331,7 +356,7 @@ */ dma_addr_t -pcibr_dma_map(struct pci_dev * hwdev, unsigned long phys_addr, size_t size) +pcibr_dma_map(struct pci_dev * hwdev, unsigned long phys_addr, size_t size, int dma_flags) { dma_addr_t dma_handle; struct pcidev_info *pcidev_info = SN_PCIDEV_INFO(hwdev); @@ -348,11 +373,11 @@ */ dma_handle = pcibr_dmatrans_direct64(pcidev_info, phys_addr, - PCI64_ATTR_PREF); + PCI64_ATTR_PREF, dma_flags); } else { /* Handle 32-63 bit cards via direct mapping */ dma_handle = pcibr_dmatrans_direct32(pcidev_info, phys_addr, - size, 0); + size, 0, dma_flags); if (!dma_handle) { /* * It is a 32 bit card and we cannot do direct mapping, @@ -360,7 +385,8 @@ */ dma_handle = pcibr_dmamap_ate32(pcidev_info, phys_addr, - size, PCI32_ATE_PREF); + size, PCI32_ATE_PREF, + dma_flags); } } @@ -369,18 +395,18 @@ dma_addr_t pcibr_dma_map_consistent(struct pci_dev * hwdev, unsigned long phys_addr, - size_t size) + size_t size, int dma_flags) { dma_addr_t dma_handle; struct pcidev_info *pcidev_info = SN_PCIDEV_INFO(hwdev); if (hwdev->dev.coherent_dma_mask == ~0UL) { dma_handle = pcibr_dmatrans_direct64(pcidev_info, phys_addr, - PCI64_ATTR_BAR); + PCI64_ATTR_BAR, dma_flags); } else { dma_handle = (dma_addr_t) pcibr_dmamap_ate32(pcidev_info, phys_addr, size, - PCI32_ATE_BAR); + PCI32_ATE_BAR, dma_flags); } return dma_handle; Index: linux-2.6.14/arch/ia64/sn/pci/tioca_provider.c =================================================================== --- linux-2.6.14.orig/arch/ia64/sn/pci/tioca_provider.c 2005-12-21 22:35:23.446284291 -0600 +++ linux-2.6.14/arch/ia64/sn/pci/tioca_provider.c 2005-12-21 22:38:24.093685188 -0600 @@ -515,11 +515,17 @@ * use the GART mapped mode. */ static uint64_t -tioca_dma_map(struct pci_dev *pdev, uint64_t paddr, size_t byte_count) +tioca_dma_map(struct pci_dev *pdev, uint64_t paddr, size_t byte_count, int dma_flags) { uint64_t mapaddr; /* + * Not supported for now ... + */ + if (dma_flags & SN_DMA_MSI) + return 0; + + /* * If card is 64 or 48 bit addresable, use a direct mapping. 32 * bit direct is so restrictive w.r.t. where the memory resides that * we don't use it even though CA has some support. Index: linux-2.6.14/arch/ia64/sn/pci/tioce_provider.c =================================================================== --- linux-2.6.14.orig/arch/ia64/sn/pci/tioce_provider.c 2005-12-21 22:35:23.445284532 -0600 +++ linux-2.6.14/arch/ia64/sn/pci/tioce_provider.c 2005-12-21 22:38:24.094684947 -0600 @@ -52,7 +52,8 @@ (ATE_PAGE((start)+(len)-1, pagesize) - ATE_PAGE(start, pagesize) + 1) #define ATE_VALID(ate) ((ate) & (1UL << 63)) -#define ATE_MAKE(addr, ps) (((addr) & ~ATE_PAGEMASK(ps)) | (1UL << 63)) +#define ATE_MAKE(addr, ps, msi) \ + (((addr) & ~ATE_PAGEMASK(ps)) | (1UL << 63) | ((msi)?(1UL << 62):0)) /* * Flavors of ate-based mapping supported by tioce_alloc_map() @@ -78,15 +79,17 @@ * * 63 - must be 1 to indicate d64 mode to CE hardware * 62 - barrier bit ... controlled with tioce_dma_barrier() - * 61 - 0 since this is not an MSI transaction + * 61 - msi bit ... specified through dma_flags * 60:54 - reserved, MBZ */ static uint64_t -tioce_dma_d64(unsigned long ct_addr) +tioce_dma_d64(unsigned long ct_addr, int dma_flags) { uint64_t bus_addr; bus_addr = ct_addr | (1UL << 63); + if (dma_flags & SN_DMA_MSI) + bus_addr |= (1UL << 61); return bus_addr; } @@ -143,7 +146,7 @@ */ static uint64_t tioce_alloc_map(struct tioce_kernel *ce_kern, int type, int port, - uint64_t ct_addr, int len) + uint64_t ct_addr, int len, int dma_flags) { int i; int j; @@ -152,6 +155,7 @@ int entries; int nates; int pagesize; + int msi_capable, msi_wanted; uint64_t *ate_shadow; uint64_t *ate_reg; uint64_t addr; @@ -173,6 +177,7 @@ ate_reg = ce_mmr->ce_ure_ate3240; pagesize = ce_kern->ce_ate3240_pagesize; bus_base = TIOCE_M32_MIN; + msi_capable = 1; break; case TIOCE_ATE_M40: first = 0; @@ -181,6 +186,7 @@ ate_reg = ce_mmr->ce_ure_ate40; pagesize = MB(64); bus_base = TIOCE_M40_MIN; + msi_capable = 0; break; case TIOCE_ATE_M40S: /* @@ -193,11 +199,16 @@ ate_reg = ce_mmr->ce_ure_ate3240; pagesize = GB(16); bus_base = TIOCE_M40S_MIN; + msi_capable = 0; break; default: return 0; } + msi_wanted = dma_flags & SN_DMA_MSI; + if (msi_wanted && !msi_capable) + return 0; + nates = ATE_NPAGES(ct_addr, len, pagesize); if (nates > entries) return 0; @@ -226,7 +237,7 @@ for (j = 0; j < nates; j++) { uint64_t ate; - ate = ATE_MAKE(addr, pagesize); + ate = ATE_MAKE(addr, pagesize, msi_wanted); ate_shadow[i + j] = ate; writeq(ate, &ate_reg[i + j]); addr += pagesize; @@ -253,7 +264,7 @@ * Map @paddr into 32-bit bus space of the CE associated with @pcidev_info. */ static uint64_t -tioce_dma_d32(struct pci_dev *pdev, uint64_t ct_addr) +tioce_dma_d32(struct pci_dev *pdev, uint64_t ct_addr, int dma_flags) { int dma_ok; int port; @@ -263,6 +274,9 @@ uint64_t ct_lower; dma_addr_t bus_addr; + if (dma_flags & SN_DMA_MSI) + return 0; + ct_upper = ct_addr & ~0x3fffffffUL; ct_lower = ct_addr & 0x3fffffffUL; @@ -387,7 +401,7 @@ */ static uint64_t tioce_do_dma_map(struct pci_dev *pdev, uint64_t paddr, size_t byte_count, - int barrier) + int barrier, int dma_flags) { unsigned long flags; uint64_t ct_addr; @@ -403,15 +417,18 @@ if (dma_mask < 0x7fffffffUL) return 0; - ct_addr = PHYS_TO_TIODMA(paddr); + if (SN_DMA_ADDRTYPE(dma_flags) == SN_DMA_ADDR_PHYS) + ct_addr = PHYS_TO_TIODMA(paddr); + else + ct_addr = paddr; /* * If the device can generate 64 bit addresses, create a D64 map. - * Since this should never fail, bypass the rest of the checks. */ if (dma_mask == ~0UL) { - mapaddr = tioce_dma_d64(ct_addr); - goto dma_map_done; + mapaddr = tioce_dma_d64(ct_addr, dma_flags); + if (mapaddr) + goto dma_map_done; } pcidev_to_tioce(pdev, NULL, &ce_kern, &port); @@ -454,18 +471,22 @@ if (byte_count > MB(64)) { mapaddr = tioce_alloc_map(ce_kern, TIOCE_ATE_M40S, - port, ct_addr, byte_count); + port, ct_addr, byte_count, + dma_flags); if (!mapaddr) mapaddr = tioce_alloc_map(ce_kern, TIOCE_ATE_M40, -1, - ct_addr, byte_count); + ct_addr, byte_count, + dma_flags); } else { mapaddr = tioce_alloc_map(ce_kern, TIOCE_ATE_M40, -1, - ct_addr, byte_count); + ct_addr, byte_count, + dma_flags); if (!mapaddr) mapaddr = tioce_alloc_map(ce_kern, TIOCE_ATE_M40S, - port, ct_addr, byte_count); + port, ct_addr, byte_count, + dma_flags); } } @@ -473,7 +494,7 @@ * 32-bit direct is the next mode to try */ if (!mapaddr && dma_mask >= 0xffffffffUL) - mapaddr = tioce_dma_d32(pdev, ct_addr); + mapaddr = tioce_dma_d32(pdev, ct_addr, dma_flags); /* * Last resort, try 32-bit ATE-based map. @@ -481,12 +502,12 @@ if (!mapaddr) mapaddr = tioce_alloc_map(ce_kern, TIOCE_ATE_M32, -1, ct_addr, - byte_count); + byte_count, dma_flags); spin_unlock_irqrestore(&ce_kern->ce_lock, flags); dma_map_done: - if (mapaddr & barrier) + if (mapaddr && barrier) mapaddr = tioce_dma_barrier(mapaddr, 1); return mapaddr; @@ -502,9 +523,9 @@ * in the address. */ static uint64_t -tioce_dma(struct pci_dev *pdev, uint64_t paddr, size_t byte_count) +tioce_dma(struct pci_dev *pdev, uint64_t paddr, size_t byte_count, int dma_flags) { - return tioce_do_dma_map(pdev, paddr, byte_count, 0); + return tioce_do_dma_map(pdev, paddr, byte_count, 0, dma_flags); } /** @@ -516,9 +537,9 @@ * Simply call tioce_do_dma_map() to create a map with the barrier bit set * in the address. */ static uint64_t -tioce_dma_consistent(struct pci_dev *pdev, uint64_t paddr, size_t byte_count) +tioce_dma_consistent(struct pci_dev *pdev, uint64_t paddr, size_t byte_count, int dma_flags) { - return tioce_do_dma_map(pdev, paddr, byte_count, 1); + return tioce_do_dma_map(pdev, paddr, byte_count, 1, dma_flags); } /** Index: linux-2.6.14/include/asm-ia64/sn/intr.h =================================================================== --- linux-2.6.14.orig/include/asm-ia64/sn/intr.h 2005-12-21 22:35:23.446284291 -0600 +++ linux-2.6.14/include/asm-ia64/sn/intr.h 2005-12-21 22:38:24.094684947 -0600 @@ -3,13 +3,14 @@ * License. See the file "COPYING" in the main directory of this archive * for more details. * - * Copyright (C) 1992 - 1997, 2000-2004 Silicon Graphics, Inc. All rights reserved. + * Copyright (C) 1992 - 1997, 2000-2005 Silicon Graphics, Inc. All rights reserved. */ #ifndef _ASM_IA64_SN_INTR_H #define _ASM_IA64_SN_INTR_H #include +#include #define SGI_UART_VECTOR (0xe9) @@ -40,6 +41,7 @@ int irq_cpuid; /* kernel logical cpuid */ int irq_irq; /* the IRQ number */ int irq_int_bit; /* Bridge interrupt pin */ + /* <0 means MSI */ uint64_t irq_xtalkaddr; /* xtalkaddr IRQ is sent to */ int irq_bridge_type;/* pciio asic type (pciio.h) */ void *irq_bridge; /* bridge generating irq */ @@ -53,6 +55,12 @@ }; extern void sn_send_IPI_phys(int, long, int, int); +extern uint64_t sn_intr_alloc(nasid_t, int, + struct sn_irq_info *, + int, nasid_t, int); +extern void sn_intr_free(nasid_t, int, struct sn_irq_info *); +extern struct sn_irq_info *sn_retarget_vector(struct sn_irq_info *, nasid_t, int); +extern struct list_head **sn_irq_lh; #define CPU_VECTOR_TO_IRQ(cpuid,vector) (vector) Index: linux-2.6.14/include/asm-ia64/sn/pcibr_provider.h =================================================================== --- linux-2.6.14.orig/include/asm-ia64/sn/pcibr_provider.h 2005-12-21 22:35:23.446284291 -0600 +++ linux-2.6.14/include/asm-ia64/sn/pcibr_provider.h 2005-12-21 22:38:24.094684947 -0600 @@ -3,7 +3,7 @@ * License. See the file "COPYING" in the main directory of this archive * for more details. * - * Copyright (C) 1992-1997,2000-2004 Silicon Graphics, Inc. All rights reserved. + * Copyright (C) 1992-1997,2000-2005 Silicon Graphics, Inc. All rights reserved. */ #ifndef _ASM_IA64_SN_PCI_PCIBR_PROVIDER_H #define _ASM_IA64_SN_PCI_PCIBR_PROVIDER_H @@ -55,6 +55,7 @@ #define PCI32_ATE_V (0x1 << 0) #define PCI32_ATE_CO (0x1 << 1) #define PCI32_ATE_PREC (0x1 << 2) +#define PCI32_ATE_MSI (0x1 << 2) #define PCI32_ATE_PREF (0x1 << 3) #define PCI32_ATE_BAR (0x1 << 4) #define PCI32_ATE_ADDR_SHFT 12 @@ -129,8 +130,8 @@ extern int pcibr_init_provider(void); extern void *pcibr_bus_fixup(struct pcibus_bussoft *, struct pci_controller *); -extern dma_addr_t pcibr_dma_map(struct pci_dev *, unsigned long, size_t); -extern dma_addr_t pcibr_dma_map_consistent(struct pci_dev *, unsigned long, size_t); +extern dma_addr_t pcibr_dma_map(struct pci_dev *, unsigned long, size_t, int type); +extern dma_addr_t pcibr_dma_map_consistent(struct pci_dev *, unsigned long, size_t, int type); extern void pcibr_dma_unmap(struct pci_dev *, dma_addr_t, int); /* Index: linux-2.6.14/include/asm-ia64/sn/pcibus_provider_defs.h =================================================================== --- linux-2.6.14.orig/include/asm-ia64/sn/pcibus_provider_defs.h 2005-12-21 22:35:23.446284291 -0600 +++ linux-2.6.14/include/asm-ia64/sn/pcibus_provider_defs.h 2005-12-21 22:38:24.095684706 -0600 @@ -3,7 +3,7 @@ * License. See the file "COPYING" in the main directory of this archive * for more details. * - * Copyright (C) 1992 - 1997, 2000-2004 Silicon Graphics, Inc. All rights reserved. + * Copyright (C) 1992 - 1997, 2000-2005 Silicon Graphics, Inc. All rights reserved. */ #ifndef _ASM_IA64_SN_PCI_PCIBUS_PROVIDER_H #define _ASM_IA64_SN_PCI_PCIBUS_PROVIDER_H @@ -45,13 +45,24 @@ */ struct sn_pcibus_provider { - dma_addr_t (*dma_map)(struct pci_dev *, unsigned long, size_t); - dma_addr_t (*dma_map_consistent)(struct pci_dev *, unsigned long, size_t); + dma_addr_t (*dma_map)(struct pci_dev *, unsigned long, size_t, int flags); + dma_addr_t (*dma_map_consistent)(struct pci_dev *, unsigned long, size_t, int flags); void (*dma_unmap)(struct pci_dev *, dma_addr_t, int); void * (*bus_fixup)(struct pcibus_bussoft *, struct pci_controller *); void (*force_interrupt)(struct sn_irq_info *); void (*target_interrupt)(struct sn_irq_info *); }; +/* + * Flags used by the map interfaces + * bits 3:0 specifies format of passed in address + * bit 4 specifies that address is to be used for MSI + */ + +#define SN_DMA_ADDRTYPE(x) ((x) & 0xf) +#define SN_DMA_ADDR_PHYS 1 /* address is an xio address. */ +#define SN_DMA_ADDR_XIO 2 /* address is phys memory */ +#define SN_DMA_MSI 0x10 /* Bus address is to be used for MSI */ + extern struct sn_pcibus_provider *sn_pci_provider[]; #endif /* _ASM_IA64_SN_PCI_PCIBUS_PROVIDER_H */ Index: linux-2.6.14/include/asm-ia64/sn/tiocp.h =================================================================== --- linux-2.6.14.orig/include/asm-ia64/sn/tiocp.h 2005-12-21 22:35:23.446284291 -0600 +++ linux-2.6.14/include/asm-ia64/sn/tiocp.h 2005-12-21 22:38:24.095684706 -0600 @@ -3,13 +3,14 @@ * License. See the file "COPYING" in the main directory of this archive * for more details. * - * Copyright (C) 2003-2004 Silicon Graphics, Inc. All rights reserved. + * Copyright (C) 2003-2005 Silicon Graphics, Inc. All rights reserved. */ #ifndef _ASM_IA64_SN_PCI_TIOCP_H #define _ASM_IA64_SN_PCI_TIOCP_H #define TIOCP_HOST_INTR_ADDR 0x003FFFFFFFFFFFFFUL #define TIOCP_PCI64_CMDTYPE_MEM (0x1ull << 60) +#define TIOCP_PCI64_CMDTYPE_MSI (0x3ull << 60) /***************************************************************************** From maule at sgi.com Thu Jan 12 02:52:56 2006 From: maule at sgi.com (Mark Maule) Date: Wed, 11 Jan 2006 09:52:56 -0600 (CST) Subject: [PATCH 1/3] msi vector targeting abstractions In-Reply-To: <20060111155251.12460.71269.12163@attica.americas.sgi.com> References: <20060111155251.12460.71269.12163@attica.americas.sgi.com> Message-ID: <20060111155256.12460.26048.32596@attica.americas.sgi.com> Abstract portions of the MSI core for platforms that do not use standard APIC interrupt controllers. This is implemented through a new arch-specific msi setup routine, and a set of msi ops which can be set on a per platform basis. Signed-off-by: Mark Maule Index: linux-maule/drivers/pci/msi.c =================================================================== --- linux-maule.orig/drivers/pci/msi.c 2006-01-10 11:48:01.000000000 -0800 +++ linux-maule/drivers/pci/msi.c 2006-01-10 13:40:45.000000000 -0800 @@ -23,8 +23,6 @@ #include "pci.h" #include "msi.h" -#define MSI_TARGET_CPU first_cpu(cpu_online_map) - static DEFINE_SPINLOCK(msi_lock); static struct msi_desc* msi_desc[NR_IRQS] = { [0 ... NR_IRQS-1] = NULL }; static kmem_cache_t* msi_cachep; @@ -40,6 +38,15 @@ u8 irq_vector[NR_IRQ_VECTORS] = { FIRST_DEVICE_VECTOR , 0 }; #endif +static struct msi_ops *msi_ops; + +int +msi_register(struct msi_ops *ops) +{ + msi_ops = ops; + return 0; +} + static void msi_cache_ctor(void *p, kmem_cache_t *cache, unsigned long flags) { memset(p, 0, NR_IRQS * sizeof(struct msi_desc)); @@ -92,7 +99,7 @@ static void set_msi_affinity(unsigned int vector, cpumask_t cpu_mask) { struct msi_desc *entry; - struct msg_address address; + u32 address_hi, address_lo; unsigned int irq = vector; unsigned int dest_cpu = first_cpu(cpu_mask); @@ -108,28 +115,36 @@ if (!(pos = pci_find_capability(entry->dev, PCI_CAP_ID_MSI))) return; + pci_read_config_dword(entry->dev, msi_upper_address_reg(pos), + &address_hi); pci_read_config_dword(entry->dev, msi_lower_address_reg(pos), - &address.lo_address.value); - address.lo_address.value &= MSI_ADDRESS_DEST_ID_MASK; - address.lo_address.value |= (cpu_physical_id(dest_cpu) << - MSI_TARGET_CPU_SHIFT); - entry->msi_attrib.current_cpu = cpu_physical_id(dest_cpu); + &address_lo); + + msi_ops->target(vector, dest_cpu, &address_hi, &address_lo); + + pci_write_config_dword(entry->dev, msi_upper_address_reg(pos), + address_hi); pci_write_config_dword(entry->dev, msi_lower_address_reg(pos), - address.lo_address.value); + address_lo); set_native_irq_info(irq, cpu_mask); break; } case PCI_CAP_ID_MSIX: { - int offset = entry->msi_attrib.entry_nr * PCI_MSIX_ENTRY_SIZE + - PCI_MSIX_ENTRY_LOWER_ADDR_OFFSET; + int offset_hi = + entry->msi_attrib.entry_nr * PCI_MSIX_ENTRY_SIZE + + PCI_MSIX_ENTRY_UPPER_ADDR_OFFSET; + int offset_lo = + entry->msi_attrib.entry_nr * PCI_MSIX_ENTRY_SIZE + + PCI_MSIX_ENTRY_LOWER_ADDR_OFFSET; + + address_hi = readl(entry->mask_base + offset_hi); + address_lo = readl(entry->mask_base + offset_lo); - address.lo_address.value = readl(entry->mask_base + offset); - address.lo_address.value &= MSI_ADDRESS_DEST_ID_MASK; - address.lo_address.value |= (cpu_physical_id(dest_cpu) << - MSI_TARGET_CPU_SHIFT); - entry->msi_attrib.current_cpu = cpu_physical_id(dest_cpu); - writel(address.lo_address.value, entry->mask_base + offset); + msi_ops->target(vector, dest_cpu, &address_hi, &address_lo); + + writel(address_hi, entry->mask_base + offset_hi); + writel(address_lo, entry->mask_base + offset_lo); set_native_irq_info(irq, cpu_mask); break; } @@ -249,30 +264,6 @@ .set_affinity = set_msi_irq_affinity }; -static void msi_data_init(struct msg_data *msi_data, - unsigned int vector) -{ - memset(msi_data, 0, sizeof(struct msg_data)); - msi_data->vector = (u8)vector; - msi_data->delivery_mode = MSI_DELIVERY_MODE; - msi_data->level = MSI_LEVEL_MODE; - msi_data->trigger = MSI_TRIGGER_MODE; -} - -static void msi_address_init(struct msg_address *msi_address) -{ - unsigned int dest_id; - unsigned long dest_phys_id = cpu_physical_id(MSI_TARGET_CPU); - - memset(msi_address, 0, sizeof(struct msg_address)); - msi_address->hi_address = (u32)0; - dest_id = (MSI_ADDRESS_HEADER << MSI_ADDRESS_HEADER_SHIFT); - msi_address->lo_address.u.dest_mode = MSI_PHYSICAL_MODE; - msi_address->lo_address.u.redirection_hint = MSI_REDIRECTION_HINT_MODE; - msi_address->lo_address.u.dest_id = dest_id; - msi_address->lo_address.value |= (dest_phys_id << MSI_TARGET_CPU_SHIFT); -} - static int msi_free_vector(struct pci_dev* dev, int vector, int reassign); static int assign_msi_vector(void) { @@ -367,6 +358,20 @@ return status; } + if ((status = msi_arch_init()) < 0) { + pci_msi_enable = 0; + printk(KERN_WARNING + "PCI: MSI arch init failed. MSI disabled.\n"); + return status; + } + + if (! msi_ops) { + printk(KERN_WARNING + "PCI: MSI ops not registered. MSI disabled.\n"); + status = -EINVAL; + return status; + } + if ((status = msi_cache_init()) < 0) { pci_msi_enable = 0; printk(KERN_WARNING "PCI: MSI cache init failed\n"); @@ -510,9 +515,11 @@ **/ static int msi_capability_init(struct pci_dev *dev) { + int status; struct msi_desc *entry; - struct msg_address address; - struct msg_data data; + u32 address_lo; + u32 address_hi; + u32 data; int pos, vector; u16 control; @@ -539,23 +546,26 @@ entry->mask_base = (void __iomem *)(long)msi_mask_bits_reg(pos, is_64bit_address(control)); } + /* Configure MSI capability structure */ + status = msi_ops->setup(dev, vector, + &address_hi, + &address_lo, + &data); + if (status < 0) { + kmem_cache_free(msi_cachep, entry); + return status; + } /* Replace with MSI handler */ irq_handler_init(PCI_CAP_ID_MSI, vector, entry->msi_attrib.maskbit); - /* Configure MSI capability structure */ - msi_address_init(&address); - msi_data_init(&data, vector); - entry->msi_attrib.current_cpu = ((address.lo_address.u.dest_id >> - MSI_TARGET_CPU_SHIFT) & MSI_TARGET_CPU_MASK); - pci_write_config_dword(dev, msi_lower_address_reg(pos), - address.lo_address.value); + + pci_write_config_dword(dev, msi_lower_address_reg(pos), address_lo); if (is_64bit_address(control)) { pci_write_config_dword(dev, - msi_upper_address_reg(pos), address.hi_address); - pci_write_config_word(dev, - msi_data_reg(pos, 1), *((u32*)&data)); + msi_upper_address_reg(pos), address_hi); + pci_write_config_word(dev, msi_data_reg(pos, 1), data); } else - pci_write_config_word(dev, - msi_data_reg(pos, 0), *((u32*)&data)); + pci_write_config_word(dev, msi_data_reg(pos, 0), data); + if (entry->msi_attrib.maskbit) { unsigned int maskbits, temp; /* All MSIs are unmasked by default, Mask them all */ @@ -590,13 +600,15 @@ struct msix_entry *entries, int nvec) { struct msi_desc *head = NULL, *tail = NULL, *entry = NULL; - struct msg_address address; - struct msg_data data; + u32 address_hi; + u32 address_lo; + u32 data; int vector, pos, i, j, nr_entries, temp = 0; u32 phys_addr, table_offset; u16 control; u8 bir; void __iomem *base; + int status; pos = pci_find_capability(dev, PCI_CAP_ID_MSIX); /* Request & Map MSI-X table region */ @@ -643,18 +655,20 @@ /* Replace with MSI-X handler */ irq_handler_init(PCI_CAP_ID_MSIX, vector, 1); /* Configure MSI-X capability structure */ - msi_address_init(&address); - msi_data_init(&data, vector); - entry->msi_attrib.current_cpu = - ((address.lo_address.u.dest_id >> - MSI_TARGET_CPU_SHIFT) & MSI_TARGET_CPU_MASK); - writel(address.lo_address.value, + status = msi_ops->setup(dev, vector, + &address_hi, + &address_lo, + &data); + if (status < 0) + break; + + writel(address_lo, base + j * PCI_MSIX_ENTRY_SIZE + PCI_MSIX_ENTRY_LOWER_ADDR_OFFSET); - writel(address.hi_address, + writel(address_hi, base + j * PCI_MSIX_ENTRY_SIZE + PCI_MSIX_ENTRY_UPPER_ADDR_OFFSET); - writel(*(u32*)&data, + writel(data, base + j * PCI_MSIX_ENTRY_SIZE + PCI_MSIX_ENTRY_DATA_OFFSET); attach_msi_entry(entry, vector); @@ -789,6 +803,8 @@ void __iomem *base; unsigned long flags; + msi_ops->teardown(vector); + spin_lock_irqsave(&msi_lock, flags); entry = msi_desc[vector]; if (!entry || entry->dev != dev) { Index: linux-maule/include/asm-i386/msi.h =================================================================== --- linux-maule.orig/include/asm-i386/msi.h 2006-01-10 11:47:42.000000000 -0800 +++ linux-maule/include/asm-i386/msi.h 2006-01-10 11:58:55.000000000 -0800 @@ -12,4 +12,11 @@ #define LAST_DEVICE_VECTOR 232 #define MSI_TARGET_CPU_SHIFT 12 +static inline int msi_arch_init(void) +{ + extern struct msi_ops msi_apic_ops; + msi_register(&msi_apic_ops); + return 0; +} + #endif /* ASM_MSI_H */ Index: linux-maule/include/asm-x86_64/msi.h =================================================================== --- linux-maule.orig/include/asm-x86_64/msi.h 2006-01-10 11:47:43.000000000 -0800 +++ linux-maule/include/asm-x86_64/msi.h 2006-01-10 11:58:55.000000000 -0800 @@ -13,4 +13,11 @@ #define LAST_DEVICE_VECTOR 232 #define MSI_TARGET_CPU_SHIFT 12 +static inline int msi_arch_init(void) +{ + extern struct msi_ops msi_apic_ops; + msi_register_apic(&msi_apic_ops); + return 0; +} + #endif /* ASM_MSI_H */ Index: linux-maule/include/asm-ia64/machvec.h =================================================================== --- linux-maule.orig/include/asm-ia64/machvec.h 2006-01-10 11:47:42.000000000 -0800 +++ linux-maule/include/asm-ia64/machvec.h 2006-01-10 12:59:09.000000000 -0800 @@ -74,6 +74,7 @@ typedef unsigned short ia64_mv_readw_relaxed_t (const volatile void __iomem *); typedef unsigned int ia64_mv_readl_relaxed_t (const volatile void __iomem *); typedef unsigned long ia64_mv_readq_relaxed_t (const volatile void __iomem *); +typedef int ia64_mv_msi_init_t (void); static inline void machvec_noop (void) @@ -146,6 +147,7 @@ # define platform_readw_relaxed ia64_mv.readw_relaxed # define platform_readl_relaxed ia64_mv.readl_relaxed # define platform_readq_relaxed ia64_mv.readq_relaxed +# define platform_msi_init ia64_mv.msi_init # endif /* __attribute__((__aligned__(16))) is required to make size of the @@ -194,6 +196,7 @@ ia64_mv_readw_relaxed_t *readw_relaxed; ia64_mv_readl_relaxed_t *readl_relaxed; ia64_mv_readq_relaxed_t *readq_relaxed; + ia64_mv_msi_init_t *msi_init; } __attribute__((__aligned__(16))); /* align attrib? see above comment */ #define MACHVEC_INIT(name) \ @@ -238,6 +241,7 @@ platform_readw_relaxed, \ platform_readl_relaxed, \ platform_readq_relaxed, \ + platform_msi_init, \ } extern struct ia64_machine_vector ia64_mv; @@ -386,5 +390,8 @@ #ifndef platform_readq_relaxed # define platform_readq_relaxed __ia64_readq_relaxed #endif +#ifndef platform_msi_init +# define platform_msi_init ia64_msi_init +#endif #endif /* _ASM_IA64_MACHVEC_H */ Index: linux-maule/include/asm-ia64/machvec_sn2.h =================================================================== --- linux-maule.orig/include/asm-ia64/machvec_sn2.h 2006-01-10 11:47:42.000000000 -0800 +++ linux-maule/include/asm-ia64/machvec_sn2.h 2006-01-10 11:58:56.000000000 -0800 @@ -71,6 +71,7 @@ extern ia64_mv_dma_sync_sg_for_device sn_dma_sync_sg_for_device; extern ia64_mv_dma_mapping_error sn_dma_mapping_error; extern ia64_mv_dma_supported sn_dma_supported; +extern ia64_mv_msi_init_t sn_msi_init; /* * This stuff has dual use! @@ -120,6 +121,7 @@ #define platform_dma_sync_sg_for_device sn_dma_sync_sg_for_device #define platform_dma_mapping_error sn_dma_mapping_error #define platform_dma_supported sn_dma_supported +#define platform_msi_init sn_msi_init #include Index: linux-maule/include/asm-ia64/msi.h =================================================================== --- linux-maule.orig/include/asm-ia64/msi.h 2006-01-10 11:47:42.000000000 -0800 +++ linux-maule/include/asm-ia64/msi.h 2006-01-10 13:02:00.000000000 -0800 @@ -14,4 +14,14 @@ #define ack_APIC_irq ia64_eoi #define MSI_TARGET_CPU_SHIFT 4 +/* default ia64 msi init routine */ +static inline int ia64_msi_init(void) +{ + extern struct msi_ops msi_apic_ops; + msi_register(&msi_apic_ops); + return 0; +} + +#define msi_arch_init platform_msi_init + #endif /* ASM_MSI_H */ Index: linux-maule/arch/ia64/sn/pci/Makefile =================================================================== --- linux-maule.orig/arch/ia64/sn/pci/Makefile 2006-01-10 11:47:31.000000000 -0800 +++ linux-maule/arch/ia64/sn/pci/Makefile 2006-01-10 11:58:56.000000000 -0800 @@ -3,8 +3,9 @@ # License. See the file "COPYING" in the main directory of this archive # for more details. # -# Copyright (C) 2000-2004 Silicon Graphics, Inc. All Rights Reserved. +# Copyright (C) 2000-2005 Silicon Graphics, Inc. All Rights Reserved. # # Makefile for the sn pci general routines. obj-y := pci_dma.o tioca_provider.o tioce_provider.o pcibr/ +obj-$(CONFIG_PCI_MSI) += msi.o Index: linux-maule/arch/ia64/sn/pci/msi.c =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 +++ linux-maule/arch/ia64/sn/pci/msi.c 2006-01-10 13:40:40.000000000 -0800 @@ -0,0 +1,18 @@ +/* + * This file is subject to the terms and conditions of the GNU General Public + * License. See the file "COPYING" in the main directory of this archive + * for more details. + * + * Copyright (C) 2005 Silicon Graphics, Inc. All Rights Reserved. + */ + +#include + +int +sn_msi_init(void) +{ + /* + * return error until MSI is supported on altix platforms + */ + return -EINVAL; +} Index: linux-maule/drivers/pci/Makefile =================================================================== --- linux-maule.orig/drivers/pci/Makefile 2006-01-10 11:48:01.000000000 -0800 +++ linux-maule/drivers/pci/Makefile 2006-01-10 11:58:56.000000000 -0800 @@ -26,7 +26,7 @@ obj-$(CONFIG_PPC64) += setup-bus.o obj-$(CONFIG_MIPS) += setup-bus.o setup-irq.o obj-$(CONFIG_X86_VISWS) += setup-irq.o -obj-$(CONFIG_PCI_MSI) += msi.o +obj-$(CONFIG_PCI_MSI) += msi.o msi-apic.o # # ACPI Related PCI FW Functions Index: linux-maule/drivers/pci/msi-apic.c =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 +++ linux-maule/drivers/pci/msi-apic.c 2006-01-10 11:58:56.000000000 -0800 @@ -0,0 +1,102 @@ +/* + * MSI hooks for standard x86 apic + */ + +#include + +#include "msi.h" + +/* + * Shifts for APIC-based data + */ + +#define MSI_DATA_VECTOR_SHIFT 0 +#define MSI_DATA_VECTOR(v) (((u8)v) << MSI_DATA_VECTOR_SHIFT) + +#define MSI_DATA_DELIVERY_SHIFT 8 +#define MSI_DATA_DELIVERY_FIXED (0 << MSI_DATA_DELIVERY_SHIFT) +#define MSI_DATA_DELIVERY_LOWPRI (1 << MSI_DATA_DELIVERY_SHIFT) + +#define MSI_DATA_LEVEL_SHIFT 14 +#define MSI_DATA_LEVEL_DEASSERT (0 << MSI_DATA_LEVEL_SHIFT) +#define MSI_DATA_LEVEL_ASSERT (1 << MSI_DATA_LEVEL_SHIFT) + +#define MSI_DATA_TRIGGER_SHIFT 15 +#define MSI_DATA_TRIGGER_EDGE (0 << MSI_DATA_TRIGGER_SHIFT) +#define MSI_DATA_TRIGGER_LEVEL (1 << MSI_DATA_TRIGGER_SHIFT) + +/* + * Shift/mask fields for APIC-based bus address + */ + +#define MSI_ADDR_HEADER 0xfee00000 + +#define MSI_ADDR_DESTID_MASK 0xfff0000f +#define MSI_ADDR_DESTID_CPU(cpu) ((cpu) << MSI_TARGET_CPU_SHIFT) + +#define MSI_ADDR_DESTMODE_SHIFT 2 +#define MSI_ADDR_DESTMODE_PHYS (0 << MSI_ADDR_DESTMODE_SHIFT) +#define MSI_ADDR_DESTMODE_LOGIC (1 << MSI_ADDR_DESTMODE_SHIFT) + +#define MSI_ADDR_REDIRECTION_SHIFT 3 +#define MSI_ADDR_REDIRECTION_CPU (0 << MSI_ADDR_REDIRECTION_SHIFT) +#define MSI_ADDR_REDIRECTION_LOWPRI (1 << MSI_ADDR_REDIRECTION_SHIFT) + + +static void +msi_target_apic(unsigned int vector, + unsigned int dest_cpu, + u32 *address_hi, /* in/out */ + u32 *address_lo) /* in/out */ +{ + u32 addr = *address_lo; + + addr &= MSI_ADDR_DESTID_MASK; + addr |= MSI_ADDR_DESTID_CPU(cpu_physical_id(dest_cpu)); + + *address_lo = addr; +} + +static int +msi_setup_apic(struct pci_dev *pdev, /* unused in generic */ + unsigned int vector, + u32 *address_hi, + u32 *address_lo, + u32 *data) +{ + unsigned long dest_phys_id; + + dest_phys_id = cpu_physical_id(first_cpu(cpu_online_map)); + + *address_hi = 0; + *address_lo = MSI_ADDR_HEADER | + MSI_ADDR_DESTMODE_PHYS | + MSI_ADDR_REDIRECTION_CPU | + MSI_ADDR_DESTID_CPU(dest_phys_id); + + *data = MSI_DATA_TRIGGER_EDGE | + MSI_DATA_LEVEL_ASSERT | + MSI_DATA_DELIVERY_FIXED | + MSI_DATA_VECTOR(vector); + + return 0; +} + +static void +msi_teardown_apic(unsigned int vector) +{ + return; /* no-op */ +} + +/* + * Generic callouts used on most archs/platforms. Override with + * msi_register_callouts() + */ + +struct msi_ops msi_apic_ops = { + .setup = msi_setup_apic, + .teardown = msi_teardown_apic, +#ifdef CONFIG_SMP + .target = msi_target_apic, +#endif +}; Index: linux-maule/drivers/pci/msi.h =================================================================== --- linux-maule.orig/drivers/pci/msi.h 2006-01-10 11:48:01.000000000 -0800 +++ linux-maule/drivers/pci/msi.h 2006-01-10 11:58:56.000000000 -0800 @@ -69,67 +69,6 @@ #define msix_mask(address) (address | PCI_MSIX_FLAGS_BITMASK) #define msix_is_pending(address) (address & PCI_MSIX_FLAGS_PENDMASK) -/* - * MSI Defined Data Structures - */ -#define MSI_ADDRESS_HEADER 0xfee -#define MSI_ADDRESS_HEADER_SHIFT 12 -#define MSI_ADDRESS_HEADER_MASK 0xfff000 -#define MSI_ADDRESS_DEST_ID_MASK 0xfff0000f -#define MSI_TARGET_CPU_MASK 0xff -#define MSI_DELIVERY_MODE 0 -#define MSI_LEVEL_MODE 1 /* Edge always assert */ -#define MSI_TRIGGER_MODE 0 /* MSI is edge sensitive */ -#define MSI_PHYSICAL_MODE 0 -#define MSI_LOGICAL_MODE 1 -#define MSI_REDIRECTION_HINT_MODE 0 - -struct msg_data { -#if defined(__LITTLE_ENDIAN_BITFIELD) - __u32 vector : 8; - __u32 delivery_mode : 3; /* 000b: FIXED | 001b: lowest prior */ - __u32 reserved_1 : 3; - __u32 level : 1; /* 0: deassert | 1: assert */ - __u32 trigger : 1; /* 0: edge | 1: level */ - __u32 reserved_2 : 16; -#elif defined(__BIG_ENDIAN_BITFIELD) - __u32 reserved_2 : 16; - __u32 trigger : 1; /* 0: edge | 1: level */ - __u32 level : 1; /* 0: deassert | 1: assert */ - __u32 reserved_1 : 3; - __u32 delivery_mode : 3; /* 000b: FIXED | 001b: lowest prior */ - __u32 vector : 8; -#else -#error "Bitfield endianness not defined! Check your byteorder.h" -#endif -} __attribute__ ((packed)); - -struct msg_address { - union { - struct { -#if defined(__LITTLE_ENDIAN_BITFIELD) - __u32 reserved_1 : 2; - __u32 dest_mode : 1; /*0:physic | 1:logic */ - __u32 redirection_hint: 1; /*0: dedicated CPU - 1: lowest priority */ - __u32 reserved_2 : 4; - __u32 dest_id : 24; /* Destination ID */ -#elif defined(__BIG_ENDIAN_BITFIELD) - __u32 dest_id : 24; /* Destination ID */ - __u32 reserved_2 : 4; - __u32 redirection_hint: 1; /*0: dedicated CPU - 1: lowest priority */ - __u32 dest_mode : 1; /*0:physic | 1:logic */ - __u32 reserved_1 : 2; -#else -#error "Bitfield endianness not defined! Check your byteorder.h" -#endif - }u; - __u32 value; - }lo_address; - __u32 hi_address; -} __attribute__ ((packed)); - struct msi_desc { struct { __u8 type : 5; /* {0: unused, 5h:MSI, 11h:MSI-X} */ @@ -138,7 +77,7 @@ __u8 reserved: 1; /* reserved */ __u8 entry_nr; /* specific enabled entry */ __u8 default_vector; /* default pre-assigned vector */ - __u8 current_cpu; /* current destination cpu */ + __u8 unused; /* formerly unused destination cpu*/ }msi_attrib; struct { Index: linux-maule/include/linux/pci.h =================================================================== --- linux-maule.orig/include/linux/pci.h 2006-01-10 11:47:46.000000000 -0800 +++ linux-maule/include/linux/pci.h 2006-01-10 11:58:56.000000000 -0800 @@ -478,6 +478,16 @@ u16 entry; /* driver uses to specify entry, OS writes */ }; +struct msi_ops { + int (*setup) (struct pci_dev *pdev, unsigned int vector, + u32 *addr_hi, u32 *addr_lo, u32 *data); + void (*teardown) (unsigned int vector); +#ifdef CONFIG_SMP + void (*target) (unsigned int vector, unsigned int cpu, + u32 *addr_hi, u32 *addr_lo); +#endif +}; + #ifndef CONFIG_PCI_MSI static inline void pci_scan_msi_device(struct pci_dev *dev) {} static inline int pci_enable_msi(struct pci_dev *dev) {return -1;} @@ -486,6 +496,7 @@ struct msix_entry *entries, int nvec) {return -1;} static inline void pci_disable_msix(struct pci_dev *dev) {} static inline void msi_remove_pci_irq_vectors(struct pci_dev *dev) {} +static inline int msi_register(struct msi_ops *ops) {return -1;} #else extern void pci_scan_msi_device(struct pci_dev *dev); extern int pci_enable_msi(struct pci_dev *dev); @@ -494,6 +505,7 @@ struct msix_entry *entries, int nvec); extern void pci_disable_msix(struct pci_dev *dev); extern void msi_remove_pci_irq_vectors(struct pci_dev *dev); +extern int msi_register(struct msi_ops *ops); #endif extern void pci_block_user_cfg_access(struct pci_dev *dev); From maule at sgi.com Thu Jan 12 02:53:01 2006 From: maule at sgi.com (Mark Maule) Date: Wed, 11 Jan 2006 09:53:01 -0600 (CST) Subject: [PATCH 2/3] per-platform IA64_{FIRST, LAST}_DEVICE_VECTOR definitions In-Reply-To: <20060111155251.12460.71269.12163@attica.americas.sgi.com> References: <20060111155251.12460.71269.12163@attica.americas.sgi.com> Message-ID: <20060111155301.12460.7283.98468@attica.americas.sgi.com> Abstract IA64_FIRST_DEVICE_VECTOR/IA64_LAST_DEVICE_VECTOR since SN platforms use a subset of the IA64 range. Implement this by making the above macros global variables which the platform can override in it setup code. Also add a reserve_irq_vector() routine used by SN to mark a vector's as in-use when that weren't allocated through assign_irq_vector(). Signed-off-by: Mark Maule Index: msi/arch/ia64/kernel/irq_ia64.c =================================================================== --- msi.orig/arch/ia64/kernel/irq_ia64.c 2005-12-21 22:59:09.000000000 -0600 +++ msi/arch/ia64/kernel/irq_ia64.c 2005-12-22 14:10:01.000000000 -0600 @@ -46,6 +46,10 @@ #define IRQ_DEBUG 0 +/* These can be overridden in platform_irq_init */ +int ia64_first_device_vector = IA64_DEF_FIRST_DEVICE_VECTOR; +int ia64_last_device_vector = IA64_DEF_LAST_DEVICE_VECTOR; + /* default base addr of IPI table */ void __iomem *ipi_base_addr = ((void __iomem *) (__IA64_UNCACHED_OFFSET | IA64_IPI_DEFAULT_BASE_ADDR)); @@ -60,7 +64,7 @@ }; EXPORT_SYMBOL(isa_irq_to_vector_map); -static unsigned long ia64_vector_mask[BITS_TO_LONGS(IA64_NUM_DEVICE_VECTORS)]; +static unsigned long ia64_vector_mask[BITS_TO_LONGS(IA64_MAX_DEVICE_VECTORS)]; int assign_irq_vector (int irq) @@ -89,6 +93,17 @@ printk(KERN_WARNING "%s: double free!\n", __FUNCTION__); } +int +reserve_irq_vector (int vector) +{ + if (vector < IA64_FIRST_DEVICE_VECTOR || + vector > IA64_LAST_DEVICE_VECTOR) + return -EINVAL; + + return test_and_set_bit(IA64_FIRST_DEVICE_VECTOR + vector, + ia64_vector_mask); +} + #ifdef CONFIG_SMP # define IS_RESCHEDULE(vec) (vec == IA64_IPI_RESCHEDULE) #else Index: msi/arch/ia64/sn/kernel/irq.c =================================================================== --- msi.orig/arch/ia64/sn/kernel/irq.c 2005-12-21 22:59:09.000000000 -0600 +++ msi/arch/ia64/sn/kernel/irq.c 2005-12-22 14:10:01.000000000 -0600 @@ -203,6 +203,9 @@ int i; irq_desc_t *base_desc = irq_desc; + ia64_first_device_vector = IA64_SN2_FIRST_DEVICE_VECTOR; + ia64_last_device_vector = IA64_SN2_LAST_DEVICE_VECTOR; + for (i = 0; i < NR_IRQS; i++) { if (base_desc[i].handler == &no_irq_type) { base_desc[i].handler = &irq_type_sn; @@ -287,6 +290,7 @@ /* link it into the sn_irq[irq] list */ spin_lock(&sn_irq_info_lock); list_add_rcu(&sn_irq_info->list, sn_irq_lh[sn_irq_info->irq_irq]); + reserve_irq_vector(sn_irq_info->irq_irq); spin_unlock(&sn_irq_info_lock); (void)register_intr_pda(sn_irq_info); @@ -310,8 +314,11 @@ spin_lock(&sn_irq_info_lock); list_del_rcu(&sn_irq_info->list); spin_unlock(&sn_irq_info_lock); + if (list_empty(sn_irq_lh[sn_irq_info->irq_irq])) + free_irq_vector(sn_irq_info->irq_irq); call_rcu(&sn_irq_info->rcu, sn_irq_info_free); pci_dev_put(pci_dev); + } static inline void Index: msi/include/asm-ia64/hw_irq.h =================================================================== --- msi.orig/include/asm-ia64/hw_irq.h 2005-12-21 22:59:09.000000000 -0600 +++ msi/include/asm-ia64/hw_irq.h 2005-12-22 14:10:01.000000000 -0600 @@ -47,9 +47,19 @@ #define IA64_CMC_VECTOR 0x1f /* corrected machine-check interrupt vector */ /* * Vectors 0x20-0x2f are reserved for legacy ISA IRQs. + * Use vectors 0x30-0xe7 as the default device vector range for ia64. + * Platforms may choose to reduce this range in platform_irq_setup, but the + * platform range must fall within + * [IA64_DEF_FIRST_DEVICE_VECTOR..IA64_DEF_LAST_DEVICE_VECTOR] */ -#define IA64_FIRST_DEVICE_VECTOR 0x30 -#define IA64_LAST_DEVICE_VECTOR 0xe7 +extern int ia64_first_device_vector; +extern int ia64_last_device_vector; + +#define IA64_DEF_FIRST_DEVICE_VECTOR 0x30 +#define IA64_DEF_LAST_DEVICE_VECTOR 0xe7 +#define IA64_FIRST_DEVICE_VECTOR ia64_first_device_vector +#define IA64_LAST_DEVICE_VECTOR ia64_last_device_vector +#define IA64_MAX_DEVICE_VECTORS (IA64_DEF_LAST_DEVICE_VECTOR - IA64_DEF_FIRST_DEVICE_VECTOR + 1) #define IA64_NUM_DEVICE_VECTORS (IA64_LAST_DEVICE_VECTOR - IA64_FIRST_DEVICE_VECTOR + 1) #define IA64_MCA_RENDEZ_VECTOR 0xe8 /* MCA rendez interrupt */ @@ -83,6 +93,7 @@ extern int assign_irq_vector (int irq); /* allocate a free vector */ extern void free_irq_vector (int vector); +extern int reserve_irq_vector (int vector); extern void ia64_send_ipi (int cpu, int vector, int delivery_mode, int redirect); extern void register_percpu_irq (ia64_vector vec, struct irqaction *action); Index: msi/drivers/pci/msi.c =================================================================== --- msi.orig/drivers/pci/msi.c 2005-12-21 22:59:09.000000000 -0600 +++ msi/drivers/pci/msi.c 2005-12-22 14:10:19.000000000 -0600 @@ -35,7 +35,7 @@ #ifndef CONFIG_X86_IO_APIC int vector_irq[NR_VECTORS] = { [0 ... NR_VECTORS - 1] = -1}; -u8 irq_vector[NR_IRQ_VECTORS] = { FIRST_DEVICE_VECTOR , 0 }; +u8 irq_vector[NR_IRQ_VECTORS]; #endif static struct msi_ops *msi_ops; @@ -377,6 +377,11 @@ printk(KERN_WARNING "PCI: MSI cache init failed\n"); return status; } + +#ifndef CONFIG_X86_IO_APIC + irq_vector[0] = FIRST_DEVICE_VECTOR; +#endif + last_alloc_vector = assign_irq_vector(AUTO_ASSIGN); if (last_alloc_vector < 0) { pci_msi_enable = 0; From torvalds at osdl.org Thu Jan 12 03:18:30 2006 From: torvalds at osdl.org (Linus Torvalds) Date: Wed, 11 Jan 2006 08:18:30 -0800 (PST) Subject: please pull powerpc-merge.git In-Reply-To: <17348.54232.914877.675904@cargo.ozlabs.ibm.com> References: <17348.54232.914877.675904@cargo.ozlabs.ibm.com> Message-ID: On Wed, 11 Jan 2006, Paul Mackerras wrote: > > When do you think you will close the merge window? The glibc guys > want us to set AT_PLATFORM to something useful on powerpc, so I'd like > to get that in. I have a patch to do that, but it will take a couple > of days to get consensus that we have the right set of strings > exported. My plan is around this Sunday. I can't leave it much later, simply because on Friday I'm flying off to NZ, and I want to leave the window open for an -rc2 if needed. That's also the two weeks after 2.6.15, so it's the right date. Linus From olof at lixom.net Thu Jan 12 03:32:32 2006 From: olof at lixom.net (Olof Johansson) Date: Wed, 11 Jan 2006 10:32:32 -0600 Subject: [PATCH] powerpc: add new hypervisor constants In-Reply-To: <20060111095418.GA30507@cs.umn.edu> References: <20060111095418.GA30507@cs.umn.edu> Message-ID: <20060111163231.GC2491@pb15.lixom.net> On Wed, Jan 11, 2006 at 03:54:18AM -0600, Dave C Boutcher wrote: > Adds a few more hypervisor call constants. Seems that you used spaces instead of tabs. Care to switch? Thanks. -Olof From olof at lixom.net Thu Jan 12 04:12:52 2006 From: olof at lixom.net (Olof Johansson) Date: Wed, 11 Jan 2006 11:12:52 -0600 Subject: [PATCH] powerpc: add ibm,suspend-me rtas interface In-Reply-To: <20060111095633.GB30507@cs.umn.edu> References: <20060111095633.GB30507@cs.umn.edu> Message-ID: <20060111171252.GD2491@pb15.lixom.net> On Wed, Jan 11, 2006 at 03:56:33AM -0600, Dave C Boutcher wrote: > Create a proc file that lets us call the ibm,suspend-me > RTAS call. This call has to be wrapped in some hypervisor > calls that synchronize all the CPUs, so it can't be done > from userland. In general, you seem to have some whitespace issues -- 4 spaces instead of tabs, 2 tabs instead of 1 in one place, and some trailing whitespace. I won't comment on the specific instances but please clean them up. If you use Vim, the following in your .vimrc will make some of them stand out easily: highlight RedundantWhitespace ctermbg=red guibg=red match RedundantWhitespace /\s\+$\| \+\ze\t/ syntax on (comes from Jeremy Kerr) However, a bigger question is: why are you defining your own interface for suspend? There's already at least one global interface for it (/sys/power/state), can't you hook in there instead? This means we'll have to carry another interface forever, since userspace tools will depend on it. > diff -uNr -X exclude-files linux-2.6.15/arch/powerpc/platforms/pseries/Makefile linux-2.6.15-vpm/arch/powerpc/platforms/pseries/Makefile > --- linux-2.6.15/arch/powerpc/platforms/pseries/Makefile 2006-01-02 21:21:10.000000000 -0600 > +++ linux-2.6.15-vpm/arch/powerpc/platforms/pseries/Makefile 2006-01-10 14:32:56.000000000 -0600 > @@ -1,5 +1,5 @@ > obj-y := pci.o lpar.o hvCall.o nvram.o reconfig.o \ > - setup.o iommu.o ras.o rtasd.o > + setup.o iommu.o ras.o rtasd.o sysstate.o > obj-$(CONFIG_SMP) += smp.o > obj-$(CONFIG_IBMVIO) += vio.o > obj-$(CONFIG_XICS) += xics.o > diff -uNr -X exclude-files linux-2.6.15/arch/powerpc/platforms/pseries/sysstate.c linux-2.6.15-vpm/arch/powerpc/platforms/pseries/sysstate.c > --- linux-2.6.15/arch/powerpc/platforms/pseries/sysstate.c 1969-12-31 18:00:00.000000000 -0600 > +++ linux-2.6.15-vpm/arch/powerpc/platforms/pseries/sysstate.c 2006-01-11 02:17:22.000000000 -0600 > @@ -0,0 +1,157 @@ > +/* > + * arch/ppc64/sys-state.c - Logical Partition State Huh? Filename is inconsistent. I'd say there's no need to keep it in the file at all, it seems to vary if it's there or not in other places of the kernel. > + * > + * Copyright (c) 2005 Dave Boutcher > + * > + * This program is free software; you can redistribute it and/or modify > + * it under the terms of the GNU General Public License as published by > + * the Free Software Foundation; either version 2 of the License, or > + * (at your option) any later version. > + * > + * This program is distributed in the hope that it will be useful, > + * but WITHOUT ANY WARRANTY; without even the implied warranty of > + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the > + * GNU General Public License for more details. > + * > + * You should have received a copy of the GNU General Public License > + * along with this program; if not, write to the Free Software > + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA > + * > + *************************************************************************** > + * This file handles the pSeries firmware supported "ibm,suspend-me" RTAS > + * call. It can't be done from userland, since all of the CPUs must be first > + * synchronized using the H_JOIN hypervisor call prior to making the > + * ibm,suspend-me RTAS call. > + *************************************************************************** > + */ > + Care to move that as a separate comment block below the GPL header? I missed it the first read-through since I usually don't read the big GPL block at the top anyway. :-) > +#include > +#include > +#include > +#include > +#include > +#include > +#include > + > +#include > + > +static int suspend_me_tok = -1; You init to -1 and check it against RTAS_UNKNOWN_SERVICE. Please use the symbolic name at init too. > + > +/* > + * We use "waiting" to indicate our state. As long > + * as it is >0, we are still trying to all join up. > + * If it goes to 0, we have successfully joined up and > + * one thread got H_Continue. If any error happens, > + * we set it to <0; > + */ Seems to me that this comment can go right before the loop in the function. > +static void cpu_suspend(void *info) > +{ > + long rc; > + long flags; > + long *waiting = (long *)info; > + int status; > + > + local_irq_save(flags); > + do { > + rc = plpar_hcall_norets(H_JOIN); > + mb(); > + } while ((rc == H_Success) && (*waiting > 0)); (((feels like) (reading) (lisp))) :-) Also, there should be no need for a full mb(), should there? The hvcall in itself should be syncronizing, but if it's not, then smp_rmb() should do just fine. > + if (rc == H_Success) > + goto out; > + > + if (rc == H_Continue) { > + *waiting = 0; > + if (suspend_me_tok != RTAS_UNKNOWN_SERVICE) { > + status = rtas_call(suspend_me_tok, 0, 1, NULL); > + if (status != 0) > + printk(KERN_ERR > + "RTAS ibm,suspend-me failed: %i\n", > + status); You go through all of this, just to check if the rtas token is set? Why don't you just abort in the beginning of the function if it's not set instead? > + } > + } else { > + *waiting = -EBUSY; > + printk(KERN_ERR "Error on H_Join hypervisor call\n"); > + } > + > + out: > + local_irq_restore(flags); > + return; > +} > + > +static int do_suspend(void) > +{ > + int i; > + long waiting = 1; > + > + smp_rmb(); Why?! > + > + /* Call function on all other CPUs */ > + if (on_each_cpu(cpu_suspend, > + &waiting, > + 1, 0)) { This can be done on line line, you've got 80 columns. > + printk(KERN_ERR "Error calling on_each_cpu!\n"); > + /* TODO: Prod everyone here */ Todo? Why not just do a return value variable and a goto out (that's right before the prod loop)? > + return -EINVAL; > + } > + > + if (waiting != 0) { > + printk(KERN_ERR "Error doing global join!\n"); > + } > + > + /* Prod each CPU. This won't hurt, and will wake > + * anyone we successfully put to sleep with H_Join > + */ > + for_each_cpu(i) > + plpar_hcall_norets(H_PROD,i); > + > + return 0; > +} > + > +static int read_proc(char *page, char **start, off_t off, > + int count, int *eof, void *data) > +{ > + int len; > + > + len = sprintf(page, "%d\n", > + 0); What's wrong with "sprintf(page, "0\n");" ? Also, no eof handling, no checking of count, etc. > + > + return len; > +} > + > +static int write_proc(struct file *file, const char __user *buffer, > + unsigned long count, void *data) > +{ > + char command[32]; > + > + if (count > sizeof(command)) > + count = sizeof(command); > + > + if (copy_from_user(command, buffer, count)) > + return -EFAULT; > + > + if (strncmp(command, "suspend", sizeof(command)) == 0) { > + do_suspend(); > + } What happens if someone echos suspend\n into the proc file? > + return count; > +} > + > +static int __init sys_state_init(void) > +{ > + struct proc_dir_entry *entry; > + suspend_me_tok = rtas_token("ibm,suspend-me"); > + if (suspend_me_tok == RTAS_UNKNOWN_SERVICE) > + return 0; > + > + entry = create_proc_entry("ppc64/rtas/platform_state", S_IWUSR, NULL); > + if (!entry) { > + printk(KERN_ERR "Failed to create platform_state proc entry\n"); > + return 0; > + } > + > + entry->read_proc = read_proc; > + entry->write_proc = write_proc; > + > + return 0; > +} > + > +arch_initcall(sys_state_init); > > -- > Dave Boutcher > _______________________________________________ > Linuxppc64-dev mailing list > Linuxppc64-dev at ozlabs.org > https://ozlabs.org/mailman/listinfo/linuxppc64-dev From sleddog at us.ibm.com Thu Jan 12 04:43:53 2006 From: sleddog at us.ibm.com (Dave C Boutcher) Date: Wed, 11 Jan 2006 11:43:53 -0600 Subject: [PATCH] powerpc: add ibm,suspend-me rtas interface In-Reply-To: <20060111171252.GD2491@pb15.lixom.net> References: <20060111095633.GB30507@cs.umn.edu> <20060111171252.GD2491@pb15.lixom.net> Message-ID: <20060111174353.GA1867@cs.umn.edu> On Wed, Jan 11, 2006 at 11:12:52AM -0600, Olof Johansson wrote: > On Wed, Jan 11, 2006 at 03:56:33AM -0600, Dave C Boutcher wrote: > In general, you seem to have some whitespace issues -- 4 spaces instead > of tabs, 2 tabs instead of 1 in one place, and some trailing whitespace. > I won't comment on the specific instances but please clean them up. Sigh...I'll fix and respin. > > If you use Vim, the following in your .vimrc will make some of them > stand out easily: VIM!!! you heretic. > However, a bigger question is: why are you defining your own interface > for suspend? There's already at least one global interface for it > (/sys/power/state), can't you hook in there instead? This means we'll > have to carry another interface forever, since userspace tools will > depend on it. This suspend is not (sigh) the same as linux suspend. I might have tried to rename it something different, but the RTAS call is "ibm,suspend-me". This is going to be driven by the HMC ultimately. This function doesn't preclude someone implementing one of the Linux swsusp versions on Power (and in fact Santi was working on that last year.) > > + *************************************************************************** > > + * This file handles the pSeries firmware supported "ibm,suspend-me" RTAS > > + * call. It can't be done from userland, since all of the CPUs must be first > > + * synchronized using the H_JOIN hypervisor call prior to making the > > + * ibm,suspend-me RTAS call. > > + *************************************************************************** > > + */ > > + > > Care to move that as a separate comment block below the GPL header? I > missed it the first read-through since I usually don't read the big GPL > block at the top anyway. :-) I assumed EVERYONE religiously reads the legal verbage at the top of the file. Thats what we tell the lawyers anyways. If deposed, I will mention your cavalier attitude towards legal text. > Also, there should be no need for a full mb(), should there? The hvcall > in itself should be syncronizing, but if it's not, then smp_rmb() should > do just fine. Hrm...ok. > Why?! Because I'm paranoid about everyone accessing that shared waiting flag. > What's wrong with "sprintf(page, "0\n");" ? Nothing, but there's another status function thats going to show up and return status here. I'll just simplify the call until I implement that. The rest of the comments are fair enough and I'll fix them up. Thanks for the review. -- Dave Boutcher From jschopp at austin.ibm.com Thu Jan 12 04:44:47 2006 From: jschopp at austin.ibm.com (Joel Schopp) Date: Wed, 11 Jan 2006 11:44:47 -0600 Subject: PowerPC fastpaths for mutex subsystem In-Reply-To: <20060110230917.GA25285@elte.hu> References: <20060104144151.GA27646@elte.hu> <43BC5E15.207@austin.ibm.com> <20060105143502.GA16816@elte.hu> <43BD4C66.60001@austin.ibm.com> <20060105222106.GA26474@elte.hu> <43BDA672.4090704@austin.ibm.com> <20060106002919.GA29190@pb15.lixom.net> <43BFFF1D.7030007@austin.ibm.com> <20060108094839.GA16887@elte.hu> <43C435B9.5080409@austin.ibm.com> <20060110230917.GA25285@elte.hu> Message-ID: <43C5440F.2060503@austin.ibm.com> > ok. I'll really need to look at "vmstat" output from these. We could > easily make the mutex slowpath behave like ppc64 semaphores, via the > attached (untested) patch, but i really think it's the wrong thing to > do, because it overloads the system with runnable tasks in an > essentially unlimited fashion [== overscheduling] - they'll all contend > for the same single mutex. > > in synthetic workloads on idle systems it such overscheduling can help, > because the 'luck factor' of the 'thundering herd' of tasks can generate > a higher total throughput - at the expense of system efficiency. At 8 > CPUs i already measured a net performance loss at 3 tasks! So i think > the current 'at most 2 tasks runnable' approach of mutexes is the right > one on a broad range of hardware. > > still, i'll try a different patch tomorrow, to keep the number of 'in > flight' tasks within a certain limit (say at 2) - i suspect that would > close the performance gap too, on this test. The fundamental problem is that there is a relatively major latency to wake somebody up, and for them to actually run so they can acquire a lock. In an ideal world there would always be a single waiter running trying to acquire the lock at the moment it was unlocked and not running until then. There are better solutions than just madly throwing more waiters in flight on an unlock. Here's three possibilities off the top of my head: 1) It is possible to have a hybrid lock that spins a single waiting thread and sleeps waiters 2..n, so there is always a waiter running trying to acquire the lock. It solves the latency problem if the lock is held a length of time at least as long as it takes to wake up the next waiter. But the spinning waiter burns some cpu to buy the decreased latency. 2) You could also do the classic spin for awhile and then sleep method. This essentially turns low latency locks into spinlocks but still sleeps locks which are held longer and/or are much more contested. 3) There is the option to look at cpu idleness of the current cpu and spin or sleep based on that. 4) Accept that we have a cpu efficient high latency lock and use it appropriately. I'm not saying any of these 4 is what we should do. I'm just trying to say there are options out there that don't involve thundering hurds and luck to address the problem. From olof at lixom.net Thu Jan 12 04:49:57 2006 From: olof at lixom.net (Olof Johansson) Date: Wed, 11 Jan 2006 11:49:57 -0600 Subject: [PATCH] powerpc: add ibm,suspend-me rtas interface In-Reply-To: <20060111174353.GA1867@cs.umn.edu> References: <20060111095633.GB30507@cs.umn.edu> <20060111171252.GD2491@pb15.lixom.net> <20060111174353.GA1867@cs.umn.edu> Message-ID: <20060111174957.GE2491@pb15.lixom.net> On Wed, Jan 11, 2006 at 11:43:53AM -0600, Dave C Boutcher wrote: > On Wed, Jan 11, 2006 at 11:12:52AM -0600, Olof Johansson wrote: > > On Wed, Jan 11, 2006 at 03:56:33AM -0600, Dave C Boutcher wrote: > > In general, you seem to have some whitespace issues -- 4 spaces instead > > of tabs, 2 tabs instead of 1 in one place, and some trailing whitespace. > > I won't comment on the specific instances but please clean them up. > > Sigh...I'll fix and respin. > > > > > If you use Vim, the following in your .vimrc will make some of them > > stand out easily: > > VIM!!! you heretic. Oh, I wasn't trying to push an editor on you, just give a useful tip in case you were using it. :) > > However, a bigger question is: why are you defining your own interface > > for suspend? There's already at least one global interface for it > > (/sys/power/state), can't you hook in there instead? This means we'll > > have to carry another interface forever, since userspace tools will > > depend on it. > > This suspend is not (sigh) the same as linux suspend. I might have > tried to rename it something different, but the RTAS call is > "ibm,suspend-me". This is going to be driven by the HMC ultimately. > > This function doesn't preclude someone implementing one of the Linux > swsusp versions on Power (and in fact Santi was working on that last > year.) Ok, good to know. I suggest a comment about it in the patch description to avoid repeated questions. > > Why?! > > Because I'm paranoid about everyone accessing that shared waiting flag. Ah, you probably want an smp_wmb() then instead. :-) > The rest of the comments are fair enough and I'll fix them up. Thanks > for the review. Thanks. -Olof From olof at lixom.net Thu Jan 12 07:02:58 2006 From: olof at lixom.net (Olof Johansson) Date: Wed, 11 Jan 2006 14:02:58 -0600 Subject: [PATCH] powerpc: remove eeh warning Message-ID: <20060111200258.GG2491@pb15.lixom.net> Hi, Paulus, please apply. ------ Remove warning in eeh code about mixed variables and code. Signed-off-by: Olof Johansson Index: 2.6/arch/powerpc/platforms/pseries/eeh.c =================================================================== --- 2.6.orig/arch/powerpc/platforms/pseries/eeh.c 2006-01-11 13:34:34.000000000 -0600 +++ 2.6/arch/powerpc/platforms/pseries/eeh.c 2006-01-11 13:57:10.000000000 -0600 @@ -208,10 +208,11 @@ static void __eeh_mark_slot (struct devi { while (dn) { if (PCI_DN(dn)) { - PCI_DN(dn)->eeh_mode |= mode_flag; - /* Mark the pci device driver too */ struct pci_dev *dev = PCI_DN(dn)->pcidev; + + PCI_DN(dn)->eeh_mode |= mode_flag; + if (dev && dev->driver) dev->error_state = pci_channel_io_frozen; From greg at kroah.com Thu Jan 12 07:21:23 2006 From: greg at kroah.com (Greg KH) Date: Wed, 11 Jan 2006 12:21:23 -0800 Subject: [PATCH 1/3] msi vector targeting abstractions In-Reply-To: <20060111155256.12460.26048.32596@attica.americas.sgi.com> References: <20060111155251.12460.71269.12163@attica.americas.sgi.com> <20060111155256.12460.26048.32596@attica.americas.sgi.com> Message-ID: <20060111202123.GC4367@kroah.com> On Wed, Jan 11, 2006 at 09:52:56AM -0600, Mark Maule wrote: > Abstract portions of the MSI core for platforms that do not use standard > APIC interrupt controllers. This is implemented through a new arch-specific > msi setup routine, and a set of msi ops which can be set on a per platform > basis. Ah, much better, just a few more minor comments below: > > Signed-off-by: Mark Maule > > Index: linux-maule/drivers/pci/msi.c > =================================================================== > --- linux-maule.orig/drivers/pci/msi.c 2006-01-10 11:48:01.000000000 -0800 > +++ linux-maule/drivers/pci/msi.c 2006-01-10 13:40:45.000000000 -0800 > @@ -23,8 +23,6 @@ > #include "pci.h" > #include "msi.h" > > -#define MSI_TARGET_CPU first_cpu(cpu_online_map) > - > static DEFINE_SPINLOCK(msi_lock); > static struct msi_desc* msi_desc[NR_IRQS] = { [0 ... NR_IRQS-1] = NULL }; > static kmem_cache_t* msi_cachep; > @@ -40,6 +38,15 @@ > u8 irq_vector[NR_IRQ_VECTORS] = { FIRST_DEVICE_VECTOR , 0 }; > #endif > > +static struct msi_ops *msi_ops; > + > +int > +msi_register(struct msi_ops *ops) > +{ > + msi_ops = ops; > + return 0; > +} > + > static void msi_cache_ctor(void *p, kmem_cache_t *cache, unsigned long flags) > { > memset(p, 0, NR_IRQS * sizeof(struct msi_desc)); > @@ -92,7 +99,7 @@ > static void set_msi_affinity(unsigned int vector, cpumask_t cpu_mask) > { > struct msi_desc *entry; > - struct msg_address address; > + u32 address_hi, address_lo; > unsigned int irq = vector; > unsigned int dest_cpu = first_cpu(cpu_mask); > > @@ -108,28 +115,36 @@ > if (!(pos = pci_find_capability(entry->dev, PCI_CAP_ID_MSI))) > return; > > + pci_read_config_dword(entry->dev, msi_upper_address_reg(pos), > + &address_hi); > pci_read_config_dword(entry->dev, msi_lower_address_reg(pos), > - &address.lo_address.value); > - address.lo_address.value &= MSI_ADDRESS_DEST_ID_MASK; > - address.lo_address.value |= (cpu_physical_id(dest_cpu) << > - MSI_TARGET_CPU_SHIFT); > - entry->msi_attrib.current_cpu = cpu_physical_id(dest_cpu); > + &address_lo); > + > + msi_ops->target(vector, dest_cpu, &address_hi, &address_lo); > + > + pci_write_config_dword(entry->dev, msi_upper_address_reg(pos), > + address_hi); > pci_write_config_dword(entry->dev, msi_lower_address_reg(pos), > - address.lo_address.value); > + address_lo); > set_native_irq_info(irq, cpu_mask); > break; > } > case PCI_CAP_ID_MSIX: > { > - int offset = entry->msi_attrib.entry_nr * PCI_MSIX_ENTRY_SIZE + > - PCI_MSIX_ENTRY_LOWER_ADDR_OFFSET; > + int offset_hi = > + entry->msi_attrib.entry_nr * PCI_MSIX_ENTRY_SIZE + > + PCI_MSIX_ENTRY_UPPER_ADDR_OFFSET; > + int offset_lo = > + entry->msi_attrib.entry_nr * PCI_MSIX_ENTRY_SIZE + > + PCI_MSIX_ENTRY_LOWER_ADDR_OFFSET; > + > + address_hi = readl(entry->mask_base + offset_hi); > + address_lo = readl(entry->mask_base + offset_lo); > > - address.lo_address.value = readl(entry->mask_base + offset); > - address.lo_address.value &= MSI_ADDRESS_DEST_ID_MASK; > - address.lo_address.value |= (cpu_physical_id(dest_cpu) << > - MSI_TARGET_CPU_SHIFT); > - entry->msi_attrib.current_cpu = cpu_physical_id(dest_cpu); > - writel(address.lo_address.value, entry->mask_base + offset); > + msi_ops->target(vector, dest_cpu, &address_hi, &address_lo); > + > + writel(address_hi, entry->mask_base + offset_hi); > + writel(address_lo, entry->mask_base + offset_lo); > set_native_irq_info(irq, cpu_mask); > break; > } > @@ -249,30 +264,6 @@ > .set_affinity = set_msi_irq_affinity > }; > > -static void msi_data_init(struct msg_data *msi_data, > - unsigned int vector) > -{ > - memset(msi_data, 0, sizeof(struct msg_data)); > - msi_data->vector = (u8)vector; > - msi_data->delivery_mode = MSI_DELIVERY_MODE; > - msi_data->level = MSI_LEVEL_MODE; > - msi_data->trigger = MSI_TRIGGER_MODE; > -} > - > -static void msi_address_init(struct msg_address *msi_address) > -{ > - unsigned int dest_id; > - unsigned long dest_phys_id = cpu_physical_id(MSI_TARGET_CPU); > - > - memset(msi_address, 0, sizeof(struct msg_address)); > - msi_address->hi_address = (u32)0; > - dest_id = (MSI_ADDRESS_HEADER << MSI_ADDRESS_HEADER_SHIFT); > - msi_address->lo_address.u.dest_mode = MSI_PHYSICAL_MODE; > - msi_address->lo_address.u.redirection_hint = MSI_REDIRECTION_HINT_MODE; > - msi_address->lo_address.u.dest_id = dest_id; > - msi_address->lo_address.value |= (dest_phys_id << MSI_TARGET_CPU_SHIFT); > -} > - > static int msi_free_vector(struct pci_dev* dev, int vector, int reassign); > static int assign_msi_vector(void) > { > @@ -367,6 +358,20 @@ > return status; > } > > + if ((status = msi_arch_init()) < 0) { > + pci_msi_enable = 0; > + printk(KERN_WARNING > + "PCI: MSI arch init failed. MSI disabled.\n"); > + return status; > + } > + > + if (! msi_ops) { > + printk(KERN_WARNING > + "PCI: MSI ops not registered. MSI disabled.\n"); > + status = -EINVAL; > + return status; > + } > + > if ((status = msi_cache_init()) < 0) { > pci_msi_enable = 0; > printk(KERN_WARNING "PCI: MSI cache init failed\n"); > @@ -510,9 +515,11 @@ > **/ > static int msi_capability_init(struct pci_dev *dev) > { > + int status; > struct msi_desc *entry; > - struct msg_address address; > - struct msg_data data; > + u32 address_lo; > + u32 address_hi; > + u32 data; > int pos, vector; > u16 control; > > @@ -539,23 +546,26 @@ > entry->mask_base = (void __iomem *)(long)msi_mask_bits_reg(pos, > is_64bit_address(control)); > } > + /* Configure MSI capability structure */ > + status = msi_ops->setup(dev, vector, > + &address_hi, > + &address_lo, > + &data); > + if (status < 0) { > + kmem_cache_free(msi_cachep, entry); > + return status; > + } > /* Replace with MSI handler */ > irq_handler_init(PCI_CAP_ID_MSI, vector, entry->msi_attrib.maskbit); > - /* Configure MSI capability structure */ > - msi_address_init(&address); > - msi_data_init(&data, vector); > - entry->msi_attrib.current_cpu = ((address.lo_address.u.dest_id >> > - MSI_TARGET_CPU_SHIFT) & MSI_TARGET_CPU_MASK); > - pci_write_config_dword(dev, msi_lower_address_reg(pos), > - address.lo_address.value); > + > + pci_write_config_dword(dev, msi_lower_address_reg(pos), address_lo); > if (is_64bit_address(control)) { > pci_write_config_dword(dev, > - msi_upper_address_reg(pos), address.hi_address); > - pci_write_config_word(dev, > - msi_data_reg(pos, 1), *((u32*)&data)); > + msi_upper_address_reg(pos), address_hi); > + pci_write_config_word(dev, msi_data_reg(pos, 1), data); > } else > - pci_write_config_word(dev, > - msi_data_reg(pos, 0), *((u32*)&data)); > + pci_write_config_word(dev, msi_data_reg(pos, 0), data); > + > if (entry->msi_attrib.maskbit) { > unsigned int maskbits, temp; > /* All MSIs are unmasked by default, Mask them all */ > @@ -590,13 +600,15 @@ > struct msix_entry *entries, int nvec) > { > struct msi_desc *head = NULL, *tail = NULL, *entry = NULL; > - struct msg_address address; > - struct msg_data data; > + u32 address_hi; > + u32 address_lo; > + u32 data; > int vector, pos, i, j, nr_entries, temp = 0; > u32 phys_addr, table_offset; > u16 control; > u8 bir; > void __iomem *base; > + int status; > > pos = pci_find_capability(dev, PCI_CAP_ID_MSIX); > /* Request & Map MSI-X table region */ > @@ -643,18 +655,20 @@ > /* Replace with MSI-X handler */ > irq_handler_init(PCI_CAP_ID_MSIX, vector, 1); > /* Configure MSI-X capability structure */ > - msi_address_init(&address); > - msi_data_init(&data, vector); > - entry->msi_attrib.current_cpu = > - ((address.lo_address.u.dest_id >> > - MSI_TARGET_CPU_SHIFT) & MSI_TARGET_CPU_MASK); > - writel(address.lo_address.value, > + status = msi_ops->setup(dev, vector, > + &address_hi, > + &address_lo, > + &data); > + if (status < 0) > + break; > + > + writel(address_lo, > base + j * PCI_MSIX_ENTRY_SIZE + > PCI_MSIX_ENTRY_LOWER_ADDR_OFFSET); > - writel(address.hi_address, > + writel(address_hi, > base + j * PCI_MSIX_ENTRY_SIZE + > PCI_MSIX_ENTRY_UPPER_ADDR_OFFSET); > - writel(*(u32*)&data, > + writel(data, > base + j * PCI_MSIX_ENTRY_SIZE + > PCI_MSIX_ENTRY_DATA_OFFSET); > attach_msi_entry(entry, vector); > @@ -789,6 +803,8 @@ > void __iomem *base; > unsigned long flags; > > + msi_ops->teardown(vector); > + > spin_lock_irqsave(&msi_lock, flags); > entry = msi_desc[vector]; > if (!entry || entry->dev != dev) { > Index: linux-maule/include/asm-i386/msi.h > =================================================================== > --- linux-maule.orig/include/asm-i386/msi.h 2006-01-10 11:47:42.000000000 -0800 > +++ linux-maule/include/asm-i386/msi.h 2006-01-10 11:58:55.000000000 -0800 > @@ -12,4 +12,11 @@ > #define LAST_DEVICE_VECTOR 232 > #define MSI_TARGET_CPU_SHIFT 12 > > +static inline int msi_arch_init(void) > +{ > + extern struct msi_ops msi_apic_ops; > + msi_register(&msi_apic_ops); > + return 0; > +} Don't have an extern in a function, it belongs in a .h file somewhere that describes it and everyone can see it. Otherwise this gets stale and messy over time. > +/* > + * Generic callouts used on most archs/platforms. Override with > + * msi_register_callouts() > + */ Care to use kerneldoc here and define exactly what is needed for these function pointers? And you are still calling them "callouts" here :) > +struct msi_ops msi_apic_ops = { > + .setup = msi_setup_apic, > + .teardown = msi_teardown_apic, > +#ifdef CONFIG_SMP > + .target = msi_target_apic, > +#endif Why the #ifdef? Just drop it, it makes the code cleaner. Care to redo this? thanks, greg k-h From maule at sgi.com Thu Jan 12 07:49:29 2006 From: maule at sgi.com (Mark Maule) Date: Wed, 11 Jan 2006 14:49:29 -0600 Subject: [PATCH 1/3] msi vector targeting abstractions In-Reply-To: <20060111202123.GC4367@kroah.com> References: <20060111155251.12460.71269.12163@attica.americas.sgi.com> <20060111155256.12460.26048.32596@attica.americas.sgi.com> <20060111202123.GC4367@kroah.com> Message-ID: <20060111204929.GA17946@sgi.com> > > +static inline int msi_arch_init(void) > > +{ > > + extern struct msi_ops msi_apic_ops; > > + msi_register(&msi_apic_ops); > > + return 0; > > +} > > Don't have an extern in a function, it belongs in a .h file somewhere > that describes it and everyone can see it. Otherwise this gets stale > and messy over time. In this case, I have a public .h (asm-xxx/msi.h) which needs a data structure decleared down in a driver-private file (drivers/pci/msi-apic.c). Do you have a suggestion for where I should put the msi_apic_ops declaration? It should be somewhere such that future msi ops (e.g. sn_msi_ops from patch3) would be treated consistently. linux/pci.h seems like one possiblity near where the ops struct is declared, but that doesn't really seem right, because we'ld want to treat sn_msi_ops (and future msi ops) the same way. Maybe just move the extern out of the function and up further in the asm-xxx/msi.h file? > > > +/* > > + * Generic callouts used on most archs/platforms. Override with > > + * msi_register_callouts() > > + */ > > Care to use kerneldoc here and define exactly what is needed for these > function pointers? And you are still calling them "callouts" here :) > > > +struct msi_ops msi_apic_ops = { > > + .setup = msi_setup_apic, > > + .teardown = msi_teardown_apic, > > +#ifdef CONFIG_SMP > > + .target = msi_target_apic, > > +#endif > > Why the #ifdef? Just drop it, it makes the code cleaner. > > Care to redo this? ok. Will submit a new version once we have the placement of the msi_apic_ops declaration sorted out. Mark From linas at austin.ibm.com Thu Jan 12 07:49:37 2006 From: linas at austin.ibm.com (linas) Date: Wed, 11 Jan 2006 14:49:37 -0600 Subject: [PATCH] powerpc: remove eeh warning In-Reply-To: <20060111200258.GG2491@pb15.lixom.net> References: <20060111200258.GG2491@pb15.lixom.net> Message-ID: <20060111204937.GQ26221@austin.ibm.com> Ack. --linas On Wed, Jan 11, 2006 at 02:02:58PM -0600, Olof Johansson was heard to remark: Hi, Paulus, please apply. ------ Remove warning in eeh code about mixed variables and code. Signed-off-by: Olof Johansson Acked-by: Linas Vepstas Index: 2.6/arch/powerpc/platforms/pseries/eeh.c =================================================================== --- 2.6.orig/arch/powerpc/platforms/pseries/eeh.c 2006-01-11 13:34:34.000000000 -0600 +++ 2.6/arch/powerpc/platforms/pseries/eeh.c 2006-01-11 13:57:10.000000000 -0600 @@ -208,10 +208,11 @@ static void __eeh_mark_slot (struct devi { while (dn) { if (PCI_DN(dn)) { - PCI_DN(dn)->eeh_mode |= mode_flag; - /* Mark the pci device driver too */ struct pci_dev *dev = PCI_DN(dn)->pcidev; + + PCI_DN(dn)->eeh_mode |= mode_flag; + if (dev && dev->driver) dev->error_state = pci_channel_io_frozen; From greg at kroah.com Thu Jan 12 07:57:49 2006 From: greg at kroah.com (Greg KH) Date: Wed, 11 Jan 2006 12:57:49 -0800 Subject: [PATCH 1/3] msi vector targeting abstractions In-Reply-To: <20060111204929.GA17946@sgi.com> References: <20060111155251.12460.71269.12163@attica.americas.sgi.com> <20060111155256.12460.26048.32596@attica.americas.sgi.com> <20060111202123.GC4367@kroah.com> <20060111204929.GA17946@sgi.com> Message-ID: <20060111205749.GA5495@kroah.com> On Wed, Jan 11, 2006 at 02:49:29PM -0600, Mark Maule wrote: > > > +static inline int msi_arch_init(void) > > > +{ > > > + extern struct msi_ops msi_apic_ops; > > > + msi_register(&msi_apic_ops); > > > + return 0; > > > +} > > > > Don't have an extern in a function, it belongs in a .h file somewhere > > that describes it and everyone can see it. Otherwise this gets stale > > and messy over time. > > In this case, I have a public .h (asm-xxx/msi.h) which needs a data structure > decleared down in a driver-private file (drivers/pci/msi-apic.c). Do you have > a suggestion for where I should put the msi_apic_ops declaration? It should > be somewhere such that future msi ops (e.g. sn_msi_ops from patch3) would > be treated consistently. > > linux/pci.h seems like one possiblity near where the ops struct is declared, > but that doesn't really seem right, because we'ld want to treat sn_msi_ops > (and future msi ops) the same way. > > Maybe just move the extern out of the function and up further in the > asm-xxx/msi.h file? Sure, or in drivers/pci/pci.h, as that is private to the pci implementation code, right? thanks, greg k-h From benh at kernel.crashing.org Thu Jan 12 08:45:28 2006 From: benh at kernel.crashing.org (Benjamin Herrenschmidt) Date: Thu, 12 Jan 2006 08:45:28 +1100 Subject: please pull powerpc-merge.git In-Reply-To: References: <17348.54232.914877.675904@cargo.ozlabs.ibm.com> Message-ID: <1137015928.5138.25.camel@localhost.localdomain> On Wed, 2006-01-11 at 08:18 -0800, Linus Torvalds wrote: > > On Wed, 11 Jan 2006, Paul Mackerras wrote: > > > > When do you think you will close the merge window? The glibc guys > > want us to set AT_PLATFORM to something useful on powerpc, so I'd like > > to get that in. I have a patch to do that, but it will take a couple > > of days to get consensus that we have the right set of strings > > exported. > > My plan is around this Sunday. I can't leave it much later, simply because > on Friday I'm flying off to NZ, and I want to leave the window open for an > -rc2 if needed. > > That's also the two weeks after 2.6.15, so it's the right date. That should leave me enough time to move prep over and finally remove pmac/chrp/prep from arch=ppc since they are just a non building burden at this point. The consolidation of the init code path between 32 and 64 bits will probably not make it in time though. Ben. From benh at kernel.crashing.org Thu Jan 12 08:47:54 2006 From: benh at kernel.crashing.org (Benjamin Herrenschmidt) Date: Thu, 12 Jan 2006 08:47:54 +1100 Subject: [PATCH] powerpc: add ibm,suspend-me rtas interface In-Reply-To: <20060111174353.GA1867@cs.umn.edu> References: <20060111095633.GB30507@cs.umn.edu> <20060111171252.GD2491@pb15.lixom.net> <20060111174353.GA1867@cs.umn.edu> Message-ID: <1137016074.5138.28.camel@localhost.localdomain> > > This suspend is not (sigh) the same as linux suspend. I might have > tried to rename it something different, but the RTAS call is > "ibm,suspend-me". This is going to be driven by the HMC ultimately. > > This function doesn't preclude someone implementing one of the Linux > swsusp versions on Power (and in fact Santi was working on that last > year.) What is it then ? Linux "suspend" means any kind of maching suspend, wether it's to RAM or to disk. If this calls suspends operations on the partition, it should probably be hooked to the linux PM framework. This is regardless of wether suspend to disk is implemented or not for ppc64. Ben. From will_schmidt at vnet.ibm.com Thu Jan 12 08:48:33 2006 From: will_schmidt at vnet.ibm.com (will schmidt) Date: Wed, 11 Jan 2006 15:48:33 -0600 Subject: powerpc: Fix iSeries bug in VMALLOCBASE/VMALLOC_START consolidation In-Reply-To: <20051216034925.GB1448@localhost.localdomain> References: <20051216034925.GB1448@localhost.localdomain> Message-ID: <43C57D31.1010304@vnet.ibm.com> David Gibson wrote: > Paulus, please apply to powerpc tree. > > Oops, forgot to compile the VMALLOCBASE/VMALLOC_START patch on > iSeries. VMALLOC_START is defined in pgtable.h whereas previously > VMALLOCBASE was previously defined in page.h. lparmap.c needs to be > updated appropriately: > > Booted on iSeries RS64 (now). > > Signed-off-by: David Gibson > > Index: working-2.6/arch/powerpc/kernel/lparmap.c > =================================================================== > --- working-2.6.orig/arch/powerpc/kernel/lparmap.c 2005-12-16 13:05:21.000000000 +1100 > +++ working-2.6/arch/powerpc/kernel/lparmap.c 2005-12-16 14:45:45.000000000 +1100 > @@ -7,7 +7,7 @@ > * 2 of the License, or (at your option) any later version. > */ > #include > -#include > +#include > #include > > const struct LparMap __attribute__((__section__(".text"))) xLparMap = { > This patch still needs to be applied? when building powerpc-git for iSeries, i'm getting this: CC arch/powerpc/kernel/lparmap.s arch/powerpc/kernel/lparmap.c:21: error: `VMALLOC_START' undeclared here (not in a function) arch/powerpc/kernel/lparmap.c:21: error: initializer element is not constant arch/powerpc/kernel/lparmap.c:21: error: (near initialization for `xLparMap.xEsids[1].xKernelEsid') arch/powerpc/kernel/lparmap.c:22: error: `VMALLOC_START' undeclared here (not in a function) ..... -Will From benh at kernel.crashing.org Thu Jan 12 08:48:54 2006 From: benh at kernel.crashing.org (Benjamin Herrenschmidt) Date: Thu, 12 Jan 2006 08:48:54 +1100 Subject: [PATCH 0/5] powerpc: add device tree property updates In-Reply-To: <20060111095921.GC30507@cs.umn.edu> References: <20060111095921.GC30507@cs.umn.edu> Message-ID: <1137016134.5138.30.camel@localhost.localdomain> On Wed, 2006-01-11 at 03:59 -0600, Dave C Boutcher wrote: > The following set of patches add support for updating device > tree properties on the fly. pseries is adding some > awfull^h^h^h^h^h^h helpful RTAS calls named "ibm,update-nodes" > and "ibm,update-properties". We can call those from userland, > but we need the interfaces to update the device trees. Looks like it's really time to turn /proc/device-tree into a filesystem... that will solve most of the problems of having properties or nodes changing. Ben. From benh at kernel.crashing.org Thu Jan 12 08:49:18 2006 From: benh at kernel.crashing.org (Benjamin Herrenschmidt) Date: Thu, 12 Jan 2006 08:49:18 +1100 Subject: [PATCH 1/5] powerpc: null pointer check In-Reply-To: <20060111100023.GD30507@cs.umn.edu> References: <20060111100023.GD30507@cs.umn.edu> Message-ID: <1137016158.5138.32.camel@localhost.localdomain> On Wed, 2006-01-11 at 04:00 -0600, Dave C Boutcher wrote: > There should never be a device-tree node without a name > property. But if one ever shows up, the panic is not > pretty. Add a quick check to make the name pointer > is not null before we use it. That code is gone anyay :) Ben. From benh at kernel.crashing.org Thu Jan 12 08:50:06 2006 From: benh at kernel.crashing.org (Benjamin Herrenschmidt) Date: Thu, 12 Jan 2006 08:50:06 +1100 Subject: [PATCH 2/5] powerpc: proc_device_tree remove and update functions In-Reply-To: <20060111100128.GE30507@cs.umn.edu> References: <20060111100128.GE30507@cs.umn.edu> Message-ID: <1137016206.5138.34.camel@localhost.localdomain> On Wed, 2006-01-11 at 04:01 -0600, Dave C Boutcher wrote: > Add support to the proc_device_tree file for removing > and updating properties. Remove just removes the > proc file, update changes the data pointer within > the proc file. The remainder of the device-tree > changes occur elsewhere. I think we should move to a filesystem instead. It should be fairly trivial (look at sun's openpromfs for example) Ben. From maule at sgi.com Thu Jan 12 09:16:43 2006 From: maule at sgi.com (Mark Maule) Date: Wed, 11 Jan 2006 16:16:43 -0600 (CST) Subject: [PATCH 2/3] per-platform IA64_{FIRST, LAST}_DEVICE_VECTOR definitions In-Reply-To: <20060111221633.28765.95775.64741@attica.americas.sgi.com> References: <20060111221633.28765.95775.64741@attica.americas.sgi.com> Message-ID: <20060111221643.28765.38687.79085@attica.americas.sgi.com> Abstract IA64_FIRST_DEVICE_VECTOR/IA64_LAST_DEVICE_VECTOR since SN platforms use a subset of the IA64 range. Implement this by making the above macros global variables which the platform can override in it setup code. Also add a reserve_irq_vector() routine used by SN to mark a vector's as in-use when that weren't allocated through assign_irq_vector(). Signed-off-by: Mark Maule Index: msi/arch/ia64/kernel/irq_ia64.c =================================================================== --- msi.orig/arch/ia64/kernel/irq_ia64.c 2005-12-21 22:59:09.000000000 -0600 +++ msi/arch/ia64/kernel/irq_ia64.c 2005-12-22 14:10:01.000000000 -0600 @@ -46,6 +46,10 @@ #define IRQ_DEBUG 0 +/* These can be overridden in platform_irq_init */ +int ia64_first_device_vector = IA64_DEF_FIRST_DEVICE_VECTOR; +int ia64_last_device_vector = IA64_DEF_LAST_DEVICE_VECTOR; + /* default base addr of IPI table */ void __iomem *ipi_base_addr = ((void __iomem *) (__IA64_UNCACHED_OFFSET | IA64_IPI_DEFAULT_BASE_ADDR)); @@ -60,7 +64,7 @@ }; EXPORT_SYMBOL(isa_irq_to_vector_map); -static unsigned long ia64_vector_mask[BITS_TO_LONGS(IA64_NUM_DEVICE_VECTORS)]; +static unsigned long ia64_vector_mask[BITS_TO_LONGS(IA64_MAX_DEVICE_VECTORS)]; int assign_irq_vector (int irq) @@ -89,6 +93,17 @@ printk(KERN_WARNING "%s: double free!\n", __FUNCTION__); } +int +reserve_irq_vector (int vector) +{ + if (vector < IA64_FIRST_DEVICE_VECTOR || + vector > IA64_LAST_DEVICE_VECTOR) + return -EINVAL; + + return test_and_set_bit(IA64_FIRST_DEVICE_VECTOR + vector, + ia64_vector_mask); +} + #ifdef CONFIG_SMP # define IS_RESCHEDULE(vec) (vec == IA64_IPI_RESCHEDULE) #else Index: msi/arch/ia64/sn/kernel/irq.c =================================================================== --- msi.orig/arch/ia64/sn/kernel/irq.c 2005-12-21 22:59:09.000000000 -0600 +++ msi/arch/ia64/sn/kernel/irq.c 2005-12-22 14:10:01.000000000 -0600 @@ -203,6 +203,9 @@ int i; irq_desc_t *base_desc = irq_desc; + ia64_first_device_vector = IA64_SN2_FIRST_DEVICE_VECTOR; + ia64_last_device_vector = IA64_SN2_LAST_DEVICE_VECTOR; + for (i = 0; i < NR_IRQS; i++) { if (base_desc[i].handler == &no_irq_type) { base_desc[i].handler = &irq_type_sn; @@ -287,6 +290,7 @@ /* link it into the sn_irq[irq] list */ spin_lock(&sn_irq_info_lock); list_add_rcu(&sn_irq_info->list, sn_irq_lh[sn_irq_info->irq_irq]); + reserve_irq_vector(sn_irq_info->irq_irq); spin_unlock(&sn_irq_info_lock); (void)register_intr_pda(sn_irq_info); @@ -310,8 +314,11 @@ spin_lock(&sn_irq_info_lock); list_del_rcu(&sn_irq_info->list); spin_unlock(&sn_irq_info_lock); + if (list_empty(sn_irq_lh[sn_irq_info->irq_irq])) + free_irq_vector(sn_irq_info->irq_irq); call_rcu(&sn_irq_info->rcu, sn_irq_info_free); pci_dev_put(pci_dev); + } static inline void Index: msi/include/asm-ia64/hw_irq.h =================================================================== --- msi.orig/include/asm-ia64/hw_irq.h 2005-12-21 22:59:09.000000000 -0600 +++ msi/include/asm-ia64/hw_irq.h 2005-12-22 14:10:01.000000000 -0600 @@ -47,9 +47,19 @@ #define IA64_CMC_VECTOR 0x1f /* corrected machine-check interrupt vector */ /* * Vectors 0x20-0x2f are reserved for legacy ISA IRQs. + * Use vectors 0x30-0xe7 as the default device vector range for ia64. + * Platforms may choose to reduce this range in platform_irq_setup, but the + * platform range must fall within + * [IA64_DEF_FIRST_DEVICE_VECTOR..IA64_DEF_LAST_DEVICE_VECTOR] */ -#define IA64_FIRST_DEVICE_VECTOR 0x30 -#define IA64_LAST_DEVICE_VECTOR 0xe7 +extern int ia64_first_device_vector; +extern int ia64_last_device_vector; + +#define IA64_DEF_FIRST_DEVICE_VECTOR 0x30 +#define IA64_DEF_LAST_DEVICE_VECTOR 0xe7 +#define IA64_FIRST_DEVICE_VECTOR ia64_first_device_vector +#define IA64_LAST_DEVICE_VECTOR ia64_last_device_vector +#define IA64_MAX_DEVICE_VECTORS (IA64_DEF_LAST_DEVICE_VECTOR - IA64_DEF_FIRST_DEVICE_VECTOR + 1) #define IA64_NUM_DEVICE_VECTORS (IA64_LAST_DEVICE_VECTOR - IA64_FIRST_DEVICE_VECTOR + 1) #define IA64_MCA_RENDEZ_VECTOR 0xe8 /* MCA rendez interrupt */ @@ -83,6 +93,7 @@ extern int assign_irq_vector (int irq); /* allocate a free vector */ extern void free_irq_vector (int vector); +extern int reserve_irq_vector (int vector); extern void ia64_send_ipi (int cpu, int vector, int delivery_mode, int redirect); extern void register_percpu_irq (ia64_vector vec, struct irqaction *action); Index: msi/drivers/pci/msi.c =================================================================== --- msi.orig/drivers/pci/msi.c 2005-12-21 22:59:09.000000000 -0600 +++ msi/drivers/pci/msi.c 2005-12-22 14:10:19.000000000 -0600 @@ -35,7 +35,7 @@ #ifndef CONFIG_X86_IO_APIC int vector_irq[NR_VECTORS] = { [0 ... NR_VECTORS - 1] = -1}; -u8 irq_vector[NR_IRQ_VECTORS] = { FIRST_DEVICE_VECTOR , 0 }; +u8 irq_vector[NR_IRQ_VECTORS]; #endif static struct msi_ops *msi_ops; @@ -377,6 +377,11 @@ printk(KERN_WARNING "PCI: MSI cache init failed\n"); return status; } + +#ifndef CONFIG_X86_IO_APIC + irq_vector[0] = FIRST_DEVICE_VECTOR; +#endif + last_alloc_vector = assign_irq_vector(AUTO_ASSIGN); if (last_alloc_vector < 0) { pci_msi_enable = 0; From maule at sgi.com Thu Jan 12 09:16:48 2006 From: maule at sgi.com (Mark Maule) Date: Wed, 11 Jan 2006 16:16:48 -0600 (CST) Subject: [PATCH 3/3] altix: msi support In-Reply-To: <20060111221633.28765.95775.64741@attica.americas.sgi.com> References: <20060111221633.28765.95775.64741@attica.americas.sgi.com> Message-ID: <20060111221648.28765.41741.34942@attica.americas.sgi.com> MSI callouts for altix. Involves a fair amount of code reorg in sn irq.c code as well as adding some extensions to the altix PCI provider abstaction. Signed-off-by: Mark Maule Index: linux-2.6.14/arch/ia64/sn/pci/msi.c =================================================================== --- linux-2.6.14.orig/arch/ia64/sn/pci/msi.c 2005-12-21 22:37:02.978262311 -0600 +++ linux-2.6.14/arch/ia64/sn/pci/msi.c 2005-12-21 22:38:24.090685912 -0600 @@ -6,13 +6,205 @@ * Copyright (C) 2005 Silicon Graphics, Inc. All Rights Reserved. */ -#include +#include +#include +#include + +#include + +#include +#include +#include +#include +#include + +struct sn_msi_info { + u64 pci_addr; + struct sn_irq_info *sn_irq_info; +}; + +static struct sn_msi_info *sn_msi_info; + +static void +sn_msi_teardown(unsigned int vector) +{ + nasid_t nasid; + int widget; + struct pci_dev *pdev; + struct pcidev_info *sn_pdev; + struct sn_irq_info *sn_irq_info; + struct pcibus_bussoft *bussoft; + struct sn_pcibus_provider *provider; + + sn_irq_info = sn_msi_info[vector].sn_irq_info; + if (sn_irq_info == NULL || sn_irq_info->irq_int_bit >= 0) + return; + + sn_pdev = (struct pcidev_info *)sn_irq_info->irq_pciioinfo; + pdev = sn_pdev->pdi_linux_pcidev; + provider = SN_PCIDEV_BUSPROVIDER(pdev); + + (*provider->dma_unmap)(pdev, + sn_msi_info[vector].pci_addr, + PCI_DMA_FROMDEVICE); + sn_msi_info[vector].pci_addr = 0; + + bussoft = SN_PCIDEV_BUSSOFT(pdev); + nasid = NASID_GET(bussoft->bs_base); + widget = (nasid & 1) ? + TIO_SWIN_WIDGETNUM(bussoft->bs_base) : + SWIN_WIDGETNUM(bussoft->bs_base); + + sn_intr_free(nasid, widget, sn_irq_info); + sn_msi_info[vector].sn_irq_info = NULL; + + return; +} int -sn_msi_init(void) +sn_msi_setup(struct pci_dev *pdev, unsigned int vector, + u32 *addr_hi, u32 *addr_lo, u32 *data) { + int widget; + int status; + nasid_t nasid; + u64 bus_addr; + struct sn_irq_info *sn_irq_info; + struct pcibus_bussoft *bussoft = SN_PCIDEV_BUSSOFT(pdev); + struct sn_pcibus_provider *provider = SN_PCIDEV_BUSPROVIDER(pdev); + + if (bussoft == NULL) + return -EINVAL; + + if (provider == NULL || provider->dma_map_consistent == NULL) + return -EINVAL; + + /* + * Set up the vector plumbing. Let the prom (via sn_intr_alloc) + * decide which cpu to direct this msi at by default. + */ + + nasid = NASID_GET(bussoft->bs_base); + widget = (nasid & 1) ? + TIO_SWIN_WIDGETNUM(bussoft->bs_base) : + SWIN_WIDGETNUM(bussoft->bs_base); + + sn_irq_info = kzalloc(sizeof(struct sn_irq_info), GFP_KERNEL); + if (! sn_irq_info) + return -ENOMEM; + + status = sn_intr_alloc(nasid, widget, sn_irq_info, vector, -1, -1); + if (status) { + kfree(sn_irq_info); + return -ENOMEM; + } + + sn_irq_info->irq_int_bit = -1; /* mark this as an MSI irq */ + sn_irq_fixup(pdev, sn_irq_info); + + /* Prom probably should fill these in, but doesn't ... */ + sn_irq_info->irq_bridge_type = bussoft->bs_asic_type; + sn_irq_info->irq_bridge = (void *)bussoft->bs_base; + /* - * return error until MSI is supported on altix platforms + * Map the xio address into bus space */ - return -EINVAL; + bus_addr = (*provider->dma_map_consistent)(pdev, + sn_irq_info->irq_xtalkaddr, + sizeof(sn_irq_info->irq_xtalkaddr), + SN_DMA_MSI|SN_DMA_ADDR_XIO); + if (! bus_addr) { + sn_intr_free(nasid, widget, sn_irq_info); + kfree(sn_irq_info); + return -ENOMEM; + } + + sn_msi_info[vector].sn_irq_info = sn_irq_info; + sn_msi_info[vector].pci_addr = bus_addr; + + *addr_hi = (u32)(bus_addr >> 32); + *addr_lo = (u32)(bus_addr & 0x00000000ffffffff); + + /* + * In the SN platform, bit 16 is a "send vector" bit which + * must be present in order to move the vector through the system. + */ + *data = 0x100 + (unsigned int)vector; + +#ifdef CONFIG_SMP + set_irq_affinity_info((vector & 0xff), sn_irq_info->irq_cpuid, 0); +#endif + + return 0; +} + +static void +sn_msi_target(unsigned int vector, unsigned int cpu, + u32 *addr_hi, u32 *addr_lo) +{ + int slice; + nasid_t nasid; + u64 bus_addr; + struct pci_dev *pdev; + struct pcidev_info *sn_pdev; + struct sn_irq_info *sn_irq_info; + struct sn_irq_info *new_irq_info; + struct sn_pcibus_provider *provider; + + sn_irq_info = sn_msi_info[vector].sn_irq_info; + if (sn_irq_info == NULL || sn_irq_info->irq_int_bit >= 0) + return; + + /* + * Release XIO resources for the old MSI PCI address + */ + + sn_pdev = (struct pcidev_info *)sn_irq_info->irq_pciioinfo; + pdev = sn_pdev->pdi_linux_pcidev; + provider = SN_PCIDEV_BUSPROVIDER(pdev); + + bus_addr = (u64)(*addr_hi) << 32 | (u64)(*addr_lo); + (*provider->dma_unmap)(pdev, bus_addr, PCI_DMA_FROMDEVICE); + sn_msi_info[vector].pci_addr = 0; + + nasid = cpuid_to_nasid(cpu); + slice = cpuid_to_slice(cpu); + + new_irq_info = sn_retarget_vector(sn_irq_info, nasid, slice); + sn_msi_info[vector].sn_irq_info = new_irq_info; + if (new_irq_info == NULL) + return; + + /* + * Map the xio address into bus space + */ + + bus_addr = (*provider->dma_map_consistent)(pdev, + new_irq_info->irq_xtalkaddr, + sizeof(new_irq_info->irq_xtalkaddr), + SN_DMA_MSI|SN_DMA_ADDR_XIO); + + sn_msi_info[vector].pci_addr = bus_addr; + *addr_hi = (u32)(bus_addr >> 32); + *addr_lo = (u32)(bus_addr & 0x00000000ffffffff); +} + +struct msi_ops sn_msi_ops = { + .setup = sn_msi_setup, + .teardown = sn_msi_teardown, +#ifdef CONFIG_SMP + .target = sn_msi_target, +#endif +}; + +int +sn_msi_init(void) +{ + sn_msi_info = + kzalloc(sizeof(struct sn_msi_info) * NR_VECTORS, GFP_KERNEL); + if (! sn_msi_info) + return -ENOMEM; + + msi_register(&sn_msi_ops); + return 0; } Index: linux-2.6.14/arch/ia64/sn/kernel/io_init.c =================================================================== --- linux-2.6.14.orig/arch/ia64/sn/kernel/io_init.c 2005-12-21 22:35:23.436286704 -0600 +++ linux-2.6.14/arch/ia64/sn/kernel/io_init.c 2005-12-21 22:38:24.091685671 -0600 @@ -51,7 +51,7 @@ */ static dma_addr_t -sn_default_pci_map(struct pci_dev *pdev, unsigned long paddr, size_t size) +sn_default_pci_map(struct pci_dev *pdev, unsigned long paddr, size_t size, int type) { return 0; } Index: linux-2.6.14/arch/ia64/sn/kernel/irq.c =================================================================== --- linux-2.6.14.orig/arch/ia64/sn/kernel/irq.c 2005-12-21 22:37:58.120953676 -0600 +++ linux-2.6.14/arch/ia64/sn/kernel/irq.c 2005-12-21 22:38:24.092685429 -0600 @@ -25,11 +25,11 @@ int sn_force_interrupt_flag = 1; extern int sn_ioif_inited; -static struct list_head **sn_irq_lh; +struct list_head **sn_irq_lh; static spinlock_t sn_irq_info_lock = SPIN_LOCK_UNLOCKED; /* non-IRQ lock */ -static inline uint64_t sn_intr_alloc(nasid_t local_nasid, int local_widget, - u64 sn_irq_info, +uint64_t sn_intr_alloc(nasid_t local_nasid, int local_widget, + struct sn_irq_info *sn_irq_info, int req_irq, nasid_t req_nasid, int req_slice) { @@ -39,12 +39,13 @@ SAL_CALL_NOLOCK(ret_stuff, (u64) SN_SAL_IOIF_INTERRUPT, (u64) SAL_INTR_ALLOC, (u64) local_nasid, - (u64) local_widget, (u64) sn_irq_info, (u64) req_irq, + (u64) local_widget, __pa(sn_irq_info), (u64) req_irq, (u64) req_nasid, (u64) req_slice); + return ret_stuff.status; } -static inline void sn_intr_free(nasid_t local_nasid, int local_widget, +void sn_intr_free(nasid_t local_nasid, int local_widget, struct sn_irq_info *sn_irq_info) { struct ia64_sal_retval ret_stuff; @@ -113,73 +114,91 @@ static void sn_irq_info_free(struct rcu_head *head); -static void sn_set_affinity_irq(unsigned int irq, cpumask_t mask) +struct sn_irq_info *sn_retarget_vector(struct sn_irq_info *sn_irq_info, + nasid_t nasid, int slice) { - struct sn_irq_info *sn_irq_info, *sn_irq_info_safe; - int cpuid, cpuphys; + int vector; + int cpuphys; + int64_t bridge; + int local_widget, status; + nasid_t local_nasid; + struct sn_irq_info *new_irq_info; + struct sn_pcibus_provider *pci_provider; - cpuid = first_cpu(mask); - cpuphys = cpu_physical_id(cpuid); + new_irq_info = kmalloc(sizeof(struct sn_irq_info), GFP_ATOMIC); + if (new_irq_info == NULL) + return NULL; - list_for_each_entry_safe(sn_irq_info, sn_irq_info_safe, - sn_irq_lh[irq], list) { - uint64_t bridge; - int local_widget, status; - nasid_t local_nasid; - struct sn_irq_info *new_irq_info; - struct sn_pcibus_provider *pci_provider; - - new_irq_info = kmalloc(sizeof(struct sn_irq_info), GFP_ATOMIC); - if (new_irq_info == NULL) - break; - memcpy(new_irq_info, sn_irq_info, sizeof(struct sn_irq_info)); - - bridge = (uint64_t) new_irq_info->irq_bridge; - if (!bridge) { - kfree(new_irq_info); - break; /* irq is not a device interrupt */ - } + memcpy(new_irq_info, sn_irq_info, sizeof(struct sn_irq_info)); - local_nasid = NASID_GET(bridge); + bridge = (uint64_t) new_irq_info->irq_bridge; + if (!bridge) { + kfree(new_irq_info); + return NULL; /* irq is not a device interrupt */ + } - if (local_nasid & 1) - local_widget = TIO_SWIN_WIDGETNUM(bridge); - else - local_widget = SWIN_WIDGETNUM(bridge); - - /* Free the old PROM new_irq_info structure */ - sn_intr_free(local_nasid, local_widget, new_irq_info); - /* Update kernels new_irq_info with new target info */ - unregister_intr_pda(new_irq_info); - - /* allocate a new PROM new_irq_info struct */ - status = sn_intr_alloc(local_nasid, local_widget, - __pa(new_irq_info), irq, - cpuid_to_nasid(cpuid), - cpuid_to_slice(cpuid)); - - /* SAL call failed */ - if (status) { - kfree(new_irq_info); - break; - } + local_nasid = NASID_GET(bridge); - new_irq_info->irq_cpuid = cpuid; - register_intr_pda(new_irq_info); + if (local_nasid & 1) + local_widget = TIO_SWIN_WIDGETNUM(bridge); + else + local_widget = SWIN_WIDGETNUM(bridge); - pci_provider = sn_pci_provider[new_irq_info->irq_bridge_type]; - if (pci_provider && pci_provider->target_interrupt) - (pci_provider->target_interrupt)(new_irq_info); - - spin_lock(&sn_irq_info_lock); - list_replace_rcu(&sn_irq_info->list, &new_irq_info->list); - spin_unlock(&sn_irq_info_lock); - call_rcu(&sn_irq_info->rcu, sn_irq_info_free); + vector = sn_irq_info->irq_irq; + /* Free the old PROM new_irq_info structure */ + sn_intr_free(local_nasid, local_widget, new_irq_info); + /* Update kernels new_irq_info with new target info */ + unregister_intr_pda(new_irq_info); + + /* allocate a new PROM new_irq_info struct */ + status = sn_intr_alloc(local_nasid, local_widget, + new_irq_info, vector, + nasid, slice); + + /* SAL call failed */ + if (status) { + kfree(new_irq_info); + return NULL; + } + + cpuphys = nasid_slice_to_cpuid(nasid, slice); + new_irq_info->irq_cpuid = cpuphys; + register_intr_pda(new_irq_info); + + pci_provider = sn_pci_provider[new_irq_info->irq_bridge_type]; + + /* + * If this represents a line interrupt, target it. If it's + * an msi (irq_int_bit < 0), it's already targeted. + */ + if (new_irq_info->irq_int_bit >= 0 && + pci_provider && pci_provider->target_interrupt) + (pci_provider->target_interrupt)(new_irq_info); + + spin_lock(&sn_irq_info_lock); + list_replace_rcu(&sn_irq_info->list, &new_irq_info->list); + spin_unlock(&sn_irq_info_lock); + call_rcu(&sn_irq_info->rcu, sn_irq_info_free); #ifdef CONFIG_SMP - set_irq_affinity_info((irq & 0xff), cpuphys, 0); + set_irq_affinity_info((vector & 0xff), cpuphys, 0); #endif - } + + return new_irq_info; +} + +static void sn_set_affinity_irq(unsigned int irq, cpumask_t mask) +{ + struct sn_irq_info *sn_irq_info, *sn_irq_info_safe; + nasid_t nasid; + int slice; + + nasid = cpuid_to_nasid(first_cpu(mask)); + slice = cpuid_to_slice(first_cpu(mask)); + + list_for_each_entry_safe(sn_irq_info, sn_irq_info_safe, + sn_irq_lh[irq], list) + (void)sn_retarget_vector(sn_irq_info, nasid, slice); } struct hw_interrupt_type irq_type_sn = { @@ -441,5 +460,4 @@ INIT_LIST_HEAD(sn_irq_lh[i]); } - } Index: linux-2.6.14/arch/ia64/sn/pci/pci_dma.c =================================================================== --- linux-2.6.14.orig/arch/ia64/sn/pci/pci_dma.c 2005-12-21 22:35:23.446284291 -0600 +++ linux-2.6.14/arch/ia64/sn/pci/pci_dma.c 2005-12-21 22:38:24.092685429 -0600 @@ -11,7 +11,7 @@ #include #include -#include +#include #include #include #include @@ -113,7 +113,8 @@ * resources. */ - *dma_handle = provider->dma_map_consistent(pdev, phys_addr, size); + *dma_handle = provider->dma_map_consistent(pdev, phys_addr, size, + SN_DMA_ADDR_PHYS); if (!*dma_handle) { printk(KERN_ERR "%s: out of ATEs\n", __FUNCTION__); free_pages((unsigned long)cpuaddr, get_order(size)); @@ -176,7 +177,7 @@ BUG_ON(dev->bus != &pci_bus_type); phys_addr = __pa(cpu_addr); - dma_addr = provider->dma_map(pdev, phys_addr, size); + dma_addr = provider->dma_map(pdev, phys_addr, size, SN_DMA_ADDR_PHYS); if (!dma_addr) { printk(KERN_ERR "%s: out of ATEs\n", __FUNCTION__); return 0; @@ -260,7 +261,8 @@ for (i = 0; i < nhwentries; i++, sg++) { phys_addr = SG_ENT_PHYS_ADDRESS(sg); sg->dma_address = provider->dma_map(pdev, - phys_addr, sg->length); + phys_addr, sg->length, + SN_DMA_ADDR_PHYS); if (!sg->dma_address) { printk(KERN_ERR "%s: out of ATEs\n", __FUNCTION__); Index: linux-2.6.14/arch/ia64/sn/pci/pcibr/pcibr_dma.c =================================================================== --- linux-2.6.14.orig/arch/ia64/sn/pci/pcibr/pcibr_dma.c 2005-12-21 22:35:23.445284532 -0600 +++ linux-2.6.14/arch/ia64/sn/pci/pcibr/pcibr_dma.c 2005-12-21 22:38:24.093685188 -0600 @@ -41,7 +41,7 @@ static dma_addr_t pcibr_dmamap_ate32(struct pcidev_info *info, - uint64_t paddr, size_t req_size, uint64_t flags) + uint64_t paddr, size_t req_size, uint64_t flags, int dma_flags) { struct pcidev_info *pcidev_info = info->pdi_host_pcidev_info; @@ -81,9 +81,12 @@ if (IS_PCIX(pcibus_info)) ate_flags &= ~(PCI32_ATE_PREF); - xio_addr = - IS_PIC_SOFT(pcibus_info) ? PHYS_TO_DMA(paddr) : - PHYS_TO_TIODMA(paddr); + if (SN_DMA_ADDRTYPE(dma_flags == SN_DMA_ADDR_PHYS)) + xio_addr = IS_PIC_SOFT(pcibus_info) ? PHYS_TO_DMA(paddr) : + PHYS_TO_TIODMA(paddr); + else + xio_addr = paddr; + offset = IOPGOFF(xio_addr); ate = ate_flags | (xio_addr - offset); @@ -91,6 +94,13 @@ if (IS_PIC_SOFT(pcibus_info)) { ate |= (pcibus_info->pbi_hub_xid << PIC_ATE_TARGETID_SHFT); } + + /* + * If we're mapping for MSI, set the MSI bit in the ATE + */ + if (dma_flags & SN_DMA_MSI) + ate |= PCI32_ATE_MSI; + ate_write(pcibus_info, ate_index, ate_count, ate); /* @@ -105,20 +115,27 @@ if (pcibus_info->pbi_devreg[internal_device] & PCIBR_DEV_SWAP_DIR) ATE_SWAP_ON(pci_addr); + return pci_addr; } static dma_addr_t pcibr_dmatrans_direct64(struct pcidev_info * info, uint64_t paddr, - uint64_t dma_attributes) + uint64_t dma_attributes, int dma_flags) { struct pcibus_info *pcibus_info = (struct pcibus_info *) ((info->pdi_host_pcidev_info)->pdi_pcibus_info); uint64_t pci_addr; /* Translate to Crosstalk View of Physical Address */ - pci_addr = (IS_PIC_SOFT(pcibus_info) ? PHYS_TO_DMA(paddr) : - PHYS_TO_TIODMA(paddr)) | dma_attributes; + if (SN_DMA_ADDRTYPE(dma_flags) == SN_DMA_ADDR_PHYS) + pci_addr = IS_PIC_SOFT(pcibus_info) ? + PHYS_TO_DMA(paddr) : + PHYS_TO_TIODMA(paddr) | dma_attributes; + else + pci_addr = IS_PIC_SOFT(pcibus_info) ? + paddr : + paddr | dma_attributes; /* Handle Bus mode */ if (IS_PCIX(pcibus_info)) @@ -130,7 +147,9 @@ ((uint64_t) pcibus_info-> pbi_hub_xid << PIC_PCI64_ATTR_TARG_SHFT); } else - pci_addr |= TIOCP_PCI64_CMDTYPE_MEM; + pci_addr |= (dma_flags & SN_DMA_MSI) ? + TIOCP_PCI64_CMDTYPE_MSI : + TIOCP_PCI64_CMDTYPE_MEM; /* If PCI mode, func zero uses VCHAN0, every other func uses VCHAN1 */ if (!IS_PCIX(pcibus_info) && PCI_FUNC(info->pdi_linux_pcidev->devfn)) @@ -142,7 +161,7 @@ static dma_addr_t pcibr_dmatrans_direct32(struct pcidev_info * info, - uint64_t paddr, size_t req_size, uint64_t flags) + uint64_t paddr, size_t req_size, uint64_t flags, int dma_flags) { struct pcidev_info *pcidev_info = info->pdi_host_pcidev_info; @@ -158,8 +177,14 @@ return 0; } - xio_addr = IS_PIC_SOFT(pcibus_info) ? PHYS_TO_DMA(paddr) : - PHYS_TO_TIODMA(paddr); + if (dma_flags & SN_DMA_MSI) + return 0; + + if (SN_DMA_ADDRTYPE(dma_flags) == SN_DMA_ADDR_PHYS) + xio_addr = IS_PIC_SOFT(pcibus_info) ? PHYS_TO_DMA(paddr) : + PHYS_TO_TIODMA(paddr); + else + xio_addr = paddr; xio_base = pcibus_info->pbi_dir_xbase; offset = xio_addr - xio_base; @@ -331,7 +356,7 @@ */ dma_addr_t -pcibr_dma_map(struct pci_dev * hwdev, unsigned long phys_addr, size_t size) +pcibr_dma_map(struct pci_dev * hwdev, unsigned long phys_addr, size_t size, int dma_flags) { dma_addr_t dma_handle; struct pcidev_info *pcidev_info = SN_PCIDEV_INFO(hwdev); @@ -348,11 +373,11 @@ */ dma_handle = pcibr_dmatrans_direct64(pcidev_info, phys_addr, - PCI64_ATTR_PREF); + PCI64_ATTR_PREF, dma_flags); } else { /* Handle 32-63 bit cards via direct mapping */ dma_handle = pcibr_dmatrans_direct32(pcidev_info, phys_addr, - size, 0); + size, 0, dma_flags); if (!dma_handle) { /* * It is a 32 bit card and we cannot do direct mapping, @@ -360,7 +385,8 @@ */ dma_handle = pcibr_dmamap_ate32(pcidev_info, phys_addr, - size, PCI32_ATE_PREF); + size, PCI32_ATE_PREF, + dma_flags); } } @@ -369,18 +395,18 @@ dma_addr_t pcibr_dma_map_consistent(struct pci_dev * hwdev, unsigned long phys_addr, - size_t size) + size_t size, int dma_flags) { dma_addr_t dma_handle; struct pcidev_info *pcidev_info = SN_PCIDEV_INFO(hwdev); if (hwdev->dev.coherent_dma_mask == ~0UL) { dma_handle = pcibr_dmatrans_direct64(pcidev_info, phys_addr, - PCI64_ATTR_BAR); + PCI64_ATTR_BAR, dma_flags); } else { dma_handle = (dma_addr_t) pcibr_dmamap_ate32(pcidev_info, phys_addr, size, - PCI32_ATE_BAR); + PCI32_ATE_BAR, dma_flags); } return dma_handle; Index: linux-2.6.14/arch/ia64/sn/pci/tioca_provider.c =================================================================== --- linux-2.6.14.orig/arch/ia64/sn/pci/tioca_provider.c 2005-12-21 22:35:23.446284291 -0600 +++ linux-2.6.14/arch/ia64/sn/pci/tioca_provider.c 2005-12-21 22:38:24.093685188 -0600 @@ -515,11 +515,17 @@ * use the GART mapped mode. */ static uint64_t -tioca_dma_map(struct pci_dev *pdev, uint64_t paddr, size_t byte_count) +tioca_dma_map(struct pci_dev *pdev, uint64_t paddr, size_t byte_count, int dma_flags) { uint64_t mapaddr; /* + * Not supported for now ... + */ + if (dma_flags & SN_DMA_MSI) + return 0; + + /* * If card is 64 or 48 bit addresable, use a direct mapping. 32 * bit direct is so restrictive w.r.t. where the memory resides that * we don't use it even though CA has some support. Index: linux-2.6.14/arch/ia64/sn/pci/tioce_provider.c =================================================================== --- linux-2.6.14.orig/arch/ia64/sn/pci/tioce_provider.c 2005-12-21 22:35:23.445284532 -0600 +++ linux-2.6.14/arch/ia64/sn/pci/tioce_provider.c 2005-12-21 22:38:24.094684947 -0600 @@ -52,7 +52,8 @@ (ATE_PAGE((start)+(len)-1, pagesize) - ATE_PAGE(start, pagesize) + 1) #define ATE_VALID(ate) ((ate) & (1UL << 63)) -#define ATE_MAKE(addr, ps) (((addr) & ~ATE_PAGEMASK(ps)) | (1UL << 63)) +#define ATE_MAKE(addr, ps, msi) \ + (((addr) & ~ATE_PAGEMASK(ps)) | (1UL << 63) | ((msi)?(1UL << 62):0)) /* * Flavors of ate-based mapping supported by tioce_alloc_map() @@ -78,15 +79,17 @@ * * 63 - must be 1 to indicate d64 mode to CE hardware * 62 - barrier bit ... controlled with tioce_dma_barrier() - * 61 - 0 since this is not an MSI transaction + * 61 - msi bit ... specified through dma_flags * 60:54 - reserved, MBZ */ static uint64_t -tioce_dma_d64(unsigned long ct_addr) +tioce_dma_d64(unsigned long ct_addr, int dma_flags) { uint64_t bus_addr; bus_addr = ct_addr | (1UL << 63); + if (dma_flags & SN_DMA_MSI) + bus_addr |= (1UL << 61); return bus_addr; } @@ -143,7 +146,7 @@ */ static uint64_t tioce_alloc_map(struct tioce_kernel *ce_kern, int type, int port, - uint64_t ct_addr, int len) + uint64_t ct_addr, int len, int dma_flags) { int i; int j; @@ -152,6 +155,7 @@ int entries; int nates; int pagesize; + int msi_capable, msi_wanted; uint64_t *ate_shadow; uint64_t *ate_reg; uint64_t addr; @@ -173,6 +177,7 @@ ate_reg = ce_mmr->ce_ure_ate3240; pagesize = ce_kern->ce_ate3240_pagesize; bus_base = TIOCE_M32_MIN; + msi_capable = 1; break; case TIOCE_ATE_M40: first = 0; @@ -181,6 +186,7 @@ ate_reg = ce_mmr->ce_ure_ate40; pagesize = MB(64); bus_base = TIOCE_M40_MIN; + msi_capable = 0; break; case TIOCE_ATE_M40S: /* @@ -193,11 +199,16 @@ ate_reg = ce_mmr->ce_ure_ate3240; pagesize = GB(16); bus_base = TIOCE_M40S_MIN; + msi_capable = 0; break; default: return 0; } + msi_wanted = dma_flags & SN_DMA_MSI; + if (msi_wanted && !msi_capable) + return 0; + nates = ATE_NPAGES(ct_addr, len, pagesize); if (nates > entries) return 0; @@ -226,7 +237,7 @@ for (j = 0; j < nates; j++) { uint64_t ate; - ate = ATE_MAKE(addr, pagesize); + ate = ATE_MAKE(addr, pagesize, msi_wanted); ate_shadow[i + j] = ate; writeq(ate, &ate_reg[i + j]); addr += pagesize; @@ -253,7 +264,7 @@ * Map @paddr into 32-bit bus space of the CE associated with @pcidev_info. */ static uint64_t -tioce_dma_d32(struct pci_dev *pdev, uint64_t ct_addr) +tioce_dma_d32(struct pci_dev *pdev, uint64_t ct_addr, int dma_flags) { int dma_ok; int port; @@ -263,6 +274,9 @@ uint64_t ct_lower; dma_addr_t bus_addr; + if (dma_flags & SN_DMA_MSI) + return 0; + ct_upper = ct_addr & ~0x3fffffffUL; ct_lower = ct_addr & 0x3fffffffUL; @@ -387,7 +401,7 @@ */ static uint64_t tioce_do_dma_map(struct pci_dev *pdev, uint64_t paddr, size_t byte_count, - int barrier) + int barrier, int dma_flags) { unsigned long flags; uint64_t ct_addr; @@ -403,15 +417,18 @@ if (dma_mask < 0x7fffffffUL) return 0; - ct_addr = PHYS_TO_TIODMA(paddr); + if (SN_DMA_ADDRTYPE(dma_flags) == SN_DMA_ADDR_PHYS) + ct_addr = PHYS_TO_TIODMA(paddr); + else + ct_addr = paddr; /* * If the device can generate 64 bit addresses, create a D64 map. - * Since this should never fail, bypass the rest of the checks. */ if (dma_mask == ~0UL) { - mapaddr = tioce_dma_d64(ct_addr); - goto dma_map_done; + mapaddr = tioce_dma_d64(ct_addr, dma_flags); + if (mapaddr) + goto dma_map_done; } pcidev_to_tioce(pdev, NULL, &ce_kern, &port); @@ -454,18 +471,22 @@ if (byte_count > MB(64)) { mapaddr = tioce_alloc_map(ce_kern, TIOCE_ATE_M40S, - port, ct_addr, byte_count); + port, ct_addr, byte_count, + dma_flags); if (!mapaddr) mapaddr = tioce_alloc_map(ce_kern, TIOCE_ATE_M40, -1, - ct_addr, byte_count); + ct_addr, byte_count, + dma_flags); } else { mapaddr = tioce_alloc_map(ce_kern, TIOCE_ATE_M40, -1, - ct_addr, byte_count); + ct_addr, byte_count, + dma_flags); if (!mapaddr) mapaddr = tioce_alloc_map(ce_kern, TIOCE_ATE_M40S, - port, ct_addr, byte_count); + port, ct_addr, byte_count, + dma_flags); } } @@ -473,7 +494,7 @@ * 32-bit direct is the next mode to try */ if (!mapaddr && dma_mask >= 0xffffffffUL) - mapaddr = tioce_dma_d32(pdev, ct_addr); + mapaddr = tioce_dma_d32(pdev, ct_addr, dma_flags); /* * Last resort, try 32-bit ATE-based map. @@ -481,12 +502,12 @@ if (!mapaddr) mapaddr = tioce_alloc_map(ce_kern, TIOCE_ATE_M32, -1, ct_addr, - byte_count); + byte_count, dma_flags); spin_unlock_irqrestore(&ce_kern->ce_lock, flags); dma_map_done: - if (mapaddr & barrier) + if (mapaddr && barrier) mapaddr = tioce_dma_barrier(mapaddr, 1); return mapaddr; @@ -502,9 +523,9 @@ * in the address. */ static uint64_t -tioce_dma(struct pci_dev *pdev, uint64_t paddr, size_t byte_count) +tioce_dma(struct pci_dev *pdev, uint64_t paddr, size_t byte_count, int dma_flags) { - return tioce_do_dma_map(pdev, paddr, byte_count, 0); + return tioce_do_dma_map(pdev, paddr, byte_count, 0, dma_flags); } /** @@ -516,9 +537,9 @@ * Simply call tioce_do_dma_map() to create a map with the barrier bit set * in the address. */ static uint64_t -tioce_dma_consistent(struct pci_dev *pdev, uint64_t paddr, size_t byte_count) +tioce_dma_consistent(struct pci_dev *pdev, uint64_t paddr, size_t byte_count, int dma_flags) { - return tioce_do_dma_map(pdev, paddr, byte_count, 1); + return tioce_do_dma_map(pdev, paddr, byte_count, 1, dma_flags); } /** Index: linux-2.6.14/include/asm-ia64/sn/intr.h =================================================================== --- linux-2.6.14.orig/include/asm-ia64/sn/intr.h 2005-12-21 22:35:23.446284291 -0600 +++ linux-2.6.14/include/asm-ia64/sn/intr.h 2005-12-21 22:38:24.094684947 -0600 @@ -3,13 +3,14 @@ * License. See the file "COPYING" in the main directory of this archive * for more details. * - * Copyright (C) 1992 - 1997, 2000-2004 Silicon Graphics, Inc. All rights reserved. + * Copyright (C) 1992 - 1997, 2000-2005 Silicon Graphics, Inc. All rights reserved. */ #ifndef _ASM_IA64_SN_INTR_H #define _ASM_IA64_SN_INTR_H #include +#include #define SGI_UART_VECTOR (0xe9) @@ -40,6 +41,7 @@ int irq_cpuid; /* kernel logical cpuid */ int irq_irq; /* the IRQ number */ int irq_int_bit; /* Bridge interrupt pin */ + /* <0 means MSI */ uint64_t irq_xtalkaddr; /* xtalkaddr IRQ is sent to */ int irq_bridge_type;/* pciio asic type (pciio.h) */ void *irq_bridge; /* bridge generating irq */ @@ -53,6 +55,12 @@ }; extern void sn_send_IPI_phys(int, long, int, int); +extern uint64_t sn_intr_alloc(nasid_t, int, + struct sn_irq_info *, + int, nasid_t, int); +extern void sn_intr_free(nasid_t, int, struct sn_irq_info *); +extern struct sn_irq_info *sn_retarget_vector(struct sn_irq_info *, nasid_t, int); +extern struct list_head **sn_irq_lh; #define CPU_VECTOR_TO_IRQ(cpuid,vector) (vector) Index: linux-2.6.14/include/asm-ia64/sn/pcibr_provider.h =================================================================== --- linux-2.6.14.orig/include/asm-ia64/sn/pcibr_provider.h 2005-12-21 22:35:23.446284291 -0600 +++ linux-2.6.14/include/asm-ia64/sn/pcibr_provider.h 2005-12-21 22:38:24.094684947 -0600 @@ -3,7 +3,7 @@ * License. See the file "COPYING" in the main directory of this archive * for more details. * - * Copyright (C) 1992-1997,2000-2004 Silicon Graphics, Inc. All rights reserved. + * Copyright (C) 1992-1997,2000-2005 Silicon Graphics, Inc. All rights reserved. */ #ifndef _ASM_IA64_SN_PCI_PCIBR_PROVIDER_H #define _ASM_IA64_SN_PCI_PCIBR_PROVIDER_H @@ -55,6 +55,7 @@ #define PCI32_ATE_V (0x1 << 0) #define PCI32_ATE_CO (0x1 << 1) #define PCI32_ATE_PREC (0x1 << 2) +#define PCI32_ATE_MSI (0x1 << 2) #define PCI32_ATE_PREF (0x1 << 3) #define PCI32_ATE_BAR (0x1 << 4) #define PCI32_ATE_ADDR_SHFT 12 @@ -129,8 +130,8 @@ extern int pcibr_init_provider(void); extern void *pcibr_bus_fixup(struct pcibus_bussoft *, struct pci_controller *); -extern dma_addr_t pcibr_dma_map(struct pci_dev *, unsigned long, size_t); -extern dma_addr_t pcibr_dma_map_consistent(struct pci_dev *, unsigned long, size_t); +extern dma_addr_t pcibr_dma_map(struct pci_dev *, unsigned long, size_t, int type); +extern dma_addr_t pcibr_dma_map_consistent(struct pci_dev *, unsigned long, size_t, int type); extern void pcibr_dma_unmap(struct pci_dev *, dma_addr_t, int); /* Index: linux-2.6.14/include/asm-ia64/sn/pcibus_provider_defs.h =================================================================== --- linux-2.6.14.orig/include/asm-ia64/sn/pcibus_provider_defs.h 2005-12-21 22:35:23.446284291 -0600 +++ linux-2.6.14/include/asm-ia64/sn/pcibus_provider_defs.h 2005-12-21 22:38:24.095684706 -0600 @@ -3,7 +3,7 @@ * License. See the file "COPYING" in the main directory of this archive * for more details. * - * Copyright (C) 1992 - 1997, 2000-2004 Silicon Graphics, Inc. All rights reserved. + * Copyright (C) 1992 - 1997, 2000-2005 Silicon Graphics, Inc. All rights reserved. */ #ifndef _ASM_IA64_SN_PCI_PCIBUS_PROVIDER_H #define _ASM_IA64_SN_PCI_PCIBUS_PROVIDER_H @@ -45,13 +45,24 @@ */ struct sn_pcibus_provider { - dma_addr_t (*dma_map)(struct pci_dev *, unsigned long, size_t); - dma_addr_t (*dma_map_consistent)(struct pci_dev *, unsigned long, size_t); + dma_addr_t (*dma_map)(struct pci_dev *, unsigned long, size_t, int flags); + dma_addr_t (*dma_map_consistent)(struct pci_dev *, unsigned long, size_t, int flags); void (*dma_unmap)(struct pci_dev *, dma_addr_t, int); void * (*bus_fixup)(struct pcibus_bussoft *, struct pci_controller *); void (*force_interrupt)(struct sn_irq_info *); void (*target_interrupt)(struct sn_irq_info *); }; +/* + * Flags used by the map interfaces + * bits 3:0 specifies format of passed in address + * bit 4 specifies that address is to be used for MSI + */ + +#define SN_DMA_ADDRTYPE(x) ((x) & 0xf) +#define SN_DMA_ADDR_PHYS 1 /* address is an xio address. */ +#define SN_DMA_ADDR_XIO 2 /* address is phys memory */ +#define SN_DMA_MSI 0x10 /* Bus address is to be used for MSI */ + extern struct sn_pcibus_provider *sn_pci_provider[]; #endif /* _ASM_IA64_SN_PCI_PCIBUS_PROVIDER_H */ Index: linux-2.6.14/include/asm-ia64/sn/tiocp.h =================================================================== --- linux-2.6.14.orig/include/asm-ia64/sn/tiocp.h 2005-12-21 22:35:23.446284291 -0600 +++ linux-2.6.14/include/asm-ia64/sn/tiocp.h 2005-12-21 22:38:24.095684706 -0600 @@ -3,13 +3,14 @@ * License. See the file "COPYING" in the main directory of this archive * for more details. * - * Copyright (C) 2003-2004 Silicon Graphics, Inc. All rights reserved. + * Copyright (C) 2003-2005 Silicon Graphics, Inc. All rights reserved. */ #ifndef _ASM_IA64_SN_PCI_TIOCP_H #define _ASM_IA64_SN_PCI_TIOCP_H #define TIOCP_HOST_INTR_ADDR 0x003FFFFFFFFFFFFFUL #define TIOCP_PCI64_CMDTYPE_MEM (0x1ull << 60) +#define TIOCP_PCI64_CMDTYPE_MSI (0x3ull << 60) /***************************************************************************** From maule at sgi.com Thu Jan 12 09:16:33 2006 From: maule at sgi.com (Mark Maule) Date: Wed, 11 Jan 2006 16:16:33 -0600 (CST) Subject: [PATCH 0/3] msi abstractions and support for altix Message-ID: <20060111221633.28765.95775.64741@attica.americas.sgi.com> Resend #4: Patch set to abstract portions of the MSI core so that it can be used on architectures which don't use standard interrupt controllers. Changes from Resend #3 + Move external declarations of msi_apic_ops out of routines, and up earlier in the respective .h files. + Add comments to the msi_ops structure declaration Changes from Resend #2 + Cleanup the ia64 platform_msi_init macro so it works on non-altix ia64 Changes from initial version + Change uintXX_t to uXX + Change _callouts to _ops + Renamed the _generic routines to _apic and moved them to a new file msi-apic.c + Have each msi_arch_init() routine call msi_register() with the desired msi ops for that platform. + Moved msi_address, msi_data, and related defs out of msi.h and into msi-apic.c, replaced by shifts/masks. + Rolled msi-arch-init.patch and msi-callouts.patch into a single msi-ops.patch Mark 1/3 msi-ops.patch Add an msi_arch_init() hook which can be used to perform platform specific setup prior to msi use. Define a set of msi ops to implement the platform-specific tasks: setup - set up plumbing to get a vector directed at a default cpu, and return the corresponding MSI bus address and data. teardown - inverse of msi_setup target - retarget a vector to a given cpu Define the routine msi_register() called from msi_arch_init() to set the desired ops. Move a bunch of apic-specific code out of the msi core .h/.c and into a new msi-apic.c file. 2/3 ia64-per-platform-device-vector.patch For the ia64 arch, allow per-platform definitions of IA64_FIRST_DEVICE_VECTOR and IA64_LAST_DEVICE_VECTOR. 3/3 msi-altix.patch Altix specific callouts to implement MSI. From maule at sgi.com Thu Jan 12 09:16:38 2006 From: maule at sgi.com (Mark Maule) Date: Wed, 11 Jan 2006 16:16:38 -0600 (CST) Subject: [PATCH 1/3] msi vector targeting abstractions In-Reply-To: <20060111221633.28765.95775.64741@attica.americas.sgi.com> References: <20060111221633.28765.95775.64741@attica.americas.sgi.com> Message-ID: <20060111221638.28765.93442.80780@attica.americas.sgi.com> Abstract portions of the MSI core for platforms that do not use standard APIC interrupt controllers. This is implemented through a new arch-specific msi setup routine, and a set of msi ops which can be set on a per platform basis. Signed-off-by: Mark Maule Index: linux-2.6/drivers/pci/msi.c =================================================================== --- linux-2.6.orig/drivers/pci/msi.c 2006-01-11 15:09:44.886491753 -0600 +++ linux-2.6/drivers/pci/msi.c 2006-01-11 16:06:16.096502865 -0600 @@ -23,8 +23,6 @@ #include "pci.h" #include "msi.h" -#define MSI_TARGET_CPU first_cpu(cpu_online_map) - static DEFINE_SPINLOCK(msi_lock); static struct msi_desc* msi_desc[NR_IRQS] = { [0 ... NR_IRQS-1] = NULL }; static kmem_cache_t* msi_cachep; @@ -40,6 +38,15 @@ u8 irq_vector[NR_IRQ_VECTORS] = { FIRST_DEVICE_VECTOR , 0 }; #endif +static struct msi_ops *msi_ops; + +int +msi_register(struct msi_ops *ops) +{ + msi_ops = ops; + return 0; +} + static void msi_cache_ctor(void *p, kmem_cache_t *cache, unsigned long flags) { memset(p, 0, NR_IRQS * sizeof(struct msi_desc)); @@ -92,7 +99,7 @@ static void set_msi_affinity(unsigned int vector, cpumask_t cpu_mask) { struct msi_desc *entry; - struct msg_address address; + u32 address_hi, address_lo; unsigned int irq = vector; unsigned int dest_cpu = first_cpu(cpu_mask); @@ -108,28 +115,36 @@ if (!(pos = pci_find_capability(entry->dev, PCI_CAP_ID_MSI))) return; + pci_read_config_dword(entry->dev, msi_upper_address_reg(pos), + &address_hi); pci_read_config_dword(entry->dev, msi_lower_address_reg(pos), - &address.lo_address.value); - address.lo_address.value &= MSI_ADDRESS_DEST_ID_MASK; - address.lo_address.value |= (cpu_physical_id(dest_cpu) << - MSI_TARGET_CPU_SHIFT); - entry->msi_attrib.current_cpu = cpu_physical_id(dest_cpu); + &address_lo); + + msi_ops->target(vector, dest_cpu, &address_hi, &address_lo); + + pci_write_config_dword(entry->dev, msi_upper_address_reg(pos), + address_hi); pci_write_config_dword(entry->dev, msi_lower_address_reg(pos), - address.lo_address.value); + address_lo); set_native_irq_info(irq, cpu_mask); break; } case PCI_CAP_ID_MSIX: { - int offset = entry->msi_attrib.entry_nr * PCI_MSIX_ENTRY_SIZE + - PCI_MSIX_ENTRY_LOWER_ADDR_OFFSET; + int offset_hi = + entry->msi_attrib.entry_nr * PCI_MSIX_ENTRY_SIZE + + PCI_MSIX_ENTRY_UPPER_ADDR_OFFSET; + int offset_lo = + entry->msi_attrib.entry_nr * PCI_MSIX_ENTRY_SIZE + + PCI_MSIX_ENTRY_LOWER_ADDR_OFFSET; + + address_hi = readl(entry->mask_base + offset_hi); + address_lo = readl(entry->mask_base + offset_lo); - address.lo_address.value = readl(entry->mask_base + offset); - address.lo_address.value &= MSI_ADDRESS_DEST_ID_MASK; - address.lo_address.value |= (cpu_physical_id(dest_cpu) << - MSI_TARGET_CPU_SHIFT); - entry->msi_attrib.current_cpu = cpu_physical_id(dest_cpu); - writel(address.lo_address.value, entry->mask_base + offset); + msi_ops->target(vector, dest_cpu, &address_hi, &address_lo); + + writel(address_hi, entry->mask_base + offset_hi); + writel(address_lo, entry->mask_base + offset_lo); set_native_irq_info(irq, cpu_mask); break; } @@ -249,30 +264,6 @@ .set_affinity = set_msi_irq_affinity }; -static void msi_data_init(struct msg_data *msi_data, - unsigned int vector) -{ - memset(msi_data, 0, sizeof(struct msg_data)); - msi_data->vector = (u8)vector; - msi_data->delivery_mode = MSI_DELIVERY_MODE; - msi_data->level = MSI_LEVEL_MODE; - msi_data->trigger = MSI_TRIGGER_MODE; -} - -static void msi_address_init(struct msg_address *msi_address) -{ - unsigned int dest_id; - unsigned long dest_phys_id = cpu_physical_id(MSI_TARGET_CPU); - - memset(msi_address, 0, sizeof(struct msg_address)); - msi_address->hi_address = (u32)0; - dest_id = (MSI_ADDRESS_HEADER << MSI_ADDRESS_HEADER_SHIFT); - msi_address->lo_address.u.dest_mode = MSI_PHYSICAL_MODE; - msi_address->lo_address.u.redirection_hint = MSI_REDIRECTION_HINT_MODE; - msi_address->lo_address.u.dest_id = dest_id; - msi_address->lo_address.value |= (dest_phys_id << MSI_TARGET_CPU_SHIFT); -} - static int msi_free_vector(struct pci_dev* dev, int vector, int reassign); static int assign_msi_vector(void) { @@ -367,6 +358,20 @@ return status; } + if ((status = msi_arch_init()) < 0) { + pci_msi_enable = 0; + printk(KERN_WARNING + "PCI: MSI arch init failed. MSI disabled.\n"); + return status; + } + + if (! msi_ops) { + printk(KERN_WARNING + "PCI: MSI ops not registered. MSI disabled.\n"); + status = -EINVAL; + return status; + } + if ((status = msi_cache_init()) < 0) { pci_msi_enable = 0; printk(KERN_WARNING "PCI: MSI cache init failed\n"); @@ -510,9 +515,11 @@ **/ static int msi_capability_init(struct pci_dev *dev) { + int status; struct msi_desc *entry; - struct msg_address address; - struct msg_data data; + u32 address_lo; + u32 address_hi; + u32 data; int pos, vector; u16 control; @@ -539,23 +546,26 @@ entry->mask_base = (void __iomem *)(long)msi_mask_bits_reg(pos, is_64bit_address(control)); } + /* Configure MSI capability structure */ + status = msi_ops->setup(dev, vector, + &address_hi, + &address_lo, + &data); + if (status < 0) { + kmem_cache_free(msi_cachep, entry); + return status; + } /* Replace with MSI handler */ irq_handler_init(PCI_CAP_ID_MSI, vector, entry->msi_attrib.maskbit); - /* Configure MSI capability structure */ - msi_address_init(&address); - msi_data_init(&data, vector); - entry->msi_attrib.current_cpu = ((address.lo_address.u.dest_id >> - MSI_TARGET_CPU_SHIFT) & MSI_TARGET_CPU_MASK); - pci_write_config_dword(dev, msi_lower_address_reg(pos), - address.lo_address.value); + + pci_write_config_dword(dev, msi_lower_address_reg(pos), address_lo); if (is_64bit_address(control)) { pci_write_config_dword(dev, - msi_upper_address_reg(pos), address.hi_address); - pci_write_config_word(dev, - msi_data_reg(pos, 1), *((u32*)&data)); + msi_upper_address_reg(pos), address_hi); + pci_write_config_word(dev, msi_data_reg(pos, 1), data); } else - pci_write_config_word(dev, - msi_data_reg(pos, 0), *((u32*)&data)); + pci_write_config_word(dev, msi_data_reg(pos, 0), data); + if (entry->msi_attrib.maskbit) { unsigned int maskbits, temp; /* All MSIs are unmasked by default, Mask them all */ @@ -590,13 +600,15 @@ struct msix_entry *entries, int nvec) { struct msi_desc *head = NULL, *tail = NULL, *entry = NULL; - struct msg_address address; - struct msg_data data; + u32 address_hi; + u32 address_lo; + u32 data; int vector, pos, i, j, nr_entries, temp = 0; u32 phys_addr, table_offset; u16 control; u8 bir; void __iomem *base; + int status; pos = pci_find_capability(dev, PCI_CAP_ID_MSIX); /* Request & Map MSI-X table region */ @@ -643,18 +655,20 @@ /* Replace with MSI-X handler */ irq_handler_init(PCI_CAP_ID_MSIX, vector, 1); /* Configure MSI-X capability structure */ - msi_address_init(&address); - msi_data_init(&data, vector); - entry->msi_attrib.current_cpu = - ((address.lo_address.u.dest_id >> - MSI_TARGET_CPU_SHIFT) & MSI_TARGET_CPU_MASK); - writel(address.lo_address.value, + status = msi_ops->setup(dev, vector, + &address_hi, + &address_lo, + &data); + if (status < 0) + break; + + writel(address_lo, base + j * PCI_MSIX_ENTRY_SIZE + PCI_MSIX_ENTRY_LOWER_ADDR_OFFSET); - writel(address.hi_address, + writel(address_hi, base + j * PCI_MSIX_ENTRY_SIZE + PCI_MSIX_ENTRY_UPPER_ADDR_OFFSET); - writel(*(u32*)&data, + writel(data, base + j * PCI_MSIX_ENTRY_SIZE + PCI_MSIX_ENTRY_DATA_OFFSET); attach_msi_entry(entry, vector); @@ -789,6 +803,8 @@ void __iomem *base; unsigned long flags; + msi_ops->teardown(vector); + spin_lock_irqsave(&msi_lock, flags); entry = msi_desc[vector]; if (!entry || entry->dev != dev) { Index: linux-2.6/include/asm-i386/msi.h =================================================================== --- linux-2.6.orig/include/asm-i386/msi.h 2006-01-11 15:09:44.888444686 -0600 +++ linux-2.6/include/asm-i386/msi.h 2006-01-11 15:10:28.932942666 -0600 @@ -12,4 +12,12 @@ #define LAST_DEVICE_VECTOR 232 #define MSI_TARGET_CPU_SHIFT 12 +extern struct msi_ops msi_apic_ops; + +static inline int msi_arch_init(void) +{ + msi_register(&msi_apic_ops); + return 0; +} + #endif /* ASM_MSI_H */ Index: linux-2.6/include/asm-x86_64/msi.h =================================================================== --- linux-2.6.orig/include/asm-x86_64/msi.h 2006-01-11 15:09:44.888444686 -0600 +++ linux-2.6/include/asm-x86_64/msi.h 2006-01-11 15:10:35.927372212 -0600 @@ -13,4 +13,12 @@ #define LAST_DEVICE_VECTOR 232 #define MSI_TARGET_CPU_SHIFT 12 +extern struct msi_ops msi_apic_ops; + +static inline int msi_arch_init(void) +{ + msi_register_apic(&msi_apic_ops); + return 0; +} + #endif /* ASM_MSI_H */ Index: linux-2.6/include/asm-ia64/machvec.h =================================================================== --- linux-2.6.orig/include/asm-ia64/machvec.h 2006-01-11 15:09:44.888444686 -0600 +++ linux-2.6/include/asm-ia64/machvec.h 2006-01-11 15:09:58.266035744 -0600 @@ -74,6 +74,7 @@ typedef unsigned short ia64_mv_readw_relaxed_t (const volatile void __iomem *); typedef unsigned int ia64_mv_readl_relaxed_t (const volatile void __iomem *); typedef unsigned long ia64_mv_readq_relaxed_t (const volatile void __iomem *); +typedef int ia64_mv_msi_init_t (void); static inline void machvec_noop (void) @@ -146,6 +147,7 @@ # define platform_readw_relaxed ia64_mv.readw_relaxed # define platform_readl_relaxed ia64_mv.readl_relaxed # define platform_readq_relaxed ia64_mv.readq_relaxed +# define platform_msi_init ia64_mv.msi_init # endif /* __attribute__((__aligned__(16))) is required to make size of the @@ -194,6 +196,7 @@ ia64_mv_readw_relaxed_t *readw_relaxed; ia64_mv_readl_relaxed_t *readl_relaxed; ia64_mv_readq_relaxed_t *readq_relaxed; + ia64_mv_msi_init_t *msi_init; } __attribute__((__aligned__(16))); /* align attrib? see above comment */ #define MACHVEC_INIT(name) \ @@ -238,6 +241,7 @@ platform_readw_relaxed, \ platform_readl_relaxed, \ platform_readq_relaxed, \ + platform_msi_init, \ } extern struct ia64_machine_vector ia64_mv; @@ -386,5 +390,8 @@ #ifndef platform_readq_relaxed # define platform_readq_relaxed __ia64_readq_relaxed #endif +#ifndef platform_msi_init +# define platform_msi_init ia64_msi_init +#endif #endif /* _ASM_IA64_MACHVEC_H */ Index: linux-2.6/include/asm-ia64/machvec_sn2.h =================================================================== --- linux-2.6.orig/include/asm-ia64/machvec_sn2.h 2006-01-11 15:09:44.889421152 -0600 +++ linux-2.6/include/asm-ia64/machvec_sn2.h 2006-01-11 15:09:58.267012210 -0600 @@ -71,6 +71,7 @@ extern ia64_mv_dma_sync_sg_for_device sn_dma_sync_sg_for_device; extern ia64_mv_dma_mapping_error sn_dma_mapping_error; extern ia64_mv_dma_supported sn_dma_supported; +extern ia64_mv_msi_init_t sn_msi_init; /* * This stuff has dual use! @@ -120,6 +121,7 @@ #define platform_dma_sync_sg_for_device sn_dma_sync_sg_for_device #define platform_dma_mapping_error sn_dma_mapping_error #define platform_dma_supported sn_dma_supported +#define platform_msi_init sn_msi_init #include Index: linux-2.6/include/asm-ia64/msi.h =================================================================== --- linux-2.6.orig/include/asm-ia64/msi.h 2006-01-11 15:09:44.889421152 -0600 +++ linux-2.6/include/asm-ia64/msi.h 2006-01-11 15:10:44.146290750 -0600 @@ -14,4 +14,15 @@ #define ack_APIC_irq ia64_eoi #define MSI_TARGET_CPU_SHIFT 4 +extern struct msi_ops msi_apic_ops; + +/* default ia64 msi init routine */ +static inline int ia64_msi_init(void) +{ + msi_register(&msi_apic_ops); + return 0; +} + +#define msi_arch_init platform_msi_init + #endif /* ASM_MSI_H */ Index: linux-2.6/arch/ia64/sn/pci/Makefile =================================================================== --- linux-2.6.orig/arch/ia64/sn/pci/Makefile 2006-01-11 15:09:44.890397619 -0600 +++ linux-2.6/arch/ia64/sn/pci/Makefile 2006-01-11 15:09:58.270918076 -0600 @@ -3,8 +3,9 @@ # License. See the file "COPYING" in the main directory of this archive # for more details. # -# Copyright (C) 2000-2004 Silicon Graphics, Inc. All Rights Reserved. +# Copyright (C) 2000-2005 Silicon Graphics, Inc. All Rights Reserved. # # Makefile for the sn pci general routines. obj-y := pci_dma.o tioca_provider.o tioce_provider.o pcibr/ +obj-$(CONFIG_PCI_MSI) += msi.o Index: linux-2.6/arch/ia64/sn/pci/msi.c =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 +++ linux-2.6/arch/ia64/sn/pci/msi.c 2006-01-11 16:06:14.504862843 -0600 @@ -0,0 +1,18 @@ +/* + * This file is subject to the terms and conditions of the GNU General Public + * License. See the file "COPYING" in the main directory of this archive + * for more details. + * + * Copyright (C) 2005 Silicon Graphics, Inc. All Rights Reserved. + */ + +#include + +int +sn_msi_init(void) +{ + /* + * return error until MSI is supported on altix platforms + */ + return -EINVAL; +} Index: linux-2.6/drivers/pci/Makefile =================================================================== --- linux-2.6.orig/drivers/pci/Makefile 2006-01-11 15:09:44.887468219 -0600 +++ linux-2.6/drivers/pci/Makefile 2006-01-11 15:09:58.271894543 -0600 @@ -26,7 +26,7 @@ obj-$(CONFIG_PPC64) += setup-bus.o obj-$(CONFIG_MIPS) += setup-bus.o setup-irq.o obj-$(CONFIG_X86_VISWS) += setup-irq.o -obj-$(CONFIG_PCI_MSI) += msi.o +obj-$(CONFIG_PCI_MSI) += msi.o msi-apic.o # # ACPI Related PCI FW Functions Index: linux-2.6/drivers/pci/msi-apic.c =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 +++ linux-2.6/drivers/pci/msi-apic.c 2006-01-11 16:07:17.131503734 -0600 @@ -0,0 +1,100 @@ +/* + * MSI hooks for standard x86 apic + */ + +#include +#include + +#include "msi.h" + +/* + * Shifts for APIC-based data + */ + +#define MSI_DATA_VECTOR_SHIFT 0 +#define MSI_DATA_VECTOR(v) (((u8)v) << MSI_DATA_VECTOR_SHIFT) + +#define MSI_DATA_DELIVERY_SHIFT 8 +#define MSI_DATA_DELIVERY_FIXED (0 << MSI_DATA_DELIVERY_SHIFT) +#define MSI_DATA_DELIVERY_LOWPRI (1 << MSI_DATA_DELIVERY_SHIFT) + +#define MSI_DATA_LEVEL_SHIFT 14 +#define MSI_DATA_LEVEL_DEASSERT (0 << MSI_DATA_LEVEL_SHIFT) +#define MSI_DATA_LEVEL_ASSERT (1 << MSI_DATA_LEVEL_SHIFT) + +#define MSI_DATA_TRIGGER_SHIFT 15 +#define MSI_DATA_TRIGGER_EDGE (0 << MSI_DATA_TRIGGER_SHIFT) +#define MSI_DATA_TRIGGER_LEVEL (1 << MSI_DATA_TRIGGER_SHIFT) + +/* + * Shift/mask fields for APIC-based bus address + */ + +#define MSI_ADDR_HEADER 0xfee00000 + +#define MSI_ADDR_DESTID_MASK 0xfff0000f +#define MSI_ADDR_DESTID_CPU(cpu) ((cpu) << MSI_TARGET_CPU_SHIFT) + +#define MSI_ADDR_DESTMODE_SHIFT 2 +#define MSI_ADDR_DESTMODE_PHYS (0 << MSI_ADDR_DESTMODE_SHIFT) +#define MSI_ADDR_DESTMODE_LOGIC (1 << MSI_ADDR_DESTMODE_SHIFT) + +#define MSI_ADDR_REDIRECTION_SHIFT 3 +#define MSI_ADDR_REDIRECTION_CPU (0 << MSI_ADDR_REDIRECTION_SHIFT) +#define MSI_ADDR_REDIRECTION_LOWPRI (1 << MSI_ADDR_REDIRECTION_SHIFT) + + +static void +msi_target_apic(unsigned int vector, + unsigned int dest_cpu, + u32 *address_hi, /* in/out */ + u32 *address_lo) /* in/out */ +{ + u32 addr = *address_lo; + + addr &= MSI_ADDR_DESTID_MASK; + addr |= MSI_ADDR_DESTID_CPU(cpu_physical_id(dest_cpu)); + + *address_lo = addr; +} + +static int +msi_setup_apic(struct pci_dev *pdev, /* unused in generic */ + unsigned int vector, + u32 *address_hi, + u32 *address_lo, + u32 *data) +{ + unsigned long dest_phys_id; + + dest_phys_id = cpu_physical_id(first_cpu(cpu_online_map)); + + *address_hi = 0; + *address_lo = MSI_ADDR_HEADER | + MSI_ADDR_DESTMODE_PHYS | + MSI_ADDR_REDIRECTION_CPU | + MSI_ADDR_DESTID_CPU(dest_phys_id); + + *data = MSI_DATA_TRIGGER_EDGE | + MSI_DATA_LEVEL_ASSERT | + MSI_DATA_DELIVERY_FIXED | + MSI_DATA_VECTOR(vector); + + return 0; +} + +static void +msi_teardown_apic(unsigned int vector) +{ + return; /* no-op */ +} + +/* + * Generic ops used on most IA archs/platforms. Set with msi_register() + */ + +struct msi_ops msi_apic_ops = { + .setup = msi_setup_apic, + .teardown = msi_teardown_apic, + .target = msi_target_apic, +}; Index: linux-2.6/drivers/pci/msi.h =================================================================== --- linux-2.6.orig/drivers/pci/msi.h 2006-01-11 15:09:44.887468219 -0600 +++ linux-2.6/drivers/pci/msi.h 2006-01-11 15:09:58.275800409 -0600 @@ -69,67 +69,6 @@ #define msix_mask(address) (address | PCI_MSIX_FLAGS_BITMASK) #define msix_is_pending(address) (address & PCI_MSIX_FLAGS_PENDMASK) -/* - * MSI Defined Data Structures - */ -#define MSI_ADDRESS_HEADER 0xfee -#define MSI_ADDRESS_HEADER_SHIFT 12 -#define MSI_ADDRESS_HEADER_MASK 0xfff000 -#define MSI_ADDRESS_DEST_ID_MASK 0xfff0000f -#define MSI_TARGET_CPU_MASK 0xff -#define MSI_DELIVERY_MODE 0 -#define MSI_LEVEL_MODE 1 /* Edge always assert */ -#define MSI_TRIGGER_MODE 0 /* MSI is edge sensitive */ -#define MSI_PHYSICAL_MODE 0 -#define MSI_LOGICAL_MODE 1 -#define MSI_REDIRECTION_HINT_MODE 0 - -struct msg_data { -#if defined(__LITTLE_ENDIAN_BITFIELD) - __u32 vector : 8; - __u32 delivery_mode : 3; /* 000b: FIXED | 001b: lowest prior */ - __u32 reserved_1 : 3; - __u32 level : 1; /* 0: deassert | 1: assert */ - __u32 trigger : 1; /* 0: edge | 1: level */ - __u32 reserved_2 : 16; -#elif defined(__BIG_ENDIAN_BITFIELD) - __u32 reserved_2 : 16; - __u32 trigger : 1; /* 0: edge | 1: level */ - __u32 level : 1; /* 0: deassert | 1: assert */ - __u32 reserved_1 : 3; - __u32 delivery_mode : 3; /* 000b: FIXED | 001b: lowest prior */ - __u32 vector : 8; -#else -#error "Bitfield endianness not defined! Check your byteorder.h" -#endif -} __attribute__ ((packed)); - -struct msg_address { - union { - struct { -#if defined(__LITTLE_ENDIAN_BITFIELD) - __u32 reserved_1 : 2; - __u32 dest_mode : 1; /*0:physic | 1:logic */ - __u32 redirection_hint: 1; /*0: dedicated CPU - 1: lowest priority */ - __u32 reserved_2 : 4; - __u32 dest_id : 24; /* Destination ID */ -#elif defined(__BIG_ENDIAN_BITFIELD) - __u32 dest_id : 24; /* Destination ID */ - __u32 reserved_2 : 4; - __u32 redirection_hint: 1; /*0: dedicated CPU - 1: lowest priority */ - __u32 dest_mode : 1; /*0:physic | 1:logic */ - __u32 reserved_1 : 2; -#else -#error "Bitfield endianness not defined! Check your byteorder.h" -#endif - }u; - __u32 value; - }lo_address; - __u32 hi_address; -} __attribute__ ((packed)); - struct msi_desc { struct { __u8 type : 5; /* {0: unused, 5h:MSI, 11h:MSI-X} */ @@ -138,7 +77,7 @@ __u8 reserved: 1; /* reserved */ __u8 entry_nr; /* specific enabled entry */ __u8 default_vector; /* default pre-assigned vector */ - __u8 current_cpu; /* current destination cpu */ + __u8 unused; /* formerly unused destination cpu*/ }msi_attrib; struct { Index: linux-2.6/include/linux/pci.h =================================================================== --- linux-2.6.orig/include/linux/pci.h 2006-01-11 15:09:44.889421152 -0600 +++ linux-2.6/include/linux/pci.h 2006-01-11 15:59:55.573460347 -0600 @@ -547,6 +547,66 @@ u16 entry; /* driver uses to specify entry, OS writes */ }; +/* + * MSI operation vector. Used by the msi core code (drivers/pci/msi.c) + * to abstract platform-specific tasks relating to MSI address generation + * and resource management. + */ +struct msi_ops { + /** + * setup - generate an MSI bus address and data for a given vector + * @pdev: PCI device context (in) + * @vector: vector allocated by the msi core (in) + * @addr_hi: upper 32 bits of PCI bus MSI address (out) + * @addr_lo: lower 32 bits of PCI bus MSI address (out) + * @data: MSI data payload (out) + * + * Description: The setup op is used to generate a PCI bus addres and + * data which the msi core will program into the card MSI capability + * registers. The setup routine is responsible for picking an initial + * cpu to target the MSI at. The setup routine is responsible for + * examining pdev to determine the MSI capabilities of the card and + * generating a suitable address/data. The setup routine is + * responsible for allocating and tracking any system resources it + * needs to route the MSI to the cpu it picks, and for associating + * those resources with the passed in vector. + * + * Returns 0 if the MSI address/data was successfully setup. + **/ + + int (*setup) (struct pci_dev *pdev, unsigned int vector, + u32 *addr_hi, u32 *addr_lo, u32 *data); + + /** + * teardown - release resources allocated by setup + * @vector: vector context for resources (in) + * + * Description: The teardown op is used to release any resources + * that were allocated in the setup routine associated with the passed + * in vector. + **/ + + void (*teardown) (unsigned int vector); + + /** + * target - retarget an MSI at a different cpu + * @vector: vector context for resources (in) + * @cpu: new cpu to direct vector at (in) + * @addr_hi: new value of PCI bus upper 32 bits (in/out) + * @addr_lo: new value of PCI bus lower 32 bits (in/out) + * + * Description: The target op is used to redirect an MSI vector + * at a different cpu. addr_hi/addr_lo coming in are the existing + * values that the MSI core has programmed into the card. The + * target code is responsible for freeing any resources (if any) + * associated with the old address, and generating a new PCI bus + * addr_hi/addr_lo that will redirect the vector at the indicated cpu. + **/ + + void (*target) (unsigned int vector, unsigned int cpu, + u32 *addr_hi, u32 *addr_lo); +}; + #ifndef CONFIG_PCI_MSI static inline void pci_scan_msi_device(struct pci_dev *dev) {} static inline int pci_enable_msi(struct pci_dev *dev) {return -1;} @@ -555,6 +615,7 @@ struct msix_entry *entries, int nvec) {return -1;} static inline void pci_disable_msix(struct pci_dev *dev) {} static inline void msi_remove_pci_irq_vectors(struct pci_dev *dev) {} +static inline int msi_register(struct msi_ops *ops) {return -1;} #else extern void pci_scan_msi_device(struct pci_dev *dev); extern int pci_enable_msi(struct pci_dev *dev); @@ -563,6 +624,7 @@ struct msix_entry *entries, int nvec); extern void pci_disable_msix(struct pci_dev *dev); extern void msi_remove_pci_irq_vectors(struct pci_dev *dev); +extern int msi_register(struct msi_ops *ops); #endif extern void pci_block_user_cfg_access(struct pci_dev *dev); From arnd at arndb.de Thu Jan 12 09:32:37 2006 From: arnd at arndb.de (Arnd Bergmann) Date: Wed, 11 Jan 2006 22:32:37 +0000 Subject: [PATCH 2/5] powerpc: proc_device_tree remove and update functions In-Reply-To: <1137016206.5138.34.camel@localhost.localdomain> References: <20060111100128.GE30507@cs.umn.edu> <1137016206.5138.34.camel@localhost.localdomain> Message-ID: <200601112232.38192.arnd@arndb.de> On Wednesday 11 January 2006 21:50, Benjamin Herrenschmidt wrote: > I think we should move to a filesystem instead. It should be fairly > trivial (look at sun's openpromfs for example) openpromfs predates most of libfs, which means it is a lot more complicated than necessary already, and it doesn't fit the powerpc representation of device_node very well. It's probably easier to write a new libfs based file system for device nodes than to use the existing openpromfs. Once we have that, it could even be possible to move sparc over to use the new fs ;-) However, I still think the better solution would be to use sysfs instead. It is already pretty clever regarding memory allocation and easy to use. The /sys/firmware/ hierarchy actually is made for exactly this kind of scenario and it is currently unused on powerpc. The biggest advantage here would be that we can easily describe the relation between OF device nodes and the linux device tree by using sysfs_create_link(). Do you see any strong reason against using sysfs? Arnd <>< From benh at kernel.crashing.org Thu Jan 12 09:43:20 2006 From: benh at kernel.crashing.org (Benjamin Herrenschmidt) Date: Thu, 12 Jan 2006 09:43:20 +1100 Subject: [PATCH 2/5] powerpc: proc_device_tree remove and update functions In-Reply-To: <200601112232.38192.arnd@arndb.de> References: <20060111100128.GE30507@cs.umn.edu> <1137016206.5138.34.camel@localhost.localdomain> <200601112232.38192.arnd@arndb.de> Message-ID: <1137019401.5138.46.camel@localhost.localdomain> On Wed, 2006-01-11 at 22:32 +0000, Arnd Bergmann wrote: > On Wednesday 11 January 2006 21:50, Benjamin Herrenschmidt wrote: > > I think we should move to a filesystem instead. It should be fairly > > trivial (look at sun's openpromfs for example) > > openpromfs predates most of libfs, which means it is a lot more > complicated than necessary already, and it doesn't fit the powerpc > representation of device_node very well. Yeah, well, it was just an example ;) In fact, if you think it's too complicated, then what is simple ? :) (openpromfs looks trivial enough). One of the big thing we want is to stop eating loads of memory on machines with gazillion nodes (typically big memory machines have gazillion of /memory@* nodes) among others. We want dentries & inodes to be created on the fly and purged automatically. > It's probably easier to write a new libfs based file system for > device nodes than to use the existing openpromfs. Once we have > that, it could even be possible to move sparc over to use the > new fs ;-) Hehe. > However, I still think the better solution would be to use sysfs > instead. It is already pretty clever regarding memory allocation > and easy to use. The /sys/firmware/ hierarchy actually is made > for exactly this kind of scenario and it is currently unused on > powerpc. > The biggest advantage here would be that we can easily describe > the relation between OF device nodes and the linux device tree > by using sysfs_create_link(). > > Do you see any strong reason against using sysfs? Yes, the fact that we have to allocate everything like we do for proc. Also, a special file system can be mounted on /proc/device-tree so is easily backward compatible with existing userland tools. Ben. From sleddog at us.ibm.com Thu Jan 12 09:48:30 2006 From: sleddog at us.ibm.com (Dave C Boutcher) Date: Wed, 11 Jan 2006 16:48:30 -0600 Subject: [PATCH] powerpc: add ibm,suspend-me rtas interface In-Reply-To: <1137016074.5138.28.camel@localhost.localdomain> References: <20060111095633.GB30507@cs.umn.edu> <20060111171252.GD2491@pb15.lixom.net> <20060111174353.GA1867@cs.umn.edu> <1137016074.5138.28.camel@localhost.localdomain> Message-ID: <20060111224830.GA4223@cs.umn.edu> On Thu, Jan 12, 2006 at 08:47:54AM +1100, Benjamin Herrenschmidt wrote: > > > > > This suspend is not (sigh) the same as linux suspend. I might have > > tried to rename it something different, but the RTAS call is > > "ibm,suspend-me". This is going to be driven by the HMC ultimately. > > > > This function doesn't preclude someone implementing one of the Linux > > swsusp versions on Power (and in fact Santi was working on that last > > year.) > > What is it then ? Linux "suspend" means any kind of maching suspend, > wether it's to RAM or to disk. If this calls suspends operations on the > partition, it should probably be hooked to the linux PM framework. This > is regardless of wether suspend to disk is implemented or not for ppc64. The only time this gets used is when the HMC wants to bring the OS to a sync point. It is not a generic linux-initiated suspend thing. Properly this should just be a generic RTAS call from user-land, except that there is this wierd dance that has to occur with some hypervisor calls. There is no need (or desire) to tie into (for example) all the device-suspend/resume stuff. I wish they had called the RTAS call "OS-sync" or something. -- Dave Boutcher From sleddog at us.ibm.com Thu Jan 12 09:49:15 2006 From: sleddog at us.ibm.com (Dave C Boutcher) Date: Wed, 11 Jan 2006 16:49:15 -0600 Subject: [PATCH 0/5] powerpc: add device tree property updates In-Reply-To: <1137016134.5138.30.camel@localhost.localdomain> References: <20060111095921.GC30507@cs.umn.edu> <1137016134.5138.30.camel@localhost.localdomain> Message-ID: <20060111224915.GB4223@cs.umn.edu> On Thu, Jan 12, 2006 at 08:48:54AM +1100, Benjamin Herrenschmidt wrote: > Looks like it's really time to turn /proc/device-tree into a > filesystem... that will solve most of the problems of having properties > or nodes changing. And/or move it to sysfs. -- Dave Boutcher From benh at kernel.crashing.org Thu Jan 12 09:54:39 2006 From: benh at kernel.crashing.org (Benjamin Herrenschmidt) Date: Thu, 12 Jan 2006 09:54:39 +1100 Subject: [PATCH 0/5] powerpc: add device tree property updates In-Reply-To: <20060111224915.GB4223@cs.umn.edu> References: <20060111095921.GC30507@cs.umn.edu> <1137016134.5138.30.camel@localhost.localdomain> <20060111224915.GB4223@cs.umn.edu> Message-ID: <1137020080.5138.52.camel@localhost.localdomain> On Wed, 2006-01-11 at 16:49 -0600, Dave C Boutcher wrote: > On Thu, Jan 12, 2006 at 08:48:54AM +1100, Benjamin Herrenschmidt wrote: > > Looks like it's really time to turn /proc/device-tree into a > > filesystem... that will solve most of the problems of having properties > > or nodes changing. > > And/or move it to sysfs. Yah, but I do prefer a filesystem ;) Ben. From sleddog at us.ibm.com Thu Jan 12 09:57:42 2006 From: sleddog at us.ibm.com (Dave C Boutcher) Date: Wed, 11 Jan 2006 16:57:42 -0600 Subject: [PATCH 2/5] powerpc: proc_device_tree remove and update functions In-Reply-To: <1137019401.5138.46.camel@localhost.localdomain> References: <20060111100128.GE30507@cs.umn.edu> <1137016206.5138.34.camel@localhost.localdomain> <200601112232.38192.arnd@arndb.de> <1137019401.5138.46.camel@localhost.localdomain> Message-ID: <20060111225742.GD4223@cs.umn.edu> On Thu, Jan 12, 2006 at 09:43:20AM +1100, Benjamin Herrenschmidt wrote: > On Wed, 2006-01-11 at 22:32 +0000, Arnd Bergmann wrote: > > On Wednesday 11 January 2006 21:50, Benjamin Herrenschmidt wrote: > > > I think we should move to a filesystem instead. It should be fairly > > > trivial (look at sun's openpromfs for example) > > > > openpromfs predates most of libfs, which means it is a lot more > > complicated than necessary already, and it doesn't fit the powerpc > > representation of device_node very well. > > Yeah, well, it was just an example ;) In fact, if you think it's too > complicated, then what is simple ? :) (openpromfs looks trivial enough). > > One of the big thing we want is to stop eating loads of memory on > machines with gazillion nodes (typically big memory machines have > gazillion of /memory@* nodes) among others. We want dentries & inodes to > be created on the fly and purged automatically. Actually, from just having swam around in the code for a while, I think the procfs part is less problematic than the way we deal with the device tree in the kernel. The whole "get_property() returning a no-lifetime pointer to some data" part is more of an architecture issue than the userland filesystem part. But changing that is going to be a mess. -- Dave Boutcher From benh at kernel.crashing.org Thu Jan 12 10:01:59 2006 From: benh at kernel.crashing.org (Benjamin Herrenschmidt) Date: Thu, 12 Jan 2006 10:01:59 +1100 Subject: [PATCH 2/5] powerpc: proc_device_tree remove and update functions In-Reply-To: <20060111225742.GD4223@cs.umn.edu> References: <20060111100128.GE30507@cs.umn.edu> <1137016206.5138.34.camel@localhost.localdomain> <200601112232.38192.arnd@arndb.de> <1137019401.5138.46.camel@localhost.localdomain> <20060111225742.GD4223@cs.umn.edu> Message-ID: <1137020519.5138.56.camel@localhost.localdomain> On Wed, 2006-01-11 at 16:57 -0600, Dave C Boutcher wrote: > On Thu, Jan 12, 2006 at 09:43:20AM +1100, Benjamin Herrenschmidt wrote: > > On Wed, 2006-01-11 at 22:32 +0000, Arnd Bergmann wrote: > > > On Wednesday 11 January 2006 21:50, Benjamin Herrenschmidt wrote: > > > > I think we should move to a filesystem instead. It should be fairly > > > > trivial (look at sun's openpromfs for example) > > > > > > openpromfs predates most of libfs, which means it is a lot more > > > complicated than necessary already, and it doesn't fit the powerpc > > > representation of device_node very well. > > > > Yeah, well, it was just an example ;) In fact, if you think it's too > > complicated, then what is simple ? :) (openpromfs looks trivial enough). > > > > One of the big thing we want is to stop eating loads of memory on > > machines with gazillion nodes (typically big memory machines have > > gazillion of /memory@* nodes) among others. We want dentries & inodes to > > be created on the fly and purged automatically. > > Actually, from just having swam around in the code for a while, I think > the procfs part is less problematic than the way we deal with the device > tree in the kernel. The whole "get_property() returning a no-lifetime > pointer to some data" part is more of an architecture issue than the > userland filesystem part. But changing that is going to be a mess. Agreed, it was never meant to add/remove properties, thus the lifetime of properties was based on the lifetime of nodes... Also, there are issues with node addition/removal fs. the iterators too. If you iterate, at one point, you hold a reference to node A which contains a next pointer to node B. Somebody removes node B behind your back, then you try to iterate for the next node -> kaboom. Similar problem all over the kernel with the lists, we probably need a real iterator objects _or_ make global rwsem that must be taken around iterations (and taken for write around modifications to the tree structure). Ben. From arnd at arndb.de Thu Jan 12 09:35:36 2006 From: arnd at arndb.de (Arnd Bergmann) Date: Wed, 11 Jan 2006 22:35:36 +0000 Subject: [patch 0/5] powerpc namespace cleanups: make symbols static Message-ID: <20060111223536.198580000@klappe.arndb.de> As Milton mentioned, there is a symbol in one of my drivers, that is not used anywhere else, so it should not be in the global name space but marked 'static'. Since making symbols static used to be one of my pet projects, I couldn't let this stand and tried to find all symbols that can be made static in the 64 bit powerpc allyesconfig build. This series is what I found. Arnd <>< -- From arnd at arndb.de Wed Jan 11 11:00:03 2006 From: arnd at arndb.de (Arnd Bergmann) Date: Wed, 11 Jan 2006 00:00:03 +0000 Subject: [patch 3/5] powerpc: pmac namespace cleanup References: <20060111223536.198580000@klappe.arndb.de> Message-ID: <20060111224040.816617000@klappe.arndb.de> An embedded and charset-unspecified text was scrubbed... Name: pmac-namespace.diff Url: http://ozlabs.org/pipermail/linuxppc64-dev/attachments/20060111/adde17df/attachment.txt From arnd at arndb.de Wed Jan 11 11:00:02 2006 From: arnd at arndb.de (Arnd Bergmann) Date: Wed, 11 Jan 2006 00:00:02 +0000 Subject: [patch 2/5] powerpc: pseries namespace cleanup References: <20060111223536.198580000@klappe.arndb.de> Message-ID: <20060111224040.460150000@klappe.arndb.de> An embedded and charset-unspecified text was scrubbed... Name: pseries-namespace.diff Url: http://ozlabs.org/pipermail/linuxppc64-dev/attachments/20060111/43a1c1d8/attachment.txt From arnd at arndb.de Wed Jan 11 11:00:01 2006 From: arnd at arndb.de (Arnd Bergmann) Date: Wed, 11 Jan 2006 00:00:01 +0000 Subject: [patch 1/5] powerpc: arch/powerpc/{kernel,mm} namespace cleanup References: <20060111223536.198580000@klappe.arndb.de> Message-ID: <20060111224040.202775000@klappe.arndb.de> An embedded and charset-unspecified text was scrubbed... Name: powerpc-namespace.diff Url: http://ozlabs.org/pipermail/linuxppc64-dev/attachments/20060111/46c2c189/attachment.txt From arnd at arndb.de Wed Jan 11 11:00:05 2006 From: arnd at arndb.de (Arnd Bergmann) Date: Wed, 11 Jan 2006 00:00:05 +0000 Subject: [patch 5/5] powerpc: xmon namespace cleanups References: <20060111223536.198580000@klappe.arndb.de> Message-ID: <20060111224041.529585000@klappe.arndb.de> An embedded and charset-unspecified text was scrubbed... Name: xmon-namespace.diff Url: http://ozlabs.org/pipermail/linuxppc64-dev/attachments/20060111/b54c485f/attachment.txt From arnd at arndb.de Thu Jan 12 10:07:11 2006 From: arnd at arndb.de (Arnd Bergmann) Date: Wed, 11 Jan 2006 23:07:11 +0000 Subject: [patch 4/5] powerpc: cell namespace cleanup References: <20060111223536.198580000@klappe.arndb.de> Message-ID: <200601112307.12092.arnd@arndb.de> These symbols are only used in the file that they are defined in, so they should not be in the global namespace. Signed-off-by: Arnd Bergmann --- linux-cg.orig/arch/powerpc/platforms/cell/setup.c 2006-01-11 15:05:14.000000000 +0000 +++ linux-cg/arch/powerpc/platforms/cell/setup.c 2006-01-11 15:05:33.000000000 +0000 @@ -57,7 +57,7 @@ #define DBG(fmt...) #endif -void cell_show_cpuinfo(struct seq_file *m) +static void cell_show_cpuinfo(struct seq_file *m) { struct device_node *root; const char *model = ""; Index: linux-cg/arch/powerpc/platforms/cell/pervasive.c =================================================================== --- linux-cg.orig/arch/powerpc/platforms/cell/pervasive.c 2006-01-11 15:05:14.000000000 +0000 +++ linux-cg/arch/powerpc/platforms/cell/pervasive.c 2006-01-11 15:05:33.000000000 +0000 @@ -142,7 +142,7 @@ } } -int cbe_system_reset_exception(struct pt_regs *regs) +static int cbe_system_reset_exception(struct pt_regs *regs) { switch (regs->msr & SRR1_WAKEMASK) { case SRR1_WAKEEE: Index: linux-cg/arch/powerpc/platforms/cell/spufs/syscalls.c =================================================================== --- linux-cg.orig/arch/powerpc/platforms/cell/spufs/syscalls.c 2006-01-11 15:05:30.000000000 +0000 +++ linux-cg/arch/powerpc/platforms/cell/spufs/syscalls.c 2006-01-11 15:05:35.000000000 +0000 @@ -29,7 +29,9 @@ * value of the spu_status register after the SPU has stopped. * */ -long do_spu_run(struct file *filp, __u32 __user *unpc, __u32 __user *ustatus) +static long do_spu_run(struct file *filp, + __u32 __user *unpc, + __u32 __user *ustatus) { long ret; struct spufs_inode_info *i; -- From paulus at samba.org Thu Jan 12 10:59:07 2006 From: paulus at samba.org (Paul Mackerras) Date: Thu, 12 Jan 2006 10:59:07 +1100 Subject: [PATCH] powerpc: add ibm,suspend-me rtas interface In-Reply-To: <20060111224830.GA4223@cs.umn.edu> References: <20060111095633.GB30507@cs.umn.edu> <20060111171252.GD2491@pb15.lixom.net> <20060111174353.GA1867@cs.umn.edu> <1137016074.5138.28.camel@localhost.localdomain> <20060111224830.GA4223@cs.umn.edu> Message-ID: <17349.39883.223457.362888@cargo.ozlabs.ibm.com> Dave C Boutcher writes: > I wish they had called the RTAS call "OS-sync" or something. There's no reason why the userlevel interface can't use "sync" or or "hmcsync" or "hvsync", is there? Are there going to be any other values that we might want to write to /proc/ppc64/platform_state? If not, why not just have a /proc/ppc64/hmcsync instead, and have any (non-zero length) write to it invoke the RTAS call? Paul. From galak at gate.crashing.org Thu Jan 12 10:57:13 2006 From: galak at gate.crashing.org (Kumar Gala) Date: Wed, 11 Jan 2006 17:57:13 -0600 (CST) Subject: [PATCH] powerpc: Fixed memory reserve map layout Message-ID: powerpc: Fixed memory reserve map layout The memory reserve map is suppose to be a pair of 64-bit integers to represent each region. On ppc32 the code was treating the pair as two 32-bit integers. Additional the prom_init code was producing the wrong layout on ppc32. Added a simple check to try to provide backwards compatibility. Signed-off-by: Kumar Gala --- commit dc15eeb7325279bf9e5b49f79567fa0886cd8c31 tree e724bd9d855d5f2a71720742c7ec279609c1aaaa parent aa30a75885b935a7f09a1312e792f96cc338e505 author Kumar Gala Wed, 11 Jan 2006 18:02:36 -0600 committer Kumar Gala Wed, 11 Jan 2006 18:02:36 -0600 arch/powerpc/kernel/prom.c | 28 ++++++++++++++++++++++++---- arch/powerpc/kernel/prom_init.c | 8 ++++---- 2 files changed, 28 insertions(+), 8 deletions(-) diff --git a/arch/powerpc/kernel/prom.c b/arch/powerpc/kernel/prom.c index 34ab0da..02e2115 100644 --- a/arch/powerpc/kernel/prom.c +++ b/arch/powerpc/kernel/prom.c @@ -1100,17 +1100,37 @@ static int __init early_init_dt_scan_mem static void __init early_reserve_mem(void) { - unsigned long base, size; - unsigned long *reserve_map; + u64 base, size; + u64 *reserve_map; - reserve_map = (unsigned long *)(((unsigned long)initial_boot_params) + + reserve_map = (u64 *)(((unsigned long)initial_boot_params) + initial_boot_params->off_mem_rsvmap); +#ifdef CONFIG_PPC32 + /* + * Handle the case where we might be booting from an old kexec + * image that setup the mem_rsvmap as pairs of 32-bit values + */ + if (*reserve_map > 0xffffffffull) { + u32 base_32, size_32; + u32 *reserve_map_32 = (u32 *)reserve_map; + + while (1) { + base_32 = *(reserve_map_32++); + size_32 = *(reserve_map_32++); + if (size_32 == 0) + break; + DBG("reserving: %lx -> %lx\n", base_32, size_32); + lmb_reserve(base_32, size_32); + } + return; + } +#endif while (1) { base = *(reserve_map++); size = *(reserve_map++); if (size == 0) break; - DBG("reserving: %lx -> %lx\n", base, size); + DBG("reserving: %llx -> %llx\n", base, size); lmb_reserve(base, size); } diff --git a/arch/powerpc/kernel/prom_init.c b/arch/powerpc/kernel/prom_init.c index e381f2f..d963a12 100644 --- a/arch/powerpc/kernel/prom_init.c +++ b/arch/powerpc/kernel/prom_init.c @@ -137,8 +137,8 @@ struct prom_t { }; struct mem_map_entry { - unsigned long base; - unsigned long size; + u64 base; + u64 size; }; typedef u32 cell_t; @@ -897,9 +897,9 @@ static unsigned long __init prom_next_ce * If problems seem to show up, it would be a good start to track * them down. */ -static void reserve_mem(unsigned long base, unsigned long size) +static void reserve_mem(u64 base, u64 size) { - unsigned long top = base + size; + u64 top = base + size; unsigned long cnt = RELOC(mem_reserve_cnt); if (size == 0) From sleddog at us.ibm.com Thu Jan 12 11:16:52 2006 From: sleddog at us.ibm.com (Dave C Boutcher) Date: Wed, 11 Jan 2006 18:16:52 -0600 Subject: [PATCH] powerpc: add ibm,suspend-me rtas interface In-Reply-To: <17349.39883.223457.362888@cargo.ozlabs.ibm.com> References: <20060111095633.GB30507@cs.umn.edu> <20060111171252.GD2491@pb15.lixom.net> <20060111174353.GA1867@cs.umn.edu> <1137016074.5138.28.camel@localhost.localdomain> <20060111224830.GA4223@cs.umn.edu> <17349.39883.223457.362888@cargo.ozlabs.ibm.com> Message-ID: <20060112001652.GE4223@cs.umn.edu> On Thu, Jan 12, 2006 at 10:59:07AM +1100, Paul Mackerras wrote: > Dave C Boutcher writes: > > > I wish they had called the RTAS call "OS-sync" or something. > > There's no reason why the userlevel interface can't use "sync" or > or "hmcsync" or "hvsync", is there? None at all, except that since the RTAS call is suspend, I thought that might be needlessly obfuscatory :-) > Are there going to be any other values that we might want to write to > /proc/ppc64/platform_state? If not, why not just have a > /proc/ppc64/hmcsync instead, and have any (non-zero length) write to > it invoke the RTAS call? There are no other values today...but I would rather leave it open for future functions. There's not much value in demanding that the string be "suspend" as opposed to anything else, but a strcmp doesn't cost that much... -- Dave Boutcher From arnd at arndb.de Thu Jan 12 11:34:15 2006 From: arnd at arndb.de (Arnd Bergmann) Date: Thu, 12 Jan 2006 00:34:15 +0000 Subject: [PATCH 0/5] powerpc: add device tree property updates In-Reply-To: <1137020080.5138.52.camel@localhost.localdomain> References: <20060111095921.GC30507@cs.umn.edu> <20060111224915.GB4223@cs.umn.edu> <1137020080.5138.52.camel@localhost.localdomain> Message-ID: <200601120034.16581.arnd@arndb.de> On Wednesday 11 January 2006 22:54, Benjamin Herrenschmidt wrote: > Yah, but I do prefer a filesystem Ok, if you want something to play with, try this one. It's my two-hour, 200 line attempt to give you an idea of how the most simple implementation could look like. It's pretty much guaranteed not to work since I don't have any powerpc machines around at home, but it's a start. Arnd <>< diff --git a/arch/powerpc/kernel/Makefile b/arch/powerpc/kernel/Makefile index 144e284..48285a6 100644 --- a/arch/powerpc/kernel/Makefile +++ b/arch/powerpc/kernel/Makefile @@ -46,6 +46,7 @@ extra-y += vmlinux.lds obj-y += process.o init_task.o time.o \ prom.o traps.o setup-common.o udbg.o +obj-y += prom_fs.o obj-$(CONFIG_PPC32) += entry_32.o setup_32.o misc_32.o systbl.o obj-$(CONFIG_PPC64) += misc_64.o dma_64.o iommu.o obj-$(CONFIG_PPC_MULTIPLATFORM) += prom_init.o --- /dev/null 2006-01-11 21:47:23.852291750 +0000 +++ arch/powerpc/kernel/prom_fs.c 2006-01-12 00:23:24.000000000 +0000 @@ -0,0 +1,200 @@ +#include +#include +#include +#include +#include +#include + +#include + +#define PROMFS_MAGIC 0xf0384d8c + +static ssize_t promfs_read(struct file *file, char __user *data, + size_t len, loff_t *ppos) +{ + struct property *prop = file->f_dentry->d_inode->u.generic_ip; + + return simple_read_from_buffer(data, len, ppos, + prop->value, prop->length); +} + +static struct file_operations promfs_property_operations = { + .read = promfs_read, +}; + +static struct inode *promfs_new_inode(struct super_block *sb, + int mode, void *data) +{ + struct inode *inode; + + inode = new_inode(sb); + if (!inode) + goto out; + + inode->i_mode = mode; + inode->i_uid = current->fsuid; + inode->i_gid = current->fsgid; + inode->i_blksize = PAGE_CACHE_SIZE; + inode->i_blocks = 0; + inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME; + inode->u.generic_ip = data; + switch (mode & S_IFMT) { + case S_IFDIR: + inode->i_op = &simple_dir_inode_operations; + inode->i_fop = &simple_dir_operations; + break; + case S_IFREG: + inode->i_fop = &promfs_property_operations; + break; + } +out: + return inode; +} + +static int promfs_create_prop(struct super_block *sb, struct dentry *dir, + struct property *prop) +{ + struct dentry *dentry; + struct inode *inode; + int ret; + + ret = -ENOMEM; + dentry = d_alloc_name(dir, prop->name); + if (!dentry) + goto out; + inode = promfs_new_inode(sb, S_IFREG | 0555, prop); + if (!inode) + goto out_dput; + d_add(dentry, inode); + return 0; + +out_dput: + dput(dentry); +out: + return ret; +} + +static int promfs_create_props(struct super_block *sb, struct dentry *dir, + struct device_node *node) +{ + struct property *prop; + int ret = 0; + + for (prop = node->properties; prop && !ret; prop = prop->next) + ret = promfs_create_prop(sb, dir, prop); + + if (ret) { + WARN_ON(1); +/* + promfs_remove_props(sb, dir); +*/ + } + + return ret; +} + +static int promfs_create_dir(struct super_block *sb, + struct dentry *dir, struct device_node *node) +{ + int ret; + struct device_node *np; + struct dentry *dentry; + struct inode *inode; + + ret = -ENOMEM; + dentry = d_alloc_name(dir, node->name); + if (!dentry) + goto out; + + inode = promfs_new_inode(sb, S_IFREG | 0555, node); + if (!inode) + goto out_dput; + + np = NULL; + while ((np = of_get_next_child(node, np)) != NULL) { + ret = promfs_create_dir(sb, dentry, np); + if (ret) + goto out; + } + + ret = promfs_create_props(sb, dentry, node); + if (ret) + goto out_cleanup; + + d_add(dentry, inode); + return 0; + +out_cleanup: + WARN_ON(1); +// promfs_remove_dirs(); +out_dput: + dput(dentry); +out: + return ret; +} + +static int promfs_create_root(struct super_block *sb, void *data) +{ + struct inode *inode; + struct device_node *node; + int ret; + + ret = -ENOENT; + node = of_find_node_by_path("/"); + if (!node) + goto out; + ret = -ENOMEM; + inode = promfs_new_inode(sb, S_IFDIR | 0555, node); + if (!inode) + goto out_nput; + sb->s_root = d_alloc_root(inode); + if (!sb->s_root) + goto out_iput; + return 0; +out_iput: + iput(inode); +out_nput: + of_node_put(node); +out: + return ret; +} + +static struct super_operations promfs_super_operations = { + .statfs = simple_statfs, + .drop_inode = generic_delete_inode, +}; + +static int promfs_fill_super(struct super_block *sb, void *data, int silent) +{ + sb->s_maxbytes = MAX_LFS_FILESIZE; + sb->s_blocksize = PAGE_CACHE_SIZE; + sb->s_blocksize_bits = PAGE_CACHE_SHIFT; + sb->s_magic = PROMFS_MAGIC; + sb->s_op = &promfs_super_operations; + return promfs_create_root(sb, data); +} + +static struct super_block *promfs_get_sb(struct file_system_type *fstype, + int flags, const char *name, void *data) +{ + return get_sb_single(fstype, flags, data, promfs_fill_super); +} + +static struct file_system_type promfs_type = { + .owner = THIS_MODULE, + .name = "promfs", + .get_sb = promfs_get_sb, + .kill_sb = kill_litter_super, +}; + +static int __init promfs_init(void) +{ + return register_filesystem(&promfs_type); +} +module_init(promfs_init); + +static void __exit promfs_exit(void) +{ + unregister_filesystem(&promfs_type); +} +module_exit(promfs_exit); From ntl at pobox.com Thu Jan 12 12:17:59 2006 From: ntl at pobox.com (Nathan Lynch) Date: Wed, 11 Jan 2006 19:17:59 -0600 Subject: [PATCH] powerpc: add ibm,suspend-me rtas interface In-Reply-To: <20060111095633.GB30507@cs.umn.edu> References: <20060111095633.GB30507@cs.umn.edu> Message-ID: <20060112011759.GC2846@localhost.localdomain> Dave C Boutcher wrote: > + /* Prod each CPU. This won't hurt, and will wake > + * anyone we successfully put to sleep with H_Join > + */ > + for_each_cpu(i) > + plpar_hcall_norets(H_PROD,i); Is prodding an offline cpu okay/well-defined? From sleddog at us.ibm.com Thu Jan 12 12:19:44 2006 From: sleddog at us.ibm.com (Dave C Boutcher) Date: Wed, 11 Jan 2006 19:19:44 -0600 Subject: [PATCH] powerpc: add ibm,suspend-me rtas interface In-Reply-To: <20060112011759.GC2846@localhost.localdomain> References: <20060111095633.GB30507@cs.umn.edu> <20060112011759.GC2846@localhost.localdomain> Message-ID: <20060112011944.GF4223@cs.umn.edu> On Wed, Jan 11, 2006 at 07:17:59PM -0600, Nathan Lynch wrote: > Dave C Boutcher wrote: > > > + /* Prod each CPU. This won't hurt, and will wake > > + * anyone we successfully put to sleep with H_Join > > + */ > > + for_each_cpu(i) > > + plpar_hcall_norets(H_PROD,i); > > Is prodding an offline cpu okay/well-defined? Yes, just returns a hypervisor return code (H_Param, I think.) -- Dave Boutcher From sleddog at us.ibm.com Thu Jan 12 12:23:26 2006 From: sleddog at us.ibm.com (Dave C Boutcher) Date: Wed, 11 Jan 2006 19:23:26 -0600 Subject: [PATCH 0/7] powerpc: resend sysstate and devicetree update patches Message-ID: <20060112012326.GG4223@cs.umn.edu> The previous patches I sent had some whitespace issues, as well as some functional comments from Olof. I'm resending the patches against 2.6.15 with those issues resolved. Also just grouped the patches into one set to make life easier for Paulus :-) -- Dave Boutcher From sleddog at us.ibm.com Thu Jan 12 12:25:44 2006 From: sleddog at us.ibm.com (Dave C Boutcher) Date: Wed, 11 Jan 2006 19:25:44 -0600 Subject: [PATCH 1/7] powerpc: add new hypervisor constants In-Reply-To: <20060112012326.GG4223@cs.umn.edu> References: <20060112012326.GG4223@cs.umn.edu> Message-ID: <20060112012544.GH4223@cs.umn.edu> Adds a few more hypervisor call constants. Updated to address whitespace issues raised by Olof Johansson. Signed-off-by: Dave Boutcher diff -uNr linux-2.6.15-patched/include/asm-powerpc/hvcall.h linux-2.6.15-patched2/include/asm-powerpc/hvcall.h --- linux-2.6.15-patched/include/asm-powerpc/hvcall.h 2006-01-11 17:46:59.000000000 -0600 +++ linux-2.6.15-patched2/include/asm-powerpc/hvcall.h 2006-01-11 17:48:44.000000000 -0600 @@ -5,7 +5,10 @@ #define H_Success 0 #define H_Busy 1 /* Hardware busy -- retry later */ +#define H_Closed 2 /* Resource closed */ #define H_Constrained 4 /* Resource request constrained to max allowed */ +#define H_InProgress 14 /* Kind of like busy */ +#define H_Continue 18 /* Returned from H_Join on success */ #define H_LongBusyStartRange 9900 /* Start of long busy range */ #define H_LongBusyOrder1msec 9900 /* Long busy, hint that 1msec is a good time to retry */ #define H_LongBusyOrder10msec 9901 /* Long busy, hint that 10msec is a good time to retry */ @@ -113,6 +116,8 @@ #define H_REGISTER_VTERM 0x154 #define H_FREE_VTERM 0x158 #define H_POLL_PENDING 0x1D8 +#define H_JOIN 0x298 +#define H_ENABLE_CRQ 0x2B0 #ifndef __ASSEMBLY__ -- Dave Boutcher From sleddog at us.ibm.com Thu Jan 12 12:27:01 2006 From: sleddog at us.ibm.com (Dave C Boutcher) Date: Wed, 11 Jan 2006 19:27:01 -0600 Subject: [PATCH 2/7] powerpc: add ibm,suspend-me rtas interface In-Reply-To: <20060112012326.GG4223@cs.umn.edu> References: <20060112012326.GG4223@cs.umn.edu> Message-ID: <20060112012701.GI4223@cs.umn.edu> Create a proc file that lets us call the ibm,suspend-me RTAS call. This call has to be wrapped in some hypervisor calls that synchronize all the CPUs, so it can't be done from userland. This depends on a prior patch to add additional hypervisor call constants. Updated to reflect comments from Olof Johansson Signed-off-by: Dave Boutcher arch/powerpc/platforms/pseries/Makefile | 2 arch/powerpc/platforms/pseries/sysstate.c | 157 ++++++++++++++++++++++++++++++ 2 files changed, 158 insertions(+), 1 deletion(-) diff -uNr linux-2.6.15-patched/arch/powerpc/platforms/pseries/Makefile linux-2.6.15-patched2/arch/powerpc/platforms/pseries/Makefile --- linux-2.6.15-patched/arch/powerpc/platforms/pseries/Makefile 2006-01-11 17:46:57.000000000 -0600 +++ linux-2.6.15-patched2/arch/powerpc/platforms/pseries/Makefile 2006-01-11 17:50:21.000000000 -0600 @@ -1,5 +1,5 @@ obj-y := pci.o lpar.o hvCall.o nvram.o reconfig.o \ - setup.o iommu.o ras.o rtasd.o + setup.o iommu.o ras.o rtasd.o sysstate.o obj-$(CONFIG_SMP) += smp.o obj-$(CONFIG_IBMVIO) += vio.o obj-$(CONFIG_XICS) += xics.o diff -uNr linux-2.6.15-patched/arch/powerpc/platforms/pseries/sysstate.c linux-2.6.15-patched2/arch/powerpc/platforms/pseries/sysstate.c --- linux-2.6.15-patched/arch/powerpc/platforms/pseries/sysstate.c 1969-12-31 18:00:00.000000000 -0600 +++ linux-2.6.15-patched2/arch/powerpc/platforms/pseries/sysstate.c 2006-01-11 17:50:21.000000000 -0600 @@ -0,0 +1,143 @@ +/* + * Logical Partition State + * + * Copyright (c) 2005 Dave Boutcher + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* + * This file handles the pSeries firmware supported "ibm,suspend-me" RTAS + * call. It can't be done from userland, since all of the CPUs must be first + * synchronized using the H_JOIN hypervisor call prior to making the + * ibm,suspend-me RTAS call. + * + * Note that this is completely different than normal Linux "software suspend". + * This is a hypervisor function driven as part of logical partitioning to give + * the hypervisor a "sync point" across the operating system. + */ + +#include +#include +#include +#include +#include +#include +#include + +#include + +static int suspend_me_tok = RTAS_UNKNOWN_SERVICE; + +static void cpu_suspend(void *info) +{ + long rc; + long flags; + long *waiting = (long *)info; + int status; + + /* + * We use "waiting" to indicate our state. As long + * as it is >0, we are still trying to all join up. + * If it goes to 0, we have successfully joined up and + * one thread got H_Continue. If any error happens, + * we set it to <0; + */ + local_irq_save(flags); + do { + rc = plpar_hcall_norets(H_JOIN); + smp_rmb(); + } while (rc == H_Success && *waiting > 0); + if (rc == H_Success) + goto out; + + if (rc == H_Continue) { + *waiting = 0; + if (suspend_me_tok != RTAS_UNKNOWN_SERVICE) { + status = rtas_call(suspend_me_tok, 0, 1, NULL); + if (status != 0) + printk(KERN_ERR + "RTAS ibm,suspend-me failed: %i\n", + status); + } + } else { + *waiting = -EBUSY; + printk(KERN_ERR "Error on H_Join hypervisor call\n"); + } + +out: + local_irq_restore(flags); + return; +} + +static int do_suspend(void) +{ + int i; + long waiting = 1; + + /* Call function on all other CPUs */ + if (on_each_cpu(cpu_suspend, &waiting, 1, 0)) + waiting = -EINVAL; + + if (waiting != 0) + printk(KERN_ERR "Error doing global join!\n"); + + /* Prod each CPU. This won't hurt, and will wake + * anyone we successfully put to sleep with H_Join + */ + for_each_cpu(i) + plpar_hcall_norets(H_PROD,i); + + return 0; +} + +static int write_proc(struct file *file, const char __user *buffer, + unsigned long count, void *data) +{ + char command[32]; + + if (count > sizeof(command)) + count = sizeof(command); + + if (copy_from_user(command, buffer, count)) + return -EFAULT; + + command[7] = '\0'; + + if (strcmp(command, "suspend") == 0) { + do_suspend(); + } + return count; +} + +static int __init sys_state_init(void) +{ + struct proc_dir_entry *entry; + suspend_me_tok = rtas_token("ibm,suspend-me"); + if (suspend_me_tok == RTAS_UNKNOWN_SERVICE) + return 0; + + entry = create_proc_entry("ppc64/rtas/platform_state", S_IWUSR, NULL); + if (!entry) { + printk(KERN_ERR "Failed to create platform_state proc entry\n"); + return 0; + } + + entry->write_proc = write_proc; + + return 0; +} + +arch_initcall(sys_state_init); -- Dave Boutcher From sleddog at us.ibm.com Thu Jan 12 12:27:55 2006 From: sleddog at us.ibm.com (Dave C Boutcher) Date: Wed, 11 Jan 2006 19:27:55 -0600 Subject: [PATCH 3/7] powerpc: null pointer check In-Reply-To: <20060112012326.GG4223@cs.umn.edu> References: <20060112012326.GG4223@cs.umn.edu> Message-ID: <20060112012755.GJ4223@cs.umn.edu> There should never be a device-tree node without a name property. But if one ever shows up, the panic is not pretty. Add a quick check to make the name pointer is not null before we use it. Signed-off-by: Dave Boutcher diff -uNr linux-2.6.15-patched/arch/powerpc/kernel/prom.c linux-2.6.15-patched2/arch/powerpc/kernel/prom.c --- linux-2.6.15-patched/arch/powerpc/kernel/prom.c 2006-01-11 17:46:57.000000000 -0600 +++ linux-2.6.15-patched2/arch/powerpc/kernel/prom.c 2006-01-11 17:54:10.000000000 -0600 @@ -613,7 +613,8 @@ if (ip != NULL) nsizec = *ip; - if (!strcmp(np->name, "device-tree") || np->parent == NULL) + if ((np->name && !strcmp(np->name, "device-tree")) + || (np->parent == NULL)) ifunc = interpret_root_props; else if (np->type == 0) ifunc = NULL; -- Dave Boutcher From sleddog at us.ibm.com Thu Jan 12 12:29:04 2006 From: sleddog at us.ibm.com (Dave C Boutcher) Date: Wed, 11 Jan 2006 19:29:04 -0600 Subject: [PATCH 4/7] powerpc: proc_device_tree remove and update functions In-Reply-To: <20060112012326.GG4223@cs.umn.edu> References: <20060112012326.GG4223@cs.umn.edu> Message-ID: <20060112012904.GK4223@cs.umn.edu> Add support to the proc_device_tree file for removing and updating properties. Remove just removes the proc file, update changes the data pointer within the proc file. The remainder of the device-tree changes occur elsewhere. Updated to fix whitspace issues. Signed-off-by: Dave Boutcher fs/proc/proc_devtree.c | 24 ++++++++++++++++++++++++ include/linux/proc_fs.h | 5 +++++ 2 files changed, 29 insertions(+) diff -uNr linux-2.6.15-patched/fs/proc/proc_devtree.c linux-2.6.15-patched2/fs/proc/proc_devtree.c --- linux-2.6.15-patched/fs/proc/proc_devtree.c 2006-01-11 17:46:58.000000000 -0600 +++ linux-2.6.15-patched2/fs/proc/proc_devtree.c 2006-01-11 17:58:02.000000000 -0600 @@ -81,6 +81,30 @@ __proc_device_tree_add_prop(pde, prop); } +void proc_device_tree_remove_prop(struct proc_dir_entry *pde, + struct property *prop) +{ + remove_proc_entry(prop->name, pde); +} + +void proc_device_tree_update_prop(struct proc_dir_entry *pde, + struct property *newprop, + struct property *oldprop) +{ + struct proc_dir_entry *ent; + + for (ent = pde->subdir; ent != NULL; ent = ent->next) + if (ent->data == oldprop) + break; + if (ent == NULL) { + printk(KERN_WARNING "device-tree: property \"%s\" " + " does not exist\n", oldprop->name); + } else { + ent->data = newprop; + ent->size = newprop->length; + } +} + /* * Process a node, adding entries for its children and its properties. */ diff -uNr linux-2.6.15-patched/include/linux/proc_fs.h linux-2.6.15-patched2/include/linux/proc_fs.h --- linux-2.6.15-patched/include/linux/proc_fs.h 2006-01-11 17:46:59.000000000 -0600 +++ linux-2.6.15-patched2/include/linux/proc_fs.h 2006-01-11 17:58:02.000000000 -0600 @@ -146,6 +146,11 @@ extern void proc_device_tree_init(void); extern void proc_device_tree_add_node(struct device_node *, struct proc_dir_entry *); extern void proc_device_tree_add_prop(struct proc_dir_entry *pde, struct property *prop); +extern void proc_device_tree_remove_prop(struct proc_dir_entry *pde, + struct property *prop); +extern void proc_device_tree_update_prop(struct proc_dir_entry *pde, + struct property *newprop, + struct property *oldprop); #endif /* CONFIG_PROC_DEVICETREE */ extern struct proc_dir_entry *proc_symlink(const char *, -- Dave Boutcher From sleddog at us.ibm.com Thu Jan 12 12:30:27 2006 From: sleddog at us.ibm.com (Dave C Boutcher) Date: Wed, 11 Jan 2006 19:30:27 -0600 Subject: [PATCH 5/7] powerpc: prom.c support for updating and removing In-Reply-To: <20060112012326.GG4223@cs.umn.edu> References: <20060112012326.GG4223@cs.umn.edu> Message-ID: <20060112013027.GL4223@cs.umn.edu> Add support for updating and removing device tree properties. Since we hand out pointers to properties with gay abandon, we can't just free the property storage. Instead we move deleted, or the old copy of an updated property, to a "dead properties" list. Also note, its not feasable to kref device tree properties. we call get_property() all over the kernel in a wild variety of contexts. One consequence of this change is that we now take a read_lock(&devtree_lock) when doing get_property(). Updated to fix whitespace issues. Signed-off-by: Dave Boutcher arch/powerpc/kernel/prom.c | 93 ++++++++++++++++++++++++++++++++++++++++++++- include/asm-powerpc/prom.h | 5 ++ 2 files changed, 96 insertions(+), 2 deletions(-) diff -uNr linux-2.6.15-patched/arch/powerpc/kernel/prom.c linux-2.6.15-patched2/arch/powerpc/kernel/prom.c --- linux-2.6.15-patched/arch/powerpc/kernel/prom.c 2006-01-11 17:57:49.000000000 -0600 +++ linux-2.6.15-patched2/arch/powerpc/kernel/prom.c 2006-01-11 17:59:11.000000000 -0600 @@ -1801,6 +1801,11 @@ kfree(prop->value); kfree(prop); prop = next; + + if (!prop) { + prop = node->deadprops; + node->deadprops = NULL; + } } kfree(node->intrs); kfree(node->addrs); @@ -1957,13 +1962,16 @@ { struct property *pp; + read_lock(&devtree_lock); for (pp = np->properties; pp != 0; pp = pp->next) if (strcmp(pp->name, name) == 0) { if (lenp != 0) *lenp = pp->length; - return pp->value; + break; } - return NULL; + read_unlock(&devtree_lock); + + return pp ? pp->value : NULL; } EXPORT_SYMBOL(get_property); @@ -1997,6 +2005,87 @@ return 0; } +/* + * Remove a property from a node. Note that we don't actually + * remove it, since we have given out who-knows-how-many pointers + * to the data using get-property. Instead we just move the property + * to the "dead properties" list, so it won't be found any more. + */ +int prom_remove_property(struct device_node *np, struct property *prop) +{ + struct property **next; + int found = 0; + + write_lock(&devtree_lock); + next = &np->properties; + while (*next) { + if (*next == prop) { + /* found the node */ + *next = prop->next; + prop->next = np->deadprops; + np->deadprops = prop; + found = 1; + break; + } + next = &(*next)->next; + } + write_unlock(&devtree_lock); + + if (!found) + return -ENODEV; + +#ifdef CONFIG_PROC_DEVICETREE + /* try to remove the proc node as well */ + if (np->pde) + proc_device_tree_remove_prop(np->pde, prop); +#endif /* CONFIG_PROC_DEVICETREE */ + + return 0; +} + +/* + * Update a property in a node. Note that we don't actually + * remove it, since we have given out who-knows-how-many pointers + * to the data using get-property. Instead we just move the property + * to the "dead properties" list, and add the new property to the + * property list + */ +int prom_update_property(struct device_node *np, + struct property *newprop, + struct property *oldprop) +{ + struct property **next; + int found = 0; + + write_lock(&devtree_lock); + next = &np->properties; + while (*next) { + if (*next == oldprop) { + /* found the node */ + newprop->next = oldprop->next; + *next = newprop; + oldprop->next = np->deadprops; + np->deadprops = oldprop; + found = 1; + break; + } + next = &(*next)->next; + } + write_unlock(&devtree_lock); + + if (!found) + return -ENODEV; + +#ifdef CONFIG_PROC_DEVICETREE + /* try to add to proc as well if it was initialized */ + if (np->pde) + proc_device_tree_update_prop(np->pde, newprop, + oldprop); +#endif /* CONFIG_PROC_DEVICETREE */ + + return 0; +} + /* I quickly hacked that one, check against spec ! */ static inline unsigned long bus_space_to_resource_flags(unsigned int bus_space) diff -uNr linux-2.6.15-patched/include/asm-powerpc/prom.h linux-2.6.15-patched2/include/asm-powerpc/prom.h --- linux-2.6.15-patched/include/asm-powerpc/prom.h 2006-01-11 17:46:59.000000000 -0600 +++ linux-2.6.15-patched2/include/asm-powerpc/prom.h 2006-01-11 17:59:11.000000000 -0600 @@ -127,6 +127,7 @@ char *full_name; struct property *properties; + struct property *deadprops; /* removed properties */ struct device_node *parent; struct device_node *child; struct device_node *sibling; @@ -204,6 +205,10 @@ extern int prom_n_intr_cells(struct device_node* np); extern void prom_get_irq_senses(unsigned char *senses, int off, int max); extern int prom_add_property(struct device_node* np, struct property* prop); +extern int prom_remove_property(struct device_node *np, struct property *prop); +extern int prom_update_property(struct device_node *np, + struct property *newprop, + struct property *oldprop); #ifdef CONFIG_PPC32 /* -- Dave Boutcher From sleddog at us.ibm.com Thu Jan 12 12:31:30 2006 From: sleddog at us.ibm.com (Dave C Boutcher) Date: Wed, 11 Jan 2006 19:31:30 -0600 Subject: [PATCH 6/7] powerpc: add of_find_property function In-Reply-To: <20060112012326.GG4223@cs.umn.edu> References: <20060112012326.GG4223@cs.umn.edu> Message-ID: <20060112013130.GM4223@cs.umn.edu> Add an of_find_property function that returns a struct property given a property name. Then change the get_property function to use that routine internally. Signed-off-by: Dave Boutcher arch/powerpc/kernel/prom.c | 19 +++++++++++++------ include/asm-powerpc/prom.h | 3 +++ 2 files changed, 16 insertions(+), 6 deletions(-) diff -uNr linux-2.6.15-patched/arch/powerpc/kernel/prom.c linux-2.6.15-patched2/arch/powerpc/kernel/prom.c --- linux-2.6.15-patched/arch/powerpc/kernel/prom.c 2006-01-11 18:00:06.000000000 -0600 +++ linux-2.6.15-patched2/arch/powerpc/kernel/prom.c 2006-01-11 18:00:21.000000000 -0600 @@ -1953,12 +1953,8 @@ __initcall(prom_reconfig_setup); #endif -/* - * Find a property with a given name for a given node - * and return the value. - */ -unsigned char *get_property(struct device_node *np, const char *name, - int *lenp) +struct property *of_find_property(struct device_node *np, const char *name, + int *lenp) { struct property *pp; @@ -1971,6 +1967,17 @@ } read_unlock(&devtree_lock); + return pp; +} + +/* + * Find a property with a given name for a given node + * and return the value. + */ +unsigned char *get_property(struct device_node *np, const char *name, + int *lenp) +{ + struct property *pp = of_find_property(np,name,lenp); return pp ? pp->value : NULL; } EXPORT_SYMBOL(get_property); diff -uNr linux-2.6.15-patched/include/asm-powerpc/prom.h linux-2.6.15-patched2/include/asm-powerpc/prom.h --- linux-2.6.15-patched/include/asm-powerpc/prom.h 2006-01-11 18:00:06.000000000 -0600 +++ linux-2.6.15-patched2/include/asm-powerpc/prom.h 2006-01-11 18:00:21.000000000 -0600 @@ -176,6 +176,9 @@ extern struct device_node *of_get_parent(const struct device_node *node); extern struct device_node *of_get_next_child(const struct device_node *node, struct device_node *prev); +extern struct property *of_find_property(struct device_node *np, + const char *name, + int *lenp); extern struct device_node *of_node_get(struct device_node *node); extern void of_node_put(struct device_node *node); -- Dave Boutcher From sleddog at us.ibm.com Thu Jan 12 12:32:19 2006 From: sleddog at us.ibm.com (Dave C Boutcher) Date: Wed, 11 Jan 2006 19:32:19 -0600 Subject: [PATCH 7/7] powerpc: add reconfigure intefaces for updating In-Reply-To: <20060112012326.GG4223@cs.umn.edu> References: <20060112012326.GG4223@cs.umn.edu> Message-ID: <20060112013219.GN4223@cs.umn.edu> Add support to reconfigure the device tree through the existing proc filesystem interface. Add "add_property", "remove_property", and "update_property" interfaces. Signed-off-by: Dave Boutcher arch/powerpc/platforms/pseries/reconfig.c | 101 ++++++++++++++++++++++++++++++ 1 file changed, 101 insertions(+) diff -uNr linux-2.6.15-patched/arch/powerpc/platforms/pseries/reconfig.c linux-2.6.15-patched2/arch/powerpc/platforms/pseries/reconfig.c --- linux-2.6.15-patched/arch/powerpc/platforms/pseries/reconfig.c 2006-01-11 17:46:57.000000000 -0600 +++ linux-2.6.15-patched2/arch/powerpc/platforms/pseries/reconfig.c 2006-01-11 18:01:16.000000000 -0600 @@ -350,6 +350,101 @@ return rv; } +static char *parse_node(char *buf, size_t bufsize, struct device_node **npp) +{ + char *handle_str; + phandle handle; + *npp = NULL; + + handle_str = buf; + + buf = strchr(buf, ' '); + if (!buf) + return NULL; + *buf = '\0'; + buf++; + + handle = simple_strtoul(handle_str, NULL, 10); + + *npp = of_find_node_by_phandle(handle); + return buf; +} + +static int do_add_property(char *buf, size_t bufsize) +{ + struct property *prop = NULL; + struct device_node *np; + unsigned char *value; + char *name, *end; + int length; + end = buf + bufsize; + buf = parse_node(buf,bufsize,&np); + + if (!np) + return -ENODEV; + + if (parse_next_property(buf, end, &name, &length, &value) == NULL) + return -EINVAL; + + prop = new_property(name, length, value, NULL); + if (!prop) + return -ENOMEM; + + prom_add_property(np, + prop); + + return 0; +} + +static int do_remove_property(char *buf, size_t bufsize) +{ + struct device_node *np; + char *tmp; + struct property *prop; + buf = parse_node(buf,bufsize,&np); + + if (!np) + return -ENODEV; + + tmp = strchr(buf,' '); + if (tmp) + *tmp = '\0'; + + if (strlen(buf) == 0) + return -EINVAL; + + prop = of_find_property(np, buf, NULL); + + return prom_remove_property(np, prop); +} + +static int do_update_property(char *buf, size_t bufsize) +{ + struct device_node *np; + unsigned char *value; + char *name, *end; + int length; + struct property *newprop, *oldprop; + buf = parse_node(buf,bufsize,&np); + end = buf + bufsize; + + if (!np) + return -ENODEV; + + if (parse_next_property(buf, end, &name, &length, &value) == NULL) + return -EINVAL; + + newprop = new_property(name, length, value, NULL); + if (!newprop) + return -ENOMEM; + + oldprop = of_find_property(np, name,NULL); + if (!oldprop) + return -ENODEV; + + return prom_update_property(np, newprop, oldprop); +} + /** * ofdt_write - perform operations on the Open Firmware device tree * @@ -392,6 +487,12 @@ rv = do_add_node(tmp, count - (tmp - kbuf)); else if (!strcmp(kbuf, "remove_node")) rv = do_remove_node(tmp); + else if (!strcmp(kbuf, "add_property")) + rv = do_add_property(tmp, count - (tmp - kbuf)); + else if (!strcmp(kbuf, "remove_property")) + rv = do_remove_property(tmp, count - (tmp - kbuf)); + else if (!strcmp(kbuf, "update_property")) + rv = do_update_property(tmp, count - (tmp - kbuf)); else rv = -EINVAL; out: -- Dave Boutcher From ntl at pobox.com Thu Jan 12 13:32:49 2006 From: ntl at pobox.com (Nathan Lynch) Date: Wed, 11 Jan 2006 20:32:49 -0600 Subject: [PATCH 0/5] powerpc: add device tree property updates In-Reply-To: <20060111095921.GC30507@cs.umn.edu> References: <20060111095921.GC30507@cs.umn.edu> Message-ID: <20060112023249.GD2846@localhost.localdomain> Dave C Boutcher wrote: > The following set of patches add support for updating device > tree properties on the fly. pseries is adding some > awfull^h^h^h^h^h^h helpful RTAS calls named "ibm,update-nodes" > and "ibm,update-properties". Can you elaborate on what these methods do, how they're intended to be used, and what relationship, if any, they have with the ibm,suspend-me method, please? From sfr at canb.auug.org.au Thu Jan 12 13:35:37 2006 From: sfr at canb.auug.org.au (Stephen Rothwell) Date: Thu, 12 Jan 2006 13:35:37 +1100 Subject: [PATCH 0/7] powerpc: some, mostly iSeries, cleanups Message-ID: <20060112133537.2951952c.sfr@canb.auug.org.au> Hi Paul, This patch set does some cleaning of the iSeries code (with some small incidental generic powerpc cleanups). These are mostly removing the use of bitfields from structures used to communicate with the hypervisor (and some bitfields that should never have been bitfield in the first place). [ Paulus:These patches are available from my git tree if you would prefer that. ] -- Cheers, Stephen Rothwell sfr at canb.auug.org.au http://www.canb.auug.org.au/~sfr/ -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: not available Url : http://ozlabs.org/pipermail/linuxppc64-dev/attachments/20060112/e5571ef4/attachment.pgp From sfr at canb.auug.org.au Thu Jan 12 13:47:43 2006 From: sfr at canb.auug.org.au (Stephen Rothwell) Date: Thu, 12 Jan 2006 13:47:43 +1100 Subject: [PATCH 2/7] powerpc: remove bitfields from HvLpEvent In-Reply-To: <20060112133537.2951952c.sfr@canb.auug.org.au> References: <20060112133537.2951952c.sfr@canb.auug.org.au> Message-ID: <20060112134743.63245c18.sfr@canb.auug.org.au> Signed-off-by: Stephen Rothwell --- arch/powerpc/platforms/iseries/irq.c | 13 +-------- arch/powerpc/platforms/iseries/lpevents.c | 12 ++++---- arch/powerpc/platforms/iseries/mf.c | 16 ++--------- arch/powerpc/platforms/iseries/viopath.c | 12 ++++---- drivers/block/viodasd.c | 32 +++++++++++------------ drivers/cdrom/viocd.c | 6 ++-- drivers/char/viocons.c | 31 +++++++++++----------- drivers/net/iseries_veth.c | 4 +-- include/asm-powerpc/iseries/hv_lp_event.h | 41 ++++++++++++++++++++++------- 9 files changed, 82 insertions(+), 85 deletions(-) -- Cheers, Stephen Rothwell sfr at canb.auug.org.au http://www.canb.auug.org.au/~sfr/ 028fbf65a15d188ca853aa119a3dd31bd43aaf83 diff --git a/arch/powerpc/platforms/iseries/irq.c b/arch/powerpc/platforms/iseries/irq.c index 42e978e..3d02385 100644 --- a/arch/powerpc/platforms/iseries/irq.c +++ b/arch/powerpc/platforms/iseries/irq.c @@ -147,20 +147,11 @@ static void int_received(struct pci_even static void pci_event_handler(struct HvLpEvent *event, struct pt_regs *regs) { if (event && (event->xType == HvLpEvent_Type_PciIo)) { - switch (event->xFlags.xFunction) { - case HvLpEvent_Function_Int: + if (hvlpevent_is_int(event)) int_received((struct pci_event *)event, regs); - break; - case HvLpEvent_Function_Ack: + else printk(KERN_ERR "pci_event_handler: unexpected ack received\n"); - break; - default: - printk(KERN_ERR - "pci_event_handler: unexpected event function %d\n", - (int)event->xFlags.xFunction); - break; - } } else if (event) printk(KERN_ERR "pci_event_handler: Unrecognized PCI event type 0x%x\n", diff --git a/arch/powerpc/platforms/iseries/lpevents.c b/arch/powerpc/platforms/iseries/lpevents.c index e9fb98b..0b88530 100644 --- a/arch/powerpc/platforms/iseries/lpevents.c +++ b/arch/powerpc/platforms/iseries/lpevents.c @@ -53,7 +53,7 @@ static struct HvLpEvent * get_next_hvlpe struct HvLpEvent * event; event = (struct HvLpEvent *)hvlpevent_queue.xSlicCurEventPtr; - if (event->xFlags.xValid) { + if (hvlpevent_is_valid(event)) { /* rmb() needed only for weakly consistent machines (regatta) */ rmb(); /* Set pointer to next potential event */ @@ -84,7 +84,7 @@ int hvlpevent_is_pending(void) next_event = (struct HvLpEvent *)hvlpevent_queue.xSlicCurEventPtr; - return next_event->xFlags.xValid | + return hvlpevent_is_valid(next_event) || hvlpevent_queue.xPlicOverflowIntPending; } @@ -101,18 +101,18 @@ static void hvlpevent_clear_valid(struct switch (extra) { case 3: tmp = (struct HvLpEvent*)((char*)event + 3 * LpEventAlign); - tmp->xFlags.xValid = 0; + hvlpevent_invalidate(tmp); case 2: tmp = (struct HvLpEvent*)((char*)event + 2 * LpEventAlign); - tmp->xFlags.xValid = 0; + hvlpevent_invalidate(tmp); case 1: tmp = (struct HvLpEvent*)((char*)event + 1 * LpEventAlign); - tmp->xFlags.xValid = 0; + hvlpevent_invalidate(tmp); } mb(); - event->xFlags.xValid = 0; + hvlpevent_invalidate(event); } void process_hvlpevents(struct pt_regs *regs) diff --git a/arch/powerpc/platforms/iseries/mf.c b/arch/powerpc/platforms/iseries/mf.c index 49e7e4b..a41d8b7 100644 --- a/arch/powerpc/platforms/iseries/mf.c +++ b/arch/powerpc/platforms/iseries/mf.c @@ -251,10 +251,7 @@ static struct pending_event *new_pending } memset(ev, 0, sizeof(struct pending_event)); hev = &ev->event.hp_lp_event; - hev->xFlags.xValid = 1; - hev->xFlags.xAckType = HvLpEvent_AckType_ImmediateAck; - hev->xFlags.xAckInd = HvLpEvent_AckInd_DoAck; - hev->xFlags.xFunction = HvLpEvent_Function_Int; + hev->flags = HV_LP_EVENT_VALID | HV_LP_EVENT_DO_ACK | HV_LP_EVENT_INT; hev->xType = HvLpEvent_Type_MachineFac; hev->xSourceLp = HvLpConfig_getLpIndex(); hev->xTargetLp = primary_lp; @@ -518,17 +515,10 @@ static void handle_ack(struct io_mf_lp_e static void hv_handler(struct HvLpEvent *event, struct pt_regs *regs) { if ((event != NULL) && (event->xType == HvLpEvent_Type_MachineFac)) { - switch(event->xFlags.xFunction) { - case HvLpEvent_Function_Ack: + if (hvlpevent_is_ack(event)) handle_ack((struct io_mf_lp_event *)event); - break; - case HvLpEvent_Function_Int: + else handle_int((struct io_mf_lp_event *)event); - break; - default: - printk(KERN_ERR "mf.c: non ack/int event received\n"); - break; - } } else printk(KERN_ERR "mf.c: alien event received\n"); } diff --git a/arch/powerpc/platforms/iseries/viopath.c b/arch/powerpc/platforms/iseries/viopath.c index 8426726..622a301 100644 --- a/arch/powerpc/platforms/iseries/viopath.c +++ b/arch/powerpc/platforms/iseries/viopath.c @@ -270,7 +270,7 @@ static void handleMonitorEvent(struct Hv * First see if this is just a normal monitor message from the * other partition */ - if (event->xFlags.xFunction == HvLpEvent_Function_Int) { + if (hvlpevent_is_int(event)) { remoteLp = event->xSourceLp; if (!viopathStatus[remoteLp].isActive) sendMonMsg(remoteLp); @@ -331,13 +331,12 @@ static void handleConfig(struct HvLpEven { if (!event) return; - if (event->xFlags.xFunction == HvLpEvent_Function_Int) { + if (hvlpevent_is_int(event)) { printk(VIOPATH_KERN_WARN "unexpected config request from partition %d", event->xSourceLp); - if ((event->xFlags.xFunction == HvLpEvent_Function_Int) && - (event->xFlags.xAckInd == HvLpEvent_AckInd_DoAck)) { + if (hvlpevent_need_ack(event)) { event->xRc = HvLpEvent_Rc_InvalidSubtype; HvCallEvent_ackLpEvent(event); } @@ -377,7 +376,7 @@ static void vio_handleEvent(struct HvLpE int subtype = (event->xSubtype & VIOMAJOR_SUBTYPE_MASK) >> VIOMAJOR_SUBTYPE_SHIFT; - if (event->xFlags.xFunction == HvLpEvent_Function_Int) { + if (hvlpevent_is_int(event)) { remoteLp = event->xSourceLp; /* * The isActive is checked because if the hosting partition @@ -436,8 +435,7 @@ static void vio_handleEvent(struct HvLpE "unexpected virtual io event subtype %d from partition %d\n", event->xSubtype, remoteLp); /* No handler. Ack if necessary */ - if ((event->xFlags.xFunction == HvLpEvent_Function_Int) && - (event->xFlags.xAckInd == HvLpEvent_AckInd_DoAck)) { + if (hvlpevent_is_int(event) && hvlpevent_need_ack(event)) { event->xRc = HvLpEvent_Rc_InvalidSubtype; HvCallEvent_ackLpEvent(event); } diff --git a/drivers/block/viodasd.c b/drivers/block/viodasd.c index 2d518aa..4a24f35 100644 --- a/drivers/block/viodasd.c +++ b/drivers/block/viodasd.c @@ -319,6 +319,7 @@ static int send_request(struct request * u16 viocmd; HvLpEvent_Rc hvrc; struct vioblocklpevent *bevent; + struct HvLpEvent *hev; struct scatterlist sg[VIOMAXBLOCKDMA]; int sgindex; int statindex; @@ -373,22 +374,19 @@ static int send_request(struct request * * token so we can match the response up later */ memset(bevent, 0, sizeof(struct vioblocklpevent)); - bevent->event.xFlags.xValid = 1; - bevent->event.xFlags.xFunction = HvLpEvent_Function_Int; - bevent->event.xFlags.xAckInd = HvLpEvent_AckInd_DoAck; - bevent->event.xFlags.xAckType = HvLpEvent_AckType_ImmediateAck; - bevent->event.xType = HvLpEvent_Type_VirtualIo; - bevent->event.xSubtype = viocmd; - bevent->event.xSourceLp = HvLpConfig_getLpIndex(); - bevent->event.xTargetLp = viopath_hostLp; - bevent->event.xSizeMinus1 = + hev = &bevent->event; + hev->flags = HV_LP_EVENT_VALID | HV_LP_EVENT_DO_ACK | + HV_LP_EVENT_INT; + hev->xType = HvLpEvent_Type_VirtualIo; + hev->xSubtype = viocmd; + hev->xSourceLp = HvLpConfig_getLpIndex(); + hev->xTargetLp = viopath_hostLp; + hev->xSizeMinus1 = offsetof(struct vioblocklpevent, u.rw_data.dma_info) + (sizeof(bevent->u.rw_data.dma_info[0]) * nsg) - 1; - bevent->event.xSourceInstanceId = - viopath_sourceinst(viopath_hostLp); - bevent->event.xTargetInstanceId = - viopath_targetinst(viopath_hostLp); - bevent->event.xCorrelationToken = (u64)req; + hev->xSourceInstanceId = viopath_sourceinst(viopath_hostLp); + hev->xTargetInstanceId = viopath_targetinst(viopath_hostLp); + hev->xCorrelationToken = (u64)req; bevent->version = VIOVERSION; bevent->disk = DEVICE_NO(d); bevent->u.rw_data.offset = start; @@ -675,10 +673,10 @@ static void handle_block_event(struct Hv /* Notification that a partition went away! */ return; /* First, we should NEVER get an int here...only acks */ - if (event->xFlags.xFunction == HvLpEvent_Function_Int) { + if (hvlpevent_is_int(event)) { printk(VIOD_KERN_WARNING "Yikes! got an int in viodasd event handler!\n"); - if (event->xFlags.xAckInd == HvLpEvent_AckInd_DoAck) { + if (hvlpevent_need_ack(event)) { event->xRc = HvLpEvent_Rc_InvalidSubtype; HvCallEvent_ackLpEvent(event); } @@ -721,7 +719,7 @@ static void handle_block_event(struct Hv default: printk(VIOD_KERN_WARNING "invalid subtype!"); - if (event->xFlags.xAckInd == HvLpEvent_AckInd_DoAck) { + if (hvlpevent_need_ack(event)) { event->xRc = HvLpEvent_Rc_InvalidSubtype; HvCallEvent_ackLpEvent(event); } diff --git a/drivers/cdrom/viocd.c b/drivers/cdrom/viocd.c index b519178..193446e 100644 --- a/drivers/cdrom/viocd.c +++ b/drivers/cdrom/viocd.c @@ -542,10 +542,10 @@ static void vio_handle_cd_event(struct H /* Notification that a partition went away! */ return; /* First, we should NEVER get an int here...only acks */ - if (event->xFlags.xFunction == HvLpEvent_Function_Int) { + if (hvlpevent_is_int(event)) { printk(VIOCD_KERN_WARNING "Yikes! got an int in viocd event handler!\n"); - if (event->xFlags.xAckInd == HvLpEvent_AckInd_DoAck) { + if (hvlpevent_need_ack(event)) { event->xRc = HvLpEvent_Rc_InvalidSubtype; HvCallEvent_ackLpEvent(event); } @@ -616,7 +616,7 @@ return_complete: printk(VIOCD_KERN_WARNING "message with invalid subtype %0x04X!\n", event->xSubtype & VIOMINOR_SUBTYPE_MASK); - if (event->xFlags.xAckInd == HvLpEvent_AckInd_DoAck) { + if (hvlpevent_need_ack(event)) { event->xRc = HvLpEvent_Rc_InvalidSubtype; HvCallEvent_ackLpEvent(event); } diff --git a/drivers/char/viocons.c b/drivers/char/viocons.c index 4d75c26..2dd1651 100644 --- a/drivers/char/viocons.c +++ b/drivers/char/viocons.c @@ -476,19 +476,19 @@ static struct port_info *get_port_data(s */ static void initDataEvent(struct viocharlpevent *viochar, HvLpIndex lp) { + struct HvLpEvent *hev = &viochar->event; + memset(viochar, 0, sizeof(struct viocharlpevent)); - viochar->event.xFlags.xValid = 1; - viochar->event.xFlags.xFunction = HvLpEvent_Function_Int; - viochar->event.xFlags.xAckInd = HvLpEvent_AckInd_NoAck; - viochar->event.xFlags.xAckType = HvLpEvent_AckType_DeferredAck; - viochar->event.xType = HvLpEvent_Type_VirtualIo; - viochar->event.xSubtype = viomajorsubtype_chario | viochardata; - viochar->event.xSourceLp = HvLpConfig_getLpIndex(); - viochar->event.xTargetLp = lp; - viochar->event.xSizeMinus1 = sizeof(struct viocharlpevent); - viochar->event.xSourceInstanceId = viopath_sourceinst(lp); - viochar->event.xTargetInstanceId = viopath_targetinst(lp); + hev->flags = HV_LP_EVENT_VALID | HV_LP_EVENT_DEFERRED_ACK | + HV_LP_EVENT_INT; + hev->xType = HvLpEvent_Type_VirtualIo; + hev->xSubtype = viomajorsubtype_chario | viochardata; + hev->xSourceLp = HvLpConfig_getLpIndex(); + hev->xTargetLp = lp; + hev->xSizeMinus1 = sizeof(struct viocharlpevent); + hev->xSourceInstanceId = viopath_sourceinst(lp); + hev->xTargetInstanceId = viopath_targetinst(lp); } /* @@ -752,7 +752,7 @@ static void vioHandleOpenEvent(struct Hv struct port_info *pi; int reject = 0; - if (event->xFlags.xFunction == HvLpEvent_Function_Ack) { + if (hvlpevent_is_ack(event)) { if (port >= VTTY_PORTS) return; @@ -788,7 +788,7 @@ static void vioHandleOpenEvent(struct Hv } /* This had better require an ack, otherwise complain */ - if (event->xFlags.xAckInd != HvLpEvent_AckInd_DoAck) { + if (!hvlpevent_need_ack(event)) { printk(VIOCONS_KERN_WARN "viocharopen without ack bit!\n"); return; } @@ -856,7 +856,7 @@ static void vioHandleCloseEvent(struct H struct viocharlpevent *cevent = (struct viocharlpevent *)event; u8 port = cevent->virtual_device; - if (event->xFlags.xFunction == HvLpEvent_Function_Int) { + if (hvlpevent_is_int(event)) { if (port >= VTTY_PORTS) { printk(VIOCONS_KERN_WARN "close message from invalid virtual device.\n"); @@ -1056,8 +1056,7 @@ static void vioHandleCharEvent(struct Hv vioHandleConfig(event); break; default: - if ((event->xFlags.xFunction == HvLpEvent_Function_Int) && - (event->xFlags.xAckInd == HvLpEvent_AckInd_DoAck)) { + if (hvlpevent_is_int(event) && hvlpevent_need_ack(event)) { event->xRc = HvLpEvent_Rc_InvalidSubtype; HvCallEvent_ackLpEvent(event); } diff --git a/drivers/net/iseries_veth.c b/drivers/net/iseries_veth.c index 77eadf8..f0f04be 100644 --- a/drivers/net/iseries_veth.c +++ b/drivers/net/iseries_veth.c @@ -590,9 +590,9 @@ static void veth_handle_event(struct HvL { struct veth_lpevent *veth_event = (struct veth_lpevent *)event; - if (event->xFlags.xFunction == HvLpEvent_Function_Ack) + if (hvlpevent_is_ack(event)) veth_handle_ack(veth_event); - else if (event->xFlags.xFunction == HvLpEvent_Function_Int) + else veth_handle_int(veth_event); } diff --git a/include/asm-powerpc/iseries/hv_lp_event.h b/include/asm-powerpc/iseries/hv_lp_event.h index 499ab1a..8ee89b6 100644 --- a/include/asm-powerpc/iseries/hv_lp_event.h +++ b/include/asm-powerpc/iseries/hv_lp_event.h @@ -32,17 +32,8 @@ * partitions through PLIC. */ -struct HvEventFlags { - u8 xValid:1; /* Indicates a valid request x00-x00 */ - u8 xRsvd1:4; /* Reserved ... */ - u8 xAckType:1; /* Immediate or deferred ... */ - u8 xAckInd:1; /* Indicates if ACK required ... */ - u8 xFunction:1; /* Interrupt or Acknowledge ... */ -}; - - struct HvLpEvent { - struct HvEventFlags xFlags; /* Event flags x00-x00 */ + u8 flags; /* Event flags x00-x00 */ u8 xType; /* Type of message x01-x01 */ u16 xSubtype; /* Subtype for event x02-x03 */ u8 xSourceLp; /* Source LP x04-x04 */ @@ -126,6 +117,11 @@ extern int HvLpEvent_closePath(HvLpEvent #define HvLpEvent_AckType_ImmediateAck 0 #define HvLpEvent_AckType_DeferredAck 1 +#define HV_LP_EVENT_INT 0x01 +#define HV_LP_EVENT_DO_ACK 0x02 +#define HV_LP_EVENT_DEFERRED_ACK 0x04 +#define HV_LP_EVENT_VALID 0x80 + #define HvLpDma_Direction_LocalToRemote 0 #define HvLpDma_Direction_RemoteToLocal 1 @@ -139,4 +135,29 @@ extern int HvLpEvent_closePath(HvLpEvent #define HvLpDma_Rc_InvalidAddress 4 #define HvLpDma_Rc_InvalidLength 5 +static inline int hvlpevent_is_valid(struct HvLpEvent *h) +{ + return h->flags & HV_LP_EVENT_VALID; +} + +static inline void hvlpevent_invalidate(struct HvLpEvent *h) +{ + h->flags &= ~ HV_LP_EVENT_VALID; +} + +static inline int hvlpevent_is_int(struct HvLpEvent *h) +{ + return h->flags & HV_LP_EVENT_INT; +} + +static inline int hvlpevent_is_ack(struct HvLpEvent *h) +{ + return !hvlpevent_is_int(h); +} + +static inline int hvlpevent_need_ack(struct HvLpEvent *h) +{ + return h->flags & HV_LP_EVENT_DO_ACK; +} + #endif /* _ASM_POWERPC_ISERIES_HV_LP_EVENT_H */ -- 1.0.8 From sfr at canb.auug.org.au Thu Jan 12 13:48:52 2006 From: sfr at canb.auug.org.au (Stephen Rothwell) Date: Thu, 12 Jan 2006 13:48:52 +1100 Subject: [PATCH 1/7] powerpc: remove bitfields from hv_call_event.h In-Reply-To: <20060112133537.2951952c.sfr@canb.auug.org.au> References: <20060112133537.2951952c.sfr@canb.auug.org.au> Message-ID: <20060112134852.27c9dabf.sfr@canb.auug.org.au> Also does some comment cleanups and removal of unnecessary variables. Signed-off-by: Stephen Rothwell --- include/asm-powerpc/iseries/hv_call_event.h | 134 +++++++-------------------- 1 files changed, 36 insertions(+), 98 deletions(-) -- Cheers, Stephen Rothwell sfr at canb.auug.org.au http://www.canb.auug.org.au/~sfr/ d61f2f99c7f32c140312c2c625945932e1bb6a87 diff --git a/include/asm-powerpc/iseries/hv_call_event.h b/include/asm-powerpc/iseries/hv_call_event.h index 46763a3..4cec476 100644 --- a/include/asm-powerpc/iseries/hv_call_event.h +++ b/include/asm-powerpc/iseries/hv_call_event.h @@ -1,5 +1,4 @@ /* - * HvCallEvent.h * Copyright (C) 2001 Mike Corrigan IBM Corporation * * This program is free software; you can redistribute it and/or modify @@ -15,8 +14,7 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ -/* + * * This file contains the "hypervisor call" interface which is used to * drive the hypervisor from the OS. */ @@ -33,32 +31,9 @@ typedef u8 HvLpEvent_Type; typedef u8 HvLpEvent_AckInd; typedef u8 HvLpEvent_AckType; -struct HvCallEvent_PackedParms { - u8 xAckType:1; - u8 xAckInd:1; - u8 xRsvd:1; - u8 xTargetLp:5; - u8 xType; - u16 xSubtype; - HvLpInstanceId xSourceInstId; - HvLpInstanceId xTargetInstId; -}; - typedef u8 HvLpDma_Direction; typedef u8 HvLpDma_AddressType; -struct HvCallEvent_PackedDmaParms { - u8 xDirection:1; - u8 xLocalAddrType:1; - u8 xRemoteAddrType:1; - u8 xRsvd1:5; - HvLpIndex xRemoteLp; - u8 xType; - u8 xRsvd2; - HvLpInstanceId xLocalInstId; - HvLpInstanceId xRemoteInstId; -}; - typedef u64 HvLpEvent_Rc; typedef u64 HvLpDma_Rc; @@ -92,11 +67,8 @@ static inline void HvCallEvent_setInterL static inline void HvCallEvent_setLpEventStack(u8 queueIndex, char *eventStackAddr, u32 eventStackSize) { - u64 abs_addr; - - abs_addr = virt_to_abs(eventStackAddr); - HvCall3(HvCallEventSetLpEventStack, queueIndex, abs_addr, - eventStackSize); + HvCall3(HvCallEventSetLpEventStack, queueIndex, + virt_to_abs(eventStackAddr), eventStackSize); } static inline void HvCallEvent_setLpEventQueueInterruptProc(u8 queueIndex, @@ -108,14 +80,7 @@ static inline void HvCallEvent_setLpEven static inline HvLpEvent_Rc HvCallEvent_signalLpEvent(struct HvLpEvent *event) { - u64 abs_addr; - -#ifdef DEBUG_SENDEVENT - printk("HvCallEvent_signalLpEvent: *event = %016lx\n ", - (unsigned long)event); -#endif - abs_addr = virt_to_abs(event); - return HvCall1(HvCallEventSignalLpEvent, abs_addr); + return HvCall1(HvCallEventSignalLpEvent, virt_to_abs(event)); } static inline HvLpEvent_Rc HvCallEvent_signalLpEventFast(HvLpIndex targetLp, @@ -127,17 +92,21 @@ static inline HvLpEvent_Rc HvCallEvent_s { /* Pack the misc bits into a single Dword to pass to PLIC */ union { - struct HvCallEvent_PackedParms parms; + struct { + u8 ack_and_target; + u8 type; + u16 subtype; + HvLpInstanceId src_inst; + HvLpInstanceId target_inst; + } parms; u64 dword; } packed; - packed.parms.xAckType = ackType; - packed.parms.xAckInd = ackInd; - packed.parms.xRsvd = 0; - packed.parms.xTargetLp = targetLp; - packed.parms.xType = type; - packed.parms.xSubtype = subtype; - packed.parms.xSourceInstId = sourceInstanceId; - packed.parms.xTargetInstId = targetInstanceId; + + packed.parms.ack_and_target = (ackType << 7) | (ackInd << 6) | targetLp; + packed.parms.type = type; + packed.parms.subtype = subtype; + packed.parms.src_inst = sourceInstanceId; + packed.parms.target_inst = targetInstanceId; return HvCall7(HvCallEventSignalLpEventParms, packed.dword, correlationToken, eventData1, eventData2, @@ -146,18 +115,12 @@ static inline HvLpEvent_Rc HvCallEvent_s static inline HvLpEvent_Rc HvCallEvent_ackLpEvent(struct HvLpEvent *event) { - u64 abs_addr; - - abs_addr = virt_to_abs(event); - return HvCall1(HvCallEventAckLpEvent, abs_addr); + return HvCall1(HvCallEventAckLpEvent, virt_to_abs(event)); } static inline HvLpEvent_Rc HvCallEvent_cancelLpEvent(struct HvLpEvent *event) { - u64 abs_addr; - - abs_addr = virt_to_abs(event); - return HvCall1(HvCallEventCancelLpEvent, abs_addr); + return HvCall1(HvCallEventCancelLpEvent, virt_to_abs(event)); } static inline HvLpInstanceId HvCallEvent_getSourceLpInstanceId( @@ -195,59 +158,34 @@ static inline HvLpDma_Rc HvCallEvent_dma { /* Pack the misc bits into a single Dword to pass to PLIC */ union { - struct HvCallEvent_PackedDmaParms parms; + struct { + u8 flags; + HvLpIndex remote; + u8 type; + u8 reserved; + HvLpInstanceId local_inst; + HvLpInstanceId remote_inst; + } parms; u64 dword; } packed; - packed.parms.xDirection = direction; - packed.parms.xLocalAddrType = localAddressType; - packed.parms.xRemoteAddrType = remoteAddressType; - packed.parms.xRsvd1 = 0; - packed.parms.xRemoteLp = remoteLp; - packed.parms.xType = type; - packed.parms.xRsvd2 = 0; - packed.parms.xLocalInstId = localInstanceId; - packed.parms.xRemoteInstId = remoteInstanceId; + packed.parms.flags = (direction << 7) | + (localAddressType << 6) | (remoteAddressType << 5); + packed.parms.remote = remoteLp; + packed.parms.type = type; + packed.parms.reserved = 0; + packed.parms.local_inst = localInstanceId; + packed.parms.remote_inst = remoteInstanceId; return HvCall4(HvCallEventDmaBufList, packed.dword, localBufList, remoteBufList, transferLength); } -static inline HvLpDma_Rc HvCallEvent_dmaSingle(HvLpEvent_Type type, - HvLpIndex remoteLp, HvLpDma_Direction direction, - HvLpInstanceId localInstanceId, - HvLpInstanceId remoteInstanceId, - HvLpDma_AddressType localAddressType, - HvLpDma_AddressType remoteAddressType, - u64 localAddrOrTce, u64 remoteAddrOrTce, u32 transferLength) -{ - /* Pack the misc bits into a single Dword to pass to PLIC */ - union { - struct HvCallEvent_PackedDmaParms parms; - u64 dword; - } packed; - - packed.parms.xDirection = direction; - packed.parms.xLocalAddrType = localAddressType; - packed.parms.xRemoteAddrType = remoteAddressType; - packed.parms.xRsvd1 = 0; - packed.parms.xRemoteLp = remoteLp; - packed.parms.xType = type; - packed.parms.xRsvd2 = 0; - packed.parms.xLocalInstId = localInstanceId; - packed.parms.xRemoteInstId = remoteInstanceId; - - return (HvLpDma_Rc)HvCall4(HvCallEventDmaSingle, packed.dword, - localAddrOrTce, remoteAddrOrTce, transferLength); -} - static inline HvLpDma_Rc HvCallEvent_dmaToSp(void *local, u32 remote, u32 length, HvLpDma_Direction dir) { - u64 abs_addr; - - abs_addr = virt_to_abs(local); - return HvCall4(HvCallEventDmaToSp, abs_addr, remote, length, dir); + return HvCall4(HvCallEventDmaToSp, virt_to_abs(local), remote, + length, dir); } #endif /* _ASM_POWERPC_ISERIES_HV_CALL_EVENT_H */ -- 1.0.8 From sfr at canb.auug.org.au Thu Jan 12 13:50:18 2006 From: sfr at canb.auug.org.au (Stephen Rothwell) Date: Thu, 12 Jan 2006 13:50:18 +1100 Subject: [PATCH 3/7] powerpc: eliminate bitfields from ItLpNaca In-Reply-To: <20060112133537.2951952c.sfr@canb.auug.org.au> References: <20060112133537.2951952c.sfr@canb.auug.org.au> Message-ID: <20060112135018.578507ff.sfr@canb.auug.org.au> Signed-off-by: Stephen Rothwell --- arch/powerpc/platforms/iseries/lpardata.c | 5 +---- include/asm-powerpc/iseries/it_lp_naca.h | 21 +++++++++++---------- 2 files changed, 12 insertions(+), 14 deletions(-) -- Cheers, Stephen Rothwell sfr at canb.auug.org.au http://www.canb.auug.org.au/~sfr/ a920c7676e0030a5a51735c6d7d689f95d97b850 diff --git a/arch/powerpc/platforms/iseries/lpardata.c b/arch/powerpc/platforms/iseries/lpardata.c index ea72385..438e2db 100644 --- a/arch/powerpc/platforms/iseries/lpardata.c +++ b/arch/powerpc/platforms/iseries/lpardata.c @@ -93,10 +93,7 @@ struct ItLpNaca itLpNaca = { .xPirEnvironMode = 0, /* Piranha stuff */ .xPirConsoleMode = 0, .xPirDasdMode = 0, - .xLparInstalled = 0, - .xSysPartitioned = 0, - .xHwSyncedTBs = 0, - .xIntProcUtilHmt = 0, + .flags = 0, .xSpVpdFormat = 0, .xIntProcRatio = 0, .xPlicVrmIndex = 0, /* VRM index of PLIC */ diff --git a/include/asm-powerpc/iseries/it_lp_naca.h b/include/asm-powerpc/iseries/it_lp_naca.h index c3ef1de..cc29899 100644 --- a/include/asm-powerpc/iseries/it_lp_naca.h +++ b/include/asm-powerpc/iseries/it_lp_naca.h @@ -37,17 +37,13 @@ struct ItLpNaca { u8 xLpIndex; // LP Index x0B-x0B u16 xMaxLpQueues; // Number of allocated queues x0C-x0D u16 xLpQueueOffset; // Offset to start of LP queues x0E-x0F - u8 xPirEnvironMode:8; // Piranha or hardware x10-x10 - u8 xPirConsoleMode:8; // Piranha console indicator x11-x11 - u8 xPirDasdMode:8; // Piranha dasd indicator x12-x12 + u8 xPirEnvironMode; // Piranha or hardware x10-x10 + u8 xPirConsoleMode; // Piranha console indicator x11-x11 + u8 xPirDasdMode; // Piranha dasd indicator x12-x12 u8 xRsvd1_0[5]; // Reserved for Piranha related x13-x17 - u8 xLparInstalled:1; // Is LPAR installed on system x18-x1F - u8 xSysPartitioned:1; // Is the system partitioned ... - u8 xHwSyncedTBs:1; // Hardware synced TBs ... - u8 xIntProcUtilHmt:1; // Utilize HMT for interrupts ... - u8 xRsvd1_1:4; // Reserved ... - u8 xSpVpdFormat:8; // VPD areas are in CSP format ... - u8 xIntProcRatio:8; // Ratio of int procs to procs ... + u8 flags; // flags, see below x18-x1F + u8 xSpVpdFormat; // VPD areas are in CSP format ... + u8 xIntProcRatio; // Ratio of int procs to procs ... u8 xRsvd1_2[5]; // Reserved ... u16 xRsvd1_3; // Reserved x20-x21 u16 xPlicVrmIndex; // VRM index of PLIC x22-x23 @@ -77,4 +73,9 @@ struct ItLpNaca { extern struct ItLpNaca itLpNaca; +#define ITLPNACA_LPAR 0x80 /* Is LPAR installed on the system */ +#define ITLPNACA_PARTITIONED 0x40 /* Is the system partitioned */ +#define ITLPNACA_HWSYNCEDTBS 0x20 /* Hardware synced TBs */ +#define ITLPNACA_HMTINT 0x10 /* Utilize MHT for interrupts */ + #endif /* _ASM_POWERPC_ISERIES_IT_LP_NACA_H */ -- 1.0.8 From sfr at canb.auug.org.au Thu Jan 12 13:51:42 2006 From: sfr at canb.auug.org.au (Stephen Rothwell) Date: Thu, 12 Jan 2006 13:51:42 +1100 Subject: [PATCH 4/7] powercp: iSeries include file comment cleanups In-Reply-To: <20060112133537.2951952c.sfr@canb.auug.org.au> References: <20060112133537.2951952c.sfr@canb.auug.org.au> Message-ID: <20060112135142.4d5f2b58.sfr@canb.auug.org.au> Mainly just removing file names from the comments. Signed-off-by: Stephen Rothwell --- include/asm-powerpc/iseries/hv_call.h | 4 +--- include/asm-powerpc/iseries/hv_call_sc.h | 1 - include/asm-powerpc/iseries/hv_lp_config.h | 1 - include/asm-powerpc/iseries/hv_lp_event.h | 1 - include/asm-powerpc/iseries/hv_types.h | 1 - include/asm-powerpc/iseries/iseries_io.h | 2 +- include/asm-powerpc/iseries/it_exp_vpd_panel.h | 1 - include/asm-powerpc/iseries/it_lp_naca.h | 1 - include/asm-powerpc/iseries/it_lp_queue.h | 1 - include/asm-powerpc/iseries/it_lp_reg_save.h | 3 +-- include/asm-powerpc/iseries/lpar_map.h | 1 - include/asm-powerpc/iseries/mf.h | 1 - include/asm-powerpc/iseries/vio.h | 1 - 13 files changed, 3 insertions(+), 16 deletions(-) -- Cheers, Stephen Rothwell sfr at canb.auug.org.au http://www.canb.auug.org.au/~sfr/ b7b40bb6bed4b473b752e5f1ceab26607c4c8d7f diff --git a/include/asm-powerpc/iseries/hv_call.h b/include/asm-powerpc/iseries/hv_call.h index e9f831c..162d653 100644 --- a/include/asm-powerpc/iseries/hv_call.h +++ b/include/asm-powerpc/iseries/hv_call.h @@ -1,5 +1,4 @@ /* - * HvCall.h * Copyright (C) 2001 Mike Corrigan IBM Corporation * * This program is free software; you can redistribute it and/or modify @@ -15,8 +14,7 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ -/* + * * This file contains the "hypervisor call" interface which is used to * drive the hypervisor from the OS. */ diff --git a/include/asm-powerpc/iseries/hv_call_sc.h b/include/asm-powerpc/iseries/hv_call_sc.h index dec7e9d..f5d2109 100644 --- a/include/asm-powerpc/iseries/hv_call_sc.h +++ b/include/asm-powerpc/iseries/hv_call_sc.h @@ -1,5 +1,4 @@ /* - * HvCallSc.h * Copyright (C) 2001 Mike Corrigan IBM Corporation * * This program is free software; you can redistribute it and/or modify diff --git a/include/asm-powerpc/iseries/hv_lp_config.h b/include/asm-powerpc/iseries/hv_lp_config.h index bc00f03..df8b207 100644 --- a/include/asm-powerpc/iseries/hv_lp_config.h +++ b/include/asm-powerpc/iseries/hv_lp_config.h @@ -1,5 +1,4 @@ /* - * HvLpConfig.h * Copyright (C) 2001 Mike Corrigan IBM Corporation * * This program is free software; you can redistribute it and/or modify diff --git a/include/asm-powerpc/iseries/hv_lp_event.h b/include/asm-powerpc/iseries/hv_lp_event.h index 8ee89b6..4065a4d 100644 --- a/include/asm-powerpc/iseries/hv_lp_event.h +++ b/include/asm-powerpc/iseries/hv_lp_event.h @@ -1,5 +1,4 @@ /* - * HvLpEvent.h * Copyright (C) 2001 Mike Corrigan IBM Corporation * * This program is free software; you can redistribute it and/or modify diff --git a/include/asm-powerpc/iseries/hv_types.h b/include/asm-powerpc/iseries/hv_types.h index c38f7e3..c3e6d2a 100644 --- a/include/asm-powerpc/iseries/hv_types.h +++ b/include/asm-powerpc/iseries/hv_types.h @@ -1,5 +1,4 @@ /* - * HvTypes.h * Copyright (C) 2001 Mike Corrigan IBM Corporation * * This program is free software; you can redistribute it and/or modify diff --git a/include/asm-powerpc/iseries/iseries_io.h b/include/asm-powerpc/iseries/iseries_io.h index 56b2113..d1c317c 100644 --- a/include/asm-powerpc/iseries/iseries_io.h +++ b/include/asm-powerpc/iseries/iseries_io.h @@ -6,7 +6,7 @@ #ifdef CONFIG_PPC_ISERIES #include /* - * File iSeries_io.h created by Allan Trautman on Thu Dec 28 2000. + * Created by Allan Trautman on Thu Dec 28 2000. * * Remaps the io.h for the iSeries Io * Copyright (C) 2000 Allan H Trautman, IBM Corporation diff --git a/include/asm-powerpc/iseries/it_exp_vpd_panel.h b/include/asm-powerpc/iseries/it_exp_vpd_panel.h index 66a17a2..304a609 100644 --- a/include/asm-powerpc/iseries/it_exp_vpd_panel.h +++ b/include/asm-powerpc/iseries/it_exp_vpd_panel.h @@ -1,5 +1,4 @@ /* - * ItExtVpdPanel.h * Copyright (C) 2002 Dave Boutcher IBM Corporation * * This program is free software; you can redistribute it and/or modify diff --git a/include/asm-powerpc/iseries/it_lp_naca.h b/include/asm-powerpc/iseries/it_lp_naca.h index cc29899..4fdcf05 100644 --- a/include/asm-powerpc/iseries/it_lp_naca.h +++ b/include/asm-powerpc/iseries/it_lp_naca.h @@ -1,5 +1,4 @@ /* - * ItLpNaca.h * Copyright (C) 2001 Mike Corrigan IBM Corporation * * This program is free software; you can redistribute it and/or modify diff --git a/include/asm-powerpc/iseries/it_lp_queue.h b/include/asm-powerpc/iseries/it_lp_queue.h index a60d03a..b7c6fc1 100644 --- a/include/asm-powerpc/iseries/it_lp_queue.h +++ b/include/asm-powerpc/iseries/it_lp_queue.h @@ -1,5 +1,4 @@ /* - * ItLpQueue.h * Copyright (C) 2001 Mike Corrigan IBM Corporation * * This program is free software; you can redistribute it and/or modify diff --git a/include/asm-powerpc/iseries/it_lp_reg_save.h b/include/asm-powerpc/iseries/it_lp_reg_save.h index 81824e1..5403b75 100644 --- a/include/asm-powerpc/iseries/it_lp_reg_save.h +++ b/include/asm-powerpc/iseries/it_lp_reg_save.h @@ -1,5 +1,4 @@ /* - * ItLpRegSave.h * Copyright (C) 2001 Mike Corrigan IBM Corporation * * This program is free software; you can redistribute it and/or modify @@ -83,4 +82,4 @@ struct ItLpRegSave { extern struct ItLpRegSave iseries_reg_save[]; -#endif /* _ITLPREGSAVE_H */ +#endif /* _ASM_POWERPC_ISERIES_IT_LP_REG_SAVE_H */ diff --git a/include/asm-powerpc/iseries/lpar_map.h b/include/asm-powerpc/iseries/lpar_map.h index 84fc321..2ec384d 100644 --- a/include/asm-powerpc/iseries/lpar_map.h +++ b/include/asm-powerpc/iseries/lpar_map.h @@ -1,5 +1,4 @@ /* - * LparMap.h * Copyright (C) 2001 Mike Corrigan IBM Corporation * * This program is free software; you can redistribute it and/or modify diff --git a/include/asm-powerpc/iseries/mf.h b/include/asm-powerpc/iseries/mf.h index e7bd57a..857e520 100644 --- a/include/asm-powerpc/iseries/mf.h +++ b/include/asm-powerpc/iseries/mf.h @@ -1,5 +1,4 @@ /* - * mf.h * Copyright (C) 2001 Troy D. Armstrong IBM Corporation * Copyright (C) 2004 Stephen Rothwell IBM Corporation * diff --git a/include/asm-powerpc/iseries/vio.h b/include/asm-powerpc/iseries/vio.h index 7e3a469..72a97d3 100644 --- a/include/asm-powerpc/iseries/vio.h +++ b/include/asm-powerpc/iseries/vio.h @@ -1,5 +1,4 @@ /* -*- linux-c -*- - * drivers/char/vio.h * * iSeries Virtual I/O Message Path header * -- 1.0.8 From sfr at canb.auug.org.au Thu Jan 12 13:54:20 2006 From: sfr at canb.auug.org.au (Stephen Rothwell) Date: Thu, 12 Jan 2006 13:54:20 +1100 Subject: [PATCH 5/7] powerpc: iSeries fixes for build with no PCI In-Reply-To: <20060112133537.2951952c.sfr@canb.auug.org.au> References: <20060112133537.2951952c.sfr@canb.auug.org.au> Message-ID: <20060112135420.19163790.sfr@canb.auug.org.au> This reverts part of "ppc64 iSeries: allow build with no PCI" (145d01e4287b8cbf50f87c3283e33bf5c84e8468) which affected generic code and applies a fix in the arch specific code. Commit "partly merge iseries do_IRQ" (5fee9b3b39eb55c7e3619a3b36ceeabffeb8f144) introduced iSeries_get_irq which was only available if CONFIG_PCI is set. Signed-off-by: Stephen Rothwell --- arch/powerpc/platforms/iseries/Makefile | 4 ++-- arch/powerpc/platforms/iseries/irq.c | 6 ++++++ drivers/char/mem.c | 8 ++++---- include/asm-powerpc/iseries/iseries_io.h | 12 ++++++++++++ 4 files changed, 24 insertions(+), 6 deletions(-) -- Cheers, Stephen Rothwell sfr at canb.auug.org.au http://www.canb.auug.org.au/~sfr/ e4e52470fa4df61a2683d5af697dead148e8c288 diff --git a/arch/powerpc/platforms/iseries/Makefile b/arch/powerpc/platforms/iseries/Makefile index 127b465..ce8c0b9 100644 --- a/arch/powerpc/platforms/iseries/Makefile +++ b/arch/powerpc/platforms/iseries/Makefile @@ -1,8 +1,8 @@ EXTRA_CFLAGS += -mno-minimal-toc obj-y += hvlog.o hvlpconfig.o lpardata.o setup.o mf.o lpevents.o \ - hvcall.o proc.o htab.o iommu.o misc.o -obj-$(CONFIG_PCI) += pci.o irq.o vpdinfo.o + hvcall.o proc.o htab.o iommu.o misc.o irq.o +obj-$(CONFIG_PCI) += pci.o vpdinfo.o obj-$(CONFIG_IBMVIO) += vio.o obj-$(CONFIG_SMP) += smp.o obj-$(CONFIG_VIOPATH) += viopath.o diff --git a/arch/powerpc/platforms/iseries/irq.c b/arch/powerpc/platforms/iseries/irq.c index 3d02385..83442ea 100644 --- a/arch/powerpc/platforms/iseries/irq.c +++ b/arch/powerpc/platforms/iseries/irq.c @@ -48,6 +48,8 @@ extern void iSeries_smp_message_recv(struct pt_regs *); #endif +#ifdef CONFIG_PCI + enum pci_event_type { pe_bus_created = 0, /* PHB has been created */ pe_bus_error = 1, /* PHB has failed */ @@ -325,6 +327,8 @@ int __init iSeries_allocate_IRQ(HvBusNum return virtirq; } +#endif /* CONFIG_PCI */ + /* * Get the next pending IRQ. */ @@ -344,6 +348,7 @@ int iSeries_get_irq(struct pt_regs *regs if (hvlpevent_is_pending()) process_hvlpevents(regs); +#ifdef CONFIG_PCI if (num_pending_irqs) { spin_lock(&pending_irqs_lock); for (irq = 0; irq < NR_IRQS; irq++) { @@ -357,6 +362,7 @@ int iSeries_get_irq(struct pt_regs *regs if (irq >= NR_IRQS) irq = -2; } +#endif return irq; } diff --git a/drivers/char/mem.c b/drivers/char/mem.c index 91dd669..d4dc776 100644 --- a/drivers/char/mem.c +++ b/drivers/char/mem.c @@ -519,7 +519,7 @@ static ssize_t write_kmem(struct file * return virtr + wrote; } -#if (defined(CONFIG_ISA) || !defined(__mc68000__)) && (!defined(CONFIG_PPC_ISERIES) || defined(CONFIG_PCI)) +#if defined(CONFIG_ISA) || !defined(__mc68000__) static ssize_t read_port(struct file * file, char __user * buf, size_t count, loff_t *ppos) { @@ -780,7 +780,7 @@ static struct file_operations null_fops .write = write_null, }; -#if (defined(CONFIG_ISA) || !defined(__mc68000__)) && (!defined(CONFIG_PPC_ISERIES) || defined(CONFIG_PCI)) +#if defined(CONFIG_ISA) || !defined(__mc68000__) static struct file_operations port_fops = { .llseek = memory_lseek, .read = read_port, @@ -847,7 +847,7 @@ static int memory_open(struct inode * in case 3: filp->f_op = &null_fops; break; -#if (defined(CONFIG_ISA) || !defined(__mc68000__)) && (!defined(CONFIG_PPC_ISERIES) || defined(CONFIG_PCI)) +#if defined(CONFIG_ISA) || !defined(__mc68000__) case 4: filp->f_op = &port_fops; break; @@ -894,7 +894,7 @@ static const struct { {1, "mem", S_IRUSR | S_IWUSR | S_IRGRP, &mem_fops}, {2, "kmem", S_IRUSR | S_IWUSR | S_IRGRP, &kmem_fops}, {3, "null", S_IRUGO | S_IWUGO, &null_fops}, -#if (defined(CONFIG_ISA) || !defined(__mc68000__)) && (!defined(CONFIG_PPC_ISERIES) || defined(CONFIG_PCI)) +#if defined(CONFIG_ISA) || !defined(__mc68000__) {4, "port", S_IRUSR | S_IWUSR | S_IRGRP, &port_fops}, #endif {5, "zero", S_IRUGO | S_IWUGO, &zero_fops}, diff --git a/include/asm-powerpc/iseries/iseries_io.h b/include/asm-powerpc/iseries/iseries_io.h index d1c317c..496aa85 100644 --- a/include/asm-powerpc/iseries/iseries_io.h +++ b/include/asm-powerpc/iseries/iseries_io.h @@ -32,6 +32,7 @@ * End Change Activity */ +#ifdef CONFIG_PCI extern u8 iSeries_Read_Byte(const volatile void __iomem * IoAddress); extern u16 iSeries_Read_Word(const volatile void __iomem * IoAddress); extern u32 iSeries_Read_Long(const volatile void __iomem * IoAddress); @@ -44,6 +45,17 @@ extern void iSeries_memcpy_toio(volatile size_t n); extern void iSeries_memcpy_fromio(void *dest, const volatile void __iomem *source, size_t n); +#else +static inline u8 iSeries_Read_Byte(const volatile void __iomem *IoAddress) +{ + return 0xff; +} + +static inline void iSeries_Write_Byte(u8 IoData, + volatile void __iomem *IoAddress) +{ +} +#endif /* CONFIG_PCI */ #endif /* CONFIG_PPC_ISERIES */ #endif /* _ASM_POWERPC_ISERIES_ISERIES_IO_H */ -- 1.0.8 From sfr at canb.auug.org.au Thu Jan 12 13:58:19 2006 From: sfr at canb.auug.org.au (Stephen Rothwell) Date: Thu, 12 Jan 2006 13:58:19 +1100 Subject: [PATCH 6/7] powerpc: clean up iommu.h a bit In-Reply-To: <20060112133537.2951952c.sfr@canb.auug.org.au> References: <20060112133537.2951952c.sfr@canb.auug.org.au> Message-ID: <20060112135819.6924ccb2.sfr@canb.auug.org.au> There was a function declared for CONFIG_PSERIES which no longer exists and the two function declarations for CONFIG_ISERIES have been moved into an include file in platforms/iseries since they are defined and used only there. Signed-off-by: Stephen Rothwell --- arch/powerpc/platforms/iseries/iommu.c | 2 ++ arch/powerpc/platforms/iseries/iommu.h | 35 ++++++++++++++++++++++++++++++++ arch/powerpc/platforms/iseries/pci.c | 1 + arch/powerpc/platforms/iseries/vio.c | 2 ++ include/asm-powerpc/iommu.h | 19 ----------------- 5 files changed, 40 insertions(+), 19 deletions(-) create mode 100644 arch/powerpc/platforms/iseries/iommu.h -- Cheers, Stephen Rothwell sfr at canb.auug.org.au http://www.canb.auug.org.au/~sfr/ 665171a8436e2d543df9844402958e1ac58744af diff --git a/arch/powerpc/platforms/iseries/iommu.c b/arch/powerpc/platforms/iseries/iommu.c index 2b54eeb..bea0b70 100644 --- a/arch/powerpc/platforms/iseries/iommu.c +++ b/arch/powerpc/platforms/iseries/iommu.c @@ -34,6 +34,8 @@ #include #include +#include "iommu.h" + extern struct list_head iSeries_Global_Device_List; diff --git a/arch/powerpc/platforms/iseries/iommu.h b/arch/powerpc/platforms/iseries/iommu.h new file mode 100644 index 0000000..cb5658f --- /dev/null +++ b/arch/powerpc/platforms/iseries/iommu.h @@ -0,0 +1,35 @@ +#ifndef _PLATFORMS_ISERIES_IOMMU_H +#define _PLATFORMS_ISERIES_IOMMU_H + +/* + * Copyright (C) 2005 Stephen Rothwell, IBM Corporation + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the: + * Free Software Foundation, Inc., + * 59 Temple Place, Suite 330, + * Boston, MA 02111-1307 USA + */ + +struct device_node; +struct iommu_table; + +/* Creates table for an individual device node */ +extern void iommu_devnode_init_iSeries(struct device_node *dn); + +/* Get table parameters from HV */ +extern void iommu_table_getparms_iSeries(unsigned long busno, + unsigned char slotno, unsigned char virtbus, + struct iommu_table *tbl); + +#endif /* _PLATFORMS_ISERIES_IOMMU_H */ diff --git a/arch/powerpc/platforms/iseries/pci.c b/arch/powerpc/platforms/iseries/pci.c index dafc518..a19833b 100644 --- a/arch/powerpc/platforms/iseries/pci.c +++ b/arch/powerpc/platforms/iseries/pci.c @@ -43,6 +43,7 @@ #include "irq.h" #include "pci.h" #include "call_pci.h" +#include "iommu.h" extern unsigned long io_page_mask; diff --git a/arch/powerpc/platforms/iseries/vio.c b/arch/powerpc/platforms/iseries/vio.c index 384360e..ad36ab0 100644 --- a/arch/powerpc/platforms/iseries/vio.c +++ b/arch/powerpc/platforms/iseries/vio.c @@ -22,6 +22,8 @@ #include #include +#include "iommu.h" + struct device *iSeries_vio_dev = &vio_bus_device.dev; EXPORT_SYMBOL(iSeries_vio_dev); diff --git a/include/asm-powerpc/iommu.h b/include/asm-powerpc/iommu.h index 8a8393e..d5677cb 100644 --- a/include/asm-powerpc/iommu.h +++ b/include/asm-powerpc/iommu.h @@ -64,25 +64,6 @@ extern void iommu_free_table(struct devi #endif /* CONFIG_PPC_MULTIPLATFORM */ -#ifdef CONFIG_PPC_PSERIES - -/* Creates table for an individual device node */ -extern void iommu_devnode_init_pSeries(struct device_node *dn); - -#endif /* CONFIG_PPC_PSERIES */ - -#ifdef CONFIG_PPC_ISERIES - -/* Creates table for an individual device node */ -extern void iommu_devnode_init_iSeries(struct device_node *dn); -/* Get table parameters from HV */ -extern void iommu_table_getparms_iSeries(unsigned long busno, - unsigned char slotno, - unsigned char virtbus, - struct iommu_table* tbl); - -#endif /* CONFIG_PPC_ISERIES */ - /* Initializes an iommu_table based in values set in the passed-in * structure */ -- 1.0.8 From sfr at canb.auug.org.au Thu Jan 12 14:18:28 2006 From: sfr at canb.auug.org.au (Stephen Rothwell) Date: Thu, 12 Jan 2006 14:18:28 +1100 Subject: [PATCH 7/7] powerpc: small pci cleanups In-Reply-To: <20060112133537.2951952c.sfr@canb.auug.org.au> References: <20060112133537.2951952c.sfr@canb.auug.org.au> Message-ID: <20060112141828.3d60c3e1.sfr@canb.auug.org.au> pcibios_claim_one_bus is not needed on iSeries and phbs_remap_io can be mode static. Signed-off-by: Stephen Rothwell --- arch/powerpc/kernel/pci_64.c | 5 +++-- include/asm-powerpc/pci-bridge.h | 2 -- 2 files changed, 3 insertions(+), 4 deletions(-) -- Cheers, Stephen Rothwell sfr at canb.auug.org.au http://www.canb.auug.org.au/~sfr/ 284412a6d950894f284218b219b7c47adf544a01 diff --git a/arch/powerpc/kernel/pci_64.c b/arch/powerpc/kernel/pci_64.c index ba21a6c..5db00c5 100644 --- a/arch/powerpc/kernel/pci_64.c +++ b/arch/powerpc/kernel/pci_64.c @@ -53,6 +53,7 @@ EXPORT_SYMBOL(io_page_mask); #ifdef CONFIG_PPC_MULTIPLATFORM static void fixup_resource(struct resource *res, struct pci_dev *dev); static void do_bus_setup(struct pci_bus *bus); +static void phbs_remap_io(void); #endif /* pci_io_base -- the base address from which io bars are offsets. @@ -251,6 +252,7 @@ void pcibios_free_controller(struct pci_ kfree(phb); } +#ifndef CONFIG_PPC_ISERIES void __devinit pcibios_claim_one_bus(struct pci_bus *b) { struct pci_dev *dev; @@ -272,7 +274,6 @@ void __devinit pcibios_claim_one_bus(str pcibios_claim_one_bus(child_bus); } -#ifndef CONFIG_PPC_ISERIES static void __init pcibios_claim_of_setup(void) { struct pci_bus *b; @@ -1215,7 +1216,7 @@ int remap_bus_range(struct pci_bus *bus) } EXPORT_SYMBOL(remap_bus_range); -void phbs_remap_io(void) +static void phbs_remap_io(void) { struct pci_controller *hose, *tmp; diff --git a/include/asm-powerpc/pci-bridge.h b/include/asm-powerpc/pci-bridge.h index b0d816f..38de92d 100644 --- a/include/asm-powerpc/pci-bridge.h +++ b/include/asm-powerpc/pci-bridge.h @@ -142,8 +142,6 @@ void pcibios_fixup_new_pci_devices(struc extern int pcibios_remove_root_bus(struct pci_controller *phb); -extern void phbs_remap_io(void); - static inline struct pci_controller *pci_bus_to_host(struct pci_bus *bus) { struct device_node *busdn = bus->sysdata; -- 1.0.8 From gregkh at suse.de Thu Jan 12 16:36:22 2006 From: gregkh at suse.de (Greg KH) Date: Wed, 11 Jan 2006 21:36:22 -0800 Subject: [PATCH 1/3] msi vector targeting abstractions In-Reply-To: <20060112050243.GC332@colo.lackof.org> References: <20060111155251.12460.71269.12163@attica.americas.sgi.com> <20060111155256.12460.26048.32596@attica.americas.sgi.com> <20060112050243.GC332@colo.lackof.org> Message-ID: <20060112053622.GA29142@suse.de> On Wed, Jan 11, 2006 at 10:02:43PM -0700, Grant Grundler wrote: > On Wed, Jan 11, 2006 at 09:52:56AM -0600, Mark Maule wrote: > > Abstract portions of the MSI core for platforms that do not use standard > > APIC interrupt controllers. This is implemented through a new arch-specific > > msi setup routine, and a set of msi ops which can be set on a per platform > > basis. > ... > > Index: linux-maule/drivers/pci/msi.c > ... > > + if ((status = msi_arch_init()) < 0) { > > Willy told me I should always complain about assignment in if() statements :) > > Greg, I volunteer to submit a patch to fix all occurances in pci/msi.c > including the one above. I can prepare that this weekend on my own time. > Is that ok? Yes, that would be wonderful to have. thanks, greg k-h From grundler at parisc-linux.org Thu Jan 12 16:02:43 2006 From: grundler at parisc-linux.org (Grant Grundler) Date: Wed, 11 Jan 2006 22:02:43 -0700 Subject: [PATCH 1/3] msi vector targeting abstractions In-Reply-To: <20060111155256.12460.26048.32596@attica.americas.sgi.com> References: <20060111155251.12460.71269.12163@attica.americas.sgi.com> <20060111155256.12460.26048.32596@attica.americas.sgi.com> Message-ID: <20060112050243.GC332@colo.lackof.org> On Wed, Jan 11, 2006 at 09:52:56AM -0600, Mark Maule wrote: > Abstract portions of the MSI core for platforms that do not use standard > APIC interrupt controllers. This is implemented through a new arch-specific > msi setup routine, and a set of msi ops which can be set on a per platform > basis. ... > Index: linux-maule/drivers/pci/msi.c ... > + if ((status = msi_arch_init()) < 0) { Willy told me I should always complain about assignment in if() statements :) Greg, I volunteer to submit a patch to fix all occurances in pci/msi.c including the one above. I can prepare that this weekend on my own time. Is that ok? grant From paulus at samba.org Thu Jan 12 16:47:27 2006 From: paulus at samba.org (Paul Mackerras) Date: Thu, 12 Jan 2006 16:47:27 +1100 Subject: [PATCH 1/3] msi vector targeting abstractions In-Reply-To: <20060112050243.GC332@colo.lackof.org> References: <20060111155251.12460.71269.12163@attica.americas.sgi.com> <20060111155256.12460.26048.32596@attica.americas.sgi.com> <20060112050243.GC332@colo.lackof.org> Message-ID: <17349.60783.236661.875374@cargo.ozlabs.ibm.com> Grant Grundler writes: > > + if ((status = msi_arch_init()) < 0) { > > Willy told me I should always complain about assignment in if() statements :) We are getting incredibly politically correct these days, aren't we. I see nothing wrong with that if statement. It's perfectly valid, idiomatic C. You can ignore Willy if you like. :) (I would look askance at something that did an assignment as one of the parameters of a procedure call in an if statement, though.) Paul. From michael at ellerman.id.au Thu Jan 12 17:09:58 2006 From: michael at ellerman.id.au (Michael Ellerman) Date: Thu, 12 Jan 2006 17:09:58 +1100 Subject: [PATCH 0/4] powerpc: Random firmware feature related cleanups Message-ID: <1137046198.56732.289003998582.qpush@concordia> This is a few patches I've had lying around for a while. Booted on iSeries & pSeries LPAR, built for G5 and pmac32 (which breaks elsewhere). From michael at ellerman.id.au Thu Jan 12 17:09:59 2006 From: michael at ellerman.id.au (Michael Ellerman) Date: Thu, 12 Jan 2006 17:09:59 +1100 Subject: [PATCH 1/4] powerpc: Add firmware_set_feature() In-Reply-To: <1137046198.56732.289003998582.qpush@concordia> Message-ID: <20060112061010.55D6A68A40@ozlabs.org> We have firmware_has_feature() to test for features, add firmware_set_feature() so that no one needs to touch ppc64_firmware_features directly. ppc64_firmware_features will be initialised to 0, but make it explicit. Signed-off-by: Michael Ellerman --- arch/powerpc/kernel/firmware.c | 2 +- arch/powerpc/platforms/iseries/setup.c | 2 +- include/asm-powerpc/firmware.h | 7 ++++++- 3 files changed, 8 insertions(+), 3 deletions(-) Index: linux/include/asm-powerpc/firmware.h =================================================================== --- linux.orig/include/asm-powerpc/firmware.h +++ linux/include/asm-powerpc/firmware.h @@ -79,7 +79,7 @@ enum { }; /* This is used to identify firmware features which are available - * to the kernel. + * to the kernel. Don't use this directly, use the macros below. */ extern unsigned long ppc64_firmware_features; @@ -89,6 +89,11 @@ static inline unsigned long firmware_has (FW_FEATURE_POSSIBLE & ppc64_firmware_features & feature); } +static inline void firmware_set_feature(unsigned long feature) +{ + ppc64_firmware_features |= FW_FEATURE_POSSIBLE & feature; +} + #ifdef CONFIG_PPC_PSERIES typedef struct { unsigned long val; Index: linux/arch/powerpc/platforms/iseries/setup.c =================================================================== --- linux.orig/arch/powerpc/platforms/iseries/setup.c +++ linux/arch/powerpc/platforms/iseries/setup.c @@ -303,7 +303,7 @@ static void __init iSeries_init_early(vo { DBG(" -> iSeries_init_early()\n"); - ppc64_firmware_features = FW_FEATURE_ISERIES; + firmware_set_feature(FW_FEATURE_ISERIES); ppc64_interrupt_controller = IC_ISERIES; Index: linux/arch/powerpc/kernel/firmware.c =================================================================== --- linux.orig/arch/powerpc/kernel/firmware.c +++ linux/arch/powerpc/kernel/firmware.c @@ -17,7 +17,7 @@ #include -unsigned long ppc64_firmware_features; +unsigned long ppc64_firmware_features = 0; #ifdef CONFIG_PPC_PSERIES firmware_feature_t firmware_features_table[FIRMWARE_MAX_FEATURES] = { From michael at ellerman.id.au Thu Jan 12 17:10:00 2006 From: michael at ellerman.id.au (Michael Ellerman) Date: Thu, 12 Jan 2006 17:10:00 +1100 Subject: [PATCH 2/4] powerpc: Cleanup pSeries firmware feature initialisation In-Reply-To: <1137046198.56732.289003998582.qpush@concordia> Message-ID: <20060112061012.0678A68A52@ozlabs.org> Cleanup fw_feature_init in platforms/pseries/setup.c to use the new firmware_set_feature(), cleanup white space and replace the while loop with a for loop - which seems clearer to me. Signed-off-by: Michael Ellerman --- arch/powerpc/platforms/pseries/setup.c | 46 +++++++++++++++------------------ 1 files changed, 21 insertions(+), 25 deletions(-) Index: linux/arch/powerpc/platforms/pseries/setup.c =================================================================== --- linux.orig/arch/powerpc/platforms/pseries/setup.c +++ linux/arch/powerpc/platforms/pseries/setup.c @@ -263,48 +263,44 @@ static int __init pSeries_init_panel(voi arch_initcall(pSeries_init_panel); -/* Build up the ppc64_firmware_features bitmask field - * using contents of device-tree/ibm,hypertas-functions. - * Ultimately this functionality may be moved into prom.c prom_init(). +/* Build up the firmware features bitmask using the contents of + * device-tree/ibm,hypertas-functions. Ultimately this functionality may + * be moved into prom.c prom_init(). */ static void __init fw_feature_init(void) { - struct device_node * dn; - char * hypertas; - unsigned int len; + struct device_node *dn; + char *hyptertas, *s; + int len, i; DBG(" -> fw_feature_init()\n"); - ppc64_firmware_features = 0; dn = of_find_node_by_path("/rtas"); if (dn == NULL) { - printk(KERN_ERR "WARNING ! Cannot find RTAS in device-tree !\n"); + printk(KERN_ERR "WARNING! Cannot find RTAS in device-tree!\n"); goto no_rtas; } - hypertas = get_property(dn, "ibm,hypertas-functions", &len); - if (hypertas) { - while (len > 0){ - int i, hypertas_len; + hyptertas = get_property(dn, "ibm,hypertas-functions", &len); + if (hyptertas == NULL) + goto no_hypertas; + + for (s = hyptertas; s < hyptertas + len; s += strlen(s) + 1) { + for (i = 0; i < FIRMWARE_MAX_FEATURES; i++) { /* check value against table of strings */ - for(i=0; i < FIRMWARE_MAX_FEATURES ;i++) { - if ((firmware_features_table[i].name) && - (strcmp(firmware_features_table[i].name,hypertas))==0) { - /* we have a match */ - ppc64_firmware_features |= - (firmware_features_table[i].val); - break; - } - } - hypertas_len = strlen(hypertas); - len -= hypertas_len +1; - hypertas+= hypertas_len +1; + if (!firmware_features_table[i].name || + strcmp(firmware_features_table[i].name, s)) + continue; + + /* we have a match */ + firmware_set_feature(firmware_features_table[i].val); + break; } } +no_hypertas: of_node_put(dn); no_rtas: - DBG(" <- fw_feature_init()\n"); } From michael at ellerman.id.au Thu Jan 12 17:10:03 2006 From: michael at ellerman.id.au (Michael Ellerman) Date: Thu, 12 Jan 2006 17:10:03 +1100 Subject: [PATCH 3/4] powerpc: Move pSeries firmware feature setup into platforms/pseries In-Reply-To: <1137046198.56732.289003998582.qpush@concordia> Message-ID: <20060112061015.6870768A57@ozlabs.org> Currently we have some stuff in firmware.h and kernel/firmware.c that is #ifdef CONFIG_PPC_PSERIES. Move it all into platforms/pseries. Signed-off-by: Michael Ellerman --- arch/powerpc/kernel/firmware.c | 25 ------- arch/powerpc/platforms/pseries/Makefile | 3 arch/powerpc/platforms/pseries/firmware.c | 103 ++++++++++++++++++++++++++++++ arch/powerpc/platforms/pseries/firmware.h | 17 ++++ arch/powerpc/platforms/pseries/setup.c | 45 ------------- include/asm-powerpc/firmware.h | 9 -- 6 files changed, 123 insertions(+), 79 deletions(-) Index: linux/arch/powerpc/kernel/firmware.c =================================================================== --- linux.orig/arch/powerpc/kernel/firmware.c +++ linux/arch/powerpc/kernel/firmware.c @@ -18,28 +18,3 @@ #include unsigned long ppc64_firmware_features = 0; - -#ifdef CONFIG_PPC_PSERIES -firmware_feature_t firmware_features_table[FIRMWARE_MAX_FEATURES] = { - {FW_FEATURE_PFT, "hcall-pft"}, - {FW_FEATURE_TCE, "hcall-tce"}, - {FW_FEATURE_SPRG0, "hcall-sprg0"}, - {FW_FEATURE_DABR, "hcall-dabr"}, - {FW_FEATURE_COPY, "hcall-copy"}, - {FW_FEATURE_ASR, "hcall-asr"}, - {FW_FEATURE_DEBUG, "hcall-debug"}, - {FW_FEATURE_PERF, "hcall-perf"}, - {FW_FEATURE_DUMP, "hcall-dump"}, - {FW_FEATURE_INTERRUPT, "hcall-interrupt"}, - {FW_FEATURE_MIGRATE, "hcall-migrate"}, - {FW_FEATURE_PERFMON, "hcall-perfmon"}, - {FW_FEATURE_CRQ, "hcall-crq"}, - {FW_FEATURE_VIO, "hcall-vio"}, - {FW_FEATURE_RDMA, "hcall-rdma"}, - {FW_FEATURE_LLAN, "hcall-lLAN"}, - {FW_FEATURE_BULK, "hcall-bulk"}, - {FW_FEATURE_XDABR, "hcall-xdabr"}, - {FW_FEATURE_MULTITCE, "hcall-multi-tce"}, - {FW_FEATURE_SPLPAR, "hcall-splpar"}, -}; -#endif Index: linux/arch/powerpc/platforms/pseries/Makefile =================================================================== --- linux.orig/arch/powerpc/platforms/pseries/Makefile +++ linux/arch/powerpc/platforms/pseries/Makefile @@ -1,5 +1,6 @@ obj-y := pci.o lpar.o hvCall.o nvram.o reconfig.o \ - setup.o iommu.o ras.o rtasd.o pci_dlpar.o + setup.o iommu.o ras.o rtasd.o pci_dlpar.o \ + firmware.o obj-$(CONFIG_SMP) += smp.o obj-$(CONFIG_IBMVIO) += vio.o obj-$(CONFIG_XICS) += xics.o Index: linux/arch/powerpc/platforms/pseries/firmware.c =================================================================== --- /dev/null +++ linux/arch/powerpc/platforms/pseries/firmware.c @@ -0,0 +1,103 @@ +/* + * pSeries firmware setup code. + * + * Portions from arch/powerpc/platforms/pseries/setup.c: + * Copyright (C) 1995 Linus Torvalds + * Adapted from 'alpha' version by Gary Thomas + * Modified by Cort Dougan (cort at cs.nmt.edu) + * Modified by PPC64 Team, IBM Corp + * + * Portions from arch/powerpc/kernel/firmware.c + * Copyright (C) 2001 Ben. Herrenschmidt (benh at kernel.crashing.org) + * Modifications for ppc64: + * Copyright (C) 2003 Dave Engebretsen + * Copyright (C) 2005 Stephen Rothwell, IBM Corporation + * + * Copyright 2006 IBM Corporation. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version + * 2 of the License, or (at your option) any later version. + */ + +#undef DEBUG + +#include +#include + +#ifdef DEBUG +#define DBG(fmt...) udbg_printf(fmt) +#else +#define DBG(fmt...) +#endif + +typedef struct { + unsigned long val; + char * name; +} firmware_feature_t; + +static __initdata firmware_feature_t +firmware_features_table[FIRMWARE_MAX_FEATURES] = { + {FW_FEATURE_PFT, "hcall-pft"}, + {FW_FEATURE_TCE, "hcall-tce"}, + {FW_FEATURE_SPRG0, "hcall-sprg0"}, + {FW_FEATURE_DABR, "hcall-dabr"}, + {FW_FEATURE_COPY, "hcall-copy"}, + {FW_FEATURE_ASR, "hcall-asr"}, + {FW_FEATURE_DEBUG, "hcall-debug"}, + {FW_FEATURE_PERF, "hcall-perf"}, + {FW_FEATURE_DUMP, "hcall-dump"}, + {FW_FEATURE_INTERRUPT, "hcall-interrupt"}, + {FW_FEATURE_MIGRATE, "hcall-migrate"}, + {FW_FEATURE_PERFMON, "hcall-perfmon"}, + {FW_FEATURE_CRQ, "hcall-crq"}, + {FW_FEATURE_VIO, "hcall-vio"}, + {FW_FEATURE_RDMA, "hcall-rdma"}, + {FW_FEATURE_LLAN, "hcall-lLAN"}, + {FW_FEATURE_BULK, "hcall-bulk"}, + {FW_FEATURE_XDABR, "hcall-xdabr"}, + {FW_FEATURE_MULTITCE, "hcall-multi-tce"}, + {FW_FEATURE_SPLPAR, "hcall-splpar"}, +}; + +/* Build up the firmware features bitmask using the contents of + * device-tree/ibm,hypertas-functions. Ultimately this functionality may + * be moved into prom.c prom_init(). + */ +void __init fw_feature_init(void) +{ + struct device_node *dn; + char *hyptertas, *s; + int len, i; + + DBG(" -> fw_feature_init()\n"); + + dn = of_find_node_by_path("/rtas"); + if (dn == NULL) { + printk(KERN_ERR "WARNING! Cannot find RTAS in device-tree!\n"); + goto no_rtas; + } + + hyptertas = get_property(dn, "ibm,hypertas-functions", &len); + if (hyptertas == NULL) + goto no_hypertas; + + for (s = hyptertas; s < hyptertas + len; s += strlen(s) + 1) { + for (i = 0; i < FIRMWARE_MAX_FEATURES; i++) { + /* check value against table of strings */ + if (!firmware_features_table[i].name || + strcmp(firmware_features_table[i].name, s)) + continue; + + /* we have a match */ + firmware_set_feature(firmware_features_table[i].val); + break; + } + } + +no_hypertas: + of_node_put(dn); +no_rtas: + DBG(" <- fw_feature_init()\n"); +} Index: linux/arch/powerpc/platforms/pseries/setup.c =================================================================== --- linux.orig/arch/powerpc/platforms/pseries/setup.c +++ linux/arch/powerpc/platforms/pseries/setup.c @@ -60,7 +60,6 @@ #include #include #include "xics.h" -#include #include #include #include @@ -70,6 +69,7 @@ #include "plpar_wrappers.h" #include "ras.h" +#include "firmware.h" #ifdef DEBUG #define DBG(fmt...) udbg_printf(fmt) @@ -262,49 +262,6 @@ static int __init pSeries_init_panel(voi } arch_initcall(pSeries_init_panel); - -/* Build up the firmware features bitmask using the contents of - * device-tree/ibm,hypertas-functions. Ultimately this functionality may - * be moved into prom.c prom_init(). - */ -static void __init fw_feature_init(void) -{ - struct device_node *dn; - char *hyptertas, *s; - int len, i; - - DBG(" -> fw_feature_init()\n"); - - dn = of_find_node_by_path("/rtas"); - if (dn == NULL) { - printk(KERN_ERR "WARNING! Cannot find RTAS in device-tree!\n"); - goto no_rtas; - } - - hyptertas = get_property(dn, "ibm,hypertas-functions", &len); - if (hyptertas == NULL) - goto no_hypertas; - - for (s = hyptertas; s < hyptertas + len; s += strlen(s) + 1) { - for (i = 0; i < FIRMWARE_MAX_FEATURES; i++) { - /* check value against table of strings */ - if (!firmware_features_table[i].name || - strcmp(firmware_features_table[i].name, s)) - continue; - - /* we have a match */ - firmware_set_feature(firmware_features_table[i].val); - break; - } - } - -no_hypertas: - of_node_put(dn); -no_rtas: - DBG(" <- fw_feature_init()\n"); -} - - static void __init pSeries_discover_pic(void) { struct device_node *np; Index: linux/include/asm-powerpc/firmware.h =================================================================== --- linux.orig/include/asm-powerpc/firmware.h +++ linux/include/asm-powerpc/firmware.h @@ -94,15 +94,6 @@ static inline void firmware_set_feature( ppc64_firmware_features |= FW_FEATURE_POSSIBLE & feature; } -#ifdef CONFIG_PPC_PSERIES -typedef struct { - unsigned long val; - char * name; -} firmware_feature_t; - -extern firmware_feature_t firmware_features_table[]; -#endif - extern void system_reset_fwnmi(void); extern void machine_check_fwnmi(void); Index: linux/arch/powerpc/platforms/pseries/firmware.h =================================================================== --- /dev/null +++ linux/arch/powerpc/platforms/pseries/firmware.h @@ -0,0 +1,17 @@ +/* + * Copyright 2006 IBM Corporation. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version + * 2 of the License, or (at your option) any later version. + */ + +#ifndef _PSERIES_FIRMWARE_H +#define _PSERIES_FIRMWARE_H + +#include + +extern void __init fw_feature_init(void); + +#endif /* _PSERIES_FIRMWARE_H */ From michael at ellerman.id.au Thu Jan 12 17:10:06 2006 From: michael at ellerman.id.au (Michael Ellerman) Date: Thu, 12 Jan 2006 17:10:06 +1100 Subject: [PATCH 4/4] powerpc: Replace platform_is_lpar() with a firmware feature In-Reply-To: <1137046198.56732.289003998582.qpush@concordia> Message-ID: <20060112061019.3335C68A5D@ozlabs.org> It has been decreed that platform numbers are evil, so as a step in that direction, replace platform_is_lpar() with a FW_FEATURE_LPAR bit. Signed-off-by: Michael Ellerman --- arch/powerpc/mm/hash_utils_64.c | 4 ++-- arch/powerpc/oprofile/op_model_power4.c | 3 ++- arch/powerpc/platforms/iseries/setup.c | 10 +++++++--- arch/powerpc/platforms/pseries/iommu.c | 2 +- arch/powerpc/platforms/pseries/setup.c | 11 +++++++---- arch/powerpc/platforms/pseries/smp.c | 2 +- arch/powerpc/platforms/pseries/xics.c | 3 ++- include/asm-powerpc/firmware.h | 5 +++-- include/asm-powerpc/processor.h | 1 - 9 files changed, 25 insertions(+), 16 deletions(-) Index: linux/include/asm-powerpc/firmware.h =================================================================== --- linux.orig/include/asm-powerpc/firmware.h +++ linux/include/asm-powerpc/firmware.h @@ -41,6 +41,7 @@ #define FW_FEATURE_MULTITCE (1UL<<19) #define FW_FEATURE_SPLPAR (1UL<<20) #define FW_FEATURE_ISERIES (1UL<<21) +#define FW_FEATURE_LPAR (1UL<<22) enum { #ifdef CONFIG_PPC64 @@ -51,9 +52,9 @@ enum { FW_FEATURE_MIGRATE | FW_FEATURE_PERFMON | FW_FEATURE_CRQ | FW_FEATURE_VIO | FW_FEATURE_RDMA | FW_FEATURE_LLAN | FW_FEATURE_BULK | FW_FEATURE_XDABR | FW_FEATURE_MULTITCE | - FW_FEATURE_SPLPAR, + FW_FEATURE_SPLPAR | FW_FEATURE_LPAR, FW_FEATURE_PSERIES_ALWAYS = 0, - FW_FEATURE_ISERIES_POSSIBLE = FW_FEATURE_ISERIES, + FW_FEATURE_ISERIES_POSSIBLE = FW_FEATURE_ISERIES | FW_FEATURE_LPAR, FW_FEATURE_ISERIES_ALWAYS = FW_FEATURE_ISERIES, FW_FEATURE_POSSIBLE = #ifdef CONFIG_PPC_PSERIES Index: linux/arch/powerpc/mm/hash_utils_64.c =================================================================== --- linux.orig/arch/powerpc/mm/hash_utils_64.c +++ linux/arch/powerpc/mm/hash_utils_64.c @@ -421,7 +421,7 @@ void __init htab_initialize(void) htab_hash_mask = pteg_count - 1; - if (platform_is_lpar()) { + if (firmware_has_feature(FW_FEATURE_LPAR)) { /* Using a hypervisor which owns the htab */ htab_address = NULL; _SDR1 = 0; @@ -516,7 +516,7 @@ void __init htab_initialize(void) void htab_initialize_secondary(void) { - if (!platform_is_lpar()) + if (!firmware_has_feature(FW_FEATURE_LPAR)) mtspr(SPRN_SDR1, _SDR1); } Index: linux/arch/powerpc/oprofile/op_model_power4.c =================================================================== --- linux.orig/arch/powerpc/oprofile/op_model_power4.c +++ linux/arch/powerpc/oprofile/op_model_power4.c @@ -10,6 +10,7 @@ #include #include #include +#include #include #include #include @@ -232,7 +233,7 @@ static unsigned long get_pc(struct pt_re mmcra = mfspr(SPRN_MMCRA); /* Were we in the hypervisor? */ - if (platform_is_lpar() && (mmcra & MMCRA_SIHV)) + if (firmware_has_feature(FW_FEATURE_LPAR) && (mmcra & MMCRA_SIHV)) /* function descriptor madness */ return *((unsigned long *)hypervisor_bucket); Index: linux/arch/powerpc/platforms/pseries/iommu.c =================================================================== --- linux.orig/arch/powerpc/platforms/pseries/iommu.c +++ linux/arch/powerpc/platforms/pseries/iommu.c @@ -584,7 +584,7 @@ void iommu_init_early_pSeries(void) return; } - if (platform_is_lpar()) { + if (firmware_has_feature(FW_FEATURE_LPAR)) { if (firmware_has_feature(FW_FEATURE_MULTITCE)) { ppc_md.tce_build = tce_buildmulti_pSeriesLP; ppc_md.tce_free = tce_freemulti_pSeriesLP; Index: linux/arch/powerpc/platforms/pseries/setup.c =================================================================== --- linux.orig/arch/powerpc/platforms/pseries/setup.c +++ linux/arch/powerpc/platforms/pseries/setup.c @@ -246,7 +246,7 @@ static void __init pSeries_setup_arch(vo ppc_md.idle_loop = default_idle; } - if (platform_is_lpar()) + if (firmware_has_feature(FW_FEATURE_LPAR)) ppc_md.enable_pmcs = pseries_lpar_enable_pmcs; else ppc_md.enable_pmcs = power4_enable_pmcs; @@ -326,7 +326,7 @@ static void __init pSeries_init_early(vo fw_feature_init(); - if (platform_is_lpar()) + if (firmware_has_feature(FW_FEATURE_LPAR)) hpte_init_lpar(); else { hpte_init_native(); @@ -334,7 +334,7 @@ static void __init pSeries_init_early(vo get_property(of_chosen, "linux,iommu-off", NULL)); } - if (platform_is_lpar()) + if (firmware_has_feature(FW_FEATURE_LPAR)) find_udbg_vterm(); if (firmware_has_feature(FW_FEATURE_DABR)) @@ -390,6 +390,9 @@ static int __init pSeries_probe(int plat * it here ... */ + if (platform == PLATFORM_PSERIES_LPAR) + firmware_set_feature(FW_FEATURE_LPAR); + return 1; } @@ -531,7 +534,7 @@ static void pseries_shared_idle(void) static int pSeries_pci_probe_mode(struct pci_bus *bus) { - if (platform_is_lpar()) + if (firmware_has_feature(FW_FEATURE_LPAR)) return PCI_PROBE_DEVTREE; return PCI_PROBE_NORMAL; } Index: linux/arch/powerpc/platforms/pseries/smp.c =================================================================== --- linux.orig/arch/powerpc/platforms/pseries/smp.c +++ linux/arch/powerpc/platforms/pseries/smp.c @@ -443,7 +443,7 @@ void __init smp_init_pSeries(void) smp_ops->cpu_die = pSeries_cpu_die; /* Processors can be added/removed only on LPAR */ - if (platform_is_lpar()) + if (firmware_has_feature(FW_FEATURE_LPAR)) pSeries_reconfig_notifier_register(&pSeries_smp_nb); #endif Index: linux/arch/powerpc/platforms/pseries/xics.c =================================================================== --- linux.orig/arch/powerpc/platforms/pseries/xics.c +++ linux/arch/powerpc/platforms/pseries/xics.c @@ -20,6 +20,7 @@ #include #include #include +#include #include #include #include @@ -536,7 +537,7 @@ nextnode: of_node_put(np); } - if (platform_is_lpar()) + if (firmware_has_feature(FW_FEATURE_LPAR)) ops = &pSeriesLP_ops; else { #ifdef CONFIG_SMP Index: linux/arch/powerpc/platforms/iseries/setup.c =================================================================== --- linux.orig/arch/powerpc/platforms/iseries/setup.c +++ linux/arch/powerpc/platforms/iseries/setup.c @@ -303,8 +303,6 @@ static void __init iSeries_init_early(vo { DBG(" -> iSeries_init_early()\n"); - firmware_set_feature(FW_FEATURE_ISERIES); - ppc64_interrupt_controller = IC_ISERIES; #if defined(CONFIG_BLK_DEV_INITRD) @@ -710,7 +708,13 @@ void __init iSeries_init_IRQ(void) { } static int __init iseries_probe(int platform) { - return PLATFORM_ISERIES_LPAR == platform; + if (PLATFORM_ISERIES_LPAR != platform) + return 0; + + firmware_set_feature(FW_FEATURE_ISERIES); + firmware_set_feature(FW_FEATURE_LPAR); + + return 1; } struct machdep_calls __initdata iseries_md = { Index: linux/include/asm-powerpc/processor.h =================================================================== --- linux.orig/include/asm-powerpc/processor.h +++ linux/include/asm-powerpc/processor.h @@ -52,7 +52,6 @@ #ifdef __KERNEL__ #define platform_is_pseries() (_machine == PLATFORM_PSERIES || \ _machine == PLATFORM_PSERIES_LPAR) -#define platform_is_lpar() (!!(_machine & PLATFORM_LPAR)) #if defined(CONFIG_PPC_MULTIPLATFORM) extern int _machine; From olof at lixom.net Thu Jan 12 17:20:50 2006 From: olof at lixom.net (Olof Johansson) Date: Thu, 12 Jan 2006 00:20:50 -0600 Subject: [PATCH] powerpc: minor dart driver cleanup Message-ID: <20060112062050.GH2491@pb15.lixom.net> Paul, Please apply. --- Rpn is assigned every time in the loop, no need to increase it too. Signed-off-by: Olof Johansson Index: 2.6/arch/powerpc/sysdev/dart_iommu.c =================================================================== --- 2.6.orig/arch/powerpc/sysdev/dart_iommu.c 2006-01-11 23:59:53.000000000 -0600 +++ 2.6/arch/powerpc/sysdev/dart_iommu.c 2006-01-12 00:19:06.000000000 -0600 @@ -139,7 +139,6 @@ static void dart_build(struct iommu_tabl *(dp++) = DARTMAP_VALID | (rpn & DARTMAP_RPNMASK); - rpn++; uaddr += DART_PAGE_SIZE; } From david at gibson.dropbear.id.au Thu Jan 12 17:39:46 2006 From: david at gibson.dropbear.id.au (David Gibson) Date: Thu, 12 Jan 2006 17:39:46 +1100 Subject: [PATCH 1/4] powerpc: Add firmware_set_feature() In-Reply-To: <20060112061010.55D6A68A40@ozlabs.org> References: <1137046198.56732.289003998582.qpush@concordia> <20060112061010.55D6A68A40@ozlabs.org> Message-ID: <20060112063946.GH13755@localhost.localdomain> On Thu, Jan 12, 2006 at 05:09:59PM +1100, Michael Ellerman wrote: > We have firmware_has_feature() to test for features, add firmware_set_feature() > so that no one needs to touch ppc64_firmware_features directly. > > ppc64_firmware_features will be initialised to 0, but make it explicit. > > Signed-off-by: Michael Ellerman > --- > > arch/powerpc/kernel/firmware.c | 2 +- > arch/powerpc/platforms/iseries/setup.c | 2 +- > include/asm-powerpc/firmware.h | 7 ++++++- > 3 files changed, 8 insertions(+), 3 deletions(-) > > Index: linux/include/asm-powerpc/firmware.h > =================================================================== > --- linux.orig/include/asm-powerpc/firmware.h > +++ linux/include/asm-powerpc/firmware.h > @@ -79,7 +79,7 @@ enum { > }; > > /* This is used to identify firmware features which are available > - * to the kernel. > + * to the kernel. Don't use this directly, use the macros below. > */ > extern unsigned long ppc64_firmware_features; > > @@ -89,6 +89,11 @@ static inline unsigned long firmware_has > (FW_FEATURE_POSSIBLE & ppc64_firmware_features & feature); > } > > +static inline void firmware_set_feature(unsigned long feature) > +{ > + ppc64_firmware_features |= FW_FEATURE_POSSIBLE & feature; > +} Hrm.. should we really mask here, or just BUG_ON(! (feature & FW_FEATURE_POSSIBLE))? > + > #ifdef CONFIG_PPC_PSERIES > typedef struct { > unsigned long val; > Index: linux/arch/powerpc/platforms/iseries/setup.c > =================================================================== > --- linux.orig/arch/powerpc/platforms/iseries/setup.c > +++ linux/arch/powerpc/platforms/iseries/setup.c > @@ -303,7 +303,7 @@ static void __init iSeries_init_early(vo > { > DBG(" -> iSeries_init_early()\n"); > > - ppc64_firmware_features = FW_FEATURE_ISERIES; > + firmware_set_feature(FW_FEATURE_ISERIES); > > ppc64_interrupt_controller = IC_ISERIES; > > Index: linux/arch/powerpc/kernel/firmware.c > =================================================================== > --- linux.orig/arch/powerpc/kernel/firmware.c > +++ linux/arch/powerpc/kernel/firmware.c > @@ -17,7 +17,7 @@ > > #include > > -unsigned long ppc64_firmware_features; > +unsigned long ppc64_firmware_features = 0; Kernel convention is generally not to explicitly initialize to zero. Doing so forces the variable into .data rather than .bss, and therby increases the vmlinux size. I usually but a /* = 0 */ comment instead. -- David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson From michael at ellerman.id.au Thu Jan 12 18:10:35 2006 From: michael at ellerman.id.au (Michael Ellerman) Date: Thu, 12 Jan 2006 18:10:35 +1100 Subject: [PATCH 1/4] powerpc: Add firmware_set_feature() In-Reply-To: <20060112063946.GH13755@localhost.localdomain> References: <1137046198.56732.289003998582.qpush@concordia> <20060112061010.55D6A68A40@ozlabs.org> <20060112063946.GH13755@localhost.localdomain> Message-ID: <200601121810.39142.michael@ellerman.id.au> On Thu, 12 Jan 2006 17:39, David Gibson wrote: > On Thu, Jan 12, 2006 at 05:09:59PM +1100, Michael Ellerman wrote: > > +static inline void firmware_set_feature(unsigned long feature) > > +{ > > + ppc64_firmware_features |= FW_FEATURE_POSSIBLE & feature; > > +} > > Hrm.. should we really mask here, or just BUG_ON(! (feature & > FW_FEATURE_POSSIBLE))? I think we should definitely mask, we don't want to end up with imPOSSIBLE features being turned on. BUG_ON might be appropriate, it would at least catch people who forget to add features to the POSSIBLE map - is there any way to cause it to fail at build time though? > > -unsigned long ppc64_firmware_features; > > +unsigned long ppc64_firmware_features = 0; > > Kernel convention is generally not to explicitly initialize to zero. > Doing so forces the variable into .data rather than .bss, and therby > increases the vmlinux size. I usually but a /* = 0 */ comment > instead. Blergh, gcc can't work that out? I'll fix it to have the comment. cheers -- Michael Ellerman IBM OzLabs email: michael:ellerman.id.au inmsg: mpe:jabber.org wwweb: http://michael.ellerman.id.au phone: +61 2 6212 1183 (tie line 70 21183) We do not inherit the earth from our ancestors, we borrow it from our children. - S.M.A.R.T Person -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: not available Url : http://ozlabs.org/pipermail/linuxppc64-dev/attachments/20060112/8e84ea9d/attachment.pgp From michael at ellerman.id.au Thu Jan 12 18:16:32 2006 From: michael at ellerman.id.au (Michael Ellerman) Date: Thu, 12 Jan 2006 18:16:32 +1100 Subject: [PATCH 2/4] powerpc: Cleanup pSeries firmware feature initialisation In-Reply-To: <20060112061012.0678A68A52@ozlabs.org> References: <20060112061012.0678A68A52@ozlabs.org> Message-ID: <200601121816.35346.michael@ellerman.id.au> On Thu, 12 Jan 2006 17:10, Michael Ellerman wrote: > + char *hyptertas, *s; ^ should be hypertas :/ - thanks to ojn I'll resend the whole series as they depend on each other. cheers -- Michael Ellerman IBM OzLabs email: michael:ellerman.id.au inmsg: mpe:jabber.org wwweb: http://michael.ellerman.id.au phone: +61 2 6212 1183 (tie line 70 21183) We do not inherit the earth from our ancestors, we borrow it from our children. - S.M.A.R.T Person -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: not available Url : http://ozlabs.org/pipermail/linuxppc64-dev/attachments/20060112/5e43f2e6/attachment.pgp From grundler at parisc-linux.org Thu Jan 12 18:33:09 2006 From: grundler at parisc-linux.org (Grant Grundler) Date: Thu, 12 Jan 2006 00:33:09 -0700 Subject: [PATCH 1/3] msi vector targeting abstractions In-Reply-To: <17349.60783.236661.875374@cargo.ozlabs.ibm.com> References: <20060111155251.12460.71269.12163@attica.americas.sgi.com> <20060111155256.12460.26048.32596@attica.americas.sgi.com> <20060112050243.GC332@colo.lackof.org> <17349.60783.236661.875374@cargo.ozlabs.ibm.com> Message-ID: <20060112073308.GA15355@colo.lackof.org> On Thu, Jan 12, 2006 at 04:47:27PM +1100, Paul Mackerras wrote: > Grant Grundler writes: > > > > + if ((status = msi_arch_init()) < 0) { > > > > Willy told me I should always complain about assignment in if() statements :) > > We are getting incredibly politically correct these days, aren't we. I'm not asking greg to reject the patch nor dictating Mark Mauler change it. Since greg is willing to accept a patch to "fix" it, I'm willing to provide the patch in this case. I think that's fairly normal way to clean things up. > I see nothing wrong with that if statement. It's perfectly valid, > idiomatic C. You can ignore Willy if you like. :) While it is valid C, "=" occasionally gets confused with "==". And adding unnecessary parens to an if() statement increases the risk someone will misread the line. "someone" includes me. :) > (I would look askance at something that did an assignment as one of > the parameters of a procedure call in an if statement, though.) *nod* thanks, grant From michael at ellerman.id.au Thu Jan 12 18:30:15 2006 From: michael at ellerman.id.au (Michael Ellerman) Date: Thu, 12 Jan 2006 18:30:15 +1100 Subject: [PATCH 4/4] powerpc: Replace platform_is_lpar() with a firmware feature In-Reply-To: <20060112061019.3335C68A5D@ozlabs.org> References: <20060112061019.3335C68A5D@ozlabs.org> Message-ID: <200601121830.18618.michael@ellerman.id.au> And as Stephen points out, this was is broken too - we should be setting ISERIES_ALWAYS to include LPAR. cheers On Thu, 12 Jan 2006 17:10, Michael Ellerman wrote: > It has been decreed that platform numbers are evil, so as a step in that > direction, replace platform_is_lpar() with a FW_FEATURE_LPAR bit. > > Signed-off-by: Michael Ellerman > --- > > arch/powerpc/mm/hash_utils_64.c | 4 ++-- > arch/powerpc/oprofile/op_model_power4.c | 3 ++- > arch/powerpc/platforms/iseries/setup.c | 10 +++++++--- > arch/powerpc/platforms/pseries/iommu.c | 2 +- > arch/powerpc/platforms/pseries/setup.c | 11 +++++++---- > arch/powerpc/platforms/pseries/smp.c | 2 +- > arch/powerpc/platforms/pseries/xics.c | 3 ++- > include/asm-powerpc/firmware.h | 5 +++-- > include/asm-powerpc/processor.h | 1 - > 9 files changed, 25 insertions(+), 16 deletions(-) > > Index: linux/include/asm-powerpc/firmware.h > =================================================================== > --- linux.orig/include/asm-powerpc/firmware.h > +++ linux/include/asm-powerpc/firmware.h > @@ -41,6 +41,7 @@ > #define FW_FEATURE_MULTITCE (1UL<<19) > #define FW_FEATURE_SPLPAR (1UL<<20) > #define FW_FEATURE_ISERIES (1UL<<21) > +#define FW_FEATURE_LPAR (1UL<<22) > > enum { > #ifdef CONFIG_PPC64 > @@ -51,9 +52,9 @@ enum { > FW_FEATURE_MIGRATE | FW_FEATURE_PERFMON | FW_FEATURE_CRQ | > FW_FEATURE_VIO | FW_FEATURE_RDMA | FW_FEATURE_LLAN | > FW_FEATURE_BULK | FW_FEATURE_XDABR | FW_FEATURE_MULTITCE | > - FW_FEATURE_SPLPAR, > + FW_FEATURE_SPLPAR | FW_FEATURE_LPAR, > FW_FEATURE_PSERIES_ALWAYS = 0, > - FW_FEATURE_ISERIES_POSSIBLE = FW_FEATURE_ISERIES, > + FW_FEATURE_ISERIES_POSSIBLE = FW_FEATURE_ISERIES | FW_FEATURE_LPAR, > FW_FEATURE_ISERIES_ALWAYS = FW_FEATURE_ISERIES, > FW_FEATURE_POSSIBLE = > #ifdef CONFIG_PPC_PSERIES > Index: linux/arch/powerpc/mm/hash_utils_64.c > =================================================================== > --- linux.orig/arch/powerpc/mm/hash_utils_64.c > +++ linux/arch/powerpc/mm/hash_utils_64.c > @@ -421,7 +421,7 @@ void __init htab_initialize(void) > > htab_hash_mask = pteg_count - 1; > > - if (platform_is_lpar()) { > + if (firmware_has_feature(FW_FEATURE_LPAR)) { > /* Using a hypervisor which owns the htab */ > htab_address = NULL; > _SDR1 = 0; > @@ -516,7 +516,7 @@ void __init htab_initialize(void) > > void htab_initialize_secondary(void) > { > - if (!platform_is_lpar()) > + if (!firmware_has_feature(FW_FEATURE_LPAR)) > mtspr(SPRN_SDR1, _SDR1); > } > > Index: linux/arch/powerpc/oprofile/op_model_power4.c > =================================================================== > --- linux.orig/arch/powerpc/oprofile/op_model_power4.c > +++ linux/arch/powerpc/oprofile/op_model_power4.c > @@ -10,6 +10,7 @@ > #include > #include > #include > +#include > #include > #include > #include > @@ -232,7 +233,7 @@ static unsigned long get_pc(struct pt_re > mmcra = mfspr(SPRN_MMCRA); > > /* Were we in the hypervisor? */ > - if (platform_is_lpar() && (mmcra & MMCRA_SIHV)) > + if (firmware_has_feature(FW_FEATURE_LPAR) && (mmcra & MMCRA_SIHV)) > /* function descriptor madness */ > return *((unsigned long *)hypervisor_bucket); > > Index: linux/arch/powerpc/platforms/pseries/iommu.c > =================================================================== > --- linux.orig/arch/powerpc/platforms/pseries/iommu.c > +++ linux/arch/powerpc/platforms/pseries/iommu.c > @@ -584,7 +584,7 @@ void iommu_init_early_pSeries(void) > return; > } > > - if (platform_is_lpar()) { > + if (firmware_has_feature(FW_FEATURE_LPAR)) { > if (firmware_has_feature(FW_FEATURE_MULTITCE)) { > ppc_md.tce_build = tce_buildmulti_pSeriesLP; > ppc_md.tce_free = tce_freemulti_pSeriesLP; > Index: linux/arch/powerpc/platforms/pseries/setup.c > =================================================================== > --- linux.orig/arch/powerpc/platforms/pseries/setup.c > +++ linux/arch/powerpc/platforms/pseries/setup.c > @@ -246,7 +246,7 @@ static void __init pSeries_setup_arch(vo > ppc_md.idle_loop = default_idle; > } > > - if (platform_is_lpar()) > + if (firmware_has_feature(FW_FEATURE_LPAR)) > ppc_md.enable_pmcs = pseries_lpar_enable_pmcs; > else > ppc_md.enable_pmcs = power4_enable_pmcs; > @@ -326,7 +326,7 @@ static void __init pSeries_init_early(vo > > fw_feature_init(); > > - if (platform_is_lpar()) > + if (firmware_has_feature(FW_FEATURE_LPAR)) > hpte_init_lpar(); > else { > hpte_init_native(); > @@ -334,7 +334,7 @@ static void __init pSeries_init_early(vo > get_property(of_chosen, "linux,iommu-off", NULL)); > } > > - if (platform_is_lpar()) > + if (firmware_has_feature(FW_FEATURE_LPAR)) > find_udbg_vterm(); > > if (firmware_has_feature(FW_FEATURE_DABR)) > @@ -390,6 +390,9 @@ static int __init pSeries_probe(int plat > * it here ... > */ > > + if (platform == PLATFORM_PSERIES_LPAR) > + firmware_set_feature(FW_FEATURE_LPAR); > + > return 1; > } > > @@ -531,7 +534,7 @@ static void pseries_shared_idle(void) > > static int pSeries_pci_probe_mode(struct pci_bus *bus) > { > - if (platform_is_lpar()) > + if (firmware_has_feature(FW_FEATURE_LPAR)) > return PCI_PROBE_DEVTREE; > return PCI_PROBE_NORMAL; > } > Index: linux/arch/powerpc/platforms/pseries/smp.c > =================================================================== > --- linux.orig/arch/powerpc/platforms/pseries/smp.c > +++ linux/arch/powerpc/platforms/pseries/smp.c > @@ -443,7 +443,7 @@ void __init smp_init_pSeries(void) > smp_ops->cpu_die = pSeries_cpu_die; > > /* Processors can be added/removed only on LPAR */ > - if (platform_is_lpar()) > + if (firmware_has_feature(FW_FEATURE_LPAR)) > pSeries_reconfig_notifier_register(&pSeries_smp_nb); > #endif > > Index: linux/arch/powerpc/platforms/pseries/xics.c > =================================================================== > --- linux.orig/arch/powerpc/platforms/pseries/xics.c > +++ linux/arch/powerpc/platforms/pseries/xics.c > @@ -20,6 +20,7 @@ > #include > #include > #include > +#include > #include > #include > #include > @@ -536,7 +537,7 @@ nextnode: > of_node_put(np); > } > > - if (platform_is_lpar()) > + if (firmware_has_feature(FW_FEATURE_LPAR)) > ops = &pSeriesLP_ops; > else { > #ifdef CONFIG_SMP > Index: linux/arch/powerpc/platforms/iseries/setup.c > =================================================================== > --- linux.orig/arch/powerpc/platforms/iseries/setup.c > +++ linux/arch/powerpc/platforms/iseries/setup.c > @@ -303,8 +303,6 @@ static void __init iSeries_init_early(vo > { > DBG(" -> iSeries_init_early()\n"); > > - firmware_set_feature(FW_FEATURE_ISERIES); > - > ppc64_interrupt_controller = IC_ISERIES; > > #if defined(CONFIG_BLK_DEV_INITRD) > @@ -710,7 +708,13 @@ void __init iSeries_init_IRQ(void) { } > > static int __init iseries_probe(int platform) > { > - return PLATFORM_ISERIES_LPAR == platform; > + if (PLATFORM_ISERIES_LPAR != platform) > + return 0; > + > + firmware_set_feature(FW_FEATURE_ISERIES); > + firmware_set_feature(FW_FEATURE_LPAR); > + > + return 1; > } > > struct machdep_calls __initdata iseries_md = { > Index: linux/include/asm-powerpc/processor.h > =================================================================== > --- linux.orig/include/asm-powerpc/processor.h > +++ linux/include/asm-powerpc/processor.h > @@ -52,7 +52,6 @@ > #ifdef __KERNEL__ > #define platform_is_pseries() (_machine == PLATFORM_PSERIES || \ > _machine == PLATFORM_PSERIES_LPAR) > -#define platform_is_lpar() (!!(_machine & PLATFORM_LPAR)) > > #if defined(CONFIG_PPC_MULTIPLATFORM) > extern int _machine; > _______________________________________________ > Linuxppc64-dev mailing list > Linuxppc64-dev at ozlabs.org > https://ozlabs.org/mailman/listinfo/linuxppc64-dev -- Michael Ellerman IBM OzLabs email: michael:ellerman.id.au inmsg: mpe:jabber.org wwweb: http://michael.ellerman.id.au phone: +61 2 6212 1183 (tie line 70 21183) We do not inherit the earth from our ancestors, we borrow it from our children. - S.M.A.R.T Person -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: not available Url : http://ozlabs.org/pipermail/linuxppc64-dev/attachments/20060112/f80f822e/attachment.pgp From paulus at samba.org Thu Jan 12 20:29:01 2006 From: paulus at samba.org (Paul Mackerras) Date: Thu, 12 Jan 2006 20:29:01 +1100 Subject: [PATCH 1/4] powerpc: Add firmware_set_feature() In-Reply-To: <20060112061010.55D6A68A40@ozlabs.org> References: <1137046198.56732.289003998582.qpush@concordia> <20060112061010.55D6A68A40@ozlabs.org> Message-ID: <17350.8541.637349.160971@cargo.ozlabs.ibm.com> Michael Ellerman writes: > We have firmware_has_feature() to test for features, add firmware_set_feature() > so that no one needs to touch ppc64_firmware_features directly. Because they might get their fingers dirty? :) Seriously, I don't think firmware_set_feature is really a help. To me it's easier to understand what ppc64_firmware_features = xxx does than to understand firmware_set_feature(xxx) does, because with the latter I have to go off and look for the definition of firmware_set_feature. And while I am finding it I'll be wondering whether it actually does a firmware call or something, or if it does some extra checking, or if I can only call it for one feature at a time (it is firmware_set_feature not firmware_set_features, after all). Also, uninitialized variables (outside of procedures) are always set to 0. This is required by the C standard. If you add the = 0 then some janitor or other will just come along and remove it again. :) Paul. From michael at ellerman.id.au Thu Jan 12 21:13:38 2006 From: michael at ellerman.id.au (Michael Ellerman) Date: Thu, 12 Jan 2006 21:13:38 +1100 Subject: [PATCH 1/4] powerpc: Add firmware_set_feature() In-Reply-To: <17350.8541.637349.160971@cargo.ozlabs.ibm.com> References: <1137046198.56732.289003998582.qpush@concordia> <20060112061010.55D6A68A40@ozlabs.org> <17350.8541.637349.160971@cargo.ozlabs.ibm.com> Message-ID: <200601122113.41078.michael@ellerman.id.au> On Thu, 12 Jan 2006 20:29, Paul Mackerras wrote: > Michael Ellerman writes: > > We have firmware_has_feature() to test for features, add > > firmware_set_feature() so that no one needs to touch > > ppc64_firmware_features directly. > > Because they might get their fingers dirty? :) Exactly. > Seriously, I don't think firmware_set_feature is really a help. To me > it's easier to understand what ppc64_firmware_features = xxx does than > to understand firmware_set_feature(xxx) does, because with the latter > I have to go off and look for the definition of firmware_set_feature. > And while I am finding it I'll be wondering whether it actually does a > firmware call or something, or if it does some extra checking, or if I > can only call it for one feature at a time (it is firmware_set_feature > not firmware_set_features, after all). Well actually I just thought it made it a proper API, if we don't need firmware_set_feature() then why do we need firmware_has_feature(). It does do some checking, and should probably BUG_ON or refuse to build if we try to assign impossible features. But perhaps that's just hand holding ? :) > Also, uninitialized variables (outside of procedures) are always set > to 0. This is required by the C standard. If you add the = 0 then > some janitor or other will just come along and remove it again. :) Sure. I just thought it was nice to make it clear, because with firmware_set_feature() you're _always_ or'ing with the initial value - but whatever. cheers -- Michael Ellerman IBM OzLabs email: michael:ellerman.id.au inmsg: mpe:jabber.org wwweb: http://michael.ellerman.id.au phone: +61 2 6212 1183 (tie line 70 21183) We do not inherit the earth from our ancestors, we borrow it from our children. - S.M.A.R.T Person -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: not available Url : http://ozlabs.org/pipermail/linuxppc64-dev/attachments/20060112/95bfcec7/attachment.pgp From paulus at samba.org Thu Jan 12 22:08:25 2006 From: paulus at samba.org (Paul Mackerras) Date: Thu, 12 Jan 2006 22:08:25 +1100 Subject: please pull powerpc-merge.git Message-ID: <17350.14505.761269.884382@cargo.ozlabs.ibm.com> Linus, Please pull git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc-merge.git The commits there are all bug-fixes and cleanups. Paul. arch/powerpc/kernel/Makefile | 6 arch/powerpc/kernel/pci_64.c | 5 arch/powerpc/kernel/process.c | 8 arch/powerpc/kernel/prom.c | 28 + arch/powerpc/kernel/prom_init.c | 8 arch/powerpc/kernel/signal_32.c | 21 - arch/powerpc/kernel/signal_64.c | 20 - arch/powerpc/platforms/cell/pervasive.c | 2 arch/powerpc/platforms/cell/setup.c | 2 arch/powerpc/platforms/cell/spufs/syscalls.c | 4 arch/powerpc/platforms/iseries/Makefile | 4 arch/powerpc/platforms/iseries/iommu.c | 2 arch/powerpc/platforms/iseries/iommu.h | 35 + arch/powerpc/platforms/iseries/irq.c | 19 - arch/powerpc/platforms/iseries/lpardata.c | 5 arch/powerpc/platforms/iseries/lpevents.c | 12 arch/powerpc/platforms/iseries/mf.c | 16 arch/powerpc/platforms/iseries/pci.c | 1 arch/powerpc/platforms/iseries/vio.c | 2 arch/powerpc/platforms/iseries/viopath.c | 12 arch/powerpc/platforms/powermac/setup.c | 2 arch/powerpc/platforms/pseries/eeh.c | 5 arch/powerpc/platforms/pseries/hvcserver.c | 4 arch/powerpc/platforms/pseries/iommu.c | 2 arch/powerpc/platforms/pseries/scanlog.c | 4 arch/powerpc/platforms/pseries/setup.c | 2 arch/powerpc/platforms/pseries/smp.c | 4 arch/powerpc/platforms/pseries/xics.c | 2 arch/powerpc/sysdev/dart_iommu.c | 1 arch/powerpc/xmon/xmon.c | 14 arch/ppc/kernel/Makefile | 1 arch/ppc/kernel/process.c | 851 ------------------------ drivers/block/viodasd.c | 32 - drivers/cdrom/viocd.c | 6 drivers/char/mem.c | 8 drivers/char/viocons.c | 31 - drivers/net/iseries_veth.c | 4 include/asm-powerpc/iommu.h | 19 - include/asm-powerpc/iseries/hv_call.h | 4 include/asm-powerpc/iseries/hv_call_event.h | 134 +--- include/asm-powerpc/iseries/hv_call_sc.h | 1 include/asm-powerpc/iseries/hv_lp_config.h | 1 include/asm-powerpc/iseries/hv_lp_event.h | 42 + include/asm-powerpc/iseries/hv_types.h | 1 include/asm-powerpc/iseries/iseries_io.h | 14 include/asm-powerpc/iseries/it_exp_vpd_panel.h | 1 include/asm-powerpc/iseries/it_lp_naca.h | 22 - include/asm-powerpc/iseries/it_lp_queue.h | 1 include/asm-powerpc/iseries/it_lp_reg_save.h | 3 include/asm-powerpc/iseries/lpar_map.h | 1 include/asm-powerpc/iseries/mf.h | 1 include/asm-powerpc/iseries/vio.h | 1 include/asm-powerpc/pci-bridge.h | 2 include/asm-powerpc/system.h | 8 include/asm-ppc/system.h | 12 55 files changed, 298 insertions(+), 1155 deletions(-) create mode 100644 arch/powerpc/platforms/iseries/iommu.h delete mode 100644 arch/ppc/kernel/process.c Arnd Bergmann: powerpc: pseries namespace cleanup powerpc: pmac namespace cleanup powerpc: xmon namespace cleanups powerpc: cell namespace cleanup Kumar Gala: powerpc: Fixed memory reserve map layout Olof Johansson: powerpc: remove warning in EEH code powerpc: minor dart driver cleanup Paul Mackerras: powerpc: Avoid potential FP corruption with preempt and UP powerpc: make ARCH=ppc use arch/powerpc/kernel/process.c Stephen Rothwell: powerpc: remove bitfields from hv_call_event.h powerpc: remove bitfields from HvLpEvent powerpc: eliminate bitfields from ItLpNaca powercp: iSeries include file comment cleanups powerpc: iSeries fixes for build with no PCI powerpc: clean up iommu.h a bit powerpc: small pci cleanups From arnd at arndb.de Fri Jan 13 01:41:15 2006 From: arnd at arndb.de (Arnd Bergmann) Date: Thu, 12 Jan 2006 14:41:15 +0000 Subject: [PATCH 1/4] powerpc: Add firmware_set_feature() In-Reply-To: <200601121810.39142.michael@ellerman.id.au> References: <1137046198.56732.289003998582.qpush@concordia> <20060112063946.GH13755@localhost.localdomain> <200601121810.39142.michael@ellerman.id.au> Message-ID: <200601121441.15535.arnd@arndb.de> On Thursday 12 January 2006 07:10, Michael Ellerman wrote: > I think we should definitely mask, we don't want to end up with imPOSSIBLE > features being turned on. BUG_ON might be appropriate, it would at least > catch people who forget to add features to the POSSIBLE map - is there any > way to cause it to fail at build time though? There is BUILD_BUG_ON() that should do exactly that. > > > -unsigned long ppc64_firmware_features; > > > +unsigned long ppc64_firmware_features = 0; > > > > Kernel convention is generally not to explicitly initialize to zero. > > Doing so forces the variable into .data rather than .bss, and therby > > increases the vmlinux size. ?I usually but a /* = 0 */ comment > > instead. > > Blergh, gcc can't work that out? I'll fix it to have the comment. gcc version 3.3 or higher now does this itself. The conclusion on the last kernel-janitors discussion about this topic was to stop changing existing code for this. It's up to the code author which way to write it. IMHO, adding the comment is the worst option, I'd just leave the '= 0' in place. Arnd <>< From ntl at pobox.com Fri Jan 13 02:59:22 2006 From: ntl at pobox.com (Nathan Lynch) Date: Thu, 12 Jan 2006 09:59:22 -0600 Subject: [PATCH 5/7] powerpc: prom.c support for updating and removing In-Reply-To: <20060112013027.GL4223@cs.umn.edu> References: <20060112012326.GG4223@cs.umn.edu> <20060112013027.GL4223@cs.umn.edu> Message-ID: <20060112155922.GE2846@localhost.localdomain> Dave C Boutcher wrote: > Add support for updating and removing device tree > properties. Since we hand out pointers to properties with gay > abandon, we can't just free the property storage. Instead we > move deleted, or the old copy of an updated property, to a > "dead properties" list. > > Also note, its not feasable to kref device tree properties. > we call get_property() all over the kernel in a wild variety > of contexts. It's really not all that bad -- just arch/{powerpc,ppc} and the occasional pmac driver. I believe use of get_property in interrupt context is rare (maybe eeh does it). > One consequence of this change is that we now take a > read_lock(&devtree_lock) when doing get_property(). What does this really buy us? Notwithstanding the abuse in prom_add_property, devtree_lock currently protects: o traversals of the device tree through device_node's allnext, parent, child, and sibling pointers (read side) o device node insertion and removal (write side) Until now, the assumption has been that properties are immutable at runtime. AFAICT, the patch series doesn't fix the real issue -- how do you prevent code from using properties that have been removed or changed? Just preventing oopses in the property list traversal code doesn't address that. I think we need to at least audit for code that caches the pointer returned by get_property, and consider adding to the existing notification mechanism in the reconfig code for that purpose. Maybe you could tell us more specifics -- e.g. is there a known set of properties that are subject to update or removal? At what point(s) in the system's operation are property addition/removal/updates supposed to occur (like, during resume?). From jdmason at us.ibm.com Fri Jan 13 05:02:40 2006 From: jdmason at us.ibm.com (Jon Mason) Date: Thu, 12 Jan 2006 12:02:40 -0600 Subject: [PATCH] trivial: modify comments to refer to new location of files Message-ID: <20060112180240.GB17539@us.ibm.com> Trivial patch to modify the references to the now defunct ppc64 tree to the powerpc tree (and related changes to accommodate for 70 char lines). Thanks, Jon Signed-off-by: Jon Mason diff -r 2e15034efcb7 Documentation/powerpc/eeh-pci-error-recovery.txt --- a/Documentation/powerpc/eeh-pci-error-recovery.txt Wed Jan 11 16:14:16 2006 +++ b/Documentation/powerpc/eeh-pci-error-recovery.txt Thu Jan 12 08:25:34 2006 @@ -121,7 +121,7 @@ EEH must be enabled in the PHB's very early during the boot process, and if a PCI slot is hot-plugged. The former is performed by -eeh_init() in arch/ppc64/kernel/eeh.c, and the later by +eeh_init() in arch/powerpc/platforms/pseries/eeh.c, and the later by drivers/pci/hotplug/pSeries_pci.c calling in to the eeh.c code. EEH must be enabled before a PCI scan of the device can proceed. Current Power5 hardware will not work unless EEH is enabled; @@ -133,7 +133,7 @@ pci_get_device_by_addr() will find the pci device associated with that address (if any). -The default include/asm-ppc64/io.h macros readb(), inb(), insb(), +The default include/asm-powerpc/io.h macros readb(), inb(), insb(), etc. include a check to see if the i/o read returned all-0xff's. If so, these make a call to eeh_dn_check_failure(), which in turn asks the firmware if the all-ff's value is the sign of a true EEH @@ -143,11 +143,12 @@ all of these occur during boot, when the PCI bus is scanned, where a large number of 0xff reads are part of the bus scan procedure. -If a frozen slot is detected, code in arch/ppc64/kernel/eeh.c will -print a stack trace to syslog (/var/log/messages). This stack trace -has proven to be very useful to device-driver authors for finding -out at what point the EEH error was detected, as the error itself -usually occurs slightly beforehand. +If a frozen slot is detected, code in +arch/powerpc/platforms/pseries/eeh.c will print a stack trace to +syslog (/var/log/messages). This stack trace has proven to be very +useful to device-driver authors for finding out at what point the EEH +error was detected, as the error itself usually occurs slightly +beforehand. Next, it uses the Linux kernel notifier chain/work queue mechanism to allow any interested parties to find out about the failure. Device diff -r 2e15034efcb7 arch/powerpc/boot/install.sh --- a/arch/powerpc/boot/install.sh Wed Jan 11 16:14:16 2006 +++ b/arch/powerpc/boot/install.sh Thu Jan 12 08:25:34 2006 @@ -1,6 +1,6 @@ #!/bin/sh # -# arch/ppc64/boot/install.sh +# arch/powerpc/boot/install.sh # # This file is subject to the terms and conditions of the GNU General Public # License. See the file "COPYING" in the main directory of this archive diff -r 2e15034efcb7 arch/powerpc/kernel/entry_64.S --- a/arch/powerpc/kernel/entry_64.S Wed Jan 11 16:14:16 2006 +++ b/arch/powerpc/kernel/entry_64.S Thu Jan 12 08:25:34 2006 @@ -1,5 +1,5 @@ /* - * arch/ppc64/kernel/entry.S + * arch/powerpc/kernel/entry_64.S * * PowerPC version * Copyright (C) 1995-1996 Gary Thomas (gdt at linuxppc.org) @@ -374,7 +374,7 @@ * the fork code also. * * The code which creates the new task context is in 'copy_thread' - * in arch/ppc64/kernel/process.c + * in arch/powerpc/kernel/process.c */ .align 7 _GLOBAL(_switch) diff -r 2e15034efcb7 arch/powerpc/kernel/head_44x.S --- a/arch/powerpc/kernel/head_44x.S Wed Jan 11 16:14:16 2006 +++ b/arch/powerpc/kernel/head_44x.S Thu Jan 12 08:25:34 2006 @@ -1,5 +1,5 @@ /* - * arch/ppc/kernel/head_44x.S + * arch/powerpc/kernel/head_44x.S * * Kernel execution entry point code. * diff -r 2e15034efcb7 arch/powerpc/kernel/head_64.S --- a/arch/powerpc/kernel/head_64.S Wed Jan 11 16:14:16 2006 +++ b/arch/powerpc/kernel/head_64.S Thu Jan 12 08:25:34 2006 @@ -1,5 +1,5 @@ /* - * arch/ppc64/kernel/head.S + * arch/powerpc/kernel/head_64.S * * PowerPC version * Copyright (C) 1995-1996 Gary Thomas (gdt at linuxppc.org) diff -r 2e15034efcb7 arch/powerpc/kernel/head_8xx.S --- a/arch/powerpc/kernel/head_8xx.S Wed Jan 11 16:14:16 2006 +++ b/arch/powerpc/kernel/head_8xx.S Thu Jan 12 08:25:34 2006 @@ -1,5 +1,5 @@ /* - * arch/ppc/kernel/except_8xx.S + * arch/powerpc/kernel/head_8xx.S * * PowerPC version * Copyright (C) 1995-1996 Gary Thomas (gdt at linuxppc.org) diff -r 2e15034efcb7 arch/powerpc/kernel/head_fsl_booke.S --- a/arch/powerpc/kernel/head_fsl_booke.S Wed Jan 11 16:14:16 2006 +++ b/arch/powerpc/kernel/head_fsl_booke.S Thu Jan 12 08:25:34 2006 @@ -1,5 +1,5 @@ /* - * arch/ppc/kernel/head_fsl_booke.S + * arch/powerpc/kernel/head_fsl_booke.S * * Kernel execution entry point code. * diff -r 2e15034efcb7 arch/powerpc/kernel/iomap.c --- a/arch/powerpc/kernel/iomap.c Wed Jan 11 16:14:16 2006 +++ b/arch/powerpc/kernel/iomap.c Thu Jan 12 08:25:34 2006 @@ -1,5 +1,5 @@ /* - * arch/ppc64/kernel/iomap.c + * arch/powerpc/kernel/iomap.c * * ppc64 "iomap" interface implementation. * diff -r 2e15034efcb7 arch/powerpc/kernel/iommu.c --- a/arch/powerpc/kernel/iommu.c Wed Jan 11 16:14:16 2006 +++ b/arch/powerpc/kernel/iommu.c Thu Jan 12 08:25:34 2006 @@ -1,5 +1,6 @@ /* - * arch/ppc64/kernel/iommu.c + * arch/powerpc/kernel/iommu.c + * * Copyright (C) 2001 Mike Corrigan & Dave Engebretsen, IBM Corporation * * Rewrite, cleanup, new allocation schemes, virtual merging: diff -r 2e15034efcb7 arch/powerpc/kernel/irq.c --- a/arch/powerpc/kernel/irq.c Wed Jan 11 16:14:16 2006 +++ b/arch/powerpc/kernel/irq.c Thu Jan 12 08:25:34 2006 @@ -1,5 +1,5 @@ /* - * arch/ppc/kernel/irq.c + * arch/powerpc/kernel/irq.c * * Derived from arch/i386/kernel/irq.c * Copyright (C) 1992 Linus Torvalds diff -r 2e15034efcb7 arch/powerpc/kernel/kprobes.c --- a/arch/powerpc/kernel/kprobes.c Wed Jan 11 16:14:16 2006 +++ b/arch/powerpc/kernel/kprobes.c Thu Jan 12 08:25:34 2006 @@ -1,6 +1,6 @@ /* * Kernel Probes (KProbes) - * arch/ppc64/kernel/kprobes.c + * arch/powerpc/kernel/kprobes.c * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff -r 2e15034efcb7 arch/powerpc/kernel/pci_iommu.c --- a/arch/powerpc/kernel/pci_iommu.c Wed Jan 11 16:14:16 2006 +++ b/arch/powerpc/kernel/pci_iommu.c Thu Jan 12 08:25:34 2006 @@ -1,5 +1,6 @@ /* - * arch/ppc64/kernel/pci_iommu.c + * arch/powerpc/kernel/pci_iommu.c + * * Copyright (C) 2001 Mike Corrigan & Dave Engebretsen, IBM Corporation * * Rewrite, cleanup, new allocation schemes: diff -r 2e15034efcb7 arch/powerpc/kernel/process.c --- a/arch/powerpc/kernel/process.c Wed Jan 11 16:14:16 2006 +++ b/arch/powerpc/kernel/process.c Thu Jan 12 08:25:34 2006 @@ -1,5 +1,5 @@ /* - * arch/ppc/kernel/process.c + * arch/powerpc/kernel/process.c * * Derived from "arch/i386/kernel/process.c" * Copyright (C) 1995 Linus Torvalds diff -r 2e15034efcb7 arch/powerpc/kernel/ptrace-common.h --- a/arch/powerpc/kernel/ptrace-common.h Wed Jan 11 16:14:16 2006 +++ b/arch/powerpc/kernel/ptrace-common.h Thu Jan 12 08:25:34 2006 @@ -1,5 +1,5 @@ /* - * linux/arch/ppc64/kernel/ptrace-common.h + * arch/powerpc/kernel/ptrace-common.h * * Copyright (c) 2002 Stephen Rothwell, IBM Coproration * Extracted from ptrace.c and ptrace32.c diff -r 2e15034efcb7 arch/powerpc/kernel/rtas-proc.c --- a/arch/powerpc/kernel/rtas-proc.c Wed Jan 11 16:14:16 2006 +++ b/arch/powerpc/kernel/rtas-proc.c Thu Jan 12 08:25:34 2006 @@ -1,5 +1,6 @@ /* - * arch/ppc64/kernel/rtas-proc.c + * arch/powerpc/kernel/rtas-proc.c + * * Copyright (C) 2000 Tilmann Bitterberg * (tilmann at bitterberg.de) * diff -r 2e15034efcb7 arch/powerpc/kernel/rtas_pci.c --- a/arch/powerpc/kernel/rtas_pci.c Wed Jan 11 16:14:16 2006 +++ b/arch/powerpc/kernel/rtas_pci.c Thu Jan 12 08:25:34 2006 @@ -1,5 +1,5 @@ /* - * arch/ppc64/kernel/rtas_pci.c + * arch/powerpc/kernel/rtas_pci.c * * Copyright (C) 2001 Dave Engebretsen, IBM Corporation * Copyright (C) 2003 Anton Blanchard , IBM diff -r 2e15034efcb7 arch/powerpc/kernel/signal_64.c --- a/arch/powerpc/kernel/signal_64.c Wed Jan 11 16:14:16 2006 +++ b/arch/powerpc/kernel/signal_64.c Thu Jan 12 08:25:34 2006 @@ -1,5 +1,5 @@ /* - * linux/arch/ppc64/kernel/signal.c + * arch/powerpc/kernel/signal_64.c * * PowerPC version * Copyright (C) 1995-1996 Gary Thomas (gdt at linuxppc.org) diff -r 2e15034efcb7 arch/powerpc/kernel/vdso.c --- a/arch/powerpc/kernel/vdso.c Wed Jan 11 16:14:16 2006 +++ b/arch/powerpc/kernel/vdso.c Thu Jan 12 08:25:34 2006 @@ -1,5 +1,5 @@ /* - * linux/arch/ppc64/kernel/vdso.c + * arch/powerpc/kernel/vdso.c * * Copyright (C) 2004 Benjamin Herrenschmidt, IBM Corp. * diff -r 2e15034efcb7 arch/powerpc/lib/copypage_64.S --- a/arch/powerpc/lib/copypage_64.S Wed Jan 11 16:14:16 2006 +++ b/arch/powerpc/lib/copypage_64.S Thu Jan 12 08:25:34 2006 @@ -1,5 +1,5 @@ /* - * arch/ppc64/lib/copypage.S + * arch/powerpc/lib/copypage_64.S * * Copyright (C) 2002 Paul Mackerras, IBM Corp. * diff -r 2e15034efcb7 arch/powerpc/lib/copyuser_64.S --- a/arch/powerpc/lib/copyuser_64.S Wed Jan 11 16:14:16 2006 +++ b/arch/powerpc/lib/copyuser_64.S Thu Jan 12 08:25:34 2006 @@ -1,5 +1,5 @@ /* - * arch/ppc64/lib/copyuser.S + * arch/powerpc/lib/copyuser_64.S * * Copyright (C) 2002 Paul Mackerras, IBM Corp. * diff -r 2e15034efcb7 arch/powerpc/lib/e2a.c --- a/arch/powerpc/lib/e2a.c Wed Jan 11 16:14:16 2006 +++ b/arch/powerpc/lib/e2a.c Thu Jan 12 08:25:34 2006 @@ -1,9 +1,9 @@ /* - * arch/ppc64/lib/e2a.c + * arch/powerpc/lib/e2a.c * * EBCDIC to ASCII conversion * - * This function moved here from arch/ppc64/kernel/viopath.c + * This function moved here from arch/powerpc/platforms/iseries/viopath.c * * (C) Copyright 2000-2004 IBM Corporation * diff -r 2e15034efcb7 arch/powerpc/lib/memcpy_64.S --- a/arch/powerpc/lib/memcpy_64.S Wed Jan 11 16:14:16 2006 +++ b/arch/powerpc/lib/memcpy_64.S Thu Jan 12 08:25:34 2006 @@ -1,5 +1,5 @@ /* - * arch/ppc64/lib/memcpy.S + * arch/powerpc/lib/memcpy_64.S * * Copyright (C) 2002 Paul Mackerras, IBM Corp. * diff -r 2e15034efcb7 arch/powerpc/lib/rheap.c --- a/arch/powerpc/lib/rheap.c Wed Jan 11 16:14:16 2006 +++ b/arch/powerpc/lib/rheap.c Thu Jan 12 08:25:34 2006 @@ -1,5 +1,5 @@ /* - * arch/ppc/syslib/rheap.c + * arch/powerpc/lib/rheap.c * * A Remote Heap. Remote means that we don't touch the memory that the * heap points to. Normal heap implementations use the memory they manage diff -r 2e15034efcb7 arch/powerpc/mm/fault.c --- a/arch/powerpc/mm/fault.c Wed Jan 11 16:14:16 2006 +++ b/arch/powerpc/mm/fault.c Thu Jan 12 08:25:34 2006 @@ -1,5 +1,5 @@ /* - * arch/ppc/mm/fault.c + * arch/powerpc/mm/fault.c * * PowerPC version * Copyright (C) 1995-1996 Gary Thomas (gdt at linuxppc.org) diff -r 2e15034efcb7 arch/powerpc/mm/hash_low_32.S --- a/arch/powerpc/mm/hash_low_32.S Wed Jan 11 16:14:16 2006 +++ b/arch/powerpc/mm/hash_low_32.S Thu Jan 12 08:25:34 2006 @@ -1,5 +1,5 @@ /* - * arch/ppc/kernel/hashtable.S + * arch/powerpc/mm/hash_low_32.S * * $Id: hashtable.S,v 1.6 1999/10/08 01:56:15 paulus Exp $ * diff -r 2e15034efcb7 arch/powerpc/mm/mmap.c --- a/arch/powerpc/mm/mmap.c Wed Jan 11 16:14:16 2006 +++ b/arch/powerpc/mm/mmap.c Thu Jan 12 08:25:34 2006 @@ -1,5 +1,5 @@ /* - * linux/arch/ppc64/mm/mmap.c + * arch/powerpc/mm/mmap.c * * flexible mmap layout support * diff -r 2e15034efcb7 arch/powerpc/mm/mmu_decl.h --- a/arch/powerpc/mm/mmu_decl.h Wed Jan 11 16:14:16 2006 +++ b/arch/powerpc/mm/mmu_decl.h Thu Jan 12 08:25:34 2006 @@ -1,6 +1,6 @@ /* * Declarations of procedures and variables shared between files - * in arch/ppc/mm/. + * in arch/powerpc/mm/. * * Derived from arch/ppc/mm/init.c: * Copyright (C) 1995-1996 Gary Thomas (gdt at linuxppc.org) diff -r 2e15034efcb7 arch/powerpc/mm/slb_low.S --- a/arch/powerpc/mm/slb_low.S Wed Jan 11 16:14:16 2006 +++ b/arch/powerpc/mm/slb_low.S Thu Jan 12 08:25:34 2006 @@ -1,5 +1,5 @@ /* - * arch/ppc64/mm/slb_low.S + * arch/powerpc/mm/slb_low.S * * Low-level SLB routines * diff -r 2e15034efcb7 arch/powerpc/mm/tlb_64.c --- a/arch/powerpc/mm/tlb_64.c Wed Jan 11 16:14:16 2006 +++ b/arch/powerpc/mm/tlb_64.c Thu Jan 12 08:25:34 2006 @@ -36,7 +36,7 @@ DEFINE_PER_CPU(struct ppc64_tlb_batch, ppc64_tlb_batch); /* This is declared as we are using the more or less generic - * include/asm-ppc64/tlb.h file -- tgall + * include/asm-powerpc/tlb.h file -- tgall */ DEFINE_PER_CPU(struct mmu_gather, mmu_gathers); DEFINE_PER_CPU(struct pte_freelist_batch *, pte_freelist_cur); diff -r 2e15034efcb7 arch/powerpc/platforms/chrp/pegasos_eth.c --- a/arch/powerpc/platforms/chrp/pegasos_eth.c Wed Jan 11 16:14:16 2006 +++ b/arch/powerpc/platforms/chrp/pegasos_eth.c Thu Jan 12 08:25:34 2006 @@ -1,5 +1,5 @@ /* - * arch/ppc/platforms/chrp_pegasos_eth.c + * arch/powerpc/platforms/chrp/pegasos_eth.c * * Copyright (C) 2005 Sven Luther * Thanks to : diff -r 2e15034efcb7 arch/powerpc/platforms/chrp/setup.c --- a/arch/powerpc/platforms/chrp/setup.c Wed Jan 11 16:14:16 2006 +++ b/arch/powerpc/platforms/chrp/setup.c Thu Jan 12 08:25:34 2006 @@ -1,5 +1,5 @@ /* - * arch/ppc/platforms/setup.c + * arch/powerpc/platforms/chrp/setup.c * * Copyright (C) 1995 Linus Torvalds * Adapted from 'alpha' version by Gary Thomas diff -r 2e15034efcb7 arch/powerpc/platforms/chrp/time.c --- a/arch/powerpc/platforms/chrp/time.c Wed Jan 11 16:14:16 2006 +++ b/arch/powerpc/platforms/chrp/time.c Thu Jan 12 08:25:34 2006 @@ -1,5 +1,5 @@ /* - * arch/ppc/platforms/chrp_time.c + * arch/powerpc/platforms/chrp/time.c * * Copyright (C) 1991, 1992, 1995 Linus Torvalds * diff -r 2e15034efcb7 arch/powerpc/platforms/maple/time.c --- a/arch/powerpc/platforms/maple/time.c Wed Jan 11 16:14:16 2006 +++ b/arch/powerpc/platforms/maple/time.c Thu Jan 12 08:25:34 2006 @@ -1,5 +1,5 @@ /* - * arch/ppc64/kernel/maple_time.c + * arch/powerpc/platforms/maple/time.c * * (c) Copyright 2004 Benjamin Herrenschmidt (benh at kernel.crashing.org), * IBM Corp. diff -r 2e15034efcb7 arch/powerpc/platforms/powermac/cpufreq_32.c --- a/arch/powerpc/platforms/powermac/cpufreq_32.c Wed Jan 11 16:14:16 2006 +++ b/arch/powerpc/platforms/powermac/cpufreq_32.c Thu Jan 12 08:25:34 2006 @@ -1,5 +1,5 @@ /* - * arch/ppc/platforms/pmac_cpufreq.c + * arch/powerpc/platforms/powermac/cpufreq_32.c * * Copyright (C) 2002 - 2005 Benjamin Herrenschmidt * Copyright (C) 2004 John Steele Scott diff -r 2e15034efcb7 arch/powerpc/platforms/powermac/feature.c --- a/arch/powerpc/platforms/powermac/feature.c Wed Jan 11 16:14:16 2006 +++ b/arch/powerpc/platforms/powermac/feature.c Thu Jan 12 08:25:34 2006 @@ -1,5 +1,5 @@ /* - * arch/ppc/platforms/pmac_feature.c + * arch/powerpc/platforms/powermac/feature.c * * Copyright (C) 1996-2001 Paul Mackerras (paulus at cs.anu.edu.au) * Ben. Herrenschmidt (benh at kernel.crashing.org) diff -r 2e15034efcb7 arch/powerpc/platforms/powermac/nvram.c --- a/arch/powerpc/platforms/powermac/nvram.c Wed Jan 11 16:14:16 2006 +++ b/arch/powerpc/platforms/powermac/nvram.c Thu Jan 12 08:25:34 2006 @@ -1,5 +1,5 @@ /* - * arch/ppc/platforms/pmac_nvram.c + * arch/powerpc/platforms/powermac/nvram.c * * Copyright (C) 2002 Benjamin Herrenschmidt (benh at kernel.crashing.org) * diff -r 2e15034efcb7 arch/powerpc/platforms/pseries/hvCall.S --- a/arch/powerpc/platforms/pseries/hvCall.S Wed Jan 11 16:14:16 2006 +++ b/arch/powerpc/platforms/pseries/hvCall.S Thu Jan 12 08:25:34 2006 @@ -1,5 +1,5 @@ /* - * arch/ppc64/kernel/pSeries_hvCall.S + * arch/powerpc/platforms/pseries/hvCall.S * * This file contains the generic code to perform a call to the * pSeries LPAR hypervisor. diff -r 2e15034efcb7 arch/powerpc/platforms/pseries/iommu.c --- a/arch/powerpc/platforms/pseries/iommu.c Wed Jan 11 16:14:16 2006 +++ b/arch/powerpc/platforms/pseries/iommu.c Thu Jan 12 08:25:34 2006 @@ -1,5 +1,5 @@ /* - * arch/ppc64/kernel/pSeries_iommu.c + * arch/powerpc/platforms/pseries/iommu.c * * Copyright (C) 2001 Mike Corrigan & Dave Engebretsen, IBM Corporation * diff -r 2e15034efcb7 arch/powerpc/platforms/pseries/pci.c --- a/arch/powerpc/platforms/pseries/pci.c Wed Jan 11 16:14:16 2006 +++ b/arch/powerpc/platforms/pseries/pci.c Thu Jan 12 08:25:34 2006 @@ -1,5 +1,5 @@ /* - * arch/ppc64/kernel/pSeries_pci.c + * arch/powerpc/platforms/pseries/pci.c * * Copyright (C) 2001 Dave Engebretsen, IBM Corporation * Copyright (C) 2003 Anton Blanchard , IBM diff -r 2e15034efcb7 arch/powerpc/sysdev/dcr.S --- a/arch/powerpc/sysdev/dcr.S Wed Jan 11 16:14:16 2006 +++ b/arch/powerpc/sysdev/dcr.S Thu Jan 12 08:25:34 2006 @@ -1,5 +1,5 @@ /* - * arch/ppc/syslib/dcr.S + * arch/powerpc/sysdev/dcr.S * * "Indirect" DCR access * diff -r 2e15034efcb7 arch/powerpc/sysdev/ipic.h --- a/arch/powerpc/sysdev/ipic.h Wed Jan 11 16:14:16 2006 +++ b/arch/powerpc/sysdev/ipic.h Thu Jan 12 08:25:34 2006 @@ -1,5 +1,5 @@ /* - * arch/ppc/kernel/ipic.h + * arch/powerpc/sysdev/ipic.h * * IPIC private definitions and structure. * diff -r 2e15034efcb7 drivers/char/hvcs.c --- a/drivers/char/hvcs.c Wed Jan 11 16:14:16 2006 +++ b/drivers/char/hvcs.c Thu Jan 12 08:25:34 2006 @@ -118,7 +118,7 @@ * the hvcs_final_close() function in order to get it out of the spinlock. * Rearranged hvcs_close(). Cleaned up some printks and did some housekeeping * on the changelog. Removed local CLC_LENGTH and used HVCS_CLC_LENGTH from - * arch/ppc64/hvcserver.h. + * include/asm-powerpc/hvcserver.h * * 1.3.2 -> 1.3.3 Replaced yield() in hvcs_close() with tty_wait_until_sent() to * prevent possible lockup with realtime scheduling as similarily pointed out by @@ -168,9 +168,10 @@ /* * The hcall interface involves putting 8 chars into each of two registers. - * We load up those 2 registers (in arch/ppc64/hvconsole.c) by casting char[16] - * to long[2]. It would work without __ALIGNED__, but a little (tiny) bit - * slower because an unaligned load is slower than aligned load. + * We load up those 2 registers (in arch/powerpc/platforms/pseries/hvconsole.c) + * by casting char[16] to long[2]. It would work without __ALIGNED__, but a + * little (tiny) bit slower because an unaligned load is slower than aligned + * load. */ #define __ALIGNED__ __attribute__((__aligned__(8))) diff -r 2e15034efcb7 include/asm-powerpc/paca.h --- a/include/asm-powerpc/paca.h Wed Jan 11 16:14:16 2006 +++ b/include/asm-powerpc/paca.h Thu Jan 12 08:25:34 2006 @@ -53,7 +53,7 @@ #endif /* CONFIG_PPC_ISERIES */ /* - * MAGIC: the spinlock functions in arch/ppc64/lib/locks.c + * MAGIC: the spinlock functions in arch/powerpc/lib/locks.c * load lock_token and paca_index with a single lwz * instruction. They must travel together and be properly * aligned. diff -r 2e15034efcb7 include/asm-powerpc/rwsem.h --- a/include/asm-powerpc/rwsem.h Wed Jan 11 16:14:16 2006 +++ b/include/asm-powerpc/rwsem.h Thu Jan 12 08:25:34 2006 @@ -4,7 +4,7 @@ #ifdef __KERNEL__ /* - * include/asm-ppc64/rwsem.h: R/W semaphores for PPC using the stuff + * include/asm-powerpc/rwsem.h: R/W semaphores for PPC using the stuff * in lib/rwsem.c. Adapted largely from include/asm-i386/rwsem.h * by Paul Mackerras . */ diff -r 2e15034efcb7 kernel/auditsc.c --- a/kernel/auditsc.c Wed Jan 11 16:14:16 2006 +++ b/kernel/auditsc.c Thu Jan 12 08:25:34 2006 @@ -958,7 +958,7 @@ * * i386 no * x86_64 no - * ppc64 yes (see arch/ppc64/kernel/misc.S) + * ppc64 yes (see arch/powerpc/platforms/iseries/misc.S) * * This also happens with vm86 emulation in a non-nested manner * (entries without exits), so this case must be caught. From linas at austin.ibm.com Fri Jan 13 07:36:25 2006 From: linas at austin.ibm.com (linas) Date: Thu, 12 Jan 2006 14:36:25 -0600 Subject: [PATCH] PCI panic on dlpar add (add pci slot to running partition) Message-ID: <20060112203625.GU26221@austin.ibm.com> Greg, Please apply and forward upstream. Removing and then adding a PCI slot to a running partition results in a kernel panic. The current code attempts to add iospace for an entire root bus, which is inappropriate, and silently fails. When a pci device tries to use the iospace, a page fault is taken, as the iospace had not been mapped, and of course the page fault cannot be resolved. This only occurs for PCI adapters using pio, which may be why it hadn't been seen earlier (this seems to have been broken for a while). This patch has survived testing of dozens of slot add and removes. Signed-off-by: Linas Vepstas Index: linux-2.6.15-git6/drivers/pci/hotplug/rpadlpar_core.c =================================================================== --- linux-2.6.15-git6.orig/drivers/pci/hotplug/rpadlpar_core.c 2006-01-12 13:54:52.374015674 -0600 +++ linux-2.6.15-git6/drivers/pci/hotplug/rpadlpar_core.c 2006-01-12 13:56:08.191380743 -0600 @@ -152,7 +152,7 @@ pcibios_claim_one_bus(dev->bus); /* ioremap() for child bus, which may or may not succeed */ - (void) remap_bus_range(dev->bus); + remap_bus_range(dev->subordinate); /* Add new devices to global lists. Register in proc, sysfs. */ pci_bus_add_devices(phb->bus); From sleddog at us.ibm.com Fri Jan 13 09:03:58 2006 From: sleddog at us.ibm.com (Dave C Boutcher) Date: Thu, 12 Jan 2006 16:03:58 -0600 Subject: [PATCH 0/6] powerpc: powerpc.git version of sysstate and devicetree patches Message-ID: <20060112220358.GB15752@cs.umn.edu> Appologies for the patch spam. Here is the final version of the sysstate and devicetree patches built against the powerpc.git tree. Hopefully the last version -- Dave Boutcher From trini at kernel.crashing.org Fri Jan 13 08:25:50 2006 From: trini at kernel.crashing.org (Tom Rini) Date: Thu, 12 Jan 2006 14:25:50 -0700 Subject: [PATCH] Remove bzImage target Message-ID: <20060112212550.GJ27215@smtp.west.cox.net> Since the documentation no longer tells people to 'make bzImage', and with the previous patch nothing more than 'make' is required to get the right bootable images (just like on i386 now), this removes the bzImage -> zImage target redirect on ARCH=powerpc Signed-off-by: Tom Rini diff --git a/arch/powerpc/Makefile b/arch/powerpc/Makefile index 5f80e58..ad19028 100644 --- a/arch/powerpc/Makefile +++ b/arch/powerpc/Makefile @@ -148,9 +150,6 @@ all: $(KBUILD_IMAGE) CPPFLAGS_vmlinux.lds := -Upowerpc -# All the instructions talk about "make bzImage". -bzImage: zImage - BOOT_TARGETS = zImage zImage.initrd znetboot znetboot.initrd vmlinux.sm uImage .PHONY: $(BOOT_TARGETS) -- Tom Rini http://gate.crashing.org/~trini/ From sleddog at us.ibm.com Fri Jan 13 09:05:35 2006 From: sleddog at us.ibm.com (Dave C Boutcher) Date: Thu, 12 Jan 2006 16:05:35 -0600 Subject: [PATCH 1/6] powerpc: powerpc.git version of hypervisor constants In-Reply-To: <20060112220358.GB15752@cs.umn.edu> References: <20060112220358.GB15752@cs.umn.edu> Message-ID: <20060112220535.GC15752@cs.umn.edu> Adds a few more hypervisor call constants. Updated to address whitespace issues raised by Olof Johansson. Signed-off-by: Dave Boutcher diff -uNr powerpc.git.patched2/include/asm-powerpc/hvcall.h powerpc.git.vpm/include/asm-powerpc/hvcall.h --- powerpc.git.patched2/include/asm-powerpc/hvcall.h 2006-01-12 15:12:19.000000000 -0600 +++ powerpc.git.vpm/include/asm-powerpc/hvcall.h 2006-01-12 15:11:43.000000000 -0600 @@ -6,7 +6,10 @@ #define H_Success 0 #define H_Busy 1 /* Hardware busy -- retry later */ +#define H_Closed 2 /* Resource closed */ #define H_Constrained 4 /* Resource request constrained to max allowed */ +#define H_InProgress 14 /* Kind of like busy */ +#define H_Continue 18 /* Returned from H_Join on success */ #define H_LongBusyStartRange 9900 /* Start of long busy range */ #define H_LongBusyOrder1msec 9900 /* Long busy, hint that 1msec is a good time to retry */ #define H_LongBusyOrder10msec 9901 /* Long busy, hint that 10msec is a good time to retry */ @@ -114,6 +117,8 @@ #define H_REGISTER_VTERM 0x154 #define H_FREE_VTERM 0x158 #define H_POLL_PENDING 0x1D8 +#define H_JOIN 0x298 +#define H_ENABLE_CRQ 0x2B0 #ifndef __ASSEMBLY__ -- Dave Boutcher From sleddog at us.ibm.com Fri Jan 13 09:06:20 2006 From: sleddog at us.ibm.com (Dave C Boutcher) Date: Thu, 12 Jan 2006 16:06:20 -0600 Subject: [PATCH 2/6] powerpc: powerpc.git version of sysstate interface In-Reply-To: <20060112220358.GB15752@cs.umn.edu> References: <20060112220358.GB15752@cs.umn.edu> Message-ID: <20060112220620.GD15752@cs.umn.edu> Create a proc file that lets us call the ibm,suspend-me RTAS call. This call has to be wrapped in some hypervisor calls that synchronize all the CPUs, so it can't be done from userland. This depends on a prior patch to add additional hypervisor call constants. Signed-off-by: Dave Boutcher arch/powerpc/platforms/pseries/Makefile | 2 arch/powerpc/platforms/pseries/sysstate.c | 157 ++++++++++++++++++++++++++++++ 2 files changed, 158 insertions(+), 1 deletion(-) diff -uNr powerpc.git.patched2/arch/powerpc/platforms/pseries/Makefile powerpc.git.vpm/arch/powerpc/platforms/pseries/Makefile --- powerpc.git.patched2/arch/powerpc/platforms/pseries/Makefile 2006-01-12 15:12:17.000000000 -0600 +++ powerpc.git.vpm/arch/powerpc/platforms/pseries/Makefile 2006-01-12 15:21:14.000000000 -0600 @@ -1,5 +1,6 @@ obj-y := pci.o lpar.o hvCall.o nvram.o reconfig.o \ - setup.o iommu.o ras.o rtasd.o pci_dlpar.o + setup.o iommu.o ras.o rtasd.o pci_dlpar.o \ + sysstate.o obj-$(CONFIG_SMP) += smp.o obj-$(CONFIG_IBMVIO) += vio.o obj-$(CONFIG_XICS) += xics.o diff -uNr powerpc.git.patched2/arch/powerpc/platforms/pseries/sysstate.c powerpc.git.vpm/arch/powerpc/platforms/pseries/sysstate.c --- powerpc.git.patched2/arch/powerpc/platforms/pseries/sysstate.c 1969-12-31 18:00:00.000000000 -0600 +++ powerpc.git.vpm/arch/powerpc/platforms/pseries/sysstate.c 2006-01-12 15:20:26.000000000 -0600 @@ -0,0 +1,143 @@ +/* + * Logical Partition State + * + * Copyright (c) 2005 Dave Boutcher + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* + * This file handles the pSeries firmware supported "ibm,suspend-me" RTAS + * call. It can't be done from userland, since all of the CPUs must be first + * synchronized using the H_JOIN hypervisor call prior to making the + * ibm,suspend-me RTAS call. + * + * Note that this is completely different than normal Linux "software suspend". + * This is a hypervisor function driven as part of logical partitioning to give + * the hypervisor a "sync point" across the operating system. + */ + +#include +#include +#include +#include +#include +#include +#include + +#include + +static int suspend_me_tok = RTAS_UNKNOWN_SERVICE; + +static void cpu_suspend(void *info) +{ + long rc; + long flags; + long *waiting = (long *)info; + int status; + + /* + * We use "waiting" to indicate our state. As long + * as it is >0, we are still trying to all join up. + * If it goes to 0, we have successfully joined up and + * one thread got H_Continue. If any error happens, + * we set it to <0; + */ + local_irq_save(flags); + do { + rc = plpar_hcall_norets(H_JOIN); + smp_rmb(); + } while (rc == H_Success && *waiting > 0); + if (rc == H_Success) + goto out; + + if (rc == H_Continue) { + *waiting = 0; + if (suspend_me_tok != RTAS_UNKNOWN_SERVICE) { + status = rtas_call(suspend_me_tok, 0, 1, NULL); + if (status != 0) + printk(KERN_ERR + "RTAS ibm,suspend-me failed: %i\n", + status); + } + } else { + *waiting = -EBUSY; + printk(KERN_ERR "Error on H_Join hypervisor call\n"); + } + +out: + local_irq_restore(flags); + return; +} + +static int do_suspend(void) +{ + int i; + long waiting = 1; + + /* Call function on all other CPUs */ + if (on_each_cpu(cpu_suspend, &waiting, 1, 0)) + waiting = -EINVAL; + + if (waiting != 0) + printk(KERN_ERR "Error doing global join!\n"); + + /* Prod each CPU. This won't hurt, and will wake + * anyone we successfully put to sleep with H_Join + */ + for_each_cpu(i) + plpar_hcall_norets(H_PROD,i); + + return 0; +} + +static int write_proc(struct file *file, const char __user *buffer, + unsigned long count, void *data) +{ + char command[32]; + + if (count > sizeof(command)) + count = sizeof(command); + + if (copy_from_user(command, buffer, count)) + return -EFAULT; + + command[7] = '\0'; + + if (strcmp(command, "suspend") == 0) { + do_suspend(); + } + return count; +} + +static int __init sys_state_init(void) +{ + struct proc_dir_entry *entry; + suspend_me_tok = rtas_token("ibm,suspend-me"); + if (suspend_me_tok == RTAS_UNKNOWN_SERVICE) + return 0; + + entry = create_proc_entry("ppc64/rtas/platform_state", S_IWUSR, NULL); + if (!entry) { + printk(KERN_ERR "Failed to create platform_state proc entry\n"); + return 0; + } + + entry->write_proc = write_proc; + + return 0; +} + +arch_initcall(sys_state_init); -- Dave Boutcher From sleddog at us.ibm.com Fri Jan 13 09:07:17 2006 From: sleddog at us.ibm.com (Dave C Boutcher) Date: Thu, 12 Jan 2006 16:07:17 -0600 Subject: [PATCH 3/6] powerpc: powerpc.git version of devicetree remove/update In-Reply-To: <20060112220358.GB15752@cs.umn.edu> References: <20060112220358.GB15752@cs.umn.edu> Message-ID: <20060112220717.GE15752@cs.umn.edu> Add support to the proc_device_tree file for removing and updating properties. Remove just removes the proc file, update changes the data pointer within the proc file. The remainder of the device-tree changes occur elsewhere. Signed-off-by: Dave Boutcher fs/proc/proc_devtree.c | 24 ++++++++++++++++++++++++ include/linux/proc_fs.h | 5 +++++ 2 files changed, 29 insertions(+) diff -uNr linux-2.6.15-patched/fs/proc/proc_devtree.c linux-2.6.15-patched2/fs/proc/proc_devtree.c --- linux-2.6.15-patched/fs/proc/proc_devtree.c 2006-01-11 17:46:58.000000000 -0600 +++ linux-2.6.15-patched2/fs/proc/proc_devtree.c 2006-01-11 17:58:02.000000000 -0600 @@ -81,6 +81,30 @@ __proc_device_tree_add_prop(pde, prop); } +void proc_device_tree_remove_prop(struct proc_dir_entry *pde, + struct property *prop) +{ + remove_proc_entry(prop->name, pde); +} + +void proc_device_tree_update_prop(struct proc_dir_entry *pde, + struct property *newprop, + struct property *oldprop) +{ + struct proc_dir_entry *ent; + + for (ent = pde->subdir; ent != NULL; ent = ent->next) + if (ent->data == oldprop) + break; + if (ent == NULL) { + printk(KERN_WARNING "device-tree: property \"%s\" " + " does not exist\n", oldprop->name); + } else { + ent->data = newprop; + ent->size = newprop->length; + } +} + /* * Process a node, adding entries for its children and its properties. */ diff -uNr linux-2.6.15-patched/include/linux/proc_fs.h linux-2.6.15-patched2/include/linux/proc_fs.h --- linux-2.6.15-patched/include/linux/proc_fs.h 2006-01-11 17:46:59.000000000 -0600 +++ linux-2.6.15-patched2/include/linux/proc_fs.h 2006-01-11 17:58:02.000000000 -0600 @@ -146,6 +146,11 @@ extern void proc_device_tree_init(void); extern void proc_device_tree_add_node(struct device_node *, struct proc_dir_entry *); extern void proc_device_tree_add_prop(struct proc_dir_entry *pde, struct property *prop); +extern void proc_device_tree_remove_prop(struct proc_dir_entry *pde, + struct property *prop); +extern void proc_device_tree_update_prop(struct proc_dir_entry *pde, + struct property *newprop, + struct property *oldprop); #endif /* CONFIG_PROC_DEVICETREE */ extern struct proc_dir_entry *proc_symlink(const char *, -- Dave Boutcher From sleddog at us.ibm.com Fri Jan 13 09:08:27 2006 From: sleddog at us.ibm.com (Dave C Boutcher) Date: Thu, 12 Jan 2006 16:08:27 -0600 Subject: [PATCH 4/6] powerpc: powerpc.git version of prom.c remove/update support In-Reply-To: <20060112220358.GB15752@cs.umn.edu> References: <20060112220358.GB15752@cs.umn.edu> Message-ID: <20060112220827.GF15752@cs.umn.edu> Add support for updating and removing device tree properties. Since we hand out pointers to properties with gay abandon, we can't just free the property storage. Instead we move deleted, or the old copy of an updated property, to a "dead properties" list. Also note, its not feasable to kref device tree properties. we call get_property() all over the kernel in a wild variety of contexts. One consequence of this change is that we now take a read_lock(&devtree_lock) when doing get_property(). Signed-off-by: Dave Boutcher arch/powerpc/kernel/prom.c | 93 ++++++++++++++++++++++++++++++++++++++++++++- include/asm-powerpc/prom.h | 5 ++ 2 files changed, 96 insertions(+), 2 deletions(-) diff -uNr powerpc.git.patched2/arch/powerpc/kernel/prom.c powerpc.git.vpm/arch/powerpc/kernel/prom.c --- powerpc.git.patched2/arch/powerpc/kernel/prom.c 2006-01-12 15:12:17.000000000 -0600 +++ powerpc.git.vpm/arch/powerpc/kernel/prom.c 2006-01-12 15:34:11.000000000 -0600 @@ -1607,6 +1607,11 @@ kfree(prop->value); kfree(prop); prop = next; + + if (!prop) { + prop = node->deadprops; + node->deadprops = NULL; + } } kfree(node->intrs); kfree(node->full_name); @@ -1763,13 +1768,16 @@ { struct property *pp; + read_lock(&devtree_lock); for (pp = np->properties; pp != 0; pp = pp->next) if (strcmp(pp->name, name) == 0) { if (lenp != 0) *lenp = pp->length; - return pp->value; + break; } - return NULL; + read_unlock(&devtree_lock); + + return pp ? pp->value : NULL; } EXPORT_SYMBOL(get_property); @@ -1803,4 +1811,83 @@ return 0; } +/* + * Remove a property from a node. Note that we don't actually + * remove it, since we have given out who-knows-how-many pointers + * to the data using get-property. Instead we just move the property + * to the "dead properties" list, so it won't be found any more. + */ +int prom_remove_property(struct device_node *np, struct property *prop) +{ + struct property **next; + int found = 0; + + write_lock(&devtree_lock); + next = &np->properties; + while (*next) { + if (*next == prop) { + /* found the node */ + *next = prop->next; + prop->next = np->deadprops; + np->deadprops = prop; + found = 1; + break; + } + next = &(*next)->next; + } + write_unlock(&devtree_lock); + + if (!found) + return -ENODEV; + +#ifdef CONFIG_PROC_DEVICETREE + /* try to remove the proc node as well */ + if (np->pde) + proc_device_tree_remove_prop(np->pde, prop); +#endif /* CONFIG_PROC_DEVICETREE */ + + return 0; +} + +/* + * Update a property in a node. Note that we don't actually + * remove it, since we have given out who-knows-how-many pointers + * to the data using get-property. Instead we just move the property + * to the "dead properties" list, and add the new property to the + * property list + */ +int prom_update_property(struct device_node *np, + struct property *newprop, + struct property *oldprop) +{ + struct property **next; + int found = 0; + write_lock(&devtree_lock); + next = &np->properties; + while (*next) { + if (*next == oldprop) { + /* found the node */ + newprop->next = oldprop->next; + *next = newprop; + oldprop->next = np->deadprops; + np->deadprops = oldprop; + found = 1; + break; + } + next = &(*next)->next; + } + write_unlock(&devtree_lock); + + if (!found) + return -ENODEV; + +#ifdef CONFIG_PROC_DEVICETREE + /* try to add to proc as well if it was initialized */ + if (np->pde) + proc_device_tree_update_prop(np->pde, newprop, + oldprop); +#endif /* CONFIG_PROC_DEVICETREE */ + + return 0; +} diff -uNr powerpc.git.patched2/include/asm-powerpc/prom.h powerpc.git.vpm/include/asm-powerpc/prom.h --- powerpc.git.patched2/include/asm-powerpc/prom.h 2006-01-12 15:12:19.000000000 -0600 +++ powerpc.git.vpm/include/asm-powerpc/prom.h 2006-01-12 15:29:25.000000000 -0600 @@ -87,6 +87,7 @@ char *full_name; struct property *properties; + struct property *deadprops; /* removed properties */ struct device_node *parent; struct device_node *child; struct device_node *sibling; @@ -164,6 +165,10 @@ extern int prom_n_intr_cells(struct device_node* np); extern void prom_get_irq_senses(unsigned char *senses, int off, int max); extern int prom_add_property(struct device_node* np, struct property* prop); +extern int prom_remove_property(struct device_node *np, struct property *prop); +extern int prom_update_property(struct device_node *np, + struct property *newprop, + struct property *oldprop); #ifdef CONFIG_PPC32 /* -- Dave Boutcher From sleddog at us.ibm.com Fri Jan 13 09:09:29 2006 From: sleddog at us.ibm.com (Dave C Boutcher) Date: Thu, 12 Jan 2006 16:09:29 -0600 Subject: [PATCH 5/6] powerpc: powerpc.git version of of_find_property function In-Reply-To: <20060112220358.GB15752@cs.umn.edu> References: <20060112220358.GB15752@cs.umn.edu> Message-ID: <20060112220929.GG15752@cs.umn.edu> Add an of_find_property function that returns a struct property given a property name. Then change the get_property function to use that routine internally. Signed-off-by: Dave Boutcher arch/powerpc/kernel/prom.c | 19 +++++++++++++------ include/asm-powerpc/prom.h | 3 +++ 2 files changed, 16 insertions(+), 6 deletions(-) diff -uNr powerpc.git.patched2/arch/powerpc/kernel/prom.c powerpc.git.vpm/arch/powerpc/kernel/prom.c --- powerpc.git.patched2/arch/powerpc/kernel/prom.c 2006-01-12 15:39:04.000000000 -0600 +++ powerpc.git.vpm/arch/powerpc/kernel/prom.c 2006-01-12 15:39:25.000000000 -0600 @@ -1759,12 +1759,8 @@ __initcall(prom_reconfig_setup); #endif -/* - * Find a property with a given name for a given node - * and return the value. - */ -unsigned char *get_property(struct device_node *np, const char *name, - int *lenp) +struct property *of_find_property(struct device_node *np, const char *name, + int *lenp) { struct property *pp; @@ -1777,6 +1773,17 @@ } read_unlock(&devtree_lock); + return pp; +} + +/* + * Find a property with a given name for a given node + * and return the value. + */ +unsigned char *get_property(struct device_node *np, const char *name, + int *lenp) +{ + struct property *pp = of_find_property(np,name,lenp); return pp ? pp->value : NULL; } EXPORT_SYMBOL(get_property); diff -uNr powerpc.git.patched2/include/asm-powerpc/prom.h powerpc.git.vpm/include/asm-powerpc/prom.h --- powerpc.git.patched2/include/asm-powerpc/prom.h 2006-01-12 15:39:04.000000000 -0600 +++ powerpc.git.vpm/include/asm-powerpc/prom.h 2006-01-12 15:39:25.000000000 -0600 @@ -136,6 +136,9 @@ extern struct device_node *of_get_parent(const struct device_node *node); extern struct device_node *of_get_next_child(const struct device_node *node, struct device_node *prev); +extern struct property *of_find_property(struct device_node *np, + const char *name, + int *lenp); extern struct device_node *of_node_get(struct device_node *node); extern void of_node_put(struct device_node *node); -- Dave Boutcher From trini at kernel.crashing.org Fri Jan 13 08:23:19 2006 From: trini at kernel.crashing.org (Tom Rini) Date: Thu, 12 Jan 2006 14:23:19 -0700 Subject: [PATCH] Add zImage / uImage to default builds Message-ID: <20060112212319.GI27215@smtp.west.cox.net> This adds uImage and zImage to the list of default build targets on ARCH=powerpc to match ARCH=ppc Signed-off-by: Tom Rini diff --git a/arch/powerpc/Makefile b/arch/powerpc/Makefile index 5f80e58..ad19028 100644 --- a/arch/powerpc/Makefile +++ b/arch/powerpc/Makefile @@ -60,6 +60,8 @@ endif LDFLAGS_vmlinux := -Bstatic +all: uImage zImage + # The -Iarch/$(ARCH)/include is temporary while we are merging CPPFLAGS-$(CONFIG_PPC32) := -Iarch/$(ARCH) -Iarch/$(ARCH)/include AFLAGS-$(CONFIG_PPC32) := -Iarch/$(ARCH) -- Tom Rini http://gate.crashing.org/~trini/ From sleddog at us.ibm.com Fri Jan 13 09:10:22 2006 From: sleddog at us.ibm.com (Dave C Boutcher) Date: Thu, 12 Jan 2006 16:10:22 -0600 Subject: [PATCH 6/6] powerpc: powerpc.git version of reconfig propety interface In-Reply-To: <20060112220358.GB15752@cs.umn.edu> References: <20060112220358.GB15752@cs.umn.edu> Message-ID: <20060112221022.GH15752@cs.umn.edu> Add support to reconfigure the device tree through the existing proc filesystem interface. Add "add_property", "remove_property", and "update_property" interfaces. Signed-off-by: Dave Boutcher arch/powerpc/platforms/pseries/reconfig.c | 101 ++++++++++++++++++++++++++++++ 1 file changed, 101 insertions(+) diff -uNr linux-2.6.15-patched/arch/powerpc/platforms/pseries/reconfig.c linux-2.6.15-patched2/arch/powerpc/platforms/pseries/reconfig.c --- linux-2.6.15-patched/arch/powerpc/platforms/pseries/reconfig.c 2006-01-11 17:46:57.000000000 -0600 +++ linux-2.6.15-patched2/arch/powerpc/platforms/pseries/reconfig.c 2006-01-11 18:01:16.000000000 -0600 @@ -350,6 +350,101 @@ return rv; } +static char *parse_node(char *buf, size_t bufsize, struct device_node **npp) +{ + char *handle_str; + phandle handle; + *npp = NULL; + + handle_str = buf; + + buf = strchr(buf, ' '); + if (!buf) + return NULL; + *buf = '\0'; + buf++; + + handle = simple_strtoul(handle_str, NULL, 10); + + *npp = of_find_node_by_phandle(handle); + return buf; +} + +static int do_add_property(char *buf, size_t bufsize) +{ + struct property *prop = NULL; + struct device_node *np; + unsigned char *value; + char *name, *end; + int length; + end = buf + bufsize; + buf = parse_node(buf,bufsize,&np); + + if (!np) + return -ENODEV; + + if (parse_next_property(buf, end, &name, &length, &value) == NULL) + return -EINVAL; + + prop = new_property(name, length, value, NULL); + if (!prop) + return -ENOMEM; + + prom_add_property(np, + prop); + + return 0; +} + +static int do_remove_property(char *buf, size_t bufsize) +{ + struct device_node *np; + char *tmp; + struct property *prop; + buf = parse_node(buf,bufsize,&np); + + if (!np) + return -ENODEV; + + tmp = strchr(buf,' '); + if (tmp) + *tmp = '\0'; + + if (strlen(buf) == 0) + return -EINVAL; + + prop = of_find_property(np, buf, NULL); + + return prom_remove_property(np, prop); +} + +static int do_update_property(char *buf, size_t bufsize) +{ + struct device_node *np; + unsigned char *value; + char *name, *end; + int length; + struct property *newprop, *oldprop; + buf = parse_node(buf,bufsize,&np); + end = buf + bufsize; + + if (!np) + return -ENODEV; + + if (parse_next_property(buf, end, &name, &length, &value) == NULL) + return -EINVAL; + + newprop = new_property(name, length, value, NULL); + if (!newprop) + return -ENOMEM; + + oldprop = of_find_property(np, name,NULL); + if (!oldprop) + return -ENODEV; + + return prom_update_property(np, newprop, oldprop); +} + /** * ofdt_write - perform operations on the Open Firmware device tree * @@ -392,6 +487,12 @@ rv = do_add_node(tmp, count - (tmp - kbuf)); else if (!strcmp(kbuf, "remove_node")) rv = do_remove_node(tmp); + else if (!strcmp(kbuf, "add_property")) + rv = do_add_property(tmp, count - (tmp - kbuf)); + else if (!strcmp(kbuf, "remove_property")) + rv = do_remove_property(tmp, count - (tmp - kbuf)); + else if (!strcmp(kbuf, "update_property")) + rv = do_update_property(tmp, count - (tmp - kbuf)); else rv = -EINVAL; out: -- Dave Boutcher From david at gibson.dropbear.id.au Fri Jan 13 10:24:58 2006 From: david at gibson.dropbear.id.au (David Gibson) Date: Fri, 13 Jan 2006 10:24:58 +1100 Subject: powerpc: Cleanup LOADADDR etc. asm macros Message-ID: <20060112232458.GB22961@localhost.localdomain> Resend. powerpc: Cleanup LOADADDR etc. asm macros This patch consolidates the variety of macros used for loading 32 or 64-bit constants in assembler (LOADADDR, LOADBASE, SET_REG_TO_*). The idea is to make the set of macros consistent across 32 and 64 bit and to make it more obvious which is the appropriate one to use in a given situation. The new macros and their semantics are described in the comments in ppc_asm.h. In the process, we change several places that were unnecessarily using immediate loads on ppc64 to use the GOT/TOC. Likewise we cleanup a couple of places where we were clumsily subtracting PAGE_OFFSET with asm instructions to use assemble-time arithmetic or the toreal() macro instead. Signed-off-by: David Gibson Index: working-2.6/include/asm-powerpc/ppc_asm.h =================================================================== --- working-2.6.orig/include/asm-powerpc/ppc_asm.h 2005-11-23 15:56:35.000000000 +1100 +++ working-2.6/include/asm-powerpc/ppc_asm.h 2005-12-16 16:07:14.000000000 +1100 @@ -155,52 +155,56 @@ n: #endif /* - * LOADADDR( rn, name ) - * loads the address of 'name' into 'rn' + * LOAD_REG_IMMEDIATE(rn, expr) + * Loads the value of the constant expression 'expr' into register 'rn' + * using immediate instructions only. Use this when it's important not + * to reference other data (i.e. on ppc64 when the TOC pointer is not + * valid). * - * LOADBASE( rn, name ) - * loads the address (possibly without the low 16 bits) of 'name' into 'rn' - * suitable for base+disp addressing + * LOAD_REG_ADDR(rn, name) + * Loads the address of label 'name' into register 'rn'. Use this when + * you don't particularly need immediate instructions only, but you need + * the whole address in one register (e.g. it's a structure address and + * you want to access various offsets within it). On ppc32 this is + * identical to LOAD_REG_IMMEDIATE. + * + * LOAD_REG_ADDRBASE(rn, name) + * ADDROFF(name) + * LOAD_REG_ADDRBASE loads part of the address of label 'name' into + * register 'rn'. ADDROFF(name) returns the remainder of the address as + * a constant expression. ADDROFF(name) is a signed expression < 16 bits + * in size, so is suitable for use directly as an offset in load and store + * instructions. Use this when loading/storing a single word or less as: + * LOAD_REG_ADDRBASE(rX, name) + * ld rY,ADDROFF(name)(rX) */ #ifdef __powerpc64__ -#define LOADADDR(rn,name) \ - lis rn,name##@highest; \ - ori rn,rn,name##@higher; \ - rldicr rn,rn,32,31; \ - oris rn,rn,name##@h; \ - ori rn,rn,name##@l - -#define LOADBASE(rn,name) \ - ld rn,name at got(r2) - -#define OFF(name) 0 - -#define SET_REG_TO_CONST(reg, value) \ - lis reg,(((value)>>48)&0xFFFF); \ - ori reg,reg,(((value)>>32)&0xFFFF); \ - rldicr reg,reg,32,31; \ - oris reg,reg,(((value)>>16)&0xFFFF); \ - ori reg,reg,((value)&0xFFFF); - -#define SET_REG_TO_LABEL(reg, label) \ - lis reg,(label)@highest; \ - ori reg,reg,(label)@higher; \ - rldicr reg,reg,32,31; \ - oris reg,reg,(label)@h; \ - ori reg,reg,(label)@l; +#define LOAD_REG_IMMEDIATE(reg,expr) \ + lis (reg),(expr)@highest; \ + ori (reg),(reg),(expr)@higher; \ + rldicr (reg),(reg),32,31; \ + oris (reg),(reg),(expr)@h; \ + ori (reg),(reg),(expr)@l; + +#define LOAD_REG_ADDR(reg,name) \ + ld (reg),name at got(r2) + +#define LOAD_REG_ADDRBASE(reg,name) LOAD_REG_ADDR(reg,name) +#define ADDROFF(name) 0 /* offsets for stack frame layout */ #define LRSAVE 16 #else /* 32-bit */ -#define LOADADDR(rn,name) \ - lis rn,name at ha; \ - addi rn,rn,name at l -#define LOADBASE(rn,name) \ - lis rn,name at ha +#define LOAD_REG_IMMEDIATE(reg,expr) \ + lis (reg),(expr)@ha; \ + addi (reg),(reg),(expr)@l; + +#define LOAD_REG_ADDR(reg,name) LOAD_REG_IMMEDIATE(reg, name) -#define OFF(name) name at l +#define LOAD_REG_ADDRBASE(reg, name) lis (reg),name at ha +#define ADDROFF(name) name at l /* offsets for stack frame layout */ #define LRSAVE 4 Index: working-2.6/arch/powerpc/kernel/entry_64.S =================================================================== --- working-2.6.orig/arch/powerpc/kernel/entry_64.S 2005-12-16 13:05:21.000000000 +1100 +++ working-2.6/arch/powerpc/kernel/entry_64.S 2005-12-16 15:51:35.000000000 +1100 @@ -689,9 +689,8 @@ _GLOBAL(enter_rtas) std r6,PACASAVEDMSR(r13) /* Setup our real return addr */ - SET_REG_TO_LABEL(r4,.rtas_return_loc) - SET_REG_TO_CONST(r9,PAGE_OFFSET) - sub r4,r4,r9 + LOAD_REG_ADDR(r4,.rtas_return_loc) + toreal(r4) mtlr r4 li r0,0 @@ -706,7 +705,7 @@ _GLOBAL(enter_rtas) sync /* disable interrupts so SRR0/1 */ mtmsrd r0 /* don't get trashed */ - SET_REG_TO_LABEL(r4,rtas) + LOAD_REG_ADDR(r4, rtas) ld r5,RTASENTRY(r4) /* get the rtas->entry value */ ld r4,RTASBASE(r4) /* get the rtas->base value */ @@ -718,8 +717,7 @@ _GLOBAL(enter_rtas) _STATIC(rtas_return_loc) /* relocation is off at this point */ mfspr r4,SPRN_SPRG3 /* Get PACA */ - SET_REG_TO_CONST(r5, PAGE_OFFSET) - sub r4,r4,r5 /* RELOC the PACA base pointer */ + toreal(r4) mfmsr r6 li r0,MSR_RI @@ -728,7 +726,7 @@ _STATIC(rtas_return_loc) mtmsrd r6 ld r1,PACAR1(r4) /* Restore our SP */ - LOADADDR(r3,.rtas_restore_regs) + LOAD_REG_IMMEDIATE(r3,.rtas_restore_regs) ld r4,PACASAVEDMSR(r4) /* Restore our MSR */ mtspr SPRN_SRR0,r3 Index: working-2.6/arch/powerpc/kernel/head_64.S =================================================================== --- working-2.6.orig/arch/powerpc/kernel/head_64.S 2005-12-16 13:05:21.000000000 +1100 +++ working-2.6/arch/powerpc/kernel/head_64.S 2005-12-16 15:51:35.000000000 +1100 @@ -154,12 +154,12 @@ _GLOBAL(__secondary_hold) bne 100b #ifdef CONFIG_HMT - LOADADDR(r4, .hmt_init) + SET_REG_IMMEDIATE(r4, .hmt_init) mtctr r4 bctr #else #ifdef CONFIG_SMP - LOADADDR(r4, .pSeries_secondary_smp_init) + LOAD_REG_IMMEDIATE(r4, .pSeries_secondary_smp_init) mtctr r4 mr r3,r24 bctr @@ -205,9 +205,10 @@ exception_marker: #define EX_LR 72 /* - * We're short on space and time in the exception prolog, so we can't use - * the normal LOADADDR macro. Normally we just need the low halfword of the - * address, but for Kdump we need the whole low word. + * We're short on space and time in the exception prolog, so we can't + * use the normal SET_REG_IMMEDIATE macro. Normally we just need the + * low halfword of the address, but for Kdump we need the whole low + * word. */ #ifdef CONFIG_CRASH_DUMP #define LOAD_HANDLER(reg, label) \ @@ -713,7 +714,7 @@ system_reset_iSeries: lbz r23,PACAPROCSTART(r13) /* Test if this processor * should start */ sync - LOADADDR(r3,current_set) + LOAD_REG_IMMEDIATE(r3,current_set) sldi r28,r24,3 /* get current_set[cpu#] */ ldx r3,r3,r28 addi r1,r3,THREAD_SIZE @@ -746,8 +747,8 @@ iSeries_secondary_smp_loop: decrementer_iSeries_masked: li r11,1 stb r11,PACALPPACA+LPPACADECRINT(r13) - LOADBASE(r12,tb_ticks_per_jiffy) - lwz r12,OFF(tb_ticks_per_jiffy)(r12) + LOAD_REG_ADDRBASE(r12,tb_ticks_per_jiffy) + lwz r12,ADDROFF(tb_ticks_per_jiffy)(r12) mtspr SPRN_DEC,r12 /* fall through */ @@ -1412,7 +1413,7 @@ _GLOBAL(pSeries_secondary_smp_init) * physical cpu id in r24, we need to search the pacas to find * which logical id maps to our physical one. */ - LOADADDR(r13, paca) /* Get base vaddr of paca array */ + LOAD_REG_IMMEDIATE(r13, paca) /* Get base vaddr of paca array */ li r5,0 /* logical cpu id */ 1: lhz r6,PACAHWCPUID(r13) /* Load HW procid from paca */ cmpw r6,r24 /* Compare to our id */ @@ -1446,8 +1447,8 @@ _GLOBAL(pSeries_secondary_smp_init) #ifdef CONFIG_PPC_ISERIES _STATIC(__start_initialization_iSeries) /* Clear out the BSS */ - LOADADDR(r11,__bss_stop) - LOADADDR(r8,__bss_start) + LOAD_REG_IMMEDIATE(r11,__bss_stop) + LOAD_REG_IMMEDIATE(r8,__bss_start) sub r11,r11,r8 /* bss size */ addi r11,r11,7 /* round up to an even double word */ rldicl. r11,r11,61,3 /* shift right by 3 */ @@ -1458,17 +1459,17 @@ _STATIC(__start_initialization_iSeries) 3: stdu r0,8(r8) bdnz 3b 4: - LOADADDR(r1,init_thread_union) + LOAD_REG_IMMEDIATE(r1,init_thread_union) addi r1,r1,THREAD_SIZE li r0,0 stdu r0,-STACK_FRAME_OVERHEAD(r1) - LOADADDR(r3,cpu_specs) - LOADADDR(r4,cur_cpu_spec) + LOAD_REG_IMMEDIATE(r3,cpu_specs) + LOAD_REG_IMMEDIATE(r4,cur_cpu_spec) li r5,0 bl .identify_cpu - LOADADDR(r2,__toc_start) + LOAD_REG_IMMEDIATE(r2,__toc_start) addi r2,r2,0x4000 addi r2,r2,0x4000 @@ -1526,7 +1527,7 @@ _GLOBAL(__start_initialization_multiplat li r24,0 /* Switch off MMU if not already */ - LOADADDR(r4, .__after_prom_start - KERNELBASE) + LOAD_REG_IMMEDIATE(r4, .__after_prom_start - KERNELBASE) add r4,r4,r30 bl .__mmu_off b .__after_prom_start @@ -1545,7 +1546,7 @@ _STATIC(__boot_from_prom) /* put a relocation offset into r3 */ bl .reloc_offset - LOADADDR(r2,__toc_start) + LOAD_REG_IMMEDIATE(r2,__toc_start) addi r2,r2,0x4000 addi r2,r2,0x4000 @@ -1584,9 +1585,9 @@ _STATIC(__after_prom_start) */ bl .reloc_offset mr r26,r3 - SET_REG_TO_CONST(r27,KERNELBASE) + LOAD_REG_IMMEDIATE(r27, KERNELBASE) - LOADADDR(r3, PHYSICAL_START) /* target addr */ + LOAD_REG_IMMEDIATE(r3, PHYSICAL_START) /* target addr */ // XXX FIXME: Use phys returned by OF (r30) add r4,r27,r26 /* source addr */ @@ -1594,7 +1595,7 @@ _STATIC(__after_prom_start) /* i.e. where we are running */ /* the source addr */ - LOADADDR(r5,copy_to_here) /* # bytes of memory to copy */ + LOAD_REG_IMMEDIATE(r5,copy_to_here) /* # bytes of memory to copy */ sub r5,r5,r27 li r6,0x100 /* Start offset, the first 0x100 */ @@ -1604,11 +1605,11 @@ _STATIC(__after_prom_start) /* this includes the code being */ /* executed here. */ - LOADADDR(r0, 4f) /* Jump to the copy of this code */ + LOAD_REG_IMMEDIATE(r0, 4f) /* Jump to the copy of this code */ mtctr r0 /* that we just made/relocated */ bctr -4: LOADADDR(r5,klimit) +4: LOAD_REG_IMMEDIATE(r5,klimit) add r5,r5,r26 ld r5,0(r5) /* get the value of klimit */ sub r5,r5,r27 @@ -1690,7 +1691,7 @@ _GLOBAL(pmac_secondary_start) mtmsrd r3 /* RI on */ /* Set up a paca value for this processor. */ - LOADADDR(r4, paca) /* Get base vaddr of paca array */ + LOAD_REG_IMMEDIATE(r4, paca) /* Get base vaddr of paca array */ mulli r13,r24,PACA_SIZE /* Calculate vaddr of right paca */ add r13,r13,r4 /* for this processor. */ mtspr SPRN_SPRG3,r13 /* Save vaddr of paca in SPRG3 */ @@ -1727,7 +1728,7 @@ _GLOBAL(__secondary_start) bl .early_setup_secondary /* Initialize the kernel stack. Just a repeat for iSeries. */ - LOADADDR(r3,current_set) + LOAD_REG_ADDR(r3, current_set) sldi r28,r24,3 /* get current_set[cpu#] */ ldx r1,r3,r28 addi r1,r1,THREAD_SIZE-STACK_FRAME_OVERHEAD @@ -1738,8 +1739,8 @@ _GLOBAL(__secondary_start) mtlr r7 /* enable MMU and jump to start_secondary */ - LOADADDR(r3,.start_secondary_prolog) - SET_REG_TO_CONST(r4, MSR_KERNEL) + LOAD_REG_ADDR(r3, .start_secondary_prolog) + LOAD_REG_IMMEDIATE(r4, MSR_KERNEL) #ifdef DO_SOFT_DISABLE ori r4,r4,MSR_EE #endif @@ -1788,8 +1789,8 @@ _STATIC(start_here_multiplatform) * be detached from the kernel completely. Besides, we need * to clear it now for kexec-style entry. */ - LOADADDR(r11,__bss_stop) - LOADADDR(r8,__bss_start) + LOAD_REG_IMMEDIATE(r11,__bss_stop) + LOAD_REG_IMMEDIATE(r8,__bss_start) sub r11,r11,r8 /* bss size */ addi r11,r11,7 /* round up to an even double word */ rldicl. r11,r11,61,3 /* shift right by 3 */ @@ -1827,7 +1828,7 @@ _STATIC(start_here_multiplatform) /* up the htab. This is done because we have relocated the */ /* kernel but are still running in real mode. */ - LOADADDR(r3,init_thread_union) + LOAD_REG_IMMEDIATE(r3,init_thread_union) add r3,r3,r26 /* set up a stack pointer (physical address) */ @@ -1836,14 +1837,14 @@ _STATIC(start_here_multiplatform) stdu r0,-STACK_FRAME_OVERHEAD(r1) /* set up the TOC (physical address) */ - LOADADDR(r2,__toc_start) + LOAD_REG_IMMEDIATE(r2,__toc_start) addi r2,r2,0x4000 addi r2,r2,0x4000 add r2,r2,r26 - LOADADDR(r3,cpu_specs) + LOAD_REG_IMMEDIATE(r3, cpu_specs) add r3,r3,r26 - LOADADDR(r4,cur_cpu_spec) + LOAD_REG_IMMEDIATE(r4,cur_cpu_spec) add r4,r4,r26 mr r5,r26 bl .identify_cpu @@ -1859,11 +1860,11 @@ _STATIC(start_here_multiplatform) * nowhere it can be initialized differently before we reach this * code */ - LOADADDR(r27, boot_cpuid) + LOAD_REG_IMMEDIATE(r27, boot_cpuid) add r27,r27,r26 lwz r27,0(r27) - LOADADDR(r24, paca) /* Get base vaddr of paca array */ + LOAD_REG_IMMEDIATE(r24, paca) /* Get base vaddr of paca array */ mulli r13,r27,PACA_SIZE /* Calculate vaddr of right paca */ add r13,r13,r24 /* for this processor. */ add r13,r13,r26 /* convert to physical addr */ @@ -1876,8 +1877,8 @@ _STATIC(start_here_multiplatform) mr r3,r31 bl .early_setup - LOADADDR(r3,.start_here_common) - SET_REG_TO_CONST(r4, MSR_KERNEL) + LOAD_REG_IMMEDIATE(r3, .start_here_common) + LOAD_REG_IMMEDIATE(r4, MSR_KERNEL) mtspr SPRN_SRR0,r3 mtspr SPRN_SRR1,r4 rfid @@ -1891,7 +1892,7 @@ _STATIC(start_here_common) /* The following code sets up the SP and TOC now that we are */ /* running with translation enabled. */ - LOADADDR(r3,init_thread_union) + LOAD_REG_IMMEDIATE(r3,init_thread_union) /* set up the stack */ addi r1,r3,THREAD_SIZE @@ -1904,16 +1905,16 @@ _STATIC(start_here_common) li r3,0 bl .do_cpu_ftr_fixups - LOADADDR(r26, boot_cpuid) + LOAD_REG_IMMEDIATE(r26, boot_cpuid) lwz r26,0(r26) - LOADADDR(r24, paca) /* Get base vaddr of paca array */ + LOAD_REG_IMMEDIATE(r24, paca) /* Get base vaddr of paca array */ mulli r13,r26,PACA_SIZE /* Calculate vaddr of right paca */ add r13,r13,r24 /* for this processor. */ mtspr SPRN_SPRG3,r13 /* ptr to current */ - LOADADDR(r4,init_task) + LOAD_REG_IMMEDIATE(r4, init_task) std r4,PACACURRENT(r13) /* Load the TOC */ @@ -1936,7 +1937,7 @@ _STATIC(start_here_common) _GLOBAL(hmt_init) #ifdef CONFIG_HMT - LOADADDR(r5, hmt_thread_data) + LOAD_REG_IMMEDIATE(r5, hmt_thread_data) mfspr r7,SPRN_PVR srwi r7,r7,16 cmpwi r7,0x34 /* Pulsar */ @@ -1957,7 +1958,7 @@ _GLOBAL(hmt_init) b 101f __hmt_secondary_hold: - LOADADDR(r5, hmt_thread_data) + LOAD_REG_IMMEDIATE(r5, hmt_thread_data) clrldi r5,r5,4 li r7,0 mfspr r6,SPRN_PIR @@ -1985,7 +1986,7 @@ __hmt_secondary_hold: #ifdef CONFIG_HMT _GLOBAL(hmt_start_secondary) - LOADADDR(r4,__hmt_secondary_hold) + LOAD_REG_IMMEDIATE(r4,__hmt_secondary_hold) clrldi r4,r4,4 mtspr SPRN_NIADORM, r4 mfspr r4, SPRN_MSRDORM Index: working-2.6/arch/powerpc/kernel/misc_64.S =================================================================== --- working-2.6.orig/arch/powerpc/kernel/misc_64.S 2005-11-23 15:56:22.000000000 +1100 +++ working-2.6/arch/powerpc/kernel/misc_64.S 2005-12-16 15:51:35.000000000 +1100 @@ -39,7 +39,7 @@ _GLOBAL(reloc_offset) mflr r0 bl 1f 1: mflr r3 - LOADADDR(r4,1b) + LOAD_REG_IMMEDIATE(r4,1b) subf r3,r4,r3 mtlr r0 blr @@ -51,7 +51,7 @@ _GLOBAL(add_reloc_offset) mflr r0 bl 1f 1: mflr r5 - LOADADDR(r4,1b) + LOAD_REG_IMMEDIATE(r4,1b) subf r5,r4,r5 add r3,r3,r5 mtlr r0 @@ -498,15 +498,15 @@ _GLOBAL(identify_cpu) */ _GLOBAL(do_cpu_ftr_fixups) /* Get CPU 0 features */ - LOADADDR(r6,cur_cpu_spec) + LOAD_REG_IMMEDIATE(r6,cur_cpu_spec) sub r6,r6,r3 ld r4,0(r6) sub r4,r4,r3 ld r4,CPU_SPEC_FEATURES(r4) /* Get the fixup table */ - LOADADDR(r6,__start___ftr_fixup) + LOAD_REG_IMMEDIATE(r6,__start___ftr_fixup) sub r6,r6,r3 - LOADADDR(r7,__stop___ftr_fixup) + LOAD_REG_IMMEDIATE(r7,__stop___ftr_fixup) sub r7,r7,r3 /* Do the fixup */ 1: cmpld r6,r7 Index: working-2.6/arch/powerpc/kernel/cpu_setup_power4.S =================================================================== --- working-2.6.orig/arch/powerpc/kernel/cpu_setup_power4.S 2005-11-23 15:56:22.000000000 +1100 +++ working-2.6/arch/powerpc/kernel/cpu_setup_power4.S 2005-12-16 15:51:35.000000000 +1100 @@ -130,7 +130,7 @@ _GLOBAL(__save_cpu_setup) mfcr r7 /* Get storage ptr */ - LOADADDR(r5,cpu_state_storage) + LOAD_REG_IMMEDIATE(r5,cpu_state_storage) /* We only deal with 970 for now */ mfspr r0,SPRN_PVR @@ -164,7 +164,7 @@ _GLOBAL(__restore_cpu_setup) /* Get storage ptr (FIXME when using anton reloc as we * are running with translation disabled here */ - LOADADDR(r5,cpu_state_storage) + LOAD_REG_IMMEDIATE(r5,cpu_state_storage) /* We only deal with 970 for now */ mfspr r0,SPRN_PVR Index: working-2.6/arch/powerpc/kernel/entry_32.S =================================================================== --- working-2.6.orig/arch/powerpc/kernel/entry_32.S 2005-12-16 13:05:21.000000000 +1100 +++ working-2.6/arch/powerpc/kernel/entry_32.S 2005-12-16 15:51:35.000000000 +1100 @@ -988,7 +988,7 @@ _GLOBAL(enter_rtas) stwu r1,-INT_FRAME_SIZE(r1) mflr r0 stw r0,INT_FRAME_SIZE+4(r1) - LOADADDR(r4, rtas) + LOAD_REG_ADDR(r4, rtas) lis r6,1f at ha /* physical return address for rtas */ addi r6,r6,1f at l tophys(r6,r6) Index: working-2.6/arch/powerpc/kernel/misc_32.S =================================================================== --- working-2.6.orig/arch/powerpc/kernel/misc_32.S 2005-12-16 13:05:21.000000000 +1100 +++ working-2.6/arch/powerpc/kernel/misc_32.S 2005-12-16 15:51:35.000000000 +1100 @@ -68,7 +68,7 @@ _GLOBAL(reloc_offset) mflr r0 bl 1f 1: mflr r3 - LOADADDR(r4,1b) + LOAD_REG_IMMEDIATE(r4,1b) subf r3,r4,r3 mtlr r0 blr @@ -80,7 +80,7 @@ _GLOBAL(add_reloc_offset) mflr r0 bl 1f 1: mflr r5 - LOADADDR(r4,1b) + LOAD_REG_IMMEDIATE(r4,1b) subf r5,r4,r5 add r3,r3,r5 mtlr r0 Index: working-2.6/arch/powerpc/kernel/fpu.S =================================================================== --- working-2.6.orig/arch/powerpc/kernel/fpu.S 2005-11-23 15:56:22.000000000 +1100 +++ working-2.6/arch/powerpc/kernel/fpu.S 2005-12-16 15:51:35.000000000 +1100 @@ -39,9 +39,9 @@ _GLOBAL(load_up_fpu) * to another. Instead we call giveup_fpu in switch_to. */ #ifndef CONFIG_SMP - LOADBASE(r3, last_task_used_math) + LOAD_REG_ADDRBASE(r3, last_task_used_math) toreal(r3) - PPC_LL r4,OFF(last_task_used_math)(r3) + PPC_LL r4,ADDROFF(last_task_used_math)(r3) PPC_LCMPI 0,r4,0 beq 1f toreal(r4) @@ -77,7 +77,7 @@ _GLOBAL(load_up_fpu) #ifndef CONFIG_SMP subi r4,r5,THREAD fromreal(r4) - PPC_STL r4,OFF(last_task_used_math)(r3) + PPC_STL r4,ADDROFF(last_task_used_math)(r3) #endif /* CONFIG_SMP */ /* restore registers and return */ /* we haven't used ctr or xer or lr */ @@ -113,8 +113,8 @@ _GLOBAL(giveup_fpu) 1: #ifndef CONFIG_SMP li r5,0 - LOADBASE(r4,last_task_used_math) - PPC_STL r5,OFF(last_task_used_math)(r4) + LOAD_REG_ADDRBASE(r4,last_task_used_math) + PPC_STL r5,ADDROFF(last_task_used_math)(r4) #endif /* CONFIG_SMP */ blr Index: working-2.6/arch/powerpc/kernel/idle_power4.S =================================================================== --- working-2.6.orig/arch/powerpc/kernel/idle_power4.S 2005-11-23 15:56:22.000000000 +1100 +++ working-2.6/arch/powerpc/kernel/idle_power4.S 2005-12-16 15:51:35.000000000 +1100 @@ -38,14 +38,14 @@ END_FTR_SECTION_IFCLR(CPU_FTR_CAN_NAP) /* We must dynamically check for the NAP feature as it * can be cleared by CPU init after the fixups are done */ - LOADBASE(r3,cur_cpu_spec) - ld r4,OFF(cur_cpu_spec)(r3) + LOAD_REG_ADDRBASE(r3,cur_cpu_spec) + ld r4,ADDROFF(cur_cpu_spec)(r3) ld r4,CPU_SPEC_FEATURES(r4) andi. r0,r4,CPU_FTR_CAN_NAP beqlr /* Now check if user or arch enabled NAP mode */ - LOADBASE(r3,powersave_nap) - lwz r4,OFF(powersave_nap)(r3) + LOAD_REG_ADDRBASE(r3,powersave_nap) + lwz r4,ADDROFF(powersave_nap)(r3) cmpwi 0,r4,0 beqlr -- David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson _______________________________________________ Linuxppc64-dev mailing list Linuxppc64-dev at ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc64-dev ----- End forwarded message ----- -- David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson From david at gibson.dropbear.id.au Fri Jan 13 10:26:42 2006 From: david at gibson.dropbear.id.au (David Gibson) Date: Fri, 13 Jan 2006 10:26:42 +1100 Subject: powerpc: Remove lppaca structure from the PACA Message-ID: <20060112232642.GC22961@localhost.localdomain> Paulus, resend for your consideration.. At present the lppaca - the structure shared with the iSeries hypervisor and phyp is contained within the PACA, our own low-level per-cpu structure. This doesn't have to be so, the patch below removes it, making a separate array of lppaca structures. This saves approximately 500*NR_CPUS bytes of image size and kernel memory, because we don't need aligning gap between the Linux and hypervisor portions of every PACA. On the other hand it means an extra level of dereference in many accesses to the lppaca. The patch also gets rid of several places where we assign the paca address to a local variable for no particular reason. Does this seem like a good idea or not? Signed-off-by: David Gibson Index: working-2.6/arch/powerpc/kernel/asm-offsets.c =================================================================== --- working-2.6.orig/arch/powerpc/kernel/asm-offsets.c 2005-12-22 14:26:50.000000000 +1100 +++ working-2.6/arch/powerpc/kernel/asm-offsets.c 2005-12-22 14:37:28.000000000 +1100 @@ -135,7 +135,7 @@ int main(void) DEFINE(PACA_EXMC, offsetof(struct paca_struct, exmc)); DEFINE(PACA_EXSLB, offsetof(struct paca_struct, exslb)); DEFINE(PACAEMERGSP, offsetof(struct paca_struct, emergency_sp)); - DEFINE(PACALPPACA, offsetof(struct paca_struct, lppaca)); + DEFINE(PACALPPACAPTR, offsetof(struct paca_struct, lppaca_ptr)); DEFINE(PACAHWCPUID, offsetof(struct paca_struct, hw_cpu_id)); DEFINE(LPPACASRR0, offsetof(struct lppaca, saved_srr0)); Index: working-2.6/arch/powerpc/kernel/paca.c =================================================================== --- working-2.6.orig/arch/powerpc/kernel/paca.c 2005-12-19 14:18:24.000000000 +1100 +++ working-2.6/arch/powerpc/kernel/paca.c 2005-12-22 14:36:59.000000000 +1100 @@ -25,6 +25,28 @@ * field correctly */ extern unsigned long __toc_start; +/* + * iSeries structure which the hypervisor knows about - this structure + * should not cross a page boundary. The vpa_init/register_vpa call + * is now known to fail if the lppaca structure crosses a page + * boundary. The lppaca is also used on POWER5 pSeries boxes. The + * lppaca is 640 bytes long, and cannot readily change since the + * hypervisor knows its layout, so a 1kB alignment will suffice to + * ensure that it doesn't cross a page boundary. + */ +struct lppaca lppaca[] = { + [0 ... (NR_CPUS-1)] = { + .desc = 0xd397d781, /* "LpPa" */ + .size = sizeof(struct lppaca), + .dyn_proc_status = 2, + .decr_val = 0x00ff0000, + .fpregs_in_use = 1, + .end_of_quantum = 0xfffffffffffffffful, + .slb_count = 64, + .vmxregs_in_use = 0, + }, +}; + /* The Paca is an array with one entry per processor. Each contains an * lppaca, which contains the information shared between the * hypervisor and Linux. @@ -35,27 +57,17 @@ extern unsigned long __toc_start; * processor (not thread). */ #define PACA_INIT_COMMON(number, start, asrr, asrv) \ + .lppaca_ptr = &lppaca[number], \ .lock_token = 0x8000, \ .paca_index = (number), /* Paca Index */ \ .kernel_toc = (unsigned long)(&__toc_start) + 0x8000UL, \ .stab_real = (asrr), /* Real pointer to segment table */ \ .stab_addr = (asrv), /* Virt pointer to segment table */ \ .cpu_start = (start), /* Processor start */ \ - .hw_cpu_id = 0xffff, \ - .lppaca = { \ - .desc = 0xd397d781, /* "LpPa" */ \ - .size = sizeof(struct lppaca), \ - .dyn_proc_status = 2, \ - .decr_val = 0x00ff0000, \ - .fpregs_in_use = 1, \ - .end_of_quantum = 0xfffffffffffffffful, \ - .slb_count = 64, \ - .vmxregs_in_use = 0, \ - }, \ + .hw_cpu_id = 0xffff, #ifdef CONFIG_PPC_ISERIES #define PACA_INIT_ISERIES(number) \ - .lppaca_ptr = &paca[number].lppaca, \ .reg_save_ptr = &iseries_reg_save[number], #define PACA_INIT(number) \ Index: working-2.6/include/asm-powerpc/lppaca.h =================================================================== --- working-2.6.orig/include/asm-powerpc/lppaca.h 2005-12-21 10:59:36.000000000 +1100 +++ working-2.6/include/asm-powerpc/lppaca.h 2005-12-22 14:36:59.000000000 +1100 @@ -29,7 +29,9 @@ //---------------------------------------------------------------------------- #include -struct lppaca { +/* The Hypervisor barfs if the lppaca crosses a page boundary. A 1k + * alignment is sufficient to prevent this */ +struct __attribute__((__aligned__(0x400))) lppaca { //============================================================================= // CACHE_LINE_1 0x0000 - 0x007F Contains read-only data // NOTE: The xDynXyz fields are fields that will be dynamically changed by @@ -129,5 +131,7 @@ struct lppaca { u8 pmc_save_area[256]; // PMC interrupt Area x00-xFF }; +extern struct lppaca lppaca[]; + #endif /* __KERNEL__ */ #endif /* _ASM_POWERPC_LPPACA_H */ Index: working-2.6/include/asm-powerpc/paca.h =================================================================== --- working-2.6.orig/include/asm-powerpc/paca.h 2005-12-21 10:59:36.000000000 +1100 +++ working-2.6/include/asm-powerpc/paca.h 2005-12-22 14:37:28.000000000 +1100 @@ -23,6 +23,7 @@ register struct paca_struct *local_paca asm("r13"); #define get_paca() local_paca +#define get_lppaca() (get_paca()->lppaca_ptr) struct task_struct; @@ -94,19 +95,6 @@ struct paca_struct { u64 saved_r1; /* r1 save for RTAS calls */ u64 saved_msr; /* MSR saved here by enter_rtas */ u8 proc_enabled; /* irq soft-enable flag */ - - /* - * iSeries structure which the hypervisor knows about - - * this structure should not cross a page boundary. - * The vpa_init/register_vpa call is now known to fail if the - * lppaca structure crosses a page boundary. - * The lppaca is also used on POWER5 pSeries boxes. - * The lppaca is 640 bytes long, and cannot readily change - * since the hypervisor knows its layout, so a 1kB - * alignment will suffice to ensure that it doesn't - * cross a page boundary. - */ - struct lppaca lppaca __attribute__((__aligned__(0x400))); }; extern struct paca_struct paca[]; Index: working-2.6/arch/powerpc/platforms/pseries/lpar.c =================================================================== --- working-2.6.orig/arch/powerpc/platforms/pseries/lpar.c 2005-12-19 14:18:25.000000000 +1100 +++ working-2.6/arch/powerpc/platforms/pseries/lpar.c 2005-12-22 14:36:59.000000000 +1100 @@ -254,11 +254,11 @@ out: void vpa_init(int cpu) { int hwcpu = get_hard_smp_processor_id(cpu); - unsigned long vpa = __pa(&paca[cpu].lppaca); + unsigned long vpa = __pa(&lppaca[cpu]); long ret; if (cpu_has_feature(CPU_FTR_ALTIVEC)) - paca[cpu].lppaca.vmxregs_in_use = 1; + lppaca[cpu].vmxregs_in_use = 1; ret = register_vpa(hwcpu, vpa); Index: working-2.6/arch/powerpc/kernel/lparcfg.c =================================================================== --- working-2.6.orig/arch/powerpc/kernel/lparcfg.c 2005-11-23 15:56:22.000000000 +1100 +++ working-2.6/arch/powerpc/kernel/lparcfg.c 2005-12-22 14:36:59.000000000 +1100 @@ -55,15 +55,13 @@ static unsigned long get_purr(void) { unsigned long sum_purr = 0; int cpu; - struct paca_struct *lpaca; for_each_cpu(cpu) { - lpaca = paca + cpu; - sum_purr += lpaca->lppaca.emulated_time_base; + sum_purr += lppaca[cpu].emulated_time_base; #ifdef PURR_DEBUG printk(KERN_INFO "get_purr for cpu (%d) has value (%ld) \n", - cpu, lpaca->lppaca.emulated_time_base); + cpu, lppaca[cpu].emulated_time_base); #endif } return sum_purr; @@ -79,12 +77,11 @@ static int lparcfg_data(struct seq_file unsigned long pool_id, lp_index; int shared, entitled_capacity, max_entitled_capacity; int processors, max_processors; - struct paca_struct *lpaca = get_paca(); unsigned long purr = get_purr(); seq_printf(m, "%s %s \n", MODULE_NAME, MODULE_VERS); - shared = (int)(lpaca->lppaca_ptr->shared_proc); + shared = (int)(get_lppaca()->shared_proc); seq_printf(m, "serial_number=%c%c%c%c%c%c%c\n", e2a(xItExtVpdPanel.mfgID[2]), e2a(xItExtVpdPanel.mfgID[3]), @@ -402,7 +399,7 @@ static int lparcfg_data(struct seq_file (h_resource >> 0 * 8) & 0xffff); /* pool related entries are apropriate for shared configs */ - if (paca[0].lppaca.shared_proc) { + if (lppaca[0].shared_proc) { h_pic(&pool_idle_time, &pool_procs); @@ -451,7 +448,7 @@ static int lparcfg_data(struct seq_file seq_printf(m, "partition_potential_processors=%d\n", partition_potential_processors); - seq_printf(m, "shared_processor_mode=%d\n", paca[0].lppaca.shared_proc); + seq_printf(m, "shared_processor_mode=%d\n", lppaca[0].shared_proc); return 0; } Index: working-2.6/arch/powerpc/platforms/pseries/setup.c =================================================================== --- working-2.6.orig/arch/powerpc/platforms/pseries/setup.c 2005-12-19 14:18:25.000000000 +1100 +++ working-2.6/arch/powerpc/platforms/pseries/setup.c 2005-12-22 14:36:59.000000000 +1100 @@ -192,7 +192,7 @@ static void pseries_lpar_enable_pmcs(voi /* instruct hypervisor to maintain PMCs */ if (firmware_has_feature(FW_FEATURE_SPLPAR)) - get_paca()->lppaca.pmcregs_in_use = 1; + get_lppaca()->pmcregs_in_use = 1; } static void __init pSeries_setup_arch(void) @@ -236,7 +236,7 @@ static void __init pSeries_setup_arch(vo /* Choose an idle loop */ if (firmware_has_feature(FW_FEATURE_SPLPAR)) { vpa_init(boot_cpuid); - if (get_paca()->lppaca.shared_proc) { + if (get_lppaca()->shared_proc) { printk(KERN_INFO "Using shared processor idle loop\n"); ppc_md.idle_loop = pseries_shared_idle; } else { @@ -443,10 +443,10 @@ DECLARE_PER_CPU(unsigned long, smt_snooz static inline void dedicated_idle_sleep(unsigned int cpu) { - struct paca_struct *ppaca = &paca[cpu ^ 1]; + struct lppaca *plppaca = &lppaca[cpu ^ 1]; /* Only sleep if the other thread is not idle */ - if (!(ppaca->lppaca.idle)) { + if (!(plppaca->idle)) { local_irq_disable(); /* @@ -479,7 +479,6 @@ static inline void dedicated_idle_sleep( static void pseries_dedicated_idle(void) { - struct paca_struct *lpaca = get_paca(); unsigned int cpu = smp_processor_id(); unsigned long start_snooze; unsigned long *smt_snooze_delay = &__get_cpu_var(smt_snooze_delay); @@ -490,7 +489,7 @@ static void pseries_dedicated_idle(void) * Indicate to the HV that we are idle. Now would be * a good time to find other work to dispatch. */ - lpaca->lppaca.idle = 1; + get_lppaca()->idle = 1; if (!need_resched()) { start_snooze = get_tb() + @@ -517,7 +516,7 @@ static void pseries_dedicated_idle(void) HMT_medium(); } - lpaca->lppaca.idle = 0; + get_lppaca()->idle = 0; ppc64_runlatch_on(); preempt_enable_no_resched(); @@ -531,7 +530,6 @@ static void pseries_dedicated_idle(void) static void pseries_shared_idle(void) { - struct paca_struct *lpaca = get_paca(); unsigned int cpu = smp_processor_id(); while (1) { @@ -539,7 +537,7 @@ static void pseries_shared_idle(void) * Indicate to the HV that we are idle. Now would be * a good time to find other work to dispatch. */ - lpaca->lppaca.idle = 1; + get_lppaca()->idle = 1; while (!need_resched() && !cpu_is_offline(cpu)) { local_irq_disable(); @@ -563,7 +561,7 @@ static void pseries_shared_idle(void) HMT_medium(); } - lpaca->lppaca.idle = 0; + get_lppaca()->idle = 0; ppc64_runlatch_on(); preempt_enable_no_resched(); @@ -587,7 +585,7 @@ static void pseries_kexec_cpu_down(int c { /* Don't risk a hypervisor call if we're crashing */ if (!crash_shutdown) { - unsigned long vpa = __pa(&get_paca()->lppaca); + unsigned long vpa = __pa(get_lppaca()); if (unregister_vpa(hard_smp_processor_id(), vpa)) { printk("VPA deregistration of cpu %u (hw_cpu_id %d) " Index: working-2.6/arch/powerpc/kernel/entry_64.S =================================================================== --- working-2.6.orig/arch/powerpc/kernel/entry_64.S 2005-12-22 14:26:50.000000000 +1100 +++ working-2.6/arch/powerpc/kernel/entry_64.S 2005-12-22 14:36:59.000000000 +1100 @@ -511,7 +511,8 @@ restore: cmpdi 0,r5,0 beq 4f /* Check for pending interrupts (iSeries) */ - ld r3,PACALPPACA+LPPACAANYINT(r13) + ld r3,PACALPPACAPTR(r13) + ld r3,LPPACAANYINT(r3) cmpdi r3,0 beq+ 4f /* skip do_IRQ if no interrupts */ Index: working-2.6/arch/powerpc/kernel/head_64.S =================================================================== --- working-2.6.orig/arch/powerpc/kernel/head_64.S 2005-12-22 14:26:50.000000000 +1100 +++ working-2.6/arch/powerpc/kernel/head_64.S 2005-12-22 14:36:59.000000000 +1100 @@ -255,8 +255,9 @@ exception_marker: #define EXCEPTION_PROLOG_ISERIES_2 \ mfmsr r10; \ - ld r11,PACALPPACA+LPPACASRR0(r13); \ - ld r12,PACALPPACA+LPPACASRR1(r13); \ + ld r12,PACALPPACAPTR(r13); \ + ld r11,LPPACASRR0(r12); \ + ld r12,LPPACASRR1(r12); \ ori r10,r10,MSR_RI; \ mtmsrd r10,1 @@ -635,7 +636,8 @@ data_access_slb_iSeries: std r12,PACA_EXSLB+EX_R12(r13) mfspr r10,SPRN_SPRG1 std r10,PACA_EXSLB+EX_R13(r13) - ld r12,PACALPPACA+LPPACASRR1(r13); + ld r12,PACALPPACAPTR(r13) + ld r12,LPPACASRR1(r12) b .slb_miss_realmode STD_EXCEPTION_ISERIES(0x400, instruction_access, PACA_EXGEN) @@ -645,7 +647,8 @@ instruction_access_slb_iSeries: mtspr SPRN_SPRG1,r13 /* save r13 */ mfspr r13,SPRN_SPRG3 /* get paca address into r13 */ std r3,PACA_EXSLB+EX_R3(r13) - ld r3,PACALPPACA+LPPACASRR0(r13) /* get SRR0 value */ + ld r3,PACALPPACAPTR(r13) + ld r3,LPPACASRR0(r3) /* get SRR0 value */ std r9,PACA_EXSLB+EX_R9(r13) mfcr r9 #ifdef __DISABLED__ @@ -657,7 +660,8 @@ instruction_access_slb_iSeries: std r12,PACA_EXSLB+EX_R12(r13) mfspr r10,SPRN_SPRG1 std r10,PACA_EXSLB+EX_R13(r13) - ld r12,PACALPPACA+LPPACASRR1(r13); + ld r12,PACALPPACAPTR(r13) + ld r12,LPPACASRR1(r12) b .slb_miss_realmode #ifdef __DISABLED__ @@ -746,7 +750,8 @@ iSeries_secondary_smp_loop: .globl decrementer_iSeries_masked decrementer_iSeries_masked: li r11,1 - stb r11,PACALPPACA+LPPACADECRINT(r13) + ld r12,PACALPPACAPTR(r13) + stb r11,LPPACADECRINT(r12) LOAD_REG_ADDRBASE(r12,tb_ticks_per_jiffy) lwz r12,ADDROFF(tb_ticks_per_jiffy)(r12) mtspr SPRN_DEC,r12 @@ -755,8 +760,9 @@ decrementer_iSeries_masked: .globl hardware_interrupt_iSeries_masked hardware_interrupt_iSeries_masked: mtcrf 0x80,r9 /* Restore regs */ - ld r11,PACALPPACA+LPPACASRR0(r13) - ld r12,PACALPPACA+LPPACASRR1(r13) + ld r12,PACALPPACAPTR(r13) + ld r11,LPPACASRR0(r12) + ld r12,LPPACASRR1(r12) mtspr SPRN_SRR0,r11 mtspr SPRN_SRR1,r12 ld r9,PACA_EXGEN+EX_R9(r13) @@ -995,7 +1001,8 @@ _GLOBAL(slb_miss_realmode) ld r3,PACA_EXSLB+EX_R3(r13) lwz r9,PACA_EXSLB+EX_CCR(r13) /* get saved CR */ #ifdef CONFIG_PPC_ISERIES - ld r11,PACALPPACA+LPPACASRR0(r13) /* get SRR0 value */ + ld r11,PACALPPACAPTR(r13) + ld r11,LPPACASRR0(r11) /* get SRR0 value */ #endif /* CONFIG_PPC_ISERIES */ mtlr r10 Index: working-2.6/arch/powerpc/kernel/irq.c =================================================================== --- working-2.6.orig/arch/powerpc/kernel/irq.c 2005-12-19 14:18:24.000000000 +1100 +++ working-2.6/arch/powerpc/kernel/irq.c 2005-12-22 14:36:59.000000000 +1100 @@ -238,14 +238,10 @@ void do_IRQ(struct pt_regs *regs) irq_exit(); #ifdef CONFIG_PPC_ISERIES - { - struct paca_struct *lpaca = get_paca(); - - if (lpaca->lppaca.int_dword.fields.decr_int) { - lpaca->lppaca.int_dword.fields.decr_int = 0; - /* Signal a fake decrementer interrupt */ - timer_interrupt(regs); - } + if (get_lppaca()->int_dword.fields.decr_int) { + get_lppaca()->int_dword.fields.decr_int = 0; + /* Signal a fake decrementer interrupt */ + timer_interrupt(regs); } #endif } Index: working-2.6/arch/powerpc/kernel/time.c =================================================================== --- working-2.6.orig/arch/powerpc/kernel/time.c 2005-12-19 14:18:24.000000000 +1100 +++ working-2.6/arch/powerpc/kernel/time.c 2005-12-22 14:36:59.000000000 +1100 @@ -431,7 +431,7 @@ void timer_interrupt(struct pt_regs * re profile_tick(CPU_PROFILING, regs); #ifdef CONFIG_PPC_ISERIES - get_paca()->lppaca.int_dword.fields.decr_int = 0; + get_lppaca()->int_dword.fields.decr_int = 0; #endif while ((ticks = tb_ticks_since(per_cpu(last_jiffy, cpu))) Index: working-2.6/arch/powerpc/lib/locks.c =================================================================== --- working-2.6.orig/arch/powerpc/lib/locks.c 2005-11-23 15:56:22.000000000 +1100 +++ working-2.6/arch/powerpc/lib/locks.c 2005-12-22 14:36:59.000000000 +1100 @@ -28,15 +28,13 @@ void __spin_yield(raw_spinlock_t *lock) { unsigned int lock_value, holder_cpu, yield_count; - struct paca_struct *holder_paca; lock_value = lock->slock; if (lock_value == 0) return; holder_cpu = lock_value & 0xffff; BUG_ON(holder_cpu >= NR_CPUS); - holder_paca = &paca[holder_cpu]; - yield_count = holder_paca->lppaca.yield_count; + yield_count = lppaca[holder_cpu].yield_count; if ((yield_count & 1) == 0) return; /* virtual cpu is currently running */ rmb(); @@ -60,15 +58,13 @@ void __rw_yield(raw_rwlock_t *rw) { int lock_value; unsigned int holder_cpu, yield_count; - struct paca_struct *holder_paca; lock_value = rw->lock; if (lock_value >= 0) return; /* no write lock at present */ holder_cpu = lock_value & 0xffff; BUG_ON(holder_cpu >= NR_CPUS); - holder_paca = &paca[holder_cpu]; - yield_count = holder_paca->lppaca.yield_count; + yield_count = lppaca[holder_cpu].yield_count; if ((yield_count & 1) == 0) return; /* virtual cpu is currently running */ rmb(); Index: working-2.6/arch/powerpc/platforms/iseries/irq.c =================================================================== --- working-2.6.orig/arch/powerpc/platforms/iseries/irq.c 2005-12-19 14:18:24.000000000 +1100 +++ working-2.6/arch/powerpc/platforms/iseries/irq.c 2005-12-22 14:36:59.000000000 +1100 @@ -339,14 +339,12 @@ int __init iSeries_allocate_IRQ(HvBusNum */ int iSeries_get_irq(struct pt_regs *regs) { - struct paca_struct *lpaca; /* -2 means ignore this interrupt */ int irq = -2; - lpaca = get_paca(); #ifdef CONFIG_SMP - if (lpaca->lppaca.int_dword.fields.ipi_cnt) { - lpaca->lppaca.int_dword.fields.ipi_cnt = 0; + if (get_lppaca()->int_dword.fields.ipi_cnt) { + get_lppaca()->int_dword.fields.ipi_cnt = 0; iSeries_smp_message_recv(regs); } #endif /* CONFIG_SMP */ Index: working-2.6/arch/powerpc/platforms/iseries/setup.c =================================================================== --- working-2.6.orig/arch/powerpc/platforms/iseries/setup.c 2005-12-19 14:18:24.000000000 +1100 +++ working-2.6/arch/powerpc/platforms/iseries/setup.c 2005-12-22 14:36:59.000000000 +1100 @@ -547,7 +547,7 @@ static unsigned long __init build_iSerie */ static void __init iSeries_setup_arch(void) { - if (get_paca()->lppaca.shared_proc) { + if (get_lppaca()->shared_proc) { ppc_md.idle_loop = iseries_shared_idle; printk(KERN_INFO "Using shared processor idle loop\n"); } else { @@ -656,7 +656,7 @@ static void yield_shared_processor(void) * The decrementer stops during the yield. Force a fake decrementer * here and let the timer_interrupt code sort out the actual time. */ - get_paca()->lppaca.int_dword.fields.decr_int = 1; + get_lppaca()->int_dword.fields.decr_int = 1; process_iSeries_events(); } @@ -883,7 +883,7 @@ void dt_cpus(struct iseries_flat_dt *dt) dt_prop_u32(dt, "#size-cells", 0); for (i = 0; i < NR_CPUS; i++) { - if (paca[i].lppaca.dyn_proc_status >= 2) + if (lppaca[i].dyn_proc_status >= 2) continue; snprintf(p, 32 - (p - buf), "@%d", i); @@ -891,7 +891,7 @@ void dt_cpus(struct iseries_flat_dt *dt) dt_prop_str(dt, "device_type", "cpu"); - index = paca[i].lppaca.dyn_hv_phys_proc_index; + index = lppaca[i].dyn_hv_phys_proc_index; d = &xIoHriProcessorVpd[index]; dt_prop_u32(dt, "i-cache-size", d->xInstCacheSize * 1024); Index: working-2.6/arch/powerpc/platforms/iseries/smp.c =================================================================== --- working-2.6.orig/arch/powerpc/platforms/iseries/smp.c 2005-11-23 15:56:22.000000000 +1100 +++ working-2.6/arch/powerpc/platforms/iseries/smp.c 2005-12-22 14:36:59.000000000 +1100 @@ -91,7 +91,7 @@ static void smp_iSeries_kick_cpu(int nr) BUG_ON((nr < 0) || (nr >= NR_CPUS)); /* Verify that our partition has a processor nr */ - if (paca[nr].lppaca.dyn_proc_status >= 2) + if (lppaca[nr].dyn_proc_status >= 2) return; /* The processor is currently spinning, waiting Index: working-2.6/include/asm-powerpc/spinlock.h =================================================================== --- working-2.6.orig/include/asm-powerpc/spinlock.h 2005-12-21 10:59:36.000000000 +1100 +++ working-2.6/include/asm-powerpc/spinlock.h 2005-12-22 14:36:59.000000000 +1100 @@ -80,7 +80,7 @@ static int __inline__ __raw_spin_trylock #if defined(CONFIG_PPC_SPLPAR) || defined(CONFIG_PPC_ISERIES) /* We only yield to the hypervisor if we are in shared processor mode */ -#define SHARED_PROCESSOR (get_paca()->lppaca.shared_proc) +#define SHARED_PROCESSOR (get_lppaca()->shared_proc) extern void __spin_yield(raw_spinlock_t *lock); extern void __rw_yield(raw_rwlock_t *lock); #else /* SPLPAR || ISERIES */ Index: working-2.6/include/asm-powerpc/time.h =================================================================== --- working-2.6.orig/include/asm-powerpc/time.h 2005-11-23 15:56:36.000000000 +1100 +++ working-2.6/include/asm-powerpc/time.h 2005-12-22 14:36:59.000000000 +1100 @@ -175,11 +175,10 @@ static inline void set_dec(int val) set_dec_cpu6(val); #else #ifdef CONFIG_PPC_ISERIES - struct paca_struct *lpaca = get_paca(); int cur_dec; - if (lpaca->lppaca.shared_proc) { - lpaca->lppaca.virtual_decr = val; + if (get_lppaca()->shared_proc) { + get_lppaca()->virtual_decr = val; cur_dec = get_dec(); if (cur_dec > val) HvCall_setVirtualDecr(); Index: working-2.6/arch/powerpc/platforms/iseries/misc.S =================================================================== --- working-2.6.orig/arch/powerpc/platforms/iseries/misc.S 2005-11-23 15:56:22.000000000 +1100 +++ working-2.6/arch/powerpc/platforms/iseries/misc.S 2005-12-22 14:36:59.000000000 +1100 @@ -44,7 +44,8 @@ _GLOBAL(local_irq_restore) /* Check pending interrupts */ /* A decrementer, IPI or PMC interrupt may have occurred * while we were in the hypervisor (which enables) */ - ld r4,PACALPPACA+LPPACAANYINT(r13) + ld r4,PACALPPACAPTR(r13) + ld r4,LPPACAANYINT(r4) cmpdi r4,0 beqlr -- David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson From trini at kernel.crashing.org Fri Jan 13 10:55:58 2006 From: trini at kernel.crashing.org (Tom Rini) Date: Thu, 12 Jan 2006 16:55:58 -0700 Subject: [PATCH powerpc.git] Better use defaultimage- Message-ID: <20060112235557.GK27215@smtp.west.cox.net> [ Please disregard the patch to make zImage & uImage the default, Paul has NAK'd this on IRC ] The following reworks how defaultimage- is used. We default to zImage here and then override it on platforms that need something more (uImage in the future) or less (vmlinux on iSeries). Signed-off-by: Tom Rini diff --git a/arch/powerpc/Makefile b/arch/powerpc/Makefile index 5f80e58..cb6e3ca 100644 --- a/arch/powerpc/Makefile +++ b/arch/powerpc/Makefile @@ -140,8 +140,8 @@ drivers-$(CONFIG_CPM2) += arch/ppc/8260 drivers-$(CONFIG_OPROFILE) += arch/powerpc/oprofile/ -defaultimage-$(CONFIG_PPC32) := zImage +# Default to zImage, override when needed +defaultimage-y := zImage defaultimage-$(CONFIG_PPC_ISERIES) := vmlinux -defaultimage-$(CONFIG_PPC_PSERIES) := zImage KBUILD_IMAGE := $(defaultimage-y) all: $(KBUILD_IMAGE) -- Tom Rini http://gate.crashing.org/~trini/ From linas at austin.ibm.com Fri Jan 13 11:08:10 2006 From: linas at austin.ibm.com (linas) Date: Thu, 12 Jan 2006 18:08:10 -0600 Subject: [PATCH]: ppc64: Rename routines to make it clear they're arch-specific. Message-ID: <20060113000810.GW26221@austin.ibm.com> [PATCH]: ppc64: Rename routines to make it clear they're arch-specific. This patch renames two routines, unmap_bus_range() and remap_bus_range(), to make it clear that the are associated with the architecture, rather than being interpreted as generic bus or geeric pci routines. Signed-off-by: Linas Vepstas Index: linux-2.6.15-git8/arch/powerpc/kernel/pci_64.c =================================================================== --- linux-2.6.15-git8.orig/arch/powerpc/kernel/pci_64.c 2006-01-12 16:21:14.578944328 -0600 +++ linux-2.6.15-git8/arch/powerpc/kernel/pci_64.c 2006-01-12 16:21:29.024919529 -0600 @@ -1173,7 +1173,7 @@ return 0; } -int unmap_bus_range(struct pci_bus *bus) +int pcibios_unmap_bus_range(struct pci_bus *bus) { unsigned long start_phys; unsigned long start_virt; @@ -1191,9 +1191,9 @@ return 0; } -EXPORT_SYMBOL(unmap_bus_range); +EXPORT_SYMBOL_GPL(pcibios_unmap_bus_range); -int remap_bus_range(struct pci_bus *bus) +int pcibios_remap_bus_range(struct pci_bus *bus) { unsigned long start_phys; unsigned long start_virt; @@ -1216,14 +1216,14 @@ return 0; } -EXPORT_SYMBOL(remap_bus_range); +EXPORT_SYMBOL_GPL(pcibios_remap_bus_range); void phbs_remap_io(void) { struct pci_controller *hose, *tmp; list_for_each_entry_safe(hose, tmp, &hose_list, list_node) - remap_bus_range(hose->bus); + pcibios_remap_bus_range(hose->bus); } static void __devinit fixup_resource(struct resource *res, struct pci_dev *dev) Index: linux-2.6.15-git8/arch/powerpc/kernel/rtas_pci.c =================================================================== --- linux-2.6.15-git8.orig/arch/powerpc/kernel/rtas_pci.c 2006-01-12 16:21:14.578944328 -0600 +++ linux-2.6.15-git8/arch/powerpc/kernel/rtas_pci.c 2006-01-12 16:21:29.024919529 -0600 @@ -394,7 +394,7 @@ return 1; } - rc = unmap_bus_range(b); + rc = pcibios_unmap_bus_range(b); if (rc) { printk(KERN_ERR "%s: failed to unmap IO on bus %s\n", __FUNCTION__, b->name); Index: linux-2.6.15-git8/drivers/pci/hotplug/rpadlpar_core.c =================================================================== --- linux-2.6.15-git8.orig/drivers/pci/hotplug/rpadlpar_core.c 2006-01-12 16:21:25.543407514 -0600 +++ linux-2.6.15-git8/drivers/pci/hotplug/rpadlpar_core.c 2006-01-12 16:21:29.024919529 -0600 @@ -152,7 +152,7 @@ pcibios_claim_one_bus(dev->bus); /* ioremap() for child bus, which may or may not succeed */ - remap_bus_range(dev->subordinate); + pcibios_remap_bus_range(dev->subordinate); /* Add new devices to global lists. Register in proc, sysfs. */ pci_bus_add_devices(phb->bus); @@ -383,7 +383,7 @@ rpaphp_unconfig_pci_adapter(bus); } - if (unmap_bus_range(bus)) { + if (pcibios_unmap_bus_range(bus)) { printk(KERN_ERR "%s: failed to unmap bus range\n", __FUNCTION__); return -ERANGE; Index: linux-2.6.15-git8/include/asm-powerpc/pci.h =================================================================== --- linux-2.6.15-git8.orig/include/asm-powerpc/pci.h 2006-01-12 16:21:14.578944328 -0600 +++ linux-2.6.15-git8/include/asm-powerpc/pci.h 2006-01-12 16:21:29.025919389 -0600 @@ -209,9 +209,9 @@ return root; } -extern int unmap_bus_range(struct pci_bus *bus); +extern int pcibios_unmap_bus_range(struct pci_bus *bus); -extern int remap_bus_range(struct pci_bus *bus); +extern int pcibios_remap_bus_range(struct pci_bus *bus); extern void pcibios_fixup_device_resources(struct pci_dev *dev, struct pci_bus *bus); From linas at austin.ibm.com Fri Jan 13 11:15:56 2006 From: linas at austin.ibm.com (linas) Date: Thu, 12 Jan 2006 18:15:56 -0600 Subject: [PATCH 0/9] PCI powerpc hotplug/dlpar: remove dead/stale code Message-ID: <20060113001556.GX26221@austin.ibm.com> The following series of patches remove a fair amount of duplicated code fro the drivers/pci/hotplug/rpa*.c tree. They've been tested at length, on one machine. Please apply. --linas From linas at austin.ibm.com Fri Jan 13 11:18:26 2006 From: linas at austin.ibm.com (linas) Date: Thu, 12 Jan 2006 18:18:26 -0600 Subject: [PATCH 1/9] powerpc/PCI hotplug: remove rpaphp_find_bus() In-Reply-To: <20060113001556.GX26221@austin.ibm.com> References: <20060113001556.GX26221@austin.ibm.com> Message-ID: <20060113001826.GY26221@austin.ibm.com> The function rpaphp_find_pci_bus() has been migrated to pcibios_find_pci_bus() in arch/powerpc/platforms/pseries/pci_dlpar.c This patch removes the old version. Signed-off-by: Linas Vepstas Index: linux-2.6.15-git8/drivers/pci/hotplug/rpaphp_pci.c =================================================================== --- linux-2.6.15-git8.orig/drivers/pci/hotplug/rpaphp_pci.c 2006-01-12 16:21:13.482098065 -0600 +++ linux-2.6.15-git8/drivers/pci/hotplug/rpaphp_pci.c 2006-01-12 16:21:33.586280184 -0600 @@ -32,36 +32,6 @@ #include "../pci.h" /* for pci_add_new_bus */ #include "rpaphp.h" -static struct pci_bus *find_bus_among_children(struct pci_bus *bus, - struct device_node *dn) -{ - struct pci_bus *child = NULL; - struct list_head *tmp; - struct device_node *busdn; - - busdn = pci_bus_to_OF_node(bus); - if (busdn == dn) - return bus; - - list_for_each(tmp, &bus->children) { - child = find_bus_among_children(pci_bus_b(tmp), dn); - if (child) - break; - } - return child; -} - -struct pci_bus *rpaphp_find_pci_bus(struct device_node *dn) -{ - struct pci_dn *pdn = dn->data; - - if (!pdn || !pdn->phb || !pdn->phb->bus) - return NULL; - - return find_bus_among_children(pdn->phb->bus, dn); -} -EXPORT_SYMBOL_GPL(rpaphp_find_pci_bus); - static int rpaphp_get_sensor_state(struct slot *slot, int *state) { int rc; @@ -120,7 +90,7 @@ /* config/unconfig adapter */ *value = slot->state; } else { - bus = rpaphp_find_pci_bus(slot->dn); + bus = pcibios_find_pci_bus(slot->dn); if (bus && !list_empty(&bus->devices)) *value = CONFIGURED; else @@ -370,7 +340,7 @@ struct pci_bus *bus; BUG_ON(!dn); - bus = rpaphp_find_pci_bus(dn); + bus = pcibios_find_pci_bus(dn); if (!bus) { err("%s: no pci_bus for dn %s\n", __FUNCTION__, dn->full_name); goto exit_rc; Index: linux-2.6.15-git8/drivers/pci/hotplug/rpadlpar_core.c =================================================================== --- linux-2.6.15-git8.orig/drivers/pci/hotplug/rpadlpar_core.c 2006-01-12 16:21:29.024919529 -0600 +++ linux-2.6.15-git8/drivers/pci/hotplug/rpadlpar_core.c 2006-01-12 16:21:33.586280184 -0600 @@ -174,7 +174,7 @@ { struct pci_dev *dev; - if (rpaphp_find_pci_bus(dn)) + if (pcibios_find_pci_bus(dn)) return -EINVAL; /* Add pci bus */ @@ -221,7 +221,7 @@ struct pci_dn *pdn; int rc = 0; - if (!rpaphp_find_pci_bus(dn)) + if (!pcibios_find_pci_bus(dn)) return -EINVAL; slot = find_slot(dn); @@ -366,7 +366,7 @@ struct pci_bus *bus; struct slot *slot; - bus = rpaphp_find_pci_bus(dn); + bus = pcibios_find_pci_bus(dn); if (!bus) return -EINVAL; Index: linux-2.6.15-git8/drivers/pci/hotplug/rpaphp.h =================================================================== --- linux-2.6.15-git8.orig/drivers/pci/hotplug/rpaphp.h 2006-01-12 16:21:13.482098065 -0600 +++ linux-2.6.15-git8/drivers/pci/hotplug/rpaphp.h 2006-01-12 16:21:33.586280184 -0600 @@ -88,13 +88,10 @@ /* function prototypes */ /* rpaphp_pci.c */ -extern struct pci_bus *rpaphp_find_pci_bus(struct device_node *dn); -extern int rpaphp_claim_resource(struct pci_dev *dev, int resource); extern int rpaphp_enable_pci_slot(struct slot *slot); extern int register_pci_slot(struct slot *slot); extern int rpaphp_get_pci_adapter_status(struct slot *slot, int is_init, u8 * value); extern void rpaphp_init_new_devs(struct pci_bus *bus); -extern void rpaphp_eeh_init_nodes(struct device_node *dn); extern int rpaphp_config_pci_adapter(struct pci_bus *bus); extern int rpaphp_unconfig_pci_adapter(struct pci_bus *bus); From linas at austin.ibm.com Fri Jan 13 11:20:26 2006 From: linas at austin.ibm.com (linas) Date: Thu, 12 Jan 2006 18:20:26 -0600 Subject: [PATCH 2/9] powerpc/PCI hotplug: remove rpaphp_fixup_new_pci_devices() In-Reply-To: <20060113001556.GX26221@austin.ibm.com> References: <20060113001556.GX26221@austin.ibm.com> Message-ID: <20060113002026.GZ26221@austin.ibm.com> The function rpaphp_fixup_new_pci_devices() has been migrated to pcibios_fixup_new_pci_devices() in arch/powerpc/platforms/pseries/pci_dlpar.c This patch removes the old version. Signed-off-by: Linas Vepstas Index: linux-2.6.15-git8/drivers/pci/hotplug/rpaphp_pci.c =================================================================== --- linux-2.6.15-git8.orig/drivers/pci/hotplug/rpaphp_pci.c 2006-01-12 16:21:33.586280184 -0600 +++ linux-2.6.15-git8/drivers/pci/hotplug/rpaphp_pci.c 2006-01-12 16:21:35.837964574 -0600 @@ -101,140 +101,6 @@ return rc; } -/* Must be called before pci_bus_add_devices */ -void rpaphp_fixup_new_pci_devices(struct pci_bus *bus, int fix_bus) -{ - struct pci_dev *dev; - - list_for_each_entry(dev, &bus->devices, bus_list) { - /* - * Skip already-present devices (which are on the - * global device list.) - */ - if (list_empty(&dev->global_list)) { - int i; - - /* Need to setup IOMMU tables */ - ppc_md.iommu_dev_setup(dev); - - if(fix_bus) - pcibios_fixup_device_resources(dev, bus); - pci_read_irq_line(dev); - for (i = 0; i < PCI_NUM_RESOURCES; i++) { - struct resource *r = &dev->resource[i]; - - if (r->parent || !r->start || !r->flags) - continue; - pci_claim_resource(dev, i); - } - } - } -} - -static void rpaphp_eeh_add_bus_device(struct pci_bus *bus) -{ - struct pci_dev *dev; - - list_for_each_entry(dev, &bus->devices, bus_list) { - eeh_add_device_late(dev); - if (dev->hdr_type == PCI_HEADER_TYPE_BRIDGE) { - struct pci_bus *subbus = dev->subordinate; - if (subbus) - rpaphp_eeh_add_bus_device (subbus); - } - } -} - -static int rpaphp_pci_config_bridge(struct pci_dev *dev) -{ - u8 sec_busno; - struct pci_bus *child_bus; - struct pci_dev *child_dev; - - dbg("Enter %s: BRIDGE dev=%s\n", __FUNCTION__, pci_name(dev)); - - /* get busno of downstream bus */ - pci_read_config_byte(dev, PCI_SECONDARY_BUS, &sec_busno); - - /* add to children of PCI bridge dev->bus */ - child_bus = pci_add_new_bus(dev->bus, dev, sec_busno); - if (!child_bus) { - err("%s: could not add second bus\n", __FUNCTION__); - return -EIO; - } - sprintf(child_bus->name, "PCI Bus #%02x", child_bus->number); - /* do pci_scan_child_bus */ - pci_scan_child_bus(child_bus); - - list_for_each_entry(child_dev, &child_bus->devices, bus_list) { - eeh_add_device_late(child_dev); - } - - /* fixup new pci devices without touching bus struct */ - rpaphp_fixup_new_pci_devices(child_bus, 0); - - /* Make the discovered devices available */ - pci_bus_add_devices(child_bus); - return 0; -} - -void rpaphp_init_new_devs(struct pci_bus *bus) -{ - rpaphp_fixup_new_pci_devices(bus, 0); - rpaphp_eeh_add_bus_device(bus); -} -EXPORT_SYMBOL_GPL(rpaphp_init_new_devs); - -/***************************************************************************** - rpaphp_pci_config_slot() will configure all devices under the - given slot->dn and return the the first pci_dev. - *****************************************************************************/ -static struct pci_dev * -rpaphp_pci_config_slot(struct pci_bus *bus) -{ - struct device_node *dn = pci_bus_to_OF_node(bus); - struct pci_dev *dev = NULL; - int slotno; - int num; - - dbg("Enter %s: dn=%s bus=%s\n", __FUNCTION__, dn->full_name, bus->name); - if (!dn || !dn->child) - return NULL; - - if (_machine == PLATFORM_PSERIES_LPAR) { - of_scan_bus(dn, bus); - if (list_empty(&bus->devices)) { - err("%s: No new device found\n", __FUNCTION__); - return NULL; - } - - rpaphp_init_new_devs(bus); - pci_bus_add_devices(bus); - dev = list_entry(&bus->devices, struct pci_dev, bus_list); - } else { - slotno = PCI_SLOT(PCI_DN(dn->child)->devfn); - - /* pci_scan_slot should find all children */ - num = pci_scan_slot(bus, PCI_DEVFN(slotno, 0)); - if (num) { - rpaphp_fixup_new_pci_devices(bus, 1); - pci_bus_add_devices(bus); - } - if (list_empty(&bus->devices)) { - err("%s: No new device found\n", __FUNCTION__); - return NULL; - } - list_for_each_entry(dev, &bus->devices, bus_list) { - if (dev->hdr_type == PCI_HEADER_TYPE_BRIDGE) - rpaphp_pci_config_bridge(dev); - - rpaphp_eeh_add_bus_device(bus); - } - } - - return dev; -} - static void print_slot_pci_funcs(struct pci_bus *bus) { struct device_node *dn; @@ -253,19 +119,13 @@ int rpaphp_config_pci_adapter(struct pci_bus *bus) { struct device_node *dn = pci_bus_to_OF_node(bus); - struct pci_dev *dev; int rc = -ENODEV; dbg("Entry %s: slot[%s]\n", __FUNCTION__, dn->full_name); if (!dn) goto exit; - eeh_add_device_tree_early(dn); - dev = rpaphp_pci_config_slot(bus); - if (!dev) { - err("%s: can't find any devices.\n", __FUNCTION__); - goto exit; - } + pcibios_add_pci_devices(bus); print_slot_pci_funcs(bus); rc = 0; exit: Index: linux-2.6.15-git8/drivers/pci/hotplug/rpadlpar_core.c =================================================================== --- linux-2.6.15-git8.orig/drivers/pci/hotplug/rpadlpar_core.c 2006-01-12 16:21:33.586280184 -0600 +++ linux-2.6.15-git8/drivers/pci/hotplug/rpadlpar_core.c 2006-01-12 16:21:35.838964434 -0600 @@ -146,7 +146,7 @@ dev->hdr_type == PCI_HEADER_TYPE_CARDBUS) of_scan_pci_bridge(dn, dev); - rpaphp_init_new_devs(dev->subordinate); + pcibios_fixup_new_pci_devices(dev->subordinate,0); /* Claim new bus resources */ pcibios_claim_one_bus(dev->bus); Index: linux-2.6.15-git8/drivers/pci/hotplug/rpaphp.h =================================================================== --- linux-2.6.15-git8.orig/drivers/pci/hotplug/rpaphp.h 2006-01-12 16:21:33.586280184 -0600 +++ linux-2.6.15-git8/drivers/pci/hotplug/rpaphp.h 2006-01-12 16:21:35.838964434 -0600 @@ -91,7 +91,6 @@ extern int rpaphp_enable_pci_slot(struct slot *slot); extern int register_pci_slot(struct slot *slot); extern int rpaphp_get_pci_adapter_status(struct slot *slot, int is_init, u8 * value); -extern void rpaphp_init_new_devs(struct pci_bus *bus); extern int rpaphp_config_pci_adapter(struct pci_bus *bus); extern int rpaphp_unconfig_pci_adapter(struct pci_bus *bus); From linas at austin.ibm.com Fri Jan 13 11:22:07 2006 From: linas at austin.ibm.com (linas) Date: Thu, 12 Jan 2006 18:22:07 -0600 Subject: [PATCH 3/9] powerpc/PCI hotplug: merge config_pci_adapter In-Reply-To: <20060113001556.GX26221@austin.ibm.com> References: <20060113001556.GX26221@austin.ibm.com> Message-ID: <20060113002206.GA26221@austin.ibm.com> Remove general baroqueness. The function rpaphp_config_pci_adapter() is really just one line of code, once all the dbg printks are removed. And its called in only one place. So replace the call by the one line. Signed-off-by: Linas Vepstas Index: linux-2.6.15-git8/drivers/pci/hotplug/rpaphp_pci.c =================================================================== --- linux-2.6.15-git8.orig/drivers/pci/hotplug/rpaphp_pci.c 2006-01-12 16:21:35.837964574 -0600 +++ linux-2.6.15-git8/drivers/pci/hotplug/rpaphp_pci.c 2006-01-12 16:21:37.582720017 -0600 @@ -116,24 +116,6 @@ return; } -int rpaphp_config_pci_adapter(struct pci_bus *bus) -{ - struct device_node *dn = pci_bus_to_OF_node(bus); - int rc = -ENODEV; - - dbg("Entry %s: slot[%s]\n", __FUNCTION__, dn->full_name); - if (!dn) - goto exit; - - pcibios_add_pci_devices(bus); - print_slot_pci_funcs(bus); - rc = 0; -exit: - dbg("Exit %s: rc=%d\n", __FUNCTION__, rc); - return rc; -} -EXPORT_SYMBOL_GPL(rpaphp_config_pci_adapter); - static void rpaphp_eeh_remove_bus_device(struct pci_dev *dev) { eeh_remove_device(dev); @@ -225,11 +207,8 @@ if (slot->hotplug_slot->info->adapter_status == NOT_CONFIGURED) { dbg("%s CONFIGURING pci adapter in slot[%s]\n", __FUNCTION__, slot->name); - if (rpaphp_config_pci_adapter(slot->bus)) { - err("%s: CONFIG pci adapter failed\n", __FUNCTION__); - goto exit_rc; - } - + pcibios_add_pci_devices(slot->bus); + } else if (slot->hotplug_slot->info->adapter_status != CONFIGURED) { err("%s: slot[%s]'s adapter_status is NOT_VALID.\n", __FUNCTION__, slot->name); @@ -274,16 +253,10 @@ /* if slot is not empty, enable the adapter */ if (state == PRESENT) { dbg("%s : slot[%s] is occupied.\n", __FUNCTION__, slot->name); - retval = rpaphp_config_pci_adapter(slot->bus); - if (!retval) { - slot->state = CONFIGURED; - info("%s: devices in slot[%s] configured\n", + pcibios_add_pci_devices(slot->bus); + slot->state = CONFIGURED; + info("%s: devices in slot[%s] configured\n", __FUNCTION__, slot->name); - } else { - slot->state = NOT_CONFIGURED; - dbg("%s: no pci_dev struct for adapter in slot[%s]\n", - __FUNCTION__, slot->name); - } } else if (state == EMPTY) { dbg("%s : slot[%s] is empty\n", __FUNCTION__, slot->name); slot->state = EMPTY; Index: linux-2.6.15-git8/drivers/pci/hotplug/rpaphp.h =================================================================== --- linux-2.6.15-git8.orig/drivers/pci/hotplug/rpaphp.h 2006-01-12 16:21:35.838964434 -0600 +++ linux-2.6.15-git8/drivers/pci/hotplug/rpaphp.h 2006-01-12 16:21:37.582720017 -0600 @@ -92,7 +92,6 @@ extern int register_pci_slot(struct slot *slot); extern int rpaphp_get_pci_adapter_status(struct slot *slot, int is_init, u8 * value); -extern int rpaphp_config_pci_adapter(struct pci_bus *bus); extern int rpaphp_unconfig_pci_adapter(struct pci_bus *bus); /* rpaphp_core.c */ From linas at austin.ibm.com Fri Jan 13 11:24:27 2006 From: linas at austin.ibm.com (linas) Date: Thu, 12 Jan 2006 18:24:27 -0600 Subject: [PATCH 4/9] powerpc/PCI hotplug: remove remove_bus_device() In-Reply-To: <20060113001556.GX26221@austin.ibm.com> References: <20060113001556.GX26221@austin.ibm.com> Message-ID: <20060113002427.GB26221@austin.ibm.com> The function rpaphp_eeh_remove_bus_device() is a dupe of eeh_remove_bus_device(). Remove it. Signed-off-by: Linas Vepstas Index: linux-2.6.15-git8/drivers/pci/hotplug/rpaphp_pci.c =================================================================== --- linux-2.6.15-git8.orig/drivers/pci/hotplug/rpaphp_pci.c 2006-01-12 16:21:37.582720017 -0600 +++ linux-2.6.15-git8/drivers/pci/hotplug/rpaphp_pci.c 2006-01-12 16:21:39.573440984 -0600 @@ -116,30 +116,12 @@ return; } -static void rpaphp_eeh_remove_bus_device(struct pci_dev *dev) -{ - eeh_remove_device(dev); - if (dev->hdr_type == PCI_HEADER_TYPE_BRIDGE) { - struct pci_bus *bus = dev->subordinate; - struct list_head *ln; - if (!bus) - return; - for (ln = bus->devices.next; ln != &bus->devices; ln = ln->next) { - struct pci_dev *pdev = pci_dev_b(ln); - if (pdev) - rpaphp_eeh_remove_bus_device(pdev); - } - - } - return; -} - int rpaphp_unconfig_pci_adapter(struct pci_bus *bus) { struct pci_dev *dev, *tmp; list_for_each_entry_safe(dev, tmp, &bus->devices, bus_list) { - rpaphp_eeh_remove_bus_device(dev); + eeh_remove_bus_device(dev); pci_remove_bus_device(dev); } return 0; From linas at austin.ibm.com Fri Jan 13 11:26:27 2006 From: linas at austin.ibm.com (linas) Date: Thu, 12 Jan 2006 18:26:27 -0600 Subject: [PATCH 5/9] powerpc/PCI hotplug: de-convolute rpaphp_unconfig_pci_adap In-Reply-To: <20060113001556.GX26221@austin.ibm.com> References: <20060113001556.GX26221@austin.ibm.com> Message-ID: <20060113002627.GC26221@austin.ibm.com> Remove general baroqueness. The function rpaphp_unconfig_pci_adapter() is really just three lines of code, once all the dbg printks are removed. And its called in only one place. So replace the call by the thre lines. Also, provide proper semaphore locking in the affected function disable_slot() Signed-off-by: Linas Vepstas Index: linux-2.6.15-git8/drivers/pci/hotplug/rpadlpar_core.c =================================================================== --- linux-2.6.15-git8.orig/drivers/pci/hotplug/rpadlpar_core.c 2006-01-12 16:21:35.838964434 -0600 +++ linux-2.6.15-git8/drivers/pci/hotplug/rpadlpar_core.c 2006-01-12 16:21:41.013239172 -0600 @@ -380,7 +380,11 @@ return -EIO; } } else { - rpaphp_unconfig_pci_adapter(bus); + struct pci_dev *dev, *tmp; + list_for_each_entry_safe(dev, tmp, &bus->devices, bus_list) { + eeh_remove_bus_device(dev); + pci_remove_bus_device(dev); + } } if (pcibios_unmap_bus_range(bus)) { Index: linux-2.6.15-git8/drivers/pci/hotplug/rpaphp_core.c =================================================================== --- linux-2.6.15-git8.orig/drivers/pci/hotplug/rpaphp_core.c 2006-01-12 16:18:04.896526749 -0600 +++ linux-2.6.15-git8/drivers/pci/hotplug/rpaphp_core.c 2006-01-12 16:21:41.014239031 -0600 @@ -412,27 +412,31 @@ return retval; } -static int disable_slot(struct hotplug_slot *hotplug_slot) +static int __disable_slot(struct slot *slot) { - int retval = -EINVAL; - struct slot *slot = (struct slot *)hotplug_slot->private; + struct pci_dev *dev, *tmp; - dbg("%s - Entry: slot[%s]\n", __FUNCTION__, slot->name); + if (slot->state == NOT_CONFIGURED) + return -EINVAL; - if (slot->state == NOT_CONFIGURED) { - dbg("%s: %s is already disabled\n", __FUNCTION__, slot->name); - goto exit; + list_for_each_entry_safe(dev, tmp, &slot->bus->devices, bus_list) { + eeh_remove_bus_device(dev); + pci_remove_bus_device(dev); } + + slot->state = NOT_CONFIGURED; + return 0; +} + +static int disable_slot(struct hotplug_slot *hotplug_slot) +{ + struct slot *slot = (struct slot *)hotplug_slot->private; + int retval; - dbg("DISABLING SLOT %s\n", slot->name); down(&rpaphp_sem); - retval = rpaphp_unconfig_pci_adapter(slot->bus); + retval = __disable_slot (slot); up(&rpaphp_sem); - slot->state = NOT_CONFIGURED; - info("%s: devices in slot[%s] unconfigured.\n", __FUNCTION__, - slot->name); -exit: - dbg("%s - Exit: rc[%d]\n", __FUNCTION__, retval); + return retval; } Index: linux-2.6.15-git8/drivers/pci/hotplug/rpaphp_pci.c =================================================================== --- linux-2.6.15-git8.orig/drivers/pci/hotplug/rpaphp_pci.c 2006-01-12 16:21:39.573440984 -0600 +++ linux-2.6.15-git8/drivers/pci/hotplug/rpaphp_pci.c 2006-01-12 16:21:41.014239031 -0600 @@ -116,18 +116,6 @@ return; } -int rpaphp_unconfig_pci_adapter(struct pci_bus *bus) -{ - struct pci_dev *dev, *tmp; - - list_for_each_entry_safe(dev, tmp, &bus->devices, bus_list) { - eeh_remove_bus_device(dev); - pci_remove_bus_device(dev); - } - return 0; -} -EXPORT_SYMBOL_GPL(rpaphp_unconfig_pci_adapter); - static int setup_pci_hotplug_slot_info(struct slot *slot) { struct hotplug_slot_info *hotplug_slot_info = slot->hotplug_slot->info; Index: linux-2.6.15-git8/drivers/pci/hotplug/rpaphp.h =================================================================== --- linux-2.6.15-git8.orig/drivers/pci/hotplug/rpaphp.h 2006-01-12 16:21:37.582720017 -0600 +++ linux-2.6.15-git8/drivers/pci/hotplug/rpaphp.h 2006-01-12 16:21:41.014239031 -0600 @@ -92,8 +92,6 @@ extern int register_pci_slot(struct slot *slot); extern int rpaphp_get_pci_adapter_status(struct slot *slot, int is_init, u8 * value); -extern int rpaphp_unconfig_pci_adapter(struct pci_bus *bus); - /* rpaphp_core.c */ extern int rpaphp_add_slot(struct device_node *dn); extern int rpaphp_remove_slot(struct slot *slot); From michael at ellerman.id.au Fri Jan 13 11:26:55 2006 From: michael at ellerman.id.au (Michael Ellerman) Date: Fri, 13 Jan 2006 11:26:55 +1100 Subject: [PATCH 1/4] powerpc: Add firmware_set_feature() In-Reply-To: <200601121441.15535.arnd@arndb.de> References: <1137046198.56732.289003998582.qpush@concordia> <200601121810.39142.michael@ellerman.id.au> <200601121441.15535.arnd@arndb.de> Message-ID: <200601131126.58341.michael@ellerman.id.au> On Fri, 13 Jan 2006 01:41, Arnd Bergmann wrote: > On Thursday 12 January 2006 07:10, Michael Ellerman wrote: > > I think we should definitely mask, we don't want to end up with > > imPOSSIBLE features being turned on. BUG_ON might be appropriate, it > > would at least catch people who forget to add features to the POSSIBLE > > map - is there any way to cause it to fail at build time though? > > There is BUILD_BUG_ON() that should do exactly that. Except it doesn't work :( We could do some ugly hack to cause a link error, but that's gross. Seeing as Paulus doesn't like it, and he's the man with the keys to the git tree, I think I'll just can the patch. cheers -- Michael Ellerman IBM OzLabs email: michael:ellerman.id.au inmsg: mpe:jabber.org wwweb: http://michael.ellerman.id.au phone: +61 2 6212 1183 (tie line 70 21183) We do not inherit the earth from our ancestors, we borrow it from our children. - S.M.A.R.T Person -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 185 bytes Desc: not available Url : http://ozlabs.org/pipermail/linuxppc64-dev/attachments/20060113/fe66b201/attachment.pgp From linas at austin.ibm.com Fri Jan 13 11:28:22 2006 From: linas at austin.ibm.com (linas) Date: Thu, 12 Jan 2006 18:28:22 -0600 Subject: [PATCH 6/9] powerpc/PCI hotplug: merge rpaphp_enable_pci_slot() In-Reply-To: <20060113001556.GX26221@austin.ibm.com> References: <20060113001556.GX26221@austin.ibm.com> Message-ID: <20060113002822.GD26221@austin.ibm.com> Remove general baroqueness. The function rpaphp_enable_pci_slot() has a fairly simple logic structure, once all of the debug printk's are removed. Its called from only one place, and that place also has a very simple structure once he printk's are removed. Merge the two together. Signed-off-by: Linas Vepstas Index: linux-2.6.15-git8/drivers/pci/hotplug/rpaphp_core.c =================================================================== --- linux-2.6.15-git8.orig/drivers/pci/hotplug/rpaphp_core.c 2006-01-12 16:21:41.014239031 -0600 +++ linux-2.6.15-git8/drivers/pci/hotplug/rpaphp_core.c 2006-01-12 16:21:42.742996715 -0600 @@ -393,22 +393,40 @@ cleanup_slots(); } -static int enable_slot(struct hotplug_slot *hotplug_slot) +static int __enable_slot(struct slot *slot) { - int retval = 0; - struct slot *slot = (struct slot *)hotplug_slot->private; + int state; + int retval; + + if (slot->state == CONFIGURED) + return 0; - if (slot->state == CONFIGURED) { - dbg("%s: %s is already enabled\n", __FUNCTION__, slot->name); - goto exit; + retval = rpaphp_get_sensor_state(slot, &state); + if (retval) + return retval; + + if (state == PRESENT) { + pcibios_add_pci_devices(slot->bus); + slot->state = CONFIGURED; + } else if (state == EMPTY) { + slot->state = EMPTY; + } else { + err("%s: slot[%s] is in invalid state\n", __FUNCTION__, slot->name); + slot->state = NOT_VALID; + return -EINVAL; } + return 0; +} + +static int enable_slot(struct hotplug_slot *hotplug_slot) +{ + int retval; + struct slot *slot = (struct slot *)hotplug_slot->private; - dbg("ENABLING SLOT %s\n", slot->name); down(&rpaphp_sem); - retval = rpaphp_enable_pci_slot(slot); + retval = __enable_slot(slot); up(&rpaphp_sem); -exit: - dbg("%s - Exit: rc[%d]\n", __FUNCTION__, retval); + return retval; } Index: linux-2.6.15-git8/drivers/pci/hotplug/rpaphp_pci.c =================================================================== --- linux-2.6.15-git8.orig/drivers/pci/hotplug/rpaphp_pci.c 2006-01-12 16:21:41.014239031 -0600 +++ linux-2.6.15-git8/drivers/pci/hotplug/rpaphp_pci.c 2006-01-12 16:21:42.742996715 -0600 @@ -32,7 +32,7 @@ #include "../pci.h" /* for pci_add_new_bus */ #include "rpaphp.h" -static int rpaphp_get_sensor_state(struct slot *slot, int *state) +int rpaphp_get_sensor_state(struct slot *slot, int *state) { int rc; int setlevel; @@ -212,31 +212,3 @@ return rc; } -int rpaphp_enable_pci_slot(struct slot *slot) -{ - int retval = 0, state; - - retval = rpaphp_get_sensor_state(slot, &state); - if (retval) - goto exit; - dbg("%s: sensor state[%d]\n", __FUNCTION__, state); - /* if slot is not empty, enable the adapter */ - if (state == PRESENT) { - dbg("%s : slot[%s] is occupied.\n", __FUNCTION__, slot->name); - pcibios_add_pci_devices(slot->bus); - slot->state = CONFIGURED; - info("%s: devices in slot[%s] configured\n", - __FUNCTION__, slot->name); - } else if (state == EMPTY) { - dbg("%s : slot[%s] is empty\n", __FUNCTION__, slot->name); - slot->state = EMPTY; - } else { - err("%s: slot[%s] is in invalid state\n", __FUNCTION__, - slot->name); - slot->state = NOT_VALID; - retval = -EINVAL; - } -exit: - dbg("%s - Exit: rc[%d]\n", __FUNCTION__, retval); - return retval; -} Index: linux-2.6.15-git8/drivers/pci/hotplug/rpaphp.h =================================================================== --- linux-2.6.15-git8.orig/drivers/pci/hotplug/rpaphp.h 2006-01-12 16:21:41.014239031 -0600 +++ linux-2.6.15-git8/drivers/pci/hotplug/rpaphp.h 2006-01-12 16:21:42.743996575 -0600 @@ -91,6 +91,7 @@ extern int rpaphp_enable_pci_slot(struct slot *slot); extern int register_pci_slot(struct slot *slot); extern int rpaphp_get_pci_adapter_status(struct slot *slot, int is_init, u8 * value); +extern int rpaphp_get_sensor_state(struct slot *slot, int *state); /* rpaphp_core.c */ extern int rpaphp_add_slot(struct device_node *dn); From linas at austin.ibm.com Fri Jan 13 11:31:01 2006 From: linas at austin.ibm.com (linas) Date: Thu, 12 Jan 2006 18:31:01 -0600 Subject: [PATCH 7/9] powerpc/PCI hotplug: cleanup: add prefix In-Reply-To: <20060113001556.GX26221@austin.ibm.com> References: <20060113001556.GX26221@austin.ibm.com> Message-ID: <20060113003101.GE26221@austin.ibm.com> Minor cleanup. Add the prefix rpaphp_* to several generic-sounding routines. Remove rpaphp_remove_slot(), which is a one-liner. Signed-off-by: Linas Vepstas Index: linux-2.6.15-git8/drivers/pci/hotplug/rpaphp_core.c =================================================================== --- linux-2.6.15-git8.orig/drivers/pci/hotplug/rpaphp_core.c 2006-01-12 16:21:42.742996715 -0600 +++ linux-2.6.15-git8/drivers/pci/hotplug/rpaphp_core.c 2006-01-12 16:21:44.953686848 -0600 @@ -196,11 +196,6 @@ return 0; } -int rpaphp_remove_slot(struct slot *slot) -{ - return deregister_slot(slot); -} - static int get_children_props(struct device_node *dn, int **drc_indexes, int **drc_names, int **drc_types, int **drc_power_domains) { @@ -307,13 +302,15 @@ return 0; } -/**************************************************************** +/** + * rpaphp_add_slot -- add hotplug or dlpar slot + * * rpaphp not only registers PCI hotplug slots(HOTPLUG), * but also logical DR slots(EMBEDDED). * HOTPLUG slot: An adapter can be physically added/removed. * EMBEDDED slot: An adapter can be logically removed/added * from/to a partition with the slot. - ***************************************************************/ + */ int rpaphp_add_slot(struct device_node *dn) { struct slot *slot; @@ -344,7 +341,7 @@ dbg("Found drc-index:0x%x drc-name:%s drc-type:%s\n", indexes[i + 1], name, type); - retval = register_pci_slot(slot); + retval = rpaphp_register_pci_slot(slot); } } exit: @@ -462,6 +459,5 @@ module_exit(rpaphp_exit); EXPORT_SYMBOL_GPL(rpaphp_add_slot); -EXPORT_SYMBOL_GPL(rpaphp_remove_slot); EXPORT_SYMBOL_GPL(rpaphp_slot_head); EXPORT_SYMBOL_GPL(rpaphp_get_drc_props); Index: linux-2.6.15-git8/drivers/pci/hotplug/rpaphp_pci.c =================================================================== --- linux-2.6.15-git8.orig/drivers/pci/hotplug/rpaphp_pci.c 2006-01-12 16:21:42.742996715 -0600 +++ linux-2.6.15-git8/drivers/pci/hotplug/rpaphp_pci.c 2006-01-12 16:21:44.953686848 -0600 @@ -199,7 +199,7 @@ return -EINVAL; } -int register_pci_slot(struct slot *slot) +int rpaphp_register_pci_slot(struct slot *slot) { int rc = -EINVAL; @@ -207,7 +207,7 @@ goto exit_rc; if (setup_pci_slot(slot)) goto exit_rc; - rc = register_slot(slot); + rc = rpaphp_register_slot(slot); exit_rc: return rc; } Index: linux-2.6.15-git8/drivers/pci/hotplug/rpadlpar_core.c =================================================================== --- linux-2.6.15-git8.orig/drivers/pci/hotplug/rpadlpar_core.c 2006-01-12 16:21:41.013239172 -0600 +++ linux-2.6.15-git8/drivers/pci/hotplug/rpadlpar_core.c 2006-01-12 16:21:44.954686707 -0600 @@ -227,7 +227,7 @@ slot = find_slot(dn); if (slot) { /* Remove hotplug slot */ - if (rpaphp_remove_slot(slot)) { + if (rpaphp_deregister_slot(slot)) { printk(KERN_ERR "%s: unable to remove hotplug slot %s\n", __FUNCTION__, drc_name); @@ -373,7 +373,7 @@ slot = find_slot(dn); if (slot) { /* Remove hotplug slot */ - if (rpaphp_remove_slot(slot)) { + if (rpaphp_deregister_slot(slot)) { printk(KERN_ERR "%s: unable to remove hotplug slot %s\n", __FUNCTION__, drc_name); Index: linux-2.6.15-git8/drivers/pci/hotplug/rpaphp_slot.c =================================================================== --- linux-2.6.15-git8.orig/drivers/pci/hotplug/rpaphp_slot.c 2006-01-12 16:18:03.922663207 -0600 +++ linux-2.6.15-git8/drivers/pci/hotplug/rpaphp_slot.c 2006-01-12 16:21:44.954686707 -0600 @@ -35,16 +35,16 @@ static ssize_t location_read_file (struct hotplug_slot *php_slot, char *buf) { - char *value; - int retval = -ENOENT; + char *value; + int retval = -ENOENT; struct slot *slot = (struct slot *)php_slot->private; if (!slot) return retval; - value = slot->location; - retval = sprintf (buf, "%s\n", value); - return retval; + value = slot->location; + retval = sprintf (buf, "%s\n", value); + return retval; } static struct hotplug_slot_attribute hotplug_slot_attr_location = { @@ -137,7 +137,7 @@ return 0; } -int deregister_slot(struct slot *slot) +int rpaphp_deregister_slot(struct slot *slot) { int retval = 0; struct hotplug_slot *php_slot = slot->hotplug_slot; @@ -160,7 +160,7 @@ return retval; } -int register_slot(struct slot *slot) +int rpaphp_register_slot(struct slot *slot) { int retval; @@ -169,7 +169,7 @@ slot->power_domain, slot->type); /* should not try to register the same slot twice */ if (is_registered(slot)) { /* should't be here */ - err("register_slot: slot[%s] is already registered\n", slot->name); + err("rpaphp_register_slot: slot[%s] is already registered\n", slot->name); rpaphp_release_slot(slot->hotplug_slot); return -EAGAIN; } Index: linux-2.6.15-git8/drivers/pci/hotplug/rpaphp.h =================================================================== --- linux-2.6.15-git8.orig/drivers/pci/hotplug/rpaphp.h 2006-01-12 16:21:42.743996575 -0600 +++ linux-2.6.15-git8/drivers/pci/hotplug/rpaphp.h 2006-01-12 16:21:44.954686707 -0600 @@ -89,7 +89,7 @@ /* rpaphp_pci.c */ extern int rpaphp_enable_pci_slot(struct slot *slot); -extern int register_pci_slot(struct slot *slot); +extern int rpaphp_register_pci_slot(struct slot *slot); extern int rpaphp_get_pci_adapter_status(struct slot *slot, int is_init, u8 * value); extern int rpaphp_get_sensor_state(struct slot *slot, int *state); @@ -102,8 +102,8 @@ /* rpaphp_slot.c */ extern void dealloc_slot_struct(struct slot *slot); extern struct slot *alloc_slot_struct(struct device_node *dn, int drc_index, char *drc_name, int power_domain); -extern int register_slot(struct slot *slot); -extern int deregister_slot(struct slot *slot); +extern int rpaphp_register_slot(struct slot *slot); +extern int rpaphp_deregister_slot(struct slot *slot); extern int rpaphp_get_power_status(struct slot *slot, u8 * value); extern int rpaphp_set_attention_status(struct slot *slot, u8 status); From linas at austin.ibm.com Fri Jan 13 11:32:58 2006 From: linas at austin.ibm.com (linas) Date: Thu, 12 Jan 2006 18:32:58 -0600 Subject: [PATCH 8/9] powerpc/PCI hotplug: minor cleanup forward decls In-Reply-To: <20060113001556.GX26221@austin.ibm.com> References: <20060113001556.GX26221@austin.ibm.com> Message-ID: <20060113003258.GF26221@austin.ibm.com> Minor cleanup. Move structure initializer to bottom of file, this allows elimination of eyeball-strain-inducing forward declarations. Signed-off-by: Linas Vepstas Index: linux-2.6.15-git8/drivers/pci/hotplug/rpaphp_core.c =================================================================== --- linux-2.6.15-git8.orig/drivers/pci/hotplug/rpaphp_core.c 2006-01-12 16:21:44.953686848 -0600 +++ linux-2.6.15-git8/drivers/pci/hotplug/rpaphp_core.c 2006-01-12 16:21:46.832423508 -0600 @@ -56,25 +56,6 @@ module_param(debug, bool, 0644); -static int enable_slot(struct hotplug_slot *slot); -static int disable_slot(struct hotplug_slot *slot); -static int set_attention_status(struct hotplug_slot *slot, u8 value); -static int get_power_status(struct hotplug_slot *slot, u8 * value); -static int get_attention_status(struct hotplug_slot *slot, u8 * value); -static int get_adapter_status(struct hotplug_slot *slot, u8 * value); -static int get_max_bus_speed(struct hotplug_slot *hotplug_slot, enum pci_bus_speed *value); - -struct hotplug_slot_ops rpaphp_hotplug_slot_ops = { - .owner = THIS_MODULE, - .enable_slot = enable_slot, - .disable_slot = disable_slot, - .set_attention_status = set_attention_status, - .get_power_status = get_power_status, - .get_attention_status = get_attention_status, - .get_adapter_status = get_adapter_status, - .get_max_bus_speed = get_max_bus_speed, -}; - static int rpaphp_get_attention_status(struct slot *slot) { return slot->hotplug_slot->info->attention_status; @@ -455,6 +436,17 @@ return retval; } +struct hotplug_slot_ops rpaphp_hotplug_slot_ops = { + .owner = THIS_MODULE, + .enable_slot = enable_slot, + .disable_slot = disable_slot, + .set_attention_status = set_attention_status, + .get_power_status = get_power_status, + .get_attention_status = get_attention_status, + .get_adapter_status = get_adapter_status, + .get_max_bus_speed = get_max_bus_speed, +}; + module_init(rpaphp_init); module_exit(rpaphp_exit); From linas at austin.ibm.com Fri Jan 13 11:35:23 2006 From: linas at austin.ibm.com (linas) Date: Thu, 12 Jan 2006 18:35:23 -0600 Subject: [PATCH 9/9] powerpc/PCI hotplug: shuffle error checking to better location. In-Reply-To: <20060113001556.GX26221@austin.ibm.com> References: <20060113001556.GX26221@austin.ibm.com> Message-ID: <20060113003523.GG26221@austin.ibm.com> Error checking is scattered through various layers of the dlpar code, leading to a somewhat opaque code structure. This patch consolidates error checking in one routine, simplifying the code a tad. There's also some whitespace cleanup here too. Signed-off-by: Linas Vepstas Index: linux-2.6.15-git8/drivers/pci/hotplug/rpadlpar_core.c =================================================================== --- linux-2.6.15-git8.orig/drivers/pci/hotplug/rpadlpar_core.c 2006-01-12 16:21:44.954686707 -0600 +++ linux-2.6.15-git8/drivers/pci/hotplug/rpadlpar_core.c 2006-01-12 16:21:49.479053107 -0600 @@ -103,13 +103,13 @@ struct list_head *tmp, *n; struct slot *slot; - list_for_each_safe(tmp, n, &rpaphp_slot_head) { - slot = list_entry(tmp, struct slot, rpaphp_slot_list); - if (slot->dn == dn) - return slot; - } + list_for_each_safe(tmp, n, &rpaphp_slot_head) { + slot = list_entry(tmp, struct slot, rpaphp_slot_list); + if (slot->dn == dn) + return slot; + } - return NULL; + return NULL; } static struct pci_dev *dlpar_find_new_dev(struct pci_bus *parent, @@ -126,9 +126,9 @@ return NULL; } -static struct pci_dev *dlpar_pci_add_bus(struct device_node *dn) +static void dlpar_pci_add_bus(struct device_node *dn) { - struct pci_dn *pdn = dn->data; + struct pci_dn *pdn = PCI_DN(dn); struct pci_controller *phb = pdn->phb; struct pci_dev *dev = NULL; @@ -139,7 +139,7 @@ if (!dev) { printk(KERN_ERR "%s: failed to create pci dev for %s\n", __FUNCTION__, dn->full_name); - return NULL; + return; } if (dev->hdr_type == PCI_HEADER_TYPE_BRIDGE || @@ -156,34 +156,34 @@ /* Add new devices to global lists. Register in proc, sysfs. */ pci_bus_add_devices(phb->bus); - - /* Confirm new bridge dev was created */ - dev = dlpar_find_new_dev(phb->bus, dn); - if (dev) { - if (dev->hdr_type != PCI_HEADER_TYPE_BRIDGE) { - printk(KERN_ERR "%s: unexpected header type %d\n", - __FUNCTION__, dev->hdr_type); - return NULL; - } - } - - return dev; } static int dlpar_add_pci_slot(char *drc_name, struct device_node *dn) { struct pci_dev *dev; + struct pci_controller *phb; if (pcibios_find_pci_bus(dn)) return -EINVAL; /* Add pci bus */ - dev = dlpar_pci_add_bus(dn); + dlpar_pci_add_bus(dn); + + /* Confirm new bridge dev was created */ + phb = PCI_DN(dn)->phb; + dev = dlpar_find_new_dev(phb->bus, dn); + if (!dev) { printk(KERN_ERR "%s: unable to add bus %s\n", __FUNCTION__, drc_name); return -EIO; } + + if (dev->hdr_type != PCI_HEADER_TYPE_BRIDGE) { + printk(KERN_ERR "%s: unexpected header type %d, unable to add bus %s\n", + __FUNCTION__, dev->hdr_type, drc_name); + return -EIO; + } /* Add hotplug slot */ if (rpaphp_add_slot(dn)) { From sfr at canb.auug.org.au Fri Jan 13 11:44:01 2006 From: sfr at canb.auug.org.au (Stephen Rothwell) Date: Fri, 13 Jan 2006 11:44:01 +1100 Subject: [PATCH] trivial: modify comments to refer to new location of files In-Reply-To: <20060112180240.GB17539@us.ibm.com> References: <20060112180240.GB17539@us.ibm.com> Message-ID: <20060113114401.3289f33f.sfr@canb.auug.org.au> On Thu, 12 Jan 2006 12:02:40 -0600 Jon Mason wrote: > > diff -r 2e15034efcb7 arch/powerpc/kernel/entry_64.S > --- a/arch/powerpc/kernel/entry_64.S Wed Jan 11 16:14:16 2006 > +++ b/arch/powerpc/kernel/entry_64.S Thu Jan 12 08:25:34 2006 > @@ -1,5 +1,5 @@ > /* > - * arch/ppc64/kernel/entry.S > + * arch/powerpc/kernel/entry_64.S Can we just remove these useless self references, please? -- Cheers, Stephen Rothwell sfr at canb.auug.org.au http://www.canb.auug.org.au/~sfr/ -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: not available Url : http://ozlabs.org/pipermail/linuxppc64-dev/attachments/20060113/5159970d/attachment.pgp From johnrose at austin.ibm.com Fri Jan 13 07:45:27 2006 From: johnrose at austin.ibm.com (John Rose) Date: Thu, 12 Jan 2006 14:45:27 -0600 Subject: [PATCH] PCI panic on dlpar add (add pci slot to running partition) In-Reply-To: <20060112203625.GU26221@austin.ibm.com> References: <20060112203625.GU26221@austin.ibm.com> Message-ID: <1137098727.22537.3.camel@sinatra.austin.ibm.com> Acked-by: John Rose From sfr at canb.auug.org.au Fri Jan 13 13:39:29 2006 From: sfr at canb.auug.org.au (Stephen Rothwell) Date: Fri, 13 Jan 2006 13:39:29 +1100 Subject: powerpc: Remove lppaca structure from the PACA In-Reply-To: <20060112232642.GC22961@localhost.localdomain> References: <20060112232642.GC22961@localhost.localdomain> Message-ID: <20060113133929.4873beec.sfr@canb.auug.org.au> On Fri, 13 Jan 2006 10:26:42 +1100 David Gibson wrote: > > Paulus, resend for your consideration.. > > At present the lppaca - the structure shared with the iSeries > hypervisor and phyp is contained within the PACA, our own low-level > per-cpu structure. This doesn't have to be so, the patch below > removes it, making a separate array of lppaca structures. > > This saves approximately 500*NR_CPUS bytes of image size and kernel > memory, because we don't need aligning gap between the Linux and > hypervisor portions of every PACA. On the other hand it means an > extra level of dereference in many accesses to the lppaca. > > The patch also gets rid of several places where we assign the paca > address to a local variable for no particular reason. > > Does this seem like a good idea or not? > > Signed-off-by: David Gibson Acked-by: Stephen Rothwell -- Cheers, Stephen Rothwell sfr at canb.auug.org.au http://www.canb.auug.org.au/~sfr/ -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: not available Url : http://ozlabs.org/pipermail/linuxppc64-dev/attachments/20060113/ea119276/attachment.pgp From paulus at samba.org Fri Jan 13 14:23:25 2006 From: paulus at samba.org (Paul Mackerras) Date: Fri, 13 Jan 2006 14:23:25 +1100 Subject: [PATCH] Increase AT_VECTOR_SIZE Message-ID: <17351.7469.959679.355418@cargo.ozlabs.ibm.com> On PowerPC, we want to be able to provide an AT_PLATFORM aux table entry to userspace, so that glibc can choose optimized libraries for the processor we're running on. Unfortunately that would be the 21st aux table entry on powerpc, meaning that the aux table including the terminating null entry would overflow the mm->saved_auxv[] array, leading to userland programs segfaulting. This increases the size of the mm->saved_auxv array to be large enough to accommodate an AT_PLATFORM entry on powerpc. Signed-off-by: Paul Mackerras --- Linus, can this go in before 2.6.16-rc1 please? I can't see that it will break anything, and the glibc guys are keen to have the AT_PLATFORM value provided by 2.6.16 and later kernels. Thanks, Paul. diff --git a/include/linux/auxvec.h b/include/linux/auxvec.h index 9a7b374..d2bc0d6 100644 --- a/include/linux/auxvec.h +++ b/include/linux/auxvec.h @@ -26,6 +26,6 @@ #define AT_SECURE 23 /* secure mode boolean */ -#define AT_VECTOR_SIZE 42 /* Size of auxiliary table. */ +#define AT_VECTOR_SIZE 44 /* Size of auxiliary table. */ #endif /* _LINUX_AUXVEC_H */ From david at gibson.dropbear.id.au Fri Jan 13 14:56:25 2006 From: david at gibson.dropbear.id.au (David Gibson) Date: Fri, 13 Jan 2006 14:56:25 +1100 Subject: powerpc: Cleanup LOADADDR etc. asm macros In-Reply-To: <20060112232458.GB22961@localhost.localdomain> References: <20060112232458.GB22961@localhost.localdomain> Message-ID: <20060113035625.GG22961@localhost.localdomain> On Fri, Jan 13, 2006 at 10:24:58AM +1100, David Gibson wrote: > Resend. As requested, here's a respin which uses clrldi to convert virtual to real mode addresses around the rtas call, rather than relying on the CPU ignoring the high bits in real mode. This also removes the offests the previous version had against the current tree. powerpc: Cleanup LOADADDR etc. asm macros This patch consolidates the variety of macros used for loading 32 or 64-bit constants in assembler (LOADADDR, LOADBASE, SET_REG_TO_*). The idea is to make the set of macros consistent across 32 and 64 bit and to make it more obvious which is the appropriate one to use in a given situation. The new macros and their semantics are described in the comments in ppc_asm.h. In the process, we change several places that were unnecessarily using immediate loads on ppc64 to use the GOT/TOC. Likewise we cleanup a couple of places where we were clumsily subtracting PAGE_OFFSET with asm instructions to use assemble-time arithmetic or the toreal() macro instead. Signed-off-by: David Gibson Index: working-2.6/include/asm-powerpc/ppc_asm.h =================================================================== --- working-2.6.orig/include/asm-powerpc/ppc_asm.h 2006-01-13 12:07:17.000000000 +1100 +++ working-2.6/include/asm-powerpc/ppc_asm.h 2006-01-13 12:07:19.000000000 +1100 @@ -156,52 +156,56 @@ n: #endif /* - * LOADADDR( rn, name ) - * loads the address of 'name' into 'rn' + * LOAD_REG_IMMEDIATE(rn, expr) + * Loads the value of the constant expression 'expr' into register 'rn' + * using immediate instructions only. Use this when it's important not + * to reference other data (i.e. on ppc64 when the TOC pointer is not + * valid). * - * LOADBASE( rn, name ) - * loads the address (possibly without the low 16 bits) of 'name' into 'rn' - * suitable for base+disp addressing + * LOAD_REG_ADDR(rn, name) + * Loads the address of label 'name' into register 'rn'. Use this when + * you don't particularly need immediate instructions only, but you need + * the whole address in one register (e.g. it's a structure address and + * you want to access various offsets within it). On ppc32 this is + * identical to LOAD_REG_IMMEDIATE. + * + * LOAD_REG_ADDRBASE(rn, name) + * ADDROFF(name) + * LOAD_REG_ADDRBASE loads part of the address of label 'name' into + * register 'rn'. ADDROFF(name) returns the remainder of the address as + * a constant expression. ADDROFF(name) is a signed expression < 16 bits + * in size, so is suitable for use directly as an offset in load and store + * instructions. Use this when loading/storing a single word or less as: + * LOAD_REG_ADDRBASE(rX, name) + * ld rY,ADDROFF(name)(rX) */ #ifdef __powerpc64__ -#define LOADADDR(rn,name) \ - lis rn,name##@highest; \ - ori rn,rn,name##@higher; \ - rldicr rn,rn,32,31; \ - oris rn,rn,name##@h; \ - ori rn,rn,name##@l - -#define LOADBASE(rn,name) \ - ld rn,name at got(r2) - -#define OFF(name) 0 - -#define SET_REG_TO_CONST(reg, value) \ - lis reg,(((value)>>48)&0xFFFF); \ - ori reg,reg,(((value)>>32)&0xFFFF); \ - rldicr reg,reg,32,31; \ - oris reg,reg,(((value)>>16)&0xFFFF); \ - ori reg,reg,((value)&0xFFFF); - -#define SET_REG_TO_LABEL(reg, label) \ - lis reg,(label)@highest; \ - ori reg,reg,(label)@higher; \ - rldicr reg,reg,32,31; \ - oris reg,reg,(label)@h; \ - ori reg,reg,(label)@l; +#define LOAD_REG_IMMEDIATE(reg,expr) \ + lis (reg),(expr)@highest; \ + ori (reg),(reg),(expr)@higher; \ + rldicr (reg),(reg),32,31; \ + oris (reg),(reg),(expr)@h; \ + ori (reg),(reg),(expr)@l; + +#define LOAD_REG_ADDR(reg,name) \ + ld (reg),name at got(r2) + +#define LOAD_REG_ADDRBASE(reg,name) LOAD_REG_ADDR(reg,name) +#define ADDROFF(name) 0 /* offsets for stack frame layout */ #define LRSAVE 16 #else /* 32-bit */ -#define LOADADDR(rn,name) \ - lis rn,name at ha; \ - addi rn,rn,name at l -#define LOADBASE(rn,name) \ - lis rn,name at ha +#define LOAD_REG_IMMEDIATE(reg,expr) \ + lis (reg),(expr)@ha; \ + addi (reg),(reg),(expr)@l; + +#define LOAD_REG_ADDR(reg,name) LOAD_REG_IMMEDIATE(reg, name) -#define OFF(name) name at l +#define LOAD_REG_ADDRBASE(reg, name) lis (reg),name at ha +#define ADDROFF(name) name at l /* offsets for stack frame layout */ #define LRSAVE 4 Index: working-2.6/arch/powerpc/kernel/entry_64.S =================================================================== --- working-2.6.orig/arch/powerpc/kernel/entry_64.S 2006-01-13 12:07:17.000000000 +1100 +++ working-2.6/arch/powerpc/kernel/entry_64.S 2006-01-13 14:54:34.000000000 +1100 @@ -689,9 +689,8 @@ _GLOBAL(enter_rtas) std r6,PACASAVEDMSR(r13) /* Setup our real return addr */ - SET_REG_TO_LABEL(r4,.rtas_return_loc) - SET_REG_TO_CONST(r9,PAGE_OFFSET) - sub r4,r4,r9 + LOAD_REG_ADDR(r4,.rtas_return_loc) + clrldi r4,r4,2 /* convert to realmode address */ mtlr r4 li r0,0 @@ -706,7 +705,7 @@ _GLOBAL(enter_rtas) sync /* disable interrupts so SRR0/1 */ mtmsrd r0 /* don't get trashed */ - SET_REG_TO_LABEL(r4,rtas) + LOAD_REG_ADDR(r4, rtas) ld r5,RTASENTRY(r4) /* get the rtas->entry value */ ld r4,RTASBASE(r4) /* get the rtas->base value */ @@ -718,8 +717,7 @@ _GLOBAL(enter_rtas) _STATIC(rtas_return_loc) /* relocation is off at this point */ mfspr r4,SPRN_SPRG3 /* Get PACA */ - SET_REG_TO_CONST(r5, PAGE_OFFSET) - sub r4,r4,r5 /* RELOC the PACA base pointer */ + clrldi r4,r4,2 /* convert to realmode address */ mfmsr r6 li r0,MSR_RI @@ -728,7 +726,7 @@ _STATIC(rtas_return_loc) mtmsrd r6 ld r1,PACAR1(r4) /* Restore our SP */ - LOADADDR(r3,.rtas_restore_regs) + LOAD_REG_IMMEDIATE(r3,.rtas_restore_regs) ld r4,PACASAVEDMSR(r4) /* Restore our MSR */ mtspr SPRN_SRR0,r3 Index: working-2.6/arch/powerpc/kernel/head_64.S =================================================================== --- working-2.6.orig/arch/powerpc/kernel/head_64.S 2006-01-13 12:07:17.000000000 +1100 +++ working-2.6/arch/powerpc/kernel/head_64.S 2006-01-13 12:07:19.000000000 +1100 @@ -154,12 +154,12 @@ _GLOBAL(__secondary_hold) bne 100b #ifdef CONFIG_HMT - LOADADDR(r4, .hmt_init) + SET_REG_IMMEDIATE(r4, .hmt_init) mtctr r4 bctr #else #ifdef CONFIG_SMP - LOADADDR(r4, .pSeries_secondary_smp_init) + LOAD_REG_IMMEDIATE(r4, .pSeries_secondary_smp_init) mtctr r4 mr r3,r24 bctr @@ -205,9 +205,10 @@ exception_marker: #define EX_LR 72 /* - * We're short on space and time in the exception prolog, so we can't use - * the normal LOADADDR macro. Normally we just need the low halfword of the - * address, but for Kdump we need the whole low word. + * We're short on space and time in the exception prolog, so we can't + * use the normal SET_REG_IMMEDIATE macro. Normally we just need the + * low halfword of the address, but for Kdump we need the whole low + * word. */ #ifdef CONFIG_CRASH_DUMP #define LOAD_HANDLER(reg, label) \ @@ -713,7 +714,7 @@ system_reset_iSeries: lbz r23,PACAPROCSTART(r13) /* Test if this processor * should start */ sync - LOADADDR(r3,current_set) + LOAD_REG_IMMEDIATE(r3,current_set) sldi r28,r24,3 /* get current_set[cpu#] */ ldx r3,r3,r28 addi r1,r3,THREAD_SIZE @@ -746,8 +747,8 @@ iSeries_secondary_smp_loop: decrementer_iSeries_masked: li r11,1 stb r11,PACALPPACA+LPPACADECRINT(r13) - LOADBASE(r12,tb_ticks_per_jiffy) - lwz r12,OFF(tb_ticks_per_jiffy)(r12) + LOAD_REG_ADDRBASE(r12,tb_ticks_per_jiffy) + lwz r12,ADDROFF(tb_ticks_per_jiffy)(r12) mtspr SPRN_DEC,r12 /* fall through */ @@ -1412,7 +1413,7 @@ _GLOBAL(pSeries_secondary_smp_init) * physical cpu id in r24, we need to search the pacas to find * which logical id maps to our physical one. */ - LOADADDR(r13, paca) /* Get base vaddr of paca array */ + LOAD_REG_IMMEDIATE(r13, paca) /* Get base vaddr of paca array */ li r5,0 /* logical cpu id */ 1: lhz r6,PACAHWCPUID(r13) /* Load HW procid from paca */ cmpw r6,r24 /* Compare to our id */ @@ -1446,8 +1447,8 @@ _GLOBAL(pSeries_secondary_smp_init) #ifdef CONFIG_PPC_ISERIES _STATIC(__start_initialization_iSeries) /* Clear out the BSS */ - LOADADDR(r11,__bss_stop) - LOADADDR(r8,__bss_start) + LOAD_REG_IMMEDIATE(r11,__bss_stop) + LOAD_REG_IMMEDIATE(r8,__bss_start) sub r11,r11,r8 /* bss size */ addi r11,r11,7 /* round up to an even double word */ rldicl. r11,r11,61,3 /* shift right by 3 */ @@ -1458,17 +1459,17 @@ _STATIC(__start_initialization_iSeries) 3: stdu r0,8(r8) bdnz 3b 4: - LOADADDR(r1,init_thread_union) + LOAD_REG_IMMEDIATE(r1,init_thread_union) addi r1,r1,THREAD_SIZE li r0,0 stdu r0,-STACK_FRAME_OVERHEAD(r1) - LOADADDR(r3,cpu_specs) - LOADADDR(r4,cur_cpu_spec) + LOAD_REG_IMMEDIATE(r3,cpu_specs) + LOAD_REG_IMMEDIATE(r4,cur_cpu_spec) li r5,0 bl .identify_cpu - LOADADDR(r2,__toc_start) + LOAD_REG_IMMEDIATE(r2,__toc_start) addi r2,r2,0x4000 addi r2,r2,0x4000 @@ -1528,7 +1529,7 @@ _GLOBAL(__start_initialization_multiplat li r24,0 /* Switch off MMU if not already */ - LOADADDR(r4, .__after_prom_start - KERNELBASE) + LOAD_REG_IMMEDIATE(r4, .__after_prom_start - KERNELBASE) add r4,r4,r30 bl .__mmu_off b .__after_prom_start @@ -1548,7 +1549,7 @@ _STATIC(__boot_from_prom) /* put a relocation offset into r3 */ bl .reloc_offset - LOADADDR(r2,__toc_start) + LOAD_REG_IMMEDIATE(r2,__toc_start) addi r2,r2,0x4000 addi r2,r2,0x4000 @@ -1588,9 +1589,9 @@ _STATIC(__after_prom_start) */ bl .reloc_offset mr r26,r3 - SET_REG_TO_CONST(r27,KERNELBASE) + LOAD_REG_IMMEDIATE(r27, KERNELBASE) - LOADADDR(r3, PHYSICAL_START) /* target addr */ + LOAD_REG_IMMEDIATE(r3, PHYSICAL_START) /* target addr */ // XXX FIXME: Use phys returned by OF (r30) add r4,r27,r26 /* source addr */ @@ -1598,7 +1599,7 @@ _STATIC(__after_prom_start) /* i.e. where we are running */ /* the source addr */ - LOADADDR(r5,copy_to_here) /* # bytes of memory to copy */ + LOAD_REG_IMMEDIATE(r5,copy_to_here) /* # bytes of memory to copy */ sub r5,r5,r27 li r6,0x100 /* Start offset, the first 0x100 */ @@ -1608,11 +1609,11 @@ _STATIC(__after_prom_start) /* this includes the code being */ /* executed here. */ - LOADADDR(r0, 4f) /* Jump to the copy of this code */ + LOAD_REG_IMMEDIATE(r0, 4f) /* Jump to the copy of this code */ mtctr r0 /* that we just made/relocated */ bctr -4: LOADADDR(r5,klimit) +4: LOAD_REG_IMMEDIATE(r5,klimit) add r5,r5,r26 ld r5,0(r5) /* get the value of klimit */ sub r5,r5,r27 @@ -1694,7 +1695,7 @@ _GLOBAL(pmac_secondary_start) mtmsrd r3 /* RI on */ /* Set up a paca value for this processor. */ - LOADADDR(r4, paca) /* Get base vaddr of paca array */ + LOAD_REG_IMMEDIATE(r4, paca) /* Get base vaddr of paca array */ mulli r13,r24,PACA_SIZE /* Calculate vaddr of right paca */ add r13,r13,r4 /* for this processor. */ mtspr SPRN_SPRG3,r13 /* Save vaddr of paca in SPRG3 */ @@ -1731,7 +1732,7 @@ _GLOBAL(__secondary_start) bl .early_setup_secondary /* Initialize the kernel stack. Just a repeat for iSeries. */ - LOADADDR(r3,current_set) + LOAD_REG_ADDR(r3, current_set) sldi r28,r24,3 /* get current_set[cpu#] */ ldx r1,r3,r28 addi r1,r1,THREAD_SIZE-STACK_FRAME_OVERHEAD @@ -1742,8 +1743,8 @@ _GLOBAL(__secondary_start) mtlr r7 /* enable MMU and jump to start_secondary */ - LOADADDR(r3,.start_secondary_prolog) - SET_REG_TO_CONST(r4, MSR_KERNEL) + LOAD_REG_ADDR(r3, .start_secondary_prolog) + LOAD_REG_IMMEDIATE(r4, MSR_KERNEL) #ifdef DO_SOFT_DISABLE ori r4,r4,MSR_EE #endif @@ -1792,8 +1793,8 @@ _STATIC(start_here_multiplatform) * be detached from the kernel completely. Besides, we need * to clear it now for kexec-style entry. */ - LOADADDR(r11,__bss_stop) - LOADADDR(r8,__bss_start) + LOAD_REG_IMMEDIATE(r11,__bss_stop) + LOAD_REG_IMMEDIATE(r8,__bss_start) sub r11,r11,r8 /* bss size */ addi r11,r11,7 /* round up to an even double word */ rldicl. r11,r11,61,3 /* shift right by 3 */ @@ -1831,7 +1832,7 @@ _STATIC(start_here_multiplatform) /* up the htab. This is done because we have relocated the */ /* kernel but are still running in real mode. */ - LOADADDR(r3,init_thread_union) + LOAD_REG_IMMEDIATE(r3,init_thread_union) add r3,r3,r26 /* set up a stack pointer (physical address) */ @@ -1840,14 +1841,14 @@ _STATIC(start_here_multiplatform) stdu r0,-STACK_FRAME_OVERHEAD(r1) /* set up the TOC (physical address) */ - LOADADDR(r2,__toc_start) + LOAD_REG_IMMEDIATE(r2,__toc_start) addi r2,r2,0x4000 addi r2,r2,0x4000 add r2,r2,r26 - LOADADDR(r3,cpu_specs) + LOAD_REG_IMMEDIATE(r3, cpu_specs) add r3,r3,r26 - LOADADDR(r4,cur_cpu_spec) + LOAD_REG_IMMEDIATE(r4,cur_cpu_spec) add r4,r4,r26 mr r5,r26 bl .identify_cpu @@ -1863,11 +1864,11 @@ _STATIC(start_here_multiplatform) * nowhere it can be initialized differently before we reach this * code */ - LOADADDR(r27, boot_cpuid) + LOAD_REG_IMMEDIATE(r27, boot_cpuid) add r27,r27,r26 lwz r27,0(r27) - LOADADDR(r24, paca) /* Get base vaddr of paca array */ + LOAD_REG_IMMEDIATE(r24, paca) /* Get base vaddr of paca array */ mulli r13,r27,PACA_SIZE /* Calculate vaddr of right paca */ add r13,r13,r24 /* for this processor. */ add r13,r13,r26 /* convert to physical addr */ @@ -1880,8 +1881,8 @@ _STATIC(start_here_multiplatform) mr r3,r31 bl .early_setup - LOADADDR(r3,.start_here_common) - SET_REG_TO_CONST(r4, MSR_KERNEL) + LOAD_REG_IMMEDIATE(r3, .start_here_common) + LOAD_REG_IMMEDIATE(r4, MSR_KERNEL) mtspr SPRN_SRR0,r3 mtspr SPRN_SRR1,r4 rfid @@ -1895,7 +1896,7 @@ _STATIC(start_here_common) /* The following code sets up the SP and TOC now that we are */ /* running with translation enabled. */ - LOADADDR(r3,init_thread_union) + LOAD_REG_IMMEDIATE(r3,init_thread_union) /* set up the stack */ addi r1,r3,THREAD_SIZE @@ -1908,16 +1909,16 @@ _STATIC(start_here_common) li r3,0 bl .do_cpu_ftr_fixups - LOADADDR(r26, boot_cpuid) + LOAD_REG_IMMEDIATE(r26, boot_cpuid) lwz r26,0(r26) - LOADADDR(r24, paca) /* Get base vaddr of paca array */ + LOAD_REG_IMMEDIATE(r24, paca) /* Get base vaddr of paca array */ mulli r13,r26,PACA_SIZE /* Calculate vaddr of right paca */ add r13,r13,r24 /* for this processor. */ mtspr SPRN_SPRG3,r13 /* ptr to current */ - LOADADDR(r4,init_task) + LOAD_REG_IMMEDIATE(r4, init_task) std r4,PACACURRENT(r13) /* Load the TOC */ @@ -1940,7 +1941,7 @@ _STATIC(start_here_common) _GLOBAL(hmt_init) #ifdef CONFIG_HMT - LOADADDR(r5, hmt_thread_data) + LOAD_REG_IMMEDIATE(r5, hmt_thread_data) mfspr r7,SPRN_PVR srwi r7,r7,16 cmpwi r7,0x34 /* Pulsar */ @@ -1961,7 +1962,7 @@ _GLOBAL(hmt_init) b 101f __hmt_secondary_hold: - LOADADDR(r5, hmt_thread_data) + LOAD_REG_IMMEDIATE(r5, hmt_thread_data) clrldi r5,r5,4 li r7,0 mfspr r6,SPRN_PIR @@ -1989,7 +1990,7 @@ __hmt_secondary_hold: #ifdef CONFIG_HMT _GLOBAL(hmt_start_secondary) - LOADADDR(r4,__hmt_secondary_hold) + LOAD_REG_IMMEDIATE(r4,__hmt_secondary_hold) clrldi r4,r4,4 mtspr SPRN_NIADORM, r4 mfspr r4, SPRN_MSRDORM Index: working-2.6/arch/powerpc/kernel/misc_64.S =================================================================== --- working-2.6.orig/arch/powerpc/kernel/misc_64.S 2006-01-13 12:07:17.000000000 +1100 +++ working-2.6/arch/powerpc/kernel/misc_64.S 2006-01-13 12:07:19.000000000 +1100 @@ -39,7 +39,7 @@ _GLOBAL(reloc_offset) mflr r0 bl 1f 1: mflr r3 - LOADADDR(r4,1b) + LOAD_REG_IMMEDIATE(r4,1b) subf r3,r4,r3 mtlr r0 blr @@ -51,7 +51,7 @@ _GLOBAL(add_reloc_offset) mflr r0 bl 1f 1: mflr r5 - LOADADDR(r4,1b) + LOAD_REG_IMMEDIATE(r4,1b) subf r5,r4,r5 add r3,r3,r5 mtlr r0 @@ -498,15 +498,15 @@ _GLOBAL(identify_cpu) */ _GLOBAL(do_cpu_ftr_fixups) /* Get CPU 0 features */ - LOADADDR(r6,cur_cpu_spec) + LOAD_REG_IMMEDIATE(r6,cur_cpu_spec) sub r6,r6,r3 ld r4,0(r6) sub r4,r4,r3 ld r4,CPU_SPEC_FEATURES(r4) /* Get the fixup table */ - LOADADDR(r6,__start___ftr_fixup) + LOAD_REG_IMMEDIATE(r6,__start___ftr_fixup) sub r6,r6,r3 - LOADADDR(r7,__stop___ftr_fixup) + LOAD_REG_IMMEDIATE(r7,__stop___ftr_fixup) sub r7,r7,r3 /* Do the fixup */ 1: cmpld r6,r7 Index: working-2.6/arch/powerpc/kernel/cpu_setup_power4.S =================================================================== --- working-2.6.orig/arch/powerpc/kernel/cpu_setup_power4.S 2006-01-13 12:07:17.000000000 +1100 +++ working-2.6/arch/powerpc/kernel/cpu_setup_power4.S 2006-01-13 12:07:19.000000000 +1100 @@ -130,7 +130,7 @@ _GLOBAL(__save_cpu_setup) mfcr r7 /* Get storage ptr */ - LOADADDR(r5,cpu_state_storage) + LOAD_REG_IMMEDIATE(r5,cpu_state_storage) /* We only deal with 970 for now */ mfspr r0,SPRN_PVR @@ -164,7 +164,7 @@ _GLOBAL(__restore_cpu_setup) /* Get storage ptr (FIXME when using anton reloc as we * are running with translation disabled here */ - LOADADDR(r5,cpu_state_storage) + LOAD_REG_IMMEDIATE(r5,cpu_state_storage) /* We only deal with 970 for now */ mfspr r0,SPRN_PVR Index: working-2.6/arch/powerpc/kernel/entry_32.S =================================================================== --- working-2.6.orig/arch/powerpc/kernel/entry_32.S 2006-01-13 12:07:17.000000000 +1100 +++ working-2.6/arch/powerpc/kernel/entry_32.S 2006-01-13 12:07:19.000000000 +1100 @@ -988,7 +988,7 @@ _GLOBAL(enter_rtas) stwu r1,-INT_FRAME_SIZE(r1) mflr r0 stw r0,INT_FRAME_SIZE+4(r1) - LOADADDR(r4, rtas) + LOAD_REG_ADDR(r4, rtas) lis r6,1f at ha /* physical return address for rtas */ addi r6,r6,1f at l tophys(r6,r6) Index: working-2.6/arch/powerpc/kernel/misc_32.S =================================================================== --- working-2.6.orig/arch/powerpc/kernel/misc_32.S 2006-01-13 12:07:17.000000000 +1100 +++ working-2.6/arch/powerpc/kernel/misc_32.S 2006-01-13 12:07:19.000000000 +1100 @@ -68,7 +68,7 @@ _GLOBAL(reloc_offset) mflr r0 bl 1f 1: mflr r3 - LOADADDR(r4,1b) + LOAD_REG_IMMEDIATE(r4,1b) subf r3,r4,r3 mtlr r0 blr @@ -80,7 +80,7 @@ _GLOBAL(add_reloc_offset) mflr r0 bl 1f 1: mflr r5 - LOADADDR(r4,1b) + LOAD_REG_IMMEDIATE(r4,1b) subf r5,r4,r5 add r3,r3,r5 mtlr r0 Index: working-2.6/arch/powerpc/kernel/fpu.S =================================================================== --- working-2.6.orig/arch/powerpc/kernel/fpu.S 2006-01-13 12:07:17.000000000 +1100 +++ working-2.6/arch/powerpc/kernel/fpu.S 2006-01-13 12:07:19.000000000 +1100 @@ -39,9 +39,9 @@ _GLOBAL(load_up_fpu) * to another. Instead we call giveup_fpu in switch_to. */ #ifndef CONFIG_SMP - LOADBASE(r3, last_task_used_math) + LOAD_REG_ADDRBASE(r3, last_task_used_math) toreal(r3) - PPC_LL r4,OFF(last_task_used_math)(r3) + PPC_LL r4,ADDROFF(last_task_used_math)(r3) PPC_LCMPI 0,r4,0 beq 1f toreal(r4) @@ -77,7 +77,7 @@ _GLOBAL(load_up_fpu) #ifndef CONFIG_SMP subi r4,r5,THREAD fromreal(r4) - PPC_STL r4,OFF(last_task_used_math)(r3) + PPC_STL r4,ADDROFF(last_task_used_math)(r3) #endif /* CONFIG_SMP */ /* restore registers and return */ /* we haven't used ctr or xer or lr */ @@ -113,8 +113,8 @@ _GLOBAL(giveup_fpu) 1: #ifndef CONFIG_SMP li r5,0 - LOADBASE(r4,last_task_used_math) - PPC_STL r5,OFF(last_task_used_math)(r4) + LOAD_REG_ADDRBASE(r4,last_task_used_math) + PPC_STL r5,ADDROFF(last_task_used_math)(r4) #endif /* CONFIG_SMP */ blr Index: working-2.6/arch/powerpc/kernel/idle_power4.S =================================================================== --- working-2.6.orig/arch/powerpc/kernel/idle_power4.S 2006-01-13 12:07:17.000000000 +1100 +++ working-2.6/arch/powerpc/kernel/idle_power4.S 2006-01-13 12:07:19.000000000 +1100 @@ -38,14 +38,14 @@ END_FTR_SECTION_IFCLR(CPU_FTR_CAN_NAP) /* We must dynamically check for the NAP feature as it * can be cleared by CPU init after the fixups are done */ - LOADBASE(r3,cur_cpu_spec) - ld r4,OFF(cur_cpu_spec)(r3) + LOAD_REG_ADDRBASE(r3,cur_cpu_spec) + ld r4,ADDROFF(cur_cpu_spec)(r3) ld r4,CPU_SPEC_FEATURES(r4) andi. r0,r4,CPU_FTR_CAN_NAP beqlr /* Now check if user or arch enabled NAP mode */ - LOADBASE(r3,powersave_nap) - lwz r4,OFF(powersave_nap)(r3) + LOAD_REG_ADDRBASE(r3,powersave_nap) + lwz r4,ADDROFF(powersave_nap)(r3) cmpwi 0,r4,0 beqlr -- David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson From anton at samba.org Fri Jan 13 15:38:39 2006 From: anton at samba.org (Anton Blanchard) Date: Fri, 13 Jan 2006 15:38:39 +1100 Subject: [PATCH] powerpc: reformat atomic_add_unless Message-ID: <20060113043839.GC26421@krispykreme> It makes my eyes hurt. Signed-off-by: Anton Blanchard --- Index: build/include/asm-powerpc/atomic.h =================================================================== --- build.orig/include/asm-powerpc/atomic.h 2006-01-13 15:09:49.000000000 +1100 +++ build/include/asm-powerpc/atomic.h 2006-01-13 15:18:32.000000000 +1100 @@ -176,19 +176,19 @@ * Atomically adds @a to @v, so long as it was not @u. * Returns non-zero if @v was not @u, and zero otherwise. */ -#define atomic_add_unless(v, a, u) \ -({ \ - int c, old; \ - c = atomic_read(v); \ - for (;;) { \ - if (unlikely(c == (u))) \ - break; \ - old = atomic_cmpxchg((v), c, c + (a)); \ - if (likely(old == c)) \ - break; \ - c = old; \ - } \ - c != (u); \ +#define atomic_add_unless(v, a, u) \ +({ \ + int c, old; \ + c = atomic_read(v); \ + for (;;) { \ + if (unlikely(c == (u))) \ + break; \ + old = atomic_cmpxchg((v), c, c + (a)); \ + if (likely(old == c)) \ + break; \ + c = old; \ + } \ + c != (u); \ }) #define atomic_inc_not_zero(v) atomic_add_unless((v), 1, 0) From anton at samba.org Fri Jan 13 15:37:17 2006 From: anton at samba.org (Anton Blanchard) Date: Fri, 13 Jan 2006 15:37:17 +1100 Subject: [PATCH] powerpc: use lwsync in lock functions Message-ID: <20060113043717.GB26421@krispykreme> eieio is only a store - store ordering. When used to order an unlock operation loads may leak out of the critical region. This is potentially buggy, one example is if a user wants to atomically read a couple of values. We can solve this with an lwsync which orders everything except store - load. I removed the (now unused) EIEIO_ON_SMP macros and the c versions isync_on_smp and eieio_on_smp now we dont use them. I also removed some old comments that were used to identify inline spinlocks in assembly, they dont make sense now our locks are out of line. Another interesting thing was that read_unlock was using an eieio even though the rest of the spinlock code had already been converted to use lwsync. Signed-off-by: Anton Blanchard --- Index: build/include/asm-powerpc/atomic.h =================================================================== --- build.orig/include/asm-powerpc/atomic.h 2006-01-13 12:01:03.000000000 +1100 +++ build/include/asm-powerpc/atomic.h 2006-01-13 12:01:04.000000000 +1100 @@ -36,7 +36,7 @@ int t; __asm__ __volatile__( - EIEIO_ON_SMP + LWSYNC_ON_SMP "1: lwarx %0,0,%2 # atomic_add_return\n\ add %0,%1,%0\n" PPC405_ERR77(0,%2) @@ -72,7 +72,7 @@ int t; __asm__ __volatile__( - EIEIO_ON_SMP + LWSYNC_ON_SMP "1: lwarx %0,0,%2 # atomic_sub_return\n\ subf %0,%1,%0\n" PPC405_ERR77(0,%2) @@ -106,7 +106,7 @@ int t; __asm__ __volatile__( - EIEIO_ON_SMP + LWSYNC_ON_SMP "1: lwarx %0,0,%1 # atomic_inc_return\n\ addic %0,%0,1\n" PPC405_ERR77(0,%1) @@ -150,7 +150,7 @@ int t; __asm__ __volatile__( - EIEIO_ON_SMP + LWSYNC_ON_SMP "1: lwarx %0,0,%1 # atomic_dec_return\n\ addic %0,%0,-1\n" PPC405_ERR77(0,%1) @@ -204,7 +204,7 @@ int t; __asm__ __volatile__( - EIEIO_ON_SMP + LWSYNC_ON_SMP "1: lwarx %0,0,%1 # atomic_dec_if_positive\n\ addic. %0,%0,-1\n\ blt- 2f\n" @@ -253,7 +253,7 @@ long t; __asm__ __volatile__( - EIEIO_ON_SMP + LWSYNC_ON_SMP "1: ldarx %0,0,%2 # atomic64_add_return\n\ add %0,%1,%0\n\ stdcx. %0,0,%2 \n\ @@ -287,7 +287,7 @@ long t; __asm__ __volatile__( - EIEIO_ON_SMP + LWSYNC_ON_SMP "1: ldarx %0,0,%2 # atomic64_sub_return\n\ subf %0,%1,%0\n\ stdcx. %0,0,%2 \n\ @@ -319,7 +319,7 @@ long t; __asm__ __volatile__( - EIEIO_ON_SMP + LWSYNC_ON_SMP "1: ldarx %0,0,%1 # atomic64_inc_return\n\ addic %0,%0,1\n\ stdcx. %0,0,%1 \n\ @@ -361,7 +361,7 @@ long t; __asm__ __volatile__( - EIEIO_ON_SMP + LWSYNC_ON_SMP "1: ldarx %0,0,%1 # atomic64_dec_return\n\ addic %0,%0,-1\n\ stdcx. %0,0,%1\n\ @@ -386,7 +386,7 @@ long t; __asm__ __volatile__( - EIEIO_ON_SMP + LWSYNC_ON_SMP "1: ldarx %0,0,%1 # atomic64_dec_if_positive\n\ addic. %0,%0,-1\n\ blt- 2f\n\ Index: build/include/asm-powerpc/bitops.h =================================================================== --- build.orig/include/asm-powerpc/bitops.h 2006-01-13 12:01:03.000000000 +1100 +++ build/include/asm-powerpc/bitops.h 2006-01-13 12:01:04.000000000 +1100 @@ -112,7 +112,7 @@ unsigned long *p = ((unsigned long *)addr) + BITOP_WORD(nr); __asm__ __volatile__( - EIEIO_ON_SMP + LWSYNC_ON_SMP "1:" PPC_LLARX "%0,0,%3 # test_and_set_bit\n" "or %1,%0,%2 \n" PPC405_ERR77(0,%3) @@ -134,7 +134,7 @@ unsigned long *p = ((unsigned long *)addr) + BITOP_WORD(nr); __asm__ __volatile__( - EIEIO_ON_SMP + LWSYNC_ON_SMP "1:" PPC_LLARX "%0,0,%3 # test_and_clear_bit\n" "andc %1,%0,%2 \n" PPC405_ERR77(0,%3) @@ -156,7 +156,7 @@ unsigned long *p = ((unsigned long *)addr) + BITOP_WORD(nr); __asm__ __volatile__( - EIEIO_ON_SMP + LWSYNC_ON_SMP "1:" PPC_LLARX "%0,0,%3 # test_and_change_bit\n" "xor %1,%0,%2 \n" PPC405_ERR77(0,%3) Index: build/include/asm-powerpc/futex.h =================================================================== --- build.orig/include/asm-powerpc/futex.h 2006-01-13 12:01:03.000000000 +1100 +++ build/include/asm-powerpc/futex.h 2006-01-13 12:01:04.000000000 +1100 @@ -11,7 +11,7 @@ #define __futex_atomic_op(insn, ret, oldval, uaddr, oparg) \ __asm__ __volatile ( \ - SYNC_ON_SMP \ + LWSYNC_ON_SMP \ "1: lwarx %0,0,%2\n" \ insn \ PPC405_ERR77(0, %2) \ Index: build/include/asm-powerpc/spinlock.h =================================================================== --- build.orig/include/asm-powerpc/spinlock.h 2006-01-13 12:01:03.000000000 +1100 +++ build/include/asm-powerpc/spinlock.h 2006-01-13 14:47:15.000000000 +1100 @@ -46,7 +46,7 @@ token = LOCK_TOKEN; __asm__ __volatile__( -"1: lwarx %0,0,%2 # __spin_trylock\n\ +"1: lwarx %0,0,%2\n\ cmpwi 0,%0,0\n\ bne- 2f\n\ stwcx. %1,0,%2\n\ @@ -124,8 +124,8 @@ static __inline__ void __raw_spin_unlock(raw_spinlock_t *lock) { - __asm__ __volatile__(SYNC_ON_SMP" # __raw_spin_unlock" - : : :"memory"); + __asm__ __volatile__("# __raw_spin_unlock\n\t" + LWSYNC_ON_SMP: : :"memory"); lock->slock = 0; } @@ -167,7 +167,7 @@ long tmp; __asm__ __volatile__( -"1: lwarx %0,0,%1 # read_trylock\n" +"1: lwarx %0,0,%1\n" __DO_SIGN_EXTEND " addic. %0,%0,1\n\ ble- 2f\n" @@ -192,7 +192,7 @@ token = WRLOCK_TOKEN; __asm__ __volatile__( -"1: lwarx %0,0,%2 # write_trylock\n\ +"1: lwarx %0,0,%2\n\ cmpwi 0,%0,0\n\ bne- 2f\n" PPC405_ERR77(0,%1) @@ -249,8 +249,9 @@ long tmp; __asm__ __volatile__( - "eieio # read_unlock\n\ -1: lwarx %0,0,%1\n\ + "# read_unlock\n\t" + LWSYNC_ON_SMP +"1: lwarx %0,0,%1\n\ addic %0,%0,-1\n" PPC405_ERR77(0,%1) " stwcx. %0,0,%1\n\ @@ -262,8 +263,8 @@ static __inline__ void __raw_write_unlock(raw_rwlock_t *rw) { - __asm__ __volatile__(SYNC_ON_SMP" # write_unlock" - : : :"memory"); + __asm__ __volatile__("# write_unlock\n\t" + LWSYNC_ON_SMP: : :"memory"); rw->lock = 0; } Index: build/include/asm-powerpc/synch.h =================================================================== --- build.orig/include/asm-powerpc/synch.h 2006-01-13 12:01:03.000000000 +1100 +++ build/include/asm-powerpc/synch.h 2006-01-13 14:31:13.000000000 +1100 @@ -2,6 +2,8 @@ #define _ASM_POWERPC_SYNCH_H #ifdef __KERNEL__ +#include + #ifdef __powerpc64__ #define __SUBARCH_HAS_LWSYNC #endif @@ -12,20 +14,12 @@ # define LWSYNC sync #endif - -/* - * Arguably the bitops and *xchg operations don't imply any memory barrier - * or SMP ordering, but in fact a lot of drivers expect them to imply - * both, since they do on x86 cpus. - */ #ifdef CONFIG_SMP -#define EIEIO_ON_SMP "eieio\n" #define ISYNC_ON_SMP "\n\tisync" -#define SYNC_ON_SMP __stringify(LWSYNC) "\n" +#define LWSYNC_ON_SMP __stringify(LWSYNC) "\n" #else -#define EIEIO_ON_SMP #define ISYNC_ON_SMP -#define SYNC_ON_SMP +#define LWSYNC_ON_SMP #endif static inline void eieio(void) @@ -38,14 +32,5 @@ __asm__ __volatile__ ("isync" : : : "memory"); } -#ifdef CONFIG_SMP -#define eieio_on_smp() eieio() -#define isync_on_smp() isync() -#else -#define eieio_on_smp() __asm__ __volatile__("": : :"memory") -#define isync_on_smp() __asm__ __volatile__("": : :"memory") -#endif - #endif /* __KERNEL__ */ #endif /* _ASM_POWERPC_SYNCH_H */ - Index: build/include/asm-powerpc/system.h =================================================================== --- build.orig/include/asm-powerpc/system.h 2006-01-13 12:01:03.000000000 +1100 +++ build/include/asm-powerpc/system.h 2006-01-13 12:01:04.000000000 +1100 @@ -212,7 +212,7 @@ unsigned long prev; __asm__ __volatile__( - EIEIO_ON_SMP + LWSYNC_ON_SMP "1: lwarx %0,0,%2 \n" PPC405_ERR77(0,%2) " stwcx. %3,0,%2 \n\ @@ -232,7 +232,7 @@ unsigned long prev; __asm__ __volatile__( - EIEIO_ON_SMP + LWSYNC_ON_SMP "1: ldarx %0,0,%2 \n" PPC405_ERR77(0,%2) " stdcx. %3,0,%2 \n\ @@ -287,7 +287,7 @@ unsigned int prev; __asm__ __volatile__ ( - EIEIO_ON_SMP + LWSYNC_ON_SMP "1: lwarx %0,0,%2 # __cmpxchg_u32\n\ cmpw 0,%0,%3\n\ bne- 2f\n" @@ -311,7 +311,7 @@ unsigned long prev; __asm__ __volatile__ ( - EIEIO_ON_SMP + LWSYNC_ON_SMP "1: ldarx %0,0,%2 # __cmpxchg_u64\n\ cmpd 0,%0,%3\n\ bne- 2f\n\ From olof at lixom.net Fri Jan 13 15:49:07 2006 From: olof at lixom.net (Olof Johansson) Date: Thu, 12 Jan 2006 22:49:07 -0600 Subject: [PATCH] powerpc: reformat atomic_add_unless In-Reply-To: <20060113043839.GC26421@krispykreme> References: <20060113043839.GC26421@krispykreme> Message-ID: <20060113044906.GI2491@pb15.lixom.net> On Fri, Jan 13, 2006 at 03:38:39PM +1100, Anton Blanchard wrote: > > It makes my eyes hurt. Much better, but that crazy double-tab-plus-a-few-spaces indentation itches a bit too. :-) > > Signed-off-by: Anton Blanchard > --- > > Index: build/include/asm-powerpc/atomic.h > =================================================================== > --- build.orig/include/asm-powerpc/atomic.h 2006-01-13 15:09:49.000000000 +1100 > +++ build/include/asm-powerpc/atomic.h 2006-01-13 15:18:32.000000000 +1100 > @@ -176,19 +176,19 @@ > * Atomically adds @a to @v, so long as it was not @u. > * Returns non-zero if @v was not @u, and zero otherwise. > */ > -#define atomic_add_unless(v, a, u) \ > -({ \ > - int c, old; \ > - c = atomic_read(v); \ > - for (;;) { \ > - if (unlikely(c == (u))) \ > - break; \ > - old = atomic_cmpxchg((v), c, c + (a)); \ > - if (likely(old == c)) \ > - break; \ > - c = old; \ > - } \ > - c != (u); \ > +#define atomic_add_unless(v, a, u) \ > +({ \ > + int c, old; \ > + c = atomic_read(v); \ > + for (;;) { \ > + if (unlikely(c == (u))) \ > + break; \ > + old = atomic_cmpxchg((v), c, c + (a)); \ > + if (likely(old == c)) \ > + break; \ > + c = old; \ > + } \ > + c != (u); \ > }) > #define atomic_inc_not_zero(v) atomic_add_unless((v), 1, 0) > > _______________________________________________ > Linuxppc64-dev mailing list > Linuxppc64-dev at ozlabs.org > https://ozlabs.org/mailman/listinfo/linuxppc64-dev From hollis at penguinppc.org Fri Jan 13 16:08:18 2006 From: hollis at penguinppc.org (Hollis Blanchard) Date: Thu, 12 Jan 2006 23:08:18 -0600 Subject: [PATCH] powerpc: reformat atomic_add_unless In-Reply-To: <20060113044906.GI2491@pb15.lixom.net> References: <20060113043839.GC26421@krispykreme> <20060113044906.GI2491@pb15.lixom.net> Message-ID: <341a348fca429eb4aeb75084d79662b9@penguinppc.org> On Jan 12, 2006, at 10:49 PM, Olof Johansson wrote: > On Fri, Jan 13, 2006 at 03:38:39PM +1100, Anton Blanchard wrote: >> >> It makes my eyes hurt. > > Much better, but that crazy double-tab-plus-a-few-spaces indentation > itches a bit too. :-) "Tabs for indentation, spaces for formatting" seems to pain the fewest number of people... -Hollis From anton at samba.org Fri Jan 13 16:51:52 2006 From: anton at samba.org (Anton Blanchard) Date: Fri, 13 Jan 2006 16:51:52 +1100 Subject: [PATCH] powerpc: reformat atomic_add_unless In-Reply-To: <20060113044906.GI2491@pb15.lixom.net> References: <20060113043839.GC26421@krispykreme> <20060113044906.GI2491@pb15.lixom.net> Message-ID: <20060113055152.GE26421@krispykreme> > Much better, but that crazy double-tab-plus-a-few-spaces indentation > itches a bit too. :-) Yuck, didnt notice that when I scanned through it. Anton -- It makes my eyes hurt. Signed-off-by: Anton Blanchard --- Index: build/include/asm-powerpc/atomic.h =================================================================== --- build.orig/include/asm-powerpc/atomic.h 2006-01-13 15:09:49.000000000 +1100 +++ build/include/asm-powerpc/atomic.h 2006-01-13 16:47:06.000000000 +1100 @@ -176,19 +176,19 @@ static __inline__ int atomic_dec_return( * Atomically adds @a to @v, so long as it was not @u. * Returns non-zero if @v was not @u, and zero otherwise. */ -#define atomic_add_unless(v, a, u) \ -({ \ - int c, old; \ - c = atomic_read(v); \ - for (;;) { \ - if (unlikely(c == (u))) \ - break; \ - old = atomic_cmpxchg((v), c, c + (a)); \ - if (likely(old == c)) \ - break; \ - c = old; \ - } \ - c != (u); \ +#define atomic_add_unless(v, a, u) \ +({ \ + int c, old; \ + c = atomic_read(v); \ + for (;;) { \ + if (unlikely(c == (u))) \ + break; \ + old = atomic_cmpxchg((v), c, c + (a)); \ + if (likely(old == c)) \ + break; \ + c = old; \ + } \ + c != (u); \ }) #define atomic_inc_not_zero(v) atomic_add_unless((v), 1, 0) From michael at ellerman.id.au Fri Jan 13 17:46:55 2006 From: michael at ellerman.id.au (Michael Ellerman) Date: Fri, 13 Jan 2006 17:46:55 +1100 Subject: [PATCH 0/10] powerpc: Random firmware feature & iSeries related cleanups Message-ID: <1137134815.491678.995063725775.qpush@concordia> This is the series I sent yesterday, with firmware_set_feature() removed, plus a few other patches. Booted on iSeries & pSeries LPAR, built for G5 and pmac32 (which breaks elsewhere). From michael at ellerman.id.au Fri Jan 13 17:46:55 2006 From: michael at ellerman.id.au (Michael Ellerman) Date: Fri, 13 Jan 2006 17:46:55 +1100 Subject: [PATCH 1/10] powerpc: Cleanup pSeries firmware feature initialisation In-Reply-To: <1137134815.491678.995063725775.qpush@concordia> Message-ID: <20060113064705.C0AED689AC@ozlabs.org> Cleanup fw_feature_init in platforms/pseries/setup.c. Cleanup white space and replace the while loop with a for loop - which seems clearer to me. Signed-off-by: Michael Ellerman --- arch/powerpc/platforms/pseries/setup.c | 45 +++++++++++++++------------------ 1 files changed, 21 insertions(+), 24 deletions(-) Index: linux/arch/powerpc/platforms/pseries/setup.c =================================================================== --- linux.orig/arch/powerpc/platforms/pseries/setup.c +++ linux/arch/powerpc/platforms/pseries/setup.c @@ -263,48 +263,45 @@ static int __init pSeries_init_panel(voi arch_initcall(pSeries_init_panel); -/* Build up the ppc64_firmware_features bitmask field - * using contents of device-tree/ibm,hypertas-functions. - * Ultimately this functionality may be moved into prom.c prom_init(). +/* Build up the firmware features bitmask using the contents of + * device-tree/ibm,hypertas-functions. Ultimately this functionality may + * be moved into prom.c prom_init(). */ static void __init fw_feature_init(void) { - struct device_node * dn; - char * hypertas; - unsigned int len; + struct device_node *dn; + char *hypertas, *s; + int len, i; DBG(" -> fw_feature_init()\n"); - ppc64_firmware_features = 0; dn = of_find_node_by_path("/rtas"); if (dn == NULL) { - printk(KERN_ERR "WARNING ! Cannot find RTAS in device-tree !\n"); + printk(KERN_ERR "WARNING! Cannot find RTAS in device-tree!\n"); goto no_rtas; } hypertas = get_property(dn, "ibm,hypertas-functions", &len); - if (hypertas) { - while (len > 0){ - int i, hypertas_len; + if (hypertas == NULL) + goto no_hypertas; + + for (s = hypertas; s < hypertas + len; s += strlen(s) + 1) { + for (i = 0; i < FIRMWARE_MAX_FEATURES; i++) { /* check value against table of strings */ - for(i=0; i < FIRMWARE_MAX_FEATURES ;i++) { - if ((firmware_features_table[i].name) && - (strcmp(firmware_features_table[i].name,hypertas))==0) { - /* we have a match */ - ppc64_firmware_features |= - (firmware_features_table[i].val); - break; - } - } - hypertas_len = strlen(hypertas); - len -= hypertas_len +1; - hypertas+= hypertas_len +1; + if (!firmware_features_table[i].name || + strcmp(firmware_features_table[i].name, s)) + continue; + + /* we have a match */ + ppc64_firmware_features |= + firmware_features_table[i].val; + break; } } +no_hypertas: of_node_put(dn); no_rtas: - DBG(" <- fw_feature_init()\n"); } From michael at ellerman.id.au Fri Jan 13 17:46:56 2006 From: michael at ellerman.id.au (Michael Ellerman) Date: Fri, 13 Jan 2006 17:46:56 +1100 Subject: [PATCH 2/10] powerpc: Move pSeries firmware feature setup into platforms/pseries In-Reply-To: <1137134815.491678.995063725775.qpush@concordia> Message-ID: <20060113064706.5B9CB689AE@ozlabs.org> Currently we have some stuff in firmware.h and kernel/firmware.c that is #ifdef CONFIG_PPC_PSERIES. Move it all into platforms/pseries. Signed-off-by: Michael Ellerman --- arch/powerpc/kernel/firmware.c | 25 ------- arch/powerpc/platforms/pseries/Makefile | 3 arch/powerpc/platforms/pseries/firmware.c | 104 ++++++++++++++++++++++++++++++ arch/powerpc/platforms/pseries/firmware.h | 17 ++++ arch/powerpc/platforms/pseries/setup.c | 46 ------------- include/asm-powerpc/firmware.h | 9 -- 6 files changed, 124 insertions(+), 80 deletions(-) Index: linux/arch/powerpc/kernel/firmware.c =================================================================== --- linux.orig/arch/powerpc/kernel/firmware.c +++ linux/arch/powerpc/kernel/firmware.c @@ -18,28 +18,3 @@ #include unsigned long ppc64_firmware_features; - -#ifdef CONFIG_PPC_PSERIES -firmware_feature_t firmware_features_table[FIRMWARE_MAX_FEATURES] = { - {FW_FEATURE_PFT, "hcall-pft"}, - {FW_FEATURE_TCE, "hcall-tce"}, - {FW_FEATURE_SPRG0, "hcall-sprg0"}, - {FW_FEATURE_DABR, "hcall-dabr"}, - {FW_FEATURE_COPY, "hcall-copy"}, - {FW_FEATURE_ASR, "hcall-asr"}, - {FW_FEATURE_DEBUG, "hcall-debug"}, - {FW_FEATURE_PERF, "hcall-perf"}, - {FW_FEATURE_DUMP, "hcall-dump"}, - {FW_FEATURE_INTERRUPT, "hcall-interrupt"}, - {FW_FEATURE_MIGRATE, "hcall-migrate"}, - {FW_FEATURE_PERFMON, "hcall-perfmon"}, - {FW_FEATURE_CRQ, "hcall-crq"}, - {FW_FEATURE_VIO, "hcall-vio"}, - {FW_FEATURE_RDMA, "hcall-rdma"}, - {FW_FEATURE_LLAN, "hcall-lLAN"}, - {FW_FEATURE_BULK, "hcall-bulk"}, - {FW_FEATURE_XDABR, "hcall-xdabr"}, - {FW_FEATURE_MULTITCE, "hcall-multi-tce"}, - {FW_FEATURE_SPLPAR, "hcall-splpar"}, -}; -#endif Index: linux/arch/powerpc/platforms/pseries/Makefile =================================================================== --- linux.orig/arch/powerpc/platforms/pseries/Makefile +++ linux/arch/powerpc/platforms/pseries/Makefile @@ -1,5 +1,6 @@ obj-y := pci.o lpar.o hvCall.o nvram.o reconfig.o \ - setup.o iommu.o ras.o rtasd.o pci_dlpar.o + setup.o iommu.o ras.o rtasd.o pci_dlpar.o \ + firmware.o obj-$(CONFIG_SMP) += smp.o obj-$(CONFIG_IBMVIO) += vio.o obj-$(CONFIG_XICS) += xics.o Index: linux/arch/powerpc/platforms/pseries/firmware.c =================================================================== --- /dev/null +++ linux/arch/powerpc/platforms/pseries/firmware.c @@ -0,0 +1,104 @@ +/* + * pSeries firmware setup code. + * + * Portions from arch/powerpc/platforms/pseries/setup.c: + * Copyright (C) 1995 Linus Torvalds + * Adapted from 'alpha' version by Gary Thomas + * Modified by Cort Dougan (cort at cs.nmt.edu) + * Modified by PPC64 Team, IBM Corp + * + * Portions from arch/powerpc/kernel/firmware.c + * Copyright (C) 2001 Ben. Herrenschmidt (benh at kernel.crashing.org) + * Modifications for ppc64: + * Copyright (C) 2003 Dave Engebretsen + * Copyright (C) 2005 Stephen Rothwell, IBM Corporation + * + * Copyright 2006 IBM Corporation. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version + * 2 of the License, or (at your option) any later version. + */ + +#undef DEBUG + +#include +#include + +#ifdef DEBUG +#define DBG(fmt...) udbg_printf(fmt) +#else +#define DBG(fmt...) +#endif + +typedef struct { + unsigned long val; + char * name; +} firmware_feature_t; + +static __initdata firmware_feature_t +firmware_features_table[FIRMWARE_MAX_FEATURES] = { + {FW_FEATURE_PFT, "hcall-pft"}, + {FW_FEATURE_TCE, "hcall-tce"}, + {FW_FEATURE_SPRG0, "hcall-sprg0"}, + {FW_FEATURE_DABR, "hcall-dabr"}, + {FW_FEATURE_COPY, "hcall-copy"}, + {FW_FEATURE_ASR, "hcall-asr"}, + {FW_FEATURE_DEBUG, "hcall-debug"}, + {FW_FEATURE_PERF, "hcall-perf"}, + {FW_FEATURE_DUMP, "hcall-dump"}, + {FW_FEATURE_INTERRUPT, "hcall-interrupt"}, + {FW_FEATURE_MIGRATE, "hcall-migrate"}, + {FW_FEATURE_PERFMON, "hcall-perfmon"}, + {FW_FEATURE_CRQ, "hcall-crq"}, + {FW_FEATURE_VIO, "hcall-vio"}, + {FW_FEATURE_RDMA, "hcall-rdma"}, + {FW_FEATURE_LLAN, "hcall-lLAN"}, + {FW_FEATURE_BULK, "hcall-bulk"}, + {FW_FEATURE_XDABR, "hcall-xdabr"}, + {FW_FEATURE_MULTITCE, "hcall-multi-tce"}, + {FW_FEATURE_SPLPAR, "hcall-splpar"}, +}; + +/* Build up the firmware features bitmask using the contents of + * device-tree/ibm,hypertas-functions. Ultimately this functionality may + * be moved into prom.c prom_init(). + */ +void __init fw_feature_init(void) +{ + struct device_node *dn; + char *hypertas, *s; + int len, i; + + DBG(" -> fw_feature_init()\n"); + + dn = of_find_node_by_path("/rtas"); + if (dn == NULL) { + printk(KERN_ERR "WARNING! Cannot find RTAS in device-tree!\n"); + goto no_rtas; + } + + hypertas = get_property(dn, "ibm,hypertas-functions", &len); + if (hypertas == NULL) + goto no_hypertas; + + for (s = hypertas; s < hypertas + len; s += strlen(s) + 1) { + for (i = 0; i < FIRMWARE_MAX_FEATURES; i++) { + /* check value against table of strings */ + if (!firmware_features_table[i].name || + strcmp(firmware_features_table[i].name, s)) + continue; + + /* we have a match */ + ppc64_firmware_features |= + firmware_features_table[i].val; + break; + } + } + +no_hypertas: + of_node_put(dn); +no_rtas: + DBG(" <- fw_feature_init()\n"); +} Index: linux/arch/powerpc/platforms/pseries/setup.c =================================================================== --- linux.orig/arch/powerpc/platforms/pseries/setup.c +++ linux/arch/powerpc/platforms/pseries/setup.c @@ -60,7 +60,6 @@ #include #include #include "xics.h" -#include #include #include #include @@ -70,6 +69,7 @@ #include "plpar_wrappers.h" #include "ras.h" +#include "firmware.h" #ifdef DEBUG #define DBG(fmt...) udbg_printf(fmt) @@ -262,50 +262,6 @@ static int __init pSeries_init_panel(voi } arch_initcall(pSeries_init_panel); - -/* Build up the firmware features bitmask using the contents of - * device-tree/ibm,hypertas-functions. Ultimately this functionality may - * be moved into prom.c prom_init(). - */ -static void __init fw_feature_init(void) -{ - struct device_node *dn; - char *hypertas, *s; - int len, i; - - DBG(" -> fw_feature_init()\n"); - - dn = of_find_node_by_path("/rtas"); - if (dn == NULL) { - printk(KERN_ERR "WARNING! Cannot find RTAS in device-tree!\n"); - goto no_rtas; - } - - hypertas = get_property(dn, "ibm,hypertas-functions", &len); - if (hypertas == NULL) - goto no_hypertas; - - for (s = hypertas; s < hypertas + len; s += strlen(s) + 1) { - for (i = 0; i < FIRMWARE_MAX_FEATURES; i++) { - /* check value against table of strings */ - if (!firmware_features_table[i].name || - strcmp(firmware_features_table[i].name, s)) - continue; - - /* we have a match */ - ppc64_firmware_features |= - firmware_features_table[i].val; - break; - } - } - -no_hypertas: - of_node_put(dn); -no_rtas: - DBG(" <- fw_feature_init()\n"); -} - - static void __init pSeries_discover_pic(void) { struct device_node *np; Index: linux/include/asm-powerpc/firmware.h =================================================================== --- linux.orig/include/asm-powerpc/firmware.h +++ linux/include/asm-powerpc/firmware.h @@ -89,15 +89,6 @@ static inline unsigned long firmware_has (FW_FEATURE_POSSIBLE & ppc64_firmware_features & feature); } -#ifdef CONFIG_PPC_PSERIES -typedef struct { - unsigned long val; - char * name; -} firmware_feature_t; - -extern firmware_feature_t firmware_features_table[]; -#endif - extern void system_reset_fwnmi(void); extern void machine_check_fwnmi(void); Index: linux/arch/powerpc/platforms/pseries/firmware.h =================================================================== --- /dev/null +++ linux/arch/powerpc/platforms/pseries/firmware.h @@ -0,0 +1,17 @@ +/* + * Copyright 2006 IBM Corporation. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version + * 2 of the License, or (at your option) any later version. + */ + +#ifndef _PSERIES_FIRMWARE_H +#define _PSERIES_FIRMWARE_H + +#include + +extern void __init fw_feature_init(void); + +#endif /* _PSERIES_FIRMWARE_H */ From michael at ellerman.id.au Fri Jan 13 17:46:57 2006 From: michael at ellerman.id.au (Michael Ellerman) Date: Fri, 13 Jan 2006 17:46:57 +1100 Subject: [PATCH 3/10] powerpc: Replace platform_is_lpar() with a firmware feature In-Reply-To: <1137134815.491678.995063725775.qpush@concordia> Message-ID: <20060113064706.E3A786893F@ozlabs.org> It has been decreed that platform numbers are evil, so as a step in that direction, replace platform_is_lpar() with a FW_FEATURE_LPAR bit. Signed-off-by: Michael Ellerman --- arch/powerpc/mm/hash_utils_64.c | 4 ++-- arch/powerpc/oprofile/op_model_power4.c | 3 ++- arch/powerpc/platforms/iseries/setup.c | 10 +++++++--- arch/powerpc/platforms/pseries/iommu.c | 2 +- arch/powerpc/platforms/pseries/setup.c | 11 +++++++---- arch/powerpc/platforms/pseries/smp.c | 2 +- arch/powerpc/platforms/pseries/xics.c | 3 ++- include/asm-powerpc/firmware.h | 7 ++++--- include/asm-powerpc/processor.h | 1 - 9 files changed, 26 insertions(+), 17 deletions(-) Index: linux/include/asm-powerpc/firmware.h =================================================================== --- linux.orig/include/asm-powerpc/firmware.h +++ linux/include/asm-powerpc/firmware.h @@ -41,6 +41,7 @@ #define FW_FEATURE_MULTITCE (1UL<<19) #define FW_FEATURE_SPLPAR (1UL<<20) #define FW_FEATURE_ISERIES (1UL<<21) +#define FW_FEATURE_LPAR (1UL<<22) enum { #ifdef CONFIG_PPC64 @@ -51,10 +52,10 @@ enum { FW_FEATURE_MIGRATE | FW_FEATURE_PERFMON | FW_FEATURE_CRQ | FW_FEATURE_VIO | FW_FEATURE_RDMA | FW_FEATURE_LLAN | FW_FEATURE_BULK | FW_FEATURE_XDABR | FW_FEATURE_MULTITCE | - FW_FEATURE_SPLPAR, + FW_FEATURE_SPLPAR | FW_FEATURE_LPAR, FW_FEATURE_PSERIES_ALWAYS = 0, - FW_FEATURE_ISERIES_POSSIBLE = FW_FEATURE_ISERIES, - FW_FEATURE_ISERIES_ALWAYS = FW_FEATURE_ISERIES, + FW_FEATURE_ISERIES_POSSIBLE = FW_FEATURE_ISERIES | FW_FEATURE_LPAR, + FW_FEATURE_ISERIES_ALWAYS = FW_FEATURE_ISERIES | FW_FEATURE_LPAR, FW_FEATURE_POSSIBLE = #ifdef CONFIG_PPC_PSERIES FW_FEATURE_PSERIES_POSSIBLE | Index: linux/arch/powerpc/mm/hash_utils_64.c =================================================================== --- linux.orig/arch/powerpc/mm/hash_utils_64.c +++ linux/arch/powerpc/mm/hash_utils_64.c @@ -421,7 +421,7 @@ void __init htab_initialize(void) htab_hash_mask = pteg_count - 1; - if (platform_is_lpar()) { + if (firmware_has_feature(FW_FEATURE_LPAR)) { /* Using a hypervisor which owns the htab */ htab_address = NULL; _SDR1 = 0; @@ -516,7 +516,7 @@ void __init htab_initialize(void) void htab_initialize_secondary(void) { - if (!platform_is_lpar()) + if (!firmware_has_feature(FW_FEATURE_LPAR)) mtspr(SPRN_SDR1, _SDR1); } Index: linux/arch/powerpc/oprofile/op_model_power4.c =================================================================== --- linux.orig/arch/powerpc/oprofile/op_model_power4.c +++ linux/arch/powerpc/oprofile/op_model_power4.c @@ -10,6 +10,7 @@ #include #include #include +#include #include #include #include @@ -232,7 +233,7 @@ static unsigned long get_pc(struct pt_re mmcra = mfspr(SPRN_MMCRA); /* Were we in the hypervisor? */ - if (platform_is_lpar() && (mmcra & MMCRA_SIHV)) + if (firmware_has_feature(FW_FEATURE_LPAR) && (mmcra & MMCRA_SIHV)) /* function descriptor madness */ return *((unsigned long *)hypervisor_bucket); Index: linux/arch/powerpc/platforms/pseries/iommu.c =================================================================== --- linux.orig/arch/powerpc/platforms/pseries/iommu.c +++ linux/arch/powerpc/platforms/pseries/iommu.c @@ -584,7 +584,7 @@ void iommu_init_early_pSeries(void) return; } - if (platform_is_lpar()) { + if (firmware_has_feature(FW_FEATURE_LPAR)) { if (firmware_has_feature(FW_FEATURE_MULTITCE)) { ppc_md.tce_build = tce_buildmulti_pSeriesLP; ppc_md.tce_free = tce_freemulti_pSeriesLP; Index: linux/arch/powerpc/platforms/pseries/setup.c =================================================================== --- linux.orig/arch/powerpc/platforms/pseries/setup.c +++ linux/arch/powerpc/platforms/pseries/setup.c @@ -246,7 +246,7 @@ static void __init pSeries_setup_arch(vo ppc_md.idle_loop = default_idle; } - if (platform_is_lpar()) + if (firmware_has_feature(FW_FEATURE_LPAR)) ppc_md.enable_pmcs = pseries_lpar_enable_pmcs; else ppc_md.enable_pmcs = power4_enable_pmcs; @@ -326,7 +326,7 @@ static void __init pSeries_init_early(vo fw_feature_init(); - if (platform_is_lpar()) + if (firmware_has_feature(FW_FEATURE_LPAR)) hpte_init_lpar(); else { hpte_init_native(); @@ -334,7 +334,7 @@ static void __init pSeries_init_early(vo get_property(of_chosen, "linux,iommu-off", NULL)); } - if (platform_is_lpar()) + if (firmware_has_feature(FW_FEATURE_LPAR)) find_udbg_vterm(); if (firmware_has_feature(FW_FEATURE_DABR)) @@ -390,6 +390,9 @@ static int __init pSeries_probe(int plat * it here ... */ + if (platform == PLATFORM_PSERIES_LPAR) + ppc64_firmware_features |= FW_FEATURE_LPAR; + return 1; } @@ -531,7 +534,7 @@ static void pseries_shared_idle(void) static int pSeries_pci_probe_mode(struct pci_bus *bus) { - if (platform_is_lpar()) + if (firmware_has_feature(FW_FEATURE_LPAR)) return PCI_PROBE_DEVTREE; return PCI_PROBE_NORMAL; } Index: linux/arch/powerpc/platforms/pseries/smp.c =================================================================== --- linux.orig/arch/powerpc/platforms/pseries/smp.c +++ linux/arch/powerpc/platforms/pseries/smp.c @@ -443,7 +443,7 @@ void __init smp_init_pSeries(void) smp_ops->cpu_die = pSeries_cpu_die; /* Processors can be added/removed only on LPAR */ - if (platform_is_lpar()) + if (firmware_has_feature(FW_FEATURE_LPAR)) pSeries_reconfig_notifier_register(&pSeries_smp_nb); #endif Index: linux/arch/powerpc/platforms/pseries/xics.c =================================================================== --- linux.orig/arch/powerpc/platforms/pseries/xics.c +++ linux/arch/powerpc/platforms/pseries/xics.c @@ -20,6 +20,7 @@ #include #include #include +#include #include #include #include @@ -536,7 +537,7 @@ nextnode: of_node_put(np); } - if (platform_is_lpar()) + if (firmware_has_feature(FW_FEATURE_LPAR)) ops = &pSeriesLP_ops; else { #ifdef CONFIG_SMP Index: linux/arch/powerpc/platforms/iseries/setup.c =================================================================== --- linux.orig/arch/powerpc/platforms/iseries/setup.c +++ linux/arch/powerpc/platforms/iseries/setup.c @@ -303,8 +303,6 @@ static void __init iSeries_init_early(vo { DBG(" -> iSeries_init_early()\n"); - ppc64_firmware_features = FW_FEATURE_ISERIES; - ppc64_interrupt_controller = IC_ISERIES; #if defined(CONFIG_BLK_DEV_INITRD) @@ -710,7 +708,13 @@ void __init iSeries_init_IRQ(void) { } static int __init iseries_probe(int platform) { - return PLATFORM_ISERIES_LPAR == platform; + if (PLATFORM_ISERIES_LPAR != platform) + return 0; + + ppc64_firmware_features |= FW_FEATURE_ISERIES; + ppc64_firmware_features |= FW_FEATURE_LPAR; + + return 1; } struct machdep_calls __initdata iseries_md = { Index: linux/include/asm-powerpc/processor.h =================================================================== --- linux.orig/include/asm-powerpc/processor.h +++ linux/include/asm-powerpc/processor.h @@ -52,7 +52,6 @@ #ifdef __KERNEL__ #define platform_is_pseries() (_machine == PLATFORM_PSERIES || \ _machine == PLATFORM_PSERIES_LPAR) -#define platform_is_lpar() (!!(_machine & PLATFORM_LPAR)) #if defined(CONFIG_PPC_MULTIPLATFORM) extern int _machine; From michael at ellerman.id.au Fri Jan 13 17:46:57 2006 From: michael at ellerman.id.au (Michael Ellerman) Date: Fri, 13 Jan 2006 17:46:57 +1100 Subject: [PATCH 4/10] powerpc: trivial: cleanup whitespace in cputable.h In-Reply-To: <1137134815.491678.995063725775.qpush@concordia> Message-ID: <20060113064707.98F3C689C4@ozlabs.org> Remove redundant whitepsace in include/asm-powerpc/cputable.h Signed-off-by: Michael Ellerman --- include/asm-powerpc/cputable.h | 34 +++++++++++++++++----------------- 1 files changed, 17 insertions(+), 17 deletions(-) Index: linux/include/asm-powerpc/cputable.h =================================================================== --- linux.orig/include/asm-powerpc/cputable.h +++ linux/include/asm-powerpc/cputable.h @@ -96,19 +96,19 @@ extern void do_cpu_ftr_fixups(unsigned l #define CPU_FTR_NEED_COHERENT ASM_CONST(0x0000000000020000) #define CPU_FTR_NO_BTIC ASM_CONST(0x0000000000040000) #define CPU_FTR_BIG_PHYS ASM_CONST(0x0000000000080000) -#define CPU_FTR_NODSISRALIGN ASM_CONST(0x0000000000100000) +#define CPU_FTR_NODSISRALIGN ASM_CONST(0x0000000000100000) #ifdef __powerpc64__ /* Add the 64b processor unique features in the top half of the word */ -#define CPU_FTR_SLB ASM_CONST(0x0000000100000000) -#define CPU_FTR_16M_PAGE ASM_CONST(0x0000000200000000) -#define CPU_FTR_TLBIEL ASM_CONST(0x0000000400000000) -#define CPU_FTR_NOEXECUTE ASM_CONST(0x0000000800000000) -#define CPU_FTR_IABR ASM_CONST(0x0000002000000000) -#define CPU_FTR_MMCRA ASM_CONST(0x0000004000000000) +#define CPU_FTR_SLB ASM_CONST(0x0000000100000000) +#define CPU_FTR_16M_PAGE ASM_CONST(0x0000000200000000) +#define CPU_FTR_TLBIEL ASM_CONST(0x0000000400000000) +#define CPU_FTR_NOEXECUTE ASM_CONST(0x0000000800000000) +#define CPU_FTR_IABR ASM_CONST(0x0000002000000000) +#define CPU_FTR_MMCRA ASM_CONST(0x0000004000000000) #define CPU_FTR_CTRL ASM_CONST(0x0000008000000000) -#define CPU_FTR_SMT ASM_CONST(0x0000010000000000) -#define CPU_FTR_COHERENT_ICACHE ASM_CONST(0x0000020000000000) +#define CPU_FTR_SMT ASM_CONST(0x0000010000000000) +#define CPU_FTR_COHERENT_ICACHE ASM_CONST(0x0000020000000000) #define CPU_FTR_LOCKLESS_TLBIE ASM_CONST(0x0000040000000000) #define CPU_FTR_MMCRA_SIHV ASM_CONST(0x0000080000000000) #define CPU_FTR_CI_LARGE_PAGE ASM_CONST(0x0000100000000000) @@ -116,15 +116,15 @@ extern void do_cpu_ftr_fixups(unsigned l #else /* ensure on 32b processors the flags are available for compiling but * don't do anything */ -#define CPU_FTR_SLB ASM_CONST(0x0) -#define CPU_FTR_16M_PAGE ASM_CONST(0x0) -#define CPU_FTR_TLBIEL ASM_CONST(0x0) -#define CPU_FTR_NOEXECUTE ASM_CONST(0x0) -#define CPU_FTR_IABR ASM_CONST(0x0) -#define CPU_FTR_MMCRA ASM_CONST(0x0) +#define CPU_FTR_SLB ASM_CONST(0x0) +#define CPU_FTR_16M_PAGE ASM_CONST(0x0) +#define CPU_FTR_TLBIEL ASM_CONST(0x0) +#define CPU_FTR_NOEXECUTE ASM_CONST(0x0) +#define CPU_FTR_IABR ASM_CONST(0x0) +#define CPU_FTR_MMCRA ASM_CONST(0x0) #define CPU_FTR_CTRL ASM_CONST(0x0) -#define CPU_FTR_SMT ASM_CONST(0x0) -#define CPU_FTR_COHERENT_ICACHE ASM_CONST(0x0) +#define CPU_FTR_SMT ASM_CONST(0x0) +#define CPU_FTR_COHERENT_ICACHE ASM_CONST(0x0) #define CPU_FTR_LOCKLESS_TLBIE ASM_CONST(0x0) #define CPU_FTR_MMCRA_SIHV ASM_CONST(0x0) #define CPU_FTR_CI_LARGE_PAGE ASM_CONST(0x0) From michael at ellerman.id.au Fri Jan 13 17:46:58 2006 From: michael at ellerman.id.au (Michael Ellerman) Date: Fri, 13 Jan 2006 17:46:58 +1100 Subject: [PATCH 5/10] powerpc: iSeries mf related cleanups In-Reply-To: <1137134815.491678.995063725775.qpush@concordia> Message-ID: <20060113064708.7B86F689D3@ozlabs.org> Some cleanups in the iSeries code. - Make mf_display_progress() check mf_initialized rather than the caller. - Set mf_initialized in mf_init() rather than in setup.c - Then move mf_initialized into mf.c, the only place it's used. - Move the mf related logic from iSeries_progress() to mf_display_progress() - Use a #define to size the pending_event_prealloc array - Use that define in the initialsation loop rather than sizeof jiggery pokery - Remove stupid comment(s) - Mark stuff static and/or __init Signed-off-by: Michael Ellerman --- arch/powerpc/platforms/iseries/mf.c | 32 +++++++++++++++++++++++--------- arch/powerpc/platforms/iseries/setup.c | 11 +---------- include/asm-powerpc/iseries/mf.h | 1 - 3 files changed, 24 insertions(+), 20 deletions(-) Index: linux/arch/powerpc/platforms/iseries/mf.c =================================================================== --- linux.orig/arch/powerpc/platforms/iseries/mf.c +++ linux/arch/powerpc/platforms/iseries/mf.c @@ -46,6 +46,7 @@ #include "setup.h" extern int piranha_simulator; +static int mf_initialized = 0; /* * This is the structure layout for the Machine Facilites LPAR event @@ -143,7 +144,8 @@ static spinlock_t pending_event_spinlock static struct pending_event *pending_event_head; static struct pending_event *pending_event_tail; static struct pending_event *pending_event_avail; -static struct pending_event pending_event_prealloc[16]; +#define PENDING_EVENT_PREALLOC_LEN 16 +static struct pending_event pending_event_prealloc[PENDING_EVENT_PREALLOC_LEN]; /* * Put a pending event onto the available queue, so it can get reused. @@ -625,7 +627,7 @@ void mf_display_src(u32 word) /* * Display a single word SRC of the form "PROGXXXX" on the VSP control panel. */ -void mf_display_progress(u16 value) +static __init void mf_display_progress_src(u16 value) { u8 ce[12]; u8 src[72]; @@ -649,30 +651,42 @@ void mf_display_progress(u16 value) * Clear the VSP control panel. Used to "erase" an SRC that was * previously displayed. */ -void mf_clear_src(void) +static void mf_clear_src(void) { signal_ce_msg_simple(0x4b, NULL); } +void __init mf_display_progress(u16 value) +{ + if (piranha_simulator || !mf_initialized) + return; + + if (0xFFFF == value) + mf_clear_src(); + else + mf_display_progress_src(value); +} + /* * Initialization code here. */ -void mf_init(void) +void __init mf_init(void) { int i; - /* initialize */ spin_lock_init(&pending_event_spinlock); - for (i = 0; - i < sizeof(pending_event_prealloc) / sizeof(*pending_event_prealloc); - ++i) + + for (i = 0; i < PENDING_EVENT_PREALLOC_LEN; i++) free_pending_event(&pending_event_prealloc[i]); + HvLpEvent_registerHandler(HvLpEvent_Type_MachineFac, &hv_handler); /* virtual continue ack */ signal_ce_msg_simple(0x57, NULL); - /* initialization complete */ + mf_initialized = 1; + mb(); + printk(KERN_NOTICE "mf.c: iSeries Linux LPAR Machine Facilities " "initialized\n"); } Index: linux/arch/powerpc/platforms/iseries/setup.c =================================================================== --- linux.orig/arch/powerpc/platforms/iseries/setup.c +++ linux/arch/powerpc/platforms/iseries/setup.c @@ -89,8 +89,6 @@ extern unsigned long embedded_sysmap_end extern unsigned long iSeries_recal_tb; extern unsigned long iSeries_recal_titan; -static int mf_initialized; - static unsigned long cmd_mem_limit; struct MemoryBlock { @@ -347,8 +345,6 @@ static void __init iSeries_init_early(vo HvCallEvent_setLpEventQueueInterruptProc(0, 0); mf_init(); - mf_initialized = 1; - mb(); /* If we were passed an initrd, set the ROOT_DEV properly if the values * look sensible. If not, clear initrd reference. @@ -585,12 +581,7 @@ static void iSeries_halt(void) static void __init iSeries_progress(char * st, unsigned short code) { printk("Progress: [%04x] - %s\n", (unsigned)code, st); - if (!piranha_simulator && mf_initialized) { - if (code != 0xffff) - mf_display_progress(code); - else - mf_clear_src(); - } + mf_display_progress(code); } static void __init iSeries_fixup_klimit(void) Index: linux/include/asm-powerpc/iseries/mf.h =================================================================== --- linux.orig/include/asm-powerpc/iseries/mf.h +++ linux/include/asm-powerpc/iseries/mf.h @@ -45,7 +45,6 @@ extern void mf_reboot(void); extern void mf_display_src(u32 word); extern void mf_display_progress(u16 value); -extern void mf_clear_src(void); extern void mf_init(void); From michael at ellerman.id.au Fri Jan 13 17:46:59 2006 From: michael at ellerman.id.au (Michael Ellerman) Date: Fri, 13 Jan 2006 17:46:59 +1100 Subject: [PATCH 6/10] powerpc: Remove pointless iSeries_(restart|power_off|halt) In-Reply-To: <1137134815.491678.995063725775.qpush@concordia> Message-ID: <20060113064709.8B3BF689C4@ozlabs.org> These routines just call through to the mf routines, so point ppc_md straight at the mf routines. We need to pass the cmd through to mf_reboot to make it work, but that seems reasonable. Signed-off-by: Michael Ellerman --- arch/powerpc/platforms/iseries/mf.c | 2 +- arch/powerpc/platforms/iseries/setup.c | 30 +++--------------------------- include/asm-powerpc/iseries/mf.h | 2 +- 3 files changed, 5 insertions(+), 29 deletions(-) Index: linux/arch/powerpc/platforms/iseries/setup.c =================================================================== --- linux.orig/arch/powerpc/platforms/iseries/setup.c +++ linux/arch/powerpc/platforms/iseries/setup.c @@ -554,30 +554,6 @@ static void iSeries_show_cpuinfo(struct seq_printf(m, "machine\t\t: 64-bit iSeries Logical Partition\n"); } -/* - * Document me. - */ -static void iSeries_restart(char *cmd) -{ - mf_reboot(); -} - -/* - * Document me. - */ -static void iSeries_power_off(void) -{ - mf_power_off(); -} - -/* - * Document me. - */ -static void iSeries_halt(void) -{ - mf_power_off(); -} - static void __init iSeries_progress(char * st, unsigned short code) { printk("Progress: [%04x] - %s\n", (unsigned)code, st); @@ -715,9 +691,9 @@ struct machdep_calls __initdata iseries_ .get_irq = iSeries_get_irq, .init_early = iSeries_init_early, .pcibios_fixup = iSeries_pci_final_fixup, - .restart = iSeries_restart, - .power_off = iSeries_power_off, - .halt = iSeries_halt, + .restart = mf_reboot, + .power_off = mf_power_off, + .halt = mf_power_off, .get_boot_time = iSeries_get_boot_time, .set_rtc_time = iSeries_set_rtc_time, .get_rtc_time = iSeries_get_rtc_time, Index: linux/arch/powerpc/platforms/iseries/mf.c =================================================================== --- linux.orig/arch/powerpc/platforms/iseries/mf.c +++ linux/arch/powerpc/platforms/iseries/mf.c @@ -599,7 +599,7 @@ void mf_power_off(void) * Global kernel interface to tell the VSP object in the primary * partition to reboot this partition. */ -void mf_reboot(void) +void mf_reboot(char *cmd) { printk(KERN_INFO "mf.c: Preparing to bounce...\n"); signal_ce_msg_simple(0x4e, NULL); Index: linux/include/asm-powerpc/iseries/mf.h =================================================================== --- linux.orig/include/asm-powerpc/iseries/mf.h +++ linux/include/asm-powerpc/iseries/mf.h @@ -41,7 +41,7 @@ extern void mf_deallocate_lp_events(HvLp unsigned count, MFCompleteHandler hdlr, void *userToken); extern void mf_power_off(void); -extern void mf_reboot(void); +extern void mf_reboot(char *cmd); extern void mf_display_src(u32 word); extern void mf_display_progress(u16 value); From michael at ellerman.id.au Fri Jan 13 17:47:00 2006 From: michael at ellerman.id.au (Michael Ellerman) Date: Fri, 13 Jan 2006 17:47:00 +1100 Subject: [PATCH 7/10] powerpc: Make more stuff static in platforms/iseries/mf.c In-Reply-To: <1137134815.491678.995063725775.qpush@concordia> Message-ID: <20060113064710.DD42E689D0@ozlabs.org> Make mf_get_rtc(), mf_get_boot_rtc() and mf_set_rtc() static, cause they can be. We need to move mf_set_rtc() to avoid a forward decleration. Signed-off-by: Michael Ellerman --- arch/powerpc/platforms/iseries/mf.c | 78 ++++++++++++++++++------------------ include/asm-powerpc/iseries/mf.h | 4 - 2 files changed, 39 insertions(+), 43 deletions(-) Index: linux/arch/powerpc/platforms/iseries/mf.c =================================================================== --- linux.orig/arch/powerpc/platforms/iseries/mf.c +++ linux/arch/powerpc/platforms/iseries/mf.c @@ -706,6 +706,43 @@ static void get_rtc_time_complete(void * complete(&rtc->com); } +static int mf_set_rtc(struct rtc_time *tm) +{ + char ce_time[12]; + u8 day, mon, hour, min, sec, y1, y2; + unsigned year; + + year = 1900 + tm->tm_year; + y1 = year / 100; + y2 = year % 100; + + sec = tm->tm_sec; + min = tm->tm_min; + hour = tm->tm_hour; + day = tm->tm_mday; + mon = tm->tm_mon + 1; + + BIN_TO_BCD(sec); + BIN_TO_BCD(min); + BIN_TO_BCD(hour); + BIN_TO_BCD(mon); + BIN_TO_BCD(day); + BIN_TO_BCD(y1); + BIN_TO_BCD(y2); + + memset(ce_time, 0, sizeof(ce_time)); + ce_time[3] = 0x41; + ce_time[4] = y1; + ce_time[5] = y2; + ce_time[6] = sec; + ce_time[7] = min; + ce_time[8] = hour; + ce_time[10] = day; + ce_time[11] = mon; + + return signal_ce_msg(ce_time, NULL); +} + static int rtc_set_tm(int rc, u8 *ce_msg, struct rtc_time *tm) { tm->tm_wday = 0; @@ -761,7 +798,7 @@ static int rtc_set_tm(int rc, u8 *ce_msg return 0; } -int mf_get_rtc(struct rtc_time *tm) +static int mf_get_rtc(struct rtc_time *tm) { struct ce_msg_comp_data ce_complete; struct rtc_time_data rtc_data; @@ -794,7 +831,7 @@ static void get_boot_rtc_time_complete(v rtc->busy = 0; } -int mf_get_boot_rtc(struct rtc_time *tm) +static int mf_get_boot_rtc(struct rtc_time *tm) { struct ce_msg_comp_data ce_complete; struct boot_rtc_time_data rtc_data; @@ -816,43 +853,6 @@ int mf_get_boot_rtc(struct rtc_time *tm) return rtc_set_tm(rtc_data.rc, rtc_data.ce_msg.ce_msg, tm); } -int mf_set_rtc(struct rtc_time *tm) -{ - char ce_time[12]; - u8 day, mon, hour, min, sec, y1, y2; - unsigned year; - - year = 1900 + tm->tm_year; - y1 = year / 100; - y2 = year % 100; - - sec = tm->tm_sec; - min = tm->tm_min; - hour = tm->tm_hour; - day = tm->tm_mday; - mon = tm->tm_mon + 1; - - BIN_TO_BCD(sec); - BIN_TO_BCD(min); - BIN_TO_BCD(hour); - BIN_TO_BCD(mon); - BIN_TO_BCD(day); - BIN_TO_BCD(y1); - BIN_TO_BCD(y2); - - memset(ce_time, 0, sizeof(ce_time)); - ce_time[3] = 0x41; - ce_time[4] = y1; - ce_time[5] = y2; - ce_time[6] = sec; - ce_time[7] = min; - ce_time[8] = hour; - ce_time[10] = day; - ce_time[11] = mon; - - return signal_ce_msg(ce_time, NULL); -} - #ifdef CONFIG_PROC_FS static int proc_mf_dump_cmdline(char *page, char **start, off_t off, Index: linux/include/asm-powerpc/iseries/mf.h =================================================================== --- linux.orig/include/asm-powerpc/iseries/mf.h +++ linux/include/asm-powerpc/iseries/mf.h @@ -48,8 +48,4 @@ extern void mf_display_progress(u16 valu extern void mf_init(void); -extern int mf_get_rtc(struct rtc_time *tm); -extern int mf_get_boot_rtc(struct rtc_time *tm); -extern int mf_set_rtc(struct rtc_time *tm); - #endif /* _ASM_POWERPC_ISERIES_MF_H */ From michael at ellerman.id.au Fri Jan 13 17:47:01 2006 From: michael at ellerman.id.au (Michael Ellerman) Date: Fri, 13 Jan 2006 17:47:01 +1100 Subject: [PATCH 8/10] powerpc: Move create_(instruction|branch|function_call) into util.h In-Reply-To: <1137134815.491678.995063725775.qpush@concordia> Message-ID: <20060113064711.01175689D3@ozlabs.org> These functions don't really belong in system.h, and they can't be there if the next patch is going to work. So create util.h for them, a bit icky I admit. Signed-off-by: Michael Ellerman --- arch/powerpc/kernel/crash_dump.c | 1 include/asm-powerpc/system.h | 48 --------------------------------- include/asm-powerpc/util.h | 56 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 57 insertions(+), 48 deletions(-) Index: linux/include/asm-powerpc/system.h =================================================================== --- linux.orig/include/asm-powerpc/system.h +++ linux/include/asm-powerpc/system.h @@ -366,53 +366,5 @@ extern void reloc_got2(unsigned long); #define PTRRELOC(x) ((typeof(x)) add_reloc_offset((unsigned long)(x))) -static inline void create_instruction(unsigned long addr, unsigned int instr) -{ - unsigned int *p; - p = (unsigned int *)addr; - *p = instr; - asm ("dcbst 0, %0; sync; icbi 0,%0; sync; isync" : : "r" (p)); -} - -/* Flags for create_branch: - * "b" == create_branch(addr, target, 0); - * "ba" == create_branch(addr, target, BRANCH_ABSOLUTE); - * "bl" == create_branch(addr, target, BRANCH_SET_LINK); - * "bla" == create_branch(addr, target, BRANCH_ABSOLUTE | BRANCH_SET_LINK); - */ -#define BRANCH_SET_LINK 0x1 -#define BRANCH_ABSOLUTE 0x2 - -static inline void create_branch(unsigned long addr, - unsigned long target, int flags) -{ - unsigned int instruction; - - if (! (flags & BRANCH_ABSOLUTE)) - target = target - addr; - - /* Mask out the flags and target, so they don't step on each other. */ - instruction = 0x48000000 | (flags & 0x3) | (target & 0x03FFFFFC); - - create_instruction(addr, instruction); -} - -static inline void create_function_call(unsigned long addr, void * func) -{ - unsigned long func_addr; - -#ifdef CONFIG_PPC64 - /* - * On PPC64 the function pointer actually points to the function's - * descriptor. The first entry in the descriptor is the address - * of the function text. - */ - func_addr = *(unsigned long *)func; -#else - func_addr = (unsigned long)func; -#endif - create_branch(addr, func_addr, BRANCH_SET_LINK); -} - #endif /* __KERNEL__ */ #endif /* _ASM_POWERPC_SYSTEM_H */ Index: linux/include/asm-powerpc/util.h =================================================================== --- /dev/null +++ linux/include/asm-powerpc/util.h @@ -0,0 +1,56 @@ +/* + * Copyright (C) 2005,2006 IBM Corporation. + */ + +#ifndef _ASM_POWERPC_UTIL_H +#define _ASM_POWERPC_UTIL_H + +static inline void create_instruction(unsigned long addr, unsigned int instr) +{ + unsigned int *p; + p = (unsigned int *)addr; + *p = instr; + asm ("dcbst 0, %0; sync; icbi 0,%0; sync; isync" : : "r" (p)); +} + +/* Flags for create_branch: + * "b" == create_branch(addr, target, 0); + * "ba" == create_branch(addr, target, BRANCH_ABSOLUTE); + * "bl" == create_branch(addr, target, BRANCH_SET_LINK); + * "bla" == create_branch(addr, target, BRANCH_ABSOLUTE | BRANCH_SET_LINK); + */ +#define BRANCH_SET_LINK 0x1 +#define BRANCH_ABSOLUTE 0x2 + +static inline void create_branch(unsigned long addr, + unsigned long target, int flags) +{ + unsigned int instruction; + + if (! (flags & BRANCH_ABSOLUTE)) + target = target - addr; + + /* Mask out the flags and target, so they don't step on each other. */ + instruction = 0x48000000 | (flags & 0x3) | (target & 0x03FFFFFC); + + create_instruction(addr, instruction); +} + +static inline void create_function_call(unsigned long addr, void * func) +{ + unsigned long func_addr; + +#ifdef CONFIG_PPC64 + /* + * On PPC64 the function pointer actually points to the function's + * descriptor. The first entry in the descriptor is the address + * of the function text. + */ + func_addr = *(unsigned long *)func; +#else + func_addr = (unsigned long)func; +#endif + create_branch(addr, func_addr, BRANCH_SET_LINK); +} + +#endif /* _ASM_POWERPC_UTIL_H */ Index: linux/arch/powerpc/kernel/crash_dump.c =================================================================== --- linux.orig/arch/powerpc/kernel/crash_dump.c +++ linux/arch/powerpc/kernel/crash_dump.c @@ -17,6 +17,7 @@ #include #include #include +#include #ifdef DEBUG #include From michael at ellerman.id.au Fri Jan 13 17:47:02 2006 From: michael at ellerman.id.au (Michael Ellerman) Date: Fri, 13 Jan 2006 17:47:02 +1100 Subject: [PATCH 9/10] powerpc: Use flush_icache_range() in create_instruction() In-Reply-To: <1137134815.491678.995063725775.qpush@concordia> Message-ID: <20060113064713.0A920689E5@ozlabs.org> Now that ppc64_caches is setup with default values, we can call flush_icache_range() from create_instruction() rather than using our own asm version. Signed-off-by: Michael Ellerman --- include/asm-powerpc/util.h | 4 +++- 1 files changed, 3 insertions(+), 1 deletion(-) Index: linux/include/asm-powerpc/util.h =================================================================== --- linux.orig/include/asm-powerpc/util.h +++ linux/include/asm-powerpc/util.h @@ -5,12 +5,14 @@ #ifndef _ASM_POWERPC_UTIL_H #define _ASM_POWERPC_UTIL_H +#include + static inline void create_instruction(unsigned long addr, unsigned int instr) { unsigned int *p; p = (unsigned int *)addr; *p = instr; - asm ("dcbst 0, %0; sync; icbi 0,%0; sync; isync" : : "r" (p)); + flush_icache_range(addr, addr + 4); } /* Flags for create_branch: From michael at ellerman.id.au Fri Jan 13 17:47:04 2006 From: michael at ellerman.id.au (Michael Ellerman) Date: Fri, 13 Jan 2006 17:47:04 +1100 Subject: [PATCH 10/10] powerpc: Replace calls to make_bl() with create_function_call() In-Reply-To: <1137134815.491678.995063725775.qpush@concordia> Message-ID: <20060113064715.2A246689EF@ozlabs.org> Now that we create_function_call() we can remove make_bl() in hash_utils_64.c To make this cleaner we change create_function_call a little, we're the only caller. Signed-off-by: Michael Ellerman --- arch/powerpc/mm/hash_utils_64.c | 27 +++++++++------------------ include/asm-powerpc/util.h | 4 ++-- 2 files changed, 11 insertions(+), 20 deletions(-) Index: linux/arch/powerpc/mm/hash_utils_64.c =================================================================== --- linux.orig/arch/powerpc/mm/hash_utils_64.c +++ linux/arch/powerpc/mm/hash_utils_64.c @@ -52,6 +52,7 @@ #include #include #include +#include #ifdef DEBUG #define DBG(fmt...) udbg_printf(fmt) @@ -721,16 +722,6 @@ void flush_hash_range(unsigned long numb } } -static inline void make_bl(unsigned int *insn_addr, void *func) -{ - unsigned long funcp = *((unsigned long *)func); - int offset = funcp - (unsigned long)insn_addr; - - *insn_addr = (unsigned int)(0x48000001 | (offset & 0x03fffffc)); - flush_icache_range((unsigned long)insn_addr, 4+ - (unsigned long)insn_addr); -} - /* * low_hash_fault is called when we the low level hash code failed * to instert a PTE due to an hypervisor error @@ -763,14 +754,14 @@ void __init htab_finish_init(void) extern unsigned int *ht64_call_hpte_remove; extern unsigned int *ht64_call_hpte_updatepp; - make_bl(ht64_call_hpte_insert1, ppc_md.hpte_insert); - make_bl(ht64_call_hpte_insert2, ppc_md.hpte_insert); - make_bl(ht64_call_hpte_remove, ppc_md.hpte_remove); - make_bl(ht64_call_hpte_updatepp, ppc_md.hpte_updatepp); + create_function_call(ht64_call_hpte_insert1, ppc_md.hpte_insert); + create_function_call(ht64_call_hpte_insert2, ppc_md.hpte_insert); + create_function_call(ht64_call_hpte_remove, ppc_md.hpte_remove); + create_function_call(ht64_call_hpte_updatepp, ppc_md.hpte_updatepp); #endif /* CONFIG_PPC_64K_PAGES */ - make_bl(htab_call_hpte_insert1, ppc_md.hpte_insert); - make_bl(htab_call_hpte_insert2, ppc_md.hpte_insert); - make_bl(htab_call_hpte_remove, ppc_md.hpte_remove); - make_bl(htab_call_hpte_updatepp, ppc_md.hpte_updatepp); + create_function_call(htab_call_hpte_insert1, ppc_md.hpte_insert); + create_function_call(htab_call_hpte_insert2, ppc_md.hpte_insert); + create_function_call(htab_call_hpte_remove, ppc_md.hpte_remove); + create_function_call(htab_call_hpte_updatepp, ppc_md.hpte_updatepp); } Index: linux/include/asm-powerpc/util.h =================================================================== --- linux.orig/include/asm-powerpc/util.h +++ linux/include/asm-powerpc/util.h @@ -38,7 +38,7 @@ static inline void create_branch(unsigne create_instruction(addr, instruction); } -static inline void create_function_call(unsigned long addr, void * func) +static inline void create_function_call(void *addr, void *func) { unsigned long func_addr; @@ -52,7 +52,7 @@ static inline void create_function_call( #else func_addr = (unsigned long)func; #endif - create_branch(addr, func_addr, BRANCH_SET_LINK); + create_branch((unsigned long)addr, func_addr, BRANCH_SET_LINK); } #endif /* _ASM_POWERPC_UTIL_H */ From hch at lst.de Fri Jan 13 20:48:40 2006 From: hch at lst.de (Christoph Hellwig) Date: Fri, 13 Jan 2006 10:48:40 +0100 Subject: [PATCH] powerpc: reformat atomic_add_unless In-Reply-To: <20060113055152.GE26421@krispykreme> References: <20060113043839.GC26421@krispykreme> <20060113044906.GI2491@pb15.lixom.net> <20060113055152.GE26421@krispykreme> Message-ID: <20060113094840.GA26246@lst.de> On Fri, Jan 13, 2006 at 04:51:52PM +1100, Anton Blanchard wrote: > > > Much better, but that crazy double-tab-plus-a-few-spaces indentation > > itches a bit too. :-) > > Yuck, didnt notice that when I scanned through it. Any reasons this is not an inline function? From galak at gate.crashing.org Sat Jan 14 03:15:17 2006 From: galak at gate.crashing.org (Kumar Gala) Date: Fri, 13 Jan 2006 10:15:17 -0600 (CST) Subject: [PATCH] powerpc: Allow for ppc_md restart, power_off, and halt to be NULL Message-ID: On a number of embedded reference boards there isn't always a way to reset, power_off, or halt the board. Rather than having each board implement a spin loop just let the generic code do it. Signed-off-by: Kumar Gala --- commit be64cad3bdcae667f790fcf6f3e066be498baa83 tree 1437c325cfda412ded472c3dee505f81468f41b0 parent 66c0ddd1284ef56bfeb41374b51edfd0c8a980a8 author Kumar Gala Fri, 13 Jan 2006 09:46:28 -0600 committer Kumar Gala Fri, 13 Jan 2006 09:46:28 -0600 arch/powerpc/kernel/setup-common.c | 9 ++++++--- 1 files changed, 6 insertions(+), 3 deletions(-) diff --git a/arch/powerpc/kernel/setup-common.c b/arch/powerpc/kernel/setup-common.c index d5c52fa..be12041 100644 --- a/arch/powerpc/kernel/setup-common.c +++ b/arch/powerpc/kernel/setup-common.c @@ -100,7 +100,8 @@ void machine_shutdown(void) void machine_restart(char *cmd) { machine_shutdown(); - ppc_md.restart(cmd); + if (ppc_md.restart) + ppc_md.restart(cmd); #ifdef CONFIG_SMP smp_send_stop(); #endif @@ -112,7 +113,8 @@ void machine_restart(char *cmd) void machine_power_off(void) { machine_shutdown(); - ppc_md.power_off(); + if (ppc_md.power_off) + ppc_md.power_off(); #ifdef CONFIG_SMP smp_send_stop(); #endif @@ -129,7 +131,8 @@ EXPORT_SYMBOL_GPL(pm_power_off); void machine_halt(void) { machine_shutdown(); - ppc_md.halt(); + if (ppc_md.halt) + ppc_md.halt(); #ifdef CONFIG_SMP smp_send_stop(); #endif From galak at gate.crashing.org Sat Jan 14 03:16:24 2006 From: galak at gate.crashing.org (Kumar Gala) Date: Fri, 13 Jan 2006 10:16:24 -0600 (CST) Subject: [PATCH] powerpc: Add CONFIG_DEFAULT_UIMAGE to build a uImage by default for a board Message-ID: Embedded boards that u-boot require a kernel image in the uImage format. This allows a given board to specify it wants a uImage built by default. Signed-off-by: Kumar Gala --- commit 461d4edf6f4a1950a94a190f1fc3a4b9e692453e tree 40b6d33d95a56e0bd8f71bb74320adb79c1fc5b2 parent be64cad3bdcae667f790fcf6f3e066be498baa83 author Kumar Gala Fri, 13 Jan 2006 09:56:34 -0600 committer Kumar Gala Fri, 13 Jan 2006 09:56:34 -0600 arch/powerpc/Kconfig | 6 ++++++ arch/powerpc/Makefile | 1 + 2 files changed, 7 insertions(+), 0 deletions(-) diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig index 01feed0..a8d2f2d 100644 --- a/arch/powerpc/Kconfig +++ b/arch/powerpc/Kconfig @@ -94,6 +94,12 @@ config GENERIC_TBSYNC default y if PPC32 && SMP default n +config DEFAULT_UIMAGE + bool + help + Used to allow a board to specify it wants a uImage built by default + default n + menu "Processor support" choice prompt "Processor Type" diff --git a/arch/powerpc/Makefile b/arch/powerpc/Makefile index d3654a2..63eeaee 100644 --- a/arch/powerpc/Makefile +++ b/arch/powerpc/Makefile @@ -142,6 +142,7 @@ drivers-$(CONFIG_OPROFILE) += arch/power defaultimage-$(CONFIG_PPC32) := zImage defaultimage-$(CONFIG_PPC_ISERIES) := vmlinux defaultimage-$(CONFIG_PPC_PSERIES) := zImage +defaultimage-$(CONFIG_DEFAULT_UIMAGE) := uImage KBUILD_IMAGE := $(defaultimage-y) all: $(KBUILD_IMAGE) From greg at kroah.com Sat Jan 14 04:21:08 2006 From: greg at kroah.com (Greg KH) Date: Fri, 13 Jan 2006 09:21:08 -0800 Subject: [PATCH 0/9] PCI powerpc hotplug/dlpar: remove dead/stale code In-Reply-To: <20060113001556.GX26221@austin.ibm.com> References: <20060113001556.GX26221@austin.ibm.com> Message-ID: <20060113172107.GA3569@kroah.com> On Thu, Jan 12, 2006 at 06:15:56PM -0600, linas wrote: > > The following series of patches remove a fair amount of > duplicated code fro the drivers/pci/hotplug/rpa*.c tree. > They've been tested at length, on one machine. > > Please apply. I've been treating John as the de-facto maintainer for this driver, so who are you addressing this to? John or me? John, do you still want to ack/nak every patch for this driver? Or can I take Linas's patches directly? thanks, greg k-h From arndb at de.ibm.com Sat Jan 14 05:30:33 2006 From: arndb at de.ibm.com (Arnd Bergmann) Date: Fri, 13 Jan 2006 13:30:33 -0500 Subject: [patch 0/8] systemsim and hvc_console patches Message-ID: <20060113183033.696401000@localhost> This is an attempt from me to get the hvc console patches that we have been discussing earlier and the slightly related systemsim patches from Eric's git tree into a formally correct shape for submission. The first hvc_console patch is the combined patch of Ryan's last submission and the base patch we have discussed last year. I have not taken much of a look into the systemsim device drivers themselves to see if they are any good and I realize that it is _very_ late for any new feature to get included into 2.6.16. Paul, please merge any of this that you feel comfortable with. The systemsim base patch and the hvc_console base patch are the only ones that other have dependencies on, any other one can be left out if it is not good enough. Arnd <>< From arndb at de.ibm.com Sat Jan 14 05:30:35 2006 From: arndb at de.ibm.com (Arnd Bergmann) Date: Fri, 13 Jan 2006 13:30:35 -0500 Subject: [patch 2/8] powerpc: systemsim block device driver References: <20060113183033.696401000@localhost> Message-ID: <20060113183958.994894000@localhost> An embedded and charset-unspecified text was scrubbed... Name: systemsim-block.diff Url: http://ozlabs.org/pipermail/linuxppc64-dev/attachments/20060113/0d6dc1db/attachment.txt From arndb at de.ibm.com Sat Jan 14 05:41:16 2006 From: arndb at de.ibm.com (Arnd Bergmann) Date: Fri, 13 Jan 2006 13:41:16 -0500 Subject: [patch 3/8] powerpc: cpu_idle implementation for systemsim References: <20060113183033.696401000@localhost> Message-ID: <200601131841.16940.arndb@de.ibm.com> The original cpu_idle hack from the systemsim git tree is a bit strange, because it unconditionally changes the native_idle function. This one instead introduces a new idle implementation that is only used on systemsim. Signed-off-by: Arnd Bergmann Index: linux-2.6.16-rc/arch/powerpc/Kconfig =================================================================== --- linux-2.6.16-rc.orig/arch/powerpc/Kconfig +++ linux-2.6.16-rc/arch/powerpc/Kconfig @@ -380,6 +380,15 @@ config PPC_SYSTEMSIM The Full system simulator is available for download from http://www.alphaworks.ibm.com/tech/. +config SYSTEMSIM_IDLE + bool " Optimized idle loop for systemsim" + depends on PPC_SYSTEMSIM + help + Selecting this option will enable an more optimized idle loop + for running on the IBM Full System Simulator that + significantly reduces the load on the host system when + simulating an idle system. + config XICS depends on PPC_PSERIES bool Index: linux-2.6.16-rc/arch/powerpc/kernel/setup_64.c =================================================================== --- linux-2.6.16-rc.orig/arch/powerpc/kernel/setup_64.c +++ linux-2.6.16-rc/arch/powerpc/kernel/setup_64.c @@ -554,6 +554,23 @@ static void __init emergency_stack_init( } /* + * Detect if we are running on top of the IBM Full System Simulator. + * If we are, use the optimized idle loop for that case. + */ +static void __init setup_systemsim_idle(void) +{ +#ifdef CONFIG_SYSTEMSIM_IDLE + struct device_node *mambo_node; + + mambo_node = of_find_node_by_path("/mambo"); + if (mambo_node) { + ppc_md.idle_loop = systemsim_idle; + of_node_put(mambo_node); + } +#endif +} + +/* * Called into from start_kernel, after lock_kernel has been called. * Initializes bootmem, which is unsed to manage page allocation until * mem_init is called. @@ -600,6 +617,8 @@ void __init setup_arch(char **cmdline_p) ppc_md.setup_arch(); + setup_systemsim_idle(); + /* Use the default idle loop if the platform hasn't provided one. */ if (NULL == ppc_md.idle_loop) { ppc_md.idle_loop = default_idle; Index: linux-2.6.16-rc/include/asm-powerpc/machdep.h =================================================================== --- linux-2.6.16-rc.orig/include/asm-powerpc/machdep.h +++ linux-2.6.16-rc/include/asm-powerpc/machdep.h @@ -244,6 +244,7 @@ struct machdep_calls { extern void default_idle(void); extern void native_idle(void); +extern void systemsim_idle(void); extern struct machdep_calls ppc_md; extern char cmd_line[COMMAND_LINE_SIZE]; Index: linux-2.6.16-rc/arch/powerpc/kernel/idle_systemsim.c =================================================================== --- /dev/null +++ linux-2.6.16-rc/arch/powerpc/kernel/idle_systemsim.c @@ -0,0 +1,35 @@ +/* + * Idle daemon for the IBM Full System Simulator. + * + * Originally Written by Cort Dougan (cort at cs.nmt.edu) + * Copyright (c) 2003-2006 IBM Corporation + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version + * 2 of the License, or (at your option) any later version. + */ + +#include +#include + +#include + +#define SIM_HALT_CODE 126 + +static inline void systemsim_halt(void) +{ + callthru0(SIM_HALT_CODE); +} + +void systemsim_idle(void) +{ + while (1) { + while (!need_resched()) + systemsim_halt(); + + preempt_enable_no_resched(); + schedule(); + preempt_disable(); + } +} Index: linux-2.6.16-rc/arch/powerpc/kernel/Makefile =================================================================== --- linux-2.6.16-rc.orig/arch/powerpc/kernel/Makefile +++ linux-2.6.16-rc/arch/powerpc/kernel/Makefile @@ -21,6 +21,7 @@ obj-$(CONFIG_PPC64) += setup_64.o binfm obj-$(CONFIG_PPC64) += vdso64/ obj-$(CONFIG_ALTIVEC) += vecemu.o vector.o obj-$(CONFIG_POWER4) += idle_power4.o +obj-$(CONFIG_SYSTEMSIM_IDLE) += idle_systemsim.o obj-$(CONFIG_PPC_OF) += of_device.o prom_parse.o procfs-$(CONFIG_PPC64) := proc_ppc64.o obj-$(CONFIG_PROC_FS) += $(procfs-y) -- From arndb at de.ibm.com Sat Jan 14 05:30:37 2006 From: arndb at de.ibm.com (Arnd Bergmann) Date: Fri, 13 Jan 2006 13:30:37 -0500 Subject: [patch 4/8] powerpc: systemsim network driver References: <20060113183033.696401000@localhost> Message-ID: <20060113183959.342152000@localhost> An embedded and charset-unspecified text was scrubbed... Name: systemsim-net.diff Url: http://ozlabs.org/pipermail/linuxppc64-dev/attachments/20060113/ea26b11e/attachment.txt From arndb at de.ibm.com Sat Jan 14 05:41:32 2006 From: arndb at de.ibm.com (Arnd Bergmann) Date: Fri, 13 Jan 2006 13:41:32 -0500 Subject: [patch 7/8] powerpc: hvc backend for systemsim References: <20060113183033.696401000@localhost> Message-ID: <200601131841.33259.arndb@de.ibm.com> The IBM full system simulator for PowerPC has its own set of calls used for console interaction, when not simulating actual serial port hardware. This is needed to run the simulator for Cell and can also be used for the PowerPC 970 simulator. It also adds the generic asm/systemsim.h header file that is also used by other device drivers for the system simulator, i.e. the block and network drivers. Signed-off-by: "Ryan S. Arnold" Signed-off-by: Arnd Bergmann Index: linux-2.6.16-rc/drivers/char/hvc_fss.c =================================================================== --- /dev/null +++ linux-2.6.16-rc/drivers/char/hvc_fss.c @@ -0,0 +1,109 @@ +/* + * IBM Full System Simulator driver interface to hvc_console.c + * + * (C) Copyright IBM Corporation 2001-2005 + * Author(s): Maximino Augilar + * : Ryan S. Arnold + * + * inspired by drivers/char/hvc_console.c + * written by Anton Blanchard and Paul Mackerras + * + * Some code is from the IBM Full System Simulator Group in ARL. + * Author: Patrick Bohrer + * + * Much of this code was moved here from the IBM Full System Simulator + * Bogus console driver in order to reuse the framework provided by the hvc + * console driver. Ryan S. Arnold + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#include +#include +#include +#include + +#include +#include +#include + +#include "hvc_console.h" + +#define SIM_WRITE_CONSOLE_CODE 0 +#define SIM_READ_CONSOLE_CODE 60 + +#define hvc_fss_cookie 0x1aa70e29 + +static int hvc_fss_write_console(uint32_t vtermno, const char *buf, int count) +{ + int ret; + ret = callthru3(SIM_WRITE_CONSOLE_CODE, (unsigned long)buf, count, 1); + if (ret != 0) + return (count - ret); /* is this right? */ + + /* the calling routine expects to receive the number of bytes sent */ + return count; +} + +static int hvc_fss_read_console(uint32_t vtermno, char *buf, int count) +{ + unsigned long got; + int c, i; + + got = 0; + for (i = 0; i < count; i++) { + if ((c = callthru0(SIM_READ_CONSOLE_CODE)) != -1) { + buf[i] = c; + ++got; + } + else + break; + } + return got; +} + +static struct hv_ops hvc_fss_get_put_ops = { + .get_chars = hvc_fss_read_console, + .put_chars = hvc_fss_write_console, +}; + +static int __init hvc_fss_init(void) +{ + struct hvc_struct *hp; + + /* Allocate an hvc_struct for the console device we instantiated + * earlier. Save off hp so that we can return it on exit */ + hp = hvc_alloc(hvc_fss_cookie, NO_IRQ, &hvc_fss_get_put_ops); + if (IS_ERR(hp)) + return PTR_ERR(hp); + + return 0; +} +module_init(hvc_fss_init); + +/* This will happen prior to module init. There is no tty at this time? */ +static int __init hvc_fss_console_init(void) +{ + /* Don't register if we aren't running on the simulator */ + if (of_find_node_by_path("/mambo")) { + /* Tell the driver we know of one console device. We + * shouldn't get a collision on the index as long as no-one + * else instantiates on hardware they don't have. */ + hvc_instantiate(hvc_fss_cookie, 0, &hvc_fss_get_put_ops ); + add_preferred_console("hvc", 0, NULL); + } + return 0; +} +console_initcall(hvc_fss_console_init); Index: linux-2.6.16-rc/drivers/char/Kconfig =================================================================== --- linux-2.6.16-rc.orig/drivers/char/Kconfig +++ linux-2.6.16-rc/drivers/char/Kconfig @@ -578,6 +578,14 @@ config HVC_CONSOLE console. This driver allows each pSeries partition to have a console which is accessed via the HMC. +config HVC_FSS + bool "IBM Full System Simulator Console support" + depends on PPC_SYSTEMSIM + select HVC_DRIVER + help + IBM Full System Simulator Console device driver which makes use of + the HVC_DRIVER front end. + config HVCS tristate "IBM Hypervisor Virtual Console Server support" depends on PPC_PSERIES Index: linux-2.6.16-rc/drivers/char/Makefile =================================================================== --- linux-2.6.16-rc.orig/drivers/char/Makefile +++ linux-2.6.16-rc/drivers/char/Makefile @@ -43,6 +43,7 @@ obj-$(CONFIG_SX) += sx.o generic_serial obj-$(CONFIG_RIO) += rio/ generic_serial.o obj-$(CONFIG_HVC_DRIVER) += hvc_console.o obj-$(CONFIG_HVC_CONSOLE) += hvc_vio.o hvsi.o +obj-$(CONFIG_HVC_FSS) += hvc_fss.o obj-$(CONFIG_RAW_DRIVER) += raw.o obj-$(CONFIG_SGI_SNSC) += snsc.o snsc_event.o obj-$(CONFIG_MMTIMER) += mmtimer.o -- From arndb at de.ibm.com Sat Jan 14 05:41:43 2006 From: arndb at de.ibm.com (Arnd Bergmann) Date: Fri, 13 Jan 2006 13:41:43 -0500 Subject: [patch 8/8] powerpc: hvc backend for rtas References: <20060113183033.696401000@localhost> Message-ID: <200601131841.43486.arndb@de.ibm.com> Current Cell hardware is using the console through a set of rtas calls. This driver is needed to get console output on those boards. Signed-off-by: Arnd Bergmann Index: linux-2.6.16-rc/drivers/char/hvc_rtas.c =================================================================== --- /dev/null +++ linux-2.6.16-rc/drivers/char/hvc_rtas.c @@ -0,0 +1,138 @@ +/* + * IBM RTAS driver interface to hvc_console.c + * + * (C) Copyright IBM Corporation 2001-2005 + * (C) Copyright Red Hat, Inc. 2005 + * + * Author(s): Maximino Augilar + * : Ryan S. Arnold + * : Utz Bacher + * : David Woodhouse + * + * inspired by drivers/char/hvc_console.c + * written by Anton Blanchard and Paul Mackerras + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#include +#include +#include +#include +#include +#include + +#include +#include +#include "hvc_console.h" + +#define hvc_rtas_cookie 0x67781e15 +struct hvc_struct *hvc_rtas_dev; + +#define RTASCONS_PUT_ATTEMPTS 16 + +static int rtascons_put_char_token = RTAS_UNKNOWN_SERVICE; +static int rtascons_get_char_token = RTAS_UNKNOWN_SERVICE; +static int rtascons_put_delay = 100; +module_param_named(put_delay, rtascons_put_delay, int, 0644); + +static inline int hvc_rtas_write_console(uint32_t vtermno, const char *buf, int count) +{ + int done; + + /* if there is more than one character to be displayed, wait a bit */ + for (done = 0; done < count; done++) { + int result; + result = rtas_call(rtascons_put_char_token, 1, 1, NULL, buf[done]); + if (result) + break; + } + /* the calling routine expects to receive the number of bytes sent */ + return done; +} + +static int hvc_rtas_read_console(uint32_t vtermno, char *buf, int count) +{ + int i; + + for (i = 0; i < count; i++) { + int c, err; + + err = rtas_call(rtascons_get_char_token, 0, 2, &c); + if (err) + break; + + buf[i] = c; + } + + return i; +} + +static struct hv_ops hvc_rtas_get_put_ops = { + .get_chars = hvc_rtas_read_console, + .put_chars = hvc_rtas_write_console, +}; + +static int hvc_rtas_init(void) +{ + struct hvc_struct *hp; + + if (rtascons_put_char_token == RTAS_UNKNOWN_SERVICE) + rtascons_put_char_token = rtas_token("put-term-char"); + if (rtascons_put_char_token == RTAS_UNKNOWN_SERVICE) + return -EIO; + + if (rtascons_get_char_token == RTAS_UNKNOWN_SERVICE) + rtascons_get_char_token = rtas_token("get-term-char"); + if (rtascons_get_char_token == RTAS_UNKNOWN_SERVICE) + return -EIO; + + BUG_ON(hvc_rtas_dev); + + /* Allocate an hvc_struct for the console device we instantiated + * earlier. Save off hp so that we can return it on exit */ + hp = hvc_alloc(hvc_rtas_cookie, NO_IRQ, &hvc_rtas_get_put_ops); + if (IS_ERR(hp)) + return PTR_ERR(hp); + hvc_rtas_dev = hp; + return 0; +} +module_init(hvc_rtas_init); + +/* This will tear down the tty portion of the driver */ +static void __exit hvc_rtas_exit(void) +{ + /* Really the fun isn't over until the worker thread breaks down and the + * tty cleans up */ + if (hvc_rtas_dev) + hvc_remove(hvc_rtas_dev); +} +module_exit(hvc_rtas_exit); /* before drivers/char/hvc_console.c */ + +/* This will happen prior to module init. There is no tty at this time? */ +static int hvc_rtas_console_init(void) +{ + rtascons_put_char_token = rtas_token("put-term-char"); + if (rtascons_put_char_token == RTAS_UNKNOWN_SERVICE) + return -EIO; + rtascons_get_char_token = rtas_token("get-term-char"); + if (rtascons_get_char_token == RTAS_UNKNOWN_SERVICE) + return -EIO; + + hvc_instantiate(hvc_rtas_cookie, 0, &hvc_rtas_get_put_ops ); + add_preferred_console("hvc", 0, NULL); + return 0; +} +console_initcall(hvc_rtas_console_init); Index: linux-2.6.16-rc/drivers/char/Makefile =================================================================== --- linux-2.6.16-rc.orig/drivers/char/Makefile +++ linux-2.6.16-rc/drivers/char/Makefile @@ -44,6 +44,7 @@ obj-$(CONFIG_RIO) += rio/ generic_seria obj-$(CONFIG_HVC_DRIVER) += hvc_console.o obj-$(CONFIG_HVC_CONSOLE) += hvc_vio.o hvsi.o obj-$(CONFIG_HVC_FSS) += hvc_fss.o +obj-$(CONFIG_HVC_RTAS) += hvc_rtas.o obj-$(CONFIG_RAW_DRIVER) += raw.o obj-$(CONFIG_SGI_SNSC) += snsc.o snsc_event.o obj-$(CONFIG_MMTIMER) += mmtimer.o Index: linux-2.6.16-rc/drivers/char/Kconfig =================================================================== --- linux-2.6.16-rc.orig/drivers/char/Kconfig +++ linux-2.6.16-rc/drivers/char/Kconfig @@ -586,6 +586,13 @@ config HVC_FSS IBM Full System Simulator Console device driver which makes use of the HVC_DRIVER front end. +config HVC_RTAS + bool "IBM RTAS Console support" + depends on PPC_RTAS + select HVC_DRIVER + help + IBM Console device driver which makes use of RTAS + config HVCS tristate "IBM Hypervisor Virtual Console Server support" depends on PPC_PSERIES -- From arndb at de.ibm.com Sat Jan 14 05:30:39 2006 From: arndb at de.ibm.com (Arnd Bergmann) Date: Fri, 13 Jan 2006 13:30:39 -0500 Subject: [patch 6/8] powerpc: hvc_console updates References: <20060113183033.696401000@localhost> Message-ID: <20060113183959.701185000@localhost> An embedded and charset-unspecified text was scrubbed... Name: hvc-console-rework-2.diff Url: http://ozlabs.org/pipermail/linuxppc64-dev/attachments/20060113/8bc8b907/attachment.txt From arndb at de.ibm.com Sat Jan 14 05:30:34 2006 From: arndb at de.ibm.com (Arnd Bergmann) Date: Fri, 13 Jan 2006 13:30:34 -0500 Subject: [patch 1/8] powerpc: basic systemsim support References: <20060113183033.696401000@localhost> Message-ID: <20060113183958.864972000@localhost> An embedded and charset-unspecified text was scrubbed... Name: systemsim-base.diff Url: http://ozlabs.org/pipermail/linuxppc64-dev/attachments/20060113/eb4deb3e/attachment.txt From arndb at de.ibm.com Sat Jan 14 05:30:38 2006 From: arndb at de.ibm.com (Arnd Bergmann) Date: Fri, 13 Jan 2006 13:30:38 -0500 Subject: [patch 5/8] powerpc: add systemsim_defconfig References: <20060113183033.696401000@localhost> Message-ID: <20060113183959.519047000@localhost> An embedded and charset-unspecified text was scrubbed... Name: systemsim-defconfig.diff Url: http://ozlabs.org/pipermail/linuxppc64-dev/attachments/20060113/0d997fce/attachment.txt From hch at lst.de Sat Jan 14 06:55:29 2006 From: hch at lst.de (Christoph Hellwig) Date: Fri, 13 Jan 2006 20:55:29 +0100 Subject: [patch 2/8] powerpc: systemsim block device driver In-Reply-To: <20060113183958.994894000@localhost> References: <20060113183033.696401000@localhost> <20060113183958.994894000@localhost> Message-ID: <20060113195529.GA5985@lst.de> On Fri, Jan 13, 2006 at 01:30:35PM -0500, Arnd Bergmann wrote: > The block device driver for systemsim is currently > required for running on the Cell systemsim port, which > does not simulate any other block devices. Umm, folks can we pleast stop adding virtual disk drivers? There's already two just for power systems from ibm. Why can't the cell system simulator implement the phyp vioscsi interface? Or at least a new small submodule for vioscsi. From hch at lst.de Sat Jan 14 06:55:49 2006 From: hch at lst.de (Christoph Hellwig) Date: Fri, 13 Jan 2006 20:55:49 +0100 Subject: [patch 4/8] powerpc: systemsim network driver In-Reply-To: <20060113183959.342152000@localhost> References: <20060113183033.696401000@localhost> <20060113183959.342152000@localhost> Message-ID: <20060113195549.GB5985@lst.de> On Fri, Jan 13, 2006 at 01:30:37PM -0500, Arnd Bergmann wrote: > This adds a simple network driver for virtual > networking on the IBM Full System Simulator. Dito for virtual network devices. From apw at shadowen.org Sat Jan 14 08:02:15 2006 From: apw at shadowen.org (Andy Whitcroft) Date: Fri, 13 Jan 2006 21:02:15 +0000 Subject: p650 console stopped working under 2.6.15-git6 Message-ID: <43C81557.3040808@shadowen.org> Somewhere between 2.6.15-git5 and 2.6.15-git6 the console for my p650 has stopped working, output stopping at the 'returning from prom_init' stage. Anyone got any clues? -apw From linas at austin.ibm.com Sat Jan 14 08:52:21 2006 From: linas at austin.ibm.com (linas) Date: Fri, 13 Jan 2006 15:52:21 -0600 Subject: powerpc: Cleanup LOADADDR etc. asm macros In-Reply-To: <20060113035625.GG22961@localhost.localdomain> References: <20060112232458.GB22961@localhost.localdomain> <20060113035625.GG22961@localhost.localdomain> Message-ID: <20060113215221.GJ26221@austin.ibm.com> Hi, On Fri, Jan 13, 2006 at 02:56:25PM +1100, David Gibson was heard to remark: > > to make it more obvious which is the appropriate one to use in a given > situation. ... > + * LOAD_REG_ADDR(rn, name) > + * Loads the address of label 'name' into register 'rn'. Use this when ... > -#define SET_REG_TO_LABEL(reg, label) \ Mabe its just me, but I do find the name "set reg to label" to be more intiuitive than "load reg addr". Something like "LOAD_ADDR_OF_LABEL" would have been nearly ideal. --linas From sleddog at us.ibm.com Sat Jan 14 09:03:31 2006 From: sleddog at us.ibm.com (Dave C Boutcher) Date: Fri, 13 Jan 2006 16:03:31 -0600 Subject: [PATCH] powerpc: special case ibm,suspend-me rtas call Message-ID: <20060113220331.GA13754@cs.umn.edu> Handle the ibm,suspend-me RTAS call specially. It needs to be wrapped in a set of synchronization hypervisor calls (H_Join). When the H_Join calls are made on all CPUs, the intent is that only one will return with H_Continue, meaning that he is the "last man standing". That CPU then issues the ibm,suspend-me call. What is interesting, of course, is that the CPU running when the rtas syscall is made, may NOT be the CPU that ultimately executes the ibm,suspend-me syscall. This is an alternative to a previous patch I submitted which issues the rtas call through a new (and thus evil) /proc file. I don't especially like adding special-case code to the rtas call path, but I don't like adding a /proc file either... Signed-off-by: Dave Boutcher diff -uNr -X exclude-files powerpc.git.patched2/arch/powerpc/kernel/rtas.c powerpc.git.vpm/arch/powerpc/kernel/rtas.c --- powerpc.git.patched2/arch/powerpc/kernel/rtas.c 2006-01-12 15:12:17.000000000 -0600 +++ powerpc.git.vpm/arch/powerpc/kernel/rtas.c 2006-01-13 15:53:37.000000000 -0600 @@ -34,6 +34,11 @@ .lock = SPIN_LOCK_UNLOCKED }; +struct rtas_suspend_me_data { + long waiting; + struct rtas_args *args; +}; + EXPORT_SYMBOL(rtas); DEFINE_SPINLOCK(rtas_data_buf_lock); @@ -549,6 +554,80 @@ } while (status == RTAS_BUSY); } +static int ibm_suspend_me_token = RTAS_UNKNOWN_SERVICE; +#ifdef CONFIG_PPC_PSERIES +static void rtas_percpu_suspend_me(void *info) +{ + long rc; + long flags; + struct rtas_suspend_me_data *data = + (struct rtas_suspend_me_data *)info; + + /* + * We use "waiting" to indicate our state. As long + * as it is >0, we are still trying to all join up. + * If it goes to 0, we have successfully joined up and + * one thread got H_Continue. If any error happens, + * we set it to <0; + */ + local_irq_save(flags); + do { + rc = plpar_hcall_norets(H_JOIN); + smp_rmb(); + } while (rc == H_Success && data->waiting > 0); + if (rc == H_Success) + goto out; + + if (rc == H_Continue) { + data->waiting = 0; + rtas_call(ibm_suspend_me_token, 0, 1, + data->args->args); + } else { + data->waiting = -EBUSY; + printk(KERN_ERR "Error on H_Join hypervisor call\n"); + } + +out: +#ifdef CONFIG_DETECT_SOFTLOCKUP + /* before we restore interrupts, make sure we don't + * generate a spurious soft lockup errors + */ + touch_softlockup_watchdog(); +#endif + local_irq_restore(flags); + return; +} + +static int rtas_ibm_suspend_me(struct rtas_args *args) +{ + int i; + + struct rtas_suspend_me_data data; + + data.waiting = 1; + data.args = args; + + /* Call function on all other CPUs */ + if (on_each_cpu(rtas_percpu_suspend_me, &data, 1, 0)) + data.waiting = -EINVAL; + + if (data.waiting != 0) + printk(KERN_ERR "Error doing global join\n"); + + /* Prod each CPU. This won't hurt, and will wake + * anyone we successfully put to sleep with H_Join + */ + for_each_cpu(i) + plpar_hcall_norets(H_PROD,i); + + return data.waiting; +} +#else /* CONFIG_PPC_PSERIES */ +static int rtas_ibm_suspend_me(struct rtas_args *args) +{ + return -EINVAL; +} +#endif asmlinkage int ppc_rtas(struct rtas_args __user *uargs) { @@ -556,6 +635,7 @@ unsigned long flags; char *buff_copy, *errbuf = NULL; int nargs; + int rc; if (!capable(CAP_SYS_ADMIN)) return -EPERM; @@ -574,6 +654,18 @@ nargs * sizeof(rtas_arg_t)) != 0) return -EFAULT; + if (args.token == RTAS_UNKNOWN_SERVICE) + return -EINVAL; + + /* Need to handle ibm,suspend_me call specially */ + if (args.token == ibm_suspend_me_token) { + rc = rtas_ibm_suspend_me(&args); + if (rc) + return rc; + else + goto copy_return; + } + buff_copy = get_errorlog_buffer(); spin_lock_irqsave(&rtas.lock, flags); @@ -597,6 +689,7 @@ kfree(buff_copy); } +copy_return: /* Copy out args. */ if (copy_to_user(uargs->args + nargs, args.args + nargs, @@ -668,8 +761,10 @@ * the stop-self token if any */ #ifdef CONFIG_PPC64 - if (_machine == PLATFORM_PSERIES_LPAR) + if (_machine == PLATFORM_PSERIES_LPAR) { rtas_region = min(lmb.rmo_size, RTAS_INSTANTIATE_MAX); + ibm_suspend_me_token = rtas_token("ibm,suspend-me"); + } #endif rtas_rmo_buf = lmb_alloc_base(RTAS_RMOBUF_MAX, PAGE_SIZE, rtas_region); -- Dave Boutcher From ntl at pobox.com Sat Jan 14 09:58:38 2006 From: ntl at pobox.com (Nathan Lynch) Date: Fri, 13 Jan 2006 16:58:38 -0600 Subject: p650 console stopped working under 2.6.15-git6 In-Reply-To: <43C81557.3040808@shadowen.org> References: <43C81557.3040808@shadowen.org> Message-ID: <20060113225838.GI2846@localhost.localdomain> Andy Whitcroft wrote: > Somewhere between 2.6.15-git5 and 2.6.15-git6 the console for my p650 > has stopped working, output stopping at the 'returning from prom_init' > stage. Anyone got any clues? Is this a partition or a "full system" configuration? Can you send the full output of the failed boot? Any chance you could try a git bisect? Looks like the commit ids corresponding to the daily snapshots are also on kernel.org alongside the patches (e.g. 2.6.15-git6.id). From ntl at pobox.com Sat Jan 14 10:52:25 2006 From: ntl at pobox.com (Nathan Lynch) Date: Fri, 13 Jan 2006 17:52:25 -0600 Subject: [PATCH] powerpc: special case ibm,suspend-me rtas call In-Reply-To: <20060113220331.GA13754@cs.umn.edu> References: <20060113220331.GA13754@cs.umn.edu> Message-ID: <20060113235225.GJ2846@localhost.localdomain> Dave C Boutcher wrote: > Handle the ibm,suspend-me RTAS call specially. It needs > to be wrapped in a set of synchronization hypervisor calls > (H_Join). When the H_Join calls are made on all CPUs, the > intent is that only one will return with H_Continue, meaning > that he is the "last man standing". That CPU then issues the > ibm,suspend-me call. What is interesting, of course, is that > the CPU running when the rtas syscall is made, may NOT be the > CPU that ultimately executes the ibm,suspend-me syscall. > > This is an alternative to a previous patch I submitted which issues the > rtas call through a new (and thus evil) /proc file. I don't especially > like adding special-case code to the rtas call path, but I don't like > adding a /proc file either... Agreed... in that I don't like either option. :) I think there's coincidentally some discussion on lkml about adding something like a /sys/hypervisor hierarchy for Xen et al... maybe we could use that for things like this? I've been wanting to convert the dlpar stuff to an interface like that for a while, rather than having userspace invoke the RTAS calls directly. Also, I think you probably want a big mutex around the rtas_ibm_suspend_me stuff... I don't think you'd want two threads going down that path concurrently. More comments below. > + > +out: > +#ifdef CONFIG_DETECT_SOFTLOCKUP > + /* before we restore interrupts, make sure we don't > + * generate a spurious soft lockup errors > + */ > + touch_softlockup_watchdog(); > +#endif ifdef not needed. > +static int rtas_ibm_suspend_me(struct rtas_args *args) > +{ > + int i; > + > + struct rtas_suspend_me_data data; > + > + data.waiting = 1; > + data.args = args; > + > + /* Call function on all other CPUs */ > + if (on_each_cpu(rtas_percpu_suspend_me, &data, 1, 0)) > + data.waiting = -EINVAL; I'm feeling soooo nitpicky -- can you please remove the "other" from this comment (or just ditch the comment altogether)? It briefly confused me into thinking rtas_percpu_suspend_me isn't called on this cpu, until I looked at the definition of on_each_cpu. > +#else /* CONFIG_PPC_PSERIES */ > +static int rtas_ibm_suspend_me(struct rtas_args *args) > +{ > + return -EINVAL; > +} > +#endif -ENOSYS would be better, I think. From sleddog at us.ibm.com Sat Jan 14 11:39:24 2006 From: sleddog at us.ibm.com (Dave C Boutcher) Date: Fri, 13 Jan 2006 18:39:24 -0600 Subject: [PATCH] powerpc: special case ibm,suspend-me rtas call Message-ID: <20060114003924.GA21799@cs.umn.edu> Handle the ibm,suspend-me RTAS call specially. It needs to be wrapped in a set of synchronization hypervisor calls (H_Join). When the H_Join calls are made on all CPUs, the intent is that only one will return with H_Continue, meaning that he is the "last man standing". That CPU then issues the ibm,suspend-me call. What is interesting, of course, is that the CPU running when the rtas syscall is made, may NOT be the CPU that ultimately executes the ibm,suspend-me rtas call. Resend#1: minor updates based on comments from Nathan Lynch. Signed-off-by: Dave Boutcher diff -uNr -X exclude-files powerpc.git.patched2/arch/powerpc/kernel/rtas.c powerpc.git.vpm/arch/powerpc/kernel/rtas.c --- powerpc.git.patched2/arch/powerpc/kernel/rtas.c 2006-01-12 15:12:17.000000000 -0600 +++ powerpc.git.vpm/arch/powerpc/kernel/rtas.c 2006-01-13 18:25:58.000000000 -0600 @@ -34,6 +34,11 @@ .lock = SPIN_LOCK_UNLOCKED }; +struct rtas_suspend_me_data { + long waiting; + struct rtas_args *args; +}; + EXPORT_SYMBOL(rtas); DEFINE_SPINLOCK(rtas_data_buf_lock); @@ -549,6 +554,80 @@ } while (status == RTAS_BUSY); } +static int ibm_suspend_me_token = RTAS_UNKNOWN_SERVICE; +#ifdef CONFIG_PPC_PSERIES +static void rtas_percpu_suspend_me(void *info) +{ + long rc; + long flags; + struct rtas_suspend_me_data *data = + (struct rtas_suspend_me_data *)info; + + /* + * We use "waiting" to indicate our state. As long + * as it is >0, we are still trying to all join up. + * If it goes to 0, we have successfully joined up and + * one thread got H_Continue. If any error happens, + * we set it to <0; + */ + local_irq_save(flags); + do { + rc = plpar_hcall_norets(H_JOIN); + smp_rmb(); + } while (rc == H_Success && data->waiting > 0); + if (rc == H_Success) + goto out; + + if (rc == H_Continue) { + data->waiting = 0; + rtas_call(ibm_suspend_me_token, 0, 1, + data->args->args); + } else { + data->waiting = -EBUSY; + printk(KERN_ERR "Error on H_Join hypervisor call\n"); + } + +out: + /* before we restore interrupts, make sure we don't + * generate a spurious soft lockup errors + */ + touch_softlockup_watchdog(); + local_irq_restore(flags); + return; +} + +static int rtas_ibm_suspend_me(struct rtas_args *args) +{ + int i; + + struct rtas_suspend_me_data data; + + data.waiting = 1; + data.args = args; + + /* Call function on all CPUs. One of us will make the + * rtas call + */ + if (on_each_cpu(rtas_percpu_suspend_me, &data, 1, 0)) + data.waiting = -EINVAL; + + if (data.waiting != 0) + printk(KERN_ERR "Error doing global join\n"); + + /* Prod each CPU. This won't hurt, and will wake + * anyone we successfully put to sleep with H_Join + */ + for_each_cpu(i) + plpar_hcall_norets(H_PROD,i); + + return data.waiting; +} +#else /* CONFIG_PPC_PSERIES */ +static int rtas_ibm_suspend_me(struct rtas_args *args) +{ + return -ENOSYS; +} +#endif asmlinkage int ppc_rtas(struct rtas_args __user *uargs) { @@ -556,6 +635,7 @@ unsigned long flags; char *buff_copy, *errbuf = NULL; int nargs; + int rc; if (!capable(CAP_SYS_ADMIN)) return -EPERM; @@ -574,6 +654,18 @@ nargs * sizeof(rtas_arg_t)) != 0) return -EFAULT; + if (args.token == RTAS_UNKNOWN_SERVICE) + return -EINVAL; + + /* Need to handle ibm,suspend_me call specially */ + if (args.token == ibm_suspend_me_token) { + rc = rtas_ibm_suspend_me(&args); + if (rc) + return rc; + else + goto copy_return; + } + buff_copy = get_errorlog_buffer(); spin_lock_irqsave(&rtas.lock, flags); @@ -597,6 +689,7 @@ kfree(buff_copy); } +copy_return: /* Copy out args. */ if (copy_to_user(uargs->args + nargs, args.args + nargs, @@ -668,8 +761,10 @@ * the stop-self token if any */ #ifdef CONFIG_PPC64 - if (_machine == PLATFORM_PSERIES_LPAR) + if (_machine == PLATFORM_PSERIES_LPAR) { rtas_region = min(lmb.rmo_size, RTAS_INSTANTIATE_MAX); + ibm_suspend_me_token = rtas_token("ibm,suspend-me"); + } #endif rtas_rmo_buf = lmb_alloc_base(RTAS_RMOBUF_MAX, PAGE_SIZE, rtas_region); -- Dave Boutcher From ntl at pobox.com Sat Jan 14 13:42:22 2006 From: ntl at pobox.com (Nathan Lynch) Date: Fri, 13 Jan 2006 20:42:22 -0600 Subject: [PATCH] powerpc: special case ibm,suspend-me rtas call In-Reply-To: <20060113235225.GJ2846@localhost.localdomain> References: <20060113220331.GA13754@cs.umn.edu> <20060113235225.GJ2846@localhost.localdomain> Message-ID: <20060114024221.GK2846@localhost.localdomain> Nathan Lynch wrote: > > Also, I think you probably want a big mutex around the > rtas_ibm_suspend_me stuff... I don't think you'd want two threads > going down that path concurrently. Never mind this part. I see now that call_lock in smp_call_function serializes such things, sorry. From olof at lixom.net Sat Jan 14 14:09:07 2006 From: olof at lixom.net (Olof Johansson) Date: Fri, 13 Jan 2006 21:09:07 -0600 Subject: [patch 0/8] systemsim and hvc_console patches In-Reply-To: <20060113183033.696401000@localhost> References: <20060113183033.696401000@localhost> Message-ID: <20060114030907.GP2491@pb15.lixom.net> On Fri, Jan 13, 2006 at 01:30:33PM -0500, Arnd Bergmann wrote: > I have not taken much of a look into the systemsim device drivers > themselves to see if they are any good and I realize that it is > _very_ late for any new feature to get included into 2.6.16. Seems like they still need a bit of cleanup before they get merged. I've commented on most of the patches, see separate emails. Overall I'm not sure how I feel about having hacks in the kernel for systemsim. If it's truly simulating the full system, why can't it simulate the disk device and network device as well instead of doing things with magic instructions like it does now? -Olof From olof at lixom.net Sat Jan 14 14:05:00 2006 From: olof at lixom.net (Olof Johansson) Date: Fri, 13 Jan 2006 21:05:00 -0600 Subject: [patch 7/8] powerpc: hvc backend for systemsim In-Reply-To: <200601131841.33259.arndb@de.ibm.com> References: <20060113183033.696401000@localhost> <200601131841.33259.arndb@de.ibm.com> Message-ID: <20060114030500.GO2491@pb15.lixom.net> On Fri, Jan 13, 2006 at 01:41:32PM -0500, Arnd Bergmann wrote: > The IBM full system simulator for PowerPC has its own > set of calls used for console interaction, when not > simulating actual serial port hardware. > > This is needed to run the simulator for Cell and can > also be used for the PowerPC 970 simulator. > > It also adds the generic asm/systemsim.h header file > that is also used by other device drivers for the > system simulator, i.e. the block and network drivers. This introduces a third name for the same enviroment. Now we have: * Mambo * systemsim * FSS or Full System Simulator I don't care which one stays, but it's silly to have three. From olof at lixom.net Sat Jan 14 13:54:52 2006 From: olof at lixom.net (Olof Johansson) Date: Fri, 13 Jan 2006 20:54:52 -0600 Subject: [patch 2/8] powerpc: systemsim block device driver In-Reply-To: <20060113183958.994894000@localhost> References: <20060113183033.696401000@localhost> <20060113183958.994894000@localhost> Message-ID: <20060114025452.GL2491@pb15.lixom.net> On Fri, Jan 13, 2006 at 01:30:35PM -0500, Arnd Bergmann wrote: > The block device driver for systemsim is currently > required for running on the Cell systemsim port, which > does not simulate any other block devices. Maybe I'm just missing it, but I'm not seeing where the _init function is detecting the presence of the driver (i.e. the environment) without doing callthru() calls. There should be a way to detect the presence of it before you start executing random instructions (which is what the callthru is, right?) Also, do you want to keep the Mambo naming in there, or move over to systemsim? > > From: Eric Van Hensbergen > Signed-off-by: Arnd Bergmann > > Index: linux-2.6.16-rc/drivers/block/Makefile > =================================================================== > --- linux-2.6.16-rc.orig/drivers/block/Makefile > +++ linux-2.6.16-rc/drivers/block/Makefile > @@ -28,6 +28,6 @@ obj-$(CONFIG_BLK_DEV_NBD) += nbd.o > obj-$(CONFIG_BLK_DEV_CRYPTOLOOP) += cryptoloop.o > > obj-$(CONFIG_VIODASD) += viodasd.o > +obj-$(CONFIG_BLK_DEV_SYSTEMSIM) += systemsim_bd.o > obj-$(CONFIG_BLK_DEV_SX8) += sx8.o > obj-$(CONFIG_BLK_DEV_UB) += ub.o > - > Index: linux-2.6.16-rc/drivers/block/Kconfig > =================================================================== > --- linux-2.6.16-rc.orig/drivers/block/Kconfig > +++ linux-2.6.16-rc/drivers/block/Kconfig > @@ -409,6 +409,13 @@ config BLK_DEV_INITRD > "real" root file system, etc. See > for details. > > +config BLK_DEV_SYSTEMSIM > + depends on PPC_SYSTEMSIM > + tristate "IBM Full System Simulator Bogus Disk Support" > + default y > + help > + Provides quick access to disk images in the simulator without > + simulating a full IDE or SCSI device. > > config CDROM_PKTCDVD > tristate "Packet writing on CD/DVD media" > Index: linux-2.6.16-rc/drivers/block/systemsim_bd.c > =================================================================== > --- /dev/null > +++ linux-2.6.16-rc/drivers/block/systemsim_bd.c > @@ -0,0 +1,285 @@ > +/* > + * Bogus Block Driver for PowerPC Full System Simulator > + * > + * (C) Copyright IBM Corporation 2003-2005 > + * > + * Bogus Disk Driver > + * > + * Author: Eric Van Hensbegren > + * > + * inspired by drivers/block/nbd.c > + * written by Pavel Machek and Steven Whitehouse > + * > + * Some code is from the IBM Full System Simulator Group in ARL > + * Author: PAtrick Bohrer > + * > + * This program is free software; you can redistribute it and/or modify > + * it under the terms of the GNU General Public License as published by > + * the Free Software Foundation; either version 2, or (at your option) > + * any later version. > + * > + * This program is distributed in the hope that it will be useful, > + * but WITHOUT ANY WARRANTY; without even the implied warranty of > + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the > + * GNU General Public License for more details. > + * > + * You should have received a copy of the GNU General Public License > + * along with this program; if not, write to: > + * Free Software Foundation > + * 51 Franklin Street, Fifth Floor > + * Boston, MA 02111-1301 USA > + * > + */ > + > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > + > +#include > + > +#include devfs? really? Don't show this to Greg K-H. :-) > + > +#include > +#include > + > +#define MAJOR_NR 42 > +#define MAX_MBD 128 > + > +#define MBD_SET_BLKSIZE _IO( 0xab, 1 ) > +#define MBD_SET_SIZE _IO( 0xab, 2 ) > +#define MBD_SET_SIZE_BLOCKS _IO( 0xab, 7 ) > +#define MBD_DISCONNECT _IO( 0xab, 8 ) > + > +struct mbd_device { > + int initialized; > + int refcnt; > + int flags; > + struct gendisk *disk; whitespace > +}; > + > +static struct mbd_device mbd_dev[MAX_MBD]; > + > +#define BD_INFO_SYNC 0 > +#define BD_INFO_STATUS 1 > +#define BD_INFO_BLKSZ 2 > +#define BD_INFO_DEVSZ 3 > +#define BD_INFO_CHANGE 4 > + > +#define BOGUS_DISK_READ 116 > +#define BOGUS_DISK_WRITE 117 > +#define BOGUS_DISK_INFO 118 > + > +static inline int > +MamboBogusDiskRead(int devno, void *buf, ulong sect, ulong nrsect) CanWeGetRidOfTheSillyCaps? > +{ > + return callthru3(BOGUS_DISK_READ, (unsigned long)buf, > + (unsigned long)sect, > + (unsigned long)((nrsect << 16) | devno)); > +} > + > +static inline int > +MamboBogusDiskWrite(int devno, void *buf, ulong sect, ulong nrsect) > +{ > + return callthru3(BOGUS_DISK_WRITE, (unsigned long)buf, > + (unsigned long)sect, > + (unsigned long)((nrsect << 16) | devno)); > +} > + > +static inline int MamboBogusDiskInfo(int op, int devno) > +{ > + return callthru2(BOGUS_DISK_INFO, (unsigned long)op, > + (unsigned long)devno); > +} > + > +static int mbd_init_disk(int devno) > +{ > + struct gendisk *disk = mbd_dev[devno].disk; > + unsigned int sz; > + > + /* check disk configured */ > + if (!MamboBogusDiskInfo(BD_INFO_STATUS, devno)) { > + printk(KERN_ERR > + "Attempting to open bogus disk before initializaiton\n"); > + return 0; > + } > + > + mbd_dev[devno].initialized++; > + > + sz = MamboBogusDiskInfo(BD_INFO_DEVSZ, devno); > + > + printk("Initializing disk %d with devsz %u\n", devno, sz); > + > + set_capacity(disk, sz << 1); > + > + return 1; > +} > + > +static void do_mbd_request(request_queue_t * q) > +{ > + int result = 0; > + struct request *req; > + > + while ((req = elv_next_request(q)) != NULL) { > + int minor = req->rq_disk->first_minor; > + > + switch (rq_data_dir(req)) { > + case READ: > + result = MamboBogusDiskRead(minor, > + req->buffer, req->sector, > + req->current_nr_sectors); > + break; > + case WRITE: > + result = MamboBogusDiskWrite(minor, > + req->buffer, req->sector, > + req->current_nr_sectors); > + }; > + > + if (result) > + end_request(req, 0); /* failure */ > + else > + end_request(req, 1); /* success */ > + } > +} > + > +static int mbd_release(struct inode *inode, struct file *file) > +{ > + struct mbd_device *lo; > + int dev; > + > + if (!inode) > + return -ENODEV; > + dev = inode->i_bdev->bd_disk->first_minor; > + if (dev >= MAX_MBD) > + return -ENODEV; > + if (MamboBogusDiskInfo(BD_INFO_SYNC, dev) < 0) { > + printk(KERN_ALERT "mbd_release: unable to sync\n"); > + } > + lo = &mbd_dev[dev]; > + if (lo->refcnt <= 0) > + printk(KERN_ALERT "mbd_release: refcount(%d) <= 0\n", > + lo->refcnt); > + lo->refcnt--; > + return 0; > +} > + > +static int mbd_revalidate(struct gendisk *disk) > +{ > + int devno = disk->first_minor; > + > + mbd_init_disk(devno); > + > + return 0; > +} > + > +static int mbd_open(struct inode *inode, struct file *file) > +{ > + int dev; > + > + if (!inode) > + return -EINVAL; > + dev = inode->i_bdev->bd_disk->first_minor; > + if (dev >= MAX_MBD) > + return -ENODEV; > + > + check_disk_change(inode->i_bdev); > + > + if (!mbd_dev[dev].initialized) > + if (!mbd_init_disk(dev)) > + return -ENODEV; > + > + mbd_dev[dev].refcnt++; > + return 0; > +} > + > +static struct block_device_operations mbd_fops = { > + owner:THIS_MODULE, > + open:mbd_open, > + release:mbd_release, > + /* media_changed: mbd_check_change, */ > + revalidate_disk:mbd_revalidate, > +}; > + > +static spinlock_t mbd_lock = SPIN_LOCK_UNLOCKED; > + > +static int __init mbd_init(void) > +{ > + int err = -ENOMEM; > + int i; > + > + for (i = 0; i < MAX_MBD; i++) { > + struct gendisk *disk = alloc_disk(1); > + if (!disk) > + goto out; > + mbd_dev[i].disk = disk; > + /* > + * The new linux 2.5 block layer implementation requires > + * every gendisk to have its very own request_queue struct. > + * These structs are big so we dynamically allocate them. > + */ > + disk->queue = blk_init_queue(do_mbd_request, &mbd_lock); > + if (!disk->queue) { > + put_disk(disk); > + goto out; > + } > + } > + > + if (register_blkdev(MAJOR_NR, "mbd")) { > + err = -EIO; > + goto out; > + } > +#ifdef MODULE > + printk("mambo bogus disk: registered device at major %d\n", MAJOR_NR); > +#else > + printk("mambo bogus disk: compiled in with kernel\n"); > +#endif > + > + devfs_mk_dir("mambobd"); > + for (i = 0; i < MAX_MBD; i++) { /* load defaults */ > + struct gendisk *disk = mbd_dev[i].disk; > + mbd_dev[i].initialized = 0; > + mbd_dev[i].refcnt = 0; > + mbd_dev[i].flags = 0; > + disk->major = MAJOR_NR; > + disk->first_minor = i; > + disk->fops = &mbd_fops; > + disk->private_data = &mbd_dev[i]; > + sprintf(disk->disk_name, "mambobd%d", i); > + sprintf(disk->devfs_name, "mambobd%d", i); > + set_capacity(disk, 0x7ffffc00ULL << 1); /* 2 TB */ > + add_disk(disk); > + } > + > + return 0; > + out: > + while (i--) { > + if (mbd_dev[i].disk->queue) > + blk_cleanup_queue(mbd_dev[i].disk->queue); > + put_disk(mbd_dev[i].disk); > + } > + return -EIO; > +} > + > +static void __exit mbd_cleanup(void) > +{ > + devfs_remove("mambobd"); > + > + if (unregister_blkdev(MAJOR_NR, "mbd") != 0) > + printk("mbd: cleanup_module failed\n"); > + else > + printk("mbd: module cleaned up.\n"); > +} > + > +module_init(mbd_init); > +module_exit(mbd_cleanup); > + > +MODULE_DESCRIPTION("Mambo Block Device"); > +MODULE_LICENSE("GPL"); > > -- > > _______________________________________________ > Linuxppc64-dev mailing list > Linuxppc64-dev at ozlabs.org > https://ozlabs.org/mailman/listinfo/linuxppc64-dev From olof at lixom.net Sat Jan 14 14:01:39 2006 From: olof at lixom.net (Olof Johansson) Date: Fri, 13 Jan 2006 21:01:39 -0600 Subject: [patch 3/8] powerpc: cpu_idle implementation for systemsim In-Reply-To: <200601131841.16940.arndb@de.ibm.com> References: <20060113183033.696401000@localhost> <200601131841.16940.arndb@de.ibm.com> Message-ID: <20060114030139.GN2491@pb15.lixom.net> On Fri, Jan 13, 2006 at 01:41:16PM -0500, Arnd Bergmann wrote: > The original cpu_idle hack from the systemsim git > tree is a bit strange, because it unconditionally > changes the native_idle function. This one instead > introduces a new idle implementation that is only > used on systemsim. > > Signed-off-by: Arnd Bergmann > > Index: linux-2.6.16-rc/arch/powerpc/Kconfig > =================================================================== > --- linux-2.6.16-rc.orig/arch/powerpc/Kconfig > +++ linux-2.6.16-rc/arch/powerpc/Kconfig > @@ -380,6 +380,15 @@ config PPC_SYSTEMSIM > The Full system simulator is available for download from > http://www.alphaworks.ibm.com/tech/. > > +config SYSTEMSIM_IDLE > + bool " Optimized idle loop for systemsim" > + depends on PPC_SYSTEMSIM > + help > + Selecting this option will enable an more optimized idle loop > + for running on the IBM Full System Simulator that > + significantly reduces the load on the host system when > + simulating an idle system. Do you really need this configured separately from the rest of systemsim? > + > config XICS > depends on PPC_PSERIES > bool > Index: linux-2.6.16-rc/arch/powerpc/kernel/setup_64.c > =================================================================== > --- linux-2.6.16-rc.orig/arch/powerpc/kernel/setup_64.c > +++ linux-2.6.16-rc/arch/powerpc/kernel/setup_64.c > @@ -554,6 +554,23 @@ static void __init emergency_stack_init( > } > > /* > + * Detect if we are running on top of the IBM Full System Simulator. > + * If we are, use the optimized idle loop for that case. > + */ > +static void __init setup_systemsim_idle(void) > +{ > +#ifdef CONFIG_SYSTEMSIM_IDLE > + struct device_node *mambo_node; > + > + mambo_node = of_find_node_by_path("/mambo"); > + if (mambo_node) { > + ppc_md.idle_loop = systemsim_idle; > + of_node_put(mambo_node); > + } > +#endif > +} > + > +/* > * Called into from start_kernel, after lock_kernel has been called. > * Initializes bootmem, which is unsed to manage page allocation until > * mem_init is called. > @@ -600,6 +617,8 @@ void __init setup_arch(char **cmdline_p) > > ppc_md.setup_arch(); > > + setup_systemsim_idle(); > + Idle loops are generally probed and setup in the platform-specific inits (setup_arch). Can't you do this from there too on the affected platforms, it's only two after all. You can move the setup_systemsim_idle() function to idle_systemsim.c to share it. > /* Use the default idle loop if the platform hasn't provided one. */ > if (NULL == ppc_md.idle_loop) { > ppc_md.idle_loop = default_idle; > Index: linux-2.6.16-rc/include/asm-powerpc/machdep.h > =================================================================== > --- linux-2.6.16-rc.orig/include/asm-powerpc/machdep.h > +++ linux-2.6.16-rc/include/asm-powerpc/machdep.h > @@ -244,6 +244,7 @@ struct machdep_calls { > > extern void default_idle(void); > extern void native_idle(void); > +extern void systemsim_idle(void); > > extern struct machdep_calls ppc_md; > extern char cmd_line[COMMAND_LINE_SIZE]; > Index: linux-2.6.16-rc/arch/powerpc/kernel/idle_systemsim.c > =================================================================== > --- /dev/null > +++ linux-2.6.16-rc/arch/powerpc/kernel/idle_systemsim.c > @@ -0,0 +1,35 @@ > +/* > + * Idle daemon for the IBM Full System Simulator. > + * > + * Originally Written by Cort Dougan (cort at cs.nmt.edu) > + * Copyright (c) 2003-2006 IBM Corporation > + * > + * This program is free software; you can redistribute it and/or > + * modify it under the terms of the GNU General Public License > + * as published by the Free Software Foundation; either version > + * 2 of the License, or (at your option) any later version. > + */ > + > +#include > +#include > + > +#include > + > +#define SIM_HALT_CODE 126 > + > +static inline void systemsim_halt(void) > +{ > + callthru0(SIM_HALT_CODE); > +} > + > +void systemsim_idle(void) > +{ > + while (1) { > + while (!need_resched()) > + systemsim_halt(); > + > + preempt_enable_no_resched(); > + schedule(); > + preempt_disable(); > + } > +} > Index: linux-2.6.16-rc/arch/powerpc/kernel/Makefile > =================================================================== > --- linux-2.6.16-rc.orig/arch/powerpc/kernel/Makefile > +++ linux-2.6.16-rc/arch/powerpc/kernel/Makefile > @@ -21,6 +21,7 @@ obj-$(CONFIG_PPC64) += setup_64.o binfm > obj-$(CONFIG_PPC64) += vdso64/ > obj-$(CONFIG_ALTIVEC) += vecemu.o vector.o > obj-$(CONFIG_POWER4) += idle_power4.o > +obj-$(CONFIG_SYSTEMSIM_IDLE) += idle_systemsim.o > obj-$(CONFIG_PPC_OF) += of_device.o prom_parse.o > procfs-$(CONFIG_PPC64) := proc_ppc64.o > obj-$(CONFIG_PROC_FS) += $(procfs-y) > > -- > > _______________________________________________ > Linuxppc64-dev mailing list > Linuxppc64-dev at ozlabs.org > https://ozlabs.org/mailman/listinfo/linuxppc64-dev From olof at lixom.net Sat Jan 14 13:47:41 2006 From: olof at lixom.net (Olof Johansson) Date: Fri, 13 Jan 2006 20:47:41 -0600 Subject: [patch 1/8] powerpc: basic systemsim support In-Reply-To: <20060113183958.864972000@localhost> References: <20060113183033.696401000@localhost> <20060113183958.864972000@localhost> Message-ID: <20060114024741.GK2491@pb15.lixom.net> On Fri, Jan 13, 2006 at 01:30:34PM -0500, Arnd Bergmann wrote: > Add some support and doc files for the IBM Full System > Simulator and a configuration option that acts as a control > for the patches based on this one. > > No code is changed in this patch, but it is required for > the systemsim network, block, hvc_console and cpu_idle > patches that are based on the infrastructure in here. This patch is full of coding style issues on comments. It also contains a systemsim.txt file that's 50% marketing text. Can we keep it technical and relevant, or leave it out of the kernel sources, please? I'm also not sure if the Documentation directory is the best place to put the TCL config file for the simulator. Shouldn't that be packaged with that instead of the kernel? > > From: Eric Van Hensbergen > Signed-off-by: Arnd Bergmann > > Index: linux-2.6.16-rc/include/asm-powerpc/systemsim.h > =================================================================== > --- /dev/null > +++ linux-2.6.16-rc/include/asm-powerpc/systemsim.h > @@ -0,0 +1,132 @@ > +/* > + * > + * Copyright (C) 2001, 2005 IBM > + * > + * Filename : systemsim.h > + * > + * Originator : Patrick Bohrer and Charles Lefurgy > + * Modified By : Eric Van Hensbegren > + * > + * Purpose : > + * > + * This file is compiled with programs that are run under the > + * PowerPC Full System simulator. For example, stand-alone programs > + * or operating systems. The programs call the callthru wrapper > + * functions which use an illegal PowerPC instruction to signal the > + * simulator to emulate special support. > + * > + */ > + > +#ifndef _SYSTEMSIM_CONFIG_H_ > +#define _SYSTEMSIM_CONFIG_H_ > +#ifdef __KERNEL__ > + > +/* The functions callthru0 to callthru5 setup up the arguments for the > + * simulator callthru and then use the callthru instruction. Note that > + * 0-5 specify the number of arguments after the command */ > + > +/* Note: Arguments are cast as void* to prevent casting by the > + compiler. This way, you can pass pointers, integers, etc. in > + machine register and have the simulator interpret what the > + register is supposed to be. To help with typing errors when using > + callthrus, we provide wrapper functions for each callthru. The > + wrappers cast all arguments to void*. Unfortunately, this results > + in a lot of compiler warnings that I do not know how to remove. If > + you modify this code, be aware that we are trying to pick a type > + that is the size of the registers (32-bit or 64-bit) and that is > + why are choosing to cast to a void* (it should be the size of a > + machine register) */ > + > +static inline int callthru0(int command) > +{ > + register int c asm("r3") = command; > + asm volatile (".long 0x000eaeb0":"=r" (c):"r"(c)); > + return (c); > +} > +static inline int callthru1(int command, unsigned long arg1) > +{ > + register int c asm("r3") = command; > + register unsigned long a1 asm("r4") = arg1; > + asm volatile (".long 0x000eaeb0":"=r" (c):"r"(c), "r"(a1)); > + return (c); > +} > +static inline int callthru2(int command, unsigned long arg1, unsigned long arg2) > +{ > + register int c asm("r3") = command; > + register unsigned long a1 asm("r4") = arg1; > + register unsigned long a2 asm("r5") = arg2; > + asm volatile (".long 0x000eaeb0":"=r" (c):"r"(c), "r"(a1), "r"(a2)); > + return (c); > +} > +static inline int callthru3(int command, unsigned long arg1, unsigned long arg2, > + unsigned long arg3) > +{ > + register int c asm("r3") = command; > + register unsigned long a1 asm("r4") = arg1; > + register unsigned long a2 asm("r5") = arg2; > + register unsigned long a3 asm("r6") = arg3; > + asm volatile (".long 0x000eaeb0":"=r" (c):"r"(c), "r"(a1), "r"(a2), > + "r"(a3)); > + return (c); > +} > +static inline int callthru4(int command, unsigned long arg1, unsigned long arg2, > + unsigned long arg3, unsigned long arg4) > +{ > + register int c asm("r3") = command; > + register unsigned long a1 asm("r4") = arg1; > + register unsigned long a2 asm("r5") = arg2; > + register unsigned long a3 asm("r6") = arg3; > + register unsigned long a4 asm("r7") = arg4; > + asm volatile (".long 0x000eaeb0":"=r" (c):"r"(c), "r"(a1), "r"(a2), > + "r"(a3), "r"(a4)); > + return (c); > +} > +static inline int callthru5(int command, unsigned long arg1, unsigned long arg2, > + unsigned long arg3, unsigned long arg4, > + unsigned long arg5) > +{ > + register int c asm("r3") = command; > + register unsigned long a1 asm("r4") = arg1; > + register unsigned long a2 asm("r5") = arg2; > + register unsigned long a3 asm("r6") = arg3; > + register unsigned long a4 asm("r7") = arg4; > + register unsigned long a5 asm("r8") = arg5; > + asm volatile (".long 0x000eaeb0":"=r" (c):"r"(c), "r"(a1), "r"(a2), > + "r"(a3), "r"(a4), "r"(a5)); > + return (c); > +} > +static inline int callthru6(int command, unsigned long arg1, unsigned long arg2, > + unsigned long arg3, unsigned long arg4, > + unsigned long arg5, unsigned long arg6) > +{ > + register int c asm("r3") = command; > + register unsigned long a1 asm("r4") = arg1; > + register unsigned long a2 asm("r5") = arg2; > + register unsigned long a3 asm("r6") = arg3; > + register unsigned long a4 asm("r7") = arg4; > + register unsigned long a5 asm("r8") = arg5; > + register unsigned long a6 asm("r9") = arg6; > + asm volatile (".long 0x000eaeb0":"=r" (c):"r"(c), "r"(a1), "r"(a2), > + "r"(a3), "r"(a4), "r"(a5), "r"(a6)); > + return (c); > +} > +static inline int callthru7(int command, unsigned long arg1, unsigned long arg2, > + unsigned long arg3, unsigned long arg4, > + unsigned long arg5, unsigned long arg6, > + unsigned long arg7) > +{ > + register int c asm("r3") = command; > + register unsigned long a1 asm("r4") = arg1; > + register unsigned long a2 asm("r5") = arg2; > + register unsigned long a3 asm("r6") = arg3; > + register unsigned long a4 asm("r7") = arg4; > + register unsigned long a5 asm("r8") = arg5; > + register unsigned long a6 asm("r9") = arg6; > + register unsigned long a7 asm("r10") = arg7; > + asm volatile (".long 0x000eaeb0":"=r" (c):"r"(c), "r"(a1), "r"(a2), > + "r"(a3), "r"(a4), "r"(a5), "r"(a6), "r"(a7)); > + return (c); > +} > + > +#endif /* __KERNEL__ */ > +#endif/* _SYSTEMSIM_CONFIG_H_ */ > Index: linux-2.6.16-rc/arch/powerpc/Kconfig > =================================================================== > --- linux-2.6.16-rc.orig/arch/powerpc/Kconfig > +++ linux-2.6.16-rc/arch/powerpc/Kconfig > @@ -369,6 +369,17 @@ config PPC_CELL > select MMIO_NVRAM > select PPC_UDBG_16550 > > +config PPC_SYSTEMSIM > + bool " IBM Full System Simulator (systemsim) support" > + depends on PPC_CELL || PPC_PSERIES || PPC_MAPLE > + help > + Support booting resulting image under IBMs Full System Simulator. > + If you enable this option, you are able to select device > + drivers (e.g. network and disk) for purely simulated devices > + that are provided by systemsim. > + The Full system simulator is available for download from > + http://www.alphaworks.ibm.com/tech/. > + > config XICS > depends on PPC_PSERIES > bool > Index: linux-2.6.16-rc/Documentation/systemsim/maple.tcl > =================================================================== > --- /dev/null > +++ linux-2.6.16-rc/Documentation/systemsim/maple.tcl > @@ -0,0 +1,95 @@ > +puts "To debug mambo with gdb: attach [pid]" > +#gets stdin > +#simdebug set UART 1 > + > +# get the general procedures defined for mambo > +source $env(LIB_DIR)/ppc/util.tcl > + > + > +# > +# First create a simulator called mysim > +# > +define dup gpul myconf > +myconf config cpus 1 > +myconf config memory_size 128M > + > +# we prefer a maple right now > +myconf config pic/start 0xf8040000 > +myconf config pic/end 0xf807ffff > +myconf config pic/little_endian 0 > + > +set isa_base 0xf4000000 > + > +myconf config rtc/start [add64 $isa_base 0x900] > +myconf config rtc/end [add64 $isa_base 0x90f] > +myconf config uart0 on > +myconf config uart0/start [add64 $isa_base 0x3f8] > +myconf config uart0/end [add64 $isa_base 0x3ff] > +myconf config uart1/start [add64 $isa_base 0x2f8] > +myconf config uart1/end [add64 $isa_base 0x2ff] > + > +define machine myconf mysim > + > +set root [ mysim of find_device / ] > + > +set ht [ mysim of addchild $root ht 0 ] > +set range [list 0x0 0x0 ] > +mysim of addprop $ht array "bus-range" range > +set ranges [list 0x81000000 0x00000000 0x00000000 0x00000000 0xf4000000 0x00000000 0x00400000 0x82000000 0x00000000 0x80000000 0x00000000 0x80000000 0x00000000 0x70000000 ] > +mysim of addprop $ht array "ranges" ranges > +set reg [list 0x0 0xf2000000 0x03000000 ] > +mysim of addprop $ht array "reg" reg > +mysim of addprop $ht string "compatible" "u3-ht" > +mysim of addprop $ht int "#size-cells" 2 > +mysim of addprop $ht int "#address-cells" 3 > +mysim of addprop $ht string "device_type" "ht" > +mysim of addprop $ht string "name" "ht" > + > +set isa [ mysim of addchild $ht isa 4 ] > +mysim of addprop $isa string "name" "isa" > +mysim of addprop $isa string "device_type" "isa" > +set reg [list 0x2000 0x0 0x0 0x0 0x0] > +mysim of addprop $isa array "reg" reg > +set ranges [list 0x1 $isa_base 0x10000 ] > +mysim of addprop $isa array "ranges" ranges > + > +set rtc [ mysim of addchild $isa rtc 0x900 ] > +mysim of addprop $rtc string "compatible" "pnpPNP,B00" > +mysim of addprop $rtc string "name" "rtc" > +mysim of addprop $rtc string "device_type" "rtc" > +set reg [list 0x1 0x900 0x1 0x1 0x901 0x1] > +mysim of addprop $rtc array "reg" reg > + > +set uart1 [ mysim of addchild $isa serial 0x3f8 ] > +set reg [ list 0x1 0x3f8 0x8 ] > +mysim of addprop $uart1 array "reg" reg > +mysim of addprop $uart1 string "device_type" "serial" > +mysim of package_to_path $uart1 > + > +if { [ info exists GUI_HOOK ] } then { eval $GUI_HOOK } > + > +# > +# Now load the boot image > +# > + > +mysim bogus disk init 0 rootdisk.img newcow simple.cow 1024 > +mysim bogus net init 0 de:ad:ca:fe:ba:be /tmp/serversocketh0 0 0 > +mysim load vmlinux vmlinux 0 > + > +mysim modify loose on > + > +set usertcl /dev/null > +if { [ file exists ./user.tcl ] } { > + set usertcl ./user.tcl > +} > +source $usertcl > + > +set of_root [mysim of find_device /] > +mysim of setprop $of_root compatible "Momentum,Maple" > +set of_chosen [mysim of find_device /chosen] > +mysim of setprop $of_chosen bootargs "rw root=/dev/mambobd0 console=bogus0" > +simdebug set PCI 1 > +set dart [ mysim of addchild $root dart 0 ] > +mysim of addprop $dart string "device_type" "dart" > +mysim of addprop $dart string "compatible" "u3-dart" > +mysim go > Index: linux-2.6.16-rc/Documentation/systemsim/systemsim.txt > =================================================================== > --- /dev/null > +++ linux-2.6.16-rc/Documentation/systemsim/systemsim.txt > @@ -0,0 +1,92 @@ > + SystemSim: PowerPC Full-System Simulator > + > +Introduction > +============ > + > +What is the IBM Full-System Simulator for IBM PowerPC 970? > +---------------------------------------------------------- > + > +The IBM Full-System Simulator has been developed and refined in conjunction > +with several large-system design projects built upon the IBM Power Architecture. > +As an execution-driven, full-system simulator, the IBM Full-System Simulator has > +facilitated the experimentation and evaluation of a wide variety of system > +components for core IBM initiatives, such as the STI Cell and the IBM PERCS > +projects. The IBM Full-System Simulator for PowerPC 970 enables development > +teams both within and outside IBM to simulate a PowerPC 970 system in order to > +develop and enhance application support for this platform. > + > +This technology runs on AIX?, Linux?, and Mac OS X (see the requirements > +section on the website for details). > + > +How does it work? > +----------------- > + > +Written in C, a significant part of the Full-System Simulator's simulation > +capability is directly attributed to its TSIM component. Developed as a > +robust, high-performance alternative to conventional process and thread > +programming, TSIM is a light-weight, multi-tasking scheduling framework that > +provides a complete set of facilities for creating and scheduling threads, > +manipulating time delays, and applying a variety of inter-thread communication > +policies and mechanisms to simulation events. > + > +In TSIM's multi-threaded approach, individually-schedulable threads are created > +to simulate a component or collection of components. If a thread must defer > +processing, it requests to be blocked and continues execution when awakened. Any > +local (stack) state is preserved in order to mitigate the necessity for > +allocating areas for saving and restoring this state. TSIM threads are > +non-preemptive; they block only on well-defined events. TSIM simplifies access > +to shared data that must otherwise be serialized in order to guarantee correct > +behavior. Each thread has an associated priority. Scheduling and resource > +allocations are all "first-come, first-served" (FCFS) within priority. TSIM also > +includes software components useful for modeling common hardware components > +such as gates, latches, and ports. > + > +This low-level simulation infrastructure is complemented with a host of > +additional features, such as integrated development and debugging tools, > +support for stand-alone and operating system boot, data collection and > +analysis frameworks, performance visualization, and tracing and logging > +capabilities that enable developers to realistically represent an entire > +system of equipment, devices, or subsystems and simulate not only the > +instructions executed by the processor core, but also its interactions with > +its surrounding system components. Additionally, the Full-System Simulator is > +capable of booting K42, IBM's research operating system, and rHype, the > +research hypervisor. > + > +About the technology author(s): > +------------------------------- > + > +The IBM Full-System Simulator has been developed by the Future Systems group at > +the IBM Austin Research Lab (ARL). Consisting of the Performance and Tools team, > +Novel Systems Architecture team, and Power-Aware Systems team, Future Systems > +focuses on software system issues, including system-level power analysis, system > +performance, and low-level system software issues. The researchers bring a wide > +variety of expertise and extensive experience in numerous software and hardware > +technologies to the team, including computer architecture, performance analysis, > +operating systems, power management, and algorithms. > + > +Where can I get it? > +------------------- > + > +The IBM PowerPC Full-System Simulator is available from the IBM Alphaworks > +website: http://www.alphaworks.ibm.com/tech/systemsim970 > + > +Compiling & Booting Linux for SystemSim > +======================================= > + > +When compiling Linux to run on SystemSim you should use the configuration > +file in arch/ppc64/configs/systemsim_defconfig as a base. > + > +When booting the resulting image in SystemSim use the maple.tcl file in > +this directory (Documentation/systemsim/maple.tcl) as a base. You will > +likely need to change the name of the root disk image and perhaps the path > +to the vmlinux file. This standard profile will be included with the > +SystemSim tool in the near future (at which point we will hopefully update > +this document. > + > +For further information on using Linux with SystemSim, please reference the > +SystemSim documentation, and the FAQ and/or Forums on the Alphaworks site. > + > + > + > + > + > > -- > > _______________________________________________ > Linuxppc64-dev mailing list > Linuxppc64-dev at ozlabs.org > https://ozlabs.org/mailman/listinfo/linuxppc64-dev From olof at lixom.net Sat Jan 14 13:57:04 2006 From: olof at lixom.net (Olof Johansson) Date: Fri, 13 Jan 2006 20:57:04 -0600 Subject: [patch 4/8] powerpc: systemsim network driver In-Reply-To: <20060113183959.342152000@localhost> References: <20060113183033.696401000@localhost> <20060113183959.342152000@localhost> Message-ID: <20060114025704.GM2491@pb15.lixom.net> On Fri, Jan 13, 2006 at 01:30:37PM -0500, Arnd Bergmann wrote: > This adds a simple network driver for virtual > networking on the IBM Full System Simulator. Shouldn't this be reviewed and submitted through netdev/Jeff Garzik? (Same Mambo/Systemsim comment as for the block driver -- at least this one does proper device probing through the device tree) -Olof From haren at us.ibm.com Sat Jan 14 14:15:36 2006 From: haren at us.ibm.com (Haren Myneni) Date: Fri, 13 Jan 2006 19:15:36 -0800 Subject: [PATCH] powerpc: Fix for copy regs and dynamic allocate per cpu crash notes Message-ID: <43C86CD8.3060300@us.ibm.com> - This patch contains the arch specific changes for the following the kdump generic fixes which were already accepted in the upstream. . Capturing CPU registers (for the case of 'panic' and invoking the dump using 'sysrq-trigger') from a function (stack frame) which will be not be available during the kdump boot. Hence, might result in invalid stack trace. . Dynamically allocating per cpu ELF notes section instead of statically for NR_CPUS. - Fix the compiler warning in prom_init.c. Thanks Haren Signed-off-by: Haren Myneni -------------- next part -------------- A non-text attachment was scrubbed... Name: kdump-copy-regs-percpu-crash-notes-fixes.patch Type: text/x-patch Size: 6125 bytes Desc: not available Url : http://ozlabs.org/pipermail/linuxppc64-dev/attachments/20060113/0e11bf08/attachment.bin From haren at us.ibm.com Sat Jan 14 14:23:35 2006 From: haren at us.ibm.com (Haren Myneni) Date: Fri, 13 Jan 2006 19:23:35 -0800 Subject: [Fwd: [PATCH] powerpc: Fix for copy regs and dynamic allocate per cpu crash notes] Message-ID: <43C86EB7.7000404@us.ibm.com> Wrong e-mail address. Sorry for re-posting. Thanks Haren -------------- next part -------------- An embedded message was scrubbed... From: Haren Myneni Subject: [PATCH] powerpc: Fix for copy regs and dynamic allocate per cpu crash notes Date: Fri, 13 Jan 2006 19:15:36 -0800 Size: 7779 Url: http://ozlabs.org/pipermail/linuxppc64-dev/attachments/20060113/354a16b4/attachment.eml From paulus at samba.org Sat Jan 14 15:23:03 2006 From: paulus at samba.org (Paul Mackerras) Date: Sat, 14 Jan 2006 15:23:03 +1100 Subject: please pull powerpc-merge.git Message-ID: <17352.31911.799540.543433@cargo.ozlabs.ibm.com> Linus, Please pull git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc-merge.git Various bits in there, including a patch to fix the "G4" symbol clash between oprofile and the wacom driver, a patch from Anton to strengthen the barriers in the atomics and bitops, my patch to provide an AT_PLATFORM value to userland, plus initial ports of some embedded platforms over to ARCH=powerpc. Diffstat and shortlog follow. Thanks, Paul. arch/powerpc/Makefile | 7 arch/powerpc/boot/Makefile | 49 + arch/powerpc/boot/crt0.S | 21 - arch/powerpc/boot/hack-coff.c | 84 ++ arch/powerpc/boot/main.c | 46 + arch/powerpc/boot/prom.c | 538 +++------------ arch/powerpc/boot/prom.h | 36 + arch/powerpc/boot/rs6000.h | 243 +++++++ arch/powerpc/boot/stdio.c | 325 +++++++++ arch/powerpc/boot/stdio.h | 6 arch/powerpc/boot/string.S | 20 - arch/powerpc/boot/zImage.coff.lds | 46 + arch/powerpc/configs/mpc834x_sys_defconfig | 911 ++++++++++++++++++++++++++ arch/powerpc/kernel/asm-offsets.c | 2 arch/powerpc/kernel/cpu_setup_power4.S | 4 arch/powerpc/kernel/cputable.c | 224 ++++-- arch/powerpc/kernel/entry_32.S | 2 arch/powerpc/kernel/entry_64.S | 15 arch/powerpc/kernel/fpu.S | 10 arch/powerpc/kernel/head_64.S | 112 ++- arch/powerpc/kernel/idle_power4.S | 8 arch/powerpc/kernel/irq.c | 12 arch/powerpc/kernel/lparcfg.c | 13 arch/powerpc/kernel/misc_32.S | 4 arch/powerpc/kernel/misc_64.S | 10 arch/powerpc/kernel/paca.c | 36 + arch/powerpc/kernel/ppc_ksyms.c | 3 arch/powerpc/kernel/prom.c | 109 +++ arch/powerpc/kernel/prom_parse.c | 3 arch/powerpc/kernel/rtas.c | 96 +++ arch/powerpc/kernel/setup-common.c | 9 arch/powerpc/kernel/time.c | 2 arch/powerpc/lib/locks.c | 8 arch/powerpc/oprofile/common.c | 8 arch/powerpc/platforms/83xx/Kconfig | 1 arch/powerpc/platforms/83xx/mpc834x_sys.c | 243 +++++++ arch/powerpc/platforms/83xx/mpc834x_sys.h | 23 + arch/powerpc/platforms/83xx/mpc83xx.h | 14 arch/powerpc/platforms/83xx/pci.c | 99 +++ arch/powerpc/platforms/chrp/pci.c | 27 - arch/powerpc/platforms/chrp/setup.c | 7 arch/powerpc/platforms/chrp/time.c | 7 arch/powerpc/platforms/iseries/irq.c | 6 arch/powerpc/platforms/iseries/misc.S | 3 arch/powerpc/platforms/iseries/setup.c | 8 arch/powerpc/platforms/iseries/smp.c | 2 arch/powerpc/platforms/pseries/lpar.c | 4 arch/powerpc/platforms/pseries/reconfig.c | 100 +++ arch/powerpc/platforms/pseries/setup.c | 20 - arch/powerpc/sysdev/Makefile | 1 arch/powerpc/sysdev/fsl_soc.c | 317 +++++++++ arch/powerpc/sysdev/fsl_soc.h | 8 arch/ppc/kernel/head_8xx.S | 77 ++ arch/ppc/kernel/ppc_ksyms.c | 1 arch/ppc/platforms/83xx/mpc834x_sys.c | 10 arch/ppc/platforms/85xx/mpc8540_ads.c | 14 arch/ppc/platforms/85xx/mpc8560_ads.c | 11 arch/ppc/platforms/85xx/mpc85xx_cds_common.c | 16 arch/ppc/platforms/85xx/sbc8560.c | 10 arch/ppc/platforms/85xx/stx_gp3.c | 10 arch/ppc/platforms/85xx/tqm85xx.c | 16 arch/ppc/syslib/mpc83xx_devices.c | 10 arch/ppc/syslib/mpc85xx_devices.c | 10 drivers/macintosh/macio-adb.c | 13 fs/proc/proc_devtree.c | 24 + include/asm-powerpc/atomic.h | 46 + include/asm-powerpc/bitops.h | 6 include/asm-powerpc/cputable.h | 14 include/asm-powerpc/elf.h | 16 include/asm-powerpc/futex.h | 2 include/asm-powerpc/hvcall.h | 5 include/asm-powerpc/lppaca.h | 6 include/asm-powerpc/paca.h | 14 include/asm-powerpc/ppc_asm.h | 76 +- include/asm-powerpc/prom.h | 8 include/asm-powerpc/spinlock.h | 21 - include/asm-powerpc/synch.h | 23 - include/asm-powerpc/system.h | 8 include/asm-powerpc/time.h | 5 include/linux/proc_fs.h | 5 80 files changed, 3452 insertions(+), 937 deletions(-) create mode 100644 arch/powerpc/boot/hack-coff.c create mode 100644 arch/powerpc/boot/rs6000.h create mode 100644 arch/powerpc/boot/stdio.c create mode 100644 arch/powerpc/boot/zImage.coff.lds create mode 100644 arch/powerpc/configs/mpc834x_sys_defconfig create mode 100644 arch/powerpc/platforms/83xx/mpc834x_sys.c create mode 100644 arch/powerpc/platforms/83xx/mpc834x_sys.h create mode 100644 arch/powerpc/platforms/83xx/mpc83xx.h create mode 100644 arch/powerpc/platforms/83xx/pci.c create mode 100644 arch/powerpc/sysdev/fsl_soc.c create mode 100644 arch/powerpc/sysdev/fsl_soc.h Andy Whitcroft: powerpc: oprofile cpu type names clash with other code Anton Blanchard: powerpc: use lwsync in atomics, bitops, lock functions powerpc: reformat atomic_add_unless Dave C Boutcher: powerpc: Add some more pSeries hypervisor call constants powerpc: Add/remove/update properties in /proc/device-tree powerpc: Add/remove/update properties in firmware device tree powerpc: Add of_find_property function powerpc: Add support for changing properties from userspace powerpc: special-case ibm,suspend-me RTAS call David Gibson: powerpc: Cleanup LOADADDR etc. asm macros powerpc: Remove lppaca structure from the PACA David Woodhouse: powerpc: Make CHRP build again powerpc: macio-adb build fix Kumar Gala: powerpc: Updated platforms that use gianfar to match driver powerpc: Allow for ppc_md restart, power_off, and halt to be NULL powerpc: Add FSL SOC library and setup code powerpc: Add MPC834x SYS board to arch/powerpc Marcelo Tosatti: powerpc/8xx: Use 8MB D-TLB's for kernel static mapping faults Paul Mackerras: powerpc: Provide a suitable AT_PLATFORM value ppc: Remove duplicate export of get_wchan powerpc: Make COFF zImages for old 32-bit powermacs powerpc: Avoid unaligned loads and stores in boot memcpy code powerpc: Recognize /chaos bridge on old pmacs as PCI Tom Rini: Remove bzImage target powerpc/boot: Better use of defaultimage- From benh at kernel.crashing.org Sat Jan 14 16:35:35 2006 From: benh at kernel.crashing.org (Benjamin Herrenschmidt) Date: Sat, 14 Jan 2006 16:35:35 +1100 Subject: [PATCH] powerpc: Fix Maple build Message-ID: <1137216935.4854.26.camel@localhost.localdomain> The changes to the device node structure broke Maple build. This fixes it. Unfortunately I coudn't test as my Maple board appears to be dead. Signed-off-by: Benjamin Herrenschmidt Index: linux-work/arch/powerpc/platforms/maple/pci.c =================================================================== --- linux-work.orig/arch/powerpc/platforms/maple/pci.c 2006-01-14 14:43:22.000000000 +1100 +++ linux-work/arch/powerpc/platforms/maple/pci.c 2006-01-14 15:44:38.000000000 +1100 @@ -316,7 +316,6 @@ static int __init add_bridge(struct devi char* disp_name; int *bus_range; int primary = 1; - struct property *of_prop; DBG("Adding PCI host bridge %s\n", dev->full_name); Index: linux-work/arch/powerpc/platforms/maple/setup.c =================================================================== --- linux-work.orig/arch/powerpc/platforms/maple/setup.c 2006-01-14 15:37:50.000000000 +1100 +++ linux-work/arch/powerpc/platforms/maple/setup.c 2006-01-14 15:49:03.000000000 +1100 @@ -71,38 +71,60 @@ #define DBG(fmt...) #endif +static unsigned long maple_find_nvram_base(void) +{ + struct device_node *rtcs; + unsigned long result = 0; + + /* find NVRAM device */ + rtcs = of_find_compatible_node(NULL, "nvram", "AMD8111"); + if (rtcs) { + struct resource r; + if (of_address_to_resource(rtcs, 0, &r)) { + printk(KERN_EMERG "Maple: Unable to translate NVRAM" + " address\n"); + goto bail; + } + if (!(r.flags & IORESOURCE_IO)) { + printk(KERN_EMERG "Maple: NVRAM address isn't PIO!\n"); + goto bail; + } + result = r.start; + } else + printk(KERN_EMERG "Maple: Unable to find NVRAM\n"); + bail: + of_node_put(rtcs); + return result; +} + static void maple_restart(char *cmd) { unsigned int maple_nvram_base; unsigned int maple_nvram_offset; unsigned int maple_nvram_command; - struct device_node *rtcs; + struct device_node *sp; - /* find NVRAM device */ - rtcs = find_compatible_devices("nvram", "AMD8111"); - if (rtcs && rtcs->addrs) { - maple_nvram_base = rtcs->addrs[0].address; - } else { - printk(KERN_EMERG "Maple: Unable to find NVRAM\n"); - printk(KERN_EMERG "Maple: Manual Restart Required\n"); - return; - } + maple_nvram_base = maple_find_nvram_base(); + if (maple_nvram_base == 0) + goto fail; /* find service processor device */ - rtcs = find_devices("service-processor"); - if (!rtcs) { + sp = of_find_node_by_name(NULL, "service-processor"); + if (!sp) { printk(KERN_EMERG "Maple: Unable to find Service Processor\n"); - printk(KERN_EMERG "Maple: Manual Restart Required\n"); - return; + goto fail; } - maple_nvram_offset = *(unsigned int*) get_property(rtcs, + maple_nvram_offset = *(unsigned int*) get_property(sp, "restart-addr", NULL); - maple_nvram_command = *(unsigned int*) get_property(rtcs, + maple_nvram_command = *(unsigned int*) get_property(sp, "restart-value", NULL); + of_node_put(sp); /* send command */ outb_p(maple_nvram_command, maple_nvram_base + maple_nvram_offset); for (;;) ; + fail: + printk(KERN_EMERG "Maple: Manual Restart Required\n"); } static void maple_power_off(void) @@ -110,33 +132,29 @@ static void maple_power_off(void) unsigned int maple_nvram_base; unsigned int maple_nvram_offset; unsigned int maple_nvram_command; - struct device_node *rtcs; + struct device_node *sp; - /* find NVRAM device */ - rtcs = find_compatible_devices("nvram", "AMD8111"); - if (rtcs && rtcs->addrs) { - maple_nvram_base = rtcs->addrs[0].address; - } else { - printk(KERN_EMERG "Maple: Unable to find NVRAM\n"); - printk(KERN_EMERG "Maple: Manual Power-Down Required\n"); - return; - } + maple_nvram_base = maple_find_nvram_base(); + if (maple_nvram_base == 0) + goto fail; /* find service processor device */ - rtcs = find_devices("service-processor"); - if (!rtcs) { + sp = of_find_node_by_name(NULL, "service-processor"); + if (!sp) { printk(KERN_EMERG "Maple: Unable to find Service Processor\n"); - printk(KERN_EMERG "Maple: Manual Power-Down Required\n"); - return; + goto fail; } - maple_nvram_offset = *(unsigned int*) get_property(rtcs, + maple_nvram_offset = *(unsigned int*) get_property(sp, "power-off-addr", NULL); - maple_nvram_command = *(unsigned int*) get_property(rtcs, + maple_nvram_command = *(unsigned int*) get_property(sp, "power-off-value", NULL); + of_node_put(sp); /* send command */ outb_p(maple_nvram_command, maple_nvram_base + maple_nvram_offset); for (;;) ; + fail: + printk(KERN_EMERG "Maple: Manual Power-Down Required\n"); } static void maple_halt(void) @@ -179,9 +197,6 @@ void __init maple_setup_arch(void) */ static void __init maple_init_early(void) { - unsigned int default_speed; - u64 physport; - DBG(" -> maple_init_early\n"); /* Initialize hash table, from now on, we can take hash faults Index: linux-work/arch/powerpc/platforms/maple/time.c =================================================================== --- linux-work.orig/arch/powerpc/platforms/maple/time.c 2006-01-14 14:43:22.000000000 +1100 +++ linux-work/arch/powerpc/platforms/maple/time.c 2006-01-14 15:52:29.000000000 +1100 @@ -168,11 +168,24 @@ unsigned long __init maple_get_boot_time struct rtc_time tm; struct device_node *rtcs; - rtcs = find_compatible_devices("rtc", "pnpPNP,b00"); - if (rtcs && rtcs->addrs) { - maple_rtc_addr = rtcs->addrs[0].address; - printk(KERN_INFO "Maple: Found RTC at 0x%x\n", maple_rtc_addr); - } else { + rtcs = of_find_compatible_node(NULL, "rtc", "pnpPNP,b00"); + if (rtcs) { + struct resource r; + if (of_address_to_resource(rtcs, 0, &r)) { + printk(KERN_EMERG "Maple: Unable to translate RTC" + " address\n"); + goto bail; + } + if (!(r.flags & IORESOURCE_IO)) { + printk(KERN_EMERG "Maple: RTC address isn't PIO!\n"); + goto bail; + } + maple_rtc_addr = r.start; + printk(KERN_INFO "Maple: Found RTC at IO 0x%x\n", + maple_rtc_addr); + } + bail: + if (maple_rtc_addr == 0) { maple_rtc_addr = RTC_PORT(0); /* legacy address */ printk(KERN_INFO "Maple: No device node for RTC, assuming " "legacy address (0x%x)\n", maple_rtc_addr); From benh at kernel.crashing.org Sat Jan 14 16:38:13 2006 From: benh at kernel.crashing.org (Benjamin Herrenschmidt) Date: Sat, 14 Jan 2006 16:38:13 +1100 Subject: [PATCH] powerpc: LPAR is a firmware feature Message-ID: <1137217093.4854.30.camel@localhost.localdomain> Make LPAR a firmware feature and stop testing for the LPAR bit in _machine. Signed-off-by: Michael Ellerman Signed-off-by: Benjamin Herrenschmidt This is the patch posted earlier by Michael Ellerman extracted from his series as it's a pre-requisite to the next patch I'm posting. >From linuxppc64-dev-bounces at ozlabs.org Fri Jan 13 00:41:00 2006 Return-Path: Received: from ozlabs.org (ozlabs.org [203.10.76.45]) by gate.crashing.org (8.12.8/8.12.8) with ESMTP id k0D6exWG008949; Fri, 13 Jan 2006 00:41:00 -0600 Received: from ozlabs.org (localhost [127.0.0.1]) by ozlabs.org (Postfix) with ESMTP id 0D000689E2; Fri, 13 Jan 2006 17:47:13 +1100 (EST) X-Original-To: linuxppc64-dev at ozlabs.org Delivered-To: linuxppc64-dev at ozlabs.org Received: by ozlabs.org (Postfix, from userid 1034) id E3A786893F; Fri, 13 Jan 2006 17:47:06 +1100 (EST) To: Paul Mackerras , From: Michael Ellerman Date: Fri, 13 Jan 2006 17:46:57 +1100 Subject: [PATCH 3/10] powerpc: Replace platform_is_lpar() with a firmware feature In-Reply-To: <1137134815.491678.995063725775.qpush at concordia> Message-Id: <20060113064706.E3A786893F at ozlabs.org> X-BeenThere: linuxppc64-dev at ozlabs.org X-Mailman-Version: 2.1.6 Precedence: list List-Id: 64-bit Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Sender: linuxppc64-dev-bounces at ozlabs.org Errors-To: linuxppc64-dev-bounces at ozlabs.org X-Spam-Checker-Version: SpamAssassin 3.0.1 (2004-10-22) on gate.crashing.org X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.0.1 Status: X-Evolution-Source: pop://benh at localhost:10110/ Content-Transfer-Encoding: 8bit It has been decreed that platform numbers are evil, so as a step in that direction, replace platform_is_lpar() with a FW_FEATURE_LPAR bit. Signed-off-by: Michael Ellerman Index: linux-work/include/asm-powerpc/firmware.h =================================================================== --- linux-work.orig/include/asm-powerpc/firmware.h 2006-01-14 15:18:12.000000000 +1100 +++ linux-work/include/asm-powerpc/firmware.h 2006-01-14 15:18:42.000000000 +1100 @@ -41,6 +41,7 @@ #define FW_FEATURE_MULTITCE (1UL<<19) #define FW_FEATURE_SPLPAR (1UL<<20) #define FW_FEATURE_ISERIES (1UL<<21) +#define FW_FEATURE_LPAR (1UL<<22) enum { #ifdef CONFIG_PPC64 @@ -51,10 +52,10 @@ enum { FW_FEATURE_MIGRATE | FW_FEATURE_PERFMON | FW_FEATURE_CRQ | FW_FEATURE_VIO | FW_FEATURE_RDMA | FW_FEATURE_LLAN | FW_FEATURE_BULK | FW_FEATURE_XDABR | FW_FEATURE_MULTITCE | - FW_FEATURE_SPLPAR, + FW_FEATURE_SPLPAR | FW_FEATURE_LPAR, FW_FEATURE_PSERIES_ALWAYS = 0, - FW_FEATURE_ISERIES_POSSIBLE = FW_FEATURE_ISERIES, - FW_FEATURE_ISERIES_ALWAYS = FW_FEATURE_ISERIES, + FW_FEATURE_ISERIES_POSSIBLE = FW_FEATURE_ISERIES | FW_FEATURE_LPAR, + FW_FEATURE_ISERIES_ALWAYS = FW_FEATURE_ISERIES | FW_FEATURE_LPAR, FW_FEATURE_POSSIBLE = #ifdef CONFIG_PPC_PSERIES FW_FEATURE_PSERIES_POSSIBLE | Index: linux-work/arch/powerpc/mm/hash_utils_64.c =================================================================== --- linux-work.orig/arch/powerpc/mm/hash_utils_64.c 2006-01-14 15:18:12.000000000 +1100 +++ linux-work/arch/powerpc/mm/hash_utils_64.c 2006-01-14 15:30:24.000000000 +1100 @@ -421,7 +421,7 @@ void __init htab_initialize(void) htab_hash_mask = pteg_count - 1; - if (platform_is_lpar()) { + if (firmware_has_feature(FW_FEATURE_LPAR)) { /* Using a hypervisor which owns the htab */ htab_address = NULL; _SDR1 = 0; @@ -516,7 +516,7 @@ void __init htab_initialize(void) void htab_initialize_secondary(void) { - if (!platform_is_lpar()) + if (!firmware_has_feature(FW_FEATURE_LPAR)) mtspr(SPRN_SDR1, _SDR1); } Index: linux-work/arch/powerpc/oprofile/op_model_power4.c =================================================================== --- linux-work.orig/arch/powerpc/oprofile/op_model_power4.c 2006-01-14 15:18:12.000000000 +1100 +++ linux-work/arch/powerpc/oprofile/op_model_power4.c 2006-01-14 15:18:42.000000000 +1100 @@ -10,6 +10,7 @@ #include #include #include +#include #include #include #include @@ -232,7 +233,7 @@ static unsigned long get_pc(struct pt_re mmcra = mfspr(SPRN_MMCRA); /* Were we in the hypervisor? */ - if (platform_is_lpar() && (mmcra & MMCRA_SIHV)) + if (firmware_has_feature(FW_FEATURE_LPAR) && (mmcra & MMCRA_SIHV)) /* function descriptor madness */ return *((unsigned long *)hypervisor_bucket); Index: linux-work/arch/powerpc/platforms/pseries/iommu.c =================================================================== --- linux-work.orig/arch/powerpc/platforms/pseries/iommu.c 2006-01-14 15:18:12.000000000 +1100 +++ linux-work/arch/powerpc/platforms/pseries/iommu.c 2006-01-14 15:18:42.000000000 +1100 @@ -582,7 +582,7 @@ void iommu_init_early_pSeries(void) return; } - if (platform_is_lpar()) { + if (firmware_has_feature(FW_FEATURE_LPAR)) { if (firmware_has_feature(FW_FEATURE_MULTITCE)) { ppc_md.tce_build = tce_buildmulti_pSeriesLP; ppc_md.tce_free = tce_freemulti_pSeriesLP; Index: linux-work/arch/powerpc/platforms/pseries/setup.c =================================================================== --- linux-work.orig/arch/powerpc/platforms/pseries/setup.c 2006-01-14 15:18:12.000000000 +1100 +++ linux-work/arch/powerpc/platforms/pseries/setup.c 2006-01-14 15:30:40.000000000 +1100 @@ -246,7 +246,7 @@ static void __init pSeries_setup_arch(vo ppc_md.idle_loop = default_idle; } - if (platform_is_lpar()) + if (firmware_has_feature(FW_FEATURE_LPAR)) ppc_md.enable_pmcs = pseries_lpar_enable_pmcs; else ppc_md.enable_pmcs = power4_enable_pmcs; @@ -275,7 +275,6 @@ static void __init fw_feature_init(void) DBG(" -> fw_feature_init()\n"); - ppc64_firmware_features = 0; dn = of_find_node_by_path("/rtas"); if (dn == NULL) { printk(KERN_ERR "WARNING ! Cannot find RTAS in device-tree !\n"); @@ -373,7 +372,7 @@ static void __init pSeries_init_early(vo fw_feature_init(); - if (platform_is_lpar()) + if (firmware_has_feature(FW_FEATURE_LPAR)) hpte_init_lpar(); else { hpte_init_native(); @@ -381,7 +380,7 @@ static void __init pSeries_init_early(vo get_property(of_chosen, "linux,iommu-off", NULL)); } - if (platform_is_lpar()) + if (firmware_has_feature(FW_FEATURE_LPAR)) find_udbg_vterm(); if (firmware_has_feature(FW_FEATURE_DABR)) @@ -437,6 +436,9 @@ static int __init pSeries_probe(int plat * it here ... */ + if (platform == PLATFORM_PSERIES_LPAR) + ppc64_firmware_features |= FW_FEATURE_LPAR; + return 1; } @@ -578,7 +580,7 @@ static void pseries_shared_idle(void) static int pSeries_pci_probe_mode(struct pci_bus *bus) { - if (platform_is_lpar()) + if (firmware_has_feature(FW_FEATURE_LPAR)) return PCI_PROBE_DEVTREE; return PCI_PROBE_NORMAL; } Index: linux-work/arch/powerpc/platforms/pseries/smp.c =================================================================== --- linux-work.orig/arch/powerpc/platforms/pseries/smp.c 2006-01-14 15:18:12.000000000 +1100 +++ linux-work/arch/powerpc/platforms/pseries/smp.c 2006-01-14 15:18:42.000000000 +1100 @@ -443,7 +443,7 @@ void __init smp_init_pSeries(void) smp_ops->cpu_die = pSeries_cpu_die; /* Processors can be added/removed only on LPAR */ - if (platform_is_lpar()) + if (firmware_has_feature(FW_FEATURE_LPAR)) pSeries_reconfig_notifier_register(&pSeries_smp_nb); #endif Index: linux-work/arch/powerpc/platforms/pseries/xics.c =================================================================== --- linux-work.orig/arch/powerpc/platforms/pseries/xics.c 2006-01-14 15:18:12.000000000 +1100 +++ linux-work/arch/powerpc/platforms/pseries/xics.c 2006-01-14 15:18:42.000000000 +1100 @@ -20,6 +20,7 @@ #include #include #include +#include #include #include #include @@ -536,7 +537,7 @@ nextnode: of_node_put(np); } - if (platform_is_lpar()) + if (firmware_has_feature(FW_FEATURE_LPAR)) ops = &pSeriesLP_ops; else { #ifdef CONFIG_SMP Index: linux-work/arch/powerpc/platforms/iseries/setup.c =================================================================== --- linux-work.orig/arch/powerpc/platforms/iseries/setup.c 2006-01-14 15:18:12.000000000 +1100 +++ linux-work/arch/powerpc/platforms/iseries/setup.c 2006-01-14 15:30:24.000000000 +1100 @@ -303,8 +303,6 @@ static void __init iSeries_init_early(vo { DBG(" -> iSeries_init_early()\n"); - ppc64_firmware_features = FW_FEATURE_ISERIES; - ppc64_interrupt_controller = IC_ISERIES; #if defined(CONFIG_BLK_DEV_INITRD) @@ -710,7 +708,13 @@ void __init iSeries_init_IRQ(void) { } static int __init iseries_probe(int platform) { - return PLATFORM_ISERIES_LPAR == platform; + if (PLATFORM_ISERIES_LPAR != platform) + return 0; + + ppc64_firmware_features |= FW_FEATURE_ISERIES; + ppc64_firmware_features |= FW_FEATURE_LPAR; + + return 1; } struct machdep_calls __initdata iseries_md = { Index: linux-work/include/asm-powerpc/processor.h =================================================================== --- linux-work.orig/include/asm-powerpc/processor.h 2006-01-14 15:18:12.000000000 +1100 +++ linux-work/include/asm-powerpc/processor.h 2006-01-14 15:30:24.000000000 +1100 @@ -52,7 +52,6 @@ #ifdef __KERNEL__ #define platform_is_pseries() (_machine == PLATFORM_PSERIES || \ _machine == PLATFORM_PSERIES_LPAR) -#define platform_is_lpar() (!!(_machine & PLATFORM_LPAR)) #if defined(CONFIG_PPC_MULTIPLATFORM) extern int _machine; From benh at kernel.crashing.org Sat Jan 14 16:45:30 2006 From: benh at kernel.crashing.org (Benjamin Herrenschmidt) Date: Sat, 14 Jan 2006 16:45:30 +1100 Subject: [PATCH] powerpc: Better machine descriptions and kill magic numbers Message-ID: <1137217531.4854.39.camel@localhost.localdomain> This patch does the long awaited change of the machine descriptions so that: - Both 32 and 64 bits now rely on a probe() entrypoint in ppc_md which is supposed to use the flat device-tree to identify the board. In addition, I've added a couple of functions to make things easier to retreive the root of the flat device-tree and to test the "compatible" property of a node in the flat tree - Machines are defined entirely locally to the machine setup*.c file. A macro is used to define the ppc_md structure for the board and adds it to a specific ELF section. It will automatically get probed. - Machines/Platforms magic numbers are gone, _machine is gone too, you can now use the machine_is(name) macro to check if you are running on a givem board, this macro works by testing which of the machine descriptions was selected at boot. - I kept the !MULTIPLAFORM case available for 32 bits (in which case you still have to provide a platform_init() routine) but I would like that to go. I recommend that any new and/or embedded board ported to ARCH=powerpc gets added to the MULTIPLATFORM case. If necessary, Kconfig should be fixed to enable MULTIPLATFORM for other CPU types. Tested on 32 and 64 bits powermacs and pseries. Build tested on iseries chrp and maple. Signed-off-by: Benjamin Herrenschmidt Index: linux-work/arch/powerpc/kernel/prom.c =================================================================== --- linux-work.orig/arch/powerpc/kernel/prom.c 2006-01-14 15:37:50.000000000 +1100 +++ linux-work/arch/powerpc/kernel/prom.c 2006-01-14 16:05:16.000000000 +1100 @@ -383,14 +383,14 @@ static int __devinit finish_node_interru /* Apple uses bits in there in a different way, let's * only keep the real sense bit on macs */ - if (_machine == PLATFORM_POWERMAC) + if (machine_is(powermac)) sense &= 0x1; np->intrs[intrcount].sense = map_mpic_senses[sense]; } #ifdef CONFIG_PPC64 /* We offset irq numbers for the u3 MPIC by 128 in PowerMac */ - if (_machine == PLATFORM_POWERMAC && ic && ic->parent) { + if (machine_is(powermac) && ic && ic->parent) { char *name = get_property(ic->parent, "name", NULL); if (name && !strcmp(name, "u3")) np->intrs[intrcount].line += 128; @@ -565,6 +565,18 @@ int __init of_scan_flat_dt(int (*it)(uns return rc; } +unsigned long __init of_get_flat_dt_root(void) +{ + unsigned long p = ((unsigned long)initial_boot_params) + + initial_boot_params->off_dt_struct; + + while(*((u32 *)p) == OF_DT_NOP) + p += 4; + BUG_ON (*((u32 *)p) != OF_DT_BEGIN_NODE); + p += 4; + return _ALIGN(p + strlen((char *)p) + 1, 4); +} + /** * This function can be used within scan_flattened_dt callback to get * access to properties @@ -607,6 +619,25 @@ void* __init of_get_flat_dt_prop(unsigne } while(1); } +int __init of_flat_dt_is_compatible(unsigned long node, const char *compat) +{ + const char* cp; + unsigned long cplen, l; + + cp = of_get_flat_dt_prop(node, "compatible", &cplen); + if (cp == NULL) + return 0; + while (cplen > 0) { + if (strncasecmp(cp, compat, strlen(compat)) == 0) + return 1; + l = strlen(cp) + 1; + cp += l; + cplen -= l; + } + + return 0; +} + static void *__init unflatten_dt_alloc(unsigned long *mem, unsigned long size, unsigned long align) { @@ -681,7 +712,7 @@ static unsigned long __init unflatten_dt #ifdef DEBUG if ((strlen(p) + l + 1) != allocl) { DBG("%s: p: %d, l: %d, a: %d\n", - pathp, strlen(p), l, allocl); + pathp, (int)strlen(p), l, allocl); } #endif p += strlen(p); @@ -933,7 +964,6 @@ static int __init early_init_dt_scan_cpu static int __init early_init_dt_scan_chosen(unsigned long node, const char *uname, int depth, void *data) { - u32 *prop; unsigned long *lprop; DBG("search \"chosen\", depth: %d, uname: %s\n", depth, uname); @@ -942,14 +972,6 @@ static int __init early_init_dt_scan_cho (strcmp(uname, "chosen") != 0 && strcmp(uname, "chosen at 0") != 0)) return 0; - /* get platform type */ - prop = (u32 *)of_get_flat_dt_prop(node, "linux,platform", NULL); - if (prop == NULL) - return 0; -#ifdef CONFIG_PPC_MULTIPLATFORM - _machine = *prop; -#endif - #ifdef CONFIG_PPC64 /* check if iommu is forced on or off */ if (of_get_flat_dt_prop(node, "linux,iommu-off", NULL) != NULL) @@ -976,15 +998,15 @@ static int __init early_init_dt_scan_cho * set of RTAS infos now if available */ { - u64 *basep, *entryp; + u64 *basep, *entryp, *sizep; basep = of_get_flat_dt_prop(node, "linux,rtas-base", NULL); entryp = of_get_flat_dt_prop(node, "linux,rtas-entry", NULL); - prop = of_get_flat_dt_prop(node, "linux,rtas-size", NULL); - if (basep && entryp && prop) { + sizep = of_get_flat_dt_prop(node, "linux,rtas-size", NULL); + if (basep && entryp && sizep) { rtas.base = *basep; rtas.entry = *entryp; - rtas.size = *prop; + rtas.size = *sizep; } } #endif /* CONFIG_PPC_RTAS */ @@ -1727,7 +1749,7 @@ static int of_finish_dynamic_node(struct /* We don't support that function on PowerMac, at least * not yet */ - if (_machine == PLATFORM_POWERMAC) + if (machine_is(powermac)) return -ENODEV; /* fix up new node's linux_phandle field */ Index: linux-work/arch/powerpc/kernel/setup-common.c =================================================================== --- linux-work.orig/arch/powerpc/kernel/setup-common.c 2006-01-14 15:37:50.000000000 +1100 +++ linux-work/arch/powerpc/kernel/setup-common.c 2006-01-14 16:05:16.000000000 +1100 @@ -9,6 +9,9 @@ * as published by the Free Software Foundation; either version * 2 of the License, or (at your option) any later version. */ + +#undef DEBUG + #include #include #include @@ -41,6 +44,7 @@ #include #include #include +#include #include #include #include @@ -56,8 +60,6 @@ #include "setup.h" -#undef DEBUG - #ifdef DEBUG #include #define DBG(fmt...) udbg_printf(fmt) @@ -65,10 +67,12 @@ #define DBG(fmt...) #endif -#ifdef CONFIG_PPC_MULTIPLATFORM -int _machine = 0; -EXPORT_SYMBOL(_machine); -#endif +/* The main machine-dep calls structure + */ +struct machdep_calls ppc_md; +EXPORT_SYMBOL(ppc_md); +struct machdep_calls *machine_id; +EXPORT_SYMBOL(machine_id); unsigned long klimit = (unsigned long) _end; @@ -397,7 +401,7 @@ void __init smp_setup_cpu_maps(void) * On pSeries LPAR, we need to know how many cpus * could possibly be added to this partition. */ - if (_machine == PLATFORM_PSERIES_LPAR && + if (machine_is(pseries) && firmware_has_feature(FW_FEATURE_LPAR) && (dn = of_find_node_by_path("/rtas"))) { int num_addr_cell, num_size_cell, maxcpus; unsigned int *ireg; @@ -466,3 +470,32 @@ static int __init early_xmon(char *p) } early_param("xmon", early_xmon); #endif + +void probe_machine(void) +{ + extern struct machdep_calls __machine_desc_start; + extern struct machdep_calls __machine_desc_end; + + /* + * Iterate all ppc_md structures until we find the proper + * one for the current machine type + */ + DBG("Probing machine type ...\n"); + + for (machine_id = &__machine_desc_start; + machine_id < &__machine_desc_end; + machine_id++) { + DBG(" %s ...", machine_id->name); + memcpy(&ppc_md, machine_id, sizeof(struct machdep_calls)); + if (ppc_md.probe()) { + DBG(" match !\n"); + break; + } + DBG("\n"); + } + /* What can we do if we didn't find ? */ + if (machine_id >= &__machine_desc_end) { + DBG("No suitable machine found !\n"); + for (;;); + } +} Index: linux-work/arch/powerpc/kernel/setup_32.c =================================================================== --- linux-work.orig/arch/powerpc/kernel/setup_32.c 2006-01-14 15:37:50.000000000 +1100 +++ linux-work/arch/powerpc/kernel/setup_32.c 2006-01-14 16:10:14.000000000 +1100 @@ -70,10 +70,6 @@ unsigned int DMA_MODE_WRITE; int have_of = 1; #ifdef CONFIG_PPC_MULTIPLATFORM -extern void prep_init(void); -extern void pmac_init(void); -extern void chrp_init(void); - dev_t boot_dev; #endif /* CONFIG_PPC_MULTIPLATFORM */ @@ -85,9 +81,6 @@ unsigned long SYSRQ_KEY = 0x54; unsigned long vgacon_remap_base; #endif -struct machdep_calls ppc_md; -EXPORT_SYMBOL(ppc_md); - /* * These are used in binfmt_elf.c to put aux entries on the stack * for each elf executable being started. @@ -123,48 +116,6 @@ unsigned long __init early_init(unsigned return KERNELBASE + offset; } -#ifdef CONFIG_PPC_MULTIPLATFORM -/* - * The PPC_MULTIPLATFORM version of platform_init... - */ -void __init platform_init(void) -{ - /* if we didn't get any bootinfo telling us what we are... */ - if (_machine == 0) { - /* prep boot loader tells us if we're prep or not */ - if ( *(unsigned long *)(KERNELBASE) == (0xdeadc0de) ) - _machine = _MACH_prep; - } - -#ifdef CONFIG_PPC_PREP - /* not much more to do here, if prep */ - if (_machine == _MACH_prep) { - prep_init(); - return; - } -#endif - -#ifdef CONFIG_ADB - if (strstr(cmd_line, "adb_sync")) { - extern int __adb_probe_sync; - __adb_probe_sync = 1; - } -#endif /* CONFIG_ADB */ - - switch (_machine) { -#ifdef CONFIG_PPC_PMAC - case _MACH_Pmac: - pmac_init(); - break; -#endif -#ifdef CONFIG_PPC_CHRP - case _MACH_chrp: - chrp_init(); - break; -#endif - } -} -#endif /* * Find out what kind of machine we're on and save any data we need @@ -190,8 +141,12 @@ void __init machine_init(unsigned long d strlcpy(cmd_line, CONFIG_CMDLINE, sizeof(cmd_line)); #endif /* CONFIG_CMDLINE */ - /* Base init based on machine type */ +#ifdef CONFIG_PPC_MULTIPLATFORM + probe_machine(); +#else + /* Base init based on machine type. Obsoloete, please kill ! */ platform_init(); +#endif #ifdef CONFIG_6xx ppc_md.power_save = ppc6xx_idle; @@ -367,7 +322,4 @@ void __init setup_arch(char **cmdline_p) if ( ppc_md.progress ) ppc_md.progress("arch: exit", 0x3eab); paging_init(); - - /* this is for modules since _machine can be a define -- Cort */ - ppc_md.ppc_machine = _machine; } Index: linux-work/arch/powerpc/kernel/setup_64.c =================================================================== --- linux-work.orig/arch/powerpc/kernel/setup_64.c 2006-01-14 15:37:50.000000000 +1100 +++ linux-work/arch/powerpc/kernel/setup_64.c 2006-01-14 16:05:16.000000000 +1100 @@ -96,11 +96,6 @@ int dcache_bsize; int icache_bsize; int ucache_bsize; -/* The main machine-dep calls structure - */ -struct machdep_calls ppc_md; -EXPORT_SYMBOL(ppc_md); - #ifdef CONFIG_MAGIC_SYSRQ unsigned long SYSRQ_KEY; #endif /* CONFIG_MAGIC_SYSRQ */ @@ -161,32 +156,6 @@ early_param("smt-enabled", early_smt_ena #define check_smt_enabled() #endif /* CONFIG_SMP */ -extern struct machdep_calls pSeries_md; -extern struct machdep_calls pmac_md; -extern struct machdep_calls maple_md; -extern struct machdep_calls cell_md; -extern struct machdep_calls iseries_md; - -/* Ultimately, stuff them in an elf section like initcalls... */ -static struct machdep_calls __initdata *machines[] = { -#ifdef CONFIG_PPC_PSERIES - &pSeries_md, -#endif /* CONFIG_PPC_PSERIES */ -#ifdef CONFIG_PPC_PMAC - &pmac_md, -#endif /* CONFIG_PPC_PMAC */ -#ifdef CONFIG_PPC_MAPLE - &maple_md, -#endif /* CONFIG_PPC_MAPLE */ -#ifdef CONFIG_PPC_CELL - &cell_md, -#endif -#ifdef CONFIG_PPC_ISERIES - &iseries_md, -#endif - NULL -}; - /* * Early initialization entry point. This is called by head.S * with MMU translation disabled. We rely on the "feature" of @@ -209,12 +178,11 @@ static struct machdep_calls __initdata * void __init early_setup(unsigned long dt_ptr) { struct paca_struct *lpaca = get_paca(); - static struct machdep_calls **mach; /* Enable early debugging if any specified (see udbg.h) */ udbg_early_init(); - DBG(" -> early_setup()\n"); + DBG(" -> early_setup(), dt_ptr: 0x%lx\n", dt_ptr); /* * Do early initializations using the flattened device @@ -223,22 +191,8 @@ void __init early_setup(unsigned long dt */ early_init_devtree(__va(dt_ptr)); - /* - * Iterate all ppc_md structures until we find the proper - * one for the current machine type - */ - DBG("Probing machine type for platform %x...\n", _machine); - - for (mach = machines; *mach; mach++) { - if ((*mach)->probe(_machine)) - break; - } - /* What can we do if we didn't find ? */ - if (*mach == NULL) { - DBG("No suitable machine found !\n"); - for (;;); - } - ppc_md = **mach; + /* Probe the machine type */ + probe_machine(); #ifdef CONFIG_CRASH_DUMP kdump_setup(); @@ -342,7 +296,7 @@ static void __init initialize_cache_info const char *dc, *ic; /* Then read cache informations */ - if (_machine == PLATFORM_POWERMAC) { + if (machine_is(powermac)) { dc = "d-cache-block-size"; ic = "i-cache-block-size"; } else { @@ -481,7 +435,6 @@ void __init setup_system(void) printk("ppc64_pft_size = 0x%lx\n", ppc64_pft_size); printk("ppc64_interrupt_controller = 0x%ld\n", ppc64_interrupt_controller); - printk("platform = 0x%x\n", _machine); printk("physicalMemorySize = 0x%lx\n", lmb_phys_mem_size()); printk("ppc64_caches.dcache_line_size = 0x%x\n", ppc64_caches.dline_size); Index: linux-work/arch/powerpc/kernel/vmlinux.lds.S =================================================================== --- linux-work.orig/arch/powerpc/kernel/vmlinux.lds.S 2006-01-14 15:37:50.000000000 +1100 +++ linux-work/arch/powerpc/kernel/vmlinux.lds.S 2006-01-14 16:05:16.000000000 +1100 @@ -1,9 +1,11 @@ #include #ifdef CONFIG_PPC64 #include +#define PROVIDE32(x) PROVIDE(__unused__##x) #else #define PAGE_SIZE 4096 #define KERNELBASE CONFIG_KERNEL_START +#define PROVIDE32(x) PROVIDE(x) #endif #include @@ -18,43 +20,42 @@ jiffies = jiffies_64 + 4; #endif SECTIONS { - /* Sections to be discarded. */ - /DISCARD/ : { - *(.exitcall.exit) - *(.exit.data) - } - - . = KERNELBASE; - - /* Read-only sections, merged into text segment: */ - .text : { - *(.text .text.*) - SCHED_TEXT - LOCK_TEXT - KPROBES_TEXT - *(.fixup) -#ifdef CONFIG_PPC32 - *(.got1) - __got2_start = .; - *(.got2) - __got2_end = .; -#else - . = ALIGN(PAGE_SIZE); - _etext = .; -#endif - } -#ifdef CONFIG_PPC32 - _etext = .; - PROVIDE (etext = .); + /* Sections to be discarded. */ + /DISCARD/ : { + *(.exitcall.exit) + *(.exit.data) + } - RODATA - .fini : { *(.fini) } =0 - .ctors : { *(.ctors) } - .dtors : { *(.dtors) } + . = KERNELBASE; - .fixup : { *(.fixup) } -#endif +/* + * Text, read only data and other permanent read-only sections + */ + + /* Text and gots */ + .text : { + *(.text .text.*) + SCHED_TEXT + LOCK_TEXT + KPROBES_TEXT + *(.fixup) + +#ifdef CONFIG_PPC32 + *(.got1) + __got2_start = .; + *(.got2) + __got2_end = .; +#endif /* CONFIG_PPC32 */ + + . = ALIGN(PAGE_SIZE); + _etext = .; + PROVIDE32 (etext = .); + } + + /* Read-only data */ + RODATA + /* Exception & bug tables */ __ex_table : { __start___ex_table = .; *(__ex_table) @@ -67,192 +68,172 @@ SECTIONS __stop___bug_table = .; } -#ifdef CONFIG_PPC64 +/* + * Init sections discarded at runtime + */ + . = ALIGN(PAGE_SIZE); + __init_begin = .; + + .init.text : { + _sinittext = .; + *(.init.text) + _einittext = .; + } + + /* .exit.text is discarded at runtime, not link time, + * to deal with references from __bug_table + */ + .exit.text : { *(.exit.text) } + + .init.data : { + *(.init.data); + __vtop_table_begin = .; + *(.vtop_fixup); + __vtop_table_end = .; + __ptov_table_begin = .; + *(.ptov_fixup); + __ptov_table_end = .; + } + + . = ALIGN(16); + .init.setup : { + __setup_start = .; + *(.init.setup) + __setup_end = .; + } + + .initcall.init : { + __initcall_start = .; + *(.initcall1.init) + *(.initcall2.init) + *(.initcall3.init) + *(.initcall4.init) + *(.initcall5.init) + *(.initcall6.init) + *(.initcall7.init) + __initcall_end = .; + } + + .con_initcall.init : { + __con_initcall_start = .; + *(.con_initcall.init) + __con_initcall_end = .; + } + + SECURITY_INIT + + . = ALIGN(8); __ftr_fixup : { __start___ftr_fixup = .; *(__ftr_fixup) __stop___ftr_fixup = .; } - RODATA -#endif + . = ALIGN(PAGE_SIZE); + .init.ramfs : { + __initramfs_start = .; + *(.init.ramfs) + __initramfs_end = .; + } #ifdef CONFIG_PPC32 - /* Read-write section, merged into data segment: */ - . = ALIGN(PAGE_SIZE); - _sdata = .; - .data : - { - *(.data) - *(.data1) - *(.sdata) - *(.sdata2) - *(.got.plt) *(.got) - *(.dynamic) - CONSTRUCTORS - } - - . = ALIGN(PAGE_SIZE); - __nosave_begin = .; - .data_nosave : { *(.data.nosave) } - . = ALIGN(PAGE_SIZE); - __nosave_end = .; + . = ALIGN(32); +#else + . = ALIGN(128); +#endif + .data.percpu : { + __per_cpu_start = .; + *(.data.percpu) + __per_cpu_end = .; + } - . = ALIGN(32); - .data.cacheline_aligned : { *(.data.cacheline_aligned) } + . = ALIGN(8); + .machine.desc : { + __machine_desc_start = . ; + *(.machine.desc) + __machine_desc_end = . ; + } - _edata = .; - PROVIDE (edata = .); + /* freed after init ends here */ + . = ALIGN(PAGE_SIZE); + __init_end = .; + +/* + * And now the various read/write data + */ + + . = ALIGN(PAGE_SIZE); + _sdata = .; + +#ifdef CONFIG_PPC32 + .data : + { + *(.data) + *(.sdata) + *(.got.plt) *(.got) + } +#else + .data : { + *(.data .data.rel* .toc1) + *(.branch_lt) + } - . = ALIGN(8192); - .data.init_task : { *(.data.init_task) } -#endif + .opd : { + *(.opd) + } - /* will be freed after init */ - . = ALIGN(PAGE_SIZE); - __init_begin = .; - .init.text : { - _sinittext = .; - *(.init.text) - _einittext = .; - } -#ifdef CONFIG_PPC32 - /* .exit.text is discarded at runtime, not link time, - to deal with references from __bug_table */ - .exit.text : { *(.exit.text) } + .got : { + __toc_start = .; + *(.got) + *(.toc) + } #endif - .init.data : { - *(.init.data); - __vtop_table_begin = .; - *(.vtop_fixup); - __vtop_table_end = .; - __ptov_table_begin = .; - *(.ptov_fixup); - __ptov_table_end = .; - } - - . = ALIGN(16); - .init.setup : { - __setup_start = .; - *(.init.setup) - __setup_end = .; - } - - .initcall.init : { - __initcall_start = .; - *(.initcall1.init) - *(.initcall2.init) - *(.initcall3.init) - *(.initcall4.init) - *(.initcall5.init) - *(.initcall6.init) - *(.initcall7.init) - __initcall_end = .; - } - - .con_initcall.init : { - __con_initcall_start = .; - *(.con_initcall.init) - __con_initcall_end = .; - } - SECURITY_INIT + . = ALIGN(PAGE_SIZE); + _edata = .; + PROVIDE32 (edata = .); + /* The initial task and kernel stack */ #ifdef CONFIG_PPC32 - __start___ftr_fixup = .; - __ftr_fixup : { *(__ftr_fixup) } - __stop___ftr_fixup = .; + . = ALIGN(8192); #else - . = ALIGN(PAGE_SIZE); - .init.ramfs : { - __initramfs_start = .; - *(.init.ramfs) - __initramfs_end = .; - } -#endif - -#ifdef CONFIG_PPC32 - . = ALIGN(32); + . = ALIGN(16384); #endif - .data.percpu : { - __per_cpu_start = .; - *(.data.percpu) - __per_cpu_end = .; - } + .data.init_task : { + *(.data.init_task) + } - . = ALIGN(PAGE_SIZE); -#ifdef CONFIG_PPC64 - . = ALIGN(16384); - __init_end = .; - /* freed after init ends here */ - - /* Read/write sections */ - . = ALIGN(PAGE_SIZE); - . = ALIGN(16384); - _sdata = .; - /* The initial task and kernel stack */ - .data.init_task : { - *(.data.init_task) - } - - . = ALIGN(PAGE_SIZE); - .data.page_aligned : { - *(.data.page_aligned) - } - - .data.cacheline_aligned : { - *(.data.cacheline_aligned) - } - - .data : { - *(.data .data.rel* .toc1) - *(.branch_lt) - } - - .opd : { - *(.opd) - } - - .got : { - __toc_start = .; - *(.got) - *(.toc) - . = ALIGN(PAGE_SIZE); - _edata = .; - } + . = ALIGN(PAGE_SIZE); + .data.page_aligned : { + *(.data.page_aligned) + } - . = ALIGN(PAGE_SIZE); -#else - __initramfs_start = .; - .init.ramfs : { - *(.init.ramfs) - } - __initramfs_end = .; - - . = ALIGN(4096); - __init_end = .; - - . = ALIGN(4096); - _sextratext = .; - _eextratext = .; + .data.cacheline_aligned : { + *(.data.cacheline_aligned) + } - __bss_start = .; -#endif + . = ALIGN(PAGE_SIZE); + __data_nosave : { + __nosave_begin = .; + *(.data.nosave) + . = ALIGN(PAGE_SIZE); + __nosave_end = .; + } - .bss : { - __bss_start = .; - *(.sbss) *(.scommon) - *(.dynbss) - *(.bss) - *(COMMON) - __bss_stop = .; - } +/* + * And finally the bss + */ + + .bss : { + __bss_start = .; + *(.sbss) *(.scommon) + *(.dynbss) + *(.bss) + *(COMMON) + __bss_stop = .; + } -#ifdef CONFIG_PPC64 - . = ALIGN(PAGE_SIZE); -#endif - _end = . ; -#ifdef CONFIG_PPC32 - PROVIDE (end = .); -#endif + . = ALIGN(PAGE_SIZE); + _end = . ; + PROVIDE32 (end = .); } Index: linux-work/arch/powerpc/platforms/cell/setup.c =================================================================== --- linux-work.orig/arch/powerpc/platforms/cell/setup.c 2006-01-14 15:37:50.000000000 +1100 +++ linux-work/arch/powerpc/platforms/cell/setup.c 2006-01-14 16:05:16.000000000 +1100 @@ -195,9 +195,10 @@ static void __init cell_init_early(void) } -static int __init cell_probe(int platform) +static int __init cell_probe(void) { - if (platform != PLATFORM_CELL) + unsigned long root = of_get_flat_dt_root(); + if (!of_flat_dt_is_compatible(root, "IBM,CPB")) return 0; return 1; @@ -212,7 +213,7 @@ static int cell_check_legacy_ioport(unsi return -ENODEV; } -struct machdep_calls __initdata cell_md = { +define_machine(cell) { .probe = cell_probe, .setup_arch = cell_setup_arch, .init_early = cell_init_early, Index: linux-work/arch/powerpc/platforms/iseries/setup.c =================================================================== --- linux-work.orig/arch/powerpc/platforms/iseries/setup.c 2006-01-14 16:05:13.000000000 +1100 +++ linux-work/arch/powerpc/platforms/iseries/setup.c 2006-01-14 16:05:16.000000000 +1100 @@ -706,9 +706,13 @@ static void iseries_dedicated_idle(void) void __init iSeries_init_IRQ(void) { } #endif -static int __init iseries_probe(int platform) +static int __init iseries_probe(void) { - if (PLATFORM_ISERIES_LPAR != platform) + char *model = of_get_flat_dt_prop(of_get_flat_dt_root(), + "model", NULL); + if (model == NULL) + return 0; + if (strcmp(model, "ibm,iSeries")) return 0; ppc64_firmware_features |= FW_FEATURE_ISERIES; @@ -717,7 +721,8 @@ static int __init iseries_probe(int plat return 1; } -struct machdep_calls __initdata iseries_md = { +define_machine(iseries) { + .name = "iSeries", .setup_arch = iSeries_setup_arch, .show_cpuinfo = iSeries_show_cpuinfo, .init_IRQ = iSeries_init_IRQ, @@ -930,6 +935,7 @@ void build_flat_dt(struct iseries_flat_d dt_prop_u32(dt, "#address-cells", 2); dt_prop_u32(dt, "#size-cells", 2); + dt_prop_str(dt, "model", "ibm,iSeries"); /* /memory */ dt_start_node(dt, "memory at 0"); @@ -942,7 +948,6 @@ void build_flat_dt(struct iseries_flat_d /* /chosen */ dt_start_node(dt, "chosen"); - dt_prop_u32(dt, "linux,platform", PLATFORM_ISERIES_LPAR); if (cmd_mem_limit) dt_prop_u64(dt, "linux,memory-limit", cmd_mem_limit); dt_end_node(dt); Index: linux-work/arch/powerpc/platforms/maple/setup.c =================================================================== --- linux-work.orig/arch/powerpc/platforms/maple/setup.c 2006-01-14 16:04:49.000000000 +1100 +++ linux-work/arch/powerpc/platforms/maple/setup.c 2006-01-14 16:05:16.000000000 +1100 @@ -259,9 +259,10 @@ static void __init maple_progress(char * /* * Called very early, MMU is off, device-tree isn't unflattened */ -static int __init maple_probe(int platform) +static int __init maple_probe(void) { - if (platform != PLATFORM_MAPLE) + unsigned long root = of_get_flat_dt_root(); + if (!of_flat_dt_is_compatible(root, "Momentum,Maple")) return 0; /* * On U3, the DART (iommu) must be allocated now since it @@ -274,7 +275,8 @@ static int __init maple_probe(int platfo return 1; } -struct machdep_calls __initdata maple_md = { +define_machine(maple_md) { + .name = "Maple", .probe = maple_probe, .setup_arch = maple_setup_arch, .init_early = maple_init_early, Index: linux-work/arch/powerpc/platforms/powermac/pci.c =================================================================== --- linux-work.orig/arch/powerpc/platforms/powermac/pci.c 2006-01-14 15:37:50.000000000 +1100 +++ linux-work/arch/powerpc/platforms/powermac/pci.c 2006-01-14 16:05:16.000000000 +1100 @@ -1204,7 +1204,7 @@ void __init pmac_pcibios_after_init(void #ifdef CONFIG_PPC32 void pmac_pci_fixup_cardbus(struct pci_dev* dev) { - if (_machine != _MACH_Pmac) + if (!machine_is(powermac)) return; /* * Fix the interrupt routing on the various cardbus bridges @@ -1247,8 +1247,9 @@ void pmac_pci_fixup_pciata(struct pci_de * On PowerMacs, we try to switch any PCI ATA controller to * fully native mode */ - if (_machine != _MACH_Pmac) + if (!machine_is(powermac)) return; + /* Some controllers don't have the class IDE */ if (dev->vendor == PCI_VENDOR_ID_PROMISE) switch(dev->device) { Index: linux-work/arch/powerpc/platforms/powermac/setup.c =================================================================== --- linux-work.orig/arch/powerpc/platforms/powermac/setup.c 2006-01-14 15:37:50.000000000 +1100 +++ linux-work/arch/powerpc/platforms/powermac/setup.c 2006-01-14 16:05:16.000000000 +1100 @@ -352,6 +352,13 @@ static void __init pmac_setup_arch(void) smp_ops = &psurge_smp_ops; #endif #endif /* CONFIG_SMP */ + +#ifdef CONFIG_ADB + if (strstr(cmd_line, "adb_sync")) { + extern int __adb_probe_sync; + __adb_probe_sync = 1; + } +#endif /* CONFIG_ADB */ } char *bootpath; @@ -578,30 +585,6 @@ pmac_halt(void) pmac_power_off(); } -#ifdef CONFIG_PPC32 -void __init pmac_init(void) -{ - /* isa_io_base gets set in pmac_pci_init */ - isa_mem_base = PMAC_ISA_MEM_BASE; - pci_dram_offset = PMAC_PCI_DRAM_OFFSET; - ISA_DMA_THRESHOLD = ~0L; - DMA_MODE_READ = 1; - DMA_MODE_WRITE = 2; - - ppc_md = pmac_md; - -#if defined(CONFIG_BLK_DEV_IDE) || defined(CONFIG_BLK_DEV_IDE_MODULE) -#ifdef CONFIG_BLK_DEV_IDE_PMAC - ppc_ide_md.ide_init_hwif = pmac_ide_init_hwif_ports; - ppc_ide_md.default_io_base = pmac_ide_get_base; -#endif /* CONFIG_BLK_DEV_IDE_PMAC */ -#endif /* defined(CONFIG_BLK_DEV_IDE) || defined(CONFIG_BLK_DEV_IDE_MODULE) */ - - if (ppc_md.progress) ppc_md.progress("pmac_init(): exit", 0); - -} -#endif - /* * Early initialization. */ @@ -652,6 +635,12 @@ static int __init pmac_declare_of_platfo { struct device_node *np; + if (machine_is(chrp)) + return -1; + + if (!machine_is(powermac)) + return 0; + np = of_find_node_by_name(NULL, "valkyrie"); if (np) of_platform_device_create(np, "valkyrie", NULL); @@ -672,12 +661,15 @@ device_initcall(pmac_declare_of_platform /* * Called very early, MMU is off, device-tree isn't unflattened */ -static int __init pmac_probe(int platform) +static int __init pmac_probe(void) { -#ifdef CONFIG_PPC64 - if (platform != PLATFORM_POWERMAC) + unsigned long root = of_get_flat_dt_root(); + + if (!of_flat_dt_is_compatible(root, "Power Macintosh") && + !of_flat_dt_is_compatible(root, "MacRISC")) return 0; +#ifdef CONFIG_PPC64 /* * On U3, the DART (iommu) must be allocated now since it * has an impact on htab_initialize (due to the large page it @@ -687,6 +679,23 @@ static int __init pmac_probe(int platfor alloc_dart_table(); #endif +#ifdef CONFIG_PPC32 + /* isa_io_base gets set in pmac_pci_init */ + isa_mem_base = PMAC_ISA_MEM_BASE; + pci_dram_offset = PMAC_PCI_DRAM_OFFSET; + ISA_DMA_THRESHOLD = ~0L; + DMA_MODE_READ = 1; + DMA_MODE_WRITE = 2; + +#if defined(CONFIG_BLK_DEV_IDE) || defined(CONFIG_BLK_DEV_IDE_MODULE) +#ifdef CONFIG_BLK_DEV_IDE_PMAC + ppc_ide_md.ide_init_hwif = pmac_ide_init_hwif_ports; + ppc_ide_md.default_io_base = pmac_ide_get_base; +#endif /* CONFIG_BLK_DEV_IDE_PMAC */ +#endif /* defined(CONFIG_BLK_DEV_IDE) || defined(CONFIG_BLK_DEV_IDE_MODULE) */ + +#endif /* CONFIG_PPC32 */ + #ifdef CONFIG_PMAC_SMU /* * SMU based G5s need some memory below 2Gb, at least the current @@ -715,10 +724,8 @@ static int pmac_pci_probe_mode(struct pc } #endif -struct machdep_calls __initdata pmac_md = { -#if defined(CONFIG_HOTPLUG_CPU) && defined(CONFIG_PPC64) - .cpu_die = generic_mach_cpu_die, -#endif +define_machine(powermac) { + .name = "PowerMac", .probe = pmac_probe, .setup_arch = pmac_setup_arch, .init_early = pmac_init_early, @@ -752,4 +759,7 @@ struct machdep_calls __initdata pmac_md .pcibios_after_init = pmac_pcibios_after_init, .phys_mem_access_prot = pci_phys_mem_access_prot, #endif +#if defined(CONFIG_HOTPLUG_CPU) && defined(CONFIG_PPC64) + .cpu_die = generic_mach_cpu_die, +#endif }; Index: linux-work/arch/powerpc/platforms/pseries/setup.c =================================================================== --- linux-work.orig/arch/powerpc/platforms/pseries/setup.c 2006-01-14 16:05:13.000000000 +1100 +++ linux-work/arch/powerpc/platforms/pseries/setup.c 2006-01-14 16:05:16.000000000 +1100 @@ -426,22 +426,40 @@ static int pSeries_check_legacy_ioport(u */ extern struct machdep_calls pSeries_md; -static int __init pSeries_probe(int platform) +static int __init pSeries_probe_hypertas(unsigned long node, + const char *uname, int depth, + void *data) { - if (platform != PLATFORM_PSERIES && - platform != PLATFORM_PSERIES_LPAR) + if (depth != 1 || + (strcmp(uname, "rtas") != 0 && strcmp(uname, "rtas at 0") != 0)) return 0; - /* if we have some ppc_md fixups for LPAR to do, do - * it here ... - */ - - if (platform == PLATFORM_PSERIES_LPAR) + if (of_get_flat_dt_prop(node, "ibm,hypertas-functions", NULL) != NULL) ppc64_firmware_features |= FW_FEATURE_LPAR; return 1; } +static int __init pSeries_probe(void) +{ + char *dtype = of_get_flat_dt_prop(of_get_flat_dt_root(), + "device_type", NULL); + if (dtype == NULL) + return 0; + if (strcmp(dtype, "chrp")) + return 0; + + DBG("pSeries detected, looking for LPAR capability...\n"); + + /* Now try to figure out if we are running on LPAR */ + of_scan_flat_dt(pSeries_probe_hypertas, NULL); + + DBG("Machine is%s LPAR !\n", + (ppc64_firmware_features & FW_FEATURE_LPAR) ? "" : " not"); + + return 1; +} + DECLARE_PER_CPU(unsigned long, smt_snooze_delay); static inline void dedicated_idle_sleep(unsigned int cpu) @@ -606,7 +624,8 @@ static void pseries_kexec_cpu_down(int c } #endif -struct machdep_calls __initdata pSeries_md = { +define_machine(pseries) { + .name = "pSeries", .probe = pSeries_probe, .setup_arch = pSeries_setup_arch, .init_early = pSeries_init_early, Index: linux-work/include/asm-powerpc/machdep.h =================================================================== --- linux-work.orig/include/asm-powerpc/machdep.h 2006-01-14 15:37:50.000000000 +1100 +++ linux-work/include/asm-powerpc/machdep.h 2006-01-14 16:05:16.000000000 +1100 @@ -47,6 +47,7 @@ struct smp_ops_t { #endif struct machdep_calls { + char *name; #ifdef CONFIG_PPC64 void (*hpte_invalidate)(unsigned long slot, unsigned long va, @@ -85,9 +86,9 @@ struct machdep_calls { void (*iommu_dev_setup)(struct pci_dev *dev); void (*iommu_bus_setup)(struct pci_bus *bus); void (*irq_bus_setup)(struct pci_bus *bus); -#endif +#endif /* CONFIG_PPC64 */ - int (*probe)(int platform); + int (*probe)(void); void (*setup_arch)(void); void (*init_early)(void); /* Optional, may be NULL. */ @@ -208,8 +209,6 @@ struct machdep_calls { /* Called at then very end of pcibios_init() */ void (*pcibios_after_init)(void); - /* this is for modules, since _machine can be a define -- Cort */ - int ppc_machine; #endif /* CONFIG_PPC32 */ /* Called to shutdown machine specific hardware not already controlled @@ -245,7 +244,26 @@ struct machdep_calls { extern void default_idle(void); extern void native_idle(void); +/* + * ppc_md contains a copy of the machine description structure for the + * current platform. machine_id contains the initial address where the + * description was found during boot. + */ extern struct machdep_calls ppc_md; +extern struct machdep_calls *machine_id; + +#define __machine_desc __attribute__ ((__section__ (".machine.desc"))) + +#define define_machine(name) struct machdep_calls mach_##name __machine_desc = +#define machine_is(name) \ + ({ \ + extern struct machdep_calls mach_##name \ + __attribute__((weak)); \ + machine_id == &mach_##name; \ + }) + +extern void probe_machine(void); + extern char cmd_line[COMMAND_LINE_SIZE]; #ifdef CONFIG_PPC_PMAC Index: linux-work/include/asm-powerpc/processor.h =================================================================== --- linux-work.orig/include/asm-powerpc/processor.h 2006-01-14 16:05:13.000000000 +1100 +++ linux-work/include/asm-powerpc/processor.h 2006-01-14 16:05:16.000000000 +1100 @@ -22,22 +22,6 @@ * -- BenH. */ -/* Platforms codes (to be obsoleted) */ -#define PLATFORM_PSERIES 0x0100 -#define PLATFORM_PSERIES_LPAR 0x0101 -#define PLATFORM_ISERIES_LPAR 0x0201 -#define PLATFORM_LPAR 0x0001 -#define PLATFORM_POWERMAC 0x0400 -#define PLATFORM_MAPLE 0x0500 -#define PLATFORM_PREP 0x0600 -#define PLATFORM_CHRP 0x0700 -#define PLATFORM_CELL 0x1000 - -/* Compat platform codes for 32 bits */ -#define _MACH_prep PLATFORM_PREP -#define _MACH_Pmac PLATFORM_POWERMAC -#define _MACH_chrp PLATFORM_CHRP - /* PREP sub-platform types see residual.h for these */ #define _PREP_Motorola 0x01 /* motorola prep */ #define _PREP_Firm 0x02 /* firmworks prep */ @@ -50,13 +34,7 @@ #define _CHRP_Pegasos 0x06 /* Genesi/bplan's Pegasos and Pegasos2 */ #ifdef __KERNEL__ -#define platform_is_pseries() (_machine == PLATFORM_PSERIES || \ - _machine == PLATFORM_PSERIES_LPAR) - -#if defined(CONFIG_PPC_MULTIPLATFORM) -extern int _machine; - -#ifdef CONFIG_PPC32 +#if defined(CONFIG_PPC_MULTIPLATFORM) && defined(CONFIG_PPC32) /* what kind of prep workstation we are */ extern int _prep_type; @@ -71,16 +49,8 @@ extern unsigned char ucBoardRev; extern unsigned char ucBoardRevMaj, ucBoardRevMin; #endif /* CONFIG_PPC32 */ - -#elif defined(CONFIG_PPC_ISERIES) -/* - * iSeries is soon to become MULTIPLATFORM hopefully ... - */ -#define _machine PLATFORM_ISERIES_LPAR -#else -#define _machine 0 -#endif /* CONFIG_PPC_MULTIPLATFORM */ #endif /* __KERNEL__ */ + /* * Default implementation of macro that returns current * instruction pointer ("program counter"). Index: linux-work/include/asm-powerpc/prom.h =================================================================== --- linux-work.orig/include/asm-powerpc/prom.h 2006-01-14 15:37:50.000000000 +1100 +++ linux-work/include/asm-powerpc/prom.h 2006-01-14 16:05:16.000000000 +1100 @@ -139,12 +139,14 @@ extern struct device_node *of_node_get(s extern void of_node_put(struct device_node *node); /* For scanning the flat device-tree at boot time */ -int __init of_scan_flat_dt(int (*it)(unsigned long node, - const char *uname, int depth, - void *data), - void *data); -void* __init of_get_flat_dt_prop(unsigned long node, const char *name, - unsigned long *size); +extern int __init of_scan_flat_dt(int (*it)(unsigned long node, + const char *uname, int depth, + void *data), + void *data); +extern void* __init of_get_flat_dt_prop(unsigned long node, const char *name, + unsigned long *size); +extern int __init of_flat_dt_is_compatible(unsigned long node, const char *name); +extern unsigned long __init of_get_flat_dt_root(void); /* For updating the device tree at runtime */ extern void of_attach_node(struct device_node *); Index: linux-work/arch/powerpc/kernel/nvram_64.c =================================================================== --- linux-work.orig/arch/powerpc/kernel/nvram_64.c 2006-01-14 15:37:50.000000000 +1100 +++ linux-work/arch/powerpc/kernel/nvram_64.c 2006-01-14 16:05:16.000000000 +1100 @@ -160,7 +160,7 @@ static int dev_nvram_ioctl(struct inode case IOC_NVRAM_GET_OFFSET: { int part, offset; - if (_machine != PLATFORM_POWERMAC) + if (!machine_is(powermac)) return -EINVAL; if (copy_from_user(&part, (void __user*)arg, sizeof(part)) != 0) return -EFAULT; @@ -443,7 +443,7 @@ static int nvram_setup_partition(void) * in our nvram, as Apple defined partitions use pretty much * all of the space */ - if (_machine == PLATFORM_POWERMAC) + if (machine_is(powermac)) return -ENOSPC; /* see if we have an OS partition that meets our needs. Index: linux-work/arch/powerpc/kernel/proc_ppc64.c =================================================================== --- linux-work.orig/arch/powerpc/kernel/proc_ppc64.c 2006-01-14 15:37:50.000000000 +1100 +++ linux-work/arch/powerpc/kernel/proc_ppc64.c 2006-01-14 16:05:16.000000000 +1100 @@ -23,6 +23,7 @@ #include #include +#include #include #include #include @@ -51,7 +52,7 @@ static int __init proc_ppc64_create(void if (!root) return 1; - if (!(platform_is_pseries() || _machine == PLATFORM_CELL)) + if (!machine_is(pseries) && !machine_is(cell)) return 0; if (!proc_mkdir("rtas", root)) Index: linux-work/arch/powerpc/kernel/rtas-proc.c =================================================================== --- linux-work.orig/arch/powerpc/kernel/rtas-proc.c 2006-01-14 15:37:50.000000000 +1100 +++ linux-work/arch/powerpc/kernel/rtas-proc.c 2006-01-14 16:05:16.000000000 +1100 @@ -258,7 +258,7 @@ static int __init proc_rtas_init(void) { struct proc_dir_entry *entry; - if (_machine != PLATFORM_PSERIES && _machine != PLATFORM_PSERIES_LPAR) + if (!machine_is(pseries)) return 1; rtas_node = of_find_node_by_name(NULL, "rtas"); Index: linux-work/arch/powerpc/kernel/rtas.c =================================================================== --- linux-work.orig/arch/powerpc/kernel/rtas.c 2006-01-14 15:37:50.000000000 +1100 +++ linux-work/arch/powerpc/kernel/rtas.c 2006-01-14 16:05:16.000000000 +1100 @@ -24,6 +24,7 @@ #include #include #include +#include #include #include #include @@ -675,7 +676,7 @@ void __init rtas_initialize(void) * the stop-self token if any */ #ifdef CONFIG_PPC64 - if (_machine == PLATFORM_PSERIES_LPAR) + if (machine_is(pseries) && firmware_has_feature(FW_FEATURE_LPAR)) rtas_region = min(lmb.rmo_size, RTAS_INSTANTIATE_MAX); #endif rtas_rmo_buf = lmb_alloc_base(RTAS_RMOBUF_MAX, PAGE_SIZE, rtas_region); Index: linux-work/arch/powerpc/kernel/traps.c =================================================================== --- linux-work.orig/arch/powerpc/kernel/traps.c 2006-01-14 15:37:50.000000000 +1100 +++ linux-work/arch/powerpc/kernel/traps.c 2006-01-14 16:05:16.000000000 +1100 @@ -97,7 +97,6 @@ static DEFINE_SPINLOCK(die_lock); int die(const char *str, struct pt_regs *regs, long err) { static int die_counter, crash_dump_start = 0; - int nl = 0; if (debugger(regs)) return 1; @@ -106,7 +105,7 @@ int die(const char *str, struct pt_regs spin_lock_irq(&die_lock); bust_spinlocks(1); #ifdef CONFIG_PMAC_BACKLIGHT - if (_machine == _MACH_Pmac) { + if (machine_is(powermac)) { set_backlight_enable(1); set_backlight_level(BACKLIGHT_MAX); } @@ -114,46 +113,18 @@ int die(const char *str, struct pt_regs printk("Oops: %s, sig: %ld [#%d]\n", str, err, ++die_counter); #ifdef CONFIG_PREEMPT printk("PREEMPT "); - nl = 1; #endif #ifdef CONFIG_SMP printk("SMP NR_CPUS=%d ", NR_CPUS); - nl = 1; #endif #ifdef CONFIG_DEBUG_PAGEALLOC printk("DEBUG_PAGEALLOC "); - nl = 1; #endif #ifdef CONFIG_NUMA printk("NUMA "); - nl = 1; #endif -#ifdef CONFIG_PPC64 - switch (_machine) { - case PLATFORM_PSERIES: - printk("PSERIES "); - nl = 1; - break; - case PLATFORM_PSERIES_LPAR: - printk("PSERIES LPAR "); - nl = 1; - break; - case PLATFORM_ISERIES_LPAR: - printk("ISERIES LPAR "); - nl = 1; - break; - case PLATFORM_POWERMAC: - printk("POWERMAC "); - nl = 1; - break; - case PLATFORM_CELL: - printk("CELL "); - nl = 1; - break; - } -#endif - if (nl) - printk("\n"); + printk("%s\n", ppc_md.name ? "" : ppc_md.name); + print_modules(); show_regs(regs); bust_spinlocks(0); Index: linux-work/arch/powerpc/platforms/powermac/feature.c =================================================================== --- linux-work.orig/arch/powerpc/platforms/powermac/feature.c 2006-01-14 15:37:50.000000000 +1100 +++ linux-work/arch/powerpc/platforms/powermac/feature.c 2006-01-14 16:05:16.000000000 +1100 @@ -2954,7 +2954,7 @@ static void *pmac_early_vresume_data; void pmac_set_early_video_resume(void (*proc)(void *data), void *data) { - if (_machine != _MACH_Pmac) + if (!machine_is(powermac)) return; preempt_disable(); pmac_early_vresume_proc = proc; Index: linux-work/arch/powerpc/platforms/powermac/nvram.c =================================================================== --- linux-work.orig/arch/powerpc/platforms/powermac/nvram.c 2006-01-14 15:37:50.000000000 +1100 +++ linux-work/arch/powerpc/platforms/powermac/nvram.c 2006-01-14 16:05:16.000000000 +1100 @@ -599,7 +599,7 @@ int __init pmac_nvram_init(void) } #ifdef CONFIG_PPC32 - if (_machine == _MACH_chrp && nvram_naddrs == 1) { + if (machine_is(chrp) && nvram_naddrs == 1) { nvram_data = ioremap(r1.start, s1); nvram_mult = 1; ppc_md.nvram_read_val = direct_nvram_read_byte; Index: linux-work/arch/powerpc/platforms/pseries/eeh.c =================================================================== --- linux-work.orig/arch/powerpc/platforms/pseries/eeh.c 2006-01-14 15:37:50.000000000 +1100 +++ linux-work/arch/powerpc/platforms/pseries/eeh.c 2006-01-14 16:05:16.000000000 +1100 @@ -1004,7 +1004,7 @@ static int __init eeh_init_proc(void) { struct proc_dir_entry *e; - if (platform_is_pseries()) { + if (machine_is(pseries)) { e = create_proc_entry("ppc64/eeh", 0, NULL); if (e) e->proc_fops = &proc_eeh_operations; Index: linux-work/arch/powerpc/platforms/pseries/pci.c =================================================================== --- linux-work.orig/arch/powerpc/platforms/pseries/pci.c 2006-01-14 15:37:50.000000000 +1100 +++ linux-work/arch/powerpc/platforms/pseries/pci.c 2006-01-14 16:05:16.000000000 +1100 @@ -122,7 +122,7 @@ static void fixup_winbond_82c105(struct int i; unsigned int reg; - if (!platform_is_pseries()) + if (!machine_is(pseries)) return; printk("Using INTC for W82c105 IDE controller.\n"); Index: linux-work/arch/powerpc/platforms/pseries/reconfig.c =================================================================== --- linux-work.orig/arch/powerpc/platforms/pseries/reconfig.c 2006-01-14 15:37:50.000000000 +1100 +++ linux-work/arch/powerpc/platforms/pseries/reconfig.c 2006-01-14 16:05:16.000000000 +1100 @@ -17,8 +17,9 @@ #include #include -#include +#include #include +#include @@ -408,7 +409,7 @@ static int proc_ppc64_create_ofdt(void) { struct proc_dir_entry *ent; - if (!platform_is_pseries()) + if (!machine_is(pseries)) return 0; ent = create_proc_entry("ppc64/ofdt", S_IWUSR, NULL); Index: linux-work/arch/powerpc/platforms/pseries/rtasd.c =================================================================== --- linux-work.orig/arch/powerpc/platforms/pseries/rtasd.c 2006-01-14 15:37:50.000000000 +1100 +++ linux-work/arch/powerpc/platforms/pseries/rtasd.c 2006-01-14 16:05:16.000000000 +1100 @@ -27,6 +27,7 @@ #include #include #include +#include #if 0 #define DEBUG(A...) printk(KERN_ERR A) @@ -481,7 +482,7 @@ static int __init rtas_init(void) { struct proc_dir_entry *entry; - if (!platform_is_pseries()) + if (!machine_is(pseries)) return 0; /* No RTAS */ Index: linux-work/arch/powerpc/platforms/Makefile =================================================================== --- linux-work.orig/arch/powerpc/platforms/Makefile 2006-01-14 15:37:50.000000000 +1100 +++ linux-work/arch/powerpc/platforms/Makefile 2006-01-14 16:05:16.000000000 +1100 @@ -9,7 +9,10 @@ obj-$(CONFIG_PPC_CHRP) += chrp/ obj-$(CONFIG_4xx) += 4xx/ obj-$(CONFIG_PPC_83xx) += 83xx/ obj-$(CONFIG_85xx) += 85xx/ -obj-$(CONFIG_PPC_PSERIES) += pseries/ obj-$(CONFIG_PPC_ISERIES) += iseries/ obj-$(CONFIG_PPC_MAPLE) += maple/ obj-$(CONFIG_PPC_CELL) += cell/ + +# Keep pSeries last in link order as it's probing is a bit weak and might +# match some of the other platforms incorrectly +obj-$(CONFIG_PPC_PSERIES) += pseries/ Index: linux-work/include/asm-powerpc/vdso_datapage.h =================================================================== --- linux-work.orig/include/asm-powerpc/vdso_datapage.h 2006-01-14 15:37:50.000000000 +1100 +++ linux-work/include/asm-powerpc/vdso_datapage.h 2006-01-14 16:05:16.000000000 +1100 @@ -55,6 +55,9 @@ struct vdso_data { __u32 minor; /* Minor number 0x14 */ } version; + /* Note about the platform flags: it now only contains the lpar + * bit. The actual platform number is dead and burried + */ __u32 platform; /* Platform flags 0x18 */ __u32 processor; /* Processor type 0x1C */ __u64 processorCount; /* # of physical processors 0x20 */ Index: linux-work/arch/powerpc/kernel/vdso.c =================================================================== --- linux-work.orig/arch/powerpc/kernel/vdso.c 2006-01-14 15:37:50.000000000 +1100 +++ linux-work/arch/powerpc/kernel/vdso.c 2006-01-14 16:05:16.000000000 +1100 @@ -35,6 +35,7 @@ #include #include #include +#include #include #include @@ -669,7 +670,13 @@ void __init vdso_init(void) vdso_data->version.major = SYSTEMCFG_MAJOR; vdso_data->version.minor = SYSTEMCFG_MINOR; vdso_data->processor = mfspr(SPRN_PVR); - vdso_data->platform = _machine; + /* + * Fake the old platform number for pSeries and iSeries and add + * in LPAR bit if necessary + */ + vdso_data->platform = machine_is(iseries) ? 0x200 : 0x100; + if (firmware_has_feature(FW_FEATURE_LPAR)) + vdso_data->platform |= 1; vdso_data->physicalMemorySize = lmb_phys_mem_size(); vdso_data->dcache_size = ppc64_caches.dsize; vdso_data->dcache_line_size = ppc64_caches.dline_size; Index: linux-work/arch/powerpc/kernel/asm-offsets.c =================================================================== --- linux-work.orig/arch/powerpc/kernel/asm-offsets.c 2006-01-14 15:37:50.000000000 +1100 +++ linux-work/arch/powerpc/kernel/asm-offsets.c 2006-01-14 16:05:16.000000000 +1100 @@ -106,8 +106,6 @@ int main(void) DEFINE(ICACHEL1LINESIZE, offsetof(struct ppc64_caches, iline_size)); DEFINE(ICACHEL1LOGLINESIZE, offsetof(struct ppc64_caches, log_iline_size)); DEFINE(ICACHEL1LINESPERPAGE, offsetof(struct ppc64_caches, ilines_per_page)); - DEFINE(PLATFORM_LPAR, PLATFORM_LPAR); - /* paca */ DEFINE(PACA_SIZE, sizeof(struct paca_struct)); DEFINE(PACAPACAINDEX, offsetof(struct paca_struct, paca_index)); Index: linux-work/arch/powerpc/kernel/prom_init.c =================================================================== --- linux-work.orig/arch/powerpc/kernel/prom_init.c 2006-01-14 15:37:50.000000000 +1100 +++ linux-work/arch/powerpc/kernel/prom_init.c 2006-01-14 16:05:16.000000000 +1100 @@ -180,6 +180,17 @@ static unsigned long __initdata prom_tce static unsigned long __initdata prom_tce_alloc_end; #endif +/* Platforms codes (to be obsoleted). Now only used within this + * file and ultimately gone too + */ +#define PLATFORM_PSERIES 0x0100 +#define PLATFORM_PSERIES_LPAR 0x0101 +#define PLATFORM_LPAR 0x0001 +#define PLATFORM_POWERMAC 0x0400 +#define PLATFORM_MAPLE 0x0500 +#define PLATFORM_CHRP 0x0700 +#define PLATFORM_CELL 0x1000 + static int __initdata of_platform; static char __initdata prom_cmd_line[COMMAND_LINE_SIZE]; @@ -2066,7 +2077,6 @@ unsigned long __init prom_init(unsigned { struct prom_t *_prom; unsigned long hdr; - u32 getprop_rval; unsigned long offset = reloc_offset(); #ifdef CONFIG_PPC32 @@ -2107,9 +2117,6 @@ unsigned long __init prom_init(unsigned * between pSeries SMP and pSeries LPAR */ RELOC(of_platform) = prom_find_machine_type(); - getprop_rval = RELOC(of_platform); - prom_setprop(_prom->chosen, "/chosen", "linux,platform", - &getprop_rval, sizeof(getprop_rval)); #ifdef CONFIG_PPC_PSERIES /* Index: linux-work/arch/powerpc/mm/hash_utils_64.c =================================================================== --- linux-work.orig/arch/powerpc/mm/hash_utils_64.c 2006-01-14 16:05:13.000000000 +1100 +++ linux-work/arch/powerpc/mm/hash_utils_64.c 2006-01-14 16:05:16.000000000 +1100 @@ -166,7 +166,7 @@ int htab_bolt_mapping(unsigned long vsta * normal insert callback here. */ #ifdef CONFIG_PPC_ISERIES - if (_machine == PLATFORM_ISERIES_LPAR) + if (machine_is(iseries)) ret = iSeries_hpte_insert(hpteg, va, virt_to_abs(paddr), tmp_mode, @@ -175,7 +175,7 @@ int htab_bolt_mapping(unsigned long vsta else #endif #ifdef CONFIG_PPC_PSERIES - if (_machine & PLATFORM_LPAR) + if (machine_is(pseries) && firmware_has_feature(FW_FEATURE_LPAR)) ret = pSeries_lpar_hpte_insert(hpteg, va, virt_to_abs(paddr), tmp_mode, @@ -294,8 +294,7 @@ static void __init htab_init_page_sizes( * Not in the device-tree, let's fallback on known size * list for 16M capable GP & GR */ - if ((_machine != PLATFORM_ISERIES_LPAR) && - cpu_has_feature(CPU_FTR_16M_PAGE)) + if (cpu_has_feature(CPU_FTR_16M_PAGE) && !machine_is(iseries)) memcpy(mmu_psize_defs, mmu_psize_defaults_gp, sizeof(mmu_psize_defaults_gp)); found: Index: linux-work/drivers/char/generic_nvram.c =================================================================== --- linux-work.orig/drivers/char/generic_nvram.c 2006-01-14 15:37:50.000000000 +1100 +++ linux-work/drivers/char/generic_nvram.c 2006-01-14 16:16:01.000000000 +1100 @@ -22,6 +22,9 @@ #include #include #include +#ifdef CONFIG_PPC_PMAC +#include +#endif #define NVRAM_SIZE 8192 @@ -92,7 +95,7 @@ static int nvram_ioctl(struct inode *ino case IOC_NVRAM_GET_OFFSET: { int part, offset; - if (_machine != _MACH_Pmac) + if (!machine_is(powermac)) return -EINVAL; if (copy_from_user(&part, (void __user*)arg, sizeof(part)) != 0) return -EFAULT; Index: linux-work/drivers/ide/pci/via82cxxx.c =================================================================== --- linux-work.orig/drivers/ide/pci/via82cxxx.c 2006-01-14 15:37:50.000000000 +1100 +++ linux-work/drivers/ide/pci/via82cxxx.c 2006-01-14 16:05:16.000000000 +1100 @@ -440,7 +440,7 @@ static void __devinit init_hwif_via82cxx #if defined(CONFIG_PPC_CHRP) && defined(CONFIG_PPC32) - if(_machine == _MACH_chrp && _chrp_type == _CHRP_Pegasos) { + if(machine_is(chrp) && _chrp_type == _CHRP_Pegasos) { hwif->irq = hwif->channel ? 15 : 14; } #endif Index: linux-work/drivers/ide/ppc/pmac.c =================================================================== --- linux-work.orig/drivers/ide/ppc/pmac.c 2006-01-14 15:37:50.000000000 +1100 +++ linux-work/drivers/ide/ppc/pmac.c 2006-01-14 16:05:16.000000000 +1100 @@ -1677,7 +1677,7 @@ MODULE_DEVICE_TABLE(pci, pmac_ide_pci_ma void __init pmac_ide_probe(void) { - if (_machine != _MACH_Pmac) + if (!machine_is(powermac)) return; #ifdef CONFIG_BLK_DEV_IDE_PMAC_ATA100FIRST Index: linux-work/drivers/ieee1394/ohci1394.c =================================================================== --- linux-work.orig/drivers/ieee1394/ohci1394.c 2006-01-14 15:37:50.000000000 +1100 +++ linux-work/drivers/ieee1394/ohci1394.c 2006-01-14 16:05:16.000000000 +1100 @@ -3526,7 +3526,7 @@ static void ohci1394_pci_remove(struct p static int ohci1394_pci_resume (struct pci_dev *pdev) { #ifdef CONFIG_PPC_PMAC - if (_machine == _MACH_Pmac) { + if (machine_is(powermac)) { struct device_node *of_node; /* Re-enable 1394 */ @@ -3545,7 +3545,7 @@ static int ohci1394_pci_resume (struct p static int ohci1394_pci_suspend (struct pci_dev *pdev, pm_message_t state) { #ifdef CONFIG_PPC_PMAC - if (_machine == _MACH_Pmac) { + if (machine_is(powermac)) { struct device_node *of_node; /* Disable 1394 */ Index: linux-work/drivers/macintosh/adb.c =================================================================== --- linux-work.orig/drivers/macintosh/adb.c 2006-01-14 15:37:50.000000000 +1100 +++ linux-work/drivers/macintosh/adb.c 2006-01-14 16:28:16.000000000 +1100 @@ -42,6 +42,7 @@ #include #ifdef CONFIG_PPC #include +#include #endif @@ -294,7 +295,7 @@ int __init adb_init(void) int i; #ifdef CONFIG_PPC32 - if ( (_machine != _MACH_chrp) && (_machine != _MACH_Pmac) ) + if (!machine_is(chrp) && !machine_is(powermac)) return 0; #endif #ifdef CONFIG_MAC Index: linux-work/drivers/macintosh/adbhid.c =================================================================== --- linux-work.orig/drivers/macintosh/adbhid.c 2006-01-14 15:37:50.000000000 +1100 +++ linux-work/drivers/macintosh/adbhid.c 2006-01-14 16:05:16.000000000 +1100 @@ -1206,8 +1206,8 @@ init_ms_a3(int id) static int __init adbhid_init(void) { #ifndef CONFIG_MAC - if ( (_machine != _MACH_chrp) && (_machine != _MACH_Pmac) ) - return 0; + if (!machine_is(chrp) && !machine_is(powermac)) + return 0; #endif led_request.complete = 1; Index: linux-work/drivers/macintosh/mediabay.c =================================================================== --- linux-work.orig/drivers/macintosh/mediabay.c 2006-01-14 15:37:50.000000000 +1100 +++ linux-work/drivers/macintosh/mediabay.c 2006-01-14 16:05:16.000000000 +1100 @@ -839,8 +839,8 @@ static int __init media_bay_init(void) media_bays[i].cd_index = -1; #endif } - if (_machine != _MACH_Pmac) - return -ENODEV; + if (!machine_is(powermac)) + return 0; macio_register_driver(&media_bay_driver); Index: linux-work/drivers/media/video/planb.c =================================================================== --- linux-work.orig/drivers/media/video/planb.c 2006-01-14 15:37:50.000000000 +1100 +++ linux-work/drivers/media/video/planb.c 2006-01-14 16:05:16.000000000 +1100 @@ -2156,7 +2156,7 @@ static int find_planb(void) struct pci_dev *pdev; int rc; - if (_machine != _MACH_Pmac) + if (!machine_is(powermac)) return 0; planb_devices = find_devices("planb"); Index: linux-work/drivers/scsi/mesh.c =================================================================== --- linux-work.orig/drivers/scsi/mesh.c 2006-01-14 15:37:50.000000000 +1100 +++ linux-work/drivers/scsi/mesh.c 2006-01-14 16:05:16.000000000 +1100 @@ -1748,7 +1748,7 @@ static int mesh_host_reset(struct scsi_c static void set_mesh_power(struct mesh_state *ms, int state) { - if (_machine != _MACH_Pmac) + if (!machine_is(powermac)) return; if (state) { pmac_call_feature(PMAC_FTR_MESH_ENABLE, macio_get_of_node(ms->mdev), 0, 1); Index: linux-work/drivers/usb/core/hcd-pci.c =================================================================== --- linux-work.orig/drivers/usb/core/hcd-pci.c 2006-01-14 15:37:50.000000000 +1100 +++ linux-work/drivers/usb/core/hcd-pci.c 2006-01-14 16:05:16.000000000 +1100 @@ -291,7 +291,7 @@ done: #ifdef CONFIG_PPC_PMAC /* Disable ASIC clocks for USB */ - if (_machine == _MACH_Pmac) { + if (machine_is(powermac)) { struct device_node *of_node; of_node = pci_device_to_OF_node (dev); @@ -326,7 +326,7 @@ int usb_hcd_pci_resume (struct pci_dev * #ifdef CONFIG_PPC_PMAC /* Reenable ASIC clocks for USB */ - if (_machine == _MACH_Pmac) { + if (machine_is(powermac)) { struct device_node *of_node; of_node = pci_device_to_OF_node (dev); Index: linux-work/drivers/video/aty/aty128fb.c =================================================================== --- linux-work.orig/drivers/video/aty/aty128fb.c 2006-01-14 15:37:50.000000000 +1100 +++ linux-work/drivers/video/aty/aty128fb.c 2006-01-14 16:05:16.000000000 +1100 @@ -67,6 +67,7 @@ #include #ifdef CONFIG_PPC_PMAC +#include #include #include #include @@ -1748,7 +1749,7 @@ static int __init aty128_init(struct pci var = default_var; #ifdef CONFIG_PPC_PMAC - if (_machine == _MACH_Pmac) { + if (machine_is(powermac)) { /* Indicate sleep capability */ if (par->chip_gen == rage_M3) { pmac_call_feature(PMAC_FTR_DEVICE_CAN_WAKE, NULL, 0, 1); @@ -2011,7 +2012,7 @@ static int aty128fb_blank(int blank, str return 0; #ifdef CONFIG_PMAC_BACKLIGHT - if ((_machine == _MACH_Pmac) && blank) + if (machine_is(powermac) && blank) set_backlight_enable(0); #endif /* CONFIG_PMAC_BACKLIGHT */ @@ -2029,7 +2030,7 @@ static int aty128fb_blank(int blank, str aty128_set_lcd_enable(par, par->lcd_on && !blank); } #ifdef CONFIG_PMAC_BACKLIGHT - if ((_machine == _MACH_Pmac) && !blank) + if (machine_is(powermac) && !blank) set_backlight_enable(1); #endif /* CONFIG_PMAC_BACKLIGHT */ return 0; Index: linux-work/drivers/video/aty/atyfb_base.c =================================================================== --- linux-work.orig/drivers/video/aty/atyfb_base.c 2006-01-14 15:37:50.000000000 +1100 +++ linux-work/drivers/video/aty/atyfb_base.c 2006-01-14 16:05:16.000000000 +1100 @@ -75,6 +75,7 @@ #include "ati_ids.h" #ifdef __powerpc__ +#include #include #include "../macmodes.h" #endif @@ -2518,7 +2519,7 @@ static int __init aty_init(struct fb_inf memset(&var, 0, sizeof(var)); #ifdef CONFIG_PPC - if (_machine == _MACH_Pmac) { + if (machine_is(powermac)) { /* * FIXME: The NVRAM stuff should be put in a Mac-specific file, as it * applies to all Mac video cards @@ -2673,7 +2674,7 @@ static int atyfb_blank(int blank, struct return 0; #ifdef CONFIG_PMAC_BACKLIGHT - if ((_machine == _MACH_Pmac) && blank > FB_BLANK_NORMAL) + if (machine_is(powermac) && blank > FB_BLANK_NORMAL) set_backlight_enable(0); #elif defined(CONFIG_FB_ATY_GENERIC_LCD) if (par->lcd_table && blank > FB_BLANK_NORMAL && @@ -2705,7 +2706,7 @@ static int atyfb_blank(int blank, struct aty_st_le32(CRTC_GEN_CNTL, gen_cntl, par); #ifdef CONFIG_PMAC_BACKLIGHT - if ((_machine == _MACH_Pmac) && blank <= FB_BLANK_NORMAL) + if (machine_is(powermac) && blank <= FB_BLANK_NORMAL) set_backlight_enable(1); #elif defined(CONFIG_FB_ATY_GENERIC_LCD) if (par->lcd_table && blank <= FB_BLANK_NORMAL && Index: linux-work/drivers/video/aty/radeon_pm.c =================================================================== --- linux-work.orig/drivers/video/aty/radeon_pm.c 2006-01-14 15:37:50.000000000 +1100 +++ linux-work/drivers/video/aty/radeon_pm.c 2006-01-14 16:05:16.000000000 +1100 @@ -20,7 +20,7 @@ #include #ifdef CONFIG_PPC_PMAC -#include +#include #include #include #endif @@ -2735,7 +2735,7 @@ void radeonfb_pm_init(struct radeonfb_in * reason. --BenH */ #if defined(CONFIG_PM) && defined(CONFIG_PPC_OF) - if (_machine == _MACH_Pmac && rinfo->of_node) { + if (machine_is(powermac) && rinfo->of_node) { if (rinfo->is_mobility && rinfo->pm_reg && rinfo->family <= CHIP_FAMILY_RV250) rinfo->pm_mode |= radeon_pm_d2; Index: linux-work/drivers/video/cirrusfb.c =================================================================== --- linux-work.orig/drivers/video/cirrusfb.c 2006-01-14 15:37:50.000000000 +1100 +++ linux-work/drivers/video/cirrusfb.c 2006-01-14 16:05:16.000000000 +1100 @@ -60,8 +60,8 @@ #include #endif #ifdef CONFIG_PPC_PREP -#include -#define isPReP (_machine == _MACH_prep) +#include +#define isPReP (machine_is(prep)) #else #define isPReP 0 #endif Index: linux-work/drivers/video/matrox/matroxfb_base.c =================================================================== --- linux-work.orig/drivers/video/matrox/matroxfb_base.c 2006-01-14 15:37:50.000000000 +1100 +++ linux-work/drivers/video/matrox/matroxfb_base.c 2006-01-14 16:05:16.000000000 +1100 @@ -116,6 +116,7 @@ #include #ifdef CONFIG_PPC_PMAC +#include unsigned char nvram_read_byte(int); static int default_vmode = VMODE_NVRAM; static int default_cmode = CMODE_NVRAM; @@ -1835,7 +1836,7 @@ static int initMatrox2(WPMINFO struct bo /* FIXME: Where to move this?! */ #if defined(CONFIG_PPC_PMAC) #ifndef MODULE - if (_machine == _MACH_Pmac) { + if (machine_is(powermac)) { struct fb_var_screeninfo var; if (default_vmode <= 0 || default_vmode > VMODE_MAX) default_vmode = VMODE_640_480_60; Index: linux-work/drivers/video/nvidia/nvidia.c =================================================================== --- linux-work.orig/drivers/video/nvidia/nvidia.c 2006-01-14 15:37:50.000000000 +1100 +++ linux-work/drivers/video/nvidia/nvidia.c 2006-01-14 16:05:16.000000000 +1100 @@ -29,6 +29,7 @@ #include #endif #ifdef CONFIG_PMAC_BACKLIGHT +#include #include #endif @@ -1351,7 +1352,7 @@ static int nvidiafb_blank(int blank, str NVWriteCrtc(par, 0x1a, vesa); #ifdef CONFIG_PMAC_BACKLIGHT - if (par->FlatPanel && _machine == _MACH_Pmac) { + if (par->FlatPanel && machine_is(powermac)) { set_backlight_enable(!blank); } #endif @@ -1686,7 +1687,7 @@ static int __devinit nvidiafb_probe(stru info->fix.id, par->FbMapSize / (1024 * 1024), info->fix.smem_start); #ifdef CONFIG_PMAC_BACKLIGHT - if (par->FlatPanel && _machine == _MACH_Pmac) + if (par->FlatPanel && machine_is(powermac)) register_backlight_controller(&nvidia_backlight_controller, par, "mnca"); #endif Index: linux-work/drivers/video/radeonfb.c =================================================================== --- linux-work.orig/drivers/video/radeonfb.c 2006-01-14 15:37:50.000000000 +1100 +++ linux-work/drivers/video/radeonfb.c 2006-01-14 16:05:16.000000000 +1100 @@ -1596,7 +1596,7 @@ static int radeonfb_blank (int blank, st return 0; #ifdef CONFIG_PMAC_BACKLIGHT - if (rinfo->dviDisp_type == MT_LCD && _machine == _MACH_Pmac) { + if (rinfo->dviDisp_type == MT_LCD && machine_is(powermac)) { set_backlight_enable(!blank); return 0; } Index: linux-work/drivers/video/riva/fbdev.c =================================================================== --- linux-work.orig/drivers/video/riva/fbdev.c 2006-01-14 15:37:50.000000000 +1100 +++ linux-work/drivers/video/riva/fbdev.c 2006-01-14 16:05:16.000000000 +1100 @@ -49,6 +49,7 @@ #include #endif #ifdef CONFIG_PMAC_BACKLIGHT +#include #include #endif @@ -1247,7 +1248,7 @@ static int rivafb_blank(int blank, struc CRTCout(par, 0x1a, vesa); #ifdef CONFIG_PMAC_BACKLIGHT - if ( par->FlatPanel && _machine == _MACH_Pmac) { + if ( par->FlatPanel && machine_is(powermac)) { set_backlight_enable(!blank); } #endif @@ -2037,9 +2038,9 @@ static int __devinit rivafb_probe(struct info->fix.smem_len / (1024 * 1024), info->fix.smem_start); #ifdef CONFIG_PMAC_BACKLIGHT - if (default_par->FlatPanel && _machine == _MACH_Pmac) - register_backlight_controller(&riva_backlight_controller, - default_par, "mnca"); + if (default_par->FlatPanel && machine_is(powermac)) + register_backlight_controller(&riva_backlight_controller, + default_par, "mnca"); #endif NVTRACE_LEAVE(); return 0; Index: linux-work/include/asm-powerpc/pmac_feature.h =================================================================== --- linux-work.orig/include/asm-powerpc/pmac_feature.h 2006-01-14 15:37:50.000000000 +1100 +++ linux-work/include/asm-powerpc/pmac_feature.h 2006-01-14 16:05:16.000000000 +1100 @@ -305,7 +305,7 @@ extern void pmac_feature_init(void); extern void pmac_set_early_video_resume(void (*proc)(void *data), void *data); extern void pmac_call_early_video_resume(void); -#define PMAC_FTR_DEF(x) ((_MACH_Pmac << 16) | (x)) +#define PMAC_FTR_DEF(x) ((0x6660000) | (x)) /* The AGP driver registers itself here */ extern void pmac_register_agp_pm(struct pci_dev *bridge, Index: linux-work/arch/powerpc/platforms/powermac/low_i2c.c =================================================================== --- linux-work.orig/arch/powerpc/platforms/powermac/low_i2c.c 2006-01-14 15:37:50.000000000 +1100 +++ linux-work/arch/powerpc/platforms/powermac/low_i2c.c 2006-01-14 16:05:16.000000000 +1100 @@ -1458,6 +1458,9 @@ int __init pmac_i2c_init(void) return 0; i2c_inited = 1; + if (!machine_is(powermac)) + return 0; + /* Probe keywest-i2c busses */ kw_i2c_probe(); Index: linux-work/arch/powerpc/platforms/powermac/pfunc_base.c =================================================================== --- linux-work.orig/arch/powerpc/platforms/powermac/pfunc_base.c 2006-01-14 15:37:50.000000000 +1100 +++ linux-work/arch/powerpc/platforms/powermac/pfunc_base.c 2006-01-14 16:05:16.000000000 +1100 @@ -331,6 +331,8 @@ int __init pmac_pfunc_base_install(void) return 0; pfbase_inited = 1; + if (!machine_is(powermac)) + return 0; DBG("Installing base platform functions...\n"); Index: linux-work/fs/partitions/mac.c =================================================================== --- linux-work.orig/fs/partitions/mac.c 2006-01-14 15:37:50.000000000 +1100 +++ linux-work/fs/partitions/mac.c 2006-01-14 16:05:16.000000000 +1100 @@ -12,6 +12,7 @@ #include "mac.h" #ifdef CONFIG_PPC_PMAC +#include extern void note_bootable_part(dev_t dev, int part, int goodness); #endif @@ -79,7 +80,7 @@ int mac_partition(struct parsed_partitio * If this is the first bootable partition, tell the * setup code, in case it wants to make this the root. */ - if (_machine == _MACH_Pmac) { + if (machine_is(powermac)) { int goodness = 0; mac_fix_string(part->processor, 16); Index: linux-work/sound/oss/dmasound/dmasound_awacs.c =================================================================== --- linux-work.orig/sound/oss/dmasound/dmasound_awacs.c 2006-01-14 15:37:50.000000000 +1100 +++ linux-work/sound/oss/dmasound/dmasound_awacs.c 2006-01-14 16:05:16.000000000 +1100 @@ -2816,7 +2816,7 @@ int __init dmasound_awacs_init(void) struct device_node *io = NULL, *info = NULL; int vol, res; - if (_machine != _MACH_Pmac) + if (!machine_is(powermac)) return -ENODEV; awacs_subframe = 0; Index: linux-work/sound/ppc/pmac.c =================================================================== --- linux-work.orig/sound/ppc/pmac.c 2006-01-14 15:37:50.000000000 +1100 +++ linux-work/sound/ppc/pmac.c 2006-01-14 16:05:16.000000000 +1100 @@ -869,7 +869,7 @@ static int __init snd_pmac_detect(struct u32 layout_id = 0; - if (_machine != _MACH_Pmac) + if (!machine_is(powermac)) return -ENODEV; chip->subframe = 0; Index: linux-work/arch/powerpc/platforms/chrp/setup.c =================================================================== --- linux-work.orig/arch/powerpc/platforms/chrp/setup.c 2006-01-14 16:04:50.000000000 +1100 +++ linux-work/arch/powerpc/platforms/chrp/setup.c 2006-01-14 16:11:35.000000000 +1100 @@ -306,6 +306,10 @@ void __init chrp_setup_arch(void) pci_create_OF_bus_map(); +#ifdef CONFIG_SMP + smp_ops = &chrp_smp_ops; +#endif /* CONFIG_SMP */ + /* * Print the banner, then scroll down so boot progress * can be printed. -- Cort @@ -482,8 +486,15 @@ chrp_init2(void) ppc_md.progress(" Have fun! ", 0x7777); } -void __init chrp_init(void) +static int __init chrp_probe(void) { + char *dtype = of_get_flat_dt_prop(of_get_flat_dt_root(), + "device_type", NULL); + if (dtype == NULL) + return 0; + if (strcmp(dtype, "chrp")) + return 0; + ISA_DMA_THRESHOLD = ~0L; DMA_MODE_READ = 0x44; DMA_MODE_WRITE = 0x48; @@ -493,26 +504,24 @@ void __init chrp_init(void) /* Assume we have an 8259... */ __irq_offset_value = NUM_ISA_INTERRUPTS; - ppc_md.setup_arch = chrp_setup_arch; - ppc_md.show_cpuinfo = chrp_show_cpuinfo; - - ppc_md.init_IRQ = chrp_init_IRQ; - ppc_md.init = chrp_init2; - - ppc_md.phys_mem_access_prot = pci_phys_mem_access_prot; - - ppc_md.restart = rtas_restart; - ppc_md.power_off = rtas_power_off; - ppc_md.halt = rtas_halt; - - ppc_md.time_init = chrp_time_init; - ppc_md.calibrate_decr = chrp_calibrate_decr; + return 1; +} +define_machine(chrp) { + .name = "CHRP", + .probe = chrp_probe, + .setup_arch = chrp_setup_arch, + .show_cpuinfo = chrp_show_cpuinfo, + .init_IRQ = chrp_init_IRQ, + .init = chrp_init2, + .phys_mem_access_prot = pci_phys_mem_access_prot, + .restart = rtas_restart, + .power_off = rtas_power_off, + .halt = rtas_halt, + .time_init = chrp_time_init, + .calibrate_decr = chrp_calibrate_decr, /* this may get overridden with rtas routines later... */ - ppc_md.set_rtc_time = chrp_set_rtc_time; - ppc_md.get_rtc_time = chrp_get_rtc_time; + .set_rtc_time = chrp_set_rtc_time, + .get_rtc_time = chrp_get_rtc_time, +}; -#ifdef CONFIG_SMP - smp_ops = &chrp_smp_ops; -#endif /* CONFIG_SMP */ -} Index: linux-work/arch/powerpc/platforms/powermac/bootx_init.c =================================================================== --- linux-work.orig/arch/powerpc/platforms/powermac/bootx_init.c 2006-01-14 14:43:22.000000000 +1100 +++ linux-work/arch/powerpc/platforms/powermac/bootx_init.c 2006-01-14 16:13:00.000000000 +1100 @@ -161,9 +161,7 @@ static void __init bootx_dt_add_prop(cha static void __init bootx_add_chosen_props(unsigned long base, unsigned long *mem_end) { - u32 val = _MACH_Pmac; - - bootx_dt_add_prop("linux,platform", &val, 4, mem_end); + u32 val; if (bootx_info->kernelParamsOffset) { char *args = (char *)((unsigned long)bootx_info) + Index: linux-work/arch/powerpc/platforms/powermac/smp.c =================================================================== --- linux-work.orig/arch/powerpc/platforms/powermac/smp.c 2006-01-14 15:30:24.000000000 +1100 +++ linux-work/arch/powerpc/platforms/powermac/smp.c 2006-01-14 16:14:27.000000000 +1100 @@ -435,7 +435,7 @@ struct smp_ops_t psurge_smp_ops = { */ static void (*pmac_tb_freeze)(int freeze); -static unsigned long timebase; +static u64 timebase; static int tb_req; static void smp_core99_give_timebase(void) Index: linux-work/arch/powerpc/platforms/powermac/time.c =================================================================== --- linux-work.orig/arch/powerpc/platforms/powermac/time.c 2006-01-14 14:43:22.000000000 +1100 +++ linux-work/arch/powerpc/platforms/powermac/time.c 2006-01-14 16:17:51.000000000 +1100 @@ -336,10 +336,10 @@ static struct pmu_sleep_notifier time_sl */ void __init pmac_calibrate_decr(void) { -#ifdef CONFIG_PM +#if defined(CONFIG_PM) && defined(CONFIG_ADB_PMU) /* XXX why here? */ pmu_register_sleep_notifier(&time_sleep_notifier); -#endif /* CONFIG_PM */ +#endif generic_calibrate_decr(); Index: linux-work/arch/ppc/kernel/pci.c =================================================================== --- linux-work.orig/arch/ppc/kernel/pci.c 2006-01-14 14:43:22.000000000 +1100 +++ linux-work/arch/ppc/kernel/pci.c 2006-01-14 16:12:20.000000000 +1100 @@ -787,7 +787,7 @@ pci_busdev_to_OF_node(struct pci_bus *bu * fix has to be done by making the remapping per-host and always * filling the pci_to_OF map. --BenH */ - if (_machine == _MACH_Pmac && busnr >= 0xf0) + if (machine_is(powermac) && busnr >= 0xf0) busnr -= 0xf0; else #endif @@ -1728,7 +1728,7 @@ long sys_pciconfig_iobase(long which, un * (bus 0 is HT root), we return the AGP one instead. */ #ifdef CONFIG_PPC_PMAC - if (_machine == _MACH_Pmac && machine_is_compatible("MacRISC4")) + if (machine_is(powermac) && machine_is_compatible("MacRISC4")) if (bus == 0) bus = 0xf0; #endif /* CONFIG_PPC_PMAC */ Index: linux-work/drivers/net/tulip/de4x5.c =================================================================== --- linux-work.orig/drivers/net/tulip/de4x5.c 2006-01-14 14:43:28.000000000 +1100 +++ linux-work/drivers/net/tulip/de4x5.c 2006-01-14 16:16:55.000000000 +1100 @@ -4160,7 +4160,7 @@ get_hw_addr(struct net_device *dev) ** If the address starts with 00 a0, we have to bit-reverse ** each byte of the address. */ - if ( (_machine & _MACH_Pmac) && + if ( machine_is(powermac) && (dev->dev_addr[0] == 0) && (dev->dev_addr[1] == 0xa0) ) { From benh at kernel.crashing.org Sat Jan 14 16:46:47 2006 From: benh at kernel.crashing.org (Benjamin Herrenschmidt) Date: Sat, 14 Jan 2006 16:46:47 +1100 Subject: [PATCH] powerpc: Update pmac32_defconfig Message-ID: <1137217608.4854.40.camel@localhost.localdomain> Index: linux-work/arch/powerpc/configs/pmac32_defconfig =================================================================== --- linux-work.orig/arch/powerpc/configs/pmac32_defconfig 2006-01-14 14:43:22.000000000 +1100 +++ linux-work/arch/powerpc/configs/pmac32_defconfig 2006-01-14 16:45:22.000000000 +1100 @@ -1,7 +1,7 @@ # # Automatically generated make config: don't edit -# Linux kernel version: 2.6.15-rc5 -# Tue Dec 13 17:24:05 2005 +# Linux kernel version: 2.6.15 +# Sat Jan 14 16:26:08 2006 # # CONFIG_PPC64 is not set CONFIG_PPC32=y @@ -15,11 +15,15 @@ CONFIG_EARLY_PRINTK=y CONFIG_GENERIC_NVRAM=y CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y CONFIG_ARCH_MAY_HAVE_PC_FDC=y +CONFIG_PPC_OF=y +# CONFIG_PPC_UDBG_16550 is not set +# CONFIG_CRASH_DUMP is not set +# CONFIG_GENERIC_TBSYNC is not set # # Processor support # -CONFIG_6xx=y +CONFIG_CLASSIC32=y # CONFIG_PPC_52xx is not set # CONFIG_PPC_82xx is not set # CONFIG_PPC_83xx is not set @@ -28,6 +32,7 @@ CONFIG_6xx=y # CONFIG_8xx is not set # CONFIG_E200 is not set # CONFIG_E500 is not set +CONFIG_6xx=y CONFIG_PPC_FPU=y CONFIG_ALTIVEC=y CONFIG_PPC_STD_MMU=y @@ -53,17 +58,18 @@ CONFIG_POSIX_MQUEUE=y # CONFIG_BSD_PROCESS_ACCT is not set CONFIG_SYSCTL=y # CONFIG_AUDIT is not set -CONFIG_HOTPLUG=y -CONFIG_KOBJECT_UEVENT=y CONFIG_IKCONFIG=y CONFIG_IKCONFIG_PROC=y CONFIG_INITRAMFS_SOURCE="" +# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set # CONFIG_EMBEDDED is not set CONFIG_KALLSYMS=y # CONFIG_KALLSYMS_ALL is not set # CONFIG_KALLSYMS_EXTRA_PASS is not set +CONFIG_HOTPLUG=y CONFIG_PRINTK=y CONFIG_BUG=y +CONFIG_ELF_CORE=y CONFIG_BASE_FULL=y CONFIG_FUTEX=y CONFIG_EPOLL=y @@ -72,8 +78,10 @@ CONFIG_CC_ALIGN_FUNCTIONS=0 CONFIG_CC_ALIGN_LABELS=0 CONFIG_CC_ALIGN_LOOPS=0 CONFIG_CC_ALIGN_JUMPS=0 +CONFIG_SLAB=y # CONFIG_TINY_SHMEM is not set CONFIG_BASE_SMALL=0 +# CONFIG_SLOB is not set # # Loadable module support @@ -113,13 +121,10 @@ CONFIG_PPC_MULTIPLATFORM=y # CONFIG_APUS is not set # CONFIG_PPC_CHRP is not set CONFIG_PPC_PMAC=y -CONFIG_PPC_OF=y CONFIG_MPIC=y # CONFIG_PPC_RTAS is not set # CONFIG_MMIO_NVRAM is not set -# CONFIG_CRASH_DUMP is not set CONFIG_PPC_MPC106=y -# CONFIG_GENERIC_TBSYNC is not set CONFIG_CPU_FREQ=y CONFIG_CPU_FREQ_TABLE=y # CONFIG_CPU_FREQ_DEBUG is not set @@ -195,6 +200,11 @@ CONFIG_CARDBUS=y # PC-card bridges # CONFIG_YENTA=m +CONFIG_YENTA_O2=y +CONFIG_YENTA_RICOH=y +CONFIG_YENTA_TI=y +CONFIG_YENTA_ENE_TUNE=y +CONFIG_YENTA_TOSHIBA=y # CONFIG_PD6729 is not set # CONFIG_I82092 is not set CONFIG_PCCARD_NONSTATIC=m @@ -464,7 +474,7 @@ CONFIG_IEEE80211_CRYPT_TKIP=m # # CONFIG_STANDALONE is not set CONFIG_PREVENT_FIRMWARE_BUILD=y -CONFIG_FW_LOADER=m +CONFIG_FW_LOADER=y # CONFIG_DEBUG_DRIVER is not set # @@ -491,7 +501,7 @@ CONFIG_PROC_EVENTS=y # Block devices # # CONFIG_BLK_DEV_FD is not set -CONFIG_MAC_FLOPPY=y +CONFIG_MAC_FLOPPY=m # CONFIG_BLK_CPQ_DA is not set # CONFIG_BLK_CPQ_CISS_DA is not set # CONFIG_BLK_DEV_DAC960 is not set @@ -603,7 +613,7 @@ CONFIG_SCSI_CONSTANTS=y # SCSI Transport Attributes # CONFIG_SCSI_SPI_ATTRS=y -# CONFIG_SCSI_FC_ATTRS is not set +CONFIG_SCSI_FC_ATTRS=y # CONFIG_SCSI_ISCSI_ATTRS is not set # CONFIG_SCSI_SAS_ATTRS is not set @@ -645,12 +655,7 @@ CONFIG_SCSI_SYM53C8XX_MAX_TAGS=64 # CONFIG_SCSI_QLOGIC_FC is not set # CONFIG_SCSI_QLOGIC_1280 is not set CONFIG_SCSI_QLA2XXX=y -# CONFIG_SCSI_QLA21XX is not set -# CONFIG_SCSI_QLA22XX is not set -# CONFIG_SCSI_QLA2300 is not set -# CONFIG_SCSI_QLA2322 is not set -# CONFIG_SCSI_QLA6312 is not set -# CONFIG_SCSI_QLA24XX is not set +# CONFIG_SCSI_QLA2XXX_EMBEDDED_FIRMWARE is not set # CONFIG_SCSI_LPFC is not set # CONFIG_SCSI_DC395x is not set # CONFIG_SCSI_DC390T is not set @@ -658,7 +663,7 @@ CONFIG_SCSI_QLA2XXX=y # CONFIG_SCSI_DEBUG is not set CONFIG_SCSI_MESH=y CONFIG_SCSI_MESH_SYNC_RATE=5 -CONFIG_SCSI_MESH_RESET_DELAY_MS=1000 +CONFIG_SCSI_MESH_RESET_DELAY_MS=4000 CONFIG_SCSI_MAC53C94=y # @@ -727,7 +732,6 @@ CONFIG_IEEE1394_SBP2=m CONFIG_IEEE1394_ETH1394=m CONFIG_IEEE1394_DV1394=m CONFIG_IEEE1394_RAWIO=m -# CONFIG_IEEE1394_CMP is not set # # I2O device support @@ -740,7 +744,7 @@ CONFIG_IEEE1394_RAWIO=m CONFIG_ADB=y CONFIG_ADB_CUDA=y CONFIG_ADB_PMU=y -CONFIG_PMAC_APM_EMU=y +CONFIG_PMAC_APM_EMU=m CONFIG_PMAC_MEDIABAY=y CONFIG_PMAC_BACKLIGHT=y CONFIG_INPUT_ADBHID=y @@ -819,6 +823,7 @@ CONFIG_PCNET32=y # CONFIG_R8169 is not set # CONFIG_SIS190 is not set # CONFIG_SKGE is not set +# CONFIG_SKY2 is not set # CONFIG_SK98LIN is not set # CONFIG_VIA_VELOCITY is not set # CONFIG_TIGON3 is not set @@ -978,14 +983,14 @@ CONFIG_HW_CONSOLE=y CONFIG_SERIAL_8250=m # CONFIG_SERIAL_8250_CS is not set CONFIG_SERIAL_8250_NR_UARTS=4 +CONFIG_SERIAL_8250_RUNTIME_UARTS=4 # CONFIG_SERIAL_8250_EXTENDED is not set # # Non-8250 serial port support # CONFIG_SERIAL_CORE=m -# CONFIG_SERIAL_PMACZILOG is not set -# CONFIG_SERIAL_JSM is not set +CONFIG_SERIAL_PMACZILOG=m CONFIG_UNIX98_PTYS=y CONFIG_LEGACY_PTYS=y CONFIG_LEGACY_PTY_COUNT=256 @@ -1058,7 +1063,7 @@ CONFIG_I2C_ALGOBIT=y # CONFIG_I2C_I801 is not set # CONFIG_I2C_I810 is not set # CONFIG_I2C_PIIX4 is not set -CONFIG_I2C_KEYWEST=m +CONFIG_I2C_POWERMAC=y # CONFIG_I2C_MPC is not set # CONFIG_I2C_NFORCE2 is not set # CONFIG_I2C_PARPORT_LIGHT is not set @@ -1160,7 +1165,6 @@ CONFIG_FB_ATY128=y CONFIG_FB_ATY=y CONFIG_FB_ATY_CT=y # CONFIG_FB_ATY_GENERIC_LCD is not set -# CONFIG_FB_ATY_XL_INIT is not set CONFIG_FB_ATY_GX=y # CONFIG_FB_SAVAGE is not set # CONFIG_FB_SIS is not set @@ -1169,7 +1173,6 @@ CONFIG_FB_ATY_GX=y CONFIG_FB_3DFX=y # CONFIG_FB_3DFX_ACCEL is not set # CONFIG_FB_VOODOO1 is not set -# CONFIG_FB_CYBLA is not set # CONFIG_FB_TRIDENT is not set # CONFIG_FB_VIRTUAL is not set @@ -1214,9 +1217,10 @@ CONFIG_SND_OSSEMUL=y CONFIG_SND_MIXER_OSS=m CONFIG_SND_PCM_OSS=m CONFIG_SND_SEQUENCER_OSS=y +# CONFIG_SND_DYNAMIC_MINORS is not set +CONFIG_SND_SUPPORT_OLD_API=y # CONFIG_SND_VERBOSE_PRINTK is not set # CONFIG_SND_DEBUG is not set -CONFIG_SND_GENERIC_DRIVER=y # # Generic devices @@ -1230,6 +1234,8 @@ CONFIG_SND_DUMMY=m # # PCI devices # +# CONFIG_SND_AD1889 is not set +# CONFIG_SND_ALS4000 is not set # CONFIG_SND_ALI5451 is not set # CONFIG_SND_ATIIXP is not set # CONFIG_SND_ATIIXP_MODEM is not set @@ -1238,45 +1244,44 @@ CONFIG_SND_DUMMY=m # CONFIG_SND_AU8830 is not set # CONFIG_SND_AZT3328 is not set # CONFIG_SND_BT87X is not set -# CONFIG_SND_CS46XX is not set +# CONFIG_SND_CA0106 is not set +# CONFIG_SND_CMIPCI is not set # CONFIG_SND_CS4281 is not set +# CONFIG_SND_CS46XX is not set # CONFIG_SND_EMU10K1 is not set # CONFIG_SND_EMU10K1X is not set -# CONFIG_SND_CA0106 is not set -# CONFIG_SND_KORG1212 is not set -# CONFIG_SND_MIXART is not set -# CONFIG_SND_NM256 is not set -# CONFIG_SND_RME32 is not set -# CONFIG_SND_RME96 is not set -# CONFIG_SND_RME9652 is not set -# CONFIG_SND_HDSP is not set -# CONFIG_SND_HDSPM is not set -# CONFIG_SND_TRIDENT is not set -# CONFIG_SND_YMFPCI is not set -# CONFIG_SND_AD1889 is not set -# CONFIG_SND_ALS4000 is not set -# CONFIG_SND_CMIPCI is not set # CONFIG_SND_ENS1370 is not set # CONFIG_SND_ENS1371 is not set # CONFIG_SND_ES1938 is not set # CONFIG_SND_ES1968 is not set -# CONFIG_SND_MAESTRO3 is not set # CONFIG_SND_FM801 is not set +# CONFIG_SND_HDA_INTEL is not set +# CONFIG_SND_HDSP is not set +# CONFIG_SND_HDSPM is not set # CONFIG_SND_ICE1712 is not set # CONFIG_SND_ICE1724 is not set # CONFIG_SND_INTEL8X0 is not set # CONFIG_SND_INTEL8X0M is not set +# CONFIG_SND_KORG1212 is not set +# CONFIG_SND_MAESTRO3 is not set +# CONFIG_SND_MIXART is not set +# CONFIG_SND_NM256 is not set +# CONFIG_SND_PCXHR is not set +# CONFIG_SND_RME32 is not set +# CONFIG_SND_RME96 is not set +# CONFIG_SND_RME9652 is not set # CONFIG_SND_SONICVIBES is not set +# CONFIG_SND_TRIDENT is not set # CONFIG_SND_VIA82XX is not set # CONFIG_SND_VIA82XX_MODEM is not set # CONFIG_SND_VX222 is not set -# CONFIG_SND_HDA_INTEL is not set +# CONFIG_SND_YMFPCI is not set # # ALSA PowerMac devices # CONFIG_SND_POWERMAC=m -# CONFIG_SND_POWERMAC_AUTO_DRC is not set +CONFIG_SND_POWERMAC_AUTO_DRC=y # # USB devices @@ -1336,6 +1341,7 @@ CONFIG_USB_PRINTER=m # may also be needed; see USB_STORAGE Help for more information # # CONFIG_USB_STORAGE is not set +# CONFIG_USB_LIBUSUAL is not set # # USB Input Devices @@ -1355,6 +1361,7 @@ CONFIG_USB_HIDINPUT=y # CONFIG_USB_YEALINK is not set # CONFIG_USB_XPAD is not set # CONFIG_USB_ATI_REMOTE is not set +# CONFIG_USB_ATI_REMOTE2 is not set # CONFIG_USB_KEYSPAN_REMOTE is not set CONFIG_USB_APPLETOUCH=y @@ -1501,6 +1508,7 @@ CONFIG_FS_MBCACHE=y # CONFIG_JFS_FS is not set # CONFIG_FS_POSIX_ACL is not set # CONFIG_XFS_FS is not set +# CONFIG_OCFS2_FS is not set # CONFIG_MINIX_FS is not set # CONFIG_ROMFS_FS is not set CONFIG_INOTIFY=y @@ -1540,6 +1548,7 @@ CONFIG_TMPFS=y # CONFIG_HUGETLB_PAGE is not set CONFIG_RAMFS=y CONFIG_RELAYFS_FS=m +# CONFIG_CONFIGFS_FS is not set # # Miscellaneous filesystems @@ -1670,12 +1679,13 @@ CONFIG_OPROFILE=y # Kernel hacking # # CONFIG_PRINTK_TIME is not set -CONFIG_DEBUG_KERNEL=y # CONFIG_MAGIC_SYSRQ is not set +CONFIG_DEBUG_KERNEL=y CONFIG_LOG_BUF_SHIFT=14 CONFIG_DETECT_SOFTLOCKUP=y # CONFIG_SCHEDSTATS is not set # CONFIG_DEBUG_SLAB is not set +# CONFIG_DEBUG_MUTEXES is not set # CONFIG_DEBUG_SPINLOCK is not set # CONFIG_DEBUG_SPINLOCK_SLEEP is not set # CONFIG_DEBUG_KOBJECT is not set @@ -1688,6 +1698,11 @@ CONFIG_XMON=y CONFIG_XMON_DEFAULT=y # CONFIG_BDI_SWITCH is not set CONFIG_BOOTX_TEXT=y +# CONFIG_PPC_EARLY_DEBUG_LPAR is not set +# CONFIG_PPC_EARLY_DEBUG_G5 is not set +# CONFIG_PPC_EARLY_DEBUG_RTAS is not set +# CONFIG_PPC_EARLY_DEBUG_MAPLE is not set +# CONFIG_PPC_EARLY_DEBUG_ISERIES is not set # # Security options From olof at lixom.net Sun Jan 15 05:40:40 2006 From: olof at lixom.net (Olof Johansson) Date: Sat, 14 Jan 2006 12:40:40 -0600 Subject: [PATCH] powerpc: Better machine descriptions and kill magic numbers In-Reply-To: <1137217531.4854.39.camel@localhost.localdomain> References: <1137217531.4854.39.camel@localhost.localdomain> Message-ID: <20060114184040.GR2491@pb15.lixom.net> On Sat, Jan 14, 2006 at 04:45:30PM +1100, Benjamin Herrenschmidt wrote: > - Machines/Platforms magic numbers are gone, _machine is gone too, you > can now use the machine_is(name) macro to check if you are running on a > givem board, this macro works by testing which of the machine > descriptions was selected at boot. Nice! Overall I like this. It removes some of the kexec limitations of having to play with platform numbers when booting a newer kernel that detects platforms differently (or renumbered) too. I do have a couple of comments on the implementation: I got complaints when I did this for cpu features, where I first used a cpu_has_feature() syntax instead of cpu_has_feature(CPU_FTR_). I think I agree with some of the reasoning for that too: someone searching for "powermac" when looking for the "machine_is(powermac)" logic won't find it. Because of this, I suggest keeping the mach_ part in the syntax, i.e, to use: machine_is(mach_powermac) instead, and not do preprocessor mangling of the label name. The same would go for define_machine(). It would seem to make some sense to keep the platform types looking like defines (i.e. MACH_POWERMAC instead of mach_powermac) to keep it consistent with the CPU and firmware feature testing, but the way it's implemented that doesn't make much sense. That's a bit of a shame. In the probe loop, ppc_md is copied over for each probe, that seems wasteful. Shouldn't the probe routines use and modify their own machdep_calls instead of ppc_md, so the copying can be done only once, after a match is found? -Olof From olof at lixom.net Sun Jan 15 07:48:11 2006 From: olof at lixom.net (Olof Johansson) Date: Sat, 14 Jan 2006 14:48:11 -0600 Subject: please pull powerpc-merge.git In-Reply-To: <17352.31911.799540.543433@cargo.ozlabs.ibm.com> References: <17352.31911.799540.543433@cargo.ozlabs.ibm.com> Message-ID: <20060114204811.GT2491@pb15.lixom.net> On Sat, Jan 14, 2006 at 03:23:03PM +1100, Paul Mackerras wrote: > powerpc: Add FSL SOC library and setup code > powerpc: Add MPC834x SYS board to arch/powerpc Hrm. I commented on these patches on the list, not knowing they had already been merged. These were posted on the list less than 12 hours before the pull request. It'd be nice to have a bit more time than that to look at them and comment next time around. I know the upstream merge window is closing, but still. Thanks, -Olof From benh at kernel.crashing.org Sun Jan 15 08:04:46 2006 From: benh at kernel.crashing.org (Benjamin Herrenschmidt) Date: Sun, 15 Jan 2006 08:04:46 +1100 Subject: [PATCH] powerpc: Better machine descriptions and kill magic numbers In-Reply-To: <20060114184040.GR2491@pb15.lixom.net> References: <1137217531.4854.39.camel@localhost.localdomain> <20060114184040.GR2491@pb15.lixom.net> Message-ID: <1137272686.4855.17.camel@localhost.localdomain> > Because of this, I suggest keeping the mach_ part in the syntax, i.e, > to use: > > machine_is(mach_powermac) instead, and not do preprocessor mangling of > the label name. The same would go for define_machine(). > > It would seem to make some sense to keep the platform types looking > like defines (i.e. MACH_POWERMAC instead of mach_powermac) to keep it > consistent with the CPU and firmware feature testing, but the way it's > implemented that doesn't make much sense. That's a bit of a shame. I'm not sure about these ... I'm definitely not fan of going uppercase (and it makes no sense vs. the implementation as it's not macros). I also don't get your problem with grep... the "mach_" construct is totally invisible, so people wouldn't grep for it, but for "powermac" alone. Or do you mean a grep on "powermac" might return too many things unrelated ? It should be easy enough in this case to grep for machine_is(powermac) instead then, after all, that's the only possible use... > In the probe loop, ppc_md is copied over for each probe, that seems > wasteful. I changed that from the old way indeed to allow the probe() function to override things in ppc_md. > Shouldn't the probe routines use and modify their own > machdep_calls instead of ppc_md, so the copying can be done only once, > after a match is found? I don't like modifying their own machdep calls because the name of the structure is hidden. In general, I prefer that things continue to only access ppc_md. and not their own machine structure that goes away. That means that the code "patching" it can be moved away etc... without special case instead of having a special case in probe() that has to reference the machine specific copy... I doubt the memcpy per machine at boot will cause any kind of significant performance issue ... Ben. From haren at us.ibm.com Sun Jan 15 08:48:25 2006 From: haren at us.ibm.com (Haren Myneni) Date: Sat, 14 Jan 2006 13:48:25 -0800 Subject: [PATCH] powerpc: Kconfig changes for CRASH_DUMP Message-ID: <43C971A9.1010101@us.ibm.com> Noticed in 2.6.15-git9 that CRASH_DUMP option is moved to top level. Moved CRASH_DUMP into "kernel options" next to KEXEC and this config option supports only for PPC64 at this time. Signed-off-by: Haren Myneni -------------- next part -------------- A non-text attachment was scrubbed... Name: kdump-kconfig-fix.patch Type: text/x-patch Size: 1193 bytes Desc: not available Url : http://ozlabs.org/pipermail/linuxppc64-dev/attachments/20060114/1c115374/attachment.bin From paulus at samba.org Sun Jan 15 10:49:58 2006 From: paulus at samba.org (Paul Mackerras) Date: Sun, 15 Jan 2006 10:49:58 +1100 Subject: please pull powerpc-merge.git In-Reply-To: <20060114204811.GT2491@pb15.lixom.net> References: <17352.31911.799540.543433@cargo.ozlabs.ibm.com> <20060114204811.GT2491@pb15.lixom.net> Message-ID: <17353.36390.4345.135025@cargo.ozlabs.ibm.com> Olof Johansson writes: > On Sat, Jan 14, 2006 at 03:23:03PM +1100, Paul Mackerras wrote: > > > powerpc: Add FSL SOC library and setup code > > powerpc: Add MPC834x SYS board to arch/powerpc > > Hrm. I commented on these patches on the list, not knowing they had > already been merged. > > These were posted on the list less than 12 hours before the pull > request. It'd be nice to have a bit more time than that to look at them > and comment next time around. I know the upstream merge window is closing, > but still. I merged them because Kumar is the maintainer for that code and because they didn't look like they would break any other platforms. Your review is still useful, thanks, and Kumar can address your comments by sending another patch. Also, I'm not of the opinion that patches have to be perfect before they can go in, particularly when they are adding stuff that has no previous users, such as 83xx support in ARCH=powerpc. The code evolves, and it is useful for the git history to show how that happened (within reason of course). Paul. From olof at lixom.net Sun Jan 15 11:42:22 2006 From: olof at lixom.net (Olof Johansson) Date: Sat, 14 Jan 2006 18:42:22 -0600 Subject: [PATCH] powerpc: Better machine descriptions and kill magic numbers In-Reply-To: <1137272686.4855.17.camel@localhost.localdomain> References: <1137217531.4854.39.camel@localhost.localdomain> <20060114184040.GR2491@pb15.lixom.net> <1137272686.4855.17.camel@localhost.localdomain> Message-ID: <20060115004221.GU2491@pb15.lixom.net> On Sun, Jan 15, 2006 at 08:04:46AM +1100, Benjamin Herrenschmidt wrote: > > > Because of this, I suggest keeping the mach_ part in the syntax, i.e, > > to use: > > > > machine_is(mach_powermac) instead, and not do preprocessor mangling of > > the label name. The same would go for define_machine(). > > > > It would seem to make some sense to keep the platform types looking > > like defines (i.e. MACH_POWERMAC instead of mach_powermac) to keep it > > consistent with the CPU and firmware feature testing, but the way it's > > implemented that doesn't make much sense. That's a bit of a shame. > > I'm not sure about these ... I'm definitely not fan of going uppercase (and > it makes no sense vs. the implementation as it's not macros). I also don't Yeah, that's what I meant with doesn't make sense in this case. I was just thinking out loud. > get your problem with grep... the "mach_" construct is totally invisible, > so people wouldn't grep for it, but for "powermac" alone. > > Or do you mean a grep on "powermac" might return too many things unrelated ? > > It should be easy enough in this case to grep for machine_is(powermac) instead > then, after all, that's the only possible use... One drawback is that source navigation tools like tags and cscope probably won't find it, and the base strings are quite generic (powermac, cbe/cell, etc). A stringbased grep will, sure. > > In the probe loop, ppc_md is copied over for each probe, that seems > > wasteful. > > I changed that from the old way indeed to allow the probe() function to > override things in ppc_md. > > > Shouldn't the probe routines use and modify their own > > machdep_calls instead of ppc_md, so the copying can be done only once, > > after a match is found? > > I don't like modifying their own machdep calls because the name of the > structure is hidden. In general, I prefer that things continue to only > access ppc_md. and not their own machine structure that goes away. That > means that the code "patching" it can be moved away etc... without > special case instead of having a special case in probe() that has to > reference the machine specific copy... Ok. > I doubt the memcpy per machine at boot will cause any kind of > significant performance issue ... Yeah, that's why I said it seemed wasteful, not that it'd be a performance issue. From will_schmidt at vnet.ibm.com Thu Jan 12 06:11:14 2006 From: will_schmidt at vnet.ibm.com (will schmidt) Date: Wed, 11 Jan 2006 13:11:14 -0600 Subject: powerpc.git tree In-Reply-To: <17348.60119.801379.127209@cargo.ozlabs.ibm.com> References: <17348.60119.801379.127209@cargo.ozlabs.ibm.com> Message-ID: <43C55852.2060703@vnet.ibm.com> Paul Mackerras wrote: > > That means that anyone who is following the powerpc.git tree by doing > pulls periodically will need to reset their tree too. Otherwise each > pull will do an unnecessary merge. Hi Paul, By reset, do you mean to delete the local tree and pull a fresh one, or something fancier? -Will > > Comments? > > Paul. > _______________________________________________ > Linuxppc64-dev mailing list > Linuxppc64-dev at ozlabs.org > https://ozlabs.org/mailman/listinfo/linuxppc64-dev From sfr at canb.auug.org.au Sun Jan 15 16:53:23 2006 From: sfr at canb.auug.org.au (Stephen Rothwell) Date: Sun, 15 Jan 2006 16:53:23 +1100 Subject: powerpc.git tree In-Reply-To: <43C55852.2060703@vnet.ibm.com> References: <17348.60119.801379.127209@cargo.ozlabs.ibm.com> <43C55852.2060703@vnet.ibm.com> Message-ID: <20060115165323.20bd0df3.sfr@canb.auug.org.au> Hi Will, On Wed, 11 Jan 2006 13:11:14 -0600 will schmidt wrote: > > Paul Mackerras wrote: > > > > That means that anyone who is following the powerpc.git tree by doing > > pulls periodically will need to reset their tree too. Otherwise each > > pull will do an unnecessary merge. > > By reset, do you mean to delete the local tree and pull a fresh one, or something fancier? I just did a "git fetch -f powerpc" where my .git/remotes/powerpc points at the powerpc.git tree on kernel.org. -- Cheers, Stephen Rothwell sfr at canb.auug.org.au http://www.canb.auug.org.au/~sfr/ -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: not available Url : http://ozlabs.org/pipermail/linuxppc64-dev/attachments/20060115/6985b0de/attachment.pgp From paulus at samba.org Sun Jan 15 17:07:57 2006 From: paulus at samba.org (Paul Mackerras) Date: Sun, 15 Jan 2006 17:07:57 +1100 Subject: powerpc.git tree In-Reply-To: <43C55852.2060703@vnet.ibm.com> References: <17348.60119.801379.127209@cargo.ozlabs.ibm.com> <43C55852.2060703@vnet.ibm.com> Message-ID: <17353.59069.640198.595911@cargo.ozlabs.ibm.com> will schmidt writes: > Paul Mackerras wrote: > > > > That means that anyone who is following the powerpc.git tree by doing > > pulls periodically will need to reset their tree too. Otherwise each > > pull will do an unnecessary merge. > > Hi Paul, > > By reset, do you mean to delete the local tree and pull a fresh > one, or something fancier? The powerpc.git tree is now identical to Linus' tree as of a day or so ago. There are several ways you can reset your tree: - make a fresh clone of Linus' tree, and make its .git/remotes/powerpc point at the powerpc.git tree on kernel.org, or - do "git fetch -f powerpc" (substitute whatever remote name you use for the powerpc.git tree) (according to Stephen Rothwell), or - do a pull as you would normally do, then throw away the merge and the extra objects by doing: git reset --hard FETCH_HEAD git prune - or you can delete the local tree and do a fresh clone. I will start putting stuff in powerpc.git in the next day or so. Paul. From jdmason at us.ibm.com Sun Jan 15 17:07:20 2006 From: jdmason at us.ibm.com (Jon Mason) Date: Sun, 15 Jan 2006 00:07:20 -0600 Subject: [PATCH] trivial: modify comments to refer to new location of files In-Reply-To: <20060113114401.3289f33f.sfr@canb.auug.org.au> References: <20060112180240.GB17539@us.ibm.com> <20060113114401.3289f33f.sfr@canb.auug.org.au> Message-ID: <20060115060716.GA2157@us.ibm.com> On Fri, Jan 13, 2006 at 11:44:01AM +1100, Stephen Rothwell wrote: > Can we just remove these useless self references, please? Is this more towards your liking? Signed-off-by: Jon Mason diff -r 800442576617 Documentation/powerpc/eeh-pci-error-recovery.txt --- a/Documentation/powerpc/eeh-pci-error-recovery.txt Sat Jan 14 05:24:55 2006 +++ b/Documentation/powerpc/eeh-pci-error-recovery.txt Sat Jan 14 23:40:17 2006 @@ -121,7 +121,7 @@ EEH must be enabled in the PHB's very early during the boot process, and if a PCI slot is hot-plugged. The former is performed by -eeh_init() in arch/ppc64/kernel/eeh.c, and the later by +eeh_init() in arch/powerpc/platforms/pseries/eeh.c, and the later by drivers/pci/hotplug/pSeries_pci.c calling in to the eeh.c code. EEH must be enabled before a PCI scan of the device can proceed. Current Power5 hardware will not work unless EEH is enabled; @@ -133,7 +133,7 @@ pci_get_device_by_addr() will find the pci device associated with that address (if any). -The default include/asm-ppc64/io.h macros readb(), inb(), insb(), +The default include/asm-powerpc/io.h macros readb(), inb(), insb(), etc. include a check to see if the i/o read returned all-0xff's. If so, these make a call to eeh_dn_check_failure(), which in turn asks the firmware if the all-ff's value is the sign of a true EEH @@ -143,11 +143,12 @@ all of these occur during boot, when the PCI bus is scanned, where a large number of 0xff reads are part of the bus scan procedure. -If a frozen slot is detected, code in arch/ppc64/kernel/eeh.c will -print a stack trace to syslog (/var/log/messages). This stack trace -has proven to be very useful to device-driver authors for finding -out at what point the EEH error was detected, as the error itself -usually occurs slightly beforehand. +If a frozen slot is detected, code in +arch/powerpc/platforms/pseries/eeh.c will print a stack trace to +syslog (/var/log/messages). This stack trace has proven to be very +useful to device-driver authors for finding out at what point the EEH +error was detected, as the error itself usually occurs slightly +beforehand. Next, it uses the Linux kernel notifier chain/work queue mechanism to allow any interested parties to find out about the failure. Device diff -r 800442576617 arch/powerpc/boot/install.sh --- a/arch/powerpc/boot/install.sh Sat Jan 14 05:24:55 2006 +++ b/arch/powerpc/boot/install.sh Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ #!/bin/sh -# -# arch/ppc64/boot/install.sh # # This file is subject to the terms and conditions of the GNU General Public # License. See the file "COPYING" in the main directory of this archive diff -r 800442576617 arch/powerpc/kernel/entry_64.S --- a/arch/powerpc/kernel/entry_64.S Sat Jan 14 05:24:55 2006 +++ b/arch/powerpc/kernel/entry_64.S Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc64/kernel/entry.S - * * PowerPC version * Copyright (C) 1995-1996 Gary Thomas (gdt at linuxppc.org) * Rewritten by Cort Dougan (cort at cs.nmt.edu) for PReP @@ -374,7 +372,7 @@ * the fork code also. * * The code which creates the new task context is in 'copy_thread' - * in arch/ppc64/kernel/process.c + * in arch/powerpc/kernel/process.c */ .align 7 _GLOBAL(_switch) diff -r 800442576617 arch/powerpc/kernel/head_44x.S --- a/arch/powerpc/kernel/head_44x.S Sat Jan 14 05:24:55 2006 +++ b/arch/powerpc/kernel/head_44x.S Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/kernel/head_44x.S - * * Kernel execution entry point code. * * Copyright (c) 1995-1996 Gary Thomas diff -r 800442576617 arch/powerpc/kernel/head_64.S --- a/arch/powerpc/kernel/head_64.S Sat Jan 14 05:24:55 2006 +++ b/arch/powerpc/kernel/head_64.S Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc64/kernel/head.S - * * PowerPC version * Copyright (C) 1995-1996 Gary Thomas (gdt at linuxppc.org) * diff -r 800442576617 arch/powerpc/kernel/head_8xx.S --- a/arch/powerpc/kernel/head_8xx.S Sat Jan 14 05:24:55 2006 +++ b/arch/powerpc/kernel/head_8xx.S Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/kernel/except_8xx.S - * * PowerPC version * Copyright (C) 1995-1996 Gary Thomas (gdt at linuxppc.org) * Rewritten by Cort Dougan (cort at cs.nmt.edu) for PReP diff -r 800442576617 arch/powerpc/kernel/head_fsl_booke.S --- a/arch/powerpc/kernel/head_fsl_booke.S Sat Jan 14 05:24:55 2006 +++ b/arch/powerpc/kernel/head_fsl_booke.S Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/kernel/head_fsl_booke.S - * * Kernel execution entry point code. * * Copyright (c) 1995-1996 Gary Thomas diff -r 800442576617 arch/powerpc/kernel/iomap.c --- a/arch/powerpc/kernel/iomap.c Sat Jan 14 05:24:55 2006 +++ b/arch/powerpc/kernel/iomap.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc64/kernel/iomap.c - * * ppc64 "iomap" interface implementation. * * (C) Copyright 2004 Linus Torvalds diff -r 800442576617 arch/powerpc/kernel/iommu.c --- a/arch/powerpc/kernel/iommu.c Sat Jan 14 05:24:55 2006 +++ b/arch/powerpc/kernel/iommu.c Sat Jan 14 23:40:17 2006 @@ -1,5 +1,4 @@ /* - * arch/ppc64/kernel/iommu.c * Copyright (C) 2001 Mike Corrigan & Dave Engebretsen, IBM Corporation * * Rewrite, cleanup, new allocation schemes, virtual merging: diff -r 800442576617 arch/powerpc/kernel/irq.c --- a/arch/powerpc/kernel/irq.c Sat Jan 14 05:24:55 2006 +++ b/arch/powerpc/kernel/irq.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/kernel/irq.c - * * Derived from arch/i386/kernel/irq.c * Copyright (C) 1992 Linus Torvalds * Adapted from arch/i386 by Gary Thomas diff -r 800442576617 arch/powerpc/kernel/kprobes.c --- a/arch/powerpc/kernel/kprobes.c Sat Jan 14 05:24:55 2006 +++ b/arch/powerpc/kernel/kprobes.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,5 @@ /* * Kernel Probes (KProbes) - * arch/ppc64/kernel/kprobes.c * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff -r 800442576617 arch/powerpc/kernel/pci_iommu.c --- a/arch/powerpc/kernel/pci_iommu.c Sat Jan 14 05:24:55 2006 +++ b/arch/powerpc/kernel/pci_iommu.c Sat Jan 14 23:40:17 2006 @@ -1,5 +1,4 @@ /* - * arch/ppc64/kernel/pci_iommu.c * Copyright (C) 2001 Mike Corrigan & Dave Engebretsen, IBM Corporation * * Rewrite, cleanup, new allocation schemes: diff -r 800442576617 arch/powerpc/kernel/process.c --- a/arch/powerpc/kernel/process.c Sat Jan 14 05:24:55 2006 +++ b/arch/powerpc/kernel/process.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/kernel/process.c - * * Derived from "arch/i386/kernel/process.c" * Copyright (C) 1995 Linus Torvalds * diff -r 800442576617 arch/powerpc/kernel/ptrace-common.h --- a/arch/powerpc/kernel/ptrace-common.h Sat Jan 14 05:24:55 2006 +++ b/arch/powerpc/kernel/ptrace-common.h Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * linux/arch/ppc64/kernel/ptrace-common.h - * * Copyright (c) 2002 Stephen Rothwell, IBM Coproration * Extracted from ptrace.c and ptrace32.c * diff -r 800442576617 arch/powerpc/kernel/rtas-proc.c --- a/arch/powerpc/kernel/rtas-proc.c Sat Jan 14 05:24:55 2006 +++ b/arch/powerpc/kernel/rtas-proc.c Sat Jan 14 23:40:17 2006 @@ -1,5 +1,4 @@ /* - * arch/ppc64/kernel/rtas-proc.c * Copyright (C) 2000 Tilmann Bitterberg * (tilmann at bitterberg.de) * diff -r 800442576617 arch/powerpc/kernel/rtas_pci.c --- a/arch/powerpc/kernel/rtas_pci.c Sat Jan 14 05:24:55 2006 +++ b/arch/powerpc/kernel/rtas_pci.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc64/kernel/rtas_pci.c - * * Copyright (C) 2001 Dave Engebretsen, IBM Corporation * Copyright (C) 2003 Anton Blanchard , IBM * diff -r 800442576617 arch/powerpc/kernel/signal_64.c --- a/arch/powerpc/kernel/signal_64.c Sat Jan 14 05:24:55 2006 +++ b/arch/powerpc/kernel/signal_64.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * linux/arch/ppc64/kernel/signal.c - * * PowerPC version * Copyright (C) 1995-1996 Gary Thomas (gdt at linuxppc.org) * diff -r 800442576617 arch/powerpc/kernel/vdso.c --- a/arch/powerpc/kernel/vdso.c Sat Jan 14 05:24:55 2006 +++ b/arch/powerpc/kernel/vdso.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * linux/arch/ppc64/kernel/vdso.c - * * Copyright (C) 2004 Benjamin Herrenschmidt, IBM Corp. * * diff -r 800442576617 arch/powerpc/lib/copypage_64.S --- a/arch/powerpc/lib/copypage_64.S Sat Jan 14 05:24:55 2006 +++ b/arch/powerpc/lib/copypage_64.S Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc64/lib/copypage.S - * * Copyright (C) 2002 Paul Mackerras, IBM Corp. * * This program is free software; you can redistribute it and/or diff -r 800442576617 arch/powerpc/lib/copyuser_64.S --- a/arch/powerpc/lib/copyuser_64.S Sat Jan 14 05:24:55 2006 +++ b/arch/powerpc/lib/copyuser_64.S Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc64/lib/copyuser.S - * * Copyright (C) 2002 Paul Mackerras, IBM Corp. * * This program is free software; you can redistribute it and/or diff -r 800442576617 arch/powerpc/lib/e2a.c --- a/arch/powerpc/lib/e2a.c Sat Jan 14 05:24:55 2006 +++ b/arch/powerpc/lib/e2a.c Sat Jan 14 23:40:17 2006 @@ -1,9 +1,7 @@ /* - * arch/ppc64/lib/e2a.c - * * EBCDIC to ASCII conversion * - * This function moved here from arch/ppc64/kernel/viopath.c + * This function moved here from arch/powerpc/platforms/iseries/viopath.c * * (C) Copyright 2000-2004 IBM Corporation * diff -r 800442576617 arch/powerpc/lib/memcpy_64.S --- a/arch/powerpc/lib/memcpy_64.S Sat Jan 14 05:24:55 2006 +++ b/arch/powerpc/lib/memcpy_64.S Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc64/lib/memcpy.S - * * Copyright (C) 2002 Paul Mackerras, IBM Corp. * * This program is free software; you can redistribute it and/or diff -r 800442576617 arch/powerpc/lib/rheap.c --- a/arch/powerpc/lib/rheap.c Sat Jan 14 05:24:55 2006 +++ b/arch/powerpc/lib/rheap.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/syslib/rheap.c - * * A Remote Heap. Remote means that we don't touch the memory that the * heap points to. Normal heap implementations use the memory they manage * to place their list. We cannot do that because the memory we manage may diff -r 800442576617 arch/powerpc/mm/fault.c --- a/arch/powerpc/mm/fault.c Sat Jan 14 05:24:55 2006 +++ b/arch/powerpc/mm/fault.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/mm/fault.c - * * PowerPC version * Copyright (C) 1995-1996 Gary Thomas (gdt at linuxppc.org) * diff -r 800442576617 arch/powerpc/mm/hash_low_32.S --- a/arch/powerpc/mm/hash_low_32.S Sat Jan 14 05:24:55 2006 +++ b/arch/powerpc/mm/hash_low_32.S Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/kernel/hashtable.S - * * $Id: hashtable.S,v 1.6 1999/10/08 01:56:15 paulus Exp $ * * PowerPC version diff -r 800442576617 arch/powerpc/mm/mmap.c --- a/arch/powerpc/mm/mmap.c Sat Jan 14 05:24:55 2006 +++ b/arch/powerpc/mm/mmap.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * linux/arch/ppc64/mm/mmap.c - * * flexible mmap layout support * * Copyright 2003-2004 Red Hat Inc., Durham, North Carolina. diff -r 800442576617 arch/powerpc/mm/slb_low.S --- a/arch/powerpc/mm/slb_low.S Sat Jan 14 05:24:55 2006 +++ b/arch/powerpc/mm/slb_low.S Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc64/mm/slb_low.S - * * Low-level SLB routines * * Copyright (C) 2004 David Gibson , IBM diff -r 800442576617 arch/powerpc/mm/tlb_64.c --- a/arch/powerpc/mm/tlb_64.c Sat Jan 14 05:24:55 2006 +++ b/arch/powerpc/mm/tlb_64.c Sat Jan 14 23:40:17 2006 @@ -36,7 +36,7 @@ DEFINE_PER_CPU(struct ppc64_tlb_batch, ppc64_tlb_batch); /* This is declared as we are using the more or less generic - * include/asm-ppc64/tlb.h file -- tgall + * include/asm-powerpc/tlb.h file -- tgall */ DEFINE_PER_CPU(struct mmu_gather, mmu_gathers); DEFINE_PER_CPU(struct pte_freelist_batch *, pte_freelist_cur); diff -r 800442576617 arch/powerpc/platforms/chrp/pegasos_eth.c --- a/arch/powerpc/platforms/chrp/pegasos_eth.c Sat Jan 14 05:24:55 2006 +++ b/arch/powerpc/platforms/chrp/pegasos_eth.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/chrp_pegasos_eth.c - * * Copyright (C) 2005 Sven Luther * Thanks to : * Dale Farnsworth diff -r 800442576617 arch/powerpc/platforms/chrp/setup.c --- a/arch/powerpc/platforms/chrp/setup.c Sat Jan 14 05:24:55 2006 +++ b/arch/powerpc/platforms/chrp/setup.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/setup.c - * * Copyright (C) 1995 Linus Torvalds * Adapted from 'alpha' version by Gary Thomas * Modified by Cort Dougan (cort at cs.nmt.edu) diff -r 800442576617 arch/powerpc/platforms/chrp/time.c --- a/arch/powerpc/platforms/chrp/time.c Sat Jan 14 05:24:55 2006 +++ b/arch/powerpc/platforms/chrp/time.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/chrp_time.c - * * Copyright (C) 1991, 1992, 1995 Linus Torvalds * * Adapted for PowerPC (PReP) by Gary Thomas diff -r 800442576617 arch/powerpc/platforms/maple/time.c --- a/arch/powerpc/platforms/maple/time.c Sat Jan 14 05:24:55 2006 +++ b/arch/powerpc/platforms/maple/time.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc64/kernel/maple_time.c - * * (c) Copyright 2004 Benjamin Herrenschmidt (benh at kernel.crashing.org), * IBM Corp. * diff -r 800442576617 arch/powerpc/platforms/powermac/cpufreq_32.c --- a/arch/powerpc/platforms/powermac/cpufreq_32.c Sat Jan 14 05:24:55 2006 +++ b/arch/powerpc/platforms/powermac/cpufreq_32.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/pmac_cpufreq.c - * * Copyright (C) 2002 - 2005 Benjamin Herrenschmidt * Copyright (C) 2004 John Steele Scott * diff -r 800442576617 arch/powerpc/platforms/powermac/feature.c --- a/arch/powerpc/platforms/powermac/feature.c Sat Jan 14 05:24:55 2006 +++ b/arch/powerpc/platforms/powermac/feature.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/pmac_feature.c - * * Copyright (C) 1996-2001 Paul Mackerras (paulus at cs.anu.edu.au) * Ben. Herrenschmidt (benh at kernel.crashing.org) * diff -r 800442576617 arch/powerpc/platforms/powermac/nvram.c --- a/arch/powerpc/platforms/powermac/nvram.c Sat Jan 14 05:24:55 2006 +++ b/arch/powerpc/platforms/powermac/nvram.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/pmac_nvram.c - * * Copyright (C) 2002 Benjamin Herrenschmidt (benh at kernel.crashing.org) * * This program is free software; you can redistribute it and/or diff -r 800442576617 arch/powerpc/platforms/pseries/hvCall.S --- a/arch/powerpc/platforms/pseries/hvCall.S Sat Jan 14 05:24:55 2006 +++ b/arch/powerpc/platforms/pseries/hvCall.S Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc64/kernel/pSeries_hvCall.S - * * This file contains the generic code to perform a call to the * pSeries LPAR hypervisor. * NOTE: this file will go away when we move to inline this work. diff -r 800442576617 arch/powerpc/platforms/pseries/iommu.c --- a/arch/powerpc/platforms/pseries/iommu.c Sat Jan 14 05:24:55 2006 +++ b/arch/powerpc/platforms/pseries/iommu.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc64/kernel/pSeries_iommu.c - * * Copyright (C) 2001 Mike Corrigan & Dave Engebretsen, IBM Corporation * * Rewrite, cleanup: diff -r 800442576617 arch/powerpc/platforms/pseries/pci.c --- a/arch/powerpc/platforms/pseries/pci.c Sat Jan 14 05:24:55 2006 +++ b/arch/powerpc/platforms/pseries/pci.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc64/kernel/pSeries_pci.c - * * Copyright (C) 2001 Dave Engebretsen, IBM Corporation * Copyright (C) 2003 Anton Blanchard , IBM * diff -r 800442576617 arch/powerpc/sysdev/dcr.S --- a/arch/powerpc/sysdev/dcr.S Sat Jan 14 05:24:55 2006 +++ b/arch/powerpc/sysdev/dcr.S Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/syslib/dcr.S - * * "Indirect" DCR access * * Copyright (c) 2004 Eugene Surovegin diff -r 800442576617 arch/powerpc/sysdev/ipic.h --- a/arch/powerpc/sysdev/ipic.h Sat Jan 14 05:24:55 2006 +++ b/arch/powerpc/sysdev/ipic.h Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/kernel/ipic.h - * * IPIC private definitions and structure. * * Maintainer: Kumar Gala diff -r 800442576617 arch/ppc/4xx_io/serial_sicc.c --- a/arch/ppc/4xx_io/serial_sicc.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/4xx_io/serial_sicc.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/4xx_io/serial_sicc.c - * * Driver for IBM STB3xxx SICC serial port * * Based on drivers/char/serial_amba.c, by ARM Ltd. diff -r 800442576617 arch/ppc/amiga/amiints.c --- a/arch/ppc/amiga/amiints.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/amiga/amiints.c Sat Jan 14 23:40:17 2006 @@ -1,5 +1,5 @@ /* - * arch/ppc/amiga/amiints.c -- Amiga Linux interrupt handling code + * Amiga Linux interrupt handling code * * This file is subject to the terms and conditions of the GNU General Public * License. See the file COPYING in the main directory of this archive diff -r 800442576617 arch/ppc/amiga/bootinfo.c --- a/arch/ppc/amiga/bootinfo.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/amiga/bootinfo.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/amiga/bootinfo.c - * * Extracted from arch/m68k/kernel/setup.c. * Should be properly generalized and put somewhere else. * Jesper diff -r 800442576617 arch/ppc/amiga/cia.c --- a/arch/ppc/amiga/cia.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/amiga/cia.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/amiga/cia.c - CIA support - * * Copyright (C) 1996 Roman Zippel * * The concept of some functions bases on the original Amiga OS function diff -r 800442576617 arch/ppc/amiga/ints.c --- a/arch/ppc/amiga/ints.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/amiga/ints.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/amiga/ints.c - * * Linux/m68k general interrupt handling code from arch/m68k/kernel/ints.c * Needed to drive the m68k emulating IRQ hardware on the PowerUp boards. */ diff -r 800442576617 arch/ppc/boot/Makefile --- a/arch/ppc/boot/Makefile Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/boot/Makefile Sat Jan 14 23:40:17 2006 @@ -1,6 +1,3 @@ -# -# arch/ppc/boot/Makefile -# # This file is subject to the terms and conditions of the GNU General Public # License. See the file "COPYING" in the main directory of this archive # for more details. diff -r 800442576617 arch/ppc/boot/common/Makefile --- a/arch/ppc/boot/common/Makefile Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/boot/common/Makefile Sat Jan 14 23:40:17 2006 @@ -1,6 +1,3 @@ -# -# arch/ppc/boot/common/Makefile -# # This file is subject to the terms and conditions of the GNU General Public # License. See the file "COPYING" in the main directory of this archive # for more details. diff -r 800442576617 arch/ppc/boot/common/bootinfo.c --- a/arch/ppc/boot/common/bootinfo.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/boot/common/bootinfo.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/common/bootinfo.c - * * General bootinfo record utilities * Author: Randy Vinson * diff -r 800442576617 arch/ppc/boot/common/misc-common.c --- a/arch/ppc/boot/common/misc-common.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/boot/common/misc-common.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/boot/common/misc-common.c - * * Misc. bootloader code (almost) all platforms can use * * Author: Johnnie Peters diff -r 800442576617 arch/ppc/boot/common/serial_stub.c --- a/arch/ppc/boot/common/serial_stub.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/boot/common/serial_stub.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/boot/common/serial_stub.c - * * This is a few stub routines to make the boot code cleaner looking when * there is no serial port support doesn't need to be closed, for example. * diff -r 800442576617 arch/ppc/boot/common/util.S --- a/arch/ppc/boot/common/util.S Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/boot/common/util.S Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/boot/common/util.S - * * Useful bootup functions, which are more easily done in asm than C. * * NOTE: Be very very careful about the registers you use here. diff -r 800442576617 arch/ppc/boot/include/mpc10x.h --- a/arch/ppc/boot/include/mpc10x.h Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/boot/include/mpc10x.h Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/boot/include/mpc10.h - * * Common defines for the Motorola SPS MPC106/8240/107 Host bridge/Mem * ctrl/EPIC/etc. * diff -r 800442576617 arch/ppc/boot/simple/cpc700_memory.c --- a/arch/ppc/boot/simple/cpc700_memory.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/boot/simple/cpc700_memory.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/boot/common/cpc700_memory.c - * * Find memory based upon settings in the CPC700 bridge * * Author: Dan Cox diff -r 800442576617 arch/ppc/boot/simple/head.S --- a/arch/ppc/boot/simple/head.S Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/boot/simple/head.S Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/boot/simple/head.S - * * Initial board bringup code for many different boards. * * Author: Tom Rini diff -r 800442576617 arch/ppc/boot/simple/misc-chestnut.c --- a/arch/ppc/boot/simple/misc-chestnut.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/boot/simple/misc-chestnut.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/boot/simple/misc-chestnut.c - * * Setup for the IBM Chestnut (ibm-750fxgx_eval) * * Author: Mark A. Greer diff -r 800442576617 arch/ppc/boot/simple/misc-cpci690.c --- a/arch/ppc/boot/simple/misc-cpci690.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/boot/simple/misc-cpci690.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/boot/simple/misc-cpci690.c - * * Add birec data for Force CPCI690 board. * * Author: Mark A. Greer diff -r 800442576617 arch/ppc/boot/simple/misc-ev64260.c --- a/arch/ppc/boot/simple/misc-ev64260.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/boot/simple/misc-ev64260.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/boot/simple/misc-ev64260.c - * * Host bridge init code for the Marvell/Galileo EV-64260-BP evaluation board * with a GT64260 onboard. * diff -r 800442576617 arch/ppc/boot/simple/misc-ev64360.c --- a/arch/ppc/boot/simple/misc-ev64360.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/boot/simple/misc-ev64360.c Sat Jan 14 23:40:17 2006 @@ -1,5 +1,4 @@ /* - * arch/ppc/boot/simple/misc-ev64360.c * Copyright (C) 2005 Lee Nicks * * Based on arch/ppc/boot/simple/misc-katana.c from: diff -r 800442576617 arch/ppc/boot/simple/misc-katana.c --- a/arch/ppc/boot/simple/misc-katana.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/boot/simple/misc-katana.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/boot/simple/misc-katana.c - * * Set up MPSC values to bootwrapper can prompt user. * * Author: Mark A. Greer diff -r 800442576617 arch/ppc/boot/simple/misc-mv64x60.c --- a/arch/ppc/boot/simple/misc-mv64x60.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/boot/simple/misc-mv64x60.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/boot/simple/misc-mv64x60.c - * * Relocate bridge's register base and call board specific routine. * * Author: Mark A. Greer diff -r 800442576617 arch/ppc/boot/simple/misc-prep.c --- a/arch/ppc/boot/simple/misc-prep.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/boot/simple/misc-prep.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/boot/simple/misc-prep.c - * * Maintainer: Tom Rini * * In the past: Gary Thomas, Cort Dougan diff -r 800442576617 arch/ppc/boot/simple/misc-radstone_ppc7d.c --- a/arch/ppc/boot/simple/misc-radstone_ppc7d.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/boot/simple/misc-radstone_ppc7d.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/boot/simple/misc-radstone_ppc7d.c - * * Misc data for Radstone PPC7D board. * * Author: James Chapman diff -r 800442576617 arch/ppc/boot/simple/misc-spruce.c --- a/arch/ppc/boot/simple/misc-spruce.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/boot/simple/misc-spruce.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/boot/spruce/misc.c - * * Misc. bootloader code for IBM Spruce reference platform * * Authors: Johnnie Peters diff -r 800442576617 arch/ppc/boot/simple/misc.c --- a/arch/ppc/boot/simple/misc.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/boot/simple/misc.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/simple/misc.c - * * Misc. bootloader code for many machines. This assumes you have are using * a 6xx/7xx/74xx CPU in your machine. This assumes the chunk of memory * below 8MB is free. Finally, it assumes you have a NS16550-style uart for diff -r 800442576617 arch/ppc/boot/simple/mpc10x_memory.c --- a/arch/ppc/boot/simple/mpc10x_memory.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/boot/simple/mpc10x_memory.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/boot/common/mpc10x_common.c - * * A routine to find out how much memory the machine has. * * Based on: diff -r 800442576617 arch/ppc/boot/simple/mpc52xx_tty.c --- a/arch/ppc/boot/simple/mpc52xx_tty.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/boot/simple/mpc52xx_tty.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/boot/simple/mpc52xx_tty.c - * * Minimal serial functions needed to send messages out a MPC52xx * Programmable Serial Controller (PSC). * diff -r 800442576617 arch/ppc/boot/simple/mv64x60_tty.c --- a/arch/ppc/boot/simple/mv64x60_tty.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/boot/simple/mv64x60_tty.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/boot/simple/mv64x60_tty.c - * * Bootloader version of the embedded MPSC/UART driver for the Marvell 64x60. * Note: Due to a GT64260A erratum, DMA will be used for UART input (via SDMA). * diff -r 800442576617 arch/ppc/boot/simple/openbios.c --- a/arch/ppc/boot/simple/openbios.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/boot/simple/openbios.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/boot/simple/openbios.c - * * Copyright (c) 2005 DENX Software Engineering * Stefan Roese * diff -r 800442576617 arch/ppc/boot/simple/relocate.S --- a/arch/ppc/boot/simple/relocate.S Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/boot/simple/relocate.S Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/boot/simple/relocate.S - * * This is the common part of the loader relocation and initialization * process. All of the board/processor specific initialization is * done before we get here. diff -r 800442576617 arch/ppc/boot/utils/mkbugboot.c --- a/arch/ppc/boot/utils/mkbugboot.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/boot/utils/mkbugboot.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/boot/utils/mkbugboot.c - * * Makes a Motorola PPCBUG ROM bootable image which can be flashed * into one of the FLASH banks on a Motorola PowerPlus board. * diff -r 800442576617 arch/ppc/kernel/head_44x.S --- a/arch/ppc/kernel/head_44x.S Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/kernel/head_44x.S Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/kernel/head_44x.S - * * Kernel execution entry point code. * * Copyright (c) 1995-1996 Gary Thomas diff -r 800442576617 arch/ppc/kernel/head_8xx.S --- a/arch/ppc/kernel/head_8xx.S Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/kernel/head_8xx.S Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/kernel/except_8xx.S - * * PowerPC version * Copyright (C) 1995-1996 Gary Thomas (gdt at linuxppc.org) * Rewritten by Cort Dougan (cort at cs.nmt.edu) for PReP diff -r 800442576617 arch/ppc/kernel/head_fsl_booke.S --- a/arch/ppc/kernel/head_fsl_booke.S Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/kernel/head_fsl_booke.S Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/kernel/head_fsl_booke.S - * * Kernel execution entry point code. * * Copyright (c) 1995-1996 Gary Thomas diff -r 800442576617 arch/ppc/kernel/traps.c --- a/arch/ppc/kernel/traps.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/kernel/traps.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/kernel/traps.c - * * Copyright (C) 1995-1996 Gary Thomas (gdt at linuxppc.org) * * This program is free software; you can redistribute it and/or diff -r 800442576617 arch/ppc/lib/rheap.c --- a/arch/ppc/lib/rheap.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/lib/rheap.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/syslib/rheap.c - * * A Remote Heap. Remote means that we don't touch the memory that the * heap points to. Normal heap implementations use the memory they manage * to place their list. We cannot do that because the memory we manage may diff -r 800442576617 arch/ppc/math-emu/math.c --- a/arch/ppc/math-emu/math.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/math-emu/math.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/math-emu/math.c - * * Copyright (C) 1999 Eddie C. Dost (ecd at atecom.com) */ diff -r 800442576617 arch/ppc/mm/fault.c --- a/arch/ppc/mm/fault.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/mm/fault.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/mm/fault.c - * * PowerPC version * Copyright (C) 1995-1996 Gary Thomas (gdt at linuxppc.org) * diff -r 800442576617 arch/ppc/mm/hashtable.S --- a/arch/ppc/mm/hashtable.S Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/mm/hashtable.S Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/kernel/hashtable.S - * * $Id: hashtable.S,v 1.6 1999/10/08 01:56:15 paulus Exp $ * * PowerPC version diff -r 800442576617 arch/ppc/platforms/4xx/bamboo.c --- a/arch/ppc/platforms/4xx/bamboo.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/platforms/4xx/bamboo.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/4xx/bamboo.c - * * Bamboo board specific routines * * Wade Farnsworth diff -r 800442576617 arch/ppc/platforms/4xx/bamboo.h --- a/arch/ppc/platforms/4xx/bamboo.h Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/platforms/4xx/bamboo.h Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/bamboo.h - * * Bamboo board definitions * * Wade Farnsworth diff -r 800442576617 arch/ppc/platforms/4xx/bubinga.h --- a/arch/ppc/platforms/4xx/bubinga.h Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/platforms/4xx/bubinga.h Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/4xx/bubinga.h - * * Bubinga board definitions * * Copyright (c) 2005 DENX Software Engineering diff -r 800442576617 arch/ppc/platforms/4xx/cpci405.c --- a/arch/ppc/platforms/4xx/cpci405.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/platforms/4xx/cpci405.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/cpci405.c - * * Board setup routines for the esd CPCI-405 cPCI Board. * * Author: Stefan Roese diff -r 800442576617 arch/ppc/platforms/4xx/ebony.c --- a/arch/ppc/platforms/4xx/ebony.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/platforms/4xx/ebony.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/4xx/ebony.c - * * Ebony board specific routines * * Matt Porter diff -r 800442576617 arch/ppc/platforms/4xx/ebony.h --- a/arch/ppc/platforms/4xx/ebony.h Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/platforms/4xx/ebony.h Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/ebony.h - * * Ebony board definitions * * Matt Porter diff -r 800442576617 arch/ppc/platforms/4xx/ep405.c --- a/arch/ppc/platforms/4xx/ep405.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/platforms/4xx/ep405.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/4xx/ep405.c - * * Embedded Planet 405GP board * http://www.embeddedplanet.com * diff -r 800442576617 arch/ppc/platforms/4xx/ep405.h --- a/arch/ppc/platforms/4xx/ep405.h Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/platforms/4xx/ep405.h Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/4xx/ep405.h - * * Embedded Planet 405GP board * http://www.embeddedplanet.com * diff -r 800442576617 arch/ppc/platforms/4xx/ibm405ep.c --- a/arch/ppc/platforms/4xx/ibm405ep.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/platforms/4xx/ibm405ep.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/ibm405ep.c - * * Support for IBM PPC 405EP processors. * * Author: SAW (IBM), derived from ibmnp405l.c. diff -r 800442576617 arch/ppc/platforms/4xx/ibm405ep.h --- a/arch/ppc/platforms/4xx/ibm405ep.h Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/platforms/4xx/ibm405ep.h Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/4xx/ibm405ep.h - * * IBM PPC 405EP processor defines. * * Author: SAW (IBM), derived from ibm405gp.h. diff -r 800442576617 arch/ppc/platforms/4xx/ibm405gp.h --- a/arch/ppc/platforms/4xx/ibm405gp.h Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/platforms/4xx/ibm405gp.h Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/4xx/ibm405gp.h - * * Author: Armin Kuster akuster at mvista.com * * 2001 (c) MontaVista, Software, Inc. This file is licensed under diff -r 800442576617 arch/ppc/platforms/4xx/ibm405gpr.c --- a/arch/ppc/platforms/4xx/ibm405gpr.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/platforms/4xx/ibm405gpr.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/4xx/ibm405gpr.c - * * Author: Armin Kuster * * 2002 (c) MontaVista, Software, Inc. This file is licensed under diff -r 800442576617 arch/ppc/platforms/4xx/ibm405gpr.h --- a/arch/ppc/platforms/4xx/ibm405gpr.h Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/platforms/4xx/ibm405gpr.h Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/4xx/ibm405gpr.h - * * Author: Armin Kuster * * 2002 (c) MontaVista, Software, Inc. This file is licensed under diff -r 800442576617 arch/ppc/platforms/4xx/ibm440ep.c --- a/arch/ppc/platforms/4xx/ibm440ep.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/platforms/4xx/ibm440ep.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/4xx/ibm440ep.c - * * PPC440EP I/O descriptions * * Wade Farnsworth diff -r 800442576617 arch/ppc/platforms/4xx/ibm440ep.h --- a/arch/ppc/platforms/4xx/ibm440ep.h Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/platforms/4xx/ibm440ep.h Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/4xx/ibm440ep.h - * * PPC440EP definitions * * Wade Farnsworth diff -r 800442576617 arch/ppc/platforms/4xx/ibm440gp.c --- a/arch/ppc/platforms/4xx/ibm440gp.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/platforms/4xx/ibm440gp.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/4xx/ibm440gp.c - * * PPC440GP I/O descriptions * * Matt Porter diff -r 800442576617 arch/ppc/platforms/4xx/ibm440gp.h --- a/arch/ppc/platforms/4xx/ibm440gp.h Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/platforms/4xx/ibm440gp.h Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/4xx/ibm440gp.h - * * PPC440GP definitions * * Roland Dreier diff -r 800442576617 arch/ppc/platforms/4xx/ibm440gx.c --- a/arch/ppc/platforms/4xx/ibm440gx.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/platforms/4xx/ibm440gx.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/4xx/ibm440gx.c - * * PPC440GX I/O descriptions * * Matt Porter diff -r 800442576617 arch/ppc/platforms/4xx/ibm440gx.h --- a/arch/ppc/platforms/4xx/ibm440gx.h Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/platforms/4xx/ibm440gx.h Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/ibm440gx.h - * * PPC440GX definitions * * Matt Porter diff -r 800442576617 arch/ppc/platforms/4xx/ibm440sp.c --- a/arch/ppc/platforms/4xx/ibm440sp.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/platforms/4xx/ibm440sp.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/4xx/ibm440sp.c - * * PPC440SP I/O descriptions * * Matt Porter diff -r 800442576617 arch/ppc/platforms/4xx/ibm440sp.h --- a/arch/ppc/platforms/4xx/ibm440sp.h Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/platforms/4xx/ibm440sp.h Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/4xx/ibm440sp.h - * * PPC440SP definitions * * Matt Porter diff -r 800442576617 arch/ppc/platforms/4xx/ibmnp405h.c --- a/arch/ppc/platforms/4xx/ibmnp405h.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/platforms/4xx/ibmnp405h.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/4xx/ibmnp405h.c - * * Author: Armin Kuster * * 2000-2002 (c) MontaVista, Software, Inc. This file is licensed under diff -r 800442576617 arch/ppc/platforms/4xx/ibmnp405h.h --- a/arch/ppc/platforms/4xx/ibmnp405h.h Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/platforms/4xx/ibmnp405h.h Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/4xx/ibmnp405h.h - * * Author: Armin Kuster * * 2002 (c) MontaVista, Software, Inc. This file is licensed under diff -r 800442576617 arch/ppc/platforms/4xx/ibmstb4.c --- a/arch/ppc/platforms/4xx/ibmstb4.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/platforms/4xx/ibmstb4.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/4xx/ibmstb4.c - * * Author: Armin Kuster * * 2000-2001 (c) MontaVista, Software, Inc. This file is licensed under diff -r 800442576617 arch/ppc/platforms/4xx/ibmstb4.h --- a/arch/ppc/platforms/4xx/ibmstb4.h Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/platforms/4xx/ibmstb4.h Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/4xx/ibmstb4.h - * * Author: Armin Kuster * * 2001 (c) MontaVista, Software, Inc. This file is licensed under diff -r 800442576617 arch/ppc/platforms/4xx/ibmstbx25.c --- a/arch/ppc/platforms/4xx/ibmstbx25.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/platforms/4xx/ibmstbx25.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/4xx/ibmstbx25.c - * * Author: Armin Kuster * * 2000-2002 (c) MontaVista, Software, Inc. This file is licensed under diff -r 800442576617 arch/ppc/platforms/4xx/ibmstbx25.h --- a/arch/ppc/platforms/4xx/ibmstbx25.h Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/platforms/4xx/ibmstbx25.h Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/4xx/ibmstbx25.h - * * Author: Armin Kuster * * 2002 (c) MontaVista, Software, Inc. This file is licensed under diff -r 800442576617 arch/ppc/platforms/4xx/luan.c --- a/arch/ppc/platforms/4xx/luan.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/platforms/4xx/luan.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/4xx/luan.c - * * Luan board specific routines * * Matt Porter diff -r 800442576617 arch/ppc/platforms/4xx/luan.h --- a/arch/ppc/platforms/4xx/luan.h Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/platforms/4xx/luan.h Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/4xx/luan.h - * * Luan board definitions * * Matt Porter diff -r 800442576617 arch/ppc/platforms/4xx/ocotea.c --- a/arch/ppc/platforms/4xx/ocotea.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/platforms/4xx/ocotea.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/4xx/ocotea.c - * * Ocotea board specific routines * * Matt Porter diff -r 800442576617 arch/ppc/platforms/4xx/ocotea.h --- a/arch/ppc/platforms/4xx/ocotea.h Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/platforms/4xx/ocotea.h Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/ocotea.h - * * Ocotea board definitions * * Matt Porter diff -r 800442576617 arch/ppc/platforms/4xx/ppc440spe.c --- a/arch/ppc/platforms/4xx/ppc440spe.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/platforms/4xx/ppc440spe.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/4xx/ppc440spe.c - * * PPC440SPe I/O descriptions * * Roland Dreier diff -r 800442576617 arch/ppc/platforms/4xx/ppc440spe.h --- a/arch/ppc/platforms/4xx/ppc440spe.h Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/platforms/4xx/ppc440spe.h Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/4xx/ibm440spe.h - * * PPC440SPe definitions * * Roland Dreier diff -r 800442576617 arch/ppc/platforms/4xx/redwood5.c --- a/arch/ppc/platforms/4xx/redwood5.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/platforms/4xx/redwood5.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/4xx/redwood5.c - * * Support for the IBM redwood5 eval board file * * Author: Armin Kuster diff -r 800442576617 arch/ppc/platforms/4xx/redwood5.h --- a/arch/ppc/platforms/4xx/redwood5.h Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/platforms/4xx/redwood5.h Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/4xx/redwood5.h - * * Macros, definitions, and data structures specific to the IBM PowerPC * STB03xxx "Redwood" evaluation board. * diff -r 800442576617 arch/ppc/platforms/4xx/redwood6.c --- a/arch/ppc/platforms/4xx/redwood6.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/platforms/4xx/redwood6.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/4xx/redwood6.c - * * Author: Armin Kuster * * 2002 (c) MontaVista, Software, Inc. This file is licensed under diff -r 800442576617 arch/ppc/platforms/4xx/redwood6.h --- a/arch/ppc/platforms/4xx/redwood6.h Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/platforms/4xx/redwood6.h Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/4xx/redwood6.h - * * Macros, definitions, and data structures specific to the IBM PowerPC * STBx25xx "Redwood6" evaluation board. * diff -r 800442576617 arch/ppc/platforms/4xx/sycamore.c --- a/arch/ppc/platforms/4xx/sycamore.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/platforms/4xx/sycamore.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/4xx/sycamore.c - * * Architecture- / platform-specific boot-time initialization code for * IBM PowerPC 4xx based boards. * diff -r 800442576617 arch/ppc/platforms/4xx/sycamore.h --- a/arch/ppc/platforms/4xx/sycamore.h Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/platforms/4xx/sycamore.h Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/4xx/sycamore.h - * * Sycamore board definitions * * Copyright (c) 2005 DENX Software Engineering diff -r 800442576617 arch/ppc/platforms/4xx/virtex-ii_pro.c --- a/arch/ppc/platforms/4xx/virtex-ii_pro.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/platforms/4xx/virtex-ii_pro.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/4xx/virtex-ii_pro.c - * * Author: MontaVista Software, Inc. * source at mvista.com * diff -r 800442576617 arch/ppc/platforms/4xx/virtex-ii_pro.h --- a/arch/ppc/platforms/4xx/virtex-ii_pro.h Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/platforms/4xx/virtex-ii_pro.h Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/4xx/virtex-ii_pro.h - * * Include file that defines the Xilinx Virtex-II Pro processor * * Author: MontaVista Software, Inc. diff -r 800442576617 arch/ppc/platforms/4xx/walnut.c --- a/arch/ppc/platforms/4xx/walnut.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/platforms/4xx/walnut.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/4xx/walnut.c - * * Architecture- / platform-specific boot-time initialization code for * IBM PowerPC 4xx based boards. Adapted from original * code by Gary Thomas, Cort Dougan , and Dan Malek diff -r 800442576617 arch/ppc/platforms/4xx/walnut.h --- a/arch/ppc/platforms/4xx/walnut.h Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/platforms/4xx/walnut.h Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/4xx/walnut.h - * * Walnut board definitions * * Copyright (c) 2005 DENX Software Engineering diff -r 800442576617 arch/ppc/platforms/4xx/xilinx_ml300.c --- a/arch/ppc/platforms/4xx/xilinx_ml300.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/platforms/4xx/xilinx_ml300.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/4xx/xilinx_ml300.c - * * Xilinx ML300 evaluation board initialization * * Author: MontaVista Software, Inc. diff -r 800442576617 arch/ppc/platforms/4xx/xilinx_ml300.h --- a/arch/ppc/platforms/4xx/xilinx_ml300.h Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/platforms/4xx/xilinx_ml300.h Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/4xx/xilinx_ml300.h - * * Include file that defines the Xilinx ML300 evaluation board * * Author: MontaVista Software, Inc. diff -r 800442576617 arch/ppc/platforms/4xx/yucca.c --- a/arch/ppc/platforms/4xx/yucca.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/platforms/4xx/yucca.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/4xx/yucca.c - * * Yucca board specific routines * * Roland Dreier (based on luan.c by Matt Porter) diff -r 800442576617 arch/ppc/platforms/4xx/yucca.h --- a/arch/ppc/platforms/4xx/yucca.h Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/platforms/4xx/yucca.h Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/4xx/yucca.h - * * Yucca board definitions * * Roland Dreier (based on luan.h by Matt Porter) diff -r 800442576617 arch/ppc/platforms/83xx/mpc834x_sys.c --- a/arch/ppc/platforms/83xx/mpc834x_sys.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/platforms/83xx/mpc834x_sys.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/83xx/mpc834x_sys.c - * * MPC834x SYS board specific routines * * Maintainer: Kumar Gala diff -r 800442576617 arch/ppc/platforms/83xx/mpc834x_sys.h --- a/arch/ppc/platforms/83xx/mpc834x_sys.h Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/platforms/83xx/mpc834x_sys.h Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/83xx/mpc834x_sys.h - * * MPC834X SYS common board definitions * * Maintainer: Kumar Gala diff -r 800442576617 arch/ppc/platforms/85xx/mpc8540_ads.c --- a/arch/ppc/platforms/85xx/mpc8540_ads.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/platforms/85xx/mpc8540_ads.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/85xx/mpc8540_ads.c - * * MPC8540ADS board specific routines * * Maintainer: Kumar Gala diff -r 800442576617 arch/ppc/platforms/85xx/mpc8540_ads.h --- a/arch/ppc/platforms/85xx/mpc8540_ads.h Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/platforms/85xx/mpc8540_ads.h Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/85xx/mpc8540_ads.h - * * MPC8540ADS board definitions * * Maintainer: Kumar Gala diff -r 800442576617 arch/ppc/platforms/85xx/mpc8555_cds.h --- a/arch/ppc/platforms/85xx/mpc8555_cds.h Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/platforms/85xx/mpc8555_cds.h Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/mpc8555_cds.h - * * MPC8555CDS board definitions * * Maintainer: Kumar Gala diff -r 800442576617 arch/ppc/platforms/85xx/mpc8560_ads.c --- a/arch/ppc/platforms/85xx/mpc8560_ads.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/platforms/85xx/mpc8560_ads.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/85xx/mpc8560_ads.c - * * MPC8560ADS board specific routines * * Maintainer: Kumar Gala diff -r 800442576617 arch/ppc/platforms/85xx/mpc8560_ads.h --- a/arch/ppc/platforms/85xx/mpc8560_ads.h Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/platforms/85xx/mpc8560_ads.h Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/mpc8560_ads.h - * * MPC8540ADS board definitions * * Maintainer: Kumar Gala diff -r 800442576617 arch/ppc/platforms/85xx/mpc85xx_ads_common.c --- a/arch/ppc/platforms/85xx/mpc85xx_ads_common.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/platforms/85xx/mpc85xx_ads_common.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/85xx/mpc85xx_ads_common.c - * * MPC85xx ADS board common routines * * Maintainer: Kumar Gala diff -r 800442576617 arch/ppc/platforms/85xx/mpc85xx_ads_common.h --- a/arch/ppc/platforms/85xx/mpc85xx_ads_common.h Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/platforms/85xx/mpc85xx_ads_common.h Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/85xx/mpc85xx_ads_common.h - * * MPC85XX ADS common board definitions * * Maintainer: Kumar Gala diff -r 800442576617 arch/ppc/platforms/85xx/mpc85xx_cds_common.c --- a/arch/ppc/platforms/85xx/mpc85xx_cds_common.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/platforms/85xx/mpc85xx_cds_common.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platform/85xx/mpc85xx_cds_common.c - * * MPC85xx CDS board specific routines * * Maintainer: Kumar Gala diff -r 800442576617 arch/ppc/platforms/85xx/mpc85xx_cds_common.h --- a/arch/ppc/platforms/85xx/mpc85xx_cds_common.h Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/platforms/85xx/mpc85xx_cds_common.h Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/85xx/mpc85xx_cds_common.h - * * MPC85xx CDS board definitions * * Maintainer: Kumar Gala diff -r 800442576617 arch/ppc/platforms/85xx/sbc8560.c --- a/arch/ppc/platforms/85xx/sbc8560.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/platforms/85xx/sbc8560.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/85xx/sbc8560.c - * * Wind River SBC8560 board specific routines * * Maintainer: Kumar Gala diff -r 800442576617 arch/ppc/platforms/85xx/sbc8560.h --- a/arch/ppc/platforms/85xx/sbc8560.h Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/platforms/85xx/sbc8560.h Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/85xx/sbc8560.h - * * Wind River SBC8560 board definitions * * Copyright 2003 Motorola Inc. diff -r 800442576617 arch/ppc/platforms/85xx/sbc85xx.c --- a/arch/ppc/platforms/85xx/sbc85xx.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/platforms/85xx/sbc85xx.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platform/85xx/sbc85xx.c - * * WindRiver PowerQUICC III SBC85xx board common routines * * Copyright 2002, 2003 Motorola Inc. diff -r 800442576617 arch/ppc/platforms/85xx/sbc85xx.h --- a/arch/ppc/platforms/85xx/sbc85xx.h Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/platforms/85xx/sbc85xx.h Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/85xx/sbc85xx.h - * * WindRiver PowerQUICC III SBC85xx common board definitions * * Copyright 2003 Motorola Inc. diff -r 800442576617 arch/ppc/platforms/85xx/stx_gp3.c --- a/arch/ppc/platforms/85xx/stx_gp3.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/platforms/85xx/stx_gp3.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/85xx/stx_gp3.c - * * STx GP3 board specific routines * * Dan Malek diff -r 800442576617 arch/ppc/platforms/85xx/stx_gp3.h --- a/arch/ppc/platforms/85xx/stx_gp3.h Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/platforms/85xx/stx_gp3.h Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/stx8560_gp3.h - * * STx GP3 board definitions * * Dan Malek (dan at embeddededge.com) diff -r 800442576617 arch/ppc/platforms/85xx/tqm85xx.c --- a/arch/ppc/platforms/85xx/tqm85xx.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/platforms/85xx/tqm85xx.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/85xx/tqm85xx.c - * * TQM85xx (40/41/55/60) board specific routines * * Copyright (c) 2005 DENX Software Engineering diff -r 800442576617 arch/ppc/platforms/85xx/tqm85xx.h --- a/arch/ppc/platforms/85xx/tqm85xx.h Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/platforms/85xx/tqm85xx.h Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/85xx/tqm85xx.h - * * TQM85xx (40/41/55/60) board definitions * * Copyright (c) 2005 DENX Software Engineering diff -r 800442576617 arch/ppc/platforms/apus_setup.c --- a/arch/ppc/platforms/apus_setup.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/platforms/apus_setup.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/apus_setup.c - * * Copyright (C) 1998, 1999 Jesper Skov * * Basically what is needed to replace functionality found in diff -r 800442576617 arch/ppc/platforms/chestnut.c --- a/arch/ppc/platforms/chestnut.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/platforms/chestnut.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/chestnut.c - * * Board setup routines for IBM Chestnut * * Author: diff -r 800442576617 arch/ppc/platforms/chestnut.h --- a/arch/ppc/platforms/chestnut.h Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/platforms/chestnut.h Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/chestnut.h - * * Definitions for IBM 750FXGX Eval (Chestnut) * * Author: diff -r 800442576617 arch/ppc/platforms/chrp_pegasos_eth.c --- a/arch/ppc/platforms/chrp_pegasos_eth.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/platforms/chrp_pegasos_eth.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/chrp_pegasos_eth.c - * * Copyright (C) 2005 Sven Luther * Thanks to : * Dale Farnsworth diff -r 800442576617 arch/ppc/platforms/chrp_setup.c --- a/arch/ppc/platforms/chrp_setup.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/platforms/chrp_setup.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/setup.c - * * Copyright (C) 1995 Linus Torvalds * Adapted from 'alpha' version by Gary Thomas * Modified by Cort Dougan (cort at cs.nmt.edu) diff -r 800442576617 arch/ppc/platforms/chrp_time.c --- a/arch/ppc/platforms/chrp_time.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/platforms/chrp_time.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/chrp_time.c - * * Copyright (C) 1991, 1992, 1995 Linus Torvalds * * Adapted for PowerPC (PReP) by Gary Thomas diff -r 800442576617 arch/ppc/platforms/cpci690.c --- a/arch/ppc/platforms/cpci690.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/platforms/cpci690.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/cpci690.c - * * Board setup routines for the Force CPCI690 board. * * Author: Mark A. Greer diff -r 800442576617 arch/ppc/platforms/cpci690.h --- a/arch/ppc/platforms/cpci690.h Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/platforms/cpci690.h Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/cpci690.h - * * Definitions for Force CPCI690 * * Author: Mark A. Greer diff -r 800442576617 arch/ppc/platforms/ev64260.c --- a/arch/ppc/platforms/ev64260.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/platforms/ev64260.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/ev64260.c - * * Board setup routines for the Marvell/Galileo EV-64260-BP Evaluation Board. * * Author: Mark A. Greer diff -r 800442576617 arch/ppc/platforms/ev64260.h --- a/arch/ppc/platforms/ev64260.h Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/platforms/ev64260.h Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/ev64260.h - * * Definitions for Marvell/Galileo EV-64260-BP Evaluation Board. * * Author: Mark A. Greer diff -r 800442576617 arch/ppc/platforms/ev64360.c --- a/arch/ppc/platforms/ev64360.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/platforms/ev64360.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/ev64360.c - * * Board setup routines for the Marvell EV-64360-BP Evaluation Board. * * Author: Lee Nicks diff -r 800442576617 arch/ppc/platforms/ev64360.h --- a/arch/ppc/platforms/ev64360.h Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/platforms/ev64360.h Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/ev64360.h - * * Definitions for Marvell EV-64360-BP Evaluation Board. * * Author: Lee Nicks diff -r 800442576617 arch/ppc/platforms/gemini.h --- a/arch/ppc/platforms/gemini.h Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/platforms/gemini.h Sat Jan 14 23:40:17 2006 @@ -1,7 +1,4 @@ /* - * arch/ppc/platforms/gemini.h - * - * * Onboard registers and descriptions for Synergy Microsystems' * "Gemini" boards. * diff -r 800442576617 arch/ppc/platforms/gemini_prom.S --- a/arch/ppc/platforms/gemini_prom.S Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/platforms/gemini_prom.S Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/gemini_prom.S - * * Not really prom support code (yet), but sort of anti-prom code. The current * bootloader does a number of things it shouldn't and doesn't do things that it * should. The stuff in here is mainly a hodge-podge collection of setup code diff -r 800442576617 arch/ppc/platforms/gemini_setup.c --- a/arch/ppc/platforms/gemini_setup.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/platforms/gemini_setup.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/gemini_setup.c - * * Copyright (C) 1995 Linus Torvalds * Adapted from 'alpha' version by Gary Thomas * Modified by Cort Dougan (cort at cs.nmt.edu) diff -r 800442576617 arch/ppc/platforms/hdpu.c --- a/arch/ppc/platforms/hdpu.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/platforms/hdpu.c Sat Jan 14 23:40:17 2006 @@ -1,7 +1,4 @@ - /* - * arch/ppc/platforms/hdpu_setup.c - * * Board setup routines for the Sky Computers HDPU Compute Blade. * * Written by Brian Waite diff -r 800442576617 arch/ppc/platforms/hdpu.h --- a/arch/ppc/platforms/hdpu.h Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/platforms/hdpu.h Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/hdpu.h - * * Definitions for Sky Computers HDPU board. * * Brian Waite diff -r 800442576617 arch/ppc/platforms/katana.c --- a/arch/ppc/platforms/katana.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/platforms/katana.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/katana.c - * * Board setup routines for the Artesyn Katana cPCI boards. * * Author: Tim Montgomery diff -r 800442576617 arch/ppc/platforms/katana.h --- a/arch/ppc/platforms/katana.h Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/platforms/katana.h Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/katana.h - * * Definitions for Artesyn Katana750i/3750 board. * * Author: Tim Montgomery diff -r 800442576617 arch/ppc/platforms/lite5200.c --- a/arch/ppc/platforms/lite5200.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/platforms/lite5200.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/lite5200.c - * * Platform support file for the Freescale LITE5200 based on MPC52xx. * A maximum of this file should be moved to syslib/mpc52xx_????? * so that new platform based on MPC52xx need a minimal platform file diff -r 800442576617 arch/ppc/platforms/lite5200.h --- a/arch/ppc/platforms/lite5200.h Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/platforms/lite5200.h Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/lite5200.h - * * Definitions for Freescale LITE5200 : MPC52xx Standard Development * Platform board support * diff -r 800442576617 arch/ppc/platforms/lopec.c --- a/arch/ppc/platforms/lopec.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/platforms/lopec.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/lopec.c - * * Setup routines for the Motorola LoPEC. * * Author: Dan Cox diff -r 800442576617 arch/ppc/platforms/mvme5100.c --- a/arch/ppc/platforms/mvme5100.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/platforms/mvme5100.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/mvme5100.c - * * Board setup routines for the Motorola MVME5100. * * Author: Matt Porter diff -r 800442576617 arch/ppc/platforms/pal4.h --- a/arch/ppc/platforms/pal4.h Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/platforms/pal4.h Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/pal4.h - * * Definitions for SBS Palomar IV board * * Author: Dan Cox diff -r 800442576617 arch/ppc/platforms/pal4_pci.c --- a/arch/ppc/platforms/pal4_pci.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/platforms/pal4_pci.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/pal4_pci.c - * * PCI support for SBS Palomar IV * * Author: Dan Cox diff -r 800442576617 arch/ppc/platforms/pal4_serial.h --- a/arch/ppc/platforms/pal4_serial.h Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/platforms/pal4_serial.h Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/pal4_serial.h - * * Definitions for SBS PalomarIV serial support * * Author: Dan Cox diff -r 800442576617 arch/ppc/platforms/pal4_setup.c --- a/arch/ppc/platforms/pal4_setup.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/platforms/pal4_setup.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/pal4_setup.c - * * Board setup routines for the SBS PalomarIV. * * Author: Dan Cox diff -r 800442576617 arch/ppc/platforms/pmac_cpufreq.c --- a/arch/ppc/platforms/pmac_cpufreq.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/platforms/pmac_cpufreq.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/pmac_cpufreq.c - * * Copyright (C) 2002 - 2005 Benjamin Herrenschmidt * Copyright (C) 2004 John Steele Scott * diff -r 800442576617 arch/ppc/platforms/pmac_feature.c --- a/arch/ppc/platforms/pmac_feature.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/platforms/pmac_feature.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/pmac_feature.c - * * Copyright (C) 1996-2001 Paul Mackerras (paulus at cs.anu.edu.au) * Ben. Herrenschmidt (benh at kernel.crashing.org) * diff -r 800442576617 arch/ppc/platforms/pmac_low_i2c.c --- a/arch/ppc/platforms/pmac_low_i2c.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/platforms/pmac_low_i2c.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/pmac_low_i2c.c - * * Copyright (C) 2003 Ben. Herrenschmidt (benh at kernel.crashing.org) * * This program is free software; you can redistribute it and/or diff -r 800442576617 arch/ppc/platforms/pmac_nvram.c --- a/arch/ppc/platforms/pmac_nvram.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/platforms/pmac_nvram.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/pmac_nvram.c - * * Copyright (C) 2002 Benjamin Herrenschmidt (benh at kernel.crashing.org) * * This program is free software; you can redistribute it and/or diff -r 800442576617 arch/ppc/platforms/pmac_setup.c --- a/arch/ppc/platforms/pmac_setup.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/platforms/pmac_setup.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/setup.c - * * PowerPC version * Copyright (C) 1995-1996 Gary Thomas (gdt at linuxppc.org) * diff -r 800442576617 arch/ppc/platforms/powerpmc250.c --- a/arch/ppc/platforms/powerpmc250.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/platforms/powerpmc250.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/powerpmc250.c - * * Board setup routines for Force PowerPMC-250 Processor PMC * * Author: Troy Benjegerdes diff -r 800442576617 arch/ppc/platforms/pplus.c --- a/arch/ppc/platforms/pplus.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/platforms/pplus.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/pplus.c - * * Board and PCI setup routines for MCG PowerPlus * * Author: Randy Vinson diff -r 800442576617 arch/ppc/platforms/pplus.h --- a/arch/ppc/platforms/pplus.h Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/platforms/pplus.h Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/pplus.h - * * Definitions for Motorola MCG Falcon/Raven & HAWK North Bridge & Memory ctlr. * * Author: Mark A. Greerinclude/asm-ppc/hawk.h diff -r 800442576617 arch/ppc/platforms/pq2ads.c --- a/arch/ppc/platforms/pq2ads.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/platforms/pq2ads.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/pq2ads.c - * * PQ2ADS platform support * * Author: Kumar Gala diff -r 800442576617 arch/ppc/platforms/prep_setup.c --- a/arch/ppc/platforms/prep_setup.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/platforms/prep_setup.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/setup.c - * * Copyright (C) 1995 Linus Torvalds * Adapted from 'alpha' version by Gary Thomas * Modified by Cort Dougan (cort at cs.nmt.edu) diff -r 800442576617 arch/ppc/platforms/prpmc750.c --- a/arch/ppc/platforms/prpmc750.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/platforms/prpmc750.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/prpmc750_setup.c - * * Board setup routines for Motorola PrPMC750 * * Author: Matt Porter diff -r 800442576617 arch/ppc/platforms/prpmc800.c --- a/arch/ppc/platforms/prpmc800.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/platforms/prpmc800.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/prpmc800.c - * * Author: Dale Farnsworth * * 2001-2004 (c) MontaVista, Software, Inc. This file is licensed under diff -r 800442576617 arch/ppc/platforms/radstone_ppc7d.c --- a/arch/ppc/platforms/radstone_ppc7d.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/platforms/radstone_ppc7d.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/radstone_ppc7d.c - * * Board setup routines for the Radstone PPC7D boards. * * Author: James Chapman diff -r 800442576617 arch/ppc/platforms/radstone_ppc7d.h --- a/arch/ppc/platforms/radstone_ppc7d.h Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/platforms/radstone_ppc7d.h Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/radstone_ppc7d.h - * * Board definitions for the Radstone PPC7D boards. * * Author: James Chapman diff -r 800442576617 arch/ppc/platforms/sandpoint.c --- a/arch/ppc/platforms/sandpoint.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/platforms/sandpoint.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/sandpoint_setup.c - * * Board setup routines for the Motorola SPS Sandpoint Test Platform. * * Author: Mark A. Greer diff -r 800442576617 arch/ppc/platforms/sandpoint.h --- a/arch/ppc/platforms/sandpoint.h Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/platforms/sandpoint.h Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/sandpoint.h - * * Definitions for Motorola SPS Sandpoint Test Platform * * Author: Mark A. Greer diff -r 800442576617 arch/ppc/platforms/sbc82xx.c --- a/arch/ppc/platforms/sbc82xx.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/platforms/sbc82xx.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/sbc82xx.c - * * SBC82XX platform support * * Author: Guy Streeter diff -r 800442576617 arch/ppc/platforms/spruce.c --- a/arch/ppc/platforms/spruce.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/platforms/spruce.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/spruce.c - * * Board and PCI setup routines for IBM Spruce * * Author: MontaVista Software diff -r 800442576617 arch/ppc/platforms/tqm8260_setup.c --- a/arch/ppc/platforms/tqm8260_setup.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/platforms/tqm8260_setup.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/tqm8260_setup.c - * * TQM8260 platform support * * Author: Allen Curtis diff -r 800442576617 arch/ppc/syslib/cpc700.h --- a/arch/ppc/syslib/cpc700.h Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/syslib/cpc700.h Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/syslib/cpc700.h - * * Header file for IBM CPC700 Host Bridge, et. al. * * Author: Mark A. Greer diff -r 800442576617 arch/ppc/syslib/cpc700_pic.c --- a/arch/ppc/syslib/cpc700_pic.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/syslib/cpc700_pic.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/syslib/cpc700_pic.c - * * Interrupt controller support for IBM Spruce * * Authors: Mark Greer, Matt Porter, and Johnnie Peters diff -r 800442576617 arch/ppc/syslib/cpc710.h --- a/arch/ppc/syslib/cpc710.h Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/syslib/cpc710.h Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/syslib/cpc710.h - * * Definitions for the IBM CPC710 PCI Host Bridge * * Author: Matt Porter diff -r 800442576617 arch/ppc/syslib/gen550.h --- a/arch/ppc/syslib/gen550.h Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/syslib/gen550.h Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/syslib/gen550.h - * * gen550 prototypes * * Matt Porter diff -r 800442576617 arch/ppc/syslib/gen550_dbg.c --- a/arch/ppc/syslib/gen550_dbg.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/syslib/gen550_dbg.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/syslib/gen550_dbg.c - * * A library of polled 16550 serial routines. These are intended to * be used to support progress messages, xmon, kgdb, etc. on a * variety of platforms. diff -r 800442576617 arch/ppc/syslib/gen550_kgdb.c --- a/arch/ppc/syslib/gen550_kgdb.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/syslib/gen550_kgdb.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/syslib/gen550_kgdb.c - * * Generic 16550 kgdb support intended to be useful on a variety * of platforms. To enable this support, it is necessary to set * the CONFIG_GEN550 option. Any virtual mapping of the serial diff -r 800442576617 arch/ppc/syslib/gt64260_pic.c --- a/arch/ppc/syslib/gt64260_pic.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/syslib/gt64260_pic.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/syslib/gt64260_pic.c - * * Interrupt controller support for Galileo's GT64260. * * Author: Chris Zankel diff -r 800442576617 arch/ppc/syslib/harrier.c --- a/arch/ppc/syslib/harrier.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/syslib/harrier.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/syslib/harrier.c - * * Motorola MCG Harrier northbridge/memory controller support * * Author: Dale Farnsworth diff -r 800442576617 arch/ppc/syslib/hawk_common.c --- a/arch/ppc/syslib/hawk_common.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/syslib/hawk_common.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/syslib/hawk_common.c - * * Common Motorola PowerPlus Platform--really Falcon/Raven or HAWK. * * Author: Mark A. Greer diff -r 800442576617 arch/ppc/syslib/ibm440gp_common.c --- a/arch/ppc/syslib/ibm440gp_common.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/syslib/ibm440gp_common.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/syslib/ibm440gp_common.c - * * PPC440GP system library * * Matt Porter diff -r 800442576617 arch/ppc/syslib/ibm440gp_common.h --- a/arch/ppc/syslib/ibm440gp_common.h Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/syslib/ibm440gp_common.h Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/kernel/ibm440gp_common.h - * * PPC440GP system library * * Eugene Surovegin or diff -r 800442576617 arch/ppc/syslib/ibm440gx_common.c --- a/arch/ppc/syslib/ibm440gx_common.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/syslib/ibm440gx_common.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/kernel/ibm440gx_common.c - * * PPC440GX system library * * Eugene Surovegin or diff -r 800442576617 arch/ppc/syslib/ibm440gx_common.h --- a/arch/ppc/syslib/ibm440gx_common.h Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/syslib/ibm440gx_common.h Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/kernel/ibm440gx_common.h - * * PPC440GX system library * * Eugene Surovegin or diff -r 800442576617 arch/ppc/syslib/ibm440sp_common.c --- a/arch/ppc/syslib/ibm440sp_common.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/syslib/ibm440sp_common.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/syslib/ibm440sp_common.c - * * PPC440SP/PPC440SPe system library * * Matt Porter diff -r 800442576617 arch/ppc/syslib/ibm440sp_common.h --- a/arch/ppc/syslib/ibm440sp_common.h Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/syslib/ibm440sp_common.h Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/syslib/ibm440sp_common.h - * * PPC440SP system library * * Matt Porter diff -r 800442576617 arch/ppc/syslib/ibm44x_common.c --- a/arch/ppc/syslib/ibm44x_common.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/syslib/ibm44x_common.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/syslib/ibm44x_common.c - * * PPC44x system library * * Matt Porter diff -r 800442576617 arch/ppc/syslib/ibm44x_common.h --- a/arch/ppc/syslib/ibm44x_common.h Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/syslib/ibm44x_common.h Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/kernel/ibm44x_common.h - * * PPC44x system library * * Eugene Surovegin or diff -r 800442576617 arch/ppc/syslib/m8260_pci_erratum9.c --- a/arch/ppc/syslib/m8260_pci_erratum9.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/syslib/m8260_pci_erratum9.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/mpc8260_pci9.c - * * Workaround for device erratum PCI 9. * See Motorola's "XPC826xA Family Device Errata Reference." * The erratum applies to all 8260 family Hip4 processors. It is scheduled diff -r 800442576617 arch/ppc/syslib/m8260_setup.c --- a/arch/ppc/syslib/m8260_setup.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/syslib/m8260_setup.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/syslib/m8260_setup.c - * * Copyright (C) 1995 Linus Torvalds * Adapted from 'alpha' version by Gary Thomas * Modified by Cort Dougan (cort at cs.nmt.edu) diff -r 800442576617 arch/ppc/syslib/m8xx_setup.c --- a/arch/ppc/syslib/m8xx_setup.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/syslib/m8xx_setup.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/kernel/setup.c - * * Copyright (C) 1995 Linus Torvalds * Adapted from 'alpha' version by Gary Thomas * Modified by Cort Dougan (cort at cs.nmt.edu) diff -r 800442576617 arch/ppc/syslib/mpc10x_common.c --- a/arch/ppc/syslib/mpc10x_common.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/syslib/mpc10x_common.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/syslib/mpc10x_common.c - * * Common routines for the Motorola SPS MPC106, MPC107 and MPC8240 Host bridge, * Mem ctlr, EPIC, etc. * diff -r 800442576617 arch/ppc/syslib/mpc52xx_devices.c --- a/arch/ppc/syslib/mpc52xx_devices.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/syslib/mpc52xx_devices.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/syslib/mpc52xx_devices.c - * * Freescale MPC52xx device descriptions * * diff -r 800442576617 arch/ppc/syslib/mpc52xx_pci.c --- a/arch/ppc/syslib/mpc52xx_pci.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/syslib/mpc52xx_pci.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/syslib/mpc52xx_pci.c - * * PCI code for the Freescale MPC52xx embedded CPU. * * diff -r 800442576617 arch/ppc/syslib/mpc52xx_pci.h --- a/arch/ppc/syslib/mpc52xx_pci.h Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/syslib/mpc52xx_pci.h Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/syslib/mpc52xx_pci.h - * * PCI Include file the Freescale MPC52xx embedded cpu chips * * diff -r 800442576617 arch/ppc/syslib/mpc52xx_pic.c --- a/arch/ppc/syslib/mpc52xx_pic.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/syslib/mpc52xx_pic.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/syslib/mpc52xx_pic.c - * * Programmable Interrupt Controller functions for the Freescale MPC52xx * embedded CPU. * diff -r 800442576617 arch/ppc/syslib/mpc52xx_setup.c --- a/arch/ppc/syslib/mpc52xx_setup.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/syslib/mpc52xx_setup.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/syslib/mpc52xx_setup.c - * * Common code for the boards based on Freescale MPC52xx embedded CPU. * * diff -r 800442576617 arch/ppc/syslib/mpc52xx_sys.c --- a/arch/ppc/syslib/mpc52xx_sys.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/syslib/mpc52xx_sys.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/syslib/mpc52xx_sys.c - * * Freescale MPC52xx system descriptions * * diff -r 800442576617 arch/ppc/syslib/mpc83xx_devices.c --- a/arch/ppc/syslib/mpc83xx_devices.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/syslib/mpc83xx_devices.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/83xx/mpc83xx_devices.c - * * MPC83xx Device descriptions * * Maintainer: Kumar Gala diff -r 800442576617 arch/ppc/syslib/mpc83xx_sys.c --- a/arch/ppc/syslib/mpc83xx_sys.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/syslib/mpc83xx_sys.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/83xx/mpc83xx_sys.c - * * MPC83xx System descriptions * * Maintainer: Kumar Gala diff -r 800442576617 arch/ppc/syslib/mpc85xx_devices.c --- a/arch/ppc/syslib/mpc85xx_devices.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/syslib/mpc85xx_devices.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/85xx/mpc85xx_devices.c - * * MPC85xx Device descriptions * * Maintainer: Kumar Gala diff -r 800442576617 arch/ppc/syslib/mpc85xx_sys.c --- a/arch/ppc/syslib/mpc85xx_sys.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/syslib/mpc85xx_sys.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/85xx/mpc85xx_sys.c - * * MPC85xx System descriptions * * Maintainer: Kumar Gala diff -r 800442576617 arch/ppc/syslib/mpc8xx_devices.c --- a/arch/ppc/syslib/mpc8xx_devices.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/syslib/mpc8xx_devices.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/syslib/mpc8xx_devices.c - * * MPC8xx Device descriptions * * Maintainer: Kumar Gala diff -r 800442576617 arch/ppc/syslib/mpc8xx_sys.c --- a/arch/ppc/syslib/mpc8xx_sys.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/syslib/mpc8xx_sys.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/mpc8xx_sys.c - * * MPC8xx System descriptions * * Maintainer: Kumar Gala diff -r 800442576617 arch/ppc/syslib/mv64360_pic.c --- a/arch/ppc/syslib/mv64360_pic.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/syslib/mv64360_pic.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/kernel/mv64360_pic.c - * * Interrupt controller support for Marvell's MV64360. * * Author: Rabeeh Khoury diff -r 800442576617 arch/ppc/syslib/mv64x60.c --- a/arch/ppc/syslib/mv64x60.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/syslib/mv64x60.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/syslib/mv64x60.c - * * Common routines for the Marvell/Galileo Discovery line of host bridges * (gt64260, mv64360, mv64460, ...). * diff -r 800442576617 arch/ppc/syslib/mv64x60_dbg.c --- a/arch/ppc/syslib/mv64x60_dbg.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/syslib/mv64x60_dbg.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/syslib/mv64x60_dbg.c - * * KGDB and progress routines for the Marvell/Galileo MV64x60 (Discovery). * * Author: Mark A. Greer diff -r 800442576617 arch/ppc/syslib/mv64x60_win.c --- a/arch/ppc/syslib/mv64x60_win.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/syslib/mv64x60_win.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/syslib/mv64x60_win.c - * * Tables with info on how to manipulate the 32 & 64 bit windows on the * various types of Marvell bridge chips. * diff -r 800442576617 arch/ppc/syslib/open_pic.c --- a/arch/ppc/syslib/open_pic.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/syslib/open_pic.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/kernel/open_pic.c -- OpenPIC Interrupt Handling - * * Copyright (C) 1997 Geert Uytterhoeven * * This file is subject to the terms and conditions of the GNU General Public diff -r 800442576617 arch/ppc/syslib/open_pic2.c --- a/arch/ppc/syslib/open_pic2.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/syslib/open_pic2.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/kernel/open_pic.c -- OpenPIC Interrupt Handling - * * Copyright (C) 1997 Geert Uytterhoeven * * This file is subject to the terms and conditions of the GNU General Public diff -r 800442576617 arch/ppc/syslib/open_pic_defs.h --- a/arch/ppc/syslib/open_pic_defs.h Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/syslib/open_pic_defs.h Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/kernel/open_pic_defs.h -- OpenPIC definitions - * * Copyright (C) 1997 Geert Uytterhoeven * * This file is based on the following documentation: diff -r 800442576617 arch/ppc/syslib/pci_auto.c --- a/arch/ppc/syslib/pci_auto.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/syslib/pci_auto.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/syslib/pci_auto.c - * * PCI autoconfiguration library * * Author: Matt Porter diff -r 800442576617 arch/ppc/syslib/ppc4xx_dma.c --- a/arch/ppc/syslib/ppc4xx_dma.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/syslib/ppc4xx_dma.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/kernel/ppc4xx_dma.c - * * IBM PPC4xx DMA engine core library * * Copyright 2000-2004 MontaVista Software Inc. diff -r 800442576617 arch/ppc/syslib/ppc4xx_pic.c --- a/arch/ppc/syslib/ppc4xx_pic.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/syslib/ppc4xx_pic.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/syslib/ppc4xx_pic.c - * * Interrupt controller driver for PowerPC 4xx-based processors. * * Eugene Surovegin or diff -r 800442576617 arch/ppc/syslib/ppc4xx_sgdma.c --- a/arch/ppc/syslib/ppc4xx_sgdma.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/syslib/ppc4xx_sgdma.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/kernel/ppc4xx_sgdma.c - * * IBM PPC4xx DMA engine scatter/gather library * * Copyright 2002-2003 MontaVista Software Inc. diff -r 800442576617 arch/ppc/syslib/ppc83xx_setup.c --- a/arch/ppc/syslib/ppc83xx_setup.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/syslib/ppc83xx_setup.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/syslib/ppc83xx_setup.c - * * MPC83XX common board code * * Maintainer: Kumar Gala diff -r 800442576617 arch/ppc/syslib/ppc83xx_setup.h --- a/arch/ppc/syslib/ppc83xx_setup.h Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/syslib/ppc83xx_setup.h Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/syslib/ppc83xx_setup.h - * * MPC83XX common board definitions * * Maintainer: Kumar Gala diff -r 800442576617 arch/ppc/syslib/ppc85xx_common.c --- a/arch/ppc/syslib/ppc85xx_common.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/syslib/ppc85xx_common.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/syslib/ppc85xx_common.c - * * MPC85xx support routines * * Maintainer: Kumar Gala diff -r 800442576617 arch/ppc/syslib/ppc85xx_common.h --- a/arch/ppc/syslib/ppc85xx_common.h Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/syslib/ppc85xx_common.h Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/syslib/ppc85xx_common.h - * * MPC85xx support routines * * Maintainer: Kumar Gala diff -r 800442576617 arch/ppc/syslib/ppc85xx_setup.c --- a/arch/ppc/syslib/ppc85xx_setup.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/syslib/ppc85xx_setup.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/syslib/ppc85xx_setup.c - * * MPC85XX common board code * * Maintainer: Kumar Gala diff -r 800442576617 arch/ppc/syslib/ppc85xx_setup.h --- a/arch/ppc/syslib/ppc85xx_setup.h Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/syslib/ppc85xx_setup.h Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/syslib/ppc85xx_setup.h - * * MPC85XX common board definitions * * Maintainer: Kumar Gala diff -r 800442576617 arch/ppc/syslib/ppc_sys.c --- a/arch/ppc/syslib/ppc_sys.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/syslib/ppc_sys.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/syslib/ppc_sys.c - * * PPC System library functions * * Maintainer: Kumar Gala diff -r 800442576617 arch/ppc/syslib/pq2_devices.c --- a/arch/ppc/syslib/pq2_devices.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/syslib/pq2_devices.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/syslib/pq2_devices.c - * * PQ2 Device descriptions * * Maintainer: Kumar Gala diff -r 800442576617 arch/ppc/syslib/pq2_sys.c --- a/arch/ppc/syslib/pq2_sys.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/syslib/pq2_sys.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/syslib/pq2_devices.c - * * PQ2 System descriptions * * Maintainer: Kumar Gala diff -r 800442576617 arch/ppc/syslib/prep_nvram.c --- a/arch/ppc/syslib/prep_nvram.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/syslib/prep_nvram.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/kernel/prep_nvram.c - * * Copyright (C) 1998 Corey Minyard * * This reads the NvRAM on PReP compliant machines (generally from IBM or diff -r 800442576617 arch/ppc/syslib/todc_time.c --- a/arch/ppc/syslib/todc_time.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/syslib/todc_time.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/syslib/todc_time.c - * * Time of Day Clock support for the M48T35, M48T37, M48T59, and MC146818 * Real Time Clocks/Timekeepers. * diff -r 800442576617 arch/ppc/syslib/xilinx_pic.c --- a/arch/ppc/syslib/xilinx_pic.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/syslib/xilinx_pic.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/syslib/xilinx_pic.c - * * Interrupt controller driver for Xilinx Virtex-II Pro. * * Author: MontaVista Software, Inc. diff -r 800442576617 drivers/char/hvcs.c --- a/drivers/char/hvcs.c Sat Jan 14 05:24:55 2006 +++ b/drivers/char/hvcs.c Sat Jan 14 23:40:17 2006 @@ -118,7 +118,7 @@ * the hvcs_final_close() function in order to get it out of the spinlock. * Rearranged hvcs_close(). Cleaned up some printks and did some housekeeping * on the changelog. Removed local CLC_LENGTH and used HVCS_CLC_LENGTH from - * arch/ppc64/hvcserver.h. + * include/asm-powerpc/hvcserver.h * * 1.3.2 -> 1.3.3 Replaced yield() in hvcs_close() with tty_wait_until_sent() to * prevent possible lockup with realtime scheduling as similarily pointed out by @@ -168,9 +168,10 @@ /* * The hcall interface involves putting 8 chars into each of two registers. - * We load up those 2 registers (in arch/ppc64/hvconsole.c) by casting char[16] - * to long[2]. It would work without __ALIGNED__, but a little (tiny) bit - * slower because an unaligned load is slower than aligned load. + * We load up those 2 registers (in arch/powerpc/platforms/pseries/hvconsole.c) + * by casting char[16] to long[2]. It would work without __ALIGNED__, but a + * little (tiny) bit slower because an unaligned load is slower than aligned + * load. */ #define __ALIGNED__ __attribute__((__aligned__(8))) diff -r 800442576617 include/asm-powerpc/paca.h --- a/include/asm-powerpc/paca.h Sat Jan 14 05:24:55 2006 +++ b/include/asm-powerpc/paca.h Sat Jan 14 23:40:17 2006 @@ -54,7 +54,7 @@ #endif /* CONFIG_PPC_ISERIES */ /* - * MAGIC: the spinlock functions in arch/ppc64/lib/locks.c + * MAGIC: the spinlock functions in arch/powerpc/lib/locks.c * load lock_token and paca_index with a single lwz * instruction. They must travel together and be properly * aligned. diff -r 800442576617 include/asm-powerpc/rwsem.h --- a/include/asm-powerpc/rwsem.h Sat Jan 14 05:24:55 2006 +++ b/include/asm-powerpc/rwsem.h Sat Jan 14 23:40:17 2006 @@ -4,7 +4,7 @@ #ifdef __KERNEL__ /* - * include/asm-ppc64/rwsem.h: R/W semaphores for PPC using the stuff + * include/asm-powerpc/rwsem.h: R/W semaphores for PPC using the stuff * in lib/rwsem.c. Adapted largely from include/asm-i386/rwsem.h * by Paul Mackerras . */ diff -r 800442576617 include/asm-ppc/harrier.h --- a/include/asm-ppc/harrier.h Sat Jan 14 05:24:55 2006 +++ b/include/asm-ppc/harrier.h Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/kernel/harrier.h - * * Definitions for Motorola MCG Harrier North Bridge & Memory controller * * Author: Dale Farnsworth diff -r 800442576617 include/asm-ppc/mpc10x.h --- a/include/asm-ppc/mpc10x.h Sat Jan 14 05:24:55 2006 +++ b/include/asm-ppc/mpc10x.h Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/kernel/mpc10x.h - * * Common routines for the Motorola SPS MPC106/8240/107 Host bridge/Mem * ctlr/EPIC/etc. * diff -r 800442576617 kernel/auditsc.c --- a/kernel/auditsc.c Sat Jan 14 05:24:55 2006 +++ b/kernel/auditsc.c Sat Jan 14 23:40:17 2006 @@ -958,7 +958,7 @@ * * i386 no * x86_64 no - * ppc64 yes (see arch/ppc64/kernel/misc.S) + * ppc64 yes (see arch/powerpc/platforms/iseries/misc.S) * * This also happens with vm86 emulation in a non-nested manner * (entries without exits), so this case must be caught. diff -r 800442576617 lib/extable.c --- a/lib/extable.c Sat Jan 14 05:24:55 2006 +++ b/lib/extable.c Sat Jan 14 23:40:17 2006 @@ -1,5 +1,4 @@ /* - * lib/extable.c * Derived from arch/ppc/mm/extable.c and arch/i386/mm/extable.c. * * Copyright (C) 2004 Paul Mackerras, IBM Corp. From galak at kernel.crashing.org Sun Jan 15 18:33:57 2006 From: galak at kernel.crashing.org (Kumar Gala) Date: Sun, 15 Jan 2006 01:33:57 -0600 Subject: please pull powerpc-merge.git In-Reply-To: <20060114204811.GT2491@pb15.lixom.net> References: <17352.31911.799540.543433@cargo.ozlabs.ibm.com> <20060114204811.GT2491@pb15.lixom.net> Message-ID: <0E772062-74AF-44C0-9481-E2F2E981677D@kernel.crashing.org> On Jan 14, 2006, at 2:48 PM, Olof Johansson wrote: > On Sat, Jan 14, 2006 at 03:23:03PM +1100, Paul Mackerras wrote: > >> powerpc: Add FSL SOC library and setup code >> powerpc: Add MPC834x SYS board to arch/powerpc > > Hrm. I commented on these patches on the list, not knowing they had > already been merged. > > These were posted on the list less than 12 hours before the pull > request. It'd be nice to have a bit more time than that to look at > them > and comment next time around. I know the upstream merge window is > closing, > but still. I didn't see any comments related to the the MPC834x SYS board patch. - kumar From galak at kernel.crashing.org Sun Jan 15 18:42:12 2006 From: galak at kernel.crashing.org (Kumar Gala) Date: Sun, 15 Jan 2006 01:42:12 -0600 Subject: [PATCH] trivial: modify comments to refer to new location of files In-Reply-To: <20060115060716.GA2157@us.ibm.com> References: <20060112180240.GB17539@us.ibm.com> <20060113114401.3289f33f.sfr@canb.auug.org.au> <20060115060716.GA2157@us.ibm.com> Message-ID: I'm with Stephen and we should probably just drop these. The problem is (and I just did this myself) is that people use an existing file as a template and duplicate whatever its doing. - kumar On Jan 15, 2006, at 12:07 AM, Jon Mason wrote: > On Fri, Jan 13, 2006 at 11:44:01AM +1100, Stephen Rothwell wrote: >> Can we just remove these useless self references, please? > > Is this more towards your liking? > > Signed-off-by: Jon Mason > > diff -r 800442576617 Documentation/powerpc/eeh-pci-error-recovery.txt > --- a/Documentation/powerpc/eeh-pci-error-recovery.txt Sat Jan 14 > 05:24:55 2006 > +++ b/Documentation/powerpc/eeh-pci-error-recovery.txt Sat Jan 14 > 23:40:17 2006 > @@ -121,7 +121,7 @@ > > EEH must be enabled in the PHB's very early during the boot process, > and if a PCI slot is hot-plugged. The former is performed by > -eeh_init() in arch/ppc64/kernel/eeh.c, and the later by > +eeh_init() in arch/powerpc/platforms/pseries/eeh.c, and the later by > drivers/pci/hotplug/pSeries_pci.c calling in to the eeh.c code. > EEH must be enabled before a PCI scan of the device can proceed. > Current Power5 hardware will not work unless EEH is enabled; > @@ -133,7 +133,7 @@ > pci_get_device_by_addr() will find the pci device associated > with that address (if any). > > -The default include/asm-ppc64/io.h macros readb(), inb(), insb(), > +The default include/asm-powerpc/io.h macros readb(), inb(), insb(), > etc. include a check to see if the i/o read returned all-0xff's. > If so, these make a call to eeh_dn_check_failure(), which in turn > asks the firmware if the all-ff's value is the sign of a true EEH > @@ -143,11 +143,12 @@ > all of these occur during boot, when the PCI bus is scanned, where > a large number of 0xff reads are part of the bus scan procedure. > > -If a frozen slot is detected, code in arch/ppc64/kernel/eeh.c will > -print a stack trace to syslog (/var/log/messages). This stack trace > -has proven to be very useful to device-driver authors for finding > -out at what point the EEH error was detected, as the error itself > -usually occurs slightly beforehand. > +If a frozen slot is detected, code in > +arch/powerpc/platforms/pseries/eeh.c will print a stack trace to > +syslog (/var/log/messages). This stack trace has proven to be very > +useful to device-driver authors for finding out at what point the EEH > +error was detected, as the error itself usually occurs slightly > +beforehand. > > Next, it uses the Linux kernel notifier chain/work queue mechanism to > allow any interested parties to find out about the failure. Device > diff -r 800442576617 arch/powerpc/boot/install.sh > --- a/arch/powerpc/boot/install.sh Sat Jan 14 05:24:55 2006 > +++ b/arch/powerpc/boot/install.sh Sat Jan 14 23:40:17 2006 > @@ -1,6 +1,4 @@ > #!/bin/sh > -# > -# arch/ppc64/boot/install.sh > # > # This file is subject to the terms and conditions of the GNU > General Public > # License. See the file "COPYING" in the main directory of this > archive > diff -r 800442576617 arch/powerpc/kernel/entry_64.S > --- a/arch/powerpc/kernel/entry_64.S Sat Jan 14 05:24:55 2006 > +++ b/arch/powerpc/kernel/entry_64.S Sat Jan 14 23:40:17 2006 > @@ -1,6 +1,4 @@ > /* > - * arch/ppc64/kernel/entry.S > - * > * PowerPC version > * Copyright (C) 1995-1996 Gary Thomas (gdt at linuxppc.org) > * Rewritten by Cort Dougan (cort at cs.nmt.edu) for PReP > @@ -374,7 +372,7 @@ > * the fork code also. > * > * The code which creates the new task context is in 'copy_thread' > - * in arch/ppc64/kernel/process.c > + * in arch/powerpc/kernel/process.c > */ > .align 7 > _GLOBAL(_switch) > diff -r 800442576617 arch/powerpc/kernel/head_44x.S > --- a/arch/powerpc/kernel/head_44x.S Sat Jan 14 05:24:55 2006 > +++ b/arch/powerpc/kernel/head_44x.S Sat Jan 14 23:40:17 2006 > @@ -1,6 +1,4 @@ > /* > - * arch/ppc/kernel/head_44x.S > - * > * Kernel execution entry point code. > * > * Copyright (c) 1995-1996 Gary Thomas > diff -r 800442576617 arch/powerpc/kernel/head_64.S > --- a/arch/powerpc/kernel/head_64.S Sat Jan 14 05:24:55 2006 > +++ b/arch/powerpc/kernel/head_64.S Sat Jan 14 23:40:17 2006 > @@ -1,6 +1,4 @@ > /* > - * arch/ppc64/kernel/head.S > - * > * PowerPC version > * Copyright (C) 1995-1996 Gary Thomas (gdt at linuxppc.org) > * > diff -r 800442576617 arch/powerpc/kernel/head_8xx.S > --- a/arch/powerpc/kernel/head_8xx.S Sat Jan 14 05:24:55 2006 > +++ b/arch/powerpc/kernel/head_8xx.S Sat Jan 14 23:40:17 2006 > @@ -1,6 +1,4 @@ > /* > - * arch/ppc/kernel/except_8xx.S > - * > * PowerPC version > * Copyright (C) 1995-1996 Gary Thomas (gdt at linuxppc.org) > * Rewritten by Cort Dougan (cort at cs.nmt.edu) for PReP > diff -r 800442576617 arch/powerpc/kernel/head_fsl_booke.S > --- a/arch/powerpc/kernel/head_fsl_booke.S Sat Jan 14 05:24:55 2006 > +++ b/arch/powerpc/kernel/head_fsl_booke.S Sat Jan 14 23:40:17 2006 > @@ -1,6 +1,4 @@ > /* > - * arch/ppc/kernel/head_fsl_booke.S > - * > * Kernel execution entry point code. > * > * Copyright (c) 1995-1996 Gary Thomas > diff -r 800442576617 arch/powerpc/kernel/iomap.c > --- a/arch/powerpc/kernel/iomap.c Sat Jan 14 05:24:55 2006 > +++ b/arch/powerpc/kernel/iomap.c Sat Jan 14 23:40:17 2006 > @@ -1,6 +1,4 @@ > /* > - * arch/ppc64/kernel/iomap.c > - * > * ppc64 "iomap" interface implementation. > * > * (C) Copyright 2004 Linus Torvalds > diff -r 800442576617 arch/powerpc/kernel/iommu.c > --- a/arch/powerpc/kernel/iommu.c Sat Jan 14 05:24:55 2006 > +++ b/arch/powerpc/kernel/iommu.c Sat Jan 14 23:40:17 2006 > @@ -1,5 +1,4 @@ > /* > - * arch/ppc64/kernel/iommu.c > * Copyright (C) 2001 Mike Corrigan & Dave Engebretsen, IBM > Corporation > * > * Rewrite, cleanup, new allocation schemes, virtual merging: > diff -r 800442576617 arch/powerpc/kernel/irq.c > --- a/arch/powerpc/kernel/irq.c Sat Jan 14 05:24:55 2006 > +++ b/arch/powerpc/kernel/irq.c Sat Jan 14 23:40:17 2006 > @@ -1,6 +1,4 @@ > /* > - * arch/ppc/kernel/irq.c > - * > * Derived from arch/i386/kernel/irq.c > * Copyright (C) 1992 Linus Torvalds > * Adapted from arch/i386 by Gary Thomas > diff -r 800442576617 arch/powerpc/kernel/kprobes.c > --- a/arch/powerpc/kernel/kprobes.c Sat Jan 14 05:24:55 2006 > +++ b/arch/powerpc/kernel/kprobes.c Sat Jan 14 23:40:17 2006 > @@ -1,6 +1,5 @@ > /* > * Kernel Probes (KProbes) > - * arch/ppc64/kernel/kprobes.c > * > * This program is free software; you can redistribute it and/or > modify > * it under the terms of the GNU General Public License as > published by > diff -r 800442576617 arch/powerpc/kernel/pci_iommu.c > --- a/arch/powerpc/kernel/pci_iommu.c Sat Jan 14 05:24:55 2006 > +++ b/arch/powerpc/kernel/pci_iommu.c Sat Jan 14 23:40:17 2006 > @@ -1,5 +1,4 @@ > /* > - * arch/ppc64/kernel/pci_iommu.c > * Copyright (C) 2001 Mike Corrigan & Dave Engebretsen, IBM > Corporation > * > * Rewrite, cleanup, new allocation schemes: > diff -r 800442576617 arch/powerpc/kernel/process.c > --- a/arch/powerpc/kernel/process.c Sat Jan 14 05:24:55 2006 > +++ b/arch/powerpc/kernel/process.c Sat Jan 14 23:40:17 2006 > @@ -1,6 +1,4 @@ > /* > - * arch/ppc/kernel/process.c > - * > * Derived from "arch/i386/kernel/process.c" > * Copyright (C) 1995 Linus Torvalds > * > diff -r 800442576617 arch/powerpc/kernel/ptrace-common.h > --- a/arch/powerpc/kernel/ptrace-common.h Sat Jan 14 05:24:55 2006 > +++ b/arch/powerpc/kernel/ptrace-common.h Sat Jan 14 23:40:17 2006 > @@ -1,6 +1,4 @@ > /* > - * linux/arch/ppc64/kernel/ptrace-common.h > - * > * Copyright (c) 2002 Stephen Rothwell, IBM Coproration > * Extracted from ptrace.c and ptrace32.c > * > diff -r 800442576617 arch/powerpc/kernel/rtas-proc.c > --- a/arch/powerpc/kernel/rtas-proc.c Sat Jan 14 05:24:55 2006 > +++ b/arch/powerpc/kernel/rtas-proc.c Sat Jan 14 23:40:17 2006 > @@ -1,5 +1,4 @@ > /* > - * arch/ppc64/kernel/rtas-proc.c > * Copyright (C) 2000 Tilmann Bitterberg > * (tilmann at bitterberg.de) > * > diff -r 800442576617 arch/powerpc/kernel/rtas_pci.c > --- a/arch/powerpc/kernel/rtas_pci.c Sat Jan 14 05:24:55 2006 > +++ b/arch/powerpc/kernel/rtas_pci.c Sat Jan 14 23:40:17 2006 > @@ -1,6 +1,4 @@ > /* > - * arch/ppc64/kernel/rtas_pci.c > - * > * Copyright (C) 2001 Dave Engebretsen, IBM Corporation > * Copyright (C) 2003 Anton Blanchard , IBM > * > diff -r 800442576617 arch/powerpc/kernel/signal_64.c > --- a/arch/powerpc/kernel/signal_64.c Sat Jan 14 05:24:55 2006 > +++ b/arch/powerpc/kernel/signal_64.c Sat Jan 14 23:40:17 2006 > @@ -1,6 +1,4 @@ > /* > - * linux/arch/ppc64/kernel/signal.c > - * > * PowerPC version > * Copyright (C) 1995-1996 Gary Thomas (gdt at linuxppc.org) > * > diff -r 800442576617 arch/powerpc/kernel/vdso.c > --- a/arch/powerpc/kernel/vdso.c Sat Jan 14 05:24:55 2006 > +++ b/arch/powerpc/kernel/vdso.c Sat Jan 14 23:40:17 2006 > @@ -1,6 +1,4 @@ > /* > - * linux/arch/ppc64/kernel/vdso.c > - * > * Copyright (C) 2004 Benjamin Herrenschmidt, IBM Corp. > * > * > diff -r 800442576617 arch/powerpc/lib/copypage_64.S > --- a/arch/powerpc/lib/copypage_64.S Sat Jan 14 05:24:55 2006 > +++ b/arch/powerpc/lib/copypage_64.S Sat Jan 14 23:40:17 2006 > @@ -1,6 +1,4 @@ > /* > - * arch/ppc64/lib/copypage.S > - * > * Copyright (C) 2002 Paul Mackerras, IBM Corp. > * > * This program is free software; you can redistribute it and/or > diff -r 800442576617 arch/powerpc/lib/copyuser_64.S > --- a/arch/powerpc/lib/copyuser_64.S Sat Jan 14 05:24:55 2006 > +++ b/arch/powerpc/lib/copyuser_64.S Sat Jan 14 23:40:17 2006 > @@ -1,6 +1,4 @@ > /* > - * arch/ppc64/lib/copyuser.S > - * > * Copyright (C) 2002 Paul Mackerras, IBM Corp. > * > * This program is free software; you can redistribute it and/or > diff -r 800442576617 arch/powerpc/lib/e2a.c > --- a/arch/powerpc/lib/e2a.c Sat Jan 14 05:24:55 2006 > +++ b/arch/powerpc/lib/e2a.c Sat Jan 14 23:40:17 2006 > @@ -1,9 +1,7 @@ > /* > - * arch/ppc64/lib/e2a.c > - * > * EBCDIC to ASCII conversion > * > - * This function moved here from arch/ppc64/kernel/viopath.c > + * This function moved here from arch/powerpc/platforms/iseries/ > viopath.c > * > * (C) Copyright 2000-2004 IBM Corporation > * > diff -r 800442576617 arch/powerpc/lib/memcpy_64.S > --- a/arch/powerpc/lib/memcpy_64.S Sat Jan 14 05:24:55 2006 > +++ b/arch/powerpc/lib/memcpy_64.S Sat Jan 14 23:40:17 2006 > @@ -1,6 +1,4 @@ > /* > - * arch/ppc64/lib/memcpy.S > - * > * Copyright (C) 2002 Paul Mackerras, IBM Corp. > * > * This program is free software; you can redistribute it and/or > diff -r 800442576617 arch/powerpc/lib/rheap.c > --- a/arch/powerpc/lib/rheap.c Sat Jan 14 05:24:55 2006 > +++ b/arch/powerpc/lib/rheap.c Sat Jan 14 23:40:17 2006 > @@ -1,6 +1,4 @@ > /* > - * arch/ppc/syslib/rheap.c > - * > * A Remote Heap. Remote means that we don't touch the memory > that the > * heap points to. Normal heap implementations use the memory they > manage > * to place their list. We cannot do that because the memory we > manage may > diff -r 800442576617 arch/powerpc/mm/fault.c > --- a/arch/powerpc/mm/fault.c Sat Jan 14 05:24:55 2006 > +++ b/arch/powerpc/mm/fault.c Sat Jan 14 23:40:17 2006 > @@ -1,6 +1,4 @@ > /* > - * arch/ppc/mm/fault.c > - * > * PowerPC version > * Copyright (C) 1995-1996 Gary Thomas (gdt at linuxppc.org) > * > diff -r 800442576617 arch/powerpc/mm/hash_low_32.S > --- a/arch/powerpc/mm/hash_low_32.S Sat Jan 14 05:24:55 2006 > +++ b/arch/powerpc/mm/hash_low_32.S Sat Jan 14 23:40:17 2006 > @@ -1,6 +1,4 @@ > /* > - * arch/ppc/kernel/hashtable.S > - * > * $Id: hashtable.S,v 1.6 1999/10/08 01:56:15 paulus Exp $ > * > * PowerPC version > diff -r 800442576617 arch/powerpc/mm/mmap.c > --- a/arch/powerpc/mm/mmap.c Sat Jan 14 05:24:55 2006 > +++ b/arch/powerpc/mm/mmap.c Sat Jan 14 23:40:17 2006 > @@ -1,6 +1,4 @@ > /* > - * linux/arch/ppc64/mm/mmap.c > - * > * flexible mmap layout support > * > * Copyright 2003-2004 Red Hat Inc., Durham, North Carolina. > diff -r 800442576617 arch/powerpc/mm/slb_low.S > --- a/arch/powerpc/mm/slb_low.S Sat Jan 14 05:24:55 2006 > +++ b/arch/powerpc/mm/slb_low.S Sat Jan 14 23:40:17 2006 > @@ -1,6 +1,4 @@ > /* > - * arch/ppc64/mm/slb_low.S > - * > * Low-level SLB routines > * > * Copyright (C) 2004 David Gibson , IBM > diff -r 800442576617 arch/powerpc/mm/tlb_64.c > --- a/arch/powerpc/mm/tlb_64.c Sat Jan 14 05:24:55 2006 > +++ b/arch/powerpc/mm/tlb_64.c Sat Jan 14 23:40:17 2006 > @@ -36,7 +36,7 @@ > DEFINE_PER_CPU(struct ppc64_tlb_batch, ppc64_tlb_batch); > > /* This is declared as we are using the more or less generic > - * include/asm-ppc64/tlb.h file -- tgall > + * include/asm-powerpc/tlb.h file -- tgall > */ > DEFINE_PER_CPU(struct mmu_gather, mmu_gathers); > DEFINE_PER_CPU(struct pte_freelist_batch *, pte_freelist_cur); > diff -r 800442576617 arch/powerpc/platforms/chrp/pegasos_eth.c > --- a/arch/powerpc/platforms/chrp/pegasos_eth.c Sat Jan 14 05:24:55 > 2006 > +++ b/arch/powerpc/platforms/chrp/pegasos_eth.c Sat Jan 14 23:40:17 > 2006 > @@ -1,6 +1,4 @@ > /* > - * arch/ppc/platforms/chrp_pegasos_eth.c > - * > * Copyright (C) 2005 Sven Luther > * Thanks to : > * Dale Farnsworth > diff -r 800442576617 arch/powerpc/platforms/chrp/setup.c > --- a/arch/powerpc/platforms/chrp/setup.c Sat Jan 14 05:24:55 2006 > +++ b/arch/powerpc/platforms/chrp/setup.c Sat Jan 14 23:40:17 2006 > @@ -1,6 +1,4 @@ > /* > - * arch/ppc/platforms/setup.c > - * > * Copyright (C) 1995 Linus Torvalds > * Adapted from 'alpha' version by Gary Thomas > * Modified by Cort Dougan (cort at cs.nmt.edu) > diff -r 800442576617 arch/powerpc/platforms/chrp/time.c > --- a/arch/powerpc/platforms/chrp/time.c Sat Jan 14 05:24:55 2006 > +++ b/arch/powerpc/platforms/chrp/time.c Sat Jan 14 23:40:17 2006 > @@ -1,6 +1,4 @@ > /* > - * arch/ppc/platforms/chrp_time.c > - * > * Copyright (C) 1991, 1992, 1995 Linus Torvalds > * > * Adapted for PowerPC (PReP) by Gary Thomas > diff -r 800442576617 arch/powerpc/platforms/maple/time.c > --- a/arch/powerpc/platforms/maple/time.c Sat Jan 14 05:24:55 2006 > +++ b/arch/powerpc/platforms/maple/time.c Sat Jan 14 23:40:17 2006 > @@ -1,6 +1,4 @@ > /* > - * arch/ppc64/kernel/maple_time.c > - * > * (c) Copyright 2004 Benjamin Herrenschmidt > (benh at kernel.crashing.org), > * IBM Corp. > * > diff -r 800442576617 arch/powerpc/platforms/powermac/cpufreq_32.c > --- a/arch/powerpc/platforms/powermac/cpufreq_32.c Sat Jan 14 > 05:24:55 2006 > +++ b/arch/powerpc/platforms/powermac/cpufreq_32.c Sat Jan 14 > 23:40:17 2006 > @@ -1,6 +1,4 @@ > /* > - * arch/ppc/platforms/pmac_cpufreq.c > - * > * Copyright (C) 2002 - 2005 Benjamin Herrenschmidt > > * Copyright (C) 2004 John Steele Scott > * > diff -r 800442576617 arch/powerpc/platforms/powermac/feature.c > --- a/arch/powerpc/platforms/powermac/feature.c Sat Jan 14 05:24:55 > 2006 > +++ b/arch/powerpc/platforms/powermac/feature.c Sat Jan 14 23:40:17 > 2006 > @@ -1,6 +1,4 @@ > /* > - * arch/ppc/platforms/pmac_feature.c > - * > * Copyright (C) 1996-2001 Paul Mackerras (paulus at cs.anu.edu.au) > * Ben. Herrenschmidt > (benh at kernel.crashing.org) > * > diff -r 800442576617 arch/powerpc/platforms/powermac/nvram.c > --- a/arch/powerpc/platforms/powermac/nvram.c Sat Jan 14 05:24:55 2006 > +++ b/arch/powerpc/platforms/powermac/nvram.c Sat Jan 14 23:40:17 2006 > @@ -1,6 +1,4 @@ > /* > - * arch/ppc/platforms/pmac_nvram.c > - * > * Copyright (C) 2002 Benjamin Herrenschmidt > (benh at kernel.crashing.org) > * > * This program is free software; you can redistribute it and/or > diff -r 800442576617 arch/powerpc/platforms/pseries/hvCall.S > --- a/arch/powerpc/platforms/pseries/hvCall.S Sat Jan 14 05:24:55 2006 > +++ b/arch/powerpc/platforms/pseries/hvCall.S Sat Jan 14 23:40:17 2006 > @@ -1,6 +1,4 @@ > /* > - * arch/ppc64/kernel/pSeries_hvCall.S > - * > * This file contains the generic code to perform a call to the > * pSeries LPAR hypervisor. > * NOTE: this file will go away when we move to inline this work. > diff -r 800442576617 arch/powerpc/platforms/pseries/iommu.c > --- a/arch/powerpc/platforms/pseries/iommu.c Sat Jan 14 05:24:55 2006 > +++ b/arch/powerpc/platforms/pseries/iommu.c Sat Jan 14 23:40:17 2006 > @@ -1,6 +1,4 @@ > /* > - * arch/ppc64/kernel/pSeries_iommu.c > - * > * Copyright (C) 2001 Mike Corrigan & Dave Engebretsen, IBM > Corporation > * > * Rewrite, cleanup: > diff -r 800442576617 arch/powerpc/platforms/pseries/pci.c > --- a/arch/powerpc/platforms/pseries/pci.c Sat Jan 14 05:24:55 2006 > +++ b/arch/powerpc/platforms/pseries/pci.c Sat Jan 14 23:40:17 2006 > @@ -1,6 +1,4 @@ > /* > - * arch/ppc64/kernel/pSeries_pci.c > - * > * Copyright (C) 2001 Dave Engebretsen, IBM Corporation > * Copyright (C) 2003 Anton Blanchard , IBM > * > diff -r 800442576617 arch/powerpc/sysdev/dcr.S > --- a/arch/powerpc/sysdev/dcr.S Sat Jan 14 05:24:55 2006 > +++ b/arch/powerpc/sysdev/dcr.S Sat Jan 14 23:40:17 2006 > @@ -1,6 +1,4 @@ > /* > - * arch/ppc/syslib/dcr.S > - * > * "Indirect" DCR access > * > * Copyright (c) 2004 Eugene Surovegin > diff -r 800442576617 arch/powerpc/sysdev/ipic.h > --- a/arch/powerpc/sysdev/ipic.h Sat Jan 14 05:24:55 2006 > +++ b/arch/powerpc/sysdev/ipic.h Sat Jan 14 23:40:17 2006 > @@ -1,6 +1,4 @@ > /* > - * arch/ppc/kernel/ipic.h > - * > * IPIC private definitions and structure. > * > * Maintainer: Kumar Gala > diff -r 800442576617 arch/ppc/4xx_io/serial_sicc.c > --- a/arch/ppc/4xx_io/serial_sicc.c Sat Jan 14 05:24:55 2006 > +++ b/arch/ppc/4xx_io/serial_sicc.c Sat Jan 14 23:40:17 2006 > @@ -1,6 +1,4 @@ > /* > - * arch/ppc/4xx_io/serial_sicc.c > - * > * Driver for IBM STB3xxx SICC serial port > * > * Based on drivers/char/serial_amba.c, by ARM Ltd. > diff -r 800442576617 arch/ppc/amiga/amiints.c > --- a/arch/ppc/amiga/amiints.c Sat Jan 14 05:24:55 2006 > +++ b/arch/ppc/amiga/amiints.c Sat Jan 14 23:40:17 2006 > @@ -1,5 +1,5 @@ > /* > - * arch/ppc/amiga/amiints.c -- Amiga Linux interrupt handling code > + * Amiga Linux interrupt handling code > * > * This file is subject to the terms and conditions of the GNU > General Public > * License. See the file COPYING in the main directory of this > archive > diff -r 800442576617 arch/ppc/amiga/bootinfo.c > --- a/arch/ppc/amiga/bootinfo.c Sat Jan 14 05:24:55 2006 > +++ b/arch/ppc/amiga/bootinfo.c Sat Jan 14 23:40:17 2006 > @@ -1,6 +1,4 @@ > /* > - * arch/ppc/amiga/bootinfo.c > - * > * Extracted from arch/m68k/kernel/setup.c. > * Should be properly generalized and put somewhere else. > * Jesper > diff -r 800442576617 arch/ppc/amiga/cia.c > --- a/arch/ppc/amiga/cia.c Sat Jan 14 05:24:55 2006 > +++ b/arch/ppc/amiga/cia.c Sat Jan 14 23:40:17 2006 > @@ -1,6 +1,4 @@ > /* > - * arch/ppc/amiga/cia.c - CIA support > - * > * Copyright (C) 1996 Roman Zippel > * > * The concept of some functions bases on the original Amiga OS > function > diff -r 800442576617 arch/ppc/amiga/ints.c > --- a/arch/ppc/amiga/ints.c Sat Jan 14 05:24:55 2006 > +++ b/arch/ppc/amiga/ints.c Sat Jan 14 23:40:17 2006 > @@ -1,6 +1,4 @@ > /* > - * arch/ppc/amiga/ints.c > - * > * Linux/m68k general interrupt handling code from arch/m68k/ > kernel/ints.c > * Needed to drive the m68k emulating IRQ hardware on the PowerUp > boards. > */ > diff -r 800442576617 arch/ppc/boot/Makefile > --- a/arch/ppc/boot/Makefile Sat Jan 14 05:24:55 2006 > +++ b/arch/ppc/boot/Makefile Sat Jan 14 23:40:17 2006 > @@ -1,6 +1,3 @@ > -# > -# arch/ppc/boot/Makefile > -# > # This file is subject to the terms and conditions of the GNU > General Public > # License. See the file "COPYING" in the main directory of this > archive > # for more details. > diff -r 800442576617 arch/ppc/boot/common/Makefile > --- a/arch/ppc/boot/common/Makefile Sat Jan 14 05:24:55 2006 > +++ b/arch/ppc/boot/common/Makefile Sat Jan 14 23:40:17 2006 > @@ -1,6 +1,3 @@ > -# > -# arch/ppc/boot/common/Makefile > -# > # This file is subject to the terms and conditions of the GNU > General Public > # License. See the file "COPYING" in the main directory of this > archive > # for more details. > diff -r 800442576617 arch/ppc/boot/common/bootinfo.c > --- a/arch/ppc/boot/common/bootinfo.c Sat Jan 14 05:24:55 2006 > +++ b/arch/ppc/boot/common/bootinfo.c Sat Jan 14 23:40:17 2006 > @@ -1,6 +1,4 @@ > /* > - * arch/ppc/common/bootinfo.c > - * > * General bootinfo record utilities > * Author: Randy Vinson > * > diff -r 800442576617 arch/ppc/boot/common/misc-common.c > --- a/arch/ppc/boot/common/misc-common.c Sat Jan 14 05:24:55 2006 > +++ b/arch/ppc/boot/common/misc-common.c Sat Jan 14 23:40:17 2006 > @@ -1,6 +1,4 @@ > /* > - * arch/ppc/boot/common/misc-common.c > - * > * Misc. bootloader code (almost) all platforms can use > * > * Author: Johnnie Peters > diff -r 800442576617 arch/ppc/boot/common/serial_stub.c > --- a/arch/ppc/boot/common/serial_stub.c Sat Jan 14 05:24:55 2006 > +++ b/arch/ppc/boot/common/serial_stub.c Sat Jan 14 23:40:17 2006 > @@ -1,6 +1,4 @@ > /* > - * arch/ppc/boot/common/serial_stub.c > - * > * This is a few stub routines to make the boot code cleaner > looking when > * there is no serial port support doesn't need to be closed, for > example. > * > diff -r 800442576617 arch/ppc/boot/common/util.S > --- a/arch/ppc/boot/common/util.S Sat Jan 14 05:24:55 2006 > +++ b/arch/ppc/boot/common/util.S Sat Jan 14 23:40:17 2006 > @@ -1,6 +1,4 @@ > /* > - * arch/ppc/boot/common/util.S > - * > * Useful bootup functions, which are more easily done in asm than C. > * > * NOTE: Be very very careful about the registers you use here. > diff -r 800442576617 arch/ppc/boot/include/mpc10x.h > --- a/arch/ppc/boot/include/mpc10x.h Sat Jan 14 05:24:55 2006 > +++ b/arch/ppc/boot/include/mpc10x.h Sat Jan 14 23:40:17 2006 > @@ -1,6 +1,4 @@ > /* > - * arch/ppc/boot/include/mpc10.h > - * > * Common defines for the Motorola SPS MPC106/8240/107 Host bridge/ > Mem > * ctrl/EPIC/etc. > * > diff -r 800442576617 arch/ppc/boot/simple/cpc700_memory.c > --- a/arch/ppc/boot/simple/cpc700_memory.c Sat Jan 14 05:24:55 2006 > +++ b/arch/ppc/boot/simple/cpc700_memory.c Sat Jan 14 23:40:17 2006 > @@ -1,6 +1,4 @@ > /* > - * arch/ppc/boot/common/cpc700_memory.c > - * > * Find memory based upon settings in the CPC700 bridge > * > * Author: Dan Cox > diff -r 800442576617 arch/ppc/boot/simple/head.S > --- a/arch/ppc/boot/simple/head.S Sat Jan 14 05:24:55 2006 > +++ b/arch/ppc/boot/simple/head.S Sat Jan 14 23:40:17 2006 > @@ -1,6 +1,4 @@ > /* > - * arch/ppc/boot/simple/head.S > - * > * Initial board bringup code for many different boards. > * > * Author: Tom Rini > diff -r 800442576617 arch/ppc/boot/simple/misc-chestnut.c > --- a/arch/ppc/boot/simple/misc-chestnut.c Sat Jan 14 05:24:55 2006 > +++ b/arch/ppc/boot/simple/misc-chestnut.c Sat Jan 14 23:40:17 2006 > @@ -1,6 +1,4 @@ > /* > - * arch/ppc/boot/simple/misc-chestnut.c > - * > * Setup for the IBM Chestnut (ibm-750fxgx_eval) > * > * Author: Mark A. Greer > diff -r 800442576617 arch/ppc/boot/simple/misc-cpci690.c > --- a/arch/ppc/boot/simple/misc-cpci690.c Sat Jan 14 05:24:55 2006 > +++ b/arch/ppc/boot/simple/misc-cpci690.c Sat Jan 14 23:40:17 2006 > @@ -1,6 +1,4 @@ > /* > - * arch/ppc/boot/simple/misc-cpci690.c > - * > * Add birec data for Force CPCI690 board. > * > * Author: Mark A. Greer > diff -r 800442576617 arch/ppc/boot/simple/misc-ev64260.c > --- a/arch/ppc/boot/simple/misc-ev64260.c Sat Jan 14 05:24:55 2006 > +++ b/arch/ppc/boot/simple/misc-ev64260.c Sat Jan 14 23:40:17 2006 > @@ -1,6 +1,4 @@ > /* > - * arch/ppc/boot/simple/misc-ev64260.c > - * > * Host bridge init code for the Marvell/Galileo EV-64260-BP > evaluation board > * with a GT64260 onboard. > * > diff -r 800442576617 arch/ppc/boot/simple/misc-ev64360.c > --- a/arch/ppc/boot/simple/misc-ev64360.c Sat Jan 14 05:24:55 2006 > +++ b/arch/ppc/boot/simple/misc-ev64360.c Sat Jan 14 23:40:17 2006 > @@ -1,5 +1,4 @@ > /* > - * arch/ppc/boot/simple/misc-ev64360.c > * Copyright (C) 2005 Lee Nicks > * > * Based on arch/ppc/boot/simple/misc-katana.c from: > diff -r 800442576617 arch/ppc/boot/simple/misc-katana.c > --- a/arch/ppc/boot/simple/misc-katana.c Sat Jan 14 05:24:55 2006 > +++ b/arch/ppc/boot/simple/misc-katana.c Sat Jan 14 23:40:17 2006 > @@ -1,6 +1,4 @@ > /* > - * arch/ppc/boot/simple/misc-katana.c > - * > * Set up MPSC values to bootwrapper can prompt user. > * > * Author: Mark A. Greer > diff -r 800442576617 arch/ppc/boot/simple/misc-mv64x60.c > --- a/arch/ppc/boot/simple/misc-mv64x60.c Sat Jan 14 05:24:55 2006 > +++ b/arch/ppc/boot/simple/misc-mv64x60.c Sat Jan 14 23:40:17 2006 > @@ -1,6 +1,4 @@ > /* > - * arch/ppc/boot/simple/misc-mv64x60.c > - * > * Relocate bridge's register base and call board specific routine. > * > * Author: Mark A. Greer > diff -r 800442576617 arch/ppc/boot/simple/misc-prep.c > --- a/arch/ppc/boot/simple/misc-prep.c Sat Jan 14 05:24:55 2006 > +++ b/arch/ppc/boot/simple/misc-prep.c Sat Jan 14 23:40:17 2006 > @@ -1,6 +1,4 @@ > /* > - * arch/ppc/boot/simple/misc-prep.c > - * > * Maintainer: Tom Rini > * > * In the past: Gary Thomas, Cort Dougan > diff -r 800442576617 arch/ppc/boot/simple/misc-radstone_ppc7d.c > --- a/arch/ppc/boot/simple/misc-radstone_ppc7d.c Sat Jan 14 > 05:24:55 2006 > +++ b/arch/ppc/boot/simple/misc-radstone_ppc7d.c Sat Jan 14 > 23:40:17 2006 > @@ -1,6 +1,4 @@ > /* > - * arch/ppc/boot/simple/misc-radstone_ppc7d.c > - * > * Misc data for Radstone PPC7D board. > * > * Author: James Chapman > diff -r 800442576617 arch/ppc/boot/simple/misc-spruce.c > --- a/arch/ppc/boot/simple/misc-spruce.c Sat Jan 14 05:24:55 2006 > +++ b/arch/ppc/boot/simple/misc-spruce.c Sat Jan 14 23:40:17 2006 > @@ -1,6 +1,4 @@ > /* > - * arch/ppc/boot/spruce/misc.c > - * > * Misc. bootloader code for IBM Spruce reference platform > * > * Authors: Johnnie Peters > diff -r 800442576617 arch/ppc/boot/simple/misc.c > --- a/arch/ppc/boot/simple/misc.c Sat Jan 14 05:24:55 2006 > +++ b/arch/ppc/boot/simple/misc.c Sat Jan 14 23:40:17 2006 > @@ -1,6 +1,4 @@ > /* > - * arch/ppc/simple/misc.c > - * > * Misc. bootloader code for many machines. This assumes you have > are using > * a 6xx/7xx/74xx CPU in your machine. This assumes the chunk of > memory > * below 8MB is free. Finally, it assumes you have a NS16550- > style uart for > diff -r 800442576617 arch/ppc/boot/simple/mpc10x_memory.c > --- a/arch/ppc/boot/simple/mpc10x_memory.c Sat Jan 14 05:24:55 2006 > +++ b/arch/ppc/boot/simple/mpc10x_memory.c Sat Jan 14 23:40:17 2006 > @@ -1,6 +1,4 @@ > /* > - * arch/ppc/boot/common/mpc10x_common.c > - * > * A routine to find out how much memory the machine has. > * > * Based on: > diff -r 800442576617 arch/ppc/boot/simple/mpc52xx_tty.c > --- a/arch/ppc/boot/simple/mpc52xx_tty.c Sat Jan 14 05:24:55 2006 > +++ b/arch/ppc/boot/simple/mpc52xx_tty.c Sat Jan 14 23:40:17 2006 > @@ -1,6 +1,4 @@ > /* > - * arch/ppc/boot/simple/mpc52xx_tty.c > - * > * Minimal serial functions needed to send messages out a MPC52xx > * Programmable Serial Controller (PSC). > * > diff -r 800442576617 arch/ppc/boot/simple/mv64x60_tty.c > --- a/arch/ppc/boot/simple/mv64x60_tty.c Sat Jan 14 05:24:55 2006 > +++ b/arch/ppc/boot/simple/mv64x60_tty.c Sat Jan 14 23:40:17 2006 > @@ -1,6 +1,4 @@ > /* > - * arch/ppc/boot/simple/mv64x60_tty.c > - * > * Bootloader version of the embedded MPSC/UART driver for the > Marvell 64x60. > * Note: Due to a GT64260A erratum, DMA will be used for UART > input (via SDMA). > * > diff -r 800442576617 arch/ppc/boot/simple/openbios.c > --- a/arch/ppc/boot/simple/openbios.c Sat Jan 14 05:24:55 2006 > +++ b/arch/ppc/boot/simple/openbios.c Sat Jan 14 23:40:17 2006 > @@ -1,6 +1,4 @@ > /* > - * arch/ppc/boot/simple/openbios.c > - * > * Copyright (c) 2005 DENX Software Engineering > * Stefan Roese > * > diff -r 800442576617 arch/ppc/boot/simple/relocate.S > --- a/arch/ppc/boot/simple/relocate.S Sat Jan 14 05:24:55 2006 > +++ b/arch/ppc/boot/simple/relocate.S Sat Jan 14 23:40:17 2006 > @@ -1,6 +1,4 @@ > /* > - * arch/ppc/boot/simple/relocate.S > - * > * This is the common part of the loader relocation and > initialization > * process. All of the board/processor specific initialization is > * done before we get here. > diff -r 800442576617 arch/ppc/boot/utils/mkbugboot.c > --- a/arch/ppc/boot/utils/mkbugboot.c Sat Jan 14 05:24:55 2006 > +++ b/arch/ppc/boot/utils/mkbugboot.c Sat Jan 14 23:40:17 2006 > @@ -1,6 +1,4 @@ > /* > - * arch/ppc/boot/utils/mkbugboot.c > - * > * Makes a Motorola PPCBUG ROM bootable image which can be flashed > * into one of the FLASH banks on a Motorola PowerPlus board. > * > diff -r 800442576617 arch/ppc/kernel/head_44x.S > --- a/arch/ppc/kernel/head_44x.S Sat Jan 14 05:24:55 2006 > +++ b/arch/ppc/kernel/head_44x.S Sat Jan 14 23:40:17 2006 > @@ -1,6 +1,4 @@ > /* > - * arch/ppc/kernel/head_44x.S > - * > * Kernel execution entry point code. > * > * Copyright (c) 1995-1996 Gary Thomas > diff -r 800442576617 arch/ppc/kernel/head_8xx.S > --- a/arch/ppc/kernel/head_8xx.S Sat Jan 14 05:24:55 2006 > +++ b/arch/ppc/kernel/head_8xx.S Sat Jan 14 23:40:17 2006 > @@ -1,6 +1,4 @@ > /* > - * arch/ppc/kernel/except_8xx.S > - * > * PowerPC version > * Copyright (C) 1995-1996 Gary Thomas (gdt at linuxppc.org) > * Rewritten by Cort Dougan (cort at cs.nmt.edu) for PReP > diff -r 800442576617 arch/ppc/kernel/head_fsl_booke.S > --- a/arch/ppc/kernel/head_fsl_booke.S Sat Jan 14 05:24:55 2006 > +++ b/arch/ppc/kernel/head_fsl_booke.S Sat Jan 14 23:40:17 2006 > @@ -1,6 +1,4 @@ > /* > - * arch/ppc/kernel/head_fsl_booke.S > - * > * Kernel execution entry point code. > * > * Copyright (c) 1995-1996 Gary Thomas > diff -r 800442576617 arch/ppc/kernel/traps.c > --- a/arch/ppc/kernel/traps.c Sat Jan 14 05:24:55 2006 > +++ b/arch/ppc/kernel/traps.c Sat Jan 14 23:40:17 2006 > @@ -1,6 +1,4 @@ > /* > - * arch/ppc/kernel/traps.c > - * > * Copyright (C) 1995-1996 Gary Thomas (gdt at linuxppc.org) > * > * This program is free software; you can redistribute it and/or > diff -r 800442576617 arch/ppc/lib/rheap.c > --- a/arch/ppc/lib/rheap.c Sat Jan 14 05:24:55 2006 > +++ b/arch/ppc/lib/rheap.c Sat Jan 14 23:40:17 2006 > @@ -1,6 +1,4 @@ > /* > - * arch/ppc/syslib/rheap.c > - * > * A Remote Heap. Remote means that we don't touch the memory > that the > * heap points to. Normal heap implementations use the memory they > manage > * to place their list. We cannot do that because the memory we > manage may > diff -r 800442576617 arch/ppc/math-emu/math.c > --- a/arch/ppc/math-emu/math.c Sat Jan 14 05:24:55 2006 > +++ b/arch/ppc/math-emu/math.c Sat Jan 14 23:40:17 2006 > @@ -1,6 +1,4 @@ > /* > - * arch/ppc/math-emu/math.c > - * > * Copyright (C) 1999 Eddie C. Dost (ecd at atecom.com) > */ > > diff -r 800442576617 arch/ppc/mm/fault.c > --- a/arch/ppc/mm/fault.c Sat Jan 14 05:24:55 2006 > +++ b/arch/ppc/mm/fault.c Sat Jan 14 23:40:17 2006 > @@ -1,6 +1,4 @@ > /* > - * arch/ppc/mm/fault.c > - * > * PowerPC version > * Copyright (C) 1995-1996 Gary Thomas (gdt at linuxppc.org) > * > diff -r 800442576617 arch/ppc/mm/hashtable.S > --- a/arch/ppc/mm/hashtable.S Sat Jan 14 05:24:55 2006 > +++ b/arch/ppc/mm/hashtable.S Sat Jan 14 23:40:17 2006 > @@ -1,6 +1,4 @@ > /* > - * arch/ppc/kernel/hashtable.S > - * > * $Id: hashtable.S,v 1.6 1999/10/08 01:56:15 paulus Exp $ > * > * PowerPC version > diff -r 800442576617 arch/ppc/platforms/4xx/bamboo.c > --- a/arch/ppc/platforms/4xx/bamboo.c Sat Jan 14 05:24:55 2006 > +++ b/arch/ppc/platforms/4xx/bamboo.c Sat Jan 14 23:40:17 2006 > @@ -1,6 +1,4 @@ > /* > - * arch/ppc/platforms/4xx/bamboo.c > - * > * Bamboo board specific routines > * > * Wade Farnsworth > diff -r 800442576617 arch/ppc/platforms/4xx/bamboo.h > --- a/arch/ppc/platforms/4xx/bamboo.h Sat Jan 14 05:24:55 2006 > +++ b/arch/ppc/platforms/4xx/bamboo.h Sat Jan 14 23:40:17 2006 > @@ -1,6 +1,4 @@ > /* > - * arch/ppc/platforms/bamboo.h > - * > * Bamboo board definitions > * > * Wade Farnsworth > diff -r 800442576617 arch/ppc/platforms/4xx/bubinga.h > --- a/arch/ppc/platforms/4xx/bubinga.h Sat Jan 14 05:24:55 2006 > +++ b/arch/ppc/platforms/4xx/bubinga.h Sat Jan 14 23:40:17 2006 > @@ -1,6 +1,4 @@ > /* > - * arch/ppc/platforms/4xx/bubinga.h > - * > * Bubinga board definitions > * > * Copyright (c) 2005 DENX Software Engineering > diff -r 800442576617 arch/ppc/platforms/4xx/cpci405.c > --- a/arch/ppc/platforms/4xx/cpci405.c Sat Jan 14 05:24:55 2006 > +++ b/arch/ppc/platforms/4xx/cpci405.c Sat Jan 14 23:40:17 2006 > @@ -1,6 +1,4 @@ > /* > - * arch/ppc/platforms/cpci405.c > - * > * Board setup routines for the esd CPCI-405 cPCI Board. > * > * Author: Stefan Roese > diff -r 800442576617 arch/ppc/platforms/4xx/ebony.c > --- a/arch/ppc/platforms/4xx/ebony.c Sat Jan 14 05:24:55 2006 > +++ b/arch/ppc/platforms/4xx/ebony.c Sat Jan 14 23:40:17 2006 > @@ -1,6 +1,4 @@ > /* > - * arch/ppc/platforms/4xx/ebony.c > - * > * Ebony board specific routines > * > * Matt Porter > diff -r 800442576617 arch/ppc/platforms/4xx/ebony.h > --- a/arch/ppc/platforms/4xx/ebony.h Sat Jan 14 05:24:55 2006 > +++ b/arch/ppc/platforms/4xx/ebony.h Sat Jan 14 23:40:17 2006 > @@ -1,6 +1,4 @@ > /* > - * arch/ppc/platforms/ebony.h > - * > * Ebony board definitions > * > * Matt Porter > diff -r 800442576617 arch/ppc/platforms/4xx/ep405.c > --- a/arch/ppc/platforms/4xx/ep405.c Sat Jan 14 05:24:55 2006 > +++ b/arch/ppc/platforms/4xx/ep405.c Sat Jan 14 23:40:17 2006 > @@ -1,6 +1,4 @@ > /* > - * arch/ppc/platforms/4xx/ep405.c > - * > * Embedded Planet 405GP board > * http://www.embeddedplanet.com > * > diff -r 800442576617 arch/ppc/platforms/4xx/ep405.h > --- a/arch/ppc/platforms/4xx/ep405.h Sat Jan 14 05:24:55 2006 > +++ b/arch/ppc/platforms/4xx/ep405.h Sat Jan 14 23:40:17 2006 > @@ -1,6 +1,4 @@ > /* > - * arch/ppc/platforms/4xx/ep405.h > - * > * Embedded Planet 405GP board > * http://www.embeddedplanet.com > * > diff -r 800442576617 arch/ppc/platforms/4xx/ibm405ep.c > --- a/arch/ppc/platforms/4xx/ibm405ep.c Sat Jan 14 05:24:55 2006 > +++ b/arch/ppc/platforms/4xx/ibm405ep.c Sat Jan 14 23:40:17 2006 > @@ -1,6 +1,4 @@ > /* > - * arch/ppc/platforms/ibm405ep.c > - * > * Support for IBM PPC 405EP processors. > * > * Author: SAW (IBM), derived from ibmnp405l.c. > diff -r 800442576617 arch/ppc/platforms/4xx/ibm405ep.h > --- a/arch/ppc/platforms/4xx/ibm405ep.h Sat Jan 14 05:24:55 2006 > +++ b/arch/ppc/platforms/4xx/ibm405ep.h Sat Jan 14 23:40:17 2006 > @@ -1,6 +1,4 @@ > /* > - * arch/ppc/platforms/4xx/ibm405ep.h > - * > * IBM PPC 405EP processor defines. > * > * Author: SAW (IBM), derived from ibm405gp.h. > diff -r 800442576617 arch/ppc/platforms/4xx/ibm405gp.h > --- a/arch/ppc/platforms/4xx/ibm405gp.h Sat Jan 14 05:24:55 2006 > +++ b/arch/ppc/platforms/4xx/ibm405gp.h Sat Jan 14 23:40:17 2006 > @@ -1,6 +1,4 @@ > /* > - * arch/ppc/platforms/4xx/ibm405gp.h > - * > * Author: Armin Kuster akuster at mvista.com > * > * 2001 (c) MontaVista, Software, Inc. This file is licensed under > diff -r 800442576617 arch/ppc/platforms/4xx/ibm405gpr.c > --- a/arch/ppc/platforms/4xx/ibm405gpr.c Sat Jan 14 05:24:55 2006 > +++ b/arch/ppc/platforms/4xx/ibm405gpr.c Sat Jan 14 23:40:17 2006 > @@ -1,6 +1,4 @@ > /* > - * arch/ppc/platforms/4xx/ibm405gpr.c > - * > * Author: Armin Kuster > * > * 2002 (c) MontaVista, Software, Inc. This file is licensed under > diff -r 800442576617 arch/ppc/platforms/4xx/ibm405gpr.h > --- a/arch/ppc/platforms/4xx/ibm405gpr.h Sat Jan 14 05:24:55 2006 > +++ b/arch/ppc/platforms/4xx/ibm405gpr.h Sat Jan 14 23:40:17 2006 > @@ -1,6 +1,4 @@ > /* > - * arch/ppc/platforms/4xx/ibm405gpr.h > - * > * Author: Armin Kuster > * > * 2002 (c) MontaVista, Software, Inc. This file is licensed under > diff -r 800442576617 arch/ppc/platforms/4xx/ibm440ep.c > --- a/arch/ppc/platforms/4xx/ibm440ep.c Sat Jan 14 05:24:55 2006 > +++ b/arch/ppc/platforms/4xx/ibm440ep.c Sat Jan 14 23:40:17 2006 > @@ -1,6 +1,4 @@ > /* > - * arch/ppc/platforms/4xx/ibm440ep.c > - * > * PPC440EP I/O descriptions > * > * Wade Farnsworth > diff -r 800442576617 arch/ppc/platforms/4xx/ibm440ep.h > --- a/arch/ppc/platforms/4xx/ibm440ep.h Sat Jan 14 05:24:55 2006 > +++ b/arch/ppc/platforms/4xx/ibm440ep.h Sat Jan 14 23:40:17 2006 > @@ -1,6 +1,4 @@ > /* > - * arch/ppc/platforms/4xx/ibm440ep.h > - * > * PPC440EP definitions > * > * Wade Farnsworth > diff -r 800442576617 arch/ppc/platforms/4xx/ibm440gp.c > --- a/arch/ppc/platforms/4xx/ibm440gp.c Sat Jan 14 05:24:55 2006 > +++ b/arch/ppc/platforms/4xx/ibm440gp.c Sat Jan 14 23:40:17 2006 > @@ -1,6 +1,4 @@ > /* > - * arch/ppc/platforms/4xx/ibm440gp.c > - * > * PPC440GP I/O descriptions > * > * Matt Porter > diff -r 800442576617 arch/ppc/platforms/4xx/ibm440gp.h > --- a/arch/ppc/platforms/4xx/ibm440gp.h Sat Jan 14 05:24:55 2006 > +++ b/arch/ppc/platforms/4xx/ibm440gp.h Sat Jan 14 23:40:17 2006 > @@ -1,6 +1,4 @@ > /* > - * arch/ppc/platforms/4xx/ibm440gp.h > - * > * PPC440GP definitions > * > * Roland Dreier > diff -r 800442576617 arch/ppc/platforms/4xx/ibm440gx.c > --- a/arch/ppc/platforms/4xx/ibm440gx.c Sat Jan 14 05:24:55 2006 > +++ b/arch/ppc/platforms/4xx/ibm440gx.c Sat Jan 14 23:40:17 2006 > @@ -1,6 +1,4 @@ > /* > - * arch/ppc/platforms/4xx/ibm440gx.c > - * > * PPC440GX I/O descriptions > * > * Matt Porter > diff -r 800442576617 arch/ppc/platforms/4xx/ibm440gx.h > --- a/arch/ppc/platforms/4xx/ibm440gx.h Sat Jan 14 05:24:55 2006 > +++ b/arch/ppc/platforms/4xx/ibm440gx.h Sat Jan 14 23:40:17 2006 > @@ -1,6 +1,4 @@ > /* > - * arch/ppc/platforms/ibm440gx.h > - * > * PPC440GX definitions > * > * Matt Porter > diff -r 800442576617 arch/ppc/platforms/4xx/ibm440sp.c > --- a/arch/ppc/platforms/4xx/ibm440sp.c Sat Jan 14 05:24:55 2006 > +++ b/arch/ppc/platforms/4xx/ibm440sp.c Sat Jan 14 23:40:17 2006 > @@ -1,6 +1,4 @@ > /* > - * arch/ppc/platforms/4xx/ibm440sp.c > - * > * PPC440SP I/O descriptions > * > * Matt Porter > diff -r 800442576617 arch/ppc/platforms/4xx/ibm440sp.h > --- a/arch/ppc/platforms/4xx/ibm440sp.h Sat Jan 14 05:24:55 2006 > +++ b/arch/ppc/platforms/4xx/ibm440sp.h Sat Jan 14 23:40:17 2006 > @@ -1,6 +1,4 @@ > /* > - * arch/ppc/platforms/4xx/ibm440sp.h > - * > * PPC440SP definitions > * > * Matt Porter > diff -r 800442576617 arch/ppc/platforms/4xx/ibmnp405h.c > --- a/arch/ppc/platforms/4xx/ibmnp405h.c Sat Jan 14 05:24:55 2006 > +++ b/arch/ppc/platforms/4xx/ibmnp405h.c Sat Jan 14 23:40:17 2006 > @@ -1,6 +1,4 @@ > /* > - * arch/ppc/platforms/4xx/ibmnp405h.c > - * > * Author: Armin Kuster > * > * 2000-2002 (c) MontaVista, Software, Inc. This file is licensed > under > diff -r 800442576617 arch/ppc/platforms/4xx/ibmnp405h.h > --- a/arch/ppc/platforms/4xx/ibmnp405h.h Sat Jan 14 05:24:55 2006 > +++ b/arch/ppc/platforms/4xx/ibmnp405h.h Sat Jan 14 23:40:17 2006 > @@ -1,6 +1,4 @@ > /* > - * arch/ppc/platforms/4xx/ibmnp405h.h > - * > * Author: Armin Kuster > * > * 2002 (c) MontaVista, Software, Inc. This file is licensed under > diff -r 800442576617 arch/ppc/platforms/4xx/ibmstb4.c > --- a/arch/ppc/platforms/4xx/ibmstb4.c Sat Jan 14 05:24:55 2006 > +++ b/arch/ppc/platforms/4xx/ibmstb4.c Sat Jan 14 23:40:17 2006 > @@ -1,6 +1,4 @@ > /* > - * arch/ppc/platforms/4xx/ibmstb4.c > - * > * Author: Armin Kuster > * > * 2000-2001 (c) MontaVista, Software, Inc. This file is licensed > under > diff -r 800442576617 arch/ppc/platforms/4xx/ibmstb4.h > --- a/arch/ppc/platforms/4xx/ibmstb4.h Sat Jan 14 05:24:55 2006 > +++ b/arch/ppc/platforms/4xx/ibmstb4.h Sat Jan 14 23:40:17 2006 > @@ -1,6 +1,4 @@ > /* > - * arch/ppc/platforms/4xx/ibmstb4.h > - * > * Author: Armin Kuster > * > * 2001 (c) MontaVista, Software, Inc. This file is licensed under > diff -r 800442576617 arch/ppc/platforms/4xx/ibmstbx25.c > --- a/arch/ppc/platforms/4xx/ibmstbx25.c Sat Jan 14 05:24:55 2006 > +++ b/arch/ppc/platforms/4xx/ibmstbx25.c Sat Jan 14 23:40:17 2006 > @@ -1,6 +1,4 @@ > /* > - * arch/ppc/platforms/4xx/ibmstbx25.c > - * > * Author: Armin Kuster > * > * 2000-2002 (c) MontaVista, Software, Inc. This file is licensed > under > diff -r 800442576617 arch/ppc/platforms/4xx/ibmstbx25.h > --- a/arch/ppc/platforms/4xx/ibmstbx25.h Sat Jan 14 05:24:55 2006 > +++ b/arch/ppc/platforms/4xx/ibmstbx25.h Sat Jan 14 23:40:17 2006 > @@ -1,6 +1,4 @@ > /* > - * arch/ppc/platforms/4xx/ibmstbx25.h > - * > * Author: Armin Kuster > * > * 2002 (c) MontaVista, Software, Inc. This file is licensed under > diff -r 800442576617 arch/ppc/platforms/4xx/luan.c > --- a/arch/ppc/platforms/4xx/luan.c Sat Jan 14 05:24:55 2006 > +++ b/arch/ppc/platforms/4xx/luan.c Sat Jan 14 23:40:17 2006 > @@ -1,6 +1,4 @@ > /* > - * arch/ppc/platforms/4xx/luan.c > - * > * Luan board specific routines > * > * Matt Porter > diff -r 800442576617 arch/ppc/platforms/4xx/luan.h > --- a/arch/ppc/platforms/4xx/luan.h Sat Jan 14 05:24:55 2006 > +++ b/arch/ppc/platforms/4xx/luan.h Sat Jan 14 23:40:17 2006 > @@ -1,6 +1,4 @@ > /* > - * arch/ppc/platforms/4xx/luan.h > - * > * Luan board definitions > * > * Matt Porter > diff -r 800442576617 arch/ppc/platforms/4xx/ocotea.c > --- a/arch/ppc/platforms/4xx/ocotea.c Sat Jan 14 05:24:55 2006 > +++ b/arch/ppc/platforms/4xx/ocotea.c Sat Jan 14 23:40:17 2006 > @@ -1,6 +1,4 @@ > /* > - * arch/ppc/platforms/4xx/ocotea.c > - * > * Ocotea board specific routines > * > * Matt Porter > diff -r 800442576617 arch/ppc/platforms/4xx/ocotea.h > --- a/arch/ppc/platforms/4xx/ocotea.h Sat Jan 14 05:24:55 2006 > +++ b/arch/ppc/platforms/4xx/ocotea.h Sat Jan 14 23:40:17 2006 > @@ -1,6 +1,4 @@ > /* > - * arch/ppc/platforms/ocotea.h > - * > * Ocotea board definitions > * > * Matt Porter > diff -r 800442576617 arch/ppc/platforms/4xx/ppc440spe.c > --- a/arch/ppc/platforms/4xx/ppc440spe.c Sat Jan 14 05:24:55 2006 > +++ b/arch/ppc/platforms/4xx/ppc440spe.c Sat Jan 14 23:40:17 2006 > @@ -1,6 +1,4 @@ > /* > - * arch/ppc/platforms/4xx/ppc440spe.c > - * > * PPC440SPe I/O descriptions > * > * Roland Dreier > diff -r 800442576617 arch/ppc/platforms/4xx/ppc440spe.h > --- a/arch/ppc/platforms/4xx/ppc440spe.h Sat Jan 14 05:24:55 2006 > +++ b/arch/ppc/platforms/4xx/ppc440spe.h Sat Jan 14 23:40:17 2006 > @@ -1,6 +1,4 @@ > /* > - * arch/ppc/platforms/4xx/ibm440spe.h > - * > * PPC440SPe definitions > * > * Roland Dreier > diff -r 800442576617 arch/ppc/platforms/4xx/redwood5.c > --- a/arch/ppc/platforms/4xx/redwood5.c Sat Jan 14 05:24:55 2006 > +++ b/arch/ppc/platforms/4xx/redwood5.c Sat Jan 14 23:40:17 2006 > @@ -1,6 +1,4 @@ > /* > - * arch/ppc/platforms/4xx/redwood5.c > - * > * Support for the IBM redwood5 eval board file > * > * Author: Armin Kuster > diff -r 800442576617 arch/ppc/platforms/4xx/redwood5.h > --- a/arch/ppc/platforms/4xx/redwood5.h Sat Jan 14 05:24:55 2006 > +++ b/arch/ppc/platforms/4xx/redwood5.h Sat Jan 14 23:40:17 2006 > @@ -1,6 +1,4 @@ > /* > - * arch/ppc/platforms/4xx/redwood5.h > - * > * Macros, definitions, and data structures specific to the IBM > PowerPC > * STB03xxx "Redwood" evaluation board. > * > diff -r 800442576617 arch/ppc/platforms/4xx/redwood6.c > --- a/arch/ppc/platforms/4xx/redwood6.c Sat Jan 14 05:24:55 2006 > +++ b/arch/ppc/platforms/4xx/redwood6.c Sat Jan 14 23:40:17 2006 > @@ -1,6 +1,4 @@ > /* > - * arch/ppc/platforms/4xx/redwood6.c > - * > * Author: Armin Kuster > * > * 2002 (c) MontaVista, Software, Inc. This file is licensed under > diff -r 800442576617 arch/ppc/platforms/4xx/redwood6.h > --- a/arch/ppc/platforms/4xx/redwood6.h Sat Jan 14 05:24:55 2006 > +++ b/arch/ppc/platforms/4xx/redwood6.h Sat Jan 14 23:40:17 2006 > @@ -1,6 +1,4 @@ > /* > - * arch/ppc/platforms/4xx/redwood6.h > - * > * Macros, definitions, and data structures specific to the IBM > PowerPC > * STBx25xx "Redwood6" evaluation board. > * > diff -r 800442576617 arch/ppc/platforms/4xx/sycamore.c > --- a/arch/ppc/platforms/4xx/sycamore.c Sat Jan 14 05:24:55 2006 > +++ b/arch/ppc/platforms/4xx/sycamore.c Sat Jan 14 23:40:17 2006 > @@ -1,6 +1,4 @@ > /* > - * arch/ppc/platforms/4xx/sycamore.c > - * > * Architecture- / platform-specific boot-time initialization code > for > * IBM PowerPC 4xx based boards. > * > diff -r 800442576617 arch/ppc/platforms/4xx/sycamore.h > --- a/arch/ppc/platforms/4xx/sycamore.h Sat Jan 14 05:24:55 2006 > +++ b/arch/ppc/platforms/4xx/sycamore.h Sat Jan 14 23:40:17 2006 > @@ -1,6 +1,4 @@ > /* > - * arch/ppc/platforms/4xx/sycamore.h > - * > * Sycamore board definitions > * > * Copyright (c) 2005 DENX Software Engineering > diff -r 800442576617 arch/ppc/platforms/4xx/virtex-ii_pro.c > --- a/arch/ppc/platforms/4xx/virtex-ii_pro.c Sat Jan 14 05:24:55 2006 > +++ b/arch/ppc/platforms/4xx/virtex-ii_pro.c Sat Jan 14 23:40:17 2006 > @@ -1,6 +1,4 @@ > /* > - * arch/ppc/platforms/4xx/virtex-ii_pro.c > - * > * Author: MontaVista Software, Inc. > * source at mvista.com > * > diff -r 800442576617 arch/ppc/platforms/4xx/virtex-ii_pro.h > --- a/arch/ppc/platforms/4xx/virtex-ii_pro.h Sat Jan 14 05:24:55 2006 > +++ b/arch/ppc/platforms/4xx/virtex-ii_pro.h Sat Jan 14 23:40:17 2006 > @@ -1,6 +1,4 @@ > /* > - * arch/ppc/platforms/4xx/virtex-ii_pro.h > - * > * Include file that defines the Xilinx Virtex-II Pro processor > * > * Author: MontaVista Software, Inc. > diff -r 800442576617 arch/ppc/platforms/4xx/walnut.c > --- a/arch/ppc/platforms/4xx/walnut.c Sat Jan 14 05:24:55 2006 > +++ b/arch/ppc/platforms/4xx/walnut.c Sat Jan 14 23:40:17 2006 > @@ -1,6 +1,4 @@ > /* > - * arch/ppc/platforms/4xx/walnut.c > - * > * Architecture- / platform-specific boot-time initialization code > for > * IBM PowerPC 4xx based boards. Adapted from original > * code by Gary Thomas, Cort Dougan , and Dan Malek > diff -r 800442576617 arch/ppc/platforms/4xx/walnut.h > --- a/arch/ppc/platforms/4xx/walnut.h Sat Jan 14 05:24:55 2006 > +++ b/arch/ppc/platforms/4xx/walnut.h Sat Jan 14 23:40:17 2006 > @@ -1,6 +1,4 @@ > /* > - * arch/ppc/platforms/4xx/walnut.h > - * > * Walnut board definitions > * > * Copyright (c) 2005 DENX Software Engineering > diff -r 800442576617 arch/ppc/platforms/4xx/xilinx_ml300.c > --- a/arch/ppc/platforms/4xx/xilinx_ml300.c Sat Jan 14 05:24:55 2006 > +++ b/arch/ppc/platforms/4xx/xilinx_ml300.c Sat Jan 14 23:40:17 2006 > @@ -1,6 +1,4 @@ > /* > - * arch/ppc/platforms/4xx/xilinx_ml300.c > - * > * Xilinx ML300 evaluation board initialization > * > * Author: MontaVista Software, Inc. > diff -r 800442576617 arch/ppc/platforms/4xx/xilinx_ml300.h > --- a/arch/ppc/platforms/4xx/xilinx_ml300.h Sat Jan 14 05:24:55 2006 > +++ b/arch/ppc/platforms/4xx/xilinx_ml300.h Sat Jan 14 23:40:17 2006 > @@ -1,6 +1,4 @@ > /* > - * arch/ppc/platforms/4xx/xilinx_ml300.h > - * > * Include file that defines the Xilinx ML300 evaluation board > * > * Author: MontaVista Software, Inc. > diff -r 800442576617 arch/ppc/platforms/4xx/yucca.c > --- a/arch/ppc/platforms/4xx/yucca.c Sat Jan 14 05:24:55 2006 > +++ b/arch/ppc/platforms/4xx/yucca.c Sat Jan 14 23:40:17 2006 > @@ -1,6 +1,4 @@ > /* > - * arch/ppc/platforms/4xx/yucca.c > - * > * Yucca board specific routines > * > * Roland Dreier (based on luan.c by Matt Porter) > diff -r 800442576617 arch/ppc/platforms/4xx/yucca.h > --- a/arch/ppc/platforms/4xx/yucca.h Sat Jan 14 05:24:55 2006 > +++ b/arch/ppc/platforms/4xx/yucca.h Sat Jan 14 23:40:17 2006 > @@ -1,6 +1,4 @@ > /* > - * arch/ppc/platforms/4xx/yucca.h > - * > * Yucca board definitions > * > * Roland Dreier (based on luan.h by Matt Porter) > diff -r 800442576617 arch/ppc/platforms/83xx/mpc834x_sys.c > --- a/arch/ppc/platforms/83xx/mpc834x_sys.c Sat Jan 14 05:24:55 2006 > +++ b/arch/ppc/platforms/83xx/mpc834x_sys.c Sat Jan 14 23:40:17 2006 > @@ -1,6 +1,4 @@ > /* > - * arch/ppc/platforms/83xx/mpc834x_sys.c > - * > * MPC834x SYS board specific routines > * > * Maintainer: Kumar Gala > diff -r 800442576617 arch/ppc/platforms/83xx/mpc834x_sys.h > --- a/arch/ppc/platforms/83xx/mpc834x_sys.h Sat Jan 14 05:24:55 2006 > +++ b/arch/ppc/platforms/83xx/mpc834x_sys.h Sat Jan 14 23:40:17 2006 > @@ -1,6 +1,4 @@ > /* > - * arch/ppc/platforms/83xx/mpc834x_sys.h > - * > * MPC834X SYS common board definitions > * > * Maintainer: Kumar Gala > diff -r 800442576617 arch/ppc/platforms/85xx/mpc8540_ads.c > --- a/arch/ppc/platforms/85xx/mpc8540_ads.c Sat Jan 14 05:24:55 2006 > +++ b/arch/ppc/platforms/85xx/mpc8540_ads.c Sat Jan 14 23:40:17 2006 > @@ -1,6 +1,4 @@ > /* > - * arch/ppc/platforms/85xx/mpc8540_ads.c > - * > * MPC8540ADS board specific routines > * > * Maintainer: Kumar Gala > diff -r 800442576617 arch/ppc/platforms/85xx/mpc8540_ads.h > --- a/arch/ppc/platforms/85xx/mpc8540_ads.h Sat Jan 14 05:24:55 2006 > +++ b/arch/ppc/platforms/85xx/mpc8540_ads.h Sat Jan 14 23:40:17 2006 > @@ -1,6 +1,4 @@ > /* > - * arch/ppc/platforms/85xx/mpc8540_ads.h > - * > * MPC8540ADS board definitions > * > * Maintainer: Kumar Gala > diff -r 800442576617 arch/ppc/platforms/85xx/mpc8555_cds.h > --- a/arch/ppc/platforms/85xx/mpc8555_cds.h Sat Jan 14 05:24:55 2006 > +++ b/arch/ppc/platforms/85xx/mpc8555_cds.h Sat Jan 14 23:40:17 2006 > @@ -1,6 +1,4 @@ > /* > - * arch/ppc/platforms/mpc8555_cds.h > - * > * MPC8555CDS board definitions > * > * Maintainer: Kumar Gala > diff -r 800442576617 arch/ppc/platforms/85xx/mpc8560_ads.c > --- a/arch/ppc/platforms/85xx/mpc8560_ads.c Sat Jan 14 05:24:55 2006 > +++ b/arch/ppc/platforms/85xx/mpc8560_ads.c Sat Jan 14 23:40:17 2006 > @@ -1,6 +1,4 @@ > /* > - * arch/ppc/platforms/85xx/mpc8560_ads.c > - * > * MPC8560ADS board specific routines > * > * Maintainer: Kumar Gala > diff -r 800442576617 arch/ppc/platforms/85xx/mpc8560_ads.h > --- a/arch/ppc/platforms/85xx/mpc8560_ads.h Sat Jan 14 05:24:55 2006 > +++ b/arch/ppc/platforms/85xx/mpc8560_ads.h Sat Jan 14 23:40:17 2006 > @@ -1,6 +1,4 @@ > /* > - * arch/ppc/platforms/mpc8560_ads.h > - * > * MPC8540ADS board definitions > * > * Maintainer: Kumar Gala > diff -r 800442576617 arch/ppc/platforms/85xx/mpc85xx_ads_common.c > --- a/arch/ppc/platforms/85xx/mpc85xx_ads_common.c Sat Jan 14 > 05:24:55 2006 > +++ b/arch/ppc/platforms/85xx/mpc85xx_ads_common.c Sat Jan 14 > 23:40:17 2006 > @@ -1,6 +1,4 @@ > /* > - * arch/ppc/platforms/85xx/mpc85xx_ads_common.c > - * > * MPC85xx ADS board common routines > * > * Maintainer: Kumar Gala > diff -r 800442576617 arch/ppc/platforms/85xx/mpc85xx_ads_common.h > --- a/arch/ppc/platforms/85xx/mpc85xx_ads_common.h Sat Jan 14 > 05:24:55 2006 > +++ b/arch/ppc/platforms/85xx/mpc85xx_ads_common.h Sat Jan 14 > 23:40:17 2006 > @@ -1,6 +1,4 @@ > /* > - * arch/ppc/platforms/85xx/mpc85xx_ads_common.h > - * > * MPC85XX ADS common board definitions > * > * Maintainer: Kumar Gala > diff -r 800442576617 arch/ppc/platforms/85xx/mpc85xx_cds_common.c > --- a/arch/ppc/platforms/85xx/mpc85xx_cds_common.c Sat Jan 14 > 05:24:55 2006 > +++ b/arch/ppc/platforms/85xx/mpc85xx_cds_common.c Sat Jan 14 > 23:40:17 2006 > @@ -1,6 +1,4 @@ > /* > - * arch/ppc/platform/85xx/mpc85xx_cds_common.c > - * > * MPC85xx CDS board specific routines > * > * Maintainer: Kumar Gala > diff -r 800442576617 arch/ppc/platforms/85xx/mpc85xx_cds_common.h > --- a/arch/ppc/platforms/85xx/mpc85xx_cds_common.h Sat Jan 14 > 05:24:55 2006 > +++ b/arch/ppc/platforms/85xx/mpc85xx_cds_common.h Sat Jan 14 > 23:40:17 2006 > @@ -1,6 +1,4 @@ > /* > - * arch/ppc/platforms/85xx/mpc85xx_cds_common.h > - * > * MPC85xx CDS board definitions > * > * Maintainer: Kumar Gala > diff -r 800442576617 arch/ppc/platforms/85xx/sbc8560.c > --- a/arch/ppc/platforms/85xx/sbc8560.c Sat Jan 14 05:24:55 2006 > +++ b/arch/ppc/platforms/85xx/sbc8560.c Sat Jan 14 23:40:17 2006 > @@ -1,6 +1,4 @@ > /* > - * arch/ppc/platforms/85xx/sbc8560.c > - * > * Wind River SBC8560 board specific routines > * > * Maintainer: Kumar Gala > diff -r 800442576617 arch/ppc/platforms/85xx/sbc8560.h > --- a/arch/ppc/platforms/85xx/sbc8560.h Sat Jan 14 05:24:55 2006 > +++ b/arch/ppc/platforms/85xx/sbc8560.h Sat Jan 14 23:40:17 2006 > @@ -1,6 +1,4 @@ > /* > - * arch/ppc/platforms/85xx/sbc8560.h > - * > * Wind River SBC8560 board definitions > * > * Copyright 2003 Motorola Inc. > diff -r 800442576617 arch/ppc/platforms/85xx/sbc85xx.c > --- a/arch/ppc/platforms/85xx/sbc85xx.c Sat Jan 14 05:24:55 2006 > +++ b/arch/ppc/platforms/85xx/sbc85xx.c Sat Jan 14 23:40:17 2006 > @@ -1,6 +1,4 @@ > /* > - * arch/ppc/platform/85xx/sbc85xx.c > - * > * WindRiver PowerQUICC III SBC85xx board common routines > * > * Copyright 2002, 2003 Motorola Inc. > diff -r 800442576617 arch/ppc/platforms/85xx/sbc85xx.h > --- a/arch/ppc/platforms/85xx/sbc85xx.h Sat Jan 14 05:24:55 2006 > +++ b/arch/ppc/platforms/85xx/sbc85xx.h Sat Jan 14 23:40:17 2006 > @@ -1,6 +1,4 @@ > /* > - * arch/ppc/platforms/85xx/sbc85xx.h > - * > * WindRiver PowerQUICC III SBC85xx common board definitions > * > * Copyright 2003 Motorola Inc. > diff -r 800442576617 arch/ppc/platforms/85xx/stx_gp3.c > --- a/arch/ppc/platforms/85xx/stx_gp3.c Sat Jan 14 05:24:55 2006 > +++ b/arch/ppc/platforms/85xx/stx_gp3.c Sat Jan 14 23:40:17 2006 > @@ -1,6 +1,4 @@ > /* > - * arch/ppc/platforms/85xx/stx_gp3.c > - * > * STx GP3 board specific routines > * > * Dan Malek > diff -r 800442576617 arch/ppc/platforms/85xx/stx_gp3.h > --- a/arch/ppc/platforms/85xx/stx_gp3.h Sat Jan 14 05:24:55 2006 > +++ b/arch/ppc/platforms/85xx/stx_gp3.h Sat Jan 14 23:40:17 2006 > @@ -1,6 +1,4 @@ > /* > - * arch/ppc/platforms/stx8560_gp3.h > - * > * STx GP3 board definitions > * > * Dan Malek (dan at embeddededge.com) > diff -r 800442576617 arch/ppc/platforms/85xx/tqm85xx.c > --- a/arch/ppc/platforms/85xx/tqm85xx.c Sat Jan 14 05:24:55 2006 > +++ b/arch/ppc/platforms/85xx/tqm85xx.c Sat Jan 14 23:40:17 2006 > @@ -1,6 +1,4 @@ > /* > - * arch/ppc/platforms/85xx/tqm85xx.c > - * > * TQM85xx (40/41/55/60) board specific routines > * > * Copyright (c) 2005 DENX Software Engineering > diff -r 800442576617 arch/ppc/platforms/85xx/tqm85xx.h > --- a/arch/ppc/platforms/85xx/tqm85xx.h Sat Jan 14 05:24:55 2006 > +++ b/arch/ppc/platforms/85xx/tqm85xx.h Sat Jan 14 23:40:17 2006 > @@ -1,6 +1,4 @@ > /* > - * arch/ppc/platforms/85xx/tqm85xx.h > - * > * TQM85xx (40/41/55/60) board definitions > * > * Copyright (c) 2005 DENX Software Engineering > diff -r 800442576617 arch/ppc/platforms/apus_setup.c > --- a/arch/ppc/platforms/apus_setup.c Sat Jan 14 05:24:55 2006 > +++ b/arch/ppc/platforms/apus_setup.c Sat Jan 14 23:40:17 2006 > @@ -1,6 +1,4 @@ > /* > - * arch/ppc/platforms/apus_setup.c > - * > * Copyright (C) 1998, 1999 Jesper Skov > * > * Basically what is needed to replace functionality found in > diff -r 800442576617 arch/ppc/platforms/chestnut.c > --- a/arch/ppc/platforms/chestnut.c Sat Jan 14 05:24:55 2006 > +++ b/arch/ppc/platforms/chestnut.c Sat Jan 14 23:40:17 2006 > @@ -1,6 +1,4 @@ > /* > - * arch/ppc/platforms/chestnut.c > - * > * Board setup routines for IBM Chestnut > * > * Author: > diff -r 800442576617 arch/ppc/platforms/chestnut.h > --- a/arch/ppc/platforms/chestnut.h Sat Jan 14 05:24:55 2006 > +++ b/arch/ppc/platforms/chestnut.h Sat Jan 14 23:40:17 2006 > @@ -1,6 +1,4 @@ > /* > - * arch/ppc/platforms/chestnut.h > - * > * Definitions for IBM 750FXGX Eval (Chestnut) > * > * Author: > diff -r 800442576617 arch/ppc/platforms/chrp_pegasos_eth.c > --- a/arch/ppc/platforms/chrp_pegasos_eth.c Sat Jan 14 05:24:55 2006 > +++ b/arch/ppc/platforms/chrp_pegasos_eth.c Sat Jan 14 23:40:17 2006 > @@ -1,6 +1,4 @@ > /* > - * arch/ppc/platforms/chrp_pegasos_eth.c > - * > * Copyright (C) 2005 Sven Luther > * Thanks to : > * Dale Farnsworth > diff -r 800442576617 arch/ppc/platforms/chrp_setup.c > --- a/arch/ppc/platforms/chrp_setup.c Sat Jan 14 05:24:55 2006 > +++ b/arch/ppc/platforms/chrp_setup.c Sat Jan 14 23:40:17 2006 > @@ -1,6 +1,4 @@ > /* > - * arch/ppc/platforms/setup.c > - * > * Copyright (C) 1995 Linus Torvalds > * Adapted from 'alpha' version by Gary Thomas > * Modified by Cort Dougan (cort at cs.nmt.edu) > diff -r 800442576617 arch/ppc/platforms/chrp_time.c > --- a/arch/ppc/platforms/chrp_time.c Sat Jan 14 05:24:55 2006 > +++ b/arch/ppc/platforms/chrp_time.c Sat Jan 14 23:40:17 2006 > @@ -1,6 +1,4 @@ > /* > - * arch/ppc/platforms/chrp_time.c > - * > * Copyright (C) 1991, 1992, 1995 Linus Torvalds > * > * Adapted for PowerPC (PReP) by Gary Thomas > diff -r 800442576617 arch/ppc/platforms/cpci690.c > --- a/arch/ppc/platforms/cpci690.c Sat Jan 14 05:24:55 2006 > +++ b/arch/ppc/platforms/cpci690.c Sat Jan 14 23:40:17 2006 > @@ -1,6 +1,4 @@ > /* > - * arch/ppc/platforms/cpci690.c > - * > * Board setup routines for the Force CPCI690 board. > * > * Author: Mark A. Greer > diff -r 800442576617 arch/ppc/platforms/cpci690.h > --- a/arch/ppc/platforms/cpci690.h Sat Jan 14 05:24:55 2006 > +++ b/arch/ppc/platforms/cpci690.h Sat Jan 14 23:40:17 2006 > @@ -1,6 +1,4 @@ > /* > - * arch/ppc/platforms/cpci690.h > - * > * Definitions for Force CPCI690 > * > * Author: Mark A. Greer > diff -r 800442576617 arch/ppc/platforms/ev64260.c > --- a/arch/ppc/platforms/ev64260.c Sat Jan 14 05:24:55 2006 > +++ b/arch/ppc/platforms/ev64260.c Sat Jan 14 23:40:17 2006 > @@ -1,6 +1,4 @@ > /* > - * arch/ppc/platforms/ev64260.c > - * > * Board setup routines for the Marvell/Galileo EV-64260-BP > Evaluation Board. > * > * Author: Mark A. Greer > diff -r 800442576617 arch/ppc/platforms/ev64260.h > --- a/arch/ppc/platforms/ev64260.h Sat Jan 14 05:24:55 2006 > +++ b/arch/ppc/platforms/ev64260.h Sat Jan 14 23:40:17 2006 > @@ -1,6 +1,4 @@ > /* > - * arch/ppc/platforms/ev64260.h > - * > * Definitions for Marvell/Galileo EV-64260-BP Evaluation Board. > * > * Author: Mark A. Greer > diff -r 800442576617 arch/ppc/platforms/ev64360.c > --- a/arch/ppc/platforms/ev64360.c Sat Jan 14 05:24:55 2006 > +++ b/arch/ppc/platforms/ev64360.c Sat Jan 14 23:40:17 2006 > @@ -1,6 +1,4 @@ > /* > - * arch/ppc/platforms/ev64360.c > - * > * Board setup routines for the Marvell EV-64360-BP Evaluation Board. > * > * Author: Lee Nicks > diff -r 800442576617 arch/ppc/platforms/ev64360.h > --- a/arch/ppc/platforms/ev64360.h Sat Jan 14 05:24:55 2006 > +++ b/arch/ppc/platforms/ev64360.h Sat Jan 14 23:40:17 2006 > @@ -1,6 +1,4 @@ > /* > - * arch/ppc/platforms/ev64360.h > - * > * Definitions for Marvell EV-64360-BP Evaluation Board. > * > * Author: Lee Nicks > diff -r 800442576617 arch/ppc/platforms/gemini.h > --- a/arch/ppc/platforms/gemini.h Sat Jan 14 05:24:55 2006 > +++ b/arch/ppc/platforms/gemini.h Sat Jan 14 23:40:17 2006 > @@ -1,7 +1,4 @@ > /* > - * arch/ppc/platforms/gemini.h > - * > - * > * Onboard registers and descriptions for Synergy Microsystems' > * "Gemini" boards. > * > diff -r 800442576617 arch/ppc/platforms/gemini_prom.S > --- a/arch/ppc/platforms/gemini_prom.S Sat Jan 14 05:24:55 2006 > +++ b/arch/ppc/platforms/gemini_prom.S Sat Jan 14 23:40:17 2006 > @@ -1,6 +1,4 @@ > /* > - * arch/ppc/platforms/gemini_prom.S > - * > * Not really prom support code (yet), but sort of anti-prom > code. The current > * bootloader does a number of things it shouldn't and doesn't do > things that it > * should. The stuff in here is mainly a hodge-podge collection > of setup code > diff -r 800442576617 arch/ppc/platforms/gemini_setup.c > --- a/arch/ppc/platforms/gemini_setup.c Sat Jan 14 05:24:55 2006 > +++ b/arch/ppc/platforms/gemini_setup.c Sat Jan 14 23:40:17 2006 > @@ -1,6 +1,4 @@ > /* > - * arch/ppc/platforms/gemini_setup.c > - * > * Copyright (C) 1995 Linus Torvalds > * Adapted from 'alpha' version by Gary Thomas > * Modified by Cort Dougan (cort at cs.nmt.edu) > diff -r 800442576617 arch/ppc/platforms/hdpu.c > --- a/arch/ppc/platforms/hdpu.c Sat Jan 14 05:24:55 2006 > +++ b/arch/ppc/platforms/hdpu.c Sat Jan 14 23:40:17 2006 > @@ -1,7 +1,4 @@ > - > /* > - * arch/ppc/platforms/hdpu_setup.c > - * > * Board setup routines for the Sky Computers HDPU Compute Blade. > * > * Written by Brian Waite > diff -r 800442576617 arch/ppc/platforms/hdpu.h > --- a/arch/ppc/platforms/hdpu.h Sat Jan 14 05:24:55 2006 > +++ b/arch/ppc/platforms/hdpu.h Sat Jan 14 23:40:17 2006 > @@ -1,6 +1,4 @@ > /* > - * arch/ppc/platforms/hdpu.h > - * > * Definitions for Sky Computers HDPU board. > * > * Brian Waite > diff -r 800442576617 arch/ppc/platforms/katana.c > --- a/arch/ppc/platforms/katana.c Sat Jan 14 05:24:55 2006 > +++ b/arch/ppc/platforms/katana.c Sat Jan 14 23:40:17 2006 > @@ -1,6 +1,4 @@ > /* > - * arch/ppc/platforms/katana.c > - * > * Board setup routines for the Artesyn Katana cPCI boards. > * > * Author: Tim Montgomery > diff -r 800442576617 arch/ppc/platforms/katana.h > --- a/arch/ppc/platforms/katana.h Sat Jan 14 05:24:55 2006 > +++ b/arch/ppc/platforms/katana.h Sat Jan 14 23:40:17 2006 > @@ -1,6 +1,4 @@ > /* > - * arch/ppc/platforms/katana.h > - * > * Definitions for Artesyn Katana750i/3750 board. > * > * Author: Tim Montgomery > diff -r 800442576617 arch/ppc/platforms/lite5200.c > --- a/arch/ppc/platforms/lite5200.c Sat Jan 14 05:24:55 2006 > +++ b/arch/ppc/platforms/lite5200.c Sat Jan 14 23:40:17 2006 > @@ -1,6 +1,4 @@ > /* > - * arch/ppc/platforms/lite5200.c > - * > * Platform support file for the Freescale LITE5200 based on MPC52xx. > * A maximum of this file should be moved to syslib/mpc52xx_????? > * so that new platform based on MPC52xx need a minimal platform file > diff -r 800442576617 arch/ppc/platforms/lite5200.h > --- a/arch/ppc/platforms/lite5200.h Sat Jan 14 05:24:55 2006 > +++ b/arch/ppc/platforms/lite5200.h Sat Jan 14 23:40:17 2006 > @@ -1,6 +1,4 @@ > /* > - * arch/ppc/platforms/lite5200.h > - * > * Definitions for Freescale LITE5200 : MPC52xx Standard Development > * Platform board support > * > diff -r 800442576617 arch/ppc/platforms/lopec.c > --- a/arch/ppc/platforms/lopec.c Sat Jan 14 05:24:55 2006 > +++ b/arch/ppc/platforms/lopec.c Sat Jan 14 23:40:17 2006 > @@ -1,6 +1,4 @@ > /* > - * arch/ppc/platforms/lopec.c > - * > * Setup routines for the Motorola LoPEC. > * > * Author: Dan Cox > diff -r 800442576617 arch/ppc/platforms/mvme5100.c > --- a/arch/ppc/platforms/mvme5100.c Sat Jan 14 05:24:55 2006 > +++ b/arch/ppc/platforms/mvme5100.c Sat Jan 14 23:40:17 2006 > @@ -1,6 +1,4 @@ > /* > - * arch/ppc/platforms/mvme5100.c > - * > * Board setup routines for the Motorola MVME5100. > * > * Author: Matt Porter > diff -r 800442576617 arch/ppc/platforms/pal4.h > --- a/arch/ppc/platforms/pal4.h Sat Jan 14 05:24:55 2006 > +++ b/arch/ppc/platforms/pal4.h Sat Jan 14 23:40:17 2006 > @@ -1,6 +1,4 @@ > /* > - * arch/ppc/platforms/pal4.h > - * > * Definitions for SBS Palomar IV board > * > * Author: Dan Cox > diff -r 800442576617 arch/ppc/platforms/pal4_pci.c > --- a/arch/ppc/platforms/pal4_pci.c Sat Jan 14 05:24:55 2006 > +++ b/arch/ppc/platforms/pal4_pci.c Sat Jan 14 23:40:17 2006 > @@ -1,6 +1,4 @@ > /* > - * arch/ppc/platforms/pal4_pci.c > - * > * PCI support for SBS Palomar IV > * > * Author: Dan Cox > diff -r 800442576617 arch/ppc/platforms/pal4_serial.h > --- a/arch/ppc/platforms/pal4_serial.h Sat Jan 14 05:24:55 2006 > +++ b/arch/ppc/platforms/pal4_serial.h Sat Jan 14 23:40:17 2006 > @@ -1,6 +1,4 @@ > /* > - * arch/ppc/platforms/pal4_serial.h > - * > * Definitions for SBS PalomarIV serial support > * > * Author: Dan Cox > diff -r 800442576617 arch/ppc/platforms/pal4_setup.c > --- a/arch/ppc/platforms/pal4_setup.c Sat Jan 14 05:24:55 2006 > +++ b/arch/ppc/platforms/pal4_setup.c Sat Jan 14 23:40:17 2006 > @@ -1,6 +1,4 @@ > /* > - * arch/ppc/platforms/pal4_setup.c > - * > * Board setup routines for the SBS PalomarIV. > * > * Author: Dan Cox > diff -r 800442576617 arch/ppc/platforms/pmac_cpufreq.c > --- a/arch/ppc/platforms/pmac_cpufreq.c Sat Jan 14 05:24:55 2006 > +++ b/arch/ppc/platforms/pmac_cpufreq.c Sat Jan 14 23:40:17 2006 > @@ -1,6 +1,4 @@ > /* > - * arch/ppc/platforms/pmac_cpufreq.c > - * > * Copyright (C) 2002 - 2005 Benjamin Herrenschmidt > > * Copyright (C) 2004 John Steele Scott > * > diff -r 800442576617 arch/ppc/platforms/pmac_feature.c > --- a/arch/ppc/platforms/pmac_feature.c Sat Jan 14 05:24:55 2006 > +++ b/arch/ppc/platforms/pmac_feature.c Sat Jan 14 23:40:17 2006 > @@ -1,6 +1,4 @@ > /* > - * arch/ppc/platforms/pmac_feature.c > - * > * Copyright (C) 1996-2001 Paul Mackerras (paulus at cs.anu.edu.au) > * Ben. Herrenschmidt > (benh at kernel.crashing.org) > * > diff -r 800442576617 arch/ppc/platforms/pmac_low_i2c.c > --- a/arch/ppc/platforms/pmac_low_i2c.c Sat Jan 14 05:24:55 2006 > +++ b/arch/ppc/platforms/pmac_low_i2c.c Sat Jan 14 23:40:17 2006 > @@ -1,6 +1,4 @@ > /* > - * arch/ppc/platforms/pmac_low_i2c.c > - * > * Copyright (C) 2003 Ben. Herrenschmidt (benh at kernel.crashing.org) > * > * This program is free software; you can redistribute it and/or > diff -r 800442576617 arch/ppc/platforms/pmac_nvram.c > --- a/arch/ppc/platforms/pmac_nvram.c Sat Jan 14 05:24:55 2006 > +++ b/arch/ppc/platforms/pmac_nvram.c Sat Jan 14 23:40:17 2006 > @@ -1,6 +1,4 @@ > /* > - * arch/ppc/platforms/pmac_nvram.c > - * > * Copyright (C) 2002 Benjamin Herrenschmidt > (benh at kernel.crashing.org) > * > * This program is free software; you can redistribute it and/or > diff -r 800442576617 arch/ppc/platforms/pmac_setup.c > --- a/arch/ppc/platforms/pmac_setup.c Sat Jan 14 05:24:55 2006 > +++ b/arch/ppc/platforms/pmac_setup.c Sat Jan 14 23:40:17 2006 > @@ -1,6 +1,4 @@ > /* > - * arch/ppc/platforms/setup.c > - * > * PowerPC version > * Copyright (C) 1995-1996 Gary Thomas (gdt at linuxppc.org) > * > diff -r 800442576617 arch/ppc/platforms/powerpmc250.c > --- a/arch/ppc/platforms/powerpmc250.c Sat Jan 14 05:24:55 2006 > +++ b/arch/ppc/platforms/powerpmc250.c Sat Jan 14 23:40:17 2006 > @@ -1,6 +1,4 @@ > /* > - * arch/ppc/platforms/powerpmc250.c > - * > * Board setup routines for Force PowerPMC-250 Processor PMC > * > * Author: Troy Benjegerdes > diff -r 800442576617 arch/ppc/platforms/pplus.c > --- a/arch/ppc/platforms/pplus.c Sat Jan 14 05:24:55 2006 > +++ b/arch/ppc/platforms/pplus.c Sat Jan 14 23:40:17 2006 > @@ -1,6 +1,4 @@ > /* > - * arch/ppc/platforms/pplus.c > - * > * Board and PCI setup routines for MCG PowerPlus > * > * Author: Randy Vinson > diff -r 800442576617 arch/ppc/platforms/pplus.h > --- a/arch/ppc/platforms/pplus.h Sat Jan 14 05:24:55 2006 > +++ b/arch/ppc/platforms/pplus.h Sat Jan 14 23:40:17 2006 > @@ -1,6 +1,4 @@ > /* > - * arch/ppc/platforms/pplus.h > - * > * Definitions for Motorola MCG Falcon/Raven & HAWK North Bridge & > Memory ctlr. > * > * Author: Mark A. Greerinclude/asm-ppc/hawk.h > diff -r 800442576617 arch/ppc/platforms/pq2ads.c > --- a/arch/ppc/platforms/pq2ads.c Sat Jan 14 05:24:55 2006 > +++ b/arch/ppc/platforms/pq2ads.c Sat Jan 14 23:40:17 2006 > @@ -1,6 +1,4 @@ > /* > - * arch/ppc/platforms/pq2ads.c > - * > * PQ2ADS platform support > * > * Author: Kumar Gala > diff -r 800442576617 arch/ppc/platforms/prep_setup.c > --- a/arch/ppc/platforms/prep_setup.c Sat Jan 14 05:24:55 2006 > +++ b/arch/ppc/platforms/prep_setup.c Sat Jan 14 23:40:17 2006 > @@ -1,6 +1,4 @@ > /* > - * arch/ppc/platforms/setup.c > - * > * Copyright (C) 1995 Linus Torvalds > * Adapted from 'alpha' version by Gary Thomas > * Modified by Cort Dougan (cort at cs.nmt.edu) > diff -r 800442576617 arch/ppc/platforms/prpmc750.c > --- a/arch/ppc/platforms/prpmc750.c Sat Jan 14 05:24:55 2006 > +++ b/arch/ppc/platforms/prpmc750.c Sat Jan 14 23:40:17 2006 > @@ -1,6 +1,4 @@ > /* > - * arch/ppc/platforms/prpmc750_setup.c > - * > * Board setup routines for Motorola PrPMC750 > * > * Author: Matt Porter > diff -r 800442576617 arch/ppc/platforms/prpmc800.c > --- a/arch/ppc/platforms/prpmc800.c Sat Jan 14 05:24:55 2006 > +++ b/arch/ppc/platforms/prpmc800.c Sat Jan 14 23:40:17 2006 > @@ -1,6 +1,4 @@ > /* > - * arch/ppc/platforms/prpmc800.c > - * > * Author: Dale Farnsworth > * > * 2001-2004 (c) MontaVista, Software, Inc. This file is licensed > under > diff -r 800442576617 arch/ppc/platforms/radstone_ppc7d.c > --- a/arch/ppc/platforms/radstone_ppc7d.c Sat Jan 14 05:24:55 2006 > +++ b/arch/ppc/platforms/radstone_ppc7d.c Sat Jan 14 23:40:17 2006 > @@ -1,6 +1,4 @@ > /* > - * arch/ppc/platforms/radstone_ppc7d.c > - * > * Board setup routines for the Radstone PPC7D boards. > * > * Author: James Chapman > diff -r 800442576617 arch/ppc/platforms/radstone_ppc7d.h > --- a/arch/ppc/platforms/radstone_ppc7d.h Sat Jan 14 05:24:55 2006 > +++ b/arch/ppc/platforms/radstone_ppc7d.h Sat Jan 14 23:40:17 2006 > @@ -1,6 +1,4 @@ > /* > - * arch/ppc/platforms/radstone_ppc7d.h > - * > * Board definitions for the Radstone PPC7D boards. > * > * Author: James Chapman > diff -r 800442576617 arch/ppc/platforms/sandpoint.c > --- a/arch/ppc/platforms/sandpoint.c Sat Jan 14 05:24:55 2006 > +++ b/arch/ppc/platforms/sandpoint.c Sat Jan 14 23:40:17 2006 > @@ -1,6 +1,4 @@ > /* > - * arch/ppc/platforms/sandpoint_setup.c > - * > * Board setup routines for the Motorola SPS Sandpoint Test Platform. > * > * Author: Mark A. Greer > diff -r 800442576617 arch/ppc/platforms/sandpoint.h > --- a/arch/ppc/platforms/sandpoint.h Sat Jan 14 05:24:55 2006 > +++ b/arch/ppc/platforms/sandpoint.h Sat Jan 14 23:40:17 2006 > @@ -1,6 +1,4 @@ > /* > - * arch/ppc/platforms/sandpoint.h > - * > * Definitions for Motorola SPS Sandpoint Test Platform > * > * Author: Mark A. Greer > diff -r 800442576617 arch/ppc/platforms/sbc82xx.c > --- a/arch/ppc/platforms/sbc82xx.c Sat Jan 14 05:24:55 2006 > +++ b/arch/ppc/platforms/sbc82xx.c Sat Jan 14 23:40:17 2006 > @@ -1,6 +1,4 @@ > /* > - * arch/ppc/platforms/sbc82xx.c > - * > * SBC82XX platform support > * > * Author: Guy Streeter > diff -r 800442576617 arch/ppc/platforms/spruce.c > --- a/arch/ppc/platforms/spruce.c Sat Jan 14 05:24:55 2006 > +++ b/arch/ppc/platforms/spruce.c Sat Jan 14 23:40:17 2006 > @@ -1,6 +1,4 @@ > /* > - * arch/ppc/platforms/spruce.c > - * > * Board and PCI setup routines for IBM Spruce > * > * Author: MontaVista Software > diff -r 800442576617 arch/ppc/platforms/tqm8260_setup.c > --- a/arch/ppc/platforms/tqm8260_setup.c Sat Jan 14 05:24:55 2006 > +++ b/arch/ppc/platforms/tqm8260_setup.c Sat Jan 14 23:40:17 2006 > @@ -1,6 +1,4 @@ > /* > - * arch/ppc/platforms/tqm8260_setup.c > - * > * TQM8260 platform support > * > * Author: Allen Curtis > diff -r 800442576617 arch/ppc/syslib/cpc700.h > --- a/arch/ppc/syslib/cpc700.h Sat Jan 14 05:24:55 2006 > +++ b/arch/ppc/syslib/cpc700.h Sat Jan 14 23:40:17 2006 > @@ -1,6 +1,4 @@ > /* > - * arch/ppc/syslib/cpc700.h > - * > * Header file for IBM CPC700 Host Bridge, et. al. > * > * Author: Mark A. Greer > diff -r 800442576617 arch/ppc/syslib/cpc700_pic.c > --- a/arch/ppc/syslib/cpc700_pic.c Sat Jan 14 05:24:55 2006 > +++ b/arch/ppc/syslib/cpc700_pic.c Sat Jan 14 23:40:17 2006 > @@ -1,6 +1,4 @@ > /* > - * arch/ppc/syslib/cpc700_pic.c > - * > * Interrupt controller support for IBM Spruce > * > * Authors: Mark Greer, Matt Porter, and Johnnie Peters > diff -r 800442576617 arch/ppc/syslib/cpc710.h > --- a/arch/ppc/syslib/cpc710.h Sat Jan 14 05:24:55 2006 > +++ b/arch/ppc/syslib/cpc710.h Sat Jan 14 23:40:17 2006 > @@ -1,6 +1,4 @@ > /* > - * arch/ppc/syslib/cpc710.h > - * > * Definitions for the IBM CPC710 PCI Host Bridge > * > * Author: Matt Porter > diff -r 800442576617 arch/ppc/syslib/gen550.h > --- a/arch/ppc/syslib/gen550.h Sat Jan 14 05:24:55 2006 > +++ b/arch/ppc/syslib/gen550.h Sat Jan 14 23:40:17 2006 > @@ -1,6 +1,4 @@ > /* > - * arch/ppc/syslib/gen550.h > - * > * gen550 prototypes > * > * Matt Porter > diff -r 800442576617 arch/ppc/syslib/gen550_dbg.c > --- a/arch/ppc/syslib/gen550_dbg.c Sat Jan 14 05:24:55 2006 > +++ b/arch/ppc/syslib/gen550_dbg.c Sat Jan 14 23:40:17 2006 > @@ -1,6 +1,4 @@ > /* > - * arch/ppc/syslib/gen550_dbg.c > - * > * A library of polled 16550 serial routines. These are intended to > * be used to support progress messages, xmon, kgdb, etc. on a > * variety of platforms. > diff -r 800442576617 arch/ppc/syslib/gen550_kgdb.c > --- a/arch/ppc/syslib/gen550_kgdb.c Sat Jan 14 05:24:55 2006 > +++ b/arch/ppc/syslib/gen550_kgdb.c Sat Jan 14 23:40:17 2006 > @@ -1,6 +1,4 @@ > /* > - * arch/ppc/syslib/gen550_kgdb.c > - * > * Generic 16550 kgdb support intended to be useful on a variety > * of platforms. To enable this support, it is necessary to set > * the CONFIG_GEN550 option. Any virtual mapping of the serial > diff -r 800442576617 arch/ppc/syslib/gt64260_pic.c > --- a/arch/ppc/syslib/gt64260_pic.c Sat Jan 14 05:24:55 2006 > +++ b/arch/ppc/syslib/gt64260_pic.c Sat Jan 14 23:40:17 2006 > @@ -1,6 +1,4 @@ > /* > - * arch/ppc/syslib/gt64260_pic.c > - * > * Interrupt controller support for Galileo's GT64260. > * > * Author: Chris Zankel > diff -r 800442576617 arch/ppc/syslib/harrier.c > --- a/arch/ppc/syslib/harrier.c Sat Jan 14 05:24:55 2006 > +++ b/arch/ppc/syslib/harrier.c Sat Jan 14 23:40:17 2006 > @@ -1,6 +1,4 @@ > /* > - * arch/ppc/syslib/harrier.c > - * > * Motorola MCG Harrier northbridge/memory controller support > * > * Author: Dale Farnsworth > diff -r 800442576617 arch/ppc/syslib/hawk_common.c > --- a/arch/ppc/syslib/hawk_common.c Sat Jan 14 05:24:55 2006 > +++ b/arch/ppc/syslib/hawk_common.c Sat Jan 14 23:40:17 2006 > @@ -1,6 +1,4 @@ > /* > - * arch/ppc/syslib/hawk_common.c > - * > * Common Motorola PowerPlus Platform--really Falcon/Raven or HAWK. > * > * Author: Mark A. Greer > diff -r 800442576617 arch/ppc/syslib/ibm440gp_common.c > --- a/arch/ppc/syslib/ibm440gp_common.c Sat Jan 14 05:24:55 2006 > +++ b/arch/ppc/syslib/ibm440gp_common.c Sat Jan 14 23:40:17 2006 > @@ -1,6 +1,4 @@ > /* > - * arch/ppc/syslib/ibm440gp_common.c > - * > * PPC440GP system library > * > * Matt Porter > diff -r 800442576617 arch/ppc/syslib/ibm440gp_common.h > --- a/arch/ppc/syslib/ibm440gp_common.h Sat Jan 14 05:24:55 2006 > +++ b/arch/ppc/syslib/ibm440gp_common.h Sat Jan 14 23:40:17 2006 > @@ -1,6 +1,4 @@ > /* > - * arch/ppc/kernel/ibm440gp_common.h > - * > * PPC440GP system library > * > * Eugene Surovegin or > > diff -r 800442576617 arch/ppc/syslib/ibm440gx_common.c > --- a/arch/ppc/syslib/ibm440gx_common.c Sat Jan 14 05:24:55 2006 > +++ b/arch/ppc/syslib/ibm440gx_common.c Sat Jan 14 23:40:17 2006 > @@ -1,6 +1,4 @@ > /* > - * arch/ppc/kernel/ibm440gx_common.c > - * > * PPC440GX system library > * > * Eugene Surovegin or > > diff -r 800442576617 arch/ppc/syslib/ibm440gx_common.h > --- a/arch/ppc/syslib/ibm440gx_common.h Sat Jan 14 05:24:55 2006 > +++ b/arch/ppc/syslib/ibm440gx_common.h Sat Jan 14 23:40:17 2006 > @@ -1,6 +1,4 @@ > /* > - * arch/ppc/kernel/ibm440gx_common.h > - * > * PPC440GX system library > * > * Eugene Surovegin or > > diff -r 800442576617 arch/ppc/syslib/ibm440sp_common.c > --- a/arch/ppc/syslib/ibm440sp_common.c Sat Jan 14 05:24:55 2006 > +++ b/arch/ppc/syslib/ibm440sp_common.c Sat Jan 14 23:40:17 2006 > @@ -1,6 +1,4 @@ > /* > - * arch/ppc/syslib/ibm440sp_common.c > - * > * PPC440SP/PPC440SPe system library > * > * Matt Porter > diff -r 800442576617 arch/ppc/syslib/ibm440sp_common.h > --- a/arch/ppc/syslib/ibm440sp_common.h Sat Jan 14 05:24:55 2006 > +++ b/arch/ppc/syslib/ibm440sp_common.h Sat Jan 14 23:40:17 2006 > @@ -1,6 +1,4 @@ > /* > - * arch/ppc/syslib/ibm440sp_common.h > - * > * PPC440SP system library > * > * Matt Porter > diff -r 800442576617 arch/ppc/syslib/ibm44x_common.c > --- a/arch/ppc/syslib/ibm44x_common.c Sat Jan 14 05:24:55 2006 > +++ b/arch/ppc/syslib/ibm44x_common.c Sat Jan 14 23:40:17 2006 > @@ -1,6 +1,4 @@ > /* > - * arch/ppc/syslib/ibm44x_common.c > - * > * PPC44x system library > * > * Matt Porter > diff -r 800442576617 arch/ppc/syslib/ibm44x_common.h > --- a/arch/ppc/syslib/ibm44x_common.h Sat Jan 14 05:24:55 2006 > +++ b/arch/ppc/syslib/ibm44x_common.h Sat Jan 14 23:40:17 2006 > @@ -1,6 +1,4 @@ > /* > - * arch/ppc/kernel/ibm44x_common.h > - * > * PPC44x system library > * > * Eugene Surovegin or > > diff -r 800442576617 arch/ppc/syslib/m8260_pci_erratum9.c > --- a/arch/ppc/syslib/m8260_pci_erratum9.c Sat Jan 14 05:24:55 2006 > +++ b/arch/ppc/syslib/m8260_pci_erratum9.c Sat Jan 14 23:40:17 2006 > @@ -1,6 +1,4 @@ > /* > - * arch/ppc/platforms/mpc8260_pci9.c > - * > * Workaround for device erratum PCI 9. > * See Motorola's "XPC826xA Family Device Errata Reference." > * The erratum applies to all 8260 family Hip4 processors. It is > scheduled > diff -r 800442576617 arch/ppc/syslib/m8260_setup.c > --- a/arch/ppc/syslib/m8260_setup.c Sat Jan 14 05:24:55 2006 > +++ b/arch/ppc/syslib/m8260_setup.c Sat Jan 14 23:40:17 2006 > @@ -1,6 +1,4 @@ > /* > - * arch/ppc/syslib/m8260_setup.c > - * > * Copyright (C) 1995 Linus Torvalds > * Adapted from 'alpha' version by Gary Thomas > * Modified by Cort Dougan (cort at cs.nmt.edu) > diff -r 800442576617 arch/ppc/syslib/m8xx_setup.c > --- a/arch/ppc/syslib/m8xx_setup.c Sat Jan 14 05:24:55 2006 > +++ b/arch/ppc/syslib/m8xx_setup.c Sat Jan 14 23:40:17 2006 > @@ -1,6 +1,4 @@ > /* > - * arch/ppc/kernel/setup.c > - * > * Copyright (C) 1995 Linus Torvalds > * Adapted from 'alpha' version by Gary Thomas > * Modified by Cort Dougan (cort at cs.nmt.edu) > diff -r 800442576617 arch/ppc/syslib/mpc10x_common.c > --- a/arch/ppc/syslib/mpc10x_common.c Sat Jan 14 05:24:55 2006 > +++ b/arch/ppc/syslib/mpc10x_common.c Sat Jan 14 23:40:17 2006 > @@ -1,6 +1,4 @@ > /* > - * arch/ppc/syslib/mpc10x_common.c > - * > * Common routines for the Motorola SPS MPC106, MPC107 and MPC8240 > Host bridge, > * Mem ctlr, EPIC, etc. > * > diff -r 800442576617 arch/ppc/syslib/mpc52xx_devices.c > --- a/arch/ppc/syslib/mpc52xx_devices.c Sat Jan 14 05:24:55 2006 > +++ b/arch/ppc/syslib/mpc52xx_devices.c Sat Jan 14 23:40:17 2006 > @@ -1,6 +1,4 @@ > /* > - * arch/ppc/syslib/mpc52xx_devices.c > - * > * Freescale MPC52xx device descriptions > * > * > diff -r 800442576617 arch/ppc/syslib/mpc52xx_pci.c > --- a/arch/ppc/syslib/mpc52xx_pci.c Sat Jan 14 05:24:55 2006 > +++ b/arch/ppc/syslib/mpc52xx_pci.c Sat Jan 14 23:40:17 2006 > @@ -1,6 +1,4 @@ > /* > - * arch/ppc/syslib/mpc52xx_pci.c > - * > * PCI code for the Freescale MPC52xx embedded CPU. > * > * > diff -r 800442576617 arch/ppc/syslib/mpc52xx_pci.h > --- a/arch/ppc/syslib/mpc52xx_pci.h Sat Jan 14 05:24:55 2006 > +++ b/arch/ppc/syslib/mpc52xx_pci.h Sat Jan 14 23:40:17 2006 > @@ -1,6 +1,4 @@ > /* > - * arch/ppc/syslib/mpc52xx_pci.h > - * > * PCI Include file the Freescale MPC52xx embedded cpu chips > * > * > diff -r 800442576617 arch/ppc/syslib/mpc52xx_pic.c > --- a/arch/ppc/syslib/mpc52xx_pic.c Sat Jan 14 05:24:55 2006 > +++ b/arch/ppc/syslib/mpc52xx_pic.c Sat Jan 14 23:40:17 2006 > @@ -1,6 +1,4 @@ > /* > - * arch/ppc/syslib/mpc52xx_pic.c > - * > * Programmable Interrupt Controller functions for the Freescale > MPC52xx > * embedded CPU. > * > diff -r 800442576617 arch/ppc/syslib/mpc52xx_setup.c > --- a/arch/ppc/syslib/mpc52xx_setup.c Sat Jan 14 05:24:55 2006 > +++ b/arch/ppc/syslib/mpc52xx_setup.c Sat Jan 14 23:40:17 2006 > @@ -1,6 +1,4 @@ > /* > - * arch/ppc/syslib/mpc52xx_setup.c > - * > * Common code for the boards based on Freescale MPC52xx embedded > CPU. > * > * > diff -r 800442576617 arch/ppc/syslib/mpc52xx_sys.c > --- a/arch/ppc/syslib/mpc52xx_sys.c Sat Jan 14 05:24:55 2006 > +++ b/arch/ppc/syslib/mpc52xx_sys.c Sat Jan 14 23:40:17 2006 > @@ -1,6 +1,4 @@ > /* > - * arch/ppc/syslib/mpc52xx_sys.c > - * > * Freescale MPC52xx system descriptions > * > * > diff -r 800442576617 arch/ppc/syslib/mpc83xx_devices.c > --- a/arch/ppc/syslib/mpc83xx_devices.c Sat Jan 14 05:24:55 2006 > +++ b/arch/ppc/syslib/mpc83xx_devices.c Sat Jan 14 23:40:17 2006 > @@ -1,6 +1,4 @@ > /* > - * arch/ppc/platforms/83xx/mpc83xx_devices.c > - * > * MPC83xx Device descriptions > * > * Maintainer: Kumar Gala > diff -r 800442576617 arch/ppc/syslib/mpc83xx_sys.c > --- a/arch/ppc/syslib/mpc83xx_sys.c Sat Jan 14 05:24:55 2006 > +++ b/arch/ppc/syslib/mpc83xx_sys.c Sat Jan 14 23:40:17 2006 > @@ -1,6 +1,4 @@ > /* > - * arch/ppc/platforms/83xx/mpc83xx_sys.c > - * > * MPC83xx System descriptions > * > * Maintainer: Kumar Gala > diff -r 800442576617 arch/ppc/syslib/mpc85xx_devices.c > --- a/arch/ppc/syslib/mpc85xx_devices.c Sat Jan 14 05:24:55 2006 > +++ b/arch/ppc/syslib/mpc85xx_devices.c Sat Jan 14 23:40:17 2006 > @@ -1,6 +1,4 @@ > /* > - * arch/ppc/platforms/85xx/mpc85xx_devices.c > - * > * MPC85xx Device descriptions > * > * Maintainer: Kumar Gala > diff -r 800442576617 arch/ppc/syslib/mpc85xx_sys.c > --- a/arch/ppc/syslib/mpc85xx_sys.c Sat Jan 14 05:24:55 2006 > +++ b/arch/ppc/syslib/mpc85xx_sys.c Sat Jan 14 23:40:17 2006 > @@ -1,6 +1,4 @@ > /* > - * arch/ppc/platforms/85xx/mpc85xx_sys.c > - * > * MPC85xx System descriptions > * > * Maintainer: Kumar Gala > diff -r 800442576617 arch/ppc/syslib/mpc8xx_devices.c > --- a/arch/ppc/syslib/mpc8xx_devices.c Sat Jan 14 05:24:55 2006 > +++ b/arch/ppc/syslib/mpc8xx_devices.c Sat Jan 14 23:40:17 2006 > @@ -1,6 +1,4 @@ > /* > - * arch/ppc/syslib/mpc8xx_devices.c > - * > * MPC8xx Device descriptions > * > * Maintainer: Kumar Gala > diff -r 800442576617 arch/ppc/syslib/mpc8xx_sys.c > --- a/arch/ppc/syslib/mpc8xx_sys.c Sat Jan 14 05:24:55 2006 > +++ b/arch/ppc/syslib/mpc8xx_sys.c Sat Jan 14 23:40:17 2006 > @@ -1,6 +1,4 @@ > /* > - * arch/ppc/platforms/mpc8xx_sys.c > - * > * MPC8xx System descriptions > * > * Maintainer: Kumar Gala > diff -r 800442576617 arch/ppc/syslib/mv64360_pic.c > --- a/arch/ppc/syslib/mv64360_pic.c Sat Jan 14 05:24:55 2006 > +++ b/arch/ppc/syslib/mv64360_pic.c Sat Jan 14 23:40:17 2006 > @@ -1,6 +1,4 @@ > /* > - * arch/ppc/kernel/mv64360_pic.c > - * > * Interrupt controller support for Marvell's MV64360. > * > * Author: Rabeeh Khoury > diff -r 800442576617 arch/ppc/syslib/mv64x60.c > --- a/arch/ppc/syslib/mv64x60.c Sat Jan 14 05:24:55 2006 > +++ b/arch/ppc/syslib/mv64x60.c Sat Jan 14 23:40:17 2006 > @@ -1,6 +1,4 @@ > /* > - * arch/ppc/syslib/mv64x60.c > - * > * Common routines for the Marvell/Galileo Discovery line of host > bridges > * (gt64260, mv64360, mv64460, ...). > * > diff -r 800442576617 arch/ppc/syslib/mv64x60_dbg.c > --- a/arch/ppc/syslib/mv64x60_dbg.c Sat Jan 14 05:24:55 2006 > +++ b/arch/ppc/syslib/mv64x60_dbg.c Sat Jan 14 23:40:17 2006 > @@ -1,6 +1,4 @@ > /* > - * arch/ppc/syslib/mv64x60_dbg.c > - * > * KGDB and progress routines for the Marvell/Galileo MV64x60 > (Discovery). > * > * Author: Mark A. Greer > diff -r 800442576617 arch/ppc/syslib/mv64x60_win.c > --- a/arch/ppc/syslib/mv64x60_win.c Sat Jan 14 05:24:55 2006 > +++ b/arch/ppc/syslib/mv64x60_win.c Sat Jan 14 23:40:17 2006 > @@ -1,6 +1,4 @@ > /* > - * arch/ppc/syslib/mv64x60_win.c > - * > * Tables with info on how to manipulate the 32 & 64 bit windows > on the > * various types of Marvell bridge chips. > * > diff -r 800442576617 arch/ppc/syslib/open_pic.c > --- a/arch/ppc/syslib/open_pic.c Sat Jan 14 05:24:55 2006 > +++ b/arch/ppc/syslib/open_pic.c Sat Jan 14 23:40:17 2006 > @@ -1,6 +1,4 @@ > /* > - * arch/ppc/kernel/open_pic.c -- OpenPIC Interrupt Handling > - * > * Copyright (C) 1997 Geert Uytterhoeven > * > * This file is subject to the terms and conditions of the GNU > General Public > diff -r 800442576617 arch/ppc/syslib/open_pic2.c > --- a/arch/ppc/syslib/open_pic2.c Sat Jan 14 05:24:55 2006 > +++ b/arch/ppc/syslib/open_pic2.c Sat Jan 14 23:40:17 2006 > @@ -1,6 +1,4 @@ > /* > - * arch/ppc/kernel/open_pic.c -- OpenPIC Interrupt Handling > - * > * Copyright (C) 1997 Geert Uytterhoeven > * > * This file is subject to the terms and conditions of the GNU > General Public > diff -r 800442576617 arch/ppc/syslib/open_pic_defs.h > --- a/arch/ppc/syslib/open_pic_defs.h Sat Jan 14 05:24:55 2006 > +++ b/arch/ppc/syslib/open_pic_defs.h Sat Jan 14 23:40:17 2006 > @@ -1,6 +1,4 @@ > /* > - * arch/ppc/kernel/open_pic_defs.h -- OpenPIC definitions > - * > * Copyright (C) 1997 Geert Uytterhoeven > * > * This file is based on the following documentation: > diff -r 800442576617 arch/ppc/syslib/pci_auto.c > --- a/arch/ppc/syslib/pci_auto.c Sat Jan 14 05:24:55 2006 > +++ b/arch/ppc/syslib/pci_auto.c Sat Jan 14 23:40:17 2006 > @@ -1,6 +1,4 @@ > /* > - * arch/ppc/syslib/pci_auto.c > - * > * PCI autoconfiguration library > * > * Author: Matt Porter > diff -r 800442576617 arch/ppc/syslib/ppc4xx_dma.c > --- a/arch/ppc/syslib/ppc4xx_dma.c Sat Jan 14 05:24:55 2006 > +++ b/arch/ppc/syslib/ppc4xx_dma.c Sat Jan 14 23:40:17 2006 > @@ -1,6 +1,4 @@ > /* > - * arch/ppc/kernel/ppc4xx_dma.c > - * > * IBM PPC4xx DMA engine core library > * > * Copyright 2000-2004 MontaVista Software Inc. > diff -r 800442576617 arch/ppc/syslib/ppc4xx_pic.c > --- a/arch/ppc/syslib/ppc4xx_pic.c Sat Jan 14 05:24:55 2006 > +++ b/arch/ppc/syslib/ppc4xx_pic.c Sat Jan 14 23:40:17 2006 > @@ -1,6 +1,4 @@ > /* > - * arch/ppc/syslib/ppc4xx_pic.c > - * > * Interrupt controller driver for PowerPC 4xx-based processors. > * > * Eugene Surovegin or > > diff -r 800442576617 arch/ppc/syslib/ppc4xx_sgdma.c > --- a/arch/ppc/syslib/ppc4xx_sgdma.c Sat Jan 14 05:24:55 2006 > +++ b/arch/ppc/syslib/ppc4xx_sgdma.c Sat Jan 14 23:40:17 2006 > @@ -1,6 +1,4 @@ > /* > - * arch/ppc/kernel/ppc4xx_sgdma.c > - * > * IBM PPC4xx DMA engine scatter/gather library > * > * Copyright 2002-2003 MontaVista Software Inc. > diff -r 800442576617 arch/ppc/syslib/ppc83xx_setup.c > --- a/arch/ppc/syslib/ppc83xx_setup.c Sat Jan 14 05:24:55 2006 > +++ b/arch/ppc/syslib/ppc83xx_setup.c Sat Jan 14 23:40:17 2006 > @@ -1,6 +1,4 @@ > /* > - * arch/ppc/syslib/ppc83xx_setup.c > - * > * MPC83XX common board code > * > * Maintainer: Kumar Gala > diff -r 800442576617 arch/ppc/syslib/ppc83xx_setup.h > --- a/arch/ppc/syslib/ppc83xx_setup.h Sat Jan 14 05:24:55 2006 > +++ b/arch/ppc/syslib/ppc83xx_setup.h Sat Jan 14 23:40:17 2006 > @@ -1,6 +1,4 @@ > /* > - * arch/ppc/syslib/ppc83xx_setup.h > - * > * MPC83XX common board definitions > * > * Maintainer: Kumar Gala > diff -r 800442576617 arch/ppc/syslib/ppc85xx_common.c > --- a/arch/ppc/syslib/ppc85xx_common.c Sat Jan 14 05:24:55 2006 > +++ b/arch/ppc/syslib/ppc85xx_common.c Sat Jan 14 23:40:17 2006 > @@ -1,6 +1,4 @@ > /* > - * arch/ppc/syslib/ppc85xx_common.c > - * > * MPC85xx support routines > * > * Maintainer: Kumar Gala > diff -r 800442576617 arch/ppc/syslib/ppc85xx_common.h > --- a/arch/ppc/syslib/ppc85xx_common.h Sat Jan 14 05:24:55 2006 > +++ b/arch/ppc/syslib/ppc85xx_common.h Sat Jan 14 23:40:17 2006 > @@ -1,6 +1,4 @@ > /* > - * arch/ppc/syslib/ppc85xx_common.h > - * > * MPC85xx support routines > * > * Maintainer: Kumar Gala > diff -r 800442576617 arch/ppc/syslib/ppc85xx_setup.c > --- a/arch/ppc/syslib/ppc85xx_setup.c Sat Jan 14 05:24:55 2006 > +++ b/arch/ppc/syslib/ppc85xx_setup.c Sat Jan 14 23:40:17 2006 > @@ -1,6 +1,4 @@ > /* > - * arch/ppc/syslib/ppc85xx_setup.c > - * > * MPC85XX common board code > * > * Maintainer: Kumar Gala > diff -r 800442576617 arch/ppc/syslib/ppc85xx_setup.h > --- a/arch/ppc/syslib/ppc85xx_setup.h Sat Jan 14 05:24:55 2006 > +++ b/arch/ppc/syslib/ppc85xx_setup.h Sat Jan 14 23:40:17 2006 > @@ -1,6 +1,4 @@ > /* > - * arch/ppc/syslib/ppc85xx_setup.h > - * > * MPC85XX common board definitions > * > * Maintainer: Kumar Gala > diff -r 800442576617 arch/ppc/syslib/ppc_sys.c > --- a/arch/ppc/syslib/ppc_sys.c Sat Jan 14 05:24:55 2006 > +++ b/arch/ppc/syslib/ppc_sys.c Sat Jan 14 23:40:17 2006 > @@ -1,6 +1,4 @@ > /* > - * arch/ppc/syslib/ppc_sys.c > - * > * PPC System library functions > * > * Maintainer: Kumar Gala > diff -r 800442576617 arch/ppc/syslib/pq2_devices.c > --- a/arch/ppc/syslib/pq2_devices.c Sat Jan 14 05:24:55 2006 > +++ b/arch/ppc/syslib/pq2_devices.c Sat Jan 14 23:40:17 2006 > @@ -1,6 +1,4 @@ > /* > - * arch/ppc/syslib/pq2_devices.c > - * > * PQ2 Device descriptions > * > * Maintainer: Kumar Gala > diff -r 800442576617 arch/ppc/syslib/pq2_sys.c > --- a/arch/ppc/syslib/pq2_sys.c Sat Jan 14 05:24:55 2006 > +++ b/arch/ppc/syslib/pq2_sys.c Sat Jan 14 23:40:17 2006 > @@ -1,6 +1,4 @@ > /* > - * arch/ppc/syslib/pq2_devices.c > - * > * PQ2 System descriptions > * > * Maintainer: Kumar Gala > diff -r 800442576617 arch/ppc/syslib/prep_nvram.c > --- a/arch/ppc/syslib/prep_nvram.c Sat Jan 14 05:24:55 2006 > +++ b/arch/ppc/syslib/prep_nvram.c Sat Jan 14 23:40:17 2006 > @@ -1,6 +1,4 @@ > /* > - * arch/ppc/kernel/prep_nvram.c > - * > * Copyright (C) 1998 Corey Minyard > * > * This reads the NvRAM on PReP compliant machines (generally from > IBM or > diff -r 800442576617 arch/ppc/syslib/todc_time.c > --- a/arch/ppc/syslib/todc_time.c Sat Jan 14 05:24:55 2006 > +++ b/arch/ppc/syslib/todc_time.c Sat Jan 14 23:40:17 2006 > @@ -1,6 +1,4 @@ > /* > - * arch/ppc/syslib/todc_time.c > - * > * Time of Day Clock support for the M48T35, M48T37, M48T59, and > MC146818 > * Real Time Clocks/Timekeepers. > * > diff -r 800442576617 arch/ppc/syslib/xilinx_pic.c > --- a/arch/ppc/syslib/xilinx_pic.c Sat Jan 14 05:24:55 2006 > +++ b/arch/ppc/syslib/xilinx_pic.c Sat Jan 14 23:40:17 2006 > @@ -1,6 +1,4 @@ > /* > - * arch/ppc/syslib/xilinx_pic.c > - * > * Interrupt controller driver for Xilinx Virtex-II Pro. > * > * Author: MontaVista Software, Inc. > diff -r 800442576617 drivers/char/hvcs.c > --- a/drivers/char/hvcs.c Sat Jan 14 05:24:55 2006 > +++ b/drivers/char/hvcs.c Sat Jan 14 23:40:17 2006 > @@ -118,7 +118,7 @@ > * the hvcs_final_close() function in order to get it out of the > spinlock. > * Rearranged hvcs_close(). Cleaned up some printks and did some > housekeeping > * on the changelog. Removed local CLC_LENGTH and used > HVCS_CLC_LENGTH from > - * arch/ppc64/hvcserver.h. > + * include/asm-powerpc/hvcserver.h > * > * 1.3.2 -> 1.3.3 Replaced yield() in hvcs_close() with > tty_wait_until_sent() to > * prevent possible lockup with realtime scheduling as similarily > pointed out by > @@ -168,9 +168,10 @@ > > /* > * The hcall interface involves putting 8 chars into each of two > registers. > - * We load up those 2 registers (in arch/ppc64/hvconsole.c) by > casting char[16] > - * to long[2]. It would work without __ALIGNED__, but a little > (tiny) bit > - * slower because an unaligned load is slower than aligned load. > + * We load up those 2 registers (in arch/powerpc/platforms/pseries/ > hvconsole.c) > + * by casting char[16] to long[2]. It would work without > __ALIGNED__, but a > + * little (tiny) bit slower because an unaligned load is slower > than aligned > + * load. > */ > #define __ALIGNED__ __attribute__((__aligned__(8))) > > diff -r 800442576617 include/asm-powerpc/paca.h > --- a/include/asm-powerpc/paca.h Sat Jan 14 05:24:55 2006 > +++ b/include/asm-powerpc/paca.h Sat Jan 14 23:40:17 2006 > @@ -54,7 +54,7 @@ > #endif /* CONFIG_PPC_ISERIES */ > > /* > - * MAGIC: the spinlock functions in arch/ppc64/lib/locks.c > + * MAGIC: the spinlock functions in arch/powerpc/lib/locks.c > * load lock_token and paca_index with a single lwz > * instruction. They must travel together and be properly > * aligned. > diff -r 800442576617 include/asm-powerpc/rwsem.h > --- a/include/asm-powerpc/rwsem.h Sat Jan 14 05:24:55 2006 > +++ b/include/asm-powerpc/rwsem.h Sat Jan 14 23:40:17 2006 > @@ -4,7 +4,7 @@ > #ifdef __KERNEL__ > > /* > - * include/asm-ppc64/rwsem.h: R/W semaphores for PPC using the stuff > + * include/asm-powerpc/rwsem.h: R/W semaphores for PPC using the > stuff > * in lib/rwsem.c. Adapted largely from include/asm-i386/rwsem.h > * by Paul Mackerras . > */ > diff -r 800442576617 include/asm-ppc/harrier.h > --- a/include/asm-ppc/harrier.h Sat Jan 14 05:24:55 2006 > +++ b/include/asm-ppc/harrier.h Sat Jan 14 23:40:17 2006 > @@ -1,6 +1,4 @@ > /* > - * arch/ppc/kernel/harrier.h > - * > * Definitions for Motorola MCG Harrier North Bridge & Memory > controller > * > * Author: Dale Farnsworth > diff -r 800442576617 include/asm-ppc/mpc10x.h > --- a/include/asm-ppc/mpc10x.h Sat Jan 14 05:24:55 2006 > +++ b/include/asm-ppc/mpc10x.h Sat Jan 14 23:40:17 2006 > @@ -1,6 +1,4 @@ > /* > - * arch/ppc/kernel/mpc10x.h > - * > * Common routines for the Motorola SPS MPC106/8240/107 Host > bridge/Mem > * ctlr/EPIC/etc. > * > diff -r 800442576617 kernel/auditsc.c > --- a/kernel/auditsc.c Sat Jan 14 05:24:55 2006 > +++ b/kernel/auditsc.c Sat Jan 14 23:40:17 2006 > @@ -958,7 +958,7 @@ > * > * i386 no > * x86_64 no > - * ppc64 yes (see arch/ppc64/kernel/misc.S) > + * ppc64 yes (see arch/powerpc/platforms/iseries/misc.S) > * > * This also happens with vm86 emulation in a non-nested manner > * (entries without exits), so this case must be caught. > diff -r 800442576617 lib/extable.c > --- a/lib/extable.c Sat Jan 14 05:24:55 2006 > +++ b/lib/extable.c Sat Jan 14 23:40:17 2006 > @@ -1,5 +1,4 @@ > /* > - * lib/extable.c > * Derived from arch/ppc/mm/extable.c and arch/i386/mm/extable.c. > * > * Copyright (C) 2004 Paul Mackerras, IBM Corp. > _______________________________________________ > Linuxppc64-dev mailing list > Linuxppc64-dev at ozlabs.org > https://ozlabs.org/mailman/listinfo/linuxppc64-dev From olof at lixom.net Sun Jan 15 18:55:12 2006 From: olof at lixom.net (Olof Johansson) Date: Sun, 15 Jan 2006 01:55:12 -0600 Subject: please pull powerpc-merge.git In-Reply-To: <0E772062-74AF-44C0-9481-E2F2E981677D@kernel.crashing.org> References: <17352.31911.799540.543433@cargo.ozlabs.ibm.com> <20060114204811.GT2491@pb15.lixom.net> <0E772062-74AF-44C0-9481-E2F2E981677D@kernel.crashing.org> Message-ID: <20060115075512.GB932@pb15.lixom.net> On Sun, Jan 15, 2006 at 01:33:57AM -0600, Kumar Gala wrote: > I didn't see any comments related to the the MPC834x SYS board patch. I can't seem to find a record of it being sent now either. Weird, I was sure I sent it. Anyway, it was just nitpicks, since it's merged it's no big deal. -Olof From paulus at samba.org Sun Jan 15 21:12:17 2006 From: paulus at samba.org (Paul Mackerras) Date: Sun, 15 Jan 2006 21:12:17 +1100 Subject: please pull powerpc-merge.git Message-ID: <17354.8193.362833.202616@cargo.ozlabs.ibm.com> Linus, Please do a pull from git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc-merge.git There are 7 commits there: Benjamin Herrenschmidt: powerpc: Fix Maple build powerpc: Update pmac32_defconfig Haren Myneni: powerpc: Fix kdump copy regs and dynamic allocate per-cpu crash notes powerpc: Kconfig changes for CRASH_DUMP Paul Mackerras: powerpc/32: Generate miboot images with ARCH=powerpc ppc: Remove powermac support from ARCH=ppc powerpc: Make ARCH=powerpc the default for 32-bit ppc The 3 commits of mine complete the move of 32-bit powermac support to ARCH=powerpc, and remove the powermac support from ARCH=ppc. The powermac support in arch/ppc was broken, and Ben H says he is not going to fix or maintain it. Note that the last commit listed there modifies the top-level Makefile to default to ARCH=powerpc if uname -m gives either "ppc" or "ppc64". Most people who would be likely to build their own kernels natively on ppc32 machines will be using powermacs (or possibly CHRP workstations, which are also supported with ARCH=powerpc now). Embedded developers who are using ports that haven't been moved over to ARCH=powerpc can put ARCH=ppc explicitly on the command line, or hack the top-level Makefile. (Many of them would be cross-compiling already, anyway.) The other commits are minor fixes and a defconfig update. I didn't put in Ben's patch to get rid of the dependence on the _machine variable, but I suspect he will argue for its inclusion before 2.6.16. :) Thanks, Paul. Makefile | 2 arch/powerpc/Kconfig | 21 arch/powerpc/boot/Makefile | 29 arch/powerpc/boot/dummy.c | 4 arch/powerpc/configs/pmac32_defconfig | 105 + arch/powerpc/kernel/crash.c | 77 - arch/powerpc/kernel/prom_init.c | 3 arch/powerpc/platforms/maple/pci.c | 1 arch/powerpc/platforms/maple/setup.c | 85 - arch/powerpc/platforms/maple/time.c | 23 arch/ppc/Kconfig | 73 - arch/ppc/boot/Makefile | 2 arch/ppc/boot/openfirmware/Makefile | 96 - arch/ppc/boot/openfirmware/coffmain.c | 101 - arch/ppc/boot/openfirmware/newworldmain.c | 94 - arch/ppc/kernel/Makefile | 2 arch/ppc/kernel/misc.S | 72 - arch/ppc/kernel/pci.c | 240 -- arch/ppc/kernel/ppc_ksyms.c | 9 arch/ppc/kernel/setup.c | 34 arch/ppc/kernel/traps.c | 13 arch/ppc/mm/init.c | 29 arch/ppc/platforms/Makefile | 11 arch/ppc/platforms/chrp_pci.c | 2 arch/ppc/platforms/chrp_setup.c | 73 + arch/ppc/platforms/chrp_time.c | 64 + arch/ppc/platforms/pmac_backlight.c | 202 -- arch/ppc/platforms/pmac_cache.S | 359 --- arch/ppc/platforms/pmac_cpufreq.c | 735 ------- arch/ppc/platforms/pmac_feature.c | 3023 ----------------------------- arch/ppc/platforms/pmac_low_i2c.c | 511 ----- arch/ppc/platforms/pmac_nvram.c | 584 ------ arch/ppc/platforms/pmac_pci.c | 1124 ----------- arch/ppc/platforms/pmac_pic.c | 693 ------- arch/ppc/platforms/pmac_pic.h | 11 arch/ppc/platforms/pmac_setup.c | 745 ------- arch/ppc/platforms/pmac_sleep.S | 396 ---- arch/ppc/platforms/pmac_smp.c | 692 ------- arch/ppc/platforms/pmac_time.c | 291 --- arch/ppc/syslib/Makefile | 2 arch/ppc/syslib/prom.c | 21 arch/ppc/xmon/start.c | 161 -- arch/ppc/xmon/xmon.c | 13 drivers/video/aty/radeon_pm.c | 6 include/asm-powerpc/kexec.h | 85 + include/asm-ppc/prom.h | 8 46 files changed, 452 insertions(+), 10475 deletions(-) create mode 100644 arch/powerpc/boot/dummy.c delete mode 100644 arch/ppc/boot/openfirmware/coffmain.c delete mode 100644 arch/ppc/boot/openfirmware/newworldmain.c delete mode 100644 arch/ppc/platforms/pmac_backlight.c delete mode 100644 arch/ppc/platforms/pmac_cache.S delete mode 100644 arch/ppc/platforms/pmac_cpufreq.c delete mode 100644 arch/ppc/platforms/pmac_feature.c delete mode 100644 arch/ppc/platforms/pmac_low_i2c.c delete mode 100644 arch/ppc/platforms/pmac_nvram.c delete mode 100644 arch/ppc/platforms/pmac_pci.c delete mode 100644 arch/ppc/platforms/pmac_pic.c delete mode 100644 arch/ppc/platforms/pmac_pic.h delete mode 100644 arch/ppc/platforms/pmac_setup.c delete mode 100644 arch/ppc/platforms/pmac_sleep.S delete mode 100644 arch/ppc/platforms/pmac_smp.c delete mode 100644 arch/ppc/platforms/pmac_time.c From paulus at samba.org Sun Jan 15 22:09:05 2006 From: paulus at samba.org (Paul Mackerras) Date: Sun, 15 Jan 2006 22:09:05 +1100 Subject: please pull powerpc-merge.git In-Reply-To: <17354.8193.362833.202616@cargo.ozlabs.ibm.com> References: <17354.8193.362833.202616@cargo.ozlabs.ibm.com> Message-ID: <17354.11601.111573.322621@cargo.ozlabs.ibm.com> Linus, I just pushed another commit to powerpc-merge.git, which restores the powermac-specific parts of the PCI code for ppc32. When I did the powermac removal, I overlooked the fact that arch/ppc/kernel/pci.c was still being used for ppc32 ARCH=powerpc builds. This restores the original version as arch/powerpc/kernel/pci_32.c. It would be nice to get to the point where ppc32 ARCH=powerpc builds aren't using any files from arch/ppc - maybe post -rc1? Paul. From arndb at de.ibm.com Mon Jan 16 00:10:13 2006 From: arndb at de.ibm.com (Arnd Bergmann) Date: Sun, 15 Jan 2006 13:10:13 +0000 Subject: [patch 0/8] systemsim and hvc_console patches In-Reply-To: <20060114030907.GP2491@pb15.lixom.net> References: <20060113183033.696401000@localhost> <20060114030907.GP2491@pb15.lixom.net> Message-ID: <200601151310.14135.arndb@de.ibm.com> On Saturday 14 January 2006 03:09, Olof Johansson wrote: > Seems like they still need a bit of cleanup before they get merged. I've > commented on most of the patches, see separate emails. Ok, after looking at the device drivers more closely, I feel a little silly for proposing the systemim patches for inclusion. Are there any further issues with patches 5 and 6, the hvc_console cleanup and rtas driver patches? It would surely be good to get them in because they are required to run on the Mercury products that are already shipping. In this case, the definition of 'in' would probably be powerpc.git and subsequently linux-2.6.17, or is there a different upstream maintainer for console patches? > Overall I'm not sure how I feel about having hacks in the kernel for > systemsim. If it's truly simulating the full system, why can't it simulate > the disk device and network device as well instead of doing things with > magic instructions like it does now? I think systemsim does have accurate models for a number of IDE and network devices, but I would rather not have to use them because they will run at a horribly slow speed, because they try to model the performance of the devices relative to the CPU cycles. For the cell simulator in particular, I think there is no model of the spider-pic interrupt controller, which means that systemsim can not use the models for the devices it uses on other platforms. Eric, is this still correct? Arnd <>< From arndb at de.ibm.com Mon Jan 16 00:06:51 2006 From: arndb at de.ibm.com (Arnd Bergmann) Date: Sun, 15 Jan 2006 13:06:51 +0000 Subject: [patch 1/8] powerpc: basic systemsim support In-Reply-To: <20060114024741.GK2491@pb15.lixom.net> References: <20060113183033.696401000@localhost> <20060113183958.864972000@localhost> <20060114024741.GK2491@pb15.lixom.net> Message-ID: <200601151306.51919.arndb@de.ibm.com> On Saturday 14 January 2006 02:47, Olof Johansson wrote: > On Fri, Jan 13, 2006 at 01:30:34PM -0500, Arnd Bergmann wrote: > > Add some support and doc files for the IBM Full System > > Simulator and a configuration option that acts as a control > > for the patches based on this one. > > > > No code is changed in this patch, but it is required for > > the systemsim network, block, hvc_console and cpu_idle > > patches that are based on the infrastructure in here. > > This patch is full of coding style issues on comments. It also contains > a systemsim.txt file that's 50% marketing text. Can we keep it technical > and relevant, or leave it out of the kernel sources, please? > > I'm also not sure if the Documentation directory is the best place to > put the TCL config file for the simulator. Shouldn't that be packaged > with that instead of the kernel? Yes, I guess the Documentation/systemsim directory can just be removed from the patch. Maybe it would still be nice to have a Documentation/powerpc/systemsim.txt file with some very basic instructions for building a kernel for systemsim and for downloading the simulator itself. Arnd <>< From arndb at de.ibm.com Mon Jan 16 00:11:22 2006 From: arndb at de.ibm.com (Arnd Bergmann) Date: Sun, 15 Jan 2006 13:11:22 +0000 Subject: [patch 7/8] powerpc: hvc backend for systemsim In-Reply-To: <20060114030500.GO2491@pb15.lixom.net> References: <20060113183033.696401000@localhost> <200601131841.33259.arndb@de.ibm.com> <20060114030500.GO2491@pb15.lixom.net> Message-ID: <200601151311.22630.arndb@de.ibm.com> On Saturday 14 January 2006 03:05, Olof Johansson wrote: > This introduces a third name for the same enviroment. > > Now we have: > > * Mambo > * systemsim > * FSS or Full System Simulator > > I don't care which one stays, but it's silly to have three. Yes, that was not particularly well coordinated. Ryan chose the 'fss' name when he did the hvc backend driver, which was probably a poor choice considering that everything else seems to move to systemsim. The 'mambo' identifier should probably not appear in kernel sources except when referring to the established '/mambo' device node in the device tree. AFAICT, 'IBM Full System Simulator' is the horribly long official name for this thing, and it is commonly abbreviated as 'systemsim'. Is this correct? Arnd <>< From arndb at de.ibm.com Sun Jan 15 23:35:50 2006 From: arndb at de.ibm.com (Arnd Bergmann) Date: Sun, 15 Jan 2006 12:35:50 +0000 Subject: [patch 4/8] powerpc: systemsim network driver In-Reply-To: <20060114025704.GM2491@pb15.lixom.net> References: <20060113183033.696401000@localhost> <20060113183959.342152000@localhost> <20060114025704.GM2491@pb15.lixom.net> Message-ID: <200601151235.50971.arndb@de.ibm.com> On Saturday 14 January 2006 02:57, Olof Johansson wrote: > Shouldn't this be reviewed and submitted through netdev/Jeff Garzik? Yes, that's probably true. It's always a little tricky to find the right way to get something upstream when separate maintainers are involved because of the cross-dependency: Each of the device drivers depends on the base support, but there is no point merging the base support unless the device drivers eventually get in as well. > (Same Mambo/Systemsim comment as for the block driver -- at least this > one does proper device probing through the device tree) yes. Arnd <>< From arndb at de.ibm.com Sun Jan 15 23:44:11 2006 From: arndb at de.ibm.com (Arnd Bergmann) Date: Sun, 15 Jan 2006 12:44:11 +0000 Subject: [patch 3/8] powerpc: cpu_idle implementation for systemsim In-Reply-To: <20060114030139.GN2491@pb15.lixom.net> References: <20060113183033.696401000@localhost> <200601131841.16940.arndb@de.ibm.com> <20060114030139.GN2491@pb15.lixom.net> Message-ID: <200601151244.11771.arndb@de.ibm.com> On Saturday 14 January 2006 03:01, Olof Johansson wrote: > > +config SYSTEMSIM_IDLE > > +?????bool " ? Optimized idle loop for systemsim" > > +?????depends on PPC_SYSTEMSIM > > +?????help > > +????? ?Selecting this option will enable an more optimized idle loop > > +????? ?for running on the IBM Full System Simulator that > > +????? ?significantly reduces the load on the host system when > > +????? ?simulating an idle system. > > Do you really need this configured separately from the rest of > systemsim? Maybe not. The idea here is that if you want cycle-accurate simulation of the system, then you might want to use the regular idle loop instead of the faster one, but you might still rely on one of the device drivers. > > +/* > > ? * Called into from start_kernel, after lock_kernel has been called. > > ? * Initializes bootmem, which is unsed to manage page allocation until > > ? * mem_init is called. > > @@ -600,6 +617,8 @@ void __init setup_arch(char **cmdline_p) > > ? > > ??????ppc_md.setup_arch(); > > ? > > +?????setup_systemsim_idle(); > > + > > Idle loops are generally probed and setup in the platform-specific inits > (setup_arch). Can't you do this from there too on the affected > platforms, it's only two after all. You can move the > setup_systemsim_idle() function to idle_systemsim.c to share it. Good idea, the setup_systemsim_idle() function should definitely be moved to the other file. I don't know really how many of the platforms in the current kernel also have a systemsim port (there are only two publically available ones, but a lot more for other systems that still have a closed user base). It's certainly cleaner to move this into the platforms, but it might be helpful if any new systemsim target 'just works' with this. Arnd <>< From arndb at de.ibm.com Sun Jan 15 23:32:40 2006 From: arndb at de.ibm.com (Arnd Bergmann) Date: Sun, 15 Jan 2006 12:32:40 +0000 Subject: [patch 2/8] powerpc: systemsim block device driver In-Reply-To: <20060114025452.GL2491@pb15.lixom.net> References: <20060113183033.696401000@localhost> <20060113183958.994894000@localhost> <20060114025452.GL2491@pb15.lixom.net> Message-ID: <200601151232.41230.arndb@de.ibm.com> On Saturday 14 January 2006 02:54, Olof Johansson wrote: > Maybe I'm just missing it, but I'm not seeing where the _init function > is detecting the presence of the driver (i.e. the environment) without > doing callthru() calls. There should be a way to detect the presence of > it before you start executing random instructions (which is what the > callthru is, right?) Right, it's missing from this version of the driver. Last we talked about this, the consensus was that the driver needs to look for of device nodes below "/mambo/" for each of the block devices it creates. Apparently this change has not yet found the way in yet. > Also, do you want to keep the Mambo naming in there, or move over to > systemsim? I would vote for moving everything over to 'systemsim' names, but I did not want to make big changes to the driver. I did change the file names as part of splitting up Eric's tree into separate patches with the Kconfig and Makefile changes in each of them. Arnd <>< From ericvh at gmail.com Mon Jan 16 03:32:35 2006 From: ericvh at gmail.com (Eric Van Hensbergen) Date: Sun, 15 Jan 2006 10:32:35 -0600 Subject: [patch 7/8] powerpc: hvc backend for systemsim In-Reply-To: <200601151311.22630.arndb@de.ibm.com> References: <20060113183033.696401000@localhost> <200601131841.33259.arndb@de.ibm.com> <20060114030500.GO2491@pb15.lixom.net> <200601151311.22630.arndb@de.ibm.com> Message-ID: On 1/15/06, Arnd Bergmann wrote: > On Saturday 14 January 2006 03:05, Olof Johansson wrote: > > The 'mambo' identifier should probably not appear in kernel > sources except when referring to the established '/mambo' > device node in the device tree. > I see no reason why we can't move /mambo in the device-tree to /systemsim. We'll just need to coordinate a bit to avoid breakage across the simulator. -eric From ericvh at gmail.com Mon Jan 16 03:40:53 2006 From: ericvh at gmail.com (Eric Van Hensbergen) Date: Sun, 15 Jan 2006 10:40:53 -0600 Subject: [patch 0/8] systemsim and hvc_console patches In-Reply-To: <200601151310.14135.arndb@de.ibm.com> References: <20060113183033.696401000@localhost> <20060114030907.GP2491@pb15.lixom.net> <200601151310.14135.arndb@de.ibm.com> Message-ID: On 1/15/06, Arnd Bergmann wrote: > > Overall I'm not sure how I feel about having hacks in the kernel for > > systemsim. If it's truly simulating the full system, why can't it simulate > > the disk device and network device as well instead of doing things with > > magic instructions like it does now? > > I think systemsim does have accurate models for a number of IDE and > network devices, but I would rather not have to use them because they will > run at a horribly slow speed, because they try to model the performance > of the devices relative to the CPU cycles. > We could probably produce some performance numbers on this from the simulator side, but the overall reports from the end-users were that non-bogus devices were really slow. That being said, I see no reason why they can't be available as a patch -- most folks using the simulator are building their own kernels anyways. > > For the cell simulator in particular, I think there is no model of the > spider-pic interrupt controller, which means that systemsim can not use > the models for the devices it uses on other platforms. Eric, is this still > correct? > I believe we have a model for the interrupt controller, but I'm not sure what its releasability status is from the STI-end of things. IIRC the real complication when we tried to use it (even for delivering interrupts to BogusNet) was problems with the firmware not being set up correctly to route the interrupts. This results in the Cell BogusNet having to run in polled mode (and having pretty poor performance as a result). There were some attempts by the simulator team to resolve this issue, but I'm not sure where they left it (so I'm copying them on this message to see if we can get a definitive answer). -eric From ericvh at gmail.com Mon Jan 16 03:42:12 2006 From: ericvh at gmail.com (Eric Van Hensbergen) Date: Sun, 15 Jan 2006 10:42:12 -0600 Subject: [patch 3/8] powerpc: cpu_idle implementation for systemsim In-Reply-To: <200601151244.11771.arndb@de.ibm.com> References: <20060113183033.696401000@localhost> <200601131841.16940.arndb@de.ibm.com> <20060114030139.GN2491@pb15.lixom.net> <200601151244.11771.arndb@de.ibm.com> Message-ID: On 1/15/06, Arnd Bergmann wrote: > On Saturday 14 January 2006 03:01, Olof Johansson wrote: > > > +config SYSTEMSIM_IDLE > > > +bool " Optimized idle loop for systemsim" > > > +depends on PPC_SYSTEMSIM > > > +help > > > + Selecting this option will enable an more optimized idle loop > > > + for running on the IBM Full System Simulator that > > > + significantly reduces the load on the host system when > > > + simulating an idle system. > > > > Do you really need this configured separately from the rest of > > systemsim? > > Maybe not. The idea here is that if you want cycle-accurate simulation > of the system, then you might want to use the regular idle loop > instead of the faster one, but you might still rely on one of the > device drivers. > This might also be best done as a kernel command-line argument or something that gets pulled from the device-tree. -eric From jdmason at us.ibm.com Mon Jan 16 05:33:39 2006 From: jdmason at us.ibm.com (Jon Mason) Date: Sun, 15 Jan 2006 12:33:39 -0600 Subject: [PATCH] trivial: modify comments to refer to new location of files In-Reply-To: References: <20060112180240.GB17539@us.ibm.com> <20060113114401.3289f33f.sfr@canb.auug.org.au> <20060115060716.GA2157@us.ibm.com> Message-ID: <20060115183334.GA17151@us.ibm.com> On Sun, Jan 15, 2006 at 01:42:12AM -0600, Kumar Gala wrote: > I'm with Stephen and we should probably just drop these. The problem > is (and I just did this myself) is that people use an existing file > as a template and duplicate whatever its doing. This patch (ie, the one below, not the original) removes all self references and fixes references to files in the now defunct arch/ppc64 tree. I think this accomplises everything wanted, though there might be a few references I missed. If me sending the new patch in this thread caused any confusion, I would be happy to send the new patch in a seperate thread. Thanks, Jon > > - kumar > > On Jan 15, 2006, at 12:07 AM, Jon Mason wrote: > > >On Fri, Jan 13, 2006 at 11:44:01AM +1100, Stephen Rothwell wrote: > >>Can we just remove these useless self references, please? > > > >Is this more towards your liking? > > > >Signed-off-by: Jon Mason > > > >diff -r 800442576617 Documentation/powerpc/eeh-pci-error-recovery.txt > >--- a/Documentation/powerpc/eeh-pci-error-recovery.txt Sat Jan 14 > >05:24:55 2006 > >+++ b/Documentation/powerpc/eeh-pci-error-recovery.txt Sat Jan 14 > >23:40:17 2006 > >@@ -121,7 +121,7 @@ > > > > EEH must be enabled in the PHB's very early during the boot process, > > and if a PCI slot is hot-plugged. The former is performed by > >-eeh_init() in arch/ppc64/kernel/eeh.c, and the later by > >+eeh_init() in arch/powerpc/platforms/pseries/eeh.c, and the later by > > drivers/pci/hotplug/pSeries_pci.c calling in to the eeh.c code. > > EEH must be enabled before a PCI scan of the device can proceed. > > Current Power5 hardware will not work unless EEH is enabled; > >@@ -133,7 +133,7 @@ > > pci_get_device_by_addr() will find the pci device associated > > with that address (if any). > > > >-The default include/asm-ppc64/io.h macros readb(), inb(), insb(), > >+The default include/asm-powerpc/io.h macros readb(), inb(), insb(), > > etc. include a check to see if the i/o read returned all-0xff's. > > If so, these make a call to eeh_dn_check_failure(), which in turn > > asks the firmware if the all-ff's value is the sign of a true EEH > >@@ -143,11 +143,12 @@ > > all of these occur during boot, when the PCI bus is scanned, where > > a large number of 0xff reads are part of the bus scan procedure. > > > >-If a frozen slot is detected, code in arch/ppc64/kernel/eeh.c will > >-print a stack trace to syslog (/var/log/messages). This stack trace > >-has proven to be very useful to device-driver authors for finding > >-out at what point the EEH error was detected, as the error itself > >-usually occurs slightly beforehand. > >+If a frozen slot is detected, code in > >+arch/powerpc/platforms/pseries/eeh.c will print a stack trace to > >+syslog (/var/log/messages). This stack trace has proven to be very > >+useful to device-driver authors for finding out at what point the EEH > >+error was detected, as the error itself usually occurs slightly > >+beforehand. > > > > Next, it uses the Linux kernel notifier chain/work queue mechanism to > > allow any interested parties to find out about the failure. Device > >diff -r 800442576617 arch/powerpc/boot/install.sh > >--- a/arch/powerpc/boot/install.sh Sat Jan 14 05:24:55 2006 > >+++ b/arch/powerpc/boot/install.sh Sat Jan 14 23:40:17 2006 > >@@ -1,6 +1,4 @@ > > #!/bin/sh > >-# > >-# arch/ppc64/boot/install.sh > > # > > # This file is subject to the terms and conditions of the GNU > >General Public > > # License. See the file "COPYING" in the main directory of this > >archive > >diff -r 800442576617 arch/powerpc/kernel/entry_64.S > >--- a/arch/powerpc/kernel/entry_64.S Sat Jan 14 05:24:55 2006 > >+++ b/arch/powerpc/kernel/entry_64.S Sat Jan 14 23:40:17 2006 > >@@ -1,6 +1,4 @@ > > /* > >- * arch/ppc64/kernel/entry.S > >- * > > * PowerPC version > > * Copyright (C) 1995-1996 Gary Thomas (gdt at linuxppc.org) > > * Rewritten by Cort Dougan (cort at cs.nmt.edu) for PReP > >@@ -374,7 +372,7 @@ > > * the fork code also. > > * > > * The code which creates the new task context is in 'copy_thread' > >- * in arch/ppc64/kernel/process.c > >+ * in arch/powerpc/kernel/process.c > > */ > > .align 7 > > _GLOBAL(_switch) > >diff -r 800442576617 arch/powerpc/kernel/head_44x.S > >--- a/arch/powerpc/kernel/head_44x.S Sat Jan 14 05:24:55 2006 > >+++ b/arch/powerpc/kernel/head_44x.S Sat Jan 14 23:40:17 2006 > >@@ -1,6 +1,4 @@ > > /* > >- * arch/ppc/kernel/head_44x.S > >- * > > * Kernel execution entry point code. > > * > > * Copyright (c) 1995-1996 Gary Thomas > >diff -r 800442576617 arch/powerpc/kernel/head_64.S > >--- a/arch/powerpc/kernel/head_64.S Sat Jan 14 05:24:55 2006 > >+++ b/arch/powerpc/kernel/head_64.S Sat Jan 14 23:40:17 2006 > >@@ -1,6 +1,4 @@ > > /* > >- * arch/ppc64/kernel/head.S > >- * > > * PowerPC version > > * Copyright (C) 1995-1996 Gary Thomas (gdt at linuxppc.org) > > * > >diff -r 800442576617 arch/powerpc/kernel/head_8xx.S > >--- a/arch/powerpc/kernel/head_8xx.S Sat Jan 14 05:24:55 2006 > >+++ b/arch/powerpc/kernel/head_8xx.S Sat Jan 14 23:40:17 2006 > >@@ -1,6 +1,4 @@ > > /* > >- * arch/ppc/kernel/except_8xx.S > >- * > > * PowerPC version > > * Copyright (C) 1995-1996 Gary Thomas (gdt at linuxppc.org) > > * Rewritten by Cort Dougan (cort at cs.nmt.edu) for PReP > >diff -r 800442576617 arch/powerpc/kernel/head_fsl_booke.S > >--- a/arch/powerpc/kernel/head_fsl_booke.S Sat Jan 14 05:24:55 2006 > >+++ b/arch/powerpc/kernel/head_fsl_booke.S Sat Jan 14 23:40:17 2006 > >@@ -1,6 +1,4 @@ > > /* > >- * arch/ppc/kernel/head_fsl_booke.S > >- * > > * Kernel execution entry point code. > > * > > * Copyright (c) 1995-1996 Gary Thomas > >diff -r 800442576617 arch/powerpc/kernel/iomap.c > >--- a/arch/powerpc/kernel/iomap.c Sat Jan 14 05:24:55 2006 > >+++ b/arch/powerpc/kernel/iomap.c Sat Jan 14 23:40:17 2006 > >@@ -1,6 +1,4 @@ > > /* > >- * arch/ppc64/kernel/iomap.c > >- * > > * ppc64 "iomap" interface implementation. > > * > > * (C) Copyright 2004 Linus Torvalds > >diff -r 800442576617 arch/powerpc/kernel/iommu.c > >--- a/arch/powerpc/kernel/iommu.c Sat Jan 14 05:24:55 2006 > >+++ b/arch/powerpc/kernel/iommu.c Sat Jan 14 23:40:17 2006 > >@@ -1,5 +1,4 @@ > > /* > >- * arch/ppc64/kernel/iommu.c > > * Copyright (C) 2001 Mike Corrigan & Dave Engebretsen, IBM > >Corporation > > * > > * Rewrite, cleanup, new allocation schemes, virtual merging: > >diff -r 800442576617 arch/powerpc/kernel/irq.c > >--- a/arch/powerpc/kernel/irq.c Sat Jan 14 05:24:55 2006 > >+++ b/arch/powerpc/kernel/irq.c Sat Jan 14 23:40:17 2006 > >@@ -1,6 +1,4 @@ > > /* > >- * arch/ppc/kernel/irq.c > >- * > > * Derived from arch/i386/kernel/irq.c > > * Copyright (C) 1992 Linus Torvalds > > * Adapted from arch/i386 by Gary Thomas > >diff -r 800442576617 arch/powerpc/kernel/kprobes.c > >--- a/arch/powerpc/kernel/kprobes.c Sat Jan 14 05:24:55 2006 > >+++ b/arch/powerpc/kernel/kprobes.c Sat Jan 14 23:40:17 2006 > >@@ -1,6 +1,5 @@ > > /* > > * Kernel Probes (KProbes) > >- * arch/ppc64/kernel/kprobes.c > > * > > * This program is free software; you can redistribute it and/or > >modify > > * it under the terms of the GNU General Public License as > >published by > >diff -r 800442576617 arch/powerpc/kernel/pci_iommu.c > >--- a/arch/powerpc/kernel/pci_iommu.c Sat Jan 14 05:24:55 2006 > >+++ b/arch/powerpc/kernel/pci_iommu.c Sat Jan 14 23:40:17 2006 > >@@ -1,5 +1,4 @@ > > /* > >- * arch/ppc64/kernel/pci_iommu.c > > * Copyright (C) 2001 Mike Corrigan & Dave Engebretsen, IBM > >Corporation > > * > > * Rewrite, cleanup, new allocation schemes: > >diff -r 800442576617 arch/powerpc/kernel/process.c > >--- a/arch/powerpc/kernel/process.c Sat Jan 14 05:24:55 2006 > >+++ b/arch/powerpc/kernel/process.c Sat Jan 14 23:40:17 2006 > >@@ -1,6 +1,4 @@ > > /* > >- * arch/ppc/kernel/process.c > >- * > > * Derived from "arch/i386/kernel/process.c" > > * Copyright (C) 1995 Linus Torvalds > > * > >diff -r 800442576617 arch/powerpc/kernel/ptrace-common.h > >--- a/arch/powerpc/kernel/ptrace-common.h Sat Jan 14 05:24:55 2006 > >+++ b/arch/powerpc/kernel/ptrace-common.h Sat Jan 14 23:40:17 2006 > >@@ -1,6 +1,4 @@ > > /* > >- * linux/arch/ppc64/kernel/ptrace-common.h > >- * > > * Copyright (c) 2002 Stephen Rothwell, IBM Coproration > > * Extracted from ptrace.c and ptrace32.c > > * > >diff -r 800442576617 arch/powerpc/kernel/rtas-proc.c > >--- a/arch/powerpc/kernel/rtas-proc.c Sat Jan 14 05:24:55 2006 > >+++ b/arch/powerpc/kernel/rtas-proc.c Sat Jan 14 23:40:17 2006 > >@@ -1,5 +1,4 @@ > > /* > >- * arch/ppc64/kernel/rtas-proc.c > > * Copyright (C) 2000 Tilmann Bitterberg > > * (tilmann at bitterberg.de) > > * > >diff -r 800442576617 arch/powerpc/kernel/rtas_pci.c > >--- a/arch/powerpc/kernel/rtas_pci.c Sat Jan 14 05:24:55 2006 > >+++ b/arch/powerpc/kernel/rtas_pci.c Sat Jan 14 23:40:17 2006 > >@@ -1,6 +1,4 @@ > > /* > >- * arch/ppc64/kernel/rtas_pci.c > >- * > > * Copyright (C) 2001 Dave Engebretsen, IBM Corporation > > * Copyright (C) 2003 Anton Blanchard , IBM > > * > >diff -r 800442576617 arch/powerpc/kernel/signal_64.c > >--- a/arch/powerpc/kernel/signal_64.c Sat Jan 14 05:24:55 2006 > >+++ b/arch/powerpc/kernel/signal_64.c Sat Jan 14 23:40:17 2006 > >@@ -1,6 +1,4 @@ > > /* > >- * linux/arch/ppc64/kernel/signal.c > >- * > > * PowerPC version > > * Copyright (C) 1995-1996 Gary Thomas (gdt at linuxppc.org) > > * > >diff -r 800442576617 arch/powerpc/kernel/vdso.c > >--- a/arch/powerpc/kernel/vdso.c Sat Jan 14 05:24:55 2006 > >+++ b/arch/powerpc/kernel/vdso.c Sat Jan 14 23:40:17 2006 > >@@ -1,6 +1,4 @@ > > /* > >- * linux/arch/ppc64/kernel/vdso.c > >- * > > * Copyright (C) 2004 Benjamin Herrenschmidt, IBM Corp. > > * > > * > >diff -r 800442576617 arch/powerpc/lib/copypage_64.S > >--- a/arch/powerpc/lib/copypage_64.S Sat Jan 14 05:24:55 2006 > >+++ b/arch/powerpc/lib/copypage_64.S Sat Jan 14 23:40:17 2006 > >@@ -1,6 +1,4 @@ > > /* > >- * arch/ppc64/lib/copypage.S > >- * > > * Copyright (C) 2002 Paul Mackerras, IBM Corp. > > * > > * This program is free software; you can redistribute it and/or > >diff -r 800442576617 arch/powerpc/lib/copyuser_64.S > >--- a/arch/powerpc/lib/copyuser_64.S Sat Jan 14 05:24:55 2006 > >+++ b/arch/powerpc/lib/copyuser_64.S Sat Jan 14 23:40:17 2006 > >@@ -1,6 +1,4 @@ > > /* > >- * arch/ppc64/lib/copyuser.S > >- * > > * Copyright (C) 2002 Paul Mackerras, IBM Corp. > > * > > * This program is free software; you can redistribute it and/or > >diff -r 800442576617 arch/powerpc/lib/e2a.c > >--- a/arch/powerpc/lib/e2a.c Sat Jan 14 05:24:55 2006 > >+++ b/arch/powerpc/lib/e2a.c Sat Jan 14 23:40:17 2006 > >@@ -1,9 +1,7 @@ > > /* > >- * arch/ppc64/lib/e2a.c > >- * > > * EBCDIC to ASCII conversion > > * > >- * This function moved here from arch/ppc64/kernel/viopath.c > >+ * This function moved here from arch/powerpc/platforms/iseries/ > >viopath.c > > * > > * (C) Copyright 2000-2004 IBM Corporation > > * > >diff -r 800442576617 arch/powerpc/lib/memcpy_64.S > >--- a/arch/powerpc/lib/memcpy_64.S Sat Jan 14 05:24:55 2006 > >+++ b/arch/powerpc/lib/memcpy_64.S Sat Jan 14 23:40:17 2006 > >@@ -1,6 +1,4 @@ > > /* > >- * arch/ppc64/lib/memcpy.S > >- * > > * Copyright (C) 2002 Paul Mackerras, IBM Corp. > > * > > * This program is free software; you can redistribute it and/or > >diff -r 800442576617 arch/powerpc/lib/rheap.c > >--- a/arch/powerpc/lib/rheap.c Sat Jan 14 05:24:55 2006 > >+++ b/arch/powerpc/lib/rheap.c Sat Jan 14 23:40:17 2006 > >@@ -1,6 +1,4 @@ > > /* > >- * arch/ppc/syslib/rheap.c > >- * > > * A Remote Heap. Remote means that we don't touch the memory > >that the > > * heap points to. Normal heap implementations use the memory they > >manage > > * to place their list. We cannot do that because the memory we > >manage may > >diff -r 800442576617 arch/powerpc/mm/fault.c > >--- a/arch/powerpc/mm/fault.c Sat Jan 14 05:24:55 2006 > >+++ b/arch/powerpc/mm/fault.c Sat Jan 14 23:40:17 2006 > >@@ -1,6 +1,4 @@ > > /* > >- * arch/ppc/mm/fault.c > >- * > > * PowerPC version > > * Copyright (C) 1995-1996 Gary Thomas (gdt at linuxppc.org) > > * > >diff -r 800442576617 arch/powerpc/mm/hash_low_32.S > >--- a/arch/powerpc/mm/hash_low_32.S Sat Jan 14 05:24:55 2006 > >+++ b/arch/powerpc/mm/hash_low_32.S Sat Jan 14 23:40:17 2006 > >@@ -1,6 +1,4 @@ > > /* > >- * arch/ppc/kernel/hashtable.S > >- * > > * $Id: hashtable.S,v 1.6 1999/10/08 01:56:15 paulus Exp $ > > * > > * PowerPC version > >diff -r 800442576617 arch/powerpc/mm/mmap.c > >--- a/arch/powerpc/mm/mmap.c Sat Jan 14 05:24:55 2006 > >+++ b/arch/powerpc/mm/mmap.c Sat Jan 14 23:40:17 2006 > >@@ -1,6 +1,4 @@ > > /* > >- * linux/arch/ppc64/mm/mmap.c > >- * > > * flexible mmap layout support > > * > > * Copyright 2003-2004 Red Hat Inc., Durham, North Carolina. > >diff -r 800442576617 arch/powerpc/mm/slb_low.S > >--- a/arch/powerpc/mm/slb_low.S Sat Jan 14 05:24:55 2006 > >+++ b/arch/powerpc/mm/slb_low.S Sat Jan 14 23:40:17 2006 > >@@ -1,6 +1,4 @@ > > /* > >- * arch/ppc64/mm/slb_low.S > >- * > > * Low-level SLB routines > > * > > * Copyright (C) 2004 David Gibson , IBM > >diff -r 800442576617 arch/powerpc/mm/tlb_64.c > >--- a/arch/powerpc/mm/tlb_64.c Sat Jan 14 05:24:55 2006 > >+++ b/arch/powerpc/mm/tlb_64.c Sat Jan 14 23:40:17 2006 > >@@ -36,7 +36,7 @@ > > DEFINE_PER_CPU(struct ppc64_tlb_batch, ppc64_tlb_batch); > > > > /* This is declared as we are using the more or less generic > >- * include/asm-ppc64/tlb.h file -- tgall > >+ * include/asm-powerpc/tlb.h file -- tgall > > */ > > DEFINE_PER_CPU(struct mmu_gather, mmu_gathers); > > DEFINE_PER_CPU(struct pte_freelist_batch *, pte_freelist_cur); > >diff -r 800442576617 arch/powerpc/platforms/chrp/pegasos_eth.c > >--- a/arch/powerpc/platforms/chrp/pegasos_eth.c Sat Jan 14 05:24:55 > >2006 > >+++ b/arch/powerpc/platforms/chrp/pegasos_eth.c Sat Jan 14 23:40:17 > >2006 > >@@ -1,6 +1,4 @@ > > /* > >- * arch/ppc/platforms/chrp_pegasos_eth.c > >- * > > * Copyright (C) 2005 Sven Luther > > * Thanks to : > > * Dale Farnsworth > >diff -r 800442576617 arch/powerpc/platforms/chrp/setup.c > >--- a/arch/powerpc/platforms/chrp/setup.c Sat Jan 14 05:24:55 2006 > >+++ b/arch/powerpc/platforms/chrp/setup.c Sat Jan 14 23:40:17 2006 > >@@ -1,6 +1,4 @@ > > /* > >- * arch/ppc/platforms/setup.c > >- * > > * Copyright (C) 1995 Linus Torvalds > > * Adapted from 'alpha' version by Gary Thomas > > * Modified by Cort Dougan (cort at cs.nmt.edu) > >diff -r 800442576617 arch/powerpc/platforms/chrp/time.c > >--- a/arch/powerpc/platforms/chrp/time.c Sat Jan 14 05:24:55 2006 > >+++ b/arch/powerpc/platforms/chrp/time.c Sat Jan 14 23:40:17 2006 > >@@ -1,6 +1,4 @@ > > /* > >- * arch/ppc/platforms/chrp_time.c > >- * > > * Copyright (C) 1991, 1992, 1995 Linus Torvalds > > * > > * Adapted for PowerPC (PReP) by Gary Thomas > >diff -r 800442576617 arch/powerpc/platforms/maple/time.c > >--- a/arch/powerpc/platforms/maple/time.c Sat Jan 14 05:24:55 2006 > >+++ b/arch/powerpc/platforms/maple/time.c Sat Jan 14 23:40:17 2006 > >@@ -1,6 +1,4 @@ > > /* > >- * arch/ppc64/kernel/maple_time.c > >- * > > * (c) Copyright 2004 Benjamin Herrenschmidt > >(benh at kernel.crashing.org), > > * IBM Corp. > > * > >diff -r 800442576617 arch/powerpc/platforms/powermac/cpufreq_32.c > >--- a/arch/powerpc/platforms/powermac/cpufreq_32.c Sat Jan 14 > >05:24:55 2006 > >+++ b/arch/powerpc/platforms/powermac/cpufreq_32.c Sat Jan 14 > >23:40:17 2006 > >@@ -1,6 +1,4 @@ > > /* > >- * arch/ppc/platforms/pmac_cpufreq.c > >- * > > * Copyright (C) 2002 - 2005 Benjamin Herrenschmidt > > > > * Copyright (C) 2004 John Steele Scott > > * > >diff -r 800442576617 arch/powerpc/platforms/powermac/feature.c > >--- a/arch/powerpc/platforms/powermac/feature.c Sat Jan 14 05:24:55 > >2006 > >+++ b/arch/powerpc/platforms/powermac/feature.c Sat Jan 14 23:40:17 > >2006 > >@@ -1,6 +1,4 @@ > > /* > >- * arch/ppc/platforms/pmac_feature.c > >- * > > * Copyright (C) 1996-2001 Paul Mackerras (paulus at cs.anu.edu.au) > > * Ben. Herrenschmidt > >(benh at kernel.crashing.org) > > * > >diff -r 800442576617 arch/powerpc/platforms/powermac/nvram.c > >--- a/arch/powerpc/platforms/powermac/nvram.c Sat Jan 14 05:24:55 2006 > >+++ b/arch/powerpc/platforms/powermac/nvram.c Sat Jan 14 23:40:17 2006 > >@@ -1,6 +1,4 @@ > > /* > >- * arch/ppc/platforms/pmac_nvram.c > >- * > > * Copyright (C) 2002 Benjamin Herrenschmidt > >(benh at kernel.crashing.org) > > * > > * This program is free software; you can redistribute it and/or > >diff -r 800442576617 arch/powerpc/platforms/pseries/hvCall.S > >--- a/arch/powerpc/platforms/pseries/hvCall.S Sat Jan 14 05:24:55 2006 > >+++ b/arch/powerpc/platforms/pseries/hvCall.S Sat Jan 14 23:40:17 2006 > >@@ -1,6 +1,4 @@ > > /* > >- * arch/ppc64/kernel/pSeries_hvCall.S > >- * > > * This file contains the generic code to perform a call to the > > * pSeries LPAR hypervisor. > > * NOTE: this file will go away when we move to inline this work. > >diff -r 800442576617 arch/powerpc/platforms/pseries/iommu.c > >--- a/arch/powerpc/platforms/pseries/iommu.c Sat Jan 14 05:24:55 2006 > >+++ b/arch/powerpc/platforms/pseries/iommu.c Sat Jan 14 23:40:17 2006 > >@@ -1,6 +1,4 @@ > > /* > >- * arch/ppc64/kernel/pSeries_iommu.c > >- * > > * Copyright (C) 2001 Mike Corrigan & Dave Engebretsen, IBM > >Corporation > > * > > * Rewrite, cleanup: > >diff -r 800442576617 arch/powerpc/platforms/pseries/pci.c > >--- a/arch/powerpc/platforms/pseries/pci.c Sat Jan 14 05:24:55 2006 > >+++ b/arch/powerpc/platforms/pseries/pci.c Sat Jan 14 23:40:17 2006 > >@@ -1,6 +1,4 @@ > > /* > >- * arch/ppc64/kernel/pSeries_pci.c > >- * > > * Copyright (C) 2001 Dave Engebretsen, IBM Corporation > > * Copyright (C) 2003 Anton Blanchard , IBM > > * > >diff -r 800442576617 arch/powerpc/sysdev/dcr.S > >--- a/arch/powerpc/sysdev/dcr.S Sat Jan 14 05:24:55 2006 > >+++ b/arch/powerpc/sysdev/dcr.S Sat Jan 14 23:40:17 2006 > >@@ -1,6 +1,4 @@ > > /* > >- * arch/ppc/syslib/dcr.S > >- * > > * "Indirect" DCR access > > * > > * Copyright (c) 2004 Eugene Surovegin > >diff -r 800442576617 arch/powerpc/sysdev/ipic.h > >--- a/arch/powerpc/sysdev/ipic.h Sat Jan 14 05:24:55 2006 > >+++ b/arch/powerpc/sysdev/ipic.h Sat Jan 14 23:40:17 2006 > >@@ -1,6 +1,4 @@ > > /* > >- * arch/ppc/kernel/ipic.h > >- * > > * IPIC private definitions and structure. > > * > > * Maintainer: Kumar Gala > >diff -r 800442576617 arch/ppc/4xx_io/serial_sicc.c > >--- a/arch/ppc/4xx_io/serial_sicc.c Sat Jan 14 05:24:55 2006 > >+++ b/arch/ppc/4xx_io/serial_sicc.c Sat Jan 14 23:40:17 2006 > >@@ -1,6 +1,4 @@ > > /* > >- * arch/ppc/4xx_io/serial_sicc.c > >- * > > * Driver for IBM STB3xxx SICC serial port > > * > > * Based on drivers/char/serial_amba.c, by ARM Ltd. > >diff -r 800442576617 arch/ppc/amiga/amiints.c > >--- a/arch/ppc/amiga/amiints.c Sat Jan 14 05:24:55 2006 > >+++ b/arch/ppc/amiga/amiints.c Sat Jan 14 23:40:17 2006 > >@@ -1,5 +1,5 @@ > > /* > >- * arch/ppc/amiga/amiints.c -- Amiga Linux interrupt handling code > >+ * Amiga Linux interrupt handling code > > * > > * This file is subject to the terms and conditions of the GNU > >General Public > > * License. See the file COPYING in the main directory of this > >archive > >diff -r 800442576617 arch/ppc/amiga/bootinfo.c > >--- a/arch/ppc/amiga/bootinfo.c Sat Jan 14 05:24:55 2006 > >+++ b/arch/ppc/amiga/bootinfo.c Sat Jan 14 23:40:17 2006 > >@@ -1,6 +1,4 @@ > > /* > >- * arch/ppc/amiga/bootinfo.c > >- * > > * Extracted from arch/m68k/kernel/setup.c. > > * Should be properly generalized and put somewhere else. > > * Jesper > >diff -r 800442576617 arch/ppc/amiga/cia.c > >--- a/arch/ppc/amiga/cia.c Sat Jan 14 05:24:55 2006 > >+++ b/arch/ppc/amiga/cia.c Sat Jan 14 23:40:17 2006 > >@@ -1,6 +1,4 @@ > > /* > >- * arch/ppc/amiga/cia.c - CIA support > >- * > > * Copyright (C) 1996 Roman Zippel > > * > > * The concept of some functions bases on the original Amiga OS > >function > >diff -r 800442576617 arch/ppc/amiga/ints.c > >--- a/arch/ppc/amiga/ints.c Sat Jan 14 05:24:55 2006 > >+++ b/arch/ppc/amiga/ints.c Sat Jan 14 23:40:17 2006 > >@@ -1,6 +1,4 @@ > > /* > >- * arch/ppc/amiga/ints.c > >- * > > * Linux/m68k general interrupt handling code from arch/m68k/ > >kernel/ints.c > > * Needed to drive the m68k emulating IRQ hardware on the PowerUp > >boards. > > */ > >diff -r 800442576617 arch/ppc/boot/Makefile > >--- a/arch/ppc/boot/Makefile Sat Jan 14 05:24:55 2006 > >+++ b/arch/ppc/boot/Makefile Sat Jan 14 23:40:17 2006 > >@@ -1,6 +1,3 @@ > >-# > >-# arch/ppc/boot/Makefile > >-# > > # This file is subject to the terms and conditions of the GNU > >General Public > > # License. See the file "COPYING" in the main directory of this > >archive > > # for more details. > >diff -r 800442576617 arch/ppc/boot/common/Makefile > >--- a/arch/ppc/boot/common/Makefile Sat Jan 14 05:24:55 2006 > >+++ b/arch/ppc/boot/common/Makefile Sat Jan 14 23:40:17 2006 > >@@ -1,6 +1,3 @@ > >-# > >-# arch/ppc/boot/common/Makefile > >-# > > # This file is subject to the terms and conditions of the GNU > >General Public > > # License. See the file "COPYING" in the main directory of this > >archive > > # for more details. > >diff -r 800442576617 arch/ppc/boot/common/bootinfo.c > >--- a/arch/ppc/boot/common/bootinfo.c Sat Jan 14 05:24:55 2006 > >+++ b/arch/ppc/boot/common/bootinfo.c Sat Jan 14 23:40:17 2006 > >@@ -1,6 +1,4 @@ > > /* > >- * arch/ppc/common/bootinfo.c > >- * > > * General bootinfo record utilities > > * Author: Randy Vinson > > * > >diff -r 800442576617 arch/ppc/boot/common/misc-common.c > >--- a/arch/ppc/boot/common/misc-common.c Sat Jan 14 05:24:55 2006 > >+++ b/arch/ppc/boot/common/misc-common.c Sat Jan 14 23:40:17 2006 > >@@ -1,6 +1,4 @@ > > /* > >- * arch/ppc/boot/common/misc-common.c > >- * > > * Misc. bootloader code (almost) all platforms can use > > * > > * Author: Johnnie Peters > >diff -r 800442576617 arch/ppc/boot/common/serial_stub.c > >--- a/arch/ppc/boot/common/serial_stub.c Sat Jan 14 05:24:55 2006 > >+++ b/arch/ppc/boot/common/serial_stub.c Sat Jan 14 23:40:17 2006 > >@@ -1,6 +1,4 @@ > > /* > >- * arch/ppc/boot/common/serial_stub.c > >- * > > * This is a few stub routines to make the boot code cleaner > >looking when > > * there is no serial port support doesn't need to be closed, for > >example. > > * > >diff -r 800442576617 arch/ppc/boot/common/util.S > >--- a/arch/ppc/boot/common/util.S Sat Jan 14 05:24:55 2006 > >+++ b/arch/ppc/boot/common/util.S Sat Jan 14 23:40:17 2006 > >@@ -1,6 +1,4 @@ > > /* > >- * arch/ppc/boot/common/util.S > >- * > > * Useful bootup functions, which are more easily done in asm than C. > > * > > * NOTE: Be very very careful about the registers you use here. > >diff -r 800442576617 arch/ppc/boot/include/mpc10x.h > >--- a/arch/ppc/boot/include/mpc10x.h Sat Jan 14 05:24:55 2006 > >+++ b/arch/ppc/boot/include/mpc10x.h Sat Jan 14 23:40:17 2006 > >@@ -1,6 +1,4 @@ > > /* > >- * arch/ppc/boot/include/mpc10.h > >- * > > * Common defines for the Motorola SPS MPC106/8240/107 Host bridge/ > >Mem > > * ctrl/EPIC/etc. > > * > >diff -r 800442576617 arch/ppc/boot/simple/cpc700_memory.c > >--- a/arch/ppc/boot/simple/cpc700_memory.c Sat Jan 14 05:24:55 2006 > >+++ b/arch/ppc/boot/simple/cpc700_memory.c Sat Jan 14 23:40:17 2006 > >@@ -1,6 +1,4 @@ > > /* > >- * arch/ppc/boot/common/cpc700_memory.c > >- * > > * Find memory based upon settings in the CPC700 bridge > > * > > * Author: Dan Cox > >diff -r 800442576617 arch/ppc/boot/simple/head.S > >--- a/arch/ppc/boot/simple/head.S Sat Jan 14 05:24:55 2006 > >+++ b/arch/ppc/boot/simple/head.S Sat Jan 14 23:40:17 2006 > >@@ -1,6 +1,4 @@ > > /* > >- * arch/ppc/boot/simple/head.S > >- * > > * Initial board bringup code for many different boards. > > * > > * Author: Tom Rini > >diff -r 800442576617 arch/ppc/boot/simple/misc-chestnut.c > >--- a/arch/ppc/boot/simple/misc-chestnut.c Sat Jan 14 05:24:55 2006 > >+++ b/arch/ppc/boot/simple/misc-chestnut.c Sat Jan 14 23:40:17 2006 > >@@ -1,6 +1,4 @@ > > /* > >- * arch/ppc/boot/simple/misc-chestnut.c > >- * > > * Setup for the IBM Chestnut (ibm-750fxgx_eval) > > * > > * Author: Mark A. Greer > >diff -r 800442576617 arch/ppc/boot/simple/misc-cpci690.c > >--- a/arch/ppc/boot/simple/misc-cpci690.c Sat Jan 14 05:24:55 2006 > >+++ b/arch/ppc/boot/simple/misc-cpci690.c Sat Jan 14 23:40:17 2006 > >@@ -1,6 +1,4 @@ > > /* > >- * arch/ppc/boot/simple/misc-cpci690.c > >- * > > * Add birec data for Force CPCI690 board. > > * > > * Author: Mark A. Greer > >diff -r 800442576617 arch/ppc/boot/simple/misc-ev64260.c > >--- a/arch/ppc/boot/simple/misc-ev64260.c Sat Jan 14 05:24:55 2006 > >+++ b/arch/ppc/boot/simple/misc-ev64260.c Sat Jan 14 23:40:17 2006 > >@@ -1,6 +1,4 @@ > > /* > >- * arch/ppc/boot/simple/misc-ev64260.c > >- * > > * Host bridge init code for the Marvell/Galileo EV-64260-BP > >evaluation board > > * with a GT64260 onboard. > > * > >diff -r 800442576617 arch/ppc/boot/simple/misc-ev64360.c > >--- a/arch/ppc/boot/simple/misc-ev64360.c Sat Jan 14 05:24:55 2006 > >+++ b/arch/ppc/boot/simple/misc-ev64360.c Sat Jan 14 23:40:17 2006 > >@@ -1,5 +1,4 @@ > > /* > >- * arch/ppc/boot/simple/misc-ev64360.c > > * Copyright (C) 2005 Lee Nicks > > * > > * Based on arch/ppc/boot/simple/misc-katana.c from: > >diff -r 800442576617 arch/ppc/boot/simple/misc-katana.c > >--- a/arch/ppc/boot/simple/misc-katana.c Sat Jan 14 05:24:55 2006 > >+++ b/arch/ppc/boot/simple/misc-katana.c Sat Jan 14 23:40:17 2006 > >@@ -1,6 +1,4 @@ > > /* > >- * arch/ppc/boot/simple/misc-katana.c > >- * > > * Set up MPSC values to bootwrapper can prompt user. > > * > > * Author: Mark A. Greer > >diff -r 800442576617 arch/ppc/boot/simple/misc-mv64x60.c > >--- a/arch/ppc/boot/simple/misc-mv64x60.c Sat Jan 14 05:24:55 2006 > >+++ b/arch/ppc/boot/simple/misc-mv64x60.c Sat Jan 14 23:40:17 2006 > >@@ -1,6 +1,4 @@ > > /* > >- * arch/ppc/boot/simple/misc-mv64x60.c > >- * > > * Relocate bridge's register base and call board specific routine. > > * > > * Author: Mark A. Greer > >diff -r 800442576617 arch/ppc/boot/simple/misc-prep.c > >--- a/arch/ppc/boot/simple/misc-prep.c Sat Jan 14 05:24:55 2006 > >+++ b/arch/ppc/boot/simple/misc-prep.c Sat Jan 14 23:40:17 2006 > >@@ -1,6 +1,4 @@ > > /* > >- * arch/ppc/boot/simple/misc-prep.c > >- * > > * Maintainer: Tom Rini > > * > > * In the past: Gary Thomas, Cort Dougan > >diff -r 800442576617 arch/ppc/boot/simple/misc-radstone_ppc7d.c > >--- a/arch/ppc/boot/simple/misc-radstone_ppc7d.c Sat Jan 14 > >05:24:55 2006 > >+++ b/arch/ppc/boot/simple/misc-radstone_ppc7d.c Sat Jan 14 > >23:40:17 2006 > >@@ -1,6 +1,4 @@ > > /* > >- * arch/ppc/boot/simple/misc-radstone_ppc7d.c > >- * > > * Misc data for Radstone PPC7D board. > > * > > * Author: James Chapman > >diff -r 800442576617 arch/ppc/boot/simple/misc-spruce.c > >--- a/arch/ppc/boot/simple/misc-spruce.c Sat Jan 14 05:24:55 2006 > >+++ b/arch/ppc/boot/simple/misc-spruce.c Sat Jan 14 23:40:17 2006 > >@@ -1,6 +1,4 @@ > > /* > >- * arch/ppc/boot/spruce/misc.c > >- * > > * Misc. bootloader code for IBM Spruce reference platform > > * > > * Authors: Johnnie Peters > >diff -r 800442576617 arch/ppc/boot/simple/misc.c > >--- a/arch/ppc/boot/simple/misc.c Sat Jan 14 05:24:55 2006 > >+++ b/arch/ppc/boot/simple/misc.c Sat Jan 14 23:40:17 2006 > >@@ -1,6 +1,4 @@ > > /* > >- * arch/ppc/simple/misc.c > >- * > > * Misc. bootloader code for many machines. This assumes you have > >are using > > * a 6xx/7xx/74xx CPU in your machine. This assumes the chunk of > >memory > > * below 8MB is free. Finally, it assumes you have a NS16550- > >style uart for > >diff -r 800442576617 arch/ppc/boot/simple/mpc10x_memory.c > >--- a/arch/ppc/boot/simple/mpc10x_memory.c Sat Jan 14 05:24:55 2006 > >+++ b/arch/ppc/boot/simple/mpc10x_memory.c Sat Jan 14 23:40:17 2006 > >@@ -1,6 +1,4 @@ > > /* > >- * arch/ppc/boot/common/mpc10x_common.c > >- * > > * A routine to find out how much memory the machine has. > > * > > * Based on: > >diff -r 800442576617 arch/ppc/boot/simple/mpc52xx_tty.c > >--- a/arch/ppc/boot/simple/mpc52xx_tty.c Sat Jan 14 05:24:55 2006 > >+++ b/arch/ppc/boot/simple/mpc52xx_tty.c Sat Jan 14 23:40:17 2006 > >@@ -1,6 +1,4 @@ > > /* > >- * arch/ppc/boot/simple/mpc52xx_tty.c > >- * > > * Minimal serial functions needed to send messages out a MPC52xx > > * Programmable Serial Controller (PSC). > > * > >diff -r 800442576617 arch/ppc/boot/simple/mv64x60_tty.c > >--- a/arch/ppc/boot/simple/mv64x60_tty.c Sat Jan 14 05:24:55 2006 > >+++ b/arch/ppc/boot/simple/mv64x60_tty.c Sat Jan 14 23:40:17 2006 > >@@ -1,6 +1,4 @@ > > /* > >- * arch/ppc/boot/simple/mv64x60_tty.c > >- * > > * Bootloader version of the embedded MPSC/UART driver for the > >Marvell 64x60. > > * Note: Due to a GT64260A erratum, DMA will be used for UART > >input (via SDMA). > > * > >diff -r 800442576617 arch/ppc/boot/simple/openbios.c > >--- a/arch/ppc/boot/simple/openbios.c Sat Jan 14 05:24:55 2006 > >+++ b/arch/ppc/boot/simple/openbios.c Sat Jan 14 23:40:17 2006 > >@@ -1,6 +1,4 @@ > > /* > >- * arch/ppc/boot/simple/openbios.c > >- * > > * Copyright (c) 2005 DENX Software Engineering > > * Stefan Roese > > * > >diff -r 800442576617 arch/ppc/boot/simple/relocate.S > >--- a/arch/ppc/boot/simple/relocate.S Sat Jan 14 05:24:55 2006 > >+++ b/arch/ppc/boot/simple/relocate.S Sat Jan 14 23:40:17 2006 > >@@ -1,6 +1,4 @@ > > /* > >- * arch/ppc/boot/simple/relocate.S > >- * > > * This is the common part of the loader relocation and > >initialization > > * process. All of the board/processor specific initialization is > > * done before we get here. > >diff -r 800442576617 arch/ppc/boot/utils/mkbugboot.c > >--- a/arch/ppc/boot/utils/mkbugboot.c Sat Jan 14 05:24:55 2006 > >+++ b/arch/ppc/boot/utils/mkbugboot.c Sat Jan 14 23:40:17 2006 > >@@ -1,6 +1,4 @@ > > /* > >- * arch/ppc/boot/utils/mkbugboot.c > >- * > > * Makes a Motorola PPCBUG ROM bootable image which can be flashed > > * into one of the FLASH banks on a Motorola PowerPlus board. > > * > >diff -r 800442576617 arch/ppc/kernel/head_44x.S > >--- a/arch/ppc/kernel/head_44x.S Sat Jan 14 05:24:55 2006 > >+++ b/arch/ppc/kernel/head_44x.S Sat Jan 14 23:40:17 2006 > >@@ -1,6 +1,4 @@ > > /* > >- * arch/ppc/kernel/head_44x.S > >- * > > * Kernel execution entry point code. > > * > > * Copyright (c) 1995-1996 Gary Thomas > >diff -r 800442576617 arch/ppc/kernel/head_8xx.S > >--- a/arch/ppc/kernel/head_8xx.S Sat Jan 14 05:24:55 2006 > >+++ b/arch/ppc/kernel/head_8xx.S Sat Jan 14 23:40:17 2006 > >@@ -1,6 +1,4 @@ > > /* > >- * arch/ppc/kernel/except_8xx.S > >- * > > * PowerPC version > > * Copyright (C) 1995-1996 Gary Thomas (gdt at linuxppc.org) > > * Rewritten by Cort Dougan (cort at cs.nmt.edu) for PReP > >diff -r 800442576617 arch/ppc/kernel/head_fsl_booke.S > >--- a/arch/ppc/kernel/head_fsl_booke.S Sat Jan 14 05:24:55 2006 > >+++ b/arch/ppc/kernel/head_fsl_booke.S Sat Jan 14 23:40:17 2006 > >@@ -1,6 +1,4 @@ > > /* > >- * arch/ppc/kernel/head_fsl_booke.S > >- * > > * Kernel execution entry point code. > > * > > * Copyright (c) 1995-1996 Gary Thomas > >diff -r 800442576617 arch/ppc/kernel/traps.c > >--- a/arch/ppc/kernel/traps.c Sat Jan 14 05:24:55 2006 > >+++ b/arch/ppc/kernel/traps.c Sat Jan 14 23:40:17 2006 > >@@ -1,6 +1,4 @@ > > /* > >- * arch/ppc/kernel/traps.c > >- * > > * Copyright (C) 1995-1996 Gary Thomas (gdt at linuxppc.org) > > * > > * This program is free software; you can redistribute it and/or > >diff -r 800442576617 arch/ppc/lib/rheap.c > >--- a/arch/ppc/lib/rheap.c Sat Jan 14 05:24:55 2006 > >+++ b/arch/ppc/lib/rheap.c Sat Jan 14 23:40:17 2006 > >@@ -1,6 +1,4 @@ > > /* > >- * arch/ppc/syslib/rheap.c > >- * > > * A Remote Heap. Remote means that we don't touch the memory > >that the > > * heap points to. Normal heap implementations use the memory they > >manage > > * to place their list. We cannot do that because the memory we > >manage may > >diff -r 800442576617 arch/ppc/math-emu/math.c > >--- a/arch/ppc/math-emu/math.c Sat Jan 14 05:24:55 2006 > >+++ b/arch/ppc/math-emu/math.c Sat Jan 14 23:40:17 2006 > >@@ -1,6 +1,4 @@ > > /* > >- * arch/ppc/math-emu/math.c > >- * > > * Copyright (C) 1999 Eddie C. Dost (ecd at atecom.com) > > */ > > > >diff -r 800442576617 arch/ppc/mm/fault.c > >--- a/arch/ppc/mm/fault.c Sat Jan 14 05:24:55 2006 > >+++ b/arch/ppc/mm/fault.c Sat Jan 14 23:40:17 2006 > >@@ -1,6 +1,4 @@ > > /* > >- * arch/ppc/mm/fault.c > >- * > > * PowerPC version > > * Copyright (C) 1995-1996 Gary Thomas (gdt at linuxppc.org) > > * > >diff -r 800442576617 arch/ppc/mm/hashtable.S > >--- a/arch/ppc/mm/hashtable.S Sat Jan 14 05:24:55 2006 > >+++ b/arch/ppc/mm/hashtable.S Sat Jan 14 23:40:17 2006 > >@@ -1,6 +1,4 @@ > > /* > >- * arch/ppc/kernel/hashtable.S > >- * > > * $Id: hashtable.S,v 1.6 1999/10/08 01:56:15 paulus Exp $ > > * > > * PowerPC version > >diff -r 800442576617 arch/ppc/platforms/4xx/bamboo.c > >--- a/arch/ppc/platforms/4xx/bamboo.c Sat Jan 14 05:24:55 2006 > >+++ b/arch/ppc/platforms/4xx/bamboo.c Sat Jan 14 23:40:17 2006 > >@@ -1,6 +1,4 @@ > > /* > >- * arch/ppc/platforms/4xx/bamboo.c > >- * > > * Bamboo board specific routines > > * > > * Wade Farnsworth > >diff -r 800442576617 arch/ppc/platforms/4xx/bamboo.h > >--- a/arch/ppc/platforms/4xx/bamboo.h Sat Jan 14 05:24:55 2006 > >+++ b/arch/ppc/platforms/4xx/bamboo.h Sat Jan 14 23:40:17 2006 > >@@ -1,6 +1,4 @@ > > /* > >- * arch/ppc/platforms/bamboo.h > >- * > > * Bamboo board definitions > > * > > * Wade Farnsworth > >diff -r 800442576617 arch/ppc/platforms/4xx/bubinga.h > >--- a/arch/ppc/platforms/4xx/bubinga.h Sat Jan 14 05:24:55 2006 > >+++ b/arch/ppc/platforms/4xx/bubinga.h Sat Jan 14 23:40:17 2006 > >@@ -1,6 +1,4 @@ > > /* > >- * arch/ppc/platforms/4xx/bubinga.h > >- * > > * Bubinga board definitions > > * > > * Copyright (c) 2005 DENX Software Engineering > >diff -r 800442576617 arch/ppc/platforms/4xx/cpci405.c > >--- a/arch/ppc/platforms/4xx/cpci405.c Sat Jan 14 05:24:55 2006 > >+++ b/arch/ppc/platforms/4xx/cpci405.c Sat Jan 14 23:40:17 2006 > >@@ -1,6 +1,4 @@ > > /* > >- * arch/ppc/platforms/cpci405.c > >- * > > * Board setup routines for the esd CPCI-405 cPCI Board. > > * > > * Author: Stefan Roese > >diff -r 800442576617 arch/ppc/platforms/4xx/ebony.c > >--- a/arch/ppc/platforms/4xx/ebony.c Sat Jan 14 05:24:55 2006 > >+++ b/arch/ppc/platforms/4xx/ebony.c Sat Jan 14 23:40:17 2006 > >@@ -1,6 +1,4 @@ > > /* > >- * arch/ppc/platforms/4xx/ebony.c > >- * > > * Ebony board specific routines > > * > > * Matt Porter > >diff -r 800442576617 arch/ppc/platforms/4xx/ebony.h > >--- a/arch/ppc/platforms/4xx/ebony.h Sat Jan 14 05:24:55 2006 > >+++ b/arch/ppc/platforms/4xx/ebony.h Sat Jan 14 23:40:17 2006 > >@@ -1,6 +1,4 @@ > > /* > >- * arch/ppc/platforms/ebony.h > >- * > > * Ebony board definitions > > * > > * Matt Porter > >diff -r 800442576617 arch/ppc/platforms/4xx/ep405.c > >--- a/arch/ppc/platforms/4xx/ep405.c Sat Jan 14 05:24:55 2006 > >+++ b/arch/ppc/platforms/4xx/ep405.c Sat Jan 14 23:40:17 2006 > >@@ -1,6 +1,4 @@ > > /* > >- * arch/ppc/platforms/4xx/ep405.c > >- * > > * Embedded Planet 405GP board > > * http://www.embeddedplanet.com > > * > >diff -r 800442576617 arch/ppc/platforms/4xx/ep405.h > >--- a/arch/ppc/platforms/4xx/ep405.h Sat Jan 14 05:24:55 2006 > >+++ b/arch/ppc/platforms/4xx/ep405.h Sat Jan 14 23:40:17 2006 > >@@ -1,6 +1,4 @@ > > /* > >- * arch/ppc/platforms/4xx/ep405.h > >- * > > * Embedded Planet 405GP board > > * http://www.embeddedplanet.com > > * > >diff -r 800442576617 arch/ppc/platforms/4xx/ibm405ep.c > >--- a/arch/ppc/platforms/4xx/ibm405ep.c Sat Jan 14 05:24:55 2006 > >+++ b/arch/ppc/platforms/4xx/ibm405ep.c Sat Jan 14 23:40:17 2006 > >@@ -1,6 +1,4 @@ > > /* > >- * arch/ppc/platforms/ibm405ep.c > >- * > > * Support for IBM PPC 405EP processors. > > * > > * Author: SAW (IBM), derived from ibmnp405l.c. > >diff -r 800442576617 arch/ppc/platforms/4xx/ibm405ep.h > >--- a/arch/ppc/platforms/4xx/ibm405ep.h Sat Jan 14 05:24:55 2006 > >+++ b/arch/ppc/platforms/4xx/ibm405ep.h Sat Jan 14 23:40:17 2006 > >@@ -1,6 +1,4 @@ > > /* > >- * arch/ppc/platforms/4xx/ibm405ep.h > >- * > > * IBM PPC 405EP processor defines. > > * > > * Author: SAW (IBM), derived from ibm405gp.h. > >diff -r 800442576617 arch/ppc/platforms/4xx/ibm405gp.h > >--- a/arch/ppc/platforms/4xx/ibm405gp.h Sat Jan 14 05:24:55 2006 > >+++ b/arch/ppc/platforms/4xx/ibm405gp.h Sat Jan 14 23:40:17 2006 > >@@ -1,6 +1,4 @@ > > /* > >- * arch/ppc/platforms/4xx/ibm405gp.h > >- * > > * Author: Armin Kuster akuster at mvista.com > > * > > * 2001 (c) MontaVista, Software, Inc. This file is licensed under > >diff -r 800442576617 arch/ppc/platforms/4xx/ibm405gpr.c > >--- a/arch/ppc/platforms/4xx/ibm405gpr.c Sat Jan 14 05:24:55 2006 > >+++ b/arch/ppc/platforms/4xx/ibm405gpr.c Sat Jan 14 23:40:17 2006 > >@@ -1,6 +1,4 @@ > > /* > >- * arch/ppc/platforms/4xx/ibm405gpr.c > >- * > > * Author: Armin Kuster > > * > > * 2002 (c) MontaVista, Software, Inc. This file is licensed under > >diff -r 800442576617 arch/ppc/platforms/4xx/ibm405gpr.h > >--- a/arch/ppc/platforms/4xx/ibm405gpr.h Sat Jan 14 05:24:55 2006 > >+++ b/arch/ppc/platforms/4xx/ibm405gpr.h Sat Jan 14 23:40:17 2006 > >@@ -1,6 +1,4 @@ > > /* > >- * arch/ppc/platforms/4xx/ibm405gpr.h > >- * > > * Author: Armin Kuster > > * > > * 2002 (c) MontaVista, Software, Inc. This file is licensed under > >diff -r 800442576617 arch/ppc/platforms/4xx/ibm440ep.c > >--- a/arch/ppc/platforms/4xx/ibm440ep.c Sat Jan 14 05:24:55 2006 > >+++ b/arch/ppc/platforms/4xx/ibm440ep.c Sat Jan 14 23:40:17 2006 > >@@ -1,6 +1,4 @@ > > /* > >- * arch/ppc/platforms/4xx/ibm440ep.c > >- * > > * PPC440EP I/O descriptions > > * > > * Wade Farnsworth > >diff -r 800442576617 arch/ppc/platforms/4xx/ibm440ep.h > >--- a/arch/ppc/platforms/4xx/ibm440ep.h Sat Jan 14 05:24:55 2006 > >+++ b/arch/ppc/platforms/4xx/ibm440ep.h Sat Jan 14 23:40:17 2006 > >@@ -1,6 +1,4 @@ > > /* > >- * arch/ppc/platforms/4xx/ibm440ep.h > >- * > > * PPC440EP definitions > > * > > * Wade Farnsworth > >diff -r 800442576617 arch/ppc/platforms/4xx/ibm440gp.c > >--- a/arch/ppc/platforms/4xx/ibm440gp.c Sat Jan 14 05:24:55 2006 > >+++ b/arch/ppc/platforms/4xx/ibm440gp.c Sat Jan 14 23:40:17 2006 > >@@ -1,6 +1,4 @@ > > /* > >- * arch/ppc/platforms/4xx/ibm440gp.c > >- * > > * PPC440GP I/O descriptions > > * > > * Matt Porter > >diff -r 800442576617 arch/ppc/platforms/4xx/ibm440gp.h > >--- a/arch/ppc/platforms/4xx/ibm440gp.h Sat Jan 14 05:24:55 2006 > >+++ b/arch/ppc/platforms/4xx/ibm440gp.h Sat Jan 14 23:40:17 2006 > >@@ -1,6 +1,4 @@ > > /* > >- * arch/ppc/platforms/4xx/ibm440gp.h > >- * > > * PPC440GP definitions > > * > > * Roland Dreier > >diff -r 800442576617 arch/ppc/platforms/4xx/ibm440gx.c > >--- a/arch/ppc/platforms/4xx/ibm440gx.c Sat Jan 14 05:24:55 2006 > >+++ b/arch/ppc/platforms/4xx/ibm440gx.c Sat Jan 14 23:40:17 2006 > >@@ -1,6 +1,4 @@ > > /* > >- * arch/ppc/platforms/4xx/ibm440gx.c > >- * > > * PPC440GX I/O descriptions > > * > > * Matt Porter > >diff -r 800442576617 arch/ppc/platforms/4xx/ibm440gx.h > >--- a/arch/ppc/platforms/4xx/ibm440gx.h Sat Jan 14 05:24:55 2006 > >+++ b/arch/ppc/platforms/4xx/ibm440gx.h Sat Jan 14 23:40:17 2006 > >@@ -1,6 +1,4 @@ > > /* > >- * arch/ppc/platforms/ibm440gx.h > >- * > > * PPC440GX definitions > > * > > * Matt Porter > >diff -r 800442576617 arch/ppc/platforms/4xx/ibm440sp.c > >--- a/arch/ppc/platforms/4xx/ibm440sp.c Sat Jan 14 05:24:55 2006 > >+++ b/arch/ppc/platforms/4xx/ibm440sp.c Sat Jan 14 23:40:17 2006 > >@@ -1,6 +1,4 @@ > > /* > >- * arch/ppc/platforms/4xx/ibm440sp.c > >- * > > * PPC440SP I/O descriptions > > * > > * Matt Porter > >diff -r 800442576617 arch/ppc/platforms/4xx/ibm440sp.h > >--- a/arch/ppc/platforms/4xx/ibm440sp.h Sat Jan 14 05:24:55 2006 > >+++ b/arch/ppc/platforms/4xx/ibm440sp.h Sat Jan 14 23:40:17 2006 > >@@ -1,6 +1,4 @@ > > /* > >- * arch/ppc/platforms/4xx/ibm440sp.h > >- * > > * PPC440SP definitions > > * > > * Matt Porter > >diff -r 800442576617 arch/ppc/platforms/4xx/ibmnp405h.c > >--- a/arch/ppc/platforms/4xx/ibmnp405h.c Sat Jan 14 05:24:55 2006 > >+++ b/arch/ppc/platforms/4xx/ibmnp405h.c Sat Jan 14 23:40:17 2006 > >@@ -1,6 +1,4 @@ > > /* > >- * arch/ppc/platforms/4xx/ibmnp405h.c > >- * > > * Author: Armin Kuster > > * > > * 2000-2002 (c) MontaVista, Software, Inc. This file is licensed > >under > >diff -r 800442576617 arch/ppc/platforms/4xx/ibmnp405h.h > >--- a/arch/ppc/platforms/4xx/ibmnp405h.h Sat Jan 14 05:24:55 2006 > >+++ b/arch/ppc/platforms/4xx/ibmnp405h.h Sat Jan 14 23:40:17 2006 > >@@ -1,6 +1,4 @@ > > /* > >- * arch/ppc/platforms/4xx/ibmnp405h.h > >- * > > * Author: Armin Kuster > > * > > * 2002 (c) MontaVista, Software, Inc. This file is licensed under > >diff -r 800442576617 arch/ppc/platforms/4xx/ibmstb4.c > >--- a/arch/ppc/platforms/4xx/ibmstb4.c Sat Jan 14 05:24:55 2006 > >+++ b/arch/ppc/platforms/4xx/ibmstb4.c Sat Jan 14 23:40:17 2006 > >@@ -1,6 +1,4 @@ > > /* > >- * arch/ppc/platforms/4xx/ibmstb4.c > >- * > > * Author: Armin Kuster > > * > > * 2000-2001 (c) MontaVista, Software, Inc. This file is licensed > >under > >diff -r 800442576617 arch/ppc/platforms/4xx/ibmstb4.h > >--- a/arch/ppc/platforms/4xx/ibmstb4.h Sat Jan 14 05:24:55 2006 > >+++ b/arch/ppc/platforms/4xx/ibmstb4.h Sat Jan 14 23:40:17 2006 > >@@ -1,6 +1,4 @@ > > /* > >- * arch/ppc/platforms/4xx/ibmstb4.h > >- * > > * Author: Armin Kuster > > * > > * 2001 (c) MontaVista, Software, Inc. This file is licensed under > >diff -r 800442576617 arch/ppc/platforms/4xx/ibmstbx25.c > >--- a/arch/ppc/platforms/4xx/ibmstbx25.c Sat Jan 14 05:24:55 2006 > >+++ b/arch/ppc/platforms/4xx/ibmstbx25.c Sat Jan 14 23:40:17 2006 > >@@ -1,6 +1,4 @@ > > /* > >- * arch/ppc/platforms/4xx/ibmstbx25.c > >- * > > * Author: Armin Kuster > > * > > * 2000-2002 (c) MontaVista, Software, Inc. This file is licensed > >under > >diff -r 800442576617 arch/ppc/platforms/4xx/ibmstbx25.h > >--- a/arch/ppc/platforms/4xx/ibmstbx25.h Sat Jan 14 05:24:55 2006 > >+++ b/arch/ppc/platforms/4xx/ibmstbx25.h Sat Jan 14 23:40:17 2006 > >@@ -1,6 +1,4 @@ > > /* > >- * arch/ppc/platforms/4xx/ibmstbx25.h > >- * > > * Author: Armin Kuster > > * > > * 2002 (c) MontaVista, Software, Inc. This file is licensed under > >diff -r 800442576617 arch/ppc/platforms/4xx/luan.c > >--- a/arch/ppc/platforms/4xx/luan.c Sat Jan 14 05:24:55 2006 > >+++ b/arch/ppc/platforms/4xx/luan.c Sat Jan 14 23:40:17 2006 > >@@ -1,6 +1,4 @@ > > /* > >- * arch/ppc/platforms/4xx/luan.c > >- * > > * Luan board specific routines > > * > > * Matt Porter > >diff -r 800442576617 arch/ppc/platforms/4xx/luan.h > >--- a/arch/ppc/platforms/4xx/luan.h Sat Jan 14 05:24:55 2006 > >+++ b/arch/ppc/platforms/4xx/luan.h Sat Jan 14 23:40:17 2006 > >@@ -1,6 +1,4 @@ > > /* > >- * arch/ppc/platforms/4xx/luan.h > >- * > > * Luan board definitions > > * > > * Matt Porter > >diff -r 800442576617 arch/ppc/platforms/4xx/ocotea.c > >--- a/arch/ppc/platforms/4xx/ocotea.c Sat Jan 14 05:24:55 2006 > >+++ b/arch/ppc/platforms/4xx/ocotea.c Sat Jan 14 23:40:17 2006 > >@@ -1,6 +1,4 @@ > > /* > >- * arch/ppc/platforms/4xx/ocotea.c > >- * > > * Ocotea board specific routines > > * > > * Matt Porter > >diff -r 800442576617 arch/ppc/platforms/4xx/ocotea.h > >--- a/arch/ppc/platforms/4xx/ocotea.h Sat Jan 14 05:24:55 2006 > >+++ b/arch/ppc/platforms/4xx/ocotea.h Sat Jan 14 23:40:17 2006 > >@@ -1,6 +1,4 @@ > > /* > >- * arch/ppc/platforms/ocotea.h > >- * > > * Ocotea board definitions > > * > > * Matt Porter > >diff -r 800442576617 arch/ppc/platforms/4xx/ppc440spe.c > >--- a/arch/ppc/platforms/4xx/ppc440spe.c Sat Jan 14 05:24:55 2006 > >+++ b/arch/ppc/platforms/4xx/ppc440spe.c Sat Jan 14 23:40:17 2006 > >@@ -1,6 +1,4 @@ > > /* > >- * arch/ppc/platforms/4xx/ppc440spe.c > >- * > > * PPC440SPe I/O descriptions > > * > > * Roland Dreier > >diff -r 800442576617 arch/ppc/platforms/4xx/ppc440spe.h > >--- a/arch/ppc/platforms/4xx/ppc440spe.h Sat Jan 14 05:24:55 2006 > >+++ b/arch/ppc/platforms/4xx/ppc440spe.h Sat Jan 14 23:40:17 2006 > >@@ -1,6 +1,4 @@ > > /* > >- * arch/ppc/platforms/4xx/ibm440spe.h > >- * > > * PPC440SPe definitions > > * > > * Roland Dreier > >diff -r 800442576617 arch/ppc/platforms/4xx/redwood5.c > >--- a/arch/ppc/platforms/4xx/redwood5.c Sat Jan 14 05:24:55 2006 > >+++ b/arch/ppc/platforms/4xx/redwood5.c Sat Jan 14 23:40:17 2006 > >@@ -1,6 +1,4 @@ > > /* > >- * arch/ppc/platforms/4xx/redwood5.c > >- * > > * Support for the IBM redwood5 eval board file > > * > > * Author: Armin Kuster > >diff -r 800442576617 arch/ppc/platforms/4xx/redwood5.h > >--- a/arch/ppc/platforms/4xx/redwood5.h Sat Jan 14 05:24:55 2006 > >+++ b/arch/ppc/platforms/4xx/redwood5.h Sat Jan 14 23:40:17 2006 > >@@ -1,6 +1,4 @@ > > /* > >- * arch/ppc/platforms/4xx/redwood5.h > >- * > > * Macros, definitions, and data structures specific to the IBM > >PowerPC > > * STB03xxx "Redwood" evaluation board. > > * > >diff -r 800442576617 arch/ppc/platforms/4xx/redwood6.c > >--- a/arch/ppc/platforms/4xx/redwood6.c Sat Jan 14 05:24:55 2006 > >+++ b/arch/ppc/platforms/4xx/redwood6.c Sat Jan 14 23:40:17 2006 > >@@ -1,6 +1,4 @@ > > /* > >- * arch/ppc/platforms/4xx/redwood6.c > >- * > > * Author: Armin Kuster > > * > > * 2002 (c) MontaVista, Software, Inc. This file is licensed under > >diff -r 800442576617 arch/ppc/platforms/4xx/redwood6.h > >--- a/arch/ppc/platforms/4xx/redwood6.h Sat Jan 14 05:24:55 2006 > >+++ b/arch/ppc/platforms/4xx/redwood6.h Sat Jan 14 23:40:17 2006 > >@@ -1,6 +1,4 @@ > > /* > >- * arch/ppc/platforms/4xx/redwood6.h > >- * > > * Macros, definitions, and data structures specific to the IBM > >PowerPC > > * STBx25xx "Redwood6" evaluation board. > > * > >diff -r 800442576617 arch/ppc/platforms/4xx/sycamore.c > >--- a/arch/ppc/platforms/4xx/sycamore.c Sat Jan 14 05:24:55 2006 > >+++ b/arch/ppc/platforms/4xx/sycamore.c Sat Jan 14 23:40:17 2006 > >@@ -1,6 +1,4 @@ > > /* > >- * arch/ppc/platforms/4xx/sycamore.c > >- * > > * Architecture- / platform-specific boot-time initialization code > >for > > * IBM PowerPC 4xx based boards. > > * > >diff -r 800442576617 arch/ppc/platforms/4xx/sycamore.h > >--- a/arch/ppc/platforms/4xx/sycamore.h Sat Jan 14 05:24:55 2006 > >+++ b/arch/ppc/platforms/4xx/sycamore.h Sat Jan 14 23:40:17 2006 > >@@ -1,6 +1,4 @@ > > /* > >- * arch/ppc/platforms/4xx/sycamore.h > >- * > > * Sycamore board definitions > > * > > * Copyright (c) 2005 DENX Software Engineering > >diff -r 800442576617 arch/ppc/platforms/4xx/virtex-ii_pro.c > >--- a/arch/ppc/platforms/4xx/virtex-ii_pro.c Sat Jan 14 05:24:55 2006 > >+++ b/arch/ppc/platforms/4xx/virtex-ii_pro.c Sat Jan 14 23:40:17 2006 > >@@ -1,6 +1,4 @@ > > /* > >- * arch/ppc/platforms/4xx/virtex-ii_pro.c > >- * > > * Author: MontaVista Software, Inc. > > * source at mvista.com > > * > >diff -r 800442576617 arch/ppc/platforms/4xx/virtex-ii_pro.h > >--- a/arch/ppc/platforms/4xx/virtex-ii_pro.h Sat Jan 14 05:24:55 2006 > >+++ b/arch/ppc/platforms/4xx/virtex-ii_pro.h Sat Jan 14 23:40:17 2006 > >@@ -1,6 +1,4 @@ > > /* > >- * arch/ppc/platforms/4xx/virtex-ii_pro.h > >- * > > * Include file that defines the Xilinx Virtex-II Pro processor > > * > > * Author: MontaVista Software, Inc. > >diff -r 800442576617 arch/ppc/platforms/4xx/walnut.c > >--- a/arch/ppc/platforms/4xx/walnut.c Sat Jan 14 05:24:55 2006 > >+++ b/arch/ppc/platforms/4xx/walnut.c Sat Jan 14 23:40:17 2006 > >@@ -1,6 +1,4 @@ > > /* > >- * arch/ppc/platforms/4xx/walnut.c > >- * > > * Architecture- / platform-specific boot-time initialization code > >for > > * IBM PowerPC 4xx based boards. Adapted from original > > * code by Gary Thomas, Cort Dougan , and Dan Malek > >diff -r 800442576617 arch/ppc/platforms/4xx/walnut.h > >--- a/arch/ppc/platforms/4xx/walnut.h Sat Jan 14 05:24:55 2006 > >+++ b/arch/ppc/platforms/4xx/walnut.h Sat Jan 14 23:40:17 2006 > >@@ -1,6 +1,4 @@ > > /* > >- * arch/ppc/platforms/4xx/walnut.h > >- * > > * Walnut board definitions > > * > > * Copyright (c) 2005 DENX Software Engineering > >diff -r 800442576617 arch/ppc/platforms/4xx/xilinx_ml300.c > >--- a/arch/ppc/platforms/4xx/xilinx_ml300.c Sat Jan 14 05:24:55 2006 > >+++ b/arch/ppc/platforms/4xx/xilinx_ml300.c Sat Jan 14 23:40:17 2006 > >@@ -1,6 +1,4 @@ > > /* > >- * arch/ppc/platforms/4xx/xilinx_ml300.c > >- * > > * Xilinx ML300 evaluation board initialization > > * > > * Author: MontaVista Software, Inc. > >diff -r 800442576617 arch/ppc/platforms/4xx/xilinx_ml300.h > >--- a/arch/ppc/platforms/4xx/xilinx_ml300.h Sat Jan 14 05:24:55 2006 > >+++ b/arch/ppc/platforms/4xx/xilinx_ml300.h Sat Jan 14 23:40:17 2006 > >@@ -1,6 +1,4 @@ > > /* > >- * arch/ppc/platforms/4xx/xilinx_ml300.h > >- * > > * Include file that defines the Xilinx ML300 evaluation board > > * > > * Author: MontaVista Software, Inc. > >diff -r 800442576617 arch/ppc/platforms/4xx/yucca.c > >--- a/arch/ppc/platforms/4xx/yucca.c Sat Jan 14 05:24:55 2006 > >+++ b/arch/ppc/platforms/4xx/yucca.c Sat Jan 14 23:40:17 2006 > >@@ -1,6 +1,4 @@ > > /* > >- * arch/ppc/platforms/4xx/yucca.c > >- * > > * Yucca board specific routines > > * > > * Roland Dreier (based on luan.c by Matt Porter) > >diff -r 800442576617 arch/ppc/platforms/4xx/yucca.h > >--- a/arch/ppc/platforms/4xx/yucca.h Sat Jan 14 05:24:55 2006 > >+++ b/arch/ppc/platforms/4xx/yucca.h Sat Jan 14 23:40:17 2006 > >@@ -1,6 +1,4 @@ > > /* > >- * arch/ppc/platforms/4xx/yucca.h > >- * > > * Yucca board definitions > > * > > * Roland Dreier (based on luan.h by Matt Porter) > >diff -r 800442576617 arch/ppc/platforms/83xx/mpc834x_sys.c > >--- a/arch/ppc/platforms/83xx/mpc834x_sys.c Sat Jan 14 05:24:55 2006 > >+++ b/arch/ppc/platforms/83xx/mpc834x_sys.c Sat Jan 14 23:40:17 2006 > >@@ -1,6 +1,4 @@ > > /* > >- * arch/ppc/platforms/83xx/mpc834x_sys.c > >- * > > * MPC834x SYS board specific routines > > * > > * Maintainer: Kumar Gala > >diff -r 800442576617 arch/ppc/platforms/83xx/mpc834x_sys.h > >--- a/arch/ppc/platforms/83xx/mpc834x_sys.h Sat Jan 14 05:24:55 2006 > >+++ b/arch/ppc/platforms/83xx/mpc834x_sys.h Sat Jan 14 23:40:17 2006 > >@@ -1,6 +1,4 @@ > > /* > >- * arch/ppc/platforms/83xx/mpc834x_sys.h > >- * > > * MPC834X SYS common board definitions > > * > > * Maintainer: Kumar Gala > >diff -r 800442576617 arch/ppc/platforms/85xx/mpc8540_ads.c > >--- a/arch/ppc/platforms/85xx/mpc8540_ads.c Sat Jan 14 05:24:55 2006 > >+++ b/arch/ppc/platforms/85xx/mpc8540_ads.c Sat Jan 14 23:40:17 2006 > >@@ -1,6 +1,4 @@ > > /* > >- * arch/ppc/platforms/85xx/mpc8540_ads.c > >- * > > * MPC8540ADS board specific routines > > * > > * Maintainer: Kumar Gala > >diff -r 800442576617 arch/ppc/platforms/85xx/mpc8540_ads.h > >--- a/arch/ppc/platforms/85xx/mpc8540_ads.h Sat Jan 14 05:24:55 2006 > >+++ b/arch/ppc/platforms/85xx/mpc8540_ads.h Sat Jan 14 23:40:17 2006 > >@@ -1,6 +1,4 @@ > > /* > >- * arch/ppc/platforms/85xx/mpc8540_ads.h > >- * > > * MPC8540ADS board definitions > > * > > * Maintainer: Kumar Gala > >diff -r 800442576617 arch/ppc/platforms/85xx/mpc8555_cds.h > >--- a/arch/ppc/platforms/85xx/mpc8555_cds.h Sat Jan 14 05:24:55 2006 > >+++ b/arch/ppc/platforms/85xx/mpc8555_cds.h Sat Jan 14 23:40:17 2006 > >@@ -1,6 +1,4 @@ > > /* > >- * arch/ppc/platforms/mpc8555_cds.h > >- * > > * MPC8555CDS board definitions > > * > > * Maintainer: Kumar Gala > >diff -r 800442576617 arch/ppc/platforms/85xx/mpc8560_ads.c > >--- a/arch/ppc/platforms/85xx/mpc8560_ads.c Sat Jan 14 05:24:55 2006 > >+++ b/arch/ppc/platforms/85xx/mpc8560_ads.c Sat Jan 14 23:40:17 2006 > >@@ -1,6 +1,4 @@ > > /* > >- * arch/ppc/platforms/85xx/mpc8560_ads.c > >- * > > * MPC8560ADS board specific routines > > * > > * Maintainer: Kumar Gala > >diff -r 800442576617 arch/ppc/platforms/85xx/mpc8560_ads.h > >--- a/arch/ppc/platforms/85xx/mpc8560_ads.h Sat Jan 14 05:24:55 2006 > >+++ b/arch/ppc/platforms/85xx/mpc8560_ads.h Sat Jan 14 23:40:17 2006 > >@@ -1,6 +1,4 @@ > > /* > >- * arch/ppc/platforms/mpc8560_ads.h > >- * > > * MPC8540ADS board definitions > > * > > * Maintainer: Kumar Gala > >diff -r 800442576617 arch/ppc/platforms/85xx/mpc85xx_ads_common.c > >--- a/arch/ppc/platforms/85xx/mpc85xx_ads_common.c Sat Jan 14 > >05:24:55 2006 > >+++ b/arch/ppc/platforms/85xx/mpc85xx_ads_common.c Sat Jan 14 > >23:40:17 2006 > >@@ -1,6 +1,4 @@ > > /* > >- * arch/ppc/platforms/85xx/mpc85xx_ads_common.c > >- * > > * MPC85xx ADS board common routines > > * > > * Maintainer: Kumar Gala > >diff -r 800442576617 arch/ppc/platforms/85xx/mpc85xx_ads_common.h > >--- a/arch/ppc/platforms/85xx/mpc85xx_ads_common.h Sat Jan 14 > >05:24:55 2006 > >+++ b/arch/ppc/platforms/85xx/mpc85xx_ads_common.h Sat Jan 14 > >23:40:17 2006 > >@@ -1,6 +1,4 @@ > > /* > >- * arch/ppc/platforms/85xx/mpc85xx_ads_common.h > >- * > > * MPC85XX ADS common board definitions > > * > > * Maintainer: Kumar Gala > >diff -r 800442576617 arch/ppc/platforms/85xx/mpc85xx_cds_common.c > >--- a/arch/ppc/platforms/85xx/mpc85xx_cds_common.c Sat Jan 14 > >05:24:55 2006 > >+++ b/arch/ppc/platforms/85xx/mpc85xx_cds_common.c Sat Jan 14 > >23:40:17 2006 > >@@ -1,6 +1,4 @@ > > /* > >- * arch/ppc/platform/85xx/mpc85xx_cds_common.c > >- * > > * MPC85xx CDS board specific routines > > * > > * Maintainer: Kumar Gala > >diff -r 800442576617 arch/ppc/platforms/85xx/mpc85xx_cds_common.h > >--- a/arch/ppc/platforms/85xx/mpc85xx_cds_common.h Sat Jan 14 > >05:24:55 2006 > >+++ b/arch/ppc/platforms/85xx/mpc85xx_cds_common.h Sat Jan 14 > >23:40:17 2006 > >@@ -1,6 +1,4 @@ > > /* > >- * arch/ppc/platforms/85xx/mpc85xx_cds_common.h > >- * > > * MPC85xx CDS board definitions > > * > > * Maintainer: Kumar Gala > >diff -r 800442576617 arch/ppc/platforms/85xx/sbc8560.c > >--- a/arch/ppc/platforms/85xx/sbc8560.c Sat Jan 14 05:24:55 2006 > >+++ b/arch/ppc/platforms/85xx/sbc8560.c Sat Jan 14 23:40:17 2006 > >@@ -1,6 +1,4 @@ > > /* > >- * arch/ppc/platforms/85xx/sbc8560.c > >- * > > * Wind River SBC8560 board specific routines > > * > > * Maintainer: Kumar Gala > >diff -r 800442576617 arch/ppc/platforms/85xx/sbc8560.h > >--- a/arch/ppc/platforms/85xx/sbc8560.h Sat Jan 14 05:24:55 2006 > >+++ b/arch/ppc/platforms/85xx/sbc8560.h Sat Jan 14 23:40:17 2006 > >@@ -1,6 +1,4 @@ > > /* > >- * arch/ppc/platforms/85xx/sbc8560.h > >- * > > * Wind River SBC8560 board definitions > > * > > * Copyright 2003 Motorola Inc. > >diff -r 800442576617 arch/ppc/platforms/85xx/sbc85xx.c > >--- a/arch/ppc/platforms/85xx/sbc85xx.c Sat Jan 14 05:24:55 2006 > >+++ b/arch/ppc/platforms/85xx/sbc85xx.c Sat Jan 14 23:40:17 2006 > >@@ -1,6 +1,4 @@ > > /* > >- * arch/ppc/platform/85xx/sbc85xx.c > >- * > > * WindRiver PowerQUICC III SBC85xx board common routines > > * > > * Copyright 2002, 2003 Motorola Inc. > >diff -r 800442576617 arch/ppc/platforms/85xx/sbc85xx.h > >--- a/arch/ppc/platforms/85xx/sbc85xx.h Sat Jan 14 05:24:55 2006 > >+++ b/arch/ppc/platforms/85xx/sbc85xx.h Sat Jan 14 23:40:17 2006 > >@@ -1,6 +1,4 @@ > > /* > >- * arch/ppc/platforms/85xx/sbc85xx.h > >- * > > * WindRiver PowerQUICC III SBC85xx common board definitions > > * > > * Copyright 2003 Motorola Inc. > >diff -r 800442576617 arch/ppc/platforms/85xx/stx_gp3.c > >--- a/arch/ppc/platforms/85xx/stx_gp3.c Sat Jan 14 05:24:55 2006 > >+++ b/arch/ppc/platforms/85xx/stx_gp3.c Sat Jan 14 23:40:17 2006 > >@@ -1,6 +1,4 @@ > > /* > >- * arch/ppc/platforms/85xx/stx_gp3.c > >- * > > * STx GP3 board specific routines > > * > > * Dan Malek > >diff -r 800442576617 arch/ppc/platforms/85xx/stx_gp3.h > >--- a/arch/ppc/platforms/85xx/stx_gp3.h Sat Jan 14 05:24:55 2006 > >+++ b/arch/ppc/platforms/85xx/stx_gp3.h Sat Jan 14 23:40:17 2006 > >@@ -1,6 +1,4 @@ > > /* > >- * arch/ppc/platforms/stx8560_gp3.h > >- * > > * STx GP3 board definitions > > * > > * Dan Malek (dan at embeddededge.com) > >diff -r 800442576617 arch/ppc/platforms/85xx/tqm85xx.c > >--- a/arch/ppc/platforms/85xx/tqm85xx.c Sat Jan 14 05:24:55 2006 > >+++ b/arch/ppc/platforms/85xx/tqm85xx.c Sat Jan 14 23:40:17 2006 > >@@ -1,6 +1,4 @@ > > /* > >- * arch/ppc/platforms/85xx/tqm85xx.c > >- * > > * TQM85xx (40/41/55/60) board specific routines > > * > > * Copyright (c) 2005 DENX Software Engineering > >diff -r 800442576617 arch/ppc/platforms/85xx/tqm85xx.h > >--- a/arch/ppc/platforms/85xx/tqm85xx.h Sat Jan 14 05:24:55 2006 > >+++ b/arch/ppc/platforms/85xx/tqm85xx.h Sat Jan 14 23:40:17 2006 > >@@ -1,6 +1,4 @@ > > /* > >- * arch/ppc/platforms/85xx/tqm85xx.h > >- * > > * TQM85xx (40/41/55/60) board definitions > > * > > * Copyright (c) 2005 DENX Software Engineering > >diff -r 800442576617 arch/ppc/platforms/apus_setup.c > >--- a/arch/ppc/platforms/apus_setup.c Sat Jan 14 05:24:55 2006 > >+++ b/arch/ppc/platforms/apus_setup.c Sat Jan 14 23:40:17 2006 > >@@ -1,6 +1,4 @@ > > /* > >- * arch/ppc/platforms/apus_setup.c > >- * > > * Copyright (C) 1998, 1999 Jesper Skov > > * > > * Basically what is needed to replace functionality found in > >diff -r 800442576617 arch/ppc/platforms/chestnut.c > >--- a/arch/ppc/platforms/chestnut.c Sat Jan 14 05:24:55 2006 > >+++ b/arch/ppc/platforms/chestnut.c Sat Jan 14 23:40:17 2006 > >@@ -1,6 +1,4 @@ > > /* > >- * arch/ppc/platforms/chestnut.c > >- * > > * Board setup routines for IBM Chestnut > > * > > * Author: > >diff -r 800442576617 arch/ppc/platforms/chestnut.h > >--- a/arch/ppc/platforms/chestnut.h Sat Jan 14 05:24:55 2006 > >+++ b/arch/ppc/platforms/chestnut.h Sat Jan 14 23:40:17 2006 > >@@ -1,6 +1,4 @@ > > /* > >- * arch/ppc/platforms/chestnut.h > >- * > > * Definitions for IBM 750FXGX Eval (Chestnut) > > * > > * Author: > >diff -r 800442576617 arch/ppc/platforms/chrp_pegasos_eth.c > >--- a/arch/ppc/platforms/chrp_pegasos_eth.c Sat Jan 14 05:24:55 2006 > >+++ b/arch/ppc/platforms/chrp_pegasos_eth.c Sat Jan 14 23:40:17 2006 > >@@ -1,6 +1,4 @@ > > /* > >- * arch/ppc/platforms/chrp_pegasos_eth.c > >- * > > * Copyright (C) 2005 Sven Luther > > * Thanks to : > > * Dale Farnsworth > >diff -r 800442576617 arch/ppc/platforms/chrp_setup.c > >--- a/arch/ppc/platforms/chrp_setup.c Sat Jan 14 05:24:55 2006 > >+++ b/arch/ppc/platforms/chrp_setup.c Sat Jan 14 23:40:17 2006 > >@@ -1,6 +1,4 @@ > > /* > >- * arch/ppc/platforms/setup.c > >- * > > * Copyright (C) 1995 Linus Torvalds > > * Adapted from 'alpha' version by Gary Thomas > > * Modified by Cort Dougan (cort at cs.nmt.edu) > >diff -r 800442576617 arch/ppc/platforms/chrp_time.c > >--- a/arch/ppc/platforms/chrp_time.c Sat Jan 14 05:24:55 2006 > >+++ b/arch/ppc/platforms/chrp_time.c Sat Jan 14 23:40:17 2006 > >@@ -1,6 +1,4 @@ > > /* > >- * arch/ppc/platforms/chrp_time.c > >- * > > * Copyright (C) 1991, 1992, 1995 Linus Torvalds > > * > > * Adapted for PowerPC (PReP) by Gary Thomas > >diff -r 800442576617 arch/ppc/platforms/cpci690.c > >--- a/arch/ppc/platforms/cpci690.c Sat Jan 14 05:24:55 2006 > >+++ b/arch/ppc/platforms/cpci690.c Sat Jan 14 23:40:17 2006 > >@@ -1,6 +1,4 @@ > > /* > >- * arch/ppc/platforms/cpci690.c > >- * > > * Board setup routines for the Force CPCI690 board. > > * > > * Author: Mark A. Greer > >diff -r 800442576617 arch/ppc/platforms/cpci690.h > >--- a/arch/ppc/platforms/cpci690.h Sat Jan 14 05:24:55 2006 > >+++ b/arch/ppc/platforms/cpci690.h Sat Jan 14 23:40:17 2006 > >@@ -1,6 +1,4 @@ > > /* > >- * arch/ppc/platforms/cpci690.h > >- * > > * Definitions for Force CPCI690 > > * > > * Author: Mark A. Greer > >diff -r 800442576617 arch/ppc/platforms/ev64260.c > >--- a/arch/ppc/platforms/ev64260.c Sat Jan 14 05:24:55 2006 > >+++ b/arch/ppc/platforms/ev64260.c Sat Jan 14 23:40:17 2006 > >@@ -1,6 +1,4 @@ > > /* > >- * arch/ppc/platforms/ev64260.c > >- * > > * Board setup routines for the Marvell/Galileo EV-64260-BP > >Evaluation Board. > > * > > * Author: Mark A. Greer > >diff -r 800442576617 arch/ppc/platforms/ev64260.h > >--- a/arch/ppc/platforms/ev64260.h Sat Jan 14 05:24:55 2006 > >+++ b/arch/ppc/platforms/ev64260.h Sat Jan 14 23:40:17 2006 > >@@ -1,6 +1,4 @@ > > /* > >- * arch/ppc/platforms/ev64260.h > >- * > > * Definitions for Marvell/Galileo EV-64260-BP Evaluation Board. > > * > > * Author: Mark A. Greer > >diff -r 800442576617 arch/ppc/platforms/ev64360.c > >--- a/arch/ppc/platforms/ev64360.c Sat Jan 14 05:24:55 2006 > >+++ b/arch/ppc/platforms/ev64360.c Sat Jan 14 23:40:17 2006 > >@@ -1,6 +1,4 @@ > > /* > >- * arch/ppc/platforms/ev64360.c > >- * > > * Board setup routines for the Marvell EV-64360-BP Evaluation Board. > > * > > * Author: Lee Nicks > >diff -r 800442576617 arch/ppc/platforms/ev64360.h > >--- a/arch/ppc/platforms/ev64360.h Sat Jan 14 05:24:55 2006 > >+++ b/arch/ppc/platforms/ev64360.h Sat Jan 14 23:40:17 2006 > >@@ -1,6 +1,4 @@ > > /* > >- * arch/ppc/platforms/ev64360.h > >- * > > * Definitions for Marvell EV-64360-BP Evaluation Board. > > * > > * Author: Lee Nicks > >diff -r 800442576617 arch/ppc/platforms/gemini.h > >--- a/arch/ppc/platforms/gemini.h Sat Jan 14 05:24:55 2006 > >+++ b/arch/ppc/platforms/gemini.h Sat Jan 14 23:40:17 2006 > >@@ -1,7 +1,4 @@ > > /* > >- * arch/ppc/platforms/gemini.h > >- * > >- * > > * Onboard registers and descriptions for Synergy Microsystems' > > * "Gemini" boards. > > * > >diff -r 800442576617 arch/ppc/platforms/gemini_prom.S > >--- a/arch/ppc/platforms/gemini_prom.S Sat Jan 14 05:24:55 2006 > >+++ b/arch/ppc/platforms/gemini_prom.S Sat Jan 14 23:40:17 2006 > >@@ -1,6 +1,4 @@ > > /* > >- * arch/ppc/platforms/gemini_prom.S > >- * > > * Not really prom support code (yet), but sort of anti-prom > >code. The current > > * bootloader does a number of things it shouldn't and doesn't do > >things that it > > * should. The stuff in here is mainly a hodge-podge collection > >of setup code > >diff -r 800442576617 arch/ppc/platforms/gemini_setup.c > >--- a/arch/ppc/platforms/gemini_setup.c Sat Jan 14 05:24:55 2006 > >+++ b/arch/ppc/platforms/gemini_setup.c Sat Jan 14 23:40:17 2006 > >@@ -1,6 +1,4 @@ > > /* > >- * arch/ppc/platforms/gemini_setup.c > >- * > > * Copyright (C) 1995 Linus Torvalds > > * Adapted from 'alpha' version by Gary Thomas > > * Modified by Cort Dougan (cort at cs.nmt.edu) > >diff -r 800442576617 arch/ppc/platforms/hdpu.c > >--- a/arch/ppc/platforms/hdpu.c Sat Jan 14 05:24:55 2006 > >+++ b/arch/ppc/platforms/hdpu.c Sat Jan 14 23:40:17 2006 > >@@ -1,7 +1,4 @@ > >- > > /* > >- * arch/ppc/platforms/hdpu_setup.c > >- * > > * Board setup routines for the Sky Computers HDPU Compute Blade. > > * > > * Written by Brian Waite > >diff -r 800442576617 arch/ppc/platforms/hdpu.h > >--- a/arch/ppc/platforms/hdpu.h Sat Jan 14 05:24:55 2006 > >+++ b/arch/ppc/platforms/hdpu.h Sat Jan 14 23:40:17 2006 > >@@ -1,6 +1,4 @@ > > /* > >- * arch/ppc/platforms/hdpu.h > >- * > > * Definitions for Sky Computers HDPU board. > > * > > * Brian Waite > >diff -r 800442576617 arch/ppc/platforms/katana.c > >--- a/arch/ppc/platforms/katana.c Sat Jan 14 05:24:55 2006 > >+++ b/arch/ppc/platforms/katana.c Sat Jan 14 23:40:17 2006 > >@@ -1,6 +1,4 @@ > > /* > >- * arch/ppc/platforms/katana.c > >- * > > * Board setup routines for the Artesyn Katana cPCI boards. > > * > > * Author: Tim Montgomery > >diff -r 800442576617 arch/ppc/platforms/katana.h > >--- a/arch/ppc/platforms/katana.h Sat Jan 14 05:24:55 2006 > >+++ b/arch/ppc/platforms/katana.h Sat Jan 14 23:40:17 2006 > >@@ -1,6 +1,4 @@ > > /* > >- * arch/ppc/platforms/katana.h > >- * > > * Definitions for Artesyn Katana750i/3750 board. > > * > > * Author: Tim Montgomery > >diff -r 800442576617 arch/ppc/platforms/lite5200.c > >--- a/arch/ppc/platforms/lite5200.c Sat Jan 14 05:24:55 2006 > >+++ b/arch/ppc/platforms/lite5200.c Sat Jan 14 23:40:17 2006 > >@@ -1,6 +1,4 @@ > > /* > >- * arch/ppc/platforms/lite5200.c > >- * > > * Platform support file for the Freescale LITE5200 based on MPC52xx. > > * A maximum of this file should be moved to syslib/mpc52xx_????? > > * so that new platform based on MPC52xx need a minimal platform file > >diff -r 800442576617 arch/ppc/platforms/lite5200.h > >--- a/arch/ppc/platforms/lite5200.h Sat Jan 14 05:24:55 2006 > >+++ b/arch/ppc/platforms/lite5200.h Sat Jan 14 23:40:17 2006 > >@@ -1,6 +1,4 @@ > > /* > >- * arch/ppc/platforms/lite5200.h > >- * > > * Definitions for Freescale LITE5200 : MPC52xx Standard Development > > * Platform board support > > * > >diff -r 800442576617 arch/ppc/platforms/lopec.c > >--- a/arch/ppc/platforms/lopec.c Sat Jan 14 05:24:55 2006 > >+++ b/arch/ppc/platforms/lopec.c Sat Jan 14 23:40:17 2006 > >@@ -1,6 +1,4 @@ > > /* > >- * arch/ppc/platforms/lopec.c > >- * > > * Setup routines for the Motorola LoPEC. > > * > > * Author: Dan Cox > >diff -r 800442576617 arch/ppc/platforms/mvme5100.c > >--- a/arch/ppc/platforms/mvme5100.c Sat Jan 14 05:24:55 2006 > >+++ b/arch/ppc/platforms/mvme5100.c Sat Jan 14 23:40:17 2006 > >@@ -1,6 +1,4 @@ > > /* > >- * arch/ppc/platforms/mvme5100.c > >- * > > * Board setup routines for the Motorola MVME5100. > > * > > * Author: Matt Porter > >diff -r 800442576617 arch/ppc/platforms/pal4.h > >--- a/arch/ppc/platforms/pal4.h Sat Jan 14 05:24:55 2006 > >+++ b/arch/ppc/platforms/pal4.h Sat Jan 14 23:40:17 2006 > >@@ -1,6 +1,4 @@ > > /* > >- * arch/ppc/platforms/pal4.h > >- * > > * Definitions for SBS Palomar IV board > > * > > * Author: Dan Cox > >diff -r 800442576617 arch/ppc/platforms/pal4_pci.c > >--- a/arch/ppc/platforms/pal4_pci.c Sat Jan 14 05:24:55 2006 > >+++ b/arch/ppc/platforms/pal4_pci.c Sat Jan 14 23:40:17 2006 > >@@ -1,6 +1,4 @@ > > /* > >- * arch/ppc/platforms/pal4_pci.c > >- * > > * PCI support for SBS Palomar IV > > * > > * Author: Dan Cox > >diff -r 800442576617 arch/ppc/platforms/pal4_serial.h > >--- a/arch/ppc/platforms/pal4_serial.h Sat Jan 14 05:24:55 2006 > >+++ b/arch/ppc/platforms/pal4_serial.h Sat Jan 14 23:40:17 2006 > >@@ -1,6 +1,4 @@ > > /* > >- * arch/ppc/platforms/pal4_serial.h > >- * > > * Definitions for SBS PalomarIV serial support > > * > > * Author: Dan Cox > >diff -r 800442576617 arch/ppc/platforms/pal4_setup.c > >--- a/arch/ppc/platforms/pal4_setup.c Sat Jan 14 05:24:55 2006 > >+++ b/arch/ppc/platforms/pal4_setup.c Sat Jan 14 23:40:17 2006 > >@@ -1,6 +1,4 @@ > > /* > >- * arch/ppc/platforms/pal4_setup.c > >- * > > * Board setup routines for the SBS PalomarIV. > > * > > * Author: Dan Cox > >diff -r 800442576617 arch/ppc/platforms/pmac_cpufreq.c > >--- a/arch/ppc/platforms/pmac_cpufreq.c Sat Jan 14 05:24:55 2006 > >+++ b/arch/ppc/platforms/pmac_cpufreq.c Sat Jan 14 23:40:17 2006 > >@@ -1,6 +1,4 @@ > > /* > >- * arch/ppc/platforms/pmac_cpufreq.c > >- * > > * Copyright (C) 2002 - 2005 Benjamin Herrenschmidt > > > > * Copyright (C) 2004 John Steele Scott > > * > >diff -r 800442576617 arch/ppc/platforms/pmac_feature.c > >--- a/arch/ppc/platforms/pmac_feature.c Sat Jan 14 05:24:55 2006 > >+++ b/arch/ppc/platforms/pmac_feature.c Sat Jan 14 23:40:17 2006 > >@@ -1,6 +1,4 @@ > > /* > >- * arch/ppc/platforms/pmac_feature.c > >- * > > * Copyright (C) 1996-2001 Paul Mackerras (paulus at cs.anu.edu.au) > > * Ben. Herrenschmidt > >(benh at kernel.crashing.org) > > * > >diff -r 800442576617 arch/ppc/platforms/pmac_low_i2c.c > >--- a/arch/ppc/platforms/pmac_low_i2c.c Sat Jan 14 05:24:55 2006 > >+++ b/arch/ppc/platforms/pmac_low_i2c.c Sat Jan 14 23:40:17 2006 > >@@ -1,6 +1,4 @@ > > /* > >- * arch/ppc/platforms/pmac_low_i2c.c > >- * > > * Copyright (C) 2003 Ben. Herrenschmidt (benh at kernel.crashing.org) > > * > > * This program is free software; you can redistribute it and/or > >diff -r 800442576617 arch/ppc/platforms/pmac_nvram.c > >--- a/arch/ppc/platforms/pmac_nvram.c Sat Jan 14 05:24:55 2006 > >+++ b/arch/ppc/platforms/pmac_nvram.c Sat Jan 14 23:40:17 2006 > >@@ -1,6 +1,4 @@ > > /* > >- * arch/ppc/platforms/pmac_nvram.c > >- * > > * Copyright (C) 2002 Benjamin Herrenschmidt > >(benh at kernel.crashing.org) > > * > > * This program is free software; you can redistribute it and/or > >diff -r 800442576617 arch/ppc/platforms/pmac_setup.c > >--- a/arch/ppc/platforms/pmac_setup.c Sat Jan 14 05:24:55 2006 > >+++ b/arch/ppc/platforms/pmac_setup.c Sat Jan 14 23:40:17 2006 > >@@ -1,6 +1,4 @@ > > /* > >- * arch/ppc/platforms/setup.c > >- * > > * PowerPC version > > * Copyright (C) 1995-1996 Gary Thomas (gdt at linuxppc.org) > > * > >diff -r 800442576617 arch/ppc/platforms/powerpmc250.c > >--- a/arch/ppc/platforms/powerpmc250.c Sat Jan 14 05:24:55 2006 > >+++ b/arch/ppc/platforms/powerpmc250.c Sat Jan 14 23:40:17 2006 > >@@ -1,6 +1,4 @@ > > /* > >- * arch/ppc/platforms/powerpmc250.c > >- * > > * Board setup routines for Force PowerPMC-250 Processor PMC > > * > > * Author: Troy Benjegerdes > >diff -r 800442576617 arch/ppc/platforms/pplus.c > >--- a/arch/ppc/platforms/pplus.c Sat Jan 14 05:24:55 2006 > >+++ b/arch/ppc/platforms/pplus.c Sat Jan 14 23:40:17 2006 > >@@ -1,6 +1,4 @@ > > /* > >- * arch/ppc/platforms/pplus.c > >- * > > * Board and PCI setup routines for MCG PowerPlus > > * > > * Author: Randy Vinson > >diff -r 800442576617 arch/ppc/platforms/pplus.h > >--- a/arch/ppc/platforms/pplus.h Sat Jan 14 05:24:55 2006 > >+++ b/arch/ppc/platforms/pplus.h Sat Jan 14 23:40:17 2006 > >@@ -1,6 +1,4 @@ > > /* > >- * arch/ppc/platforms/pplus.h > >- * > > * Definitions for Motorola MCG Falcon/Raven & HAWK North Bridge & > >Memory ctlr. > > * > > * Author: Mark A. Greerinclude/asm-ppc/hawk.h > >diff -r 800442576617 arch/ppc/platforms/pq2ads.c > >--- a/arch/ppc/platforms/pq2ads.c Sat Jan 14 05:24:55 2006 > >+++ b/arch/ppc/platforms/pq2ads.c Sat Jan 14 23:40:17 2006 > >@@ -1,6 +1,4 @@ > > /* > >- * arch/ppc/platforms/pq2ads.c > >- * > > * PQ2ADS platform support > > * > > * Author: Kumar Gala > >diff -r 800442576617 arch/ppc/platforms/prep_setup.c > >--- a/arch/ppc/platforms/prep_setup.c Sat Jan 14 05:24:55 2006 > >+++ b/arch/ppc/platforms/prep_setup.c Sat Jan 14 23:40:17 2006 > >@@ -1,6 +1,4 @@ > > /* > >- * arch/ppc/platforms/setup.c > >- * > > * Copyright (C) 1995 Linus Torvalds > > * Adapted from 'alpha' version by Gary Thomas > > * Modified by Cort Dougan (cort at cs.nmt.edu) > >diff -r 800442576617 arch/ppc/platforms/prpmc750.c > >--- a/arch/ppc/platforms/prpmc750.c Sat Jan 14 05:24:55 2006 > >+++ b/arch/ppc/platforms/prpmc750.c Sat Jan 14 23:40:17 2006 > >@@ -1,6 +1,4 @@ > > /* > >- * arch/ppc/platforms/prpmc750_setup.c > >- * > > * Board setup routines for Motorola PrPMC750 > > * > > * Author: Matt Porter > >diff -r 800442576617 arch/ppc/platforms/prpmc800.c > >--- a/arch/ppc/platforms/prpmc800.c Sat Jan 14 05:24:55 2006 > >+++ b/arch/ppc/platforms/prpmc800.c Sat Jan 14 23:40:17 2006 > >@@ -1,6 +1,4 @@ > > /* > >- * arch/ppc/platforms/prpmc800.c > >- * > > * Author: Dale Farnsworth > > * > > * 2001-2004 (c) MontaVista, Software, Inc. This file is licensed > >under > >diff -r 800442576617 arch/ppc/platforms/radstone_ppc7d.c > >--- a/arch/ppc/platforms/radstone_ppc7d.c Sat Jan 14 05:24:55 2006 > >+++ b/arch/ppc/platforms/radstone_ppc7d.c Sat Jan 14 23:40:17 2006 > >@@ -1,6 +1,4 @@ > > /* > >- * arch/ppc/platforms/radstone_ppc7d.c > >- * > > * Board setup routines for the Radstone PPC7D boards. > > * > > * Author: James Chapman > >diff -r 800442576617 arch/ppc/platforms/radstone_ppc7d.h > >--- a/arch/ppc/platforms/radstone_ppc7d.h Sat Jan 14 05:24:55 2006 > >+++ b/arch/ppc/platforms/radstone_ppc7d.h Sat Jan 14 23:40:17 2006 > >@@ -1,6 +1,4 @@ > > /* > >- * arch/ppc/platforms/radstone_ppc7d.h > >- * > > * Board definitions for the Radstone PPC7D boards. > > * > > * Author: James Chapman > >diff -r 800442576617 arch/ppc/platforms/sandpoint.c > >--- a/arch/ppc/platforms/sandpoint.c Sat Jan 14 05:24:55 2006 > >+++ b/arch/ppc/platforms/sandpoint.c Sat Jan 14 23:40:17 2006 > >@@ -1,6 +1,4 @@ > > /* > >- * arch/ppc/platforms/sandpoint_setup.c > >- * > > * Board setup routines for the Motorola SPS Sandpoint Test Platform. > > * > > * Author: Mark A. Greer > >diff -r 800442576617 arch/ppc/platforms/sandpoint.h > >--- a/arch/ppc/platforms/sandpoint.h Sat Jan 14 05:24:55 2006 > >+++ b/arch/ppc/platforms/sandpoint.h Sat Jan 14 23:40:17 2006 > >@@ -1,6 +1,4 @@ > > /* > >- * arch/ppc/platforms/sandpoint.h > >- * > > * Definitions for Motorola SPS Sandpoint Test Platform > > * > > * Author: Mark A. Greer > >diff -r 800442576617 arch/ppc/platforms/sbc82xx.c > >--- a/arch/ppc/platforms/sbc82xx.c Sat Jan 14 05:24:55 2006 > >+++ b/arch/ppc/platforms/sbc82xx.c Sat Jan 14 23:40:17 2006 > >@@ -1,6 +1,4 @@ > > /* > >- * arch/ppc/platforms/sbc82xx.c > >- * > > * SBC82XX platform support > > * > > * Author: Guy Streeter > >diff -r 800442576617 arch/ppc/platforms/spruce.c > >--- a/arch/ppc/platforms/spruce.c Sat Jan 14 05:24:55 2006 > >+++ b/arch/ppc/platforms/spruce.c Sat Jan 14 23:40:17 2006 > >@@ -1,6 +1,4 @@ > > /* > >- * arch/ppc/platforms/spruce.c > >- * > > * Board and PCI setup routines for IBM Spruce > > * > > * Author: MontaVista Software > >diff -r 800442576617 arch/ppc/platforms/tqm8260_setup.c > >--- a/arch/ppc/platforms/tqm8260_setup.c Sat Jan 14 05:24:55 2006 > >+++ b/arch/ppc/platforms/tqm8260_setup.c Sat Jan 14 23:40:17 2006 > >@@ -1,6 +1,4 @@ > > /* > >- * arch/ppc/platforms/tqm8260_setup.c > >- * > > * TQM8260 platform support > > * > > * Author: Allen Curtis > >diff -r 800442576617 arch/ppc/syslib/cpc700.h > >--- a/arch/ppc/syslib/cpc700.h Sat Jan 14 05:24:55 2006 > >+++ b/arch/ppc/syslib/cpc700.h Sat Jan 14 23:40:17 2006 > >@@ -1,6 +1,4 @@ > > /* > >- * arch/ppc/syslib/cpc700.h > >- * > > * Header file for IBM CPC700 Host Bridge, et. al. > > * > > * Author: Mark A. Greer > >diff -r 800442576617 arch/ppc/syslib/cpc700_pic.c > >--- a/arch/ppc/syslib/cpc700_pic.c Sat Jan 14 05:24:55 2006 > >+++ b/arch/ppc/syslib/cpc700_pic.c Sat Jan 14 23:40:17 2006 > >@@ -1,6 +1,4 @@ > > /* > >- * arch/ppc/syslib/cpc700_pic.c > >- * > > * Interrupt controller support for IBM Spruce > > * > > * Authors: Mark Greer, Matt Porter, and Johnnie Peters > >diff -r 800442576617 arch/ppc/syslib/cpc710.h > >--- a/arch/ppc/syslib/cpc710.h Sat Jan 14 05:24:55 2006 > >+++ b/arch/ppc/syslib/cpc710.h Sat Jan 14 23:40:17 2006 > >@@ -1,6 +1,4 @@ > > /* > >- * arch/ppc/syslib/cpc710.h > >- * > > * Definitions for the IBM CPC710 PCI Host Bridge > > * > > * Author: Matt Porter > >diff -r 800442576617 arch/ppc/syslib/gen550.h > >--- a/arch/ppc/syslib/gen550.h Sat Jan 14 05:24:55 2006 > >+++ b/arch/ppc/syslib/gen550.h Sat Jan 14 23:40:17 2006 > >@@ -1,6 +1,4 @@ > > /* > >- * arch/ppc/syslib/gen550.h > >- * > > * gen550 prototypes > > * > > * Matt Porter > >diff -r 800442576617 arch/ppc/syslib/gen550_dbg.c > >--- a/arch/ppc/syslib/gen550_dbg.c Sat Jan 14 05:24:55 2006 > >+++ b/arch/ppc/syslib/gen550_dbg.c Sat Jan 14 23:40:17 2006 > >@@ -1,6 +1,4 @@ > > /* > >- * arch/ppc/syslib/gen550_dbg.c > >- * > > * A library of polled 16550 serial routines. These are intended to > > * be used to support progress messages, xmon, kgdb, etc. on a > > * variety of platforms. > >diff -r 800442576617 arch/ppc/syslib/gen550_kgdb.c > >--- a/arch/ppc/syslib/gen550_kgdb.c Sat Jan 14 05:24:55 2006 > >+++ b/arch/ppc/syslib/gen550_kgdb.c Sat Jan 14 23:40:17 2006 > >@@ -1,6 +1,4 @@ > > /* > >- * arch/ppc/syslib/gen550_kgdb.c > >- * > > * Generic 16550 kgdb support intended to be useful on a variety > > * of platforms. To enable this support, it is necessary to set > > * the CONFIG_GEN550 option. Any virtual mapping of the serial > >diff -r 800442576617 arch/ppc/syslib/gt64260_pic.c > >--- a/arch/ppc/syslib/gt64260_pic.c Sat Jan 14 05:24:55 2006 > >+++ b/arch/ppc/syslib/gt64260_pic.c Sat Jan 14 23:40:17 2006 > >@@ -1,6 +1,4 @@ > > /* > >- * arch/ppc/syslib/gt64260_pic.c > >- * > > * Interrupt controller support for Galileo's GT64260. > > * > > * Author: Chris Zankel > >diff -r 800442576617 arch/ppc/syslib/harrier.c > >--- a/arch/ppc/syslib/harrier.c Sat Jan 14 05:24:55 2006 > >+++ b/arch/ppc/syslib/harrier.c Sat Jan 14 23:40:17 2006 > >@@ -1,6 +1,4 @@ > > /* > >- * arch/ppc/syslib/harrier.c > >- * > > * Motorola MCG Harrier northbridge/memory controller support > > * > > * Author: Dale Farnsworth > >diff -r 800442576617 arch/ppc/syslib/hawk_common.c > >--- a/arch/ppc/syslib/hawk_common.c Sat Jan 14 05:24:55 2006 > >+++ b/arch/ppc/syslib/hawk_common.c Sat Jan 14 23:40:17 2006 > >@@ -1,6 +1,4 @@ > > /* > >- * arch/ppc/syslib/hawk_common.c > >- * > > * Common Motorola PowerPlus Platform--really Falcon/Raven or HAWK. > > * > > * Author: Mark A. Greer > >diff -r 800442576617 arch/ppc/syslib/ibm440gp_common.c > >--- a/arch/ppc/syslib/ibm440gp_common.c Sat Jan 14 05:24:55 2006 > >+++ b/arch/ppc/syslib/ibm440gp_common.c Sat Jan 14 23:40:17 2006 > >@@ -1,6 +1,4 @@ > > /* > >- * arch/ppc/syslib/ibm440gp_common.c > >- * > > * PPC440GP system library > > * > > * Matt Porter > >diff -r 800442576617 arch/ppc/syslib/ibm440gp_common.h > >--- a/arch/ppc/syslib/ibm440gp_common.h Sat Jan 14 05:24:55 2006 > >+++ b/arch/ppc/syslib/ibm440gp_common.h Sat Jan 14 23:40:17 2006 > >@@ -1,6 +1,4 @@ > > /* > >- * arch/ppc/kernel/ibm440gp_common.h > >- * > > * PPC440GP system library > > * > > * Eugene Surovegin or > > > >diff -r 800442576617 arch/ppc/syslib/ibm440gx_common.c > >--- a/arch/ppc/syslib/ibm440gx_common.c Sat Jan 14 05:24:55 2006 > >+++ b/arch/ppc/syslib/ibm440gx_common.c Sat Jan 14 23:40:17 2006 > >@@ -1,6 +1,4 @@ > > /* > >- * arch/ppc/kernel/ibm440gx_common.c > >- * > > * PPC440GX system library > > * > > * Eugene Surovegin or > > > >diff -r 800442576617 arch/ppc/syslib/ibm440gx_common.h > >--- a/arch/ppc/syslib/ibm440gx_common.h Sat Jan 14 05:24:55 2006 > >+++ b/arch/ppc/syslib/ibm440gx_common.h Sat Jan 14 23:40:17 2006 > >@@ -1,6 +1,4 @@ > > /* > >- * arch/ppc/kernel/ibm440gx_common.h > >- * > > * PPC440GX system library > > * > > * Eugene Surovegin or > > > >diff -r 800442576617 arch/ppc/syslib/ibm440sp_common.c > >--- a/arch/ppc/syslib/ibm440sp_common.c Sat Jan 14 05:24:55 2006 > >+++ b/arch/ppc/syslib/ibm440sp_common.c Sat Jan 14 23:40:17 2006 > >@@ -1,6 +1,4 @@ > > /* > >- * arch/ppc/syslib/ibm440sp_common.c > >- * > > * PPC440SP/PPC440SPe system library > > * > > * Matt Porter > >diff -r 800442576617 arch/ppc/syslib/ibm440sp_common.h > >--- a/arch/ppc/syslib/ibm440sp_common.h Sat Jan 14 05:24:55 2006 > >+++ b/arch/ppc/syslib/ibm440sp_common.h Sat Jan 14 23:40:17 2006 > >@@ -1,6 +1,4 @@ > > /* > >- * arch/ppc/syslib/ibm440sp_common.h > >- * > > * PPC440SP system library > > * > > * Matt Porter > >diff -r 800442576617 arch/ppc/syslib/ibm44x_common.c > >--- a/arch/ppc/syslib/ibm44x_common.c Sat Jan 14 05:24:55 2006 > >+++ b/arch/ppc/syslib/ibm44x_common.c Sat Jan 14 23:40:17 2006 > >@@ -1,6 +1,4 @@ > > /* > >- * arch/ppc/syslib/ibm44x_common.c > >- * > > * PPC44x system library > > * > > * Matt Porter > >diff -r 800442576617 arch/ppc/syslib/ibm44x_common.h > >--- a/arch/ppc/syslib/ibm44x_common.h Sat Jan 14 05:24:55 2006 > >+++ b/arch/ppc/syslib/ibm44x_common.h Sat Jan 14 23:40:17 2006 > >@@ -1,6 +1,4 @@ > > /* > >- * arch/ppc/kernel/ibm44x_common.h > >- * > > * PPC44x system library > > * > > * Eugene Surovegin or > > > >diff -r 800442576617 arch/ppc/syslib/m8260_pci_erratum9.c > >--- a/arch/ppc/syslib/m8260_pci_erratum9.c Sat Jan 14 05:24:55 2006 > >+++ b/arch/ppc/syslib/m8260_pci_erratum9.c Sat Jan 14 23:40:17 2006 > >@@ -1,6 +1,4 @@ > > /* > >- * arch/ppc/platforms/mpc8260_pci9.c > >- * > > * Workaround for device erratum PCI 9. > > * See Motorola's "XPC826xA Family Device Errata Reference." > > * The erratum applies to all 8260 family Hip4 processors. It is > >scheduled > >diff -r 800442576617 arch/ppc/syslib/m8260_setup.c > >--- a/arch/ppc/syslib/m8260_setup.c Sat Jan 14 05:24:55 2006 > >+++ b/arch/ppc/syslib/m8260_setup.c Sat Jan 14 23:40:17 2006 > >@@ -1,6 +1,4 @@ > > /* > >- * arch/ppc/syslib/m8260_setup.c > >- * > > * Copyright (C) 1995 Linus Torvalds > > * Adapted from 'alpha' version by Gary Thomas > > * Modified by Cort Dougan (cort at cs.nmt.edu) > >diff -r 800442576617 arch/ppc/syslib/m8xx_setup.c > >--- a/arch/ppc/syslib/m8xx_setup.c Sat Jan 14 05:24:55 2006 > >+++ b/arch/ppc/syslib/m8xx_setup.c Sat Jan 14 23:40:17 2006 > >@@ -1,6 +1,4 @@ > > /* > >- * arch/ppc/kernel/setup.c > >- * > > * Copyright (C) 1995 Linus Torvalds > > * Adapted from 'alpha' version by Gary Thomas > > * Modified by Cort Dougan (cort at cs.nmt.edu) > >diff -r 800442576617 arch/ppc/syslib/mpc10x_common.c > >--- a/arch/ppc/syslib/mpc10x_common.c Sat Jan 14 05:24:55 2006 > >+++ b/arch/ppc/syslib/mpc10x_common.c Sat Jan 14 23:40:17 2006 > >@@ -1,6 +1,4 @@ > > /* > >- * arch/ppc/syslib/mpc10x_common.c > >- * > > * Common routines for the Motorola SPS MPC106, MPC107 and MPC8240 > >Host bridge, > > * Mem ctlr, EPIC, etc. > > * > >diff -r 800442576617 arch/ppc/syslib/mpc52xx_devices.c > >--- a/arch/ppc/syslib/mpc52xx_devices.c Sat Jan 14 05:24:55 2006 > >+++ b/arch/ppc/syslib/mpc52xx_devices.c Sat Jan 14 23:40:17 2006 > >@@ -1,6 +1,4 @@ > > /* > >- * arch/ppc/syslib/mpc52xx_devices.c > >- * > > * Freescale MPC52xx device descriptions > > * > > * > >diff -r 800442576617 arch/ppc/syslib/mpc52xx_pci.c > >--- a/arch/ppc/syslib/mpc52xx_pci.c Sat Jan 14 05:24:55 2006 > >+++ b/arch/ppc/syslib/mpc52xx_pci.c Sat Jan 14 23:40:17 2006 > >@@ -1,6 +1,4 @@ > > /* > >- * arch/ppc/syslib/mpc52xx_pci.c > >- * > > * PCI code for the Freescale MPC52xx embedded CPU. > > * > > * > >diff -r 800442576617 arch/ppc/syslib/mpc52xx_pci.h > >--- a/arch/ppc/syslib/mpc52xx_pci.h Sat Jan 14 05:24:55 2006 > >+++ b/arch/ppc/syslib/mpc52xx_pci.h Sat Jan 14 23:40:17 2006 > >@@ -1,6 +1,4 @@ > > /* > >- * arch/ppc/syslib/mpc52xx_pci.h > >- * > > * PCI Include file the Freescale MPC52xx embedded cpu chips > > * > > * > >diff -r 800442576617 arch/ppc/syslib/mpc52xx_pic.c > >--- a/arch/ppc/syslib/mpc52xx_pic.c Sat Jan 14 05:24:55 2006 > >+++ b/arch/ppc/syslib/mpc52xx_pic.c Sat Jan 14 23:40:17 2006 > >@@ -1,6 +1,4 @@ > > /* > >- * arch/ppc/syslib/mpc52xx_pic.c > >- * > > * Programmable Interrupt Controller functions for the Freescale > >MPC52xx > > * embedded CPU. > > * > >diff -r 800442576617 arch/ppc/syslib/mpc52xx_setup.c > >--- a/arch/ppc/syslib/mpc52xx_setup.c Sat Jan 14 05:24:55 2006 > >+++ b/arch/ppc/syslib/mpc52xx_setup.c Sat Jan 14 23:40:17 2006 > >@@ -1,6 +1,4 @@ > > /* > >- * arch/ppc/syslib/mpc52xx_setup.c > >- * > > * Common code for the boards based on Freescale MPC52xx embedded > >CPU. > > * > > * > >diff -r 800442576617 arch/ppc/syslib/mpc52xx_sys.c > >--- a/arch/ppc/syslib/mpc52xx_sys.c Sat Jan 14 05:24:55 2006 > >+++ b/arch/ppc/syslib/mpc52xx_sys.c Sat Jan 14 23:40:17 2006 > >@@ -1,6 +1,4 @@ > > /* > >- * arch/ppc/syslib/mpc52xx_sys.c > >- * > > * Freescale MPC52xx system descriptions > > * > > * > >diff -r 800442576617 arch/ppc/syslib/mpc83xx_devices.c > >--- a/arch/ppc/syslib/mpc83xx_devices.c Sat Jan 14 05:24:55 2006 > >+++ b/arch/ppc/syslib/mpc83xx_devices.c Sat Jan 14 23:40:17 2006 > >@@ -1,6 +1,4 @@ > > /* > >- * arch/ppc/platforms/83xx/mpc83xx_devices.c > >- * > > * MPC83xx Device descriptions > > * > > * Maintainer: Kumar Gala > >diff -r 800442576617 arch/ppc/syslib/mpc83xx_sys.c > >--- a/arch/ppc/syslib/mpc83xx_sys.c Sat Jan 14 05:24:55 2006 > >+++ b/arch/ppc/syslib/mpc83xx_sys.c Sat Jan 14 23:40:17 2006 > >@@ -1,6 +1,4 @@ > > /* > >- * arch/ppc/platforms/83xx/mpc83xx_sys.c > >- * > > * MPC83xx System descriptions > > * > > * Maintainer: Kumar Gala > >diff -r 800442576617 arch/ppc/syslib/mpc85xx_devices.c > >--- a/arch/ppc/syslib/mpc85xx_devices.c Sat Jan 14 05:24:55 2006 > >+++ b/arch/ppc/syslib/mpc85xx_devices.c Sat Jan 14 23:40:17 2006 > >@@ -1,6 +1,4 @@ > > /* > >- * arch/ppc/platforms/85xx/mpc85xx_devices.c > >- * > > * MPC85xx Device descriptions > > * > > * Maintainer: Kumar Gala > >diff -r 800442576617 arch/ppc/syslib/mpc85xx_sys.c > >--- a/arch/ppc/syslib/mpc85xx_sys.c Sat Jan 14 05:24:55 2006 > >+++ b/arch/ppc/syslib/mpc85xx_sys.c Sat Jan 14 23:40:17 2006 > >@@ -1,6 +1,4 @@ > > /* > >- * arch/ppc/platforms/85xx/mpc85xx_sys.c > >- * > > * MPC85xx System descriptions > > * > > * Maintainer: Kumar Gala > >diff -r 800442576617 arch/ppc/syslib/mpc8xx_devices.c > >--- a/arch/ppc/syslib/mpc8xx_devices.c Sat Jan 14 05:24:55 2006 > >+++ b/arch/ppc/syslib/mpc8xx_devices.c Sat Jan 14 23:40:17 2006 > >@@ -1,6 +1,4 @@ > > /* > >- * arch/ppc/syslib/mpc8xx_devices.c > >- * > > * MPC8xx Device descriptions > > * > > * Maintainer: Kumar Gala > >diff -r 800442576617 arch/ppc/syslib/mpc8xx_sys.c > >--- a/arch/ppc/syslib/mpc8xx_sys.c Sat Jan 14 05:24:55 2006 > >+++ b/arch/ppc/syslib/mpc8xx_sys.c Sat Jan 14 23:40:17 2006 > >@@ -1,6 +1,4 @@ > > /* > >- * arch/ppc/platforms/mpc8xx_sys.c > >- * > > * MPC8xx System descriptions > > * > > * Maintainer: Kumar Gala > >diff -r 800442576617 arch/ppc/syslib/mv64360_pic.c > >--- a/arch/ppc/syslib/mv64360_pic.c Sat Jan 14 05:24:55 2006 > >+++ b/arch/ppc/syslib/mv64360_pic.c Sat Jan 14 23:40:17 2006 > >@@ -1,6 +1,4 @@ > > /* > >- * arch/ppc/kernel/mv64360_pic.c > >- * > > * Interrupt controller support for Marvell's MV64360. > > * > > * Author: Rabeeh Khoury > >diff -r 800442576617 arch/ppc/syslib/mv64x60.c > >--- a/arch/ppc/syslib/mv64x60.c Sat Jan 14 05:24:55 2006 > >+++ b/arch/ppc/syslib/mv64x60.c Sat Jan 14 23:40:17 2006 > >@@ -1,6 +1,4 @@ > > /* > >- * arch/ppc/syslib/mv64x60.c > >- * > > * Common routines for the Marvell/Galileo Discovery line of host > >bridges > > * (gt64260, mv64360, mv64460, ...). > > * > >diff -r 800442576617 arch/ppc/syslib/mv64x60_dbg.c > >--- a/arch/ppc/syslib/mv64x60_dbg.c Sat Jan 14 05:24:55 2006 > >+++ b/arch/ppc/syslib/mv64x60_dbg.c Sat Jan 14 23:40:17 2006 > >@@ -1,6 +1,4 @@ > > /* > >- * arch/ppc/syslib/mv64x60_dbg.c > >- * > > * KGDB and progress routines for the Marvell/Galileo MV64x60 > >(Discovery). > > * > > * Author: Mark A. Greer > >diff -r 800442576617 arch/ppc/syslib/mv64x60_win.c > >--- a/arch/ppc/syslib/mv64x60_win.c Sat Jan 14 05:24:55 2006 > >+++ b/arch/ppc/syslib/mv64x60_win.c Sat Jan 14 23:40:17 2006 > >@@ -1,6 +1,4 @@ > > /* > >- * arch/ppc/syslib/mv64x60_win.c > >- * > > * Tables with info on how to manipulate the 32 & 64 bit windows > >on the > > * various types of Marvell bridge chips. > > * > >diff -r 800442576617 arch/ppc/syslib/open_pic.c > >--- a/arch/ppc/syslib/open_pic.c Sat Jan 14 05:24:55 2006 > >+++ b/arch/ppc/syslib/open_pic.c Sat Jan 14 23:40:17 2006 > >@@ -1,6 +1,4 @@ > > /* > >- * arch/ppc/kernel/open_pic.c -- OpenPIC Interrupt Handling > >- * > > * Copyright (C) 1997 Geert Uytterhoeven > > * > > * This file is subject to the terms and conditions of the GNU > >General Public > >diff -r 800442576617 arch/ppc/syslib/open_pic2.c > >--- a/arch/ppc/syslib/open_pic2.c Sat Jan 14 05:24:55 2006 > >+++ b/arch/ppc/syslib/open_pic2.c Sat Jan 14 23:40:17 2006 > >@@ -1,6 +1,4 @@ > > /* > >- * arch/ppc/kernel/open_pic.c -- OpenPIC Interrupt Handling > >- * > > * Copyright (C) 1997 Geert Uytterhoeven > > * > > * This file is subject to the terms and conditions of the GNU > >General Public > >diff -r 800442576617 arch/ppc/syslib/open_pic_defs.h > >--- a/arch/ppc/syslib/open_pic_defs.h Sat Jan 14 05:24:55 2006 > >+++ b/arch/ppc/syslib/open_pic_defs.h Sat Jan 14 23:40:17 2006 > >@@ -1,6 +1,4 @@ > > /* > >- * arch/ppc/kernel/open_pic_defs.h -- OpenPIC definitions > >- * > > * Copyright (C) 1997 Geert Uytterhoeven > > * > > * This file is based on the following documentation: > >diff -r 800442576617 arch/ppc/syslib/pci_auto.c > >--- a/arch/ppc/syslib/pci_auto.c Sat Jan 14 05:24:55 2006 > >+++ b/arch/ppc/syslib/pci_auto.c Sat Jan 14 23:40:17 2006 > >@@ -1,6 +1,4 @@ > > /* > >- * arch/ppc/syslib/pci_auto.c > >- * > > * PCI autoconfiguration library > > * > > * Author: Matt Porter > >diff -r 800442576617 arch/ppc/syslib/ppc4xx_dma.c > >--- a/arch/ppc/syslib/ppc4xx_dma.c Sat Jan 14 05:24:55 2006 > >+++ b/arch/ppc/syslib/ppc4xx_dma.c Sat Jan 14 23:40:17 2006 > >@@ -1,6 +1,4 @@ > > /* > >- * arch/ppc/kernel/ppc4xx_dma.c > >- * > > * IBM PPC4xx DMA engine core library > > * > > * Copyright 2000-2004 MontaVista Software Inc. > >diff -r 800442576617 arch/ppc/syslib/ppc4xx_pic.c > >--- a/arch/ppc/syslib/ppc4xx_pic.c Sat Jan 14 05:24:55 2006 > >+++ b/arch/ppc/syslib/ppc4xx_pic.c Sat Jan 14 23:40:17 2006 > >@@ -1,6 +1,4 @@ > > /* > >- * arch/ppc/syslib/ppc4xx_pic.c > >- * > > * Interrupt controller driver for PowerPC 4xx-based processors. > > * > > * Eugene Surovegin or > > > >diff -r 800442576617 arch/ppc/syslib/ppc4xx_sgdma.c > >--- a/arch/ppc/syslib/ppc4xx_sgdma.c Sat Jan 14 05:24:55 2006 > >+++ b/arch/ppc/syslib/ppc4xx_sgdma.c Sat Jan 14 23:40:17 2006 > >@@ -1,6 +1,4 @@ > > /* > >- * arch/ppc/kernel/ppc4xx_sgdma.c > >- * > > * IBM PPC4xx DMA engine scatter/gather library > > * > > * Copyright 2002-2003 MontaVista Software Inc. > >diff -r 800442576617 arch/ppc/syslib/ppc83xx_setup.c > >--- a/arch/ppc/syslib/ppc83xx_setup.c Sat Jan 14 05:24:55 2006 > >+++ b/arch/ppc/syslib/ppc83xx_setup.c Sat Jan 14 23:40:17 2006 > >@@ -1,6 +1,4 @@ > > /* > >- * arch/ppc/syslib/ppc83xx_setup.c > >- * > > * MPC83XX common board code > > * > > * Maintainer: Kumar Gala > >diff -r 800442576617 arch/ppc/syslib/ppc83xx_setup.h > >--- a/arch/ppc/syslib/ppc83xx_setup.h Sat Jan 14 05:24:55 2006 > >+++ b/arch/ppc/syslib/ppc83xx_setup.h Sat Jan 14 23:40:17 2006 > >@@ -1,6 +1,4 @@ > > /* > >- * arch/ppc/syslib/ppc83xx_setup.h > >- * > > * MPC83XX common board definitions > > * > > * Maintainer: Kumar Gala > >diff -r 800442576617 arch/ppc/syslib/ppc85xx_common.c > >--- a/arch/ppc/syslib/ppc85xx_common.c Sat Jan 14 05:24:55 2006 > >+++ b/arch/ppc/syslib/ppc85xx_common.c Sat Jan 14 23:40:17 2006 > >@@ -1,6 +1,4 @@ > > /* > >- * arch/ppc/syslib/ppc85xx_common.c > >- * > > * MPC85xx support routines > > * > > * Maintainer: Kumar Gala > >diff -r 800442576617 arch/ppc/syslib/ppc85xx_common.h > >--- a/arch/ppc/syslib/ppc85xx_common.h Sat Jan 14 05:24:55 2006 > >+++ b/arch/ppc/syslib/ppc85xx_common.h Sat Jan 14 23:40:17 2006 > >@@ -1,6 +1,4 @@ > > /* > >- * arch/ppc/syslib/ppc85xx_common.h > >- * > > * MPC85xx support routines > > * > > * Maintainer: Kumar Gala > >diff -r 800442576617 arch/ppc/syslib/ppc85xx_setup.c > >--- a/arch/ppc/syslib/ppc85xx_setup.c Sat Jan 14 05:24:55 2006 > >+++ b/arch/ppc/syslib/ppc85xx_setup.c Sat Jan 14 23:40:17 2006 > >@@ -1,6 +1,4 @@ > > /* > >- * arch/ppc/syslib/ppc85xx_setup.c > >- * > > * MPC85XX common board code > > * > > * Maintainer: Kumar Gala > >diff -r 800442576617 arch/ppc/syslib/ppc85xx_setup.h > >--- a/arch/ppc/syslib/ppc85xx_setup.h Sat Jan 14 05:24:55 2006 > >+++ b/arch/ppc/syslib/ppc85xx_setup.h Sat Jan 14 23:40:17 2006 > >@@ -1,6 +1,4 @@ > > /* > >- * arch/ppc/syslib/ppc85xx_setup.h > >- * > > * MPC85XX common board definitions > > * > > * Maintainer: Kumar Gala > >diff -r 800442576617 arch/ppc/syslib/ppc_sys.c > >--- a/arch/ppc/syslib/ppc_sys.c Sat Jan 14 05:24:55 2006 > >+++ b/arch/ppc/syslib/ppc_sys.c Sat Jan 14 23:40:17 2006 > >@@ -1,6 +1,4 @@ > > /* > >- * arch/ppc/syslib/ppc_sys.c > >- * > > * PPC System library functions > > * > > * Maintainer: Kumar Gala > >diff -r 800442576617 arch/ppc/syslib/pq2_devices.c > >--- a/arch/ppc/syslib/pq2_devices.c Sat Jan 14 05:24:55 2006 > >+++ b/arch/ppc/syslib/pq2_devices.c Sat Jan 14 23:40:17 2006 > >@@ -1,6 +1,4 @@ > > /* > >- * arch/ppc/syslib/pq2_devices.c > >- * > > * PQ2 Device descriptions > > * > > * Maintainer: Kumar Gala > >diff -r 800442576617 arch/ppc/syslib/pq2_sys.c > >--- a/arch/ppc/syslib/pq2_sys.c Sat Jan 14 05:24:55 2006 > >+++ b/arch/ppc/syslib/pq2_sys.c Sat Jan 14 23:40:17 2006 > >@@ -1,6 +1,4 @@ > > /* > >- * arch/ppc/syslib/pq2_devices.c > >- * > > * PQ2 System descriptions > > * > > * Maintainer: Kumar Gala > >diff -r 800442576617 arch/ppc/syslib/prep_nvram.c > >--- a/arch/ppc/syslib/prep_nvram.c Sat Jan 14 05:24:55 2006 > >+++ b/arch/ppc/syslib/prep_nvram.c Sat Jan 14 23:40:17 2006 > >@@ -1,6 +1,4 @@ > > /* > >- * arch/ppc/kernel/prep_nvram.c > >- * > > * Copyright (C) 1998 Corey Minyard > > * > > * This reads the NvRAM on PReP compliant machines (generally from > >IBM or > >diff -r 800442576617 arch/ppc/syslib/todc_time.c > >--- a/arch/ppc/syslib/todc_time.c Sat Jan 14 05:24:55 2006 > >+++ b/arch/ppc/syslib/todc_time.c Sat Jan 14 23:40:17 2006 > >@@ -1,6 +1,4 @@ > > /* > >- * arch/ppc/syslib/todc_time.c > >- * > > * Time of Day Clock support for the M48T35, M48T37, M48T59, and > >MC146818 > > * Real Time Clocks/Timekeepers. > > * > >diff -r 800442576617 arch/ppc/syslib/xilinx_pic.c > >--- a/arch/ppc/syslib/xilinx_pic.c Sat Jan 14 05:24:55 2006 > >+++ b/arch/ppc/syslib/xilinx_pic.c Sat Jan 14 23:40:17 2006 > >@@ -1,6 +1,4 @@ > > /* > >- * arch/ppc/syslib/xilinx_pic.c > >- * > > * Interrupt controller driver for Xilinx Virtex-II Pro. > > * > > * Author: MontaVista Software, Inc. > >diff -r 800442576617 drivers/char/hvcs.c > >--- a/drivers/char/hvcs.c Sat Jan 14 05:24:55 2006 > >+++ b/drivers/char/hvcs.c Sat Jan 14 23:40:17 2006 > >@@ -118,7 +118,7 @@ > > * the hvcs_final_close() function in order to get it out of the > >spinlock. > > * Rearranged hvcs_close(). Cleaned up some printks and did some > >housekeeping > > * on the changelog. Removed local CLC_LENGTH and used > >HVCS_CLC_LENGTH from > >- * arch/ppc64/hvcserver.h. > >+ * include/asm-powerpc/hvcserver.h > > * > > * 1.3.2 -> 1.3.3 Replaced yield() in hvcs_close() with > >tty_wait_until_sent() to > > * prevent possible lockup with realtime scheduling as similarily > >pointed out by > >@@ -168,9 +168,10 @@ > > > > /* > > * The hcall interface involves putting 8 chars into each of two > >registers. > >- * We load up those 2 registers (in arch/ppc64/hvconsole.c) by > >casting char[16] > >- * to long[2]. It would work without __ALIGNED__, but a little > >(tiny) bit > >- * slower because an unaligned load is slower than aligned load. > >+ * We load up those 2 registers (in arch/powerpc/platforms/pseries/ > >hvconsole.c) > >+ * by casting char[16] to long[2]. It would work without > >__ALIGNED__, but a > >+ * little (tiny) bit slower because an unaligned load is slower > >than aligned > >+ * load. > > */ > > #define __ALIGNED__ __attribute__((__aligned__(8))) > > > >diff -r 800442576617 include/asm-powerpc/paca.h > >--- a/include/asm-powerpc/paca.h Sat Jan 14 05:24:55 2006 > >+++ b/include/asm-powerpc/paca.h Sat Jan 14 23:40:17 2006 > >@@ -54,7 +54,7 @@ > > #endif /* CONFIG_PPC_ISERIES */ > > > > /* > >- * MAGIC: the spinlock functions in arch/ppc64/lib/locks.c > >+ * MAGIC: the spinlock functions in arch/powerpc/lib/locks.c > > * load lock_token and paca_index with a single lwz > > * instruction. They must travel together and be properly > > * aligned. > >diff -r 800442576617 include/asm-powerpc/rwsem.h > >--- a/include/asm-powerpc/rwsem.h Sat Jan 14 05:24:55 2006 > >+++ b/include/asm-powerpc/rwsem.h Sat Jan 14 23:40:17 2006 > >@@ -4,7 +4,7 @@ > > #ifdef __KERNEL__ > > > > /* > >- * include/asm-ppc64/rwsem.h: R/W semaphores for PPC using the stuff > >+ * include/asm-powerpc/rwsem.h: R/W semaphores for PPC using the > >stuff > > * in lib/rwsem.c. Adapted largely from include/asm-i386/rwsem.h > > * by Paul Mackerras . > > */ > >diff -r 800442576617 include/asm-ppc/harrier.h > >--- a/include/asm-ppc/harrier.h Sat Jan 14 05:24:55 2006 > >+++ b/include/asm-ppc/harrier.h Sat Jan 14 23:40:17 2006 > >@@ -1,6 +1,4 @@ > > /* > >- * arch/ppc/kernel/harrier.h > >- * > > * Definitions for Motorola MCG Harrier North Bridge & Memory > >controller > > * > > * Author: Dale Farnsworth > >diff -r 800442576617 include/asm-ppc/mpc10x.h > >--- a/include/asm-ppc/mpc10x.h Sat Jan 14 05:24:55 2006 > >+++ b/include/asm-ppc/mpc10x.h Sat Jan 14 23:40:17 2006 > >@@ -1,6 +1,4 @@ > > /* > >- * arch/ppc/kernel/mpc10x.h > >- * > > * Common routines for the Motorola SPS MPC106/8240/107 Host > >bridge/Mem > > * ctlr/EPIC/etc. > > * > >diff -r 800442576617 kernel/auditsc.c > >--- a/kernel/auditsc.c Sat Jan 14 05:24:55 2006 > >+++ b/kernel/auditsc.c Sat Jan 14 23:40:17 2006 > >@@ -958,7 +958,7 @@ > > * > > * i386 no > > * x86_64 no > >- * ppc64 yes (see arch/ppc64/kernel/misc.S) > >+ * ppc64 yes (see arch/powerpc/platforms/iseries/misc.S) > > * > > * This also happens with vm86 emulation in a non-nested manner > > * (entries without exits), so this case must be caught. > >diff -r 800442576617 lib/extable.c > >--- a/lib/extable.c Sat Jan 14 05:24:55 2006 > >+++ b/lib/extable.c Sat Jan 14 23:40:17 2006 > >@@ -1,5 +1,4 @@ > > /* > >- * lib/extable.c > > * Derived from arch/ppc/mm/extable.c and arch/i386/mm/extable.c. > > * > > * Copyright (C) 2004 Paul Mackerras, IBM Corp. > >_______________________________________________ > >Linuxppc64-dev mailing list > >Linuxppc64-dev at ozlabs.org > >https://ozlabs.org/mailman/listinfo/linuxppc64-dev > > From michael at ellerman.id.au Mon Jan 16 11:31:29 2006 From: michael at ellerman.id.au (Michael Ellerman) Date: Mon, 16 Jan 2006 11:31:29 +1100 Subject: [PATCH 8/10] powerpc: Move create_(instruction|branch|function_call) into util.h In-Reply-To: <20060113064711.01175689D3@ozlabs.org> References: <20060113064711.01175689D3@ozlabs.org> Message-ID: <200601161131.30478.michael@ellerman.id.au> This was missing a quilt ref, we need to include util.h in powermac/smp.c --- powerpc: Move create_(instruction|branch|function_call) into util.h These functions don't really belong in system.h, and they can't be there if the next patch is going to work. So create util.h for them, a bit icky I admit. Index: linux/include/asm-powerpc/system.h =================================================================== --- linux.orig/include/asm-powerpc/system.h +++ linux/include/asm-powerpc/system.h @@ -366,53 +366,5 @@ extern void reloc_got2(unsigned long); #define PTRRELOC(x) ((typeof(x)) add_reloc_offset((unsigned long)(x))) -static inline void create_instruction(unsigned long addr, unsigned int instr) -{ - unsigned int *p; - p = (unsigned int *)addr; - *p = instr; - asm ("dcbst 0, %0; sync; icbi 0,%0; sync; isync" : : "r" (p)); -} - -/* Flags for create_branch: - * "b" == create_branch(addr, target, 0); - * "ba" == create_branch(addr, target, BRANCH_ABSOLUTE); - * "bl" == create_branch(addr, target, BRANCH_SET_LINK); - * "bla" == create_branch(addr, target, BRANCH_ABSOLUTE | BRANCH_SET_LINK); - */ -#define BRANCH_SET_LINK 0x1 -#define BRANCH_ABSOLUTE 0x2 - -static inline void create_branch(unsigned long addr, - unsigned long target, int flags) -{ - unsigned int instruction; - - if (! (flags & BRANCH_ABSOLUTE)) - target = target - addr; - - /* Mask out the flags and target, so they don't step on each other. */ - instruction = 0x48000000 | (flags & 0x3) | (target & 0x03FFFFFC); - - create_instruction(addr, instruction); -} - -static inline void create_function_call(unsigned long addr, void * func) -{ - unsigned long func_addr; - -#ifdef CONFIG_PPC64 - /* - * On PPC64 the function pointer actually points to the function's - * descriptor. The first entry in the descriptor is the address - * of the function text. - */ - func_addr = *(unsigned long *)func; -#else - func_addr = (unsigned long)func; -#endif - create_branch(addr, func_addr, BRANCH_SET_LINK); -} - #endif /* __KERNEL__ */ #endif /* _ASM_POWERPC_SYSTEM_H */ Index: linux/include/asm-powerpc/util.h =================================================================== --- /dev/null +++ linux/include/asm-powerpc/util.h @@ -0,0 +1,56 @@ +/* + * Copyright (C) 2005,2006 IBM Corporation. + */ + +#ifndef _ASM_POWERPC_UTIL_H +#define _ASM_POWERPC_UTIL_H + +static inline void create_instruction(unsigned long addr, unsigned int instr) +{ + unsigned int *p; + p = (unsigned int *)addr; + *p = instr; + asm ("dcbst 0, %0; sync; icbi 0,%0; sync; isync" : : "r" (p)); +} + +/* Flags for create_branch: + * "b" == create_branch(addr, target, 0); + * "ba" == create_branch(addr, target, BRANCH_ABSOLUTE); + * "bl" == create_branch(addr, target, BRANCH_SET_LINK); + * "bla" == create_branch(addr, target, BRANCH_ABSOLUTE | BRANCH_SET_LINK); + */ +#define BRANCH_SET_LINK 0x1 +#define BRANCH_ABSOLUTE 0x2 + +static inline void create_branch(unsigned long addr, + unsigned long target, int flags) +{ + unsigned int instruction; + + if (! (flags & BRANCH_ABSOLUTE)) + target = target - addr; + + /* Mask out the flags and target, so they don't step on each other. */ + instruction = 0x48000000 | (flags & 0x3) | (target & 0x03FFFFFC); + + create_instruction(addr, instruction); +} + +static inline void create_function_call(unsigned long addr, void * func) +{ + unsigned long func_addr; + +#ifdef CONFIG_PPC64 + /* + * On PPC64 the function pointer actually points to the function's + * descriptor. The first entry in the descriptor is the address + * of the function text. + */ + func_addr = *(unsigned long *)func; +#else + func_addr = (unsigned long)func; +#endif + create_branch(addr, func_addr, BRANCH_SET_LINK); +} + +#endif /* _ASM_POWERPC_UTIL_H */ Index: linux/arch/powerpc/kernel/crash_dump.c =================================================================== --- linux.orig/arch/powerpc/kernel/crash_dump.c +++ linux/arch/powerpc/kernel/crash_dump.c @@ -17,6 +17,7 @@ #include #include #include +#include #ifdef DEBUG #include Index: linux/arch/powerpc/platforms/powermac/smp.c =================================================================== --- linux.orig/arch/powerpc/platforms/powermac/smp.c +++ linux/arch/powerpc/platforms/powermac/smp.c @@ -53,6 +53,7 @@ #include #include #include +#include #define DEBUG From akpm at osdl.org Mon Jan 16 18:05:57 2006 From: akpm at osdl.org (Andrew Morton) Date: Sun, 15 Jan 2006 23:05:57 -0800 Subject: 2.6.15-mm4 failure on power5 In-Reply-To: <20060116063530.GB23399@sergelap.austin.ibm.com> References: <20060116063530.GB23399@sergelap.austin.ibm.com> Message-ID: <20060115230557.0f07a55c.akpm@osdl.org> "Serge E. Hallyn" wrote: > > On my power5 partition, 2.6.15-mm4 hangs on boot with the following > console output. 2.6.15-mm3 booted fine. .config attached. > > boot: quicktest > Please wait, loading kernel... > Elf64 kernel loaded... > OF stdout device is: /vdevice/vty at 30000000 > Hypertas detected, assuming LPAR ! > command line: ro console=hvc0 root=/dev/sda6 smt-enabled=1 > memory layout at init: > memory_limit : 0000000000000000 (16 MB aligned) > alloc_bottom : 0000000002223000 > alloc_top : 0000000008000000 > alloc_top_hi : 0000000088000000 > rmo_top : 0000000008000000 > ram_top : 0000000088000000 > Looking for displays > instantiating rtas at 0x00000000077d7000 ... done > 0000000000000000 : boot cpu 0000000000000000 > 0000000000000002 : starting cpu hw idx 0000000000000002... done > 0000000000000004 : starting cpu hw idx 0000000000000004... done > 0000000000000006 : starting cpu hw idx 0000000000000006... done > copying OF device tree ... > Building dt strings... > Building dt structure... > Device tree strings 0x0000000002424000 -> 0x0000000002424f36 > Device tree struct 0x0000000002425000 -> 0x000000000242c000 > Calling quiesce ... > returning from prom_init > Page orders: linear mapping = 24, others = 12 It might be worth reverting the changes to arch/powerpc/mm/hash_utils_64.c, see if that unbreaks it. - base = lmb.memory.region[i].base + KERNELBASE; + base = (unsigned long)__va(lmb.memory.region[i].base); The nice comment in page.h: * KERNELBASE is the virtual address of the start of the kernel, it's often * the same as PAGE_OFFSET, but _might not be_. * * The kdump dump kernel is one example where KERNELBASE != PAGE_OFFSET. * * To get a physical address from a virtual one you subtract PAGE_OFFSET, * _not_ KERNELBASE. Tells us that was not an equivalent transformation. From serue at us.ibm.com Mon Jan 16 17:35:30 2006 From: serue at us.ibm.com (Serge E. Hallyn) Date: Mon, 16 Jan 2006 00:35:30 -0600 Subject: 2.6.15-mm4 failure on power5 Message-ID: <20060116063530.GB23399@sergelap.austin.ibm.com> On my power5 partition, 2.6.15-mm4 hangs on boot with the following console output. 2.6.15-mm3 booted fine. .config attached. boot: quicktest Please wait, loading kernel... Elf64 kernel loaded... OF stdout device is: /vdevice/vty at 30000000 Hypertas detected, assuming LPAR ! command line: ro console=hvc0 root=/dev/sda6 smt-enabled=1 memory layout at init: memory_limit : 0000000000000000 (16 MB aligned) alloc_bottom : 0000000002223000 alloc_top : 0000000008000000 alloc_top_hi : 0000000088000000 rmo_top : 0000000008000000 ram_top : 0000000088000000 Looking for displays instantiating rtas at 0x00000000077d7000 ... done 0000000000000000 : boot cpu 0000000000000000 0000000000000002 : starting cpu hw idx 0000000000000002... done 0000000000000004 : starting cpu hw idx 0000000000000004... done 0000000000000006 : starting cpu hw idx 0000000000000006... done copying OF device tree ... Building dt strings... Building dt structure... Device tree strings 0x0000000002424000 -> 0x0000000002424f36 Device tree struct 0x0000000002425000 -> 0x000000000242c000 Calling quiesce ... returning from prom_init Page orders: linear mapping = 24, others = 12 thanks, -serge -------------- next part -------------- # # Automatically generated make config: don't edit # Linux kernel version: 2.6.15-mm3 # Sun Jan 15 18:03:01 2006 # CONFIG_PPC64=y CONFIG_64BIT=y CONFIG_PPC_MERGE=y CONFIG_MMU=y CONFIG_GENERIC_HARDIRQS=y CONFIG_RWSEM_XCHGADD_ALGORITHM=y CONFIG_GENERIC_CALIBRATE_DELAY=y CONFIG_PPC=y CONFIG_EARLY_PRINTK=y CONFIG_COMPAT=y CONFIG_SYSVIPC_COMPAT=y CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y CONFIG_ARCH_MAY_HAVE_PC_FDC=y CONFIG_PPC_OF=y CONFIG_PPC_UDBG_16550=y # CONFIG_CRASH_DUMP is not set # CONFIG_GENERIC_TBSYNC is not set # # Processor support # # CONFIG_POWER4_ONLY is not set CONFIG_POWER3=y CONFIG_POWER4=y CONFIG_PPC_FPU=y CONFIG_ALTIVEC=y CONFIG_PPC_STD_MMU=y CONFIG_SMP=y CONFIG_NR_CPUS=128 # # Code maturity level options # CONFIG_EXPERIMENTAL=y # CONFIG_CLEAN_COMPILE is not set CONFIG_BROKEN=y CONFIG_BROKEN_ON_SMP=y CONFIG_LOCK_KERNEL=y CONFIG_INIT_ENV_ARG_LIMIT=32 # # General setup # CONFIG_LOCALVERSION="" CONFIG_LOCALVERSION_AUTO=y CONFIG_SWAP=y CONFIG_SYSVIPC=y # CONFIG_POSIX_MQUEUE is not set CONFIG_BSD_PROCESS_ACCT=y # CONFIG_BSD_PROCESS_ACCT_V3 is not set CONFIG_SYSCTL=y CONFIG_AUDIT=y CONFIG_AUDITSYSCALL=y CONFIG_IKCONFIG=y CONFIG_IKCONFIG_PROC=y # CONFIG_CPUSETS is not set CONFIG_INITRAMFS_SOURCE="" CONFIG_CC_OPTIMIZE_FOR_SIZE=y # CONFIG_EMBEDDED is not set CONFIG_KALLSYMS=y # CONFIG_KALLSYMS_ALL is not set # CONFIG_KALLSYMS_EXTRA_PASS is not set CONFIG_HOTPLUG=y CONFIG_PRINTK=y CONFIG_BUG=y CONFIG_ELF_CORE=y CONFIG_BASE_FULL=y CONFIG_FUTEX=y CONFIG_EPOLL=y CONFIG_SHMEM=y CONFIG_CC_ALIGN_FUNCTIONS=0 CONFIG_CC_ALIGN_LABELS=0 CONFIG_CC_ALIGN_LOOPS=0 CONFIG_CC_ALIGN_JUMPS=0 CONFIG_SLAB=y CONFIG_SERIAL_PCI=y # CONFIG_TINY_SHMEM is not set CONFIG_BASE_SMALL=0 # CONFIG_SLOB is not set # # Loadable module support # CONFIG_MODULES=y CONFIG_MODULE_UNLOAD=y # CONFIG_MODULE_FORCE_UNLOAD is not set CONFIG_OBSOLETE_MODPARM=y CONFIG_MODVERSIONS=y # CONFIG_MODULE_SRCVERSION_ALL is not set CONFIG_KMOD=y CONFIG_STOP_MACHINE=y # # Block layer # # CONFIG_BLK_DEV_IO_TRACE is not set # # IO Schedulers # CONFIG_IOSCHED_NOOP=y CONFIG_IOSCHED_AS=y CONFIG_IOSCHED_DEADLINE=y CONFIG_IOSCHED_CFQ=y CONFIG_DEFAULT_AS=y # CONFIG_DEFAULT_DEADLINE is not set # CONFIG_DEFAULT_CFQ is not set # CONFIG_DEFAULT_NOOP is not set CONFIG_DEFAULT_IOSCHED="anticipatory" # # Platform support # CONFIG_PPC_MULTIPLATFORM=y # CONFIG_PPC_ISERIES is not set # CONFIG_EMBEDDED6xx is not set # CONFIG_APUS is not set CONFIG_PPC_PSERIES=y # CONFIG_PPC_PMAC is not set # CONFIG_PPC_MAPLE is not set # CONFIG_PPC_CELL is not set CONFIG_XICS=y # CONFIG_U3_DART is not set CONFIG_MPIC=y CONFIG_PPC_RTAS=y CONFIG_RTAS_ERROR_LOGGING=y # CONFIG_RTAS_PROC is not set # CONFIG_MMIO_NVRAM is not set CONFIG_IBMVIO=y CONFIG_IBMEBUS=y # CONFIG_PPC_MPC106 is not set # CONFIG_CPU_FREQ is not set # CONFIG_WANT_EARLY_SERIAL is not set # # Kernel options # # CONFIG_HZ_100 is not set CONFIG_HZ_250=y # CONFIG_HZ_1000 is not set CONFIG_HZ=250 CONFIG_PREEMPT_NONE=y # CONFIG_PREEMPT_VOLUNTARY is not set # CONFIG_PREEMPT is not set CONFIG_PREEMPT_BKL=y CONFIG_BINFMT_ELF=y CONFIG_BINFMT_MISC=m CONFIG_FORCE_MAX_ZONEORDER=13 # CONFIG_IOMMU_VMERGE is not set CONFIG_HOTPLUG_CPU=y # CONFIG_KEXEC is not set # CONFIG_IRQ_ALL_CPUS is not set CONFIG_PPC_SPLPAR=y # CONFIG_HMT is not set CONFIG_EEH=y CONFIG_LPARCFG=y CONFIG_NUMA=y CONFIG_ARCH_SELECT_MEMORY_MODEL=y CONFIG_ARCH_SPARSEMEM_ENABLE=y CONFIG_ARCH_SPARSEMEM_DEFAULT=y CONFIG_SELECT_MEMORY_MODEL=y # CONFIG_FLATMEM_MANUAL is not set # CONFIG_DISCONTIGMEM_MANUAL is not set CONFIG_SPARSEMEM_MANUAL=y CONFIG_SPARSEMEM=y CONFIG_NEED_MULTIPLE_NODES=y CONFIG_HAVE_MEMORY_PRESENT=y # CONFIG_SPARSEMEM_STATIC is not set CONFIG_SPARSEMEM_EXTREME=y # CONFIG_MEMORY_HOTPLUG is not set CONFIG_SPLIT_PTLOCK_CPUS=4 CONFIG_MIGRATION=y CONFIG_HAVE_ARCH_EARLY_PFN_TO_NID=y # CONFIG_PPC_64K_PAGES is not set CONFIG_SCHED_SMT=y CONFIG_PROC_DEVICETREE=y # CONFIG_CMDLINE_BOOL is not set # CONFIG_PM is not set CONFIG_SECCOMP=y CONFIG_ISA_DMA_API=y # # Bus options # CONFIG_GENERIC_ISA_DMA=y CONFIG_PPC_I8259=y # CONFIG_PPC_INDIRECT_PCI is not set CONFIG_PCI=y CONFIG_PCI_DOMAINS=y # CONFIG_PCI_LEGACY_PROC is not set # CONFIG_PCI_DEBUG is not set # # PCCARD (PCMCIA/CardBus) support # # CONFIG_PCCARD is not set # # PCI Hotplug Support # CONFIG_HOTPLUG_PCI=y # CONFIG_HOTPLUG_PCI_FAKE is not set # CONFIG_HOTPLUG_PCI_CPCI is not set # CONFIG_HOTPLUG_PCI_SHPC is not set CONFIG_HOTPLUG_PCI_RPA=y CONFIG_HOTPLUG_PCI_RPA_DLPAR=y CONFIG_KERNEL_START=0xc000000000000000 # # Networking # CONFIG_NET=y # # Networking options # CONFIG_PACKET=y CONFIG_PACKET_MMAP=y CONFIG_UNIX=y CONFIG_XFRM=y CONFIG_XFRM_USER=m CONFIG_NET_KEY=y CONFIG_INET=y CONFIG_IP_MULTICAST=y CONFIG_IP_ADVANCED_ROUTER=y CONFIG_ASK_IP_FIB_HASH=y # CONFIG_IP_FIB_TRIE is not set CONFIG_IP_FIB_HASH=y CONFIG_IP_MULTIPLE_TABLES=y # CONFIG_IP_ROUTE_FWMARK is not set CONFIG_IP_ROUTE_MULTIPATH=y # CONFIG_IP_ROUTE_MULTIPATH_CACHED is not set # CONFIG_IP_ROUTE_VERBOSE is not set # CONFIG_IP_PNP is not set CONFIG_NET_IPIP=m CONFIG_NET_IPGRE=m CONFIG_NET_IPGRE_BROADCAST=y CONFIG_IP_MROUTE=y CONFIG_IP_PIMSM_V1=y CONFIG_IP_PIMSM_V2=y # CONFIG_ARPD is not set CONFIG_SYN_COOKIES=y CONFIG_INET_AH=m CONFIG_INET_ESP=m CONFIG_INET_IPCOMP=m CONFIG_INET_TUNNEL=m CONFIG_INET_DIAG=y CONFIG_INET_TCP_DIAG=y # CONFIG_TCP_CONG_ADVANCED is not set CONFIG_TCP_CONG_BIC=y # # IP: Virtual Server Configuration # # CONFIG_IP_VS is not set CONFIG_IPV6=m CONFIG_IPV6_PRIVACY=y CONFIG_INET6_AH=m CONFIG_INET6_ESP=m CONFIG_INET6_IPCOMP=m CONFIG_INET6_TUNNEL=m CONFIG_IPV6_TUNNEL=m CONFIG_NETFILTER=y # CONFIG_NETFILTER_DEBUG is not set CONFIG_BRIDGE_NETFILTER=y # # Core Netfilter Configuration # # CONFIG_NETFILTER_NETLINK is not set # CONFIG_NETFILTER_XTABLES is not set # # IP: Netfilter Configuration # CONFIG_IP_NF_CONNTRACK=m # CONFIG_IP_NF_CT_ACCT is not set CONFIG_IP_NF_CONNTRACK_MARK=y # CONFIG_IP_NF_CONNTRACK_EVENTS is not set # CONFIG_IP_NF_CT_PROTO_SCTP is not set CONFIG_IP_NF_FTP=m CONFIG_IP_NF_IRC=m # CONFIG_IP_NF_NETBIOS_NS is not set CONFIG_IP_NF_TFTP=m CONFIG_IP_NF_AMANDA=m # CONFIG_IP_NF_PPTP is not set CONFIG_IP_NF_QUEUE=m # # IPv6: Netfilter Configuration (EXPERIMENTAL) # CONFIG_IP6_NF_QUEUE=m # # Bridge: Netfilter Configuration # CONFIG_BRIDGE_NF_EBTABLES=m CONFIG_BRIDGE_EBT_BROUTE=m CONFIG_BRIDGE_EBT_T_FILTER=m CONFIG_BRIDGE_EBT_T_NAT=m CONFIG_BRIDGE_EBT_802_3=m CONFIG_BRIDGE_EBT_AMONG=m CONFIG_BRIDGE_EBT_ARP=m CONFIG_BRIDGE_EBT_IP=m CONFIG_BRIDGE_EBT_LIMIT=m CONFIG_BRIDGE_EBT_MARK=m CONFIG_BRIDGE_EBT_PKTTYPE=m CONFIG_BRIDGE_EBT_STP=m CONFIG_BRIDGE_EBT_VLAN=m CONFIG_BRIDGE_EBT_ARPREPLY=m CONFIG_BRIDGE_EBT_DNAT=m CONFIG_BRIDGE_EBT_MARK_T=m CONFIG_BRIDGE_EBT_REDIRECT=m # CONFIG_BRIDGE_EBT_SNAT is not set CONFIG_BRIDGE_EBT_LOG=m # CONFIG_BRIDGE_EBT_ULOG is not set # # DCCP Configuration (EXPERIMENTAL) # # CONFIG_IP_DCCP is not set # # SCTP Configuration (EXPERIMENTAL) # CONFIG_IP_SCTP=m # CONFIG_SCTP_DBG_MSG is not set # CONFIG_SCTP_DBG_OBJCNT is not set CONFIG_SCTP_HMAC_NONE=y # CONFIG_SCTP_HMAC_SHA1 is not set # CONFIG_SCTP_HMAC_MD5 is not set # CONFIG_ATM is not set CONFIG_BRIDGE=m CONFIG_VLAN_8021Q=m # CONFIG_DECNET is not set CONFIG_LLC=y CONFIG_LLC2=m CONFIG_IPX=m CONFIG_IPX_INTERN=y CONFIG_ATALK=m CONFIG_DEV_APPLETALK=y CONFIG_IPDDP=m CONFIG_IPDDP_ENCAP=y CONFIG_IPDDP_DECAP=y # CONFIG_X25 is not set # CONFIG_LAPB is not set # # TIPC Configuration (EXPERIMENTAL) # # CONFIG_TIPC is not set # CONFIG_NET_DIVERT is not set # CONFIG_ECONET is not set # CONFIG_WAN_ROUTER is not set # # QoS and/or fair queueing # CONFIG_NET_SCHED=y CONFIG_NET_SCH_CLK_JIFFIES=y # CONFIG_NET_SCH_CLK_GETTIMEOFDAY is not set # CONFIG_NET_SCH_CLK_CPU is not set # # Queueing/Scheduling # CONFIG_NET_SCH_CBQ=m CONFIG_NET_SCH_HTB=m CONFIG_NET_SCH_HFSC=m CONFIG_NET_SCH_PRIO=m CONFIG_NET_SCH_RED=m CONFIG_NET_SCH_SFQ=m CONFIG_NET_SCH_TEQL=m CONFIG_NET_SCH_TBF=m CONFIG_NET_SCH_GRED=m CONFIG_NET_SCH_DSMARK=m # CONFIG_NET_SCH_NETEM is not set CONFIG_NET_SCH_INGRESS=m # # Classification # CONFIG_NET_CLS=y # CONFIG_NET_CLS_BASIC is not set CONFIG_NET_CLS_TCINDEX=m CONFIG_NET_CLS_ROUTE4=m CONFIG_NET_CLS_ROUTE=y CONFIG_NET_CLS_FW=m CONFIG_NET_CLS_U32=m # CONFIG_CLS_U32_PERF is not set # CONFIG_CLS_U32_MARK is not set CONFIG_NET_CLS_RSVP=m CONFIG_NET_CLS_RSVP6=m # CONFIG_NET_EMATCH is not set # CONFIG_NET_CLS_ACT is not set CONFIG_NET_CLS_POLICE=y # CONFIG_NET_CLS_IND is not set CONFIG_NET_ESTIMATOR=y # # Network testing # CONFIG_NET_PKTGEN=m # CONFIG_HAMRADIO is not set # CONFIG_IRDA is not set # CONFIG_BT is not set # CONFIG_IEEE80211 is not set # # Device Drivers # # # Generic Driver Options # CONFIG_STANDALONE=y CONFIG_PREVENT_FIRMWARE_BUILD=y CONFIG_FW_LOADER=y # CONFIG_DEBUG_DRIVER is not set # # Connector - unified userspace <-> kernelspace linker # # CONFIG_CONNECTOR is not set # # Memory Technology Devices (MTD) # # CONFIG_MTD is not set # # Parallel port support # # CONFIG_PARPORT is not set # # Plug and Play support # # # Block devices # CONFIG_BLK_DEV_FD=y # CONFIG_BLK_CPQ_DA is not set # CONFIG_BLK_CPQ_CISS_DA is not set # CONFIG_BLK_DEV_DAC960 is not set # CONFIG_BLK_DEV_UMEM is not set # CONFIG_BLK_DEV_COW_COMMON is not set CONFIG_BLK_DEV_LOOP=y CONFIG_BLK_DEV_CRYPTOLOOP=m CONFIG_BLK_DEV_NBD=m # CONFIG_BLK_DEV_SX8 is not set CONFIG_BLK_DEV_RAM=y CONFIG_BLK_DEV_RAM_COUNT=16 CONFIG_BLK_DEV_RAM_SIZE=123456 CONFIG_BLK_DEV_INITRD=y # CONFIG_CDROM_PKTCDVD is not set # CONFIG_ATA_OVER_ETH is not set # # ATA/ATAPI/MFM/RLL support # CONFIG_IDE=y CONFIG_BLK_DEV_IDE=y # # Please see Documentation/ide.txt for help/info on IDE drives # # CONFIG_BLK_DEV_IDE_SATA is not set CONFIG_BLK_DEV_IDEDISK=y # CONFIG_IDEDISK_MULTI_MODE is not set CONFIG_BLK_DEV_IDECD=y # CONFIG_BLK_DEV_IDETAPE is not set # CONFIG_BLK_DEV_IDEFLOPPY is not set # CONFIG_BLK_DEV_IDESCSI is not set CONFIG_IDE_TASK_IOCTL=y # # IDE chipset support/bugfixes # CONFIG_IDE_GENERIC=y CONFIG_BLK_DEV_IDEPCI=y CONFIG_IDEPCI_SHARE_IRQ=y # CONFIG_BLK_DEV_OFFBOARD is not set CONFIG_BLK_DEV_GENERIC=y # CONFIG_BLK_DEV_OPTI621 is not set CONFIG_BLK_DEV_SL82C105=y CONFIG_BLK_DEV_IDEDMA_PCI=y CONFIG_BLK_DEV_IDEDMA_FORCED=y CONFIG_IDEDMA_PCI_AUTO=y # CONFIG_IDEDMA_ONLYDISK is not set # CONFIG_BLK_DEV_AEC62XX is not set # CONFIG_BLK_DEV_ALI15X3 is not set CONFIG_BLK_DEV_AMD74XX=y # CONFIG_BLK_DEV_CMD64X is not set # CONFIG_BLK_DEV_TRIFLEX is not set # CONFIG_BLK_DEV_CY82C693 is not set # CONFIG_BLK_DEV_CS5520 is not set # CONFIG_BLK_DEV_CS5530 is not set # CONFIG_BLK_DEV_HPT34X is not set # CONFIG_BLK_DEV_HPT366 is not set # CONFIG_BLK_DEV_SC1200 is not set # CONFIG_BLK_DEV_PIIX is not set # CONFIG_BLK_DEV_IT821X is not set # CONFIG_BLK_DEV_NS87415 is not set CONFIG_BLK_DEV_PDC202XX_OLD=y CONFIG_PDC202XX_BURST=y CONFIG_BLK_DEV_PDC202XX_NEW=y # CONFIG_PDC202XX_FORCE is not set # CONFIG_BLK_DEV_SVWKS is not set CONFIG_BLK_DEV_SIIMAGE=y # CONFIG_BLK_DEV_SLC90E66 is not set # CONFIG_BLK_DEV_TRM290 is not set # CONFIG_BLK_DEV_VIA82CXXX is not set # CONFIG_IDE_ARM is not set CONFIG_BLK_DEV_IDEDMA=y # CONFIG_IDEDMA_IVB is not set CONFIG_IDEDMA_AUTO=y # CONFIG_BLK_DEV_HD is not set # # SCSI device support # # CONFIG_RAID_ATTRS is not set CONFIG_SCSI=y CONFIG_SCSI_PROC_FS=y # # SCSI support type (disk, tape, CD-ROM) # CONFIG_BLK_DEV_SD=y CONFIG_CHR_DEV_ST=m # CONFIG_CHR_DEV_OSST is not set CONFIG_BLK_DEV_SR=m CONFIG_BLK_DEV_SR_VENDOR=y CONFIG_CHR_DEV_SG=m # CONFIG_CHR_DEV_SCH is not set # # Some SCSI devices (e.g. CD jukebox) support multiple LUNs # CONFIG_SCSI_MULTI_LUN=y CONFIG_SCSI_CONSTANTS=y CONFIG_SCSI_LOGGING=y # # SCSI Transports # CONFIG_SCSI_SPI_ATTRS=y CONFIG_SCSI_FC_ATTRS=y # CONFIG_SCSI_ISCSI_ATTRS is not set # CONFIG_SCSI_SAS_ATTRS is not set # CONFIG_SAS_CLASS is not set # # SCSI low-level drivers # # CONFIG_ISCSI_TCP is not set # CONFIG_BLK_DEV_3W_XXXX_RAID is not set # CONFIG_SCSI_3W_9XXX is not set # CONFIG_SCSI_ACARD is not set # CONFIG_SCSI_AACRAID is not set # CONFIG_SCSI_AIC7XXX is not set # CONFIG_SCSI_AIC7XXX_OLD is not set # CONFIG_SCSI_AIC79XX is not set # CONFIG_SCSI_ADVANSYS is not set # CONFIG_SCSI_ARCMSR is not set # CONFIG_MEGARAID_NEWGEN is not set # CONFIG_MEGARAID_LEGACY is not set # CONFIG_MEGARAID_SAS is not set # CONFIG_SCSI_SATA is not set # CONFIG_SCSI_BUSLOGIC is not set # CONFIG_SCSI_DMX3191D is not set # CONFIG_SCSI_EATA is not set # CONFIG_SCSI_EATA_PIO is not set # CONFIG_SCSI_FUTURE_DOMAIN is not set # CONFIG_SCSI_GDTH is not set CONFIG_SCSI_IPS=y CONFIG_SCSI_IBMVSCSI=y # CONFIG_SCSI_INITIO is not set # CONFIG_SCSI_INIA100 is not set CONFIG_SCSI_SYM53C8XX_2=y CONFIG_SCSI_SYM53C8XX_DMA_ADDRESSING_MODE=0 CONFIG_SCSI_SYM53C8XX_DEFAULT_TAGS=16 CONFIG_SCSI_SYM53C8XX_MAX_TAGS=64 CONFIG_SCSI_SYM53C8XX_MMIO=y # CONFIG_SCSI_IPR is not set # CONFIG_SCSI_QLOGIC_FC is not set # CONFIG_SCSI_QLOGIC_1280 is not set # CONFIG_SCSI_QLA_FC is not set # CONFIG_SCSI_LPFC is not set # CONFIG_SCSI_DC395x is not set # CONFIG_SCSI_DC390T is not set CONFIG_SCSI_DEBUG=m # # Multi-device support (RAID and LVM) # CONFIG_MD=y CONFIG_BLK_DEV_MD=y CONFIG_MD_LINEAR=m CONFIG_MD_RAID0=m CONFIG_MD_RAID1=m # CONFIG_MD_RAID10 is not set CONFIG_MD_RAID5=m # CONFIG_MD_RAID6 is not set CONFIG_MD_MULTIPATH=m # CONFIG_MD_FAULTY is not set CONFIG_BLK_DEV_DM=m CONFIG_DM_CRYPT=m CONFIG_DM_SNAPSHOT=m CONFIG_DM_MIRROR=m CONFIG_DM_ZERO=m # CONFIG_DM_MULTIPATH is not set # # Fusion MPT device support # # CONFIG_FUSION is not set # CONFIG_FUSION_SPI is not set # CONFIG_FUSION_FC is not set # CONFIG_FUSION_SAS is not set # # IEEE 1394 (FireWire) support # # CONFIG_IEEE1394 is not set # # I2O device support # # CONFIG_I2O is not set # # Macintosh device drivers # # CONFIG_WINDFARM is not set # # Network device support # CONFIG_NETDEVICES=y CONFIG_DUMMY=m CONFIG_BONDING=m CONFIG_EQUALIZER=m CONFIG_TUN=m # # ARCnet devices # # CONFIG_ARCNET is not set # # PHY device support # # CONFIG_PHYLIB is not set # # Ethernet (10 or 100Mbit) # CONFIG_NET_ETHERNET=y CONFIG_MII=y # CONFIG_OAKNET is not set # CONFIG_HAPPYMEAL is not set # CONFIG_SUNGEM is not set # CONFIG_CASSINI is not set # CONFIG_NET_VENDOR_3COM is not set # # Tulip family network device support # # CONFIG_NET_TULIP is not set # CONFIG_HP100 is not set CONFIG_IBMVETH=y # CONFIG_NET_PCI is not set # # Ethernet (1000 Mbit) # # CONFIG_ACENIC is not set # CONFIG_DL2K is not set CONFIG_E1000=y CONFIG_E1000_NAPI=y # CONFIG_NS83820 is not set # CONFIG_HAMACHI is not set # CONFIG_YELLOWFIN is not set # CONFIG_R8169 is not set # CONFIG_SIS190 is not set # CONFIG_SKGE is not set # CONFIG_SKY2 is not set # CONFIG_SK98LIN is not set CONFIG_TIGON3=m # CONFIG_BNX2 is not set # CONFIG_MV643XX_ETH is not set # # Ethernet (10000 Mbit) # # CONFIG_CHELSIO_T1 is not set CONFIG_IXGB=m CONFIG_IXGB_NAPI=y CONFIG_S2IO=m CONFIG_S2IO_NAPI=y # # Token Ring devices # CONFIG_TR=y CONFIG_IBMOL=m # CONFIG_3C359 is not set # CONFIG_TMS380TR is not set # # Wireless LAN (non-hamradio) # # CONFIG_NET_RADIO is not set # # Wan interfaces # # CONFIG_WAN is not set # CONFIG_FDDI is not set # CONFIG_HIPPI is not set # CONFIG_PPP is not set # CONFIG_SLIP is not set # CONFIG_NET_FC is not set # CONFIG_SHAPER is not set CONFIG_NETCONSOLE=m # CONFIG_KGDBOE is not set CONFIG_NETPOLL=y # CONFIG_NETPOLL_RX is not set # CONFIG_NETPOLL_TRAP is not set CONFIG_NET_POLL_CONTROLLER=y # # ISDN subsystem # # CONFIG_ISDN is not set # # Telephony Support # # CONFIG_PHONE is not set # # Input device support # CONFIG_INPUT=y # # Userland interfaces # CONFIG_INPUT_MOUSEDEV=y CONFIG_INPUT_MOUSEDEV_PSAUX=y CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024 CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768 CONFIG_INPUT_JOYDEV=m CONFIG_INPUT_TSDEV=m CONFIG_INPUT_TSDEV_SCREEN_X=240 CONFIG_INPUT_TSDEV_SCREEN_Y=320 CONFIG_INPUT_EVDEV=m # CONFIG_INPUT_EVBUG is not set # # Input Device Drivers # CONFIG_INPUT_KEYBOARD=y CONFIG_KEYBOARD_ATKBD=y # CONFIG_KEYBOARD_SUNKBD is not set # CONFIG_KEYBOARD_LKKBD is not set # CONFIG_KEYBOARD_XTKBD is not set # CONFIG_KEYBOARD_NEWTON is not set CONFIG_INPUT_MOUSE=y CONFIG_MOUSE_PS2=y # CONFIG_MOUSE_SERIAL is not set # CONFIG_MOUSE_VSXXXAA is not set # CONFIG_INPUT_JOYSTICK is not set # CONFIG_INPUT_TOUCHSCREEN is not set CONFIG_INPUT_MISC=y # CONFIG_INPUT_PCSPKR is not set # CONFIG_INPUT_UINPUT is not set # # Hardware I/O ports # CONFIG_SERIO=y CONFIG_SERIO_I8042=y # CONFIG_SERIO_SERPORT is not set # CONFIG_SERIO_PCIPS2 is not set CONFIG_SERIO_LIBPS2=y # CONFIG_SERIO_RAW is not set # CONFIG_GAMEPORT is not set # # Character devices # CONFIG_VT=y CONFIG_VT_CONSOLE=y CONFIG_HW_CONSOLE=y # CONFIG_SERIAL_NONSTANDARD is not set # # Serial drivers # CONFIG_SERIAL_8250=y CONFIG_SERIAL_8250_CONSOLE=y CONFIG_SERIAL_8250_NR_UARTS=4 CONFIG_SERIAL_8250_RUNTIME_UARTS=4 # CONFIG_SERIAL_8250_EXTENDED is not set # # Non-8250 serial port support # CONFIG_SERIAL_CORE=y CONFIG_SERIAL_CORE_CONSOLE=y CONFIG_SERIAL_ICOM=m # CONFIG_SERIAL_JSM is not set CONFIG_UNIX98_PTYS=y CONFIG_LEGACY_PTYS=y CONFIG_LEGACY_PTY_COUNT=256 CONFIG_HVC_CONSOLE=y CONFIG_HVCS=m # # IPMI # # CONFIG_IPMI_HANDLER is not set # # Watchdog Cards # CONFIG_WATCHDOG=y # CONFIG_WATCHDOG_NOWAYOUT is not set # # Watchdog Device Drivers # CONFIG_SOFT_WATCHDOG=m # CONFIG_WATCHDOG_RTAS is not set # # PCI-based Watchdog Cards # # CONFIG_PCIPCWATCHDOG is not set # CONFIG_WDTPCI is not set # CONFIG_RTC is not set # CONFIG_GEN_RTC is not set # CONFIG_DTLK is not set # CONFIG_R3964 is not set # CONFIG_APPLICOM is not set # # Ftape, the floppy tape device driver # # CONFIG_AGP is not set # CONFIG_DRM is not set CONFIG_RAW_DRIVER=m CONFIG_MAX_RAW_DEVS=4096 # CONFIG_HANGCHECK_TIMER is not set # # TPM devices # # CONFIG_TCG_TPM is not set # CONFIG_TELCLOCK is not set # # I2C support # # CONFIG_I2C is not set # # SPI support # # CONFIG_SPI is not set # CONFIG_SPI_MASTER is not set # # Dallas's 1-wire bus # # CONFIG_W1 is not set # # Hardware Monitoring support # CONFIG_HWMON=y # CONFIG_HWMON_VID is not set # CONFIG_SENSORS_F71805F is not set # CONFIG_HWMON_DEBUG_CHIP is not set # # Misc devices # # # Multimedia Capabilities Port drivers # # # Multimedia devices # # CONFIG_VIDEO_DEV is not set # # Digital Video Broadcasting Devices # # CONFIG_DVB is not set # # Graphics support # CONFIG_FB=y CONFIG_FB_CFB_FILLRECT=y CONFIG_FB_CFB_COPYAREA=y CONFIG_FB_CFB_IMAGEBLIT=y CONFIG_FB_MACMODES=y # CONFIG_FB_MODE_HELPERS is not set CONFIG_FB_TILEBLITTING=y # CONFIG_FB_CIRRUS is not set # CONFIG_FB_PM2 is not set # CONFIG_FB_CYBER2000 is not set CONFIG_FB_OF=y # CONFIG_FB_CT65550 is not set # CONFIG_FB_ASILIANT is not set # CONFIG_FB_IMSTT is not set # CONFIG_FB_VGA16 is not set # CONFIG_FB_S1D13XXX is not set # CONFIG_FB_NVIDIA is not set # CONFIG_FB_RIVA is not set # CONFIG_FB_MATROX is not set # CONFIG_FB_RADEON_OLD is not set # CONFIG_FB_RADEON is not set # CONFIG_FB_ATY128 is not set # CONFIG_FB_ATY is not set # CONFIG_FB_S3TRIO is not set # CONFIG_FB_SAVAGE is not set # CONFIG_FB_SIS is not set # CONFIG_FB_NEOMAGIC is not set # CONFIG_FB_KYRO is not set # CONFIG_FB_3DFX is not set # CONFIG_FB_VOODOO1 is not set # CONFIG_FB_TRIDENT is not set # CONFIG_FB_PM3 is not set # CONFIG_FB_VIRTUAL is not set # # Console display driver support # # CONFIG_VGA_CONSOLE is not set CONFIG_DUMMY_CONSOLE=y # CONFIG_FRAMEBUFFER_CONSOLE is not set # # Logo configuration # # CONFIG_LOGO is not set # CONFIG_BACKLIGHT_LCD_SUPPORT is not set # # Sound # # CONFIG_SOUND is not set # # USB support # CONFIG_USB_ARCH_HAS_HCD=y CONFIG_USB_ARCH_HAS_OHCI=y # CONFIG_USB is not set # # NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' # # # USB Gadget Support # # CONFIG_USB_GADGET is not set # # MMC/SD Card support # # CONFIG_MMC is not set # # InfiniBand support # # CONFIG_INFINIBAND is not set # # SN Devices # # # EDAC - error detection and reporting (RAS) # # # Distributed Lock Manager # # CONFIG_DLM is not set # # File systems # CONFIG_EXT2_FS=y CONFIG_EXT2_FS_XATTR=y CONFIG_EXT2_FS_POSIX_ACL=y CONFIG_EXT2_FS_SECURITY=y # CONFIG_EXT2_FS_XIP is not set CONFIG_EXT3_FS=y CONFIG_EXT3_FS_XATTR=y CONFIG_EXT3_FS_POSIX_ACL=y CONFIG_EXT3_FS_SECURITY=y CONFIG_JBD=y # CONFIG_JBD_DEBUG is not set CONFIG_FS_MBCACHE=y # CONFIG_REISER4_FS is not set # CONFIG_REISERFS_FS is not set # CONFIG_JFS_FS is not set CONFIG_FS_POSIX_ACL=y # CONFIG_XFS_FS is not set # CONFIG_OCFS2_FS is not set # CONFIG_MINIX_FS is not set # CONFIG_ROMFS_FS is not set CONFIG_INOTIFY=y # CONFIG_QUOTA is not set CONFIG_DNOTIFY=y # CONFIG_AUTOFS_FS is not set # CONFIG_AUTOFS4_FS is not set # CONFIG_FUSE_FS is not set # # CD-ROM/DVD Filesystems # # CONFIG_ISO9660_FS is not set # CONFIG_UDF_FS is not set # # DOS/FAT/NT Filesystems # # CONFIG_MSDOS_FS is not set # CONFIG_VFAT_FS is not set # CONFIG_NTFS_FS is not set # # Pseudo filesystems # CONFIG_PROC_FS=y CONFIG_PROC_KCORE=y CONFIG_SYSFS=y CONFIG_TMPFS=y CONFIG_HUGETLBFS=y CONFIG_HUGETLB_PAGE=y CONFIG_RAMFS=y # CONFIG_RELAYFS_FS is not set # CONFIG_CONFIGFS_FS is not set # # Miscellaneous filesystems # # CONFIG_ADFS_FS is not set # CONFIG_AFFS_FS is not set # CONFIG_ASFS_FS is not set # CONFIG_HFS_FS is not set # CONFIG_HFSPLUS_FS is not set # CONFIG_BEFS_FS is not set # CONFIG_BFS_FS is not set # CONFIG_EFS_FS is not set CONFIG_CRAMFS=y # CONFIG_VXFS_FS is not set # CONFIG_HPFS_FS is not set # CONFIG_QNX4FS_FS is not set # CONFIG_SYSV_FS is not set CONFIG_UFS_FS=m # CONFIG_UFS_FS_WRITE is not set # # Network File Systems # CONFIG_NFS_FS=y CONFIG_NFS_V3=y # CONFIG_NFS_V3_ACL is not set # CONFIG_NFS_V4 is not set CONFIG_NFS_DIRECTIO=y # CONFIG_NFSD is not set CONFIG_LOCKD=y CONFIG_LOCKD_V4=y CONFIG_NFS_COMMON=y CONFIG_SUNRPC=y # CONFIG_RPCSEC_GSS_KRB5 is not set # CONFIG_RPCSEC_GSS_SPKM3 is not set # CONFIG_SMB_FS is not set # CONFIG_CIFS is not set # CONFIG_NCP_FS is not set # CONFIG_CODA_FS is not set # CONFIG_AFS_FS is not set # CONFIG_9P_FS is not set # # Partition Types # # CONFIG_PARTITION_ADVANCED is not set CONFIG_MSDOS_PARTITION=y # # Native Language Support # # CONFIG_NLS is not set # # Library routines # CONFIG_CRC_CCITT=y # CONFIG_CRC16 is not set CONFIG_CRC32=y # CONFIG_LIBCRC32C is not set CONFIG_ZLIB_INFLATE=y CONFIG_ZLIB_DEFLATE=m # # Instrumentation Support # # CONFIG_PROFILING is not set # CONFIG_KPROBES is not set # # Kernel hacking # # CONFIG_PRINTK_TIME is not set CONFIG_MAGIC_SYSRQ=y # CONFIG_DEBUG_SHIRQ is not set CONFIG_DEBUG_KERNEL=y CONFIG_LOG_BUF_SHIFT=19 CONFIG_DETECT_SOFTLOCKUP=y # CONFIG_SCHEDSTATS is not set # CONFIG_DEBUG_SLAB is not set CONFIG_DEBUG_MUTEXES=y # CONFIG_DEBUG_SPINLOCK is not set # CONFIG_DEBUG_SPINLOCK_SLEEP is not set # CONFIG_DEBUG_KOBJECT is not set # CONFIG_DEBUG_INFO is not set # CONFIG_DEBUG_FS is not set # CONFIG_DEBUG_VM is not set CONFIG_FORCED_INLINING=y # CONFIG_RCU_TORTURE_TEST is not set # CONFIG_DEBUG_SYNCHRO_TEST is not set CONFIG_DEBUG_STACKOVERFLOW=y CONFIG_DEBUG_STACK_USAGE=y CONFIG_DEBUGGER=y # CONFIG_KGDB is not set CONFIG_XMON=y # CONFIG_XMON_DEFAULT is not set CONFIG_IRQSTACKS=y # CONFIG_BOOTX_TEXT is not set # CONFIG_PPC_EARLY_DEBUG_LPAR is not set # CONFIG_PPC_EARLY_DEBUG_G5 is not set # CONFIG_PPC_EARLY_DEBUG_RTAS is not set # CONFIG_PPC_EARLY_DEBUG_MAPLE is not set # CONFIG_PPC_EARLY_DEBUG_ISERIES is not set # # Security options # # CONFIG_KEYS is not set CONFIG_SECURITY=y CONFIG_SECURITY_NETWORK=y # CONFIG_SECURITY_NETWORK_XFRM is not set CONFIG_SECURITY_CAPABILITIES=y # CONFIG_SECURITY_SECLVL is not set CONFIG_SECURITY_SELINUX=y CONFIG_SECURITY_SELINUX_BOOTPARAM=y CONFIG_SECURITY_SELINUX_BOOTPARAM_VALUE=1 CONFIG_SECURITY_SELINUX_DISABLE=y CONFIG_SECURITY_SELINUX_DEVELOP=y CONFIG_SECURITY_SELINUX_AVC_STATS=y CONFIG_SECURITY_SELINUX_CHECKREQPROT_VALUE=1 # # Cryptographic options # CONFIG_CRYPTO=y CONFIG_CRYPTO_HMAC=y CONFIG_CRYPTO_NULL=m # CONFIG_CRYPTO_MD4 is not set CONFIG_CRYPTO_MD5=y CONFIG_CRYPTO_SHA1=y # CONFIG_CRYPTO_SHA256 is not set # CONFIG_CRYPTO_SHA512 is not set # CONFIG_CRYPTO_WP512 is not set # CONFIG_CRYPTO_TGR192 is not set CONFIG_CRYPTO_DES=m CONFIG_CRYPTO_BLOWFISH=m CONFIG_CRYPTO_TWOFISH=m CONFIG_CRYPTO_SERPENT=m CONFIG_CRYPTO_AES=m # CONFIG_CRYPTO_CAST5 is not set # CONFIG_CRYPTO_CAST6 is not set # CONFIG_CRYPTO_TEA is not set # CONFIG_CRYPTO_ARC4 is not set # CONFIG_CRYPTO_KHAZAD is not set # CONFIG_CRYPTO_ANUBIS is not set CONFIG_CRYPTO_DEFLATE=m # CONFIG_CRYPTO_MICHAEL_MIC is not set # CONFIG_CRYPTO_CRC32C is not set CONFIG_CRYPTO_TEST=m # # Hardware crypto devices # From michael at ellerman.id.au Tue Jan 17 00:00:54 2006 From: michael at ellerman.id.au (Michael Ellerman) Date: Tue, 17 Jan 2006 00:00:54 +1100 Subject: 2.6.15-mm4 failure on power5 In-Reply-To: <20060115230557.0f07a55c.akpm@osdl.org> References: <20060116063530.GB23399@sergelap.austin.ibm.com> <20060115230557.0f07a55c.akpm@osdl.org> Message-ID: <200601170000.58134.michael@ellerman.id.au> On Mon, 16 Jan 2006 18:05, Andrew Morton wrote: > "Serge E. Hallyn" wrote: > > On my power5 partition, 2.6.15-mm4 hangs on boot > > It might be worth reverting the changes to arch/powerpc/mm/hash_utils_64.c, > see if that unbreaks it. > > - base = lmb.memory.region[i].base + KERNELBASE; > + base = (unsigned long)__va(lmb.memory.region[i].base); You can try it, but if that fixes the problem I'll buy a sombrero and then eat it. > The nice comment in page.h: > > * KERNELBASE is the virtual address of the start of the kernel, it's often > * the same as PAGE_OFFSET, but _might not be_. > * > * The kdump dump kernel is one example where KERNELBASE != PAGE_OFFSET. > * > * To get a physical address from a virtual one you subtract PAGE_OFFSET, > * _not_ KERNELBASE. > > Tells us that was not an equivalent transformation. True, not equivalent in all cases, but correct. For non-kdump kernels (which I assume this is) KERNELBASE == PAGE_OFFSET, and for a kdump kernel that code wants to use PAGE_OFFSET, not KERNELBASE. Try enabling early debugging (see arch/powerpc/kernel/setup_64.c) and then turning on DEBUG in hash_utils_64.c, setup_64.c etc. cheers -- Michael Ellerman IBM OzLabs email: michael:ellerman.id.au inmsg: mpe:jabber.org wwweb: http://michael.ellerman.id.au phone: +61 2 6212 1183 (tie line 70 21183) We do not inherit the earth from our ancestors, we borrow it from our children. - S.M.A.R.T Person -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: not available Url : http://ozlabs.org/pipermail/linuxppc64-dev/attachments/20060117/099ae637/attachment.pgp From sharada at in.ibm.com Tue Jan 17 02:16:50 2006 From: sharada at in.ibm.com (R Sharada) Date: Mon, 16 Jan 2006 20:46:50 +0530 Subject: [PATCH 5/6] ppc64-kdump-elf-hdr-generation.patch In-Reply-To: <20060116151245.GE4029@in.ibm.com> References: <20060116150712.GA4029@in.ibm.com> <20060116150855.GB4029@in.ibm.com> <20060116150957.GC4029@in.ibm.com> <20060116151052.GD4029@in.ibm.com> <20060116151245.GE4029@in.ibm.com> Message-ID: <20060116151650.GI4029@in.ibm.com> This patch implements the elf core header generation - creates elf core headers as 64 bit elf code headers - includes required #defines Signed-off-by: R Sharada --- diff -puN kexec/arch/ppc64/crashdump-ppc64.c~ppc64-kdump-elf-hdr-generation kexec/arch/ppc64/crashdump-ppc64.c --- kexec-tools-1.101/kexec/arch/ppc64/crashdump-ppc64.c~ppc64-kdump-elf-hdr-generation 2006-01-17 07:10:25.000000000 +0530 +++ kexec-tools-1.101-sharada/kexec/arch/ppc64/crashdump-ppc64.c 2006-01-17 07:21:42.000000000 +0530 @@ -257,6 +257,101 @@ static int add_cmdline_param(char *cmdli return 0; } +/* Prepares the crash memory elf64 headers and stores in supplied buffer. */ +static int prepare_crash_memory_elf64_headers(struct kexec_info *info, + void *buf, unsigned long size) +{ + Elf64_Ehdr *elf; + Elf64_Phdr *phdr; + int i; + char *bufp; + long int nr_cpus = 0; + unsigned long notes_addr; + + bufp = (char*) buf; + + /* Setup ELF Header*/ + elf = (Elf64_Ehdr *) bufp; + bufp += sizeof(Elf64_Ehdr); + memcpy(elf->e_ident, ELFMAG, SELFMAG); + elf->e_ident[EI_CLASS] = ELFCLASS64; + elf->e_ident[EI_DATA] = ELFDATA2MSB; + elf->e_ident[EI_VERSION]= EV_CURRENT; + elf->e_ident[EI_OSABI] = ELFOSABI_NONE; + memset(elf->e_ident+EI_PAD, 0, EI_NIDENT-EI_PAD); + elf->e_type = ET_CORE; + elf->e_machine = EM_PPC64; + elf->e_version = EV_CURRENT; + elf->e_entry = 0; + elf->e_phoff = sizeof(Elf64_Ehdr); + elf->e_shoff = 0; + elf->e_flags = 0; + elf->e_ehsize = sizeof(Elf64_Ehdr); + elf->e_phentsize= sizeof(Elf64_Phdr); + elf->e_phnum = 0; + elf->e_shentsize= 0; + elf->e_shnum = 0; + elf->e_shstrndx = 0; + + /* PT_NOTE program headers. One per cpu*/ + nr_cpus = sysconf(_SC_NPROCESSORS_CONF); + if (nr_cpus < 0) + return -1; + + /* Need to find a better way to determine per cpu notes section size. */ +#define MAX_NOTE_BYTES 1024 + for (i = 0; i < nr_cpus; i++) { + if (get_crash_notes_per_cpu(i, ¬es_addr) < 0) { + /* This cpu is not present. Skip it. */ + continue; + } + phdr = (Elf64_Phdr *) bufp; + bufp += sizeof(Elf64_Phdr); + phdr->p_type = PT_NOTE; + phdr->p_flags = 0; + phdr->p_offset = phdr->p_paddr = notes_addr; + phdr->p_vaddr = 0; + phdr->p_filesz = phdr->p_memsz = MAX_NOTE_BYTES; + /* Do we need any alignment of segments? */ + phdr->p_align = 0; + + /* Increment number of program headers. */ + (elf->e_phnum)++; + } + + /* Setup PT_LOAD type program header for every system RAM chunk. + * A seprate program header for Backup Region + */ + for (i = 0; i < CRASH_MAX_MEMORY_RANGES; i++) { + unsigned long long mstart, mend; + mstart = crash_memory_range[i].start; + mend = crash_memory_range[i].end; + if (!mstart && !mend) + break; + phdr = (Elf64_Phdr *) bufp; + bufp += sizeof(Elf64_Phdr); + phdr->p_type = PT_LOAD; + phdr->p_flags = PF_R|PF_W|PF_X; + if (mstart == BACKUP_START && mend == BACKUP_END) + phdr->p_offset = info->backup_start; + else + phdr->p_offset = mstart; + /* Handle linearly mapped region.*/ + if (mend <= (MAXMEM - 1)) + phdr->p_vaddr = mstart + PAGE_OFFSET; + else + phdr->p_vaddr = -1ULL; + phdr->p_paddr = mstart; + phdr->p_filesz = phdr->p_memsz = mend - mstart; + /* Do we need any alignment of segments? */ + phdr->p_align = 0; + + /* Increment number of program headers. */ + (elf->e_phnum)++; + } + return 0; +} + /* Loads additional segments in case of a panic kernel is being loaded. * One segment for backup region, another segment for storing elf headers * for crash memory image. diff -puN kexec/arch/ppc64/kexec-ppc64.h~ppc64-kdump-elf-hdr-generation kexec/arch/ppc64/kexec-ppc64.h --- kexec-tools-1.101/kexec/arch/ppc64/kexec-ppc64.h~ppc64-kdump-elf-hdr-generation 2006-01-17 07:10:25.000000000 +0530 +++ kexec-tools-1.101-sharada/kexec/arch/ppc64/kexec-ppc64.h 2006-01-17 07:10:25.000000000 +0530 @@ -4,6 +4,8 @@ #define MAX_MEMORY_RANGES 256 /* TO FIX - needs to be dynamically set */ #define MAXBYTES 128 #define MAX_LINE 160 +#define CORE_TYPE_ELF32 1 +#define CORE_TYPE_ELF64 2 int setup_memory_ranges(unsigned long kexec_flags); @@ -26,6 +28,10 @@ struct bootblock { boot_physid; }; +struct arch_options_t { + int core_header_type; +}; + struct exclude_range { unsigned long long start, end; }; diff -puN kexec/arch/ppc64/kexec-ppc64.c~ppc64-kdump-elf-hdr-generation kexec/arch/ppc64/kexec-ppc64.c --- kexec-tools-1.101/kexec/arch/ppc64/kexec-ppc64.c~ppc64-kdump-elf-hdr-generation 2006-01-17 07:10:25.000000000 +0530 +++ kexec-tools-1.101-sharada/kexec/arch/ppc64/kexec-ppc64.c 2006-01-17 07:10:25.000000000 +0530 @@ -578,17 +578,18 @@ int file_types = sizeof(file_type) / siz void arch_usage(void) { fprintf(stderr, " --devicetreeblob= Specify device tree blob file.\n"); + fprintf(stderr, " --elf64-core-headers Prepare core headers in ELF64 format\n"); } -static struct { -} arch_options = { +struct arch_options_t arch_options = { + .core_header_type = CORE_TYPE_ELF64, }; int arch_process_options(int argc, char **argv) { static const struct option options[] = { KEXEC_ARCH_OPTIONS - { 0, 0, NULL, 0 }, + { 0, 0, NULL, 0 }, }; static const char short_options[] = KEXEC_ARCH_OPT_STR; int opt; @@ -598,6 +599,9 @@ int arch_process_options(int argc, char switch(opt) { default: break; + case OPT_ELF64_CORE: + arch_options.core_header_type = CORE_TYPE_ELF64; + break; } } /* Reset getopt for the next pass; called in other source modules */ diff -puN kexec/arch/ppc64/include/arch/options.h~ppc64-kdump-elf-hdr-generation kexec/arch/ppc64/include/arch/options.h --- kexec-tools-1.101/kexec/arch/ppc64/include/arch/options.h~ppc64-kdump-elf-hdr-generation 2006-01-17 07:10:25.000000000 +0530 +++ kexec-tools-1.101-sharada/kexec/arch/ppc64/include/arch/options.h 2006-01-17 07:10:25.000000000 +0530 @@ -2,9 +2,11 @@ #define KEXEC_ARCH_PPC64_OPTIONS_H #define OPT_ARCH_MAX (OPT_MAX+0) +#define OPT_ELF64_CORE (OPT_MAX+1) #define KEXEC_ARCH_OPTIONS \ KEXEC_OPTIONS \ + { "elf64-core-headers", 0, 0, OPT_ELF64_CORE }, \ #define KEXEC_ARCH_OPT_STR KEXEC_OPT_STR "" _ From sharada at in.ibm.com Tue Jan 17 02:17:56 2006 From: sharada at in.ibm.com (R Sharada) Date: Mon, 16 Jan 2006 20:47:56 +0530 Subject: [PATCH 6/6] ppc64-kdump-purgatory-backup-support.patch In-Reply-To: <20060116151650.GI4029@in.ibm.com> References: <20060116150712.GA4029@in.ibm.com> <20060116150855.GB4029@in.ibm.com> <20060116150957.GC4029@in.ibm.com> <20060116151052.GD4029@in.ibm.com> <20060116151245.GE4029@in.ibm.com> <20060116151650.GI4029@in.ibm.com> Message-ID: <20060116151756.GJ4029@in.ibm.com> This patch implements the purgatory support to take backup of the first 32KB of the first kernel - Modified the v2wrap code to make the secondary cpus spin directly in the v2wrap after pulling them out of kexec_wait - Use the elf_rel function support to set the various symbols used in purgatory - load device-tree as a separate segment - other miscellaneous compiler warnings cleanup - add purgatory code support for backup - build purgatory as relocatable for ppc64 Signed-off-by: R Sharada Signed-off-by: Mohan Kumar M --- diff -puN kexec/arch/ppc64/fs2dt.c~ppc64-kdump-purgatory-backup-support kexec/arch/ppc64/fs2dt.c --- kexec-tools-1.101/kexec/arch/ppc64/fs2dt.c~ppc64-kdump-purgatory-backup-support 2006-01-17 07:23:35.000000000 +0530 +++ kexec-tools-1.101-sharada/kexec/arch/ppc64/fs2dt.c 2006-01-17 07:23:35.000000000 +0530 @@ -374,7 +374,7 @@ void putnode(void) } int create_flatten_tree(struct kexec_info *info, unsigned char **bufp, - unsigned long *sizep, char *cmdline) + unsigned long *sizep, char *cmdline) { unsigned long len; unsigned long tlen; @@ -420,10 +420,10 @@ int create_flatten_tree(struct kexec_inf reserve(me, bb->totalsize); /* patched later in kexec_load */ - buf = (unsigned char *) realloc(*bufp, *sizep + bb->totalsize); + buf = (unsigned char *) malloc(bb->totalsize); *bufp = buf; - memcpy(buf+(*sizep), bb, bb->off_mem_rsvmap); - tlen = *sizep + bb->off_mem_rsvmap; + memcpy(buf, bb, bb->off_mem_rsvmap); + tlen = bb->off_mem_rsvmap; memcpy(buf+tlen, mem_rsrv, bb->off_dt_struct - bb->off_mem_rsvmap); tlen = tlen + (bb->off_dt_struct - bb->off_mem_rsvmap); memcpy(buf+tlen, dtstruct, bb->off_dt_strings - bb->off_dt_struct); diff -puN kexec/arch/ppc64/kexec-elf-ppc64.c~ppc64-kdump-purgatory-backup-support kexec/arch/ppc64/kexec-elf-ppc64.c --- kexec-tools-1.101/kexec/arch/ppc64/kexec-elf-ppc64.c~ppc64-kdump-purgatory-backup-support 2006-01-17 07:23:35.000000000 +0530 +++ kexec-tools-1.101-sharada/kexec/arch/ppc64/kexec-elf-ppc64.c 2006-01-17 07:23:35.000000000 +0530 @@ -4,6 +4,7 @@ * Copyright (C) 2004 Adam Litke (agl at us.ibm.com) * Copyright (C) 2004 IBM Corp. * Copyright (C) 2005 R Sharada (sharada at in.ibm.com) + * Copyright (C) 2006 Mohan Kumar M (mohan at in.ibm.com) * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -45,6 +46,7 @@ unsigned long initrd_base, initrd_size; int create_flatten_tree(struct kexec_info *, unsigned char **, unsigned long *, char *); +int my_r2(struct mem_ehdr *ehdr); int elf_ppc64_probe(const char *buf, off_t len) { @@ -83,6 +85,10 @@ int elf_ppc64_load(int argc, char **argv struct bootblock *bb_ptr; unsigned int nr_segments, i; int result, opt; + unsigned long my_kernel, my_dt_offset; + unsigned int my_panic_kernel; + unsigned long my_stack, my_backup_start; + unsigned long toc_addr; #define OPT_APPEND (OPT_ARCH_MAX+0) #define OPT_RAMDISK (OPT_ARCH_MAX+1) @@ -167,7 +173,7 @@ int elf_ppc64_load(int argc, char **argv size = phdr->p_memsz; hole_addr = (unsigned long)locate_hole(info, size, 0, 0, - 0xFFFFFFFFFFFFFFFFUL, 1); + max_addr, 1); ehdr.e_phdr[0].p_paddr = hole_addr; result = elf_exec_load(&ehdr, info); if (result < 0) { @@ -175,24 +181,6 @@ int elf_ppc64_load(int argc, char **argv return result; } - /* Add a ram-disk to the current image */ - if (ramdisk) { - if (devicetreeblob) { - fprintf(stderr, "Can't use ramdisk with device tree blob input\n"); - return -1; - } - unsigned char *ramdisk_buf = NULL; - off_t ramdisk_size = 0; - unsigned long long ramdisk_addr; - - ramdisk_buf = slurp_file(ramdisk, &ramdisk_size); - add_buffer(info, ramdisk_buf, ramdisk_size, ramdisk_size, 0, 0, - 0xFFFFFFFFFFFFFFFFUL, 1); - ramdisk_addr = (unsigned long long)info->segment[info->nr_segments-1].mem; - initrd_base = ramdisk_addr; - initrd_size = ramdisk_size; - } - /* If panic kernel is being loaded, additional segments need * to be created. */ @@ -207,68 +195,136 @@ int elf_ppc64_load(int argc, char **argv } /* Add v2wrap to the current image */ - unsigned char *v2wrap_buf = NULL; - off_t v2wrap_size = 0; - unsigned long long *rsvmap_ptr; - struct bootblock *bb_ptr; - unsigned int devtree_size; + seg_buf = NULL; + seg_size = 0; - v2wrap_buf = (char *) malloc(purgatory_size); - if (v2wrap_buf == NULL) { + seg_buf = (char *) malloc(purgatory_size); + if (seg_buf == NULL) { free_elf_info(&ehdr); return -1; } - memcpy(v2wrap_buf, purgatory, purgatory_size); - v2wrap_size = purgatory_size; + memcpy(seg_buf, purgatory, purgatory_size); + seg_size = purgatory_size; + elf_rel_build_load(info, &info->rhdr, purgatory, purgatory_size, + 0, max_addr, 1); + + /* Add a ram-disk to the current image + * Note: Add the ramdisk after elf_rel_build_load + */ + if (ramdisk) { + if (devicetreeblob) { + fprintf(stderr, + "Can't use ramdisk with device tree blob input\n"); + return -1; + } + seg_buf = slurp_file(ramdisk, &seg_size); + add_buffer(info, seg_buf, seg_size, seg_size, 0, 0, max_addr, 1); + hole_addr = (unsigned long long) + info->segment[info->nr_segments-1].mem; + initrd_base = hole_addr; + initrd_size = (unsigned long long) + info->segment[info->nr_segments-1].memsz; + } /* ramdisk */ + if (devicetreeblob) { - unsigned char *blob_buf = NULL; - off_t blob_size = 0; - unsigned char *tmp_buf = NULL; - - /* Grab device tree from buffer */ - blob_buf = slurp_file(devicetreeblob, &blob_size); - - /* Append to purgatory */ - tmp_buf = (unsigned char *) realloc(v2wrap_buf, v2wrap_size + blob_size); - v2wrap_buf = tmp_buf; - memcpy(v2wrap_buf+v2wrap_size, blob_buf, blob_size); - v2wrap_size += blob_size; + unsigned char *blob_buf = NULL; + off_t blob_size = 0; + + /* Grab device tree from buffer */ + blob_buf = slurp_file(devicetreeblob, &blob_size); + add_buffer(info, blob_buf, blob_size, blob_size, 0, 0, + max_addr, -1); } else { - /* create from fs2dt */ - create_flatten_tree(info, &v2wrap_buf, &v2wrap_size); + /* create from fs2dt */ + seg_buf = NULL; + seg_size = 0; + create_flatten_tree(info, &seg_buf, &seg_size, cmdline); + add_buffer(info, seg_buf, seg_size, seg_size, + 0, 0, max_addr, -1); } - add_buffer(info, v2wrap_buf, v2wrap_size, v2wrap_size, 0, 0, - 0xFFFFFFFFFFFFFFFFUL, -1); /* patch reserve map address for flattened device-tree - find last entry (both 0) in the reserve mem list. Assume DT - entry is before this one */ + * find last entry (both 0) in the reserve mem list. Assume DT + * entry is before this one + */ bb_ptr = (struct bootblock *)( - (unsigned char *)info->segment[(info->nr_segments)-1].buf + - 0x100); + (unsigned char *)info->segment[(info->nr_segments)-1].buf); rsvmap_ptr = (long long *)( (unsigned char *)info->segment[(info->nr_segments)-1].buf + - bb_ptr->off_mem_rsvmap + 0x100); - while (*rsvmap_ptr || *(rsvmap_ptr+1)){ + bb_ptr->off_mem_rsvmap); + while (*rsvmap_ptr || *(rsvmap_ptr+1)) rsvmap_ptr += 2; - } rsvmap_ptr -= 2; *rsvmap_ptr = (unsigned long long)( - info->segment[(info->nr_segments)-1].mem + 0x100); - rsvmap_ptr++; - *rsvmap_ptr = (unsigned long long)bb_ptr->totalsize; + info->segment[(info->nr_segments)-1].mem); + rsvmap_ptr++; + *rsvmap_ptr = (unsigned long long)bb_ptr->totalsize; - unsigned int nr_segments; nr_segments = info->nr_segments; - lp = info->segment[nr_segments-1].buf + 0x100; - lp--; - *lp = info->segment[0].mem; - info->entry = info->segment[nr_segments-1].mem; - unsigned int i; + /* Set kernel */ + my_kernel = (unsigned long )info->segment[0].mem; + elf_rel_set_symbol(&info->rhdr, "kernel", &my_kernel, sizeof(my_kernel)); + + /* Set dt_offset */ + my_dt_offset = (unsigned long )info->segment[nr_segments-1].mem; + elf_rel_set_symbol(&info->rhdr, "dt_offset", &my_dt_offset, + sizeof(my_dt_offset)); + + if (info->kexec_flags & KEXEC_ON_CRASH) { + my_panic_kernel = 1; + /* Set panic flag */ + elf_rel_set_symbol(&info->rhdr, "panic_kernel", + &my_panic_kernel, sizeof(my_panic_kernel)); + + /* Set backup address */ + my_backup_start = info->backup_start; + elf_rel_set_symbol(&info->rhdr, "backup_start", + &my_backup_start, sizeof(my_backup_start)); + } + + /* Set stack address */ + my_stack = locate_hole(info, 16*1024, 0, 0, max_addr, 1); + my_stack += 16*1024; + elf_rel_set_symbol(&info->rhdr, "stack", &my_stack, sizeof(my_stack)); + + /* Set toc */ + toc_addr = (unsigned long) my_r2(&info->rhdr); + elf_rel_set_symbol(&info->rhdr, "my_toc", &toc_addr, sizeof(toc_addr)); + +#ifdef DEBUG + my_kernel = 0; + my_dt_offset = 0; + my_panic_kernel = 0; + my_backup_start = 0; + my_stack = 0; + toc_addr = 0; + + elf_rel_get_symbol(&info->rhdr, "kernel", &my_kernel, sizeof(my_kernel)); + elf_rel_get_symbol(&info->rhdr, "dt_offset", &my_dt_offset, + sizeof(my_dt_offset)); + elf_rel_get_symbol(&info->rhdr, "panic_kernel", &my_panic_kernel, + sizeof(my_panic_kernel)); + elf_rel_get_symbol(&info->rhdr, "backup_start", &my_backup_start, + sizeof(my_backup_start)); + elf_rel_get_symbol(&info->rhdr, "stack", &my_stack, sizeof(my_stack)); + elf_rel_get_symbol(&info->rhdr, "my_toc", &toc_addr, + sizeof(toc_addr)); + + fprintf(stderr, "info->entry is %p\n", info->entry); + fprintf(stderr, "kernel is %Lx\n", my_kernel); + fprintf(stderr, "dt_offset is %Lx\n", my_dt_offset); + fprintf(stderr, "panic_kernel is %x\n", my_panic_kernel); + fprintf(stderr, "backup_start is %Lx\n", my_backup_start); + fprintf(stderr, "stack is %Lx\n", my_stack); + fprintf(stderr, "toc_addr is %Lx\n", toc_addr); + fprintf(stderr, "purgatory size is %d\n", purgatory_size); +#endif + for (i = 0; i < nr_segments; i++) - printf("segment[i].mem:%lx\n", info->segment[i].mem); + fprintf(stderr, "segment[%d].mem:%p memsz:%ld\n", i, + info->segment[i].mem, info->segment[i].memsz); return 0; } diff -puN kexec/arch/ppc64/kexec-elf-rel-ppc64.c~ppc64-kdump-purgatory-backup-support kexec/arch/ppc64/kexec-elf-rel-ppc64.c --- kexec-tools-1.101/kexec/arch/ppc64/kexec-elf-rel-ppc64.c~ppc64-kdump-purgatory-backup-support 2006-01-17 07:23:35.000000000 +0530 +++ kexec-tools-1.101-sharada/kexec/arch/ppc64/kexec-elf-rel-ppc64.c 2006-01-17 07:35:50.000000000 +0530 @@ -1,5 +1,6 @@ #include #include +#include #include "../../kexec.h" #include "../../kexec-elf.h" @@ -21,20 +22,19 @@ static struct mem_shdr *toc_section(cons { struct mem_shdr *shdr, *shdr_end; unsigned char *strtab; - strtab = ehdr->e_shdr[ehdr->e_shstrndx].sh_data; + strtab = (unsigned char *)ehdr->e_shdr[ehdr->e_shstrndx].sh_data; shdr_end = &ehdr->e_shdr[ehdr->e_shnum]; - for(shdr = ehdr->e_shdr; shdr != shdr_end; shdr++) { - if (strcmp(shdr->sh_name, ".toc") == 0) { + for(shdr = ehdr->e_shdr; shdr != shdr_end; shdr++) + if ( shdr->sh_size && + strcmp(&strtab[shdr->sh_name], ".toc") == 0) return shdr; - } - } return NULL; } /* r2 is the TOC pointer: it actually points 0x8000 into the TOC (this gives the value maximum span in an instruction which uses a signed offset) */ -static unsigned long my_r2(const struct mem_ehdr *ehdr) +unsigned long my_r2(const struct mem_ehdr *ehdr) { struct mem_shdr *shdr; shdr = toc_section(ehdr); @@ -53,7 +53,7 @@ void machine_apply_elf_rel(struct mem_eh /* Simply set it */ *(uint32_t *)location = value; break; - + case R_PPC64_ADDR64: /* Simply set it */ *(uint64_t *)location = value; @@ -78,15 +78,34 @@ void machine_apply_elf_rel(struct mem_eh /* Convert value to relative */ value -= address; if (value + 0x2000000 > 0x3ffffff || (value & 3) != 0){ - die("REL24 %li out of range!\n", + die("REL24 %li out of range!\n", (long int)value); } /* Only replace bits 2 through 26 */ - *(uint32_t *)location - = (*(uint32_t *)location & ~0x03fffffc) - | (value & 0x03fffffc); + *(uint32_t *)location = (*(uint32_t *)location & ~0x03fffffc) + | (value & 0x03fffffc); + break; + + case R_PPC64_ADDR16_LO: + *(uint16_t *)location = value & 0xffff; + break; + + case R_PPC64_ADDR16_HI: + *(uint16_t *)location = (value>>16) & 0xffff; break; + + case R_PPC64_ADDR16_HA: + *(uint16_t *)location = ((value>>16) & 0xffff); + break; + + case R_PPC64_ADDR16_HIGHEST: + *(uint16_t *)location = ((value>>48) & 0xffff); + break; + case R_PPC64_ADDR16_HIGHER: + *(uint16_t *)location = ((value>>32) & 0xffff); + break; + default: die("Unknown rela relocation: %lu\n", r_type); break; diff -puN kexec/arch/ppc64/kexec-zImage-ppc64.c~ppc64-kdump-purgatory-backup-support kexec/arch/ppc64/kexec-zImage-ppc64.c --- kexec-tools-1.101/kexec/arch/ppc64/kexec-zImage-ppc64.c~ppc64-kdump-purgatory-backup-support 2006-01-17 07:23:35.000000000 +0530 +++ kexec-tools-1.101-sharada/kexec/arch/ppc64/kexec-zImage-ppc64.c 2006-01-17 07:23:35.000000000 +0530 @@ -153,7 +153,8 @@ int zImage_ppc64_load(FILE *file, int ar return -1; } mem_offset = p->p_vaddr - load_loc; - if (fread(segment->buf+mem_offset, p->p_filesz, 1, file) != 1) { + if (fread((void *)segment->buf+mem_offset, p->p_filesz, 1, + file) != 1) { perror("read error: "); return -1; } diff -puN purgatory/Makefile~ppc64-kdump-purgatory-backup-support purgatory/Makefile --- kexec-tools-1.101/purgatory/Makefile~ppc64-kdump-purgatory-backup-support 2006-01-17 07:23:35.000000000 +0530 +++ kexec-tools-1.101-sharada/purgatory/Makefile 2006-01-17 07:23:35.000000000 +0530 @@ -21,13 +21,11 @@ PCFLAGS += $(call cc-option, -fnobuiltin PCFLAGS += $(call cc-option, -fnostdinc) PCFLAGS += $(call cc-option, -fno-zero-initialized-in-bss) -PURGATORY_C_SRCS:= -ifneq ($(ARCH),ppc64) +PURGATORY_C_SRCS:= PURGATORY_C_SRCS += purgatory/purgatory.c PURGATORY_C_SRCS += purgatory/printf.c PURGATORY_C_SRCS += purgatory/string.c -endif -PURGATORY_S_OBJS:= +PURGATORY_S_OBJS:= include purgatory/arch/$(ARCH)/Makefile @@ -61,12 +59,7 @@ $(PURGATORY_S_OBJS): $(OBJDIR)/%.o: %.S $(PURGATORY): $(PURGATORY_OBJS) $(UTIL_LIB) $(MKDIR) -p $(@D) -ifneq ($(ARCH),ppc64) $(LD) $(LDFLAGS) --no-undefined -e purgatory_start -r -o $@ $(PURGATORY_OBJS) $(UTIL_LIB) -else - $(LD) -Ttext=0 -e 0 -o $(OBJDIR)/purgatory/v2wrap.elf $(PURGATORY_OBJS) - objcopy -O binary $(OBJDIR)/purgatory/v2wrap.elf $@ -endif echo:: @echo "PURGATORY_C_SRCS $(PURGATORY_C_SRCS)" diff -puN purgatory/arch/ppc64/Makefile~ppc64-kdump-purgatory-backup-support purgatory/arch/ppc64/Makefile --- kexec-tools-1.101/purgatory/arch/ppc64/Makefile~ppc64-kdump-purgatory-backup-support 2006-01-17 07:23:35.000000000 +0530 +++ kexec-tools-1.101-sharada/purgatory/arch/ppc64/Makefile 2006-01-17 07:23:35.000000000 +0530 @@ -2,6 +2,7 @@ # Purgatory ppc # -PURGATORY_C_SRCS+= PURGATORY_S_SRCS+= purgatory/arch/ppc64/v2wrap.S - +PURGATORY_C_SRCS += purgatory/arch/ppc64/purgatory-ppc64.c +PURGATORY_C_SRCS += purgatory/arch/ppc64/console-ppc64.c +PURGATORY_C_SRCS += purgatory/arch/ppc64/crashdump_backup.c diff -puN /dev/null purgatory/arch/ppc64/console-ppc64.c --- /dev/null 2004-07-01 07:56:11.000000000 +0530 +++ kexec-tools-1.101-sharada/purgatory/arch/ppc64/console-ppc64.c 2006-01-17 07:23:35.000000000 +0530 @@ -0,0 +1,27 @@ +/* + * kexec: Linux boots Linux + * + * Created by: Mohan Kumar M (mohan at in.ibm.com) + * + * Copyright (C) IBM Corporation, 2005. All rights reserved + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation (version 2 of the License). + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#include + +void putchar(int c) +{ + return; +} diff -puN /dev/null purgatory/arch/ppc64/purgatory-ppc64.c --- /dev/null 2004-07-01 07:56:11.000000000 +0530 +++ kexec-tools-1.101-sharada/purgatory/arch/ppc64/purgatory-ppc64.c 2006-01-17 07:23:35.000000000 +0530 @@ -0,0 +1,41 @@ +/* + * kexec: Linux boots Linux + * + * Created by: Mohan Kumar M (mohan at in.ibm.com) + * + * Copyright (C) IBM Corporation, 2005. All rights reserved + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation (version 2 of the License). + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#include +#include "purgatory-ppc64.h" + +unsigned int panic_kernel = 0; +unsigned long backup_start = 0; +unsigned long stack = 0; +unsigned long dt_offset = 0; +unsigned long my_toc = 0; +unsigned long kernel = 0; + +void setup_arch(void) +{ + return; +} + +void post_verification_setup_arch(void) +{ + if (panic_kernel) + crashdump_backup_memory(); +} diff -puN /dev/null purgatory/arch/ppc64/purgatory-ppc64.h --- /dev/null 2004-07-01 07:56:11.000000000 +0530 +++ kexec-tools-1.101-sharada/purgatory/arch/ppc64/purgatory-ppc64.h 2006-01-17 07:23:35.000000000 +0530 @@ -0,0 +1,6 @@ +#ifndef PURGATORY_PPC64_H +#define PURGATORY_PPC64_H + +void crashdump_backup_memory(void); + +#endif /* PURGATORY_PPC64_H */ diff -puN purgatory/arch/ppc64/v2wrap.S~ppc64-kdump-purgatory-backup-support purgatory/arch/ppc64/v2wrap.S --- kexec-tools-1.101/purgatory/arch/ppc64/v2wrap.S~ppc64-kdump-purgatory-backup-support 2006-01-17 07:23:35.000000000 +0530 +++ kexec-tools-1.101-sharada/purgatory/arch/ppc64/v2wrap.S 2006-01-17 07:23:35.000000000 +0530 @@ -2,6 +2,7 @@ # kexec: Linux boots Linux # # Copyright (C) 2004 - 2005, Milton D Miller II, IBM Corporation +# Copyright (C) 2006, Mohan Kumar M (mohan at in.ibm.com), IBM Corporation # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -18,14 +19,17 @@ # # v2wrap.S -# a wrapper to place in front of a v2 device tree -# to call a ppc64 kernel with the expected arguments +# a wrapper to call purgatory code to backup first +# 32kB of first kernel into the backup region +# reserved by kexec-tools. +# Invokes ppc64 kernel with the expected arguments # of kernel(device-tree, phys-offset, 0) + # # calling convention: # r3 = physical number of this cpu (all cpus) # r4 = address of this chunk (master only) -# master enters at start (aka first byte of this chunk) +# master enters at purgatory_start (aka first byte of this chunk) # slaves (additional cpus), if any, enter a copy of the # first 0x100 bytes of this code relocated to 0x0 # @@ -34,50 +38,50 @@ # and the slaves are sent to address 0x60 # with r3 = their physical cpu number. +#define LOADADDR(rn,name) \ + lis rn,name##@highest; \ + ori rn,rn,name##@higher; \ + rldicr rn,rn,32,31; \ + oris rn,rn,name##@h; \ + ori rn,rn,name##@l # look a bit like a Linux kernel here ... .machine ppc64 - .org 0 -start: b master + .globl purgatory_start +purgatory_start: b master tweq 0,0 -secondary_hold: - .llong 0 - - .org 0x20 # need a bit more space than after slave, master: - std 4,secondary_hold at l(0) # bring slaves up here to this copy - sync # try to get the slaves to see this or 1,1,1 # low priority to let other thread catchup isync - mr 5,3 # save cpu id to r5 - addi 3,4,0x100 # r3 = boot param block - lwz 6,20(3) # fetch version number - cmpwi 0,6,2 # v2 ? - blt 80f - stw 5,28(3) # save my cpu number as boot_cpu_phys -80: b 81f - - .org 0x60 # ABI: slaves start at 60 with r3=phys -slave: ld 4,secondary_hold at l(0); - cmpdi 0,4,0 - beq slave - - # ahh, master told us where he is running from - # jump into our copy of the code up there so this code can change - addi 5,4,1f-start - mtctr 5 - bctr + mr 17,3 # save cpu id to r17 + mr 15,4 # save physical address in reg15 - # ok, now wait for the master to tell is to go back to the new block -1: ld 5,copied at l(4) - cmpdi 0,5,0 - beq 1b - ba 0x60 + LOADADDR(6,my_toc) + ld 2,0(6) #setup toc + LOADADDR(6,stack) + ld 1,0(6) #setup stack + subi 1,1,112 + bl .purgatory + nop + + b 81f + .org purgatory_start + 0x60 # ABI: slaves start at 60 with r3=phys +slave: + # load slave spin code address and branch into that + LOADADDR(6,slave_spin) + ld 4,0(6) + mtctr 4 + bctr - .long 0 # just an eye-catcher, delete if space needed - .long 0 # just an eye-catcher, delete if space needed +spin: .long 1 +slave_spin_code: + lis 5,spin at ha + lwz 5,spin at l(5) + cmpwi 0,5,0 + bne slave_spin_code + ba 0x60 81: # master continues here or 3,3,3 # ok back to high, lets boot @@ -85,7 +89,17 @@ slave: ld 4,secondary_hold at l(0); mtctr 6 # delay a bit for slaves to catch up 83: bdnz 83b # before we overwrite 0-100 again - ld 4,-8(3) # kernel pointer is at -8(bb) by loader + LOADADDR(16, dt_offset) + ld 3,0(16) # load device-tree address + mr 16,3 # save dt address in reg16 + lwz 6,20(3) # fetch version number + cmpwi 0,6,2 # v2 ? + blt 80f + stw 17,28(3) # save my cpu number as boot_cpu_phys +80: + LOADADDR(6,kernel) + ld 4,0(6) # load the kernel address + addi 5,4,-8 # prepare copy with update form instructions li 6,0x100/8 mtctr 6 @@ -103,12 +117,12 @@ slave: ld 4,secondary_hold at l(0); icbi 0,6 sync isync - std 6,-16(3) # send slaves back down + lis 6,spin at ha + li 0,0 + stw 0,spin at l(6) + mr 3,16 # restore dt address + bctr # start kernel - .org 0xf0 -copied: .llong 0 -kernel: .llong 0 - .org 0x100 -__end_stub: - .equ boot_block, . - start +slave_spin: .llong slave_spin_code + diff -puN kexec/kexec-elf.c~ppc64-kdump-purgatory-backup-support kexec/kexec-elf.c --- kexec-tools-1.101/kexec/kexec-elf.c~ppc64-kdump-purgatory-backup-support 2006-01-17 07:23:35.000000000 +0530 +++ kexec-tools-1.101-sharada/kexec/kexec-elf.c 2006-01-17 07:29:17.000000000 +0530 @@ -113,21 +113,21 @@ static int build_mem_elf32_ehdr(const ch } return -1; } - if (elf32_to_cpu(ehdr, lehdr.e_entry) > ULONG_MAX) { + if (elf32_to_cpu(ehdr, lehdr.e_entry) > UINT32_MAX) { /* entry is to large */ if (probe_debug) { fprintf(stderr, "ELF e_entry to large\n"); } return -1; } - if (elf32_to_cpu(ehdr, lehdr.e_phoff) > ULONG_MAX) { + if (elf32_to_cpu(ehdr, lehdr.e_phoff) > UINT32_MAX) { /* phoff is to large */ if (probe_debug) { fprintf(stderr, "ELF e_phoff to large\n"); } return -1; } - if (elf32_to_cpu(ehdr, lehdr.e_shoff) > ULONG_MAX) { + if (elf32_to_cpu(ehdr, lehdr.e_shoff) > UINT32_MAX) { /* shoff is to large */ if (probe_debug) { fprintf(stderr, "ELF e_shoff to large\n"); @@ -146,7 +146,7 @@ static int build_mem_elf32_ehdr(const ch ehdr->e_shstrndx = elf16_to_cpu(ehdr, lehdr.e_shstrndx); if ((ehdr->e_phnum > 0) && - (elf16_to_cpu(ehdr, lehdr.e_phentsize) != sizeof(Elf32_Phdr))) + (elf16_to_cpu(ehdr, lehdr.e_phentsize) != sizeof(Elf32_Phdr))) { /* Invalid program header size */ if (probe_debug) { @@ -185,21 +185,21 @@ static int build_mem_elf64_ehdr(const ch } return -1; } - if (elf32_to_cpu(ehdr, lehdr.e_entry) > ULONG_MAX) { + if (elf32_to_cpu(ehdr, lehdr.e_entry) > UINT32_MAX) { /* entry is to large */ if (probe_debug) { fprintf(stderr, "ELF e_entry to large\n"); } return -1; } - if (elf32_to_cpu(ehdr, lehdr.e_phoff) > ULONG_MAX) { + if (elf32_to_cpu(ehdr, lehdr.e_phoff) > UINT32_MAX) { /* phoff is to large */ if (probe_debug) { fprintf(stderr, "ELF e_phoff to large\n"); } return -1; } - if (elf32_to_cpu(ehdr, lehdr.e_shoff) > ULONG_MAX) { + if (elf32_to_cpu(ehdr, lehdr.e_shoff) > UINT32_MAX) { /* shoff is to large */ if (probe_debug) { fprintf(stderr, "ELF e_shoff to large\n"); @@ -218,7 +218,7 @@ static int build_mem_elf64_ehdr(const ch ehdr->e_shstrndx = elf16_to_cpu(ehdr, lehdr.e_shstrndx); if ((ehdr->e_phnum > 0) && - (elf16_to_cpu(ehdr, lehdr.e_phentsize) != sizeof(Elf64_Phdr))) + (elf16_to_cpu(ehdr, lehdr.e_phentsize) != sizeof(Elf64_Phdr))) { /* Invalid program header size */ if (probe_debug) { @@ -302,7 +302,7 @@ static int build_mem_ehdr(const char *bu return 0; } -static int build_mem_elf32_phdr(const char *buf, off_t len, +static int build_mem_elf32_phdr(const char *buf, off_t len, struct mem_ehdr *ehdr, int idx) { struct mem_phdr *phdr; @@ -312,12 +312,12 @@ static int build_mem_elf32_phdr(const ch phdr = &ehdr->e_phdr[idx]; memcpy(&lphdr, pbuf, sizeof(lphdr)); - if ( (elf32_to_cpu(ehdr, lphdr.p_filesz) > ULONG_MAX) || - (elf32_to_cpu(ehdr, lphdr.p_memsz) > ULONG_MAX) || - (elf32_to_cpu(ehdr, lphdr.p_offset) > ULONG_MAX) || - (elf32_to_cpu(ehdr, lphdr.p_paddr) > ULONG_MAX) || - (elf32_to_cpu(ehdr, lphdr.p_vaddr) > ULONG_MAX) || - (elf32_to_cpu(ehdr, lphdr.p_align) > ULONG_MAX)) + if ( (elf32_to_cpu(ehdr, lphdr.p_filesz) > UINT32_MAX) || + (elf32_to_cpu(ehdr, lphdr.p_memsz) > UINT32_MAX) || + (elf32_to_cpu(ehdr, lphdr.p_offset) > UINT32_MAX) || + (elf32_to_cpu(ehdr, lphdr.p_paddr) > UINT32_MAX) || + (elf32_to_cpu(ehdr, lphdr.p_vaddr) > UINT32_MAX) || + (elf32_to_cpu(ehdr, lphdr.p_align) > UINT32_MAX)) { fprintf(stderr, "Program segment size out of range\n"); return -1; @@ -345,12 +345,12 @@ static int build_mem_elf64_phdr(const ch phdr = &ehdr->e_phdr[idx]; memcpy(&lphdr, pbuf, sizeof(lphdr)); - if ( (elf64_to_cpu(ehdr, lphdr.p_filesz) > ULONG_MAX) || - (elf64_to_cpu(ehdr, lphdr.p_memsz) > ULONG_MAX) || - (elf64_to_cpu(ehdr, lphdr.p_offset) > ULONG_MAX) || - (elf64_to_cpu(ehdr, lphdr.p_paddr) > ULONG_MAX) || - (elf64_to_cpu(ehdr, lphdr.p_vaddr) > ULONG_MAX) || - (elf64_to_cpu(ehdr, lphdr.p_align) > ULONG_MAX)) + if ( (elf64_to_cpu(ehdr, lphdr.p_filesz) > UINT64_MAX) || + (elf64_to_cpu(ehdr, lphdr.p_memsz) > UINT64_MAX) || + (elf64_to_cpu(ehdr, lphdr.p_offset) > UINT64_MAX) || + (elf64_to_cpu(ehdr, lphdr.p_paddr) > UINT64_MAX) || + (elf64_to_cpu(ehdr, lphdr.p_vaddr) > UINT64_MAX) || + (elf64_to_cpu(ehdr, lphdr.p_align) > UINT64_MAX)) { fprintf(stderr, "Program segment size out of range\n"); return -1; @@ -388,7 +388,7 @@ static int build_mem_phdrs(const char *b fprintf(stderr, "Invalid ei_class?\n"); return -1; } - phdr_size *= ehdr->e_phnum; + phdr_size *= ehdr->e_phnum; if (ehdr->e_phoff + phdr_size > len) { /* The program header did not fit in the file buffer */ if (probe_debug) { @@ -396,7 +396,7 @@ static int build_mem_phdrs(const char *b } return -1; } - + /* Allocate the e_phdr array */ mem_phdr_size = sizeof(ehdr->e_phdr[0]) * ehdr->e_phnum; ehdr->e_phdr = xmalloc(mem_phdr_size); @@ -440,7 +440,7 @@ static int build_mem_phdrs(const char *b return 0; } -static int build_mem_elf32_shdr(const char *buf, off_t len, +static int build_mem_elf32_shdr(const char *buf, off_t len, struct mem_ehdr *ehdr, int idx) { struct mem_shdr *shdr; @@ -451,12 +451,12 @@ static int build_mem_elf32_shdr(const ch shdr = &ehdr->e_shdr[idx]; memcpy(&lshdr, sbuf, sizeof(lshdr)); - if ( (elf32_to_cpu(ehdr, lshdr.sh_flags) > ULONG_MAX) || - (elf32_to_cpu(ehdr, lshdr.sh_addr) > ULONG_MAX) || - (elf32_to_cpu(ehdr, lshdr.sh_offset) > ULONG_MAX) || - (elf32_to_cpu(ehdr, lshdr.sh_size) > ULONG_MAX) || - (elf32_to_cpu(ehdr, lshdr.sh_addralign) > ULONG_MAX) || - (elf32_to_cpu(ehdr, lshdr.sh_entsize) > ULONG_MAX)) + if ( (elf32_to_cpu(ehdr, lshdr.sh_flags) > UINT32_MAX) || + (elf32_to_cpu(ehdr, lshdr.sh_addr) > UINT32_MAX) || + (elf32_to_cpu(ehdr, lshdr.sh_offset) > UINT32_MAX) || + (elf32_to_cpu(ehdr, lshdr.sh_size) > UINT32_MAX) || + (elf32_to_cpu(ehdr, lshdr.sh_addralign) > UINT32_MAX) || + (elf32_to_cpu(ehdr, lshdr.sh_entsize) > UINT32_MAX)) { fprintf(stderr, "Program section size out of range\n"); return -1; @@ -510,7 +510,7 @@ static int build_mem_elf32_shdr(const ch return 0; } -static int build_mem_elf64_shdr(const char *buf, off_t len, +static int build_mem_elf64_shdr(const char *buf, off_t len, struct mem_ehdr *ehdr, int idx) { struct mem_shdr *shdr; @@ -521,12 +521,12 @@ static int build_mem_elf64_shdr(const ch shdr = &ehdr->e_shdr[idx]; memcpy(&lshdr, sbuf, sizeof(lshdr)); - if ( (elf64_to_cpu(ehdr, lshdr.sh_flags) > ULONG_MAX) || - (elf64_to_cpu(ehdr, lshdr.sh_addr) > ULONG_MAX) || - (elf64_to_cpu(ehdr, lshdr.sh_offset) > ULONG_MAX) || - (elf64_to_cpu(ehdr, lshdr.sh_size) > ULONG_MAX) || - (elf64_to_cpu(ehdr, lshdr.sh_addralign) > ULONG_MAX) || - (elf64_to_cpu(ehdr, lshdr.sh_entsize) > ULONG_MAX)) + if ( (elf64_to_cpu(ehdr, lshdr.sh_flags) > UINT64_MAX) || + (elf64_to_cpu(ehdr, lshdr.sh_addr) > UINT64_MAX) || + (elf64_to_cpu(ehdr, lshdr.sh_offset) > UINT64_MAX) || + (elf64_to_cpu(ehdr, lshdr.sh_size) > UINT64_MAX) || + (elf64_to_cpu(ehdr, lshdr.sh_addralign) > UINT64_MAX) || + (elf64_to_cpu(ehdr, lshdr.sh_entsize) > UINT64_MAX)) { fprintf(stderr, "Program section size out of range\n"); return -1; @@ -608,7 +608,7 @@ static int build_mem_shdrs(const char *b } return -1; } - + /* Allocate the e_shdr array */ mem_shdr_size = sizeof(ehdr->e_shdr[0]) * ehdr->e_shnum; ehdr->e_shdr = xmalloc(mem_shdr_size); @@ -635,7 +635,7 @@ static int build_mem_shdrs(const char *b { /* The section does not fit in the buffer */ if (probe_debug) { - fprintf(stderr, "ELF section %d not in file\n", + fprintf(stderr, "ELF section %d not in file\n", i); } return -1; @@ -653,14 +653,14 @@ static int build_mem_shdrs(const char *b return 0; } -static void read_nhdr(const struct mem_ehdr *ehdr, +static void read_nhdr(const struct mem_ehdr *ehdr, ElfNN_Nhdr *hdr, const unsigned char *note) { memcpy(hdr, note, sizeof(*hdr)); hdr->n_namesz = elf32_to_cpu(ehdr, hdr->n_namesz); hdr->n_descsz = elf32_to_cpu(ehdr, hdr->n_descsz); hdr->n_type = elf32_to_cpu(ehdr, hdr->n_type); - + } static int build_mem_notes(const char *buf, off_t len, struct mem_ehdr *ehdr) { @@ -686,7 +686,7 @@ static int build_mem_notes(const char *b if (!note_start) { return 0; } - + /* Walk through and count the notes */ ehdr->e_notenum = 0; for(note = note_start; note < note_end; note+= note_size) { @@ -708,7 +708,7 @@ static int build_mem_notes(const char *b note_size += (hdr.n_namesz + 3) & ~3; desc = note + note_size; note_size += (hdr.n_descsz + 3) & ~3; - + if ((hdr.n_namesz != 0) && (name[hdr.n_namesz -1] != '\0')) { die("Note name is not null termiated"); } @@ -716,7 +716,7 @@ static int build_mem_notes(const char *b ehdr->e_note[i].n_name = name; ehdr->e_note[i].n_desc = desc; ehdr->e_note[i].n_descsz = hdr.n_descsz; - + } return 0; } diff -puN kexec/kexec-elf-rel.c~ppc64-kdump-purgatory-backup-support kexec/kexec-elf-rel.c --- kexec-tools-1.101/kexec/kexec-elf-rel.c~ppc64-kdump-purgatory-backup-support 2006-01-17 07:23:35.000000000 +0530 +++ kexec-tools-1.101-sharada/kexec/kexec-elf-rel.c 2006-01-17 07:23:35.000000000 +0530 @@ -155,7 +155,7 @@ int build_elf_rel_info(const char *buf, if (probe_debug) { fprintf(stderr, "No ELF section headers\n"); } - return -1; + return -1; } if (!machine_verify_elf_rel(ehdr)) { /* It does not meant the native architecture constraints */ @@ -251,7 +251,7 @@ int elf_rel_load(struct mem_ehdr *ehdr, /* Allocate where we will put the relocated object */ buf = xmalloc(bufsz); - buf_addr = add_buffer(info, buf, bufsz, bufsz + bss_pad + bsssz, + buf_addr = add_buffer(info, buf, bufsz, bufsz + bss_pad + bsssz, buf_align, min, max, end); ehdr->rel_addr = buf_addr; ehdr->rel_size = bufsz + bss_pad + bsssz; @@ -269,7 +269,7 @@ int elf_rel_load(struct mem_ehdr *ehdr, unsigned long off; /* Adjust the address */ data_addr = (data_addr + (align - 1)) & ~(align -1); - + /* Update the section */ off = data_addr - buf_addr; memcpy(buf + off, shdr->sh_data, shdr->sh_size); @@ -306,7 +306,7 @@ int elf_rel_load(struct mem_ehdr *ehdr, continue; } if ((shdr->sh_info > ehdr->e_shnum) || - (shdr->sh_link > ehdr->e_shnum)) + (shdr->sh_link > ehdr->e_shnum)) { die("Invalid section number\n"); } @@ -350,12 +350,12 @@ int elf_rel_load(struct mem_ehdr *ehdr, /* The final address of that location */ address = section->sh_addr + rel.r_offset; - + /* The relevant symbol */ sym = elf_sym(ehdr, symtab->sh_data + (rel.r_sym * elf_sym_size(ehdr))); -#if 0 +#ifdef DEBUG fprintf(stderr, "sym: %10s info: %02x other: %02x shndx: %lx value: %lx size: %lx\n", - strtab + sym.st_name, + strtab + sym.st_name, sym.st_info, sym.st_other, sym.st_shndx, @@ -364,8 +364,18 @@ int elf_rel_load(struct mem_ehdr *ehdr, #endif if (sym.st_shndx == STN_UNDEF) { - die("Undefined symbol: %s\n", + /* + * NOTE: ppc64 elf .ro shows up a UNDEF section. + * From Elf 1.2 Spec: + * Relocation Entries: If the index is STN_UNDEF, + * the undefined symbol index, the relocation uses 0 + * as the "symbol value". + * So, is this really an error condition to flag die? + */ + /* + die("Undefined symbol: %s\n", strtab + sym.st_name); + */ } sec_base = 0; if (sym.st_shndx == SHN_COMMON) { @@ -383,14 +393,14 @@ int elf_rel_load(struct mem_ehdr *ehdr, else { sec_base = ehdr->e_shdr[sym.st_shndx].sh_addr; } -#if 0 +#ifdef DEBUG fprintf(stderr, "sym: %s value: %lx addr: %lx\n", strtab + sym.st_name, value, address); #endif value = sym.st_value; value += sec_base; value += rel.r_addend; - machine_apply_elf_rel(ehdr, rel.r_type, + machine_apply_elf_rel(ehdr, rel.r_type, (void *)location, address, value); } } @@ -399,7 +409,7 @@ int elf_rel_load(struct mem_ehdr *ehdr, return result; } -void elf_rel_build_load(struct kexec_info *info, struct mem_ehdr *ehdr, +void elf_rel_build_load(struct kexec_info *info, struct mem_ehdr *ehdr, const char *buf, off_t len, unsigned long min, unsigned long max, int end) { @@ -452,8 +462,8 @@ int elf_rel_find_symbol(struct mem_ehdr if (strcmp(strtab + sym.st_name, name) != 0) { continue; } - if ((sym.st_shndx == STN_UNDEF) || - (sym.st_shndx > ehdr->e_shnum)) + if ((sym.st_shndx == STN_UNDEF) || + (sym.st_shndx > ehdr->e_shnum)) { die("Symbol: %s has Bad section index %d\n", name, sym.st_shndx); @@ -491,7 +501,7 @@ void elf_rel_set_symbol(struct mem_ehdr result = elf_rel_find_symbol(ehdr, name, &sym); if (result < 0) { - die("Symbol: %s not found cannot set\n", + die("Symbol: %s not found cannot set\n", name); } if (sym.st_size != size) { diff -puN /dev/null purgatory/arch/ppc64/crashdump_backup.c --- /dev/null 2004-07-01 07:56:11.000000000 +0530 +++ kexec-tools-1.101-sharada/purgatory/arch/ppc64/crashdump_backup.c 2006-01-17 07:23:35.000000000 +0530 @@ -0,0 +1,41 @@ +/* + * kexec: Linux boots Linux + * + * Created by: Mohan Kumar M (mohan at in.ibm.com) + * + * Copyright (C) IBM Corporation, 2005. All rights reserved + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation (version 2 of the License). + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#include +#include + +#define BACKUP_REGION_SOURCE 0x0 +#define BACKUP_REGION_SIZE 32*1024 + +extern unsigned long backup_start; + +/* Backup first 32KB of memory to backup region reserved by kexec */ +void crashdump_backup_memory(void) +{ + void *dest, *src; + + src = (void *)BACKUP_REGION_SOURCE; + + if (backup_start) { + dest = (void *)(backup_start); + memcpy(dest, src, BACKUP_REGION_SIZE); + } +} _ From sharada at in.ibm.com Tue Jan 17 02:08:55 2006 From: sharada at in.ibm.com (R Sharada) Date: Mon, 16 Jan 2006 20:38:55 +0530 Subject: [PATCH 1/6] ppc64-fix-function-parameters In-Reply-To: <20060116150712.GA4029@in.ibm.com> References: <20060116150712.GA4029@in.ibm.com> Message-ID: <20060116150855.GB4029@in.ibm.com> Fix the input parameters for get_memory_ranges and arch_compat_trampoline keeping in line with the function prototypes defined in kexec/kexec.h. Also changed variable references in /proc/device-tree - modified the function parameters for get_memory_ranges and arch_compat_trampoline - fixed the names for kernel_end, htab_base and htab_size, in line with the kernel variable names for the same Signed-off-by: R Sharada --- diff -puN kexec/arch/ppc64/kexec-ppc64.c~ppc64-fix-function-parameters kexec/arch/ppc64/kexec-ppc64.c --- kexec-tools-1.101/kexec/arch/ppc64/kexec-ppc64.c~ppc64-fix-function-parameters 2005-12-24 04:15:37.000000000 +0530 +++ kexec-tools-1.101-sharada/kexec/arch/ppc64/kexec-ppc64.c 2005-12-24 04:51:51.000000000 +0530 @@ -64,7 +64,6 @@ static int get_base_ranges() FILE *file; struct dirent *dentry, *mentry; int n; - unsigned long long start, end; if ((dir = opendir(device_tree)) == NULL) { perror(device_tree); @@ -193,7 +192,7 @@ static int get_devtree_details() memset(fname, 0, sizeof(fname)); strcpy(fname, device_tree); strcat(fname, dentry->d_name); - strcat(fname, "/kernel_end"); + strcat(fname, "/linux,kernel-end"); if ((file = fopen(fname, "r")) == NULL) { perror(fname); closedir(cdir); @@ -220,7 +219,7 @@ static int get_devtree_details() memset(fname, 0, sizeof(fname)); strcpy(fname, device_tree); strcat(fname, dentry->d_name); - strcat(fname, "/htab_base"); + strcat(fname, "/linux,htab-base"); if ((file = fopen(fname, "r")) == NULL) { perror(fname); closedir(cdir); @@ -238,7 +237,7 @@ static int get_devtree_details() memset(fname, 0, sizeof(fname)); strcpy(fname, device_tree); strcat(fname, dentry->d_name); - strcat(fname, "/htab_size"); + strcat(fname, "/linux,htab-size"); if ((file = fopen(fname, "r")) == NULL) { perror(fname); closedir(cdir); @@ -452,7 +451,8 @@ int setup_memory_ranges(void) } /* Return a list of valid memory ranges */ -int get_memory_ranges(struct memory_range **range, int *ranges) +int get_memory_ranges(struct memory_range **range, int *ranges, + unsigned long kexec_flags) { setup_memory_ranges(); *range = memory_range; @@ -497,7 +497,7 @@ int arch_process_options(int argc, char return 0; } -int arch_compat_trampoline(struct kexec_info *info, unsigned long *flags) +int arch_compat_trampoline(struct kexec_info *info) { int result; struct utsname utsname; @@ -512,7 +512,7 @@ int arch_compat_trampoline(struct kexec_ /* We are running a 32-bit kexec-tools on 64-bit ppc64. * So pass KEXEC_ARCH_PPC64 here */ - *flags |= KEXEC_ARCH_PPC64; + info->kexec_flags |= KEXEC_ARCH_PPC64; } else { fprintf(stderr, "Unsupported machine type: %s\n", diff -puN kexec/arch/ppc64/fs2dt.c~ppc64-fix-function-parameters kexec/arch/ppc64/fs2dt.c --- kexec-tools-1.101/kexec/arch/ppc64/fs2dt.c~ppc64-fix-function-parameters 2005-12-24 06:57:29.000000000 +0530 +++ kexec-tools-1.101-sharada/kexec/arch/ppc64/fs2dt.c 2005-12-24 06:58:07.000000000 +0530 @@ -162,9 +162,9 @@ void putprops(char *fn, DIR *dir) * boot. So, ignore it. */ if (!strcmp(dp->d_name, "linux,pci-domain") || - !strcmp(dp->d_name, "htab_base") || - !strcmp(dp->d_name, "htab_size") || - !strcmp(dp->d_name, "kernel_end")) + !strcmp(dp->d_name, "linux,htab-base") || + !strcmp(dp->d_name, "linux,htab-size") || + !strcmp(dp->d_name, "linux,kernel-end")) continue; if (S_ISREG(statbuf[0].st_mode)) { _ From serue at us.ibm.com Tue Jan 17 02:37:48 2006 From: serue at us.ibm.com (Serge E. Hallyn) Date: Mon, 16 Jan 2006 09:37:48 -0600 Subject: 2.6.15-mm4 failure on power5 In-Reply-To: <200601170000.58134.michael@ellerman.id.au> References: <20060116063530.GB23399@sergelap.austin.ibm.com> <20060115230557.0f07a55c.akpm@osdl.org> <200601170000.58134.michael@ellerman.id.au> Message-ID: <20060116153748.GA25866@sergelap.austin.ibm.com> Quoting Michael Ellerman (michael at ellerman.id.au): > On Mon, 16 Jan 2006 18:05, Andrew Morton wrote: > > "Serge E. Hallyn" wrote: > > > On my power5 partition, 2.6.15-mm4 hangs on boot > > > > It might be worth reverting the changes to arch/powerpc/mm/hash_utils_64.c, > > see if that unbreaks it. > > > > - base = lmb.memory.region[i].base + KERNELBASE; > > + base = (unsigned long)__va(lmb.memory.region[i].base); > > You can try it, but if that fixes the problem I'll buy a sombrero and then eat > it. Sounds unpleasant, but no need - that didn't fix it. > > The nice comment in page.h: > > > > * KERNELBASE is the virtual address of the start of the kernel, it's often > > * the same as PAGE_OFFSET, but _might not be_. > > * > > * The kdump dump kernel is one example where KERNELBASE != PAGE_OFFSET. > > * > > * To get a physical address from a virtual one you subtract PAGE_OFFSET, > > * _not_ KERNELBASE. > > > > Tells us that was not an equivalent transformation. > > True, not equivalent in all cases, but correct. For non-kdump kernels (which I > assume this is) KERNELBASE == PAGE_OFFSET, and for a kdump kernel that code > wants to use PAGE_OFFSET, not KERNELBASE. > > Try enabling early debugging (see arch/powerpc/kernel/setup_64.c) and then > turning on DEBUG in hash_utils_64.c, setup_64.c etc. That gives me the following output: boot: quicktest Please wait, loading kernel... Elf64 kernel loaded... OF stdout device is: /vdevice/vty at 30000000 Hypertas detected, assuming LPAR ! command line: ro console=hvc0 root=/dev/sda6 smt-enabled=1 memory layout at init: memory_limit : 0000000000000000 (16 MB aligned) alloc_bottom : 0000000002223000 alloc_top : 0000000008000000 alloc_top_hi : 0000000088000000 rmo_top : 0000000008000000 ram_top : 0000000088000000 Looking for displays instantiating rtas at 0x00000000077d7000 ... done 0000000000000000 : boot cpu 0000000000000000 0000000000000002 : starting cpu hw idx 0000000000000002... done 0000000000000004 : starting cpu hw idx 0000000000000004... done 0000000000000006 : starting cpu hw idx 0000000000000006... done copying OF device tree ... Building dt strings... Building dt structure... Device tree strings 0x0000000002424000 -> 0x0000000002424f36 Device tree struct 0x0000000002425000 -> 0x000000000242c000 Calling quiesce ... returning from prom_init -> early_setup() Probing machine type for platform 101... Found, Initializing memory management... -> htab_initialize() creating mapping for region: c000000000000000 : 88000000 <- htab_initialize() <- early_setup() -> setup_system() -> initialize_cache_info() <- initialize_cache_info() Page orders: linear mapping = 24, others = 12 -> smp_release_cpus() <- smp_release_cpus() <- setup_system() So setup_system() at least finishes, though I don't see the printk's at the bottom of that function. thanks, -serge From sharada at in.ibm.com Tue Jan 17 02:12:45 2006 From: sharada at in.ibm.com (R Sharada) Date: Mon, 16 Jan 2006 20:42:45 +0530 Subject: [PATCH 4/6] ppc64-kdump-crash-segments-support.patch In-Reply-To: <20060116151052.GD4029@in.ibm.com> References: <20060116150712.GA4029@in.ibm.com> <20060116150855.GB4029@in.ibm.com> <20060116150957.GC4029@in.ibm.com> <20060116151052.GD4029@in.ibm.com> Message-ID: <20060116151245.GE4029@in.ibm.com> This patch provides the basic functionality for loading crash dump segment and required features. - Code for loading the crashdump segments - It modifies the crash dump cmdline parameter to add the new parameters, elfcorehdr and savemaxmem - other miscellaneous cleanups and re-ordering of some existing code in kexec-elf-ppc64.c Signed-off-by: R Sharada --- diff -puN kexec/arch/ppc64/kexec-elf-ppc64.c~ppc64-kdump-crash-segments-support kexec/arch/ppc64/kexec-elf-ppc64.c --- kexec-tools-1.101/kexec/arch/ppc64/kexec-elf-ppc64.c~ppc64-kdump-crash-segments-support 2006-01-15 08:11:27.000000000 +0530 +++ kexec-tools-1.101-sharada/kexec/arch/ppc64/kexec-elf-ppc64.c 2006-01-15 08:38:42.000000000 +0530 @@ -33,18 +33,18 @@ #include #include "../../kexec.h" #include "../../kexec-elf.h" +#include "../../kexec-syscall.h" #include "kexec-ppc64.h" +#include "crashdump-ppc64.h" #include #define BOOTLOADER "kexec" #define BOOTLOADER_VERSION VERSION -#define MAX_COMMAND_LINE 256 unsigned long initrd_base, initrd_size; -int create_flatten_tree(struct kexec_info *, unsigned char **, unsigned long *); -int parse_options(char *); -int setup_memory_ranges(void); +int create_flatten_tree(struct kexec_info *, unsigned char **, unsigned long *, + char *); int elf_ppc64_probe(const char *buf, off_t len) { @@ -68,23 +68,29 @@ int elf_ppc64_probe(const char *buf, off } int elf_ppc64_load(int argc, char **argv, const char *buf, off_t len, - struct kexec_info *info) + struct kexec_info *info) { struct mem_ehdr ehdr; - const char *command_line; - const char *input_options; - int command_line_len; - const char *ramdisk; - const char *devicetreeblob; - unsigned long *lp; - int result; - int opt; + char *cmdline, *modified_cmdline; + const char *ramdisk, *devicetreeblob; + int cmdline_len, modified_cmdline_len; + unsigned long long max_addr, hole_addr; + unsigned char *seg_buf = NULL; + off_t seg_size = 0; + struct mem_phdr *phdr; + size_t size; + unsigned long long *rsvmap_ptr; + struct bootblock *bb_ptr; + unsigned int nr_segments, i; + int result, opt; + #define OPT_APPEND (OPT_ARCH_MAX+0) #define OPT_RAMDISK (OPT_ARCH_MAX+1) #define OPT_DEVICETREEBLOB (OPT_ARCH_MAX+2) static const struct option options[] = { KEXEC_ARCH_OPTIONS + { "command-line", 1, NULL, OPT_APPEND }, { "append", 1, NULL, OPT_APPEND }, { "ramdisk", 1, NULL, OPT_RAMDISK }, { "devicetreeblob", 1, NULL, OPT_DEVICETREEBLOB }, @@ -96,23 +102,24 @@ int elf_ppc64_load(int argc, char **argv /* Parse command line arguments */ initrd_base = 0; initrd_size = 0; - command_line = 0; - input_options = 0; + cmdline = 0; ramdisk = 0; devicetreeblob = 0; + max_addr = 0xFFFFFFFFFFFFFFFFUL; + hole_addr = 0; - while ((opt = getopt_long(argc, argv, short_options, options, 0)) != -1) { + while ((opt = getopt_long(argc, argv, short_options, + options, 0)) != -1) { switch (opt) { default: /* Ignore core options */ - if (opt < OPT_ARCH_MAX) { + if (opt < OPT_ARCH_MAX) break; - } case '?': usage(); return -1; case OPT_APPEND: - input_options = optarg; + cmdline = optarg; break; case OPT_RAMDISK: ramdisk = optarg; @@ -123,13 +130,24 @@ int elf_ppc64_load(int argc, char **argv } } - command_line_len = 0; - if (command_line) { - command_line_len = strlen(command_line) + 1; - } + cmdline_len = 0; + if (cmdline) + cmdline_len = strlen(cmdline) + 1; + + setup_memory_ranges(info->kexec_flags); - if (input_options) - parse_options(input_options); + /* Need to append some command line parameters internally in case of + * taking crash dumps. + */ + if (info->kexec_flags & KEXEC_ON_CRASH) { + modified_cmdline = xmalloc(COMMAND_LINE_SIZE); + memset((void *)modified_cmdline, 0, COMMAND_LINE_SIZE); + if (cmdline) { + strncpy(modified_cmdline, cmdline, COMMAND_LINE_SIZE); + modified_cmdline[COMMAND_LINE_SIZE - 1] = '\0'; + } + modified_cmdline_len = strlen(modified_cmdline); + } /* Parse the Elf file */ result = build_elf_exec_info(buf, len, &ehdr); @@ -138,25 +156,19 @@ int elf_ppc64_load(int argc, char **argv return result; } - /* Load the Elf data */ - setup_memory_ranges(); /* Load the Elf data. Physical load addresses in elf64 header do not * show up correctly. Use user supplied address for now to patch the * elf header */ - unsigned long long base_addr; - struct mem_phdr *phdr; - size_t size; phdr = &ehdr.e_phdr[0]; size = phdr->p_filesz; - if (size > phdr->p_memsz) { + if (size > phdr->p_memsz) size = phdr->p_memsz; - } - base_addr = (unsigned long)locate_hole(info, size, 0, 0, + hole_addr = (unsigned long)locate_hole(info, size, 0, 0, 0xFFFFFFFFFFFFFFFFUL, 1); - ehdr.e_phdr[0].p_paddr = base_addr; + ehdr.e_phdr[0].p_paddr = hole_addr; result = elf_exec_load(&ehdr, info); if (result < 0) { free_elf_info(&ehdr); @@ -165,10 +177,10 @@ int elf_ppc64_load(int argc, char **argv /* Add a ram-disk to the current image */ if (ramdisk) { - if (devicetreeblob) { - fprintf(stderr, "Can't use ramdisk with device tree blob input\n"); - return -1; - } + if (devicetreeblob) { + fprintf(stderr, "Can't use ramdisk with device tree blob input\n"); + return -1; + } unsigned char *ramdisk_buf = NULL; off_t ramdisk_size = 0; unsigned long long ramdisk_addr; @@ -181,6 +193,19 @@ int elf_ppc64_load(int argc, char **argv initrd_size = ramdisk_size; } + /* If panic kernel is being loaded, additional segments need + * to be created. + */ + if (info->kexec_flags & KEXEC_ON_CRASH) { + result = load_crashdump_segments(info, modified_cmdline, + max_addr, 0); + if (result < 0) + return -1; + /* Use new command line. */ + cmdline = modified_cmdline; + cmdline_len = strlen(modified_cmdline) + 1; + } + /* Add v2wrap to the current image */ unsigned char *v2wrap_buf = NULL; off_t v2wrap_size = 0; @@ -229,7 +254,7 @@ int elf_ppc64_load(int argc, char **argv rsvmap_ptr += 2; } rsvmap_ptr -= 2; - *rsvmap_ptr = (unsigned long long)( + *rsvmap_ptr = (unsigned long long)( info->segment[(info->nr_segments)-1].mem + 0x100); rsvmap_ptr++; *rsvmap_ptr = (unsigned long long)bb_ptr->totalsize; @@ -252,67 +277,3 @@ void elf_ppc64_usage(void) { fprintf(stderr, "elf support is still broken\n"); } - -struct param_struct { - const char *name; - void *val; -}; -struct param_struct params; - -static char *next_arg(char *args, char **param, char **val) -{ - unsigned int i, equals = 0; - char *next; - - /* Chew any extra spaces */ - while (*args == ' ') args++; - for (i = 0; args[i]; i++) { - if (args[i] == ' ') - break; - if (equals == 0) { - if (args[i] == '=') - equals = i; - } - } - *param = args; - if (!equals) - *val = NULL; - else { - args[equals] = '\0'; - *val = args + equals + 1; - } - - if (args[i]) { - args[i] = '\0'; - next = args + i + 1; - } else - next = args + i; - return next; -} - -static int add_arg(char *param, char*val) -{ - int ret = 0; - if (strcmp(param, "initrd-base")==0) - initrd_base=strtoul(val, NULL, 0); - else if (strcmp(param, "initrd-size")==0) - initrd_size=strtoul(val, NULL, 0); - else { - printf("invalid option\n"); - ret = 1; - } - return ret; -} - -int parse_options(char *options) -{ - char *param, *val; - /* initrd-addr , initrd-size */ - while (*options) { - int ret; - options = next_arg(options, ¶m, &val); - ret = add_arg(param, val); - } - /* All parsed OK */ - return 0; -} diff -puN kexec/arch/ppc64/Makefile~ppc64-kdump-crash-segments-support kexec/arch/ppc64/Makefile --- kexec-tools-1.101/kexec/arch/ppc64/Makefile~ppc64-kdump-crash-segments-support 2006-01-15 08:14:47.000000000 +0530 +++ kexec-tools-1.101-sharada/kexec/arch/ppc64/Makefile 2006-01-15 08:15:40.000000000 +0530 @@ -6,5 +6,6 @@ KEXEC_C_SRCS+= kexec/arch/ppc64/kexec-zI KEXEC_C_SRCS+= kexec/arch/ppc64/fs2dt.c KEXEC_C_SRCS+= kexec/arch/ppc64/kexec-elf-ppc64.c KEXEC_C_SRCS+= kexec/arch/ppc64/kexec-ppc64.c +KEXEC_C_SRCS+= kexec/arch/ppc64/crashdump-ppc64.c KEXEC_S_SRCS+= diff -puN kexec/arch/ppc64/crashdump-ppc64.c~ppc64-kdump-crash-segments-support kexec/arch/ppc64/crashdump-ppc64.c --- kexec-tools-1.101/kexec/arch/ppc64/crashdump-ppc64.c~ppc64-kdump-crash-segments-support 2006-01-15 08:40:23.000000000 +0530 +++ kexec-tools-1.101-sharada/kexec/arch/ppc64/crashdump-ppc64.c 2006-01-15 09:11:45.000000000 +0530 @@ -31,6 +31,8 @@ #include "kexec-ppc64.h" #include "crashdump-ppc64.h" +extern struct arch_options_t arch_options; + /* Stores a sorted list of RAM memory ranges for which to create elf headers. * A separate program header is created for backup region */ @@ -45,6 +47,17 @@ mem_rgns_t usablemem_rgns = {0, }; /* array to store memory regions to be excluded from elf header creation */ mem_rgns_t exclude_rgns = {0, }; +/* + * To store the memory size of the first kernel and this value will be + * passed to the second kernel as command line (savemaxmem=xM). + * The second kernel will be calculated saved_max_pfn based on this + * variable. + * Since we are creating/using usable-memory property, there is no way + * we can determine the RAM size unless parsing the device-tree/memoy@/reg + * property in the kernel. + */ +unsigned long saved_max_mem = 0; + static int sort_regions(mem_rgns_t *rgn); /* Reads the appropriate file and retrieves the SYSTEM RAM regions for whom to @@ -192,6 +205,116 @@ static int get_crash_memory_ranges(struc return 0; } +/* Converts unsigned long to ascii string. */ +static void ultoa(unsigned long i, char *str) +{ + int j = 0, k; + char tmp; + + do { + str[j++] = i % 10 + '0'; + } while ((i /=10) > 0); + str[j] = '\0'; + + /* Reverse the string. */ + for (j = 0, k = strlen(str) - 1; j < k; j++, k--) { + tmp = str[k]; + str[k] = str[j]; + str[j] = tmp; + } +} + +static int add_cmdline_param(char *cmdline, unsigned long addr, + char *cmdstr, char *byte) +{ + int cmdlen, len, align = 1024; + char str[COMMAND_LINE_SIZE], *ptr; + + /* Passing in =xxxK / =xxxM format. Saves space required in cmdline.*/ + switch (byte[0]) { + case 'K': + if (addr%align) + return -1; + addr = addr/align; + break; + case 'M': + addr = addr/(align *align); + break; + } + ptr = str; + strcpy(str, cmdstr); + ptr += strlen(str); + ultoa(addr, ptr); + strcat(str, byte); + len = strlen(str); + cmdlen = strlen(cmdline) + len; + if (cmdlen > (COMMAND_LINE_SIZE - 1)) + die("Command line overflow\n"); + strcat(cmdline, str); +#if DEBUG + fprintf(stderr, "Command line after adding elfcorehdr: %s\n", cmdline); +#endif + return 0; +} + +/* Loads additional segments in case of a panic kernel is being loaded. + * One segment for backup region, another segment for storing elf headers + * for crash memory image. + */ +int load_crashdump_segments(struct kexec_info *info, char* mod_cmdline, + unsigned long max_addr, unsigned long min_base) +{ + void *tmp; + unsigned long sz, elfcorehdr; + int nr_ranges, align = 1024; + long int nr_cpus = 0; + struct memory_range *mem_range; + + if (get_crash_memory_ranges(&mem_range, &nr_ranges) < 0) + return -1; + + /* Create a backup region segment to store backup data*/ + sz = (BACKUP_SIZE + align - 1) & ~(align - 1); + tmp = xmalloc(sz); + memset(tmp, 0, sz); + info->backup_start = add_buffer(info, tmp, sz, sz, align, + 0, max_addr, 1); + reserve(info->backup_start, sz); + /* Create elf header segment and store crash image data. */ + nr_cpus = sysconf(_SC_NPROCESSORS_CONF); + if (nr_cpus < 0) { + fprintf(stderr,"kexec_load (elf header segment)" + " failed: %s\n", strerror(errno)); + return -1; + } + if (arch_options.core_header_type == CORE_TYPE_ELF64) { + sz = sizeof(Elf64_Ehdr) + + nr_cpus * sizeof(Elf64_Phdr) + + nr_ranges * sizeof(Elf64_Phdr); + } else { + sz = sizeof(Elf32_Ehdr) + + nr_cpus * sizeof(Elf32_Phdr) + + nr_ranges * sizeof(Elf32_Phdr); + } + sz = (sz + align - 1) & ~(align -1); + tmp = xmalloc(sz); + memset(tmp, 0, sz); + if (arch_options.core_header_type == CORE_TYPE_ELF64) { + if (prepare_crash_memory_elf64_headers(info, tmp, sz) < 0) + return -1; + } + + elfcorehdr = add_buffer(info, tmp, sz, sz, align, min_base, + max_addr, 1); + reserve(elfcorehdr, sz); + /* modify and store the cmdline in a global array. This is later + * read by flatten_device_tree and modified if required + */ + add_cmdline_param(mod_cmdline, elfcorehdr, " elfcorehdr=", "K"); + add_cmdline_param(mod_cmdline, saved_max_mem, " savemaxmem=", "M"); + return 0; +} + /* * Used to save various memory regions needed for the captured kernel. */ _ From rsa at us.ibm.com Tue Jan 17 03:21:58 2006 From: rsa at us.ibm.com (Ryan Arnold) Date: Mon, 16 Jan 2006 10:21:58 -0600 Subject: [patch 7/8] powerpc: hvc backend for systemsim In-Reply-To: <200601151311.22630.arndb@de.ibm.com> References: <20060113183033.696401000@localhost> <200601131841.33259.arndb@de.ibm.com> <20060114030500.GO2491@pb15.lixom.net> <200601151311.22630.arndb@de.ibm.com> Message-ID: <1137428518.27698.24.camel@localhost.localdomain> On Sun, 2006-01-15 at 13:11 +0000, Arnd Bergmann wrote: > On Saturday 14 January 2006 03:05, Olof Johansson wrote: > > This introduces a third name for the same enviroment. > > > > Now we have: > > > > * Mambo > > * systemsim > > * FSS or Full System Simulator > > > > I don't care which one stays, but it's silly to have three. > > Yes, that was not particularly well coordinated. Ryan chose > the 'fss' name when he did the hvc backend driver, which was > probably a poor choice considering that everything else > seems to move to systemsim. I avoided 'systemsim' because it made my function names excessively long, but that probably isn't an excuse. I'm not particularily attached to the driver name so change it as you see fit. -- Ryan Arnold IBM Linux Technology Center From sharada at in.ibm.com Tue Jan 17 02:09:57 2006 From: sharada at in.ibm.com (R Sharada) Date: Mon, 16 Jan 2006 20:39:57 +0530 Subject: [PATCH 2/6] ppc64-kdump-prepare-device-tree In-Reply-To: <20060116150855.GB4029@in.ibm.com> References: <20060116150712.GA4029@in.ibm.com> <20060116150855.GB4029@in.ibm.com> Message-ID: <20060116150957.GC4029@in.ibm.com> This patch provides the extra functionality and features in the flattened device-tree that is required for crashdump functionality. - create add_usable_mem_property in device-tree which is used by the second kernel for booting with restricted memory. This provides similar feature as the memmap= option on other archs - move initrd creation/modification code to putnode - add code to prepare correct commandline for bootargs. If "root=" option is not specified in user cmdline, add it from existing bootargs - include mem_rgns_t definition in kexec-ppc64.h. Move initrd variables out to .c file Signed-off-by: R Sharada Signed-off-by: Haren Myneni --- diff -puN kexec/arch/ppc64/fs2dt.c~ppc64-kdump-prepare-device-tree kexec/arch/ppc64/fs2dt.c --- kexec-tools-1.101/kexec/arch/ppc64/fs2dt.c~ppc64-kdump-prepare-device-tree 2006-01-15 06:22:47.000000000 +0530 +++ kexec-tools-1.101-sharada/kexec/arch/ppc64/fs2dt.c 2006-01-15 06:49:07.000000000 +0530 @@ -28,7 +28,9 @@ #include #include #include +#include "../../kexec.h" #include "kexec-ppc64.h" +#include "crashdump-ppc64.h" #define MAXPATH 1024 /* max path name length */ #define NAMESPACE 16384 /* max bytes for property names */ @@ -62,9 +64,12 @@ char propnames[NAMESPACE]; dvt dtstruct[TREEWORDS], *dt; unsigned long long mem_rsrv[2*MEMRESERVE]; -extern unsigned long initrd_base; -extern unsigned long initrd_size; static int initrd_found = 0; +static int crash_param = 0; +char local_cmdline[COMMAND_LINE_SIZE] = { "" }; +dvt *dt_len; /* changed len of modified cmdline in flat device-tree */ +extern mem_rgns_t usablemem_rgns; +struct bootblock bb[1]; void reserve(unsigned long long where, unsigned long long length) { @@ -88,26 +93,12 @@ void checkprop(char *name, dvt *data) err((void *)data, ERR_RESERVE); else if (!strcmp(name, "linux,rtas-base")) base = *data; - else if (!strcmp(name, "linux,initrd-start")) { - if (initrd_base) - *(unsigned long long *) data = initrd_base; - base = *(unsigned long long *)data; - initrd_found = 1; - } else if (!strcmp(name, "linux,tce-base")) base = *(unsigned long long *) data; else if (!strcmp(name, "rtas-size") || !strcmp(name, "linux,tce-size")) size = *data; - else if (!strcmp(name, "linux,initrd-end")) { - if (initrd_size) { - *(unsigned long long *) data = initrd_base + - initrd_size; - size = initrd_size; - } else - end = *(unsigned long long *)data; - initrd_found = 1; - } + if (size && end) err(name, ERR_RESERVE); if (base && size) { @@ -139,6 +130,67 @@ dvt propnum(const char *name) return offset; } +void add_usable_mem_property(int fd, int len) +{ + char fname[MAXPATH], *bname; + char buf[MAXBYTES +1]; + unsigned long ranges[2*MAX_MEMORY_RANGES]; + unsigned long long base, end, loc_base, loc_end; + int range, rlen = 0; + + strcpy(fname, pathname); + bname = strrchr(fname,'/'); + bname[0] = '\0'; + bname = strrchr(fname,'/'); + if (strncmp(bname, "/memory@", 8)) + return; + + lseek(fd, 0, SEEK_SET); + if (read(fd, buf, len) != len) + err(pathname, ERR_READ); + + base = ((unsigned long long *)buf)[0]; + end = base + ((unsigned long long *)buf)[1]; + + for (range = 0; range < usablemem_rgns.size; range++) { + loc_base = usablemem_rgns.ranges[range].start; + loc_end = usablemem_rgns.ranges[range].end; + if (loc_base >= base && loc_end <= end) { + ranges[rlen++] = loc_base; + ranges[rlen++] = loc_end - loc_base; + } else if (base < loc_end && end > loc_base) { + if (loc_base < base) + loc_base = base; + if (loc_end > end) + loc_end = end; + ranges[rlen++] = loc_base; + ranges[rlen++] = loc_end - loc_base; + } + } + + if (!rlen) { + /* + * User did not pass any ranges for thsi region. Hence, write + * (0,0) duple in linux,usable-memory property such that + * this region will be ignored. + */ + ranges[rlen++] = 0; + ranges[rlen++] = 0; + } + + rlen = rlen * sizeof(unsigned long); + /* + * No add linux,usable-memory property. + */ + *dt++ = 3; + *dt++ = rlen; + *dt++ = propnum("linux,usable-memory"); + if ((rlen >= 8) && ((unsigned long)dt & 0x4)) + dt++; + memcpy(dt,&ranges,rlen); + dt += (rlen + 3)/4; +} + /* put all properties (files) in the property structure */ void putprops(char *fn, DIR *dir) { @@ -150,11 +202,10 @@ void putprops(char *fn, DIR *dir) if (lstat(pathname, statbuf)) err(pathname, ERR_STAT); - /* skip initrd entries if 2nd kernel does not need them */ - if (!initrd_base && !strcmp(fn,"linux,initrd-end")) + if (!crash_param && !strcmp(fn,"linux,crashkernel-base")) continue; - if (!initrd_base && !strcmp(fn,"linux,initrd-start")) + if (!crash_param && !strcmp(fn,"linux,crashkernel-size")) continue; /* @@ -165,12 +216,20 @@ void putprops(char *fn, DIR *dir) !strcmp(dp->d_name, "linux,htab-base") || !strcmp(dp->d_name, "linux,htab-size") || !strcmp(dp->d_name, "linux,kernel-end")) - continue; + continue; + + /* This property will be created/modified later in putnode() + * So ignore it. + */ + if (!strcmp(dp->d_name, "linux,initrd-start") || + !strcmp(dp->d_name, "linux,initrd-end")) + continue; if (S_ISREG(statbuf[0].st_mode)) { int fd, len = statbuf[0].st_size; *dt++ = 3; + dt_len = dt; *dt++ = len; *dt++ = propnum(fn); @@ -182,11 +241,45 @@ void putprops(char *fn, DIR *dir) err(pathname, ERR_OPEN); if (read(fd, dt, len) != len) err(pathname, ERR_READ); - close(fd); checkprop(fn, dt); + /* Get the cmdline from the device-tree and modify it */ + if (!strcmp(dp->d_name, "bootargs")) { + int cmd_len; + char temp_cmdline[COMMAND_LINE_SIZE] = { "" }; + char *param = NULL; + cmd_len = strlen(local_cmdline); + if (cmd_len != 0) { + param = strstr(local_cmdline, + "crashkernel="); + if (param) + crash_param = 1; + param = NULL; + param = strstr(local_cmdline, "root="); + } + if (!param) { + char *old_param; + memcpy(temp_cmdline, dt, len); + param = strstr(temp_cmdline, "root="); + old_param = strtok(param, " "); + if (cmd_len != 0) + strcat(local_cmdline, " "); + strcat(local_cmdline, old_param); + } + strcat(local_cmdline, " "); + cmd_len = strlen(local_cmdline); + cmd_len = cmd_len + 1; + memcpy(dt,local_cmdline,cmd_len); + len = cmd_len; + *dt_len = cmd_len; + fprintf(stderr, "Modified cmdline:%s\n", local_cmdline); + } + dt += (len + 3)/4; + if (!strcmp(dp->d_name, "reg") && usablemem_rgns.size) + add_usable_mem_property(fd, len); + close(fd); } } fn[0] = '\0'; @@ -252,7 +345,7 @@ void putnode(void) if ((len >= 8) && ((unsigned long)dt & 0x4)) dt++; - memcpy(dt,&initrd_end,8); + memcpy(dt,&initrd_end,len); dt += (len + 3)/4; reserve(initrd_base, initrd_size); @@ -280,9 +373,8 @@ void putnode(void) dn[-1] = '\0'; } -struct bootblock bb[1]; - -int create_flatten_tree(struct kexec_info *info, unsigned char **bufp, unsigned long *sizep) +int create_flatten_tree(struct kexec_info *info, unsigned char **bufp, + unsigned long *sizep, char *cmdline) { unsigned long len; unsigned long tlen; @@ -296,6 +388,9 @@ int create_flatten_tree(struct kexec_inf pathstart = pathname + strlen(pathname); dt = dtstruct; + if (cmdline) + strcpy(local_cmdline, cmdline); + putnode(); *dt++ = 9; diff -puN /dev/null kexec/arch/ppc64/crashdump-ppc64.h --- /dev/null 2004-07-01 07:56:11.000000000 +0530 +++ kexec-tools-1.101-sharada/kexec/arch/ppc64/crashdump-ppc64.h 2006-01-15 06:51:55.000000000 +0530 @@ -0,0 +1,27 @@ +#ifndef CRASHDUMP_PPC64_H +#define CRASHDUMP_PPC64_H + +void add_usable_mem_rgns(unsigned long long base, unsigned long long size); + +#define PAGE_OFFSET 0xC000000000000000 +#define KERNELBASE PAGE_OFFSET +#define VMALLOCBASE 0xD000000000000000 + +#define __pa(x) ((unsigned long)(x)-PAGE_OFFSET) + +#define MAXMEM (-KERNELBASE-VMALLOCBASE) + +#define CRASH_MAX_MEMORY_RANGES (MAX_MEMORY_RANGES + 6) + +#define COMMAND_LINE_SIZE 512 /* from kernel */ +/* Backup Region, First 32K of System RAM. */ +#define BACKUP_START 0x0000 +#define BACKUP_END 0x8000 +#define BACKUP_SIZE (BACKUP_END - BACKUP_START + 1) + +#define KDUMP_BACKUP_LIMIT 0x8000 +#define _ALIGN_UP(addr,size) (((addr)+((size)-1))&(~((size)-1))) +#define _ALIGN_DOWN(addr,size) ((addr)&(~((size)-1))) +#define PAGE_SIZE 4096 + +#endif /* CRASHDUMP_PPC64_H */ diff -puN kexec/arch/ppc64/kexec-ppc64.h~ppc64-kdump-prepare-device-tree kexec/arch/ppc64/kexec-ppc64.h --- kexec-tools-1.101/kexec/arch/ppc64/kexec-ppc64.h~ppc64-kdump-prepare-device-tree 2006-01-15 06:56:31.000000000 +0530 +++ kexec-tools-1.101-sharada/kexec/arch/ppc64/kexec-ppc64.h 2006-01-15 06:59:07.000000000 +0530 @@ -5,9 +5,9 @@ int elf_ppc64_probe(const char *buf, off int elf_ppc64_load(int argc, char **argv, const char *buf, off_t len, struct kexec_info *info); void elf_ppc64_usage(void); +void reserve(unsigned long long where, unsigned long long length); -unsigned long initrd_base; -unsigned long initrd_size; +extern unsigned long initrd_base, initrd_size; /* boot block version 2 as defined by the linux kernel */ struct bootblock { unsigned magic, @@ -19,4 +19,10 @@ struct bootblock { last_comp_version, boot_physid; }; + +typedef struct mem_rgns { + unsigned int size; + struct exclude_range ranges[MAX_MEMORY_RANGES]; +} mem_rgns_t; + #endif /* KEXEC_PPC64_H */ diff -puN kexec/arch/ppc64/kexec-elf-ppc64.c~ppc64-kdump-prepare-device-tree kexec/arch/ppc64/kexec-elf-ppc64.c --- kexec-tools-1.101/kexec/arch/ppc64/kexec-elf-ppc64.c~ppc64-kdump-prepare-device-tree 2006-01-15 07:00:11.000000000 +0530 +++ kexec-tools-1.101-sharada/kexec/arch/ppc64/kexec-elf-ppc64.c 2006-01-15 07:01:08.000000000 +0530 @@ -40,6 +40,8 @@ #define BOOTLOADER_VERSION VERSION #define MAX_COMMAND_LINE 256 +unsigned long initrd_base, initrd_size; + int create_flatten_tree(struct kexec_info *, unsigned char **, unsigned long *); int parse_options(char *); int setup_memory_ranges(void); _ From linas at austin.ibm.com Tue Jan 17 08:52:17 2006 From: linas at austin.ibm.com (linas) Date: Mon, 16 Jan 2006 15:52:17 -0600 Subject: [PATCH] trivial: modify comments to refer to new location of files In-Reply-To: <20060115060716.GA2157@us.ibm.com> References: <20060112180240.GB17539@us.ibm.com> <20060113114401.3289f33f.sfr@canb.auug.org.au> <20060115060716.GA2157@us.ibm.com> Message-ID: <20060116215217.GO26221@austin.ibm.com> On Sun, Jan 15, 2006 at 12:07:20AM -0600, Jon Mason was heard to remark: > On Fri, Jan 13, 2006 at 11:44:01AM +1100, Stephen Rothwell wrote: > > Can we just remove these useless self references, please? > > Is this more towards your liking? > > Signed-off-by: Jon Mason Acked-by: Linas Vepstas (I'm acking for the eeh-pci-error-recovery.txt part of the patch.) diff -r 800442576617 Documentation/powerpc/eeh-pci-error-recovery.txt --- a/Documentation/powerpc/eeh-pci-error-recovery.txt Sat Jan 14 05:24:55 2006 +++ b/Documentation/powerpc/eeh-pci-error-recovery.txt Sat Jan 14 23:40:17 2006 @@ -121,7 +121,7 @@ EEH must be enabled in the PHB's very early during the boot process, and if a PCI slot is hot-plugged. The former is performed by -eeh_init() in arch/ppc64/kernel/eeh.c, and the later by +eeh_init() in arch/powerpc/platforms/pseries/eeh.c, and the later by drivers/pci/hotplug/pSeries_pci.c calling in to the eeh.c code. EEH must be enabled before a PCI scan of the device can proceed. Current Power5 hardware will not work unless EEH is enabled; @@ -133,7 +133,7 @@ pci_get_device_by_addr() will find the pci device associated with that address (if any). -The default include/asm-ppc64/io.h macros readb(), inb(), insb(), +The default include/asm-powerpc/io.h macros readb(), inb(), insb(), etc. include a check to see if the i/o read returned all-0xff's. If so, these make a call to eeh_dn_check_failure(), which in turn asks the firmware if the all-ff's value is the sign of a true EEH @@ -143,11 +143,12 @@ all of these occur during boot, when the PCI bus is scanned, where a large number of 0xff reads are part of the bus scan procedure. -If a frozen slot is detected, code in arch/ppc64/kernel/eeh.c will -print a stack trace to syslog (/var/log/messages). This stack trace -has proven to be very useful to device-driver authors for finding -out at what point the EEH error was detected, as the error itself -usually occurs slightly beforehand. +If a frozen slot is detected, code in +arch/powerpc/platforms/pseries/eeh.c will print a stack trace to +syslog (/var/log/messages). This stack trace has proven to be very +useful to device-driver authors for finding out at what point the EEH +error was detected, as the error itself usually occurs slightly +beforehand. Next, it uses the Linux kernel notifier chain/work queue mechanism to allow any interested parties to find out about the failure. Device diff -r 800442576617 arch/powerpc/boot/install.sh --- a/arch/powerpc/boot/install.sh Sat Jan 14 05:24:55 2006 +++ b/arch/powerpc/boot/install.sh Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ #!/bin/sh -# -# arch/ppc64/boot/install.sh # # This file is subject to the terms and conditions of the GNU General Public # License. See the file "COPYING" in the main directory of this archive diff -r 800442576617 arch/powerpc/kernel/entry_64.S --- a/arch/powerpc/kernel/entry_64.S Sat Jan 14 05:24:55 2006 +++ b/arch/powerpc/kernel/entry_64.S Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc64/kernel/entry.S - * * PowerPC version * Copyright (C) 1995-1996 Gary Thomas (gdt at linuxppc.org) * Rewritten by Cort Dougan (cort at cs.nmt.edu) for PReP @@ -374,7 +372,7 @@ * the fork code also. * * The code which creates the new task context is in 'copy_thread' - * in arch/ppc64/kernel/process.c + * in arch/powerpc/kernel/process.c */ .align 7 _GLOBAL(_switch) diff -r 800442576617 arch/powerpc/kernel/head_44x.S --- a/arch/powerpc/kernel/head_44x.S Sat Jan 14 05:24:55 2006 +++ b/arch/powerpc/kernel/head_44x.S Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/kernel/head_44x.S - * * Kernel execution entry point code. * * Copyright (c) 1995-1996 Gary Thomas diff -r 800442576617 arch/powerpc/kernel/head_64.S --- a/arch/powerpc/kernel/head_64.S Sat Jan 14 05:24:55 2006 +++ b/arch/powerpc/kernel/head_64.S Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc64/kernel/head.S - * * PowerPC version * Copyright (C) 1995-1996 Gary Thomas (gdt at linuxppc.org) * diff -r 800442576617 arch/powerpc/kernel/head_8xx.S --- a/arch/powerpc/kernel/head_8xx.S Sat Jan 14 05:24:55 2006 +++ b/arch/powerpc/kernel/head_8xx.S Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/kernel/except_8xx.S - * * PowerPC version * Copyright (C) 1995-1996 Gary Thomas (gdt at linuxppc.org) * Rewritten by Cort Dougan (cort at cs.nmt.edu) for PReP diff -r 800442576617 arch/powerpc/kernel/head_fsl_booke.S --- a/arch/powerpc/kernel/head_fsl_booke.S Sat Jan 14 05:24:55 2006 +++ b/arch/powerpc/kernel/head_fsl_booke.S Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/kernel/head_fsl_booke.S - * * Kernel execution entry point code. * * Copyright (c) 1995-1996 Gary Thomas diff -r 800442576617 arch/powerpc/kernel/iomap.c --- a/arch/powerpc/kernel/iomap.c Sat Jan 14 05:24:55 2006 +++ b/arch/powerpc/kernel/iomap.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc64/kernel/iomap.c - * * ppc64 "iomap" interface implementation. * * (C) Copyright 2004 Linus Torvalds diff -r 800442576617 arch/powerpc/kernel/iommu.c --- a/arch/powerpc/kernel/iommu.c Sat Jan 14 05:24:55 2006 +++ b/arch/powerpc/kernel/iommu.c Sat Jan 14 23:40:17 2006 @@ -1,5 +1,4 @@ /* - * arch/ppc64/kernel/iommu.c * Copyright (C) 2001 Mike Corrigan & Dave Engebretsen, IBM Corporation * * Rewrite, cleanup, new allocation schemes, virtual merging: diff -r 800442576617 arch/powerpc/kernel/irq.c --- a/arch/powerpc/kernel/irq.c Sat Jan 14 05:24:55 2006 +++ b/arch/powerpc/kernel/irq.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/kernel/irq.c - * * Derived from arch/i386/kernel/irq.c * Copyright (C) 1992 Linus Torvalds * Adapted from arch/i386 by Gary Thomas diff -r 800442576617 arch/powerpc/kernel/kprobes.c --- a/arch/powerpc/kernel/kprobes.c Sat Jan 14 05:24:55 2006 +++ b/arch/powerpc/kernel/kprobes.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,5 @@ /* * Kernel Probes (KProbes) - * arch/ppc64/kernel/kprobes.c * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff -r 800442576617 arch/powerpc/kernel/pci_iommu.c --- a/arch/powerpc/kernel/pci_iommu.c Sat Jan 14 05:24:55 2006 +++ b/arch/powerpc/kernel/pci_iommu.c Sat Jan 14 23:40:17 2006 @@ -1,5 +1,4 @@ /* - * arch/ppc64/kernel/pci_iommu.c * Copyright (C) 2001 Mike Corrigan & Dave Engebretsen, IBM Corporation * * Rewrite, cleanup, new allocation schemes: diff -r 800442576617 arch/powerpc/kernel/process.c --- a/arch/powerpc/kernel/process.c Sat Jan 14 05:24:55 2006 +++ b/arch/powerpc/kernel/process.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/kernel/process.c - * * Derived from "arch/i386/kernel/process.c" * Copyright (C) 1995 Linus Torvalds * diff -r 800442576617 arch/powerpc/kernel/ptrace-common.h --- a/arch/powerpc/kernel/ptrace-common.h Sat Jan 14 05:24:55 2006 +++ b/arch/powerpc/kernel/ptrace-common.h Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * linux/arch/ppc64/kernel/ptrace-common.h - * * Copyright (c) 2002 Stephen Rothwell, IBM Coproration * Extracted from ptrace.c and ptrace32.c * diff -r 800442576617 arch/powerpc/kernel/rtas-proc.c --- a/arch/powerpc/kernel/rtas-proc.c Sat Jan 14 05:24:55 2006 +++ b/arch/powerpc/kernel/rtas-proc.c Sat Jan 14 23:40:17 2006 @@ -1,5 +1,4 @@ /* - * arch/ppc64/kernel/rtas-proc.c * Copyright (C) 2000 Tilmann Bitterberg * (tilmann at bitterberg.de) * diff -r 800442576617 arch/powerpc/kernel/rtas_pci.c --- a/arch/powerpc/kernel/rtas_pci.c Sat Jan 14 05:24:55 2006 +++ b/arch/powerpc/kernel/rtas_pci.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc64/kernel/rtas_pci.c - * * Copyright (C) 2001 Dave Engebretsen, IBM Corporation * Copyright (C) 2003 Anton Blanchard , IBM * diff -r 800442576617 arch/powerpc/kernel/signal_64.c --- a/arch/powerpc/kernel/signal_64.c Sat Jan 14 05:24:55 2006 +++ b/arch/powerpc/kernel/signal_64.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * linux/arch/ppc64/kernel/signal.c - * * PowerPC version * Copyright (C) 1995-1996 Gary Thomas (gdt at linuxppc.org) * diff -r 800442576617 arch/powerpc/kernel/vdso.c --- a/arch/powerpc/kernel/vdso.c Sat Jan 14 05:24:55 2006 +++ b/arch/powerpc/kernel/vdso.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * linux/arch/ppc64/kernel/vdso.c - * * Copyright (C) 2004 Benjamin Herrenschmidt, IBM Corp. * * diff -r 800442576617 arch/powerpc/lib/copypage_64.S --- a/arch/powerpc/lib/copypage_64.S Sat Jan 14 05:24:55 2006 +++ b/arch/powerpc/lib/copypage_64.S Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc64/lib/copypage.S - * * Copyright (C) 2002 Paul Mackerras, IBM Corp. * * This program is free software; you can redistribute it and/or diff -r 800442576617 arch/powerpc/lib/copyuser_64.S --- a/arch/powerpc/lib/copyuser_64.S Sat Jan 14 05:24:55 2006 +++ b/arch/powerpc/lib/copyuser_64.S Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc64/lib/copyuser.S - * * Copyright (C) 2002 Paul Mackerras, IBM Corp. * * This program is free software; you can redistribute it and/or diff -r 800442576617 arch/powerpc/lib/e2a.c --- a/arch/powerpc/lib/e2a.c Sat Jan 14 05:24:55 2006 +++ b/arch/powerpc/lib/e2a.c Sat Jan 14 23:40:17 2006 @@ -1,9 +1,7 @@ /* - * arch/ppc64/lib/e2a.c - * * EBCDIC to ASCII conversion * - * This function moved here from arch/ppc64/kernel/viopath.c + * This function moved here from arch/powerpc/platforms/iseries/viopath.c * * (C) Copyright 2000-2004 IBM Corporation * diff -r 800442576617 arch/powerpc/lib/memcpy_64.S --- a/arch/powerpc/lib/memcpy_64.S Sat Jan 14 05:24:55 2006 +++ b/arch/powerpc/lib/memcpy_64.S Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc64/lib/memcpy.S - * * Copyright (C) 2002 Paul Mackerras, IBM Corp. * * This program is free software; you can redistribute it and/or diff -r 800442576617 arch/powerpc/lib/rheap.c --- a/arch/powerpc/lib/rheap.c Sat Jan 14 05:24:55 2006 +++ b/arch/powerpc/lib/rheap.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/syslib/rheap.c - * * A Remote Heap. Remote means that we don't touch the memory that the * heap points to. Normal heap implementations use the memory they manage * to place their list. We cannot do that because the memory we manage may diff -r 800442576617 arch/powerpc/mm/fault.c --- a/arch/powerpc/mm/fault.c Sat Jan 14 05:24:55 2006 +++ b/arch/powerpc/mm/fault.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/mm/fault.c - * * PowerPC version * Copyright (C) 1995-1996 Gary Thomas (gdt at linuxppc.org) * diff -r 800442576617 arch/powerpc/mm/hash_low_32.S --- a/arch/powerpc/mm/hash_low_32.S Sat Jan 14 05:24:55 2006 +++ b/arch/powerpc/mm/hash_low_32.S Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/kernel/hashtable.S - * * $Id: hashtable.S,v 1.6 1999/10/08 01:56:15 paulus Exp $ * * PowerPC version diff -r 800442576617 arch/powerpc/mm/mmap.c --- a/arch/powerpc/mm/mmap.c Sat Jan 14 05:24:55 2006 +++ b/arch/powerpc/mm/mmap.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * linux/arch/ppc64/mm/mmap.c - * * flexible mmap layout support * * Copyright 2003-2004 Red Hat Inc., Durham, North Carolina. diff -r 800442576617 arch/powerpc/mm/slb_low.S --- a/arch/powerpc/mm/slb_low.S Sat Jan 14 05:24:55 2006 +++ b/arch/powerpc/mm/slb_low.S Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc64/mm/slb_low.S - * * Low-level SLB routines * * Copyright (C) 2004 David Gibson , IBM diff -r 800442576617 arch/powerpc/mm/tlb_64.c --- a/arch/powerpc/mm/tlb_64.c Sat Jan 14 05:24:55 2006 +++ b/arch/powerpc/mm/tlb_64.c Sat Jan 14 23:40:17 2006 @@ -36,7 +36,7 @@ DEFINE_PER_CPU(struct ppc64_tlb_batch, ppc64_tlb_batch); /* This is declared as we are using the more or less generic - * include/asm-ppc64/tlb.h file -- tgall + * include/asm-powerpc/tlb.h file -- tgall */ DEFINE_PER_CPU(struct mmu_gather, mmu_gathers); DEFINE_PER_CPU(struct pte_freelist_batch *, pte_freelist_cur); diff -r 800442576617 arch/powerpc/platforms/chrp/pegasos_eth.c --- a/arch/powerpc/platforms/chrp/pegasos_eth.c Sat Jan 14 05:24:55 2006 +++ b/arch/powerpc/platforms/chrp/pegasos_eth.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/chrp_pegasos_eth.c - * * Copyright (C) 2005 Sven Luther * Thanks to : * Dale Farnsworth diff -r 800442576617 arch/powerpc/platforms/chrp/setup.c --- a/arch/powerpc/platforms/chrp/setup.c Sat Jan 14 05:24:55 2006 +++ b/arch/powerpc/platforms/chrp/setup.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/setup.c - * * Copyright (C) 1995 Linus Torvalds * Adapted from 'alpha' version by Gary Thomas * Modified by Cort Dougan (cort at cs.nmt.edu) diff -r 800442576617 arch/powerpc/platforms/chrp/time.c --- a/arch/powerpc/platforms/chrp/time.c Sat Jan 14 05:24:55 2006 +++ b/arch/powerpc/platforms/chrp/time.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/chrp_time.c - * * Copyright (C) 1991, 1992, 1995 Linus Torvalds * * Adapted for PowerPC (PReP) by Gary Thomas diff -r 800442576617 arch/powerpc/platforms/maple/time.c --- a/arch/powerpc/platforms/maple/time.c Sat Jan 14 05:24:55 2006 +++ b/arch/powerpc/platforms/maple/time.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc64/kernel/maple_time.c - * * (c) Copyright 2004 Benjamin Herrenschmidt (benh at kernel.crashing.org), * IBM Corp. * diff -r 800442576617 arch/powerpc/platforms/powermac/cpufreq_32.c --- a/arch/powerpc/platforms/powermac/cpufreq_32.c Sat Jan 14 05:24:55 2006 +++ b/arch/powerpc/platforms/powermac/cpufreq_32.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/pmac_cpufreq.c - * * Copyright (C) 2002 - 2005 Benjamin Herrenschmidt * Copyright (C) 2004 John Steele Scott * diff -r 800442576617 arch/powerpc/platforms/powermac/feature.c --- a/arch/powerpc/platforms/powermac/feature.c Sat Jan 14 05:24:55 2006 +++ b/arch/powerpc/platforms/powermac/feature.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/pmac_feature.c - * * Copyright (C) 1996-2001 Paul Mackerras (paulus at cs.anu.edu.au) * Ben. Herrenschmidt (benh at kernel.crashing.org) * diff -r 800442576617 arch/powerpc/platforms/powermac/nvram.c --- a/arch/powerpc/platforms/powermac/nvram.c Sat Jan 14 05:24:55 2006 +++ b/arch/powerpc/platforms/powermac/nvram.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/pmac_nvram.c - * * Copyright (C) 2002 Benjamin Herrenschmidt (benh at kernel.crashing.org) * * This program is free software; you can redistribute it and/or diff -r 800442576617 arch/powerpc/platforms/pseries/hvCall.S --- a/arch/powerpc/platforms/pseries/hvCall.S Sat Jan 14 05:24:55 2006 +++ b/arch/powerpc/platforms/pseries/hvCall.S Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc64/kernel/pSeries_hvCall.S - * * This file contains the generic code to perform a call to the * pSeries LPAR hypervisor. * NOTE: this file will go away when we move to inline this work. diff -r 800442576617 arch/powerpc/platforms/pseries/iommu.c --- a/arch/powerpc/platforms/pseries/iommu.c Sat Jan 14 05:24:55 2006 +++ b/arch/powerpc/platforms/pseries/iommu.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc64/kernel/pSeries_iommu.c - * * Copyright (C) 2001 Mike Corrigan & Dave Engebretsen, IBM Corporation * * Rewrite, cleanup: diff -r 800442576617 arch/powerpc/platforms/pseries/pci.c --- a/arch/powerpc/platforms/pseries/pci.c Sat Jan 14 05:24:55 2006 +++ b/arch/powerpc/platforms/pseries/pci.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc64/kernel/pSeries_pci.c - * * Copyright (C) 2001 Dave Engebretsen, IBM Corporation * Copyright (C) 2003 Anton Blanchard , IBM * diff -r 800442576617 arch/powerpc/sysdev/dcr.S --- a/arch/powerpc/sysdev/dcr.S Sat Jan 14 05:24:55 2006 +++ b/arch/powerpc/sysdev/dcr.S Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/syslib/dcr.S - * * "Indirect" DCR access * * Copyright (c) 2004 Eugene Surovegin diff -r 800442576617 arch/powerpc/sysdev/ipic.h --- a/arch/powerpc/sysdev/ipic.h Sat Jan 14 05:24:55 2006 +++ b/arch/powerpc/sysdev/ipic.h Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/kernel/ipic.h - * * IPIC private definitions and structure. * * Maintainer: Kumar Gala diff -r 800442576617 arch/ppc/4xx_io/serial_sicc.c --- a/arch/ppc/4xx_io/serial_sicc.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/4xx_io/serial_sicc.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/4xx_io/serial_sicc.c - * * Driver for IBM STB3xxx SICC serial port * * Based on drivers/char/serial_amba.c, by ARM Ltd. diff -r 800442576617 arch/ppc/amiga/amiints.c --- a/arch/ppc/amiga/amiints.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/amiga/amiints.c Sat Jan 14 23:40:17 2006 @@ -1,5 +1,5 @@ /* - * arch/ppc/amiga/amiints.c -- Amiga Linux interrupt handling code + * Amiga Linux interrupt handling code * * This file is subject to the terms and conditions of the GNU General Public * License. See the file COPYING in the main directory of this archive diff -r 800442576617 arch/ppc/amiga/bootinfo.c --- a/arch/ppc/amiga/bootinfo.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/amiga/bootinfo.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/amiga/bootinfo.c - * * Extracted from arch/m68k/kernel/setup.c. * Should be properly generalized and put somewhere else. * Jesper diff -r 800442576617 arch/ppc/amiga/cia.c --- a/arch/ppc/amiga/cia.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/amiga/cia.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/amiga/cia.c - CIA support - * * Copyright (C) 1996 Roman Zippel * * The concept of some functions bases on the original Amiga OS function diff -r 800442576617 arch/ppc/amiga/ints.c --- a/arch/ppc/amiga/ints.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/amiga/ints.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/amiga/ints.c - * * Linux/m68k general interrupt handling code from arch/m68k/kernel/ints.c * Needed to drive the m68k emulating IRQ hardware on the PowerUp boards. */ diff -r 800442576617 arch/ppc/boot/Makefile --- a/arch/ppc/boot/Makefile Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/boot/Makefile Sat Jan 14 23:40:17 2006 @@ -1,6 +1,3 @@ -# -# arch/ppc/boot/Makefile -# # This file is subject to the terms and conditions of the GNU General Public # License. See the file "COPYING" in the main directory of this archive # for more details. diff -r 800442576617 arch/ppc/boot/common/Makefile --- a/arch/ppc/boot/common/Makefile Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/boot/common/Makefile Sat Jan 14 23:40:17 2006 @@ -1,6 +1,3 @@ -# -# arch/ppc/boot/common/Makefile -# # This file is subject to the terms and conditions of the GNU General Public # License. See the file "COPYING" in the main directory of this archive # for more details. diff -r 800442576617 arch/ppc/boot/common/bootinfo.c --- a/arch/ppc/boot/common/bootinfo.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/boot/common/bootinfo.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/common/bootinfo.c - * * General bootinfo record utilities * Author: Randy Vinson * diff -r 800442576617 arch/ppc/boot/common/misc-common.c --- a/arch/ppc/boot/common/misc-common.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/boot/common/misc-common.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/boot/common/misc-common.c - * * Misc. bootloader code (almost) all platforms can use * * Author: Johnnie Peters diff -r 800442576617 arch/ppc/boot/common/serial_stub.c --- a/arch/ppc/boot/common/serial_stub.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/boot/common/serial_stub.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/boot/common/serial_stub.c - * * This is a few stub routines to make the boot code cleaner looking when * there is no serial port support doesn't need to be closed, for example. * diff -r 800442576617 arch/ppc/boot/common/util.S --- a/arch/ppc/boot/common/util.S Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/boot/common/util.S Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/boot/common/util.S - * * Useful bootup functions, which are more easily done in asm than C. * * NOTE: Be very very careful about the registers you use here. diff -r 800442576617 arch/ppc/boot/include/mpc10x.h --- a/arch/ppc/boot/include/mpc10x.h Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/boot/include/mpc10x.h Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/boot/include/mpc10.h - * * Common defines for the Motorola SPS MPC106/8240/107 Host bridge/Mem * ctrl/EPIC/etc. * diff -r 800442576617 arch/ppc/boot/simple/cpc700_memory.c --- a/arch/ppc/boot/simple/cpc700_memory.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/boot/simple/cpc700_memory.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/boot/common/cpc700_memory.c - * * Find memory based upon settings in the CPC700 bridge * * Author: Dan Cox diff -r 800442576617 arch/ppc/boot/simple/head.S --- a/arch/ppc/boot/simple/head.S Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/boot/simple/head.S Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/boot/simple/head.S - * * Initial board bringup code for many different boards. * * Author: Tom Rini diff -r 800442576617 arch/ppc/boot/simple/misc-chestnut.c --- a/arch/ppc/boot/simple/misc-chestnut.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/boot/simple/misc-chestnut.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/boot/simple/misc-chestnut.c - * * Setup for the IBM Chestnut (ibm-750fxgx_eval) * * Author: Mark A. Greer diff -r 800442576617 arch/ppc/boot/simple/misc-cpci690.c --- a/arch/ppc/boot/simple/misc-cpci690.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/boot/simple/misc-cpci690.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/boot/simple/misc-cpci690.c - * * Add birec data for Force CPCI690 board. * * Author: Mark A. Greer diff -r 800442576617 arch/ppc/boot/simple/misc-ev64260.c --- a/arch/ppc/boot/simple/misc-ev64260.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/boot/simple/misc-ev64260.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/boot/simple/misc-ev64260.c - * * Host bridge init code for the Marvell/Galileo EV-64260-BP evaluation board * with a GT64260 onboard. * diff -r 800442576617 arch/ppc/boot/simple/misc-ev64360.c --- a/arch/ppc/boot/simple/misc-ev64360.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/boot/simple/misc-ev64360.c Sat Jan 14 23:40:17 2006 @@ -1,5 +1,4 @@ /* - * arch/ppc/boot/simple/misc-ev64360.c * Copyright (C) 2005 Lee Nicks * * Based on arch/ppc/boot/simple/misc-katana.c from: diff -r 800442576617 arch/ppc/boot/simple/misc-katana.c --- a/arch/ppc/boot/simple/misc-katana.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/boot/simple/misc-katana.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/boot/simple/misc-katana.c - * * Set up MPSC values to bootwrapper can prompt user. * * Author: Mark A. Greer diff -r 800442576617 arch/ppc/boot/simple/misc-mv64x60.c --- a/arch/ppc/boot/simple/misc-mv64x60.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/boot/simple/misc-mv64x60.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/boot/simple/misc-mv64x60.c - * * Relocate bridge's register base and call board specific routine. * * Author: Mark A. Greer diff -r 800442576617 arch/ppc/boot/simple/misc-prep.c --- a/arch/ppc/boot/simple/misc-prep.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/boot/simple/misc-prep.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/boot/simple/misc-prep.c - * * Maintainer: Tom Rini * * In the past: Gary Thomas, Cort Dougan diff -r 800442576617 arch/ppc/boot/simple/misc-radstone_ppc7d.c --- a/arch/ppc/boot/simple/misc-radstone_ppc7d.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/boot/simple/misc-radstone_ppc7d.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/boot/simple/misc-radstone_ppc7d.c - * * Misc data for Radstone PPC7D board. * * Author: James Chapman diff -r 800442576617 arch/ppc/boot/simple/misc-spruce.c --- a/arch/ppc/boot/simple/misc-spruce.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/boot/simple/misc-spruce.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/boot/spruce/misc.c - * * Misc. bootloader code for IBM Spruce reference platform * * Authors: Johnnie Peters diff -r 800442576617 arch/ppc/boot/simple/misc.c --- a/arch/ppc/boot/simple/misc.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/boot/simple/misc.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/simple/misc.c - * * Misc. bootloader code for many machines. This assumes you have are using * a 6xx/7xx/74xx CPU in your machine. This assumes the chunk of memory * below 8MB is free. Finally, it assumes you have a NS16550-style uart for diff -r 800442576617 arch/ppc/boot/simple/mpc10x_memory.c --- a/arch/ppc/boot/simple/mpc10x_memory.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/boot/simple/mpc10x_memory.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/boot/common/mpc10x_common.c - * * A routine to find out how much memory the machine has. * * Based on: diff -r 800442576617 arch/ppc/boot/simple/mpc52xx_tty.c --- a/arch/ppc/boot/simple/mpc52xx_tty.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/boot/simple/mpc52xx_tty.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/boot/simple/mpc52xx_tty.c - * * Minimal serial functions needed to send messages out a MPC52xx * Programmable Serial Controller (PSC). * diff -r 800442576617 arch/ppc/boot/simple/mv64x60_tty.c --- a/arch/ppc/boot/simple/mv64x60_tty.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/boot/simple/mv64x60_tty.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/boot/simple/mv64x60_tty.c - * * Bootloader version of the embedded MPSC/UART driver for the Marvell 64x60. * Note: Due to a GT64260A erratum, DMA will be used for UART input (via SDMA). * diff -r 800442576617 arch/ppc/boot/simple/openbios.c --- a/arch/ppc/boot/simple/openbios.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/boot/simple/openbios.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/boot/simple/openbios.c - * * Copyright (c) 2005 DENX Software Engineering * Stefan Roese * diff -r 800442576617 arch/ppc/boot/simple/relocate.S --- a/arch/ppc/boot/simple/relocate.S Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/boot/simple/relocate.S Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/boot/simple/relocate.S - * * This is the common part of the loader relocation and initialization * process. All of the board/processor specific initialization is * done before we get here. diff -r 800442576617 arch/ppc/boot/utils/mkbugboot.c --- a/arch/ppc/boot/utils/mkbugboot.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/boot/utils/mkbugboot.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/boot/utils/mkbugboot.c - * * Makes a Motorola PPCBUG ROM bootable image which can be flashed * into one of the FLASH banks on a Motorola PowerPlus board. * diff -r 800442576617 arch/ppc/kernel/head_44x.S --- a/arch/ppc/kernel/head_44x.S Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/kernel/head_44x.S Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/kernel/head_44x.S - * * Kernel execution entry point code. * * Copyright (c) 1995-1996 Gary Thomas diff -r 800442576617 arch/ppc/kernel/head_8xx.S --- a/arch/ppc/kernel/head_8xx.S Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/kernel/head_8xx.S Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/kernel/except_8xx.S - * * PowerPC version * Copyright (C) 1995-1996 Gary Thomas (gdt at linuxppc.org) * Rewritten by Cort Dougan (cort at cs.nmt.edu) for PReP diff -r 800442576617 arch/ppc/kernel/head_fsl_booke.S --- a/arch/ppc/kernel/head_fsl_booke.S Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/kernel/head_fsl_booke.S Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/kernel/head_fsl_booke.S - * * Kernel execution entry point code. * * Copyright (c) 1995-1996 Gary Thomas diff -r 800442576617 arch/ppc/kernel/traps.c --- a/arch/ppc/kernel/traps.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/kernel/traps.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/kernel/traps.c - * * Copyright (C) 1995-1996 Gary Thomas (gdt at linuxppc.org) * * This program is free software; you can redistribute it and/or diff -r 800442576617 arch/ppc/lib/rheap.c --- a/arch/ppc/lib/rheap.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/lib/rheap.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/syslib/rheap.c - * * A Remote Heap. Remote means that we don't touch the memory that the * heap points to. Normal heap implementations use the memory they manage * to place their list. We cannot do that because the memory we manage may diff -r 800442576617 arch/ppc/math-emu/math.c --- a/arch/ppc/math-emu/math.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/math-emu/math.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/math-emu/math.c - * * Copyright (C) 1999 Eddie C. Dost (ecd at atecom.com) */ diff -r 800442576617 arch/ppc/mm/fault.c --- a/arch/ppc/mm/fault.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/mm/fault.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/mm/fault.c - * * PowerPC version * Copyright (C) 1995-1996 Gary Thomas (gdt at linuxppc.org) * diff -r 800442576617 arch/ppc/mm/hashtable.S --- a/arch/ppc/mm/hashtable.S Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/mm/hashtable.S Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/kernel/hashtable.S - * * $Id: hashtable.S,v 1.6 1999/10/08 01:56:15 paulus Exp $ * * PowerPC version diff -r 800442576617 arch/ppc/platforms/4xx/bamboo.c --- a/arch/ppc/platforms/4xx/bamboo.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/platforms/4xx/bamboo.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/4xx/bamboo.c - * * Bamboo board specific routines * * Wade Farnsworth diff -r 800442576617 arch/ppc/platforms/4xx/bamboo.h --- a/arch/ppc/platforms/4xx/bamboo.h Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/platforms/4xx/bamboo.h Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/bamboo.h - * * Bamboo board definitions * * Wade Farnsworth diff -r 800442576617 arch/ppc/platforms/4xx/bubinga.h --- a/arch/ppc/platforms/4xx/bubinga.h Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/platforms/4xx/bubinga.h Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/4xx/bubinga.h - * * Bubinga board definitions * * Copyright (c) 2005 DENX Software Engineering diff -r 800442576617 arch/ppc/platforms/4xx/cpci405.c --- a/arch/ppc/platforms/4xx/cpci405.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/platforms/4xx/cpci405.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/cpci405.c - * * Board setup routines for the esd CPCI-405 cPCI Board. * * Author: Stefan Roese diff -r 800442576617 arch/ppc/platforms/4xx/ebony.c --- a/arch/ppc/platforms/4xx/ebony.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/platforms/4xx/ebony.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/4xx/ebony.c - * * Ebony board specific routines * * Matt Porter diff -r 800442576617 arch/ppc/platforms/4xx/ebony.h --- a/arch/ppc/platforms/4xx/ebony.h Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/platforms/4xx/ebony.h Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/ebony.h - * * Ebony board definitions * * Matt Porter diff -r 800442576617 arch/ppc/platforms/4xx/ep405.c --- a/arch/ppc/platforms/4xx/ep405.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/platforms/4xx/ep405.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/4xx/ep405.c - * * Embedded Planet 405GP board * http://www.embeddedplanet.com * diff -r 800442576617 arch/ppc/platforms/4xx/ep405.h --- a/arch/ppc/platforms/4xx/ep405.h Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/platforms/4xx/ep405.h Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/4xx/ep405.h - * * Embedded Planet 405GP board * http://www.embeddedplanet.com * diff -r 800442576617 arch/ppc/platforms/4xx/ibm405ep.c --- a/arch/ppc/platforms/4xx/ibm405ep.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/platforms/4xx/ibm405ep.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/ibm405ep.c - * * Support for IBM PPC 405EP processors. * * Author: SAW (IBM), derived from ibmnp405l.c. diff -r 800442576617 arch/ppc/platforms/4xx/ibm405ep.h --- a/arch/ppc/platforms/4xx/ibm405ep.h Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/platforms/4xx/ibm405ep.h Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/4xx/ibm405ep.h - * * IBM PPC 405EP processor defines. * * Author: SAW (IBM), derived from ibm405gp.h. diff -r 800442576617 arch/ppc/platforms/4xx/ibm405gp.h --- a/arch/ppc/platforms/4xx/ibm405gp.h Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/platforms/4xx/ibm405gp.h Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/4xx/ibm405gp.h - * * Author: Armin Kuster akuster at mvista.com * * 2001 (c) MontaVista, Software, Inc. This file is licensed under diff -r 800442576617 arch/ppc/platforms/4xx/ibm405gpr.c --- a/arch/ppc/platforms/4xx/ibm405gpr.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/platforms/4xx/ibm405gpr.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/4xx/ibm405gpr.c - * * Author: Armin Kuster * * 2002 (c) MontaVista, Software, Inc. This file is licensed under diff -r 800442576617 arch/ppc/platforms/4xx/ibm405gpr.h --- a/arch/ppc/platforms/4xx/ibm405gpr.h Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/platforms/4xx/ibm405gpr.h Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/4xx/ibm405gpr.h - * * Author: Armin Kuster * * 2002 (c) MontaVista, Software, Inc. This file is licensed under diff -r 800442576617 arch/ppc/platforms/4xx/ibm440ep.c --- a/arch/ppc/platforms/4xx/ibm440ep.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/platforms/4xx/ibm440ep.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/4xx/ibm440ep.c - * * PPC440EP I/O descriptions * * Wade Farnsworth diff -r 800442576617 arch/ppc/platforms/4xx/ibm440ep.h --- a/arch/ppc/platforms/4xx/ibm440ep.h Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/platforms/4xx/ibm440ep.h Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/4xx/ibm440ep.h - * * PPC440EP definitions * * Wade Farnsworth diff -r 800442576617 arch/ppc/platforms/4xx/ibm440gp.c --- a/arch/ppc/platforms/4xx/ibm440gp.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/platforms/4xx/ibm440gp.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/4xx/ibm440gp.c - * * PPC440GP I/O descriptions * * Matt Porter diff -r 800442576617 arch/ppc/platforms/4xx/ibm440gp.h --- a/arch/ppc/platforms/4xx/ibm440gp.h Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/platforms/4xx/ibm440gp.h Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/4xx/ibm440gp.h - * * PPC440GP definitions * * Roland Dreier diff -r 800442576617 arch/ppc/platforms/4xx/ibm440gx.c --- a/arch/ppc/platforms/4xx/ibm440gx.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/platforms/4xx/ibm440gx.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/4xx/ibm440gx.c - * * PPC440GX I/O descriptions * * Matt Porter diff -r 800442576617 arch/ppc/platforms/4xx/ibm440gx.h --- a/arch/ppc/platforms/4xx/ibm440gx.h Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/platforms/4xx/ibm440gx.h Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/ibm440gx.h - * * PPC440GX definitions * * Matt Porter diff -r 800442576617 arch/ppc/platforms/4xx/ibm440sp.c --- a/arch/ppc/platforms/4xx/ibm440sp.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/platforms/4xx/ibm440sp.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/4xx/ibm440sp.c - * * PPC440SP I/O descriptions * * Matt Porter diff -r 800442576617 arch/ppc/platforms/4xx/ibm440sp.h --- a/arch/ppc/platforms/4xx/ibm440sp.h Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/platforms/4xx/ibm440sp.h Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/4xx/ibm440sp.h - * * PPC440SP definitions * * Matt Porter diff -r 800442576617 arch/ppc/platforms/4xx/ibmnp405h.c --- a/arch/ppc/platforms/4xx/ibmnp405h.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/platforms/4xx/ibmnp405h.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/4xx/ibmnp405h.c - * * Author: Armin Kuster * * 2000-2002 (c) MontaVista, Software, Inc. This file is licensed under diff -r 800442576617 arch/ppc/platforms/4xx/ibmnp405h.h --- a/arch/ppc/platforms/4xx/ibmnp405h.h Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/platforms/4xx/ibmnp405h.h Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/4xx/ibmnp405h.h - * * Author: Armin Kuster * * 2002 (c) MontaVista, Software, Inc. This file is licensed under diff -r 800442576617 arch/ppc/platforms/4xx/ibmstb4.c --- a/arch/ppc/platforms/4xx/ibmstb4.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/platforms/4xx/ibmstb4.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/4xx/ibmstb4.c - * * Author: Armin Kuster * * 2000-2001 (c) MontaVista, Software, Inc. This file is licensed under diff -r 800442576617 arch/ppc/platforms/4xx/ibmstb4.h --- a/arch/ppc/platforms/4xx/ibmstb4.h Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/platforms/4xx/ibmstb4.h Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/4xx/ibmstb4.h - * * Author: Armin Kuster * * 2001 (c) MontaVista, Software, Inc. This file is licensed under diff -r 800442576617 arch/ppc/platforms/4xx/ibmstbx25.c --- a/arch/ppc/platforms/4xx/ibmstbx25.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/platforms/4xx/ibmstbx25.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/4xx/ibmstbx25.c - * * Author: Armin Kuster * * 2000-2002 (c) MontaVista, Software, Inc. This file is licensed under diff -r 800442576617 arch/ppc/platforms/4xx/ibmstbx25.h --- a/arch/ppc/platforms/4xx/ibmstbx25.h Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/platforms/4xx/ibmstbx25.h Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/4xx/ibmstbx25.h - * * Author: Armin Kuster * * 2002 (c) MontaVista, Software, Inc. This file is licensed under diff -r 800442576617 arch/ppc/platforms/4xx/luan.c --- a/arch/ppc/platforms/4xx/luan.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/platforms/4xx/luan.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/4xx/luan.c - * * Luan board specific routines * * Matt Porter diff -r 800442576617 arch/ppc/platforms/4xx/luan.h --- a/arch/ppc/platforms/4xx/luan.h Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/platforms/4xx/luan.h Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/4xx/luan.h - * * Luan board definitions * * Matt Porter diff -r 800442576617 arch/ppc/platforms/4xx/ocotea.c --- a/arch/ppc/platforms/4xx/ocotea.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/platforms/4xx/ocotea.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/4xx/ocotea.c - * * Ocotea board specific routines * * Matt Porter diff -r 800442576617 arch/ppc/platforms/4xx/ocotea.h --- a/arch/ppc/platforms/4xx/ocotea.h Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/platforms/4xx/ocotea.h Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/ocotea.h - * * Ocotea board definitions * * Matt Porter diff -r 800442576617 arch/ppc/platforms/4xx/ppc440spe.c --- a/arch/ppc/platforms/4xx/ppc440spe.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/platforms/4xx/ppc440spe.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/4xx/ppc440spe.c - * * PPC440SPe I/O descriptions * * Roland Dreier diff -r 800442576617 arch/ppc/platforms/4xx/ppc440spe.h --- a/arch/ppc/platforms/4xx/ppc440spe.h Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/platforms/4xx/ppc440spe.h Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/4xx/ibm440spe.h - * * PPC440SPe definitions * * Roland Dreier diff -r 800442576617 arch/ppc/platforms/4xx/redwood5.c --- a/arch/ppc/platforms/4xx/redwood5.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/platforms/4xx/redwood5.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/4xx/redwood5.c - * * Support for the IBM redwood5 eval board file * * Author: Armin Kuster diff -r 800442576617 arch/ppc/platforms/4xx/redwood5.h --- a/arch/ppc/platforms/4xx/redwood5.h Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/platforms/4xx/redwood5.h Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/4xx/redwood5.h - * * Macros, definitions, and data structures specific to the IBM PowerPC * STB03xxx "Redwood" evaluation board. * diff -r 800442576617 arch/ppc/platforms/4xx/redwood6.c --- a/arch/ppc/platforms/4xx/redwood6.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/platforms/4xx/redwood6.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/4xx/redwood6.c - * * Author: Armin Kuster * * 2002 (c) MontaVista, Software, Inc. This file is licensed under diff -r 800442576617 arch/ppc/platforms/4xx/redwood6.h --- a/arch/ppc/platforms/4xx/redwood6.h Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/platforms/4xx/redwood6.h Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/4xx/redwood6.h - * * Macros, definitions, and data structures specific to the IBM PowerPC * STBx25xx "Redwood6" evaluation board. * diff -r 800442576617 arch/ppc/platforms/4xx/sycamore.c --- a/arch/ppc/platforms/4xx/sycamore.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/platforms/4xx/sycamore.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/4xx/sycamore.c - * * Architecture- / platform-specific boot-time initialization code for * IBM PowerPC 4xx based boards. * diff -r 800442576617 arch/ppc/platforms/4xx/sycamore.h --- a/arch/ppc/platforms/4xx/sycamore.h Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/platforms/4xx/sycamore.h Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/4xx/sycamore.h - * * Sycamore board definitions * * Copyright (c) 2005 DENX Software Engineering diff -r 800442576617 arch/ppc/platforms/4xx/virtex-ii_pro.c --- a/arch/ppc/platforms/4xx/virtex-ii_pro.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/platforms/4xx/virtex-ii_pro.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/4xx/virtex-ii_pro.c - * * Author: MontaVista Software, Inc. * source at mvista.com * diff -r 800442576617 arch/ppc/platforms/4xx/virtex-ii_pro.h --- a/arch/ppc/platforms/4xx/virtex-ii_pro.h Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/platforms/4xx/virtex-ii_pro.h Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/4xx/virtex-ii_pro.h - * * Include file that defines the Xilinx Virtex-II Pro processor * * Author: MontaVista Software, Inc. diff -r 800442576617 arch/ppc/platforms/4xx/walnut.c --- a/arch/ppc/platforms/4xx/walnut.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/platforms/4xx/walnut.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/4xx/walnut.c - * * Architecture- / platform-specific boot-time initialization code for * IBM PowerPC 4xx based boards. Adapted from original * code by Gary Thomas, Cort Dougan , and Dan Malek diff -r 800442576617 arch/ppc/platforms/4xx/walnut.h --- a/arch/ppc/platforms/4xx/walnut.h Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/platforms/4xx/walnut.h Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/4xx/walnut.h - * * Walnut board definitions * * Copyright (c) 2005 DENX Software Engineering diff -r 800442576617 arch/ppc/platforms/4xx/xilinx_ml300.c --- a/arch/ppc/platforms/4xx/xilinx_ml300.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/platforms/4xx/xilinx_ml300.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/4xx/xilinx_ml300.c - * * Xilinx ML300 evaluation board initialization * * Author: MontaVista Software, Inc. diff -r 800442576617 arch/ppc/platforms/4xx/xilinx_ml300.h --- a/arch/ppc/platforms/4xx/xilinx_ml300.h Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/platforms/4xx/xilinx_ml300.h Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/4xx/xilinx_ml300.h - * * Include file that defines the Xilinx ML300 evaluation board * * Author: MontaVista Software, Inc. diff -r 800442576617 arch/ppc/platforms/4xx/yucca.c --- a/arch/ppc/platforms/4xx/yucca.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/platforms/4xx/yucca.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/4xx/yucca.c - * * Yucca board specific routines * * Roland Dreier (based on luan.c by Matt Porter) diff -r 800442576617 arch/ppc/platforms/4xx/yucca.h --- a/arch/ppc/platforms/4xx/yucca.h Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/platforms/4xx/yucca.h Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/4xx/yucca.h - * * Yucca board definitions * * Roland Dreier (based on luan.h by Matt Porter) diff -r 800442576617 arch/ppc/platforms/83xx/mpc834x_sys.c --- a/arch/ppc/platforms/83xx/mpc834x_sys.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/platforms/83xx/mpc834x_sys.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/83xx/mpc834x_sys.c - * * MPC834x SYS board specific routines * * Maintainer: Kumar Gala diff -r 800442576617 arch/ppc/platforms/83xx/mpc834x_sys.h --- a/arch/ppc/platforms/83xx/mpc834x_sys.h Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/platforms/83xx/mpc834x_sys.h Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/83xx/mpc834x_sys.h - * * MPC834X SYS common board definitions * * Maintainer: Kumar Gala diff -r 800442576617 arch/ppc/platforms/85xx/mpc8540_ads.c --- a/arch/ppc/platforms/85xx/mpc8540_ads.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/platforms/85xx/mpc8540_ads.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/85xx/mpc8540_ads.c - * * MPC8540ADS board specific routines * * Maintainer: Kumar Gala diff -r 800442576617 arch/ppc/platforms/85xx/mpc8540_ads.h --- a/arch/ppc/platforms/85xx/mpc8540_ads.h Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/platforms/85xx/mpc8540_ads.h Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/85xx/mpc8540_ads.h - * * MPC8540ADS board definitions * * Maintainer: Kumar Gala diff -r 800442576617 arch/ppc/platforms/85xx/mpc8555_cds.h --- a/arch/ppc/platforms/85xx/mpc8555_cds.h Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/platforms/85xx/mpc8555_cds.h Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/mpc8555_cds.h - * * MPC8555CDS board definitions * * Maintainer: Kumar Gala diff -r 800442576617 arch/ppc/platforms/85xx/mpc8560_ads.c --- a/arch/ppc/platforms/85xx/mpc8560_ads.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/platforms/85xx/mpc8560_ads.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/85xx/mpc8560_ads.c - * * MPC8560ADS board specific routines * * Maintainer: Kumar Gala diff -r 800442576617 arch/ppc/platforms/85xx/mpc8560_ads.h --- a/arch/ppc/platforms/85xx/mpc8560_ads.h Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/platforms/85xx/mpc8560_ads.h Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/mpc8560_ads.h - * * MPC8540ADS board definitions * * Maintainer: Kumar Gala diff -r 800442576617 arch/ppc/platforms/85xx/mpc85xx_ads_common.c --- a/arch/ppc/platforms/85xx/mpc85xx_ads_common.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/platforms/85xx/mpc85xx_ads_common.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/85xx/mpc85xx_ads_common.c - * * MPC85xx ADS board common routines * * Maintainer: Kumar Gala diff -r 800442576617 arch/ppc/platforms/85xx/mpc85xx_ads_common.h --- a/arch/ppc/platforms/85xx/mpc85xx_ads_common.h Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/platforms/85xx/mpc85xx_ads_common.h Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/85xx/mpc85xx_ads_common.h - * * MPC85XX ADS common board definitions * * Maintainer: Kumar Gala diff -r 800442576617 arch/ppc/platforms/85xx/mpc85xx_cds_common.c --- a/arch/ppc/platforms/85xx/mpc85xx_cds_common.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/platforms/85xx/mpc85xx_cds_common.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platform/85xx/mpc85xx_cds_common.c - * * MPC85xx CDS board specific routines * * Maintainer: Kumar Gala diff -r 800442576617 arch/ppc/platforms/85xx/mpc85xx_cds_common.h --- a/arch/ppc/platforms/85xx/mpc85xx_cds_common.h Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/platforms/85xx/mpc85xx_cds_common.h Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/85xx/mpc85xx_cds_common.h - * * MPC85xx CDS board definitions * * Maintainer: Kumar Gala diff -r 800442576617 arch/ppc/platforms/85xx/sbc8560.c --- a/arch/ppc/platforms/85xx/sbc8560.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/platforms/85xx/sbc8560.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/85xx/sbc8560.c - * * Wind River SBC8560 board specific routines * * Maintainer: Kumar Gala diff -r 800442576617 arch/ppc/platforms/85xx/sbc8560.h --- a/arch/ppc/platforms/85xx/sbc8560.h Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/platforms/85xx/sbc8560.h Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/85xx/sbc8560.h - * * Wind River SBC8560 board definitions * * Copyright 2003 Motorola Inc. diff -r 800442576617 arch/ppc/platforms/85xx/sbc85xx.c --- a/arch/ppc/platforms/85xx/sbc85xx.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/platforms/85xx/sbc85xx.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platform/85xx/sbc85xx.c - * * WindRiver PowerQUICC III SBC85xx board common routines * * Copyright 2002, 2003 Motorola Inc. diff -r 800442576617 arch/ppc/platforms/85xx/sbc85xx.h --- a/arch/ppc/platforms/85xx/sbc85xx.h Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/platforms/85xx/sbc85xx.h Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/85xx/sbc85xx.h - * * WindRiver PowerQUICC III SBC85xx common board definitions * * Copyright 2003 Motorola Inc. diff -r 800442576617 arch/ppc/platforms/85xx/stx_gp3.c --- a/arch/ppc/platforms/85xx/stx_gp3.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/platforms/85xx/stx_gp3.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/85xx/stx_gp3.c - * * STx GP3 board specific routines * * Dan Malek diff -r 800442576617 arch/ppc/platforms/85xx/stx_gp3.h --- a/arch/ppc/platforms/85xx/stx_gp3.h Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/platforms/85xx/stx_gp3.h Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/stx8560_gp3.h - * * STx GP3 board definitions * * Dan Malek (dan at embeddededge.com) diff -r 800442576617 arch/ppc/platforms/85xx/tqm85xx.c --- a/arch/ppc/platforms/85xx/tqm85xx.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/platforms/85xx/tqm85xx.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/85xx/tqm85xx.c - * * TQM85xx (40/41/55/60) board specific routines * * Copyright (c) 2005 DENX Software Engineering diff -r 800442576617 arch/ppc/platforms/85xx/tqm85xx.h --- a/arch/ppc/platforms/85xx/tqm85xx.h Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/platforms/85xx/tqm85xx.h Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/85xx/tqm85xx.h - * * TQM85xx (40/41/55/60) board definitions * * Copyright (c) 2005 DENX Software Engineering diff -r 800442576617 arch/ppc/platforms/apus_setup.c --- a/arch/ppc/platforms/apus_setup.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/platforms/apus_setup.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/apus_setup.c - * * Copyright (C) 1998, 1999 Jesper Skov * * Basically what is needed to replace functionality found in diff -r 800442576617 arch/ppc/platforms/chestnut.c --- a/arch/ppc/platforms/chestnut.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/platforms/chestnut.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/chestnut.c - * * Board setup routines for IBM Chestnut * * Author: diff -r 800442576617 arch/ppc/platforms/chestnut.h --- a/arch/ppc/platforms/chestnut.h Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/platforms/chestnut.h Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/chestnut.h - * * Definitions for IBM 750FXGX Eval (Chestnut) * * Author: diff -r 800442576617 arch/ppc/platforms/chrp_pegasos_eth.c --- a/arch/ppc/platforms/chrp_pegasos_eth.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/platforms/chrp_pegasos_eth.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/chrp_pegasos_eth.c - * * Copyright (C) 2005 Sven Luther * Thanks to : * Dale Farnsworth diff -r 800442576617 arch/ppc/platforms/chrp_setup.c --- a/arch/ppc/platforms/chrp_setup.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/platforms/chrp_setup.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/setup.c - * * Copyright (C) 1995 Linus Torvalds * Adapted from 'alpha' version by Gary Thomas * Modified by Cort Dougan (cort at cs.nmt.edu) diff -r 800442576617 arch/ppc/platforms/chrp_time.c --- a/arch/ppc/platforms/chrp_time.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/platforms/chrp_time.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/chrp_time.c - * * Copyright (C) 1991, 1992, 1995 Linus Torvalds * * Adapted for PowerPC (PReP) by Gary Thomas diff -r 800442576617 arch/ppc/platforms/cpci690.c --- a/arch/ppc/platforms/cpci690.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/platforms/cpci690.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/cpci690.c - * * Board setup routines for the Force CPCI690 board. * * Author: Mark A. Greer diff -r 800442576617 arch/ppc/platforms/cpci690.h --- a/arch/ppc/platforms/cpci690.h Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/platforms/cpci690.h Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/cpci690.h - * * Definitions for Force CPCI690 * * Author: Mark A. Greer diff -r 800442576617 arch/ppc/platforms/ev64260.c --- a/arch/ppc/platforms/ev64260.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/platforms/ev64260.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/ev64260.c - * * Board setup routines for the Marvell/Galileo EV-64260-BP Evaluation Board. * * Author: Mark A. Greer diff -r 800442576617 arch/ppc/platforms/ev64260.h --- a/arch/ppc/platforms/ev64260.h Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/platforms/ev64260.h Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/ev64260.h - * * Definitions for Marvell/Galileo EV-64260-BP Evaluation Board. * * Author: Mark A. Greer diff -r 800442576617 arch/ppc/platforms/ev64360.c --- a/arch/ppc/platforms/ev64360.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/platforms/ev64360.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/ev64360.c - * * Board setup routines for the Marvell EV-64360-BP Evaluation Board. * * Author: Lee Nicks diff -r 800442576617 arch/ppc/platforms/ev64360.h --- a/arch/ppc/platforms/ev64360.h Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/platforms/ev64360.h Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/ev64360.h - * * Definitions for Marvell EV-64360-BP Evaluation Board. * * Author: Lee Nicks diff -r 800442576617 arch/ppc/platforms/gemini.h --- a/arch/ppc/platforms/gemini.h Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/platforms/gemini.h Sat Jan 14 23:40:17 2006 @@ -1,7 +1,4 @@ /* - * arch/ppc/platforms/gemini.h - * - * * Onboard registers and descriptions for Synergy Microsystems' * "Gemini" boards. * diff -r 800442576617 arch/ppc/platforms/gemini_prom.S --- a/arch/ppc/platforms/gemini_prom.S Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/platforms/gemini_prom.S Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/gemini_prom.S - * * Not really prom support code (yet), but sort of anti-prom code. The current * bootloader does a number of things it shouldn't and doesn't do things that it * should. The stuff in here is mainly a hodge-podge collection of setup code diff -r 800442576617 arch/ppc/platforms/gemini_setup.c --- a/arch/ppc/platforms/gemini_setup.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/platforms/gemini_setup.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/gemini_setup.c - * * Copyright (C) 1995 Linus Torvalds * Adapted from 'alpha' version by Gary Thomas * Modified by Cort Dougan (cort at cs.nmt.edu) diff -r 800442576617 arch/ppc/platforms/hdpu.c --- a/arch/ppc/platforms/hdpu.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/platforms/hdpu.c Sat Jan 14 23:40:17 2006 @@ -1,7 +1,4 @@ - /* - * arch/ppc/platforms/hdpu_setup.c - * * Board setup routines for the Sky Computers HDPU Compute Blade. * * Written by Brian Waite diff -r 800442576617 arch/ppc/platforms/hdpu.h --- a/arch/ppc/platforms/hdpu.h Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/platforms/hdpu.h Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/hdpu.h - * * Definitions for Sky Computers HDPU board. * * Brian Waite diff -r 800442576617 arch/ppc/platforms/katana.c --- a/arch/ppc/platforms/katana.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/platforms/katana.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/katana.c - * * Board setup routines for the Artesyn Katana cPCI boards. * * Author: Tim Montgomery diff -r 800442576617 arch/ppc/platforms/katana.h --- a/arch/ppc/platforms/katana.h Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/platforms/katana.h Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/katana.h - * * Definitions for Artesyn Katana750i/3750 board. * * Author: Tim Montgomery diff -r 800442576617 arch/ppc/platforms/lite5200.c --- a/arch/ppc/platforms/lite5200.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/platforms/lite5200.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/lite5200.c - * * Platform support file for the Freescale LITE5200 based on MPC52xx. * A maximum of this file should be moved to syslib/mpc52xx_????? * so that new platform based on MPC52xx need a minimal platform file diff -r 800442576617 arch/ppc/platforms/lite5200.h --- a/arch/ppc/platforms/lite5200.h Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/platforms/lite5200.h Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/lite5200.h - * * Definitions for Freescale LITE5200 : MPC52xx Standard Development * Platform board support * diff -r 800442576617 arch/ppc/platforms/lopec.c --- a/arch/ppc/platforms/lopec.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/platforms/lopec.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/lopec.c - * * Setup routines for the Motorola LoPEC. * * Author: Dan Cox diff -r 800442576617 arch/ppc/platforms/mvme5100.c --- a/arch/ppc/platforms/mvme5100.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/platforms/mvme5100.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/mvme5100.c - * * Board setup routines for the Motorola MVME5100. * * Author: Matt Porter diff -r 800442576617 arch/ppc/platforms/pal4.h --- a/arch/ppc/platforms/pal4.h Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/platforms/pal4.h Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/pal4.h - * * Definitions for SBS Palomar IV board * * Author: Dan Cox diff -r 800442576617 arch/ppc/platforms/pal4_pci.c --- a/arch/ppc/platforms/pal4_pci.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/platforms/pal4_pci.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/pal4_pci.c - * * PCI support for SBS Palomar IV * * Author: Dan Cox diff -r 800442576617 arch/ppc/platforms/pal4_serial.h --- a/arch/ppc/platforms/pal4_serial.h Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/platforms/pal4_serial.h Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/pal4_serial.h - * * Definitions for SBS PalomarIV serial support * * Author: Dan Cox diff -r 800442576617 arch/ppc/platforms/pal4_setup.c --- a/arch/ppc/platforms/pal4_setup.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/platforms/pal4_setup.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/pal4_setup.c - * * Board setup routines for the SBS PalomarIV. * * Author: Dan Cox diff -r 800442576617 arch/ppc/platforms/pmac_cpufreq.c --- a/arch/ppc/platforms/pmac_cpufreq.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/platforms/pmac_cpufreq.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/pmac_cpufreq.c - * * Copyright (C) 2002 - 2005 Benjamin Herrenschmidt * Copyright (C) 2004 John Steele Scott * diff -r 800442576617 arch/ppc/platforms/pmac_feature.c --- a/arch/ppc/platforms/pmac_feature.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/platforms/pmac_feature.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/pmac_feature.c - * * Copyright (C) 1996-2001 Paul Mackerras (paulus at cs.anu.edu.au) * Ben. Herrenschmidt (benh at kernel.crashing.org) * diff -r 800442576617 arch/ppc/platforms/pmac_low_i2c.c --- a/arch/ppc/platforms/pmac_low_i2c.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/platforms/pmac_low_i2c.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/pmac_low_i2c.c - * * Copyright (C) 2003 Ben. Herrenschmidt (benh at kernel.crashing.org) * * This program is free software; you can redistribute it and/or diff -r 800442576617 arch/ppc/platforms/pmac_nvram.c --- a/arch/ppc/platforms/pmac_nvram.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/platforms/pmac_nvram.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/pmac_nvram.c - * * Copyright (C) 2002 Benjamin Herrenschmidt (benh at kernel.crashing.org) * * This program is free software; you can redistribute it and/or diff -r 800442576617 arch/ppc/platforms/pmac_setup.c --- a/arch/ppc/platforms/pmac_setup.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/platforms/pmac_setup.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/setup.c - * * PowerPC version * Copyright (C) 1995-1996 Gary Thomas (gdt at linuxppc.org) * diff -r 800442576617 arch/ppc/platforms/powerpmc250.c --- a/arch/ppc/platforms/powerpmc250.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/platforms/powerpmc250.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/powerpmc250.c - * * Board setup routines for Force PowerPMC-250 Processor PMC * * Author: Troy Benjegerdes diff -r 800442576617 arch/ppc/platforms/pplus.c --- a/arch/ppc/platforms/pplus.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/platforms/pplus.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/pplus.c - * * Board and PCI setup routines for MCG PowerPlus * * Author: Randy Vinson diff -r 800442576617 arch/ppc/platforms/pplus.h --- a/arch/ppc/platforms/pplus.h Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/platforms/pplus.h Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/pplus.h - * * Definitions for Motorola MCG Falcon/Raven & HAWK North Bridge & Memory ctlr. * * Author: Mark A. Greerinclude/asm-ppc/hawk.h diff -r 800442576617 arch/ppc/platforms/pq2ads.c --- a/arch/ppc/platforms/pq2ads.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/platforms/pq2ads.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/pq2ads.c - * * PQ2ADS platform support * * Author: Kumar Gala diff -r 800442576617 arch/ppc/platforms/prep_setup.c --- a/arch/ppc/platforms/prep_setup.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/platforms/prep_setup.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/setup.c - * * Copyright (C) 1995 Linus Torvalds * Adapted from 'alpha' version by Gary Thomas * Modified by Cort Dougan (cort at cs.nmt.edu) diff -r 800442576617 arch/ppc/platforms/prpmc750.c --- a/arch/ppc/platforms/prpmc750.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/platforms/prpmc750.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/prpmc750_setup.c - * * Board setup routines for Motorola PrPMC750 * * Author: Matt Porter diff -r 800442576617 arch/ppc/platforms/prpmc800.c --- a/arch/ppc/platforms/prpmc800.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/platforms/prpmc800.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/prpmc800.c - * * Author: Dale Farnsworth * * 2001-2004 (c) MontaVista, Software, Inc. This file is licensed under diff -r 800442576617 arch/ppc/platforms/radstone_ppc7d.c --- a/arch/ppc/platforms/radstone_ppc7d.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/platforms/radstone_ppc7d.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/radstone_ppc7d.c - * * Board setup routines for the Radstone PPC7D boards. * * Author: James Chapman diff -r 800442576617 arch/ppc/platforms/radstone_ppc7d.h --- a/arch/ppc/platforms/radstone_ppc7d.h Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/platforms/radstone_ppc7d.h Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/radstone_ppc7d.h - * * Board definitions for the Radstone PPC7D boards. * * Author: James Chapman diff -r 800442576617 arch/ppc/platforms/sandpoint.c --- a/arch/ppc/platforms/sandpoint.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/platforms/sandpoint.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/sandpoint_setup.c - * * Board setup routines for the Motorola SPS Sandpoint Test Platform. * * Author: Mark A. Greer diff -r 800442576617 arch/ppc/platforms/sandpoint.h --- a/arch/ppc/platforms/sandpoint.h Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/platforms/sandpoint.h Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/sandpoint.h - * * Definitions for Motorola SPS Sandpoint Test Platform * * Author: Mark A. Greer diff -r 800442576617 arch/ppc/platforms/sbc82xx.c --- a/arch/ppc/platforms/sbc82xx.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/platforms/sbc82xx.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/sbc82xx.c - * * SBC82XX platform support * * Author: Guy Streeter diff -r 800442576617 arch/ppc/platforms/spruce.c --- a/arch/ppc/platforms/spruce.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/platforms/spruce.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/spruce.c - * * Board and PCI setup routines for IBM Spruce * * Author: MontaVista Software diff -r 800442576617 arch/ppc/platforms/tqm8260_setup.c --- a/arch/ppc/platforms/tqm8260_setup.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/platforms/tqm8260_setup.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/tqm8260_setup.c - * * TQM8260 platform support * * Author: Allen Curtis diff -r 800442576617 arch/ppc/syslib/cpc700.h --- a/arch/ppc/syslib/cpc700.h Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/syslib/cpc700.h Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/syslib/cpc700.h - * * Header file for IBM CPC700 Host Bridge, et. al. * * Author: Mark A. Greer diff -r 800442576617 arch/ppc/syslib/cpc700_pic.c --- a/arch/ppc/syslib/cpc700_pic.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/syslib/cpc700_pic.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/syslib/cpc700_pic.c - * * Interrupt controller support for IBM Spruce * * Authors: Mark Greer, Matt Porter, and Johnnie Peters diff -r 800442576617 arch/ppc/syslib/cpc710.h --- a/arch/ppc/syslib/cpc710.h Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/syslib/cpc710.h Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/syslib/cpc710.h - * * Definitions for the IBM CPC710 PCI Host Bridge * * Author: Matt Porter diff -r 800442576617 arch/ppc/syslib/gen550.h --- a/arch/ppc/syslib/gen550.h Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/syslib/gen550.h Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/syslib/gen550.h - * * gen550 prototypes * * Matt Porter diff -r 800442576617 arch/ppc/syslib/gen550_dbg.c --- a/arch/ppc/syslib/gen550_dbg.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/syslib/gen550_dbg.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/syslib/gen550_dbg.c - * * A library of polled 16550 serial routines. These are intended to * be used to support progress messages, xmon, kgdb, etc. on a * variety of platforms. diff -r 800442576617 arch/ppc/syslib/gen550_kgdb.c --- a/arch/ppc/syslib/gen550_kgdb.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/syslib/gen550_kgdb.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/syslib/gen550_kgdb.c - * * Generic 16550 kgdb support intended to be useful on a variety * of platforms. To enable this support, it is necessary to set * the CONFIG_GEN550 option. Any virtual mapping of the serial diff -r 800442576617 arch/ppc/syslib/gt64260_pic.c --- a/arch/ppc/syslib/gt64260_pic.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/syslib/gt64260_pic.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/syslib/gt64260_pic.c - * * Interrupt controller support for Galileo's GT64260. * * Author: Chris Zankel diff -r 800442576617 arch/ppc/syslib/harrier.c --- a/arch/ppc/syslib/harrier.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/syslib/harrier.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/syslib/harrier.c - * * Motorola MCG Harrier northbridge/memory controller support * * Author: Dale Farnsworth diff -r 800442576617 arch/ppc/syslib/hawk_common.c --- a/arch/ppc/syslib/hawk_common.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/syslib/hawk_common.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/syslib/hawk_common.c - * * Common Motorola PowerPlus Platform--really Falcon/Raven or HAWK. * * Author: Mark A. Greer diff -r 800442576617 arch/ppc/syslib/ibm440gp_common.c --- a/arch/ppc/syslib/ibm440gp_common.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/syslib/ibm440gp_common.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/syslib/ibm440gp_common.c - * * PPC440GP system library * * Matt Porter diff -r 800442576617 arch/ppc/syslib/ibm440gp_common.h --- a/arch/ppc/syslib/ibm440gp_common.h Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/syslib/ibm440gp_common.h Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/kernel/ibm440gp_common.h - * * PPC440GP system library * * Eugene Surovegin or diff -r 800442576617 arch/ppc/syslib/ibm440gx_common.c --- a/arch/ppc/syslib/ibm440gx_common.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/syslib/ibm440gx_common.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/kernel/ibm440gx_common.c - * * PPC440GX system library * * Eugene Surovegin or diff -r 800442576617 arch/ppc/syslib/ibm440gx_common.h --- a/arch/ppc/syslib/ibm440gx_common.h Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/syslib/ibm440gx_common.h Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/kernel/ibm440gx_common.h - * * PPC440GX system library * * Eugene Surovegin or diff -r 800442576617 arch/ppc/syslib/ibm440sp_common.c --- a/arch/ppc/syslib/ibm440sp_common.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/syslib/ibm440sp_common.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/syslib/ibm440sp_common.c - * * PPC440SP/PPC440SPe system library * * Matt Porter diff -r 800442576617 arch/ppc/syslib/ibm440sp_common.h --- a/arch/ppc/syslib/ibm440sp_common.h Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/syslib/ibm440sp_common.h Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/syslib/ibm440sp_common.h - * * PPC440SP system library * * Matt Porter diff -r 800442576617 arch/ppc/syslib/ibm44x_common.c --- a/arch/ppc/syslib/ibm44x_common.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/syslib/ibm44x_common.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/syslib/ibm44x_common.c - * * PPC44x system library * * Matt Porter diff -r 800442576617 arch/ppc/syslib/ibm44x_common.h --- a/arch/ppc/syslib/ibm44x_common.h Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/syslib/ibm44x_common.h Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/kernel/ibm44x_common.h - * * PPC44x system library * * Eugene Surovegin or diff -r 800442576617 arch/ppc/syslib/m8260_pci_erratum9.c --- a/arch/ppc/syslib/m8260_pci_erratum9.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/syslib/m8260_pci_erratum9.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/mpc8260_pci9.c - * * Workaround for device erratum PCI 9. * See Motorola's "XPC826xA Family Device Errata Reference." * The erratum applies to all 8260 family Hip4 processors. It is scheduled diff -r 800442576617 arch/ppc/syslib/m8260_setup.c --- a/arch/ppc/syslib/m8260_setup.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/syslib/m8260_setup.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/syslib/m8260_setup.c - * * Copyright (C) 1995 Linus Torvalds * Adapted from 'alpha' version by Gary Thomas * Modified by Cort Dougan (cort at cs.nmt.edu) diff -r 800442576617 arch/ppc/syslib/m8xx_setup.c --- a/arch/ppc/syslib/m8xx_setup.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/syslib/m8xx_setup.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/kernel/setup.c - * * Copyright (C) 1995 Linus Torvalds * Adapted from 'alpha' version by Gary Thomas * Modified by Cort Dougan (cort at cs.nmt.edu) diff -r 800442576617 arch/ppc/syslib/mpc10x_common.c --- a/arch/ppc/syslib/mpc10x_common.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/syslib/mpc10x_common.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/syslib/mpc10x_common.c - * * Common routines for the Motorola SPS MPC106, MPC107 and MPC8240 Host bridge, * Mem ctlr, EPIC, etc. * diff -r 800442576617 arch/ppc/syslib/mpc52xx_devices.c --- a/arch/ppc/syslib/mpc52xx_devices.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/syslib/mpc52xx_devices.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/syslib/mpc52xx_devices.c - * * Freescale MPC52xx device descriptions * * diff -r 800442576617 arch/ppc/syslib/mpc52xx_pci.c --- a/arch/ppc/syslib/mpc52xx_pci.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/syslib/mpc52xx_pci.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/syslib/mpc52xx_pci.c - * * PCI code for the Freescale MPC52xx embedded CPU. * * diff -r 800442576617 arch/ppc/syslib/mpc52xx_pci.h --- a/arch/ppc/syslib/mpc52xx_pci.h Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/syslib/mpc52xx_pci.h Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/syslib/mpc52xx_pci.h - * * PCI Include file the Freescale MPC52xx embedded cpu chips * * diff -r 800442576617 arch/ppc/syslib/mpc52xx_pic.c --- a/arch/ppc/syslib/mpc52xx_pic.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/syslib/mpc52xx_pic.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/syslib/mpc52xx_pic.c - * * Programmable Interrupt Controller functions for the Freescale MPC52xx * embedded CPU. * diff -r 800442576617 arch/ppc/syslib/mpc52xx_setup.c --- a/arch/ppc/syslib/mpc52xx_setup.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/syslib/mpc52xx_setup.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/syslib/mpc52xx_setup.c - * * Common code for the boards based on Freescale MPC52xx embedded CPU. * * diff -r 800442576617 arch/ppc/syslib/mpc52xx_sys.c --- a/arch/ppc/syslib/mpc52xx_sys.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/syslib/mpc52xx_sys.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/syslib/mpc52xx_sys.c - * * Freescale MPC52xx system descriptions * * diff -r 800442576617 arch/ppc/syslib/mpc83xx_devices.c --- a/arch/ppc/syslib/mpc83xx_devices.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/syslib/mpc83xx_devices.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/83xx/mpc83xx_devices.c - * * MPC83xx Device descriptions * * Maintainer: Kumar Gala diff -r 800442576617 arch/ppc/syslib/mpc83xx_sys.c --- a/arch/ppc/syslib/mpc83xx_sys.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/syslib/mpc83xx_sys.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/83xx/mpc83xx_sys.c - * * MPC83xx System descriptions * * Maintainer: Kumar Gala diff -r 800442576617 arch/ppc/syslib/mpc85xx_devices.c --- a/arch/ppc/syslib/mpc85xx_devices.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/syslib/mpc85xx_devices.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/85xx/mpc85xx_devices.c - * * MPC85xx Device descriptions * * Maintainer: Kumar Gala diff -r 800442576617 arch/ppc/syslib/mpc85xx_sys.c --- a/arch/ppc/syslib/mpc85xx_sys.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/syslib/mpc85xx_sys.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/85xx/mpc85xx_sys.c - * * MPC85xx System descriptions * * Maintainer: Kumar Gala diff -r 800442576617 arch/ppc/syslib/mpc8xx_devices.c --- a/arch/ppc/syslib/mpc8xx_devices.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/syslib/mpc8xx_devices.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/syslib/mpc8xx_devices.c - * * MPC8xx Device descriptions * * Maintainer: Kumar Gala diff -r 800442576617 arch/ppc/syslib/mpc8xx_sys.c --- a/arch/ppc/syslib/mpc8xx_sys.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/syslib/mpc8xx_sys.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/mpc8xx_sys.c - * * MPC8xx System descriptions * * Maintainer: Kumar Gala diff -r 800442576617 arch/ppc/syslib/mv64360_pic.c --- a/arch/ppc/syslib/mv64360_pic.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/syslib/mv64360_pic.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/kernel/mv64360_pic.c - * * Interrupt controller support for Marvell's MV64360. * * Author: Rabeeh Khoury diff -r 800442576617 arch/ppc/syslib/mv64x60.c --- a/arch/ppc/syslib/mv64x60.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/syslib/mv64x60.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/syslib/mv64x60.c - * * Common routines for the Marvell/Galileo Discovery line of host bridges * (gt64260, mv64360, mv64460, ...). * diff -r 800442576617 arch/ppc/syslib/mv64x60_dbg.c --- a/arch/ppc/syslib/mv64x60_dbg.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/syslib/mv64x60_dbg.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/syslib/mv64x60_dbg.c - * * KGDB and progress routines for the Marvell/Galileo MV64x60 (Discovery). * * Author: Mark A. Greer diff -r 800442576617 arch/ppc/syslib/mv64x60_win.c --- a/arch/ppc/syslib/mv64x60_win.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/syslib/mv64x60_win.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/syslib/mv64x60_win.c - * * Tables with info on how to manipulate the 32 & 64 bit windows on the * various types of Marvell bridge chips. * diff -r 800442576617 arch/ppc/syslib/open_pic.c --- a/arch/ppc/syslib/open_pic.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/syslib/open_pic.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/kernel/open_pic.c -- OpenPIC Interrupt Handling - * * Copyright (C) 1997 Geert Uytterhoeven * * This file is subject to the terms and conditions of the GNU General Public diff -r 800442576617 arch/ppc/syslib/open_pic2.c --- a/arch/ppc/syslib/open_pic2.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/syslib/open_pic2.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/kernel/open_pic.c -- OpenPIC Interrupt Handling - * * Copyright (C) 1997 Geert Uytterhoeven * * This file is subject to the terms and conditions of the GNU General Public diff -r 800442576617 arch/ppc/syslib/open_pic_defs.h --- a/arch/ppc/syslib/open_pic_defs.h Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/syslib/open_pic_defs.h Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/kernel/open_pic_defs.h -- OpenPIC definitions - * * Copyright (C) 1997 Geert Uytterhoeven * * This file is based on the following documentation: diff -r 800442576617 arch/ppc/syslib/pci_auto.c --- a/arch/ppc/syslib/pci_auto.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/syslib/pci_auto.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/syslib/pci_auto.c - * * PCI autoconfiguration library * * Author: Matt Porter diff -r 800442576617 arch/ppc/syslib/ppc4xx_dma.c --- a/arch/ppc/syslib/ppc4xx_dma.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/syslib/ppc4xx_dma.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/kernel/ppc4xx_dma.c - * * IBM PPC4xx DMA engine core library * * Copyright 2000-2004 MontaVista Software Inc. diff -r 800442576617 arch/ppc/syslib/ppc4xx_pic.c --- a/arch/ppc/syslib/ppc4xx_pic.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/syslib/ppc4xx_pic.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/syslib/ppc4xx_pic.c - * * Interrupt controller driver for PowerPC 4xx-based processors. * * Eugene Surovegin or diff -r 800442576617 arch/ppc/syslib/ppc4xx_sgdma.c --- a/arch/ppc/syslib/ppc4xx_sgdma.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/syslib/ppc4xx_sgdma.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/kernel/ppc4xx_sgdma.c - * * IBM PPC4xx DMA engine scatter/gather library * * Copyright 2002-2003 MontaVista Software Inc. diff -r 800442576617 arch/ppc/syslib/ppc83xx_setup.c --- a/arch/ppc/syslib/ppc83xx_setup.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/syslib/ppc83xx_setup.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/syslib/ppc83xx_setup.c - * * MPC83XX common board code * * Maintainer: Kumar Gala diff -r 800442576617 arch/ppc/syslib/ppc83xx_setup.h --- a/arch/ppc/syslib/ppc83xx_setup.h Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/syslib/ppc83xx_setup.h Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/syslib/ppc83xx_setup.h - * * MPC83XX common board definitions * * Maintainer: Kumar Gala diff -r 800442576617 arch/ppc/syslib/ppc85xx_common.c --- a/arch/ppc/syslib/ppc85xx_common.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/syslib/ppc85xx_common.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/syslib/ppc85xx_common.c - * * MPC85xx support routines * * Maintainer: Kumar Gala diff -r 800442576617 arch/ppc/syslib/ppc85xx_common.h --- a/arch/ppc/syslib/ppc85xx_common.h Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/syslib/ppc85xx_common.h Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/syslib/ppc85xx_common.h - * * MPC85xx support routines * * Maintainer: Kumar Gala diff -r 800442576617 arch/ppc/syslib/ppc85xx_setup.c --- a/arch/ppc/syslib/ppc85xx_setup.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/syslib/ppc85xx_setup.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/syslib/ppc85xx_setup.c - * * MPC85XX common board code * * Maintainer: Kumar Gala diff -r 800442576617 arch/ppc/syslib/ppc85xx_setup.h --- a/arch/ppc/syslib/ppc85xx_setup.h Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/syslib/ppc85xx_setup.h Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/syslib/ppc85xx_setup.h - * * MPC85XX common board definitions * * Maintainer: Kumar Gala diff -r 800442576617 arch/ppc/syslib/ppc_sys.c --- a/arch/ppc/syslib/ppc_sys.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/syslib/ppc_sys.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/syslib/ppc_sys.c - * * PPC System library functions * * Maintainer: Kumar Gala diff -r 800442576617 arch/ppc/syslib/pq2_devices.c --- a/arch/ppc/syslib/pq2_devices.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/syslib/pq2_devices.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/syslib/pq2_devices.c - * * PQ2 Device descriptions * * Maintainer: Kumar Gala diff -r 800442576617 arch/ppc/syslib/pq2_sys.c --- a/arch/ppc/syslib/pq2_sys.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/syslib/pq2_sys.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/syslib/pq2_devices.c - * * PQ2 System descriptions * * Maintainer: Kumar Gala diff -r 800442576617 arch/ppc/syslib/prep_nvram.c --- a/arch/ppc/syslib/prep_nvram.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/syslib/prep_nvram.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/kernel/prep_nvram.c - * * Copyright (C) 1998 Corey Minyard * * This reads the NvRAM on PReP compliant machines (generally from IBM or diff -r 800442576617 arch/ppc/syslib/todc_time.c --- a/arch/ppc/syslib/todc_time.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/syslib/todc_time.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/syslib/todc_time.c - * * Time of Day Clock support for the M48T35, M48T37, M48T59, and MC146818 * Real Time Clocks/Timekeepers. * diff -r 800442576617 arch/ppc/syslib/xilinx_pic.c --- a/arch/ppc/syslib/xilinx_pic.c Sat Jan 14 05:24:55 2006 +++ b/arch/ppc/syslib/xilinx_pic.c Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/syslib/xilinx_pic.c - * * Interrupt controller driver for Xilinx Virtex-II Pro. * * Author: MontaVista Software, Inc. diff -r 800442576617 drivers/char/hvcs.c --- a/drivers/char/hvcs.c Sat Jan 14 05:24:55 2006 +++ b/drivers/char/hvcs.c Sat Jan 14 23:40:17 2006 @@ -118,7 +118,7 @@ * the hvcs_final_close() function in order to get it out of the spinlock. * Rearranged hvcs_close(). Cleaned up some printks and did some housekeeping * on the changelog. Removed local CLC_LENGTH and used HVCS_CLC_LENGTH from - * arch/ppc64/hvcserver.h. + * include/asm-powerpc/hvcserver.h * * 1.3.2 -> 1.3.3 Replaced yield() in hvcs_close() with tty_wait_until_sent() to * prevent possible lockup with realtime scheduling as similarily pointed out by @@ -168,9 +168,10 @@ /* * The hcall interface involves putting 8 chars into each of two registers. - * We load up those 2 registers (in arch/ppc64/hvconsole.c) by casting char[16] - * to long[2]. It would work without __ALIGNED__, but a little (tiny) bit - * slower because an unaligned load is slower than aligned load. + * We load up those 2 registers (in arch/powerpc/platforms/pseries/hvconsole.c) + * by casting char[16] to long[2]. It would work without __ALIGNED__, but a + * little (tiny) bit slower because an unaligned load is slower than aligned + * load. */ #define __ALIGNED__ __attribute__((__aligned__(8))) diff -r 800442576617 include/asm-powerpc/paca.h --- a/include/asm-powerpc/paca.h Sat Jan 14 05:24:55 2006 +++ b/include/asm-powerpc/paca.h Sat Jan 14 23:40:17 2006 @@ -54,7 +54,7 @@ #endif /* CONFIG_PPC_ISERIES */ /* - * MAGIC: the spinlock functions in arch/ppc64/lib/locks.c + * MAGIC: the spinlock functions in arch/powerpc/lib/locks.c * load lock_token and paca_index with a single lwz * instruction. They must travel together and be properly * aligned. diff -r 800442576617 include/asm-powerpc/rwsem.h --- a/include/asm-powerpc/rwsem.h Sat Jan 14 05:24:55 2006 +++ b/include/asm-powerpc/rwsem.h Sat Jan 14 23:40:17 2006 @@ -4,7 +4,7 @@ #ifdef __KERNEL__ /* - * include/asm-ppc64/rwsem.h: R/W semaphores for PPC using the stuff + * include/asm-powerpc/rwsem.h: R/W semaphores for PPC using the stuff * in lib/rwsem.c. Adapted largely from include/asm-i386/rwsem.h * by Paul Mackerras . */ diff -r 800442576617 include/asm-ppc/harrier.h --- a/include/asm-ppc/harrier.h Sat Jan 14 05:24:55 2006 +++ b/include/asm-ppc/harrier.h Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/kernel/harrier.h - * * Definitions for Motorola MCG Harrier North Bridge & Memory controller * * Author: Dale Farnsworth diff -r 800442576617 include/asm-ppc/mpc10x.h --- a/include/asm-ppc/mpc10x.h Sat Jan 14 05:24:55 2006 +++ b/include/asm-ppc/mpc10x.h Sat Jan 14 23:40:17 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/kernel/mpc10x.h - * * Common routines for the Motorola SPS MPC106/8240/107 Host bridge/Mem * ctlr/EPIC/etc. * diff -r 800442576617 kernel/auditsc.c --- a/kernel/auditsc.c Sat Jan 14 05:24:55 2006 +++ b/kernel/auditsc.c Sat Jan 14 23:40:17 2006 @@ -958,7 +958,7 @@ * * i386 no * x86_64 no - * ppc64 yes (see arch/ppc64/kernel/misc.S) + * ppc64 yes (see arch/powerpc/platforms/iseries/misc.S) * * This also happens with vm86 emulation in a non-nested manner * (entries without exits), so this case must be caught. diff -r 800442576617 lib/extable.c --- a/lib/extable.c Sat Jan 14 05:24:55 2006 +++ b/lib/extable.c Sat Jan 14 23:40:17 2006 @@ -1,5 +1,4 @@ /* - * lib/extable.c * Derived from arch/ppc/mm/extable.c and arch/i386/mm/extable.c. * * Copyright (C) 2004 Paul Mackerras, IBM Corp. _______________________________________________ Linuxppc64-dev mailing list Linuxppc64-dev at ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc64-dev From sleddog at us.ibm.com Tue Jan 17 08:52:52 2006 From: sleddog at us.ibm.com (Dave C Boutcher) Date: Mon, 16 Jan 2006 15:52:52 -0600 Subject: 2.6.15-mm4 failure on power5 In-Reply-To: <20060116153748.GA25866@sergelap.austin.ibm.com> References: <20060116063530.GB23399@sergelap.austin.ibm.com> <20060115230557.0f07a55c.akpm@osdl.org> <200601170000.58134.michael@ellerman.id.au> <20060116153748.GA25866@sergelap.austin.ibm.com> Message-ID: <20060116215252.GA10538@cs.umn.edu> On Mon, Jan 16, 2006 at 09:37:48AM -0600, Serge E. Hallyn wrote: > Quoting Michael Ellerman (michael at ellerman.id.au): > > On Mon, 16 Jan 2006 18:05, Andrew Morton wrote: > > > "Serge E. Hallyn" wrote: > > > > On my power5 partition, 2.6.15-mm4 hangs on boot > > boot: quicktest > Please wait, loading kernel... ... > Page orders: linear mapping = 24, others = 12 > -> smp_release_cpus() > <- smp_release_cpus() > <- setup_system() > > So setup_system() at least finishes, though I don't see the > printk's at the bottom of that function. 2.6.15-mm4 won't boot on my power5 either. I tracked it down to the following mutex patch from Ingo: kernel-kernel-cpuc-to-mutexes.patch If I revert just that patch, mm4 boots fine. Its really not obvious to me at all why that patch is breaking things though... -- Dave Boutcher From sfr at canb.auug.org.au Tue Jan 17 09:16:30 2006 From: sfr at canb.auug.org.au (Stephen Rothwell) Date: Tue, 17 Jan 2006 09:16:30 +1100 Subject: [PATCH] trivial: modify comments to refer to new location of files In-Reply-To: <20060115060716.GA2157@us.ibm.com> References: <20060112180240.GB17539@us.ibm.com> <20060113114401.3289f33f.sfr@canb.auug.org.au> <20060115060716.GA2157@us.ibm.com> Message-ID: <20060117091630.1bf9e03c.sfr@canb.auug.org.au> On Sun, 15 Jan 2006 00:07:20 -0600 Jon Mason wrote: > > On Fri, Jan 13, 2006 at 11:44:01AM +1100, Stephen Rothwell wrote: > > Can we just remove these useless self references, please? > > Is this more towards your liking? > > Signed-off-by: Jon Mason Acked-by: Stephen Rothwell (At least the removal of the self reference comments) -- Cheers, Stephen Rothwell sfr at canb.auug.org.au http://www.canb.auug.org.au/~sfr/ -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: not available Url : http://ozlabs.org/pipermail/linuxppc64-dev/attachments/20060117/ebb837ea/attachment.pgp From johnrose at austin.ibm.com Tue Jan 17 09:38:08 2006 From: johnrose at austin.ibm.com (John Rose) Date: Mon, 16 Jan 2006 16:38:08 -0600 Subject: [PATCH 2/9] powerpc/PCI hotplug: remove rpaphp_fixup_new_pci_devices() In-Reply-To: <20060113002026.GZ26221@austin.ibm.com> References: <20060113001556.GX26221@austin.ibm.com> <20060113002026.GZ26221@austin.ibm.com> Message-ID: <1137451088.809.20.camel@sinatra.austin.ibm.com> The function rpaphp_fixup_new_pci_devices() has been migrated to pcibios_fixup_new_pci_devices() in arch/powerpc/platforms/pseries/pci_dlpar.c This patch removes the old version. Signed-off-by: Linas Vepstas Acked-by: John Rose From johnrose at austin.ibm.com Tue Jan 17 09:45:43 2006 From: johnrose at austin.ibm.com (John Rose) Date: Mon, 16 Jan 2006 16:45:43 -0600 Subject: [PATCH 3/9] powerpc/PCI hotplug: merge config_pci_adapter In-Reply-To: <20060113002206.GA26221@austin.ibm.com> References: <20060113001556.GX26221@austin.ibm.com> <20060113002206.GA26221@austin.ibm.com> Message-ID: <1137451543.809.22.camel@sinatra.austin.ibm.com> Remove general baroqueness. The function rpaphp_config_pci_adapter() is really just one line of code, once all the dbg printks are removed. And its called in only one place. So replace the call by the one line. Signed-off-by: Linas Vepstas Acked-by: John Rose From johnrose at austin.ibm.com Tue Jan 17 09:47:23 2006 From: johnrose at austin.ibm.com (John Rose) Date: Mon, 16 Jan 2006 16:47:23 -0600 Subject: [PATCH 4/9] powerpc/PCI hotplug: remove remove_bus_device() In-Reply-To: <20060113002427.GB26221@austin.ibm.com> References: <20060113001556.GX26221@austin.ibm.com> <20060113002427.GB26221@austin.ibm.com> Message-ID: <1137451643.809.24.camel@sinatra.austin.ibm.com> The function rpaphp_eeh_remove_bus_device() is a dupe of eeh_remove_bus_device(). Remove it. Signed-off-by: Linas Vepstas Acked-by: John Rose From johnrose at austin.ibm.com Tue Jan 17 09:48:57 2006 From: johnrose at austin.ibm.com (John Rose) Date: Mon, 16 Jan 2006 16:48:57 -0600 Subject: [PATCH 5/9] powerpc/PCI hotplug: de-convolute rpaphp_unconfig_pci_adap In-Reply-To: <20060113002627.GC26221@austin.ibm.com> References: <20060113001556.GX26221@austin.ibm.com> <20060113002627.GC26221@austin.ibm.com> Message-ID: <1137451737.809.26.camel@sinatra.austin.ibm.com> The function rpaphp_eeh_remove_bus_device() is a dupe of eeh_remove_bus_device(). Remove it. Signed-off-by: Linas Vepstas Acked-by: John Rose From johnrose at austin.ibm.com Tue Jan 17 09:54:25 2006 From: johnrose at austin.ibm.com (John Rose) Date: Mon, 16 Jan 2006 16:54:25 -0600 Subject: [PATCH 6/9] powerpc/PCI hotplug: merge rpaphp_enable_pci_slot() In-Reply-To: <20060113002822.GD26221@austin.ibm.com> References: <20060113001556.GX26221@austin.ibm.com> <20060113002822.GD26221@austin.ibm.com> Message-ID: <1137452065.809.28.camel@sinatra.austin.ibm.com> Remove general baroqueness. The function rpaphp_enable_pci_slot() has a fairly simple logic structure, once all of the debug printk's are removed. Its called from only one place, and that place also has a very simple structure once he printk's are removed. Merge the two together. Signed-off-by: Linas Vepstas Acked-by: John Rose From johnrose at austin.ibm.com Tue Jan 17 09:55:52 2006 From: johnrose at austin.ibm.com (John Rose) Date: Mon, 16 Jan 2006 16:55:52 -0600 Subject: [PATCH 7/9] powerpc/PCI hotplug: cleanup: add prefix In-Reply-To: <20060113003101.GE26221@austin.ibm.com> References: <20060113001556.GX26221@austin.ibm.com> <20060113003101.GE26221@austin.ibm.com> Message-ID: <1137452152.809.30.camel@sinatra.austin.ibm.com> Minor cleanup. Add the prefix rpaphp_* to several generic-sounding routines. Remove rpaphp_remove_slot(), which is a one-liner. Signed-off-by: Linas Vepstas Acked-by: John Rose From johnrose at austin.ibm.com Tue Jan 17 10:04:15 2006 From: johnrose at austin.ibm.com (John Rose) Date: Mon, 16 Jan 2006 17:04:15 -0600 Subject: [PATCH 7/9] powerpc/PCI hotplug: cleanup: add prefix In-Reply-To: <20060113003101.GE26221@austin.ibm.com> References: <20060113001556.GX26221@austin.ibm.com> <20060113003101.GE26221@austin.ibm.com> Message-ID: <1137452655.809.34.camel@sinatra.austin.ibm.com> On Thu, 2006-01-12 at 18:31, linas wrote: > Minor cleanup. Add the prefix rpaphp_* to several generic-sounding routines. > Remove rpaphp_remove_slot(), which is a one-liner. > > Signed-off-by: Linas Vepstas Acked-by: John Rose From johnrose at austin.ibm.com Tue Jan 17 10:04:35 2006 From: johnrose at austin.ibm.com (John Rose) Date: Mon, 16 Jan 2006 17:04:35 -0600 Subject: [PATCH 8/9] powerpc/PCI hotplug: minor cleanup forward decls In-Reply-To: <20060113003258.GF26221@austin.ibm.com> References: <20060113001556.GX26221@austin.ibm.com> <20060113003258.GF26221@austin.ibm.com> Message-ID: <1137452675.809.36.camel@sinatra.austin.ibm.com> On Thu, 2006-01-12 at 18:32, linas wrote: > Minor cleanup. Move structure initializer to bottom of file, > this allows elimination of eyeball-strain-inducing forward > declarations. > > Signed-off-by: Linas Vepstas Acked-by: John Rose From johnrose at austin.ibm.com Tue Jan 17 10:05:28 2006 From: johnrose at austin.ibm.com (John Rose) Date: Mon, 16 Jan 2006 17:05:28 -0600 Subject: [PATCH 9/9] powerpc/PCI hotplug: shuffle error checking to better location. In-Reply-To: <20060113003523.GG26221@austin.ibm.com> References: <20060113001556.GX26221@austin.ibm.com> <20060113003523.GG26221@austin.ibm.com> Message-ID: <1137452728.809.38.camel@sinatra.austin.ibm.com> On Thu, 2006-01-12 at 18:35, linas wrote: > Error checking is scattered through various layers of the dlpar code, > leading to a somewhat opaque code structure. This patch consolidates > error checking in one routine, simplifying the code a tad. There's > also some whitespace cleanup here too. > > Signed-off-by: Linas Vepstas Acked-by: John Rose From will_schmidt at vnet.ibm.com Tue Jan 17 10:35:40 2006 From: will_schmidt at vnet.ibm.com (will schmidt) Date: Mon, 16 Jan 2006 17:35:40 -0600 Subject: 2.6.15 failure on power4 iSeries Message-ID: <43CC2DCC.6010201@vnet.ibm.com> attempting to boot current kernels on a power4 iSeries doesnt work. have tried both the powerpc-git tree and the torvalds-git tree. OS/400 RefCode is "C200 82FF". (which means nothing to me :-) no console output at all. did a bunch of git bisects in the torvalds tree to try and narrow this down. came up with this: ----- cc5d0189b9ba95260857a5018a1c2fef90008507 is first bad commit diff-tree cc5d0189b9ba95260857a5018a1c2fef90008507 (from 9cf84d7c97992dbe5360b241327341c07ce30fc9) Author: Benjamin Herrenschmidt Date: Tue Dec 13 18:01:21 2005 +1100 [PATCH] powerpc: Remove device_node addrs/n_addr The pre-parsed addrs/n_addrs fields in struct device_node are finally gone. Remove the dodgy heuristics that did that parsing at boot and remove the fields themselves since we now have a good replacement with the new OF parsing code. This patch also fixes a bunch of drivers to use the new code instead, so that at least pmac32, pseries, iseries and g5 defconfigs build. Signed-off-by: Benjamin Herrenschmidt Signed-off-by: Paul Mackerras :040000 040000 9946b49ba087766d624c0e3aec0aacf10def46d5 c3ace2665f7af6cecedb4af1e91e8f7a297c1810 M arch :040000 040000 50d697c7cd7d7fe83708da8d984552156220eb6b b1c4acfc8a51b0ddd033b94b77c8f1c13cac3a7b M drivers :040000 040000 c147e5b58c5e209cfa1e0e23fde1e8dfeebc74cb 74f710b4ce19a09b2d1ec786e623c7b533b6e099 M include :040000 040000 069d365401f8661df52ffbdc4efad2c760199228 becfd9ac59e0c409a860f75620619640f41a5c5a M sound ---- I dont see any obvious iSeries reference in this patch, but have only given it a brief look. Any suggestions on how to track this down further? -Will From sleddog at us.ibm.com Tue Jan 17 10:50:26 2006 From: sleddog at us.ibm.com (Dave C Boutcher) Date: Mon, 16 Jan 2006 17:50:26 -0600 Subject: 2.6.15 failure on power4 iSeries In-Reply-To: <43CC2DCC.6010201@vnet.ibm.com> References: <43CC2DCC.6010201@vnet.ibm.com> Message-ID: <20060116235026.GA12938@cs.umn.edu> On Mon, Jan 16, 2006 at 05:35:40PM -0600, will schmidt wrote: > > attempting to boot current kernels on a power4 iSeries doesnt work. have tried both the powerpc-git tree and the torvalds-git tree. > > OS/400 RefCode is "C200 82FF". (which means nothing to me :-) > > no console output at all.S Grab me tomorrow and I can dig through the cobwebs. I vaguely recall that there is additional information beyond that refcode you can retrieve. I also very vaguely recall that C200 82FF means that the firmware doesn't like the kernel binary. -- Dave Boutcher From michael at ellerman.id.au Tue Jan 17 11:22:09 2006 From: michael at ellerman.id.au (Michael Ellerman) Date: Tue, 17 Jan 2006 11:22:09 +1100 Subject: 2.6.15 failure on power4 iSeries In-Reply-To: <43CC2DCC.6010201@vnet.ibm.com> References: <43CC2DCC.6010201@vnet.ibm.com> Message-ID: <200601171122.14283.michael@ellerman.id.au> On Tue, 17 Jan 2006 10:35, will schmidt wrote: > attempting to boot current kernels on a power4 iSeries doesnt work. have > tried both the powerpc-git tree and the torvalds-git tree. > > OS/400 RefCode is "C200 82FF". (which means nothing to me :-) C20082FF VSP IPL complete successfully > no console output at all. Enable early debugging for iSeries (now via Kconfig, under Kernel hacking), then enable DEBUG in platforms/iseries/* and kernel/setup_64.c, then when it dies hit "ctrl-x ctrl-x" and see if you get any output. > did a bunch of git bisects in the torvalds tree to try and narrow this > down. came up with this: > ----- > cc5d0189b9ba95260857a5018a1c2fef90008507 is first bad commit > diff-tree cc5d0189b9ba95260857a5018a1c2fef90008507 (from > 9cf84d7c97992dbe5360b241327341c07ce30fc9) Author: Benjamin Herrenschmidt > > Date: Tue Dec 13 18:01:21 2005 +1100 > > [PATCH] powerpc: Remove device_node addrs/n_addr Hmm, that doesn't touch iSeries code at all - but anything's possible I guess. cheers -- Michael Ellerman IBM OzLabs email: michael:ellerman.id.au inmsg: mpe:jabber.org wwweb: http://michael.ellerman.id.au phone: +61 2 6212 1183 (tie line 70 21183) We do not inherit the earth from our ancestors, we borrow it from our children. - S.M.A.R.T Person -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: not available Url : http://ozlabs.org/pipermail/linuxppc64-dev/attachments/20060117/db26d84b/attachment.pgp From akpm at osdl.org Tue Jan 17 12:09:07 2006 From: akpm at osdl.org (Andrew Morton) Date: Mon, 16 Jan 2006 17:09:07 -0800 Subject: 2.6.15-mm4 failure on power5 In-Reply-To: <20060116215252.GA10538@cs.umn.edu> References: <20060116063530.GB23399@sergelap.austin.ibm.com> <20060115230557.0f07a55c.akpm@osdl.org> <200601170000.58134.michael@ellerman.id.au> <20060116153748.GA25866@sergelap.austin.ibm.com> <20060116215252.GA10538@cs.umn.edu> Message-ID: <20060116170907.60149236.akpm@osdl.org> Dave C Boutcher wrote: > > On Mon, Jan 16, 2006 at 09:37:48AM -0600, Serge E. Hallyn wrote: > > Quoting Michael Ellerman (michael at ellerman.id.au): > > > On Mon, 16 Jan 2006 18:05, Andrew Morton wrote: > > > > "Serge E. Hallyn" wrote: > > > > > On my power5 partition, 2.6.15-mm4 hangs on boot > > > > boot: quicktest > > Please wait, loading kernel... > > ... > > > Page orders: linear mapping = 24, others = 12 > > -> smp_release_cpus() > > <- smp_release_cpus() > > <- setup_system() > > > > So setup_system() at least finishes, though I don't see the > > printk's at the bottom of that function. > > 2.6.15-mm4 won't boot on my power5 either. I tracked it down to the > following mutex patch from Ingo: kernel-kernel-cpuc-to-mutexes.patch Thanks for doing that - I know it's a lot of work, but boy it helps. > If I revert just that patch, mm4 boots fine. Its really not obvious to > me at all why that patch is breaking things though... > Yes, that is strange. I do recall that if something accidentally enables interrupts too early in boot, ppc64 machines tend to go comatose. But if we'd been running that code under local_irq_disable(), down() would have spat a warning. Drat, it seems I don't have CPU hotplug in my ppc64 config. From michael at ellerman.id.au Tue Jan 17 14:22:01 2006 From: michael at ellerman.id.au (Michael Ellerman) Date: Tue, 17 Jan 2006 14:22:01 +1100 Subject: [RFC/PATCH 0/12] powerpc: Convert from #ifdef ISERIES to FW_FEATURE_ISERIES Message-ID: <1137468121.172522.474053389273.qpush@concordia> This is a series of patches which take us one small step closer to the mythical combined kernel (iSeries + pSeries etc.) I'm just posting these for people's perusal at the moment. Booted on iSeries & pSeries LPAR. And with a Kconfig hack, I can at least build a combined kernel, but obviously it doesn't boot. From michael at ellerman.id.au Tue Jan 17 14:22:03 2006 From: michael at ellerman.id.au (Michael Ellerman) Date: Tue, 17 Jan 2006 14:22:03 +1100 Subject: [RFC/PATCH 1/12] powerpc: Remove calculation of io hole In-Reply-To: <1137468121.172522.474053389273.qpush@concordia> Message-ID: <20060117032217.B6EA8689AE@ozlabs.org> In mm_init_ppc64() we calculate the location of the "IO hole", but then no one ever looks at the value. So don't bother. That's actually all mm_init_ppc64() does, so get rid of it too. arch/powerpc/kernel/setup_64.c | 2 - arch/powerpc/mm/init_64.c | 48 ----------------------------------------- include/asm-powerpc/mmu.h | 1 3 files changed, 51 deletions(-) Index: linux/arch/powerpc/kernel/setup_64.c =================================================================== --- linux.orig/arch/powerpc/kernel/setup_64.c +++ linux/arch/powerpc/kernel/setup_64.c @@ -494,8 +494,6 @@ void __init setup_system(void) #endif printk("-----------------------------------------------------\n"); - mm_init_ppc64(); - DBG(" <- setup_system()\n"); } Index: linux/arch/powerpc/mm/init_64.c =================================================================== --- linux.orig/arch/powerpc/mm/init_64.c +++ linux/arch/powerpc/mm/init_64.c @@ -84,54 +84,6 @@ /* max amount of RAM to use */ unsigned long __max_memory; -/* info on what we think the IO hole is */ -unsigned long io_hole_start; -unsigned long io_hole_size; - -/* - * Do very early mm setup. - */ -void __init mm_init_ppc64(void) -{ -#ifndef CONFIG_PPC_ISERIES - unsigned long i; -#endif - - ppc64_boot_msg(0x100, "MM Init"); - - /* This is the story of the IO hole... please, keep seated, - * unfortunately, we are out of oxygen masks at the moment. - * So we need some rough way to tell where your big IO hole - * is. On pmac, it's between 2G and 4G, on POWER3, it's around - * that area as well, on POWER4 we don't have one, etc... - * We need that as a "hint" when sizing the TCE table on POWER3 - * So far, the simplest way that seem work well enough for us it - * to just assume that the first discontinuity in our physical - * RAM layout is the IO hole. That may not be correct in the future - * (and isn't on iSeries but then we don't care ;) - */ - -#ifndef CONFIG_PPC_ISERIES - for (i = 1; i < lmb.memory.cnt; i++) { - unsigned long base, prevbase, prevsize; - - prevbase = lmb.memory.region[i-1].base; - prevsize = lmb.memory.region[i-1].size; - base = lmb.memory.region[i].base; - if (base > (prevbase + prevsize)) { - io_hole_start = prevbase + prevsize; - io_hole_size = base - (prevbase + prevsize); - break; - } - } -#endif /* CONFIG_PPC_ISERIES */ - if (io_hole_start) - printk("IO Hole assumed to be %lx -> %lx\n", - io_hole_start, io_hole_start + io_hole_size - 1); - - ppc64_boot_msg(0x100, "MM Init Done"); -} - void free_initmem(void) { unsigned long addr; Index: linux/include/asm-powerpc/mmu.h =================================================================== --- linux.orig/include/asm-powerpc/mmu.h +++ linux/include/asm-powerpc/mmu.h @@ -235,7 +235,6 @@ extern void htab_initialize_secondary(vo extern void hpte_init_native(void); extern void hpte_init_lpar(void); extern void hpte_init_iSeries(void); -extern void mm_init_ppc64(void); extern long pSeries_lpar_hpte_insert(unsigned long hpte_group, unsigned long va, unsigned long prpn, From michael at ellerman.id.au Tue Jan 17 14:22:09 2006 From: michael at ellerman.id.au (Michael Ellerman) Date: Tue, 17 Jan 2006 14:22:09 +1100 Subject: [RFC/PATCH 2/12] powerpc: Remove #ifdef ISERIES from __raw_* accessors in io.h In-Reply-To: <1137468121.172522.474053389273.qpush@concordia> Message-ID: <20060117032222.E3DD9689CD@ozlabs.org> Convert the __raw_* accesors to be compilable on a combined kernel. include/asm-powerpc/io.h | 110 ++++++++++++++++++------------- include/asm-powerpc/iseries/iseries_io.h | 2 2 files changed, 66 insertions(+), 46 deletions(-) Index: linux/include/asm-powerpc/io.h =================================================================== --- linux.orig/include/asm-powerpc/io.h +++ linux/include/asm-powerpc/io.h @@ -14,13 +14,13 @@ #else #include +#include #include #include -#ifdef CONFIG_PPC_ISERIES #include -#endif #include #include +#include #include @@ -45,15 +45,6 @@ extern unsigned long io_page_mask; & io_page_mask) #ifdef CONFIG_PPC_ISERIES -/* __raw_* accessors aren't supported on iSeries */ -#define __raw_readb(addr) { BUG(); 0; } -#define __raw_readw(addr) { BUG(); 0; } -#define __raw_readl(addr) { BUG(); 0; } -#define __raw_readq(addr) { BUG(); 0; } -#define __raw_writeb(v, addr) { BUG(); 0; } -#define __raw_writew(v, addr) { BUG(); 0; } -#define __raw_writel(v, addr) { BUG(); 0; } -#define __raw_writeq(v, addr) { BUG(); 0; } #define readb(addr) iSeries_Read_Byte(addr) #define readw(addr) iSeries_Read_Word(addr) #define readl(addr) iSeries_Read_Long(addr) @@ -78,39 +69,6 @@ extern unsigned long io_page_mask; #define insw_ns(port, buf, ns) _insw_ns((u16 __iomem *)((port)+pci_io_base), (buf), (ns)) #define insl_ns(port, buf, nl) _insl_ns((u32 __iomem *)((port)+pci_io_base), (buf), (nl)) #else - -static inline unsigned char __raw_readb(const volatile void __iomem *addr) -{ - return *(volatile unsigned char __force *)addr; -} -static inline unsigned short __raw_readw(const volatile void __iomem *addr) -{ - return *(volatile unsigned short __force *)addr; -} -static inline unsigned int __raw_readl(const volatile void __iomem *addr) -{ - return *(volatile unsigned int __force *)addr; -} -static inline unsigned long __raw_readq(const volatile void __iomem *addr) -{ - return *(volatile unsigned long __force *)addr; -} -static inline void __raw_writeb(unsigned char v, volatile void __iomem *addr) -{ - *(volatile unsigned char __force *)addr = v; -} -static inline void __raw_writew(unsigned short v, volatile void __iomem *addr) -{ - *(volatile unsigned short __force *)addr = v; -} -static inline void __raw_writel(unsigned int v, volatile void __iomem *addr) -{ - *(volatile unsigned int __force *)addr = v; -} -static inline void __raw_writeq(unsigned long v, volatile void __iomem *addr) -{ - *(volatile unsigned long __force *)addr = v; -} #define readb(addr) eeh_readb(addr) #define readw(addr) eeh_readw(addr) #define readl(addr) eeh_readl(addr) @@ -146,6 +104,70 @@ static inline void __raw_writeq(unsigned #endif +static inline unsigned char __raw_readb(const volatile void __iomem *addr) +{ + if (firmware_has_feature(FW_FEATURE_ISERIES)) + BUG(); /* raw accessors aren't supported on iSeries */ + + return *(volatile unsigned char __force *)addr; +} + +static inline unsigned short __raw_readw(const volatile void __iomem *addr) +{ + if (firmware_has_feature(FW_FEATURE_ISERIES)) + BUG(); /* raw accessors aren't supported on iSeries */ + + return *(volatile unsigned short __force *)addr; +} + +static inline unsigned int __raw_readl(const volatile void __iomem *addr) +{ + if (firmware_has_feature(FW_FEATURE_ISERIES)) + BUG(); /* raw accessors aren't supported on iSeries */ + + return *(volatile unsigned int __force *)addr; +} + +static inline unsigned long __raw_readq(const volatile void __iomem *addr) +{ + if (firmware_has_feature(FW_FEATURE_ISERIES)) + BUG(); /* raw accessors aren't supported on iSeries */ + + return *(volatile unsigned long __force *)addr; +} + +static inline void __raw_writeb(unsigned char v, volatile void __iomem *addr) +{ + if (firmware_has_feature(FW_FEATURE_ISERIES)) + BUG(); /* raw accessors aren't supported on iSeries */ + + *(volatile unsigned char __force *)addr = v; +} + +static inline void __raw_writew(unsigned short v, volatile void __iomem *addr) +{ + if (firmware_has_feature(FW_FEATURE_ISERIES)) + BUG(); /* raw accessors aren't supported on iSeries */ + + *(volatile unsigned short __force *)addr = v; +} + +static inline void __raw_writel(unsigned int v, volatile void __iomem *addr) +{ + if (firmware_has_feature(FW_FEATURE_ISERIES)) + BUG(); /* raw accessors aren't supported on iSeries */ + + *(volatile unsigned int __force *)addr = v; +} + +static inline void __raw_writeq(unsigned long v, volatile void __iomem *addr) +{ + if (firmware_has_feature(FW_FEATURE_ISERIES)) + BUG(); /* raw accessors aren't supported on iSeries */ + + *(volatile unsigned long __force *)addr = v; +} + #define readb_relaxed(addr) readb(addr) #define readw_relaxed(addr) readw(addr) #define readl_relaxed(addr) readl(addr) Index: linux/include/asm-powerpc/iseries/iseries_io.h =================================================================== --- linux.orig/include/asm-powerpc/iseries/iseries_io.h +++ linux/include/asm-powerpc/iseries/iseries_io.h @@ -3,7 +3,6 @@ #include -#ifdef CONFIG_PPC_ISERIES #include /* * Created by Allan Trautman on Thu Dec 28 2000. @@ -57,5 +56,4 @@ static inline void iSeries_Write_Byte(u8 } #endif /* CONFIG_PCI */ -#endif /* CONFIG_PPC_ISERIES */ #endif /* _ASM_POWERPC_ISERIES_ISERIES_IO_H */ From michael at ellerman.id.au Tue Jan 17 14:22:14 2006 From: michael at ellerman.id.au (Michael Ellerman) Date: Tue, 17 Jan 2006 14:22:14 +1100 Subject: [RFC/PATCH 3/12] powerpc: Remove #ifdef ISERIES from readb/writeb etc. in io.h In-Reply-To: <1137468121.172522.474053389273.qpush@concordia> Message-ID: <20060117032228.CB9B7689D6@ozlabs.org> Convert readb/writeb etc. to be compilable on a combined kernel. include/asm-powerpc/io.h | 74 ++++++++++++++++++++++++++++++++++++----------- 1 files changed, 57 insertions(+), 17 deletions(-) Index: linux/include/asm-powerpc/io.h =================================================================== --- linux.orig/include/asm-powerpc/io.h +++ linux/include/asm-powerpc/io.h @@ -45,12 +45,6 @@ extern unsigned long io_page_mask; & io_page_mask) #ifdef CONFIG_PPC_ISERIES -#define readb(addr) iSeries_Read_Byte(addr) -#define readw(addr) iSeries_Read_Word(addr) -#define readl(addr) iSeries_Read_Long(addr) -#define writeb(data, addr) iSeries_Write_Byte((data),(addr)) -#define writew(data, addr) iSeries_Write_Word((data),(addr)) -#define writel(data, addr) iSeries_Write_Long((data),(addr)) #define memset_io(a,b,c) iSeries_memset_io((a),(b),(c)) #define memcpy_fromio(a,b,c) iSeries_memcpy_fromio((a), (b), (c)) #define memcpy_toio(a,b,c) iSeries_memcpy_toio((a), (b), (c)) @@ -69,14 +63,6 @@ extern unsigned long io_page_mask; #define insw_ns(port, buf, ns) _insw_ns((u16 __iomem *)((port)+pci_io_base), (buf), (ns)) #define insl_ns(port, buf, nl) _insl_ns((u32 __iomem *)((port)+pci_io_base), (buf), (nl)) #else -#define readb(addr) eeh_readb(addr) -#define readw(addr) eeh_readw(addr) -#define readl(addr) eeh_readl(addr) -#define readq(addr) eeh_readq(addr) -#define writeb(data, addr) eeh_writeb((data), (addr)) -#define writew(data, addr) eeh_writew((data), (addr)) -#define writel(data, addr) eeh_writel((data), (addr)) -#define writeq(data, addr) eeh_writeq((data), (addr)) #define memset_io(a,b,c) eeh_memset_io((a),(b),(c)) #define memcpy_fromio(a,b,c) eeh_memcpy_fromio((a),(b),(c)) #define memcpy_toio(a,b,c) eeh_memcpy_toio((a),(b),(c)) @@ -167,7 +153,6 @@ static inline void __raw_writeq(unsigned *(volatile unsigned long __force *)addr = v; } - #define readb_relaxed(addr) readb(addr) #define readw_relaxed(addr) readw(addr) #define readl_relaxed(addr) readl(addr) @@ -421,9 +406,64 @@ static inline void out_be64(volatile uns __asm__ __volatile__("std%U0%X0 %1,%0; sync" : "=m" (*addr) : "r" (val)); } -#ifndef CONFIG_PPC_ISERIES #include -#endif + +static inline u8 readb(const volatile void __iomem *addr) +{ + if (firmware_has_feature(FW_FEATURE_ISERIES)) + return iSeries_Read_Byte(addr); + else + return eeh_readb(addr); +} + +static inline u16 readw(const volatile void __iomem *addr) +{ + if (firmware_has_feature(FW_FEATURE_ISERIES)) + return iSeries_Read_Word(addr); + else + return eeh_readw(addr); +} + +static inline u32 readl(const volatile void __iomem *addr) +{ + if (firmware_has_feature(FW_FEATURE_ISERIES)) + return iSeries_Read_Long(addr); + else + return eeh_readb(addr); +} + +static inline void writeb(u8 val, volatile void __iomem *addr) +{ + if (firmware_has_feature(FW_FEATURE_ISERIES)) + iSeries_Write_Byte(val, addr); + else + eeh_writeb(val, addr); +} + +static inline void writew(u16 val, volatile void __iomem *addr) +{ + if (firmware_has_feature(FW_FEATURE_ISERIES)) + iSeries_Write_Word(val, addr); + else + eeh_writew(val, addr); +} + +static inline void writel(u32 val, volatile void __iomem *addr) +{ + if (firmware_has_feature(FW_FEATURE_ISERIES)) + iSeries_Write_Long(val, addr); + else + eeh_writel(val, addr); +} + +#define writeq writeq /* For dodgy drivers */ +static inline void writeq(u16 val, volatile void __iomem *addr) +{ + if (firmware_has_feature(FW_FEATURE_ISERIES)) + BUG(); /* doesn't exist on iSeries ?? */ + else + eeh_writeq(val, addr); +} /** * check_signature - find BIOS signatures From michael at ellerman.id.au Tue Jan 17 14:22:19 2006 From: michael at ellerman.id.au (Michael Ellerman) Date: Tue, 17 Jan 2006 14:22:19 +1100 Subject: [RFC/PATCH 4/12] powerpc: Remove #ifdef ISERIES from memset/memcpy routines in io.h In-Reply-To: <1137468121.172522.474053389273.qpush@concordia> Message-ID: <20060117032232.0B1F1689E0@ozlabs.org> Make the memcpy/memset routines compilable on a combined kernel. arch/powerpc/platforms/iseries/pci.c | 25 +++++++++++------------ include/asm-powerpc/io.h | 33 +++++++++++++++++++++++++------ include/asm-powerpc/iseries/iseries_io.h | 12 ++++++----- 3 files changed, 46 insertions(+), 24 deletions(-) Index: linux/include/asm-powerpc/io.h =================================================================== --- linux.orig/include/asm-powerpc/io.h +++ linux/include/asm-powerpc/io.h @@ -45,9 +45,6 @@ extern unsigned long io_page_mask; & io_page_mask) #ifdef CONFIG_PPC_ISERIES -#define memset_io(a,b,c) iSeries_memset_io((a),(b),(c)) -#define memcpy_fromio(a,b,c) iSeries_memcpy_fromio((a), (b), (c)) -#define memcpy_toio(a,b,c) iSeries_memcpy_toio((a), (b), (c)) #define inb(addr) readb(((void __iomem *)(long)(addr))) #define inw(addr) readw(((void __iomem *)(long)(addr))) @@ -63,9 +60,6 @@ extern unsigned long io_page_mask; #define insw_ns(port, buf, ns) _insw_ns((u16 __iomem *)((port)+pci_io_base), (buf), (ns)) #define insl_ns(port, buf, nl) _insl_ns((u32 __iomem *)((port)+pci_io_base), (buf), (nl)) #else -#define memset_io(a,b,c) eeh_memset_io((a),(b),(c)) -#define memcpy_fromio(a,b,c) eeh_memcpy_fromio((a),(b),(c)) -#define memcpy_toio(a,b,c) eeh_memcpy_toio((a),(b),(c)) #define inb(port) eeh_inb((unsigned long)port) #define outb(val, port) eeh_outb(val, (unsigned long)port) #define inw(port) eeh_inw((unsigned long)port) @@ -465,6 +459,33 @@ static inline void writeq(u16 val, volat eeh_writeq(val, addr); } +static inline void memset_io(volatile void __iomem *dest, int c, + unsigned long count) +{ + if (firmware_has_feature(FW_FEATURE_ISERIES)) + iSeries_memset_io(dest, c, count); + else + eeh_memset_io(dest, c, count); +} + +static inline void memcpy_fromio(void *dest, const volatile void __iomem *src, + unsigned long count) +{ + if (firmware_has_feature(FW_FEATURE_ISERIES)) + iSeries_memcpy_fromio(dest, src, count); + else + eeh_memcpy_fromio(dest, src, count); +} + +static inline void memcpy_toio(volatile void __iomem *dest, const void *src, + unsigned long count) +{ + if (firmware_has_feature(FW_FEATURE_ISERIES)) + iSeries_memcpy_toio(dest, src, count); + else + eeh_memcpy_toio(dest, src, count); +} + /** * check_signature - find BIOS signatures * @io_addr: mmio address to check Index: linux/arch/powerpc/platforms/iseries/pci.c =================================================================== --- linux.orig/arch/powerpc/platforms/iseries/pci.c +++ linux/arch/powerpc/platforms/iseries/pci.c @@ -468,38 +468,37 @@ static int scan_bridge_slot(HvBusNumber * I/0 Memory copy MUST use mmio commands on iSeries * To do; For performance, include the hv call directly */ -void iSeries_memset_io(volatile void __iomem *dest, char c, size_t Count) +void iSeries_memset_io(volatile void __iomem *dest, int c, unsigned long count) { u8 ByteValue = c; - long NumberOfBytes = Count; - while (NumberOfBytes > 0) { + while (count > 0) { iSeries_Write_Byte(ByteValue, dest++); - -- NumberOfBytes; + count--; } } EXPORT_SYMBOL(iSeries_memset_io); -void iSeries_memcpy_toio(volatile void __iomem *dest, void *source, size_t count) +void iSeries_memcpy_toio(volatile void __iomem *dest, const void *source, + unsigned long count) { - char *src = source; - long NumberOfBytes = count; + const char *src = source; - while (NumberOfBytes > 0) { + while (count > 0) { iSeries_Write_Byte(*src++, dest++); - -- NumberOfBytes; + count--; } } EXPORT_SYMBOL(iSeries_memcpy_toio); -void iSeries_memcpy_fromio(void *dest, const volatile void __iomem *src, size_t count) +void iSeries_memcpy_fromio(void *dest, const volatile void __iomem *src, + unsigned long count) { char *dst = dest; - long NumberOfBytes = count; - while (NumberOfBytes > 0) { + while (count > 0) { *dst++ = iSeries_Read_Byte(src++); - -- NumberOfBytes; + count--; } } EXPORT_SYMBOL(iSeries_memcpy_fromio); Index: linux/include/asm-powerpc/iseries/iseries_io.h =================================================================== --- linux.orig/include/asm-powerpc/iseries/iseries_io.h +++ linux/include/asm-powerpc/iseries/iseries_io.h @@ -39,11 +39,13 @@ extern void iSeries_Write_Byte(u8 IoDat extern void iSeries_Write_Word(u16 IoData, volatile void __iomem * IoAddress); extern void iSeries_Write_Long(u32 IoData, volatile void __iomem * IoAddress); -extern void iSeries_memset_io(volatile void __iomem *dest, char x, size_t n); -extern void iSeries_memcpy_toio(volatile void __iomem *dest, void *source, - size_t n); -extern void iSeries_memcpy_fromio(void *dest, - const volatile void __iomem *source, size_t n); + +extern void iSeries_memset_io(volatile void __iomem *dest, int c, + unsigned long count); +extern void iSeries_memcpy_toio(volatile void __iomem *dest, const void *source, + unsigned long count); +extern void iSeries_memcpy_fromio(void *dest, const volatile void __iomem *src, + unsigned long count); #else static inline u8 iSeries_Read_Byte(const volatile void __iomem *IoAddress) { From michael at ellerman.id.au Tue Jan 17 14:22:24 2006 From: michael at ellerman.id.au (Michael Ellerman) Date: Tue, 17 Jan 2006 14:22:24 +1100 Subject: [RFC/PATCH 5/12] powerpc: Remove #ifdef ISERIES from inb/outb etc. in io.h In-Reply-To: <1137468121.172522.474053389273.qpush@concordia> Message-ID: <20060117032239.5F603689E5@ozlabs.org> Make inb/outb etc. compilable on a combined kernel. include/asm-powerpc/io.h | 60 +++++++++++++++++++++++++++++++++++++---------- 1 files changed, 48 insertions(+), 12 deletions(-) Index: linux/include/asm-powerpc/io.h =================================================================== --- linux.orig/include/asm-powerpc/io.h +++ linux/include/asm-powerpc/io.h @@ -46,12 +46,6 @@ extern unsigned long io_page_mask; #ifdef CONFIG_PPC_ISERIES -#define inb(addr) readb(((void __iomem *)(long)(addr))) -#define inw(addr) readw(((void __iomem *)(long)(addr))) -#define inl(addr) readl(((void __iomem *)(long)(addr))) -#define outb(data,addr) writeb(data,((void __iomem *)(long)(addr))) -#define outw(data,addr) writew(data,((void __iomem *)(long)(addr))) -#define outl(data,addr) writel(data,((void __iomem *)(long)(addr))) /* * The *_ns versions below don't do byte-swapping. * Neither do the standard versions now, these are just here @@ -60,12 +54,6 @@ extern unsigned long io_page_mask; #define insw_ns(port, buf, ns) _insw_ns((u16 __iomem *)((port)+pci_io_base), (buf), (ns)) #define insl_ns(port, buf, nl) _insl_ns((u32 __iomem *)((port)+pci_io_base), (buf), (nl)) #else -#define inb(port) eeh_inb((unsigned long)port) -#define outb(val, port) eeh_outb(val, (unsigned long)port) -#define inw(port) eeh_inw((unsigned long)port) -#define outw(val, port) eeh_outw(val, (unsigned long)port) -#define inl(port) eeh_inl((unsigned long)port) -#define outl(val, port) eeh_outl(val, (unsigned long)port) /* * The insw/outsw/insl/outsl macros don't do byte-swapping. @@ -486,6 +474,54 @@ static inline void memcpy_toio(volatile eeh_memcpy_toio(dest, src, count); } +static inline u8 inb(unsigned long addr) +{ + if (firmware_has_feature(FW_FEATURE_ISERIES)) + return readb((void __iomem *)addr); + else + return eeh_inb(addr); +} + +static inline u16 inw(unsigned long addr) +{ + if (firmware_has_feature(FW_FEATURE_ISERIES)) + return readw((void __iomem *)addr); + else + return eeh_inw(addr); +} + +static inline u32 inl(unsigned long addr) +{ + if (firmware_has_feature(FW_FEATURE_ISERIES)) + return readl((void __iomem *)addr); + else + return eeh_inl(addr); +} + +static inline void outb(u8 val, unsigned long addr) +{ + if (firmware_has_feature(FW_FEATURE_ISERIES)) + return writeb(val, (void __iomem *)addr); + else + return eeh_outb(val, addr); +} + +static inline void outw(u16 val, unsigned long addr) +{ + if (firmware_has_feature(FW_FEATURE_ISERIES)) + return writew(val, (void __iomem *)addr); + else + return eeh_outw(val, addr); +} + +static inline void outl(u32 val, unsigned long addr) +{ + if (firmware_has_feature(FW_FEATURE_ISERIES)) + return writel(val, (void __iomem *)addr); + else + return eeh_outl(val, addr); +} + /** * check_signature - find BIOS signatures * @io_addr: mmio address to check From michael at ellerman.id.au Tue Jan 17 14:22:29 2006 From: michael at ellerman.id.au (Michael Ellerman) Date: Tue, 17 Jan 2006 14:22:29 +1100 Subject: [RFC/PATCH 6/12] powerpc: Remove #ifdef ISERIES from insw_ns/insl_ns in io.h In-Reply-To: <1137468121.172522.474053389273.qpush@concordia> Message-ID: <20060117032240.E9663689E5@ozlabs.org> Make insw_ns/insl_ns compilable on a combined kernel. include/asm-powerpc/io.h | 36 +++++++++++++++++++++++------------- 1 files changed, 23 insertions(+), 13 deletions(-) Index: linux/include/asm-powerpc/io.h =================================================================== --- linux.orig/include/asm-powerpc/io.h +++ linux/include/asm-powerpc/io.h @@ -44,17 +44,7 @@ extern unsigned long io_page_mask; #define _IO_IS_VALID(port) ((port) >= MAX_ISA_PORT || (1 << (port>>PAGE_SHIFT)) \ & io_page_mask) -#ifdef CONFIG_PPC_ISERIES - -/* - * The *_ns versions below don't do byte-swapping. - * Neither do the standard versions now, these are just here - * for older code. - */ -#define insw_ns(port, buf, ns) _insw_ns((u16 __iomem *)((port)+pci_io_base), (buf), (ns)) -#define insl_ns(port, buf, nl) _insl_ns((u32 __iomem *)((port)+pci_io_base), (buf), (nl)) -#else - +#ifndef CONFIG_PPC_ISERIES /* * The insw/outsw/insl/outsl macros don't do byte-swapping. * They are only used in practice for transferring buffers which @@ -63,8 +53,6 @@ extern unsigned long io_page_mask; #define insb(port, buf, ns) eeh_insb((port), (buf), (ns)) #define insw(port, buf, ns) eeh_insw_ns((port), (buf), (ns)) #define insl(port, buf, nl) eeh_insl_ns((port), (buf), (nl)) -#define insw_ns(port, buf, ns) eeh_insw_ns((port), (buf), (ns)) -#define insl_ns(port, buf, nl) eeh_insl_ns((port), (buf), (nl)) #define outsb(port, buf, ns) _outsb((u8 __iomem *)((port)+pci_io_base), (buf), (ns)) #define outsw(port, buf, ns) _outsw_ns((u16 __iomem *)((port)+pci_io_base), (buf), (ns)) @@ -522,6 +510,28 @@ static inline void outl(u32 val, unsigne return eeh_outl(val, addr); } +/* + * The *_ns versions below don't do byte-swapping. + * Neither do the standard versions now, these are just here + * for older code. + */ + +static inline void insw_ns(unsigned long port, void *buf, int ns) +{ + if (firmware_has_feature(FW_FEATURE_ISERIES)) + _insw_ns((u16 __iomem *)(port + pci_io_base), buf, ns); + else + eeh_insw_ns(port, buf, ns); +} + +static inline void insl_ns(unsigned long port, void *buf, int nl) +{ + if (firmware_has_feature(FW_FEATURE_ISERIES)) + _insl_ns((u32 __iomem *)(port + pci_io_base), buf, nl); + else + eeh_insl_ns(port, buf, nl); +} + /** * check_signature - find BIOS signatures * @io_addr: mmio address to check From michael at ellerman.id.au Tue Jan 17 14:22:31 2006 From: michael at ellerman.id.au (Michael Ellerman) Date: Tue, 17 Jan 2006 14:22:31 +1100 Subject: [RFC/PATCH 7/12] powerpc: Use FW_FEATURE_ISERIES in pgtable_64.c In-Reply-To: <1137468121.172522.474053389273.qpush@concordia> Message-ID: <20060117032247.93B4D689F6@ozlabs.org> Convert from #ifdef ISERIES to FW_FEATURE_ISERIES tests in pgtable_64.c arch/powerpc/mm/pgtable_64.c | 30 +++++++----------------------- 1 files changed, 7 insertions(+), 23 deletions(-) Index: linux/arch/powerpc/mm/pgtable_64.c =================================================================== --- linux.orig/arch/powerpc/mm/pgtable_64.c +++ linux/arch/powerpc/mm/pgtable_64.c @@ -70,26 +70,6 @@ unsigned long ioremap_bot = IMALLOC_BASE; static unsigned long phbs_io_bot = PHBS_IO_BASE; -#ifdef CONFIG_PPC_ISERIES - -void __iomem *ioremap(unsigned long addr, unsigned long size) -{ - return (void __iomem *)addr; -} - -extern void __iomem *__ioremap(unsigned long addr, unsigned long size, - unsigned long flags) -{ - return (void __iomem *)addr; -} - -void iounmap(volatile void __iomem *addr) -{ - return; -} - -#else - /* * map_io_page currently only called by __ioremap * map_io_page adds an entry to the ioremap page table @@ -162,6 +142,9 @@ void __iomem * __ioremap(unsigned long a unsigned long pa, ea; void __iomem *ret; + if (firmware_has_feature(FW_FEATURE_ISERIES)) + return (void __iomem *)addr; + /* * Choose an address to map it to. * Once the imalloc system is running, we use it. @@ -256,9 +239,12 @@ void iounmap(volatile void __iomem *toke { void *addr; + if (firmware_has_feature(FW_FEATURE_ISERIES)) + return; + if (!mem_init_done) return; - + addr = (void *) ((unsigned long __force) token & PAGE_MASK); im_free(addr); @@ -316,8 +302,6 @@ int iounmap_explicit(volatile void __iom return 0; } -#endif - EXPORT_SYMBOL(ioremap); EXPORT_SYMBOL(__ioremap); EXPORT_SYMBOL(iounmap); From michael at ellerman.id.au Tue Jan 17 14:22:37 2006 From: michael at ellerman.id.au (Michael Ellerman) Date: Tue, 17 Jan 2006 14:22:37 +1100 Subject: [RFC/PATCH 8/12] powerpc: Use FW_FEATURE_ISERIES in pci_64.c In-Reply-To: <1137468121.172522.474053389273.qpush@concordia> Message-ID: <20060117032251.394AA681B8@ozlabs.org> Convert from #ifdef ISERIES to FW_FEATURE_ISERIES tests in pci_64.c arch/powerpc/kernel/pci_64.c | 50 +++++++++++++++++++++++-------------------- 1 files changed, 27 insertions(+), 23 deletions(-) Index: linux/arch/powerpc/kernel/pci_64.c =================================================================== --- linux.orig/arch/powerpc/kernel/pci_64.c +++ linux/arch/powerpc/kernel/pci_64.c @@ -252,12 +252,14 @@ void pcibios_free_controller(struct pci_ kfree(phb); } -#ifndef CONFIG_PPC_ISERIES void __devinit pcibios_claim_one_bus(struct pci_bus *b) { struct pci_dev *dev; struct pci_bus *child_bus; + if (firmware_has_feature(FW_FEATURE_ISERIES)) + return; + list_for_each_entry(dev, &b->devices, bus_list) { int i; @@ -281,10 +283,12 @@ static void __init pcibios_claim_of_setu { struct pci_bus *b; + if (firmware_has_feature(FW_FEATURE_ISERIES)) + return; + list_for_each_entry(b, &pci_root_buses, node) pcibios_claim_one_bus(b); } -#endif #ifdef CONFIG_PPC_MULTIPLATFORM static u32 get_int_prop(struct device_node *np, const char *name, u32 def) @@ -601,9 +605,8 @@ static int __init pcibios_init(void) */ ppc_md.phys_mem_access_prot = pci_phys_mem_access_prot; -#ifdef CONFIG_PPC_ISERIES - iSeries_pcibios_init(); -#endif + if (firmware_has_feature(FW_FEATURE_ISERIES)) + iSeries_pcibios_init(); printk("PCI: Probing PCI hardware\n"); @@ -611,15 +614,15 @@ static int __init pcibios_init(void) list_for_each_entry_safe(hose, tmp, &hose_list, list_node) scan_phb(hose); -#ifndef CONFIG_PPC_ISERIES - if (pci_probe_only) - pcibios_claim_of_setup(); - else + if (!firmware_has_feature(FW_FEATURE_ISERIES)) { /* FIXME: `else' will be removed when - pci_assign_unassigned_resources() is able to work - correctly with [partially] allocated PCI tree. */ - pci_assign_unassigned_resources(); -#endif /* !CONFIG_PPC_ISERIES */ + pci_assign_unassigned_resources() is able to work + correctly with [partially] allocated PCI tree. */ + if (pci_probe_only) + pcibios_claim_of_setup(); + else + pci_assign_unassigned_resources(); + } /* Call machine dependent final fixup */ if (ppc_md.pcibios_fixup) @@ -682,13 +685,13 @@ int pcibios_enable_device(struct pci_dev */ int pci_domain_nr(struct pci_bus *bus) { -#ifdef CONFIG_PPC_ISERIES - return 0; -#else - struct pci_controller *hose = pci_bus_to_host(bus); + struct pci_controller *hose; + if (firmware_has_feature(FW_FEATURE_ISERIES)) + return 0; + + hose = pci_bus_to_host(bus); return hose->global_number; -#endif } EXPORT_SYMBOL(pci_domain_nr); @@ -696,12 +699,13 @@ EXPORT_SYMBOL(pci_domain_nr); /* Decide whether to display the domain number in /proc */ int pci_proc_domain(struct pci_bus *bus) { -#ifdef CONFIG_PPC_ISERIES - return 0; -#else - struct pci_controller *hose = pci_bus_to_host(bus); + struct pci_controller *hose; + + if (firmware_has_feature(FW_FEATURE_ISERIES)) + return 0; + + hose = pci_bus_to_host(bus); return hose->buid; -#endif } /* From michael at ellerman.id.au Tue Jan 17 14:22:41 2006 From: michael at ellerman.id.au (Michael Ellerman) Date: Tue, 17 Jan 2006 14:22:41 +1100 Subject: [RFC/PATCH 9/12] powerpc: Make find_and_init_phbs() work in a combined kernel In-Reply-To: <1137468121.172522.474053389273.qpush@concordia> Message-ID: <20060117032253.35848689EC@ozlabs.org> We currently build two version of find_and_init_pubs(), that won't work in a combined kernel. This is a bit ugly at present, we could make it a ppc_md function if necessary. arch/powerpc/kernel/pci_64.c | 8 ++++++++ arch/powerpc/kernel/rtas_pci.c | 2 +- arch/powerpc/platforms/iseries/pci.c | 13 +++++-------- include/asm-powerpc/ppc-pci.h | 2 ++ 4 files changed, 16 insertions(+), 9 deletions(-) Index: linux/arch/powerpc/kernel/pci_64.c =================================================================== --- linux.orig/arch/powerpc/kernel/pci_64.c +++ linux/arch/powerpc/kernel/pci_64.c @@ -1444,3 +1444,11 @@ long sys_pciconfig_iobase(long which, un return -EOPNOTSUPP; } + +unsigned long find_and_init_phbs(void) +{ + if (firmware_has_feature(FW_FEATURE_ISERIES)) + return iseries_find_and_init_phbs(); + else + return rtas_find_and_init_phbs(); +} Index: linux/arch/powerpc/kernel/rtas_pci.c =================================================================== --- linux.orig/arch/powerpc/kernel/rtas_pci.c +++ linux/arch/powerpc/kernel/rtas_pci.c @@ -295,7 +295,7 @@ static int __devinit setup_phb(struct de return 0; } -unsigned long __init find_and_init_phbs(void) +unsigned long __init rtas_find_and_init_phbs(void) { struct device_node *node; struct pci_controller *phb; Index: linux/arch/powerpc/platforms/iseries/pci.c =================================================================== --- linux.orig/arch/powerpc/platforms/iseries/pci.c +++ linux/arch/powerpc/platforms/iseries/pci.c @@ -226,15 +226,12 @@ static struct device_node *build_device_ } /* - * unsigned long __init find_and_init_phbs(void) - * - * Description: - * This function checks for all possible system PCI host bridges that connect - * PCI buses. The system hypervisor is queried as to the guest partition - * ownership status. A pci_controller is built for any bus which is partially - * owned or fully owned by this guest partition. + * This function checks for all possible system PCI host bridges that connect + * PCI buses. The system hypervisor is queried as to the guest partition + * ownership status. A pci_controller is built for any bus which is partially + * owned or fully owned by this guest partition. */ -unsigned long __init find_and_init_phbs(void) +unsigned long __init iseries_find_and_init_phbs(void) { struct pci_controller *phb; HvBusNumber bus; Index: linux/include/asm-powerpc/ppc-pci.h =================================================================== --- linux.orig/include/asm-powerpc/ppc-pci.h +++ linux/include/asm-powerpc/ppc-pci.h @@ -23,6 +23,8 @@ extern struct list_head hose_list; extern int global_phb_number; extern unsigned long find_and_init_phbs(void); +extern unsigned long iseries_find_and_init_phbs(void); +extern unsigned long rtas_find_and_init_phbs(void); extern struct pci_dev *ppc64_isabridge_dev; /* may be NULL if no ISA bus */ From michael at ellerman.id.au Tue Jan 17 14:22:43 2006 From: michael at ellerman.id.au (Michael Ellerman) Date: Tue, 17 Jan 2006 14:22:43 +1100 Subject: [RFC/PATCH 10/12] powerpc: Remove empty iSeries version of pcibios_fixup_bus() In-Reply-To: <1137468121.172522.474053389273.qpush@concordia> Message-ID: <20060117032255.F21B068A02@ozlabs.org> We currently build two version of pcibios_fixup_bus(), although the iSeries version is empty. So replace with a FW_FEATURE_ISERIES test. Move some stuff around to avoid needing prototype declarations. arch/powerpc/kernel/pci_64.c | 78 ++++++++++++++++++----------------- arch/powerpc/platforms/iseries/pci.c | 4 - 2 files changed, 41 insertions(+), 41 deletions(-) Index: linux/arch/powerpc/kernel/pci_64.c =================================================================== --- linux.orig/arch/powerpc/kernel/pci_64.c +++ linux/arch/powerpc/kernel/pci_64.c @@ -52,7 +52,6 @@ EXPORT_SYMBOL(io_page_mask); #ifdef CONFIG_PPC_MULTIPLATFORM static void fixup_resource(struct resource *res, struct pci_dev *dev); -static void do_bus_setup(struct pci_bus *bus); static void phbs_remap_io(void); #endif @@ -290,6 +289,19 @@ static void __init pcibios_claim_of_setu pcibios_claim_one_bus(b); } +static void __devinit do_bus_setup(struct pci_bus *bus) +{ + struct pci_dev *dev; + + ppc_md.iommu_bus_setup(bus); + + list_for_each_entry(dev, &bus->devices, bus_list) + ppc_md.iommu_dev_setup(dev); + + if (ppc_md.irq_bus_setup) + ppc_md.irq_bus_setup(bus); +} + #ifdef CONFIG_PPC_MULTIPLATFORM static u32 get_int_prop(struct device_node *np, const char *name, u32 def) { @@ -1274,42 +1286,6 @@ void __devinit pcibios_fixup_device_reso EXPORT_SYMBOL(pcibios_fixup_device_resources); -static void __devinit do_bus_setup(struct pci_bus *bus) -{ - struct pci_dev *dev; - - ppc_md.iommu_bus_setup(bus); - - list_for_each_entry(dev, &bus->devices, bus_list) - ppc_md.iommu_dev_setup(dev); - - if (ppc_md.irq_bus_setup) - ppc_md.irq_bus_setup(bus); -} - -void __devinit pcibios_fixup_bus(struct pci_bus *bus) -{ - struct pci_dev *dev = bus->self; - - if (dev && pci_probe_only && - (dev->class >> 8) == PCI_CLASS_BRIDGE_PCI) { - /* This is a subordinate bridge */ - - pci_read_bridge_bases(bus); - pcibios_fixup_device_resources(dev, bus); - } - - do_bus_setup(bus); - - if (!pci_probe_only) - return; - - list_for_each_entry(dev, &bus->devices, bus_list) - if ((dev->class >> 8) != PCI_CLASS_BRIDGE_PCI) - pcibios_fixup_device_resources(dev, bus); -} -EXPORT_SYMBOL(pcibios_fixup_bus); - /* * Reads the interrupt pin to determine if interrupt is use by card. * If the interrupt is used, then gets the interrupt line from the @@ -1373,6 +1349,34 @@ struct pci_controller* pci_find_hose_for #endif /* CONFIG_PPC_MULTIPLATFORM */ +void __devinit pcibios_fixup_bus(struct pci_bus *bus) +{ + struct pci_dev *dev; + + if (firmware_has_feature(FW_FEATURE_ISERIES)) + return; + + dev = bus->self; + + if (dev && pci_probe_only && + (dev->class >> 8) == PCI_CLASS_BRIDGE_PCI) { + /* This is a subordinate bridge */ + + pci_read_bridge_bases(bus); + pcibios_fixup_device_resources(dev, bus); + } + + do_bus_setup(bus); + + if (!pci_probe_only) + return; + + list_for_each_entry(dev, &bus->devices, bus_list) + if ((dev->class >> 8) != PCI_CLASS_BRIDGE_PCI) + pcibios_fixup_device_resources(dev, bus); +} +EXPORT_SYMBOL(pcibios_fixup_bus); + unsigned long pci_address_to_pio(phys_addr_t address) { struct pci_controller *hose, *tmp; Index: linux/arch/powerpc/platforms/iseries/pci.c =================================================================== --- linux.orig/arch/powerpc/platforms/iseries/pci.c +++ linux/arch/powerpc/platforms/iseries/pci.c @@ -311,10 +311,6 @@ void __init iSeries_pci_final_fixup(void mf_display_src(0xC9000200); } -void pcibios_fixup_bus(struct pci_bus *PciBus) -{ -} - void pcibios_fixup_resources(struct pci_dev *pdev) { } From michael at ellerman.id.au Tue Jan 17 14:22:46 2006 From: michael at ellerman.id.au (Michael Ellerman) Date: Tue, 17 Jan 2006 14:22:46 +1100 Subject: [RFC/PATCH 11/12] powerpc: Use FW_FEATURE_ISERIES in slb_initialize() In-Reply-To: <1137468121.172522.474053389273.qpush@concordia> Message-ID: <20060117032300.D707568A0A@ozlabs.org> Use a firmware feature test in slb_initialize(). arch/powerpc/mm/slb.c | 46 +++++++++++++++++++++++----------------------- 1 files changed, 23 insertions(+), 23 deletions(-) Index: linux/arch/powerpc/mm/slb.c =================================================================== --- linux.orig/arch/powerpc/mm/slb.c +++ linux/arch/powerpc/mm/slb.c @@ -23,6 +23,7 @@ #include #include #include +#include #ifdef DEBUG #define DBG(fmt...) udbg_printf(fmt) @@ -202,29 +203,28 @@ void slb_initialize(void) /* On iSeries the bolted entries have already been set up by * the hypervisor from the lparMap data in head.S */ -#ifndef CONFIG_PPC_ISERIES - { - unsigned long lflags, vflags; - - lflags = SLB_VSID_KERNEL | linear_llp; - vflags = SLB_VSID_KERNEL | virtual_llp; - - /* Invalidate the entire SLB (even slot 0) & all the ERATS */ - asm volatile("isync":::"memory"); - asm volatile("slbmte %0,%0"::"r" (0) : "memory"); - asm volatile("isync; slbia; isync":::"memory"); - create_slbe(PAGE_OFFSET, lflags, 0); - - /* VMALLOC space has 4K pages always for now */ - create_slbe(VMALLOC_START, vflags, 1); - - /* We don't bolt the stack for the time being - we're in boot, - * so the stack is in the bolted segment. By the time it goes - * elsewhere, we'll call _switch() which will bolt in the new - * one. */ - asm volatile("isync":::"memory"); - } -#endif /* CONFIG_PPC_ISERIES */ + if (!firmware_has_feature(FW_FEATURE_ISERIES)) + { + unsigned long lflags, vflags; + + lflags = SLB_VSID_KERNEL | linear_llp; + vflags = SLB_VSID_KERNEL | virtual_llp; + + /* Invalidate the entire SLB (even slot 0) & all the ERATS */ + asm volatile("isync":::"memory"); + asm volatile("slbmte %0,%0"::"r" (0) : "memory"); + asm volatile("isync; slbia; isync":::"memory"); + create_slbe(PAGE_OFFSET, lflags, 0); + + /* VMALLOC space has 4K pages always for now */ + create_slbe(VMALLOC_START, vflags, 1); + + /* We don't bolt the stack for the time being - we're in boot, + * so the stack is in the bolted segment. By the time it goes + * elsewhere, we'll call _switch() which will bolt in the new + * one. */ + asm volatile("isync":::"memory"); + } get_paca()->stab_rr = SLB_NUM_BOLTED; } From michael at ellerman.id.au Tue Jan 17 14:22:51 2006 From: michael at ellerman.id.au (Michael Ellerman) Date: Tue, 17 Jan 2006 14:22:51 +1100 Subject: [RFC/PATCH 12/12] powerpc: Use FW_FEATURE_ISERIES in sysfs.c In-Reply-To: <1137468121.172522.474053389273.qpush@concordia> Message-ID: <20060117032304.19D9668A19@ozlabs.org> Use a firmware feature test in sysfs.c arch/powerpc/kernel/sysfs.c | 13 ++++--------- 1 files changed, 4 insertions(+), 9 deletions(-) Index: linux/arch/powerpc/kernel/sysfs.c =================================================================== --- linux.orig/arch/powerpc/kernel/sysfs.c +++ linux/arch/powerpc/kernel/sysfs.c @@ -25,7 +25,6 @@ static DEFINE_PER_CPU(struct cpu, cpu_de /* SMT stuff */ -#ifdef CONFIG_PPC_MULTIPLATFORM /* default to snooze disabled */ DEFINE_PER_CPU(unsigned long, smt_snooze_delay); @@ -101,8 +100,6 @@ static int __init setup_smt_snooze_delay } __setup("smt-snooze-delay=", setup_smt_snooze_delay); -#endif /* CONFIG_PPC_MULTIPLATFORM */ - /* * Enabling PMCs will slow partition context switch times so we only do * it the first time we write to the PMCs. @@ -202,10 +199,9 @@ static void register_cpu_online(unsigned struct cpu *c = &per_cpu(cpu_devices, cpu); struct sys_device *s = &c->sysdev; -#ifndef CONFIG_PPC_ISERIES - if (cpu_has_feature(CPU_FTR_SMT)) + if (!firmware_has_feature(FW_FEATURE_ISERIES) && + cpu_has_feature(CPU_FTR_SMT)) sysdev_create_file(s, &attr_smt_snooze_delay); -#endif /* PMC stuff */ @@ -244,10 +240,9 @@ static void unregister_cpu_online(unsign BUG_ON(c->no_control); -#ifndef CONFIG_PPC_ISERIES - if (cpu_has_feature(CPU_FTR_SMT)) + if (!firmware_has_feature(FW_FEATURE_ISERIES) && + cpu_has_feature(CPU_FTR_SMT)) sysdev_remove_file(s, &attr_smt_snooze_delay); -#endif /* PMC stuff */ From prenuka at gmail.com Tue Jan 17 15:45:31 2006 From: prenuka at gmail.com (Renuka Pampana) Date: Tue, 17 Jan 2006 10:15:31 +0530 Subject: Linuxppc64-dev Digest, Vol 17, Issue 74 In-Reply-To: References: Message-ID: <9b23fc710601162045h78967731w69858e69a3c13b2d@mail.gmail.com> Hi, I compilied rpms and installed while executing the command This error i am facing #gettext -bash: /tmp/test12/cdt/bin/gettext: /tmp/test12/cdt/lib/ld-linux.so.2: bad ELF interpreter: No such file or directory But the libraries are present in correct place. If i try to see with strace this error it showing # strace gettext strace: exec: No such file or directory execve("/tmp/test12/cdt/bin/gettext", ["gettext"], [/* 37 vars */]) =3D 0 Can anyone help... I tried searching in the google but couldnot resolve... Thank you in advance.. Renuka From david at gibson.dropbear.id.au Tue Jan 17 15:59:32 2006 From: david at gibson.dropbear.id.au (David Gibson) Date: Tue, 17 Jan 2006 15:59:32 +1100 Subject: [RFC/PATCH 2/12] powerpc: Remove #ifdef ISERIES from __raw_* accessors in io.h In-Reply-To: <20060117032222.E3DD9689CD@ozlabs.org> References: <1137468121.172522.474053389273.qpush@concordia> <20060117032222.E3DD9689CD@ozlabs.org> Message-ID: <20060117045932.GH1557@localhost.localdomain> On Tue, Jan 17, 2006 at 02:22:09PM +1100, Michael Ellerman wrote: > Convert the __raw_* accesors to be compilable on a combined kernel. [snip] > +static inline unsigned char __raw_readb(const volatile void __iomem *addr) > +{ > + if (firmware_has_feature(FW_FEATURE_ISERIES)) > + BUG(); /* raw accessors aren't supported on iSeries > */ BUG_ON() would seem reasonable here.. -- David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson From mingo at elte.hu Tue Jan 17 19:17:49 2006 From: mingo at elte.hu (Ingo Molnar) Date: Tue, 17 Jan 2006 09:17:49 +0100 Subject: 2.6.15-mm4 failure on power5 In-Reply-To: <20060116170907.60149236.akpm@osdl.org> References: <20060116063530.GB23399@sergelap.austin.ibm.com> <20060115230557.0f07a55c.akpm@osdl.org> <200601170000.58134.michael@ellerman.id.au> <20060116153748.GA25866@sergelap.austin.ibm.com> <20060116215252.GA10538@cs.umn.edu> <20060116170907.60149236.akpm@osdl.org> Message-ID: <20060117081749.GA10135@elte.hu> * Andrew Morton wrote: > > If I revert just that patch, mm4 boots fine. Its really not obvious to > > me at all why that patch is breaking things though... > > Yes, that is strange. I do recall that if something accidentally > enables interrupts too early in boot, ppc64 machines tend to go > comatose. But if we'd been running that code under > local_irq_disable(), down() would have spat a warning. perhaps it was just luck it worked so far, and the bug could have had worse incarnations that the current clear hang if a certain generic codepath is touched in a perfectly valid way. Does CONFIG_DEBUG_MUTEXES (or any of the other debugging options) make any noise? Ingo From akpm at osdl.org Tue Jan 17 19:47:11 2006 From: akpm at osdl.org (Andrew Morton) Date: Tue, 17 Jan 2006 00:47:11 -0800 Subject: 2.6.15-mm4 failure on power5 In-Reply-To: <20060117081749.GA10135@elte.hu> References: <20060116063530.GB23399@sergelap.austin.ibm.com> <20060115230557.0f07a55c.akpm@osdl.org> <200601170000.58134.michael@ellerman.id.au> <20060116153748.GA25866@sergelap.austin.ibm.com> <20060116215252.GA10538@cs.umn.edu> <20060116170907.60149236.akpm@osdl.org> <20060117081749.GA10135@elte.hu> Message-ID: <20060117004711.1f4508cd.akpm@osdl.org> Ingo Molnar wrote: > > > * Andrew Morton wrote: > > > > If I revert just that patch, mm4 boots fine. Its really not obvious to > > > me at all why that patch is breaking things though... > > > > Yes, that is strange. I do recall that if something accidentally > > enables interrupts too early in boot, ppc64 machines tend to go > > comatose. But if we'd been running that code under > > local_irq_disable(), down() would have spat a warning. > > perhaps it was just luck it worked so far, and the bug could have had > worse incarnations that the current clear hang if a certain generic > codepath is touched in a perfectly valid way. Does CONFIG_DEBUG_MUTEXES > (or any of the other debugging options) make any noise? > The bug happens on the G5 too. There's nothing useful on the screen, nothing on netconsole. Could the people whose machines have a fscking serial port please try CONFIG_DEBUG_MUTEXES? From hch at lst.de Tue Jan 17 21:14:06 2006 From: hch at lst.de (Christoph Hellwig) Date: Tue, 17 Jan 2006 11:14:06 +0100 Subject: [RFC/PATCH 2/12] powerpc: Remove #ifdef ISERIES from __raw_* accessors in io.h In-Reply-To: <20060117032222.E3DD9689CD@ozlabs.org> References: <1137468121.172522.474053389273.qpush@concordia> <20060117032222.E3DD9689CD@ozlabs.org> Message-ID: <20060117101406.GA23484@lst.de> > +static inline unsigned char __raw_readb(const volatile void __iomem *addr) > +{ > + if (firmware_has_feature(FW_FEATURE_ISERIES)) > + BUG(); /* raw accessors aren't supported on iSeries */ > + > + return *(volatile unsigned char __force *)addr; > +} Actually ?his is still wrong. You must support these as they are part of the Linux driver API. Even if that means endianess swap the value back and still doing all the barriers the full versions do. From hch at lst.de Tue Jan 17 21:14:56 2006 From: hch at lst.de (Christoph Hellwig) Date: Tue, 17 Jan 2006 11:14:56 +0100 Subject: [RFC/PATCH 3/12] powerpc: Remove #ifdef ISERIES from readb/writeb etc. in io.h In-Reply-To: <20060117032228.CB9B7689D6@ozlabs.org> References: <1137468121.172522.474053389273.qpush@concordia> <20060117032228.CB9B7689D6@ozlabs.org> Message-ID: <20060117101456.GB23484@lst.de> On Tue, Jan 17, 2006 at 02:22:14PM +1100, Michael Ellerman wrote: > Convert readb/writeb etc. to be compilable on a combined kernel. this will bloat the kernel quite horribly I suspect. Either move them out of line or at least find a way to optimize away the dead code for normal builds. From sfr at canb.auug.org.au Tue Jan 17 21:31:19 2006 From: sfr at canb.auug.org.au (Stephen Rothwell) Date: Tue, 17 Jan 2006 21:31:19 +1100 Subject: [RFC/PATCH 3/12] powerpc: Remove #ifdef ISERIES from readb/writeb etc. in io.h In-Reply-To: <20060117101456.GB23484@lst.de> References: <1137468121.172522.474053389273.qpush@concordia> <20060117032228.CB9B7689D6@ozlabs.org> <20060117101456.GB23484@lst.de> Message-ID: <20060117213119.6796acd2.sfr@canb.auug.org.au> On Tue, 17 Jan 2006 11:14:56 +0100 Christoph Hellwig wrote: > > On Tue, Jan 17, 2006 at 02:22:14PM +1100, Michael Ellerman wrote: > > Convert readb/writeb etc. to be compilable on a combined kernel. > > this will bloat the kernel quite horribly I suspect. Either move them > out of line or at least find a way to optimize away the dead code for > normal builds. That's excatly what this does. If you build with CONFIG_PPC_ISERIES not set, then firmware_has_feature(FW_FEATURE_ISERIES) is constant 0. If you build for iSeries only, then firmware_has_feature(FW_FEATURE_ISERIES) is constant 1. -- Cheers, Stephen Rothwell sfr at canb.auug.org.au http://www.canb.auug.org.au/~sfr/ -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: not available Url : http://ozlabs.org/pipermail/linuxppc64-dev/attachments/20060117/045539ea/attachment.pgp From david at gibson.dropbear.id.au Tue Jan 17 21:32:47 2006 From: david at gibson.dropbear.id.au (David Gibson) Date: Tue, 17 Jan 2006 21:32:47 +1100 Subject: [RFC/PATCH 2/12] powerpc: Remove #ifdef ISERIES from __raw_* accessors in io.h In-Reply-To: <20060117101406.GA23484@lst.de> References: <1137468121.172522.474053389273.qpush@concordia> <20060117032222.E3DD9689CD@ozlabs.org> <20060117101406.GA23484@lst.de> Message-ID: <20060117103247.GA14125@localhost.localdomain> On Tue, Jan 17, 2006 at 11:14:06AM +0100, Christoph Hellwig wrote: > > +static inline unsigned char __raw_readb(const volatile void __iomem *addr) > > +{ > > + if (firmware_has_feature(FW_FEATURE_ISERIES)) > > + BUG(); /* raw accessors aren't supported on iSeries */ > > + > > + return *(volatile unsigned char __force *)addr; > > +} > > Actually ?his is still wrong. You must support these as they are part > of the Linux driver API. Even if that means endianess swap the value > back and still doing all the barriers the full versions do. If no-one's hit this on legacy iSeries so far, it's staggeringly unlikely they ever will. These machines have no real IO, it's all virtual. -- David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson From david at gibson.dropbear.id.au Tue Jan 17 21:33:38 2006 From: david at gibson.dropbear.id.au (David Gibson) Date: Tue, 17 Jan 2006 21:33:38 +1100 Subject: [RFC/PATCH 3/12] powerpc: Remove #ifdef ISERIES from readb/writeb etc. in io.h In-Reply-To: <20060117101456.GB23484@lst.de> References: <1137468121.172522.474053389273.qpush@concordia> <20060117032228.CB9B7689D6@ozlabs.org> <20060117101456.GB23484@lst.de> Message-ID: <20060117103338.GB14125@localhost.localdomain> On Tue, Jan 17, 2006 at 11:14:56AM +0100, Christoph Hellwig wrote: > On Tue, Jan 17, 2006 at 02:22:14PM +1100, Michael Ellerman wrote: > > Convert readb/writeb etc. to be compilable on a combined kernel. > > this will bloat the kernel quite horribly I suspect. Either move them > out of line or at least find a way to optimize away the dead code for > normal builds. It already will be, firmware_has_feature() will resolve at compile time unless both CONFIG_MULTIPLATFORM and CONFIG_ISERIES are defined. -- David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson From sfr at canb.auug.org.au Tue Jan 17 21:34:55 2006 From: sfr at canb.auug.org.au (Stephen Rothwell) Date: Tue, 17 Jan 2006 21:34:55 +1100 Subject: [RFC/PATCH 2/12] powerpc: Remove #ifdef ISERIES from __raw_* accessors in io.h In-Reply-To: <20060117101406.GA23484@lst.de> References: <1137468121.172522.474053389273.qpush@concordia> <20060117032222.E3DD9689CD@ozlabs.org> <20060117101406.GA23484@lst.de> Message-ID: <20060117213455.3776b4d7.sfr@canb.auug.org.au> On Tue, 17 Jan 2006 11:14:06 +0100 Christoph Hellwig wrote: > > > +static inline unsigned char __raw_readb(const volatile void __iomem *addr) > > +{ > > + if (firmware_has_feature(FW_FEATURE_ISERIES)) > > + BUG(); /* raw accessors aren't supported on iSeries */ > > + > > + return *(volatile unsigned char __force *)addr; > > +} > > Actually ?his is still wrong. You must support these as they are part > of the Linux driver API. Even if that means endianess swap the value > back and still doing all the barriers the full versions do. These have never been supported on iSeries so the drivers for the (fairly tightly controlled) set of hardware that will run on iSeries obviously don't need them. iSeries is a legacy platform ... -- Cheers, Stephen Rothwell sfr at canb.auug.org.au http://www.canb.auug.org.au/~sfr/ -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: not available Url : http://ozlabs.org/pipermail/linuxppc64-dev/attachments/20060117/ac46ed0a/attachment.pgp From arnd at arndb.de Tue Jan 17 21:38:46 2006 From: arnd at arndb.de (Arnd Bergmann) Date: Tue, 17 Jan 2006 11:38:46 +0100 Subject: [RFC/PATCH 2/12] powerpc: Remove #ifdef ISERIES from __raw_* accessors in io.h In-Reply-To: <20060117045932.GH1557@localhost.localdomain> References: <1137468121.172522.474053389273.qpush@concordia> <20060117032222.E3DD9689CD@ozlabs.org> <20060117045932.GH1557@localhost.localdomain> Message-ID: <200601171138.47000.arnd@arndb.de> On Tuesday 17 January 2006 05:59, David Gibson wrote: > > +static inline unsigned char __raw_readb(const volatile void __iomem *addr) > > +{ > > +?????if (firmware_has_feature(FW_FEATURE_ISERIES)) > > +?????????????BUG();??/* raw accessors aren't supported on iSeries > > */ > > BUG_ON() would seem reasonable here.. > Actually, I think not. The result of firmware_has_features(FW_FEATURE_ISERIES) should normally be a compile-time constant, so the BUG code gets optimized away. If you do BUG_ON(), you force the compiler to emit the code for that anyway, even if it never causes any action to be taken. Arnd <>< From arnd at arndb.de Tue Jan 17 21:41:45 2006 From: arnd at arndb.de (Arnd Bergmann) Date: Tue, 17 Jan 2006 11:41:45 +0100 Subject: [RFC/PATCH 3/12] powerpc: Remove #ifdef ISERIES from readb/writeb etc. in io.h In-Reply-To: <20060117101456.GB23484@lst.de> References: <1137468121.172522.474053389273.qpush@concordia> <20060117032228.CB9B7689D6@ozlabs.org> <20060117101456.GB23484@lst.de> Message-ID: <200601171141.45853.arnd@arndb.de> On Tuesday 17 January 2006 11:14, Christoph Hellwig wrote: > this will bloat the kernel quite horribly I suspect. ?Either move them > out of line or at least find a way to optimize away the dead code for > normal builds. firmware_has_feature() normally is a compile-time check, so it won't bloat the kernel unless you enable both iSeries and multiplatform, which is not possible yet. Arnd <>< From david at gibson.dropbear.id.au Tue Jan 17 21:47:47 2006 From: david at gibson.dropbear.id.au (David Gibson) Date: Tue, 17 Jan 2006 21:47:47 +1100 Subject: [RFC/PATCH 2/12] powerpc: Remove #ifdef ISERIES from __raw_* accessors in io.h In-Reply-To: <200601171138.47000.arnd@arndb.de> References: <1137468121.172522.474053389273.qpush@concordia> <20060117032222.E3DD9689CD@ozlabs.org> <20060117045932.GH1557@localhost.localdomain> <200601171138.47000.arnd@arndb.de> Message-ID: <20060117104747.GC14125@localhost.localdomain> On Tue, Jan 17, 2006 at 11:38:46AM +0100, Arnd Bergmann wrote: > On Tuesday 17 January 2006 05:59, David Gibson wrote: > > > +static inline unsigned char __raw_readb(const volatile void __iomem *addr) > > > +{ > > > +?????if (firmware_has_feature(FW_FEATURE_ISERIES)) > > > +?????????????BUG();??/* raw accessors aren't supported on iSeries > > > */ > > > > BUG_ON() would seem reasonable here.. > > > Actually, I think not. The result of > firmware_has_features(FW_FEATURE_ISERIES) should normally be > a compile-time constant, so the BUG code gets optimized away. > If you do BUG_ON(), you force the compiler to emit the code for > that anyway, even if it never causes any action to be taken. Yes, sfr pointed that out shortly after I sent that. We should fix BUG_ON(), or I'm sure I won't be the last to suggest the change.. -- David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson From apw at shadowen.org Tue Jan 17 21:55:03 2006 From: apw at shadowen.org (Andy Whitcroft) Date: Tue, 17 Jan 2006 10:55:03 +0000 Subject: p650 console stopped working under 2.6.15-git6 In-Reply-To: <20060113225838.GI2846@localhost.localdomain> References: <43C81557.3040808@shadowen.org> <20060113225838.GI2846@localhost.localdomain> Message-ID: <43CCCD07.6090109@shadowen.org> Nathan Lynch wrote: > Is this a partition or a "full system" configuration? This is a partition. > Can you send the full output of the failed boot? Attached. > Any chance you could try a git bisect? Looks like the commit ids > corresponding to the daily snapshots are also on kernel.org alongside > the patches (e.g. 2.6.15-git6.id). Not got much time at the moment chasing other problems. But as it just went into -mm4 I guess it just got more urgent. -apw -------------- next part -------------- A non-text attachment was scrubbed... Name: console.log.raw Type: application/octet-stream Size: 9364 bytes Desc: not available Url : http://ozlabs.org/pipermail/linuxppc64-dev/attachments/20060117/50ba56b2/attachment.obj From serue at us.ibm.com Tue Jan 17 23:22:30 2006 From: serue at us.ibm.com (Serge E. Hallyn) Date: Tue, 17 Jan 2006 06:22:30 -0600 Subject: 2.6.15-mm4 failure on power5 In-Reply-To: <20060116215252.GA10538@cs.umn.edu> References: <20060116063530.GB23399@sergelap.austin.ibm.com> <20060115230557.0f07a55c.akpm@osdl.org> <200601170000.58134.michael@ellerman.id.au> <20060116153748.GA25866@sergelap.austin.ibm.com> <20060116215252.GA10538@cs.umn.edu> Message-ID: <20060117122230.GB20632@sergelap.austin.ibm.com> Quoting Dave C Boutcher (sleddog at us.ibm.com): > On Mon, Jan 16, 2006 at 09:37:48AM -0600, Serge E. Hallyn wrote: > > Quoting Michael Ellerman (michael at ellerman.id.au): > > > On Mon, 16 Jan 2006 18:05, Andrew Morton wrote: > > > > "Serge E. Hallyn" wrote: > > > > > On my power5 partition, 2.6.15-mm4 hangs on boot > > > > boot: quicktest > > Please wait, loading kernel... > > ... > > > Page orders: linear mapping = 24, others = 12 > > -> smp_release_cpus() > > <- smp_release_cpus() > > <- setup_system() > > > > So setup_system() at least finishes, though I don't see the > > printk's at the bottom of that function. > > 2.6.15-mm4 won't boot on my power5 either. I tracked it down to the > following mutex patch from Ingo: kernel-kernel-cpuc-to-mutexes.patch > > If I revert just that patch, mm4 boots fine. Its really not obvious to > me at all why that patch is breaking things though... FWIW this fixes mine as well. -serge From hch at lst.de Tue Jan 17 23:52:11 2006 From: hch at lst.de (Christoph Hellwig) Date: Tue, 17 Jan 2006 13:52:11 +0100 Subject: [patch 0/8] systemsim and hvc_console patches In-Reply-To: <200601151310.14135.arndb@de.ibm.com> References: <20060113183033.696401000@localhost> <20060114030907.GP2491@pb15.lixom.net> <200601151310.14135.arndb@de.ibm.com> Message-ID: <20060117125211.GA26550@lst.de> On Sun, Jan 15, 2006 at 01:10:13PM +0000, Arnd Bergmann wrote: > I think systemsim does have accurate models for a number of IDE and > network devices, but I would rather not have to use them because they will > run at a horribly slow speed, because they try to model the performance > of the devices relative to the CPU cycles. > > For the cell simulator in particular, I think there is no model of the > spider-pic interrupt controller, which means that systemsim can not use > the models for the devices it uses on other platforms. Eric, is this still > correct? So please add support for vioscsi and vioeth. IBM already supports these virtual storage and network devices and we don't need to add yet more. There's already more than enough of these virtual or simulated hardware drivers in the tree. From michael at ellerman.id.au Wed Jan 18 00:32:43 2006 From: michael at ellerman.id.au (Michael Ellerman) Date: Wed, 18 Jan 2006 00:32:43 +1100 Subject: 2.6.15-mm4 failure on power5 In-Reply-To: <20060116215252.GA10538@cs.umn.edu> References: <20060116063530.GB23399@sergelap.austin.ibm.com> <20060116153748.GA25866@sergelap.austin.ibm.com> <20060116215252.GA10538@cs.umn.edu> Message-ID: <200601180032.46867.michael@ellerman.id.au> On Tue, 17 Jan 2006 08:52, Dave C Boutcher wrote: > 2.6.15-mm4 won't boot on my power5 either. I tracked it down to the > following mutex patch from Ingo: kernel-kernel-cpuc-to-mutexes.patch > > If I revert just that patch, mm4 boots fine. Its really not obvious to > me at all why that patch is breaking things though... My POWER5 (gr) LPAR seems to boot ok (3 times so far) with that patch, guess it's something subtle. That's with CONFIG_DEBUG_MUTEXES=y. And it's just booted once with CONFIG_DEBUG_MUTEXES=n. And now it's booted the full mm4 patch set without blinking. cheers -- Michael Ellerman IBM OzLabs email: michael:ellerman.id.au inmsg: mpe:jabber.org wwweb: http://michael.ellerman.id.au phone: +61 2 6212 1183 (tie line 70 21183) We do not inherit the earth from our ancestors, we borrow it from our children. - S.M.A.R.T Person -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: not available Url : http://ozlabs.org/pipermail/linuxppc64-dev/attachments/20060118/a34c6adc/attachment.pgp From mingo at elte.hu Wed Jan 18 01:00:50 2006 From: mingo at elte.hu (Ingo Molnar) Date: Tue, 17 Jan 2006 15:00:50 +0100 Subject: 2.6.15-mm4 failure on power5 In-Reply-To: <200601180032.46867.michael@ellerman.id.au> References: <20060116063530.GB23399@sergelap.austin.ibm.com> <20060116153748.GA25866@sergelap.austin.ibm.com> <20060116215252.GA10538@cs.umn.edu> <200601180032.46867.michael@ellerman.id.au> Message-ID: <20060117140050.GA13188@elte.hu> * Michael Ellerman wrote: > On Tue, 17 Jan 2006 08:52, Dave C Boutcher wrote: > > 2.6.15-mm4 won't boot on my power5 either. I tracked it down to the > > following mutex patch from Ingo: kernel-kernel-cpuc-to-mutexes.patch > > > > If I revert just that patch, mm4 boots fine. Its really not obvious to > > me at all why that patch is breaking things though... > > My POWER5 (gr) LPAR seems to boot ok (3 times so far) with that patch, > guess it's something subtle. That's with CONFIG_DEBUG_MUTEXES=y. And > it's just booted once with CONFIG_DEBUG_MUTEXES=n. > > And now it's booted the full mm4 patch set without blinking. so it booted fine with CONFIG_DEBUG_MUTEXES=n but with that patch not applied? the patch will likely work around the bug, so DEBUG_MUTEXES=y/n should make no difference with that patch applied. Ingo From will_schmidt at vnet.ibm.com Wed Jan 18 01:42:49 2006 From: will_schmidt at vnet.ibm.com (will schmidt) Date: Tue, 17 Jan 2006 08:42:49 -0600 Subject: 2.6.15 failure on power4 iSeries In-Reply-To: <200601171122.14283.michael@ellerman.id.au> References: <43CC2DCC.6010201@vnet.ibm.com> <200601171122.14283.michael@ellerman.id.au> Message-ID: <43CD0269.6060909@vnet.ibm.com> Michael Ellerman wrote: > On Tue, 17 Jan 2006 10:35, will schmidt wrote: > >>attempting to boot current kernels on a power4 iSeries doesnt work. have >>tried both the powerpc-git tree and the torvalds-git tree. >> >>OS/400 RefCode is "C200 82FF". (which means nothing to me :-) > > C20082FF VSP IPL complete successfully > >>no console output at all. > > Enable early debugging for iSeries (now via Kconfig, under Kernel hacking), > then enable DEBUG in platforms/iseries/* and kernel/setup_64.c, then when it > dies hit "ctrl-x ctrl-x" and see if you get any output. > -> early_setup() Probing machine type for platform 201... Found, Initializing memory management... <- early_setup() -> setup_system() -> initialize_cache_info() <- initialize_cache_info() -> iSeries_init_early() <- iSeries_init_early() Mapping load area - physical addr = 0000000000000000 absolute addr = 0000000018000000 Load area size 32768K HPT absolute addr = 000000014a000000, size = 32768K Mainstore_VPD: Regatta ms_vpd: processing area 0 blocks=1 block 0 absStart=8000000000000000 absEnd=8000000100000000 ms_vpd: processing area 1 blocks=1 block 0 absStart=8000000100000000 absEnd=8000000200000000 ms_vpd: processing area 2 blocks=1 block 0 absStart=8000000200000000 absEnd=8000000280000000 ms_vpd: 3 sorted memory blocks Bitmap range: 0000000000000000 - 0000000100000000 Absolute range: 8000000000000000 - 8000000100000000 Bitmap range: 0000000100000000 - 0000000200000000 Absolute range: 8000000100000000 - 8000000200000000 Bitmap range: 0000000200000000 - 0000000280000000 Absolute range: 8000000200000000 - 8000000280000000 Mainstore_VPD: numMemoryBlocks = 3 Mainstore_VPD: block 0 logical chunks 0000000000000000 - 0000000000004000 abs chunks 0000000000000000 - 0000000000004000 Mainstore_VPD: block 1 logical chunks 0000000000004000 - 0000000000008000 abs chunks 0000000000004000 - 0000000000008000 Mainstore_VPD: block 2 logical chunks 0000000000008000 - 000000000000a000 abs chunks 0000000000008000 - 000000000000a000 Page orders: linear mapping = 12, others = 12 mf.c: iSeries Linux LPAR Machine Facilities initialized -> smp_release_cpus() <- smp_release_cpus() <- setup_system() This looks like the "2.6.15-mm4 failure on power5" output.. but I dont see a *cpuc-to-mutexes.patch in this tree to back out. (torvalds-git) Will clean my glasses and look closer in a bit.. :-) -Will > >>did a bunch of git bisects in the torvalds tree to try and narrow this >>down. came up with this: >>----- >>cc5d0189b9ba95260857a5018a1c2fef90008507 is first bad commit >>diff-tree cc5d0189b9ba95260857a5018a1c2fef90008507 (from >>9cf84d7c97992dbe5360b241327341c07ce30fc9) Author: Benjamin Herrenschmidt >> >>Date: Tue Dec 13 18:01:21 2005 +1100 >> >> [PATCH] powerpc: Remove device_node addrs/n_addr > > > Hmm, that doesn't touch iSeries code at all - but anything's possible I guess. > > cheers > From will_schmidt at vnet.ibm.com Wed Jan 18 02:52:07 2006 From: will_schmidt at vnet.ibm.com (will schmidt) Date: Tue, 17 Jan 2006 09:52:07 -0600 Subject: [RFC/PATCH 2/12] powerpc: Remove #ifdef ISERIES from __raw_* accessors in io.h In-Reply-To: <20060117103247.GA14125@localhost.localdomain> References: <1137468121.172522.474053389273.qpush@concordia> <20060117032222.E3DD9689CD@ozlabs.org> <20060117101406.GA23484@lst.de> <20060117103247.GA14125@localhost.localdomain> Message-ID: <43CD12A7.2080802@vnet.ibm.com> David Gibson wrote: > On Tue, Jan 17, 2006 at 11:14:06AM +0100, Christoph Hellwig wrote: > >>>+static inline unsigned char __raw_readb(const volatile void __iomem *addr) >>>+{ >>>+ if (firmware_has_feature(FW_FEATURE_ISERIES)) >>>+ BUG(); /* raw accessors aren't supported on iSeries */ >>>+ >>>+ return *(volatile unsigned char __force *)addr; >>>+} >> >>Actually ~his is still wrong. You must support these as they are part >>of the Linux driver API. Even if that means endianess swap the value >>back and still doing all the barriers the full versions do. > > > If no-one's hit this on legacy iSeries so far, it's staggeringly > unlikely they ever will. These machines have no real IO, it's all > virtual. > Confirming what both of you said... The defines were originally added so that folks could build both iseries and pseries kernels against a common list of modules. (IIRC, This was by request from one of the distros). The defines only exist to avoid the build errors. > > > ------------------------------------------------------------------------ > > _______________________________________________ > Linuxppc64-dev mailing list > Linuxppc64-dev at ozlabs.org > https://ozlabs.org/mailman/listinfo/linuxppc64-dev From sleddog at us.ibm.com Wed Jan 18 03:52:44 2006 From: sleddog at us.ibm.com (Dave C Boutcher) Date: Tue, 17 Jan 2006 10:52:44 -0600 Subject: 2.6.15-mm4 failure on power5 In-Reply-To: <20060117081749.GA10135@elte.hu> References: <20060116063530.GB23399@sergelap.austin.ibm.com> <20060115230557.0f07a55c.akpm@osdl.org> <200601170000.58134.michael@ellerman.id.au> <20060116153748.GA25866@sergelap.austin.ibm.com> <20060116215252.GA10538@cs.umn.edu> <20060116170907.60149236.akpm@osdl.org> <20060117081749.GA10135@elte.hu> Message-ID: <20060117165244.GA23254@cs.umn.edu> On Tue, Jan 17, 2006 at 09:17:49AM +0100, Ingo Molnar wrote: > > * Andrew Morton wrote: > > > > If I revert just that patch, mm4 boots fine. Its really not obvious to > > > me at all why that patch is breaking things though... > > > > Yes, that is strange. I do recall that if something accidentally > > enables interrupts too early in boot, ppc64 machines tend to go > > comatose. But if we'd been running that code under > > local_irq_disable(), down() would have spat a warning. > > perhaps it was just luck it worked so far, and the bug could have had > worse incarnations that the current clear hang if a certain generic > codepath is touched in a perfectly valid way. Does CONFIG_DEBUG_MUTEXES > (or any of the other debugging options) make any noise? Well, it turns out that I've been running with CONFIG_DEBUG_MUTEXES all along...so no noise. My console output is a little different that Serge's, so I think this is timing related. Also note that I'm dying in the timer interrupt... Please wait, loading kernel... Elf64 kernel loaded... Loading ramdisk... ramdisk loaded at 02600000, size: 1212 Kbytes OF stdout device is: /vdevice/vty at 30000000 Hypertas detected, assuming LPAR ! command line: root=/dev/sda3 selinux=0 elevator=cfq memory layout at init: memory_limit : 0000000000000000 (16 MB aligned) alloc_bottom : 000000000272f000 alloc_top : 0000000008000000 alloc_top_hi : 0000000100000000 rmo_top : 0000000008000000 ram_top : 0000000100000000 Looking for displays found display : /pci at 800000020000002/pci at 2,6/pci at 1/display at 0, opening ... doneinstantiating rtas at 0x0000000007734000 ... done 0000000000000000 : boot cpu 0000000000000000 0000000000000002 : starting cpu hw idx 0000000000000002... done 0000000000000004 : starting cpu hw idx 0000000000000004... done 0000000000000006 : starting cpu hw idx 0000000000000006... done copying OF device tree ... Building dt strings... Building dt structure... Device tree strings 0x0000000002a30000 -> 0x0000000002a313f5 Device tree struct 0x0000000002a32000 -> 0x0000000002a42000 Calling quiesce ... returning from prom_init Page orders: linear mapping = 24, others = 12 Found initrd at 0xc000000002600000:0xc00000000272f000 cpu 0x0: Vector: 300 (Data Access) at [c000000000577520] pc: c000000000021064: .timer_interrupt+0xf4/0x440 lr: c000000000021020: .timer_interrupt+0xb0/0x440 sp: c0000000005777a0 msr: 8000000000001032 dar: 10 dsisr: 40000000 current = 0xc0000000005c1150 paca = 0xc0000000005c1d00 pid = 0, comm = swapper enter ? for help 0:mon> -- Dave Boutcher From sleddog at us.ibm.com Wed Jan 18 03:55:55 2006 From: sleddog at us.ibm.com (Dave C Boutcher) Date: Tue, 17 Jan 2006 10:55:55 -0600 Subject: 2.6.15-mm4 failure on power5 In-Reply-To: <20060117165244.GA23254@cs.umn.edu> References: <20060116063530.GB23399@sergelap.austin.ibm.com> <20060115230557.0f07a55c.akpm@osdl.org> <200601170000.58134.michael@ellerman.id.au> <20060116153748.GA25866@sergelap.austin.ibm.com> <20060116215252.GA10538@cs.umn.edu> <20060116170907.60149236.akpm@osdl.org> <20060117081749.GA10135@elte.hu> <20060117165244.GA23254@cs.umn.edu> Message-ID: <20060117165555.GA24562@cs.umn.edu> On Tue, Jan 17, 2006 at 10:52:44AM -0600, Dave C Boutcher wrote: > Well, it turns out that I've been running with CONFIG_DEBUG_MUTEXES all > along...so no noise. My console output is a little different that > Serge's, so I think this is timing related. Also note that I'm dying in > the timer interrupt... duh... here's the backtrace 0:mon> t [c000000000577890] c0000000000034b4 decrementer_common+0xb4/0x100 --- Exception: 901 (Decrementer) at c0000000004627ec .__mutex_lock_interruptible_slowpath+0x3bc/0x4c4 [c000000000577c60] c000000000075064 .__lock_cpu_hotplug+0x44/0xa8 [c000000000577ce0] c000000000075600 .register_cpu_notifier+0x24/0x68 [c000000000577d70] c00000000052cd7c .do_init_bootmem+0x68c/0xab0 [c000000000577e50] c000000000522c84 .setup_arch+0x21c/0x2c0 [c000000000577ef0] c00000000051a538 .start_kernel+0x40/0x280 [c000000000577f90] c000000000008574 .hmt_init+0x0/0x8c -- Dave Boutcher From johnrose at austin.ibm.com Wed Jan 18 06:34:05 2006 From: johnrose at austin.ibm.com (John Rose) Date: Tue, 17 Jan 2006 13:34:05 -0600 Subject: [PATCH 0/9] PCI powerpc hotplug/dlpar: remove dead/stale code In-Reply-To: <20060113172107.GA3569@kroah.com> References: <20060113001556.GX26221@austin.ibm.com> <20060113172107.GA3569@kroah.com> Message-ID: <1137526444.5988.19.camel@sinatra.austin.ibm.com> > John, do you still want to ack/nak every patch for this driver? Or can > I take Linas's patches directly? I'd prefer the former for now. And I'll do my best to be more timely with my ack's in the future. :) Thanks- John From arnd at arndb.de Wed Jan 18 06:25:42 2006 From: arnd at arndb.de (Arnd Bergmann) Date: Tue, 17 Jan 2006 20:25:42 +0100 Subject: [PATCH] powerpc: update cell defconfig Message-ID: <200601172025.42955.arnd@arndb.de> The upstream cell_defconfig has gotten a bit out of sync with what we are using internally here. Change some of the options and update to latest Kconfig options. Signed-off-by: Arnd Bergmann --- Please apply to the powerpc-merge tree. Index: linux-2.6.16-rc/arch/powerpc/configs/cell_defconfig =================================================================== --- linux-2.6.16-rc.orig/arch/powerpc/configs/cell_defconfig +++ linux-2.6.16-rc/arch/powerpc/configs/cell_defconfig @@ -16,6 +16,9 @@ CONFIG_COMPAT=y CONFIG_SYSVIPC_COMPAT=y CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y CONFIG_ARCH_MAY_HAVE_PC_FDC=y +CONFIG_PPC_OF=y +CONFIG_PPC_UDBG_16550=y +# CONFIG_GENERIC_TBSYNC is not set # # Processor support @@ -48,8 +52,6 @@ CONFIG_SYSVIPC=y # CONFIG_BSD_PROCESS_ACCT is not set CONFIG_SYSCTL=y # CONFIG_AUDIT is not set -CONFIG_HOTPLUG=y -CONFIG_KOBJECT_UEVENT=y # CONFIG_IKCONFIG is not set # CONFIG_CPUSETS is not set CONFIG_INITRAMFS_SOURCE="" @@ -58,8 +60,10 @@ CONFIG_CC_OPTIMIZE_FOR_SIZE=y CONFIG_KALLSYMS=y # CONFIG_KALLSYMS_ALL is not set # CONFIG_KALLSYMS_EXTRA_PASS is not set +CONFIG_HOTPLUG=y CONFIG_PRINTK=y CONFIG_BUG=y +CONFIG_ELF_CORE=y CONFIG_BASE_FULL=y CONFIG_FUTEX=y CONFIG_EPOLL=y @@ -68,8 +72,10 @@ CONFIG_CC_ALIGN_FUNCTIONS=0 CONFIG_CC_ALIGN_LABELS=0 CONFIG_CC_ALIGN_LOOPS=0 CONFIG_CC_ALIGN_JUMPS=0 +CONFIG_SLAB=y # CONFIG_TINY_SHMEM is not set CONFIG_BASE_SMALL=0 +# CONFIG_SLOB is not set # # Loadable module support @@ -80,7 +86,7 @@ CONFIG_MODULE_UNLOAD=y CONFIG_OBSOLETE_MODPARM=y # CONFIG_MODVERSIONS is not set # CONFIG_MODULE_SRCVERSION_ALL is not set -# CONFIG_KMOD is not set +CONFIG_KMOD=y CONFIG_STOP_MACHINE=y # @@ -111,8 +117,10 @@ CONFIG_PPC_MULTIPLATFORM=y # CONFIG_PPC_PMAC is not set # CONFIG_PPC_MAPLE is not set CONFIG_PPC_CELL=y -CONFIG_PPC_OF=y +CONFIG_PPC_SYSTEMSIM=y +CONFIG_SYSTEMSIM_IDLE=y # CONFIG_U3_DART is not set +CONFIG_MPIC=y CONFIG_PPC_RTAS=y # CONFIG_RTAS_ERROR_LOGGING is not set CONFIG_RTAS_PROC=y @@ -120,11 +128,17 @@ CONFIG_RTAS_FLASH=y CONFIG_MMIO_NVRAM=y CONFIG_CELL_IIC=y # CONFIG_PPC_MPC106 is not set -# CONFIG_GENERIC_TBSYNC is not set # CONFIG_CPU_FREQ is not set # CONFIG_WANT_EARLY_SERIAL is not set # +# Cell Broadband Engine options +# +CONFIG_BE_DD2=y +CONFIG_SPU_FS=m +CONFIG_SPUFS_MMAP=y + +# # Kernel options # # CONFIG_HZ_100 is not set @@ -140,19 +154,23 @@ CONFIG_BINFMT_ELF=y CONFIG_FORCE_MAX_ZONEORDER=13 # CONFIG_IOMMU_VMERGE is not set CONFIG_KEXEC=y +# CONFIG_CRASH_DUMP is not set CONFIG_IRQ_ALL_CPUS=y # CONFIG_NUMA is not set CONFIG_ARCH_SELECT_MEMORY_MODEL=y CONFIG_ARCH_FLATMEM_ENABLE=y CONFIG_ARCH_SPARSEMEM_ENABLE=y CONFIG_SELECT_MEMORY_MODEL=y -CONFIG_FLATMEM_MANUAL=y +# CONFIG_FLATMEM_MANUAL is not set # CONFIG_DISCONTIGMEM_MANUAL is not set -# CONFIG_SPARSEMEM_MANUAL is not set -CONFIG_FLATMEM=y -CONFIG_FLAT_NODE_MEM_MAP=y +CONFIG_SPARSEMEM_MANUAL=y +CONFIG_SPARSEMEM=y +CONFIG_HAVE_MEMORY_PRESENT=y # CONFIG_SPARSEMEM_STATIC is not set +CONFIG_SPARSEMEM_EXTREME=y +# CONFIG_MEMORY_HOTPLUG is not set CONFIG_SPLIT_PTLOCK_CPUS=4 +CONFIG_MIGRATION=y # CONFIG_PPC_64K_PAGES is not set CONFIG_SCHED_SMT=y CONFIG_PROC_DEVICETREE=y @@ -234,6 +252,7 @@ CONFIG_NETFILTER=y # Core Netfilter Configuration # # CONFIG_NETFILTER_NETLINK is not set +# CONFIG_NETFILTER_XTABLES is not set # # IP: Netfilter Configuration @@ -250,68 +269,11 @@ CONFIG_IP_NF_TFTP=m CONFIG_IP_NF_AMANDA=m # CONFIG_IP_NF_PPTP is not set CONFIG_IP_NF_QUEUE=m -CONFIG_IP_NF_IPTABLES=m -CONFIG_IP_NF_MATCH_LIMIT=m -CONFIG_IP_NF_MATCH_IPRANGE=m -CONFIG_IP_NF_MATCH_MAC=m -CONFIG_IP_NF_MATCH_PKTTYPE=m -CONFIG_IP_NF_MATCH_MARK=m -CONFIG_IP_NF_MATCH_MULTIPORT=m -CONFIG_IP_NF_MATCH_TOS=m -CONFIG_IP_NF_MATCH_RECENT=m -CONFIG_IP_NF_MATCH_ECN=m -CONFIG_IP_NF_MATCH_DSCP=m -CONFIG_IP_NF_MATCH_AH_ESP=m -CONFIG_IP_NF_MATCH_LENGTH=m -CONFIG_IP_NF_MATCH_TTL=m -CONFIG_IP_NF_MATCH_TCPMSS=m -CONFIG_IP_NF_MATCH_HELPER=m -CONFIG_IP_NF_MATCH_STATE=m -CONFIG_IP_NF_MATCH_CONNTRACK=m -CONFIG_IP_NF_MATCH_OWNER=m -CONFIG_IP_NF_MATCH_ADDRTYPE=m -CONFIG_IP_NF_MATCH_REALM=m -CONFIG_IP_NF_MATCH_SCTP=m -# CONFIG_IP_NF_MATCH_DCCP is not set -CONFIG_IP_NF_MATCH_COMMENT=m -CONFIG_IP_NF_MATCH_HASHLIMIT=m -CONFIG_IP_NF_MATCH_STRING=m -CONFIG_IP_NF_FILTER=m -CONFIG_IP_NF_TARGET_REJECT=m -CONFIG_IP_NF_TARGET_LOG=m -CONFIG_IP_NF_TARGET_ULOG=m -CONFIG_IP_NF_TARGET_TCPMSS=m -CONFIG_IP_NF_TARGET_NFQUEUE=m -CONFIG_IP_NF_NAT=m -CONFIG_IP_NF_NAT_NEEDED=y -CONFIG_IP_NF_TARGET_MASQUERADE=m -CONFIG_IP_NF_TARGET_REDIRECT=m -CONFIG_IP_NF_TARGET_NETMAP=m -CONFIG_IP_NF_TARGET_SAME=m -CONFIG_IP_NF_NAT_SNMP_BASIC=m -CONFIG_IP_NF_NAT_IRC=m -CONFIG_IP_NF_NAT_FTP=m -CONFIG_IP_NF_NAT_TFTP=m -CONFIG_IP_NF_NAT_AMANDA=m -CONFIG_IP_NF_MANGLE=m -CONFIG_IP_NF_TARGET_TOS=m -CONFIG_IP_NF_TARGET_ECN=m -CONFIG_IP_NF_TARGET_DSCP=m -CONFIG_IP_NF_TARGET_MARK=m -CONFIG_IP_NF_TARGET_CLASSIFY=m -CONFIG_IP_NF_TARGET_TTL=m -CONFIG_IP_NF_RAW=m -CONFIG_IP_NF_TARGET_NOTRACK=m -CONFIG_IP_NF_ARPTABLES=m -CONFIG_IP_NF_ARPFILTER=m -CONFIG_IP_NF_ARP_MANGLE=m # # IPv6: Netfilter Configuration (EXPERIMENTAL) # # CONFIG_IP6_NF_QUEUE is not set -# CONFIG_IP6_NF_IPTABLES is not set -# CONFIG_IP6_NF_TARGET_NFQUEUE is not set # # DCCP Configuration (EXPERIMENTAL) @@ -331,6 +293,11 @@ CONFIG_IP_NF_ARP_MANGLE=m # CONFIG_ATALK is not set # CONFIG_X25 is not set # CONFIG_LAPB is not set + +# +# TIPC Configuration (EXPERIMENTAL) +# +# CONFIG_TIPC is not set # CONFIG_NET_DIVERT is not set # CONFIG_ECONET is not set # CONFIG_WAN_ROUTER is not set @@ -339,7 +306,6 @@ CONFIG_IP_NF_ARP_MANGLE=m # QoS and/or fair queueing # # CONFIG_NET_SCHED is not set -CONFIG_NET_CLS_ROUTE=y # # Network testing @@ -392,12 +358,13 @@ CONFIG_FW_LOADER=y # CONFIG_BLK_DEV_COW_COMMON is not set CONFIG_BLK_DEV_LOOP=y # CONFIG_BLK_DEV_CRYPTOLOOP is not set -CONFIG_BLK_DEV_NBD=y +# CONFIG_BLK_DEV_NBD is not set # CONFIG_BLK_DEV_SX8 is not set CONFIG_BLK_DEV_RAM=y CONFIG_BLK_DEV_RAM_COUNT=16 CONFIG_BLK_DEV_RAM_SIZE=131072 CONFIG_BLK_DEV_INITRD=y +CONFIG_BLK_DEV_SYSTEMSIM=y # CONFIG_CDROM_PKTCDVD is not set # CONFIG_ATA_OVER_ETH is not set @@ -524,6 +491,7 @@ CONFIG_MII=y # # CONFIG_NET_TULIP is not set # CONFIG_HP100 is not set +CONFIG_SYSTEMSIM_NET=y # CONFIG_NET_PCI is not set # @@ -531,17 +499,19 @@ CONFIG_MII=y # # CONFIG_ACENIC is not set # CONFIG_DL2K is not set -CONFIG_E1000=m +CONFIG_E1000=y # CONFIG_E1000_NAPI is not set # CONFIG_NS83820 is not set # CONFIG_HAMACHI is not set # CONFIG_YELLOWFIN is not set # CONFIG_R8169 is not set # CONFIG_SIS190 is not set -CONFIG_SKGE=m +# CONFIG_SKGE is not set +# CONFIG_SKY2 is not set # CONFIG_SK98LIN is not set # CONFIG_TIGON3 is not set # CONFIG_BNX2 is not set +CONFIG_SPIDER_NET=m # CONFIG_MV643XX_ETH is not set # @@ -627,13 +597,16 @@ CONFIG_VT=y CONFIG_VT_CONSOLE=y CONFIG_HW_CONSOLE=y CONFIG_SERIAL_NONSTANDARD=y +# CONFIG_COMPUTONE is not set # CONFIG_ROCKETPORT is not set # CONFIG_CYCLADES is not set # CONFIG_DIGIEPCA is not set +# CONFIG_MOXA_INTELLIO is not set # CONFIG_MOXA_SMARTIO is not set # CONFIG_ISI is not set # CONFIG_SYNCLINK is not set # CONFIG_SYNCLINKMP is not set +# CONFIG_SYNCLINK_GT is not set # CONFIG_N_HDLC is not set # CONFIG_SPECIALIX is not set # CONFIG_SX is not set @@ -645,6 +618,7 @@ CONFIG_SERIAL_NONSTANDARD=y CONFIG_SERIAL_8250=y CONFIG_SERIAL_8250_CONSOLE=y CONFIG_SERIAL_8250_NR_UARTS=4 +CONFIG_SERIAL_8250_RUNTIME_UARTS=4 # CONFIG_SERIAL_8250_EXTENDED is not set # @@ -652,9 +626,11 @@ CONFIG_SERIAL_8250_NR_UARTS=4 # CONFIG_SERIAL_CORE=y CONFIG_SERIAL_CORE_CONSOLE=y -# CONFIG_SERIAL_JSM is not set CONFIG_UNIX98_PTYS=y # CONFIG_LEGACY_PTYS is not set +CONFIG_HVC_DRIVER=y +CONFIG_HVC_FSS=y +CONFIG_HVC_RTAS=y # # IPMI @@ -671,7 +647,7 @@ CONFIG_WATCHDOG=y # Watchdog Device Drivers # # CONFIG_SOFT_WATCHDOG is not set -# CONFIG_WATCHDOG_RTAS is not set +CONFIG_WATCHDOG_RTAS=y # # PCI-based Watchdog Cards @@ -679,8 +655,7 @@ CONFIG_WATCHDOG=y # CONFIG_PCIPCWATCHDOG is not set # CONFIG_WDTPCI is not set # CONFIG_RTC is not set -CONFIG_GEN_RTC=y -# CONFIG_GEN_RTC_X is not set +# CONFIG_GEN_RTC is not set # CONFIG_DTLK is not set # CONFIG_R3964 is not set # CONFIG_APPLICOM is not set @@ -755,6 +730,12 @@ CONFIG_I2C_ALGOBIT=y # CONFIG_I2C_DEBUG_CHIP is not set # +# SPI support +# +# CONFIG_SPI is not set +# CONFIG_SPI_MASTER is not set + +# # Dallas's 1-wire bus # # CONFIG_W1 is not set @@ -823,7 +804,14 @@ CONFIG_USB_ARCH_HAS_OHCI=y # # InfiniBand support # -# CONFIG_INFINIBAND is not set +CONFIG_INFINIBAND=y +CONFIG_INFINIBAND_USER_MAD=m +CONFIG_INFINIBAND_USER_ACCESS=m +CONFIG_INFINIBAND_MTHCA=m +CONFIG_INFINIBAND_MTHCA_DEBUG=y +CONFIG_INFINIBAND_IPOIB=m +CONFIG_INFINIBAND_IPOIB_DEBUG=y +CONFIG_INFINIBAND_IPOIB_DEBUG_DATA=y # # SN Devices @@ -846,6 +834,7 @@ CONFIG_FS_MBCACHE=y # CONFIG_JFS_FS is not set CONFIG_FS_POSIX_ACL=y # CONFIG_XFS_FS is not set +# CONFIG_OCFS2_FS is not set # CONFIG_MINIX_FS is not set # CONFIG_ROMFS_FS is not set CONFIG_INOTIFY=y @@ -885,6 +874,7 @@ CONFIG_HUGETLBFS=y CONFIG_HUGETLB_PAGE=y CONFIG_RAMFS=y # CONFIG_RELAYFS_FS is not set +# CONFIG_CONFIGFS_FS is not set # # Miscellaneous filesystems @@ -950,6 +940,7 @@ CONFIG_MSDOS_PARTITION=y # CONFIG_SGI_PARTITION is not set # CONFIG_ULTRIX_PARTITION is not set # CONFIG_SUN_PARTITION is not set +# CONFIG_KARMA_PARTITION is not set CONFIG_EFI_PARTITION=y # @@ -1005,10 +996,6 @@ CONFIG_CRC32=y # CONFIG_LIBCRC32C is not set CONFIG_ZLIB_INFLATE=m CONFIG_ZLIB_DEFLATE=m -CONFIG_TEXTSEARCH=y -CONFIG_TEXTSEARCH_KMP=m -CONFIG_TEXTSEARCH_BM=m -CONFIG_TEXTSEARCH_FSM=m # # Instrumentation Support @@ -1020,18 +1007,20 @@ CONFIG_TEXTSEARCH_FSM=m # Kernel hacking # # CONFIG_PRINTK_TIME is not set -CONFIG_DEBUG_KERNEL=y CONFIG_MAGIC_SYSRQ=y +CONFIG_DEBUG_KERNEL=y CONFIG_LOG_BUF_SHIFT=15 CONFIG_DETECT_SOFTLOCKUP=y # CONFIG_SCHEDSTATS is not set # CONFIG_DEBUG_SLAB is not set +CONFIG_DEBUG_MUTEXES=y # CONFIG_DEBUG_SPINLOCK is not set CONFIG_DEBUG_SPINLOCK_SLEEP=y # CONFIG_DEBUG_KOBJECT is not set # CONFIG_DEBUG_INFO is not set CONFIG_DEBUG_FS=y # CONFIG_DEBUG_VM is not set +# CONFIG_FORCED_INLINING is not set # CONFIG_RCU_TORTURE_TEST is not set # CONFIG_DEBUG_STACKOVERFLOW is not set # CONFIG_DEBUG_STACK_USAGE is not set @@ -1039,6 +1028,11 @@ CONFIG_DEBUGGER=y # CONFIG_XMON is not set CONFIG_IRQSTACKS=y # CONFIG_BOOTX_TEXT is not set +# CONFIG_PPC_EARLY_DEBUG_LPAR is not set +# CONFIG_PPC_EARLY_DEBUG_G5 is not set +# CONFIG_PPC_EARLY_DEBUG_RTAS is not set +# CONFIG_PPC_EARLY_DEBUG_MAPLE is not set +# CONFIG_PPC_EARLY_DEBUG_ISERIES is not set # # Security options From arnd at arndb.de Wed Jan 18 06:32:39 2006 From: arnd at arndb.de (Arnd Bergmann) Date: Tue, 17 Jan 2006 20:32:39 +0100 Subject: [PATCH] powerpc: declare arch syscalls in Message-ID: <200601172032.39521.arnd@arndb.de> powerpc currently declares some of its own system calls in , but not all of them. That place also contains remainders of the now almost unused kernel syscall hack. - Add a new with clean declarations - Include that file from every source that implements one of these - Get rid of old declarations in This patch is required as a base for implementing system calls from an SPU, but also makes sense as a general cleanup. Signed-off-by: Arnd Bergmann --- Please apply to the powerpc.git tree if you like it. Index: linux-2.6.16-rc/include/asm-powerpc/syscalls.h =================================================================== --- /dev/null +++ linux-2.6.16-rc/include/asm-powerpc/syscalls.h @@ -0,0 +1,59 @@ +#ifndef __ASM_POWERPC_SYSCALLS_H +#define __ASM_POWERPC_SYSCALLS_H +#ifdef __KERNEL__ + +#include +#include +#include +#include + +struct new_utsname; +struct pt_regs; +struct rtas_args; +struct sigaction; + +asmlinkage unsigned long sys_mmap(unsigned long addr, size_t len, + unsigned long prot, unsigned long flags, + unsigned long fd, off_t offset); +asmlinkage unsigned long sys_mmap2(unsigned long addr, size_t len, + unsigned long prot, unsigned long flags, + unsigned long fd, unsigned long pgoff); +asmlinkage int sys_execve(unsigned long a0, unsigned long a1, + unsigned long a2, unsigned long a3, unsigned long a4, + unsigned long a5, struct pt_regs *regs); +asmlinkage int sys_clone(unsigned long clone_flags, unsigned long usp, + int __user *parent_tidp, void __user *child_threadptr, + int __user *child_tidp, int p6, struct pt_regs *regs); +asmlinkage int sys_fork(unsigned long p1, unsigned long p2, + unsigned long p3, unsigned long p4, unsigned long p5, + unsigned long p6, struct pt_regs *regs); +asmlinkage int sys_vfork(unsigned long p1, unsigned long p2, + unsigned long p3, unsigned long p4, unsigned long p5, + unsigned long p6, struct pt_regs *regs); +asmlinkage int sys_pipe(int __user *fildes); +asmlinkage long sys_rt_sigaction(int sig, + const struct sigaction __user *act, + struct sigaction __user *oact, size_t sigsetsize); +asmlinkage int sys_ipc(uint call, int first, unsigned long second, + long third, void __user *ptr, long fifth); +asmlinkage long ppc64_personality(unsigned long personality); +asmlinkage int ppc_rtas(struct rtas_args __user *uargs); +asmlinkage time_t sys64_time(time_t __user * tloc); +asmlinkage long ppc_newuname(struct new_utsname __user * name); + +asmlinkage long sys_rt_sigsuspend(sigset_t __user *unewset, + size_t sigsetsize, int p3, int p4, + int p6, int p7, struct pt_regs *regs); + +#ifndef __powerpc64__ +asmlinkage long sys_sigaltstack(const stack_t __user *uss, + stack_t __user *uoss, int r5, int r6, int r7, int r8, + struct pt_regs *regs); +#else /* __powerpc64__ */ +asmlinkage long sys_sigaltstack(const stack_t __user *uss, + stack_t __user *uoss, unsigned long r5, unsigned long r6, + unsigned long r7, unsigned long r8, struct pt_regs *regs); +#endif /* __powerpc64__ */ + +#endif /* __KERNEL__ */ +#endif /* __ASM_POWERPC_SYSCALLS_H */ Index: linux-2.6.16-rc/include/asm-powerpc/unistd.h =================================================================== --- linux-2.6.16-rc.orig/include/asm-powerpc/unistd.h +++ linux-2.6.16-rc/include/asm-powerpc/unistd.h @@ -422,6 +422,7 @@ type name(type1 arg1, type2 arg2, type3 #include #include #include +#include #define __ARCH_WANT_IPC_PARSE_VERSION #define __ARCH_WANT_OLD_READDIR @@ -455,44 +456,10 @@ type name(type1 arg1, type2 arg2, type3 * System call prototypes. */ #ifdef __KERNEL_SYSCALLS__ -extern pid_t setsid(void); -extern int write(int fd, const char *buf, off_t count); -extern int read(int fd, char *buf, off_t count); -extern off_t lseek(int fd, off_t offset, int count); -extern int dup(int fd); extern int execve(const char *file, char **argv, char **envp); -extern int open(const char *file, int flag, int mode); -extern int close(int fd); -extern pid_t waitpid(pid_t pid, int *wait_stat, int options); #endif /* __KERNEL_SYSCALLS__ */ /* - * Functions that implement syscalls. - */ -unsigned long sys_mmap(unsigned long addr, size_t len, unsigned long prot, - unsigned long flags, unsigned long fd, off_t offset); -unsigned long sys_mmap2(unsigned long addr, size_t len, - unsigned long prot, unsigned long flags, - unsigned long fd, unsigned long pgoff); -struct pt_regs; -int sys_execve(unsigned long a0, unsigned long a1, unsigned long a2, - unsigned long a3, unsigned long a4, unsigned long a5, - struct pt_regs *regs); -int sys_clone(unsigned long clone_flags, unsigned long usp, - int __user *parent_tidp, void __user *child_threadptr, - int __user *child_tidp, int p6, struct pt_regs *regs); -int sys_fork(unsigned long p1, unsigned long p2, unsigned long p3, - unsigned long p4, unsigned long p5, unsigned long p6, - struct pt_regs *regs); -int sys_vfork(unsigned long p1, unsigned long p2, unsigned long p3, - unsigned long p4, unsigned long p5, unsigned long p6, - struct pt_regs *regs); -int sys_pipe(int __user *fildes); -struct sigaction; -long sys_rt_sigaction(int sig, const struct sigaction __user *act, - struct sigaction __user *oact, size_t sigsetsize); - -/* * "Conditional" syscalls * * What we want is __attribute__((weak,alias("sys_ni_syscall"))), Index: linux-2.6.16-rc/arch/powerpc/kernel/process.c =================================================================== --- linux-2.6.16-rc.orig/arch/powerpc/kernel/process.c +++ linux-2.6.16-rc/arch/powerpc/kernel/process.c @@ -47,6 +47,7 @@ #include #include #include +#include #ifdef CONFIG_PPC64 #include #include Index: linux-2.6.16-rc/arch/powerpc/kernel/rtas.c =================================================================== --- linux-2.6.16-rc.orig/arch/powerpc/kernel/rtas.c +++ linux-2.6.16-rc/arch/powerpc/kernel/rtas.c @@ -31,6 +31,7 @@ #include #include #include +#include struct rtas_t rtas = { .lock = SPIN_LOCK_UNLOCKED Index: linux-2.6.16-rc/arch/powerpc/kernel/signal_32.c =================================================================== --- linux-2.6.16-rc.orig/arch/powerpc/kernel/signal_32.c +++ linux-2.6.16-rc/arch/powerpc/kernel/signal_32.c @@ -42,6 +42,7 @@ #include #include +#include #include #include #ifdef CONFIG_PPC64 Index: linux-2.6.16-rc/arch/powerpc/kernel/signal_64.c =================================================================== --- linux-2.6.16-rc.orig/arch/powerpc/kernel/signal_64.c +++ linux-2.6.16-rc/arch/powerpc/kernel/signal_64.c @@ -35,6 +35,7 @@ #include #include #include +#include #include #define DEBUG_SIG 0 Index: linux-2.6.16-rc/arch/powerpc/kernel/syscalls.c =================================================================== --- linux-2.6.16-rc.orig/arch/powerpc/kernel/syscalls.c +++ linux-2.6.16-rc/arch/powerpc/kernel/syscalls.c @@ -40,6 +40,7 @@ #include #include #include +#include #include #include From arnd at arndb.de Tue Jan 17 10:00:01 2006 From: arnd at arndb.de (Arnd Bergmann) Date: Tue, 17 Jan 2006 00:00:01 +0100 Subject: [1/4] [FYI] Performance hacks for broken Cell CPU revisions References: <20060117195650.419158000@klappe.arndb.de> Message-ID: <20060117200253.463516000@klappe.arndb.de> An embedded and charset-unspecified text was scrubbed... Name: dd2-performance.diff Url: http://ozlabs.org/pipermail/linuxppc64-dev/attachments/20060117/8393b0a7/attachment.txt From arnd at arndb.de Tue Jan 17 10:00:02 2006 From: arnd at arndb.de (Arnd Bergmann) Date: Tue, 17 Jan 2006 00:00:02 +0100 Subject: [2/4] [FYI] cell: Hack to create struct page .ICE-unix .X0-lock .X11-unix NLPaaa.tmp NLPbaa.tmp NLPcaa.tmp ibm.rcp.arnd.3657447818.libjsig.so iwp-log-arnd.txt kde-arnd ksocket-arnd mbox3 patches quilt_mail.T29UU3 quilt_mail.WF8zh5 ssh-LlYEFr3906 xmms_arnd.0 for SPUs References: <20060117195650.419158000@klappe.arndb.de> Message-ID: <20060117200253.607297000@klappe.arndb.de> An embedded and charset-unspecified text was scrubbed... Name: spufs-sparsemem-extreme-2.diff Url: http://ozlabs.org/pipermail/linuxppc64-dev/attachments/20060117/4d453110/attachment.txt From arnd at arndb.de Wed Jan 18 06:56:50 2006 From: arnd at arndb.de (Arnd Bergmann) Date: Tue, 17 Jan 2006 20:56:50 +0100 Subject: [0/4] cell: FYI: the ugly patches Message-ID: <20060117195650.419158000@klappe.arndb.de> This is my collection of stuff that I currently apply on top of 2.6.16-rc1 and the patches I have already sent, but that even I am not mad enough to propose for inclusion. Still, we need them to have a runnable system, and for everyone who is lucky enough to own a cell blade system or similar, you should apply these to your own kernel sources until we come up with a better solution. Arnd <>< From arnd at arndb.de Tue Jan 17 10:00:02 2006 From: arnd at arndb.de (Arnd Bergmann) Date: Tue, 17 Jan 2006 00:00:02 +0100 Subject: [RFC/PATCH 2/3] spufs: implement mfc access for PPE-side DMA References: <20060117194942.647145000@klappe.arndb.de> Message-ID: <20060117195015.435739000@klappe.arndb.de> An embedded and charset-unspecified text was scrubbed... Name: spufs-mfc-file.diff Url: http://ozlabs.org/pipermail/linuxppc64-dev/attachments/20060117/d2e19d16/attachment.txt From arnd at arndb.de Wed Jan 18 06:28:00 2006 From: arnd at arndb.de (Arnd Bergmann) Date: Tue, 17 Jan 2006 20:28:00 +0100 Subject: [RFC] powerpc: cell interrupt controller updates Message-ID: <200601172028.01013.arnd@arndb.de> The current interrupt controller setup on Cell is done in a rather ad-hoc way with device tree properties that are not standardized at all. In an attempt to do something that follows the OF standard (or at least the IBM extensions to it) more closely, we have now come up with this patch. It still provides a fallback to the old behaviour when we find older firmware, that hack can not be removed until the existing customer installations have upgraded. There are a number of difficulties with this patch: - the detection of interrupt controllers per CPU is also used to detect an SMT setup, with the strange 'ibm,interrupt-server-ranges' property. - OF does not currently deal with SMT, the IBM extension for this is specific to the XICS interrupt controller. - The setup on our current boards consists of two actual internal interrupt controllers on the CPUs, which are represented as four logical ones (one per thread), as well as two external 'spiderpic' controllers. In future designs, the spiderpic will be replaced with something else. - ... Cc: hpenner at de.ibm.com Cc: stk at de.ibm.com Cc: Segher Boessenkool Cc: Milton Miller Cc: benh at kernel.crashing.org From: Jens Osterkamp Signed-off-by: Arnd Bergmann --- The point of this patch is to get the discussion started about how it should be done. Since I will be mostly offline for the next few weeks during my stay in New Zealand, I hope that Jens will take care of this. Index: linux-2.6.16-rc/arch/powerpc/platforms/cell/spider-pic.c =================================================================== --- linux-2.6.16-rc.orig/arch/powerpc/platforms/cell/spider-pic.c +++ linux-2.6.16-rc/arch/powerpc/platforms/cell/spider-pic.c @@ -84,10 +84,11 @@ static void __iomem *spider_get_irq_conf static void spider_enable_irq(unsigned int irq) { + int nodeid = (irq / IIC_NODE_STRIDE) * 0x10; void __iomem *cfg = spider_get_irq_config(irq); irq = spider_get_nr(irq); - out_be32(cfg, in_be32(cfg) | 0x3107000eu); + out_be32(cfg, in_be32(cfg) | 0x3107000eu | nodeid); out_be32(cfg + 4, in_be32(cfg + 4) | 0x00020000u | irq); } @@ -131,61 +132,107 @@ static struct hw_interrupt_type spider_p .end = spider_end_irq, }; - -int spider_get_irq(unsigned long int_pending) +int spider_get_irq(int node) { - void __iomem *regs = spider_get_pic(int_pending); unsigned long cs; - int irq; - - cs = in_be32(regs + TIR_CS); + void __iomem *regs = spider_pics[node]; - irq = cs >> 24; - if (irq != 63) - return irq; + cs = in_be32(regs + TIR_CS) >> 24; - return -1; + if (cs == 63) + return -1; + else + return cs; } - -void spider_init_IRQ(void) + +/* hardcoded part to be compatible with older firmware */ + +void spider_init_IRQ_hardcoded(void) { int node; - struct device_node *dn; - unsigned int *property; long spiderpic; + long pics[] = { 0x24000008000, 0x34000008000 }; int n; -/* FIXME: detect multiple PICs as soon as the device tree has them */ - for (node = 0; node < 1; node++) { - dn = of_find_node_by_path("/"); - n = prom_n_addr_cells(dn); - property = (unsigned int *) get_property(dn, - "platform-spider-pic", NULL); + pr_debug("%s(%d): Using hardcoded defaults\n", __FUNCTION__, __LINE__); - if (!property) - continue; - for (spiderpic = 0; n > 0; --n) - spiderpic = (spiderpic << 32) + *property++; + for (node = 0; node < num_present_cpus()/2; node++) { + spiderpic = pics[node]; printk(KERN_DEBUG "SPIDER addr: %lx\n", spiderpic); spider_pics[node] = __ioremap(spiderpic, 0x800, _PAGE_NO_CACHE); for (n = 0; n < IIC_NUM_EXT; n++) { int irq = n + IIC_EXT_OFFSET + node * IIC_NODE_STRIDE; get_irq_desc(irq)->handler = &spider_pic; + } /* do not mask any interrupts because of level */ out_be32(spider_pics[node] + TIR_MSK, 0x0); - + /* disable edge detection clear */ /* out_be32(spider_pics[node] + TIR_EDC, 0x0); */ - + /* enable interrupt packets to be output */ out_be32(spider_pics[node] + TIR_PIEN, in_be32(spider_pics[node] + TIR_PIEN) | 0x1); - + /* Enable the interrupt detection enable bit. Do this last! */ out_be32(spider_pics[node] + TIR_DEN, - in_be32(spider_pics[node] +TIR_DEN) | 0x1); + in_be32(spider_pics[node] + TIR_DEN) | 0x1); + } +} + +void spider_init_IRQ(void) +{ + long spider_reg; + struct device_node *dn; + char *compatible; + int n, node = 0; + + for (dn = NULL; (dn = of_find_node_by_name(dn, "interrupt-controller"));) { + compatible = (char *)get_property(dn, "compatible", NULL); + if (!compatible) + continue; + + if (strstr(compatible, "CBEA,platform-spider-pic")) + spider_reg = *(long *)get_property(dn,"reg", NULL); + else { + spider_init_IRQ_hardcoded(); + return; } + + if (!spider_reg) + printk("interrupt controller does not have reg property !\n"); + + n = prom_n_addr_cells(dn); + + if ( n != 2) + printk("reg property with invalid number of elements \n"); + + spider_pics[node] = __ioremap(spider_reg, 0x800, _PAGE_NO_CACHE); + + printk("SPIDER addr: %lx with %i addr_cells mapped to %p\n", + spider_reg, n, spider_pics[node]); + + for (n = 0; n < IIC_NUM_EXT; n++) { + int irq = n + IIC_EXT_OFFSET + node * IIC_NODE_STRIDE; + get_irq_desc(irq)->handler = &spider_pic; + } + + /* do not mask any interrupts because of level */ + out_be32(spider_pics[node] + TIR_MSK, 0x0); + + /* disable edge detection clear */ + /* out_be32(spider_pics[node] + TIR_EDC, 0x0); */ + + /* enable interrupt packets to be output */ + out_be32(spider_pics[node] + TIR_PIEN, + in_be32(spider_pics[node] + TIR_PIEN) | 0x1); + + /* Enable the interrupt detection enable bit. Do this last! */ + out_be32(spider_pics[node] + TIR_DEN, + in_be32(spider_pics[node] + TIR_DEN) | 0x1); + + node++; } } Index: linux-2.6.16-rc/arch/powerpc/platforms/cell/interrupt.c =================================================================== --- linux-2.6.16-rc.orig/arch/powerpc/platforms/cell/interrupt.c +++ linux-2.6.16-rc/arch/powerpc/platforms/cell/interrupt.c @@ -123,7 +123,7 @@ static int iic_external_get_irq(struct i pending.class != 2) break; irq = IIC_EXT_OFFSET - + spider_get_irq(pending.prio + node * IIC_NODE_STRIDE) + + spider_get_irq(node) + node * IIC_NODE_STRIDE; break; case 0x01 ... 0x04: @@ -174,40 +174,104 @@ int iic_get_irq(struct pt_regs *regs) return irq; } -static int setup_iic(int cpu, struct iic *iic) +/* hardcoded part to be compatible with older firmware */ + +static int setup_iic_hardcoded(void) { struct device_node *np; - int nodeid = cpu / 2; + int nodeid, cpu; unsigned long regs; + struct iic *iic; - for (np = of_find_node_by_type(NULL, "cpu"); - np; - np = of_find_node_by_type(np, "cpu")) { - if (nodeid == *(int *)get_property(np, "node-id", NULL)) - break; - } + for_each_cpu(cpu) { + iic = &per_cpu(iic, cpu); + nodeid = cpu/2; - if (!np) { - printk(KERN_WARNING "IIC: CPU %d not found\n", cpu); - iic->regs = NULL; - iic->target_id = 0xff; - return -ENODEV; - } + for (np = of_find_node_by_type(NULL, "cpu"); + np; + np = of_find_node_by_type(np, "cpu")) { + if (nodeid == *(int *)get_property(np, "node-id", NULL)) + break; + } + + if (!np) { + printk(KERN_WARNING "IIC: CPU %d not found\n", cpu); + iic->regs = NULL; + iic->target_id = 0xff; + return -ENODEV; + } + + regs = *(long *)get_property(np, "iic", NULL); + + /* hack until we have decided on the devtree info */ + regs += 0x400; + if (cpu & 1) + regs += 0x20; + + printk(KERN_INFO "IIC for CPU %d at %lx\n", cpu, regs); + iic->regs = __ioremap(regs, sizeof(struct iic_regs), + _PAGE_NO_CACHE); - regs = *(long *)get_property(np, "iic", NULL); + iic->target_id = (nodeid << 4) + ((cpu & 1) ? 0xf : 0xe); + } - /* hack until we have decided on the devtree info */ - regs += 0x400; - if (cpu & 1) - regs += 0x20; - - printk(KERN_DEBUG "IIC for CPU %d at %lx\n", cpu, regs); - iic->regs = __ioremap(regs, sizeof(struct iic_regs), - _PAGE_NO_CACHE); - iic->target_id = (nodeid << 4) + ((cpu & 1) ? 0xf : 0xe); return 0; } +static int setup_iic(void) +{ + struct device_node *dn; + unsigned long *regs; + char *compatible; + unsigned *np, found = 0; + struct iic *iic = NULL; + + for (dn = NULL; (dn = of_find_node_by_name(dn, "interrupt-controller"));) { + compatible = (char *)get_property(dn, "compatible", NULL); + + if (!compatible) { + printk(KERN_WARNING "no compatible property found !\n"); + continue; + } + + if (strstr(compatible, "IBM,CBEA-Internal-Interrupt-Controller")) + regs = (unsigned long *)get_property(dn,"reg", NULL); + else + continue; + + if (!regs) + printk(KERN_WARNING "IIC: no reg property\n"); + + np = (unsigned int *)get_property(dn, "ibm,interrupt-server-ranges", NULL); + + if (!np) { + printk(KERN_WARNING "IIC: CPU association not found\n"); + iic->regs = NULL; + iic->target_id = 0xff; + return -ENODEV; + } + + iic = &per_cpu(iic, np[0]); + iic->regs = __ioremap(regs[0], sizeof(struct iic_regs), + _PAGE_NO_CACHE); + iic->target_id = (np[0] << 4) + 0xe; + printk("IIC for CPU %d at %lx mapped to %p\n", np[0], regs[0], iic->regs); + + iic = &per_cpu(iic, np[1]); + iic->regs = __ioremap(regs[2], sizeof(struct iic_regs), + _PAGE_NO_CACHE); + iic->target_id = (np[1] << 3) + 0xe; + printk("IIC for CPU %d at %lx mapped to %p\n", np[1], regs[2], iic->regs); + + found++; + } + + if (found) + return 0; + else + return -ENODEV; +} + #ifdef CONFIG_SMP /* Use the highest interrupt priorities for IPI */ @@ -283,10 +347,12 @@ void iic_init_IRQ(void) int cpu, irq_offset; struct iic *iic; + if (setup_iic() < 0) + setup_iic_hardcoded(); + irq_offset = 0; for_each_cpu(cpu) { iic = &per_cpu(iic, cpu); - setup_iic(cpu, iic); if (iic->regs) out_be64(&iic->regs->prio, 0xff); } Index: linux-2.6.16-rc/arch/powerpc/platforms/cell/interrupt.h =================================================================== --- linux-2.6.16-rc.orig/arch/powerpc/platforms/cell/interrupt.h +++ linux-2.6.16-rc/arch/powerpc/platforms/cell/interrupt.h @@ -57,7 +57,7 @@ extern void iic_local_disable(void); extern u8 iic_get_target_id(int cpu); extern void spider_init_IRQ(void); -extern int spider_get_irq(unsigned long int_pending); +extern int spider_get_irq(int node); #endif #endif /* ASM_CELL_PIC_H */ From arnd at arndb.de Tue Jan 17 10:00:03 2006 From: arnd at arndb.de (Arnd Bergmann) Date: Tue, 17 Jan 2006 00:00:03 +0100 Subject: [3/4] [FYI] cell: systemsim defconfig References: <20060117195650.419158000@klappe.arndb.de> Message-ID: <20060117200253.753530000@klappe.arndb.de> An embedded and charset-unspecified text was scrubbed... Name: cbesim-defconfig.diff Url: http://ozlabs.org/pipermail/linuxppc64-dev/attachments/20060117/85511555/attachment.txt From arnd at arndb.de Tue Jan 17 10:00:04 2006 From: arnd at arndb.de (Arnd Bergmann) Date: Tue, 17 Jan 2006 00:00:04 +0100 Subject: [4/4] [FYI] cell: hack around broken firmware command line References: <20060117195650.419158000@klappe.arndb.de> Message-ID: <20060117200253.897808000@klappe.arndb.de> An embedded and charset-unspecified text was scrubbed... Name: parm-fixup.diff Url: http://ozlabs.org/pipermail/linuxppc64-dev/attachments/20060117/89535b3d/attachment.txt From arnd at arndb.de Tue Jan 17 10:00:03 2006 From: arnd at arndb.de (Arnd Bergmann) Date: Tue, 17 Jan 2006 00:00:03 +0100 Subject: [RFC/PATCH 3/3] spufs: enable SPE problem state MMIO access. References: <20060117194942.647145000@klappe.arndb.de> Message-ID: <20060117195015.586435000@klappe.arndb.de> An embedded and charset-unspecified text was scrubbed... Name: spufs-ps-mapping-2.diff Url: http://ozlabs.org/pipermail/linuxppc64-dev/attachments/20060117/bdea56fe/attachment.txt From arnd at arndb.de Wed Jan 18 06:49:42 2006 From: arnd at arndb.de (Arnd Bergmann) Date: Tue, 17 Jan 2006 20:49:42 +0100 Subject: [RFC/PATCH 0/3] cell/spufs: new experimental features Message-ID: <20060117194942.647145000@klappe.arndb.de> These three patches implement features that are desired by many of the cell/spufs users in order to improve performance and functionality of cell specific applications. Since they all touch very sensitive parts of the kernel (memory management and system calls), I would at least like a thorough review before declaring the interfaces stable and submitting the patches for inclusion. Arnd <>< - From arnd at arndb.de Wed Jan 18 06:22:45 2006 From: arnd at arndb.de (Arnd Bergmann) Date: Tue, 17 Jan 2006 20:22:45 +0100 Subject: [PATCH] powerpc: fix cell iommu setup Message-ID: <200601172022.45532.arnd@arndb.de> A small bug crept in the iommu driver when we made it more generic. This patch is needed for boards that have a dma window that does not start at bus address zero. Signed-off-by: Arnd Bergmann --- Please apply in the powerpc-merge tree. Index: linux-2.6.15-rc5/arch/powerpc/platforms/cell/iommu.c =================================================================== --- linux-2.6.15-rc5.orig/arch/powerpc/platforms/cell/iommu.c +++ linux-2.6.15-rc5/arch/powerpc/platforms/cell/iommu.c @@ -289,7 +289,7 @@ static void cell_do_map_iommu(struct cel ioc_base = iommu->mapped_base; ioc_mmio_base = iommu->mapped_mmio_base; - for (real_address = 0, io_address = 0; + for (real_address = 0, io_address = map_start; io_address <= map_start + map_size; real_address += io_page_size, io_address += io_page_size) { ioste = get_iost_entry(fake_iopt, io_address, io_page_size); @@ -302,7 +302,7 @@ static void cell_do_map_iommu(struct cel set_iopt_cache(ioc_mmio_base, get_ioc_hash_1way(ioste, io_address), get_ioc_tag(ioste, io_address), - get_iopt_entry(real_address-map_start, ioid, IOPT_PROT_RW)); + get_iopt_entry(real_address, ioid, IOPT_PROT_RW)); } } From arnd at arndb.de Tue Jan 17 10:00:01 2006 From: arnd at arndb.de (Arnd Bergmann) Date: Tue, 17 Jan 2006 00:00:01 +0100 Subject: [RFC/PATCH 1/3] spufs: allow SPU code to do syscalls References: <20060117194942.647145000@klappe.arndb.de> Message-ID: <20060117195015.280749000@klappe.arndb.de> An embedded and charset-unspecified text was scrubbed... Name: spufs-callbacks-2.diff Url: http://ozlabs.org/pipermail/linuxppc64-dev/attachments/20060117/3598b35e/attachment.txt From arndb at de.ibm.com Wed Jan 18 07:39:03 2006 From: arndb at de.ibm.com (Arnd Bergmann) Date: Tue, 17 Jan 2006 21:39:03 +0100 Subject: [2/4] [FYI] cell: Hack to create struct page * for SPUs In-Reply-To: <20060117200253.607297000@klappe.arndb.de> References: <20060117195650.419158000@klappe.arndb.de> <20060117200253.607297000@klappe.arndb.de> Message-ID: <200601172139.03931.arndb@de.ibm.com> Wow, that subject was screwed up in interesting ways by quilt. Fortunatly, that was only in my almost empty /tmp directory, not in something larger... Arnd <>< From benh at kernel.crashing.org Wed Jan 18 08:35:07 2006 From: benh at kernel.crashing.org (Benjamin Herrenschmidt) Date: Wed, 18 Jan 2006 08:35:07 +1100 Subject: [RFC] powerpc: cell interrupt controller updates In-Reply-To: <200601172028.01013.arnd@arndb.de> References: <200601172028.01013.arnd@arndb.de> Message-ID: <1137533707.4823.106.camel@localhost.localdomain> On Tue, 2006-01-17 at 20:28 +0100, Arnd Bergmann wrote: > The current interrupt controller setup on Cell is done > in a rather ad-hoc way with device tree properties > that are not standardized at all. > > In an attempt to do something that follows the OF standard > (or at least the IBM extensions to it) more closely, > we have now come up with this patch. It still provides > a fallback to the old behaviour when we find older firmware, > that hack can not be removed until the existing customer > installations have upgraded. > > There are a number of difficulties with this patch: > - the detection of interrupt controllers per CPU > is also used to detect an SMT setup, with the strange > 'ibm,interrupt-server-ranges' property. > - OF does not currently deal with SMT, the IBM extension > for this is specific to the XICS interrupt controller. > - The setup on our current boards consists of two > actual internal interrupt controllers on the CPUs, > which are represented as four logical ones (one per > thread), as well as two external 'spiderpic' > controllers. In future designs, the spiderpic will > be replaced with something else. > - ... The patch alone isn't very "talking" to me. Could you write down the kind of HW setup you have and how you expressed that in the device-tree ? Ben. From arnd at arndb.de Wed Jan 18 10:20:16 2006 From: arnd at arndb.de (Arnd Bergmann) Date: Wed, 18 Jan 2006 00:20:16 +0100 Subject: [RFC] powerpc: cell interrupt controller updates In-Reply-To: <1137533707.4823.106.camel@localhost.localdomain> References: <200601172028.01013.arnd@arndb.de> <1137533707.4823.106.camel@localhost.localdomain> Message-ID: <200601180020.17301.arnd@arndb.de> Am Dienstag, 17. Januar 2006 22:35 schrieb Benjamin Herrenschmidt: > The patch alone isn't very "talking" to me. Could you write down the > kind of HW setup you have and how you expressed that in the > device-tree ? Most of the discussion was between Jens and Hartmut, but I'll try to explain as much as I can remember from it. Jens, please correct me on this. The physical setup on the board is roughly like this CBE - CBE | | spider spider-ide0 | | eth1 eth0 Each Cell Broadband Engine (CBE) has two SMT threads, that each have their own interrupt controller registers for the Internal Interrupt Controller (IIC). Each of the two spider chips has an external interrupt controller (spiderpic) that can receive interrupts from an I/O device and forward those to exactly one of the four SMT threads (unlike e.g. mpic which AFAIU makes an interrupt pending at up to four CPUs simultaneously). We now represent all this in the device tree as four separate interrupt controller nodes: /interrupt-controller at 20000002000/ /type "interrupt-controller" /reg "20000002020 20 20000002040 20" /compatible "IBM,CBEA-Internal-Interrupt-Controller" /ibm,interrupt-server-ranges "0 1" /interrupt-controller at 30000002000/ /type "interrupt-controller" /reg "30000002020 20 30000002040 20" /compatible "IBM,CBEA-Internal-Interrupt-Controller" /ibm,interrupt-server-ranges "2 3" /interrupt-controller at 24000008000/ /type "interrupt-controller" /reg "24000008000 800" /compatible "CBEA,platform-spider-pic" /interrupt-parent phandleof("/interrupt-controller at 20000002000") /interrupt-controller at 34000008000/ /type "interrupt-controller" /reg "34000008000 800" /compatible "CBEA,platform-spider-pic" /interrupt-parent phandleof("/interrupt-controller at 30000002000") /cpus/ /cpu at 20000000000/ /ibm,ppc-interrupt-server#s "0 1" /interrupt-parent phandleof("/interrupt-controller at 20000002000") /cpu at 30000000000/ /ibm,ppc-interrupt-server#s "2 3" /interrupt-parent phandleof("/interrupt-controller at 30000002000") The above is all from memory, so it's likely to be wrong in details. The 'ibm,ppc-interrupt-server#s' property of the CPU is used as the hard-processor-id in linux and also matched with the 'ibm,interrupt-server-ranges' of the 'IBM,CBEA-Internal-Interrupt-Controller' node. It is used as an index into the 'reg' properties of the interrupt controller to find the actual registers for one SMT thread. The interrupt-parent relationship between the spider and iic controllers is just an approximation, each spider pic can also send interrupts to any other interrupt controller in the system (all six of them, if you count the SMT threads as separate interrupt targets), but for best performance, it is usually wise to use local interrupt delivery. Arnd <>< From michael at ellerman.id.au Wed Jan 18 10:55:51 2006 From: michael at ellerman.id.au (Michael Ellerman) Date: Wed, 18 Jan 2006 10:55:51 +1100 Subject: 2.6.15 failure on power4 iSeries In-Reply-To: <43CD0269.6060909@vnet.ibm.com> References: <43CC2DCC.6010201@vnet.ibm.com> <200601171122.14283.michael@ellerman.id.au> <43CD0269.6060909@vnet.ibm.com> Message-ID: <200601181055.53605.michael@ellerman.id.au> On Wed, 18 Jan 2006 01:42, will schmidt wrote: > Michael Ellerman wrote: > > On Tue, 17 Jan 2006 10:35, will schmidt wrote: > >>attempting to boot current kernels on a power4 iSeries doesnt work. have > >>tried both the powerpc-git tree and the torvalds-git tree. > >> > >>OS/400 RefCode is "C200 82FF". (which means nothing to me :-) > > > > C20082FF VSP IPL complete successfully > > > >>no console output at all. > > > > Enable early debugging for iSeries (now via Kconfig, under Kernel > > hacking), then enable DEBUG in platforms/iseries/* and kernel/setup_64.c, > > then when it dies hit "ctrl-x ctrl-x" and see if you get any output. > > -> early_setup() > Probing machine type for platform 201... > Found, Initializing memory management... > <- early_setup() > -> setup_system() > -> initialize_cache_info() > <- initialize_cache_info() > -> iSeries_init_early() > <- iSeries_init_early() > Mapping load area - physical addr = 0000000000000000 > absolute addr = 0000000018000000 > Load area size 32768K > HPT absolute addr = 000000014a000000, size = 32768K > Mainstore_VPD: Regatta > ms_vpd: processing area 0 blocks=1 > block 0 absStart=8000000000000000 absEnd=8000000100000000 > ms_vpd: processing area 1 blocks=1 > block 0 absStart=8000000100000000 absEnd=8000000200000000 > ms_vpd: processing area 2 blocks=1 > block 0 absStart=8000000200000000 absEnd=8000000280000000 > ms_vpd: 3 sorted memory blocks > Bitmap range: 0000000000000000 - 0000000100000000 > Absolute range: 8000000000000000 - 8000000100000000 > Bitmap range: 0000000100000000 - 0000000200000000 > Absolute range: 8000000100000000 - 8000000200000000 > Bitmap range: 0000000200000000 - 0000000280000000 > Absolute range: 8000000200000000 - 8000000280000000 > Mainstore_VPD: numMemoryBlocks = 3 > Mainstore_VPD: block 0 logical chunks 0000000000000000 - 0000000000004000 > abs chunks 0000000000000000 - > 0000000000004000 Mainstore_VPD: block 1 logical chunks 0000000000004000 - > 0000000000008000 abs chunks 0000000000004000 - 0000000000008000 > Mainstore_VPD: block 2 logical chunks 0000000000008000 - 000000000000a000 > abs chunks 0000000000008000 - 000000000000a000 Page orders: linear mapping > = 12, others = 12 > mf.c: iSeries Linux LPAR Machine Facilities initialized > -> smp_release_cpus() > <- smp_release_cpus() > <- setup_system() > > > This looks like the "2.6.15-mm4 failure on power5" output.. but I dont > see a *cpuc-to-mutexes.patch in this tree to back out. (torvalds-git) > > Will clean my glasses and look closer in a bit.. :-) Yeah, looks similar. I can't reproduce that crash on my POWER5 box here though, so I'm not sure if that patch is actually the problem. Might be worth git bisecting. You could try adding calls to udbg_printf() in start_kernel() to see if we're getting in there. cheers -- Michael Ellerman IBM OzLabs email: michael:ellerman.id.au inmsg: mpe:jabber.org wwweb: http://michael.ellerman.id.au phone: +61 2 6212 1183 (tie line 70 21183) We do not inherit the earth from our ancestors, we borrow it from our children. - S.M.A.R.T Person -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: not available Url : http://ozlabs.org/pipermail/linuxppc64-dev/attachments/20060118/9a39bd04/attachment.pgp From michael at ellerman.id.au Wed Jan 18 11:19:36 2006 From: michael at ellerman.id.au (Michael Ellerman) Date: Wed, 18 Jan 2006 11:19:36 +1100 Subject: 2.6.15-mm4 failure on power5 In-Reply-To: <20060117140050.GA13188@elte.hu> References: <20060116063530.GB23399@sergelap.austin.ibm.com> <200601180032.46867.michael@ellerman.id.au> <20060117140050.GA13188@elte.hu> Message-ID: <200601181119.39872.michael@ellerman.id.au> On Wed, 18 Jan 2006 01:00, Ingo Molnar wrote: > * Michael Ellerman wrote: > > On Tue, 17 Jan 2006 08:52, Dave C Boutcher wrote: > > > 2.6.15-mm4 won't boot on my power5 either. I tracked it down to the > > > following mutex patch from Ingo: kernel-kernel-cpuc-to-mutexes.patch > > > > > > If I revert just that patch, mm4 boots fine. Its really not obvious to > > > me at all why that patch is breaking things though... > > > > My POWER5 (gr) LPAR seems to boot ok (3 times so far) with that patch, > > guess it's something subtle. That's with CONFIG_DEBUG_MUTEXES=y. And > > it's just booted once with CONFIG_DEBUG_MUTEXES=n. > > > > And now it's booted the full mm4 patch set without blinking. > > so it booted fine with CONFIG_DEBUG_MUTEXES=n but with that patch not > applied? > > the patch will likely work around the bug, so DEBUG_MUTEXES=y/n should > make no difference with that patch applied. It booted fine _with_ the patch applied, with DEBUG_MUTEXES=y and n. Boutcher, to be clear, you can't boot with kernel-kernel-cpuc-to-mutexes.patch applied and DEBUG_MUTEXES=y ? But if you revert kernel-kernel-cpuc-to-mutexes.patch it boots ok? This is looking quite similar to another hang we're seeing on Power4 iSeries on mainline git: http://ozlabs.org/pipermail/linuxppc64-dev/2006-January/007679.html cheers -- Michael Ellerman IBM OzLabs email: michael:ellerman.id.au inmsg: mpe:jabber.org wwweb: http://michael.ellerman.id.au phone: +61 2 6212 1183 (tie line 70 21183) We do not inherit the earth from our ancestors, we borrow it from our children. - S.M.A.R.T Person -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: not available Url : http://ozlabs.org/pipermail/linuxppc64-dev/attachments/20060118/94a60614/attachment.pgp From sleddog at us.ibm.com Wed Jan 18 14:32:39 2006 From: sleddog at us.ibm.com (Dave C Boutcher) Date: Tue, 17 Jan 2006 21:32:39 -0600 Subject: 2.6.15-mm4 failure on power5 In-Reply-To: <200601181119.39872.michael@ellerman.id.au> References: <20060116063530.GB23399@sergelap.austin.ibm.com> <200601180032.46867.michael@ellerman.id.au> <20060117140050.GA13188@elte.hu> <200601181119.39872.michael@ellerman.id.au> Message-ID: <20060118033239.GA621@cs.umn.edu> On Wed, Jan 18, 2006 at 11:19:36AM +1100, Michael Ellerman wrote: > It booted fine _with_ the patch applied, with DEBUG_MUTEXES=y and n. > > Boutcher, to be clear, you can't boot with kernel-kernel-cpuc-to-mutexes.patch > applied and DEBUG_MUTEXES=y ? > > But if you revert kernel-kernel-cpuc-to-mutexes.patch it boots ok? > > This is looking quite similar to another hang we're seeing on Power4 iSeries > on mainline git: > http://ozlabs.org/pipermail/linuxppc64-dev/2006-January/007679.html Correct...I die in exactly the same place every time with DEBUG_MUTEXES=Y. I posted a backtrace that points into the _lock_cpu code, but I haven't really dug into the issue yet. I believe this is very timing related (Serge was dying slightly differently). -- Dave Boutcher From miltonm at bga.com Wed Jan 18 16:55:28 2006 From: miltonm at bga.com (Milton Miller) Date: Tue, 17 Jan 2006 23:55:28 -0600 Subject: [PATCH 0/5] powerpc: add device tree property updates Message-ID: <0e51f66be939a091b19b252a4e9e0114@bga.com> On Thu Jan 12 11:34:15 EST 2006, Arnd Bergmann wrote: > On Wednesday 11 January 2006 22:54, Benjamin Herrenschmidt wrote: > > Yah, but I do prefer a filesystem > > Ok, if you want something to play with, try this one. > It's my two-hour, 200 line attempt to give you an idea of how > the most simple implementation could look like. > > It's pretty much guaranteed not to work since I don't have any > powerpc machines around at home, but it's a start. > > Arnd <>< Here's my 30 second review :-) 1) properties (files) should be 0444 not 555 2) directories should be S_IFDIR not S_IFREG (create_dir) 3) this missed one of the requirements, namely that it create inodes and dentries on the fly, which precludes simple_readdir 4) it doesn't have an api to add or remove files, which is necessary because of 3 above. Ok so what should the inode number be ? directory inodes should be the phandle .... yeah .. now to assign all the others non-conflicting. Do all the current phandle generators use either a memory address, offset, or small enum? 5) ref counts ... i would think the node should only be refcounted when the directory is open ... (you were careful to put the root but not the child nodes on failed alloc). Actually i guess it should be refcounted with the inode lifetime. Ok, its taking more like 10-20 minutes to type this in, thinking of more along the way. milton From mingo at elte.hu Wed Jan 18 17:37:32 2006 From: mingo at elte.hu (Ingo Molnar) Date: Wed, 18 Jan 2006 07:37:32 +0100 Subject: 2.6.15-mm4 failure on power5 In-Reply-To: <20060118033239.GA621@cs.umn.edu> References: <20060116063530.GB23399@sergelap.austin.ibm.com> <200601180032.46867.michael@ellerman.id.au> <20060117140050.GA13188@elte.hu> <200601181119.39872.michael@ellerman.id.au> <20060118033239.GA621@cs.umn.edu> Message-ID: <20060118063732.GA21003@elte.hu> * Dave C Boutcher wrote: > On Wed, Jan 18, 2006 at 11:19:36AM +1100, Michael Ellerman wrote: > > It booted fine _with_ the patch applied, with DEBUG_MUTEXES=y and n. > > > > Boutcher, to be clear, you can't boot with kernel-kernel-cpuc-to-mutexes.patch > > applied and DEBUG_MUTEXES=y ? > > > > But if you revert kernel-kernel-cpuc-to-mutexes.patch it boots ok? > > > > This is looking quite similar to another hang we're seeing on Power4 iSeries > > on mainline git: > > http://ozlabs.org/pipermail/linuxppc64-dev/2006-January/007679.html > > Correct...I die in exactly the same place every time with > DEBUG_MUTEXES=Y. I posted a backtrace that points into the _lock_cpu > code, but I haven't really dug into the issue yet. I believe this is > very timing related (Serge was dying slightly differently). so my question still is: _without_ the workaround patch, i.e. with vanilla -mm4, and DEBUG_MUTEXES=n, do you get a hang? the reason for my question is that DEBUG_MUTEXES=y will e.g. enable interrupts - so buggy early bootup code which relies on interrupts being off might be surprised by it. The fact that you observed that it's somehow related to the timer interrupt seems to strengthen this suspicion. DEBUG_MUTEXES=n on the other hand should have no such interrupt-enabling effects. [ if this indeed is the case then i'll add irqs_off() checks to DEBUG_MUTEXES=y, to ensure that the mutex APIs are never called with interrupts disabled. ] Ingo From ntl at pobox.com Wed Jan 18 17:40:50 2006 From: ntl at pobox.com (Nathan Lynch) Date: Wed, 18 Jan 2006 00:40:50 -0600 Subject: 2.6.15-mm4 failure on power5 In-Reply-To: <20060117165555.GA24562@cs.umn.edu> References: <20060116063530.GB23399@sergelap.austin.ibm.com> <20060115230557.0f07a55c.akpm@osdl.org> <200601170000.58134.michael@ellerman.id.au> <20060116153748.GA25866@sergelap.austin.ibm.com> <20060116215252.GA10538@cs.umn.edu> <20060116170907.60149236.akpm@osdl.org> <20060117081749.GA10135@elte.hu> <20060117165244.GA23254@cs.umn.edu> <20060117165555.GA24562@cs.umn.edu> Message-ID: <20060118064050.GQ2846@localhost.localdomain> Dave C Boutcher wrote: > On Tue, Jan 17, 2006 at 10:52:44AM -0600, Dave C Boutcher wrote: > > Well, it turns out that I've been running with CONFIG_DEBUG_MUTEXES all > > along...so no noise. My console output is a little different that > > Serge's, so I think this is timing related. Also note that I'm dying in > > the timer interrupt... > > duh... here's the backtrace > 0:mon> t > [c000000000577890] c0000000000034b4 decrementer_common+0xb4/0x100 > --- Exception: 901 (Decrementer) at c0000000004627ec > .__mutex_lock_interruptible_slowpath+0x3bc/0x4c4 > [c000000000577c60] c000000000075064 .__lock_cpu_hotplug+0x44/0xa8 > [c000000000577ce0] c000000000075600 .register_cpu_notifier+0x24/0x68 > [c000000000577d70] c00000000052cd7c .do_init_bootmem+0x68c/0xab0 > [c000000000577e50] c000000000522c84 .setup_arch+0x21c/0x2c0 > [c000000000577ef0] c00000000051a538 .start_kernel+0x40/0x280 > [c000000000577f90] c000000000008574 .hmt_init+0x0/0x8c The mutex debug code (debug_spin_unlock in kernel/mutex-debug.h) is doing a local_irq_enable way before we're ready. BTW: I couldn't build powerpc without mutex debugging until I changed the SYNC_ON_SMP in include/asm-powerpc/mutex.h:__mutex_fastpath_unlock to ISYNC_ON_SMP. With that change, I was able to boot semi-successfully with mutex debugging off -- the system got hung up when udev started, apparently (or maybe I was too impatient). From akpm at osdl.org Wed Jan 18 17:53:04 2006 From: akpm at osdl.org (Andrew Morton) Date: Tue, 17 Jan 2006 22:53:04 -0800 Subject: 2.6.15-mm4 failure on power5 In-Reply-To: <20060118063732.GA21003@elte.hu> References: <20060116063530.GB23399@sergelap.austin.ibm.com> <200601180032.46867.michael@ellerman.id.au> <20060117140050.GA13188@elte.hu> <200601181119.39872.michael@ellerman.id.au> <20060118033239.GA621@cs.umn.edu> <20060118063732.GA21003@elte.hu> Message-ID: <20060117225304.4b6dd045.akpm@osdl.org> Ingo Molnar wrote: > > > * Dave C Boutcher wrote: > > > On Wed, Jan 18, 2006 at 11:19:36AM +1100, Michael Ellerman wrote: > > > It booted fine _with_ the patch applied, with DEBUG_MUTEXES=y and n. > > > > > > Boutcher, to be clear, you can't boot with kernel-kernel-cpuc-to-mutexes.patch > > > applied and DEBUG_MUTEXES=y ? > > > > > > But if you revert kernel-kernel-cpuc-to-mutexes.patch it boots ok? > > > > > > This is looking quite similar to another hang we're seeing on Power4 iSeries > > > on mainline git: > > > http://ozlabs.org/pipermail/linuxppc64-dev/2006-January/007679.html > > > > Correct...I die in exactly the same place every time with > > DEBUG_MUTEXES=Y. I posted a backtrace that points into the _lock_cpu > > code, but I haven't really dug into the issue yet. I believe this is > > very timing related (Serge was dying slightly differently). > > so my question still is: _without_ the workaround patch, i.e. with > vanilla -mm4, and DEBUG_MUTEXES=n, do you get a hang? > > the reason for my question is that DEBUG_MUTEXES=y will e.g. enable > interrupts That used to kill ppc64 and yes, it died in timer interrupts. > - so buggy early bootup code which relies on interrupts being > off might be surprised by it. I don't think it's necessarily buggy that bootup code needs interrupts disabled. It _is_ buggy that bootup code which needs interrupts disabled is calling lock_cpu_hotplug(). > The fact that you observed that it's > somehow related to the timer interrupt seems to strengthen this > suspicion. DEBUG_MUTEXES=n on the other hand should have no such > interrupt-enabling effects. > > [ if this indeed is the case then i'll add irqs_off() checks to > DEBUG_MUTEXES=y, to ensure that the mutex APIs are never called with > interrupts disabled. ] Yes, I suppose so. But we're already calling might_sleep(), and might_sleep() checks for that. Perhaps the might_sleep() check is being defeated by the nasty system_running check. There's a sad story behind that system_running check in might_sleep(). Because the kernel early boot is running in an in_atomic() state, a great number of bogus might_sleep() warnings come out because of various code doing potentially-sleepy things. I ended up adding the system_running test, with the changelog "OK, I give up. Kill all the might_sleep warnings from the early boot process." Undoing that and fixing up the fallout would be a lot of nasty work. From mingo at elte.hu Wed Jan 18 18:04:36 2006 From: mingo at elte.hu (Ingo Molnar) Date: Wed, 18 Jan 2006 08:04:36 +0100 Subject: 2.6.15-mm4 failure on power5 In-Reply-To: <20060117225304.4b6dd045.akpm@osdl.org> References: <20060116063530.GB23399@sergelap.austin.ibm.com> <200601180032.46867.michael@ellerman.id.au> <20060117140050.GA13188@elte.hu> <200601181119.39872.michael@ellerman.id.au> <20060118033239.GA621@cs.umn.edu> <20060118063732.GA21003@elte.hu> <20060117225304.4b6dd045.akpm@osdl.org> Message-ID: <20060118070436.GA24378@elte.hu> * Andrew Morton wrote: > > [ if this indeed is the case then i'll add irqs_off() checks to > > DEBUG_MUTEXES=y, to ensure that the mutex APIs are never called with > > interrupts disabled. ] > > Yes, I suppose so. But we're already calling might_sleep(), and > might_sleep() checks for that. Perhaps the might_sleep() check is > being defeated by the nasty system_running check. ah ... indeed. > There's a sad story behind that system_running check in might_sleep(). > Because the kernel early boot is running in an in_atomic() state, a > great number of bogus might_sleep() warnings come out because of > various code doing potentially-sleepy things. I ended up adding the > system_running test, with the changelog "OK, I give up. Kill all the > might_sleep warnings from the early boot process." Undoing that and > fixing up the fallout would be a lot of nasty work. OTOH, x86 was just fine last i checked, and it has alot more complex bootup code than any of the other architectures (due to the sheer number of x86 variants). Ingo From mingo at elte.hu Wed Jan 18 18:07:34 2006 From: mingo at elte.hu (Ingo Molnar) Date: Wed, 18 Jan 2006 08:07:34 +0100 Subject: 2.6.15-mm4 failure on power5 In-Reply-To: <20060118064050.GQ2846@localhost.localdomain> References: <20060116063530.GB23399@sergelap.austin.ibm.com> <20060115230557.0f07a55c.akpm@osdl.org> <200601170000.58134.michael@ellerman.id.au> <20060116153748.GA25866@sergelap.austin.ibm.com> <20060116215252.GA10538@cs.umn.edu> <20060116170907.60149236.akpm@osdl.org> <20060117081749.GA10135@elte.hu> <20060117165244.GA23254@cs.umn.edu> <20060117165555.GA24562@cs.umn.edu> <20060118064050.GQ2846@localhost.localdomain> Message-ID: <20060118070734.GB24378@elte.hu> * Nathan Lynch wrote: > Dave C Boutcher wrote: > > On Tue, Jan 17, 2006 at 10:52:44AM -0600, Dave C Boutcher wrote: > > > Well, it turns out that I've been running with CONFIG_DEBUG_MUTEXES all > > > along...so no noise. My console output is a little different that > > > Serge's, so I think this is timing related. Also note that I'm dying in > > > the timer interrupt... > > > > duh... here's the backtrace > > 0:mon> t > > [c000000000577890] c0000000000034b4 decrementer_common+0xb4/0x100 > > --- Exception: 901 (Decrementer) at c0000000004627ec > > .__mutex_lock_interruptible_slowpath+0x3bc/0x4c4 > > [c000000000577c60] c000000000075064 .__lock_cpu_hotplug+0x44/0xa8 > > [c000000000577ce0] c000000000075600 .register_cpu_notifier+0x24/0x68 > > [c000000000577d70] c00000000052cd7c .do_init_bootmem+0x68c/0xab0 > > [c000000000577e50] c000000000522c84 .setup_arch+0x21c/0x2c0 > > [c000000000577ef0] c00000000051a538 .start_kernel+0x40/0x280 > > [c000000000577f90] c000000000008574 .hmt_init+0x0/0x8c > > The mutex debug code (debug_spin_unlock in kernel/mutex-debug.h) is > doing a local_irq_enable way before we're ready. > > BTW: I couldn't build powerpc without mutex debugging until I changed > the SYNC_ON_SMP in include/asm-powerpc/mutex.h:__mutex_fastpath_unlock > to ISYNC_ON_SMP. > > With that change, I was able to boot semi-successfully with mutex > debugging off -- the system got hung up when udev started, apparently > (or maybe I was too impatient). ugh! Does the patch below get you a working system with DEBUG_MUTEXES=n? Ingo -- revert the ppc64 mutex fastpath assembly optimizations for now. Signed-off-by: Ingo Molnar ---- include/asm-powerpc/mutex.h | 85 ++------------------------------------------ 1 files changed, 5 insertions(+), 80 deletions(-) Index: linux/include/asm-powerpc/mutex.h =================================================================== --- linux.orig/include/asm-powerpc/mutex.h +++ linux/include/asm-powerpc/mutex.h @@ -1,84 +1,9 @@ /* - * include/asm-powerpc/mutex.h + * Pull in the generic implementation for the mutex fastpath. * - * PowerPC optimized mutex locking primitives - * - * Please look into asm-generic/mutex-xchg.h for a formal definition. - * Copyright (C) 2006 Joel Schopp , IBM + * TODO: implement optimized primitives instead, or leave the generic + * implementation in place, or pick the atomic_xchg() based generic + * implementation. (see asm-generic/mutex-xchg.h for details) */ -#ifndef _ASM_MUTEX_H -#define _ASM_MUTEX_H -#define __mutex_fastpath_lock(count, fail_fn)\ -do{ \ - int tmp; \ - __asm__ __volatile__( \ -"1: lwarx %0,0,%1\n" \ -" addic %0,%0,-1\n" \ -" stwcx. %0,0,%1\n" \ -" bne- 1b\n" \ - ISYNC_ON_SMP \ - : "=&r" (tmp) \ - : "r" (&(count)->counter) \ - : "cr0", "memory"); \ - if (unlikely(tmp < 0)) \ - fail_fn(count); \ -} while (0) - -#define __mutex_fastpath_unlock(count, fail_fn)\ -do{ \ - int tmp; \ - __asm__ __volatile__(SYNC_ON_SMP\ -"1: lwarx %0,0,%1\n" \ -" addic %0,%0,1\n" \ -" stwcx. %0,0,%1\n" \ -" bne- 1b\n" \ - : "=&r" (tmp) \ - : "r" (&(count)->counter) \ - : "cr0", "memory"); \ - if (unlikely(tmp <= 0)) \ - fail_fn(count); \ -} while (0) - - -static inline int -__mutex_fastpath_trylock(atomic_t* count, int (*fail_fn)(atomic_t*)) -{ - int tmp; - __asm__ __volatile__( -"1: lwarx %0,0,%1\n" -" cmpwi 0,%0,1\n" -" bne- 2f\n" -" addic %0,%0,-1\n" -" stwcx. %0,0,%1\n" -" bne- 1b\n" -" isync\n" -"2:" - : "=&r" (tmp) - : "r" (&(count)->counter) - : "cr0", "memory"); - - return (int)tmp; - -} - -#define __mutex_slowpath_needs_to_unlock() 1 -static inline int -__mutex_fastpath_lock_retval(atomic_t* count, int (*fail_fn)(atomic_t *)) -{ - int tmp; - __asm__ __volatile__( -"1: lwarx %0,0,%1\n" -" addic %0,%0,-1\n" -" stwcx. %0,0,%1\n" -" bne- 1b\n" -" isync \n" - : "=&r" (tmp) - : "r" (&(count)->counter) - : "cr0", "memory"); - if (unlikely(tmp < 0)) - return fail_fn(count); - else - return 0; -} -#endif +#include From ntl at pobox.com Wed Jan 18 18:28:15 2006 From: ntl at pobox.com (Nathan Lynch) Date: Wed, 18 Jan 2006 01:28:15 -0600 Subject: 2.6.15-mm4 failure on power5 In-Reply-To: <20060117225304.4b6dd045.akpm@osdl.org> References: <20060116063530.GB23399@sergelap.austin.ibm.com> <200601180032.46867.michael@ellerman.id.au> <20060117140050.GA13188@elte.hu> <200601181119.39872.michael@ellerman.id.au> <20060118033239.GA621@cs.umn.edu> <20060118063732.GA21003@elte.hu> <20060117225304.4b6dd045.akpm@osdl.org> Message-ID: <20060118072815.GR2846@localhost.localdomain> Andrew Morton wrote: > Ingo Molnar wrote: > > - so buggy early bootup code which relies on interrupts being > > off might be surprised by it. > > I don't think it's necessarily buggy that bootup code needs interrupts > disabled. It _is_ buggy that bootup code which needs interrupts disabled > is calling lock_cpu_hotplug(). I guess I don't understand -- why is it wrong for code that runs only in early early bootup, when there is only one process context, to use common code to e.g. register a hotplug cpu notifier? Should the powerpc numa code be made to wait to register its notifier until initcall time or something? > > The fact that you observed that it's > > somehow related to the timer interrupt seems to strengthen this > > suspicion. DEBUG_MUTEXES=n on the other hand should have no such > > interrupt-enabling effects. > > > > [ if this indeed is the case then i'll add irqs_off() checks to > > DEBUG_MUTEXES=y, to ensure that the mutex APIs are never called with > > interrupts disabled. ] > > Yes, I suppose so. But we're already calling might_sleep(), and > might_sleep() checks for that. Perhaps the might_sleep() check is being > defeated by the nasty system_running check. Yes, which would be why this code never triggered a warning when cpucontrol was a semaphore. From akpm at osdl.org Wed Jan 18 18:37:34 2006 From: akpm at osdl.org (Andrew Morton) Date: Tue, 17 Jan 2006 23:37:34 -0800 Subject: 2.6.15-mm4 failure on power5 In-Reply-To: <20060118072815.GR2846@localhost.localdomain> References: <20060116063530.GB23399@sergelap.austin.ibm.com> <200601180032.46867.michael@ellerman.id.au> <20060117140050.GA13188@elte.hu> <200601181119.39872.michael@ellerman.id.au> <20060118033239.GA621@cs.umn.edu> <20060118063732.GA21003@elte.hu> <20060117225304.4b6dd045.akpm@osdl.org> <20060118072815.GR2846@localhost.localdomain> Message-ID: <20060117233734.506c2f2e.akpm@osdl.org> Nathan Lynch wrote: > > Andrew Morton wrote: > > Ingo Molnar wrote: > > > - so buggy early bootup code which relies on interrupts being > > > off might be surprised by it. > > > > I don't think it's necessarily buggy that bootup code needs interrupts > > disabled. It _is_ buggy that bootup code which needs interrupts disabled > > is calling lock_cpu_hotplug(). > > I guess I don't understand -- why is it wrong for code that runs only > in early early bootup, when there is only one process context, to use > common code to e.g. register a hotplug cpu notifier? OK, it's not wrong I guess - we're running code which requires local_irq_disable() and that code is calling functions which do local_irq_enable() but we know that those functions won't do that because there cannot be any lock contention. So it works, and will continue to work, but it's all rather unpleasant, IMO. > Should the > powerpc numa code be made to wait to register its notifier until > initcall time or something? I think the powerpc code is busted, really - it shouldn't be keeling over like that if someone enables local interrupts. That being said, it's a good way of detecting accidental interrupt-enablings. > Yes, which would be why this code never triggered a warning when > cpucontrol was a semaphore. Yup. Perhaps a sane fix which preserves the unpleasant semantics is to do irqsave in the mutex debug code. From ntl at pobox.com Wed Jan 18 18:53:18 2006 From: ntl at pobox.com (Nathan Lynch) Date: Wed, 18 Jan 2006 01:53:18 -0600 Subject: 2.6.15-mm4 failure on power5 In-Reply-To: <20060118070734.GB24378@elte.hu> References: <20060115230557.0f07a55c.akpm@osdl.org> <200601170000.58134.michael@ellerman.id.au> <20060116153748.GA25866@sergelap.austin.ibm.com> <20060116215252.GA10538@cs.umn.edu> <20060116170907.60149236.akpm@osdl.org> <20060117081749.GA10135@elte.hu> <20060117165244.GA23254@cs.umn.edu> <20060117165555.GA24562@cs.umn.edu> <20060118064050.GQ2846@localhost.localdomain> <20060118070734.GB24378@elte.hu> Message-ID: <20060118075318.GS2846@localhost.localdomain> Ingo Molnar wrote: > > * Nathan Lynch wrote: > > > Dave C Boutcher wrote: > > > On Tue, Jan 17, 2006 at 10:52:44AM -0600, Dave C Boutcher wrote: > > > > Well, it turns out that I've been running with CONFIG_DEBUG_MUTEXES all > > > > along...so no noise. My console output is a little different that > > > > Serge's, so I think this is timing related. Also note that I'm dying in > > > > the timer interrupt... > > > > > > duh... here's the backtrace > > > 0:mon> t > > > [c000000000577890] c0000000000034b4 decrementer_common+0xb4/0x100 > > > --- Exception: 901 (Decrementer) at c0000000004627ec > > > .__mutex_lock_interruptible_slowpath+0x3bc/0x4c4 > > > [c000000000577c60] c000000000075064 .__lock_cpu_hotplug+0x44/0xa8 > > > [c000000000577ce0] c000000000075600 .register_cpu_notifier+0x24/0x68 > > > [c000000000577d70] c00000000052cd7c .do_init_bootmem+0x68c/0xab0 > > > [c000000000577e50] c000000000522c84 .setup_arch+0x21c/0x2c0 > > > [c000000000577ef0] c00000000051a538 .start_kernel+0x40/0x280 > > > [c000000000577f90] c000000000008574 .hmt_init+0x0/0x8c > > > > The mutex debug code (debug_spin_unlock in kernel/mutex-debug.h) is > > doing a local_irq_enable way before we're ready. > > > > BTW: I couldn't build powerpc without mutex debugging until I changed > > the SYNC_ON_SMP in include/asm-powerpc/mutex.h:__mutex_fastpath_unlock > > to ISYNC_ON_SMP. > > > > With that change, I was able to boot semi-successfully with mutex > > debugging off -- the system got hung up when udev started, apparently > > (or maybe I was too impatient). > > ugh! Does the patch below get you a working system with DEBUG_MUTEXES=n? Yes, this gets me to a login prompt, thanks. From ntl at pobox.com Wed Jan 18 19:08:12 2006 From: ntl at pobox.com (Nathan Lynch) Date: Wed, 18 Jan 2006 02:08:12 -0600 Subject: 2.6.15-mm4 failure on power5 In-Reply-To: <20060118064050.GQ2846@localhost.localdomain> References: <20060116063530.GB23399@sergelap.austin.ibm.com> <20060115230557.0f07a55c.akpm@osdl.org> <200601170000.58134.michael@ellerman.id.au> <20060116153748.GA25866@sergelap.austin.ibm.com> <20060116215252.GA10538@cs.umn.edu> <20060116170907.60149236.akpm@osdl.org> <20060117081749.GA10135@elte.hu> <20060117165244.GA23254@cs.umn.edu> <20060117165555.GA24562@cs.umn.edu> <20060118064050.GQ2846@localhost.localdomain> Message-ID: <20060118080812.GT2846@localhost.localdomain> Nathan Lynch wrote: > Dave C Boutcher wrote: > > On Tue, Jan 17, 2006 at 10:52:44AM -0600, Dave C Boutcher wrote: > > > Well, it turns out that I've been running with CONFIG_DEBUG_MUTEXES all > > > along...so no noise. My console output is a little different that > > > Serge's, so I think this is timing related. Also note that I'm dying in > > > the timer interrupt... > > > > duh... here's the backtrace > > 0:mon> t > > [c000000000577890] c0000000000034b4 decrementer_common+0xb4/0x100 > > --- Exception: 901 (Decrementer) at c0000000004627ec > > .__mutex_lock_interruptible_slowpath+0x3bc/0x4c4 > > [c000000000577c60] c000000000075064 .__lock_cpu_hotplug+0x44/0xa8 > > [c000000000577ce0] c000000000075600 .register_cpu_notifier+0x24/0x68 > > [c000000000577d70] c00000000052cd7c .do_init_bootmem+0x68c/0xab0 > > [c000000000577e50] c000000000522c84 .setup_arch+0x21c/0x2c0 > > [c000000000577ef0] c00000000051a538 .start_kernel+0x40/0x280 > > [c000000000577f90] c000000000008574 .hmt_init+0x0/0x8c > > The mutex debug code (debug_spin_unlock in kernel/mutex-debug.h) is > doing a local_irq_enable way before we're ready. Looks like not only the powerpc setup_arch code could trigger this -- rcu_init, init_timers, and sched_init all do register_cpu_notifier (and hence mutex_lock, therefore potentially enabling interrupts too early in the mutex debug case) before the initial local_irq_enable in start_kernel. From mingo at elte.hu Wed Jan 18 19:08:28 2006 From: mingo at elte.hu (Ingo Molnar) Date: Wed, 18 Jan 2006 09:08:28 +0100 Subject: 2.6.15-mm4 failure on power5 In-Reply-To: <20060117233734.506c2f2e.akpm@osdl.org> References: <20060116063530.GB23399@sergelap.austin.ibm.com> <200601180032.46867.michael@ellerman.id.au> <20060117140050.GA13188@elte.hu> <200601181119.39872.michael@ellerman.id.au> <20060118033239.GA621@cs.umn.edu> <20060118063732.GA21003@elte.hu> <20060117225304.4b6dd045.akpm@osdl.org> <20060118072815.GR2846@localhost.localdomain> <20060117233734.506c2f2e.akpm@osdl.org> Message-ID: <20060118080828.GA2324@elte.hu> * Andrew Morton wrote: > > Yes, which would be why this code never triggered a warning when > > cpucontrol was a semaphore. > > Yup. Perhaps a sane fix which preserves the unpleasant semantics is > to do irqsave in the mutex debug code. i'd much rather remove that ugly hack from __might_sleep(). How many other bugs does it hide? Does it hide bugs that dont normally trigger during bootups on real hardware, but which could trigger on e.g. UML or on Xen? I really think such ugly workarounds are not justified, if other arches can get their act together. Would you make such an exception for other arches too, like ARM? an irqsave in the mutex debug code will uglify the kernel/mutex.c code - i'd have to add extra "unsigned long flags" lines. [It will also slow down the debug code a bit - an extra PUSHF has to be done.] Ingo From akpm at osdl.org Wed Jan 18 19:24:59 2006 From: akpm at osdl.org (Andrew Morton) Date: Wed, 18 Jan 2006 00:24:59 -0800 Subject: 2.6.15-mm4 failure on power5 In-Reply-To: <20060118080828.GA2324@elte.hu> References: <20060116063530.GB23399@sergelap.austin.ibm.com> <200601180032.46867.michael@ellerman.id.au> <20060117140050.GA13188@elte.hu> <200601181119.39872.michael@ellerman.id.au> <20060118033239.GA621@cs.umn.edu> <20060118063732.GA21003@elte.hu> <20060117225304.4b6dd045.akpm@osdl.org> <20060118072815.GR2846@localhost.localdomain> <20060117233734.506c2f2e.akpm@osdl.org> <20060118080828.GA2324@elte.hu> Message-ID: <20060118002459.3bc8f75a.akpm@osdl.org> Ingo Molnar wrote: > > > * Andrew Morton wrote: > > > > Yes, which would be why this code never triggered a warning when > > > cpucontrol was a semaphore. > > > > Yup. Perhaps a sane fix which preserves the unpleasant semantics is > > to do irqsave in the mutex debug code. > > i'd much rather remove that ugly hack from __might_sleep(). How many > other bugs does it hide? Gee, it was 2.6.0-test9. I don't remember, but I do recall the problems were really really nasty, and what's the point? We're only running one thread on one CPU at that time, so none of these things _will_ sleep. > Does it hide bugs that dont normally trigger > during bootups on real hardware, but which could trigger on e.g. UML or > on Xen? I really think such ugly workarounds are not justified, if other > arches can get their act together. Would you make such an exception for > other arches too, like ARM? Don't care really, as long as a) the problems don't hit -mm or mainline and b) someone else fixes them. Yes, it'd be nice to fix these things, and we might even find real bugs. Perhaps things are better now, but I suspect it's a can of worms. > an irqsave in the mutex debug code will uglify the kernel/mutex.c code - > i'd have to add extra "unsigned long flags" lines. [It will also slow > down the debug code a bit - an extra PUSHF has to be done.] Small cost, really... From mingo at elte.hu Wed Jan 18 20:02:43 2006 From: mingo at elte.hu (Ingo Molnar) Date: Wed, 18 Jan 2006 10:02:43 +0100 Subject: [patch] work around ppc64 bootup bug by making mutex-debugging save/restore irqs In-Reply-To: <20060118002459.3bc8f75a.akpm@osdl.org> References: <200601180032.46867.michael@ellerman.id.au> <20060117140050.GA13188@elte.hu> <200601181119.39872.michael@ellerman.id.au> <20060118033239.GA621@cs.umn.edu> <20060118063732.GA21003@elte.hu> <20060117225304.4b6dd045.akpm@osdl.org> <20060118072815.GR2846@localhost.localdomain> <20060117233734.506c2f2e.akpm@osdl.org> <20060118080828.GA2324@elte.hu> <20060118002459.3bc8f75a.akpm@osdl.org> Message-ID: <20060118090243.GA15165@elte.hu> * Andrew Morton wrote: > > Does it hide bugs that dont normally trigger > > during bootups on real hardware, but which could trigger on e.g. UML or > > on Xen? I really think such ugly workarounds are not justified, if other > > arches can get their act together. Would you make such an exception for > > other arches too, like ARM? > > Don't care really, as long as a) the problems don't hit -mm or > mainline and b) someone else fixes them. Yes, it'd be nice to fix > these things, and we might even find real bugs. Perhaps things are > better now, but I suspect it's a can of worms. patch to mutex code below. -- it seems ppc64 wants to lock mutexes in early bootup code, with interrupts disabled, and they expect interrupts to stay disabled, else they crash. work this bug around by making mutex debugging variants save/restore irq flags. Signed-off-by: Ingo Molnar ---- kernel/mutex-debug.c | 12 ++++++------ kernel/mutex-debug.h | 25 +++++-------------------- kernel/mutex.c | 21 ++++++++++++--------- kernel/mutex.h | 6 ++++-- 4 files changed, 27 insertions(+), 37 deletions(-) Index: linux/kernel/mutex-debug.c =================================================================== --- linux.orig/kernel/mutex-debug.c +++ linux/kernel/mutex-debug.c @@ -153,13 +153,13 @@ next: continue; count++; cursor = curr->next; - debug_spin_lock_restore(&debug_mutex_lock, flags); + debug_spin_unlock_restore(&debug_mutex_lock, flags); printk("\n#%03d: ", count); printk_lock(lock, filter ? 0 : 1); goto next; } - debug_spin_lock_restore(&debug_mutex_lock, flags); + debug_spin_unlock_restore(&debug_mutex_lock, flags); printk("\n"); } @@ -316,7 +316,7 @@ void mutex_debug_check_no_locks_held(str continue; list_del_init(curr); DEBUG_OFF(); - debug_spin_lock_restore(&debug_mutex_lock, flags); + debug_spin_unlock_restore(&debug_mutex_lock, flags); printk("BUG: %s/%d, lock held at task exit time!\n", task->comm, task->pid); @@ -325,7 +325,7 @@ void mutex_debug_check_no_locks_held(str printk("exiting task is not even the owner??\n"); return; } - debug_spin_lock_restore(&debug_mutex_lock, flags); + debug_spin_unlock_restore(&debug_mutex_lock, flags); } /* @@ -352,7 +352,7 @@ void mutex_debug_check_no_locks_freed(co continue; list_del_init(curr); DEBUG_OFF(); - debug_spin_lock_restore(&debug_mutex_lock, flags); + debug_spin_unlock_restore(&debug_mutex_lock, flags); printk("BUG: %s/%d, active lock [%p(%p-%p)] freed!\n", current->comm, current->pid, lock, from, to); @@ -362,7 +362,7 @@ void mutex_debug_check_no_locks_freed(co printk("freeing task is not even the owner??\n"); return; } - debug_spin_lock_restore(&debug_mutex_lock, flags); + debug_spin_unlock_restore(&debug_mutex_lock, flags); } /* Index: linux/kernel/mutex-debug.h =================================================================== --- linux.orig/kernel/mutex-debug.h +++ linux/kernel/mutex-debug.h @@ -46,21 +46,6 @@ extern void mutex_remove_waiter(struct m extern void debug_mutex_unlock(struct mutex *lock); extern void debug_mutex_init(struct mutex *lock, const char *name); -#define debug_spin_lock(lock) \ - do { \ - local_irq_disable(); \ - if (debug_mutex_on) \ - spin_lock(lock); \ - } while (0) - -#define debug_spin_unlock(lock) \ - do { \ - if (debug_mutex_on) \ - spin_unlock(lock); \ - local_irq_enable(); \ - preempt_check_resched(); \ - } while (0) - #define debug_spin_lock_save(lock, flags) \ do { \ local_irq_save(flags); \ @@ -68,7 +53,7 @@ extern void debug_mutex_init(struct mute spin_lock(lock); \ } while (0) -#define debug_spin_lock_restore(lock, flags) \ +#define debug_spin_unlock_restore(lock, flags) \ do { \ if (debug_mutex_on) \ spin_unlock(lock); \ @@ -76,20 +61,20 @@ extern void debug_mutex_init(struct mute preempt_check_resched(); \ } while (0) -#define spin_lock_mutex(lock) \ +#define spin_lock_mutex(lock, flags) \ do { \ struct mutex *l = container_of(lock, struct mutex, wait_lock); \ \ DEBUG_WARN_ON(in_interrupt()); \ - debug_spin_lock(&debug_mutex_lock); \ + debug_spin_lock_save(&debug_mutex_lock, flags); \ spin_lock(lock); \ DEBUG_WARN_ON(l->magic != l); \ } while (0) -#define spin_unlock_mutex(lock) \ +#define spin_unlock_mutex(lock, flags) \ do { \ spin_unlock(lock); \ - debug_spin_unlock(&debug_mutex_lock); \ + debug_spin_unlock_restore(&debug_mutex_lock, flags); \ } while (0) #define DEBUG_OFF() \ Index: linux/kernel/mutex.c =================================================================== --- linux.orig/kernel/mutex.c +++ linux/kernel/mutex.c @@ -125,10 +125,11 @@ __mutex_lock_common(struct mutex *lock, struct task_struct *task = current; struct mutex_waiter waiter; unsigned int old_val; + unsigned long flags; debug_mutex_init_waiter(&waiter); - spin_lock_mutex(&lock->wait_lock); + spin_lock_mutex(&lock->wait_lock, flags); debug_mutex_add_waiter(lock, &waiter, task->thread_info, ip); @@ -157,7 +158,7 @@ __mutex_lock_common(struct mutex *lock, if (unlikely(state == TASK_INTERRUPTIBLE && signal_pending(task))) { mutex_remove_waiter(lock, &waiter, task->thread_info); - spin_unlock_mutex(&lock->wait_lock); + spin_unlock_mutex(&lock->wait_lock, flags); debug_mutex_free_waiter(&waiter); return -EINTR; @@ -165,9 +166,9 @@ __mutex_lock_common(struct mutex *lock, __set_task_state(task, state); /* didnt get the lock, go to sleep: */ - spin_unlock_mutex(&lock->wait_lock); + spin_unlock_mutex(&lock->wait_lock, flags); schedule(); - spin_lock_mutex(&lock->wait_lock); + spin_lock_mutex(&lock->wait_lock, flags); } /* got the lock - rejoice! */ @@ -178,7 +179,7 @@ __mutex_lock_common(struct mutex *lock, if (likely(list_empty(&lock->wait_list))) atomic_set(&lock->count, 0); - spin_unlock_mutex(&lock->wait_lock); + spin_unlock_mutex(&lock->wait_lock, flags); debug_mutex_free_waiter(&waiter); @@ -203,10 +204,11 @@ static fastcall noinline void __mutex_unlock_slowpath(atomic_t *lock_count __IP_DECL__) { struct mutex *lock = container_of(lock_count, struct mutex, count); + unsigned long flags; DEBUG_WARN_ON(lock->owner != current_thread_info()); - spin_lock_mutex(&lock->wait_lock); + spin_lock_mutex(&lock->wait_lock, flags); /* * some architectures leave the lock unlocked in the fastpath failure @@ -231,7 +233,7 @@ __mutex_unlock_slowpath(atomic_t *lock_c debug_mutex_clear_owner(lock); - spin_unlock_mutex(&lock->wait_lock); + spin_unlock_mutex(&lock->wait_lock, flags); } /* @@ -276,9 +278,10 @@ __mutex_lock_interruptible_slowpath(atom static inline int __mutex_trylock_slowpath(atomic_t *lock_count) { struct mutex *lock = container_of(lock_count, struct mutex, count); + unsigned long flags; int prev; - spin_lock_mutex(&lock->wait_lock); + spin_lock_mutex(&lock->wait_lock, flags); prev = atomic_xchg(&lock->count, -1); if (likely(prev == 1)) @@ -287,7 +290,7 @@ static inline int __mutex_trylock_slowpa if (likely(list_empty(&lock->wait_list))) atomic_set(&lock->count, 0); - spin_unlock_mutex(&lock->wait_lock); + spin_unlock_mutex(&lock->wait_lock, flags); return prev == 1; } Index: linux/kernel/mutex.h =================================================================== --- linux.orig/kernel/mutex.h +++ linux/kernel/mutex.h @@ -9,8 +9,10 @@ * !CONFIG_DEBUG_MUTEXES case. Most of them are NOPs: */ -#define spin_lock_mutex(lock) spin_lock(lock) -#define spin_unlock_mutex(lock) spin_unlock(lock) +#define spin_lock_mutex(lock, flags) \ + do { spin_lock(lock); (void)(flags); } while (0) +#define spin_unlock_mutex(lock, flags) \ + do { spin_unlock(lock); (void)(flags); } while (0) #define mutex_remove_waiter(lock, waiter, ti) \ __list_del((waiter)->list.prev, (waiter)->list.next) From mingo at elte.hu Wed Jan 18 20:18:34 2006 From: mingo at elte.hu (Ingo Molnar) Date: Wed, 18 Jan 2006 10:18:34 +0100 Subject: [patch] turn on might_sleep() in early bootup code too In-Reply-To: <20060118002459.3bc8f75a.akpm@osdl.org> References: <200601180032.46867.michael@ellerman.id.au> <20060117140050.GA13188@elte.hu> <200601181119.39872.michael@ellerman.id.au> <20060118033239.GA621@cs.umn.edu> <20060118063732.GA21003@elte.hu> <20060117225304.4b6dd045.akpm@osdl.org> <20060118072815.GR2846@localhost.localdomain> <20060117233734.506c2f2e.akpm@osdl.org> <20060118080828.GA2324@elte.hu> <20060118002459.3bc8f75a.akpm@osdl.org> Message-ID: <20060118091834.GA21366@elte.hu> Could we try the patch below in -mm, to get a feeling of how widespread the early bootup lock-atomicity assumptions are? I also added a .config option to add back the workaround, and turned it on for ppc64. (users can still select this manually on any other arch as well) i found one such bug on x86: early-printk calls register_console(), which acquires console_sem. Since we can work such things around per-lock and per-assumption [see the printk.c changes], i think we should rather do the workarounds that way, and thus document the hacks we need - without impacting the ability of such platforms to boot - while still keeping might_sleep() checks widely enabled. (btw., x86 still booted fine, despite the warning.) Ingo -- enable might_sleep() checks even in early bootup code (when system_state != SYSTEM_RUNNING). There's also a new config option to turn this off: CONFIG_DEBUG_SPINLOCK_SLEEP_EARLY_BOOTUP_WORKAROUND while most other architectures. the patch also documents and works around an EARLY_PRINTK locking dependency. [which we might want to get rid of in the future.] tested on x86. Signed-off-by: Ingo Molnar ---- arch/powerpc/Kconfig.debug | 2 ++ kernel/printk.c | 11 ++++++++++- kernel/sched.c | 7 +++++-- lib/Kconfig.debug | 11 +++++++++++ 4 files changed, 28 insertions(+), 3 deletions(-) Index: linux/arch/powerpc/Kconfig.debug =================================================================== --- linux.orig/arch/powerpc/Kconfig.debug +++ linux/arch/powerpc/Kconfig.debug @@ -2,6 +2,8 @@ menu "Kernel hacking" source "lib/Kconfig.debug" +select CONFIG_DEBUG_SPINLOCK_SLEEP_EARLY_BOOTUP_WORKAROUND + config DEBUG_STACKOVERFLOW bool "Check for stack overflows" depends on DEBUG_KERNEL && PPC64 Index: linux/kernel/printk.c =================================================================== --- linux.orig/kernel/printk.c +++ linux/kernel/printk.c @@ -710,7 +710,16 @@ void acquire_console_sem(void) { if (in_interrupt()) BUG(); - down(&console_sem); + /* + * Early-printk wants to acquire the console_sem in + * register_console(). Make a special exception for them by + * going via trylock first, which doesnt trigger the + * might_sleep() atomicity check. + */ +#ifdef CONFIG_EARLY_PRINTK + if (down_trylock(&console_sem)) +#endif + down(&console_sem); console_locked = 1; console_may_schedule = 1; } Index: linux/kernel/sched.c =================================================================== --- linux.orig/kernel/sched.c +++ linux/kernel/sched.c @@ -6285,8 +6285,11 @@ void __might_sleep(char *file, int line) #if defined(in_atomic) static unsigned long prev_jiffy; /* ratelimiting */ - if ((in_atomic() || irqs_disabled()) && - system_state == SYSTEM_RUNNING && !oops_in_progress) { +#ifdef CONFIG_DEBUG_SPINLOCK_SLEEP_EARLY_BOOTUP_WORKAROUND + if (system_state != SYSTEM_RUNNING) + return; +#endif + if ((in_atomic() || irqs_disabled()) && !oops_in_progress) { if (time_before(jiffies, prev_jiffy + HZ) && prev_jiffy) return; prev_jiffy = jiffies; Index: linux/lib/Kconfig.debug =================================================================== --- linux.orig/lib/Kconfig.debug +++ linux/lib/Kconfig.debug @@ -128,6 +128,17 @@ config DEBUG_SPINLOCK_SLEEP If you say Y here, various routines which may sleep will become very noisy if they are called with a spinlock held. +config DEBUG_SPINLOCK_SLEEP_EARLY_BOOTUP_WORKAROUND + bool "Work around sleep-inside-spinlock checking in early bootup code" + depends on DEBUG_SPINLOCK_SLEEP + help + If you say Y here, then early bootup code will not check for + "do not call potentially sleeping functions in atomic sections" + rule, that the DEBUG_SPINLOCK_SLEEP option enforces. + + You want to say N here, unless your system does not boot with + "Y" here. + config DEBUG_KOBJECT bool "kobject debugging" depends on DEBUG_KERNEL From segher at kernel.crashing.org Wed Jan 18 21:18:27 2006 From: segher at kernel.crashing.org (Segher Boessenkool) Date: Wed, 18 Jan 2006 11:18:27 +0100 Subject: [PATCH 0/5] powerpc: add device tree property updates In-Reply-To: <0e51f66be939a091b19b252a4e9e0114@bga.com> References: <0e51f66be939a091b19b252a4e9e0114@bga.com> Message-ID: <87f678e06d0f1ac6fbe85cf5c97d3479@kernel.crashing.org> > Ok so what should the inode number be ? > > directory inodes should be the phandle .... yeah .. now to assign all > the others non-conflicting. Do all the current phandle generators > use either a memory address, offset, or small enum? Nope. All current PowerPC OF implementations use a 32-bit client interface though (to the best of my knowledge); this implies that all phandle's are 32-bit. If inode numbers can be bigger than 32 bit, problem solved; if not, you'll have a problem as soon as someone creates a 64-bit client interface (as is strongly recommended for 64-bit systems). But I think I see an easy way out... you only deal with the flattened device tree anyway, so just use the offset in that blob? Should be a nicely small number... Segher From akpm at osdl.org Wed Jan 18 21:35:09 2006 From: akpm at osdl.org (Andrew Morton) Date: Wed, 18 Jan 2006 02:35:09 -0800 Subject: [patch] turn on might_sleep() in early bootup code too In-Reply-To: <20060118091834.GA21366@elte.hu> References: <200601180032.46867.michael@ellerman.id.au> <20060117140050.GA13188@elte.hu> <200601181119.39872.michael@ellerman.id.au> <20060118033239.GA621@cs.umn.edu> <20060118063732.GA21003@elte.hu> <20060117225304.4b6dd045.akpm@osdl.org> <20060118072815.GR2846@localhost.localdomain> <20060117233734.506c2f2e.akpm@osdl.org> <20060118080828.GA2324@elte.hu> <20060118002459.3bc8f75a.akpm@osdl.org> <20060118091834.GA21366@elte.hu> Message-ID: <20060118023509.50fe2701.akpm@osdl.org> Ingo Molnar wrote: > > enable might_sleep() checks even in early bootup code (when system_state > != SYSTEM_RUNNING). There's also a new config option to turn this off: > CONFIG_DEBUG_SPINLOCK_SLEEP_EARLY_BOOTUP_WORKAROUND > while most other architectures. I get just the one on ppc64: Debug: sleeping function called from invalid context at include/asm/semaphore.h:62 in_atomic():1, irqs_disabled():1 Call Trace: [C0000000004EFD20] [C00000000000F660] .show_stack+0x5c/0x1cc (unreliable) [C0000000004EFDD0] [C000000000053214] .__might_sleep+0xbc/0xe0 [C0000000004EFE60] [C000000000413D1C] .lock_kernel+0x50/0xb0 [C0000000004EFEF0] [C0000000004AC574] .start_kernel+0x1c/0x278 [C0000000004EFF90] [C0000000000085D4] .hmt_init+0x0/0x2c Your fault ;) From mingo at elte.hu Wed Jan 18 21:43:19 2006 From: mingo at elte.hu (Ingo Molnar) Date: Wed, 18 Jan 2006 11:43:19 +0100 Subject: [patch] turn on might_sleep() in early bootup code too In-Reply-To: <20060118023509.50fe2701.akpm@osdl.org> References: <200601181119.39872.michael@ellerman.id.au> <20060118033239.GA621@cs.umn.edu> <20060118063732.GA21003@elte.hu> <20060117225304.4b6dd045.akpm@osdl.org> <20060118072815.GR2846@localhost.localdomain> <20060117233734.506c2f2e.akpm@osdl.org> <20060118080828.GA2324@elte.hu> <20060118002459.3bc8f75a.akpm@osdl.org> <20060118091834.GA21366@elte.hu> <20060118023509.50fe2701.akpm@osdl.org> Message-ID: <20060118104319.GB7885@elte.hu> * Andrew Morton wrote: > Ingo Molnar wrote: > > > > enable might_sleep() checks even in early bootup code (when system_state > > != SYSTEM_RUNNING). There's also a new config option to turn this off: > > CONFIG_DEBUG_SPINLOCK_SLEEP_EARLY_BOOTUP_WORKAROUND > > while most other architectures. > > I get just the one on ppc64: > > > Debug: sleeping function called from invalid context at include/asm/semaphore.h:62 > in_atomic():1, irqs_disabled():1 > Call Trace: > [C0000000004EFD20] [C00000000000F660] .show_stack+0x5c/0x1cc (unreliable) > [C0000000004EFDD0] [C000000000053214] .__might_sleep+0xbc/0xe0 > [C0000000004EFE60] [C000000000413D1C] .lock_kernel+0x50/0xb0 > [C0000000004EFEF0] [C0000000004AC574] .start_kernel+0x1c/0x278 > [C0000000004EFF90] [C0000000000085D4] .hmt_init+0x0/0x2c > > > Your fault ;) yes :-) I have a really ugly workaround in my tree that is definitely not worth posting. I think to do this cleanly i'll add trylock_kernel(), and do this in main.c: BUG_ON(!trylock_kernel()); but there's another one that is much nastier in terms of scope: BUG: sleeping function called from invalid context at kernel/mutex.c:256 in_atomic():0, irqs_disabled():1 [] show_trace+0xd/0xf [] dump_stack+0x15/0x17 [] __might_sleep+0x64/0x6c [] mutex_lock_interruptible+0x15/0x22 [] __lock_cpu_hotplug+0x26/0x52 [] lock_cpu_hotplug_interruptible+0xd/0xf [] register_cpu_notifier+0xc/0x2b [] page_alloc_init+0xd/0xf [] start_kernel+0x125/0x376 [] 0xc0100210 this is what is causing the ppc64 problems too i think. lock_cpu_hotplug() has design problems i think: hotplug-locked sections are slowly spreading in the kernel, encompassing more and more code :-) Shouldnt the CPU hotplug lock be a spinlock to begin with? Ingo From nickpiggin at yahoo.com.au Wed Jan 18 21:46:35 2006 From: nickpiggin at yahoo.com.au (Nick Piggin) Date: Wed, 18 Jan 2006 21:46:35 +1100 Subject: [patch] turn on might_sleep() in early bootup code too In-Reply-To: <20060118023509.50fe2701.akpm@osdl.org> References: <200601180032.46867.michael@ellerman.id.au> <20060117140050.GA13188@elte.hu> <200601181119.39872.michael@ellerman.id.au> <20060118033239.GA621@cs.umn.edu> <20060118063732.GA21003@elte.hu> <20060117225304.4b6dd045.akpm@osdl.org> <20060118072815.GR2846@localhost.localdomain> <20060117233734.506c2f2e.akpm@osdl.org> <20060118080828.GA2324@elte.hu> <20060118002459.3bc8f75a.akpm@osdl.org> <20060118091834.GA21366@elte.hu> <20060118023509.50fe2701.akpm@osdl.org> Message-ID: <43CE1C8B.3010802@yahoo.com.au> Andrew Morton wrote: > Ingo Molnar wrote: > >> enable might_sleep() checks even in early bootup code (when system_state >> != SYSTEM_RUNNING). There's also a new config option to turn this off: >> CONFIG_DEBUG_SPINLOCK_SLEEP_EARLY_BOOTUP_WORKAROUND >> while most other architectures. > > > I get just the one on ppc64: > > > Debug: sleeping function called from invalid context at include/asm/semaphore.h:62 > in_atomic():1, irqs_disabled():1 > Call Trace: > [C0000000004EFD20] [C00000000000F660] .show_stack+0x5c/0x1cc (unreliable) > [C0000000004EFDD0] [C000000000053214] .__might_sleep+0xbc/0xe0 > [C0000000004EFE60] [C000000000413D1C] .lock_kernel+0x50/0xb0 > [C0000000004EFEF0] [C0000000004AC574] .start_kernel+0x1c/0x278 > [C0000000004EFF90] [C0000000000085D4] .hmt_init+0x0/0x2c > > > Your fault ;) This lock_kernel should never sleep should it? Maybe it could be changed to lock_kernel_init_locked() or something? -- SUSE Labs, Novell Inc. Send instant messages to your online friends http://au.messenger.yahoo.com From mingo at elte.hu Wed Jan 18 22:07:39 2006 From: mingo at elte.hu (Ingo Molnar) Date: Wed, 18 Jan 2006 12:07:39 +0100 Subject: [patch] turn on might_sleep() in early bootup code too In-Reply-To: <43CE1C8B.3010802@yahoo.com.au> References: <20060118033239.GA621@cs.umn.edu> <20060118063732.GA21003@elte.hu> <20060117225304.4b6dd045.akpm@osdl.org> <20060118072815.GR2846@localhost.localdomain> <20060117233734.506c2f2e.akpm@osdl.org> <20060118080828.GA2324@elte.hu> <20060118002459.3bc8f75a.akpm@osdl.org> <20060118091834.GA21366@elte.hu> <20060118023509.50fe2701.akpm@osdl.org> <43CE1C8B.3010802@yahoo.com.au> Message-ID: <20060118110739.GA11316@elte.hu> * Nick Piggin wrote: > Andrew Morton wrote: > >Ingo Molnar wrote: > > > >>enable might_sleep() checks even in early bootup code (when system_state > >>!= SYSTEM_RUNNING). There's also a new config option to turn this off: > >>CONFIG_DEBUG_SPINLOCK_SLEEP_EARLY_BOOTUP_WORKAROUND > >>while most other architectures. > > > > > >I get just the one on ppc64: > > > > > >Debug: sleeping function called from invalid context at > >include/asm/semaphore.h:62 > >in_atomic():1, irqs_disabled():1 > >Call Trace: > >[C0000000004EFD20] [C00000000000F660] .show_stack+0x5c/0x1cc (unreliable) > >[C0000000004EFDD0] [C000000000053214] .__might_sleep+0xbc/0xe0 > >[C0000000004EFE60] [C000000000413D1C] .lock_kernel+0x50/0xb0 > >[C0000000004EFEF0] [C0000000004AC574] .start_kernel+0x1c/0x278 > >[C0000000004EFF90] [C0000000000085D4] .hmt_init+0x0/0x2c > > > > > >Your fault ;) > > This lock_kernel should never sleep should it? Maybe it could be > changed to lock_kernel_init_locked() or something? the way i fixed it in my tree was to add a trylock_kernel(), and to check for success in init/main.c. See the patch below. Ingo -- introduce trylock_kernel(), to be used by the early init code to acquire the BKL in an atomic way. Signed-off-by: Ingo Molnar ---- Index: linux/include/linux/smp_lock.h =================================================================== --- linux.orig/include/linux/smp_lock.h +++ linux/include/linux/smp_lock.h @@ -39,6 +39,7 @@ static inline int reacquire_kernel_lock( } extern void __lockfunc lock_kernel(void) __acquires(kernel_lock); +extern int __lockfunc trylock_kernel(void); extern void __lockfunc unlock_kernel(void) __releases(kernel_lock); #else Index: linux/init/main.c =================================================================== --- linux.orig/init/main.c +++ linux/init/main.c @@ -443,11 +443,14 @@ asmlinkage void __init start_kernel(void { char * command_line; extern struct kernel_param __start___param[], __stop___param[]; -/* - * Interrupts are still disabled. Do necessary setups, then - * enable them - */ - lock_kernel(); + + /* + * Interrupts are still disabled. Do necessary setups, then + * enable them. This is the first time we take the BKL, so + * it must succeed: + */ + if (!trylock_kernel()) + WARN_ON(1); page_address_init(); printk(KERN_NOTICE); printk(linux_banner); @@ -466,6 +469,7 @@ asmlinkage void __init start_kernel(void * time - but meanwhile we still have a functioning scheduler. */ sched_init(); + mutex_key_hash_init(); /* * Disable preemption - early bootup scheduling is extremely * fragile until we cpu_idle() for the first time. Index: linux/lib/kernel_lock.c =================================================================== --- linux.orig/lib/kernel_lock.c +++ linux/lib/kernel_lock.c @@ -76,6 +76,23 @@ void __lockfunc lock_kernel(void) task->lock_depth = depth; } +int __lockfunc trylock_kernel(void) +{ + struct task_struct *task = current; + int depth = task->lock_depth + 1; + + if (likely(!depth)) { + if (unlikely(down_trylock(&kernel_sem))) + return 0; + else + __acquire(kernel_sem); + } + + task->lock_depth = depth; + return 1; +} + + void __lockfunc unlock_kernel(void) { struct task_struct *task = current; @@ -194,6 +211,25 @@ void __lockfunc lock_kernel(void) current->lock_depth = depth; } +int __lockfunc trylock_kernel(void) +{ + struct task_struct *task = current; + int depth = task->lock_depth + 1; + + if (likely(!depth)) { + if (unlikely(!spin_trylock(&kernel_flag))) + return 0; + else + __acquire(kernel_sem); + } + + if (likely(!depth) && unlikely(!spin_trylock(&kernel_flag))) + return 0; + + task->lock_depth = depth; + return 1; +} + void __lockfunc unlock_kernel(void) { BUG_ON(current->lock_depth < 0); @@ -204,5 +240,6 @@ void __lockfunc unlock_kernel(void) #endif EXPORT_SYMBOL(lock_kernel); +/* we do not export trylock_kernel(). BKL code should shrink :-) */ EXPORT_SYMBOL(unlock_kernel); From mingo at elte.hu Wed Jan 18 22:15:40 2006 From: mingo at elte.hu (Ingo Molnar) Date: Wed, 18 Jan 2006 12:15:40 +0100 Subject: [patch] make bug messages more consistent In-Reply-To: <20060118104319.GB7885@elte.hu> References: <20060118033239.GA621@cs.umn.edu> <20060118063732.GA21003@elte.hu> <20060117225304.4b6dd045.akpm@osdl.org> <20060118072815.GR2846@localhost.localdomain> <20060117233734.506c2f2e.akpm@osdl.org> <20060118080828.GA2324@elte.hu> <20060118002459.3bc8f75a.akpm@osdl.org> <20060118091834.GA21366@elte.hu> <20060118023509.50fe2701.akpm@osdl.org> <20060118104319.GB7885@elte.hu> Message-ID: <20060118111540.GA14023@elte.hu> while we are changing debugging code. One problem is that we've got a hodgepodge of bug messages right now, and i frequently miss e.g. 'Badness' messages from the kernel because they simply do not stick out visually. 'BUG' is much more apparent and also makes it obvious that there's a kernel bug here. Here's a patch that makes the messages more consistent: -- consolidate all kernel bug printouts to begin with the "BUG: " string. Makes it easier to find them in large bootup logs. Signed-off-by: Ingo Molnar ---- include/asm-generic/bug.h | 4 ++-- kernel/sched.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) Index: linux/include/asm-generic/bug.h =================================================================== --- linux.orig/include/asm-generic/bug.h +++ linux/include/asm-generic/bug.h @@ -7,7 +7,7 @@ #ifdef CONFIG_BUG #ifndef HAVE_ARCH_BUG #define BUG() do { \ - printk("kernel BUG at %s:%d!\n", __FILE__, __LINE__); \ + printk("BUG: failure at %s:%d/%s()!\n", __FILE__, __LINE__, __FUNCTION__); \ panic("BUG!"); \ } while (0) #endif @@ -19,7 +19,7 @@ #ifndef HAVE_ARCH_WARN_ON #define WARN_ON(condition) do { \ if (unlikely((condition)!=0)) { \ - printk("Badness in %s at %s:%d\n", __FUNCTION__, __FILE__, __LINE__); \ + printk("BUG: warning at %s:%d/%s()\n", __FILE__, __LINE__, __FUNCTION__); \ dump_stack(); \ } \ } while (0) Index: linux/kernel/sched.c =================================================================== --- linux.orig/kernel/sched.c +++ linux/kernel/sched.c @@ -2973,7 +2973,7 @@ asmlinkage void __sched schedule(void) */ if (likely(!current->exit_state)) { if (unlikely(in_atomic())) { - printk(KERN_ERR "scheduling while atomic: " + printk(KERN_ERR "BUG: scheduling while atomic: " "%s/0x%08x/%d\n", current->comm, preempt_count(), current->pid); dump_stack(); @@ -6293,7 +6293,7 @@ void __might_sleep(char *file, int line) if (time_before(jiffies, prev_jiffy + HZ) && prev_jiffy) return; prev_jiffy = jiffies; - printk(KERN_ERR "Debug: sleeping function called from invalid" + printk(KERN_ERR "BUG: sleeping function called from invalid" " context at %s:%d\n", file, line); printk("in_atomic():%d, irqs_disabled():%d\n", in_atomic(), irqs_disabled()); From mingo at elte.hu Wed Jan 18 23:53:05 2006 From: mingo at elte.hu (Ingo Molnar) Date: Wed, 18 Jan 2006 13:53:05 +0100 Subject: [patch] add trylock_kernel() In-Reply-To: <20060118110739.GA11316@elte.hu> References: <20060118063732.GA21003@elte.hu> <20060117225304.4b6dd045.akpm@osdl.org> <20060118072815.GR2846@localhost.localdomain> <20060117233734.506c2f2e.akpm@osdl.org> <20060118080828.GA2324@elte.hu> <20060118002459.3bc8f75a.akpm@osdl.org> <20060118091834.GA21366@elte.hu> <20060118023509.50fe2701.akpm@osdl.org> <43CE1C8B.3010802@yahoo.com.au> <20060118110739.GA11316@elte.hu> Message-ID: <20060118125305.GA30907@elte.hu> * Ingo Molnar wrote: > the way i fixed it in my tree was to add a trylock_kernel(), and to > check for success in init/main.c. See the patch below. i had a silly bug in the spinlock variant, and some extra unneeded change from another debug patch - fixed patch is below. Tested on x86, with and without CONFIG_PREEMPT_BKL. Ingo -- introduce trylock_kernel(), to be used by the early init code to acquire the BKL in an atomic way. Signed-off-by: Ingo Molnar ---- include/linux/smp_lock.h | 1 + init/main.c | 13 ++++++++----- lib/kernel_lock.c | 34 ++++++++++++++++++++++++++++++++++ 3 files changed, 43 insertions(+), 5 deletions(-) Index: linux/include/linux/smp_lock.h =================================================================== --- linux.orig/include/linux/smp_lock.h +++ linux/include/linux/smp_lock.h @@ -39,6 +39,7 @@ static inline int reacquire_kernel_lock( } extern void __lockfunc lock_kernel(void) __acquires(kernel_lock); +extern int __lockfunc trylock_kernel(void); extern void __lockfunc unlock_kernel(void) __releases(kernel_lock); #else Index: linux/init/main.c =================================================================== --- linux.orig/init/main.c +++ linux/init/main.c @@ -443,11 +443,14 @@ asmlinkage void __init start_kernel(void { char * command_line; extern struct kernel_param __start___param[], __stop___param[]; -/* - * Interrupts are still disabled. Do necessary setups, then - * enable them - */ - lock_kernel(); + + /* + * Interrupts are still disabled. Do necessary setups, then + * enable them. This is the first time we take the BKL, so + * it must succeed: + */ + if (!trylock_kernel()) + WARN_ON(1); page_address_init(); printk(KERN_NOTICE); printk(linux_banner); Index: linux/lib/kernel_lock.c =================================================================== --- linux.orig/lib/kernel_lock.c +++ linux/lib/kernel_lock.c @@ -76,6 +76,23 @@ void __lockfunc lock_kernel(void) task->lock_depth = depth; } +int __lockfunc trylock_kernel(void) +{ + struct task_struct *task = current; + int depth = task->lock_depth + 1; + + if (likely(!depth)) { + if (unlikely(down_trylock(&kernel_sem))) + return 0; + else + __acquire(kernel_sem); + } + + task->lock_depth = depth; + return 1; +} + + void __lockfunc unlock_kernel(void) { struct task_struct *task = current; @@ -194,6 +211,22 @@ void __lockfunc lock_kernel(void) current->lock_depth = depth; } +int __lockfunc trylock_kernel(void) +{ + struct task_struct *task = current; + int depth = task->lock_depth + 1; + + if (likely(!depth)) { + if (unlikely(!spin_trylock(&kernel_flag))) + return 0; + else + __acquire(kernel_sem); + } + + task->lock_depth = depth; + return 1; +} + void __lockfunc unlock_kernel(void) { BUG_ON(current->lock_depth < 0); @@ -204,5 +237,6 @@ void __lockfunc unlock_kernel(void) #endif EXPORT_SYMBOL(lock_kernel); +/* we do not export trylock_kernel(). BKL code should shrink :-) */ EXPORT_SYMBOL(unlock_kernel); From arjan at infradead.org Wed Jan 18 18:38:01 2006 From: arjan at infradead.org (Arjan van de Ven) Date: Wed, 18 Jan 2006 08:38:01 +0100 Subject: 2.6.15-mm4 failure on power5 In-Reply-To: <20060118072815.GR2846@localhost.localdomain> References: <20060116063530.GB23399@sergelap.austin.ibm.com> <200601180032.46867.michael@ellerman.id.au> <20060117140050.GA13188@elte.hu> <200601181119.39872.michael@ellerman.id.au> <20060118033239.GA621@cs.umn.edu> <20060118063732.GA21003@elte.hu> <20060117225304.4b6dd045.akpm@osdl.org> <20060118072815.GR2846@localhost.localdomain> Message-ID: <1137569882.3005.73.camel@laptopd505.fenrus.org> On Wed, 2006-01-18 at 01:28 -0600, Nathan Lynch wrote: > Andrew Morton wrote: > > Ingo Molnar wrote: > > > - so buggy early bootup code which relies on interrupts being > > > off might be surprised by it. > > > > I don't think it's necessarily buggy that bootup code needs interrupts > > disabled. It _is_ buggy that bootup code which needs interrupts disabled > > is calling lock_cpu_hotplug(). > > I guess I don't understand -- why is it wrong for code that runs only > in early early bootup, when there is only one process context, to use > common code to e.g. register a hotplug cpu notifier? it's nasty to use things-that-can-sleep there though. Even if that sleep is a bit theoretical, it still isn't nice. From arnd at arndb.de Thu Jan 19 01:20:09 2006 From: arnd at arndb.de (Arnd Bergmann) Date: Wed, 18 Jan 2006 15:20:09 +0100 Subject: [PATCH 0/5] powerpc: add device tree property updates In-Reply-To: <0e51f66be939a091b19b252a4e9e0114@bga.com> References: <0e51f66be939a091b19b252a4e9e0114@bga.com> Message-ID: <200601181520.10012.arnd@arndb.de> On Wednesday 18 January 2006 06:55, Milton Miller wrote: > 1) properties (files) should be 0444 not 555 > 2) directories should be S_IFDIR not S_IFREG (create_dir) right. both are simple copy-paste bugs > 3) this missed one of the requirements, > ? ?namely that it create inodes and dentries on the fly, > ? ?which precludes simple_readdir yes, that was intentional. I have no idea how to do that, so I wrote down all that I know about for someone else to start from. > 4) it doesn't have an api to add or remove files, which is necessary > ? ?because of 3 above. I think it's an unrelated problem, but you're right. > Ok so what should the inode number be ? > > directory inodes should be the phandle .... yeah .. ?now to assign all > the others non-conflicting. ? Do all the current phandle generators > use either a memory address, offset, or small enum? Do we need the inode number to be meaningful at all? libfs makes sure it's unique, I think that should be enough for us. > 5) ref counts ... i would think the node should only be refcounted > ? ?when the directory is open ... ?(you were careful to put the root > ? ?but not the child nodes on failed alloc). > > ? ?Actually i guess it should be refcounted with the inode lifetime. As long as an inode exists, it needs to hold a counted reference on the object it represents, there should not be any doubt about that. The simple fs prototype I posted needs the reference counts for every device node to be held all the time because the inodes are persistant, that is the design limitation you mentioned as 3). I forgot to give up the reference count on delete_inode() and on failure in the init path, which is an implementation bug. We have several types of objects that we need to maintain, the question is which of them can be easily regenerated and which ones can remain in memory. On my power mac, I estimate this much stuff in the device tree: 140 device nodes 1456 properties 1596 inodes 1876 dentries (each node also has a '..' and a '.' dentry) 931840 bytes in struct inode for properties 89600 bytes in struct inode for device nodes 361088 bytes in struct dentry for properties 104160 bytes in struct dentry for device nodes 46592 bytes in struct property 2240 bytes in struct device_node 19090 bytes in property names 212633 bytes in property data From the memory consumption perspective, it would be most beneficial to have the inodes for the properties created on the fly, and we could do the same their dentries without getting overly complicated. That is the same that is now done in sysfs, iirc. it would also be convenient to merge the inode struct with device_node struct as a simplification, but the properties would still need separate inodes that are never cached. oh, and another bug that I found: 6) the recursive function to create the directory entries is never called, so the file system will only have a root entry right now. Arnd <>< From sharada at in.ibm.com Thu Jan 19 01:22:02 2006 From: sharada at in.ibm.com (R Sharada) Date: Wed, 18 Jan 2006 19:52:02 +0530 Subject: Fw: [Fastboot] Re: [PATCH 3/6] ppc64-kdump-crash-memory-support Message-ID: <20060118142201.GA1863@in.ibm.com> This patch apparently, for some strange reason, did not make it to the linuxppc64-dev mailing list. So, resending it again Thanks and Regards, Sharada ----- Forwarded message from R Sharada ----- Date: Mon, 16 Jan 2006 20:40:52 +0530 From: R Sharada To: fastboot at osdl.org, linuxppc64-dev at ozlabs.org Cc: Subject: [Fastboot] Re: [PATCH 3/6] ppc64-kdump-crash-memory-support Reply-To: sharada at in.ibm.com This patch provides the support for setting up te various memory regions required for crashdump functionality. - limit mem_min and mem_max to crash_base and crash_end - create usable_memory_regions for use by second kernel - exclude regions not to be dumped by second kernel. For example - tce-table and crash reserved region - include rtas region in crash_memory_ranges if it falls within crash reserved region, as we want to obtain the rtas image in the dump core file. Signed-off-by: R Sharada Signed-off-by: Haren Myneni --- diff -puN kexec/arch/ppc64/kexec-ppc64.c~ppc64-kdump-crash-memory-support kexec/arch/ppc64/kexec-ppc64.c --- kexec-tools-1.101/kexec/arch/ppc64/kexec-ppc64.c~ppc64-kdump-crash-memory-support 2006-01-15 07:07:36.000000000 +0530 +++ kexec-tools-1.101-sharada/kexec/arch/ppc64/kexec-ppc64.c 2006-01-15 08:10:20.000000000 +0530 @@ -31,27 +31,23 @@ #include "../../kexec.h" #include "../../kexec-syscall.h" #include "kexec-ppc64.h" +#include "crashdump-ppc64.h" #include -#define MAX_MEMORY_RANGES 64 -#define MAX_LINE 160 -#define MAXBYTES 128 /* Platforms supported by kexec on PPC64 */ #define PLATFORM_PSERIES 0x0100 #define PLATFORM_PSERIES_LPAR 0x0101 -struct exclude_range { - unsigned long long start, end; -}; static struct exclude_range exclude_range[MAX_MEMORY_RANGES]; - static unsigned long long rmo_top; static unsigned int platform; static struct memory_range memory_range[MAX_MEMORY_RANGES]; static struct memory_range base_memory_range[MAX_MEMORY_RANGES]; unsigned long long memory_max = 0; -static int nr_memory_ranges; -static int nr_exclude_ranges; +static int nr_memory_ranges, nr_exclude_ranges; +unsigned long long crash_base, crash_size; + +static int sort_base_ranges(); /* Get base memory ranges */ static int get_base_ranges() @@ -105,17 +101,44 @@ static int get_base_ranges() ((unsigned long long *)buf)[1]; base_memory_range[local_memory_ranges].type = RANGE_RAM; local_memory_ranges++; -#if 0 +#ifdef DEBUG fprintf(stderr, "%016Lx-%016Lx : %x\n", memory_range[local_memory_ranges-1].start, memory_range[local_memory_ranges-1].end, memory_range[local_memory_ranges].type); #endif fclose(file); } - memory_max = base_memory_range[local_memory_ranges - 1].end; closedir(dmem); } closedir(dir); nr_memory_ranges = local_memory_ranges; + sort_base_ranges(); + memory_max = base_memory_range[nr_memory_ranges - 1].end; +#ifdef DEBUG fprintf(stderr, "get base memory ranges:%d\n", nr_memory_ranges); +#endif + return 0; +} + +/* Sort the base ranges in memory - this is useful for ensuring that our + * ranges are in ascending order, even if device-tree read of memory nodes + * is done differently. Also, could be used for other range coalescing later + */ +static int sort_base_ranges() +{ + int i, j; + unsigned long long tstart, tend; + + for (i = 0; i < nr_memory_ranges - 1; i++) { + for (j = 0; j < nr_memory_ranges - i - 1; j++) { + if (base_memory_range[j].start > base_memory_range[j+1].start) { + tstart = base_memory_range[j].start; + tend = base_memory_range[j].end; + base_memory_range[j].start = base_memory_range[j+1].start; + base_memory_range[j].end = base_memory_range[j+1].end; + base_memory_range[j+1].start = tstart; + base_memory_range[j+1].end = tend; + } + } + } return 0; } @@ -139,12 +162,17 @@ static int sort_ranges() return 0; } -/* Get devtree details and create exclude_range array */ -static int get_devtree_details() +/* Get devtree details and create exclude_range array + * Also create usablemem_ranges for KEXEC_ON_CRASH + */ +static int get_devtree_details(unsigned long kexec_flags) { unsigned long long rmo_base; unsigned long long tce_base; unsigned int tce_size; + unsigned int rtas_base, rtas_size; + unsigned long long htab_base, htab_size; + unsigned long long kernel_end; char buf[MAXBYTES-1]; char device_tree[256] = "/proc/device-tree/"; char fname[256]; @@ -189,6 +217,7 @@ static int get_devtree_details() return -1; } fclose(file); + memset(fname, 0, sizeof(fname)); strcpy(fname, device_tree); strcat(fname, dentry->d_name); @@ -199,7 +228,6 @@ static int get_devtree_details() closedir(dir); return -1; } - unsigned long long kernel_end; if (fread(&kernel_end, sizeof(unsigned long), 1, file) != 1) { perror(fname); fclose(file); @@ -207,10 +235,62 @@ static int get_devtree_details() closedir(dir); return -1; } + fclose(file); + /* Add kernel memory to exclude_range */ exclude_range[i].start = 0x0UL; exclude_range[i].end = kernel_end; i++; + + if (kexec_flags & KEXEC_ON_CRASH) { + memset(fname, 0, sizeof(fname)); + strcpy(fname, device_tree); + strcat(fname, dentry->d_name); + strcat(fname, "/linux,crashkernel-base"); + if ((file = fopen(fname, "r")) == NULL) { + perror(fname); + closedir(cdir); + closedir(dir); + return -1; + } + if (fread(&crash_base, sizeof(unsigned long), 1, + file) != 1) { + perror(fname); + fclose(file); + closedir(cdir); + closedir(dir); + return -1; + } + fclose(file); + + memset(fname, 0, sizeof(fname)); + strcpy(fname, device_tree); + strcat(fname, dentry->d_name); + strcat(fname, "/linux,crashkernel-size"); + if ((file = fopen(fname, "r")) == NULL) { + perror(fname); + closedir(cdir); + closedir(dir); + return -1; + } + if (fread(&crash_size, sizeof(unsigned long), 1, + file) != 1) { + perror(fname); + fclose(file); + closedir(cdir); + closedir(dir); + return -1; + } + + if (crash_base > mem_min) + mem_min = crash_base; + if (crash_base + crash_size < mem_max) + mem_max = crash_base + crash_size; + + add_usable_mem_rgns(0, crash_base + crash_size); + reserve(KDUMP_BACKUP_LIMIT, crash_base-KDUMP_BACKUP_LIMIT); + } + /* if LPAR, no need to read any more from /chosen */ if (platform != PLATFORM_PSERIES) { closedir(cdir); @@ -226,7 +306,6 @@ static int get_devtree_details() closedir(dir); return -1; } - unsigned long long htab_base, htab_size; if (fread(&htab_base, sizeof(unsigned long), 1, file) != 1) { perror(fname); fclose(file); @@ -265,7 +344,6 @@ static int get_devtree_details() closedir(dir); return -1; } - unsigned int rtas_base, rtas_size; if (fread(&rtas_base, sizeof(unsigned int), 1, file) != 1) { perror(fname); fclose(file); @@ -295,6 +373,8 @@ static int get_devtree_details() exclude_range[i].start = rtas_base; exclude_range[i].end = rtas_base + rtas_size; i++; + if (kexec_flags & KEXEC_ON_CRASH) + add_usable_mem_rgns(rtas_base, rtas_size); } /* rtas */ if (strncmp(dentry->d_name, "memory at 0", 8) == 0) { @@ -314,8 +394,10 @@ static int get_devtree_details() } rmo_base = ((unsigned long long *)buf)[0]; rmo_top = rmo_base + ((unsigned long long *)buf)[1]; - if (platform == PLATFORM_PSERIES) - if (memory_max > 0x40000000UL? (rmo_top = 0x40000000UL) : (rmo_top = memory_max)); + if (platform == PLATFORM_PSERIES) { + if (rmo_top > 0x30000000UL) + rmo_top = 0x30000000UL; + } fclose(file); closedir(cdir); } /* memory */ @@ -360,6 +442,8 @@ static int get_devtree_details() exclude_range[i].start = tce_base; exclude_range[i].end = tce_base + tce_size; i++; + if (kexec_flags & KEXEC_ON_CRASH) + add_usable_mem_rgns(tce_base, tce_size); closedir(cdir); } /* pci */ } @@ -368,7 +452,31 @@ static int get_devtree_details() nr_exclude_ranges = i; sort_ranges(); -#if 0 + + /* add crash_region and remove rtas range from exclude regions if it + * lies within crash region + */ + if (kexec_flags & KEXEC_ON_CRASH) { + unsigned long new_crash_size; + if (crash_base < rtas_base && + ((crash_base + crash_size) > (rtas_base + rtas_size))){ + new_crash_size = rtas_base - crash_base; + add_exclude_rgns(crash_base, new_crash_size); + new_crash_size = (crash_base + crash_size) - (rtas_base + rtas_size); + add_exclude_rgns(rtas_base + rtas_size, new_crash_size); + } else if (crash_base < rtas_base && + ((rtas_base + rtas_size) > (crash_base + crash_size))){ + new_crash_size = rtas_base - crash_base; + add_exclude_rgns(crash_base, new_crash_size); + } else if (crash_base > rtas_base && + ((rtas_base + rtas_size) < (crash_base + crash_size))){ + new_crash_size = (crash_base + crash_size) - (rtas_base + rtas_size); + add_exclude_rgns(rtas_base + rtas_size, new_crash_size); + } else + add_exclude_rgns(crash_base, crash_size); + } + +#ifdef DEBUG int k; for (k = 0; k < i; k++) fprintf(stderr, "exclude_range sorted exclude_range[%d] start:%lx, end:%lx\n", k, exclude_range[k].start, exclude_range[k].end); @@ -377,7 +485,7 @@ static int get_devtree_details() } /* Setup a sorted list of memory ranges. */ -int setup_memory_ranges(void) +int setup_memory_ranges(unsigned long kexec_flags) { int i, j = 0; @@ -386,7 +494,7 @@ int setup_memory_ranges(void) */ get_base_ranges(); - get_devtree_details(); + get_devtree_details(kexec_flags); for (i = 0; i < nr_exclude_ranges; i++) { /* If first exclude range does not start with 0, include the @@ -435,17 +543,18 @@ int setup_memory_ranges(void) j--; break; } - if ((memory_range[j-1].start < rmo_top) && (memory_range[j-1].end >= rmo_top)) { + if ((memory_range[j-1].start < rmo_top) && + (memory_range[j-1].end >= rmo_top)) { memory_range[j-1].end = rmo_top; break; } } nr_memory_ranges = j; -#if 0 +#ifdef DEBUG int k; for (k = 0; k < j; k++) - fprintf(stderr, "seup_memory_ranges memory_range[%d] start:%lx, end:%lx\n", k, memory_range[k].start, memory_range[k].end); + fprintf(stderr, "setup_memory_ranges memory_range[%d] start:%lx, end:%lx\n", k, memory_range[k].start, memory_range[k].end); #endif return 0; } @@ -454,7 +563,7 @@ int setup_memory_ranges(void) int get_memory_ranges(struct memory_range **range, int *ranges, unsigned long kexec_flags) { - setup_memory_ranges(); + setup_memory_ranges(kexec_flags); *range = memory_range; *ranges = nr_memory_ranges; fprintf(stderr, "get memory ranges:%d\n", nr_memory_ranges); diff -puN kexec/arch/ppc64/kexec-ppc64.h~ppc64-kdump-crash-memory-support kexec/arch/ppc64/kexec-ppc64.h --- kexec-tools-1.101/kexec/arch/ppc64/kexec-ppc64.h~ppc64-kdump-crash-memory-support 2006-01-15 07:07:36.000000000 +0530 +++ kexec-tools-1.101-sharada/kexec/arch/ppc64/kexec-ppc64.h 2006-01-15 07:15:01.000000000 +0530 @@ -1,6 +1,12 @@ #ifndef KEXEC_PPC64_H #define KEXEC_PPC64_H +#define MAX_MEMORY_RANGES 256 /* TO FIX - needs to be dynamically set */ +#define MAXBYTES 128 +#define MAX_LINE 160 + +int setup_memory_ranges(unsigned long kexec_flags); + int elf_ppc64_probe(const char *buf, off_t len); int elf_ppc64_load(int argc, char **argv, const char *buf, off_t len, struct kexec_info *info); @@ -20,6 +26,10 @@ struct bootblock { boot_physid; }; +struct exclude_range { + unsigned long long start, end; +}; + typedef struct mem_rgns { unsigned int size; struct exclude_range ranges[MAX_MEMORY_RANGES]; diff -puN /dev/null kexec/arch/ppc64/crashdump-ppc64.c --- /dev/null 2004-07-01 07:56:11.000000000 +0530 +++ kexec-tools-1.101-sharada/kexec/arch/ppc64/crashdump-ppc64.c 2006-01-15 08:06:29.000000000 +0530 @@ -0,0 +1,293 @@ +/* + * kexec: Linux boots Linux + * + * Created by: R Sharada (sharada at in.ibm.com) + * Copyright (C) IBM Corporation, 2005. All rights reserved + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation (version 2 of the License). + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ +#include +#include +#include +#include +#include +#include +#include +#include "../../kexec.h" +#include "../../kexec-elf.h" +#include "../../kexec-syscall.h" +#include "../../crashdump.h" +#include "kexec-ppc64.h" +#include "crashdump-ppc64.h" + +/* Stores a sorted list of RAM memory ranges for which to create elf headers. + * A separate program header is created for backup region + */ +static struct memory_range crash_memory_range[CRASH_MAX_MEMORY_RANGES]; + +/* + * Used to save various memory ranges/regions needed for the captured + * kernel to boot. (lime memmap= option in other archs) + */ +mem_rgns_t usablemem_rgns = {0, }; + +/* array to store memory regions to be excluded from elf header creation */ +mem_rgns_t exclude_rgns = {0, }; + +static int sort_regions(mem_rgns_t *rgn); + +/* Reads the appropriate file and retrieves the SYSTEM RAM regions for whom to + * create Elf headers. Keeping it separate from get_memory_ranges() as + * requirements are different in the case of normal kexec and crashdumps. + * + * Normal kexec needs to look at all of available physical memory irrespective + * of the fact how much of it is being used by currently running kernel. + * Crashdumps need to have access to memory regions actually being used by + * running kernel. Expecting a different file/data structure than /proc/iomem + * to look into down the line. May be something like /proc/kernelmem or may + * be zone data structures exported from kernel. + */ +static int get_crash_memory_ranges(struct memory_range **range, int *ranges) +{ + + int memory_ranges = 0; + char device_tree[256] = "/proc/device-tree/"; + char fname[256]; + char buf[MAXBYTES-1]; + DIR *dir, *dmem; + FILE *file; + struct dirent *dentry, *mentry; + int i, n, match; + unsigned long long start, end, cstart, cend; + + /* create a separate program header for the backup region */ + crash_memory_range[0].start = 0x0000000000000000; + crash_memory_range[0].end = 0x0000000000008000; + crash_memory_range[0].type = RANGE_RAM; + memory_ranges++; + + if ((dir = opendir(device_tree)) == NULL) { + perror(device_tree); + return -1; + } + while ((dentry = readdir(dir)) != NULL) { + if (strncmp(dentry->d_name, "memory@", 7)) + continue; + strcpy(fname, device_tree); + strcat(fname, dentry->d_name); + if ((dmem = opendir(fname)) == NULL) { + perror(fname); + closedir(dir); + return -1; + } + while ((mentry = readdir(dmem)) != NULL) { + if (strcmp(mentry->d_name, "reg")) + continue; + strcat(fname, "/reg"); + if ((file = fopen(fname, "r")) == NULL) { + perror(fname); + closedir(dmem); + closedir(dir); + return -1; + } + if ((n = fread(buf, 1, MAXBYTES, file)) < 0) { + perror(fname); + fclose(file); + closedir(dmem); + closedir(dir); + return -1; + } + if (memory_ranges >= MAX_MEMORY_RANGES) + break; + start = ((unsigned long long *)buf)[0]; + end = start + ((unsigned long long *)buf)[1]; + if (start == 0 && end >= 0x8000) + start = 0x8000; + match = 0; + sort_regions(&exclude_rgns); + + /* exclude crash reserved regions */ + for (i = 0; i < exclude_rgns.size; i++) { + cstart = exclude_rgns.ranges[i].start; + cend = exclude_rgns.ranges[i].end; + if (cstart < end && cend > start) { + if ((cstart == start) && (cend == end)) { + match = 1; + continue; + } + if (start < cstart && end > cend) { + match = 1; + crash_memory_range[memory_ranges].start = start; + crash_memory_range[memory_ranges].end = cstart - 1; + crash_memory_range[memory_ranges].type = RANGE_RAM; + memory_ranges++; + crash_memory_range[memory_ranges].start = cend + 1; + crash_memory_range[memory_ranges].end = end; + crash_memory_range[memory_ranges].type = RANGE_RAM; + memory_ranges++; + break; + } else if (start < cstart) { + match = 1; + crash_memory_range[memory_ranges].start = start; + crash_memory_range[memory_ranges].end = cstart - 1; + crash_memory_range[memory_ranges].type = RANGE_RAM; + memory_ranges++; + end = cstart - 1; + continue; + } else if (end > cend){ + match = 1; + crash_memory_range[memory_ranges].start = cend + 1; + crash_memory_range[memory_ranges].end = end; + crash_memory_range[memory_ranges].type = RANGE_RAM; + memory_ranges++; + start = cend + 1; + continue; + } + } + + } /* end of for loop */ + if (!match) { + crash_memory_range[memory_ranges].start = start; + crash_memory_range[memory_ranges].end = end; + crash_memory_range[memory_ranges].type = RANGE_RAM; + memory_ranges++; + } + + fclose(file); + } + closedir(dmem); + } + closedir(dir); + + /* + * Can not trust the memory regions order that we read from + * device-tree. Hence, get the MAX end value. + */ + for (i = 0; i < memory_ranges; i++) + if (saved_max_mem < crash_memory_range[i].end) + saved_max_mem = crash_memory_range[i].end; + + *range = crash_memory_range; + *ranges = memory_ranges; +#if DEBUG + int i; + printf("CRASH MEMORY RANGES\n"); + for(i = 0; i < *ranges; i++) { + start = crash_memory_range[i].start; + end = crash_memory_range[i].end; + fprintf(stderr, "%016Lx-%016Lx\n", start, end); + } +#endif + return 0; +} + +/* + * Used to save various memory regions needed for the captured kernel. + */ + +void add_usable_mem_rgns(unsigned long long base, unsigned long long size) +{ + int i; + unsigned long long end = base + size; + unsigned long long ustart, uend; + + base = _ALIGN_DOWN(base, PAGE_SIZE); + end = _ALIGN_UP(end, PAGE_SIZE); + + for (i=0; i < usablemem_rgns.size; i++) { + ustart = usablemem_rgns.ranges[i].start; + uend = usablemem_rgns.ranges[i].end; + if (base < uend && end > ustart) { + if ((base >= ustart) && (end <= uend)) + return; + if (base < ustart && end > uend) { + usablemem_rgns.ranges[i].start = base; + usablemem_rgns.ranges[i].end = end; + return; + } else if (base < ustart) { + usablemem_rgns.ranges[i].start = base; + return; + } else if (end > uend){ + usablemem_rgns.ranges[i].end = end; + return; + } + } + } + usablemem_rgns.ranges[usablemem_rgns.size].start = base; + usablemem_rgns.ranges[usablemem_rgns.size++].end = end; + +#ifdef DEBUG + fprintf(stderr, "usable memory rgns size:%d base:%lx size:%lx\n", usablemem_rgns.size, base, size); +#endif +} + +/* + * Used to exclude various memory regions that do not need elf hdr generation + */ + +void add_exclude_rgns(unsigned long long base, unsigned long long size) +{ + int i; + unsigned long long end = base + size; + unsigned long long xstart, xend; + + for (i=0; i < exclude_rgns.size; i++) { + xstart = exclude_rgns.ranges[i].start; + xend = exclude_rgns.ranges[i].end; + if (base < xend && end > xstart) { + if ((base >= xstart) && (end <= xend)) + return; + if (base < xstart && end > xend) { + exclude_rgns.ranges[i].start = base; + exclude_rgns.ranges[i].end = end; + return; + } else if (base < xstart) { + exclude_rgns.ranges[i].start = base; + exclude_rgns.ranges[i].end = xend; + return; + } else if (end > xend){ + exclude_rgns.ranges[i].start = xstart; + exclude_rgns.ranges[i].end = end; + return; + } + } + } + exclude_rgns.ranges[exclude_rgns.size].start = base; + exclude_rgns.ranges[exclude_rgns.size++].end = end; + +#ifdef DEBUG + fprintf(stderr, "exclude rgns size:%d base:%lx end:%lx size:%lx\n", exclude_rgns.size, base, end, size); +#endif +} + +static int sort_regions(mem_rgns_t *rgn) +{ + int i, j; + unsigned long long tstart, tend; + for (i = 0; i < rgn->size; i++) { + for (j = 0; j < rgn->size - i - 1; j++) { + if (rgn->ranges[j].start > rgn->ranges[j+1].start) { + tstart = rgn->ranges[j].start; + tend = rgn->ranges[j].end; + rgn->ranges[j].start = rgn->ranges[j+1].start; + rgn->ranges[j].end = rgn->ranges[j+1].end; + rgn->ranges[j+1].start = tstart; + rgn->ranges[j+1].end = tend; + } + } + } + return 0; + +} + diff -puN kexec/arch/ppc64/crashdump-ppc64.h~ppc64-kdump-crash-memory-support kexec/arch/ppc64/crashdump-ppc64.h --- kexec-tools-1.101/kexec/arch/ppc64/crashdump-ppc64.h~ppc64-kdump-crash-memory-support 2006-01-15 08:06:43.000000000 +0530 +++ kexec-tools-1.101-sharada/kexec/arch/ppc64/crashdump-ppc64.h 2006-01-15 08:09:45.000000000 +0530 @@ -1,7 +1,10 @@ #ifndef CRASHDUMP_PPC64_H #define CRASHDUMP_PPC64_H +int load_crashdump_segments(struct kexec_info *info, char *mod_cmdline, + unsigned long max_addr, unsigned long min_base); void add_usable_mem_rgns(unsigned long long base, unsigned long long size); +void add_exclude_rgns(unsigned long long base, unsigned long long size); #define PAGE_OFFSET 0xC000000000000000 #define KERNELBASE PAGE_OFFSET @@ -24,4 +27,7 @@ void add_usable_mem_rgns(unsigned long l #define _ALIGN_DOWN(addr,size) ((addr)&(~((size)-1))) #define PAGE_SIZE 4096 +extern unsigned long long crash_base; +extern unsigned long long crash_size; + #endif /* CRASHDUMP_PPC64_H */ _ _______________________________________________ fastboot mailing list fastboot at lists.osdl.org https://lists.osdl.org/mailman/listinfo/fastboot ----- End forwarded message ----- From arnd at arndb.de Thu Jan 19 01:29:56 2006 From: arnd at arndb.de (Arnd Bergmann) Date: Wed, 18 Jan 2006 15:29:56 +0100 Subject: [patch 0/8] systemsim and hvc_console patches In-Reply-To: <20060117125211.GA26550@lst.de> References: <20060113183033.696401000@localhost> <200601151310.14135.arndb@de.ibm.com> <20060117125211.GA26550@lst.de> Message-ID: <200601181529.56615.arnd@arndb.de> On Tuesday 17 January 2006 13:52, Christoph Hellwig wrote: > On Sun, Jan 15, 2006 at 01:10:13PM +0000, Arnd Bergmann wrote: > > I think systemsim does have accurate models for a number of IDE and > > network devices, but I would rather not have to use them because they will > > run at a horribly slow speed, because they try to model the performance > > of the devices relative to the CPU cycles. > > > > For the cell simulator in particular, I think there is no model of the > > spider-pic interrupt controller, which means that systemsim can not use > > the models for the devices it uses on other platforms. Eric, is this still > > correct? > > So please add support for vioscsi and vioeth. ?IBM already supports > these virtual storage and network devices and we don't need to add yet > more. ?There's already more than enough of these virtual or simulated > hardware drivers in the tree. (adding more people to Cc:) Can someone from the systemsim team please comment on this? the thread leading here is archived at http://ozlabs.org/pipermail/linuxppc64-dev/2006-January/thread.html#7600 Arnd <>< From will_schmidt at vnet.ibm.com Thu Jan 19 01:38:09 2006 From: will_schmidt at vnet.ibm.com (will schmidt) Date: Wed, 18 Jan 2006 08:38:09 -0600 Subject: 2.6.15 failure on power4 iSeries In-Reply-To: <200601181055.53605.michael@ellerman.id.au> References: <43CC2DCC.6010201@vnet.ibm.com> <200601171122.14283.michael@ellerman.id.au> <43CD0269.6060909@vnet.ibm.com> <200601181055.53605.michael@ellerman.id.au> Message-ID: <43CE52D1.9020309@vnet.ibm.com> Michael Ellerman wrote: > On Wed, 18 Jan 2006 01:42, will schmidt wrote: > >>Michael Ellerman wrote: >> >>>On Tue, 17 Jan 2006 10:35, will schmidt wrote: >>> >>>>attempting to boot current kernels on a power4 iSeries doesnt work. have >>>>tried both the powerpc-git tree and the torvalds-git tree. >>>> >>>>OS/400 RefCode is "C200 82FF". (which means nothing to me :-) >>> >>>C20082FF VSP IPL complete successfully >>> >>> >>>>no console output at all. >>> >>>Enable early debugging for iSeries (now via Kconfig, under Kernel >>>hacking), then enable DEBUG in platforms/iseries/* and kernel/setup_64.c, >>>then when it dies hit "ctrl-x ctrl-x" and see if you get any output. >> >> -> early_setup() >>Probing machine type for platform 201... >>Found, Initializing memory management... >> <- early_setup() >> -> setup_system() >> -> initialize_cache_info() >> <- initialize_cache_info() >> -> iSeries_init_early() >> <- iSeries_init_early() >>Mapping load area - physical addr = 0000000000000000 >> absolute addr = 0000000018000000 >>Load area size 32768K >>HPT absolute addr = 000000014a000000, size = 32768K >>Mainstore_VPD: Regatta >>ms_vpd: processing area 0 blocks=1 >> block 0 absStart=8000000000000000 absEnd=8000000100000000 >>ms_vpd: processing area 1 blocks=1 >> block 0 absStart=8000000100000000 absEnd=8000000200000000 >>ms_vpd: processing area 2 blocks=1 >> block 0 absStart=8000000200000000 absEnd=8000000280000000 >>ms_vpd: 3 sorted memory blocks >> Bitmap range: 0000000000000000 - 0000000100000000 >> Absolute range: 8000000000000000 - 8000000100000000 >> Bitmap range: 0000000100000000 - 0000000200000000 >> Absolute range: 8000000100000000 - 8000000200000000 >> Bitmap range: 0000000200000000 - 0000000280000000 >> Absolute range: 8000000200000000 - 8000000280000000 >>Mainstore_VPD: numMemoryBlocks = 3 >>Mainstore_VPD: block 0 logical chunks 0000000000000000 - 0000000000004000 >> abs chunks 0000000000000000 - >>0000000000004000 Mainstore_VPD: block 1 logical chunks 0000000000004000 - >>0000000000008000 abs chunks 0000000000004000 - 0000000000008000 >>Mainstore_VPD: block 2 logical chunks 0000000000008000 - 000000000000a000 >>abs chunks 0000000000008000 - 000000000000a000 Page orders: linear mapping >>= 12, others = 12 >>mf.c: iSeries Linux LPAR Machine Facilities initialized >> -> smp_release_cpus() >> <- smp_release_cpus() >> <- setup_system() >> >> >>This looks like the "2.6.15-mm4 failure on power5" output.. but I dont >>see a *cpuc-to-mutexes.patch in this tree to back out. (torvalds-git) >> >>Will clean my glasses and look closer in a bit.. :-) > > > Yeah, looks similar. I can't reproduce that crash on my POWER5 box here > though, so I'm not sure if that patch is actually the problem. Might be worth > git bisecting. I already git bisected to get it narrowed down to that one patch. Or are you saying that the patch is broken up into more parts in the powerpc-git tree? Same tree builds and boots OK on power5 partition here too.. this seems to be something unique to power4 iSeries. > > You could try adding calls to udbg_printf() in start_kernel() to see if we're > getting in there. > > cheers > From michael at ellerman.id.au Thu Jan 19 02:02:17 2006 From: michael at ellerman.id.au (Michael Ellerman) Date: Thu, 19 Jan 2006 02:02:17 +1100 Subject: 2.6.15 failure on power4 iSeries In-Reply-To: <43CE52D1.9020309@vnet.ibm.com> References: <43CC2DCC.6010201@vnet.ibm.com> <200601181055.53605.michael@ellerman.id.au> <43CE52D1.9020309@vnet.ibm.com> Message-ID: <200601190202.20260.michael@ellerman.id.au> On Thu, 19 Jan 2006 01:38, will schmidt wrote: > Michael Ellerman wrote: > > On Wed, 18 Jan 2006 01:42, will schmidt wrote: > >>Michael Ellerman wrote: > >>>On Tue, 17 Jan 2006 10:35, will schmidt wrote: > >>>>attempting to boot current kernels on a power4 iSeries doesnt work. > >>>> have tried both the powerpc-git tree and the torvalds-git tree. > >>>> > >>>>OS/400 RefCode is "C200 82FF". (which means nothing to me :-) > >>> > >>>C20082FF VSP IPL complete successfully > >>> > >>>>no console output at all. > >> > >>This looks like the "2.6.15-mm4 failure on power5" output.. but I dont > >>see a *cpuc-to-mutexes.patch in this tree to back out. (torvalds-git) > >> > >>Will clean my glasses and look closer in a bit.. :-) > > > > Yeah, looks similar. I can't reproduce that crash on my POWER5 box here > > though, so I'm not sure if that patch is actually the problem. Might be > > worth git bisecting. > > I already git bisected to get it narrowed down to that one patch. Or are > you saying that the patch is broken up into more parts in the powerpc-git > tree? > > Same tree builds and boots OK on power5 partition here too.. this seems > to be something unique to power4 iSeries. Sorry, getting the two bugs confused. I'm not sure which of the code in question is in mm vs Linus' git. It might be worth trying one of Ingo's patches for the other bug though, just in case. > > You could try adding calls to udbg_printf() in start_kernel() to see if > > we're getting in there. Any luck with this? cheers -- Michael Ellerman IBM OzLabs email: michael:ellerman.id.au inmsg: mpe:jabber.org wwweb: http://michael.ellerman.id.au phone: +61 2 6212 1183 (tie line 70 21183) We do not inherit the earth from our ancestors, we borrow it from our children. - S.M.A.R.T Person -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: not available Url : http://ozlabs.org/pipermail/linuxppc64-dev/attachments/20060119/abd7d37a/attachment.pgp From will_schmidt at vnet.ibm.com Thu Jan 19 03:00:25 2006 From: will_schmidt at vnet.ibm.com (will schmidt) Date: Wed, 18 Jan 2006 10:00:25 -0600 Subject: 2.6.15 failure on power4 iSeries In-Reply-To: <200601190202.20260.michael@ellerman.id.au> References: <43CC2DCC.6010201@vnet.ibm.com> <200601181055.53605.michael@ellerman.id.au> <43CE52D1.9020309@vnet.ibm.com> <200601190202.20260.michael@ellerman.id.au> Message-ID: <43CE6619.3080002@vnet.ibm.com> Michael Ellerman wrote: > On Thu, 19 Jan 2006 01:38, will schmidt wrote: > >>Michael Ellerman wrote: >> >>>On Wed, 18 Jan 2006 01:42, will schmidt wrote: >>> >>>>Michael Ellerman wrote: >>>> >>>>>On Tue, 17 Jan 2006 10:35, will schmidt wrote: >>>>> >>>>>>attempting to boot current kernels on a power4 iSeries doesnt work. >>>>>>have tried both the powerpc-git tree and the torvalds-git tree. >>>>>> >>>>>>OS/400 RefCode is "C200 82FF". (which means nothing to me :-) >>>>> >>>>>C20082FF VSP IPL complete successfully >>>>> >>>>> >>>>>>no console output at all. >>>> >>>>This looks like the "2.6.15-mm4 failure on power5" output.. but I dont >>>>see a *cpuc-to-mutexes.patch in this tree to back out. (torvalds-git) >>>> >>>>Will clean my glasses and look closer in a bit.. :-) >>> >>>Yeah, looks similar. I can't reproduce that crash on my POWER5 box here >>>though, so I'm not sure if that patch is actually the problem. Might be >>>worth git bisecting. >> >>I already git bisected to get it narrowed down to that one patch. Or are >>you saying that the patch is broken up into more parts in the powerpc-git >>tree? >> >>Same tree builds and boots OK on power5 partition here too.. this seems >>to be something unique to power4 iSeries. > > > Sorry, getting the two bugs confused. I'm not sure which of the code in > question is in mm vs Linus' git. It might be worth trying one of Ingo's > patches for the other bug though, just in case. > > >>>You could try adding calls to udbg_printf() in start_kernel() to see if >>>we're getting in there. > > > Any luck with this? yup, just added some more debug.. looks like setup_arch() calls into do_init_bootmem() which loops around a reserve_bootmem() call. the last call into reserve_bootmem isnt returning. debug code: DBG("-> do_init_bootmem %d\n",__LINE__); DBG("-> do_init_bootmem lmb.reserved.cnt %d\n",lmb.reserved.cnt); /* reserve the sections we're already using */ for (i = 0; i < lmb.reserved.cnt; i++) { DBG("-> reserve_bootmem ( %lx %lx %d \n",lmb.reserved.region[i].base,lmb_size_bytes(&lmb.reserved,i),i); reserve_bootmem(lmb.reserved.region[i].base, lmb_size_bytes(&lmb.reserved, i)); DBG("<- reserve_bootmem \n"); } DBG("-> do_init_bootmem %d\n",__LINE__); console output: -> do_init_bootmem 285 -> do_init_bootmem lmb.reserved.cnt 5 -> reserve_bootmem ( 0 500e80 0 <- reserve_bootmem -> reserve_bootmem ( ffe5000 1b000 1 <- reserve_bootmem -> reserve_bootmem ( 3c7f7000 8000 2 <- reserve_bootmem -> reserve_bootmem ( 3c7ff668 994 3 <- reserve_bootmem -> reserve_bootmem ( 3c800000 0 4 looks like lmb_size_bytes is returning a zero for that last lmb.. > > cheers > From miltonm at bga.com Thu Jan 19 03:21:40 2006 From: miltonm at bga.com (Milton Miller) Date: Wed, 18 Jan 2006 10:21:40 -0600 Subject: [PATCH 0/5] powerpc: add device tree property updates In-Reply-To: <200601181520.10012.arnd@arndb.de> References: <0e51f66be939a091b19b252a4e9e0114@bga.com> <200601181520.10012.arnd@arndb.de> Message-ID: On Jan 18, 2006, at 8:20 AM, Arnd Bergmann wrote: > On Wednesday 18 January 2006 06:55, Milton Miller wrote: >> 3) this missed one of the requirements, >> ? ?namely that it create inodes and dentries on the fly, >> ? ?which precludes simple_readdir > > yes, that was intentional. I have no idea how to do that, so > I wrote down all that I know about for someone else to start from. Unfornately I think that drives back up into the fs, since libfs no longer works. >> 4) it doesn't have an api to add or remove files, which is necessary >> ? ?because of 3 above. > > I think it's an unrelated problem, but you're right. Well, if the fs were to read the tree then we only need calls to clear references to the nodes. Since its static ... >> Ok so what should the inode number be ? >> >> directory inodes should be the phandle .... yeah .. ?now to assign all >> the others non-conflicting. ? Do all the current phandle generators >> use either a memory address, offset, or small enum? > > Do we need the inode number to be meaningful at all? libfs makes sure > it's unique, I think that should be enough for us. If we stick to simple always in memory then that would be enough. But if we go to dynamic, then the numbers will change under us (ok, fat may be similar). inode numbers are unsigned long in the kernel, so to work on 32 bit platforms we have to divide that space between properties and nodes. phandles are also 32 bits, so this becomes problematic if we allow adding nodes on 32 bit platforms. > We have several types of objects that we need to maintain, the question > is which of them can be easily regenerated and which ones can remain > in memory. I think it should be easy to create inodes on the fly for device nodes. The hard part will be assigning the inode number, and maybe finding the dentry for removal. I'll see if I find time to try something here. Maybe just add an inode number to the property struct. > From the memory consumption perspective, it would be most > beneficial to have the inodes for the properties created > on the fly, and we could do the same their dentries without > getting overly complicated. That is the same that is now done > in sysfs, iirc. yes > it would also be convenient to merge the inode struct with > device_node struct as a simplification, but the properties > would still need separate inodes that are never cached. I don't think this will be necessary, and prevents us from reading nodes dynamically to save space. > oh, and another bug that I found: > 6) the recursive function to create the directory entries is never > called, > so the file system will only have a root entry right now. Hey. Your seperating the root inode creation into a seperate function made me miss this one. milton From mjw at us.ibm.com Thu Jan 19 04:25:24 2006 From: mjw at us.ibm.com (Mike Wolf) Date: Wed, 18 Jan 2006 11:25:24 -0600 Subject: [PATCH] powerpc: radeon and CONFIG_PM Message-ID: <1137605125.19133.2.camel@localhost.localdomain> Resend. Previous patch was line wrapped, so I'm going to try this again. The following comment is in drivers/video/aty/radeon_pm.c /* Check if we can power manage on suspend/resume. We can do * D2 on M6, M7 and M9, and we can resume from D3 cold a few other * "Mac" cards, but that's all. We need more infos about what the * BIOS does tho. Right now, all this PM stuff is pmac-only for that * reason. --BenH */ but it didnt check that CONFIG_PMAC was selected with CONFIG_PM. This results in build errors when CONFIG_PM is selected and pseries is built. Signed-off-by: Mike Wolf ======================================================================================= --- a/drivers/video/aty/radeon_pm.c 2005-12-08 14:17:45.000000000 +0800 +++ b/drivers/video/aty/radeon_pm.c 2005-12-08 14:35:57.000000000 +0800 @@ -2734,7 +2734,7 @@ * BIOS does tho. Right now, all this PM stuff is pmac-only for that * reason. --BenH */ -#if defined(CONFIG_PM) && defined(CONFIG_PPC_OF) +#if defined(CONFIG_PM) && defined(CONFIG_PPC_OF) && defined(CONFIG_PPC_PMAC) if (_machine == _MACH_Pmac && rinfo->of_node) { if (rinfo->is_mobility && rinfo->pm_reg && rinfo->family <= CHIP_FAMILY_RV250) @@ -2778,12 +2778,12 @@ OUTREG(TV_DAC_CNTL, INREG(TV_DAC_CNTL) | 0x07000000); #endif } -#endif /* defined(CONFIG_PM) && defined(CONFIG_PPC_OF) */ +#endif /* defined(CONFIG_PM) && defined(CONFIG_PPC_OF) && defined(CONFIG_PPC_PMAC) */ } void radeonfb_pm_exit(struct radeonfb_info *rinfo) { -#if defined(CONFIG_PM) && defined(CONFIG_PPC_OF) +#if defined(CONFIG_PM) && defined(CONFIG_PPC_OF) && defined(CONFIG_PPC_PMAC) if (rinfo->pm_mode != radeon_pm_none) pmac_set_early_video_resume(NULL, NULL); #endif From sharada at in.ibm.com Tue Jan 17 02:07:12 2006 From: sharada at in.ibm.com (R Sharada) Date: Mon, 16 Jan 2006 20:37:12 +0530 Subject: [PATCH 0/6] kdump support for ppc64 Message-ID: <20060116150712.GA4029@in.ibm.com> The patches that follow implement the kdump support for ppc64, built on top of the kexec infrastructure. The set contains 6 patches: - ppc64-fix-function-parameters.patch - this is required for basic kexec working on ppc64 for newer 2.6 kernels. - it fixes some function prototype changes that were made in arch independent code that affects ppc64 compilation - fixes some variable names, to keep in line with the changed kernel names (kernel_end, htab_base, htab_size) - ppc64-kdump-prepare-device-tree.patch - this patch adds the code for add_usable_mem_property to create the usable-memory property (thanks to Haren for this implementation) - adds code to modify commandline for bootargs - adds code to modify the initrd device-tree properties (thanks to Mohan for this fix) - includes some miscellaneous cleanups - ppc64-kdump-crash-memory-support.patch - this patch adds all the support for creating the various memory ranges required for creating elf headers for dump, memory regions to be excluded from the second kernel boot (similar to memmap option). - adds code to calculate memory regions to create elf headers for. excludes rtas region if it is within crash reserved region - adds code to read linux,crashkernel-base and linux,crashkernel-size values from device-tree and limit mem_min and mem_max for kdump case - adds code for adding usable memmory regions which is used by add_usablem_mem_property (thanks to Haren for this implementation) - ppc64-kdump-crash-segments-support.patch - this patch implements the code to load crashdump segments - adds code to add the additional commandline parameters required for crashdump - other miscellaneous cleanups and code re-order - ppc64-kdump-elf-hdr-generation.patch - creates elf core headers for the crash_memory_regions - ppc64-kdump-purgatory-backup-support.patch (thanks to Mohan for this getting this functionality working) - changes v2wrap.S to make secondary cpus spin directly in v2wrap code - adds code to use elf_rel_xx functions to retrieve and set the values for the variables used in purgatory (panic_kernel, backup_start, dt_offset, etc) - loads device-tree now as a separate segment - other miscellaneous compiler warning fixes in common kexec code Besides this, thanks to Haren and Mohan for all the intermediate testing, reporting bugs and providing fixes These patches were created on top of the following level of kexec-tools: - kexec-tools-1.101.tar.gz (from eric biederman's site or from lse site) + - kexec-tools-1.101-kdump.patch (consolidated patch posted on http://lse.sf.net/kdump) + - the 1-line patch posted by Mark Williamson http://lists.osdl.org/pipermail/fastboot/2005-June/001584.html The patches have been tested on the following level of kernel sources: - 2.6.15-git11 linux source + Haren's 2 patches, which were posted on the linuxppc64-dev list - http://ozlabs.org/pipermail/linuxppc64-dev/2006-January/007624.html (fix for crash-notes) - http://ozlabs.org/pipermail/linuxppc64-dev/2006-January/007314.html (initrd fix for free_initrd) Kernel Requirements: -------------------- 2.6 kernel with kexec and kdump support (CONFIG_KEXEC and CONFIG_CRASH_DUMP) - kexec requires CONFIG_KEXEC to be set to y - kdump requires CONFIG_KEXEC, CONFIG_CRASH_DUMP, CONFIG_EMBEDDED, CONFIG_PROC_VMCORE Note: At the moment, both require CONFIG_NUMA to be not set Test Status: ------------ They have been tested on Power5, 4 CPU, 12GB RAM p550, for 1. kexec load and kexec reboot (using kexec -l and kexec -e) (with and without ramdisk) 2. kexec load on panic and kdump reboot (using kexec -p and alt-sysrq-c trigger via /proc interface) (with and without ramdisk) The ramdisk tests were tried with ipr driver built as module Test Results: ------------- - Normal kexec works fine and all drivers come up ok. - Kdump triggered kexec reboot brings up the system ok to login prompt. However, n/w interface and usb drivers fail to come up. - /proc/vmcore is generated and copied over successfully in the kdump case - The vmcore thus generated was able to show backtraces using gdb Known issues: ------------- - During crashdump reboot, usb and network fails to come up - For now, the kexec kernels have to be built as non-NUMA. (NUMA kernels seem to panic in find_busiest_group) Commandline Syntax to use the tools: ------------------------------------ Note: parameters in [] braces are optional Normal kexec load and reboot: For load: ./kexec -l [--append="commandline options"] [--ramdisk=] For reboot: ./kexec -e kdump panic kernel load and reboot: For load: ./kexec -p [--append="commandline options"] [--ramdisk=] For triggering crashdump: echo c > /proc/sysrq-trigger Review and test comments, inputs are welcome Thanks and Regards, Sharada From sharada at in.ibm.com Tue Jan 17 02:10:52 2006 From: sharada at in.ibm.com (R Sharada) Date: Mon, 16 Jan 2006 20:40:52 +0530 Subject: [PATCH 3/6] ppc64-kdump-crash-memory-support In-Reply-To: <20060116150957.GC4029@in.ibm.com> References: <20060116150712.GA4029@in.ibm.com> <20060116150855.GB4029@in.ibm.com> <20060116150957.GC4029@in.ibm.com> Message-ID: <20060116151052.GD4029@in.ibm.com> This patch provides the support for setting up te various memory regions required for crashdump functionality. - limit mem_min and mem_max to crash_base and crash_end - create usable_memory_regions for use by second kernel - exclude regions not to be dumped by second kernel. For example - tce-table and crash reserved region - include rtas region in crash_memory_ranges if it falls within crash reserved region, as we want to obtain the rtas image in the dump core file. Signed-off-by: R Sharada Signed-off-by: Haren Myneni --- diff -puN kexec/arch/ppc64/kexec-ppc64.c~ppc64-kdump-crash-memory-support kexec/arch/ppc64/kexec-ppc64.c --- kexec-tools-1.101/kexec/arch/ppc64/kexec-ppc64.c~ppc64-kdump-crash-memory-support 2006-01-15 07:07:36.000000000 +0530 +++ kexec-tools-1.101-sharada/kexec/arch/ppc64/kexec-ppc64.c 2006-01-15 08:10:20.000000000 +0530 @@ -31,27 +31,23 @@ #include "../../kexec.h" #include "../../kexec-syscall.h" #include "kexec-ppc64.h" +#include "crashdump-ppc64.h" #include -#define MAX_MEMORY_RANGES 64 -#define MAX_LINE 160 -#define MAXBYTES 128 /* Platforms supported by kexec on PPC64 */ #define PLATFORM_PSERIES 0x0100 #define PLATFORM_PSERIES_LPAR 0x0101 -struct exclude_range { - unsigned long long start, end; -}; static struct exclude_range exclude_range[MAX_MEMORY_RANGES]; - static unsigned long long rmo_top; static unsigned int platform; static struct memory_range memory_range[MAX_MEMORY_RANGES]; static struct memory_range base_memory_range[MAX_MEMORY_RANGES]; unsigned long long memory_max = 0; -static int nr_memory_ranges; -static int nr_exclude_ranges; +static int nr_memory_ranges, nr_exclude_ranges; +unsigned long long crash_base, crash_size; + +static int sort_base_ranges(); /* Get base memory ranges */ static int get_base_ranges() @@ -105,17 +101,44 @@ static int get_base_ranges() ((unsigned long long *)buf)[1]; base_memory_range[local_memory_ranges].type = RANGE_RAM; local_memory_ranges++; -#if 0 +#ifdef DEBUG fprintf(stderr, "%016Lx-%016Lx : %x\n", memory_range[local_memory_ranges-1].start, memory_range[local_memory_ranges-1].end, memory_range[local_memory_ranges].type); #endif fclose(file); } - memory_max = base_memory_range[local_memory_ranges - 1].end; closedir(dmem); } closedir(dir); nr_memory_ranges = local_memory_ranges; + sort_base_ranges(); + memory_max = base_memory_range[nr_memory_ranges - 1].end; +#ifdef DEBUG fprintf(stderr, "get base memory ranges:%d\n", nr_memory_ranges); +#endif + return 0; +} + +/* Sort the base ranges in memory - this is useful for ensuring that our + * ranges are in ascending order, even if device-tree read of memory nodes + * is done differently. Also, could be used for other range coalescing later + */ +static int sort_base_ranges() +{ + int i, j; + unsigned long long tstart, tend; + + for (i = 0; i < nr_memory_ranges - 1; i++) { + for (j = 0; j < nr_memory_ranges - i - 1; j++) { + if (base_memory_range[j].start > base_memory_range[j+1].start) { + tstart = base_memory_range[j].start; + tend = base_memory_range[j].end; + base_memory_range[j].start = base_memory_range[j+1].start; + base_memory_range[j].end = base_memory_range[j+1].end; + base_memory_range[j+1].start = tstart; + base_memory_range[j+1].end = tend; + } + } + } return 0; } @@ -139,12 +162,17 @@ static int sort_ranges() return 0; } -/* Get devtree details and create exclude_range array */ -static int get_devtree_details() +/* Get devtree details and create exclude_range array + * Also create usablemem_ranges for KEXEC_ON_CRASH + */ +static int get_devtree_details(unsigned long kexec_flags) { unsigned long long rmo_base; unsigned long long tce_base; unsigned int tce_size; + unsigned int rtas_base, rtas_size; + unsigned long long htab_base, htab_size; + unsigned long long kernel_end; char buf[MAXBYTES-1]; char device_tree[256] = "/proc/device-tree/"; char fname[256]; @@ -189,6 +217,7 @@ static int get_devtree_details() return -1; } fclose(file); + memset(fname, 0, sizeof(fname)); strcpy(fname, device_tree); strcat(fname, dentry->d_name); @@ -199,7 +228,6 @@ static int get_devtree_details() closedir(dir); return -1; } - unsigned long long kernel_end; if (fread(&kernel_end, sizeof(unsigned long), 1, file) != 1) { perror(fname); fclose(file); @@ -207,10 +235,62 @@ static int get_devtree_details() closedir(dir); return -1; } + fclose(file); + /* Add kernel memory to exclude_range */ exclude_range[i].start = 0x0UL; exclude_range[i].end = kernel_end; i++; + + if (kexec_flags & KEXEC_ON_CRASH) { + memset(fname, 0, sizeof(fname)); + strcpy(fname, device_tree); + strcat(fname, dentry->d_name); + strcat(fname, "/linux,crashkernel-base"); + if ((file = fopen(fname, "r")) == NULL) { + perror(fname); + closedir(cdir); + closedir(dir); + return -1; + } + if (fread(&crash_base, sizeof(unsigned long), 1, + file) != 1) { + perror(fname); + fclose(file); + closedir(cdir); + closedir(dir); + return -1; + } + fclose(file); + + memset(fname, 0, sizeof(fname)); + strcpy(fname, device_tree); + strcat(fname, dentry->d_name); + strcat(fname, "/linux,crashkernel-size"); + if ((file = fopen(fname, "r")) == NULL) { + perror(fname); + closedir(cdir); + closedir(dir); + return -1; + } + if (fread(&crash_size, sizeof(unsigned long), 1, + file) != 1) { + perror(fname); + fclose(file); + closedir(cdir); + closedir(dir); + return -1; + } + + if (crash_base > mem_min) + mem_min = crash_base; + if (crash_base + crash_size < mem_max) + mem_max = crash_base + crash_size; + + add_usable_mem_rgns(0, crash_base + crash_size); + reserve(KDUMP_BACKUP_LIMIT, crash_base-KDUMP_BACKUP_LIMIT); + } + /* if LPAR, no need to read any more from /chosen */ if (platform != PLATFORM_PSERIES) { closedir(cdir); @@ -226,7 +306,6 @@ static int get_devtree_details() closedir(dir); return -1; } - unsigned long long htab_base, htab_size; if (fread(&htab_base, sizeof(unsigned long), 1, file) != 1) { perror(fname); fclose(file); @@ -265,7 +344,6 @@ static int get_devtree_details() closedir(dir); return -1; } - unsigned int rtas_base, rtas_size; if (fread(&rtas_base, sizeof(unsigned int), 1, file) != 1) { perror(fname); fclose(file); @@ -295,6 +373,8 @@ static int get_devtree_details() exclude_range[i].start = rtas_base; exclude_range[i].end = rtas_base + rtas_size; i++; + if (kexec_flags & KEXEC_ON_CRASH) + add_usable_mem_rgns(rtas_base, rtas_size); } /* rtas */ if (strncmp(dentry->d_name, "memory at 0", 8) == 0) { @@ -314,8 +394,10 @@ static int get_devtree_details() } rmo_base = ((unsigned long long *)buf)[0]; rmo_top = rmo_base + ((unsigned long long *)buf)[1]; - if (platform == PLATFORM_PSERIES) - if (memory_max > 0x40000000UL? (rmo_top = 0x40000000UL) : (rmo_top = memory_max)); + if (platform == PLATFORM_PSERIES) { + if (rmo_top > 0x30000000UL) + rmo_top = 0x30000000UL; + } fclose(file); closedir(cdir); } /* memory */ @@ -360,6 +442,8 @@ static int get_devtree_details() exclude_range[i].start = tce_base; exclude_range[i].end = tce_base + tce_size; i++; + if (kexec_flags & KEXEC_ON_CRASH) + add_usable_mem_rgns(tce_base, tce_size); closedir(cdir); } /* pci */ } @@ -368,7 +452,31 @@ static int get_devtree_details() nr_exclude_ranges = i; sort_ranges(); -#if 0 + + /* add crash_region and remove rtas range from exclude regions if it + * lies within crash region + */ + if (kexec_flags & KEXEC_ON_CRASH) { + unsigned long new_crash_size; + if (crash_base < rtas_base && + ((crash_base + crash_size) > (rtas_base + rtas_size))){ + new_crash_size = rtas_base - crash_base; + add_exclude_rgns(crash_base, new_crash_size); + new_crash_size = (crash_base + crash_size) - (rtas_base + rtas_size); + add_exclude_rgns(rtas_base + rtas_size, new_crash_size); + } else if (crash_base < rtas_base && + ((rtas_base + rtas_size) > (crash_base + crash_size))){ + new_crash_size = rtas_base - crash_base; + add_exclude_rgns(crash_base, new_crash_size); + } else if (crash_base > rtas_base && + ((rtas_base + rtas_size) < (crash_base + crash_size))){ + new_crash_size = (crash_base + crash_size) - (rtas_base + rtas_size); + add_exclude_rgns(rtas_base + rtas_size, new_crash_size); + } else + add_exclude_rgns(crash_base, crash_size); + } + +#ifdef DEBUG int k; for (k = 0; k < i; k++) fprintf(stderr, "exclude_range sorted exclude_range[%d] start:%lx, end:%lx\n", k, exclude_range[k].start, exclude_range[k].end); @@ -377,7 +485,7 @@ static int get_devtree_details() } /* Setup a sorted list of memory ranges. */ -int setup_memory_ranges(void) +int setup_memory_ranges(unsigned long kexec_flags) { int i, j = 0; @@ -386,7 +494,7 @@ int setup_memory_ranges(void) */ get_base_ranges(); - get_devtree_details(); + get_devtree_details(kexec_flags); for (i = 0; i < nr_exclude_ranges; i++) { /* If first exclude range does not start with 0, include the @@ -435,17 +543,18 @@ int setup_memory_ranges(void) j--; break; } - if ((memory_range[j-1].start < rmo_top) && (memory_range[j-1].end >= rmo_top)) { + if ((memory_range[j-1].start < rmo_top) && + (memory_range[j-1].end >= rmo_top)) { memory_range[j-1].end = rmo_top; break; } } nr_memory_ranges = j; -#if 0 +#ifdef DEBUG int k; for (k = 0; k < j; k++) - fprintf(stderr, "seup_memory_ranges memory_range[%d] start:%lx, end:%lx\n", k, memory_range[k].start, memory_range[k].end); + fprintf(stderr, "setup_memory_ranges memory_range[%d] start:%lx, end:%lx\n", k, memory_range[k].start, memory_range[k].end); #endif return 0; } @@ -454,7 +563,7 @@ int setup_memory_ranges(void) int get_memory_ranges(struct memory_range **range, int *ranges, unsigned long kexec_flags) { - setup_memory_ranges(); + setup_memory_ranges(kexec_flags); *range = memory_range; *ranges = nr_memory_ranges; fprintf(stderr, "get memory ranges:%d\n", nr_memory_ranges); diff -puN kexec/arch/ppc64/kexec-ppc64.h~ppc64-kdump-crash-memory-support kexec/arch/ppc64/kexec-ppc64.h --- kexec-tools-1.101/kexec/arch/ppc64/kexec-ppc64.h~ppc64-kdump-crash-memory-support 2006-01-15 07:07:36.000000000 +0530 +++ kexec-tools-1.101-sharada/kexec/arch/ppc64/kexec-ppc64.h 2006-01-15 07:15:01.000000000 +0530 @@ -1,6 +1,12 @@ #ifndef KEXEC_PPC64_H #define KEXEC_PPC64_H +#define MAX_MEMORY_RANGES 256 /* TO FIX - needs to be dynamically set */ +#define MAXBYTES 128 +#define MAX_LINE 160 + +int setup_memory_ranges(unsigned long kexec_flags); + int elf_ppc64_probe(const char *buf, off_t len); int elf_ppc64_load(int argc, char **argv, const char *buf, off_t len, struct kexec_info *info); @@ -20,6 +26,10 @@ struct bootblock { boot_physid; }; +struct exclude_range { + unsigned long long start, end; +}; + typedef struct mem_rgns { unsigned int size; struct exclude_range ranges[MAX_MEMORY_RANGES]; diff -puN /dev/null kexec/arch/ppc64/crashdump-ppc64.c --- /dev/null 2004-07-01 07:56:11.000000000 +0530 +++ kexec-tools-1.101-sharada/kexec/arch/ppc64/crashdump-ppc64.c 2006-01-15 08:06:29.000000000 +0530 @@ -0,0 +1,293 @@ +/* + * kexec: Linux boots Linux + * + * Created by: R Sharada (sharada at in.ibm.com) + * Copyright (C) IBM Corporation, 2005. All rights reserved + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation (version 2 of the License). + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ +#include +#include +#include +#include +#include +#include +#include +#include "../../kexec.h" +#include "../../kexec-elf.h" +#include "../../kexec-syscall.h" +#include "../../crashdump.h" +#include "kexec-ppc64.h" +#include "crashdump-ppc64.h" + +/* Stores a sorted list of RAM memory ranges for which to create elf headers. + * A separate program header is created for backup region + */ +static struct memory_range crash_memory_range[CRASH_MAX_MEMORY_RANGES]; + +/* + * Used to save various memory ranges/regions needed for the captured + * kernel to boot. (lime memmap= option in other archs) + */ +mem_rgns_t usablemem_rgns = {0, }; + +/* array to store memory regions to be excluded from elf header creation */ +mem_rgns_t exclude_rgns = {0, }; + +static int sort_regions(mem_rgns_t *rgn); + +/* Reads the appropriate file and retrieves the SYSTEM RAM regions for whom to + * create Elf headers. Keeping it separate from get_memory_ranges() as + * requirements are different in the case of normal kexec and crashdumps. + * + * Normal kexec needs to look at all of available physical memory irrespective + * of the fact how much of it is being used by currently running kernel. + * Crashdumps need to have access to memory regions actually being used by + * running kernel. Expecting a different file/data structure than /proc/iomem + * to look into down the line. May be something like /proc/kernelmem or may + * be zone data structures exported from kernel. + */ +static int get_crash_memory_ranges(struct memory_range **range, int *ranges) +{ + + int memory_ranges = 0; + char device_tree[256] = "/proc/device-tree/"; + char fname[256]; + char buf[MAXBYTES-1]; + DIR *dir, *dmem; + FILE *file; + struct dirent *dentry, *mentry; + int i, n, match; + unsigned long long start, end, cstart, cend; + + /* create a separate program header for the backup region */ + crash_memory_range[0].start = 0x0000000000000000; + crash_memory_range[0].end = 0x0000000000008000; + crash_memory_range[0].type = RANGE_RAM; + memory_ranges++; + + if ((dir = opendir(device_tree)) == NULL) { + perror(device_tree); + return -1; + } + while ((dentry = readdir(dir)) != NULL) { + if (strncmp(dentry->d_name, "memory@", 7)) + continue; + strcpy(fname, device_tree); + strcat(fname, dentry->d_name); + if ((dmem = opendir(fname)) == NULL) { + perror(fname); + closedir(dir); + return -1; + } + while ((mentry = readdir(dmem)) != NULL) { + if (strcmp(mentry->d_name, "reg")) + continue; + strcat(fname, "/reg"); + if ((file = fopen(fname, "r")) == NULL) { + perror(fname); + closedir(dmem); + closedir(dir); + return -1; + } + if ((n = fread(buf, 1, MAXBYTES, file)) < 0) { + perror(fname); + fclose(file); + closedir(dmem); + closedir(dir); + return -1; + } + if (memory_ranges >= MAX_MEMORY_RANGES) + break; + start = ((unsigned long long *)buf)[0]; + end = start + ((unsigned long long *)buf)[1]; + if (start == 0 && end >= 0x8000) + start = 0x8000; + match = 0; + sort_regions(&exclude_rgns); + + /* exclude crash reserved regions */ + for (i = 0; i < exclude_rgns.size; i++) { + cstart = exclude_rgns.ranges[i].start; + cend = exclude_rgns.ranges[i].end; + if (cstart < end && cend > start) { + if ((cstart == start) && (cend == end)) { + match = 1; + continue; + } + if (start < cstart && end > cend) { + match = 1; + crash_memory_range[memory_ranges].start = start; + crash_memory_range[memory_ranges].end = cstart - 1; + crash_memory_range[memory_ranges].type = RANGE_RAM; + memory_ranges++; + crash_memory_range[memory_ranges].start = cend + 1; + crash_memory_range[memory_ranges].end = end; + crash_memory_range[memory_ranges].type = RANGE_RAM; + memory_ranges++; + break; + } else if (start < cstart) { + match = 1; + crash_memory_range[memory_ranges].start = start; + crash_memory_range[memory_ranges].end = cstart - 1; + crash_memory_range[memory_ranges].type = RANGE_RAM; + memory_ranges++; + end = cstart - 1; + continue; + } else if (end > cend){ + match = 1; + crash_memory_range[memory_ranges].start = cend + 1; + crash_memory_range[memory_ranges].end = end; + crash_memory_range[memory_ranges].type = RANGE_RAM; + memory_ranges++; + start = cend + 1; + continue; + } + } + + } /* end of for loop */ + if (!match) { + crash_memory_range[memory_ranges].start = start; + crash_memory_range[memory_ranges].end = end; + crash_memory_range[memory_ranges].type = RANGE_RAM; + memory_ranges++; + } + + fclose(file); + } + closedir(dmem); + } + closedir(dir); + + /* + * Can not trust the memory regions order that we read from + * device-tree. Hence, get the MAX end value. + */ + for (i = 0; i < memory_ranges; i++) + if (saved_max_mem < crash_memory_range[i].end) + saved_max_mem = crash_memory_range[i].end; + + *range = crash_memory_range; + *ranges = memory_ranges; +#if DEBUG + int i; + printf("CRASH MEMORY RANGES\n"); + for(i = 0; i < *ranges; i++) { + start = crash_memory_range[i].start; + end = crash_memory_range[i].end; + fprintf(stderr, "%016Lx-%016Lx\n", start, end); + } +#endif + return 0; +} + +/* + * Used to save various memory regions needed for the captured kernel. + */ + +void add_usable_mem_rgns(unsigned long long base, unsigned long long size) +{ + int i; + unsigned long long end = base + size; + unsigned long long ustart, uend; + + base = _ALIGN_DOWN(base, PAGE_SIZE); + end = _ALIGN_UP(end, PAGE_SIZE); + + for (i=0; i < usablemem_rgns.size; i++) { + ustart = usablemem_rgns.ranges[i].start; + uend = usablemem_rgns.ranges[i].end; + if (base < uend && end > ustart) { + if ((base >= ustart) && (end <= uend)) + return; + if (base < ustart && end > uend) { + usablemem_rgns.ranges[i].start = base; + usablemem_rgns.ranges[i].end = end; + return; + } else if (base < ustart) { + usablemem_rgns.ranges[i].start = base; + return; + } else if (end > uend){ + usablemem_rgns.ranges[i].end = end; + return; + } + } + } + usablemem_rgns.ranges[usablemem_rgns.size].start = base; + usablemem_rgns.ranges[usablemem_rgns.size++].end = end; + +#ifdef DEBUG + fprintf(stderr, "usable memory rgns size:%d base:%lx size:%lx\n", usablemem_rgns.size, base, size); +#endif +} + +/* + * Used to exclude various memory regions that do not need elf hdr generation + */ + +void add_exclude_rgns(unsigned long long base, unsigned long long size) +{ + int i; + unsigned long long end = base + size; + unsigned long long xstart, xend; + + for (i=0; i < exclude_rgns.size; i++) { + xstart = exclude_rgns.ranges[i].start; + xend = exclude_rgns.ranges[i].end; + if (base < xend && end > xstart) { + if ((base >= xstart) && (end <= xend)) + return; + if (base < xstart && end > xend) { + exclude_rgns.ranges[i].start = base; + exclude_rgns.ranges[i].end = end; + return; + } else if (base < xstart) { + exclude_rgns.ranges[i].start = base; + exclude_rgns.ranges[i].end = xend; + return; + } else if (end > xend){ + exclude_rgns.ranges[i].start = xstart; + exclude_rgns.ranges[i].end = end; + return; + } + } + } + exclude_rgns.ranges[exclude_rgns.size].start = base; + exclude_rgns.ranges[exclude_rgns.size++].end = end; + +#ifdef DEBUG + fprintf(stderr, "exclude rgns size:%d base:%lx end:%lx size:%lx\n", exclude_rgns.size, base, end, size); +#endif +} + +static int sort_regions(mem_rgns_t *rgn) +{ + int i, j; + unsigned long long tstart, tend; + for (i = 0; i < rgn->size; i++) { + for (j = 0; j < rgn->size - i - 1; j++) { + if (rgn->ranges[j].start > rgn->ranges[j+1].start) { + tstart = rgn->ranges[j].start; + tend = rgn->ranges[j].end; + rgn->ranges[j].start = rgn->ranges[j+1].start; + rgn->ranges[j].end = rgn->ranges[j+1].end; + rgn->ranges[j+1].start = tstart; + rgn->ranges[j+1].end = tend; + } + } + } + return 0; + +} + diff -puN kexec/arch/ppc64/crashdump-ppc64.h~ppc64-kdump-crash-memory-support kexec/arch/ppc64/crashdump-ppc64.h --- kexec-tools-1.101/kexec/arch/ppc64/crashdump-ppc64.h~ppc64-kdump-crash-memory-support 2006-01-15 08:06:43.000000000 +0530 +++ kexec-tools-1.101-sharada/kexec/arch/ppc64/crashdump-ppc64.h 2006-01-15 08:09:45.000000000 +0530 @@ -1,7 +1,10 @@ #ifndef CRASHDUMP_PPC64_H #define CRASHDUMP_PPC64_H +int load_crashdump_segments(struct kexec_info *info, char *mod_cmdline, + unsigned long max_addr, unsigned long min_base); void add_usable_mem_rgns(unsigned long long base, unsigned long long size); +void add_exclude_rgns(unsigned long long base, unsigned long long size); #define PAGE_OFFSET 0xC000000000000000 #define KERNELBASE PAGE_OFFSET @@ -24,4 +27,7 @@ void add_usable_mem_rgns(unsigned long l #define _ALIGN_DOWN(addr,size) ((addr)&(~((size)-1))) #define PAGE_SIZE 4096 +extern unsigned long long crash_base; +extern unsigned long long crash_size; + #endif /* CRASHDUMP_PPC64_H */ _ From will_schmidt at vnet.ibm.com Thu Jan 19 09:07:43 2006 From: will_schmidt at vnet.ibm.com (will schmidt) Date: Wed, 18 Jan 2006 16:07:43 -0600 Subject: 2.6.15 failure on power4 iSeries In-Reply-To: <43CE6619.3080002@vnet.ibm.com> References: <43CC2DCC.6010201@vnet.ibm.com> <200601181055.53605.michael@ellerman.id.au> <43CE52D1.9020309@vnet.ibm.com> <200601190202.20260.michael@ellerman.id.au> <43CE6619.3080002@vnet.ibm.com> Message-ID: <43CEBC2F.2060507@vnet.ibm.com> will schmidt wrote: > Michael Ellerman wrote: > >>On Thu, 19 Jan 2006 01:38, will schmidt wrote: >> >> >>>Michael Ellerman wrote: >>> >>> >>>>On Wed, 18 Jan 2006 01:42, will schmidt wrote: >>>> >>>> >>>>>Michael Ellerman wrote: >>>>> >>>>> >>>>>>On Tue, 17 Jan 2006 10:35, will schmidt wrote: >>>>>> >>>>>> >>>>>>>attempting to boot current kernels on a power4 iSeries doesnt work. >>>>>>>have tried both the powerpc-git tree and the torvalds-git tree. >>>>>>> >>>>>>>OS/400 RefCode is "C200 82FF". (which means nothing to me :-) >>>>>> >>>>>>C20082FF VSP IPL complete successfully >>>>>> >>>>>> >>>>>> >>>>>>>no console output at all. >>>>> >>>>>This looks like the "2.6.15-mm4 failure on power5" output.. but I dont >>>>>see a *cpuc-to-mutexes.patch in this tree to back out. (torvalds-git) >>>>> >>>>>Will clean my glasses and look closer in a bit.. :-) >>>> >>>>Yeah, looks similar. I can't reproduce that crash on my POWER5 box here >>>>though, so I'm not sure if that patch is actually the problem. Might be >>>>worth git bisecting. >>> >>>I already git bisected to get it narrowed down to that one patch. Or are >>>you saying that the patch is broken up into more parts in the powerpc-git >>>tree? >>> >>>Same tree builds and boots OK on power5 partition here too.. this seems >>>to be something unique to power4 iSeries. >> >> >>Sorry, getting the two bugs confused. I'm not sure which of the code in >>question is in mm vs Linus' git. It might be worth trying one of Ingo's >>patches for the other bug though, just in case. >> >> >> >>>>You could try adding calls to udbg_printf() in start_kernel() to see if >>>>we're getting in there. >> >> >>Any luck with this? > > > yup, just added some more debug.. > > looks like setup_arch() calls into do_init_bootmem() which loops around a reserve_bootmem() call. the last call into reserve_bootmem isnt returning. > > debug code: > DBG("-> do_init_bootmem %d\n",__LINE__); > > DBG("-> do_init_bootmem lmb.reserved.cnt %d\n",lmb.reserved.cnt); > /* reserve the sections we're already using */ > for (i = 0; i < lmb.reserved.cnt; i++) { > DBG("-> reserve_bootmem ( %lx %lx %d \n",lmb.reserved.region[i].base,lmb_size_bytes(&lmb.reserved,i),i); > reserve_bootmem(lmb.reserved.region[i].base, > lmb_size_bytes(&lmb.reserved, i)); > DBG("<- reserve_bootmem \n"); > } > DBG("-> do_init_bootmem %d\n",__LINE__); > > > console output: > -> do_init_bootmem 285 > -> do_init_bootmem lmb.reserved.cnt 5 > -> reserve_bootmem ( 0 500e80 0 > <- reserve_bootmem > -> reserve_bootmem ( ffe5000 1b000 1 > <- reserve_bootmem > -> reserve_bootmem ( 3c7f7000 8000 2 > <- reserve_bootmem > -> reserve_bootmem ( 3c7ff668 994 3 > <- reserve_bootmem > -> reserve_bootmem ( 3c800000 0 4 > > looks like lmb_size_bytes is returning a zero for that last lmb.. > have been trying to narrow down where the zero is coming from, Some additional debug here: -> lmb_alloc_base 0x1000 0x80 0x10000000 -> lmb_add_region (4 base:0x0 size:0x0 <- lmb_add_region (4 base:0x0 size:0x0 -> lmb_alloc_base 0x1000 0x80 0x10000000 -> lmb_add_region (4 base:0x0 size:0x0 <- lmb_add_region (4 base:0x0 size:0x0 -> lmb_alloc_base 0x1000 0x80 0x10000000 -> lmb_add_region (4 base:0x0 size:0x0 <- lmb_add_region (4 base:0x0 size:0x0 -> setup_arch 595 -> setup_arch 598 -> do_init_bootmem 248 -> do_init_bootmem 260 -> do_init_bootmem 263 -> lmb_alloc_base 0x8000 0x1000 0x0 -> lmb_add_region (4 base:0x0 size:0x0 <- lmb_add_region (5 base:0x0 size:0x0 -> do_init_bootmem 269 -> do_init_bootmem 285 -> do_init_bootmem lmb.reserved.cnt 5 -> reserve_bootmem ( 0 500e80 0 <- reserve_bootmem -> reserve_bootmem ( ffe5000 1b000 1 <- reserve_bootmem -> reserve_bootmem ( 3c7f7000 8000 2 <- reserve_bootmem -> reserve_bootmem ( 3c7ff668 994 3 <- reserve_bootmem -> reserve_bootmem ( 3c800000 0 4 the code making the last call into lmb_alloc looks like: DBG("-> do_init_bootmem %d\n",__LINE__); bootmap_pages = bootmem_bootmap_pages(total_pages); DBG("-> do_init_bootmem %d\n",__LINE__); start = lmb_alloc(bootmap_pages << PAGE_SHIFT, PAGE_SIZE); /* wms */ BUG_ON(!start); boot_mapsize = init_bootmem(start >> PAGE_SHIFT, total_pages); I think we call direct into lmb_alloc_base most of the time,.. so the difference with this call is the LMB_ALLOC_ANYWHERE parm.. unsigned long __init lmb_alloc(unsigned long size, unsigned long align) { return lmb_alloc_base(size, align, LMB_ALLOC_ANYWHERE); } LMB_ALLOC_ANYWHERE looks to have a value of 0. "include/asm-powerpc/lmb.h:#define LMB_ALLOC_ANYWHERE 0" I am not very familiar with this code.. dont know if the '0' here is mistakenly mapped to a size, or if this 0 is a red herring. -Will > > > > > > > > > >>cheers >> > > > _______________________________________________ > Linuxppc64-dev mailing list > Linuxppc64-dev at ozlabs.org > https://ozlabs.org/mailman/listinfo/linuxppc64-dev From benh at kernel.crashing.org Thu Jan 19 09:56:38 2006 From: benh at kernel.crashing.org (Benjamin Herrenschmidt) Date: Thu, 19 Jan 2006 09:56:38 +1100 Subject: [PATCH 0/5] powerpc: add device tree property updates In-Reply-To: <0e51f66be939a091b19b252a4e9e0114@bga.com> References: <0e51f66be939a091b19b252a4e9e0114@bga.com> Message-ID: <1137624998.4823.144.camel@localhost.localdomain> O > 1) properties (files) should be 0444 not 555 > 2) directories should be S_IFDIR not S_IFREG (create_dir) > 3) this missed one of the requirements, > namely that it create inodes and dentries on the fly, > which precludes simple_readdir > 4) it doesn't have an api to add or remove files, which is necessary > because of 3 above. I think we don't need such an API if we _really_ create them on the fly and do dynamic allocation, which the patch doesn't do but we should. One of the main reason for doing a filesytem is to avoid having a static allocation of filesystem object for everything in the device-tree. Once we have dynamic allocation, all we need is to invalidate directories when files are added/removed. Thus a simpler API > Ok so what should the inode number be ? I was thinking about the phandle, but that would require creating phandles for nodes who don't have them (BootX booting or flat tree with only some nodes having phandles). The advantage is that it's stable accross boots. The cons is that the creation of missing phandles is a bit annoying as it needs to make sure it "skips" whatever phandles have already been assigned. > directory inodes should be the phandle .... yeah .. now to assign all > the others non-conflicting. Do all the current phandle generators > use either a memory address, offset, or small enum? Or we could just use the pointer to struct device_node for now. That means they become volatile between mounts reboots but that's fine. At least at first. We can then look into the problem of maybe using phandles. > 5) ref counts ... i would think the node should only be refcounted > when the directory is open ... (you were careful to put the root > but not the child nodes on failed alloc). > > Actually i guess it should be refcounted with the inode lifetime. > > > > Ok, its taking more like 10-20 minutes to type this in, thinking > of more along the way. > > milton From benh at kernel.crashing.org Thu Jan 19 10:04:38 2006 From: benh at kernel.crashing.org (Benjamin Herrenschmidt) Date: Thu, 19 Jan 2006 10:04:38 +1100 Subject: [PATCH 0/5] powerpc: add device tree property updates In-Reply-To: <200601181520.10012.arnd@arndb.de> References: <0e51f66be939a091b19b252a4e9e0114@bga.com> <200601181520.10012.arnd@arndb.de> Message-ID: <1137625479.4823.154.camel@localhost.localdomain> > Do we need the inode number to be meaningful at all? libfs makes sure > it's unique, I think that should be enough for us. I don't see any point in doing a filesystem if it's for allocating everything statically, which is what you told me libfs does. From mikey at neuling.org Thu Jan 19 10:22:48 2006 From: mikey at neuling.org (Michael Neuling) Date: Thu, 19 Jan 2006 10:22:48 +1100 Subject: [PATCH 0/6] kdump support for ppc64 In-Reply-To: <20060116150712.GA4029@in.ibm.com> References: <20060116150712.GA4029@in.ibm.com> Message-ID: <20060119102248.3e3d7d7c.mikey@neuling.org> Sharada, > Known issues: > ------------- ... > - For now, the kexec kernels have to be built as non-NUMA. > (NUMA kernels seem to panic in find_busiest_group) We've not been seeing this. Can you send in a full bug report? (eg. stack trace, register dump, kernel version etc.) Mikey From arnd at arndb.de Thu Jan 19 10:31:05 2006 From: arnd at arndb.de (Arnd Bergmann) Date: Thu, 19 Jan 2006 00:31:05 +0100 Subject: [PATCH 0/5] powerpc: add device tree property updates In-Reply-To: <1137624998.4823.144.camel@localhost.localdomain> References: <0e51f66be939a091b19b252a4e9e0114@bga.com> <1137624998.4823.144.camel@localhost.localdomain> Message-ID: <200601190031.05668.arnd@arndb.de> Am Wednesday 18 January 2006 23:56 schrieb Benjamin Herrenschmidt: > I think we don't need such an API if we _really_ create them on the fly > and do dynamic allocation, which the patch doesn't do but we should. One > of the main reason for doing a filesytem is to avoid having a static > allocation of filesystem object for everything in the device-tree. > > Once we have dynamic allocation, all we need is to invalidate directories > when files are added/removed. Thus a simpler API Objects that are dynamically allocated should not be cached in the first place, so no need to invalidate them. If only properties are dynamically allocated and device nodes (directories) are stable, the device node add/remove operation should be identical to the directory create/delete operation. > > Ok so what should the inode number be ? > > I was thinking about the phandle, but that would require creating > phandles for nodes who don't have them (BootX booting or flat tree with > only some nodes having phandles). The advantage is that it's stable > accross boots. The cons is that the creation of missing phandles is a > bit annoying as it needs to make sure it "skips" whatever phandles have > already been assigned. > > > directory inodes should be the phandle .... yeah .. ?now to assign all > > the others non-conflicting. ? Do all the current phandle generators > > use either a memory address, offset, or small enum? > > Or we could just use the pointer to struct device_node for now. That > means they become volatile between mounts reboots but that's fine. At > least at first. We can then look into the problem of maybe using > phandles. I think that won't work because 32 bit user space has 32 bit inode numbers, truncating a pointer (or a 64 bit phandle, if we ever get one) means that it is no longer unique. Arnd <>< From paulus at samba.org Thu Jan 19 10:31:20 2006 From: paulus at samba.org (Paul Mackerras) Date: Thu, 19 Jan 2006 10:31:20 +1100 Subject: [PATCH] powerpc: radeon and CONFIG_PM In-Reply-To: <1137605125.19133.2.camel@localhost.localdomain> References: <1137605125.19133.2.camel@localhost.localdomain> Message-ID: <17358.53192.374042.229869@cargo.ozlabs.ibm.com> Mike Wolf writes: > but it didnt check that CONFIG_PMAC was selected with CONFIG_PM. This > results in build errors when CONFIG_PM is selected and pseries is built. Fixed already; I just changed CONFIG_PPC_OF to CONFIG_PPC_PMAC. Paul. From michael at ellerman.id.au Thu Jan 19 11:55:50 2006 From: michael at ellerman.id.au (Michael Ellerman) Date: Thu, 19 Jan 2006 11:55:50 +1100 Subject: 2.6.15 failure on power4 iSeries In-Reply-To: <43CEBC2F.2060507@vnet.ibm.com> References: <43CC2DCC.6010201@vnet.ibm.com> <43CE6619.3080002@vnet.ibm.com> <43CEBC2F.2060507@vnet.ibm.com> Message-ID: <200601191155.53437.michael@ellerman.id.au> On Thu, 19 Jan 2006 09:07, will schmidt wrote: > > looks like setup_arch() calls into do_init_bootmem() which loops around a > > reserve_bootmem() call. the last call into reserve_bootmem isnt > > returning. > > -> reserve_bootmem ( 3c800000 0 4 It shoud hit BUG_ON(!size) (in reserve_bootmem_core()), perhaps it is but we're just not seeing it? > the code making the last call into lmb_alloc looks like: > DBG("-> do_init_bootmem %d\n",__LINE__); > bootmap_pages = bootmem_bootmap_pages(total_pages); > > DBG("-> do_init_bootmem %d\n",__LINE__); > start = lmb_alloc(bootmap_pages << PAGE_SHIFT, PAGE_SIZE); /* > wms */ BUG_ON(!start); > > boot_mapsize = init_bootmem(start >> PAGE_SHIFT, total_pages); > > > I think we call direct into lmb_alloc_base most of the time,.. so the > difference with this call is the LMB_ALLOC_ANYWHERE parm.. > > unsigned long __init lmb_alloc(unsigned long size, unsigned long align) > { > return lmb_alloc_base(size, align, LMB_ALLOC_ANYWHERE); > } > > LMB_ALLOC_ANYWHERE looks to have a value of 0. > "include/asm-powerpc/lmb.h:#define LMB_ALLOC_ANYWHERE 0" > > I am not very familiar with this code.. dont know if the '0' here is > mistakenly mapped to a size, or if this 0 is a red herring. I think that's fine. LMB_ALLOC_ANYWHERE just constrains where the alloc comes from. For example if you need an alloc within the RMO. Try this patch to dump the lmbs. Might be good to compare the output of this to the same from a known good kernel. cheers Index: linux/arch/powerpc/kernel/prom.c =================================================================== --- linux.orig/arch/powerpc/kernel/prom.c 2006-01-19 10:49:03.000000000 +1100 +++ linux/arch/powerpc/kernel/prom.c 2006-01-19 11:49:52.000000000 +1100 @@ -1134,10 +1134,8 @@ static void __init early_reserve_mem(voi lmb_reserve(base, size); } -#if 0 DBG("memory reserved, lmbs :\n"); - lmb_dump_all(); -#endif + lmb_dump_all(); } void __init early_init_devtree(void *params) Index: linux/arch/powerpc/mm/lmb.c =================================================================== --- linux.orig/arch/powerpc/mm/lmb.c 2006-01-19 10:49:03.000000000 +1100 +++ linux/arch/powerpc/mm/lmb.c 2006-01-19 11:49:34.000000000 +1100 @@ -22,7 +22,7 @@ #include "mmu_decl.h" /* for __max_low_memory */ #endif -#undef DEBUG +#define DEBUG 1 #ifdef DEBUG #include -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: not available Url : http://ozlabs.org/pipermail/linuxppc64-dev/attachments/20060119/3b4602c5/attachment.pgp From hjsong at samsung.com Thu Jan 19 11:00:18 2006 From: hjsong at samsung.com (Hyo Jung Song) Date: Thu, 19 Jan 2006 09:00:18 +0900 Subject: FW: Fwd: kernel debugging tool Message-ID: <0ITB0074BC0LA6@mmp2.samsung.com> WE are interested in Cell BE (broadband engine) Linux patch. (found in http://www.bsc.es/projects/deepcomputing/linuxoncell/cbexdev.html) We want to debug kernel sources sometimes. How can we do it? I believe you guys debugged kernel source codes for CBE and you used some tools. Could you please some tips for this? Thank you. Hyo Jung Song Senior Engineer Samsung Electronics tel. 82-2-3416-0355 -----Original Message----- From: Cell Support [mailto:cell_support at bsc.es] Sent: Wednesday, January 18, 2006 11:27 PM To: hjsong at samsung.com Cc: cell_support at bsc.es Subject: Re: Fwd: kernel debugging tool Dear Hyo, we don't develop linux patches for Cell BE. We got them from public kernel mailing lists and post them to help people to built a kernel that works with Cell BE. This avoids having to go through kernel mailing lists to find the correct patch files that fit a specific kernel release. Hope this helps people. We think you should post your question to a linux kernel mailing list. Regarding the ppc64 kernel development, the linuxppc64-dev at ozlabs.org is the right place (https://ozlabs.org/mailman/listinfo/linuxppc64-dev). But you can also sent this to the http://www.kernel.org mailing lists. Probable, kernel developers can help you because they are always debugging new their code. Hope this helps. Regards, > Sender : hjsong at samsung.com > Date : 2006-01-17 10:13 > Title : kernel debugging tool > > Hi. > > WE are interested in CBE Linux patch. > We want to debug kernel sources sometimes. How can we do it? > I believe you guys debugged kernel source codes for CBE and you used > some tools. > Could you please some tips for this? Thank you. > > > > Hyo Jung Song > Senior Engineer > Samsung Electronics > tel. 82-2-3416-0355 From zwane at arm.linux.org.uk Thu Jan 19 15:39:14 2006 From: zwane at arm.linux.org.uk (Zwane Mwaikambo) Date: Wed, 18 Jan 2006 20:39:14 -0800 (PST) Subject: [patch] turn on might_sleep() in early bootup code too In-Reply-To: <20060118104319.GB7885@elte.hu> References: <200601181119.39872.michael@ellerman.id.au> <20060118033239.GA621@cs.umn.edu> <20060118063732.GA21003@elte.hu> <20060117225304.4b6dd045.akpm@osdl.org> <20060118072815.GR2846@localhost.localdomain> <20060117233734.506c2f2e.akpm@osdl.org> <20060118080828.GA2324@elte.hu> <20060118002459.3bc8f75a.akpm@osdl.org> <20060118091834.GA21366@elte.hu> <20060118023509.50fe2701.akpm@osdl.org> <20060118104319.GB7885@elte.hu> Message-ID: On Wed, 18 Jan 2006, Ingo Molnar wrote: > lock_cpu_hotplug() has design problems i think: hotplug-locked sections > are slowly spreading in the kernel, encompassing more and more code :-) > Shouldnt the CPU hotplug lock be a spinlock to begin with? The way it's used certainly is bizarre, but a spinlock would be harder to work with as a lot of the code protected by it sleep. From johnrose at austin.ibm.com Tue Jan 17 09:36:21 2006 From: johnrose at austin.ibm.com (John Rose) Date: Mon, 16 Jan 2006 16:36:21 -0600 Subject: [PATCH 1/9] powerpc/PCI hotplug: remove rpaphp_find_bus() In-Reply-To: <20060113001826.GY26221@austin.ibm.com> References: <20060113001556.GX26221@austin.ibm.com> <20060113001826.GY26221@austin.ibm.com> Message-ID: <1137450981.809.18.camel@sinatra.austin.ibm.com> The function rpaphp_find_pci_bus() has been migrated to pcibios_find_pci_bus() in arch/powerpc/platforms/pseries/pci_dlpar.c This patch removes the old version. Signed-off-by: Linas Vepstas Acked-by: John Rose From Jens.Osterkamp at de.ibm.com Thu Jan 19 23:10:38 2006 From: Jens.Osterkamp at de.ibm.com (Jens Osterkamp) Date: Thu, 19 Jan 2006 13:10:38 +0100 Subject: FW: Fwd: kernel debugging tool In-Reply-To: <0ITB0074BC0LA6@mmp2.samsung.com> Message-ID: Hyo, besides simple printk debugging ;-) we use RISCwatch, which is a networked device for JTAG communication. You can read registers, memory, ... with it. We also have a "drone" card which is a IBM internal development tool. Basically it is a PCI card which gives you access to a lot of lowlevel hardware resources in the machine. Hope that helps, Jens eMail: osterkam at de.ibm.com -- Phone: +49-(0)7031-16-5071 IBM Germany Lab, Sch?naicherstr. 220, 71032 B?blingen Hyo Jung Song To Sent by: linuxppc64-dev at ozlabs.org linuxppc64-dev-bo cc unces at ozlabs.org Subject FW: Fwd: kernel debugging tool 01/19/2006 01:00 AM WE are interested in Cell BE (broadband engine) Linux patch. (found in http://www.bsc.es/projects/deepcomputing/linuxoncell/cbexdev.html) We want to debug kernel sources sometimes. How can we do it? I believe you guys debugged kernel source codes for CBE and you used some tools. Could you please some tips for this? Thank you. Hyo Jung Song Senior Engineer Samsung Electronics tel. 82-2-3416-0355 -----Original Message----- From: Cell Support [mailto:cell_support at bsc.es] Sent: Wednesday, January 18, 2006 11:27 PM To: hjsong at samsung.com Cc: cell_support at bsc.es Subject: Re: Fwd: kernel debugging tool Dear Hyo, we don't develop linux patches for Cell BE. We got them from public kernel mailing lists and post them to help people to built a kernel that works with Cell BE. This avoids having to go through kernel mailing lists to find the correct patch files that fit a specific kernel release. Hope this helps people. We think you should post your question to a linux kernel mailing list. Regarding the ppc64 kernel development, the linuxppc64-dev at ozlabs.org is the right place (https://ozlabs.org/mailman/listinfo/linuxppc64-dev). But you can also sent this to the http://www.kernel.org mailing lists. Probable, kernel developers can help you because they are always debugging new their code. Hope this helps. Regards, > Sender : hjsong at samsung.com > Date : 2006-01-17 10:13 > Title : kernel debugging tool > > Hi. > > WE are interested in CBE Linux patch. > We want to debug kernel sources sometimes. How can we do it? > I believe you guys debugged kernel source codes for CBE and you used > some tools. > Could you please some tips for this? Thank you. > > > > Hyo Jung Song > Senior Engineer > Samsung Electronics > tel. 82-2-3416-0355 _______________________________________________ Linuxppc64-dev mailing list Linuxppc64-dev at ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc64-dev From ahuja at austin.ibm.com Fri Jan 20 03:38:44 2006 From: ahuja at austin.ibm.com (Manish Ahuja) Date: Thu, 19 Jan 2006 10:38:44 -0600 Subject: [PATCH] PPC64 collect and export low-level cpu usage statistics Message-ID: <43CFC094.8000709@austin.ibm.com> The issue of correctness of time is an important one, where users would like to accurately get a feel for how the system is performing. With Virtualization and addition of abstract layers between the hardware and the OS, we have introduced changes that do not allow us to correctly measure performance or accuracy at this moment. Any activity at this moment that collects metrics is faced with the challenge of collecting values that might be bogus. POWER5 machines have a per-hardware-thread register which counts at a rate which is proportional to the percentage of cycles on which the cpu dispatches an instruction for this thread (if the thread gets all the dispatch cycles it counts at the same rate as the timebase register). This register is also context-switched by the hypervisor. Thus it gives a fine-grained measure of the actual cpu usage by the thread over time. This patch builds on a patch submitted earlier. This patch provides framework and data which allows other tools to report measurements accurately to different tools. This Patch calculates the amount of real physical time spent by the processor in each USER/SYS mode. It calculates that by trapping entry and exits into the kernel. The values after calculations are avilable from /sys/devices/system/cpu/cpuX/dispatched_cycles. These values are calculated during interrupts & context switches. To be able to correctly report all cycles, it is important to be able to track all the cycles that are given to lpars that are either offline or have been removed since the system started. All such cycles are calculated and stored in /sys/devices/system/cpu/cpuX/offline_cpu_cycles A few tools are in the works that will exploit the values being calculated. Example output look like as follows. %user %sys %wait %idle ------ ------ ------ ------ 00.90 0.09 0.00 99.01 This patch also keeps track of exact user/kernel times for each process and updates them accordingly to be used by tools like CKRM. I am working with performance group to calculate the impact of this patch. I will add those numbers as soon something becomes available. Signed-off-by: Manish Ahuja -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: cpu_acct.patch1 Url: http://ozlabs.org/pipermail/linuxppc64-dev/attachments/20060119/aa9bff93/attachment.txt From maule at sgi.com Fri Jan 20 06:46:47 2006 From: maule at sgi.com (Mark Maule) Date: Thu, 19 Jan 2006 13:46:47 -0600 (CST) Subject: [PATCH 0/3] msi abstractions and support for altix Message-ID: <20060119194647.12213.44658.14543@lnx-maule.americas.sgi.com> Resend #5: bug fixes Patch set to abstract portions of the MSI core so that it can be used on architectures which don't use standard interrupt controllers. Changes from Resend #4 + Fix an x86_64 build problem + Fix an ia64 CONFIG_IA64_GENERIC build problem + Fix a bug in the new ia64 reserve_irq_vector() + Restore dev->irq if msi_ops->setup fails + Redo msi-altix.patch so it applies on 2.6.16-rc1 Changes from Resend #3 + Move external declarations of msi_apic_ops out of routines, and up earlier in the respective .h files. + Add comments to the msi_ops structure declaration Changes from Resend #2 + Cleanup the ia64 platform_msi_init macro so it works on non-altix ia64 Changes from initial version + Change uintXX_t to uXX + Change _callouts to _ops + Renamed the _generic routines to _apic and moved them to a new file msi-apic.c + Have each msi_arch_init() routine call msi_register() with the desired msi ops for that platform. + Moved msi_address, msi_data, and related defs out of msi.h and into msi-apic.c, replaced by shifts/masks. + Rolled msi-arch-init.patch and msi-callouts.patch into a single msi-ops.patch Mark 1/3 msi-ops.patch Add an msi_arch_init() hook which can be used to perform platform specific setup prior to msi use. Define a set of msi ops to implement the platform-specific tasks: setup - set up plumbing to get a vector directed at a default cpu, and return the corresponding MSI bus address and data. teardown - inverse of msi_setup target - retarget a vector to a given cpu Define the routine msi_register() called from msi_arch_init() to set the desired ops. Move a bunch of apic-specific code out of the msi core .h/.c and into a new msi-apic.c file. 2/3 ia64-per-platform-device-vector.patch For the ia64 arch, allow per-platform definitions of IA64_FIRST_DEVICE_VECTOR and IA64_LAST_DEVICE_VECTOR. 3/3 msi-altix.patch Altix specific callouts to implement MSI. From maule at sgi.com Fri Jan 20 06:47:02 2006 From: maule at sgi.com (Mark Maule) Date: Thu, 19 Jan 2006 13:47:02 -0600 (CST) Subject: [PATCH 3/3] altix: msi support In-Reply-To: <20060119194647.12213.44658.14543@lnx-maule.americas.sgi.com> References: <20060119194647.12213.44658.14543@lnx-maule.americas.sgi.com> Message-ID: <20060119194702.12213.16524.93275@lnx-maule.americas.sgi.com> MSI callouts for altix. Involves a fair amount of code reorg in sn irq.c code as well as adding some extensions to the altix PCI provider abstaction. Signed-off-by: Mark Maule Index: msi/arch/ia64/sn/pci/msi.c =================================================================== --- msi.orig/arch/ia64/sn/pci/msi.c 2006-01-18 14:00:52.097507212 -0600 +++ msi/arch/ia64/sn/pci/msi.c 2006-01-18 14:01:06.964228604 -0600 @@ -6,13 +6,205 @@ * Copyright (C) 2005 Silicon Graphics, Inc. All Rights Reserved. */ -#include +#include +#include +#include + +#include + +#include +#include +#include +#include +#include + +struct sn_msi_info { + u64 pci_addr; + struct sn_irq_info *sn_irq_info; +}; + +static struct sn_msi_info *sn_msi_info; + +static void +sn_msi_teardown(unsigned int vector) +{ + nasid_t nasid; + int widget; + struct pci_dev *pdev; + struct pcidev_info *sn_pdev; + struct sn_irq_info *sn_irq_info; + struct pcibus_bussoft *bussoft; + struct sn_pcibus_provider *provider; + + sn_irq_info = sn_msi_info[vector].sn_irq_info; + if (sn_irq_info == NULL || sn_irq_info->irq_int_bit >= 0) + return; + + sn_pdev = (struct pcidev_info *)sn_irq_info->irq_pciioinfo; + pdev = sn_pdev->pdi_linux_pcidev; + provider = SN_PCIDEV_BUSPROVIDER(pdev); + + (*provider->dma_unmap)(pdev, + sn_msi_info[vector].pci_addr, + PCI_DMA_FROMDEVICE); + sn_msi_info[vector].pci_addr = 0; + + bussoft = SN_PCIDEV_BUSSOFT(pdev); + nasid = NASID_GET(bussoft->bs_base); + widget = (nasid & 1) ? + TIO_SWIN_WIDGETNUM(bussoft->bs_base) : + SWIN_WIDGETNUM(bussoft->bs_base); + + sn_intr_free(nasid, widget, sn_irq_info); + sn_msi_info[vector].sn_irq_info = NULL; + + return; +} int -sn_msi_init(void) +sn_msi_setup(struct pci_dev *pdev, unsigned int vector, + u32 *addr_hi, u32 *addr_lo, u32 *data) { + int widget; + int status; + nasid_t nasid; + u64 bus_addr; + struct sn_irq_info *sn_irq_info; + struct pcibus_bussoft *bussoft = SN_PCIDEV_BUSSOFT(pdev); + struct sn_pcibus_provider *provider = SN_PCIDEV_BUSPROVIDER(pdev); + + if (bussoft == NULL) + return -EINVAL; + + if (provider == NULL || provider->dma_map_consistent == NULL) + return -EINVAL; + + /* + * Set up the vector plumbing. Let the prom (via sn_intr_alloc) + * decide which cpu to direct this msi at by default. + */ + + nasid = NASID_GET(bussoft->bs_base); + widget = (nasid & 1) ? + TIO_SWIN_WIDGETNUM(bussoft->bs_base) : + SWIN_WIDGETNUM(bussoft->bs_base); + + sn_irq_info = kzalloc(sizeof(struct sn_irq_info), GFP_KERNEL); + if (! sn_irq_info) + return -ENOMEM; + + status = sn_intr_alloc(nasid, widget, sn_irq_info, vector, -1, -1); + if (status) { + kfree(sn_irq_info); + return -ENOMEM; + } + + sn_irq_info->irq_int_bit = -1; /* mark this as an MSI irq */ + sn_irq_fixup(pdev, sn_irq_info); + + /* Prom probably should fill these in, but doesn't ... */ + sn_irq_info->irq_bridge_type = bussoft->bs_asic_type; + sn_irq_info->irq_bridge = (void *)bussoft->bs_base; + /* - * return error until MSI is supported on altix platforms + * Map the xio address into bus space */ - return -EINVAL; + bus_addr = (*provider->dma_map_consistent)(pdev, + sn_irq_info->irq_xtalkaddr, + sizeof(sn_irq_info->irq_xtalkaddr), + SN_DMA_MSI|SN_DMA_ADDR_XIO); + if (! bus_addr) { + sn_intr_free(nasid, widget, sn_irq_info); + kfree(sn_irq_info); + return -ENOMEM; + } + + sn_msi_info[vector].sn_irq_info = sn_irq_info; + sn_msi_info[vector].pci_addr = bus_addr; + + *addr_hi = (u32)(bus_addr >> 32); + *addr_lo = (u32)(bus_addr & 0x00000000ffffffff); + + /* + * In the SN platform, bit 16 is a "send vector" bit which + * must be present in order to move the vector through the system. + */ + *data = 0x100 + (unsigned int)vector; + +#ifdef CONFIG_SMP + set_irq_affinity_info((vector & 0xff), sn_irq_info->irq_cpuid, 0); +#endif + + return 0; +} + +static void +sn_msi_target(unsigned int vector, unsigned int cpu, + u32 *addr_hi, u32 *addr_lo) +{ + int slice; + nasid_t nasid; + u64 bus_addr; + struct pci_dev *pdev; + struct pcidev_info *sn_pdev; + struct sn_irq_info *sn_irq_info; + struct sn_irq_info *new_irq_info; + struct sn_pcibus_provider *provider; + + sn_irq_info = sn_msi_info[vector].sn_irq_info; + if (sn_irq_info == NULL || sn_irq_info->irq_int_bit >= 0) + return; + + /* + * Release XIO resources for the old MSI PCI address + */ + + sn_pdev = (struct pcidev_info *)sn_irq_info->irq_pciioinfo; + pdev = sn_pdev->pdi_linux_pcidev; + provider = SN_PCIDEV_BUSPROVIDER(pdev); + + bus_addr = (u64)(*addr_hi) << 32 | (u64)(*addr_lo); + (*provider->dma_unmap)(pdev, bus_addr, PCI_DMA_FROMDEVICE); + sn_msi_info[vector].pci_addr = 0; + + nasid = cpuid_to_nasid(cpu); + slice = cpuid_to_slice(cpu); + + new_irq_info = sn_retarget_vector(sn_irq_info, nasid, slice); + sn_msi_info[vector].sn_irq_info = new_irq_info; + if (new_irq_info == NULL) + return; + + /* + * Map the xio address into bus space + */ + + bus_addr = (*provider->dma_map_consistent)(pdev, + new_irq_info->irq_xtalkaddr, + sizeof(new_irq_info->irq_xtalkaddr), + SN_DMA_MSI|SN_DMA_ADDR_XIO); + + sn_msi_info[vector].pci_addr = bus_addr; + *addr_hi = (u32)(bus_addr >> 32); + *addr_lo = (u32)(bus_addr & 0x00000000ffffffff); +} + +struct msi_ops sn_msi_ops = { + .setup = sn_msi_setup, + .teardown = sn_msi_teardown, +#ifdef CONFIG_SMP + .target = sn_msi_target, +#endif +}; + +int +sn_msi_init(void) +{ + sn_msi_info = + kzalloc(sizeof(struct sn_msi_info) * NR_VECTORS, GFP_KERNEL); + if (! sn_msi_info) + return -ENOMEM; + + msi_register(&sn_msi_ops); + return 0; } Index: msi/arch/ia64/sn/kernel/io_init.c =================================================================== --- msi.orig/arch/ia64/sn/kernel/io_init.c 2006-01-18 14:00:52.099460147 -0600 +++ msi/arch/ia64/sn/kernel/io_init.c 2006-01-18 14:01:06.969110943 -0600 @@ -51,7 +51,7 @@ */ static dma_addr_t -sn_default_pci_map(struct pci_dev *pdev, unsigned long paddr, size_t size) +sn_default_pci_map(struct pci_dev *pdev, unsigned long paddr, size_t size, int type) { return 0; } Index: msi/arch/ia64/sn/kernel/irq.c =================================================================== --- msi.orig/arch/ia64/sn/kernel/irq.c 2006-01-18 14:01:05.024963679 -0600 +++ msi/arch/ia64/sn/kernel/irq.c 2006-01-18 14:01:06.971063878 -0600 @@ -25,11 +25,11 @@ int sn_force_interrupt_flag = 1; extern int sn_ioif_inited; -static struct list_head **sn_irq_lh; +struct list_head **sn_irq_lh; static spinlock_t sn_irq_info_lock = SPIN_LOCK_UNLOCKED; /* non-IRQ lock */ -static inline u64 sn_intr_alloc(nasid_t local_nasid, int local_widget, - u64 sn_irq_info, +u64 sn_intr_alloc(nasid_t local_nasid, int local_widget, + struct sn_irq_info *sn_irq_info, int req_irq, nasid_t req_nasid, int req_slice) { @@ -39,12 +39,13 @@ SAL_CALL_NOLOCK(ret_stuff, (u64) SN_SAL_IOIF_INTERRUPT, (u64) SAL_INTR_ALLOC, (u64) local_nasid, - (u64) local_widget, (u64) sn_irq_info, (u64) req_irq, + (u64) local_widget, __pa(sn_irq_info), (u64) req_irq, (u64) req_nasid, (u64) req_slice); + return ret_stuff.status; } -static inline void sn_intr_free(nasid_t local_nasid, int local_widget, +void sn_intr_free(nasid_t local_nasid, int local_widget, struct sn_irq_info *sn_irq_info) { struct ia64_sal_retval ret_stuff; @@ -113,73 +114,91 @@ static void sn_irq_info_free(struct rcu_head *head); -static void sn_set_affinity_irq(unsigned int irq, cpumask_t mask) +struct sn_irq_info *sn_retarget_vector(struct sn_irq_info *sn_irq_info, + nasid_t nasid, int slice) { - struct sn_irq_info *sn_irq_info, *sn_irq_info_safe; - int cpuid, cpuphys; + int vector; + int cpuphys; + int64_t bridge; + int local_widget, status; + nasid_t local_nasid; + struct sn_irq_info *new_irq_info; + struct sn_pcibus_provider *pci_provider; - cpuid = first_cpu(mask); - cpuphys = cpu_physical_id(cpuid); + new_irq_info = kmalloc(sizeof(struct sn_irq_info), GFP_ATOMIC); + if (new_irq_info == NULL) + return NULL; - list_for_each_entry_safe(sn_irq_info, sn_irq_info_safe, - sn_irq_lh[irq], list) { - u64 bridge; - int local_widget, status; - nasid_t local_nasid; - struct sn_irq_info *new_irq_info; - struct sn_pcibus_provider *pci_provider; - - new_irq_info = kmalloc(sizeof(struct sn_irq_info), GFP_ATOMIC); - if (new_irq_info == NULL) - break; - memcpy(new_irq_info, sn_irq_info, sizeof(struct sn_irq_info)); - - bridge = (u64) new_irq_info->irq_bridge; - if (!bridge) { - kfree(new_irq_info); - break; /* irq is not a device interrupt */ - } + memcpy(new_irq_info, sn_irq_info, sizeof(struct sn_irq_info)); - local_nasid = NASID_GET(bridge); + bridge = (u64) new_irq_info->irq_bridge; + if (!bridge) { + kfree(new_irq_info); + return NULL; /* irq is not a device interrupt */ + } - if (local_nasid & 1) - local_widget = TIO_SWIN_WIDGETNUM(bridge); - else - local_widget = SWIN_WIDGETNUM(bridge); - - /* Free the old PROM new_irq_info structure */ - sn_intr_free(local_nasid, local_widget, new_irq_info); - /* Update kernels new_irq_info with new target info */ - unregister_intr_pda(new_irq_info); - - /* allocate a new PROM new_irq_info struct */ - status = sn_intr_alloc(local_nasid, local_widget, - __pa(new_irq_info), irq, - cpuid_to_nasid(cpuid), - cpuid_to_slice(cpuid)); - - /* SAL call failed */ - if (status) { - kfree(new_irq_info); - break; - } + local_nasid = NASID_GET(bridge); - new_irq_info->irq_cpuid = cpuid; - register_intr_pda(new_irq_info); + if (local_nasid & 1) + local_widget = TIO_SWIN_WIDGETNUM(bridge); + else + local_widget = SWIN_WIDGETNUM(bridge); - pci_provider = sn_pci_provider[new_irq_info->irq_bridge_type]; - if (pci_provider && pci_provider->target_interrupt) - (pci_provider->target_interrupt)(new_irq_info); - - spin_lock(&sn_irq_info_lock); - list_replace_rcu(&sn_irq_info->list, &new_irq_info->list); - spin_unlock(&sn_irq_info_lock); - call_rcu(&sn_irq_info->rcu, sn_irq_info_free); + vector = sn_irq_info->irq_irq; + /* Free the old PROM new_irq_info structure */ + sn_intr_free(local_nasid, local_widget, new_irq_info); + /* Update kernels new_irq_info with new target info */ + unregister_intr_pda(new_irq_info); + + /* allocate a new PROM new_irq_info struct */ + status = sn_intr_alloc(local_nasid, local_widget, + new_irq_info, vector, + nasid, slice); + + /* SAL call failed */ + if (status) { + kfree(new_irq_info); + return NULL; + } + + cpuphys = nasid_slice_to_cpuid(nasid, slice); + new_irq_info->irq_cpuid = cpuphys; + register_intr_pda(new_irq_info); + + pci_provider = sn_pci_provider[new_irq_info->irq_bridge_type]; + + /* + * If this represents a line interrupt, target it. If it's + * an msi (irq_int_bit < 0), it's already targeted. + */ + if (new_irq_info->irq_int_bit >= 0 && + pci_provider && pci_provider->target_interrupt) + (pci_provider->target_interrupt)(new_irq_info); + + spin_lock(&sn_irq_info_lock); + list_replace_rcu(&sn_irq_info->list, &new_irq_info->list); + spin_unlock(&sn_irq_info_lock); + call_rcu(&sn_irq_info->rcu, sn_irq_info_free); #ifdef CONFIG_SMP - set_irq_affinity_info((irq & 0xff), cpuphys, 0); + set_irq_affinity_info((vector & 0xff), cpuphys, 0); #endif - } + + return new_irq_info; +} + +static void sn_set_affinity_irq(unsigned int irq, cpumask_t mask) +{ + struct sn_irq_info *sn_irq_info, *sn_irq_info_safe; + nasid_t nasid; + int slice; + + nasid = cpuid_to_nasid(first_cpu(mask)); + slice = cpuid_to_slice(first_cpu(mask)); + + list_for_each_entry_safe(sn_irq_info, sn_irq_info_safe, + sn_irq_lh[irq], list) + (void)sn_retarget_vector(sn_irq_info, nasid, slice); } struct hw_interrupt_type irq_type_sn = { @@ -441,5 +460,4 @@ INIT_LIST_HEAD(sn_irq_lh[i]); } - } Index: msi/arch/ia64/sn/pci/pci_dma.c =================================================================== --- msi.orig/arch/ia64/sn/pci/pci_dma.c 2006-01-18 14:00:52.097507212 -0600 +++ msi/arch/ia64/sn/pci/pci_dma.c 2006-01-18 14:01:06.971063878 -0600 @@ -11,7 +11,7 @@ #include #include -#include +#include #include #include #include @@ -113,7 +113,8 @@ * resources. */ - *dma_handle = provider->dma_map_consistent(pdev, phys_addr, size); + *dma_handle = provider->dma_map_consistent(pdev, phys_addr, size, + SN_DMA_ADDR_PHYS); if (!*dma_handle) { printk(KERN_ERR "%s: out of ATEs\n", __FUNCTION__); free_pages((unsigned long)cpuaddr, get_order(size)); @@ -176,7 +177,7 @@ BUG_ON(dev->bus != &pci_bus_type); phys_addr = __pa(cpu_addr); - dma_addr = provider->dma_map(pdev, phys_addr, size); + dma_addr = provider->dma_map(pdev, phys_addr, size, SN_DMA_ADDR_PHYS); if (!dma_addr) { printk(KERN_ERR "%s: out of ATEs\n", __FUNCTION__); return 0; @@ -260,7 +261,8 @@ for (i = 0; i < nhwentries; i++, sg++) { phys_addr = SG_ENT_PHYS_ADDRESS(sg); sg->dma_address = provider->dma_map(pdev, - phys_addr, sg->length); + phys_addr, sg->length, + SN_DMA_ADDR_PHYS); if (!sg->dma_address) { printk(KERN_ERR "%s: out of ATEs\n", __FUNCTION__); Index: msi/arch/ia64/sn/pci/pcibr/pcibr_dma.c =================================================================== --- msi.orig/arch/ia64/sn/pci/pcibr/pcibr_dma.c 2006-01-18 14:00:52.098483680 -0600 +++ msi/arch/ia64/sn/pci/pcibr/pcibr_dma.c 2006-01-18 14:01:06.974969749 -0600 @@ -41,7 +41,7 @@ static dma_addr_t pcibr_dmamap_ate32(struct pcidev_info *info, - u64 paddr, size_t req_size, u64 flags) + u64 paddr, size_t req_size, u64 flags, int dma_flags) { struct pcidev_info *pcidev_info = info->pdi_host_pcidev_info; @@ -81,9 +81,12 @@ if (IS_PCIX(pcibus_info)) ate_flags &= ~(PCI32_ATE_PREF); - xio_addr = - IS_PIC_SOFT(pcibus_info) ? PHYS_TO_DMA(paddr) : - PHYS_TO_TIODMA(paddr); + if (SN_DMA_ADDRTYPE(dma_flags == SN_DMA_ADDR_PHYS)) + xio_addr = IS_PIC_SOFT(pcibus_info) ? PHYS_TO_DMA(paddr) : + PHYS_TO_TIODMA(paddr); + else + xio_addr = paddr; + offset = IOPGOFF(xio_addr); ate = ate_flags | (xio_addr - offset); @@ -91,6 +94,13 @@ if (IS_PIC_SOFT(pcibus_info)) { ate |= (pcibus_info->pbi_hub_xid << PIC_ATE_TARGETID_SHFT); } + + /* + * If we're mapping for MSI, set the MSI bit in the ATE + */ + if (dma_flags & SN_DMA_MSI) + ate |= PCI32_ATE_MSI; + ate_write(pcibus_info, ate_index, ate_count, ate); /* @@ -105,20 +115,27 @@ if (pcibus_info->pbi_devreg[internal_device] & PCIBR_DEV_SWAP_DIR) ATE_SWAP_ON(pci_addr); + return pci_addr; } static dma_addr_t pcibr_dmatrans_direct64(struct pcidev_info * info, u64 paddr, - u64 dma_attributes) + u64 dma_attributes, int dma_flags) { struct pcibus_info *pcibus_info = (struct pcibus_info *) ((info->pdi_host_pcidev_info)->pdi_pcibus_info); u64 pci_addr; /* Translate to Crosstalk View of Physical Address */ - pci_addr = (IS_PIC_SOFT(pcibus_info) ? PHYS_TO_DMA(paddr) : - PHYS_TO_TIODMA(paddr)) | dma_attributes; + if (SN_DMA_ADDRTYPE(dma_flags) == SN_DMA_ADDR_PHYS) + pci_addr = IS_PIC_SOFT(pcibus_info) ? + PHYS_TO_DMA(paddr) : + PHYS_TO_TIODMA(paddr) | dma_attributes; + else + pci_addr = IS_PIC_SOFT(pcibus_info) ? + paddr : + paddr | dma_attributes; /* Handle Bus mode */ if (IS_PCIX(pcibus_info)) @@ -130,7 +147,9 @@ ((u64) pcibus_info-> pbi_hub_xid << PIC_PCI64_ATTR_TARG_SHFT); } else - pci_addr |= TIOCP_PCI64_CMDTYPE_MEM; + pci_addr |= (dma_flags & SN_DMA_MSI) ? + TIOCP_PCI64_CMDTYPE_MSI : + TIOCP_PCI64_CMDTYPE_MEM; /* If PCI mode, func zero uses VCHAN0, every other func uses VCHAN1 */ if (!IS_PCIX(pcibus_info) && PCI_FUNC(info->pdi_linux_pcidev->devfn)) @@ -142,7 +161,7 @@ static dma_addr_t pcibr_dmatrans_direct32(struct pcidev_info * info, - u64 paddr, size_t req_size, u64 flags) + u64 paddr, size_t req_size, u64 flags, int dma_flags) { struct pcidev_info *pcidev_info = info->pdi_host_pcidev_info; @@ -158,8 +177,14 @@ return 0; } - xio_addr = IS_PIC_SOFT(pcibus_info) ? PHYS_TO_DMA(paddr) : - PHYS_TO_TIODMA(paddr); + if (dma_flags & SN_DMA_MSI) + return 0; + + if (SN_DMA_ADDRTYPE(dma_flags) == SN_DMA_ADDR_PHYS) + xio_addr = IS_PIC_SOFT(pcibus_info) ? PHYS_TO_DMA(paddr) : + PHYS_TO_TIODMA(paddr); + else + xio_addr = paddr; xio_base = pcibus_info->pbi_dir_xbase; offset = xio_addr - xio_base; @@ -333,7 +358,7 @@ */ dma_addr_t -pcibr_dma_map(struct pci_dev * hwdev, unsigned long phys_addr, size_t size) +pcibr_dma_map(struct pci_dev * hwdev, unsigned long phys_addr, size_t size, int dma_flags) { dma_addr_t dma_handle; struct pcidev_info *pcidev_info = SN_PCIDEV_INFO(hwdev); @@ -350,11 +375,11 @@ */ dma_handle = pcibr_dmatrans_direct64(pcidev_info, phys_addr, - PCI64_ATTR_PREF); + PCI64_ATTR_PREF, dma_flags); } else { /* Handle 32-63 bit cards via direct mapping */ dma_handle = pcibr_dmatrans_direct32(pcidev_info, phys_addr, - size, 0); + size, 0, dma_flags); if (!dma_handle) { /* * It is a 32 bit card and we cannot do direct mapping, @@ -362,7 +387,8 @@ */ dma_handle = pcibr_dmamap_ate32(pcidev_info, phys_addr, - size, PCI32_ATE_PREF); + size, PCI32_ATE_PREF, + dma_flags); } } @@ -371,18 +397,18 @@ dma_addr_t pcibr_dma_map_consistent(struct pci_dev * hwdev, unsigned long phys_addr, - size_t size) + size_t size, int dma_flags) { dma_addr_t dma_handle; struct pcidev_info *pcidev_info = SN_PCIDEV_INFO(hwdev); if (hwdev->dev.coherent_dma_mask == ~0UL) { dma_handle = pcibr_dmatrans_direct64(pcidev_info, phys_addr, - PCI64_ATTR_BAR); + PCI64_ATTR_BAR, dma_flags); } else { dma_handle = (dma_addr_t) pcibr_dmamap_ate32(pcidev_info, phys_addr, size, - PCI32_ATE_BAR); + PCI32_ATE_BAR, dma_flags); } return dma_handle; Index: msi/arch/ia64/sn/pci/tioca_provider.c =================================================================== --- msi.orig/arch/ia64/sn/pci/tioca_provider.c 2006-01-18 14:00:52.098483680 -0600 +++ msi/arch/ia64/sn/pci/tioca_provider.c 2006-01-18 14:01:06.975946217 -0600 @@ -515,11 +515,17 @@ * use the GART mapped mode. */ static u64 -tioca_dma_map(struct pci_dev *pdev, u64 paddr, size_t byte_count) +tioca_dma_map(struct pci_dev *pdev, u64 paddr, size_t byte_count, int dma_flags) { u64 mapaddr; /* + * Not supported for now ... + */ + if (dma_flags & SN_DMA_MSI) + return 0; + + /* * If card is 64 or 48 bit addresable, use a direct mapping. 32 * bit direct is so restrictive w.r.t. where the memory resides that * we don't use it even though CA has some support. Index: msi/arch/ia64/sn/pci/tioce_provider.c =================================================================== --- msi.orig/arch/ia64/sn/pci/tioce_provider.c 2006-01-18 14:00:52.099460147 -0600 +++ msi/arch/ia64/sn/pci/tioce_provider.c 2006-01-18 14:01:06.976922685 -0600 @@ -52,7 +52,8 @@ (ATE_PAGE((start)+(len)-1, pagesize) - ATE_PAGE(start, pagesize) + 1) #define ATE_VALID(ate) ((ate) & (1UL << 63)) -#define ATE_MAKE(addr, ps) (((addr) & ~ATE_PAGEMASK(ps)) | (1UL << 63)) +#define ATE_MAKE(addr, ps, msi) \ + (((addr) & ~ATE_PAGEMASK(ps)) | (1UL << 63) | ((msi)?(1UL << 62):0)) /* * Flavors of ate-based mapping supported by tioce_alloc_map() @@ -78,15 +79,17 @@ * * 63 - must be 1 to indicate d64 mode to CE hardware * 62 - barrier bit ... controlled with tioce_dma_barrier() - * 61 - 0 since this is not an MSI transaction + * 61 - msi bit ... specified through dma_flags * 60:54 - reserved, MBZ */ static u64 -tioce_dma_d64(unsigned long ct_addr) +tioce_dma_d64(unsigned long ct_addr, int dma_flags) { u64 bus_addr; bus_addr = ct_addr | (1UL << 63); + if (dma_flags & SN_DMA_MSI) + bus_addr |= (1UL << 61); return bus_addr; } @@ -143,7 +146,7 @@ */ static u64 tioce_alloc_map(struct tioce_kernel *ce_kern, int type, int port, - u64 ct_addr, int len) + u64 ct_addr, int len, int dma_flags) { int i; int j; @@ -152,6 +155,7 @@ int entries; int nates; int pagesize; + int msi_capable, msi_wanted; u64 *ate_shadow; u64 *ate_reg; u64 addr; @@ -173,6 +177,7 @@ ate_reg = ce_mmr->ce_ure_ate3240; pagesize = ce_kern->ce_ate3240_pagesize; bus_base = TIOCE_M32_MIN; + msi_capable = 1; break; case TIOCE_ATE_M40: first = 0; @@ -181,6 +186,7 @@ ate_reg = ce_mmr->ce_ure_ate40; pagesize = MB(64); bus_base = TIOCE_M40_MIN; + msi_capable = 0; break; case TIOCE_ATE_M40S: /* @@ -193,11 +199,16 @@ ate_reg = ce_mmr->ce_ure_ate3240; pagesize = GB(16); bus_base = TIOCE_M40S_MIN; + msi_capable = 0; break; default: return 0; } + msi_wanted = dma_flags & SN_DMA_MSI; + if (msi_wanted && !msi_capable) + return 0; + nates = ATE_NPAGES(ct_addr, len, pagesize); if (nates > entries) return 0; @@ -226,7 +237,7 @@ for (j = 0; j < nates; j++) { u64 ate; - ate = ATE_MAKE(addr, pagesize); + ate = ATE_MAKE(addr, pagesize, msi_wanted); ate_shadow[i + j] = ate; writeq(ate, &ate_reg[i + j]); addr += pagesize; @@ -253,7 +264,7 @@ * Map @paddr into 32-bit bus space of the CE associated with @pcidev_info. */ static u64 -tioce_dma_d32(struct pci_dev *pdev, u64 ct_addr) +tioce_dma_d32(struct pci_dev *pdev, u64 ct_addr, int dma_flags) { int dma_ok; int port; @@ -263,6 +274,9 @@ u64 ct_lower; dma_addr_t bus_addr; + if (dma_flags & SN_DMA_MSI) + return 0; + ct_upper = ct_addr & ~0x3fffffffUL; ct_lower = ct_addr & 0x3fffffffUL; @@ -387,7 +401,7 @@ */ static u64 tioce_do_dma_map(struct pci_dev *pdev, u64 paddr, size_t byte_count, - int barrier) + int barrier, int dma_flags) { unsigned long flags; u64 ct_addr; @@ -403,15 +417,18 @@ if (dma_mask < 0x7fffffffUL) return 0; - ct_addr = PHYS_TO_TIODMA(paddr); + if (SN_DMA_ADDRTYPE(dma_flags) == SN_DMA_ADDR_PHYS) + ct_addr = PHYS_TO_TIODMA(paddr); + else + ct_addr = paddr; /* * If the device can generate 64 bit addresses, create a D64 map. - * Since this should never fail, bypass the rest of the checks. */ if (dma_mask == ~0UL) { - mapaddr = tioce_dma_d64(ct_addr); - goto dma_map_done; + mapaddr = tioce_dma_d64(ct_addr, dma_flags); + if (mapaddr) + goto dma_map_done; } pcidev_to_tioce(pdev, NULL, &ce_kern, &port); @@ -454,18 +471,22 @@ if (byte_count > MB(64)) { mapaddr = tioce_alloc_map(ce_kern, TIOCE_ATE_M40S, - port, ct_addr, byte_count); + port, ct_addr, byte_count, + dma_flags); if (!mapaddr) mapaddr = tioce_alloc_map(ce_kern, TIOCE_ATE_M40, -1, - ct_addr, byte_count); + ct_addr, byte_count, + dma_flags); } else { mapaddr = tioce_alloc_map(ce_kern, TIOCE_ATE_M40, -1, - ct_addr, byte_count); + ct_addr, byte_count, + dma_flags); if (!mapaddr) mapaddr = tioce_alloc_map(ce_kern, TIOCE_ATE_M40S, - port, ct_addr, byte_count); + port, ct_addr, byte_count, + dma_flags); } } @@ -473,7 +494,7 @@ * 32-bit direct is the next mode to try */ if (!mapaddr && dma_mask >= 0xffffffffUL) - mapaddr = tioce_dma_d32(pdev, ct_addr); + mapaddr = tioce_dma_d32(pdev, ct_addr, dma_flags); /* * Last resort, try 32-bit ATE-based map. @@ -481,12 +502,12 @@ if (!mapaddr) mapaddr = tioce_alloc_map(ce_kern, TIOCE_ATE_M32, -1, ct_addr, - byte_count); + byte_count, dma_flags); spin_unlock_irqrestore(&ce_kern->ce_lock, flags); dma_map_done: - if (mapaddr & barrier) + if (mapaddr && barrier) mapaddr = tioce_dma_barrier(mapaddr, 1); return mapaddr; @@ -502,9 +523,9 @@ * in the address. */ static u64 -tioce_dma(struct pci_dev *pdev, u64 paddr, size_t byte_count) +tioce_dma(struct pci_dev *pdev, u64 paddr, size_t byte_count, int dma_flags) { - return tioce_do_dma_map(pdev, paddr, byte_count, 0); + return tioce_do_dma_map(pdev, paddr, byte_count, 0, dma_flags); } /** @@ -516,9 +537,9 @@ * Simply call tioce_do_dma_map() to create a map with the barrier bit set * in the address. */ static u64 -tioce_dma_consistent(struct pci_dev *pdev, u64 paddr, size_t byte_count) +tioce_dma_consistent(struct pci_dev *pdev, u64 paddr, size_t byte_count, int dma_flags) { - return tioce_do_dma_map(pdev, paddr, byte_count, 1); + return tioce_do_dma_map(pdev, paddr, byte_count, 1, dma_flags); } /** Index: msi/include/asm-ia64/sn/intr.h =================================================================== --- msi.orig/include/asm-ia64/sn/intr.h 2006-01-18 14:00:52.100436615 -0600 +++ msi/include/asm-ia64/sn/intr.h 2006-01-18 14:01:06.982781491 -0600 @@ -3,13 +3,14 @@ * License. See the file "COPYING" in the main directory of this archive * for more details. * - * Copyright (C) 1992 - 1997, 2000-2004 Silicon Graphics, Inc. All rights reserved. + * Copyright (C) 1992 - 1997, 2000-2005 Silicon Graphics, Inc. All rights reserved. */ #ifndef _ASM_IA64_SN_INTR_H #define _ASM_IA64_SN_INTR_H #include +#include #define SGI_UART_VECTOR (0xe9) @@ -40,6 +41,7 @@ int irq_cpuid; /* kernel logical cpuid */ int irq_irq; /* the IRQ number */ int irq_int_bit; /* Bridge interrupt pin */ + /* <0 means MSI */ u64 irq_xtalkaddr; /* xtalkaddr IRQ is sent to */ int irq_bridge_type;/* pciio asic type (pciio.h) */ void *irq_bridge; /* bridge generating irq */ @@ -53,6 +55,12 @@ }; extern void sn_send_IPI_phys(int, long, int, int); +extern u64 sn_intr_alloc(nasid_t, int, + struct sn_irq_info *, + int, nasid_t, int); +extern void sn_intr_free(nasid_t, int, struct sn_irq_info *); +extern struct sn_irq_info *sn_retarget_vector(struct sn_irq_info *, nasid_t, int); +extern struct list_head **sn_irq_lh; #define CPU_VECTOR_TO_IRQ(cpuid,vector) (vector) Index: msi/include/asm-ia64/sn/pcibr_provider.h =================================================================== --- msi.orig/include/asm-ia64/sn/pcibr_provider.h 2006-01-18 14:00:52.100436615 -0600 +++ msi/include/asm-ia64/sn/pcibr_provider.h 2006-01-18 14:01:06.984734427 -0600 @@ -3,7 +3,7 @@ * License. See the file "COPYING" in the main directory of this archive * for more details. * - * Copyright (C) 1992-1997,2000-2004 Silicon Graphics, Inc. All rights reserved. + * Copyright (C) 1992-1997,2000-2005 Silicon Graphics, Inc. All rights reserved. */ #ifndef _ASM_IA64_SN_PCI_PCIBR_PROVIDER_H #define _ASM_IA64_SN_PCI_PCIBR_PROVIDER_H @@ -55,6 +55,7 @@ #define PCI32_ATE_V (0x1 << 0) #define PCI32_ATE_CO (0x1 << 1) #define PCI32_ATE_PREC (0x1 << 2) +#define PCI32_ATE_MSI (0x1 << 2) #define PCI32_ATE_PREF (0x1 << 3) #define PCI32_ATE_BAR (0x1 << 4) #define PCI32_ATE_ADDR_SHFT 12 @@ -129,8 +130,8 @@ extern int pcibr_init_provider(void); extern void *pcibr_bus_fixup(struct pcibus_bussoft *, struct pci_controller *); -extern dma_addr_t pcibr_dma_map(struct pci_dev *, unsigned long, size_t); -extern dma_addr_t pcibr_dma_map_consistent(struct pci_dev *, unsigned long, size_t); +extern dma_addr_t pcibr_dma_map(struct pci_dev *, unsigned long, size_t, int type); +extern dma_addr_t pcibr_dma_map_consistent(struct pci_dev *, unsigned long, size_t, int type); extern void pcibr_dma_unmap(struct pci_dev *, dma_addr_t, int); /* Index: msi/include/asm-ia64/sn/pcibus_provider_defs.h =================================================================== --- msi.orig/include/asm-ia64/sn/pcibus_provider_defs.h 2006-01-18 14:00:52.101413083 -0600 +++ msi/include/asm-ia64/sn/pcibus_provider_defs.h 2006-01-18 14:01:06.986687362 -0600 @@ -3,7 +3,7 @@ * License. See the file "COPYING" in the main directory of this archive * for more details. * - * Copyright (C) 1992 - 1997, 2000-2004 Silicon Graphics, Inc. All rights reserved. + * Copyright (C) 1992 - 1997, 2000-2005 Silicon Graphics, Inc. All rights reserved. */ #ifndef _ASM_IA64_SN_PCI_PCIBUS_PROVIDER_H #define _ASM_IA64_SN_PCI_PCIBUS_PROVIDER_H @@ -45,13 +45,24 @@ */ struct sn_pcibus_provider { - dma_addr_t (*dma_map)(struct pci_dev *, unsigned long, size_t); - dma_addr_t (*dma_map_consistent)(struct pci_dev *, unsigned long, size_t); + dma_addr_t (*dma_map)(struct pci_dev *, unsigned long, size_t, int flags); + dma_addr_t (*dma_map_consistent)(struct pci_dev *, unsigned long, size_t, int flags); void (*dma_unmap)(struct pci_dev *, dma_addr_t, int); void * (*bus_fixup)(struct pcibus_bussoft *, struct pci_controller *); void (*force_interrupt)(struct sn_irq_info *); void (*target_interrupt)(struct sn_irq_info *); }; +/* + * Flags used by the map interfaces + * bits 3:0 specifies format of passed in address + * bit 4 specifies that address is to be used for MSI + */ + +#define SN_DMA_ADDRTYPE(x) ((x) & 0xf) +#define SN_DMA_ADDR_PHYS 1 /* address is an xio address. */ +#define SN_DMA_ADDR_XIO 2 /* address is phys memory */ +#define SN_DMA_MSI 0x10 /* Bus address is to be used for MSI */ + extern struct sn_pcibus_provider *sn_pci_provider[]; #endif /* _ASM_IA64_SN_PCI_PCIBUS_PROVIDER_H */ Index: msi/include/asm-ia64/sn/tiocp.h =================================================================== --- msi.orig/include/asm-ia64/sn/tiocp.h 2006-01-18 14:00:52.101413083 -0600 +++ msi/include/asm-ia64/sn/tiocp.h 2006-01-18 14:01:06.988640298 -0600 @@ -3,13 +3,14 @@ * License. See the file "COPYING" in the main directory of this archive * for more details. * - * Copyright (C) 2003-2004 Silicon Graphics, Inc. All rights reserved. + * Copyright (C) 2003-2005 Silicon Graphics, Inc. All rights reserved. */ #ifndef _ASM_IA64_SN_PCI_TIOCP_H #define _ASM_IA64_SN_PCI_TIOCP_H #define TIOCP_HOST_INTR_ADDR 0x003FFFFFFFFFFFFFUL #define TIOCP_PCI64_CMDTYPE_MEM (0x1ull << 60) +#define TIOCP_PCI64_CMDTYPE_MSI (0x3ull << 60) /***************************************************************************** From maule at sgi.com Fri Jan 20 06:46:57 2006 From: maule at sgi.com (Mark Maule) Date: Thu, 19 Jan 2006 13:46:57 -0600 (CST) Subject: [PATCH 2/3] per-platform IA64_{FIRST,LAST}_DEVICE_VECTOR definitions In-Reply-To: <20060119194647.12213.44658.14543@lnx-maule.americas.sgi.com> References: <20060119194647.12213.44658.14543@lnx-maule.americas.sgi.com> Message-ID: <20060119194657.12213.25378.83969@lnx-maule.americas.sgi.com> Abstract IA64_FIRST_DEVICE_VECTOR/IA64_LAST_DEVICE_VECTOR since SN platforms use a subset of the IA64 range. Implement this by making the above macros global variables which the platform can override in it setup code. Also add a reserve_irq_vector() routine used by SN to mark a vector's as in-use when that weren't allocated through assign_irq_vector(). Signed-off-by: Mark Maule Index: linux-maule/arch/ia64/kernel/irq_ia64.c =================================================================== --- linux-maule.orig/arch/ia64/kernel/irq_ia64.c 2006-01-17 11:09:12.000000000 -0600 +++ linux-maule/arch/ia64/kernel/irq_ia64.c 2006-01-19 10:35:05.494256362 -0600 @@ -46,6 +46,10 @@ #define IRQ_DEBUG 0 +/* These can be overridden in platform_irq_init */ +int ia64_first_device_vector = IA64_DEF_FIRST_DEVICE_VECTOR; +int ia64_last_device_vector = IA64_DEF_LAST_DEVICE_VECTOR; + /* default base addr of IPI table */ void __iomem *ipi_base_addr = ((void __iomem *) (__IA64_UNCACHED_OFFSET | IA64_IPI_DEFAULT_BASE_ADDR)); @@ -60,7 +64,7 @@ }; EXPORT_SYMBOL(isa_irq_to_vector_map); -static unsigned long ia64_vector_mask[BITS_TO_LONGS(IA64_NUM_DEVICE_VECTORS)]; +static unsigned long ia64_vector_mask[BITS_TO_LONGS(IA64_MAX_DEVICE_VECTORS)]; int assign_irq_vector (int irq) @@ -89,6 +93,19 @@ printk(KERN_WARNING "%s: double free!\n", __FUNCTION__); } +int +reserve_irq_vector (int vector) +{ + int pos; + + if (vector < IA64_FIRST_DEVICE_VECTOR || + vector > IA64_LAST_DEVICE_VECTOR) + return -EINVAL; + + pos = vector - IA64_FIRST_DEVICE_VECTOR; + return test_and_set_bit(pos, ia64_vector_mask); +} + #ifdef CONFIG_SMP # define IS_RESCHEDULE(vec) (vec == IA64_IPI_RESCHEDULE) #else Index: linux-maule/arch/ia64/sn/kernel/irq.c =================================================================== --- linux-maule.orig/arch/ia64/sn/kernel/irq.c 2006-01-17 11:09:12.000000000 -0600 +++ linux-maule/arch/ia64/sn/kernel/irq.c 2006-01-19 10:34:44.803879833 -0600 @@ -203,6 +203,9 @@ int i; irq_desc_t *base_desc = irq_desc; + ia64_first_device_vector = IA64_SN2_FIRST_DEVICE_VECTOR; + ia64_last_device_vector = IA64_SN2_LAST_DEVICE_VECTOR; + for (i = 0; i < NR_IRQS; i++) { if (base_desc[i].handler == &no_irq_type) { base_desc[i].handler = &irq_type_sn; @@ -287,6 +290,7 @@ /* link it into the sn_irq[irq] list */ spin_lock(&sn_irq_info_lock); list_add_rcu(&sn_irq_info->list, sn_irq_lh[sn_irq_info->irq_irq]); + reserve_irq_vector(sn_irq_info->irq_irq); spin_unlock(&sn_irq_info_lock); (void)register_intr_pda(sn_irq_info); @@ -310,8 +314,11 @@ spin_lock(&sn_irq_info_lock); list_del_rcu(&sn_irq_info->list); spin_unlock(&sn_irq_info_lock); + if (list_empty(sn_irq_lh[sn_irq_info->irq_irq])) + free_irq_vector(sn_irq_info->irq_irq); call_rcu(&sn_irq_info->rcu, sn_irq_info_free); pci_dev_put(pci_dev); + } static inline void Index: linux-maule/include/asm-ia64/hw_irq.h =================================================================== --- linux-maule.orig/include/asm-ia64/hw_irq.h 2006-01-17 11:09:18.000000000 -0600 +++ linux-maule/include/asm-ia64/hw_irq.h 2006-01-19 09:47:23.915399191 -0600 @@ -47,9 +47,19 @@ #define IA64_CMC_VECTOR 0x1f /* corrected machine-check interrupt vector */ /* * Vectors 0x20-0x2f are reserved for legacy ISA IRQs. + * Use vectors 0x30-0xe7 as the default device vector range for ia64. + * Platforms may choose to reduce this range in platform_irq_setup, but the + * platform range must fall within + * [IA64_DEF_FIRST_DEVICE_VECTOR..IA64_DEF_LAST_DEVICE_VECTOR] */ -#define IA64_FIRST_DEVICE_VECTOR 0x30 -#define IA64_LAST_DEVICE_VECTOR 0xe7 +extern int ia64_first_device_vector; +extern int ia64_last_device_vector; + +#define IA64_DEF_FIRST_DEVICE_VECTOR 0x30 +#define IA64_DEF_LAST_DEVICE_VECTOR 0xe7 +#define IA64_FIRST_DEVICE_VECTOR ia64_first_device_vector +#define IA64_LAST_DEVICE_VECTOR ia64_last_device_vector +#define IA64_MAX_DEVICE_VECTORS (IA64_DEF_LAST_DEVICE_VECTOR - IA64_DEF_FIRST_DEVICE_VECTOR + 1) #define IA64_NUM_DEVICE_VECTORS (IA64_LAST_DEVICE_VECTOR - IA64_FIRST_DEVICE_VECTOR + 1) #define IA64_MCA_RENDEZ_VECTOR 0xe8 /* MCA rendez interrupt */ @@ -83,6 +93,7 @@ extern int assign_irq_vector (int irq); /* allocate a free vector */ extern void free_irq_vector (int vector); +extern int reserve_irq_vector (int vector); extern void ia64_send_ipi (int cpu, int vector, int delivery_mode, int redirect); extern void register_percpu_irq (ia64_vector vec, struct irqaction *action); Index: linux-maule/drivers/pci/msi.c =================================================================== --- linux-maule.orig/drivers/pci/msi.c 2006-01-19 09:46:52.315749136 -0600 +++ linux-maule/drivers/pci/msi.c 2006-01-19 09:47:23.915399191 -0600 @@ -35,7 +35,7 @@ #ifndef CONFIG_X86_IO_APIC int vector_irq[NR_VECTORS] = { [0 ... NR_VECTORS - 1] = -1}; -u8 irq_vector[NR_IRQ_VECTORS] = { FIRST_DEVICE_VECTOR , 0 }; +u8 irq_vector[NR_IRQ_VECTORS]; #endif static struct msi_ops *msi_ops; @@ -377,6 +377,11 @@ printk(KERN_WARNING "PCI: MSI cache init failed\n"); return status; } + +#ifndef CONFIG_X86_IO_APIC + irq_vector[0] = FIRST_DEVICE_VECTOR; +#endif + last_alloc_vector = assign_irq_vector(AUTO_ASSIGN); if (last_alloc_vector < 0) { pci_msi_enable = 0; From maule at sgi.com Fri Jan 20 06:46:52 2006 From: maule at sgi.com (Mark Maule) Date: Thu, 19 Jan 2006 13:46:52 -0600 (CST) Subject: [PATCH 1/3] msi vector targeting abstractions In-Reply-To: <20060119194647.12213.44658.14543@lnx-maule.americas.sgi.com> References: <20060119194647.12213.44658.14543@lnx-maule.americas.sgi.com> Message-ID: <20060119194652.12213.96503.19247@lnx-maule.americas.sgi.com> Abstract portions of the MSI core for platforms that do not use standard APIC interrupt controllers. This is implemented through a new arch-specific msi setup routine, and a set of msi ops which can be set on a per platform basis. Signed-off-by: Mark Maule Index: linux-maule/drivers/pci/msi.c =================================================================== --- linux-maule.orig/drivers/pci/msi.c 2006-01-17 11:09:15.000000000 -0600 +++ linux-maule/drivers/pci/msi.c 2006-01-19 12:40:27.938752136 -0600 @@ -23,8 +23,6 @@ #include "pci.h" #include "msi.h" -#define MSI_TARGET_CPU first_cpu(cpu_online_map) - static DEFINE_SPINLOCK(msi_lock); static struct msi_desc* msi_desc[NR_IRQS] = { [0 ... NR_IRQS-1] = NULL }; static kmem_cache_t* msi_cachep; @@ -40,6 +38,15 @@ u8 irq_vector[NR_IRQ_VECTORS] = { FIRST_DEVICE_VECTOR , 0 }; #endif +static struct msi_ops *msi_ops; + +int +msi_register(struct msi_ops *ops) +{ + msi_ops = ops; + return 0; +} + static void msi_cache_ctor(void *p, kmem_cache_t *cache, unsigned long flags) { memset(p, 0, NR_IRQS * sizeof(struct msi_desc)); @@ -92,7 +99,7 @@ static void set_msi_affinity(unsigned int vector, cpumask_t cpu_mask) { struct msi_desc *entry; - struct msg_address address; + u32 address_hi, address_lo; unsigned int irq = vector; unsigned int dest_cpu = first_cpu(cpu_mask); @@ -108,28 +115,36 @@ if (!(pos = pci_find_capability(entry->dev, PCI_CAP_ID_MSI))) return; + pci_read_config_dword(entry->dev, msi_upper_address_reg(pos), + &address_hi); pci_read_config_dword(entry->dev, msi_lower_address_reg(pos), - &address.lo_address.value); - address.lo_address.value &= MSI_ADDRESS_DEST_ID_MASK; - address.lo_address.value |= (cpu_physical_id(dest_cpu) << - MSI_TARGET_CPU_SHIFT); - entry->msi_attrib.current_cpu = cpu_physical_id(dest_cpu); + &address_lo); + + msi_ops->target(vector, dest_cpu, &address_hi, &address_lo); + + pci_write_config_dword(entry->dev, msi_upper_address_reg(pos), + address_hi); pci_write_config_dword(entry->dev, msi_lower_address_reg(pos), - address.lo_address.value); + address_lo); set_native_irq_info(irq, cpu_mask); break; } case PCI_CAP_ID_MSIX: { - int offset = entry->msi_attrib.entry_nr * PCI_MSIX_ENTRY_SIZE + - PCI_MSIX_ENTRY_LOWER_ADDR_OFFSET; + int offset_hi = + entry->msi_attrib.entry_nr * PCI_MSIX_ENTRY_SIZE + + PCI_MSIX_ENTRY_UPPER_ADDR_OFFSET; + int offset_lo = + entry->msi_attrib.entry_nr * PCI_MSIX_ENTRY_SIZE + + PCI_MSIX_ENTRY_LOWER_ADDR_OFFSET; + + address_hi = readl(entry->mask_base + offset_hi); + address_lo = readl(entry->mask_base + offset_lo); - address.lo_address.value = readl(entry->mask_base + offset); - address.lo_address.value &= MSI_ADDRESS_DEST_ID_MASK; - address.lo_address.value |= (cpu_physical_id(dest_cpu) << - MSI_TARGET_CPU_SHIFT); - entry->msi_attrib.current_cpu = cpu_physical_id(dest_cpu); - writel(address.lo_address.value, entry->mask_base + offset); + msi_ops->target(vector, dest_cpu, &address_hi, &address_lo); + + writel(address_hi, entry->mask_base + offset_hi); + writel(address_lo, entry->mask_base + offset_lo); set_native_irq_info(irq, cpu_mask); break; } @@ -249,30 +264,6 @@ .set_affinity = set_msi_irq_affinity }; -static void msi_data_init(struct msg_data *msi_data, - unsigned int vector) -{ - memset(msi_data, 0, sizeof(struct msg_data)); - msi_data->vector = (u8)vector; - msi_data->delivery_mode = MSI_DELIVERY_MODE; - msi_data->level = MSI_LEVEL_MODE; - msi_data->trigger = MSI_TRIGGER_MODE; -} - -static void msi_address_init(struct msg_address *msi_address) -{ - unsigned int dest_id; - unsigned long dest_phys_id = cpu_physical_id(MSI_TARGET_CPU); - - memset(msi_address, 0, sizeof(struct msg_address)); - msi_address->hi_address = (u32)0; - dest_id = (MSI_ADDRESS_HEADER << MSI_ADDRESS_HEADER_SHIFT); - msi_address->lo_address.u.dest_mode = MSI_PHYSICAL_MODE; - msi_address->lo_address.u.redirection_hint = MSI_REDIRECTION_HINT_MODE; - msi_address->lo_address.u.dest_id = dest_id; - msi_address->lo_address.value |= (dest_phys_id << MSI_TARGET_CPU_SHIFT); -} - static int msi_free_vector(struct pci_dev* dev, int vector, int reassign); static int assign_msi_vector(void) { @@ -367,6 +358,20 @@ return status; } + if ((status = msi_arch_init()) < 0) { + pci_msi_enable = 0; + printk(KERN_WARNING + "PCI: MSI arch init failed. MSI disabled.\n"); + return status; + } + + if (! msi_ops) { + printk(KERN_WARNING + "PCI: MSI ops not registered. MSI disabled.\n"); + status = -EINVAL; + return status; + } + if ((status = msi_cache_init()) < 0) { pci_msi_enable = 0; printk(KERN_WARNING "PCI: MSI cache init failed\n"); @@ -510,9 +515,11 @@ **/ static int msi_capability_init(struct pci_dev *dev) { + int status; struct msi_desc *entry; - struct msg_address address; - struct msg_data data; + u32 address_lo; + u32 address_hi; + u32 data; int pos, vector; u16 control; @@ -539,23 +546,27 @@ entry->mask_base = (void __iomem *)(long)msi_mask_bits_reg(pos, is_64bit_address(control)); } + /* Configure MSI capability structure */ + status = msi_ops->setup(dev, vector, + &address_hi, + &address_lo, + &data); + if (status < 0) { + dev->irq = entry->msi_attrib.default_vector; + kmem_cache_free(msi_cachep, entry); + return status; + } /* Replace with MSI handler */ irq_handler_init(PCI_CAP_ID_MSI, vector, entry->msi_attrib.maskbit); - /* Configure MSI capability structure */ - msi_address_init(&address); - msi_data_init(&data, vector); - entry->msi_attrib.current_cpu = ((address.lo_address.u.dest_id >> - MSI_TARGET_CPU_SHIFT) & MSI_TARGET_CPU_MASK); - pci_write_config_dword(dev, msi_lower_address_reg(pos), - address.lo_address.value); + + pci_write_config_dword(dev, msi_lower_address_reg(pos), address_lo); if (is_64bit_address(control)) { pci_write_config_dword(dev, - msi_upper_address_reg(pos), address.hi_address); - pci_write_config_word(dev, - msi_data_reg(pos, 1), *((u32*)&data)); + msi_upper_address_reg(pos), address_hi); + pci_write_config_word(dev, msi_data_reg(pos, 1), data); } else - pci_write_config_word(dev, - msi_data_reg(pos, 0), *((u32*)&data)); + pci_write_config_word(dev, msi_data_reg(pos, 0), data); + if (entry->msi_attrib.maskbit) { unsigned int maskbits, temp; /* All MSIs are unmasked by default, Mask them all */ @@ -590,13 +601,15 @@ struct msix_entry *entries, int nvec) { struct msi_desc *head = NULL, *tail = NULL, *entry = NULL; - struct msg_address address; - struct msg_data data; + u32 address_hi; + u32 address_lo; + u32 data; int vector, pos, i, j, nr_entries, temp = 0; u32 phys_addr, table_offset; u16 control; u8 bir; void __iomem *base; + int status; pos = pci_find_capability(dev, PCI_CAP_ID_MSIX); /* Request & Map MSI-X table region */ @@ -643,18 +656,20 @@ /* Replace with MSI-X handler */ irq_handler_init(PCI_CAP_ID_MSIX, vector, 1); /* Configure MSI-X capability structure */ - msi_address_init(&address); - msi_data_init(&data, vector); - entry->msi_attrib.current_cpu = - ((address.lo_address.u.dest_id >> - MSI_TARGET_CPU_SHIFT) & MSI_TARGET_CPU_MASK); - writel(address.lo_address.value, + status = msi_ops->setup(dev, vector, + &address_hi, + &address_lo, + &data); + if (status < 0) + break; + + writel(address_lo, base + j * PCI_MSIX_ENTRY_SIZE + PCI_MSIX_ENTRY_LOWER_ADDR_OFFSET); - writel(address.hi_address, + writel(address_hi, base + j * PCI_MSIX_ENTRY_SIZE + PCI_MSIX_ENTRY_UPPER_ADDR_OFFSET); - writel(*(u32*)&data, + writel(data, base + j * PCI_MSIX_ENTRY_SIZE + PCI_MSIX_ENTRY_DATA_OFFSET); attach_msi_entry(entry, vector); @@ -789,6 +804,8 @@ void __iomem *base; unsigned long flags; + msi_ops->teardown(vector); + spin_lock_irqsave(&msi_lock, flags); entry = msi_desc[vector]; if (!entry || entry->dev != dev) { Index: linux-maule/include/asm-i386/msi.h =================================================================== --- linux-maule.orig/include/asm-i386/msi.h 2006-01-17 11:09:18.000000000 -0600 +++ linux-maule/include/asm-i386/msi.h 2006-01-19 09:46:52.315749136 -0600 @@ -12,4 +12,12 @@ #define LAST_DEVICE_VECTOR 232 #define MSI_TARGET_CPU_SHIFT 12 +extern struct msi_ops msi_apic_ops; + +static inline int msi_arch_init(void) +{ + msi_register(&msi_apic_ops); + return 0; +} + #endif /* ASM_MSI_H */ Index: linux-maule/include/asm-x86_64/msi.h =================================================================== --- linux-maule.orig/include/asm-x86_64/msi.h 2006-01-17 11:09:18.000000000 -0600 +++ linux-maule/include/asm-x86_64/msi.h 2006-01-19 09:46:52.315749136 -0600 @@ -13,4 +13,12 @@ #define LAST_DEVICE_VECTOR 232 #define MSI_TARGET_CPU_SHIFT 12 +extern struct msi_ops msi_apic_ops; + +static inline int msi_arch_init(void) +{ + msi_register(&msi_apic_ops); + return 0; +} + #endif /* ASM_MSI_H */ Index: linux-maule/include/asm-ia64/machvec.h =================================================================== --- linux-maule.orig/include/asm-ia64/machvec.h 2006-01-17 11:09:18.000000000 -0600 +++ linux-maule/include/asm-ia64/machvec.h 2006-01-19 09:46:52.315749136 -0600 @@ -74,6 +74,7 @@ typedef unsigned short ia64_mv_readw_relaxed_t (const volatile void __iomem *); typedef unsigned int ia64_mv_readl_relaxed_t (const volatile void __iomem *); typedef unsigned long ia64_mv_readq_relaxed_t (const volatile void __iomem *); +typedef int ia64_mv_msi_init_t (void); static inline void machvec_noop (void) @@ -146,6 +147,7 @@ # define platform_readw_relaxed ia64_mv.readw_relaxed # define platform_readl_relaxed ia64_mv.readl_relaxed # define platform_readq_relaxed ia64_mv.readq_relaxed +# define platform_msi_init ia64_mv.msi_init # endif /* __attribute__((__aligned__(16))) is required to make size of the @@ -194,6 +196,7 @@ ia64_mv_readw_relaxed_t *readw_relaxed; ia64_mv_readl_relaxed_t *readl_relaxed; ia64_mv_readq_relaxed_t *readq_relaxed; + ia64_mv_msi_init_t *msi_init; } __attribute__((__aligned__(16))); /* align attrib? see above comment */ #define MACHVEC_INIT(name) \ @@ -238,6 +241,7 @@ platform_readw_relaxed, \ platform_readl_relaxed, \ platform_readq_relaxed, \ + platform_msi_init, \ } extern struct ia64_machine_vector ia64_mv; @@ -386,5 +390,13 @@ #ifndef platform_readq_relaxed # define platform_readq_relaxed __ia64_readq_relaxed #endif +#ifndef platform_msi_init +#ifdef CONFIG_PCI_MSI +#include /* pull in ia64_msi_init() */ +# define platform_msi_init ia64_msi_init +#else +# define platform_msi_init NULL +#endif /* CONFIG_PCI_MSI */ +#endif #endif /* _ASM_IA64_MACHVEC_H */ Index: linux-maule/include/asm-ia64/machvec_sn2.h =================================================================== --- linux-maule.orig/include/asm-ia64/machvec_sn2.h 2006-01-17 11:09:18.000000000 -0600 +++ linux-maule/include/asm-ia64/machvec_sn2.h 2006-01-19 09:46:52.315749136 -0600 @@ -71,6 +71,7 @@ extern ia64_mv_dma_sync_sg_for_device sn_dma_sync_sg_for_device; extern ia64_mv_dma_mapping_error sn_dma_mapping_error; extern ia64_mv_dma_supported sn_dma_supported; +extern ia64_mv_msi_init_t sn_msi_init; /* * This stuff has dual use! @@ -120,6 +121,11 @@ #define platform_dma_sync_sg_for_device sn_dma_sync_sg_for_device #define platform_dma_mapping_error sn_dma_mapping_error #define platform_dma_supported sn_dma_supported +#ifdef CONFIG_PCI_MSI +#define platform_msi_init sn_msi_init +#else +#define platform_msi_init NULL +#endif #include Index: linux-maule/include/asm-ia64/msi.h =================================================================== --- linux-maule.orig/include/asm-ia64/msi.h 2006-01-17 11:09:18.000000000 -0600 +++ linux-maule/include/asm-ia64/msi.h 2006-01-19 09:46:52.315749136 -0600 @@ -14,4 +14,19 @@ #define ack_APIC_irq ia64_eoi #define MSI_TARGET_CPU_SHIFT 4 +extern struct msi_ops msi_apic_ops; + +/* Ugly defs to avoid having to include pci.h in machvec.h */ +struct msi_ops; +extern int msi_register(struct msi_ops *); + +/* default ia64 msi init routine */ +static inline int ia64_msi_init(void) +{ + msi_register(&msi_apic_ops); + return 0; +} + +#define msi_arch_init platform_msi_init /* in asm/machvec.h */ + #endif /* ASM_MSI_H */ Index: linux-maule/arch/ia64/sn/pci/Makefile =================================================================== --- linux-maule.orig/arch/ia64/sn/pci/Makefile 2006-01-17 11:09:12.000000000 -0600 +++ linux-maule/arch/ia64/sn/pci/Makefile 2006-01-19 09:46:52.315749136 -0600 @@ -3,8 +3,9 @@ # License. See the file "COPYING" in the main directory of this archive # for more details. # -# Copyright (C) 2000-2004 Silicon Graphics, Inc. All Rights Reserved. +# Copyright (C) 2000-2005 Silicon Graphics, Inc. All Rights Reserved. # # Makefile for the sn pci general routines. obj-y := pci_dma.o tioca_provider.o tioce_provider.o pcibr/ +obj-$(CONFIG_PCI_MSI) += msi.o Index: linux-maule/arch/ia64/sn/pci/msi.c =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 +++ linux-maule/arch/ia64/sn/pci/msi.c 2006-01-19 12:39:27.915552602 -0600 @@ -0,0 +1,18 @@ +/* + * This file is subject to the terms and conditions of the GNU General Public + * License. See the file "COPYING" in the main directory of this archive + * for more details. + * + * Copyright (C) 2005 Silicon Graphics, Inc. All Rights Reserved. + */ + +#include + +int +sn_msi_init(void) +{ + /* + * return error until MSI is supported on altix platforms + */ + return -EINVAL; +} Index: linux-maule/drivers/pci/Makefile =================================================================== --- linux-maule.orig/drivers/pci/Makefile 2006-01-17 11:09:15.000000000 -0600 +++ linux-maule/drivers/pci/Makefile 2006-01-19 09:46:52.319749598 -0600 @@ -26,7 +26,7 @@ obj-$(CONFIG_PPC64) += setup-bus.o obj-$(CONFIG_MIPS) += setup-bus.o setup-irq.o obj-$(CONFIG_X86_VISWS) += setup-irq.o -obj-$(CONFIG_PCI_MSI) += msi.o +obj-$(CONFIG_PCI_MSI) += msi.o msi-apic.o # # ACPI Related PCI FW Functions Index: linux-maule/drivers/pci/msi-apic.c =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 +++ linux-maule/drivers/pci/msi-apic.c 2006-01-19 09:46:52.319749598 -0600 @@ -0,0 +1,100 @@ +/* + * MSI hooks for standard x86 apic + */ + +#include +#include + +#include "msi.h" + +/* + * Shifts for APIC-based data + */ + +#define MSI_DATA_VECTOR_SHIFT 0 +#define MSI_DATA_VECTOR(v) (((u8)v) << MSI_DATA_VECTOR_SHIFT) + +#define MSI_DATA_DELIVERY_SHIFT 8 +#define MSI_DATA_DELIVERY_FIXED (0 << MSI_DATA_DELIVERY_SHIFT) +#define MSI_DATA_DELIVERY_LOWPRI (1 << MSI_DATA_DELIVERY_SHIFT) + +#define MSI_DATA_LEVEL_SHIFT 14 +#define MSI_DATA_LEVEL_DEASSERT (0 << MSI_DATA_LEVEL_SHIFT) +#define MSI_DATA_LEVEL_ASSERT (1 << MSI_DATA_LEVEL_SHIFT) + +#define MSI_DATA_TRIGGER_SHIFT 15 +#define MSI_DATA_TRIGGER_EDGE (0 << MSI_DATA_TRIGGER_SHIFT) +#define MSI_DATA_TRIGGER_LEVEL (1 << MSI_DATA_TRIGGER_SHIFT) + +/* + * Shift/mask fields for APIC-based bus address + */ + +#define MSI_ADDR_HEADER 0xfee00000 + +#define MSI_ADDR_DESTID_MASK 0xfff0000f +#define MSI_ADDR_DESTID_CPU(cpu) ((cpu) << MSI_TARGET_CPU_SHIFT) + +#define MSI_ADDR_DESTMODE_SHIFT 2 +#define MSI_ADDR_DESTMODE_PHYS (0 << MSI_ADDR_DESTMODE_SHIFT) +#define MSI_ADDR_DESTMODE_LOGIC (1 << MSI_ADDR_DESTMODE_SHIFT) + +#define MSI_ADDR_REDIRECTION_SHIFT 3 +#define MSI_ADDR_REDIRECTION_CPU (0 << MSI_ADDR_REDIRECTION_SHIFT) +#define MSI_ADDR_REDIRECTION_LOWPRI (1 << MSI_ADDR_REDIRECTION_SHIFT) + + +static void +msi_target_apic(unsigned int vector, + unsigned int dest_cpu, + u32 *address_hi, /* in/out */ + u32 *address_lo) /* in/out */ +{ + u32 addr = *address_lo; + + addr &= MSI_ADDR_DESTID_MASK; + addr |= MSI_ADDR_DESTID_CPU(cpu_physical_id(dest_cpu)); + + *address_lo = addr; +} + +static int +msi_setup_apic(struct pci_dev *pdev, /* unused in generic */ + unsigned int vector, + u32 *address_hi, + u32 *address_lo, + u32 *data) +{ + unsigned long dest_phys_id; + + dest_phys_id = cpu_physical_id(first_cpu(cpu_online_map)); + + *address_hi = 0; + *address_lo = MSI_ADDR_HEADER | + MSI_ADDR_DESTMODE_PHYS | + MSI_ADDR_REDIRECTION_CPU | + MSI_ADDR_DESTID_CPU(dest_phys_id); + + *data = MSI_DATA_TRIGGER_EDGE | + MSI_DATA_LEVEL_ASSERT | + MSI_DATA_DELIVERY_FIXED | + MSI_DATA_VECTOR(vector); + + return 0; +} + +static void +msi_teardown_apic(unsigned int vector) +{ + return; /* no-op */ +} + +/* + * Generic ops used on most IA archs/platforms. Set with msi_register() + */ + +struct msi_ops msi_apic_ops = { + .setup = msi_setup_apic, + .teardown = msi_teardown_apic, + .target = msi_target_apic, +}; Index: linux-maule/drivers/pci/msi.h =================================================================== --- linux-maule.orig/drivers/pci/msi.h 2006-01-17 11:09:15.000000000 -0600 +++ linux-maule/drivers/pci/msi.h 2006-01-19 09:46:52.319749598 -0600 @@ -69,67 +69,6 @@ #define msix_mask(address) (address | PCI_MSIX_FLAGS_BITMASK) #define msix_is_pending(address) (address & PCI_MSIX_FLAGS_PENDMASK) -/* - * MSI Defined Data Structures - */ -#define MSI_ADDRESS_HEADER 0xfee -#define MSI_ADDRESS_HEADER_SHIFT 12 -#define MSI_ADDRESS_HEADER_MASK 0xfff000 -#define MSI_ADDRESS_DEST_ID_MASK 0xfff0000f -#define MSI_TARGET_CPU_MASK 0xff -#define MSI_DELIVERY_MODE 0 -#define MSI_LEVEL_MODE 1 /* Edge always assert */ -#define MSI_TRIGGER_MODE 0 /* MSI is edge sensitive */ -#define MSI_PHYSICAL_MODE 0 -#define MSI_LOGICAL_MODE 1 -#define MSI_REDIRECTION_HINT_MODE 0 - -struct msg_data { -#if defined(__LITTLE_ENDIAN_BITFIELD) - __u32 vector : 8; - __u32 delivery_mode : 3; /* 000b: FIXED | 001b: lowest prior */ - __u32 reserved_1 : 3; - __u32 level : 1; /* 0: deassert | 1: assert */ - __u32 trigger : 1; /* 0: edge | 1: level */ - __u32 reserved_2 : 16; -#elif defined(__BIG_ENDIAN_BITFIELD) - __u32 reserved_2 : 16; - __u32 trigger : 1; /* 0: edge | 1: level */ - __u32 level : 1; /* 0: deassert | 1: assert */ - __u32 reserved_1 : 3; - __u32 delivery_mode : 3; /* 000b: FIXED | 001b: lowest prior */ - __u32 vector : 8; -#else -#error "Bitfield endianness not defined! Check your byteorder.h" -#endif -} __attribute__ ((packed)); - -struct msg_address { - union { - struct { -#if defined(__LITTLE_ENDIAN_BITFIELD) - __u32 reserved_1 : 2; - __u32 dest_mode : 1; /*0:physic | 1:logic */ - __u32 redirection_hint: 1; /*0: dedicated CPU - 1: lowest priority */ - __u32 reserved_2 : 4; - __u32 dest_id : 24; /* Destination ID */ -#elif defined(__BIG_ENDIAN_BITFIELD) - __u32 dest_id : 24; /* Destination ID */ - __u32 reserved_2 : 4; - __u32 redirection_hint: 1; /*0: dedicated CPU - 1: lowest priority */ - __u32 dest_mode : 1; /*0:physic | 1:logic */ - __u32 reserved_1 : 2; -#else -#error "Bitfield endianness not defined! Check your byteorder.h" -#endif - }u; - __u32 value; - }lo_address; - __u32 hi_address; -} __attribute__ ((packed)); - struct msi_desc { struct { __u8 type : 5; /* {0: unused, 5h:MSI, 11h:MSI-X} */ @@ -138,7 +77,7 @@ __u8 reserved: 1; /* reserved */ __u8 entry_nr; /* specific enabled entry */ __u8 default_vector; /* default pre-assigned vector */ - __u8 current_cpu; /* current destination cpu */ + __u8 unused; /* formerly unused destination cpu*/ }msi_attrib; struct { Index: linux-maule/include/linux/pci.h =================================================================== --- linux-maule.orig/include/linux/pci.h 2006-01-17 11:09:18.000000000 -0600 +++ linux-maule/include/linux/pci.h 2006-01-19 09:46:52.319749598 -0600 @@ -547,6 +547,66 @@ u16 entry; /* driver uses to specify entry, OS writes */ }; +/* + * MSI operation vector. Used by the msi core code (drivers/pci/msi.c) + * to abstract platform-specific tasks relating to MSI address generation + * and resource management. + */ +struct msi_ops { + /** + * setup - generate an MSI bus address and data for a given vector + * @pdev: PCI device context (in) + * @vector: vector allocated by the msi core (in) + * @addr_hi: upper 32 bits of PCI bus MSI address (out) + * @addr_lo: lower 32 bits of PCI bus MSI address (out) + * @data: MSI data payload (out) + * + * Description: The setup op is used to generate a PCI bus addres and + * data which the msi core will program into the card MSI capability + * registers. The setup routine is responsible for picking an initial + * cpu to target the MSI at. The setup routine is responsible for + * examining pdev to determine the MSI capabilities of the card and + * generating a suitable address/data. The setup routine is + * responsible for allocating and tracking any system resources it + * needs to route the MSI to the cpu it picks, and for associating + * those resources with the passed in vector. + * + * Returns 0 if the MSI address/data was successfully setup. + **/ + + int (*setup) (struct pci_dev *pdev, unsigned int vector, + u32 *addr_hi, u32 *addr_lo, u32 *data); + + /** + * teardown - release resources allocated by setup + * @vector: vector context for resources (in) + * + * Description: The teardown op is used to release any resources + * that were allocated in the setup routine associated with the passed + * in vector. + **/ + + void (*teardown) (unsigned int vector); + + /** + * target - retarget an MSI at a different cpu + * @vector: vector context for resources (in) + * @cpu: new cpu to direct vector at (in) + * @addr_hi: new value of PCI bus upper 32 bits (in/out) + * @addr_lo: new value of PCI bus lower 32 bits (in/out) + * + * Description: The target op is used to redirect an MSI vector + * at a different cpu. addr_hi/addr_lo coming in are the existing + * values that the MSI core has programmed into the card. The + * target code is responsible for freeing any resources (if any) + * associated with the old address, and generating a new PCI bus + * addr_hi/addr_lo that will redirect the vector at the indicated cpu. + **/ + + void (*target) (unsigned int vector, unsigned int cpu, + u32 *addr_hi, u32 *addr_lo); +}; + #ifndef CONFIG_PCI_MSI static inline void pci_scan_msi_device(struct pci_dev *dev) {} static inline int pci_enable_msi(struct pci_dev *dev) {return -1;} @@ -555,6 +615,7 @@ struct msix_entry *entries, int nvec) {return -1;} static inline void pci_disable_msix(struct pci_dev *dev) {} static inline void msi_remove_pci_irq_vectors(struct pci_dev *dev) {} +static inline int msi_register(struct msi_ops *ops) {return -1;} #else extern void pci_scan_msi_device(struct pci_dev *dev); extern int pci_enable_msi(struct pci_dev *dev); @@ -563,6 +624,7 @@ struct msix_entry *entries, int nvec); extern void pci_disable_msix(struct pci_dev *dev); extern void msi_remove_pci_irq_vectors(struct pci_dev *dev); +extern int msi_register(struct msi_ops *ops); #endif extern void pci_block_user_cfg_access(struct pci_dev *dev); From olh at suse.de Fri Jan 20 08:48:25 2006 From: olh at suse.de (Olaf Hering) Date: Thu, 19 Jan 2006 22:48:25 +0100 Subject: [PATCH 0/6] kdump support for ppc64 In-Reply-To: <20060116150712.GA4029@in.ibm.com> References: <20060116150712.GA4029@in.ibm.com> Message-ID: <20060119214825.GB7894@suse.de> On Mon, Jan 16, R Sharada wrote: > Review and test comments, inputs are welcome It doesnt seem to work for me: satsuma:~ # uname -a Linux satsuma 2.6.16-rc1-git2-kexec #7 SMP Thu Jan 19 22:08:43 CET 2006 ppc64 ppc64 ppc64 GNU/Linux satsuma:~ # kexec -p 2.6.16-rc1-git2-kdump/vmlinux --append="root=/dev/sdd2 init=/bin/bash --login" get memory ranges:1 machine_apply_elf_rel(51) mem_ehdr 0xfffffe39ce8 r_type 29 location 0x10097aea address 284401a value 2847bc0 machine_apply_elf_rel(51) mem_ehdr 0xfffffe39ce8 r_type 27 location 0x10097aee address 284401e value 2847bc0 machine_apply_elf_rel(51) mem_ehdr 0xfffffe39ce8 r_type 5 location 0x10097af6 address 2844026 value 2847bc0 machine_apply_elf_rel(51) mem_ehdr 0xfffffe39ce8 r_type 4 location 0x10097afa address 284402a value 2847bc0 machine_apply_elf_rel(51) mem_ehdr 0xfffffe39ce8 r_type 29 location 0x10097b02 address 2844032 value 2847bb0 machine_apply_elf_rel(51) mem_ehdr 0xfffffe39ce8 r_type 27 location 0x10097b06 address 2844036 value 2847bb0 machine_apply_elf_rel(51) mem_ehdr 0xfffffe39ce8 r_type 5 location 0x10097b0e address 284403e value 2847bb0 machine_apply_elf_rel(51) mem_ehdr 0xfffffe39ce8 r_type 4 location 0x10097b12 address 2844042 value 2847bb0 machine_apply_elf_rel(51) mem_ehdr 0xfffffe39ce8 r_type a location 0x10097b1c address 284404c value 0 REL24 -42221644 out of range! satsuma:~ # printf '%x\n' -42221644 fffffffffd7bbfb4 should it handle a value of 0 somehow, perhaps ignore it? -- short story of a lazy sysadmin: alias appserv=wotan From will_schmidt at vnet.ibm.com Fri Jan 20 08:56:14 2006 From: will_schmidt at vnet.ibm.com (will schmidt) Date: Thu, 19 Jan 2006 15:56:14 -0600 Subject: 2.6.15 failure on power4 iSeries In-Reply-To: <200601191155.53437.michael@ellerman.id.au> References: <43CC2DCC.6010201@vnet.ibm.com> <43CE6619.3080002@vnet.ibm.com> <43CEBC2F.2060507@vnet.ibm.com> <200601191155.53437.michael@ellerman.id.au> Message-ID: <43D00AFE.9050300@vnet.ibm.com> Michael Ellerman wrote: > On Thu, 19 Jan 2006 09:07, will schmidt wrote: > >>>looks like setup_arch() calls into do_init_bootmem() which loops around a >>>reserve_bootmem() call. the last call into reserve_bootmem isnt >>>returning. > > >>>-> reserve_bootmem ( 3c800000 0 4 > > > It shoud hit BUG_ON(!size) (in reserve_bootmem_core()), perhaps it is but > we're just not seeing it? Yeah, i followed code to that BUG call.. i'm not seeing any bug or panic message. > > >>the code making the last call into lmb_alloc looks like: >> DBG("-> do_init_bootmem %d\n",__LINE__); >> bootmap_pages = bootmem_bootmap_pages(total_pages); >> >> DBG("-> do_init_bootmem %d\n",__LINE__); >> start = lmb_alloc(bootmap_pages << PAGE_SHIFT, PAGE_SIZE); /* >>wms */ BUG_ON(!start); >> >> boot_mapsize = init_bootmem(start >> PAGE_SHIFT, total_pages); >> >> >>I think we call direct into lmb_alloc_base most of the time,.. so the >>difference with this call is the LMB_ALLOC_ANYWHERE parm.. >> >>unsigned long __init lmb_alloc(unsigned long size, unsigned long align) >>{ >> return lmb_alloc_base(size, align, LMB_ALLOC_ANYWHERE); >>} >> >>LMB_ALLOC_ANYWHERE looks to have a value of 0. >>"include/asm-powerpc/lmb.h:#define LMB_ALLOC_ANYWHERE 0" >> >>I am not very familiar with this code.. dont know if the '0' here is >>mistakenly mapped to a size, or if this 0 is a red herring. > > > I think that's fine. LMB_ALLOC_ANYWHERE just constrains where the alloc comes > from. For example if you need an alloc within the RMO. > > Try this patch to dump the lmbs. Might be good to compare the output of this to > the same from a known good kernel. > > cheers > turning on the lmb_dump_all func returns different values depending on how far we've gotten. Initially it returns this: just after entry to early_setup() lmb_dump_all: memory.cnt = 0x1 memory.size = 0x3c800000 memory.region[0x0].base = 0x0 .size = 0x3c800000 reserved.cnt = 0x1 reserved.size = 0x0 reserved.region[0x0].base = 0x0 .size = 0x500e80 just before we call into do_init_bootmem, looks more like this: lmb_dump_all: memory.cnt = 0x1 memory.size = 0x3c800000 memory.region[0x0].base = 0x0 .size = 0x3c800000 reserved.cnt = 0x4 reserved.size = 0x0 reserved.region[0x0].base = 0x0 .size = 0x500e80 reserved.region[0x1].base = 0xffe5000 .size = 0x1b000 reserved.region[0x2].base = 0x3c7ff668 .size = 0x994 reserved.region[0x3].base = 0x3c800000 .size = 0x0 Tried adding this debug to an earlier working kernel, but wasnt able to get output. I think i'm at a point before the CONFIG_PPC_EARLY_DEBUG_ISERIES config option existed. notice that the partition memory size happens to be the same as the .base of our last region. (memory.size , and physicalMemorySize value) (is there a bad assumption somewhere and we're squishing the size with lmb_enforce_memory_limit()?, or the overlaps_region? ) ----------------------------------------------------- ppc64_pft_size = 0x19 ppc64_interrupt_controller = 0x4 platform = 0x201 physicalMemorySize = 0x3c800000 <--- ppc64_caches.dcache_line_size = 0x80 ppc64_caches.icache_line_size = 0x80 htab_address = 0x0000000000000000 htab_hash_mask = 0x3ffff ----------------------------------------------------- -Will From olh at suse.de Fri Jan 20 10:32:00 2006 From: olh at suse.de (Olaf Hering) Date: Fri, 20 Jan 2006 00:32:00 +0100 Subject: [Fastboot] Re: [PATCH 0/6] kdump support for ppc64 In-Reply-To: <20060119214825.GB7894@suse.de> References: <20060116150712.GA4029@in.ibm.com> <20060119214825.GB7894@suse.de> Message-ID: <20060119233159.GA12009@suse.de> On Thu, Jan 19, Olaf Hering wrote: > machine_apply_elf_rel(51) mem_ehdr 0xfffffe39ce8 r_type a location 0x10097b1c address 284404c value 0 > REL24 -42221644 out of range! This is the .purgatory section. Building the tools with SLES9 fixes it for me. -- short story of a lazy sysadmin: alias appserv=wotan From hjsong at samsung.com Fri Jan 20 10:50:59 2006 From: hjsong at samsung.com (Hyo Jung Song) Date: Fri, 20 Jan 2006 08:50:59 +0900 Subject: FW: Fwd: kernel debugging tool In-Reply-To: Message-ID: <0ITD001SM6928T@mmp1.samsung.com> We are currently using Mambo (System Simulator) and we plan to purchase Cell Blade from IBM. on Mambo, how did you manage the kernel debugging? Thanks. > -----Original Message----- > From: Jens Osterkamp [mailto:Jens.Osterkamp at de.ibm.com] > Sent: Thursday, January 19, 2006 9:11 PM > To: Hyo Jung Song > Cc: linuxppc64-dev at ozlabs.org > Subject: Re: FW: Fwd: kernel debugging tool > > Hyo, > > besides simple printk debugging ;-) we use RISCwatch, which is a networked > device for JTAG communication. > You can read registers, memory, ... with it. > We also have a "drone" card which is a IBM internal development tool. > Basically it is a PCI card which gives you > access to a lot of lowlevel hardware resources in the machine. > > Hope that helps, > > Jens > > eMail: osterkam at de.ibm.com -- Phone: +49-(0)7031-16-5071 > IBM Germany Lab, Sch?naicherstr. 220, 71032 B?blingen > > > > > Hyo Jung Song > om> > To > Sent by: linuxppc64-dev at ozlabs.org > linuxppc64-dev-bo > cc > unces at ozlabs.org > > Subject > FW: Fwd: kernel debugging tool > 01/19/2006 01:00 > AM > > > > > > > > > WE are interested in Cell BE (broadband engine) Linux patch. (found in > http://www.bsc.es/projects/deepcomputing/linuxoncell/cbexdev.html) > We want to debug kernel sources sometimes. How can we do it? > I believe you guys debugged kernel source codes for CBE and you used > some tools. > Could you please some tips for this? Thank you. > > > > Hyo Jung Song > Senior Engineer > Samsung Electronics > tel. 82-2-3416-0355 > > -----Original Message----- > From: Cell Support [mailto:cell_support at bsc.es] > Sent: Wednesday, January 18, 2006 11:27 PM > To: hjsong at samsung.com > Cc: cell_support at bsc.es > Subject: Re: Fwd: kernel debugging tool > > Dear Hyo, > > we don't develop linux patches for Cell BE. We got them from public > kernel mailing lists and post them to help > people to built a kernel that works with Cell BE. This avoids having to > go through kernel mailing lists to > find the correct patch files that fit a specific kernel release. Hope > this helps people. > > We think you should post your question to a linux kernel mailing list. > Regarding the ppc64 kernel development, > the linuxppc64-dev at ozlabs.org is the right place > (https://ozlabs.org/mailman/listinfo/linuxppc64-dev). But > you can also sent this to the http://www.kernel.org mailing lists. > Probable, kernel developers can help you > because they are always debugging new their code. > > Hope this helps. > > Regards, > > > Sender : hjsong at samsung.com > > Date : 2006-01-17 10:13 > > Title : kernel debugging tool > > > > Hi. > > > > WE are interested in CBE Linux patch. > > We want to debug kernel sources sometimes. How can we do it? > > I believe you guys debugged kernel source codes for CBE and you used > > some tools. > > Could you please some tips for this? Thank you. > > > > > > > > Hyo Jung Song > > Senior Engineer > > Samsung Electronics > > tel. 82-2-3416-0355 > > > > _______________________________________________ > Linuxppc64-dev mailing list > Linuxppc64-dev at ozlabs.org > https://ozlabs.org/mailman/listinfo/linuxppc64-dev > > From haren at us.ibm.com Fri Jan 20 11:12:31 2006 From: haren at us.ibm.com (Haren Myneni) Date: Thu, 19 Jan 2006 16:12:31 -0800 Subject: [Fastboot] Re: [PATCH 0/6] kdump support for ppc64 In-Reply-To: <20060119233159.GA12009@suse.de> References: <20060116150712.GA4029@in.ibm.com> <20060119214825.GB7894@suse.de> <20060119233159.GA12009@suse.de> Message-ID: <43D02AEF.4050307@us.ibm.com> Olaf Hering wrote: > On Thu, Jan 19, Olaf Hering wrote: > > > >>machine_apply_elf_rel(51) mem_ehdr 0xfffffe39ce8 r_type a location 0x10097b1c address 284404c value 0 >>REL24 -42221644 out of range! >> >> > >This is the .purgatory section. Building the tools with SLES9 fixes it >for me. > > > Working when we built with gcc 3.3, but not for > gcc 3.4.5. From greg at kroah.com Fri Jan 20 13:15:28 2006 From: greg at kroah.com (Greg KH) Date: Thu, 19 Jan 2006 18:15:28 -0800 Subject: [PATCH 1/3] msi vector targeting abstractions In-Reply-To: <20060119194652.12213.96503.19247@lnx-maule.americas.sgi.com> References: <20060119194647.12213.44658.14543@lnx-maule.americas.sgi.com> <20060119194652.12213.96503.19247@lnx-maule.americas.sgi.com> Message-ID: <20060120021528.GA19201@kroah.com> On Thu, Jan 19, 2006 at 01:46:52PM -0600, Mark Maule wrote: > Abstract portions of the MSI core for platforms that do not use standard > APIC interrupt controllers. This is implemented through a new arch-specific > msi setup routine, and a set of msi ops which can be set on a per platform > basis. > > Signed-off-by: Mark Maule Note that I changed this patch a bunch, rearanging where things went (should not have touched include/linux/pci.h for this change) and everything builds properly still on i386. You should check that they build on ia64 now too. thanks, greg k-h From Jens.Osterkamp at de.ibm.com Fri Jan 20 17:13:25 2006 From: Jens.Osterkamp at de.ibm.com (Jens Osterkamp) Date: Fri, 20 Jan 2006 07:13:25 +0100 Subject: FW: Fwd: kernel debugging tool In-Reply-To: <0ITD001SM6928T@mmp1.samsung.com> Message-ID: > We are currently using Mambo (System Simulator) and we plan to > purchase Cell Blade from IBM. > > on Mambo, how did you manage the kernel debugging? I haven't done a lot of things with Mambo, so I cannot really comment on that. Mike ? Eric ? Jens From miltonm at bga.com Sat Jan 21 03:53:19 2006 From: miltonm at bga.com (Milton Miller) Date: Fri, 20 Jan 2006 10:53:19 -0600 Subject: [PATCH 0/5] powerpc: add device tree property update In-Reply-To: <200601190031.05668.arnd@arndb.de> References: <0e51f66be939a091b19b252a4e9e0114@bga.com> <1137624998.4823.144.camel@localhost.localdomain> <200601190031.05668.arnd@arndb.de> Message-ID: I've spent the night doing some coding and have a new patch against 2.6.16-rc1. I want to test out a bit before sending. The issue of what should we call this fs has been raised. Ideas so far include: promfs offs devicetreefs devicetree dtfs From: Milton Miller Subject: [RFC][PATCH] promfs v0.2 Here is a patch for a mountable system, called promfs, that only pins the device tree root when mounted. All other dentrys and inodes are dynamic. Both property files and device directorys hold a reference to the device_node through u.generic_ip. The property is therefore stored only in the dcache d_fsdata entry. Lookup searches directorys by full name, properties, then directorys by short name. We could add back by unit address. arch/powerpc/kernel/prom.c | 326 +++++++++++++++++++++++++++++++++++++++++++++ include/asm-powerpc/prom.h | 6 2 files changed, 332 insertions TODO: See if it even compiles Properly generate -p1 instead of -p3 patch hook the (pSeries) device tree property and node add -- prom_add_property should be ok, but the other interfaces do not get inode numbers assigned hook the (pSeries) device tree property removal hook the (pSeries) device tree node removal check if kill_anon_super is enough -- not pinning get true refcount on directories? show both name and fullname if different? should add/remove become file operations? From paulus at samba.org Fri Jan 20 16:13:11 2006 From: paulus at samba.org (Paul Mackerras) Date: Fri, 20 Jan 2006 16:13:11 +1100 Subject: [PATCH] trivial: modify comments to refer to new location of files In-Reply-To: <20060115183334.GA17151@us.ibm.com> References: <20060112180240.GB17539@us.ibm.com> <20060113114401.3289f33f.sfr@canb.auug.org.au> <20060115060716.GA2157@us.ibm.com> <20060115183334.GA17151@us.ibm.com> Message-ID: <17360.29031.368718.22396@cargo.ozlabs.ibm.com> Jon Mason writes: > This patch (ie, the one below, not the original) removes all self > references and fixes references to files in the now defunct arch/ppc64 > tree. I think this accomplises everything wanted, though there might > be a few references I missed. Hmmm, now it doesn't apply because it wants to patch files in arch/ppc that aren't there any more. > If me sending the new patch in this thread caused any confusion, I would > be happy to send the new patch in a seperate thread. Please send a new patch in a new thread with an appropriate description and signed-off-by line. Thanks, Paul. From jdmason at us.ibm.com Sat Jan 21 10:11:28 2006 From: jdmason at us.ibm.com (Jon Mason) Date: Fri, 20 Jan 2006 17:11:28 -0600 Subject: [PATCH] trivial: modify comments to refer to new location of files In-Reply-To: <17360.29031.368718.22396@cargo.ozlabs.ibm.com> References: <20060112180240.GB17539@us.ibm.com> <20060113114401.3289f33f.sfr@canb.auug.org.au> <20060115060716.GA2157@us.ibm.com> <20060115183334.GA17151@us.ibm.com> <17360.29031.368718.22396@cargo.ozlabs.ibm.com> Message-ID: <20060120231128.GI1489@us.ibm.com> On Fri, Jan 20, 2006 at 04:13:11PM +1100, Paul Mackerras wrote: > Jon Mason writes: > > > This patch (ie, the one below, not the original) removes all self > > references and fixes references to files in the now defunct arch/ppc64 > > tree. I think this accomplises everything wanted, though there might > > be a few references I missed. > > Hmmm, now it doesn't apply because it wants to patch files in arch/ppc > that aren't there any more. Strange. I'll rediff and provide the signed-off-by and description you requested. Thanks, Jon > > > If me sending the new patch in this thread caused any confusion, I would > > be happy to send the new patch in a seperate thread. > > Please send a new patch in a new thread with an appropriate > description and signed-off-by line. > > Thanks, > Paul. > From galak at kernel.crashing.org Sat Jan 21 10:26:29 2006 From: galak at kernel.crashing.org (Kumar Gala) Date: Fri, 20 Jan 2006 17:26:29 -0600 Subject: [PATCH] trivial: modify comments to refer to new location of files In-Reply-To: <20060120231128.GI1489@us.ibm.com> References: <20060112180240.GB17539@us.ibm.com> <20060113114401.3289f33f.sfr@canb.auug.org.au> <20060115060716.GA2157@us.ibm.com> <20060115183334.GA17151@us.ibm.com> <17360.29031.368718.22396@cargo.ozlabs.ibm.com> <20060120231128.GI1489@us.ibm.com> Message-ID: <1B718DBB-B476-48C7-A6E3-368DBFB3011E@kernel.crashing.org> On Jan 20, 2006, at 5:11 PM, Jon Mason wrote: > On Fri, Jan 20, 2006 at 04:13:11PM +1100, Paul Mackerras wrote: >> Jon Mason writes: >> >>> This patch (ie, the one below, not the original) removes all self >>> references and fixes references to files in the now defunct arch/ >>> ppc64 >>> tree. I think this accomplises everything wanted, though there >>> might >>> be a few references I missed. >> >> Hmmm, now it doesn't apply because it wants to patch files in arch/ >> ppc >> that aren't there any more. > > Strange. I'll rediff and provide the signed-off-by and description you > requested. > > Thanks, > Jon And make sure to fix any new cases that I might have introduced :) - k From michael at ellerman.id.au Sat Jan 21 15:23:27 2006 From: michael at ellerman.id.au (Michael Ellerman) Date: Sat, 21 Jan 2006 17:23:27 +1300 Subject: 2.6.15 failure on power4 iSeries In-Reply-To: <43D00AFE.9050300@vnet.ibm.com> References: <43CC2DCC.6010201@vnet.ibm.com> <200601191155.53437.michael@ellerman.id.au> <43D00AFE.9050300@vnet.ibm.com> Message-ID: <200601211723.30448.michael@ellerman.id.au> On Fri, 20 Jan 2006 10:56, you wrote: > Michael Ellerman wrote: > > On Thu, 19 Jan 2006 09:07, will schmidt wrote: > >>>looks like setup_arch() calls into do_init_bootmem() which loops around > >>> a reserve_bootmem() call. the last call into reserve_bootmem isnt > >>> returning. > >>> > >>> > >>>-> reserve_bootmem ( 3c800000 0 4 > > > > It shoud hit BUG_ON(!size) (in reserve_bootmem_core()), perhaps it is but > > we're just not seeing it? > > Yeah, i followed code to that BUG call.. i'm not seeing any bug or panic > message. That's curious. :) > turning on the lmb_dump_all func returns different values depending on how > far we've gotten. Yeah that's normal, people are reserving memory as we go and so the reserved stuff changes. You shouldn't see the memory.* stuff changing though. > Initially it returns this: just after entry to early_setup() > lmb_dump_all: > memory.cnt = 0x1 > memory.size = 0x3c800000 > memory.region[0x0].base = 0x0 > .size = 0x3c800000 > > reserved.cnt = 0x1 > reserved.size = 0x0 > reserved.region[0x0].base = 0x0 > .size = 0x500e80 So it thinks you've got just under 1G of RAM, is that about right? The reserved region will be the kernel text I think. > just before we call into do_init_bootmem, looks more like this: > lmb_dump_all: > memory.cnt = 0x1 > memory.size = 0x3c800000 > memory.region[0x0].base = 0x0 > .size = 0x3c800000 > > reserved.cnt = 0x4 > reserved.size = 0x0 > reserved.region[0x0].base = 0x0 > .size = 0x500e80 > reserved.region[0x1].base = 0xffe5000 > .size = 0x1b000 > reserved.region[0x2].base = 0x3c7ff668 > .size = 0x994 > reserved.region[0x3].base = 0x3c800000 > .size = 0x0 That last reserved region looks bogus (obviously). It'd be _really_ interesting to know who's adding that. You might be able to hack something with DBG to print __builtin_return_address() or whatever it is, to get the caller of lmb_reserve. > Tried adding this debug to an earlier working kernel, but wasnt able to get > output. I think i'm at a point before the CONFIG_PPC_EARLY_DEBUG_ISERIES > config option existed. Yep, it's pretty new. We could hack up iSeries early debug for older kernels if we wanted, what's the latest kernel that worked? > notice that the partition memory size happens to be the same as the .base > of our last region. (memory.size , and physicalMemorySize value) (is there > a bad assumption somewhere and we're squishing the size with > lmb_enforce_memory_limit()?, or the overlaps_region? ) Yeah that looks weird doesn't it. I'm internet caf'ing it at the moment, so will have a look tonight and get back to you. cheers -- Michael Ellerman IBM OzLabs email: michael:ellerman.id.au inmsg: mpe:jabber.org wwweb: http://michael.ellerman.id.au phone: +61 2 6212 1183 (tie line 70 21183) We do not inherit the earth from our ancestors, we borrow it from our children. - S.M.A.R.T Person -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: not available Url : http://ozlabs.org/pipermail/linuxppc64-dev/attachments/20060121/4f3cd0c2/attachment.pgp From mkistler at us.ibm.com Sat Jan 21 01:52:40 2006 From: mkistler at us.ibm.com (Mike Kistler) Date: Fri, 20 Jan 2006 08:52:40 -0600 Subject: FW: Fwd: kernel debugging tool In-Reply-To: Message-ID: Jens, Mambo supports gdb attach to allow kernel debugging. This is done using the "remote agent" feature of gdb. Mambo listens on a socket, and gdb attachs using the "target remote" command. Then gdb commands are passed to Mambo and Mambo handles them accordingly. I can provide more details if necessary. Regards, Mike Jens Osterkamp at IBMDE 01/20/2006 12:13 AM To: Hyo Jung Song cc: linuxppc64-dev at ozlabs.org, ericvh at gmail.com, Mike Kistler/Austin/IBM at IBMUS Subject: RE: FW: Fwd: kernel debugging tool > We are currently using Mambo (System Simulator) and we plan to > purchase Cell Blade from IBM. > > on Mambo, how did you manage the kernel debugging? I haven't done a lot of things with Mambo, so I cannot really comment on that. Mike ? Eric ? Jens -------------- next part -------------- An HTML attachment was scrubbed... URL: http://ozlabs.org/pipermail/linuxppc64-dev/attachments/20060120/f05680d1/attachment.htm From npiggin at suse.de Sat Jan 21 22:25:36 2006 From: npiggin at suse.de (Nick Piggin) Date: Sat, 21 Jan 2006 12:25:36 +0100 Subject: [patch] powerpc: native atomic_add_unless Message-ID: <20060121112536.GA27505@wotan.suse.de> Hi list, atomic_add_unless (atomic_inc_not_zero) is used in several hot paths in the vfs and I'm planning some uses in the memory manager, so it should be as small and fast as possible. Joel had a good suggestion to save a register but all bugs are mine. Comments? Nick -- Implement atomic_add_unless natively instead of using cmpxchg. Improvements by Joel Schopp. Signed-off-by: Nick Piggin Index: linux-2.6/include/asm-powerpc/atomic.h =================================================================== --- linux-2.6.orig/include/asm-powerpc/atomic.h +++ linux-2.6/include/asm-powerpc/atomic.h @@ -8,6 +8,7 @@ typedef struct { volatile int counter; } atomic_t; #ifdef __KERNEL__ +#include #include #include @@ -176,20 +177,29 @@ static __inline__ int atomic_dec_return( * Atomically adds @a to @v, so long as it was not @u. * Returns non-zero if @v was not @u, and zero otherwise. */ -#define atomic_add_unless(v, a, u) \ -({ \ - int c, old; \ - c = atomic_read(v); \ - for (;;) { \ - if (unlikely(c == (u))) \ - break; \ - old = atomic_cmpxchg((v), c, c + (a)); \ - if (likely(old == c)) \ - break; \ - c = old; \ - } \ - c != (u); \ -}) +static __inline__ int atomic_add_unless(atomic_t *v, int a, int u) +{ + int t; + + __asm__ __volatile__ ( + LWSYNC_ON_SMP +"1: lwarx %0,0,%1 # atomic_add_unless\n\ + cmpw 0,%0,%3 \n\ + beq- 2f \n\ + add %0,%2,%0 \n" + PPC405_ERR77(0,%2) +" stwcx. %0,0,%1 \n\ + bne- 1b \n" + ISYNC_ON_SMP +" subf %0,%2,%0 \n\ +2:" + : "=&r" (t) + : "r" (&v->counter), "r" (a), "r" (u) + : "cc", "memory"); + + return likely(t != u); +} + #define atomic_inc_not_zero(v) atomic_add_unless((v), 1, 0) #define atomic_sub_and_test(a, v) (atomic_sub_return((a), (v)) == 0) From stefan at nocrew.org Mon Jan 23 05:50:37 2006 From: stefan at nocrew.org (Stefan Berndtsson) Date: Sun, 22 Jan 2006 19:50:37 +0100 Subject: Vortex AU8820 crashes in PPC64 Message-ID: <87d5ikksg2.fsf@nopanic.nocrew.org> When loading the ALSA module snd-au8820, I get the oops below. Kernel used is 2.6.15 (2.6.15-1-powerpc64 from debian). Command used is "modprobe snd-au8820" which results in the oops and a Segmentation Fault for modprobe. PCI: Enabling device: (0001:06:03.0), cmd 7 Vortex: init.... <1>Unable to handle kernel paging request for data at address 0xd000080083973018 Faulting instruction address: 0xd0000000002b1118 Oops: Kernel access of bad area, sig: 11 [#1] SMP NR_CPUS=32 NUMA POWERMAC Modules linked in: snd_au8820 snd_ac97_codec snd_ac97_bus gameport snd_mpu401_uart snd_rawmidi snd_seq_device rfcomm l2cap bluetooth snd_pcm_oss snd_pcm snd_page_alloc snd_timer snd_mixer_oss snd soundcore tun usbhid ohci_hcd ehci_hcd usbcore sungem sungem_phy ipv6 ext3 jbd mbcache sd_mod generic sata_svw libata scsi_mod evdev NIP: D0000000002B1118 LR: D0000000002B1104 CTR: 0000000000000000 REGS: c00000001b9634e0 TRAP: 0300 Not tainted (2.6.15-1-powerpc64) MSR: 9000000000009032 CR: 24002482 XER: 00000000 DAR: D000080083973018, DSISR: 0000000042000000 TASK = c00000001ec1a7f0[1674] 'modprobe' THREAD: c00000001b960000 CPU: 0 GPR00: D000080083973018 C00000001B963760 D0000000002C2470 0000000000000017 GPR04: 9000000000009032 0000000000000001 0000000000000010 C00000000036AC00 GPR08: 00000000000047F2 D00008008396E000 C000000000443B28 FFFFFFFFFFFFFFFF GPR12: 0000000044002488 C00000000036AC00 0000000000000000 0000000000000000 GPR16: 0000000000000000 0000000000000000 00000000100013D0 000000001001E328 GPR20: 00000000F7FD4000 0000000000000003 0000000000000000 0000000000000000 GPR24: 000000001001E778 0000000000000000 C000000001AF0800 C000000010BF6000 GPR28: D0000000002B87A8 0000000000000000 D0000000002C1C80 C00000001B944000 NIP [D0000000002B1118] .snd_vortex_probe+0x1cc/0x10c8 [snd_au8820] LR [D0000000002B1104] .snd_vortex_probe+0x1b8/0x10c8 [snd_au8820] Call Trace: [C00000001B963760] [D0000000002B1104] .snd_vortex_probe+0x1b8/0x10c8 [snd_au8820] (unreliable) [C00000001B963850] [C00000000014D3B0] .pci_device_probe+0xc0/0x14c [C00000001B9638F0] [C0000000001EE294] .driver_probe_device+0x98/0x110 [C00000001B963980] [C0000000001EE458] .__driver_attach+0x68/0xb8 [C00000001B963A10] [C0000000001ED354] .bus_for_each_dev+0x78/0xc8 [C00000001B963AC0] [C0000000001EDF70] .driver_attach+0x28/0x40 [C00000001B963B40] [C0000000001ED9D8] .bus_add_driver+0x90/0x17c [C00000001B963BE0] [C0000000001EE8F4] .driver_register+0x5c/0x78 [C00000001B963C80] [C00000000014CCEC] .__pci_register_driver+0xa8/0xf4 [C00000001B963D20] [D0000000002B35D8] .alsa_card_vortex_init+0x20/0x38 [snd_au8820] [C00000001B963DA0] [C000000000070D54] .sys_init_module+0x1b4/0x3f8 [C00000001B963E30] [C000000000008600] syscall_exit+0x0/0x18 Instruction dump: e87e8178 3ba0fff4 48002539 e8410028 4800074c e87e8180 48002529 e8410028 e93f1500 3960ffff 3d290002 38095018 <7d60052c> 7c0004ac 38600005 48002805 /Stefan Berndtsson From stefan at nocrew.org Mon Jan 23 06:36:19 2006 From: stefan at nocrew.org (Stefan Berndtsson) Date: Sun, 22 Jan 2006 20:36:19 +0100 Subject: Vortex AU8820 crashes in PPC64 In-Reply-To: <87d5ikksg2.fsf@nopanic.nocrew.org> (Stefan Berndtsson's message of "Sun, 22 Jan 2006 19:50:37 +0100") References: <87d5ikksg2.fsf@nopanic.nocrew.org> Message-ID: <871wz0kqbw.fsf@nopanic.nocrew.org> Stefan Berndtsson writes: > When loading the ALSA module snd-au8820, I get the oops below. > > Kernel used is 2.6.15 (2.6.15-1-powerpc64 from debian). > > Command used is "modprobe snd-au8820" which results in the oops > and a Segmentation Fault for modprobe. Could be relevant to mention that it's running on a G5, single-1.8GHz, and it works in 2.6.11 (32bit kernel). /Stefan Berndtsson From npiggin at suse.de Mon Jan 23 17:41:46 2006 From: npiggin at suse.de (Nick Piggin) Date: Mon, 23 Jan 2006 07:41:46 +0100 Subject: [patch] powerpc: native atomic_add_unless In-Reply-To: <20060121112536.GA27505@wotan.suse.de> References: <20060121112536.GA27505@wotan.suse.de> Message-ID: <20060123064146.GB15112@wotan.suse.de> On Sat, Jan 21, 2006 at 12:25:36PM +0100, Nick Piggin wrote: > Hi list, > > atomic_add_unless (atomic_inc_not_zero) is used in several hot paths in the > vfs and I'm planning some uses in the memory manager, so it should be as > small and fast as possible. > > Joel had a good suggestion to save a register but all bugs are mine. > > Comments? > Sorry, this probably doesn't compile without also the following patch -- Index: linux-2.6/include/asm-powerpc/synch.h =================================================================== --- linux-2.6.orig/include/asm-powerpc/synch.h +++ linux-2.6/include/asm-powerpc/synch.h @@ -15,7 +15,7 @@ #endif #ifdef CONFIG_SMP -#define ISYNC_ON_SMP "\n\tisync" +#define ISYNC_ON_SMP "\n\tisync\n" #define LWSYNC_ON_SMP __stringify(LWSYNC) "\n" #else #define ISYNC_ON_SMP From jfaslist at yahoo.fr Tue Jan 24 02:29:48 2006 From: jfaslist at yahoo.fr (jfaslist) Date: Mon, 23 Jan 2006 16:29:48 +0100 Subject: IOCTL from 64b user space Message-ID: <43D4F66C.9000301@yahoo.fr> Hi, I am using a Maple platform. I have written a driver which ioctl entry point expects a structure passed from a 64b user space program. The driver is passed the structure address in the "arg" argument: int (*ioctl) (struct inode *inode, struct file *filp, unsigned int cmd, unsigned long arg); But in my driver when I look at the address of that structure (prior to doing a copy_from_user ) , I see the address is "0". the "cmd" ioctl code is correct though. Question: can I have 64b apps making ioctl calls? or do I have to use only 32b apps and use the ioctl32.c scheme, like on Sparc64? Sorry for what is likely a basic question. Thanks -jf simon ___________________________________________________________________________ Nouveau : t?l?phonez moins cher avec Yahoo! Messenger ! D?couvez les tarifs exceptionnels pour appeler la France et l'international. T?l?chargez sur http://fr.messenger.yahoo.com From jfaslist at yahoo.fr Tue Jan 24 03:21:06 2006 From: jfaslist at yahoo.fr (jfaslist) Date: Mon, 23 Jan 2006 17:21:06 +0100 Subject: IOCTL from 64b user space In-Reply-To: <43D4F66C.9000301@yahoo.fr> References: <43D4F66C.9000301@yahoo.fr> Message-ID: <43D50272.90900@yahoo.fr> jfaslist wrote: > Hi, > I am using a Maple platform. > I have written a driver which ioctl entry point expects a structure > passed from a 64b user space program. The driver is passed the > structure address in the "arg" argument: > > int (*ioctl) (struct inode *inode, struct file *filp, > unsigned int cmd, unsigned long arg); > > But in my driver when I look at the address of that structure (prior > to doing a copy_from_user ) , I see the address is "0". the "cmd" > ioctl code is correct though. > Question: can I have 64b apps making ioctl calls? or do I have to use > only 32b apps and use the ioctl32.c scheme, like on Sparc64? > > Sorry for what is likely a basic question. > Thanks > -jf simon > > Please ignore. It was a bug in my code. Sorry -jfs ___________________________________________________________________________ Nouveau : t?l?phonez moins cher avec Yahoo! Messenger ! D?couvez les tarifs exceptionnels pour appeler la France et l'international. T?l?chargez sur http://fr.messenger.yahoo.com From jdmason at us.ibm.com Tue Jan 24 03:58:20 2006 From: jdmason at us.ibm.com (Jon Mason) Date: Mon, 23 Jan 2006 10:58:20 -0600 Subject: [PATCH] trivial: modify comments to refer to new location of files In-Reply-To: <17360.29031.368718.22396@cargo.ozlabs.ibm.com> References: <20060112180240.GB17539@us.ibm.com> <20060113114401.3289f33f.sfr@canb.auug.org.au> <20060115060716.GA2157@us.ibm.com> <20060115183334.GA17151@us.ibm.com> <17360.29031.368718.22396@cargo.ozlabs.ibm.com> Message-ID: <20060123165820.GD17162@us.ibm.com> This patch removes all self references and fixes references to files in the now defunct arch/ppc64 tree. I think this accomplises everything wanted, though there might be a few references I missed. Applies cleanly to 2.6.16-rc1 Thanks, Jon Signed-off-by: Jon Mason diff -r df46ccb05adf Documentation/powerpc/eeh-pci-error-recovery.txt --- a/Documentation/powerpc/eeh-pci-error-recovery.txt Fri Jan 20 09:49:15 2006 +++ b/Documentation/powerpc/eeh-pci-error-recovery.txt Mon Jan 23 08:34:59 2006 @@ -121,7 +121,7 @@ EEH must be enabled in the PHB's very early during the boot process, and if a PCI slot is hot-plugged. The former is performed by -eeh_init() in arch/ppc64/kernel/eeh.c, and the later by +eeh_init() in arch/powerpc/platforms/pseries/eeh.c, and the later by drivers/pci/hotplug/pSeries_pci.c calling in to the eeh.c code. EEH must be enabled before a PCI scan of the device can proceed. Current Power5 hardware will not work unless EEH is enabled; @@ -133,7 +133,7 @@ pci_get_device_by_addr() will find the pci device associated with that address (if any). -The default include/asm-ppc64/io.h macros readb(), inb(), insb(), +The default include/asm-powerpc/io.h macros readb(), inb(), insb(), etc. include a check to see if the i/o read returned all-0xff's. If so, these make a call to eeh_dn_check_failure(), which in turn asks the firmware if the all-ff's value is the sign of a true EEH @@ -143,11 +143,12 @@ all of these occur during boot, when the PCI bus is scanned, where a large number of 0xff reads are part of the bus scan procedure. -If a frozen slot is detected, code in arch/ppc64/kernel/eeh.c will -print a stack trace to syslog (/var/log/messages). This stack trace -has proven to be very useful to device-driver authors for finding -out at what point the EEH error was detected, as the error itself -usually occurs slightly beforehand. +If a frozen slot is detected, code in +arch/powerpc/platforms/pseries/eeh.c will print a stack trace to +syslog (/var/log/messages). This stack trace has proven to be very +useful to device-driver authors for finding out at what point the EEH +error was detected, as the error itself usually occurs slightly +beforehand. Next, it uses the Linux kernel notifier chain/work queue mechanism to allow any interested parties to find out about the failure. Device diff -r df46ccb05adf arch/powerpc/boot/install.sh --- a/arch/powerpc/boot/install.sh Fri Jan 20 09:49:15 2006 +++ b/arch/powerpc/boot/install.sh Mon Jan 23 08:34:59 2006 @@ -1,6 +1,4 @@ #!/bin/sh -# -# arch/ppc64/boot/install.sh # # This file is subject to the terms and conditions of the GNU General Public # License. See the file "COPYING" in the main directory of this archive diff -r df46ccb05adf arch/powerpc/kernel/entry_64.S --- a/arch/powerpc/kernel/entry_64.S Fri Jan 20 09:49:15 2006 +++ b/arch/powerpc/kernel/entry_64.S Mon Jan 23 08:34:59 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc64/kernel/entry.S - * * PowerPC version * Copyright (C) 1995-1996 Gary Thomas (gdt at linuxppc.org) * Rewritten by Cort Dougan (cort at cs.nmt.edu) for PReP @@ -374,7 +372,7 @@ * the fork code also. * * The code which creates the new task context is in 'copy_thread' - * in arch/ppc64/kernel/process.c + * in arch/powerpc/kernel/process.c */ .align 7 _GLOBAL(_switch) diff -r df46ccb05adf arch/powerpc/kernel/head_44x.S --- a/arch/powerpc/kernel/head_44x.S Fri Jan 20 09:49:15 2006 +++ b/arch/powerpc/kernel/head_44x.S Mon Jan 23 08:34:59 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/kernel/head_44x.S - * * Kernel execution entry point code. * * Copyright (c) 1995-1996 Gary Thomas diff -r df46ccb05adf arch/powerpc/kernel/head_64.S --- a/arch/powerpc/kernel/head_64.S Fri Jan 20 09:49:15 2006 +++ b/arch/powerpc/kernel/head_64.S Mon Jan 23 08:34:59 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc64/kernel/head.S - * * PowerPC version * Copyright (C) 1995-1996 Gary Thomas (gdt at linuxppc.org) * diff -r df46ccb05adf arch/powerpc/kernel/head_8xx.S --- a/arch/powerpc/kernel/head_8xx.S Fri Jan 20 09:49:15 2006 +++ b/arch/powerpc/kernel/head_8xx.S Mon Jan 23 08:34:59 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/kernel/except_8xx.S - * * PowerPC version * Copyright (C) 1995-1996 Gary Thomas (gdt at linuxppc.org) * Rewritten by Cort Dougan (cort at cs.nmt.edu) for PReP diff -r df46ccb05adf arch/powerpc/kernel/head_fsl_booke.S --- a/arch/powerpc/kernel/head_fsl_booke.S Fri Jan 20 09:49:15 2006 +++ b/arch/powerpc/kernel/head_fsl_booke.S Mon Jan 23 08:34:59 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/kernel/head_fsl_booke.S - * * Kernel execution entry point code. * * Copyright (c) 1995-1996 Gary Thomas diff -r df46ccb05adf arch/powerpc/kernel/iomap.c --- a/arch/powerpc/kernel/iomap.c Fri Jan 20 09:49:15 2006 +++ b/arch/powerpc/kernel/iomap.c Mon Jan 23 08:34:59 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc64/kernel/iomap.c - * * ppc64 "iomap" interface implementation. * * (C) Copyright 2004 Linus Torvalds diff -r df46ccb05adf arch/powerpc/kernel/iommu.c --- a/arch/powerpc/kernel/iommu.c Fri Jan 20 09:49:15 2006 +++ b/arch/powerpc/kernel/iommu.c Mon Jan 23 08:34:59 2006 @@ -1,5 +1,4 @@ /* - * arch/ppc64/kernel/iommu.c * Copyright (C) 2001 Mike Corrigan & Dave Engebretsen, IBM Corporation * * Rewrite, cleanup, new allocation schemes, virtual merging: diff -r df46ccb05adf arch/powerpc/kernel/irq.c --- a/arch/powerpc/kernel/irq.c Fri Jan 20 09:49:15 2006 +++ b/arch/powerpc/kernel/irq.c Mon Jan 23 08:34:59 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/kernel/irq.c - * * Derived from arch/i386/kernel/irq.c * Copyright (C) 1992 Linus Torvalds * Adapted from arch/i386 by Gary Thomas diff -r df46ccb05adf arch/powerpc/kernel/kprobes.c --- a/arch/powerpc/kernel/kprobes.c Fri Jan 20 09:49:15 2006 +++ b/arch/powerpc/kernel/kprobes.c Mon Jan 23 08:34:59 2006 @@ -1,6 +1,5 @@ /* * Kernel Probes (KProbes) - * arch/ppc64/kernel/kprobes.c * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff -r df46ccb05adf arch/powerpc/kernel/pci_iommu.c --- a/arch/powerpc/kernel/pci_iommu.c Fri Jan 20 09:49:15 2006 +++ b/arch/powerpc/kernel/pci_iommu.c Mon Jan 23 08:34:59 2006 @@ -1,5 +1,4 @@ /* - * arch/ppc64/kernel/pci_iommu.c * Copyright (C) 2001 Mike Corrigan & Dave Engebretsen, IBM Corporation * * Rewrite, cleanup, new allocation schemes: diff -r df46ccb05adf arch/powerpc/kernel/process.c --- a/arch/powerpc/kernel/process.c Fri Jan 20 09:49:15 2006 +++ b/arch/powerpc/kernel/process.c Mon Jan 23 08:34:59 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/kernel/process.c - * * Derived from "arch/i386/kernel/process.c" * Copyright (C) 1995 Linus Torvalds * diff -r df46ccb05adf arch/powerpc/kernel/ptrace-common.h --- a/arch/powerpc/kernel/ptrace-common.h Fri Jan 20 09:49:15 2006 +++ b/arch/powerpc/kernel/ptrace-common.h Mon Jan 23 08:34:59 2006 @@ -1,6 +1,4 @@ /* - * linux/arch/ppc64/kernel/ptrace-common.h - * * Copyright (c) 2002 Stephen Rothwell, IBM Coproration * Extracted from ptrace.c and ptrace32.c * diff -r df46ccb05adf arch/powerpc/kernel/rtas-proc.c --- a/arch/powerpc/kernel/rtas-proc.c Fri Jan 20 09:49:15 2006 +++ b/arch/powerpc/kernel/rtas-proc.c Mon Jan 23 08:34:59 2006 @@ -1,5 +1,4 @@ /* - * arch/ppc64/kernel/rtas-proc.c * Copyright (C) 2000 Tilmann Bitterberg * (tilmann at bitterberg.de) * diff -r df46ccb05adf arch/powerpc/kernel/rtas_pci.c --- a/arch/powerpc/kernel/rtas_pci.c Fri Jan 20 09:49:15 2006 +++ b/arch/powerpc/kernel/rtas_pci.c Mon Jan 23 08:34:59 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc64/kernel/rtas_pci.c - * * Copyright (C) 2001 Dave Engebretsen, IBM Corporation * Copyright (C) 2003 Anton Blanchard , IBM * diff -r df46ccb05adf arch/powerpc/kernel/signal_64.c --- a/arch/powerpc/kernel/signal_64.c Fri Jan 20 09:49:15 2006 +++ b/arch/powerpc/kernel/signal_64.c Mon Jan 23 08:34:59 2006 @@ -1,6 +1,4 @@ /* - * linux/arch/ppc64/kernel/signal.c - * * PowerPC version * Copyright (C) 1995-1996 Gary Thomas (gdt at linuxppc.org) * diff -r df46ccb05adf arch/powerpc/kernel/vdso.c --- a/arch/powerpc/kernel/vdso.c Fri Jan 20 09:49:15 2006 +++ b/arch/powerpc/kernel/vdso.c Mon Jan 23 08:34:59 2006 @@ -1,6 +1,4 @@ /* - * linux/arch/ppc64/kernel/vdso.c - * * Copyright (C) 2004 Benjamin Herrenschmidt, IBM Corp. * * diff -r df46ccb05adf arch/powerpc/lib/copypage_64.S --- a/arch/powerpc/lib/copypage_64.S Fri Jan 20 09:49:15 2006 +++ b/arch/powerpc/lib/copypage_64.S Mon Jan 23 08:34:59 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc64/lib/copypage.S - * * Copyright (C) 2002 Paul Mackerras, IBM Corp. * * This program is free software; you can redistribute it and/or diff -r df46ccb05adf arch/powerpc/lib/copyuser_64.S --- a/arch/powerpc/lib/copyuser_64.S Fri Jan 20 09:49:15 2006 +++ b/arch/powerpc/lib/copyuser_64.S Mon Jan 23 08:34:59 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc64/lib/copyuser.S - * * Copyright (C) 2002 Paul Mackerras, IBM Corp. * * This program is free software; you can redistribute it and/or diff -r df46ccb05adf arch/powerpc/lib/e2a.c --- a/arch/powerpc/lib/e2a.c Fri Jan 20 09:49:15 2006 +++ b/arch/powerpc/lib/e2a.c Mon Jan 23 08:34:59 2006 @@ -1,9 +1,7 @@ /* - * arch/ppc64/lib/e2a.c - * * EBCDIC to ASCII conversion * - * This function moved here from arch/ppc64/kernel/viopath.c + * This function moved here from arch/powerpc/platforms/iseries/viopath.c * * (C) Copyright 2000-2004 IBM Corporation * diff -r df46ccb05adf arch/powerpc/lib/memcpy_64.S --- a/arch/powerpc/lib/memcpy_64.S Fri Jan 20 09:49:15 2006 +++ b/arch/powerpc/lib/memcpy_64.S Mon Jan 23 08:34:59 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc64/lib/memcpy.S - * * Copyright (C) 2002 Paul Mackerras, IBM Corp. * * This program is free software; you can redistribute it and/or diff -r df46ccb05adf arch/powerpc/lib/rheap.c --- a/arch/powerpc/lib/rheap.c Fri Jan 20 09:49:15 2006 +++ b/arch/powerpc/lib/rheap.c Mon Jan 23 08:34:59 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/syslib/rheap.c - * * A Remote Heap. Remote means that we don't touch the memory that the * heap points to. Normal heap implementations use the memory they manage * to place their list. We cannot do that because the memory we manage may diff -r df46ccb05adf arch/powerpc/mm/fault.c --- a/arch/powerpc/mm/fault.c Fri Jan 20 09:49:15 2006 +++ b/arch/powerpc/mm/fault.c Mon Jan 23 08:34:59 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/mm/fault.c - * * PowerPC version * Copyright (C) 1995-1996 Gary Thomas (gdt at linuxppc.org) * diff -r df46ccb05adf arch/powerpc/mm/hash_low_32.S --- a/arch/powerpc/mm/hash_low_32.S Fri Jan 20 09:49:15 2006 +++ b/arch/powerpc/mm/hash_low_32.S Mon Jan 23 08:34:59 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/kernel/hashtable.S - * * $Id: hashtable.S,v 1.6 1999/10/08 01:56:15 paulus Exp $ * * PowerPC version diff -r df46ccb05adf arch/powerpc/mm/mmap.c --- a/arch/powerpc/mm/mmap.c Fri Jan 20 09:49:15 2006 +++ b/arch/powerpc/mm/mmap.c Mon Jan 23 08:34:59 2006 @@ -1,6 +1,4 @@ /* - * linux/arch/ppc64/mm/mmap.c - * * flexible mmap layout support * * Copyright 2003-2004 Red Hat Inc., Durham, North Carolina. diff -r df46ccb05adf arch/powerpc/mm/slb_low.S --- a/arch/powerpc/mm/slb_low.S Fri Jan 20 09:49:15 2006 +++ b/arch/powerpc/mm/slb_low.S Mon Jan 23 08:34:59 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc64/mm/slb_low.S - * * Low-level SLB routines * * Copyright (C) 2004 David Gibson , IBM diff -r df46ccb05adf arch/powerpc/mm/tlb_64.c --- a/arch/powerpc/mm/tlb_64.c Fri Jan 20 09:49:15 2006 +++ b/arch/powerpc/mm/tlb_64.c Mon Jan 23 08:34:59 2006 @@ -36,7 +36,7 @@ DEFINE_PER_CPU(struct ppc64_tlb_batch, ppc64_tlb_batch); /* This is declared as we are using the more or less generic - * include/asm-ppc64/tlb.h file -- tgall + * include/asm-powerpc/tlb.h file -- tgall */ DEFINE_PER_CPU(struct mmu_gather, mmu_gathers); DEFINE_PER_CPU(struct pte_freelist_batch *, pte_freelist_cur); diff -r df46ccb05adf arch/powerpc/platforms/chrp/pegasos_eth.c --- a/arch/powerpc/platforms/chrp/pegasos_eth.c Fri Jan 20 09:49:15 2006 +++ b/arch/powerpc/platforms/chrp/pegasos_eth.c Mon Jan 23 08:34:59 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/chrp_pegasos_eth.c - * * Copyright (C) 2005 Sven Luther * Thanks to : * Dale Farnsworth diff -r df46ccb05adf arch/powerpc/platforms/chrp/setup.c --- a/arch/powerpc/platforms/chrp/setup.c Fri Jan 20 09:49:15 2006 +++ b/arch/powerpc/platforms/chrp/setup.c Mon Jan 23 08:34:59 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/setup.c - * * Copyright (C) 1995 Linus Torvalds * Adapted from 'alpha' version by Gary Thomas * Modified by Cort Dougan (cort at cs.nmt.edu) diff -r df46ccb05adf arch/powerpc/platforms/chrp/time.c --- a/arch/powerpc/platforms/chrp/time.c Fri Jan 20 09:49:15 2006 +++ b/arch/powerpc/platforms/chrp/time.c Mon Jan 23 08:34:59 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/chrp_time.c - * * Copyright (C) 1991, 1992, 1995 Linus Torvalds * * Adapted for PowerPC (PReP) by Gary Thomas diff -r df46ccb05adf arch/powerpc/platforms/maple/time.c --- a/arch/powerpc/platforms/maple/time.c Fri Jan 20 09:49:15 2006 +++ b/arch/powerpc/platforms/maple/time.c Mon Jan 23 08:34:59 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc64/kernel/maple_time.c - * * (c) Copyright 2004 Benjamin Herrenschmidt (benh at kernel.crashing.org), * IBM Corp. * diff -r df46ccb05adf arch/powerpc/platforms/powermac/cpufreq_32.c --- a/arch/powerpc/platforms/powermac/cpufreq_32.c Fri Jan 20 09:49:15 2006 +++ b/arch/powerpc/platforms/powermac/cpufreq_32.c Mon Jan 23 08:34:59 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/pmac_cpufreq.c - * * Copyright (C) 2002 - 2005 Benjamin Herrenschmidt * Copyright (C) 2004 John Steele Scott * diff -r df46ccb05adf arch/powerpc/platforms/powermac/feature.c --- a/arch/powerpc/platforms/powermac/feature.c Fri Jan 20 09:49:15 2006 +++ b/arch/powerpc/platforms/powermac/feature.c Mon Jan 23 08:34:59 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/pmac_feature.c - * * Copyright (C) 1996-2001 Paul Mackerras (paulus at cs.anu.edu.au) * Ben. Herrenschmidt (benh at kernel.crashing.org) * diff -r df46ccb05adf arch/powerpc/platforms/powermac/nvram.c --- a/arch/powerpc/platforms/powermac/nvram.c Fri Jan 20 09:49:15 2006 +++ b/arch/powerpc/platforms/powermac/nvram.c Mon Jan 23 08:34:59 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/pmac_nvram.c - * * Copyright (C) 2002 Benjamin Herrenschmidt (benh at kernel.crashing.org) * * This program is free software; you can redistribute it and/or diff -r df46ccb05adf arch/powerpc/platforms/pseries/hvCall.S --- a/arch/powerpc/platforms/pseries/hvCall.S Fri Jan 20 09:49:15 2006 +++ b/arch/powerpc/platforms/pseries/hvCall.S Mon Jan 23 08:34:59 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc64/kernel/pSeries_hvCall.S - * * This file contains the generic code to perform a call to the * pSeries LPAR hypervisor. * NOTE: this file will go away when we move to inline this work. diff -r df46ccb05adf arch/powerpc/platforms/pseries/iommu.c --- a/arch/powerpc/platforms/pseries/iommu.c Fri Jan 20 09:49:15 2006 +++ b/arch/powerpc/platforms/pseries/iommu.c Mon Jan 23 08:34:59 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc64/kernel/pSeries_iommu.c - * * Copyright (C) 2001 Mike Corrigan & Dave Engebretsen, IBM Corporation * * Rewrite, cleanup: diff -r df46ccb05adf arch/powerpc/platforms/pseries/pci.c --- a/arch/powerpc/platforms/pseries/pci.c Fri Jan 20 09:49:15 2006 +++ b/arch/powerpc/platforms/pseries/pci.c Mon Jan 23 08:34:59 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc64/kernel/pSeries_pci.c - * * Copyright (C) 2001 Dave Engebretsen, IBM Corporation * Copyright (C) 2003 Anton Blanchard , IBM * diff -r df46ccb05adf arch/powerpc/sysdev/dcr.S --- a/arch/powerpc/sysdev/dcr.S Fri Jan 20 09:49:15 2006 +++ b/arch/powerpc/sysdev/dcr.S Mon Jan 23 08:34:59 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/syslib/dcr.S - * * "Indirect" DCR access * * Copyright (c) 2004 Eugene Surovegin diff -r df46ccb05adf arch/powerpc/sysdev/ipic.h --- a/arch/powerpc/sysdev/ipic.h Fri Jan 20 09:49:15 2006 +++ b/arch/powerpc/sysdev/ipic.h Mon Jan 23 08:34:59 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/kernel/ipic.h - * * IPIC private definitions and structure. * * Maintainer: Kumar Gala diff -r df46ccb05adf arch/ppc/4xx_io/serial_sicc.c --- a/arch/ppc/4xx_io/serial_sicc.c Fri Jan 20 09:49:15 2006 +++ b/arch/ppc/4xx_io/serial_sicc.c Mon Jan 23 08:34:59 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/4xx_io/serial_sicc.c - * * Driver for IBM STB3xxx SICC serial port * * Based on drivers/char/serial_amba.c, by ARM Ltd. diff -r df46ccb05adf arch/ppc/amiga/amiints.c --- a/arch/ppc/amiga/amiints.c Fri Jan 20 09:49:15 2006 +++ b/arch/ppc/amiga/amiints.c Mon Jan 23 08:34:59 2006 @@ -1,5 +1,5 @@ /* - * arch/ppc/amiga/amiints.c -- Amiga Linux interrupt handling code + * Amiga Linux interrupt handling code * * This file is subject to the terms and conditions of the GNU General Public * License. See the file COPYING in the main directory of this archive diff -r df46ccb05adf arch/ppc/amiga/bootinfo.c --- a/arch/ppc/amiga/bootinfo.c Fri Jan 20 09:49:15 2006 +++ b/arch/ppc/amiga/bootinfo.c Mon Jan 23 08:34:59 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/amiga/bootinfo.c - * * Extracted from arch/m68k/kernel/setup.c. * Should be properly generalized and put somewhere else. * Jesper diff -r df46ccb05adf arch/ppc/amiga/cia.c --- a/arch/ppc/amiga/cia.c Fri Jan 20 09:49:15 2006 +++ b/arch/ppc/amiga/cia.c Mon Jan 23 08:34:59 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/amiga/cia.c - CIA support - * * Copyright (C) 1996 Roman Zippel * * The concept of some functions bases on the original Amiga OS function diff -r df46ccb05adf arch/ppc/amiga/config.c --- a/arch/ppc/amiga/config.c Fri Jan 20 09:49:15 2006 +++ b/arch/ppc/amiga/config.c Mon Jan 23 08:34:59 2006 @@ -1,8 +1,6 @@ #define m68k_debug_device debug_device /* - * arch/ppc/amiga/config.c - * * Copyright (C) 1993 Hamish Macdonald * * This file is subject to the terms and conditions of the GNU General Public diff -r df46ccb05adf arch/ppc/amiga/ints.c --- a/arch/ppc/amiga/ints.c Fri Jan 20 09:49:15 2006 +++ b/arch/ppc/amiga/ints.c Mon Jan 23 08:34:59 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/amiga/ints.c - * * Linux/m68k general interrupt handling code from arch/m68k/kernel/ints.c * Needed to drive the m68k emulating IRQ hardware on the PowerUp boards. */ diff -r df46ccb05adf arch/ppc/boot/Makefile --- a/arch/ppc/boot/Makefile Fri Jan 20 09:49:15 2006 +++ b/arch/ppc/boot/Makefile Mon Jan 23 08:34:59 2006 @@ -1,6 +1,3 @@ -# -# arch/ppc/boot/Makefile -# # This file is subject to the terms and conditions of the GNU General Public # License. See the file "COPYING" in the main directory of this archive # for more details. diff -r df46ccb05adf arch/ppc/boot/common/Makefile --- a/arch/ppc/boot/common/Makefile Fri Jan 20 09:49:15 2006 +++ b/arch/ppc/boot/common/Makefile Mon Jan 23 08:34:59 2006 @@ -1,6 +1,3 @@ -# -# arch/ppc/boot/common/Makefile -# # This file is subject to the terms and conditions of the GNU General Public # License. See the file "COPYING" in the main directory of this archive # for more details. diff -r df46ccb05adf arch/ppc/boot/common/bootinfo.c --- a/arch/ppc/boot/common/bootinfo.c Fri Jan 20 09:49:15 2006 +++ b/arch/ppc/boot/common/bootinfo.c Mon Jan 23 08:34:59 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/common/bootinfo.c - * * General bootinfo record utilities * Author: Randy Vinson * diff -r df46ccb05adf arch/ppc/boot/common/misc-common.c --- a/arch/ppc/boot/common/misc-common.c Fri Jan 20 09:49:15 2006 +++ b/arch/ppc/boot/common/misc-common.c Mon Jan 23 08:34:59 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/boot/common/misc-common.c - * * Misc. bootloader code (almost) all platforms can use * * Author: Johnnie Peters diff -r df46ccb05adf arch/ppc/boot/common/serial_stub.c --- a/arch/ppc/boot/common/serial_stub.c Fri Jan 20 09:49:15 2006 +++ b/arch/ppc/boot/common/serial_stub.c Mon Jan 23 08:34:59 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/boot/common/serial_stub.c - * * This is a few stub routines to make the boot code cleaner looking when * there is no serial port support doesn't need to be closed, for example. * diff -r df46ccb05adf arch/ppc/boot/common/util.S --- a/arch/ppc/boot/common/util.S Fri Jan 20 09:49:15 2006 +++ b/arch/ppc/boot/common/util.S Mon Jan 23 08:34:59 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/boot/common/util.S - * * Useful bootup functions, which are more easily done in asm than C. * * NOTE: Be very very careful about the registers you use here. diff -r df46ccb05adf arch/ppc/boot/include/mpc10x.h --- a/arch/ppc/boot/include/mpc10x.h Fri Jan 20 09:49:15 2006 +++ b/arch/ppc/boot/include/mpc10x.h Mon Jan 23 08:34:59 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/boot/include/mpc10.h - * * Common defines for the Motorola SPS MPC106/8240/107 Host bridge/Mem * ctrl/EPIC/etc. * diff -r df46ccb05adf arch/ppc/boot/simple/cpc700_memory.c --- a/arch/ppc/boot/simple/cpc700_memory.c Fri Jan 20 09:49:15 2006 +++ b/arch/ppc/boot/simple/cpc700_memory.c Mon Jan 23 08:34:59 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/boot/common/cpc700_memory.c - * * Find memory based upon settings in the CPC700 bridge * * Author: Dan Cox diff -r df46ccb05adf arch/ppc/boot/simple/head.S --- a/arch/ppc/boot/simple/head.S Fri Jan 20 09:49:15 2006 +++ b/arch/ppc/boot/simple/head.S Mon Jan 23 08:34:59 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/boot/simple/head.S - * * Initial board bringup code for many different boards. * * Author: Tom Rini diff -r df46ccb05adf arch/ppc/boot/simple/misc-chestnut.c --- a/arch/ppc/boot/simple/misc-chestnut.c Fri Jan 20 09:49:15 2006 +++ b/arch/ppc/boot/simple/misc-chestnut.c Mon Jan 23 08:34:59 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/boot/simple/misc-chestnut.c - * * Setup for the IBM Chestnut (ibm-750fxgx_eval) * * Author: Mark A. Greer diff -r df46ccb05adf arch/ppc/boot/simple/misc-cpci690.c --- a/arch/ppc/boot/simple/misc-cpci690.c Fri Jan 20 09:49:15 2006 +++ b/arch/ppc/boot/simple/misc-cpci690.c Mon Jan 23 08:34:59 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/boot/simple/misc-cpci690.c - * * Add birec data for Force CPCI690 board. * * Author: Mark A. Greer diff -r df46ccb05adf arch/ppc/boot/simple/misc-ev64260.c --- a/arch/ppc/boot/simple/misc-ev64260.c Fri Jan 20 09:49:15 2006 +++ b/arch/ppc/boot/simple/misc-ev64260.c Mon Jan 23 08:34:59 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/boot/simple/misc-ev64260.c - * * Host bridge init code for the Marvell/Galileo EV-64260-BP evaluation board * with a GT64260 onboard. * diff -r df46ccb05adf arch/ppc/boot/simple/misc-ev64360.c --- a/arch/ppc/boot/simple/misc-ev64360.c Fri Jan 20 09:49:15 2006 +++ b/arch/ppc/boot/simple/misc-ev64360.c Mon Jan 23 08:34:59 2006 @@ -1,5 +1,4 @@ /* - * arch/ppc/boot/simple/misc-ev64360.c * Copyright (C) 2005 Lee Nicks * * Based on arch/ppc/boot/simple/misc-katana.c from: diff -r df46ccb05adf arch/ppc/boot/simple/misc-katana.c --- a/arch/ppc/boot/simple/misc-katana.c Fri Jan 20 09:49:15 2006 +++ b/arch/ppc/boot/simple/misc-katana.c Mon Jan 23 08:34:59 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/boot/simple/misc-katana.c - * * Set up MPSC values to bootwrapper can prompt user. * * Author: Mark A. Greer diff -r df46ccb05adf arch/ppc/boot/simple/misc-mv64x60.c --- a/arch/ppc/boot/simple/misc-mv64x60.c Fri Jan 20 09:49:15 2006 +++ b/arch/ppc/boot/simple/misc-mv64x60.c Mon Jan 23 08:34:59 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/boot/simple/misc-mv64x60.c - * * Relocate bridge's register base and call board specific routine. * * Author: Mark A. Greer diff -r df46ccb05adf arch/ppc/boot/simple/misc-prep.c --- a/arch/ppc/boot/simple/misc-prep.c Fri Jan 20 09:49:15 2006 +++ b/arch/ppc/boot/simple/misc-prep.c Mon Jan 23 08:34:59 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/boot/simple/misc-prep.c - * * Maintainer: Tom Rini * * In the past: Gary Thomas, Cort Dougan diff -r df46ccb05adf arch/ppc/boot/simple/misc-radstone_ppc7d.c --- a/arch/ppc/boot/simple/misc-radstone_ppc7d.c Fri Jan 20 09:49:15 2006 +++ b/arch/ppc/boot/simple/misc-radstone_ppc7d.c Mon Jan 23 08:34:59 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/boot/simple/misc-radstone_ppc7d.c - * * Misc data for Radstone PPC7D board. * * Author: James Chapman diff -r df46ccb05adf arch/ppc/boot/simple/misc-spruce.c --- a/arch/ppc/boot/simple/misc-spruce.c Fri Jan 20 09:49:15 2006 +++ b/arch/ppc/boot/simple/misc-spruce.c Mon Jan 23 08:34:59 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/boot/spruce/misc.c - * * Misc. bootloader code for IBM Spruce reference platform * * Authors: Johnnie Peters diff -r df46ccb05adf arch/ppc/boot/simple/misc.c --- a/arch/ppc/boot/simple/misc.c Fri Jan 20 09:49:15 2006 +++ b/arch/ppc/boot/simple/misc.c Mon Jan 23 08:34:59 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/simple/misc.c - * * Misc. bootloader code for many machines. This assumes you have are using * a 6xx/7xx/74xx CPU in your machine. This assumes the chunk of memory * below 8MB is free. Finally, it assumes you have a NS16550-style uart for diff -r df46ccb05adf arch/ppc/boot/simple/mpc10x_memory.c --- a/arch/ppc/boot/simple/mpc10x_memory.c Fri Jan 20 09:49:15 2006 +++ b/arch/ppc/boot/simple/mpc10x_memory.c Mon Jan 23 08:34:59 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/boot/common/mpc10x_common.c - * * A routine to find out how much memory the machine has. * * Based on: diff -r df46ccb05adf arch/ppc/boot/simple/mpc52xx_tty.c --- a/arch/ppc/boot/simple/mpc52xx_tty.c Fri Jan 20 09:49:15 2006 +++ b/arch/ppc/boot/simple/mpc52xx_tty.c Mon Jan 23 08:34:59 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/boot/simple/mpc52xx_tty.c - * * Minimal serial functions needed to send messages out a MPC52xx * Programmable Serial Controller (PSC). * diff -r df46ccb05adf arch/ppc/boot/simple/mv64x60_tty.c --- a/arch/ppc/boot/simple/mv64x60_tty.c Fri Jan 20 09:49:15 2006 +++ b/arch/ppc/boot/simple/mv64x60_tty.c Mon Jan 23 08:34:59 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/boot/simple/mv64x60_tty.c - * * Bootloader version of the embedded MPSC/UART driver for the Marvell 64x60. * Note: Due to a GT64260A erratum, DMA will be used for UART input (via SDMA). * diff -r df46ccb05adf arch/ppc/boot/simple/openbios.c --- a/arch/ppc/boot/simple/openbios.c Fri Jan 20 09:49:15 2006 +++ b/arch/ppc/boot/simple/openbios.c Mon Jan 23 08:34:59 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/boot/simple/openbios.c - * * Copyright (c) 2005 DENX Software Engineering * Stefan Roese * diff -r df46ccb05adf arch/ppc/boot/simple/relocate.S --- a/arch/ppc/boot/simple/relocate.S Fri Jan 20 09:49:15 2006 +++ b/arch/ppc/boot/simple/relocate.S Mon Jan 23 08:34:59 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/boot/simple/relocate.S - * * This is the common part of the loader relocation and initialization * process. All of the board/processor specific initialization is * done before we get here. diff -r df46ccb05adf arch/ppc/boot/utils/mkbugboot.c --- a/arch/ppc/boot/utils/mkbugboot.c Fri Jan 20 09:49:15 2006 +++ b/arch/ppc/boot/utils/mkbugboot.c Mon Jan 23 08:34:59 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/boot/utils/mkbugboot.c - * * Makes a Motorola PPCBUG ROM bootable image which can be flashed * into one of the FLASH banks on a Motorola PowerPlus board. * diff -r df46ccb05adf arch/ppc/kernel/head_44x.S --- a/arch/ppc/kernel/head_44x.S Fri Jan 20 09:49:15 2006 +++ b/arch/ppc/kernel/head_44x.S Mon Jan 23 08:34:59 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/kernel/head_44x.S - * * Kernel execution entry point code. * * Copyright (c) 1995-1996 Gary Thomas diff -r df46ccb05adf arch/ppc/kernel/head_8xx.S --- a/arch/ppc/kernel/head_8xx.S Fri Jan 20 09:49:15 2006 +++ b/arch/ppc/kernel/head_8xx.S Mon Jan 23 08:34:59 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/kernel/except_8xx.S - * * PowerPC version * Copyright (C) 1995-1996 Gary Thomas (gdt at linuxppc.org) * Rewritten by Cort Dougan (cort at cs.nmt.edu) for PReP diff -r df46ccb05adf arch/ppc/kernel/head_fsl_booke.S --- a/arch/ppc/kernel/head_fsl_booke.S Fri Jan 20 09:49:15 2006 +++ b/arch/ppc/kernel/head_fsl_booke.S Mon Jan 23 08:34:59 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/kernel/head_fsl_booke.S - * * Kernel execution entry point code. * * Copyright (c) 1995-1996 Gary Thomas diff -r df46ccb05adf arch/ppc/kernel/traps.c --- a/arch/ppc/kernel/traps.c Fri Jan 20 09:49:15 2006 +++ b/arch/ppc/kernel/traps.c Mon Jan 23 08:34:59 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/kernel/traps.c - * * Copyright (C) 1995-1996 Gary Thomas (gdt at linuxppc.org) * * This program is free software; you can redistribute it and/or diff -r df46ccb05adf arch/ppc/lib/rheap.c --- a/arch/ppc/lib/rheap.c Fri Jan 20 09:49:15 2006 +++ b/arch/ppc/lib/rheap.c Mon Jan 23 08:34:59 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/syslib/rheap.c - * * A Remote Heap. Remote means that we don't touch the memory that the * heap points to. Normal heap implementations use the memory they manage * to place their list. We cannot do that because the memory we manage may diff -r df46ccb05adf arch/ppc/math-emu/math.c --- a/arch/ppc/math-emu/math.c Fri Jan 20 09:49:15 2006 +++ b/arch/ppc/math-emu/math.c Mon Jan 23 08:34:59 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/math-emu/math.c - * * Copyright (C) 1999 Eddie C. Dost (ecd at atecom.com) */ diff -r df46ccb05adf arch/ppc/mm/fault.c --- a/arch/ppc/mm/fault.c Fri Jan 20 09:49:15 2006 +++ b/arch/ppc/mm/fault.c Mon Jan 23 08:34:59 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/mm/fault.c - * * PowerPC version * Copyright (C) 1995-1996 Gary Thomas (gdt at linuxppc.org) * diff -r df46ccb05adf arch/ppc/mm/hashtable.S --- a/arch/ppc/mm/hashtable.S Fri Jan 20 09:49:15 2006 +++ b/arch/ppc/mm/hashtable.S Mon Jan 23 08:34:59 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/kernel/hashtable.S - * * $Id: hashtable.S,v 1.6 1999/10/08 01:56:15 paulus Exp $ * * PowerPC version diff -r df46ccb05adf arch/ppc/platforms/4xx/bamboo.c --- a/arch/ppc/platforms/4xx/bamboo.c Fri Jan 20 09:49:15 2006 +++ b/arch/ppc/platforms/4xx/bamboo.c Mon Jan 23 08:34:59 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/4xx/bamboo.c - * * Bamboo board specific routines * * Wade Farnsworth diff -r df46ccb05adf arch/ppc/platforms/4xx/bamboo.h --- a/arch/ppc/platforms/4xx/bamboo.h Fri Jan 20 09:49:15 2006 +++ b/arch/ppc/platforms/4xx/bamboo.h Mon Jan 23 08:34:59 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/bamboo.h - * * Bamboo board definitions * * Wade Farnsworth diff -r df46ccb05adf arch/ppc/platforms/4xx/bubinga.h --- a/arch/ppc/platforms/4xx/bubinga.h Fri Jan 20 09:49:15 2006 +++ b/arch/ppc/platforms/4xx/bubinga.h Mon Jan 23 08:34:59 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/4xx/bubinga.h - * * Bubinga board definitions * * Copyright (c) 2005 DENX Software Engineering diff -r df46ccb05adf arch/ppc/platforms/4xx/cpci405.c --- a/arch/ppc/platforms/4xx/cpci405.c Fri Jan 20 09:49:15 2006 +++ b/arch/ppc/platforms/4xx/cpci405.c Mon Jan 23 08:34:59 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/cpci405.c - * * Board setup routines for the esd CPCI-405 cPCI Board. * * Author: Stefan Roese diff -r df46ccb05adf arch/ppc/platforms/4xx/ebony.c --- a/arch/ppc/platforms/4xx/ebony.c Fri Jan 20 09:49:15 2006 +++ b/arch/ppc/platforms/4xx/ebony.c Mon Jan 23 08:34:59 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/4xx/ebony.c - * * Ebony board specific routines * * Matt Porter diff -r df46ccb05adf arch/ppc/platforms/4xx/ebony.h --- a/arch/ppc/platforms/4xx/ebony.h Fri Jan 20 09:49:15 2006 +++ b/arch/ppc/platforms/4xx/ebony.h Mon Jan 23 08:34:59 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/ebony.h - * * Ebony board definitions * * Matt Porter diff -r df46ccb05adf arch/ppc/platforms/4xx/ep405.c --- a/arch/ppc/platforms/4xx/ep405.c Fri Jan 20 09:49:15 2006 +++ b/arch/ppc/platforms/4xx/ep405.c Mon Jan 23 08:34:59 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/4xx/ep405.c - * * Embedded Planet 405GP board * http://www.embeddedplanet.com * diff -r df46ccb05adf arch/ppc/platforms/4xx/ep405.h --- a/arch/ppc/platforms/4xx/ep405.h Fri Jan 20 09:49:15 2006 +++ b/arch/ppc/platforms/4xx/ep405.h Mon Jan 23 08:34:59 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/4xx/ep405.h - * * Embedded Planet 405GP board * http://www.embeddedplanet.com * diff -r df46ccb05adf arch/ppc/platforms/4xx/ibm405ep.c --- a/arch/ppc/platforms/4xx/ibm405ep.c Fri Jan 20 09:49:15 2006 +++ b/arch/ppc/platforms/4xx/ibm405ep.c Mon Jan 23 08:34:59 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/ibm405ep.c - * * Support for IBM PPC 405EP processors. * * Author: SAW (IBM), derived from ibmnp405l.c. diff -r df46ccb05adf arch/ppc/platforms/4xx/ibm405ep.h --- a/arch/ppc/platforms/4xx/ibm405ep.h Fri Jan 20 09:49:15 2006 +++ b/arch/ppc/platforms/4xx/ibm405ep.h Mon Jan 23 08:34:59 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/4xx/ibm405ep.h - * * IBM PPC 405EP processor defines. * * Author: SAW (IBM), derived from ibm405gp.h. diff -r df46ccb05adf arch/ppc/platforms/4xx/ibm405gp.h --- a/arch/ppc/platforms/4xx/ibm405gp.h Fri Jan 20 09:49:15 2006 +++ b/arch/ppc/platforms/4xx/ibm405gp.h Mon Jan 23 08:34:59 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/4xx/ibm405gp.h - * * Author: Armin Kuster akuster at mvista.com * * 2001 (c) MontaVista, Software, Inc. This file is licensed under diff -r df46ccb05adf arch/ppc/platforms/4xx/ibm405gpr.c --- a/arch/ppc/platforms/4xx/ibm405gpr.c Fri Jan 20 09:49:15 2006 +++ b/arch/ppc/platforms/4xx/ibm405gpr.c Mon Jan 23 08:34:59 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/4xx/ibm405gpr.c - * * Author: Armin Kuster * * 2002 (c) MontaVista, Software, Inc. This file is licensed under diff -r df46ccb05adf arch/ppc/platforms/4xx/ibm405gpr.h --- a/arch/ppc/platforms/4xx/ibm405gpr.h Fri Jan 20 09:49:15 2006 +++ b/arch/ppc/platforms/4xx/ibm405gpr.h Mon Jan 23 08:34:59 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/4xx/ibm405gpr.h - * * Author: Armin Kuster * * 2002 (c) MontaVista, Software, Inc. This file is licensed under diff -r df46ccb05adf arch/ppc/platforms/4xx/ibm440ep.c --- a/arch/ppc/platforms/4xx/ibm440ep.c Fri Jan 20 09:49:15 2006 +++ b/arch/ppc/platforms/4xx/ibm440ep.c Mon Jan 23 08:34:59 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/4xx/ibm440ep.c - * * PPC440EP I/O descriptions * * Wade Farnsworth diff -r df46ccb05adf arch/ppc/platforms/4xx/ibm440ep.h --- a/arch/ppc/platforms/4xx/ibm440ep.h Fri Jan 20 09:49:15 2006 +++ b/arch/ppc/platforms/4xx/ibm440ep.h Mon Jan 23 08:34:59 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/4xx/ibm440ep.h - * * PPC440EP definitions * * Wade Farnsworth diff -r df46ccb05adf arch/ppc/platforms/4xx/ibm440gp.c --- a/arch/ppc/platforms/4xx/ibm440gp.c Fri Jan 20 09:49:15 2006 +++ b/arch/ppc/platforms/4xx/ibm440gp.c Mon Jan 23 08:34:59 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/4xx/ibm440gp.c - * * PPC440GP I/O descriptions * * Matt Porter diff -r df46ccb05adf arch/ppc/platforms/4xx/ibm440gp.h --- a/arch/ppc/platforms/4xx/ibm440gp.h Fri Jan 20 09:49:15 2006 +++ b/arch/ppc/platforms/4xx/ibm440gp.h Mon Jan 23 08:34:59 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/4xx/ibm440gp.h - * * PPC440GP definitions * * Roland Dreier diff -r df46ccb05adf arch/ppc/platforms/4xx/ibm440gx.c --- a/arch/ppc/platforms/4xx/ibm440gx.c Fri Jan 20 09:49:15 2006 +++ b/arch/ppc/platforms/4xx/ibm440gx.c Mon Jan 23 08:34:59 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/4xx/ibm440gx.c - * * PPC440GX I/O descriptions * * Matt Porter diff -r df46ccb05adf arch/ppc/platforms/4xx/ibm440gx.h --- a/arch/ppc/platforms/4xx/ibm440gx.h Fri Jan 20 09:49:15 2006 +++ b/arch/ppc/platforms/4xx/ibm440gx.h Mon Jan 23 08:34:59 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/ibm440gx.h - * * PPC440GX definitions * * Matt Porter diff -r df46ccb05adf arch/ppc/platforms/4xx/ibm440sp.c --- a/arch/ppc/platforms/4xx/ibm440sp.c Fri Jan 20 09:49:15 2006 +++ b/arch/ppc/platforms/4xx/ibm440sp.c Mon Jan 23 08:34:59 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/4xx/ibm440sp.c - * * PPC440SP I/O descriptions * * Matt Porter diff -r df46ccb05adf arch/ppc/platforms/4xx/ibm440sp.h --- a/arch/ppc/platforms/4xx/ibm440sp.h Fri Jan 20 09:49:15 2006 +++ b/arch/ppc/platforms/4xx/ibm440sp.h Mon Jan 23 08:34:59 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/4xx/ibm440sp.h - * * PPC440SP definitions * * Matt Porter diff -r df46ccb05adf arch/ppc/platforms/4xx/ibmnp405h.c --- a/arch/ppc/platforms/4xx/ibmnp405h.c Fri Jan 20 09:49:15 2006 +++ b/arch/ppc/platforms/4xx/ibmnp405h.c Mon Jan 23 08:34:59 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/4xx/ibmnp405h.c - * * Author: Armin Kuster * * 2000-2002 (c) MontaVista, Software, Inc. This file is licensed under diff -r df46ccb05adf arch/ppc/platforms/4xx/ibmnp405h.h --- a/arch/ppc/platforms/4xx/ibmnp405h.h Fri Jan 20 09:49:15 2006 +++ b/arch/ppc/platforms/4xx/ibmnp405h.h Mon Jan 23 08:34:59 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/4xx/ibmnp405h.h - * * Author: Armin Kuster * * 2002 (c) MontaVista, Software, Inc. This file is licensed under diff -r df46ccb05adf arch/ppc/platforms/4xx/ibmstb4.c --- a/arch/ppc/platforms/4xx/ibmstb4.c Fri Jan 20 09:49:15 2006 +++ b/arch/ppc/platforms/4xx/ibmstb4.c Mon Jan 23 08:34:59 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/4xx/ibmstb4.c - * * Author: Armin Kuster * * 2000-2001 (c) MontaVista, Software, Inc. This file is licensed under diff -r df46ccb05adf arch/ppc/platforms/4xx/ibmstb4.h --- a/arch/ppc/platforms/4xx/ibmstb4.h Fri Jan 20 09:49:15 2006 +++ b/arch/ppc/platforms/4xx/ibmstb4.h Mon Jan 23 08:34:59 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/4xx/ibmstb4.h - * * Author: Armin Kuster * * 2001 (c) MontaVista, Software, Inc. This file is licensed under diff -r df46ccb05adf arch/ppc/platforms/4xx/ibmstbx25.c --- a/arch/ppc/platforms/4xx/ibmstbx25.c Fri Jan 20 09:49:15 2006 +++ b/arch/ppc/platforms/4xx/ibmstbx25.c Mon Jan 23 08:34:59 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/4xx/ibmstbx25.c - * * Author: Armin Kuster * * 2000-2002 (c) MontaVista, Software, Inc. This file is licensed under diff -r df46ccb05adf arch/ppc/platforms/4xx/ibmstbx25.h --- a/arch/ppc/platforms/4xx/ibmstbx25.h Fri Jan 20 09:49:15 2006 +++ b/arch/ppc/platforms/4xx/ibmstbx25.h Mon Jan 23 08:34:59 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/4xx/ibmstbx25.h - * * Author: Armin Kuster * * 2002 (c) MontaVista, Software, Inc. This file is licensed under diff -r df46ccb05adf arch/ppc/platforms/4xx/luan.c --- a/arch/ppc/platforms/4xx/luan.c Fri Jan 20 09:49:15 2006 +++ b/arch/ppc/platforms/4xx/luan.c Mon Jan 23 08:34:59 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/4xx/luan.c - * * Luan board specific routines * * Matt Porter diff -r df46ccb05adf arch/ppc/platforms/4xx/luan.h --- a/arch/ppc/platforms/4xx/luan.h Fri Jan 20 09:49:15 2006 +++ b/arch/ppc/platforms/4xx/luan.h Mon Jan 23 08:34:59 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/4xx/luan.h - * * Luan board definitions * * Matt Porter diff -r df46ccb05adf arch/ppc/platforms/4xx/ocotea.c --- a/arch/ppc/platforms/4xx/ocotea.c Fri Jan 20 09:49:15 2006 +++ b/arch/ppc/platforms/4xx/ocotea.c Mon Jan 23 08:34:59 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/4xx/ocotea.c - * * Ocotea board specific routines * * Matt Porter diff -r df46ccb05adf arch/ppc/platforms/4xx/ocotea.h --- a/arch/ppc/platforms/4xx/ocotea.h Fri Jan 20 09:49:15 2006 +++ b/arch/ppc/platforms/4xx/ocotea.h Mon Jan 23 08:34:59 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/ocotea.h - * * Ocotea board definitions * * Matt Porter diff -r df46ccb05adf arch/ppc/platforms/4xx/ppc440spe.c --- a/arch/ppc/platforms/4xx/ppc440spe.c Fri Jan 20 09:49:15 2006 +++ b/arch/ppc/platforms/4xx/ppc440spe.c Mon Jan 23 08:34:59 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/4xx/ppc440spe.c - * * PPC440SPe I/O descriptions * * Roland Dreier diff -r df46ccb05adf arch/ppc/platforms/4xx/ppc440spe.h --- a/arch/ppc/platforms/4xx/ppc440spe.h Fri Jan 20 09:49:15 2006 +++ b/arch/ppc/platforms/4xx/ppc440spe.h Mon Jan 23 08:34:59 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/4xx/ibm440spe.h - * * PPC440SPe definitions * * Roland Dreier diff -r df46ccb05adf arch/ppc/platforms/4xx/redwood5.c --- a/arch/ppc/platforms/4xx/redwood5.c Fri Jan 20 09:49:15 2006 +++ b/arch/ppc/platforms/4xx/redwood5.c Mon Jan 23 08:34:59 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/4xx/redwood5.c - * * Support for the IBM redwood5 eval board file * * Author: Armin Kuster diff -r df46ccb05adf arch/ppc/platforms/4xx/redwood5.h --- a/arch/ppc/platforms/4xx/redwood5.h Fri Jan 20 09:49:15 2006 +++ b/arch/ppc/platforms/4xx/redwood5.h Mon Jan 23 08:34:59 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/4xx/redwood5.h - * * Macros, definitions, and data structures specific to the IBM PowerPC * STB03xxx "Redwood" evaluation board. * diff -r df46ccb05adf arch/ppc/platforms/4xx/redwood6.c --- a/arch/ppc/platforms/4xx/redwood6.c Fri Jan 20 09:49:15 2006 +++ b/arch/ppc/platforms/4xx/redwood6.c Mon Jan 23 08:34:59 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/4xx/redwood6.c - * * Author: Armin Kuster * * 2002 (c) MontaVista, Software, Inc. This file is licensed under diff -r df46ccb05adf arch/ppc/platforms/4xx/redwood6.h --- a/arch/ppc/platforms/4xx/redwood6.h Fri Jan 20 09:49:15 2006 +++ b/arch/ppc/platforms/4xx/redwood6.h Mon Jan 23 08:34:59 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/4xx/redwood6.h - * * Macros, definitions, and data structures specific to the IBM PowerPC * STBx25xx "Redwood6" evaluation board. * diff -r df46ccb05adf arch/ppc/platforms/4xx/sycamore.c --- a/arch/ppc/platforms/4xx/sycamore.c Fri Jan 20 09:49:15 2006 +++ b/arch/ppc/platforms/4xx/sycamore.c Mon Jan 23 08:34:59 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/4xx/sycamore.c - * * Architecture- / platform-specific boot-time initialization code for * IBM PowerPC 4xx based boards. * diff -r df46ccb05adf arch/ppc/platforms/4xx/sycamore.h --- a/arch/ppc/platforms/4xx/sycamore.h Fri Jan 20 09:49:15 2006 +++ b/arch/ppc/platforms/4xx/sycamore.h Mon Jan 23 08:34:59 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/4xx/sycamore.h - * * Sycamore board definitions * * Copyright (c) 2005 DENX Software Engineering diff -r df46ccb05adf arch/ppc/platforms/4xx/virtex-ii_pro.c --- a/arch/ppc/platforms/4xx/virtex-ii_pro.c Fri Jan 20 09:49:15 2006 +++ b/arch/ppc/platforms/4xx/virtex-ii_pro.c Mon Jan 23 08:34:59 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/4xx/virtex-ii_pro.c - * * Author: MontaVista Software, Inc. * source at mvista.com * diff -r df46ccb05adf arch/ppc/platforms/4xx/virtex-ii_pro.h --- a/arch/ppc/platforms/4xx/virtex-ii_pro.h Fri Jan 20 09:49:15 2006 +++ b/arch/ppc/platforms/4xx/virtex-ii_pro.h Mon Jan 23 08:34:59 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/4xx/virtex-ii_pro.h - * * Include file that defines the Xilinx Virtex-II Pro processor * * Author: MontaVista Software, Inc. diff -r df46ccb05adf arch/ppc/platforms/4xx/walnut.c --- a/arch/ppc/platforms/4xx/walnut.c Fri Jan 20 09:49:15 2006 +++ b/arch/ppc/platforms/4xx/walnut.c Mon Jan 23 08:34:59 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/4xx/walnut.c - * * Architecture- / platform-specific boot-time initialization code for * IBM PowerPC 4xx based boards. Adapted from original * code by Gary Thomas, Cort Dougan , and Dan Malek diff -r df46ccb05adf arch/ppc/platforms/4xx/walnut.h --- a/arch/ppc/platforms/4xx/walnut.h Fri Jan 20 09:49:15 2006 +++ b/arch/ppc/platforms/4xx/walnut.h Mon Jan 23 08:34:59 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/4xx/walnut.h - * * Walnut board definitions * * Copyright (c) 2005 DENX Software Engineering diff -r df46ccb05adf arch/ppc/platforms/4xx/xilinx_ml300.c --- a/arch/ppc/platforms/4xx/xilinx_ml300.c Fri Jan 20 09:49:15 2006 +++ b/arch/ppc/platforms/4xx/xilinx_ml300.c Mon Jan 23 08:34:59 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/4xx/xilinx_ml300.c - * * Xilinx ML300 evaluation board initialization * * Author: MontaVista Software, Inc. diff -r df46ccb05adf arch/ppc/platforms/4xx/xilinx_ml300.h --- a/arch/ppc/platforms/4xx/xilinx_ml300.h Fri Jan 20 09:49:15 2006 +++ b/arch/ppc/platforms/4xx/xilinx_ml300.h Mon Jan 23 08:34:59 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/4xx/xilinx_ml300.h - * * Include file that defines the Xilinx ML300 evaluation board * * Author: MontaVista Software, Inc. diff -r df46ccb05adf arch/ppc/platforms/4xx/yucca.c --- a/arch/ppc/platforms/4xx/yucca.c Fri Jan 20 09:49:15 2006 +++ b/arch/ppc/platforms/4xx/yucca.c Mon Jan 23 08:34:59 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/4xx/yucca.c - * * Yucca board specific routines * * Roland Dreier (based on luan.c by Matt Porter) diff -r df46ccb05adf arch/ppc/platforms/4xx/yucca.h --- a/arch/ppc/platforms/4xx/yucca.h Fri Jan 20 09:49:15 2006 +++ b/arch/ppc/platforms/4xx/yucca.h Mon Jan 23 08:34:59 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/4xx/yucca.h - * * Yucca board definitions * * Roland Dreier (based on luan.h by Matt Porter) diff -r df46ccb05adf arch/ppc/platforms/83xx/mpc834x_sys.c --- a/arch/ppc/platforms/83xx/mpc834x_sys.c Fri Jan 20 09:49:15 2006 +++ b/arch/ppc/platforms/83xx/mpc834x_sys.c Mon Jan 23 08:34:59 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/83xx/mpc834x_sys.c - * * MPC834x SYS board specific routines * * Maintainer: Kumar Gala diff -r df46ccb05adf arch/ppc/platforms/83xx/mpc834x_sys.h --- a/arch/ppc/platforms/83xx/mpc834x_sys.h Fri Jan 20 09:49:15 2006 +++ b/arch/ppc/platforms/83xx/mpc834x_sys.h Mon Jan 23 08:34:59 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/83xx/mpc834x_sys.h - * * MPC834X SYS common board definitions * * Maintainer: Kumar Gala diff -r df46ccb05adf arch/ppc/platforms/85xx/mpc8540_ads.c --- a/arch/ppc/platforms/85xx/mpc8540_ads.c Fri Jan 20 09:49:15 2006 +++ b/arch/ppc/platforms/85xx/mpc8540_ads.c Mon Jan 23 08:34:59 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/85xx/mpc8540_ads.c - * * MPC8540ADS board specific routines * * Maintainer: Kumar Gala diff -r df46ccb05adf arch/ppc/platforms/85xx/mpc8540_ads.h --- a/arch/ppc/platforms/85xx/mpc8540_ads.h Fri Jan 20 09:49:15 2006 +++ b/arch/ppc/platforms/85xx/mpc8540_ads.h Mon Jan 23 08:34:59 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/85xx/mpc8540_ads.h - * * MPC8540ADS board definitions * * Maintainer: Kumar Gala diff -r df46ccb05adf arch/ppc/platforms/85xx/mpc8555_cds.h --- a/arch/ppc/platforms/85xx/mpc8555_cds.h Fri Jan 20 09:49:15 2006 +++ b/arch/ppc/platforms/85xx/mpc8555_cds.h Mon Jan 23 08:34:59 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/mpc8555_cds.h - * * MPC8555CDS board definitions * * Maintainer: Kumar Gala diff -r df46ccb05adf arch/ppc/platforms/85xx/mpc8560_ads.c --- a/arch/ppc/platforms/85xx/mpc8560_ads.c Fri Jan 20 09:49:15 2006 +++ b/arch/ppc/platforms/85xx/mpc8560_ads.c Mon Jan 23 08:34:59 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/85xx/mpc8560_ads.c - * * MPC8560ADS board specific routines * * Maintainer: Kumar Gala diff -r df46ccb05adf arch/ppc/platforms/85xx/mpc8560_ads.h --- a/arch/ppc/platforms/85xx/mpc8560_ads.h Fri Jan 20 09:49:15 2006 +++ b/arch/ppc/platforms/85xx/mpc8560_ads.h Mon Jan 23 08:34:59 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/mpc8560_ads.h - * * MPC8540ADS board definitions * * Maintainer: Kumar Gala diff -r df46ccb05adf arch/ppc/platforms/85xx/mpc85xx_ads_common.c --- a/arch/ppc/platforms/85xx/mpc85xx_ads_common.c Fri Jan 20 09:49:15 2006 +++ b/arch/ppc/platforms/85xx/mpc85xx_ads_common.c Mon Jan 23 08:34:59 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/85xx/mpc85xx_ads_common.c - * * MPC85xx ADS board common routines * * Maintainer: Kumar Gala diff -r df46ccb05adf arch/ppc/platforms/85xx/mpc85xx_ads_common.h --- a/arch/ppc/platforms/85xx/mpc85xx_ads_common.h Fri Jan 20 09:49:15 2006 +++ b/arch/ppc/platforms/85xx/mpc85xx_ads_common.h Mon Jan 23 08:34:59 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/85xx/mpc85xx_ads_common.h - * * MPC85XX ADS common board definitions * * Maintainer: Kumar Gala diff -r df46ccb05adf arch/ppc/platforms/85xx/mpc85xx_cds_common.c --- a/arch/ppc/platforms/85xx/mpc85xx_cds_common.c Fri Jan 20 09:49:15 2006 +++ b/arch/ppc/platforms/85xx/mpc85xx_cds_common.c Mon Jan 23 08:34:59 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platform/85xx/mpc85xx_cds_common.c - * * MPC85xx CDS board specific routines * * Maintainer: Kumar Gala diff -r df46ccb05adf arch/ppc/platforms/85xx/mpc85xx_cds_common.h --- a/arch/ppc/platforms/85xx/mpc85xx_cds_common.h Fri Jan 20 09:49:15 2006 +++ b/arch/ppc/platforms/85xx/mpc85xx_cds_common.h Mon Jan 23 08:34:59 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/85xx/mpc85xx_cds_common.h - * * MPC85xx CDS board definitions * * Maintainer: Kumar Gala diff -r df46ccb05adf arch/ppc/platforms/85xx/sbc8560.c --- a/arch/ppc/platforms/85xx/sbc8560.c Fri Jan 20 09:49:15 2006 +++ b/arch/ppc/platforms/85xx/sbc8560.c Mon Jan 23 08:34:59 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/85xx/sbc8560.c - * * Wind River SBC8560 board specific routines * * Maintainer: Kumar Gala diff -r df46ccb05adf arch/ppc/platforms/85xx/sbc8560.h --- a/arch/ppc/platforms/85xx/sbc8560.h Fri Jan 20 09:49:15 2006 +++ b/arch/ppc/platforms/85xx/sbc8560.h Mon Jan 23 08:34:59 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/85xx/sbc8560.h - * * Wind River SBC8560 board definitions * * Copyright 2003 Motorola Inc. diff -r df46ccb05adf arch/ppc/platforms/85xx/sbc85xx.c --- a/arch/ppc/platforms/85xx/sbc85xx.c Fri Jan 20 09:49:15 2006 +++ b/arch/ppc/platforms/85xx/sbc85xx.c Mon Jan 23 08:34:59 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platform/85xx/sbc85xx.c - * * WindRiver PowerQUICC III SBC85xx board common routines * * Copyright 2002, 2003 Motorola Inc. diff -r df46ccb05adf arch/ppc/platforms/85xx/sbc85xx.h --- a/arch/ppc/platforms/85xx/sbc85xx.h Fri Jan 20 09:49:15 2006 +++ b/arch/ppc/platforms/85xx/sbc85xx.h Mon Jan 23 08:34:59 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/85xx/sbc85xx.h - * * WindRiver PowerQUICC III SBC85xx common board definitions * * Copyright 2003 Motorola Inc. diff -r df46ccb05adf arch/ppc/platforms/85xx/stx_gp3.c --- a/arch/ppc/platforms/85xx/stx_gp3.c Fri Jan 20 09:49:15 2006 +++ b/arch/ppc/platforms/85xx/stx_gp3.c Mon Jan 23 08:34:59 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/85xx/stx_gp3.c - * * STx GP3 board specific routines * * Dan Malek diff -r df46ccb05adf arch/ppc/platforms/85xx/stx_gp3.h --- a/arch/ppc/platforms/85xx/stx_gp3.h Fri Jan 20 09:49:15 2006 +++ b/arch/ppc/platforms/85xx/stx_gp3.h Mon Jan 23 08:34:59 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/stx8560_gp3.h - * * STx GP3 board definitions * * Dan Malek (dan at embeddededge.com) diff -r df46ccb05adf arch/ppc/platforms/85xx/tqm85xx.c --- a/arch/ppc/platforms/85xx/tqm85xx.c Fri Jan 20 09:49:15 2006 +++ b/arch/ppc/platforms/85xx/tqm85xx.c Mon Jan 23 08:34:59 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/85xx/tqm85xx.c - * * TQM85xx (40/41/55/60) board specific routines * * Copyright (c) 2005 DENX Software Engineering diff -r df46ccb05adf arch/ppc/platforms/85xx/tqm85xx.h --- a/arch/ppc/platforms/85xx/tqm85xx.h Fri Jan 20 09:49:15 2006 +++ b/arch/ppc/platforms/85xx/tqm85xx.h Mon Jan 23 08:34:59 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/85xx/tqm85xx.h - * * TQM85xx (40/41/55/60) board definitions * * Copyright (c) 2005 DENX Software Engineering diff -r df46ccb05adf arch/ppc/platforms/apus_setup.c --- a/arch/ppc/platforms/apus_setup.c Fri Jan 20 09:49:15 2006 +++ b/arch/ppc/platforms/apus_setup.c Mon Jan 23 08:34:59 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/apus_setup.c - * * Copyright (C) 1998, 1999 Jesper Skov * * Basically what is needed to replace functionality found in diff -r df46ccb05adf arch/ppc/platforms/chestnut.c --- a/arch/ppc/platforms/chestnut.c Fri Jan 20 09:49:15 2006 +++ b/arch/ppc/platforms/chestnut.c Mon Jan 23 08:34:59 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/chestnut.c - * * Board setup routines for IBM Chestnut * * Author: diff -r df46ccb05adf arch/ppc/platforms/chestnut.h --- a/arch/ppc/platforms/chestnut.h Fri Jan 20 09:49:15 2006 +++ b/arch/ppc/platforms/chestnut.h Mon Jan 23 08:34:59 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/chestnut.h - * * Definitions for IBM 750FXGX Eval (Chestnut) * * Author: diff -r df46ccb05adf arch/ppc/platforms/chrp_pegasos_eth.c --- a/arch/ppc/platforms/chrp_pegasos_eth.c Fri Jan 20 09:49:15 2006 +++ b/arch/ppc/platforms/chrp_pegasos_eth.c Mon Jan 23 08:34:59 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/chrp_pegasos_eth.c - * * Copyright (C) 2005 Sven Luther * Thanks to : * Dale Farnsworth diff -r df46ccb05adf arch/ppc/platforms/chrp_setup.c --- a/arch/ppc/platforms/chrp_setup.c Fri Jan 20 09:49:15 2006 +++ b/arch/ppc/platforms/chrp_setup.c Mon Jan 23 08:34:59 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/setup.c - * * Copyright (C) 1995 Linus Torvalds * Adapted from 'alpha' version by Gary Thomas * Modified by Cort Dougan (cort at cs.nmt.edu) diff -r df46ccb05adf arch/ppc/platforms/chrp_time.c --- a/arch/ppc/platforms/chrp_time.c Fri Jan 20 09:49:15 2006 +++ b/arch/ppc/platforms/chrp_time.c Mon Jan 23 08:34:59 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/chrp_time.c - * * Copyright (C) 1991, 1992, 1995 Linus Torvalds * * Adapted for PowerPC (PReP) by Gary Thomas diff -r df46ccb05adf arch/ppc/platforms/cpci690.c --- a/arch/ppc/platforms/cpci690.c Fri Jan 20 09:49:15 2006 +++ b/arch/ppc/platforms/cpci690.c Mon Jan 23 08:34:59 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/cpci690.c - * * Board setup routines for the Force CPCI690 board. * * Author: Mark A. Greer diff -r df46ccb05adf arch/ppc/platforms/cpci690.h --- a/arch/ppc/platforms/cpci690.h Fri Jan 20 09:49:15 2006 +++ b/arch/ppc/platforms/cpci690.h Mon Jan 23 08:34:59 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/cpci690.h - * * Definitions for Force CPCI690 * * Author: Mark A. Greer diff -r df46ccb05adf arch/ppc/platforms/ev64260.c --- a/arch/ppc/platforms/ev64260.c Fri Jan 20 09:49:15 2006 +++ b/arch/ppc/platforms/ev64260.c Mon Jan 23 08:34:59 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/ev64260.c - * * Board setup routines for the Marvell/Galileo EV-64260-BP Evaluation Board. * * Author: Mark A. Greer diff -r df46ccb05adf arch/ppc/platforms/ev64260.h --- a/arch/ppc/platforms/ev64260.h Fri Jan 20 09:49:15 2006 +++ b/arch/ppc/platforms/ev64260.h Mon Jan 23 08:34:59 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/ev64260.h - * * Definitions for Marvell/Galileo EV-64260-BP Evaluation Board. * * Author: Mark A. Greer diff -r df46ccb05adf arch/ppc/platforms/ev64360.c --- a/arch/ppc/platforms/ev64360.c Fri Jan 20 09:49:15 2006 +++ b/arch/ppc/platforms/ev64360.c Mon Jan 23 08:34:59 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/ev64360.c - * * Board setup routines for the Marvell EV-64360-BP Evaluation Board. * * Author: Lee Nicks diff -r df46ccb05adf arch/ppc/platforms/ev64360.h --- a/arch/ppc/platforms/ev64360.h Fri Jan 20 09:49:15 2006 +++ b/arch/ppc/platforms/ev64360.h Mon Jan 23 08:34:59 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/ev64360.h - * * Definitions for Marvell EV-64360-BP Evaluation Board. * * Author: Lee Nicks diff -r df46ccb05adf arch/ppc/platforms/gemini.h --- a/arch/ppc/platforms/gemini.h Fri Jan 20 09:49:15 2006 +++ b/arch/ppc/platforms/gemini.h Mon Jan 23 08:34:59 2006 @@ -1,7 +1,4 @@ /* - * arch/ppc/platforms/gemini.h - * - * * Onboard registers and descriptions for Synergy Microsystems' * "Gemini" boards. * diff -r df46ccb05adf arch/ppc/platforms/gemini_prom.S --- a/arch/ppc/platforms/gemini_prom.S Fri Jan 20 09:49:15 2006 +++ b/arch/ppc/platforms/gemini_prom.S Mon Jan 23 08:34:59 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/gemini_prom.S - * * Not really prom support code (yet), but sort of anti-prom code. The current * bootloader does a number of things it shouldn't and doesn't do things that it * should. The stuff in here is mainly a hodge-podge collection of setup code diff -r df46ccb05adf arch/ppc/platforms/gemini_setup.c --- a/arch/ppc/platforms/gemini_setup.c Fri Jan 20 09:49:15 2006 +++ b/arch/ppc/platforms/gemini_setup.c Mon Jan 23 08:34:59 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/gemini_setup.c - * * Copyright (C) 1995 Linus Torvalds * Adapted from 'alpha' version by Gary Thomas * Modified by Cort Dougan (cort at cs.nmt.edu) diff -r df46ccb05adf arch/ppc/platforms/hdpu.c --- a/arch/ppc/platforms/hdpu.c Fri Jan 20 09:49:15 2006 +++ b/arch/ppc/platforms/hdpu.c Mon Jan 23 08:34:59 2006 @@ -1,7 +1,4 @@ - /* - * arch/ppc/platforms/hdpu_setup.c - * * Board setup routines for the Sky Computers HDPU Compute Blade. * * Written by Brian Waite diff -r df46ccb05adf arch/ppc/platforms/hdpu.h --- a/arch/ppc/platforms/hdpu.h Fri Jan 20 09:49:15 2006 +++ b/arch/ppc/platforms/hdpu.h Mon Jan 23 08:34:59 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/hdpu.h - * * Definitions for Sky Computers HDPU board. * * Brian Waite diff -r df46ccb05adf arch/ppc/platforms/katana.c --- a/arch/ppc/platforms/katana.c Fri Jan 20 09:49:15 2006 +++ b/arch/ppc/platforms/katana.c Mon Jan 23 08:34:59 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/katana.c - * * Board setup routines for the Artesyn Katana cPCI boards. * * Author: Tim Montgomery diff -r df46ccb05adf arch/ppc/platforms/katana.h --- a/arch/ppc/platforms/katana.h Fri Jan 20 09:49:15 2006 +++ b/arch/ppc/platforms/katana.h Mon Jan 23 08:34:59 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/katana.h - * * Definitions for Artesyn Katana750i/3750 board. * * Author: Tim Montgomery diff -r df46ccb05adf arch/ppc/platforms/lite5200.c --- a/arch/ppc/platforms/lite5200.c Fri Jan 20 09:49:15 2006 +++ b/arch/ppc/platforms/lite5200.c Mon Jan 23 08:34:59 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/lite5200.c - * * Platform support file for the Freescale LITE5200 based on MPC52xx. * A maximum of this file should be moved to syslib/mpc52xx_????? * so that new platform based on MPC52xx need a minimal platform file diff -r df46ccb05adf arch/ppc/platforms/lite5200.h --- a/arch/ppc/platforms/lite5200.h Fri Jan 20 09:49:15 2006 +++ b/arch/ppc/platforms/lite5200.h Mon Jan 23 08:34:59 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/lite5200.h - * * Definitions for Freescale LITE5200 : MPC52xx Standard Development * Platform board support * diff -r df46ccb05adf arch/ppc/platforms/lopec.c --- a/arch/ppc/platforms/lopec.c Fri Jan 20 09:49:15 2006 +++ b/arch/ppc/platforms/lopec.c Mon Jan 23 08:34:59 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/lopec.c - * * Setup routines for the Motorola LoPEC. * * Author: Dan Cox diff -r df46ccb05adf arch/ppc/platforms/mvme5100.c --- a/arch/ppc/platforms/mvme5100.c Fri Jan 20 09:49:15 2006 +++ b/arch/ppc/platforms/mvme5100.c Mon Jan 23 08:34:59 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/mvme5100.c - * * Board setup routines for the Motorola MVME5100. * * Author: Matt Porter diff -r df46ccb05adf arch/ppc/platforms/pal4.h --- a/arch/ppc/platforms/pal4.h Fri Jan 20 09:49:15 2006 +++ b/arch/ppc/platforms/pal4.h Mon Jan 23 08:34:59 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/pal4.h - * * Definitions for SBS Palomar IV board * * Author: Dan Cox diff -r df46ccb05adf arch/ppc/platforms/pal4_pci.c --- a/arch/ppc/platforms/pal4_pci.c Fri Jan 20 09:49:15 2006 +++ b/arch/ppc/platforms/pal4_pci.c Mon Jan 23 08:34:59 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/pal4_pci.c - * * PCI support for SBS Palomar IV * * Author: Dan Cox diff -r df46ccb05adf arch/ppc/platforms/pal4_serial.h --- a/arch/ppc/platforms/pal4_serial.h Fri Jan 20 09:49:15 2006 +++ b/arch/ppc/platforms/pal4_serial.h Mon Jan 23 08:34:59 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/pal4_serial.h - * * Definitions for SBS PalomarIV serial support * * Author: Dan Cox diff -r df46ccb05adf arch/ppc/platforms/pal4_setup.c --- a/arch/ppc/platforms/pal4_setup.c Fri Jan 20 09:49:15 2006 +++ b/arch/ppc/platforms/pal4_setup.c Mon Jan 23 08:34:59 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/pal4_setup.c - * * Board setup routines for the SBS PalomarIV. * * Author: Dan Cox diff -r df46ccb05adf arch/ppc/platforms/powerpmc250.c --- a/arch/ppc/platforms/powerpmc250.c Fri Jan 20 09:49:15 2006 +++ b/arch/ppc/platforms/powerpmc250.c Mon Jan 23 08:34:59 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/powerpmc250.c - * * Board setup routines for Force PowerPMC-250 Processor PMC * * Author: Troy Benjegerdes diff -r df46ccb05adf arch/ppc/platforms/pplus.c --- a/arch/ppc/platforms/pplus.c Fri Jan 20 09:49:15 2006 +++ b/arch/ppc/platforms/pplus.c Mon Jan 23 08:34:59 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/pplus.c - * * Board and PCI setup routines for MCG PowerPlus * * Author: Randy Vinson diff -r df46ccb05adf arch/ppc/platforms/pplus.h --- a/arch/ppc/platforms/pplus.h Fri Jan 20 09:49:15 2006 +++ b/arch/ppc/platforms/pplus.h Mon Jan 23 08:34:59 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/pplus.h - * * Definitions for Motorola MCG Falcon/Raven & HAWK North Bridge & Memory ctlr. * * Author: Mark A. Greerinclude/asm-ppc/hawk.h diff -r df46ccb05adf arch/ppc/platforms/pq2ads.c --- a/arch/ppc/platforms/pq2ads.c Fri Jan 20 09:49:15 2006 +++ b/arch/ppc/platforms/pq2ads.c Mon Jan 23 08:34:59 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/pq2ads.c - * * PQ2ADS platform support * * Author: Kumar Gala diff -r df46ccb05adf arch/ppc/platforms/prep_setup.c --- a/arch/ppc/platforms/prep_setup.c Fri Jan 20 09:49:15 2006 +++ b/arch/ppc/platforms/prep_setup.c Mon Jan 23 08:34:59 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/setup.c - * * Copyright (C) 1995 Linus Torvalds * Adapted from 'alpha' version by Gary Thomas * Modified by Cort Dougan (cort at cs.nmt.edu) diff -r df46ccb05adf arch/ppc/platforms/prpmc750.c --- a/arch/ppc/platforms/prpmc750.c Fri Jan 20 09:49:15 2006 +++ b/arch/ppc/platforms/prpmc750.c Mon Jan 23 08:34:59 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/prpmc750_setup.c - * * Board setup routines for Motorola PrPMC750 * * Author: Matt Porter diff -r df46ccb05adf arch/ppc/platforms/prpmc800.c --- a/arch/ppc/platforms/prpmc800.c Fri Jan 20 09:49:15 2006 +++ b/arch/ppc/platforms/prpmc800.c Mon Jan 23 08:34:59 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/prpmc800.c - * * Author: Dale Farnsworth * * 2001-2004 (c) MontaVista, Software, Inc. This file is licensed under diff -r df46ccb05adf arch/ppc/platforms/radstone_ppc7d.c --- a/arch/ppc/platforms/radstone_ppc7d.c Fri Jan 20 09:49:15 2006 +++ b/arch/ppc/platforms/radstone_ppc7d.c Mon Jan 23 08:34:59 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/radstone_ppc7d.c - * * Board setup routines for the Radstone PPC7D boards. * * Author: James Chapman diff -r df46ccb05adf arch/ppc/platforms/radstone_ppc7d.h --- a/arch/ppc/platforms/radstone_ppc7d.h Fri Jan 20 09:49:15 2006 +++ b/arch/ppc/platforms/radstone_ppc7d.h Mon Jan 23 08:34:59 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/radstone_ppc7d.h - * * Board definitions for the Radstone PPC7D boards. * * Author: James Chapman diff -r df46ccb05adf arch/ppc/platforms/sandpoint.c --- a/arch/ppc/platforms/sandpoint.c Fri Jan 20 09:49:15 2006 +++ b/arch/ppc/platforms/sandpoint.c Mon Jan 23 08:34:59 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/sandpoint_setup.c - * * Board setup routines for the Motorola SPS Sandpoint Test Platform. * * Author: Mark A. Greer diff -r df46ccb05adf arch/ppc/platforms/sandpoint.h --- a/arch/ppc/platforms/sandpoint.h Fri Jan 20 09:49:15 2006 +++ b/arch/ppc/platforms/sandpoint.h Mon Jan 23 08:34:59 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/sandpoint.h - * * Definitions for Motorola SPS Sandpoint Test Platform * * Author: Mark A. Greer diff -r df46ccb05adf arch/ppc/platforms/sbc82xx.c --- a/arch/ppc/platforms/sbc82xx.c Fri Jan 20 09:49:15 2006 +++ b/arch/ppc/platforms/sbc82xx.c Mon Jan 23 08:34:59 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/sbc82xx.c - * * SBC82XX platform support * * Author: Guy Streeter diff -r df46ccb05adf arch/ppc/platforms/spruce.c --- a/arch/ppc/platforms/spruce.c Fri Jan 20 09:49:15 2006 +++ b/arch/ppc/platforms/spruce.c Mon Jan 23 08:34:59 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/spruce.c - * * Board and PCI setup routines for IBM Spruce * * Author: MontaVista Software diff -r df46ccb05adf arch/ppc/platforms/tqm8260_setup.c --- a/arch/ppc/platforms/tqm8260_setup.c Fri Jan 20 09:49:15 2006 +++ b/arch/ppc/platforms/tqm8260_setup.c Mon Jan 23 08:34:59 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/tqm8260_setup.c - * * TQM8260 platform support * * Author: Allen Curtis diff -r df46ccb05adf arch/ppc/syslib/cpc700.h --- a/arch/ppc/syslib/cpc700.h Fri Jan 20 09:49:15 2006 +++ b/arch/ppc/syslib/cpc700.h Mon Jan 23 08:34:59 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/syslib/cpc700.h - * * Header file for IBM CPC700 Host Bridge, et. al. * * Author: Mark A. Greer diff -r df46ccb05adf arch/ppc/syslib/cpc700_pic.c --- a/arch/ppc/syslib/cpc700_pic.c Fri Jan 20 09:49:15 2006 +++ b/arch/ppc/syslib/cpc700_pic.c Mon Jan 23 08:34:59 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/syslib/cpc700_pic.c - * * Interrupt controller support for IBM Spruce * * Authors: Mark Greer, Matt Porter, and Johnnie Peters diff -r df46ccb05adf arch/ppc/syslib/cpc710.h --- a/arch/ppc/syslib/cpc710.h Fri Jan 20 09:49:15 2006 +++ b/arch/ppc/syslib/cpc710.h Mon Jan 23 08:34:59 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/syslib/cpc710.h - * * Definitions for the IBM CPC710 PCI Host Bridge * * Author: Matt Porter diff -r df46ccb05adf arch/ppc/syslib/gen550.h --- a/arch/ppc/syslib/gen550.h Fri Jan 20 09:49:15 2006 +++ b/arch/ppc/syslib/gen550.h Mon Jan 23 08:34:59 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/syslib/gen550.h - * * gen550 prototypes * * Matt Porter diff -r df46ccb05adf arch/ppc/syslib/gen550_dbg.c --- a/arch/ppc/syslib/gen550_dbg.c Fri Jan 20 09:49:15 2006 +++ b/arch/ppc/syslib/gen550_dbg.c Mon Jan 23 08:34:59 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/syslib/gen550_dbg.c - * * A library of polled 16550 serial routines. These are intended to * be used to support progress messages, xmon, kgdb, etc. on a * variety of platforms. diff -r df46ccb05adf arch/ppc/syslib/gen550_kgdb.c --- a/arch/ppc/syslib/gen550_kgdb.c Fri Jan 20 09:49:15 2006 +++ b/arch/ppc/syslib/gen550_kgdb.c Mon Jan 23 08:34:59 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/syslib/gen550_kgdb.c - * * Generic 16550 kgdb support intended to be useful on a variety * of platforms. To enable this support, it is necessary to set * the CONFIG_GEN550 option. Any virtual mapping of the serial diff -r df46ccb05adf arch/ppc/syslib/gt64260_pic.c --- a/arch/ppc/syslib/gt64260_pic.c Fri Jan 20 09:49:15 2006 +++ b/arch/ppc/syslib/gt64260_pic.c Mon Jan 23 08:34:59 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/syslib/gt64260_pic.c - * * Interrupt controller support for Galileo's GT64260. * * Author: Chris Zankel diff -r df46ccb05adf arch/ppc/syslib/harrier.c --- a/arch/ppc/syslib/harrier.c Fri Jan 20 09:49:15 2006 +++ b/arch/ppc/syslib/harrier.c Mon Jan 23 08:34:59 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/syslib/harrier.c - * * Motorola MCG Harrier northbridge/memory controller support * * Author: Dale Farnsworth diff -r df46ccb05adf arch/ppc/syslib/hawk_common.c --- a/arch/ppc/syslib/hawk_common.c Fri Jan 20 09:49:15 2006 +++ b/arch/ppc/syslib/hawk_common.c Mon Jan 23 08:34:59 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/syslib/hawk_common.c - * * Common Motorola PowerPlus Platform--really Falcon/Raven or HAWK. * * Author: Mark A. Greer diff -r df46ccb05adf arch/ppc/syslib/ibm440gp_common.c --- a/arch/ppc/syslib/ibm440gp_common.c Fri Jan 20 09:49:15 2006 +++ b/arch/ppc/syslib/ibm440gp_common.c Mon Jan 23 08:34:59 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/syslib/ibm440gp_common.c - * * PPC440GP system library * * Matt Porter diff -r df46ccb05adf arch/ppc/syslib/ibm440gp_common.h --- a/arch/ppc/syslib/ibm440gp_common.h Fri Jan 20 09:49:15 2006 +++ b/arch/ppc/syslib/ibm440gp_common.h Mon Jan 23 08:34:59 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/kernel/ibm440gp_common.h - * * PPC440GP system library * * Eugene Surovegin or diff -r df46ccb05adf arch/ppc/syslib/ibm440gx_common.c --- a/arch/ppc/syslib/ibm440gx_common.c Fri Jan 20 09:49:15 2006 +++ b/arch/ppc/syslib/ibm440gx_common.c Mon Jan 23 08:34:59 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/kernel/ibm440gx_common.c - * * PPC440GX system library * * Eugene Surovegin or diff -r df46ccb05adf arch/ppc/syslib/ibm440gx_common.h --- a/arch/ppc/syslib/ibm440gx_common.h Fri Jan 20 09:49:15 2006 +++ b/arch/ppc/syslib/ibm440gx_common.h Mon Jan 23 08:34:59 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/kernel/ibm440gx_common.h - * * PPC440GX system library * * Eugene Surovegin or diff -r df46ccb05adf arch/ppc/syslib/ibm440sp_common.c --- a/arch/ppc/syslib/ibm440sp_common.c Fri Jan 20 09:49:15 2006 +++ b/arch/ppc/syslib/ibm440sp_common.c Mon Jan 23 08:34:59 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/syslib/ibm440sp_common.c - * * PPC440SP/PPC440SPe system library * * Matt Porter diff -r df46ccb05adf arch/ppc/syslib/ibm440sp_common.h --- a/arch/ppc/syslib/ibm440sp_common.h Fri Jan 20 09:49:15 2006 +++ b/arch/ppc/syslib/ibm440sp_common.h Mon Jan 23 08:34:59 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/syslib/ibm440sp_common.h - * * PPC440SP system library * * Matt Porter diff -r df46ccb05adf arch/ppc/syslib/ibm44x_common.c --- a/arch/ppc/syslib/ibm44x_common.c Fri Jan 20 09:49:15 2006 +++ b/arch/ppc/syslib/ibm44x_common.c Mon Jan 23 08:34:59 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/syslib/ibm44x_common.c - * * PPC44x system library * * Matt Porter diff -r df46ccb05adf arch/ppc/syslib/ibm44x_common.h --- a/arch/ppc/syslib/ibm44x_common.h Fri Jan 20 09:49:15 2006 +++ b/arch/ppc/syslib/ibm44x_common.h Mon Jan 23 08:34:59 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/kernel/ibm44x_common.h - * * PPC44x system library * * Eugene Surovegin or diff -r df46ccb05adf arch/ppc/syslib/m8260_pci_erratum9.c --- a/arch/ppc/syslib/m8260_pci_erratum9.c Fri Jan 20 09:49:15 2006 +++ b/arch/ppc/syslib/m8260_pci_erratum9.c Mon Jan 23 08:34:59 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/mpc8260_pci9.c - * * Workaround for device erratum PCI 9. * See Motorola's "XPC826xA Family Device Errata Reference." * The erratum applies to all 8260 family Hip4 processors. It is scheduled diff -r df46ccb05adf arch/ppc/syslib/m8260_setup.c --- a/arch/ppc/syslib/m8260_setup.c Fri Jan 20 09:49:15 2006 +++ b/arch/ppc/syslib/m8260_setup.c Mon Jan 23 08:34:59 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/syslib/m8260_setup.c - * * Copyright (C) 1995 Linus Torvalds * Adapted from 'alpha' version by Gary Thomas * Modified by Cort Dougan (cort at cs.nmt.edu) diff -r df46ccb05adf arch/ppc/syslib/m8xx_setup.c --- a/arch/ppc/syslib/m8xx_setup.c Fri Jan 20 09:49:15 2006 +++ b/arch/ppc/syslib/m8xx_setup.c Mon Jan 23 08:34:59 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/kernel/setup.c - * * Copyright (C) 1995 Linus Torvalds * Adapted from 'alpha' version by Gary Thomas * Modified by Cort Dougan (cort at cs.nmt.edu) diff -r df46ccb05adf arch/ppc/syslib/mpc10x_common.c --- a/arch/ppc/syslib/mpc10x_common.c Fri Jan 20 09:49:15 2006 +++ b/arch/ppc/syslib/mpc10x_common.c Mon Jan 23 08:34:59 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/syslib/mpc10x_common.c - * * Common routines for the Motorola SPS MPC106, MPC107 and MPC8240 Host bridge, * Mem ctlr, EPIC, etc. * diff -r df46ccb05adf arch/ppc/syslib/mpc52xx_devices.c --- a/arch/ppc/syslib/mpc52xx_devices.c Fri Jan 20 09:49:15 2006 +++ b/arch/ppc/syslib/mpc52xx_devices.c Mon Jan 23 08:34:59 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/syslib/mpc52xx_devices.c - * * Freescale MPC52xx device descriptions * * diff -r df46ccb05adf arch/ppc/syslib/mpc52xx_pci.c --- a/arch/ppc/syslib/mpc52xx_pci.c Fri Jan 20 09:49:15 2006 +++ b/arch/ppc/syslib/mpc52xx_pci.c Mon Jan 23 08:34:59 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/syslib/mpc52xx_pci.c - * * PCI code for the Freescale MPC52xx embedded CPU. * * diff -r df46ccb05adf arch/ppc/syslib/mpc52xx_pci.h --- a/arch/ppc/syslib/mpc52xx_pci.h Fri Jan 20 09:49:15 2006 +++ b/arch/ppc/syslib/mpc52xx_pci.h Mon Jan 23 08:34:59 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/syslib/mpc52xx_pci.h - * * PCI Include file the Freescale MPC52xx embedded cpu chips * * diff -r df46ccb05adf arch/ppc/syslib/mpc52xx_pic.c --- a/arch/ppc/syslib/mpc52xx_pic.c Fri Jan 20 09:49:15 2006 +++ b/arch/ppc/syslib/mpc52xx_pic.c Mon Jan 23 08:34:59 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/syslib/mpc52xx_pic.c - * * Programmable Interrupt Controller functions for the Freescale MPC52xx * embedded CPU. * diff -r df46ccb05adf arch/ppc/syslib/mpc52xx_setup.c --- a/arch/ppc/syslib/mpc52xx_setup.c Fri Jan 20 09:49:15 2006 +++ b/arch/ppc/syslib/mpc52xx_setup.c Mon Jan 23 08:34:59 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/syslib/mpc52xx_setup.c - * * Common code for the boards based on Freescale MPC52xx embedded CPU. * * diff -r df46ccb05adf arch/ppc/syslib/mpc52xx_sys.c --- a/arch/ppc/syslib/mpc52xx_sys.c Fri Jan 20 09:49:15 2006 +++ b/arch/ppc/syslib/mpc52xx_sys.c Mon Jan 23 08:34:59 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/syslib/mpc52xx_sys.c - * * Freescale MPC52xx system descriptions * * diff -r df46ccb05adf arch/ppc/syslib/mpc83xx_devices.c --- a/arch/ppc/syslib/mpc83xx_devices.c Fri Jan 20 09:49:15 2006 +++ b/arch/ppc/syslib/mpc83xx_devices.c Mon Jan 23 08:34:59 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/83xx/mpc83xx_devices.c - * * MPC83xx Device descriptions * * Maintainer: Kumar Gala diff -r df46ccb05adf arch/ppc/syslib/mpc83xx_sys.c --- a/arch/ppc/syslib/mpc83xx_sys.c Fri Jan 20 09:49:15 2006 +++ b/arch/ppc/syslib/mpc83xx_sys.c Mon Jan 23 08:34:59 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/83xx/mpc83xx_sys.c - * * MPC83xx System descriptions * * Maintainer: Kumar Gala diff -r df46ccb05adf arch/ppc/syslib/mpc85xx_devices.c --- a/arch/ppc/syslib/mpc85xx_devices.c Fri Jan 20 09:49:15 2006 +++ b/arch/ppc/syslib/mpc85xx_devices.c Mon Jan 23 08:34:59 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/85xx/mpc85xx_devices.c - * * MPC85xx Device descriptions * * Maintainer: Kumar Gala diff -r df46ccb05adf arch/ppc/syslib/mpc85xx_sys.c --- a/arch/ppc/syslib/mpc85xx_sys.c Fri Jan 20 09:49:15 2006 +++ b/arch/ppc/syslib/mpc85xx_sys.c Mon Jan 23 08:34:59 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/85xx/mpc85xx_sys.c - * * MPC85xx System descriptions * * Maintainer: Kumar Gala diff -r df46ccb05adf arch/ppc/syslib/mpc8xx_devices.c --- a/arch/ppc/syslib/mpc8xx_devices.c Fri Jan 20 09:49:15 2006 +++ b/arch/ppc/syslib/mpc8xx_devices.c Mon Jan 23 08:34:59 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/syslib/mpc8xx_devices.c - * * MPC8xx Device descriptions * * Maintainer: Kumar Gala diff -r df46ccb05adf arch/ppc/syslib/mpc8xx_sys.c --- a/arch/ppc/syslib/mpc8xx_sys.c Fri Jan 20 09:49:15 2006 +++ b/arch/ppc/syslib/mpc8xx_sys.c Mon Jan 23 08:34:59 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/platforms/mpc8xx_sys.c - * * MPC8xx System descriptions * * Maintainer: Kumar Gala diff -r df46ccb05adf arch/ppc/syslib/mv64360_pic.c --- a/arch/ppc/syslib/mv64360_pic.c Fri Jan 20 09:49:15 2006 +++ b/arch/ppc/syslib/mv64360_pic.c Mon Jan 23 08:34:59 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/kernel/mv64360_pic.c - * * Interrupt controller support for Marvell's MV64360. * * Author: Rabeeh Khoury diff -r df46ccb05adf arch/ppc/syslib/mv64x60.c --- a/arch/ppc/syslib/mv64x60.c Fri Jan 20 09:49:15 2006 +++ b/arch/ppc/syslib/mv64x60.c Mon Jan 23 08:34:59 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/syslib/mv64x60.c - * * Common routines for the Marvell/Galileo Discovery line of host bridges * (gt64260, mv64360, mv64460, ...). * diff -r df46ccb05adf arch/ppc/syslib/mv64x60_dbg.c --- a/arch/ppc/syslib/mv64x60_dbg.c Fri Jan 20 09:49:15 2006 +++ b/arch/ppc/syslib/mv64x60_dbg.c Mon Jan 23 08:34:59 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/syslib/mv64x60_dbg.c - * * KGDB and progress routines for the Marvell/Galileo MV64x60 (Discovery). * * Author: Mark A. Greer diff -r df46ccb05adf arch/ppc/syslib/mv64x60_win.c --- a/arch/ppc/syslib/mv64x60_win.c Fri Jan 20 09:49:15 2006 +++ b/arch/ppc/syslib/mv64x60_win.c Mon Jan 23 08:34:59 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/syslib/mv64x60_win.c - * * Tables with info on how to manipulate the 32 & 64 bit windows on the * various types of Marvell bridge chips. * diff -r df46ccb05adf arch/ppc/syslib/open_pic.c --- a/arch/ppc/syslib/open_pic.c Fri Jan 20 09:49:15 2006 +++ b/arch/ppc/syslib/open_pic.c Mon Jan 23 08:34:59 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/kernel/open_pic.c -- OpenPIC Interrupt Handling - * * Copyright (C) 1997 Geert Uytterhoeven * * This file is subject to the terms and conditions of the GNU General Public diff -r df46ccb05adf arch/ppc/syslib/open_pic2.c --- a/arch/ppc/syslib/open_pic2.c Fri Jan 20 09:49:15 2006 +++ b/arch/ppc/syslib/open_pic2.c Mon Jan 23 08:34:59 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/kernel/open_pic.c -- OpenPIC Interrupt Handling - * * Copyright (C) 1997 Geert Uytterhoeven * * This file is subject to the terms and conditions of the GNU General Public diff -r df46ccb05adf arch/ppc/syslib/open_pic_defs.h --- a/arch/ppc/syslib/open_pic_defs.h Fri Jan 20 09:49:15 2006 +++ b/arch/ppc/syslib/open_pic_defs.h Mon Jan 23 08:34:59 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/kernel/open_pic_defs.h -- OpenPIC definitions - * * Copyright (C) 1997 Geert Uytterhoeven * * This file is based on the following documentation: diff -r df46ccb05adf arch/ppc/syslib/pci_auto.c --- a/arch/ppc/syslib/pci_auto.c Fri Jan 20 09:49:15 2006 +++ b/arch/ppc/syslib/pci_auto.c Mon Jan 23 08:34:59 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/syslib/pci_auto.c - * * PCI autoconfiguration library * * Author: Matt Porter diff -r df46ccb05adf arch/ppc/syslib/ppc4xx_dma.c --- a/arch/ppc/syslib/ppc4xx_dma.c Fri Jan 20 09:49:15 2006 +++ b/arch/ppc/syslib/ppc4xx_dma.c Mon Jan 23 08:34:59 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/kernel/ppc4xx_dma.c - * * IBM PPC4xx DMA engine core library * * Copyright 2000-2004 MontaVista Software Inc. diff -r df46ccb05adf arch/ppc/syslib/ppc4xx_pic.c --- a/arch/ppc/syslib/ppc4xx_pic.c Fri Jan 20 09:49:15 2006 +++ b/arch/ppc/syslib/ppc4xx_pic.c Mon Jan 23 08:34:59 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/syslib/ppc4xx_pic.c - * * Interrupt controller driver for PowerPC 4xx-based processors. * * Eugene Surovegin or diff -r df46ccb05adf arch/ppc/syslib/ppc4xx_sgdma.c --- a/arch/ppc/syslib/ppc4xx_sgdma.c Fri Jan 20 09:49:15 2006 +++ b/arch/ppc/syslib/ppc4xx_sgdma.c Mon Jan 23 08:34:59 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/kernel/ppc4xx_sgdma.c - * * IBM PPC4xx DMA engine scatter/gather library * * Copyright 2002-2003 MontaVista Software Inc. diff -r df46ccb05adf arch/ppc/syslib/ppc83xx_setup.c --- a/arch/ppc/syslib/ppc83xx_setup.c Fri Jan 20 09:49:15 2006 +++ b/arch/ppc/syslib/ppc83xx_setup.c Mon Jan 23 08:34:59 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/syslib/ppc83xx_setup.c - * * MPC83XX common board code * * Maintainer: Kumar Gala diff -r df46ccb05adf arch/ppc/syslib/ppc83xx_setup.h --- a/arch/ppc/syslib/ppc83xx_setup.h Fri Jan 20 09:49:15 2006 +++ b/arch/ppc/syslib/ppc83xx_setup.h Mon Jan 23 08:34:59 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/syslib/ppc83xx_setup.h - * * MPC83XX common board definitions * * Maintainer: Kumar Gala diff -r df46ccb05adf arch/ppc/syslib/ppc85xx_common.c --- a/arch/ppc/syslib/ppc85xx_common.c Fri Jan 20 09:49:15 2006 +++ b/arch/ppc/syslib/ppc85xx_common.c Mon Jan 23 08:34:59 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/syslib/ppc85xx_common.c - * * MPC85xx support routines * * Maintainer: Kumar Gala diff -r df46ccb05adf arch/ppc/syslib/ppc85xx_common.h --- a/arch/ppc/syslib/ppc85xx_common.h Fri Jan 20 09:49:15 2006 +++ b/arch/ppc/syslib/ppc85xx_common.h Mon Jan 23 08:34:59 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/syslib/ppc85xx_common.h - * * MPC85xx support routines * * Maintainer: Kumar Gala diff -r df46ccb05adf arch/ppc/syslib/ppc85xx_setup.c --- a/arch/ppc/syslib/ppc85xx_setup.c Fri Jan 20 09:49:15 2006 +++ b/arch/ppc/syslib/ppc85xx_setup.c Mon Jan 23 08:34:59 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/syslib/ppc85xx_setup.c - * * MPC85XX common board code * * Maintainer: Kumar Gala diff -r df46ccb05adf arch/ppc/syslib/ppc85xx_setup.h --- a/arch/ppc/syslib/ppc85xx_setup.h Fri Jan 20 09:49:15 2006 +++ b/arch/ppc/syslib/ppc85xx_setup.h Mon Jan 23 08:34:59 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/syslib/ppc85xx_setup.h - * * MPC85XX common board definitions * * Maintainer: Kumar Gala diff -r df46ccb05adf arch/ppc/syslib/ppc_sys.c --- a/arch/ppc/syslib/ppc_sys.c Fri Jan 20 09:49:15 2006 +++ b/arch/ppc/syslib/ppc_sys.c Mon Jan 23 08:34:59 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/syslib/ppc_sys.c - * * PPC System library functions * * Maintainer: Kumar Gala diff -r df46ccb05adf arch/ppc/syslib/pq2_devices.c --- a/arch/ppc/syslib/pq2_devices.c Fri Jan 20 09:49:15 2006 +++ b/arch/ppc/syslib/pq2_devices.c Mon Jan 23 08:34:59 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/syslib/pq2_devices.c - * * PQ2 Device descriptions * * Maintainer: Kumar Gala diff -r df46ccb05adf arch/ppc/syslib/pq2_sys.c --- a/arch/ppc/syslib/pq2_sys.c Fri Jan 20 09:49:15 2006 +++ b/arch/ppc/syslib/pq2_sys.c Mon Jan 23 08:34:59 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/syslib/pq2_devices.c - * * PQ2 System descriptions * * Maintainer: Kumar Gala diff -r df46ccb05adf arch/ppc/syslib/prep_nvram.c --- a/arch/ppc/syslib/prep_nvram.c Fri Jan 20 09:49:15 2006 +++ b/arch/ppc/syslib/prep_nvram.c Mon Jan 23 08:34:59 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/kernel/prep_nvram.c - * * Copyright (C) 1998 Corey Minyard * * This reads the NvRAM on PReP compliant machines (generally from IBM or diff -r df46ccb05adf arch/ppc/syslib/todc_time.c --- a/arch/ppc/syslib/todc_time.c Fri Jan 20 09:49:15 2006 +++ b/arch/ppc/syslib/todc_time.c Mon Jan 23 08:34:59 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/syslib/todc_time.c - * * Time of Day Clock support for the M48T35, M48T37, M48T59, and MC146818 * Real Time Clocks/Timekeepers. * diff -r df46ccb05adf arch/ppc/syslib/xilinx_pic.c --- a/arch/ppc/syslib/xilinx_pic.c Fri Jan 20 09:49:15 2006 +++ b/arch/ppc/syslib/xilinx_pic.c Mon Jan 23 08:34:59 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/syslib/xilinx_pic.c - * * Interrupt controller driver for Xilinx Virtex-II Pro. * * Author: MontaVista Software, Inc. diff -r df46ccb05adf drivers/char/hvcs.c --- a/drivers/char/hvcs.c Fri Jan 20 09:49:15 2006 +++ b/drivers/char/hvcs.c Mon Jan 23 08:34:59 2006 @@ -118,7 +118,7 @@ * the hvcs_final_close() function in order to get it out of the spinlock. * Rearranged hvcs_close(). Cleaned up some printks and did some housekeeping * on the changelog. Removed local CLC_LENGTH and used HVCS_CLC_LENGTH from - * arch/ppc64/hvcserver.h. + * include/asm-powerpc/hvcserver.h * * 1.3.2 -> 1.3.3 Replaced yield() in hvcs_close() with tty_wait_until_sent() to * prevent possible lockup with realtime scheduling as similarily pointed out by @@ -168,9 +168,10 @@ /* * The hcall interface involves putting 8 chars into each of two registers. - * We load up those 2 registers (in arch/ppc64/hvconsole.c) by casting char[16] - * to long[2]. It would work without __ALIGNED__, but a little (tiny) bit - * slower because an unaligned load is slower than aligned load. + * We load up those 2 registers (in arch/powerpc/platforms/pseries/hvconsole.c) + * by casting char[16] to long[2]. It would work without __ALIGNED__, but a + * little (tiny) bit slower because an unaligned load is slower than aligned + * load. */ #define __ALIGNED__ __attribute__((__aligned__(8))) diff -r df46ccb05adf include/asm-powerpc/paca.h --- a/include/asm-powerpc/paca.h Fri Jan 20 09:49:15 2006 +++ b/include/asm-powerpc/paca.h Mon Jan 23 08:34:59 2006 @@ -54,7 +54,7 @@ #endif /* CONFIG_PPC_ISERIES */ /* - * MAGIC: the spinlock functions in arch/ppc64/lib/locks.c + * MAGIC: the spinlock functions in arch/powerpc/lib/locks.c * load lock_token and paca_index with a single lwz * instruction. They must travel together and be properly * aligned. diff -r df46ccb05adf include/asm-powerpc/rwsem.h --- a/include/asm-powerpc/rwsem.h Fri Jan 20 09:49:15 2006 +++ b/include/asm-powerpc/rwsem.h Mon Jan 23 08:34:59 2006 @@ -4,7 +4,7 @@ #ifdef __KERNEL__ /* - * include/asm-ppc64/rwsem.h: R/W semaphores for PPC using the stuff + * include/asm-powerpc/rwsem.h: R/W semaphores for PPC using the stuff * in lib/rwsem.c. Adapted largely from include/asm-i386/rwsem.h * by Paul Mackerras . */ diff -r df46ccb05adf include/asm-ppc/harrier.h --- a/include/asm-ppc/harrier.h Fri Jan 20 09:49:15 2006 +++ b/include/asm-ppc/harrier.h Mon Jan 23 08:34:59 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/kernel/harrier.h - * * Definitions for Motorola MCG Harrier North Bridge & Memory controller * * Author: Dale Farnsworth diff -r df46ccb05adf include/asm-ppc/mpc10x.h --- a/include/asm-ppc/mpc10x.h Fri Jan 20 09:49:15 2006 +++ b/include/asm-ppc/mpc10x.h Mon Jan 23 08:34:59 2006 @@ -1,6 +1,4 @@ /* - * arch/ppc/kernel/mpc10x.h - * * Common routines for the Motorola SPS MPC106/8240/107 Host bridge/Mem * ctlr/EPIC/etc. * diff -r df46ccb05adf include/asm-ppc/todc.h --- a/include/asm-ppc/todc.h Fri Jan 20 09:49:15 2006 +++ b/include/asm-ppc/todc.h Mon Jan 23 08:34:59 2006 @@ -1,6 +1,4 @@ /* - * include/asm-ppc/todc.h - * * Definitions for the M48Txx and mc146818 series of Time of day/Real Time * Clock chips. * diff -r df46ccb05adf kernel/auditsc.c --- a/kernel/auditsc.c Fri Jan 20 09:49:15 2006 +++ b/kernel/auditsc.c Mon Jan 23 08:34:59 2006 @@ -958,7 +958,7 @@ * * i386 no * x86_64 no - * ppc64 yes (see arch/ppc64/kernel/misc.S) + * ppc64 yes (see arch/powerpc/platforms/iseries/misc.S) * * This also happens with vm86 emulation in a non-nested manner * (entries without exits), so this case must be caught. diff -r df46ccb05adf lib/extable.c --- a/lib/extable.c Fri Jan 20 09:49:15 2006 +++ b/lib/extable.c Mon Jan 23 08:34:59 2006 @@ -1,5 +1,4 @@ /* - * lib/extable.c * Derived from arch/ppc/mm/extable.c and arch/i386/mm/extable.c. * * Copyright (C) 2004 Paul Mackerras, IBM Corp. From linas at austin.ibm.com Tue Jan 24 07:30:41 2006 From: linas at austin.ibm.com (linas) Date: Mon, 23 Jan 2006 14:30:41 -0600 Subject: [PATCH] PPC64 collect and export low-level cpu usage statistics In-Reply-To: <43CFC094.8000709@austin.ibm.com> References: <43CFC094.8000709@austin.ibm.com> Message-ID: <20060123203041.GD26221@austin.ibm.com> Hi, On Thu, Jan 19, 2006 at 10:38:44AM -0600, Manish Ahuja was heard to remark: > > POWER5 machines have a per-hardware-thread register which counts at a [...] Can you repackage this intro as a stand-alone file, and submit it as a patch to Documentation/powerpc/cpu_usage_statistics.txt ? I enjoy writing about things; I'll do this for you, if you wish. (there's a few things in the description I'd like to change). --linas From michael at ellerman.id.au Tue Jan 24 10:19:09 2006 From: michael at ellerman.id.au (Michael Ellerman) Date: Tue, 24 Jan 2006 12:19:09 +1300 Subject: 2.6.15 failure on power4 iSeries In-Reply-To: <43D00AFE.9050300@vnet.ibm.com> References: <43CC2DCC.6010201@vnet.ibm.com> <200601191155.53437.michael@ellerman.id.au> <43D00AFE.9050300@vnet.ibm.com> Message-ID: <200601241219.13260.michael@ellerman.id.au> I think I might have found what's causing this. On my box at least, we're trying to allocate 0 bytes in finish_device_tree(). lmb_alloc() happily does that, and reserves the 0 bytes for us. On my machine that reserved region gets coallesced with another and so there's no bug, but perhaps on yours it doesn't get coallesced and eventually it blows up in reserve_bootmem(). Prior to benh's n_addrs patch finish_device_tree() wants to allocate 24 bytes, whereas with it it allocates 0 (for iSeries). So that's exposed the bug in the lmb code. This'll show us what's happening: --- linux.orig/arch/powerpc/kernel/prom.c 2006-01-24 11:27:15.000000000 +1300 +++ linux/arch/powerpc/kernel/prom.c 2006-01-24 11:34:40.000000000 +1300 @@ -13,7 +13,7 @@ * 2 of the License, or (at your option) any later version. */ -#undef DEBUG +#define DEBUG 1 #include #include @@ -704,6 +704,7 @@ void __init finish_device_tree(void) size = 16; finish_node(allnodes, &size, NULL, 0, 0, 1); size -= 16; + DBG("finish_device_tree: size = %d\n", size); end = start = (unsigned long) __va(lmb_alloc(size, 128)); finish_node(allnodes, &end, NULL, 0, 0, 0); BUG_ON(end != start + size); cheers -- Michael Ellerman IBM OzLabs email: michael:ellerman.id.au inmsg: mpe:jabber.org wwweb: http://michael.ellerman.id.au phone: +61 2 6212 1183 (tie line 70 21183) We do not inherit the earth from our ancestors, we borrow it from our children. - S.M.A.R.T Person -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: not available Url : http://ozlabs.org/pipermail/linuxppc64-dev/attachments/20060124/f8427f80/attachment.pgp From geoffrey.levand at am.sony.com Tue Jan 24 12:37:11 2006 From: geoffrey.levand at am.sony.com (Geoff Levand) Date: Mon, 23 Jan 2006 17:37:11 -0800 Subject: [PATCH] spufs-fix-init.patch Message-ID: <43D584C7.7080504@am.sony.com> spufs-fix-init.patch: This is a small fix to get the spufs init sequence right. init_spu_base() in spu_base.c should be called (via module_init(init_spu_base)) before spufs_init() (via module_init(spufs_init)) in spufs/inode.c gets called. Arnd, could you check that this works for your hardware and make any adjustments. -Geoff Signed-off-by: Masato Noguchi Signed-off-by: Geoff Levand diff -uprN linux-2.6.15+spufs/arch/powerpc/platforms/cell/Makefile linux-2.6.15+spufs.mod/arch/powerpc/platforms/cell/Makefile --- linux-2.6.15+spufs/arch/powerpc/platforms/cell/Makefile 2006-01-18 20:46:38.000000000 +0900 +++ linux-2.6.15+spufs.mod/arch/powerpc/platforms/cell/Makefile 2006-01-20 17:16:32.000000000 +0900 @@ -2,7 +2,7 @@ obj-y += interrupt.o iommu.o setup.o s obj-y += pervasive.o obj-$(CONFIG_SMP) += smp.o -obj-$(CONFIG_SPU_FS) += spufs/ spu-base.o +obj-$(CONFIG_SPU_FS) += spu-base.o spufs/ spu-base-y += spu_base.o spu_priv1.o builtin-spufs-$(CONFIG_SPU_FS) += spu_syscalls.o obj-y += $(builtin-spufs-m) From will_schmidt at vnet.ibm.com Tue Jan 24 14:18:33 2006 From: will_schmidt at vnet.ibm.com (will schmidt) Date: Mon, 23 Jan 2006 21:18:33 -0600 Subject: 2.6.15 failure on power4 iSeries In-Reply-To: <200601241219.13260.michael@ellerman.id.au> References: <43CC2DCC.6010201@vnet.ibm.com> <200601191155.53437.michael@ellerman.id.au> <43D00AFE.9050300@vnet.ibm.com> <200601241219.13260.michael@ellerman.id.au> Message-ID: <43D59C89.9090409@vnet.ibm.com> Michael Ellerman wrote: > I think I might have found what's causing this. You beat me to the list.. :-) > > On my box at least, we're trying to allocate 0 bytes in finish_device_tree(). > lmb_alloc() happily does that, and reserves the 0 bytes for us. On my > machine that reserved region gets coallesced with another and so there's no > bug, but perhaps on yours it doesn't get coallesced and eventually it blows > up in reserve_bootmem(). > > Prior to benh's n_addrs patch finish_device_tree() wants to allocate 24 bytes, > whereas with it it allocates 0 (for iSeries). So that's exposed the bug in > the lmb code. > I narrowed down the bad lmb entry with size 0 to the finish_device_tree code,. so my test tree now contains this.. #ifdef CONFIG_PPC_ISERIES end = start = 0; #else end = start = (unsigned long) __va(lmb_alloc(size, 128)); #endif and I boot the rest of the way up. Am not sure what the real fix should be, pretty sure this isnt it. :-) > This'll show us what's happening: > From michael at ellerman.id.au Tue Jan 24 15:08:55 2006 From: michael at ellerman.id.au (Michael Ellerman) Date: Tue, 24 Jan 2006 17:08:55 +1300 Subject: 2.6.15 failure on power4 iSeries In-Reply-To: <43D59C89.9090409@vnet.ibm.com> References: <43CC2DCC.6010201@vnet.ibm.com> <200601241219.13260.michael@ellerman.id.au> <43D59C89.9090409@vnet.ibm.com> Message-ID: <200601241709.01295.michael@ellerman.id.au> On Tue, 24 Jan 2006 16:18, will schmidt wrote: > > On my box at least, we're trying to allocate 0 bytes in > > finish_device_tree(). lmb_alloc() happily does that, and reserves the 0 > > bytes for us. On my machine that reserved region gets coallesced with > > another and so there's no bug, but perhaps on yours it doesn't get > > coallesced and eventually it blows up in reserve_bootmem(). > > > > Prior to benh's n_addrs patch finish_device_tree() wants to allocate 24 > > bytes, whereas with it it allocates 0 (for iSeries). So that's exposed > > the bug in the lmb code. > > I narrowed down the bad lmb entry with size 0 to the finish_device_tree > code,. so my test tree now contains this.. > > #ifdef CONFIG_PPC_ISERIES > end = start = 0; > #else > end = start = (unsigned long) __va(lmb_alloc(size, 128)); > #endif > > and I boot the rest of the way up. Am not sure what the real fix should > be, pretty sure this isnt it. :-) Cool - we both tracked it to the same piece of code, which is always nice :) I've got a patch that seems to do the trick, I'll post it in a sec. cheers -- Michael Ellerman IBM OzLabs email: michael:ellerman.id.au inmsg: mpe:jabber.org wwweb: http://michael.ellerman.id.au phone: +61 2 6212 1183 (tie line 70 21183) We do not inherit the earth from our ancestors, we borrow it from our children. - S.M.A.R.T Person -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: not available Url : http://ozlabs.org/pipermail/linuxppc64-dev/attachments/20060124/fc5e4147/attachment.pgp From michael at ellerman.id.au Wed Jan 25 19:31:24 2006 From: michael at ellerman.id.au (Michael Ellerman) Date: Wed, 25 Jan 2006 21:31:24 +1300 Subject: [PATCH 0/5] powerpc: lmb related bug fix & cleanups Message-ID: <1138177884.332529.405746276098.qpush@concordia> The first patch in this series should fix the crash we're seeing on iSeries of late, since Benh's n_addrs patch. It should go upstream asap. The second is a preventative patch, to make finding a similar bug in the future easier. The third patch implements an idea I floated a while back, which is to make lmb_alloc() panic on failure. Currently all[1] callers either panic or don't check the return value. The other two are just cleanups of lmb.h All booted on pSeries LPAR & iSeries, built for G5 and pmac32. [1] except for careful_allocation(), which my patch caters for. From michael at ellerman.id.au Wed Jan 25 19:31:25 2006 From: michael at ellerman.id.au (Michael Ellerman) Date: Wed, 25 Jan 2006 21:31:25 +1300 Subject: [PATCH 1/5] powerpc: Don't allocate zero bytes in finish_device_tree() In-Reply-To: <1138177884.332529.405746276098.qpush@concordia> Message-ID: <20060125083139.96266689C0@ozlabs.org> In prom.c we run finish_node() on allnodes twice. The first time we just calculate how much memory we'll need, the second time we do the actual work. If the calculation stage determines that we need 0 bytes, then we should skip the lmb allocation. Although an alloc of zero will work, it has been seen to lead to a BUG_ON() in reserve_bootmem() on at least one machine. Signed-off-by: Michael Ellerman --- arch/powerpc/kernel/prom.c | 7 ++++++- 1 files changed, 6 insertions(+), 1 deletion(-) Index: linux/arch/powerpc/kernel/prom.c =================================================================== --- linux.orig/arch/powerpc/kernel/prom.c +++ linux/arch/powerpc/kernel/prom.c @@ -491,7 +491,12 @@ void __init finish_device_tree(void) size = 16; finish_node(allnodes, &size, 1); size -= 16; - end = start = (unsigned long) __va(lmb_alloc(size, 128)); + + if (0 == size) + end = start = 0; + else + end = start = (unsigned long)__va(lmb_alloc(size, 128)); + finish_node(allnodes, &end, 0); BUG_ON(end != start + size); From michael at ellerman.id.au Wed Jan 25 19:31:26 2006 From: michael at ellerman.id.au (Michael Ellerman) Date: Wed, 25 Jan 2006 21:31:26 +1300 Subject: [PATCH 2/5] powerpc: Make sure we don't create empty lmb regions In-Reply-To: <1138177884.332529.405746276098.qpush@concordia> Message-ID: <20060125083140.ECB7D689AE@ozlabs.org> To prevent problems later in boot, make sure we don't create zero-size lmb regions. I've checked all the callers, and at the moment no one should ever hit this. All callers use a constant size, or they check the computed size before they call us. Signed-off-by: Michael Ellerman --- arch/powerpc/mm/lmb.c | 4 ++++ 1 files changed, 4 insertions(+) Index: linux/arch/powerpc/mm/lmb.c =================================================================== --- linux.orig/arch/powerpc/mm/lmb.c +++ linux/arch/powerpc/mm/lmb.c @@ -197,6 +197,8 @@ long __init lmb_reserve(unsigned long ba { struct lmb_region *_rgn = &(lmb.reserved); + BUG_ON(0 == size); + return lmb_add_region(_rgn, base, size); } @@ -227,6 +229,8 @@ unsigned long __init lmb_alloc_base(unsi long i, j; unsigned long base = 0; + BUG_ON(0 == size); + #ifdef CONFIG_PPC32 /* On 32-bit, make sure we allocate lowmem */ if (max_addr == LMB_ALLOC_ANYWHERE) From michael at ellerman.id.au Wed Jan 25 19:31:28 2006 From: michael at ellerman.id.au (Michael Ellerman) Date: Wed, 25 Jan 2006 21:31:28 +1300 Subject: [PATCH 3/5] powerpc: Always panic if lmb_alloc() fails In-Reply-To: <1138177884.332529.405746276098.qpush@concordia> Message-ID: <20060125083142.A9E55689AE@ozlabs.org> Currently most callers of lmb_alloc() don't check if it worked or not, if it ever does weird bad things will probably happen. The few callers who do check just panic or BUG_ON. So make lmb_alloc() panic internally, to catch bugs at the source. The few callers who did check the result no longer need to. The only caller that did anything interesting with the return result was careful_allocation(). For it we create __lmb_alloc_base() which _doesn't_ panic automatically, a little messy, but passable. Signed-off-by: Michael Ellerman --- arch/powerpc/kernel/prom.c | 4 ---- arch/powerpc/mm/hash_utils_64.c | 1 - arch/powerpc/mm/lmb.c | 14 ++++++++++++++ arch/powerpc/mm/mem.c | 1 - arch/powerpc/mm/numa.c | 4 ++-- arch/powerpc/mm/stab.c | 4 ---- arch/powerpc/sysdev/dart_iommu.c | 2 -- include/asm-powerpc/lmb.h | 2 ++ 8 files changed, 18 insertions(+), 14 deletions(-) Index: linux/arch/powerpc/mm/lmb.c =================================================================== --- linux.orig/arch/powerpc/mm/lmb.c +++ linux/arch/powerpc/mm/lmb.c @@ -226,6 +226,20 @@ unsigned long __init lmb_alloc(unsigned unsigned long __init lmb_alloc_base(unsigned long size, unsigned long align, unsigned long max_addr) { + unsigned long alloc; + + alloc = __lmb_alloc_base(size, align, max_addr); + + if (alloc < 0) + panic("ERROR: Failed to allocate 0x%lx bytes below 0x%lx.\n", + size, max_addr); + + return alloc; +} + +unsigned long __init __lmb_alloc_base(unsigned long size, unsigned long align, + unsigned long max_addr) +{ long i, j; unsigned long base = 0; Index: linux/arch/powerpc/kernel/prom.c =================================================================== --- linux.orig/arch/powerpc/kernel/prom.c +++ linux/arch/powerpc/kernel/prom.c @@ -831,10 +831,6 @@ void __init unflatten_device_tree(void) /* Allocate memory for the expanded device tree */ mem = lmb_alloc(size + 4, __alignof__(struct device_node)); - if (!mem) { - DBG("Couldn't allocate memory with lmb_alloc()!\n"); - panic("Couldn't allocate memory with lmb_alloc()!\n"); - } mem = (unsigned long) __va(mem); ((u32 *)mem)[size / 4] = 0xdeadbeef; Index: linux/arch/powerpc/mm/hash_utils_64.c =================================================================== --- linux.orig/arch/powerpc/mm/hash_utils_64.c +++ linux/arch/powerpc/mm/hash_utils_64.c @@ -430,7 +430,6 @@ void __init htab_initialize(void) * the absolute address space. */ table = lmb_alloc(htab_size_bytes, htab_size_bytes); - BUG_ON(table == 0); DBG("Hash table allocated at %lx, size: %lx\n", table, htab_size_bytes); Index: linux/arch/powerpc/mm/mem.c =================================================================== --- linux.orig/arch/powerpc/mm/mem.c +++ linux/arch/powerpc/mm/mem.c @@ -249,7 +249,6 @@ void __init do_init_bootmem(void) bootmap_pages = bootmem_bootmap_pages(total_pages); start = lmb_alloc(bootmap_pages << PAGE_SHIFT, PAGE_SIZE); - BUG_ON(!start); boot_mapsize = init_bootmem(start >> PAGE_SHIFT, total_pages); Index: linux/arch/powerpc/mm/numa.c =================================================================== --- linux.orig/arch/powerpc/mm/numa.c +++ linux/arch/powerpc/mm/numa.c @@ -570,11 +570,11 @@ static void __init *careful_allocation(i unsigned long end_pfn) { int new_nid; - unsigned long ret = lmb_alloc_base(size, align, end_pfn << PAGE_SHIFT); + unsigned long ret = __lmb_alloc_base(size, align, end_pfn << PAGE_SHIFT); /* retry over all memory */ if (!ret) - ret = lmb_alloc_base(size, align, lmb_end_of_DRAM()); + ret = __lmb_alloc_base(size, align, lmb_end_of_DRAM()); if (!ret) panic("numa.c: cannot allocate %lu bytes on node %d", Index: linux/arch/powerpc/mm/stab.c =================================================================== --- linux.orig/arch/powerpc/mm/stab.c +++ linux/arch/powerpc/mm/stab.c @@ -247,10 +247,6 @@ void stabs_alloc(void) newstab = lmb_alloc_base(HW_PAGE_SIZE, HW_PAGE_SIZE, 1<> DART_PAGE_SHIFT) & DARTMAP_RPNMASK); Index: linux/include/asm-powerpc/lmb.h =================================================================== --- linux.orig/include/asm-powerpc/lmb.h +++ linux/include/asm-powerpc/lmb.h @@ -48,6 +48,8 @@ extern long __init lmb_reserve(unsigned extern unsigned long __init lmb_alloc(unsigned long, unsigned long); extern unsigned long __init lmb_alloc_base(unsigned long, unsigned long, unsigned long); +extern unsigned long __init __lmb_alloc_base(unsigned long, unsigned long, + unsigned long); extern unsigned long __init lmb_phys_mem_size(void); extern unsigned long __init lmb_end_of_DRAM(void); extern unsigned long __init lmb_abs_to_phys(unsigned long); From michael at ellerman.id.au Wed Jan 25 19:31:30 2006 From: michael at ellerman.id.au (Michael Ellerman) Date: Wed, 25 Jan 2006 21:31:30 +1300 Subject: [PATCH 4/5] powerpc: Move LMB_ALLOC_ANYWHERE out of lmb.h In-Reply-To: <1138177884.332529.405746276098.qpush@concordia> Message-ID: <20060125083148.B586B68926@ozlabs.org> LMB_ALLOC_ANYWHERE doesn't need to be part of the API, it's only used in lmb.c - so move it out of the header file. Signed-off-by: Michael Ellerman --- arch/powerpc/mm/lmb.c | 2 ++ include/asm-powerpc/lmb.h | 2 -- 2 files changed, 2 insertions(+), 2 deletions(-) Index: linux/arch/powerpc/mm/lmb.c =================================================================== --- linux.orig/arch/powerpc/mm/lmb.c +++ linux/arch/powerpc/mm/lmb.c @@ -31,6 +31,8 @@ #define DBG(fmt...) #endif +#define LMB_ALLOC_ANYWHERE 0 + struct lmb lmb; void lmb_dump_all(void) Index: linux/include/asm-powerpc/lmb.h =================================================================== --- linux.orig/include/asm-powerpc/lmb.h +++ linux/include/asm-powerpc/lmb.h @@ -19,8 +19,6 @@ #define MAX_LMB_REGIONS 128 -#define LMB_ALLOC_ANYWHERE 0 - struct lmb_property { unsigned long base; unsigned long size; From michael at ellerman.id.au Wed Jan 25 19:31:36 2006 From: michael at ellerman.id.au (Michael Ellerman) Date: Wed, 25 Jan 2006 21:31:36 +1300 Subject: [PATCH 5/5] powerpc: Put parameter names in lmb.h prototypes In-Reply-To: <1138177884.332529.405746276098.qpush@concordia> Message-ID: <20060125083150.151EE689AE@ozlabs.org> Prototypes aren't so useful without parameter names, add them to lmb.h based on the names in lmb.c Signed-off-by: Michael Ellerman --- include/asm-powerpc/lmb.h | 17 ++++++++--------- 1 files changed, 8 insertions(+), 9 deletions(-) Index: linux/include/asm-powerpc/lmb.h =================================================================== --- linux.orig/include/asm-powerpc/lmb.h +++ linux/include/asm-powerpc/lmb.h @@ -41,17 +41,16 @@ extern struct lmb lmb; extern void __init lmb_init(void); extern void __init lmb_analyze(void); -extern long __init lmb_add(unsigned long, unsigned long); -extern long __init lmb_reserve(unsigned long, unsigned long); -extern unsigned long __init lmb_alloc(unsigned long, unsigned long); -extern unsigned long __init lmb_alloc_base(unsigned long, unsigned long, - unsigned long); -extern unsigned long __init __lmb_alloc_base(unsigned long, unsigned long, - unsigned long); +extern long __init lmb_add(unsigned long base, unsigned long size); +extern long __init lmb_reserve(unsigned long base, unsigned long size); +extern unsigned long __init lmb_alloc(unsigned long size, unsigned long align); +extern unsigned long __init lmb_alloc_base(unsigned long size, + unsigned long align, unsigned long max_addr); +extern unsigned long __init __lmb_alloc_base(unsigned long size, + unsigned long align, unsigned long max_addr); extern unsigned long __init lmb_phys_mem_size(void); extern unsigned long __init lmb_end_of_DRAM(void); -extern unsigned long __init lmb_abs_to_phys(unsigned long); -extern void __init lmb_enforce_memory_limit(unsigned long); +extern void __init lmb_enforce_memory_limit(unsigned long memory_limit); extern void lmb_dump_all(void); From michael at ellerman.id.au Wed Jan 25 19:48:48 2006 From: michael at ellerman.id.au (Michael Ellerman) Date: Wed, 25 Jan 2006 21:48:48 +1300 Subject: [PATCH] powerpc: Refuse to boot a kdump kernel via OF Message-ID: <20060125084903.40C0B68926@ozlabs.org> You can't boot a kdump kernel via OF, not reliably anyway, the kernel being at 32 MB conflicts with the zImage wrapper etc. and it blows up. It's trivial to check in prom_init though, and this is early enough that we can actually drop back to OF where a reset-all will get you going again, which is kinda nice. I think this should go in for 2.6.16. arch/powerpc/kernel/prom_init.c | 4 ++++ 1 files changed, 4 insertions(+) Index: linux/arch/powerpc/kernel/prom_init.c =================================================================== --- linux.orig/arch/powerpc/kernel/prom_init.c +++ linux/arch/powerpc/kernel/prom_init.c @@ -2098,6 +2098,10 @@ unsigned long __init prom_init(unsigned */ prom_init_stdout(); + /* Bail if this is a kdump kernel. */ + if (PHYSICAL_START > 0) + prom_panic("Error: You can't boot a kdump kernel from OF!\n"); + /* * Check for an initrd */ From geoffrey.levand at am.sony.com Thu Jan 26 05:25:58 2006 From: geoffrey.levand at am.sony.com (Geoff Levand) Date: Wed, 25 Jan 2006 10:25:58 -0800 Subject: [PATCH] spufs-prevent-sdr1-access Message-ID: <43D7C2B6.4000902@am.sony.com> spufs-prevent-sdr1-access.patch: SDR1 is a hypervisor resource. It is not accessible when kernel is on LPAR. Signed-off-by: Masato Noguchi Signed-off-by: Geoff Levand diff -uprN linux-2.6.15+spufs/arch/powerpc/platforms/cell/spu_base.c linux-2.6.15+spufs.mod/arch/powerpc/platforms/cell/spu_base.c --- linux-2.6.15+spufs/arch/powerpc/platforms/cell/spu_base.c 2006-01-18 20:46:38.000000000 +0900 +++ linux-2.6.15+spufs.mod/arch/powerpc/platforms/cell/spu_base.c 2006-01-20 17:18:41.000000000 +0900 @@ -626,7 +626,8 @@ static int __init create_spu(struct devi spu->dsisr = 0UL; spin_lock_init(&spu->register_lock); - spu_mfc_sdr_set(spu, mfspr(SPRN_SDR1)); + if (!platform_is_lpar()) + spu_mfc_sdr_set(spu, mfspr(SPRN_SDR1)); spu_mfc_sr1_set(spu, 0x33); spu->ibox_callback = NULL; diff -uprN linux-2.6.15+spufs/arch/powerpc/platforms/cell/spufs/switch.c linux-2.6.15+spufs.mod/arch/powerpc/platforms/cell/spufs/switch.c --- linux-2.6.15+spufs/arch/powerpc/platforms/cell/spufs/switch.c 2006-01-18 20:46:38.000000000 +0900 +++ linux-2.6.15+spufs.mod/arch/powerpc/platforms/cell/spufs/switch.c 2006-01-20 17:17:30.000000000 +0900 @@ -2136,7 +2136,8 @@ static void init_priv1(struct spu_state MFC_STATE1_RELOCATE_MASK | MFC_STATE1_BUS_TLBIE_MASK; /* Set storage description. */ - csa->priv1.mfc_sdr_RW = mfspr(SPRN_SDR1); + if (!platform_is_lpar()) + csa->priv1.mfc_sdr_RW = mfspr(SPRN_SDR1); /* Enable OS-specific set of interrupts. */ csa->priv1.int_mask_class0_RW = CLASS0_ENABLE_DMA_ALIGNMENT_INTR | From olof at lixom.net Thu Jan 26 06:42:30 2006 From: olof at lixom.net (Olof Johansson) Date: Thu, 26 Jan 2006 08:42:30 +1300 Subject: [PATCH] spufs-prevent-sdr1-access In-Reply-To: <43D7C2B6.4000902@am.sony.com> References: <43D7C2B6.4000902@am.sony.com> Message-ID: <20060125194230.GA662@pb15.lixom.net> On Wed, Jan 25, 2006 at 10:25:58AM -0800, Geoff Levand wrote: > spufs-prevent-sdr1-access.patch: > > SDR1 is a hypervisor resource. It is not accessible when > kernel is on LPAR. I apologize if this is a stupid question since I don't know all the spufs and cell details... Don't you still need to set that SPU side register, or does the hypervisor do it? What stops a partition from setting it itself and override whatever hypervisor setting there is, thus breaking the partition isolation, etc? -Olof From michael at ellerman.id.au Thu Jan 26 08:57:15 2006 From: michael at ellerman.id.au (Michael Ellerman) Date: Thu, 26 Jan 2006 10:57:15 +1300 Subject: [PATCH] spufs-prevent-sdr1-access In-Reply-To: <43D7C2B6.4000902@am.sony.com> References: <43D7C2B6.4000902@am.sony.com> Message-ID: <200601261057.19288.michael@ellerman.id.au> On Thu, 26 Jan 2006 07:25, Geoff Levand wrote: > diff -uprN linux-2.6.15+spufs/arch/powerpc/platforms/cell/spu_base.c > linux-2.6.15+spufs.mod/arch/powerpc/platforms/cell/spu_base.c --- > linux-2.6.15+spufs/arch/powerpc/platforms/cell/spu_base.c 2006-01-18 > 20:46:38.000000000 +0900 +++ > linux-2.6.15+spufs.mod/arch/powerpc/platforms/cell/spu_base.c 2006-01-20 > 17:18:41.000000000 +0900 @@ -626,7 +626,8 @@ static int __init > create_spu(struct devi > spu->dsisr = 0UL; > spin_lock_init(&spu->register_lock); > > - spu_mfc_sdr_set(spu, mfspr(SPRN_SDR1)); > + if (!platform_is_lpar()) > + spu_mfc_sdr_set(spu, mfspr(SPRN_SDR1)); > spu_mfc_sr1_set(spu, 0x33); > > spu->ibox_callback = NULL; Unfortunately (for you :) we just removed platform_is_lpar(), instead you should use firmware_has_feature(FW_FEATURE_LPAR). cheers -- Michael Ellerman IBM OzLabs email: michael:ellerman.id.au inmsg: mpe:jabber.org wwweb: http://michael.ellerman.id.au phone: +61 2 6212 1183 (tie line 70 21183) We do not inherit the earth from our ancestors, we borrow it from our children. - S.M.A.R.T Person -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: not available Url : http://ozlabs.org/pipermail/linuxppc64-dev/attachments/20060126/13c941a9/attachment.pgp From arnd at arndb.de Thu Jan 26 09:34:31 2006 From: arnd at arndb.de (Arnd Bergmann) Date: Wed, 25 Jan 2006 23:34:31 +0100 Subject: [PATCH] spufs-prevent-sdr1-access In-Reply-To: <43D7C2B6.4000902@am.sony.com> References: <43D7C2B6.4000902@am.sony.com> Message-ID: <200601252334.32086.arnd@arndb.de> On Wednesday 25 January 2006 19:25, Geoff Levand wrote: > spufs-prevent-sdr1-access.patch: > > SDR1 is a hypervisor resource. It is not accessible when > kernel is on LPAR. Ok, good catch. We need to change it, but I think there is a better way to do it than this patch. > diff -uprN linux-2.6.15+spufs/arch/powerpc/platforms/cell/spu_base.c linux-2.6.15+spufs.mod/arch/powerpc/platforms/cell/spu_base.c > --- linux-2.6.15+spufs/arch/powerpc/platforms/cell/spu_base.c 2006-01-18 20:46:38.000000000 +0900 > +++ linux-2.6.15+spufs.mod/arch/powerpc/platforms/cell/spu_base.c 2006-01-20 17:18:41.000000000 +0900 > @@ -626,7 +626,8 @@ static int __init create_spu(struct devi > spu->dsisr = 0UL; > spin_lock_init(&spu->register_lock); > > - spu_mfc_sdr_set(spu, mfspr(SPRN_SDR1)); > + if (!platform_is_lpar()) > + spu_mfc_sdr_set(spu, mfspr(SPRN_SDR1)); > spu_mfc_sr1_set(spu, 0x33); > > spu->ibox_callback = NULL; The definition of spu_mfc_sdr_set() already knows about wether it's running on hypervisor or not. Also, we know that we always pass the same value. I'd suggest changing this to 'spu_mfc_sdr1_setup();' which is defined as void spu_mfc_sdr1_setup(struct spu *spu) { if (!firmware_has_feature(FW_FEATURE_LPAR)) out_be64(&spu->priv1->mfc_sdr_RW, mfspr(SPRN_SDR1)); else do_whatever_is_necessary(spu); } > diff -uprN linux-2.6.15+spufs/arch/powerpc/platforms/cell/spufs/switch.c linux-2.6.15+spufs.mod/arch/powerpc/platforms/cell/spufs/switch.c > --- linux-2.6.15+spufs/arch/powerpc/platforms/cell/spufs/switch.c 2006-01-18 20:46:38.000000000 +0900 > +++ linux-2.6.15+spufs.mod/arch/powerpc/platforms/cell/spufs/switch.c 2006-01-20 17:17:30.000000000 +0900 > @@ -2136,7 +2136,8 @@ static void init_priv1(struct spu_state > MFC_STATE1_RELOCATE_MASK | MFC_STATE1_BUS_TLBIE_MASK; > > /* Set storage description. */ > - csa->priv1.mfc_sdr_RW = mfspr(SPRN_SDR1); > + if (!platform_is_lpar()) > + csa->priv1.mfc_sdr_RW = mfspr(SPRN_SDR1); > > /* Enable OS-specific set of interrupts. */ > csa->priv1.int_mask_class0_RW = CLASS0_ENABLE_DMA_ALIGNMENT_INTR | > I don't think we need to read SPRN_SDR1 here at all, since the value should be constant over the lifetime of the kernel. Can you try ripping out mfc_sdr_RW from csa->priv1 completely? Arnd <>< From ahuja at austin.ibm.com Thu Jan 26 09:39:57 2006 From: ahuja at austin.ibm.com (Manish Ahuja) Date: Wed, 25 Jan 2006 16:39:57 -0600 Subject: [PATCH] PPC64 collect and export low-level cpu usage statistics In-Reply-To: <20060123203041.GD26221@austin.ibm.com> References: <43CFC094.8000709@austin.ibm.com> <20060123203041.GD26221@austin.ibm.com> Message-ID: <43D7FE3D.7000207@austin.ibm.com> I do have another version of this writeup available which has far more details. But somethings need to be deleted and some other stuff added to it. I can try and send that out and see how you like it. linas wrote: >Hi, > >On Thu, Jan 19, 2006 at 10:38:44AM -0600, Manish Ahuja was heard to remark: > > >>POWER5 machines have a per-hardware-thread register which counts at a >> >> >[...] > >Can you repackage this intro as a stand-alone file, and submit it >as a patch to Documentation/powerpc/cpu_usage_statistics.txt ? > >I enjoy writing about things; I'll do this for you, if you wish. >(there's a few things in the description I'd like to change). > >--linas > > > > From geoffrey.levand at am.sony.com Thu Jan 26 09:54:16 2006 From: geoffrey.levand at am.sony.com (Geoff Levand) Date: Wed, 25 Jan 2006 14:54:16 -0800 Subject: [PATCH] spufs-prevent-sdr1-access In-Reply-To: <200601252334.32086.arnd@arndb.de> References: <200601252334.32086.arnd@arndb.de> Message-ID: <43D80198.4000103@am.sony.com> Arnd Bergmann wrote: > The definition of spu_mfc_sdr_set() already knows about wether it's > running on hypervisor or not. Also, we know that we always pass the > same value. I'd suggest changing this to 'spu_mfc_sdr1_setup();' > > which is defined as > > void spu_mfc_sdr1_setup(struct spu *spu) > { > if (!firmware_has_feature(FW_FEATURE_LPAR)) > out_be64(&spu->priv1->mfc_sdr_RW, mfspr(SPRN_SDR1)); > else > do_whatever_is_necessary(spu); > } > I was thinking that would be a better way also... >> /* Set storage description. */ >>- csa->priv1.mfc_sdr_RW = mfspr(SPRN_SDR1); >>+ if (!platform_is_lpar()) >>+ csa->priv1.mfc_sdr_RW = mfspr(SPRN_SDR1); >> > > I don't think we need to read SPRN_SDR1 here at all, since the value > should > be constant over the lifetime of the kernel. Can you try ripping out > mfc_sdr_RW from csa->priv1 completely? > Ok, we have some other cleanups we're preparing, so I'll try to put it in with those. Maybe in a day or so. Paul, please ignore this patch. -Geoff From geoffrey.levand at am.sony.com Thu Jan 26 09:38:06 2006 From: geoffrey.levand at am.sony.com (Geoff Levand) Date: Wed, 25 Jan 2006 14:38:06 -0800 Subject: [PATCH] spufs-prevent-sdr1-access In-Reply-To: <20060125194230.GA662@pb15.lixom.net> References: <20060125194230.GA662@pb15.lixom.net> Message-ID: <43D7FDCE.6050002@am.sony.com> Olof Johansson wrote: > On Wed, Jan 25, 2006 at 10:25:58AM -0800, Geoff Levand wrote: > >>spufs-prevent-sdr1-access.patch: >> >>SDR1 is a hypervisor resource. It is not accessible when >>kernel is on LPAR. > > > I apologize if this is a stupid question since I don't know all the > spufs and cell details... > > Don't you still need to set that SPU side register, or does the > hypervisor do it? What stops a partition from setting it itself > and override whatever hypervisor setting there is, thus breaking the > partition isolation, etc? > It seems that for current hypervisor designs just ignoring this operation is enough since the hypervisor manages those details of the SPU. This fix just follows the method of testing platform_is_lpar() before accessing SPRN_SDR1 as done in arch/powerpc/mm/hash_utils_64.c. Those PPE side SPU registers are privlege 1 registers, so only accessable by the hypervisor. Access to those by code executing in a partition will trap into the hypervisor. spu_mfc_sdr_set() is a hypervisor specific wrapper and needs to be coded to do the right thing. Anyone interested in details of the PPE side SPU registers can check the Cell Architecture Manual here: http://cell.scei.co.jp/e_download.html -Geoff From pat at computer-refuge.org Thu Jan 26 10:21:47 2006 From: pat at computer-refuge.org (Patrick Finnegan) Date: Wed, 25 Jan 2006 18:21:47 -0500 Subject: PPC64 boot failure with 2.6.15 Message-ID: <200601251821.47557.pat@computer-refuge.org> After succeeding to get 2.4.26 working on my machine (an IBM 9076-N81 high node), I'm trying to get 2.6 to work on it. So far, the kernel fails to boot, and the machine resets partway through bootup. I've tried compiling both an SMP and UP 2.6.15.1 kernel (unmodified kernel.org sources). I'm compiling the kernels with gcc-4.0, on a dual-G5 running a ppc64 kernel, v2.6.11.7: gcc-4.0 (GCC) 4.0.3 20060115 (prerelease) (Debian 4.0.2-7) Linux excalibur 2.6.11.7 #1 SMP Mon Apr 18 21:31:43 EST 2005 ppc64 GNU/Linux Bootup messages for 2.6.15.1-up: http://computer-refuge.org/bh-debian/2.6/boot-2.6.15.1-up-fail.txt Bootup messages for 2.6.15.1-smp: http://computer-refuge.org/bh-debian/2.6/boot-2.6.15.1-smp-fail.txt Config for 2.6.15.1-smp: http://computer-refuge.org/bh-debian/2.6/config-2.6.15.1-smp For reference, here's the working config I used for 2.4.26 (SMP): http://computer-refuge.org/bh-debian/2.6/config-2.4.26-installer and boot log.... http://computer-refuge.org/bh-debian/bh-boot-2.4.26.txt Anyone have any hints? Pat -- Purdue University Research Computing --- http://www.rcac.purdue.edu/ The Computer Refuge --- http://computer-refuge.org From benh at kernel.crashing.org Thu Jan 26 11:54:42 2006 From: benh at kernel.crashing.org (Benjamin Herrenschmidt) Date: Thu, 26 Jan 2006 11:54:42 +1100 Subject: PPC64 boot failure with 2.6.15 In-Reply-To: <200601251821.47557.pat@computer-refuge.org> References: <200601251821.47557.pat@computer-refuge.org> Message-ID: <1138236882.20983.20.camel@localhost.localdomain> On Wed, 2006-01-25 at 18:21 -0500, Patrick Finnegan wrote: > After succeeding to get 2.4.26 working on my machine (an IBM 9076-N81 > high node), I'm trying to get 2.6 to work on it. So far, the kernel > fails to boot, and the machine resets partway through bootup. I've > tried compiling both an SMP and UP 2.6.15.1 kernel (unmodified > kernel.org sources). > > I'm compiling the kernels with gcc-4.0, on a dual-G5 running a ppc64 > kernel, v2.6.11.7: > gcc-4.0 (GCC) 4.0.3 20060115 (prerelease) (Debian 4.0.2-7) > Linux excalibur 2.6.11.7 #1 SMP Mon Apr 18 21:31:43 EST 2005 ppc64 > GNU/Linux I don't see why it would reset at that point.... (after the symbios driver message). Does it sit there for a while before the reset or not ? Do you see any other message ? (The reset itself is spewing something on the serial port at all ?) One possible thing I spot in your log is: wdrtas: couldn't get token for ibm,get-system-parameter. Trying to continue with a default timeout value of 300 seconds. What happens if you disable CONFIG_WATCHDOG_RTAS ? Ben. From pat at computer-refuge.org Thu Jan 26 12:24:52 2006 From: pat at computer-refuge.org (Patrick Finnegan) Date: Wed, 25 Jan 2006 20:24:52 -0500 Subject: PPC64 boot failure with 2.6.15 In-Reply-To: <1138236882.20983.20.camel@localhost.localdomain> References: <200601251821.47557.pat@computer-refuge.org> <1138236882.20983.20.camel@localhost.localdomain> Message-ID: <200601252024.53071.pat@computer-refuge.org> On Wednesday 25 January 2006 19:54, Benjamin Herrenschmidt wrote: > On Wed, 2006-01-25 at 18:21 -0500, Patrick Finnegan wrote: > > After succeeding to get 2.4.26 working on my machine (an IBM 9076-N81 > > high node), I'm trying to get 2.6 to work on it. So far, the kernel > > fails to boot, and the machine resets partway through bootup. I've > > tried compiling both an SMP and UP 2.6.15.1 kernel (unmodified > > kernel.org sources). > > > > I'm compiling the kernels with gcc-4.0, on a dual-G5 running a ppc64 > > kernel, v2.6.11.7: > > gcc-4.0 (GCC) 4.0.3 20060115 (prerelease) (Debian 4.0.2-7) > > Linux excalibur 2.6.11.7 #1 SMP Mon Apr 18 21:31:43 EST 2005 ppc64 > > GNU/Linux > > I don't see why it would reset at that point.... (after the symbios > driver message). Does it sit there for a while before the reset or not ? Yes, it sits there for a few minutes (I didn't time it). I've seem somewhere that there's a problem with the SYM53C8xx driver in uniproc mode, and with 2.4, it didn't work unless I was running an SMP kernel with the number of procs setting set to at least 16. > Do you see any other message ? (The reset itself is spewing something on > the serial port at all ?) All the messages I see are listed; that's the output of the serial console. The "E075" is what the service processor spits out when the machine resets. > One possible thing I spot in your log is: > > wdrtas: couldn't get token for ibm,get-system-parameter. Trying to continue > with a default timeout value of 300 seconds. > > What happens if you disable CONFIG_WATCHDOG_RTAS ? It sits at the same location (right after the message "scsi0 : sym-2.2.1") for about 7 minutes, and then resets - basically the same thing as before. Pat -- Purdue University ITAP/RCAC --- http://www.rcac.purdue.edu/ The Computer Refuge --- http://computer-refuge.org From anton at samba.org Thu Jan 26 13:23:42 2006 From: anton at samba.org (Anton Blanchard) Date: Thu, 26 Jan 2006 13:23:42 +1100 Subject: PPC64 boot failure with 2.6.15 In-Reply-To: <200601251821.47557.pat@computer-refuge.org> References: <200601251821.47557.pat@computer-refuge.org> Message-ID: <20060126022342.GA32008@krispykreme> Hi, > After succeeding to get 2.4.26 working on my machine (an IBM 9076-N81 > high node), I'm trying to get 2.6 to work on it. So far, the kernel > fails to boot, and the machine resets partway through bootup. I've > tried compiling both an SMP and UP 2.6.15.1 kernel (unmodified > kernel.org sources). Excellent! Ive been wanting to get these machines booting again but our one isnt setup right now. There is one known issue: mpic: Setting upMPIC " version 1.2 at fec000max 1 CPUs Notice the max 1 CPUs. I forgot to tell benh when he was reworking the openpic code that we cant rely on the nr cpus field to be correct :) Paul had a patch to fix this, I'll see if I can find it. If you feel keen you could hack it up by changing the following code in arch/powerpc/sysdev/mpic.c: /* Map the per-CPU registers */ for (i = 0; i < mpic->num_cpus; i++) { mpic->cpuregs[i] = ioremap(phys_addr + MPIC_CPU_BASE + i * MPIC_CPU_STRIDE, 0x1000); BUG_ON(mpic->cpuregs[i] == NULL); } And replace the for loop with for_each_cpu() Anton From pat at computer-refuge.org Thu Jan 26 15:07:45 2006 From: pat at computer-refuge.org (Patrick Finnegan) Date: Wed, 25 Jan 2006 23:07:45 -0500 Subject: PPC64 boot failure with 2.6.15 In-Reply-To: <20060126022342.GA32008@krispykreme> References: <200601251821.47557.pat@computer-refuge.org> <20060126022342.GA32008@krispykreme> Message-ID: <200601252307.45741.pat@computer-refuge.org> On Wednesday 25 January 2006 21:23, you wrote: > Hi, > > > After succeeding to get 2.4.26 working on my machine (an IBM 9076-N81 > > high node), I'm trying to get 2.6 to work on it. So far, the kernel > > fails to boot, and the machine resets partway through bootup. I've > > tried compiling both an SMP and UP 2.6.15.1 kernel (unmodified > > kernel.org sources). > > Excellent! Ive been wanting to get these machines booting again but our > one isnt setup right now. There is one known issue: > > mpic: Setting upMPIC " version 1.2 at fec000max 1 CPUs > > Notice the max 1 CPUs. I forgot to tell benh when he was reworking the > openpic code that we cant rely on the nr cpus field to be correct :) > > Paul had a patch to fix this, I'll see if I can find it. > > If you feel keen you could hack it up by changing the following code in > arch/powerpc/sysdev/mpic.c: > > /* Map the per-CPU registers */ > for (i = 0; i < mpic->num_cpus; i++) { > mpic->cpuregs[i] = ioremap(phys_addr + MPIC_CPU_BASE + > i * MPIC_CPU_STRIDE, 0x1000); > BUG_ON(mpic->cpuregs[i] == NULL); > } > > And replace the for loop with for_each_cpu() Thanks for the hint! I can confirm that this fixes the problem. Patch below. Pat --- linux-2.6.15.1/arch/powerpc/sysdev/mpic.c 2006-01-15 01:16:02.000000000 -0500 +++ linux-2.6.15.1.mod/arch/powerpc/sysdev/mpic.c 2006-01-25 23:00:56.000000000 -0500 @@ -538,7 +538,7 @@ >> MPIC_GREG_FEATURE_LAST_SRC_SHIFT) + 1; /* Map the per-CPU registers */ - for (i = 0; i < mpic->num_cpus; i++) { + for_each_cpu(i) { mpic->cpuregs[i] = ioremap(phys_addr + MPIC_CPU_BASE + i * MPIC_CPU_STRIDE, 0x1000); BUG_ON(mpic->cpuregs[i] == NULL); -- Purdue University ITAP/RCAC --- http://www.rcac.purdue.edu/ The Computer Refuge --- http://computer-refuge.org From pat at computer-refuge.org Thu Jan 26 16:51:00 2006 From: pat at computer-refuge.org (Patrick Finnegan) Date: Thu, 26 Jan 2006 00:51:00 -0500 Subject: PPC64 boot failure with 2.6.15 In-Reply-To: <200601252307.45741.pat@computer-refuge.org> References: <200601251821.47557.pat@computer-refuge.org> <20060126022342.GA32008@krispykreme> <200601252307.45741.pat@computer-refuge.org> Message-ID: <200601260051.00902.pat@computer-refuge.org> On Wednesday 25 January 2006 23:07, Patrick Finnegan wrote: > On Wednesday 25 January 2006 21:23, you wrote: > > And replace the for loop with for_each_cpu() > > Thanks for the hint! > > I can confirm that this fixes the problem. Patch below. Grumble. It looks like I was wrong (I compiled a UP kernel, not an SMP one). The change doesn't fix anything; it still has the message: mpic: Setting up MPIC " MPIC " version 1.at fec00000, max 1 CPUs Looks like that doesn't change anything. What's the last kernel that has the old (working) OpenPIC code? Pat -- Purdue University Research Computing -- http://www.itap.purdue.edu/rcac -- Purdue University ITAP/RCAC --- http://www.rcac.purdue.edu/ The Computer Refuge --- http://computer-refuge.org From jfaslist at yahoo.fr Fri Jan 27 04:24:01 2006 From: jfaslist at yahoo.fr (jfaslist) Date: Thu, 26 Jan 2006 18:24:01 +0100 Subject: Need to arbitrarily set PCI-PCI bridge memory window size. Message-ID: <43D905B1.6010201@yahoo.fr> Problem: Need to arbitrarily set PCI-PCI bridge memory window size. We have designed a VME board based on the IBM 970 Maple design. For accessing VME, we use the PCI-VME Tundra Universe2 bridge. (http://www.tundra.com/Products/Bridges/UniverseII/index.cfm) It's located on the PCI bus hanging from the AMD8111. The PCI-VME bridge works by translating a range of PCI addresses (1Gbytes in my case) to VME. So I need the AMD8111 memory window (PCI CFG off 0x20) to be wide enough to let that range of PCI addresses reach the subordinate PCI bus that holds the PCI-VME bridge. The problem is that the PCI_VME controller BARs only defines and map the chip register sets (4KB). And it looks like the ppc64 linux kernel will set a memory window in the AMD8111 just large enough to meet requirements of BARs from devices on the subordinate bus. Is there a way I can tell linux to program a wider window to let through the PCI to VME range of addresses? Currently I manually program the AMD8111 from my VME driver, but it is just a hack. I have also tried to set the window from the firmware but linux doesn't care. Thanks a lot! -- Best regards, _______________________________________ jean-francois simon - themis computer 5, rue irene joliot curie 38330 eybens - france +33 (0)4 76 14 77 85 ___________________________________________________________________________ Nouveau : t?l?phonez moins cher avec Yahoo! Messenger ! D?couvez les tarifs exceptionnels pour appeler la France et l'international. T?l?chargez sur http://fr.messenger.yahoo.com From linas at austin.ibm.com Fri Jan 27 07:15:17 2006 From: linas at austin.ibm.com (linas) Date: Thu, 26 Jan 2006 14:15:17 -0600 Subject: [PATCH] PPC64 collect and export low-level cpu usage statistics In-Reply-To: <43CFC094.8000709@austin.ibm.com> References: <43CFC094.8000709@austin.ibm.com> Message-ID: <20060126201517.GD19465@austin.ibm.com> Hi, Here's a minor nit: On Thu, Jan 19, 2006 at 10:38:44AM -0600, Manish Ahuja was heard to remark: > Index: linux-2.6.15-rc6/arch/powerpc/kernel/setup_64.c > + > +static void collect_startcpu_util(int cpu); > +static void collect_cpu_deltas(int cpu); > +static void post_cpu_deltas(int cpu); I don't know about everyone else, but I hate forward declarations. Can't we just put the code that defines tese functions earlier in the file? --linas From linas at austin.ibm.com Fri Jan 27 07:28:15 2006 From: linas at austin.ibm.com (linas) Date: Thu, 26 Jan 2006 14:28:15 -0600 Subject: [PATCH] PPC64 collect and export low-level cpu usage statistics In-Reply-To: <43CFC094.8000709@austin.ibm.com> References: <43CFC094.8000709@austin.ibm.com> Message-ID: <20060126202815.GE19465@austin.ibm.com> Hi, Below is a dumb question. Maybe the answer is easy, but I figured it would be easier to ask them than to try to figure out the answer. On Thu, Jan 19, 2006 at 10:38:44AM -0600, Manish Ahuja was heard to remark: > Index: linux-2.6.15-rc6/arch/powerpc/kernel/process.c > + > + lpaca = get_paca(); > + pd->collected_krntb = lpaca->delta_tb; > + pd->collected_timebase = mftb(); What prevents us from accidentally gietting migrated to a different cpu during this process? In particular, I notice you are running this with interrupts enabled. --linas From linas at austin.ibm.com Fri Jan 27 07:36:25 2006 From: linas at austin.ibm.com (linas) Date: Thu, 26 Jan 2006 14:36:25 -0600 Subject: [PATCH] PPC64 collect and export low-level cpu usage statistics In-Reply-To: <43CFC094.8000709@austin.ibm.com> References: <43CFC094.8000709@austin.ibm.com> Message-ID: <20060126203625.GF19465@austin.ibm.com> Hi, On Thu, Jan 19, 2006 at 10:38:44AM -0600, Manish Ahuja was heard to remark: > Index: linux-2.6.15-rc6/arch/powerpc/kernel/setup_64.c > > +/* To initialize and collect statics for user and kernel times typo: s/statics/statistics/ > +static void post_cpu_deltas(cpu) > +{ > + struct cpu_usage *pd = &per_cpu(cpu_usage_array, cpu); > + u64 total_timebase, total_cpu_util; > + total_timebase = (pd->collected_timebase - pd->start_timebase); > + total_cpu_util = pd->current_cpu_util - pd->start_cpu_util; > + offline_cpu_total_tb += total_timebase; > + offline_cpu_total_cpu_util += total_cpu_util; > + offline_cpu_total_krncycles += pd->collected_krntb; > + offline_cpu_total_idle += (total_timebase - total_cpu_util); > +} What prevents races here? You might s/might/typically will/ have multiple cpus going down at he same time, in which case they are all racing to update these saem global variables, and will potentially clobber each other. Right? --linas From linas at austin.ibm.com Fri Jan 27 07:44:32 2006 From: linas at austin.ibm.com (linas) Date: Thu, 26 Jan 2006 14:44:32 -0600 Subject: [PATCH] PPC64 collect and export low-level cpu usage statistics In-Reply-To: <43CFC094.8000709@austin.ibm.com> References: <43CFC094.8000709@austin.ibm.com> Message-ID: <20060126204432.GG19465@austin.ibm.com> And another comment: On Thu, Jan 19, 2006 at 10:38:44AM -0600, Manish Ahuja was heard to remark: > Index: linux-2.6.15-rc6/arch/powerpc/kernel/sysfs.c > +static ssize_t show_dispatchedcycles(struct sys_device *, char *); > +static ssize_t show_offline_cpu_cycles(struct sys_device *, char *); > + > +static SYSDEV_ATTR(offline_cpu_cycles, 0444, show_offline_cpu_cycles, NULL); > +static SYSDEV_ATTR(cpu_dispatched_cycles, 0444, show_dispatchedcycles, NULL); I think you need a #ifdef CONFIG_PPC64 around the above. > - if (cpu_has_feature(CPU_FTR_SMT)) > + if (cpu_has_feature(CPU_FTR_SMT)) { > sysdev_create_file(s, &attr_purr); > + sysdev_create_file(s, &attr_offline_cpu_cycles); > + sysdev_create_file(s, &attr_cpu_dispatched_cycles); > + } Shouldn't this be CPU_FTR_PURR not FTR_SMT ? (and also in the next section too). > +/* Defined in setup.c */ > +extern u64 offline_cpu_total_tb; > +extern u64 offline_cpu_total_cpu_util; > +extern u64 offline_cpu_total_krncycles; > +extern u64 offline_cpu_total_idle; These should be in a header file, probably arch/powerpc/kernel/setup.h > +static ssize_t show_offline_cpu_cycles(struct sys_device *dev, char *buf) #ifdef CONFIG_PPC64 surrounding the above .... --linas From vax at purdue.edu Thu Jan 26 15:53:38 2006 From: vax at purdue.edu (Patrick Finnegan) Date: Wed, 25 Jan 2006 23:53:38 -0500 Subject: PPC64 boot failure with 2.6.15 In-Reply-To: <200601252307.45741.pat@computer-refuge.org> References: <200601251821.47557.pat@computer-refuge.org> <20060126022342.GA32008@krispykreme> <200601252307.45741.pat@computer-refuge.org> Message-ID: <200601252353.39095.vax@purdue.edu> On Wednesday 25 January 2006 23:07, Patrick Finnegan wrote: > On Wednesday 25 January 2006 21:23, you wrote: > > And replace the for loop with for_each_cpu() > > Thanks for the hint! > > I can confirm that this fixes the problem. Patch below. Grumble. It looks like I was wrong (I compiled a UP kernel, not an SMP one). The change doesn't fix anything; it still has the message: mpic: Setting up MPIC " MPIC " version 1.at fec00000, max 1 CPUs Looks like that doesn't change anything. What's the last kernel that has the old (working) OpenPIC code? Pat -- Purdue University Research Computing -- http://www.itap.purdue.edu/rcac From wangzyu at cn.ibm.com Fri Jan 27 09:27:58 2006 From: wangzyu at cn.ibm.com (Zhao Yu Wang) Date: Fri, 27 Jan 2006 06:27:58 +0800 Subject: Zhao Yu Wang is out of the office. Message-ID: I will be out of the office starting 2006-01-27 and will not return until 2006-02-07. I will be out of the office starting 2006-01-27 and will not return until 2006-02-07. I will respond to your message when I return. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://ozlabs.org/pipermail/linuxppc64-dev/attachments/20060127/b6bbcb55/attachment.htm From geoffrey.levand at am.sony.com Fri Jan 27 11:22:07 2006 From: geoffrey.levand at am.sony.com (Geoff Levand) Date: Thu, 26 Jan 2006 16:22:07 -0800 Subject: spufs platform dependent code Message-ID: <43D967AF.1060305@am.sony.com> Arnd, We need to consider how we will arrange the platform dependent code in spufs. First, we need to consider the run-time selection of spu wrappers, etc. You seemed to think that a simple comparison, as here, will be sufficient: if (firmware_has_feature(FW_FEATURE_HYPERVISOR)) hvcall_spu_get_irq_mask(spu->spu_magical_id, cls, &val); else val = in_be64(&spu->priv1->int_stat_class0_RW + cls); I see a problem in that in the general case, support for several hypervisors and also 'raw hardware' will be compiled in. I was thinking it might work better to use an indirect call through a pointer to a structure of function pointers. struct spu_ops *spu_ops; spu_ops->spu_get_irq_mask(spu->spu_magical_id, cls, &val); The instance of the structure could be setup statically in the platform code and the pointer set with a runtime check or in the platform startup code. Another point is that there is some platform dependent interrupt and spu setup code in spu_base.c. This needs to be moved out and into a platform dependent file. We currently have spu_priv1.c with the platform dependent wrappers. I propose we rename spu_priv1.c to something that hints that is the platform code for 'raw' access, and move the platform code in spu_base.c to it. Do you have any recommended names, or any other suggestions? -Geoff From pat at computer-refuge.org Fri Jan 27 12:25:44 2006 From: pat at computer-refuge.org (Patrick Finnegan) Date: Thu, 26 Jan 2006 20:25:44 -0500 Subject: PPC64 boot failure with 2.6.15 In-Reply-To: <200601260051.00902.pat@computer-refuge.org> References: <200601251821.47557.pat@computer-refuge.org> <200601252307.45741.pat@computer-refuge.org> <200601260051.00902.pat@computer-refuge.org> Message-ID: <200601262025.44777.pat@computer-refuge.org> On Thursday 26 January 2006 00:51, Patrick Finnegan wrote: > On Wednesday 25 January 2006 23:07, Patrick Finnegan wrote: > > On Wednesday 25 January 2006 21:23, you wrote: > > > And replace the for loop with for_each_cpu() > > > > Thanks for the hint! > > > > I can confirm that this fixes the problem. Patch below. > > Grumble. It looks like I was wrong (I compiled a UP kernel, not an > SMP one). The change doesn't fix anything; it still has the message: > mpic: Setting up MPIC " MPIC " version 1.at fec00000, max 1 CPUs > > Looks like that doesn't change anything. > > What's the last kernel that has the old (working) OpenPIC code? Ok, it appears that 2.6.10-rc1 was the last version of the kernel that would boot (in SMP mode) on here. Any hints on what to look at? Pat -- Purdue University Research Computing --- http://www.rcac.purdue.edu/ The Computer Refuge --- http://computer-refuge.org From markh at osdl.org Sat Jan 28 03:57:40 2006 From: markh at osdl.org (Mark Haverkamp) Date: Fri, 27 Jan 2006 08:57:40 -0800 Subject: iommu_alloc failure and panic Message-ID: <1138381060.11796.22.camel@markh3.pdx.osdl.net> While running a disk test (bonnie++) I have been seeing iommu_alloc failed messages in the syslog leading to a panic. The machine that I have is an IBM openserver 720. It has 7856808 kB memory and two dual core power5 cpus. cpu : POWER5 (gr) clock : 1656.384000MHz revision : 2.1 (pvr 003a 0201) I have been testing large numbers of storage devices. I have 16000 scsi LUNs configured. (4000 fiberchannel LUNS seen 4 times). They are configured as 4000 multipath devices using device mapper. I have 100 of those devices configured as a logical volume using LVM2. Once I start bonnie++ using one of those logical volumes I start seeing iommu_alloc failures and then a panic. I don't have this issue when accessing the individual devices or the individual multipath devices. Only when conglomerated into a logical volume. Here is the syslog output: Jan 26 14:56:41 linux kernel: iommu_alloc failed, tbl c00000000263c480 vaddr c0000000d7967000 npages 10 Jan 26 14:56:41 linux kernel: iommu_alloc failed, tbl c00000000263c480 vaddr c00000011ad80000 npages 10 Jan 26 14:56:41 linux kernel: iommu_alloc failed, tbl c00000000263c480 vaddr c0000000e3bca000 npages 10 Jan 26 14:56:41 linux kernel: iommu_alloc failed, tbl c00000000263c480 vaddr c00000011ad80000 npages 10 Jan 26 14:56:41 linux kernel: iommu_alloc failed, tbl c00000000263c480 vaddr c00000011733a000 npages 10 Jan 26 14:56:41 linux kernel: iommu_alloc failed, tbl c00000000263c480 vaddr c000000117c58000 npages 10 Jan 26 14:56:41 linux kernel: iommu_alloc failed, tbl c00000000263c480 vaddr c00000011711d000 npages 10 Jan 26 14:56:41 linux kernel: iommu_alloc failed, tbl c00000000263c480 vaddr c000000126292000 npages 10 Jan 26 14:56:41 linux kernel: iommu_alloc failed, tbl c00000000263c480 vaddr c00000011ad80000 npages 10 Jan 26 14:56:41 linux kernel: iommu_alloc failed, tbl c00000000263c480 vaddr c0000000d4728000 npages 10 Jan 26 14:56:46 linux kernel: printk: 830 messages suppressed. Jan 26 14:56:46 linux kernel: iommu_alloc failed, tbl c00000000263c480 vaddr c00000012adaa000 npages 10 Jan 26 14:56:51 linux kernel: printk: 818 messages suppressed. Jan 26 14:56:51 linux kernel: iommu_alloc failed, tbl c00000000263c480 vaddr c0000001451eb000 npages 10 Jan 26 14:56:56 linux kernel: printk: 1027 messages suppressed. Jan 26 14:56:56 linux kernel: iommu_alloc failed, tbl c00000000263c480 vaddr c00000009c365000 npages 10 Jan 26 14:57:01 linux kernel: printk: 810 messages suppressed. Jan 26 14:57:01 linux kernel: iommu_alloc failed, tbl c00000000263c480 vaddr c000000152606000 npages 10 Jan 26 14:57:06 linux kernel: printk: 819 messages suppressed. Jan 26 14:57:06 linux kernel: iommu_alloc failed, tbl c00000000263c480 vaddr c000000134f3a000 npages 10 Jan 26 14:57:11 linux kernel: printk: 679 messages suppressed. Jan 26 14:57:11 linux kernel: iommu_alloc failed, tbl c00000000263c480 vaddr c000000167030000 npages 10 Here is the panic output cut from the console: Welcome to SUSE LINUX 10.0 (PPC) - Kernel 2.6.16-rc1-ppc64 (hvc0). dev2-002 login: Oops: Kernel access of bad area, sig: 11 [#1] SMP NR_CPUS=128 NUMA PSERIES LPAR Modules linked in: dm_round_robin lpfc scsi_transport_fc dm_multipath ipv6 parport_pc lp parport dm_mod sg st ipr firmware_class sd_mod scsi_mod NIP: C00000000000F7D0 LR: C00000000000FA2C CTR: 0000000000000000 REGS: c0000000076db940 TRAP: 0300 Not tainted (2.6.16-rc1-ppc64) MSR: 8000000000009032 CR: 24002048 XER: 00000010 DAR: C000000600711710, DSISR: 0000000040010000 TASK = c0000000076e4040[191] 'kblockd/3' THREAD: c0000000076d8000 CPU: 3 GPR00: 0000000600000000 C0000000076DBBC0 C00000000070EE68 C0000000076DBDE0 GPR04: C0000000076E4040 00000000000002F0 0000000000080000 C00000000058C720 GPR08: 0000000000000001 C0000000076DBD10 C000000000711710 C0000000076D8000 GPR12: C0000000076DB720 C00000000055F100 0000000000000000 0000000000000000 GPR16: 0000000000000000 000000000197FD90 4000000001C00000 000000000197FD88 GPR20: 000000000197FD98 C000000000503290 0000000000000060 0000000002103728 GPR24: C00000000055EB00 0000000000000001 0000000000000000 C0000000076DBEE0 GPR28: 0000000000000002 C0000000076DBDE0 C0000000076E4040 C000000000079FC0 NIP [C00000000000F7D0] .validate_sp+0x30/0xc0 LR [C00000000000FA2C] .show_stack+0xec/0x1d0 Call Trace: [C0000000076DBBC0] [C00000000000FA18] .show_stack+0xd8/0x1d0 (unreliable) [C0000000076DBC60] [C000000000433838] .schedule+0xd78/0xfb0 [C0000000076DBDE0] [C000000000079FC0] .worker_thread+0x1b0/0x1c0 Unable to handle kernel paging request for data at address 0xc000000600711710 Faulting instruction address: 0xc00000000000f7d0 Unable to handle kernel paging request for data at address 0xc00001800055eb30 Faulting instruction address: 0xc00000000005967c Badness in __mutex_unlock_slowpath at kernel/mutex.c:209 Call Trace: [C00000011E4FF770] [C00000000000F9A8] .show_stack+0x68/0x1d0 (unreliable) [C00000011E4FF810] [C000000000436C00] .program_check_exception+0x2f0/0x600 [C00000011E4FF8B0] [C000000000004348] program_check_common+0xc8/0x100 --- Exception: 700 at .__mutex_unlock_slowpath+0xd4/0x250 LR = .generic_file_write+0x6c/0x130 [C00000011E4FFBA0] [C00000011E4FFBB0] 0xc00000011e4ffbb0 (unreliable) [C00000011E4FFC30] [C0000000000A03DC] .generic_file_write+0x6c/0x130 [C00000011E4FFCF0] [C0000000000D380C] .vfs_write+0x14c/0x210 [C00000011E4FFD90] [C0000000000D44BC] .sys_write+0x4c/0x90 Unable to handle kernel paging request for data at address 0xc000000600711718 Faulting instruction address: 0xc00000000000f7d0 My kernel is 2.6.16-rc1 from the git tree yesterday (01/26/06). It does the same thing with 2.6.15 though. I have attached my .config -- Mark Haverkamp -------------- next part -------------- # # Automatically generated make config: don't edit # Linux kernel version: 2.6.16-rc1 # Thu Jan 26 08:47:58 2006 # CONFIG_PPC64=y CONFIG_64BIT=y CONFIG_PPC_MERGE=y CONFIG_MMU=y CONFIG_GENERIC_HARDIRQS=y CONFIG_RWSEM_XCHGADD_ALGORITHM=y CONFIG_GENERIC_CALIBRATE_DELAY=y CONFIG_PPC=y CONFIG_EARLY_PRINTK=y CONFIG_COMPAT=y CONFIG_SYSVIPC_COMPAT=y CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y CONFIG_ARCH_MAY_HAVE_PC_FDC=y CONFIG_PPC_OF=y CONFIG_PPC_UDBG_16550=y CONFIG_GENERIC_TBSYNC=y # # Processor support # # CONFIG_POWER4_ONLY is not set CONFIG_POWER3=y CONFIG_POWER4=y CONFIG_PPC_FPU=y CONFIG_ALTIVEC=y CONFIG_PPC_STD_MMU=y CONFIG_SMP=y CONFIG_NR_CPUS=128 # # Code maturity level options # CONFIG_EXPERIMENTAL=y CONFIG_CLEAN_COMPILE=y CONFIG_LOCK_KERNEL=y CONFIG_INIT_ENV_ARG_LIMIT=32 # # General setup # CONFIG_LOCALVERSION="-ppc64" CONFIG_LOCALVERSION_AUTO=y CONFIG_SWAP=y CONFIG_SYSVIPC=y CONFIG_POSIX_MQUEUE=y CONFIG_BSD_PROCESS_ACCT=y CONFIG_BSD_PROCESS_ACCT_V3=y CONFIG_SYSCTL=y CONFIG_AUDIT=y CONFIG_AUDITSYSCALL=y CONFIG_IKCONFIG=y CONFIG_IKCONFIG_PROC=y CONFIG_CPUSETS=y CONFIG_INITRAMFS_SOURCE="" # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set # CONFIG_EMBEDDED is not set CONFIG_KALLSYMS=y CONFIG_KALLSYMS_ALL=y # CONFIG_KALLSYMS_EXTRA_PASS is not set CONFIG_HOTPLUG=y CONFIG_PRINTK=y CONFIG_BUG=y CONFIG_ELF_CORE=y CONFIG_BASE_FULL=y CONFIG_FUTEX=y CONFIG_EPOLL=y CONFIG_SHMEM=y CONFIG_CC_ALIGN_FUNCTIONS=0 CONFIG_CC_ALIGN_LABELS=0 CONFIG_CC_ALIGN_LOOPS=0 CONFIG_CC_ALIGN_JUMPS=0 CONFIG_SLAB=y # CONFIG_TINY_SHMEM is not set CONFIG_BASE_SMALL=0 # CONFIG_SLOB is not set # # Loadable module support # CONFIG_MODULES=y CONFIG_MODULE_UNLOAD=y # CONFIG_MODULE_FORCE_UNLOAD is not set CONFIG_OBSOLETE_MODPARM=y CONFIG_MODVERSIONS=y CONFIG_MODULE_SRCVERSION_ALL=y CONFIG_KMOD=y CONFIG_STOP_MACHINE=y # # Block layer # # # IO Schedulers # CONFIG_IOSCHED_NOOP=y CONFIG_IOSCHED_AS=y CONFIG_IOSCHED_DEADLINE=y CONFIG_IOSCHED_CFQ=y CONFIG_DEFAULT_AS=y # CONFIG_DEFAULT_DEADLINE is not set # CONFIG_DEFAULT_CFQ is not set # CONFIG_DEFAULT_NOOP is not set CONFIG_DEFAULT_IOSCHED="anticipatory" # # Platform support # CONFIG_PPC_MULTIPLATFORM=y # CONFIG_PPC_ISERIES is not set # CONFIG_EMBEDDED6xx is not set # CONFIG_APUS is not set CONFIG_PPC_PSERIES=y CONFIG_PPC_PMAC=y CONFIG_PPC_PMAC64=y # CONFIG_PPC_MAPLE is not set # CONFIG_PPC_CELL is not set CONFIG_XICS=y CONFIG_U3_DART=y CONFIG_MPIC=y CONFIG_PPC_RTAS=y CONFIG_RTAS_ERROR_LOGGING=y CONFIG_RTAS_PROC=y CONFIG_RTAS_FLASH=m # CONFIG_MMIO_NVRAM is not set CONFIG_MPIC_BROKEN_U3=y CONFIG_IBMVIO=y # CONFIG_IBMEBUS is not set # CONFIG_PPC_MPC106 is not set # CONFIG_CPU_FREQ is not set # CONFIG_WANT_EARLY_SERIAL is not set # # Kernel options # CONFIG_HZ_100=y # CONFIG_HZ_250 is not set # CONFIG_HZ_1000 is not set CONFIG_HZ=100 CONFIG_PREEMPT_NONE=y # CONFIG_PREEMPT_VOLUNTARY is not set # CONFIG_PREEMPT is not set # CONFIG_PREEMPT_BKL is not set CONFIG_BINFMT_ELF=y CONFIG_BINFMT_MISC=m CONFIG_FORCE_MAX_ZONEORDER=13 CONFIG_IOMMU_VMERGE=y CONFIG_HOTPLUG_CPU=y CONFIG_KEXEC=y # CONFIG_CRASH_DUMP is not set # CONFIG_IRQ_ALL_CPUS is not set CONFIG_PPC_SPLPAR=y CONFIG_EEH=y CONFIG_SCANLOG=m CONFIG_LPARCFG=y CONFIG_NUMA=y CONFIG_ARCH_SELECT_MEMORY_MODEL=y CONFIG_ARCH_SPARSEMEM_ENABLE=y CONFIG_ARCH_SPARSEMEM_DEFAULT=y CONFIG_SELECT_MEMORY_MODEL=y # CONFIG_FLATMEM_MANUAL is not set # CONFIG_DISCONTIGMEM_MANUAL is not set CONFIG_SPARSEMEM_MANUAL=y CONFIG_SPARSEMEM=y CONFIG_NEED_MULTIPLE_NODES=y CONFIG_HAVE_MEMORY_PRESENT=y # CONFIG_SPARSEMEM_STATIC is not set CONFIG_SPARSEMEM_EXTREME=y # CONFIG_MEMORY_HOTPLUG is not set CONFIG_SPLIT_PTLOCK_CPUS=4 CONFIG_MIGRATION=y CONFIG_HAVE_ARCH_EARLY_PFN_TO_NID=y # CONFIG_PPC_64K_PAGES is not set CONFIG_SCHED_SMT=y CONFIG_PROC_DEVICETREE=y # CONFIG_CMDLINE_BOOL is not set # CONFIG_PM is not set CONFIG_SECCOMP=y CONFIG_ISA_DMA_API=y # # Bus options # CONFIG_GENERIC_ISA_DMA=y CONFIG_PPC_I8259=y # CONFIG_PPC_INDIRECT_PCI is not set CONFIG_PCI=y CONFIG_PCI_DOMAINS=y # CONFIG_PCI_LEGACY_PROC is not set # CONFIG_PCI_DEBUG is not set # # PCCARD (PCMCIA/CardBus) support # # CONFIG_PCCARD is not set # # PCI Hotplug Support # CONFIG_HOTPLUG_PCI=m CONFIG_HOTPLUG_PCI_FAKE=m # CONFIG_HOTPLUG_PCI_CPCI is not set # CONFIG_HOTPLUG_PCI_SHPC is not set CONFIG_HOTPLUG_PCI_RPA=m CONFIG_HOTPLUG_PCI_RPA_DLPAR=m CONFIG_KERNEL_START=0xc000000000000000 # # Networking # CONFIG_NET=y # # Networking options # CONFIG_PACKET=y CONFIG_PACKET_MMAP=y CONFIG_UNIX=y CONFIG_XFRM=y CONFIG_XFRM_USER=m CONFIG_NET_KEY=y CONFIG_INET=y CONFIG_IP_MULTICAST=y CONFIG_IP_ADVANCED_ROUTER=y CONFIG_ASK_IP_FIB_HASH=y # CONFIG_IP_FIB_TRIE is not set CONFIG_IP_FIB_HASH=y CONFIG_IP_MULTIPLE_TABLES=y # CONFIG_IP_ROUTE_FWMARK is not set CONFIG_IP_ROUTE_MULTIPATH=y CONFIG_IP_ROUTE_MULTIPATH_CACHED=y CONFIG_IP_ROUTE_MULTIPATH_RR=m CONFIG_IP_ROUTE_MULTIPATH_RANDOM=m CONFIG_IP_ROUTE_MULTIPATH_WRANDOM=m CONFIG_IP_ROUTE_MULTIPATH_DRR=m CONFIG_IP_ROUTE_VERBOSE=y # CONFIG_IP_PNP is not set CONFIG_NET_IPIP=m CONFIG_NET_IPGRE=m CONFIG_NET_IPGRE_BROADCAST=y CONFIG_IP_MROUTE=y CONFIG_IP_PIMSM_V1=y CONFIG_IP_PIMSM_V2=y # CONFIG_ARPD is not set CONFIG_SYN_COOKIES=y CONFIG_INET_AH=m CONFIG_INET_ESP=m CONFIG_INET_IPCOMP=m CONFIG_INET_TUNNEL=m CONFIG_INET_DIAG=y CONFIG_INET_TCP_DIAG=y CONFIG_TCP_CONG_ADVANCED=y # # TCP congestion control # CONFIG_TCP_CONG_BIC=m CONFIG_TCP_CONG_CUBIC=m CONFIG_TCP_CONG_WESTWOOD=m CONFIG_TCP_CONG_HTCP=m CONFIG_TCP_CONG_HSTCP=m CONFIG_TCP_CONG_HYBLA=m CONFIG_TCP_CONG_VEGAS=m CONFIG_TCP_CONG_SCALABLE=m # # IP: Virtual Server Configuration # # CONFIG_IP_VS is not set CONFIG_IPV6=m CONFIG_IPV6_PRIVACY=y CONFIG_INET6_AH=m CONFIG_INET6_ESP=m CONFIG_INET6_IPCOMP=m CONFIG_INET6_TUNNEL=m CONFIG_IPV6_TUNNEL=m CONFIG_NETFILTER=y # CONFIG_NETFILTER_DEBUG is not set CONFIG_BRIDGE_NETFILTER=y # # Core Netfilter Configuration # # CONFIG_NETFILTER_NETLINK is not set # CONFIG_NETFILTER_XTABLES is not set # # IP: Netfilter Configuration # CONFIG_IP_NF_CONNTRACK=m # CONFIG_IP_NF_CT_ACCT is not set CONFIG_IP_NF_CONNTRACK_MARK=y # CONFIG_IP_NF_CONNTRACK_EVENTS is not set CONFIG_IP_NF_CT_PROTO_SCTP=m CONFIG_IP_NF_FTP=m CONFIG_IP_NF_IRC=m # CONFIG_IP_NF_NETBIOS_NS is not set CONFIG_IP_NF_TFTP=m CONFIG_IP_NF_AMANDA=m # CONFIG_IP_NF_PPTP is not set CONFIG_IP_NF_QUEUE=m # # IPv6: Netfilter Configuration (EXPERIMENTAL) # CONFIG_IP6_NF_QUEUE=m # # Bridge: Netfilter Configuration # CONFIG_BRIDGE_NF_EBTABLES=m CONFIG_BRIDGE_EBT_BROUTE=m CONFIG_BRIDGE_EBT_T_FILTER=m CONFIG_BRIDGE_EBT_T_NAT=m CONFIG_BRIDGE_EBT_802_3=m CONFIG_BRIDGE_EBT_AMONG=m CONFIG_BRIDGE_EBT_ARP=m CONFIG_BRIDGE_EBT_IP=m CONFIG_BRIDGE_EBT_LIMIT=m CONFIG_BRIDGE_EBT_MARK=m CONFIG_BRIDGE_EBT_PKTTYPE=m CONFIG_BRIDGE_EBT_STP=m CONFIG_BRIDGE_EBT_VLAN=m CONFIG_BRIDGE_EBT_ARPREPLY=m CONFIG_BRIDGE_EBT_DNAT=m CONFIG_BRIDGE_EBT_MARK_T=m CONFIG_BRIDGE_EBT_REDIRECT=m CONFIG_BRIDGE_EBT_SNAT=m CONFIG_BRIDGE_EBT_LOG=m CONFIG_BRIDGE_EBT_ULOG=m # # DCCP Configuration (EXPERIMENTAL) # # CONFIG_IP_DCCP is not set # # SCTP Configuration (EXPERIMENTAL) # CONFIG_IP_SCTP=m # CONFIG_SCTP_DBG_MSG is not set # CONFIG_SCTP_DBG_OBJCNT is not set CONFIG_SCTP_HMAC_NONE=y # CONFIG_SCTP_HMAC_SHA1 is not set # CONFIG_SCTP_HMAC_MD5 is not set # # TIPC Configuration (EXPERIMENTAL) # # CONFIG_TIPC is not set # CONFIG_ATM is not set CONFIG_BRIDGE=m CONFIG_VLAN_8021Q=m # CONFIG_DECNET is not set CONFIG_LLC=y CONFIG_LLC2=m CONFIG_IPX=m CONFIG_IPX_INTERN=y CONFIG_ATALK=m CONFIG_DEV_APPLETALK=y CONFIG_IPDDP=m CONFIG_IPDDP_ENCAP=y CONFIG_IPDDP_DECAP=y # CONFIG_X25 is not set # CONFIG_LAPB is not set # CONFIG_NET_DIVERT is not set # CONFIG_ECONET is not set # CONFIG_WAN_ROUTER is not set # # QoS and/or fair queueing # CONFIG_NET_SCHED=y CONFIG_NET_SCH_CLK_JIFFIES=y # CONFIG_NET_SCH_CLK_GETTIMEOFDAY is not set # CONFIG_NET_SCH_CLK_CPU is not set # # Queueing/Scheduling # CONFIG_NET_SCH_CBQ=m CONFIG_NET_SCH_HTB=m CONFIG_NET_SCH_HFSC=m CONFIG_NET_SCH_PRIO=m CONFIG_NET_SCH_RED=m CONFIG_NET_SCH_SFQ=m CONFIG_NET_SCH_TEQL=m CONFIG_NET_SCH_TBF=m CONFIG_NET_SCH_GRED=m CONFIG_NET_SCH_DSMARK=m CONFIG_NET_SCH_NETEM=m CONFIG_NET_SCH_INGRESS=m # # Classification # CONFIG_NET_CLS=y CONFIG_NET_CLS_BASIC=m CONFIG_NET_CLS_TCINDEX=m CONFIG_NET_CLS_ROUTE4=m CONFIG_NET_CLS_ROUTE=y CONFIG_NET_CLS_FW=m CONFIG_NET_CLS_U32=m CONFIG_CLS_U32_PERF=y CONFIG_CLS_U32_MARK=y CONFIG_NET_CLS_RSVP=m CONFIG_NET_CLS_RSVP6=m CONFIG_NET_EMATCH=y CONFIG_NET_EMATCH_STACK=32 CONFIG_NET_EMATCH_CMP=m CONFIG_NET_EMATCH_NBYTE=m CONFIG_NET_EMATCH_U32=m CONFIG_NET_EMATCH_META=m CONFIG_NET_EMATCH_TEXT=m CONFIG_NET_CLS_ACT=y CONFIG_NET_ACT_POLICE=m CONFIG_NET_ACT_GACT=m CONFIG_GACT_PROB=y CONFIG_NET_ACT_MIRRED=m CONFIG_NET_ACT_PEDIT=m CONFIG_NET_ACT_SIMP=m CONFIG_NET_CLS_IND=y CONFIG_NET_ESTIMATOR=y # # Network testing # CONFIG_NET_PKTGEN=m # CONFIG_HAMRADIO is not set # CONFIG_IRDA is not set CONFIG_BT=m CONFIG_BT_L2CAP=m CONFIG_BT_SCO=m CONFIG_BT_RFCOMM=m CONFIG_BT_RFCOMM_TTY=y CONFIG_BT_BNEP=m CONFIG_BT_BNEP_MC_FILTER=y CONFIG_BT_BNEP_PROTO_FILTER=y CONFIG_BT_HIDP=m # # Bluetooth device drivers # CONFIG_BT_HCIUSB=m CONFIG_BT_HCIUSB_SCO=y # CONFIG_BT_HCIUART is not set CONFIG_BT_HCIBCM203X=m CONFIG_BT_HCIBPA10X=m CONFIG_BT_HCIBFUSB=m CONFIG_BT_HCIVHCI=m # CONFIG_IEEE80211 is not set # # Device Drivers # # # Generic Driver Options # CONFIG_STANDALONE=y CONFIG_PREVENT_FIRMWARE_BUILD=y CONFIG_FW_LOADER=m # CONFIG_DEBUG_DRIVER is not set # # Connector - unified userspace <-> kernelspace linker # # CONFIG_CONNECTOR is not set # # Memory Technology Devices (MTD) # # CONFIG_MTD is not set # # Parallel port support # CONFIG_PARPORT=m CONFIG_PARPORT_PC=m CONFIG_PARPORT_SERIAL=m CONFIG_PARPORT_PC_FIFO=y CONFIG_PARPORT_PC_SUPERIO=y CONFIG_PARPORT_NOT_PC=y # CONFIG_PARPORT_GSC is not set CONFIG_PARPORT_1284=y # # Plug and Play support # # # Block devices # CONFIG_BLK_DEV_FD=m # CONFIG_PARIDE is not set # CONFIG_BLK_CPQ_DA is not set # CONFIG_BLK_CPQ_CISS_DA is not set # CONFIG_BLK_DEV_DAC960 is not set # CONFIG_BLK_DEV_UMEM is not set # CONFIG_BLK_DEV_COW_COMMON is not set CONFIG_BLK_DEV_LOOP=y CONFIG_BLK_DEV_CRYPTOLOOP=m CONFIG_BLK_DEV_NBD=m # CONFIG_BLK_DEV_SX8 is not set # CONFIG_BLK_DEV_UB is not set CONFIG_BLK_DEV_RAM=y CONFIG_BLK_DEV_RAM_COUNT=16 CONFIG_BLK_DEV_RAM_SIZE=123456 CONFIG_BLK_DEV_INITRD=y CONFIG_CDROM_PKTCDVD=m CONFIG_CDROM_PKTCDVD_BUFFERS=8 CONFIG_CDROM_PKTCDVD_WCACHE=y CONFIG_ATA_OVER_ETH=m # # ATA/ATAPI/MFM/RLL support # CONFIG_IDE=y CONFIG_BLK_DEV_IDE=y # # Please see Documentation/ide.txt for help/info on IDE drives # # CONFIG_BLK_DEV_IDE_SATA is not set CONFIG_BLK_DEV_IDEDISK=y # CONFIG_IDEDISK_MULTI_MODE is not set CONFIG_BLK_DEV_IDECD=m # CONFIG_BLK_DEV_IDETAPE is not set # CONFIG_BLK_DEV_IDEFLOPPY is not set CONFIG_BLK_DEV_IDESCSI=m CONFIG_IDE_TASK_IOCTL=y # # IDE chipset support/bugfixes # CONFIG_IDE_GENERIC=y CONFIG_BLK_DEV_IDEPCI=y CONFIG_IDEPCI_SHARE_IRQ=y # CONFIG_BLK_DEV_OFFBOARD is not set CONFIG_BLK_DEV_GENERIC=y # CONFIG_BLK_DEV_OPTI621 is not set CONFIG_BLK_DEV_SL82C105=y CONFIG_BLK_DEV_IDEDMA_PCI=y CONFIG_BLK_DEV_IDEDMA_FORCED=y CONFIG_IDEDMA_PCI_AUTO=y # CONFIG_IDEDMA_ONLYDISK is not set # CONFIG_BLK_DEV_AEC62XX is not set # CONFIG_BLK_DEV_ALI15X3 is not set CONFIG_BLK_DEV_AMD74XX=y # CONFIG_BLK_DEV_CMD64X is not set # CONFIG_BLK_DEV_TRIFLEX is not set # CONFIG_BLK_DEV_CY82C693 is not set # CONFIG_BLK_DEV_CS5520 is not set # CONFIG_BLK_DEV_CS5530 is not set # CONFIG_BLK_DEV_HPT34X is not set # CONFIG_BLK_DEV_HPT366 is not set # CONFIG_BLK_DEV_SC1200 is not set # CONFIG_BLK_DEV_PIIX is not set CONFIG_BLK_DEV_IT821X=m # CONFIG_BLK_DEV_NS87415 is not set CONFIG_BLK_DEV_PDC202XX_OLD=y CONFIG_PDC202XX_BURST=y CONFIG_BLK_DEV_PDC202XX_NEW=y # CONFIG_PDC202XX_FORCE is not set # CONFIG_BLK_DEV_SVWKS is not set CONFIG_BLK_DEV_SIIMAGE=y # CONFIG_BLK_DEV_SLC90E66 is not set # CONFIG_BLK_DEV_TRM290 is not set # CONFIG_BLK_DEV_VIA82CXXX is not set CONFIG_BLK_DEV_IDE_PMAC=y CONFIG_BLK_DEV_IDE_PMAC_ATA100FIRST=y CONFIG_BLK_DEV_IDEDMA_PMAC=y # CONFIG_BLK_DEV_IDE_PMAC_BLINK is not set # CONFIG_IDE_ARM is not set CONFIG_BLK_DEV_IDEDMA=y # CONFIG_IDEDMA_IVB is not set CONFIG_IDEDMA_AUTO=y # CONFIG_BLK_DEV_HD is not set # # SCSI device support # # CONFIG_RAID_ATTRS is not set CONFIG_SCSI=m CONFIG_SCSI_PROC_FS=y # # SCSI support type (disk, tape, CD-ROM) # CONFIG_BLK_DEV_SD=m CONFIG_CHR_DEV_ST=m # CONFIG_CHR_DEV_OSST is not set CONFIG_BLK_DEV_SR=m CONFIG_BLK_DEV_SR_VENDOR=y CONFIG_CHR_DEV_SG=m CONFIG_CHR_DEV_SCH=m # # Some SCSI devices (e.g. CD jukebox) support multiple LUNs # CONFIG_SCSI_MULTI_LUN=y CONFIG_SCSI_CONSTANTS=y CONFIG_SCSI_LOGGING=y # # SCSI Transport Attributes # CONFIG_SCSI_SPI_ATTRS=m CONFIG_SCSI_FC_ATTRS=m CONFIG_SCSI_ISCSI_ATTRS=m # CONFIG_SCSI_SAS_ATTRS is not set # # SCSI low-level drivers # CONFIG_ISCSI_TCP=m # CONFIG_BLK_DEV_3W_XXXX_RAID is not set # CONFIG_SCSI_3W_9XXX is not set # CONFIG_SCSI_ACARD is not set # CONFIG_SCSI_AACRAID is not set # CONFIG_SCSI_AIC7XXX is not set # CONFIG_SCSI_AIC7XXX_OLD is not set # CONFIG_SCSI_AIC79XX is not set # CONFIG_MEGARAID_NEWGEN is not set # CONFIG_MEGARAID_LEGACY is not set # CONFIG_MEGARAID_SAS is not set CONFIG_SCSI_SATA=m CONFIG_SCSI_SATA_AHCI=m CONFIG_SCSI_SATA_SVW=m # CONFIG_SCSI_ATA_PIIX is not set # CONFIG_SCSI_SATA_MV is not set # CONFIG_SCSI_SATA_NV is not set # CONFIG_SCSI_PDC_ADMA is not set # CONFIG_SCSI_SATA_QSTOR is not set # CONFIG_SCSI_SATA_PROMISE is not set # CONFIG_SCSI_SATA_SX4 is not set # CONFIG_SCSI_SATA_SIL is not set # CONFIG_SCSI_SATA_SIL24 is not set # CONFIG_SCSI_SATA_SIS is not set # CONFIG_SCSI_SATA_ULI is not set # CONFIG_SCSI_SATA_VIA is not set CONFIG_SCSI_SATA_VITESSE=m CONFIG_SCSI_SATA_INTEL_COMBINED=y # CONFIG_SCSI_BUSLOGIC is not set # CONFIG_SCSI_DMX3191D is not set # CONFIG_SCSI_EATA is not set # CONFIG_SCSI_FUTURE_DOMAIN is not set # CONFIG_SCSI_GDTH is not set # CONFIG_SCSI_IPS is not set CONFIG_SCSI_IBMVSCSI=m # CONFIG_SCSI_INITIO is not set # CONFIG_SCSI_INIA100 is not set # CONFIG_SCSI_PPA is not set # CONFIG_SCSI_IMM is not set CONFIG_SCSI_SYM53C8XX_2=m CONFIG_SCSI_SYM53C8XX_DMA_ADDRESSING_MODE=0 CONFIG_SCSI_SYM53C8XX_DEFAULT_TAGS=16 CONFIG_SCSI_SYM53C8XX_MAX_TAGS=64 # CONFIG_SCSI_SYM53C8XX_IOMAPPED is not set CONFIG_SCSI_IPR=m CONFIG_SCSI_IPR_TRACE=y CONFIG_SCSI_IPR_DUMP=y # CONFIG_SCSI_QLOGIC_FC is not set # CONFIG_SCSI_QLOGIC_1280 is not set CONFIG_SCSI_QLA_FC=m # CONFIG_SCSI_QLA2XXX_EMBEDDED_FIRMWARE is not set CONFIG_SCSI_LPFC=m # CONFIG_SCSI_DC395x is not set # CONFIG_SCSI_DC390T is not set CONFIG_SCSI_DEBUG=m # # Multi-device support (RAID and LVM) # CONFIG_MD=y CONFIG_BLK_DEV_MD=y CONFIG_MD_LINEAR=m CONFIG_MD_RAID0=m CONFIG_MD_RAID1=m CONFIG_MD_RAID10=m CONFIG_MD_RAID5=m CONFIG_MD_RAID6=m CONFIG_MD_MULTIPATH=m CONFIG_MD_FAULTY=m CONFIG_BLK_DEV_DM=m CONFIG_DM_CRYPT=m CONFIG_DM_SNAPSHOT=m CONFIG_DM_MIRROR=m CONFIG_DM_ZERO=m CONFIG_DM_MULTIPATH=m CONFIG_DM_MULTIPATH_EMC=m # # Fusion MPT device support # # CONFIG_FUSION is not set # CONFIG_FUSION_SPI is not set # CONFIG_FUSION_FC is not set # CONFIG_FUSION_SAS is not set # # IEEE 1394 (FireWire) support # CONFIG_IEEE1394=m # # Subsystem Options # # CONFIG_IEEE1394_VERBOSEDEBUG is not set # CONFIG_IEEE1394_OUI_DB is not set CONFIG_IEEE1394_EXTRA_CONFIG_ROMS=y CONFIG_IEEE1394_CONFIG_ROM_IP1394=y CONFIG_IEEE1394_EXPORT_FULL_API=y # # Device Drivers # # CONFIG_IEEE1394_PCILYNX is not set CONFIG_IEEE1394_OHCI1394=m # # Protocol Drivers # CONFIG_IEEE1394_VIDEO1394=m CONFIG_IEEE1394_SBP2=m # CONFIG_IEEE1394_SBP2_PHYS_DMA is not set CONFIG_IEEE1394_ETH1394=m CONFIG_IEEE1394_DV1394=m CONFIG_IEEE1394_RAWIO=m # # I2O device support # # CONFIG_I2O is not set # # Macintosh device drivers # CONFIG_ADB_PMU=y CONFIG_PMAC_SMU=y CONFIG_THERM_PM72=y # CONFIG_WINDFARM is not set # # Network device support # CONFIG_NETDEVICES=y # CONFIG_IFB is not set CONFIG_DUMMY=m CONFIG_BONDING=m CONFIG_EQUALIZER=m CONFIG_TUN=m # # ARCnet devices # # CONFIG_ARCNET is not set # # PHY device support # # CONFIG_PHYLIB is not set # # Ethernet (10 or 100Mbit) # CONFIG_NET_ETHERNET=y CONFIG_MII=m # CONFIG_HAPPYMEAL is not set CONFIG_SUNGEM=m # CONFIG_CASSINI is not set CONFIG_NET_VENDOR_3COM=y CONFIG_VORTEX=m CONFIG_TYPHOON=m # # Tulip family network device support # CONFIG_NET_TULIP=y # CONFIG_DE2104X is not set CONFIG_TULIP=m CONFIG_TULIP_MWI=y CONFIG_TULIP_MMIO=y CONFIG_TULIP_NAPI=y CONFIG_TULIP_NAPI_HW_MITIGATION=y CONFIG_DE4X5=m CONFIG_WINBOND_840=m CONFIG_DM9102=m # CONFIG_ULI526X is not set # CONFIG_HP100 is not set CONFIG_IBMVETH=m CONFIG_NET_PCI=y CONFIG_PCNET32=m CONFIG_AMD8111_ETH=m CONFIG_AMD8111E_NAPI=y # CONFIG_ADAPTEC_STARFIRE is not set # CONFIG_B44 is not set # CONFIG_FORCEDETH is not set # CONFIG_DGRS is not set # CONFIG_EEPRO100 is not set CONFIG_E100=m # CONFIG_FEALNX is not set # CONFIG_NATSEMI is not set # CONFIG_NE2K_PCI is not set # CONFIG_8139CP is not set # CONFIG_8139TOO is not set # CONFIG_SIS900 is not set # CONFIG_EPIC100 is not set # CONFIG_SUNDANCE is not set # CONFIG_VIA_RHINE is not set # CONFIG_NET_POCKET is not set # # Ethernet (1000 Mbit) # CONFIG_ACENIC=m CONFIG_ACENIC_OMIT_TIGON_I=y # CONFIG_DL2K is not set CONFIG_E1000=y CONFIG_E1000_NAPI=y # CONFIG_E1000_DISABLE_PACKET_SPLIT is not set # CONFIG_NS83820 is not set # CONFIG_HAMACHI is not set # CONFIG_YELLOWFIN is not set CONFIG_R8169=m CONFIG_R8169_NAPI=y CONFIG_R8169_VLAN=y # CONFIG_SIS190 is not set # CONFIG_SKGE is not set # CONFIG_SKY2 is not set # CONFIG_SK98LIN is not set # CONFIG_VIA_VELOCITY is not set CONFIG_TIGON3=m # CONFIG_BNX2 is not set # CONFIG_MV643XX_ETH is not set # # Ethernet (10000 Mbit) # # CONFIG_CHELSIO_T1 is not set CONFIG_IXGB=m CONFIG_IXGB_NAPI=y CONFIG_S2IO=m CONFIG_S2IO_NAPI=y # # Token Ring devices # CONFIG_TR=y CONFIG_IBMOL=m # CONFIG_3C359 is not set # CONFIG_TMS380TR is not set # # Wireless LAN (non-hamradio) # # CONFIG_NET_RADIO is not set # # Wan interfaces # # CONFIG_WAN is not set # CONFIG_FDDI is not set # CONFIG_HIPPI is not set # CONFIG_PLIP is not set CONFIG_PPP=m CONFIG_PPP_MULTILINK=y CONFIG_PPP_FILTER=y CONFIG_PPP_ASYNC=m CONFIG_PPP_SYNC_TTY=m CONFIG_PPP_DEFLATE=m CONFIG_PPP_BSDCOMP=m CONFIG_PPP_MPPE=m CONFIG_PPPOE=m CONFIG_SLIP=m CONFIG_SLIP_COMPRESSED=y CONFIG_SLIP_SMART=y # CONFIG_SLIP_MODE_SLIP6 is not set CONFIG_NET_FC=y CONFIG_SHAPER=m CONFIG_NETCONSOLE=m CONFIG_NETPOLL=y CONFIG_NETPOLL_RX=y CONFIG_NETPOLL_TRAP=y CONFIG_NET_POLL_CONTROLLER=y # # ISDN subsystem # # CONFIG_ISDN is not set # # Telephony Support # # CONFIG_PHONE is not set # # Input device support # CONFIG_INPUT=y # # Userland interfaces # CONFIG_INPUT_MOUSEDEV=y # CONFIG_INPUT_MOUSEDEV_PSAUX is not set CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024 CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768 CONFIG_INPUT_JOYDEV=m CONFIG_INPUT_TSDEV=m CONFIG_INPUT_TSDEV_SCREEN_X=240 CONFIG_INPUT_TSDEV_SCREEN_Y=320 CONFIG_INPUT_EVDEV=y CONFIG_INPUT_EVBUG=m # # Input Device Drivers # CONFIG_INPUT_KEYBOARD=y CONFIG_KEYBOARD_ATKBD=y # CONFIG_KEYBOARD_SUNKBD is not set # CONFIG_KEYBOARD_LKKBD is not set # CONFIG_KEYBOARD_XTKBD is not set # CONFIG_KEYBOARD_NEWTON is not set CONFIG_INPUT_MOUSE=y CONFIG_MOUSE_PS2=y CONFIG_MOUSE_SERIAL=m # CONFIG_MOUSE_VSXXXAA is not set CONFIG_INPUT_JOYSTICK=y # CONFIG_JOYSTICK_ANALOG is not set # CONFIG_JOYSTICK_A3D is not set # CONFIG_JOYSTICK_ADI is not set # CONFIG_JOYSTICK_COBRA is not set # CONFIG_JOYSTICK_GF2K is not set # CONFIG_JOYSTICK_GRIP is not set # CONFIG_JOYSTICK_GRIP_MP is not set # CONFIG_JOYSTICK_GUILLEMOT is not set # CONFIG_JOYSTICK_INTERACT is not set # CONFIG_JOYSTICK_SIDEWINDER is not set # CONFIG_JOYSTICK_TMDC is not set CONFIG_JOYSTICK_IFORCE=m CONFIG_JOYSTICK_IFORCE_USB=y CONFIG_JOYSTICK_IFORCE_232=y CONFIG_JOYSTICK_WARRIOR=m CONFIG_JOYSTICK_MAGELLAN=m CONFIG_JOYSTICK_SPACEORB=m CONFIG_JOYSTICK_SPACEBALL=m CONFIG_JOYSTICK_STINGER=m CONFIG_JOYSTICK_TWIDJOY=m # CONFIG_JOYSTICK_DB9 is not set # CONFIG_JOYSTICK_GAMECON is not set # CONFIG_JOYSTICK_TURBOGRAFX is not set CONFIG_JOYSTICK_JOYDUMP=m CONFIG_INPUT_TOUCHSCREEN=y # CONFIG_TOUCHSCREEN_GUNZE is not set # CONFIG_TOUCHSCREEN_ELO is not set CONFIG_TOUCHSCREEN_MTOUCH=m # CONFIG_TOUCHSCREEN_MK712 is not set CONFIG_INPUT_MISC=y CONFIG_INPUT_PCSPKR=m CONFIG_INPUT_UINPUT=m # # Hardware I/O ports # CONFIG_SERIO=y CONFIG_SERIO_I8042=y CONFIG_SERIO_SERPORT=m # CONFIG_SERIO_PARKBD is not set # CONFIG_SERIO_PCIPS2 is not set CONFIG_SERIO_LIBPS2=y CONFIG_SERIO_RAW=m CONFIG_GAMEPORT=m # CONFIG_GAMEPORT_NS558 is not set # CONFIG_GAMEPORT_L4 is not set # CONFIG_GAMEPORT_EMU10K1 is not set # CONFIG_GAMEPORT_FM801 is not set # # Character devices # CONFIG_VT=y CONFIG_VT_CONSOLE=y CONFIG_HW_CONSOLE=y # CONFIG_SERIAL_NONSTANDARD is not set # # Serial drivers # CONFIG_SERIAL_8250=y CONFIG_SERIAL_8250_CONSOLE=y CONFIG_SERIAL_8250_NR_UARTS=4 CONFIG_SERIAL_8250_RUNTIME_UARTS=4 # CONFIG_SERIAL_8250_EXTENDED is not set # # Non-8250 serial port support # CONFIG_SERIAL_CORE=y CONFIG_SERIAL_CORE_CONSOLE=y CONFIG_SERIAL_PMACZILOG=y CONFIG_SERIAL_PMACZILOG_CONSOLE=y CONFIG_SERIAL_ICOM=m CONFIG_UNIX98_PTYS=y CONFIG_LEGACY_PTYS=y CONFIG_LEGACY_PTY_COUNT=256 CONFIG_PRINTER=m # CONFIG_LP_CONSOLE is not set # CONFIG_PPDEV is not set # CONFIG_TIPAR is not set CONFIG_HVC_CONSOLE=y CONFIG_HVCS=m # # IPMI # # CONFIG_IPMI_HANDLER is not set # # Watchdog Cards # CONFIG_WATCHDOG=y # CONFIG_WATCHDOG_NOWAYOUT is not set # # Watchdog Device Drivers # CONFIG_SOFT_WATCHDOG=m CONFIG_WATCHDOG_RTAS=m # # PCI-based Watchdog Cards # # CONFIG_PCIPCWATCHDOG is not set # CONFIG_WDTPCI is not set # # USB-based Watchdog Cards # # CONFIG_USBPCWATCHDOG is not set # CONFIG_RTC is not set # CONFIG_GEN_RTC is not set # CONFIG_DTLK is not set # CONFIG_R3964 is not set # CONFIG_APPLICOM is not set # # Ftape, the floppy tape device driver # CONFIG_AGP=m CONFIG_AGP_UNINORTH=m CONFIG_DRM=m # CONFIG_DRM_TDFX is not set CONFIG_DRM_R128=m CONFIG_DRM_RADEON=m # CONFIG_DRM_MGA is not set # CONFIG_DRM_SIS is not set # CONFIG_DRM_VIA is not set # CONFIG_DRM_SAVAGE is not set CONFIG_RAW_DRIVER=m CONFIG_MAX_RAW_DEVS=4096 # CONFIG_HANGCHECK_TIMER is not set # # TPM devices # # CONFIG_TCG_TPM is not set # CONFIG_TELCLOCK is not set # # I2C support # CONFIG_I2C=y CONFIG_I2C_CHARDEV=m # # I2C Algorithms # CONFIG_I2C_ALGOBIT=y # CONFIG_I2C_ALGOPCF is not set # CONFIG_I2C_ALGOPCA is not set # # I2C Hardware Bus support # # CONFIG_I2C_ALI1535 is not set # CONFIG_I2C_ALI1563 is not set # CONFIG_I2C_ALI15X3 is not set # CONFIG_I2C_AMD756 is not set # CONFIG_I2C_AMD8111 is not set # CONFIG_I2C_I801 is not set # CONFIG_I2C_I810 is not set # CONFIG_I2C_PIIX4 is not set CONFIG_I2C_POWERMAC=y # CONFIG_I2C_NFORCE2 is not set # CONFIG_I2C_PARPORT is not set # CONFIG_I2C_PARPORT_LIGHT is not set # CONFIG_I2C_PROSAVAGE is not set # CONFIG_I2C_SAVAGE4 is not set # CONFIG_SCx200_ACB is not set # CONFIG_I2C_SIS5595 is not set # CONFIG_I2C_SIS630 is not set # CONFIG_I2C_SIS96X is not set # CONFIG_I2C_STUB is not set # CONFIG_I2C_VIA is not set # CONFIG_I2C_VIAPRO is not set # CONFIG_I2C_VOODOO3 is not set # CONFIG_I2C_PCA_ISA is not set # # Miscellaneous I2C Chip support # # CONFIG_SENSORS_DS1337 is not set # CONFIG_SENSORS_DS1374 is not set # CONFIG_SENSORS_EEPROM is not set # CONFIG_SENSORS_PCF8574 is not set # CONFIG_SENSORS_PCA9539 is not set # CONFIG_SENSORS_PCF8591 is not set # CONFIG_SENSORS_RTC8564 is not set # CONFIG_SENSORS_MAX6875 is not set # CONFIG_RTC_X1205_I2C is not set # CONFIG_I2C_DEBUG_CORE is not set # CONFIG_I2C_DEBUG_ALGO is not set # CONFIG_I2C_DEBUG_BUS is not set # CONFIG_I2C_DEBUG_CHIP is not set # # SPI support # # CONFIG_SPI is not set # CONFIG_SPI_MASTER is not set # # Dallas's 1-wire bus # # CONFIG_W1 is not set # # Hardware Monitoring support # # CONFIG_HWMON is not set # CONFIG_HWMON_VID is not set # # Misc devices # # # Multimedia Capabilities Port drivers # # # Multimedia devices # CONFIG_VIDEO_DEV=m # # Video For Linux # # # Video Adapters # # CONFIG_VIDEO_ADV_DEBUG is not set CONFIG_VIDEO_BT848=m # CONFIG_VIDEO_SAA6588 is not set # CONFIG_VIDEO_BWQCAM is not set # CONFIG_VIDEO_CQCAM is not set # CONFIG_VIDEO_W9966 is not set # CONFIG_VIDEO_CPIA is not set # CONFIG_VIDEO_SAA5246A is not set # CONFIG_VIDEO_SAA5249 is not set # CONFIG_TUNER_3036 is not set # CONFIG_VIDEO_STRADIS is not set # CONFIG_VIDEO_ZORAN is not set # CONFIG_VIDEO_SAA7134 is not set # CONFIG_VIDEO_MXB is not set # CONFIG_VIDEO_DPC is not set # CONFIG_VIDEO_HEXIUM_ORION is not set # CONFIG_VIDEO_HEXIUM_GEMINI is not set # CONFIG_VIDEO_CX88 is not set # CONFIG_VIDEO_EM28XX is not set # CONFIG_VIDEO_OVCAMCHIP is not set # CONFIG_VIDEO_AUDIO_DECODER is not set # CONFIG_VIDEO_DECODER is not set # # Radio Adapters # # CONFIG_RADIO_GEMTEK_PCI is not set # CONFIG_RADIO_MAXIRADIO is not set # CONFIG_RADIO_MAESTRO is not set # # Digital Video Broadcasting Devices # # CONFIG_DVB is not set CONFIG_VIDEO_TUNER=m CONFIG_VIDEO_BUF=m CONFIG_VIDEO_BTCX=m CONFIG_VIDEO_IR=m CONFIG_VIDEO_TVEEPROM=m # # Graphics support # CONFIG_FB=y CONFIG_FB_CFB_FILLRECT=y CONFIG_FB_CFB_COPYAREA=y CONFIG_FB_CFB_IMAGEBLIT=y CONFIG_FB_MACMODES=y CONFIG_FB_MODE_HELPERS=y CONFIG_FB_TILEBLITTING=y # CONFIG_FB_CIRRUS is not set # CONFIG_FB_PM2 is not set # CONFIG_FB_CYBER2000 is not set CONFIG_FB_OF=y # CONFIG_FB_CONTROL is not set # CONFIG_FB_PLATINUM is not set # CONFIG_FB_VALKYRIE is not set # CONFIG_FB_CT65550 is not set # CONFIG_FB_ASILIANT is not set # CONFIG_FB_IMSTT is not set # CONFIG_FB_VGA16 is not set # CONFIG_FB_S1D13XXX is not set # CONFIG_FB_NVIDIA is not set # CONFIG_FB_RIVA is not set CONFIG_FB_MATROX=y CONFIG_FB_MATROX_MILLENIUM=y CONFIG_FB_MATROX_MYSTIQUE=y CONFIG_FB_MATROX_G=y CONFIG_FB_MATROX_I2C=m CONFIG_FB_MATROX_MAVEN=m CONFIG_FB_MATROX_MULTIHEAD=y # CONFIG_FB_RADEON_OLD is not set CONFIG_FB_RADEON=y CONFIG_FB_RADEON_I2C=y # CONFIG_FB_RADEON_DEBUG is not set # CONFIG_FB_ATY128 is not set # CONFIG_FB_ATY is not set # CONFIG_FB_SAVAGE is not set # CONFIG_FB_SIS is not set # CONFIG_FB_NEOMAGIC is not set # CONFIG_FB_KYRO is not set # CONFIG_FB_3DFX is not set # CONFIG_FB_VOODOO1 is not set # CONFIG_FB_TRIDENT is not set # CONFIG_FB_VIRTUAL is not set # # Console display driver support # # CONFIG_VGA_CONSOLE is not set CONFIG_DUMMY_CONSOLE=y CONFIG_FRAMEBUFFER_CONSOLE=y # CONFIG_FRAMEBUFFER_CONSOLE_ROTATION is not set # CONFIG_FONTS is not set CONFIG_FONT_8x8=y CONFIG_FONT_8x16=y # # Logo configuration # CONFIG_LOGO=y # CONFIG_LOGO_LINUX_MONO is not set CONFIG_LOGO_LINUX_VGA16=y # CONFIG_LOGO_LINUX_CLUT224 is not set CONFIG_BACKLIGHT_LCD_SUPPORT=y CONFIG_BACKLIGHT_CLASS_DEVICE=m CONFIG_BACKLIGHT_DEVICE=y CONFIG_LCD_CLASS_DEVICE=m CONFIG_LCD_DEVICE=y # # Sound # CONFIG_SOUND=m # # Advanced Linux Sound Architecture # CONFIG_SND=m CONFIG_SND_TIMER=m CONFIG_SND_PCM=m CONFIG_SND_HWDEP=m CONFIG_SND_RAWMIDI=m CONFIG_SND_SEQUENCER=m CONFIG_SND_SEQ_DUMMY=m CONFIG_SND_OSSEMUL=y CONFIG_SND_MIXER_OSS=m CONFIG_SND_PCM_OSS=m CONFIG_SND_SEQUENCER_OSS=y # CONFIG_SND_DYNAMIC_MINORS is not set CONFIG_SND_SUPPORT_OLD_API=y CONFIG_SND_VERBOSE_PRINTK=y CONFIG_SND_DEBUG=y # CONFIG_SND_DEBUG_DETECT is not set # # Generic devices # CONFIG_SND_MPU401_UART=m CONFIG_SND_DUMMY=m CONFIG_SND_VIRMIDI=m CONFIG_SND_MTPAV=m CONFIG_SND_SERIAL_U16550=m CONFIG_SND_MPU401=m # # PCI devices # # CONFIG_SND_AD1889 is not set # CONFIG_SND_ALS4000 is not set # CONFIG_SND_ALI5451 is not set # CONFIG_SND_ATIIXP is not set # CONFIG_SND_ATIIXP_MODEM is not set # CONFIG_SND_AU8810 is not set # CONFIG_SND_AU8820 is not set # CONFIG_SND_AU8830 is not set # CONFIG_SND_AZT3328 is not set # CONFIG_SND_BT87X is not set # CONFIG_SND_CA0106 is not set # CONFIG_SND_CMIPCI is not set # CONFIG_SND_CS4281 is not set # CONFIG_SND_CS46XX is not set # CONFIG_SND_EMU10K1 is not set # CONFIG_SND_EMU10K1X is not set # CONFIG_SND_ENS1370 is not set # CONFIG_SND_ENS1371 is not set # CONFIG_SND_ES1938 is not set # CONFIG_SND_ES1968 is not set # CONFIG_SND_FM801 is not set # CONFIG_SND_HDA_INTEL is not set # CONFIG_SND_HDSP is not set # CONFIG_SND_HDSPM is not set # CONFIG_SND_ICE1712 is not set # CONFIG_SND_ICE1724 is not set # CONFIG_SND_INTEL8X0 is not set # CONFIG_SND_INTEL8X0M is not set # CONFIG_SND_KORG1212 is not set # CONFIG_SND_MAESTRO3 is not set # CONFIG_SND_MIXART is not set # CONFIG_SND_NM256 is not set # CONFIG_SND_PCXHR is not set # CONFIG_SND_RME32 is not set # CONFIG_SND_RME96 is not set # CONFIG_SND_RME9652 is not set # CONFIG_SND_SONICVIBES is not set # CONFIG_SND_TRIDENT is not set # CONFIG_SND_VIA82XX is not set # CONFIG_SND_VIA82XX_MODEM is not set # CONFIG_SND_VX222 is not set # CONFIG_SND_YMFPCI is not set # # ALSA PowerMac devices # CONFIG_SND_POWERMAC=m CONFIG_SND_POWERMAC_AUTO_DRC=y # # USB devices # CONFIG_SND_USB_AUDIO=m CONFIG_SND_USB_USX2Y=m # # Open Sound System # # CONFIG_SOUND_PRIME is not set # # USB support # CONFIG_USB_ARCH_HAS_HCD=y CONFIG_USB_ARCH_HAS_OHCI=y CONFIG_USB=y # CONFIG_USB_DEBUG is not set # # Miscellaneous USB options # CONFIG_USB_DEVICEFS=y CONFIG_USB_BANDWIDTH=y # CONFIG_USB_DYNAMIC_MINORS is not set # CONFIG_USB_OTG is not set # # USB Host Controller Drivers # CONFIG_USB_EHCI_HCD=y CONFIG_USB_EHCI_SPLIT_ISO=y CONFIG_USB_EHCI_ROOT_HUB_TT=y # CONFIG_USB_ISP116X_HCD is not set CONFIG_USB_OHCI_HCD=y # CONFIG_USB_OHCI_BIG_ENDIAN is not set CONFIG_USB_OHCI_LITTLE_ENDIAN=y CONFIG_USB_UHCI_HCD=m # CONFIG_USB_SL811_HCD is not set # # USB Device Class drivers # # CONFIG_OBSOLETE_OSS_USB_DRIVER is not set # CONFIG_USB_ACM is not set # CONFIG_USB_PRINTER is not set # # NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' # # # may also be needed; see USB_STORAGE Help for more information # CONFIG_USB_STORAGE=m # CONFIG_USB_STORAGE_DEBUG is not set CONFIG_USB_STORAGE_DATAFAB=y CONFIG_USB_STORAGE_FREECOM=y CONFIG_USB_STORAGE_ISD200=y CONFIG_USB_STORAGE_DPCM=y CONFIG_USB_STORAGE_USBAT=y CONFIG_USB_STORAGE_SDDR09=y CONFIG_USB_STORAGE_SDDR55=y CONFIG_USB_STORAGE_JUMPSHOT=y # CONFIG_USB_STORAGE_ALAUDA is not set CONFIG_USB_STORAGE_ONETOUCH=y # CONFIG_USB_LIBUSUAL is not set # # USB Input Devices # CONFIG_USB_HID=y CONFIG_USB_HIDINPUT=y # CONFIG_USB_HIDINPUT_POWERBOOK is not set CONFIG_HID_FF=y CONFIG_HID_PID=y CONFIG_LOGITECH_FF=y CONFIG_THRUSTMASTER_FF=y CONFIG_USB_HIDDEV=y # CONFIG_USB_AIPTEK is not set # CONFIG_USB_WACOM is not set # CONFIG_USB_ACECAD is not set # CONFIG_USB_KBTAB is not set # CONFIG_USB_POWERMATE is not set # CONFIG_USB_MTOUCH is not set # CONFIG_USB_ITMTOUCH is not set # CONFIG_USB_EGALAX is not set # CONFIG_USB_YEALINK is not set # CONFIG_USB_XPAD is not set CONFIG_USB_ATI_REMOTE=m # CONFIG_USB_ATI_REMOTE2 is not set CONFIG_USB_KEYSPAN_REMOTE=m # CONFIG_USB_APPLETOUCH is not set # # USB Imaging devices # CONFIG_USB_MDC800=m CONFIG_USB_MICROTEK=m # # USB Multimedia devices # CONFIG_USB_DABUSB=m CONFIG_USB_VICAM=m CONFIG_USB_DSBR=m CONFIG_USB_IBMCAM=m CONFIG_USB_KONICAWC=m CONFIG_USB_OV511=m CONFIG_USB_SE401=m CONFIG_USB_SN9C102=m CONFIG_USB_STV680=m CONFIG_USB_PWC=m # # USB Network Adapters # CONFIG_USB_CATC=m CONFIG_USB_KAWETH=m CONFIG_USB_PEGASUS=m CONFIG_USB_RTL8150=m CONFIG_USB_USBNET=m CONFIG_USB_NET_AX8817X=m CONFIG_USB_NET_CDCETHER=m # CONFIG_USB_NET_GL620A is not set CONFIG_USB_NET_NET1080=m # CONFIG_USB_NET_PLUSB is not set # CONFIG_USB_NET_RNDIS_HOST is not set # CONFIG_USB_NET_CDC_SUBSET is not set CONFIG_USB_NET_ZAURUS=m # CONFIG_USB_MON is not set # # USB port drivers # CONFIG_USB_USS720=m # # USB Serial Converter support # CONFIG_USB_SERIAL=m CONFIG_USB_SERIAL_GENERIC=y CONFIG_USB_SERIAL_AIRPRIME=m # CONFIG_USB_SERIAL_ANYDATA is not set CONFIG_USB_SERIAL_BELKIN=m # CONFIG_USB_SERIAL_WHITEHEAT is not set CONFIG_USB_SERIAL_DIGI_ACCELEPORT=m CONFIG_USB_SERIAL_CP2101=m CONFIG_USB_SERIAL_CYPRESS_M8=m CONFIG_USB_SERIAL_EMPEG=m CONFIG_USB_SERIAL_FTDI_SIO=m CONFIG_USB_SERIAL_VISOR=m CONFIG_USB_SERIAL_IPAQ=m CONFIG_USB_SERIAL_IR=m CONFIG_USB_SERIAL_EDGEPORT=m CONFIG_USB_SERIAL_EDGEPORT_TI=m CONFIG_USB_SERIAL_GARMIN=m CONFIG_USB_SERIAL_IPW=m CONFIG_USB_SERIAL_KEYSPAN_PDA=m CONFIG_USB_SERIAL_KEYSPAN=m CONFIG_USB_SERIAL_KEYSPAN_MPR=y CONFIG_USB_SERIAL_KEYSPAN_USA28=y CONFIG_USB_SERIAL_KEYSPAN_USA28X=y CONFIG_USB_SERIAL_KEYSPAN_USA28XA=y CONFIG_USB_SERIAL_KEYSPAN_USA28XB=y CONFIG_USB_SERIAL_KEYSPAN_USA19=y CONFIG_USB_SERIAL_KEYSPAN_USA18X=y CONFIG_USB_SERIAL_KEYSPAN_USA19W=y CONFIG_USB_SERIAL_KEYSPAN_USA19QW=y CONFIG_USB_SERIAL_KEYSPAN_USA19QI=y CONFIG_USB_SERIAL_KEYSPAN_USA49W=y CONFIG_USB_SERIAL_KEYSPAN_USA49WLC=y CONFIG_USB_SERIAL_KLSI=m CONFIG_USB_SERIAL_KOBIL_SCT=m CONFIG_USB_SERIAL_MCT_U232=m CONFIG_USB_SERIAL_PL2303=m CONFIG_USB_SERIAL_HP4X=m CONFIG_USB_SERIAL_SAFE=m CONFIG_USB_SERIAL_SAFE_PADDED=y CONFIG_USB_SERIAL_TI=m CONFIG_USB_SERIAL_CYBERJACK=m CONFIG_USB_SERIAL_XIRCOM=m CONFIG_USB_SERIAL_OMNINET=m CONFIG_USB_EZUSB=y # # USB Miscellaneous drivers # CONFIG_USB_EMI62=m CONFIG_USB_EMI26=m CONFIG_USB_AUERSWALD=m CONFIG_USB_RIO500=m CONFIG_USB_LEGOTOWER=m CONFIG_USB_LCD=m CONFIG_USB_LED=m CONFIG_USB_CYTHERM=m CONFIG_USB_PHIDGETKIT=m CONFIG_USB_PHIDGETSERVO=m CONFIG_USB_IDMOUSE=m CONFIG_USB_SISUSBVGA=m # CONFIG_USB_SISUSBVGA_CON is not set CONFIG_USB_LD=m # CONFIG_USB_TEST is not set # # USB DSL modem support # # # USB Gadget Support # # CONFIG_USB_GADGET is not set # # MMC/SD Card support # # CONFIG_MMC is not set # # InfiniBand support # CONFIG_INFINIBAND=m # CONFIG_INFINIBAND_USER_MAD is not set # CONFIG_INFINIBAND_USER_ACCESS is not set CONFIG_INFINIBAND_MTHCA=m # CONFIG_INFINIBAND_MTHCA_DEBUG is not set CONFIG_INFINIBAND_IPOIB=m # CONFIG_INFINIBAND_IPOIB_DEBUG is not set # CONFIG_INFINIBAND_SRP is not set # # SN Devices # # # EDAC - error detection and reporting (RAS) # # # File systems # CONFIG_EXT2_FS=y CONFIG_EXT2_FS_XATTR=y CONFIG_EXT2_FS_POSIX_ACL=y CONFIG_EXT2_FS_SECURITY=y CONFIG_EXT2_FS_XIP=y CONFIG_FS_XIP=y CONFIG_EXT3_FS=y CONFIG_EXT3_FS_XATTR=y CONFIG_EXT3_FS_POSIX_ACL=y CONFIG_EXT3_FS_SECURITY=y CONFIG_JBD=y # CONFIG_JBD_DEBUG is not set CONFIG_FS_MBCACHE=y CONFIG_REISERFS_FS=y # CONFIG_REISERFS_CHECK is not set CONFIG_REISERFS_PROC_INFO=y CONFIG_REISERFS_FS_XATTR=y CONFIG_REISERFS_FS_POSIX_ACL=y CONFIG_REISERFS_FS_SECURITY=y CONFIG_JFS_FS=m CONFIG_JFS_POSIX_ACL=y CONFIG_JFS_SECURITY=y # CONFIG_JFS_DEBUG is not set CONFIG_JFS_STATISTICS=y CONFIG_FS_POSIX_ACL=y CONFIG_XFS_FS=m CONFIG_XFS_EXPORT=y CONFIG_XFS_QUOTA=y CONFIG_XFS_SECURITY=y CONFIG_XFS_POSIX_ACL=y CONFIG_XFS_RT=y CONFIG_OCFS2_FS=m CONFIG_MINIX_FS=m CONFIG_ROMFS_FS=m CONFIG_INOTIFY=y CONFIG_QUOTA=y CONFIG_QFMT_V1=m CONFIG_QFMT_V2=m CONFIG_QUOTACTL=y CONFIG_DNOTIFY=y CONFIG_AUTOFS_FS=m CONFIG_AUTOFS4_FS=m CONFIG_FUSE_FS=m # # CD-ROM/DVD Filesystems # CONFIG_ISO9660_FS=m CONFIG_JOLIET=y CONFIG_ZISOFS=y CONFIG_ZISOFS_FS=m CONFIG_UDF_FS=m CONFIG_UDF_NLS=y # # DOS/FAT/NT Filesystems # CONFIG_FAT_FS=m CONFIG_MSDOS_FS=m CONFIG_VFAT_FS=m CONFIG_FAT_DEFAULT_CODEPAGE=437 CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1" CONFIG_NTFS_FS=m # CONFIG_NTFS_DEBUG is not set # CONFIG_NTFS_RW is not set # # Pseudo filesystems # CONFIG_PROC_FS=y CONFIG_PROC_KCORE=y CONFIG_SYSFS=y CONFIG_TMPFS=y CONFIG_HUGETLBFS=y CONFIG_HUGETLB_PAGE=y CONFIG_RAMFS=y # CONFIG_RELAYFS_FS is not set CONFIG_CONFIGFS_FS=m # # Miscellaneous filesystems # # CONFIG_ADFS_FS is not set # CONFIG_AFFS_FS is not set CONFIG_HFS_FS=m CONFIG_HFSPLUS_FS=m # CONFIG_BEFS_FS is not set # CONFIG_BFS_FS is not set # CONFIG_EFS_FS is not set CONFIG_CRAMFS=m # CONFIG_VXFS_FS is not set # CONFIG_HPFS_FS is not set # CONFIG_QNX4FS_FS is not set # CONFIG_SYSV_FS is not set CONFIG_UFS_FS=m # CONFIG_UFS_FS_WRITE is not set # # Network File Systems # CONFIG_NFS_FS=y CONFIG_NFS_V3=y CONFIG_NFS_V3_ACL=y CONFIG_NFS_V4=y CONFIG_NFS_DIRECTIO=y CONFIG_NFSD=m CONFIG_NFSD_V2_ACL=y CONFIG_NFSD_V3=y CONFIG_NFSD_V3_ACL=y CONFIG_NFSD_V4=y CONFIG_NFSD_TCP=y CONFIG_LOCKD=y CONFIG_LOCKD_V4=y CONFIG_EXPORTFS=m CONFIG_NFS_ACL_SUPPORT=y CONFIG_NFS_COMMON=y CONFIG_SUNRPC=y CONFIG_SUNRPC_GSS=y CONFIG_RPCSEC_GSS_KRB5=y CONFIG_RPCSEC_GSS_SPKM3=m CONFIG_SMB_FS=m # CONFIG_SMB_NLS_DEFAULT is not set CONFIG_CIFS=m CONFIG_CIFS_STATS=y # CONFIG_CIFS_STATS2 is not set CONFIG_CIFS_XATTR=y CONFIG_CIFS_POSIX=y # CONFIG_CIFS_EXPERIMENTAL is not set CONFIG_NCP_FS=m CONFIG_NCPFS_PACKET_SIGNING=y CONFIG_NCPFS_IOCTL_LOCKING=y CONFIG_NCPFS_STRONG=y CONFIG_NCPFS_NFS_NS=y CONFIG_NCPFS_OS2_NS=y CONFIG_NCPFS_SMALLDOS=y CONFIG_NCPFS_NLS=y CONFIG_NCPFS_EXTRAS=y # CONFIG_CODA_FS is not set # CONFIG_AFS_FS is not set # CONFIG_9P_FS is not set # # Partition Types # CONFIG_PARTITION_ADVANCED=y # CONFIG_ACORN_PARTITION is not set CONFIG_OSF_PARTITION=y CONFIG_AMIGA_PARTITION=y CONFIG_ATARI_PARTITION=y CONFIG_MAC_PARTITION=y CONFIG_MSDOS_PARTITION=y CONFIG_BSD_DISKLABEL=y CONFIG_MINIX_SUBPARTITION=y CONFIG_SOLARIS_X86_PARTITION=y CONFIG_UNIXWARE_DISKLABEL=y CONFIG_LDM_PARTITION=y # CONFIG_LDM_DEBUG is not set CONFIG_SGI_PARTITION=y CONFIG_ULTRIX_PARTITION=y CONFIG_SUN_PARTITION=y # CONFIG_KARMA_PARTITION is not set CONFIG_EFI_PARTITION=y # # Native Language Support # CONFIG_NLS=m CONFIG_NLS_DEFAULT="utf8" CONFIG_NLS_CODEPAGE_437=m CONFIG_NLS_CODEPAGE_737=m CONFIG_NLS_CODEPAGE_775=m CONFIG_NLS_CODEPAGE_850=m CONFIG_NLS_CODEPAGE_852=m CONFIG_NLS_CODEPAGE_855=m CONFIG_NLS_CODEPAGE_857=m CONFIG_NLS_CODEPAGE_860=m CONFIG_NLS_CODEPAGE_861=m CONFIG_NLS_CODEPAGE_862=m CONFIG_NLS_CODEPAGE_863=m CONFIG_NLS_CODEPAGE_864=m CONFIG_NLS_CODEPAGE_865=m CONFIG_NLS_CODEPAGE_866=m CONFIG_NLS_CODEPAGE_869=m CONFIG_NLS_CODEPAGE_936=m CONFIG_NLS_CODEPAGE_950=m CONFIG_NLS_CODEPAGE_932=m CONFIG_NLS_CODEPAGE_949=m CONFIG_NLS_CODEPAGE_874=m CONFIG_NLS_ISO8859_8=m CONFIG_NLS_CODEPAGE_1250=m CONFIG_NLS_CODEPAGE_1251=m CONFIG_NLS_ASCII=m CONFIG_NLS_ISO8859_1=m CONFIG_NLS_ISO8859_2=m CONFIG_NLS_ISO8859_3=m CONFIG_NLS_ISO8859_4=m CONFIG_NLS_ISO8859_5=m CONFIG_NLS_ISO8859_6=m CONFIG_NLS_ISO8859_7=m CONFIG_NLS_ISO8859_9=m CONFIG_NLS_ISO8859_13=m CONFIG_NLS_ISO8859_14=m CONFIG_NLS_ISO8859_15=m CONFIG_NLS_KOI8_R=m CONFIG_NLS_KOI8_U=m CONFIG_NLS_UTF8=m # # Library routines # CONFIG_CRC_CCITT=m # CONFIG_CRC16 is not set CONFIG_CRC32=y CONFIG_LIBCRC32C=m CONFIG_ZLIB_INFLATE=m CONFIG_ZLIB_DEFLATE=m CONFIG_TEXTSEARCH=y CONFIG_TEXTSEARCH_KMP=m CONFIG_TEXTSEARCH_BM=m CONFIG_TEXTSEARCH_FSM=m # # Instrumentation Support # CONFIG_PROFILING=y CONFIG_OPROFILE=y CONFIG_KPROBES=y # # Kernel hacking # # CONFIG_PRINTK_TIME is not set CONFIG_MAGIC_SYSRQ=y CONFIG_DEBUG_KERNEL=y CONFIG_LOG_BUF_SHIFT=19 CONFIG_DETECT_SOFTLOCKUP=y # CONFIG_SCHEDSTATS is not set # CONFIG_DEBUG_SLAB is not set CONFIG_DEBUG_MUTEXES=y # CONFIG_DEBUG_SPINLOCK is not set # CONFIG_DEBUG_SPINLOCK_SLEEP is not set # CONFIG_DEBUG_KOBJECT is not set # CONFIG_DEBUG_INFO is not set CONFIG_DEBUG_FS=y # CONFIG_DEBUG_VM is not set CONFIG_FORCED_INLINING=y # CONFIG_RCU_TORTURE_TEST is not set CONFIG_DEBUG_STACKOVERFLOW=y CONFIG_DEBUG_STACK_USAGE=y CONFIG_DEBUGGER=y CONFIG_XMON=y # CONFIG_XMON_DEFAULT is not set CONFIG_IRQSTACKS=y CONFIG_BOOTX_TEXT=y # CONFIG_PPC_EARLY_DEBUG_LPAR is not set # CONFIG_PPC_EARLY_DEBUG_G5 is not set # CONFIG_PPC_EARLY_DEBUG_RTAS is not set # CONFIG_PPC_EARLY_DEBUG_MAPLE is not set # CONFIG_PPC_EARLY_DEBUG_ISERIES is not set # # Security options # # CONFIG_KEYS is not set CONFIG_SECURITY=y CONFIG_SECURITY_NETWORK=y # CONFIG_SECURITY_NETWORK_XFRM is not set CONFIG_SECURITY_CAPABILITIES=m CONFIG_SECURITY_ROOTPLUG=m CONFIG_SECURITY_SECLVL=m CONFIG_SECURITY_SELINUX=y CONFIG_SECURITY_SELINUX_BOOTPARAM=y CONFIG_SECURITY_SELINUX_BOOTPARAM_VALUE=0 CONFIG_SECURITY_SELINUX_DISABLE=y CONFIG_SECURITY_SELINUX_DEVELOP=y CONFIG_SECURITY_SELINUX_AVC_STATS=y CONFIG_SECURITY_SELINUX_CHECKREQPROT_VALUE=1 # # Cryptographic options # CONFIG_CRYPTO=y CONFIG_CRYPTO_HMAC=y CONFIG_CRYPTO_NULL=m CONFIG_CRYPTO_MD4=m CONFIG_CRYPTO_MD5=y CONFIG_CRYPTO_SHA1=m CONFIG_CRYPTO_SHA256=m CONFIG_CRYPTO_SHA512=m CONFIG_CRYPTO_WP512=m CONFIG_CRYPTO_TGR192=m CONFIG_CRYPTO_DES=y CONFIG_CRYPTO_BLOWFISH=m CONFIG_CRYPTO_TWOFISH=m CONFIG_CRYPTO_SERPENT=m CONFIG_CRYPTO_AES=m CONFIG_CRYPTO_CAST5=m CONFIG_CRYPTO_CAST6=m CONFIG_CRYPTO_TEA=m CONFIG_CRYPTO_ARC4=m CONFIG_CRYPTO_KHAZAD=m CONFIG_CRYPTO_ANUBIS=m CONFIG_CRYPTO_DEFLATE=m CONFIG_CRYPTO_MICHAEL_MIC=m CONFIG_CRYPTO_CRC32C=m CONFIG_CRYPTO_TEST=m # # Hardware crypto devices # From pat at computer-refuge.org Sat Jan 28 07:12:24 2006 From: pat at computer-refuge.org (Patrick Finnegan) Date: Fri, 27 Jan 2006 15:12:24 -0500 Subject: Kernel panic with 2.6.15.1 on IBM 9076-N81 Message-ID: <200601271512.24501.pat@computer-refuge.org> Ok. I've figured some things out, working from 2.6.15.1: First, the console doesn't get set up properly. The call to disable_early_printk() fron console_init() turns off the console, and none of the other console routines init the serial console. Second, there's a panic (I commented out the disable_early_printk call so that I could see what was happening): requesting IPIs ... IPIs requested... Processor 1 found. Unable to handle kernel paging request for data at address 0x00000080 Faulting instruction address: 0xc0000000000394d4 Oops: Kernel access of bad area, sig: 11 [#1] SMP NR_CPUS=32 NUM PSERIES Modules linked in: NC0000000000394D4 LR: C000000000039348 CTR: C00000000002A750 REGS: c00000000ff87b80 TRAP: 0300 Not tainted (2.6.15.1-power3-smp) MSR: A000000000001032 CR: 22000002 XER: 20000000 DAR: 0000000000000080, DSISR: 0000000002200000 TASK = c00000003ffbf0a0[0 'swapper' THREAD: c00000000ff841 GPR00: 0000000000000080 C00000000FF87E00 C00000000042E4A8 A000000000001032 GPR04: A000000000001032 0000000000000004 0000000000000F 0000000000000001 GPR08: 0000020 0000000000000000 D000080080204C00 0000000000000000 GPR12: C00000000FFEF000 C00000000036F400 0000000000000000 0000000000000000 GPR16: 0000000000000000 000000000000000 0000000000000000 0000000000000 GPR20: 0000000000000000 0000000000C00000 0000000000004000 0000000000000001 GPR24: 00000000000001 0000000000000000 0000000000000000 0000000000000000 GPR28: C000000000431CB8 0000000000000002 C00000000038F1C8 C000000002579000 NIP [C0000000000394D4] .mpic_setupthis_cpu+0x1d4/0x210 LR [C000000000039348] .mpic_setup_this_cpu+0x48/0x2 Call Trace: [C00000000FF87E90] [C00000000002A760] .smp_mpic_setup_cpu+0x10/0x30 [C00000000FF87F00] [C00000000002AD1C] .start_se0x9c/0x150 [C00000000FF87F90] [C00000000000827C] .start_secondary_prolog+0xc/0x10 Instruction dump: 7c00eb78 7d6bfa14 79290020 e94b01e8 7d2b4b78 4082ff68 7c0907b4 7c0a5a14 7d20052c 7c0004ac 4bffff60 38090080 <7d60052c> 7c0004ac 60000000 60000000 (I had to reconstruct that from multiple retries of the same panic, since the shared SP console tends to "eat" characters, and setting the Open Firmware input-device and output-device variables doesn't actually redirect the console. Yes, I know it's still missing some characters.) Pat -- Purdue University Research Computing --- http://www.rcac.purdue.edu/ The Computer Refuge --- http://computer-refuge.org From arnd at arndb.de Sat Jan 28 07:31:56 2006 From: arnd at arndb.de (Arnd Bergmann) Date: Fri, 27 Jan 2006 21:31:56 +0100 Subject: spufs platform dependent code In-Reply-To: <43D967AF.1060305@am.sony.com> References: <43D967AF.1060305@am.sony.com> Message-ID: <200601272131.56936.arnd@arndb.de> On Friday 27 January 2006 01:22, Geoff Levand wrote: > We need to consider how we will arrange the platform > dependent code in spufs. > > First, we need to consider the run-time selection of > spu wrappers, etc. You seemed to think that a simple > comparison, as here, will be sufficient: > > ?if (firmware_has_feature(FW_FEATURE_HYPERVISOR)) > ????????hvcall_spu_get_irq_mask(spu->spu_magical_id, cls, &val); > ?else > ????????val = in_be64(&spu->priv1->int_stat_class0_RW + cls); > > I see a problem in that in the general case, support for several > hypervisors and also 'raw hardware' will be compiled in. ?I was > thinking it might work better to use an indirect call through a > pointer to a structure of function pointers. In most cases we have now, the code above should be pretty well optimized because firmware_has_feature() can be evaluated at compile time depending on CONFIG_* and no conditional branch gets added here. I agree that in the long term, we may want to optimize for the case where we have a single kernel binary that has all possible options enabled, which would work better with a function pointer. > ?struct spu_ops *spu_ops; > ?spu_ops->spu_get_irq_mask(spu->spu_magical_id, cls, &val); > > The instance of the structure could be setup statically in > the platform code and the pointer set with a runtime check > or in the platform startup code. The standard way to do this kind of OO abstraction would pass 'spu' as the first argument to spu_get_irq_mask() instead of spu->spu_magical_id. Also, you can leave out the 'spu_' prefix in the struct member. If you want to prepare a patch for this, I'd prefer you to write this as val = spu->ops.get_irq_mask(spu, cls); or val = spu_ops->get_irq_mask(spu, cls); if the latter turns out to be more efficient. I don't particularly like having a new global function pointer structure, but I don't really expect to see systems where it makes sense to have different ->ops pointers per spu structure. > Another point is that there is some platform dependent interrupt > and spu setup code in spu_base.c. ?This needs to be moved > out and into a platform dependent file. We currently have > spu_priv1.c with the platform dependent wrappers. ?I > propose we rename spu_priv1.c to something > that hints that is the platform code for 'raw' access, > and move the platform code in spu_base.c to it. ?Do you > have any recommended names, or any other suggestions? I'm not sure I could follow you. My idea of the cell platform code is that it ought to be generic enough to work with all hardware that has some SPU support in it. Right now, a lot of stuff is hardwired to use the stuff we have on the Cell Blade, but that only means that so far nobody has submitted a patch to extend this to any other hardware. Did I get you right that you instead want to add a separate platform directory for your hypervisor abstraction? Since I haven't seen your code, I don't know how much it differs from what we have so far and can't really tell which would be better. For the spu_priv1.c file, it's proably easiest to do it similar to the abstraction we already have for spu_context_ops, the files could e.g. be named spu_priv1_mmio.c and spu_priv1_hvcall.c. Arnd <>< From olof at lixom.net Sat Jan 28 07:40:22 2006 From: olof at lixom.net (Olof Johansson) Date: Sat, 28 Jan 2006 09:40:22 +1300 Subject: iommu_alloc failure and panic In-Reply-To: <1138381060.11796.22.camel@markh3.pdx.osdl.net> References: <1138381060.11796.22.camel@markh3.pdx.osdl.net> Message-ID: <20060127204022.GA26653@pb15.lixom.net> Hi, On Fri, Jan 27, 2006 at 08:57:40AM -0800, Mark Haverkamp wrote: > While running a disk test (bonnie++) I have been seeing iommu_alloc > failed messages in the syslog leading to a panic. The machine that I Hmm. The IOMMU code tries to be clever and not write on a cacheline that's already in use, to avoid invalidating cached entries on the I/O bridges. Since a cache line is 128 bytes (16 entries), this means it advances that much on each allocation, and tries to allocate a new entry in the next block of 16. Essentially it is fragmenting the allocation space on purpose. So far I haven't seen anyone else have problems with this. I'm suspecting that the SCSI probe code might map something per disk (or similar), such that there's alot of small allocations being done, each using up part of a line. once the end of the allocation space is reached, the allocator wraps to the beginning and starts walking again. Since this greatly reduces the chance of allocating anything 16 pages or more, a part of the table (25%) is set aside and used for the large allocations. If an allocation in one section of the table (large/small) doesn't succeed, the other half is also searched. Each allocation in your report is 10 entries, so that means that at least 7 must be taken on each line, since the allocation won't go to the large area by default. Can you try this, just to confirm that this is what we're seeing? 1. In iommu_setparms_lpar() in arch/powerpc/platforms/pseries/iommu.c, can you try changing it_blocksize from 16 to 1? Thanks, Olof From markh at osdl.org Sat Jan 28 09:39:50 2006 From: markh at osdl.org (Mark Haverkamp) Date: Fri, 27 Jan 2006 14:39:50 -0800 Subject: iommu_alloc failure and panic In-Reply-To: <20060127204022.GA26653@pb15.lixom.net> References: <1138381060.11796.22.camel@markh3.pdx.osdl.net> <20060127204022.GA26653@pb15.lixom.net> Message-ID: <1138401590.11796.26.camel@markh3.pdx.osdl.net> On Sat, 2006-01-28 at 09:40 +1300, Olof Johansson wrote: > Hi, > > On Fri, Jan 27, 2006 at 08:57:40AM -0800, Mark Haverkamp wrote: > > While running a disk test (bonnie++) I have been seeing iommu_alloc > > failed messages in the syslog leading to a panic. The machine that I > > Hmm. The IOMMU code tries to be clever and not write on a cacheline > that's already in use, to avoid invalidating cached entries on the I/O > bridges. > > Since a cache line is 128 bytes (16 entries), this means it advances > that much on each allocation, and tries to allocate a new entry in the > next block of 16. Essentially it is fragmenting the allocation space on > purpose. > > So far I haven't seen anyone else have problems with this. I'm > suspecting that the SCSI probe code might map something per disk (or > similar), such that there's alot of small allocations being done, each > using up part of a line. once the end of the allocation space is > reached, the allocator wraps to the beginning and starts walking again. > > Since this greatly reduces the chance of allocating anything 16 pages or > more, a part of the table (25%) is set aside and used for the large > allocations. If an allocation in one section of the table (large/small) > doesn't succeed, the other half is also searched. > > Each allocation in your report is 10 entries, so that means that at > least 7 must be taken on each line, since the allocation won't go to the > large area by default. > > Can you try this, just to confirm that this is what we're seeing? > > 1. In iommu_setparms_lpar() in arch/powerpc/platforms/pseries/iommu.c, > can you try changing it_blocksize from 16 to 1? I tried this but I still see the iommu_alloc failures: Jan 27 14:19:41 linux kernel: iommu_alloc failed, tbl c00000000263c480 vaddr c000000133b00000 npages 10 Jan 27 14:19:41 linux kernel: iommu_alloc failed, tbl c00000000263c480 vaddr c00000016e9ef000 npages 10 Jan 27 14:19:41 linux kernel: iommu_alloc failed, tbl c00000000263c480 vaddr c000000133b00000 npages 10 Jan 27 14:19:41 linux kernel: iommu_alloc failed, tbl c00000000263c480 vaddr c00000016e9ef000 npages 10 Jan 27 14:19:41 linux kernel: iommu_alloc failed, tbl c00000000263c480 vaddr c0000000f7970000 npages 10 Jan 27 14:19:41 linux kernel: iommu_alloc failed, tbl c00000000263c480 vaddr c00000013304f000 npages 10 Jan 27 14:19:41 linux kernel: iommu_alloc failed, tbl c00000000263c480 vaddr c00000016eb4a000 npages 10 Jan 27 14:19:41 linux kernel: iommu_alloc failed, tbl c00000000263c480 vaddr c00000017105b000 npages 10 Jan 27 14:19:41 linux kernel: iommu_alloc failed, tbl c00000000263c480 vaddr c00000016ec21000 npages 10 Jan 27 14:19:41 linux kernel: iommu_alloc failed, tbl c00000000263c480 vaddr c0000000b96c2000 npages 10 Jan 27 14:19:48 linux kernel: printk: 415 messages suppressed. Jan 27 14:19:48 linux kernel: iommu_alloc failed, tbl c00000000263c480 vaddr c00000016d350000 npages 10 Jan 27 14:19:53 linux kernel: printk: 430 messages suppressed. Jan 27 14:19:53 linux kernel: iommu_alloc failed, tbl c00000000263c480 vaddr c00000010a940000 npages 10 Jan 27 14:19:56 linux kernel: printk: 481 messages suppressed. Jan 27 14:19:56 linux kernel: iommu_alloc failed, tbl c00000000263c480 vaddr c0000000a74d0000 npages 10 Jan 27 14:20:03 linux kernel: printk: 530 messages suppressed. Jan 27 14:20:03 linux kernel: iommu_alloc failed, tbl c00000000263c480 vaddr c00000016036a000 npages 10 Jan 27 14:20:07 linux kernel: printk: 510 messages suppressed. Jan 27 14:20:07 linux kernel: iommu_alloc failed, tbl c00000000263c480 vaddr c0000000971cc000 npages 10 Jan 27 14:20:11 linux kernel: printk: 482 messages suppressed. Jan 27 14:20:11 linux kernel: iommu_alloc failed, tbl c00000000263c480 vaddr c000000167cae000 npages 10 Jan 27 14:20:16 linux kernel: printk: 381 messages suppressed. Jan 27 14:20:16 linux kernel: iommu_alloc failed, tbl c00000000263c480 vaddr c00000011d384000 npages 10 Jan 27 14:20:21 linux kernel: printk: 776 messages suppressed. Jan 27 14:20:21 linux kernel: iommu_alloc failed, tbl c00000000263c480 vaddr c00000015c942000 npages 10 Jan 27 14:20:26 linux kernel: printk: 643 messages suppressed. Jan 27 14:20:26 linux kernel: iommu_alloc failed, tbl c00000000263c480 vaddr c000000148e22000 npages 10 Jan 27 14:20:31 linux kernel: printk: 455 messages suppressed. Jan 27 14:20:31 linux kernel: iommu_alloc failed, tbl c00000000263c480 vaddr c000000128527000 npages 10 Jan 27 14:20:48 linux kernel: printk: 542 messages suppressed. Jan 27 14:20:48 linux kernel: iommu_alloc failed, tbl c00000000263c480 vaddr c00000002f380000 npages 10 Jan 27 14:20:49 linux kernel: iommu_alloc failed, tbl c00000000263c480 vaddr c00000006ffad000 npages 10 Jan 27 14:20:49 linux kernel: iommu_alloc failed, tbl c00000000263c480 vaddr c00000006ffad000 npages 10 Jan 27 14:20:51 linux kernel: printk: 359 messages suppressed. Jan 27 14:20:51 linux kernel: iommu_alloc failed, tbl c00000000263c480 vaddr c000000068db1000 npages 10 I would have thought that the npages would be 1 now. Here is the console output. Welcome to SUSE LINUX 10.0 (PPC) - Kernel 2.6.16-rc1-ppc64 (hvc0). dev2-002 login: Oops: Kernel access of bad area, sig: 11 [#1] SMP NR_CPUS=128 NUMA PSERIES LPAR Modules linked in: dm_round_robin dm_multipath lpfc scsi_transport_fc ipv6 parport_pc lp parport dm_mod sg st ipr firmware_class sd_mod scsi_mod NIP: C00000000000F7D0 LR: C00000000000FA2C CTR: 0000000000000000 REGS: c0000001e7bb3940 TRAP: 0300 Not tainted (2.6.16-rc1-ppc64) MSR: 8000000000009032 CR: 24002048 XER: 00000018 DAR: C000000600711718, DSISR: 0000000040010000 TASK = c00000000764f040[179] 'kblockd/0' THREAD: c0000001e7bb0000 CPU: 0 GPR00: 0000000600000008 C0000001E7BB3BC0 C00000000070EE68 C0000001E7BB3DE0 GPR04: C00000000764F040 00000000000002F0 0000000000080000 C00000000058C720 GPR08: 0000000000000001 C0000001E7BB3D10 C000000000711710 C0000001E7BB0000 GPR12: C0000001E7BB3720 C00000000055EB00 0000000000000000 0000000000000000 GPR16: 0000000000000000 000000000197FD90 4000000001C00000 000000000197FD88 GPR20: 000000000197FD98 C000000000503290 0000000000000060 0000000002103728 GPR24: C00000000055EB00 0000000000000001 0000000000000000 C0000001E7BB3EE0 GPR28: 0000000000000002 C0000001E7BB3DE0 C00000000764F040 C000000000079FC0 NIP [C00000000000F7D0] .validate_sp+0x30/0xc0 LR [C00000000000FA2C] .show_stack+0xec/0x1d0 Call Trace: [C0000001E7BB3BC0] [C00000000000FA18] .show_stack+0xd8/0x1d0 (unreliable) [C0000001E7BB3C60] [C000000000433838] .schedule+0xd78/0xfb0 [C0000001E7BB3DE0] [C000000000079FC0] .worker_thread+0x1b0/0x1c0 Unable to handle kernel paging request for data at address 0xc000000600711718 Faulting instruction address: 0xc00000000000f7d0 Unable to handle kernel paging request for data at address 0xc00001800055ed30 Faulting instruction address: 0xc000000000056ec4 -- Mark Haverkamp From olof at lixom.net Sat Jan 28 10:34:43 2006 From: olof at lixom.net (Olof Johansson) Date: Sat, 28 Jan 2006 12:34:43 +1300 Subject: iommu_alloc failure and panic In-Reply-To: <1138401590.11796.26.camel@markh3.pdx.osdl.net> References: <1138381060.11796.22.camel@markh3.pdx.osdl.net> <20060127204022.GA26653@pb15.lixom.net> <1138401590.11796.26.camel@markh3.pdx.osdl.net> Message-ID: <20060127233443.GB26653@pb15.lixom.net> On Fri, Jan 27, 2006 at 02:39:50PM -0800, Mark Haverkamp wrote: > I would have thought that the npages would be 1 now. No, npages is the size of the allocation coming from the driver, that won't chance. The table blocksize just says how wide the cacheline size is, i.e. how far it should advance between allocations. This is a patch that should probably have been added a while ago, to give a bit more info. Can you apply it and give it a go? Thanks, Olof Index: 2.6/arch/powerpc/kernel/iommu.c =================================================================== --- 2.6.orig/arch/powerpc/kernel/iommu.c 2006-01-28 12:18:56.000000000 +1300 +++ 2.6/arch/powerpc/kernel/iommu.c 2006-01-28 12:31:20.000000000 +1300 @@ -146,6 +146,8 @@ static unsigned long iommu_range_alloc(s if (handle) *handle = end; + tbl->it_used += npages; + return n; } @@ -214,6 +216,8 @@ static void __iommu_free(struct iommu_ta for (i = 0; i < npages; i++) __clear_bit(free_entry+i, tbl->it_map); + + tbl->it_used -= npages; } static void iommu_free(struct iommu_table *tbl, dma_addr_t dma_addr, @@ -281,9 +285,11 @@ int iommu_map_sg(struct device *dev, str /* Handle failure */ if (unlikely(entry == DMA_ERROR_CODE)) { - if (printk_ratelimit()) - printk(KERN_INFO "iommu_alloc failed, tbl %p vaddr %lx" + if (printk_ratelimit()) { + printk(KERN_INFO "iommu_alloc_sg failed, tbl %p vaddr %lx" " npages %lx\n", tbl, vaddr, npages); + printk(KERN_INFO "table size %lx used %lx\n", tbl->it_size, tbl->it_used); + } goto failure; } @@ -422,6 +428,7 @@ struct iommu_table *iommu_init_table(str tbl->it_hint = 0; tbl->it_largehint = tbl->it_halfpoint; + tbl->it_used = 0; spin_lock_init(&tbl->it_lock); /* Clear the hardware table in case firmware left allocations in it */ @@ -496,6 +503,7 @@ dma_addr_t iommu_map_single(struct iommu printk(KERN_INFO "iommu_alloc failed, " "tbl %p vaddr %p npages %d\n", tbl, vaddr, npages); + printk(KERN_INFO "table size %lx used %lx\n", tbl->it_size, tbl->it_used); } } else dma_handle |= (uaddr & ~PAGE_MASK); Index: 2.6/include/asm-powerpc/iommu.h =================================================================== --- 2.6.orig/include/asm-powerpc/iommu.h 2006-01-21 03:14:30.000000000 +1300 +++ 2.6/include/asm-powerpc/iommu.h 2006-01-28 12:26:39.000000000 +1300 @@ -47,6 +47,7 @@ struct iommu_table { unsigned long it_largehint; /* Hint for large allocs */ unsigned long it_halfpoint; /* Breaking point for small/large allocs */ spinlock_t it_lock; /* Protects it_map */ + unsigned long it_used; unsigned long *it_map; /* A simple allocation bitmap for now */ }; From markh at osdl.org Sat Jan 28 10:37:34 2006 From: markh at osdl.org (Mark Haverkamp) Date: Fri, 27 Jan 2006 15:37:34 -0800 Subject: iommu_alloc failure and panic In-Reply-To: <20060127233443.GB26653@pb15.lixom.net> References: <1138381060.11796.22.camel@markh3.pdx.osdl.net> <20060127204022.GA26653@pb15.lixom.net> <1138401590.11796.26.camel@markh3.pdx.osdl.net> <20060127233443.GB26653@pb15.lixom.net> Message-ID: <1138405054.11796.27.camel@markh3.pdx.osdl.net> On Sat, 2006-01-28 at 12:34 +1300, Olof Johansson wrote: > On Fri, Jan 27, 2006 at 02:39:50PM -0800, Mark Haverkamp wrote: > > > I would have thought that the npages would be 1 now. > > No, npages is the size of the allocation coming from the driver, that > won't chance. The table blocksize just says how wide the cacheline size > is, i.e. how far it should advance between allocations. > > This is a patch that should probably have been added a while ago, to > give a bit more info. Can you apply it and give it a go? OK, I'll try it and let you know. Thanks, Mark. -- Mark Haverkamp From geoffrey.levand at am.sony.com Sat Jan 28 10:46:05 2006 From: geoffrey.levand at am.sony.com (Geoff Levand) Date: Fri, 27 Jan 2006 15:46:05 -0800 Subject: spufs platform dependent code In-Reply-To: <200601272131.56936.arnd@arndb.de> References: <200601272131.56936.arnd@arndb.de> Message-ID: <43DAB0BD.6010303@am.sony.com> Arnd Bergmann wrote: > On Friday 27 January 2006 01:22, Geoff Levand wrote: > >>We need to consider how we will arrange the platform >>dependent code in spufs. >> >>First, we need to consider the run-time selection of >>spu wrappers, etc. You seemed to think that a simple >>comparison, as here, will be sufficient: >> >>?if (firmware_has_feature(FW_FEATURE_HYPERVISOR)) >>????????hvcall_spu_get_irq_mask(spu->spu_magical_id, cls, &val); >>?else >>????????val = in_be64(&spu->priv1->int_stat_class0_RW + cls); >> >>I see a problem in that in the general case, support for several >>hypervisors and also 'raw hardware' will be compiled in. ?I was >>thinking it might work better to use an indirect call through a >>pointer to a structure of function pointers. > > > In most cases we have now, the code above should be pretty well > optimized because firmware_has_feature() can be evaluated at compile > time depending on CONFIG_* and no conditional branch gets added here. > > I agree that in the long term, we may want to optimize for the case > where we have a single kernel binary that has all possible options > enabled, which would work better with a function pointer. I started some work on this. I'll post a patch for comment, maybe next week. >>?struct spu_ops *spu_ops; >>?spu_ops->spu_get_irq_mask(spu->spu_magical_id, cls, &val); >> >>The instance of the structure could be setup statically in >>the platform code and the pointer set with a runtime check >>or in the platform startup code. > > > The standard way to do this kind of OO abstraction would pass > 'spu' as the first argument to spu_get_irq_mask() instead of > spu->spu_magical_id. Also, you can leave out the 'spu_' > prefix in the struct member. Yes, you are of course correct, I just cut and pasted that merely for illustration. > If you want to prepare a patch for this, I'd prefer you to > write this as > > val = spu->ops.get_irq_mask(spu, cls); > > or > > val = spu_ops->get_irq_mask(spu, cls); > > if the latter turns out to be more efficient. I don't particularly > like having a new global function pointer structure, but I don't > really expect to see systems where it makes sense to have different > ->ops pointers per spu structure. I can't see a system having different ops either. I'll see what code is generated by each. >>Another point is that there is some platform dependent interrupt >>and spu setup code in spu_base.c. ?This needs to be moved >>out and into a platform dependent file. We currently have >>spu_priv1.c with the platform dependent wrappers. ?I >>propose we rename spu_priv1.c to something >>that hints that is the platform code for 'raw' access, >>and move the platform code in spu_base.c to it. ?Do you >>have any recommended names, or any other suggestions? > > > I'm not sure I could follow you. My idea of the cell platform > code is that it ought to be generic enough to work with all > hardware that has some SPU support in it. Right now, a lot of > stuff is hardwired to use the stuff we have on the Cell Blade, > but that only means that so far nobody has submitted a patch > to extend this to any other hardware. I found you have some stuff in there specific to your platform. It assumes there is a certain south bridge, and that spu interrupts are serviced by that south bridge. It also makes assumptions of how the spu's are represented in the device tree. I've got a first cut patch to break those things out. I'll post it soon for comment. > Did I get you right that you instead want to add a separate > platform directory for your hypervisor abstraction? > Since I haven't seen your code, I don't know how much it differs > from what we have so far and can't really tell which would be > better. > > For the spu_priv1.c file, it's proably easiest to do it similar > to the abstraction we already have for spu_context_ops, the files > could e.g. be named spu_priv1_mmio.c and spu_priv1_hvcall.c. Sorry for the confusion, what I meant was that if we move the interrupt code, etc. to spu_priv1.c, it becomes more than just priv1 wrappers, so I thought it might be better to name it something else. I was also thinking to put support for all platforms into arch/powerpc/platforms/cell, each in a different file. But on consideration it might work better to put them into a separate directory. Let's not decide that now though, and just focus on splitting out the platform code from spu_base.c and doing the wrappers. -Geoff From geoffrey.levand at am.sony.com Sat Jan 28 10:51:36 2006 From: geoffrey.levand at am.sony.com (Geoff Levand) Date: Fri, 27 Jan 2006 15:51:36 -0800 Subject: [PATCH] spufs split off platform code Message-ID: <43DAB208.9000505@am.sony.com> spufs-split-off-platform-code.patch: This patch moves the platform dependent code from spu_base.c to spu_priv1.c. Signed-off-by: Masato Noguchi Signed-off-by: Geoff Levand -- Index: alp-linux--dev--10/arch/powerpc/platforms/cell/spu_base.c =================================================================== --- alp-linux--dev--10.orig/arch/powerpc/platforms/cell/spu_base.c 2006-01-27 10:45:30.000000000 -0800 +++ alp-linux--dev--10/arch/powerpc/platforms/cell/spu_base.c 2006-01-27 11:27:34.000000000 -0800 @@ -31,13 +31,10 @@ #include #include -#include #include #include #include -#include "interrupt.h" - static int __spu_trap_invalid_dma(struct spu *spu) { pr_debug("%s\n", __FUNCTION__); @@ -296,53 +293,6 @@ return stat ? IRQ_HANDLED : IRQ_NONE; } -static int -spu_request_irqs(struct spu *spu) -{ - int ret; - int irq_base; - - irq_base = IIC_NODE_STRIDE * spu->node + IIC_SPE_OFFSET; - - snprintf(spu->irq_c0, sizeof (spu->irq_c0), "spe%02d.0", spu->number); - ret = request_irq(irq_base + spu->isrc, - spu_irq_class_0, 0, spu->irq_c0, spu); - if (ret) - goto out; - - snprintf(spu->irq_c1, sizeof (spu->irq_c1), "spe%02d.1", spu->number); - ret = request_irq(irq_base + IIC_CLASS_STRIDE + spu->isrc, - spu_irq_class_1, 0, spu->irq_c1, spu); - if (ret) - goto out1; - - snprintf(spu->irq_c2, sizeof (spu->irq_c2), "spe%02d.2", spu->number); - ret = request_irq(irq_base + 2*IIC_CLASS_STRIDE + spu->isrc, - spu_irq_class_2, 0, spu->irq_c2, spu); - if (ret) - goto out2; - goto out; - -out2: - free_irq(irq_base + IIC_CLASS_STRIDE + spu->isrc, spu); -out1: - free_irq(irq_base + spu->isrc, spu); -out: - return ret; -} - -static void -spu_free_irqs(struct spu *spu) -{ - int irq_base; - - irq_base = IIC_NODE_STRIDE * spu->node + IIC_SPE_OFFSET; - - free_irq(irq_base + spu->isrc, spu); - free_irq(irq_base + IIC_CLASS_STRIDE + spu->isrc, spu); - free_irq(irq_base + 2*IIC_CLASS_STRIDE + spu->isrc, spu); -} - static LIST_HEAD(spu_list); static DECLARE_MUTEX(spu_mutex); @@ -388,7 +338,7 @@ if (!list_empty(&spu_list)) { spu = list_entry(spu_list.next, struct spu, list); list_del_init(&spu->list); - pr_debug("Got SPU %x %d\n", spu->isrc, spu->number); + pr_debug("Got SPU %d\n", spu->number); } else { pr_debug("No SPU left\n"); spu = NULL; @@ -509,103 +459,37 @@ return ret; } -void spu_irq_setaffinity(struct spu *spu, int cpu) -{ - u64 target = iic_get_target_id(cpu); - u64 route = target << 48 | target << 32 | target << 16; - spu_int_route_set(spu, route); -} -EXPORT_SYMBOL_GPL(spu_irq_setaffinity); - -static void __iomem * __init map_spe_prop(struct device_node *n, - const char *name) -{ - struct address_prop { - unsigned long address; - unsigned int len; - } __attribute__((packed)) *prop; - - void *p; - int proplen; - - p = get_property(n, name, &proplen); - if (proplen != sizeof (struct address_prop)) - return NULL; - - prop = p; - - return ioremap(prop->address, prop->len); -} - static void spu_unmap(struct spu *spu) { - iounmap(spu->priv2); iounmap(spu->priv1); + iounmap(spu->priv2); iounmap(spu->problem); iounmap((u8 __iomem *)spu->local_store); } -static int __init spu_map_device(struct spu *spu, struct device_node *spe) +static int __init spu_map(struct spu *spu) { - char *prop; - int ret; - - ret = -ENODEV; - prop = get_property(spe, "isrc", NULL); - if (!prop) - goto out; - spu->isrc = *(unsigned int *)prop; - - spu->name = get_property(spe, "name", NULL); - if (!spu->name) - goto out; - - prop = get_property(spe, "local-store", NULL); - if (!prop) - goto out; - spu->local_store_phys = *(unsigned long *)prop; - - /* we use local store as ram, not io memory */ - spu->local_store = (void __force *)map_spe_prop(spe, "local-store"); - if (!spu->local_store) - goto out; - - prop = get_property(spe, "problem", NULL); - if (!prop) - goto out_unmap; - spu->problem_phys = *(unsigned long *)prop; - - spu->problem= map_spe_prop(spe, "problem"); - if (!spu->problem) - goto out_unmap; - - spu->priv1= map_spe_prop(spe, "priv1"); - /* priv1 is not available on a hypervisor */ - - spu->priv2= map_spe_prop(spe, "priv2"); - if (!spu->priv2) - goto out_unmap; - ret = 0; - goto out; - -out_unmap: - spu_unmap(spu); -out: - return ret; -} - -static int __init find_spu_node_id(struct device_node *spe) -{ - unsigned int *id; - struct device_node *cpu; - - cpu = spe->parent->parent; - id = (unsigned int *)get_property(cpu, "node-id", NULL); - - return id ? *id : 0; + spu->local_store = ioremap(spu->local_store_phys.addr, + spu->local_store_phys.size); + spu->problem = ioremap(spu->problem_phys.addr, + spu->problem_phys.size); + spu->priv2 = ioremap(spu->priv2_phys.addr, spu->priv2_phys.size); + spu->priv1 = spu->priv1_phys.addr + ? ioremap(spu->priv1_phys.addr, spu->priv1_phys.size) + : NULL; + + if (!spu->local_store || !spu->problem || !spu->priv2 + || (!spu->priv1_phys.addr != !spu->priv1)) { + pr_debug("%s failed: %p %p %p %p\n", __func__, spu->local_store, + spu->problem, spu->priv2, spu->priv1); + spu_unmap(spu); + return -ENODEV; + } + + return 0; } -static int __init create_spu(struct device_node *spe) +int create_spu(void *spu_setup_data) { struct spu *spu; int ret; @@ -616,11 +500,14 @@ if (!spu) goto out; - ret = spu_map_device(spu, spe); + ret = spu_setup(spu, spu_setup_data); + if (ret) + goto out_free; + + ret = spu_map(spu); if (ret) goto out_free; - spu->node = find_spu_node_id(spe); spu->stop_code = 0; spu->slb_replace = 0; spu->mm = NULL; @@ -643,15 +530,16 @@ down(&spu_mutex); spu->number = number++; - ret = spu_request_irqs(spu); + ret = spu_request_irqs(spu, spu_irq_class_0, spu_irq_class_1, + spu_irq_class_2); if (ret) goto out_unmap; list_add(&spu->list, &spu_list); up(&spu_mutex); - pr_debug(KERN_DEBUG "Using SPE %s %02x %p %p %p %p %d\n", - spu->name, spu->isrc, spu->local_store, + pr_debug(KERN_DEBUG "Using SPE %s (%p) %p %p %p %p %d\n", + spu->name, spu, spu->local_store, spu->problem, spu->priv1, spu->priv2, spu->number); goto out; @@ -663,6 +551,7 @@ out: return ret; } +EXPORT_SYMBOL_GPL(create_spu); static void destroy_spu(struct spu *spu) { @@ -685,31 +574,11 @@ static int __init init_spu_base(void) { - struct device_node *node; - int ret; - - ret = -ENODEV; - for (node = of_find_node_by_type(NULL, "spe"); - node; node = of_find_node_by_type(node, "spe")) { - ret = create_spu(node); - if (ret) { - printk(KERN_WARNING "%s: Error initializing %s\n", - __FUNCTION__, node->name); - cleanup_spu_base(); - break; - } - } - /* in some old firmware versions, the spe is called 'spc', so we - look for that as well */ - for (node = of_find_node_by_type(NULL, "spc"); - node; node = of_find_node_by_type(node, "spc")) { - ret = create_spu(node); - if (ret) { - printk(KERN_WARNING "%s: Error initializing %s\n", - __FUNCTION__, node->name); - cleanup_spu_base(); - break; - } + int ret = enum_and_create_spu(); + if (ret) { + printk(KERN_WARNING "%s: Error initializing spu-base\n", + __FUNCTION__); + cleanup_spu_base(); } return ret; } Index: alp-linux--dev--10/arch/powerpc/platforms/cell/spu_priv1.c =================================================================== --- alp-linux--dev--10.orig/arch/powerpc/platforms/cell/spu_priv1.c 2006-01-27 10:45:30.000000000 -0800 +++ alp-linux--dev--10/arch/powerpc/platforms/cell/spu_priv1.c 2006-01-27 11:31:06.000000000 -0800 @@ -5,6 +5,202 @@ #include #include +#include +#include "interrupt.h" + +struct spu_priv_data { + u32 isrc; + u32 node; +}; + +static int __init find_spu_node_id(struct device_node *spe) +{ + unsigned int *id; + struct device_node *cpu; + + cpu = spe->parent->parent; + id = (unsigned int *)get_property(cpu, "node-id", NULL); + + return id ? *id : 0; +} + +static void __init get_spe_property(struct device_node *n, const char *name, + struct spu_phys* phys) +{ + struct address_prop { + unsigned long address; + unsigned int len; + } __attribute__((packed)) *prop; + + void *p; + int proplen; + + p = get_property(n, name, &proplen); + if (proplen != sizeof (struct address_prop)) { + phys->addr = phys->size = 0; + return; + } + prop = p; + + phys->addr = prop->address; + phys->size = prop->len; +} + +int __init enum_and_create_spu(void) +{ + struct device_node *node; + int ret; + + ret = -ENODEV; + for (node = of_find_node_by_type(NULL, "spe"); + node; node = of_find_node_by_type(node, "spe")) { + ret = create_spu(node); + if (ret) + break; + } + /* in some old firmware versions, the spe is called 'spc', so we + look for that as well */ + for (node = of_find_node_by_type(NULL, "spc"); + node; node = of_find_node_by_type(node, "spc")) { + ret = create_spu(node); + if (ret) + break; + } + return ret; +} +EXPORT_SYMBOL_GPL(enum_and_create_spu); + +int __init spu_setup(struct spu *spu, void *spu_setup_data) +{ + struct device_node *spe = spu_setup_data; + char *prop; + + spu->priv_data = kmalloc(sizeof(struct spu_priv_data), GFP_KERNEL); + if (!spu->priv_data) + return -ENOMEM; + + spu->priv_data->node = find_spu_node_id(spe); + + prop = get_property(spe, "isrc", NULL); + if (!prop) + goto out_free; + spu->priv_data->isrc = *(unsigned int *)prop; + + spu->name = get_property(spe, "name", NULL); + if (!spu->name) + goto out_free; + + get_spe_property(spe, "local-store", &spu->local_store_phys); + if (!spu->local_store_phys.addr) + goto out_free; + + get_spe_property(spe, "problem", &spu->problem_phys); + if (!spu->problem_phys.addr) + goto out_free; + + get_spe_property(spe, "priv1", &spu->priv1_phys); + + get_spe_property(spe, "priv2", &spu->priv2_phys); + if (!spu->priv2_phys.addr) + goto out_free; + + return 0; + +out_free: + printk(KERN_WARNING "%s: no spu device found\n", __func__); + pr_debug("%s: error (%p)\n", __func__, spu); + kfree(spu->priv_data); + spu->priv_data = NULL; + return -ENODEV; +} +EXPORT_SYMBOL_GPL(spu_setup); + +void spu_free_priv_data(struct spu *spu) +{ + if (spu->priv_data) { + kfree(spu->priv_data); + spu->priv_data = NULL; + } +} +EXPORT_SYMBOL_GPL(spu_free_priv_data); + +int spu_request_irqs(struct spu *spu, + irqreturn_t (*cls0)(int, void *, struct pt_regs *), + irqreturn_t (*cls1)(int, void *, struct pt_regs *), + irqreturn_t (*cls2)(int, void *, struct pt_regs *)) +{ + int ret; + int irq_base; + + BUG_ON(spu->priv_data); + + if(!spu->priv_data) { + spu->priv_data = kmalloc(sizeof(struct spu_priv_data), + GFP_KERNEL); + + if(!spu->priv_data) { + ret = -ENOMEM; + goto out; + } + } + + irq_base = IIC_NODE_STRIDE * spu->priv_data->node + IIC_SPE_OFFSET; + + snprintf(spu->irq_c0, sizeof (spu->irq_c0), "spe%02d.0", spu->number); + ret = request_irq(irq_base + spu->priv_data->isrc, + cls0, 0, spu->irq_c0, spu); + if (ret) + goto out; + + snprintf(spu->irq_c1, sizeof (spu->irq_c1), "spe%02d.1", spu->number); + ret = request_irq(irq_base + IIC_CLASS_STRIDE + spu->priv_data->isrc, + cls1, 0, spu->irq_c1, spu); + if (ret) + goto out1; + + snprintf(spu->irq_c2, sizeof (spu->irq_c2), "spe%02d.2", spu->number); + ret = request_irq(irq_base + 2*IIC_CLASS_STRIDE + spu->priv_data->isrc, + cls2, 0, spu->irq_c2, spu); + if (ret) + goto out2; + goto out; + +out2: + free_irq(irq_base + IIC_CLASS_STRIDE + spu->priv_data->isrc, spu); +out1: + free_irq(irq_base + spu->priv_data->isrc, spu); +out: + return ret; +} +EXPORT_SYMBOL_GPL(spu_request_irqs); + +void spu_free_irqs(struct spu *spu) +{ + int irq_base; + + if(!spu->priv_data) { + pr_debug("null priv_data in %p\n", spu); + return; + } + + irq_base = IIC_NODE_STRIDE * spu->priv_data->node + IIC_SPE_OFFSET; + + free_irq(irq_base + spu->priv_data->isrc, spu); + free_irq(irq_base + IIC_CLASS_STRIDE + spu->priv_data->isrc, spu); + free_irq(irq_base + 2*IIC_CLASS_STRIDE + spu->priv_data->isrc, spu); + + kfree(spu->priv_data); + spu->priv_data = NULL; +} +EXPORT_SYMBOL_GPL(spu_free_irqs); + +void spu_irq_setaffinity(struct spu *spu, int cpu) +{ + u64 target = iic_get_target_id(cpu); + u64 route = target << 48 | target << 32 | target << 16; + spu_int_route_set(spu, route); +} +EXPORT_SYMBOL_GPL(spu_irq_setaffinity); void spu_int_mask_and(struct spu *spu, int class, u64 mask) { Index: alp-linux--dev--10/include/asm-powerpc/spu.h =================================================================== --- alp-linux--dev--10.orig/include/asm-powerpc/spu.h 2006-01-27 10:45:30.000000000 -0800 +++ alp-linux--dev--10/include/asm-powerpc/spu.h 2006-01-27 11:02:29.000000000 -0800 @@ -25,6 +25,7 @@ #include #include #include +#include #define LS_SIZE (256 * 1024) #define LS_ADDR_MASK (LS_SIZE - 1) @@ -103,20 +104,26 @@ struct spu_context; struct spu_runqueue; +struct spu_priv_data; +struct spu_phys { + unsigned long addr; + unsigned long size; +}; struct spu { + struct spu_priv_data *priv_data; /* opaque */ char *name; - unsigned long local_store_phys; + struct spu_phys local_store_phys; u8 *local_store; - unsigned long problem_phys; + struct spu_phys problem_phys; struct spu_problem __iomem *problem; + struct spu_phys priv1_phys; struct spu_priv1 __iomem *priv1; + struct spu_phys priv2_phys; struct spu_priv2 __iomem *priv2; struct list_head list; struct list_head sched_list; int number; - u32 isrc; - u32 node; u64 flags; u64 dar; u64 dsisr; @@ -178,7 +185,19 @@ } #endif -/* access to priv1 registers */ +/* base setup routines */ +int create_spu(void *spu_setup_data); + +/* platform setup routines */ +int enum_and_create_spu(void); +int spu_setup(struct spu *spu, void *spu_setup_data); +int spu_request_irqs(struct spu *spu, + irqreturn_t (*cls0)(int, void *, struct pt_regs *), + irqreturn_t (*cls1)(int, void *, struct pt_regs *), + irqreturn_t (*cls2)(int, void *, struct pt_regs *)); +void spu_free_irqs(struct spu *spu); + +/* platform priv1 register access */ void spu_int_mask_and(struct spu *spu, int class, u64 mask); void spu_int_mask_or(struct spu *spu, int class, u64 mask); void spu_int_mask_set(struct spu *spu, int class, u64 mask); From anton at samba.org Sat Jan 28 10:48:53 2006 From: anton at samba.org (Anton Blanchard) Date: Sat, 28 Jan 2006 10:48:53 +1100 Subject: iommu_alloc failure and panic In-Reply-To: <1138381060.11796.22.camel@markh3.pdx.osdl.net> References: <1138381060.11796.22.camel@markh3.pdx.osdl.net> Message-ID: <20060127234853.GA17018@krispykreme> Hi, > I have been testing large numbers of storage devices. I have 16000 scsi > LUNs configured. (4000 fiberchannel LUNS seen 4 times). They are > configured as 4000 multipath devices using device mapper. I have 100 of > those devices configured as a logical volume using LVM2. Once I start > bonnie++ using one of those logical volumes I start seeing iommu_alloc > failures and then a panic. I don't have this issue when accessing the > individual devices or the individual multipath devices. Only when > conglomerated into a logical volume. > > Here is the syslog output: > > Jan 26 14:56:41 linux kernel: iommu_alloc failed, tbl c00000000263c480 vaddr c0000000d7967000 npages 10 This stuff should be OK since the lpfc driver should handle the iommu filling up. Im guessing since you have so many LUNs you can get a whole lot of outstanding IO, enough to fill up the TCE table. > DAR: C000000600711710 > NIP [C00000000000F7D0] .validate_sp+0x30/0xc0 > LR [C00000000000FA2C] .show_stack+0xec/0x1d0 > Call Trace: > [C0000000076DBBC0] [C00000000000FA18] .show_stack+0xd8/0x1d0 (unreliable) > [C0000000076DBC60] [C000000000433838] .schedule+0xd78/0xfb0 > [C0000000076DBDE0] [C000000000079FC0] .worker_thread+0x1b0/0x1c0 This is interesting, an oops in validate_sp which is a pretty boring function. We have seen this in the past when you overflow your kernel stack. The bottom of the kernel stack contains the threadinfo struct and in that we have the task_cpu() data. When we overflow the stack and overwrite the threadinfo we end up with a crazy number for task_cpu() and then oops when doing hardirq_ctx[task_cpu(p)]. Can you turn on DEBUG_STACKOVERFLOW and DEBUG_STACK_USAGE and see if you get any stack overflow warnings? The second option will also allow you to do sysrq t and dump the most stack each process has used at that point. Anton From markh at osdl.org Sat Jan 28 11:00:47 2006 From: markh at osdl.org (Mark Haverkamp) Date: Fri, 27 Jan 2006 16:00:47 -0800 Subject: iommu_alloc failure and panic In-Reply-To: <20060127234853.GA17018@krispykreme> References: <1138381060.11796.22.camel@markh3.pdx.osdl.net> <20060127234853.GA17018@krispykreme> Message-ID: <1138406447.11796.32.camel@markh3.pdx.osdl.net> On Sat, 2006-01-28 at 10:48 +1100, Anton Blanchard wrote: > Hi, > > > I have been testing large numbers of storage devices. I have 16000 scsi > > LUNs configured. (4000 fiberchannel LUNS seen 4 times). They are > > configured as 4000 multipath devices using device mapper. I have 100 of > > those devices configured as a logical volume using LVM2. Once I start > > bonnie++ using one of those logical volumes I start seeing iommu_alloc > > failures and then a panic. I don't have this issue when accessing the > > individual devices or the individual multipath devices. Only when > > conglomerated into a logical volume. > > > > Here is the syslog output: > > > > Jan 26 14:56:41 linux kernel: iommu_alloc failed, tbl c00000000263c480 vaddr c0000000d7967000 npages 10 > > This stuff should be OK since the lpfc driver should handle the iommu > filling up. Im guessing since you have so many LUNs you can get a whole > lot of outstanding IO, enough to fill up the TCE table. > > > DAR: C000000600711710 > > > NIP [C00000000000F7D0] .validate_sp+0x30/0xc0 > > LR [C00000000000FA2C] .show_stack+0xec/0x1d0 > > Call Trace: > > [C0000000076DBBC0] [C00000000000FA18] .show_stack+0xd8/0x1d0 (unreliable) > > [C0000000076DBC60] [C000000000433838] .schedule+0xd78/0xfb0 > > [C0000000076DBDE0] [C000000000079FC0] .worker_thread+0x1b0/0x1c0 > > This is interesting, an oops in validate_sp which is a pretty boring > function. We have seen this in the past when you overflow your kernel > stack. The bottom of the kernel stack contains the threadinfo struct and > in that we have the task_cpu() data. > > When we overflow the stack and overwrite the threadinfo we end up with > a crazy number for task_cpu() and then oops when doing > hardirq_ctx[task_cpu(p)]. Can you turn on DEBUG_STACKOVERFLOW and > DEBUG_STACK_USAGE and see if you get any stack overflow warnings? It looks like they are already on: CONFIG_DEBUG_STACKOVERFLOW=y CONFIG_DEBUG_STACK_USAGE=y > The > second option will also allow you to do sysrq t and dump the most stack > each process has used at that point. The machine is frozen after the panic. Mark. > > Anton -- Mark Haverkamp From arnd at arndb.de Sat Jan 28 11:05:16 2006 From: arnd at arndb.de (Arnd Bergmann) Date: Sat, 28 Jan 2006 01:05:16 +0100 Subject: spufs platform dependent code In-Reply-To: <43DAB0BD.6010303@am.sony.com> References: <200601272131.56936.arnd@arndb.de> <43DAB0BD.6010303@am.sony.com> Message-ID: <200601280105.16729.arnd@arndb.de> On Saturday 28 January 2006 00:46, Geoff Levand wrote: > Arnd Bergmann wrote: > > I agree that in the long term, we may want to optimize for the case > > where we have a single kernel binary that has all possible options > > enabled, which would work better with a function pointer. > > > I started some work on this. ? I'll post a patch for comment, maybe > next week. Ok, great. I'll be mostly offline during the next few weeks so I might not be able to comment on your patches. > > I'm not sure I could follow you. My idea of the cell platform > > code is that it ought to be generic enough to work with all > > hardware that has some SPU support in it. Right now, a lot of > > stuff is hardwired to use the stuff we have on the Cell Blade, > > but that only means that so far nobody has submitted a patch > > to extend this to any other hardware. > > I found you have some stuff in there specific to your platform. > It assumes there is a certain south bridge, and that spu > interrupts are serviced by that south bridge. ?It also makes > assumptions of how the spu's are represented in the device tree. > > I've got a first cut patch to break those things out. ?I'll post > it soon for comment. The stuff that is specific to our south bridge should be fairly independant from anything that is related to spu code. If you have http://patchwork.ozlabs.org/linuxppc64/patch?id=4188 applied, it should already become a bit cleaner. Since the base code is just using the internal interrupt controller interfaces that are specified in the CBE Architecture documents, I assumed they were pretty universal, even when using hcall interfaces instead of mmio access. Is that different for your implementation? Regarding the device tree representation of SPUs, we failed to document this properly in the past, but I strongly feel that we should standardize on a common representation before any system ships in large quantaties. Of course I would rather not have to make changes to our current firmware, but if you have requirements that can not be met with what we are doing now, we might get convinced to adapt to what you are doing or some compromize. > > Did I get you right that you instead want to add a separate > > platform directory for your hypervisor abstraction? > > Since I haven't seen your code, I don't know how much it differs > > from what we have so far and can't really tell which would be > > better. > > > > For the spu_priv1.c file, it's proably easiest to do it similar > > to the abstraction we already have for spu_context_ops, the files > > could e.g. be named spu_priv1_mmio.c and spu_priv1_hvcall.c. > > > Sorry for the confusion, what I meant was that if we move the > interrupt code, etc. to spu_priv1.c, it becomes more than just > priv1 wrappers, so I thought it might be better to name it > something else. > > I was also thinking to put support for all platforms into > arch/powerpc/platforms/cell, each in a different file. ?But > on consideration it might work better to put them into a > separate directory. ?Let's not decide that now though, and > just focus on splitting out the platform code from spu_base.c > and doing the wrappers. > ok, agreed. Arnd <>< From geoffrey.levand at am.sony.com Sat Jan 28 12:11:40 2006 From: geoffrey.levand at am.sony.com (Geoff Levand) Date: Fri, 27 Jan 2006 17:11:40 -0800 Subject: spufs platform dependent code In-Reply-To: <200601280105.16729.arnd@arndb.de> References: <200601280105.16729.arnd@arndb.de> Message-ID: <43DAC4CC.4040907@am.sony.com> Arnd Bergmann wrote: > On Saturday 28 January 2006 00:46, Geoff Levand wrote: >>I found you have some stuff in there specific to your platform. >>It assumes there is a certain south bridge, and that spu >>interrupts are serviced by that south bridge. It also makes >>assumptions of how the spu's are represented in the device tree. >> >>I've got a first cut patch to break those things out. I'll post >>it soon for comment. > > > The stuff that is specific to our south bridge should be fairly > independant from anything that is related to spu code. If you have > http://patchwork.ozlabs.org/linuxppc64/patch?id=4188 applied, > it should already become a bit cleaner. > > Since the base code is just using the internal interrupt controller > interfaces that are specified in the CBE Architecture documents, > I assumed they were pretty universal, even when using hcall interfaces > instead of mmio access. Is that different for your implementation? OK, maybe things can be be pushed down to lower level routines. > Regarding the device tree representation of SPUs, we failed to > document this properly in the past, but I strongly feel that we should > standardize on a common representation before any system ships in > large quantaties. Of course I would rather not have to make changes > to our current firmware, but if you have requirements that can not > be met with what we are doing now, we might get convinced to adapt > to what you are doing or some compromize. OK, I agree with you. It will take me some time to gather the details. For now just refer to the split-out patch I posted. -Geoff From segher at kernel.crashing.org Sat Jan 28 23:06:32 2006 From: segher at kernel.crashing.org (Segher Boessenkool) Date: Sat, 28 Jan 2006 13:06:32 +0100 Subject: Need to arbitrarily set PCI-PCI bridge memory window size. In-Reply-To: <43D905B1.6010201@yahoo.fr> References: <43D905B1.6010201@yahoo.fr> Message-ID: > We have designed a VME board based on the IBM 970 Maple design. > For accessing VME, we use the PCI-VME Tundra Universe2 bridge. > (http://www.tundra.com/Products/Bridges/UniverseII/index.cfm) No free docs (well, registration required), so I have to do a bit of guessing here... > It's located on the PCI bus hanging from the AMD8111. > The PCI-VME bridge works by translating a range of PCI addresses > (1Gbytes in my case) to VME. > So I need the AMD8111 memory window (PCI CFG off 0x20) to be wide > enough to let that range > of PCI addresses reach the subordinate PCI bus that holds the PCI-VME > bridge. Does the UniverseII device show that range in its PCI config regs, too? If not, Linux will probably mess up the range on the PCI-PCI bridge (on the 8111). > The problem is that the PCI_VME controller BARs only defines and map > the > chip register sets (4KB). Right. > And it looks > like the ppc64 linux kernel will set a memory window in the AMD8111 > just large enough to meet requirements of > BARs from devices on the subordinate bus. > > Is there a way I can tell linux to program a wider window to let > through > the PCI to VME range of addresses? You can of course hack up the Linux source, but there's another option. You can set the 8111 PCI bus to be subtractively decoded, i.e., all accesses that aren't claimed by anything else will go to the PCI bus. See the config reg devB:0x40, bit 5. > Currently I manually program the AMD8111 from my VME driver, but it is > just a hack. I have also tried to set > the window from the firmware but linux doesn't care. Yes, Linux _loves_ to reprogram your PCI bridges to what it thinks are better settings. That, combined with "weird" PCI devices is a bit of a pain. Sigh. Segher From anton at samba.org Sat Jan 28 12:19:48 2006 From: anton at samba.org (Anton Blanchard) Date: Sat, 28 Jan 2006 12:19:48 +1100 Subject: iommu_alloc failure and panic In-Reply-To: <1138406447.11796.32.camel@markh3.pdx.osdl.net> References: <1138381060.11796.22.camel@markh3.pdx.osdl.net> <20060127234853.GA17018@krispykreme> <1138406447.11796.32.camel@markh3.pdx.osdl.net> Message-ID: <20060128011948.GB17018@krispykreme> Hi, > It looks like they are already on: > > CONFIG_DEBUG_STACKOVERFLOW=y > CONFIG_DEBUG_STACK_USAGE=y You could try bumping the limit for the warning in arch/powerpc/kernel/irq.c if (unlikely(sp < (sizeof(struct thread_info) + 2048))) Change it to 4096. Unfortunately if the long call chain is in an interrupt disabled area you will not get warned. > The machine is frozen after the panic. You can do it sometime before the hang to see if you are getting close to overflowing the stack. Anton From benh at kernel.crashing.org Sun Jan 29 23:47:09 2006 From: benh at kernel.crashing.org (Benjamin Herrenschmidt) Date: Sun, 29 Jan 2006 23:47:09 +1100 Subject: spufs platform dependent code In-Reply-To: <43DAB0BD.6010303@am.sony.com> References: <200601272131.56936.arnd@arndb.de> <43DAB0BD.6010303@am.sony.com> Message-ID: <1138538830.24530.14.camel@localhost.localdomain> > I found you have some stuff in there specific to your platform.It assumes there is a certain south bridge, and that spuinterrupts are serviced by that south bridge. It also makesassumptions of how the spu's are represented in the device tree. > I've got a first cut patch to break those things out. I'll postit soon for comment. The device-tree representation should be made independant. We need you guys to agree on it and stick to one representation. I strongly suggest you document it too. Ben. From anton at samba.org Mon Jan 30 10:15:24 2006 From: anton at samba.org (Anton Blanchard) Date: Mon, 30 Jan 2006 10:15:24 +1100 Subject: PPC64 boot failure with 2.6.15 In-Reply-To: <200601252353.39095.vax@purdue.edu> References: <200601251821.47557.pat@computer-refuge.org> <20060126022342.GA32008@krispykreme> <200601252307.45741.pat@computer-refuge.org> <200601252353.39095.vax@purdue.edu> Message-ID: <20060129231524.GB32008@krispykreme> > Grumble. It looks like I was wrong (I compiled a UP kernel, not an > SMP one). The change doesn't fix anything; it still has the message: > mpic: Setting up MPIC " MPIC " version 1.at fec00000, max 1 CPUs Its still going to report that incorrect value, but it should map all the per cpu interrupt structures with that patch (it wasnt before). Anton From pat at purdueriots.com Mon Jan 30 12:43:45 2006 From: pat at purdueriots.com (Patrick Finnegan) Date: Sun, 29 Jan 2006 20:43:45 -0500 Subject: PPC64 boot failure with 2.6.15 In-Reply-To: <20060129231524.GB32008@krispykreme> References: <200601251821.47557.pat@computer-refuge.org> <200601252353.39095.vax@purdue.edu> <20060129231524.GB32008@krispykreme> Message-ID: <200601292043.45244.pat@purdueriots.com> On Sunday 29 January 2006 18:15, Anton Blanchard wrote: > > Grumble. It looks like I was wrong (I compiled a UP kernel, not an > > SMP one). The change doesn't fix anything; it still has the message: > > mpic: Setting up MPIC " MPIC " version 1.at fec00000, max 1 CPUs > > Its still going to report that incorrect value, but it should map all > the per cpu interrupt structures with that patch (it wasnt before). Yes, but it still panics with the patch, in smp mode. Pat -- Purdue University ITAP/RCS Information Technology at Purdue Research Computing and Storage http://www.itap.purdue.edu/rcs/ From markh at osdl.org Tue Jan 31 02:32:58 2006 From: markh at osdl.org (Mark Haverkamp) Date: Mon, 30 Jan 2006 07:32:58 -0800 Subject: iommu_alloc failure and panic In-Reply-To: <20060127233443.GB26653@pb15.lixom.net> References: <1138381060.11796.22.camel@markh3.pdx.osdl.net> <20060127204022.GA26653@pb15.lixom.net> <1138401590.11796.26.camel@markh3.pdx.osdl.net> <20060127233443.GB26653@pb15.lixom.net> Message-ID: <1138635178.5150.1.camel@markh3.pdx.osdl.net> On Sat, 2006-01-28 at 12:34 +1300, Olof Johansson wrote: > On Fri, Jan 27, 2006 at 02:39:50PM -0800, Mark Haverkamp wrote: > > > I would have thought that the npages would be 1 now. > > No, npages is the size of the allocation coming from the driver, that > won't chance. The table blocksize just says how wide the cacheline size > is, i.e. how far it should advance between allocations. > > This is a patch that should probably have been added a while ago, to > give a bit more info. Can you apply it and give it a go? > > > Thanks, > > Olof > Here are the last few lines of the log before it crashed. Jan 30 07:29:14 linux kernel: table size 10000 used f752 Jan 30 07:29:21 linux kernel: printk: 650 messages suppressed. Jan 30 07:29:21 linux kernel: iommu_alloc_sg failed, tbl c0000001e794dd80 vaddr c000000059424000 npages 10 Jan 30 07:29:21 linux kernel: table size 10000 used f2c9 Jan 30 07:29:25 linux kernel: printk: 590 messages suppressed. Jan 30 07:29:25 linux kernel: iommu_alloc_sg failed, tbl c0000001e794dd80 vaddr c00000007c5f9000 npages e Jan 30 07:29:25 linux kernel: table size 10000 used f6ae Jan 30 07:29:29 linux kernel: printk: 705 messages suppressed. Jan 30 07:29:29 linux kernel: iommu_alloc_sg failed, tbl c0000001e794dd80 vaddr c0000000d3c9f000 npages e Jan 30 07:29:29 linux kernel: table size 10000 used f530 Jan 30 07:29:35 linux kernel: printk: 357 messages suppressed. Jan 30 07:29:35 linux kernel: iommu_alloc_sg failed, tbl c0000001e794dd80 vaddr c00000010156b000 npages 10 Jan 30 07:29:35 linux kernel: table size 10000 used e69e Jan 30 07:29:39 linux kernel: printk: 481 messages suppressed. Jan 30 07:29:39 linux kernel: iommu_alloc_sg failed, tbl c0000001e794dd80 vaddr c00000007616b000 npages 10 Jan 30 07:29:39 linux kernel: table size 10000 used f8e2 Jan 30 07:30:02 linux kernel: printk: 366 messages suppressed. Jan 30 07:30:02 linux kernel: iommu_alloc_sg failed, tbl c0000001e794dd80 vaddr c0000000b0f80000 npages 10 Jan 30 07:30:02 linux kernel: table size 10000 used fbf2 Jan 30 07:30:02 linux kernel: iommu_alloc_sg failed, tbl c0000001e794dd80 vaddr c0000000b43d3000 npages 10 Jan 30 07:30:02 linux kernel: table size 10000 used fc00 Jan 30 07:30:02 linux kernel: iommu_alloc_sg failed, tbl c0000001e794dd80 vaddr c0000000ac267000 npages 10 Jan 30 07:30:02 linux kernel: table size 10000 used fbf1 Jan 30 07:30:02 linux kernel: iommu_alloc_sg failed, tbl c0000001e794dd80 vaddr c0000000b7380000 npages 10 Jan 30 07:30:02 linux kernel: table size 10000 used fc66 Jan 30 07:30:04 linux kernel: printk: 417 messages suppressed. Jan 30 07:30:04 linux kernel: iommu_alloc_sg failed, tbl c0000001e794dd80 vaddr c0000000d94be000 npages 10 Jan 30 07:30:04 linux kernel: table size 10000 used ffd2 Jan 30 07:30:09 linux kernel: printk: 957 messages suppressed. Jan 30 07:30:09 linux kernel: iommu_alloc_sg failed, tbl c0000001e794dd80 vaddr c0000000e59c0000 npages e Jan 30 07:30:09 linux kernel: table size 10000 used fd18 Jan 30 07:30:14 linux kernel: printk: 990 messages suppressed. Jan 30 07:30:14 linux kernel: iommu_alloc_sg failed, tbl c0000001e794dd80 vaddr c0000001019c3000 npages 10 Jan 30 07:30:14 linux kernel: table size 10000 used fa2b Jan 30 07:30:19 linux kernel: printk: 881 messages suppressed. Jan 30 07:30:19 linux kernel: iommu_alloc_sg failed, tbl c0000001e794dd80 vaddr c000000066901000 npages 10 Jan 30 07:30:19 linux kernel: table size 10000 used ee58 Jan 30 07:30:24 linux kernel: printk: 1094 messages suppressed. Jan 30 07:30:24 linux kernel: iommu_alloc_sg failed, tbl c0000001e794dd80 vaddr c00000011d110000 npages 10 Jan 30 07:30:24 linux kernel: table size 10000 used f74a Jan 30 07:30:29 linux kernel: printk: 890 messages suppressed. Jan 30 07:30:29 linux kernel: iommu_alloc_sg failed, tbl c0000001e794dd80 vaddr c00000007db1c000 npages 10 Jan 30 07:30:29 linux kernel: table size 10000 used f6e3 Jan 30 07:30:34 linux kernel: printk: 1020 messages suppressed. Jan 30 07:30:34 linux kernel: iommu_alloc_sg failed, tbl c0000001e794dd80 vaddr c00000004759f000 npages 10 Jan 30 07:30:34 linux kernel: table size 10000 used f972 Jan 30 07:30:39 linux kernel: printk: 1209 messages suppressed. Jan 30 07:30:39 linux kernel: iommu_alloc_sg failed, tbl c0000001e794dd80 vaddr c00000003a39b000 npages 10 Jan 30 07:30:39 linux kernel: table size 10000 used e358 Jan 30 07:30:44 linux kernel: printk: 608 messages suppressed. Jan 30 07:30:44 linux kernel: iommu_alloc_sg failed, tbl c0000001e794dd80 vaddr c00000000b086000 npages 10 Jan 30 07:30:44 linux kernel: table size 10000 used ff52 -- Mark Haverkamp From pat at computer-refuge.org Tue Jan 31 03:28:36 2006 From: pat at computer-refuge.org (Patrick Finnegan) Date: Mon, 30 Jan 2006 11:28:36 -0500 Subject: PPC64 boot failure with 2.6.15 In-Reply-To: <200601292043.45244.pat@purdueriots.com> References: <200601251821.47557.pat@computer-refuge.org> <20060129231524.GB32008@krispykreme> <200601292043.45244.pat@purdueriots.com> Message-ID: <200601301128.36100.pat@computer-refuge.org> On Sunday 29 January 2006 20:43, Patrick Finnegan wrote: > On Sunday 29 January 2006 18:15, Anton Blanchard wrote: > > > Grumble. It looks like I was wrong (I compiled a UP kernel, not an > > > SMP one). The change doesn't fix anything; it still has the message: > > > mpic: Setting up MPIC " MPIC " version 1.at fec00000, max 1 CPUs > > > > Its still going to report that incorrect value, but it should map all > > the per cpu interrupt structures with that patch (it wasnt before). > > Yes, but it still panics with the patch, in smp mode. Ok, with the patch, it actually dies earlier, after spitting out these messages (no panic message is printed): requesting IPIs ... IPIs requested... cessor 1 found. And then, the system resets. Pat -- Purdue University ITAP/RCAC --- http://www.rcac.purdue.edu/ The Computer Refuge --- http://computer-refuge.org From trini at kernel.crashing.org Tue Jan 31 04:17:59 2006 From: trini at kernel.crashing.org (Tom Rini) Date: Mon, 30 Jan 2006 10:17:59 -0700 Subject: Maple fails to boot current git Message-ID: <20060130171759.GE22672@smtp.west.cox.net> Hello, trying to boot my maple board (ppc64_defconfig + CONFIG_PPC_EARLY_DEBUG_MAPLE=y) fails as follows (the "dirty" is #define DEBUG in kernel/prom_parse.c and platforms/maple/time.c): Memory test starting...OK .. ---------------------------------------------------- PowerPC Initialization and Boot Software (PIBS) COPYRIGHT I B M CORPORATION 2001, 2004 LICENSED MATERIAL - PROGRAM PROPERTY OF I B M Version 1.05.0000 04/26/2005 ---------------------------------------------------- XX XXX XXXX XX XX XX XX XXX XXX XX XXXXXXX XX XX XX XX XXXXX XX XX XX XX XX XX XX XXXXXXX XX XXXXX XX XX XX XX XX X XX XXXX XXXXXX XXXXXXX XXXXX XXXXXXX XXXX ---------------------------------------------------- board config data version: 1.1 processor name : 970FX processor PVR value : 0x003c0300 timer clock frequency : 175000000 total SDRAM memory : 1073741824 SDRAM frequency : 266666666 system clk frequency (Hz): 175000000 CPU frequency : 1400000000 CPU frequency ind. est. : 1400003500 CPU to EI speed ratio : 2:1 frequency scaling divider: 1 serial clk frequency : 1843200 HID0 value : 0011008180000000 HID1 value : fd3c200000000000 HID4 value : 0000001000000000 HID5 value : 0000000000000080 SDR1 value : 0000000000d00000 Temperature data : N/A, N/A, 20.0, 20.0, 23.0, 21.5, 20.0, 22.0 Ethernet hardware addr 0 : 0003CC3C013D ------------------------------------------- status: starting Ethernet configuration status: DHCP configuration completed add net default: gateway 192.168.2.1 enet0: flags=63 metric 0 inet 192.168.2.12 netmask ffffff00 broadcast 192.168.2.255 status: autoboot "eth" in 4 seconds 004003002001status: ready for TFTP binary file transfer status: requesting file vmlinuz-ibm-970fx status: from 192.168.2.1 status: block=00001block=04844block=06074 zImage starting: loaded at 0x00400000 (sp: 0x00ff84a0) Allocating 0x838a68 bytes for kernel ... OF version = 'some_model' gunzipping (0x1400000 <- 0x406000:0x6e62a5)...done 0x7c4970 bytes OF stdout device is: /ht at 0/isa at 4/serial at 3f8 command line: console=ttyS0,115200 ip=on kgdboe=@192.168.2.13/eth0, at 192.168.2.1/ memory layout at init: memory_limit : 0000000000000000 (16 MB aligned) alloc_bottom : 0000000001c3d000 alloc_top : 0000000030000000 alloc_top_hi : 0000000040000000 rmo_top : 0000000030000000 ram_top : 0000000040000000 Looking for displays 0000000000000000 : boot cpu 0000000000000000 0000000000000001 : starting cpu hw idx 0000000000000001... done copying OF device tree ... Building dt strings... Building dt structure... Device tree strings 0x0000000001c3e000 -> 0x0000000001c3e346 Device tree struct 0x0000000001c3f000 -> 0x0000000001c41000 Calling quiesce ... returning from prom_init -> maple_init_early <- maple_init_early Page orders: linear mapping = 24, others = 12 DART: table not allocated, using direct DMA Starting Linux PPC64 #8 SMP Mon Jan 30 10:07:21 MST 2006 ----------------------------------------------------- ppc64_pft_size = 0x0 ppc64_interrupt_controller = 0x1 platform = 0x500 physicalMemorySize = 0x40000000 ppc64_caches.dcache_line_size = 0x80 ppc64_caches.icache_line_size = 0x80 htab_address = 0xc00000003f000000 htab_hash_mask = 0x1ffff ----------------------------------------------------- *** 0000 : CF000100 *** 0000 : MM Init [boot]0100 MM Init *** 0000 : CF000100 *** 0000 : MM Init Done [boot]0100 MM Init Done Linux version 2.6.16-rc1-g076d022c-dirty (trini at Bill-The-Cat) (gcc version 3.4.3 (MontaVista 3.4.3-25.0.70.0501961 2005-12-18)) #8 SMP Mon Jan 30 10:07:21 MST 2006 *** 0000 : CF000012 *** 0000 : Setup Arch [boot]0012 Setup Arch Adding PCI host bridge /ht at 0 Found U3-HT PCI host bridge. Firmware bus number: 0->239 no ISA ranges or unexpected isa range size,mapping 64k PCI Host 0, io start: 0; io end: 3fffff Using native/NAP idle loop Top of RAM: 0x40000000, Total RAM: 0x40000000 Memory hole size: 0MB *** 0000 : CF000015 *** 0000 : Setup Done [boot]0015 Setup Done Built 1 zonelists Kernel command line: console=ttyS0,115200 ip=on kgdboe=@192.168.2.13/eth0, at 192.168.2.1/ -> maple_init_IRQ mpic: Setting up MPIC "U3-MPIC" version 1.2 at f8040000, max 4 CPUs mpic: ISU size: 124, shift: 7, mask: 7f mpic: Initializing for 124 sources mpic: Setting up HT PICs workarounds for U3/U4 mpic: - HT:01.0 [0xb8] vendor 1022 device 7450 has 4 irqs mpic: - HT:02.0 [0xb8] vendor 1022 device 7450 has 4 irqs mpic: - HT:03.0 [0xf0] vendor 1022 device 7460 has 24 irqs <- maple_init_IRQ PID hash table entries: 4096 (order: 12, 131072 bytes) time_init: decrementer frequency = 175.000000 MHz time_init: processor frequency = 1400.000000 MHz OF: ** translation for device /ht at 0/isa at 4/rtc at 900 ** OF: bus is isa (na=2, ns=1) on /ht at 0/isa at 4 OF: translating address: 00000001 00000900 OF: parent bus is default (na=3, ns=2) on /ht at 0 OF: walking ranges... OF: not found ! Maple: Unable to translate RTC address Maple: No device node for RTC, assuming legacy address (0x70) -- Tom Rini http://gate.crashing.org/~trini/ From benh at kernel.crashing.org Tue Jan 31 09:40:28 2006 From: benh at kernel.crashing.org (Benjamin Herrenschmidt) Date: Tue, 31 Jan 2006 09:40:28 +1100 Subject: PPC64 boot failure with 2.6.15 In-Reply-To: <200601262025.44777.pat@computer-refuge.org> References: <200601251821.47557.pat@computer-refuge.org> <200601252307.45741.pat@computer-refuge.org> <200601260051.00902.pat@computer-refuge.org> <200601262025.44777.pat@computer-refuge.org> Message-ID: <1138660828.12601.21.camel@localhost.localdomain> > Ok, it appears that 2.6.10-rc1 was the last version of the kernel that > would boot (in SMP mode) on here. > > Any hints on what to look at? Interesting... best would be to try to bisect to find out what specific patch broke it but I understand that's not easy with those old kernels that were maintained with bitkeeper... Maybe you could try to spot which daily bk snapshot broke it if they are still available somewhere ? Ben. From mostrows at watson.ibm.com Tue Jan 31 10:10:30 2006 From: mostrows at watson.ibm.com (Michal Ostrowski) Date: Mon, 30 Jan 2006 18:10:30 -0500 Subject: LINUXPPC64 Maple fails to boot current git In-Reply-To: <20060130171759.GE22672@smtp.west.cox.net> References: <20060130171759.GE22672@smtp.west.cox.net> Message-ID: <1138662630.3417.26.camel@brick.watson.ibm.com> I saw something similar on a JS-20 w SLOF. The last message you see is related to the RTC driver, but the next thing to run after that is console_init(), which was where my system was dying. Dropping the "#ifdef CONFIG_ISA" statements in arch/powerpc/kernel/legacy_serial.c appears to fix things, and I've been told that a patch to this effect has been posted (though I've yet to see it). -- Michal Ostrowski On Mon, 2006-01-30 at 10:17 -0700, Tom Rini wrote: > Hello, trying to boot my maple board (ppc64_defconfig + > CONFIG_PPC_EARLY_DEBUG_MAPLE=y) fails as follows (the "dirty" is > #define DEBUG in kernel/prom_parse.c and platforms/maple/time.c): > > > Memory test starting...OK > .. > ---------------------------------------------------- > PowerPC Initialization and Boot Software (PIBS) > COPYRIGHT I B M CORPORATION 2001, 2004 > LICENSED MATERIAL - PROGRAM PROPERTY OF I B M > Version 1.05.0000 04/26/2005 > ---------------------------------------------------- > XX XXX XXXX > XX XX XX > XX XXX XXX XX XXXXXXX XX > XX XX XX XXXXX XX XX > XX XX XX XX XX XXXXXXX XX > XXXXX XX XX XX XX XX X > XX XXXX XXXXXX XXXXXXX XXXXX XXXXXXX > XXXX > ---------------------------------------------------- > board config data version: 1.1 > processor name : 970FX > processor PVR value : 0x003c0300 > timer clock frequency : 175000000 > total SDRAM memory : 1073741824 > SDRAM frequency : 266666666 > system clk frequency (Hz): 175000000 > CPU frequency : 1400000000 > CPU frequency ind. est. : 1400003500 > CPU to EI speed ratio : 2:1 > frequency scaling divider: 1 > serial clk frequency : 1843200 > HID0 value : 0011008180000000 > HID1 value : fd3c200000000000 > HID4 value : 0000001000000000 > HID5 value : 0000000000000080 > SDR1 value : 0000000000d00000 > Temperature data : N/A, N/A, 20.0, 20.0, 23.0, 21.5, 20.0, 22.0 > Ethernet hardware addr 0 : 0003CC3C013D > ------------------------------------------- > status: starting Ethernet configuration > status: DHCP configuration completed > add net default: gateway 192.168.2.1 > enet0: flags=63 metric 0 > inet 192.168.2.12 netmask ffffff00 broadcast 192.168.2.255 > status: autoboot "eth" in 4 seconds > 004003002001status: ready for TFTP binary file transfer > status: requesting file vmlinuz-ibm-970fx > status: from 192.168.2.1 > status: block=00001block=04844block=06074 > > zImage starting: loaded at 0x00400000 (sp: 0x00ff84a0) > Allocating 0x838a68 bytes for kernel ... > OF version = 'some_model' > gunzipping (0x1400000 <- 0x406000:0x6e62a5)...done 0x7c4970 bytes > OF stdout device is: /ht at 0/isa at 4/serial at 3f8 > command line: console=ttyS0,115200 ip=on kgdboe=@192.168.2.13/eth0, at 192.168.2.1/ > memory layout at init: > memory_limit : 0000000000000000 (16 MB aligned) > alloc_bottom : 0000000001c3d000 > alloc_top : 0000000030000000 > alloc_top_hi : 0000000040000000 > rmo_top : 0000000030000000 > ram_top : 0000000040000000 > Looking for displays > 0000000000000000 : boot cpu 0000000000000000 > 0000000000000001 : starting cpu hw idx 0000000000000001... done > copying OF device tree ... > Building dt strings... > Building dt structure... > Device tree strings 0x0000000001c3e000 -> 0x0000000001c3e346 > Device tree struct 0x0000000001c3f000 -> 0x0000000001c41000 > Calling quiesce ... > returning from prom_init > -> maple_init_early > <- maple_init_early > Page orders: linear mapping = 24, others = 12 > DART: table not allocated, using direct DMA > Starting Linux PPC64 #8 SMP Mon Jan 30 10:07:21 MST 2006 > ----------------------------------------------------- > ppc64_pft_size = 0x0 > ppc64_interrupt_controller = 0x1 > platform = 0x500 > physicalMemorySize = 0x40000000 > ppc64_caches.dcache_line_size = 0x80 > ppc64_caches.icache_line_size = 0x80 > htab_address = 0xc00000003f000000 > htab_hash_mask = 0x1ffff > ----------------------------------------------------- > *** 0000 : CF000100 > > *** 0000 : MM Init > [boot]0100 MM Init > *** 0000 : CF000100 > > *** 0000 : MM Init Done > [boot]0100 MM Init Done > Linux version 2.6.16-rc1-g076d022c-dirty (trini at Bill-The-Cat) (gcc version 3.4.3 (MontaVista 3.4.3-25.0.70.0501961 2005-12-18)) #8 SMP Mon Jan 30 10:07:21 MST 2006 > *** 0000 : CF000012 > > *** 0000 : Setup Arch > [boot]0012 Setup Arch > Adding PCI host bridge /ht at 0 > Found U3-HT PCI host bridge. Firmware bus number: 0->239 > no ISA ranges or unexpected isa range size,mapping 64k > PCI Host 0, io start: 0; io end: 3fffff > Using native/NAP idle loop > Top of RAM: 0x40000000, Total RAM: 0x40000000 > Memory hole size: 0MB > *** 0000 : CF000015 > > *** 0000 : Setup Done > [boot]0015 Setup Done > Built 1 zonelists > Kernel command line: console=ttyS0,115200 ip=on kgdboe=@192.168.2.13/eth0, at 192.168.2.1/ > -> maple_init_IRQ > mpic: Setting up MPIC "U3-MPIC" version 1.2 at f8040000, max 4 CPUs > mpic: ISU size: 124, shift: 7, mask: 7f > mpic: Initializing for 124 sources > mpic: Setting up HT PICs workarounds for U3/U4 > mpic: - HT:01.0 [0xb8] vendor 1022 device 7450 has 4 irqs > mpic: - HT:02.0 [0xb8] vendor 1022 device 7450 has 4 irqs > mpic: - HT:03.0 [0xf0] vendor 1022 device 7460 has 24 irqs > <- maple_init_IRQ > PID hash table entries: 4096 (order: 12, 131072 bytes) > time_init: decrementer frequency = 175.000000 MHz > time_init: processor frequency = 1400.000000 MHz > OF: ** translation for device /ht at 0/isa at 4/rtc at 900 ** > OF: bus is isa (na=2, ns=1) on /ht at 0/isa at 4 > OF: translating address: 00000001 00000900 > OF: parent bus is default (na=3, ns=2) on /ht at 0 > OF: walking ranges... > OF: not found ! > Maple: Unable to translate RTC address > Maple: No device node for RTC, assuming legacy address (0x70) > From david at gibson.dropbear.id.au Tue Jan 31 10:11:18 2006 From: david at gibson.dropbear.id.au (David Gibson) Date: Tue, 31 Jan 2006 12:11:18 +1300 Subject: Maple fails to boot current git In-Reply-To: <20060130171759.GE22672@smtp.west.cox.net> References: <20060130171759.GE22672@smtp.west.cox.net> Message-ID: <20060130231118.GA19671@localhost.localdomain> On Mon, Jan 30, 2006 at 10:17:59AM -0700, Tom Rini wrote: > Hello, trying to boot my maple board (ppc64_defconfig + > CONFIG_PPC_EARLY_DEBUG_MAPLE=y) fails as follows (the "dirty" is > #define DEBUG in kernel/prom_parse.c and platforms/maple/time.c): Crud. Our Maple is stuffed at the moment (doesn't complete the CPU init script, so PIBS never even comes up on the 970), so I can't really investigate. -- David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson From olof at lixom.net Tue Jan 31 10:13:48 2006 From: olof at lixom.net (Olof Johansson) Date: Tue, 31 Jan 2006 10:13:48 +1100 Subject: iommu_alloc failure and panic In-Reply-To: <1138635178.5150.1.camel@markh3.pdx.osdl.net> References: <1138381060.11796.22.camel@markh3.pdx.osdl.net> <20060127204022.GA26653@pb15.lixom.net> <1138401590.11796.26.camel@markh3.pdx.osdl.net> <20060127233443.GB26653@pb15.lixom.net> <1138635178.5150.1.camel@markh3.pdx.osdl.net> Message-ID: <20060130231348.GC9368@pb15.lixom.net> On Mon, Jan 30, 2006 at 07:32:58AM -0800, Mark Haverkamp wrote: > On Sat, 2006-01-28 at 12:34 +1300, Olof Johansson wrote: > > On Fri, Jan 27, 2006 at 02:39:50PM -0800, Mark Haverkamp wrote: > > > > > I would have thought that the npages would be 1 now. > > > > No, npages is the size of the allocation coming from the driver, that > > won't chance. The table blocksize just says how wide the cacheline size > > is, i.e. how far it should advance between allocations. > > > > This is a patch that should probably have been added a while ago, to > > give a bit more info. Can you apply it and give it a go? > > > > > > Thanks, > > > > Olof > > > > > Here are the last few lines of the log before it crashed. > > > Jan 30 07:29:14 linux kernel: table size 10000 used f752 Ok, that's a 256MB table, which is standard, and it seems to have been filled with mappings. in some cases there's a few entries left but it's likely that fragmentation causes the 10-entry alloc to fail, quite normal. There's two things to look at, unfortunately I fall short on both of them myself: 1) There's a way to get more than the default 256MB DMA window for a PCI slot. I'm not aware of the exact details, but you need recent firmware and you configure it in the ASM menues (the web interface for the service processor). Cc:ing Jake Moilanen in case he has any more up to date info. 2) The emulex driver has been prone to problems in the past where it's been very aggressive at starting DMA operations, and I think it can be avoided with tuning. What I don't know is if it's because of this, or simply because of the large number of targets you have. Cc:ing James Smart. -Olof From dwg at au1.ibm.com Tue Jan 31 11:47:22 2006 From: dwg at au1.ibm.com (David Gibson) Date: Tue, 31 Jan 2006 13:47:22 +1300 Subject: powerpc: Add flattened device tree documentation Message-ID: <20060131004722.GB19671@localhost.localdomain> Andrew, please apply. The flattened device tree is the only supported way of booting ARCH=powerpc kernels on non Open Firmware machines. The documentation for the flattened tree format and contents has been discussed on mailing lists and lately has been living in the dtc git tree. Really, it ought to go in the kernel's Documentation directory for maximum visibility. I know we're in -rc time, but as documentation only this can hardly break things. Can we push this in before 2.6.16, so that ongoing updates can start flowing there rather than continuing to be handled clumsily out of the tree? Signed-off-by: David Gibson Index: working-2.6/Documentation/powerpc/booting-without-of.txt =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 +++ working-2.6/Documentation/powerpc/booting-without-of.txt 2006-01-31 10:33:00.000000000 +1100 @@ -0,0 +1,1420 @@ + Booting the Linux/ppc kernel without Open Firmware + -------------------------------------------------- + + +(c) 2005 Benjamin Herrenschmidt , + IBM Corp. +(c) 2005 Becky Bruce , + Freescale Semiconductor, FSL SOC and 32-bit additions + + May 18, 2005: Rev 0.1 - Initial draft, no chapter III yet. + + May 19, 2005: Rev 0.2 - Add chapter III and bits & pieces here or + clarifies the fact that a lot of things are + optional, the kernel only requires a very + small device tree, though it is encouraged + to provide an as complete one as possible. + + May 24, 2005: Rev 0.3 - Precise that DT block has to be in RAM + - Misc fixes + - Define version 3 and new format version 16 + for the DT block (version 16 needs kernel + patches, will be fwd separately). + String block now has a size, and full path + is replaced by unit name for more + compactness. + linux,phandle is made optional, only nodes + that are referenced by other nodes need it. + "name" property is now automatically + deduced from the unit name + + June 1, 2005: Rev 0.4 - Correct confusion between OF_DT_END and + OF_DT_END_NODE in structure definition. + - Change version 16 format to always align + property data to 4 bytes. Since tokens are + already aligned, that means no specific + required alignement between property size + and property data. The old style variable + alignment would make it impossible to do + "simple" insertion of properties using + memove (thanks Milton for + noticing). Updated kernel patch as well + - Correct a few more alignement constraints + - Add a chapter about the device-tree + compiler and the textural representation of + the tree that can be "compiled" by dtc. + + + November 21, 2005: Rev 0.5 + - Additions/generalizations for 32-bit + - Changed to reflect the new arch/powerpc + structure + - Added chapter VI + + + ToDo: + - Add some definitions of interrupt tree (simple/complex) + - Add some definitions for pci host bridges + - Add some common address format examples + - Add definitions for standard properties and "compatible" + names for cells that are not already defined by the existing + OF spec. + - Compare FSL SOC use of PCI to standard and make sure no new + node definition required. + - Add more information about node definitions for SOC devices + that currently have no standard, like the FSL CPM. + + +I - Introduction +================ + +During the recent development of the Linux/ppc64 kernel, and more +specifically, the addition of new platform types outside of the old +IBM pSeries/iSeries pair, it was decided to enforce some strict rules +regarding the kernel entry and bootloader <-> kernel interfaces, in +order to avoid the degeneration that had become the ppc32 kernel entry +point and the way a new platform should be added to the kernel. The +legacy iSeries platform breaks those rules as it predates this scheme, +but no new board support will be accepted in the main tree that +doesn't follows them properly. In addition, since the advent of the +arch/powerpc merged architecture for ppc32 and ppc64, new 32-bit +platforms and 32-bit platforms which move into arch/powerpc will be +required to use these rules as well. + +The main requirement that will be defined in more detail below is +the presence of a device-tree whose format is defined after Open +Firmware specification. However, in order to make life easier +to embedded board vendors, the kernel doesn't require the device-tree +to represent every device in the system and only requires some nodes +and properties to be present. This will be described in detail in +section III, but, for example, the kernel does not require you to +create a node for every PCI device in the system. It is a requirement +to have a node for PCI host bridges in order to provide interrupt +routing informations and memory/IO ranges, among others. It is also +recommended to define nodes for on chip devices and other busses that +don't specifically fit in an existing OF specification. This creates a +great flexibility in the way the kernel can then probe those and match +drivers to device, without having to hard code all sorts of tables. It +also makes it more flexible for board vendors to do minor hardware +upgrades without significantly impacting the kernel code or cluttering +it with special cases. + + +1) Entry point for arch/powerpc +------------------------------- + + There is one and one single entry point to the kernel, at the start + of the kernel image. That entry point supports two calling + conventions: + + a) Boot from Open Firmware. If your firmware is compatible + with Open Firmware (IEEE 1275) or provides an OF compatible + client interface API (support for "interpret" callback of + forth words isn't required), you can enter the kernel with: + + r5 : OF callback pointer as defined by IEEE 1275 + bindings to powerpc. Only the 32 bit client interface + is currently supported + + r3, r4 : address & length of an initrd if any or 0 + + The MMU is either on or off; the kernel will run the + trampoline located in arch/powerpc/kernel/prom_init.c to + extract the device-tree and other information from open + firmware and build a flattened device-tree as described + in b). prom_init() will then re-enter the kernel using + the second method. This trampoline code runs in the + context of the firmware, which is supposed to handle all + exceptions during that time. + + b) Direct entry with a flattened device-tree block. This entry + point is called by a) after the OF trampoline and can also be + called directly by a bootloader that does not support the Open + Firmware client interface. It is also used by "kexec" to + implement "hot" booting of a new kernel from a previous + running one. This method is what I will describe in more + details in this document, as method a) is simply standard Open + Firmware, and thus should be implemented according to the + various standard documents defining it and its binding to the + PowerPC platform. The entry point definition then becomes: + + r3 : physical pointer to the device-tree block + (defined in chapter II) in RAM + + r4 : physical pointer to the kernel itself. This is + used by the assembly code to properly disable the MMU + in case you are entering the kernel with MMU enabled + and a non-1:1 mapping. + + r5 : NULL (as to differenciate with method a) + + Note about SMP entry: Either your firmware puts your other + CPUs in some sleep loop or spin loop in ROM where you can get + them out via a soft reset or some other means, in which case + you don't need to care, or you'll have to enter the kernel + with all CPUs. The way to do that with method b) will be + described in a later revision of this document. + + +2) Board support +---------------- + +64-bit kernels: + + Board supports (platforms) are not exclusive config options. An + arbitrary set of board supports can be built in a single kernel + image. The kernel will "know" what set of functions to use for a + given platform based on the content of the device-tree. Thus, you + should: + + a) add your platform support as a _boolean_ option in + arch/powerpc/Kconfig, following the example of PPC_PSERIES, + PPC_PMAC and PPC_MAPLE. The later is probably a good + example of a board support to start from. + + b) create your main platform file as + "arch/powerpc/platforms/myplatform/myboard_setup.c" and add it + to the Makefile under the condition of your CONFIG_ + option. This file will define a structure of type "ppc_md" + containing the various callbacks that the generic code will + use to get to your platform specific code + + c) Add a reference to your "ppc_md" structure in the + "machines" table in arch/powerpc/kernel/setup_64.c if you are + a 64-bit platform. + + d) request and get assigned a platform number (see PLATFORM_* + constants in include/asm-powerpc/processor.h + +32-bit embedded kernels: + + Currently, board support is essentially an exclusive config option. + The kernel is configured for a single platform. Part of the reason + for this is to keep kernels on embedded systems small and efficient; + part of this is due to the fact the code is already that way. In the + future, a kernel may support multiple platforms, but only if the + platforms feature the same core architectire. A single kernel build + cannot support both configurations with Book E and configurations + with classic Powerpc architectures. + + 32-bit embedded platforms that are moved into arch/powerpc using a + flattened device tree should adopt the merged tree practice of + setting ppc_md up dynamically, even though the kernel is currently + built with support for only a single platform at a time. This allows + unification of the setup code, and will make it easier to go to a + multiple-platform-support model in the future. + +NOTE: I believe the above will be true once Ben's done with the merge +of the boot sequences.... someone speak up if this is wrong! + + To add a 32-bit embedded platform support, follow the instructions + for 64-bit platforms above, with the exception that the Kconfig + option should be set up such that the kernel builds exclusively for + the platform selected. The processor type for the platform should + enable another config option to select the specific board + supported. + +NOTE: If ben doesn't merge the setup files, may need to change this to +point to setup_32.c + + + I will describe later the boot process and various callbacks that + your platform should implement. + + +II - The DT block format +======================== + + +This chapter defines the actual format of the flattened device-tree +passed to the kernel. The actual content of it and kernel requirements +are described later. You can find example of code manipulating that +format in various places, including arch/powerpc/kernel/prom_init.c +which will generate a flattened device-tree from the Open Firmware +representation, or the fs2dt utility which is part of the kexec tools +which will generate one from a filesystem representation. It is +expected that a bootloader like uboot provides a bit more support, +that will be discussed later as well. + +Note: The block has to be in main memory. It has to be accessible in +both real mode and virtual mode with no mapping other than main +memory. If you are writing a simple flash bootloader, it should copy +the block to RAM before passing it to the kernel. + + +1) Header +--------- + + The kernel is entered with r3 pointing to an area of memory that is + roughtly described in include/asm-powerpc/prom.h by the structure + boot_param_header: + +struct boot_param_header { + u32 magic; /* magic word OF_DT_HEADER */ + u32 totalsize; /* total size of DT block */ + u32 off_dt_struct; /* offset to structure */ + u32 off_dt_strings; /* offset to strings */ + u32 off_mem_rsvmap; /* offset to memory reserve map +*/ + u32 version; /* format version */ + u32 last_comp_version; /* last compatible version */ + + /* version 2 fields below */ + u32 boot_cpuid_phys; /* Which physical CPU id we're + booting on */ + /* version 3 fields below */ + u32 size_dt_strings; /* size of the strings block */ +}; + + Along with the constants: + +/* Definitions used by the flattened device tree */ +#define OF_DT_HEADER 0xd00dfeed /* 4: version, + 4: total size */ +#define OF_DT_BEGIN_NODE 0x1 /* Start node: full name +*/ +#define OF_DT_END_NODE 0x2 /* End node */ +#define OF_DT_PROP 0x3 /* Property: name off, + size, content */ +#define OF_DT_END 0x9 + + All values in this header are in big endian format, the various + fields in this header are defined more precisely below. All + "offset" values are in bytes from the start of the header; that is + from the value of r3. + + - magic + + This is a magic value that "marks" the beginning of the + device-tree block header. It contains the value 0xd00dfeed and is + defined by the constant OF_DT_HEADER + + - totalsize + + This is the total size of the DT block including the header. The + "DT" block should enclose all data structures defined in this + chapter (who are pointed to by offsets in this header). That is, + the device-tree structure, strings, and the memory reserve map. + + - off_dt_struct + + This is an offset from the beginning of the header to the start + of the "structure" part the device tree. (see 2) device tree) + + - off_dt_strings + + This is an offset from the beginning of the header to the start + of the "strings" part of the device-tree + + - off_mem_rsvmap + + This is an offset from the beginning of the header to the start + of the reserved memory map. This map is a list of pairs of 64 + bit integers. Each pair is a physical address and a size. The + + list is terminated by an entry of size 0. This map provides the + kernel with a list of physical memory areas that are "reserved" + and thus not to be used for memory allocations, especially during + early initialization. The kernel needs to allocate memory during + boot for things like un-flattening the device-tree, allocating an + MMU hash table, etc... Those allocations must be done in such a + way to avoid overriding critical things like, on Open Firmware + capable machines, the RTAS instance, or on some pSeries, the TCE + tables used for the iommu. Typically, the reserve map should + contain _at least_ this DT block itself (header,total_size). If + you are passing an initrd to the kernel, you should reserve it as + well. You do not need to reserve the kernel image itself. The map + should be 64 bit aligned. + + - version + + This is the version of this structure. Version 1 stops + here. Version 2 adds an additional field boot_cpuid_phys. + Version 3 adds the size of the strings block, allowing the kernel + to reallocate it easily at boot and free up the unused flattened + structure after expansion. Version 16 introduces a new more + "compact" format for the tree itself that is however not backward + compatible. You should always generate a structure of the highest + version defined at the time of your implementation. Currently + that is version 16, unless you explicitely aim at being backward + compatible. + + - last_comp_version + + Last compatible version. This indicates down to what version of + the DT block you are backward compatible. For example, version 2 + is backward compatible with version 1 (that is, a kernel build + for version 1 will be able to boot with a version 2 format). You + should put a 1 in this field if you generate a device tree of + version 1 to 3, or 0x10 if you generate a tree of version 0x10 + using the new unit name format. + + - boot_cpuid_phys + + This field only exist on version 2 headers. It indicate which + physical CPU ID is calling the kernel entry point. This is used, + among others, by kexec. If you are on an SMP system, this value + should match the content of the "reg" property of the CPU node in + the device-tree corresponding to the CPU calling the kernel entry + point (see further chapters for more informations on the required + device-tree contents) + + + So the typical layout of a DT block (though the various parts don't + need to be in that order) looks like this (addresses go from top to + bottom): + + + ------------------------------ + r3 -> | struct boot_param_header | + ------------------------------ + | (alignment gap) (*) | + ------------------------------ + | memory reserve map | + ------------------------------ + | (alignment gap) | + ------------------------------ + | | + | device-tree structure | + | | + ------------------------------ + | (alignment gap) | + ------------------------------ + | | + | device-tree strings | + | | + -----> ------------------------------ + | + | + --- (r3 + totalsize) + + (*) The alignment gaps are not necessarily present; their presence + and size are dependent on the various alignment requirements of + the individual data blocks. + + +2) Device tree generalities +--------------------------- + +This device-tree itself is separated in two different blocks, a +structure block and a strings block. Both need to be aligned to a 4 +byte boundary. + +First, let's quickly describe the device-tree concept before detailing +the storage format. This chapter does _not_ describe the detail of the +required types of nodes & properties for the kernel, this is done +later in chapter III. + +The device-tree layout is strongly inherited from the definition of +the Open Firmware IEEE 1275 device-tree. It's basically a tree of +nodes, each node having two or more named properties. A property can +have a value or not. + +It is a tree, so each node has one and only one parent except for the +root node who has no parent. + +A node has 2 names. The actual node name is generally contained in a +property of type "name" in the node property list whose value is a +zero terminated string and is mandatory for version 1 to 3 of the +format definition (as it is in Open Firmware). Version 0x10 makes it +optional as it can generate it from the unit name defined below. + +There is also a "unit name" that is used to differenciate nodes with +the same name at the same level, it is usually made of the node +name's, the "@" sign, and a "unit address", which definition is +specific to the bus type the node sits on. + +The unit name doesn't exist as a property per-se but is included in +the device-tree structure. It is typically used to represent "path" in +the device-tree. More details about the actual format of these will be +below. + +The kernel powerpc generic code does not make any formal use of the +unit address (though some board support code may do) so the only real +requirement here for the unit address is to ensure uniqueness of +the node unit name at a given level of the tree. Nodes with no notion +of address and no possible sibling of the same name (like /memory or +/cpus) may omit the unit address in the context of this specification, +or use the "@0" default unit address. The unit name is used to define +a node "full path", which is the concatenation of all parent node +unit names separated with "/". + +The root node doesn't have a defined name, and isn't required to have +a name property either if you are using version 3 or earlier of the +format. It also has no unit address (no @ symbol followed by a unit +address). The root node unit name is thus an empty string. The full +path to the root node is "/". + +Every node which actually represents an actual device (that is, a node +which isn't only a virtual "container" for more nodes, like "/cpus" +is) is also required to have a "device_type" property indicating the +type of node . + +Finally, every node that can be referenced from a property in another +node is required to have a "linux,phandle" property. Real open +firmware implementations provide a unique "phandle" value for every +node that the "prom_init()" trampoline code turns into +"linux,phandle" properties. However, this is made optional if the +flattened device tree is used directly. An example of a node +referencing another node via "phandle" is when laying out the +interrupt tree which will be described in a further version of this +document. + +This "linux, phandle" property is a 32 bit value that uniquely +identifies a node. You are free to use whatever values or system of +values, internal pointers, or whatever to generate these, the only +requirement is that every node for which you provide that property has +a unique value for it. + +Here is an example of a simple device-tree. In this example, an "o" +designates a node followed by the node unit name. Properties are +presented with their name followed by their content. "content" +represents an ASCII string (zero terminated) value, while +represents a 32 bit hexadecimal value. The various nodes in this +example will be discussed in a later chapter. At this point, it is +only meant to give you a idea of what a device-tree looks like. I have +purposefully kept the "name" and "linux,phandle" properties which +aren't necessary in order to give you a better idea of what the tree +looks like in practice. + + / o device-tree + |- name = "device-tree" + |- model = "MyBoardName" + |- compatible = "MyBoardFamilyName" + |- #address-cells = <2> + |- #size-cells = <2> + |- linux,phandle = <0> + | + o cpus + | | - name = "cpus" + | | - linux,phandle = <1> + | | - #address-cells = <1> + | | - #size-cells = <0> + | | + | o PowerPC,970 at 0 + | |- name = "PowerPC,970" + | |- device_type = "cpu" + | |- reg = <0> + | |- clock-frequency = <5f5e1000> + | |- linux,boot-cpu + | |- linux,phandle = <2> + | + o memory at 0 + | |- name = "memory" + | |- device_type = "memory" + | |- reg = <00000000 00000000 00000000 20000000> + | |- linux,phandle = <3> + | + o chosen + |- name = "chosen" + |- bootargs = "root=/dev/sda2" + |- linux,platform = <00000600> + |- linux,phandle = <4> + +This tree is almost a minimal tree. It pretty much contains the +minimal set of required nodes and properties to boot a linux kernel; +that is, some basic model informations at the root, the CPUs, and the +physical memory layout. It also includes misc information passed +through /chosen, like in this example, the platform type (mandatory) +and the kernel command line arguments (optional). + +The /cpus/PowerPC,970 at 0/linux,boot-cpu property is an example of a +property without a value. All other properties have a value. The +significance of the #address-cells and #size-cells properties will be +explained in chapter IV which defines precisely the required nodes and +properties and their content. + + +3) Device tree "structure" block + +The structure of the device tree is a linearized tree structure. The +"OF_DT_BEGIN_NODE" token starts a new node, and the "OF_DT_END_NODE" +ends that node definition. Child nodes are simply defined before +"OF_DT_END_NODE" (that is nodes within the node). A 'token' is a 32 +bit value. The tree has to be "finished" with a OF_DT_END token + +Here's the basic structure of a single node: + + * token OF_DT_BEGIN_NODE (that is 0x00000001) + * for version 1 to 3, this is the node full path as a zero + terminated string, starting with "/". For version 16 and later, + this is the node unit name only (or an empty string for the + root node) + * [align gap to next 4 bytes boundary] + * for each property: + * token OF_DT_PROP (that is 0x00000003) + * 32 bit value of property value size in bytes (or 0 of no + * value) + * 32 bit value of offset in string block of property name + * property value data if any + * [align gap to next 4 bytes boundary] + * [child nodes if any] + * token OF_DT_END_NODE (that is 0x00000002) + +So the node content can be summmarised as a start token, a full path, +a list of properties, a list of child node and an end token. Every +child node is a full node structure itself as defined above. + +4) Device tree 'strings" block + +In order to save space, property names, which are generally redundant, +are stored separately in the "strings" block. This block is simply the +whole bunch of zero terminated strings for all property names +concatenated together. The device-tree property definitions in the +structure block will contain offset values from the beginning of the +strings block. + + +III - Required content of the device tree +========================================= + +WARNING: All "linux,*" properties defined in this document apply only +to a flattened device-tree. If your platform uses a real +implementation of Open Firmware or an implementation compatible with +the Open Firmware client interface, those properties will be created +by the trampoline code in the kernel's prom_init() file. For example, +that's where you'll have to add code to detect your board model and +set the platform number. However, when using the flatenned device-tree +entry point, there is no prom_init() pass, and thus you have to +provide those properties yourself. + + +1) Note about cells and address representation +---------------------------------------------- + +The general rule is documented in the various Open Firmware +documentations. If you chose to describe a bus with the device-tree +and there exist an OF bus binding, then you should follow the +specification. However, the kernel does not require every single +device or bus to be described by the device tree. + +In general, the format of an address for a device is defined by the +parent bus type, based on the #address-cells and #size-cells +property. In the absence of such a property, the parent's parent +values are used, etc... The kernel requires the root node to have +those properties defining addresses format for devices directly mapped +on the processor bus. + +Those 2 properties define 'cells' for representing an address and a +size. A "cell" is a 32 bit number. For example, if both contain 2 +like the example tree given above, then an address and a size are both +composed of 2 cells, and each is a 64 bit number (cells are +concatenated and expected to be in big endian format). Another example +is the way Apple firmware defines them, with 2 cells for an address +and one cell for a size. Most 32-bit implementations should define +#address-cells and #size-cells to 1, which represents a 32-bit value. +Some 32-bit processors allow for physical addresses greater than 32 +bits; these processors should define #address-cells as 2. + +"reg" properties are always a tuple of the type "address size" where +the number of cells of address and size is specified by the bus +#address-cells and #size-cells. When a bus supports various address +spaces and other flags relative to a given address allocation (like +prefetchable, etc...) those flags are usually added to the top level +bits of the physical address. For example, a PCI physical address is +made of 3 cells, the bottom two containing the actual address itself +while the top cell contains address space indication, flags, and pci +bus & device numbers. + +For busses that support dynamic allocation, it's the accepted practice +to then not provide the address in "reg" (keep it 0) though while +providing a flag indicating the address is dynamically allocated, and +then, to provide a separate "assigned-addresses" property that +contains the fully allocated addresses. See the PCI OF bindings for +details. + +In general, a simple bus with no address space bits and no dynamic +allocation is preferred if it reflects your hardware, as the existing +kernel address parsing functions will work out of the box. If you +define a bus type with a more complex address format, including things +like address space bits, you'll have to add a bus translator to the +prom_parse.c file of the recent kernels for your bus type. + +The "reg" property only defines addresses and sizes (if #size-cells +is +non-0) within a given bus. In order to translate addresses upward +(that is into parent bus addresses, and possibly into cpu physical +addresses), all busses must contain a "ranges" property. If the +"ranges" property is missing at a given level, it's assumed that +translation isn't possible. The format of the "ranges" proprety for a +bus is a list of: + + bus address, parent bus address, size + +"bus address" is in the format of the bus this bus node is defining, +that is, for a PCI bridge, it would be a PCI address. Thus, (bus +address, size) defines a range of addresses for child devices. "parent +bus address" is in the format of the parent bus of this bus. For +example, for a PCI host controller, that would be a CPU address. For a +PCI<->ISA bridge, that would be a PCI address. It defines the base +address in the parent bus where the beginning of that range is mapped. + +For a new 64 bit powerpc board, I recommend either the 2/2 format or +Apple's 2/1 format which is slightly more compact since sizes usually +fit in a single 32 bit word. New 32 bit powerpc boards should use a +1/1 format, unless the processor supports physical addresses greater +than 32-bits, in which case a 2/1 format is recommended. + + +2) Note about "compatible" properties +------------------------------------- + +These properties are optional, but recommended in devices and the root +node. The format of a "compatible" property is a list of concatenated +zero terminated strings. They allow a device to express its +compatibility with a family of similar devices, in some cases, +allowing a single driver to match against several devices regardless +of their actual names. + +3) Note about "name" properties +------------------------------- + +While earlier users of Open Firmware like OldWorld macintoshes tended +to use the actual device name for the "name" property, it's nowadays +considered a good practice to use a name that is closer to the device +class (often equal to device_type). For example, nowadays, ethernet +controllers are named "ethernet", an additional "model" property +defining precisely the chip type/model, and "compatible" property +defining the family in case a single driver can driver more than one +of these chips. However, the kernel doesn't generally put any +restriction on the "name" property; it is simply considered good +practice to follow the standard and its evolutions as closely as +possible. + +Note also that the new format version 16 makes the "name" property +optional. If it's absent for a node, then the node's unit name is then +used to reconstruct the name. That is, the part of the unit name +before the "@" sign is used (or the entire unit name if no "@" sign +is present). + +4) Note about node and property names and character set +------------------------------------------------------- + +While open firmware provides more flexibe usage of 8859-1, this +specification enforces more strict rules. Nodes and properties should +be comprised only of ASCII characters 'a' to 'z', '0' to +'9', ',', '.', '_', '+', '#', '?', and '-'. Node names additionally +allow uppercase characters 'A' to 'Z' (property names should be +lowercase. The fact that vendors like Apple don't respect this rule is +irrelevant here). Additionally, node and property names should always +begin with a character in the range 'a' to 'z' (or 'A' to 'Z' for node +names). + +The maximum number of characters for both nodes and property names +is 31. In the case of node names, this is only the leftmost part of +a unit name (the pure "name" property), it doesn't include the unit +address which can extend beyond that limit. + + +5) Required nodes and properties +-------------------------------- + These are all that are currently required. However, it is strongly + recommended that you expose PCI host bridges as documented in the + PCI binding to open firmware, and your interrupt tree as documented + in OF interrupt tree specification. + + a) The root node + + The root node requires some properties to be present: + + - model : this is your board name/model + - #address-cells : address representation for "root" devices + - #size-cells: the size representation for "root" devices + + Additionally, some recommended properties are: + + - compatible : the board "family" generally finds its way here, + for example, if you have 2 board models with a similar layout, + that typically get driven by the same platform code in the + kernel, you would use a different "model" property but put a + value in "compatible". The kernel doesn't directly use that + value (see /chosen/linux,platform for how the kernel choses a + platform type) but it is generally useful. + + The root node is also generally where you add additional properties + specific to your board like the serial number if any, that sort of + thing. it is recommended that if you add any "custom" property whose + name may clash with standard defined ones, you prefix them with your + vendor name and a comma. + + b) The /cpus node + + This node is the parent of all individual CPU nodes. It doesn't + have any specific requirements, though it's generally good practice + to have at least: + + #address-cells = <00000001> + #size-cells = <00000000> + + This defines that the "address" for a CPU is a single cell, and has + no meaningful size. This is not necessary but the kernel will assume + that format when reading the "reg" properties of a CPU node, see + below + + c) The /cpus/* nodes + + So under /cpus, you are supposed to create a node for every CPU on + the machine. There is no specific restriction on the name of the + CPU, though It's common practice to call it PowerPC,. For + example, Apple uses PowerPC,G5 while IBM uses PowerPC,970FX. + + Required properties: + + - device_type : has to be "cpu" + - reg : This is the physical cpu number, it's a single 32 bit cell + and is also used as-is as the unit number for constructing the + unit name in the full path. For example, with 2 CPUs, you would + have the full path: + /cpus/PowerPC,970FX at 0 + /cpus/PowerPC,970FX at 1 + (unit addresses do not require leading zeroes) + - d-cache-line-size : one cell, L1 data cache line size in bytes + - i-cache-line-size : one cell, L1 instruction cache line size in + bytes + - d-cache-size : one cell, size of L1 data cache in bytes + - i-cache-size : one cell, size of L1 instruction cache in bytes + - linux, boot-cpu : Should be defined if this cpu is the boot cpu. + + Recommended properties: + + - timebase-frequency : a cell indicating the frequency of the + timebase in Hz. This is not directly used by the generic code, + but you are welcome to copy/paste the pSeries code for setting + the kernel timebase/decrementer calibration based on this + value. + - clock-frequency : a cell indicating the CPU core clock frequency + in Hz. A new property will be defined for 64 bit values, but if + your frequency is < 4Ghz, one cell is enough. Here as well as + for the above, the common code doesn't use that property, but + you are welcome to re-use the pSeries or Maple one. A future + kernel version might provide a common function for this. + + You are welcome to add any property you find relevant to your board, + like some information about the mechanism used to soft-reset the + CPUs. For example, Apple puts the GPIO number for CPU soft reset + lines in there as a "soft-reset" property since they start secondary + CPUs by soft-resetting them. + + + d) the /memory node(s) + + To define the physical memory layout of your board, you should + create one or more memory node(s). You can either create a single + node with all memory ranges in its reg property, or you can create + several nodes, as you wish. The unit address (@ part) used for the + full path is the address of the first range of memory defined by a + given node. If you use a single memory node, this will typically be + @0. + + Required properties: + + - device_type : has to be "memory" + - reg : This property contains all the physical memory ranges of + your board. It's a list of addresses/sizes concatenated + together, with the number of cells of each defined by the + #address-cells and #size-cells of the root node. For example, + with both of these properties beeing 2 like in the example given + earlier, a 970 based machine with 6Gb of RAM could typically + have a "reg" property here that looks like: + + 00000000 00000000 00000000 80000000 + 00000001 00000000 00000001 00000000 + + That is a range starting at 0 of 0x80000000 bytes and a range + starting at 0x100000000 and of 0x100000000 bytes. You can see + that there is no memory covering the IO hole between 2Gb and + 4Gb. Some vendors prefer splitting those ranges into smaller + segments, but the kernel doesn't care. + + e) The /chosen node + + This node is a bit "special". Normally, that's where open firmware + puts some variable environment information, like the arguments, or + phandle pointers to nodes like the main interrupt controller, or the + default input/output devices. + + This specification makes a few of these mandatory, but also defines + some linux-specific properties that would be normally constructed by + the prom_init() trampoline when booting with an OF client interface, + but that you have to provide yourself when using the flattened format. + + Required properties: + + - linux,platform : This is your platform number as assigned by the + architecture maintainers + + Recommended properties: + + - bootargs : This zero-terminated string is passed as the kernel + command line + - linux,stdout-path : This is the full path to your standard + console device if any. Typically, if you have serial devices on + your board, you may want to put the full path to the one set as + the default console in the firmware here, for the kernel to pick + it up as it's own default console. If you look at the funciton + set_preferred_console() in arch/ppc64/kernel/setup.c, you'll see + that the kernel tries to find out the default console and has + knowledge of various types like 8250 serial ports. You may want + to extend this function to add your own. + - interrupt-controller : This is one cell containing a phandle + value that matches the "linux,phandle" property of your main + interrupt controller node. May be used for interrupt routing. + + + Note that u-boot creates and fills in the chosen node for platforms + that use it. + + f) the /soc node + + This node is used to represent a system-on-a-chip (SOC) and must be + present if the processor is a SOC. The top-level soc node contains + information that is global to all devices on the SOC. The node name + should contain a unit address for the SOC, which is the base address + of the memory-mapped register set for the SOC. The name of an soc + node should start with "soc", and the remainder of the name should + represent the part number for the soc. For example, the MPC8540's + soc node would be called "soc8540". + + Required properties: + + - device_type : Should be "soc" + - ranges : Should be defined as specified in 1) to describe the + translation of SOC addresses for memory mapped SOC registers. + + Recommended properties: + + - reg : This property defines the address and size of the + memory-mapped registers that are used for the SOC node itself. + It does not include the child device registers - these will be + defined inside each child node. The address specified in the + "reg" property should match the unit address of the SOC node. + - #address-cells : Address representation for "soc" devices. The + format of this field may vary depending on whether or not the + device registers are memory mapped. For memory mapped + registers, this field represents the number of cells needed to + represent the address of the registers. For SOCs that do not + use MMIO, a special address format should be defined that + contains enough cells to represent the required information. + See 1) above for more details on defining #address-cells. + - #size-cells : Size representation for "soc" devices + - #interrupt-cells : Defines the width of cells used to represent + interrupts. Typically this value is <2>, which includes a + 32-bit number that represents the interrupt number, and a + 32-bit number that represents the interrupt sense and level. + This field is only needed if the SOC contains an interrupt + controller. + + The SOC node may contain child nodes for each SOC device that the + platform uses. Nodes should not be created for devices which exist + on the SOC but are not used by a particular platform. See chapter VI + for more information on how to specify devices that are part of an +SOC. + + Example SOC node for the MPC8540: + + soc8540 at e0000000 { + #address-cells = <1>; + #size-cells = <1>; + #interrupt-cells = <2>; + device_type = "soc"; + ranges = <00000000 e0000000 00100000> + reg = ; + } + + + +IV - "dtc", the device tree compiler +==================================== + + +dtc source code can be found at + + +WARNING: This version is still in early development stage; the +resulting device-tree "blobs" have not yet been validated with the +kernel. The current generated bloc lacks a useful reserve map (it will +be fixed to generate an empty one, it's up to the bootloader to fill +it up) among others. The error handling needs work, bugs are lurking, +etc... + +dtc basically takes a device-tree in a given format and outputs a +device-tree in another format. The currently supported formats are: + + Input formats: + ------------- + + - "dtb": "blob" format, that is a flattened device-tree block + with + header all in a binary blob. + - "dts": "source" format. This is a text file containing a + "source" for a device-tree. The format is defined later in this + chapter. + - "fs" format. This is a representation equivalent to the + output of /proc/device-tree, that is nodes are directories and + properties are files + + Output formats: + --------------- + + - "dtb": "blob" format + - "dts": "source" format + - "asm": assembly language file. This is a file that can be + sourced by gas to generate a device-tree "blob". That file can + then simply be added to your Makefile. Additionally, the + assembly file exports some symbols that can be use + + +The syntax of the dtc tool is + + dtc [-I ] [-O ] + [-o output-filename] [-V output_version] input_filename + + +The "output_version" defines what versio of the "blob" format will be +generated. Supported versions are 1,2,3 and 16. The default is +currently version 3 but that may change in the future to version 16. + +Additionally, dtc performs various sanity checks on the tree, like the +uniqueness of linux,phandle properties, validity of strings, etc... + +The format of the .dts "source" file is "C" like, supports C and C++ +style commments. + +/ { +} + +The above is the "device-tree" definition. It's the only statement +supported currently at the toplevel. + +/ { + property1 = "string_value"; /* define a property containing a 0 + * terminated string + */ + + property2 = <1234abcd>; /* define a property containing a + * numerical 32 bits value (hexadecimal) + */ + + property3 = <12345678 12345678 deadbeef>; + /* define a property containing 3 + * numerical 32 bits values (cells) in + * hexadecimal + */ + property4 = [0a 0b 0c 0d de ea ad be ef]; + /* define a property whose content is + * an arbitrary array of bytes + */ + + childnode at addresss { /* define a child node named "childnode" + * whose unit name is "childnode at + * address" + */ + + childprop = "hello\n"; /* define a property "childprop" of + * childnode (in this case, a string) + */ + }; +}; + +Nodes can contain other nodes etc... thus defining the hierarchical +structure of the tree. + +Strings support common escape sequences from C: "\n", "\t", "\r", +"\(octal value)", "\x(hex value)". + +It is also suggested that you pipe your source file through cpp (gcc +preprocessor) so you can use #include's, #define for constants, etc... + +Finally, various options are planned but not yet implemented, like +automatic generation of phandles, labels (exported to the asm file so +you can point to a property content and change it easily from whatever +you link the device-tree with), label or path instead of numeric value +in some cells to "point" to a node (replaced by a phandle at compile +time), export of reserve map address to the asm file, ability to +specify reserve map content at compile time, etc... + +We may provide a .h include file with common definitions of that +proves useful for some properties (like building PCI properties or +interrupt maps) though it may be better to add a notion of struct +definitions to the compiler... + + +V - Recommendations for a bootloader +==================================== + + +Here are some various ideas/recommendations that have been proposed +while all this has been defined and implemented. + + - The bootloader may want to be able to use the device-tree itself + and may want to manipulate it (to add/edit some properties, + like physical memory size or kernel arguments). At this point, 2 + choices can be made. Either the bootloader works directly on the + flattened format, or the bootloader has its own internal tree + representation with pointers (similar to the kernel one) and + re-flattens the tree when booting the kernel. The former is a bit + more difficult to edit/modify, the later requires probably a bit + more code to handle the tree structure. Note that the structure + format has been designed so it's relatively easy to "insert" + properties or nodes or delete them by just memmoving things + around. It contains no internal offsets or pointers for this + purpose. + + - An example of code for iterating nodes & retreiving properties + directly from the flattened tree format can be found in the kernel + file arch/ppc64/kernel/prom.c, look at scan_flat_dt() function, + it's usage in early_init_devtree(), and the corresponding various + early_init_dt_scan_*() callbacks. That code can be re-used in a + GPL bootloader, and as the author of that code, I would be happy + do discuss possible free licencing to any vendor who wishes to + integrate all or part of this code into a non-GPL bootloader. + + + +VI - System-on-a-chip devices and nodes +======================================= + +Many companies are now starting to develop system-on-a-chip +processors, where the processor core (cpu) and many peripheral devices +exist on a single piece of silicon. For these SOCs, an SOC node +should be used that defines child nodes for the devices that make +up the SOC. While platforms are not required to use this model in +order to boot the kernel, it is highly encouraged that all SOC +implementations define as complete a flat-device-tree as possible to +describe the devices on the SOC. This will allow for the +genericization of much of the kernel code. + + +1) Defining child nodes of an SOC +--------------------------------- + +Each device that is part of an SOC may have its own node entry inside +the SOC node. For each device that is included in the SOC, the unit +address property represents the address offset for this device's +memory-mapped registers in the parent's address space. The parent's +address space is defined by the "ranges" property in the top-level soc +node. The "reg" property for each node that exists directly under the +SOC node should contain the address mapping from the child address space +to the parent SOC address space and the size of the device's +memory-mapped register file. + +For many devices that may exist inside an SOC, there are predefined +specifications for the format of the device tree node. All SOC child +nodes should follow these specifications, except where noted in this +document. + +See appendix A for an example partial SOC node definition for the +MPC8540. + + +2) Specifying interrupt information for SOC devices +--------------------------------------------------- + +Each device that is part of an SOC and which generates interrupts +should have the following properties: + + - interrupt-parent : contains the phandle of the interrupt + controller which handles interrupts for this device + - interrupts : a list of tuples representing the interrupt + number and the interrupt sense and level for each interupt + for this device. + +This information is used by the kernel to build the interrupt table +for the interrupt controllers in the system. + +Sense and level information should be encoded as follows: + + Devices connected to openPIC-compatible controllers should encode + sense and polarity as follows: + + 0 = high to low edge sensitive type enabled + 1 = active low level sensitive type enabled + 2 = low to high edge sensitive type enabled + 3 = active high level sensitive type enabled + + ISA PIC interrupt controllers should adhere to the ISA PIC + encodings listed below: + + 0 = active low level sensitive type enabled + 1 = active high level sensitive type enabled + 2 = high to low edge sensitive type enabled + 3 = low to high edge sensitive type enabled + + + +3) Representing devices without a current OF specification +---------------------------------------------------------- + +Currently, there are many devices on SOCs that do not have a standard +representation pre-defined as part of the open firmware +specifications, mainly because the boards that contain these SOCs are +not currently booted using open firmware. This section contains +descriptions for the SOC devices for which new nodes have been +defined; this list will expand as more and more SOC-containing +platforms are moved over to use the flattened-device-tree model. + + a) MDIO IO device + + The MDIO is a bus to which the PHY devices are connected. For each + device that exists on this bus, a child node should be created. See + the definition of the PHY node below for an example of how to define + a PHY. + + Required properties: + - reg : Offset and length of the register set for the device + - device_type : Should be "mdio" + - compatible : Should define the compatible device type for the + mdio. Currently, this is most likely to be "gianfar" + + Example: + + mdio at 24520 { + reg = <24520 20>; + + ethernet-phy at 0 { + ...... + }; + }; + + + b) Gianfar-compatible ethernet nodes + + Required properties: + + - device_type : Should be "network" + - model : Model of the device. Can be "TSEC", "eTSEC", or "FEC" + - compatible : Should be "gianfar" + - reg : Offset and length of the register set for the device + - address : List of bytes representing the ethernet address of + this controller + - interrupts : where a is the interrupt number and b is a + field that represents an encoding of the sense and level + information for the interrupt. This should be encoded based on + the information in section 2) depending on the type of interrupt + controller you have. + - interrupt-parent : the phandle for the interrupt controller that + services interrupts for this device. + - phy-handle : The phandle for the PHY connected to this ethernet + controller. + + Example: + + ethernet at 24000 { + #size-cells = <0>; + device_type = "network"; + model = "TSEC"; + compatible = "gianfar"; + reg = <24000 1000>; + address = [ 00 E0 0C 00 73 00 ]; + interrupts = ; + interrupt-parent = <40000>; + phy-handle = <2452000> + }; + + + + c) PHY nodes + + Required properties: + + - device_type : Should be "ethernet-phy" + - interrupts : where a is the interrupt number and b is a + field that represents an encoding of the sense and level + information for the interrupt. This should be encoded based on + the information in section 2) depending on the type of interrupt + controller you have. + - interrupt-parent : the phandle for the interrupt controller that + services interrupts for this device. + - reg : The ID number for the phy, usually a small integer + - linux,phandle : phandle for this node; likely referenced by an + ethernet controller node. + + + Example: + + ethernet-phy at 0 { + linux,phandle = <2452000> + interrupt-parent = <40000>; + interrupts = <35 1>; + reg = <0>; + device_type = "ethernet-phy"; + }; + + + d) Interrupt controllers + + Some SOC devices contain interrupt controllers that are different + from the standard Open PIC specification. The SOC device nodes for + these types of controllers should be specified just like a standard + OpenPIC controller. Sense and level information should be encoded + as specified in section 2) of this chapter for each device that + specifies an interrupt. + + Example : + + pic at 40000 { + linux,phandle = <40000>; + clock-frequency = <0>; + interrupt-controller; + #address-cells = <0>; + reg = <40000 40000>; + built-in; + compatible = "chrp,open-pic"; + device_type = "open-pic"; + big-endian; + }; + + + e) I2C + + Required properties : + + - device_type : Should be "i2c" + - reg : Offset and length of the register set for the device + + Recommended properties : + + - compatible : Should be "fsl-i2c" for parts compatible with + Freescale I2C specifications. + - interrupts : where a is the interrupt number and b is a + field that represents an encoding of the sense and level + information for the interrupt. This should be encoded based on + the information in section 2) depending on the type of interrupt + controller you have. + - interrupt-parent : the phandle for the interrupt controller that + services interrupts for this device. + - dfsrr : boolean; if defined, indicates that this I2C device has + a digital filter sampling rate register + - fsl5200-clocking : boolean; if defined, indicated that this device + uses the FSL 5200 clocking mechanism. + + Example : + + i2c at 3000 { + interrupt-parent = <40000>; + interrupts = <1b 3>; + reg = <3000 18>; + device_type = "i2c"; + compatible = "fsl-i2c"; + dfsrr; + }; + + + More devices will be defined as this spec matures. + + +Appendix A - Sample SOC node for MPC8540 +======================================== + +Note that the #address-cells and #size-cells for the SoC node +in this example have been explicitly listed; these are likely +not necessary as they are usually the same as the root node. + + soc8540 at e0000000 { + #address-cells = <1>; + #size-cells = <1>; + #interrupt-cells = <2>; + device_type = "soc"; + ranges = <00000000 e0000000 00100000> + reg = ; + + mdio at 24520 { + reg = <24520 20>; + device_type = "mdio"; + compatible = "gianfar"; + + ethernet-phy at 0 { + linux,phandle = <2452000> + interrupt-parent = <40000>; + interrupts = <35 1>; + reg = <0>; + device_type = "ethernet-phy"; + }; + + ethernet-phy at 1 { + linux,phandle = <2452001> + interrupt-parent = <40000>; + interrupts = <35 1>; + reg = <1>; + device_type = "ethernet-phy"; + }; + + ethernet-phy at 3 { + linux,phandle = <2452002> + interrupt-parent = <40000>; + interrupts = <35 1>; + reg = <3>; + device_type = "ethernet-phy"; + }; + + }; + + ethernet at 24000 { + #size-cells = <0>; + device_type = "network"; + model = "TSEC"; + compatible = "gianfar"; + reg = <24000 1000>; + address = [ 00 E0 0C 00 73 00 ]; + interrupts = ; + interrupt-parent = <40000>; + phy-handle = <2452000>; + }; + + ethernet at 25000 { + #address-cells = <1>; + #size-cells = <0>; + device_type = "network"; + model = "TSEC"; + compatible = "gianfar"; + reg = <25000 1000>; + address = [ 00 E0 0C 00 73 01 ]; + interrupts = <13 3 14 3 18 3>; + interrupt-parent = <40000>; + phy-handle = <2452001>; + }; + + ethernet at 26000 { + #address-cells = <1>; + #size-cells = <0>; + device_type = "network"; + model = "FEC"; + compatible = "gianfar"; + reg = <26000 1000>; + address = [ 00 E0 0C 00 73 02 ]; + interrupts = <19 3>; + interrupt-parent = <40000>; + phy-handle = <2452002>; + }; + + serial at 4500 { + device_type = "serial"; + compatible = "ns16550"; + reg = <4500 100>; + clock-frequency = <0>; + interrupts = <1a 3>; + interrupt-parent = <40000>; + }; + + pic at 40000 { + linux,phandle = <40000>; + clock-frequency = <0>; + interrupt-controller; + #address-cells = <0>; + reg = <40000 40000>; + built-in; + compatible = "chrp,open-pic"; + device_type = "open-pic"; + big-endian; + }; + + i2c at 3000 { + interrupt-parent = <40000>; + interrupts = <1b 3>; + reg = <3000 18>; + device_type = "i2c"; + compatible = "fsl-i2c"; + dfsrr; + }; + + }; -- David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson From trini at kernel.crashing.org Tue Jan 31 11:51:40 2006 From: trini at kernel.crashing.org (Tom Rini) Date: Mon, 30 Jan 2006 17:51:40 -0700 Subject: LINUXPPC64 Maple fails to boot current git In-Reply-To: <1138662630.3417.26.camel@brick.watson.ibm.com> References: <20060130171759.GE22672@smtp.west.cox.net> <1138662630.3417.26.camel@brick.watson.ibm.com> Message-ID: <20060131005139.GM22672@smtp.west.cox.net> On Mon, Jan 30, 2006 at 06:10:30PM -0500, Michal Ostrowski wrote: > I saw something similar on a JS-20 w SLOF. The last message you see is > related to the RTC driver, but the next thing to run after that is > console_init(), which was where my system was dying. > > Dropping the "#ifdef CONFIG_ISA" statements in > arch/powerpc/kernel/legacy_serial.c appears to fix things, and I've been > told that a patch to this effect has been posted (though I've yet to see > it). Changing it to ISA || PPC_MAPLE fixes it for me. But that still seems odd, unless ISA just means ISA-like legacy crud and there's an ISA_PHYSICAL_PORT for the I/O cards. -- Tom Rini http://gate.crashing.org/~trini/ From dwm at maxeymade.com Tue Jan 31 12:18:47 2006 From: dwm at maxeymade.com (Doug Maxey) Date: Mon, 30 Jan 2006 19:18:47 -0600 Subject: iommu_alloc failure and panic In-Reply-To: <20060130231348.GC9368@pb15.lixom.net> Message-ID: <200601310118.k0V1Il7Z018408@falcon30.maxeymade.com> On Tue, 31 Jan 2006 10:13:48 +1100, Olof Johansson wrote: >On Mon, Jan 30, 2006 at 07:32:58AM -0800, Mark Haverkamp wrote: >> On Sat, 2006-01-28 at 12:34 +1300, Olof Johansson wrote: >> > On Fri, Jan 27, 2006 at 02:39:50PM -0800, Mark Haverkamp wrote: >> > >> > > I would have thought that the npages would be 1 now. >> > >> > No, npages is the size of the allocation coming from the driver, that >> > won't chance. The table blocksize just says how wide the cacheline size >> > is, i.e. how far it should advance between allocations. >> > >> > This is a patch that should probably have been added a while ago, to >> > give a bit more info. Can you apply it and give it a go? >> > >> > >> > Thanks, >> > >> > Olof >> > >> >> >> Here are the last few lines of the log before it crashed. >> >> >> Jan 30 07:29:14 linux kernel: table size 10000 used f752 > >Ok, that's a 256MB table, which is standard, and it seems to have been >filled with mappings. in some cases there's a few entries left but it's >likely that fragmentation causes the 10-entry alloc to fail, quite >normal. > >There's two things to look at, unfortunately I fall short on both of >them myself: > >1) There's a way to get more than the default 256MB DMA window for a PCI >slot. I'm not aware of the exact details, but you need recent firmware >and you configure it in the ASM menues (the web interface for the >service processor). Cc:ing Jake Moilanen in case he has any more up to >date info. > ASM > System Configuration > I/O Adapter Enlarged Capacity. This only applies to the last slot on a PHB. AKA superslot. >2) The emulex driver has been prone to problems in the past where it's >been very aggressive at starting DMA operations, and I think it can >be avoided with tuning. What I don't know is if it's because of this, >or simply because of the large number of targets you have. Cc:ing James >Smart. > > >-Olof >_______________________________________________ >Linuxppc64-dev mailing list >Linuxppc64-dev at ozlabs.org >https://ozlabs.org/mailman/listinfo/linuxppc64-dev > From greg at mcgary.org Tue Jan 31 12:49:44 2006 From: greg at mcgary.org (Greg McGary) Date: 30 Jan 2006 18:49:44 -0700 Subject: glibc for ARCH=powerpc ? Message-ID: What glibc compiles biarch using headers from which recent linux 2.6.* with ARCH=powerpc ? Thanks muchly. G From benh at kernel.crashing.org Tue Jan 31 14:53:11 2006 From: benh at kernel.crashing.org (Benjamin Herrenschmidt) Date: Tue, 31 Jan 2006 14:53:11 +1100 Subject: Maple fails to boot current git In-Reply-To: <20060130231118.GA19671@localhost.localdomain> References: <20060130171759.GE22672@smtp.west.cox.net> <20060130231118.GA19671@localhost.localdomain> Message-ID: <1138679592.4934.1.camel@localhost.localdomain> On Tue, 2006-01-31 at 12:11 +1300, David Gibson wrote: > On Mon, Jan 30, 2006 at 10:17:59AM -0700, Tom Rini wrote: > > Hello, trying to boot my maple board (ppc64_defconfig + > > CONFIG_PPC_EARLY_DEBUG_MAPLE=y) fails as follows (the "dirty" is > > #define DEBUG in kernel/prom_parse.c and platforms/maple/time.c): > > Crud. Our Maple is stuffed at the moment (doesn't complete the CPU > init script, so PIBS never even comes up on the 970), so I can't > really investigate. Well, the RTC problem definitely looks like a bogus or lack of "ranges" property or the fact that the parser doesn't recognize "ht" as a PCI bus. You may want to try updating prom_parse.c to treat "ht" as a PCI bus and see if that helps. Ben. From michael at ellerman.id.au Tue Jan 31 15:10:38 2006 From: michael at ellerman.id.au (Michael Ellerman) Date: Tue, 31 Jan 2006 15:10:38 +1100 Subject: [PATCH] powerpc: ibmveth: Harden driver initilisation for kexec Message-ID: <20060131041055.5623C68A46@ozlabs.org> After a kexec the veth driver will fail when trying to register with the Hypervisor because the previous kernel has not unregistered. So if the registration fails, we unregister and then try again. drivers/net/ibmveth.c | 32 ++++++++++++++++++++++++++------ 1 files changed, 26 insertions(+), 6 deletions(-) Index: kexec/drivers/net/ibmveth.c =================================================================== --- kexec.orig/drivers/net/ibmveth.c +++ kexec/drivers/net/ibmveth.c @@ -436,6 +436,31 @@ static void ibmveth_cleanup(struct ibmve ibmveth_free_buffer_pool(adapter, &adapter->rx_buff_pool[i]); } +static int ibmveth_register_logical_lan(struct ibmveth_adapter *adapter, + union ibmveth_buf_desc rxq_desc, u64 mac_address) +{ + int rc, try_again = 1; + + /* After a kexec the adapter will still be open, so our attempt to + * open it will fail. So if we get a failure we free the adapter and + * try again, but only once. */ +retry: + rc = h_register_logical_lan(adapter->vdev->unit_address, + adapter->buffer_list_dma, rxq_desc.desc, + adapter->filter_list_dma, mac_address); + + if (rc != H_Success && try_again) { + do { + rc = h_free_logical_lan(adapter->vdev->unit_address); + } while (H_isLongBusy(rc) || (rc == H_Busy)); + + try_again = 0; + goto retry; + } + + return rc; +} + static int ibmveth_open(struct net_device *netdev) { struct ibmveth_adapter *adapter = netdev->priv; @@ -504,12 +529,7 @@ static int ibmveth_open(struct net_devic ibmveth_debug_printk("filter list @ 0x%p\n", adapter->filter_list_addr); ibmveth_debug_printk("receive q @ 0x%p\n", adapter->rx_queue.queue_addr); - - lpar_rc = h_register_logical_lan(adapter->vdev->unit_address, - adapter->buffer_list_dma, - rxq_desc.desc, - adapter->filter_list_dma, - mac_address); + lpar_rc = ibmveth_register_logical_lan(adapter, rxq_desc, mac_address); if(lpar_rc != H_Success) { ibmveth_error_printk("h_register_logical_lan failed with %ld\n", lpar_rc); From anton at samba.org Tue Jan 31 15:29:03 2006 From: anton at samba.org (Anton Blanchard) Date: Tue, 31 Jan 2006 15:29:03 +1100 Subject: [PATCH] powerpc: ibmveth: Harden driver initilisation for kexec In-Reply-To: <20060131041055.5623C68A46@ozlabs.org> References: <20060131041055.5623C68A46@ozlabs.org> Message-ID: <20060131042903.GF28896@krispykreme> From: Michael Ellerman After a kexec the veth driver will fail when trying to register with the Hypervisor because the previous kernel has not unregistered. So if the registration fails, we unregister and then try again. Acked-by: Anton Blanchard --- drivers/net/ibmveth.c | 32 ++++++++++++++++++++++++++------ 1 files changed, 26 insertions(+), 6 deletions(-) Looks good to me, and has been around for a couple of months. Index: kexec/drivers/net/ibmveth.c =================================================================== --- kexec.orig/drivers/net/ibmveth.c +++ kexec/drivers/net/ibmveth.c @@ -436,6 +436,31 @@ static void ibmveth_cleanup(struct ibmve ibmveth_free_buffer_pool(adapter, &adapter->rx_buff_pool[i]); } +static int ibmveth_register_logical_lan(struct ibmveth_adapter *adapter, + union ibmveth_buf_desc rxq_desc, u64 mac_address) +{ + int rc, try_again = 1; + + /* After a kexec the adapter will still be open, so our attempt to + * open it will fail. So if we get a failure we free the adapter and + * try again, but only once. */ +retry: + rc = h_register_logical_lan(adapter->vdev->unit_address, + adapter->buffer_list_dma, rxq_desc.desc, + adapter->filter_list_dma, mac_address); + + if (rc != H_Success && try_again) { + do { + rc = h_free_logical_lan(adapter->vdev->unit_address); + } while (H_isLongBusy(rc) || (rc == H_Busy)); + + try_again = 0; + goto retry; + } + + return rc; +} + static int ibmveth_open(struct net_device *netdev) { struct ibmveth_adapter *adapter = netdev->priv; @@ -504,12 +529,7 @@ static int ibmveth_open(struct net_devic ibmveth_debug_printk("filter list @ 0x%p\n", adapter->filter_list_addr); ibmveth_debug_printk("receive q @ 0x%p\n", adapter->rx_queue.queue_addr); - - lpar_rc = h_register_logical_lan(adapter->vdev->unit_address, - adapter->buffer_list_dma, - rxq_desc.desc, - adapter->filter_list_dma, - mac_address); + lpar_rc = ibmveth_register_logical_lan(adapter, rxq_desc, mac_address); if(lpar_rc != H_Success) { ibmveth_error_printk("h_register_logical_lan failed with %ld\n", lpar_rc); From olof at lixom.net Tue Jan 31 15:27:45 2006 From: olof at lixom.net (Olof Johansson) Date: Tue, 31 Jan 2006 15:27:45 +1100 Subject: [PATCH] IOMMU SG paranoia In-Reply-To: <20060130215154.5105107e.moilanen@austin.ibm.com> References: <20060130215154.5105107e.moilanen@austin.ibm.com> Message-ID: <20060131042745.GE9368@pb15.lixom.net> On Mon, Jan 30, 2006 at 09:51:54PM -0600, Jake Moilanen wrote: > This patch addresses two items, which are unlikely to be hit if we > trust drivers. > > The first is moving a memory barrier below where the vmerged SG count > is passed back, but before the list is set to end. If those > instructions were reordered, there could be an issue in iommu_unmap_sg(). Hmm. I'm not sure how instruction reordering could cause this, but a speculative read and execution down the error path of the driver and it calling the unmap function could read and use the previous value. It's amazingly unlikely to happen given the number of tests and branches between the two, but it doesn't hurt to move the barrier down. > The second is making sure we terminate the list on the failure case of > iommu_map_sg(). If a driver does not look at the failure return code, > it could pass a ill-formed SG list to iommu_unmap_sg(). Only the first entry should need to be set to 0, you're doing a bit of extra work. It's an error path so it shouldn't be critical. > Signed-off-by: Jake Moilanen Acked-by: Olof Johansson > Index: 2.6.15/arch/powerpc/kernel/iommu.c > =================================================================== > --- 2.6.15.orig/arch/powerpc/kernel/iommu.c 2006-01-03 14:51:31.000000000 -0600 > +++ 2.6.15/arch/powerpc/kernel/iommu.c 2006-01-30 21:30:06.000000000 -0600 > @@ -334,9 +334,6 @@ > > spin_unlock_irqrestore(&(tbl->it_lock), flags); > > - /* Make sure updates are seen by hardware */ > - mb(); > - > DBG("mapped %d elements:\n", outcount); > > /* For the sake of iommu_unmap_sg, we clear out the length in the > @@ -347,6 +344,10 @@ > outs->dma_address = DMA_ERROR_CODE; > outs->dma_length = 0; > } > + > + /* Make sure updates are seen by hardware */ > + mb(); > + > return outcount; > > failure: > @@ -358,6 +359,8 @@ > npages = (PAGE_ALIGN(s->dma_address + s->dma_length) - vaddr) > >> PAGE_SHIFT; > __iommu_free(tbl, vaddr, npages); > + s->dma_address = DMA_ERROR_CODE; > + s->dma_length = 0; > } > } > spin_unlock_irqrestore(&(tbl->it_lock), flags); From michael at ellerman.id.au Tue Jan 31 17:17:47 2006 From: michael at ellerman.id.au (Michael Ellerman) Date: Tue, 31 Jan 2006 17:17:47 +1100 Subject: [PATCH] powerpc: Fix !SMP build of rtas.c Message-ID: <20060131061807.0104468A53@ozlabs.org> arch/powerpc/kernel/rtas.c is getting hvcall.h via spinlock.h, but when we're building for UP we don't include spinlock.h. arch/powerpc/kernel/rtas.c | 1 + 1 files changed, 1 insertion(+) Index: linux/arch/powerpc/kernel/rtas.c =================================================================== --- linux.orig/arch/powerpc/kernel/rtas.c +++ linux/arch/powerpc/kernel/rtas.c @@ -22,6 +22,7 @@ #include #include +#include #include #include #include From arnd at arndb.de Sat Jan 28 14:57:07 2006 From: arnd at arndb.de (Arnd Bergmann) Date: Sat, 28 Jan 2006 04:57:07 +0100 Subject: [PATCH] spufs split off platform code In-Reply-To: <43DAB208.9000505@am.sony.com> References: <43DAB208.9000505@am.sony.com> Message-ID: <200601280457.08170.arnd@arndb.de> On Saturday 28 January 2006 00:51, Geoff Levand wrote: > Index: alp-linux--dev--10/arch/powerpc/platforms/cell/spu_priv1.c > =================================================================== > --- alp-linux--dev--10.orig/arch/powerpc/platforms/cell/spu_priv1.c?????2006-01-27 10:45:30.000000000 -0800 > +++ alp-linux--dev--10/arch/powerpc/platforms/cell/spu_priv1.c??2006-01-27 11:31:06.000000000 -0800 > @@ -5,6 +5,202 @@ > > ?#include > ?#include > +#include > +#include "interrupt.h" > + > +struct spu_priv_data { > +???????u32 isrc; > +???????u32 node; > +}; > + The spu_priv_data should be rather generic. You definitely need an interrupt source number in order to be able to register the irq handler correctly. It might be better to store isrc and node in a single word, since both of them only need four bits according to the current CBE spec. If you only have one physical processor in the system, you don't need the node-id property at all, as it will always be zero. > +static int __init find_spu_node_id(struct device_node *spe) > +{ > +???????unsigned int *id; > +???????struct device_node *cpu; > + > +???????cpu = spe->parent->parent; > +???????id = (unsigned int *)get_property(cpu, "node-id", NULL); > + > +???????return id ? *id : 0; > +} which also means that this function becomes generic. In retrospect, it seems we should have used the open PAPR bindings for NUMA to specify the node, but I'm not sure if there is a point in moving to that now. > + > +static void __init get_spe_property(struct device_node *n, const char *name, > +???????struct spu_phys* phys) > +{ > +???????struct address_prop { > +???????????????unsigned long address; > +???????????????unsigned int len; > +???????} __attribute__((packed)) *prop; > + > +???????void *p; > +???????int proplen; > + > +???????p = get_property(n, name, &proplen); > +???????if (proplen != sizeof (struct address_prop)) { > +???????????????phys->addr = phys->size = 0; > +???????????????return; > +???????} > +???????prop = p; > + > +???????phys->addr = prop->address; > +???????phys->size = prop->len; > +} > + > +int __init enum_and_create_spu(void) > +{ > +???????struct device_node *node; > +???????int ret; > + > +???????ret = -ENODEV; > +???????for (node = of_find_node_by_type(NULL, "spe"); > +???????????????????????node; node = of_find_node_by_type(node, "spe")) { > +???????????????ret = create_spu(node); > +???????????????if (ret) > +???????????????????????break; > +???????} > +???????/* in some old firmware versions, the spe is called 'spc', so we > +??????? ? look for that as well */ > +???????for (node = of_find_node_by_type(NULL, "spc"); > +???????????????????????node; node = of_find_node_by_type(node, "spc")) { > +???????????????ret = create_spu(node); > +???????????????if (ret) > +???????????????????????break; > +???????} > +???????return ret; > +} > +EXPORT_SYMBOL_GPL(enum_and_create_spu); I guess that the "spc" device type can be removed now, I don't think that any systems are left that have not been converted. Do you have "spe" type nodes at all? Is there anything that you need to do different about them? > + > +int __init spu_setup(struct spu *spu, void *spu_setup_data) > +{ > +???????struct device_node *spe = spu_setup_data; > +???????char *prop; > + > +???????spu->priv_data = kmalloc(sizeof(struct spu_priv_data), GFP_KERNEL); > +???????if (!spu->priv_data) > +???????????????return -ENOMEM; > + > +???????spu->priv_data->node = find_spu_node_id(spe); > + > +???????prop = get_property(spe, "isrc", NULL); > +???????if (!prop) > +???????????????goto out_free; > +???????spu->priv_data->isrc = *(unsigned int *)prop; > + > +???????spu->name = get_property(spe, "name", NULL); > +???????if (!spu->name) > +???????????????goto out_free; > + > +???????get_spe_property(spe, "local-store", &spu->local_store_phys); > +???????if (!spu->local_store_phys.addr) > +???????????????goto out_free; > + > +???????get_spe_property(spe, "problem", &spu->problem_phys); > +???????if (!spu->problem_phys.addr) > +???????????????goto out_free; > + > +???????get_spe_property(spe, "priv1", &spu->priv1_phys); > + > +???????get_spe_property(spe, "priv2", &spu->priv2_phys); > +???????if (!spu->priv2_phys.addr) > +???????????????goto out_free; > + > +???????return 0; > +??????? > +out_free: > +???????printk(KERN_WARNING "%s: no spu device found\n", __func__); > +???????pr_debug("%s: error (%p)\n", __func__, spu); > +???????kfree(spu->priv_data); > +???????spu->priv_data = NULL; > +???????return -ENODEV; > +} > +EXPORT_SYMBOL_GPL(spu_setup); > + > +void spu_free_priv_data(struct spu *spu) > +{ > +???????if (spu->priv_data) { > +???????????????kfree(spu->priv_data); > +???????????????spu->priv_data = NULL; > +???????} > +} > +EXPORT_SYMBOL_GPL(spu_free_priv_data); > + > +int spu_request_irqs(struct spu *spu, > +???????irqreturn_t (*cls0)(int, void *, struct pt_regs *), > +???????irqreturn_t (*cls1)(int, void *, struct pt_regs *), > +???????irqreturn_t (*cls2)(int, void *, struct pt_regs *)) > +{ > +???????int ret; > +???????int irq_base; > + > +???????BUG_ON(spu->priv_data); > +??????? > +???????if(!spu->priv_data) { > +???????????????spu->priv_data = kmalloc(sizeof(struct spu_priv_data), > +???????????????????????GFP_KERNEL); > + > +???????????????if(!spu->priv_data) { > +???????????????????????ret = -ENOMEM; > +???????????????????????goto out; > +???????????????} > +???????} > + > +???????irq_base = IIC_NODE_STRIDE * spu->priv_data->node + IIC_SPE_OFFSET; > + > +???????snprintf(spu->irq_c0, sizeof (spu->irq_c0), "spe%02d.0", spu->number); > +???????ret = request_irq(irq_base + spu->priv_data->isrc, > +??????????????? cls0, 0, spu->irq_c0, spu); > +???????if (ret) > +???????????????goto out; > + > +???????snprintf(spu->irq_c1, sizeof (spu->irq_c1), "spe%02d.1", spu->number); > +???????ret = request_irq(irq_base + IIC_CLASS_STRIDE + spu->priv_data->isrc, > +??????????????? cls1, 0, spu->irq_c1, spu); > +???????if (ret) > +???????????????goto out1; > + > +???????snprintf(spu->irq_c2, sizeof (spu->irq_c2), "spe%02d.2", spu->number); > +???????ret = request_irq(irq_base + 2*IIC_CLASS_STRIDE + spu->priv_data->isrc, > +??????????????? cls2, 0, spu->irq_c2, spu); > +???????if (ret) > +???????????????goto out2; > +???????goto out; > + > +out2: > +???????free_irq(irq_base + IIC_CLASS_STRIDE + spu->priv_data->isrc, spu); > +out1: > +???????free_irq(irq_base + spu->priv_data->isrc, spu); > +out: > +???????return ret; > +} > +EXPORT_SYMBOL_GPL(spu_request_irqs); Ok, I can see how it is not generic enough to use just assume that 'n * IIC_CLASS_STRIDE + spu->isrc' is the correct irq number. We might be able to keep the scheme, but it should at least be documented in some sort of generic device tree bindings file for Cell. > + > +void spu_free_irqs(struct spu *spu) > +{ > +???????int irq_base; > + > +???????if(!spu->priv_data) { > +???????????????pr_debug("null priv_data in %p\n", spu); > +???????????????return; > +???????} It may be just me, but I don't like this bit of coding style: You are trying to deal with priv_data being either allocated or not allocated at this point. Better make sure that you have freed the structure before returning an error from any function that would allocate it on success. Then get rid of the check here. > +??????? > +???????irq_base = IIC_NODE_STRIDE * spu->priv_data->node + IIC_SPE_OFFSET; > + > +???????free_irq(irq_base + spu->priv_data->isrc, spu); > +???????free_irq(irq_base + IIC_CLASS_STRIDE + spu->priv_data->isrc, spu); > +???????free_irq(irq_base + 2*IIC_CLASS_STRIDE + spu->priv_data->isrc, spu); > + > +???????kfree(spu->priv_data); > +???????spu->priv_data = NULL; > +} > +EXPORT_SYMBOL_GPL(spu_free_irqs); > + > +void spu_irq_setaffinity(struct spu *spu, int cpu) > +{ > +???????u64 target = iic_get_target_id(cpu); > +???????u64 route = target << 48 | target << 32 | target << 16; > +???????spu_int_route_set(spu, route); > +} > +EXPORT_SYMBOL_GPL(spu_irq_setaffinity); > > ?void spu_int_mask_and(struct spu *spu, int class, u64 mask) > ?{ > Index: alp-linux--dev--10/include/asm-powerpc/spu.h > =================================================================== > --- alp-linux--dev--10.orig/include/asm-powerpc/spu.h???2006-01-27 10:45:30.000000000 -0800 > +++ alp-linux--dev--10/include/asm-powerpc/spu.h????????2006-01-27 11:02:29.000000000 -0800 > @@ -25,6 +25,7 @@ > ?#include > ?#include > ?#include > +#include > > ?#define LS_SIZE (256 * 1024) > ?#define LS_ADDR_MASK (LS_SIZE - 1) > @@ -103,20 +104,26 @@ > > ?struct spu_context; > ?struct spu_runqueue; > +struct spu_priv_data; > +struct spu_phys { > +???????unsigned long addr; > +???????unsigned long size; > +}; > > ?struct spu { > +???????struct spu_priv_data *priv_data; /* opaque */ > ????????char *name; If you want priv_data to point to different types of data structures depending on the context, I find it easier to understand if there is a simple void pointer and the actual struct definitions have different type names. > -???????unsigned long local_store_phys; > +???????struct spu_phys local_store_phys; > ????????u8 *local_store; > -???????unsigned long problem_phys; > +???????struct spu_phys problem_phys; > ????????struct spu_problem __iomem *problem; > +???????struct spu_phys priv1_phys; > ????????struct spu_priv1 __iomem *priv1; > +???????struct spu_phys priv2_phys; > ????????struct spu_priv2 __iomem *priv2; > ????????struct list_head list; > ????????struct list_head sched_list; > ????????int number; > -???????u32 isrc; > -???????u32 node; > ????????u64 flags; > ????????u64 dar; > ????????u64 dsisr; > @@ -178,7 +185,19 @@ > ?} > ?#endif > > -/* access to priv1 registers */ > +/* base setup routines */ > +int create_spu(void *spu_setup_data); > + > +/* platform setup routines */ > +int enum_and_create_spu(void); > +int spu_setup(struct spu *spu, void *spu_setup_data); > +int spu_request_irqs(struct spu *spu, > +???????irqreturn_t (*cls0)(int, void *, struct pt_regs *), > +???????irqreturn_t (*cls1)(int, void *, struct pt_regs *), > +???????irqreturn_t (*cls2)(int, void *, struct pt_regs *)); > +void spu_free_irqs(struct spu *spu); > + > +/* platform priv1 register access */ From arnd at arndb.de Sat Jan 28 14:56:41 2006 From: arnd at arndb.de (Arnd Bergmann) Date: Sat, 28 Jan 2006 04:56:41 +0100 Subject: [PATCH] spufs-fix-init.patch In-Reply-To: <43D584C7.7080504@am.sony.com> References: <43D584C7.7080504@am.sony.com> Message-ID: <200601280456.41561.arnd@arndb.de> On Tuesday 24 January 2006 02:37, Geoff Levand wrote: > spufs-fix-init.patch: > > This is a small fix to get the spufs init sequence right. > > init_spu_base() in spu_base.c should be called (via module_init(init_spu_base)) > before spufs_init() (via module_init(spufs_init)) in spufs/inode.c gets called. > > Arnd, could you check that this works for your hardware and make any adjustments. Almost forgot about this patch. I can't test it right now, but I'm rather certain that it is correct. We have been using spufs as a loadable module in our test setup, so the bug could never be found there. > Signed-off-by: Masato Noguchi > Signed-off-by: Geoff Levand Acked-by: Arnd Bergmann > diff -uprN linux-2.6.15+spufs/arch/powerpc/platforms/cell/Makefile linux-2.6.15+spufs.mod/arch/powerpc/platforms/cell/Makefile > --- linux-2.6.15+spufs/arch/powerpc/platforms/cell/Makefile 2006-01-18 20:46:38.000000000 +0900 > +++ linux-2.6.15+spufs.mod/arch/powerpc/platforms/cell/Makefile 2006-01-20 17:16:32.000000000 +0900 > @@ -2,7 +2,7 @@ obj-y += interrupt.o iommu.o setup.o s > obj-y += pervasive.o > > obj-$(CONFIG_SMP) += smp.o > -obj-$(CONFIG_SPU_FS) += spufs/ spu-base.o > +obj-$(CONFIG_SPU_FS) += spu-base.o spufs/ > spu-base-y += spu_base.o spu_priv1.o > builtin-spufs-$(CONFIG_SPU_FS) += spu_syscalls.o > obj-y += $(builtin-spufs-m) > > > > > From moilanen at austin.ibm.com Tue Jan 31 14:51:54 2006 From: moilanen at austin.ibm.com (Jake Moilanen) Date: Mon, 30 Jan 2006 21:51:54 -0600 Subject: [PATCH] IOMMU SG paranoia Message-ID: <20060130215154.5105107e.moilanen@austin.ibm.com> This patch addresses two items, which are unlikely to be hit if we trust drivers. The first is moving a memory barrier below where the vmerged SG count is passed back, but before the list is set to end. If those instructions were reordered, there could be an issue in iommu_unmap_sg(). The second is making sure we terminate the list on the failure case of iommu_map_sg(). If a driver does not look at the failure return code, it could pass a ill-formed SG list to iommu_unmap_sg(). Signed-off-by: Jake Moilanen Index: 2.6.15/arch/powerpc/kernel/iommu.c =================================================================== --- 2.6.15.orig/arch/powerpc/kernel/iommu.c 2006-01-03 14:51:31.000000000 -0600 +++ 2.6.15/arch/powerpc/kernel/iommu.c 2006-01-30 21:30:06.000000000 -0600 @@ -334,9 +334,6 @@ spin_unlock_irqrestore(&(tbl->it_lock), flags); - /* Make sure updates are seen by hardware */ - mb(); - DBG("mapped %d elements:\n", outcount); /* For the sake of iommu_unmap_sg, we clear out the length in the @@ -347,6 +344,10 @@ outs->dma_address = DMA_ERROR_CODE; outs->dma_length = 0; } + + /* Make sure updates are seen by hardware */ + mb(); + return outcount; failure: @@ -358,6 +359,8 @@ npages = (PAGE_ALIGN(s->dma_address + s->dma_length) - vaddr) >> PAGE_SHIFT; __iommu_free(tbl, vaddr, npages); + s->dma_address = DMA_ERROR_CODE; + s->dma_length = 0; } } spin_unlock_irqrestore(&(tbl->it_lock), flags);