mbox series

[U-Boot,v2,0/6] pico-imx7d: Add support for BL33 case

Message ID 1553761801-2489-1-git-send-email-jun.nie@linaro.org
Headers show
Series pico-imx7d: Add support for BL33 case | expand

Message

Jun Nie March 28, 2019, 8:29 a.m. UTC
Add configuration to boot U-boot as BL33 case. The boot flow
is ATF -> OPTEE -> U-boot.

Changes vs V1:
- Remove DCD file.
- Add a patch to fix uart clock root ID.
- Change file name from pico-pi-imx7d_bl33_defconfig to pico-imx7d_bl33_defconfig

Jun Nie (6):
  mx7_common: Share configs to skip low level init
  imx: mx7: Add empty arch_cpu_init if skipped
  pico-imx7d: Reserve region of memory to OPTEE
  pico-imx7d: Add boot option for verified boot
  pico-imx7d: Add bl33 config
  pico-imx7d: Correct uart clock root

 arch/arm/include/asm/arch-mx7/clock.h    |  5 +++
 arch/arm/mach-imx/mx7/clock.c            |  2 +-
 arch/arm/mach-imx/mx7/soc.c              |  4 +++
 board/technexion/pico-imx7d/pico-imx7d.c |  5 +++
 configs/pico-imx7d_bl33_defconfig        | 61 ++++++++++++++++++++++++++++++++
 include/configs/mx7_common.h             | 11 ++++++
 include/configs/pico-imx7d.h             | 39 ++++++++++++++++++--
 include/configs/warp7.h                  | 11 ------
 8 files changed, 123 insertions(+), 15 deletions(-)
 create mode 100644 configs/pico-imx7d_bl33_defconfig

Comments

Otavio Salvador March 28, 2019, 12:57 p.m. UTC | #1
On Thu, Mar 28, 2019 at 5:30 AM Jun Nie <jun.nie@linaro.org> wrote:
>
> Add configuration to boot U-boot as BL33 case. The boot flow
> is ATF -> OPTEE -> U-boot.

Could you add a README explaining how to use / test it?
Jun Nie April 3, 2019, 11:47 a.m. UTC | #2
Otavio Salvador <otavio.salvador@ossystems.com.br> 于2019年3月28日周四 下午8:57写道:
>
> On Thu, Mar 28, 2019 at 5:30 AM Jun Nie <jun.nie@linaro.org> wrote:
> >
> > Add configuration to boot U-boot as BL33 case. The boot flow
> > is ATF -> OPTEE -> U-boot.
>
> Could you add a README explaining how to use / test it?

Hi Otavio,

Below is draft of README. some of command may not be accurate because I am
on travel and cannot access latest code in my PC in home. If you are
OK with idea
in it, I will polish it later. The SPL is built but not used because
the BL33 is loaded
by ATF while ATF exist in SRAM. ATF cannot load SPL into SRAM to
override itself.


README.pico-imx7d_BL33
This document describes the instruction to build ATF/OPTEE and flash eMMC on
pico-imx7d board.  U-Boot is loaded by ATF/OPTEE in this setup.

- Build u-boot
    # set environment variable of CROSS_COMPILE for your toolchain and ARCH=arm
    make pico-pi-imx7d-mbl_defconfig
    make all

- Download and build OPTEE
    git clone https://git.linaro.org/landing-teams/working/mbl/optee_os.git
-b linaro-pico
    make PLATFORM=imx PLATFORM_FLAVOR=mx7dpico_mbl ARCH=arm

- Download and build ATF, create FIP image
    git clone https://git.linaro.org/landing-teams/working/mbl/arm-trusted-firmware.git
-b linaro-imx7
    make DEBUG=1 PLAT=picopi ARCH=aarch32 ARM_ARCH_MAJOR=7
CROSS_COMPILE=arm-linux-gnueabihf- LOG_LEVEL=50 V=1 CRASH_REPORTING=1
AARCH32_SP=optee all
    wget http://git.linaro.org/landing-teams/working/mbl/u-boot.git/tree/board/technexion/pico-imx7d/pico-imx7d.cfg?h=linaro-imx
    mkimage -n pico-imx7d.cfg -T imximage -e 0x87800000 -d -d
build/picopi/debug/bl2.bin bl2.imx
    # create a  fiptool_images/ folder under atf folder, copy
u-boot.bin in u-boot folder and tee*.bin in optee core/tee/ folder to
fiptool_images. Run below command to generate FIP image.
    tools/fiptool/fiptool create --tos-fw fiptool_images/tee-header_v2.bin \
    --tos-fw-extra1 fiptool_images/tee-pager_v2.bin \
    --tos-fw-extra2 fiptool_images/tee-pageable_v2.bin \
    --nt-fw fiptool_images/u-boot.bin \
    fip.bin

- Burn the images to eMMC for test.
    # Run below command in atf folder:
    dd if=build/picopi/debug/bl2.bin.imx of=/dev/disk/by-id/usb-<your
device>  bs=1024 seek=1;sync
    dd if=fip.bin of=/dev/disk/by-id/usb-<your device>  bs=1024 seek=1;sync

- Test
    Just boot up your board and wait for u-boot start up after ATF's
log. For booting Linux in FIT image, please reference the FIT files in
u-boot doc/uImage.FIT/ folder.


>
>
> --
> Otavio Salvador                             O.S. Systems
> http://www.ossystems.com.br        http://code.ossystems.com.br
> Mobile: +55 (53) 9 9981-7854          Mobile: +1 (347) 903-9750
Jun Nie April 3, 2019, noon UTC | #3
Hi Otavio,

And for the file name pico-imx7d_bl33_defconfig,
pico-pi-imx7d_bl33_defconfig should be better in my later thought.
Because a concrete device tree source file should be specified in
defconfig file, so that public key can be stored in u-boot FDT blob
for kernel/initramfs FIT signature verification. What's your comments?

Thanks!
Jun
Otavio Salvador April 4, 2019, 12:40 p.m. UTC | #4
On Wed, Apr 3, 2019 at 9:00 AM Jun Nie <jun.nie@linaro.org> wrote:
> And for the file name pico-imx7d_bl33_defconfig,
> pico-pi-imx7d_bl33_defconfig should be better in my later thought.
> Because a concrete device tree source file should be specified in
> defconfig file, so that public key can be stored in u-boot FDT blob
> for kernel/initramfs FIT signature verification. What's your comments?

The FIT image might have them all, no? It would allow a single binary
to work on all baseboards, giving a very nice user experience.
Jun Nie April 10, 2019, 2:16 a.m. UTC | #5
Otavio Salvador <otavio.salvador@ossystems.com.br> 于2019年4月4日周四 下午8:40写道:
>
> On Wed, Apr 3, 2019 at 9:00 AM Jun Nie <jun.nie@linaro.org> wrote:
> > And for the file name pico-imx7d_bl33_defconfig,
> > pico-pi-imx7d_bl33_defconfig should be better in my later thought.
> > Because a concrete device tree source file should be specified in
> > defconfig file, so that public key can be stored in u-boot FDT blob
> > for kernel/initramfs FIT signature verification. What's your comments?
>
> The FIT image might have them all, no? It would allow a single binary
> to work on all baseboards, giving a very nice user experience.

The FIT image have all device trees. I mean the device tree for u-boot should
be specified. As device trees are copied from kernel, while there is
no dts file for
pico-imx7d. It is a bit peculiar if you specify device tree as pico-pi-imx7d in
pico-imx7d_bl33_defconfig.

>
> --
> Otavio Salvador                             O.S. Systems
> http://www.ossystems.com.br        http://code.ossystems.com.br
> Mobile: +55 (53) 9 9981-7854          Mobile: +1 (347) 903-9750