[patch 0/2] add Altivec/VMX state to coredumps

2007-10-11 Thread markn
-- 
Here's the new and improved patch to add Altivec/VMX state into the coredump.

It's now two patches:
* the first patch makes the note type of the state dumped by
  elf_core_copy_task_xfpregs() a #define and adds the appropriate #defines so
  that archs that support SSE still have their note type as NT_PRXFPREG
* the second patch actually adds the Altivec/VMX state to the coredumps and
  uses a note type of NT_PPC_VMX that's #defined as 0x100. Thus SPE could use
  a note type of NT_PPC_SPE and 0x101, for example.

The second patch is essentially the same as the single patch that was posted on
2007-09-25, but with the addition of the new NT_PPC_VMX note type.

___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


[patch 1/2] Replace NT_PRXFPREG with ELF_CORE_XFPREG_TYPE #define

2007-10-11 Thread markn
Replace NT_PRXFPREG with ELF_CORE_XFPREG_TYPE in the coredump code which
allows for more flexibility in the note type for the state of 'extended
floating point' implementations in coredumps. New note types can now be
added with an appropriate #define.

#define ELF_CORE_XFPREG_TYPE to be NT_PRXFPREG in all current users so
there's are no change in behaviour.

Signed-off-by: Mark Nelson <[EMAIL PROTECTED]>
---
 arch/ia64/ia32/elfcore32.h |1 +
 arch/x86_64/ia32/ia32_binfmt.c |1 +
 fs/binfmt_elf.c|4 ++--
 include/asm-i386/elf.h |1 +
 4 files changed, 5 insertions(+), 2 deletions(-)

Index: linux/arch/ia64/ia32/elfcore32.h
===
--- linux.orig/arch/ia64/ia32/elfcore32.h
+++ linux/arch/ia64/ia32/elfcore32.h
@@ -117,6 +117,7 @@ elf_core_copy_task_fpregs(struct task_st
 }
 
 #define ELF_CORE_COPY_XFPREGS 1
+#define ELF_CORE_XFPREG_TYPE NT_PRXFPREG
 static inline int
 elf_core_copy_task_xfpregs(struct task_struct *tsk, elf_fpxregset_t *xfpu)
 {
Index: linux/arch/x86_64/ia32/ia32_binfmt.c
===
--- linux.orig/arch/x86_64/ia32/ia32_binfmt.c
+++ linux/arch/x86_64/ia32/ia32_binfmt.c
@@ -188,6 +188,7 @@ elf_core_copy_task_fpregs(struct task_st
 }
 
 #define ELF_CORE_COPY_XFPREGS 1
+#define ELF_CORE_XFPREG_TYPE NT_PRXFPREG
 static inline int 
 elf_core_copy_task_xfpregs(struct task_struct *t, elf_fpxregset_t *xfpu)
 {
Index: linux/fs/binfmt_elf.c
===
--- linux.orig/fs/binfmt_elf.c
+++ linux/fs/binfmt_elf.c
@@ -1446,8 +1446,8 @@ static int elf_dump_thread_status(long s
 
 #ifdef ELF_CORE_COPY_XFPREGS
if (elf_core_copy_task_xfpregs(p, &t->xfpu)) {
-   fill_note(&t->notes[2], "LINUX", NT_PRXFPREG, sizeof(t->xfpu),
- &t->xfpu);
+   fill_note(&t->notes[2], "LINUX", ELF_CORE_XFPREG_TYPE,
+ sizeof(t->xfpu), &t->xfpu);
t->num_notes++;
sz += notesize(&t->notes[2]);
}
Index: linux/include/asm-i386/elf.h
===
--- linux.orig/include/asm-i386/elf.h
+++ linux/include/asm-i386/elf.h
@@ -129,6 +129,7 @@ extern int dump_task_extended_fpu (struc
 #define ELF_CORE_COPY_TASK_REGS(tsk, elf_regs) dump_task_regs(tsk, elf_regs)
 #define ELF_CORE_COPY_FPREGS(tsk, elf_fpregs) dump_task_fpu(tsk, elf_fpregs)
 #define ELF_CORE_COPY_XFPREGS(tsk, elf_xfpregs) dump_task_extended_fpu(tsk, 
elf_xfpregs)
+#define ELF_CORE_XFPREG_TYPE NT_PRXFPREG
 
 #define VDSO_HIGH_BASE (__fix_to_virt(FIX_VDSO))
 #define VDSO_CURRENT_BASE  ((unsigned long)current->mm->context.vdso)

-- 
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


[patch 2/2] add Altivec/VMX state to coredumps

2007-10-11 Thread markn
Update dump_task_altivec() (that has so far never been put to use)
so that it dumps the Altivec/VMX registers (VR[0] - VR[31], VSCR
and VRSAVE) in the same format as the ptrace get_vrregs() and add
the appropriate glue typedef and #defines to make it work.

A new note type of NT_PPC_VMX was chosen to be 0x100 (arbitrarily)
because it allows the low range values to be used for more generic
purposes and 0x100 seems an adequate starting point for PowerPC
extensions.

Signed-off-by: Mark Nelson <[EMAIL PROTECTED]>
---
 arch/powerpc/kernel/process.c |   28 +---
 include/asm-powerpc/elf.h |8 
 include/linux/elf.h   |1 +
 3 files changed, 34 insertions(+), 3 deletions(-)

Index: linux/arch/powerpc/kernel/process.c
===
--- linux.orig/arch/powerpc/kernel/process.c
+++ linux/arch/powerpc/kernel/process.c
@@ -149,10 +149,32 @@ void flush_altivec_to_thread(struct task
}
 }
 
-int dump_task_altivec(struct pt_regs *regs, elf_vrregset_t *vrregs)
+int dump_task_altivec(struct task_struct *tsk, elf_vrregset_t *vrregs)
 {
-   flush_altivec_to_thread(current);
-   memcpy(vrregs, ¤t->thread.vr[0], sizeof(*vrregs));
+   /* ELF_NVRREG includes the VSCR and VRSAVE which we need to save
+* separately, see below */
+   const int nregs = ELF_NVRREG - 2;
+   elf_vrreg_t *reg;
+   u32 *dest;
+
+   if (tsk == current)
+   flush_altivec_to_thread(tsk);
+
+   reg = (elf_vrreg_t *)vrregs;
+
+   /* copy the 32 vr registers */
+   memcpy(reg, &tsk->thread.vr[0], nregs * sizeof(*reg));
+   reg += nregs;
+
+   /* copy the vscr */
+   memcpy(reg, &tsk->thread.vscr, sizeof(*reg));
+   reg++;
+
+   /* vrsave is stored in the high 32bit slot of the final 128bits */
+   memset(reg, 0, sizeof(*reg));
+   dest = (u32 *)reg;
+   *dest = tsk->thread.vrsave;
+
return 1;
 }
 #endif /* CONFIG_ALTIVEC */
Index: linux/include/asm-powerpc/elf.h
===
--- linux.orig/include/asm-powerpc/elf.h
+++ linux/include/asm-powerpc/elf.h
@@ -212,6 +212,14 @@ static inline int dump_task_regs(struct 
 extern int dump_task_fpu(struct task_struct *, elf_fpregset_t *); 
 #define ELF_CORE_COPY_FPREGS(tsk, elf_fpregs) dump_task_fpu(tsk, elf_fpregs)
 
+typedef elf_vrregset_t elf_fpxregset_t;
+
+#ifdef CONFIG_ALTIVEC
+extern int dump_task_altivec(struct task_struct *, elf_vrregset_t *vrregs);
+#define ELF_CORE_COPY_XFPREGS(tsk, regs) dump_task_altivec(tsk, regs)
+#define ELF_CORE_XFPREG_TYPE NT_PPC_VMX
+#endif
+
 #endif /* __KERNEL__ */
 
 /* ELF_HWCAP yields a mask that user programs can use to figure out what
Index: linux/include/linux/elf.h
===
--- linux.orig/include/linux/elf.h
+++ linux/include/linux/elf.h
@@ -355,6 +355,7 @@ typedef struct elf64_shdr {
 #define NT_TASKSTRUCT  4
 #define NT_AUXV6
 #define NT_PRXFPREG 0x46e62b7f  /* copied from 
gdb5.1/include/elf/common.h */
+#define NT_PPC_VMX 0x100   /* PowerPC Altivec/VMX registers */
 
 
 /* Note header in a PT_NOTE section */

-- 
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


RE: [PATCH 4/9] add platform support for MPC837x MDS board

2007-10-11 Thread Li Yang-r58472
> -Original Message-
> From: Stephen Rothwell [mailto:[EMAIL PROTECTED] 
> Sent: Thursday, October 11, 2007 9:06 AM
> To: Li Yang-r58472
> Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED]; 
> linuxppc-dev@ozlabs.org
> Subject: Re: [PATCH 4/9] add platform support for MPC837x MDS board
> 
> On Wed, 10 Oct 2007 18:06:39 +0800 Li Yang 
> <[EMAIL PROTECTED]> wrote:
> >
> > +++ b/arch/powerpc/platforms/83xx/mpc837x_mds.c
> >
> > +#include 
> 
> You actually neeed linux/of.h (for of_ routines) and 
> asm/prom.h (for of_flat_dt_is_compatible).

Thanks for the comments.  Updated version on the way.

- Leo
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


[PATCH v2] Fix regression. Make hot unlplug of CPU0 work again.

2007-10-11 Thread Tony Breeds

Early in the 2.6.23 cycle we broke the ability to offline cpu0
(7ccb4a662462616f6be5053e26b79580e02f1529).  This patch fixes that by
ensuring that the (xics)  default irq server, will not be 0 when taking
cpu0 offline.

Also catches a use of irq, when virq should be used (I think that's the
last one).

This patch also include the fix from Milton which makes JS21 work
aswell. In the commit message for that patch Milton writes:
xics_set_affinity no longer looks at the cpu_mask arg, instead
get_irq_server reads it from the irq descriptor.

Signed-off-by: Tony Breeds <[EMAIL PROTECTED]>
Signed-off-by: Milton Miller <[EMAIL PROTECTED]>

---
Milton also says in his patch:
> A more complete fix might be to pass the cpu_mask struct to get_irq_server,
> but kernel/irq/manage.c currently sets the descriptor first.

 arch/powerpc/platforms/pseries/xics.c |   11 ++-
 1 files changed, 10 insertions(+), 1 deletions(-)

diff --git a/arch/powerpc/platforms/pseries/xics.c 
b/arch/powerpc/platforms/pseries/xics.c
index f0b5ff1..217ae5d 100644
--- a/arch/powerpc/platforms/pseries/xics.c
+++ b/arch/powerpc/platforms/pseries/xics.c
@@ -837,6 +837,15 @@ void xics_migrate_irqs_away(void)
/* Allow IPIs again... */
xics_set_cpu_priority(cpu, DEFAULT_PRIORITY);
 
+   /* It would be bad to migrate any IRQs to the CPU we're taking down */
+   if (default_server == cpu) {
+   unsigned int new_server = first_cpu(cpu_online_map);
+
+   default_server = get_hard_smp_processor_id(new_server);
+   printk(KERN_WARNING "%s: default server was %d, reset to %d\n",
+  __func__, cpu, default_server);
+   }
+
for_each_irq(virq) {
struct irq_desc *desc;
int xics_status[2];
@@ -881,8 +890,8 @@ void xics_migrate_irqs_away(void)
   virq, cpu);
 
/* Reset affinity to all cpus */
+   irq_desc[virq].affinity = CPU_MASK_ALL;
desc->chip->set_affinity(virq, CPU_MASK_ALL);
-   irq_desc[irq].affinity = CPU_MASK_ALL;
 unlock:
spin_unlock_irqrestore(&desc->lock, flags);
}

Yours Tony

  linux.conf.auhttp://linux.conf.au/ || http://lca2008.linux.org.au/
  Jan 28 - Feb 02 2008 The Australian Linux Technical Conference!

___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


port gnome

2007-10-11 Thread Bai Shuwei
all, hi
  I want to port the GNOME or KDE to AMCC PowerPC 440EP board. I want to
know whether it will run and whether the monitor work if I use PCI to
connect the monitor card? Thank you very much!

Buroc
-- 

Add: Tianshui South Road 222, Lanzhou, P.R.China
Tel: +86-931-8912025
Zip Code: 73
Email: [EMAIL PROTECTED], [EMAIL PROTECTED]
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev

Kconfig selects non-existent IBM_NEW_EMAC_ZMII

2007-10-11 Thread Robert P. J. Day

  just FYI, from arch/powerpc/platforms/4xx/Kconfig:

...
config 440GP
bool
select IBM_NEW_EMAC_ZMII
...

  there is no such Kconfig variable IBM_NEW_EMAC_ZMII.

rday
-- 

Robert P. J. Day
Linux Consulting, Training and Annoying Kernel Pedantry
Waterloo, Ontario, CANADA

http://crashcourse.ca

___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: port gnome

2007-10-11 Thread Benjamin Herrenschmidt

On Thu, 2007-10-11 at 16:22 +0800, Bai Shuwei wrote:
> 
> all, hi
>   I want to port the GNOME or KDE to AMCC PowerPC 440EP board. I want
> to know whether it will run and whether the monitor work if I use PCI
> to connect the monitor card? Thank you very much!

Gnome and KDE themselves should just work...

The problem is to get a video card working. The main issue is to
soft-boot it with some kind of x86 emulator such as x86emu. Once
that's done, the second main problem is that 440 tend to have
PCI memory space above 32bits, which totally defeats broken X
hacks through /dev/mem.

There's a way to work around the later by doing a kernel tweak to
create a "window" in /dev/mem that gets remapped to the appropriate
PCI space, but you still need to fake the card base address for
X ... pretty hard overall (doable though).

Ben.
 

___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [PATCH v2] Fix regression. Make hot unlplug of CPU0 work again.

2007-10-11 Thread Michael Neuling
In message <[EMAIL PROTECTED]> you wrote:
> 
> Early in the 2.6.23 cycle we broke the ability to offline cpu0
> (7ccb4a662462616f6be5053e26b79580e02f1529).  This patch fixes that by
> ensuring that the (xics)  default irq server, will not be 0 when taking
> cpu0 offline.
> 
> Also catches a use of irq, when virq should be used (I think that's the
> last one).
> 
> This patch also include the fix from Milton which makes JS21 work
> aswell. In the commit message for that patch Milton writes:
>   xics_set_affinity no longer looks at the cpu_mask arg, instead
>   get_irq_server reads it from the irq descriptor.

This doesn't fix the problem for me.  

If I offline CPU0, then online it again, it's fine, but doing the same
for CPU1 kills the machine.

Mikey

> 
> Signed-off-by: Tony Breeds <[EMAIL PROTECTED]>
> Signed-off-by: Milton Miller <[EMAIL PROTECTED]>
> 
> ---
> Milton also says in his patch:
> > A more complete fix might be to pass the cpu_mask struct to get_irq_server,
> > but kernel/irq/manage.c currently sets the descriptor first.
> 
>  arch/powerpc/platforms/pseries/xics.c |   11 ++-
>  1 files changed, 10 insertions(+), 1 deletions(-)
> 
> diff --git a/arch/powerpc/platforms/pseries/xics.c b/arch/powerpc/platforms/p
series/xics.c
> index f0b5ff1..217ae5d 100644
> --- a/arch/powerpc/platforms/pseries/xics.c
> +++ b/arch/powerpc/platforms/pseries/xics.c
> @@ -837,6 +837,15 @@ void xics_migrate_irqs_away(void)
>   /* Allow IPIs again... */
>   xics_set_cpu_priority(cpu, DEFAULT_PRIORITY);
>  
> + /* It would be bad to migrate any IRQs to the CPU we're taking down */
> + if (default_server == cpu) {
> + unsigned int new_server = first_cpu(cpu_online_map);
> +
> + default_server = get_hard_smp_processor_id(new_server);
> + printk(KERN_WARNING "%s: default server was %d, reset to %d\n",
> +__func__, cpu, default_server);
> + }
> +
>   for_each_irq(virq) {
>   struct irq_desc *desc;
>   int xics_status[2];
> @@ -881,8 +890,8 @@ void xics_migrate_irqs_away(void)
>  virq, cpu);
>  
>   /* Reset affinity to all cpus */
> + irq_desc[virq].affinity = CPU_MASK_ALL;
>   desc->chip->set_affinity(virq, CPU_MASK_ALL);
> - irq_desc[irq].affinity = CPU_MASK_ALL;
>  unlock:
>   spin_unlock_irqrestore(&desc->lock, flags);
>   }
> 
> Yours Tony
> 
>   linux.conf.auhttp://linux.conf.au/ || http://lca2008.linux.org.au/
>   Jan 28 - Feb 02 2008 The Australian Linux Technical Conference!
> 
> ___
> Linuxppc-dev mailing list
> Linuxppc-dev@ozlabs.org
> https://ozlabs.org/mailman/listinfo/linuxppc-dev
> 
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [PATCH 3/3] [POWERPC] Kilauea DTS

2007-10-11 Thread Stefan Roese
On Wednesday 10 October 2007, Josh Boyer wrote:
> On Mon, 2007-10-08 at 11:10 +0200, Stefan Roese wrote:
> > Signed-off-by: Stefan Roese <[EMAIL PROTECTED]>
>
> Looks pretty good.  Just a couple of questions.
>
> > ---
> >  arch/powerpc/boot/dts/kilauea.dts |  253
> > + 1 files changed, 253 insertions(+),
> > 0 deletions(-)
> >  create mode 100644 arch/powerpc/boot/dts/kilauea.dts
> >
> > diff --git a/arch/powerpc/boot/dts/kilauea.dts
> > b/arch/powerpc/boot/dts/kilauea.dts new file mode 100644
> > index 000..4683174
> > --- /dev/null
> > +++ b/arch/powerpc/boot/dts/kilauea.dts
> > @@ -0,0 +1,253 @@
> > +/*
> > + * Device Tree Source for AMCC Kilauea (405EX)
> > + *
> > + * Copyright 2007 DENX Software Engineering, Stefan Roese <[EMAIL 
> > PROTECTED]>
> > + *
> > + * This file is licensed under the terms of the GNU General Public
> > + * License version 2.  This program is licensed "as is" without
> > + * any warranty of any kind, whether express or implied.
> > + */
> > +
> > +/ {
> > +   #address-cells = <1>;
> > +   #size-cells = <1>;
> > +   model = "amcc,kilauea";
> > +   compatible = "amcc,kilauea";
> > +   dcr-parent = <&/cpus/PowerPC,[EMAIL PROTECTED]>;
> > +
> > +   cpus {
> > +   #address-cells = <1>;
> > +   #size-cells = <0>;
> > +
> > +   PowerPC,[EMAIL PROTECTED] {
> > +   device_type = "cpu";
> > +   reg = <0>;
> > +   clock-frequency = <0>; /* Filled in by U-Boot */
>
> Filled in by U-Boot itself?  Or by a cuboot wrapper? (which I can't find
> in the patches.)

By U-Boot itself. I have a U-Boot patch in the queue to add device tree 
support for 4xx. Therefor I don't plan adding a cuboot wrapper for Kilauea.

> > +   timebase-frequency = <0>; /* Filled in by U-Boot */
> > +   i-cache-line-size = <20>;
> > +   d-cache-line-size = <20>;
> > +   i-cache-size = <4000>; /* 16 kB */
> > +   d-cache-size = <4000>; /* 16 kB */
> > +   dcr-controller;
> > +   dcr-access-method = "native";
> > +   };
> > +   };
> > +
> > +   memory {
> > +   device_type = "memory";
> > +   reg = <0 0>; /* Filled in by U-Boot */
> > +   };
> > +
> > +   UIC0: interrupt-controller {
> > +   compatible = "ibm,uic-405ex", "ibm,uic";
> > +   interrupt-controller;
> > +   cell-index = <0>;
> > +   dcr-reg = <0c0 009>;
> > +   #address-cells = <0>;
> > +   #size-cells = <0>;
> > +   #interrupt-cells = <2>;
> > +   };
> > +
> > +   UIC1: interrupt-controller1 {
> > +   compatible = "ibm,uic-405ex","ibm,uic";
> > +   interrupt-controller;
> > +   cell-index = <1>;
> > +   dcr-reg = <0d0 009>;
> > +   #address-cells = <0>;
> > +   #size-cells = <0>;
> > +   #interrupt-cells = <2>;
> > +   interrupts = <1e 4 1f 4>; /* cascade */
> > +   interrupt-parent = <&UIC0>;
> > +   };
> > +
> > +   UIC2: interrupt-controller2 {
> > +   compatible = "ibm,uic-405ex","ibm,uic";
> > +   interrupt-controller;
> > +   cell-index = <2>;
> > +   dcr-reg = <0e0 009>;
> > +   #address-cells = <0>;
> > +   #size-cells = <0>;
> > +   #interrupt-cells = <2>;
> > +   interrupts = <1c 4 1d 4>; /* cascade */
> > +   interrupt-parent = <&UIC0>;
> > +   };
> > +
> > +   plb {
> > +   compatible = "ibm,plb-405ex", "ibm,plb4";
> > +   #address-cells = <1>;
> > +   #size-cells = <1>;
> > +   ranges;
> > +   clock-frequency = <0>; /* Filled in by U-Boot */
> > +
> > +   SDRAM0: memory-controller {
> > +   compatible = "ibm,sdram-405ex";
> > +   dcr-reg = <010 2>;
> > +   };
> > +
> > +   MAL0: mcmal {
> > +   compatible = "ibm,mcmal-405ex", "ibm,mcmal2";
> > +   dcr-reg = <180 62>;
> > +   num-tx-chans = <2>;
> > +   num-rx-chans = <2>;
> > +   interrupt-parent = <&MAL0>;
> > +   interrupts = <0 1 2 3 4>;
> > +   #interrupt-cells = <1>;
> > +   #address-cells = <0>;
> > +   #size-cells = <0>;
> > +   interrupt-map =  > +   /*RXEOB*/ 1 &UIC0 b 4
> > +   /*SERR*/  2 &UIC1 0 4
> > +   /*TXDE*/  3 &UIC1 1 4
> > +   /*RXDE*/  4 &UIC1 2 4>;
> > +   interrupt-map-mask = ;
> > +   };
> > +
> > +   POB0: opb {
> > +   compatible = "ibm,opb-405ex", "ibm,opb";
> > +   #address-cells = <1>;
> > +   #size-cells = <1>;
> > +   ranges = ;
> > +   d

[PATCH 3/9 v2] add Freescale SerDes PHY support

2007-10-11 Thread Li Yang
The SerDes(serializer/deserializer) PHY block is a new SoC block used
in Freescale chips to support multiple serial interfaces, such as PCI
Express, SGMII, SATA.

Signed-off-by: Li Yang <[EMAIL PROTECTED]>
---
 arch/powerpc/platforms/Kconfig   |4 +
 arch/powerpc/sysdev/Makefile |1 +
 arch/powerpc/sysdev/fsl_serdes.c |  170 ++
 arch/powerpc/sysdev/fsl_serdes.h |   36 
 4 files changed, 211 insertions(+), 0 deletions(-)
 create mode 100644 arch/powerpc/sysdev/fsl_serdes.c
 create mode 100644 arch/powerpc/sysdev/fsl_serdes.h

diff --git a/arch/powerpc/platforms/Kconfig b/arch/powerpc/platforms/Kconfig
index 19d4628..e89f803 100644
--- a/arch/powerpc/platforms/Kconfig
+++ b/arch/powerpc/platforms/Kconfig
@@ -291,4 +291,8 @@ config FSL_ULI1575
  Freescale reference boards. The boards all use the ULI in pretty
  much the same way.
 
+config FSL_SERDES
+   bool
+   default n
+
 endmenu
diff --git a/arch/powerpc/sysdev/Makefile b/arch/powerpc/sysdev/Makefile
index 08ce31e..315aa36 100644
--- a/arch/powerpc/sysdev/Makefile
+++ b/arch/powerpc/sysdev/Makefile
@@ -19,6 +19,7 @@ mv64x60-$(CONFIG_PCI) += mv64x60_pci.o
 obj-$(CONFIG_MV64X60)  += $(mv64x60-y) mv64x60_pic.o mv64x60_dev.o
 obj-$(CONFIG_RTC_DRV_CMOS) += rtc_cmos_setup.o
 obj-$(CONFIG_AXON_RAM) += axonram.o
+obj-$(CONFIG_FSL_SERDES)   += fsl_serdes.o
 
 # contains only the suspend handler for time
 ifeq ($(CONFIG_RTC_CLASS),)
diff --git a/arch/powerpc/sysdev/fsl_serdes.c b/arch/powerpc/sysdev/fsl_serdes.c
new file mode 100644
index 000..8a04395
--- /dev/null
+++ b/arch/powerpc/sysdev/fsl_serdes.c
@@ -0,0 +1,170 @@
+/*
+ * arch/powerpc/sysdev/fsl_serdes.c
+ *
+ * Copyright (C) 2007 Freescale Semiconductor, Inc. All rights reserved.
+ *
+ * Author: Li Yang <[EMAIL PROTECTED]>
+ *
+ * Freescale SerDes initialization routines
+ *
+ * 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 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+#include 
+
+#include "fsl_serdes.h"
+
+static int __init setup_serdes(struct device_node *np)
+{
+   void __iomem *regs;
+   const void *prot;
+   const unsigned int *freq;
+   struct resource res;
+   u32 tmp, rfcks;
+
+   of_address_to_resource(np, 0, &res);
+   regs = ioremap(res.start, res.end - res.start + 1);
+
+   prot = of_get_property(np, "protocol", NULL);
+   if (!prot)
+   return -EINVAL;
+   freq = of_get_property(np, "clock", NULL);
+   switch (*freq) {
+   case 100:
+   rfcks = FSL_SRDSCR4_RFCKS_100;
+   break;
+   case 125:
+   rfcks = FSL_SRDSCR4_RFCKS_125;
+   break;
+   case 150:
+   rfcks = FSL_SRDSCR4_RFCKS_150;
+   break;
+   default:
+   printk(KERN_ERR "SerDes: Wrong frequency\n");
+   return -EINVAL;
+   }
+
+   /* Use default prescale and counter */
+
+   /* 1.0V corevdd */
+   if (of_get_property(np, "vdd-1v", NULL)) {
+   /* DPPE/DPPA = 0 */
+   tmp = in_be32(regs + FSL_SRDSCR0_OFFS);
+   tmp &= ~FSL_SRDSCR0_DPP_1V2;
+   out_be32(regs + FSL_SRDSCR0_OFFS, tmp);
+
+   /* VDD = 0 */
+   tmp = in_be32(regs + FSL_SRDSCR2_OFFS);
+   tmp &= ~FSL_SRDSCR2_VDD_1V2;
+   out_be32(regs + FSL_SRDSCR2_OFFS, tmp);
+   }
+
+   /* protocol specific configuration */
+   if (!strcmp(prot, "sata")) {
+   /* Set and clear reset bits */
+   tmp = in_be32(regs + FSL_SRDSRSTCTL_OFFS);
+   tmp |= FSL_SRDSRSTCTL_SATA_RESET;
+   out_be32(regs + FSL_SRDSRSTCTL_OFFS, tmp);
+   mdelay(1);
+   tmp &= ~FSL_SRDSRSTCTL_SATA_RESET;
+   out_be32(regs + FSL_SRDSRSTCTL_OFFS, tmp);
+
+   /* Configure SRDSCR1 */
+   tmp = in_be32(regs + FSL_SRDSCR1_OFFS);
+   tmp &= ~FSL_SRDSCR1_PLLBW;
+   out_be32(regs + FSL_SRDSCR1_OFFS, tmp);
+
+   /* Configure SRDSCR2 */
+   tmp = in_be32(regs + FSL_SRDSCR2_OFFS);
+   tmp &= ~FSL_SRDSCR2_SEIC_MASK;
+   tmp |= FSL_SRDSCR2_SEIC_SATA;
+   out_be32(regs + FSL_SRDSCR2_OFFS, tmp);
+
+   /* Configure SRDSCR3 */
+   tmp = FSL_SRDSCR3_KFR_SATA | FSL_SRDSCR3_KPH_SATA |
+   FSL_SRDSCR3_SDFM_SATA_PEX |
+   FSL_SRDSCR3_SDTXL_SATA;
+   out_be32(regs + FSL_SRDSCR3_OFFS, tmp);
+
+   /* Configure SRDSCR4 */
+   tmp = rfcks | FSL_SRDSCR4_PROT_SATA;
+   out_be32(regs + FSL_SRDSCR4_OFF

[PATCH 4/9 v2] add platform support for MPC837x MDS board

2007-10-11 Thread Li Yang
The MPC837x MDS is a new member of Freescale MDS reference system.

Signed-off-by: Li Yang <[EMAIL PROTECTED]>
---
 arch/powerpc/platforms/83xx/Kconfig   |   12 
 arch/powerpc/platforms/83xx/Makefile  |1 +
 arch/powerpc/platforms/83xx/mpc837x_mds.c |  102 +
 3 files changed, 115 insertions(+), 0 deletions(-)
 create mode 100644 arch/powerpc/platforms/83xx/mpc837x_mds.c

diff --git a/arch/powerpc/platforms/83xx/Kconfig 
b/arch/powerpc/platforms/83xx/Kconfig
index ec305f1..0c61e7a 100644
--- a/arch/powerpc/platforms/83xx/Kconfig
+++ b/arch/powerpc/platforms/83xx/Kconfig
@@ -50,6 +50,11 @@ config MPC836x_MDS
help
  This option enables support for the MPC836x MDS Processor Board.
 
+config MPC837x_MDS
+   bool "Freescale MPC837x MDS"
+   select DEFAULT_UIMAGE
+   help
+ This option enables support for the MPC837x MDS Processor Board.
 endchoice
 
 config PPC_MPC831x
@@ -75,3 +80,10 @@ config PPC_MPC836x
select PPC_UDBG_16550
select PPC_INDIRECT_PCI
default y if MPC836x_MDS
+
+config PPC_MPC837x
+   bool
+   select PPC_UDBG_16550
+   select PPC_INDIRECT_PCI
+   select FSL_SERDES
+   default y if MPC837x_MDS
diff --git a/arch/powerpc/platforms/83xx/Makefile 
b/arch/powerpc/platforms/83xx/Makefile
index 5a98f88..df46629 100644
--- a/arch/powerpc/platforms/83xx/Makefile
+++ b/arch/powerpc/platforms/83xx/Makefile
@@ -9,3 +9,4 @@ obj-$(CONFIG_MPC834x_MDS)   += mpc834x_mds.o
 obj-$(CONFIG_MPC834x_ITX)  += mpc834x_itx.o
 obj-$(CONFIG_MPC836x_MDS)  += mpc836x_mds.o
 obj-$(CONFIG_MPC832x_MDS)  += mpc832x_mds.o
+obj-$(CONFIG_MPC837x_MDS)  += mpc837x_mds.o
diff --git a/arch/powerpc/platforms/83xx/mpc837x_mds.c 
b/arch/powerpc/platforms/83xx/mpc837x_mds.c
new file mode 100644
index 000..4342173
--- /dev/null
+++ b/arch/powerpc/platforms/83xx/mpc837x_mds.c
@@ -0,0 +1,103 @@
+/*
+ * arch/powerpc/platforms/83xx/mpc837x_mds.c
+ *
+ * Copyright (C) 2007 Freescale Semiconductor, Inc. All rights reserved.
+ *
+ * MPC837x MDS board specific routines
+ *
+ * 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 
+
+#include 
+#include 
+#include 
+
+#include "mpc83xx.h"
+
+#ifndef CONFIG_PCI
+unsigned long isa_io_base = 0;
+unsigned long isa_mem_base = 0;
+#endif
+
+/* 
+ *
+ * Setup the architecture
+ *
+ */
+static void __init mpc837x_mds_setup_arch(void)
+{
+#ifdef CONFIG_PCI
+   struct device_node *np;
+#endif
+
+   if (ppc_md.progress)
+   ppc_md.progress("mpc837x_mds_setup_arch()", 0);
+
+#ifdef CONFIG_PCI
+   for (np = NULL; (np = of_find_node_by_type(np, "pci")) != NULL;)
+   mpc83xx_add_bridge(np);
+#endif
+}
+
+static struct of_device_id mpc837x_ids[] = {
+   { .type = "soc", },
+   { .compatible = "soc", },
+   {},
+};
+
+static int __init mpc837x_declare_of_platform_devices(void)
+{
+   if (!machine_is(mpc837x_mds))
+   return 0;
+
+   /* Publish of_device */
+   of_platform_bus_probe(NULL, mpc837x_ids, NULL);
+
+   return 0;
+}
+device_initcall(mpc837x_declare_of_platform_devices);
+
+static void __init mpc837x_mds_init_IRQ(void)
+{
+   struct device_node *np;
+
+   np = of_find_compatible_node(NULL, NULL, "fsl,ipic");
+   if (!np)
+   return;
+
+   ipic_init(np, 0);
+
+   /* Initialize the default interrupt mapping priorities,
+* in case the boot rom changed something on us.
+*/
+   ipic_set_default_priority();
+}
+
+/*
+ * Called very early, MMU is off, device-tree isn't unflattened
+ */
+static int __init mpc837x_mds_probe(void)
+{
+unsigned long root = of_get_flat_dt_root();
+
+return of_flat_dt_is_compatible(root, "fsl,mpc837xmds");
+}
+
+define_machine(mpc837x_mds) {
+   .name   = "MPC837x MDS",
+   .probe  = mpc837x_mds_probe,
+   .setup_arch = mpc837x_mds_setup_arch,
+   .init_IRQ   = mpc837x_mds_init_IRQ,
+   .get_irq= ipic_get_irq,
+   .restart= mpc83xx_restart,
+   .time_init  = mpc83xx_time_init,
+   .calibrate_decr = generic_calibrate_decr,
+   .progress   = udbg_progress,
+};
-- 
1.5.3.2.104.g41ef

___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


[PATCH] Make clockevents work on PPC601 processors

2007-10-11 Thread Paul Mackerras
In testing the new clocksource and clockevent code on a PPC601
processor, I discovered that the clockevent multiplier value for the
decrementer clockevent was overflowing.  Because the RTCL register in
the 601 effectively counts at 1GHz (it doesn't actually, but it
increases by 128 every 128ns), and the shift value was 32, that meant
the multiplier value had to be 2^32, which won't fit in an unsigned
long on 32-bit.  The same problem would arise on any platform where
the timebase frequency was 1GHz or more (not that we actually have any
such machines today).

This fixes it by reducing the shift value to 16.  Doing the
calculations with a resolution of 2^-16 nanoseconds (15 femtoseconds)
should be quite adequate.  :) 

Signed-off-by: Paul Mackerras <[EMAIL PROTECTED]>
---
diff --git a/arch/powerpc/kernel/time.c b/arch/powerpc/kernel/time.c
index 64b503c..9368da3 100644
--- a/arch/powerpc/kernel/time.c
+++ b/arch/powerpc/kernel/time.c
@@ -108,7 +108,7 @@ static void decrementer_set_mode(enum clock_event_mode mode,
 static struct clock_event_device decrementer_clockevent = {
.name   = "decrementer",
.rating = 200,
-   .shift  = 32,
+   .shift  = 16,
.mult   = 0,/* To be filled in */
.irq= 0,
.set_next_event = decrementer_set_next_event,
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [PATCH 3/3] [POWERPC] Kilauea DTS

2007-10-11 Thread Josh Boyer
On Thu, 2007-10-11 at 10:49 +0200, Stefan Roese wrote:
> > > + PowerPC,[EMAIL PROTECTED] {
> > > + device_type = "cpu";
> > > + reg = <0>;
> > > + clock-frequency = <0>; /* Filled in by U-Boot */
> >
> > Filled in by U-Boot itself?  Or by a cuboot wrapper? (which I can't find
> > in the patches.)
> 
> By U-Boot itself. I have a U-Boot patch in the queue to add device tree 
> support for 4xx. Therefor I don't plan adding a cuboot wrapper for Kilauea.

Very cool!

> > > + interrupt-parent = <&UIC1>;
> > > +
> > > + [EMAIL PROTECTED],0 {
> >
> > You have no ranges property for the ebc parent node.  Is if filled in by
> > U-Boot?  If so, please add a comment because otherwise I don't see how
> > this mapping will work.
> 
> Yes, it's filled in by U-Boot too. I'll add a comment here.

Ok.

> >
> > No chosen node?
> 
> No. U-Boot will provide all needed information here.

Does it provide it by creating the chosen node?  Or by still using the
bd_t method?

josh

___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [PATCH 3/3] [POWERPC] Kilauea DTS

2007-10-11 Thread Stefan Roese
On Thursday 11 October 2007, Josh Boyer wrote:
> On Thu, 2007-10-11 at 10:49 +0200, Stefan Roese wrote:
> > > > +   PowerPC,[EMAIL PROTECTED] {
> > > > +   device_type = "cpu";
> > > > +   reg = <0>;
> > > > +   clock-frequency = <0>; /* Filled in by U-Boot */
> > >
> > > Filled in by U-Boot itself?  Or by a cuboot wrapper? (which I can't
> > > find in the patches.)
> >
> > By U-Boot itself. I have a U-Boot patch in the queue to add device tree
> > support for 4xx. Therefor I don't plan adding a cuboot wrapper for
> > Kilauea.
>
> Very cool!

You can take a look at the kilauea-405ex branch of my 4xx custodian repository 
for a latest development snapshort:

http://www.denx.de/cgi-bin/gitweb.cgi?p=u-boot/u-boot-ppc4xx.git;a=shortlog;h=kilauea-405ex

> > > > +   interrupt-parent = <&UIC1>;
> > > > +
> > > > +   [EMAIL PROTECTED],0 {
> > >
> > > You have no ranges property for the ebc parent node.  Is if filled in
> > > by U-Boot?  If so, please add a comment because otherwise I don't see
> > > how this mapping will work.
> >
> > Yes, it's filled in by U-Boot too. I'll add a comment here.
>
> Ok.
>
> > > No chosen node?
> >
> > No. U-Boot will provide all needed information here.
>
> Does it provide it by creating the chosen node?  Or by still using the
> bd_t method?

bd_t? What's that? ;)

Best regards,
Stefan
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


[PATCH 1/4 v2] [POWERPC] Add AMCC 405EX support to cputable.c

2007-10-11 Thread Stefan Roese
Signed-off-by: Stefan Roese <[EMAIL PROTECTED]>
---
 arch/powerpc/kernel/cputable.c |   11 +++
 1 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/arch/powerpc/kernel/cputable.c b/arch/powerpc/kernel/cputable.c
index b03a442..eccdad0 100644
--- a/arch/powerpc/kernel/cputable.c
+++ b/arch/powerpc/kernel/cputable.c
@@ -1103,6 +1103,17 @@ static struct cpu_spec cpu_specs[] = {
.dcache_bsize   = 32,
.platform   = "ppc405",
},
+   {   /* 405EX */
+   .pvr_mask   = 0x,
+   .pvr_value  = 0x1291,
+   .cpu_name   = "405EX",
+   .cpu_features   = CPU_FTRS_40X,
+   .cpu_user_features  = PPC_FEATURE_32 |
+   PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC,
+   .icache_bsize   = 32,
+   .dcache_bsize   = 32,
+   .platform   = "ppc405",
+   },
 
 #endif /* CONFIG_40x */
 #ifdef CONFIG_44x
-- 
1.5.3.4

___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


[PATCH 3/4 v2] [POWERPC] Kilauea DTS

2007-10-11 Thread Stefan Roese
Signed-off-by: Stefan Roese <[EMAIL PROTECTED]>
---
 arch/powerpc/boot/dts/kilauea.dts |  252 +
 1 files changed, 252 insertions(+), 0 deletions(-)
 create mode 100644 arch/powerpc/boot/dts/kilauea.dts

diff --git a/arch/powerpc/boot/dts/kilauea.dts 
b/arch/powerpc/boot/dts/kilauea.dts
new file mode 100644
index 000..c824e8f
--- /dev/null
+++ b/arch/powerpc/boot/dts/kilauea.dts
@@ -0,0 +1,252 @@
+/*
+ * Device Tree Source for AMCC Kilauea (405EX)
+ *
+ * Copyright 2007 DENX Software Engineering, Stefan Roese <[EMAIL PROTECTED]>
+ *
+ * This file is licensed under the terms of the GNU General Public
+ * License version 2.  This program is licensed "as is" without
+ * any warranty of any kind, whether express or implied.
+ */
+
+/ {
+   #address-cells = <1>;
+   #size-cells = <1>;
+   model = "amcc,kilauea";
+   compatible = "amcc,kilauea";
+   dcr-parent = <&/cpus/PowerPC,[EMAIL PROTECTED]>;
+
+   cpus {
+   #address-cells = <1>;
+   #size-cells = <0>;
+
+   PowerPC,[EMAIL PROTECTED] {
+   device_type = "cpu";
+   reg = <0>;
+   clock-frequency = <0>; /* Filled in by U-Boot */
+   timebase-frequency = <0>; /* Filled in by U-Boot */
+   i-cache-line-size = <20>;
+   d-cache-line-size = <20>;
+   i-cache-size = <4000>; /* 16 kB */
+   d-cache-size = <4000>; /* 16 kB */
+   dcr-controller;
+   dcr-access-method = "native";
+   };
+   };
+
+   memory {
+   device_type = "memory";
+   reg = <0 0>; /* Filled in by U-Boot */
+   };
+
+   UIC0: interrupt-controller {
+   compatible = "ibm,uic-405ex", "ibm,uic";
+   interrupt-controller;
+   cell-index = <0>;
+   dcr-reg = <0c0 009>;
+   #address-cells = <0>;
+   #size-cells = <0>;
+   #interrupt-cells = <2>;
+   };
+
+   UIC1: interrupt-controller1 {
+   compatible = "ibm,uic-405ex","ibm,uic";
+   interrupt-controller;
+   cell-index = <1>;
+   dcr-reg = <0d0 009>;
+   #address-cells = <0>;
+   #size-cells = <0>;
+   #interrupt-cells = <2>;
+   interrupts = <1e 4 1f 4>; /* cascade */
+   interrupt-parent = <&UIC0>;
+   };
+
+   UIC2: interrupt-controller2 {
+   compatible = "ibm,uic-405ex","ibm,uic";
+   interrupt-controller;
+   cell-index = <2>;
+   dcr-reg = <0e0 009>;
+   #address-cells = <0>;
+   #size-cells = <0>;
+   #interrupt-cells = <2>;
+   interrupts = <1c 4 1d 4>; /* cascade */
+   interrupt-parent = <&UIC0>;
+   };
+
+   plb {
+   compatible = "ibm,plb-405ex", "ibm,plb4";
+   #address-cells = <1>;
+   #size-cells = <1>;
+   ranges;
+   clock-frequency = <0>; /* Filled in by U-Boot */
+
+   SDRAM0: memory-controller {
+   compatible = "ibm,sdram-405ex";
+   dcr-reg = <010 2>;
+   };
+
+   MAL0: mcmal {
+   compatible = "ibm,mcmal-405ex", "ibm,mcmal2";
+   dcr-reg = <180 62>;
+   num-tx-chans = <2>;
+   num-rx-chans = <2>;
+   interrupt-parent = <&MAL0>;
+   interrupts = <0 1 2 3 4>;
+   #interrupt-cells = <1>;
+   #address-cells = <0>;
+   #size-cells = <0>;
+   interrupt-map = ;
+   interrupt-map-mask = ;
+   };
+
+   POB0: opb {
+   compatible = "ibm,opb-405ex", "ibm,opb";
+   #address-cells = <1>;
+   #size-cells = <1>;
+   ranges = <8000 8000 1000
+ ef60 ef60 a0
+ f000 f000 1000>;
+   dcr-reg = <0a0 5>;
+   clock-frequency = <0>; /* Filled in by U-Boot */
+
+   EBC0: ebc {
+   compatible = "ibm,ebc-405ex", "ibm,ebc";
+   dcr-reg = <012 2>;
+   #address-cells = <2>;
+   #size-cells = <1>;
+   clock-frequency = <0>; /* Filled in by U-Boot */
+   /* ranges property is supplied by U-Boot */
+   interrupts = <5 1>;
+   interrupt-parent = <&UIC1>;
+
+ 

[PATCH 4/4 v2] [POWERPC] Kilauea defconfig file

2007-10-11 Thread Stefan Roese
Signed-off-by: Stefan Roese <[EMAIL PROTECTED]>
---
 arch/powerpc/configs/kilauea_defconfig |  768 
 1 files changed, 768 insertions(+), 0 deletions(-)
 create mode 100644 arch/powerpc/configs/kilauea_defconfig

diff --git a/arch/powerpc/configs/kilauea_defconfig 
b/arch/powerpc/configs/kilauea_defconfig
new file mode 100644
index 000..0ce0a58
--- /dev/null
+++ b/arch/powerpc/configs/kilauea_defconfig
@@ -0,0 +1,768 @@
+#
+# Automatically generated make config: don't edit
+# Linux kernel version: 2.6.23-rc9
+# Thu Oct 11 10:57:30 2007
+#
+# CONFIG_PPC64 is not set
+
+#
+# Processor support
+#
+# CONFIG_6xx is not set
+# CONFIG_PPC_85xx is not set
+# CONFIG_PPC_8xx is not set
+CONFIG_40x=y
+# CONFIG_44x is not set
+# CONFIG_E200 is not set
+CONFIG_4xx=y
+# CONFIG_PPC_MM_SLICES is not set
+CONFIG_NOT_COHERENT_CACHE=y
+CONFIG_PPC32=y
+CONFIG_WORD_SIZE=32
+CONFIG_PPC_MERGE=y
+CONFIG_MMU=y
+CONFIG_GENERIC_CMOS_UPDATE=y
+CONFIG_GENERIC_TIME=y
+CONFIG_GENERIC_TIME_VSYSCALL=y
+CONFIG_GENERIC_CLOCKEVENTS=y
+CONFIG_GENERIC_HARDIRQS=y
+CONFIG_IRQ_PER_CPU=y
+CONFIG_RWSEM_XCHGADD_ALGORITHM=y
+CONFIG_ARCH_HAS_ILOG2_U32=y
+CONFIG_GENERIC_HWEIGHT=y
+CONFIG_GENERIC_CALIBRATE_DELAY=y
+CONFIG_GENERIC_FIND_NEXT_BIT=y
+# CONFIG_ARCH_NO_VIRT_TO_BUS is not set
+CONFIG_PPC=y
+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_OF=y
+# CONFIG_PPC_UDBG_16550 is not set
+# CONFIG_GENERIC_TBSYNC is not set
+CONFIG_AUDIT_ARCH=y
+CONFIG_GENERIC_BUG=y
+# CONFIG_DEFAULT_UIMAGE is not set
+CONFIG_PPC_DCR_NATIVE=y
+# CONFIG_PPC_DCR_MMIO is not set
+CONFIG_PPC_DCR=y
+CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
+
+#
+# General setup
+#
+CONFIG_EXPERIMENTAL=y
+CONFIG_BROKEN_ON_SMP=y
+CONFIG_INIT_ENV_ARG_LIMIT=32
+CONFIG_LOCALVERSION=""
+CONFIG_LOCALVERSION_AUTO=y
+CONFIG_SWAP=y
+CONFIG_SYSVIPC=y
+CONFIG_SYSVIPC_SYSCTL=y
+CONFIG_POSIX_MQUEUE=y
+# CONFIG_BSD_PROCESS_ACCT is not set
+# CONFIG_TASKSTATS is not set
+# CONFIG_USER_NS is not set
+# CONFIG_AUDIT is not set
+# CONFIG_IKCONFIG is not set
+CONFIG_LOG_BUF_SHIFT=14
+CONFIG_SYSFS_DEPRECATED=y
+# CONFIG_RELAY is not set
+CONFIG_BLK_DEV_INITRD=y
+CONFIG_INITRAMFS_SOURCE=""
+# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
+CONFIG_SYSCTL=y
+CONFIG_EMBEDDED=y
+CONFIG_SYSCTL_SYSCALL=y
+CONFIG_KALLSYMS=y
+CONFIG_KALLSYMS_ALL=y
+CONFIG_KALLSYMS_EXTRA_PASS=y
+CONFIG_HOTPLUG=y
+CONFIG_PRINTK=y
+CONFIG_BUG=y
+CONFIG_ELF_CORE=y
+CONFIG_BASE_FULL=y
+CONFIG_FUTEX=y
+CONFIG_ANON_INODES=y
+CONFIG_EPOLL=y
+CONFIG_SIGNALFD=y
+CONFIG_EVENTFD=y
+CONFIG_SHMEM=y
+CONFIG_VM_EVENT_COUNTERS=y
+CONFIG_SLAB=y
+# CONFIG_SLUB is not set
+# CONFIG_SLOB is not set
+CONFIG_RT_MUTEXES=y
+# CONFIG_TINY_SHMEM is not set
+CONFIG_BASE_SMALL=0
+CONFIG_MODULES=y
+CONFIG_MODULE_UNLOAD=y
+# CONFIG_MODULE_FORCE_UNLOAD is not set
+# CONFIG_MODVERSIONS is not set
+# CONFIG_MODULE_SRCVERSION_ALL is not set
+CONFIG_KMOD=y
+CONFIG_BLOCK=y
+CONFIG_LBD=y
+# CONFIG_BLK_DEV_IO_TRACE is not set
+# CONFIG_LSF is not set
+# CONFIG_BLK_DEV_BSG 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_MPC52xx is not set
+# CONFIG_PPC_MPC5200 is not set
+# CONFIG_PPC_CELL is not set
+# CONFIG_PPC_CELL_NATIVE is not set
+# CONFIG_PQ2ADS is not set
+CONFIG_KILAUEA=y
+# CONFIG_WALNUT is not set
+# CONFIG_XILINX_VIRTEX_GENERIC_BOARD is not set
+# CONFIG_MPIC is not set
+# CONFIG_MPIC_WEIRD is not set
+# CONFIG_PPC_I8259 is not set
+# CONFIG_PPC_RTAS is not set
+# CONFIG_MMIO_NVRAM is not set
+# CONFIG_PPC_MPC106 is not set
+# CONFIG_PPC_970_NAP is not set
+# CONFIG_PPC_INDIRECT_IO is not set
+# CONFIG_GENERIC_IOMAP is not set
+# CONFIG_CPU_FREQ is not set
+# CONFIG_CPM2 is not set
+# CONFIG_FSL_ULI1575 is not set
+
+#
+# Kernel options
+#
+# CONFIG_HIGHMEM is not set
+# CONFIG_TICK_ONESHOT is not set
+# CONFIG_NO_HZ is not set
+# CONFIG_HIGH_RES_TIMERS is not set
+# CONFIG_HZ_100 is not set
+CONFIG_HZ_250=y
+# CONFIG_HZ_300 is not set
+# 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_BINFMT_ELF=y
+# CONFIG_BINFMT_MISC is not set
+# CONFIG_MATH_EMULATION is not set
+CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
+CONFIG_ARCH_FLATMEM_ENABLE=y
+CONFIG_ARCH_POPULATES_NODE_MAP=y
+CONFIG_SELECT_MEMORY_MODEL=y
+CONFIG_FLATMEM_MANUAL=y
+# CONFIG_DISCONTIGMEM_MANUAL is not set
+# CONFIG_SPARSEMEM_MANUAL is not set
+CONFIG_FLATMEM=y
+CONFIG_FLAT_NODE_MEM_MAP=y
+# CONFIG_SPARSEMEM_STATIC is not set
+CONFIG_SPLIT_PTLOCK_CPUS=4
+CONFIG_RESOURCES_64BIT=y
+CONFIG_ZONE_DMA_FLAG=1
+CONFIG_BOUNCE=y
+CONFIG_VIRT_TO_BUS=y
+CONFIG_PROC_DEVICETREE=y
+# CONFIG_CMDLINE_BOOL is not set
+

[PATCH 2/4 v2] [POWERPC] Add AMCC Kilauea eval board support to platforms/40x

2007-10-11 Thread Stefan Roese
This patch adds basic support for the new 405EX and the AMCC eval board
Kilauea to arch/powerpc.

Signed-off-by: Stefan Roese <[EMAIL PROTECTED]>
---
 arch/powerpc/platforms/40x/Kconfig   |7 
 arch/powerpc/platforms/40x/Makefile  |5 ++-
 arch/powerpc/platforms/40x/kilauea.c |   58 ++
 3 files changed, 68 insertions(+), 2 deletions(-)
 create mode 100644 arch/powerpc/platforms/40x/kilauea.c

diff --git a/arch/powerpc/platforms/40x/Kconfig 
b/arch/powerpc/platforms/40x/Kconfig
index a0a50b1..47b3b0a 100644
--- a/arch/powerpc/platforms/40x/Kconfig
+++ b/arch/powerpc/platforms/40x/Kconfig
@@ -29,6 +29,13 @@
 #  help
 #This option enables support for the extra features of the EP405PC 
board.
 
+config KILAUEA
+   bool "Kilauea"
+   depends on 40x
+   default n
+   help
+ This option enables support for the AMCC PPC405EX evaluation board.
+
 #config REDWOOD_5
 #  bool "Redwood-5"
 #  depends on 40x
diff --git a/arch/powerpc/platforms/40x/Makefile 
b/arch/powerpc/platforms/40x/Makefile
index 0a3cfe9..51dadee 100644
--- a/arch/powerpc/platforms/40x/Makefile
+++ b/arch/powerpc/platforms/40x/Makefile
@@ -1,2 +1,3 @@
-obj-$(CONFIG_WALNUT) += walnut.o
-obj-$(CONFIG_XILINX_VIRTEX_GENERIC_BOARD) += virtex.o
+obj-$(CONFIG_KILAUEA)  += kilauea.o
+obj-$(CONFIG_WALNUT)   += walnut.o
+obj-$(CONFIG_XILINX_VIRTEX_GENERIC_BOARD)  += virtex.o
diff --git a/arch/powerpc/platforms/40x/kilauea.c 
b/arch/powerpc/platforms/40x/kilauea.c
new file mode 100644
index 000..1bffdbd
--- /dev/null
+++ b/arch/powerpc/platforms/40x/kilauea.c
@@ -0,0 +1,58 @@
+/*
+ * Kilauea board specific routines
+ *
+ * Copyright 2007 DENX Software Engineering, Stefan Roese <[EMAIL PROTECTED]>
+ *
+ * Based on the Walnut code by
+ * Josh Boyer <[EMAIL PROTECTED]>
+ * Copyright 2007 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 
+#include 
+#include 
+#include 
+#include 
+
+static struct of_device_id kilauea_of_bus[] = {
+   { .compatible = "ibm,plb4", },
+   { .compatible = "ibm,opb", },
+   { .compatible = "ibm,ebc", },
+   {},
+};
+
+static int __init kilauea_device_probe(void)
+{
+   if (!machine_is(kilauea))
+   return 0;
+
+   of_platform_bus_probe(NULL, kilauea_of_bus, NULL);
+
+   return 0;
+}
+device_initcall(kilauea_device_probe);
+
+static int __init kilauea_probe(void)
+{
+   unsigned long root = of_get_flat_dt_root();
+
+   if (!of_flat_dt_is_compatible(root, "amcc,kilauea"))
+   return 0;
+
+   return 1;
+}
+
+define_machine(kilauea) {
+   .name   = "Kilauea",
+   .probe  = kilauea_probe,
+   .progress   = udbg_progress,
+   .init_IRQ   = uic_init_tree,
+   .get_irq= uic_get_irq,
+   .calibrate_decr = generic_calibrate_decr,
+};
-- 
1.5.3.4

___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [PATCH 3/3] [POWERPC] Kilauea DTS

2007-10-11 Thread Josh Boyer
On Thu, 2007-10-11 at 14:02 +0200, Stefan Roese wrote:
> On Thursday 11 October 2007, Josh Boyer wrote:
> > On Thu, 2007-10-11 at 10:49 +0200, Stefan Roese wrote:
> > > > > + PowerPC,[EMAIL PROTECTED] {
> > > > > + device_type = "cpu";
> > > > > + reg = <0>;
> > > > > + clock-frequency = <0>; /* Filled in by U-Boot */
> > > >
> > > > Filled in by U-Boot itself?  Or by a cuboot wrapper? (which I can't
> > > > find in the patches.)
> > >
> > > By U-Boot itself. I have a U-Boot patch in the queue to add device tree
> > > support for 4xx. Therefor I don't plan adding a cuboot wrapper for
> > > Kilauea.
> >
> > Very cool!
> 
> You can take a look at the kilauea-405ex branch of my 4xx custodian 
> repository 
> for a latest development snapshort:
> 
> http://www.denx.de/cgi-bin/gitweb.cgi?p=u-boot/u-boot-ppc4xx.git;a=shortlog;h=kilauea-405ex

Ok, so how does the DTS file from the kernel get to U-Boot?  Since there
is no defconfig provided and no wrapper bits, I'm assuming this port
takes a raw uImage.  Is that correct?  If so, do you expect a separate
DTB file to be built for this that is passed to U-Boot?

josh

___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [PATCH 3/3] [POWERPC] Kilauea DTS

2007-10-11 Thread Stefan Roese
Hi Josh,

On Thursday 11 October 2007, Josh Boyer wrote:
> Ok, so how does the DTS file from the kernel get to U-Boot?  Since there
> is no defconfig provided and no wrapper bits, I'm assuming this port
> takes a raw uImage.  Is that correct?

Yes, correct.

> If so, do you expect a separate 
> DTB file to be built for this that is passed to U-Boot?

For booting on such a platform the "raw" uImage is needed plus the dtb file, 
generated from the dts file in arch/powerpc. At least that's how I'm doing 
it, and I'm still very new to this device tree stuff.

Best regards,
Stefan
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


[PATCH respin] ucc_geth: fix module removal

2007-10-11 Thread Anton Vorontsov
- uccf should be set to NULL to not double-free memory on
  subsequent calls;
- ind_hash_q and group_hash_q lists should be initialized in the
  probe() function, instead of struct_init() (called by open()),
  otherwise there will be an oops if ucc_geth_driver removed
  prior 'ifconfig ethX up';
- add unregister_netdev();
- reorder geth_remove() steps.

Signed-off-by: Anton Vorontsov <[EMAIL PROTECTED]>
---
 drivers/net/ucc_geth.c |   17 ++---
 1 files changed, 10 insertions(+), 7 deletions(-)

diff --git a/drivers/net/ucc_geth.c b/drivers/net/ucc_geth.c
index 7dedc96..18a6f48 100644
--- a/drivers/net/ucc_geth.c
+++ b/drivers/net/ucc_geth.c
@@ -2080,8 +2080,10 @@ static void ucc_geth_memclean(struct ucc_geth_private 
*ugeth)
if (!ugeth)
return;
 
-   if (ugeth->uccf)
+   if (ugeth->uccf) {
ucc_fast_free(ugeth->uccf);
+   ugeth->uccf = NULL;
+   }
 
if (ugeth->p_thread_data_tx) {
qe_muram_free(ugeth->thread_dat_tx_offset);
@@ -2312,10 +2314,6 @@ static int ucc_struct_init(struct ucc_geth_private 
*ugeth)
ug_info = ugeth->ug_info;
uf_info = &ug_info->uf_info;
 
-   /* Create CQs for hash tables */
-   INIT_LIST_HEAD(&ugeth->group_hash_q);
-   INIT_LIST_HEAD(&ugeth->ind_hash_q);
-
if (!((uf_info->bd_mem_part == MEM_PART_SYSTEM) ||
  (uf_info->bd_mem_part == MEM_PART_MURAM))) {
if (netif_msg_probe(ugeth))
@@ -3949,6 +3947,10 @@ static int ucc_geth_probe(struct of_device* ofdev, const 
struct of_device_id *ma
ugeth = netdev_priv(dev);
spin_lock_init(&ugeth->lock);
 
+   /* Create CQs for hash tables */
+   INIT_LIST_HEAD(&ugeth->group_hash_q);
+   INIT_LIST_HEAD(&ugeth->ind_hash_q);
+
dev_set_drvdata(device, dev);
 
/* Set the dev->base_addr to the gfar reg region */
@@ -4002,9 +4004,10 @@ static int ucc_geth_remove(struct of_device* ofdev)
struct net_device *dev = dev_get_drvdata(device);
struct ucc_geth_private *ugeth = netdev_priv(dev);
 
-   dev_set_drvdata(device, NULL);
-   ucc_geth_memclean(ugeth);
+   unregister_netdev(dev);
free_netdev(dev);
+   ucc_geth_memclean(ugeth);
+   dev_set_drvdata(device, NULL);
 
return 0;
 }
-- 
1.5.0.6

___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: powerpc commits for 2.6.24

2007-10-11 Thread Josh Boyer
On Thu, 2007-10-11 at 22:30 +1000, Paul Mackerras wrote:
> Below is the list of commits that I plan to ask Linus to pull
> tomorrow.  This is the last call for anything else or for objections
> to any of these commits going in.  These commits are in powerpc.git on
> the master and for-2.6.24 branches.

Hi Paul,

Could you pull from:

master.kernel.org/pub/scm/linux/kernel/git/jwboyer/powerpc-4xx.git for-2.6.24

to pick up some Xilinx changes from Grant?  I'm also hoping to get
Stefan's 405EX changes in soon.

josh

___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: powerpc commits for 2.6.24

2007-10-11 Thread Paul Mackerras
Kumar Gala writes:

> > Wolfgang Denk (1):
> >   [POWERPC] Disable vDSO support for ARCH=ppc where it's not  
> > implemented
> 
> Did I miss this getting posted to linuxppc-dev?

It was posted yesterday, so if you didn't see it, I guess you must
have missed it. :)

Paul.
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


[PATCH] ucc_geth: add support for netpoll

2007-10-11 Thread Anton Vorontsov
This patch adds netpoll support for the QE UCC Gigabit Ethernet
driver. The approach is very similar to the gianfar driver.

Tested using netconsole.

Signed-off-by: Anton Vorontsov <[EMAIL PROTECTED]>
---
 drivers/net/ucc_geth.c |   19 +++
 1 files changed, 19 insertions(+), 0 deletions(-)

diff --git a/drivers/net/ucc_geth.c b/drivers/net/ucc_geth.c
index 18a6f48..06807ce 100644
--- a/drivers/net/ucc_geth.c
+++ b/drivers/net/ucc_geth.c
@@ -3691,6 +3691,22 @@ static irqreturn_t ucc_geth_irq_handler(int irq, void 
*info)
return IRQ_HANDLED;
 }
 
+#ifdef CONFIG_NET_POLL_CONTROLLER
+/*
+ * Polling 'interrupt' - used by things like netconsole to send skbs
+ * without having to re-enable interrupts. It's not called while
+ * the interrupt routine is executing.
+ */
+static void ucc_netpoll(struct net_device *dev)
+{
+   struct ucc_geth_private *ugeth = netdev_priv(dev);
+
+   disable_irq(ugeth->ug_info->uf_info.irq);
+   ucc_geth_irq_handler(ugeth->ug_info->uf_info.irq, dev);
+   enable_irq(ugeth->ug_info->uf_info.irq);
+}
+#endif /* CONFIG_NET_POLL_CONTROLLER */
+
 /* Called when something needs to use the ethernet device */
 /* Returns 0 for success. */
 static int ucc_geth_open(struct net_device *dev)
@@ -3969,6 +3985,9 @@ static int ucc_geth_probe(struct of_device* ofdev, const 
struct of_device_id *ma
dev->poll = ucc_geth_poll;
dev->weight = UCC_GETH_DEV_WEIGHT;
 #endif /* CONFIG_UGETH_NAPI */
+#ifdef CONFIG_NET_POLL_CONTROLLER
+   dev->poll_controller = ucc_netpoll;
+#endif
dev->stop = ucc_geth_close;
dev->get_stats = ucc_geth_get_stats;
 //dev->change_mtu = ucc_geth_change_mtu;
-- 
1.5.0.6

___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [patch 1/2] Replace NT_PRXFPREG with ELF_CORE_XFPREG_TYPE #define

2007-10-11 Thread Kumar Gala

On Oct 11, 2007, at 2:15 AM, [EMAIL PROTECTED] wrote:

> Replace NT_PRXFPREG with ELF_CORE_XFPREG_TYPE in the coredump code  
> which
> allows for more flexibility in the note type for the state of  
> 'extended
> floating point' implementations in coredumps. New note types can  
> now be
> added with an appropriate #define.
>
> #define ELF_CORE_XFPREG_TYPE to be NT_PRXFPREG in all current users so
> there's are no change in behaviour.

Can we make this ELF_CORE_VECREG_TYPE or something that is so coupled  
to the x86 specific name?

>
> Signed-off-by: Mark Nelson <[EMAIL PROTECTED]>
> ---
>  arch/ia64/ia32/elfcore32.h |1 +
>  arch/x86_64/ia32/ia32_binfmt.c |1 +
>  fs/binfmt_elf.c|4 ++--
>  include/asm-i386/elf.h |1 +
>  4 files changed, 5 insertions(+), 2 deletions(-)
>
> Index: linux/arch/ia64/ia32/elfcore32.h
> ===
> --- linux.orig/arch/ia64/ia32/elfcore32.h
> +++ linux/arch/ia64/ia32/elfcore32.h
> @@ -117,6 +117,7 @@ elf_core_copy_task_fpregs(struct task_st
>  }
>
>  #define ELF_CORE_COPY_XFPREGS 1
> +#define ELF_CORE_XFPREG_TYPE NT_PRXFPREG
>  static inline int
>  elf_core_copy_task_xfpregs(struct task_struct *tsk,  
> elf_fpxregset_t *xfpu)
>  {
> Index: linux/arch/x86_64/ia32/ia32_binfmt.c
> ===
> --- linux.orig/arch/x86_64/ia32/ia32_binfmt.c
> +++ linux/arch/x86_64/ia32/ia32_binfmt.c
> @@ -188,6 +188,7 @@ elf_core_copy_task_fpregs(struct task_st
>  }
>
>  #define ELF_CORE_COPY_XFPREGS 1
> +#define ELF_CORE_XFPREG_TYPE NT_PRXFPREG
>  static inline int
>  elf_core_copy_task_xfpregs(struct task_struct *t, elf_fpxregset_t  
> *xfpu)
>  {
> Index: linux/fs/binfmt_elf.c
> ===
> --- linux.orig/fs/binfmt_elf.c
> +++ linux/fs/binfmt_elf.c
> @@ -1446,8 +1446,8 @@ static int elf_dump_thread_status(long s
>
>  #ifdef ELF_CORE_COPY_XFPREGS
>   if (elf_core_copy_task_xfpregs(p, &t->xfpu)) {
> - fill_note(&t->notes[2], "LINUX", NT_PRXFPREG, sizeof(t->xfpu),
> -   &t->xfpu);
> + fill_note(&t->notes[2], "LINUX", ELF_CORE_XFPREG_TYPE,
> +   sizeof(t->xfpu), &t->xfpu);
>   t->num_notes++;
>   sz += notesize(&t->notes[2]);
>   }

You've only fixed up one of 4 NT_PRXFPREG uses in the kernel.

Also, I'm not a fan of your proposed mechanism to "overload" the  
elf_fpxregset_t.  I'd rather see us introduce a new elf_vecregset_t  
and have it typedef'd to be elf_fpxregset_t on i386, x86_64, ia64

> Index: linux/include/asm-i386/elf.h
> ===
> --- linux.orig/include/asm-i386/elf.h
> +++ linux/include/asm-i386/elf.h
> @@ -129,6 +129,7 @@ extern int dump_task_extended_fpu (struc
>  #define ELF_CORE_COPY_TASK_REGS(tsk, elf_regs) dump_task_regs(tsk,  
> elf_regs)
>  #define ELF_CORE_COPY_FPREGS(tsk, elf_fpregs) dump_task_fpu(tsk,  
> elf_fpregs)
>  #define ELF_CORE_COPY_XFPREGS(tsk, elf_xfpregs)  
> dump_task_extended_fpu(tsk, elf_xfpregs)
> +#define ELF_CORE_XFPREG_TYPE NT_PRXFPREG
>
>  #define VDSO_HIGH_BASE   (__fix_to_virt(FIX_VDSO))
>  #define VDSO_CURRENT_BASE((unsigned long)current->mm->context.vdso)
>
> -- 
> ___
> Linuxppc-dev mailing list
> Linuxppc-dev@ozlabs.org
> https://ozlabs.org/mailman/listinfo/linuxppc-dev

___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [PATCH 4/4 v2] [POWERPC] Kilauea defconfig file

2007-10-11 Thread Josh Boyer
On Thu, 2007-10-11 at 14:08 +0200, Stefan Roese wrote:
> Signed-off-by: Stefan Roese <[EMAIL PROTECTED]>
> +# CONFIG_MATH_EMULATION is not set

Does the 405EX have an FPU?  If not, do you want this set by default so
floating point instructions work?

> +CONFIG_RESOURCES_64BIT=y

I'm not sure about that one.  I see walnut has the same thing for some
reason, but is it really needed?

> +CONFIG_WANT_DEVICE_TREE=y
> +CONFIG_DEVICE_TREE="walnut.dts"

That looks wrong.  Should be selecting the Kilauea dts

josh

___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: powerpc commits for 2.6.24

2007-10-11 Thread Kumar Gala

On Oct 11, 2007, at 7:30 AM, Paul Mackerras wrote:

> Below is the list of commits that I plan to ask Linus to pull
> tomorrow.  This is the last call for anything else or for objections
> to any of these commits going in.  These commits are in powerpc.git on
> the master and for-2.6.24 branches.

I'm debugging one issue with MPC8560 that should get fixed today with  
a new pull request after I find the issue.

Just to clarify, are we closing 2.6.24 for new code after you send  
Linus a pull request or are we still taking things during the two  
week merge window?

- k
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: powerpc commits for 2.6.24

2007-10-11 Thread Kumar Gala
> Benjamin Herrenschmidt (3):
>   [POWERPC] Fix platinumfb framebuffer
>   [POWERPC] cell: Move cbe_regs.h to include/asm-powerpc/cell- 
> regs.h
>   [POWERPC] cell: Add Cell memory controller register defs and  
> expose it

Ben, your slacking :)

> Wolfgang Denk (1):
>   [POWERPC] Disable vDSO support for ARCH=ppc where it's not  
> implemented

Did I miss this getting posted to linuxppc-dev?

- k



___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [PATCH 4/4 v2] [POWERPC] Kilauea defconfig file

2007-10-11 Thread Stefan Roese
On Thursday 11 October 2007, Josh Boyer wrote:
> On Thu, 2007-10-11 at 14:08 +0200, Stefan Roese wrote:
> > Signed-off-by: Stefan Roese <[EMAIL PROTECTED]>
> > +# CONFIG_MATH_EMULATION is not set
>
> Does the 405EX have an FPU?

No.

> If not, do you want this set by default so 
> floating point instructions work?

I just checked some existing arch/ppc defconfig files (and arch/powerpc too). 
Most if not all have MATH_EMULATION not set. Even on those PPC's without FPU. 
I assume we see no problems since soft-float is used while compiling.

Anyways, I'll change this and resubmit.

> > +CONFIG_RESOURCES_64BIT=y
>
> I'm not sure about that one.  I see walnut has the same thing for some
> reason, but is it really needed?

No, I don't think it is needed. As all 405 PPC's, the 405EX is 32bit only. 
I'll change this too.

> > +CONFIG_WANT_DEVICE_TREE=y
> > +CONFIG_DEVICE_TREE="walnut.dts"
>
> That looks wrong.  Should be selecting the Kilauea dts

Yes, good catch. Since I'm not using the bootwrapper, I should be able to get 
rid of WANT_DEVICE_TREE too. But it seems to be autoselected in 
arch/powerpc/platforms/Kconfig.cputype for 40x and most other "embedded" 
CPU's. Any idea why this is the case?

Thanks.

Best regards,
Stefan
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: powerpc commits for 2.6.24

2007-10-11 Thread Kumar Gala

On Oct 11, 2007, at 7:53 AM, Paul Mackerras wrote:

> Kumar Gala writes:
>
>>> Wolfgang Denk (1):
>>>   [POWERPC] Disable vDSO support for ARCH=ppc where it's not
>>> implemented
>>
>> Did I miss this getting posted to linuxppc-dev?
>
> It was posted yesterday, so if you didn't see it, I guess you must
> have missed it. :)

found it.

- k
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [PATCH] Make clockevents work on PPC601 processors

2007-10-11 Thread Kumar Gala

On Oct 11, 2007, at 6:46 AM, Paul Mackerras wrote:

> In testing the new clocksource and clockevent code on a PPC601
> processor, I discovered that the clockevent multiplier value for the
> decrementer clockevent was overflowing.  Because the RTCL register in
> the 601 effectively counts at 1GHz (it doesn't actually, but it
> increases by 128 every 128ns), and the shift value was 32, that meant
> the multiplier value had to be 2^32, which won't fit in an unsigned
> long on 32-bit.  The same problem would arise on any platform where
> the timebase frequency was 1GHz or more (not that we actually have any
> such machines today).

do you still have a 601 running somewhere?

- k
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: powerpc commits for 2.6.24

2007-10-11 Thread Grant Likely
On 10/11/07, Kumar Gala <[EMAIL PROTECTED]> wrote:
>
> Just to clarify, are we closing 2.6.24 for new code after you send
> Linus a pull request or are we still taking things during the two
> week merge window?

And as a follow-on question; if you are closing for new code, will you
still accept patches for documentation/defconfigs/device trees?

Cheers,
g.

-- 
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.
[EMAIL PROTECTED]
(403) 399-0195
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Please pull from 'for-2.6.24' branch

2007-10-11 Thread Kumar Gala
Please pull from 'for-2.6.24' branch of

master.kernel.org:/pub/scm/linux/kernel/git/galak/powerpc.git for-2.6.24

to receive the following updates:

 arch/powerpc/boot/dts/mpc8272ads.dts   |2
 arch/powerpc/boot/dts/mpc8541cds.dts   |   36 ++
 arch/powerpc/boot/dts/mpc8555cds.dts   |   36 ++
 arch/powerpc/boot/dts/mpc8560ads.dts   |   82 +++---
 arch/powerpc/configs/mpc8560_ads_defconfig |   23 +++
 arch/powerpc/platforms/85xx/Kconfig|1
 arch/powerpc/platforms/85xx/mpc8540_ads.h  |   35 --
 arch/powerpc/platforms/85xx/mpc85xx_ads.c  |  168 +++--
 arch/powerpc/platforms/85xx/mpc85xx_ads.h  |   60 --
 arch/powerpc/platforms/85xx/mpc85xx_cds.c  |   10 +
 arch/powerpc/platforms/85xx/mpc85xx_cds.h  |   43 ---
 arch/powerpc/platforms/85xx/mpc85xx_ds.c   |1
 arch/powerpc/platforms/85xx/mpc85xx_mds.c  |1
 include/asm-powerpc/cpm2.h |4
 include/asm-powerpc/fs_pd.h|2
 include/asm-powerpc/mpc85xx.h  |   45 ---
 16 files changed, 238 insertions(+), 311 deletions(-)

Kumar Gala (2):
  [POWERPC] 85xx: Killed 
  [POWERPC] 85xx: Enable FP emulation in MPC8560 ADS defconfig

Scott Wood (3):
  [POWERPC] mpc8272ads: Remove muram from the CPM reg property.
  [POWERPC] 85xx: Convert mpc8560ads to the new CPM binding.
  [POWERPC] 85xx: Add cpm nodes for 8541/8555 CDS

___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


[PATCH] [POWERPC] 85xx: Enable FP emulation in MPC8560 ADS defconfig

2007-10-11 Thread Kumar Gala
---
 arch/powerpc/configs/mpc8560_ads_defconfig |   23 ++-
 1 files changed, 18 insertions(+), 5 deletions(-)

diff --git a/arch/powerpc/configs/mpc8560_ads_defconfig 
b/arch/powerpc/configs/mpc8560_ads_defconfig
index 0fb54c7..3d68c65 100644
--- a/arch/powerpc/configs/mpc8560_ads_defconfig
+++ b/arch/powerpc/configs/mpc8560_ads_defconfig
@@ -1,7 +1,7 @@
 #
 # Automatically generated make config: don't edit
-# Linux kernel version: 2.6.23-rc4
-# Tue Aug 28 21:24:43 2007
+# Linux kernel version: 2.6.23-rc9
+# Thu Oct 11 09:16:32 2007
 #
 # CONFIG_PPC64 is not set

@@ -22,8 +22,13 @@ CONFIG_FSL_BOOKE=y
 CONFIG_SPE=y
 # CONFIG_PPC_MM_SLICES is not set
 CONFIG_PPC32=y
+CONFIG_WORD_SIZE=32
 CONFIG_PPC_MERGE=y
 CONFIG_MMU=y
+CONFIG_GENERIC_CMOS_UPDATE=y
+CONFIG_GENERIC_TIME=y
+CONFIG_GENERIC_TIME_VSYSCALL=y
+CONFIG_GENERIC_CLOCKEVENTS=y
 CONFIG_GENERIC_HARDIRQS=y
 CONFIG_IRQ_PER_CPU=y
 CONFIG_RWSEM_XCHGADD_ALGORITHM=y
@@ -86,7 +91,6 @@ CONFIG_FUTEX=y
 CONFIG_ANON_INODES=y
 CONFIG_EPOLL=y
 CONFIG_SIGNALFD=y
-CONFIG_TIMERFD=y
 CONFIG_EVENTFD=y
 CONFIG_SHMEM=y
 CONFIG_VM_EVENT_COUNTERS=y
@@ -128,7 +132,7 @@ CONFIG_DEFAULT_IOSCHED="anticipatory"
 CONFIG_MPC8560_ADS=y
 # CONFIG_MPC85xx_CDS is not set
 # CONFIG_MPC85xx_MDS is not set
-# CONFIG_MPC8544_DS is not set
+# CONFIG_MPC85xx_DS is not set
 CONFIG_MPC8560=y
 CONFIG_MPC85xx=y
 CONFIG_MPIC=y
@@ -142,12 +146,17 @@ CONFIG_MPIC=y
 # CONFIG_GENERIC_IOMAP is not set
 # CONFIG_CPU_FREQ is not set
 CONFIG_CPM2=y
+CONFIG_PPC_CPM_NEW_BINDING=y
 # CONFIG_FSL_ULI1575 is not set
+CONFIG_CPM=y

 #
 # Kernel options
 #
 # CONFIG_HIGHMEM is not set
+# CONFIG_TICK_ONESHOT is not set
+# CONFIG_NO_HZ is not set
+# CONFIG_HIGH_RES_TIMERS is not set
 # CONFIG_HZ_100 is not set
 CONFIG_HZ_250=y
 # CONFIG_HZ_300 is not set
@@ -158,7 +167,7 @@ CONFIG_PREEMPT_NONE=y
 # CONFIG_PREEMPT is not set
 CONFIG_BINFMT_ELF=y
 CONFIG_BINFMT_MISC=y
-# CONFIG_MATH_EMULATION is not set
+CONFIG_MATH_EMULATION=y
 CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
 CONFIG_ARCH_FLATMEM_ENABLE=y
 CONFIG_ARCH_POPULATES_NODE_MAP=y
@@ -177,6 +186,8 @@ CONFIG_VIRT_TO_BUS=y
 # CONFIG_PROC_DEVICETREE is not set
 # CONFIG_CMDLINE_BOOL is not set
 # CONFIG_PM is not set
+CONFIG_SUSPEND_UP_POSSIBLE=y
+CONFIG_HIBERNATION_UP_POSSIBLE=y
 # CONFIG_SECCOMP is not set
 CONFIG_WANT_DEVICE_TREE=y
 CONFIG_DEVICE_TREE=""
@@ -415,6 +426,7 @@ CONFIG_E1000_NAPI=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 is not set
 # CONFIG_BNX2 is not set
@@ -807,3 +819,4 @@ CONFIG_FORCED_INLINING=y
 # CONFIG_KEYS is not set
 # CONFIG_SECURITY is not set
 # CONFIG_CRYPTO is not set
+# CONFIG_PPC_CLOCK is not set
-- 
1.5.2.4

___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


[PATCH v2] [POWERPC] 85xx: Killed

2007-10-11 Thread Kumar Gala
asm-powerpc/mpc85xx.h was really a hold over from arch/ppc.  Now that
more decoupling has occurred we can remove  and some of
its legacy.

As part of this we moved the definition of CPM_MAP_ADDR into cpm2.h
for 85xx platforms.  This is a stop gap until drivers stop using
CPM_MAP_ADDR.

---

Feels good to remove code :)

 arch/powerpc/platforms/85xx/mpc8540_ads.h |   35 -
 arch/powerpc/platforms/85xx/mpc85xx_ads.c |1 -
 arch/powerpc/platforms/85xx/mpc85xx_ads.h |   60 -
 arch/powerpc/platforms/85xx/mpc85xx_cds.c |   10 -
 arch/powerpc/platforms/85xx/mpc85xx_cds.h |   43 
 arch/powerpc/platforms/85xx/mpc85xx_ds.c  |1 -
 arch/powerpc/platforms/85xx/mpc85xx_mds.c |1 -
 include/asm-powerpc/cpm2.h|4 ++
 include/asm-powerpc/fs_pd.h   |2 -
 include/asm-powerpc/mpc85xx.h |   45 -
 10 files changed, 13 insertions(+), 189 deletions(-)
 delete mode 100644 arch/powerpc/platforms/85xx/mpc8540_ads.h
 delete mode 100644 arch/powerpc/platforms/85xx/mpc85xx_ads.h
 delete mode 100644 arch/powerpc/platforms/85xx/mpc85xx_cds.h
 delete mode 100644 include/asm-powerpc/mpc85xx.h

diff --git a/arch/powerpc/platforms/85xx/mpc8540_ads.h 
b/arch/powerpc/platforms/85xx/mpc8540_ads.h
deleted file mode 100644
index da82f4c..000
--- a/arch/powerpc/platforms/85xx/mpc8540_ads.h
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * arch/powerpc/platforms/85xx/mpc8540_ads.h
- *
- * MPC8540ADS board definitions
- *
- * Maintainer: Kumar Gala <[EMAIL PROTECTED]>
- *
- * Copyright 2004 Freescale Semiconductor Inc.
- *
- * This program is free software; you can redistribute  it and/or modify it
- * under  the terms of  the GNU General  Public License as published by the
- * Free Software Foundation;  either version 2 of the  License, or (at your
- * option) any later version.
- *
- */
-
-#ifndef __MACH_MPC8540ADS_H__
-#define __MACH_MPC8540ADS_H__
-
-#include 
-
-#define BOARD_CCSRBAR  ((uint)0xe000)
-#define BCSR_ADDR  ((uint)0xf800)
-#define BCSR_SIZE  ((uint)(32 * 1024))
-
-/* PCI interrupt controller */
-#define PIRQA  MPC85xx_IRQ_EXT1
-#define PIRQB  MPC85xx_IRQ_EXT2
-#define PIRQC  MPC85xx_IRQ_EXT3
-#define PIRQD  MPC85xx_IRQ_EXT4
-
-/* Offset of CPM register space */
-#define CPM_MAP_ADDR   (CCSRBAR + MPC85xx_CPM_OFFSET)
-
-#endif /* __MACH_MPC8540ADS_H__ */
diff --git a/arch/powerpc/platforms/85xx/mpc85xx_ads.c 
b/arch/powerpc/platforms/85xx/mpc85xx_ads.c
index 509d46b..bccdc25 100644
--- a/arch/powerpc/platforms/85xx/mpc85xx_ads.c
+++ b/arch/powerpc/platforms/85xx/mpc85xx_ads.c
@@ -23,7 +23,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
diff --git a/arch/powerpc/platforms/85xx/mpc85xx_ads.h 
b/arch/powerpc/platforms/85xx/mpc85xx_ads.h
deleted file mode 100644
index 46c3532..000
--- a/arch/powerpc/platforms/85xx/mpc85xx_ads.h
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * MPC85xx ADS board definitions
- *
- * Maintainer: Kumar Gala <[EMAIL PROTECTED]>
- *
- * Copyright 2004 Freescale Semiconductor Inc.
- *
- * 2006 (c) MontaVista Software, Inc.
- * Vitaly Bordug <[EMAIL PROTECTED]>
- *
- * 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 __MACH_MPC85XXADS_H
-#define __MACH_MPC85XXADS_H
-
-#include 
-#include 
-
-#define BCSR_ADDR  ((uint)0xf800)
-#define BCSR_SIZE  ((uint)(32 * 1024))
-
-#ifdef CONFIG_CPM2
-
-#define MPC85xx_CPM_OFFSET (0x8)
-
-#define CPM_MAP_ADDR   (get_immrbase() + MPC85xx_CPM_OFFSET)
-#define CPM_IRQ_OFFSET 60
-
-#define SIU_INT_SMC1   ((uint)0x04+CPM_IRQ_OFFSET)
-#define SIU_INT_SMC2   ((uint)0x05+CPM_IRQ_OFFSET)
-#define SIU_INT_SCC1   ((uint)0x28+CPM_IRQ_OFFSET)
-#define SIU_INT_SCC2   ((uint)0x29+CPM_IRQ_OFFSET)
-#define SIU_INT_SCC3   ((uint)0x2a+CPM_IRQ_OFFSET)
-#define SIU_INT_SCC4   ((uint)0x2b+CPM_IRQ_OFFSET)
-
-/* FCC1 Clock Source Configuration.  These can be
- * redefined in the board specific file.
- *Can only choose from CLK9-12 */
-#define F1_RXCLK   12
-#define F1_TXCLK   11
-
-/* FCC2 Clock Source Configuration.  These can be
- * redefined in the board specific file.
- *Can only choose from CLK13-16 */
-#define F2_RXCLK   13
-#define F2_TXCLK   14
-
-/* FCC3 Clock Source Configuration.  These can be
- * redefined in the board specific file.
- *Can only choose from CLK13-16 */
-#define F3_RXCLK   15
-#define F3_TXCLK   16
-
-#endif /* CONFIG_CPM2 */
-#endif /* __MACH_MPC85XXADS_H */
diff --git a/arch/powerpc/platforms/85xx/mpc85xx_cds.c 
b/arch/powerpc/platforms/85xx/mpc85xx_cds.c
ind

Re: powerpc commits for 2.6.24

2007-10-11 Thread Grant Likely
On 10/11/07, Paul Mackerras <[EMAIL PROTECTED]> wrote:
> Below is the list of commits that I plan to ask Linus to pull
> tomorrow.  This is the last call for anything else or for objections
> to any of these commits going in.  These commits are in powerpc.git on
> the master and for-2.6.24 branches.
>

How about these 4?  Do you want to pull them directly, or would you
rather me repost them to the list?

are available in the git repository at:

 git://git.secretlab.ca/git/linux-2.6-mpc52xx.git for-2.6.24

Grant Likely (4):
 [POWERPC] MPC52xx: Drop show_cpuinfo platform hooks from Lite5200
 [POWERPC] MPC52xx: Trim includes on mpc5200 platform support code
 [POWERPC] MPC5200: Don't make firmware fixups into common code
 [POWERPC] Add co-maintainer for PowerPC MPC52xx platform

-- 
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.
[EMAIL PROTECTED]
(403) 399-0195
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Warning: "isa_io_base" [/home/oliu/pmm-mpc-k26-6437/pmm.ko] undefined!

2007-10-11 Thread Oliver Liu
Hi,
   
  When i compile my device driver for kernel2.6, i got a warning as followng:
  Warning: "isa_io_base" [/home/oliu/pmm-mpc-k26-6437/pmm.ko] undefined! 
   
  When i insmod pmm.ko, i got the message as following:
  # insmod pmm.ko
pmm: Unknown symbol isa_io_base
insmod: cannot insert `pmm.ko': Unknown symbol in module (-1): No such file or 
directory
# 
   
  I am sure the symbol "isa_io_base" is not come from my driver source code. 
Has anybody  ever met this problem before?
   
  Regards,
  Oliver

   
-
Be a better Heartthrob. Get better relationship answers from someone who knows.
Yahoo! Answers - Check it out. ___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev

[PATCH] PowerPC: Fix find_legacy_serial_ports on OPB.

2007-10-11 Thread Valentine Barshak
Currently find_legacy_serial_ports() can find no serial ports on the OPB.
Thus no legacy boot console can be initialized. Just the early udbg console
works, which is initialized with udbg_init_44x_as1() on the UART's physical
address specified in kernel config. This happens because we look for ns16750
and higher serial devices only and expect opb node to have a device type
property. This patch makes it look for ns16550 compatible devices and use
of_device_is_compatible() for opb instead of checking device type.
Lack of legacy serial ports found causes problems for KGDB over serial.

Signed-off-by: Valentine Barshak <[EMAIL PROTECTED]>
---
 arch/powerpc/kernel/legacy_serial.c |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff -pruN linux-2.6.orig/arch/powerpc/kernel/legacy_serial.c 
linux-2.6/arch/powerpc/kernel/legacy_serial.c
--- linux-2.6.orig/arch/powerpc/kernel/legacy_serial.c  2007-10-11 
17:12:09.0 +0400
+++ linux-2.6/arch/powerpc/kernel/legacy_serial.c   2007-10-11 
17:40:11.0 +0400
@@ -340,9 +340,9 @@ void __init find_legacy_serial_ports(voi
}
 
/* First fill our array with opb bus ports */
-   for (np = NULL; (np = of_find_compatible_node(np, "serial", "ns16750")) 
!= NULL;) {
+   for (np = NULL; (np = of_find_compatible_node(np, "serial", "ns16550")) 
!= NULL;) {
struct device_node *opb = of_get_parent(np);
-   if (opb && !strcmp(opb->type, "opb")) {
+   if (opb && of_device_is_compatible(opb, "ibm,opb")) {
index = add_legacy_soc_port(np, np);
if (index >= 0 && np == stdout)
legacy_serial_console = index;
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: powerpc commits for 2.6.24

2007-10-11 Thread Timur Tabi
Kumar Gala wrote:

> Just to clarify, are we closing 2.6.24 for new code after you send  
> Linus a pull request or are we still taking things during the two  
> week merge window?

I certainly hope the window isn't closed!  I need another week to get my UART 
driver in.

-- 
Timur Tabi
Linux Kernel Developer @ Freescale
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [PATCH] PowerPC: Fix find_legacy_serial_ports on OPB.

2007-10-11 Thread Arnd Bergmann
On Thursday 11 October 2007, Valentine Barshak wrote:
> Currently find_legacy_serial_ports() can find no serial ports on the OPB.
> Thus no legacy boot console can be initialized. Just the early udbg console
> works, which is initialized with udbg_init_44x_as1() on the UART's physical
> address specified in kernel config. This happens because we look for ns16750
> and higher serial devices only and expect opb node to have a device type
> property. This patch makes it look for ns16550 compatible devices and use
> of_device_is_compatible() for opb instead of checking device type.
> Lack of legacy serial ports found causes problems for KGDB over serial.
> 
> Signed-off-by: Valentine Barshak <[EMAIL PROTECTED]>

The patch would make sense if we were only dealing with flattened device
tree systems at this point. Unfortunately, IBM is shipping hardware that
encodes the serial port in exactly the way that find_legacy_serial_ports
is looking for (parent->type == "opb", compatible = "ns16750" "ns16550"
"ns16450" i8250").

Changing the search for ns16750 to ns16550 should be fine, but unnecessary
because AFAIK, all OPB serial imlpementations are actually ns16750 and
should have that in the device tree as well.

For the device type of the bus, please check for both compatible and
type, so that it still works on machines that are missing the compatible
property.

Arnd <><
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [PATCH 4/4 v2] [POWERPC] Kilauea defconfig file

2007-10-11 Thread Wolfgang Denk
Hallo Stefan,

In message <[EMAIL PROTECTED]> you wrote:
> 
> > If not, do you want this set by default so 
> > floating point instructions work?

No, we use soft-float on all such systems which is much faster.

> I just checked some existing arch/ppc defconfig files (and arch/powerpc too). 
> Most if not all have MATH_EMULATION not set. Even on those PPC's without FPU. 
> I assume we see no problems since soft-float is used while compiling.
> 
> Anyways, I'll change this and resubmit.

No, please leave as is.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: [EMAIL PROTECTED]
Be kind to unkind people - they need it the most.
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [PATCH v2] powerpc: don't enable cpu hotplug on mpic-based pseries

2007-10-11 Thread Milton Miller
On Oct 10, 2007, at 11:43 AM, Olof Johansson wrote:
> On Wed, Oct 10, 2007 at 05:08:44AM -0500, Milton Miller wrote:
>> Olof's patch searched the device-tree again, looking for an mpic.   
>> This
>> code instead checks that we found an xics the first time by checking 
>> the
>> init function.
>
> I'm glad you find the kernel so perfect that your best use of time is
> to tweak the code added in a non-critical path (performance-wise) with
> a new way of checking for hardware features (no other code in the 
> kernel
> checks ppc_md function pointers for that purpose).

I never argued performance, I posted because !mpic != !!xics.  The 
tweak of not searching again was about avoiding code duplication.  I 
considered moving the call from an init function to an explicit call 
when we find it like the smp and kexec hooks are handled.   It would 
reorder the notifier registration (from arch_initcall to setup_arch) 
which would require additional testing.

> Pseries can only have mpic or xics, so it's not like it matters if we
> check for mpic or !xics, either.

Actually, in my work with simulators, sometimes I use neither, so the 
check is not equivalent.  We recently changed the call to 
ppc_md.init_IRQ to allow this.

> But hey, any color bike shed will do, and I don't care which one Paul
> chooses to merge. I will not waste more time debating this simple patch
> though. :)
>
> -Olof

milton

___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [PATCH] PowerPC: Fix find_legacy_serial_ports on OPB.

2007-10-11 Thread Josh Boyer
On Thu, 2007-10-11 at 17:50 +0200, Arnd Bergmann wrote:
> On Thursday 11 October 2007, Valentine Barshak wrote:
> > Currently find_legacy_serial_ports() can find no serial ports on the OPB.
> > Thus no legacy boot console can be initialized. Just the early udbg console
> > works, which is initialized with udbg_init_44x_as1() on the UART's physical
> > address specified in kernel config. This happens because we look for ns16750
> > and higher serial devices only and expect opb node to have a device type
> > property. This patch makes it look for ns16550 compatible devices and use
> > of_device_is_compatible() for opb instead of checking device type.
> > Lack of legacy serial ports found causes problems for KGDB over serial.
> > 
> > Signed-off-by: Valentine Barshak <[EMAIL PROTECTED]>
> 
> The patch would make sense if we were only dealing with flattened device
> tree systems at this point. Unfortunately, IBM is shipping hardware that
> encodes the serial port in exactly the way that find_legacy_serial_ports
> is looking for (parent->type == "opb", compatible = "ns16750" "ns16550"
> "ns16450" i8250").
> 
> Changing the search for ns16750 to ns16550 should be fine, but unnecessary
> because AFAIK, all OPB serial imlpementations are actually ns16750 and
> should have that in the device tree as well.
> 
> For the device type of the bus, please check for both compatible and
> type, so that it still works on machines that are missing the compatible
> property.

Wait, no.  We already had this discussion months ago when David was
working on the original Ebony port.  It was declared that legacy_serial
is not how serial should be done on 4xx and the serial_of driver was
supposed to be used instead.

Have we changed our stance on that?  If not, then perhaps KGDB should be
fixed to work with serial_of.

josh

___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [PATCH v4 or so] Use 1TB segments

2007-10-11 Thread Linas Vepstas
On Thu, Oct 11, 2007 at 08:37:10PM +1000, Paul Mackerras wrote:
> This makes the kernel use 1TB segments for all kernel mappings and for
> user addresses of 1TB and above, on machines which support them
> (currently POWER5+, POWER6 and PA6T).

Gack. A system dump might take a while on these machines ... 

--linas
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [PATCH 4/4 v2] [POWERPC] Kilauea defconfig file

2007-10-11 Thread Josh Boyer
On Thu, 2007-10-11 at 17:37 +0200, Wolfgang Denk wrote:
> Hallo Stefan,
> 
> In message <[EMAIL PROTECTED]> you wrote:
> > 
> > > If not, do you want this set by default so 
> > > floating point instructions work?
> 
> No, we use soft-float on all such systems which is much faster.
> 
> > I just checked some existing arch/ppc defconfig files (and arch/powerpc 
> > too). 
> > Most if not all have MATH_EMULATION not set. Even on those PPC's without 
> > FPU. 
> > I assume we see no problems since soft-float is used while compiling.
> > 
> > Anyways, I'll change this and resubmit.
> 
> No, please leave as is.

It's fine either way with me.  It was just a question since not all
distributions compile with soft-float.

josh

___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: powerpc commits for 2.6.24

2007-10-11 Thread Olof Johansson
On Thu, Oct 11, 2007 at 10:30:05PM +1000, Paul Mackerras wrote:
> Below is the list of commits that I plan to ask Linus to pull
> tomorrow.  This is the last call for anything else or for objections
> to any of these commits going in.  These commits are in powerpc.git on
> the master and for-2.6.24 branches.

What about:

[PATCH v2] powerpc: Implement logging of unhandled signals


Thanks,

-Olof
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: powerpc commits for 2.6.24

2007-10-11 Thread Arnd Bergmann
On Thursday 11 October 2007, Timur Tabi wrote:
> 
> Kumar Gala wrote:
> 
> > Just to clarify, are we closing 2.6.24 for new code after you send  
> > Linus a pull request or are we still taking things during the two  
> > week merge window?
> 
> I certainly hope the window isn't closed!  I need another week to get my UART 
> driver in.

Officially, the time for submissions to paulus is now over and you should
not be working on code for the open merge window any more. I'm saying this
as someone who's normally one of the worst offenders of this rule and
I do feel guilty about it.

There is always stuff that goes in late in the merge window, so not all
is lost for you, but you should be aware that what you are doing is wrong
and you will be subject to public shaming on #mklinux when you try ;-)

Arnd <><
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


[PATCH 2/2] powerpc: Switch to generic WARN_ON()/BUG_ON()

2007-10-11 Thread Olof Johansson
Not using the ppc-specific WARN_ON/BUG_ON constructs actually saves about
4K text on a ppc64_defconfig. The main reason seems to be that prepping
the arguments to the conditional trap instructions is more work than
just doing a compare and branch.

Signed-off-by: Olof Johansson <[EMAIL PROTECTED]>

diff --git a/include/asm-powerpc/bug.h b/include/asm-powerpc/bug.h
index 02e171c..966de9b 100644
--- a/include/asm-powerpc/bug.h
+++ b/include/asm-powerpc/bug.h
@@ -54,12 +54,6 @@
".previous\n"
 #endif
 
-/*
- * BUG_ON() and WARN_ON() do their best to cooperate with compile-time
- * optimisations. However depending on the complexity of the condition
- * some compiler versions may not produce optimal results.
- */
-
 #define BUG() do { \
__asm__ __volatile__(   \
"1: twi 31,0,0\n"   \
@@ -69,20 +63,6 @@
for(;;) ;   \
 } while (0)
 
-#define BUG_ON(x) do { \
-   if (__builtin_constant_p(x)) {  \
-   if (x)  \
-   BUG();  \
-   } else {\
-   __asm__ __volatile__(   \
-   "1: "PPC_TLNEI" %4,0\n" \
-   _EMIT_BUG_ENTRY \
-   : : "i" (__FILE__), "i" (__LINE__), "i" (0),\
- "i" (sizeof(struct bug_entry)),   \
- "r" ((__force long)(x))); \
-   }   \
-} while (0)
-
 #define __WARN() do {  \
__asm__ __volatile__(   \
"1: twi 31,0,0\n"   \
@@ -92,27 +72,8 @@
  "i" (sizeof(struct bug_entry)));  \
 } while (0)
 
-#define WARN_ON(x) ({  \
-   int __ret_warn_on = !!(x);  \
-   if (__builtin_constant_p(__ret_warn_on)) {  \
-   if (__ret_warn_on)  \
-   __WARN();   \
-   } else {\
-   __asm__ __volatile__(   \
-   "1: "PPC_TLNEI" %4,0\n" \
-   _EMIT_BUG_ENTRY \
-   : : "i" (__FILE__), "i" (__LINE__), \
- "i" (BUGFLAG_WARNING),\
- "i" (sizeof(struct bug_entry)),   \
- "r" (__ret_warn_on)); \
-   }   \
-   unlikely(__ret_warn_on);\
-})
-
 #define HAVE_ARCH_BUG
 #define HAVE_ARCH_WARN
-#define HAVE_ARCH_BUG_ON
-#define HAVE_ARCH_WARN_ON
 #endif /* __ASSEMBLY __ */
 #endif /* CONFIG_BUG */
 
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


[PATCH 1/2] bug.h: Introduce HAVE_ARCH_WARN

2007-10-11 Thread Olof Johansson
HAVE_ARCH_WARN is used to determine if an arch already has a __WARN()
macro, or if a generic one is needed.

With this, some of the arch-specific WARN_ON() implementations can be
made common instead (see follow-up patch for powerpc).

Signed-off-by: Olof Johansson <[EMAIL PROTECTED]>

diff --git a/include/asm-generic/bug.h b/include/asm-generic/bug.h
index d56fedb..c6b8386 100644
--- a/include/asm-generic/bug.h
+++ b/include/asm-generic/bug.h
@@ -31,14 +31,19 @@ struct bug_entry {
 #define BUG_ON(condition) do { if (unlikely(condition)) BUG(); } while(0)
 #endif
 
+#ifndef HAVE_ARCH_WARN
+#define __WARN() do {  \
+   printk("WARNING: at %s:%d %s()\n", __FILE__,\
+   __LINE__, __FUNCTION__);\
+   dump_stack();   \
+} while (0)
+#endif
+
 #ifndef HAVE_ARCH_WARN_ON
 #define WARN_ON(condition) ({  \
int __ret_warn_on = !!(condition);  \
-   if (unlikely(__ret_warn_on)) {  \
-   printk("WARNING: at %s:%d %s()\n", __FILE__,\
-   __LINE__, __FUNCTION__);\
-   dump_stack();   \
-   }   \
+   if (unlikely(__ret_warn_on))\
+   __WARN();   \
unlikely(__ret_warn_on);\
 })
 #endif
diff --git a/include/asm-parisc/bug.h b/include/asm-parisc/bug.h
index 8cfc553..3f68100 100644
--- a/include/asm-parisc/bug.h
+++ b/include/asm-parisc/bug.h
@@ -8,6 +8,7 @@
 
 #ifdef CONFIG_BUG
 #define HAVE_ARCH_BUG
+#define HAVE_ARCH_WARN
 #define HAVE_ARCH_WARN_ON
 
 /* the break instruction is used as BUG() marker.  */
diff --git a/include/asm-powerpc/bug.h b/include/asm-powerpc/bug.h
index e55d1f6..02e171c 100644
--- a/include/asm-powerpc/bug.h
+++ b/include/asm-powerpc/bug.h
@@ -110,6 +110,7 @@
 })
 
 #define HAVE_ARCH_BUG
+#define HAVE_ARCH_WARN
 #define HAVE_ARCH_BUG_ON
 #define HAVE_ARCH_WARN_ON
 #endif /* __ASSEMBLY __ */
diff --git a/include/asm-sh/bug.h b/include/asm-sh/bug.h
index a78d482..4ea415b 100644
--- a/include/asm-sh/bug.h
+++ b/include/asm-sh/bug.h
@@ -5,6 +5,7 @@
 
 #ifdef CONFIG_BUG
 #define HAVE_ARCH_BUG
+#define HAVE_ARCH_WARN
 #define HAVE_ARCH_WARN_ON
 
 /**
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [PATCH] PowerPC: Fix find_legacy_serial_ports on OPB.

2007-10-11 Thread Arnd Bergmann
On Thursday 11 October 2007, Josh Boyer wrote:
> Wait, no.  We already had this discussion months ago when David was
> working on the original Ebony port.  It was declared that legacy_serial
> is not how serial should be done on 4xx and the serial_of driver was
> supposed to be used instead.
> 
> Have we changed our stance on that?  If not, then perhaps KGDB should be
> fixed to work with serial_of.

I guess I'm fine with a patch that removes the OPB probing from
legacy_serial, but as long as it's there it should work on all
platforms.

Note that of_serial and legacy_serial are not exclusive, as of_serial
will simply take over all ports that have previously been registered
by the legacy code. Probing them early has the advantage that you
can see many printk messages earlier when the of_serial initialization
has not been called yet.

Arnd <><
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


[PATCH 4/4 v3] [POWERPC] Kilauea defconfig file

2007-10-11 Thread Stefan Roese
Signed-off-by: Stefan Roese <[EMAIL PROTECTED]>
---
Josh, I'm sending only the updated defconfig file now from
this patch-series. Hopefully this is enough.

Thanks,
Stefan

 arch/powerpc/configs/kilauea_defconfig |  768 
 1 files changed, 768 insertions(+), 0 deletions(-)
 create mode 100644 arch/powerpc/configs/kilauea_defconfig

diff --git a/arch/powerpc/configs/kilauea_defconfig 
b/arch/powerpc/configs/kilauea_defconfig
new file mode 100644
index 000..31790d3
--- /dev/null
+++ b/arch/powerpc/configs/kilauea_defconfig
@@ -0,0 +1,768 @@
+#
+# Automatically generated make config: don't edit
+# Linux kernel version: 2.6.23-rc9
+# Thu Oct 11 19:05:15 2007
+#
+# CONFIG_PPC64 is not set
+
+#
+# Processor support
+#
+# CONFIG_6xx is not set
+# CONFIG_PPC_85xx is not set
+# CONFIG_PPC_8xx is not set
+CONFIG_40x=y
+# CONFIG_44x is not set
+# CONFIG_E200 is not set
+CONFIG_4xx=y
+# CONFIG_PPC_MM_SLICES is not set
+CONFIG_NOT_COHERENT_CACHE=y
+CONFIG_PPC32=y
+CONFIG_WORD_SIZE=32
+CONFIG_PPC_MERGE=y
+CONFIG_MMU=y
+CONFIG_GENERIC_CMOS_UPDATE=y
+CONFIG_GENERIC_TIME=y
+CONFIG_GENERIC_TIME_VSYSCALL=y
+CONFIG_GENERIC_CLOCKEVENTS=y
+CONFIG_GENERIC_HARDIRQS=y
+CONFIG_IRQ_PER_CPU=y
+CONFIG_RWSEM_XCHGADD_ALGORITHM=y
+CONFIG_ARCH_HAS_ILOG2_U32=y
+CONFIG_GENERIC_HWEIGHT=y
+CONFIG_GENERIC_CALIBRATE_DELAY=y
+CONFIG_GENERIC_FIND_NEXT_BIT=y
+# CONFIG_ARCH_NO_VIRT_TO_BUS is not set
+CONFIG_PPC=y
+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_OF=y
+# CONFIG_PPC_UDBG_16550 is not set
+# CONFIG_GENERIC_TBSYNC is not set
+CONFIG_AUDIT_ARCH=y
+CONFIG_GENERIC_BUG=y
+# CONFIG_DEFAULT_UIMAGE is not set
+CONFIG_PPC_DCR_NATIVE=y
+# CONFIG_PPC_DCR_MMIO is not set
+CONFIG_PPC_DCR=y
+CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
+
+#
+# General setup
+#
+CONFIG_EXPERIMENTAL=y
+CONFIG_BROKEN_ON_SMP=y
+CONFIG_INIT_ENV_ARG_LIMIT=32
+CONFIG_LOCALVERSION=""
+CONFIG_LOCALVERSION_AUTO=y
+CONFIG_SWAP=y
+CONFIG_SYSVIPC=y
+CONFIG_SYSVIPC_SYSCTL=y
+CONFIG_POSIX_MQUEUE=y
+# CONFIG_BSD_PROCESS_ACCT is not set
+# CONFIG_TASKSTATS is not set
+# CONFIG_USER_NS is not set
+# CONFIG_AUDIT is not set
+# CONFIG_IKCONFIG is not set
+CONFIG_LOG_BUF_SHIFT=14
+CONFIG_SYSFS_DEPRECATED=y
+# CONFIG_RELAY is not set
+CONFIG_BLK_DEV_INITRD=y
+CONFIG_INITRAMFS_SOURCE=""
+# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
+CONFIG_SYSCTL=y
+CONFIG_EMBEDDED=y
+CONFIG_SYSCTL_SYSCALL=y
+CONFIG_KALLSYMS=y
+CONFIG_KALLSYMS_ALL=y
+CONFIG_KALLSYMS_EXTRA_PASS=y
+CONFIG_HOTPLUG=y
+CONFIG_PRINTK=y
+CONFIG_BUG=y
+CONFIG_ELF_CORE=y
+CONFIG_BASE_FULL=y
+CONFIG_FUTEX=y
+CONFIG_ANON_INODES=y
+CONFIG_EPOLL=y
+CONFIG_SIGNALFD=y
+CONFIG_EVENTFD=y
+CONFIG_SHMEM=y
+CONFIG_VM_EVENT_COUNTERS=y
+CONFIG_SLAB=y
+# CONFIG_SLUB is not set
+# CONFIG_SLOB is not set
+CONFIG_RT_MUTEXES=y
+# CONFIG_TINY_SHMEM is not set
+CONFIG_BASE_SMALL=0
+CONFIG_MODULES=y
+CONFIG_MODULE_UNLOAD=y
+# CONFIG_MODULE_FORCE_UNLOAD is not set
+# CONFIG_MODVERSIONS is not set
+# CONFIG_MODULE_SRCVERSION_ALL is not set
+CONFIG_KMOD=y
+CONFIG_BLOCK=y
+CONFIG_LBD=y
+# CONFIG_BLK_DEV_IO_TRACE is not set
+# CONFIG_LSF is not set
+# CONFIG_BLK_DEV_BSG 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_MPC52xx is not set
+# CONFIG_PPC_MPC5200 is not set
+# CONFIG_PPC_CELL is not set
+# CONFIG_PPC_CELL_NATIVE is not set
+# CONFIG_PQ2ADS is not set
+CONFIG_KILAUEA=y
+# CONFIG_WALNUT is not set
+# CONFIG_XILINX_VIRTEX_GENERIC_BOARD is not set
+# CONFIG_MPIC is not set
+# CONFIG_MPIC_WEIRD is not set
+# CONFIG_PPC_I8259 is not set
+# CONFIG_PPC_RTAS is not set
+# CONFIG_MMIO_NVRAM is not set
+# CONFIG_PPC_MPC106 is not set
+# CONFIG_PPC_970_NAP is not set
+# CONFIG_PPC_INDIRECT_IO is not set
+# CONFIG_GENERIC_IOMAP is not set
+# CONFIG_CPU_FREQ is not set
+# CONFIG_CPM2 is not set
+# CONFIG_FSL_ULI1575 is not set
+
+#
+# Kernel options
+#
+# CONFIG_HIGHMEM is not set
+# CONFIG_TICK_ONESHOT is not set
+# CONFIG_NO_HZ is not set
+# CONFIG_HIGH_RES_TIMERS is not set
+# CONFIG_HZ_100 is not set
+CONFIG_HZ_250=y
+# CONFIG_HZ_300 is not set
+# 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_BINFMT_ELF=y
+# CONFIG_BINFMT_MISC is not set
+# CONFIG_MATH_EMULATION is not set
+CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
+CONFIG_ARCH_FLATMEM_ENABLE=y
+CONFIG_ARCH_POPULATES_NODE_MAP=y
+CONFIG_SELECT_MEMORY_MODEL=y
+CONFIG_FLATMEM_MANUAL=y
+# CONFIG_DISCONTIGMEM_MANUAL is not set
+# CONFIG_SPARSEMEM_MANUAL is not set
+CONFIG_FLATMEM=y
+CONFIG_FLAT_NODE_MEM_MAP=y
+# CONFIG_SPARSEMEM_STATIC is not set
+CONFIG_SPLIT_PTLOCK_CPUS=4
+# CONFIG_RESOURCES_64BIT is 

Re: [PATCH] PowerPC: Fix find_legacy_serial_ports on OPB.

2007-10-11 Thread Valentine Barshak
Josh Boyer wrote:
> On Thu, 2007-10-11 at 17:50 +0200, Arnd Bergmann wrote:
>> On Thursday 11 October 2007, Valentine Barshak wrote:
>>> Currently find_legacy_serial_ports() can find no serial ports on the OPB.
>>> Thus no legacy boot console can be initialized. Just the early udbg console
>>> works, which is initialized with udbg_init_44x_as1() on the UART's physical
>>> address specified in kernel config. This happens because we look for ns16750
>>> and higher serial devices only and expect opb node to have a device type
>>> property. This patch makes it look for ns16550 compatible devices and use
>>> of_device_is_compatible() for opb instead of checking device type.
>>> Lack of legacy serial ports found causes problems for KGDB over serial.
>>>
>>> Signed-off-by: Valentine Barshak <[EMAIL PROTECTED]>
>> The patch would make sense if we were only dealing with flattened device
>> tree systems at this point. Unfortunately, IBM is shipping hardware that
>> encodes the serial port in exactly the way that find_legacy_serial_ports
>> is looking for (parent->type == "opb", compatible = "ns16750" "ns16550"
>> "ns16450" i8250").
>>
>> Changing the search for ns16750 to ns16550 should be fine, but unnecessary
>> because AFAIK, all OPB serial imlpementations are actually ns16750 and
>> should have that in the device tree as well.
>>
>> For the device type of the bus, please check for both compatible and
>> type, so that it still works on machines that are missing the compatible
>> property.
> 
> Wait, no.  We already had this discussion months ago when David was
> working on the original Ebony port.  It was declared that legacy_serial
> is not how serial should be done on 4xx and the serial_of driver was
> supposed to be used instead.
> 
> Have we changed our stance on that?  If not, then perhaps KGDB should be
> fixed to work with serial_of.

Actually I don't see any reason not to use legacy_serial stuff for early 
console. We could split the kernel configured very early debug output, 
which uses  PPC_EARLY_DEBUG_44x_PHYSLOW/PHYSHIGH (since it's really 
dangerous) and early console things by using legacy serial. We could use 
  early boot console without PPC_EARLY_DEBUG_44x.
Thanks,
Valentine.

> 
> josh
> 
> ___
> Linuxppc-dev mailing list
> Linuxppc-dev@ozlabs.org
> https://ozlabs.org/mailman/listinfo/linuxppc-dev

___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


[PATCH] [POWERPC] Adjust TASK_SIZE on ppc32 systems to 3GB that are capable

2007-10-11 Thread Kumar Gala
All ppc32 systems except PReP and 8xx are capable of handling 3G of user
address space.  Old legacy had set this to 2GB and no one has bothered to
fix it.

8xx could be bumped up to 3GB if its SW TLB miss handlers were fixed up
to properly determine kernel/user addresses.

---
 arch/powerpc/Kconfig |3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
index 3180457..037664d 100644
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
@@ -599,7 +599,8 @@ config TASK_SIZE_BOOL

 config TASK_SIZE
hex "Size of user task space" if TASK_SIZE_BOOL
-   default "0x8000"
+   default "0x8000" if PPC_PREP || PPC_8xx
+   default "0xc000"

 config CONSISTENT_START_BOOL
bool "Set custom consistent memory pool address"
-- 
1.5.2.4

___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [PATCH] PowerPC: Fix find_legacy_serial_ports on OPB.

2007-10-11 Thread Valentine Barshak
Arnd Bergmann wrote:
> On Thursday 11 October 2007, Valentine Barshak wrote:
>> Currently find_legacy_serial_ports() can find no serial ports on the OPB.
>> Thus no legacy boot console can be initialized. Just the early udbg console
>> works, which is initialized with udbg_init_44x_as1() on the UART's physical
>> address specified in kernel config. This happens because we look for ns16750
>> and higher serial devices only and expect opb node to have a device type
>> property. This patch makes it look for ns16550 compatible devices and use
>> of_device_is_compatible() for opb instead of checking device type.
>> Lack of legacy serial ports found causes problems for KGDB over serial.
>>
>> Signed-off-by: Valentine Barshak <[EMAIL PROTECTED]>
> 
> The patch would make sense if we were only dealing with flattened device
> tree systems at this point. Unfortunately, IBM is shipping hardware that
> encodes the serial port in exactly the way that find_legacy_serial_ports
> is looking for (parent->type == "opb", compatible = "ns16750" "ns16550"
> "ns16450" i8250").
> 
> Changing the search for ns16750 to ns16550 should be fine, but unnecessary
> because AFAIK, all OPB serial imlpementations are actually ns16750 and
> should have that in the device tree as well.

This is a bit odd. The docs say that uart chips on the ppc44x processors 
are registry-compatible to 16750, but have 16-byte FIFO's.
This is OK for legacy serial stuff (since it really needs the chip to be 
16550-compatible), but the 8250 driver expects 64-byte FIFO size for 16750.
I guess that's why 44x uart dts entries don't have 16750 compatible 
property.

> 
> For the device type of the bus, please check for both compatible and
> type, so that it still works on machines that are missing the compatible
> property.
> 
>   Arnd <><

___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


[PATCH] [POWERPC] Use PAGE_OFFSET to tell if an address is user/kernel in SW TLB handlers

2007-10-11 Thread Kumar Gala
Move to using PAGE_OFFSET instead of TASK_SIZE or KERNELBASE value on
6xx/40x/44x/fsl-booke to determine if the faulting address is a kernel or
user space address.  This mimics how the macro is_kernel_addr() works.

---

I've tested this on fsl_booke & 603 systems.

 arch/powerpc/kernel/head_32.S|   18 +-
 arch/powerpc/kernel/head_40x.S   |6 +++---
 arch/powerpc/kernel/head_44x.S   |6 +++---
 arch/powerpc/kernel/head_fsl_booke.S |   11 ---
 4 files changed, 19 insertions(+), 22 deletions(-)

diff --git a/arch/powerpc/kernel/head_32.S b/arch/powerpc/kernel/head_32.S
index d83f04e..a5b13ae 100644
--- a/arch/powerpc/kernel/head_32.S
+++ b/arch/powerpc/kernel/head_32.S
@@ -469,12 +469,12 @@ InstructionTLBMiss:
mfctr   r0
/* Get PTE (linux-style) and check access */
mfspr   r3,SPRN_IMISS
-   lis r1,[EMAIL PROTECTED]/* check if kernel address */
-   cmplw   0,r3,r1
+   lis r1,[EMAIL PROTECTED]/* check if kernel address */
+   cmplw   0,r1,r3
mfspr   r2,SPRN_SPRG3
li  r1,_PAGE_USER|_PAGE_PRESENT /* low addresses tested as user */
lwz r2,PGDIR(r2)
-   blt+112f
+   bge-112f
mfspr   r2,SPRN_SRR1/* and MSR_PR bit from SRR1 */
rlwimi  r1,r2,32-12,29,29   /* shift MSR_PR to _PAGE_USER posn */
lis r2,[EMAIL PROTECTED]/* if kernel address, use */
@@ -543,12 +543,12 @@ DataLoadTLBMiss:
mfctr   r0
/* Get PTE (linux-style) and check access */
mfspr   r3,SPRN_DMISS
-   lis r1,[EMAIL PROTECTED]/* check if kernel address */
-   cmplw   0,r3,r1
+   lis r1,[EMAIL PROTECTED]/* check if kernel address */
+   cmplw   0,r1,r3
mfspr   r2,SPRN_SPRG3
li  r1,_PAGE_USER|_PAGE_PRESENT /* low addresses tested as user */
lwz r2,PGDIR(r2)
-   blt+112f
+   bge-112f
mfspr   r2,SPRN_SRR1/* and MSR_PR bit from SRR1 */
rlwimi  r1,r2,32-12,29,29   /* shift MSR_PR to _PAGE_USER posn */
lis r2,[EMAIL PROTECTED]/* if kernel address, use */
@@ -615,12 +615,12 @@ DataStoreTLBMiss:
mfctr   r0
/* Get PTE (linux-style) and check access */
mfspr   r3,SPRN_DMISS
-   lis r1,[EMAIL PROTECTED]/* check if kernel address */
-   cmplw   0,r3,r1
+   lis r1,[EMAIL PROTECTED]/* check if kernel address */
+   cmplw   0,r1,r3
mfspr   r2,SPRN_SPRG3
li  r1,_PAGE_RW|_PAGE_USER|_PAGE_PRESENT /* access flags */
lwz r2,PGDIR(r2)
-   blt+112f
+   bge-112f
mfspr   r2,SPRN_SRR1/* and MSR_PR bit from SRR1 */
rlwimi  r1,r2,32-12,29,29   /* shift MSR_PR to _PAGE_USER posn */
lis r2,[EMAIL PROTECTED]/* if kernel address, use */
diff --git a/arch/powerpc/kernel/head_40x.S b/arch/powerpc/kernel/head_40x.S
index e312824..cfefc2d 100644
--- a/arch/powerpc/kernel/head_40x.S
+++ b/arch/powerpc/kernel/head_40x.S
@@ -289,7 +289,7 @@ label:
/* If we are faulting a kernel address, we have to use the
 * kernel page tables.
 */
-   lis r11, [EMAIL PROTECTED]
+   lis r11, [EMAIL PROTECTED]
cmplw   r10, r11
blt+3f
lis r11, [EMAIL PROTECTED]
@@ -481,7 +481,7 @@ label:
/* If we are faulting a kernel address, we have to use the
 * kernel page tables.
 */
-   lis r11, [EMAIL PROTECTED]
+   lis r11, [EMAIL PROTECTED]
cmplw   r10, r11
blt+3f
lis r11, [EMAIL PROTECTED]
@@ -581,7 +581,7 @@ label:
/* If we are faulting a kernel address, we have to use the
 * kernel page tables.
 */
-   lis r11, [EMAIL PROTECTED]
+   lis r11, [EMAIL PROTECTED]
cmplw   r10, r11
blt+3f
lis r11, [EMAIL PROTECTED]
diff --git a/arch/powerpc/kernel/head_44x.S b/arch/powerpc/kernel/head_44x.S
index 864d63f..409db61 100644
--- a/arch/powerpc/kernel/head_44x.S
+++ b/arch/powerpc/kernel/head_44x.S
@@ -319,7 +319,7 @@ interrupt_base:
/* If we are faulting a kernel address, we have to use the
 * kernel page tables.
 */
-   lis r11, [EMAIL PROTECTED]
+   lis r11, [EMAIL PROTECTED]
cmplw   r10, r11
blt+3f
lis r11, [EMAIL PROTECTED]
@@ -458,7 +458,7 @@ interrupt_base:
/* If we are faulting a kernel address, we have to use the
 * kernel page tables.
 */
-   lis r11, [EMAIL PROTECTED]
+   lis r11, [EMAIL PROTECTED]
cmplw   r10, r11
blt+3f
lis r11, [EMAIL PROTECTED]
@@ -528,7 +528,7 @@ interrupt_base:
/* If we are faulting a kernel address, we have to use the
 * kernel page tables.
 */
-   lis r11, [EMAIL PROTECT

Re: [PATCH] PowerPC: Fix find_legacy_serial_ports on OPB.

2007-10-11 Thread Josh Boyer
On Thu, 2007-10-11 at 21:26 +0400, Valentine Barshak wrote:
> Josh Boyer wrote:
> > On Thu, 2007-10-11 at 17:50 +0200, Arnd Bergmann wrote:
> >> On Thursday 11 October 2007, Valentine Barshak wrote:
> >>> Currently find_legacy_serial_ports() can find no serial ports on the OPB.
> >>> Thus no legacy boot console can be initialized. Just the early udbg 
> >>> console
> >>> works, which is initialized with udbg_init_44x_as1() on the UART's 
> >>> physical
> >>> address specified in kernel config. This happens because we look for 
> >>> ns16750
> >>> and higher serial devices only and expect opb node to have a device type
> >>> property. This patch makes it look for ns16550 compatible devices and use
> >>> of_device_is_compatible() for opb instead of checking device type.
> >>> Lack of legacy serial ports found causes problems for KGDB over serial.
> >>>
> >>> Signed-off-by: Valentine Barshak <[EMAIL PROTECTED]>
> >> The patch would make sense if we were only dealing with flattened device
> >> tree systems at this point. Unfortunately, IBM is shipping hardware that
> >> encodes the serial port in exactly the way that find_legacy_serial_ports
> >> is looking for (parent->type == "opb", compatible = "ns16750" "ns16550"
> >> "ns16450" i8250").
> >>
> >> Changing the search for ns16750 to ns16550 should be fine, but unnecessary
> >> because AFAIK, all OPB serial imlpementations are actually ns16750 and
> >> should have that in the device tree as well.
> >>
> >> For the device type of the bus, please check for both compatible and
> >> type, so that it still works on machines that are missing the compatible
> >> property.
> > 
> > Wait, no.  We already had this discussion months ago when David was
> > working on the original Ebony port.  It was declared that legacy_serial
> > is not how serial should be done on 4xx and the serial_of driver was
> > supposed to be used instead.
> > 
> > Have we changed our stance on that?  If not, then perhaps KGDB should be
> > fixed to work with serial_of.
> 
> Actually I don't see any reason not to use legacy_serial stuff for early 
> console. We could split the kernel configured very early debug output, 
> which uses  PPC_EARLY_DEBUG_44x_PHYSLOW/PHYSHIGH (since it's really 
> dangerous) and early console things by using legacy serial. We could use 
>   early boot console without PPC_EARLY_DEBUG_44x.

That was exactly my thinking when this first came up.  I'd like to hear
David's opinion on it.

josh

___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: Please pull linux-2.6-mpc52xx.git

2007-10-11 Thread tnt
> Paulus,
>
> Sylvain has asked if I would like to help with the mpc52xx
> maintainership.  If it's okay by you, here is a patch that adds me as
> co-maintainer for the mpc52xx platform along with 3 other mpc52xx
> related fixes.
>
> Sylvain, can you please reply to this message confirming that this is
> what we talked about?

Paulus,
Yes, I confirm.


Sylvain


___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Please pull from 'for-2.6.24' branch [updated]

2007-10-11 Thread Kumar Gala
(Added the two patches to use PAGE_OFFSET and set TASK_SIZE to 3GB)

Please pull from 'for-2.6.24' branch of

master.kernel.org:/pub/scm/linux/kernel/git/galak/powerpc.git for-2.6.24

to receive the following updates:

 arch/powerpc/Kconfig   |3
 arch/powerpc/boot/dts/mpc8272ads.dts   |2
 arch/powerpc/boot/dts/mpc8541cds.dts   |   36 ++
 arch/powerpc/boot/dts/mpc8555cds.dts   |   36 ++
 arch/powerpc/boot/dts/mpc8560ads.dts   |   82 +++---
 arch/powerpc/configs/mpc8560_ads_defconfig |   23 +++
 arch/powerpc/kernel/head_32.S  |   18 +--
 arch/powerpc/kernel/head_40x.S |6 -
 arch/powerpc/kernel/head_44x.S |6 -
 arch/powerpc/kernel/head_fsl_booke.S   |   11 -
 arch/powerpc/platforms/85xx/Kconfig|1
 arch/powerpc/platforms/85xx/mpc8540_ads.h  |   35 --
 arch/powerpc/platforms/85xx/mpc85xx_ads.c  |  168 +++--
 arch/powerpc/platforms/85xx/mpc85xx_ads.h  |   60 --
 arch/powerpc/platforms/85xx/mpc85xx_cds.c  |   10 +
 arch/powerpc/platforms/85xx/mpc85xx_cds.h  |   43 ---
 arch/powerpc/platforms/85xx/mpc85xx_ds.c   |1
 arch/powerpc/platforms/85xx/mpc85xx_mds.c  |1
 include/asm-powerpc/cpm2.h |4
 include/asm-powerpc/fs_pd.h|2
 include/asm-powerpc/mpc85xx.h  |   45 ---
 21 files changed, 259 insertions(+), 334 deletions(-)

Kumar Gala (4):
  [POWERPC] 85xx: Killed 
  [POWERPC] 85xx: Enable FP emulation in MPC8560 ADS defconfig
  [POWERPC] Use PAGE_OFFSET to tell if an address is user/kernel in SW TLB 
handlers
  [POWERPC] Adjust TASK_SIZE on ppc32 systems to 3GB that are capable

Scott Wood (3):
  [POWERPC] mpc8272ads: Remove muram from the CPM reg property.
  [POWERPC] 85xx: Convert mpc8560ads to the new CPM binding.
  [POWERPC] 85xx: Add cpm nodes for 8541/8555 CDS

___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


[PATCH] PowerPC: Add legacy serial support for OPB with flattened device tree.

2007-10-11 Thread Valentine Barshak
Currently find_legacy_serial_ports() can find no serial ports on the OPB
with flattened device. Thus no legacy boot console can be initialized.
Just the early udbg console works, which is initialized with udbg_init_44x_as1
on the UART's physical address specified in kernel config. This happens
because we look for ns16750 serial devices only and expect opb node to have
a device type property. This patch makes it look for ns16550-compatible
devices and use of_device_is_compatible() for opb in case device type is not
specified.

Signed-off-by: Valentine Barshak <[EMAIL PROTECTED]>
---
 arch/powerpc/kernel/legacy_serial.c |5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff -pruN linux-2.6.orig/arch/powerpc/kernel/legacy_serial.c 
linux-2.6/arch/powerpc/kernel/legacy_serial.c
--- linux-2.6.orig/arch/powerpc/kernel/legacy_serial.c  2007-10-11 
17:12:09.0 +0400
+++ linux-2.6/arch/powerpc/kernel/legacy_serial.c   2007-10-11 
23:01:25.0 +0400
@@ -340,9 +340,10 @@ void __init find_legacy_serial_ports(voi
}
 
/* First fill our array with opb bus ports */
-   for (np = NULL; (np = of_find_compatible_node(np, "serial", "ns16750")) 
!= NULL;) {
+   for (np = NULL; (np = of_find_compatible_node(np, "serial", "ns16550")) 
!= NULL;) {
struct device_node *opb = of_get_parent(np);
-   if (opb && !strcmp(opb->type, "opb")) {
+   if (opb && (!strcmp(opb->type, "opb") ||
+   of_device_is_compatible(opb, "ibm,opb"))) {
index = add_legacy_soc_port(np, np);
if (index >= 0 && np == stdout)
legacy_serial_console = index;
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [PATCH 2/2] powerpc: Switch to generic WARN_ON()/BUG_ON()

2007-10-11 Thread Scott Wood
On Thu, Oct 11, 2007 at 12:14:13PM -0500, Olof Johansson wrote:
> Not using the ppc-specific WARN_ON/BUG_ON constructs actually saves about
> 4K text on a ppc64_defconfig. The main reason seems to be that prepping
> the arguments to the conditional trap instructions is more work than
> just doing a compare and branch.

It'd be nice if we could get GCC to generate bug table entries for
__builtin_trap(); that way we could use GCC's ability to put arbitrary
conditions in the trap instruction.

-Scott
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [PATCH 4/4 v2] [POWERPC] Kilauea defconfig file

2007-10-11 Thread Scott Wood
On Thu, Oct 11, 2007 at 03:31:12PM +0200, Stefan Roese wrote:
> Yes, good catch. Since I'm not using the bootwrapper, I should be able to get 
> rid of WANT_DEVICE_TREE too. But it seems to be autoselected in 
> arch/powerpc/platforms/Kconfig.cputype for 40x and most other "embedded" 
> CPU's. Any idea why this is the case?

Probably copying from 83xx, 85xx, etc, which set it on the entire CPU family
because there's a wrapper platform that covers the entire family.  AFAICT,
there are only board wrappers for 4xx, so individual boards should be
selecting WANT_DEVICE_TREE.

In any case, you can just set DEVICE_TREE to an empty string if you only
want the regular uImage.

-Scott
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [PATCH 3/9 v2] add Freescale SerDes PHY support

2007-10-11 Thread Scott Wood
On Thu, Oct 11, 2007 at 05:53:45PM +0800, Li Yang wrote:
> diff --git a/arch/powerpc/platforms/Kconfig b/arch/powerpc/platforms/Kconfig
> index 19d4628..e89f803 100644
> --- a/arch/powerpc/platforms/Kconfig
> +++ b/arch/powerpc/platforms/Kconfig
> @@ -291,4 +291,8 @@ config FSL_ULI1575
> Freescale reference boards. The boards all use the ULI in pretty
> much the same way.
>  
> +config FSL_SERDES
> + bool
> + default n

"default n" is the default -- no need to specify it explicitly.

> + /* Configure SRDSCR1 */
> + tmp = in_be32(regs + FSL_SRDSCR1_OFFS);
> + tmp &= ~FSL_SRDSCR1_PLLBW;
> + out_be32(regs + FSL_SRDSCR1_OFFS, tmp);

clrbits32?

> + /* Configure SRDSCR2 */
> + tmp = in_be32(regs + FSL_SRDSCR2_OFFS);
> + tmp &= ~FSL_SRDSCR2_SEIC_MASK;
> + tmp |= FSL_SRDSCR2_SEIC_SATA;
> + out_be32(regs + FSL_SRDSCR2_OFFS, tmp);

clrsetbits_be32?

-Scott
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: Build failure on treeboot-walnut.cg

2007-10-11 Thread Scott Wood
On Thu, Oct 11, 2007 at 10:12:35AM +1000, Paul Mackerras wrote:
> Timur Tabi writes:
> 
> > Is this a new policy?  Modules in the kernel are not built unless you want 
> > them.  Even in arch/powerpc/platforms, only the specific platform file I'm 
> > targeting is built.  So I don't really understand why you claim it's normal 
> > for platform-specific files to be built, regardless of the actual platform.
> 
> The wrapper script is intended to be a standalone tool which is
> independent of the kernel configuration, and can be used separately
> from the kernel build process.

Is it ever actually used that way?  I wonder if this "intent" is worth the
pain...

-Scott
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: Hard hang in hypervisor!?

2007-10-11 Thread Linas Vepstas
On Thu, Oct 11, 2007 at 10:04:40AM +1000, Paul Mackerras wrote:
> Linas Vepstas writes:
> 
> > Err ..  it was cpu 0 that was spinlocked.  Are interrupts not
> > distributed?
> 
> We have some bogosities in the xics code that I noticed a couple of
> days ago.  Basically we only set the xics to distribute interrupts to
> all cpus if (a) the affinity mask is equal to CPU_MASK_ALL (which has
> ones in every bit position from 0 to NR_CPUS-1) and (b) all present
> cpus are online (cpu_online_map == cpu_present_map).  Otherwise we
> direct interrupts to the first cpu in the affinity map.  So you can
> easily have the affinity mask containing all the online cpus and still
> not get distributed interrupts.
> 
> So in your case it's quite possible that all interrupts were directed
> to cpu 0.

Thanks,
I'll give this a whirl if I don't get distracted by other tasks. 

A simple cat /proc/interrupts shows them evenly distributed on
my "usual" box, and all glommed up on cpu 0 on the one thats 
giving me fits.

Also, I noticed years ago that "BAD" was non-zero and large.
Vowed to look into it someday ...

--linas
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: powerpc commits for 2.6.24

2007-10-11 Thread Benjamin Herrenschmidt

On Thu, 2007-10-11 at 07:52 -0500, Kumar Gala wrote:
> > Benjamin Herrenschmidt (3):
> >   [POWERPC] Fix platinumfb framebuffer
> >   [POWERPC] cell: Move cbe_regs.h to include/asm-powerpc/cell- 
> > regs.h
> >   [POWERPC] cell: Add Cell memory controller register defs and  
> > expose it
> 
> Ben, your slacking :)

 ?

Ben.


___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [PATCH] Make clockevents work on PPC601 processors

2007-10-11 Thread Benjamin Herrenschmidt

On Thu, 2007-10-11 at 09:12 -0500, Kumar Gala wrote:
> On Oct 11, 2007, at 6:46 AM, Paul Mackerras wrote:
> 
> > In testing the new clocksource and clockevent code on a PPC601
> > processor, I discovered that the clockevent multiplier value for the
> > decrementer clockevent was overflowing.  Because the RTCL register in
> > the 601 effectively counts at 1GHz (it doesn't actually, but it
> > increases by 128 every 128ns), and the shift value was 32, that meant
> > the multiplier value had to be 2^32, which won't fit in an unsigned
> > long on 32-bit.  The same problem would arise on any platform where
> > the timebase frequency was 1GHz or more (not that we actually have any
> > such machines today).
> 
> do you still have a 601 running somewhere?

On my desk :-) (and he also has a 601 card for the 7500 iirc)

/me remembers to revive his dual 604 8500 one of these days.

Ben.


___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: powerpc commits for 2.6.24

2007-10-11 Thread Kumar Gala

On Oct 11, 2007, at 3:55 PM, Benjamin Herrenschmidt wrote:

>
> On Thu, 2007-10-11 at 07:52 -0500, Kumar Gala wrote:
>>> Benjamin Herrenschmidt (3):
>>>   [POWERPC] Fix platinumfb framebuffer
>>>   [POWERPC] cell: Move cbe_regs.h to include/asm-powerpc/cell-
>>> regs.h
>>>   [POWERPC] cell: Add Cell memory controller register defs and
>>> expose it
>>
>> Ben, your slacking :)
>
>  ?

Just three patches for 2.6.24... :)

- k
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [PATCH] PowerPC: Add legacy serial support for OPB with flattened device tree.

2007-10-11 Thread Arnd Bergmann
On Thursday 11 October 2007, Valentine Barshak wrote:
> Currently find_legacy_serial_ports() can find no serial ports on the OPB
> with flattened device. Thus no legacy boot console can be initialized.
> Just the early udbg console works, which is initialized with udbg_init_44x_as1
> on the UART's physical address specified in kernel config. This happens
> because we look for ns16750 serial devices only and expect opb node to have
> a device type property. This patch makes it look for ns16550-compatible
> devices and use of_device_is_compatible() for opb in case device type is not
> specified.
> 
> Signed-off-by: Valentine Barshak <[EMAIL PROTECTED]>

Looks correct for QS21 now.

Acked-by: Arnd Bergmann <[EMAIL PROTECTED]>
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [PATCH 4/4 v2] [POWERPC] Kilauea defconfig file

2007-10-11 Thread Josh Boyer
On Thu, 2007-10-11 at 15:12 -0500, Scott Wood wrote:
> On Thu, Oct 11, 2007 at 03:31:12PM +0200, Stefan Roese wrote:
> > Yes, good catch. Since I'm not using the bootwrapper, I should be able to 
> > get 
> > rid of WANT_DEVICE_TREE too. But it seems to be autoselected in 
> > arch/powerpc/platforms/Kconfig.cputype for 40x and most other "embedded" 
> > CPU's. Any idea why this is the case?
> 
> Probably copying from 83xx, 85xx, etc, which set it on the entire CPU family
> because there's a wrapper platform that covers the entire family.  AFAICT,
> there are only board wrappers for 4xx, so individual boards should be
> selecting WANT_DEVICE_TREE.

Probably.  Seems somewhat redundant at this point to move it into the
individual board options though.

> In any case, you can just set DEVICE_TREE to an empty string if you only
> want the regular uImage.

Well, he wants the raw uImage, and a separate DTB to be spit out as far
as I can tell.  So we don't want an empty string here, but what's there
currently doesn't do the latter part either.

josh

___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: Hard hang in hypervisor!?

2007-10-11 Thread Milton Miller
On Thu Oct 11 10:04:40 EST 2007, Paul Mackerras wrote:
> Linas Vepstas writes:
>> Err ..  it was cpu 0 that was spinlocked.  Are interrupts not
>> distributed?
> 
> We have some bogosities in the xics code that I noticed a couple of
> days ago.  Basically we only set the xics to distribute interrupts to
> all cpus if (a) the affinity mask is equal to CPU_MASK_ALL (which has
> ones in every bit position from 0 to NR_CPUS-1) and (b) all present
> cpus are online (cpu_online_map == cpu_present_map).  Otherwise we
> direct interrupts to the first cpu in the affinity map.  So you can
> easily have the affinity mask containing all the online cpus and still
> not get distributed interrupts.


The second condition was just added to try fix some issues where a 
vendor wants to always run the kdump kernel with maxcpus=1 on all
architectures, and the emulated xics on js20 was not working.
For a true xics, this should work because we (1) remove all but 1
cpu from the global server list and (2) raise the prioirity of the
cpu to disabled and the hardware will deliver to another cpu in the
parition.

http://ozlabs.org/pipermail/linuxppc-dev/2006-December/028941.html
http://ozlabs.org/pipermail/linuxppc-dev/2007-January/029607.html
http://ozlabs.org/pipermail/linuxppc-dev/2007-March/032621.html

However, my experience the other day on a js21 was that firmware
delivered either to all cpus (if we bound to the global server) or
the first online cpu in the partition, regardless of to which cpu
we bound the interrupt, so I don't know that the change will fix
the original problem.

It does mean that taking a cpu offline but not dlpar removing it from the
kernel will result in the inability to actually distribute interrupts
to all cpus.

I'd be happy to say remove the extra check and work with firmware to
property distribute the interrupts.

milton
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [PATCH v2] powerpc: don't enable cpu hotplug on mpic-based pseries

2007-10-11 Thread Milton Miller
Paul Mackerras writes:
> Olof Johansson writes:
>> Don't allow cpu hotplug on systems lacking XICS interrupt controller,
>> since current code is hardcoded for it.
> ...
>> +for (np = NULL; (np = of_find_node_by_name(np,
>> +   "interrupt-controller"));) {
> 
> Looks like for_each_node_by_name would be nicer here.
> 
> If you agree, I'll hand-edit your patch to do that and apply it.  Of
> course, ultimately we should implement the necessary mpic bits to
> support cpu hotplug.
> 

While you are editing, can you please change the condition to finding
ppc-xicp instead of not finding open-pic?

thanks.
milton

___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


[RFC] Fixup stfiwx decode bug

2007-10-11 Thread Kumar Gala
Paul,

Can you look over this fix and see if you have any style issues with it.
Its legal for stfiwx to have RA = 0, however we treated it as illegal
since it was in class "XE".

- k

diff --git a/arch/powerpc/math-emu/math.c b/arch/powerpc/math-emu/math.c
index 69058b2..381306b 100644
--- a/arch/powerpc/math-emu/math.c
+++ b/arch/powerpc/math-emu/math.c
@@ -407,11 +407,16 @@ do_mathemu(struct pt_regs *regs)

case XE:
idx = (insn >> 16) & 0x1f;
-   if (!idx)
-   goto illegal;
-
op0 = (void *)¤t->thread.fpr[(insn >> 21) & 0x1f];
-   op1 = (void *)(regs->gpr[idx] + regs->gpr[(insn >> 11) & 0x1f]);
+   if (!idx) {
+   if (((insn >> 1) & 0x3ff) == STFIWX)
+   op1 = (void *)(regs->gpr[(insn >> 11) & 0x1f]);
+   else
+   goto illegal;
+   } else {
+   op1 = (void *)(regs->gpr[idx] + regs->gpr[(insn >> 11) 
& 0x1f]);
+   }
+
break;

case XEU:
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [PATCH v4 or so] Use 1TB segments

2007-10-11 Thread Paul Mackerras
Linas Vepstas writes:

> Gack. A system dump might take a while on these machines ... 

Why?  Using 1TB segments doesn't mean they have 1TB of RAM ...

Paul.
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [patch 1/2] Replace NT_PRXFPREG with ELF_CORE_XFPREG_TYPE #define

2007-10-11 Thread Paul Mackerras
Kumar Gala writes:

> > #define ELF_CORE_XFPREG_TYPE to be NT_PRXFPREG in all current users so
> > there's are no change in behaviour.
> 
> Can we make this ELF_CORE_VECREG_TYPE or something that is so coupled  
> to the x86 specific name?

How is "extended floating point registers" x86-specific?

ELF_CORE_XFPREG_TYPE is a suitable name for something that's used in
conjunction with a function called elf_core_copy_task_xfpregs().

Paul.
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [patch 1/2] Replace NT_PRXFPREG with ELF_CORE_XFPREG_TYPE #define

2007-10-11 Thread Kumar Gala

On Oct 11, 2007, at 4:55 PM, Paul Mackerras wrote:

> Kumar Gala writes:
>
>>> #define ELF_CORE_XFPREG_TYPE to be NT_PRXFPREG in all current  
>>> users so
>>> there's are no change in behaviour.
>>
>> Can we make this ELF_CORE_VECREG_TYPE or something that is so coupled
>> to the x86 specific name?
>
> How is "extended floating point registers" x86-specific?

we'll I don't consider the altivec register file as 'extended fp'.   
I'm assuming the name XFP came from IA32 land when MMX/SSE came into  
existence.

> ELF_CORE_XFPREG_TYPE is a suitable name for something that's used in
> conjunction with a function called elf_core_copy_task_xfpregs().

agreed, I think the function name should change as well.

- k
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: powerpc commits for 2.6.24

2007-10-11 Thread Josh Boyer
On Thu, 2007-10-11 at 07:47 -0500, Josh Boyer wrote:
> On Thu, 2007-10-11 at 22:30 +1000, Paul Mackerras wrote:
> > Below is the list of commits that I plan to ask Linus to pull
> > tomorrow.  This is the last call for anything else or for objections
> > to any of these commits going in.  These commits are in powerpc.git on
> > the master and for-2.6.24 branches.
> 
> Hi Paul,
> 
> Could you pull from:
> 
> master.kernel.org/pub/scm/linux/kernel/git/jwboyer/powerpc-4xx.git for-2.6.24
> 
> to pick up some Xilinx changes from Grant?  I'm also hoping to get
> Stefan's 405EX changes in soon.

I added Stefan's latest patch set to my tree as well.  They look good.

josh

___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [patch 1/2] Replace NT_PRXFPREG with ELF_CORE_XFPREG_TYPE #define

2007-10-11 Thread Paul Mackerras
Kumar Gala writes:

> > ELF_CORE_XFPREG_TYPE is a suitable name for something that's used in
> > conjunction with a function called elf_core_copy_task_xfpregs().
> 
> agreed, I think the function name should change as well.

Maybe.  Let's do one step at a time...

Paul.
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: powerpc commits for 2.6.24

2007-10-11 Thread Paul Mackerras
Kumar Gala writes:

> I'm debugging one issue with MPC8560 that should get fixed today with  
> a new pull request after I find the issue.

There's no particular hurry for bug fixes.

> Just to clarify, are we closing 2.6.24 for new code after you send  
> Linus a pull request or are we still taking things during the two  
> week merge window?

Basically, yes.  We got a lecture at kernel summit from Linus and
Andrew where we got told to get everything merged early in the merge
window.  I might make an exception for stuff that has already been
posted for review but still needs some minor changes, but other than
that, the window for new code has closed.

Paul.
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [PATCH] Make clockevents work on PPC601 processors

2007-10-11 Thread Paul Mackerras
Kumar Gala writes:

> do you still have a 601 running somewhere?

Yes, I still have the original 601 cpu card for my PowerMac 7500. :)

Paul.
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: powerpc commits for 2.6.24

2007-10-11 Thread Kumar Gala

On Oct 11, 2007, at 5:31 PM, Paul Mackerras wrote:

> Kumar Gala writes:
>
>> I'm debugging one issue with MPC8560 that should get fixed today with
>> a new pull request after I find the issue.
>
> There's no particular hurry for bug fixes.

Already dealt with, mainly I was being stupid.

>> Just to clarify, are we closing 2.6.24 for new code after you send
>> Linus a pull request or are we still taking things during the two
>> week merge window?
>
> Basically, yes.  We got a lecture at kernel summit from Linus and
> Andrew where we got told to get everything merged early in the merge
> window.  I might make an exception for stuff that has already been
> posted for review but still needs some minor changes, but other than
> that, the window for new code has closed.

I was wondering about this case.  I'll follow your lead here.

- k
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [patch 1/2] Replace NT_PRXFPREG with ELF_CORE_XFPREG_TYPE #define

2007-10-11 Thread Michael Ellerman
On Thu, 2007-10-11 at 08:04 -0500, Kumar Gala wrote:
> On Oct 11, 2007, at 2:15 AM, [EMAIL PROTECTED] wrote:
> 
> > Replace NT_PRXFPREG with ELF_CORE_XFPREG_TYPE in the coredump code  
> > which
> > allows for more flexibility in the note type for the state of  
> > 'extended
> > floating point' implementations in coredumps. New note types can  
> > now be
> > added with an appropriate #define.
> >
> > #define ELF_CORE_XFPREG_TYPE to be NT_PRXFPREG in all current users so
> > there's are no change in behaviour.
> 
> Can we make this ELF_CORE_VECREG_TYPE or something that is so coupled  
> to the x86 specific name?
> 
> >
> > Signed-off-by: Mark Nelson <[EMAIL PROTECTED]>
> > ---
> >  arch/ia64/ia32/elfcore32.h |1 +
> >  arch/x86_64/ia32/ia32_binfmt.c |1 +
> >  fs/binfmt_elf.c|4 ++--
> >  include/asm-i386/elf.h |1 +
> >  4 files changed, 5 insertions(+), 2 deletions(-)
> >
> > Index: linux/arch/ia64/ia32/elfcore32.h
> > ===
> > --- linux.orig/arch/ia64/ia32/elfcore32.h
> > +++ linux/arch/ia64/ia32/elfcore32.h
> > @@ -117,6 +117,7 @@ elf_core_copy_task_fpregs(struct task_st
> >  }
> >
> >  #define ELF_CORE_COPY_XFPREGS 1
> > +#define ELF_CORE_XFPREG_TYPE NT_PRXFPREG
> >  static inline int
> >  elf_core_copy_task_xfpregs(struct task_struct *tsk,  
> > elf_fpxregset_t *xfpu)
> >  {
> > Index: linux/arch/x86_64/ia32/ia32_binfmt.c
> > ===
> > --- linux.orig/arch/x86_64/ia32/ia32_binfmt.c
> > +++ linux/arch/x86_64/ia32/ia32_binfmt.c
> > @@ -188,6 +188,7 @@ elf_core_copy_task_fpregs(struct task_st
> >  }
> >
> >  #define ELF_CORE_COPY_XFPREGS 1
> > +#define ELF_CORE_XFPREG_TYPE NT_PRXFPREG
> >  static inline int
> >  elf_core_copy_task_xfpregs(struct task_struct *t, elf_fpxregset_t  
> > *xfpu)
> >  {
> > Index: linux/fs/binfmt_elf.c
> > ===
> > --- linux.orig/fs/binfmt_elf.c
> > +++ linux/fs/binfmt_elf.c
> > @@ -1446,8 +1446,8 @@ static int elf_dump_thread_status(long s
> >
> >  #ifdef ELF_CORE_COPY_XFPREGS
> > if (elf_core_copy_task_xfpregs(p, &t->xfpu)) {
> > -   fill_note(&t->notes[2], "LINUX", NT_PRXFPREG, sizeof(t->xfpu),
> > - &t->xfpu);
> > +   fill_note(&t->notes[2], "LINUX", ELF_CORE_XFPREG_TYPE,
> > + sizeof(t->xfpu), &t->xfpu);
> > t->num_notes++;
> > sz += notesize(&t->notes[2]);
> > }
> 
> You've only fixed up one of 4 NT_PRXFPREG uses in the kernel.
> 
> Also, I'm not a fan of your proposed mechanism to "overload" the  
> elf_fpxregset_t.  I'd rather see us introduce a new elf_vecregset_t  
> and have it typedef'd to be elf_fpxregset_t on i386, x86_64, ia64

He's not overloading it, there is no such thing as an elf_fpxregset_t,
unless it's typedef'd to something else by the arch code, eg:

include/asm-i386/elf.h:typedef struct user_fxsr_struct elf_fpxregset_t;
include/asm-ia64/elf.h:typedef unsigned long elf_fpxregset_t;

Introducing another typedef would just be another layer of obfuscation
IMO, and the elf code doesn't need any more of that.

cheers

-- 
Michael Ellerman
OzLabs, IBM Australia Development Lab

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


signature.asc
Description: This is a digitally signed message part
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev

Re: [PATCH v2] Fix regression. Make hot unlplug of CPU0 work again.

2007-10-11 Thread Michael Ellerman
On Thu, 2007-10-11 at 17:30 +1000, Tony Breeds wrote:
> Early in the 2.6.23 cycle we broke the ability to offline cpu0
> (7ccb4a662462616f6be5053e26b79580e02f1529).  This patch fixes that by
> ensuring that the (xics)  default irq server, will not be 0 when taking
> cpu0 offline.
> 
> Also catches a use of irq, when virq should be used (I think that's the
> last one).
> 
> This patch also include the fix from Milton which makes JS21 work
> aswell. In the commit message for that patch Milton writes:
>   xics_set_affinity no longer looks at the cpu_mask arg, instead
>   get_irq_server reads it from the irq descriptor.
> 
> Signed-off-by: Tony Breeds <[EMAIL PROTECTED]>
> Signed-off-by: Milton Miller <[EMAIL PROTECTED]>
> 
> ---
> Milton also says in his patch:
> > A more complete fix might be to pass the cpu_mask struct to get_irq_server,
> > but kernel/irq/manage.c currently sets the descriptor first.
> 
>  arch/powerpc/platforms/pseries/xics.c |   11 ++-
>  1 files changed, 10 insertions(+), 1 deletions(-)
> 
> diff --git a/arch/powerpc/platforms/pseries/xics.c 
> b/arch/powerpc/platforms/pseries/xics.c
> index f0b5ff1..217ae5d 100644
> --- a/arch/powerpc/platforms/pseries/xics.c
> +++ b/arch/powerpc/platforms/pseries/xics.c
> @@ -837,6 +837,15 @@ void xics_migrate_irqs_away(void)
>   /* Allow IPIs again... */
>   xics_set_cpu_priority(cpu, DEFAULT_PRIORITY);
>  
> + /* It would be bad to migrate any IRQs to the CPU we're taking down */
> + if (default_server == cpu) {
> + unsigned int new_server = first_cpu(cpu_online_map);
> +
> + default_server = get_hard_smp_processor_id(new_server);
> + printk(KERN_WARNING "%s: default server was %d, reset to %d\n",
> +__func__, cpu, default_server);

WARNING? It's not like the user can do anything about it.

cheers

-- 
Michael Ellerman
OzLabs, IBM Australia Development Lab

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


signature.asc
Description: This is a digitally signed message part
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev

[PATCH v3] powerpc: Implement logging of unhandled signals

2007-10-11 Thread Olof Johansson
Implement show_unhandled_signals sysctl + support to print when a process
is killed due to unhandled signals just as i386 and x86_64 does.

Default to having it off, unlike x86 that defaults on.

Signed-off-by: Olof Johansson <[EMAIL PROTECTED]>

Index: 2.6.23/arch/powerpc/kernel/traps.c
===
--- 2.6.23.orig/arch/powerpc/kernel/traps.c
+++ 2.6.23/arch/powerpc/kernel/traps.c
@@ -172,11 +172,21 @@ int die(const char *str, struct pt_regs 
 void _exception(int signr, struct pt_regs *regs, int code, unsigned long addr)
 {
siginfo_t info;
+   const char fmt32[] = KERN_INFO "%s[%d]: unhandled signal %d " \
+   "at %08lx nip %08lx lr %08lx code %x\n";
+   const char fmt64[] = KERN_INFO "%s[%d]: unhandled signal %d " \
+   "at %016lx nip %016lx lr %016lx code %x\n";
 
if (!user_mode(regs)) {
if (die("Exception in kernel mode", regs, signr))
return;
-   }
+   } else if (show_unhandled_signals &&
+   unhandled_signal(current, signr) &&
+   printk_ratelimit()) {
+   printk(regs->msr & MSR_SF ? fmt64 : fmt32,
+   current->comm, current->pid, signr,
+   addr, regs->nip, regs->link, code);
+   }
 
memset(&info, 0, sizeof(info));
info.si_signo = signr;
Index: 2.6.23/arch/powerpc/kernel/signal_64.c
===
--- 2.6.23.orig/arch/powerpc/kernel/signal_64.c
+++ 2.6.23/arch/powerpc/kernel/signal_64.c
@@ -64,6 +64,11 @@ struct rt_sigframe {
char abigap[288];
 } __attribute__ ((aligned (16)));
 
+static const char fmt32[] = KERN_INFO \
+   "%s[%d]: bad frame in %s: %08lx nip %08lx lr %08lx\n";
+static const char fmt64[] = KERN_INFO \
+   "%s[%d]: bad frame in %s: %016lx nip %016lx lr %016lx\n";
+
 /*
  * Set up the sigcontext for the signal frame.
  */
@@ -315,6 +320,11 @@ badframe:
printk("badframe in sys_rt_sigreturn, regs=%p uc=%p 
&uc->uc_mcontext=%p\n",
   regs, uc, &uc->uc_mcontext);
 #endif
+   if (show_unhandled_signals && printk_ratelimit())
+   printk(regs->msr & MSR_SF ? fmt64 : fmt32,
+   current->comm, current->pid, "rt_sigreturn",
+   (long)uc, regs->nip, regs->link);
+
force_sig(SIGSEGV, current);
return 0;
 }
@@ -398,6 +408,11 @@ badframe:
printk("badframe in setup_rt_frame, regs=%p frame=%p newsp=%lx\n",
   regs, frame, newsp);
 #endif
+   if (show_unhandled_signals && printk_ratelimit())
+   printk(regs->msr & MSR_SF ? fmt64 : fmt32,
+   current->comm, current->pid, "setup_rt_frame",
+   (long)frame, regs->nip, regs->link);
+
force_sigsegv(signr, current);
return 0;
 }
Index: 2.6.23/kernel/sysctl.c
===
--- 2.6.23.orig/kernel/sysctl.c
+++ 2.6.23/kernel/sysctl.c
@@ -1221,7 +1221,7 @@ static ctl_table fs_table[] = {
 };
 
 static ctl_table debug_table[] = {
-#ifdef CONFIG_X86
+#if defined(CONFIG_X86) || defined(CONFIG_PPC)
{
.ctl_name   = CTL_UNNUMBERED,
.procname   = "exception-trace",
Index: 2.6.23/arch/powerpc/kernel/signal_32.c
===
--- 2.6.23.orig/arch/powerpc/kernel/signal_32.c
+++ 2.6.23/arch/powerpc/kernel/signal_32.c
@@ -705,11 +705,13 @@ int handle_rt_signal32(unsigned long sig
 {
struct rt_sigframe __user *rt_sf;
struct mcontext __user *frame;
+   void __user *addr;
unsigned long newsp = 0;
 
/* Set up Signal Frame */
/* Put a Real Time Context onto stack */
rt_sf = get_sigframe(ka, regs, sizeof(*rt_sf));
+   addr = rt_sf;
if (unlikely(rt_sf == NULL))
goto badframe;
 
@@ -728,6 +730,7 @@ int handle_rt_signal32(unsigned long sig
 
/* Save user registers on the stack */
frame = &rt_sf->uc.uc_mcontext;
+   addr = frame;
if (vdso32_rt_sigtramp && current->mm->context.vdso_base) {
if (save_user_regs(regs, frame, 0))
goto badframe;
@@ -742,6 +745,7 @@ int handle_rt_signal32(unsigned long sig
 
/* create a stack frame for the caller of the handler */
newsp = ((unsigned long)rt_sf) - (__SIGNAL_FRAMESIZE + 16);
+   addr = (void __user *)regs->gpr[1];
if (put_user(regs->gpr[1], (u32 __user *)newsp))
goto badframe;
 
@@ -762,6 +766,12 @@ badframe:
printk("badframe in handle_rt_signal, regs=%p frame=%p newsp=%lx\n",
   regs, frame, newsp);
 #endif
+   if (show_unhandled_signals && printk_ratelimit())
+   printk(KERN_INFO "%s[%d]: bad frame in handle_rt_signal32

Re: [PATCH v3] powerpc: Implement logging of unhandled signals

2007-10-11 Thread Benjamin Herrenschmidt

On Thu, 2007-10-11 at 19:20 -0500, Olof Johansson wrote:
> Implement show_unhandled_signals sysctl + support to print when a process
> is killed due to unhandled signals just as i386 and x86_64 does.
> 
> Default to having it off, unlike x86 that defaults on.

Why ? I'd like it on by default :-)

Ben.

___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: powerpc commits for 2.6.24

2007-10-11 Thread Michael Ellerman
On Thu, 2007-10-11 at 22:30 +1000, Paul Mackerras wrote:
> Below is the list of commits that I plan to ask Linus to pull
> tomorrow.  This is the last call for anything else or for objections
> to any of these commits going in.  These commits are in powerpc.git on
> the master and for-2.6.24 branches.

Anything wrong with my patch "Fail early in lmb_remove_region()", it
generated no comment ..

http://patchwork.ozlabs.org/linuxppc/patch?q=ellerman&id=13883

cheers

-- 
Michael Ellerman
OzLabs, IBM Australia Development Lab

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


signature.asc
Description: This is a digitally signed message part
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev

Re: powerpc commits for 2.6.24

2007-10-11 Thread Paul Mackerras
Michael Ellerman writes:

> Anything wrong with my patch "Fail early in lmb_remove_region()", it
> generated no comment ..

Just seems a little unnecessary given that the function in question is
static, that's all...

Paul.
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [PATCH v3] powerpc: Implement logging of unhandled signals

2007-10-11 Thread Olof Johansson
On Fri, Oct 12, 2007 at 10:21:09AM +1000, Benjamin Herrenschmidt wrote:
> 
> On Thu, 2007-10-11 at 19:20 -0500, Olof Johansson wrote:
> > Implement show_unhandled_signals sysctl + support to print when a process
> > is killed due to unhandled signals just as i386 and x86_64 does.
> > 
> > Default to having it off, unlike x86 that defaults on.
> 
> Why ? I'd like it on by default :-)

Paulus mentioned on IRC that he preferred it that way. I'll leave it up
to the two of you to argue it out. I'd prefer on by default but I don't
really care all that much as long as I can enable it with bootargs.


-Olof
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: powerpc commits for 2.6.24

2007-10-11 Thread Michael Ellerman
On Fri, 2007-10-12 at 10:32 +1000, Paul Mackerras wrote:
> Michael Ellerman writes:
> 
> > Anything wrong with my patch "Fail early in lmb_remove_region()", it
> > generated no comment ..
> 
> Just seems a little unnecessary given that the function in question is
> static, that's all...

Yeah true. I figured it was nice to have it spelled out in the code that
the routine is only valid for certain values of r - but I'm not fussed.

cheers

-- 
Michael Ellerman
OzLabs, IBM Australia Development Lab

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


signature.asc
Description: This is a digitally signed message part
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev

Re: [PATCH 2/2] powerpc: Switch to generic WARN_ON()/BUG_ON()

2007-10-11 Thread Paul Mackerras
Olof Johansson writes:

> Not using the ppc-specific WARN_ON/BUG_ON constructs actually saves about
> 4K text on a ppc64_defconfig. The main reason seems to be that prepping
> the arguments to the conditional trap instructions is more work than
> just doing a compare and branch.

It might be more instructions but it takes fewer cycles, I would
expect.  Do you have the actual instruction sequences to compare?

Paul.
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [patch 1/2] Replace NT_PRXFPREG with ELF_CORE_XFPREG_TYPE #define

2007-10-11 Thread Mark Nelson
Kumar Gala wrote:
> 
> On Oct 11, 2007, at 2:15 AM, [EMAIL PROTECTED] wrote:
> 
>> Replace NT_PRXFPREG with ELF_CORE_XFPREG_TYPE in the coredump code which
>> allows for more flexibility in the note type for the state of 'extended
>> floating point' implementations in coredumps. New note types can now be
>> added with an appropriate #define.
>>
>> #define ELF_CORE_XFPREG_TYPE to be NT_PRXFPREG in all current users so
>> there's are no change in behaviour.
> 
> Can we make this ELF_CORE_VECREG_TYPE or something that is so coupled to
> the x86 specific name?
> 
>>
>> Signed-off-by: Mark Nelson <[EMAIL PROTECTED]>
>> ---
>>  arch/ia64/ia32/elfcore32.h |1 +
>>  arch/x86_64/ia32/ia32_binfmt.c |1 +
>>  fs/binfmt_elf.c|4 ++--
>>  include/asm-i386/elf.h |1 +
>>  4 files changed, 5 insertions(+), 2 deletions(-)
>>
>> Index: linux/arch/ia64/ia32/elfcore32.h
>> ===
>> --- linux.orig/arch/ia64/ia32/elfcore32.h
>> +++ linux/arch/ia64/ia32/elfcore32.h
>> @@ -117,6 +117,7 @@ elf_core_copy_task_fpregs(struct task_st
>>  }
>>
>>  #define ELF_CORE_COPY_XFPREGS 1
>> +#define ELF_CORE_XFPREG_TYPE NT_PRXFPREG
>>  static inline int
>>  elf_core_copy_task_xfpregs(struct task_struct *tsk, elf_fpxregset_t
>> *xfpu)
>>  {
>> Index: linux/arch/x86_64/ia32/ia32_binfmt.c
>> ===
>> --- linux.orig/arch/x86_64/ia32/ia32_binfmt.c
>> +++ linux/arch/x86_64/ia32/ia32_binfmt.c
>> @@ -188,6 +188,7 @@ elf_core_copy_task_fpregs(struct task_st
>>  }
>>
>>  #define ELF_CORE_COPY_XFPREGS 1
>> +#define ELF_CORE_XFPREG_TYPE NT_PRXFPREG
>>  static inline int
>>  elf_core_copy_task_xfpregs(struct task_struct *t, elf_fpxregset_t *xfpu)
>>  {
>> Index: linux/fs/binfmt_elf.c
>> ===
>> --- linux.orig/fs/binfmt_elf.c
>> +++ linux/fs/binfmt_elf.c
>> @@ -1446,8 +1446,8 @@ static int elf_dump_thread_status(long s
>>
>>  #ifdef ELF_CORE_COPY_XFPREGS
>>  if (elf_core_copy_task_xfpregs(p, &t->xfpu)) {
>> -fill_note(&t->notes[2], "LINUX", NT_PRXFPREG, sizeof(t->xfpu),
>> -  &t->xfpu);
>> +fill_note(&t->notes[2], "LINUX", ELF_CORE_XFPREG_TYPE,
>> +  sizeof(t->xfpu), &t->xfpu);
>>  t->num_notes++;
>>  sz += notesize(&t->notes[2]);
>>  }
> 
> You've only fixed up one of 4 NT_PRXFPREG uses in the kernel.

Ooops... Right you are - very good pickup :) Fixed in a new version (will send 
promptly).


Thanks!

Mark.

> 
> Also, I'm not a fan of your proposed mechanism to "overload" the
> elf_fpxregset_t.  I'd rather see us introduce a new elf_vecregset_t and
> have it typedef'd to be elf_fpxregset_t on i386, x86_64, ia64
> 
>> Index: linux/include/asm-i386/elf.h
>> ===
>> --- linux.orig/include/asm-i386/elf.h
>> +++ linux/include/asm-i386/elf.h
>> @@ -129,6 +129,7 @@ extern int dump_task_extended_fpu (struc
>>  #define ELF_CORE_COPY_TASK_REGS(tsk, elf_regs) dump_task_regs(tsk,
>> elf_regs)
>>  #define ELF_CORE_COPY_FPREGS(tsk, elf_fpregs) dump_task_fpu(tsk,
>> elf_fpregs)
>>  #define ELF_CORE_COPY_XFPREGS(tsk, elf_xfpregs)
>> dump_task_extended_fpu(tsk, elf_xfpregs)
>> +#define ELF_CORE_XFPREG_TYPE NT_PRXFPREG
>>
>>  #define VDSO_HIGH_BASE(__fix_to_virt(FIX_VDSO))
>>  #define VDSO_CURRENT_BASE((unsigned long)current->mm->context.vdso)
>>
>> -- 
>> ___
>> Linuxppc-dev mailing list
>> Linuxppc-dev@ozlabs.org
>> https://ozlabs.org/mailman/listinfo/linuxppc-dev
> 

___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


[PATCH 1/2] [V2] Replace NT_PRXFPREG with ELF_CORE_XFPREG_TYPE #define

2007-10-11 Thread Mark Nelson
Replace NT_PRXFPREG with ELF_CORE_XFPREG_TYPE in the coredump code which
allows for more flexibility in the note type for the state of 'extended
floating point' implementations in coredumps.  New note types can now be
added with an appropriate #define.

This does #define ELF_CORE_XFPREG_TYPE to be NT_PRXFPREG in all
current users so there's are no change in behaviour.

This will let us use different note types on powerpc for the
Altivec/VMX state that some PowerPC cpus have (G4, PPC970, POWER6) and
for the SPE (signal processing extension) state that some embedded
PowerPC cpus from Freescale have.

Signed-off-by: Mark Nelson <[EMAIL PROTECTED]>
---
 arch/ia64/ia32/elfcore32.h |1 +
 arch/x86_64/ia32/ia32_binfmt.c |1 +
 fs/binfmt_elf.c|8 
 fs/binfmt_elf_fdpic.c  |6 +++---
 include/asm-i386/elf.h |1 +
 5 files changed, 10 insertions(+), 7 deletions(-)

Index: linux/arch/ia64/ia32/elfcore32.h
===
--- linux.orig/arch/ia64/ia32/elfcore32.h
+++ linux/arch/ia64/ia32/elfcore32.h
@@ -117,6 +117,7 @@ elf_core_copy_task_fpregs(struct task_st
 }
 
 #define ELF_CORE_COPY_XFPREGS 1
+#define ELF_CORE_XFPREG_TYPE NT_PRXFPREG
 static inline int
 elf_core_copy_task_xfpregs(struct task_struct *tsk, elf_fpxregset_t *xfpu)
 {
Index: linux/arch/x86_64/ia32/ia32_binfmt.c
===
--- linux.orig/arch/x86_64/ia32/ia32_binfmt.c
+++ linux/arch/x86_64/ia32/ia32_binfmt.c
@@ -188,6 +188,7 @@ elf_core_copy_task_fpregs(struct task_st
 }
 
 #define ELF_CORE_COPY_XFPREGS 1
+#define ELF_CORE_XFPREG_TYPE NT_PRXFPREG
 static inline int 
 elf_core_copy_task_xfpregs(struct task_struct *t, elf_fpxregset_t *xfpu)
 {
Index: linux/fs/binfmt_elf.c
===
--- linux.orig/fs/binfmt_elf.c
+++ linux/fs/binfmt_elf.c
@@ -1411,7 +1411,7 @@ struct elf_thread_status
elf_fpregset_t fpu; /* NT_PRFPREG */
struct task_struct *thread;
 #ifdef ELF_CORE_COPY_XFPREGS
-   elf_fpxregset_t xfpu;   /* NT_PRXFPREG */
+   elf_fpxregset_t xfpu;   /* ELF_CORE_XFPREG_TYPE */
 #endif
struct memelfnote notes[3];
int num_notes;
@@ -1446,8 +1446,8 @@ static int elf_dump_thread_status(long s
 
 #ifdef ELF_CORE_COPY_XFPREGS
if (elf_core_copy_task_xfpregs(p, &t->xfpu)) {
-   fill_note(&t->notes[2], "LINUX", NT_PRXFPREG, sizeof(t->xfpu),
- &t->xfpu);
+   fill_note(&t->notes[2], "LINUX", ELF_CORE_XFPREG_TYPE,
+ sizeof(t->xfpu), &t->xfpu);
t->num_notes++;
sz += notesize(&t->notes[2]);
}
@@ -1624,7 +1624,7 @@ static int elf_core_dump(long signr, str
 #ifdef ELF_CORE_COPY_XFPREGS
if (elf_core_copy_task_xfpregs(current, xfpu))
fill_note(notes + numnote++,
- "LINUX", NT_PRXFPREG, sizeof(*xfpu), xfpu);
+ "LINUX", ELF_CORE_XFPREG_TYPE, sizeof(*xfpu), xfpu);
 #endif 
   
fs = get_fs();
Index: linux/fs/binfmt_elf_fdpic.c
===
--- linux.orig/fs/binfmt_elf_fdpic.c
+++ linux/fs/binfmt_elf_fdpic.c
@@ -1417,7 +1417,7 @@ struct elf_thread_status
elf_fpregset_t fpu; /* NT_PRFPREG */
struct task_struct *thread;
 #ifdef ELF_CORE_COPY_XFPREGS
-   elf_fpxregset_t xfpu;   /* NT_PRXFPREG */
+   elf_fpxregset_t xfpu;   /* ELF_CORE_XFPREG_TYPE */
 #endif
struct memelfnote notes[3];
int num_notes;
@@ -1453,7 +1453,7 @@ static int elf_dump_thread_status(long s
 
 #ifdef ELF_CORE_COPY_XFPREGS
if (elf_core_copy_task_xfpregs(p, &t->xfpu)) {
-   fill_note(&t->notes[2], "LINUX", NT_PRXFPREG, sizeof(t->xfpu),
+   fill_note(&t->notes[2], "LINUX", ELF_CORE_XFPREG_TYPE, 
sizeof(t->xfpu),
  &t->xfpu);
t->num_notes++;
sz += notesize(&t->notes[2]);
@@ -1690,7 +1690,7 @@ static int elf_fdpic_core_dump(long sign
 #ifdef ELF_CORE_COPY_XFPREGS
if (elf_core_copy_task_xfpregs(current, xfpu))
fill_note(notes + numnote++,
- "LINUX", NT_PRXFPREG, sizeof(*xfpu), xfpu);
+ "LINUX", ELF_CORE_XFPREG_TYPE, sizeof(*xfpu), xfpu);
 #endif
 
fs = get_fs();
Index: linux/include/asm-i386/elf.h
===
--- linux.orig/include/asm-i386/elf.h
+++ linux/include/asm-i386/elf.h
@@ -129,6 +129,7 @@ extern int dump_task_extended_fpu (struc
 #define ELF_CORE_COPY_TASK_REGS(tsk, elf_regs) dump_task_regs(tsk, elf_regs)
 #define ELF_CORE_COPY_FPREGS(tsk, elf_fpregs) dump_task_fpu(tsk, elf_fpregs)
 #define ELF_CORE_COPY_XFPREGS(tsk, elf_xfpregs) dump_task_extended_fpu(tsk, 
elf_xfpregs)
+#define ELF

Re: [PATCH 2/2] powerpc: Switch to generic WARN_ON()/BUG_ON()

2007-10-11 Thread Olof Johansson
On Fri, Oct 12, 2007 at 11:23:39AM +1000, Paul Mackerras wrote:
> Olof Johansson writes:
> 
> > Not using the ppc-specific WARN_ON/BUG_ON constructs actually saves about
> > 4K text on a ppc64_defconfig. The main reason seems to be that prepping
> > the arguments to the conditional trap instructions is more work than
> > just doing a compare and branch.
> 
> It might be more instructions but it takes fewer cycles, I would
> expect.  Do you have the actual instruction sequences to compare?

Sure. Just looking at a couple of cases:

On range comparisons such as (a < CONST):
* without this patch, you end up with a comparison, then a cr-to-cr op +
mfcr + mask operation + tdnei.
* with the patch, you get a comparison and a conditional branch with
twi out of line.

On multiple comparisons like WARN_ON( a || b), it seems that there's an
added li to make the tdnei always hit for the first case. There it uses
a regular conditional branch, so no real difference in generated code
besides that.

Code examples. This was with a ppc64_defconfig, so CONFIG_POWER4_ONLY
wasn't enabled. It uses mfocrf when it is, which is alot cheaper. Still,
the rest of the code sequence is the same:

void irq_free_virt(unsigned int virq, unsigned int count)
{
unsigned long flags;
unsigned int i;

WARN_ON (virq < NUM_ISA_INTERRUPTS);
WARN_ON (count == 0 || (virq + count) > irq_virq_count);

spin_lock_irqsave(&irq_big_lock, flags);

Without the patch:

c000b33c <.irq_free_virt>:
c000b33c:   7c 08 02 a6 mflrr0
c000b340:   2b 83 00 0f cmplwi  cr7,r3,15
c000b344:   fb c1 ff f0 std r30,-16(r1)
c000b348:   fb e1 ff f8 std r31,-8(r1)
c000b34c:   7c 9e 23 78 mr  r30,r4
c000b350:   7c 7f 1b 78 mr  r31,r3
c000b354:   4f dd e8 42 crnot   4*cr7+eq,4*cr7+gt
c000b358:   f8 01 00 10 std r0,16(r1)
c000b35c:   f8 21 ff 81 stdur1,-128(r1)
c000b360:   7c 00 00 26 mfcrr0
c000b364:   54 00 ff fe rlwinm  r0,r0,31,31,31
c000b368:   0b 00 00 00 tdnei   r0,0
c000b36c:   2f a4 00 00 cmpdi   cr7,r4,0
c000b370:   38 00 00 01 li  r0,1
c000b374:   41 9e 00 1c beq cr7,c000b390 
<.irq_free_virt+0x54>
c000b378:   e9 22 80 d8 ld  r9,-32552(r2)
c000b37c:   7d 63 22 14 add r11,r3,r4
c000b380:   80 09 00 00 lwz r0,0(r9)
c000b384:   7f 8b 00 40 cmplw   cr7,r11,r0
c000b388:   7c 00 00 26 mfcrr0
c000b38c:   54 00 f7 fe rlwinm  r0,r0,30,31,31
c000b390:   0b 00 00 00 tdnei   r0,0
c000b394:   e8 62 80 f8 ld  r3,-32520(r2)
c000b398:   48 54 4c b1 bl  c0550048 
<._spin_lock_irqsave>
c000b39c:   60 00 00 00 nop

With the patch:

c000b0b0 <.irq_free_virt>:
c000b0b0:   7c 08 02 a6 mflrr0
c000b0b4:   2b 83 00 0f cmplwi  cr7,r3,15
c000b0b8:   fb c1 ff f0 std r30,-16(r1)
c000b0bc:   fb e1 ff f8 std r31,-8(r1)
c000b0c0:   7c 9e 23 78 mr  r30,r4
c000b0c4:   7c 7f 1b 78 mr  r31,r3
c000b0c8:   f8 01 00 10 std r0,16(r1)
c000b0cc:   f8 21 ff 81 stdur1,-128(r1)
c000b0d0:   41 bd 00 08 bgt cr7,c000b0d8 
<.irq_free_virt+0x28>
c000b0d4:   0f e0 00 00 twi 31,r0,0
c000b0d8:   2f be 00 00 cmpdi   cr7,r30,0
c000b0dc:   41 9e 00 18 beq cr7,c000b0f4 
<.irq_free_virt+0x44>
c000b0e0:   e9 22 80 d8 ld  r9,-32552(r2)
c000b0e4:   7d 7f f2 14 add r11,r31,r30
c000b0e8:   80 09 00 00 lwz r0,0(r9)
c000b0ec:   7f 8b 00 40 cmplw   cr7,r11,r0
c000b0f0:   40 bd 00 08 ble cr7,c000b0f8 
<.irq_free_virt+0x48>
c000b0f4:   0f e0 00 00 twi 31,r0,0
c000b0f8:   e8 62 80 f8 ld  r3,-32520(r2)
c000b0fc:   48 54 3f 75 bl  c054f070 
<._spin_lock_irqsave>
c000b100:   60 00 00 00 nop
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [PATCH 2/2] powerpc: Switch to generic WARN_ON()/BUG_ON()

2007-10-11 Thread Olof Johansson
On Thu, Oct 11, 2007 at 10:04:19PM -0400, Kyle McMartin wrote:
> On Fri, Oct 12, 2007 at 11:23:39AM +1000, Paul Mackerras wrote:
> > Olof Johansson writes:
> > 
> > > Not using the ppc-specific WARN_ON/BUG_ON constructs actually saves about
> > > 4K text on a ppc64_defconfig. The main reason seems to be that prepping
> > > the arguments to the conditional trap instructions is more work than
> > > just doing a compare and branch.
> > 
> > It might be more instructions but it takes fewer cycles, I would
> > expect.  Do you have the actual instruction sequences to compare?
> > 
> 
> I really hope WARN_ON/BUG_ON aren't hotpaths on powerpc. ;-)

Not the taken branch of them, no. :)  But making it past them as fast
as possible when they're not tripping is always good.


-Olof
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: powerpc commits for 2.6.24

2007-10-11 Thread David Gibson
One more for you.  This is preparation for the libfdt merge.

Add memchr() to the bootwrapper

This patch adds a memchr() implementation to the bootwrapper.  libfdt
will need this.

Signed-off-by: David Gibson <[EMAIL PROTECTED]>

Index: working-2.6/arch/powerpc/boot/string.S
===
--- working-2.6.orig/arch/powerpc/boot/string.S 2007-09-27 18:36:21.0 
+1000
+++ working-2.6/arch/powerpc/boot/string.S  2007-09-27 18:40:24.0 
+1000
@@ -219,6 +219,19 @@ backwards_memcpy:
mtctr   r7
b   1b
 
+   .globl  memchr
+memchr:
+   cmpwi   0,r5,0
+   blelr
+   mtctr   r5
+   addir3,r3,-1
+1: lbzur0,1(r3)
+   cmpwr0,r4
+   beqlr
+   bdnz1b
+   li  r3,0
+   blr
+
.globl  memcmp
 memcmp:
cmpwi   0,r5,0
Index: working-2.6/arch/powerpc/boot/string.h
===
--- working-2.6.orig/arch/powerpc/boot/string.h 2007-09-27 18:40:27.0 
+1000
+++ working-2.6/arch/powerpc/boot/string.h  2007-09-27 18:40:58.0 
+1000
@@ -14,6 +14,7 @@ extern size_t strnlen(const char *s, siz
 extern void *memset(void *s, int c, size_t n);
 extern void *memmove(void *dest, const void *src, unsigned long n);
 extern void *memcpy(void *dest, const void *src, unsigned long n);
+extern void *memchr(const void *s, int c, size_t n);
 extern int memcmp(const void *s1, const void *s2, size_t n);
 
 #endif /* _PPC_BOOT_STRING_H_ */


-- 
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
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [PATCH] PowerPC: Fix find_legacy_serial_ports on OPB.

2007-10-11 Thread David Gibson
On Thu, Oct 11, 2007 at 01:31:53PM -0500, Josh Boyer wrote:
> On Thu, 2007-10-11 at 21:26 +0400, Valentine Barshak wrote:
> > Josh Boyer wrote:
> > > On Thu, 2007-10-11 at 17:50 +0200, Arnd Bergmann wrote:
> > >> On Thursday 11 October 2007, Valentine Barshak wrote:
> > >>> Currently find_legacy_serial_ports() can find no serial ports on the 
> > >>> OPB.
> > >>> Thus no legacy boot console can be initialized. Just the early udbg 
> > >>> console
> > >>> works, which is initialized with udbg_init_44x_as1() on the UART's 
> > >>> physical
> > >>> address specified in kernel config. This happens because we look for 
> > >>> ns16750
> > >>> and higher serial devices only and expect opb node to have a device type
> > >>> property. This patch makes it look for ns16550 compatible devices and 
> > >>> use
> > >>> of_device_is_compatible() for opb instead of checking device type.
> > >>> Lack of legacy serial ports found causes problems for KGDB over serial.
> > >>>
> > >>> Signed-off-by: Valentine Barshak <[EMAIL PROTECTED]>
> > >> The patch would make sense if we were only dealing with flattened device
> > >> tree systems at this point. Unfortunately, IBM is shipping hardware that
> > >> encodes the serial port in exactly the way that find_legacy_serial_ports
> > >> is looking for (parent->type == "opb", compatible = "ns16750" "ns16550"
> > >> "ns16450" i8250").
> > >>
> > >> Changing the search for ns16750 to ns16550 should be fine, but 
> > >> unnecessary
> > >> because AFAIK, all OPB serial imlpementations are actually ns16750 and
> > >> should have that in the device tree as well.
> > >>
> > >> For the device type of the bus, please check for both compatible and
> > >> type, so that it still works on machines that are missing the compatible
> > >> property.
> > > 
> > > Wait, no.  We already had this discussion months ago when David was
> > > working on the original Ebony port.  It was declared that legacy_serial
> > > is not how serial should be done on 4xx and the serial_of driver was
> > > supposed to be used instead.
> > > 
> > > Have we changed our stance on that?  If not, then perhaps KGDB should be
> > > fixed to work with serial_of.
> > 
> > Actually I don't see any reason not to use legacy_serial stuff for early 
> > console. We could split the kernel configured very early debug output, 
> > which uses  PPC_EARLY_DEBUG_44x_PHYSLOW/PHYSHIGH (since it's really 
> > dangerous) and early console things by using legacy serial. We could use 
> >   early boot console without PPC_EARLY_DEBUG_44x.
> 
> That was exactly my thinking when this first came up.  I'd like to hear
> David's opinion on it.

Yeah, I think I misinterpreted BenH way back when.  This looks ok, and
means serial will be initialized earlier than of_serial, which would
be nice.

-- 
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
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [PATCH 1/2] [V2] Replace NT_PRXFPREG with ELF_CORE_XFPREG_TYPE #define

2007-10-11 Thread Mark Nelson
Sorry for the patch noise but please disregard this patch - a line is longer 
than 80 characters and I'd hate to be brought up on that...

V3 will be the perfect version then :)


Thanks and apologies again!

Mark.

Mark Nelson wrote:
> Replace NT_PRXFPREG with ELF_CORE_XFPREG_TYPE in the coredump code which
> allows for more flexibility in the note type for the state of 'extended
> floating point' implementations in coredumps.  New note types can now be
> added with an appropriate #define.
> 
> This does #define ELF_CORE_XFPREG_TYPE to be NT_PRXFPREG in all
> current users so there's are no change in behaviour.
> 
> This will let us use different note types on powerpc for the
> Altivec/VMX state that some PowerPC cpus have (G4, PPC970, POWER6) and
> for the SPE (signal processing extension) state that some embedded
> PowerPC cpus from Freescale have.
> 
> Signed-off-by: Mark Nelson <[EMAIL PROTECTED]>
> ---
>  arch/ia64/ia32/elfcore32.h |1 +
>  arch/x86_64/ia32/ia32_binfmt.c |1 +
>  fs/binfmt_elf.c|8 
>  fs/binfmt_elf_fdpic.c  |6 +++---
>  include/asm-i386/elf.h |1 +
>  5 files changed, 10 insertions(+), 7 deletions(-)
> 
> Index: linux/arch/ia64/ia32/elfcore32.h
> ===
> --- linux.orig/arch/ia64/ia32/elfcore32.h
> +++ linux/arch/ia64/ia32/elfcore32.h
> @@ -117,6 +117,7 @@ elf_core_copy_task_fpregs(struct task_st
>  }
>  
>  #define ELF_CORE_COPY_XFPREGS 1
> +#define ELF_CORE_XFPREG_TYPE NT_PRXFPREG
>  static inline int
>  elf_core_copy_task_xfpregs(struct task_struct *tsk, elf_fpxregset_t *xfpu)
>  {
> Index: linux/arch/x86_64/ia32/ia32_binfmt.c
> ===
> --- linux.orig/arch/x86_64/ia32/ia32_binfmt.c
> +++ linux/arch/x86_64/ia32/ia32_binfmt.c
> @@ -188,6 +188,7 @@ elf_core_copy_task_fpregs(struct task_st
>  }
>  
>  #define ELF_CORE_COPY_XFPREGS 1
> +#define ELF_CORE_XFPREG_TYPE NT_PRXFPREG
>  static inline int 
>  elf_core_copy_task_xfpregs(struct task_struct *t, elf_fpxregset_t *xfpu)
>  {
> Index: linux/fs/binfmt_elf.c
> ===
> --- linux.orig/fs/binfmt_elf.c
> +++ linux/fs/binfmt_elf.c
> @@ -1411,7 +1411,7 @@ struct elf_thread_status
>   elf_fpregset_t fpu; /* NT_PRFPREG */
>   struct task_struct *thread;
>  #ifdef ELF_CORE_COPY_XFPREGS
> - elf_fpxregset_t xfpu;   /* NT_PRXFPREG */
> + elf_fpxregset_t xfpu;   /* ELF_CORE_XFPREG_TYPE */
>  #endif
>   struct memelfnote notes[3];
>   int num_notes;
> @@ -1446,8 +1446,8 @@ static int elf_dump_thread_status(long s
>  
>  #ifdef ELF_CORE_COPY_XFPREGS
>   if (elf_core_copy_task_xfpregs(p, &t->xfpu)) {
> - fill_note(&t->notes[2], "LINUX", NT_PRXFPREG, sizeof(t->xfpu),
> -   &t->xfpu);
> + fill_note(&t->notes[2], "LINUX", ELF_CORE_XFPREG_TYPE,
> +   sizeof(t->xfpu), &t->xfpu);
>   t->num_notes++;
>   sz += notesize(&t->notes[2]);
>   }
> @@ -1624,7 +1624,7 @@ static int elf_core_dump(long signr, str
>  #ifdef ELF_CORE_COPY_XFPREGS
>   if (elf_core_copy_task_xfpregs(current, xfpu))
>   fill_note(notes + numnote++,
> -   "LINUX", NT_PRXFPREG, sizeof(*xfpu), xfpu);
> +   "LINUX", ELF_CORE_XFPREG_TYPE, sizeof(*xfpu), xfpu);
>  #endif   
>
>   fs = get_fs();
> Index: linux/fs/binfmt_elf_fdpic.c
> ===
> --- linux.orig/fs/binfmt_elf_fdpic.c
> +++ linux/fs/binfmt_elf_fdpic.c
> @@ -1417,7 +1417,7 @@ struct elf_thread_status
>   elf_fpregset_t fpu; /* NT_PRFPREG */
>   struct task_struct *thread;
>  #ifdef ELF_CORE_COPY_XFPREGS
> - elf_fpxregset_t xfpu;   /* NT_PRXFPREG */
> + elf_fpxregset_t xfpu;   /* ELF_CORE_XFPREG_TYPE */
>  #endif
>   struct memelfnote notes[3];
>   int num_notes;
> @@ -1453,7 +1453,7 @@ static int elf_dump_thread_status(long s
>  
>  #ifdef ELF_CORE_COPY_XFPREGS
>   if (elf_core_copy_task_xfpregs(p, &t->xfpu)) {
> - fill_note(&t->notes[2], "LINUX", NT_PRXFPREG, sizeof(t->xfpu),
> + fill_note(&t->notes[2], "LINUX", ELF_CORE_XFPREG_TYPE, 
> sizeof(t->xfpu),

the line above is the offender...

> &t->xfpu);
>   t->num_notes++;
>   sz += notesize(&t->notes[2]);
> @@ -1690,7 +1690,7 @@ static int elf_fdpic_core_dump(long sign
>  #ifdef ELF_CORE_COPY_XFPREGS
>   if (elf_core_copy_task_xfpregs(current, xfpu))
>   fill_note(notes + numnote++,
> -   "LINUX", NT_PRXFPREG, sizeof(*xfpu), xfpu);
> +   "LINUX", ELF_CORE_XFPREG_TYPE, sizeof(*xfpu), xfpu);
>  #endif
>  
>   fs = get_fs();
> Index: linux/include/asm-i386/elf.h
> 

[PATCH 1/2] [V3] Replace NT_PRXFPREG with ELF_CORE_XFPREG_TYPE #define

2007-10-11 Thread Mark Nelson
Replace NT_PRXFPREG with ELF_CORE_XFPREG_TYPE in the coredump code which
allows for more flexibility in the note type for the state of 'extended
floating point' implementations in coredumps.  New note types can now be
added with an appropriate #define.

This does #define ELF_CORE_XFPREG_TYPE to be NT_PRXFPREG in all
current users so there's are no change in behaviour.

This will let us use different note types on powerpc for the
Altivec/VMX state that some PowerPC cpus have (G4, PPC970, POWER6) and
for the SPE (signal processing extension) state that some embedded
PowerPC cpus from Freescale have.

Signed-off-by: Mark Nelson <[EMAIL PROTECTED]>
---
 arch/ia64/ia32/elfcore32.h |1 +
 arch/x86_64/ia32/ia32_binfmt.c |1 +
 fs/binfmt_elf.c|8 
 fs/binfmt_elf_fdpic.c  |8 
 include/asm-i386/elf.h |1 +
 5 files changed, 11 insertions(+), 8 deletions(-)

Index: linux/arch/ia64/ia32/elfcore32.h
===
--- linux.orig/arch/ia64/ia32/elfcore32.h
+++ linux/arch/ia64/ia32/elfcore32.h
@@ -117,6 +117,7 @@ elf_core_copy_task_fpregs(struct task_st
 }
 
 #define ELF_CORE_COPY_XFPREGS 1
+#define ELF_CORE_XFPREG_TYPE NT_PRXFPREG
 static inline int
 elf_core_copy_task_xfpregs(struct task_struct *tsk, elf_fpxregset_t *xfpu)
 {
Index: linux/arch/x86_64/ia32/ia32_binfmt.c
===
--- linux.orig/arch/x86_64/ia32/ia32_binfmt.c
+++ linux/arch/x86_64/ia32/ia32_binfmt.c
@@ -188,6 +188,7 @@ elf_core_copy_task_fpregs(struct task_st
 }
 
 #define ELF_CORE_COPY_XFPREGS 1
+#define ELF_CORE_XFPREG_TYPE NT_PRXFPREG
 static inline int 
 elf_core_copy_task_xfpregs(struct task_struct *t, elf_fpxregset_t *xfpu)
 {
Index: linux/fs/binfmt_elf.c
===
--- linux.orig/fs/binfmt_elf.c
+++ linux/fs/binfmt_elf.c
@@ -1411,7 +1411,7 @@ struct elf_thread_status
elf_fpregset_t fpu; /* NT_PRFPREG */
struct task_struct *thread;
 #ifdef ELF_CORE_COPY_XFPREGS
-   elf_fpxregset_t xfpu;   /* NT_PRXFPREG */
+   elf_fpxregset_t xfpu;   /* ELF_CORE_XFPREG_TYPE */
 #endif
struct memelfnote notes[3];
int num_notes;
@@ -1446,8 +1446,8 @@ static int elf_dump_thread_status(long s
 
 #ifdef ELF_CORE_COPY_XFPREGS
if (elf_core_copy_task_xfpregs(p, &t->xfpu)) {
-   fill_note(&t->notes[2], "LINUX", NT_PRXFPREG, sizeof(t->xfpu),
- &t->xfpu);
+   fill_note(&t->notes[2], "LINUX", ELF_CORE_XFPREG_TYPE,
+ sizeof(t->xfpu), &t->xfpu);
t->num_notes++;
sz += notesize(&t->notes[2]);
}
@@ -1624,7 +1624,7 @@ static int elf_core_dump(long signr, str
 #ifdef ELF_CORE_COPY_XFPREGS
if (elf_core_copy_task_xfpregs(current, xfpu))
fill_note(notes + numnote++,
- "LINUX", NT_PRXFPREG, sizeof(*xfpu), xfpu);
+ "LINUX", ELF_CORE_XFPREG_TYPE, sizeof(*xfpu), xfpu);
 #endif 
   
fs = get_fs();
Index: linux/fs/binfmt_elf_fdpic.c
===
--- linux.orig/fs/binfmt_elf_fdpic.c
+++ linux/fs/binfmt_elf_fdpic.c
@@ -1417,7 +1417,7 @@ struct elf_thread_status
elf_fpregset_t fpu; /* NT_PRFPREG */
struct task_struct *thread;
 #ifdef ELF_CORE_COPY_XFPREGS
-   elf_fpxregset_t xfpu;   /* NT_PRXFPREG */
+   elf_fpxregset_t xfpu;   /* ELF_CORE_XFPREG_TYPE */
 #endif
struct memelfnote notes[3];
int num_notes;
@@ -1453,8 +1453,8 @@ static int elf_dump_thread_status(long s
 
 #ifdef ELF_CORE_COPY_XFPREGS
if (elf_core_copy_task_xfpregs(p, &t->xfpu)) {
-   fill_note(&t->notes[2], "LINUX", NT_PRXFPREG, sizeof(t->xfpu),
- &t->xfpu);
+   fill_note(&t->notes[2], "LINUX", ELF_CORE_XFPREG_TYPE,
+ sizeof(t->xfpu), &t->xfpu);
t->num_notes++;
sz += notesize(&t->notes[2]);
}
@@ -1690,7 +1690,7 @@ static int elf_fdpic_core_dump(long sign
 #ifdef ELF_CORE_COPY_XFPREGS
if (elf_core_copy_task_xfpregs(current, xfpu))
fill_note(notes + numnote++,
- "LINUX", NT_PRXFPREG, sizeof(*xfpu), xfpu);
+ "LINUX", ELF_CORE_XFPREG_TYPE, sizeof(*xfpu), xfpu);
 #endif
 
fs = get_fs();
Index: linux/include/asm-i386/elf.h
===
--- linux.orig/include/asm-i386/elf.h
+++ linux/include/asm-i386/elf.h
@@ -129,6 +129,7 @@ extern int dump_task_extended_fpu (struc
 #define ELF_CORE_COPY_TASK_REGS(tsk, elf_regs) dump_task_regs(tsk, elf_regs)
 #define ELF_CORE_COPY_FPREGS(tsk, elf_fpregs) dump_task_fpu(tsk, elf_fpregs)
 #define ELF_CORE_COPY_XFPREGS(tsk, elf_xfpregs) dump_t

Re: [PATCH] [POWERPC] Use PAGE_OFFSET to tell if an address is user/kernel in SW TLB handlers

2007-10-11 Thread David Gibson
On Thu, Oct 11, 2007 at 01:42:30PM -0500, Kumar Gala wrote:
> Move to using PAGE_OFFSET instead of TASK_SIZE or KERNELBASE value on
> 6xx/40x/44x/fsl-booke to determine if the faulting address is a kernel or
> user space address.  This mimics how the macro is_kernel_addr()
> works.

Actually it's ambiguous whether TASK_SIZE or PAGE_OFFSET is correct in
most of these cases (KERNELBASE is certainly wrong, though).

TASK_SIZE is the top of the userspace mapped area, PAGE_OFFSET is the
bottom of the linear mapping.  So, strictly speaking there are 3 paths
for the miss handlers: < TASK_SIZE => user mapping, >= PAGE_OFFSET =>
kernel mapping, between the two => immediate fault.

We get away with a two way comparison on 32-bit because, a) they have
the same value and b) none of the pagetables, user or kernel, should
have any entries in the in between region so we'll end up in
do_page_fault in the end, anyway.

-- 
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
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [PATCH 4/4 v2] [POWERPC] Kilauea defconfig file

2007-10-11 Thread David Gibson
On Thu, Oct 11, 2007 at 04:13:39PM -0500, Josh Boyer wrote:
> On Thu, 2007-10-11 at 15:12 -0500, Scott Wood wrote:
> > On Thu, Oct 11, 2007 at 03:31:12PM +0200, Stefan Roese wrote:
> > > Yes, good catch. Since I'm not using the bootwrapper, I should be able to 
> > > get 
> > > rid of WANT_DEVICE_TREE too. But it seems to be autoselected in 
> > > arch/powerpc/platforms/Kconfig.cputype for 40x and most other "embedded" 
> > > CPU's. Any idea why this is the case?
> > 
> > Probably copying from 83xx, 85xx, etc, which set it on the entire CPU family
> > because there's a wrapper platform that covers the entire family.  AFAICT,
> > there are only board wrappers for 4xx, so individual boards should be
> > selecting WANT_DEVICE_TREE.
> 
> Probably.  Seems somewhat redundant at this point to move it into the
> individual board options though.
> 
> > In any case, you can just set DEVICE_TREE to an empty string if you only
> > want the regular uImage.
> 
> Well, he wants the raw uImage, and a separate DTB to be spit out as far
> as I can tell.  So we don't want an empty string here, but what's there
> currently doesn't do the latter part either.

I think it should be DEVICE_TREE="kilauea.dts".  DEVICE_TREE will
actually be ignored for building the uImage in any case, but this way
it will be correct if we ever do add a cuboot or other dtb-requiring
bootwrapper for Kilauea.

This is, of course, why CONFIG_DEVICE_TREE makes no real sense and
never has: it's a per-image, not a per-configuration variable.

-- 
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
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


  1   2   >