int board_early_init_f(void) { struct ccsr_scfg *scfg = (struct ccsr_scfg *)CONFIG_SYS_FSL_SCFG_ADDR; #ifdef CONFIG_TSEC_ENET /* clear BD & FR bits for BE BD's and frame data */ clrbits_be32(&scfg->etsecdmamcr, SCFG_ETSECDMAMCR_LE_BD_FR); out_be32(&scfg->etsecmcr, SCFG_ETSECCMCR_GE2_CLK125); #endif #ifdef CONFIG_FSL_IFC init_early_memctl_regs(); #endif arch_soc_init(); #if defined(CONFIG_DEEP_SLEEP) if (is_warm_boot()) { timer_init(); dram_init(); } #endif return 0; }
void board_init_f(ulong dummy) { struct ccsr_cci400 *cci = (struct ccsr_cci400 *)CONFIG_SYS_CCI400_ADDR; unsigned int major; #ifdef CONFIG_NAND_BOOT struct ccsr_gur __iomem *gur = (void *)CONFIG_SYS_FSL_GUTS_ADDR; u32 porsr1, pinctl; /* * There is LS1 SoC issue where NOR, FPGA are inaccessible during * NAND boot because IFC signals > IFC_AD7 are not enabled. * This workaround changes RCW source to make all signals enabled. */ porsr1 = in_be32(&gur->porsr1); pinctl = ((porsr1 & ~(DCFG_CCSR_PORSR1_RCW_MASK)) | DCFG_CCSR_PORSR1_RCW_SRC_I2C); out_be32((unsigned int *)(CONFIG_SYS_DCSR_DCFG_ADDR + DCFG_DCSR_PORCR1), pinctl); #endif /* Clear the BSS */ memset(__bss_start, 0, __bss_end - __bss_start); #ifdef CONFIG_FSL_IFC init_early_memctl_regs(); #endif get_clocks(); #if defined(CONFIG_DEEP_SLEEP) if (is_warm_boot()) fsl_dp_disable_console(); #endif preloader_console_init(); #ifdef CONFIG_SPL_I2C_SUPPORT i2c_init_all(); #endif major = get_soc_major_rev(); if (major == SOC_MAJOR_VER_1_0) out_le32(&cci->ctrl_ord, CCI400_CTRLORD_TERM_BARRIER); dram_init(); /* Allow OCRAM access permission as R/W */ #ifdef CONFIG_LAYERSCAPE_NS_ACCESS enable_layerscape_ns_access(); #endif board_init_r(NULL, 0); }
int board_early_init_f(void) { struct ccsr_scfg *scfg = (struct ccsr_scfg *)CONFIG_SYS_FSL_SCFG_ADDR; struct ccsr_cci400 *cci = (struct ccsr_cci400 *)CONFIG_SYS_CCI400_ADDR; unsigned int major; #ifdef CONFIG_TSEC_ENET /* clear BD & FR bits for BE BD's and frame data */ clrbits_be32(&scfg->etsecdmamcr, SCFG_ETSECDMAMCR_LE_BD_FR); out_be32(&scfg->etsecmcr, SCFG_ETSECCMCR_GE2_CLK125); #endif #ifdef CONFIG_FSL_IFC init_early_memctl_regs(); #endif #ifdef CONFIG_FSL_DCU_FB out_be32(&scfg->pixclkcr, SCFG_PIXCLKCR_PXCKEN); #endif #ifdef CONFIG_FSL_QSPI out_be32(&scfg->qspi_cfg, SCFG_QSPI_CLKSEL); #endif /* Configure Little endian for SAI, ASRC and SPDIF */ out_be32(&scfg->endiancr, SCFG_ENDIANCR_LE); /* * Enable snoop requests and DVM message requests for * Slave insterface S4 (A7 core cluster) */ out_le32(&cci->slave[4].snoop_ctrl, CCI400_DVM_MESSAGE_REQ_EN | CCI400_SNOOP_REQ_EN); major = get_soc_major_rev(); if (major == SOC_MAJOR_VER_1_0) { /* * Set CCI-400 Slave interface S1, S2 Shareable Override * Register All transactions are treated as non-shareable */ out_le32(&cci->slave[1].sha_ord, CCI400_SHAORD_NON_SHAREABLE); out_le32(&cci->slave[2].sha_ord, CCI400_SHAORD_NON_SHAREABLE); } #if defined(CONFIG_DEEP_SLEEP) if (is_warm_boot()) { timer_init(); dram_init(); } #endif return 0; }
void board_init_f(ulong dummy) { void (*second_uboot)(void); /* Clear the BSS */ memset(__bss_start, 0, __bss_end - __bss_start); get_clocks(); #if defined(CONFIG_DEEP_SLEEP) if (is_warm_boot()) fsl_dp_disable_console(); #endif preloader_console_init(); dram_init(); /* Allow OCRAM access permission as R/W */ #ifdef CONFIG_LAYERSCAPE_NS_ACCESS enable_layerscape_ns_access(); enable_layerscape_ns_access(); #endif /* * if it is woken up from deep sleep, then jump to second * stage uboot and continue executing without recopying * it from SD since it has already been reserved in memeory * in last boot. */ if (is_warm_boot()) { second_uboot = (void (*)(void))CONFIG_SYS_TEXT_BASE; second_uboot(); } board_init_r(NULL, 0); }
int fsl_dp_resume(void) { u32 start_addr; void (*kernel_resume)(void); struct ccsr_scfg __iomem *scfg = (void *)CONFIG_SYS_FSL_SCFG_ADDR; if (!is_warm_boot()) return 0; dp_resume_prepare(); /* Get the entry address and jump to kernel */ start_addr = in_le32(&scfg->sparecr[3]); debug("Entry address is 0x%08x\n", start_addr); kernel_resume = (void (*)(void))start_addr; secure_ram_addr(_do_nonsec_entry)(kernel_resume, 0, 0, 0); return 0; }
int fsl_dp_resume(void) { u32 start_addr; void (*kernel_resume)(void); struct ccsr_scfg __iomem *scfg = (void *)CONFIG_SYS_MPC85xx_SCFG; if (!is_warm_boot()) return 0; dp_resume_prepare(); /* Get the entry address and jump to kernel */ start_addr = in_be32(&scfg->sparecr[1]); debug("Entry address is 0x%08x\n", start_addr); kernel_resume = (void (*)(void))start_addr; kernel_resume(); return 0; }
void board_init_f(ulong dummy) { /* Clear the BSS */ memset(__bss_start, 0, __bss_end - __bss_start); get_clocks(); #if defined(CONFIG_DEEP_SLEEP) if (is_warm_boot()) fsl_dp_disable_console(); #endif preloader_console_init(); dram_init(); /* Allow OCRAM access permission as R/W */ #ifdef CONFIG_LS102XA_NS_ACCESS enable_devices_ns_access(&ns_dev[4], 1); enable_devices_ns_access(&ns_dev[7], 1); #endif board_init_r(NULL, 0); }
void ddrmc_init(void) { struct ccsr_ddr *ddr = (struct ccsr_ddr *)CONFIG_SYS_FSL_DDR_ADDR; u32 temp_sdram_cfg; out_be32(&ddr->sdram_cfg, DDR_SDRAM_CFG); out_be32(&ddr->cs0_bnds, DDR_CS0_BNDS); out_be32(&ddr->cs0_config, DDR_CS0_CONFIG); out_be32(&ddr->timing_cfg_0, DDR_TIMING_CFG_0); out_be32(&ddr->timing_cfg_1, DDR_TIMING_CFG_1); out_be32(&ddr->timing_cfg_2, DDR_TIMING_CFG_2); out_be32(&ddr->timing_cfg_3, DDR_TIMING_CFG_3); out_be32(&ddr->timing_cfg_4, DDR_TIMING_CFG_4); out_be32(&ddr->timing_cfg_5, DDR_TIMING_CFG_5); #ifdef CONFIG_DEEP_SLEEP if (is_warm_boot()) { out_be32(&ddr->sdram_cfg_2, DDR_SDRAM_CFG_2 & ~SDRAM_CFG2_D_INIT); out_be32(&ddr->init_addr, CONFIG_SYS_SDRAM_BASE); out_be32(&ddr->init_ext_addr, (1 << 31)); /* DRAM VRef will not be trained */ out_be32(&ddr->ddr_cdr2, DDR_DDR_CDR2 & ~DDR_CDR2_VREF_TRAIN_EN); } else #endif { out_be32(&ddr->sdram_cfg_2, DDR_SDRAM_CFG_2); out_be32(&ddr->ddr_cdr2, DDR_DDR_CDR2); } out_be32(&ddr->sdram_mode, DDR_SDRAM_MODE); out_be32(&ddr->sdram_mode_2, DDR_SDRAM_MODE_2); out_be32(&ddr->sdram_interval, DDR_SDRAM_INTERVAL); out_be32(&ddr->ddr_wrlvl_cntl, DDR_DDR_WRLVL_CNTL); out_be32(&ddr->ddr_wrlvl_cntl_2, DDR_DDR_WRLVL_CNTL_2); out_be32(&ddr->ddr_wrlvl_cntl_3, DDR_DDR_WRLVL_CNTL_3); out_be32(&ddr->ddr_cdr1, DDR_DDR_CDR1); out_be32(&ddr->sdram_clk_cntl, DDR_SDRAM_CLK_CNTL); out_be32(&ddr->ddr_zq_cntl, DDR_DDR_ZQ_CNTL); out_be32(&ddr->cs0_config_2, DDR_CS0_CONFIG_2); udelay(1); #ifdef CONFIG_DEEP_SLEEP if (is_warm_boot()) { /* enter self-refresh */ temp_sdram_cfg = in_be32(&ddr->sdram_cfg_2); temp_sdram_cfg |= SDRAM_CFG2_FRC_SR; out_be32(&ddr->sdram_cfg_2, temp_sdram_cfg); temp_sdram_cfg = (DDR_SDRAM_CFG_MEM_EN | SDRAM_CFG_BI); } else #endif temp_sdram_cfg = (DDR_SDRAM_CFG_MEM_EN & ~SDRAM_CFG_BI); out_be32(&ddr->sdram_cfg, DDR_SDRAM_CFG | temp_sdram_cfg); #ifdef CONFIG_DEEP_SLEEP if (is_warm_boot()) { /* exit self-refresh */ temp_sdram_cfg = in_be32(&ddr->sdram_cfg_2); temp_sdram_cfg &= ~SDRAM_CFG2_FRC_SR; out_be32(&ddr->sdram_cfg_2, temp_sdram_cfg); } #endif }