[PATCH 1/6] Move code patching code into arch/powerpc/lib/code-patching.c

2008-05-29 Thread Michael Ellerman
We currently have a few routines for patching code in asm/system.h, because they didn't fit anywhere else. I'd like to clean them up a little and add some more, so first move them into a dedicated C file - they don't need to be inlined. While we're moving the code, drop create_function_call(),

[PATCH 2/6] Allow create_branch() to return errors

2008-05-29 Thread Michael Ellerman
Currently create_branch() creates a branch instruction for you, and patches it into the call site. In some circumstances it would be nice to be able to create the instruction and patch it later, and also some code might want to check for errors in the branch creation before doing the patching. A

[PATCH 3/6] Make create_branch() return errors if the branch target is too large

2008-05-29 Thread Michael Ellerman
If you pass a target value to create_branch() which is more than 32MB - 4, or - 32MB away from the branch site, then it's impossible to create an immediate branch. The current code doesn't check, which will lead to us creating a branch to somewhere else - which is bad. For code that cares to

[PATCH 4/6] Add ppc_function_entry() which gets the entry point for a function

2008-05-29 Thread Michael Ellerman
Because function pointers point to different things on 32-bit vs 64-bit, add a macro that deals with dereferencing the OPD on 64-bit. The soon to be merged ftrace wants this, as well as other code I am working on. Signed-off-by: Michael Ellerman [EMAIL PROTECTED] ---

[PATCH 5/6] Add tests for the code patching code, and introduce checking functions

2008-05-29 Thread Michael Ellerman
Some code I am working on wants to check that the code it's patching is what it expects, so add three functions which check the passed instruction to see what it is. Add some tests for those routines, and also test the results of the existing create_branch() function using the new routines. It

[PATCH 6/6] Add PPC_NOP_INSTR, a hash define for the preferred nop instruction

2008-05-29 Thread Michael Ellerman
A bunch of code has hard-coded the value for a nop instruction, it would be nice to have a #define for it. Signed-off-by: Michael Ellerman [EMAIL PROTECTED] --- arch/powerpc/kernel/cputable.c |3 ++- arch/powerpc/kernel/crash_dump.c|2 +- arch/powerpc/kernel/module_64.c |

Re: [PATCH 1/6] Move code patching code into arch/powerpc/lib/code-patching.c

2008-05-29 Thread Benjamin Herrenschmidt
On Thu, 2008-05-29 at 16:20 +1000, Michael Ellerman wrote: We currently have a few routines for patching code in asm/system.h, because they didn't fit anywhere else. I'd like to clean them up a little and add some more, so first move them into a dedicated C file - they don't need to be

Re: [PATCH 2/6] Allow create_branch() to return errors

2008-05-29 Thread Benjamin Herrenschmidt
On Thu, 2008-05-29 at 16:20 +1000, Michael Ellerman wrote: Currently create_branch() creates a branch instruction for you, and patches it into the call site. In some circumstances it would be nice to be able to create the instruction and patch it later, and also some code might want to check

Re: [PATCH 3/6] Make create_branch() return errors if the branch target is too large

2008-05-29 Thread Benjamin Herrenschmidt
On Thu, 2008-05-29 at 16:20 +1000, Michael Ellerman wrote: If you pass a target value to create_branch() which is more than 32MB - 4, or - 32MB away from the branch site, then it's impossible to create an immediate branch. The current code doesn't check, which will lead to us creating a branch

Re: [PATCH 4/6] Add ppc_function_entry() which gets the entry point for a function

2008-05-29 Thread Benjamin Herrenschmidt
On Thu, 2008-05-29 at 16:20 +1000, Michael Ellerman wrote: Because function pointers point to different things on 32-bit vs 64-bit, add a macro that deals with dereferencing the OPD on 64-bit. The soon to be merged ftrace wants this, as well as other code I am working on. Signed-off-by:

Re: [PATCH 4/6] Add ppc_function_entry() which gets the entry point for a function

2008-05-29 Thread Michael Ellerman
On Thu, 2008-05-29 at 16:37 +1000, Benjamin Herrenschmidt wrote: On Thu, 2008-05-29 at 16:20 +1000, Michael Ellerman wrote: Because function pointers point to different things on 32-bit vs 64-bit, add a macro that deals with dereferencing the OPD on 64-bit. The soon to be merged ftrace

Re: May I ask some questions?

2008-05-29 Thread Sergey Temerkhanov
vencent2006 wrote: I am Michael from China.A few days ago, I was supposed to debug executable.elf with xmd while some problems happened.It said like that: xmd% dow executable.elf Failed to download ELF file ERROR(1053):UNABLE TO READ ELF FILE.THE ELF FILE MAYBE CORRUPTED :executable.elf You

Re: MMIO and gcc re-ordering issue

2008-05-29 Thread Arnd Bergmann
On Wednesday 28 May 2008, Benjamin Herrenschmidt wrote: On Tue, 2008-05-27 at 14:55 -0700, Linus Torvalds wrote: On Wed, 28 May 2008, Benjamin Herrenschmidt wrote: A problem with __raw_ though is that they -also- don't do byteswap, Well, that's why there is __readl() and

dtc: Remove some small bashisms from test scripts

2008-05-29 Thread David Gibson
Some of the helper scripts used to run testcases contain some constructs that are bashisms. Or at least which don't work on dash, the minimal shell used as /bin/sh on recent Ubuntu systems. This patch removes these constructs so that the testsuite will pass out of the box on systems where

USB @ MPC834x

2008-05-29 Thread Andre Schwarz
Scott, Li, I'm sorry to bother you again ... but after bringing up all parts of my MPC8343 based board the not working USB is the last pending problem. Actually I'm running on 2.6.25 with a custom board. Since USB is different for MPC8349/7/3 (depending on package) there _could_ be a

Re: MMIO and gcc re-ordering issue

2008-05-29 Thread Alan Cox
It's not exactly a well-established interface. Only five architectures define these functions, and there is not a single user in the kernel source outside of these architecture's io.h files. That is because the drivers using them had them removed (eg I²O) - mostly because it didn't compile on

Re: dtc: Remove some small bashisms from test scripts

2008-05-29 Thread Segher Boessenkool
Some of the helper scripts used to run testcases contain some constructs that are bashisms. Or at least which don't work on dash, the minimal shell used as /bin/sh on recent Ubuntu systems. Both of these (the redirection, and source searching the current directory if the script isn't found in

Re: MMIO and gcc re-ordering issue

2008-05-29 Thread Pantelis Antoniou
On 28 Μαϊ 2008, at 11:36 ΠΜ, Haavard Skinnemoen wrote: Benjamin Herrenschmidt [EMAIL PROTECTED] wrote: I'm happy to say that __raw is purely about ordering and make them byteswap on powerpc tho (ie, make them little endian like the non- raw counterpart). That would break a lot of drivers.

RE: USB @ MPC834x

2008-05-29 Thread Li Yang
-Original Message- From: Andre Schwarz [mailto:[EMAIL PROTECTED] Sent: Thursday, May 29, 2008 5:51 PM To: Wood Scott; Li Yang Cc: linux-ppc list Subject: USB @ MPC834x Scott, Li, I'm sorry to bother you again ... but after bringing up all parts of my MPC8343 based board the

Re: dtc: Remove reference to dead Makefile variables

2008-05-29 Thread Jon Loeliger
Previous cleanups have removed the LIBFDT_CLEANFILES and DTC_CLEANFILES variables from the Makefiles. However, they're still referenced by the Makefile. This patch gets rid of these last vestiges. Signed-off-by: David Gibson [EMAIL PROTECTED] Applied. jdl

Re: libfdt: Seval cleanups to parameter checking (v3)

2008-05-29 Thread Jon Loeliger
Subject: Re: libfdt: Seval cleanups to parameter checking (v3) Please put the (v3) in brackets at the begining of the Subject:. This patch makes a couple of small cleanups to parameter checking of libfdt functions. - In several functions which take a node offset, we use an idiom

Re: dtc: Remove some small bashisms from test scripts

2008-05-29 Thread Jon Loeliger
Some of the helper scripts used to run testcases contain some constructs that are bashisms. Or at least which don't work on dash, the minimal shell used as /bin/sh on recent Ubuntu systems. This patch removes these constructs so that the testsuite will pass out of the box on systems where

Re: [PATCH] Add support for binary includes.

2008-05-29 Thread Jon Loeliger
David Gibson wrote: A while back I sent out a spiel explaining more clearly why I didn't like it, and where I thought we should go with this, but I don't think anyone noticed it at the time. I'll resend. Thanks. I started working towards a version of this I liked, but was sidetracked by a

Re: MMIO and gcc re-ordering issue

2008-05-29 Thread James Bottomley
On Thu, 2008-05-29 at 10:47 -0400, Jes Sorensen wrote: Roland == Roland Dreier [EMAIL PROTECTED] writes: This is a different issue. We deal with it on powerpc by having writel set a per-cpu flag and spin_unlock() test it, and do the barrier if needed there. Roland Cool... I assume you

Re: MMIO and gcc re-ordering issue

2008-05-29 Thread Jes Sorensen
Roland == Roland Dreier [EMAIL PROTECTED] writes: This is a different issue. We deal with it on powerpc by having writel set a per-cpu flag and spin_unlock() test it, and do the barrier if needed there. Roland Cool... I assume you do this for mutex_unlock() etc? Roland Is there any reason

Please pull 'next' branch of 4xx tree

2008-05-29 Thread Josh Boyer
Hi Paul, Please pull from: master.kernel.org:/pub/scm/linux/kernel/git/jwboyer/powerpc-4xx.git next to pick up some of the initial changes for 2.6.27 in the 4xx tree. They include some PIKA Warp updates, a DCR infrastructure rework, and David's large dts conversion patch (which accounts for

Re: May I ask some questions?

2008-05-29 Thread John Bonesio
xparameters.h will #include the other xparameters_mlxxx.h file. When using XPS in the EDK, you can use the 'software platforms settings' dialog box to specify the peripherals to use, the size of memory to use, and other parameters. When this is done, you can select 'generate libraries and bsps'

Re: [PATCHv2] i2c: adds support for i2c bus on Freescale CPM1/CPM2 controllers

2008-05-29 Thread Jean Delvare
On Wed, 21 May 2008 18:39:42 +0200, Jochen Friedrich wrote: This driver uses the port of 2.4 code from Vitaly Bordug [EMAIL PROTECTED] and the actual algorithm used by the i2c driver of the DBox code on cvs.tuxboc.org from Felix Domke ([EMAIL PROTECTED]) and Gillem ([EMAIL PROTECTED])

Re: [PATCHv2] i2c: adds support for i2c bus on Freescale CPM1/CPM2 controllers

2008-05-29 Thread Jean Delvare
On Thu, 29 May 2008 17:52:26 +0200, Jean Delvare wrote: On Wed, 21 May 2008 18:39:42 +0200, Jochen Friedrich wrote: This driver uses the port of 2.4 code from Vitaly Bordug [EMAIL PROTECTED] and the actual algorithm used by the i2c driver of the DBox code on cvs.tuxboc.org from Felix Domke

[RFC PATCH 0/4] Relocable kernel support for PPC64

2008-05-29 Thread Mohan Kumar M
Hi, Following four patches enable the relocatable kernel feature for PPC64 kernels. 1. extract_relocation_info.patch 2. relocation_build.patch 3. apply_relocation.patch 4. relocation_support.patch With the patchset, vmcore image of a crashed system can be captured

[RFC PATCH 0/4] Relocatable kernel support for PPC64

2008-05-29 Thread Mohan Kumar M
Hi, Following four patches enable the relocatable kernel feature for PPC64 kernels. 1. extract_relocation_info.patch 2. relocation_build.patch 3. apply_relocation.patch 4. relocation_support.patch With the patchset, vmcore image of a crashed system can be captured

[PATCH 1/2] update crypto node definition and device tree instances

2008-05-29 Thread Kim Phillips
delete obsolete device-type property, delete model property (use compatible property instead), prepend fsl, to Freescale specific properties. Add nodes to device trees that are missing them, and fix broken property values in other trees. Signed-off-by: Kim Phillips [EMAIL PROTECTED] ---

[RFC PATCH 1/4] Extract list of relocation offsets

2008-05-29 Thread Mohan Kumar M
Extract list of relocation offsets Extract list of offsets in the vmlinux file for which the relocation delta has to be patched. Currently only following type of relocation types are considered: R_PPC64_ADDR16_HI, R_PPC64_TOC and R_PPC64_ADDR64 The offsets are sorted according to the relocation

[PATCH 2/2] talitos: Freescale integrated security engine (SEC) driver

2008-05-29 Thread Kim Phillips
Add support for the SEC available on a wide range of PowerQUICC devices, e.g. MPC8349E, MPC8548E. this initial version supports authenc(hmac(sha1),cbc(aes)) for use with IPsec. Signed-off-by: Kim Phillips [EMAIL PROTECTED] --- drivers/crypto/Kconfig | 15 + drivers/crypto/Makefile |1 +

[RFC PATCH 2/4] Build files needed for relocation support

2008-05-29 Thread Mohan Kumar M
Build files needed for relocation This patch builds vmlinux file with relocation sections and contents so that relocs user space program can extract the required relocation offsets. This packs final relocatable vmlinux kernel as following: earlier part of relocation apply code, vmlinux, rest of

[RFC PATCH 3/4] Apply relocation info to vmlinux

2008-05-29 Thread Mohan Kumar M
Apply relocation info to vmlinux This code is a wrapper around regular kernel. This checks whether the kernel is loaded at 32MB, if its not loaded at 32MB, its treated as a regular kernel and the control is given to the kernel immediately. If the kernel is loaded at 32MB, it applies relocation

[RFC PATCH 4/4] Relocation support

2008-05-29 Thread Mohan Kumar M
Relocation support This patch changes all LOAD_REG_ADDR macro calls to LOAD_REG_IMMEDIATE to make sure that we load the correct address. It also takes care of absolute symbols access in the code by adding the relocation kernel base address. Signed-off-by: Mohan Kumar M [EMAIL PROTECTED] ---

Please pull merge branch of pasemi.git

2008-05-29 Thread Olof Johansson
Paul, Please pull from 'merge' branch of master.kernel.org:/pub/scm/linux/kernel/git/olof/pasemi.git merge to receive the following updates for 2.6.26: arch/powerpc/configs/pasemi_defconfig | 172 +- drivers/pcmcia/electra_cf.c |1 2 files

Re: [PATCH v4] [POWERPC] Move to runtime allocated exception stacks

2008-05-29 Thread Josh Boyer
On Tue, 20 May 2008 00:02:45 -0500 Kumar Gala [EMAIL PROTECTED] wrote: For the additonal exception levels (critical, debug, machine check) on 40x/book-e we were using static allocations of the stack in the associated head.S. Move to a runtime allocation to make the code a bit easier to read

Re: MMIO and gcc re-ordering issue

2008-05-29 Thread Benjamin Herrenschmidt
On Thu, 2008-05-29 at 10:47 -0400, Jes Sorensen wrote: The only way to guarantee ordering in the above setup, is to either make writel() fully ordered or adding the mmiowb()'s inbetween the two writel's. On Altix you have to go and read from the PCI brige to ensure all writes to it have been

Re: MMIO and gcc re-ordering issue

2008-05-29 Thread Trent Piepho
On Fri, 30 May 2008, Benjamin Herrenschmidt wrote: On Thu, 2008-05-29 at 10:47 -0400, Jes Sorensen wrote: Interesting. I've always been taught by ia64 people that mmiowb() was intended to be used solely between writel() and spin_unlock(). That's what I gathered too, based on what's written in

Re: MMIO and gcc re-ordering issue

2008-05-29 Thread Jesse Barnes
On Thursday, May 29, 2008 2:40 pm Benjamin Herrenschmidt wrote: On Thu, 2008-05-29 at 10:47 -0400, Jes Sorensen wrote: The only way to guarantee ordering in the above setup, is to either make writel() fully ordered or adding the mmiowb()'s inbetween the two writel's. On Altix you have to go

Re: MMIO and gcc re-ordering issue

2008-05-29 Thread Roland Dreier
The problem is that your two writel's, despite being both issued on cpu X, due to the spin lock, in your example, can end up with the first one going through NR 1 and the second one going through NR 2. If there's contention on NR 1, the write going via NR 2 may hit the PCI bridge prior

Re: MMIO and gcc re-ordering issue

2008-05-29 Thread Benjamin Herrenschmidt
On Thu, 2008-05-29 at 14:48 -0700, Trent Piepho wrote: I wrote a JTAG over gpio driver for the powerpc MPC8572DS platform. With the non-raw io accessors, the JTAG clock can run at almost ~9.5 MHz. Using raw versions (which I had to write since powerpc doesn't have any), the clock speed

JFFS2 problem, still

2008-05-29 Thread Ron Madrid
Ok, so I feel as though now I have a little more insight to this problem. Here's a brief rundown. I am using u-boot to boot the latest linux kernel from a large page NAND device (trivial) with the rootfs also on the same NAND device. In my dts the fs is defined as being located at 0x40

Re: MMIO and gcc re-ordering issue

2008-05-29 Thread Benjamin Herrenschmidt
I do -- in all the drivers for on-chip peripherals that are shared between AT91 ARM (LE) and AVR32 (BE). Since everything goes on inside the chip, we must use LE accesses on ARM and BE accesses on AVR32. Currently, this is the only interface I know that can do native-endian accesses, so if

Re: [PATCH] Add support for binary includes.

2008-05-29 Thread David Gibson
On Thu, May 29, 2008 at 09:04:29AM -0500, Jon Loeliger wrote: David Gibson wrote: A while back I sent out a spiel explaining more clearly why I didn't like it, and where I thought we should go with this, but I don't think anyone noticed it at the time. I'll resend. Thanks. Actually

dtc: Add a testcase for 'reg' or 'ranges' in /

2008-05-29 Thread David Gibson
This patch adds an extra testcase to dtc to ensure that the reg_format and ranges_format checks trigger as they should if a 'reg' or 'ranges' property appears in the root node. Signed-off-by: David Gibson [EMAIL PROTECTED] Index: dtc/tests/reg-ranges-root.dts

Re: MMIO and gcc re-ordering issue

2008-05-29 Thread Trent Piepho
On Fri, 30 May 2008, Benjamin Herrenschmidt wrote: On Thu, 2008-05-29 at 14:48 -0700, Trent Piepho wrote: I wrote a JTAG over gpio driver for the powerpc MPC8572DS platform. With the non-raw io accessors, the JTAG clock can run at almost ~9.5 MHz. Using raw versions (which I had to write

[PATCH] [POWERPC] Fix rpadlpar pci hotplug driver sysfs usage

2008-05-29 Thread Benjamin Herrenschmidt
When Greg fixed the sysfs usage of that driver a while back, he seem to have introduced a bug where the quotes are added around the name of our specific sysfs files, thus breaking the user space tool. This fixes it. Tested DLPAR operations on a POWER6 machine successfully. Signed-off-by:

Re: [PATCH] [POWERPC] Fix rpadlpar pci hotplug driver sysfs usage

2008-05-29 Thread Jesse Barnes
On Thursday, May 29, 2008 8:39 pm Benjamin Herrenschmidt wrote: When Greg fixed the sysfs usage of that driver a while back, he seem to have introduced a bug where the quotes are added around the name of our specific sysfs files, thus breaking the user space tool. This fixes it. Tested DLPAR

Re: MMIO and gcc re-ordering issue

2008-05-29 Thread Paul Mackerras
Trent Piepho writes: On Thu, 29 May 2008, Roland Dreier wrote: The problem is that your two writel's, despite being both issued on cpu X, due to the spin lock, in your example, can end up with the first one going through NR 1 and the second one going through NR 2. If there's

Re: [PATCH 2.6.26] electra_cf: Add MODULE_DEVICE_TABLE()

2008-05-29 Thread Stephen Rothwell
Hi Olof, On Thu, 29 May 2008 15:05:44 -0500 Olof Johansson [EMAIL PROTECTED] wrote: electra_cf: Add MODULE_DEVICE_TABLE() Add a module device table to electra_cf so that modules can be auto-probed/loaded. [will be included in git pull request later today] No Signed-off-by?

Re: [PATCH] [POWERPC] Fix rpadlpar pci hotplug driver sysfs usage

2008-05-29 Thread Benjamin Herrenschmidt
On Thu, 2008-05-29 at 21:02 -0700, Jesse Barnes wrote: On Thursday, May 29, 2008 8:39 pm Benjamin Herrenschmidt wrote: When Greg fixed the sysfs usage of that driver a while back, he seem to have introduced a bug where the quotes are added around the name of our specific sysfs files, thus