u-boot/arch/arm/include/asm
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
..
arch-am33xx mach-omap2: add AM335x Display PLL register definition 2018-01-11 15:16:34 +01:00
arch-armada8k arm64: mvebu: Add L3 cache flush functionality to A8K family 2016-12-12 09:05:28 +01:00
arch-armada100 i2c: Drop use of CONFIG_I2C_HARD 2017-05-15 06:17:09 +02:00
arch-armv7 ARMv7: Factor out reusable timer_wait from sunxi/psci_sun7i.S 2015-07-20 11:44:38 -07:00
arch-aspeed aspeed: Refactor SCU to use consistent mask & shift 2017-05-08 11:57:35 -04:00
arch-bcm235xx bcm235xx: boot0 hook: adjust to unified boot0 semantics 2017-11-21 23:57:21 +01:00
arch-bcm281xx bcm281xx: boot0 hook: adjust to unified boot0 semantics 2017-11-21 23:57:22 +01:00
arch-bcmcygnus net: move Broadcom SF2 driver to Kconfig 2017-08-07 15:18:30 -05:00
arch-bcmnsp arm: add Cygnus and NSP boards 2014-08-30 07:46:40 -04:00
arch-ep93xx arm: ep9315: Return back Cirrus Logic EDB9315A board support 2014-07-04 23:45:48 +02:00
arch-fsl-layerscape drivers/misc: Share qbman init between archs 2018-01-10 12:28:47 -08:00
arch-hi3798cv200 ARM64: poplar: hi3798cv200: u-boot support for Poplar 96Boards 2017-07-10 14:26:03 -04:00
arch-hi6220 driver: gpio: hikey: Fix pointer conversion warnings for hikey 2015-11-12 15:58:59 -05:00
arch-imx common: freescale: Move arch-specific imx code to arch-imx 2017-06-05 12:31:22 -04:00
arch-lpc32xx i2c: lpc32xx: Move definitions to header file 2017-03-28 06:27:14 +02:00
arch-ls102xa ata: Migrate CONFIG_LIBATA to Kconfig 2017-12-12 18:16:05 -05:00
arch-meson ARM: arch-meson: build memory banks using reported memory from registers 2017-12-04 10:17:29 -05:00
arch-mvebu spi: kirkwood_spi: implement mvebu_spi_set_mode() 2016-11-18 13:04:52 +05:30
arch-mx5 arm: mx5: Add more register definitions 2017-11-20 09:58:31 +01:00
arch-mx6 imx: initialize and use generic timer on i.MX 6UL/ULL 2018-01-08 17:33:06 +01:00
arch-mx7 imx7: Add include guards for include/asm/arch-mx7/sys_proto.h file 2017-11-09 11:32:49 +01:00
arch-mx7ulp imx: reorganize IMX code as other SOCs 2017-07-12 10:17:44 +02:00
arch-mx25 imx: reorganize IMX code as other SOCs 2017-07-12 10:17:44 +02:00
arch-mx27 mmc: move more driver config options to Kconfig 2017-01-11 19:40:15 +09:00
arch-mx31 imx: reorganize IMX code as other SOCs 2017-07-12 10:17:44 +02:00
arch-mx35 imx: fix licensing in i.MX files 2017-08-23 10:45:45 +02:00
arch-mxs imx: fix licensing in i.MX files 2017-08-23 10:45:45 +02:00
arch-omap3 Convert CONFIG_SYS_I2C_BUS_MAX to Kconfig 2017-09-01 20:44:30 -04:00
arch-omap4 Convert CONFIG_SYS_I2C_BUS_MAX to Kconfig 2017-09-01 20:44:30 -04:00
arch-omap5 ARM: DRA7: Cleanup old pinctrl macros 2017-09-14 21:32:56 -04:00
arch-orion5x edminiv2: switch to SPL 2015-02-25 07:59:50 +01:00
arch-pxa ARM: pxa: Remove unused ifdefs 2017-12-12 21:34:10 -05:00
arch-rockchip Merge git://git.denx.de/u-boot-usb 2018-01-11 11:18:29 -05:00
arch-s32v234 armv8: s32v234: Introduce basic support for s32v234evb 2016-06-13 08:56:35 -04:00
arch-sa1100
arch-spear spear: fix STMicroelectronics copyright 2017-11-06 09:51:01 -05:00
arch-stih410 sti: fix STMicroelectronics copyright 2017-11-06 09:51:01 -05:00
arch-stm32f4 board: stm32f429-disco: switch to DM STM32 pinctrl and gpio driver 2018-01-10 08:05:46 -05:00
arch-stm32f7 stm32: migrate clock structs in include/stm32_rcc.h 2017-11-29 22:30:50 -05:00
arch-stm32h7 stm32: fix STMicroelectronics copyright 2017-11-06 09:51:01 -05:00
arch-stv0991 stv0991: fix STMicroelectronics copyright 2017-11-06 09:51:01 -05:00
arch-sunxi bitops: collect BIT macros to include/linux/bitops.h 2017-11-29 00:28:57 +09:00
arch-tegra dm: tegra: Convert clock_decode_periph_id() to support livetree 2017-07-28 12:02:47 -06:00
arch-tegra20 ARM: tegra: use DT bindings for GPIO naming 2016-05-31 09:53:56 -07:00
arch-tegra30 ARM: tegra: use DT bindings for GPIO naming 2016-05-31 09:53:56 -07:00
arch-tegra114 Add more SPDX-License-Identifier tags 2016-01-19 08:31:21 -05:00
arch-tegra124 Various, unrelated tree-wide typo fixes. 2016-07-16 09:43:12 -04:00
arch-tegra186 ARM: tegra: add core Tegra186 support 2016-05-31 11:22:59 -07:00
arch-tegra210 ARM: tegra: use DT bindings for GPIO naming 2016-05-31 09:53:56 -07:00
arch-vf610 imx: reorganize IMX code as other SOCs 2017-07-12 10:17:44 +02:00
arch-zynqmp arm64: zynqmp: Add missing zynq_board_read_rom_ethaddr() prototype 2017-12-14 20:08:44 +01:00
armv8 armv8: mmu: fix page table mapping 2017-12-04 10:23:52 -05:00
iproc-common arm: add Cygnus and NSP boards 2014-08-30 07:46:40 -04:00
kona-common bcm281xx: add support for "USB OTG clock" 2014-12-29 16:31:23 -05:00
mach-imx arm: imx: hab: Fix authenticate_image input parameters 2018-01-14 17:26:30 +01:00
proc-armv ARM: add missing HYP mode constant 2014-07-28 17:06:35 +02:00
ti-common mtd: nand: Rename nand.h into rawnand.h 2017-12-04 22:00:00 +09:00
armv7.h armv7: Move L2CTLR read/write to common 2017-10-01 00:33:33 +02:00
armv7m.h armv7m: add MPU configuration support 2017-05-12 08:37:06 -04:00
armv7m_mpu.h stm32: fix STMicroelectronics copyright 2017-11-06 09:51:01 -05:00
assembler.h arm: Migrate SYS_THUMB_BUILD to Kconfig, introduce SPL_SYS_THUMB_BUILD 2017-03-18 20:28:01 -04:00
atomic.h ARM64: Add support for some of atomic64 operations 2016-10-06 20:57:42 -04:00
barriers.h ARM: Rework and correct barrier definitions 2016-08-05 07:23:57 -04:00
bitops.h arm, ubifs: fix gcc5.x compiler warning 2016-01-20 10:03:58 -05:00
bootm.h arm: Add declarations to avoid needing to include headers 2017-06-05 11:02:37 -04:00
byteorder.h armv8: Use __aarch64__ rather than CONFIG_ARM64 in some cases 2014-01-10 10:10:23 +01:00
cache.h arm: Migrate SYS_THUMB_BUILD to Kconfig, introduce SPL_SYS_THUMB_BUILD 2017-03-18 20:28:01 -04:00
config.h arm64: support running at addr other than linked to 2017-11-17 07:44:13 -05:00
davinci_rtc.h
dma-mapping.h dma: import linux/dma-direction.h to consolidate enum dma_data_direction 2017-09-12 18:02:23 -04:00
ehci-omap.h configs: Remove CONFIG_SYS_USB_EHCI_MAX_ROOT_PORTS in all boards 2017-07-28 23:34:24 +02:00
emif.h arm: am33xx: Initialize EMIF REG_PR_OLD_COUNT for BBB and am335x-evm 2016-12-09 15:00:03 -05:00
fsl_secure_boot.h ls1088ardb: Add SD Secure boot target support 2018-01-10 12:32:45 -08:00
gic.h arm64 patch: gicv3 support 2014-04-08 00:15:12 +02:00
global_data.h arm: change tbu/l type to unsigned int 2017-05-12 08:37:34 -04:00
gpio.h gpio: do not include <asm/arch/gpio.h> for ARCH_STI 2017-03-14 20:40:19 -04:00
hardware.h
io.h arm: Use asm-generic/io.h 2017-10-02 21:52:20 -04:00
linkage.h
mach-types.h arm: Re-sync with full list of MACH_TYPE_xxx values 2017-01-28 14:04:20 -05:00
macro.h ARMv8: make master CPU checking logic more clear 2017-10-08 16:19:56 -04:00
memory.h Various, accumulated typos collected from around the tree. 2016-10-06 20:57:40 -04:00
omap_common.h ARM: DRA72x: Add support for detection of DRA71x SR 2.1 2017-09-12 18:02:29 -04:00
omap_gpio.h gpio: omap: Drop 'method' parameter 2015-08-12 20:48:06 -04:00
omap_mmc.h arm: omap5+: Add board specific ldo powering 2017-09-11 16:19:35 -04:00
omap_musb.h drivers: usb: musb: adopt musb backend driver to driver model 2016-12-02 21:04:48 -07:00
omap_sec_common.h arm: mach-omap2: Factor out common FDT fixup suport 2017-07-22 22:22:43 -04:00
opcodes-sec.h ARM: adjust arm-smccc code for use in U-Boot 2017-04-18 10:29:17 -04:00
opcodes-virt.h ARM: adjust arm-smccc code for use in U-Boot 2017-04-18 10:29:17 -04:00
opcodes.h ARM: adjust arm-smccc code for use in U-Boot 2017-04-18 10:29:17 -04:00
pl310.h arm: socfpga: enable data/inst prefetch and shared override in the L2 2015-10-17 01:47:31 +02:00
posix_types.h armv8: Use __aarch64__ rather than CONFIG_ARM64 in some cases 2014-01-10 10:10:23 +01:00
processor.h Remove ${objtree}/include/asm/proc/ link 2014-06-11 16:27:05 -04:00
psci.h ARMv8: Add basic PSCI framework 2016-12-15 11:57:44 -08:00
ptrace.h Remove ${objtree}/include/asm/proc/ link 2014-06-11 16:27:05 -04:00
sections.h
secure.h ARMv8: Setup PSCI memory and device tree 2016-12-15 11:57:51 -08:00
setjmp.h arm: provide a PCS-compliant setjmp implementation 2017-11-21 23:57:22 +01:00
setup.h Various, accumulated typos collected from around the tree. 2016-10-06 20:57:40 -04:00
spin_table.h arm64: add better and more generic spin-table support 2016-07-14 18:22:16 -04:00
spl.h spl: add a 'return to bootrom' boot method 2017-08-13 17:12:19 +02:00
string.h ARM: revive CONFIG_USE_ARCH_MEMCPY/MEMSET for UniPhier and Tegra 2016-12-27 11:24:15 -05:00
system.h arm: make save_boot_params_ret prototype visible for AArch64 2017-11-21 23:57:22 +01:00
types.h types.h: move and redefine resource_size_t 2016-07-14 18:22:24 -04:00
u-boot-arm.h arm: Add declarations to avoid needing to include headers 2017-06-05 11:02:37 -04:00
u-boot.h arm: Make u-boot-arm.h a private header 2017-06-05 11:02:33 -04:00
unaligned.h arm64: core support 2014-01-09 16:08:44 +01:00
unified.h arm: include: Import unified.h from Linux kernel 2016-06-02 21:21:43 -04:00
utils.h