Skip to content

Commit 27b8d1d

Browse files
committed
main: Don't fail on missing uart
The UART driver supports only the 16550a that is only available on QEMU. Print an error but continue so salus can run on spike and HW. Signed-off-by: Dylan Reid <[email protected]>
1 parent 20deb40 commit 27b8d1d

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/main.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,6 @@ enum RequiredDeviceProbe {
359359
Imsic(drivers::imsic::ImsicError),
360360
Pci(drivers::pci::PciError),
361361
Reset(drivers::reset::Error),
362-
Uart(drivers::uart::Error),
363362
}
364363

365364
impl Display for RequiredDeviceProbe {
@@ -369,7 +368,6 @@ impl Display for RequiredDeviceProbe {
369368
Imsic(e) => write!(f, "IMSIC: {:?}", e),
370369
Pci(e) => write!(f, "PCI: {:?}", e),
371370
Reset(e) => write!(f, "Reset: {:?}", e),
372-
Uart(e) => write!(f, "UART: {:?}", e),
373371
}
374372
}
375373
}
@@ -478,8 +476,9 @@ fn primary_init(hart_id: u64, fdt_addr: u64) -> Result<CpuParams, Error> {
478476
let hyp_dt = DeviceTree::from(&hyp_fdt).map_err(Error::FdtCreation)?;
479477

480478
// Find the UART and switch to it as the system console.
481-
UartDriver::probe_from(&hyp_dt, &mut mem_map)
482-
.map_err(|e| Error::RequiredDeviceProbe(RequiredDeviceProbe::Uart(e)))?;
479+
if let Err(e) = UartDriver::probe_from(&hyp_dt, &mut mem_map) {
480+
println!("Failed to probe UART: {:?}", e);
481+
}
483482

484483
// Discover the CPU topology.
485484
CpuInfo::parse_from(&hyp_dt).map_err(Error::CpuTopologyGeneration)?;

0 commit comments

Comments
 (0)