Browse Source

Add support for serial port J11 on 3a2h.

Before just enable the serial port J10、J8,
Now add support for serial port J11.

Target:Bonito3a2h
master
Zhang Lihong 12 years ago
committed by wanghongmei
parent
commit
8b68ae816b
  1. 51
      Targets/Bonito3a2h/Bonito/start.S
  2. 2
      Targets/Bonito3a2h/Bonito/tgt_machdep.c

51
Targets/Bonito3a2h/Bonito/start.S

@ -447,6 +447,8 @@ li t1, 0x00e0 # {cu3,cu2,cu1,cu0}<={0110, status_fr<=1
bal initserial
nop
bal initserial_uart1
nop
//#define DEBUG_LS3
#ifdef DEBUG_LS3
@ -1771,13 +1773,23 @@ TM_over:
# li v1, 1
beqz v1, 1b
nop
sb a0, NSREG(NS16550_DATA)(v0)
move v1, v0
la v0, GS3_UART_BASE
bne v0, v1, 1b
nop
la v0,GS3_UART1_BASE
1:
lbu v1, NSREG(NS16550_LSR)(v0)
and v1, LSR_TXRDY
# li v1, 1
beqz v1, 1b
nop
sb a0, NSREG(NS16550_DATA)(v0)
move v1, v0
la v0, GS3_UART1_BASE
bne v0, v1, 1b
nop
j ra
nop
END(tgt_putchar)
@ -1938,6 +1950,41 @@ TM_over:
END(initserial)
#endif
LEAF(initserial_uart1)
li a0, GS3_UART1_BASE
li t1,128
# addiu a2,a0,3
sb t1,3(a0)
#ifdef BONITO_33M
li t1,0x12 # divider, highest possible baud rate,for 33M crystal
#else
#ifdef BONITO_25M
li t1,0x0e # divider, highest possible baud rate,for 25M crystal
#else
#ifdef BONITO_50M
li t1,0x1b # divider, highest possible baud rate,for 50M crystal
#endif
#endif
#endif
sb t1,0(a0)
li t1,0x0 # divider, highest possible baud rate
sb t1,1(a0)
li t1,3
sb t1,3(a0)
#srl t1,t1,0x8
li t1,0
sb t1,1(a0)
#li t1,1 # divider, highest possible baud rate
li t1,71
sb t1,2(a0)
jr ra
nop
END(initserial_uart1)
LEAF(initserial_COM1)
la v0, COM1_BASE_ADDR
#la v0, 0xba0003f8

2
Targets/Bonito3a2h/Bonito/tgt_machdep.c

@ -370,8 +370,8 @@ ConfigEntry ConfigTable[] =
#ifdef USE_LPC_UART
{ (char *)COM3_BASE_ADDR, 0, ns16550, 256, CONS_BAUD, NS16550HZ },
#else
//{ (char *)0xbfe001e0, 0, ns16550, 256, CONS_BAUD, NS16550HZ },
{ (char *)GS3_UART_BASE, 0, ns16550, 256, CONS_BAUD, NS16550HZ },
{ (char *)GS3_UART1_BASE, 0, ns16550, 256, CONS_BAUD, NS16550HZ },
#endif
#endif
#elif defined(USE_SM502_UART0)

Loading…
Cancel
Save