[PATCH 06/31] net: mediatek: use a struct to cover variations of all SoCs

Weijie Gao weijie.gao at mediatek.com
Mon Aug 8 04:28:05 CEST 2022


On Thu, 2022-08-04 at 07:56 -0600, Simon Glass wrote:
> Hi Weijie,
> 
> On Wed, 3 Aug 2022 at 21:36, Weijie Gao <weijie.gao at mediatek.com>
> wrote:
> > 
> > Using a single soc id to control different initialization and TX/RX
> > flow
> > for all SoCs is not extensible if more hardware variations are
> > added in
> > the future.
> > 
> > This patch introduces a struct to replace the original mtk_soc to
> > allow
> > the driver be able handle newer hardwares.
> > 
> > Signed-off-by: Weijie Gao <weijie.gao at mediatek.com>
> > ---
> >  drivers/net/mtk_eth.c | 50 +++++++++++++++++++++++++++++--------
> > ------
> >  drivers/net/mtk_eth.h | 25 +++++++++++++++++++++-
> >  2 files changed, 58 insertions(+), 17 deletions(-)
> 
> Reviewed-by: Simon Glass <sjg at chromium.org>
> 
> > 
> > diff --git a/drivers/net/mtk_eth.c b/drivers/net/mtk_eth.c
> > index 4fe7ee0d36..92d2ea4f2a 100644
> > --- a/drivers/net/mtk_eth.c
> > +++ b/drivers/net/mtk_eth.c
> > @@ -142,11 +142,9 @@ enum mtk_switch {
> >         SW_MT7531
> >  };
> > 
> > -enum mtk_soc {
> > -       SOC_MT7623,
> > -       SOC_MT7629,
> > -       SOC_MT7622,
> > -       SOC_MT7621
> > +struct mtk_soc_data {
> > +       u32 caps;
> > +       u32 ana_rgc3;
> 
> please comment these
> [..]

OK.

> 
> Regards,
> Simon


More information about the U-Boot mailing list