Re: [RFC v2] hw/registerfields: add `FIELDx_1CLEAR()` macro

2022-10-09 Thread Wilfred Mallawa
On Mon, 2022-10-10 at 11:29 +1000, Alistair Francis wrote: > On Tue, Sep 27, 2022 at 10:58 AM Wilfred Mallawa > wrote: > > > > From: Wilfred Mallawa > > > > Changes from V1: > >     * Instead of needing all field bits to be set > >   we clear the field if any are set. If the field i

Re: [RFC v2] hw/registerfields: add `FIELDx_1CLEAR()` macro

2022-10-09 Thread Alistair Francis
On Tue, Sep 27, 2022 at 10:58 AM Wilfred Mallawa wrote: > > From: Wilfred Mallawa > > Changes from V1: > * Instead of needing all field bits to be set > we clear the field if any are set. If the field is > 0/clear then no change. The changelog should go > > Adds a he

[RFC v2] hw/registerfields: add `FIELDx_1CLEAR()` macro

2022-09-26 Thread Wilfred Mallawa
From: Wilfred Mallawa Changes from V1: * Instead of needing all field bits to be set we clear the field if any are set. If the field is 0/clear then no change. Adds a helper macro that implements the register `w1c` functionality. Ex: uint32_t data = FIELD32_1CLEAR