env: Allow to build multiple environments in Kconfig
PATCH v3 12/15 env: Allow to build multiple environments in Kconfig
Quoted 10 lines · Maxime Ripard
Quoted 9 lines · Simon Goldschmidt
Quoted 7 lines · Maxime Ripard
Now that we have everything in place in the code, let's allow to build multiple environments backend through
Kconfig.Reviewed-by Andre Przywara <[email protected]>Reviewed-by Lukasz Majewski <[email protected]>Reviewed-by Simon Glass <[email protected]>Signed-off-by Maxime Ripard <[email protected]>
Quoted 5 lines
Quoted 2 lines
I get a build error when enabling
CONFIG_ENV_IS_IN_SPI_FLASHandCONFIG_ENV_IS_IN_MMCat the same time.Is that happening in any of the current defconfig right now? Or is it only when you add more environments?
No, this is with my own config. I'm trying out the new feature :-)
Quoted 18 lines
Quoted 18 lines
The build error is in host tools, not in U-Boot or SPL itself. In fact, this is not specific to
CONFIG_ENV_IS_IN_SPI_FLASHbut to the combination ofCONFIG_ENV_IS_IN_MMCand any of the environments marked as ENVCRC- intools/Makefile.The actual error is that the compiler does not know standard types in
efi.handmmc.h, e.g.:
In file included frominclude/blk.h:11:0,from include/part.h:10, from include/mmc.h:16, from include/environment.h:168, from ./tools/../env/embedded.c:16, from tools/env/embedded.c:2:
include/efi.h:32:2: error: unknown type name ‘u8’
u8 b[16];
^~
Quoted 7 lines
Quoted 1 line
I can't think of a correct fix right now...
I'm not sure what it could be either, that file looks like it would need a quite big rework, in order to be able to operate properly.
Do you actually need those? Maybe we can just disable those in
Kconfigto forbid such a combination?
I planned to have the environment in both SPI flash and eMMC to be able to use a common U-Boot binary accross multiple boards.
I don't need 'tools/envcrc' though. And this is where the build error is.
Maybe we could disable the combination for 'tools/envcrc' only?
Simon
PATCH v3 12/15 env: Allow to build multiple environments in Kconfig
Quoted 45 lines · Goldschmidt Simon
Quoted 10 lines · Maxime Ripard
Quoted 9 lines · Simon Goldschmidt
Quoted 7 lines · Maxime Ripard
Now that we have everything in place in the code, let's allow to build multiple environments backend through
Kconfig.Reviewed-by Andre Przywara <[email protected]>Reviewed-by Lukasz Majewski <[email protected]>Reviewed-by Simon Glass <[email protected]>Signed-off-by Maxime Ripard <[email protected]>Quoted 5 lines
Quoted 2 lines
I get a build error when enabling
CONFIG_ENV_IS_IN_SPI_FLASHandCONFIG_ENV_IS_IN_MMCat the same time.Is that happening in any of the current defconfig right now? Or is it only when you add more environments?
No, this is with my own config. I'm trying out the new feature :-)
Quoted 18 lines
Quoted 18 lines
The build error is in host tools, not in U-Boot or SPL itself. In fact, this is not specific to
CONFIG_ENV_IS_IN_SPI_FLASHbut to the combination ofCONFIG_ENV_IS_IN_MMCand any of the environments marked as ENVCRC- intools/Makefile.The actual error is that the compiler does not know standard types in
efi.handmmc.h, e.g.:
In file included frominclude/blk.h:11:0,from include/part.h:10, from include/mmc.h:16, from include/environment.h:168, from ./tools/../env/embedded.c:16, from tools/env/embedded.c:2:
include/efi.h:32:2: error: unknown type name ‘u8’
u8 b[16];
^~Quoted 7 lines
Quoted 1 line
I can't think of a correct fix right now...
I'm not sure what it could be either, that file looks like it would need a quite big rework, in order to be able to operate properly.
Do you actually need those? Maybe we can just disable those in
Kconfigto forbid such a combination?
Quoted 7 lines
I planned to have the environment in both SPI flash and eMMC to be able to use a common U-Boot binary accross multiple boards.
I don't need '
tools/envcrc' though. And this is where the build error is.Maybe we could disable the combination for '
tools/envcrc' only?
Apparently, envcrc is used to generate the CRC of an embedded environment image inside the U-Boot image, which would be triggered in some specific cases.
I'm not sure we can disable it without breaking use cases.
in this particular case, it seems that the u8 typedef is done at the architecture level, and efi.h doesn't include asm/types.h that define it. Maybe it's as simple as that. Otherwise, it includes linux/types.h that defines uint8_t, we can use that instead.
Maxime
Signature · 10 lines
Maxime Ripard, Bootlin (formerly Free Electrons) Embedded Linux and Kernel engineering http://bootlin.com -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 833 bytes Desc: not available URL: <http://lists.denx.de/pipermail/u-boot/attachments/20180205/d25c3c40/attachment.sig>
PATCH v3 12/15 env: Allow to build multiple environments in Kconfig
Quoted 46 lines · Maxime Ripard
Quoted 45 lines · Goldschmidt Simon
Quoted 5 lines · Maxime Ripard
Quoted 4 lines · Simon Goldschmidt
Quoted 3 lines · Maxime Ripard
Now that we have everything in place in the code, let's allow to build multiple environments backend through
Kconfig.Quoted 8 lines
Quoted 6 lines
Quoted 4 lines
Reviewed-by Andre Przywara <[email protected]>Reviewed-by Lukasz Majewski <[email protected]>Reviewed-by Simon Glass <[email protected]>Signed-off-by Maxime Ripard <[email protected]>I get a build error when enabling
CONFIG_ENV_IS_IN_SPI_FLASHandCONFIG_ENV_IS_IN_MMCat the same time.Is that happening in any of the current defconfig right now? Or is it only when you add more environments?
No, this is with my own config. I'm trying out the new feature :-)
Quoted 17 lines
Quoted 17 lines
The build error is in host tools, not in U-Boot or SPL itself. In fact, this is not specific to
CONFIG_ENV_IS_IN_SPI_FLASHbut to the combination ofCONFIG_ENV_IS_IN_MMCand any of the environments marked as ENVCRC- intools/Makefile.The actual error is that the compiler does not know standard types in
efi.handmmc.h, e.g.:
In file included frominclude/blk.h:11:0,from include/part.h:10, from include/mmc.h:16, from include/environment.h:168, from ./tools/../env/embedded.c:16, from tools/env/embedded.c:2: include/efi.h:32:2: error: unknown type name ‘u8’ u8 b[16]; ^~Quoted 6 lines
Quoted 1 line
I can't think of a correct fix right now...
I'm not sure what it could be either, that file looks like it would need a quite big rework, in order to be able to operate properly.
Do you actually need those? Maybe we can just disable those in
Kconfigto forbid such a combination?I planned to have the environment in both SPI flash and eMMC to be able to use a common U-Boot binary accross multiple boards.
I don't need '
tools/envcrc' though. And this is where the build error is.
Quoted 6 lines
Quoted 1 line
Maybe we could disable the combination for '
tools/envcrc' only?Apparently, envcrc is used to generate the CRC of an embedded environment image inside the U-Boot image, which would be triggered in some specific cases.
I'm not sure we can disable it without breaking use cases.
I didn't want to suggest removing envcrc. I'd rather wanted to somehow prevent including "mmc.h" when compiling for envcrc... Anyway, that would be a hack to make it work for me.
Quoted 4 lines
in this particular case, it seems that the u8 typedef is done at the architecture level, and
efi.hdoesn't includeasm/types.hthat define it. Maybe it's as simple as that. Otherwise, it includeslinux/types.hthat definesuint8_t, we can use that instead.
Digging into this again, it seems clear that this doesn't work since 'u8' is meant for kernel space while user space should use '__u8'. Envcrc *is* userspace, so using uint8_t everywhere makes more sense.
Simon
PATCH v3 12/15 env: Allow to build multiple environments in Kconfig
Quoted 8 lines · Simon Goldschmidt
Quoted 4 lines
in this particular case, it seems that the u8 typedef is done at the architecture level, and
efi.hdoesn't includeasm/types.hthat define it. Maybe it's as simple as that. Otherwise, it includeslinux/types.hthat definesuint8_t, we can use that instead.Digging into this again, it seems clear that this doesn't work since 'u8' is meant for kernel space while user space should use '
__u8'. Envcrc *is* userspace, so usinguint8_teverywhere makes more sense.
Yes, but the offending variable is in include/efi.h, which would be included by both (but probably not intentionally in the envcrc case).
Maxime
Signature · 10 lines
Maxime Ripard, Bootlin (formerly Free Electrons) Embedded Linux and Kernel engineering http://bootlin.com -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 833 bytes Desc: not available URL: <http://lists.denx.de/pipermail/u-boot/attachments/20180206/ffdeb7f1/attachment.sig>