]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
ARM: l2c: convert Broadcom L2C-310 to new code
authorRussell King <rmk+kernel@arm.linux.org.uk>
Wed, 19 Mar 2014 19:14:13 +0000 (19:14 +0000)
committerRussell King <rmk+kernel@arm.linux.org.uk>
Mon, 14 Apr 2014 10:16:09 +0000 (11:16 +0100)
The Broadcom L2C-310 devices use ARMs L2C-310 R2P3 or later.  These
require no errata workarounds, and so we can directly call the l2c210
functions from their methods.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
arch/arm/mm/cache-l2x0.c

index 751c3d7a22b38ce88eb63dd2acf574972a0ee6df..57680e03da848a1b6f7c3d4d0985d43aae50d7f8 100644 (file)
@@ -1360,16 +1360,16 @@ static void bcm_inv_range(unsigned long start, unsigned long end)
 
        /* normal case, no cross section between start and end */
        if (likely(bcm_addr_is_sys_emi(end) || !bcm_addr_is_sys_emi(start))) {
-               l2x0_inv_range(new_start, new_end);
+               l2c210_inv_range(new_start, new_end);
                return;
        }
 
        /* They cross sections, so it can only be a cross from section
         * 2 to section 3
         */
-       l2x0_inv_range(new_start,
+       l2c210_inv_range(new_start,
                bcm_l2_phys_addr(BCM_VC_EMI_SEC3_START_ADDR-1));
-       l2x0_inv_range(bcm_l2_phys_addr(BCM_VC_EMI_SEC3_START_ADDR),
+       l2c210_inv_range(bcm_l2_phys_addr(BCM_VC_EMI_SEC3_START_ADDR),
                new_end);
 }
 
@@ -1382,26 +1382,21 @@ static void bcm_clean_range(unsigned long start, unsigned long end)
        if (unlikely(end <= start))
                return;
 
-       if ((end - start) >= l2x0_size) {
-               l2x0_clean_all();
-               return;
-       }
-
        new_start = bcm_l2_phys_addr(start);
        new_end = bcm_l2_phys_addr(end);
 
        /* normal case, no cross section between start and end */
        if (likely(bcm_addr_is_sys_emi(end) || !bcm_addr_is_sys_emi(start))) {
-               l2x0_clean_range(new_start, new_end);
+               l2c210_clean_range(new_start, new_end);
                return;
        }
 
        /* They cross sections, so it can only be a cross from section
         * 2 to section 3
         */
-       l2x0_clean_range(new_start,
+       l2c210_clean_range(new_start,
                bcm_l2_phys_addr(BCM_VC_EMI_SEC3_START_ADDR-1));
-       l2x0_clean_range(bcm_l2_phys_addr(BCM_VC_EMI_SEC3_START_ADDR),
+       l2c210_clean_range(bcm_l2_phys_addr(BCM_VC_EMI_SEC3_START_ADDR),
                new_end);
 }
 
@@ -1415,7 +1410,7 @@ static void bcm_flush_range(unsigned long start, unsigned long end)
                return;
 
        if ((end - start) >= l2x0_size) {
-               l2x0_flush_all();
+               outer_cache.flush_all();
                return;
        }
 
@@ -1424,24 +1419,24 @@ static void bcm_flush_range(unsigned long start, unsigned long end)
 
        /* normal case, no cross section between start and end */
        if (likely(bcm_addr_is_sys_emi(end) || !bcm_addr_is_sys_emi(start))) {
-               l2x0_flush_range(new_start, new_end);
+               l2c210_flush_range(new_start, new_end);
                return;
        }
 
        /* They cross sections, so it can only be a cross from section
         * 2 to section 3
         */
-       l2x0_flush_range(new_start,
+       l2c210_flush_range(new_start,
                bcm_l2_phys_addr(BCM_VC_EMI_SEC3_START_ADDR-1));
-       l2x0_flush_range(bcm_l2_phys_addr(BCM_VC_EMI_SEC3_START_ADDR),
+       l2c210_flush_range(bcm_l2_phys_addr(BCM_VC_EMI_SEC3_START_ADDR),
                new_end);
 }
 
+/* Broadcom L2C-310 start from ARMs R3P2 or later, and require no fixups */
 static const struct l2c_init_data of_bcm_l2x0_data __initconst = {
        .num_lock = 8,
        .of_parse = l2c310_of_parse,
        .enable = l2c_enable,
-       .fixup = l2c310_fixup,
        .save  = l2c310_save,
        .outer_cache = {
                .inv_range   = bcm_inv_range,