blob: ca5cd096a5e82baee307416f495a00493cf0a750 [file] [log] [blame]
Ben Chuange9878452021-11-18 16:33:05 +08001/* 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
12static 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
29static 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
37static const unsigned short pci_device_ids[] = {
38 PCI_DEVICE_ID_GLI_9750,
39 0
40};
41
42static 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
48struct chip_operations drivers_generic_genesyslogic_gl9750_ops = {
49 CHIP_NAME("Genesys Logic GL9750")
50};