1
0
mirror of git://projects.qi-hardware.com/xburst-tools.git synced 2024-11-01 12:28:06 +02:00

cleanup for jz4760, move UART_BASE it to board-jz47xx.c file

Signed-off-by: Xiangfu Liu <xiangfu@sharism.cc>
This commit is contained in:
Xiangfu Liu 2010-06-07 20:46:04 +08:00
parent 14fb5adc49
commit f3237cab36
3 changed files with 12 additions and 14 deletions

View File

@ -25,7 +25,6 @@ u32 UART_BASE;
volatile u32 ARG_EXTAL; volatile u32 ARG_EXTAL;
volatile u32 ARG_CPU_SPEED; volatile u32 ARG_CPU_SPEED;
volatile u8 ARG_PHM_DIV; volatile u8 ARG_PHM_DIV;
volatile u32 ARG_UART_BASE;
volatile u32 ARG_UART_BAUD; volatile u32 ARG_UART_BAUD;
volatile u8 ARG_BUS_WIDTH_16; volatile u8 ARG_BUS_WIDTH_16;
volatile u8 ARG_BANK_ADDR_2BIT; volatile u8 ARG_BANK_ADDR_2BIT;

View File

@ -73,9 +73,9 @@ void pll_init_4740()
static void serial_setbaud() static void serial_setbaud()
{ {
volatile u8* uart_lcr = (volatile u8*)(ARG_UART_BASE + OFF_LCR); volatile u8* uart_lcr = (volatile u8*)(UART_BASE + OFF_LCR);
volatile u8* uart_dlhr = (volatile u8*)(ARG_UART_BASE + OFF_DLHR); volatile u8* uart_dlhr = (volatile u8*)(UART_BASE + OFF_DLHR);
volatile u8* uart_dllr = (volatile u8*)(ARG_UART_BASE + OFF_DLLR); volatile u8* uart_dllr = (volatile u8*)(UART_BASE + OFF_DLLR);
u32 baud_div, tmp; u32 baud_div, tmp;
baud_div = ARG_EXTAL / 16 / ARG_UART_BAUD; baud_div = ARG_EXTAL / 16 / ARG_UART_BAUD;
@ -90,12 +90,14 @@ static void serial_setbaud()
*uart_lcr = tmp; *uart_lcr = tmp;
} }
void serial_init_4740() void serial_init_4740(int uart)
{ {
volatile u8* uart_fcr = (volatile u8*)(ARG_UART_BASE + OFF_FCR); UART_BASE = UART0_BASE + uart * UART_OFF;
volatile u8* uart_lcr = (volatile u8*)(ARG_UART_BASE + OFF_LCR);
volatile u8* uart_ier = (volatile u8*)(ARG_UART_BASE + OFF_IER); volatile u8* uart_fcr = (volatile u8*)(UART_BASE + OFF_FCR);
volatile u8* uart_sircr = (volatile u8*)(ARG_UART_BASE + OFF_SIRCR); volatile u8* uart_lcr = (volatile u8*)(UART_BASE + OFF_LCR);
volatile u8* uart_ier = (volatile u8*)(UART_BASE + OFF_IER);
volatile u8* uart_sircr = (volatile u8*)(UART_BASE + OFF_SIRCR);
/* Disable port interrupts while changing hardware */ /* Disable port interrupts while changing hardware */
*uart_ier = 0; *uart_ier = 0;

View File

@ -9,11 +9,10 @@
#include "common.h" #include "common.h"
#include "serial.h" #include "serial.h"
#include "jz4740.h"
extern void gpio_init_4740(); extern void gpio_init_4740();
extern void pll_init_4740(); extern void pll_init_4740();
extern void serial_init_4740(); extern void serial_init_4740(int uart);
extern void sdram_init_4740(); extern void sdram_init_4740();
extern void nand_init_4740(); extern void nand_init_4740();
@ -23,8 +22,6 @@ void load_args()
ARG_EXTAL = 12 * 1000000; ARG_EXTAL = 12 * 1000000;
ARG_CPU_SPEED = 21 * ARG_EXTAL; ARG_CPU_SPEED = 21 * ARG_EXTAL;
ARG_PHM_DIV = 3; ARG_PHM_DIV = 3;
ARG_UART_BASE = UART0_BASE + 0 * UART_OFF;
UART_BASE = ARG_UART_BASE; // for ../target-common/serial.c
ARG_UART_BAUD = 57600; ARG_UART_BAUD = 57600;
ARG_BUS_WIDTH_16 = * (int *)0x80002014; ARG_BUS_WIDTH_16 = * (int *)0x80002014;
ARG_BANK_ADDR_2BIT = 1; ARG_BANK_ADDR_2BIT = 1;
@ -39,7 +36,7 @@ void c_main(void)
switch (ARG_CPU_ID) { switch (ARG_CPU_ID) {
case 0x4740: case 0x4740:
gpio_init_4740(); gpio_init_4740();
serial_init_4740(); serial_init_4740(0);
pll_init_4740(); pll_init_4740();
sdram_init_4740(); sdram_init_4740();
nand_init_4740(); nand_init_4740();