drivers/genesyslogic/gl9750: Add driver for Genesys Logic GL9750

The device is a PCIe Gen1 to SD 3.0 card reader controller to be
used in the Chromebook. The datasheet name is GL9750S and the revision
is 01.

The patch disables ASPM L0s.

BUG=b:206014046
TEST=Verify GL9750 enters L1 by observing CLKREQ# de-asserts.

Signed-off-by: Ben Chuang <benchuanggli@gmail.com>
Change-Id: I6d60cef41baade7457a159d3ce2f8d2e6b66e71c
Reviewed-on: https://review.coreboot.org/c/coreboot/+/59429
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
diff --git a/src/drivers/genesyslogic/gl9750/gl9750.c b/src/drivers/genesyslogic/gl9750/gl9750.c
new file mode 100644
index 0000000..ca5cd09
--- /dev/null
+++ b/src/drivers/genesyslogic/gl9750/gl9750.c
@@ -0,0 +1,50 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+
+/* Driver for Genesys Logic GL9750 */
+
+#include <console/console.h>
+#include <device/device.h>
+#include <device/pci.h>
+#include <device/pci_ops.h>
+#include <device/pci_ids.h>
+#include "gl9750.h"
+
+static void gl9750_enable(struct device *dev)
+{
+	printk(BIOS_INFO, "GL9750: configure ASPM\n");
+
+	/* Set Vendor Config to be configurable */
+	pci_or_config32(dev, CFG, CFG_EN);
+
+	/*
+	 * When both ASPM L0s and L1 are supported, GL9750 may not enter L1.
+	 * So disable L0s support.
+	 */
+	pci_and_config32(dev, CFG2, ~CFG2_L0S_SUPPORT);
+
+	/* Set Vendor Config to be non-configurable */
+	pci_and_config32(dev, CFG, ~CFG_EN);
+}
+
+static struct device_operations gl9750_ops = {
+	.read_resources		= pci_dev_read_resources,
+	.set_resources		= pci_dev_set_resources,
+	.enable_resources	= pci_dev_enable_resources,
+	.ops_pci		= &pci_dev_ops_pci,
+	.enable			= gl9750_enable
+};
+
+static const unsigned short pci_device_ids[] = {
+	PCI_DEVICE_ID_GLI_9750,
+	0
+};
+
+static const struct pci_driver genesyslogic_gl9750 __pci_driver = {
+	.ops		= &gl9750_ops,
+	.vendor		= PCI_VENDOR_ID_GLI,
+	.devices	= pci_device_ids,
+};
+
+struct chip_operations drivers_generic_genesyslogic_gl9750_ops = {
+	CHIP_NAME("Genesys Logic GL9750")
+};