[PATCH 08/15] change-text-base-and-meddle.patch
Andy Green
andy at openmoko.com
Wed Aug 13 01:59:29 CEST 2008
change the TEXT_BASE and meddle around
Signed-off-by: Andy Green <andy at openmoko.com>
---
include/neo_gta02.h | 2 +-
src/kboot.h | 4 +++-
src/lowlevel_init.S | 3 ---
src/serial.c | 27 +++++++++++++++++++++++++--
src/start.S | 2 ++
src/start_kboot.c | 10 +++++++---
6 files changed, 38 insertions(+), 10 deletions(-)
diff --git a/include/neo_gta02.h b/include/neo_gta02.h
index 506149a..c126adb 100644
--- a/include/neo_gta02.h
+++ b/include/neo_gta02.h
@@ -23,6 +23,6 @@
#ifndef __CONFIG_H
#define __CONFIG_H
-#define TEXT_BASE 0x33F80000 /* xiangfu add*/
+#define TEXT_BASE 0x33000000
#endif /* __CONFIG_H */
diff --git a/src/kboot.h b/src/kboot.h
index 037a5d0..7143aae 100644
--- a/src/kboot.h
+++ b/src/kboot.h
@@ -8,7 +8,9 @@
int printk(const char *fmt, ...);
int vsprintf(char *buf, const char *fmt, va_list args);
-void puts(const char *string);
+int puts(const char *string);
+void printhex(unsigned char v);
+void print32(unsigned int u);
#endif
diff --git a/src/lowlevel_init.S b/src/lowlevel_init.S
index 2ce0133..dcb3adf 100644
--- a/src/lowlevel_init.S
+++ b/src/lowlevel_init.S
@@ -120,9 +120,6 @@
#define REFCNT 997 /* period=17.5us, HCLK=60Mhz, (2048+1-15.6*60) */
/**************************************/
-_TEXT_BASE:
- .word TEXT_BASE
-
.globl lowlevel_init
lowlevel_init:
/* memory control configuration */
diff --git a/src/serial.c b/src/serial.c
index 38053f8..8c8c2a5 100644
--- a/src/serial.c
+++ b/src/serial.c
@@ -86,17 +86,40 @@ int puts(const char *string)
return 1;
}
+/* done like this to avoid needing statics in steppingstone */
+void printnybble(unsigned char n)
+{
+ if (n < 10)
+ serial_putc(DEBUG_CONSOLE_UART, '0' + n);
+ else
+ serial_putc(DEBUG_CONSOLE_UART, 'a' + n - 10);
+}
+
+void printhex(unsigned char n)
+{
+ printnybble((n >> 4) & 15);
+ printnybble(n & 15);
+}
+
+void print32(unsigned int u)
+{
+ printhex(u >> 24);
+ printhex(u >> 16);
+ printhex(u >> 8);
+ printhex(u);
+}
+
int printk(const char *fmt, ...)
{
va_list args;
int r;
static char buf[512];
- char *p = buf;
+ const char *p = buf;
va_start(args, fmt);
r = vsprintf(buf, fmt, args);
va_end(args);
-
+ p = fmt;
while (*p)
serial_putc(DEBUG_CONSOLE_UART, *p++);
diff --git a/src/start.S b/src/start.S
index b2b0596..5f956ed 100644
--- a/src/start.S
+++ b/src/start.S
@@ -158,6 +158,8 @@ clbss_l:
cmp r0, r1
ble clbss_l
+/* we are going to jump into the C part of the init now */
+
ldr pc, _start_armboot
_start_armboot:
diff --git a/src/start_kboot.c b/src/start_kboot.c
index b9777ec..86e2483 100644
--- a/src/start_kboot.c
+++ b/src/start_kboot.c
@@ -40,15 +40,19 @@ unsigned char buf[2*1024];
int start_kboot(void)
{
+ static int n = 0;
+
port_init();
serial_init(0x11, UART2);
while(1) {
+ serial_putc(2, '0');
serial_putc(2, 'x');
- serial_putc(2, 'x');
- serial_putc(2, 'x');
- printk("Openmoko KBOOT "stringify(BUILD_HOST)" "stringify(BUILD_VERSION)" "stringify(BUILD_DATE)"\n");
+ print32((unsigned int)&n);
+ serial_putc(2, '\n');
+// printk("Openmoko KBOOT "stringify(BUILD_HOST)" "stringify(BUILD_VERSION)" "stringify(BUILD_DATE)"\n");
blue_on(1);
+ n++;
}
/*2. test nand flash */
More information about the openmoko-kernel
mailing list