aarch64: Correct wrong settings for serial device

Corrected:
- The device name in FDT
- MMIO mapping size

Signed-off-by: Michael Zhao <michael.zhao@arm.com>
This commit is contained in:
Michael Zhao 2021-03-14 15:09:50 +08:00 committed by Xin Wang
parent afc83582be
commit ee7fcdb3cf
2 changed files with 3 additions and 3 deletions

View File

@ -490,7 +490,7 @@ fn create_serial_node<T: DeviceInfoForFDT + Clone + Debug>(
let serial_reg_prop = generate_prop64(&[dev_info.addr(), dev_info.length()]);
let irq = generate_prop32(&[GIC_FDT_IRQ_TYPE_SPI, dev_info.irq(), IRQ_TYPE_EDGE_RISING]);
append_begin_node(fdt, &format!("uart@{:x}", dev_info.addr()))?;
append_begin_node(fdt, &format!("U6_16550A@{:x}", dev_info.addr()))?;
append_property_string(fdt, "compatible", "ns16550a")?;
append_property(fdt, "reg", &serial_reg_prop)?;
append_property_u32(fdt, "clocks", CLOCK_PHANDLE)?;

View File

@ -1628,14 +1628,14 @@ impl DeviceManager {
self.address_manager
.mmio_bus
.insert(serial.clone(), addr.0, MMIO_LEN)
.insert(serial.clone(), addr.0, 0x8)
.map_err(DeviceManagerError::BusError)?;
self.id_to_dev_info.insert(
(DeviceType::Serial, DeviceType::Serial.to_string()),
MMIODeviceInfo {
addr: addr.0,
len: MMIO_LEN,
len: 0x8,
irq: serial_irq,
},
);