coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
gl9750.c
Go to the documentation of this file.
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  */
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 = {
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[] = {
39  0
40 };
41 
42 static const struct pci_driver genesyslogic_gl9750 __pci_driver = {
43  .ops = &gl9750_ops,
44  .vendor = PCI_VID_GLI,
45  .devices = pci_device_ids,
46 };
47 
49  CHIP_NAME("Genesys Logic GL9750")
50 };
#define printk(level,...)
Definition: stdlib.h:16
struct chip_operations drivers_generic_genesyslogic_gl9750_ops
Definition: gl9750.c:48
static struct device_operations gl9750_ops
Definition: gl9750.c:29
static void gl9750_enable(struct device *dev)
Definition: gl9750.c:12
static const unsigned short pci_device_ids[]
Definition: gl9750.c:37
static const struct pci_driver genesyslogic_gl9750 __pci_driver
Definition: gl9750.c:42
#define CFG_EN
Definition: gl9750.h:9
#define CFG2
Definition: gl9750.h:10
#define CFG2_L0S_SUPPORT
Definition: gl9750.h:11
#define CFG
Definition: gl9750.h:8
#define CHIP_NAME(X)
Definition: device.h:32
static __always_inline void pci_or_config32(const struct device *dev, u16 reg, u32 ormask)
Definition: pci_ops.h:191
static __always_inline void pci_and_config32(const struct device *dev, u16 reg, u32 andmask)
Definition: pci_ops.h:158
#define BIOS_INFO
BIOS_INFO - Expected events.
Definition: loglevel.h:113
void pci_dev_enable_resources(struct device *dev)
Definition: pci_device.c:721
void pci_dev_read_resources(struct device *dev)
Definition: pci_device.c:534
struct pci_operations pci_dev_ops_pci
Default device operation for PCI devices.
Definition: pci_device.c:911
void pci_dev_set_resources(struct device *dev)
Definition: pci_device.c:691
#define PCI_VID_GLI
Definition: pci_ids.h:2086
#define PCI_DID_GLI_9750
Definition: pci_ids.h:2087
void(* read_resources)(struct device *dev)
Definition: device.h:39
Definition: device.h:107