Add Device Tree and simpleImage support
PATCH v2 1/1 Add Device Tree and simpleImage support
This patch adds device tree and simpleImage support to buildroot. When the simpleImage Kernel binary image type is selected, the user has can select either an in tree device tree source file or an out of tree device tree source file.
This triggers the kernel to build the simpleImage.<dt> target and copy the resulting binary to the output/images directory. Additionally, if the install dtb option is selected the <dt>.dtb file is copied to the output directory.
--- linux/Config.in | 46 ++++++++++++++++++++++++++++++++++++++++++++++ linux/linux.mk | 41 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 87 insertions(+), 0 deletions(-)
linux/Config.in +46 -0
@@ -150,6 +150,10 @@ config BR2_LINUX_KERNEL_VMLINUZ bool "vmlinuz" depends on BR2_mips || BR2_mipsel +config BR2_LINUX_KERNEL_SIMPLEIMAGE + bool "simpleImage" + depends on BR2_microblaze + config BR2_LINUX_KERNEL_IMAGE_TARGET_CUSTOM bool "custom target" help
@@ -163,6 +167,48 @@ config BR2_LINUX_KERNEL_IMAGE_TARGET_CUSTOM endchoice +# +# Device Tree Support +# + +choice + prompt "Device Tree Blob" + default BR2_LINUX_KERNEL_USE_DTS + depends on BR2_LINUX_KERNEL_SIMPLEIMAGE + +config BR2_LINUX_KERNEL_USE_DTS + bool "Use an in kernel device tree" + +config BR2_LINUX_KERNEL_USE_CUSTOM_DTS + bool "Use a custom device tree" + +endchoice + +config BR2_LINUX_KERNEL_MAKE_DTB + bool + default y if BR2_LINUX_KERNEL_USE_DTS || BR2_LINUX_KERNEL_USE_CUSTOM_DTS + +config BR2_LINUX_KERNEL_INSTALL_DTS + bool "Copy device tree blob to the output directory" + depends on BR2_LINUX_KERNEL_MAKE_DTB + help + This copies the device tree blob to the images + directory. + +config BR2_LINUX_KERNEL_DTS + string "Dts Name" + depends on BR2_LINUX_KERNEL_USE_DTS + help + Name of device tree source file in tree to use + without the trailing .dts + +config BR2_LINUX_KERNEL_CUSTOM_DTS + string "Dts file path" + depends on BR2_LINUX_KERNEL_USE_CUSTOM_DTS + help + Path to the custom dts file. + + config BR2_LINUX_KERNEL_IMAGE_TARGET_NAME string "Kernel image target name" depends on BR2_LINUX_KERNEL_IMAGE_TARGET_CUSTOM
linux/linux.mk +41 -0
82 lines not on this page · raw message
Signature · 1 line
1.7.9
PATCH v2 1/1 Add Device Tree and simpleImage support
Quoted 3 lines · On Sunday 19 February 2012 21:41:00 Spenser Gilliland wrote:
This patch adds device tree and simpleImage support to buildroot. When the simpleImage Kernel binary image type is selected, the user has can select either an in tree device tree source file or an out of tree device tree source file.
This triggers the kernel to build the simpleImage.<dt> target and copy the resulting binary to the output/images directory. Additionally, if the install dtb option is selected the <dt>.dtb file is copied to the output directory.
Please wrap the commit message at 80 columns.
The simpleImage support should be split off from the DTS support in a
separate patch.
Quoted 1 line
Signed-off-by Spenser Gilliland <[email protected]>
[snip]
linux/Config.in config BR2_LINUX_KERNEL_IMAGE_TARGET_CUSTOM · line 177
Quoted 8 lines
linux/Config.in +8
-0+# +# Device Tree Support +# + +choice + prompt "Device Tree Blob" + default BR2_LINUX_KERNEL_USE_DTS + depends on BR2_LINUX_KERNEL_SIMPLEIMAGE
DTS is available for (almost) all architectures, so I don't think we
needs a depends here. Certainly not on simpleImage.
Quoted 9 lines
linux/Config.in +9
-0+ +config BR2_LINUX_KERNEL_USE_DTS + bool "Use an in kernel device tree" + +config BR2_LINUX_KERNEL_USE_CUSTOM_DTS + bool "Use a custom device tree" + +endchoice +
linux/Config.in config BR2_LINUX_KERNEL_IMAGE_TARGET_CUSTOM · line 196
Quoted 10 lines
linux/Config.in +10
-0+config BR2_LINUX_KERNEL_MAKE_DTB + bool + default y if BR2_LINUX_KERNEL_USE_DTS || BR2_LINUX_KERNEL_USE_CUSTOM_DTS + +config BR2_LINUX_KERNEL_INSTALL_DTS + bool "Copy device tree blob to the output directory" + depends on BR2_LINUX_KERNEL_MAKE_DTB + help + This copies the device tree blob to the images + directory.
I don't think this is necessary; the dtb is pretty small so you can just
copy it to the images directory unconditionally.
If you do keep this config, call it INSTALL_DTB and fix the description
to 'to the images directory'.
linux/Config.in config BR2_LINUX_KERNEL_IMAGE_TARGET_CUSTOM · line 203
Quoted 7 lines
linux/Config.in +7
-0+ +config BR2_LINUX_KERNEL_DTS + string "Dts Name" + depends on BR2_LINUX_KERNEL_USE_DTS + help + Name of device tree source file in tree to use + without the trailing .dts
Maybe point out where it can be found: arch/<arch>/boot/dts/
Quoted 16 lines
linux/Config.in +8
-0+ +config BR2_LINUX_KERNEL_CUSTOM_DTS + string "Dts file path" + depends on BR2_LINUX_KERNEL_USE_CUSTOM_DTS + help + Path to the custom dts file. + + config BR2_LINUX_KERNEL_IMAGE_TARGET_NAME string "Kernel image target name" depends on BR2_LINUX_KERNEL_IMAGE_TARGET_CUSTOMlinux/linux.mk +0
-0
linux/linux.mk else ifeq ($(BR2_LINUX_KERNEL_VMLINUX),y) · line 71
Quoted 5 lines
linux/linux.mk +2
-0@@ -67,6 +67,9 @@ else ifeq ($(BR2_LINUX_KERNEL_VMLINUX),y) LINUX_IMAGE_NAME=vmlinux else ifeq ($(BR2_LINUX_KERNEL_VMLINUZ),y) LINUX_IMAGE_NAME=vmlinuz +else ifeq ($(BR2_LINUX_KERNEL_SIMPLEIMAGE),y) +# Image name is set once the dts is known
If you move the DTS stuff before these conditions, then you don't
need a special case for simpleImage here.
linux/linux.mk endef · line 126
Quoted 11 lines
linux/linux.mk +4
-0+LINUX_DEPENDENCIES+=host-uboot-tools endif endif@@ -118,6 +121,35 @@ endef LINUX_POST_PATCH_HOOKS += LINUX_APPLY_PATCHES +ifneq ($(BR2_LINUX_KERNEL_CUSTOM_DTS),) +LINUX_KERNEL_CUSTOM_DTS = $(call qstrip, $(BR2_LINUX_KERNEL_CUSTOM_DTS)) +DTS_NAME = $(shell export file=`basename $(LINUX_KERNEL_CUSTOM_DTS)` && echo $${file%.*})
Doesn't this work?DTS_NAME = $(patsubst %.dts,%,$(notdir $(LINUX_KERNEL_CUSTOM_DTS)))
linux/linux.mk endef · line 128
Quoted 2 lines
linux/linux.mk +2
-0+define LINUX_COPY_DTS + echo "LINUX_KERNEL_CUSTOM_DTS=$(LINUX_KERNEL_CUSTOM_DTS) and DTS_NAME=$(DTS_NAME)" && \
I guess this line was there for debugging and is redundant now?
linux/linux.mk endef · line 140
Quoted 12 lines
linux/linux.mk +12
-0+ mkdir -p $(KERNEL_ARCH_PATH)/boot/dts && \ + cp $(BR2_LINUX_KERNEL_CUSTOM_DTS) $(KERNEL_ARCH_PATH)/boot/dts/ +endef +endif + +ifeq ($(BR2_LINUX_KERNEL_USE_DTS),y) +DTS_NAME = $(call qstrip, $(BR2_LINUX_KERNEL_DTS)) +endif + +ifeq ($(BR2_LINUX_KERNEL_MAKE_DTB),y) +define LINUX_MAKE_DTB + $(TARGET_MAKE_ENV) $(MAKE) $(LINUX_MAKE_FLAGS) -C $(@D) scripts/dtc/ && \
Is that correct? Shouldn't that be scripts/dtc/dtc ?
Also, there's no reason to use && to connect the steps here: make
implicitly terminates command execution if any command fails.
linux/linux.mk endef · line 141
Quoted 1 line
linux/linux.mk +1
-0+ scripts/dtc/dtc -O dtb -o $(KERNEL_ARCH_PATH)/boot/$(DTS_NAME).dtb \
There's something wrong with the indentation here.
Quoted 15 lines
linux/linux.mk +11
-0+ -b 0 -p 1024 $(KERNEL_ARCH_PATH)/boot/dts/$(DTS_NAME).dts +endef +define LINUX_INSTALL_DTB + cp $(KERNEL_ARCH_PATH)/boot/$(DTS_NAME).dtb $(BINARIES_DIR) +endef +endif + +ifeq ($(BR2_LINUX_KERNEL_SIMPLEIMAGE),y) +LINUX_IMAGE_NAME = simpleImage.$(DTS_NAME) +endif + ifeq ($(BR2_LINUX_KERNEL_USE_DEFCONFIG),y) KERNEL_SOURCE_CONFIG = $(KERNEL_ARCH_PATH)/configs/$(call qstrip,$(BR2_LINUX_KERNEL_DEFCONFIG))_defconfig else ifeq ($(BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG),y)
linux/linux.mk KERNEL_SOURCE_CONFIG = $(BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE) · line 161
Quoted 5 lines
linux/linux.mk +2
-0@@ -125,6 +157,8 @@ KERNEL_SOURCE_CONFIG = $(BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE) endif define LINUX_CONFIGURE_CMDS + $(if $(BR2_LINUX_KERNEL_USE_CUSTOM_DTS), + $(call LINUX_COPY_DTS))
Why is this a $(call)? You're not passing any parameters... Also, the
$(if) is redundant since LINUX_COPY_DTS will just be empty if it's not true.
linux/linux.mk define LINUX_BUILD_CMDS · line 196
Quoted 9 lines
linux/linux.mk +2
-0cp $(KERNEL_SOURCE_CONFIG) $(KERNEL_ARCH_PATH)/configs/buildroot_defconfig $(TARGET_MAKE_ENV) $(MAKE1) $(LINUX_MAKE_FLAGS) -C $(@D) buildroot_defconfig rm $(KERNEL_ARCH_PATH)/configs/buildroot_defconfig@@ -158,17 +192,22 @@ define LINUX_BUILD_CMDS @if grep -q "CONFIG_MODULES=y" $(@D)/.config; then \ $(TARGET_MAKE_ENV) $(MAKE) $(LINUX_MAKE_FLAGS) -C $(@D) modules ; \ fi + $(if $(BR2_LINUX_KERNEL_MAKE_DTB), + $(call LINUX_MAKE_DTB))
Same here.
linux/linux.mk define LINUX_BUILD_CMDS · line 203
Quoted 7 lines
linux/linux.mk +1
-0endef ifeq ($(BR2_LINUX_KERNEL_INSTALL_TARGET),y) define LINUX_INSTALL_KERNEL_IMAGE_TO_TARGET install -m 0644 -D $(LINUX_IMAGE_PATH) $(TARGET_DIR)/boot/$(LINUX_IMAGE_NAME) +
No need to add an empty line here.
linux/linux.mk define LINUX_BUILD_CMDS · line 210
Quoted 7 lines
linux/linux.mk +2
-0endef endif define LINUX_INSTALL_IMAGES_CMDS cp $(LINUX_IMAGE_PATH) $(BINARIES_DIR) + $(if $(BR2_LINUX_KERNEL_INSTALL_DTB), + $(call LINUX_INSTALL_DTB))
Again redundant $(if) and $(call).
linux/linux.mk $(LINUX_DIR)/.stamp_initramfs_rebuilt: $(LINUX_DIR)/.stamp_target_installed $(LI · line 258
Quoted 9 lines
linux/linux.mk +2
-0endef define LINUX_INSTALL_TARGET_CMDS@@ -215,6 +254,8 @@ $(LINUX_DIR)/.stamp_initramfs_rebuilt: $(LINUX_DIR)/.stamp_target_installed $(LI $(TARGET_MAKE_ENV) $(MAKE) $(LINUX_MAKE_FLAGS) -C $(@D) $(LINUX_IMAGE_NAME) # Copy the kernel image to its final destination cp $(LINUX_IMAGE_PATH) $(BINARIES_DIR) + # If there is a .ub file copy it to the final destination + test -f $(LINUX_IMAGE_PATH).ub && cp $(LINUX_IMAGE_PATH).ub $(BINARIES_DIR)
Maybe add a comment here explaining with a .ub file is.
Is this only relevant for initramfs builds?
linux/linux.mk $(LINUX_DIR)/.stamp_initramfs_rebuilt: $(LINUX_DIR)/.stamp_target_installed $(LI · line 261
Quoted 4 lines
linux/linux.mk +0
-0$(Q)touch $@ # The initramfs building code must make sure this target gets called
Regards,
Arnout
Signature · 6 lines
Arnout Vandecappelle arnout at mind be Senior Embedded Software Architect +32-16-286540 Essensium/Mind http://www.mind.be G.Geenslaan 9, 3001 Leuven, Belgium BE 872 984 063 RPR Leuven LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle GPG fingerprint: 7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F
PATCH v2 1/1 Add Device Tree and simpleImage support
Hi, Spenser
Do you need some help solving this issues? If you don't have the time I can try and solve some of them, I just don't want to step on your job if you're already working at that.
BTW, Arnout, I saw you ack'ed my previous patches for wget and xilinx's repositories, but I haven't seen them applied to the tree. Is there anything I can help with?
Regards,
2012/2/20 Arnout Vandecappelle <[email protected]>
Quoted 235 lines · On Sunday 19 February 2012 21:41:00 Spenser Gilliland wrote:
Quoted 1 line
This patch adds device tree and simpleImage support to buildroot. When
the simpleImage Kernel binary image type is selected, the user has can select either an in tree device tree source file or an out of tree device tree source file.
Quoted 2 lines
This triggers the kernel to build the simpleImage.<dt> target and copy
the resulting binary to the output/images directory. Additionally, if the install dtb option is selected the <dt>.dtb file is copied to the output directory.
Please wrap the commit message at 80 columns.
The simpleImage support should be split off from the DTS support in a
separate patch.Quoted 1 line
Signed-off-by Spenser Gilliland <[email protected]>[snip]
linux/Config.in config BR2_LINUX_KERNEL_IMAGE_TARGET_CUSTOM · line 177
Quoted 8 lines
linux/Config.in +8
-0+# +# Device Tree Support +# + +choice + prompt "Device Tree Blob" + default BR2_LINUX_KERNEL_USE_DTS + depends on BR2_LINUX_KERNEL_SIMPLEIMAGEDTS is available for (almost) all architectures, so I don't think we
needs a depends here. Certainly not on simpleImage.linux/Config.in config BR2_LINUX_KERNEL_IMAGE_TARGET_CUSTOM
Quoted 12 lines
linux/Config.in +12
-0+ +config BR2_LINUX_KERNEL_USE_DTS + bool "Use an in kernel device tree" + +config BR2_LINUX_KERNEL_USE_CUSTOM_DTS + bool "Use a custom device tree" + +endchoice + +config BR2_LINUX_KERNEL_MAKE_DTB + bool + default y if BR2_LINUX_KERNEL_USE_DTS ||
BR2_LINUX_KERNEL_USE_CUSTOM_DTSlinux/Config.in config BR2_LINUX_KERNEL_IMAGE_TARGET_CUSTOM · line 196
Quoted 7 lines
linux/Config.in +7
-0+ +config BR2_LINUX_KERNEL_INSTALL_DTS + bool "Copy device tree blob to the output directory" + depends on BR2_LINUX_KERNEL_MAKE_DTB + help + This copies the device tree blob to the images + directory.I don't think this is necessary; the dtb is pretty small so you can just
copy it to the images directory unconditionally.If you do keep this config, call it
INSTALL_DTBand fix the description
to 'to the images directory'.linux/Config.in config BR2_LINUX_KERNEL_IMAGE_TARGET_CUSTOM · line 203
Quoted 7 lines
linux/Config.in +7
-0+ +config BR2_LINUX_KERNEL_DTS + string "Dts Name" + depends on BR2_LINUX_KERNEL_USE_DTS + help + Name of device tree source file in tree to use + without the trailing .dtsMaybe point out where it can be found: arch/<arch>/boot/dts/
Quoted 16 lines
linux/Config.in +8
-0+ +config BR2_LINUX_KERNEL_CUSTOM_DTS + string "Dts file path" + depends on BR2_LINUX_KERNEL_USE_CUSTOM_DTS + help + Path to the custom dts file. + + config BR2_LINUX_KERNEL_IMAGE_TARGET_NAME string "Kernel image target name" depends on BR2_LINUX_KERNEL_IMAGE_TARGET_CUSTOMlinux/linux.mk +0
-0linux/linux.mk else ifeq ($(BR2_LINUX_KERNEL_VMLINUX),y) · line 71
Quoted 5 lines
linux/linux.mk +2
-0@@ -67,6 +67,9 @@ else ifeq ($(BR2_LINUX_KERNEL_VMLINUX),y) LINUX_IMAGE_NAME=vmlinux else ifeq ($(BR2_LINUX_KERNEL_VMLINUZ),y) LINUX_IMAGE_NAME=vmlinuz +else ifeq ($(BR2_LINUX_KERNEL_SIMPLEIMAGE),y) +# Image name is set once the dts is knownIf you move the DTS stuff before these conditions, then you don't
need a special case for simpleImage here.linux/linux.mk endef · line 126
Quoted 11 lines
linux/linux.mk +4
-0+LINUX_DEPENDENCIES+=host-uboot-tools endif endif@@ -118,6 +121,35 @@ endef LINUX_POST_PATCH_HOOKS += LINUX_APPLY_PATCHES +ifneq ($(BR2_LINUX_KERNEL_CUSTOM_DTS),) +LINUX_KERNEL_CUSTOM_DTS = $(call qstrip, $(BR2_LINUX_KERNEL_CUSTOM_DTS)) +DTS_NAME = $(shell export file=`basename $(LINUX_KERNEL_CUSTOM_DTS)` &&echo $${file%.*})
Doesn't this work?
DTS_NAME= $(patsubst %.dts,%,$(notdir $(LINUX_KERNEL_CUSTOM_DTS)))linux/linux.mk endef · line 128
Quoted 2 lines
linux/linux.mk +2
-0+define LINUX_COPY_DTS + echo "LINUX_KERNEL_CUSTOM_DTS=$(LINUX_KERNEL_CUSTOM_DTS) andDTS_NAME=$(DTS_NAME)" && \
I guess this line was there for debugging and is redundant now?
linux/linux.mk endef
Quoted 12 lines
linux/linux.mk +12
-0+ mkdir -p $(KERNEL_ARCH_PATH)/boot/dts && \ + cp $(BR2_LINUX_KERNEL_CUSTOM_DTS) $(KERNEL_ARCH_PATH)/boot/dts/ +endef +endif + +ifeq ($(BR2_LINUX_KERNEL_USE_DTS),y) +DTS_NAME = $(call qstrip, $(BR2_LINUX_KERNEL_DTS)) +endif + +ifeq ($(BR2_LINUX_KERNEL_MAKE_DTB),y) +define LINUX_MAKE_DTB + $(TARGET_MAKE_ENV) $(MAKE) $(LINUX_MAKE_FLAGS) -C $(@D)
scripts/dtc/&& \Is that correct? Shouldn't that be
scripts/dtc/dtc?Also, there's no reason to use && to connect the steps here: make
implicitly terminates command execution if any command fails.linux/linux.mk endef · line 141
Quoted 1 line
linux/linux.mk +1
-0+ scripts/dtc/dtc -O dtb -o $(KERNEL_ARCH_PATH)/boot/$(DTS_NAME).dtb \There's something wrong with the indentation here.
linux/linux.mk endef
Quoted 13 lines
linux/linux.mk +11
-0+ -b 0 -p 1024 $(KERNEL_ARCH_PATH)/boot/dts/$(DTS_NAME).dts +endef +define LINUX_INSTALL_DTB + cp $(KERNEL_ARCH_PATH)/boot/$(DTS_NAME).dtb $(BINARIES_DIR) +endef +endif + +ifeq ($(BR2_LINUX_KERNEL_SIMPLEIMAGE),y) +LINUX_IMAGE_NAME = simpleImage.$(DTS_NAME) +endif + ifeq ($(BR2_LINUX_KERNEL_USE_DEFCONFIG),y) KERNEL_SOURCE_CONFIG = $(KERNEL_ARCH_PATH)/configs/$(callqstrip,$(BR2_LINUX_KERNEL_DEFCONFIG))_defconfig
linux/linux.mk KERNEL_SOURCE_CONFIG =
Quoted 2 lines
linux/linux.mk +0
-0else ifeq ($(BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG),y)@@ -125,6 +157,8 @@ KERNEL_SOURCE_CONFIG =$(BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE)
linux/linux.mk KERNEL_SOURCE_CONFIG = $(BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE) · line 161
Quoted 5 lines
linux/linux.mk +2
-0endif define LINUX_CONFIGURE_CMDS + $(if $(BR2_LINUX_KERNEL_USE_CUSTOM_DTS), + $(call LINUX_COPY_DTS))Why is this a $(call)? You're not passing any parameters... Also, the
$(if) is redundant sinceLINUX_COPY_DTSwill just be empty if it's not true.linux/linux.mk KERNEL_SOURCE_CONFIG = · line 162
Quoted 1 line
linux/linux.mk +0
-0cp $(KERNEL_SOURCE_CONFIG)$(KERNEL_ARCH_PATH)/configs/buildroot_defconfig
linux/linux.mk KERNEL_SOURCE_CONFIG = · line 163
Quoted 1 line
linux/linux.mk +0
-0$(TARGET_MAKE_ENV) $(MAKE1) $(LINUX_MAKE_FLAGS) -C $(@D)
buildroot_defconfiglinux/linux.mk define LINUX_BUILD_CMDS · line 193
Quoted 4 lines
linux/linux.mk +0
-0rm $(KERNEL_ARCH_PATH)/configs/buildroot_defconfig@@ -158,17 +192,22 @@ define LINUX_BUILD_CMDS @if grep -q "CONFIG_MODULES=y" $(@D)/.config; then \ $(TARGET_MAKE_ENV) $(MAKE) $(LINUX_MAKE_FLAGS) -C $(@D)modules ; \
linux/linux.mk define LINUX_BUILD_CMDS · line 196
Quoted 3 lines
linux/linux.mk +2
-0fi + $(if $(BR2_LINUX_KERNEL_MAKE_DTB), + $(call LINUX_MAKE_DTB))Same here.
linux/linux.mk define LINUX_BUILD_CMDS
Quoted 6 lines
linux/linux.mk +0
-0endef ifeq ($(BR2_LINUX_KERNEL_INSTALL_TARGET),y) define LINUX_INSTALL_KERNEL_IMAGE_TO_TARGET install -m 0644 -D $(LINUX_IMAGE_PATH)$(TARGET_DIR)/boot/$(LINUX_IMAGE_NAME)
linux/linux.mk define LINUX_BUILD_CMDS · line 203
Quoted 1 line
linux/linux.mk +1
-0+No need to add an empty line here.
linux/linux.mk define LINUX_BUILD_CMDS · line 210
Quoted 7 lines
linux/linux.mk +2
-0endef endif define LINUX_INSTALL_IMAGES_CMDS cp $(LINUX_IMAGE_PATH) $(BINARIES_DIR) + $(if $(BR2_LINUX_KERNEL_INSTALL_DTB), + $(call LINUX_INSTALL_DTB))Again redundant $(if) and $(call).
linux/linux.mk $(LINUX_DIR)/.stamp_initramfs_rebuilt:
Quoted 4 lines
linux/linux.mk +0
-0endef define LINUX_INSTALL_TARGET_CMDS@@ -215,6 +254,8 @@ $(LINUX_DIR)/.stamp_initramfs_rebuilt:$(LINUX_DIR)/.stamp_target_installed $(LI
linux/linux.mk $(LINUX_DIR)/.stamp_initramfs_rebuilt: · line 254
Quoted 1 line
linux/linux.mk +0
-0$(TARGET_MAKE_ENV) $(MAKE) $(LINUX_MAKE_FLAGS) -C $(@D)$(LINUX_IMAGE_NAME)
linux/linux.mk $(LINUX_DIR)/.stamp_initramfs_rebuilt: $(LINUX_DIR)/.stamp_target_installed $(LI
Quoted 4 lines
linux/linux.mk +2
-0# Copy the kernel image to its final destination cp $(LINUX_IMAGE_PATH) $(BINARIES_DIR) + # If there is a .ub file copy it to the final destination + test -f $(LINUX_IMAGE_PATH).ub && cp $(LINUX_IMAGE_PATH).ub$(BINARIES_DIR)
Maybe add a comment here explaining with a .ub file is.
Is this only relevant for initramfs builds?
linux/linux.mk $(LINUX_DIR)/.stamp_initramfs_rebuilt: $(LINUX_DIR)/.stamp_target_installed $(LI · line 261
Quoted 4 lines
linux/linux.mk +0
-0$(Q)touch $@ # The initramfs building code must make sure this target gets calledRegards,
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_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot
Signature · 4 lines
?lvaro G?mez Machado -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20120225/2797df89/attachment-0001.html>
PATCH v2 1/1 Add Device Tree and simpleImage support
Alvaro,
Sorry I've been swamped and will be until Wednesday but everything I have done so far is in github.com/Spenser309/buildroot.
There's a branch dts where I am working on this patch and a branch microblaze where I am working on the microblaze patch.
Spenser
Quoted 257 lines · Alvaro Gamez
Hi, Spenser
Do you need some help solving this issues? If you don't have the time I can try and solve some of them, I just don't want to step on your job if you're already working at that.
BTW, Arnout, I saw you ack'ed my previous patches for wget and xilinx's repositories, but I haven't seen them applied to the tree. Is there anything I can help with?
Regards,
2012/2/20 Arnout Vandecappelle <[email protected]>
Quoted 225 lines · On Sunday 19 February 2012 21:41:00 Spenser Gilliland wrote:
Quoted 9 lines
This patch adds device tree and simpleImage support to buildroot. ?When the simpleImage Kernel binary image type is selected, the user has can select either an in tree device tree source file or an out of tree device tree source file.
This triggers the kernel to build the simpleImage.<dt> target and copy the resulting binary to the output/images directory. ?Additionally, if the install dtb option is selected the <dt>.dtb file is copied to the output directory.
?Please wrap the commit message at 80 columns.
?The simpleImage support should be split off from the DTS support in a separate patch.
Quoted 1 line
Signed-off-by Spenser Gilliland <[email protected]>[snip]
linux/Config.in config BR2_LINUX_KERNEL_IMAGE_TARGET_CUSTOM
Quoted 8 lines
linux/Config.in +8
-0+# +# Device Tree Support +# + +choice + ? ? prompt "Device Tree Blob" + ? ? default BR2_LINUX_KERNEL_USE_DTS + ? ? depends on BR2_LINUX_KERNEL_SIMPLEIMAGE?DTS is available for (almost) all architectures, so I don't think we needs a depends here. ?Certainly not on simpleImage.
Quoted 13 lines
linux/Config.in +12
-0+ +config BR2_LINUX_KERNEL_USE_DTS + ? ? bool "Use an in kernel device tree" + +config BR2_LINUX_KERNEL_USE_CUSTOM_DTS + ? ? bool "Use a custom device tree" + +endchoice + +config BR2_LINUX_KERNEL_MAKE_DTB + ? ? bool + ? ? default y if BR2_LINUX_KERNEL_USE_DTS ||
BR2_LINUX_KERNEL_USE_CUSTOM_DTSReview
Quoted 7 lines
(quoted diff) +7
-0+ +config BR2_LINUX_KERNEL_INSTALL_DTS + ? ? bool "Copy device tree blob to the output directory" + ? ? depends on BR2_LINUX_KERNEL_MAKE_DTB + ? ? help + ? ? ? This copies the device tree blob to the images + ? ? ? directory.?I don't think this is necessary; the dtb is pretty small so you can just copy it to the images directory unconditionally.
?If you do keep this config, call it
INSTALL_DTBand fix the description to 'to the images directory'.Review
Quoted 7 lines
(quoted diff) +7
-0+ +config BR2_LINUX_KERNEL_DTS + ? ? string "Dts Name" + ? ? depends on BR2_LINUX_KERNEL_USE_DTS + ? ? help + ? ? ? Name of device tree source file in tree to use + ? ? ? without the trailing .dts?Maybe point out where it can be found: arch/<arch>/boot/dts/
Quoted 19 lines
linux/Config.in +8
-0+ +config BR2_LINUX_KERNEL_CUSTOM_DTS + ? ? string "Dts file path" + ? ? depends on BR2_LINUX_KERNEL_USE_CUSTOM_DTS + ? ? help + ? ? ? Path to the custom dts file. + +?config
BR2_LINUX_KERNEL_IMAGE_TARGET_NAME
? ? ? string "Kernel image target name"
? ? ? depends onBR2_LINUX_KERNEL_IMAGE_TARGET_CUSTOMlinux/linux.mk +0
-0@@ -67,6 +67,9 @@ else ifeq ($(BR2_LINUX_KERNEL_VMLINUX),y)?LINUX_IMAGE_NAME=vmlinux
?else ifeq ($(BR2_LINUX_KERNEL_VMLINUZ),y)
?LINUX_IMAGE_NAME=vmlinuzlinux/linux.mk else ifeq ($(BR2_LINUX_KERNEL_VMLINUX),y) · line 71
Quoted 2 lines
linux/linux.mk +2
-0+else ifeq ($(BR2_LINUX_KERNEL_SIMPLEIMAGE),y) +# Image name is set once the dts is known?If you move the DTS stuff before these conditions, then you don't need a special case for simpleImage here.
Quoted 10 lines
+LINUX_DEPENDENCIES+=host-uboot-tools
?endif
?endiflinux/linux.mk +0
-0@@ -118,6 +121,35 @@ endef?LINUX_POST_PATCH_HOOKS +=
LINUX_APPLY_PATCHESlinux/linux.mk +2
-0+ifneq ($(BR2_LINUX_KERNEL_CUSTOM_DTS),) +LINUX_KERNEL_CUSTOM_DTS = $(call qstrip,Quoted 3 lines
$(BR2_LINUX_KERNEL_CUSTOM_DTS))
+DTS_NAME = $(shell export file=basename $(LINUX_KERNEL_CUSTOM_DTS)&& echo $${file%.*})?Doesn't this work?
DTS_NAME= $(patsubst %.dts,%,$(notdir $(LINUX_KERNEL_CUSTOM_DTS)))Quoted 3 lines
+define
LINUX_COPY_DTS
+ ? echo "LINUX_KERNEL_CUSTOM_DTS=$(LINUX_KERNEL_CUSTOM_DTS) and DTS_NAME=$(DTS_NAME)" && \?I guess this line was there for debugging and is redundant now?
Quoted 12 lines
+ ? ? mkdir -p $(KERNEL_ARCH_PATH)/boot/dts && \
+ ? ? cp $(BR2_LINUX_KERNEL_CUSTOM_DTS) $(KERNEL_ARCH_PATH)/boot/dts/linux/linux.mk +10
-0+endef +endif + +ifeq ($(BR2_LINUX_KERNEL_USE_DTS),y) +DTS_NAME = $(call qstrip, $(BR2_LINUX_KERNEL_DTS)) +endif + +ifeq ($(BR2_LINUX_KERNEL_MAKE_DTB),y) +define LINUX_MAKE_DTB + ? ? $(TARGET_MAKE_ENV) $(MAKE) $(LINUX_MAKE_FLAGS) -C $(@D)Quoted 1 line
scripts/dtc/&& \?Is that correct? ?Shouldn't that be
scripts/dtc/dtc??Also, there's no reason to use && to connect the steps here: make implicitly terminates command execution if any command fails.
Quoted 2 lines
+ ? ?scripts/dtc/dtc -O dtb -o $(KERNEL_ARCH_PATH)/boot/$(DTS_NAME).dtb \
?There's something wrong with the indentation here.
Quoted 19 lines
+ ? ? ?-b 0 -p 1024 $(KERNEL_ARCH_PATH)/boot/dts/$(DTS_NAME).dts
linux/linux.mk +10
-0+endef +define LINUX_INSTALL_DTB + ? ? cp $(KERNEL_ARCH_PATH)/boot/$(DTS_NAME).dtb $(BINARIES_DIR) +endef +endif + +ifeq ($(BR2_LINUX_KERNEL_SIMPLEIMAGE),y) +LINUX_IMAGE_NAME = simpleImage.$(DTS_NAME) +endif +?ifeq ($(BR2_LINUX_KERNEL_USE_DEFCONFIG),y) ?KERNEL_SOURCE_CONFIG = $(KERNEL_ARCH_PATH)/configs/$(call qstrip,$(BR2_LINUX_KERNEL_DEFCONFIG))_defconfig ?else ifeq ($(BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG),y)
linux/linux.mk +0
-0@@ -125,6 +157,8 @@ KERNEL_SOURCE_CONFIG = $(BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE)?endif
Quoted 3 lines
?define
LINUX_CONFIGURE_CMDS
+ ? ? $(if $(BR2_LINUX_KERNEL_USE_CUSTOM_DTS),
+ ? ? ? ? ? ? $(callLINUX_COPY_DTS))?Why is this a $(call)? ?You're not passing any parameters... ?Also, the $(if) is redundant since
LINUX_COPY_DTSwill just be empty if it's not true.Quoted 9 lines
? ? ? cp $(KERNEL_SOURCE_CONFIG) $(KERNEL_ARCH_PATH)/configs/buildroot_defconfig
? ? ? $(TARGET_MAKE_ENV) $(MAKE1) $(LINUX_MAKE_FLAGS) -C $(@D)buildroot_defconfig
? ? ? rm $(KERNEL_ARCH_PATH)/configs/buildroot_defconfiglinux/linux.mk +0
-0@@ -158,17 +192,22 @@ define LINUX_BUILD_CMDS ? ? ? @if grep -q "CONFIG_MODULES=y" $(@D)/.config; then ? ? ?\ ? ? ? ? ? ? ? $(TARGET_MAKE_ENV) $(MAKE) $(LINUX_MAKE_FLAGS) -C $(@D) modules ; ? ? ? \Quoted 3 lines
? ? ? fi
+ ? ? $(if $(BR2_LINUX_KERNEL_MAKE_DTB),
+ ? ? ? ? ? ? $(callLINUX_MAKE_DTB))?Same here.
Quoted 8 lines
?endef
?ifeq ($(BR2_LINUX_KERNEL_INSTALL_TARGET),y)
?defineLINUX_INSTALL_KERNEL_IMAGE_TO_TARGET
? ? ? install -m 0644 -D $(LINUX_IMAGE_PATH)
$(TARGET_DIR)/boot/$(LINUX_IMAGE_NAME)
+?No need to add an empty line here.
Quoted 7 lines
?endef
?endif?define
LINUX_INSTALL_IMAGES_CMDS
? ? ? cp $(LINUX_IMAGE_PATH) $(BINARIES_DIR)
+ ? ? $(if $(BR2_LINUX_KERNEL_INSTALL_DTB),
+ ? ? ? ? ? ? $(callLINUX_INSTALL_DTB))?Again redundant $(if) and $(call).
Quoted 4 lines
?endef
?define
LINUX_INSTALL_TARGET_CMDSlinux/linux.mk +0
-0@@ -215,6 +254,8 @@ $(LINUX_DIR)/.stamp_initramfs_rebuilt:Quoted 8 lines
$(LINUX_DIR)/.stamp_target_installed $(LI
? ? ? $(TARGET_MAKE_ENV) $(MAKE) $(LINUX_MAKE_FLAGS) -C $(@D) $(LINUX_IMAGE_NAME)
? ? ? # Copy the kernel image to its final destination ? ? ? cp $(LINUX_IMAGE_PATH) $(BINARIES_DIR)
+ ? ? # If there is a .ub file copy it to the final destination
+ ? ? test -f $(LINUX_IMAGE_PATH).ub && cp $(LINUX_IMAGE_PATH).ub $(BINARIES_DIR)?Maybe add a comment here explaining with a .ub file is.
?Is this only relevant for initramfs builds?
Quoted 4 lines
? ? ? $(Q)touch $@
?# The initramfs building code must make sure this target gets called
?Regards,
?ArnoutQuoted 12 lines
--
Arnout Vandecappelle ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? arnout at mind be Senior Embedded Software Architect ? ? ? ? ? ? ? ? +32-16-286540 Essensium/Mind ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium ? ? ? ? ? ? ? ?BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint: ?7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F
_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot--
?lvaro G?mez Machado
Signature · 3 lines
Spenser Gilliland Computer Engineer Illinois Institute of Technology
PATCH v2 1/1 Add Device Tree and simpleImage support
In reply to Alvaro GamezQuoted 3 lines · On Saturday 25 February 2012 10:34:26 Alvaro Gamez wrote:
BTW, Arnout, I saw you ack'ed my previous patches for wget and xilinx's repositories, but I haven't seen them applied to the tree. Is there anything I can help with?
Peter will get around to committing them eventually - he doesn't often
forget about patches once they're OK.
I do expect he'll first finish the 2012.02 release, so don't expect
anything for another week or so.
Regards,
Arnout
Signature · 6 lines
Arnout Vandecappelle arnout at mind be Senior Embedded Software Architect +32-16-286540 Essensium/Mind http://www.mind.be G.Geenslaan 9, 3001 Leuven, Belgium BE 872 984 063 RPR Leuven LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle GPG fingerprint: 7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F
PATCH v2 1/1 Add Device Tree and simpleImage support
Alright, thank you. I just didn't know the procedure :)
Regards
2012/2/25 Arnout Vandecappelle <[email protected]>
Quoted 23 lines · On Saturday 25 February 2012 10:34:26 Alvaro Gamez wrote:
Quoted 3 lines
BTW, Arnout, I saw you ack'ed my previous patches for wget and xilinx's repositories, but I haven't seen them applied to the tree. Is there anything I can help with?
Peter will get around to committing them eventually - he doesn't often
forget about patches once they're OK.I do expect he'll first finish the 2012.02 release, so don't expect
anything for another week or so.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
Signature · 4 lines
?lvaro G?mez Machado -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20120225/a9a65a9b/attachment-0001.html>
PATCH v2 1/1 Add Device Tree and simpleImage support
Quoted 2 lines · Alvaro Gamez
Alright, thank you. I just didn't know the procedure :)
If I can post a "Buildroot Brag" here -
The procedures of this project are a bit different than others.
Other projects, only the "release points" are expected to work. With this project, the repository "head" is expected to also work.
That goal does make the work flow a bit different at Peter's end.
Mike
Quoted 30 lines
Regards
2012/2/25 Arnout Vandecappelle <[email protected]>
Quoted 23 lines · On Saturday 25 February 2012 10:34:26 Alvaro Gamez wrote:
Quoted 3 lines
BTW, Arnout, I saw you ack'ed my previous patches for wget and xilinx's repositories, but I haven't seen them applied to the tree. Is there anything I can help with?
Peter will get around to committing them eventually - he doesn't often
forget about patches once they're OK.I do expect he'll first finish the 2012.02 release, so don't expect
anything for another week or so.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