Add some support for device tree kernels
v3 cover Add some support for device tree kernels
Hi everyone,
This is a refactoring of the previous basic device tree options available for microblaze.
The previous option only made it possible for microblaze targets to give a path to an external device tree, and build a simpleImage with it. This involved using a custom target name as simpleImages are built with the simpleImage.dt_name.
This is also the case on powerpc with cuImages.
This patchset replaces the existing mechanism with a more generic one. First, it allows to build device tree sources to blobs, both taking dts present in the kernel sources and external ones, using a path.
Then, it adds support for kernel images with appended device tree blobs. This option is only for ARM because it is the only architecture I can think of that has such feature.
Finally, it adds the simpleImage and cuImage as regular image variants, with the necessary logic to append the device tree name to use, while doing a bit of code factorisation for u-boot images along the way.
Thanks,
Maxime
Changes since v2:
* Hide the BR2_LINUX_KERNEL_APPENDED_DTB option and introduce images with appended DTs as image variants instead.
* Change various option names. Removed the behaviour modification of the BR2_LINUX_KERNEL_DTS_FILE doing so.
* Various changes in help messages, added some comments, etc...
Maxime Ripard (6):
Revert "Microblaze: build kernel with device tree" Rework support for the device tree
Factorize the u-boot images code
Add support for appended device tree blobs for arm Add cuImage(powerpc) and simpleImage(microblaze) as Linux kernel
images variants
Update s6lx9 microblaze default configuration
configs/s6lx9_microboard_defconfig | 12 +---- linux/Config.in | 100 +++++++++++++++++++++++++++++++++--- linux/linux.mk | 87 +++++++++++++++++++++++++------ 3 files changed, 165 insertions(+), 34 deletions(-)
Signature · 1 line
1.7.9.5
PATCH v3 1/6 Revert "Microblaze: build kernel with device tree"
This is way too specific to microblaze-only. Remove this support to introduce a more generic way to do support device tree kernels.
This reverts commit aaed42d15643e0cb64c96fa400a6097a19d19ef4.
--- linux/Config.in | 8 -------- linux/linux.mk | 14 -------------- 2 files changed, 22 deletions(-)
linux/Config.in +0 -8
@@ -124,14 +124,6 @@ config BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE help Path to the kernel configuration file -config BR2_LINUX_KERNEL_DTS_FILE - string "Device Tree dts file location" - depends on BR2_microblaze - help - Path from where the dts file has to be copied - The final "custom target" name depends on the - dts file name: - <name>.dts --> simpleImage.<name> # # Binary format #
linux/linux.mk +0 -14
@@ -117,18 +117,6 @@ endef LINUX_POST_PATCH_HOOKS += LINUX_APPLY_PATCHES -ifeq ($(KERNEL_ARCH),microblaze) -# on microblaze, we always want mkimage -LINUX_DEPENDENCIES+=host-uboot-tools - -define LINUX_COPY_DTS - if test -f "$(BR2_LINUX_KERNEL_DTS_FILE)" ; then \ - cp $(BR2_LINUX_KERNEL_DTS_FILE) $(@D)/arch/microblaze/boot/dts ; \ - else \ - echo "Cannot copy dts file!" ; \ - fi -endef -endif ifeq ($(BR2_LINUX_KERNEL_USE_DEFCONFIG),y) KERNEL_SOURCE_CONFIG = $(KERNEL_ARCH_PATH)/configs/$(call qstrip,$(BR2_LINUX_KERNEL_DEFCONFIG))_defconfig
@@ -143,8 +131,6 @@ define LINUX_CONFIGURE_CMDS $(if $(BR2_ARM_EABI), $(call KCONFIG_ENABLE_OPT,CONFIG_AEABI,$(@D)/.config), $(call KCONFIG_DISABLE_OPT,CONFIG_AEABI,$(@D)/.config)) - $(if $(BR2_microblaze), - $(call LINUX_COPY_DTS)) # As the kernel gets compiled before root filesystems are # built, we create a fake cpio file. It'll be # replaced later by the real cpio archive, and the kernel will be
Signature · 1 line
1.7.9.5
A message that is not in the archive (sent off-list or not yet received): CAEBucnCan1vRHv4GkhYXGHnrb3Nrtg0rOtwiLY_fTuARuV0W2g@mail.gmail.com
PATCH v3 1/6 Revert "Microblaze: build kernel with device tree"
Hi,
Please keep the list in CC.
Le 17/07/2012 21:21, Spenser Gilliland a ?crit :
Quoted 2 lines
I'm using this functionality. Is there a way to make this work without the patch?
The next patches introduce a similar functionnality. You can look at patch 6 to see the changes made to the s6lx9 configuration.
What are you using the previous behaviour for ? To build a simpleImage ?
Anyway, I don't have any microblaze hardware, so if you could test it, it would be nice.
Maxime
Signature · 4 lines
Maxime Ripard, Free Electrons Kernel, drivers, real-time and embedded Linux development, consulting, training and support. http://free-electrons.com
PATCH v3 2/6 Rework support for the device tree
In reply to Maxime RipardThis patch introduces some support for device tree-enabled kernels.
It replaces the former BR2_LINUX_KERNEL_DTS_FILE option that was microblaze-only, that was quite limited. This option was quite limited, first obviously because it was restricted to microblaze, but also because it targetted only external device tree source files, and allowed only to build simpleImages using the custom image name mechanism.
This patch adds a much more generic one, that can work on basically every architecture that supports device tree. It allows to build both device tree source file that comes with the kernel source or to set the path to the device tree file to use so that one can use a custom device tree.
--- linux/Config.in | 59 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ linux/linux.mk | 21 ++++++++++++++++++++ 2 files changed, 80 insertions(+)
linux/Config.in +59 -0
@@ -124,6 +124,65 @@ config BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE help Path to the kernel configuration file +config BR2_LINUX_KERNEL_DTS_SUPPORT + bool "Device tree support" + help + Compile a device tree source into a device tree blob. + Select the dts file to compile in the options below. + +if BR2_LINUX_KERNEL_DTS_SUPPORT + +# We have mainly three cases when it comes to device tree support: +# 1) We don't want any support at all. Then the ..DTS_SUPPORT +# variable won't be set +# 2) We want device tree support, so we need the user to enter +# the device tree name or the the path to the custom device +# he uses, but the kernel abstracts this from us and only +# build an image that looks like a regular kernel image. In +# this case, we only need to derive the kernel image name from +# the given device tree name, and all the rest is as usual +# 3) We want device tree support, but the kernel requires us to +# build the device tree blob separately. In this case, some +# more logic will be needed. +# The variable below address the second case, were you only want +# limited actions from buildroot. +config BR2_LINUX_KERNEL_DTB_IS_SELF_BUILT + bool + +choice + prompt "Device tree source" + default BR2_LINUX_KERNEL_USE_INTREE_DTS + +config BR2_LINUX_KERNEL_USE_INTREE_DTS + bool "Use a device tree present in the kernel." + help + Use a device tree source distributed with + the kernel sources. The dts files are located + in the arch/<arch>/boot/dts folder. + +config BR2_LINUX_KERNEL_USE_CUSTOM_DTS + bool "Use a custom device tree file" + help + Use a custom device tree file, i.e, a device + tree file that does not belong to the kernel + source tree. +endchoice + +config BR2_LINUX_KERNEL_INTREE_DTS_NAME + string "Device Tree Source file name" + depends on BR2_LINUX_KERNEL_USE_INTREE_DTS + help + Name of the device tree source file, without + the trailing .dts + +config BR2_LINUX_KERNEL_CUSTOM_DTS_PATH + string "Device Tree Source file path" + depends on BR2_LINUX_KERNEL_USE_CUSTOM_DTS + help + Path to the device tree source file + +endif + # # Binary format #
linux/linux.mk +21 -0
@@ -46,6 +46,12 @@ LINUX_MAKE_FLAGS = \ # going to be installed in the target filesystem. LINUX_VERSION_PROBED = $(shell $(MAKE) $(LINUX_MAKE_FLAGS) -C $(LINUX_DIR) --no-print-directory -s kernelrelease) +ifeq ($(BR2_LINUX_KERNEL_USE_INTREE_DTS),y) +KERNEL_DTS_NAME = $(BR2_LINUX_KERNEL_INTREE_DTS_NAME) +else ifeq ($(BR2_LINUX_KERNEL_USE_CUSTOM_DTS),y) +KERNEL_DTS_NAME = $(basename $(notdir $(BR2_LINUX_KERNEL_CUSTOM_DTS_PATH))) +endif + ifeq ($(BR2_LINUX_KERNEL_IMAGE_TARGET_CUSTOM),y) LINUX_IMAGE_NAME=$(call qstrip,$(BR2_LINUX_KERNEL_IMAGE_TARGET_NAME)) else
@@ -153,13 +159,27 @@ define LINUX_CONFIGURE_CMDS yes '' | $(TARGET_MAKE_ENV) $(MAKE1) $(LINUX_MAKE_FLAGS) -C $(@D) oldconfig endef +ifeq ($(BR2_LINUX_KERNEL_DTS_SUPPORT),y) +ifeq ($(BR2_LINUX_KERNEL_DTB_IS_SELF_BUILT),) +define LINUX_BUILD_DTB + $(TARGET_MAKE_ENV) $(MAKE) $(LINUX_MAKE_FLAGS) -C $(@D) $(KERNEL_DTS_NAME).dtb +endef +define LINUX_INSTALL_DTB + cp $(KERNEL_ARCH_PATH)/boot/$(KERNEL_DTS_NAME).dtb $(BINARIES_DIR)/ +endef +endif +endif + # Compilation. We make sure the kernel gets rebuilt when the # configuration has changed. define LINUX_BUILD_CMDS + $(if $(BR2_LINUX_KERNEL_USE_CUSTOM_DTS), + cp $(BR2_LINUX_KERNEL_CUSTOM_DTS_PATH) $(KERNEL_ARCH_PATH)/boot/dts/) $(TARGET_MAKE_ENV) $(MAKE) $(LINUX_MAKE_FLAGS) -C $(@D) $(LINUX_IMAGE_NAME) @if grep -q "CONFIG_MODULES=y" $(@D)/.config; then \ $(TARGET_MAKE_ENV) $(MAKE) $(LINUX_MAKE_FLAGS) -C $(@D) modules ; \ fi + $(LINUX_BUILD_DTB) endef
@@ -175,6 +195,7 @@ endef define LINUX_INSTALL_TARGET_CMDS $(LINUX_INSTALL_KERNEL_IMAGE_TO_TARGET) + $(LINUX_INSTALL_DTB) # Install modules and remove symbolic links pointing to build # directories, not relevant on the target @if grep -q "CONFIG_MODULES=y" $(@D)/.config; then \
Signature · 1 line
1.7.9.5
PATCH 2/6 Rework support for the device tree
Quoted 9 lines · Maxime Ripard
This patch introduces some support for device tree-enabled kernels.
It replaces the former
BR2_LINUX_KERNEL_DTS_FILEoption that was microblaze-only, that was quite limited. This option was quite limited, first obviously because it was restricted to microblaze, but also because it targetted only external device tree source files, and allowed only to build simpleImages using the custom image name mechanism.
Quoted 7 lines
This patch adds a much more generic one, that can work on basically every architecture that supports device tree. It allows to build both device tree source file that comes with the kernel source or to set the path to the device tree file to use so that one can use a custom device tree.
Signed-off-by Maxime Ripard<[email protected]>
Really nice!
The BR2_LINUX_KERNEL_DTB_IS_SELF_BUILT part actually belongs to
patch 4/6, but that's a minor detail.
Regards,
Arnout
Signature · 6 lines
Arnout Vandecappelle arnout at mind be Senior Embedded Software Architect +32-16-286540 Essensium/Mind http://www.mind.be G.Geenslaan 9, 3001 Leuven, Belgium BE 872 984 063 RPR Leuven LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle GPG fingerprint: 7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F
PATCH v3 3/6 Factorize the u-boot images code
In reply to Maxime RipardThis patch introduces the BR2_LINUX_KERNEL_UBOOT_IMAGE boolean to factorize more code that will be shared in the next patches that introduces other uImage-like targets.
--- linux/Config.in | 4 ++++ linux/linux.mk | 5 ++++- 2 files changed, 8 insertions(+), 1 deletion(-)
linux/Config.in +4 -0
@@ -187,12 +187,16 @@ endif # Binary format # +config BR2_LINUX_KERNEL_UBOOT_IMAGE + bool + choice prompt "Kernel binary format" config BR2_LINUX_KERNEL_UIMAGE bool "uImage" depends on BR2_arm || BR2_armeb || BR2_bfin || BR2_powerpc || BR2_avr32 || BR2_sh || BR2_sh64 + select BR2_LINUX_KERNEL_UBOOT_IMAGE config BR2_LINUX_KERNEL_BZIMAGE bool "bzImage"
linux/linux.mk +4 -1
@@ -34,6 +34,10 @@ LINUX_PATCHES = $(call qstrip,$(BR2_LINUX_KERNEL_PATCH)) LINUX_INSTALL_IMAGES = YES LINUX_DEPENDENCIES += host-module-init-tools +ifeq ($(BR2_LINUX_KERNEL_UBOOT_IMAGE),y) + LINUX_DEPENDENCIES += host-uboot-tools +endif + LINUX_MAKE_FLAGS = \ HOSTCC="$(HOSTCC)" \ HOSTCFLAGS="$(HOSTCFLAGS)" \
@@ -62,7 +66,6 @@ LINUX_IMAGE_NAME=vmImage else LINUX_IMAGE_NAME=uImage endif -LINUX_DEPENDENCIES+=host-uboot-tools else ifeq ($(BR2_LINUX_KERNEL_BZIMAGE),y) LINUX_IMAGE_NAME=bzImage else ifeq ($(BR2_LINUX_KERNEL_ZIMAGE),y)
Signature · 1 line
1.7.9.5
PATCH 3/6 Factorize the u-boot images code
Quoted 5 lines · Maxime Ripard
This patch introduces the
BR2_LINUX_KERNEL_UBOOT_IMAGEboolean to factorize more code that will be shared in the next patches that introduces other uImage-like targets.Signed-off-by Maxime Ripard<[email protected]>
(Review only)
Signature · 6 lines
Arnout Vandecappelle arnout at mind be Senior Embedded Software Architect +32-16-286540 Essensium/Mind http://www.mind.be G.Geenslaan 9, 3001 Leuven, Belgium BE 872 984 063 RPR Leuven LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle GPG fingerprint: 7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F
PATCH v3 4/6 Add support for appended device tree blobs for arm
In reply to Maxime RipardThis patch adds support for the ARM-only appended device tree mechanism present in the kernel.
This option allows to add at the end of the kernel image the device tree blob so that we can still boot device tree enabled kernels with old bootloaders.
This patch also adds the needed logic to genereate such an image when building zImages or uImages, also adding the necessary parts to rebuild the uImage.
--- linux/Config.in | 17 ++++++++++++++++- linux/linux.mk | 43 ++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 58 insertions(+), 2 deletions(-)
linux/Config.in +16 -1
@@ -149,6 +149,9 @@ if BR2_LINUX_KERNEL_DTS_SUPPORT config BR2_LINUX_KERNEL_DTB_IS_SELF_BUILT bool +config BR2_LINUX_KERNEL_APPENDED_DTB + bool + choice prompt "Device tree source" default BR2_LINUX_KERNEL_USE_INTREE_DTS
@@ -180,7 +183,6 @@ config BR2_LINUX_KERNEL_CUSTOM_DTS_PATH depends on BR2_LINUX_KERNEL_USE_CUSTOM_DTS help Path to the device tree source file - endif #
@@ -198,6 +200,13 @@ config BR2_LINUX_KERNEL_UIMAGE depends on BR2_arm || BR2_armeb || BR2_bfin || BR2_powerpc || BR2_avr32 || BR2_sh || BR2_sh64 select BR2_LINUX_KERNEL_UBOOT_IMAGE +config BR2_LINUX_KERNEL_APPENDED_UIMAGE + bool "uImage with appended DT" + depends on BR2_arm || BR2_armeb + select BR2_LINUX_KERNEL_DTS_SUPPORT + select BR2_LINUX_KERNEL_APPENDED_DTB + select BR2_LINUX_KERNEL_UBOOT_IMAGE + config BR2_LINUX_KERNEL_BZIMAGE bool "bzImage" depends on BR2_i386 || BR2_x86_64
@@ -206,6 +215,12 @@ config BR2_LINUX_KERNEL_ZIMAGE bool "zImage" depends on BR2_arm || BR2_armeb || BR2_powerpc || BR2_sparc || BR2_sh || BR2_sh64 || BR2_xtensa +config BR2_LINUX_KERNEL_APPENDED_ZIMAGE + bool "zImage with appended DT" + depends on BR2_arm || BR2_armeb + select BR2_LINUX_KERNEL_DTS_SUPPORT + select BR2_LINUX_KERNEL_APPENDED_DTB + config BR2_LINUX_KERNEL_VMLINUX_BIN bool "vmlinux.bin" depends on BR2_mips || BR2_mipsel || BR2_sh || BR2_sh64
linux/linux.mk +42 -1
86 lines not on this page · raw message
Signature · 1 line
1.7.9.5
PATCH 4/6 Add support for appended device tree blobs for arm
On 07/17/12 14:27, Maxime Ripard wrote:
[snip]
linux/Config.in config BR2_LINUX_KERNEL_UIMAGE · line 206
Quoted 8 lines
linux/Config.in +4
-0@@ -198,6 +200,13 @@ config BR2_LINUX_KERNEL_UIMAGE depends on BR2_arm || BR2_armeb || BR2_bfin || BR2_powerpc || BR2_avr32 || BR2_sh || BR2_sh64 select BR2_LINUX_KERNEL_UBOOT_IMAGE +config BR2_LINUX_KERNEL_APPENDED_UIMAGE + bool "uImage with appended DT" + depends on BR2_arm || BR2_armeb + select BR2_LINUX_KERNEL_DTS_SUPPORT
Given that this option will automatically select DTS support,
I'd prefer to see the DTS menu options later, so after the image names. Otherwise, when you select this in menuconfig (and DTS was not selected yet), it will suddenly move down because of the new options that appear. So this actually affects patch 2/6.
Quoted 6 lines
linux/Config.in +3
-0+ select BR2_LINUX_KERNEL_APPENDED_DTB + select BR2_LINUX_KERNEL_UBOOT_IMAGE + config BR2_LINUX_KERNEL_BZIMAGE bool "bzImage" depends on BR2_i386 || BR2_x86_64
[snip]
Quoted 5 lines
linux/linux.mk +1
-0@@ -66,10 +73,14 @@ LINUX_IMAGE_NAME=vmImage else LINUX_IMAGE_NAME=uImage endif +else ifeq ($(BR2_LINUX_KERNEL_APPENDED_UIMAGE),y)
linux/linux.mk LINUX_IMAGE_NAME=vmImage · line 86
Quoted 10 lines
linux/linux.mk +3
-0+LINUX_IMAGE_NAME=uImage else ifeq ($(BR2_LINUX_KERNEL_BZIMAGE),y) LINUX_IMAGE_NAME=bzImage else ifeq ($(BR2_LINUX_KERNEL_ZIMAGE),y) LINUX_IMAGE_NAME=zImage +else ifeq ($(BR2_LINUX_KERNEL_APPENDED_ZIMAGE),y) +LINUX_IMAGE_NAME=zImage else ifeq ($(BR2_LINUX_KERNEL_VMLINUX_BIN),y) LINUX_IMAGE_NAME=vmlinux.bin else ifeq ($(BR2_LINUX_KERNEL_VMLINUX),y)
I think this whole blob should move to Config.in, like we
do it for many other strings... But that's of course unrelated to this patch.
[snip]
linux/linux.mk endef · line 207
Quoted 13 lines
linux/linux.mk +13
-0+ifeq ($(BR2_LINUX_KERNEL_APPENDED_UIMAGE),y) +define LINUX_APPEND_DTB + cat $(KERNEL_ARCH_PATH)/boot/zImage $(KERNEL_ARCH_PATH)/boot/$(KERNEL_DTS_NAME).dtb> $(KERNEL_ARCH_PATH)/boot/zImage_dtb + mv $(KERNEL_ARCH_PATH)/boot/zImage_dtb $(KERNEL_ARCH_PATH)/boot/zImage + # We need to generate a new u-boot image that takes into + # account the extra-size added by the device tree at the end + # of the image. To do so, we first need to retrieve both load + # address and entry point for the kernel from the already + # generate uboot image before using mkimage -l. + LOAD=`$(MKIMAGE) -l $(LINUX_IMAGE_PATH) | sed -n 's/Load Address: \([0-9]*\)/\1/p'`; \ + ENTRY=`$(MKIMAGE) -l $(LINUX_IMAGE_PATH) | sed -n 's/Entry Point: \([0-9]*\)/\1/p'`; \ + $(MKIMAGE) -A $(KERNEL_ARCH) -O linux -T kernel -C none -a $${LOAD} -e $${ENTRY} -n 'Linux Buildroot' \ + -d $(KERNEL_ARCH_PATH)/boot/zImage $(KERNEL_ARCH_PATH)/boot/$(LINUX_IMAGE_NAME)
MKIMAGE isn't defined anywhere, so I wonder how it can work for you...
But anyway, with the amendment you posted later this shouldn't be an issue anymore.
linux/linux.mk endef · line 214
Quoted 7 lines
linux/linux.mk +7
-0+endef +else ifeq ($(BR2_LINUX_KERNEL_APPENDED_ZIMAGE),y) +define LINUX_APPEND_DTB + cat $(KERNEL_ARCH_PATH)/boot/zImage $(KERNEL_ARCH_PATH)/boot/$(KERNEL_DTS_NAME).dtb> $(KERNEL_ARCH_PATH)/boot/zImage_dtb + mv $(KERNEL_ARCH_PATH)/boot/zImage_dtb $(KERNEL_ARCH_PATH)/boot/zImage +endef +endif
Does this work?
ifeq ($(BR2_LINUX_KERNEL_APPENDED_DTB),y)
define LINUX_APPEND_DTB
cat ... ifeq ($(BR2_LINUX_KERNEL_APPENDED_UIMAGE),y) $(MAKE) ... uImage
endif
endef
endif
(I'm not sure if you can still use an ifeq inside a define.)
Regards,
Arnout
[snip]
Signature · 6 lines
Arnout Vandecappelle arnout at mind be Senior Embedded Software Architect +32-16-286540 Essensium/Mind http://www.mind.be G.Geenslaan 9, 3001 Leuven, Belgium BE 872 984 063 RPR Leuven LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle GPG fingerprint: 7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F
PATCH 4/6 Add support for appended device tree blobs for arm
Le Sat, 28 Jul 2012 16:49:34 +0200,
Arnout Vandecappelle <[email protected]> a ?crit :
Quoted 11 lines
Quoted 11 lines
linux/linux.mk +3
-0@@ -66,10 +73,14 @@ LINUX_IMAGE_NAME=vmImage else LINUX_IMAGE_NAME=uImage endif +else ifeq ($(BR2_LINUX_KERNEL_APPENDED_UIMAGE),y) +LINUX_IMAGE_NAME=uImage else ifeq ($(BR2_LINUX_KERNEL_BZIMAGE),y) LINUX_IMAGE_NAME=bzImage else ifeq ($(BR2_LINUX_KERNEL_ZIMAGE),y) LINUX_IMAGE_NAME=zImage +else ifeq ($(BR2_LINUX_KERNEL_APPENDED_ZIMAGE),y)
Quoted 8 lines
linux/linux.mk LINUX_IMAGE_NAME=vmImage · line 86
Quoted 4 lines
linux/linux.mk +1
-0+LINUX_IMAGE_NAME=zImage else ifeq ($(BR2_LINUX_KERNEL_VMLINUX_BIN),y) LINUX_IMAGE_NAME=vmlinux.bin else ifeq ($(BR2_LINUX_KERNEL_VMLINUX),y)I think this whole blob should move to Config.in, like we
do it for many other strings... But that's of course unrelated to this patch.
I don't necessarily agree here. Generally speaking my preference is to not use too much kconfig to define a bunch of strings when those are not related to visible options.
Quoted 10 lines
ifeq ($(BR2_LINUX_KERNEL_APPENDED_DTB),y)
defineLINUX_APPEND_DTBcat ... ifeq ($(BR2_LINUX_KERNEL_APPENDED_UIMAGE),y) $(MAKE) ... uImageendif
endef
endif(I'm not sure if you can still use an ifeq inside a define.)
No, you can't, and it's a shame :-(
Thomas
Signature · 4 lines
Thomas Petazzoni, Free Electrons Kernel, drivers, real-time and embedded Linux development, consulting, training and support. http://free-electrons.com
PATCH 4/6 Add support for appended device tree blobs for arm
Quoted 23 lines · Thomas Petazzoni
Le Sat, 28 Jul 2012 16:49:34 +0200,
Arnout Vandecappelle<[email protected]> a ?crit :Quoted 11 lines
Quoted 11 lines
linux/linux.mk +3
-0@@ -66,10 +73,14 @@ LINUX_IMAGE_NAME=vmImage else LINUX_IMAGE_NAME=uImage endif +else ifeq ($(BR2_LINUX_KERNEL_APPENDED_UIMAGE),y) +LINUX_IMAGE_NAME=uImage else ifeq ($(BR2_LINUX_KERNEL_BZIMAGE),y) LINUX_IMAGE_NAME=bzImage else ifeq ($(BR2_LINUX_KERNEL_ZIMAGE),y) LINUX_IMAGE_NAME=zImage +else ifeq ($(BR2_LINUX_KERNEL_APPENDED_ZIMAGE),y)Quoted 8 lines
linux/linux.mk LINUX_IMAGE_NAME=vmImage · line 86
Quoted 4 lines
linux/linux.mk +1
-0+LINUX_IMAGE_NAME=zImage else ifeq ($(BR2_LINUX_KERNEL_VMLINUX_BIN),y) LINUX_IMAGE_NAME=vmlinux.bin else ifeq ($(BR2_LINUX_KERNEL_VMLINUX),y)I think this whole blob should move to Config.in, like we
do it for many other strings... But that's of course unrelated to this patch.
Quoted 3 lines
I don't necessarily agree here. Generally speaking my preference is to not use too much kconfig to define a bunch of strings when those are not related to visible options.
Putting it in Config.in is more concise. Imagine what the Makefile would
look like if all the target/Config.in.arch strings would have to be put in "else ifeq" statements...
Also, these strings are directly related to visible options: they are
the string representation of the BR2_LINUX_KERNEL_XXX option (well, it's not a 1-to-1 mapping but it comes close).
Quoted 9 lines
Quoted 9 lines
ifeq ($(BR2_LINUX_KERNEL_APPENDED_DTB),y)
defineLINUX_APPEND_DTBcat ... ifeq ($(BR2_LINUX_KERNEL_APPENDED_UIMAGE),y) $(MAKE) ... uImageendif
endef
endif
Quoted 3 lines
Quoted 1 line
(I'm not sure if you can still use an ifeq inside a define.)
No, you can't, and it's a shame :-(
Darn.
This would work I think:
ifeq ($(BR2_LINUX_KERNEL_APPENDED_DTB),y)
define LINUX_APPEND_DTB
cat ...
endef
endif
ifeq ($(BR2_LINUX_KERNEL_APPENDED_UIMAGE),y)LINUX_APPEND_DTB += $(MAKE) ... uImage
endif
Or else, define a LINUX_REBUILD_UIMAGE macro for the appended uImage.
But neither is much better than the original (especially if the cat-rm-mv chain is replaced by a single cat) so let's keep it as it was proposed by Maxime.
Regards,
Arnout
Signature · 6 lines
Arnout Vandecappelle arnout at mind be Senior Embedded Software Architect +32-16-286540 Essensium/Mind http://www.mind.be G.Geenslaan 9, 3001 Leuven, Belgium BE 872 984 063 RPR Leuven LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle GPG fingerprint: 7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F
PATCH v3 4/6 Add support for appended device tree blobs for arm
In reply to Arnout VandecappelleQuoted 19 lines · Arnout Vandecappelle
Quoted 19 lines
...
linux/linux.mk +3
-0+ifeq ($(BR2_LINUX_KERNEL_APPENDED_UIMAGE),y) +define LINUX_APPEND_DTB + cat $(KERNEL_ARCH_PATH)/boot/zImage$(KERNEL_ARCH_PATH)/boot/$(KERNEL_DTS_NAME).dtb>
$(KERNEL_ARCH_PATH)/boot/zImage_dtb
+ mv $(KERNEL_ARCH_PATH)/boot/zImage_dtb
$(KERNEL_ARCH_PATH)/boot/zImagelinux/linux.mk +6
-0+ # We need to generate a new u-boot image that takes into + # account the extra-size added by the device tree at the end + # of the image. To do so, we first need to retrieve both load + # address and entry point for the kernel from the already + # generate uboot image before using mkimage -l. + LOAD=`$(MKIMAGE) -l $(LINUX_IMAGE_PATH) | sed -n 's/Load Address:\([0-9]*\)/\1/p'`; \
+ ENTRY=`$(MKIMAGE) -l $(LINUX_IMAGE_PATH) | sed -n 's/Entry Point:
\([0-9]*\)/\1/p'`; \
+ $(MKIMAGE) -A $(KERNEL_ARCH) -O linux -T kernel -C none -a
Quoted 8 lines
Quoted 3 lines
$${LOAD} -e $${ENTRY} -n 'Linux Buildroot' \
+ -d $(KERNEL_ARCH_PATH)/boot/zImage
$(KERNEL_ARCH_PATH)/boot/$(LINUX_IMAGE_NAME)MKIMAGE isn't defined anywhere, so I wonder how it can work for you...
But anyway, with the amendment you posted later this shouldn't be an issue anymore.
I tested the patch and doesn't work.
The MKIMAGE isn't defined anywhere.
output log error:
# We need to generate a new u-boot image that takes into
# account the extra-size added by the device tree at the end
# of the image. To do so, we first need to retrieve both load
# address and entry point for the kernel from the already
# generate uboot image before using mkimage -l.
LOAD=` -l /home/fabiopo/porting-pro3/ge863-pro3-linux-3.6/buildroot-dt/output/build/linux-custom/arch/arm/boot/uImage
| sed -n 's/Load Address: \([0-9]*\)/\1/p'`; ENTRY=` -l
/home/fabiopo/porting-pro3/ge863-pro3-linux-3.6/buildroot-dt/output/build/linux-custom/arch/arm/boot/uImage
| sed -n 's/Entry Point: \([0-9]*\)/\1/p'`; -A arm -O linux -T kernel
-C none -a ${LOAD} -e ${ENTRY} -n 'Linux Buildroot' -d
/home/fabiopo/porting-pro3/ge863-pro3-linux-3.6/buildroot-dt/output/build/linux-custom/arch/arm/boot/zImage
/home/fabiopo/porting-pro3/ge863-pro3-linux-3.6/buildroot-dt/output/build/linux-custom/arch/arm/boot/uImage
/bin/bash: -l: command not found
/bin/bash: -l: command not found
/bin/bash: -A: command not found
make: *** [/home/fabiopo/porting-pro3/ge863-pro3-linux-3.6/buildroot-dt/output/build/linux-custom/.stamp_built]
Error 127Regards
Signature · 1 line
Fabio Porcedda
PATCH 4/6 Add support for appended device tree blobs for arm
Le Mon, 30 Jul 2012 10:25:51 +0200,
Fabio Porcedda <[email protected]> a ?crit :
Quoted 2 lines
I tested the patch and doesn't work.
The MKIMAGE isn't defined anywhere.
Yes, please apply the followup patch that Maxime has posted to you on:
Date: Fri, 27 Jul 2012 20:59:15 +0200
Message-ID: <[email protected]>
It should fix this problem.
Best regards,
Thomas
Signature · 4 lines
Thomas Petazzoni, Free Electrons Kernel, drivers, real-time and embedded Linux development, consulting, training and support. http://free-electrons.com
PATCH v3 4/6 Add support for appended device tree blobs for arm
Quoted 6 lines · Thomas Petazzoni
Le Mon, 30 Jul 2012 10:25:51 +0200,
Fabio Porcedda <[email protected]> a ?crit :Quoted 2 lines
I tested the patch and doesn't work.
The MKIMAGE isn't defined anywhere.
Quoted 6 lines
Yes, please apply the followup patch that Maxime has posted to you on:
Date: Fri, 27 Jul 2012 20:59:15 +0200
Message-ID: <[email protected]>It should fix this problem.
It does fix this problem, thanks.
Best regards
Signature · 1 line
Fabio Porcedda
PATCH v3 5/6 Add cuImage(powerpc) and simpleImage(microblaze) as Linux kernel images variants
In reply to Maxime Ripard--- linux/Config.in | 14 ++++++++++++++ linux/linux.mk | 4 ++++ 2 files changed, 18 insertions(+)
linux/Config.in +14 -0
@@ -221,6 +221,20 @@ config BR2_LINUX_KERNEL_APPENDED_ZIMAGE select BR2_LINUX_KERNEL_DTS_SUPPORT select BR2_LINUX_KERNEL_APPENDED_DTB +config BR2_LINUX_KERNEL_CUIMAGE + bool "cuImage" + depends on BR2_powerpc + select BR2_LINUX_KERNEL_UBOOT_IMAGE + select BR2_LINUX_KERNEL_DTS_SUPPORT + select BR2_LINUX_KERNEL_DTB_IS_SELF_BUILT + +config BR2_LINUX_KERNEL_SIMPLEIMAGE + bool "simpleImage" + depends on BR2_microblaze + select BR2_LINUX_KERNEL_UBOOT_IMAGE + select BR2_LINUX_KERNEL_DTS_SUPPORT + select BR2_LINUX_KERNEL_DTB_IS_SELF_BUILT + config BR2_LINUX_KERNEL_VMLINUX_BIN bool "vmlinux.bin" depends on BR2_mips || BR2_mipsel || BR2_sh || BR2_sh64
linux/linux.mk +4 -0
@@ -81,6 +81,10 @@ else ifeq ($(BR2_LINUX_KERNEL_ZIMAGE),y) LINUX_IMAGE_NAME=zImage else ifeq ($(BR2_LINUX_KERNEL_APPENDED_ZIMAGE),y) LINUX_IMAGE_NAME=zImage +else ifeq ($(BR2_LINUX_KERNEL_CUIMAGE),y) +LINUX_IMAGE_NAME=cuImage.$(KERNEL_DTS_NAME) +else ifeq ($(BR2_LINUX_KERNEL_SIMPLEIMAGE),y) +LINUX_IMAGE_NAME=simpleImage.$(KERNEL_DTS_NAME) else ifeq ($(BR2_LINUX_KERNEL_VMLINUX_BIN),y) LINUX_IMAGE_NAME=vmlinux.bin else ifeq ($(BR2_LINUX_KERNEL_VMLINUX),y)
Signature · 1 line
1.7.9.5
PATCH v3 6/6 Update s6lx9 microblaze default configuration
In reply to Maxime Ripard--- configs/s6lx9_microboard_defconfig | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-)
configs/s6lx9_microboard_defconfig +2 -10
@@ -1,17 +1,9 @@ -BR2_microblaze=y BR2_microblazeel=y -BR2_TOOLCHAIN_EXTERNAL=y -BR2_TOOLCHAIN_EXTERNAL_XILINX_MICROBLAZEEL_V2=y -BR2_TOOLCHAIN_EXTERNAL_DOWNLOAD=y -BR2_TOOLCHAIN_EXTERNAL_CUSTOM_PREFIX="microblazeel-unknown-linux-gnu" -BR2_TOOLCHAIN_EXTERNAL_CUSTOM_GLIBC=y -BR2_TOOLCHAIN_EXTERNAL_CXX=y BR2_TARGET_GENERIC_GETTY_PORT="ttyUL0" # BR2_TARGET_ROOTFS_TAR is not set BR2_TARGET_ROOTFS_INITRAMFS=y BR2_LINUX_KERNEL=y BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG=y BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="board/avnet/s6lx9_microboard/lx9_mmu_defconfig" -BR2_LINUX_KERNEL_DTS_FILE="board/avnet/s6lx9_microboard/lx9_mmu.dts" -BR2_LINUX_KERNEL_IMAGE_TARGET_CUSTOM=y -BR2_LINUX_KERNEL_IMAGE_TARGET_NAME="simpleImage.lx9_mmu" +BR2_LINUX_KERNEL_USE_CUSTOM_DTS=y +BR2_LINUX_KERNEL_CUSTOM_DTS_PATH="board/avnet/s6lx9_microboard/lx9_mmu.dts"
Signature · 1 line
1.7.9.5
v3 cover Add some support for device tree kernels
In reply to Maxime RipardHi Maxime,
thanks for the work, this feature it's very useful for me, i tried your patches and i tried to build a kernel for arm, but it failed to build it,
this is the tail of the output log:
cat /home/fabiopo/porting-pro3/ge863-pro3-linux-3.6/buildroot-dt/output/build/linux-3.5/arch/arm/boot/zImage /home/fabiopo/porting-pro3/ge863-pro3-linux-3.6/buildroot-dt/output/build/linux-3.5/arch/arm/boot/"usb_a9260".dtb
Quoted 1 line
/home/fabiopo/porting-pro3/ge863-pro3-linux-3.6/buildroot-dt/output/build/linux-3.5/arch/arm/boot/zImage_dtb
mv /home/fabiopo/porting-pro3/ge863-pro3-linux-3.6/buildroot-dt/output/build/linux-3.5/arch/arm/boot/zImage_dtb /home/fabiopo/porting-pro3/ge863-pro3-linux-3.6/buildroot-dt/output/build/linux-3.5/arch/arm/boot/zImage # We need to generate a new u-boot image that takes into
# account the extra-size added by the device tree at the end
# of the image. To do so, we first need to retrieve both load
# address and entry point for the kernel from the already
# generate uboot image before using mkimage -l.
LOAD=` -l /home/fabiopo/porting-pro3/ge863-pro3-linux-3.6/buildroot-dt/output/build/linux-3.5/arch/arm/boot/uImage
| sed -n 's/Load Address: \([0-9]*\)/\1/p'`; ENTRY=` -l
/home/fabiopo/porting-pro3/ge863-pro3-linux-3.6/buildroot-dt/output/build/linux-3.5/arch/arm/boot/uImage
| sed -n 's/Entry Point: \([0-9]*\)/\1/p'`; -A arm -O linux -T kernel
-C none -a ${LOAD} -e ${ENTRY} -n 'Linux Buildroot' -d
/home/fabiopo/porting-pro3/ge863-pro3-linux-3.6/buildroot-dt/output/build/linux-3.5/arch/arm/boot/zImage
/home/fabiopo/porting-pro3/ge863-pro3-linux-3.6/buildroot-dt/output/build/linux-3.5/arch/arm/boot/uImage
/bin/bash: -l: command not found
/bin/bash: -l: command not found
/bin/bash: -A: command not found
make: *** [/home/fabiopo/porting-pro3/ge863-pro3-linux-3.6/buildroot-dt/output/build/linux-3.5/.stamp_built]
Error 127I've applied your patches on top of the commitfd08153b9d677d654add6c580b9ccc5c27d672e2,
My defconfig is:
BR2_arm=y
BR2_arm926t=y
BR2_TOOLCHAIN_EXTERNAL=y
BR2_LINUX_KERNEL=y
BR2_LINUX_KERNEL_CUSTOM_VERSION=y
BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="3.5"
BR2_LINUX_KERNEL_DEFCONFIG="at91_dt"
BR2_LINUX_KERNEL_INTREE_DTS_NAME="usb_a9260"
BR2_LINUX_KERNEL_APPENDED_UIMAGE=y
Best regards
Signature · 1 line
Fabio Porcedda
v3 cover Add some support for device tree kernels
Hi Fabio,
Thanks for the reporting.
Le 27/07/2012 18:06, Fabio Porcedda a ?crit :
Quoted 33 lines
Hi Maxime,
thanks for the work, this feature it's very useful for me, i tried your patches and i tried to build a kernel for arm, but it failed to build it,
this is the tail of the output log:cat
/home/fabiopo/porting-pro3/ge863-pro3-linux-3.6/buildroot-dt/output/build/linux-3.5/arch/arm/boot/zImage/home/fabiopo/porting-pro3/ge863-pro3-linux-3.6/buildroot-dt/output/build/linux-3.5/arch/arm/boot/"usb_a9260".dtbQuoted 1 line
/home/fabiopo/porting-pro3/ge863-pro3-linux-3.6/buildroot-dt/output/build/linux-3.5/arch/arm/boot/zImage_dtbmv
/home/fabiopo/porting-pro3/ge863-pro3-linux-3.6/buildroot-dt/output/build/linux-3.5/arch/arm/boot/zImage_dtb/home/fabiopo/porting-pro3/ge863-pro3-linux-3.6/buildroot-dt/output/build/linux-3.5/arch/arm/boot/zImage# We need to generate a new u-boot image that takes into# account the extra-size added by the device tree at the end # of the image. To do so, we first need to retrieve both load # address and entry point for the kernel from the already # generate uboot image before using mkimage -l. LOAD=` -l /home/fabiopo/porting-pro3/ge863-pro3-linux-3.6/buildroot-dt/output/build/linux-3.5/arch/arm/boot/uImage | sed -n 's/Load Address: \([0-9]*\)/\1/p'`; ENTRY=` -l /home/fabiopo/porting-pro3/ge863-pro3-linux-3.6/buildroot-dt/output/build/linux-3.5/arch/arm/boot/uImage | sed -n 's/Entry Point: \([0-9]*\)/\1/p'`; -A arm -O linux -T kernel -C none -a ${LOAD} -e ${ENTRY} -n 'Linux Buildroot' -d /home/fabiopo/porting-pro3/ge863-pro3-linux-3.6/buildroot-dt/output/build/linux-3.5/arch/arm/boot/zImage /home/fabiopo/porting-pro3/ge863-pro3-linux-3.6/buildroot-dt/output/build/linux-3.5/arch/arm/boot/uImage /bin/bash: -l: command not found /bin/bash: -l: command not found /bin/bash: -A: command not found make: *** [/home/fabiopo/porting-pro3/ge863-pro3-linux-3.6/buildroot-dt/output/build/linux-3.5/.stamp_built] Error 127I've applied your patches on top of the commit
fd08153b9d677d654add6c580b9ccc5c27d672e2,
Quoted 10 lines
My defconfig is:
BR2_arm=y
BR2_arm926t=y
BR2_TOOLCHAIN_EXTERNAL=y
BR2_LINUX_KERNEL=y
BR2_LINUX_KERNEL_CUSTOM_VERSION=y
BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="3.5"
BR2_LINUX_KERNEL_DEFCONFIG="at91_dt"
BR2_LINUX_KERNEL_INTREE_DTS_NAME="usb_a9260"
BR2_LINUX_KERNEL_APPENDED_UIMAGE=y
I have seen no such bugs during my testing, but can you try with the attached patch?
I've only discovered this simplification of the code recently and didn't take the time to submit a patch for it, I guess I have the opportunity now :)
Thanks,
Maxime
Signature · 11 lines
Maxime Ripard, Free Electrons Kernel, drivers, real-time and embedded Linux development, consulting, training and support. http://free-electrons.com -------------- next part -------------- A non-text attachment was scrubbed... Name: uimage-dtb.patch Type: text/x-patch Size: 1732 bytes Desc: not available URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20120727/e30d1f1f/attachment.bin>
v3 cover Add some support for device tree kernels
Quoted 49 lines · Maxime Ripard
Hi Fabio,
Thanks for the reporting.
Le 27/07/2012 18:06, Fabio Porcedda a ?crit :
Quoted 33 lines
Hi Maxime,
thanks for the work, this feature it's very useful for me, i tried your patches and i tried to build a kernel for arm, but it failed to build it,
this is the tail of the output log:cat
/home/fabiopo/porting-pro3/ge863-pro3-linux-3.6/buildroot-dt/output/build/linux-3.5/arch/arm/boot/zImage/home/fabiopo/porting-pro3/ge863-pro3-linux-3.6/buildroot-dt/output/build/linux-3.5/arch/arm/boot/"usb_a9260".dtbQuoted 1 line
/home/fabiopo/porting-pro3/ge863-pro3-linux-3.6/buildroot-dt/output/build/linux-3.5/arch/arm/boot/zImage_dtbmv
/home/fabiopo/porting-pro3/ge863-pro3-linux-3.6/buildroot-dt/output/build/linux-3.5/arch/arm/boot/zImage_dtb/home/fabiopo/porting-pro3/ge863-pro3-linux-3.6/buildroot-dt/output/build/linux-3.5/arch/arm/boot/zImage# We need to generate a new u-boot image that takes into# account the extra-size added by the device tree at the end # of the image. To do so, we first need to retrieve both load # address and entry point for the kernel from the already # generate uboot image before using mkimage -l. LOAD=` -l /home/fabiopo/porting-pro3/ge863-pro3-linux-3.6/buildroot-dt/output/build/linux-3.5/arch/arm/boot/uImage | sed -n 's/Load Address: \([0-9]*\)/\1/p'`; ENTRY=` -l /home/fabiopo/porting-pro3/ge863-pro3-linux-3.6/buildroot-dt/output/build/linux-3.5/arch/arm/boot/uImage | sed -n 's/Entry Point: \([0-9]*\)/\1/p'`; -A arm -O linux -T kernel -C none -a ${LOAD} -e ${ENTRY} -n 'Linux Buildroot' -d /home/fabiopo/porting-pro3/ge863-pro3-linux-3.6/buildroot-dt/output/build/linux-3.5/arch/arm/boot/zImage /home/fabiopo/porting-pro3/ge863-pro3-linux-3.6/buildroot-dt/output/build/linux-3.5/arch/arm/boot/uImage /bin/bash: -l: command not found /bin/bash: -l: command not found /bin/bash: -A: command not found make: *** [/home/fabiopo/porting-pro3/ge863-pro3-linux-3.6/buildroot-dt/output/build/linux-3.5/.stamp_built] Error 127I've applied your patches on top of the commit
fd08153b9d677d654add6c580b9ccc5c27d672e2,Quoted 10 lines
My defconfig is:
BR2_arm=y
BR2_arm926t=y
BR2_TOOLCHAIN_EXTERNAL=y
BR2_LINUX_KERNEL=y
BR2_LINUX_KERNEL_CUSTOM_VERSION=y
BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="3.5"
BR2_LINUX_KERNEL_DEFCONFIG="at91_dt"
BR2_LINUX_KERNEL_INTREE_DTS_NAME="usb_a9260"
BR2_LINUX_KERNEL_APPENDED_UIMAGE=y
Quoted 2 lines
I have seen no such bugs during my testing, but can you try with the attached patch?
The problem it's on the patch "[PATCH 2/4] Add support for appended device tree blobs for arm ",
please read my replay on the patch.
Quoted 3 lines
I've only discovered this simplification of the code recently and didn't take the time to submit a patch for it, I guess I have the opportunity now :)
I tried your patch on top of the others, but the patch doesn't apply:
git apply < ~/Downloads/uimage-dtb.patch
<stdin>:20: trailing whitespace.
cat $(KERNEL_ARCH_PATH)/boot/$(KERNEL_DTS_NAME).dtb >>
$(KERNEL_ARCH_PATH)/boot/zImage
<stdin>:21: trailing whitespace.
# We need to generate the uImage here after that so that the uImage is
<stdin>:22: trailing whitespace.
# generated with the right image size. <stdin>:23: trailing whitespace. $(TARGET_MAKE_ENV) $(MAKE) $(LINUX_MAKE_FLAGS) -C $(@D) uImage <stdin>:29: trailing whitespace. cat $(KERNEL_ARCH_PATH)/boot/$(KERNEL_DTS_NAME).dtb >> $(KERNEL_ARCH_PATH)/boot/zImage error: patch failed: linux/linux.mk:198 error: linux/linux.mk: patch does not apply
Regards
Signature · 1 line
Fabio Porcedda
v3 cover Add some support for device tree kernels
Le 30/07/2012 10:33, Fabio Porcedda a ?crit :
Quoted 66 lines
Quoted 44 lines · Maxime Ripard
Le 27/07/2012 18:06, Fabio Porcedda a ?crit :
Quoted 32 lines
thanks for the work, this feature it's very useful for me, i tried your patches and i tried to build a kernel for arm, but it failed to build it,
this is the tail of the output log:cat
/home/fabiopo/porting-pro3/ge863-pro3-linux-3.6/buildroot-dt/output/build/linux-3.5/arch/arm/boot/zImage/home/fabiopo/porting-pro3/ge863-pro3-linux-3.6/buildroot-dt/output/build/linux-3.5/arch/arm/boot/"usb_a9260".dtbQuoted 1 line
/home/fabiopo/porting-pro3/ge863-pro3-linux-3.6/buildroot-dt/output/build/linux-3.5/arch/arm/boot/zImage_dtbmv
/home/fabiopo/porting-pro3/ge863-pro3-linux-3.6/buildroot-dt/output/build/linux-3.5/arch/arm/boot/zImage_dtb/home/fabiopo/porting-pro3/ge863-pro3-linux-3.6/buildroot-dt/output/build/linux-3.5/arch/arm/boot/zImage# We need to generate a new u-boot image that takes into# account the extra-size added by the device tree at the end # of the image. To do so, we first need to retrieve both load # address and entry point for the kernel from the already # generate uboot image before using mkimage -l. LOAD=` -l /home/fabiopo/porting-pro3/ge863-pro3-linux-3.6/buildroot-dt/output/build/linux-3.5/arch/arm/boot/uImage | sed -n 's/Load Address: \([0-9]*\)/\1/p'`; ENTRY=` -l /home/fabiopo/porting-pro3/ge863-pro3-linux-3.6/buildroot-dt/output/build/linux-3.5/arch/arm/boot/uImage | sed -n 's/Entry Point: \([0-9]*\)/\1/p'`; -A arm -O linux -T kernel -C none -a ${LOAD} -e ${ENTRY} -n 'Linux Buildroot' -d /home/fabiopo/porting-pro3/ge863-pro3-linux-3.6/buildroot-dt/output/build/linux-3.5/arch/arm/boot/zImage /home/fabiopo/porting-pro3/ge863-pro3-linux-3.6/buildroot-dt/output/build/linux-3.5/arch/arm/boot/uImage /bin/bash: -l: command not found /bin/bash: -l: command not found /bin/bash: -A: command not found make: *** [/home/fabiopo/porting-pro3/ge863-pro3-linux-3.6/buildroot-dt/output/build/linux-3.5/.stamp_built] Error 127I've applied your patches on top of the commit
fd08153b9d677d654add6c580b9ccc5c27d672e2,Quoted 10 lines
My defconfig is:
BR2_arm=y
BR2_arm926t=y
BR2_TOOLCHAIN_EXTERNAL=y
BR2_LINUX_KERNEL=y
BR2_LINUX_KERNEL_CUSTOM_VERSION=y
BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="3.5"
BR2_LINUX_KERNEL_DEFCONFIG="at91_dt"
BR2_LINUX_KERNEL_INTREE_DTS_NAME="usb_a9260"
BR2_LINUX_KERNEL_APPENDED_UIMAGE=yQuoted 2 lines
I have seen no such bugs during my testing, but can you try with the attached patch?
The problem it's on the patch "[PATCH 2/4] Add support for appended device tree blobs for arm ",
please read my replay on the patch.Quoted 3 lines
I've only discovered this simplification of the code recently and didn't take the time to submit a patch for it, I guess I have the opportunity now :)
I tried your patch on top of the others, but the patch doesn't apply:
git apply <
~/Downloads/uimage-dtb.patch
<stdin>:20: trailing whitespace.cat $(KERNEL_ARCH_PATH)/boot/$(KERNEL_DTS_NAME).dtb >>$(KERNEL_ARCH_PATH)/boot/zImage
<stdin>:21: trailing whitespace.
# We need to generate the uImage here after that so that the uImage is
<stdin>:22: trailing whitespace.
Quoted 8 lines
# generated with the right image size. <stdin>:23: trailing whitespace. $(TARGET_MAKE_ENV) $(MAKE) $(LINUX_MAKE_FLAGS) -C $(@D) uImage <stdin>:29: trailing whitespace. cat $(KERNEL_ARCH_PATH)/boot/$(KERNEL_DTS_NAME).dtb >> $(KERNEL_ARCH_PATH)/boot/zImage error: patch failed: linux/linux.mk:198 error: linux/linux.mk: patch does not apply
Hmmm, that's weird, it applies fine here on top of these patches. Let me send another version of these patches then.
Maxime
Signature · 4 lines
Maxime Ripard, Free Electrons Kernel, drivers, real-time and embedded Linux development, consulting, training and support. http://free-electrons.com
v3 cover Add some support for device tree kernels
Quoted 76 lines · Maxime Ripard
Le 30/07/2012 10:33, Fabio Porcedda a ?crit :
Quoted 66 lines
Quoted 44 lines · Maxime Ripard
Le 27/07/2012 18:06, Fabio Porcedda a ?crit :
Quoted 32 lines
thanks for the work, this feature it's very useful for me, i tried your patches and i tried to build a kernel for arm, but it failed to build it,
this is the tail of the output log:cat
/home/fabiopo/porting-pro3/ge863-pro3-linux-3.6/buildroot-dt/output/build/linux-3.5/arch/arm/boot/zImage/home/fabiopo/porting-pro3/ge863-pro3-linux-3.6/buildroot-dt/output/build/linux-3.5/arch/arm/boot/"usb_a9260".dtbQuoted 1 line
/home/fabiopo/porting-pro3/ge863-pro3-linux-3.6/buildroot-dt/output/build/linux-3.5/arch/arm/boot/zImage_dtbmv
/home/fabiopo/porting-pro3/ge863-pro3-linux-3.6/buildroot-dt/output/build/linux-3.5/arch/arm/boot/zImage_dtb/home/fabiopo/porting-pro3/ge863-pro3-linux-3.6/buildroot-dt/output/build/linux-3.5/arch/arm/boot/zImage# We need to generate a new u-boot image that takes into# account the extra-size added by the device tree at the end # of the image. To do so, we first need to retrieve both load # address and entry point for the kernel from the already # generate uboot image before using mkimage -l. LOAD=` -l /home/fabiopo/porting-pro3/ge863-pro3-linux-3.6/buildroot-dt/output/build/linux-3.5/arch/arm/boot/uImage | sed -n 's/Load Address: \([0-9]*\)/\1/p'`; ENTRY=` -l /home/fabiopo/porting-pro3/ge863-pro3-linux-3.6/buildroot-dt/output/build/linux-3.5/arch/arm/boot/uImage | sed -n 's/Entry Point: \([0-9]*\)/\1/p'`; -A arm -O linux -T kernel -C none -a ${LOAD} -e ${ENTRY} -n 'Linux Buildroot' -d /home/fabiopo/porting-pro3/ge863-pro3-linux-3.6/buildroot-dt/output/build/linux-3.5/arch/arm/boot/zImage /home/fabiopo/porting-pro3/ge863-pro3-linux-3.6/buildroot-dt/output/build/linux-3.5/arch/arm/boot/uImage /bin/bash: -l: command not found /bin/bash: -l: command not found /bin/bash: -A: command not found make: *** [/home/fabiopo/porting-pro3/ge863-pro3-linux-3.6/buildroot-dt/output/build/linux-3.5/.stamp_built] Error 127I've applied your patches on top of the commit
fd08153b9d677d654add6c580b9ccc5c27d672e2,Quoted 10 lines
My defconfig is:
BR2_arm=y
BR2_arm926t=y
BR2_TOOLCHAIN_EXTERNAL=y
BR2_LINUX_KERNEL=y
BR2_LINUX_KERNEL_CUSTOM_VERSION=y
BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="3.5"
BR2_LINUX_KERNEL_DEFCONFIG="at91_dt"
BR2_LINUX_KERNEL_INTREE_DTS_NAME="usb_a9260"
BR2_LINUX_KERNEL_APPENDED_UIMAGE=yQuoted 2 lines
I have seen no such bugs during my testing, but can you try with the attached patch?
The problem it's on the patch "[PATCH 2/4] Add support for appended device tree blobs for arm ",
please read my replay on the patch.Quoted 3 lines
I've only discovered this simplification of the code recently and didn't take the time to submit a patch for it, I guess I have the opportunity now :)
I tried your patch on top of the others, but the patch doesn't apply:
git apply <
~/Downloads/uimage-dtb.patch
<stdin>:20: trailing whitespace.cat $(KERNEL_ARCH_PATH)/boot/$(KERNEL_DTS_NAME).dtb >>$(KERNEL_ARCH_PATH)/boot/zImage
<stdin>:21: trailing whitespace.
# We need to generate the uImage here after that so that the uImage is
<stdin>:22: trailing whitespace.Quoted 8 lines
# generated with the right image size. <stdin>:23: trailing whitespace. $(TARGET_MAKE_ENV) $(MAKE) $(LINUX_MAKE_FLAGS) -C $(@D) uImage <stdin>:29: trailing whitespace. cat $(KERNEL_ARCH_PATH)/boot/$(KERNEL_DTS_NAME).dtb >> $(KERNEL_ARCH_PATH)/boot/zImage error: patch failed: linux/linux.mk:198 error: linux/linux.mk: patch does not apply
Quoted 2 lines
Hmmm, that's weird, it applies fine here on top of these patches. Let me send another version of these patches then.
I applied manually and now builds fine, thanks.
Signature · 1 line
Fabio Porcedda