imx: HAB: Update hab codes to support ARM64 and i.MX8M
authorPeng Fan <peng.fan@nxp.com>
Thu, 25 Mar 2021 09:30:07 +0000 (17:30 +0800)
committerStefano Babic <sbabic@denx.de>
Thu, 8 Apr 2021 07:18:29 +0000 (09:18 +0200)
commit507da978fa0a09874b5b154bec5521688d9660d8
tree97baeee6cf7a2efe16dbac56f3ade00353e7c4e2
parentc428ca80c298df55db242571d868dae7b475ccb5
imx: HAB: Update hab codes to support ARM64 and i.MX8M

There are some changes to support ARM64 i.MX8M platform in this patches:
1. The hab_rvt base and function vectors are different as i.MX6/7

2. Need to bypass an workaround for i.MX6 to fix problem in MMU.

3. The x18 register needed save & restore before calling any HAB API. According
   to ARM procedure call spec, the x18 is caller saved when it is used as
   temporary register. So calling HAB API may scratch this register, and
   cause crash once accessing the gd pointer.

   On ARMv7, the r9 is callee saved when it is used as variable register. So
   no need to save & restore it.

4. Add SEC_CONFIG fuse for iMX8M

When current EL is not EL3, the direct calling to HAB will fail because
CAAM/SNVS can't initialize at non-secure mode. In this case, we use
SIP call to run the HAB in ATF.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
arch/arm/include/asm/mach-imx/hab.h
arch/arm/mach-imx/hab.c