[PATCH resend] mmc: kconfig: Add CONFIG_SPL_MMC_VERBOSE

2021-04-06 Thread Klaus Heinrich Kiwi
When building the SPL with MMC config and CONFIG_LOGLEVEL > 7, the
function mmc_select_mode() at drivers/mmc/mmc.c will call
mmc_mode_name() which is only defined if CONFIG_IS_ENABLED(MMC_VERBOSE)
which doesn't have a corresponding CONFIG_SPL_MMC_VERBOSE defined in
Kconfig.

Fixes this build error:

arm-linux-gnueabi-ld.bfd: drivers/built-in.o: in function
`mmc_select_mode':

/drivers/mmc/mmc.c:192: undefined
reference to `mmc_mode_name'
make[1]: *** [scripts/Makefile.spl:432: spl/u-boot-spl] Error 1
make: *** [Makefile:1942: spl/u-boot-spl] Error 2

Signed-off-by: Klaus Heinrich Kiwi 
---
 common/spl/Kconfig | 7 +++
 1 file changed, 7 insertions(+)

diff --git a/common/spl/Kconfig b/common/spl/Kconfig
index 0711cbf951..5b0eaa1414 100644
--- a/common/spl/Kconfig
+++ b/common/spl/Kconfig
@@ -710,6 +710,13 @@ config SPL_MMC_SUPPORT
  this option to build the drivers in drivers/mmc as part of an SPL
  build.
 
+config SPL_MMC_VERBOSE
+   bool "Output mode information about the MMC"
+   depends on SPL_MMC_SUPPORT
+   help
+ Enable the output of more information about the card such as the
+ operating mode.
+
 config SYS_MMCSD_FS_BOOT_PARTITION
int "MMC Boot Partition"
default 1
-- 
2.25.1



[PATCH] mmc: kconfig: Add CONFIG_SPL_MMC_VERBOSE

2021-03-08 Thread Klaus Heinrich Kiwi
When building the SPL with MMC config and CONFIG_LOGLEVEL > 7, the
function mmc_select_mode() at drivers/mmc/mmc.c will call
mmc_mode_name() which is only defined if CONFIG_IS_ENABLED(MMC_VERBOSE)
which doesn't have a corresponding CONFIG_SPL_MMC_VERBOSE defined in
Kconfig.

Fixes this build error:

arm-linux-gnueabi-ld.bfd: drivers/built-in.o: in function
`mmc_select_mode':

/drivers/mmc/mmc.c:192: undefined
reference to `mmc_mode_name'
make[1]: *** [scripts/Makefile.spl:432: spl/u-boot-spl] Error 1
make: *** [Makefile:1942: spl/u-boot-spl] Error 2

Signed-off-by: Klaus Heinrich Kiwi 
---

 common/spl/Kconfig | 7 +++
 1 file changed, 7 insertions(+)

diff --git a/common/spl/Kconfig b/common/spl/Kconfig
index 774541c02b..2b36c86e0f 100644
--- a/common/spl/Kconfig
+++ b/common/spl/Kconfig
@@ -697,6 +697,13 @@ config SPL_MMC_SUPPORT
  this option to build the drivers in drivers/mmc as part of an SPL
  build.
 
+config SPL_MMC_VERBOSE
+   bool "Output mode information about the MMC"
+   depends on SPL_MMC_SUPPORT
+   help
+ Enable the output of more information about the card such as the
+ operating mode.
+
 config SYS_MMCSD_FS_BOOT_PARTITION
int "MMC Boot Partition"
default 1
-- 
2.25.1



[PATCH] tools/mkeficapsule.c: fix DEBUG build

2021-02-20 Thread Klaus Heinrich Kiwi
Fix a missing comma sign (,) from a printf(), that is only
reachable if DEBUG is defined, in which case the build fails with:

tools/mkeficapsule.c:266:36: error: expected β€˜)’ before β€˜bin’
  266 |  printf("\tbin: %s\n\ttype: %pUl\n" bin, guid);
  |^~~~
  |)

Signed-off-by: Klaus Heinrich Kiwi 
---
 tools/mkeficapsule.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/mkeficapsule.c b/tools/mkeficapsule.c
index 162494907a..1613e74ca7 100644
--- a/tools/mkeficapsule.c
+++ b/tools/mkeficapsule.c
@@ -263,7 +263,7 @@ static int create_fwbin(char *path, char *bin, efi_guid_t 
*guid,
 
 #ifdef DEBUG
printf("For output: %s\n", path);
-   printf("\tbin: %s\n\ttype: %pUl\n" bin, guid);
+   printf("\tbin: %s\n\ttype: %pUl\n", bin, guid);
printf("\tindex: %ld\n\tinstance: %ld\n", index, instance);
 #endif
 
-- 
2.25.1



[PATCH 3/3] Makefile: Add (default) DEVICE_TREE to SPL FIT

2021-02-09 Thread Klaus Heinrich Kiwi
U-boot allows the default device tree to be overridden from
the build environment using the DEVICE_TREE variable.

Make sure that we include it in the SPL FIT mkimage build step.

This also fixes a broken image in case CONFIG_OF_LIST and
CONFIG_OF_OVERLAY_LIST are unset (i.e., expected to be supplied
by the DEVICE_TREE env var).

Signed-off-by: Klaus Heinrich Kiwi 
---

 Makefile | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Makefile b/Makefile
index ebbedb1fb1..116d03947a 100644
--- a/Makefile
+++ b/Makefile
@@ -1386,6 +1386,7 @@ MKIMAGEFLAGS_u-boot.img = -f auto -A $(ARCH) -T firmware 
-C none -O u-boot \
-a $(CONFIG_SYS_TEXT_BASE) -e $(CONFIG_SYS_UBOOT_START) \
-p $(CONFIG_FIT_EXTERNAL_OFFSET) \
-n "U-Boot $(UBOOTRELEASE) for $(BOARD) board" -E \
+   $(patsubst %,-b arch/$(ARCH)/dts/%.dtb,$(subst ",,$(DEVICE_TREE))) \
$(patsubst %,-b arch/$(ARCH)/dts/%.dtb,$(subst ",,$(CONFIG_OF_LIST))) \
$(patsubst %,-b arch/$(ARCH)/dts/%.dtbo,$(subst 
",,$(CONFIG_OF_OVERLAY_LIST)))
 else
-- 
2.25.1



[PATCH 2/3] Kconfig: SPL_FIT_SIGNATURE requires SPL_LOAD_FIT

2021-02-09 Thread Klaus Heinrich Kiwi
Having the ability to support firmware FIT signatures on the SPL sounds
not so useful if the SPL is not supporting to load a (U-boot) firmware
as a FIT image.

Signed-off-by: Klaus Heinrich Kiwi 
---

 common/Kconfig.boot | 1 +
 1 file changed, 1 insertion(+)

diff --git a/common/Kconfig.boot b/common/Kconfig.boot
index 7a0f7d9501..d323ad5d0b 100644
--- a/common/Kconfig.boot
+++ b/common/Kconfig.boot
@@ -162,6 +162,7 @@ config SPL_FIT_PRINT
 config SPL_FIT_SIGNATURE
bool "Enable signature verification of FIT firmware within SPL"
depends on SPL_DM
+   depends on SPL_LOAD_FIT || SPL_LOAD_FIT_FULL
select FIT_SIGNATURE
select SPL_FIT
select SPL_CRYPTO_SUPPORT
-- 
2.25.1



[PATCH 1/3] Kconfig: SPL_FIT_SIGNATURE selects FIT_SIGNATURE

2021-02-09 Thread Klaus Heinrich Kiwi
Selecting SPL_FIT_SIGNATURE (without selecting U-boot proper
verified boot first) breaks the build due to
CONFIG_FIT_SIGNATURE_MAX_SIZE being undefined, in addition to Kconfig
warnings on RSA and IMAGE_SIGN_INFO unmet dependencies.

Signed-off-by: Klaus Heinrich Kiwi 

---

 common/Kconfig.boot | 1 +
 1 file changed, 1 insertion(+)

diff --git a/common/Kconfig.boot b/common/Kconfig.boot
index 5eaabdfc27..7a0f7d9501 100644
--- a/common/Kconfig.boot
+++ b/common/Kconfig.boot
@@ -162,6 +162,7 @@ config SPL_FIT_PRINT
 config SPL_FIT_SIGNATURE
bool "Enable signature verification of FIT firmware within SPL"
depends on SPL_DM
+   select FIT_SIGNATURE
select SPL_FIT
select SPL_CRYPTO_SUPPORT
select SPL_HASH_SUPPORT
-- 
2.25.1



[PATCH 0/3] Misc fixes for SPL_FIT_SIGNATURE builds

2021-02-09 Thread Klaus Heinrich Kiwi


This patch series contains a few fixes for issues found when
experimenting with the SPL_FIT_SIGNATURE builds. Some of them
are apparently necessary to properly integrate this U-boot
feature with build systems such as Yocto, and by extension
OpenBMC.

 -Klaus


Klaus Heinrich Kiwi (3):
  Kconfig: SPL_FIT_SIGNATURE selects FIT_SIGNATURE
  Kconfig: SPL_FIT_SIGNATURE requires SPL_LOAD_FIT
  Makefile: Add (default) DEVICE_TREE to SPL FIT

 Makefile| 1 +
 common/Kconfig.boot | 2 ++
 2 files changed, 3 insertions(+)

-- 
2.25.1