From: Erik M. <er...@bi...> - 2006-05-02 10:43:42
|
On Mon, May 01, 2006 at 06:22:16PM -0400, Dan wrote: > Stefan Schmidt wrote: > >On Fri, 2006-04-28 at 16:09, Erik Mouw wrote: > >>You should be able to reblob the second stage loader (i.e.: blob-rest). > >>It should be loaded at BLOB_RAM_BASE. > > > >JFYI: This did not work here. Perhaps this feature is disabled inside > >the Motorola blob. I'm busy at the moment, but hopefully have some > >time the next weekend for debugging this. > > I observed that while BLOB loads and jumps to BLOB_RAM_BASE, the second > stage loader (blob-rest) is actually built to run at > BLOB_ABS_BASE_ADDR. The reblob command should be [safely] copying the > second stage BLOB from BLOB_RAM_BASE to BLOB_ABS_BASE_ADDR and then > jumping there, but I guess it doesn't (not that I've checked in a while). You nailed the problem, thanks. Here's the git patch to fix it (also pushed to the repository). The target to use for reblob is/was blob-chain. Erik diff-tree bd6e87da76478d39e134387edef68f2a0c766e5b (from 16ee5944280da198b1c569ddc8500797a8332d13) Author: Erik Mouw <mo...@nl...> Date: Tue May 2 12:33:12 2006 +0200 Recreate blob-chain target used for the "reblob" command. When overhauling the Makefile to include the second stage loader, I forgot to overhaul the chain loader as well. This patch recreats the blob-chain target. Also some minor cleanups in chain.S, we don't need to fiddle with the LEDs anymore. diff --git a/src/blob/Makefile.am b/src/blob/Makefile.am index 32151c5..18d3743 100644 --- a/src/blob/Makefile.am +++ b/src/blob/Makefile.am @@ -24,7 +24,9 @@ # bin_PROGRAMS = \ blob-rest-elf32 \ blob-rest \ + blob-chain-elf32 \ blob-elf32 \ + blob-chain \ blob @@ -188,6 +190,26 @@ blob: blob-elf32 $(OBJCOPY) $(OCFLAGS) $< $@ +# ---- Blob-chain first stage loader for use with reblob ------------- + +blob_chain_elf32_SOURCES = \ + chain.S + +blob_chain_elf32_DEPENDENCIES = \ + start-ld-script \ + blob-rest-piggy.o + +blob_chain_elf32_LDFLAGS = \ + -static -nostdlib \ + -Wl,-T,${srcdir}/start-ld-script \ + -Wl,-Map,blob-chain-elf32.map + +blob_chain_SOURCES = + +blob-chain: blob-chain-elf32 + $(OBJCOPY) $(OCFLAGS) $< $@ + + # ---- Automake administrativia -------------------------------------- EXTRA_DIST = \ diff --git a/src/blob/chain.S b/src/blob/chain.S index 8b4d94c..a5550aa 100644 --- a/src/blob/chain.S +++ b/src/blob/chain.S @@ -45,20 +45,15 @@ _start: sub r0, pc, #8 str r0, START -#ifdef H3600 + b relocate + /* this is a hack to be able to chain load blob from * bootldr. bootldr checks if it can find the linux zImage * magic value at the ninth word of an image, so we just put * it there. */ - b led .org (_start + 9 * 4) .word 0x016f2818 -led: -#endif - - /* init LED */ - //bl ledinit /* assume that the CPU and the memory are already set up at * this point. also assume that interrupts are disabled, and if @@ -92,12 +87,6 @@ copy_loop: ble copy_loop - /* turn off the LED. if it stays off it is an indication that - * we didn't make it into the C code - */ - //bl led_off - - /* blob is copied to ram, so jump to it */ ldr r0, BLOB_START mov pc, r0 -- ---- Erik Mouw ---- www.bitwizard.nl ---- +31 15 2600 998 ---- |