coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
gl9763e.c
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 
3 /* Driver for Genesys Logic GL9763E */
4 
5 #include <console/console.h>
6 #include <device/device.h>
7 #include <device/path.h>
8 #include <device/pci.h>
9 #include <device/pci_ops.h>
10 #include <device/pci_ids.h>
11 #include "gl9763e.h"
12 
13 static void gl9763e_init(struct device *dev)
14 {
15  uint32_t ver;
16 
17  printk(BIOS_INFO, "GL9763E: init\n");
18  pci_dev_init(dev);
19 
20  /* Set VHS (Vendor Header Space) to be writable */
22  /* Set single AXI request */
24  /* Disable L0s support */
26 
27  if (CONFIG(DRIVERS_GENESYSLOGIC_GL9763E_L1_MAX))
28  /* Set L1 entry delay to MAX */
30 
31  /* Set SSC to 30000 ppm */
33  /* Enable SSC */
35  /* Check chip version */
36  ver = pci_read_config32(dev, HW_VER_2);
37  if ((ver & HW_VER_MASK) == REVISION_03) {
38  /* Set clock source for RX path */
40  }
41  /* Modify DS delay */
43  /* Disable Slow mode */
45  /* Set VHS to read-only */
47 }
48 
49 static struct device_operations gl9763e_ops = {
51  .set_resources = pci_dev_set_resources,
52  .enable_resources = pci_dev_enable_resources,
53  .ops_pci = &pci_dev_ops_pci,
54  .init = gl9763e_init,
55 };
56 
57 static const unsigned short pci_device_ids[] = {
59  0
60 };
61 
62 static const struct pci_driver genesyslogic_gl9763e __pci_driver = {
63  .ops = &gl9763e_ops,
64  .vendor = PCI_VID_GLI,
65  .devices = pci_device_ids,
66 };
67 
69  CHIP_NAME("Genesys Logic GL9763E")
70 };
#define printk(level,...)
Definition: stdlib.h:16
@ CONFIG
Definition: dsi_common.h:201
static void gl9763e_init(struct device *dev)
Definition: gl9763e.c:13
static const struct pci_driver genesyslogic_gl9763e __pci_driver
Definition: gl9763e.c:62
struct chip_operations drivers_generic_genesyslogic_ops
Definition: gl9763e.c:68
static struct device_operations gl9763e_ops
Definition: gl9763e.c:49
static const unsigned short pci_device_ids[]
Definition: gl9763e.c:57
#define VHS_REV_R
Definition: gl9763e.h:9
#define SCR
Definition: gl9763e.h:12
#define SLOW_MODE
Definition: gl9763e.h:23
#define CFG_REG_2_L0S
Definition: gl9763e.h:16
#define PLL_CTL
Definition: gl9763e.h:19
#define HW_VER_MASK
Definition: gl9763e.h:30
#define VHS
Definition: gl9763e.h:7
#define AFTER_OUTPUT_BUFF
Definition: gl9763e.h:35
#define CFG_REG_2_L1DLY_MAX
Definition: gl9763e.h:17
#define EMMC_CTL
Definition: gl9763e.h:22
#define CLK_SRC_MASK
Definition: gl9763e.h:34
#define REVISION_03
Definition: gl9763e.h:31
#define PLL_CTL_2_MAX_SSC_MASK
Definition: gl9763e.h:26
#define SD_CLKRX_DLY
Definition: gl9763e.h:33
#define VHS_REV_W
Definition: gl9763e.h:11
#define VHS_REV_MASK
Definition: gl9763e.h:8
#define HS400_RX_DELAY
Definition: gl9763e.h:37
#define HW_VER_2
Definition: gl9763e.h:29
#define PLL_CTL_SSC
Definition: gl9763e.h:20
#define PLL_CTL_2
Definition: gl9763e.h:25
#define HS400_RX_DELAY_MASK
Definition: gl9763e.h:36
#define MAX_SSC_30000PPM
Definition: gl9763e.h:27
#define SCR_AXI_REQ
Definition: gl9763e.h:13
#define CFG_REG_2
Definition: gl9763e.h:15
#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_update_config32(const struct device *dev, u16 reg, u32 mask, u32 or)
Definition: pci_ops.h:120
static __always_inline u32 pci_read_config32(const struct device *dev, u16 reg)
Definition: pci_ops.h:58
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_init(struct device *dev)
Default handler: only runs the relevant PCI BIOS.
Definition: pci_device.c:873
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_DID_GLI_9763E
Definition: pci_ids.h:2089
#define PCI_VID_GLI
Definition: pci_ids.h:2086
unsigned int uint32_t
Definition: stdint.h:14
void(* read_resources)(struct device *dev)
Definition: device.h:39
Definition: device.h:107