Message ID | 20200319101251.7354-3-jagan@amarulasolutions.com |
---|---|
State | New |
Headers | show |
Series | [v2,1/5] rockchip: Separate the reset cause from display cpuinfo | expand |
On Thu, Mar 19, 2020 at 3:43 PM Jagan Teki <jagan at amarulasolutions.com> wrote: > > Custom board_early_init_f not only deal with simple gpio > configuration but also have a possibility to access clocks > to process any clock related operations like checking reset > cause state and etc. > > So, call it once the rockchip timer initialization done instead > of calling first place of board_init_f which doesn't have any > rockchip init code before. > > This specific concern was tested with checking reset reason > via board_early_init_f, which indeed require a clk probe. > > Signed-off-by: Jagan Teki <jagan at amarulasolutions.com> > --- > Changes for v2: > - none > > arch/arm/mach-rockchip/tpl.c | 5 +++-- > 1 file changed, 3 insertions(+), 2 deletions(-) > > diff --git a/arch/arm/mach-rockchip/tpl.c b/arch/arm/mach-rockchip/tpl.c > index a2b8d31cbd..fab85dff7d 100644 > --- a/arch/arm/mach-rockchip/tpl.c > +++ b/arch/arm/mach-rockchip/tpl.c > @@ -50,8 +50,6 @@ void board_init_f(ulong dummy) > struct udevice *dev; > int ret; > > - board_early_init_f(); > - > #if defined(CONFIG_DEBUG_UART) && defined(CONFIG_TPL_SERIAL_SUPPORT) > /* > * Debug UART can be used from here if required: > @@ -78,6 +76,9 @@ void board_init_f(ulong dummy) > /* Init ARM arch timer in arch/arm/cpu/ */ > timer_init(); > > + /* custom board early initialization */ > + board_early_init_f(); > + > ret = uclass_get_device(UCLASS_RAM, 0, &dev); > if (ret) { > printf("DRAM init failed: %d\n", ret); > -- > 2.17.1 > Tested-by: Suniel Mahesh <sunil at amarulasolutions.com>
diff --git a/arch/arm/mach-rockchip/tpl.c b/arch/arm/mach-rockchip/tpl.c index a2b8d31cbd..fab85dff7d 100644 --- a/arch/arm/mach-rockchip/tpl.c +++ b/arch/arm/mach-rockchip/tpl.c @@ -50,8 +50,6 @@ void board_init_f(ulong dummy) struct udevice *dev; int ret; - board_early_init_f(); - #if defined(CONFIG_DEBUG_UART) && defined(CONFIG_TPL_SERIAL_SUPPORT) /* * Debug UART can be used from here if required: @@ -78,6 +76,9 @@ void board_init_f(ulong dummy) /* Init ARM arch timer in arch/arm/cpu/ */ timer_init(); + /* custom board early initialization */ + board_early_init_f(); + ret = uclass_get_device(UCLASS_RAM, 0, &dev); if (ret) { printf("DRAM init failed: %d\n", ret);
Custom board_early_init_f not only deal with simple gpio configuration but also have a possibility to access clocks to process any clock related operations like checking reset cause state and etc. So, call it once the rockchip timer initialization done instead of calling first place of board_init_f which doesn't have any rockchip init code before. This specific concern was tested with checking reset reason via board_early_init_f, which indeed require a clk probe. Signed-off-by: Jagan Teki <jagan at amarulasolutions.com> --- Changes for v2: - none arch/arm/mach-rockchip/tpl.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)