Re: [U-Boot] [PATCH v2] rockchip: rk3188: enable remap function

2017-04-14 Thread Simon Glass
On 9 April 2017 at 13:27, Simon Glass  wrote:
> On 5 April 2017 at 16:19, Heiko Stuebner  wrote:
>> Most Rockchip socs have the ability to either map the bootrom or a sram
>> area to the starting address of the cpu by flipping a bit in the GRF.
>>
>> Newer socs leave this untouched and mapped to the bootrom but the legacy
>> loaders on rk3188 and before enabled the remap functionality and the
>> current smp implementation in the Linux kernel also requires it to be
>> enabled, to bring up secondary cpus.
>>
>> So to keep smp working in the kernel, mimic the behaviour of the legacy
>> bootloaders and enable the remap functionality.
>>
>> Signed-off-by: Heiko Stuebner 
>> ---
>> changes in v2:
>> - drop the rk_board_late_init weak function
>>   If boards need even more specialized init we can worry
>>   about that later.
>>
>>  arch/arm/mach-rockchip/Kconfig|  1 +
>>  arch/arm/mach-rockchip/rk3188-board.c | 18 ++
>>  2 files changed, 19 insertions(+)
>
> Acked-by: Simon Glass 

Applied to u-boot-rockchip, thanks!
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH v2] rockchip: rk3188: enable remap function

2017-04-09 Thread Simon Glass
On 5 April 2017 at 16:19, Heiko Stuebner  wrote:
> Most Rockchip socs have the ability to either map the bootrom or a sram
> area to the starting address of the cpu by flipping a bit in the GRF.
>
> Newer socs leave this untouched and mapped to the bootrom but the legacy
> loaders on rk3188 and before enabled the remap functionality and the
> current smp implementation in the Linux kernel also requires it to be
> enabled, to bring up secondary cpus.
>
> So to keep smp working in the kernel, mimic the behaviour of the legacy
> bootloaders and enable the remap functionality.
>
> Signed-off-by: Heiko Stuebner 
> ---
> changes in v2:
> - drop the rk_board_late_init weak function
>   If boards need even more specialized init we can worry
>   about that later.
>
>  arch/arm/mach-rockchip/Kconfig|  1 +
>  arch/arm/mach-rockchip/rk3188-board.c | 18 ++
>  2 files changed, 19 insertions(+)

Acked-by: Simon Glass 
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH v2] rockchip: rk3188: enable remap function

2017-04-05 Thread Heiko Stuebner
Most Rockchip socs have the ability to either map the bootrom or a sram
area to the starting address of the cpu by flipping a bit in the GRF.

Newer socs leave this untouched and mapped to the bootrom but the legacy
loaders on rk3188 and before enabled the remap functionality and the
current smp implementation in the Linux kernel also requires it to be
enabled, to bring up secondary cpus.

So to keep smp working in the kernel, mimic the behaviour of the legacy
bootloaders and enable the remap functionality.

Signed-off-by: Heiko Stuebner 
---
changes in v2:
- drop the rk_board_late_init weak function
  If boards need even more specialized init we can worry
  about that later.

 arch/arm/mach-rockchip/Kconfig|  1 +
 arch/arm/mach-rockchip/rk3188-board.c | 18 ++
 2 files changed, 19 insertions(+)

diff --git a/arch/arm/mach-rockchip/Kconfig b/arch/arm/mach-rockchip/Kconfig
index af0796d1d0..5b4caec953 100644
--- a/arch/arm/mach-rockchip/Kconfig
+++ b/arch/arm/mach-rockchip/Kconfig
@@ -18,6 +18,7 @@ config ROCKCHIP_RK3188
select SUPPORT_TPL
select SPL
select TPL
+   select BOARD_LATE_INIT
select ROCKCHIP_BROM_HELPER
help
  The Rockchip RK3188 is a ARM-based SoC with a quad-core Cortex-A9
diff --git a/arch/arm/mach-rockchip/rk3188-board.c 
b/arch/arm/mach-rockchip/rk3188-board.c
index c370156e4c..4be711e441 100644
--- a/arch/arm/mach-rockchip/rk3188-board.c
+++ b/arch/arm/mach-rockchip/rk3188-board.c
@@ -11,6 +11,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -19,6 +20,23 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
+int board_late_init(void)
+{
+   struct rk3188_grf *grf;
+
+   grf = syscon_get_first_range(ROCKCHIP_SYSCON_GRF);
+   if (IS_ERR(grf)) {
+   error("grf syscon returned %ld\n", PTR_ERR(grf));
+   } else {
+   /* enable noc remap to mimic legacy loaders */
+   rk_clrsetreg(>soc_con0,
+   NOC_REMAP_MASK << NOC_REMAP_SHIFT,
+   NOC_REMAP_MASK << NOC_REMAP_SHIFT);
+   }
+
+   return 0;
+}
+
 int board_init(void)
 {
 #if defined(CONFIG_ROCKCHIP_SPL_BACK_TO_BROM)
-- 
2.11.0

___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot