RFC: Support for U-Boot phases in Kconfig

Grant Likely grant.likely at secretlab.ca
Wed Aug 11 15:47:10 CEST 2021


On Wed, Aug 11, 2021 at 1:58 PM Simon Glass <sjg at chromium.org> wrote:
>
> Hi Grant,
>
> On Wed, 11 Aug 2021 at 03:58, Grant Likely <grant.likely at secretlab.ca> wrote:
> >
> > On Mon, Aug 9, 2021 at 8:11 PM Tom Rini <trini at konsulko.com> wrote:
> > >
> > > On Sat, Aug 07, 2021 at 04:23:36PM -0600, Simon Glass wrote:
> > > > Comments welcome!
> > >
> > > I think what this is really showing is that Yamada-san was right.  All
> > > the games we need to do so that "make fooboard_config all" results in
> > > building the N stages needed was the wrong track.  Taking
> > > khadas-edge-v-rk3399 as an example, if we had instead of
> > > khadas-edge-v-rk3399_defconfig but khadas-edge-v-rk3399_tpl_defconfig
> > > khadas-edge-v-rk3399_spl_defconfig and khadas-edge-v-rk3399_config, each
> > > of which could set CONFIG_TPL, CONFIG_SPL or neither.  Then yes, to
> > > build u-boot-rockchip.bin you would need to pass in the separately build
> > > TPL and SPL stages.  But, that's true of so so many other platforms.  To
> > > pick another example, imx8mm_evk doesn't function without other
> > > binaries.  If in theory to build khadas-edge-v-rk3399 you had to do
> > > something like:
> > > $ export CROSS_COMPILE=aarch64-linux-
> > > $ make O=obj/tpl khadas-edge-v-rk3399_tpl_config all
> > > $ make O=obj/spl khadas-edge-v-rk3399_spl_config all
> > > $ make O=obj/khadas-edge-v-rk3399 TPL=obj/tpl/u-boot.bin \
> > >     SPL=obj/spl/u-boot.bin khadas-edge-v-rk3399_config all
> > >
> > > But it also meant that we didn't need to duplicate so so many Kconfig
> > > options and most of our obj rules would just be:
> > > obj-$(CONFIG_FOO) += foo.o
> > >
> > > would be a win.
> >
> > Oh! I quite like this. Simpler indeed. With all the different
> > components that need to be pulled in to build a bootable image, each
> > of the various U-Boot stages would just be another configuration that
> > needs to be built and included in the result.
>
> Have you looked at binman? It is designed to put images together,
> using the various U-Boot phases and anything else about.

Yup, I looked quite closely at binman, and have been planning to use
it. This tool is more about building the required projects and less
about assembling the final image. I think the two are complementary.

g.


More information about the U-Boot mailing list