[PATCH v2 0/6] ARM: Rockchip: Read amount of memory from DDR controller

Michael Riesch michael.riesch at wolfvision.net
Fri Mar 31 08:42:54 PDT 2023


Hi Sascha,

On 3/28/23 09:40, Sascha Hauer wrote:
> This series adds support for reading the amount of memory from
> the DDR controller. This helps on boards which come with
> different amounts of memory like the Radxa Rock3a.
> 
> This series also fixes issues with an upstream TF-A firmware. With this
> the IRAM where the bootsource is stored is no longer accessible in
> normal mode. We have to read its contents before starting the TF-A.
> For this it became necessary to add a common barebox entry function
> for rk3568, to get a common place to read the IRAM contents.

Nice, thanks for your efforts! Now it should be possible to remove the
memory nodes from arch/arm/dts/rk356*, right?

I tried this on a ROCK3A with 8 GB and the memory calculation returned
the correct result. There are now two ram devices

   `-- mem0
      `-- 0x00000000-0x10fffffff (   4.3 GiB): /dev/ram1
   `-- mem1
      `-- 0x00000000-0xef5fffff (   3.7 GiB): /dev/ram0
   `-- mem2
      `-- 0x00000000-0xffffffffffffffff (   0 Bytes): /dev/mem

that start at SZ_4G and 0xa00000, respectively.

However, after loading the kernel the system hangs:

Loaded kernel to 0x100000000, devicetree at 0x101970000

Is this a bug in barebox or is something special required to boot the
kernel from SZ_4G?

Best regards,
Michael

> 
> Sascha
> 
> Changes since v1:
> - Call relocate_to_adr_full() from board code to make sure the
>   fdt from the relocated binary is used, not from the original
>   binary
> - Add patch to pass a NULL fdt to TF-A
> 
> Ahmad Fatoum (2):
>   ARM: Rockchip: implement memory read out from controller
>   ARM: Rockchip: make bootsource logic generic to all SoCs
> 
> Sascha Hauer (4):
>   ARM: dts: rk356x: Add DMC controller node
>   ARM: Rockchip: Add rk3568 specific barebox entry function
>   ARM: Rockchip: rk3568: use rk3568_barebox_entry()
>   ARM: Rockchip: Do not pass device tree to TF-A
> 
>  arch/arm/boards/pine64-quartz64/lowlevel.c    |  30 +--
>  arch/arm/boards/radxa-rock3/lowlevel.c        |  31 +--
>  .../rockchip-rk3568-bpi-r2pro/lowlevel.c      |  31 +--
>  .../arm/boards/rockchip-rk3568-evb/lowlevel.c |  32 +--
>  arch/arm/dts/rk356x.dtsi                      |   5 +
>  arch/arm/mach-rockchip/Makefile               |   3 +-
>  arch/arm/mach-rockchip/atf.c                  |  34 +++
>  arch/arm/mach-rockchip/bootrom.c              |  51 ++++
>  arch/arm/mach-rockchip/dmc.c                  | 232 ++++++++++++++++++
>  arch/arm/mach-rockchip/rk3568.c               |  29 +--
>  include/bootsource.h                          |   1 +
>  include/linux/sizes.h                         |   3 +
>  include/mach/rockchip/atf.h                   |   2 +
>  include/mach/rockchip/bootrom.h               |  32 +++
>  include/mach/rockchip/dmc.h                   |  86 +++++++
>  include/mach/rockchip/rk3399-regs.h           |   1 +
>  include/mach/rockchip/rk3568-regs.h           |   1 +
>  17 files changed, 469 insertions(+), 135 deletions(-)
>  create mode 100644 arch/arm/mach-rockchip/bootrom.c
>  create mode 100644 arch/arm/mach-rockchip/dmc.c
>  create mode 100644 include/mach/rockchip/bootrom.h
>  create mode 100644 include/mach/rockchip/dmc.h
> 



More information about the barebox mailing list