All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Automate uboot entry/load addresses detection.
@ 2009-01-30 12:37 Ihar Hrachyshka
  2009-01-30 12:57 ` Graeme Gregory
  2009-02-03 11:02 ` Ihar Hrachyshka
  0 siblings, 2 replies; 12+ messages in thread
From: Ihar Hrachyshka @ 2009-01-30 12:37 UTC (permalink / raw)
  To: openembedded-devel

Automated UBOOT_LOADADDRESS and UBOOT_ENTRYPOINT variables detection (no
need to specify them for every machine and/or kernel now).

Signed-off-by: Ihar Hrachyshka <ihar.hrachyshka@gmail.com>
---
 classes/kernel.bbclass |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/classes/kernel.bbclass b/classes/kernel.bbclass
index d1f59e5..f7a7014 100644
--- a/classes/kernel.bbclass
+++ b/classes/kernel.bbclass
@@ -69,10 +69,6 @@ KERNEL_LOCALVERSION ?= ""
 # kernels are generally machine specific
 PACKAGE_ARCH = "${MACHINE_ARCH}"
 
-# U-Boot support
-UBOOT_ENTRYPOINT ?= "20008000"
-UBOOT_LOADADDRESS ?= "${UBOOT_ENTRYPOINT}"
-
 kernel_do_compile() {
 	if [ ! -z "${INITRAMFS_IMAGE}" ]; then
 		cp "${DEPLOY_DIR_IMAGE}/${INITRAMFS_IMAGE}-${MACHINE}.cpio.gz" initramfs.cpio.gz
@@ -489,12 +485,16 @@ do_deploy() {
 	if test "x${KERNEL_IMAGETYPE}" = "xuImage" ; then 
 		if test -e arch/${ARCH}/boot/compressed/vmlinux ; then
 			${OBJCOPY} -O binary -R .note -R .comment -S arch/${ARCH}/boot/compressed/vmlinux linux.bin
+			UBOOT_LOADADDRESS=`${OBJDUMP} -p arch/${ARCH}/boot/compressed/vmlinux | sed -n 's/LOAD.*vaddr \([^ ]*\).*/\1/p'`; \
+			UBOOT_ENTRYPOINT=`${OBJDUMP} -f arch/${ARCH}/boot/compressed/vmlinux | sed -n 's/.*start address \([^ ]*\).*/\1/p'`; \
 			uboot-mkimage -A ${UBOOT_ARCH} -O linux -T kernel -C none -a ${UBOOT_LOADADDRESS} -e ${UBOOT_ENTRYPOINT} -n "${DISTRO_NAME}/${PV}/${MACHINE}" -d linux.bin ${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGE_BASE_NAME}.bin
 			rm -f linux.bin
 		else
 			${OBJCOPY} -O binary -R .note -R .comment -S vmlinux linux.bin
 			rm -f linux.bin.gz
 			gzip -9 linux.bin
+			UBOOT_LOADADDRESS=`${OBJDUMP} -p vmlinux | sed -n 's/LOAD.*vaddr \([^ ]*\).*/\1/p'`; \
+			UBOOT_ENTRYPOINT=`${OBJDUMP} -f vmlinux | sed -n 's/.*start address \([^ ]*\).*/\1/p'`; \
 			uboot-mkimage -A ${UBOOT_ARCH} -O linux -T kernel -C gzip -a ${UBOOT_LOADADDRESS} -e ${UBOOT_ENTRYPOINT} -n "${DISTRO_NAME}/${PV}/${MACHINE}" -d linux.bin.gz ${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGE_BASE_NAME}.bin
 			rm -f linux.bin.gz
 		fi
-- 
1.5.6.3





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

end of thread, other threads:[~2009-07-03 22:37 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-01-30 12:37 [PATCH] Automate uboot entry/load addresses detection Ihar Hrachyshka
2009-01-30 12:57 ` Graeme Gregory
2009-02-03 11:02 ` Ihar Hrachyshka
2009-02-03 11:31   ` Koen Kooi
2009-03-03 15:55     ` Ihar Hrachyshka
2009-03-29 22:28       ` Andrea Adami
2009-03-29 22:35         ` [PATCH] kernel.bbclass: " Andrea Adami
2009-03-29 22:58         ` [PATCH] " Ihar Hrachyshka
2009-03-29 23:11           ` Andrea Adami
2009-03-29 23:32             ` Andrea Adami
2009-07-03 14:30               ` Ihar Hrachyshka
2009-07-03 22:25                 ` Andrea Adami

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.