[U-Boot] [PATCH 1/2] mx7: Place MX7_SEC option in Kconfig

MX7_SEC is an existing configuration option that allows booting the kernel in secure mode.
Place this option in Kconfig, so that boards can select this option in their defconfig files.
Selecting this option is necessary when booting a kernel provided by NXP, such as 3.14_GA and 4.1.15_GA.
Signed-off-by: Fabio Estevam fabio.estevam@nxp.com --- arch/arm/imx-common/Kconfig | 9 +++++++++ 1 file changed, 9 insertions(+)
diff --git a/arch/arm/imx-common/Kconfig b/arch/arm/imx-common/Kconfig index 1b7da5a..c6b38bc 100644 --- a/arch/arm/imx-common/Kconfig +++ b/arch/arm/imx-common/Kconfig @@ -17,3 +17,12 @@ config IMX_BOOTAUX depends on ARCH_MX7 || ARCH_MX6 help bootaux [addr] to boot auxiliary core. + +config MX7_SEC + bool "Support booting MX7 in secure mode" + depends on ARCH_MX7 + help + NXP kernel requires to boot MX7 in secure mode. Select + this options if you want to boot a NXP kernel. In order + to boot a mainline kernel this option needs to be + unselected.

Booting a NXP kernel with mainline U-boot leads to the following kernel crash:
caam: probe of 30900000.caam failed with error -11 Unable to handle kernel NULL pointer dereference at virtual address 00000004 pgd = 80004000 [00000004] *pgd=00000000 Internal error: Oops: 805 [#1] PREEMPT SMP ARM
This happens because NXP kernel expects MX7 to boot in secure mode, so introduce mx7dsabresd_secure_defconfig that selects CONFIG_MX7_SEC and allows booting a NXP provided kernel successfully.
Signed-off-by: Fabio Estevam fabio.estevam@nxp.com --- configs/mx7dsabresd_secure_defconfig | 38 ++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 configs/mx7dsabresd_secure_defconfig
diff --git a/configs/mx7dsabresd_secure_defconfig b/configs/mx7dsabresd_secure_defconfig new file mode 100644 index 0000000..9e49004 --- /dev/null +++ b/configs/mx7dsabresd_secure_defconfig @@ -0,0 +1,38 @@ +CONFIG_ARM=y +CONFIG_ARCH_MX7=y +CONFIG_TARGET_MX7DSABRESD=y +CONFIG_IMX_RDC=y +CONFIG_IMX_BOOTAUX=y +CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=board/freescale/mx7dsabresd/imximage.cfg" +CONFIG_HUSH_PARSER=y +# CONFIG_CMD_BOOTD is not set +CONFIG_CMD_BOOTZ=y +# CONFIG_CMD_IMI is not set +# CONFIG_CMD_IMLS is not set +# CONFIG_CMD_XIMG is not set +# CONFIG_CMD_EXPORTENV is not set +# CONFIG_CMD_IMPORTENV is not set +CONFIG_CMD_MEMTEST=y +CONFIG_CMD_MMC=y +CONFIG_CMD_I2C=y +CONFIG_CMD_USB=y +CONFIG_CMD_DFU=y +CONFIG_CMD_USB_MASS_STORAGE=y +CONFIG_CMD_GPIO=y +CONFIG_CMD_DHCP=y +CONFIG_CMD_MII=y +CONFIG_CMD_PING=y +CONFIG_CMD_CACHE=y +CONFIG_CMD_EXT2=y +CONFIG_CMD_EXT4=y +CONFIG_CMD_EXT4_WRITE=y +CONFIG_CMD_FAT=y +CONFIG_USB=y +CONFIG_USB_GADGET=y +CONFIG_CI_UDC=y +CONFIG_USB_GADGET_DOWNLOAD=y +CONFIG_G_DNL_MANUFACTURER="FSL" +CONFIG_G_DNL_VENDOR_NUM=0x0525 +CONFIG_G_DNL_PRODUCT_NUM=0xa4a5 +CONFIG_OF_LIBFDT=y +CONFIG_MX7_SEC=y

Hi Stefano,
On Fri, Jun 10, 2016 at 9:46 AM, Fabio Estevam fabio.estevam@nxp.com wrote:
MX7_SEC is an existing configuration option that allows booting the kernel in secure mode.
Place this option in Kconfig, so that boards can select this option in their defconfig files.
Selecting this option is necessary when booting a kernel provided by NXP, such as 3.14_GA and 4.1.15_GA.
Signed-off-by: Fabio Estevam fabio.estevam@nxp.com
Any comments about this one?
Also, it would be nice if you could create a 'next' branch so that non bug fixes could be collected there.
Thanks

Hi Fabio,
On 17/06/2016 13:59, Fabio Estevam wrote:
Hi Stefano,
On Fri, Jun 10, 2016 at 9:46 AM, Fabio Estevam fabio.estevam@nxp.com wrote:
MX7_SEC is an existing configuration option that allows booting the kernel in secure mode.
Place this option in Kconfig, so that boards can select this option in their defconfig files.
Selecting this option is necessary when booting a kernel provided by NXP, such as 3.14_GA and 4.1.15_GA.
Signed-off-by: Fabio Estevam fabio.estevam@nxp.com
Any comments about this one?
It is in my queue for applying it.
Also, it would be nice if you could create a 'next' branch so that non bug fixes could be collected there.
Sure - I am still busy, but I plan to do this in the week-end, and also applying the bug fixes to -master.
Regards, Stefano

Hi
On Fri, Jun 17, 2016 at 2:50 PM, Stefano Babic sbabic@denx.de wrote:
Hi Fabio,
On 17/06/2016 13:59, Fabio Estevam wrote:
Hi Stefano,
On Fri, Jun 10, 2016 at 9:46 AM, Fabio Estevam fabio.estevam@nxp.com wrote:
MX7_SEC is an existing configuration option that allows booting the kernel in secure mode.
Place this option in Kconfig, so that boards can select this option in their defconfig files.
Selecting this option is necessary when booting a kernel provided by NXP, such as 3.14_GA and 4.1.15_GA.
Signed-off-by: Fabio Estevam fabio.estevam@nxp.com
Any comments about this one?
It is in my queue for applying it.
Also, it would be nice if you could create a 'next' branch so that non bug fixes could be collected there.
Sure - I am still busy, but I plan to do this in the week-end, and also applying the bug fixes to -master.
Good, I was having this problem on my booting
Michael
Regards, Stefano
--
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic@denx.de ===================================================================== _______________________________________________ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot

On Fri, Jun 17, 2016 at 9:56 AM, Michael Trimarchi michael@amarulasolutions.com wrote:
Good, I was having this problem on my booting
Great, in this case providing a Tested-by tag would be nice :-)

Hi
On Fri, Jun 17, 2016 at 4:54 PM, Fabio Estevam festevam@gmail.com wrote:
On Fri, Jun 17, 2016 at 9:56 AM, Michael Trimarchi michael@amarulasolutions.com wrote:
Good, I was having this problem on my booting
Great, in this case providing a Tested-by tag would be nice :-)
Yes I will do. Different design ;) but way tonight ;)
Michael

Hi Stefano
On Fri, Jun 17, 2016 at 4:55 PM, Michael Trimarchi michael@amarulasolutions.com wrote:
Hi
On Fri, Jun 17, 2016 at 4:54 PM, Fabio Estevam festevam@gmail.com wrote:
On Fri, Jun 17, 2016 at 9:56 AM, Michael Trimarchi michael@amarulasolutions.com wrote:
Good, I was having this problem on my booting
Great, in this case providing a Tested-by tag would be nice :-)
Yes I will do. Different design ;) but way tonight ;)
Tested-by: Michael Trimarchi michael@amarulasolutions.com
Michael
-- | Michael Nazzareno Trimarchi Amarula Solutions BV | | COO - Founder Cruquiuskade 47 | | +31(0)851119172 Amsterdam 1018 AM NL | | [`as] http://www.amarulasolutions.com |

On 17/06/2016 14:56, Michael Trimarchi wrote:
Hi
On Fri, Jun 17, 2016 at 2:50 PM, Stefano Babic sbabic@denx.de wrote:
Hi Fabio,
On 17/06/2016 13:59, Fabio Estevam wrote:
Hi Stefano,
On Fri, Jun 10, 2016 at 9:46 AM, Fabio Estevam fabio.estevam@nxp.com wrote:
MX7_SEC is an existing configuration option that allows booting the kernel in secure mode.
Place this option in Kconfig, so that boards can select this option in their defconfig files.
Selecting this option is necessary when booting a kernel provided by NXP, such as 3.14_GA and 4.1.15_GA.
Signed-off-by: Fabio Estevam fabio.estevam@nxp.com
Any comments about this one?
Applied to -next, thanks !
Best regards, Stefano Babic

On Fri, Jun 17, 2016 at 9:50 AM, Stefano Babic sbabic@denx.de wrote:
Sure - I am still busy, but I plan to do this in the week-end, and also applying the bug fixes to -master.
Excellent, thanks!
participants (4)
-
Fabio Estevam
-
Fabio Estevam
-
Michael Trimarchi
-
Stefano Babic