Skip to content

Commit d7010d0

Browse files
committed
FIX: PL011 RPi4 UART configuration
- Page alignment is required for Bao; all UARTs except for UART0 in the RPi4 are not page aligned, thus requiring an offset. This must be defined by the platform's user (plat/platform.h). - UART_CLK must be overridable and defined by the platform's user (plat/platform.h): in RPi4 PL011 run at 48 MHz Signed-off-by: ElectroQuanta <29806215+ElectroQuanta@users.noreply.github.com>
1 parent 96a78ae commit d7010d0

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/platform/drivers/pl011_uart/inc/drivers/pl011_uart.h

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@
88

99
#include <stdint.h>
1010

11+
#include <plat/platform.h>
12+
#ifndef PL011_PAGE_OFFSET
13+
#define PL011_PAGE_OFFSET (0x000) /**< offset in range of 0-0xFFF */
14+
#endif
15+
1116
/* UART Base Address (PL011) */
1217

1318
#define UART_BASE_0 0xFDF02000
@@ -28,8 +33,10 @@
2833

2934
#define NUM_UART 6
3035

36+
#ifndef UART_CLK
3137
#define UART_CLK 19200000
32-
#define UART_BAUD_RATE 115200
38+
#endif
39+
#define UART_BAUD_RATE 115200
3340

3441
/* UART Data Register */
3542

@@ -177,6 +184,7 @@
177184
/* UART (PL011) register structure */
178185

179186
struct Pl011_Uart_hw {
187+
const uint8_t offset[PL011_PAGE_OFFSET]; // Offset for page alignment
180188
volatile uint32_t data; // UART Data Register
181189
volatile uint32_t status_error; // UART Receive Status Register/Error Clear
182190
// Register

0 commit comments

Comments
 (0)