From 0b4bd34f15eb935bea6ba04711d22e8f3bbc4451 Mon Sep 17 00:00:00 2001 From: Andy Green Date: Wed, 13 Aug 2008 00:40:01 +0100 Subject: [PATCH] change-text-base-and-meddle.patch change the TEXT_BASE and meddle around Signed-off-by: Andy Green --- qiboot/include/neo_gta02.h | 2 +- qiboot/src/kboot.h | 4 +++- qiboot/src/lowlevel_init.S | 3 --- qiboot/src/serial.c | 27 +++++++++++++++++++++++++-- qiboot/src/start.S | 2 ++ qiboot/src/start_kboot.c | 10 +++++++--- 6 files changed, 38 insertions(+), 10 deletions(-) diff --git a/qiboot/include/neo_gta02.h b/qiboot/include/neo_gta02.h index 506149a..c126adb 100644 --- a/qiboot/include/neo_gta02.h +++ b/qiboot/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/qiboot/src/kboot.h b/qiboot/src/kboot.h index 037a5d0..7143aae 100644 --- a/qiboot/src/kboot.h +++ b/qiboot/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/qiboot/src/lowlevel_init.S b/qiboot/src/lowlevel_init.S index 2ce0133..dcb3adf 100644 --- a/qiboot/src/lowlevel_init.S +++ b/qiboot/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/qiboot/src/serial.c b/qiboot/src/serial.c index 38053f8..8c8c2a5 100644 --- a/qiboot/src/serial.c +++ b/qiboot/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/qiboot/src/start.S b/qiboot/src/start.S index b2b0596..5f956ed 100644 --- a/qiboot/src/start.S +++ b/qiboot/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/qiboot/src/start_kboot.c b/qiboot/src/start_kboot.c index b9777ec..86e2483 100644 --- a/qiboot/src/start_kboot.c +++ b/qiboot/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 */