u-boot/arch/arm
Bryan O'Donoghue c5800b2541 arm: imx: hab: Fix authenticate_image input parameters
u-boot command "hab_auth_img" tells a user that it takes

- addr - image hex address
- offset - hex offset of IVT in the image

but in fact the callback hab_auth_img makes to authenticate_image treats
the second 'offset' parameter as an image length.

Furthermore existing code requires the IVT header to be appended to the end
of the image which is not actually a requirement of HABv4.

This patch fixes this situation by

1: Adding a new parameter to hab_auth_img
   - addr   : image hex address
   - length : total length of the image
   - offset : offset of IVT from addr

2: Updates the existing call into authenticate_image() in
   arch/arm/mach-imx/spl.c:jump_to_image_no_args() to pass
   addr, length and IVT offset respectively.

This allows then hab_auth_img to actually operate the way it was specified
in the help text and should still allow existing code to work.

It has the added advantage that the IVT header doesn't have to be appended
to an image given to HAB - it can be prepended for example.

Note prepending the IVT is what u-boot will do when making an IVT for the
BootROM. It should be possible for u-boot properly authenticate images
made by mkimage via HAB.

This patch is the first step in making that happen subsequent patches will
focus on removing hard-coded offsets to the IVT, which again is not
mandated to live at the end of a .imx image.

Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Cc: Stefano Babic <sbabic@denx.de>
Cc: Fabio Estevam <fabio.estevam@nxp.com>
Cc: Peng Fan <peng.fan@nxp.com>
Cc: Albert Aribaud <albert.u.boot@aribaud.net>
Cc: Sven Ebenfeld <sven.ebenfeld@gmail.com>
Cc: George McCollister <george.mccollister@gmail.com>
Cc: Breno Matheus Lima <brenomatheus@gmail.com>
Tested-by: Breno Lima <breno.lima@nxp.com>
Reviewed-by: Fabio Estevam <fabio.estevam@nxp.com>
2018-01-14 17:26:30 +01:00
..
cpu Merge git://git.denx.de/u-boot-fsl-qoriq 2018-01-11 11:18:49 -05:00
dts imx: mx6ull-14x14-evk: enable DM QSPI driver 2018-01-12 14:28:04 +01:00
include arm: imx: hab: Fix authenticate_image input parameters 2018-01-14 17:26:30 +01:00
lib arm: Add support of updating dts before fix-up 2017-12-24 12:42:50 -07:00
mach-aspeed aspeed: Refactor SCU to use consistent mask & shift 2017-05-08 11:57:35 -04:00
mach-at91 board: laird: add WB50N CPU module 2017-11-29 22:36:59 -05:00
mach-bcm283x add support for Raspberry Pi Zero W 2017-12-04 09:59:02 -05:00
mach-davinci ARM: davinci: Remove CONFIG_SOC_DA830 2017-09-15 12:35:48 -04:00
mach-exynos usb: net: migrate USB Ethernet adapters to Kconfig 2017-09-08 10:23:00 -04:00
mach-highbank
mach-imx arm: imx: hab: Fix authenticate_image input parameters 2018-01-14 17:26:30 +01:00
mach-integrator env: Convert CONFIG_ENV_IS_IN... to a choice 2017-08-15 20:50:01 -04:00
mach-keystone env: Rename getenv/_f() to env_get() 2017-08-16 08:30:24 -04:00
mach-kirkwood ata: Migrate CONFIG_MVSATA_IDE to Kconfig 2017-12-12 18:16:06 -05:00
mach-meson ARM: arch-meson: fix writel arguments order 2017-12-18 13:06:30 -05:00
mach-mvebu arm: mvebu: enable boot from NAND 2017-11-30 08:30:27 +01:00
mach-omap2 mach-omap2: add AM335x Display PLL register definition 2018-01-11 15:16:34 +01:00
mach-orion5x spl: add hierarchical defaults for SPL_LDSCRIPT 2017-08-13 17:12:37 +02:00
mach-qemu ARM: Add a new arch + board for QEMU's 'virt' machine 2017-10-06 11:28:16 -04:00
mach-rmobile ARM: rmobile: Add R8A77995 D3 Draak board 2017-12-09 13:36:27 +01:00
mach-rockchip rockchip: rk3288: enable rockusb support on rk3288 based device 2018-01-10 11:11:06 +01:00
mach-s5pc1xx arm: s5pc1xx: move SoC to mach-s5pc1xx 2015-11-30 17:17:01 +09:00
mach-snapdragon dm: Rename dev_addr..() functions 2017-06-01 07:03:01 -06:00
mach-socfpga arm: socfpga: Guard commands with CONFIG_SPL_BUILD tests 2018-01-09 12:38:55 +01:00
mach-sti board: Add STMicroelectronics STiH410-B2260 support 2017-03-14 20:40:21 -04:00
mach-stm32 board: stm32: add stm32f469-discovery board support 2018-01-10 08:05:47 -05:00
mach-sunxi sunxi: set the default CPUx frequency of H5 to 816MHz 2017-12-02 21:55:25 +05:30
mach-tegra binman: tegra: Convert to use binman 2017-12-12 19:53:45 -07:00
mach-uniphier ARM: uniphier: hide memory top by platform hook instead of CONFIG 2018-01-09 21:58:19 +09:00
mach-versatile
mach-zynq mtd: zynq: nand: Move board_nand_init() function to board.c 2017-11-29 08:02:40 +01:00
thumb1/include/asm/proc-armv
config.mk binman: arm: Include the binman symbol table 2017-12-12 19:53:45 -07:00
Kconfig armv8: Implement workaround for Cortex-A53 erratum 855873 2018-01-10 12:29:57 -08:00
Kconfig.debug
Makefile imx: reorganize IMX code as other SOCs 2017-07-12 10:17:44 +02:00