Skip to content

Commit 7bd800e

Browse files
committed
examples/aarch64: initialize uart device
Actually initialize the uart to silence all the "PL011 data written to disabled UART" guest errors from QEMU. Signed-off-by: Manos Pitsidianakis <[email protected]>
1 parent d435c89 commit 7bd800e

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

examples/aarch64/src/logger.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,10 @@ struct Logger {
1717
pub fn init(max_level: LevelFilter) -> Result<(), SetLoggerError> {
1818
// Safe because BASE_ADDRESS is the base of the MMIO region for a UART and is mapped as device
1919
// memory.
20-
let uart = unsafe { Uart::new(UART_BASE_ADDRESS) };
20+
#[cfg_attr(platform = "crosvm", allow(unused_mut))]
21+
let mut uart = unsafe { Uart::new(UART_BASE_ADDRESS) };
22+
#[cfg(platform = "qemu")]
23+
uart.init(50000000, 115200);
2124
LOGGER.uart.lock().replace(uart);
2225

2326
log::set_logger(&LOGGER)?;

0 commit comments

Comments
 (0)