]> Git Repo - u-boot.git/blobdiff - arch/arm/mach-stm32mp/spl.c
common: Drop asm/global_data.h from common header
[u-boot.git] / arch / arm / mach-stm32mp / spl.c
index e84bdad7bfc06ab7329877638271df2f7e04c43a..b53659a698ad8ace64441746658185e51fe94aa6 100644 (file)
@@ -3,6 +3,8 @@
  * Copyright (C) 2018, STMicroelectronics - All Rights Reserved
  */
 
+#define LOG_CATEGORY LOGC_ARCH
+
 #include <common.h>
 #include <cpu_func.h>
 #include <dm.h>
@@ -11,6 +13,7 @@
 #include <log.h>
 #include <spl.h>
 #include <asm/cache.h>
+#include <asm/global_data.h>
 #include <asm/io.h>
 #include <asm/arch/sys_proto.h>
 #include <linux/libfdt.h>
@@ -55,6 +58,7 @@ u32 spl_mmc_boot_mode(const u32 boot_device)
        return MMCSD_MODE_RAW;
 }
 
+#ifdef CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_PARTITION
 int spl_mmc_boot_partition(const u32 boot_device)
 {
        switch (boot_device) {
@@ -66,6 +70,7 @@ int spl_mmc_boot_partition(const u32 boot_device)
                return -EINVAL;
        }
 }
+#endif
 
 #ifdef CONFIG_SPL_DISPLAY_PRINT
 void spl_display_print(void)
@@ -78,7 +83,7 @@ void spl_display_print(void)
         */
        model = fdt_getprop(gd->fdt_blob, 0, "model", NULL);
        if (model)
-               printf("Model: %s\n", model);
+               log_info("Model: %s\n", model);
 }
 #endif
 
@@ -96,25 +101,25 @@ void board_init_f(ulong dummy)
 
        ret = spl_early_init();
        if (ret) {
-               debug("spl_early_init() failed: %d\n", ret);
+               log_debug("spl_early_init() failed: %d\n", ret);
                hang();
        }
 
        ret = uclass_get_device(UCLASS_CLK, 0, &dev);
        if (ret) {
-               debug("Clock init failed: %d\n", ret);
+               log_debug("Clock init failed: %d\n", ret);
                hang();
        }
 
        ret = uclass_get_device(UCLASS_RESET, 0, &dev);
        if (ret) {
-               debug("Reset init failed: %d\n", ret);
+               log_debug("Reset init failed: %d\n", ret);
                hang();
        }
 
        ret = uclass_get_device(UCLASS_PINCTRL, 0, &dev);
        if (ret) {
-               debug("%s: Cannot find pinctrl device\n", __func__);
+               log_debug("%s: Cannot find pinctrl device\n", __func__);
                hang();
        }
 
@@ -123,13 +128,13 @@ void board_init_f(ulong dummy)
 
        ret = board_early_init_f();
        if (ret) {
-               debug("board_early_init_f() failed: %d\n", ret);
+               log_debug("board_early_init_f() failed: %d\n", ret);
                hang();
        }
 
        ret = uclass_get_device(UCLASS_RAM, 0, &dev);
        if (ret) {
-               printf("DRAM init failed: %d\n", ret);
+               log_err("DRAM init failed: %d\n", ret);
                hang();
        }
 
@@ -138,7 +143,8 @@ void board_init_f(ulong dummy)
         * to avoid speculative access and issue in get_ram_size()
         */
        if (!CONFIG_IS_ENABLED(SYS_DCACHE_OFF))
-               mmu_set_region_dcache_behaviour(STM32_DDR_BASE, STM32_DDR_SIZE,
+               mmu_set_region_dcache_behaviour(STM32_DDR_BASE,
+                                               CONFIG_DDR_CACHEABLE_SIZE,
                                                DCACHE_DEFAULT_OPTION);
 }
 
This page took 0.032061 seconds and 4 git commands to generate.