2015-03-21 02:28:12 +00:00
|
|
|
/*
|
|
|
|
* Copyright 2015 Freescale Semiconductor
|
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: GPL-2.0+
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <common.h>
|
|
|
|
#include <fsl_ifc.h>
|
2015-03-24 20:25:02 +00:00
|
|
|
#include <nand.h>
|
|
|
|
#include <spl.h>
|
2015-03-21 02:28:12 +00:00
|
|
|
#include <asm/arch-fsl-lsch3/soc.h>
|
2015-03-21 02:28:13 +00:00
|
|
|
#include <asm/io.h>
|
2015-03-24 20:25:02 +00:00
|
|
|
#include <asm/global_data.h>
|
|
|
|
|
|
|
|
DECLARE_GLOBAL_DATA_PTR;
|
2015-03-21 02:28:13 +00:00
|
|
|
|
|
|
|
static void erratum_a008751(void)
|
|
|
|
{
|
|
|
|
#ifdef CONFIG_SYS_FSL_ERRATUM_A008751
|
|
|
|
u32 __iomem *scfg = (u32 __iomem *)SCFG_BASE;
|
|
|
|
|
|
|
|
writel(0x27672b2a, scfg + SCFG_USB3PRM1CR / 4);
|
|
|
|
#endif
|
|
|
|
}
|
2015-03-21 02:28:12 +00:00
|
|
|
|
2015-03-24 20:25:02 +00:00
|
|
|
static void erratum_rcw_src(void)
|
|
|
|
{
|
|
|
|
#if defined(CONFIG_SPL)
|
|
|
|
u32 __iomem *dcfg_ccsr = (u32 __iomem *)DCFG_BASE;
|
|
|
|
u32 __iomem *dcfg_dcsr = (u32 __iomem *)DCFG_DCSR_BASE;
|
|
|
|
u32 val;
|
|
|
|
|
|
|
|
val = in_le32(dcfg_ccsr + DCFG_PORSR1 / 4);
|
|
|
|
val &= ~DCFG_PORSR1_RCW_SRC;
|
|
|
|
val |= DCFG_PORSR1_RCW_SRC_NOR;
|
|
|
|
out_le32(dcfg_dcsr + DCFG_DCSR_PORCR1 / 4, val);
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
2015-03-21 02:28:12 +00:00
|
|
|
void fsl_lsch3_early_init_f(void)
|
|
|
|
{
|
2015-03-21 02:28:13 +00:00
|
|
|
erratum_a008751();
|
2015-03-24 20:25:02 +00:00
|
|
|
erratum_rcw_src();
|
2015-03-21 02:28:12 +00:00
|
|
|
init_early_memctl_regs(); /* tighten IFC timing */
|
|
|
|
}
|
2015-03-24 20:25:02 +00:00
|
|
|
|
|
|
|
#ifdef CONFIG_SPL_BUILD
|
|
|
|
void board_init_f(ulong dummy)
|
|
|
|
{
|
|
|
|
/* Clear global data */
|
|
|
|
memset((void *)gd, 0, sizeof(gd_t));
|
|
|
|
|
|
|
|
arch_cpu_init();
|
|
|
|
board_early_init_f();
|
|
|
|
timer_init();
|
|
|
|
env_init();
|
|
|
|
gd->baudrate = getenv_ulong("baudrate", 10, CONFIG_BAUDRATE);
|
|
|
|
|
|
|
|
serial_init();
|
|
|
|
console_init_f();
|
|
|
|
dram_init();
|
|
|
|
|
|
|
|
/* Clear the BSS. */
|
|
|
|
memset(__bss_start, 0, __bss_end - __bss_start);
|
|
|
|
|
|
|
|
board_init_r(NULL, 0);
|
|
|
|
}
|
|
|
|
|
|
|
|
u32 spl_boot_device(void)
|
|
|
|
{
|
|
|
|
return BOOT_DEVICE_NAND;
|
|
|
|
}
|
|
|
|
#endif
|