aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/include/asm
diff options
context:
space:
mode:
Diffstat (limited to 'arch/powerpc/include/asm')
-rw-r--r--arch/powerpc/include/asm/cpm2.h4
-rw-r--r--arch/powerpc/include/asm/dma-mapping.h11
-rw-r--r--arch/powerpc/include/asm/elf.h4
-rw-r--r--arch/powerpc/include/asm/emulated_ops.h73
-rw-r--r--arch/powerpc/include/asm/feature-fixups.h25
-rw-r--r--arch/powerpc/include/asm/lppaca.h6
-rw-r--r--arch/powerpc/include/asm/machdep.h4
-rw-r--r--arch/powerpc/include/asm/mmu.h9
-rw-r--r--arch/powerpc/include/asm/mpc86xx.h33
-rw-r--r--arch/powerpc/include/asm/paca.h12
-rw-r--r--arch/powerpc/include/asm/page.h5
-rw-r--r--arch/powerpc/include/asm/pci-bridge.h13
-rw-r--r--arch/powerpc/include/asm/pgtable-ppc64.h5
-rw-r--r--arch/powerpc/include/asm/ppc-opcode.h25
-rw-r--r--arch/powerpc/include/asm/ppc_asm.h10
-rw-r--r--arch/powerpc/include/asm/ptrace.h4
-rw-r--r--arch/powerpc/include/asm/qe.h21
-rw-r--r--arch/powerpc/include/asm/scatterlist.h6
-rw-r--r--arch/powerpc/include/asm/swiotlb.h27
-rw-r--r--arch/powerpc/include/asm/system.h2
-rw-r--r--arch/powerpc/include/asm/xilinx_pci.h21
21 files changed, 236 insertions, 84 deletions
diff --git a/arch/powerpc/include/asm/cpm2.h b/arch/powerpc/include/asm/cpm2.h
index 0f5e8ff59a85..990ff191da8b 100644
--- a/arch/powerpc/include/asm/cpm2.h
+++ b/arch/powerpc/include/asm/cpm2.h
@@ -14,10 +14,6 @@
14#include <asm/cpm.h> 14#include <asm/cpm.h>
15#include <sysdev/fsl_soc.h> 15#include <sysdev/fsl_soc.h>
16 16
17#ifdef CONFIG_PPC_85xx
18#define CPM_MAP_ADDR (get_immrbase() + 0x80000)
19#endif
20
21/* CPM Command register. 17/* CPM Command register.
22*/ 18*/
23#define CPM_CR_RST ((uint)0x80000000) 19#define CPM_CR_RST ((uint)0x80000000)
diff --git a/arch/powerpc/include/asm/dma-mapping.h b/arch/powerpc/include/asm/dma-mapping.h
index cb448d68452c..3d9e887c3c0c 100644
--- a/arch/powerpc/include/asm/dma-mapping.h
+++ b/arch/powerpc/include/asm/dma-mapping.h
@@ -15,9 +15,18 @@
15#include <linux/scatterlist.h> 15#include <linux/scatterlist.h>
16#include <linux/dma-attrs.h> 16#include <linux/dma-attrs.h>
17#include <asm/io.h> 17#include <asm/io.h>
18#include <asm/swiotlb.h>
18 19
19#define DMA_ERROR_CODE (~(dma_addr_t)0x0) 20#define DMA_ERROR_CODE (~(dma_addr_t)0x0)
20 21
22/* Some dma direct funcs must be visible for use in other dma_ops */
23extern void *dma_direct_alloc_coherent(struct device *dev, size_t size,
24 dma_addr_t *dma_handle, gfp_t flag);
25extern void dma_direct_free_coherent(struct device *dev, size_t size,
26 void *vaddr, dma_addr_t dma_handle);
27
28extern unsigned long get_dma_direct_offset(struct device *dev);
29
21#ifdef CONFIG_NOT_COHERENT_CACHE 30#ifdef CONFIG_NOT_COHERENT_CACHE
22/* 31/*
23 * DMA-consistent mapping functions for PowerPCs that don't support 32 * DMA-consistent mapping functions for PowerPCs that don't support
@@ -78,6 +87,8 @@ struct dma_mapping_ops {
78 dma_addr_t dma_address, size_t size, 87 dma_addr_t dma_address, size_t size,
79 enum dma_data_direction direction, 88 enum dma_data_direction direction,
80 struct dma_attrs *attrs); 89 struct dma_attrs *attrs);
90 int (*addr_needs_map)(struct device *dev, dma_addr_t addr,
91 size_t size);
81#ifdef CONFIG_PPC_NEED_DMA_SYNC_OPS 92#ifdef CONFIG_PPC_NEED_DMA_SYNC_OPS
82 void (*sync_single_range_for_cpu)(struct device *hwdev, 93 void (*sync_single_range_for_cpu)(struct device *hwdev,
83 dma_addr_t dma_handle, unsigned long offset, 94 dma_addr_t dma_handle, unsigned long offset,
diff --git a/arch/powerpc/include/asm/elf.h b/arch/powerpc/include/asm/elf.h
index d6b4a12cdeff..014a624f4c8e 100644
--- a/arch/powerpc/include/asm/elf.h
+++ b/arch/powerpc/include/asm/elf.h
@@ -256,11 +256,11 @@ do { \
256 * even if we have an executable stack. 256 * even if we have an executable stack.
257 */ 257 */
258# define elf_read_implies_exec(ex, exec_stk) (test_thread_flag(TIF_32BIT) ? \ 258# define elf_read_implies_exec(ex, exec_stk) (test_thread_flag(TIF_32BIT) ? \
259 (exec_stk != EXSTACK_DISABLE_X) : 0) 259 (exec_stk == EXSTACK_DEFAULT) : 0)
260#else 260#else
261# define SET_PERSONALITY(ex) \ 261# define SET_PERSONALITY(ex) \
262 set_personality(PER_LINUX | (current->personality & (~PER_MASK))) 262 set_personality(PER_LINUX | (current->personality & (~PER_MASK)))
263# define elf_read_implies_exec(ex, exec_stk) (exec_stk != EXSTACK_DISABLE_X) 263# define elf_read_implies_exec(ex, exec_stk) (exec_stk == EXSTACK_DEFAULT)
264#endif /* __powerpc64__ */ 264#endif /* __powerpc64__ */
265 265
266extern int dcache_bsize; 266extern int dcache_bsize;
diff --git a/arch/powerpc/include/asm/emulated_ops.h b/arch/powerpc/include/asm/emulated_ops.h
new file mode 100644
index 000000000000..9154e8526732
--- /dev/null
+++ b/arch/powerpc/include/asm/emulated_ops.h
@@ -0,0 +1,73 @@
1/*
2 * Copyright 2007 Sony Corporation
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; version 2 of the License.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program.
15 * If not, see <http://www.gnu.org/licenses/>.
16 */
17
18#ifndef _ASM_POWERPC_EMULATED_OPS_H
19#define _ASM_POWERPC_EMULATED_OPS_H
20
21#include <asm/atomic.h>
22
23
24#ifdef CONFIG_PPC_EMULATED_STATS
25
26struct ppc_emulated_entry {
27 const char *name;
28 atomic_t val;
29};
30
31extern struct ppc_emulated {
32#ifdef CONFIG_ALTIVEC
33 struct ppc_emulated_entry altivec;
34#endif
35 struct ppc_emulated_entry dcba;
36 struct ppc_emulated_entry dcbz;
37 struct ppc_emulated_entry fp_pair;
38 struct ppc_emulated_entry isel;
39 struct ppc_emulated_entry mcrxr;
40 struct ppc_emulated_entry mfpvr;
41 struct ppc_emulated_entry multiple;
42 struct ppc_emulated_entry popcntb;
43 struct ppc_emulated_entry spe;
44 struct ppc_emulated_entry string;
45 struct ppc_emulated_entry unaligned;
46#ifdef CONFIG_MATH_EMULATION
47 struct ppc_emulated_entry math;
48#elif defined(CONFIG_8XX_MINIMAL_FPEMU)
49 struct ppc_emulated_entry 8xx;
50#endif
51#ifdef CONFIG_VSX
52 struct ppc_emulated_entry vsx;
53#endif
54} ppc_emulated;
55
56extern u32 ppc_warn_emulated;
57
58extern void ppc_warn_emulated_print(const char *type);
59
60#define PPC_WARN_EMULATED(type) \
61 do { \
62 atomic_inc(&ppc_emulated.type.val); \
63 if (ppc_warn_emulated) \
64 ppc_warn_emulated_print(ppc_emulated.type.name); \
65 } while (0)
66
67#else /* !CONFIG_PPC_EMULATED_STATS */
68
69#define PPC_WARN_EMULATED(type) do { } while (0)
70
71#endif /* !CONFIG_PPC_EMULATED_STATS */
72
73#endif /* _ASM_POWERPC_EMULATED_OPS_H */
diff --git a/arch/powerpc/include/asm/feature-fixups.h b/arch/powerpc/include/asm/feature-fixups.h
index e4094a5cb05b..cbd4dfa4bce2 100644
--- a/arch/powerpc/include/asm/feature-fixups.h
+++ b/arch/powerpc/include/asm/feature-fixups.h
@@ -8,8 +8,6 @@
8 * 2 of the License, or (at your option) any later version. 8 * 2 of the License, or (at your option) any later version.
9 */ 9 */
10 10
11#ifdef __ASSEMBLY__
12
13/* 11/*
14 * Feature section common macros 12 * Feature section common macros
15 * 13 *
@@ -23,10 +21,12 @@
23/* 64 bits kernel, 32 bits code (ie. vdso32) */ 21/* 64 bits kernel, 32 bits code (ie. vdso32) */
24#define FTR_ENTRY_LONG .llong 22#define FTR_ENTRY_LONG .llong
25#define FTR_ENTRY_OFFSET .long 0xffffffff; .long 23#define FTR_ENTRY_OFFSET .long 0xffffffff; .long
24#elif defined(CONFIG_PPC64)
25#define FTR_ENTRY_LONG .llong
26#define FTR_ENTRY_OFFSET .llong
26#else 27#else
27/* 64 bit kernel 64 bit code, or 32 bit kernel 32 bit code */ 28#define FTR_ENTRY_LONG .long
28#define FTR_ENTRY_LONG PPC_LONG 29#define FTR_ENTRY_OFFSET .long
29#define FTR_ENTRY_OFFSET PPC_LONG
30#endif 30#endif
31 31
32#define START_FTR_SECTION(label) label##1: 32#define START_FTR_SECTION(label) label##1:
@@ -141,6 +141,21 @@ label##5: \
141#define ALT_FW_FTR_SECTION_END_IFCLR(msk) \ 141#define ALT_FW_FTR_SECTION_END_IFCLR(msk) \
142 ALT_FW_FTR_SECTION_END_NESTED_IFCLR(msk, 97) 142 ALT_FW_FTR_SECTION_END_NESTED_IFCLR(msk, 97)
143 143
144#ifndef __ASSEMBLY__
145
146#define ASM_MMU_FTR_IF(section_if, section_else, msk, val) \
147 stringify_in_c(BEGIN_MMU_FTR_SECTION) \
148 section_if "; " \
149 stringify_in_c(MMU_FTR_SECTION_ELSE) \
150 section_else "; " \
151 stringify_in_c(ALT_MMU_FTR_SECTION_END((msk), (val)))
152
153#define ASM_MMU_FTR_IFSET(section_if, section_else, msk) \
154 ASM_MMU_FTR_IF(section_if, section_else, (msk), (msk))
155
156#define ASM_MMU_FTR_IFCLR(section_if, section_else, msk) \
157 ASM_MMU_FTR_IF(section_if, section_else, (msk), 0)
158
144#endif /* __ASSEMBLY__ */ 159#endif /* __ASSEMBLY__ */
145 160
146/* LWSYNC feature sections */ 161/* LWSYNC feature sections */
diff --git a/arch/powerpc/include/asm/lppaca.h b/arch/powerpc/include/asm/lppaca.h
index d2a65e8ca6ae..f78f65c38f05 100644
--- a/arch/powerpc/include/asm/lppaca.h
+++ b/arch/powerpc/include/asm/lppaca.h
@@ -20,6 +20,11 @@
20#define _ASM_POWERPC_LPPACA_H 20#define _ASM_POWERPC_LPPACA_H
21#ifdef __KERNEL__ 21#ifdef __KERNEL__
22 22
23/* These definitions relate to hypervisors that only exist when using
24 * a server type processor
25 */
26#ifdef CONFIG_PPC_BOOK3S
27
23//============================================================================= 28//=============================================================================
24// 29//
25// This control block contains the data that is shared between the 30// This control block contains the data that is shared between the
@@ -158,5 +163,6 @@ struct slb_shadow {
158 163
159extern struct slb_shadow slb_shadow[]; 164extern struct slb_shadow slb_shadow[];
160 165
166#endif /* CONFIG_PPC_BOOK3S */
161#endif /* __KERNEL__ */ 167#endif /* __KERNEL__ */
162#endif /* _ASM_POWERPC_LPPACA_H */ 168#endif /* _ASM_POWERPC_LPPACA_H */
diff --git a/arch/powerpc/include/asm/machdep.h b/arch/powerpc/include/asm/machdep.h
index 0efdb1dfdc5f..11d1fc3a8962 100644
--- a/arch/powerpc/include/asm/machdep.h
+++ b/arch/powerpc/include/asm/machdep.h
@@ -110,6 +110,10 @@ struct machdep_calls {
110 void (*show_percpuinfo)(struct seq_file *m, int i); 110 void (*show_percpuinfo)(struct seq_file *m, int i);
111 111
112 void (*init_IRQ)(void); 112 void (*init_IRQ)(void);
113
114 /* Return an irq, or NO_IRQ to indicate there are none pending.
115 * If for some reason there is no irq, but the interrupt
116 * shouldn't be counted as spurious, return NO_IRQ_IGNORE. */
113 unsigned int (*get_irq)(void); 117 unsigned int (*get_irq)(void);
114#ifdef CONFIG_KEXEC 118#ifdef CONFIG_KEXEC
115 void (*kexec_cpu_down)(int crash_shutdown, int secondary); 119 void (*kexec_cpu_down)(int crash_shutdown, int secondary);
diff --git a/arch/powerpc/include/asm/mmu.h b/arch/powerpc/include/asm/mmu.h
index cbf154387091..fb57ded592f9 100644
--- a/arch/powerpc/include/asm/mmu.h
+++ b/arch/powerpc/include/asm/mmu.h
@@ -52,6 +52,11 @@
52 */ 52 */
53#define MMU_FTR_NEED_DTLB_SW_LRU ASM_CONST(0x00200000) 53#define MMU_FTR_NEED_DTLB_SW_LRU ASM_CONST(0x00200000)
54 54
55/* This indicates that the processor uses the ISA 2.06 server tlbie
56 * mnemonics
57 */
58#define MMU_FTR_TLBIE_206 ASM_CONST(0x00400000)
59
55#ifndef __ASSEMBLY__ 60#ifndef __ASSEMBLY__
56#include <asm/cputable.h> 61#include <asm/cputable.h>
57 62
@@ -69,10 +74,10 @@ extern void early_init_mmu_secondary(void);
69#endif /* !__ASSEMBLY__ */ 74#endif /* !__ASSEMBLY__ */
70 75
71 76
72#ifdef CONFIG_PPC64 77#if defined(CONFIG_PPC_STD_MMU_64)
73/* 64-bit classic hash table MMU */ 78/* 64-bit classic hash table MMU */
74# include <asm/mmu-hash64.h> 79# include <asm/mmu-hash64.h>
75#elif defined(CONFIG_PPC_STD_MMU) 80#elif defined(CONFIG_PPC_STD_MMU_32)
76/* 32-bit classic hash table MMU */ 81/* 32-bit classic hash table MMU */
77# include <asm/mmu-hash32.h> 82# include <asm/mmu-hash32.h>
78#elif defined(CONFIG_40x) 83#elif defined(CONFIG_40x)
diff --git a/arch/powerpc/include/asm/mpc86xx.h b/arch/powerpc/include/asm/mpc86xx.h
deleted file mode 100644
index 15f650f987e7..000000000000
--- a/arch/powerpc/include/asm/mpc86xx.h
+++ /dev/null
@@ -1,33 +0,0 @@
1/*
2 * MPC86xx definitions
3 *
4 * Author: Jeff Brown
5 *
6 * Copyright 2004 Freescale Semiconductor, Inc
7 *
8 * This program is free software; you can redistribute it and/or modify it
9 * under the terms of the GNU General Public License as published by the
10 * Free Software Foundation; either version 2 of the License, or (at your
11 * option) any later version.
12 */
13
14#ifdef __KERNEL__
15#ifndef __ASM_POWERPC_MPC86xx_H__
16#define __ASM_POWERPC_MPC86xx_H__
17
18#include <asm/mmu.h>
19
20#ifdef CONFIG_PPC_86xx
21
22#define CPU0_BOOT_RELEASE 0x01000000
23#define CPU1_BOOT_RELEASE 0x02000000
24#define CPU_ALL_RELEASED (CPU0_BOOT_RELEASE | CPU1_BOOT_RELEASE)
25#define MCM_PORT_CONFIG_OFFSET 0x1010
26
27/* Offset from CCSRBAR */
28#define MPC86xx_MCM_OFFSET (0x00000)
29#define MPC86xx_MCM_SIZE (0x02000)
30
31#endif /* CONFIG_PPC_86xx */
32#endif /* __ASM_POWERPC_MPC86xx_H__ */
33#endif /* __KERNEL__ */
diff --git a/arch/powerpc/include/asm/paca.h b/arch/powerpc/include/asm/paca.h
index 6ef055723019..c8a3cbfe02ff 100644
--- a/arch/powerpc/include/asm/paca.h
+++ b/arch/powerpc/include/asm/paca.h
@@ -43,6 +43,7 @@ struct task_struct;
43 * processor. 43 * processor.
44 */ 44 */
45struct paca_struct { 45struct paca_struct {
46#ifdef CONFIG_PPC_BOOK3S
46 /* 47 /*
47 * Because hw_cpu_id, unlike other paca fields, is accessed 48 * Because hw_cpu_id, unlike other paca fields, is accessed
48 * routinely from other CPUs (from the IRQ code), we stick to 49 * routinely from other CPUs (from the IRQ code), we stick to
@@ -51,7 +52,7 @@ struct paca_struct {
51 */ 52 */
52 53
53 struct lppaca *lppaca_ptr; /* Pointer to LpPaca for PLIC */ 54 struct lppaca *lppaca_ptr; /* Pointer to LpPaca for PLIC */
54 55#endif /* CONFIG_PPC_BOOK3S */
55 /* 56 /*
56 * MAGIC: the spinlock functions in arch/powerpc/lib/locks.c 57 * MAGIC: the spinlock functions in arch/powerpc/lib/locks.c
57 * load lock_token and paca_index with a single lwz 58 * load lock_token and paca_index with a single lwz
@@ -64,13 +65,16 @@ struct paca_struct {
64 u64 kernel_toc; /* Kernel TOC address */ 65 u64 kernel_toc; /* Kernel TOC address */
65 u64 kernelbase; /* Base address of kernel */ 66 u64 kernelbase; /* Base address of kernel */
66 u64 kernel_msr; /* MSR while running in kernel */ 67 u64 kernel_msr; /* MSR while running in kernel */
68#ifdef CONFIG_PPC_STD_MMU_64
67 u64 stab_real; /* Absolute address of segment table */ 69 u64 stab_real; /* Absolute address of segment table */
68 u64 stab_addr; /* Virtual address of segment table */ 70 u64 stab_addr; /* Virtual address of segment table */
71#endif /* CONFIG_PPC_STD_MMU_64 */
69 void *emergency_sp; /* pointer to emergency stack */ 72 void *emergency_sp; /* pointer to emergency stack */
70 u64 data_offset; /* per cpu data offset */ 73 u64 data_offset; /* per cpu data offset */
71 s16 hw_cpu_id; /* Physical processor number */ 74 s16 hw_cpu_id; /* Physical processor number */
72 u8 cpu_start; /* At startup, processor spins until */ 75 u8 cpu_start; /* At startup, processor spins until */
73 /* this becomes non-zero. */ 76 /* this becomes non-zero. */
77#ifdef CONFIG_PPC_STD_MMU_64
74 struct slb_shadow *slb_shadow_ptr; 78 struct slb_shadow *slb_shadow_ptr;
75 79
76 /* 80 /*
@@ -81,11 +85,13 @@ struct paca_struct {
81 u64 exmc[10]; /* used for machine checks */ 85 u64 exmc[10]; /* used for machine checks */
82 u64 exslb[10]; /* used for SLB/segment table misses 86 u64 exslb[10]; /* used for SLB/segment table misses
83 * on the linear mapping */ 87 * on the linear mapping */
84 88 /* SLB related definitions */
85 mm_context_t context;
86 u16 vmalloc_sllp; 89 u16 vmalloc_sllp;
87 u16 slb_cache_ptr; 90 u16 slb_cache_ptr;
88 u16 slb_cache[SLB_CACHE_ENTRIES]; 91 u16 slb_cache[SLB_CACHE_ENTRIES];
92#endif /* CONFIG_PPC_STD_MMU_64 */
93
94 mm_context_t context;
89 95
90 /* 96 /*
91 * then miscellaneous read-write fields 97 * then miscellaneous read-write fields
diff --git a/arch/powerpc/include/asm/page.h b/arch/powerpc/include/asm/page.h
index 32cbf16f10ea..4940662ee87e 100644
--- a/arch/powerpc/include/asm/page.h
+++ b/arch/powerpc/include/asm/page.h
@@ -231,6 +231,11 @@ extern void copy_user_page(void *to, void *from, unsigned long vaddr,
231 struct page *p); 231 struct page *p);
232extern int page_is_ram(unsigned long pfn); 232extern int page_is_ram(unsigned long pfn);
233 233
234#ifdef CONFIG_PPC_SMLPAR
235void arch_free_page(struct page *page, int order);
236#define HAVE_ARCH_FREE_PAGE
237#endif
238
234struct vm_area_struct; 239struct vm_area_struct;
235 240
236typedef struct page *pgtable_t; 241typedef struct page *pgtable_t;
diff --git a/arch/powerpc/include/asm/pci-bridge.h b/arch/powerpc/include/asm/pci-bridge.h
index 84007afabdb5..4c61fa0b8d75 100644
--- a/arch/powerpc/include/asm/pci-bridge.h
+++ b/arch/powerpc/include/asm/pci-bridge.h
@@ -86,17 +86,12 @@ struct pci_controller {
86 void *io_base_alloc; 86 void *io_base_alloc;
87#endif 87#endif
88 resource_size_t io_base_phys; 88 resource_size_t io_base_phys;
89#ifndef CONFIG_PPC64
90 resource_size_t pci_io_size; 89 resource_size_t pci_io_size;
91#endif
92 90
93 /* Some machines (PReP) have a non 1:1 mapping of 91 /* Some machines (PReP) have a non 1:1 mapping of
94 * the PCI memory space in the CPU bus space 92 * the PCI memory space in the CPU bus space
95 */ 93 */
96 resource_size_t pci_mem_offset; 94 resource_size_t pci_mem_offset;
97#ifdef CONFIG_PPC64
98 unsigned long pci_io_size;
99#endif
100 95
101 /* Some machines have a special region to forward the ISA 96 /* Some machines have a special region to forward the ISA
102 * "memory" cycles such as VGA memory regions. Left to 0 97 * "memory" cycles such as VGA memory regions. Left to 0
@@ -140,10 +135,12 @@ struct pci_controller {
140 struct resource io_resource; 135 struct resource io_resource;
141 struct resource mem_resources[3]; 136 struct resource mem_resources[3];
142 int global_number; /* PCI domain number */ 137 int global_number; /* PCI domain number */
138
139 resource_size_t dma_window_base_cur;
140 resource_size_t dma_window_size;
141
143#ifdef CONFIG_PPC64 142#ifdef CONFIG_PPC64
144 unsigned long buid; 143 unsigned long buid;
145 unsigned long dma_window_base_cur;
146 unsigned long dma_window_size;
147 144
148 void *private_data; 145 void *private_data;
149#endif /* CONFIG_PPC64 */ 146#endif /* CONFIG_PPC64 */
@@ -185,7 +182,6 @@ extern int early_find_capability(struct pci_controller *hose, int bus,
185extern void setup_indirect_pci(struct pci_controller* hose, 182extern void setup_indirect_pci(struct pci_controller* hose,
186 resource_size_t cfg_addr, 183 resource_size_t cfg_addr,
187 resource_size_t cfg_data, u32 flags); 184 resource_size_t cfg_data, u32 flags);
188extern void setup_grackle(struct pci_controller *hose);
189#else /* CONFIG_PPC64 */ 185#else /* CONFIG_PPC64 */
190 186
191/* 187/*
@@ -221,6 +217,7 @@ struct pci_dn {
221#define PCI_DN(dn) ((struct pci_dn *) (dn)->data) 217#define PCI_DN(dn) ((struct pci_dn *) (dn)->data)
222 218
223extern struct device_node *fetch_dev_dn(struct pci_dev *dev); 219extern struct device_node *fetch_dev_dn(struct pci_dev *dev);
220extern void * update_dn_pci_info(struct device_node *dn, void *data);
224 221
225/* Get a device_node from a pci_dev. This code must be fast except 222/* Get a device_node from a pci_dev. This code must be fast except
226 * in the case where the sysdata is incorrect and needs to be fixed 223 * in the case where the sysdata is incorrect and needs to be fixed
diff --git a/arch/powerpc/include/asm/pgtable-ppc64.h b/arch/powerpc/include/asm/pgtable-ppc64.h
index c40db05f21e0..8cd083c61503 100644
--- a/arch/powerpc/include/asm/pgtable-ppc64.h
+++ b/arch/powerpc/include/asm/pgtable-ppc64.h
@@ -31,9 +31,11 @@
31#error TASK_SIZE_USER64 exceeds pagetable range 31#error TASK_SIZE_USER64 exceeds pagetable range
32#endif 32#endif
33 33
34#ifdef CONFIG_PPC_STD_MMU_64
34#if TASK_SIZE_USER64 > (1UL << (USER_ESID_BITS + SID_SHIFT)) 35#if TASK_SIZE_USER64 > (1UL << (USER_ESID_BITS + SID_SHIFT))
35#error TASK_SIZE_USER64 exceeds user VSID range 36#error TASK_SIZE_USER64 exceeds user VSID range
36#endif 37#endif
38#endif
37 39
38/* 40/*
39 * Define the address range of the vmalloc VM area. 41 * Define the address range of the vmalloc VM area.
@@ -199,8 +201,11 @@ static inline unsigned long pte_update(struct mm_struct *mm,
199 if (!huge) 201 if (!huge)
200 assert_pte_locked(mm, addr); 202 assert_pte_locked(mm, addr);
201 203
204#ifdef CONFIG_PPC_STD_MMU_64
202 if (old & _PAGE_HASHPTE) 205 if (old & _PAGE_HASHPTE)
203 hpte_need_flush(mm, addr, ptep, old, huge); 206 hpte_need_flush(mm, addr, ptep, old, huge);
207#endif
208
204 return old; 209 return old;
205} 210}
206 211
diff --git a/arch/powerpc/include/asm/ppc-opcode.h b/arch/powerpc/include/asm/ppc-opcode.h
index 640ccbbc0977..b74f16d45cb4 100644
--- a/arch/powerpc/include/asm/ppc-opcode.h
+++ b/arch/powerpc/include/asm/ppc-opcode.h
@@ -25,6 +25,7 @@
25#define PPC_INST_LSWI 0x7c0004aa 25#define PPC_INST_LSWI 0x7c0004aa
26#define PPC_INST_LSWX 0x7c00042a 26#define PPC_INST_LSWX 0x7c00042a
27#define PPC_INST_LWSYNC 0x7c2004ac 27#define PPC_INST_LWSYNC 0x7c2004ac
28#define PPC_INST_LXVD2X 0x7c000698
28#define PPC_INST_MCRXR 0x7c000400 29#define PPC_INST_MCRXR 0x7c000400
29#define PPC_INST_MCRXR_MASK 0xfc0007fe 30#define PPC_INST_MCRXR_MASK 0xfc0007fe
30#define PPC_INST_MFSPR_PVR 0x7c1f42a6 31#define PPC_INST_MFSPR_PVR 0x7c1f42a6
@@ -43,14 +44,18 @@
43 44
44#define PPC_INST_STSWI 0x7c0005aa 45#define PPC_INST_STSWI 0x7c0005aa
45#define PPC_INST_STSWX 0x7c00052a 46#define PPC_INST_STSWX 0x7c00052a
47#define PPC_INST_STXVD2X 0x7c000798
48#define PPC_INST_TLBIE 0x7c000264
46#define PPC_INST_TLBILX 0x7c000024 49#define PPC_INST_TLBILX 0x7c000024
47#define PPC_INST_WAIT 0x7c00007c 50#define PPC_INST_WAIT 0x7c00007c
48 51
49/* macros to insert fields into opcodes */ 52/* macros to insert fields into opcodes */
50#define __PPC_RA(a) ((a & 0x1f) << 16) 53#define __PPC_RA(a) (((a) & 0x1f) << 16)
51#define __PPC_RB(b) ((b & 0x1f) << 11) 54#define __PPC_RB(b) (((b) & 0x1f) << 11)
52#define __PPC_T_TLB(t) ((t & 0x3) << 21) 55#define __PPC_RS(s) (((s) & 0x1f) << 21)
53#define __PPC_WC(w) ((w & 0x3) << 21) 56#define __PPC_XS(s) ((((s) & 0x1f) << 21) | (((s) & 0x20) >> 5))
57#define __PPC_T_TLB(t) (((t) & 0x3) << 21)
58#define __PPC_WC(w) (((w) & 0x3) << 21)
54 59
55/* Deal with instructions that older assemblers aren't aware of */ 60/* Deal with instructions that older assemblers aren't aware of */
56#define PPC_DCBAL(a, b) stringify_in_c(.long PPC_INST_DCBAL | \ 61#define PPC_DCBAL(a, b) stringify_in_c(.long PPC_INST_DCBAL | \
@@ -69,5 +74,17 @@
69#define PPC_TLBILX_VA(a, b) PPC_TLBILX(3, a, b) 74#define PPC_TLBILX_VA(a, b) PPC_TLBILX(3, a, b)
70#define PPC_WAIT(w) stringify_in_c(.long PPC_INST_WAIT | \ 75#define PPC_WAIT(w) stringify_in_c(.long PPC_INST_WAIT | \
71 __PPC_WC(w)) 76 __PPC_WC(w))
77#define PPC_TLBIE(lp,a) stringify_in_c(.long PPC_INST_TLBIE | \
78 __PPC_RB(a) | __PPC_RS(lp))
79
80/*
81 * Define what the VSX XX1 form instructions will look like, then add
82 * the 128 bit load store instructions based on that.
83 */
84#define VSX_XX1(s, a, b) (__PPC_XS(s) | __PPC_RA(a) | __PPC_RB(b))
85#define STXVD2X(s, a, b) stringify_in_c(.long PPC_INST_STXVD2X | \
86 VSX_XX1((s), (a), (b)))
87#define LXVD2X(s, a, b) stringify_in_c(.long PPC_INST_LXVD2X | \
88 VSX_XX1((s), (a), (b)))
72 89
73#endif /* _ASM_POWERPC_PPC_OPCODE_H */ 90#endif /* _ASM_POWERPC_PPC_OPCODE_H */
diff --git a/arch/powerpc/include/asm/ppc_asm.h b/arch/powerpc/include/asm/ppc_asm.h
index 384d90c9c272..f9729529c20d 100644
--- a/arch/powerpc/include/asm/ppc_asm.h
+++ b/arch/powerpc/include/asm/ppc_asm.h
@@ -76,16 +76,6 @@ END_FTR_SECTION_IFCLR(CPU_FTR_PURR); \
76 REST_10GPRS(22, base) 76 REST_10GPRS(22, base)
77#endif 77#endif
78 78
79/*
80 * Define what the VSX XX1 form instructions will look like, then add
81 * the 128 bit load store instructions based on that.
82 */
83#define VSX_XX1(xs, ra, rb) (((xs) & 0x1f) << 21 | ((ra) << 16) | \
84 ((rb) << 11) | (((xs) >> 5)))
85
86#define STXVD2X(xs, ra, rb) .long (0x7c000798 | VSX_XX1((xs), (ra), (rb)))
87#define LXVD2X(xs, ra, rb) .long (0x7c000698 | VSX_XX1((xs), (ra), (rb)))
88
89#define SAVE_2GPRS(n, base) SAVE_GPR(n, base); SAVE_GPR(n+1, base) 79#define SAVE_2GPRS(n, base) SAVE_GPR(n, base); SAVE_GPR(n+1, base)
90#define SAVE_4GPRS(n, base) SAVE_2GPRS(n, base); SAVE_2GPRS(n+2, base) 80#define SAVE_4GPRS(n, base) SAVE_2GPRS(n, base); SAVE_2GPRS(n+2, base)
91#define SAVE_8GPRS(n, base) SAVE_4GPRS(n, base); SAVE_4GPRS(n+4, base) 81#define SAVE_8GPRS(n, base) SAVE_4GPRS(n, base); SAVE_4GPRS(n+4, base)
diff --git a/arch/powerpc/include/asm/ptrace.h b/arch/powerpc/include/asm/ptrace.h
index c9c678fb2538..8c341490cfc5 100644
--- a/arch/powerpc/include/asm/ptrace.h
+++ b/arch/powerpc/include/asm/ptrace.h
@@ -135,7 +135,9 @@ do { \
135 * These are defined as per linux/ptrace.h, which see. 135 * These are defined as per linux/ptrace.h, which see.
136 */ 136 */
137#define arch_has_single_step() (1) 137#define arch_has_single_step() (1)
138#define arch_has_block_step() (!cpu_has_feature(CPU_FTR_601))
138extern void user_enable_single_step(struct task_struct *); 139extern void user_enable_single_step(struct task_struct *);
140extern void user_enable_block_step(struct task_struct *);
139extern void user_disable_single_step(struct task_struct *); 141extern void user_disable_single_step(struct task_struct *);
140 142
141#endif /* __ASSEMBLY__ */ 143#endif /* __ASSEMBLY__ */
@@ -288,4 +290,6 @@ extern void user_disable_single_step(struct task_struct *);
288#define PPC_PTRACE_PEEKUSR_3264 0x91 290#define PPC_PTRACE_PEEKUSR_3264 0x91
289#define PPC_PTRACE_POKEUSR_3264 0x90 291#define PPC_PTRACE_POKEUSR_3264 0x90
290 292
293#define PTRACE_SINGLEBLOCK 0x100 /* resume execution until next branch */
294
291#endif /* _ASM_POWERPC_PTRACE_H */ 295#endif /* _ASM_POWERPC_PTRACE_H */
diff --git a/arch/powerpc/include/asm/qe.h b/arch/powerpc/include/asm/qe.h
index 2701753d9937..e0faf332c9c9 100644
--- a/arch/powerpc/include/asm/qe.h
+++ b/arch/powerpc/include/asm/qe.h
@@ -22,7 +22,7 @@
22#include <asm/cpm.h> 22#include <asm/cpm.h>
23#include <asm/immap_qe.h> 23#include <asm/immap_qe.h>
24 24
25#define QE_NUM_OF_SNUM 28 25#define QE_NUM_OF_SNUM 256 /* There are 256 serial number in QE */
26#define QE_NUM_OF_BRGS 16 26#define QE_NUM_OF_BRGS 16
27#define QE_NUM_OF_PORTS 1024 27#define QE_NUM_OF_PORTS 1024
28 28
@@ -152,6 +152,9 @@ unsigned int qe_get_brg_clk(void);
152int qe_setbrg(enum qe_clock brg, unsigned int rate, unsigned int multiplier); 152int qe_setbrg(enum qe_clock brg, unsigned int rate, unsigned int multiplier);
153int qe_get_snum(void); 153int qe_get_snum(void);
154void qe_put_snum(u8 snum); 154void qe_put_snum(u8 snum);
155unsigned int qe_get_num_of_risc(void);
156unsigned int qe_get_num_of_snums(void);
157
155/* we actually use cpm_muram implementation, define this for convenience */ 158/* we actually use cpm_muram implementation, define this for convenience */
156#define qe_muram_init cpm_muram_init 159#define qe_muram_init cpm_muram_init
157#define qe_muram_alloc cpm_muram_alloc 160#define qe_muram_alloc cpm_muram_alloc
@@ -231,12 +234,16 @@ struct qe_bd {
231#define QE_ALIGNMENT_OF_PRAM 64 234#define QE_ALIGNMENT_OF_PRAM 64
232 235
233/* RISC allocation */ 236/* RISC allocation */
234enum qe_risc_allocation { 237#define QE_RISC_ALLOCATION_RISC1 0x1 /* RISC 1 */
235 QE_RISC_ALLOCATION_RISC1 = 1, /* RISC 1 */ 238#define QE_RISC_ALLOCATION_RISC2 0x2 /* RISC 2 */
236 QE_RISC_ALLOCATION_RISC2 = 2, /* RISC 2 */ 239#define QE_RISC_ALLOCATION_RISC3 0x4 /* RISC 3 */
237 QE_RISC_ALLOCATION_RISC1_AND_RISC2 = 3 /* Dynamically choose 240#define QE_RISC_ALLOCATION_RISC4 0x8 /* RISC 4 */
238 RISC 1 or RISC 2 */ 241#define QE_RISC_ALLOCATION_RISC1_AND_RISC2 (QE_RISC_ALLOCATION_RISC1 | \
239}; 242 QE_RISC_ALLOCATION_RISC2)
243#define QE_RISC_ALLOCATION_FOUR_RISCS (QE_RISC_ALLOCATION_RISC1 | \
244 QE_RISC_ALLOCATION_RISC2 | \
245 QE_RISC_ALLOCATION_RISC3 | \
246 QE_RISC_ALLOCATION_RISC4)
240 247
241/* QE extended filtering Table Lookup Key Size */ 248/* QE extended filtering Table Lookup Key Size */
242enum qe_fltr_tbl_lookup_key_size { 249enum qe_fltr_tbl_lookup_key_size {
diff --git a/arch/powerpc/include/asm/scatterlist.h b/arch/powerpc/include/asm/scatterlist.h
index fcf7d55afe45..912bf597870f 100644
--- a/arch/powerpc/include/asm/scatterlist.h
+++ b/arch/powerpc/include/asm/scatterlist.h
@@ -21,7 +21,7 @@ struct scatterlist {
21 unsigned int offset; 21 unsigned int offset;
22 unsigned int length; 22 unsigned int length;
23 23
24 /* For TCE support */ 24 /* For TCE or SWIOTLB support */
25 dma_addr_t dma_address; 25 dma_addr_t dma_address;
26 u32 dma_length; 26 u32 dma_length;
27}; 27};
@@ -34,11 +34,7 @@ struct scatterlist {
34 * is 0. 34 * is 0.
35 */ 35 */
36#define sg_dma_address(sg) ((sg)->dma_address) 36#define sg_dma_address(sg) ((sg)->dma_address)
37#ifdef __powerpc64__
38#define sg_dma_len(sg) ((sg)->dma_length) 37#define sg_dma_len(sg) ((sg)->dma_length)
39#else
40#define sg_dma_len(sg) ((sg)->length)
41#endif
42 38
43#ifdef __powerpc64__ 39#ifdef __powerpc64__
44#define ISA_DMA_THRESHOLD (~0UL) 40#define ISA_DMA_THRESHOLD (~0UL)
diff --git a/arch/powerpc/include/asm/swiotlb.h b/arch/powerpc/include/asm/swiotlb.h
new file mode 100644
index 000000000000..30891d6e2bc1
--- /dev/null
+++ b/arch/powerpc/include/asm/swiotlb.h
@@ -0,0 +1,27 @@
1/*
2 * Copyright (C) 2009 Becky Bruce, Freescale Semiconductor
3 *
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License as published by the
6 * Free Software Foundation; either version 2 of the License, or (at your
7 * option) any later version.
8 *
9 */
10
11#ifndef __ASM_SWIOTLB_H
12#define __ASM_SWIOTLB_H
13
14#include <linux/swiotlb.h>
15
16extern struct dma_mapping_ops swiotlb_dma_ops;
17extern struct dma_mapping_ops swiotlb_pci_dma_ops;
18
19int swiotlb_arch_address_needs_mapping(struct device *, dma_addr_t,
20 size_t size);
21
22static inline void dma_mark_clean(void *addr, size_t size) {}
23
24extern unsigned int ppc_swiotlb_enable;
25int __init swiotlb_setup_bus_notifier(void);
26
27#endif /* __ASM_SWIOTLB_H */
diff --git a/arch/powerpc/include/asm/system.h b/arch/powerpc/include/asm/system.h
index 2b2420a49884..bb8e006a47c6 100644
--- a/arch/powerpc/include/asm/system.h
+++ b/arch/powerpc/include/asm/system.h
@@ -211,7 +211,7 @@ extern struct task_struct *_switch(struct thread_struct *prev,
211 211
212extern unsigned int rtas_data; 212extern unsigned int rtas_data;
213extern int mem_init_done; /* set on boot once kmalloc can be called */ 213extern int mem_init_done; /* set on boot once kmalloc can be called */
214extern int init_bootmem_done; /* set on !NUMA once bootmem is available */ 214extern int init_bootmem_done; /* set once bootmem is available */
215extern phys_addr_t memory_limit; 215extern phys_addr_t memory_limit;
216extern unsigned long klimit; 216extern unsigned long klimit;
217 217
diff --git a/arch/powerpc/include/asm/xilinx_pci.h b/arch/powerpc/include/asm/xilinx_pci.h
new file mode 100644
index 000000000000..7a8275caf6af
--- /dev/null
+++ b/arch/powerpc/include/asm/xilinx_pci.h
@@ -0,0 +1,21 @@
1/*
2 * Xilinx pci external definitions
3 *
4 * Copyright 2009 Roderick Colenbrander
5 * Copyright 2009 Secret Lab Technologies Ltd.
6 *
7 * This file is licensed under the terms of the GNU General Public License
8 * version 2. This program is licensed "as is" without any warranty of any
9 * kind, whether express or implied.
10 */
11
12#ifndef INCLUDE_XILINX_PCI
13#define INCLUDE_XILINX_PCI
14
15#ifdef CONFIG_XILINX_PCI
16extern void __init xilinx_pci_init(void);
17#else
18static inline void __init xilinx_pci_init(void) { return; }
19#endif
20
21#endif /* INCLUDE_XILINX_PCI */