aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/asm-powerpc/cputable.h13
-rw-r--r--include/asm-powerpc/dcr.h1
-rw-r--r--include/asm-powerpc/elf.h2
-rw-r--r--include/asm-powerpc/firmware.h10
-rw-r--r--include/asm-powerpc/fs_pd.h49
-rw-r--r--include/asm-powerpc/hvcall.h1
-rw-r--r--include/asm-powerpc/io.h6
-rw-r--r--include/asm-powerpc/iommu.h1
-rw-r--r--include/asm-powerpc/ipic.h2
-rw-r--r--include/asm-powerpc/irq.h3
-rw-r--r--include/asm-powerpc/kprobes.h7
-rw-r--r--include/asm-powerpc/mmu.h1
-rw-r--r--include/asm-powerpc/mpc52xx.h2
-rw-r--r--include/asm-powerpc/mpc8260.h24
-rw-r--r--include/asm-powerpc/mpc8xx.h28
-rw-r--r--include/asm-powerpc/mpic.h24
-rw-r--r--include/asm-powerpc/oprofile_impl.h89
-rw-r--r--include/asm-powerpc/pci-bridge.h2
-rw-r--r--include/asm-powerpc/ps3.h225
-rw-r--r--include/asm-powerpc/reg.h14
-rw-r--r--include/asm-powerpc/smp.h1
-rw-r--r--include/asm-powerpc/spu.h13
-rw-r--r--include/asm-powerpc/spu_priv1.h2
-rw-r--r--include/asm-powerpc/sstep.h1
-rw-r--r--include/asm-powerpc/time.h2
-rw-r--r--include/asm-powerpc/udbg.h2
-rw-r--r--include/asm-ppc/commproc.h1
-rw-r--r--include/asm-ppc/ibm4xx.h1
-rw-r--r--include/asm-ppc/m48t35.h77
-rw-r--r--include/asm-ppc/reg_booke.h2
-rw-r--r--include/asm-ppc/serial.h2
-rw-r--r--include/linux/log2.h11
-rw-r--r--include/linux/sysdev.h12
33 files changed, 278 insertions, 353 deletions
diff --git a/include/asm-powerpc/cputable.h b/include/asm-powerpc/cputable.h
index 7384b8086b75..e870b5393175 100644
--- a/include/asm-powerpc/cputable.h
+++ b/include/asm-powerpc/cputable.h
@@ -50,6 +50,12 @@ enum powerpc_oprofile_type {
50 PPC_OPROFILE_CELL = 5, 50 PPC_OPROFILE_CELL = 5,
51}; 51};
52 52
53enum powerpc_pmc_type {
54 PPC_PMC_DEFAULT = 0,
55 PPC_PMC_IBM = 1,
56 PPC_PMC_PA6T = 2,
57};
58
53struct cpu_spec { 59struct cpu_spec {
54 /* CPU is matched via (PVR & pvr_mask) == pvr_value */ 60 /* CPU is matched via (PVR & pvr_mask) == pvr_value */
55 unsigned int pvr_mask; 61 unsigned int pvr_mask;
@@ -65,6 +71,7 @@ struct cpu_spec {
65 71
66 /* number of performance monitor counters */ 72 /* number of performance monitor counters */
67 unsigned int num_pmcs; 73 unsigned int num_pmcs;
74 enum powerpc_pmc_type pmc_type;
68 75
69 /* this is called to initialize various CPU bits like L1 cache, 76 /* this is called to initialize various CPU bits like L1 cache,
70 * BHT, SPD, etc... from head.S before branching to identify_machine 77 * BHT, SPD, etc... from head.S before branching to identify_machine
@@ -337,12 +344,6 @@ extern void do_feature_fixups(unsigned long value, void *fixup_start,
337 CPU_FTR_COHERENT_ICACHE | CPU_FTR_LOCKLESS_TLBIE | \ 344 CPU_FTR_COHERENT_ICACHE | CPU_FTR_LOCKLESS_TLBIE | \
338 CPU_FTR_PURR | CPU_FTR_SPURR | CPU_FTR_REAL_LE | \ 345 CPU_FTR_PURR | CPU_FTR_SPURR | CPU_FTR_REAL_LE | \
339 CPU_FTR_DSCR) 346 CPU_FTR_DSCR)
340#define CPU_FTRS_POWER6X (CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | \
341 CPU_FTR_HPTE_TABLE | CPU_FTR_PPCAS_ARCH_V2 | CPU_FTR_CTRL | \
342 CPU_FTR_MMCRA | CPU_FTR_SMT | \
343 CPU_FTR_COHERENT_ICACHE | CPU_FTR_LOCKLESS_TLBIE | \
344 CPU_FTR_PURR | CPU_FTR_CI_LARGE_PAGE | \
345 CPU_FTR_SPURR | CPU_FTR_REAL_LE | CPU_FTR_DSCR)
346#define CPU_FTRS_CELL (CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | \ 347#define CPU_FTRS_CELL (CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | \
347 CPU_FTR_HPTE_TABLE | CPU_FTR_PPCAS_ARCH_V2 | CPU_FTR_CTRL | \ 348 CPU_FTR_HPTE_TABLE | CPU_FTR_PPCAS_ARCH_V2 | CPU_FTR_CTRL | \
348 CPU_FTR_ALTIVEC_COMP | CPU_FTR_MMCRA | CPU_FTR_SMT | \ 349 CPU_FTR_ALTIVEC_COMP | CPU_FTR_MMCRA | CPU_FTR_SMT | \
diff --git a/include/asm-powerpc/dcr.h b/include/asm-powerpc/dcr.h
index b66c5e6941f0..9338d50538f1 100644
--- a/include/asm-powerpc/dcr.h
+++ b/include/asm-powerpc/dcr.h
@@ -33,6 +33,7 @@
33 * base from the device-tree 33 * base from the device-tree
34 */ 34 */
35#ifdef CONFIG_PPC_MERGE 35#ifdef CONFIG_PPC_MERGE
36struct device_node;
36extern unsigned int dcr_resource_start(struct device_node *np, 37extern unsigned int dcr_resource_start(struct device_node *np,
37 unsigned int index); 38 unsigned int index);
38extern unsigned int dcr_resource_len(struct device_node *np, 39extern unsigned int dcr_resource_len(struct device_node *np,
diff --git a/include/asm-powerpc/elf.h b/include/asm-powerpc/elf.h
index d36426c01b6b..de507995c7b1 100644
--- a/include/asm-powerpc/elf.h
+++ b/include/asm-powerpc/elf.h
@@ -173,7 +173,7 @@ typedef elf_vrreg_t elf_vrregset_t32[ELF_NVRREG32];
173 the loader. We need to make sure that it is out of the way of the program 173 the loader. We need to make sure that it is out of the way of the program
174 that it will "exec", and that there is sufficient room for the brk. */ 174 that it will "exec", and that there is sufficient room for the brk. */
175 175
176#define ELF_ET_DYN_BASE (0x08000000) 176#define ELF_ET_DYN_BASE (0x20000000)
177 177
178/* Common routine for both 32-bit and 64-bit processes */ 178/* Common routine for both 32-bit and 64-bit processes */
179static inline void ppc_elf_core_copy_regs(elf_gregset_t elf_regs, 179static inline void ppc_elf_core_copy_regs(elf_gregset_t elf_regs,
diff --git a/include/asm-powerpc/firmware.h b/include/asm-powerpc/firmware.h
index 98f7b62422c9..3671c128f271 100644
--- a/include/asm-powerpc/firmware.h
+++ b/include/asm-powerpc/firmware.h
@@ -43,6 +43,8 @@
43#define FW_FEATURE_ISERIES ASM_CONST(0x0000000000200000) 43#define FW_FEATURE_ISERIES ASM_CONST(0x0000000000200000)
44#define FW_FEATURE_LPAR ASM_CONST(0x0000000000400000) 44#define FW_FEATURE_LPAR ASM_CONST(0x0000000000400000)
45#define FW_FEATURE_PS3_LV1 ASM_CONST(0x0000000000800000) 45#define FW_FEATURE_PS3_LV1 ASM_CONST(0x0000000000800000)
46#define FW_FEATURE_BEAT ASM_CONST(0x0000000001000000)
47#define FW_FEATURE_BULK_REMOVE ASM_CONST(0x0000000002000000)
46 48
47#ifndef __ASSEMBLY__ 49#ifndef __ASSEMBLY__
48 50
@@ -61,6 +63,8 @@ enum {
61 FW_FEATURE_ISERIES_ALWAYS = FW_FEATURE_ISERIES | FW_FEATURE_LPAR, 63 FW_FEATURE_ISERIES_ALWAYS = FW_FEATURE_ISERIES | FW_FEATURE_LPAR,
62 FW_FEATURE_PS3_POSSIBLE = FW_FEATURE_LPAR | FW_FEATURE_PS3_LV1, 64 FW_FEATURE_PS3_POSSIBLE = FW_FEATURE_LPAR | FW_FEATURE_PS3_LV1,
63 FW_FEATURE_PS3_ALWAYS = FW_FEATURE_LPAR | FW_FEATURE_PS3_LV1, 65 FW_FEATURE_PS3_ALWAYS = FW_FEATURE_LPAR | FW_FEATURE_PS3_LV1,
66 FW_FEATURE_CELLEB_POSSIBLE = FW_FEATURE_LPAR | FW_FEATURE_BEAT,
67 FW_FEATURE_CELLEB_ALWAYS = FW_FEATURE_LPAR | FW_FEATURE_BEAT,
64 FW_FEATURE_NATIVE_POSSIBLE = 0, 68 FW_FEATURE_NATIVE_POSSIBLE = 0,
65 FW_FEATURE_NATIVE_ALWAYS = 0, 69 FW_FEATURE_NATIVE_ALWAYS = 0,
66 FW_FEATURE_POSSIBLE = 70 FW_FEATURE_POSSIBLE =
@@ -73,6 +77,9 @@ enum {
73#ifdef CONFIG_PPC_PS3 77#ifdef CONFIG_PPC_PS3
74 FW_FEATURE_PS3_POSSIBLE | 78 FW_FEATURE_PS3_POSSIBLE |
75#endif 79#endif
80#ifdef CONFIG_PPC_CELLEB
81 FW_FEATURE_CELLEB_POSSIBLE |
82#endif
76#ifdef CONFIG_PPC_NATIVE 83#ifdef CONFIG_PPC_NATIVE
77 FW_FEATURE_NATIVE_ALWAYS | 84 FW_FEATURE_NATIVE_ALWAYS |
78#endif 85#endif
@@ -87,6 +94,9 @@ enum {
87#ifdef CONFIG_PPC_PS3 94#ifdef CONFIG_PPC_PS3
88 FW_FEATURE_PS3_ALWAYS & 95 FW_FEATURE_PS3_ALWAYS &
89#endif 96#endif
97#ifdef CONFIG_PPC_CELLEB
98 FW_FEATURE_CELLEB_ALWAYS &
99#endif
90#ifdef CONFIG_PPC_NATIVE 100#ifdef CONFIG_PPC_NATIVE
91 FW_FEATURE_NATIVE_ALWAYS & 101 FW_FEATURE_NATIVE_ALWAYS &
92#endif 102#endif
diff --git a/include/asm-powerpc/fs_pd.h b/include/asm-powerpc/fs_pd.h
index 3d0e819d37f1..c624915b757e 100644
--- a/include/asm-powerpc/fs_pd.h
+++ b/include/asm-powerpc/fs_pd.h
@@ -11,19 +11,17 @@
11 11
12#ifndef FS_PD_H 12#ifndef FS_PD_H
13#define FS_PD_H 13#define FS_PD_H
14#include <asm/cpm2.h>
15#include <sysdev/fsl_soc.h> 14#include <sysdev/fsl_soc.h>
16#include <asm/time.h> 15#include <asm/time.h>
17 16
18static inline int uart_baudrate(void) 17#ifdef CONFIG_CPM2
19{ 18#include <asm/cpm2.h>
20 return get_baudrate();
21}
22 19
23static inline int uart_clock(void) 20#if defined(CONFIG_8260)
24{ 21#include <asm/mpc8260.h>
25 return ppc_proc_freq; 22#elif defined(CONFIG_85xx)
26} 23#include <asm/mpc85xx.h>
24#endif
27 25
28#define cpm2_map(member) \ 26#define cpm2_map(member) \
29({ \ 27({ \
@@ -41,5 +39,38 @@ static inline int uart_clock(void)
41}) 39})
42 40
43#define cpm2_unmap(addr) iounmap(addr) 41#define cpm2_unmap(addr) iounmap(addr)
42#endif
43
44#ifdef CONFIG_8xx
45#include <asm/8xx_immap.h>
46#include <asm/mpc8xx.h>
47
48#define immr_map(member) \
49({ \
50 u32 offset = offsetof(immap_t, member); \
51 void *addr = ioremap (IMAP_ADDR + offset, \
52 sizeof( ((immap_t*)0)->member)); \
53 addr; \
54})
55
56#define immr_map_size(member, size) \
57({ \
58 u32 offset = offsetof(immap_t, member); \
59 void *addr = ioremap (IMAP_ADDR + offset, size); \
60 addr; \
61})
62
63#define immr_unmap(addr) iounmap(addr)
64#endif
65
66static inline int uart_baudrate(void)
67{
68 return get_baudrate();
69}
70
71static inline int uart_clock(void)
72{
73 return ppc_proc_freq;
74}
44 75
45#endif 76#endif
diff --git a/include/asm-powerpc/hvcall.h b/include/asm-powerpc/hvcall.h
index 7a500732b671..60977806d2f4 100644
--- a/include/asm-powerpc/hvcall.h
+++ b/include/asm-powerpc/hvcall.h
@@ -168,6 +168,7 @@
168#define H_FREE_LOGICAL_LAN 0x118 168#define H_FREE_LOGICAL_LAN 0x118
169#define H_ADD_LOGICAL_LAN_BUFFER 0x11C 169#define H_ADD_LOGICAL_LAN_BUFFER 0x11C
170#define H_SEND_LOGICAL_LAN 0x120 170#define H_SEND_LOGICAL_LAN 0x120
171#define H_BULK_REMOVE 0x124
171#define H_MULTICAST_CTRL 0x130 172#define H_MULTICAST_CTRL 0x130
172#define H_SET_XDABR 0x134 173#define H_SET_XDABR 0x134
173#define H_STUFF_TCE 0x138 174#define H_STUFF_TCE 0x138
diff --git a/include/asm-powerpc/io.h b/include/asm-powerpc/io.h
index 1cd532379c30..301c9bb308b1 100644
--- a/include/asm-powerpc/io.h
+++ b/include/asm-powerpc/io.h
@@ -732,6 +732,12 @@ static inline void * bus_to_virt(unsigned long address)
732 732
733#endif /* CONFIG_PPC32 */ 733#endif /* CONFIG_PPC32 */
734 734
735/* access ports */
736#define setbits32(_addr, _v) out_be32((_addr), in_be32(_addr) | (_v))
737#define clrbits32(_addr, _v) out_be32((_addr), in_be32(_addr) & ~(_v))
738
739#define setbits16(_addr, _v) out_be16((_addr), in_be16(_addr) | (_v))
740#define clrbits16(_addr, _v) out_be16((_addr), in_be16(_addr) & ~(_v))
735 741
736#endif /* __KERNEL__ */ 742#endif /* __KERNEL__ */
737 743
diff --git a/include/asm-powerpc/iommu.h b/include/asm-powerpc/iommu.h
index f85dbd305558..b2e56b30306a 100644
--- a/include/asm-powerpc/iommu.h
+++ b/include/asm-powerpc/iommu.h
@@ -99,6 +99,7 @@ extern void iommu_unmap_single(struct iommu_table *tbl, dma_addr_t dma_handle,
99extern void iommu_init_early_pSeries(void); 99extern void iommu_init_early_pSeries(void);
100extern void iommu_init_early_iSeries(void); 100extern void iommu_init_early_iSeries(void);
101extern void iommu_init_early_dart(void); 101extern void iommu_init_early_dart(void);
102extern void iommu_init_early_pasemi(void);
102 103
103#ifdef CONFIG_PCI 104#ifdef CONFIG_PCI
104extern void pci_iommu_init(void); 105extern void pci_iommu_init(void);
diff --git a/include/asm-powerpc/ipic.h b/include/asm-powerpc/ipic.h
index 9fbb03415860..edec79dcb7c1 100644
--- a/include/asm-powerpc/ipic.h
+++ b/include/asm-powerpc/ipic.h
@@ -78,7 +78,7 @@ extern u32 ipic_get_mcp_status(void);
78extern void ipic_clear_mcp_status(u32 mask); 78extern void ipic_clear_mcp_status(u32 mask);
79 79
80#ifdef CONFIG_PPC_MERGE 80#ifdef CONFIG_PPC_MERGE
81extern void ipic_init(struct device_node *node, unsigned int flags); 81extern struct ipic * ipic_init(struct device_node *node, unsigned int flags);
82extern unsigned int ipic_get_irq(void); 82extern unsigned int ipic_get_irq(void);
83#else 83#else
84extern void ipic_init(phys_addr_t phys_addr, unsigned int flags, 84extern void ipic_init(phys_addr_t phys_addr, unsigned int flags,
diff --git a/include/asm-powerpc/irq.h b/include/asm-powerpc/irq.h
index 46476e9a494a..4734cc178db5 100644
--- a/include/asm-powerpc/irq.h
+++ b/include/asm-powerpc/irq.h
@@ -89,6 +89,9 @@ struct irq_host_ops {
89 /* Dispose of such a mapping */ 89 /* Dispose of such a mapping */
90 void (*unmap)(struct irq_host *h, unsigned int virq); 90 void (*unmap)(struct irq_host *h, unsigned int virq);
91 91
92 /* Update of such a mapping */
93 void (*remap)(struct irq_host *h, unsigned int virq, irq_hw_number_t hw);
94
92 /* Translate device-tree interrupt specifier from raw format coming 95 /* Translate device-tree interrupt specifier from raw format coming
93 * from the firmware to a irq_hw_number_t (interrupt line number) and 96 * from the firmware to a irq_hw_number_t (interrupt line number) and
94 * type (sense) that can be passed to set_irq_type(). In the absence 97 * type (sense) that can be passed to set_irq_type(). In the absence
diff --git a/include/asm-powerpc/kprobes.h b/include/asm-powerpc/kprobes.h
index 2dafa376a63f..3a5dd492588f 100644
--- a/include/asm-powerpc/kprobes.h
+++ b/include/asm-powerpc/kprobes.h
@@ -44,6 +44,7 @@ typedef unsigned int kprobe_opcode_t;
44#define IS_TDI(instr) (((instr) & 0xfc000000) == 0x08000000) 44#define IS_TDI(instr) (((instr) & 0xfc000000) == 0x08000000)
45#define IS_TWI(instr) (((instr) & 0xfc000000) == 0x0c000000) 45#define IS_TWI(instr) (((instr) & 0xfc000000) == 0x0c000000)
46 46
47#ifdef CONFIG_PPC64
47/* 48/*
48 * 64bit powerpc uses function descriptors. 49 * 64bit powerpc uses function descriptors.
49 * Handle cases where: 50 * Handle cases where:
@@ -67,9 +68,13 @@ typedef unsigned int kprobe_opcode_t;
67} 68}
68 69
69#define JPROBE_ENTRY(pentry) (kprobe_opcode_t *)((func_descr_t *)pentry) 70#define JPROBE_ENTRY(pentry) (kprobe_opcode_t *)((func_descr_t *)pentry)
70
71#define is_trap(instr) (IS_TW(instr) || IS_TD(instr) || \ 71#define is_trap(instr) (IS_TW(instr) || IS_TD(instr) || \
72 IS_TWI(instr) || IS_TDI(instr)) 72 IS_TWI(instr) || IS_TDI(instr))
73#else
74/* Use stock kprobe_lookup_name since ppc32 doesn't use function descriptors */
75#define JPROBE_ENTRY(pentry) (kprobe_opcode_t *)(pentry)
76#define is_trap(instr) (IS_TW(instr) || IS_TWI(instr))
77#endif
73 78
74#define ARCH_SUPPORTS_KRETPROBES 79#define ARCH_SUPPORTS_KRETPROBES
75#define ARCH_INACTIVE_KPROBE_COUNT 1 80#define ARCH_INACTIVE_KPROBE_COUNT 1
diff --git a/include/asm-powerpc/mmu.h b/include/asm-powerpc/mmu.h
index 41c8c9c5a254..200055a4b82b 100644
--- a/include/asm-powerpc/mmu.h
+++ b/include/asm-powerpc/mmu.h
@@ -247,6 +247,7 @@ extern void htab_initialize_secondary(void);
247extern void hpte_init_native(void); 247extern void hpte_init_native(void);
248extern void hpte_init_lpar(void); 248extern void hpte_init_lpar(void);
249extern void hpte_init_iSeries(void); 249extern void hpte_init_iSeries(void);
250extern void hpte_init_beat(void);
250 251
251extern void stabs_alloc(void); 252extern void stabs_alloc(void);
252extern void slb_initialize(void); 253extern void slb_initialize(void);
diff --git a/include/asm-powerpc/mpc52xx.h b/include/asm-powerpc/mpc52xx.h
index 4560d72fc758..7afd5bf94528 100644
--- a/include/asm-powerpc/mpc52xx.h
+++ b/include/asm-powerpc/mpc52xx.h
@@ -249,6 +249,8 @@ extern void mpc52xx_declare_of_platform_devices(void);
249extern void mpc52xx_init_irq(void); 249extern void mpc52xx_init_irq(void);
250extern unsigned int mpc52xx_get_irq(void); 250extern unsigned int mpc52xx_get_irq(void);
251 251
252extern int __init mpc52xx_add_bridge(struct device_node *node);
253
252#endif /* __ASSEMBLY__ */ 254#endif /* __ASSEMBLY__ */
253 255
254#endif /* __ASM_POWERPC_MPC52xx_H__ */ 256#endif /* __ASM_POWERPC_MPC52xx_H__ */
diff --git a/include/asm-powerpc/mpc8260.h b/include/asm-powerpc/mpc8260.h
new file mode 100644
index 000000000000..f1b83b09ab2e
--- /dev/null
+++ b/include/asm-powerpc/mpc8260.h
@@ -0,0 +1,24 @@
1/*
2 * Since there are many different boards and no standard configuration,
3 * we have a unique include file for each. Rather than change every
4 * file that has to include MPC8260 configuration, they all include
5 * this one and the configuration switching is done here.
6 */
7#ifdef __KERNEL__
8#ifndef __ASM_PPC_MPC8260_H__
9#define __ASM_PPC_MPC8260_H__
10
11
12#ifdef CONFIG_8260
13
14#if defined(CONFIG_PQ2ADS) || defined (CONFIG_PQ2FADS)
15#include <platforms/82xx/pq2ads.h>
16#endif
17
18#ifdef CONFIG_PCI_8260
19#include <platforms/82xx/m82xx_pci.h>
20#endif
21
22#endif /* CONFIG_8260 */
23#endif /* !__ASM_PPC_MPC8260_H__ */
24#endif /* __KERNEL__ */
diff --git a/include/asm-powerpc/mpc8xx.h b/include/asm-powerpc/mpc8xx.h
new file mode 100644
index 000000000000..580371120e1a
--- /dev/null
+++ b/include/asm-powerpc/mpc8xx.h
@@ -0,0 +1,28 @@
1/* This is the single file included by all MPC8xx build options.
2 * Since there are many different boards and no standard configuration,
3 * we have a unique include file for each. Rather than change every
4 * file that has to include MPC8xx configuration, they all include
5 * this one and the configuration switching is done here.
6 */
7#ifdef __KERNEL__
8#ifndef __CONFIG_8xx_DEFS
9#define __CONFIG_8xx_DEFS
10
11
12#ifdef CONFIG_8xx
13
14#ifdef CONFIG_FADS
15#include <platforms/fads.h>
16#endif
17
18#if defined(CONFIG_MPC86XADS)
19#include <platforms/8xx/mpc86xads.h>
20#endif
21
22#if defined(CONFIG_MPC885ADS)
23#include <platforms/8xx/mpc885ads.h>
24#endif
25
26#endif /* CONFIG_8xx */
27#endif /* __CONFIG_8xx_DEFS */
28#endif /* __KERNEL__ */
diff --git a/include/asm-powerpc/mpic.h b/include/asm-powerpc/mpic.h
index b71e7b32a555..cb204a71e912 100644
--- a/include/asm-powerpc/mpic.h
+++ b/include/asm-powerpc/mpic.h
@@ -103,21 +103,6 @@
103#define MPIC_MAX_ISU 32 103#define MPIC_MAX_ISU 32
104 104
105/* 105/*
106 * Special vector numbers (internal use only)
107 */
108#define MPIC_VEC_SPURRIOUS 255
109#define MPIC_VEC_IPI_3 254
110#define MPIC_VEC_IPI_2 253
111#define MPIC_VEC_IPI_1 252
112#define MPIC_VEC_IPI_0 251
113
114/* unused */
115#define MPIC_VEC_TIMER_3 250
116#define MPIC_VEC_TIMER_2 249
117#define MPIC_VEC_TIMER_1 248
118#define MPIC_VEC_TIMER_0 247
119
120/*
121 * Tsi108 implementation of MPIC has many differences from the original one 106 * Tsi108 implementation of MPIC has many differences from the original one
122 */ 107 */
123 108
@@ -276,6 +261,13 @@ struct mpic
276 unsigned char *senses; 261 unsigned char *senses;
277 unsigned int senses_count; 262 unsigned int senses_count;
278 263
264 /* vector numbers used for internal sources (ipi/timers) */
265 unsigned int ipi_vecs[4];
266 unsigned int timer_vecs[4];
267
268 /* Spurious vector to program into unused sources */
269 unsigned int spurious_vec;
270
279#ifdef CONFIG_MPIC_BROKEN_U3 271#ifdef CONFIG_MPIC_BROKEN_U3
280 /* The fixup table */ 272 /* The fixup table */
281 struct mpic_irq_fixup *fixups; 273 struct mpic_irq_fixup *fixups;
@@ -332,6 +324,8 @@ struct mpic
332#define MPIC_NO_PTHROU_DIS 0x00000040 324#define MPIC_NO_PTHROU_DIS 0x00000040
333/* DCR based MPIC */ 325/* DCR based MPIC */
334#define MPIC_USES_DCR 0x00000080 326#define MPIC_USES_DCR 0x00000080
327/* MPIC has 11-bit vector fields (or larger) */
328#define MPIC_LARGE_VECTORS 0x00000100
335 329
336/* MPIC HW modification ID */ 330/* MPIC HW modification ID */
337#define MPIC_REGSET_MASK 0xf0000000 331#define MPIC_REGSET_MASK 0xf0000000
diff --git a/include/asm-powerpc/oprofile_impl.h b/include/asm-powerpc/oprofile_impl.h
index 71043bf3641f..94c0ad2bff96 100644
--- a/include/asm-powerpc/oprofile_impl.h
+++ b/include/asm-powerpc/oprofile_impl.h
@@ -58,10 +58,8 @@ extern struct op_powerpc_model op_model_power4;
58extern struct op_powerpc_model op_model_7450; 58extern struct op_powerpc_model op_model_7450;
59extern struct op_powerpc_model op_model_cell; 59extern struct op_powerpc_model op_model_cell;
60 60
61#ifndef CONFIG_FSL_BOOKE
62
63/* All the classic PPC parts use these */ 61/* All the classic PPC parts use these */
64static inline unsigned int ctr_read(unsigned int i) 62static inline unsigned int classic_ctr_read(unsigned int i)
65{ 63{
66 switch(i) { 64 switch(i) {
67 case 0: 65 case 0:
@@ -89,7 +87,7 @@ static inline unsigned int ctr_read(unsigned int i)
89 } 87 }
90} 88}
91 89
92static inline void ctr_write(unsigned int i, unsigned int val) 90static inline void classic_ctr_write(unsigned int i, unsigned int val)
93{ 91{
94 switch(i) { 92 switch(i) {
95 case 0: 93 case 0:
@@ -124,89 +122,6 @@ static inline void ctr_write(unsigned int i, unsigned int val)
124 break; 122 break;
125 } 123 }
126} 124}
127#else /* CONFIG_FSL_BOOKE */
128static inline u32 get_pmlca(int ctr)
129{
130 u32 pmlca;
131
132 switch (ctr) {
133 case 0:
134 pmlca = mfpmr(PMRN_PMLCA0);
135 break;
136 case 1:
137 pmlca = mfpmr(PMRN_PMLCA1);
138 break;
139 case 2:
140 pmlca = mfpmr(PMRN_PMLCA2);
141 break;
142 case 3:
143 pmlca = mfpmr(PMRN_PMLCA3);
144 break;
145 default:
146 panic("Bad ctr number\n");
147 }
148
149 return pmlca;
150}
151
152static inline void set_pmlca(int ctr, u32 pmlca)
153{
154 switch (ctr) {
155 case 0:
156 mtpmr(PMRN_PMLCA0, pmlca);
157 break;
158 case 1:
159 mtpmr(PMRN_PMLCA1, pmlca);
160 break;
161 case 2:
162 mtpmr(PMRN_PMLCA2, pmlca);
163 break;
164 case 3:
165 mtpmr(PMRN_PMLCA3, pmlca);
166 break;
167 default:
168 panic("Bad ctr number\n");
169 }
170}
171
172static inline unsigned int ctr_read(unsigned int i)
173{
174 switch(i) {
175 case 0:
176 return mfpmr(PMRN_PMC0);
177 case 1:
178 return mfpmr(PMRN_PMC1);
179 case 2:
180 return mfpmr(PMRN_PMC2);
181 case 3:
182 return mfpmr(PMRN_PMC3);
183 default:
184 return 0;
185 }
186}
187
188static inline void ctr_write(unsigned int i, unsigned int val)
189{
190 switch(i) {
191 case 0:
192 mtpmr(PMRN_PMC0, val);
193 break;
194 case 1:
195 mtpmr(PMRN_PMC1, val);
196 break;
197 case 2:
198 mtpmr(PMRN_PMC2, val);
199 break;
200 case 3:
201 mtpmr(PMRN_PMC3, val);
202 break;
203 default:
204 break;
205 }
206}
207
208
209#endif /* CONFIG_FSL_BOOKE */
210 125
211 126
212extern void op_powerpc_backtrace(struct pt_regs * const regs, unsigned int depth); 127extern void op_powerpc_backtrace(struct pt_regs * const regs, unsigned int depth);
diff --git a/include/asm-powerpc/pci-bridge.h b/include/asm-powerpc/pci-bridge.h
index cb02c9d1ef93..d9bf5aba96cb 100644
--- a/include/asm-powerpc/pci-bridge.h
+++ b/include/asm-powerpc/pci-bridge.h
@@ -53,6 +53,8 @@ struct pci_controller {
53 unsigned long buid; 53 unsigned long buid;
54 unsigned long dma_window_base_cur; 54 unsigned long dma_window_base_cur;
55 unsigned long dma_window_size; 55 unsigned long dma_window_size;
56
57 void *private_data;
56}; 58};
57 59
58/* 60/*
diff --git a/include/asm-powerpc/ps3.h b/include/asm-powerpc/ps3.h
index 52a69ed0d90a..4f5a1e01fdac 100644
--- a/include/asm-powerpc/ps3.h
+++ b/include/asm-powerpc/ps3.h
@@ -21,11 +21,33 @@
21#if !defined(_ASM_POWERPC_PS3_H) 21#if !defined(_ASM_POWERPC_PS3_H)
22#define _ASM_POWERPC_PS3_H 22#define _ASM_POWERPC_PS3_H
23 23
24#include <linux/compiler.h> /* for __deprecated */
25#include <linux/init.h> 24#include <linux/init.h>
26#include <linux/types.h> 25#include <linux/types.h>
27#include <linux/device.h> 26#include <linux/device.h>
28 27
28union ps3_firmware_version {
29 u64 raw;
30 struct {
31 u16 pad;
32 u16 major;
33 u16 minor;
34 u16 rev;
35 };
36};
37
38int ps3_get_firmware_version(union ps3_firmware_version *v);
39
40/* 'Other OS' area */
41
42enum ps3_param_av_multi_out {
43 PS3_PARAM_AV_MULTI_OUT_NTSC = 0,
44 PS3_PARAM_AV_MULTI_OUT_PAL_RGB = 1,
45 PS3_PARAM_AV_MULTI_OUT_PAL_YCBCR = 2,
46 PS3_PARAM_AV_MULTI_OUT_SECAM = 3,
47};
48
49enum ps3_param_av_multi_out ps3_os_area_get_av_multi_out(void);
50
29/** 51/**
30 * struct ps3_device_id - HV bus device identifier from the system repository 52 * struct ps3_device_id - HV bus device identifier from the system repository
31 * @bus_id: HV bus id, {1..} (zero invalid) 53 * @bus_id: HV bus id, {1..} (zero invalid)
@@ -139,20 +161,32 @@ unsigned long ps3_mm_phys_to_lpar(unsigned long phys_addr);
139 161
140/* inrerrupt routines */ 162/* inrerrupt routines */
141 163
142int ps3_alloc_io_irq(unsigned int interrupt_id, unsigned int *virq); 164enum ps3_cpu_binding {
165 PS3_BINDING_CPU_ANY = -1,
166 PS3_BINDING_CPU_0 = 0,
167 PS3_BINDING_CPU_1 = 1,
168};
169
170int ps3_alloc_io_irq(enum ps3_cpu_binding cpu, unsigned int interrupt_id,
171 unsigned int *virq);
143int ps3_free_io_irq(unsigned int virq); 172int ps3_free_io_irq(unsigned int virq);
144int ps3_alloc_event_irq(unsigned int *virq); 173int ps3_alloc_event_irq(enum ps3_cpu_binding cpu, unsigned int *virq);
145int ps3_free_event_irq(unsigned int virq); 174int ps3_free_event_irq(unsigned int virq);
146int ps3_send_event_locally(unsigned int virq); 175int ps3_send_event_locally(unsigned int virq);
147int ps3_connect_event_irq(const struct ps3_device_id *did, 176int ps3_connect_event_irq(enum ps3_cpu_binding cpu,
148 unsigned int interrupt_id, unsigned int *virq); 177 const struct ps3_device_id *did, unsigned int interrupt_id,
178 unsigned int *virq);
149int ps3_disconnect_event_irq(const struct ps3_device_id *did, 179int ps3_disconnect_event_irq(const struct ps3_device_id *did,
150 unsigned int interrupt_id, unsigned int virq); 180 unsigned int interrupt_id, unsigned int virq);
151int ps3_alloc_vuart_irq(void* virt_addr_bmp, unsigned int *virq); 181int ps3_alloc_vuart_irq(enum ps3_cpu_binding cpu, void* virt_addr_bmp,
152int ps3_free_vuart_irq(unsigned int virq);
153int ps3_alloc_spe_irq(unsigned long spe_id, unsigned int class,
154 unsigned int *virq); 182 unsigned int *virq);
183int ps3_free_vuart_irq(unsigned int virq);
184int ps3_alloc_spe_irq(enum ps3_cpu_binding cpu, unsigned long spe_id,
185 unsigned int class, unsigned int *virq);
155int ps3_free_spe_irq(unsigned int virq); 186int ps3_free_spe_irq(unsigned int virq);
187int ps3_alloc_irq(enum ps3_cpu_binding cpu, unsigned long outlet,
188 unsigned int *virq);
189int ps3_free_irq(unsigned int virq);
156 190
157/* lv1 result codes */ 191/* lv1 result codes */
158 192
@@ -247,146 +281,6 @@ static inline const char* ps3_result(int result)
247#endif 281#endif
248} 282}
249 283
250/* repository bus info */
251
252enum ps3_bus_type {
253 PS3_BUS_TYPE_SB = 4,
254 PS3_BUS_TYPE_STORAGE = 5,
255};
256
257enum ps3_dev_type {
258 PS3_DEV_TYPE_SB_GELIC = 3,
259 PS3_DEV_TYPE_SB_USB = 4,
260 PS3_DEV_TYPE_SB_GPIO = 6,
261};
262
263int ps3_repository_read_bus_str(unsigned int bus_index, const char *bus_str,
264 u64 *value);
265int ps3_repository_read_bus_id(unsigned int bus_index, unsigned int *bus_id);
266int ps3_repository_read_bus_type(unsigned int bus_index,
267 enum ps3_bus_type *bus_type);
268int ps3_repository_read_bus_num_dev(unsigned int bus_index,
269 unsigned int *num_dev);
270
271/* repository bus device info */
272
273enum ps3_interrupt_type {
274 PS3_INTERRUPT_TYPE_EVENT_PORT = 2,
275 PS3_INTERRUPT_TYPE_SB_OHCI = 3,
276 PS3_INTERRUPT_TYPE_SB_EHCI = 4,
277 PS3_INTERRUPT_TYPE_OTHER = 5,
278};
279
280enum ps3_region_type {
281 PS3_REGION_TYPE_SB_OHCI = 3,
282 PS3_REGION_TYPE_SB_EHCI = 4,
283 PS3_REGION_TYPE_SB_GPIO = 5,
284};
285
286int ps3_repository_read_dev_str(unsigned int bus_index,
287 unsigned int dev_index, const char *dev_str, u64 *value);
288int ps3_repository_read_dev_id(unsigned int bus_index, unsigned int dev_index,
289 unsigned int *dev_id);
290int ps3_repository_read_dev_type(unsigned int bus_index,
291 unsigned int dev_index, enum ps3_dev_type *dev_type);
292int ps3_repository_read_dev_intr(unsigned int bus_index,
293 unsigned int dev_index, unsigned int intr_index,
294 enum ps3_interrupt_type *intr_type, unsigned int *interrupt_id);
295int ps3_repository_read_dev_reg_type(unsigned int bus_index,
296 unsigned int dev_index, unsigned int reg_index,
297 enum ps3_region_type *reg_type);
298int ps3_repository_read_dev_reg_addr(unsigned int bus_index,
299 unsigned int dev_index, unsigned int reg_index, u64 *bus_addr,
300 u64 *len);
301int ps3_repository_read_dev_reg(unsigned int bus_index,
302 unsigned int dev_index, unsigned int reg_index,
303 enum ps3_region_type *reg_type, u64 *bus_addr, u64 *len);
304
305/* repository bus enumerators */
306
307struct ps3_repository_device {
308 unsigned int bus_index;
309 unsigned int dev_index;
310 struct ps3_device_id did;
311};
312
313int ps3_repository_find_device(enum ps3_bus_type bus_type,
314 enum ps3_dev_type dev_type,
315 const struct ps3_repository_device *start_dev,
316 struct ps3_repository_device *dev);
317static inline int ps3_repository_find_first_device(
318 enum ps3_bus_type bus_type, enum ps3_dev_type dev_type,
319 struct ps3_repository_device *dev)
320{
321 return ps3_repository_find_device(bus_type, dev_type, NULL, dev);
322}
323int ps3_repository_find_interrupt(const struct ps3_repository_device *dev,
324 enum ps3_interrupt_type intr_type, unsigned int *interrupt_id);
325int ps3_repository_find_region(const struct ps3_repository_device *dev,
326 enum ps3_region_type reg_type, u64 *bus_addr, u64 *len);
327
328/* repository block device info */
329
330int ps3_repository_read_dev_port(unsigned int bus_index,
331 unsigned int dev_index, u64 *port);
332int ps3_repository_read_dev_blk_size(unsigned int bus_index,
333 unsigned int dev_index, u64 *blk_size);
334int ps3_repository_read_dev_num_blocks(unsigned int bus_index,
335 unsigned int dev_index, u64 *num_blocks);
336int ps3_repository_read_dev_num_regions(unsigned int bus_index,
337 unsigned int dev_index, unsigned int *num_regions);
338int ps3_repository_read_dev_region_id(unsigned int bus_index,
339 unsigned int dev_index, unsigned int region_index,
340 unsigned int *region_id);
341int ps3_repository_read_dev_region_size(unsigned int bus_index,
342 unsigned int dev_index, unsigned int region_index, u64 *region_size);
343int ps3_repository_read_dev_region_start(unsigned int bus_index,
344 unsigned int dev_index, unsigned int region_index, u64 *region_start);
345
346/* repository pu and memory info */
347
348int ps3_repository_read_num_pu(unsigned int *num_pu);
349int ps3_repository_read_ppe_id(unsigned int *pu_index, unsigned int *ppe_id);
350int ps3_repository_read_rm_base(unsigned int ppe_id, u64 *rm_base);
351int ps3_repository_read_rm_size(unsigned int ppe_id, u64 *rm_size);
352int ps3_repository_read_region_total(u64 *region_total);
353int ps3_repository_read_mm_info(u64 *rm_base, u64 *rm_size,
354 u64 *region_total);
355
356/* repository pme info */
357
358int ps3_repository_read_num_be(unsigned int *num_be);
359int ps3_repository_read_be_node_id(unsigned int be_index, u64 *node_id);
360int ps3_repository_read_tb_freq(u64 node_id, u64 *tb_freq);
361int ps3_repository_read_be_tb_freq(unsigned int be_index, u64 *tb_freq);
362
363/* repository 'Other OS' area */
364
365int ps3_repository_read_boot_dat_addr(u64 *lpar_addr);
366int ps3_repository_read_boot_dat_size(unsigned int *size);
367int ps3_repository_read_boot_dat_info(u64 *lpar_addr, unsigned int *size);
368
369/* repository spu info */
370
371/**
372 * enum spu_resource_type - Type of spu resource.
373 * @spu_resource_type_shared: Logical spu is shared with other partions.
374 * @spu_resource_type_exclusive: Logical spu is not shared with other partions.
375 *
376 * Returned by ps3_repository_read_spu_resource_id().
377 */
378
379enum ps3_spu_resource_type {
380 PS3_SPU_RESOURCE_TYPE_SHARED = 0,
381 PS3_SPU_RESOURCE_TYPE_EXCLUSIVE = 0x8000000000000000UL,
382};
383
384int ps3_repository_read_num_spu_reserved(unsigned int *num_spu_reserved);
385int ps3_repository_read_num_spu_resource_id(unsigned int *num_resource_id);
386int ps3_repository_read_spu_resource_id(unsigned int res_index,
387 enum ps3_spu_resource_type* resource_type, unsigned int *resource_id);
388
389
390/* system bus routines */ 284/* system bus routines */
391 285
392enum ps3_match_id { 286enum ps3_match_id {
@@ -459,4 +353,39 @@ static inline void *ps3_system_bus_get_driver_data(
459 353
460extern struct bus_type ps3_system_bus_type; 354extern struct bus_type ps3_system_bus_type;
461 355
356/* vuart routines */
357
358struct ps3_vuart_stats {
359 unsigned long bytes_written;
360 unsigned long bytes_read;
361 unsigned long tx_interrupts;
362 unsigned long rx_interrupts;
363 unsigned long disconnect_interrupts;
364};
365
366/**
367 * struct ps3_vuart_port_device - a device on a vuart port
368 */
369
370struct ps3_vuart_port_device {
371 enum ps3_match_id match_id;
372 struct device core;
373
374 /* private driver variables */
375 unsigned int port_number;
376 u64 interrupt_mask;
377 struct {
378 spinlock_t lock;
379 struct list_head head;
380 } tx_list;
381 struct {
382 unsigned long bytes_held;
383 spinlock_t lock;
384 struct list_head head;
385 } rx_list;
386 struct ps3_vuart_stats stats;
387};
388
389int ps3_vuart_port_device_register(struct ps3_vuart_port_device *dev);
390
462#endif 391#endif
diff --git a/include/asm-powerpc/reg.h b/include/asm-powerpc/reg.h
index a3631b15754c..0d7f0164ed81 100644
--- a/include/asm-powerpc/reg.h
+++ b/include/asm-powerpc/reg.h
@@ -166,6 +166,7 @@
166#define SPRN_TBWU 0x11D /* Time Base Upper Register (super, R/W) */ 166#define SPRN_TBWU 0x11D /* Time Base Upper Register (super, R/W) */
167#define SPRN_SPURR 0x134 /* Scaled PURR */ 167#define SPRN_SPURR 0x134 /* Scaled PURR */
168#define SPRN_HIOR 0x137 /* 970 Hypervisor interrupt offset */ 168#define SPRN_HIOR 0x137 /* 970 Hypervisor interrupt offset */
169#define SPRN_LPCR 0x13E /* LPAR Control Register */
169#define SPRN_DBAT0L 0x219 /* Data BAT 0 Lower Register */ 170#define SPRN_DBAT0L 0x219 /* Data BAT 0 Lower Register */
170#define SPRN_DBAT0U 0x218 /* Data BAT 0 Upper Register */ 171#define SPRN_DBAT0U 0x218 /* Data BAT 0 Upper Register */
171#define SPRN_DBAT1L 0x21B /* Data BAT 1 Lower Register */ 172#define SPRN_DBAT1L 0x21B /* Data BAT 1 Lower Register */
@@ -391,6 +392,12 @@
391#define SPRN_HSRR0 0x13A /* Save/Restore Register 0 */ 392#define SPRN_HSRR0 0x13A /* Save/Restore Register 0 */
392#define SPRN_HSRR1 0x13B /* Save/Restore Register 1 */ 393#define SPRN_HSRR1 0x13B /* Save/Restore Register 1 */
393 394
395#define SPRN_TBCTL 0x35f /* PA6T Timebase control register */
396#define TBCTL_FREEZE 0x0000000000000000ull /* Freeze all tbs */
397#define TBCTL_RESTART 0x0000000100000000ull /* Restart all tbs */
398#define TBCTL_UPDATE_UPPER 0x0000000200000000ull /* Set upper 32 bits */
399#define TBCTL_UPDATE_LOWER 0x0000000300000000ull /* Set lower 32 bits */
400
394#ifndef SPRN_SVR 401#ifndef SPRN_SVR
395#define SPRN_SVR 0x11E /* System Version Register */ 402#define SPRN_SVR 0x11E /* System Version Register */
396#endif 403#endif
@@ -462,6 +469,13 @@
462#define SPRN_SIAR 780 469#define SPRN_SIAR 780
463#define SPRN_SDAR 781 470#define SPRN_SDAR 781
464 471
472#define PA6T_SPRN_PMC0 787
473#define PA6T_SPRN_PMC1 788
474#define PA6T_SPRN_PMC2 789
475#define PA6T_SPRN_PMC3 790
476#define PA6T_SPRN_PMC4 791
477#define PA6T_SPRN_PMC5 792
478
465#else /* 32-bit */ 479#else /* 32-bit */
466#define SPRN_MMCR0 952 /* Monitor Mode Control Register 0 */ 480#define SPRN_MMCR0 952 /* Monitor Mode Control Register 0 */
467#define MMCR0_FC 0x80000000UL /* freeze counters */ 481#define MMCR0_FC 0x80000000UL /* freeze counters */
diff --git a/include/asm-powerpc/smp.h b/include/asm-powerpc/smp.h
index 20ea7c70bc38..01717f266dc9 100644
--- a/include/asm-powerpc/smp.h
+++ b/include/asm-powerpc/smp.h
@@ -75,6 +75,7 @@ extern cpumask_t cpu_sibling_map[NR_CPUS];
75void smp_init_iSeries(void); 75void smp_init_iSeries(void);
76void smp_init_pSeries(void); 76void smp_init_pSeries(void);
77void smp_init_cell(void); 77void smp_init_cell(void);
78void smp_init_celleb(void);
78void smp_setup_cpu_maps(void); 79void smp_setup_cpu_maps(void);
79 80
80extern int __cpu_disable(void); 81extern int __cpu_disable(void);
diff --git a/include/asm-powerpc/spu.h b/include/asm-powerpc/spu.h
index 3d90264e9d36..b634e16575f2 100644
--- a/include/asm-powerpc/spu.h
+++ b/include/asm-powerpc/spu.h
@@ -104,6 +104,7 @@
104 104
105struct spu_context; 105struct spu_context;
106struct spu_runqueue; 106struct spu_runqueue;
107struct device_node;
107 108
108struct spu { 109struct spu {
109 const char *name; 110 const char *name;
@@ -142,7 +143,19 @@ struct spu {
142 char irq_c1[8]; 143 char irq_c1[8];
143 char irq_c2[8]; 144 char irq_c2[8];
144 145
146 u64 spe_id;
147
145 void* pdata; /* platform private data */ 148 void* pdata; /* platform private data */
149
150 /* of based platforms only */
151 struct device_node *devnode;
152
153 /* native only */
154 struct spu_priv1 __iomem *priv1;
155
156 /* beat only */
157 u64 shadow_int_mask_RW[3];
158
146 struct sys_device sysdev; 159 struct sys_device sysdev;
147}; 160};
148 161
diff --git a/include/asm-powerpc/spu_priv1.h b/include/asm-powerpc/spu_priv1.h
index 69dcb0c53884..7e78f6a1ab8b 100644
--- a/include/asm-powerpc/spu_priv1.h
+++ b/include/asm-powerpc/spu_priv1.h
@@ -206,6 +206,8 @@ spu_destroy_spu (struct spu *spu)
206 */ 206 */
207 207
208extern const struct spu_priv1_ops spu_priv1_mmio_ops; 208extern const struct spu_priv1_ops spu_priv1_mmio_ops;
209extern const struct spu_priv1_ops spu_priv1_beat_ops;
210
209extern const struct spu_management_ops spu_management_of_ops; 211extern const struct spu_management_ops spu_management_of_ops;
210 212
211#endif /* __KERNEL__ */ 213#endif /* __KERNEL__ */
diff --git a/include/asm-powerpc/sstep.h b/include/asm-powerpc/sstep.h
index 630a9889c07c..f593b0f9b627 100644
--- a/include/asm-powerpc/sstep.h
+++ b/include/asm-powerpc/sstep.h
@@ -21,6 +21,7 @@ struct pt_regs;
21 */ 21 */
22#define IS_MTMSRD(instr) (((instr) & 0xfc0007be) == 0x7c000124) 22#define IS_MTMSRD(instr) (((instr) & 0xfc0007be) == 0x7c000124)
23#define IS_RFID(instr) (((instr) & 0xfc0007fe) == 0x4c000024) 23#define IS_RFID(instr) (((instr) & 0xfc0007fe) == 0x4c000024)
24#define IS_RFI(instr) (((instr) & 0xfc0007fe) == 0x4c000064)
24 25
25/* Emulate instructions that cause a transfer of control. */ 26/* Emulate instructions that cause a transfer of control. */
26extern int emulate_step(struct pt_regs *regs, unsigned int instr); 27extern int emulate_step(struct pt_regs *regs, unsigned int instr);
diff --git a/include/asm-powerpc/time.h b/include/asm-powerpc/time.h
index 4cff977ad526..3fd57c048f59 100644
--- a/include/asm-powerpc/time.h
+++ b/include/asm-powerpc/time.h
@@ -39,6 +39,8 @@ extern void generic_calibrate_decr(void);
39extern void wakeup_decrementer(void); 39extern void wakeup_decrementer(void);
40extern void snapshot_timebase(void); 40extern void snapshot_timebase(void);
41 41
42extern void set_dec_cpu6(unsigned int val);
43
42/* Some sane defaults: 125 MHz timebase, 1GHz processor */ 44/* Some sane defaults: 125 MHz timebase, 1GHz processor */
43extern unsigned long ppc_proc_freq; 45extern unsigned long ppc_proc_freq;
44#define DEFAULT_PROC_FREQ (DEFAULT_TB_FREQ * 8) 46#define DEFAULT_PROC_FREQ (DEFAULT_TB_FREQ * 8)
diff --git a/include/asm-powerpc/udbg.h b/include/asm-powerpc/udbg.h
index 55e57844fa78..4cbc313aa02a 100644
--- a/include/asm-powerpc/udbg.h
+++ b/include/asm-powerpc/udbg.h
@@ -41,9 +41,11 @@ extern void __init udbg_early_init(void);
41extern void __init udbg_init_debug_lpar(void); 41extern void __init udbg_init_debug_lpar(void);
42extern void __init udbg_init_pmac_realmode(void); 42extern void __init udbg_init_pmac_realmode(void);
43extern void __init udbg_init_maple_realmode(void); 43extern void __init udbg_init_maple_realmode(void);
44extern void __init udbg_init_pas_realmode(void);
44extern void __init udbg_init_iseries(void); 45extern void __init udbg_init_iseries(void);
45extern void __init udbg_init_rtas_panel(void); 46extern void __init udbg_init_rtas_panel(void);
46extern void __init udbg_init_rtas_console(void); 47extern void __init udbg_init_rtas_console(void);
48extern void __init udbg_init_debug_beat(void);
47 49
48#endif /* __KERNEL__ */ 50#endif /* __KERNEL__ */
49#endif /* _ASM_POWERPC_UDBG_H */ 51#endif /* _ASM_POWERPC_UDBG_H */
diff --git a/include/asm-ppc/commproc.h b/include/asm-ppc/commproc.h
index 7b06b4e6bf30..4f99df1bafd7 100644
--- a/include/asm-ppc/commproc.h
+++ b/include/asm-ppc/commproc.h
@@ -77,6 +77,7 @@ extern int cpm_dpfree(uint offset);
77extern uint cpm_dpalloc_fixed(uint offset, uint size, uint align); 77extern uint cpm_dpalloc_fixed(uint offset, uint size, uint align);
78extern void cpm_dpdump(void); 78extern void cpm_dpdump(void);
79extern void *cpm_dpram_addr(uint offset); 79extern void *cpm_dpram_addr(uint offset);
80extern uint cpm_dpram_phys(u8* addr);
80extern void cpm_setbrg(uint brg, uint rate); 81extern void cpm_setbrg(uint brg, uint rate);
81 82
82extern uint m8xx_cpm_hostalloc(uint size); 83extern uint m8xx_cpm_hostalloc(uint size);
diff --git a/include/asm-ppc/ibm4xx.h b/include/asm-ppc/ibm4xx.h
index 499c14691c71..7a64ede53bb6 100644
--- a/include/asm-ppc/ibm4xx.h
+++ b/include/asm-ppc/ibm4xx.h
@@ -15,6 +15,7 @@
15#define __ASM_IBM4XX_H__ 15#define __ASM_IBM4XX_H__
16 16
17#include <asm/types.h> 17#include <asm/types.h>
18#include <asm/dcr.h>
18 19
19#ifdef CONFIG_40x 20#ifdef CONFIG_40x
20 21
diff --git a/include/asm-ppc/m48t35.h b/include/asm-ppc/m48t35.h
deleted file mode 100644
index a5277ea4b194..000000000000
--- a/include/asm-ppc/m48t35.h
+++ /dev/null
@@ -1,77 +0,0 @@
1/*
2 * Registers for the SGS-Thomson M48T35 Timekeeper RAM chip
3 * and
4 * Registers for the SGS-Thomson M48T37 Timekeeper RAM chip
5 * The 37 is the 35 plus alarm and century thus the offsets
6 * are shifted by the extra registers.
7 */
8
9#ifndef __PPC_M48T35_H
10#define __PPC_M48T35_H
11
12/* RTC offsets */
13#define M48T35_RTC_FLAGS (-8) /* the negative regs are really T37 only */
14#define M48T35_RTC_CENTURY (-7)
15#define M48T35_RTC_AL_SEC (-6)
16#define M48T35_RTC_AL_MIN (-5)
17#define M48T35_RTC_AL_HRS (-4)
18#define M48T35_RTC_AL_DOM (-3)
19#define M48T35_RTC_INTERRUPT (-2)
20#define M48T35_RTC_WATCHDOG (-1)
21#define M48T35_RTC_CONTROL 0 /* T35 starts here */
22#define M48T35_RTC_SECONDS 1
23#define M48T35_RTC_MINUTES 2
24#define M48T35_RTC_HOURS 3
25#define M48T35_RTC_DAY 4
26#define M48T35_RTC_DOM 5
27#define M48T35_RTC_MONTH 6
28#define M48T35_RTC_YEAR 7
29
30/* this way help us know which bits go with which regs */
31#define M48T35_RTC_FLAGS_BL 0x10
32#define M48T35_RTC_FLAGS_AF 0x40
33#define M48T35_RTC_FLAGS_WDF 0x80
34
35#define M48T35_RTC_INTERRUPT_AFE 0x80
36#define M48T35_RTC_INTERRUPT_ABE 0x20
37#define M48T35_RTC_INTERRUPT_ALL (M48T35_RTC_INTERRUPT_AFE|M48T35_RTC_INTERRUPT_ABE)
38
39#define M48T35_RTC_WATCHDOG_RB 0x03
40#define M48T35_RTC_WATCHDOG_BMB 0x7c
41#define M48T35_RTC_WATCHDOG_WDS 0x80
42#define M48T35_RTC_WATCHDOG_ALL (M48T35_RTC_WATCHDOG_RB|M48T35_RTC_WATCHDOG_BMB|M48T35_RTC_W)
43
44#define M48T35_RTC_CONTROL_WRITE 0x80
45#define M48T35_RTC_CONTROL_READ 0x40
46#define M48T35_RTC_CONTROL_CAL_SIGN 0x20
47#define M48T35_RTC_CONTROL_CAL_VALUE 0x1f
48#define M48T35_RTC_CONTROL_LOCKED (M48T35_RTC_WRITE|M48T35_RTC_READ)
49#define M48T35_RTC_CONTROL_CALIBRATION (M48T35_RTC_CONTROL_CAL_SIGN|M48T35_RTC_CONTROL_CAL_VALUE)
50
51#define M48T35_RTC_SECONDS_SEC_1 0x0f
52#define M48T35_RTC_SECONDS_SEC_10 0x70
53#define M48T35_RTC_SECONDS_ST 0x80
54#define M48T35_RTC_SECONDS_SEC_ALL (M48T35_RTC_SECONDS_SEC_1|M48T35_RTC_SECONDS_SEC_10)
55
56#define M48T35_RTC_MINUTES_MIN_1 0x0f
57#define M48T35_RTC_MINUTES_MIN_10 0x70
58#define M48T35_RTC_MINUTES_MIN_ALL (M48T35_RTC_MINUTES_MIN_1|M48T35_RTC_MINUTES_MIN_10)
59
60#define M48T35_RTC_HOURS_HRS_1 0x0f
61#define M48T35_RTC_HOURS_HRS_10 0x30
62#define M48T35_RTC_HOURS_HRS_ALL (M48T35_RTC_HOURS_HRS_1|M48T35_RTC_HOURS_HRS_10)
63
64#define M48T35_RTC_DAY_DAY_1 0x03
65#define M48T35_RTC_DAY_FT 0x40
66
67#define M48T35_RTC_ALARM_OFF 0x00
68#define M48T35_RTC_WATCHDOG_OFF 0x00
69
70
71/* legacy */
72#define M48T35_RTC_SET 0x80
73#define M48T35_RTC_STOPPED 0x80
74#define M48T35_RTC_READ 0x40
75
76
77#endif
diff --git a/include/asm-ppc/reg_booke.h b/include/asm-ppc/reg_booke.h
index a263fc1e65c4..82948ed2744a 100644
--- a/include/asm-ppc/reg_booke.h
+++ b/include/asm-ppc/reg_booke.h
@@ -9,8 +9,6 @@
9#ifndef __ASM_PPC_REG_BOOKE_H__ 9#ifndef __ASM_PPC_REG_BOOKE_H__
10#define __ASM_PPC_REG_BOOKE_H__ 10#define __ASM_PPC_REG_BOOKE_H__
11 11
12#include <asm/dcr.h>
13
14#ifndef __ASSEMBLY__ 12#ifndef __ASSEMBLY__
15/* Performance Monitor Registers */ 13/* Performance Monitor Registers */
16#define mfpmr(rn) ({unsigned int rval; \ 14#define mfpmr(rn) ({unsigned int rval; \
diff --git a/include/asm-ppc/serial.h b/include/asm-ppc/serial.h
index 8a59f8871f32..8fc1b546613d 100644
--- a/include/asm-ppc/serial.h
+++ b/include/asm-ppc/serial.h
@@ -11,8 +11,6 @@
11#include <platforms/ev64260.h> 11#include <platforms/ev64260.h>
12#elif defined(CONFIG_CHESTNUT) 12#elif defined(CONFIG_CHESTNUT)
13#include <platforms/chestnut.h> 13#include <platforms/chestnut.h>
14#elif defined(CONFIG_GEMINI)
15#include <platforms/gemini_serial.h>
16#elif defined(CONFIG_POWERPMC250) 14#elif defined(CONFIG_POWERPMC250)
17#include <platforms/powerpmc250.h> 15#include <platforms/powerpmc250.h>
18#elif defined(CONFIG_LOPEC) 16#elif defined(CONFIG_LOPEC)
diff --git a/include/linux/log2.h b/include/linux/log2.h
index d02e1a547a7e..99922bedfcc9 100644
--- a/include/linux/log2.h
+++ b/include/linux/log2.h
@@ -44,6 +44,17 @@ int __ilog2_u64(u64 n)
44#endif 44#endif
45 45
46/* 46/*
47 * Determine whether some value is a power of two, where zero is
48 * *not* considered a power of two.
49 */
50
51static inline __attribute__((const))
52bool is_power_of_2(unsigned long n)
53{
54 return (n != 0 && ((n & (n - 1)) == 0));
55}
56
57/*
47 * round up to nearest power of two 58 * round up to nearest power of two
48 */ 59 */
49static inline __attribute__((const)) 60static inline __attribute__((const))
diff --git a/include/linux/sysdev.h b/include/linux/sysdev.h
index 166a2e58c287..389ccf858d37 100644
--- a/include/linux/sysdev.h
+++ b/include/linux/sysdev.h
@@ -98,12 +98,16 @@ struct sysdev_attribute {
98}; 98};
99 99
100 100
101#define SYSDEV_ATTR(_name,_mode,_show,_store) \ 101#define _SYSDEV_ATTR(_name,_mode,_show,_store) \
102struct sysdev_attribute attr_##_name = { \ 102{ \
103 .attr = {.name = __stringify(_name), .mode = _mode }, \ 103 .attr = { .name = __stringify(_name), .mode = _mode, \
104 .owner = THIS_MODULE }, \
104 .show = _show, \ 105 .show = _show, \
105 .store = _store, \ 106 .store = _store, \
106}; 107}
108
109#define SYSDEV_ATTR(_name,_mode,_show,_store) \
110struct sysdev_attribute attr_##_name = _SYSDEV_ATTR(_name,_mode,_show,_store);
107 111
108extern int sysdev_create_file(struct sys_device *, struct sysdev_attribute *); 112extern int sysdev_create_file(struct sys_device *, struct sysdev_attribute *);
109extern void sysdev_remove_file(struct sys_device *, struct sysdev_attribute *); 113extern void sysdev_remove_file(struct sys_device *, struct sysdev_attribute *);