* [Buildroot] [PATCHv4 0/6] Add some support for device tree kernels
@ 2012-07-30 12:32 Maxime Ripard
2012-07-30 12:32 ` [Buildroot] [PATCH 1/6] Revert "Microblaze: build kernel with device tree" Maxime Ripard
` (8 more replies)
0 siblings, 9 replies; 12+ messages in thread
From: Maxime Ripard @ 2012-07-30 12:32 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 v3:
* Removed the ugly calls to sed and mkimage, that were relying on
an undefined variable (MKIMAGE) and now use the kernel build
system instead
* Changed the location of the DTS options in the configuration edition
tools
* Moved the declaration of BR2_LINUX_KERNEL_DTB_IS_SELF_BUILT from
patch 2 to patch 4, where it belongs.
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 | 101 +++++++++++++++++++++++++++++++++---
linux/linux.mk | 79 ++++++++++++++++++++++------
3 files changed, 158 insertions(+), 34 deletions(-)
--
1.7.9.5
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Buildroot] [PATCH 1/6] Revert "Microblaze: build kernel with device tree"
2012-07-30 12:32 [Buildroot] [PATCHv4 0/6] Add some support for device tree kernels Maxime Ripard
@ 2012-07-30 12:32 ` Maxime Ripard
2012-07-30 12:32 ` [Buildroot] [PATCH 2/6] Rework support for the device tree Maxime Ripard
` (7 subsequent siblings)
8 siblings, 0 replies; 12+ 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] 12+ messages in thread
* [Buildroot] [PATCH 2/6] Rework support for the device tree
2012-07-30 12:32 [Buildroot] [PATCHv4 0/6] Add some support for device tree kernels Maxime Ripard
2012-07-30 12:32 ` [Buildroot] [PATCH 1/6] Revert "Microblaze: build kernel with device tree" Maxime Ripard
@ 2012-07-30 12:32 ` Maxime Ripard
2012-07-30 12:32 ` [Buildroot] [PATCH 3/6] Factorize the u-boot images code Maxime Ripard
` (6 subsequent siblings)
8 siblings, 0 replies; 12+ messages in thread
From: Maxime Ripard @ 2012-07-30 12:32 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>
Acked-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
---
linux/Config.in | 42 ++++++++++++++++++++++++++++++++++++++++++
linux/linux.mk | 19 +++++++++++++++++++
2 files changed, 61 insertions(+)
diff --git a/linux/Config.in b/linux/Config.in
index 550371d..8ede89c 100644
--- a/linux/Config.in
+++ b/linux/Config.in
@@ -174,6 +174,48 @@ config BR2_LINUX_KERNEL_IMAGE_TARGET_NAME
Specify the kernel make target to build the kernel that you
need.
+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
+
+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
+
config BR2_LINUX_KERNEL_INSTALL_TARGET
bool "Install kernel image to /boot in target"
depends on !BR2_TARGET_ROOTFS_INITRAMFS
diff --git a/linux/linux.mk b/linux/linux.mk
index 09c8e79..25f5a05 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,25 @@ define LINUX_CONFIGURE_CMDS
yes '' | $(TARGET_MAKE_ENV) $(MAKE1) $(LINUX_MAKE_FLAGS) -C $(@D) oldconfig
endef
+ifeq ($(BR2_LINUX_KERNEL_DTS_SUPPORT),y)
+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
+
# 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 +193,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] 12+ messages in thread
* [Buildroot] [PATCH 3/6] Factorize the u-boot images code
2012-07-30 12:32 [Buildroot] [PATCHv4 0/6] Add some support for device tree kernels Maxime Ripard
2012-07-30 12:32 ` [Buildroot] [PATCH 1/6] Revert "Microblaze: build kernel with device tree" Maxime Ripard
2012-07-30 12:32 ` [Buildroot] [PATCH 2/6] Rework support for the device tree Maxime Ripard
@ 2012-07-30 12:32 ` Maxime Ripard
2012-07-30 12:32 ` [Buildroot] [PATCH 4/6] Add support for appended device tree blobs for arm Maxime Ripard
` (5 subsequent siblings)
8 siblings, 0 replies; 12+ messages in thread
From: Maxime Ripard @ 2012-07-30 12:32 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>
Acked-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
---
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 8ede89c..ff705cb 100644
--- a/linux/Config.in
+++ b/linux/Config.in
@@ -128,12 +128,16 @@ config BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE
# 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 25f5a05..5ba6c60 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] 12+ messages in thread
* [Buildroot] [PATCH 4/6] Add support for appended device tree blobs for arm
2012-07-30 12:32 [Buildroot] [PATCHv4 0/6] Add some support for device tree kernels Maxime Ripard
` (2 preceding siblings ...)
2012-07-30 12:32 ` [Buildroot] [PATCH 3/6] Factorize the u-boot images code Maxime Ripard
@ 2012-07-30 12:32 ` Maxime Ripard
2012-07-30 12:32 ` [Buildroot] [PATCH 5/6] Add cuImage(powerpc) and simpleImage(microblaze) as Linux kernel images variants Maxime Ripard
` (4 subsequent siblings)
8 siblings, 0 replies; 12+ messages in thread
From: Maxime Ripard @ 2012-07-30 12:32 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 | 33 +++++++++++++++++++++++++++++++++
linux/linux.mk | 37 ++++++++++++++++++++++++++++++++++++-
2 files changed, 69 insertions(+), 1 deletion(-)
diff --git a/linux/Config.in b/linux/Config.in
index ff705cb..37aef74 100644
--- a/linux/Config.in
+++ b/linux/Config.in
@@ -139,6 +139,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
@@ -147,6 +154,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
@@ -186,6 +199,26 @@ config BR2_LINUX_KERNEL_DTS_SUPPORT
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
+
+config BR2_LINUX_KERNEL_APPENDED_DTB
+ bool
+
choice
prompt "Device tree source"
default BR2_LINUX_KERNEL_USE_INTREE_DTS
diff --git a/linux/linux.mk b/linux/linux.mk
index 5ba6c60..d24a11a 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,10 +176,13 @@ 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
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
@@ -170,17 +190,32 @@ define LINUX_INSTALL_DTB
cp $(KERNEL_ARCH_PATH)/boot/$(KERNEL_DTS_NAME).dtb $(BINARIES_DIR)/
endef
endif
+endif
+
+ifeq ($(BR2_LINUX_KERNEL_APPENDED_UIMAGE),y)
+define LINUX_APPEND_DTB
+ cat $(KERNEL_ARCH_PATH)/boot/$(KERNEL_DTS_NAME).dtb >> $(KERNEL_ARCH_PATH)/boot/zImage
+ # We need to generate the uImage here after that so that the uImage is
+ # generated with the right image size.
+ $(TARGET_MAKE_ENV) $(MAKE) $(LINUX_MAKE_FLAGS) -C $(@D) uImage
+endef
+else ifeq ($(BR2_LINUX_KERNEL_APPENDED_ZIMAGE),y)
+define LINUX_APPEND_DTB
+ cat $(KERNEL_ARCH_PATH)/boot/$(KERNEL_DTS_NAME).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] 12+ messages in thread
* [Buildroot] [PATCH 5/6] Add cuImage(powerpc) and simpleImage(microblaze) as Linux kernel images variants
2012-07-30 12:32 [Buildroot] [PATCHv4 0/6] Add some support for device tree kernels Maxime Ripard
` (3 preceding siblings ...)
2012-07-30 12:32 ` [Buildroot] [PATCH 4/6] Add support for appended device tree blobs for arm Maxime Ripard
@ 2012-07-30 12:32 ` Maxime Ripard
2012-07-30 12:32 ` [Buildroot] [PATCH 6/6] Update s6lx9 microblaze default configuration Maxime Ripard
` (3 subsequent siblings)
8 siblings, 0 replies; 12+ messages in thread
From: Maxime Ripard @ 2012-07-30 12:32 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 37aef74..79a303c 100644
--- a/linux/Config.in
+++ b/linux/Config.in
@@ -160,6 +160,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 d24a11a..cd359ce 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] 12+ messages in thread
* [Buildroot] [PATCH 6/6] Update s6lx9 microblaze default configuration
2012-07-30 12:32 [Buildroot] [PATCHv4 0/6] Add some support for device tree kernels Maxime Ripard
` (4 preceding siblings ...)
2012-07-30 12:32 ` [Buildroot] [PATCH 5/6] Add cuImage(powerpc) and simpleImage(microblaze) as Linux kernel images variants Maxime Ripard
@ 2012-07-30 12:32 ` Maxime Ripard
2012-07-30 13:55 ` [Buildroot] [PATCH 1/2] Update qemu microblazeel " Maxime Ripard
` (2 subsequent siblings)
8 siblings, 0 replies; 12+ messages in thread
From: Maxime Ripard @ 2012-07-30 12:32 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] 12+ messages in thread
* [Buildroot] [PATCH 1/2] Update qemu microblazeel default configuration
2012-07-30 12:32 [Buildroot] [PATCHv4 0/6] Add some support for device tree kernels Maxime Ripard
` (5 preceding siblings ...)
2012-07-30 12:32 ` [Buildroot] [PATCH 6/6] Update s6lx9 microblaze default configuration Maxime Ripard
@ 2012-07-30 13:55 ` Maxime Ripard
2012-07-30 13:55 ` [Buildroot] [PATCH 2/2] Update qemu microblazebe " Maxime Ripard
2012-07-30 19:16 ` [Buildroot] [PATCHv4 0/6] Add some support for device tree kernels Thomas Petazzoni
2012-07-31 21:44 ` Thomas Petazzoni
8 siblings, 1 reply; 12+ messages in thread
From: Maxime Ripard @ 2012-07-30 13:55 UTC (permalink / raw)
To: buildroot
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
---
configs/qemu_microblazeel_mmu_defconfig | 19 +++----------------
1 file changed, 3 insertions(+), 16 deletions(-)
diff --git a/configs/qemu_microblazeel_mmu_defconfig b/configs/qemu_microblazeel_mmu_defconfig
index 7034447..d9fb318 100644
--- a/configs/qemu_microblazeel_mmu_defconfig
+++ b/configs/qemu_microblazeel_mmu_defconfig
@@ -1,27 +1,14 @@
-# Architecture
-BR2_microblaze=y
BR2_microblazeel=y
-
-# Toolchain
-BR2_TOOLCHAIN_EXTERNAL=y
-BR2_TOOLCHAIN_EXTERNAL_XILINX_MICROBLAZEEL_V2=y
-BR2_TOOLCHAIN_EXTERNAL_DOWNLOAD=y
-BR2_TOOLCHAIN_EXTERNAL_CUSTOM_GLIBC=y
-BR2_TOOLCHAIN_EXTERNAL_CXX=y
-
-# System
BR2_TARGET_GENERIC_GETTY_PORT="ttyUL0"
-
-# Filesystem
# BR2_TARGET_ROOTFS_TAR is not set
BR2_TARGET_ROOTFS_INITRAMFS=y
-
-# Kernel
BR2_LINUX_KERNEL=y
BR2_LINUX_KERNEL_CUSTOM_VERSION=y
BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="3.3.7"
BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG=y
BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="board/qemu/microblazeel-mmu/kernel-3.3.config"
-BR2_LINUX_KERNEL_DTS_FILE="board/qemu/microblazeel-mmu/system.dts"
BR2_LINUX_KERNEL_IMAGE_TARGET_CUSTOM=y
BR2_LINUX_KERNEL_IMAGE_TARGET_NAME="linux.bin"
+BR2_LINUX_KERNEL_DTS_SUPPORT=y
+BR2_LINUX_KERNEL_USE_CUSTOM_DTS=y
+BR2_LINUX_KERNEL_CUSTOM_DTS_PATH="board/qemu/microblazeel-mmu/system.dts"
--
1.7.9.5
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [Buildroot] [PATCH 2/2] Update qemu microblazebe default configuration
2012-07-30 13:55 ` [Buildroot] [PATCH 1/2] Update qemu microblazeel " Maxime Ripard
@ 2012-07-30 13:55 ` Maxime Ripard
0 siblings, 0 replies; 12+ messages in thread
From: Maxime Ripard @ 2012-07-30 13:55 UTC (permalink / raw)
To: buildroot
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
---
configs/qemu_microblazebe_mmu_defconfig | 19 +++----------------
1 file changed, 3 insertions(+), 16 deletions(-)
diff --git a/configs/qemu_microblazebe_mmu_defconfig b/configs/qemu_microblazebe_mmu_defconfig
index 387466b..e8978c9 100644
--- a/configs/qemu_microblazebe_mmu_defconfig
+++ b/configs/qemu_microblazebe_mmu_defconfig
@@ -1,27 +1,14 @@
-# Architecture
-BR2_microblaze=y
BR2_microblazebe=y
-
-# Special toolchain
-BR2_TOOLCHAIN_EXTERNAL=y
-BR2_TOOLCHAIN_EXTERNAL_XILINX_MICROBLAZEBE_V2=y
-BR2_TOOLCHAIN_EXTERNAL_DOWNLOAD=y
-BR2_TOOLCHAIN_EXTERNAL_CUSTOM_GLIBC=y
-BR2_TOOLCHAIN_EXTERNAL_CXX=y
-
-# System
BR2_TARGET_GENERIC_GETTY_PORT="ttyUL0"
-
-# Filesystem
# BR2_TARGET_ROOTFS_TAR is not set
BR2_TARGET_ROOTFS_INITRAMFS=y
-
-# Kernel
BR2_LINUX_KERNEL=y
BR2_LINUX_KERNEL_CUSTOM_VERSION=y
BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="3.3.7"
BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG=y
BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="board/qemu/microblazebe-mmu/kernel-3.3.config"
-BR2_LINUX_KERNEL_DTS_FILE="board/qemu/microblazebe-mmu/system.dts"
BR2_LINUX_KERNEL_IMAGE_TARGET_CUSTOM=y
BR2_LINUX_KERNEL_IMAGE_TARGET_NAME="linux.bin"
+BR2_LINUX_KERNEL_DTS_SUPPORT=y
+BR2_LINUX_KERNEL_USE_CUSTOM_DTS=y
+BR2_LINUX_KERNEL_CUSTOM_DTS_PATH="board/qemu/microblazebe-mmu/system.dts"
--
1.7.9.5
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [Buildroot] [PATCHv4 0/6] Add some support for device tree kernels
2012-07-30 12:32 [Buildroot] [PATCHv4 0/6] Add some support for device tree kernels Maxime Ripard
` (6 preceding siblings ...)
2012-07-30 13:55 ` [Buildroot] [PATCH 1/2] Update qemu microblazeel " Maxime Ripard
@ 2012-07-30 19:16 ` Thomas Petazzoni
2012-07-31 10:13 ` Maxime Ripard
2012-07-31 21:44 ` Thomas Petazzoni
8 siblings, 1 reply; 12+ messages in thread
From: Thomas Petazzoni @ 2012-07-30 19:16 UTC (permalink / raw)
To: buildroot
Hello,
Le Mon, 30 Jul 2012 14:32:43 +0200,
Maxime Ripard <maxime.ripard@free-electrons.com> a ?crit :
> This is a refactoring of the previous basic device tree
> options available for microblaze.
I am fine with the general design, but it doesn't work: the
qemu_microblazeel_defconfig doesn't build.
I had to make some changes:
*) Change the defconfig to limit the number of modifications compared
to the previous versions (keep architecture, toolchain, etc.)
properties.
*) Create a special kconfig entry for the linux.bin image format
(Microblaze specific). This format requires mkimage to generate
linux.bin, so we need to select BR2_LINUX_KERNEL_UBOOT_IMAGE. It
probably worked on your system because you have mkimage installed
system-wide, but since it isn't part of our required dependencies,
you shouldn't rely on it.
However, even with those fixes, building the DTB doesn't work.
Apparently, system.dts/system.dtb are kind of "reserved" names for
Microblaze (from a quick reading of arch/microblaze/boot/Makefile). I
have the following build error:
Kernel: arch/microblaze/boot/linux.bin is ready (#1)
CHK include/linux/version.h
CHK include/generated/utsrelease.h
CALL scripts/checksyscalls.sh
Building modules, stage 2.
MODPOST 0 modules
PATH="/home/test/outputs/t/host/bin:/home/test/outputs/t/host/usr/bin:/home/test/outputs/t/host/usr/sbin/:/usr/local/bin:/usr/bin:/bin:/usr/games" PERLLIB="/home/test/outputs/t/host/usr/lib/perl" /usr/bin/make -j2 HOSTCC="/usr/bin/gcc" HOSTCFLAGS="" ARCH=microblaze INSTALL_MOD_PATH=/home/test/outputs/t/target CROSS_COMPILE=" /home/test/outputs/t/host/usr/bin/microblazeel-unknown-linux-gnu-" DEPMOD=/home/test/outputs/t/host/usr/sbin/depmod -C /home/test/outputs/t/build/linux-3.3.7 system.dtb
make[2]: *** No rule to make target `system.dtb'. Stop.
make[1]: *** [/home/test/outputs/t/build/linux-3.3.7/.stamp_built] Error 2
make: *** [all] Error 2
It would be good if you could fix this problem and resubmit. Please
base your new work using the following branch, which includes the two
changes I've mentioned above:
http://git.free-electrons.com/users/thomas-petazzoni/buildroot/log/?h=device-tree-support
Thanks!
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] 12+ messages in thread
* [Buildroot] [PATCHv4 0/6] Add some support for device tree kernels
2012-07-30 19:16 ` [Buildroot] [PATCHv4 0/6] Add some support for device tree kernels Thomas Petazzoni
@ 2012-07-31 10:13 ` Maxime Ripard
0 siblings, 0 replies; 12+ messages in thread
From: Maxime Ripard @ 2012-07-31 10:13 UTC (permalink / raw)
To: buildroot
Hi Thomas,
Le 30/07/2012 21:16, Thomas Petazzoni a ?crit :
> Le Mon, 30 Jul 2012 14:32:43 +0200,
> Maxime Ripard <maxime.ripard@free-electrons.com> a ?crit :
>
>> This is a refactoring of the previous basic device tree
>> options available for microblaze.
>
> I am fine with the general design, but it doesn't work: the
> qemu_microblazeel_defconfig doesn't build.
>
> I had to make some changes:
>
> *) Change the defconfig to limit the number of modifications compared
> to the previous versions (keep architecture, toolchain, etc.)
> properties.
>
> *) Create a special kconfig entry for the linux.bin image format
> (Microblaze specific). This format requires mkimage to generate
> linux.bin, so we need to select BR2_LINUX_KERNEL_UBOOT_IMAGE. It
> probably worked on your system because you have mkimage installed
> system-wide, but since it isn't part of our required dependencies,
> you shouldn't rely on it.
>
> However, even with those fixes, building the DTB doesn't work.
> Apparently, system.dts/system.dtb are kind of "reserved" names for
> Microblaze (from a quick reading of arch/microblaze/boot/Makefile). I
> have the following build error:
>
> Kernel: arch/microblaze/boot/linux.bin is ready (#1)
> CHK include/linux/version.h
> CHK include/generated/utsrelease.h
> CALL scripts/checksyscalls.sh
> Building modules, stage 2.
> MODPOST 0 modules
> PATH="/home/test/outputs/t/host/bin:/home/test/outputs/t/host/usr/bin:/home/test/outputs/t/host/usr/sbin/:/usr/local/bin:/usr/bin:/bin:/usr/games" PERLLIB="/home/test/outputs/t/host/usr/lib/perl" /usr/bin/make -j2 HOSTCC="/usr/bin/gcc" HOSTCFLAGS="" ARCH=microblaze INSTALL_MOD_PATH=/home/test/outputs/t/target CROSS_COMPILE=" /home/test/outputs/t/host/usr/bin/microblazeel-unknown-linux-gnu-" DEPMOD=/home/test/outputs/t/host/usr/sbin/depmod -C /home/test/outputs/t/build/linux-3.3.7 system.dtb
> make[2]: *** No rule to make target `system.dtb'. Stop.
> make[1]: *** [/home/test/outputs/t/build/linux-3.3.7/.stamp_built] Error 2
> make: *** [all] Error 2
>
> It would be good if you could fix this problem and resubmit. Please
> base your new work using the following branch, which includes the two
> changes I've mentioned above:
It looks like in the previous patchset, the custom system.dts file was
copied (and as such, overwriting the original system.dts file), and
never built.
From a quick test here, adding a
select BR2_LINUX_KERNEL_DTB_IS_SELF_BUILT
to the linux.bin image is putting back the same behaviour as before, and
do not fail to build anymore.
Do you want me to send an updated version?
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] 12+ messages in thread
* [Buildroot] [PATCHv4 0/6] Add some support for device tree kernels
2012-07-30 12:32 [Buildroot] [PATCHv4 0/6] Add some support for device tree kernels Maxime Ripard
` (7 preceding siblings ...)
2012-07-30 19:16 ` [Buildroot] [PATCHv4 0/6] Add some support for device tree kernels Thomas Petazzoni
@ 2012-07-31 21:44 ` Thomas Petazzoni
8 siblings, 0 replies; 12+ messages in thread
From: Thomas Petazzoni @ 2012-07-31 21:44 UTC (permalink / raw)
To: buildroot
Le Mon, 30 Jul 2012 14:32:43 +0200,
Maxime Ripard <maxime.ripard@free-electrons.com> a ?crit :
> configs/s6lx9_microboard_defconfig | 12 +----
> linux/Config.in | 101 +++++++++++++++++++++++++++++++++---
> linux/linux.mk | 79 ++++++++++++++++++++++------
> 3 files changed, 158 insertions(+), 34 deletions(-)
I have now applied this patch set, including the small fix you
suggested for the linux.bin image problem I reported yesterday.
Thanks a lot for your persistence, I think it's great to have proper
support in Buildroot to generate DT-related kernel images.
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] 12+ messages in thread
end of thread, other threads:[~2012-07-31 21:44 UTC | newest]
Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-07-30 12:32 [Buildroot] [PATCHv4 0/6] Add some support for device tree kernels Maxime Ripard
2012-07-30 12:32 ` [Buildroot] [PATCH 1/6] Revert "Microblaze: build kernel with device tree" Maxime Ripard
2012-07-30 12:32 ` [Buildroot] [PATCH 2/6] Rework support for the device tree Maxime Ripard
2012-07-30 12:32 ` [Buildroot] [PATCH 3/6] Factorize the u-boot images code Maxime Ripard
2012-07-30 12:32 ` [Buildroot] [PATCH 4/6] Add support for appended device tree blobs for arm Maxime Ripard
2012-07-30 12:32 ` [Buildroot] [PATCH 5/6] Add cuImage(powerpc) and simpleImage(microblaze) as Linux kernel images variants Maxime Ripard
2012-07-30 12:32 ` [Buildroot] [PATCH 6/6] Update s6lx9 microblaze default configuration Maxime Ripard
2012-07-30 13:55 ` [Buildroot] [PATCH 1/2] Update qemu microblazeel " Maxime Ripard
2012-07-30 13:55 ` [Buildroot] [PATCH 2/2] Update qemu microblazebe " Maxime Ripard
2012-07-30 19:16 ` [Buildroot] [PATCHv4 0/6] Add some support for device tree kernels Thomas Petazzoni
2012-07-31 10:13 ` Maxime Ripard
2012-07-31 21:44 ` Thomas Petazzoni
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox