From mboxrd@z Thu Jan 1 00:00:00 1970 From: Simon Glass Date: Tue, 12 Sep 2017 22:25:42 -0600 Subject: [U-Boot] [PATCH 01/10] rockchip: rk3399: make spl_board_init board-specific In-Reply-To: <1505131150-39480-2-git-send-email-philipp.tomsich@theobroma-systems.com> References: <1505131150-39480-1-git-send-email-philipp.tomsich@theobroma-systems.com> <1505131150-39480-2-git-send-email-philipp.tomsich@theobroma-systems.com> Message-ID: List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hi Philipp, On 11 September 2017 at 05:59, Philipp Tomsich wrote: > > 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. Well that can go in its own patch :-) > > Signed-off-by: Philipp Tomsich > --- > > 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 > +#include Actually this was correct. Please see: https://www.denx.de/wiki/U-Boot/CodingStyle > #include > -#include > #include > #include > -#include > #include > +#include > > 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 > +#include > +#include Similarly here. In any case, this should go in a separate patch. > #include > -#include > -#include > #include > #include > -#include > -#include > +#include > #include > +#include > #include > > 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 > Regards, Simon