From 5c709039411f67519f859e27ecb47dcacd5c9211 Mon Sep 17 00:00:00 2001 From: Nathan Fontenot Date: Tue, 2 Oct 2012 16:55:01 +0000 Subject: [PATCH] --- yaml --- r: 346805 b: refs/heads/master c: e81b3295bc54eb0d03f4cdfc8cbf72e731d1b402 h: refs/heads/master i: 346803: bdd3b4af94a96ae89fe67e988591578fe36b82fc v: v3 --- [refs] | 2 +- trunk/Documentation/powerpc/ptrace.txt | 16 ---- trunk/arch/powerpc/Makefile | 2 +- trunk/arch/powerpc/configs/pseries_defconfig | 2 +- trunk/arch/powerpc/include/asm/bitops.h | 75 +++++++++++++--- trunk/arch/powerpc/include/asm/cputable.h | 12 +-- trunk/arch/powerpc/include/asm/dbell.h | 2 +- trunk/arch/powerpc/include/asm/fsl_gtm.h | 2 +- trunk/arch/powerpc/include/asm/immap_qe.h | 2 +- trunk/arch/powerpc/include/asm/machdep.h | 3 + trunk/arch/powerpc/include/asm/mmu.h | 1 - trunk/arch/powerpc/include/asm/ppc-opcode.h | 6 +- trunk/arch/powerpc/include/asm/qe.h | 2 +- trunk/arch/powerpc/include/asm/qe_ic.h | 2 +- trunk/arch/powerpc/include/asm/reg.h | 1 - trunk/arch/powerpc/include/asm/setup.h | 29 ------ trunk/arch/powerpc/include/asm/ucc.h | 2 +- trunk/arch/powerpc/include/asm/ucc_fast.h | 2 +- trunk/arch/powerpc/include/asm/ucc_slow.h | 2 +- trunk/arch/powerpc/include/asm/udbg.h | 1 + trunk/arch/powerpc/include/uapi/asm/setup.h | 31 +++++++ trunk/arch/powerpc/kernel/Makefile | 2 +- .../{cpu_setup_power.S => cpu_setup_power7.S} | 24 ----- trunk/arch/powerpc/kernel/cputable.c | 38 -------- trunk/arch/powerpc/kernel/entry_64.S | 2 - trunk/arch/powerpc/kernel/exceptions-64s.S | 2 +- trunk/arch/powerpc/kernel/head_64.S | 3 +- trunk/arch/powerpc/kernel/idle.c | 3 + trunk/arch/powerpc/kernel/iommu.c | 16 ++-- trunk/arch/powerpc/kernel/prom.c | 1 - trunk/arch/powerpc/kernel/prom_init.c | 11 +-- trunk/arch/powerpc/kernel/ptrace.c | 90 ++----------------- trunk/arch/powerpc/kernel/rtas_flash.c | 4 +- trunk/arch/powerpc/kernel/udbg.c | 23 +++++ trunk/arch/powerpc/mm/tlb_nohash_low.S | 15 +++- trunk/arch/powerpc/perf/power7-pmu.c | 17 +--- trunk/arch/powerpc/platforms/52xx/lite5200.c | 2 +- .../powerpc/platforms/82xx/pq2ads-pci-pic.c | 8 +- .../arch/powerpc/platforms/83xx/mpc832x_mds.c | 2 +- .../arch/powerpc/platforms/83xx/mpc836x_mds.c | 2 +- .../arch/powerpc/platforms/83xx/mpc836x_rdk.c | 2 +- .../arch/powerpc/platforms/83xx/mpc837x_rdb.c | 2 +- .../arch/powerpc/platforms/85xx/mpc85xx_mds.c | 2 +- .../powerpc/platforms/powermac/cpufreq_32.c | 5 +- .../arch/powerpc/platforms/powernv/pci-ioda.c | 25 +++--- trunk/arch/powerpc/platforms/pseries/dlpar.c | 24 ----- .../arch/powerpc/platforms/pseries/reconfig.c | 47 ---------- trunk/arch/powerpc/sysdev/fsl_gtm.c | 2 +- trunk/arch/powerpc/sysdev/pmi.c | 13 ++- trunk/arch/powerpc/sysdev/qe_lib/qe.c | 2 +- trunk/arch/powerpc/sysdev/qe_lib/qe_ic.c | 2 +- trunk/arch/powerpc/sysdev/qe_lib/qe_ic.h | 2 +- trunk/arch/powerpc/sysdev/qe_lib/qe_io.c | 2 +- trunk/arch/powerpc/sysdev/qe_lib/ucc.c | 2 +- trunk/arch/powerpc/sysdev/qe_lib/ucc_fast.c | 2 +- trunk/arch/powerpc/sysdev/qe_lib/ucc_slow.c | 2 +- trunk/arch/powerpc/sysdev/qe_lib/usb.c | 2 +- trunk/arch/powerpc/xmon/Makefile | 2 +- trunk/arch/powerpc/xmon/nonstdio.c | 53 ++++++----- trunk/arch/powerpc/xmon/nonstdio.h | 6 ++ trunk/arch/powerpc/xmon/start.c | 34 +++++++ trunk/arch/powerpc/xmon/xmon.c | 26 ++++-- .../drivers/macintosh/windfarm_fcu_controls.c | 14 ++- .../drivers/macintosh/windfarm_lm75_sensor.c | 14 ++- .../macintosh/windfarm_max6690_sensor.c | 13 ++- trunk/drivers/macintosh/windfarm_smu_sat.c | 13 ++- trunk/drivers/of/base.c | 55 +++++++++++- trunk/drivers/video/Kconfig | 8 +- trunk/drivers/video/gxt4500.c | 15 +--- trunk/tools/perf/perf.h | 2 +- 70 files changed, 428 insertions(+), 427 deletions(-) delete mode 100644 trunk/arch/powerpc/include/asm/setup.h rename trunk/arch/powerpc/kernel/{cpu_setup_power.S => cpu_setup_power7.S} (86%) create mode 100644 trunk/arch/powerpc/xmon/start.c diff --git a/[refs] b/[refs] index d550e8249deb..2a8811baa6ae 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 11ee7e99f35ecb15f59b21da6a82d96d2cd3fcc8 +refs/heads/master: e81b3295bc54eb0d03f4cdfc8cbf72e731d1b402 diff --git a/trunk/Documentation/powerpc/ptrace.txt b/trunk/Documentation/powerpc/ptrace.txt index f2a7a3919772..f4a5499b7bc6 100644 --- a/trunk/Documentation/powerpc/ptrace.txt +++ b/trunk/Documentation/powerpc/ptrace.txt @@ -127,22 +127,6 @@ Some examples of using the structure to: p.addr2 = (uint64_t) end_range; p.condition_value = 0; -- set a watchpoint in server processors (BookS) - - p.version = 1; - p.trigger_type = PPC_BREAKPOINT_TRIGGER_RW; - p.addr_mode = PPC_BREAKPOINT_MODE_RANGE_INCLUSIVE; - or - p.addr_mode = PPC_BREAKPOINT_MODE_EXACT; - - p.condition_mode = PPC_BREAKPOINT_CONDITION_NONE; - p.addr = (uint64_t) begin_range; - /* For PPC_BREAKPOINT_MODE_RANGE_INCLUSIVE addr2 needs to be specified, where - * addr2 - addr <= 8 Bytes. - */ - p.addr2 = (uint64_t) end_range; - p.condition_value = 0; - 3. PTRACE_DELHWDEBUG Takes an integer which identifies an existing breakpoint or watchpoint diff --git a/trunk/arch/powerpc/Makefile b/trunk/arch/powerpc/Makefile index b639852116fa..159e94f4b22a 100644 --- a/trunk/arch/powerpc/Makefile +++ b/trunk/arch/powerpc/Makefile @@ -181,7 +181,7 @@ $(BOOT_TARGETS2): vmlinux bootwrapper_install: $(Q)$(MAKE) ARCH=ppc64 $(build)=$(boot) $(patsubst %,$(boot)/%,$@) -%.dtb: scripts +%.dtb: $(Q)$(MAKE) ARCH=ppc64 $(build)=$(boot) $(patsubst %,$(boot)/%,$@) define archhelp diff --git a/trunk/arch/powerpc/configs/pseries_defconfig b/trunk/arch/powerpc/configs/pseries_defconfig index 5b8e1e508270..1f710a32ffae 100644 --- a/trunk/arch/powerpc/configs/pseries_defconfig +++ b/trunk/arch/powerpc/configs/pseries_defconfig @@ -2,7 +2,7 @@ CONFIG_PPC64=y CONFIG_ALTIVEC=y CONFIG_VSX=y CONFIG_SMP=y -CONFIG_NR_CPUS=2048 +CONFIG_NR_CPUS=1024 CONFIG_EXPERIMENTAL=y CONFIG_SYSVIPC=y CONFIG_POSIX_MQUEUE=y diff --git a/trunk/arch/powerpc/include/asm/bitops.h b/trunk/arch/powerpc/include/asm/bitops.h index ef918a2328bb..dc2cf9c6d9e6 100644 --- a/trunk/arch/powerpc/include/asm/bitops.h +++ b/trunk/arch/powerpc/include/asm/bitops.h @@ -52,6 +52,8 @@ #define smp_mb__before_clear_bit() smp_mb() #define smp_mb__after_clear_bit() smp_mb() +#define BITOP_MASK(nr) (1UL << ((nr) % BITS_PER_LONG)) +#define BITOP_WORD(nr) ((nr) / BITS_PER_LONG) #define BITOP_LE_SWIZZLE ((BITS_PER_LONG-1) & ~0x7) /* Macro for generating the ***_bits() functions */ @@ -81,22 +83,22 @@ DEFINE_BITOP(change_bits, xor, "", "") static __inline__ void set_bit(int nr, volatile unsigned long *addr) { - set_bits(BIT_MASK(nr), addr + BIT_WORD(nr)); + set_bits(BITOP_MASK(nr), addr + BITOP_WORD(nr)); } static __inline__ void clear_bit(int nr, volatile unsigned long *addr) { - clear_bits(BIT_MASK(nr), addr + BIT_WORD(nr)); + clear_bits(BITOP_MASK(nr), addr + BITOP_WORD(nr)); } static __inline__ void clear_bit_unlock(int nr, volatile unsigned long *addr) { - clear_bits_unlock(BIT_MASK(nr), addr + BIT_WORD(nr)); + clear_bits_unlock(BITOP_MASK(nr), addr + BITOP_WORD(nr)); } static __inline__ void change_bit(int nr, volatile unsigned long *addr) { - change_bits(BIT_MASK(nr), addr + BIT_WORD(nr)); + change_bits(BITOP_MASK(nr), addr + BITOP_WORD(nr)); } /* Like DEFINE_BITOP(), with changes to the arguments to 'op' and the output @@ -134,26 +136,26 @@ DEFINE_TESTOP(test_and_change_bits, xor, PPC_ATOMIC_ENTRY_BARRIER, static __inline__ int test_and_set_bit(unsigned long nr, volatile unsigned long *addr) { - return test_and_set_bits(BIT_MASK(nr), addr + BIT_WORD(nr)) != 0; + return test_and_set_bits(BITOP_MASK(nr), addr + BITOP_WORD(nr)) != 0; } static __inline__ int test_and_set_bit_lock(unsigned long nr, volatile unsigned long *addr) { - return test_and_set_bits_lock(BIT_MASK(nr), - addr + BIT_WORD(nr)) != 0; + return test_and_set_bits_lock(BITOP_MASK(nr), + addr + BITOP_WORD(nr)) != 0; } static __inline__ int test_and_clear_bit(unsigned long nr, volatile unsigned long *addr) { - return test_and_clear_bits(BIT_MASK(nr), addr + BIT_WORD(nr)) != 0; + return test_and_clear_bits(BITOP_MASK(nr), addr + BITOP_WORD(nr)) != 0; } static __inline__ int test_and_change_bit(unsigned long nr, volatile unsigned long *addr) { - return test_and_change_bits(BIT_MASK(nr), addr + BIT_WORD(nr)) != 0; + return test_and_change_bits(BITOP_MASK(nr), addr + BITOP_WORD(nr)) != 0; } #include @@ -278,8 +280,61 @@ unsigned long __arch_hweight64(__u64 w); #include /* Little-endian versions */ -#include +static __inline__ int test_bit_le(unsigned long nr, + __const__ void *addr) +{ + __const__ unsigned char *tmp = (__const__ unsigned char *) addr; + return (tmp[nr >> 3] >> (nr & 7)) & 1; +} + +static inline void set_bit_le(int nr, void *addr) +{ + set_bit(nr ^ BITOP_LE_SWIZZLE, addr); +} + +static inline void clear_bit_le(int nr, void *addr) +{ + clear_bit(nr ^ BITOP_LE_SWIZZLE, addr); +} + +static inline void __set_bit_le(int nr, void *addr) +{ + __set_bit(nr ^ BITOP_LE_SWIZZLE, addr); +} + +static inline void __clear_bit_le(int nr, void *addr) +{ + __clear_bit(nr ^ BITOP_LE_SWIZZLE, addr); +} + +static inline int test_and_set_bit_le(int nr, void *addr) +{ + return test_and_set_bit(nr ^ BITOP_LE_SWIZZLE, addr); +} + +static inline int test_and_clear_bit_le(int nr, void *addr) +{ + return test_and_clear_bit(nr ^ BITOP_LE_SWIZZLE, addr); +} + +static inline int __test_and_set_bit_le(int nr, void *addr) +{ + return __test_and_set_bit(nr ^ BITOP_LE_SWIZZLE, addr); +} + +static inline int __test_and_clear_bit_le(int nr, void *addr) +{ + return __test_and_clear_bit(nr ^ BITOP_LE_SWIZZLE, addr); +} + +#define find_first_zero_bit_le(addr, size) \ + find_next_zero_bit_le((addr), (size), 0) +unsigned long find_next_zero_bit_le(const void *addr, + unsigned long size, unsigned long offset); + +unsigned long find_next_bit_le(const void *addr, + unsigned long size, unsigned long offset); /* Bitmap functions for the ext2 filesystem */ #include diff --git a/trunk/arch/powerpc/include/asm/cputable.h b/trunk/arch/powerpc/include/asm/cputable.h index 76f81bd64f1d..21a0687b8c4d 100644 --- a/trunk/arch/powerpc/include/asm/cputable.h +++ b/trunk/arch/powerpc/include/asm/cputable.h @@ -401,14 +401,6 @@ extern const char *powerpc_base_platform; CPU_FTR_DSCR | CPU_FTR_SAO | CPU_FTR_ASYM_SMT | \ CPU_FTR_STCX_CHECKS_ADDRESS | CPU_FTR_POPCNTB | CPU_FTR_POPCNTD | \ CPU_FTR_ICSWX | CPU_FTR_CFAR | CPU_FTR_HVMODE | CPU_FTR_VMX_COPY) -#define CPU_FTRS_POWER8 (CPU_FTR_USE_TB | CPU_FTR_LWSYNC | \ - CPU_FTR_PPCAS_ARCH_V2 | CPU_FTR_CTRL | CPU_FTR_ARCH_206 |\ - CPU_FTR_MMCRA | CPU_FTR_SMT | \ - CPU_FTR_COHERENT_ICACHE | \ - CPU_FTR_PURR | CPU_FTR_SPURR | CPU_FTR_REAL_LE | \ - CPU_FTR_DSCR | CPU_FTR_SAO | \ - CPU_FTR_STCX_CHECKS_ADDRESS | CPU_FTR_POPCNTB | CPU_FTR_POPCNTD | \ - CPU_FTR_ICSWX | CPU_FTR_CFAR | CPU_FTR_HVMODE | CPU_FTR_VMX_COPY) #define CPU_FTRS_CELL (CPU_FTR_USE_TB | CPU_FTR_LWSYNC | \ CPU_FTR_PPCAS_ARCH_V2 | CPU_FTR_CTRL | \ CPU_FTR_ALTIVEC_COMP | CPU_FTR_MMCRA | CPU_FTR_SMT | \ @@ -429,8 +421,8 @@ extern const char *powerpc_base_platform; #define CPU_FTRS_POSSIBLE \ (CPU_FTRS_POWER3 | CPU_FTRS_RS64 | CPU_FTRS_POWER4 | \ CPU_FTRS_PPC970 | CPU_FTRS_POWER5 | CPU_FTRS_POWER6 | \ - CPU_FTRS_POWER7 | CPU_FTRS_POWER8 | CPU_FTRS_CELL | \ - CPU_FTRS_PA6T | CPU_FTR_VSX) + CPU_FTRS_POWER7 | CPU_FTRS_CELL | CPU_FTRS_PA6T | \ + CPU_FTR_VSX) #endif #else enum { diff --git a/trunk/arch/powerpc/include/asm/dbell.h b/trunk/arch/powerpc/include/asm/dbell.h index 607e4eeeb694..154c067761b1 100644 --- a/trunk/arch/powerpc/include/asm/dbell.h +++ b/trunk/arch/powerpc/include/asm/dbell.h @@ -1,5 +1,5 @@ /* - * Copyright 2009 Freescale Semiconductor, Inc. + * Copyright 2009 Freescale Semicondutor, Inc. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License diff --git a/trunk/arch/powerpc/include/asm/fsl_gtm.h b/trunk/arch/powerpc/include/asm/fsl_gtm.h index 3b05808f9caa..8e8c9b5032d3 100644 --- a/trunk/arch/powerpc/include/asm/fsl_gtm.h +++ b/trunk/arch/powerpc/include/asm/fsl_gtm.h @@ -1,7 +1,7 @@ /* * Freescale General-purpose Timers Module * - * Copyright 2006 Freescale Semiconductor, Inc. + * Copyright (c) Freescale Semicondutor, Inc. 2006. * Shlomi Gridish * Jerry Huang * Copyright (c) MontaVista Software, Inc. 2008. diff --git a/trunk/arch/powerpc/include/asm/immap_qe.h b/trunk/arch/powerpc/include/asm/immap_qe.h index bedbff891423..61e8490786b8 100644 --- a/trunk/arch/powerpc/include/asm/immap_qe.h +++ b/trunk/arch/powerpc/include/asm/immap_qe.h @@ -3,7 +3,7 @@ * The Internal Memory Map for devices with QE on them. This * is the superset of all QE devices (8360, etc.). - * Copyright (C) 2006. Freescale Semiconductor, Inc. All rights reserved. + * Copyright (C) 2006. Freescale Semicondutor, Inc. All rights reserved. * * Authors: Shlomi Gridish * Li Yang diff --git a/trunk/arch/powerpc/include/asm/machdep.h b/trunk/arch/powerpc/include/asm/machdep.h index a338bc7cf9d4..c4231973edd3 100644 --- a/trunk/arch/powerpc/include/asm/machdep.h +++ b/trunk/arch/powerpc/include/asm/machdep.h @@ -166,6 +166,9 @@ struct machdep_calls { unsigned long size, pgprot_t vma_prot); + /* Idle loop for this platform, leave empty for default idle loop */ + void (*idle_loop)(void); + /* * Function for waiting for work with reduced power in idle loop; * called with interrupts disabled. diff --git a/trunk/arch/powerpc/include/asm/mmu.h b/trunk/arch/powerpc/include/asm/mmu.h index 691fd8aca939..5e38eedea218 100644 --- a/trunk/arch/powerpc/include/asm/mmu.h +++ b/trunk/arch/powerpc/include/asm/mmu.h @@ -101,7 +101,6 @@ #define MMU_FTRS_POWER5 MMU_FTRS_POWER4 | MMU_FTR_LOCKLESS_TLBIE #define MMU_FTRS_POWER6 MMU_FTRS_POWER4 | MMU_FTR_LOCKLESS_TLBIE #define MMU_FTRS_POWER7 MMU_FTRS_POWER4 | MMU_FTR_LOCKLESS_TLBIE -#define MMU_FTRS_POWER8 MMU_FTRS_POWER4 | MMU_FTR_LOCKLESS_TLBIE #define MMU_FTRS_CELL MMU_FTRS_DEFAULT_HPTE_ARCH_V2 | \ MMU_FTR_CI_LARGE_PAGE #define MMU_FTRS_PA6T MMU_FTRS_DEFAULT_HPTE_ARCH_V2 | \ diff --git a/trunk/arch/powerpc/include/asm/ppc-opcode.h b/trunk/arch/powerpc/include/asm/ppc-opcode.h index e434d8b68dda..5f73ce63fcae 100644 --- a/trunk/arch/powerpc/include/asm/ppc-opcode.h +++ b/trunk/arch/powerpc/include/asm/ppc-opcode.h @@ -1,5 +1,5 @@ /* - * Copyright 2009 Freescale Semiconductor, Inc. + * Copyright 2009 Freescale Semicondutor, Inc. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -86,7 +86,6 @@ #define PPC_INST_DCBA_MASK 0xfc0007fe #define PPC_INST_DCBAL 0x7c2005ec #define PPC_INST_DCBZL 0x7c2007ec -#define PPC_INST_ICBT 0x7c00002c #define PPC_INST_ISEL 0x7c00001e #define PPC_INST_ISEL_MASK 0xfc00003e #define PPC_INST_LDARX 0x7c0000a8 @@ -199,7 +198,6 @@ #define __PPC_MB(s) (((s) & 0x1f) << 6) #define __PPC_ME(s) (((s) & 0x1f) << 1) #define __PPC_BI(s) (((s) & 0x1f) << 16) -#define __PPC_CT(t) (((t) & 0x0f) << 21) /* * Only use the larx hint bit on 64bit CPUs. e500v1/v2 based CPUs will treat a @@ -262,8 +260,6 @@ __PPC_RS(t) | __PPC_RA0(a) | __PPC_RB(b)) #define PPC_SLBFEE_DOT(t, b) stringify_in_c(.long PPC_INST_SLBFEE | \ __PPC_RT(t) | __PPC_RB(b)) -#define PPC_ICBT(c,a,b) stringify_in_c(.long PPC_INST_ICBT | \ - __PPC_CT(c) | __PPC_RA0(a) | __PPC_RB(b)) /* PASemi instructions */ #define LBZCIX(t,a,b) stringify_in_c(.long PPC_INST_LBZCIX | \ __PPC_RT(t) | __PPC_RA(a) | __PPC_RB(b)) diff --git a/trunk/arch/powerpc/include/asm/qe.h b/trunk/arch/powerpc/include/asm/qe.h index 32b9bfa0c9bd..229571a49391 100644 --- a/trunk/arch/powerpc/include/asm/qe.h +++ b/trunk/arch/powerpc/include/asm/qe.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2006 Freescale Semiconductor, Inc. All rights reserved. + * Copyright (C) 2006 Freescale Semicondutor, Inc. All rights reserved. * * Authors: Shlomi Gridish * Li Yang diff --git a/trunk/arch/powerpc/include/asm/qe_ic.h b/trunk/arch/powerpc/include/asm/qe_ic.h index 25784cc959a0..f706164b0bd0 100644 --- a/trunk/arch/powerpc/include/asm/qe_ic.h +++ b/trunk/arch/powerpc/include/asm/qe_ic.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2006 Freescale Semiconductor, Inc. All rights reserved. + * Copyright (C) 2006 Freescale Semicondutor, Inc. All rights reserved. * * Authors: Shlomi Gridish * Li Yang diff --git a/trunk/arch/powerpc/include/asm/reg.h b/trunk/arch/powerpc/include/asm/reg.h index 7b44a6e3e0f0..d24c14163966 100644 --- a/trunk/arch/powerpc/include/asm/reg.h +++ b/trunk/arch/powerpc/include/asm/reg.h @@ -1029,7 +1029,6 @@ #define PVR_970MP 0x0044 #define PVR_970GX 0x0045 #define PVR_POWER7p 0x004A -#define PVR_POWER8 0x004B #define PVR_BE 0x0070 #define PVR_PA6T 0x0090 diff --git a/trunk/arch/powerpc/include/asm/setup.h b/trunk/arch/powerpc/include/asm/setup.h deleted file mode 100644 index d3ca85529b8b..000000000000 --- a/trunk/arch/powerpc/include/asm/setup.h +++ /dev/null @@ -1,29 +0,0 @@ -#ifndef _ASM_POWERPC_SETUP_H -#define _ASM_POWERPC_SETUP_H - -#include - -#ifndef __ASSEMBLY__ -extern void ppc_printk_progress(char *s, unsigned short hex); - -extern unsigned int rtas_data; -extern int mem_init_done; /* set on boot once kmalloc can be called */ -extern int init_bootmem_done; /* set once bootmem is available */ -extern unsigned long long memory_limit; -extern unsigned long klimit; -extern void *zalloc_maybe_bootmem(size_t size, gfp_t mask); - -struct device_node; -extern void note_scsi_host(struct device_node *, void *); - -/* Used in very early kernel initialization. */ -extern unsigned long reloc_offset(void); -extern unsigned long add_reloc_offset(unsigned long); -extern void reloc_got2(unsigned long); - -#define PTRRELOC(x) ((typeof(x)) add_reloc_offset((unsigned long)(x))) - -#endif /* !__ASSEMBLY__ */ - -#endif /* _ASM_POWERPC_SETUP_H */ - diff --git a/trunk/arch/powerpc/include/asm/ucc.h b/trunk/arch/powerpc/include/asm/ucc.h index 6927ac26516e..46b09ba6bead 100644 --- a/trunk/arch/powerpc/include/asm/ucc.h +++ b/trunk/arch/powerpc/include/asm/ucc.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2006 Freescale Semiconductor, Inc. All rights reserved. + * Copyright (C) 2006 Freescale Semicondutor, Inc. All rights reserved. * * Authors: Shlomi Gridish * Li Yang diff --git a/trunk/arch/powerpc/include/asm/ucc_fast.h b/trunk/arch/powerpc/include/asm/ucc_fast.h index 72ea9bab07df..4644c840e2fa 100644 --- a/trunk/arch/powerpc/include/asm/ucc_fast.h +++ b/trunk/arch/powerpc/include/asm/ucc_fast.h @@ -1,7 +1,7 @@ /* * Internal header file for UCC FAST unit routines. * - * Copyright (C) 2006 Freescale Semiconductor, Inc. All rights reserved. + * Copyright (C) 2006 Freescale Semicondutor, Inc. All rights reserved. * * Authors: Shlomi Gridish * Li Yang diff --git a/trunk/arch/powerpc/include/asm/ucc_slow.h b/trunk/arch/powerpc/include/asm/ucc_slow.h index c44131e68e11..cf131ffdb8d1 100644 --- a/trunk/arch/powerpc/include/asm/ucc_slow.h +++ b/trunk/arch/powerpc/include/asm/ucc_slow.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2006 Freescale Semiconductor, Inc. All rights reserved. + * Copyright (C) 2006 Freescale Semicondutor, Inc. All rights reserved. * * Authors: Shlomi Gridish * Li Yang diff --git a/trunk/arch/powerpc/include/asm/udbg.h b/trunk/arch/powerpc/include/asm/udbg.h index 5a7510e9d09d..b3038817b8dc 100644 --- a/trunk/arch/powerpc/include/asm/udbg.h +++ b/trunk/arch/powerpc/include/asm/udbg.h @@ -21,6 +21,7 @@ extern int (*udbg_getc_poll)(void); extern void udbg_puts(const char *s); extern int udbg_write(const char *s, int n); +extern int udbg_read(char *buf, int buflen); extern void register_early_udbg_console(void); extern void udbg_printf(const char *fmt, ...) diff --git a/trunk/arch/powerpc/include/uapi/asm/setup.h b/trunk/arch/powerpc/include/uapi/asm/setup.h index 552df83f1a49..8b9a306260b2 100644 --- a/trunk/arch/powerpc/include/uapi/asm/setup.h +++ b/trunk/arch/powerpc/include/uapi/asm/setup.h @@ -1 +1,32 @@ +#ifndef _ASM_POWERPC_SETUP_H +#define _ASM_POWERPC_SETUP_H + #include + +#ifndef __ASSEMBLY__ +extern void ppc_printk_progress(char *s, unsigned short hex); + +extern unsigned int rtas_data; +extern int mem_init_done; /* set on boot once kmalloc can be called */ +extern int init_bootmem_done; /* set once bootmem is available */ +extern unsigned long long memory_limit; +extern unsigned long klimit; +extern void *zalloc_maybe_bootmem(size_t size, gfp_t mask); + +extern void via_cuda_init(void); +extern void read_rtc_time(void); +extern void pmac_find_display(void); + +struct device_node; +extern void note_scsi_host(struct device_node *, void *); + +/* Used in very early kernel initialization. */ +extern unsigned long reloc_offset(void); +extern unsigned long add_reloc_offset(unsigned long); +extern void reloc_got2(unsigned long); + +#define PTRRELOC(x) ((typeof(x)) add_reloc_offset((unsigned long)(x))) + +#endif /* !__ASSEMBLY__ */ + +#endif /* _ASM_POWERPC_SETUP_H */ diff --git a/trunk/arch/powerpc/kernel/Makefile b/trunk/arch/powerpc/kernel/Makefile index 8f619342f14c..cde12f8a4ebc 100644 --- a/trunk/arch/powerpc/kernel/Makefile +++ b/trunk/arch/powerpc/kernel/Makefile @@ -38,7 +38,7 @@ obj-$(CONFIG_PPC64) += setup_64.o sys_ppc32.o \ paca.o nvram_64.o firmware.o obj-$(CONFIG_HAVE_HW_BREAKPOINT) += hw_breakpoint.o obj-$(CONFIG_PPC_BOOK3S_64) += cpu_setup_ppc970.o cpu_setup_pa6t.o -obj-$(CONFIG_PPC_BOOK3S_64) += cpu_setup_power.o +obj-$(CONFIG_PPC_BOOK3S_64) += cpu_setup_power7.o obj64-$(CONFIG_RELOCATABLE) += reloc_64.o obj-$(CONFIG_PPC_BOOK3E_64) += exceptions-64e.o idle_book3e.o obj-$(CONFIG_PPC_A2) += cpu_setup_a2.o diff --git a/trunk/arch/powerpc/kernel/cpu_setup_power.S b/trunk/arch/powerpc/kernel/cpu_setup_power7.S similarity index 86% rename from trunk/arch/powerpc/kernel/cpu_setup_power.S rename to trunk/arch/powerpc/kernel/cpu_setup_power7.S index a92101d14b4e..76797c5105d6 100644 --- a/trunk/arch/powerpc/kernel/cpu_setup_power.S +++ b/trunk/arch/powerpc/kernel/cpu_setup_power7.S @@ -44,30 +44,6 @@ _GLOBAL(__restore_cpu_power7) mtlr r11 blr -_GLOBAL(__setup_cpu_power8) - mflr r11 - bl __init_hvmode_206 - mtlr r11 - beqlr - li r0,0 - mtspr SPRN_LPID,r0 - bl __init_LPCR - bl __init_TLB - mtlr r11 - blr - -_GLOBAL(__restore_cpu_power8) - mflr r11 - mfmsr r3 - rldicl. r0,r3,4,63 - beqlr - li r0,0 - mtspr SPRN_LPID,r0 - bl __init_LPCR - bl __init_TLB - mtlr r11 - blr - __init_hvmode_206: /* Disable CPU_FTR_HVMODE and exit if MSR:HV is not set */ mfmsr r3 diff --git a/trunk/arch/powerpc/kernel/cputable.c b/trunk/arch/powerpc/kernel/cputable.c index 75a3d71b895d..0514c21f138b 100644 --- a/trunk/arch/powerpc/kernel/cputable.c +++ b/trunk/arch/powerpc/kernel/cputable.c @@ -68,8 +68,6 @@ extern void __restore_cpu_pa6t(void); extern void __restore_cpu_ppc970(void); extern void __setup_cpu_power7(unsigned long offset, struct cpu_spec* spec); extern void __restore_cpu_power7(void); -extern void __setup_cpu_power8(unsigned long offset, struct cpu_spec* spec); -extern void __restore_cpu_power8(void); extern void __restore_cpu_a2(void); #endif /* CONFIG_PPC64 */ #if defined(CONFIG_E500) @@ -96,10 +94,6 @@ extern void __restore_cpu_e5500(void); PPC_FEATURE_SMT | PPC_FEATURE_ICACHE_SNOOP | \ PPC_FEATURE_TRUE_LE | \ PPC_FEATURE_PSERIES_PERFMON_COMPAT) -#define COMMON_USER_POWER8 (COMMON_USER_PPC64 | PPC_FEATURE_ARCH_2_06 |\ - PPC_FEATURE_SMT | PPC_FEATURE_ICACHE_SNOOP | \ - PPC_FEATURE_TRUE_LE | \ - PPC_FEATURE_PSERIES_PERFMON_COMPAT) #define COMMON_USER_PA6T (COMMON_USER_PPC64 | PPC_FEATURE_PA6T |\ PPC_FEATURE_TRUE_LE | \ PPC_FEATURE_HAS_ALTIVEC_COMP) @@ -435,21 +429,6 @@ static struct cpu_spec __initdata cpu_specs[] = { .cpu_restore = __restore_cpu_power7, .platform = "power7", }, - { /* 2.07-compliant processor, i.e. Power8 "architected" mode */ - .pvr_mask = 0xffffffff, - .pvr_value = 0x0f000004, - .cpu_name = "POWER8 (architected)", - .cpu_features = CPU_FTRS_POWER8, - .cpu_user_features = COMMON_USER_POWER8, - .mmu_features = MMU_FTRS_POWER8, - .icache_bsize = 128, - .dcache_bsize = 128, - .oprofile_type = PPC_OPROFILE_POWER4, - .oprofile_cpu_type = "ppc64/ibm-compat-v1", - .cpu_setup = __setup_cpu_power8, - .cpu_restore = __restore_cpu_power8, - .platform = "power8", - }, { /* Power7 */ .pvr_mask = 0xffff0000, .pvr_value = 0x003f0000, @@ -484,23 +463,6 @@ static struct cpu_spec __initdata cpu_specs[] = { .cpu_restore = __restore_cpu_power7, .platform = "power7+", }, - { /* Power8 */ - .pvr_mask = 0xffff0000, - .pvr_value = 0x004b0000, - .cpu_name = "POWER8 (raw)", - .cpu_features = CPU_FTRS_POWER8, - .cpu_user_features = COMMON_USER_POWER8, - .mmu_features = MMU_FTRS_POWER8, - .icache_bsize = 128, - .dcache_bsize = 128, - .num_pmcs = 6, - .pmc_type = PPC_PMC_IBM, - .oprofile_cpu_type = "ppc64/power8", - .oprofile_type = PPC_OPROFILE_POWER4, - .cpu_setup = __setup_cpu_power8, - .cpu_restore = __restore_cpu_power8, - .platform = "power8", - }, { /* Cell Broadband Engine */ .pvr_mask = 0xffff0000, .pvr_value = 0x00700000, diff --git a/trunk/arch/powerpc/kernel/entry_64.S b/trunk/arch/powerpc/kernel/entry_64.S index ad7666695761..56e0ff0878b5 100644 --- a/trunk/arch/powerpc/kernel/entry_64.S +++ b/trunk/arch/powerpc/kernel/entry_64.S @@ -374,8 +374,6 @@ _GLOBAL(ret_from_kernel_thread) bl .schedule_tail REST_NVGPRS(r1) REST_GPR(2,r1) - li r3,0 - std r3,0(r1) mtlr r14 mr r3,r15 blrl diff --git a/trunk/arch/powerpc/kernel/exceptions-64s.S b/trunk/arch/powerpc/kernel/exceptions-64s.S index 56630189f2ee..10b658ad65e1 100644 --- a/trunk/arch/powerpc/kernel/exceptions-64s.S +++ b/trunk/arch/powerpc/kernel/exceptions-64s.S @@ -276,7 +276,7 @@ vsx_unavailable_pSeries_1: KVM_HANDLER_PR_SKIP(PACA_EXGEN, EXC_STD, 0x1300) . = 0x1500 - .global denorm_exception_hv + .global denorm_Hypervisor denorm_exception_hv: HMT_MEDIUM mtspr SPRN_SPRG_HSCRATCH0,r13 diff --git a/trunk/arch/powerpc/kernel/head_64.S b/trunk/arch/powerpc/kernel/head_64.S index 11a4df9dd580..58bddee8e1e8 100644 --- a/trunk/arch/powerpc/kernel/head_64.S +++ b/trunk/arch/powerpc/kernel/head_64.S @@ -422,7 +422,7 @@ _STATIC(__after_prom_start) tovirt(r6,r6) /* on booke, we already run at PAGE_OFFSET */ #endif -#ifdef CONFIG_RELOCATABLE +#ifdef CONFIG_CRASH_DUMP /* * Check if the kernel has to be running as relocatable kernel based on the * variable __run_at_load, if it is set the kernel is treated as relocatable @@ -703,7 +703,6 @@ _INIT_STATIC(start_here_multiplatform) #ifdef CONFIG_PPC_EARLY_DEBUG_OPAL /* Setup OPAL entry */ - LOAD_REG_ADDR(r11, opal) std r28,0(r11); std r29,8(r11); #endif diff --git a/trunk/arch/powerpc/kernel/idle.c b/trunk/arch/powerpc/kernel/idle.c index ea78761aa169..2099d9a879e8 100644 --- a/trunk/arch/powerpc/kernel/idle.c +++ b/trunk/arch/powerpc/kernel/idle.c @@ -55,6 +55,9 @@ __setup("powersave=off", powersave_off); */ void cpu_idle(void) { + if (ppc_md.idle_loop) + ppc_md.idle_loop(); /* doesn't return */ + set_thread_flag(TIF_POLLING_NRFLAG); while (1) { tick_nohz_idle_enter(); diff --git a/trunk/arch/powerpc/kernel/iommu.c b/trunk/arch/powerpc/kernel/iommu.c index c862fd716fe3..8226c6cb348a 100644 --- a/trunk/arch/powerpc/kernel/iommu.c +++ b/trunk/arch/powerpc/kernel/iommu.c @@ -656,7 +656,7 @@ struct iommu_table *iommu_init_table(struct iommu_table *tbl, int nid) struct iommu_pool *p; /* number of bytes needed for the bitmap */ - sz = BITS_TO_LONGS(tbl->it_size) * sizeof(unsigned long); + sz = (tbl->it_size + 7) >> 3; page = alloc_pages_node(nid, GFP_ATOMIC, get_order(sz)); if (!page) @@ -708,7 +708,7 @@ struct iommu_table *iommu_init_table(struct iommu_table *tbl, int nid) void iommu_free_table(struct iommu_table *tbl, const char *node_name) { - unsigned long bitmap_sz; + unsigned long bitmap_sz, i; unsigned int order; if (!tbl || !tbl->it_map) { @@ -718,11 +718,17 @@ void iommu_free_table(struct iommu_table *tbl, const char *node_name) } /* verify that table contains no entries */ - if (!bitmap_empty(tbl->it_map, tbl->it_size)) - pr_warn("%s: Unexpected TCEs for %s\n", __func__, node_name); + /* it_size is in entries, and we're examining 64 at a time */ + for (i = 0; i < (tbl->it_size/64); i++) { + if (tbl->it_map[i] != 0) { + printk(KERN_WARNING "%s: Unexpected TCEs for %s\n", + __func__, node_name); + break; + } + } /* calculate bitmap size in bytes */ - bitmap_sz = BITS_TO_LONGS(tbl->it_size) * sizeof(unsigned long); + bitmap_sz = (tbl->it_size + 7) / 8; /* free bitmap */ order = get_order(bitmap_sz); diff --git a/trunk/arch/powerpc/kernel/prom.c b/trunk/arch/powerpc/kernel/prom.c index f5ca76a79c88..37725e86651e 100644 --- a/trunk/arch/powerpc/kernel/prom.c +++ b/trunk/arch/powerpc/kernel/prom.c @@ -54,7 +54,6 @@ #include #include #include -#include #include diff --git a/trunk/arch/powerpc/kernel/prom_init.c b/trunk/arch/powerpc/kernel/prom_init.c index 779f34049a56..cb6c123722a2 100644 --- a/trunk/arch/powerpc/kernel/prom_init.c +++ b/trunk/arch/powerpc/kernel/prom_init.c @@ -671,7 +671,6 @@ static void __init early_cmdline_parse(void) #define OV1_PPC_2_04 0x08 /* set if we support PowerPC 2.04 */ #define OV1_PPC_2_05 0x04 /* set if we support PowerPC 2.05 */ #define OV1_PPC_2_06 0x02 /* set if we support PowerPC 2.06 */ -#define OV1_PPC_2_07 0x01 /* set if we support PowerPC 2.07 */ /* Option vector 2: Open Firmware options supported */ #define OV2_REAL_MODE 0x20 /* set if we want OF in real mode */ @@ -708,7 +707,6 @@ static void __init early_cmdline_parse(void) #define OV5_PFO_HW_RNG 0x80 /* PFO Random Number Generator */ #define OV5_PFO_HW_842 0x40 /* PFO Compression Accelerator */ #define OV5_PFO_HW_ENCR 0x20 /* PFO Encryption Accelerator */ -#define OV5_SUB_PROCESSORS 0x01 /* 1,2,or 4 Sub-Processors supported */ /* Option Vector 6: IBM PAPR hints */ #define OV6_LINUX 0x02 /* Linux is our OS */ @@ -721,8 +719,6 @@ static unsigned char ibm_architecture_vec[] = { W(0xfffe0000), W(0x003a0000), /* POWER5/POWER5+ */ W(0xffff0000), W(0x003e0000), /* POWER6 */ W(0xffff0000), W(0x003f0000), /* POWER7 */ - W(0xffff0000), W(0x004b0000), /* POWER8 */ - W(0xffffffff), W(0x0f000004), /* all 2.07-compliant */ W(0xffffffff), W(0x0f000003), /* all 2.06-compliant */ W(0xffffffff), W(0x0f000002), /* all 2.05-compliant */ W(0xfffffffe), W(0x0f000001), /* all 2.04-compliant and earlier */ @@ -732,7 +728,7 @@ static unsigned char ibm_architecture_vec[] = { 3 - 2, /* length */ 0, /* don't ignore, don't halt */ OV1_PPC_2_00 | OV1_PPC_2_01 | OV1_PPC_2_02 | OV1_PPC_2_03 | - OV1_PPC_2_04 | OV1_PPC_2_05 | OV1_PPC_2_06 | OV1_PPC_2_07, + OV1_PPC_2_04 | OV1_PPC_2_05 | OV1_PPC_2_06, /* option vector 2: Open Firmware options supported */ 34 - 2, /* length */ @@ -759,7 +755,7 @@ static unsigned char ibm_architecture_vec[] = { OV4_MIN_ENT_CAP, /* minimum VP entitled capacity */ /* option vector 5: PAPR/OF options */ - 19 - 2, /* length */ + 18 - 2, /* length */ 0, /* don't ignore, don't halt */ OV5_LPAR | OV5_SPLPAR | OV5_LARGE_PAGES | OV5_DRCONF_MEMORY | OV5_DONATE_DEDICATE_CPU | OV5_MSI, @@ -773,14 +769,13 @@ static unsigned char ibm_architecture_vec[] = { * must match by the macro below. Update the definition if * the structure layout changes. */ -#define IBM_ARCH_VEC_NRCORES_OFFSET 117 +#define IBM_ARCH_VEC_NRCORES_OFFSET 101 W(NR_CPUS), /* number of cores supported */ 0, 0, 0, 0, OV5_PFO_HW_RNG | OV5_PFO_HW_ENCR | OV5_PFO_HW_842, - OV5_SUB_PROCESSORS, /* option vector 6: IBM PAPR hints */ 4 - 2, /* length */ 0, diff --git a/trunk/arch/powerpc/kernel/ptrace.c b/trunk/arch/powerpc/kernel/ptrace.c index c4970004d44d..79d8e56470df 100644 --- a/trunk/arch/powerpc/kernel/ptrace.c +++ b/trunk/arch/powerpc/kernel/ptrace.c @@ -952,10 +952,6 @@ int ptrace_set_debugreg(struct task_struct *task, unsigned long addr, arch_bp_generic_fields(data & (DABR_DATA_WRITE | DABR_DATA_READ), &attr.bp_type); - - /* Enable breakpoint */ - attr.disabled = false; - ret = modify_user_hw_breakpoint(bp, &attr); if (ret) { ptrace_put_breakpoints(task); @@ -1041,7 +1037,7 @@ void ptrace_disable(struct task_struct *child) } #ifdef CONFIG_PPC_ADV_DEBUG_REGS -static long set_instruction_bp(struct task_struct *child, +static long set_intruction_bp(struct task_struct *child, struct ppc_hw_breakpoint *bp_info) { int slot; @@ -1342,12 +1338,6 @@ static int set_dac_range(struct task_struct *child, static long ppc_set_hwdebug(struct task_struct *child, struct ppc_hw_breakpoint *bp_info) { -#ifdef CONFIG_HAVE_HW_BREAKPOINT - int len = 0; - struct thread_struct *thread = &(child->thread); - struct perf_event *bp; - struct perf_event_attr attr; -#endif /* CONFIG_HAVE_HW_BREAKPOINT */ #ifndef CONFIG_PPC_ADV_DEBUG_REGS unsigned long dabr; #endif @@ -1375,7 +1365,7 @@ static long ppc_set_hwdebug(struct task_struct *child, if ((bp_info->trigger_type != PPC_BREAKPOINT_TRIGGER_EXECUTE) || (bp_info->condition_mode != PPC_BREAKPOINT_CONDITION_NONE)) return -EINVAL; - return set_instruction_bp(child, bp_info); + return set_intruction_bp(child, bp_info); } if (bp_info->addr_mode == PPC_BREAKPOINT_MODE_EXACT) return set_dac(child, bp_info); @@ -1391,9 +1381,13 @@ static long ppc_set_hwdebug(struct task_struct *child, */ if ((bp_info->trigger_type & PPC_BREAKPOINT_TRIGGER_RW) == 0 || (bp_info->trigger_type & ~PPC_BREAKPOINT_TRIGGER_RW) != 0 || + bp_info->addr_mode != PPC_BREAKPOINT_MODE_EXACT || bp_info->condition_mode != PPC_BREAKPOINT_CONDITION_NONE) return -EINVAL; + if (child->thread.dabr) + return -ENOSPC; + if ((unsigned long)bp_info->addr >= TASK_SIZE) return -EIO; @@ -1403,50 +1397,6 @@ static long ppc_set_hwdebug(struct task_struct *child, dabr |= DABR_DATA_READ; if (bp_info->trigger_type & PPC_BREAKPOINT_TRIGGER_WRITE) dabr |= DABR_DATA_WRITE; -#ifdef CONFIG_HAVE_HW_BREAKPOINT - if (ptrace_get_breakpoints(child) < 0) - return -ESRCH; - - /* - * Check if the request is for 'range' breakpoints. We can - * support it if range < 8 bytes. - */ - if (bp_info->addr_mode == PPC_BREAKPOINT_MODE_RANGE_INCLUSIVE) { - len = bp_info->addr2 - bp_info->addr; - } else if (bp_info->addr_mode != PPC_BREAKPOINT_MODE_EXACT) { - ptrace_put_breakpoints(child); - return -EINVAL; - } - bp = thread->ptrace_bps[0]; - if (bp) { - ptrace_put_breakpoints(child); - return -ENOSPC; - } - - /* Create a new breakpoint request if one doesn't exist already */ - hw_breakpoint_init(&attr); - attr.bp_addr = (unsigned long)bp_info->addr & ~HW_BREAKPOINT_ALIGN; - attr.bp_len = len; - arch_bp_generic_fields(dabr & (DABR_DATA_WRITE | DABR_DATA_READ), - &attr.bp_type); - - thread->ptrace_bps[0] = bp = register_user_hw_breakpoint(&attr, - ptrace_triggered, NULL, child); - if (IS_ERR(bp)) { - thread->ptrace_bps[0] = NULL; - ptrace_put_breakpoints(child); - return PTR_ERR(bp); - } - - ptrace_put_breakpoints(child); - return 1; -#endif /* CONFIG_HAVE_HW_BREAKPOINT */ - - if (bp_info->addr_mode != PPC_BREAKPOINT_MODE_EXACT) - return -EINVAL; - - if (child->thread.dabr) - return -ENOSPC; child->thread.dabr = dabr; child->thread.dabrx = DABRX_ALL; @@ -1455,13 +1405,8 @@ static long ppc_set_hwdebug(struct task_struct *child, #endif /* !CONFIG_PPC_ADV_DEBUG_DVCS */ } -static long ppc_del_hwdebug(struct task_struct *child, long data) +static long ppc_del_hwdebug(struct task_struct *child, long addr, long data) { -#ifdef CONFIG_HAVE_HW_BREAKPOINT - int ret = 0; - struct thread_struct *thread = &(child->thread); - struct perf_event *bp; -#endif /* CONFIG_HAVE_HW_BREAKPOINT */ #ifdef CONFIG_PPC_ADV_DEBUG_REGS int rc; @@ -1481,25 +1426,10 @@ static long ppc_del_hwdebug(struct task_struct *child, long data) #else if (data != 1) return -EINVAL; - -#ifdef CONFIG_HAVE_HW_BREAKPOINT - if (ptrace_get_breakpoints(child) < 0) - return -ESRCH; - - bp = thread->ptrace_bps[0]; - if (bp) { - unregister_hw_breakpoint(bp); - thread->ptrace_bps[0] = NULL; - } else - ret = -ENOENT; - ptrace_put_breakpoints(child); - return ret; -#else /* CONFIG_HAVE_HW_BREAKPOINT */ if (child->thread.dabr == 0) return -ENOENT; child->thread.dabr = 0; -#endif /* CONFIG_HAVE_HW_BREAKPOINT */ return 0; #endif @@ -1606,11 +1536,7 @@ long arch_ptrace(struct task_struct *child, long request, dbginfo.data_bp_alignment = 4; #endif dbginfo.sizeof_condition = 0; -#ifdef CONFIG_HAVE_HW_BREAKPOINT - dbginfo.features = PPC_DEBUG_FEATURE_DATA_BP_RANGE; -#else dbginfo.features = 0; -#endif /* CONFIG_HAVE_HW_BREAKPOINT */ #endif /* CONFIG_PPC_ADV_DEBUG_REGS */ if (!access_ok(VERIFY_WRITE, datavp, @@ -1637,7 +1563,7 @@ long arch_ptrace(struct task_struct *child, long request, } case PPC_PTRACE_DELHWDEBUG: { - ret = ppc_del_hwdebug(child, data); + ret = ppc_del_hwdebug(child, addr, data); break; } diff --git a/trunk/arch/powerpc/kernel/rtas_flash.c b/trunk/arch/powerpc/kernel/rtas_flash.c index 8329190312c1..20b0120db0c3 100644 --- a/trunk/arch/powerpc/kernel/rtas_flash.c +++ b/trunk/arch/powerpc/kernel/rtas_flash.c @@ -650,8 +650,10 @@ static int initialize_flash_pde_data(const char *rtas_call_name, int token; dp->data = kzalloc(buf_size, GFP_KERNEL); - if (dp->data == NULL) + if (dp->data == NULL) { + remove_flash_pde(dp); return -ENOMEM; + } /* * This code assumes that the status int is the first member of the diff --git a/trunk/arch/powerpc/kernel/udbg.c b/trunk/arch/powerpc/kernel/udbg.c index f9748498fe58..c39c1ca77f46 100644 --- a/trunk/arch/powerpc/kernel/udbg.c +++ b/trunk/arch/powerpc/kernel/udbg.c @@ -122,6 +122,29 @@ int udbg_write(const char *s, int n) return n - remain; } +int udbg_read(char *buf, int buflen) +{ + char *p = buf; + int i, c; + + if (!udbg_getc) + return 0; + + for (i = 0; i < buflen; ++i) { + do { + c = udbg_getc(); + if (c == -1 && i == 0) + return -1; + + } while (c == 0x11 || c == 0x13); + if (c == 0 || c == -1) + break; + *p++ = c; + } + + return i; +} + #define UDBG_BUFSIZE 256 void udbg_printf(const char *fmt, ...) { diff --git a/trunk/arch/powerpc/mm/tlb_nohash_low.S b/trunk/arch/powerpc/mm/tlb_nohash_low.S index 626ad081639f..fab919fd1384 100644 --- a/trunk/arch/powerpc/mm/tlb_nohash_low.S +++ b/trunk/arch/powerpc/mm/tlb_nohash_low.S @@ -190,6 +190,12 @@ END_MMU_FTR_SECTION_IFSET(MMU_FTR_TYPE_47x) #ifdef CONFIG_PPC_47x +/* + * 47x variant of icbt + */ +# define ICBT(CT,RA,RB) \ + .long 0x7c00002c | ((CT) << 21) | ((RA) << 16) | ((RB) << 11) + /* * _tlbivax_bcast is only on 47x. We don't bother doing a runtime * check though, it will blow up soon enough if we mistakenly try @@ -202,7 +208,8 @@ _GLOBAL(_tlbivax_bcast) wrteei 0 mtspr SPRN_MMUCR,r5 isync - PPC_TLBIVAX(0, R3) +/* tlbivax 0,r3 - use .long to avoid binutils deps */ + .long 0x7c000624 | (r3 << 11) isync eieio tlbsync @@ -220,11 +227,11 @@ END_FTR_SECTION_IFSET(CPU_FTR_476_DD2) bl 2f 2: mflr r6 li r7,32 - PPC_ICBT(0,R6,R7) /* touch next cache line */ + ICBT(0,r6,r7) /* touch next cache line */ add r6,r6,r7 - PPC_ICBT(0,R6,R7) /* touch next cache line */ + ICBT(0,r6,r7) /* touch next cache line */ add r6,r6,r7 - PPC_ICBT(0,R6,R7) /* touch next cache line */ + ICBT(0,r6,r7) /* touch next cache line */ sync nop nop diff --git a/trunk/arch/powerpc/perf/power7-pmu.c b/trunk/arch/powerpc/perf/power7-pmu.c index 2ee01e38d5e2..441af08edf43 100644 --- a/trunk/arch/powerpc/perf/power7-pmu.c +++ b/trunk/arch/powerpc/perf/power7-pmu.c @@ -54,10 +54,8 @@ * Layout of constraint bits: * 6666555555555544444444443333333333222222222211111111110000000000 * 3210987654321098765432109876543210987654321098765432109876543210 - * < >< ><><><><><><> - * L2 NC P6P5P4P3P2P1 - * - * L2 - 16-18 - Required L2SEL value (select field) + * [ ><><><><><><> + * NC P6P5P4P3P2P1 * * NC - number of counters * 15: NC error 0x8000 @@ -74,7 +72,7 @@ static int power7_get_constraint(u64 event, unsigned long *maskp, unsigned long *valp) { - int pmc, sh, unit; + int pmc, sh; unsigned long mask = 0, value = 0; pmc = (event >> PM_PMC_SH) & PM_PMC_MSK; @@ -92,15 +90,6 @@ static int power7_get_constraint(u64 event, unsigned long *maskp, mask |= 0x8000; value |= 0x1000; } - - unit = (event >> PM_UNIT_SH) & PM_UNIT_MSK; - if (unit == 6) { - /* L2SEL must be identical across events */ - int l2sel = (event >> PM_L2SEL_SH) & PM_L2SEL_MSK; - mask |= 0x7 << 16; - value |= l2sel << 16; - } - *maskp = mask; *valp = value; return 0; diff --git a/trunk/arch/powerpc/platforms/52xx/lite5200.c b/trunk/arch/powerpc/platforms/52xx/lite5200.c index 1843bc932011..448d862bcf3d 100644 --- a/trunk/arch/powerpc/platforms/52xx/lite5200.c +++ b/trunk/arch/powerpc/platforms/52xx/lite5200.c @@ -4,7 +4,7 @@ * Written by: Grant Likely * * Copyright (C) Secret Lab Technologies Ltd. 2006. All rights reserved. - * Copyright 2006 Freescale Semiconductor, Inc. All rights reserved. + * Copyright (C) Freescale Semicondutor, Inc. 2006. All rights reserved. * * Description: * This program is free software; you can redistribute it and/or modify it diff --git a/trunk/arch/powerpc/platforms/82xx/pq2ads-pci-pic.c b/trunk/arch/powerpc/platforms/82xx/pq2ads-pci-pic.c index 74861a7fb807..328d221fd1c0 100644 --- a/trunk/arch/powerpc/platforms/82xx/pq2ads-pci-pic.c +++ b/trunk/arch/powerpc/platforms/82xx/pq2ads-pci-pic.c @@ -16,6 +16,7 @@ #include #include #include +#include #include #include @@ -148,7 +149,7 @@ int __init pq2ads_pci_init_irq(void) priv->regs = of_iomap(np, 0); if (!priv->regs) { printk(KERN_ERR "Cannot map PCI PIC registers.\n"); - goto out_free_kmalloc; + goto out_free_bootmem; } /* mask all PCI interrupts */ @@ -170,8 +171,9 @@ int __init pq2ads_pci_init_irq(void) out_unmap_regs: iounmap(priv->regs); -out_free_kmalloc: - kfree(priv); +out_free_bootmem: + free_bootmem((unsigned long)priv, + sizeof(struct pq2ads_pci_pic)); of_node_put(np); out_unmap_irq: irq_dispose_mapping(irq); diff --git a/trunk/arch/powerpc/platforms/83xx/mpc832x_mds.c b/trunk/arch/powerpc/platforms/83xx/mpc832x_mds.c index 8d762203eeff..d440435e055c 100644 --- a/trunk/arch/powerpc/platforms/83xx/mpc832x_mds.c +++ b/trunk/arch/powerpc/platforms/83xx/mpc832x_mds.c @@ -1,5 +1,5 @@ /* - * Copyright 2006 Freescale Semiconductor, Inc. All rights reserved. + * Copyright (C) Freescale Semicondutor, Inc. 2006. All rights reserved. * * Description: * MPC832xE MDS board specific routines. diff --git a/trunk/arch/powerpc/platforms/83xx/mpc836x_mds.c b/trunk/arch/powerpc/platforms/83xx/mpc836x_mds.c index 1a26d2f83401..1b1f6c8a1a12 100644 --- a/trunk/arch/powerpc/platforms/83xx/mpc836x_mds.c +++ b/trunk/arch/powerpc/platforms/83xx/mpc836x_mds.c @@ -1,5 +1,5 @@ /* - * Copyright 2006 Freescale Semiconductor, Inc. All rights reserved. + * Copyright (C) Freescale Semicondutor, Inc. 2006. All rights reserved. * * Author: Li Yang * Yin Olivia diff --git a/trunk/arch/powerpc/platforms/83xx/mpc836x_rdk.c b/trunk/arch/powerpc/platforms/83xx/mpc836x_rdk.c index b63b42d11d6c..f8769d713d61 100644 --- a/trunk/arch/powerpc/platforms/83xx/mpc836x_rdk.c +++ b/trunk/arch/powerpc/platforms/83xx/mpc836x_rdk.c @@ -1,7 +1,7 @@ /* * MPC8360E-RDK board file. * - * Copyright (c) 2006 Freescale Semiconductor, Inc. + * Copyright (c) 2006 Freescale Semicondutor, Inc. * Copyright (c) 2007-2008 MontaVista Software, Inc. * * Author: Anton Vorontsov diff --git a/trunk/arch/powerpc/platforms/83xx/mpc837x_rdb.c b/trunk/arch/powerpc/platforms/83xx/mpc837x_rdb.c index 9813c81e8e5b..eca1f0960fff 100644 --- a/trunk/arch/powerpc/platforms/83xx/mpc837x_rdb.c +++ b/trunk/arch/powerpc/platforms/83xx/mpc837x_rdb.c @@ -1,7 +1,7 @@ /* * arch/powerpc/platforms/83xx/mpc837x_rdb.c * - * Copyright (C) 2007 Freescale Semiconductor, Inc. All rights reserved. + * Copyright (C) 2007 Freescale Semicondutor, Inc. All rights reserved. * * MPC837x RDB board specific routines * diff --git a/trunk/arch/powerpc/platforms/85xx/mpc85xx_mds.c b/trunk/arch/powerpc/platforms/85xx/mpc85xx_mds.c index bd12588fa252..8498f7323470 100644 --- a/trunk/arch/powerpc/platforms/85xx/mpc85xx_mds.c +++ b/trunk/arch/powerpc/platforms/85xx/mpc85xx_mds.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2006-2010, 2012 Freescale Semiconductor, Inc. + * Copyright (C) 2006-2010, 2012 Freescale Semicondutor, Inc. * All rights reserved. * * Author: Andy Fleming diff --git a/trunk/arch/powerpc/platforms/powermac/cpufreq_32.c b/trunk/arch/powerpc/platforms/powermac/cpufreq_32.c index 311b804353b1..64171198535c 100644 --- a/trunk/arch/powerpc/platforms/powermac/cpufreq_32.c +++ b/trunk/arch/powerpc/platforms/powermac/cpufreq_32.c @@ -55,7 +55,6 @@ static unsigned int low_freq; static unsigned int hi_freq; static unsigned int cur_freq; static unsigned int sleep_freq; -static unsigned long transition_latency; /* * Different models uses different mechanisms to switch the frequency @@ -404,7 +403,7 @@ static int pmac_cpufreq_cpu_init(struct cpufreq_policy *policy) if (policy->cpu != 0) return -ENODEV; - policy->cpuinfo.transition_latency = transition_latency; + policy->cpuinfo.transition_latency = CPUFREQ_ETERNAL; policy->cur = cur_freq; cpufreq_frequency_table_get_attr(pmac_cpu_freqs, policy->cpu); @@ -659,14 +658,12 @@ static int __init pmac_cpufreq_setup(void) if (!value) goto out; cur_freq = (*value) / 1000; - transition_latency = CPUFREQ_ETERNAL; /* Check for 7447A based MacRISC3 */ if (of_machine_is_compatible("MacRISC3") && of_get_property(cpunode, "dynamic-power-step", NULL) && PVR_VER(mfspr(SPRN_PVR)) == 0x8003) { pmac_cpufreq_init_7447A(cpunode); - transition_latency = 8000000; /* Check for other MacRISC3 machines */ } else if (of_machine_is_compatible("PowerBook3,4") || of_machine_is_compatible("PowerBook3,5") || diff --git a/trunk/arch/powerpc/platforms/powernv/pci-ioda.c b/trunk/arch/powerpc/platforms/powernv/pci-ioda.c index 53d052e95cfc..471aa3ccd9fd 100644 --- a/trunk/arch/powerpc/platforms/powernv/pci-ioda.c +++ b/trunk/arch/powerpc/platforms/powernv/pci-ioda.c @@ -34,12 +34,24 @@ #include "powernv.h" #include "pci.h" +static int __pe_printk(const char *level, const struct pnv_ioda_pe *pe, + struct va_format *vaf) +{ + char pfix[32]; + + if (pe->pdev) + strlcpy(pfix, dev_name(&pe->pdev->dev), sizeof(pfix)); + else + sprintf(pfix, "%04x:%02x ", + pci_domain_nr(pe->pbus), pe->pbus->number); + return printk("pci %s%s: [PE# %.3d] %pV", level, pfix, pe->pe_number, vaf); +} + #define define_pe_printk_level(func, kern_level) \ static int func(const struct pnv_ioda_pe *pe, const char *fmt, ...) \ { \ struct va_format vaf; \ va_list args; \ - char pfix[32]; \ int r; \ \ va_start(args, fmt); \ @@ -47,16 +59,7 @@ static int func(const struct pnv_ioda_pe *pe, const char *fmt, ...) \ vaf.fmt = fmt; \ vaf.va = &args; \ \ - if (pe->pdev) \ - strlcpy(pfix, dev_name(&pe->pdev->dev), \ - sizeof(pfix)); \ - else \ - sprintf(pfix, "%04x:%02x ", \ - pci_domain_nr(pe->pbus), \ - pe->pbus->number); \ - r = printk(kern_level "pci %s: [PE# %.3d] %pV", \ - pfix, pe->pe_number, &vaf); \ - \ + r = __pe_printk(kern_level, pe, &vaf); \ va_end(args); \ \ return r; \ diff --git a/trunk/arch/powerpc/platforms/pseries/dlpar.c b/trunk/arch/powerpc/platforms/pseries/dlpar.c index 0f1b706506ed..e36789bd4e6c 100644 --- a/trunk/arch/powerpc/platforms/pseries/dlpar.c +++ b/trunk/arch/powerpc/platforms/pseries/dlpar.c @@ -13,7 +13,6 @@ #include #include #include -#include #include #include #include @@ -255,9 +254,6 @@ static struct device_node *derive_parent(const char *path) int dlpar_attach_node(struct device_node *dn) { -#ifdef CONFIG_PROC_DEVICETREE - struct proc_dir_entry *ent; -#endif int rc; of_node_set_flag(dn, OF_DYNAMIC); @@ -274,32 +270,12 @@ int dlpar_attach_node(struct device_node *dn) } of_attach_node(dn); - -#ifdef CONFIG_PROC_DEVICETREE - ent = proc_mkdir(strrchr(dn->full_name, '/') + 1, dn->parent->pde); - if (ent) - proc_device_tree_add_node(dn, ent); -#endif - of_node_put(dn->parent); return 0; } int dlpar_detach_node(struct device_node *dn) { -#ifdef CONFIG_PROC_DEVICETREE - struct device_node *parent = dn->parent; - struct property *prop = dn->properties; - - while (prop) { - remove_proc_entry(prop->name, dn->pde); - prop = prop->next; - } - - if (dn->pde) - remove_proc_entry(dn->pde->name, parent->pde); -#endif - pSeries_reconfig_notify(PSERIES_RECONFIG_REMOVE, dn); of_detach_node(dn); of_node_put(dn); /* Must decrement the refcount */ diff --git a/trunk/arch/powerpc/platforms/pseries/reconfig.c b/trunk/arch/powerpc/platforms/pseries/reconfig.c index 39f71fba9b38..f99f1ca8035b 100644 --- a/trunk/arch/powerpc/platforms/pseries/reconfig.c +++ b/trunk/arch/powerpc/platforms/pseries/reconfig.c @@ -23,48 +23,6 @@ #include #include - - -/* - * Routines for "runtime" addition and removal of device tree nodes. - */ -#ifdef CONFIG_PROC_DEVICETREE -/* - * Add a node to /proc/device-tree. - */ -static void add_node_proc_entries(struct device_node *np) -{ - struct proc_dir_entry *ent; - - ent = proc_mkdir(strrchr(np->full_name, '/') + 1, np->parent->pde); - if (ent) - proc_device_tree_add_node(np, ent); -} - -static void remove_node_proc_entries(struct device_node *np) -{ - struct property *pp = np->properties; - struct device_node *parent = np->parent; - - while (pp) { - remove_proc_entry(pp->name, np->pde); - pp = pp->next; - } - if (np->pde) - remove_proc_entry(np->pde->name, parent->pde); -} -#else /* !CONFIG_PROC_DEVICETREE */ -static void add_node_proc_entries(struct device_node *np) -{ - return; -} - -static void remove_node_proc_entries(struct device_node *np) -{ - return; -} -#endif /* CONFIG_PROC_DEVICETREE */ - /** * derive_parent - basically like dirname(1) * @path: the full_name of a node to be added to the tree @@ -149,9 +107,6 @@ static int pSeries_reconfig_add_node(const char *path, struct property *proplist } of_attach_node(np); - - add_node_proc_entries(np); - of_node_put(np->parent); return 0; @@ -179,8 +134,6 @@ static int pSeries_reconfig_remove_node(struct device_node *np) return -EBUSY; } - remove_node_proc_entries(np); - pSeries_reconfig_notify(PSERIES_RECONFIG_REMOVE, np); of_detach_node(np); diff --git a/trunk/arch/powerpc/sysdev/fsl_gtm.c b/trunk/arch/powerpc/sysdev/fsl_gtm.c index 0eb871cc3437..02cf1e7e77fc 100644 --- a/trunk/arch/powerpc/sysdev/fsl_gtm.c +++ b/trunk/arch/powerpc/sysdev/fsl_gtm.c @@ -1,7 +1,7 @@ /* * Freescale General-purpose Timers Module * - * Copyright (c) Freescale Semiconductor, Inc. 2006. + * Copyright (c) Freescale Semicondutor, Inc. 2006. * Shlomi Gridish * Jerry Huang * Copyright (c) MontaVista Software, Inc. 2008. diff --git a/trunk/arch/powerpc/sysdev/pmi.c b/trunk/arch/powerpc/sysdev/pmi.c index 5aaf86c03893..8f0465422b1e 100644 --- a/trunk/arch/powerpc/sysdev/pmi.c +++ b/trunk/arch/powerpc/sysdev/pmi.c @@ -214,7 +214,18 @@ static struct platform_driver pmi_of_platform_driver = { .of_match_table = pmi_match, }, }; -module_platform_driver(pmi_of_platform_driver); + +static int __init pmi_module_init(void) +{ + return platform_driver_register(&pmi_of_platform_driver); +} +module_init(pmi_module_init); + +static void __exit pmi_module_exit(void) +{ + platform_driver_unregister(&pmi_of_platform_driver); +} +module_exit(pmi_module_exit); int pmi_send_message(pmi_message_t msg) { diff --git a/trunk/arch/powerpc/sysdev/qe_lib/qe.c b/trunk/arch/powerpc/sysdev/qe_lib/qe.c index 238a07b97f2c..b04367529729 100644 --- a/trunk/arch/powerpc/sysdev/qe_lib/qe.c +++ b/trunk/arch/powerpc/sysdev/qe_lib/qe.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2006-2010 Freescale Semiconductor, Inc. All rights reserved. + * Copyright (C) 2006-2010 Freescale Semicondutor, Inc. All rights reserved. * * Authors: Shlomi Gridish * Li Yang diff --git a/trunk/arch/powerpc/sysdev/qe_lib/qe_ic.c b/trunk/arch/powerpc/sysdev/qe_lib/qe_ic.c index b2b87c30e266..2fba6ef2f95e 100644 --- a/trunk/arch/powerpc/sysdev/qe_lib/qe_ic.c +++ b/trunk/arch/powerpc/sysdev/qe_lib/qe_ic.c @@ -1,7 +1,7 @@ /* * arch/powerpc/sysdev/qe_lib/qe_ic.c * - * Copyright (C) 2006 Freescale Semiconductor, Inc. All rights reserved. + * Copyright (C) 2006 Freescale Semicondutor, Inc. All rights reserved. * * Author: Li Yang * Based on code from Shlomi Gridish diff --git a/trunk/arch/powerpc/sysdev/qe_lib/qe_ic.h b/trunk/arch/powerpc/sysdev/qe_lib/qe_ic.h index efef7ab9b753..c327872ed35c 100644 --- a/trunk/arch/powerpc/sysdev/qe_lib/qe_ic.h +++ b/trunk/arch/powerpc/sysdev/qe_lib/qe_ic.h @@ -3,7 +3,7 @@ * * QUICC ENGINE Interrupt Controller Header * - * Copyright (C) 2006 Freescale Semiconductor, Inc. All rights reserved. + * Copyright (C) 2006 Freescale Semicondutor, Inc. All rights reserved. * * Author: Li Yang * Based on code from Shlomi Gridish diff --git a/trunk/arch/powerpc/sysdev/qe_lib/qe_io.c b/trunk/arch/powerpc/sysdev/qe_lib/qe_io.c index a88807b3dd57..fd1a6c3b1721 100644 --- a/trunk/arch/powerpc/sysdev/qe_lib/qe_io.c +++ b/trunk/arch/powerpc/sysdev/qe_lib/qe_io.c @@ -3,7 +3,7 @@ * * QE Parallel I/O ports configuration routines * - * Copyright 2006 Freescale Semiconductor, Inc. All rights reserved. + * Copyright (C) Freescale Semicondutor, Inc. 2006. All rights reserved. * * Author: Li Yang * Based on code from Shlomi Gridish diff --git a/trunk/arch/powerpc/sysdev/qe_lib/ucc.c b/trunk/arch/powerpc/sysdev/qe_lib/ucc.c index 134b07d29435..04677505f20f 100644 --- a/trunk/arch/powerpc/sysdev/qe_lib/ucc.c +++ b/trunk/arch/powerpc/sysdev/qe_lib/ucc.c @@ -3,7 +3,7 @@ * * QE UCC API Set - UCC specific routines implementations. * - * Copyright (C) 2006 Freescale Semiconductor, Inc. All rights reserved. + * Copyright (C) 2006 Freescale Semicondutor, Inc. All rights reserved. * * Authors: Shlomi Gridish * Li Yang diff --git a/trunk/arch/powerpc/sysdev/qe_lib/ucc_fast.c b/trunk/arch/powerpc/sysdev/qe_lib/ucc_fast.c index cceb2e366738..fba02440d122 100644 --- a/trunk/arch/powerpc/sysdev/qe_lib/ucc_fast.c +++ b/trunk/arch/powerpc/sysdev/qe_lib/ucc_fast.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2006 Freescale Semiconductor, Inc. All rights reserved. + * Copyright (C) 2006 Freescale Semicondutor, Inc. All rights reserved. * * Authors: Shlomi Gridish * Li Yang diff --git a/trunk/arch/powerpc/sysdev/qe_lib/ucc_slow.c b/trunk/arch/powerpc/sysdev/qe_lib/ucc_slow.c index 1c062f48f1ac..524c0ead941d 100644 --- a/trunk/arch/powerpc/sysdev/qe_lib/ucc_slow.c +++ b/trunk/arch/powerpc/sysdev/qe_lib/ucc_slow.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2006 Freescale Semiconductor, Inc. All rights reserved. + * Copyright (C) 2006 Freescale Semicondutor, Inc. All rights reserved. * * Authors: Shlomi Gridish * Li Yang diff --git a/trunk/arch/powerpc/sysdev/qe_lib/usb.c b/trunk/arch/powerpc/sysdev/qe_lib/usb.c index 27f23bd15eb6..9162828f5da7 100644 --- a/trunk/arch/powerpc/sysdev/qe_lib/usb.c +++ b/trunk/arch/powerpc/sysdev/qe_lib/usb.c @@ -1,7 +1,7 @@ /* * QE USB routines * - * Copyright 2006 Freescale Semiconductor, Inc. + * Copyright (c) Freescale Semicondutor, Inc. 2006. * Shlomi Gridish * Jerry Huang * Copyright (c) MontaVista Software, Inc. 2008. diff --git a/trunk/arch/powerpc/xmon/Makefile b/trunk/arch/powerpc/xmon/Makefile index b49fdbd15808..c168c54e3c40 100644 --- a/trunk/arch/powerpc/xmon/Makefile +++ b/trunk/arch/powerpc/xmon/Makefile @@ -6,7 +6,7 @@ GCOV_PROFILE := n ccflags-$(CONFIG_PPC64) := -mno-minimal-toc -obj-y += xmon.o nonstdio.o +obj-y += xmon.o start.o nonstdio.o ifdef CONFIG_XMON_DISASSEMBLY obj-y += ppc-dis.o ppc-opc.o diff --git a/trunk/arch/powerpc/xmon/nonstdio.c b/trunk/arch/powerpc/xmon/nonstdio.c index bce3dcfe5058..bfac84fbe780 100644 --- a/trunk/arch/powerpc/xmon/nonstdio.c +++ b/trunk/arch/powerpc/xmon/nonstdio.c @@ -7,23 +7,9 @@ * 2 of the License, or (at your option) any later version. */ #include -#include #include #include "nonstdio.h" - -static int xmon_write(const void *ptr, int nb) -{ - return udbg_write(ptr, nb); -} - -static int xmon_readchar(void) -{ - if (udbg_getc) - return udbg_getc(); - return -1; -} - int xmon_putchar(int c) { char ch = c; @@ -37,7 +23,34 @@ static char line[256]; static char *lineptr; static int lineleft; -static int xmon_getchar(void) +int xmon_expect(const char *str, unsigned long timeout) +{ + int c; + unsigned long t0; + + /* assume 25MHz default timebase if tb_ticks_per_sec not set yet */ + timeout *= tb_ticks_per_sec? tb_ticks_per_sec: 25000000; + t0 = get_tbl(); + do { + lineptr = line; + for (;;) { + c = xmon_read_poll(); + if (c == -1) { + if (get_tbl() - t0 > timeout) + return 0; + continue; + } + if (c == '\n') + break; + if (c != '\r' && lineptr < &line[sizeof(line) - 1]) + *lineptr++ = c; + } + *lineptr = 0; + } while (strstr(line, str) == NULL); + return 1; +} + +int xmon_getchar(void) { int c; @@ -111,19 +124,13 @@ char *xmon_gets(char *str, int nb) void xmon_printf(const char *format, ...) { va_list args; + int n; static char xmon_outbuf[1024]; - int rc, n; va_start(args, format); n = vsnprintf(xmon_outbuf, sizeof(xmon_outbuf), format, args); va_end(args); - - rc = xmon_write(xmon_outbuf, n); - - if (n && rc == 0) { - /* No udbg hooks, fallback to printk() - dangerous */ - printk(xmon_outbuf); - } + xmon_write(xmon_outbuf, n); } void xmon_puts(const char *str) diff --git a/trunk/arch/powerpc/xmon/nonstdio.h b/trunk/arch/powerpc/xmon/nonstdio.h index 18a51ded4ffd..23dd95f4599c 100644 --- a/trunk/arch/powerpc/xmon/nonstdio.h +++ b/trunk/arch/powerpc/xmon/nonstdio.h @@ -4,6 +4,12 @@ #define putchar xmon_putchar extern int xmon_putchar(int c); +extern int xmon_getchar(void); extern void xmon_puts(const char *); extern char *xmon_gets(char *, int); extern void xmon_printf(const char *, ...); +extern void xmon_map_scc(void); +extern int xmon_expect(const char *str, unsigned long timeout); +extern int xmon_write(const void *ptr, int nb); +extern int xmon_readchar(void); +extern int xmon_read_poll(void); diff --git a/trunk/arch/powerpc/xmon/start.c b/trunk/arch/powerpc/xmon/start.c new file mode 100644 index 000000000000..8864de2af382 --- /dev/null +++ b/trunk/arch/powerpc/xmon/start.c @@ -0,0 +1,34 @@ +/* + * Copyright (C) 1996 Paul Mackerras. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version + * 2 of the License, or (at your option) any later version. + */ +#include +#include +#include "nonstdio.h" + +void xmon_map_scc(void) +{ +} + +int xmon_write(const void *ptr, int nb) +{ + return udbg_write(ptr, nb); +} + +int xmon_readchar(void) +{ + if (udbg_getc) + return udbg_getc(); + return -1; +} + +int xmon_read_poll(void) +{ + if (udbg_getc_poll) + return udbg_getc_poll(); + return -1; +} diff --git a/trunk/arch/powerpc/xmon/xmon.c b/trunk/arch/powerpc/xmon/xmon.c index 1f8d2f10a432..3a56a639a92e 100644 --- a/trunk/arch/powerpc/xmon/xmon.c +++ b/trunk/arch/powerpc/xmon/xmon.c @@ -52,6 +52,9 @@ #include "nonstdio.h" #include "dis-asm.h" +#define scanhex xmon_scanhex +#define skipbl xmon_skipbl + #ifdef CONFIG_SMP static cpumask_t cpus_in_xmon = CPU_MASK_NONE; static unsigned long xmon_taken = 1; @@ -166,8 +169,12 @@ extern void xmon_leave(void); #ifdef CONFIG_PPC64 #define REG "%.16lx" +#define REGS_PER_LINE 4 +#define LAST_VOLATILE 13 #else #define REG "%.8lx" +#define REGS_PER_LINE 8 +#define LAST_VOLATILE 12 #endif #define GETWORD(v) (((v)[0] << 24) + ((v)[1] << 16) + ((v)[2] << 8) + (v)[3]) @@ -1281,19 +1288,27 @@ static void get_function_bounds(unsigned long pc, unsigned long *startp, catch_memory_errors = 0; } +static int xmon_depth_to_print = 64; + #define LRSAVE_OFFSET (STACK_FRAME_LR_SAVE * sizeof(unsigned long)) #define MARKER_OFFSET (STACK_FRAME_MARKER * sizeof(unsigned long)) +#ifdef __powerpc64__ +#define REGS_OFFSET 0x70 +#else +#define REGS_OFFSET 16 +#endif + static void xmon_show_stack(unsigned long sp, unsigned long lr, unsigned long pc) { - int max_to_print = 64; unsigned long ip; unsigned long newsp; unsigned long marker; + int count = 0; struct pt_regs regs; - while (max_to_print--) { + do { if (sp < PAGE_OFFSET) { if (sp != 0) printf("SP (%lx) is in userspace\n", sp); @@ -1347,10 +1362,10 @@ static void xmon_show_stack(unsigned long sp, unsigned long lr, an exception frame. */ if (mread(sp + MARKER_OFFSET, &marker, sizeof(unsigned long)) && marker == STACK_FRAME_REGS_MARKER) { - if (mread(sp + STACK_FRAME_OVERHEAD, ®s, sizeof(regs)) + if (mread(sp + REGS_OFFSET, ®s, sizeof(regs)) != sizeof(regs)) { printf("Couldn't read registers at %lx\n", - sp + STACK_FRAME_OVERHEAD); + sp + REGS_OFFSET); break; } printf("--- Exception: %lx %s at ", regs.trap, @@ -1364,7 +1379,7 @@ static void xmon_show_stack(unsigned long sp, unsigned long lr, break; sp = newsp; - } + } while (count++ < xmon_depth_to_print); } static void backtrace(struct pt_regs *excp) @@ -2928,6 +2943,7 @@ static void xmon_init(int enable) __debugger_dabr_match = NULL; __debugger_fault_handler = NULL; } + xmon_map_scc(); } #ifdef CONFIG_MAGIC_SYSRQ diff --git a/trunk/drivers/macintosh/windfarm_fcu_controls.c b/trunk/drivers/macintosh/windfarm_fcu_controls.c index fd6ed15a979d..b3411edb324b 100644 --- a/trunk/drivers/macintosh/windfarm_fcu_controls.c +++ b/trunk/drivers/macintosh/windfarm_fcu_controls.c @@ -593,7 +593,19 @@ static struct i2c_driver wf_fcu_driver = { .id_table = wf_fcu_id, }; -module_i2c_driver(wf_fcu_driver); +static int __init wf_fcu_init(void) +{ + return i2c_add_driver(&wf_fcu_driver); +} + +static void __exit wf_fcu_exit(void) +{ + i2c_del_driver(&wf_fcu_driver); +} + + +module_init(wf_fcu_init); +module_exit(wf_fcu_exit); MODULE_AUTHOR("Benjamin Herrenschmidt "); MODULE_DESCRIPTION("FCU control objects for PowerMacs thermal control"); diff --git a/trunk/drivers/macintosh/windfarm_lm75_sensor.c b/trunk/drivers/macintosh/windfarm_lm75_sensor.c index 9ef32b3df91f..b0c2d3695b34 100644 --- a/trunk/drivers/macintosh/windfarm_lm75_sensor.c +++ b/trunk/drivers/macintosh/windfarm_lm75_sensor.c @@ -174,7 +174,19 @@ static struct i2c_driver wf_lm75_driver = { .id_table = wf_lm75_id, }; -module_i2c_driver(wf_lm75_driver); +static int __init wf_lm75_sensor_init(void) +{ + return i2c_add_driver(&wf_lm75_driver); +} + +static void __exit wf_lm75_sensor_exit(void) +{ + i2c_del_driver(&wf_lm75_driver); +} + + +module_init(wf_lm75_sensor_init); +module_exit(wf_lm75_sensor_exit); MODULE_AUTHOR("Benjamin Herrenschmidt "); MODULE_DESCRIPTION("LM75 sensor objects for PowerMacs thermal control"); diff --git a/trunk/drivers/macintosh/windfarm_max6690_sensor.c b/trunk/drivers/macintosh/windfarm_max6690_sensor.c index 945a25b2f31e..371b058d2f7d 100644 --- a/trunk/drivers/macintosh/windfarm_max6690_sensor.c +++ b/trunk/drivers/macintosh/windfarm_max6690_sensor.c @@ -130,7 +130,18 @@ static struct i2c_driver wf_max6690_driver = { .id_table = wf_max6690_id, }; -module_i2c_driver(wf_max6690_driver); +static int __init wf_max6690_sensor_init(void) +{ + return i2c_add_driver(&wf_max6690_driver); +} + +static void __exit wf_max6690_sensor_exit(void) +{ + i2c_del_driver(&wf_max6690_driver); +} + +module_init(wf_max6690_sensor_init); +module_exit(wf_max6690_sensor_exit); MODULE_AUTHOR("Paul Mackerras "); MODULE_DESCRIPTION("MAX6690 sensor objects for PowerMac thermal control"); diff --git a/trunk/drivers/macintosh/windfarm_smu_sat.c b/trunk/drivers/macintosh/windfarm_smu_sat.c index d87f5ee04ca9..426e810233d7 100644 --- a/trunk/drivers/macintosh/windfarm_smu_sat.c +++ b/trunk/drivers/macintosh/windfarm_smu_sat.c @@ -364,7 +364,18 @@ static struct i2c_driver wf_sat_driver = { .id_table = wf_sat_id, }; -module_i2c_driver(wf_sat_driver); +static int __init sat_sensors_init(void) +{ + return i2c_add_driver(&wf_sat_driver); +} + +static void __exit sat_sensors_exit(void) +{ + i2c_del_driver(&wf_sat_driver); +} + +module_init(sat_sensors_init); +module_exit(sat_sensors_exit); MODULE_AUTHOR("Paul Mackerras "); MODULE_DESCRIPTION("SMU satellite sensors for PowerMac thermal control"); diff --git a/trunk/drivers/of/base.c b/trunk/drivers/of/base.c index af3b22ac7627..bbd073f53c9f 100644 --- a/trunk/drivers/of/base.c +++ b/trunk/drivers/of/base.c @@ -1160,6 +1160,22 @@ int prom_update_property(struct device_node *np, * device tree nodes. */ +#ifdef CONFIG_PROC_DEVICETREE +static void of_add_proc_dt_entry(struct device_node *dn) +{ + struct proc_dir_entry *ent; + + ent = proc_mkdir(strrchr(dn->full_name, '/') + 1, dn->parent->pde); + if (ent) + proc_device_tree_add_node(dn, ent); +} +#else +static void of_add_proc_dt_entry(struct device_node *dn) +{ + return; +} +#endif + /** * of_attach_node - Plug a device node into the tree and global list. */ @@ -1173,8 +1189,31 @@ void of_attach_node(struct device_node *np) np->parent->child = np; allnodes = np; write_unlock_irqrestore(&devtree_lock, flags); + + of_add_proc_dt_entry(np); } +#ifdef CONFIG_PROC_DEVICETREE +static void of_remove_proc_dt_entry(struct device_node *dn) +{ + struct device_node *parent = dn->parent; + struct property *prop = dn->properties; + + while (prop) { + remove_proc_entry(prop->name, dn->pde); + prop = prop->next; + } + + if (dn->pde) + remove_proc_entry(dn->pde->name, parent->pde); +} +#else +static void of_remove_proc_dt_entry(struct device_node *dn) +{ + return; +} +#endif + /** * of_detach_node - "Unplug" a node from the device tree. * @@ -1188,9 +1227,17 @@ void of_detach_node(struct device_node *np) write_lock_irqsave(&devtree_lock, flags); + if (of_node_check_flag(np, OF_DETACHED)) { + /* someone already detached it */ + write_unlock_irqrestore(&devtree_lock, flags); + return; + } + parent = np->parent; - if (!parent) - goto out_unlock; + if (!parent) { + write_unlock_irqrestore(&devtree_lock, flags); + return; + } if (allnodes == np) allnodes = np->allnext; @@ -1215,9 +1262,9 @@ void of_detach_node(struct device_node *np) } of_node_set_flag(np, OF_DETACHED); - -out_unlock: write_unlock_irqrestore(&devtree_lock, flags); + + of_remove_proc_dt_entry(np); } #endif /* defined(CONFIG_OF_DYNAMIC) */ diff --git a/trunk/drivers/video/Kconfig b/trunk/drivers/video/Kconfig index 0cff083fbbe2..d08d7998a4aa 100644 --- a/trunk/drivers/video/Kconfig +++ b/trunk/drivers/video/Kconfig @@ -2140,16 +2140,14 @@ config FB_UDL To compile as a module, choose M here: the module name is udlfb. config FB_IBM_GXT4500 - tristate "Framebuffer support for IBM GXT4000P/4500P/6000P/6500P adaptors" + tristate "Framebuffer support for IBM GXT4500P adaptor" depends on FB && PPC select FB_CFB_FILLRECT select FB_CFB_COPYAREA select FB_CFB_IMAGEBLIT ---help--- - Say Y here to enable support for the IBM GXT4000P/6000P and - GXT4500P/6500P display adaptor based on Raster Engine RC1000, - found on some IBM System P (pSeries) machines. This driver - doesn't use Geometry Engine GT1000. + Say Y here to enable support for the IBM GXT4500P display + adaptor, found on some IBM System P (pSeries) machines. config FB_PS3 tristate "PS3 GPU framebuffer driver" diff --git a/trunk/drivers/video/gxt4500.c b/trunk/drivers/video/gxt4500.c index 4bdea6e9bd55..0e9afa41d163 100644 --- a/trunk/drivers/video/gxt4500.c +++ b/trunk/drivers/video/gxt4500.c @@ -1,6 +1,5 @@ /* - * Frame buffer device for IBM GXT4500P/6500P and GXT4000P/6000P - * display adaptors + * Frame buffer device for IBM GXT4500P and GXT6000P display adaptors * * Copyright (C) 2006 Paul Mackerras, IBM Corp. */ @@ -15,8 +14,6 @@ #include #define PCI_DEVICE_ID_IBM_GXT4500P 0x21c -#define PCI_DEVICE_ID_IBM_GXT6500P 0x21b -#define PCI_DEVICE_ID_IBM_GXT4000P 0x16e #define PCI_DEVICE_ID_IBM_GXT6000P 0x170 /* GXT4500P registers */ @@ -176,8 +173,6 @@ static const struct fb_videomode defaultmode __devinitconst = { /* List of supported cards */ enum gxt_cards { GXT4500P, - GXT6500P, - GXT4000P, GXT6000P }; @@ -187,8 +182,6 @@ static const struct cardinfo { const char *cardname; } cardinfo[] = { [GXT4500P] = { .refclk_ps = 9259, .cardname = "IBM GXT4500P" }, - [GXT6500P] = { .refclk_ps = 9259, .cardname = "IBM GXT6500P" }, - [GXT4000P] = { .refclk_ps = 40000, .cardname = "IBM GXT4000P" }, [GXT6000P] = { .refclk_ps = 40000, .cardname = "IBM GXT6000P" }, }; @@ -743,10 +736,6 @@ static void __devexit gxt4500_remove(struct pci_dev *pdev) static const struct pci_device_id gxt4500_pci_tbl[] = { { PCI_DEVICE(PCI_VENDOR_ID_IBM, PCI_DEVICE_ID_IBM_GXT4500P), .driver_data = GXT4500P }, - { PCI_DEVICE(PCI_VENDOR_ID_IBM, PCI_DEVICE_ID_IBM_GXT6500P), - .driver_data = GXT6500P }, - { PCI_DEVICE(PCI_VENDOR_ID_IBM, PCI_DEVICE_ID_IBM_GXT4000P), - .driver_data = GXT4000P }, { PCI_DEVICE(PCI_VENDOR_ID_IBM, PCI_DEVICE_ID_IBM_GXT6000P), .driver_data = GXT6000P }, { 0 } @@ -779,7 +768,7 @@ static void __exit gxt4500_exit(void) module_exit(gxt4500_exit); MODULE_AUTHOR("Paul Mackerras "); -MODULE_DESCRIPTION("FBDev driver for IBM GXT4500P/6500P and GXT4000P/6000P"); +MODULE_DESCRIPTION("FBDev driver for IBM GXT4500P/6000P"); MODULE_LICENSE("GPL"); module_param(mode_option, charp, 0); MODULE_PARM_DESC(mode_option, "Specify resolution as \"x[-][@]\""); diff --git a/trunk/tools/perf/perf.h b/trunk/tools/perf/perf.h index d4960c3834e7..276287783a03 100644 --- a/trunk/tools/perf/perf.h +++ b/trunk/tools/perf/perf.h @@ -26,7 +26,7 @@ void get_term_dimensions(struct winsize *ws); #endif #ifdef __powerpc__ -#include "../../arch/powerpc/include/uapi/asm/unistd.h" +#include "../../arch/powerpc/include/asm/unistd.h" #define rmb() asm volatile ("sync" ::: "memory") #define cpu_relax() asm volatile ("" ::: "memory"); #define CPUINFO_PROC "cpu"