Commit 26ab9830 authored by Russell King (Oracle)'s avatar Russell King (Oracle) Committed by Jakub Kicinski
Browse files

net: stmmac: replace has_xxxx with core_type



Replace the has_gmac, has_gmac4 and has_xgmac ints, of which only one
can be set when matching a core to its driver backend, with an
enumerated type carrying the DWMAC core type.

Tested-by: default avatarMaxime Chevallier <maxime.chevallier@bootlin.com>
Signed-off-by: default avatarRussell King (Oracle) <rmk+kernel@armlinux.org.uk>
Acked-by: default avatarChen-Yu Tsai <wens@kernel.org>
Reviewed-by: default avatarMaxime Chevallier <maxime.chevallier@bootlin.com>
Tested-by: default avatarMohd Ayaan Anwar <mohd.anwar@oss.qualcomm.com>
Reviewed-by: default avatarBartosz Golaszewski <bartosz.golaszewski@linaro.org>
Link: https://patch.msgid.link/E1vB6ld-0000000BIPy-2Qi4@rmk-PC.armlinux.org.uk


Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 962ac5ca
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -43,6 +43,11 @@
#define DWXGMAC_ID		0x76
#define DWXLGMAC_ID		0x27

static inline bool dwmac_is_xmac(enum dwmac_core_type core_type)
{
	return core_type == DWMAC_CORE_GMAC4 || core_type == DWMAC_CORE_XGMAC;
}

#define STMMAC_CHAN0	0	/* Always supported and default for all chips */

/* TX and RX Descriptor Length, these need to be power of two.
+1 −1
Original line number Diff line number Diff line
@@ -109,7 +109,7 @@ static int dwc_eth_dwmac_config_dt(struct platform_device *pdev,
	}

	/* dwc-qos needs GMAC4, AAL, TSO and PMT */
	plat_dat->has_gmac4 = 1;
	plat_dat->core_type = DWMAC_CORE_GMAC4;
	plat_dat->dma_cfg->aal = 1;
	plat_dat->flags |= STMMAC_FLAG_TSO_EN;
	plat_dat->pmt = 1;
+2 −3
Original line number Diff line number Diff line
@@ -565,7 +565,7 @@ static void common_default_data(struct plat_stmmacenet_data *plat)
{
	/* clk_csr_i = 20-35MHz & MDC = clk_csr_i/16 */
	plat->clk_csr = STMMAC_CSR_20_35M;
	plat->has_gmac = 1;
	plat->core_type = DWMAC_CORE_GMAC;
	plat->force_sf_dma_mode = 1;

	plat->mdio_bus_data->needs_reset = true;
@@ -612,8 +612,7 @@ static int intel_mgbe_common_data(struct pci_dev *pdev,
	plat->pdev = pdev;
	plat->phy_addr = -1;
	plat->clk_csr = STMMAC_CSR_250_300M;
	plat->has_gmac = 0;
	plat->has_gmac4 = 1;
	plat->core_type = DWMAC_CORE_GMAC4;
	plat->force_sf_dma_mode = 0;
	plat->flags |= (STMMAC_FLAG_TSO_EN | STMMAC_FLAG_SPH_DISABLE);

+1 −1
Original line number Diff line number Diff line
@@ -473,7 +473,7 @@ static int ipq806x_gmac_probe(struct platform_device *pdev)
			return err;
	}

	plat_dat->has_gmac = true;
	plat_dat->core_type = DWMAC_CORE_GMAC;
	plat_dat->bsp_priv = gmac;
	plat_dat->set_clk_tx_rate = ipq806x_gmac_set_clk_tx_rate;
	plat_dat->multicast_filter_bins = 0;
+1 −1
Original line number Diff line number Diff line
@@ -92,7 +92,7 @@ static void loongson_default_data(struct pci_dev *pdev,

	/* clk_csr_i = 20-35MHz & MDC = clk_csr_i/16 */
	plat->clk_csr = STMMAC_CSR_20_35M;
	plat->has_gmac = 1;
	plat->core_type = DWMAC_CORE_GMAC;
	plat->force_sf_dma_mode = 1;

	/* Set default value for multicast hash bins */
Loading