From d06a3c2c3a1471e9d1301fef48a3bba14fcd4a68 Mon Sep 17 00:00:00 2001 From: Andy Green Date: Fri, 28 Nov 2008 10:16:37 +0000 Subject: [PATCH] add-openocd-script.patch This is the script for gta03 load by openocd. We use the single qi image for all purposes now so U-Boot lowlevel_foo style crap is dead. We have to run the first part of init before copying qi image to TEXT_BASE (0x33000000) because DRAM is not functional until then. Fixed branchthrough at 0x8 is used as a place to hang the breakpoint. Signed-off-by: Andy Green --- qiboot/gta03-qi.ocd | 33 +++++++++++++++++++++++++++++++++ qiboot/src/start.S | 16 ++++++++++++---- 2 files changed, 45 insertions(+), 4 deletions(-) create mode 100755 qiboot/gta03-qi.ocd diff --git a/qiboot/gta03-qi.ocd b/qiboot/gta03-qi.ocd new file mode 100755 index 0000000..16cf0bd --- /dev/null +++ b/qiboot/gta03-qi.ocd @@ -0,0 +1,33 @@ +# gta03 Qi script +# Andy Green + +reset halt +wait_halt + +# bring the steppingstone part of qi image into steppingstone +# +load_binary /projects/openmoko/bootloader/image/qi 0x0 +# +# mark ourselves as JTAG load +# +mww 0x4 0xffffffff + +# +# we have to run that so SDRAM exists in a usable way +# fixed jumpthrough at 0x8 is executed after steppingstone +# init (including RAM) has completed +# +bp 0x8 4 hw +resume 0x0 +wait_halt +rbp 0x8 + +# +# now prep the SDRAM +# +load_binary /projects/openmoko/bootloader/image/qi 0x33000000 +# +# and continue... +resume 0x8 +# + diff --git a/qiboot/src/start.S b/qiboot/src/start.S index 43cfffd..1514e0f 100644 --- a/qiboot/src/start.S +++ b/qiboot/src/start.S @@ -28,6 +28,17 @@ _start: b start_code _is_jtag: .word 0 +/* it's at a fixed address (+0x8) so we can breakpoint it in the JTAG script + * we need to go through this hassle because before this moment, SDRAM is not + * working so we can't prep it from JTAG + */ + +_steppingstone_done: + ldr pc, _start_armboot + +_start_armboot: + .word start_qi + _TEXT_BASE: .word TEXT_BASE @@ -192,10 +203,7 @@ clbss_l: /* we are going to jump into the C part of the init now */ spin: - ldr pc, _start_armboot - -_start_armboot: - .word start_qi + b _steppingstone_done /* *************************************************************************