]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - arch/arm/cpu/armv7/mx5/lowlevel_init.S
ARM: mx5: Enable L2 cache
[karo-tx-uboot.git] / arch / arm / cpu / armv7 / mx5 / lowlevel_init.S
index 6d9396a97670d87aad34358129b037fbceb40478..97077fd367ce846fdce7d426e1fc6e67b927d056 100644 (file)
@@ -3,20 +3,7 @@
  *
  * (C) Copyright 2009 Freescale Semiconductor, Inc.
  *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
+ * SPDX-License-Identifier:    GPL-2.0+
  */
 
 #include <config.h>
 
        /* reconfigure L2 cache aux control reg */
        ldr r0, =0xC0 |                 /* tag RAM */ \
-                0x4 |                  /* data RAM */ \
-                1 << 24 |              /* disable write allocate delay */ \
-                1 << 23 |              /* disable write allocate combine */ \
-                1 << 22                /* disable write allocate */
+                0x4 |                  /* data RAM */ \
+                1 << 24 |              /* disable write allocate delay */ \
+                1 << 23 |              /* disable write allocate combine */ \
+                1 << 22                /* disable write allocate */
 
 #if defined(CONFIG_MX51)
        ldr r3, [r4, #ROM_SI_REV]
 #endif
 
        mcr 15, 1, r0, c9, c0, 2
+
+       /* enable L2 cache */
+       mrc 15, 0, r0, c1, c0, 1
+       orr r0, r0, #2
+       mcr 15, 0, r0, c1, c0, 1
+
 .endm /* init_l2cc */
 
 /* AIPS setup - Only setup MPROTx registers.
@@ -303,28 +296,24 @@ setup_pll_func:
 
        setup_pll PLL1_BASE_ADDR, 800
 
-        setup_pll PLL3_BASE_ADDR, 400
+       setup_pll PLL3_BASE_ADDR, 400
 
-        /* Switch peripheral to PLL3 */
-        ldr r0, =CCM_BASE_ADDR
-        ldr r1, =0x00015154
-        str r1, [r0, #CLKCTL_CBCMR]
-        ldr r1, =0x02888945
-        orr r1, r1, #(1 << 16)
-        str r1, [r0, #CLKCTL_CBCDR]
-        /* make sure change is effective */
+       /* Switch peripheral to PLL3 */
+       ldr r0, =CCM_BASE_ADDR
+       ldr r1, =0x00015154
+       str r1, [r0, #CLKCTL_CBCMR]
+       ldr r1, =0x02898945
+       str r1, [r0, #CLKCTL_CBCDR]
+       /* make sure change is effective */
 1:      ldr r1, [r0, #CLKCTL_CDHIPR]
-        cmp r1, #0x0
-        bne 1b
+       cmp r1, #0x0
+       bne 1b
 
-        setup_pll PLL2_BASE_ADDR, 400
+       setup_pll PLL2_BASE_ADDR, 400
 
        /* Switch peripheral to PLL2 */
        ldr r0, =CCM_BASE_ADDR
-       ldr r1, =0x00808145
-       orr r1, r1, #(2 << 10)
-       orr r1, r1, #(0 << 16)
-       orr r1, r1, #(1 << 19)
+       ldr r1, =0x00888945
        str r1, [r0, #CLKCTL_CBCDR]
 
        ldr r1, =0x00016154
@@ -341,7 +330,7 @@ setup_pll_func:
        cmp r1, #0x0
        bne 1b
 
-        setup_pll PLL3_BASE_ADDR, 216
+       setup_pll PLL3_BASE_ADDR, 216
 
        setup_pll PLL4_BASE_ADDR, 455
 
@@ -375,13 +364,13 @@ setup_pll_func:
        str r1, [r0, #CLKCTL_CCGR6]
        str r1, [r0, #CLKCTL_CCGR7]
 
-        mov r1, #0x00000
-        str r1, [r0, #CLKCTL_CCDR]
+       mov r1, #0x00000
+       str r1, [r0, #CLKCTL_CCDR]
 
-        /* for cko - for ARM div by 8 */
-        mov r1, #0x000A0000
-        add r1, r1, #0x00000F0
-        str r1, [r0, #CLKCTL_CCOSR]
+       /* for cko - for ARM div by 8 */
+       mov r1, #0x000A0000
+       add r1, r1, #0x00000F0
+       str r1, [r0, #CLKCTL_CCOSR]
 
 #endif /* CONFIG_MX53 */
 .endm