Giuseppe CAVALLARO | bfab27a | 2011-12-21 03:58:19 +0000 | [diff] [blame] | 1 | /******************************************************************************* |
| 2 | This contains the functions to handle the pci driver. |
| 3 | |
| 4 | Copyright (C) 2011-2012 Vayavya Labs Pvt Ltd |
| 5 | |
| 6 | This program is free software; you can redistribute it and/or modify it |
| 7 | under the terms and conditions of the GNU General Public License, |
| 8 | version 2, as published by the Free Software Foundation. |
| 9 | |
| 10 | This program is distributed in the hope it will be useful, but WITHOUT |
| 11 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
| 12 | FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for |
| 13 | more details. |
| 14 | |
Giuseppe CAVALLARO | bfab27a | 2011-12-21 03:58:19 +0000 | [diff] [blame] | 15 | The full GNU General Public License is included in this distribution in |
| 16 | the file called "COPYING". |
| 17 | |
| 18 | Author: Rayagond Kokatanur <rayagond@vayavyalabs.com> |
| 19 | Author: Giuseppe Cavallaro <peppe.cavallaro@st.com> |
| 20 | *******************************************************************************/ |
| 21 | |
| 22 | #include <linux/pci.h> |
Andy Shevchenko | 0763d95 | 2015-01-27 21:44:48 +0200 | [diff] [blame] | 23 | #include <linux/dmi.h> |
| 24 | |
Giuseppe CAVALLARO | bfab27a | 2011-12-21 03:58:19 +0000 | [diff] [blame] | 25 | #include "stmmac.h" |
| 26 | |
Andy Shevchenko | 0763d95 | 2015-01-27 21:44:48 +0200 | [diff] [blame] | 27 | /* |
| 28 | * This struct is used to associate PCI Function of MAC controller on a board, |
| 29 | * discovered via DMI, with the address of PHY connected to the MAC. The |
| 30 | * negative value of the address means that MAC controller is not connected |
| 31 | * with PHY. |
| 32 | */ |
Jan Kiszka | 8d78b69 | 2017-06-22 08:18:01 +0200 | [diff] [blame] | 33 | struct stmmac_pci_func_data { |
Andy Shevchenko | 0763d95 | 2015-01-27 21:44:48 +0200 | [diff] [blame] | 34 | unsigned int func; |
| 35 | int phy_addr; |
| 36 | }; |
| 37 | |
Jan Kiszka | 8d78b69 | 2017-06-22 08:18:01 +0200 | [diff] [blame] | 38 | struct stmmac_pci_dmi_data { |
| 39 | const struct stmmac_pci_func_data *func; |
| 40 | size_t nfuncs; |
| 41 | }; |
| 42 | |
Kweh, Hock Leong | 5b99a6b | 2015-01-27 21:44:47 +0200 | [diff] [blame] | 43 | struct stmmac_pci_info { |
Jan Kiszka | 7bc519b | 2017-06-22 08:18:00 +0200 | [diff] [blame] | 44 | int (*setup)(struct pci_dev *pdev, struct plat_stmmacenet_data *plat); |
Kweh, Hock Leong | 5b99a6b | 2015-01-27 21:44:47 +0200 | [diff] [blame] | 45 | }; |
| 46 | |
Jan Kiszka | c5d5287 | 2017-06-22 08:17:57 +0200 | [diff] [blame] | 47 | static int stmmac_pci_find_phy_addr(struct pci_dev *pdev, |
Jan Kiszka | 8d78b69 | 2017-06-22 08:18:01 +0200 | [diff] [blame] | 48 | const struct dmi_system_id *dmi_list) |
Andy Shevchenko | 0763d95 | 2015-01-27 21:44:48 +0200 | [diff] [blame] | 49 | { |
Jan Kiszka | 8d78b69 | 2017-06-22 08:18:01 +0200 | [diff] [blame] | 50 | const struct stmmac_pci_func_data *func_data; |
| 51 | const struct stmmac_pci_dmi_data *dmi_data; |
| 52 | const struct dmi_system_id *dmi_id; |
| 53 | int func = PCI_FUNC(pdev->devfn); |
| 54 | size_t n; |
Andy Shevchenko | 0763d95 | 2015-01-27 21:44:48 +0200 | [diff] [blame] | 55 | |
Jan Kiszka | 8d78b69 | 2017-06-22 08:18:01 +0200 | [diff] [blame] | 56 | dmi_id = dmi_first_match(dmi_list); |
| 57 | if (!dmi_id) |
Jan Kiszka | c5f657e | 2017-06-22 08:17:59 +0200 | [diff] [blame] | 58 | return -ENODEV; |
Andy Shevchenko | 0763d95 | 2015-01-27 21:44:48 +0200 | [diff] [blame] | 59 | |
Jan Kiszka | 8d78b69 | 2017-06-22 08:18:01 +0200 | [diff] [blame] | 60 | dmi_data = dmi_id->driver_data; |
| 61 | func_data = dmi_data->func; |
| 62 | |
| 63 | for (n = 0; n < dmi_data->nfuncs; n++, func_data++) |
| 64 | if (func_data->func == func) |
| 65 | return func_data->phy_addr; |
Andy Shevchenko | 0763d95 | 2015-01-27 21:44:48 +0200 | [diff] [blame] | 66 | |
| 67 | return -ENODEV; |
| 68 | } |
| 69 | |
Andy Shevchenko | 70fe443 | 2017-05-08 17:14:22 +0300 | [diff] [blame] | 70 | static void common_default_data(struct plat_stmmacenet_data *plat) |
Giuseppe CAVALLARO | bfab27a | 2011-12-21 03:58:19 +0000 | [diff] [blame] | 71 | { |
Andy Shevchenko | c4b2b9a | 2014-11-28 15:40:56 +0200 | [diff] [blame] | 72 | plat->clk_csr = 2; /* clk_csr_i = 20-35MHz & MDC = clk_csr_i/16 */ |
| 73 | plat->has_gmac = 1; |
| 74 | plat->force_sf_dma_mode = 1; |
Andy Shevchenko | 1e19e08 | 2014-10-31 18:28:03 +0200 | [diff] [blame] | 75 | |
Andy Shevchenko | c4b2b9a | 2014-11-28 15:40:56 +0200 | [diff] [blame] | 76 | plat->mdio_bus_data->phy_reset = NULL; |
| 77 | plat->mdio_bus_data->phy_mask = 0; |
Giuseppe CAVALLARO | bfab27a | 2011-12-21 03:58:19 +0000 | [diff] [blame] | 78 | |
Andy Shevchenko | 1e19e08 | 2014-10-31 18:28:03 +0200 | [diff] [blame] | 79 | /* Set default value for multicast hash bins */ |
Andy Shevchenko | c4b2b9a | 2014-11-28 15:40:56 +0200 | [diff] [blame] | 80 | plat->multicast_filter_bins = HASH_TABLE_SIZE; |
Andy Shevchenko | 1e19e08 | 2014-10-31 18:28:03 +0200 | [diff] [blame] | 81 | |
| 82 | /* Set default value for unicast filter entries */ |
Andy Shevchenko | c4b2b9a | 2014-11-28 15:40:56 +0200 | [diff] [blame] | 83 | plat->unicast_filter_entries = 1; |
Kweh, Hock Leong | a2cd64f | 2017-01-07 17:32:03 +0800 | [diff] [blame] | 84 | |
| 85 | /* Set the maxmtu to a default of JUMBO_LEN */ |
| 86 | plat->maxmtu = JUMBO_LEN; |
Joao Pinto | 26d6851 | 2017-03-13 10:07:07 +0000 | [diff] [blame] | 87 | |
| 88 | /* Set default number of RX and TX queues to use */ |
| 89 | plat->tx_queues_to_use = 1; |
| 90 | plat->rx_queues_to_use = 1; |
Joao Pinto | a8f5102 | 2017-03-17 16:11:06 +0000 | [diff] [blame] | 91 | |
| 92 | /* Disable Priority config by default */ |
| 93 | plat->tx_queues_cfg[0].use_prio = false; |
| 94 | plat->rx_queues_cfg[0].use_prio = false; |
Joao Pinto | abe80fd | 2017-03-17 16:11:07 +0000 | [diff] [blame] | 95 | |
| 96 | /* Disable RX queues routing by default */ |
| 97 | plat->rx_queues_cfg[0].pkt_route = 0x0; |
Giuseppe CAVALLARO | bfab27a | 2011-12-21 03:58:19 +0000 | [diff] [blame] | 98 | } |
| 99 | |
Jan Kiszka | b6a4c8f0 | 2017-06-22 08:17:58 +0200 | [diff] [blame] | 100 | static int stmmac_default_data(struct pci_dev *pdev, |
Jan Kiszka | 7bc519b | 2017-06-22 08:18:00 +0200 | [diff] [blame] | 101 | struct plat_stmmacenet_data *plat) |
Andy Shevchenko | 70fe443 | 2017-05-08 17:14:22 +0300 | [diff] [blame] | 102 | { |
| 103 | /* Set common default data first */ |
| 104 | common_default_data(plat); |
| 105 | |
| 106 | plat->bus_id = 1; |
| 107 | plat->phy_addr = 0; |
| 108 | plat->interface = PHY_INTERFACE_MODE_GMII; |
| 109 | |
| 110 | plat->dma_cfg->pbl = 32; |
| 111 | plat->dma_cfg->pblx8 = true; |
| 112 | /* TODO: AXI */ |
Jan Kiszka | b6a4c8f0 | 2017-06-22 08:17:58 +0200 | [diff] [blame] | 113 | |
| 114 | return 0; |
Andy Shevchenko | 70fe443 | 2017-05-08 17:14:22 +0300 | [diff] [blame] | 115 | } |
| 116 | |
Jan Kiszka | b6a4c8f0 | 2017-06-22 08:17:58 +0200 | [diff] [blame] | 117 | static const struct stmmac_pci_info stmmac_pci_info = { |
| 118 | .setup = stmmac_default_data, |
| 119 | }; |
| 120 | |
Jan Kiszka | 8d78b69 | 2017-06-22 08:18:01 +0200 | [diff] [blame] | 121 | static const struct stmmac_pci_func_data galileo_stmmac_func_data[] = { |
Andy Shevchenko | 0763d95 | 2015-01-27 21:44:48 +0200 | [diff] [blame] | 122 | { |
Jan Kiszka | 8d78b69 | 2017-06-22 08:18:01 +0200 | [diff] [blame] | 123 | .func = 6, |
| 124 | .phy_addr = 1, |
| 125 | }, |
| 126 | }; |
| 127 | |
| 128 | static const struct stmmac_pci_dmi_data galileo_stmmac_dmi_data = { |
| 129 | .func = galileo_stmmac_func_data, |
| 130 | .nfuncs = ARRAY_SIZE(galileo_stmmac_func_data), |
| 131 | }; |
| 132 | |
| 133 | static const struct stmmac_pci_func_data iot2040_stmmac_func_data[] = { |
| 134 | { |
Andy Shevchenko | 0763d95 | 2015-01-27 21:44:48 +0200 | [diff] [blame] | 135 | .func = 6, |
| 136 | .phy_addr = 1, |
| 137 | }, |
| 138 | { |
Jan Kiszka | 212c7fd | 2017-05-02 09:58:00 +0200 | [diff] [blame] | 139 | .func = 7, |
| 140 | .phy_addr = 1, |
| 141 | }, |
Jan Kiszka | 8d78b69 | 2017-06-22 08:18:01 +0200 | [diff] [blame] | 142 | }; |
| 143 | |
| 144 | static const struct stmmac_pci_dmi_data iot2040_stmmac_dmi_data = { |
| 145 | .func = iot2040_stmmac_func_data, |
| 146 | .nfuncs = ARRAY_SIZE(iot2040_stmmac_func_data), |
| 147 | }; |
| 148 | |
| 149 | static const struct dmi_system_id quark_pci_dmi[] = { |
| 150 | { |
| 151 | .matches = { |
| 152 | DMI_EXACT_MATCH(DMI_BOARD_NAME, "Galileo"), |
| 153 | }, |
| 154 | .driver_data = (void *)&galileo_stmmac_dmi_data, |
| 155 | }, |
| 156 | { |
| 157 | .matches = { |
| 158 | DMI_EXACT_MATCH(DMI_BOARD_NAME, "GalileoGen2"), |
| 159 | }, |
| 160 | .driver_data = (void *)&galileo_stmmac_dmi_data, |
| 161 | }, |
| 162 | { |
| 163 | .matches = { |
| 164 | DMI_EXACT_MATCH(DMI_BOARD_NAME, "SIMATIC IOT2000"), |
| 165 | DMI_EXACT_MATCH(DMI_BOARD_ASSET_TAG, |
| 166 | "6ES7647-0AA00-0YA2"), |
| 167 | }, |
| 168 | .driver_data = (void *)&galileo_stmmac_dmi_data, |
| 169 | }, |
| 170 | { |
| 171 | .matches = { |
| 172 | DMI_EXACT_MATCH(DMI_BOARD_NAME, "SIMATIC IOT2000"), |
| 173 | DMI_EXACT_MATCH(DMI_BOARD_ASSET_TAG, |
| 174 | "6ES7647-0AA00-1YA2"), |
| 175 | }, |
| 176 | .driver_data = (void *)&iot2040_stmmac_dmi_data, |
| 177 | }, |
Andy Shevchenko | 0763d95 | 2015-01-27 21:44:48 +0200 | [diff] [blame] | 178 | {} |
| 179 | }; |
| 180 | |
Jan Kiszka | 7bc519b | 2017-06-22 08:18:00 +0200 | [diff] [blame] | 181 | static int quark_default_data(struct pci_dev *pdev, |
| 182 | struct plat_stmmacenet_data *plat) |
| 183 | { |
| 184 | int ret; |
| 185 | |
| 186 | /* Set common default data first */ |
| 187 | common_default_data(plat); |
| 188 | |
| 189 | /* |
| 190 | * Refuse to load the driver and register net device if MAC controller |
| 191 | * does not connect to any PHY interface. |
| 192 | */ |
Jan Kiszka | 8d78b69 | 2017-06-22 08:18:01 +0200 | [diff] [blame] | 193 | ret = stmmac_pci_find_phy_addr(pdev, quark_pci_dmi); |
Jan Kiszka | 7bc519b | 2017-06-22 08:18:00 +0200 | [diff] [blame] | 194 | if (ret < 0) { |
| 195 | /* Return error to the caller on DMI enabled boards. */ |
| 196 | if (dmi_get_system_info(DMI_BOARD_NAME)) |
| 197 | return ret; |
| 198 | |
| 199 | /* |
| 200 | * Galileo boards with old firmware don't support DMI. We always |
| 201 | * use 1 here as PHY address, so at least the first found MAC |
| 202 | * controller would be probed. |
| 203 | */ |
| 204 | ret = 1; |
| 205 | } |
| 206 | |
| 207 | plat->bus_id = PCI_DEVID(pdev->bus->number, pdev->devfn); |
| 208 | plat->phy_addr = ret; |
| 209 | plat->interface = PHY_INTERFACE_MODE_RMII; |
| 210 | |
| 211 | plat->dma_cfg->pbl = 16; |
| 212 | plat->dma_cfg->pblx8 = true; |
| 213 | plat->dma_cfg->fixed_burst = 1; |
| 214 | /* AXI (TODO) */ |
| 215 | |
| 216 | return 0; |
| 217 | } |
| 218 | |
Jan Kiszka | c5d5287 | 2017-06-22 08:17:57 +0200 | [diff] [blame] | 219 | static const struct stmmac_pci_info quark_pci_info = { |
Kweh, Hock Leong | 5b99a6b | 2015-01-27 21:44:47 +0200 | [diff] [blame] | 220 | .setup = quark_default_data, |
| 221 | }; |
| 222 | |
Giuseppe CAVALLARO | bfab27a | 2011-12-21 03:58:19 +0000 | [diff] [blame] | 223 | /** |
| 224 | * stmmac_pci_probe |
| 225 | * |
| 226 | * @pdev: pci device pointer |
| 227 | * @id: pointer to table of device id/id's. |
| 228 | * |
| 229 | * Description: This probing function gets called for all PCI devices which |
| 230 | * match the ID table and are not "owned" by other driver yet. This function |
| 231 | * gets passed a "struct pci_dev *" for each device whose entry in the ID table |
| 232 | * matches the device. The probe functions returns zero when the driver choose |
| 233 | * to take "ownership" of the device or an error code(-ve no) otherwise. |
| 234 | */ |
Bill Pemberton | 979857b | 2012-12-03 09:23:34 -0500 | [diff] [blame] | 235 | static int stmmac_pci_probe(struct pci_dev *pdev, |
Greg Kroah-Hartman | 1dd06ae | 2012-12-06 14:30:56 +0000 | [diff] [blame] | 236 | const struct pci_device_id *id) |
Giuseppe CAVALLARO | bfab27a | 2011-12-21 03:58:19 +0000 | [diff] [blame] | 237 | { |
Kweh, Hock Leong | 5b99a6b | 2015-01-27 21:44:47 +0200 | [diff] [blame] | 238 | struct stmmac_pci_info *info = (struct stmmac_pci_info *)id->driver_data; |
Andy Shevchenko | c4b2b9a | 2014-11-28 15:40:56 +0200 | [diff] [blame] | 239 | struct plat_stmmacenet_data *plat; |
Joachim Eastwood | e56788c | 2015-05-20 20:03:07 +0200 | [diff] [blame] | 240 | struct stmmac_resources res; |
Giuseppe CAVALLARO | bfab27a | 2011-12-21 03:58:19 +0000 | [diff] [blame] | 241 | int i; |
Andy Shevchenko | 2a3e8e9 | 2014-11-05 12:27:28 +0200 | [diff] [blame] | 242 | int ret; |
Giuseppe CAVALLARO | bfab27a | 2011-12-21 03:58:19 +0000 | [diff] [blame] | 243 | |
Andy Shevchenko | c4b2b9a | 2014-11-28 15:40:56 +0200 | [diff] [blame] | 244 | plat = devm_kzalloc(&pdev->dev, sizeof(*plat), GFP_KERNEL); |
| 245 | if (!plat) |
| 246 | return -ENOMEM; |
| 247 | |
| 248 | plat->mdio_bus_data = devm_kzalloc(&pdev->dev, |
| 249 | sizeof(*plat->mdio_bus_data), |
| 250 | GFP_KERNEL); |
| 251 | if (!plat->mdio_bus_data) |
| 252 | return -ENOMEM; |
| 253 | |
| 254 | plat->dma_cfg = devm_kzalloc(&pdev->dev, sizeof(*plat->dma_cfg), |
| 255 | GFP_KERNEL); |
| 256 | if (!plat->dma_cfg) |
| 257 | return -ENOMEM; |
| 258 | |
Giuseppe CAVALLARO | bfab27a | 2011-12-21 03:58:19 +0000 | [diff] [blame] | 259 | /* Enable pci device */ |
Andy Shevchenko | 2a3e8e9 | 2014-11-05 12:27:28 +0200 | [diff] [blame] | 260 | ret = pcim_enable_device(pdev); |
Giuseppe CAVALLARO | bfab27a | 2011-12-21 03:58:19 +0000 | [diff] [blame] | 261 | if (ret) { |
Andy Shevchenko | 7627fc0 | 2014-11-05 12:27:29 +0200 | [diff] [blame] | 262 | dev_err(&pdev->dev, "%s: ERROR: failed to enable device\n", |
| 263 | __func__); |
Giuseppe CAVALLARO | bfab27a | 2011-12-21 03:58:19 +0000 | [diff] [blame] | 264 | return ret; |
| 265 | } |
Giuseppe CAVALLARO | bfab27a | 2011-12-21 03:58:19 +0000 | [diff] [blame] | 266 | |
| 267 | /* Get the base address of device */ |
Andy Shevchenko | 295f9d0 | 2014-11-05 12:27:26 +0200 | [diff] [blame] | 268 | for (i = 0; i <= PCI_STD_RESOURCE_END; i++) { |
Giuseppe CAVALLARO | bfab27a | 2011-12-21 03:58:19 +0000 | [diff] [blame] | 269 | if (pci_resource_len(pdev, i) == 0) |
| 270 | continue; |
Andy Shevchenko | 2a3e8e9 | 2014-11-05 12:27:28 +0200 | [diff] [blame] | 271 | ret = pcim_iomap_regions(pdev, BIT(i), pci_name(pdev)); |
| 272 | if (ret) |
| 273 | return ret; |
Giuseppe CAVALLARO | bfab27a | 2011-12-21 03:58:19 +0000 | [diff] [blame] | 274 | break; |
| 275 | } |
Andy Shevchenko | 2a3e8e9 | 2014-11-05 12:27:28 +0200 | [diff] [blame] | 276 | |
Giuseppe CAVALLARO | bfab27a | 2011-12-21 03:58:19 +0000 | [diff] [blame] | 277 | pci_set_master(pdev); |
| 278 | |
Jan Kiszka | 7bc519b | 2017-06-22 08:18:00 +0200 | [diff] [blame] | 279 | ret = info->setup(pdev, plat); |
Jan Kiszka | b6a4c8f0 | 2017-06-22 08:17:58 +0200 | [diff] [blame] | 280 | if (ret) |
| 281 | return ret; |
Giuseppe CAVALLARO | bfab27a | 2011-12-21 03:58:19 +0000 | [diff] [blame] | 282 | |
Kweh, Hock Leong | d2a029b | 2015-01-27 21:44:49 +0200 | [diff] [blame] | 283 | pci_enable_msi(pdev); |
| 284 | |
Joachim Eastwood | e56788c | 2015-05-20 20:03:07 +0200 | [diff] [blame] | 285 | memset(&res, 0, sizeof(res)); |
| 286 | res.addr = pcim_iomap_table(pdev)[i]; |
| 287 | res.wol_irq = pdev->irq; |
| 288 | res.irq = pdev->irq; |
| 289 | |
Joachim Eastwood | 15ffac7 | 2015-05-20 20:03:08 +0200 | [diff] [blame] | 290 | return stmmac_dvr_probe(&pdev->dev, plat, &res); |
Giuseppe CAVALLARO | bfab27a | 2011-12-21 03:58:19 +0000 | [diff] [blame] | 291 | } |
| 292 | |
| 293 | /** |
Ben Hutchings | 49ce9c2 | 2012-07-10 10:56:00 +0000 | [diff] [blame] | 294 | * stmmac_pci_remove |
Giuseppe CAVALLARO | bfab27a | 2011-12-21 03:58:19 +0000 | [diff] [blame] | 295 | * |
| 296 | * @pdev: platform device pointer |
| 297 | * Description: this function calls the main to free the net resources |
| 298 | * and releases the PCI resources. |
| 299 | */ |
Bill Pemberton | 979857b | 2012-12-03 09:23:34 -0500 | [diff] [blame] | 300 | static void stmmac_pci_remove(struct pci_dev *pdev) |
Giuseppe CAVALLARO | bfab27a | 2011-12-21 03:58:19 +0000 | [diff] [blame] | 301 | { |
Joachim Eastwood | f4e7bd8 | 2016-05-01 22:58:19 +0200 | [diff] [blame] | 302 | stmmac_dvr_remove(&pdev->dev); |
Giuseppe CAVALLARO | bfab27a | 2011-12-21 03:58:19 +0000 | [diff] [blame] | 303 | } |
| 304 | |
Joachim Eastwood | f4e7bd8 | 2016-05-01 22:58:19 +0200 | [diff] [blame] | 305 | static SIMPLE_DEV_PM_OPS(stmmac_pm_ops, stmmac_suspend, stmmac_resume); |
Andy Shevchenko | 3be3d81 | 2014-11-05 12:27:27 +0200 | [diff] [blame] | 306 | |
Jan Kiszka | b6a4c8f0 | 2017-06-22 08:17:58 +0200 | [diff] [blame] | 307 | /* synthetic ID, no official vendor */ |
| 308 | #define PCI_VENDOR_ID_STMMAC 0x700 |
| 309 | |
Kweh, Hock Leong | 5b99a6b | 2015-01-27 21:44:47 +0200 | [diff] [blame] | 310 | #define STMMAC_QUARK_ID 0x0937 |
Giuseppe CAVALLARO | bfab27a | 2011-12-21 03:58:19 +0000 | [diff] [blame] | 311 | #define STMMAC_DEVICE_ID 0x1108 |
| 312 | |
Jan Kiszka | b6a4c8f0 | 2017-06-22 08:17:58 +0200 | [diff] [blame] | 313 | #define STMMAC_DEVICE(vendor_id, dev_id, info) { \ |
| 314 | PCI_VDEVICE(vendor_id, dev_id), \ |
| 315 | .driver_data = (kernel_ulong_t)&info \ |
| 316 | } |
| 317 | |
Benoit Taine | 9baa3c3 | 2014-08-08 15:56:03 +0200 | [diff] [blame] | 318 | static const struct pci_device_id stmmac_id_table[] = { |
Jan Kiszka | b6a4c8f0 | 2017-06-22 08:17:58 +0200 | [diff] [blame] | 319 | STMMAC_DEVICE(STMMAC, STMMAC_DEVICE_ID, stmmac_pci_info), |
| 320 | STMMAC_DEVICE(STMICRO, PCI_DEVICE_ID_STMICRO_MAC, stmmac_pci_info), |
| 321 | STMMAC_DEVICE(INTEL, STMMAC_QUARK_ID, quark_pci_info), |
Alessandro Rubini | 5437f4b | 2012-01-23 23:08:56 +0000 | [diff] [blame] | 322 | {} |
Giuseppe CAVALLARO | bfab27a | 2011-12-21 03:58:19 +0000 | [diff] [blame] | 323 | }; |
| 324 | |
| 325 | MODULE_DEVICE_TABLE(pci, stmmac_id_table); |
| 326 | |
Andy Shevchenko | b2e2f0c | 2014-11-10 12:38:59 +0200 | [diff] [blame] | 327 | static struct pci_driver stmmac_pci_driver = { |
Giuseppe CAVALLARO | bfab27a | 2011-12-21 03:58:19 +0000 | [diff] [blame] | 328 | .name = STMMAC_RESOURCE_NAME, |
| 329 | .id_table = stmmac_id_table, |
| 330 | .probe = stmmac_pci_probe, |
Bill Pemberton | 979857b | 2012-12-03 09:23:34 -0500 | [diff] [blame] | 331 | .remove = stmmac_pci_remove, |
Andy Shevchenko | 3be3d81 | 2014-11-05 12:27:27 +0200 | [diff] [blame] | 332 | .driver = { |
| 333 | .pm = &stmmac_pm_ops, |
| 334 | }, |
Giuseppe CAVALLARO | bfab27a | 2011-12-21 03:58:19 +0000 | [diff] [blame] | 335 | }; |
| 336 | |
Andy Shevchenko | b2e2f0c | 2014-11-10 12:38:59 +0200 | [diff] [blame] | 337 | module_pci_driver(stmmac_pci_driver); |
| 338 | |
Giuseppe CAVALLARO | bfab27a | 2011-12-21 03:58:19 +0000 | [diff] [blame] | 339 | MODULE_DESCRIPTION("STMMAC 10/100/1000 Ethernet PCI driver"); |
| 340 | MODULE_AUTHOR("Rayagond Kokatanur <rayagond.kokatanur@vayavyalabs.com>"); |
| 341 | MODULE_AUTHOR("Giuseppe Cavallaro <peppe.cavallaro@st.com>"); |
| 342 | MODULE_LICENSE("GPL"); |