From mboxrd@z Thu Jan 1 00:00:00 1970 From: Florian Fainelli Subject: Re: [PATCH v3 net-next 1/9] net: stmmac: Add XGMAC 2.10 HWIF entry Date: Fri, 3 Aug 2018 11:54:18 -0700 Message-ID: <4f309bf8-c669-ae9d-750c-8946715f0fe1@gmail.com> References: <5ff6dcc508726dec7d170315e2e3728667b6133f.1533311285.git.joabreu@synopsys.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Cc: "David S. Miller" , Joao Pinto , Giuseppe Cavallaro , Alexandre Torgue To: Jose Abreu , netdev@vger.kernel.org Return-path: Received: from mail-wm0-f68.google.com ([74.125.82.68]:50412 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728246AbeHCUwB (ORCPT ); Fri, 3 Aug 2018 16:52:01 -0400 Received: by mail-wm0-f68.google.com with SMTP id s12-v6so7301384wmc.0 for ; Fri, 03 Aug 2018 11:54:28 -0700 (PDT) In-Reply-To: <5ff6dcc508726dec7d170315e2e3728667b6133f.1533311285.git.joabreu@synopsys.com> Content-Language: en-US Sender: netdev-owner@vger.kernel.org List-ID: On 08/03/2018 08:50 AM, Jose Abreu wrote: > Add a new entry to HWIF table for XGMAC 2.10. For now we fill it with > empty callbacks which will be added in posterior patches. > > Signed-off-by: Jose Abreu > Cc: David S. Miller > Cc: Joao Pinto > Cc: Giuseppe Cavallaro > Cc: Alexandre Torgue > --- > drivers/net/ethernet/stmicro/stmmac/common.h | 14 +++++++------ > drivers/net/ethernet/stmicro/stmmac/hwif.c | 31 ++++++++++++++++++++++++++-- > include/linux/stmmac.h | 1 + > 3 files changed, 38 insertions(+), 8 deletions(-) > > diff --git a/drivers/net/ethernet/stmicro/stmmac/common.h b/drivers/net/ethernet/stmicro/stmmac/common.h > index 78fd0f8b8e81..3fb81acbd274 100644 > --- a/drivers/net/ethernet/stmicro/stmmac/common.h > +++ b/drivers/net/ethernet/stmicro/stmmac/common.h > @@ -36,12 +36,14 @@ > #include "mmc.h" > > /* Synopsys Core versions */ > -#define DWMAC_CORE_3_40 0x34 > -#define DWMAC_CORE_3_50 0x35 > -#define DWMAC_CORE_4_00 0x40 > -#define DWMAC_CORE_4_10 0x41 > -#define DWMAC_CORE_5_00 0x50 > -#define DWMAC_CORE_5_10 0x51 > +#define DWMAC_CORE_3_40 0x34 > +#define DWMAC_CORE_3_50 0x35 > +#define DWMAC_CORE_4_00 0x40 > +#define DWMAC_CORE_4_10 0x41 > +#define DWMAC_CORE_5_00 0x50 > +#define DWMAC_CORE_5_10 0x51 > +#define DWXGMAC_CORE_2_10 0x21 > + > #define STMMAC_CHAN0 0 /* Always supported and default for all chips */ > > /* These need to be power of two, and >= 4 */ > diff --git a/drivers/net/ethernet/stmicro/stmmac/hwif.c b/drivers/net/ethernet/stmicro/stmmac/hwif.c > index 1f50e83cafb2..24f5ff175aa4 100644 > --- a/drivers/net/ethernet/stmicro/stmmac/hwif.c > +++ b/drivers/net/ethernet/stmicro/stmmac/hwif.c > @@ -72,6 +72,7 @@ static int stmmac_dwmac4_quirks(struct stmmac_priv *priv) > static const struct stmmac_hwif_entry { > bool gmac; > bool gmac4; > + bool xgmac; > u32 min_id; > const struct stmmac_regs_off regs; > const void *desc; > @@ -87,6 +88,7 @@ static const struct stmmac_hwif_entry { > { > .gmac = false, > .gmac4 = false, > + .xgmac = false, In a future clean-up you would like want to remove this and replace this an enumeration which is less error prone than having to define a boolean for each of these previous generations only to say "this is not an xgmac". -- Florian