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

2024-11-17 Thread Manos Pitsidianakis
On Sun, Nov 17, 2024 at 1:16 PM Paolo Bonzini wrote: > > > > Il dom 17 nov 2024, 11:21 Manos Pitsidianakis > ha scritto: >>> >>> This seems extremely verbose and rather obscures the fact that these >>> registers are a set of adjacent simple ID registers, compared to >>> the previous code which d

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

2024-11-17 Thread Paolo Bonzini
Il dom 17 nov 2024, 11:21 Manos Pitsidianakis < manos.pitsidiana...@linaro.org> ha scritto: > This seems extremely verbose and rather obscures the fact that these >> registers are a set of adjacent simple ID registers, compared to >> the previous code which defined them as an array of values. > >

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

2024-11-17 Thread Manos Pitsidianakis
On Sun, Nov 17, 2024, 12:14 PM Peter Maydell wrote: > On Sat, 16 Nov 2024 at 22:18, Manos Pitsidianakis > wrote: > > > > 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 r

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

2024-11-17 Thread Peter Maydell
On Sat, 16 Nov 2024 at 22:18, Manos Pitsidianakis wrote: > > 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 leveragi

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

2024-11-17 Thread Manos Pitsidianakis
On Sun, Nov 17, 2024 at 9:40 AM Paolo Bonzini wrote: > > > > Il sab 16 nov 2024, 23:18 Manos Pitsidianakis > ha scritto: >> >> -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, 0x

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

2024-11-16 Thread Paolo Bonzini
Il sab 16 nov 2024, 23:18 Manos Pitsidianakis < manos.pitsidiana...@linaro.org> ha scritto: > -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]; > +/// Va

[PATCH v2] 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. While at it, print errors when gues