]> git.sur5r.net Git - u-boot/blobdiff - arch/arm/mach-rockchip/rk3188-board.c
treewide: replace with error() with pr_err()
[u-boot] / arch / arm / mach-rockchip / rk3188-board.c
index c370156e4c04b9315ff745b4c193b3e82f197659..96859a5b4bc7f37ce263aa724ab9dec553625588 100644 (file)
@@ -11,6 +11,7 @@
 #include <syscon.h>
 #include <asm/io.h>
 #include <asm/arch/clock.h>
+#include <asm/arch/grf_rk3188.h>
 #include <asm/arch/periph.h>
 #include <asm/arch/pmu_rk3288.h>
 #include <asm/arch/boot_mode.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
+int board_late_init(void)
+{
+       struct rk3188_grf *grf;
+
+       grf = syscon_get_first_range(ROCKCHIP_SYSCON_GRF);
+       if (IS_ERR(grf)) {
+               pr_err("grf syscon returned %ld\n", PTR_ERR(grf));
+       } else {
+               /* enable noc remap to mimic legacy loaders */
+               rk_clrsetreg(&grf->soc_con0,
+                       NOC_REMAP_MASK << NOC_REMAP_SHIFT,
+                       NOC_REMAP_MASK << NOC_REMAP_SHIFT);
+       }
+
+       return 0;
+}
+
 int board_init(void)
 {
-#if defined(CONFIG_ROCKCHIP_SPL_BACK_TO_BROM)
+#if CONFIG_IS_ENABLED(ROCKCHIP_BACK_TO_BROM)
        struct udevice *pinctrl;
        int ret;
 
@@ -54,28 +72,6 @@ err:
 #endif
 }
 
-int dram_init(void)
-{
-       struct ram_info ram;
-       struct udevice *dev;
-       int ret;
-
-       ret = uclass_get_device(UCLASS_RAM, 0, &dev);
-       if (ret) {
-               debug("DRAM init failed: %d\n", ret);
-               return ret;
-       }
-       ret = ram_get_info(dev, &ram);
-       if (ret) {
-               debug("Cannot get DRAM size: %d\n", ret);
-               return ret;
-       }
-       debug("SDRAM base=%lx, size=%x\n", ram.base, ram.size);
-       gd->ram_size = ram.size;
-
-       return 0;
-}
-
 #ifndef CONFIG_SYS_DCACHE_OFF
 void enable_caches(void)
 {