Patchwork linux-dtb.inc: Run dts through the preprocessor

login
register
mail settings
Submitter Franklin Cooper Jr.
Date Aug. 14, 2013, 3:32 p.m.
Message ID <1376494338-11646-2-git-send-email-fcooper@ti.com>
Download mbox | patch
Permalink /patch/55615/
State New
Headers show

Comments

Bruce Ashfield - Aug. 14, 2013, 3:25 p.m.
On Wed, Aug 14, 2013 at 11:32 AM, Franklin S. Cooper Jr <fcooper@ti.com> wrote:
> * In the 3.11 kernel some dts files now include C code that must first run
>   through the preprocessor.
> * Update building the dtb by first running the dts file through the user's
>   compiler before building using the device tree compiler.
> * The logic used is based on mainline u-boot dts/Makefile.

We are already working through a change from Otavio that changes the way we
build DTB files, using the in kernel resources.

So this shouldn't be required in the end, or at least heavily modified.

So I suggest we hold on this change for now, and rebase it once the
patch I mentioned
is merged.

Bruce

>
> Signed-off-by: Franklin S. Cooper Jr <fcooper@ti.com>
> ---
>  meta/recipes-kernel/linux/linux-dtb.inc |    5 ++++-
>  1 files changed, 4 insertions(+), 1 deletions(-)
>
> diff --git a/meta/recipes-kernel/linux/linux-dtb.inc b/meta/recipes-kernel/linux/linux-dtb.inc
> index 41dd599..f1aafa2 100644
> --- a/meta/recipes-kernel/linux/linux-dtb.inc
> +++ b/meta/recipes-kernel/linux/linux-dtb.inc
> @@ -21,7 +21,10 @@ do_install_append() {
>                         DTS_BASE_NAME=`basename ${DTS_FILE} | awk -F "." '{print $1}'`
>                         DTB_NAME=`echo ${KERNEL_IMAGE_BASE_NAME} | sed "s/${MACHINE}/${DTS_BASE_NAME}/g"`
>                         DTB_SYMLINK_NAME=`echo ${KERNEL_IMAGE_SYMLINK_NAME} | sed "s/${MACHINE}/${DTS_BASE_NAME}/g"`
> -                       dtc -I dts -O dtb ${KERNEL_DEVICETREE_FLAGS} -o ${DTS_BASE_NAME} ${DTS_FILE}
> +
> +                       cat ${DTS_FILE} | \
> +                               ${CPP} -x assembler-with-cpp -I ./include/ -I ./arch/${ARCH}/boot/dts - | \
> +                               dtc ${KERNEL_DEVICETREE_FLAGS} -O dtb -o ${DTS_BASE_NAME} -i arch/${ARCH}/boot/dts/ -
>                         install -m 0644 ${DTS_BASE_NAME} ${D}/${KERNEL_IMAGEDEST}/devicetree-${DTB_SYMLINK_NAME}.dtb
>                 done
>         fi
> --
> 1.7.0.4
>
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-core
Franklin Cooper Jr. - Aug. 14, 2013, 3:32 p.m.
* In the 3.11 kernel some dts files now include C code that must first run
  through the preprocessor.
* Update building the dtb by first running the dts file through the user's
  compiler before building using the device tree compiler.
* The logic used is based on mainline u-boot dts/Makefile.

Signed-off-by: Franklin S. Cooper Jr <fcooper@ti.com>
---
 meta/recipes-kernel/linux/linux-dtb.inc |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
Franklin Cooper Jr. - Aug. 14, 2013, 3:44 p.m.
> -----Original Message-----
> From: Bruce Ashfield [mailto:bruce.ashfield@gmail.com]
> Sent: Wednesday, August 14, 2013 10:25 AM
> To: Cooper Jr., Franklin
> Cc: Patches and discussions about the oe-core layer; Otavio Salvador
> Subject: Re: [OE-core] [PATCH] linux-dtb.inc: Run dts through the preprocessor
> 
> On Wed, Aug 14, 2013 at 11:32 AM, Franklin S. Cooper Jr <fcooper@ti.com>
> wrote:
> > * In the 3.11 kernel some dts files now include C code that must first run
> >   through the preprocessor.
> > * Update building the dtb by first running the dts file through the user's
> >   compiler before building using the device tree compiler.
> > * The logic used is based on mainline u-boot dts/Makefile.
> 
> We are already working through a change from Otavio that changes the way we
> build DTB files, using the in kernel resources.
> 
> So this shouldn't be required in the end, or at least heavily modified.
> 
> So I suggest we hold on this change for now, and rebase it once the patch I
> mentioned is merged.

No issue on my end. As long as one of our patches makes it in master and Dylan I will be happy.
> 
> Bruce
> 
> >
> > Signed-off-by: Franklin S. Cooper Jr <fcooper@ti.com>
> > ---
> >  meta/recipes-kernel/linux/linux-dtb.inc |    5 ++++-
> >  1 files changed, 4 insertions(+), 1 deletions(-)
> >
> > diff --git a/meta/recipes-kernel/linux/linux-dtb.inc
> > b/meta/recipes-kernel/linux/linux-dtb.inc
> > index 41dd599..f1aafa2 100644
> > --- a/meta/recipes-kernel/linux/linux-dtb.inc
> > +++ b/meta/recipes-kernel/linux/linux-dtb.inc
> > @@ -21,7 +21,10 @@ do_install_append() {
> >                         DTS_BASE_NAME=`basename ${DTS_FILE} | awk -F "." '{print
> $1}'`
> >                         DTB_NAME=`echo ${KERNEL_IMAGE_BASE_NAME} | sed
> "s/${MACHINE}/${DTS_BASE_NAME}/g"`
> >                         DTB_SYMLINK_NAME=`echo
> ${KERNEL_IMAGE_SYMLINK_NAME} | sed
> "s/${MACHINE}/${DTS_BASE_NAME}/g"`
> > -                       dtc -I dts -O dtb ${KERNEL_DEVICETREE_FLAGS} -o
> ${DTS_BASE_NAME} ${DTS_FILE}
> > +
> > +                       cat ${DTS_FILE} | \
> > +                               ${CPP} -x assembler-with-cpp -I ./include/ -I
> ./arch/${ARCH}/boot/dts - | \
> > +                               dtc ${KERNEL_DEVICETREE_FLAGS} -O dtb
> > + -o ${DTS_BASE_NAME} -i arch/${ARCH}/boot/dts/ -
> >                         install -m 0644 ${DTS_BASE_NAME}
> ${D}/${KERNEL_IMAGEDEST}/devicetree-${DTB_SYMLINK_NAME}.dtb
> >                 done
> >         fi
> > --
> > 1.7.0.4
> >
> > _______________________________________________
> > Openembedded-core mailing list
> > Openembedded-core@lists.openembedded.org
> > http://lists.openembedded.org/mailman/listinfo/openembedded-core
> 
> 
> 
> --
> "Thou shalt not follow the NULL pointer, for chaos and madness await thee at its
> end"

Patch

diff --git a/meta/recipes-kernel/linux/linux-dtb.inc b/meta/recipes-kernel/linux/linux-dtb.inc
index 41dd599..f1aafa2 100644
--- a/meta/recipes-kernel/linux/linux-dtb.inc
+++ b/meta/recipes-kernel/linux/linux-dtb.inc
@@ -21,7 +21,10 @@  do_install_append() {
 			DTS_BASE_NAME=`basename ${DTS_FILE} | awk -F "." '{print $1}'`
 			DTB_NAME=`echo ${KERNEL_IMAGE_BASE_NAME} | sed "s/${MACHINE}/${DTS_BASE_NAME}/g"`
 			DTB_SYMLINK_NAME=`echo ${KERNEL_IMAGE_SYMLINK_NAME} | sed "s/${MACHINE}/${DTS_BASE_NAME}/g"`
-			dtc -I dts -O dtb ${KERNEL_DEVICETREE_FLAGS} -o ${DTS_BASE_NAME} ${DTS_FILE}
+
+			cat ${DTS_FILE} | \
+				${CPP} -x assembler-with-cpp -I ./include/ -I ./arch/${ARCH}/boot/dts - | \
+				dtc ${KERNEL_DEVICETREE_FLAGS} -O dtb -o ${DTS_BASE_NAME} -i arch/${ARCH}/boot/dts/ -
 			install -m 0644 ${DTS_BASE_NAME} ${D}/${KERNEL_IMAGEDEST}/devicetree-${DTB_SYMLINK_NAME}.dtb
 		done
 	fi