X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=board%2Ffreescale%2Fp1022ds%2Fspl.c;h=39e1bee6f361cca5854b897b608ac78e084390dd;hb=04909251fdecac9d05e527b83e86e043e8df00ea;hp=7e89de2b11645ecf0c717ee4428bc93f9bde9748;hpb=382ce7e909c09ba28da5763e717efac7a2c4d156;p=platform%2Fkernel%2Fu-boot.git diff --git a/board/freescale/p1022ds/spl.c b/board/freescale/p1022ds/spl.c index 7e89de2..39e1bee 100644 --- a/board/freescale/p1022ds/spl.c +++ b/board/freescale/p1022ds/spl.c @@ -1,25 +1,14 @@ +// SPDX-License-Identifier: GPL-2.0+ /* * Copyright 2013 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 - * */ #include +#include +#include +#include +#include +#include #include #include #include @@ -28,6 +17,7 @@ #include "../common/ngpixis.h" #include #include +#include "../common/spl.h" DECLARE_GLOBAL_DATA_PTR; @@ -36,7 +26,7 @@ static const u32 sysclk_tbl[] = { 99999000, 11111000, 12499800, 13333200 }; -ulong get_effective_memsize(void) +phys_size_t get_effective_memsize(void) { return CONFIG_SYS_L2_SIZE; } @@ -96,25 +86,46 @@ void board_init_r(gd_t *gd, ulong dest_addr) bd->bi_memstart = CONFIG_SYS_INIT_L2_ADDR; bd->bi_memsize = CONFIG_SYS_L2_SIZE; - probecpu(); + arch_cpu_init(); get_clocks(); mem_malloc_init(CONFIG_SPL_RELOC_MALLOC_ADDR, CONFIG_SPL_RELOC_MALLOC_SIZE); + gd->flags |= GD_FLG_FULL_MALLOC_INIT; +#ifndef CONFIG_SPL_NAND_BOOT env_init(); +#endif #ifdef CONFIG_SPL_MMC_BOOT mmc_initialize(bd); #endif /* relocate environment function pointers etc. */ +#ifdef CONFIG_SPL_NAND_BOOT + nand_spl_load_image(CONFIG_ENV_OFFSET, CONFIG_ENV_SIZE, + (uchar *)SPL_ENV_ADDR); + + gd->env_addr = (ulong)(SPL_ENV_ADDR); + gd->env_valid = ENV_VALID; +#else env_relocate(); +#endif - i2c_init(CONFIG_SYS_FSL_I2C_SPEED, CONFIG_SYS_I2C_SLAVE); +#ifdef CONFIG_SYS_I2C + i2c_init_all(); +#else + i2c_init(CONFIG_SYS_I2C_SPEED, CONFIG_SYS_I2C_SLAVE); +#endif - gd->ram_size = initdram(0); + dram_init(); +#ifdef CONFIG_SPL_NAND_BOOT + puts("Tertiary program loader running in sram..."); +#else puts("Second program loader running in sram...\n"); +#endif #ifdef CONFIG_SPL_MMC_BOOT mmc_boot(); #elif defined(CONFIG_SPL_SPI_BOOT) - spi_boot(); + fsl_spi_boot(); +#elif defined(CONFIG_SPL_NAND_BOOT) + nand_boot(); #endif }