]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
85xx: Remove cache config from configs.h
authorKumar Gala <galak@kernel.crashing.org>
Tue, 8 Jan 2008 07:22:21 +0000 (01:22 -0600)
committerAndrew Fleming-AFLEMING <afleming@freescale.com>
Wed, 9 Jan 2008 22:25:04 +0000 (16:25 -0600)
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>
19 files changed:
cpu/mpc85xx/start.S
include/asm-ppc/cache.h
include/asm-ppc/processor.h
include/configs/MPC8540ADS.h
include/configs/MPC8540EVAL.h
include/configs/MPC8541CDS.h
include/configs/MPC8544DS.h
include/configs/MPC8548CDS.h
include/configs/MPC8555CDS.h
include/configs/MPC8560ADS.h
include/configs/MPC8568MDS.h
include/configs/MPC8641HPCN.h
include/configs/PM854.h
include/configs/PM856.h
include/configs/SBC8540.h
include/configs/TQM85xx.h
include/configs/sbc8560.h
include/configs/stxgp3.h
include/configs/stxssa.h

index b769ef8a76a4ffa3ee281a6f264c9c7fc449144e..b489d2ff0ca2b33cefbd461995740f8952f096b0 100644 (file)
@@ -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
index e29bfc2a7b41adec84b90ec81c1ea5ec7eebac00..9d9b9717ddedbb1910b0a5ea8d09bef807e4d71c 100644 (file)
@@ -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)
 
index 9fbbdf8c56ad0e9229281ab963cca721a1e58dd4..86c5df2dbaadafcabfe539b9b35cb7f256814a01 100644 (file)
 #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 */
 #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
index 35e1d6306663c4ca58d1d659839e763d180120bd..afce7fb78fe605b3ca5b5de88dc218b575e0dcdb 100644 (file)
  */
 #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
  *
index e376c11656b61878072e21a6a54dd089039553b0..2868dcb8ad6484482d1065ef129a4de102c7cb3a 100644 (file)
  */
 #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
  *
index d2e7237895e29acbd2850e0cc45b7dd91c54ba33..c83382f0df63468eedef2184c6b8fed5ed76dace 100644 (file)
@@ -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
  *
index 545a76cc62154c1050dcd70db70bbcb3b24f936d..5a96db5ab2517193b6adbcf696e0a50d6f32cfb2 100644 (file)
@@ -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
  *
index 3f382e59a6b5053d11778e91b193dd6094d058ab..90beb252138583542f37716bcc7b89981a395c05 100644 (file)
@@ -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
  *
index 90ef3d6b6738e2844f5e065e531e376f2458e438..76d673cd0d65cc1ba2c6867841fcf1ae894f1e60 100644 (file)
@@ -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
  *
index d4e0de0d32b433363fc3e32f104a9adf9494eef7..5f105552f40b87d05137f64fa5f887fbc510dc3f 100644 (file)
  */
 #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
  *
index 59f490e8566d73b8b0b293f91cafa3d517c471c6..2b089d90d6869d03457e8c01116cedc7689ff73e 100644 (file)
@@ -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
  *
index 575bbae431f114ef26403e001556ad8baaface30..7f485c68f6c8e40feb907cffc0d909d7479a6159 100644 (file)
@@ -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
  *
index a6a1e738a806e6074c9aad6601b65e20796b6a05..f0d0399a9d08a6d6b41c64c0233edaf2c24575b2 100644 (file)
  */
 #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
  *
index 9a17e3d7333523cd01ce0d4cb3c0acac8b9024e8..ae2645c079c897e55eb4430bbd7a2c781bc860d2 100644 (file)
  */
 #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
  *
index f2c3699ab744a48fda1f5ea0c87e645fb79c4dfc..3ca85b8a9fe90264efe728f9d62b35be2462a07a 100644 (file)
  */
 #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
  *
index 6dbd3924bdd45c0061b3a0b9011a2ef4b9eadec3..f3b1a53fe9c4342754f2733c39e6065fe39cecc6 100644 (file)
  */
 #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
  *
index defc428819b4a6c98af2b439df6f6bde70c1fdcf..b71ba785be8daf1251542a9ea5a25190dceb5fda 100644 (file)
  */
 #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
  *
index c5ae0cde361480b2ee2cc830732c88db70a88c4e..3baa32c8d6e057c8708612899c7e74fe29870c2e 100644 (file)
  */
 #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
  *
index c6e79532096335fd41ed7e5cd63ac50b063beaa7..9457bce0aea1ae5fc8d50c918003cf6ac7dd9080 100644 (file)
  */
 #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
  *