@@ -11,7 +11,7 @@
#define PCI_DEVICE_ID_LOONGSON_GMAC 0x7a03
-static int loongson_default_data(struct plat_stmmacenet_data *plat)
+static void loongson_default_data(struct plat_stmmacenet_data *plat)
{
plat->clk_csr = 2; /* clk_csr_i = 20-35MHz & MDC = clk_csr_i/16 */
plat->has_gmac = 1;
@@ -20,16 +20,14 @@ static int loongson_default_data(struct plat_stmmacenet_data *plat)
/* Set default value for multicast hash bins */
plat->multicast_filter_bins = 256;
+ plat->mac_interface = PHY_INTERFACE_MODE_NA;
+
/* Set default value for unicast filter entries */
plat->unicast_filter_entries = 1;
/* Set the maxmtu to a default of JUMBO_LEN */
plat->maxmtu = JUMBO_LEN;
- /* Set default number of RX and TX queues to use */
- plat->tx_queues_to_use = 1;
- plat->rx_queues_to_use = 1;
-
/* Disable Priority config by default */
plat->tx_queues_cfg[0].use_prio = false;
plat->rx_queues_cfg[0].use_prio = false;
@@ -42,6 +40,14 @@ static int loongson_default_data(struct plat_stmmacenet_data *plat)
plat->dma_cfg->pbl = 32;
plat->dma_cfg->pblx8 = true;
+}
+
+static int loongson_gmac_data(struct plat_stmmacenet_data *plat)
+{
+ loongson_default_data(plat);
+
+ plat->tx_queues_to_use = 1;
+ plat->rx_queues_to_use = 1;
return 0;
}
@@ -111,11 +117,10 @@ static int loongson_dwmac_probe(struct pci_dev *pdev, const struct pci_device_id
}
plat->phy_interface = phy_mode;
- plat->mac_interface = PHY_INTERFACE_MODE_GMII;
pci_set_master(pdev);
- loongson_default_data(plat);
+ loongson_gmac_data(plat);
memset(&res, 0, sizeof(res));
res.addr = pcim_iomap_table(pdev)[0];