diff mbox series

[5/6] board: puma: allow building with TPL as well

Message ID 20200603145929.364923-6-heiko@sntech.de
State New
Headers show
Series revive Theobroma-Systems puma board | expand

Commit Message

Heiko Stuebner June 3, 2020, 2:59 p.m. UTC
From: Heiko Stuebner <heiko.stuebner at theobroma-systems.com>

Right now puma-u-boot can fit everything into SPL but that may overflow
easily for example with more extensive debug options.

By adding CONFIG_TPL and removing the CONFIG_SPL_TEXT_BASE it is easy
to enable a TPL build as well. Only obstacle is the usb-specific handling
for the puma regulator, so make this conditional on actual usb options
being enabled in SPL and U-Boot proper.

Signed-off-by: Heiko Stuebner <heiko.stuebner at theobroma-systems.com>
---
 board/theobroma-systems/puma_rk3399/puma-rk3399.c | 4 ++++
 1 file changed, 4 insertions(+)

Comments

Philipp Tomsich June 3, 2020, 5:10 p.m. UTC | #1
> On 03.06.2020, at 16:59, Heiko Stuebner <heiko at sntech.de> wrote:
> 
> From: Heiko Stuebner <heiko.stuebner at theobroma-systems.com>
> 
> Right now puma-u-boot can fit everything into SPL but that may overflow
> easily for example with more extensive debug options.
> 
> By adding CONFIG_TPL and removing the CONFIG_SPL_TEXT_BASE it is easy
> to enable a TPL build as well. Only obstacle is the usb-specific handling
> for the puma regulator, so make this conditional on actual usb options
> being enabled in SPL and U-Boot proper.
> 
> Signed-off-by: Heiko Stuebner <heiko.stuebner at theobroma-systems.com>

Reviewed-by: Philipp Tomsich <philipp.tomsich at theobroma-systems.com>
diff mbox series

Patch

diff --git a/board/theobroma-systems/puma_rk3399/puma-rk3399.c b/board/theobroma-systems/puma_rk3399/puma-rk3399.c
index 65bb2ad6f2..31ac27c6f5 100644
--- a/board/theobroma-systems/puma_rk3399/puma-rk3399.c
+++ b/board/theobroma-systems/puma_rk3399/puma-rk3399.c
@@ -153,6 +153,9 @@  void get_board_serial(struct tag_serialnr *serialnr)
 }
 #endif
 
+#if !defined(CONFIG_TPL_BUILD) && \
+    (defined(CONFIG_SPL_BUILD) && defined(CONFIG_SPL_USB_HOST_SUPPORT)) || \
+    (!defined(CONFIG_SPL_BUILD) && defined(CONFIG_USB))
 /**
  * Switch power at an external regulator (for our root hub).
  *
@@ -219,3 +222,4 @@  void usb_hub_reset_devices(struct usb_hub_device *hub, int port)
 	 */
 	board_usb_port_power_set(ctrl, port, true);
 }
+#endif