Skip to contentSkip to conversation

uboot: Add ELF target

PATCH New Spenser Gilliland 3 participants 5 messages May 15, 2013 – Jun 15, 2013 VFS

lore
Share & tools
lore
#0 lore raw

PATCH 1/3 uboot: Add ELF target

From: Spenser Gilliland <[email protected]>

adds ELF image option to uboot

---
 boot/uboot/Config.in |    3 +++
 boot/uboot/uboot.mk  |    4 +++-
 2 files changed, 6 insertions(+), 1 deletion(-)
boot/uboot/Config.in +3 -0
index a1874a1..aadf757 100644
@@ -98,6 +98,9 @@ config BR2_TARGET_UBOOT_FORMAT_LDR
 	depends on BR2_bfin
 	bool "u-boot.ldr"
 
+config BR2_TARGET_UBOOT_FORMAT_ELF
+	bool "u-boot.elf"
+
 endchoice
 
 config BR2_TARGET_UBOOT_OMAP_IFT
boot/uboot/uboot.mk +3 -1
index 004bdf2..593bb29 100644
@@ -25,7 +25,9 @@ UBOOT_SITE    = ftp://ftp.denx.de/pub/u-boot
 UBOOT_SOURCE  = u-boot-$(UBOOT_VERSION).tar.bz2
 endif
 
-ifeq ($(BR2_TARGET_UBOOT_FORMAT_KWB),y)
+ifeq ($(BR2_TARGET_UBOOT_FORMAT_ELF),y)
+UBOOT_BIN          = u-boot
+else ifeq ($(BR2_TARGET_UBOOT_FORMAT_KWB),y)
 UBOOT_BIN          = u-boot.kwb
 UBOOT_MAKE_TARGET  = $(UBOOT_BIN)
 else ifeq ($(BR2_TARGET_UBOOT_FORMAT_AIS),y)
Signature · 1 line
1.7.9.5
#1 lore raw

PATCH 2/3 fs: add uimage support w/ example for cpio

From: Spenser Gilliland <[email protected]>

Adds uimage support for various root filesystems. Uimage support is needed when using the bootm command in uboot. This provides both a simple infrastructure similar to the current BR2_TARGET_ROOTFS_$(2)_GZ for adding compression. To define the a rootfs should have a UIMAGE wrapper simply create the BR2_TARGET_ROOTFS_$(2)_UIMAGE symbol.

---
 fs/common.mk      |   22 +++++++++++++++++++++-
 fs/cpio/Config.in |    7 +++++++
 2 files changed, 28 insertions(+), 1 deletion(-)
fs/common.mk +21 -1
index 36da2dd..f456025 100644
@@ -31,6 +31,8 @@
 # BR2_TARGET_ROOTFS_$(FSTYPE)_LZMA exist and are enabled, then the
 # macro will automatically generate a compressed filesystem image.
 
+MKIMAGE_RAMDISK = $(HOST_DIR)/usr/bin/mkimage -A $(BR2_ARCH) -T ramdisk -C $(1) -d $(2) $(2).uboot
+
 FAKEROOT_SCRIPT = $(BUILD_DIR)/_fakeroot.fs
 FULL_DEVICE_TABLE = $(BUILD_DIR)/_device_table.txt
 ROOTFS_DEVICE_TABLES = $(call qstrip,$(BR2_ROOTFS_DEVICE_TABLE) \
@@ -40,7 +42,11 @@ USERS_TABLE = $(BUILD_DIR)/_users_table.txt
 define ROOTFS_TARGET_INTERNAL
 
 # extra deps
-ROOTFS_$(2)_DEPENDENCIES += host-fakeroot host-makedevs $$(if $$(BR2_TARGET_ROOTFS_$(2)_LZMA),host-lzma) $$(if $$(BR2_TARGET_ROOTFS_$(2)_LZO),host-lzop) $$(if $$(BR2_TARGET_ROOTFS_$(2)_XZ),host-xz)
+ROOTFS_$(2)_DEPENDENCIES += host-fakeroot host-makedevs \
+	$$(if $$(BR2_TARGET_ROOTFS_$(2)_LZMA),host-lzma) \
+	$$(if $$(BR2_TARGET_ROOTFS_$(2)_LZO),host-lzop) \
+	$$(if $$(BR2_TARGET_ROOTFS_$(2)_XZ),host-xz) \
+	$$(if $$(BR2_TARGET_ROOTFS_$(2)_UIMAGE),host-uboot-tools)
 
 $$(BINARIES_DIR)/rootfs.$(1): $$(ROOTFS_$(2)_DEPENDENCIES)
 	@$$(call MESSAGE,"Generating root filesystem image rootfs.$(1)")
@@ -79,6 +85,20 @@ endif
 ifeq ($$(BR2_TARGET_ROOTFS_$(2)_XZ),y)
 	$(XZ) -9 -C crc32 -c $$@ > [email protected]
 endif
+ifeq ($$(BR2_TARGET_ROOTFS_$(2)_UIMAGE),y)
+ifeq ($$(BR2_TARGET_ROOTFS_$(2)_NONE),y)
+	$$(call MKIMAGE_RAMDISK,none,$$@)
+endif
+ifeq ($$(BR2_TARGET_ROOTFS_$(2)_GZIP),y)
+	$$(call MKIMAGE_RAMDISK,gzip,[email protected])
+endif
+ifeq ($$(BR2_TARGET_ROOTFS_$(2)_BZIP2),y)
+	$$(call MKIMAGE_RAMDISK,bzip2,[email protected])
+endif
+ifeq ($$(BR2_TARGET_ROOTFS_$(2)_LZMA),y)
+	$$(call MKIMAGE_RAMDISK,lzma,[email protected])
+endif
+endif
 
 rootfs-$(1)-show-depends:
 	@echo $$(ROOTFS_$(2)_DEPENDENCIES)
fs/cpio/Config.in +7 -0
index 87dde64..3e82dc5 100644
@@ -5,6 +5,13 @@ config BR2_TARGET_ROOTFS_CPIO
 	  used for an initial RAM filesystem that is passed to the kernel
 	  by the bootloader.
 
+config BR2_TARGET_ROOTFS_CPIO_UIMAGE
+	bool "Add U-Boot header to the root filesystem"
+	depends on BR2_TARGET_ROOTFS_CPIO
+	help
+	  Add a u-boot header to the cpio root filesystem.  This allows
+	  the image to be booted by the bootm command in uboot.
+
 choice
         prompt "Compression method"
         default BR2_TARGET_ROOTFS_CPIO_NONE
Signature · 1 line
1.7.9.5
#2 lore raw

PATCH 3/3 zedboard: add Avnet Zedboard support.

In reply to Spenser Gilliland

add defconfig and board dir for Avnet Zedboard

---
 board/avnet/zedboard/readme.txt |   13 +++++++++++++
 configs/zedboard_defconfig      |   21 +++++++++++++++++++++
 2 files changed, 34 insertions(+)
 create mode 100644 board/avnet/zedboard/readme.txt
 create mode 100644 configs/zedboard_defconfig
board/avnet/zedboard/readme.txt new file +13 -0
new file mode 100644
index 0000000..eaa2cb8
@@ -0,0 +1,13 @@
+This is the buildroot board support for the Avnet Zedboard. The Zedboard is
+a development board based on the Xilinx Zynq-7000 based All-Programmable 
+System-On-Chip.
+
+Zedboard information including schematics, reference designs, and manuals are
+available from http://www.zedboard.org .
+
+To boot the Zedboard using a buildroot generated image copy the following files
+to the sdcard:
+	zynq-zed.dtb -> devicetree.dtb
+	rootfs.cpio.gz.uboot -> uramdisk.image.gz
+	uImage -> uImage
+
configs/zedboard_defconfig new file +21 -0
new file mode 100644
index 0000000..0dfc581
@@ -0,0 +1,21 @@
+BR2_arm=y
+BR2_cortex_a9=y
+BR2_ARM_ENABLE_NEON=y
+BR2_TARGET_GENERIC_GETTY_PORT="ttyPS0"
+BR2_TARGET_ROOTFS_CPIO=y
+BR2_TARGET_ROOTFS_CPIO_UIMAGE=y
+BR2_TARGET_ROOTFS_CPIO_GZIP=y
+BR2_TARGET_UBOOT=y
+BR2_TARGET_UBOOT_BOARDNAME="zynq_zed"
+BR2_TARGET_UBOOT_CUSTOM_GIT=y
+BR2_TARGET_UBOOT_CUSTOM_GIT_REPO_URL="git://github.com/Xilinx/u-boot-xlnx.git"
+BR2_TARGET_UBOOT_CUSTOM_GIT_VERSION="xilinx-v14.5"
+BR2_TARGET_UBOOT_FORMAT_ELF=y
+BR2_LINUX_KERNEL=y
+BR2_LINUX_KERNEL_CUSTOM_GIT=y
+BR2_LINUX_KERNEL_CUSTOM_GIT_REPO_URL="git://github.com/Xilinx/linux-xlnx.git"
+BR2_LINUX_KERNEL_CUSTOM_GIT_VERSION="xilinx-v14.5"
+BR2_LINUX_KERNEL_DEFCONFIG="xilinx_zynq"
+BR2_LINUX_KERNEL_UIMAGE_LOADADDR="0x8000"
+BR2_LINUX_KERNEL_DTS_SUPPORT=y
+BR2_LINUX_KERNEL_INTREE_DTS_NAME="zynq-zed"
Signature · 1 line
1.7.9.5
#3 lore raw

PATCH 3/3 zedboard: add Avnet Zedboard support.

Hi,

Rather new in buildroot but already fond of it.
As a Zedboard user I would really appreciate to have this patch merged in BR mainline.

Good job!

-----Original Message-----
From: [email protected] [mailto:buildroot-bounces at busybox.net] On Behalf Of Spenser Gilliland
Sent: jeudi 16 mai 2013 01:12
To: buildroot at busybox.net
Subject: [Buildroot] [PATCH 3/3] zedboard: add Avnet Zedboard support.

add defconfig and board dir for Avnet Zedboard

---
 board/avnet/zedboard/readme.txt |   13 +++++++++++++
 configs/zedboard_defconfig      |   21 +++++++++++++++++++++
 2 files changed, 34 insertions(+)
 create mode 100644 board/avnet/zedboard/readme.txt
 create mode 100644 configs/zedboard_defconfig
board/avnet/zedboard/readme.txt new file +13 -0
new file mode 100644
index 0000000..eaa2cb8
@@ -0,0 +1,13 @@
+This is the buildroot board support for the Avnet Zedboard. The Zedboard is
+a development board based on the Xilinx Zynq-7000 based All-Programmable 
+System-On-Chip.
+
+Zedboard information including schematics, reference designs, and manuals are
+available from http://www.zedboard.org .
+
+To boot the Zedboard using a buildroot generated image copy the following files
+to the sdcard:
+	zynq-zed.dtb -> devicetree.dtb
+	rootfs.cpio.gz.uboot -> uramdisk.image.gz
+	uImage -> uImage
+
configs/zedboard_defconfig new file +21 -0
new file mode 100644
index 0000000..0dfc581
@@ -0,0 +1,21 @@
+BR2_arm=y
+BR2_cortex_a9=y
+BR2_ARM_ENABLE_NEON=y
+BR2_TARGET_GENERIC_GETTY_PORT="ttyPS0"
+BR2_TARGET_ROOTFS_CPIO=y
+BR2_TARGET_ROOTFS_CPIO_UIMAGE=y
+BR2_TARGET_ROOTFS_CPIO_GZIP=y
+BR2_TARGET_UBOOT=y
+BR2_TARGET_UBOOT_BOARDNAME="zynq_zed"
+BR2_TARGET_UBOOT_CUSTOM_GIT=y
+BR2_TARGET_UBOOT_CUSTOM_GIT_REPO_URL="git://github.com/Xilinx/u-boot-xlnx.git"
+BR2_TARGET_UBOOT_CUSTOM_GIT_VERSION="xilinx-v14.5"
+BR2_TARGET_UBOOT_FORMAT_ELF=y
+BR2_LINUX_KERNEL=y
+BR2_LINUX_KERNEL_CUSTOM_GIT=y
+BR2_LINUX_KERNEL_CUSTOM_GIT_REPO_URL="git://github.com/Xilinx/linux-xlnx.git"
+BR2_LINUX_KERNEL_CUSTOM_GIT_VERSION="xilinx-v14.5"
+BR2_LINUX_KERNEL_DEFCONFIG="xilinx_zynq"
+BR2_LINUX_KERNEL_UIMAGE_LOADADDR="0x8000"
+BR2_LINUX_KERNEL_DTS_SUPPORT=y
+BR2_LINUX_KERNEL_INTREE_DTS_NAME="zynq-zed"
Signature · 6 lines
1.7.9.5

_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot