1
0
mirror of git://projects.qi-hardware.com/xburst-tools.git synced 2024-11-01 16:25:20 +02:00
xburst-tools/xbboot/target-stage1/stage1.c
Xiangfu Liu 35c0b21b65 [xbboot] fix the jz4760 compile error
Signed-off-by: Xiangfu Liu <xiangfu@sharism.cc>
2010-06-09 15:48:35 +08:00

85 lines
1.7 KiB
C

//
// Authors: Wolfgang Spraul <wolfgang@sharism.cc>
//
// 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
// 3 of the License, or (at your option) any later version.
//
#include "common.h"
#include "serial.h"
extern void gpio_init_4740();
extern void pll_init_4740();
extern void serial_init_4740(int uart);
extern void sdram_init_4740();
extern void nand_init_4740();
extern void gpio_init_4760();
extern void pll_init_4760();
extern void cpm_start_all();
extern void serial_init_4760(int uart);
extern void sdram_init_4760();
void load_args_4740()
{
ARG_CPU_ID = 0x4740;
ARG_EXTAL = 12 * 1000000;
ARG_CPU_SPEED = 21 * ARG_EXTAL;
ARG_PHM_DIV = 3;
ARG_UART_BAUD = 57600;
ARG_BUS_WIDTH_16 = * (int *)0x80002014;
ARG_BANK_ADDR_2BIT = 1;
ARG_ROW_ADDR = 13;
ARG_COL_ADDR = 9;
}
void load_args_4760()
{
ARG_CPU_ID = 0x4760;
ARG_EXTAL = 12 * 1000000;
ARG_CPU_SPEED = 2 * ARG_EXTAL;
ARG_PHM_DIV = 3;
ARG_UART_BAUD = 57600;
ARG_BUS_WIDTH_16 = * (int *)0x80002014;
ARG_BANK_ADDR_2BIT = 4;
ARG_ROW_ADDR = 12;
ARG_COL_ADDR = 9;
}
void c_main(void)
{
load_args_4740();
switch (ARG_CPU_ID) {
case 0x4740:
gpio_init_4740();
serial_init_4740(0);
pll_init_4740();
sdram_init_4740();
nand_init_4740();
break;
case 0x4760:
gpio_init_4760();
cpm_start_all();
serial_init_4760(1);
pll_init_4760();
sdram_init_4760();
__asm__ (
"li $31, 0xbfc012e0 \n\t"
"jr $31 \n\t "
);
break;
default:
return;
}
serial_puts("stage 1 finished: GPIO, clocks, SDRAM, UART setup\n"
"now jump back to BOOT ROM...\n");
}