Skip to contentSkip to conversation

Converting CONFIG_SPL_BOOT_DEVICE to Kconfig in U-Boot

DISCUSSION Tom Rini 2 participants 5 messages May 28, 2022

lore
Share & tools
lore

Tom Rini

author
#0 lore raw

Hey folks,

As part of converting outstanding CONFIG symbols to Kconfig, I've run in to CONFIG_SPL_BOOT_DEVICE and while I think I see how to do it, it would be better I think if someone that has the hardware and can test the logic out, does it.

In short, I believe we need to:
- SPL_BOOT_SPI_NOR_FLASH / SPL_BOOT_SDIO_MMC_CARD become a choice section in arch/arm/mach-mvebu/Kconfig, guarded by !SECURED_MODE_IMAGE
- KWB_CFG_SEC_BOOT_DEV in arch/arm/mach-mvebu/Makefile gets updated based on how the Kconfig logic now works.
- In the case of CONFIG_SPL_BOOT_SDIO_MMC_CARD (or whatever it's named) and MMC_SDHCI we just have that value defined and drivers/mmc/sdhci.c is updated to check it for SPL. Or if this is possibly useful outside of SPL, we make use of CONFIG_VAL and have 'SPL_FIXED_SDHCI_ALIGNED_BUFFER' be set for the current case.
- CONFIG_SPL_BOOT_DEVICE is removed

I think that covers everything, but please let me know if I missed something or I got the logic wrong or something. Thanks!

Signature · 1 line
Tom
#1 lore raw

Hi Tom,

Quoted 19 lines · Tom Rini,

Hey folks,

As part of converting outstanding CONFIG symbols to Kconfig, I've run in to CONFIG_SPL_BOOT_DEVICE and while I think I see how to do it, it would be better I think if someone that has the hardware and can test the logic out, does it.

In short, I believe we need to:
- SPL_BOOT_SPI_NOR_FLASH / SPL_BOOT_SDIO_MMC_CARD become a choice section in arch/arm/mach-mvebu/Kconfig, guarded by !SECURED_MODE_IMAGE
- KWB_CFG_SEC_BOOT_DEV in arch/arm/mach-mvebu/Makefile gets updated based on how the Kconfig logic now works.
- In the case of CONFIG_SPL_BOOT_SDIO_MMC_CARD (or whatever it's named) and MMC_SDHCI we just have that value defined and drivers/mmc/sdhci.c is updated to check it for SPL. Or if this is possibly useful outside of SPL, we make use of CONFIG_VAL and have 'SPL_FIXED_SDHCI_ALIGNED_BUFFER' be set for the current case.
- CONFIG_SPL_BOOT_DEVICE is removed

Quoted 3 lines

I think that covers everything, but please let me know if I missed something or I got the logic wrong or something. Thanks!

I can give it a go. All the boards I have access to boot from SPI but I can at least compile test the MMC support.

Quoted 3 lines

--
Tom

author
#2 lore raw
Quoted 23 lines · Chris Packham

Hi Tom,

Quoted 19 lines · Tom Rini,

Hey folks,

As part of converting outstanding CONFIG symbols to Kconfig, I've run in to CONFIG_SPL_BOOT_DEVICE and while I think I see how to do it, it would be better I think if someone that has the hardware and can test the logic out, does it.

In short, I believe we need to:
- SPL_BOOT_SPI_NOR_FLASH / SPL_BOOT_SDIO_MMC_CARD become a choice section in arch/arm/mach-mvebu/Kconfig, guarded by !SECURED_MODE_IMAGE
- KWB_CFG_SEC_BOOT_DEV in arch/arm/mach-mvebu/Makefile gets updated based on how the Kconfig logic now works.
- In the case of CONFIG_SPL_BOOT_SDIO_MMC_CARD (or whatever it's named) and MMC_SDHCI we just have that value defined and drivers/mmc/sdhci.c is updated to check it for SPL. Or if this is possibly useful outside of SPL, we make use of CONFIG_VAL and have 'SPL_FIXED_SDHCI_ALIGNED_BUFFER' be set for the current case.
- CONFIG_SPL_BOOT_DEVICE is removed

Quoted 6 lines
Quoted 3 lines

I think that covers everything, but please let me know if I missed something or I got the logic wrong or something. Thanks!

I can give it a go. All the boards I have access to boot from SPI but I can at least compile test the MMC support.

Thanks!

Signature · 1 line
Tom
#3 lore raw
Quoted 25 lines · Tom Rini
Quoted 23 lines · Chris Packham

Hi Tom,

Quoted 19 lines · Tom Rini,

Hey folks,

As part of converting outstanding CONFIG symbols to Kconfig, I've run in to CONFIG_SPL_BOOT_DEVICE and while I think I see how to do it, it would be better I think if someone that has the hardware and can test the logic out, does it.

In short, I believe we need to:
- SPL_BOOT_SPI_NOR_FLASH / SPL_BOOT_SDIO_MMC_CARD become a choice section in arch/arm/mach-mvebu/Kconfig, guarded by !SECURED_MODE_IMAGE
- KWB_CFG_SEC_BOOT_DEV in arch/arm/mach-mvebu/Makefile gets updated based on how the Kconfig logic now works.
- In the case of CONFIG_SPL_BOOT_SDIO_MMC_CARD (or whatever it's named) and MMC_SDHCI we just have that value defined and drivers/mmc/sdhci.c is updated to check it for SPL. Or if this is possibly useful outside of SPL, we make use of CONFIG_VAL and have 'SPL_FIXED_SDHCI_ALIGNED_BUFFER' be set for the current case.
- CONFIG_SPL_BOOT_DEVICE is removed

Quoted 6 lines
Quoted 6 lines
Quoted 3 lines

I think that covers everything, but please let me know if I missed something or I got the logic wrong or something. Thanks!

I can give it a go. All the boards I have access to boot from SPI but I can at least compile test the MMC support.

Actually it looks even easier.

Baruch already did most of the work in ad105f5f8694 ("mvebu:
consolidate SPL boot device config symbols"). I think the only thing left is converting the remaining 3 boards.

Quoted 5 lines

Thanks!

--
Tom

author
#4 lore raw
Quoted 30 lines · Chris Packham
Quoted 29 lines · Tom Rini
Quoted 27 lines · Chris Packham

Hi Tom,

Quoted 22 lines · Tom Rini,

Hey folks,

As part of converting outstanding CONFIG symbols to Kconfig, I've run in to CONFIG_SPL_BOOT_DEVICE and while I think I see how to do it, it would be better I think if someone that has the hardware and can test the logic out, does it.

In short, I believe we need to:
- SPL_BOOT_SPI_NOR_FLASH / SPL_BOOT_SDIO_MMC_CARD become a choice section in arch/arm/mach-mvebu/Kconfig, guarded by !SECURED_MODE_IMAGE
- KWB_CFG_SEC_BOOT_DEV in arch/arm/mach-mvebu/Makefile gets updated based on how the Kconfig logic now works.
- In the case of CONFIG_SPL_BOOT_SDIO_MMC_CARD (or whatever it's named) and MMC_SDHCI we just have that value defined and drivers/mmc/sdhci.c is updated to check it for SPL. Or if this is possibly useful outside of SPL, we make use of CONFIG_VAL and have 'SPL_FIXED_SDHCI_ALIGNED_BUFFER' be set for the current case.
- CONFIG_SPL_BOOT_DEVICE is removed

I think that covers everything, but please let me know if I missed something or I got the logic wrong or something. Thanks!

Quoted 8 lines
Quoted 2 lines
Quoted 2 lines

I can give it a go. All the boards I have access to boot from SPI but I can at least compile test the MMC support.

Actually it looks even easier.

Baruch already did most of the work in ad105f5f8694 ("mvebu:
consolidate SPL boot device config symbols"). I think the only thing left is converting the remaining 3 boards.

Oh nice. And then FIXED_SDHCI_ALIGNED_BUFFER still needs to be taken care of :)

Signature · 1 line
Tom