]> git.ipfire.org Git - people/ms/u-boot.git/commitdiff
rockchip: rk3399: make spl_board_init board-specific
authorPhilipp Tomsich <philipp.tomsich@theobroma-systems.com>
Fri, 29 Sep 2017 17:27:54 +0000 (19:27 +0200)
committerPhilipp Tomsich <philipp.tomsich@theobroma-systems.com>
Sat, 30 Sep 2017 22:33:34 +0000 (00:33 +0200)
The later-stage spl_board_init (as opposed to board_init_f) should set
up board-specific details: these differ between the EVB-RK3399 and the
RK3399-Q7 (Puma).

This moves spl_board_init back into the individual boards and removes
the unneeded functionality from Puma.

Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
arch/arm/mach-rockchip/rk3399-board-spl.c
board/rockchip/evb_rk3399/evb-rk3399.c
board/theobroma-systems/puma_rk3399/puma-rk3399.c

index 1c39d9b04b54a470b2ea3360287262878d41aa74..8e38ef19a3df56ed816418ee1e081b904f9ea903 100644 (file)
@@ -149,33 +149,6 @@ void board_init_f(ulong dummy)
        }
 }
 
-void spl_board_init(void)
-{
-       struct udevice *pinctrl;
-       int ret;
-
-       ret = uclass_get_device(UCLASS_PINCTRL, 0, &pinctrl);
-       if (ret) {
-               debug("%s: Cannot find pinctrl device\n", __func__);
-               goto err;
-       }
-
-       /* Enable debug UART */
-       ret = pinctrl_request_noflags(pinctrl, PERIPH_ID_UART_DBG);
-       if (ret) {
-               debug("%s: Failed to set up console UART\n", __func__);
-               goto err;
-       }
-
-       preloader_console_init();
-       return;
-err:
-       printf("spl_board_init: Error %d\n", ret);
-
-       /* No way to report error here */
-       hang();
-}
-
 #ifdef CONFIG_SPL_LOAD_FIT
 int board_fit_config_name_match(const char *name)
 {
index d50c59db8dde5df228324c5f99b7550657f26e3b..502dec325fc12d66a7e040e8cfd61b5e5b7c4e2d 100644 (file)
@@ -3,13 +3,14 @@
  *
  * SPDX-License-Identifier:     GPL-2.0+
  */
+
 #include <common.h>
 #include <dm.h>
-#include <ram.h>
 #include <dm/pinctrl.h>
 #include <dm/uclass-internal.h>
 #include <asm/arch/periph.h>
 #include <power/regulator.h>
+#include <spl.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -67,3 +68,30 @@ int board_init(void)
 out:
        return 0;
 }
+
+void spl_board_init(void)
+{
+       struct udevice *pinctrl;
+       int ret;
+
+       ret = uclass_get_device(UCLASS_PINCTRL, 0, &pinctrl);
+       if (ret) {
+               debug("%s: Cannot find pinctrl device\n", __func__);
+               goto err;
+       }
+
+       /* Enable debug UART */
+       ret = pinctrl_request_noflags(pinctrl, PERIPH_ID_UART_DBG);
+       if (ret) {
+               debug("%s: Failed to set up console UART\n", __func__);
+               goto err;
+       }
+
+       preloader_console_init();
+       return;
+err:
+       printf("%s: Error %d\n", __func__, ret);
+
+       /* No way to report error here */
+       hang();
+}
index 45d56cd99eb26adb15edfff8572e9ee9998972ce..e55a5c6657e97e6346f89e6a0a5c643b8bbd5cbe 100644 (file)
@@ -3,15 +3,16 @@
  *
  * SPDX-License-Identifier:     GPL-2.0+
  */
+
 #include <common.h>
 #include <dm.h>
 #include <misc.h>
-#include <ram.h>
 #include <dm/pinctrl.h>
 #include <dm/uclass-internal.h>
 #include <asm/setup.h>
 #include <asm/arch/periph.h>
 #include <power/regulator.h>
+#include <spl.h>
 #include <u-boot/sha256.h>
 
 DECLARE_GLOBAL_DATA_PTR;
@@ -59,6 +60,11 @@ out:
        return 0;
 }
 
+void spl_board_init(void)
+{
+       preloader_console_init();
+}
+
 static void setup_macaddr(void)
 {
 #if CONFIG_IS_ENABLED(CMD_NET)
@@ -91,8 +97,6 @@ static void setup_macaddr(void)
        mac_addr[0] |= 0x02;  /* set local assignment bit (IEEE802) */
        eth_env_set_enetaddr("ethaddr", mac_addr);
 #endif
-
-       return;
 }
 
 static void setup_serial(void)
@@ -147,8 +151,6 @@ static void setup_serial(void)
        env_set("cpuid#", cpuid_str);
        env_set("serial#", serialno_str);
 #endif
-
-       return;
 }
 
 int misc_init_r(void)