Subject: Re: [PATCH 19/19] bootwrapper: compatibility layer for old U-Boots (a.k.a. cuImage, cuboot)

From: Geoff Levand <[email-masked]>
Date: Mon, 12 Feb 2007 13:38:52 -0800

Scott Wood wrote:

> diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
> index aeb5309..f6e9b5e 100644
> --- a/arch/powerpc/Kconfig
> +++ b/arch/powerpc/Kconfig
> +config CUIMAGE_DTS
> +	string "Device tree source file"
> +	depends on COMPAT_UIMAGE
> +	help
> +	  This specifies the device tree source (.dts) file to
> +	  be compiled and included in the kernel image.  If
> +	  a relative filename is given, then it will be relative
> +	  to arch/powerpc/boot/dts.
> +

There is nothing CUIMAGE specific with this, so why make it so?  Other
platforms may like to use it.

> +++ b/arch/powerpc/boot/Makefile
> @@ -35,6 +35,8 @@ endif
>  
>  BOOTCFLAGS	+= -I$(obj) -I$(srctree)/$(obj)
>  
> +cuboot-plats := 83xx 85xx 86xx
> +
>  zlib       := inffast.c inflate.c inftrees.c
>  zlibheader := inffast.h inffixed.h inflate.h inftrees.h infutil.h
>  zliblinuxheader := zlib.h zconf.h zutil.h
> @@ -45,7 +47,7 @@ $(addprefix $(obj)/,$(zlib) main.o): $(a
>  src-wlib := string.S stdio.c main.c flatdevtree.c flatdevtree_misc.c \
>  		ns16550.c serial.c simple_alloc.c div64.S util.S $(zlib) \
>  		devtree.c
> -src-plat := of.c
> +src-plat := of.c $(cuboot-plats:%=cuboot-%.c)

It may be better to do it like this, as there will be more platforms that
need to hook in specific files.

src-plat-$(CONFIG_COMPAT_UIMAGE) += $(cuboot-plats:%=cuboot-%.c)
src-plat-$(CONFIG_XXX) += ...
src-plat-$(CONFIG_YYY) += ...
...
src-plat := of.c $(src-plat-y)

> +ifeq ($(CONFIG_COMPAT_UIMAGE),y)
> +cuboot-plat-$(CONFIG_83xx) += 83xx
> +cuboot-plat-$(CONFIG_85xx) += 85xx
> +cuboot-plat-$(CONFIG_86xx) += 86xx
> +cuboot-plat-y += unknown-platform
> +
> +$(obj)/uImage: vmlinux $(wrapperbits)
> +	$(call cmd,wrap_dt,cuboot-$(word 1,$(cuboot-plat-y)))
> +else
>  $(obj)/uImage: vmlinux $(wrapperbits)
>  	$(call cmd,wrap,uboot)
> +endif

It would be nice if you could make the logic such that you don't need this ifeq.

-Geoff