Ben Chuang | e987845 | 2021-11-18 16:33:05 +0800 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
| 2 | |
| 3 | /* Driver for Genesys Logic GL9750 */ |
| 4 | |
| 5 | #include <console/console.h> |
| 6 | #include <device/device.h> |
| 7 | #include <device/pci.h> |
| 8 | #include <device/pci_ops.h> |
| 9 | #include <device/pci_ids.h> |
| 10 | #include "gl9750.h" |
| 11 | |
| 12 | static void gl9750_enable(struct device *dev) |
| 13 | { |
| 14 | printk(BIOS_INFO, "GL9750: configure ASPM\n"); |
| 15 | |
| 16 | /* Set Vendor Config to be configurable */ |
| 17 | pci_or_config32(dev, CFG, CFG_EN); |
| 18 | |
| 19 | /* |
| 20 | * When both ASPM L0s and L1 are supported, GL9750 may not enter L1. |
| 21 | * So disable L0s support. |
| 22 | */ |
| 23 | pci_and_config32(dev, CFG2, ~CFG2_L0S_SUPPORT); |
| 24 | |
| 25 | /* Set Vendor Config to be non-configurable */ |
| 26 | pci_and_config32(dev, CFG, ~CFG_EN); |
| 27 | } |
| 28 | |
| 29 | static struct device_operations gl9750_ops = { |
| 30 | .read_resources = pci_dev_read_resources, |
| 31 | .set_resources = pci_dev_set_resources, |
| 32 | .enable_resources = pci_dev_enable_resources, |
| 33 | .ops_pci = &pci_dev_ops_pci, |
| 34 | .enable = gl9750_enable |
| 35 | }; |
| 36 | |
| 37 | static const unsigned short pci_device_ids[] = { |
| 38 | PCI_DEVICE_ID_GLI_9750, |
| 39 | 0 |
| 40 | }; |
| 41 | |
| 42 | static const struct pci_driver genesyslogic_gl9750 __pci_driver = { |
| 43 | .ops = &gl9750_ops, |
| 44 | .vendor = PCI_VENDOR_ID_GLI, |
| 45 | .devices = pci_device_ids, |
| 46 | }; |
| 47 | |
| 48 | struct chip_operations drivers_generic_genesyslogic_gl9750_ops = { |
| 49 | CHIP_NAME("Genesys Logic GL9750") |
| 50 | }; |