aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorKumar Gala <galak@freescale.com>2005-06-21 20:15:26 -0400
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-06-21 21:46:24 -0400
commit5be061eee931db2718feecaf10df17610386202b (patch)
tree1e78b9993aaa8f176dd2a71c2d6ef01e224b34b8 /arch
parent65145e060b1c933ebc4215c3b493f586e08a1d5c (diff)
[PATCH] ppc32: Clean up NUM_TLBCAMS usage for Freescale Book-E PPC's
Made the number of TLB CAM entries private and converted the board consumers to use num_tlbcam_entries which is setup at boot time from configuration registers. This way the only consumers of the #define NUM_TLBCAMS are the arrays used to manage the TLB. Signed-off-by: Kumar Gala <kumar.gala@freescale.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'arch')
-rw-r--r--arch/ppc/mm/fsl_booke_mmu.c2
-rw-r--r--arch/ppc/mm/mmu_decl.h2
-rw-r--r--arch/ppc/mm/pgtable.c1
-rw-r--r--arch/ppc/platforms/85xx/mpc8540_ads.c4
-rw-r--r--arch/ppc/platforms/85xx/mpc85xx_cds_common.c4
-rw-r--r--arch/ppc/platforms/85xx/sbc8560.c4
6 files changed, 10 insertions, 7 deletions
diff --git a/arch/ppc/mm/fsl_booke_mmu.c b/arch/ppc/mm/fsl_booke_mmu.c
index 36233bdcdf8f..e07990efa046 100644
--- a/arch/ppc/mm/fsl_booke_mmu.c
+++ b/arch/ppc/mm/fsl_booke_mmu.c
@@ -64,6 +64,8 @@ extern unsigned long total_lowmem;
64extern unsigned long __max_low_memory; 64extern unsigned long __max_low_memory;
65#define MAX_LOW_MEM CONFIG_LOWMEM_SIZE 65#define MAX_LOW_MEM CONFIG_LOWMEM_SIZE
66 66
67#define NUM_TLBCAMS (16)
68
67struct tlbcam { 69struct tlbcam {
68 u32 MAS0; 70 u32 MAS0;
69 u32 MAS1; 71 u32 MAS1;
diff --git a/arch/ppc/mm/mmu_decl.h b/arch/ppc/mm/mmu_decl.h
index ffcdb46997dc..540f3292b229 100644
--- a/arch/ppc/mm/mmu_decl.h
+++ b/arch/ppc/mm/mmu_decl.h
@@ -43,6 +43,8 @@ extern int mem_init_done;
43extern PTE *Hash, *Hash_end; 43extern PTE *Hash, *Hash_end;
44extern unsigned long Hash_size, Hash_mask; 44extern unsigned long Hash_size, Hash_mask;
45 45
46extern unsigned int num_tlbcam_entries;
47
46/* ...and now those things that may be slightly different between processor 48/* ...and now those things that may be slightly different between processor
47 * architectures. -- Dan 49 * architectures. -- Dan
48 */ 50 */
diff --git a/arch/ppc/mm/pgtable.c b/arch/ppc/mm/pgtable.c
index 5d2f3f66aefa..81a3d7446d37 100644
--- a/arch/ppc/mm/pgtable.c
+++ b/arch/ppc/mm/pgtable.c
@@ -66,7 +66,6 @@ void setbat(int index, unsigned long virt, unsigned long phys,
66 66
67#ifdef HAVE_TLBCAM 67#ifdef HAVE_TLBCAM
68extern unsigned int tlbcam_index; 68extern unsigned int tlbcam_index;
69extern unsigned int num_tlbcam_entries;
70extern unsigned long v_mapped_by_tlbcam(unsigned long va); 69extern unsigned long v_mapped_by_tlbcam(unsigned long va);
71extern unsigned long p_mapped_by_tlbcam(unsigned long pa); 70extern unsigned long p_mapped_by_tlbcam(unsigned long pa);
72#else /* !HAVE_TLBCAM */ 71#else /* !HAVE_TLBCAM */
diff --git a/arch/ppc/platforms/85xx/mpc8540_ads.c b/arch/ppc/platforms/85xx/mpc8540_ads.c
index 583838ab02d8..d1c2c6cb3000 100644
--- a/arch/ppc/platforms/85xx/mpc8540_ads.c
+++ b/arch/ppc/platforms/85xx/mpc8540_ads.c
@@ -88,7 +88,7 @@ mpc8540ads_setup_arch(void)
88#ifdef CONFIG_SERIAL_TEXT_DEBUG 88#ifdef CONFIG_SERIAL_TEXT_DEBUG
89 /* Invalidate the entry we stole earlier the serial ports 89 /* Invalidate the entry we stole earlier the serial ports
90 * should be properly mapped */ 90 * should be properly mapped */
91 invalidate_tlbcam_entry(NUM_TLBCAMS - 1); 91 invalidate_tlbcam_entry(num_tlbcam_entries - 1);
92#endif 92#endif
93 93
94 /* setup the board related information for the enet controllers */ 94 /* setup the board related information for the enet controllers */
@@ -150,7 +150,7 @@ platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
150 struct uart_port p; 150 struct uart_port p;
151 151
152 /* Use the last TLB entry to map CCSRBAR to allow access to DUART regs */ 152 /* Use the last TLB entry to map CCSRBAR to allow access to DUART regs */
153 settlbcam(NUM_TLBCAMS - 1, binfo->bi_immr_base, 153 settlbcam(num_tlbcam_entries - 1, binfo->bi_immr_base,
154 binfo->bi_immr_base, MPC85xx_CCSRBAR_SIZE, _PAGE_IO, 0); 154 binfo->bi_immr_base, MPC85xx_CCSRBAR_SIZE, _PAGE_IO, 0);
155 155
156 memset(&p, 0, sizeof (p)); 156 memset(&p, 0, sizeof (p));
diff --git a/arch/ppc/platforms/85xx/mpc85xx_cds_common.c b/arch/ppc/platforms/85xx/mpc85xx_cds_common.c
index bee6633f4601..51964b3081eb 100644
--- a/arch/ppc/platforms/85xx/mpc85xx_cds_common.c
+++ b/arch/ppc/platforms/85xx/mpc85xx_cds_common.c
@@ -446,7 +446,7 @@ mpc85xx_cds_setup_arch(void)
446#ifdef CONFIG_SERIAL_TEXT_DEBUG 446#ifdef CONFIG_SERIAL_TEXT_DEBUG
447 /* Invalidate the entry we stole earlier the serial ports 447 /* Invalidate the entry we stole earlier the serial ports
448 * should be properly mapped */ 448 * should be properly mapped */
449 invalidate_tlbcam_entry(NUM_TLBCAMS - 1); 449 invalidate_tlbcam_entry(num_tlbcam_entries - 1);
450#endif 450#endif
451 451
452 /* setup the board related information for the enet controllers */ 452 /* setup the board related information for the enet controllers */
@@ -528,7 +528,7 @@ platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
528 struct uart_port p; 528 struct uart_port p;
529 529
530 /* Use the last TLB entry to map CCSRBAR to allow access to DUART regs */ 530 /* Use the last TLB entry to map CCSRBAR to allow access to DUART regs */
531 settlbcam(NUM_TLBCAMS - 1, binfo->bi_immr_base, 531 settlbcam(num_tlbcam_entries - 1, binfo->bi_immr_base,
532 binfo->bi_immr_base, MPC85xx_CCSRBAR_SIZE, _PAGE_IO, 0); 532 binfo->bi_immr_base, MPC85xx_CCSRBAR_SIZE, _PAGE_IO, 0);
533 533
534 memset(&p, 0, sizeof (p)); 534 memset(&p, 0, sizeof (p));
diff --git a/arch/ppc/platforms/85xx/sbc8560.c b/arch/ppc/platforms/85xx/sbc8560.c
index 7b9e1543e175..42e960a0bf33 100644
--- a/arch/ppc/platforms/85xx/sbc8560.c
+++ b/arch/ppc/platforms/85xx/sbc8560.c
@@ -125,7 +125,7 @@ sbc8560_setup_arch(void)
125#ifdef CONFIG_SERIAL_TEXT_DEBUG 125#ifdef CONFIG_SERIAL_TEXT_DEBUG
126 /* Invalidate the entry we stole earlier the serial ports 126 /* Invalidate the entry we stole earlier the serial ports
127 * should be properly mapped */ 127 * should be properly mapped */
128 invalidate_tlbcam_entry(NUM_TLBCAMS - 1); 128 invalidate_tlbcam_entry(num_tlbcam_entries - 1);
129#endif 129#endif
130 130
131 /* setup the board related information for the enet controllers */ 131 /* setup the board related information for the enet controllers */
@@ -176,7 +176,7 @@ platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
176 176
177#ifdef CONFIG_SERIAL_TEXT_DEBUG 177#ifdef CONFIG_SERIAL_TEXT_DEBUG
178 /* Use the last TLB entry to map CCSRBAR to allow access to DUART regs */ 178 /* Use the last TLB entry to map CCSRBAR to allow access to DUART regs */
179 settlbcam(NUM_TLBCAMS - 1, UARTA_ADDR, 179 settlbcam(num_tlbcam_entries - 1, UARTA_ADDR,
180 UARTA_ADDR, 0x1000, _PAGE_IO, 0); 180 UARTA_ADDR, 0x1000, _PAGE_IO, 0);
181#endif 181#endif
182 182