Re: [PATCH v2 net-next 11/15] net: ethernet: mtk_eth_soc: introduce device register map

Lorenzo Bianconi
2022-05-20T18:11:28Z

[-- Attachment #1: Type: text/plain, Size: 996 bytes --]

> On Thu, 19 May 2022 09:51:28 +0200 Lorenzo Bianconi wrote:
> > > I don't think there's a best known practice, you'll have to exercise
> > > your judgment. Taking a look at a random example of MTK_PDMA_INT_STATUS.
> > > Looks like that one is already assigned to eth->tx_int_status_reg.
> > > Maybe that can be generalized? Personally I'd forgo the macros
> > > completely and just use eth->soc->register_name in the code.
> >
> > I personally think the code is easier to read if we use macros in this case.
> > Let's consider MTK_LRO_CTRL_DW1_CFG(), it depends on the particular soc based
> > on the register map and even on the ring index. I guess the best trade-off we
> > can get is to explicitly pass eth to the macros as parameter when needed.
>
> Yeah, do you, I was just sharing what my knee jerk direction would be.
> You know the code better.

reworking the code I introduced a register map removing the macro dependency.
I will post v3 soon.

Regards,
Lorenzo

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]