mbox series

[v2,0/2] rockchip: Update stack and bss addresses on RK3328 and RK3399

Message ID 20240217005817.2150377-1-jonas@kwiboo.se
Headers show
Series rockchip: Update stack and bss addresses on RK3328 and RK3399 | expand

Message

Jonas Karlman Feb. 17, 2024, 12:58 a.m. UTC
With the stack and text base used by U-Boot SPL and proper on RK3328 and
RK3399 there is a high likelihood of overlapping when U-Boot proper +
FDT nears 1 MiB in size.

Trying to run U-Boot proper close to 1 MiB in size with debug logging
something similar to following can be observed:

  FDT 00000000002fc4e0 gd 00000000002fddf0
  FDT overlap
  resetting ...
  System reset not supported on this platform
  ### ERROR ### Please RESET the board ###

Fix this by changing stack and bss addresses used on RK3328 and RK3399.
The addresses chosen for stack and bss is a combination from both boards.

Changes in v2:
- Rebase on v2 of "rockchip: rk3328: Update defconfigs, DTs and enable
  boot from SPI" [1]
- Use correct address 0x04000000 for 64 MiB offset in commit message
- Collect r-b tag

This series depends on v2 of the following two series:
- rockchip: rk3328: Update defconfigs, DTs and enable boot from SPI [1]
- rockchip: Read cpuid and generate MAC address from efuse for RK3328
  and RK3399 [2]

A copy of this series and its two depends can be found at [3].

[1] https://patchwork.ozlabs.org/cover/1900345/
[2] https://patchwork.ozlabs.org/cover/1897743/
[3] https://github.com/Kwiboo/u-boot-rockchip/commits/rk3328-update-v2

Jonas Karlman (2):
  rockchip: rk3328: Update stack addresses
  rockchip: rk3399: Update stack and bss addresses

 arch/arm/mach-rockchip/rk3328/Kconfig         | 2 +-
 configs/chromebook_bob_defconfig              | 2 +-
 configs/chromebook_kevin_defconfig            | 2 +-
 configs/eaidk-610-rk3399_defconfig            | 4 ++--
 configs/evb-rk3328_defconfig                  | 4 +---
 configs/evb-rk3399_defconfig                  | 4 ++--
 configs/ficus-rk3399_defconfig                | 2 +-
 configs/firefly-rk3399_defconfig              | 4 ++--
 configs/khadas-edge-captain-rk3399_defconfig  | 4 ++--
 configs/khadas-edge-rk3399_defconfig          | 4 ++--
 configs/khadas-edge-v-rk3399_defconfig        | 4 ++--
 configs/leez-rk3399_defconfig                 | 4 ++--
 configs/nanopc-t4-rk3399_defconfig            | 4 ++--
 configs/nanopi-m4-2gb-rk3399_defconfig        | 4 ++--
 configs/nanopi-m4-rk3399_defconfig            | 4 ++--
 configs/nanopi-m4b-rk3399_defconfig           | 4 ++--
 configs/nanopi-neo4-rk3399_defconfig          | 4 ++--
 configs/nanopi-r2c-plus-rk3328_defconfig      | 4 ++--
 configs/nanopi-r2c-rk3328_defconfig           | 4 ++--
 configs/nanopi-r2s-rk3328_defconfig           | 4 ++--
 configs/nanopi-r4s-rk3399_defconfig           | 4 ++--
 configs/orangepi-r1-plus-lts-rk3328_defconfig | 4 ++--
 configs/orangepi-r1-plus-rk3328_defconfig     | 4 ++--
 configs/orangepi-rk3399_defconfig             | 4 ++--
 configs/pinebook-pro-rk3399_defconfig         | 4 ++--
 configs/pinephone-pro-rk3399_defconfig        | 4 ++--
 configs/puma-rk3399_defconfig                 | 2 +-
 configs/roc-cc-rk3328_defconfig               | 4 ++--
 configs/roc-pc-mezzanine-rk3399_defconfig     | 4 ++--
 configs/roc-pc-rk3399_defconfig               | 4 ++--
 configs/rock-4c-plus-rk3399_defconfig         | 4 ++--
 configs/rock-4se-rk3399_defconfig             | 4 ++--
 configs/rock-pi-4-rk3399_defconfig            | 4 ++--
 configs/rock-pi-4c-rk3399_defconfig           | 4 ++--
 configs/rock-pi-e-rk3328_defconfig            | 4 +---
 configs/rock-pi-n10-rk3399pro_defconfig       | 4 ++--
 configs/rock64-rk3328_defconfig               | 4 ++--
 configs/rock960-rk3399_defconfig              | 4 ++--
 configs/rockpro64-rk3399_defconfig            | 4 ++--
 39 files changed, 71 insertions(+), 75 deletions(-)

Comments

Jonas Karlman Feb. 18, 2024, 9:54 p.m. UTC | #1
Hi all,

Please ignore this series for now.

The simple malloc heap created on the SPL init stack is still in use
after SPL relocation, so memory layout needs to rearranged once more.

Also the RK35xx boards is affected by a simple malloc heap and stack
overlap issue.

I will re-send a different version once I have addressed these issues.

Regards,
Jonas

On 2024-02-17 01:58, Jonas Karlman wrote:
> With the stack and text base used by U-Boot SPL and proper on RK3328 and
> RK3399 there is a high likelihood of overlapping when U-Boot proper +
> FDT nears 1 MiB in size.
> 
> Trying to run U-Boot proper close to 1 MiB in size with debug logging
> something similar to following can be observed:
> 
>   FDT 00000000002fc4e0 gd 00000000002fddf0
>   FDT overlap
>   resetting ...
>   System reset not supported on this platform
>   ### ERROR ### Please RESET the board ###
> 
> Fix this by changing stack and bss addresses used on RK3328 and RK3399.
> The addresses chosen for stack and bss is a combination from both boards.
> 
> Changes in v2:
> - Rebase on v2 of "rockchip: rk3328: Update defconfigs, DTs and enable
>   boot from SPI" [1]
> - Use correct address 0x04000000 for 64 MiB offset in commit message
> - Collect r-b tag
> 
> This series depends on v2 of the following two series:
> - rockchip: rk3328: Update defconfigs, DTs and enable boot from SPI [1]
> - rockchip: Read cpuid and generate MAC address from efuse for RK3328
>   and RK3399 [2]
> 
> A copy of this series and its two depends can be found at [3].
> 
> [1] https://patchwork.ozlabs.org/cover/1900345/
> [2] https://patchwork.ozlabs.org/cover/1897743/
> [3] https://github.com/Kwiboo/u-boot-rockchip/commits/rk3328-update-v2
> 
> Jonas Karlman (2):
>   rockchip: rk3328: Update stack addresses
>   rockchip: rk3399: Update stack and bss addresses
> 
>  arch/arm/mach-rockchip/rk3328/Kconfig         | 2 +-
>  configs/chromebook_bob_defconfig              | 2 +-
>  configs/chromebook_kevin_defconfig            | 2 +-
>  configs/eaidk-610-rk3399_defconfig            | 4 ++--
>  configs/evb-rk3328_defconfig                  | 4 +---
>  configs/evb-rk3399_defconfig                  | 4 ++--
>  configs/ficus-rk3399_defconfig                | 2 +-
>  configs/firefly-rk3399_defconfig              | 4 ++--
>  configs/khadas-edge-captain-rk3399_defconfig  | 4 ++--
>  configs/khadas-edge-rk3399_defconfig          | 4 ++--
>  configs/khadas-edge-v-rk3399_defconfig        | 4 ++--
>  configs/leez-rk3399_defconfig                 | 4 ++--
>  configs/nanopc-t4-rk3399_defconfig            | 4 ++--
>  configs/nanopi-m4-2gb-rk3399_defconfig        | 4 ++--
>  configs/nanopi-m4-rk3399_defconfig            | 4 ++--
>  configs/nanopi-m4b-rk3399_defconfig           | 4 ++--
>  configs/nanopi-neo4-rk3399_defconfig          | 4 ++--
>  configs/nanopi-r2c-plus-rk3328_defconfig      | 4 ++--
>  configs/nanopi-r2c-rk3328_defconfig           | 4 ++--
>  configs/nanopi-r2s-rk3328_defconfig           | 4 ++--
>  configs/nanopi-r4s-rk3399_defconfig           | 4 ++--
>  configs/orangepi-r1-plus-lts-rk3328_defconfig | 4 ++--
>  configs/orangepi-r1-plus-rk3328_defconfig     | 4 ++--
>  configs/orangepi-rk3399_defconfig             | 4 ++--
>  configs/pinebook-pro-rk3399_defconfig         | 4 ++--
>  configs/pinephone-pro-rk3399_defconfig        | 4 ++--
>  configs/puma-rk3399_defconfig                 | 2 +-
>  configs/roc-cc-rk3328_defconfig               | 4 ++--
>  configs/roc-pc-mezzanine-rk3399_defconfig     | 4 ++--
>  configs/roc-pc-rk3399_defconfig               | 4 ++--
>  configs/rock-4c-plus-rk3399_defconfig         | 4 ++--
>  configs/rock-4se-rk3399_defconfig             | 4 ++--
>  configs/rock-pi-4-rk3399_defconfig            | 4 ++--
>  configs/rock-pi-4c-rk3399_defconfig           | 4 ++--
>  configs/rock-pi-e-rk3328_defconfig            | 4 +---
>  configs/rock-pi-n10-rk3399pro_defconfig       | 4 ++--
>  configs/rock64-rk3328_defconfig               | 4 ++--
>  configs/rock960-rk3399_defconfig              | 4 ++--
>  configs/rockpro64-rk3399_defconfig            | 4 ++--
>  39 files changed, 71 insertions(+), 75 deletions(-)
>