HAB on iMX6

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

HAB on iMX6

Jump to solution
4,365 Views
AlbertT
Contributor V

Hello,

I am currently working on the implementation of the secured boot on an iMX6 and I have a few questions that I can't solve :

1) In the reference manual one can find the description of all eFuses and if they can be overridden by a GPIO, I am interested in the SRK_HASH one, regarding to this possibility it is written NA, others are marked Yes or No, but this one is NA. So is it possible to blow a key in the fuse and change it after ? I am almost sure that it is impossible but I just need a confirmation from experimented users !

2) Still regarding the GPIO that will override the fuses, where and when is it possible to define the value they will take ?

3) In multiple documents I found the documentation for the HAB API, for instance the pdf AN4581 gives some code which will display events, but I don't where I have to put it and from where I should call this functions.

I hope you guys could help me, thanks a lot !

Jocelyn

Labels (2)
Tags (3)
0 Kudos
1 Solution
1,738 Views
rodz
Contributor III

Jocelyn,

That depends on the board you are using.  Some boards do not use GPIOs since the boot configuration is fixed and cannot be changed.  Other boards such as the Freescale Sabre board for Smart Devices includes support for changing the boot configuration.  See SW6 on page 4 of: http://cache.freescale.com/files/32bit/doc/quick_start_guide/SABRESDB_IMX6_QSG.pdf?fpsp=1.

Regards,

-Rod

View solution in original post

0 Kudos
12 Replies
1,738 Views
Yuri
NXP Employee
NXP Employee

1.
The fuses are once programmed.

2

Setting can be overridden by GPIO settings when GPIO_FUSE_SEL fuse is not blown (this is default state).

3.
The HAB API document may be found in CST_TOOL package

Freescale Code Signing Tool for the High Assurance Boot library. Provides software code signing supp...

i.MX6Q Product Summary Page

1,738 Views
AlbertT
Contributor V

Thanks for your help !

2) When I said where I meant at which stage of the boot or in which file can I define the values of GPIO ?

3) Yes I found this, but where should I make the call to this functions of the API ? I guess in the imx6q_sabresd.c of u-boot. I am not sure.

Edit : I just managed to call the HAB event report, for those who need : copy/paste the small API which is in the appendix of AN4581.pdf in the file linked to your board in u-boot/board/freescale/<your_board>/<your_board>.c and call functions in checkboard for instance. But I don't know if it reports errors concerning the uImage or just the u-boot...

0 Kudos
1,738 Views
rodz
Contributor III

Hi Jocelyn,

For #2.  The GPIO_FUSE_SEL controls HW logic to determine if the boot parameters in the sbmr register of the src module come from GPIO pins or efuses.  At reset the HW will populate the sbmr register from the appropriate source depending on the value of GPIO_FUSE_SEL.  Once the ROM begins executing it will read the sbmr register to determine the boot configuration.  This means that GPIOs signals need to be asserted when i.MX6 comes out of reset.  On Freescale reference boards the GPIO pins are connected to DIP switches.

For #3: The manner you are using the report event API, as indicated in your "Edit" above, is correct.  The events returned by report event are only those HAB has recorded up to that point.  So if you call report event API in u-boot before calling the authenticate image API for the uImage then only events for the u-boot authentication are returned.

Regards,

-Rod

0 Kudos
1,738 Views
AlbertT
Contributor V

Hello Rod,

2) So that means I need to use the MFG tool to set GPIOs I need ? Currently I'm not using it at all so that would force me to generate my U-boot and uImage, both signed in my linux environment, copy it to a windows and set everything for the mfg. And in the command list I could change the value of EIM_DA9 for instance ? I looked for DIP in the reference manual but I can't find informations about it.

3) Ok ! And if I need to get the events of the authentication of the uImage, how could I do it ?

Thank you !

Jocelyn

EDIT : I just found in the reference manual the DCD, so if I create a write command to EIM_DA9 (there is the @ of EIM registers) maybe it could work ?

0 Kudos
1,738 Views
rodz
Contributor III


Hi Jocyln,

2.) No,  the GPIOs are fixed and the IOMUX settings are programmed appropriately by the boot ROM.  There is nothing you need to do in u-boot or in the Linux kernel. The GPIO_FUSE_SEL is for use by the boot ROM.  The DIP switch will not be documentented in the RM but will be included in the documentation for the board you are using.

The point of the GPIOs is that the boot mode setting that the ROM uses can be easily changed with switchs on the board rather than having to burn OTP efuses.

3.) The easiest way to do this is to add a second call to report event after you've called the authenticate image API in u-boot to authenticate uImage.

Regards,

-Rod.

1,738 Views
AlbertT
Contributor V

Hi Rod !

2) You mean that one could change the boot mode settings (aka GPIO ? but you said they were fixed so I miss something here) with a physical switch on the board ?

3) Ok that makes sense !

Thanks for your help, I know I have a lot of questions :smileyhappy:

EDIT : I have an other issue. I have to modify u-boot, so I run ./ltib -m prep -p u-boot and I get u-boot-2009... under rpm/BUILD/. I make my modifications to mx6q_sabresd.c (under board/freescale/mx6q_sabresd), I use ./ltib -m scbuild -p u-boot && ./ltib -m scdeploy -p u-boot to get a new u-boot.bin in rootfs/boot, but when I run it on the plateform, my modifications don't appear (these are just some printf). I don't understand why my modifications are not applied.

EDIT 2 : never-mind, I set a bad macro so that's why it didn't worked well...

0 Kudos
1,738 Views
rodz
Contributor III

Jocelyn,

Yes, exactly.  The GPIOs are an alternative source for changing the boot mode settings rather than efuses, which are one-time-programmable,  What I mean by fixed is the GPIO pin assignments cannot be changed (to different pins) since they selected by the ROM which cannot be changed.  The state of each of the pins can be either 0 or 1 depending on the corresponding switch setting.

Regards,

-Rod

0 Kudos
1,738 Views
AlbertT
Contributor V

Hello Rod,

Ok, I was not sure but now it's ok. Then how can I change their value to 0 or 1 ?

Thank you so much for your help.

Jocelyn

EDIT : Furthermore I would like to find the fuse map for iMX6, in the reference manual it is said we have to ask directly to Freescale.

0 Kudos
1,739 Views
rodz
Contributor III

Jocelyn,

That depends on the board you are using.  Some boards do not use GPIOs since the boot configuration is fixed and cannot be changed.  Other boards such as the Freescale Sabre board for Smart Devices includes support for changing the boot configuration.  See SW6 on page 4 of: http://cache.freescale.com/files/32bit/doc/quick_start_guide/SABRESDB_IMX6_QSG.pdf?fpsp=1.

Regards,

-Rod

0 Kudos
1,738 Views
AlbertT
Contributor V

Hello Rod !

Actually yes I have a sabreq SD, I managed to modify the boot configuration using this physical switch, but the way I can change other GPIO's value still remain a mystery !

Thanks again.

Jocelyn

0 Kudos
1,738 Views
veezhi
Contributor II

I am using imx6 quadcore cortex A9 and trying to implement HAB. I have successfully able to burn the keys. Subsequently my boot is not getting authenticated. I suspect some issues in the signing tool. Need help on the signing tool that we need to use for IMX 6 quadcore Arm A9, and amy specific config parameters we need to set specifically for IMX6q.

0 Kudos
1,738 Views
veezhi
Contributor II

I am using imx6 quadcore cortex A9 and trying to implement HAB. I have successfully able to burn the keys. Subsequently my boot is not getting authenticated. I suspect some issues in the signing tool. Need help on the signing tool that we need to use for IMX 6 quadcore Arm A9, and amy specific config parameters we need to set specifically for IMX6q.

0 Kudos