]> git.ipfire.org Git - people/ms/u-boot.git/blobdiff - board/freescale/p1022ds/spl.c
board_f: Drop return value from initdram()
[people/ms/u-boot.git] / board / freescale / p1022ds / spl.c
index 358b2e330edd19a87453de710e68956ee57a6f2a..1f490dc94378d8ef9ff19ee9ceaa588f713b7925 100644 (file)
@@ -1,25 +1,11 @@
 /*
  * 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
- *
+ * SPDX-License-Identifier:    GPL-2.0+
  */
 
 #include <common.h>
+#include <console.h>
 #include <ns16550.h>
 #include <malloc.h>
 #include <mmc.h>
@@ -28,6 +14,7 @@
 #include "../common/ngpixis.h"
 #include <fsl_esdhc.h>
 #include <spi_flash.h>
+#include "../common/spl.h"
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -36,7 +23,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,10 +83,11 @@ 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
@@ -117,9 +105,13 @@ void board_init_r(gd_t *gd, ulong dest_addr)
        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);
+       initdram();
 #ifdef CONFIG_SPL_NAND_BOOT
        puts("Tertiary program loader running in sram...");
 #else
@@ -129,7 +121,7 @@ void board_init_r(gd_t *gd, ulong dest_addr)
 #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