[U-Boot] [PATCH 0/8] arm-trusted-firmware support for rk3288

Heiko Stuebner heiko at sntech.de
Fri Apr 5 08:30:05 UTC 2019


This adds support for jumping into aarch32 ATF from u-boot spl
similar to how it works on aarch64.

I guess the biggest question might be "why" ;-)

Right now the status quo on Rockchip arm32 socs is, that the linux
kernel itself does smp and suspend handling. This precludes us from
doing fance things like virtualization but also deep suspend with
the DDR in self refresh, due to at least 2 approaches for putting
generalized code into sram from the kernel side failed so far.

For Virtualization we need the kernel to start in hyp mode and hence
needing to use psci for smp handling as well.

So there are multiple ways for achieving that, we could do
- psci in uboot itself is bad for coreboot and barebox who would
  need to reimplement the same
- psci in optee is the solution Rockchip themself choose but only
  provides precompiled binaries for their arm32 socs and also
  reimplmenting this in an open way is somewhat of a dead-end
  because while aarch64 can use op-tee, psci itself is always
  done in the atf
- atf using the somewhat new aarch32 port has the advantage of
  being able to share a lot of platform code making maintenance
  together with the aarch64 parts a lot easier

Not having to rely on binary components as part of the boot process
is way nicer not only for reproducible builds but also for future
proofing projects as binary blobs may not receive updates after
some time.

Also it is still possible to use this together with an optee
implementation for specific security foobar. The only difference
is that while aarch64 can has separate states for secure monitor
and secure-os, in aarch32 both need to share the bl32 space, so
optee needs to be a payload during the atf build. If no secure-os
is needed, atf can use the sp_min payload, which is part of atf.

This works nicely on my rk3288 evb and even virtualization worked
already. Full support will still need a modified devicetree to
actually make use of the new psci capabilites.


Heiko Stuebner (8):
  arm: v7: add read_mpidr function for arm32
  spl: atf: add arm32 variant
  rockchip: rk3288: move TPL options to generic position
  rockchip: rk3288: adjust load addresses
  rockchip: rk3288: reserve first 2MB when build with ATF support
  rockchip: rk3288: split evb into its two entities
  rockchip: rk3288: convert rk3288-evb to use tpl
  rockchip: rk3288: make both evb variants use atf

 arch/arm/dts/Makefile                         |   3 +-
 ...evb.dts => rk3288-evb-act8846-u-boot.dtsi} |  33 +-
 arch/arm/dts/rk3288-evb-act8846.dts           | 188 +++++++
 arch/arm/dts/rk3288-evb-rk808-u-boot.dtsi     |  40 ++
 arch/arm/dts/rk3288-evb-rk808.dts             | 202 +++++++
 arch/arm/dts/rk3288-evb.dtsi                  | 493 ++++++++----------
 arch/arm/include/asm/system.h                 |   9 +
 arch/arm/mach-rockchip/Kconfig                |  16 +
 arch/arm/mach-rockchip/rk3288/Kconfig         |  16 +-
 arch/arm/mach-rockchip/rk3288/rk3288.c        |  16 +
 board/rockchip/evb_rk3288/evb-rk3288.c        |  14 +
 board/rockchip/evb_rk3288/fit_spl_atf.its     |  52 ++
 common/spl/Kconfig                            |   2 +-
 common/spl/spl_atf.c                          |  86 ++-
 ...defconfig => evb-rk3288-act8846_defconfig} |  14 +-
 configs/evb-rk3288-rk808_defconfig            |  91 ++++
 include/atf_common.h                          |  52 ++
 include/configs/rk3288_common.h               |   8 +-
 18 files changed, 998 insertions(+), 337 deletions(-)
 rename arch/arm/dts/{rk3288-evb.dts => rk3288-evb-act8846-u-boot.dtsi} (64%)
 create mode 100644 arch/arm/dts/rk3288-evb-act8846.dts
 create mode 100644 arch/arm/dts/rk3288-evb-rk808-u-boot.dtsi
 create mode 100644 arch/arm/dts/rk3288-evb-rk808.dts
 create mode 100644 board/rockchip/evb_rk3288/fit_spl_atf.its
 rename configs/{evb-rk3288_defconfig => evb-rk3288-act8846_defconfig} (87%)
 create mode 100644 configs/evb-rk3288-rk808_defconfig

-- 
2.20.1



More information about the U-Boot mailing list