Skip to content

Commit debac3e

Browse files
iabdalkaderdpgeorge
authored andcommitted
qemu/uart: Fix UART0 address for MPS3.
Signed-off-by: iabdalkader <i.abdalkader@gmail.com>
1 parent 0cf1a58 commit debac3e

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

ports/qemu/uart.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ void uart_tx_strn(const char *buf, size_t len) {
108108
}
109109
}
110110

111-
#elif defined(QEMU_SOC_MPS2)
111+
#elif defined(QEMU_SOC_MPS2) || defined(QEMU_SOC_MPS3)
112112

113113
#define UART_STATE_TXFULL (1 << 0)
114114
#define UART_STATE_RXFULL (1 << 1)
@@ -124,7 +124,11 @@ typedef struct _UART_t {
124124
volatile uint32_t BAUDDIV;
125125
} UART_t;
126126

127+
#if defined(QEMU_SOC_MPS3)
128+
#define UART0 ((UART_t *)(0x49303000))
129+
#else
127130
#define UART0 ((UART_t *)(0x40004000))
131+
#endif
128132

129133
void uart_init(void) {
130134
UART0->BAUDDIV = 16;

0 commit comments

Comments
 (0)