]> git.ipfire.org Git - people/ms/u-boot.git/blobdiff - arch/arm/cpu/armv7/mx6/soc.c
imx: mx6: hdmi: handle overflow condition
[people/ms/u-boot.git] / arch / arm / cpu / armv7 / mx6 / soc.c
index ba21cfe5807eee2d26b350f176e40f3f655f22a1..91a3debe910e327592e128a6d81d493206ec0925 100644 (file)
@@ -8,8 +8,6 @@
  */
 
 #include <common.h>
-#include <asm/armv7.h>
-#include <asm/pl310.h>
 #include <asm/errno.h>
 #include <asm/io.h>
 #include <asm/arch/imx-regs.h>
 #include <asm/arch/sys_proto.h>
 #include <asm/imx-common/boot_mode.h>
 #include <asm/imx-common/dma.h>
+#include <asm/imx-common/hab.h>
 #include <stdbool.h>
 #include <asm/arch/mxc_hdmi.h>
 #include <asm/arch/crm_regs.h>
+#include <dm.h>
+#include <imx_thermal.h>
+#include <mmc.h>
 
 enum ldo_reg {
        LDO_ARM,
@@ -35,6 +37,26 @@ struct scu_regs {
        u32     fpga_rev;
 };
 
+#if defined(CONFIG_IMX_THERMAL)
+static const struct imx_thermal_plat imx6_thermal_plat = {
+       .regs = (void *)ANATOP_BASE_ADDR,
+       .fuse_bank = 1,
+       .fuse_word = 6,
+};
+
+U_BOOT_DEVICE(imx6_thermal) = {
+       .name = "imx_thermal",
+       .platdata = &imx6_thermal_plat,
+};
+#endif
+
+#if defined(CONFIG_SECURE_BOOT)
+struct imx_sec_config_fuse_t const imx_sec_config_fuse = {
+       .bank = 0,
+       .word = 6,
+};
+#endif
+
 u32 get_nr_cpus(void)
 {
        struct scu_regs *scu = (struct scu_regs *)SCU_BASE_ADDR;
@@ -46,11 +68,12 @@ u32 get_cpu_rev(void)
        struct anatop_regs *anatop = (struct anatop_regs *)ANATOP_BASE_ADDR;
        u32 reg = readl(&anatop->digprog_sololite);
        u32 type = ((reg >> 16) & 0xff);
+       u32 major, cfg = 0;
 
        if (type != MXC_CPU_MX6SL) {
                reg = readl(&anatop->digprog);
                struct scu_regs *scu = (struct scu_regs *)SCU_BASE_ADDR;
-               u32 cfg = readl(&scu->config) & 3;
+               cfg = readl(&scu->config) & 3;
                type = ((reg >> 16) & 0xff);
                if (type == MXC_CPU_MX6DL) {
                        if (!cfg)
@@ -63,8 +86,95 @@ u32 get_cpu_rev(void)
                }
 
        }
+       major = ((reg >> 8) & 0xff);
+       if ((major >= 1) &&
+           ((type == MXC_CPU_MX6Q) || (type == MXC_CPU_MX6D))) {
+               major--;
+               type = MXC_CPU_MX6QP;
+               if (cfg == 1)
+                       type = MXC_CPU_MX6DP;
+       }
        reg &= 0xff;            /* mx6 silicon revision */
-       return (type << 12) | (reg + 0x10);
+       return (type << 12) | (reg + (0x10 * (major + 1)));
+}
+
+/*
+ * OCOTP_CFG3[17:16] (see Fusemap Description Table offset 0x440)
+ * defines a 2-bit SPEED_GRADING
+ */
+#define OCOTP_CFG3_SPEED_SHIFT 16
+#define OCOTP_CFG3_SPEED_800MHZ        0
+#define OCOTP_CFG3_SPEED_850MHZ        1
+#define OCOTP_CFG3_SPEED_1GHZ  2
+#define OCOTP_CFG3_SPEED_1P2GHZ        3
+
+u32 get_cpu_speed_grade_hz(void)
+{
+       struct ocotp_regs *ocotp = (struct ocotp_regs *)OCOTP_BASE_ADDR;
+       struct fuse_bank *bank = &ocotp->bank[0];
+       struct fuse_bank0_regs *fuse =
+               (struct fuse_bank0_regs *)bank->fuse_regs;
+       uint32_t val;
+
+       val = readl(&fuse->cfg3);
+       val >>= OCOTP_CFG3_SPEED_SHIFT;
+       val &= 0x3;
+
+       switch (val) {
+       /* Valid for IMX6DQ */
+       case OCOTP_CFG3_SPEED_1P2GHZ:
+               if (is_cpu_type(MXC_CPU_MX6Q) || is_cpu_type(MXC_CPU_MX6D))
+                       return 1200000000;
+       /* Valid for IMX6SX/IMX6SDL/IMX6DQ */
+       case OCOTP_CFG3_SPEED_1GHZ:
+               return 996000000;
+       /* Valid for IMX6DQ */
+       case OCOTP_CFG3_SPEED_850MHZ:
+               if (is_cpu_type(MXC_CPU_MX6Q) || is_cpu_type(MXC_CPU_MX6D))
+                       return 852000000;
+       /* Valid for IMX6SX/IMX6SDL/IMX6DQ */
+       case OCOTP_CFG3_SPEED_800MHZ:
+               return 792000000;
+       }
+       return 0;
+}
+
+/*
+ * OCOTP_MEM0[7:6] (see Fusemap Description Table offset 0x480)
+ * defines a 2-bit Temperature Grade
+ *
+ * return temperature grade and min/max temperature in celcius
+ */
+#define OCOTP_MEM0_TEMP_SHIFT          6
+
+u32 get_cpu_temp_grade(int *minc, int *maxc)
+{
+       struct ocotp_regs *ocotp = (struct ocotp_regs *)OCOTP_BASE_ADDR;
+       struct fuse_bank *bank = &ocotp->bank[1];
+       struct fuse_bank1_regs *fuse =
+               (struct fuse_bank1_regs *)bank->fuse_regs;
+       uint32_t val;
+
+       val = readl(&fuse->mem0);
+       val >>= OCOTP_MEM0_TEMP_SHIFT;
+       val &= 0x3;
+
+       if (minc && maxc) {
+               if (val == TEMP_AUTOMOTIVE) {
+                       *minc = -40;
+                       *maxc = 125;
+               } else if (val == TEMP_INDUSTRIAL) {
+                       *minc = -40;
+                       *maxc = 105;
+               } else if (val == TEMP_EXTCOMMERCIAL) {
+                       *minc = -20;
+                       *maxc = 105;
+               } else {
+                       *minc = 0;
+                       *maxc = 95;
+               }
+       }
+       return val;
 }
 
 #ifdef CONFIG_REVISION_TAG
@@ -82,65 +192,6 @@ u32 __weak get_board_rev(void)
 }
 #endif
 
-void init_aips(void)
-{
-       struct aipstz_regs *aips1, *aips2;
-#ifdef CONFIG_MX6SX
-       struct aipstz_regs *aips3;
-#endif
-
-       aips1 = (struct aipstz_regs *)AIPS1_BASE_ADDR;
-       aips2 = (struct aipstz_regs *)AIPS2_BASE_ADDR;
-#ifdef CONFIG_MX6SX
-       aips3 = (struct aipstz_regs *)AIPS3_BASE_ADDR;
-#endif
-
-       /*
-        * Set all MPROTx to be non-bufferable, trusted for R/W,
-        * not forced to user-mode.
-        */
-       writel(0x77777777, &aips1->mprot0);
-       writel(0x77777777, &aips1->mprot1);
-       writel(0x77777777, &aips2->mprot0);
-       writel(0x77777777, &aips2->mprot1);
-
-       /*
-        * Set all OPACRx to be non-bufferable, not require
-        * supervisor privilege level for access,allow for
-        * write access and untrusted master access.
-        */
-       writel(0x00000000, &aips1->opacr0);
-       writel(0x00000000, &aips1->opacr1);
-       writel(0x00000000, &aips1->opacr2);
-       writel(0x00000000, &aips1->opacr3);
-       writel(0x00000000, &aips1->opacr4);
-       writel(0x00000000, &aips2->opacr0);
-       writel(0x00000000, &aips2->opacr1);
-       writel(0x00000000, &aips2->opacr2);
-       writel(0x00000000, &aips2->opacr3);
-       writel(0x00000000, &aips2->opacr4);
-
-#ifdef CONFIG_MX6SX
-       /*
-        * Set all MPROTx to be non-bufferable, trusted for R/W,
-        * not forced to user-mode.
-        */
-       writel(0x77777777, &aips3->mprot0);
-       writel(0x77777777, &aips3->mprot1);
-
-       /*
-        * Set all OPACRx to be non-bufferable, not require
-        * supervisor privilege level for access,allow for
-        * write access and untrusted master access.
-        */
-       writel(0x00000000, &aips3->opacr0);
-       writel(0x00000000, &aips3->opacr1);
-       writel(0x00000000, &aips3->opacr2);
-       writel(0x00000000, &aips3->opacr3);
-       writel(0x00000000, &aips3->opacr4);
-#endif
-}
-
 static void clear_ldo_ramp(void)
 {
        struct anatop_regs *anatop = (struct anatop_regs *)ANATOP_BASE_ADDR;
@@ -208,16 +259,6 @@ static int set_ldo_voltage(enum ldo_reg ldo, u32 mv)
        return 0;
 }
 
-static void imx_set_wdog_powerdown(bool enable)
-{
-       struct wdog_regs *wdog1 = (struct wdog_regs *)WDOG1_BASE_ADDR;
-       struct wdog_regs *wdog2 = (struct wdog_regs *)WDOG2_BASE_ADDR;
-
-       /* Write to the PDE (Power Down Enable) bit */
-       writew(enable, &wdog1->wmcr);
-       writew(enable, &wdog2->wmcr);
-}
-
 static void set_ahb_rate(u32 val)
 {
        struct mxc_ccm_reg *mxc_ccm = (struct mxc_ccm_reg *)CCM_BASE_ADDR;
@@ -233,11 +274,43 @@ static void set_ahb_rate(u32 val)
 static void clear_mmdc_ch_mask(void)
 {
        struct mxc_ccm_reg *mxc_ccm = (struct mxc_ccm_reg *)CCM_BASE_ADDR;
+       u32 reg;
+       reg = readl(&mxc_ccm->ccdr);
 
        /* Clear MMDC channel mask */
-       writel(0, &mxc_ccm->ccdr);
+       reg &= ~(MXC_CCM_CCDR_MMDC_CH1_HS_MASK | MXC_CCM_CCDR_MMDC_CH0_HS_MASK);
+       writel(reg, &mxc_ccm->ccdr);
 }
 
+static void init_bandgap(void)
+{
+       struct anatop_regs *anatop = (struct anatop_regs *)ANATOP_BASE_ADDR;
+       /*
+        * Ensure the bandgap has stabilized.
+        */
+       while (!(readl(&anatop->ana_misc0) & 0x80))
+               ;
+       /*
+        * For best noise performance of the analog blocks using the
+        * outputs of the bandgap, the reftop_selfbiasoff bit should
+        * be set.
+        */
+       writel(BM_ANADIG_ANA_MISC0_REFTOP_SELBIASOFF, &anatop->ana_misc0_set);
+}
+
+
+#ifdef CONFIG_MX6SL
+static void set_preclk_from_osc(void)
+{
+       struct mxc_ccm_reg *mxc_ccm = (struct mxc_ccm_reg *)CCM_BASE_ADDR;
+       u32 reg;
+
+       reg = readl(&mxc_ccm->cscmr1);
+       reg |= MXC_CCM_CSCMR1_PER_CLK_SEL_MASK;
+       writel(reg, &mxc_ccm->cscmr1);
+}
+#endif
+
 int arch_cpu_init(void)
 {
        init_aips();
@@ -245,6 +318,13 @@ int arch_cpu_init(void)
        /* Need to clear MMDC_CHx_MASK to make warm reset work. */
        clear_mmdc_ch_mask();
 
+       /*
+        * Disable self-bias circuit in the analog bandap.
+        * The self-bias circuit is used by the bandgap during startup.
+        * This bit should be set after the bandgap has initialized.
+        */
+       init_bandgap();
+
        /*
         * When low freq boot is enabled, ROM will not set AHB
         * freq, so we need to ensure AHB freq is 132MHz in such
@@ -253,6 +333,11 @@ int arch_cpu_init(void)
        if (mxc_get_clock(MXC_ARM_CLK) == 396000000)
                set_ahb_rate(132000000);
 
+               /* Set perclk to source from OSC 24MHz */
+#if defined(CONFIG_MX6SL)
+       set_preclk_from_osc();
+#endif
+
        imx_set_wdog_powerdown(false); /* Disable PDE bit of WMCR register */
 
 #ifdef CONFIG_APBH_DMA
@@ -260,25 +345,78 @@ int arch_cpu_init(void)
        mxs_dma_init();
 #endif
 
+       init_src();
+
        return 0;
 }
 
-int board_postclk_init(void)
+#ifdef CONFIG_ENV_IS_IN_MMC
+__weak int board_mmc_get_env_dev(int devno)
 {
-       set_ldo_voltage(LDO_SOC, 1175); /* Set VDDSOC to 1.175V */
+       return CONFIG_SYS_MMC_ENV_DEV;
+}
 
-       return 0;
+static int mmc_get_boot_dev(void)
+{
+       struct src *src_regs = (struct src *)SRC_BASE_ADDR;
+       u32 soc_sbmr = readl(&src_regs->sbmr1);
+       u32 bootsel;
+       int devno;
+
+       /*
+        * Refer to
+        * "i.MX 6Dual/6Quad Applications Processor Reference Manual"
+        * Chapter "8.5.3.1 Expansion Device eFUSE Configuration"
+        * i.MX6SL/SX/UL has same layout.
+        */
+       bootsel = (soc_sbmr & 0x000000FF) >> 6;
+
+       /* No boot from sd/mmc */
+       if (bootsel != 1)
+               return -1;
+
+       /* BOOT_CFG2[3] and BOOT_CFG2[4] */
+       devno = (soc_sbmr & 0x00001800) >> 11;
+
+       return devno;
 }
 
-#ifndef CONFIG_SYS_DCACHE_OFF
-void enable_caches(void)
+int mmc_get_env_dev(void)
 {
-       /* Avoid random hang when download by usb */
-       invalidate_dcache_all();
-       /* Enable D-cache. I-cache is already enabled in start.S */
-       dcache_enable();
+       int devno = mmc_get_boot_dev();
+
+       /* If not boot from sd/mmc, use default value */
+       if (devno < 0)
+               return CONFIG_SYS_MMC_ENV_DEV;
+
+       return board_mmc_get_env_dev(devno);
+}
+
+#ifdef CONFIG_SYS_MMC_ENV_PART
+__weak int board_mmc_get_env_part(int devno)
+{
+       return CONFIG_SYS_MMC_ENV_PART;
+}
+
+uint mmc_get_env_part(struct mmc *mmc)
+{
+       int devno = mmc_get_boot_dev();
+
+       /* If not boot from sd/mmc, use default value */
+       if (devno < 0)
+               return CONFIG_SYS_MMC_ENV_PART;
+
+       return board_mmc_get_env_part(devno);
 }
 #endif
+#endif
+
+int board_postclk_init(void)
+{
+       set_ldo_voltage(LDO_SOC, 1175); /* Set VDDSOC to 1.175V */
+
+       return 0;
+}
 
 #if defined(CONFIG_FEC_MXC)
 void imx_get_mac_from_fuse(int dev_id, unsigned char *mac)
@@ -288,36 +426,38 @@ void imx_get_mac_from_fuse(int dev_id, unsigned char *mac)
        struct fuse_bank4_regs *fuse =
                        (struct fuse_bank4_regs *)bank->fuse_regs;
 
-       u32 value = readl(&fuse->mac_addr_high);
-       mac[0] = (value >> 8);
-       mac[1] = value ;
-
-       value = readl(&fuse->mac_addr_low);
-       mac[2] = value >> 24 ;
-       mac[3] = value >> 16 ;
-       mac[4] = value >> 8 ;
-       mac[5] = value ;
+       if ((is_cpu_type(MXC_CPU_MX6SX) || is_cpu_type(MXC_CPU_MX6UL)) && 
+               dev_id == 1) {
+               u32 value = readl(&fuse->mac_addr2);
+               mac[0] = value >> 24 ;
+               mac[1] = value >> 16 ;
+               mac[2] = value >> 8 ;
+               mac[3] = value ;
+
+               value = readl(&fuse->mac_addr1);
+               mac[4] = value >> 24 ;
+               mac[5] = value >> 16 ;
+               
+       } else {
+               u32 value = readl(&fuse->mac_addr1);
+               mac[0] = (value >> 8);
+               mac[1] = value ;
+
+               value = readl(&fuse->mac_addr0);
+               mac[2] = value >> 24 ;
+               mac[3] = value >> 16 ;
+               mac[4] = value >> 8 ;
+               mac[5] = value ;
+       }
 
 }
 #endif
 
-void boot_mode_apply(unsigned cfg_val)
-{
-       unsigned reg;
-       struct src *psrc = (struct src *)SRC_BASE_ADDR;
-       writel(cfg_val, &psrc->gpr9);
-       reg = readl(&psrc->gpr10);
-       if (cfg_val)
-               reg |= 1 << 28;
-       else
-               reg &= ~(1 << 28);
-       writel(reg, &psrc->gpr10);
-}
 /*
  * cfg_val will be used for
  * Boot_cfg4[7:0]:Boot_cfg3[7:0]:Boot_cfg2[7:0]:Boot_cfg1[7:0]
- * After reset, if GPR10[28] is 1, ROM will copy GPR9[25:0]
- * to SBMR1, which will determine the boot device.
+ * After reset, if GPR10[28] is 1, ROM will use GPR9[25:0]
+ * instead of SBMR1 to determine the boot device.
  */
 const struct boot_mode soc_boot_modes[] = {
        {"normal",      MAKE_CFGVAL(0x00, 0x00, 0x00, 0x00)},
@@ -336,15 +476,22 @@ const struct boot_mode soc_boot_modes[] = {
        {NULL,          0},
 };
 
+void reset_misc(void)
+{
+#ifdef CONFIG_VIDEO_MXS
+       lcdif_power_down();
+#endif
+}
+
 void s_init(void)
 {
        struct anatop_regs *anatop = (struct anatop_regs *)ANATOP_BASE_ADDR;
-       int is_6q = is_cpu_type(MXC_CPU_MX6Q);
+       struct mxc_ccm_reg *ccm = (struct mxc_ccm_reg *)CCM_BASE_ADDR;
        u32 mask480;
        u32 mask528;
+       u32 reg, periph1, periph2;
 
-
-       if (is_cpu_type(MXC_CPU_MX6SX))
+       if (is_cpu_type(MXC_CPU_MX6SX) || is_cpu_type(MXC_CPU_MX6UL))
                return;
 
        /* Due to hardware limitation, on MX6Q we need to gate/ungate all PFDs
@@ -357,15 +504,23 @@ void s_init(void)
                ANATOP_PFD_CLKGATE_MASK(1) |
                ANATOP_PFD_CLKGATE_MASK(2) |
                ANATOP_PFD_CLKGATE_MASK(3);
-       mask528 = ANATOP_PFD_CLKGATE_MASK(0) |
-               ANATOP_PFD_CLKGATE_MASK(1) |
+       mask528 = ANATOP_PFD_CLKGATE_MASK(1) |
                ANATOP_PFD_CLKGATE_MASK(3);
 
-       /*
-        * Don't reset PFD2 on DL/S
-        */
-       if (is_6q)
+       reg = readl(&ccm->cbcmr);
+       periph2 = ((reg & MXC_CCM_CBCMR_PRE_PERIPH2_CLK_SEL_MASK)
+               >> MXC_CCM_CBCMR_PRE_PERIPH2_CLK_SEL_OFFSET);
+       periph1 = ((reg & MXC_CCM_CBCMR_PRE_PERIPH_CLK_SEL_MASK)
+               >> MXC_CCM_CBCMR_PRE_PERIPH_CLK_SEL_OFFSET);
+
+       /* Checking if PLL2 PFD0 or PLL2 PFD2 is using for periph clock */
+       if ((periph2 != 0x2) && (periph1 != 0x2))
+               mask528 |= ANATOP_PFD_CLKGATE_MASK(0);
+
+       if ((periph2 != 0x1) && (periph1 != 0x1) &&
+               (periph2 != 0x3) && (periph1 != 0x3))
                mask528 |= ANATOP_PFD_CLKGATE_MASK(2);
+
        writel(mask480, &anatop->pfd_480_set);
        writel(mask528, &anatop->pfd_528_set);
        writel(mask480, &anatop->pfd_480_clr);
@@ -393,7 +548,8 @@ void imx_setup_hdmi(void)
 {
        struct mxc_ccm_reg *mxc_ccm = (struct mxc_ccm_reg *)CCM_BASE_ADDR;
        struct hdmi_regs *hdmi  = (struct hdmi_regs *)HDMI_ARB_BASE_ADDR;
-       int reg;
+       int reg, count;
+       u8 val;
 
        /* Turn on HDMI PHY clock */
        reg = readl(&mxc_ccm->CCGR2);
@@ -410,64 +566,53 @@ void imx_setup_hdmi(void)
                 |(CHSCCDR_IPU_PRE_CLK_540M_PFD
                 << MXC_CCM_CHSCCDR_IPU1_DI0_PRE_CLK_SEL_OFFSET);
        writel(reg, &mxc_ccm->chsccdr);
-}
-#endif
 
-#ifndef CONFIG_SYS_L2CACHE_OFF
-#define IOMUXC_GPR11_L2CACHE_AS_OCRAM 0x00000002
-void v7_outer_cache_enable(void)
-{
-       struct pl310_regs *const pl310 = (struct pl310_regs *)L2_PL310_BASE;
-       unsigned int val;
-
-#if defined CONFIG_MX6SL
-       struct iomuxc *iomux = (struct iomuxc *)IOMUXC_BASE_ADDR;
-       val = readl(&iomux->gpr[11]);
-       if (val & IOMUXC_GPR11_L2CACHE_AS_OCRAM) {
-               /* L2 cache configured as OCRAM, reset it */
-               val &= ~IOMUXC_GPR11_L2CACHE_AS_OCRAM;
-               writel(val, &iomux->gpr[11]);
+       /* Clear the overflow condition */
+       if (readb(&hdmi->ih_fc_stat2) & HDMI_IH_FC_STAT2_OVERFLOW_MASK) {
+               /* TMDS software reset */
+               writeb((u8)~HDMI_MC_SWRSTZ_TMDSSWRST_REQ, &hdmi->mc_swrstz);
+               val = readb(&hdmi->fc_invidconf);
+               /* Need minimum 3 times to write to clear the register */
+               for (count = 0 ; count < 5 ; count++)
+                       writeb(val, &hdmi->fc_invidconf);
        }
+}
 #endif
 
-       /* Must disable the L2 before changing the latency parameters */
-       clrbits_le32(&pl310->pl310_ctrl, L2X0_CTRL_EN);
-
-       writel(0x132, &pl310->pl310_tag_latency_ctrl);
-       writel(0x132, &pl310->pl310_data_latency_ctrl);
-
-       val = readl(&pl310->pl310_prefetch_ctrl);
+#ifdef CONFIG_IMX_BOOTAUX
+int arch_auxiliary_core_up(u32 core_id, u32 boot_private_data)
+{
+       struct src *src_reg;
+       u32 stack, pc;
 
-       /* Turn on the L2 I/D prefetch */
-       val |= 0x30000000;
+       if (!boot_private_data)
+               return -EINVAL;
 
-       /*
-        * The L2 cache controller(PL310) version on the i.MX6D/Q is r3p1-50rel0
-        * The L2 cache controller(PL310) version on the i.MX6DL/SOLO/SL is r3p2
-        * But according to ARM PL310 errata: 752271
-        * ID: 752271: Double linefill feature can cause data corruption
-        * Fault Status: Present in: r3p0, r3p1, r3p1-50rel0. Fixed in r3p2
-        * Workaround: The only workaround to this erratum is to disable the
-        * double linefill feature. This is the default behavior.
-        */
+       stack = *(u32 *)boot_private_data;
+       pc = *(u32 *)(boot_private_data + 4);
 
-#ifndef CONFIG_MX6Q
-       val |= 0x40800000;
-#endif
-       writel(val, &pl310->pl310_prefetch_ctrl);
+       /* Set the stack and pc to M4 bootROM */
+       writel(stack, M4_BOOTROM_BASE_ADDR);
+       writel(pc, M4_BOOTROM_BASE_ADDR + 4);
 
-       val = readl(&pl310->pl310_power_ctrl);
-       val |= L2X0_DYNAMIC_CLK_GATING_EN;
-       val |= L2X0_STNDBY_MODE_EN;
-       writel(val, &pl310->pl310_power_ctrl);
+       /* Enable M4 */
+       src_reg = (struct src *)SRC_BASE_ADDR;
+       clrsetbits_le32(&src_reg->scr, SRC_SCR_M4C_NON_SCLR_RST_MASK,
+                       SRC_SCR_M4_ENABLE_MASK);
 
-       setbits_le32(&pl310->pl310_ctrl, L2X0_CTRL_EN);
+       return 0;
 }
 
-void v7_outer_cache_disable(void)
+int arch_auxiliary_core_check_up(u32 core_id)
 {
-       struct pl310_regs *const pl310 = (struct pl310_regs *)L2_PL310_BASE;
+       struct src *src_reg = (struct src *)SRC_BASE_ADDR;
+       unsigned val;
+
+       val = readl(&src_reg->scr);
 
-       clrbits_le32(&pl310->pl310_ctrl, L2X0_CTRL_EN);
+       if (val & SRC_SCR_M4C_NON_SCLR_RST_MASK)
+               return 0;  /* assert in reset */
+
+       return 1;
 }
-#endif /* !CONFIG_SYS_L2CACHE_OFF */
+#endif