aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/include/asm
diff options
context:
space:
mode:
authorDave Kleikamp <shaggy@linux.vnet.ibm.com>2010-03-05 05:43:12 -0500
committerJosh Boyer <jwboyer@linux.vnet.ibm.com>2010-05-05 09:11:10 -0400
commite7f75ad01d590243904c2d95ab47e6b2e9ef6dad (patch)
tree454cf065417973e9c2fcd75542351c2534b9a4b9 /arch/powerpc/include/asm
parent795033c344d88dc6aa5106d0cc358656f29bd722 (diff)
powerpc/47x: Base ppc476 support
This patch adds the base support for the 476 processor. The code was primarily written by Ben Herrenschmidt and Torez Smith, but I've been maintaining it for a while. The goal is to have a single binary that will run on 44x and 47x, but we still have some details to work out. The biggest is that the L1 cache line size differs on the two platforms, but it's currently a compile-time option. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Torez Smith <lnxtorez@linux.vnet.ibm.com> Signed-off-by: Dave Kleikamp <shaggy@linux.vnet.ibm.com> Signed-off-by: Josh Boyer <jwboyer@linux.vnet.ibm.com>
Diffstat (limited to 'arch/powerpc/include/asm')
-rw-r--r--arch/powerpc/include/asm/cache.h6
-rw-r--r--arch/powerpc/include/asm/cputable.h4
-rw-r--r--arch/powerpc/include/asm/mmu-44x.h51
-rw-r--r--arch/powerpc/include/asm/mmu.h1
-rw-r--r--arch/powerpc/include/asm/reg.h1
-rw-r--r--arch/powerpc/include/asm/reg_booke.h24
6 files changed, 85 insertions, 2 deletions
diff --git a/arch/powerpc/include/asm/cache.h b/arch/powerpc/include/asm/cache.h
index 81de6eb3455d..725634fc18c6 100644
--- a/arch/powerpc/include/asm/cache.h
+++ b/arch/powerpc/include/asm/cache.h
@@ -12,8 +12,12 @@
12#define L1_CACHE_SHIFT 6 12#define L1_CACHE_SHIFT 6
13#define MAX_COPY_PREFETCH 4 13#define MAX_COPY_PREFETCH 4
14#elif defined(CONFIG_PPC32) 14#elif defined(CONFIG_PPC32)
15#define L1_CACHE_SHIFT 5
16#define MAX_COPY_PREFETCH 4 15#define MAX_COPY_PREFETCH 4
16#if defined(CONFIG_PPC_47x)
17#define L1_CACHE_SHIFT 7
18#else
19#define L1_CACHE_SHIFT 5
20#endif
17#else /* CONFIG_PPC64 */ 21#else /* CONFIG_PPC64 */
18#define L1_CACHE_SHIFT 7 22#define L1_CACHE_SHIFT 7
19#endif 23#endif
diff --git a/arch/powerpc/include/asm/cputable.h b/arch/powerpc/include/asm/cputable.h
index abb833b0e58f..97ab5089df67 100644
--- a/arch/powerpc/include/asm/cputable.h
+++ b/arch/powerpc/include/asm/cputable.h
@@ -365,6 +365,7 @@ extern const char *powerpc_base_platform;
365#define CPU_FTRS_44X (CPU_FTR_USE_TB | CPU_FTR_NODSISRALIGN | CPU_FTR_NOEXECUTE) 365#define CPU_FTRS_44X (CPU_FTR_USE_TB | CPU_FTR_NODSISRALIGN | CPU_FTR_NOEXECUTE)
366#define CPU_FTRS_440x6 (CPU_FTR_USE_TB | CPU_FTR_NODSISRALIGN | CPU_FTR_NOEXECUTE | \ 366#define CPU_FTRS_440x6 (CPU_FTR_USE_TB | CPU_FTR_NODSISRALIGN | CPU_FTR_NOEXECUTE | \
367 CPU_FTR_INDEXED_DCR) 367 CPU_FTR_INDEXED_DCR)
368#define CPU_FTRS_47X (CPU_FTRS_440x6)
368#define CPU_FTRS_E200 (CPU_FTR_USE_TB | CPU_FTR_SPE_COMP | \ 369#define CPU_FTRS_E200 (CPU_FTR_USE_TB | CPU_FTR_SPE_COMP | \
369 CPU_FTR_NODSISRALIGN | CPU_FTR_COHERENT_ICACHE | \ 370 CPU_FTR_NODSISRALIGN | CPU_FTR_COHERENT_ICACHE | \
370 CPU_FTR_UNIFIED_ID_CACHE | CPU_FTR_NOEXECUTE) 371 CPU_FTR_UNIFIED_ID_CACHE | CPU_FTR_NOEXECUTE)
@@ -453,6 +454,9 @@ enum {
453#ifdef CONFIG_44x 454#ifdef CONFIG_44x
454 CPU_FTRS_44X | CPU_FTRS_440x6 | 455 CPU_FTRS_44X | CPU_FTRS_440x6 |
455#endif 456#endif
457#ifdef CONFIG_PPC_47x
458 CPU_FTRS_47X |
459#endif
456#ifdef CONFIG_E200 460#ifdef CONFIG_E200
457 CPU_FTRS_E200 | 461 CPU_FTRS_E200 |
458#endif 462#endif
diff --git a/arch/powerpc/include/asm/mmu-44x.h b/arch/powerpc/include/asm/mmu-44x.h
index 0372669383a8..bf52d704fc47 100644
--- a/arch/powerpc/include/asm/mmu-44x.h
+++ b/arch/powerpc/include/asm/mmu-44x.h
@@ -40,7 +40,7 @@
40#define PPC44x_TLB_I 0x00000400 /* Caching is inhibited */ 40#define PPC44x_TLB_I 0x00000400 /* Caching is inhibited */
41#define PPC44x_TLB_M 0x00000200 /* Memory is coherent */ 41#define PPC44x_TLB_M 0x00000200 /* Memory is coherent */
42#define PPC44x_TLB_G 0x00000100 /* Memory is guarded */ 42#define PPC44x_TLB_G 0x00000100 /* Memory is guarded */
43#define PPC44x_TLB_E 0x00000080 /* Memory is guarded */ 43#define PPC44x_TLB_E 0x00000080 /* Memory is little endian */
44 44
45#define PPC44x_TLB_PERM_MASK 0x0000003f 45#define PPC44x_TLB_PERM_MASK 0x0000003f
46#define PPC44x_TLB_UX 0x00000020 /* User execution */ 46#define PPC44x_TLB_UX 0x00000020 /* User execution */
@@ -53,6 +53,52 @@
53/* Number of TLB entries */ 53/* Number of TLB entries */
54#define PPC44x_TLB_SIZE 64 54#define PPC44x_TLB_SIZE 64
55 55
56/* 47x bits */
57#define PPC47x_MMUCR_TID 0x0000ffff
58#define PPC47x_MMUCR_STS 0x00010000
59
60/* Page identification fields */
61#define PPC47x_TLB0_EPN_MASK 0xfffff000 /* Effective Page Number */
62#define PPC47x_TLB0_VALID 0x00000800 /* Valid flag */
63#define PPC47x_TLB0_TS 0x00000400 /* Translation address space */
64#define PPC47x_TLB0_4K 0x00000000
65#define PPC47x_TLB0_16K 0x00000010
66#define PPC47x_TLB0_64K 0x00000030
67#define PPC47x_TLB0_1M 0x00000070
68#define PPC47x_TLB0_16M 0x000000f0
69#define PPC47x_TLB0_256M 0x000001f0
70#define PPC47x_TLB0_1G 0x000003f0
71#define PPC47x_TLB0_BOLTED_R 0x00000008 /* tlbre only */
72
73/* Translation fields */
74#define PPC47x_TLB1_RPN_MASK 0xfffff000 /* Real Page Number */
75#define PPC47x_TLB1_ERPN_MASK 0x000003ff
76
77/* Storage attribute and access control fields */
78#define PPC47x_TLB2_ATTR_MASK 0x0003ff80
79#define PPC47x_TLB2_IL1I 0x00020000 /* Memory is guarded */
80#define PPC47x_TLB2_IL1D 0x00010000 /* Memory is guarded */
81#define PPC47x_TLB2_U0 0x00008000 /* User 0 */
82#define PPC47x_TLB2_U1 0x00004000 /* User 1 */
83#define PPC47x_TLB2_U2 0x00002000 /* User 2 */
84#define PPC47x_TLB2_U3 0x00001000 /* User 3 */
85#define PPC47x_TLB2_W 0x00000800 /* Caching is write-through */
86#define PPC47x_TLB2_I 0x00000400 /* Caching is inhibited */
87#define PPC47x_TLB2_M 0x00000200 /* Memory is coherent */
88#define PPC47x_TLB2_G 0x00000100 /* Memory is guarded */
89#define PPC47x_TLB2_E 0x00000080 /* Memory is little endian */
90#define PPC47x_TLB2_PERM_MASK 0x0000003f
91#define PPC47x_TLB2_UX 0x00000020 /* User execution */
92#define PPC47x_TLB2_UW 0x00000010 /* User write */
93#define PPC47x_TLB2_UR 0x00000008 /* User read */
94#define PPC47x_TLB2_SX 0x00000004 /* Super execution */
95#define PPC47x_TLB2_SW 0x00000002 /* Super write */
96#define PPC47x_TLB2_SR 0x00000001 /* Super read */
97#define PPC47x_TLB2_U_RWX (PPC47x_TLB2_UX|PPC47x_TLB2_UW|PPC47x_TLB2_UR)
98#define PPC47x_TLB2_S_RWX (PPC47x_TLB2_SX|PPC47x_TLB2_SW|PPC47x_TLB2_SR)
99#define PPC47x_TLB2_S_RW (PPC47x_TLB2_SW | PPC47x_TLB2_SR)
100#define PPC47x_TLB2_IMG (PPC47x_TLB2_I | PPC47x_TLB2_M | PPC47x_TLB2_G)
101
56#ifndef __ASSEMBLY__ 102#ifndef __ASSEMBLY__
57 103
58extern unsigned int tlb_44x_hwater; 104extern unsigned int tlb_44x_hwater;
@@ -79,12 +125,15 @@ typedef struct {
79 125
80#if (PAGE_SHIFT == 12) 126#if (PAGE_SHIFT == 12)
81#define PPC44x_TLBE_SIZE PPC44x_TLB_4K 127#define PPC44x_TLBE_SIZE PPC44x_TLB_4K
128#define PPC47x_TLBE_SIZE PPC47x_TLB0_4K
82#define mmu_virtual_psize MMU_PAGE_4K 129#define mmu_virtual_psize MMU_PAGE_4K
83#elif (PAGE_SHIFT == 14) 130#elif (PAGE_SHIFT == 14)
84#define PPC44x_TLBE_SIZE PPC44x_TLB_16K 131#define PPC44x_TLBE_SIZE PPC44x_TLB_16K
132#define PPC47x_TLBE_SIZE PPC47x_TLB0_16K
85#define mmu_virtual_psize MMU_PAGE_16K 133#define mmu_virtual_psize MMU_PAGE_16K
86#elif (PAGE_SHIFT == 16) 134#elif (PAGE_SHIFT == 16)
87#define PPC44x_TLBE_SIZE PPC44x_TLB_64K 135#define PPC44x_TLBE_SIZE PPC44x_TLB_64K
136#define PPC47x_TLBE_SIZE PPC47x_TLB0_64K
88#define mmu_virtual_psize MMU_PAGE_64K 137#define mmu_virtual_psize MMU_PAGE_64K
89#elif (PAGE_SHIFT == 18) 138#elif (PAGE_SHIFT == 18)
90#define PPC44x_TLBE_SIZE PPC44x_TLB_256K 139#define PPC44x_TLBE_SIZE PPC44x_TLB_256K
diff --git a/arch/powerpc/include/asm/mmu.h b/arch/powerpc/include/asm/mmu.h
index 7ffbb65ff7a9..7ebf42ed84a2 100644
--- a/arch/powerpc/include/asm/mmu.h
+++ b/arch/powerpc/include/asm/mmu.h
@@ -18,6 +18,7 @@
18#define MMU_FTR_TYPE_44x ASM_CONST(0x00000008) 18#define MMU_FTR_TYPE_44x ASM_CONST(0x00000008)
19#define MMU_FTR_TYPE_FSL_E ASM_CONST(0x00000010) 19#define MMU_FTR_TYPE_FSL_E ASM_CONST(0x00000010)
20#define MMU_FTR_TYPE_3E ASM_CONST(0x00000020) 20#define MMU_FTR_TYPE_3E ASM_CONST(0x00000020)
21#define MMU_FTR_TYPE_47x ASM_CONST(0x00000040)
21 22
22/* 23/*
23 * This is individual features 24 * This is individual features
diff --git a/arch/powerpc/include/asm/reg.h b/arch/powerpc/include/asm/reg.h
index 5572e86223f4..b2d1ac635f22 100644
--- a/arch/powerpc/include/asm/reg.h
+++ b/arch/powerpc/include/asm/reg.h
@@ -817,6 +817,7 @@
817#define PVR_403GC 0x00200200 817#define PVR_403GC 0x00200200
818#define PVR_403GCX 0x00201400 818#define PVR_403GCX 0x00201400
819#define PVR_405GP 0x40110000 819#define PVR_405GP 0x40110000
820#define PVR_476 0x11a52000
820#define PVR_STB03XXX 0x40310000 821#define PVR_STB03XXX 0x40310000
821#define PVR_NP405H 0x41410000 822#define PVR_NP405H 0x41410000
822#define PVR_NP405L 0x41610000 823#define PVR_NP405L 0x41610000
diff --git a/arch/powerpc/include/asm/reg_booke.h b/arch/powerpc/include/asm/reg_booke.h
index 414d434a66d0..5304a37ba425 100644
--- a/arch/powerpc/include/asm/reg_booke.h
+++ b/arch/powerpc/include/asm/reg_booke.h
@@ -191,6 +191,10 @@
191#define MCSR_DCFP 0x01000000 /* D-Cache Flush Parity Error */ 191#define MCSR_DCFP 0x01000000 /* D-Cache Flush Parity Error */
192#define MCSR_IMPE 0x00800000 /* Imprecise Machine Check Exception */ 192#define MCSR_IMPE 0x00800000 /* Imprecise Machine Check Exception */
193 193
194#define PPC47x_MCSR_GPR 0x01000000 /* GPR parity error */
195#define PPC47x_MCSR_FPR 0x00800000 /* FPR parity error */
196#define PPC47x_MCSR_IPR 0x00400000 /* Imprecise Machine Check Exception */
197
194#ifdef CONFIG_E500 198#ifdef CONFIG_E500
195#define MCSR_MCP 0x80000000UL /* Machine Check Input Pin */ 199#define MCSR_MCP 0x80000000UL /* Machine Check Input Pin */
196#define MCSR_ICPERR 0x40000000UL /* I-Cache Parity Error */ 200#define MCSR_ICPERR 0x40000000UL /* I-Cache Parity Error */
@@ -604,5 +608,25 @@
604#define DBCR_JOI 0x00000002 /* JTAG Serial Outbound Int. Enable */ 608#define DBCR_JOI 0x00000002 /* JTAG Serial Outbound Int. Enable */
605#define DBCR_JII 0x00000001 /* JTAG Serial Inbound Int. Enable */ 609#define DBCR_JII 0x00000001 /* JTAG Serial Inbound Int. Enable */
606#endif /* 403GCX */ 610#endif /* 403GCX */
611
612/* Some 476 specific registers */
613#define SPRN_SSPCR 830
614#define SPRN_USPCR 831
615#define SPRN_ISPCR 829
616#define SPRN_MMUBE0 820
617#define MMUBE0_IBE0_SHIFT 24
618#define MMUBE0_IBE1_SHIFT 16
619#define MMUBE0_IBE2_SHIFT 8
620#define MMUBE0_VBE0 0x00000004
621#define MMUBE0_VBE1 0x00000002
622#define MMUBE0_VBE2 0x00000001
623#define SPRN_MMUBE1 821
624#define MMUBE1_IBE3_SHIFT 24
625#define MMUBE1_IBE4_SHIFT 16
626#define MMUBE1_IBE5_SHIFT 8
627#define MMUBE1_VBE3 0x00000004
628#define MMUBE1_VBE4 0x00000002
629#define MMUBE1_VBE5 0x00000001
630
607#endif /* __ASM_POWERPC_REG_BOOKE_H__ */ 631#endif /* __ASM_POWERPC_REG_BOOKE_H__ */
608#endif /* __KERNEL__ */ 632#endif /* __KERNEL__ */