summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKumar Gala <galak@kernel.crashing.org>2008-01-08 01:22:21 -0600
committerAndrew Fleming-AFLEMING <afleming@freescale.com>2008-01-09 16:25:04 -0600
commitb009f3eca99bb7b9e6ba6639a8909a138dd5e9fe (patch)
tree4346cd75759fe027b7d6871e54965871efd80f94
parentb964e9368f45372aaf1da0c13fe56f6d81ae8e96 (diff)
85xx: Remove cache config from configs.h
Either use the standard defines in asm/cache.h or grab the information at runtime from the L1CFG SPR. Also, minor cleanup in cache.h to make the code a bit more readable. Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
-rw-r--r--cpu/mpc85xx/start.S9
-rw-r--r--include/asm-ppc/cache.h10
-rw-r--r--include/asm-ppc/processor.h4
-rw-r--r--include/configs/MPC8540ADS.h7
-rw-r--r--include/configs/MPC8540EVAL.h7
-rw-r--r--include/configs/MPC8541CDS.h7
-rw-r--r--include/configs/MPC8544DS.h7
-rw-r--r--include/configs/MPC8548CDS.h7
-rw-r--r--include/configs/MPC8555CDS.h7
-rw-r--r--include/configs/MPC8560ADS.h7
-rw-r--r--include/configs/MPC8568MDS.h7
-rw-r--r--include/configs/MPC8641HPCN.h7
-rw-r--r--include/configs/PM854.h7
-rw-r--r--include/configs/PM856.h7
-rw-r--r--include/configs/SBC8540.h7
-rw-r--r--include/configs/TQM85xx.h7
-rw-r--r--include/configs/sbc8560.h7
-rw-r--r--include/configs/stxgp3.h7
-rw-r--r--include/configs/stxssa.h7
19 files changed, 15 insertions, 120 deletions
diff --git a/cpu/mpc85xx/start.S b/cpu/mpc85xx/start.S
index b769ef8a76a..b489d2ff0ca 100644
--- a/cpu/mpc85xx/start.S
+++ b/cpu/mpc85xx/start.S
@@ -268,7 +268,10 @@ _start_e500:
*/
lis r3,CFG_INIT_RAM_ADDR@h
ori r3,r3,CFG_INIT_RAM_ADDR@l
- li r2,(CFG_DCACHE_SIZE / (2 * CFG_CACHELINE_SIZE))
+ mfspr r2, L1CFG0
+ andi. r2, r2, 0x1ff
+ /* cache size * 1024 / (2 * L1 line size) */
+ slwi r2, r2, (10 - 1 - L1_CACHE_SHIFT)
mtctr r2
li r0,0
1:
@@ -1061,7 +1064,9 @@ unlock_ram_in_cache:
/* invalidate the INIT_RAM section */
lis r3,(CFG_INIT_RAM_ADDR & ~31)@h
ori r3,r3,(CFG_INIT_RAM_ADDR & ~31)@l
- li r4,(CFG_DCACHE_SIZE / (2 * CFG_CACHELINE_SIZE))
+ mfspr r4,L1CFG0
+ andi. r4,r4,0x1ff
+ slwi r4,r4,(10 - 1 - L1_CACHE_SHIFT)
mtctr r4
1: icbi r0,r3
dcbi r0,r3
diff --git a/include/asm-ppc/cache.h b/include/asm-ppc/cache.h
index e29bfc2a7b4..9d9b9717dde 100644
--- a/include/asm-ppc/cache.h
+++ b/include/asm-ppc/cache.h
@@ -8,15 +8,13 @@
#include <asm/processor.h>
/* bytes per L1 cache line */
-#if !(defined(CONFIG_8xx) || defined(CONFIG_IOP480))
-#if defined(CONFIG_PPC64BRIDGE)
+#if defined(CONFIG_8xx) || defined(CONFIG_IOP480)
+#define L1_CACHE_SHIFT 4
+#elif defined(CONFIG_PPC64BRIDGE)
#define L1_CACHE_SHIFT 7
#else
#define L1_CACHE_SHIFT 5
-#endif /* PPC64 */
-#else
-#define L1_CACHE_SHIFT 4
-#endif /* !(8xx || IOP480) */
+#endif
#define L1_CACHE_BYTES (1 << L1_CACHE_SHIFT)
diff --git a/include/asm-ppc/processor.h b/include/asm-ppc/processor.h
index 9fbbdf8c56a..86c5df2dbaa 100644
--- a/include/asm-ppc/processor.h
+++ b/include/asm-ppc/processor.h
@@ -424,6 +424,8 @@
#define SPRN_IVOR15 0x19f /* Interrupt Vector Offset Register 15 */
/* e500 definitions */
+#define SPRN_L1CFG0 0x203 /* L1 Cache Configuration Register 0 */
+#define SPRN_L1CFG1 0x204 /* L1 Cache Configuration Register 1 */
#define SPRN_L1CSR0 0x3f2 /* L1 Data Cache Control and Status Register 0 */
#define L1CSR0_CPE 0x00010000 /* Data Cache Parity Enable */
#define L1CSR0_DCFI 0x00000002 /* Data Cache Flash Invalidate */
@@ -621,6 +623,8 @@
#define MCSRR1 SPRN_MCSRR1
#define L1CSR0 SPRN_L1CSR0
#define L1CSR1 SPRN_L1CSR1
+#define L1CFG0 SPRN_L1CFG0
+#define L1CFG1 SPRN_L1CFG1
#define MCSR SPRN_MCSR
#define MMUCSR0 SPRN_MMUCSR0
#define BUCSR SPRN_BUCSR
diff --git a/include/configs/MPC8540ADS.h b/include/configs/MPC8540ADS.h
index 35e1d630666..afce7fb78fe 100644
--- a/include/configs/MPC8540ADS.h
+++ b/include/configs/MPC8540ADS.h
@@ -460,13 +460,6 @@
*/
#define CFG_BOOTMAPSZ (8 << 20) /* Initial Memory map for Linux*/
-/* Cache Configuration */
-#define CFG_DCACHE_SIZE 32768
-#define CFG_CACHELINE_SIZE 32
-#if defined(CONFIG_CMD_KGDB)
-#define CFG_CACHELINE_SHIFT 5 /*log base 2 of the above value*/
-#endif
-
/*
* Internal Definitions
*
diff --git a/include/configs/MPC8540EVAL.h b/include/configs/MPC8540EVAL.h
index e376c11656b..2868dcb8ad6 100644
--- a/include/configs/MPC8540EVAL.h
+++ b/include/configs/MPC8540EVAL.h
@@ -319,13 +319,6 @@
*/
#define CFG_BOOTMAPSZ (8 << 20) /* Initial Memory map for Linux */
-/* Cache Configuration */
-#define CFG_DCACHE_SIZE 32768
-#define CFG_CACHELINE_SIZE 32
-#if defined(CONFIG_CMD_KGDB)
-#define CFG_CACHELINE_SHIFT 5 /* log base 2 of the above value */
-#endif
-
/*
* Internal Definitions
*
diff --git a/include/configs/MPC8541CDS.h b/include/configs/MPC8541CDS.h
index d2e7237895e..c83382f0df6 100644
--- a/include/configs/MPC8541CDS.h
+++ b/include/configs/MPC8541CDS.h
@@ -450,13 +450,6 @@ extern unsigned long get_clock_freq(void);
*/
#define CFG_BOOTMAPSZ (8 << 20) /* Initial Memory map for Linux*/
-/* Cache Configuration */
-#define CFG_DCACHE_SIZE 32768
-#define CFG_CACHELINE_SIZE 32
-#if defined(CONFIG_CMD_KGDB)
-#define CFG_CACHELINE_SHIFT 5 /*log base 2 of the above value*/
-#endif
-
/*
* Internal Definitions
*
diff --git a/include/configs/MPC8544DS.h b/include/configs/MPC8544DS.h
index 545a76cc621..5a96db5ab25 100644
--- a/include/configs/MPC8544DS.h
+++ b/include/configs/MPC8544DS.h
@@ -444,13 +444,6 @@ extern unsigned long get_board_sys_clk(unsigned long dummy);
*/
#define CFG_BOOTMAPSZ (8 << 20) /* Initial Memory map for Linux*/
-/* Cache Configuration */
-#define CFG_DCACHE_SIZE 32768
-#define CFG_CACHELINE_SIZE 32
-#if defined(CONFIG_CMD_KGDB)
-#define CFG_CACHELINE_SHIFT 5 /*log base 2 of the above value*/
-#endif
-
/*
* Internal Definitions
*
diff --git a/include/configs/MPC8548CDS.h b/include/configs/MPC8548CDS.h
index 3f382e59a6b..90beb252138 100644
--- a/include/configs/MPC8548CDS.h
+++ b/include/configs/MPC8548CDS.h
@@ -512,13 +512,6 @@ extern unsigned long get_clock_freq(void);
*/
#define CFG_BOOTMAPSZ (8 << 20) /* Initial Memory map for Linux*/
-/* Cache Configuration */
-#define CFG_DCACHE_SIZE 32768
-#define CFG_CACHELINE_SIZE 32
-#if defined(CONFIG_CMD_KGDB)
-#define CFG_CACHELINE_SHIFT 5 /*log base 2 of the above value*/
-#endif
-
/*
* Internal Definitions
*
diff --git a/include/configs/MPC8555CDS.h b/include/configs/MPC8555CDS.h
index 90ef3d6b673..76d673cd0d6 100644
--- a/include/configs/MPC8555CDS.h
+++ b/include/configs/MPC8555CDS.h
@@ -450,13 +450,6 @@ extern unsigned long get_clock_freq(void);
*/
#define CFG_BOOTMAPSZ (8 << 20) /* Initial Memory map for Linux*/
-/* Cache Configuration */
-#define CFG_DCACHE_SIZE 32768
-#define CFG_CACHELINE_SIZE 32
-#if defined(CONFIG_CMD_KGDB)
-#define CFG_CACHELINE_SHIFT 5 /*log base 2 of the above value*/
-#endif
-
/*
* Internal Definitions
*
diff --git a/include/configs/MPC8560ADS.h b/include/configs/MPC8560ADS.h
index d4e0de0d32b..5f105552f40 100644
--- a/include/configs/MPC8560ADS.h
+++ b/include/configs/MPC8560ADS.h
@@ -490,13 +490,6 @@
*/
#define CFG_BOOTMAPSZ (8 << 20) /* Initial Memory map for Linux*/
-/* Cache Configuration */
-#define CFG_DCACHE_SIZE 32768
-#define CFG_CACHELINE_SIZE 32
-#if defined(CONFIG_CMD_KGDB)
-#define CFG_CACHELINE_SHIFT 5 /*log base 2 of the above value*/
-#endif
-
/*
* Internal Definitions
*
diff --git a/include/configs/MPC8568MDS.h b/include/configs/MPC8568MDS.h
index 59f490e8566..2b089d90d68 100644
--- a/include/configs/MPC8568MDS.h
+++ b/include/configs/MPC8568MDS.h
@@ -480,13 +480,6 @@ extern unsigned long get_clock_freq(void);
*/
#define CFG_BOOTMAPSZ (8 << 20) /* Initial Memory map for Linux*/
-/* Cache Configuration */
-#define CFG_DCACHE_SIZE 32768
-#define CFG_CACHELINE_SIZE 32
-#if defined(CONFIG_CMD_KGDB)
-#define CFG_CACHELINE_SHIFT 5 /*log base 2 of the above value*/
-#endif
-
/*
* Internal Definitions
*
diff --git a/include/configs/MPC8641HPCN.h b/include/configs/MPC8641HPCN.h
index 575bbae431f..7f485c68f6c 100644
--- a/include/configs/MPC8641HPCN.h
+++ b/include/configs/MPC8641HPCN.h
@@ -573,13 +573,6 @@ extern unsigned long get_board_sys_clk(unsigned long dummy);
*/
#define CFG_BOOTMAPSZ (8 << 20) /* Initial Memory map for Linux*/
-/* Cache Configuration */
-#define CFG_DCACHE_SIZE 32768
-#define CFG_CACHELINE_SIZE 32
-#if defined(CONFIG_CMD_KGDB)
- #define CFG_CACHELINE_SHIFT 5 /*log base 2 of the above value*/
-#endif
-
/*
* Internal Definitions
*
diff --git a/include/configs/PM854.h b/include/configs/PM854.h
index a6a1e738a80..f0d0399a9d0 100644
--- a/include/configs/PM854.h
+++ b/include/configs/PM854.h
@@ -366,13 +366,6 @@
*/
#define CFG_BOOTMAPSZ (8 << 20) /* Initial Memory map for Linux*/
-/* Cache Configuration */
-#define CFG_DCACHE_SIZE 32768
-#define CFG_CACHELINE_SIZE 32
-#if defined(CONFIG_CMD_KGDB)
-#define CFG_CACHELINE_SHIFT 5 /*log base 2 of the above value*/
-#endif
-
/*
* Internal Definitions
*
diff --git a/include/configs/PM856.h b/include/configs/PM856.h
index 9a17e3d7333..ae2645c079c 100644
--- a/include/configs/PM856.h
+++ b/include/configs/PM856.h
@@ -365,13 +365,6 @@
*/
#define CFG_BOOTMAPSZ (8 << 20) /* Initial Memory map for Linux*/
-/* Cache Configuration */
-#define CFG_DCACHE_SIZE 32768
-#define CFG_CACHELINE_SIZE 32
-#if defined(CONFIG_CMD_KGDB)
-#define CFG_CACHELINE_SHIFT 5 /*log base 2 of the above value*/
-#endif
-
/*
* Internal Definitions
*
diff --git a/include/configs/SBC8540.h b/include/configs/SBC8540.h
index f2c3699ab74..3ca85b8a9fe 100644
--- a/include/configs/SBC8540.h
+++ b/include/configs/SBC8540.h
@@ -395,13 +395,6 @@
*/
#define CFG_BOOTMAPSZ (8 << 20) /* Initial Memory map for Linux */
-/* Cache Configuration */
-#define CFG_DCACHE_SIZE 32768
-#define CFG_CACHELINE_SIZE 32
-#if defined(CONFIG_CMD_KGDB)
- #define CFG_CACHELINE_SHIFT 5 /* log base 2 of the above value */
-#endif
-
/*
* Internal Definitions
*
diff --git a/include/configs/TQM85xx.h b/include/configs/TQM85xx.h
index 6dbd3924bdd..f3b1a53fe9c 100644
--- a/include/configs/TQM85xx.h
+++ b/include/configs/TQM85xx.h
@@ -417,13 +417,6 @@
*/
#define CFG_BOOTMAPSZ (8 << 20) /* Initial Memory map for Linux */
-/* Cache Configuration */
-#define CFG_DCACHE_SIZE 32768
-#define CFG_CACHELINE_SIZE 32
-#if defined(CONFIG_CMD_KGDB)
-#define CFG_CACHELINE_SHIFT 5 /*log base 2 of the above value */
-#endif
-
/*
* Internal Definitions
*
diff --git a/include/configs/sbc8560.h b/include/configs/sbc8560.h
index defc428819b..b71ba785be8 100644
--- a/include/configs/sbc8560.h
+++ b/include/configs/sbc8560.h
@@ -377,13 +377,6 @@
*/
#define CFG_BOOTMAPSZ (8 << 20) /* Initial Memory map for Linux */
-/* Cache Configuration */
-#define CFG_DCACHE_SIZE 32768
-#define CFG_CACHELINE_SIZE 32
-#if defined(CONFIG_CMD_KGDB)
- #define CFG_CACHELINE_SHIFT 5 /* log base 2 of the above value */
-#endif
-
/*
* Internal Definitions
*
diff --git a/include/configs/stxgp3.h b/include/configs/stxgp3.h
index c5ae0cde361..3baa32c8d6e 100644
--- a/include/configs/stxgp3.h
+++ b/include/configs/stxgp3.h
@@ -357,13 +357,6 @@
*/
#define CFG_BOOTMAPSZ (8 << 20) /* Initial Memory map for Linux */
-/* Cache Configuration */
-#define CFG_DCACHE_SIZE 32768
-#define CFG_CACHELINE_SIZE 32
-#if defined(CONFIG_CMD_KGDB)
-#define CFG_CACHELINE_SHIFT 5 /* log base 2 of the above value */
-#endif
-
/*
* Internal Definitions
*
diff --git a/include/configs/stxssa.h b/include/configs/stxssa.h
index c6e79532096..9457bce0aea 100644
--- a/include/configs/stxssa.h
+++ b/include/configs/stxssa.h
@@ -391,13 +391,6 @@
*/
#define CFG_BOOTMAPSZ (8 << 20) /* Initial Memory map for Linux */
-/* Cache Configuration */
-#define CFG_DCACHE_SIZE 32768
-#define CFG_CACHELINE_SIZE 32
-#if defined(CONFIG_CMD_KGDB)
-#define CFG_CACHELINE_SHIFT 5 /* log base 2 of the above value */
-#endif
-
/*
* Internal Definitions
*