All of lore.kernel.org
 help / color / mirror / Atom feed
From: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 01/10] rockchip: rk3399: make spl_board_init board-specific
Date: Mon, 11 Sep 2017 13:59:01 +0200	[thread overview]
Message-ID: <1505131150-39480-2-git-send-email-philipp.tomsich@theobroma-systems.com> (raw)
In-Reply-To: <1505131150-39480-1-git-send-email-philipp.tomsich@theobroma-systems.com>

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.

As we are touching these files, we also sort the #include directives
and drop the inclusion of unneeded files.

Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
---

 arch/arm/mach-rockchip/rk3399-board-spl.c         | 27 -------------------
 board/rockchip/evb_rk3399/evb-rk3399.c            | 32 +++++++++++++++++++++--
 board/theobroma-systems/puma_rk3399/puma-rk3399.c | 15 ++++++++---
 3 files changed, 41 insertions(+), 33 deletions(-)

diff --git a/arch/arm/mach-rockchip/rk3399-board-spl.c b/arch/arm/mach-rockchip/rk3399-board-spl.c
index 1c39d9b..8e38ef1 100644
--- a/arch/arm/mach-rockchip/rk3399-board-spl.c
+++ b/arch/arm/mach-rockchip/rk3399-board-spl.c
@@ -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)
 {
diff --git a/board/rockchip/evb_rk3399/evb-rk3399.c b/board/rockchip/evb_rk3399/evb-rk3399.c
index d50c59d..506efff 100644
--- a/board/rockchip/evb_rk3399/evb-rk3399.c
+++ b/board/rockchip/evb_rk3399/evb-rk3399.c
@@ -3,13 +3,14 @@
  *
  * SPDX-License-Identifier:     GPL-2.0+
  */
+
 #include <common.h>
+#include <asm/arch/periph.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("spl_board_init: Error %d\n", ret);
+
+	/* No way to report error here */
+	hang();
+}
diff --git a/board/theobroma-systems/puma_rk3399/puma-rk3399.c b/board/theobroma-systems/puma_rk3399/puma-rk3399.c
index c6f8eed..01b90e3 100644
--- a/board/theobroma-systems/puma_rk3399/puma-rk3399.c
+++ b/board/theobroma-systems/puma_rk3399/puma-rk3399.c
@@ -3,15 +3,16 @@
  *
  * SPDX-License-Identifier:     GPL-2.0+
  */
+
 #include <common.h>
+#include <asm/arch/periph.h>
+#include <asm/setup.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 <misc.h>
 #include <power/regulator.h>
+#include <spl.h>
 #include <u-boot/sha256.h>
 
 DECLARE_GLOBAL_DATA_PTR;
@@ -59,6 +60,12 @@ out:
 	return 0;
 }
 
+void spl_board_init(void)
+{
+	preloader_console_init();
+	return;
+}
+
 static void setup_macaddr(void)
 {
 #if CONFIG_IS_ENABLED(CMD_NET)
-- 
2.1.4

  reply	other threads:[~2017-09-11 11:59 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-11 11:59 [U-Boot] [PATCH 00/10] For the RK3399-Q7, we have a few additional features in the SPL boot Philipp Tomsich
2017-09-11 11:59 ` Philipp Tomsich [this message]
2017-09-13  4:25   ` [U-Boot] [PATCH 01/10] rockchip: rk3399: make spl_board_init board-specific Simon Glass
2017-09-11 11:59 ` [U-Boot] [PATCH 02/10] rockchip: bootrom: add definitions to retrieve BROM boot-source Philipp Tomsich
2017-09-13  4:25   ` Simon Glass
2017-09-11 11:59 ` [U-Boot] [PATCH 03/10] rockchip: spl: add documentation for spl_node_to_boot_device() Philipp Tomsich
2017-09-13  4:25   ` Simon Glass
2017-09-11 11:59 ` [U-Boot] [PATCH 04/10] rockchip: spl: support a 'same-as-spl'-specifier in the spl-boot-order Philipp Tomsich
2017-09-13  4:25   ` Simon Glass
2017-09-13  8:13     ` Dr. Philipp Tomsich
2017-09-11 11:59 ` [U-Boot] [PATCH 05/10] rockchip: spl: rk3399: implement chip-specific board_spl_was_booted_from() Philipp Tomsich
2017-09-13  4:25   ` Simon Glass
2017-09-13  8:10     ` Dr. Philipp Tomsich
2017-09-11 11:59 ` [U-Boot] [PATCH 06/10] rockchip: dts: rk3399-puma: add 'same-as-spl' to the front of the boot-order Philipp Tomsich
2017-09-13  4:26   ` Simon Glass
2017-09-11 11:59 ` [U-Boot] [PATCH 07/10] rockchip: puma-rk3399: update board_init() Philipp Tomsich
2017-09-13  4:26   ` Simon Glass
2017-09-11 11:59 ` [U-Boot] [PATCH 08/10] rockchip: rk3399-puma: add boot-on regulator to override BIOS_DISABLE Philipp Tomsich
2017-09-13  4:26   ` Simon Glass
2017-09-11 11:59 ` [U-Boot] [PATCH 09/10] power: spl: add SPL_DM_REGULATOR_FIXED in Kconfig Philipp Tomsich
2017-09-13  4:26   ` Simon Glass
2017-09-13  8:20     ` Dr. Philipp Tomsich
2017-09-17 17:52       ` Simon Glass
2017-09-11 11:59 ` [U-Boot] [PATCH 10/10] rockchip: defconfig: puma-rk3399: update for DM_REGULATOR support in SPL Philipp Tomsich
2017-09-13  4:26   ` Simon Glass

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1505131150-39480-2-git-send-email-philipp.tomsich@theobroma-systems.com \
    --to=philipp.tomsich@theobroma-systems.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.