All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] rockchip: rk3188: add rk_board_late_init() hook
@ 2018-02-26 12:37 Alexander Kochetkov
  2018-02-26 13:02 ` [U-Boot] Moving the rk_board_late_init() hook to a device-model based implementation Dr. Philipp Tomsich
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: Alexander Kochetkov @ 2018-02-26 12:37 UTC (permalink / raw)
  To: u-boot

All other rockchip boards have rk_board_late_init() hook,
so add it to rk3188 boards also.

Signed-off-by: Alexander Kochetkov <al.kochet@gmail.com>
---
 arch/arm/mach-rockchip/rk3188-board.c |    7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/arch/arm/mach-rockchip/rk3188-board.c b/arch/arm/mach-rockchip/rk3188-board.c
index 916d18f..fc58aeb 100644
--- a/arch/arm/mach-rockchip/rk3188-board.c
+++ b/arch/arm/mach-rockchip/rk3188-board.c
@@ -20,6 +20,11 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
+__weak int rk_board_late_init(void)
+{
+	return 0;
+}
+
 int board_late_init(void)
 {
 	struct rk3188_grf *grf;
@@ -35,7 +40,7 @@ int board_late_init(void)
 			NOC_REMAP_MASK << NOC_REMAP_SHIFT);
 	}
 
-	return 0;
+	return rk_board_late_init();
 }
 
 int board_init(void)
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [U-Boot] Moving the rk_board_late_init() hook to a device-model based implementation.
  2018-02-26 12:37 [U-Boot] [PATCH] rockchip: rk3188: add rk_board_late_init() hook Alexander Kochetkov
@ 2018-02-26 13:02 ` Dr. Philipp Tomsich
  2018-03-19 18:09   ` Dr. Philipp Tomsich
  2018-03-20 14:03   ` Kever Yang
  2018-02-28 19:00 ` [U-Boot] rockchip: rk3188: add rk_board_late_init() hook Philipp Tomsich
                   ` (2 subsequent siblings)
  3 siblings, 2 replies; 8+ messages in thread
From: Dr. Philipp Tomsich @ 2018-02-26 13:02 UTC (permalink / raw)
  To: u-boot

Simon & Kever,

We have the rk_board_late_init() hook for the Rockchip boards and I’d like to convert
these to some sort of device-model based implementation.

Here’s what I’d propose as a minimal implementation:
1.	Introduce a new UCLASS_BOARD
2.	Trigger on the top-level ‘compatible’ string (e.g. "tsd,rk3399-q7” for our RK3399-Q7 board) from the DTS.
3.	Provide ops for at least the following hooks:
		.board_late_init 	[used on Rockchip for setup_boot_mode() … or for calling rk_board_late_init]
		.board_init_f		[e.g. our DDR and SRAM security region setup]
		.board_fit_config_name_match

For a more full-fledged implementation, I would like to have a UCLASS_SOC in addition to the UCLASS_BOARD and iterate over the same list of compatible strings to find a UCLASS_SOC … then perform a two step-init: i.e. first the SOC, then the BOARD.
This would be used to have common init-code, such as what we have for the RK3399 in arch_cpu_init() — i.e. "Emmc clock generator: disable the clock multipilier”.

Thanks in advance for taking the time to review and comment,
—Philipp.


> On 26 Feb 2018, at 13:37, Alexander Kochetkov <al.kochet@gmail.com> wrote:
> 
> All other rockchip boards have rk_board_late_init() hook,
> so add it to rk3188 boards also.
> 
> Signed-off-by: Alexander Kochetkov <al.kochet@gmail.com>
> ---
> arch/arm/mach-rockchip/rk3188-board.c |    7 ++++++-
> 1 file changed, 6 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/arm/mach-rockchip/rk3188-board.c b/arch/arm/mach-rockchip/rk3188-board.c
> index 916d18f..fc58aeb 100644
> --- a/arch/arm/mach-rockchip/rk3188-board.c
> +++ b/arch/arm/mach-rockchip/rk3188-board.c
> @@ -20,6 +20,11 @@
> 
> DECLARE_GLOBAL_DATA_PTR;
> 
> +__weak int rk_board_late_init(void)
> +{
> +	return 0;
> +}
> +
> int board_late_init(void)
> {
> 	struct rk3188_grf *grf;
> @@ -35,7 +40,7 @@ int board_late_init(void)
> 			NOC_REMAP_MASK << NOC_REMAP_SHIFT);
> 	}
> 
> -	return 0;
> +	return rk_board_late_init();
> }
> 
> int board_init(void)
> -- 
> 1.7.9.5
> 

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [U-Boot] rockchip: rk3188: add rk_board_late_init() hook
  2018-02-26 12:37 [U-Boot] [PATCH] rockchip: rk3188: add rk_board_late_init() hook Alexander Kochetkov
  2018-02-26 13:02 ` [U-Boot] Moving the rk_board_late_init() hook to a device-model based implementation Dr. Philipp Tomsich
@ 2018-02-28 19:00 ` Philipp Tomsich
  2018-02-28 19:00 ` Philipp Tomsich
  2018-07-13 10:25 ` Philipp Tomsich
  3 siblings, 0 replies; 8+ messages in thread
From: Philipp Tomsich @ 2018-02-28 19:00 UTC (permalink / raw)
  To: u-boot

> All other rockchip boards have rk_board_late_init() hook,
> so add it to rk3188 boards also.
> 
> Signed-off-by: Alexander Kochetkov <al.kochet@gmail.com>
> ---
>  arch/arm/mach-rockchip/rk3188-board.c |    7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
> 

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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [U-Boot] rockchip: rk3188: add rk_board_late_init() hook
  2018-02-26 12:37 [U-Boot] [PATCH] rockchip: rk3188: add rk_board_late_init() hook Alexander Kochetkov
  2018-02-26 13:02 ` [U-Boot] Moving the rk_board_late_init() hook to a device-model based implementation Dr. Philipp Tomsich
  2018-02-28 19:00 ` [U-Boot] rockchip: rk3188: add rk_board_late_init() hook Philipp Tomsich
@ 2018-02-28 19:00 ` Philipp Tomsich
  2018-07-13 10:25 ` Philipp Tomsich
  3 siblings, 0 replies; 8+ messages in thread
From: Philipp Tomsich @ 2018-02-28 19:00 UTC (permalink / raw)
  To: u-boot

> All other rockchip boards have rk_board_late_init() hook,
> so add it to rk3188 boards also.
> 
> Signed-off-by: Alexander Kochetkov <al.kochet@gmail.com>
> ---
>  arch/arm/mach-rockchip/rk3188-board.c |    7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
> 

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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [U-Boot] Moving the rk_board_late_init() hook to a device-model based implementation.
  2018-02-26 13:02 ` [U-Boot] Moving the rk_board_late_init() hook to a device-model based implementation Dr. Philipp Tomsich
@ 2018-03-19 18:09   ` Dr. Philipp Tomsich
  2018-03-20 14:03   ` Kever Yang
  1 sibling, 0 replies; 8+ messages in thread
From: Dr. Philipp Tomsich @ 2018-03-19 18:09 UTC (permalink / raw)
  To: u-boot

Simon,

ping?

Thanks,
Philipp.

> On 26 Feb 2018, at 14:02, Dr. Philipp Tomsich <philipp.tomsich@theobroma-systems.com> wrote:
> 
> Simon & Kever,
> 
> We have the rk_board_late_init() hook for the Rockchip boards and I’d like to convert
> these to some sort of device-model based implementation.
> 
> Here’s what I’d propose as a minimal implementation:
> 1.	Introduce a new UCLASS_BOARD
> 2.	Trigger on the top-level ‘compatible’ string (e.g. "tsd,rk3399-q7” for our RK3399-Q7 board) from the DTS.
> 3.	Provide ops for at least the following hooks:
> 		.board_late_init 	[used on Rockchip for setup_boot_mode() … or for calling rk_board_late_init]
> 		.board_init_f		[e.g. our DDR and SRAM security region setup]
> 		.board_fit_config_name_match
> 
> For a more full-fledged implementation, I would like to have a UCLASS_SOC in addition to the UCLASS_BOARD and iterate over the same list of compatible strings to find a UCLASS_SOC … then perform a two step-init: i.e. first the SOC, then the BOARD.
> This would be used to have common init-code, such as what we have for the RK3399 in arch_cpu_init() — i.e. "Emmc clock generator: disable the clock multipilier”.
> 
> Thanks in advance for taking the time to review and comment,
> —Philipp.
> 
> 
>> On 26 Feb 2018, at 13:37, Alexander Kochetkov <al.kochet@gmail.com> wrote:
>> 
>> All other rockchip boards have rk_board_late_init() hook,
>> so add it to rk3188 boards also.
>> 
>> Signed-off-by: Alexander Kochetkov <al.kochet@gmail.com>
>> ---
>> arch/arm/mach-rockchip/rk3188-board.c |    7 ++++++-
>> 1 file changed, 6 insertions(+), 1 deletion(-)
>> 
>> diff --git a/arch/arm/mach-rockchip/rk3188-board.c b/arch/arm/mach-rockchip/rk3188-board.c
>> index 916d18f..fc58aeb 100644
>> --- a/arch/arm/mach-rockchip/rk3188-board.c
>> +++ b/arch/arm/mach-rockchip/rk3188-board.c
>> @@ -20,6 +20,11 @@
>> 
>> DECLARE_GLOBAL_DATA_PTR;
>> 
>> +__weak int rk_board_late_init(void)
>> +{
>> +	return 0;
>> +}
>> +
>> int board_late_init(void)
>> {
>> 	struct rk3188_grf *grf;
>> @@ -35,7 +40,7 @@ int board_late_init(void)
>> 			NOC_REMAP_MASK << NOC_REMAP_SHIFT);
>> 	}
>> 
>> -	return 0;
>> +	return rk_board_late_init();
>> }
>> 
>> int board_init(void)
>> -- 
>> 1.7.9.5
>> 
> 
> _______________________________________________
> U-Boot mailing list
> U-Boot at lists.denx.de
> https://lists.denx.de/listinfo/u-boot

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [U-Boot] Moving the rk_board_late_init() hook to a device-model based implementation.
  2018-02-26 13:02 ` [U-Boot] Moving the rk_board_late_init() hook to a device-model based implementation Dr. Philipp Tomsich
  2018-03-19 18:09   ` Dr. Philipp Tomsich
@ 2018-03-20 14:03   ` Kever Yang
  2018-03-20 14:07     ` Alexander Kochetkov
  1 sibling, 1 reply; 8+ messages in thread
From: Kever Yang @ 2018-03-20 14:03 UTC (permalink / raw)
  To: u-boot

Hi Philipp,

    Amount all the source code for support Rockchip SoCs which not using
DM, I think
are all in two kind folder:
- arch/arm/mach-rockchip/
- board/vendor/board-name/

    Looks like UCLASS_SOC and UCLASS_BOARD can take care of all these
source code into DM?
Well, it looks like each implement of SoCs in these two folder are not
the same, and you want
to 'format' them in the same implementation, is that what you want to
get from new UCLASS_*?

    I have a local version of using common board init, and we can remove
all the rkxx_board.c/rkxx_board_spl.c/rkxx_board_tpl.c,
and all the soc difference go into arch/arm/mach-rockchip/rkxx/rkxx.c,
and board specific setting
go to board/vendor/board/board.c.
    After this patch set, it's much clean now in my local branch and I'm
try to clean it and send
to list now. There is not much things in soc specific and board specific
setting, while hooks like
rk_board_late_init() still needed, but I'm not sure it worth to add
uclass for both soc and board.
    I think using board_init, board_late_init, arch_cpu_init from common
board_r/f is quite handy
for me now.

    Maybe we can discuss this again after I send my patches.

Thanks,
- Kever
On 02/26/2018 09:02 PM, Dr. Philipp Tomsich wrote:
> Simon & Kever,
>
> We have the rk_board_late_init() hook for the Rockchip boards and I’d like to convert
> these to some sort of device-model based implementation.
>
> Here’s what I’d propose as a minimal implementation:
> 1.	Introduce a new UCLASS_BOARD
> 2.	Trigger on the top-level ‘compatible’ string (e.g. "tsd,rk3399-q7” for our RK3399-Q7 board) from the DTS.
> 3.	Provide ops for at least the following hooks:
> 		.board_late_init 	[used on Rockchip for setup_boot_mode() … or for calling rk_board_late_init]
> 		.board_init_f		[e.g. our DDR and SRAM security region setup]
> 		.board_fit_config_name_match
>
> For a more full-fledged implementation, I would like to have a UCLASS_SOC in addition to the UCLASS_BOARD and iterate over the same list of compatible strings to find a UCLASS_SOC … then perform a two step-init: i.e. first the SOC, then the BOARD.
> This would be used to have common init-code, such as what we have for the RK3399 in arch_cpu_init() — i.e. "Emmc clock generator: disable the clock multipilier”.
>
> Thanks in advance for taking the time to review and comment,
> —Philipp.
>
>
>> On 26 Feb 2018, at 13:37, Alexander Kochetkov <al.kochet@gmail.com> wrote:
>>
>> All other rockchip boards have rk_board_late_init() hook,
>> so add it to rk3188 boards also.
>>
>> Signed-off-by: Alexander Kochetkov <al.kochet@gmail.com>
>> ---
>> arch/arm/mach-rockchip/rk3188-board.c |    7 ++++++-
>> 1 file changed, 6 insertions(+), 1 deletion(-)
>>
>> diff --git a/arch/arm/mach-rockchip/rk3188-board.c b/arch/arm/mach-rockchip/rk3188-board.c
>> index 916d18f..fc58aeb 100644
>> --- a/arch/arm/mach-rockchip/rk3188-board.c
>> +++ b/arch/arm/mach-rockchip/rk3188-board.c
>> @@ -20,6 +20,11 @@
>>
>> DECLARE_GLOBAL_DATA_PTR;
>>
>> +__weak int rk_board_late_init(void)
>> +{
>> +	return 0;
>> +}
>> +
>> int board_late_init(void)
>> {
>> 	struct rk3188_grf *grf;
>> @@ -35,7 +40,7 @@ int board_late_init(void)
>> 			NOC_REMAP_MASK << NOC_REMAP_SHIFT);
>> 	}
>>
>> -	return 0;
>> +	return rk_board_late_init();
>> }
>>
>> int board_init(void)
>> -- 
>> 1.7.9.5
>>
>

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [U-Boot] Moving the rk_board_late_init() hook to a device-model based implementation.
  2018-03-20 14:03   ` Kever Yang
@ 2018-03-20 14:07     ` Alexander Kochetkov
  0 siblings, 0 replies; 8+ messages in thread
From: Alexander Kochetkov @ 2018-03-20 14:07 UTC (permalink / raw)
  To: u-boot


> 20 марта 2018 г., в 17:03, Kever Yang <kever.yang@rock-chips.com> написал(а):
> 
>     Maybe we can discuss this again after I send my patches.

Hello, Kever!
Please cc me on your patch series.

Regards,
Alexander.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [U-Boot] rockchip: rk3188: add rk_board_late_init() hook
  2018-02-26 12:37 [U-Boot] [PATCH] rockchip: rk3188: add rk_board_late_init() hook Alexander Kochetkov
                   ` (2 preceding siblings ...)
  2018-02-28 19:00 ` Philipp Tomsich
@ 2018-07-13 10:25 ` Philipp Tomsich
  3 siblings, 0 replies; 8+ messages in thread
From: Philipp Tomsich @ 2018-07-13 10:25 UTC (permalink / raw)
  To: u-boot

> All other rockchip boards have rk_board_late_init() hook,
> so add it to rk3188 boards also.
> 
> Signed-off-by: Alexander Kochetkov <al.kochet@gmail.com>
> Acked-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
> Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
> ---
>  arch/arm/mach-rockchip/rk3188-board.c |    7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
> 

Applied to u-boot-rockchip, thanks!

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2018-07-13 10:25 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-02-26 12:37 [U-Boot] [PATCH] rockchip: rk3188: add rk_board_late_init() hook Alexander Kochetkov
2018-02-26 13:02 ` [U-Boot] Moving the rk_board_late_init() hook to a device-model based implementation Dr. Philipp Tomsich
2018-03-19 18:09   ` Dr. Philipp Tomsich
2018-03-20 14:03   ` Kever Yang
2018-03-20 14:07     ` Alexander Kochetkov
2018-02-28 19:00 ` [U-Boot] rockchip: rk3188: add rk_board_late_init() hook Philipp Tomsich
2018-02-28 19:00 ` Philipp Tomsich
2018-07-13 10:25 ` Philipp Tomsich

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.