2008-07-09 01:48:48 +03:00
|
|
|
/*
|
|
|
|
* (C) Copyright 2007 OpenMoko, Inc.
|
|
|
|
* Author: xiangfu liu <xiangfu@openmoko.org>
|
|
|
|
*
|
|
|
|
* Configuation settings for the OPENMOKO 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
|
|
|
|
*/
|
2008-07-13 05:57:57 +03:00
|
|
|
#include "blink_led.h"
|
|
|
|
#include "nand_read.h"
|
2008-08-13 02:36:46 +03:00
|
|
|
#include "kboot.h"
|
2008-07-13 05:57:57 +03:00
|
|
|
/*
|
2008-07-09 01:48:48 +03:00
|
|
|
unsigned char buf[]={
|
|
|
|
0x0d,0xc0,0xa0,0xe1,0x00,0xd8,0x2d,0xe9,0x04,0xb0,0x4c,0xe2,0x4c,0x20,0x9f,0xe5,
|
|
|
|
0x05,0x30,0xa0,0xe3,0x00,0x30,0x82,0xe5,0x44,0x20,0x9f,0xe5,0x44,0x30,0x9f,0xe5,
|
|
|
|
0x00,0x30,0x82,0xe5,0x40,0x20,0x9f,0xe5,0x3c,0x30,0x9f,0xe5,0x00,0x30,0x93,0xe5,
|
|
|
|
0x01,0x30,0xc3,0xe3,0x00,0x30,0x82,0xe5,0x28,0x00,0x9f,0xe5,0x0b,0x00,0x00,0xeb,
|
|
|
|
0x24,0x20,0x9f,0xe5,0x20,0x30,0x9f,0xe5,0x00,0x30,0x93,0xe5,0x01,0x30,0x83,0xe3,
|
|
|
|
0x00,0x30,0x82,0xe5,0x0c,0x00,0x9f,0xe5,0x04,0x00,0x00,0xeb,0xf0,0xff,0xff,0xea,
|
|
|
|
0x10,0x00,0x00,0x56,0x18,0x00,0x00,0x56,0xff,0xff,0x00,0x00,0x14,0x00,0x00,0x56,
|
|
|
|
0x01,0x00,0x50,0xe2,0xfd,0xff,0xff,0x1a,0x0e,0xf0,0xa0,0xe1,0x0a};
|
2008-07-13 05:57:57 +03:00
|
|
|
*/
|
2008-07-28 17:47:53 +03:00
|
|
|
unsigned char buf[2*1024];
|
2008-07-09 01:48:48 +03:00
|
|
|
|
|
|
|
#define ADDR ((volatile unsigned *)&buf)
|
2008-08-13 02:37:17 +03:00
|
|
|
#define stringify(x) #x
|
2008-07-09 01:48:48 +03:00
|
|
|
|
2008-08-13 02:41:21 +03:00
|
|
|
static char * hello = "hello";
|
|
|
|
|
2008-07-25 05:27:23 +03:00
|
|
|
int start_kboot(void)
|
2008-07-09 01:48:48 +03:00
|
|
|
{
|
2008-08-13 02:40:01 +03:00
|
|
|
static int n = 0;
|
2008-08-13 02:41:21 +03:00
|
|
|
void (*p)(unsigned int) = print32;
|
2008-08-13 02:40:01 +03:00
|
|
|
|
2008-08-13 02:37:17 +03:00
|
|
|
port_init();
|
|
|
|
serial_init(0x11, UART2);
|
2008-07-28 17:47:53 +03:00
|
|
|
|
2008-08-13 02:37:17 +03:00
|
|
|
while(1) {
|
2008-08-13 02:40:01 +03:00
|
|
|
serial_putc(2, '0');
|
2008-08-13 02:37:17 +03:00
|
|
|
serial_putc(2, 'x');
|
2008-08-13 02:40:01 +03:00
|
|
|
print32((unsigned int)&n);
|
2008-08-13 02:41:21 +03:00
|
|
|
serial_putc(2, ' ');
|
|
|
|
serial_putc(2, '0');
|
|
|
|
serial_putc(2, 'x');
|
|
|
|
print32((unsigned int)p);
|
|
|
|
serial_putc(2, ' ');
|
|
|
|
serial_putc(2, '0');
|
|
|
|
serial_putc(2, 'x');
|
|
|
|
print32((unsigned int)hello);
|
|
|
|
|
2008-08-13 02:40:01 +03:00
|
|
|
serial_putc(2, '\n');
|
2008-08-13 02:41:21 +03:00
|
|
|
|
|
|
|
|
2008-08-13 02:40:01 +03:00
|
|
|
// printk("Openmoko KBOOT "stringify(BUILD_HOST)" "stringify(BUILD_VERSION)" "stringify(BUILD_DATE)"\n");
|
2008-08-13 02:37:17 +03:00
|
|
|
blue_on(1);
|
2008-08-13 02:40:01 +03:00
|
|
|
n++;
|
2008-08-13 02:37:17 +03:00
|
|
|
}
|
2008-07-13 05:57:57 +03:00
|
|
|
|
2008-08-13 02:37:17 +03:00
|
|
|
/*2. test nand flash */
|
|
|
|
if(nand_read_ll(buf, 0x000, sizeof(buf))==-1)
|
|
|
|
while(1)
|
|
|
|
blink_led();
|
2008-07-13 20:20:35 +03:00
|
|
|
|
2008-08-13 02:37:17 +03:00
|
|
|
asm volatile("mov pc, %0\n"
|
|
|
|
: /* output */
|
|
|
|
:"r"(ADDR) /* input */
|
|
|
|
);
|
|
|
|
|
|
|
|
return 0;
|
2008-07-09 01:48:48 +03:00
|
|
|
}
|