diff mbox

[U-Boot] warp7: Adjust CONFIG_MMCROOT for booting a mainline kernel

Message ID CAOMZO5DGagKtALRrfwSMA7RuD=HMcH+NjLjAxCSwWWGPM3+KPQ@mail.gmail.com
State Changes Requested
Delegated to: Stefano Babic
Headers show

Commit Message

Fabio Estevam Aug. 25, 2016, 8:26 p.m. UTC
Hi Otavio,

On Thu, Aug 25, 2016 at 5:13 PM, Otavio Salvador
<otavio.salvador@ossystems.com.br> wrote:
> On Thu, Aug 25, 2016 at 3:27 PM, Fabio Estevam <fabio.estevam@nxp.com> wrote:
>> When booting a mainline kernel on warp7 we have:
>> - mmc0: Wifi SDIO chip
>> - mmc1: eMMC
>>
>> , so point CONFIG_MMCROOT to use mmcblk1 instead.
>>
>> Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>
>
> As far as I know, the sold WaRP7 boards are shipped with the NXP
> kernel so if this patch is applied, the U-Boot won't work out of box
> for most of users

Currently U-Boot mainline does not boot NXP kernel, so I am not
breaking anything here.

To better handle NXP kernel I can add a 'warp7_secure_defconfig' and
then do like this
to handle the mmcroot:

http://lists.denx.de/mailman/listinfo/u-boot

Comments

Otavio Salvador Aug. 25, 2016, 8:56 p.m. UTC | #1
On Thu, Aug 25, 2016 at 5:26 PM, Fabio Estevam <festevam@gmail.com> wrote:
> On Thu, Aug 25, 2016 at 5:13 PM, Otavio Salvador
> <otavio.salvador@ossystems.com.br> wrote:
>> On Thu, Aug 25, 2016 at 3:27 PM, Fabio Estevam <fabio.estevam@nxp.com> wrote:
>>> When booting a mainline kernel on warp7 we have:
>>> - mmc0: Wifi SDIO chip
>>> - mmc1: eMMC
>>>
>>> , so point CONFIG_MMCROOT to use mmcblk1 instead.
>>>
>>> Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>
>>
>> As far as I know, the sold WaRP7 boards are shipped with the NXP
>> kernel so if this patch is applied, the U-Boot won't work out of box
>> for most of users
>
> Currently U-Boot mainline does not boot NXP kernel, so I am not
> breaking anything here.

Well ...

warp7: Select secure boot

In order to boot NXP 4.1.15 we need to boot in secure mode.

So enable the variable CONFIG_ARMV7_BOOT_SEC_DEFAULT by default.

Signed-off-by: Breno Lima <breno.lima@nxp.com>

From Breno, sent to the mailing list, does fix this and so it does work.

> To better handle NXP kernel I can add a 'warp7_secure_defconfig' and
> then do like this
> to handle the mmcroot:
>
> --- a/include/configs/warp7.h
> +++ b/include/configs/warp7.h
> @@ -113,7 +113,11 @@
>
>  #define CONFIG_SYS_MMC_ENV_DEV         0
>  #define CONFIG_SYS_MMC_ENV_PART                0
> -#define CONFIG_MMCROOT                 "/dev/mmcblk2p2"
> +#ifdef CONFIG_ARMV7_BOOT_SEC_DEFAULT
> +#define CONFIG_MMCROOT                 "/dev/mmcblk2p2" /* NXP kernel */
> +#else
> +#define CONFIG_MMCROOT                 "/dev/mmcblk1p2" /* Mainline kernel */
> +#endif

Someone using mainline kernel is expected to know how to set mmcroot
variable or so. I would not include this patch at all.
Fabio Estevam Aug. 25, 2016, 9:01 p.m. UTC | #2
On Thu, Aug 25, 2016 at 5:56 PM, Otavio Salvador
<otavio.salvador@ossystems.com.br> wrote:

> Well ...
>
> warp7: Select secure boot
>
> In order to boot NXP 4.1.15 we need to boot in secure mode.
>
> So enable the variable CONFIG_ARMV7_BOOT_SEC_DEFAULT by default.
>
> Signed-off-by: Breno Lima <breno.lima@nxp.com>
>
> From Breno, sent to the mailing list, does fix this and so it does work.

No, this is only available in u-boot-fslc.

>
>> To better handle NXP kernel I can add a 'warp7_secure_defconfig' and
>> then do like this
>> to handle the mmcroot:
>>
>> --- a/include/configs/warp7.h
>> +++ b/include/configs/warp7.h
>> @@ -113,7 +113,11 @@
>>
>>  #define CONFIG_SYS_MMC_ENV_DEV         0
>>  #define CONFIG_SYS_MMC_ENV_PART                0
>> -#define CONFIG_MMCROOT                 "/dev/mmcblk2p2"
>> +#ifdef CONFIG_ARMV7_BOOT_SEC_DEFAULT
>> +#define CONFIG_MMCROOT                 "/dev/mmcblk2p2" /* NXP kernel */
>> +#else
>> +#define CONFIG_MMCROOT                 "/dev/mmcblk1p2" /* Mainline kernel */
>> +#endif
>
> Someone using mainline kernel is expected to know how to set mmcroot
> variable or so. I would not include this patch at all.

This would be a bad customer experience. Much better when things work
out of the box.
Otavio Salvador Aug. 25, 2016, 9:06 p.m. UTC | #3
On Thu, Aug 25, 2016 at 6:01 PM, Fabio Estevam <festevam@gmail.com> wrote:
> On Thu, Aug 25, 2016 at 5:56 PM, Otavio Salvador
> <otavio.salvador@ossystems.com.br> wrote:
...
>> Someone using mainline kernel is expected to know how to set mmcroot
>> variable or so. I would not include this patch at all.
>
> This would be a bad customer experience. Much better when things work
> out of the box.

Mangling the mmcroot depending of secure boot is hidden things from
user, in my point of view.

I am not the i.MX or WaRP7 maintainer so it is not my call but if I
were to decide I prefer default to be kept working with NXP kernel. To
accept this change, I would prefer if NXP kernel was changed in a way
it uses same mmcroot as will be used in mainline so if user upgrades
it, he/she has a consistent behaviour.
Fabio Estevam Aug. 25, 2016, 11:06 p.m. UTC | #4
Hi Otavio,

On Thu, Aug 25, 2016 at 6:06 PM, Otavio Salvador
<otavio.salvador@ossystems.com.br> wrote:

> Mangling the mmcroot depending of secure boot is hidden things from
> user, in my point of view.

Yes, I agree.

It seems like a more elegant solution is to use UUID to specify the
rootfs location.

Will prepare a v2.

Thanks
diff mbox

Patch

--- a/include/configs/warp7.h
+++ b/include/configs/warp7.h
@@ -113,7 +113,11 @@ 

 #define CONFIG_SYS_MMC_ENV_DEV         0
 #define CONFIG_SYS_MMC_ENV_PART                0
-#define CONFIG_MMCROOT                 "/dev/mmcblk2p2"
+#ifdef CONFIG_ARMV7_BOOT_SEC_DEFAULT
+#define CONFIG_MMCROOT                 "/dev/mmcblk2p2" /* NXP kernel */
+#else
+#define CONFIG_MMCROOT                 "/dev/mmcblk1p2" /* Mainline kernel */
+#endif
_______________________________________________
U-Boot mailing list
U-Boot@lists.denx.de