Patchwork [for,dylan,3/3] linux-dtb.inc: Fix dtb generation for kernels newer than 3.8

login
register
mail settings
Submitter Franklin Cooper Jr.
Date Aug. 20, 2013, 4:51 p.m.
Message ID <1377017488-32708-3-git-send-email-fcooper@ti.com>
Download mbox | patch
Permalink /patch/56063/
State New
Headers show

Comments

Franklin Cooper Jr. - Aug. 20, 2013, 4:51 p.m.
From: Otavio Salvador <otavio@ossystems.com.br>

The 3.8 kernel has change the default directory where the dtb file is
stored. The change has been done at:

,----[ Quote of 3.8 kernel change ]
| commit 499cd8298628eeabf0eb5eb6525d4faa0eec80d8
| Author: Grant Likely <grant.likely@secretlab.ca>
| Date:   Tue Nov 27 16:29:11 2012 -0700
|
|     ARM: dt: change .dtb build rules to build in dts directory
|
|     The current rules have the .dtb files build in a different directory
|     from the .dts files. The only reason for this is that it was what
|     PowerPC has done historically. This patch changes ARM to use the generic
|     dtb rule which builds .dtb files in the same directory as the source .dts.
|
|     Cc: Russell King <linux@arm.linux.org.uk>
|     Cc: Arnd Bergmann <arnd@arndb.de>
|     Acked-by: Olof Johansson <olof@lixom.net>
|     Cc: linux-arm-kernel@lists.infradead.org
|     Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
|     [swarren: added rm command for old stale .dtb files]
|     Signed-off-by: Stephen Warren <swarren@nvidia.com>
|     Signed-off-by: Rob Herring <rob.herring@calxeda.com>
`----

This change adds support for both places to backward and forward
compatibility.

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
Acked-by: Bruce Ashfield <bruce.ashfield@windriver.com>
---
 meta/recipes-kernel/linux/linux-dtb.inc |   12 ++++++++++--
 1 files changed, 10 insertions(+), 2 deletions(-)
Otavio Salvador - Aug. 20, 2013, 6:17 p.m.
On Tue, Aug 20, 2013 at 1:51 PM, Franklin S. Cooper Jr <fcooper@ti.com> wrote:
> From: Otavio Salvador <otavio@ossystems.com.br>
>
> The 3.8 kernel has change the default directory where the dtb file is
> stored. The change has been done at:
>
> ,----[ Quote of 3.8 kernel change ]
> | commit 499cd8298628eeabf0eb5eb6525d4faa0eec80d8
> | Author: Grant Likely <grant.likely@secretlab.ca>
> | Date:   Tue Nov 27 16:29:11 2012 -0700
> |
> |     ARM: dt: change .dtb build rules to build in dts directory
> |
> |     The current rules have the .dtb files build in a different directory
> |     from the .dts files. The only reason for this is that it was what
> |     PowerPC has done historically. This patch changes ARM to use the generic
> |     dtb rule which builds .dtb files in the same directory as the source .dts.
> |
> |     Cc: Russell King <linux@arm.linux.org.uk>
> |     Cc: Arnd Bergmann <arnd@arndb.de>
> |     Acked-by: Olof Johansson <olof@lixom.net>
> |     Cc: linux-arm-kernel@lists.infradead.org
> |     Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
> |     [swarren: added rm command for old stale .dtb files]
> |     Signed-off-by: Stephen Warren <swarren@nvidia.com>
> |     Signed-off-by: Rob Herring <rob.herring@calxeda.com>
> `----
>
> This change adds support for both places to backward and forward
> compatibility.
>
> Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
> Acked-by: Bruce Ashfield <bruce.ashfield@windriver.com>

Franklin, I agree this is the way to go but I think it is a bit risky
to change it in dylan.

I think it could be included in meta-ti or other layers (in case it is
need for dylan) but it has breakage risk as noticed today in some
behaviour change as found in meta-xilinx.

Paul, please be conservative about this and my previous linux-dtb
patch. In case it is going to be applied in dylan we need to let it
sleep some more time in master to find any other side effect due the
behaviour change.

Regards,
Paul Eggleton - Aug. 20, 2013, 6:24 p.m.
Hi Otavio,

On Tuesday 20 August 2013 15:17:16 Otavio Salvador wrote:
> On Tue, Aug 20, 2013 at 1:51 PM, Franklin S. Cooper Jr <fcooper@ti.com> 
wrote:
> > From: Otavio Salvador <otavio@ossystems.com.br>
> > 
> > The 3.8 kernel has change the default directory where the dtb file is
> > stored. The change has been done at:
> > 
> > ,----[ Quote of 3.8 kernel change ]
> > 
> > | commit 499cd8298628eeabf0eb5eb6525d4faa0eec80d8
> > | Author: Grant Likely <grant.likely@secretlab.ca>
> > | Date:   Tue Nov 27 16:29:11 2012 -0700
> > | 
> > |     ARM: dt: change .dtb build rules to build in dts directory
> > |     
> > |     The current rules have the .dtb files build in a different directory
> > |     from the .dts files. The only reason for this is that it was what
> > |     PowerPC has done historically. This patch changes ARM to use the
> > |     generic
> > |     dtb rule which builds .dtb files in the same directory as the source
> > |     .dts.
> > |     
> > |     Cc: Russell King <linux@arm.linux.org.uk>
> > |     Cc: Arnd Bergmann <arnd@arndb.de>
> > |     Acked-by: Olof Johansson <olof@lixom.net>
> > |     Cc: linux-arm-kernel@lists.infradead.org
> > |     Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
> > |     [swarren: added rm command for old stale .dtb files]
> > |     Signed-off-by: Stephen Warren <swarren@nvidia.com>
> > |     Signed-off-by: Rob Herring <rob.herring@calxeda.com>
> > 
> > `----
> > 
> > This change adds support for both places to backward and forward
> > compatibility.
> > 
> > Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
> > Acked-by: Bruce Ashfield <bruce.ashfield@windriver.com>
> 
> Franklin, I agree this is the way to go but I think it is a bit risky
> to change it in dylan.
> 
> I think it could be included in meta-ti or other layers (in case it is
> need for dylan) but it has breakage risk as noticed today in some
> behaviour change as found in meta-xilinx.
> 
> Paul, please be conservative about this and my previous linux-dtb
> patch. In case it is going to be applied in dylan we need to let it
> sleep some more time in master to find any other side effect due the
> behaviour change.

Agreed, I'd very much prefer to hold on this until it has had time to soak in 
master.

Cheers,
Paul
Franklin Cooper Jr. - Aug. 20, 2013, 6:35 p.m.
> -----Original Message-----
> From: Paul Eggleton [mailto:paul.eggleton@linux.intel.com]
> Sent: Tuesday, August 20, 2013 1:24 PM
> To: Otavio Salvador
> Cc: Cooper Jr., Franklin; Patches and discussions about the oe-core layer
> Subject: Re: [for dylan][PATCH 3/3] linux-dtb.inc: Fix dtb generation for kernels
> newer than 3.8
> 
> Hi Otavio,
> 
> On Tuesday 20 August 2013 15:17:16 Otavio Salvador wrote:
> > On Tue, Aug 20, 2013 at 1:51 PM, Franklin S. Cooper Jr
> > <fcooper@ti.com>
> wrote:
> > > From: Otavio Salvador <otavio@ossystems.com.br>
> > >
> > > The 3.8 kernel has change the default directory where the dtb file
> > > is stored. The change has been done at:
> > >
> > > ,----[ Quote of 3.8 kernel change ]
> > >
> > > | commit 499cd8298628eeabf0eb5eb6525d4faa0eec80d8
> > > | Author: Grant Likely <grant.likely@secretlab.ca>
> > > | Date:   Tue Nov 27 16:29:11 2012 -0700
> > > |
> > > |     ARM: dt: change .dtb build rules to build in dts directory
> > > |
> > > |     The current rules have the .dtb files build in a different directory
> > > |     from the .dts files. The only reason for this is that it was what
> > > |     PowerPC has done historically. This patch changes ARM to use the
> > > |     generic
> > > |     dtb rule which builds .dtb files in the same directory as the source
> > > |     .dts.
> > > |
> > > |     Cc: Russell King <linux@arm.linux.org.uk>
> > > |     Cc: Arnd Bergmann <arnd@arndb.de>
> > > |     Acked-by: Olof Johansson <olof@lixom.net>
> > > |     Cc: linux-arm-kernel@lists.infradead.org
> > > |     Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
> > > |     [swarren: added rm command for old stale .dtb files]
> > > |     Signed-off-by: Stephen Warren <swarren@nvidia.com>
> > > |     Signed-off-by: Rob Herring <rob.herring@calxeda.com>
> > >
> > > `----
> > >
> > > This change adds support for both places to backward and forward
> > > compatibility.
> > >
> > > Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
> > > Acked-by: Bruce Ashfield <bruce.ashfield@windriver.com>
> >
> > Franklin, I agree this is the way to go but I think it is a bit risky
> > to change it in dylan.
> >
> > I think it could be included in meta-ti or other layers (in case it is
> > need for dylan) but it has breakage risk as noticed today in some
> > behaviour change as found in meta-xilinx.
> >
> > Paul, please be conservative about this and my previous linux-dtb
> > patch. In case it is going to be applied in dylan we need to let it
> > sleep some more time in master to find any other side effect due the
> > behaviour change.
> 
> Agreed, I'd very much prefer to hold on this until it has had time to soak in
> master.
[Franklin] 
No problem. I will put this on the back burner for some time.
> 
> Cheers,
> Paul
> 
> --
> 
> Paul Eggleton
> Intel Open Source Technology Centre

Patch

diff --git a/meta/recipes-kernel/linux/linux-dtb.inc b/meta/recipes-kernel/linux/linux-dtb.inc
index 7c8058f..258a5fc 100644
--- a/meta/recipes-kernel/linux/linux-dtb.inc
+++ b/meta/recipes-kernel/linux/linux-dtb.inc
@@ -16,8 +16,12 @@  do_install_append() {
 			DTB_BASE_NAME=`basename ${DTB} .dtb`
 			DTB_NAME=`echo ${KERNEL_IMAGE_BASE_NAME} | sed "s/${MACHINE}/${DTB_BASE_NAME}/g"`
 			DTB_SYMLINK_NAME=`echo ${KERNEL_IMAGE_SYMLINK_NAME} | sed "s/${MACHINE}/${DTB_BASE_NAME}/g"`
+			DTB_PATH="${B}/arch/${ARCH}/boot/dts/${DTB}"
 			oe_runmake ${DTB}
-			install -m 0644 ${B}/arch/${ARCH}/boot/${DTB} ${D}/${KERNEL_IMAGEDEST}/devicetree-${DTB_SYMLINK_NAME}.dtb
+			if [ ! -e "${DTB_PATH}" ]; then
+				DTB_PATH="${B}/arch/${ARCH}/boot/${DTB}"
+			fi
+			install -m 0644 ${DTB_PATH} ${D}/${KERNEL_IMAGEDEST}/devicetree-${DTB_SYMLINK_NAME}.dtb
 		done
 	fi
 }
@@ -32,8 +36,12 @@  do_deploy_append() {
 			DTB_BASE_NAME=`basename ${DTB} .dtb`
 			DTB_NAME=`echo ${KERNEL_IMAGE_BASE_NAME} | sed "s/${MACHINE}/${DTB_BASE_NAME}/g"`
 			DTB_SYMLINK_NAME=`echo ${KERNEL_IMAGE_SYMLINK_NAME} | sed "s/${MACHINE}/${DTB_BASE_NAME}/g"`
+			DTB_PATH="${B}/arch/${ARCH}/boot/dts/${DTB}"
+			if [ ! -e "${DTB_PATH}" ]; then
+				DTB_PATH="${B}/arch/${ARCH}/boot/${DTB}"
+			fi
 			install -d ${DEPLOYDIR}
-			install -m 0644 ${B}/arch/${ARCH}/boot/${DTB} ${DEPLOYDIR}/${DTB_NAME}.dtb
+			install -m 0644 ${DTB_PATH} ${DEPLOYDIR}/${DTB_NAME}.dtb
 			cd ${DEPLOYDIR}
 			ln -sf ${DTB_NAME}.dtb ${DTB_SYMLINK_NAME}.dtb
 			cd -