[PATCH 3/3] add-openocd-script.patch
Andy Green
andy at openmoko.com
Fri Aug 22 15:54:28 CEST 2008
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 <andy at openmoko.com>
---
gta03-qi.ocd | 33 +++++++++++++++++++++++++++++++++
src/start.S | 16 ++++++++++++----
2 files changed, 45 insertions(+), 4 deletions(-)
create mode 100755 gta03-qi.ocd
diff --git a/gta03-qi.ocd b/gta03-qi.ocd
new file mode 100755
index 0000000..16cf0bd
--- /dev/null
+++ b/gta03-qi.ocd
@@ -0,0 +1,33 @@
+# gta03 Qi script
+# Andy Green <andy at openmoko.com>
+
+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/src/start.S b/src/start.S
index 43cfffd..1514e0f 100644
--- a/src/start.S
+++ b/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
/*
*************************************************************************
More information about the openmoko-kernel
mailing list