Re: [PATCH v1] rust/pl011: Fix DeviceID reads

2024-11-16 Thread Manos Pitsidianakis
On Sat, Nov 16, 2024 at 10:24 PM Paolo Bonzini wrote: > > On 11/16/24 19:15, Manos Pitsidianakis wrote: > > impl DeviceId { > > -const PL011_ID_ARM: [c_uchar; 8] = [0x11, 0x10, 0x14, 0x00, 0x0d, > > 0xf0, 0x05, 0xb1]; > > -const PL011_ID_LUMINARY: [c_uchar; 8] = [0x11, 0x00, 0x18, 0x01,

Re: [PATCH v1] rust/pl011: Fix DeviceID reads

2024-11-16 Thread Peter Maydell
On Sat, 16 Nov 2024 at 20:24, Paolo Bonzini wrote: > > On 11/16/24 19:15, Manos Pitsidianakis wrote: > > match RegisterOffset::try_from(offset) { > > +Ok(PeriphID0) | Ok(PeriphID1) | Ok(PeriphID2) | Ok(PeriphID3) > > | Ok(PCellID0) > > +| Ok(PCellID1) | Ok(PCellI

Re: [PATCH v1] rust/pl011: Fix DeviceID reads

2024-11-16 Thread Paolo Bonzini
On 11/16/24 19:15, Manos Pitsidianakis wrote: impl DeviceId { -const PL011_ID_ARM: [c_uchar; 8] = [0x11, 0x10, 0x14, 0x00, 0x0d, 0xf0, 0x05, 0xb1]; -const PL011_ID_LUMINARY: [c_uchar; 8] = [0x11, 0x00, 0x18, 0x01, 0x0d, 0xf0, 0x05, 0xb1]; +/// Value of `UARTPeriphID0` register, wh

[PATCH v1] rust/pl011: Fix DeviceID reads

2024-11-16 Thread Manos Pitsidianakis
DeviceId, which maps the peripheral and PCell registers of a PL011 device, was not treating each register value as a 32 bit value. Change DeviceId enum to return register values via constified getter functions instead of leveraging the std::ops::Index<_> trait. Signed-off-by: Manos Pitsidianakis