[U-Boot] [PATCH 1/2] rockchip: sdhci: update reg map for of-platdata

After Simon's patch, the dtoc can work with 64bit address, so we need to fix reg number for it. Depend on Simon's patch set: https://patchwork.ozlabs.org/cover/807266/
Signed-off-by: Kever Yang kever.yang@rock-chips.com ---
drivers/mmc/rockchip_sdhci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/mmc/rockchip_sdhci.c b/drivers/mmc/rockchip_sdhci.c index fd3bb10..a05a422 100644 --- a/drivers/mmc/rockchip_sdhci.c +++ b/drivers/mmc/rockchip_sdhci.c @@ -187,7 +187,7 @@ static int arasan_sdhci_probe(struct udevice *dev) struct dtd_rockchip_rk3399_sdhci_5_1 *dtplat = &plat->dtplat;
host->name = dev->name; - host->ioaddr = map_sysmem(dtplat->reg[1], dtplat->reg[3]); + host->ioaddr = map_sysmem(dtplat->reg[0], dtplat->reg[1]); host->host_caps |= MMC_MODE_8BIT; max_frequency = dtplat->max_frequency; ret = clk_get_by_index_platdata(dev, 0, dtplat->clocks, &clk);

After Simon's patch, the dtoc can work with 64bit address, so we need to fix reg number for it. Depend on Simon's patch set: https://patchwork.ozlabs.org/cover/807266/
Signed-off-by: Kever Yang kever.yang@rock-chips.com ---
drivers/ram/rockchip/sdram_rk3399.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/ram/rockchip/sdram_rk3399.c b/drivers/ram/rockchip/sdram_rk3399.c index 63342ab..5ed4b03 100644 --- a/drivers/ram/rockchip/sdram_rk3399.c +++ b/drivers/ram/rockchip/sdram_rk3399.c @@ -1115,7 +1115,7 @@ static int conv_of_platdata(struct udevice *dev) int ret;
ret = regmap_init_mem_platdata(dev, dtplat->reg, - ARRAY_SIZE(dtplat->reg) / 4, + ARRAY_SIZE(dtplat->reg) / 2, &plat->map); if (ret) return ret;

Kever,
Thanks for the fix.
Could we move all RK3399 boards to use OF_CONTROL (i.e. not OF_PLATDATA) in SPL? We have been using this for the RK3399-Q7 and there is plenty of SRAM left for future code-growth, so this should be a safe choice.
Regards, Philipp.
On 7 Sep 2017, at 05:20, Kever Yang kever.yang@rock-chips.com wrote:
After Simon's patch, the dtoc can work with 64bit address, so we need to fix reg number for it. Depend on Simon's patch set: https://patchwork.ozlabs.org/cover/807266/
Signed-off-by: Kever Yang kever.yang@rock-chips.com
Reviewed-by: Philipp Tomsich philipp.tomsich@theobroma-systems.com
drivers/ram/rockchip/sdram_rk3399.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/ram/rockchip/sdram_rk3399.c b/drivers/ram/rockchip/sdram_rk3399.c index 63342ab..5ed4b03 100644 --- a/drivers/ram/rockchip/sdram_rk3399.c +++ b/drivers/ram/rockchip/sdram_rk3399.c @@ -1115,7 +1115,7 @@ static int conv_of_platdata(struct udevice *dev) int ret;
ret = regmap_init_mem_platdata(dev, dtplat->reg,
ARRAY_SIZE(dtplat->reg) / 4,
if (ret) return ret;ARRAY_SIZE(dtplat->reg) / 2, &plat->map);
-- 1.9.1

Philipp,
We already enable CONFIG_SPL_OF_CONTROL for all rk3399 board, right?
For OF_PLATDATA, I would prefer there always have a option to use for speed up the boot time, not only for ram size.
Thanks, - Kever On 09/07/2017 04:51 PM, Dr. Philipp Tomsich wrote:
Kever,
Thanks for the fix.
Could we move all RK3399 boards to use OF_CONTROL (i.e. not OF_PLATDATA) in SPL? We have been using this for the RK3399-Q7 and there is plenty of SRAM left for future code-growth, so this should be a safe choice.
Regards, Philipp.
On 7 Sep 2017, at 05:20, Kever Yang kever.yang@rock-chips.com wrote:
After Simon's patch, the dtoc can work with 64bit address, so we need to fix reg number for it. Depend on Simon's patch set: https://patchwork.ozlabs.org/cover/807266/
Signed-off-by: Kever Yang kever.yang@rock-chips.com
Reviewed-by: Philipp Tomsich philipp.tomsich@theobroma-systems.com
drivers/ram/rockchip/sdram_rk3399.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/ram/rockchip/sdram_rk3399.c b/drivers/ram/rockchip/sdram_rk3399.c index 63342ab..5ed4b03 100644 --- a/drivers/ram/rockchip/sdram_rk3399.c +++ b/drivers/ram/rockchip/sdram_rk3399.c @@ -1115,7 +1115,7 @@ static int conv_of_platdata(struct udevice *dev) int ret;
ret = regmap_init_mem_platdata(dev, dtplat->reg,
ARRAY_SIZE(dtplat->reg) / 4,
if (ret) return ret;ARRAY_SIZE(dtplat->reg) / 2, &plat->map);
-- 1.9.1

On 8 Sep 2017, at 04:46, Kever Yang kever.yang@rock-chips.com wrote:
Philipp,
We already enable CONFIG_SPL_OF_CONTROL for all rk3399 board, right?
I meant “full OF_CONTROL” as opposed to “OF_PLATDATA” (which is dependent of OF_CONTROL, but is intended as a stopgap measure).
For OF_PLATDATA, I would prefer there always have a option to use for speed up the boot time, not only for ram size.
I had discussed that with Simon recently and he views OF_PLATDATA as a last resort to be used, when there is not enough memory for full OF_CONTROL.
Thanks,
- Kever
On 09/07/2017 04:51 PM, Dr. Philipp Tomsich wrote:
Kever,
Thanks for the fix.
Could we move all RK3399 boards to use OF_CONTROL (i.e. not OF_PLATDATA) in SPL? We have been using this for the RK3399-Q7 and there is plenty of SRAM left for future code-growth, so this should be a safe choice.
Regards, Philipp.
On 7 Sep 2017, at 05:20, Kever Yang kever.yang@rock-chips.com wrote:
After Simon's patch, the dtoc can work with 64bit address, so we need to fix reg number for it. Depend on Simon's patch set: https://patchwork.ozlabs.org/cover/807266/
Signed-off-by: Kever Yang kever.yang@rock-chips.com
Reviewed-by: Philipp Tomsich philipp.tomsich@theobroma-systems.com
drivers/ram/rockchip/sdram_rk3399.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/ram/rockchip/sdram_rk3399.c b/drivers/ram/rockchip/sdram_rk3399.c index 63342ab..5ed4b03 100644 --- a/drivers/ram/rockchip/sdram_rk3399.c +++ b/drivers/ram/rockchip/sdram_rk3399.c @@ -1115,7 +1115,7 @@ static int conv_of_platdata(struct udevice *dev) int ret;
ret = regmap_init_mem_platdata(dev, dtplat->reg,
ARRAY_SIZE(dtplat->reg) / 4,
if (ret) return ret;ARRAY_SIZE(dtplat->reg) / 2, &plat->map);
-- 1.9.1

Hi Kever,
On 8 September 2017 at 01:34, Dr. Philipp Tomsich philipp.tomsich@theobroma-systems.com wrote:
On 8 Sep 2017, at 04:46, Kever Yang kever.yang@rock-chips.com wrote:
Philipp,
We already enable CONFIG_SPL_OF_CONTROL for all rk3399 board, right?
I meant “full OF_CONTROL” as opposed to “OF_PLATDATA” (which is dependent of OF_CONTROL, but is intended as a stopgap measure).
For OF_PLATDATA, I would prefer there always have a option to use for speed up the boot time, not only for ram size.
I had discussed that with Simon recently and he views OF_PLATDATA as a last resort to be used, when there is not enough memory for full OF_CONTROL.
Can you use bootstage to measure the boot time impact?
Regards, Simon

Hi Simon,
On 09/08/2017 08:17 PM, Simon Glass wrote:
Hi Kever,
On 8 September 2017 at 01:34, Dr. Philipp Tomsich philipp.tomsich@theobroma-systems.com wrote:
On 8 Sep 2017, at 04:46, Kever Yang kever.yang@rock-chips.com wrote:
Philipp,
We already enable CONFIG_SPL_OF_CONTROL for all rk3399 board, right?
I meant “full OF_CONTROL” as opposed to “OF_PLATDATA” (which is dependent of OF_CONTROL, but is intended as a stopgap measure).
For OF_PLATDATA, I would prefer there always have a option to use for
speed up the boot time, not only for ram size.
I had discussed that with Simon recently and he views OF_PLATDATA as a last resort to be used, when there is not enough memory for full OF_CONTROL.
Can you use bootstage to measure the boot time impact?
I think I have do the statistics before with the timer instead of bootstage. And here is the result I got with bootstage(with little change in spl to move secure_timer_init() before spl_early_init()):
The mark of end_spl: With of-pladata: 205952 205864 205857 without of-platdata: 279520 279495 279508
The difference is about 75ms.
BTW: bug1: there is no timer_get_boot_us() in armv8, bug2: there is something wrong with "dm_spl", it use bootstage_start() + bootstage_accum() instead of bootstage_mark_name(), the "board_init_f" will replace it, maybe some tag is not correct.
Thanks, - Kever
Regards, Simon

Hi Kever,
On 11 September 2017 at 02:17, Kever Yang kever.yang@rock-chips.com wrote:
Hi Simon,
On 09/08/2017 08:17 PM, Simon Glass wrote:
Hi Kever,
On 8 September 2017 at 01:34, Dr. Philipp Tomsich philipp.tomsich@theobroma-systems.com wrote:
On 8 Sep 2017, at 04:46, Kever Yang kever.yang@rock-chips.com wrote:
Philipp,
We already enable CONFIG_SPL_OF_CONTROL for all rk3399 board, right?
I meant “full OF_CONTROL” as opposed to “OF_PLATDATA” (which is dependent of OF_CONTROL, but is intended as a stopgap measure).
For OF_PLATDATA, I would prefer there always have a option to use
for speed up the boot time, not only for ram size.
I had discussed that with Simon recently and he views OF_PLATDATA as a last resort to be used, when there is not enough memory for full OF_CONTROL.
Can you use bootstage to measure the boot time impact?
I think I have do the statistics before with the timer instead of bootstage. And here is the result I got with bootstage(with little change in spl to move secure_timer_init() before spl_early_init()):
The mark of end_spl: With of-pladata: 205952 205864 205857 without of-platdata: 279520 279495 279508
The difference is about 75ms.
That is enough to justify using of-platdata here. I am not sure why the difference is so large though.
BTW: bug1: there is no timer_get_boot_us() in armv8, bug2: there is something wrong with "dm_spl", it use bootstage_start() + bootstage_accum() instead of bootstage_mark_name(), the "board_init_f" will replace it, maybe some tag is not correct.
OK. Do you think you could send patches to fix these?
Regards, Simon

Kever & Simon,
On 12 Sep 2017, at 14:30, Simon Glass sjg@chromium.org wrote:
Hi Kever,
On 11 September 2017 at 02:17, Kever Yang <kever.yang@rock-chips.com mailto:kever.yang@rock-chips.com> wrote:
Hi Simon,
On 09/08/2017 08:17 PM, Simon Glass wrote:
Hi Kever,
On 8 September 2017 at 01:34, Dr. Philipp Tomsich philipp.tomsich@theobroma-systems.com wrote:
On 8 Sep 2017, at 04:46, Kever Yang kever.yang@rock-chips.com wrote:
Philipp,
We already enable CONFIG_SPL_OF_CONTROL for all rk3399 board, right?
I meant “full OF_CONTROL” as opposed to “OF_PLATDATA” (which is dependent of OF_CONTROL, but is intended as a stopgap measure).
For OF_PLATDATA, I would prefer there always have a option to use for speed up the boot time, not only for ram size.
I had discussed that with Simon recently and he views OF_PLATDATA as a last resort to be used, when there is not enough memory for full OF_CONTROL.
Can you use bootstage to measure the boot time impact?
I think I have do the statistics before with the timer instead of bootstage. And here is the result I got with bootstage(with little change in spl to move secure_timer_init() before spl_early_init()):
The mark of end_spl: With of-pladata: 205952 205864 205857 without of-platdata: 279520 279495 279508
The difference is about 75ms.
That is enough to justify using of-platdata here. I am not sure why the difference is so large though.
I have noticed that the RK3399 U-Boot code does not clock up the boot CPU (i.e. rk3399_configure_cpu() is never called).
Could this be the reason for the large difference?
BTW: bug1: there is no timer_get_boot_us() in armv8, bug2: there is something wrong with "dm_spl", it use bootstage_start() + bootstage_accum() instead of bootstage_mark_name(), the "board_init_f" will replace it, maybe some tag is not correct.
OK. Do you think you could send patches to fix these?
I woul prefer if we could move the timer-code away from the generic timer and start using Rockchip-specific DM-timer drivers. This will make the U-Boot code independent of the initialisation of the secure-timer block…
Regards, Simon

After Simon's patch, the dtoc can work with 64bit address, so we need to fix reg number for it. Depend on Simon's patch set: https://patchwork.ozlabs.org/cover/807266/
Signed-off-by: Kever Yang kever.yang@rock-chips.com Reviewed-by: Philipp Tomsich philipp.tomsich@theobroma-systems.com
drivers/ram/rockchip/sdram_rk3399.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Acked-by: Philipp Tomsich philipp.tomsich@theobroma-systems.com

After Simon's patch, the dtoc can work with 64bit address, so we need to fix reg number for it. Depend on Simon's patch set: https://patchwork.ozlabs.org/cover/807266/
Signed-off-by: Kever Yang kever.yang@rock-chips.com Reviewed-by: Philipp Tomsich philipp.tomsich@theobroma-systems.com Acked-by: Philipp Tomsich philipp.tomsich@theobroma-systems.com
drivers/ram/rockchip/sdram_rk3399.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Reviewed-by: Philipp Tomsich philipp.tomsich@theobroma-systems.com

After Simon's patch, the dtoc can work with 64bit address, so we need to fix reg number for it. Depend on Simon's patch set: https://patchwork.ozlabs.org/cover/807266/
Signed-off-by: Kever Yang kever.yang@rock-chips.com Reviewed-by: Philipp Tomsich philipp.tomsich@theobroma-systems.com Acked-by: Philipp Tomsich philipp.tomsich@theobroma-systems.com Reviewed-by: Philipp Tomsich philipp.tomsich@theobroma-systems.com
drivers/ram/rockchip/sdram_rk3399.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Applied to u-boot-rockchip, thanks!

After Simon's patch, the dtoc can work with 64bit address, so we need to fix reg number for it. Depend on Simon's patch set: https://patchwork.ozlabs.org/cover/807266/
Signed-off-by: Kever Yang kever.yang@rock-chips.com
drivers/mmc/rockchip_sdhci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Acked-by: Philipp Tomsich philipp.tomsich@theobroma-systems.com

After Simon's patch, the dtoc can work with 64bit address, so we need to fix reg number for it. Depend on Simon's patch set: https://patchwork.ozlabs.org/cover/807266/
Signed-off-by: Kever Yang kever.yang@rock-chips.com Acked-by: Philipp Tomsich philipp.tomsich@theobroma-systems.com
drivers/mmc/rockchip_sdhci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Reviewed-by: Philipp Tomsich philipp.tomsich@theobroma-systems.com

After Simon's patch, the dtoc can work with 64bit address, so we need to fix reg number for it. Depend on Simon's patch set: https://patchwork.ozlabs.org/cover/807266/
Signed-off-by: Kever Yang kever.yang@rock-chips.com Acked-by: Philipp Tomsich philipp.tomsich@theobroma-systems.com Reviewed-by: Philipp Tomsich philipp.tomsich@theobroma-systems.com
drivers/mmc/rockchip_sdhci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Applied to u-boot-rockchip, thanks!
participants (4)
-
Dr. Philipp Tomsich
-
Kever Yang
-
Philipp Tomsich
-
Simon Glass