[U-Boot] [PATCH v4 21/25] arm: imx: hab: Rename is_hab_enabled imx_hab_is_enabled

2018-01-02 Thread Bryan O'Donoghue
() is a tautology. A more logical name is imx_hab_is_enabled(). Signed-off-by: Bryan O'Donoghue <bryan.odonog...@linaro.org> Cc: Stefano Babic <sba...@denx.de> Cc: Fabio Estevam <fabio.este...@nxp.com> Cc: Peng Fan <peng@nxp.com> Cc: Albert Aribaud <albert.u.b...@aribaud.net>

[U-Boot] [PATCH v4 22/25] arm: imx: hab: Make imx_hab_is_enabled global

2018-01-02 Thread Bryan O'Donoghue
It will be helpful to boot commands to know if the HAB is enabled. Export imx_hab_is_enabled() now to facilitate further work with this data-point in a secure-boot context. Signed-off-by: Bryan O'Donoghue <bryan.odonog...@linaro.org> Cc: Stefano Babic <sba...@denx.de> Cc: F

[U-Boot] [PATCH v4 08/25] arm: imx: hab: Fix authenticate image lockup on MX7

2018-01-02 Thread Bryan O'Donoghue
performance impact with dcache switched off so this fix is relatively pain-free. Signed-off-by: Bryan O'Donoghue <bryan.odonog...@linaro.org> Cc: Stefano Babic <sba...@denx.de> Cc: Fabio Estevam <fabio.este...@nxp.com> Cc: Peng Fan <peng@nxp.com> Cc: Albert Aribaud <albert.u

[U-Boot] [PATCH v4 05/25] arm: imx: hab: Move IVT_SIZE to hab.h

2018-01-02 Thread Bryan O'Donoghue
The size of the IVT header should be defined in hab.h move it there now. Signed-off-by: Bryan O'Donoghue <bryan.odonog...@linaro.org> Cc: Stefano Babic <sba...@denx.de> Cc: Fabio Estevam <fabio.este...@nxp.com> Cc: Peng Fan <peng@nxp.com> Cc: Albert Aribaud <al

[U-Boot] [PATCH v4 11/25] arm: imx: hab: Verify IVT self matches calculated address

2018-01-02 Thread Bryan O'Donoghue
The IVT is a self-describing structure which contains a self field. The self field is the absolute physical base address the IVT ought to be at in memory. Use the IVT self field to validate the calculated ivt_addr bugging out if the two values differ. Signed-off-by: Bryan O'Donoghue <bryan.odo

[U-Boot] [PATCH v4 13/25] arm: imx: hab: Print CSF based on IVT descriptor

2018-01-02 Thread Bryan O'Donoghue
The IVT gives the absolute address of the CSF. There is no requirement for the CSF to be located adjacent to the IVT so lets use the address provided in the IVT header instead of the hard-coded fixed CSF offset currently in place. Signed-off-by: Bryan O'Donoghue <bryan.odonog...@linaro.org&

[U-Boot] [PATCH v4 15/25] arm: imx: hab: Define rvt_check_target()

2018-01-02 Thread Bryan O'Donoghue
ory region is good. Signed-off-by: Bryan O'Donoghue <bryan.odonog...@linaro.org> Cc: Stefano Babic <sba...@denx.de> Cc: Fabio Estevam <fabio.este...@nxp.com> Cc: Peng Fan <peng@nxp.com> Cc: Albert Aribaud <albert.u.b...@aribaud.net> Cc: Sven Ebenfeld <sven

[U-Boot] [PATCH v4 24/25] arm: imx: hab: Implement hab_rvt_failsafe

2018-01-02 Thread Bryan O'Donoghue
on the alternative BootROM API. Signed-off-by: Bryan O'Donoghue <bryan.odonog...@linaro.org> Cc: Stefano Babic <sba...@denx.de> Cc: Fabio Estevam <fabio.este...@nxp.com> Cc: Peng Fan <peng@nxp.com> Cc: Albert Aribaud <albert.u.b...@aribaud.net> Cc: Sven Ebenfeld <sv

[U-Boot] [PATCH v4 10/25] arm: imx: hab: Add IVT header verification

2018-01-02 Thread Bryan O'Donoghue
The IVT header contains a magic number, fixed length and one of two version identifiers. Validate these settings before doing anything with a putative IVT binary. Signed-off-by: Bryan O'Donoghue <bryan.odonog...@linaro.org> Cc: Stefano Babic <sba...@denx.de> Cc: Fabio Estevam

[U-Boot] [PATCH v4 09/25] arm: imx: hab: Add IVT header definitions

2018-01-02 Thread Bryan O'Donoghue
in later patches, where we will break the current incorrect dependence on fixed offsets in favour of an IVT described parsing of incoming binaries. Signed-off-by: Bryan O'Donoghue <bryan.odonog...@linaro.org> Cc: Stefano Babic <sba...@denx.de> Cc: Fabio Estevam <fabio.este...@nxp.com>

[U-Boot] [PATCH v4 01/25] arm: imx: hab: Make authenticate_image return int

2018-01-02 Thread Bryan O'Donoghue
. The first step is fixing the return type in authenticate_image() so do that now. Signed-off-by: Bryan O'Donoghue <bryan.odonog...@linaro.org> Cc: Stefano Babic <sba...@denx.de> Cc: Fabio Estevam <fabio.este...@nxp.com> Cc: Peng Fan <peng@nxp.com> Cc: Albert Aribaud <al

[U-Boot] [PATCH v4 07/25] arm: imx: hab: Fix authenticate_image input parameters

2018-01-02 Thread Bryan O'Donoghue
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.odonog...@linaro.org> Cc: Stefano Babic <sba...@denx.de

[U-Boot] [PATCH v4 06/25] arm: imx: hab: Move CSF_PAD_SIZE to hab.h

2018-01-02 Thread Bryan O'Donoghue
CSF_PAD_SIZE should be defined in hab.h, move it to that location now. Signed-off-by: Bryan O'Donoghue <bryan.odonog...@linaro.org> Cc: Stefano Babic <sba...@denx.de> Cc: Fabio Estevam <fabio.este...@nxp.com> Cc: Peng Fan <peng@nxp.com> Cc: Albert Aribaud <albert.u

[U-Boot] [PATCH 00/23] Fix and extend i.MX HAB layer

2017-12-27 Thread Bryan O'Donoghue
in the NXP documents to perform prior to hab_rvt_authenticate_image - hab_rvt_failsafe is a useful function to set the board into BootROM USB recovery mode. Bryan O'Donoghue (23): arm: imx: hab: Make authenticate_image return int arm: imx: hab: Fix authenticate_image result code arm: imx: hab

[U-Boot] [PATCH 02/23] arm: imx: hab: Fix authenticate_image result code

2017-12-27 Thread Bryan O'Donoghue
: 36c1ca4d46ef ("imx: Support i.MX6 High Assurance Boot authentication") Signed-off-by: Bryan O'Donoghue <bryan.odonog...@linaro.org> Cc: Stefano Babic <sba...@denx.de> Cc: Fabio Estevam <fabio.este...@nxp.com> Cc: Peng Fan <peng@nxp.com> Cc: Albert Aribaud <albert.

[U-Boot] [PATCH 01/23] arm: imx: hab: Make authenticate_image return int

2017-12-27 Thread Bryan O'Donoghue
. The first step is fixing the return type in authenticate_image() so do that now. Signed-off-by: Bryan O'Donoghue <bryan.odonog...@linaro.org> Cc: Stefano Babic <sba...@denx.de> Cc: Fabio Estevam <fabio.este...@nxp.com> Cc: Peng Fan <peng@nxp.com> Cc: Albert Aribaud <al

[U-Boot] [PATCH 04/23] arm: imx: hab: Optimise flow of authenticate_image on hab_entry fail

2017-12-27 Thread Bryan O'Donoghue
The current code disjoins an entire block of code on hab_entry pass/fail resulting in a large chunk of authenticate_image being offset to the right. Fix this by checking hab_entry() pass/failure and exiting the function directly if in an error state. Signed-off-by: Bryan O'Donoghue <bryan.odo

[U-Boot] [PATCH 17/23] arm: imx: hab: Make internal functions and data static

2017-12-27 Thread Bryan O'Donoghue
There is no need to export these functions and data structures externally. Make them all static now. Signed-off-by: Bryan O'Donoghue <bryan.odonog...@linaro.org> Cc: Stefano Babic <sba...@denx.de> Cc: Fabio Estevam <fabio.este...@nxp.com> Cc: Peng Fan <peng@nxp.co

[U-Boot] [PATCH 15/23] arm: imx: hab: Implement hab_rvt_check_target

2017-12-27 Thread Bryan O'Donoghue
. Signed-off-by: Bryan O'Donoghue <bryan.odonog...@linaro.org> Cc: Stefano Babic <sba...@denx.de> Cc: Fabio Estevam <fabio.este...@nxp.com> Cc: Peng Fan <peng@nxp.com> Cc: Albert Aribaud <albert.u.b...@aribaud.net> Cc: Sven Ebenfeld <sven.ebenf...@gmail.com> Cc:

[U-Boot] [PATCH 09/23] arm: imx: hab: Add IVT header definitions

2017-12-27 Thread Bryan O'Donoghue
in later patches, where we will break the current incorrect dependence on fixed offsets in favour of an IVT described parsing of incoming binaries. Signed-off-by: Bryan O'Donoghue <bryan.odonog...@linaro.org> Cc: Stefano Babic <sba...@denx.de> Cc: Fabio Estevam <fabio.este...@nxp.com>

[U-Boot] [PATCH 08/23] arm: imx: hab: Move CSF_PAD_SIZE to hab.h

2017-12-27 Thread Bryan O'Donoghue
CSF_PAD_SIZE should be defined in hab.h, move it to that location now. Signed-off-by: Bryan O'Donoghue <bryan.odonog...@linaro.org> Cc: Stefano Babic <sba...@denx.de> Cc: Fabio Estevam <fabio.este...@nxp.com> Cc: Peng Fan <peng@nxp.com> Cc: Albert Aribaud <albert.u

[U-Boot] [PATCH 18/23] arm: imx: hab: Prefix authenticate_image with imx_hab

2017-12-27 Thread Bryan O'Donoghue
imx_hab_authenticate_image() is on the other hand very explicit. Signed-off-by: Bryan O'Donoghue <bryan.odonog...@linaro.org> Cc: Stefano Babic <sba...@denx.de> Cc: Fabio Estevam <fabio.este...@nxp.com> Cc: Peng Fan <peng@nxp.com> Cc: Albert Aribaud <albert.u.b...@aribaud.net>

[U-Boot] [PATCH 07/23] arm: imx: hab: Move IVT_SIZE to hab.h

2017-12-27 Thread Bryan O'Donoghue
The size of the IVT header should be defined in hab.h move it there now. Signed-off-by: Bryan O'Donoghue <bryan.odonog...@linaro.org> Cc: Stefano Babic <sba...@denx.de> Cc: Fabio Estevam <fabio.este...@nxp.com> Cc: Peng Fan <peng@nxp.com> Cc: Albert Aribaud <al

[U-Boot] [PATCH 06/23] arm: imx: hab: Fix authenticate image lockup on MX7

2017-12-27 Thread Bryan O'Donoghue
performance impact with dcache switched off so this fix is relatively pain-free. Signed-off-by: Bryan O'Donoghue <bryan.odonog...@linaro.org> Cc: Stefano Babic <sba...@denx.de> Cc: Fabio Estevam <fabio.este...@nxp.com> Cc: Peng Fan <peng@nxp.com> Cc: Albert Aribaud <albert.u

[U-Boot] [PATCH 13/23] arm: imx: hab: Print additional IVT elements during debug

2017-12-27 Thread Bryan O'Donoghue
This patch enables printout of the IVT entry, dcd and csf data fields. Signed-off-by: Bryan O'Donoghue <bryan.odonog...@linaro.org> Cc: Stefano Babic <sba...@denx.de> Cc: Fabio Estevam <fabio.este...@nxp.com> Cc: Peng Fan <peng@nxp.com> Cc: Albert Aribaud <albert.u

[U-Boot] [PATCH 20/23] arm: imx: hab: Make imx_hab_is_enabled global

2017-12-27 Thread Bryan O'Donoghue
It will be helpful to boot commands to know if the HAB is enabled. Export imx_hab_is_enabled() now to facilitate further work with this data-point in a secure-boot context. Signed-off-by: Bryan O'Donoghue <bryan.odonog...@linaro.org> Cc: Stefano Babic <sba...@denx.de> Cc: F

[U-Boot] [PATCH 14/23] arm: imx: hab: Define rvt_check_target()

2017-12-27 Thread Bryan O'Donoghue
ory region is good. Signed-off-by: Bryan O'Donoghue <bryan.odonog...@linaro.org> Cc: Stefano Babic <sba...@denx.de> Cc: Fabio Estevam <fabio.este...@nxp.com> Cc: Peng Fan <peng@nxp.com> Cc: Albert Aribaud <albert.u.b...@aribaud.net> Cc: Sven Ebenfeld <sven

[U-Boot] [PATCH 23/23] arm: imx: hab: Add hab_failsafe console command

2017-12-27 Thread Bryan O'Donoghue
ux dmesg thus allowing download of a new image via the BootROM USB download protocol routine. Signed-off-by: Bryan O'Donoghue <bryan.odonog...@linaro.org> Cc: Stefano Babic <sba...@denx.de> Cc: Fabio Estevam <fabio.este...@nxp.com> Cc: Peng Fan <peng@nxp.com> Cc: Albert A

[U-Boot] [PATCH 12/23] arm: imx: hab: Print CSF based on IVT descriptor

2017-12-27 Thread Bryan O'Donoghue
it now. Signed-off-by: Bryan O'Donoghue <bryan.odonog...@linaro.org> Cc: Stefano Babic <sba...@denx.de> Cc: Fabio Estevam <fabio.este...@nxp.com> Cc: Peng Fan <peng@nxp.com> Cc: Albert Aribaud <albert.u.b...@aribaud.net> Cc: Sven Ebenfeld <sven.ebenf...@

[U-Boot] [PATCH 21/23] arm: imx: hab: Define rvt_failsafe()

2017-12-27 Thread Bryan O'Donoghue
ce invoked the part will drop down to its BootROM USB recovery mode. Should it be the case that the part is in secure boot mode - only an appropriately signed binary will be accepted by the ROM and subsequently executed. Signed-off-by: Bryan O'Donoghue <bryan.odonog...@linaro.org> Cc: Stefano Babic

[U-Boot] [PATCH 22/23] arm: imx: hab: Implement hab_rvt_failsafe

2017-12-27 Thread Bryan O'Donoghue
on the alternative BootROM API. Signed-off-by: Bryan O'Donoghue <bryan.odonog...@linaro.org> Cc: Stefano Babic <sba...@denx.de> Cc: Fabio Estevam <fabio.este...@nxp.com> Cc: Peng Fan <peng@nxp.com> Cc: Albert Aribaud <albert.u.b...@aribaud.net> Cc: Sven Ebenfeld <sv

[U-Boot] [PATCH 03/23] arm: imx: hab: Optimise flow of authenticate_image on is_enabled fail

2017-12-27 Thread Bryan O'Donoghue
There is no need to call is_enabled() twice in authenticate_image - it does nothing but add an additional layer of indentation. We can check for is_enabled() at the start of the function and return the result code directly. Signed-off-by: Bryan O'Donoghue <bryan.odonog...@linaro.org> Cc: S

[U-Boot] [PATCH 16/23] arm: imx: hab: Add a hab_rvt_check_target to image auth

2017-12-27 Thread Bryan O'Donoghue
and perform that check as directed. Signed-off-by: Bryan O'Donoghue <bryan.odonog...@linaro.org> Cc: Stefano Babic <sba...@denx.de> Cc: Fabio Estevam <fabio.este...@nxp.com> Cc: Peng Fan <peng@nxp.com> Cc: Albert Aribaud <albert.u.b...@aribaud.net> Cc: Sven Ebenfel

[U-Boot] [PATCH 05/23] arm: imx: hab: Fix authenticate_image input parameters

2017-12-27 Thread Bryan O'Donoghue
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.odonog...@linaro.org> Cc: Stefano Babic <sba...@denx.de

[U-Boot] [PATCH 19/23] arm: imx: hab: Rename is_hab_enabled imx_hab_is_enabled

2017-12-27 Thread Bryan O'Donoghue
() is a tautology. A more logical name is imx_hab_is_enabled(). Signed-off-by: Bryan O'Donoghue <bryan.odonog...@linaro.org> Cc: Stefano Babic <sba...@denx.de> Cc: Fabio Estevam <fabio.este...@nxp.com> Cc: Peng Fan <peng@nxp.com> Cc: Albert Aribaud <albert.u.b...@aribaud.net>

[U-Boot] [PATCH 10/23] arm: imx: hab: Add IVT header verification

2017-12-27 Thread Bryan O'Donoghue
The IVT header contains a magic number, fixed length and one of two version identifiers. Validate these settings before doing anything with a putative IVT binary. Signed-off-by: Bryan O'Donoghue <bryan.odonog...@linaro.org> Cc: Stefano Babic <sba...@denx.de> Cc: Fabio Estevam

[U-Boot] [PATCH 11/23] arm: imx: hab: Verify IVT self matches calculated address

2017-12-27 Thread Bryan O'Donoghue
The IVT is a self-describing structure which contains a self field. The self field is the absolute physical base address the IVT ought to be at in memory. Use the IVT self field to validate the calculated ivt_addr bugging out if the two values differ. Signed-off-by: Bryan O'Donoghue <bryan.odo

Re: [U-Boot] [PATCH 10/23] arm: imx: hab: Add IVT header verification

2017-12-27 Thread Bryan O'Donoghue
I'm trying to build mx6sabreauto which uses the SPL framework and I'm getting the following build error: arch/arm/mach-imx/hab.c: In function 'imx_hab_authenticate_image': arch/arm/mach-imx/hab.c:514:6: warning: implicit declaration of function 'verify_ivt_header'

Re: [U-Boot] [PATCH v4 08/25] arm: imx: hab: Fix authenticate image lockup on MX7

2018-01-03 Thread Bryan O'Donoghue
On 03/01/18 01:25, Breno Matheus Lima wrote: Hi Bryan, 2018-01-02 14:43 GMT-02:00 Bryan O'Donoghue <bryan.odonog...@linaro.org>: The i.MX6 has some pretty explicit code associated with informing the IROM about flushing caches during authenticate_image(). Looking at various

[U-Boot] [PATCH 0/4] Add WaRP7 ATF chainloaded setup

2018-09-05 Thread Bryan O'Donoghue
This set of patches makes a version of u-boot that is bootable as BL33 in a chainloded set of images in the following sequence. BootROM -> ATF (loads a FIP) -> OPTEE -> u-boot -> Linux. Since the OPTEE image enables TrustZone u-boot no longer has access to certain low-level functions. In order

[U-Boot] [PATCH 2/4] optee: adjust dependencies and default values for dram

2018-09-05 Thread Bryan O'Donoghue
o reserve the memory used by optee, to avoid for example to realocate ourself to the same address at the end of DRAM. So, we change here the dependencies on the OPTEE lib and we set the default size and base of TZRAM to zero. Signed-off-by: Rui Miguel Silva Signed-off-by: Bryan O'Donoghue Cc: Fabi

[U-Boot] [PATCH 1/4] imx: mx7: avoid some initialization if low level is skipped

2018-09-05 Thread Bryan O'Donoghue
the permission for that. So, if the config option to skip low level init is set disable also timer, board and csu initialization. Signed-off-by: Rui Miguel Silva Signed-off-by: Bryan O'Donoghue Cc: Stefano Babic Cc: Fabio Estevam Cc: Albert Aribaud Cc: Peng Fan Cc: u-boot@lists.denx.de --- arch

[U-Boot] [PATCH 4/4] warp7: configs: add bl33 defconfig

2018-09-05 Thread Bryan O'Donoghue
From: Rui Miguel Silva Add default configuration to run u-boot as BL33 in the ARM Trusted Firmware boot flow for AArch32 case. Signed-off-by: Rui Miguel Silva Signed-off-by: Bryan O'Donoghue Cc: Fabio Estevam Cc: Simon Glass Cc: Maxime Ripard Cc: Lukasz Majewski Cc: Tuomas Tynkkynen Cc

[U-Boot] [PATCH 3/4] warp7: include: configs: set skip low level init

2018-09-05 Thread Bryan O'Donoghue
Miguel Silva Signed-off-by: Bryan O'Donoghue Cc: Fabio Estevam Cc: u-boot@lists.denx.de --- include/configs/warp7.h | 11 +++ 1 file changed, 11 insertions(+) diff --git a/include/configs/warp7.h b/include/configs/warp7.h index 1b656a5aaf..a391dfb5c1 100644 --- a/include/configs/warp7

Re: [U-Boot] [PATCH] tools/imximage: get HAB information from header

2018-07-09 Thread Bryan O'Donoghue
data.size - imximage_ivt_offset - - imximage_csf_size); + (uint32_t)(fhdr_v2->csf - fhdr_v2->self)); printf("DCD Blocks: 0x0091 0x%08x 0x%08x\n", offs, be16_to_cpu(dcdlen)); } Good

[U-Boot] [PATCH v6 11/25] arm: imx: hab: Only call ROM once headers are verified

2018-01-12 Thread Bryan O'Donoghue
-by: Bryan O'Donoghue <bryan.odonog...@linaro.org> Cc: Stefano Babic <sba...@denx.de> Cc: Fabio Estevam <fabio.este...@nxp.com> Cc: Peng Fan <peng@nxp.com> Cc: Albert Aribaud <albert.u.b...@aribaud.net> Cc: Sven Ebenfeld <sven.ebenf...@gmail.com> Cc:

[U-Boot] [PATCH v6 20/25] arm: imx: hab: Rename is_hab_enabled imx_hab_is_enabled

2018-01-12 Thread Bryan O'Donoghue
() is a tautology. A more logical name is imx_hab_is_enabled(). Signed-off-by: Bryan O'Donoghue <bryan.odonog...@linaro.org> Cc: Stefano Babic <sba...@denx.de> Cc: Fabio Estevam <fabio.este...@nxp.com> Cc: Peng Fan <peng@nxp.com> Cc: Albert Aribaud <albert.u.b...@aribaud.net>

[U-Boot] [PATCH v6 09/25] arm: imx: hab: Add IVT header verification

2018-01-12 Thread Bryan O'Donoghue
The IVT header contains a magic number, fixed length and one of two version identifiers. Validate these settings before doing anything with a putative IVT binary. Signed-off-by: Bryan O'Donoghue <bryan.odonog...@linaro.org> Cc: Stefano Babic <sba...@denx.de> Cc: Fabio Estevam

[U-Boot] [PATCH v6 13/25] arm: imx: hab: Print additional IVT elements during debug

2018-01-12 Thread Bryan O'Donoghue
This patch enables printout of the IVT entry, dcd and csf data fields. Signed-off-by: Bryan O'Donoghue <bryan.odonog...@linaro.org> Cc: Stefano Babic <sba...@denx.de> Cc: Fabio Estevam <fabio.este...@nxp.com> Cc: Peng Fan <peng@nxp.com> Cc: Albert Aribaud <albert.u

[U-Boot] [PATCH v6 15/25] arm: imx: hab: Implement hab_rvt_check_target

2018-01-12 Thread Bryan O'Donoghue
. Signed-off-by: Bryan O'Donoghue <bryan.odonog...@linaro.org> Cc: Stefano Babic <sba...@denx.de> Cc: Fabio Estevam <fabio.este...@nxp.com> Cc: Peng Fan <peng@nxp.com> Cc: Albert Aribaud <albert.u.b...@aribaud.net> Cc: Sven Ebenfeld <sven.ebenf...@gmail.com> Cc:

[U-Boot] [PATCH v6 06/25] arm: imx: hab: Move CSF_PAD_SIZE to hab.h

2018-01-12 Thread Bryan O'Donoghue
CSF_PAD_SIZE should be defined in hab.h, move it to that location now. Signed-off-by: Bryan O'Donoghue <bryan.odonog...@linaro.org> Cc: Stefano Babic <sba...@denx.de> Cc: Fabio Estevam <fabio.este...@nxp.com> Cc: Peng Fan <peng@nxp.com> Cc: Albert Aribaud <albert.u

[U-Boot] [PATCH v6 23/25] arm: imx: hab: Define rvt_failsafe()

2018-01-12 Thread Bryan O'Donoghue
ce invoked the part will drop down to its BootROM USB recovery mode. Should it be the case that the part is in secure boot mode - only an appropriately signed binary will be accepted by the ROM and subsequently executed. Signed-off-by: Bryan O'Donoghue <bryan.odonog...@linaro.org> Cc: Stefano Babic

[U-Boot] [PATCH v6 19/25] arm: imx: hab: Prefix authenticate_image with imx_hab

2018-01-12 Thread Bryan O'Donoghue
imx_hab_authenticate_image() is on the other hand very explicit. Signed-off-by: Bryan O'Donoghue <bryan.odonog...@linaro.org> Cc: Stefano Babic <sba...@denx.de> Cc: Fabio Estevam <fabio.este...@nxp.com> Cc: Peng Fan <peng@nxp.com> Cc: Albert Aribaud <albert.u.b...@aribaud.net>

[U-Boot] [PATCH v6 18/25] arm: imx: hab: Make internal functions and data static

2018-01-12 Thread Bryan O'Donoghue
There is no need to export these functions and data structures externally. Make them all static now. Signed-off-by: Bryan O'Donoghue <bryan.odonog...@linaro.org> Cc: Stefano Babic <sba...@denx.de> Cc: Fabio Estevam <fabio.este...@nxp.com> Cc: Peng Fan <peng@nxp.co

[U-Boot] [PATCH v6 21/25] arm: imx: hab: Make authenticate_image() return zero on open boards

2018-01-12 Thread Bryan O'Donoghue
. Returning a pass status for authenticate_image() calls anyway A previous patch removed the necessity to call into imx_hab_is_enabled() twice. This patch ensures the reliance on authenticate_image() returning zero is maintained. Signed-off-by: Bryan O'Donoghue <bryan.odonog...@linaro.org> Sug

[U-Boot] [PATCH v6 14/25] arm: imx: hab: Define rvt_check_target()

2018-01-12 Thread Bryan O'Donoghue
ory region is good. Signed-off-by: Bryan O'Donoghue <bryan.odonog...@linaro.org> Cc: Stefano Babic <sba...@denx.de> Cc: Fabio Estevam <fabio.este...@nxp.com> Cc: Peng Fan <peng@nxp.com> Cc: Albert Aribaud <albert.u.b...@aribaud.net> Cc: Sven Ebenfeld <sven

[U-Boot] [PATCH v6 22/25] arm: imx: hab: Make imx_hab_is_enabled global

2018-01-12 Thread Bryan O'Donoghue
It will be helpful to boot commands to know if the HAB is enabled. Export imx_hab_is_enabled() now to facilitate further work with this data-point in a secure-boot context. Signed-off-by: Bryan O'Donoghue <bryan.odonog...@linaro.org> Cc: Stefano Babic <sba...@denx.de> Cc: F

[U-Boot] [PATCH v6 25/25] arm: imx: hab: Add hab_failsafe console command

2018-01-12 Thread Bryan O'Donoghue
ux dmesg thus allowing download of a new image via the BootROM USB download protocol routine. Signed-off-by: Bryan O'Donoghue <bryan.odonog...@linaro.org> Cc: Stefano Babic <sba...@denx.de> Cc: Fabio Estevam <fabio.este...@nxp.com> Cc: Peng Fan <peng@nxp.com> Cc: Albert A

[U-Boot] [PATCH v6 16/25] arm: imx: hab: Add a hab_rvt_check_target to image auth

2018-01-12 Thread Bryan O'Donoghue
and perform that check as directed. Signed-off-by: Bryan O'Donoghue <bryan.odonog...@linaro.org> Cc: Stefano Babic <sba...@denx.de> Cc: Fabio Estevam <fabio.este...@nxp.com> Cc: Peng Fan <peng@nxp.com> Cc: Albert Aribaud <albert.u.b...@aribaud.net> Cc: Sven Ebenfel

[U-Boot] [PATCH v6 12/25] arm: imx: hab: Print CSF based on IVT descriptor

2018-01-12 Thread Bryan O'Donoghue
The IVT gives the absolute address of the CSF. There is no requirement for the CSF to be located adjacent to the IVT so lets use the address provided in the IVT header instead of the hard-coded fixed CSF offset currently in place. Signed-off-by: Bryan O'Donoghue <bryan.odonog...@linaro.org&

[U-Boot] [PATCH v6 24/25] arm: imx: hab: Implement hab_rvt_failsafe

2018-01-12 Thread Bryan O'Donoghue
on the alternative BootROM API. Signed-off-by: Bryan O'Donoghue <bryan.odonog...@linaro.org> Cc: Stefano Babic <sba...@denx.de> Cc: Fabio Estevam <fabio.este...@nxp.com> Cc: Peng Fan <peng@nxp.com> Cc: Albert Aribaud <albert.u.b...@aribaud.net> Cc: Sven Ebenfeld <sv

Re: [U-Boot] [U-Boot, v4, 07/11] spl: add support to booting with OP-TEE

2018-01-18 Thread Bryan O'Donoghue
On 18/01/18 01:31, Kever Yang wrote: I don't think we can reuse IH_TYPE_TEEļ¼Œ it use a optee.img type create by mkimage and it seem use more then one cpu. Don't really understand what you mean by using more than one CPU - can you give an example in the code ? --- bod

[U-Boot] [PATCH v3 6/9] tools: mkimage: add optee image type

2018-01-23 Thread Bryan O'Donoghue
hecks on. Subsequent patches add logic to perform those optee-specific changes prior to handing over control as described in flow #1 above. Signed-off-by: Bryan O'Donoghue <bryan.odonog...@linaro.org> Cc: Harinarayan Bhatta <harinara...@ti.com> Cc: Andrew F. Davis <a...@ti.com&g

[U-Boot] [PATCH 2/2] warp7 : run sec_init for CAAM RNG

2018-01-23 Thread Bryan O'Donoghue
s to a non-TrustZone context. Linux then simply has to detect or be told to skip RNG initialisation. This change is safe both for the OPTEE/TrustZone boot path and the regular non-OPTEE/TrustZone boot path. Signed-off-by: Bryan O'Donoghue <bryan.odonog...@linaro.org> Cc: Fabio Estevam <fa

[U-Boot] [PATCH 1/2] drivers/crypto/fsl: assign job-rings to non-TrustZone

2018-01-23 Thread Bryan O'Donoghue
skip HWRNG initialisation makes CAAM usable to Linux with TrustZone enabled. Signed-off-by: Bryan O'Donoghue <bryan.odonog...@linaro.org> Cc: Fabio Estevam <fabio.este...@nxp.com> Cc: Peng Fan <peng@nxp.com> Cc: Alex Porosanu <alexandru.poros...@nxp.com> Cc: Ruchika Gupta <ruc

[U-Boot] [PATCH v3 4/9] optee: Add optee_image_get_entry_point()

2018-01-23 Thread Bryan O'Donoghue
Add a helper function for extracting the least significant 32 bits from the OPTEE entry point address, which will be good enough to load OPTEE binaries up to (2^32)-1 bytes. We may need to extend this out later on but for now (2^32)-1 should be fine. Signed-off-by: Bryan O'Donoghue <bryan.odo

[U-Boot] [PATCH v3 9/9] bootm: optee: Add mechanism to validate an OPTEE image before boot

2018-01-23 Thread Bryan O'Donoghue
This patch makes it possible to verify the contents and location of an OPTEE image in DRAM prior to handing off control to that image. If image verification fails we won't try to boot any further. Signed-off-by: Bryan O'Donoghue <bryan.odonog...@linaro.org> Cc: Harinarayan Bhatta <

[U-Boot] [PATCH v3 5/9] optee: Add optee_image_get_load_addr()

2018-01-23 Thread Bryan O'Donoghue
This patch adds optee_image_get_load_addr() a helper function used to calculate the load-address of an OPTEE image based on the lower entry-point address given in the OPTEE header. Signed-off-by: Bryan O'Donoghue <bryan.odonog...@linaro.org> Cc: Harinarayan Bhatta <harinara...@ti.com>

[U-Boot] [PATCH v3 0/9] Add new OPTEE bootm support to u-boot

2018-01-23 Thread Bryan O'Donoghue
SPL image takes a different image type IH_TYPE_OPTEE_SPL ? to indicate the different behavior your image type has versus a directly bootable bootm image. Bryan O'Donoghue (9): optee: Add lib entries for sharing OPTEE code across ports optee: Add CONFIG_OPTEE_TZDRAM_SIZE optee: Add CONFIG_OPTEE_TZD

[U-Boot] [PATCH v3 1/9] optee: Add lib entries for sharing OPTEE code across ports

2018-01-23 Thread Bryan O'Donoghue
as more functionality gets added. Signed-off-by: Bryan O'Donoghue <bryan.odonog...@linaro.org> Cc: Harinarayan Bhatta <harinara...@ti.com> Cc: Andrew F. Davis <a...@ti.com> Cc: Tom Rini <tr...@konsulko.com> Cc: Kever Yang <kever.y...@rock-chips.com> Cc: Philipp Toms

[U-Boot] [PATCH v3 3/9] optee: Add CONFIG_OPTEE_TZDRAM_BASE

2018-01-23 Thread Bryan O'Donoghue
prior to trying to boot an OPTEE image. Signed-off-by: Bryan O'Donoghue <bryan.odonog...@linaro.org> Cc: Harinarayan Bhatta <harinara...@ti.com> Cc: Andrew F. Davis <a...@ti.com> Cc: Tom Rini <tr...@konsulko.com> Cc: Kever Yang <kever.y...@rock-chips.com> Cc: Philipp Toms

[U-Boot] [PATCH v3 2/9] optee: Add CONFIG_OPTEE_TZDRAM_SIZE

2018-01-23 Thread Bryan O'Donoghue
to boot an OPTEE image. Signed-off-by: Bryan O'Donoghue <bryan.odonog...@linaro.org> Cc: Harinarayan Bhatta <harinara...@ti.com> Cc: Andrew F. Davis <a...@ti.com> Cc: Tom Rini <tr...@konsulko.com> Cc: Kever Yang <kever.y...@rock-chips.com> Cc: Philipp Tomsich <phil

[U-Boot] [PATCH v3 7/9] optee: Add optee_verify_bootm_image()

2018-01-23 Thread Bryan O'Donoghue
This patch adds optee_verify_bootm_image() which will be subsequently used to verify the parameters encoded in the OPTEE header match the memory allocated to the OPTEE region, OPTEE header magic and version prior to handing off control to the OPTEE image. Signed-off-by: Bryan O'Donoghue

[U-Boot] [PATCH v3 8/9] optee: Add error printout

2018-01-23 Thread Bryan O'Donoghue
When encountering an error in OPTEE verification print out various details of the OPTEE header to aid in further debugging of encountered errors. Signed-off-by: Bryan O'Donoghue <bryan.odonog...@linaro.org> Cc: Harinarayan Bhatta <harinara...@ti.com> Cc: Andrew F. Davis <a...@ti.co

[U-Boot] [PATCH 0/2] Fix CAAM for TrustZone enable for warp7

2018-01-23 Thread Bryan O'Donoghue
/TEE CAAM driver to solve and is out of scope of this patchset. [1] Thanks for all of your help BTW - Peng, there's no way this would be working without you giving direction on how. Bryan O'Donoghue (2): drivers/crypto/fsl: assign job-rings to non-TrustZone warp7 : run sec_init for CAAM RNG

Re: [U-Boot] [PATCH v2 6/9] tools: mkimage: add optee image type

2018-01-23 Thread Bryan O'Donoghue
On 22/01/18 14:46, Andrew F. Davis wrote: As I understand it, that's a board-specific method, which wants to install a TEE (jump into a TEE and return to u-boot), whereas the aim with this patch-set is to chain-load and boot via TEE - OPTEE in this case. This is not board-specific, this is

Re: [U-Boot] [PATCH 3/3] imx: hab: Convert DCD non-NULL error to warning

2018-03-12 Thread Bryan O'Donoghue
On 10/03/18 01:10, Breno Matheus Lima wrote: Hi Bryan, 2018-03-09 10:07 GMT-03:00 Bryan O'Donoghue <bryan.odonog...@linaro.org>: commit 8c4037a09a5c ("imx: hab: Ensure the IVT DCD pointer is Null prior to calling HAB authenticate function.") makes the DCD field being N

Re: [U-Boot] [PATCH 3/3] imx: hab: Convert DCD non-NULL error to warning

2018-03-12 Thread Bryan O'Donoghue
On 12/03/18 16:33, Breno Matheus Lima wrote: The purpose of hab_rvt_authenticate_image() API function is to authenticate additional boot images in a post-ROM stage, initial boot images are supposed to be authenticate only once by the initial ROM code. The HAB implementation in older devices

[U-Boot] [PATCH 1/2] warp7: usb: Introduce a get method for serial number

2018-03-13 Thread Bryan O'Donoghue
on which the device was fabricated/SJC CHALLENGE/ Unique ID 10:0 - FSL-wide unique, encoded LOT ID STD II/SJC CHALLENGE/ Unique ID The 64 bits of data generate a unique serial number per-chip. Signed-off-by: Bryan O'Donoghue <bryan.odonog...@linaro.org> Cc: Fabio Estevam <fabio.este..

[U-Boot] [PATCH 2/2] warp7: usb: Set u-boot serial# based on OTP value

2018-03-13 Thread Bryan O'Donoghue
0xf42400d300d4-0:0 Signed-off-by: Bryan O'Donoghue <bryan.odonog...@linaro.org> Cc: Fabio Estevam <fabio.este...@nxp.com> Reviewed-by: Rui Miguel Silva <rui.si...@linaro.org> Reviewed-by: Ryan Harkin <ryan.har...@linaro.org> --- board/warp7/warp7.c | 12 1 fi

[U-Boot] [PATCH 0/2] NXP WaARP7 set serial# from OTP fuses for USB iSerial

2018-03-13 Thread Bryan O'Donoghue
environment, hopefully its useful and acceptable to others. Bryan O'Donoghue (2): warp7: usb: Introduce a get method for serial number warp7: usb: Set u-boot serial# based on OTP value board/warp7/warp7.c | 65 + 1 file changed, 65 insertions

Re: [U-Boot] [PATCH 1/2] warp7: usb: Introduce a get method for serial number

2018-03-13 Thread Bryan O'Donoghue
On 13/03/18 13:25, Fabio Estevam wrote: +static int warp7_get_serialid(u64 *id) Maybe you could turn place this function in a common location as it may be useful for others. Ah, looking for a place to stick this as shared code I've found something which already does what this patch does

[U-Boot] [PATCH v2 0/3] NXP WaARP7 set serial# from OTP fuses for USB iSerial

2018-03-13 Thread Bryan O'Donoghue
hopefully its useful and acceptable to others. Bryan O'Donoghue (3): imx: mx7: Fix CONFIG_SERIAL_TAG compilation imx: mx7: Add comment to describe OTP TESTER registers warp7: Set u-boot serial# based on OTP value arch/arm/mach-imx/mx7/soc.c | 22 ++ board/war

[U-Boot] [PATCH v2 1/3] imx: mx7: Fix CONFIG_SERIAL_TAG compilation

2018-03-13 Thread Bryan O'Donoghue
Currently when we define CONFIG_SERIAL_TAG we will barf with a failure to define "struct tag_serialnr". This structure is defined in , this patch includes to fix. Signed-off-by: Bryan O'Donoghue <bryan.odonog...@linaro.org> Cc: Fabio Estevam <fabio.este...@nxp.com&

[U-Boot] [PATCH v2 3/3] warp7: Set u-boot serial# based on OTP value

2018-03-13 Thread Bryan O'Donoghue
ad. With this patch in place the USB mass storage device will appear in /dev/disk/by-id with a unique name based on the OTP value. For example /dev/disk/by-id/usb-Linux_UMS_disk_0_WaRP7-0xf42400d301d4-0:0 Signed-off-by: Bryan O'Donoghue <bryan.odonog...@linaro.org> Cc: Fabio Estevam <f

[U-Boot] [PATCH v2 2/3] imx: mx7: Add comment to describe OTP TESTER registers

2018-03-13 Thread Bryan O'Donoghue
Unique ID 10:0 - FSL-wide unique, encoded LOT ID STD II/SJC CHALLENGE/ Unique ID The 64 bits of data generate a unique serial number per-chip. Signed-off-by: Bryan O'Donoghue <bryan.odonog...@linaro.org> Cc: Fabio Estevam <fabio.este...@nxp.com> Cc: Peng Fan <peng@nxp.co

[U-Boot] [PATCH v6 00/10] Add new OPTEE bootm support to u-boot

2018-03-13 Thread Bryan O'Donoghue
n then be booted directly by bootm. bootm will verify the header contents of the OPTEE binary against the DRAM area carved out in u-boot. If the defined DRAM area does not match the link address specified we refuse to boot. Kever - I'd like to suggest that your OPTEE SPL image takes a different image ty

[U-Boot] [PATCH v6 09/10] image: Add IH_OS_TEE for TEE chain-load boot

2018-03-13 Thread Bryan O'Donoghue
SPL | v U-Boot --> <- OP-TEE | V Linux IH_TYPE_TEE: (mkimage -T tee) Non-Secure Secure BootROM | - | v SPL ---> <- OP-TEE | v U-Boot

[U-Boot] [PATCH v6 08/10] optee: Add error printout

2018-03-13 Thread Bryan O'Donoghue
When encountering an error in OPTEE verification print out various details of the OPTEE header to aid in further debugging of encountered errors. Signed-off-by: Bryan O'Donoghue <bryan.odonog...@linaro.org> Cc: Harinarayan Bhatta <harinara...@ti.com> Cc: Andrew F. Davis <a...@ti.co

[U-Boot] [PATCH v6 06/10] optee: Add optee_image_get_load_addr()

2018-03-13 Thread Bryan O'Donoghue
This patch adds optee_image_get_load_addr() a helper function used to calculate the load-address of an OPTEE image based on the lower entry-point address given in the OPTEE header. Signed-off-by: Bryan O'Donoghue <bryan.odonog...@linaro.org> Cc: Harinarayan Bhatta <harinara...@ti.com>

[U-Boot] [PATCH v6 07/10] optee: Add optee_verify_bootm_image()

2018-03-13 Thread Bryan O'Donoghue
This patch adds optee_verify_bootm_image() which will be subsequently used to verify the parameters encoded in the OPTEE header match the memory allocated to the OPTEE region, OPTEE header magic and version prior to handing off control to the OPTEE image. Signed-off-by: Bryan O'Donoghue

[U-Boot] [PATCH v6 01/10] optee: Add lib entries for sharing OPTEE code across ports

2018-03-13 Thread Bryan O'Donoghue
as more functionality gets added. Signed-off-by: Bryan O'Donoghue <bryan.odonog...@linaro.org> Cc: Harinarayan Bhatta <harinara...@ti.com> Cc: Andrew F. Davis <a...@ti.com> Cc: Tom Rini <tr...@konsulko.com> Cc: Kever Yang <kever.y...@rock-chips.com> Cc: Philipp Toms

[U-Boot] [PATCH v6 10/10] bootm: optee: Add a bootm command for type IH_OS_TEE

2018-03-13 Thread Bryan O'Donoghue
This patch makes it possible to verify the contents and location of an OPTEE image in DRAM prior to handing off control to that image. If image verification fails we won't try to boot any further. Signed-off-by: Bryan O'Donoghue <bryan.odonog...@linaro.org> Suggested-by: Andrew F.

[U-Boot] [PATCH v6 02/10] optee: Add CONFIG_OPTEE_TZDRAM_SIZE

2018-03-13 Thread Bryan O'Donoghue
to boot an OPTEE image. Signed-off-by: Bryan O'Donoghue <bryan.odonog...@linaro.org> Cc: Harinarayan Bhatta <harinara...@ti.com> Cc: Andrew F. Davis <a...@ti.com> Cc: Tom Rini <tr...@konsulko.com> Cc: Kever Yang <kever.y...@rock-chips.com> Cc: Philipp Tomsich <phil

[U-Boot] [PATCH v6 03/10] optee: Add CONFIG_OPTEE_TZDRAM_BASE

2018-03-13 Thread Bryan O'Donoghue
prior to trying to boot an OPTEE image. Signed-off-by: Bryan O'Donoghue <bryan.odonog...@linaro.org> Cc: Harinarayan Bhatta <harinara...@ti.com> Cc: Andrew F. Davis <a...@ti.com> Cc: Tom Rini <tr...@konsulko.com> Cc: Kever Yang <kever.y...@rock-chips.com> Cc: Philipp Toms

[U-Boot] [PATCH v6 05/10] optee: Add optee_image_get_entry_point()

2018-03-13 Thread Bryan O'Donoghue
Add a helper function for extracting the least significant 32 bits from the OPTEE entry point address, which will be good enough to load OPTEE binaries up to (2^32)-1 bytes. We may need to extend this out later on but for now (2^32)-1 should be fine. Signed-off-by: Bryan O'Donoghue <bryan.odo

[U-Boot] [PATCH v6 04/10] optee: Add CONFIG_OPTEE_LOAD_ADDR

2018-03-13 Thread Bryan O'Donoghue
CONFIG_OPTEE_LOAD_ADDR appear in u-boot.cfg. Adding new CONFIG entires to u-boot should be kconfig driven so this patch does just that. Signed-off-by: Bryan O'Donoghue <bryan.odonog...@linaro.org> Reviewed-by: Ryan Harkin <ryan.har...@linaro.org> --- lib/optee/Kconfig | 6 ++ 1 file changed,

[U-Boot] [PATCH v5 01/10] optee: Add lib entries for sharing OPTEE code across ports

2018-03-09 Thread Bryan O'Donoghue
as more functionality gets added. Signed-off-by: Bryan O'Donoghue <bryan.odonog...@linaro.org> Cc: Harinarayan Bhatta <harinara...@ti.com> Cc: Andrew F. Davis <a...@ti.com> Cc: Tom Rini <tr...@konsulko.com> Cc: Kever Yang <kever.y...@rock-chips.com> Cc: Philipp Toms

[U-Boot] [PATCH v5 00/10] Add new OPTEE bootm support to u-boot

2018-03-09 Thread Bryan O'Donoghue
area does not match the link address specified we refuse to boot. Kever - I'd like to suggest that your OPTEE SPL image takes a different image type IH_TYPE_OPTEE_SPL ? to indicate the different behavior your image type has versus a directly bootable bootm image. Bryan O'Donoghue (10): optee: Add lib e

[U-Boot] [PATCH v5 05/10] optee: Add optee_image_get_entry_point()

2018-03-09 Thread Bryan O'Donoghue
Add a helper function for extracting the least significant 32 bits from the OPTEE entry point address, which will be good enough to load OPTEE binaries up to (2^32)-1 bytes. We may need to extend this out later on but for now (2^32)-1 should be fine. Signed-off-by: Bryan O'Donoghue <bryan.odo

<    1   2   3   4   5   6   >