Skip to content

Commit 29bbb2a

Browse files
committed
openrisc: Add support for liteuart emergency printing
This patch adds support for sending emergency print output, such as unhandled exception details, to a liteuart serial device. This is the default device available on litex platforms. If a developer want to use this they should update UART_BASE_ADD to the address of liteuart. Signed-off-by: Stafford Horne <[email protected]>
1 parent e449759 commit 29bbb2a

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

arch/openrisc/kernel/head.S

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1555,7 +1555,18 @@ ENTRY(_emergency_putc)
15551555
l.movhi r4,hi(UART_BASE_ADD)
15561556
l.ori r4,r4,lo(UART_BASE_ADD)
15571557

1558-
#if defined(CONFIG_SERIAL_8250)
1558+
#if defined(CONFIG_SERIAL_LITEUART)
1559+
/* Check OFF_TXFULL status */
1560+
1: l.lwz r5,4(r4)
1561+
l.andi r5,r5,0xff
1562+
l.sfnei r5,0
1563+
l.bf 1b
1564+
l.nop
1565+
1566+
/* Write character */
1567+
l.andi r7,r7,0xff
1568+
l.sw 0(r4),r7
1569+
#elif defined(CONFIG_SERIAL_8250)
15591570
/* Check UART LSR THRE (hold) bit */
15601571
l.addi r6,r0,0x20
15611572
1: l.lbz r5,5(r4)

0 commit comments

Comments
 (0)