* [U-Boot] [PATCH v2 1/8] board: rk3399: Drop explicit uart enablement in spl_board_init
2019-06-20 18:54 [U-Boot] [PATCH v2 0/8] rockchip: rk3399: Use spl_board_init in SPL, TPL Jagan Teki
@ 2019-06-20 18:54 ` Jagan Teki
2019-06-22 13:45 ` Kever Yang
2019-06-20 18:55 ` [U-Boot] [PATCH v2 2/8] rockchip: rk3399: Support common spl_board_init Jagan Teki
` (6 subsequent siblings)
7 siblings, 1 reply; 18+ messages in thread
From: Jagan Teki @ 2019-06-20 18:54 UTC (permalink / raw)
To: u-boot
preloader_console_init is used for printing SPL boot banner that
usually called from spl_board_init.
The current spl_board_init in evb and rock960 is enabling explicit
pinctrl, debug uart prior to calling preloader_console_init which
eventually not required since board_init_f is already enabled
debug uart.
So, drop those explicit enablement calls from spl_board_init of
evb, rock960.
Tested this by enabling CONFIG_SPL_BOARD_INIT and adding
u-boot,dm-pre-reloc property for uart node.
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
---
board/rockchip/evb_rk3399/evb-rk3399.c | 23 +------------------
board/vamrs/rock960_rk3399/rock960-rk3399.c | 25 +--------------------
2 files changed, 2 insertions(+), 46 deletions(-)
diff --git a/board/rockchip/evb_rk3399/evb-rk3399.c b/board/rockchip/evb_rk3399/evb-rk3399.c
index bf2ad98c47..769b5d146f 100644
--- a/board/rockchip/evb_rk3399/evb-rk3399.c
+++ b/board/rockchip/evb_rk3399/evb-rk3399.c
@@ -6,7 +6,6 @@
#include <common.h>
#include <dm.h>
#include <dm/pinctrl.h>
-#include <dm/uclass-internal.h>
#include <asm/arch-rockchip/periph.h>
#include <power/regulator.h>
#include <spl.h>
@@ -68,27 +67,7 @@ out:
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();
+ return;
}
diff --git a/board/vamrs/rock960_rk3399/rock960-rk3399.c b/board/vamrs/rock960_rk3399/rock960-rk3399.c
index 0f5ef3a09a..018e4b55b8 100644
--- a/board/vamrs/rock960_rk3399/rock960-rk3399.c
+++ b/board/vamrs/rock960_rk3399/rock960-rk3399.c
@@ -5,9 +5,6 @@
#include <common.h>
#include <dm.h>
-#include <dm/pinctrl.h>
-#include <dm/uclass-internal.h>
-#include <asm/arch-rockchip/periph.h>
#include <power/regulator.h>
#include <spl.h>
@@ -24,27 +21,7 @@ int board_init(void)
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();
+ return;
}
--
2.18.0.321.gffc6fa0e3
^ permalink raw reply related [flat|nested] 18+ messages in thread* [U-Boot] [PATCH v2 1/8] board: rk3399: Drop explicit uart enablement in spl_board_init
2019-06-20 18:54 ` [U-Boot] [PATCH v2 1/8] board: rk3399: Drop explicit uart enablement in spl_board_init Jagan Teki
@ 2019-06-22 13:45 ` Kever Yang
0 siblings, 0 replies; 18+ messages in thread
From: Kever Yang @ 2019-06-22 13:45 UTC (permalink / raw)
To: u-boot
Hi Jagan,
On 06/21/2019 02:54 AM, Jagan Teki wrote:
> preloader_console_init is used for printing SPL boot banner that
> usually called from spl_board_init.
>
> The current spl_board_init in evb and rock960 is enabling explicit
> pinctrl, debug uart prior to calling preloader_console_init which
> eventually not required since board_init_f is already enabled
> debug uart.
>
> So, drop those explicit enablement calls from spl_board_init of
> evb, rock960.
>
> Tested this by enabling CONFIG_SPL_BOARD_INIT and adding
> u-boot,dm-pre-reloc property for uart node.
>
> Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
Thanks,
- Kever
> ---
> board/rockchip/evb_rk3399/evb-rk3399.c | 23 +------------------
> board/vamrs/rock960_rk3399/rock960-rk3399.c | 25 +--------------------
> 2 files changed, 2 insertions(+), 46 deletions(-)
>
> diff --git a/board/rockchip/evb_rk3399/evb-rk3399.c b/board/rockchip/evb_rk3399/evb-rk3399.c
> index bf2ad98c47..769b5d146f 100644
> --- a/board/rockchip/evb_rk3399/evb-rk3399.c
> +++ b/board/rockchip/evb_rk3399/evb-rk3399.c
> @@ -6,7 +6,6 @@
> #include <common.h>
> #include <dm.h>
> #include <dm/pinctrl.h>
> -#include <dm/uclass-internal.h>
> #include <asm/arch-rockchip/periph.h>
> #include <power/regulator.h>
> #include <spl.h>
> @@ -68,27 +67,7 @@ out:
>
> 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();
> + return;
> }
> diff --git a/board/vamrs/rock960_rk3399/rock960-rk3399.c b/board/vamrs/rock960_rk3399/rock960-rk3399.c
> index 0f5ef3a09a..018e4b55b8 100644
> --- a/board/vamrs/rock960_rk3399/rock960-rk3399.c
> +++ b/board/vamrs/rock960_rk3399/rock960-rk3399.c
> @@ -5,9 +5,6 @@
>
> #include <common.h>
> #include <dm.h>
> -#include <dm/pinctrl.h>
> -#include <dm/uclass-internal.h>
> -#include <asm/arch-rockchip/periph.h>
> #include <power/regulator.h>
> #include <spl.h>
>
> @@ -24,27 +21,7 @@ int board_init(void)
>
> 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();
> + return;
> }
^ permalink raw reply [flat|nested] 18+ messages in thread
* [U-Boot] [PATCH v2 2/8] rockchip: rk3399: Support common spl_board_init
2019-06-20 18:54 [U-Boot] [PATCH v2 0/8] rockchip: rk3399: Use spl_board_init in SPL, TPL Jagan Teki
2019-06-20 18:54 ` [U-Boot] [PATCH v2 1/8] board: rk3399: Drop explicit uart enablement in spl_board_init Jagan Teki
@ 2019-06-20 18:55 ` Jagan Teki
2019-06-22 13:47 ` Kever Yang
2019-11-28 4:30 ` Vasily Khoruzhick
2019-06-20 18:55 ` [U-Boot] [PATCH v2 3/8] rockchip: rk3399: spl: Mark printascii into debug Jagan Teki
` (5 subsequent siblings)
7 siblings, 2 replies; 18+ messages in thread
From: Jagan Teki @ 2019-06-20 18:55 UTC (permalink / raw)
To: u-boot
Support common spl_board_init by moving code from puma
board file into, common rk3399-board-spl.c.
Part of the code has sysreset-gpio, regulators_enable_boot_on
but right now only puma board is using this with relevant
config options rest remains common for all targets.
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
---
arch/arm/mach-rockchip/rk3399-board-spl.c | 63 +++++++++++++++++++
board/rockchip/evb_rk3399/evb-rk3399.c | 8 ---
.../puma_rk3399/puma-rk3399.c | 58 -----------------
board/vamrs/rock960_rk3399/rock960-rk3399.c | 8 ---
4 files changed, 63 insertions(+), 74 deletions(-)
diff --git a/arch/arm/mach-rockchip/rk3399-board-spl.c b/arch/arm/mach-rockchip/rk3399-board-spl.c
index 800ca80022..65c98b697d 100644
--- a/arch/arm/mach-rockchip/rk3399-board-spl.c
+++ b/arch/arm/mach-rockchip/rk3399-board-spl.c
@@ -11,13 +11,16 @@
#include <spl.h>
#include <spl_gpio.h>
#include <syscon.h>
+#include <asm/gpio.h>
#include <asm/io.h>
#include <asm/arch-rockchip/bootrom.h>
#include <asm/arch-rockchip/clock.h>
+#include <asm/arch-rockchip/cru_rk3399.h>
#include <asm/arch-rockchip/grf_rk3399.h>
#include <asm/arch-rockchip/hardware.h>
#include <asm/arch-rockchip/periph.h>
#include <asm/arch-rockchip/sys_proto.h>
+#include <power/regulator.h>
#include <dm/pinctrl.h>
void board_return_to_bootrom(void)
@@ -202,6 +205,66 @@ void board_init_f(ulong dummy)
}
}
+#if defined(SPL_GPIO_SUPPORT)
+static void rk3399_force_power_on_reset(void)
+{
+ ofnode node;
+ struct gpio_desc sysreset_gpio;
+
+ debug("%s: trying to force a power-on reset\n", __func__);
+
+ node = ofnode_path("/config");
+ if (!ofnode_valid(node)) {
+ debug("%s: no /config node?\n", __func__);
+ return;
+ }
+
+ if (gpio_request_by_name_nodev(node, "sysreset-gpio", 0,
+ &sysreset_gpio, GPIOD_IS_OUT)) {
+ debug("%s: could not find a /config/sysreset-gpio\n", __func__);
+ return;
+ }
+
+ dm_gpio_set_value(&sysreset_gpio, 1);
+}
+#endif
+
+void spl_board_init(void)
+{
+#if defined(SPL_GPIO_SUPPORT)
+ struct rk3399_cru *cru = rockchip_get_cru();
+
+ /*
+ * The RK3399 resets only 'almost all logic' (see also in the TRM
+ * "3.9.4 Global software reset"), when issuing a software reset.
+ * This may cause issues during boot-up for some configurations of
+ * the application software stack.
+ *
+ * To work around this, we test whether the last reset reason was
+ * a power-on reset and (if not) issue an overtemp-reset to reset
+ * the entire module.
+ *
+ * While this was previously fixed by modifying the various places
+ * that could generate a software reset (e.g. U-Boot's sysreset
+ * driver, the ATF or Linux), we now have it here to ensure that
+ * we no longer have to track this through the various components.
+ */
+ if (cru->glb_rst_st != 0)
+ rk3399_force_power_on_reset();
+#endif
+
+#if defined(SPL_DM_REGULATOR)
+ /*
+ * Turning the eMMC and SPI back on (if disabled via the Qseven
+ * BIOS_ENABLE) signal is done through a always-on regulator).
+ */
+ if (regulators_enable_boot_on(false))
+ debug("%s: Cannot enable boot on regulator\n", __func__);
+#endif
+
+ preloader_console_init();
+}
+
#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 769b5d146f..c600553ff6 100644
--- a/board/rockchip/evb_rk3399/evb-rk3399.c
+++ b/board/rockchip/evb_rk3399/evb-rk3399.c
@@ -8,7 +8,6 @@
#include <dm/pinctrl.h>
#include <asm/arch-rockchip/periph.h>
#include <power/regulator.h>
-#include <spl.h>
int board_init(void)
{
@@ -64,10 +63,3 @@ int board_init(void)
out:
return 0;
}
-
-void spl_board_init(void)
-{
- preloader_console_init();
-
- return;
-}
diff --git a/board/theobroma-systems/puma_rk3399/puma-rk3399.c b/board/theobroma-systems/puma_rk3399/puma-rk3399.c
index c6b509c109..251cd2d566 100644
--- a/board/theobroma-systems/puma_rk3399/puma-rk3399.c
+++ b/board/theobroma-systems/puma_rk3399/puma-rk3399.c
@@ -13,10 +13,8 @@
#include <dm/pinctrl.h>
#include <dm/uclass-internal.h>
#include <asm/io.h>
-#include <asm/gpio.h>
#include <asm/setup.h>
#include <asm/arch-rockchip/clock.h>
-#include <asm/arch-rockchip/cru_rk3399.h>
#include <asm/arch-rockchip/hardware.h>
#include <asm/arch-rockchip/grf_rk3399.h>
#include <asm/arch-rockchip/periph.h>
@@ -38,62 +36,6 @@ int board_init(void)
return 0;
}
-static void rk3399_force_power_on_reset(void)
-{
- ofnode node;
- struct gpio_desc sysreset_gpio;
-
- debug("%s: trying to force a power-on reset\n", __func__);
-
- node = ofnode_path("/config");
- if (!ofnode_valid(node)) {
- debug("%s: no /config node?\n", __func__);
- return;
- }
-
- if (gpio_request_by_name_nodev(node, "sysreset-gpio", 0,
- &sysreset_gpio, GPIOD_IS_OUT)) {
- debug("%s: could not find a /config/sysreset-gpio\n", __func__);
- return;
- }
-
- dm_gpio_set_value(&sysreset_gpio, 1);
-}
-
-void spl_board_init(void)
-{
- int ret;
- struct rk3399_cru *cru = rockchip_get_cru();
-
- /*
- * The RK3399 resets only 'almost all logic' (see also in the TRM
- * "3.9.4 Global software reset"), when issuing a software reset.
- * This may cause issues during boot-up for some configurations of
- * the application software stack.
- *
- * To work around this, we test whether the last reset reason was
- * a power-on reset and (if not) issue an overtemp-reset to reset
- * the entire module.
- *
- * While this was previously fixed by modifying the various places
- * that could generate a software reset (e.g. U-Boot's sysreset
- * driver, the ATF or Linux), we now have it here to ensure that
- * we no longer have to track this through the various components.
- */
- if (cru->glb_rst_st != 0)
- rk3399_force_power_on_reset();
-
- /*
- * Turning the eMMC and SPI back on (if disabled via the Qseven
- * BIOS_ENABLE) signal is done through a always-on regulator).
- */
- ret = regulators_enable_boot_on(false);
- if (ret)
- debug("%s: Cannot enable boot on regulator\n", __func__);
-
- preloader_console_init();
-}
-
static void setup_macaddr(void)
{
#if CONFIG_IS_ENABLED(CMD_NET)
diff --git a/board/vamrs/rock960_rk3399/rock960-rk3399.c b/board/vamrs/rock960_rk3399/rock960-rk3399.c
index 018e4b55b8..2eb7120e84 100644
--- a/board/vamrs/rock960_rk3399/rock960-rk3399.c
+++ b/board/vamrs/rock960_rk3399/rock960-rk3399.c
@@ -6,7 +6,6 @@
#include <common.h>
#include <dm.h>
#include <power/regulator.h>
-#include <spl.h>
int board_init(void)
{
@@ -18,10 +17,3 @@ int board_init(void)
return 0;
}
-
-void spl_board_init(void)
-{
- preloader_console_init();
-
- return;
-}
--
2.18.0.321.gffc6fa0e3
^ permalink raw reply related [flat|nested] 18+ messages in thread* [U-Boot] [PATCH v2 2/8] rockchip: rk3399: Support common spl_board_init
2019-06-20 18:55 ` [U-Boot] [PATCH v2 2/8] rockchip: rk3399: Support common spl_board_init Jagan Teki
@ 2019-06-22 13:47 ` Kever Yang
2019-11-28 4:30 ` Vasily Khoruzhick
1 sibling, 0 replies; 18+ messages in thread
From: Kever Yang @ 2019-06-22 13:47 UTC (permalink / raw)
To: u-boot
Hi Jagan,
On 06/21/2019 02:55 AM, Jagan Teki wrote:
> Support common spl_board_init by moving code from puma
> board file into, common rk3399-board-spl.c.
>
> Part of the code has sysreset-gpio, regulators_enable_boot_on
> but right now only puma board is using this with relevant
> config options rest remains common for all targets.
>
> Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
Thanks,
- Kever
> ---
> arch/arm/mach-rockchip/rk3399-board-spl.c | 63 +++++++++++++++++++
> board/rockchip/evb_rk3399/evb-rk3399.c | 8 ---
> .../puma_rk3399/puma-rk3399.c | 58 -----------------
> board/vamrs/rock960_rk3399/rock960-rk3399.c | 8 ---
> 4 files changed, 63 insertions(+), 74 deletions(-)
>
> diff --git a/arch/arm/mach-rockchip/rk3399-board-spl.c b/arch/arm/mach-rockchip/rk3399-board-spl.c
> index 800ca80022..65c98b697d 100644
> --- a/arch/arm/mach-rockchip/rk3399-board-spl.c
> +++ b/arch/arm/mach-rockchip/rk3399-board-spl.c
> @@ -11,13 +11,16 @@
> #include <spl.h>
> #include <spl_gpio.h>
> #include <syscon.h>
> +#include <asm/gpio.h>
> #include <asm/io.h>
> #include <asm/arch-rockchip/bootrom.h>
> #include <asm/arch-rockchip/clock.h>
> +#include <asm/arch-rockchip/cru_rk3399.h>
> #include <asm/arch-rockchip/grf_rk3399.h>
> #include <asm/arch-rockchip/hardware.h>
> #include <asm/arch-rockchip/periph.h>
> #include <asm/arch-rockchip/sys_proto.h>
> +#include <power/regulator.h>
> #include <dm/pinctrl.h>
>
> void board_return_to_bootrom(void)
> @@ -202,6 +205,66 @@ void board_init_f(ulong dummy)
> }
> }
>
> +#if defined(SPL_GPIO_SUPPORT)
> +static void rk3399_force_power_on_reset(void)
> +{
> + ofnode node;
> + struct gpio_desc sysreset_gpio;
> +
> + debug("%s: trying to force a power-on reset\n", __func__);
> +
> + node = ofnode_path("/config");
> + if (!ofnode_valid(node)) {
> + debug("%s: no /config node?\n", __func__);
> + return;
> + }
> +
> + if (gpio_request_by_name_nodev(node, "sysreset-gpio", 0,
> + &sysreset_gpio, GPIOD_IS_OUT)) {
> + debug("%s: could not find a /config/sysreset-gpio\n", __func__);
> + return;
> + }
> +
> + dm_gpio_set_value(&sysreset_gpio, 1);
> +}
> +#endif
> +
> +void spl_board_init(void)
> +{
> +#if defined(SPL_GPIO_SUPPORT)
> + struct rk3399_cru *cru = rockchip_get_cru();
> +
> + /*
> + * The RK3399 resets only 'almost all logic' (see also in the TRM
> + * "3.9.4 Global software reset"), when issuing a software reset.
> + * This may cause issues during boot-up for some configurations of
> + * the application software stack.
> + *
> + * To work around this, we test whether the last reset reason was
> + * a power-on reset and (if not) issue an overtemp-reset to reset
> + * the entire module.
> + *
> + * While this was previously fixed by modifying the various places
> + * that could generate a software reset (e.g. U-Boot's sysreset
> + * driver, the ATF or Linux), we now have it here to ensure that
> + * we no longer have to track this through the various components.
> + */
> + if (cru->glb_rst_st != 0)
> + rk3399_force_power_on_reset();
> +#endif
> +
> +#if defined(SPL_DM_REGULATOR)
> + /*
> + * Turning the eMMC and SPI back on (if disabled via the Qseven
> + * BIOS_ENABLE) signal is done through a always-on regulator).
> + */
> + if (regulators_enable_boot_on(false))
> + debug("%s: Cannot enable boot on regulator\n", __func__);
> +#endif
> +
> + preloader_console_init();
> +}
> +
> #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 769b5d146f..c600553ff6 100644
> --- a/board/rockchip/evb_rk3399/evb-rk3399.c
> +++ b/board/rockchip/evb_rk3399/evb-rk3399.c
> @@ -8,7 +8,6 @@
> #include <dm/pinctrl.h>
> #include <asm/arch-rockchip/periph.h>
> #include <power/regulator.h>
> -#include <spl.h>
>
> int board_init(void)
> {
> @@ -64,10 +63,3 @@ int board_init(void)
> out:
> return 0;
> }
> -
> -void spl_board_init(void)
> -{
> - preloader_console_init();
> -
> - return;
> -}
> diff --git a/board/theobroma-systems/puma_rk3399/puma-rk3399.c b/board/theobroma-systems/puma_rk3399/puma-rk3399.c
> index c6b509c109..251cd2d566 100644
> --- a/board/theobroma-systems/puma_rk3399/puma-rk3399.c
> +++ b/board/theobroma-systems/puma_rk3399/puma-rk3399.c
> @@ -13,10 +13,8 @@
> #include <dm/pinctrl.h>
> #include <dm/uclass-internal.h>
> #include <asm/io.h>
> -#include <asm/gpio.h>
> #include <asm/setup.h>
> #include <asm/arch-rockchip/clock.h>
> -#include <asm/arch-rockchip/cru_rk3399.h>
> #include <asm/arch-rockchip/hardware.h>
> #include <asm/arch-rockchip/grf_rk3399.h>
> #include <asm/arch-rockchip/periph.h>
> @@ -38,62 +36,6 @@ int board_init(void)
> return 0;
> }
>
> -static void rk3399_force_power_on_reset(void)
> -{
> - ofnode node;
> - struct gpio_desc sysreset_gpio;
> -
> - debug("%s: trying to force a power-on reset\n", __func__);
> -
> - node = ofnode_path("/config");
> - if (!ofnode_valid(node)) {
> - debug("%s: no /config node?\n", __func__);
> - return;
> - }
> -
> - if (gpio_request_by_name_nodev(node, "sysreset-gpio", 0,
> - &sysreset_gpio, GPIOD_IS_OUT)) {
> - debug("%s: could not find a /config/sysreset-gpio\n", __func__);
> - return;
> - }
> -
> - dm_gpio_set_value(&sysreset_gpio, 1);
> -}
> -
> -void spl_board_init(void)
> -{
> - int ret;
> - struct rk3399_cru *cru = rockchip_get_cru();
> -
> - /*
> - * The RK3399 resets only 'almost all logic' (see also in the TRM
> - * "3.9.4 Global software reset"), when issuing a software reset.
> - * This may cause issues during boot-up for some configurations of
> - * the application software stack.
> - *
> - * To work around this, we test whether the last reset reason was
> - * a power-on reset and (if not) issue an overtemp-reset to reset
> - * the entire module.
> - *
> - * While this was previously fixed by modifying the various places
> - * that could generate a software reset (e.g. U-Boot's sysreset
> - * driver, the ATF or Linux), we now have it here to ensure that
> - * we no longer have to track this through the various components.
> - */
> - if (cru->glb_rst_st != 0)
> - rk3399_force_power_on_reset();
> -
> - /*
> - * Turning the eMMC and SPI back on (if disabled via the Qseven
> - * BIOS_ENABLE) signal is done through a always-on regulator).
> - */
> - ret = regulators_enable_boot_on(false);
> - if (ret)
> - debug("%s: Cannot enable boot on regulator\n", __func__);
> -
> - preloader_console_init();
> -}
> -
> static void setup_macaddr(void)
> {
> #if CONFIG_IS_ENABLED(CMD_NET)
> diff --git a/board/vamrs/rock960_rk3399/rock960-rk3399.c b/board/vamrs/rock960_rk3399/rock960-rk3399.c
> index 018e4b55b8..2eb7120e84 100644
> --- a/board/vamrs/rock960_rk3399/rock960-rk3399.c
> +++ b/board/vamrs/rock960_rk3399/rock960-rk3399.c
> @@ -6,7 +6,6 @@
> #include <common.h>
> #include <dm.h>
> #include <power/regulator.h>
> -#include <spl.h>
>
> int board_init(void)
> {
> @@ -18,10 +17,3 @@ int board_init(void)
>
> return 0;
> }
> -
> -void spl_board_init(void)
> -{
> - preloader_console_init();
> -
> - return;
> -}
^ permalink raw reply [flat|nested] 18+ messages in thread* [U-Boot] [PATCH v2 2/8] rockchip: rk3399: Support common spl_board_init
2019-06-20 18:55 ` [U-Boot] [PATCH v2 2/8] rockchip: rk3399: Support common spl_board_init Jagan Teki
2019-06-22 13:47 ` Kever Yang
@ 2019-11-28 4:30 ` Vasily Khoruzhick
1 sibling, 0 replies; 18+ messages in thread
From: Vasily Khoruzhick @ 2019-11-28 4:30 UTC (permalink / raw)
To: u-boot
On Thu, Jun 20, 2019 at 11:57 AM Jagan Teki <jagan@amarulasolutions.com> wrote:
>
> Support common spl_board_init by moving code from puma
> board file into, common rk3399-board-spl.c.
>
> Part of the code has sysreset-gpio, regulators_enable_boot_on
> but right now only puma board is using this with relevant
> config options rest remains common for all targets.
>
> Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
> ---
> arch/arm/mach-rockchip/rk3399-board-spl.c | 63 +++++++++++++++++++
> board/rockchip/evb_rk3399/evb-rk3399.c | 8 ---
> .../puma_rk3399/puma-rk3399.c | 58 -----------------
> board/vamrs/rock960_rk3399/rock960-rk3399.c | 8 ---
> 4 files changed, 63 insertions(+), 74 deletions(-)
>
> diff --git a/arch/arm/mach-rockchip/rk3399-board-spl.c b/arch/arm/mach-rockchip/rk3399-board-spl.c
> index 800ca80022..65c98b697d 100644
> --- a/arch/arm/mach-rockchip/rk3399-board-spl.c
> +++ b/arch/arm/mach-rockchip/rk3399-board-spl.c
> @@ -11,13 +11,16 @@
> #include <spl.h>
> #include <spl_gpio.h>
> #include <syscon.h>
> +#include <asm/gpio.h>
> #include <asm/io.h>
> #include <asm/arch-rockchip/bootrom.h>
> #include <asm/arch-rockchip/clock.h>
> +#include <asm/arch-rockchip/cru_rk3399.h>
> #include <asm/arch-rockchip/grf_rk3399.h>
> #include <asm/arch-rockchip/hardware.h>
> #include <asm/arch-rockchip/periph.h>
> #include <asm/arch-rockchip/sys_proto.h>
> +#include <power/regulator.h>
> #include <dm/pinctrl.h>
>
> void board_return_to_bootrom(void)
> @@ -202,6 +205,66 @@ void board_init_f(ulong dummy)
> }
> }
>
> +#if defined(SPL_GPIO_SUPPORT)
That hasn't been compile tested since "defined(SPL_GPIO_SUPPORT)"
ensures that this code never compiles.
It should be CONFIG_SPL_GPIO_SUPPORT instead, and it won't compile due
to missing header in this case.
Unfortunately code won't work even with missing include added since
something else is broken and it fails to request gpio.
> +static void rk3399_force_power_on_reset(void)
> +{
> + ofnode node;
> + struct gpio_desc sysreset_gpio;
> +
> + debug("%s: trying to force a power-on reset\n", __func__);
> +
> + node = ofnode_path("/config");
> + if (!ofnode_valid(node)) {
> + debug("%s: no /config node?\n", __func__);
> + return;
> + }
> +
> + if (gpio_request_by_name_nodev(node, "sysreset-gpio", 0,
> + &sysreset_gpio, GPIOD_IS_OUT)) {
> + debug("%s: could not find a /config/sysreset-gpio\n", __func__);
> + return;
> + }
> +
> + dm_gpio_set_value(&sysreset_gpio, 1);
> +}
> +#endif
> +
> +void spl_board_init(void)
> +{
> +#if defined(SPL_GPIO_SUPPORT)
> + struct rk3399_cru *cru = rockchip_get_cru();
> +
> + /*
> + * The RK3399 resets only 'almost all logic' (see also in the TRM
> + * "3.9.4 Global software reset"), when issuing a software reset.
> + * This may cause issues during boot-up for some configurations of
> + * the application software stack.
> + *
> + * To work around this, we test whether the last reset reason was
> + * a power-on reset and (if not) issue an overtemp-reset to reset
> + * the entire module.
> + *
> + * While this was previously fixed by modifying the various places
> + * that could generate a software reset (e.g. U-Boot's sysreset
> + * driver, the ATF or Linux), we now have it here to ensure that
> + * we no longer have to track this through the various components.
> + */
> + if (cru->glb_rst_st != 0)
> + rk3399_force_power_on_reset();
> +#endif
> +
> +#if defined(SPL_DM_REGULATOR)
> + /*
> + * Turning the eMMC and SPI back on (if disabled via the Qseven
> + * BIOS_ENABLE) signal is done through a always-on regulator).
> + */
> + if (regulators_enable_boot_on(false))
> + debug("%s: Cannot enable boot on regulator\n", __func__);
> +#endif
> +
> + preloader_console_init();
> +}
> +
> #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 769b5d146f..c600553ff6 100644
> --- a/board/rockchip/evb_rk3399/evb-rk3399.c
> +++ b/board/rockchip/evb_rk3399/evb-rk3399.c
> @@ -8,7 +8,6 @@
> #include <dm/pinctrl.h>
> #include <asm/arch-rockchip/periph.h>
> #include <power/regulator.h>
> -#include <spl.h>
>
> int board_init(void)
> {
> @@ -64,10 +63,3 @@ int board_init(void)
> out:
> return 0;
> }
> -
> -void spl_board_init(void)
> -{
> - preloader_console_init();
> -
> - return;
> -}
> diff --git a/board/theobroma-systems/puma_rk3399/puma-rk3399.c b/board/theobroma-systems/puma_rk3399/puma-rk3399.c
> index c6b509c109..251cd2d566 100644
> --- a/board/theobroma-systems/puma_rk3399/puma-rk3399.c
> +++ b/board/theobroma-systems/puma_rk3399/puma-rk3399.c
> @@ -13,10 +13,8 @@
> #include <dm/pinctrl.h>
> #include <dm/uclass-internal.h>
> #include <asm/io.h>
> -#include <asm/gpio.h>
> #include <asm/setup.h>
> #include <asm/arch-rockchip/clock.h>
> -#include <asm/arch-rockchip/cru_rk3399.h>
> #include <asm/arch-rockchip/hardware.h>
> #include <asm/arch-rockchip/grf_rk3399.h>
> #include <asm/arch-rockchip/periph.h>
> @@ -38,62 +36,6 @@ int board_init(void)
> return 0;
> }
>
> -static void rk3399_force_power_on_reset(void)
> -{
> - ofnode node;
> - struct gpio_desc sysreset_gpio;
> -
> - debug("%s: trying to force a power-on reset\n", __func__);
> -
> - node = ofnode_path("/config");
> - if (!ofnode_valid(node)) {
> - debug("%s: no /config node?\n", __func__);
> - return;
> - }
> -
> - if (gpio_request_by_name_nodev(node, "sysreset-gpio", 0,
> - &sysreset_gpio, GPIOD_IS_OUT)) {
> - debug("%s: could not find a /config/sysreset-gpio\n", __func__);
> - return;
> - }
> -
> - dm_gpio_set_value(&sysreset_gpio, 1);
> -}
> -
> -void spl_board_init(void)
> -{
> - int ret;
> - struct rk3399_cru *cru = rockchip_get_cru();
> -
> - /*
> - * The RK3399 resets only 'almost all logic' (see also in the TRM
> - * "3.9.4 Global software reset"), when issuing a software reset.
> - * This may cause issues during boot-up for some configurations of
> - * the application software stack.
> - *
> - * To work around this, we test whether the last reset reason was
> - * a power-on reset and (if not) issue an overtemp-reset to reset
> - * the entire module.
> - *
> - * While this was previously fixed by modifying the various places
> - * that could generate a software reset (e.g. U-Boot's sysreset
> - * driver, the ATF or Linux), we now have it here to ensure that
> - * we no longer have to track this through the various components.
> - */
> - if (cru->glb_rst_st != 0)
> - rk3399_force_power_on_reset();
> -
> - /*
> - * Turning the eMMC and SPI back on (if disabled via the Qseven
> - * BIOS_ENABLE) signal is done through a always-on regulator).
> - */
> - ret = regulators_enable_boot_on(false);
> - if (ret)
> - debug("%s: Cannot enable boot on regulator\n", __func__);
> -
> - preloader_console_init();
> -}
> -
> static void setup_macaddr(void)
> {
> #if CONFIG_IS_ENABLED(CMD_NET)
> diff --git a/board/vamrs/rock960_rk3399/rock960-rk3399.c b/board/vamrs/rock960_rk3399/rock960-rk3399.c
> index 018e4b55b8..2eb7120e84 100644
> --- a/board/vamrs/rock960_rk3399/rock960-rk3399.c
> +++ b/board/vamrs/rock960_rk3399/rock960-rk3399.c
> @@ -6,7 +6,6 @@
> #include <common.h>
> #include <dm.h>
> #include <power/regulator.h>
> -#include <spl.h>
>
> int board_init(void)
> {
> @@ -18,10 +17,3 @@ int board_init(void)
>
> return 0;
> }
> -
> -void spl_board_init(void)
> -{
> - preloader_console_init();
> -
> - return;
> -}
> --
> 2.18.0.321.gffc6fa0e3
>
> _______________________________________________
> U-Boot mailing list
> U-Boot at lists.denx.de
> https://lists.denx.de/listinfo/u-boot
^ permalink raw reply [flat|nested] 18+ messages in thread
* [U-Boot] [PATCH v2 3/8] rockchip: rk3399: spl: Mark printascii into debug
2019-06-20 18:54 [U-Boot] [PATCH v2 0/8] rockchip: rk3399: Use spl_board_init in SPL, TPL Jagan Teki
2019-06-20 18:54 ` [U-Boot] [PATCH v2 1/8] board: rk3399: Drop explicit uart enablement in spl_board_init Jagan Teki
2019-06-20 18:55 ` [U-Boot] [PATCH v2 2/8] rockchip: rk3399: Support common spl_board_init Jagan Teki
@ 2019-06-20 18:55 ` Jagan Teki
2019-06-22 13:47 ` Kever Yang
2019-06-20 18:55 ` [U-Boot] [PATCH v2 4/8] rockchip: rk3399: Move u-boot, dm-pre-reloc of uart0, uart2 Jagan Teki
` (4 subsequent siblings)
7 siblings, 1 reply; 18+ messages in thread
From: Jagan Teki @ 2019-06-20 18:55 UTC (permalink / raw)
To: u-boot
Now, we have spl_board_init with preloader_console_init that
indeed show SPL banner.
So mark the 'U-Boot SPL board init' print into debug.
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
---
arch/arm/mach-rockchip/rk3399-board-spl.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/arm/mach-rockchip/rk3399-board-spl.c b/arch/arm/mach-rockchip/rk3399-board-spl.c
index 65c98b697d..890d80025f 100644
--- a/arch/arm/mach-rockchip/rk3399-board-spl.c
+++ b/arch/arm/mach-rockchip/rk3399-board-spl.c
@@ -164,7 +164,7 @@ void board_init_f(ulong dummy)
* printhex8(0x1234);
* printascii("string");
*/
- printascii("U-Boot SPL board init\n");
+ debug("U-Boot SPL board init\n");
#endif
ret = spl_early_init();
--
2.18.0.321.gffc6fa0e3
^ permalink raw reply related [flat|nested] 18+ messages in thread* [U-Boot] [PATCH v2 3/8] rockchip: rk3399: spl: Mark printascii into debug
2019-06-20 18:55 ` [U-Boot] [PATCH v2 3/8] rockchip: rk3399: spl: Mark printascii into debug Jagan Teki
@ 2019-06-22 13:47 ` Kever Yang
0 siblings, 0 replies; 18+ messages in thread
From: Kever Yang @ 2019-06-22 13:47 UTC (permalink / raw)
To: u-boot
Hi Jagan,
On 06/21/2019 02:55 AM, Jagan Teki wrote:
> Now, we have spl_board_init with preloader_console_init that
> indeed show SPL banner.
>
> So mark the 'U-Boot SPL board init' print into debug.
>
> Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
Thanks,
- Kever
> ---
> arch/arm/mach-rockchip/rk3399-board-spl.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/arm/mach-rockchip/rk3399-board-spl.c b/arch/arm/mach-rockchip/rk3399-board-spl.c
> index 65c98b697d..890d80025f 100644
> --- a/arch/arm/mach-rockchip/rk3399-board-spl.c
> +++ b/arch/arm/mach-rockchip/rk3399-board-spl.c
> @@ -164,7 +164,7 @@ void board_init_f(ulong dummy)
> * printhex8(0x1234);
> * printascii("string");
> */
> - printascii("U-Boot SPL board init\n");
> + debug("U-Boot SPL board init\n");
> #endif
>
> ret = spl_early_init();
^ permalink raw reply [flat|nested] 18+ messages in thread
* [U-Boot] [PATCH v2 4/8] rockchip: rk3399: Move u-boot, dm-pre-reloc of uart0, uart2
2019-06-20 18:54 [U-Boot] [PATCH v2 0/8] rockchip: rk3399: Use spl_board_init in SPL, TPL Jagan Teki
` (2 preceding siblings ...)
2019-06-20 18:55 ` [U-Boot] [PATCH v2 3/8] rockchip: rk3399: spl: Mark printascii into debug Jagan Teki
@ 2019-06-20 18:55 ` Jagan Teki
2019-06-22 13:48 ` Kever Yang
2019-06-20 18:55 ` [U-Boot] [PATCH v2 5/8] rockchip: rk3399: Enable SPL_BOARD_INIT Jagan Teki
` (3 subsequent siblings)
7 siblings, 1 reply; 18+ messages in thread
From: Jagan Teki @ 2019-06-20 18:55 UTC (permalink / raw)
To: u-boot
u-boot,dm-pre-reloc for uart0, uart2 indeed u-boot specific
properties. Move them into rk3399-u-boot.dtsi so the boards
which enabled these node will available during SPL.
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
---
arch/arm/dts/rk3399-gru.dtsi | 1 -
arch/arm/dts/rk3399-puma.dtsi | 1 -
arch/arm/dts/rk3399-u-boot.dtsi | 8 ++++++++
3 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/arch/arm/dts/rk3399-gru.dtsi b/arch/arm/dts/rk3399-gru.dtsi
index ca0fc391b2..0e2e047180 100644
--- a/arch/arm/dts/rk3399-gru.dtsi
+++ b/arch/arm/dts/rk3399-gru.dtsi
@@ -629,7 +629,6 @@ ap_i2c_audio: &i2c8 {
&uart2 {
status = "okay";
- u-boot,dm-pre-reloc;
};
&usb_host0_ohci {
diff --git a/arch/arm/dts/rk3399-puma.dtsi b/arch/arm/dts/rk3399-puma.dtsi
index 897e0bda85..74368da550 100644
--- a/arch/arm/dts/rk3399-puma.dtsi
+++ b/arch/arm/dts/rk3399-puma.dtsi
@@ -639,7 +639,6 @@
};
&uart0 {
- u-boot,dm-pre-reloc;
pinctrl-names = "default";
pinctrl-0 = <&uart0_xfer &uart0_cts>;
status = "okay";
diff --git a/arch/arm/dts/rk3399-u-boot.dtsi b/arch/arm/dts/rk3399-u-boot.dtsi
index 0786c1193a..fcfce9ae02 100644
--- a/arch/arm/dts/rk3399-u-boot.dtsi
+++ b/arch/arm/dts/rk3399-u-boot.dtsi
@@ -10,3 +10,11 @@
&spi1 {
u-boot,dm-pre-reloc;
};
+
+&uart0 {
+ u-boot,dm-pre-reloc;
+};
+
+&uart2 {
+ u-boot,dm-pre-reloc;
+};
--
2.18.0.321.gffc6fa0e3
^ permalink raw reply related [flat|nested] 18+ messages in thread* [U-Boot] [PATCH v2 4/8] rockchip: rk3399: Move u-boot, dm-pre-reloc of uart0, uart2
2019-06-20 18:55 ` [U-Boot] [PATCH v2 4/8] rockchip: rk3399: Move u-boot, dm-pre-reloc of uart0, uart2 Jagan Teki
@ 2019-06-22 13:48 ` Kever Yang
0 siblings, 0 replies; 18+ messages in thread
From: Kever Yang @ 2019-06-22 13:48 UTC (permalink / raw)
To: u-boot
Hi Jagan,
On 06/21/2019 02:55 AM, Jagan Teki wrote:
> u-boot,dm-pre-reloc for uart0, uart2 indeed u-boot specific
> properties. Move them into rk3399-u-boot.dtsi so the boards
> which enabled these node will available during SPL.
>
> Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
Thanks,
- Kever
> ---
> arch/arm/dts/rk3399-gru.dtsi | 1 -
> arch/arm/dts/rk3399-puma.dtsi | 1 -
> arch/arm/dts/rk3399-u-boot.dtsi | 8 ++++++++
> 3 files changed, 8 insertions(+), 2 deletions(-)
>
> diff --git a/arch/arm/dts/rk3399-gru.dtsi b/arch/arm/dts/rk3399-gru.dtsi
> index ca0fc391b2..0e2e047180 100644
> --- a/arch/arm/dts/rk3399-gru.dtsi
> +++ b/arch/arm/dts/rk3399-gru.dtsi
> @@ -629,7 +629,6 @@ ap_i2c_audio: &i2c8 {
>
> &uart2 {
> status = "okay";
> - u-boot,dm-pre-reloc;
> };
>
> &usb_host0_ohci {
> diff --git a/arch/arm/dts/rk3399-puma.dtsi b/arch/arm/dts/rk3399-puma.dtsi
> index 897e0bda85..74368da550 100644
> --- a/arch/arm/dts/rk3399-puma.dtsi
> +++ b/arch/arm/dts/rk3399-puma.dtsi
> @@ -639,7 +639,6 @@
> };
>
> &uart0 {
> - u-boot,dm-pre-reloc;
> pinctrl-names = "default";
> pinctrl-0 = <&uart0_xfer &uart0_cts>;
> status = "okay";
> diff --git a/arch/arm/dts/rk3399-u-boot.dtsi b/arch/arm/dts/rk3399-u-boot.dtsi
> index 0786c1193a..fcfce9ae02 100644
> --- a/arch/arm/dts/rk3399-u-boot.dtsi
> +++ b/arch/arm/dts/rk3399-u-boot.dtsi
> @@ -10,3 +10,11 @@
> &spi1 {
> u-boot,dm-pre-reloc;
> };
> +
> +&uart0 {
> + u-boot,dm-pre-reloc;
> +};
> +
> +&uart2 {
> + u-boot,dm-pre-reloc;
> +};
^ permalink raw reply [flat|nested] 18+ messages in thread
* [U-Boot] [PATCH v2 5/8] rockchip: rk3399: Enable SPL_BOARD_INIT
2019-06-20 18:54 [U-Boot] [PATCH v2 0/8] rockchip: rk3399: Use spl_board_init in SPL, TPL Jagan Teki
` (3 preceding siblings ...)
2019-06-20 18:55 ` [U-Boot] [PATCH v2 4/8] rockchip: rk3399: Move u-boot, dm-pre-reloc of uart0, uart2 Jagan Teki
@ 2019-06-20 18:55 ` Jagan Teki
2019-06-22 13:49 ` Kever Yang
2019-06-20 18:55 ` [U-Boot] [PATCH v2 6/8] rockchip: rk3399: tpl: Add spl_board_init Jagan Teki
` (2 subsequent siblings)
7 siblings, 1 reply; 18+ messages in thread
From: Jagan Teki @ 2019-06-20 18:55 UTC (permalink / raw)
To: u-boot
Enable SPL_BOARD_INIT globally to rk3399, this would
help to print the SPL banner during bootup.
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
---
arch/arm/mach-rockchip/Kconfig | 1 +
configs/puma-rk3399_defconfig | 1 -
2 files changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/arm/mach-rockchip/Kconfig b/arch/arm/mach-rockchip/Kconfig
index c05e3c3f48..ce039022df 100644
--- a/arch/arm/mach-rockchip/Kconfig
+++ b/arch/arm/mach-rockchip/Kconfig
@@ -158,6 +158,7 @@ config ROCKCHIP_RK3399
select SPL
select SPL_ATF
select SPL_ATF_NO_PLATFORM_PARAM if SPL_ATF
+ select SPL_BOARD_INIT if SPL
select SPL_LOAD_FIT
select SPL_CLK if SPL
select SPL_PINCTRL if SPL
diff --git a/configs/puma-rk3399_defconfig b/configs/puma-rk3399_defconfig
index ebc78fb216..5cb2273a15 100644
--- a/configs/puma-rk3399_defconfig
+++ b/configs/puma-rk3399_defconfig
@@ -21,7 +21,6 @@ CONFIG_MISC_INIT_R=y
# CONFIG_DISPLAY_CPUINFO is not set
CONFIG_DISPLAY_BOARDINFO_LATE=y
CONFIG_SPL_TEXT_BASE=0xff8c2000
-CONFIG_SPL_BOARD_INIT=y
# CONFIG_SPL_RAW_IMAGE_SUPPORT is not set
# CONFIG_SPL_LEGACY_IMAGE_SUPPORT is not set
CONFIG_SPL_STACK_R=y
--
2.18.0.321.gffc6fa0e3
^ permalink raw reply related [flat|nested] 18+ messages in thread* [U-Boot] [PATCH v2 5/8] rockchip: rk3399: Enable SPL_BOARD_INIT
2019-06-20 18:55 ` [U-Boot] [PATCH v2 5/8] rockchip: rk3399: Enable SPL_BOARD_INIT Jagan Teki
@ 2019-06-22 13:49 ` Kever Yang
0 siblings, 0 replies; 18+ messages in thread
From: Kever Yang @ 2019-06-22 13:49 UTC (permalink / raw)
To: u-boot
Hi Jagan,
On 06/21/2019 02:55 AM, Jagan Teki wrote:
> Enable SPL_BOARD_INIT globally to rk3399, this would
> help to print the SPL banner during bootup.
>
> Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
Thanks,
- Kever
> ---
> arch/arm/mach-rockchip/Kconfig | 1 +
> configs/puma-rk3399_defconfig | 1 -
> 2 files changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/arm/mach-rockchip/Kconfig b/arch/arm/mach-rockchip/Kconfig
> index c05e3c3f48..ce039022df 100644
> --- a/arch/arm/mach-rockchip/Kconfig
> +++ b/arch/arm/mach-rockchip/Kconfig
> @@ -158,6 +158,7 @@ config ROCKCHIP_RK3399
> select SPL
> select SPL_ATF
> select SPL_ATF_NO_PLATFORM_PARAM if SPL_ATF
> + select SPL_BOARD_INIT if SPL
> select SPL_LOAD_FIT
> select SPL_CLK if SPL
> select SPL_PINCTRL if SPL
> diff --git a/configs/puma-rk3399_defconfig b/configs/puma-rk3399_defconfig
> index ebc78fb216..5cb2273a15 100644
> --- a/configs/puma-rk3399_defconfig
> +++ b/configs/puma-rk3399_defconfig
> @@ -21,7 +21,6 @@ CONFIG_MISC_INIT_R=y
> # CONFIG_DISPLAY_CPUINFO is not set
> CONFIG_DISPLAY_BOARDINFO_LATE=y
> CONFIG_SPL_TEXT_BASE=0xff8c2000
> -CONFIG_SPL_BOARD_INIT=y
> # CONFIG_SPL_RAW_IMAGE_SUPPORT is not set
> # CONFIG_SPL_LEGACY_IMAGE_SUPPORT is not set
> CONFIG_SPL_STACK_R=y
^ permalink raw reply [flat|nested] 18+ messages in thread
* [U-Boot] [PATCH v2 6/8] rockchip: rk3399: tpl: Add spl_board_init
2019-06-20 18:54 [U-Boot] [PATCH v2 0/8] rockchip: rk3399: Use spl_board_init in SPL, TPL Jagan Teki
` (4 preceding siblings ...)
2019-06-20 18:55 ` [U-Boot] [PATCH v2 5/8] rockchip: rk3399: Enable SPL_BOARD_INIT Jagan Teki
@ 2019-06-20 18:55 ` Jagan Teki
2019-06-22 13:50 ` Kever Yang
2019-06-20 18:55 ` [U-Boot] [PATCH v2 7/8] rockchip: rk3399: tpl: Mark printascii into debug Jagan Teki
2019-06-20 18:55 ` [U-Boot] [PATCH v2 8/8] rockchip: rk3399: Enable TPL_BOARD_INIT Jagan Teki
7 siblings, 1 reply; 18+ messages in thread
From: Jagan Teki @ 2019-06-20 18:55 UTC (permalink / raw)
To: u-boot
Add spl_board_init for TPL, that have TPL banner will help
to print tpl boot prints.
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
---
arch/arm/mach-rockchip/rk3399-board-tpl.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/arch/arm/mach-rockchip/rk3399-board-tpl.c b/arch/arm/mach-rockchip/rk3399-board-tpl.c
index 86d3ffe97c..72d0dd914e 100644
--- a/arch/arm/mach-rockchip/rk3399-board-tpl.c
+++ b/arch/arm/mach-rockchip/rk3399-board-tpl.c
@@ -8,6 +8,7 @@
#include <dm.h>
#include <ram.h>
#include <spl.h>
+#include <version.h>
#include <asm/io.h>
#include <asm/arch-rockchip/bootrom.h>
@@ -73,6 +74,12 @@ u32 spl_boot_device(void)
return BOOT_DEVICE_BOOTROM;
}
+void spl_board_init(void)
+{
+ puts("\nU-Boot TPL " PLAIN_VERSION " (" U_BOOT_DATE " - "
+ U_BOOT_TIME " " U_BOOT_TZ ")\n");
+}
+
#ifdef CONFIG_SPL_LOAD_FIT
int board_fit_config_name_match(const char *name)
{
--
2.18.0.321.gffc6fa0e3
^ permalink raw reply related [flat|nested] 18+ messages in thread* [U-Boot] [PATCH v2 6/8] rockchip: rk3399: tpl: Add spl_board_init
2019-06-20 18:55 ` [U-Boot] [PATCH v2 6/8] rockchip: rk3399: tpl: Add spl_board_init Jagan Teki
@ 2019-06-22 13:50 ` Kever Yang
0 siblings, 0 replies; 18+ messages in thread
From: Kever Yang @ 2019-06-22 13:50 UTC (permalink / raw)
To: u-boot
Hi Jagan,
On 06/21/2019 02:55 AM, Jagan Teki wrote:
> Add spl_board_init for TPL, that have TPL banner will help
> to print tpl boot prints.
>
> Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
Thanks,
- Kever
> ---
> arch/arm/mach-rockchip/rk3399-board-tpl.c | 7 +++++++
> 1 file changed, 7 insertions(+)
>
> diff --git a/arch/arm/mach-rockchip/rk3399-board-tpl.c b/arch/arm/mach-rockchip/rk3399-board-tpl.c
> index 86d3ffe97c..72d0dd914e 100644
> --- a/arch/arm/mach-rockchip/rk3399-board-tpl.c
> +++ b/arch/arm/mach-rockchip/rk3399-board-tpl.c
> @@ -8,6 +8,7 @@
> #include <dm.h>
> #include <ram.h>
> #include <spl.h>
> +#include <version.h>
> #include <asm/io.h>
> #include <asm/arch-rockchip/bootrom.h>
>
> @@ -73,6 +74,12 @@ u32 spl_boot_device(void)
> return BOOT_DEVICE_BOOTROM;
> }
>
> +void spl_board_init(void)
> +{
> + puts("\nU-Boot TPL " PLAIN_VERSION " (" U_BOOT_DATE " - "
> + U_BOOT_TIME " " U_BOOT_TZ ")\n");
> +}
> +
> #ifdef CONFIG_SPL_LOAD_FIT
> int board_fit_config_name_match(const char *name)
> {
^ permalink raw reply [flat|nested] 18+ messages in thread
* [U-Boot] [PATCH v2 7/8] rockchip: rk3399: tpl: Mark printascii into debug
2019-06-20 18:54 [U-Boot] [PATCH v2 0/8] rockchip: rk3399: Use spl_board_init in SPL, TPL Jagan Teki
` (5 preceding siblings ...)
2019-06-20 18:55 ` [U-Boot] [PATCH v2 6/8] rockchip: rk3399: tpl: Add spl_board_init Jagan Teki
@ 2019-06-20 18:55 ` Jagan Teki
2019-06-22 13:50 ` Kever Yang
2019-06-20 18:55 ` [U-Boot] [PATCH v2 8/8] rockchip: rk3399: Enable TPL_BOARD_INIT Jagan Teki
7 siblings, 1 reply; 18+ messages in thread
From: Jagan Teki @ 2019-06-20 18:55 UTC (permalink / raw)
To: u-boot
Now, we have spl_board_init which has TPL banner prints.
So mark the 'U-Boot TPL board init' print into debug.
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
---
arch/arm/mach-rockchip/rk3399-board-tpl.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/arm/mach-rockchip/rk3399-board-tpl.c b/arch/arm/mach-rockchip/rk3399-board-tpl.c
index 72d0dd914e..4a301249b4 100644
--- a/arch/arm/mach-rockchip/rk3399-board-tpl.c
+++ b/arch/arm/mach-rockchip/rk3399-board-tpl.c
@@ -47,7 +47,7 @@ void board_init_f(ulong dummy)
* printhex8(0x1234);
* printascii("string");
*/
- printascii("U-Boot TPL board init\n");
+ debug("U-Boot TPL board init\n");
#endif
ret = spl_early_init();
if (ret) {
--
2.18.0.321.gffc6fa0e3
^ permalink raw reply related [flat|nested] 18+ messages in thread* [U-Boot] [PATCH v2 7/8] rockchip: rk3399: tpl: Mark printascii into debug
2019-06-20 18:55 ` [U-Boot] [PATCH v2 7/8] rockchip: rk3399: tpl: Mark printascii into debug Jagan Teki
@ 2019-06-22 13:50 ` Kever Yang
0 siblings, 0 replies; 18+ messages in thread
From: Kever Yang @ 2019-06-22 13:50 UTC (permalink / raw)
To: u-boot
Hi Jagan,
On 06/21/2019 02:55 AM, Jagan Teki wrote:
> Now, we have spl_board_init which has TPL banner prints.
>
> So mark the 'U-Boot TPL board init' print into debug.
>
> Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
Thanks,
- Kever
> ---
> arch/arm/mach-rockchip/rk3399-board-tpl.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/arm/mach-rockchip/rk3399-board-tpl.c b/arch/arm/mach-rockchip/rk3399-board-tpl.c
> index 72d0dd914e..4a301249b4 100644
> --- a/arch/arm/mach-rockchip/rk3399-board-tpl.c
> +++ b/arch/arm/mach-rockchip/rk3399-board-tpl.c
> @@ -47,7 +47,7 @@ void board_init_f(ulong dummy)
> * printhex8(0x1234);
> * printascii("string");
> */
> - printascii("U-Boot TPL board init\n");
> + debug("U-Boot TPL board init\n");
> #endif
> ret = spl_early_init();
> if (ret) {
^ permalink raw reply [flat|nested] 18+ messages in thread
* [U-Boot] [PATCH v2 8/8] rockchip: rk3399: Enable TPL_BOARD_INIT
2019-06-20 18:54 [U-Boot] [PATCH v2 0/8] rockchip: rk3399: Use spl_board_init in SPL, TPL Jagan Teki
` (6 preceding siblings ...)
2019-06-20 18:55 ` [U-Boot] [PATCH v2 7/8] rockchip: rk3399: tpl: Mark printascii into debug Jagan Teki
@ 2019-06-20 18:55 ` Jagan Teki
2019-06-22 13:51 ` Kever Yang
7 siblings, 1 reply; 18+ messages in thread
From: Jagan Teki @ 2019-06-20 18:55 UTC (permalink / raw)
To: u-boot
Enable TPL_BOARD_INIT, this would help us to show
TPL boot prints.
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
---
arch/arm/mach-rockchip/Kconfig | 1 +
1 file changed, 1 insertion(+)
diff --git a/arch/arm/mach-rockchip/Kconfig b/arch/arm/mach-rockchip/Kconfig
index ce039022df..1d483be8b9 100644
--- a/arch/arm/mach-rockchip/Kconfig
+++ b/arch/arm/mach-rockchip/Kconfig
@@ -184,6 +184,7 @@ config ROCKCHIP_RK3399
imply TPL_LIBCOMMON_SUPPORT
imply TPL_LIBGENERIC_SUPPORT
imply TPL_SYS_MALLOC_SIMPLE
+ imply TPL_BOARD_INIT
imply TPL_BOOTROM_SUPPORT
imply TPL_DRIVERS_MISC_SUPPORT
imply TPL_OF_CONTROL
--
2.18.0.321.gffc6fa0e3
^ permalink raw reply related [flat|nested] 18+ messages in thread* [U-Boot] [PATCH v2 8/8] rockchip: rk3399: Enable TPL_BOARD_INIT
2019-06-20 18:55 ` [U-Boot] [PATCH v2 8/8] rockchip: rk3399: Enable TPL_BOARD_INIT Jagan Teki
@ 2019-06-22 13:51 ` Kever Yang
0 siblings, 0 replies; 18+ messages in thread
From: Kever Yang @ 2019-06-22 13:51 UTC (permalink / raw)
To: u-boot
Hi Jagan,
On 06/21/2019 02:55 AM, Jagan Teki wrote:
> Enable TPL_BOARD_INIT, this would help us to show
> TPL boot prints.
>
> Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
Thanks,
- Kever
> ---
> arch/arm/mach-rockchip/Kconfig | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/arch/arm/mach-rockchip/Kconfig b/arch/arm/mach-rockchip/Kconfig
> index ce039022df..1d483be8b9 100644
> --- a/arch/arm/mach-rockchip/Kconfig
> +++ b/arch/arm/mach-rockchip/Kconfig
> @@ -184,6 +184,7 @@ config ROCKCHIP_RK3399
> imply TPL_LIBCOMMON_SUPPORT
> imply TPL_LIBGENERIC_SUPPORT
> imply TPL_SYS_MALLOC_SIMPLE
> + imply TPL_BOARD_INIT
> imply TPL_BOOTROM_SUPPORT
> imply TPL_DRIVERS_MISC_SUPPORT
> imply TPL_OF_CONTROL
^ permalink raw reply [flat|nested] 18+ messages in thread