rust/pl011: add TYPE_PL011_LUMINARY device

Add a device specialization for the Luminary UART device.

This commit adds a DeviceId enum that utilizes the Index trait to return
different bytes depending on what device id the UART has (Arm -default-
or Luminary)

Signed-off-by: Manos Pitsidianakis <manos.pitsidianakis@linaro.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Tested-by: Zhao Liu <zhao1.liu@intel.com>
Link: https://lore.kernel.org/r/20241024-rust-round-2-v1-6-051e7a25b978@linaro.org
This commit is contained in:
Manos Pitsidianakis 2024-10-24 17:03:04 +03:00 committed by Paolo Bonzini
parent 2e57bb6b27
commit 2e06e72d2e
2 changed files with 75 additions and 3 deletions

View file

@ -47,6 +47,7 @@ pub mod device_class;
pub mod memory_ops;
pub const TYPE_PL011: &::core::ffi::CStr = c"pl011";
pub const TYPE_PL011_LUMINARY: &::core::ffi::CStr = c"pl011_luminary";
/// Offset of each register from the base memory address of the device.
///