
On 11. 03. 20 15:28, Tom Rini wrote:
On Wed, Mar 11, 2020 at 01:11:07PM +0100, Michal Simek wrote:
On 11. 03. 20 12:56, Stefan Roese wrote:
Hi Michal,
On 11.03.20 12:34, Michal Simek wrote:
<snip>
+/* Generic Control/Status Register Masks */ +#define XWT_WWCSR_GWEN_MASK BIT(0) /* Enable Bit */
+struct wwdt_regs { + u32 reserved0[1024]; + u32 refresh; /* Refresh Register [0x1000] */ + u32 reserved1[1023]; + u32 csr; /* Control/Status Register [0x2000] */ + u32 reserved2; + u32 offset; /* Offset Register [0x2008] */ + u32 reserved3; + u32 cmp0; /* Compare Value Register0 [0x2010] */ + u32 cmp1; /* Compare Value Register1 [0x2014] */ + u32 reserved4[1006]; + u32 warmrst; /* Warm Reset Register [0x2FD0] */ +};
My understanding is, that we moved to using defines instead of structs for register definitions. So if you need to send a v2, then please consider using #defines here.
When was that decision done? Any link to documentation/commit message?
Frankly, I don't remember and unfortunately I don't have a link ready to share. I've seen discussions in the past, where the old U-Boot style using structs was not preferred any more. So newer code moves to using the more common #defines instead. Perhaps some else can share a link?
Tom: Do you have any comment/link?
Well, in general, we have regmap and that should be used. In cases like this where we have some huge reserved chunks it shows the worst-case of using a struct for this too.
ok. Then let's us use regmap instead.
Ashok: Can you please take a look?
Thanks, Michal