Title: [8199] trunk/arch/blackfin: blackfin xip: push the 64 byte header into the build system and let the xip version use arbitrary entry points too now that the mkimage util doesnt require a specific -e with the -x option
Revision
8199
Author
vapier
Date
2010-01-19 19:01:26 -0500 (Tue, 19 Jan 2010)

Log Message

blackfin xip: push the 64 byte header into the build system and let the xip version use arbitrary entry points too now that the mkimage util doesnt require a specific -e with the -x option

Modified Paths

Diff

Modified: trunk/arch/blackfin/Kconfig (8198 => 8199)


--- trunk/arch/blackfin/Kconfig	2010-01-19 23:33:08 UTC (rev 8198)
+++ trunk/arch/blackfin/Kconfig	2010-01-20 00:01:26 UTC (rev 8199)
@@ -403,11 +403,19 @@
 config ROM_BASE
 	hex "Kernel ROM Base"
 	depends on ROMKERNEL
-	default "0x20040000"
+	default "0x20080040"
 	range 0x20000000 0x20400000 if !(BF54x || BF561)
 	range 0x20000000 0x30000000 if (BF54x || BF561)
 	help
+	  Make sure your ROM base does not include any file-header
+	  information that is prepended to the kernel.
 
+	  For example, the bootable U-Boot format (created with
+	  mkimage) has a 64 byte header (0x40).  So while the image
+	  you write to flash might start at say 0x20080000, you have
+	  to add 0x40 to get the kernel's ROM base as it will come
+	  after the header.
+
 comment "Clock/PLL Setup"
 
 config CLKIN_HZ

Modified: trunk/arch/blackfin/Makefile (8198 => 8199)


--- trunk/arch/blackfin/Makefile	2010-01-19 23:33:08 UTC (rev 8198)
+++ trunk/arch/blackfin/Makefile	2010-01-20 00:01:26 UTC (rev 8199)
@@ -141,7 +141,7 @@
 
 INSTALL_PATH ?= /tftpboot
 boot := arch/$(ARCH)/boot
-BOOT_TARGETS = vmImage vmImage.bin vmImage.bz2 vmImage.gz vmImage.lzma
+BOOT_TARGETS = vmImage vmImage.bin vmImage.bz2 vmImage.gz vmImage.lzma vmImage.xip
 PHONY += $(BOOT_TARGETS) install
 KBUILD_IMAGE := $(boot)/vmImage
 
@@ -159,6 +159,7 @@
   echo  '  vmImage.bz2     - Kernel-only image for U-Boot (arch/$(ARCH)/boot/vmImage.bz2)'
   echo  '* vmImage.gz      - Kernel-only image for U-Boot (arch/$(ARCH)/boot/vmImage.gz)'
   echo  '  vmImage.lzma    - Kernel-only image for U-Boot (arch/$(ARCH)/boot/vmImage.lzma)'
+  echo  '  vmImage.xip     - XIP Kernel-only image for U-Boot (arch/$(ARCH)/boot/vmImage.xip)'
   echo  '  install         - Install kernel using'
   echo  '                     (your) ~/bin/$(INSTALLKERNEL) or'
   echo  '                     (distribution) PATH: $(INSTALLKERNEL) or'

Modified: trunk/arch/blackfin/boot/Makefile (8198 => 8199)


--- trunk/arch/blackfin/boot/Makefile	2010-01-19 23:33:08 UTC (rev 8198)
+++ trunk/arch/blackfin/boot/Makefile	2010-01-20 00:01:26 UTC (rev 8199)
@@ -8,21 +8,17 @@
 
 MKIMAGE := $(srctree)/scripts/mkuboot.sh
 
-targets := vmImage vmImage.bin vmImage.bz2 vmImage.gz vmImage.lzma
-extra-y += vmlinux.bin vmlinux.bin.gz vmlinux.bin.bz2 vmlinux.bin.lzma
+targets := vmImage vmImage.bin vmImage.bz2 vmImage.gz vmImage.lzma vmImage.xip
+extra-y += vmlinux.bin vmlinux.bin.gz vmlinux.bin.bz2 vmlinux.bin.lzma vmlinux.bin.xip
 
 UIMAGE_OPTS-y :=
-UIMAGE_OPTS-$(CONFIG_RAMKERNEL) += \
-	-a $(CONFIG_BOOT_LOAD) \
-	-e $(shell $(NM) vmlinux | awk '$$NF == "__start" {print $$1}')
-UIMAGE_OPTS-$(CONFIG_ROMKERNEL) += \
-	-x \
-	-a $(CONFIG_ROM_BASE) \
-	-e $$( printf '%x' $$(( $(CONFIG_ROM_BASE) + 64 )) )
+UIMAGE_OPTS-$(CONFIG_RAMKERNEL) += -a $(CONFIG_BOOT_LOAD)
+UIMAGE_OPTS-$(CONFIG_ROMKERNEL) += -a $(CONFIG_ROM_BASE) -x
 
 quiet_cmd_uimage = UIMAGE  $@
       cmd_uimage = $(CONFIG_SHELL) $(MKIMAGE) -A $(ARCH) -O linux -T kernel \
-                   -C $(2) -n '$(MACHINE)-$(KERNELRELEASE)' -a $(CONFIG_BOOT_LOAD) \
+                   -C $(2) -n '$(MACHINE)-$(KERNELRELEASE)' \
+                   -e $(shell $(NM) vmlinux | awk '$$NF == "__start" {print $$1}') \
                    $(UIMAGE_OPTS-y) -d $< $@
 
 $(obj)/vmlinux.bin: vmlinux FORCE
@@ -37,6 +33,12 @@
 $(obj)/vmlinux.bin.lzma: $(obj)/vmlinux.bin FORCE
 	$(call if_changed,lzma)
 
+# The mkimage tool wants 64bytes prepended to the image
+quiet_cmd_mk_bin_xip = BIN     $@
+      cmd_mk_bin_xip = ( printf '%64s' | tr ' ' '\377' ; cat $< ) > $@
+$(obj)/vmlinux.bin.xip: $(obj)/vmlinux.bin FORCE
+	$(call if_changed,mk_bin_xip)
+
 $(obj)/vmImage.bin: $(obj)/vmlinux.bin
 	$(call if_changed,uimage,none)
 
@@ -49,10 +51,15 @@
 $(obj)/vmImage.lzma: $(obj)/vmlinux.bin.lzma
 	$(call if_changed,uimage,lzma)
 
+$(obj)/vmImage.xip: $(obj)/vmlinux.bin.xip
+	$(call if_changed,uimage,none)
+
 suffix-y                      := bin
 suffix-$(CONFIG_KERNEL_GZIP)  := gz
 suffix-$(CONFIG_KERNEL_BZIP2) := bz2
 suffix-$(CONFIG_KERNEL_LZMA)  := lzma
+suffix-$(CONFIG_ROMKERNEL)    := xip
+
 $(obj)/vmImage: $(obj)/vmImage.$(suffix-y)
 	@ln -sf $(notdir $<) $@
 

Modified: trunk/arch/blackfin/kernel/vmlinux.lds.S (8198 => 8199)


--- trunk/arch/blackfin/kernel/vmlinux.lds.S	2010-01-19 23:33:08 UTC (rev 8198)
+++ trunk/arch/blackfin/kernel/vmlinux.lds.S	2010-01-20 00:01:26 UTC (rev 8199)
@@ -31,7 +31,6 @@
 		__text = .;
 		_text = .;
 		__stext = .;
-		*(.romhead.text)
 		TEXT_TEXT
 #ifndef CONFIG_SCHEDULE_L1
 		SCHED_TEXT

Modified: trunk/arch/blackfin/mach-common/head.S (8198 => 8199)


--- trunk/arch/blackfin/mach-common/head.S	2010-01-19 23:33:08 UTC (rev 8198)
+++ trunk/arch/blackfin/mach-common/head.S	2010-01-20 00:01:26 UTC (rev 8199)
@@ -13,19 +13,22 @@
 #include <asm/trace.h>
 #include <asm/asm-offsets.h>
 
-#ifdef CONFIG_ROMKERNEL
-.section ".romhead.text","ax"
-#else
 __INIT
-#endif
 
+ENTRY(__init_clear_bss)
+	r2 = r2 - r1;
+	cc = r2 == 0;
+	if cc jump .L_bss_done;
+	r2 >>= 2;
+	p1 = r1;
+	p2 = r2;
+	lsetup (1f, 1f) lc0 = p2;
+1:	[p1++] = r0;
+.L_bss_done:
+	rts;
+ENDPROC(__init_clear_bss)
+
 ENTRY(__start)
-#ifdef CONFIG_ROMKERNEL
-	/* mkimage requires entry address = load address + 64 */
-	.rept 16;
-	.long 0xFFFFFFFF
-	.endr
-#endif
 	/* R0: argument of command line string, passed from uboot, save it */
 	R7 = R0;
 	/* Enable Cycle Counter and Nesting Of Interrupts */
@@ -241,21 +244,6 @@
 	jump .LWAIT_HERE;
 ENDPROC(__start)
 
-__INIT
-
-ENTRY(__init_clear_bss)
-	r2 = r2 - r1;
-	cc = r2 == 0;
-	if cc jump .L_bss_done;
-	r2 >>= 2;
-	p1 = r1;
-	p2 = r2;
-	lsetup (1f, 1f) lc0 = p2;
-1:	[p1++] = r0;
-.L_bss_done:
-	rts;
-ENDPROC(__init_clear_bss)
-
 /* A little BF561 glue ... */
 #ifndef WDOG_CTL
 # define WDOG_CTL WDOGA_CTL
_______________________________________________
Linux-kernel-commits mailing list
[email protected]
https://blackfin.uclinux.org/mailman/listinfo/linux-kernel-commits

Reply via email to