Commit 48ae5554 authored by Jose Abreu's avatar Jose Abreu Committed by David S. Miller

net: stmmac: Add XGMAC 2.10 HWIF entry

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: default avatarJose Abreu <joabreu@synopsys.com>
Cc: David S. Miller <davem@davemloft.net>
Cc: Joao Pinto <jpinto@synopsys.com>
Cc: Giuseppe Cavallaro <peppe.cavallaro@st.com>
Cc: Alexandre Torgue <alexandre.torgue@st.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent ff50eda4
...@@ -36,12 +36,14 @@ ...@@ -36,12 +36,14 @@
#include "mmc.h" #include "mmc.h"
/* Synopsys Core versions */ /* Synopsys Core versions */
#define DWMAC_CORE_3_40 0x34 #define DWMAC_CORE_3_40 0x34
#define DWMAC_CORE_3_50 0x35 #define DWMAC_CORE_3_50 0x35
#define DWMAC_CORE_4_00 0x40 #define DWMAC_CORE_4_00 0x40
#define DWMAC_CORE_4_10 0x41 #define DWMAC_CORE_4_10 0x41
#define DWMAC_CORE_5_00 0x50 #define DWMAC_CORE_5_00 0x50
#define DWMAC_CORE_5_10 0x51 #define DWMAC_CORE_5_10 0x51
#define DWXGMAC_CORE_2_10 0x21
#define STMMAC_CHAN0 0 /* Always supported and default for all chips */ #define STMMAC_CHAN0 0 /* Always supported and default for all chips */
/* These need to be power of two, and >= 4 */ /* These need to be power of two, and >= 4 */
......
...@@ -72,6 +72,7 @@ static int stmmac_dwmac4_quirks(struct stmmac_priv *priv) ...@@ -72,6 +72,7 @@ static int stmmac_dwmac4_quirks(struct stmmac_priv *priv)
static const struct stmmac_hwif_entry { static const struct stmmac_hwif_entry {
bool gmac; bool gmac;
bool gmac4; bool gmac4;
bool xgmac;
u32 min_id; u32 min_id;
const struct stmmac_regs_off regs; const struct stmmac_regs_off regs;
const void *desc; const void *desc;
...@@ -87,6 +88,7 @@ static const struct stmmac_hwif_entry { ...@@ -87,6 +88,7 @@ static const struct stmmac_hwif_entry {
{ {
.gmac = false, .gmac = false,
.gmac4 = false, .gmac4 = false,
.xgmac = false,
.min_id = 0, .min_id = 0,
.regs = { .regs = {
.ptp_off = PTP_GMAC3_X_OFFSET, .ptp_off = PTP_GMAC3_X_OFFSET,
...@@ -103,6 +105,7 @@ static const struct stmmac_hwif_entry { ...@@ -103,6 +105,7 @@ static const struct stmmac_hwif_entry {
}, { }, {
.gmac = true, .gmac = true,
.gmac4 = false, .gmac4 = false,
.xgmac = false,
.min_id = 0, .min_id = 0,
.regs = { .regs = {
.ptp_off = PTP_GMAC3_X_OFFSET, .ptp_off = PTP_GMAC3_X_OFFSET,
...@@ -119,6 +122,7 @@ static const struct stmmac_hwif_entry { ...@@ -119,6 +122,7 @@ static const struct stmmac_hwif_entry {
}, { }, {
.gmac = false, .gmac = false,
.gmac4 = true, .gmac4 = true,
.xgmac = false,
.min_id = 0, .min_id = 0,
.regs = { .regs = {
.ptp_off = PTP_GMAC4_OFFSET, .ptp_off = PTP_GMAC4_OFFSET,
...@@ -135,6 +139,7 @@ static const struct stmmac_hwif_entry { ...@@ -135,6 +139,7 @@ static const struct stmmac_hwif_entry {
}, { }, {
.gmac = false, .gmac = false,
.gmac4 = true, .gmac4 = true,
.xgmac = false,
.min_id = DWMAC_CORE_4_00, .min_id = DWMAC_CORE_4_00,
.regs = { .regs = {
.ptp_off = PTP_GMAC4_OFFSET, .ptp_off = PTP_GMAC4_OFFSET,
...@@ -151,6 +156,7 @@ static const struct stmmac_hwif_entry { ...@@ -151,6 +156,7 @@ static const struct stmmac_hwif_entry {
}, { }, {
.gmac = false, .gmac = false,
.gmac4 = true, .gmac4 = true,
.xgmac = false,
.min_id = DWMAC_CORE_4_10, .min_id = DWMAC_CORE_4_10,
.regs = { .regs = {
.ptp_off = PTP_GMAC4_OFFSET, .ptp_off = PTP_GMAC4_OFFSET,
...@@ -167,6 +173,7 @@ static const struct stmmac_hwif_entry { ...@@ -167,6 +173,7 @@ static const struct stmmac_hwif_entry {
}, { }, {
.gmac = false, .gmac = false,
.gmac4 = true, .gmac4 = true,
.xgmac = false,
.min_id = DWMAC_CORE_5_10, .min_id = DWMAC_CORE_5_10,
.regs = { .regs = {
.ptp_off = PTP_GMAC4_OFFSET, .ptp_off = PTP_GMAC4_OFFSET,
...@@ -180,11 +187,29 @@ static const struct stmmac_hwif_entry { ...@@ -180,11 +187,29 @@ static const struct stmmac_hwif_entry {
.tc = &dwmac510_tc_ops, .tc = &dwmac510_tc_ops,
.setup = dwmac4_setup, .setup = dwmac4_setup,
.quirks = NULL, .quirks = NULL,
} }, {
.gmac = false,
.gmac4 = false,
.xgmac = true,
.min_id = DWXGMAC_CORE_2_10,
.regs = {
.ptp_off = 0,
.mmc_off = 0,
},
.desc = NULL,
.dma = NULL,
.mac = NULL,
.hwtimestamp = NULL,
.mode = NULL,
.tc = NULL,
.setup = NULL,
.quirks = NULL,
},
}; };
int stmmac_hwif_init(struct stmmac_priv *priv) int stmmac_hwif_init(struct stmmac_priv *priv)
{ {
bool needs_xgmac = priv->plat->has_xgmac;
bool needs_gmac4 = priv->plat->has_gmac4; bool needs_gmac4 = priv->plat->has_gmac4;
bool needs_gmac = priv->plat->has_gmac; bool needs_gmac = priv->plat->has_gmac;
const struct stmmac_hwif_entry *entry; const struct stmmac_hwif_entry *entry;
...@@ -195,7 +220,7 @@ int stmmac_hwif_init(struct stmmac_priv *priv) ...@@ -195,7 +220,7 @@ int stmmac_hwif_init(struct stmmac_priv *priv)
if (needs_gmac) { if (needs_gmac) {
id = stmmac_get_id(priv, GMAC_VERSION); id = stmmac_get_id(priv, GMAC_VERSION);
} else if (needs_gmac4) { } else if (needs_gmac4 || needs_xgmac) {
id = stmmac_get_id(priv, GMAC4_VERSION); id = stmmac_get_id(priv, GMAC4_VERSION);
} else { } else {
id = 0; id = 0;
...@@ -229,6 +254,8 @@ int stmmac_hwif_init(struct stmmac_priv *priv) ...@@ -229,6 +254,8 @@ int stmmac_hwif_init(struct stmmac_priv *priv)
continue; continue;
if (needs_gmac4 ^ entry->gmac4) if (needs_gmac4 ^ entry->gmac4)
continue; continue;
if (needs_xgmac ^ entry->xgmac)
continue;
/* Use synopsys_id var because some setups can override this */ /* Use synopsys_id var because some setups can override this */
if (priv->synopsys_id < entry->min_id) if (priv->synopsys_id < entry->min_id)
continue; continue;
......
...@@ -190,5 +190,6 @@ struct plat_stmmacenet_data { ...@@ -190,5 +190,6 @@ struct plat_stmmacenet_data {
bool tso_en; bool tso_en;
int mac_port_sel_speed; int mac_port_sel_speed;
bool en_tx_lpi_clockgating; bool en_tx_lpi_clockgating;
int has_xgmac;
}; };
#endif #endif
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment