Re: [PATCH] powerpc: fix i2c device string format
Guennadi Liakhovetski writes: > On Thu, 9 Aug 2007, Segher Boessenkool wrote: > > > > > strncpy() won't put a terminating zero on there, is everything > > > > that uses the resulting string okay with that? Also, if the > > > > name gets cut short, it might match some _other_ expected name. > > > > > > On Wed, 1 Aug 2007, Scott Wood wrote: > > > > > > > You could use strlcpy() instead, which always leaves a zero terminator. > > > > > > The patch below does exactly this - uses strlcpy() to guarantee strings in > > > i2c device type and driver_name fields are 0-terminated. > > > > You're not checking the return values of these calls. This would > > be a good function to put attribute warn_unused_result on :-) > > hm... Well, the worst that could happen, if an "evil" programmer defines > too long a name, it gets truncated, and then binds to a wrong driver, > well, the worst that can happen is that your hardware gets damaged, not a > big thing. However, some might disagree, so, below is a new version... > Wrap some long lines while at that. That's not a commit message I can use. Please repost with an informative commit message that says what the motivation for the change is, plus anything other information that would be useful for someone looking at this in a couple of years' time. Paul. ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev
[PATCH] [POWERPC] Comment out a currently unused function
Signed-off-by: Stephen Rothwell <[EMAIL PROTECTED]> --- drivers/macintosh/windfarm_smu_sat.c |2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) -- Cheers, Stephen Rothwell[EMAIL PROTECTED] diff --git a/drivers/macintosh/windfarm_smu_sat.c b/drivers/macintosh/windfarm_smu_sat.c index 351982b..f449d77 100644 --- a/drivers/macintosh/windfarm_smu_sat.c +++ b/drivers/macintosh/windfarm_smu_sat.c @@ -380,10 +380,12 @@ static int __init sat_sensors_init(void) return i2c_add_driver(&wf_sat_driver); } +#if 0 /* uncomment when module_exit() below is uncommented */ static void __exit sat_sensors_exit(void) { i2c_del_driver(&wf_sat_driver); } +#endif module_init(sat_sensors_init); /*module_exit(sat_sensors_exit); Uncomment when cleanup is implemented */ -- 1.5.2.4 ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev
[PATCH] [POWERPC] tidy up CONFIG_PPC_MM_SLICES code
This removes some of the #ifdefs from .c files. Signed-off-by: Stephen Rothwell <[EMAIL PROTECTED]> --- arch/powerpc/mm/hash_utils_64.c |6 -- arch/powerpc/mm/mmu_context_64.c |8 +--- include/asm-powerpc/page_64.h|7 +++ 3 files changed, 8 insertions(+), 13 deletions(-) -- Cheers, Stephen Rothwell[EMAIL PROTECTED] diff --git a/arch/powerpc/mm/hash_utils_64.c b/arch/powerpc/mm/hash_utils_64.c index f178957..c42741f 100644 --- a/arch/powerpc/mm/hash_utils_64.c +++ b/arch/powerpc/mm/hash_utils_64.c @@ -602,13 +602,7 @@ static void demote_segment_4k(struct mm_struct *mm, unsigned long addr) { if (mm->context.user_psize == MMU_PAGE_4K) return; -#ifdef CONFIG_PPC_MM_SLICES slice_set_user_psize(mm, MMU_PAGE_4K); -#else /* CONFIG_PPC_MM_SLICES */ - mm->context.user_psize = MMU_PAGE_4K; - mm->context.sllp = SLB_VSID_USER | mmu_psize_defs[MMU_PAGE_4K].sllp; -#endif /* CONFIG_PPC_MM_SLICES */ - #ifdef CONFIG_SPU_BASE spu_flush_all_slbs(mm); #endif diff --git a/arch/powerpc/mm/mmu_context_64.c b/arch/powerpc/mm/mmu_context_64.c index 901ea76..1db38ba 100644 --- a/arch/powerpc/mm/mmu_context_64.c +++ b/arch/powerpc/mm/mmu_context_64.c @@ -49,18 +49,12 @@ again: return -ENOMEM; } -#ifdef CONFIG_PPC_MM_SLICES /* The old code would re-promote on fork, we don't do that * when using slices as it could cause problem promoting slices * that have been forced down to 4K */ - if (mm->context.id == 0) + if (slice_mm_new_context(mm)) slice_set_user_psize(mm, mmu_virtual_psize); -#else - mm->context.user_psize = mmu_virtual_psize; - mm->context.sllp = SLB_VSID_USER | - mmu_psize_defs[mmu_virtual_psize].sllp; -#endif mm->context.id = index; return 0; diff --git a/include/asm-powerpc/page_64.h b/include/asm-powerpc/page_64.h index 3448a3d..4ceb113 100644 --- a/include/asm-powerpc/page_64.h +++ b/include/asm-powerpc/page_64.h @@ -121,6 +121,7 @@ extern unsigned int get_slice_psize(struct mm_struct *mm, extern void slice_init_context(struct mm_struct *mm, unsigned int psize); extern void slice_set_user_psize(struct mm_struct *mm, unsigned int psize); +#define slice_mm_new_context(mm) ((mm)->context.id == 0) #define ARCH_HAS_HUGEPAGE_ONLY_RANGE extern int is_hugepage_only_range(struct mm_struct *m, @@ -130,6 +131,12 @@ extern int is_hugepage_only_range(struct mm_struct *m, #endif /* __ASSEMBLY__ */ #else #define slice_init() +#define slice_set_user_psize(mm, psize)\ +do { \ + (mm)->context.user_psize = (psize); \ + (mm)->context.sllp = SLB_VSID_USER | mmu_psize_defs[(psize)].sllp; \ +} while (0) +#define slice_mm_new_context(mm) 1 #endif /* CONFIG_PPC_MM_SLICES */ #ifdef CONFIG_HUGETLB_PAGE -- 1.5.2.4 ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev
Re: [PATCH] [POWERPC] Remove get_property and device_is_compatible
From: Stephen Rothwell <[EMAIL PROTECTED]> Date: Wed, 15 Aug 2007 16:45:15 +1000 > They were only needed for backwards compatibility and all in tree uses > have now been changed. > > Signed-off-by: Stephen Rothwell <[EMAIL PROTECTED]> Acked-by: David S. Miller <[EMAIL PROTECTED]> Thanks for doing this Stephen. ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev
[PATCH] [POWERPC] Remove get_property and device_is_compatible
They were only needed for backwards compatibility and all in tree uses have now been changed. Signed-off-by: Stephen Rothwell <[EMAIL PROTECTED]> --- include/asm-powerpc/prom.h |1 - include/asm-ppc/prom.h |1 - include/linux/of.h |1 - 3 files changed, 0 insertions(+), 3 deletions(-) -- Cheers, Stephen Rothwell[EMAIL PROTECTED] diff --git a/include/asm-powerpc/prom.h b/include/asm-powerpc/prom.h index 6720837..920b756 100644 --- a/include/asm-powerpc/prom.h +++ b/include/asm-powerpc/prom.h @@ -145,7 +145,6 @@ extern void of_detach_node(struct device_node *); extern void finish_device_tree(void); extern void unflatten_device_tree(void); extern void early_init_devtree(void *); -#define device_is_compatible(d, c) of_device_is_compatible((d), (c)) extern int machine_is_compatible(const char *compat); extern void print_properties(struct device_node *node); extern int prom_n_intr_cells(struct device_node* np); diff --git a/include/asm-ppc/prom.h b/include/asm-ppc/prom.h index 901f7fa..71f4c99 100644 --- a/include/asm-ppc/prom.h +++ b/include/asm-ppc/prom.h @@ -35,7 +35,6 @@ extern unsigned long sub_reloc_offset(unsigned long); #define machine_is_compatible(x) 0 #define of_find_compatible_node(f, t, c) NULL #define of_get_property(p, n, l) NULL -#define get_property(a, b, c) of_get_property((a), (b), (c)) #endif /* _PPC_PROM_H */ #endif /* __KERNEL__ */ diff --git a/include/linux/of.h b/include/linux/of.h index 47734ff..6df80e9 100644 --- a/include/linux/of.h +++ b/include/linux/of.h @@ -54,7 +54,6 @@ extern int of_device_is_compatible(const struct device_node *device, extern const void *of_get_property(const struct device_node *node, const char *name, int *lenp); -#define get_property(a, b, c) of_get_property((a), (b), (c)) extern int of_n_addr_cells(struct device_node *np); extern int of_n_size_cells(struct device_node *np); -- 1.5.2.4 ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev
[PATCH] [POWERPC] Use of_get_property in ipmi code
get_property has been renamed to of_get_property. Signed-off-by: Stephen Rothwell <[EMAIL PROTECTED]> --- drivers/char/ipmi/ipmi_si_intf.c |6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) -- Cheers, Stephen Rothwell[EMAIL PROTECTED] diff --git a/drivers/char/ipmi/ipmi_si_intf.c b/drivers/char/ipmi/ipmi_si_intf.c index 96d2f9e..d57083a 100644 --- a/drivers/char/ipmi/ipmi_si_intf.c +++ b/drivers/char/ipmi/ipmi_si_intf.c @@ -2251,19 +2251,19 @@ static int __devinit ipmi_of_probe(struct of_device *dev, return ret; } - regsize = get_property(np, "reg-size", &proplen); + regsize = of_get_property(np, "reg-size", &proplen); if (regsize && proplen != 4) { dev_warn(&dev->dev, PFX "invalid regsize from OF\n"); return -EINVAL; } - regspacing = get_property(np, "reg-spacing", &proplen); + regspacing = of_get_property(np, "reg-spacing", &proplen); if (regspacing && proplen != 4) { dev_warn(&dev->dev, PFX "invalid regspacing from OF\n"); return -EINVAL; } - regshift = get_property(np, "reg-shift", &proplen); + regshift = of_get_property(np, "reg-shift", &proplen); if (regshift && proplen != 4) { dev_warn(&dev->dev, PFX "invalid regshift from OF\n"); return -EINVAL; -- 1.5.2.4 ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev
Re: [PATCH 2/4] PowerPC 440EPx: Sequoia DTS
On Tuesday 14 August 2007, Valentine Barshak wrote: > AMCC Sequoia device tree. Please find some comments below. > Signed-off-by: Valentine Barshak <[EMAIL PROTECTED]> > --- > arch/powerpc/boot/dts/sequoia.dts | 289 > ++ 1 files changed, 289 insertions(+) > > diff -ruN linux-2.6.orig/arch/powerpc/boot/dts/sequoia.dts > linux-2.6/arch/powerpc/boot/dts/sequoia.dts --- > linux-2.6.orig/arch/powerpc/boot/dts/sequoia.dts 1970-01-01 > 03:00:00.0 +0300 +++ > linux-2.6/arch/powerpc/boot/dts/sequoia.dts 2007-08-14 19:32:56.0 > +0400 @@ -0,0 +1,289 @@ > +/* > + * Device Tree Source for AMCC Sequoia > + * > + * Based on Bamboo code by Josh Boyer <[EMAIL PROTECTED]> > + * Copyright (c) 2006, 2007 IBM Corp. > + * > + * FIXME: Draft only! > + * > + * 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 = <2>; > + #size-cells = <1>; > + model = "amcc,sequoia"; > + compatible = "amcc,sequoia"; > + 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 zImage */ > + timebase-frequency = <0>; /* Filled in by zImage */ > + i-cache-line-size = <20>; > + d-cache-line-size = <20>; > + i-cache-size = <8000>; > + d-cache-size = <8000>; > + dcr-controller; > + dcr-access-method = "native"; > + }; > + }; > + > + memory { > + device_type = "memory"; > + reg = <0 0 0>; /* Filled in by zImage */ > + }; > + > + UIC0: interrupt-controller0 { > + compatible = "ibm,uic-440epx","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-440epx","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-440epx","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>; > + }; > + > + SDR0: sdr { > + compatible = "ibm,sdr-440epx", "ibm,sdr-440ep"; > + dcr-reg = <00e 002>; > + }; > + > + CPR0: cpr { > + compatible = "ibm,cpr-440epx", "ibm,sdr-440ep"; sdr-440ep? I assume you really mean: + compatible = "ibm,cpr-440epx", "ibm,cpr-440ep"; > + dcr-reg = <00c 002>; > + }; > + > + plb { > + compatible = "ibm,plb-440epx", "ibm,plb4"; > + #address-cells = <2>; > + #size-cells = <1>; > + ranges; > + clock-frequency = <0>; /* Filled in by zImage */ > + > + SDRAM0: sdram { > + device_type = "memory-controller"; > + compatible = "ibm,sdram-44x-ddr2denali"; > + dcr-reg = <010 2>; > + }; > + > + DMA0: dma { > + compatible = "ibm,dma-440epx", "ibm,dma-4xx"; > + dcr-reg = <100 027>; > + }; > + > + MAL0: mcmal { > + compatible = "ibm,mcmal-440epx", "ibm,mcmal-440spe", > "ibm,mcmal2"; > + dcr-reg = <180 62>; > + num-tx-chans = <4>; > + num-rx-chans = <4>; > + 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
[PATCH] [POWERPC] fix non HUGETLB_PAGE build warning
arch/powerpc/mm/mmu_context_64.c: In function 'init_new_context': arch/powerpc/mm/mmu_context_64.c:31: warning: unused variable 'new_context' Signed-off-by: Stephen Rothwell <[EMAIL PROTECTED]> --- arch/powerpc/mm/mmu_context_64.c |5 ++--- arch/powerpc/mm/slice.c |1 + 2 files changed, 3 insertions(+), 3 deletions(-) -- Cheers, Stephen Rothwell[EMAIL PROTECTED] diff --git a/arch/powerpc/mm/mmu_context_64.c b/arch/powerpc/mm/mmu_context_64.c index 7a78cdc..901ea76 100644 --- a/arch/powerpc/mm/mmu_context_64.c +++ b/arch/powerpc/mm/mmu_context_64.c @@ -28,7 +28,6 @@ int init_new_context(struct task_struct *tsk, struct mm_struct *mm) { int index; int err; - int new_context = (mm->context.id == 0); again: if (!idr_pre_get(&mmu_context_idr, GFP_KERNEL)) @@ -50,19 +49,19 @@ again: return -ENOMEM; } - mm->context.id = index; #ifdef CONFIG_PPC_MM_SLICES /* The old code would re-promote on fork, we don't do that * when using slices as it could cause problem promoting slices * that have been forced down to 4K */ - if (new_context) + if (mm->context.id == 0) slice_set_user_psize(mm, mmu_virtual_psize); #else mm->context.user_psize = mmu_virtual_psize; mm->context.sllp = SLB_VSID_USER | mmu_psize_defs[mmu_virtual_psize].sllp; #endif + mm->context.id = index; return 0; } diff --git a/arch/powerpc/mm/slice.c b/arch/powerpc/mm/slice.c index d5fd390..319826e 100644 --- a/arch/powerpc/mm/slice.c +++ b/arch/powerpc/mm/slice.c @@ -551,6 +551,7 @@ EXPORT_SYMBOL_GPL(get_slice_psize); * * This is also called in init_new_context() to change back the user * psize from whatever the parent context had it set to + * N.B. This may be called before mm->context.id has been set. * * This function will only change the content of the {low,high)_slice_psize * masks, it will not flush SLBs as this shall be handled lazily by the -- 1.5.2.4 ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev
Re: [PATCH 4/4] PowerPC 440EPx: Sequoia board support
On Tue, Aug 14, 2007 at 11:04:09PM +0400, Valentine Barshak wrote: > AMCC 440EPx Sequoia board support. > The second bit (0x4) in the 440EPx/440GRx PVR value indicates > the Security/Kasumi engine absence if set. > This bit has been removed from the pvr mask to use a single > cputable entry for with/without Security/Kasumi cpu versions. > > > Signed-off-by: Valentine Barshak <[EMAIL PROTECTED]> > --- > arch/powerpc/kernel/cputable.c | 18 + > arch/powerpc/kernel/head_44x.S |2 - > arch/powerpc/platforms/44x/Kconfig | 17 - > arch/powerpc/platforms/44x/Makefile |1 > arch/powerpc/platforms/44x/sequoia.c | 66 > +++ > 5 files changed, 102 insertions(+), 2 deletions(-) > > diff -ruN linux-2.6.orig/arch/powerpc/kernel/cputable.c > linux-2.6/arch/powerpc/kernel/cputable.c > --- linux-2.6.orig/arch/powerpc/kernel/cputable.c 2007-08-14 > 17:11:18.0 +0400 > +++ linux-2.6/arch/powerpc/kernel/cputable.c 2007-08-14 19:37:54.0 > +0400 > @@ -1132,6 +1132,24 @@ > .dcache_bsize = 32, > .platform = "ppc440", > }, > + { /* 440EPX */ > + .pvr_mask = 0xfffb, > + .pvr_value = 0x28D0, > + .cpu_name = "440EPX", > + .cpu_features = CPU_FTRS_44X, > + .cpu_user_features = COMMON_USER_BOOKE | > PPC_FEATURE_HAS_FPU, > + .icache_bsize = 32, > + .dcache_bsize = 32, > + }, > + { /* 440GRX */ > + .pvr_mask = 0xfffb, > + .pvr_value = 0x28D8, > + .cpu_name = "440GRX", > + .cpu_features = CPU_FTRS_44X, > + .cpu_user_features = COMMON_USER_BOOKE, > + .icache_bsize = 32, > + .dcache_bsize = 32, > + }, > { /* 440GP Rev. B */ > .pvr_mask = 0xffff, > .pvr_value = 0x4440, > diff -ruN linux-2.6.orig/arch/powerpc/kernel/head_44x.S > linux-2.6/arch/powerpc/kernel/head_44x.S > --- linux-2.6.orig/arch/powerpc/kernel/head_44x.S 2007-08-14 > 17:11:19.0 +0400 > +++ linux-2.6/arch/powerpc/kernel/head_44x.S 2007-08-14 17:18:43.0 > +0400 > @@ -217,7 +217,7 @@ > lis r4,[EMAIL PROTECTED]/* IVPR only uses the high 16-bits */ > mtspr SPRN_IVPR,r4 > > -#ifdef CONFIG_440EP > +#if defined(CONFIG_440EP) || defined(CONFIG_440EPX) Since we should now be able to support both 440GP and 440EP boards in the same kernel, this probably needs to become a feature section. > /* Clear DAPUIB flag in CCR0 (enable APU between CPU and FPU) */ > mfspr r2,SPRN_CCR0 > lis r3,0xffef > diff -ruN linux-2.6.orig/arch/powerpc/platforms/44x/Kconfig > linux-2.6/arch/powerpc/platforms/44x/Kconfig > --- linux-2.6.orig/arch/powerpc/platforms/44x/Kconfig 2007-08-14 > 17:11:17.0 +0400 > +++ linux-2.6/arch/powerpc/platforms/44x/Kconfig 2007-08-14 > 20:36:19.0 +0400 > @@ -14,6 +14,14 @@ > help > This option enables support for the IBM PPC440GP evaluation board. > > +config SEQUOIA > + bool "Sequoia" > + depends on 44x > + default n > + select 440EPX > + help > + This option enables support for the AMCC PPC440EPX evaluation board. > + > #config LUAN > #bool "Luan" > #depends on 44x > @@ -37,6 +45,13 @@ > select IBM440EP_ERR42 > #select IBM_NEW_EMAC_ZMII > > +config 440EPX > + bool > + select PPC_FPU > +# Disabled until the new EMAC Driver is merged. > +#select IBM_NEW_EMAC_EMAC4 > +#select IBM_NEW_EMAC_ZMII > + > config 440GP > bool > # Disabled until the new EMAC Driver is merged. > @@ -50,7 +65,7 @@ > > config 440A > bool > - depends on 440GX > + depends on 440GX || 440EPX > default y > > # 44x errata/workaround config symbols, selected by the CPU models above > diff -ruN linux-2.6.orig/arch/powerpc/platforms/44x/Makefile > linux-2.6/arch/powerpc/platforms/44x/Makefile > --- linux-2.6.orig/arch/powerpc/platforms/44x/Makefile2007-08-14 > 17:11:17.0 +0400 > +++ linux-2.6/arch/powerpc/platforms/44x/Makefile 2007-08-14 > 17:18:43.0 +0400 > @@ -1,3 +1,4 @@ > obj-$(CONFIG_44x):= misc_44x.o > obj-$(CONFIG_EBONY) += ebony.o > obj-$(CONFIG_BAMBOO) += bamboo.o > +obj-$(CONFIG_SEQUOIA)+= sequoia.o > diff -ruN linux-2.6.orig/arch/powerpc/platforms/44x/sequoia.c > linux-2.6/arch/powerpc/platforms/44x/sequoia.c > --- linux-2.6.orig/arch/powerpc/platforms/44x/sequoia.c 1970-01-01 > 03:00:00.0 +0300 > +++ linux-2.6/arch/powerpc/platforms/44x/sequoia.c2007-08-14 > 20:12:26.0 +0400 > @@ -0,0 +1,66 @@ > +/* > + * Sequoia board specific routines >
Re: [PATCH 3/4] PowerPC 440EPx: Sequoia bootwrapper
On Tue, Aug 14, 2007 at 10:53:55PM +0400, Valentine Barshak wrote: > Bootwrapper code for AMCC 440EPx Sequoia board. > The DDR2 Denali controller support has been moved to > arch/powerpc/boot/4xx.c > The code also uses 440EP clocking fixups > initially provided for 440EP Bamboo. > > Signed-off-by: Valentine Barshak <[EMAIL PROTECTED]> [snip] > diff -ruN linux-2.6.orig/arch/powerpc/boot/cuboot-sequoia.c > linux-2.6/arch/powerpc/boot/cuboot-sequoia.c > --- linux-2.6.orig/arch/powerpc/boot/cuboot-sequoia.c 1970-01-01 > 03:00:00.0 +0300 > +++ linux-2.6/arch/powerpc/boot/cuboot-sequoia.c 2007-08-14 > 17:25:37.0 +0400 > @@ -0,0 +1,31 @@ > +/* > + * Old U-boot compatibility for Sequoia > + * > + * Based on Ebony code by David Gibson <[EMAIL PROTECTED]> > + * > + * Copyright 2007 David Gibson, IBM Corporatio. > + * Based on cuboot-83xx.c, which is: > + * Copyright (c) 2007 Freescale Semiconductor, Inc. > + * > + * This program is free software; you can redistribute it and/or modify it > + * under the terms of the GNU General Public License version 2 as published > + * by the Free Software Foundation. > + */ > + > +#include "ops.h" > +#include "stdio.h" > +#include "44x.h" > +#include "cuboot.h" > + > +#define TARGET_4xx > +#define TARGET_44x Surely you need to be more specific than that to select the correct bd_t structure? > +#include "ppcboot.h" > + > +static bd_t bd; > + > +void platform_init(unsigned long r3, unsigned long r4, unsigned long r5, > + unsigned long r6, unsigned long r7) > +{ > + CUBOOT_INIT(); > + sequoia_init(&bd.bi_enetaddr, &bd.bi_enet1addr); > +} > diff -ruN linux-2.6.orig/arch/powerpc/boot/Makefile > linux-2.6/arch/powerpc/boot/Makefile > --- linux-2.6.orig/arch/powerpc/boot/Makefile 2007-08-14 17:11:16.0 > +0400 > +++ linux-2.6/arch/powerpc/boot/Makefile 2007-08-14 17:25:38.0 > +0400 > @@ -44,10 +44,11 @@ > src-wlib := string.S crt0.S stdio.c main.c flatdevtree.c flatdevtree_misc.c \ > ns16550.c serial.c simple_alloc.c div64.S util.S \ > gunzip_util.c elf_util.c $(zlib) devtree.c oflib.c ofconsole.c \ > - 4xx.c ebony.c mv64x60.c mpsc.c mv64x60_i2c.c cuboot.c bamboo.c > + 4xx.c ebony.c mv64x60.c mpsc.c mv64x60_i2c.c cuboot.c bamboo.c \ > + sequoia.c > src-plat := of.c cuboot-83xx.c cuboot-85xx.c holly.c \ > cuboot-ebony.c treeboot-ebony.c prpmc2800.c \ > - ps3-head.S ps3-hvcall.S ps3.c treeboot-bamboo.c > + ps3-head.S ps3-hvcall.S ps3.c treeboot-bamboo.c cuboot-sequoia.c > src-boot := $(src-wlib) $(src-plat) empty.c > > src-boot := $(addprefix $(obj)/, $(src-boot)) > @@ -143,6 +144,7 @@ > image-$(CONFIG_PPC_85xx) += cuImage.85xx > image-$(CONFIG_EBONY)+= treeImage.ebony cuImage.ebony > image-$(CONFIG_BAMBOO) += treeImage.bamboo > +image-$(CONFIG_SEQUOIA) += cuImage.sequoia > endif > > # For 32-bit powermacs, build the COFF and miboot images > diff -ruN linux-2.6.orig/arch/powerpc/boot/sequoia.c > linux-2.6/arch/powerpc/boot/sequoia.c > --- linux-2.6.orig/arch/powerpc/boot/sequoia.c1970-01-01 > 03:00:00.0 +0300 > +++ linux-2.6/arch/powerpc/boot/sequoia.c 2007-08-14 20:52:10.0 > +0400 Unless another bootloader is expected to come along for Sequoia, there's no reason to separate sequoia.c from cuboot-sequoia.c > @@ -0,0 +1,48 @@ > +/*;5A > + * Valentine Barshak <[EMAIL PROTECTED]> > + * Copyright 2007 MontaVista Software, Inc > + * > + * Based on Bamboo code by Josh Boyer <[EMAIL PROTECTED]> > + * Copyright IBM Corporation, 2007 > + * > + * This program is free software; you can redistribute it and/or > + * modify it under the terms of the GNU General Public License > + * as published by the Free Software Foundation; version 2 of the License > + */ > +#include > +#include > +#include "types.h" > +#include "elf.h" > +#include "string.h" > +#include "stdio.h" > +#include "page.h" > +#include "ops.h" > +#include "dcr.h" > +#include "4xx.h" > +#include "44x.h" > + > +extern char _dtb_start[]; > +extern char _dtb_end[]; > + > +static u8 *sequoia_mac0, *sequoia_mac1; > + > + > +static void sequoia_fixups(void) > +{ > + unsigned long sysclk = ; > + > + ibm440ep_fixup_clocks(sysclk, 11059200); > + ibm4xx_fixup_ebc_ranges("/plb/opb/ebc"); > + ibm4xx_denali_fixup_memsize(); > + dt_fixup_mac_addresses(sequoia_mac0, sequoia_mac1); > +} > + > +void sequoia_init(void *mac0, void *mac1) > +{ > + platform_ops.fixups = sequoia_fixups; > + platform_ops.exit = ibm44x_dbcr_reset; > + sequoia_mac0 = mac0; > + sequoia_mac1 = mac1; > + ft_init(_dtb_start, 0, 32); > + serial_console_init(); > +} > ___ > Linuxppc-dev mailing list > Linuxppc-dev@ozlabs.org > https://ozlabs.org/mailman/listinfo/linuxppc-dev > -- David G
Re: [PATCH 2/4] PowerPC 440EPx: Sequoia DTS
On Tue, Aug 14, 2007 at 10:48:43PM +0400, Valentine Barshak wrote: > AMCC Sequoia device tree. > > Signed-off-by: Valentine Barshak <[EMAIL PROTECTED]> > --- > arch/powerpc/boot/dts/sequoia.dts | 289 > ++ > 1 files changed, 289 insertions(+) > > diff -ruN linux-2.6.orig/arch/powerpc/boot/dts/sequoia.dts > linux-2.6/arch/powerpc/boot/dts/sequoia.dts > --- linux-2.6.orig/arch/powerpc/boot/dts/sequoia.dts 1970-01-01 > 03:00:00.0 +0300 > +++ linux-2.6/arch/powerpc/boot/dts/sequoia.dts 2007-08-14 > 19:32:56.0 +0400 > @@ -0,0 +1,289 @@ > +/* > + * Device Tree Source for AMCC Sequoia > + * > + * Based on Bamboo code by Josh Boyer <[EMAIL PROTECTED]> > + * Copyright (c) 2006, 2007 IBM Corp. > + * > + * FIXME: Draft only! > + * > + * 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 = <2>; > + #size-cells = <1>; > + model = "amcc,sequoia"; > + compatible = "amcc,sequoia"; > + 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 zImage */ > + timebase-frequency = <0>; /* Filled in by zImage */ > + i-cache-line-size = <20>; > + d-cache-line-size = <20>; > + i-cache-size = <8000>; > + d-cache-size = <8000>; > + dcr-controller; > + dcr-access-method = "native"; > + }; > + }; > + > + memory { > + device_type = "memory"; > + reg = <0 0 0>; /* Filled in by zImage */ > + }; > + > + UIC0: interrupt-controller0 { > + compatible = "ibm,uic-440epx","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-440epx","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-440epx","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>; > + }; > + > + SDR0: sdr { > + compatible = "ibm,sdr-440epx", "ibm,sdr-440ep"; Ok, I take it the 440EP really does have SDR and CPR devices with which the EPx variants are compatible? > + dcr-reg = <00e 002>; > + }; > + > + CPR0: cpr { > + compatible = "ibm,cpr-440epx", "ibm,sdr-440ep"; > + dcr-reg = <00c 002>; > + }; > + > + plb { > + compatible = "ibm,plb-440epx", "ibm,plb4"; > + #address-cells = <2>; > + #size-cells = <1>; > + ranges; > + clock-frequency = <0>; /* Filled in by zImage */ > + > + SDRAM0: sdram { > + device_type = "memory-controller"; > + compatible = "ibm,sdram-44x-ddr2denali"; Should have an ibm,sdram-440epx entry as well, just in case of chip specific bugs / workarounds. > + dcr-reg = <010 2>; > + }; > + > + DMA0: dma { > + compatible = "ibm,dma-440epx", "ibm,dma-4xx"; > + dcr-reg = <100 027>; > + }; > + > + MAL0: mcmal { > + compatible = "ibm,mcmal-440epx", "ibm,mcmal-440spe", > "ibm,mcmal2"; What's the 440spe entry about? > + dcr-reg = <180 62>; > + num-tx-chans = <4>; > + num-rx-chans = <4>; > + 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*/
Discontiguous Memory for MPC85xx Series
I am working on a separate project where there is a discontiguous physical memory map . In looking at solutions, it looks like the way to go is to use something like a SPARSEMEM option. FWIW, it even mentions something about discontinuous memory in the Device Tree example about the 970 CPU (Documentation/powerpc/booting-without-of.txt) I am wondering if there is an implementation for SPARSEMEM or DISCONTIGMEM being worked on in the powerpc branch that I could use for the mpc85xx family? Or does somebody have another suggestion on how I would do this? Thanks in advance you can suggest! Tom Morrison Principal S/W Engineer Empirix, Inc (www.empirix.com) [EMAIL PROTECTED] (781) 266 - 3567 ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev
Re: System crash on boot_e500.S
On Tue, 2007-08-14 at 15:14, mike zheng wrote: > Hi All, > > I am trying to bring up MPC8548 CDS board on 2.4 kernel. I have > problem in the head Ow, it hurts when I do this! > _e500.S. The "mtspr SRR0, r7; mtspr SRR1 r6" does not work for me. The > content of R7 and R6 are not moved to SRR0 and SRR1. I am using the > tool-chain from Freescale for 2.6 kernel. > > Any idea on this issue? Maybe use current 2.6 code? jdl ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev
System crash on boot_e500.S
Hi All, I am trying to bring up MPC8548 CDS board on 2.4 kernel. I have problem in the head_e500.S. The "mtspr SRR0, r7; mtspr SRR1 r6" does not work for me. The content of R7 and R6 are not moved to SRR0 and SRR1. I am using the tool-chain from Freescale for 2.6 kernel. Any idea on this issue? Thanks, Mike Code of head_e500.S: slwi r6,r6,5 /* setup new context with other address space */ bl1f /* Find our address */ 1:mflr r9 rlwimi r7,r9,0,20,31 addi r7,r7,24 mtspr SRR0,r7 No change in SRR0 mtspr SRR1,r6 No change in SRR1 rfi System crash /* 4. Clear out PIDs & Search info */ l lir6,0 mtspr SPRN_PID0,r6 mtspr SPRN_PID1,r6 mtspr SPRN_PID2,r6 mtspr SPRN_MAS6,r6 ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev
Re: [PATCH 1/4] PowerPC 440EPx: Sequoia defconfig
On Tue, 14 Aug 2007 22:45:00 +0400 Valentine Barshak <[EMAIL PROTECTED]> wrote: > Sequoia defconfig > > Signed-off-by: Valentine Barshak <[EMAIL PROTECTED]> > --- > arch/powerpc/configs/sequoia_defconfig | 783 > + > 1 files changed, 783 insertions(+) > > diff -ruN linux-2.6.orig/arch/powerpc/configs/sequoia_defconfig > linux-2.6/arch/powerpc/configs/sequoia_defconfig > --- linux-2.6.orig/arch/powerpc/configs/sequoia_defconfig 1970-01-01 > 03:00:00.0 +0300 > +++ linux-2.6/arch/powerpc/configs/sequoia_defconfig 2007-08-14 > 17:18:07.0 +0400 > @@ -0,0 +1,783 @@ > +# > +# Automatically generated make config: don't edit > +# Linux kernel version: 2.6.23-rc1 > +# Fri Jul 27 20:46:07 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 is not set > +CONFIG_44x=y > +# CONFIG_E200 is not set > +CONFIG_PPC_FPU=y ... > +CONFIG_MATH_EMULATION=y You shouldn't need both FPU and MATH_EMULATION. Bamboo had the same bug in it's defconfig until recently, so you can blame me if you'd like :) josh ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev
[PATCH 4/4] PowerPC 440EPx: Sequoia board support
AMCC 440EPx Sequoia board support. The second bit (0x4) in the 440EPx/440GRx PVR value indicates the Security/Kasumi engine absence if set. This bit has been removed from the pvr mask to use a single cputable entry for with/without Security/Kasumi cpu versions. Signed-off-by: Valentine Barshak <[EMAIL PROTECTED]> --- arch/powerpc/kernel/cputable.c | 18 + arch/powerpc/kernel/head_44x.S |2 - arch/powerpc/platforms/44x/Kconfig | 17 - arch/powerpc/platforms/44x/Makefile |1 arch/powerpc/platforms/44x/sequoia.c | 66 +++ 5 files changed, 102 insertions(+), 2 deletions(-) diff -ruN linux-2.6.orig/arch/powerpc/kernel/cputable.c linux-2.6/arch/powerpc/kernel/cputable.c --- linux-2.6.orig/arch/powerpc/kernel/cputable.c 2007-08-14 17:11:18.0 +0400 +++ linux-2.6/arch/powerpc/kernel/cputable.c2007-08-14 19:37:54.0 +0400 @@ -1132,6 +1132,24 @@ .dcache_bsize = 32, .platform = "ppc440", }, + { /* 440EPX */ + .pvr_mask = 0xfffb, + .pvr_value = 0x28D0, + .cpu_name = "440EPX", + .cpu_features = CPU_FTRS_44X, + .cpu_user_features = COMMON_USER_BOOKE | PPC_FEATURE_HAS_FPU, + .icache_bsize = 32, + .dcache_bsize = 32, + }, + { /* 440GRX */ + .pvr_mask = 0xfffb, + .pvr_value = 0x28D8, + .cpu_name = "440GRX", + .cpu_features = CPU_FTRS_44X, + .cpu_user_features = COMMON_USER_BOOKE, + .icache_bsize = 32, + .dcache_bsize = 32, + }, { /* 440GP Rev. B */ .pvr_mask = 0xffff, .pvr_value = 0x4440, diff -ruN linux-2.6.orig/arch/powerpc/kernel/head_44x.S linux-2.6/arch/powerpc/kernel/head_44x.S --- linux-2.6.orig/arch/powerpc/kernel/head_44x.S 2007-08-14 17:11:19.0 +0400 +++ linux-2.6/arch/powerpc/kernel/head_44x.S2007-08-14 17:18:43.0 +0400 @@ -217,7 +217,7 @@ lis r4,[EMAIL PROTECTED]/* IVPR only uses the high 16-bits */ mtspr SPRN_IVPR,r4 -#ifdef CONFIG_440EP +#if defined(CONFIG_440EP) || defined(CONFIG_440EPX) /* Clear DAPUIB flag in CCR0 (enable APU between CPU and FPU) */ mfspr r2,SPRN_CCR0 lis r3,0xffef diff -ruN linux-2.6.orig/arch/powerpc/platforms/44x/Kconfig linux-2.6/arch/powerpc/platforms/44x/Kconfig --- linux-2.6.orig/arch/powerpc/platforms/44x/Kconfig 2007-08-14 17:11:17.0 +0400 +++ linux-2.6/arch/powerpc/platforms/44x/Kconfig2007-08-14 20:36:19.0 +0400 @@ -14,6 +14,14 @@ help This option enables support for the IBM PPC440GP evaluation board. +config SEQUOIA + bool "Sequoia" + depends on 44x + default n + select 440EPX + help + This option enables support for the AMCC PPC440EPX evaluation board. + #config LUAN # bool "Luan" # depends on 44x @@ -37,6 +45,13 @@ select IBM440EP_ERR42 # select IBM_NEW_EMAC_ZMII +config 440EPX + bool + select PPC_FPU +# Disabled until the new EMAC Driver is merged. +# select IBM_NEW_EMAC_EMAC4 +# select IBM_NEW_EMAC_ZMII + config 440GP bool # Disabled until the new EMAC Driver is merged. @@ -50,7 +65,7 @@ config 440A bool - depends on 440GX + depends on 440GX || 440EPX default y # 44x errata/workaround config symbols, selected by the CPU models above diff -ruN linux-2.6.orig/arch/powerpc/platforms/44x/Makefile linux-2.6/arch/powerpc/platforms/44x/Makefile --- linux-2.6.orig/arch/powerpc/platforms/44x/Makefile 2007-08-14 17:11:17.0 +0400 +++ linux-2.6/arch/powerpc/platforms/44x/Makefile 2007-08-14 17:18:43.0 +0400 @@ -1,3 +1,4 @@ obj-$(CONFIG_44x) := misc_44x.o obj-$(CONFIG_EBONY)+= ebony.o obj-$(CONFIG_BAMBOO) += bamboo.o +obj-$(CONFIG_SEQUOIA) += sequoia.o diff -ruN linux-2.6.orig/arch/powerpc/platforms/44x/sequoia.c linux-2.6/arch/powerpc/platforms/44x/sequoia.c --- linux-2.6.orig/arch/powerpc/platforms/44x/sequoia.c 1970-01-01 03:00:00.0 +0300 +++ linux-2.6/arch/powerpc/platforms/44x/sequoia.c 2007-08-14 20:12:26.0 +0400 @@ -0,0 +1,66 @@ +/* + * Sequoia board specific routines + * + * Valentine Barshak <[EMAIL PROTECTED]> + * Copyright 2007 MontaVista Software Inc. + * + * Based on the Bamboo 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
[PATCH 3/4] PowerPC 440EPx: Sequoia bootwrapper
Bootwrapper code for AMCC 440EPx Sequoia board. The DDR2 Denali controller support has been moved to arch/powerpc/boot/4xx.c The code also uses 440EP clocking fixups initially provided for 440EP Bamboo. Signed-off-by: Valentine Barshak <[EMAIL PROTECTED]> --- arch/powerpc/boot/44x.h|1 arch/powerpc/boot/4xx.c| 108 + arch/powerpc/boot/4xx.h|1 arch/powerpc/boot/Makefile |6 +- arch/powerpc/boot/cuboot-sequoia.c | 31 ++ arch/powerpc/boot/sequoia.c| 48 6 files changed, 193 insertions(+), 2 deletions(-) diff -ruN linux-2.6.orig/arch/powerpc/boot/44x.h linux-2.6/arch/powerpc/boot/44x.h --- linux-2.6.orig/arch/powerpc/boot/44x.h 2007-08-14 17:11:16.0 +0400 +++ linux-2.6/arch/powerpc/boot/44x.h 2007-08-14 17:25:37.0 +0400 @@ -12,5 +12,6 @@ void ebony_init(void *mac0, void *mac1); void bamboo_init(void); +void sequoia_init(void *mac0, void *mac1); #endif /* _PPC_BOOT_44X_H_ */ diff -ruN linux-2.6.orig/arch/powerpc/boot/4xx.c linux-2.6/arch/powerpc/boot/4xx.c --- linux-2.6.orig/arch/powerpc/boot/4xx.c 2007-08-14 17:11:16.0 +0400 +++ linux-2.6/arch/powerpc/boot/4xx.c 2007-08-14 20:16:57.0 +0400 @@ -39,6 +39,114 @@ dt_fixup_memory(0, memsize); } +/* 4xx DDR1/2 Denali memory controller support */ +/* DDR0 registers */ +#define DDR0_022 +#define DDR0_088 +#define DDR0_1010 +#define DDR0_1414 +#define DDR0_4242 +#define DDR0_4343 + +/* DDR0_02 */ +#define DDR_START 0x1 +#define DDR_START_SHIFT0 +#define DDR_MAX_CS_REG 0x3 +#define DDR_MAX_CS_REG_SHIFT 24 +#define DDR_MAX_COL_REG0xf +#define DDR_MAX_COL_REG_SHIFT 16 +#define DDR_MAX_ROW_REG0xf +#define DDR_MAX_ROW_REG_SHIFT 8 +/* DDR0_08 */ +#define DDR_DDR2_MODE 0x1 +#define DDR_DDR2_MODE_SHIFT0 +/* DDR0_10 */ +#define DDR_CS_MAP 0x3 +#define DDR_CS_MAP_SHIFT 8 +/* DDR0_14 */ +#define DDR_REDUC 0x1 +#define DDR_REDUC_SHIFT16 +/* DDR0_42 */ +#define DDR_APIN 0x7 +#define DDR_APIN_SHIFT 24 +/* DDR0_43 */ +#define DDR_COL_SZ 0x7 +#define DDR_COL_SZ_SHIFT 8 +#define DDR_BANK8 0x1 +#define DDR_BANK8_SHIFT0 + +#define DDR_GET_VAL(val, mask, shift) (((val) >> (shift)) & (mask)) + +static inline u32 mfdcr_sdram0(u32 reg) +{ +mtdcr(DCRN_SDRAM0_CFGADDR, reg); +return mfdcr(DCRN_SDRAM0_CFGDATA); +} + +void ibm4xx_denali_fixup_memsize(void) +{ + u32 val, max_cs, max_col, max_row; + u32 cs, col, row, bank, dpath; + unsigned long memsize; + + val = mfdcr_sdram0(DDR0_02); + if (!DDR_GET_VAL(val, DDR_START, DDR_START_SHIFT)) + fatal("DDR controller is not initialized\n"); + + /* get maximum cs col and row values */ + max_cs = DDR_GET_VAL(val, DDR_MAX_CS_REG, DDR_MAX_CS_REG_SHIFT); + max_col = DDR_GET_VAL(val, DDR_MAX_COL_REG, DDR_MAX_COL_REG_SHIFT); + max_row = DDR_GET_VAL(val, DDR_MAX_ROW_REG, DDR_MAX_ROW_REG_SHIFT); + + /* get CS value */ + val = mfdcr_sdram0(DDR0_10); + + val = DDR_GET_VAL(val, DDR_CS_MAP, DDR_CS_MAP_SHIFT); + cs = 0; + while (val) { + if (val && 0x1) + cs++; + val = val >> 1; + } + + if (!cs) + fatal("No memory installed\n"); + if (cs > max_cs) + fatal("DDR wrong CS configuration\n"); + + /* get data path bytes */ + val = mfdcr_sdram0(DDR0_14); + + if (DDR_GET_VAL(val, DDR_REDUC, DDR_REDUC_SHIFT)) + dpath = 8; /* 64 bits */ + else + dpath = 4; /* 32 bits */ + + /* get adress pins (rows) */ + val = mfdcr_sdram0(DDR0_42); + + row = DDR_GET_VAL(val, DDR_APIN, DDR_APIN_SHIFT); + if (row > max_row) + fatal("DDR wrong APIN configuration\n"); + row = max_row - row; + + /* get collomn size and banks */ + val = mfdcr_sdram0(DDR0_43); + + col = DDR_GET_VAL(val, DDR_COL_SZ, DDR_COL_SZ_SHIFT); + if (col > max_col) + fatal("DDR wrong COL configuration\n"); + col = max_col - col; + + if (DDR_GET_VAL(val, DDR_BANK8, DDR_BANK8_SHIFT)) + bank = 8; /* 8 banks */ + else + bank = 4; /* 4 banks */ + + memsize = cs * (1 << (col+row)) * bank * dpath; + dt_fixup_memory(0, memsize); +} + #define DBCR0_RST_SYSTEM 0x3000 void ibm44x_dbcr_reset(void) diff -ruN linux-2.6.orig/arch/powerpc/boot/4xx.h linux-2.6/arch/powerpc/boot/4xx.h --- linux-2.6.orig/arch/powerpc/boot/4xx.h 2007-08-14 17:11:16.0 +0400 +++ linux-2.6/arch/powerpc/boo
[PATCH 2/4] PowerPC 440EPx: Sequoia DTS
AMCC Sequoia device tree. Signed-off-by: Valentine Barshak <[EMAIL PROTECTED]> --- arch/powerpc/boot/dts/sequoia.dts | 289 ++ 1 files changed, 289 insertions(+) diff -ruN linux-2.6.orig/arch/powerpc/boot/dts/sequoia.dts linux-2.6/arch/powerpc/boot/dts/sequoia.dts --- linux-2.6.orig/arch/powerpc/boot/dts/sequoia.dts1970-01-01 03:00:00.0 +0300 +++ linux-2.6/arch/powerpc/boot/dts/sequoia.dts 2007-08-14 19:32:56.0 +0400 @@ -0,0 +1,289 @@ +/* + * Device Tree Source for AMCC Sequoia + * + * Based on Bamboo code by Josh Boyer <[EMAIL PROTECTED]> + * Copyright (c) 2006, 2007 IBM Corp. + * + * FIXME: Draft only! + * + * 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 = <2>; + #size-cells = <1>; + model = "amcc,sequoia"; + compatible = "amcc,sequoia"; + 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 zImage */ + timebase-frequency = <0>; /* Filled in by zImage */ + i-cache-line-size = <20>; + d-cache-line-size = <20>; + i-cache-size = <8000>; + d-cache-size = <8000>; + dcr-controller; + dcr-access-method = "native"; + }; + }; + + memory { + device_type = "memory"; + reg = <0 0 0>; /* Filled in by zImage */ + }; + + UIC0: interrupt-controller0 { + compatible = "ibm,uic-440epx","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-440epx","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-440epx","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>; + }; + + SDR0: sdr { + compatible = "ibm,sdr-440epx", "ibm,sdr-440ep"; + dcr-reg = <00e 002>; + }; + + CPR0: cpr { + compatible = "ibm,cpr-440epx", "ibm,sdr-440ep"; + dcr-reg = <00c 002>; + }; + + plb { + compatible = "ibm,plb-440epx", "ibm,plb4"; + #address-cells = <2>; + #size-cells = <1>; + ranges; + clock-frequency = <0>; /* Filled in by zImage */ + + SDRAM0: sdram { + device_type = "memory-controller"; + compatible = "ibm,sdram-44x-ddr2denali"; + dcr-reg = <010 2>; + }; + + DMA0: dma { + compatible = "ibm,dma-440epx", "ibm,dma-4xx"; + dcr-reg = <100 027>; + }; + + MAL0: mcmal { + compatible = "ibm,mcmal-440epx", "ibm,mcmal-440spe", "ibm,mcmal2"; + dcr-reg = <180 62>; + num-tx-chans = <4>; + num-rx-chans = <4>; + 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-440epx", "ibm,opb"; + #address-cells = <1>; + #size-cells = <1>; + /* Bamboo is oddball in the 44x world and doesn't use the ERPN +* bits. +*/ + ranges = < 1 8000 + 800
[PATCH 1/4] PowerPC 440EPx: Sequoia defconfig
Sequoia defconfig Signed-off-by: Valentine Barshak <[EMAIL PROTECTED]> --- arch/powerpc/configs/sequoia_defconfig | 783 + 1 files changed, 783 insertions(+) diff -ruN linux-2.6.orig/arch/powerpc/configs/sequoia_defconfig linux-2.6/arch/powerpc/configs/sequoia_defconfig --- linux-2.6.orig/arch/powerpc/configs/sequoia_defconfig 1970-01-01 03:00:00.0 +0300 +++ linux-2.6/arch/powerpc/configs/sequoia_defconfig2007-08-14 17:18:07.0 +0400 @@ -0,0 +1,783 @@ +# +# Automatically generated make config: don't edit +# Linux kernel version: 2.6.23-rc1 +# Fri Jul 27 20:46:07 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 is not set +CONFIG_44x=y +# CONFIG_E200 is not set +CONFIG_PPC_FPU=y +CONFIG_4xx=y +CONFIG_BOOKE=y +CONFIG_PTE_64BIT=y +CONFIG_PHYS_64BIT=y +# CONFIG_PPC_MM_SLICES is not set +CONFIG_NOT_COHERENT_CACHE=y +CONFIG_PPC32=y +CONFIG_PPC_MERGE=y +CONFIG_MMU=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=y +# 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" + +# +# Code maturity level options +# +CONFIG_EXPERIMENTAL=y +CONFIG_BROKEN_ON_SMP=y +CONFIG_INIT_ENV_ARG_LIMIT=32 + +# +# General setup +# +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 is not set +# CONFIG_KALLSYMS_EXTRA_PASS is not set +CONFIG_HOTPLUG=y +CONFIG_PRINTK=y +CONFIG_BUG=y +CONFIG_ELF_CORE=y +CONFIG_BASE_FULL=y +CONFIG_FUTEX=y +CONFIG_ANON_INODES=y +CONFIG_EPOLL=y +CONFIG_SIGNALFD=y +CONFIG_TIMERFD=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_EBONY is not set +CONFIG_SEQUOIA=y +CONFIG_440EPX=y +CONFIG_440A=y +# 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 + +# +# Kernel options +# +# CONFIG_HIGHMEM 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=y +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=y +CONFIG_CMDLINE="" +CONFIG_SECCOMP=y +CONFIG_WANT_DEVICE_TREE=y +CONFIG_DEVICE_TREE="sequoia.dts" +CONFI
[PATCH] Update lmb.h include protection to ASM_POWERPC
This file was protected by _PPC64_LMB_H, which is confusing, as the 32-bit code also uses the lmb these days. Changed to _ASM_POWERPC_LMB_H. Signed-off-by: Becky Bruce <[EMAIL PROTECTED]> --- include/asm-powerpc/lmb.h |6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/asm-powerpc/lmb.h b/include/asm-powerpc/lmb.h index 0c5880f..b5f9f4c 100644 --- a/include/asm-powerpc/lmb.h +++ b/include/asm-powerpc/lmb.h @@ -1,5 +1,5 @@ -#ifndef _PPC64_LMB_H -#define _PPC64_LMB_H +#ifndef _ASM_POWERPC_LMB_H +#define _ASM_POWERPC_LMB_H #ifdef __KERNEL__ /* @@ -77,4 +77,4 @@ lmb_end_pfn(struct lmb_region *type, unsigned long region_nr) } #endif /* __KERNEL__ */ -#endif /* _PPC64_LMB_H */ +#endif /* _ASM_POWERPC_LMB_H */ -- 1.5.0.3 ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev
[PATCH 0/4] PowerPC 440EPx: Initial Sequoia support take 2
The following patches add initial PowerPC 440EPx Sequoia board support. The code is based mainly on the Bamboo board support by Josh Boyer and should be applied on top of the "[patch 00/10] 4xx patch series for 2.6.24" which adds Bamboo support, since Sequoia shares some code pieces with Bamboo. These patches have been modified based on the comments for the previous 440EPx Sequoia patch series. The 2.6.24 4xx patch series is included in the following git tree: git pull git://git.infradead.org/users/jwboyer/powerpc.git for-2.6.24 Thanks, Valentine. ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev
ft_ordered removal patch status?
Hi Paul, Is there a reason this hasn't been picked up: http://ozlabs.org/pipermail/linuxppc-dev/2007-May/035906.html It fixes a build warning in the tree and removes some dead code. It appears to still apply cleanly to the top of your tree if there are issues please let me know so I can fix them. Thanks, Becky ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev
Re: [PATCH] ps3: Fix no storage devices found
Geert Uytterhoeven wrote: > Fix probing of PS3 storage devices: in the success case, we should set `error' > to zero, not `result'. > > Without this patch no storage devices are found. > > Signed-off-by: Geert Uytterhoeven <[EMAIL PROTECTED]> > --- > This brown paper bag bug slipped in due to bad patch splitting. > Please apply as soon as possible. Thanks! Looks good. Acked-by: Geoff Levand <[EMAIL PROTECTED]> ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev
[PATCH] ps3: Fix no storage devices found
Fix probing of PS3 storage devices: in the success case, we should set `error' to zero, not `result'. Without this patch no storage devices are found. Signed-off-by: Geert Uytterhoeven <[EMAIL PROTECTED]> --- This brown paper bag bug slipped in due to bad patch splitting. Please apply as soon as possible. Thanks! arch/powerpc/platforms/ps3/device-init.c |2 +- 1 files changed, 1 insertion(+), 1 deletion(-) --- a/arch/powerpc/platforms/ps3/device-init.c +++ b/arch/powerpc/platforms/ps3/device-init.c @@ -372,7 +372,7 @@ static int ps3_storage_wait_for_device(c notify_event->dev_type == repo->dev_type) { pr_debug("%s:%u: device ready: dev_id %u\n", __func__, __LINE__, repo->dev_id); - result = 0; + error = 0; break; } With kind regards, Geert Uytterhoeven Software Architect Sony Network and Software Technology Center Europe The Corporate Village · Da Vincilaan 7-D1 · B-1935 Zaventem · Belgium Phone:+32 (0)2 700 8453 Fax: +32 (0)2 700 8622 E-mail: [EMAIL PROTECTED] Internet: http://www.sony-europe.com/ Sony Network and Software Technology Center Europe A division of Sony Service Centre (Europe) N.V. Registered office: Technologielaan 7 · B-1840 Londerzeel · Belgium VAT BE 0413.825.160 · RPR Brussels Fortis Bank Zaventem · Swift GEBABEBB08A · IBAN BE39001382358619___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev
Re: [PATCH] Stop pmac_zilog from abusing 8250's device numbers.
On Tue, Aug 14, David Woodhouse wrote: > On Tue, 2007-08-14 at 13:49 +0200, Olaf Hering wrote: > > On Wed, Apr 04, Paul Mackerras wrote: > > > > > David Woodhouse writes: > > > > > > > There are proper device numbers registered for pmac_zilog now. Use them. > > > > Which numbers? > > shinybook /shiny/git/mtd-utils $ ls -l /dev/ttyPZ* > crw-rw 1 root uucp 204, 192 2007-08-13 11:48 /dev/ttyPZ0 > crw-rw 1 root uucp 204, 193 2007-08-13 11:48 /dev/ttyPZ1 I dont see 204:192 in devices.txt ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev
Re: [PATCH] Stop pmac_zilog from abusing 8250's device numbers.
On Tue, 2007-08-14 at 13:49 +0200, Olaf Hering wrote: > On Wed, Apr 04, Paul Mackerras wrote: > > > David Woodhouse writes: > > > > > There are proper device numbers registered for pmac_zilog now. Use them. > > Which numbers? shinybook /shiny/git/mtd-utils $ ls -l /dev/ttyPZ* crw-rw 1 root uucp 204, 192 2007-08-13 11:48 /dev/ttyPZ0 crw-rw 1 root uucp 204, 193 2007-08-13 11:48 /dev/ttyPZ1 -- dwmw2 ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev
Re: [PATCH] Stop pmac_zilog from abusing 8250's device numbers.
On Wed, Apr 04, Paul Mackerras wrote: > David Woodhouse writes: > > > There are proper device numbers registered for pmac_zilog now. Use them. Which numbers? > Sigh. I guess this is inevitable, but IMNSHO this exposes a weakness > in our serial subsystem. So, when will the name of pmac_zilog get changed? What major/minor pair will the two ports get? ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev
Re: [patch 07/12] powerpc: Fix size check for hugetlbfs
On Tue, Aug 14, 2007 at 12:29:18AM -0700, Greg KH wrote: > -stable review patch. If anyone has any objections, please let us know. > > -- > From: Benjamin Herrenschmidt <[EMAIL PROTECTED]> > > My "slices" address space management code that was added in 2.6.22 > implementation of get_unmapped_area() doesn't properly check that the > size is a multiple of the requested page size. This allows userland to > create VMAs that aren't a multiple of the huge page size with hugetlbfs > (since hugetlbfs entirely relies on get_unmapped_area() to do that > checking) which leads to a kernel BUG() when such areas are torn down. > > Signed-off-by: Benjamin Herrenschmidt <[EMAIL PROTECTED]> > Signed-off-by: Paul Mackerras <[EMAIL PROTECTED]> > Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]> Acked-by: David Gibson <[EMAIL PROTECTED]> -- 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-size-check-for-hugetlbfs.patch queued to -stable tree
On Tue, Aug 14, 2007 at 04:45:34PM +1000, David Gibson wrote: > On Mon, Aug 13, 2007 at 04:26:27PM -0700, [EMAIL PROTECTED] wrote: > > > > This is a note to let you know that we have just queued up the patch titled > > > > Subject: powerpc: Fix size check for hugetlbfs > > > > to the 2.6.22-stable tree. Its filename is > > > > powerpc-fix-size-check-for-hugetlbfs.patch > > > > A git repo of this tree can be found at > > > > http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary > > > > > > >From [EMAIL PROTECTED] Mon Aug 13 16:17:09 2007 > > From: Benjamin Herrenschmidt <[EMAIL PROTECTED]> > > Date: Wed, 08 Aug 2007 15:44:15 +1000 > > Subject: powerpc: Fix size check for hugetlbfs > > To: linuxppc-dev list > > Cc: Paul Mackerras <[EMAIL PROTECTED]>, [EMAIL PROTECTED] > > Message-ID: <[EMAIL PROTECTED]> > > > > From: Benjamin Herrenschmidt <[EMAIL PROTECTED]> > > > > My "slices" address space management code that was added in 2.6.22 > > implementation of get_unmapped_area() doesn't properly check that the > > size is a multiple of the requested page size. This allows userland to > > create VMAs that aren't a multiple of the huge page size with hugetlbfs > > (since hugetlbfs entirely relies on get_unmapped_area() to do that > > checking) which leads to a kernel BUG() when such areas are torn down. > > Ok, I said I was going to look into a libhugetlbfs testcase for this. > Doesn't appear there's specifically a testcase for misaligned size - > I'll add one. > > However, it seems the current kernel, on ppc64, gives a testcase > failure on 'misaligned_offset', because it's not failing a mapping > with a non-hugepage aligned file offset. I'm not sure (yet) if this > failure is also caused by the new slice code, but it seems a likely > candidate. I have written a new test for the handling of misaligned addresses, lengths and offsets for libhugetlbfs. With it I've verified that this patch does correct a serious problem with length handling - without the patch this new testcase causes an oops for me. It's simpler than the 'misaligned_offset' testcase in which the misaligned mapping was just a step to triggering a different and much more subtle kernel bug (where the misaligned mapping failed, but corrupted some pagetables in the process). But the testcase still fails because a mapping with misaligned offset still succeeds. Still don't know if this is related to the same slice changes or not. Need to do a bisect, but I'm putting it off because I have some other bugs to chase. -- 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
[patch 07/12] powerpc: Fix size check for hugetlbfs
-stable review patch. If anyone has any objections, please let us know. -- From: Benjamin Herrenschmidt <[EMAIL PROTECTED]> My "slices" address space management code that was added in 2.6.22 implementation of get_unmapped_area() doesn't properly check that the size is a multiple of the requested page size. This allows userland to create VMAs that aren't a multiple of the huge page size with hugetlbfs (since hugetlbfs entirely relies on get_unmapped_area() to do that checking) which leads to a kernel BUG() when such areas are torn down. Signed-off-by: Benjamin Herrenschmidt <[EMAIL PROTECTED]> Signed-off-by: Paul Mackerras <[EMAIL PROTECTED]> Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]> --- arch/powerpc/mm/slice.c |2 ++ 1 file changed, 2 insertions(+) --- a/arch/powerpc/mm/slice.c +++ b/arch/powerpc/mm/slice.c @@ -405,6 +405,8 @@ unsigned long slice_get_unmapped_area(un if (len > mm->task_size) return -ENOMEM; + if (len & ((1ul << pshift) - 1)) + return -EINVAL; if (fixed && (addr & ((1ul << pshift) - 1))) return -EINVAL; if (fixed && addr > (mm->task_size - len)) -- ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev