mirror of
git://projects.qi-hardware.com/xburst-tools.git
synced 2024-11-22 23:09:21 +02:00
qi-add-steppingstone-section-for-putc.patch
We need putc even when we are operating entirely from steppingstone. Arrange that the board-specific putc code is in a section that goes into steppingstone, and adapt the utils.c putc() so that it no longer needs to indirect through the board_api struct that is in main memory. Signed-off-by: Andy Green <andy@openmoko.com>
This commit is contained in:
parent
2e982c433d
commit
8d0a6cbd9f
@ -108,5 +108,7 @@ int nand_read_ll(unsigned char *buf, unsigned long start512, int blocks512);
|
|||||||
|
|
||||||
extern void memory_test(void * start, unsigned int length);
|
extern void memory_test(void * start, unsigned int length);
|
||||||
|
|
||||||
|
void set_putc_func(void (*p)(char));
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -341,7 +341,7 @@ const struct board_variant const * get_board_variant_gta02(void)
|
|||||||
return &board_variants[gta02_get_pcb_revision() & 1];
|
return &board_variants[gta02_get_pcb_revision() & 1];
|
||||||
}
|
}
|
||||||
|
|
||||||
static void putc_gta02(char c)
|
static __attribute__ (( section (".steppingstone") )) void putc_gta02(char c)
|
||||||
{
|
{
|
||||||
serial_putc_s3c24xx(GTA02_DEBUG_UART, c);
|
serial_putc_s3c24xx(GTA02_DEBUG_UART, c);
|
||||||
}
|
}
|
||||||
|
@ -37,12 +37,16 @@ SECTIONS
|
|||||||
. = ALIGN(4);
|
. = ALIGN(4);
|
||||||
.text :
|
.text :
|
||||||
{
|
{
|
||||||
src/cpu/s3c2442/start.o (.text .rodata* .data)
|
src/cpu/s3c2442/start.o (.text .rodata* .data .bss)
|
||||||
src/cpu/s3c2442/lowlevel_init.o (.text .rodata* .data)
|
src/cpu/s3c2442/lowlevel_init.o (.text .rodata* .data .bss)
|
||||||
src/cpu/s3c2442/start_qi.o (.text .rodata* .data)
|
src/cpu/s3c2442/start_qi.o (.text .rodata* .data .bss)
|
||||||
src/blink_led.o (.text .rodata* .data)
|
/* src/blink_led.o (.text .rodata* .data .bss) */
|
||||||
src/cpu/s3c2442/nand_read.o (.text .rodata* .data)
|
src/cpu/s3c2442/nand_read.o (.text .rodata* .data .bss)
|
||||||
src/cpu/s3c2442/serial-s3c24xx.o (.text .rodata* .data)
|
src/cpu/s3c2442/serial-s3c24xx.o (.text .rodata* .data .bss)
|
||||||
|
src/memory-test.o (.text .rodata* .data .bss)
|
||||||
|
src/utils.o (.text .rodata* .data .bss)
|
||||||
|
src/ctype.o (.text .rodata* .data .bss)
|
||||||
|
* (.steppingstone)
|
||||||
}
|
}
|
||||||
|
|
||||||
. = ALIGN(4);
|
. = ALIGN(4);
|
||||||
|
@ -98,6 +98,7 @@ void start_qi(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
this_board->port_init();
|
this_board->port_init();
|
||||||
|
set_putc_func(this_board->putc);
|
||||||
|
|
||||||
/* stick some hello messages on debug console */
|
/* stick some hello messages on debug console */
|
||||||
|
|
||||||
|
@ -166,7 +166,7 @@ int is_this_board_gta03(void)
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void putc_gta03(char c)
|
static __attribute__ (( section (".steppingstone") )) void putc_gta03(char c)
|
||||||
{
|
{
|
||||||
serial_putc_s3c64xx(GTA03_DEBUG_UART, c);
|
serial_putc_s3c64xx(GTA03_DEBUG_UART, c);
|
||||||
}
|
}
|
||||||
|
@ -42,13 +42,15 @@ SECTIONS
|
|||||||
__steppingstone :
|
__steppingstone :
|
||||||
AT (0)
|
AT (0)
|
||||||
{
|
{
|
||||||
src/cpu/s3c6410/start.o (.text .rodata* .data)
|
src/cpu/s3c6410/start.o (.text .rodata* .data .bss)
|
||||||
src/cpu/s3c6410/start_qi.o (.text .rodata* .data)
|
src/cpu/s3c6410/start_qi.o (.text .rodata* .data .bss)
|
||||||
src/cpu/s3c6410/serial-s3c64xx.o (.text .rodata* .data)
|
src/cpu/s3c6410/serial-s3c64xx.o (.text .rodata* .data .bss)
|
||||||
src/cpu/s3c6410/gta03.o (.text .rodata* .data)
|
src/cpu/s3c6410/gta03.o (.text .rodata* .data .bss)
|
||||||
src/cpu/s3c6410/hs_mmc.o (.text .rodata* .data)
|
src/cpu/s3c6410/hs_mmc.o (.text .rodata* .data .bss)
|
||||||
src/utils.o (.text .rodata* .data)
|
src/utils.o (.text .rodata* .data .bss)
|
||||||
src/ctype.o (.text .rodata* .data)
|
src/memory-test.o (.text .rodata* .data .bss)
|
||||||
|
src/ctype.o (.text .rodata* .data .bss)
|
||||||
|
* (.steppingstone)
|
||||||
}
|
}
|
||||||
|
|
||||||
. = ALIGN(4);
|
. = ALIGN(4);
|
||||||
|
@ -79,6 +79,7 @@ void start_qi(void)
|
|||||||
/* okay, do the critical port and serial init for our board */
|
/* okay, do the critical port and serial init for our board */
|
||||||
|
|
||||||
this_board->port_init();
|
this_board->port_init();
|
||||||
|
set_putc_func(this_board->putc);
|
||||||
|
|
||||||
/* stick some hello messages on debug console */
|
/* stick some hello messages on debug console */
|
||||||
|
|
||||||
@ -97,7 +98,7 @@ void start_qi(void)
|
|||||||
|
|
||||||
if (!is_jtag) {
|
if (!is_jtag) {
|
||||||
/*
|
/*
|
||||||
* We got the first 4KBytes of the bootloader pulled into the
|
* We got the first 8KBytes of the bootloader pulled into the
|
||||||
* steppingstone SRAM for free. Now we pull the whole bootloader
|
* steppingstone SRAM for free. Now we pull the whole bootloader
|
||||||
* image into SDRAM.
|
* image into SDRAM.
|
||||||
*
|
*
|
||||||
|
@ -23,10 +23,14 @@
|
|||||||
#include <qi.h>
|
#include <qi.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
static u8 malloc_pool[100 * 1024];
|
static void (*putc_func)(char) = NULL;
|
||||||
void * malloc_pointer = &malloc_pool[0];
|
|
||||||
|
|
||||||
|
|
||||||
|
void set_putc_func(void (*p)(char))
|
||||||
|
{
|
||||||
|
putc_func = p;
|
||||||
|
}
|
||||||
|
|
||||||
size_t strlen(const char *s)
|
size_t strlen(const char *s)
|
||||||
{
|
{
|
||||||
size_t n = 0;
|
size_t n = 0;
|
||||||
@ -88,7 +92,7 @@ char *strchr(const char *s, int c)
|
|||||||
int puts(const char *string)
|
int puts(const char *string)
|
||||||
{
|
{
|
||||||
while (*string)
|
while (*string)
|
||||||
this_board->putc(*string++);
|
(putc_func)(*string++);
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
@ -97,9 +101,9 @@ int puts(const char *string)
|
|||||||
void printnybble(unsigned char n)
|
void printnybble(unsigned char n)
|
||||||
{
|
{
|
||||||
if (n < 10)
|
if (n < 10)
|
||||||
this_board->putc('0' + n);
|
(putc_func)('0' + n);
|
||||||
else
|
else
|
||||||
this_board->putc('a' + n - 10);
|
(putc_func)('a' + n - 10);
|
||||||
}
|
}
|
||||||
|
|
||||||
void print8(unsigned char n)
|
void print8(unsigned char n)
|
||||||
@ -122,13 +126,13 @@ void hexdump(unsigned char *start, int len)
|
|||||||
|
|
||||||
while (len > 0) {
|
while (len > 0) {
|
||||||
print32((int)start);
|
print32((int)start);
|
||||||
this_board->putc(':');
|
(putc_func)(':');
|
||||||
this_board->putc(' ');
|
(putc_func)(' ');
|
||||||
for (n = 0; n < 16; n++) {
|
for (n = 0; n < 16; n++) {
|
||||||
print8(*start++);
|
print8(*start++);
|
||||||
this_board->putc(' ');
|
(putc_func)(' ');
|
||||||
}
|
}
|
||||||
this_board->putc('\n');
|
(putc_func)('\n');
|
||||||
len -= 16;
|
len -= 16;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -152,7 +156,7 @@ void printdec(int n)
|
|||||||
int div = 0;
|
int div = 0;
|
||||||
|
|
||||||
if (n < 0) {
|
if (n < 0) {
|
||||||
this_board->putc('-');
|
(putc_func)('-');
|
||||||
n = -n;
|
n = -n;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -163,7 +167,7 @@ void printdec(int n)
|
|||||||
n -= d[div];
|
n -= d[div];
|
||||||
}
|
}
|
||||||
if (r || flag || (d[div] == 1)) {
|
if (r || flag || (d[div] == 1)) {
|
||||||
this_board->putc('0' + r);
|
(putc_func)('0' + r);
|
||||||
flag = 1;
|
flag = 1;
|
||||||
}
|
}
|
||||||
div++;
|
div++;
|
||||||
|
Loading…
Reference in New Issue
Block a user