1
0
mirror of git://projects.qi-hardware.com/xburst-tools.git synced 2025-04-21 12:27:27 +03:00

add serial output function, Thanks Dennis <dennis.yxun@gmail.com>, his patch make me clear. Thank for Andy Green help.

This commit is contained in:
xiangfu
2008-07-24 22:27:23 -04:00
parent 12ba156cfb
commit b92d8222aa
9 changed files with 201 additions and 18 deletions

View File

@@ -66,7 +66,7 @@ int blue_on(int times)
return 0;
}
int blink_led()
int blink_led(void)
{
set_GPB();

View File

@@ -32,23 +32,35 @@ SECTIONS
. = ALIGN(4);
.text :
{
start.o (.text)
lowlevel_init.o(.text)
start_kboot.o (.text)
src/start.o (.text)
src/lowlevel_init.o(.text)
src/start_kboot.o (.text)
*(.text)
}
. = ALIGN(4);
.rodata : { *(.rodata) }
.rodata :
{
*(.rodata)
}
. = ALIGN(4);
.data : { *(.data) }
.data :
{
*(.data)
}
. = ALIGN(4);
.got : { *(.got) }
.got :
{
*(.got)
}
. = ALIGN(4);
__bss_start = .;
.bss : { *(.bss) }
.bss :
{
*(.bss)
}
_end = .;
}

33
qiboot/src/serial.c Normal file
View File

@@ -0,0 +1,33 @@
/*
* (C) Copyright 2007 OpenMoko, Inc.
* Author: xiangfu liu <xiangfu@openmoko.org>
*
* Configuation settings for the FIC Neo GTA02 Linux GSM phone
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
* MA 02111-1307 USA
*/
# include <serial.h>
/*
* Output a single byte to the serial port.
*/
void serial_puti (const int i)
{
while (!(UTRSTAT & 0x2));
rUTXH0 |= i;
}

View File

@@ -21,6 +21,7 @@
*/
#include "blink_led.h"
#include "nand_read.h"
#include "serial.h"
/*
unsigned char buf[]={
0x0d,0xc0,0xa0,0xe1,0x00,0xd8,0x2d,0xe9,0x04,0xb0,0x4c,0xe2,0x4c,0x20,0x9f,0xe5,
@@ -36,14 +37,19 @@ unsigned char buf[2048];
#define ADDR ((volatile unsigned *)&buf)
int start_kboot()
int start_kboot(void)
{
if(nand_read_ll(buf, 0x32000000, sizeof(buf))==-1)
{
while(1){blink_led(1);}
/*1 say hello to uart */
serial_puti (123);
blue_on(1);
/*2. test nand flash */
if(nand_read_ll(buf, 0x40000, sizeof(buf))==-1) {
while(1) {
blink_led();
}
}
asm volatile("mov pc, %0\n"
asm volatile("mov pc, %0\n"
: /* output */
:"r"(ADDR) /* input */
);