All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCHv3 0/6] Add some support for device tree kernels
@ 2012-07-17 12:27 Maxime Ripard
  2012-07-17 12:27 ` [Buildroot] [PATCH 1/6] Revert "Microblaze: build kernel with device tree" Maxime Ripard
                   ` (6 more replies)
  0 siblings, 7 replies; 22+ messages in thread
From: Maxime Ripard @ 2012-07-17 12:27 UTC (permalink / raw)
  To: buildroot

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(-)

-- 
1.7.9.5

^ permalink raw reply	[flat|nested] 22+ messages in thread

* [Buildroot] [PATCH 1/6] Revert "Microblaze: build kernel with device tree"
  2012-07-17 12:27 [Buildroot] [PATCHv3 0/6] Add some support for device tree kernels Maxime Ripard
@ 2012-07-17 12:27 ` Maxime Ripard
       [not found]   ` <CAEBucnCan1vRHv4GkhYXGHnrb3Nrtg0rOtwiLY_fTuARuV0W2g@mail.gmail.com>
  2012-07-17 12:27 ` [Buildroot] [PATCH 2/6] Rework support for the device tree Maxime Ripard
                   ` (5 subsequent siblings)
  6 siblings, 1 reply; 22+ messages in thread
From: Maxime Ripard @ 2012-07-17 12:27 UTC (permalink / raw)
  To: buildroot

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.

Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
---
 linux/Config.in |    8 --------
 linux/linux.mk  |   14 --------------
 2 files changed, 22 deletions(-)

diff --git a/linux/Config.in b/linux/Config.in
index 4562b1b..550371d 100644
--- a/linux/Config.in
+++ b/linux/Config.in
@@ -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
 #
diff --git a/linux/linux.mk b/linux/linux.mk
index 34f8623..09c8e79 100644
--- a/linux/linux.mk
+++ b/linux/linux.mk
@@ -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
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [Buildroot] [PATCH 2/6] Rework support for the device tree
  2012-07-17 12:27 [Buildroot] [PATCHv3 0/6] Add some support for device tree kernels Maxime Ripard
  2012-07-17 12:27 ` [Buildroot] [PATCH 1/6] Revert "Microblaze: build kernel with device tree" Maxime Ripard
@ 2012-07-17 12:27 ` Maxime Ripard
  2012-07-27 19:45   ` Arnout Vandecappelle
  2012-07-17 12:27 ` [Buildroot] [PATCH 3/6] Factorize the u-boot images code Maxime Ripard
                   ` (4 subsequent siblings)
  6 siblings, 1 reply; 22+ messages in thread
From: Maxime Ripard @ 2012-07-17 12:27 UTC (permalink / raw)
  To: buildroot

This 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.

Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
---
 linux/Config.in |   59 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
 linux/linux.mk  |   21 ++++++++++++++++++++
 2 files changed, 80 insertions(+)

diff --git a/linux/Config.in b/linux/Config.in
index 550371d..9b63ab3 100644
--- a/linux/Config.in
+++ b/linux/Config.in
@@ -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
 #
diff --git a/linux/linux.mk b/linux/linux.mk
index 09c8e79..9b4abf1 100644
--- a/linux/linux.mk
+++ b/linux/linux.mk
@@ -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 	\
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [Buildroot] [PATCH 3/6] Factorize the u-boot images code
  2012-07-17 12:27 [Buildroot] [PATCHv3 0/6] Add some support for device tree kernels Maxime Ripard
  2012-07-17 12:27 ` [Buildroot] [PATCH 1/6] Revert "Microblaze: build kernel with device tree" Maxime Ripard
  2012-07-17 12:27 ` [Buildroot] [PATCH 2/6] Rework support for the device tree Maxime Ripard
@ 2012-07-17 12:27 ` Maxime Ripard
  2012-07-28 14:36   ` Arnout Vandecappelle
  2012-07-17 12:27 ` [Buildroot] [PATCH 4/6] Add support for appended device tree blobs for arm Maxime Ripard
                   ` (3 subsequent siblings)
  6 siblings, 1 reply; 22+ messages in thread
From: Maxime Ripard @ 2012-07-17 12:27 UTC (permalink / raw)
  To: buildroot

This 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.

Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
---
 linux/Config.in |    4 ++++
 linux/linux.mk  |    5 ++++-
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/linux/Config.in b/linux/Config.in
index 9b63ab3..6da50f5 100644
--- a/linux/Config.in
+++ b/linux/Config.in
@@ -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"
diff --git a/linux/linux.mk b/linux/linux.mk
index 9b4abf1..7d632f6 100644
--- a/linux/linux.mk
+++ b/linux/linux.mk
@@ -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)
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [Buildroot] [PATCH 4/6] Add support for appended device tree blobs for arm
  2012-07-17 12:27 [Buildroot] [PATCHv3 0/6] Add some support for device tree kernels Maxime Ripard
                   ` (2 preceding siblings ...)
  2012-07-17 12:27 ` [Buildroot] [PATCH 3/6] Factorize the u-boot images code Maxime Ripard
@ 2012-07-17 12:27 ` Maxime Ripard
  2012-07-28 14:49   ` Arnout Vandecappelle
  2012-07-17 12:27 ` [Buildroot] [PATCH 5/6] Add cuImage(powerpc) and simpleImage(microblaze) as Linux kernel images variants Maxime Ripard
                   ` (2 subsequent siblings)
  6 siblings, 1 reply; 22+ messages in thread
From: Maxime Ripard @ 2012-07-17 12:27 UTC (permalink / raw)
  To: buildroot

This 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.

Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
---
 linux/Config.in |   17 ++++++++++++++++-
 linux/linux.mk  |   43 ++++++++++++++++++++++++++++++++++++++++++-
 2 files changed, 58 insertions(+), 2 deletions(-)

diff --git a/linux/Config.in b/linux/Config.in
index 6da50f5..606bf8e 100644
--- a/linux/Config.in
+++ b/linux/Config.in
@@ -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
diff --git a/linux/linux.mk b/linux/linux.mk
index 7d632f6..011474e 100644
--- a/linux/linux.mk
+++ b/linux/linux.mk
@@ -56,6 +56,13 @@ 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_APPENDED_DTB),y)
+ifneq ($(words $(KERNEL_DTS_NAME)),1)
+$(error Kernel with appended device tree needs exactly one DTS source.\
+  Check BR2_LINUX_KERNEL_INTREE_DTS_NAME or BR2_LINUX_KERNEL_CUSTOM_DTS_PATH.)
+endif
+endif
+
 ifeq ($(BR2_LINUX_KERNEL_IMAGE_TARGET_CUSTOM),y)
 LINUX_IMAGE_NAME=$(call qstrip,$(BR2_LINUX_KERNEL_IMAGE_TARGET_NAME))
 else
@@ -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)
+LINUX_IMAGE_NAME=zImage
 else ifeq ($(BR2_LINUX_KERNEL_VMLINUX_BIN),y)
 LINUX_IMAGE_NAME=vmlinux.bin
 else ifeq ($(BR2_LINUX_KERNEL_VMLINUX),y)
@@ -79,6 +90,12 @@ LINUX_IMAGE_NAME=vmlinuz
 endif
 endif
 
+ifeq ($(BR2_LINUX_KERNEL_APPENDED_DTB),y)
+LINUX_IMAGE_TARGET=zImage
+else
+LINUX_IMAGE_TARGET=$(LINUX_IMAGE_NAME)
+endif
+
 # Compute the arch path, since i386 and x86_64 are in arch/x86 and not
 # in arch/$(KERNEL_ARCH). Even if the kernel creates symbolic links
 # for bzImage, arch/i386 and arch/x86_64 do not exist when copying the
@@ -159,6 +176,8 @@ define LINUX_CONFIGURE_CMDS
 		$(call KCONFIG_SET_OPT,CONFIG_UEVENT_HELPER_PATH,\"/sbin/mdev\",$(@D)/.config))
 	$(if $(BR2_PACKAGE_SYSTEMD),
 		$(call KCONFIG_ENABLE_OPT,CONFIG_CGROUPS,$(@D)/.config))
+	$(if $(BR2_LINUX_KERNEL_APPENDED_DTB),
+		$(call KCONFIG_ENABLE_OPT,CONFIG_ARM_APPENDED_DTB,$(@D)/.config))
 	yes '' | $(TARGET_MAKE_ENV) $(MAKE1) $(LINUX_MAKE_FLAGS) -C $(@D) oldconfig
 endef
 
@@ -173,16 +192,38 @@ endef
 endif
 endif
 
+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)
+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
+
 # 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)
+	$(TARGET_MAKE_ENV) $(MAKE) $(LINUX_MAKE_FLAGS) -C $(@D) $(LINUX_IMAGE_TARGET)
 	@if grep -q "CONFIG_MODULES=y" $(@D)/.config; then 	\
 		$(TARGET_MAKE_ENV) $(MAKE) $(LINUX_MAKE_FLAGS) -C $(@D) modules ;	\
 	fi
 	$(LINUX_BUILD_DTB)
+	$(LINUX_APPEND_DTB)
 endef
 
 
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [Buildroot] [PATCH 5/6] Add cuImage(powerpc) and simpleImage(microblaze) as Linux kernel images variants
  2012-07-17 12:27 [Buildroot] [PATCHv3 0/6] Add some support for device tree kernels Maxime Ripard
                   ` (3 preceding siblings ...)
  2012-07-17 12:27 ` [Buildroot] [PATCH 4/6] Add support for appended device tree blobs for arm Maxime Ripard
@ 2012-07-17 12:27 ` Maxime Ripard
  2012-07-17 12:27 ` [Buildroot] [PATCH 6/6] Update s6lx9 microblaze default configuration Maxime Ripard
  2012-07-27 16:06 ` [Buildroot] [PATCHv3 0/6] Add some support for device tree kernels Fabio Porcedda
  6 siblings, 0 replies; 22+ messages in thread
From: Maxime Ripard @ 2012-07-17 12:27 UTC (permalink / raw)
  To: buildroot

Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Acked-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
---
 linux/Config.in |   14 ++++++++++++++
 linux/linux.mk  |    4 ++++
 2 files changed, 18 insertions(+)

diff --git a/linux/Config.in b/linux/Config.in
index 606bf8e..a23198c 100644
--- a/linux/Config.in
+++ b/linux/Config.in
@@ -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
diff --git a/linux/linux.mk b/linux/linux.mk
index 011474e..dd61a04 100644
--- a/linux/linux.mk
+++ b/linux/linux.mk
@@ -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)
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [Buildroot] [PATCH 6/6] Update s6lx9 microblaze default configuration
  2012-07-17 12:27 [Buildroot] [PATCHv3 0/6] Add some support for device tree kernels Maxime Ripard
                   ` (4 preceding siblings ...)
  2012-07-17 12:27 ` [Buildroot] [PATCH 5/6] Add cuImage(powerpc) and simpleImage(microblaze) as Linux kernel images variants Maxime Ripard
@ 2012-07-17 12:27 ` Maxime Ripard
  2012-07-27 16:06 ` [Buildroot] [PATCHv3 0/6] Add some support for device tree kernels Fabio Porcedda
  6 siblings, 0 replies; 22+ messages in thread
From: Maxime Ripard @ 2012-07-17 12:27 UTC (permalink / raw)
  To: buildroot

Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
---
 configs/s6lx9_microboard_defconfig |   12 ++----------
 1 file changed, 2 insertions(+), 10 deletions(-)

diff --git a/configs/s6lx9_microboard_defconfig b/configs/s6lx9_microboard_defconfig
index 5011766..7fd809d 100644
--- a/configs/s6lx9_microboard_defconfig
+++ b/configs/s6lx9_microboard_defconfig
@@ -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"
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [Buildroot] [PATCH 1/6] Revert "Microblaze: build kernel with device tree"
       [not found]   ` <CAEBucnCan1vRHv4GkhYXGHnrb3Nrtg0rOtwiLY_fTuARuV0W2g@mail.gmail.com>
@ 2012-07-18  7:23     ` Maxime Ripard
  0 siblings, 0 replies; 22+ messages in thread
From: Maxime Ripard @ 2012-07-18  7:23 UTC (permalink / raw)
  To: buildroot

Hi,

Please keep the list in CC.

Le 17/07/2012 21:21, Spenser Gilliland a ?crit :
> 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

-- 
Maxime Ripard, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com

^ permalink raw reply	[flat|nested] 22+ messages in thread

* [Buildroot] [PATCHv3 0/6] Add some support for device tree kernels
  2012-07-17 12:27 [Buildroot] [PATCHv3 0/6] Add some support for device tree kernels Maxime Ripard
                   ` (5 preceding siblings ...)
  2012-07-17 12:27 ` [Buildroot] [PATCH 6/6] Update s6lx9 microblaze default configuration Maxime Ripard
@ 2012-07-27 16:06 ` Fabio Porcedda
  2012-07-27 18:59   ` Maxime Ripard
  6 siblings, 1 reply; 22+ messages in thread
From: Fabio Porcedda @ 2012-07-27 16:06 UTC (permalink / raw)
  To: buildroot

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".dtb
> /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 127


I've applied your patches on top of the commit
fd08153b9d677d654add6c580b9ccc5c27d672e2,

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
-- 
Fabio Porcedda

^ permalink raw reply	[flat|nested] 22+ messages in thread

* [Buildroot] [PATCHv3 0/6] Add some support for device tree kernels
  2012-07-27 16:06 ` [Buildroot] [PATCHv3 0/6] Add some support for device tree kernels Fabio Porcedda
@ 2012-07-27 18:59   ` Maxime Ripard
  2012-07-30  8:33     ` Fabio Porcedda
  0 siblings, 1 reply; 22+ messages in thread
From: Maxime Ripard @ 2012-07-27 18:59 UTC (permalink / raw)
  To: buildroot

Hi Fabio,

Thanks for the reporting.

Le 27/07/2012 18:06, Fabio Porcedda a ?crit :
> 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".dtb
>> /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 127
> 
> 
> I've applied your patches on top of the commit
> fd08153b9d677d654add6c580b9ccc5c27d672e2,
> 
> 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
-- 
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>

^ permalink raw reply	[flat|nested] 22+ messages in thread

* [Buildroot] [PATCH 2/6] Rework support for the device tree
  2012-07-17 12:27 ` [Buildroot] [PATCH 2/6] Rework support for the device tree Maxime Ripard
@ 2012-07-27 19:45   ` Arnout Vandecappelle
  0 siblings, 0 replies; 22+ messages in thread
From: Arnout Vandecappelle @ 2012-07-27 19:45 UTC (permalink / raw)
  To: buildroot

On 07/17/12 14:27, Maxime Ripard wrote:
> This 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.
>
> Signed-off-by: Maxime Ripard<maxime.ripard@free-electrons.com>

Acked-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>

  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
-- 
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

^ permalink raw reply	[flat|nested] 22+ messages in thread

* [Buildroot] [PATCH 3/6] Factorize the u-boot images code
  2012-07-17 12:27 ` [Buildroot] [PATCH 3/6] Factorize the u-boot images code Maxime Ripard
@ 2012-07-28 14:36   ` Arnout Vandecappelle
  0 siblings, 0 replies; 22+ messages in thread
From: Arnout Vandecappelle @ 2012-07-28 14:36 UTC (permalink / raw)
  To: buildroot

On 07/17/12 14:27, Maxime Ripard wrote:
> This 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.
>
> Signed-off-by: Maxime Ripard<maxime.ripard@free-electrons.com>

Acked-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
(Review only)

-- 
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

^ permalink raw reply	[flat|nested] 22+ messages in thread

* [Buildroot] [PATCH 4/6] Add support for appended device tree blobs for arm
  2012-07-17 12:27 ` [Buildroot] [PATCH 4/6] Add support for appended device tree blobs for arm Maxime Ripard
@ 2012-07-28 14:49   ` Arnout Vandecappelle
  2012-07-28 19:29     ` Thomas Petazzoni
  2012-07-30  8:25     ` Fabio Porcedda
  0 siblings, 2 replies; 22+ messages in thread
From: Arnout Vandecappelle @ 2012-07-28 14:49 UTC (permalink / raw)
  To: buildroot

On 07/17/12 14:27, Maxime Ripard wrote:
[snip]
> @@ -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.


> +	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]
> @@ -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)
> +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]
> +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.

> +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]

-- 
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

^ permalink raw reply	[flat|nested] 22+ messages in thread

* [Buildroot] [PATCH 4/6] Add support for appended device tree blobs for arm
  2012-07-28 14:49   ` Arnout Vandecappelle
@ 2012-07-28 19:29     ` Thomas Petazzoni
  2012-07-29 15:16       ` Arnout Vandecappelle
  2012-07-30  8:25     ` Fabio Porcedda
  1 sibling, 1 reply; 22+ messages in thread
From: Thomas Petazzoni @ 2012-07-28 19:29 UTC (permalink / raw)
  To: buildroot

Le Sat, 28 Jul 2012 16:49:34 +0200,
Arnout Vandecappelle <arnout@mind.be> a ?crit :

> > @@ -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)
> > +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.

> 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.)

No, you can't, and it's a shame :-(

Thomas
-- 
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com

^ permalink raw reply	[flat|nested] 22+ messages in thread

* [Buildroot] [PATCH 4/6] Add support for appended device tree blobs for arm
  2012-07-28 19:29     ` Thomas Petazzoni
@ 2012-07-29 15:16       ` Arnout Vandecappelle
  0 siblings, 0 replies; 22+ messages in thread
From: Arnout Vandecappelle @ 2012-07-29 15:16 UTC (permalink / raw)
  To: buildroot

On 07/28/12 21:29, Thomas Petazzoni wrote:
> Le Sat, 28 Jul 2012 16:49:34 +0200,
> Arnout Vandecappelle<arnout@mind.be>  a ?crit :
>
>>> @@ -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)
>>> +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.

  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).


>> 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.)
>
> 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
-- 
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

^ permalink raw reply	[flat|nested] 22+ messages in thread

* [Buildroot] [PATCH 4/6] Add support for appended device tree blobs for arm
  2012-07-28 14:49   ` Arnout Vandecappelle
  2012-07-28 19:29     ` Thomas Petazzoni
@ 2012-07-30  8:25     ` Fabio Porcedda
  2012-07-30  8:31       ` Thomas Petazzoni
  1 sibling, 1 reply; 22+ messages in thread
From: Fabio Porcedda @ 2012-07-30  8:25 UTC (permalink / raw)
  To: buildroot

On Sat, Jul 28, 2012 at 4:49 PM, Arnout Vandecappelle <arnout@mind.be> wrote:
>> ...
>>
>> +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.

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 127

Regards
-- 
Fabio Porcedda

^ permalink raw reply	[flat|nested] 22+ messages in thread

* [Buildroot] [PATCH 4/6] Add support for appended device tree blobs for arm
  2012-07-30  8:25     ` Fabio Porcedda
@ 2012-07-30  8:31       ` Thomas Petazzoni
  2012-07-30 10:10         ` Fabio Porcedda
  0 siblings, 1 reply; 22+ messages in thread
From: Thomas Petazzoni @ 2012-07-30  8:31 UTC (permalink / raw)
  To: buildroot

Le Mon, 30 Jul 2012 10:25:51 +0200,
Fabio Porcedda <fabio.porcedda@gmail.com> a ?crit :

> 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: <5012E503.2070005@free-electrons.com>

It should fix this problem.

Best regards,

Thomas
-- 
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com

^ permalink raw reply	[flat|nested] 22+ messages in thread

* [Buildroot] [PATCHv3 0/6] Add some support for device tree kernels
  2012-07-27 18:59   ` Maxime Ripard
@ 2012-07-30  8:33     ` Fabio Porcedda
  2012-07-30  9:38       ` Maxime Ripard
  0 siblings, 1 reply; 22+ messages in thread
From: Fabio Porcedda @ 2012-07-30  8:33 UTC (permalink / raw)
  To: buildroot

On Fri, Jul 27, 2012 at 8:59 PM, Maxime Ripard
<maxime.ripard@free-electrons.com> wrote:
> Hi Fabio,
>
> Thanks for the reporting.
>
> Le 27/07/2012 18:06, Fabio Porcedda a ?crit :
>> 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".dtb
>>> /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 127
>>
>>
>> I've applied your patches on top of the commit
>> fd08153b9d677d654add6c580b9ccc5c27d672e2,
>>
>> 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?

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.

> 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
-- 
Fabio Porcedda

^ permalink raw reply	[flat|nested] 22+ messages in thread

* [Buildroot] [PATCHv3 0/6] Add some support for device tree kernels
  2012-07-30  8:33     ` Fabio Porcedda
@ 2012-07-30  9:38       ` Maxime Ripard
  2012-07-30 10:09         ` Fabio Porcedda
  0 siblings, 1 reply; 22+ messages in thread
From: Maxime Ripard @ 2012-07-30  9:38 UTC (permalink / raw)
  To: buildroot

Le 30/07/2012 10:33, Fabio Porcedda a ?crit :
> On Fri, Jul 27, 2012 at 8:59 PM, Maxime Ripard
> <maxime.ripard@free-electrons.com> wrote:
>> Le 27/07/2012 18:06, Fabio Porcedda a ?crit :
>>> 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
>>>> /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 127
>>>
>>>
>>> I've applied your patches on top of the commit
>>> fd08153b9d677d654add6c580b9ccc5c27d672e2,
>>>
>>> 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?
> 
> 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.
> 
>> 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

Hmmm, that's weird, it applies fine here on top of these patches.
Let me send another version of these patches then.

Maxime

-- 
Maxime Ripard, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com

^ permalink raw reply	[flat|nested] 22+ messages in thread

* [Buildroot] [PATCHv3 0/6] Add some support for device tree kernels
  2012-07-30  9:38       ` Maxime Ripard
@ 2012-07-30 10:09         ` Fabio Porcedda
  0 siblings, 0 replies; 22+ messages in thread
From: Fabio Porcedda @ 2012-07-30 10:09 UTC (permalink / raw)
  To: buildroot

On Mon, Jul 30, 2012 at 11:38 AM, Maxime Ripard
<maxime.ripard@free-electrons.com> wrote:
> Le 30/07/2012 10:33, Fabio Porcedda a ?crit :
>> On Fri, Jul 27, 2012 at 8:59 PM, Maxime Ripard
>> <maxime.ripard@free-electrons.com> wrote:
>>> Le 27/07/2012 18:06, Fabio Porcedda a ?crit :
>>>> 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
>>>>> /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 127
>>>>
>>>>
>>>> I've applied your patches on top of the commit
>>>> fd08153b9d677d654add6c580b9ccc5c27d672e2,
>>>>
>>>> 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?
>>
>> 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.
>>
>>> 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
>
> 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.

-- 
Fabio Porcedda

^ permalink raw reply	[flat|nested] 22+ messages in thread

* [Buildroot] [PATCH 4/6] Add support for appended device tree blobs for arm
  2012-07-30  8:31       ` Thomas Petazzoni
@ 2012-07-30 10:10         ` Fabio Porcedda
  0 siblings, 0 replies; 22+ messages in thread
From: Fabio Porcedda @ 2012-07-30 10:10 UTC (permalink / raw)
  To: buildroot

On Mon, Jul 30, 2012 at 10:31 AM, Thomas Petazzoni
<thomas.petazzoni@free-electrons.com> wrote:
> Le Mon, 30 Jul 2012 10:25:51 +0200,
> Fabio Porcedda <fabio.porcedda@gmail.com> a ?crit :
>
>> 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: <5012E503.2070005@free-electrons.com>
>
> It should fix this problem.

It does fix this problem, thanks.

Best regards
-- 
Fabio Porcedda

^ permalink raw reply	[flat|nested] 22+ messages in thread

* [Buildroot] [PATCH 1/6] Revert "Microblaze: build kernel with device tree"
  2012-07-30 12:32 [Buildroot] [PATCHv4 " Maxime Ripard
@ 2012-07-30 12:32 ` Maxime Ripard
  0 siblings, 0 replies; 22+ messages in thread
From: Maxime Ripard @ 2012-07-30 12:32 UTC (permalink / raw)
  To: buildroot

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.

Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
---
 linux/Config.in |    8 --------
 linux/linux.mk  |   14 --------------
 2 files changed, 22 deletions(-)

diff --git a/linux/Config.in b/linux/Config.in
index 4562b1b..550371d 100644
--- a/linux/Config.in
+++ b/linux/Config.in
@@ -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
 #
diff --git a/linux/linux.mk b/linux/linux.mk
index 34f8623..09c8e79 100644
--- a/linux/linux.mk
+++ b/linux/linux.mk
@@ -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
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 22+ messages in thread

end of thread, other threads:[~2012-07-30 12:32 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-07-17 12:27 [Buildroot] [PATCHv3 0/6] Add some support for device tree kernels Maxime Ripard
2012-07-17 12:27 ` [Buildroot] [PATCH 1/6] Revert "Microblaze: build kernel with device tree" Maxime Ripard
     [not found]   ` <CAEBucnCan1vRHv4GkhYXGHnrb3Nrtg0rOtwiLY_fTuARuV0W2g@mail.gmail.com>
2012-07-18  7:23     ` Maxime Ripard
2012-07-17 12:27 ` [Buildroot] [PATCH 2/6] Rework support for the device tree Maxime Ripard
2012-07-27 19:45   ` Arnout Vandecappelle
2012-07-17 12:27 ` [Buildroot] [PATCH 3/6] Factorize the u-boot images code Maxime Ripard
2012-07-28 14:36   ` Arnout Vandecappelle
2012-07-17 12:27 ` [Buildroot] [PATCH 4/6] Add support for appended device tree blobs for arm Maxime Ripard
2012-07-28 14:49   ` Arnout Vandecappelle
2012-07-28 19:29     ` Thomas Petazzoni
2012-07-29 15:16       ` Arnout Vandecappelle
2012-07-30  8:25     ` Fabio Porcedda
2012-07-30  8:31       ` Thomas Petazzoni
2012-07-30 10:10         ` Fabio Porcedda
2012-07-17 12:27 ` [Buildroot] [PATCH 5/6] Add cuImage(powerpc) and simpleImage(microblaze) as Linux kernel images variants Maxime Ripard
2012-07-17 12:27 ` [Buildroot] [PATCH 6/6] Update s6lx9 microblaze default configuration Maxime Ripard
2012-07-27 16:06 ` [Buildroot] [PATCHv3 0/6] Add some support for device tree kernels Fabio Porcedda
2012-07-27 18:59   ` Maxime Ripard
2012-07-30  8:33     ` Fabio Porcedda
2012-07-30  9:38       ` Maxime Ripard
2012-07-30 10:09         ` Fabio Porcedda
2012-07-30 12:32 [Buildroot] [PATCHv4 " Maxime Ripard
2012-07-30 12:32 ` [Buildroot] [PATCH 1/6] Revert "Microblaze: build kernel with device tree" Maxime Ripard

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.