From 610b680154fbe679ab4130af4dc5adf5c04c1487 Mon Sep 17 00:00:00 2001 From: Jeremy Soller Date: Thu, 10 Oct 2019 15:36:15 -0600 Subject: [PATCH] Remove thunderbolt driver Change-Id: I2cfda79ab838e76170219e9081daf8218b4c09fc --- src/drivers/thunderbolt/Kconfig | 4 - src/drivers/thunderbolt/Makefile.inc | 1 - src/drivers/thunderbolt/thunderbolt.c | 110 -------------------------- src/mainboard/system76/cml-u/Kconfig | 1 - 4 files changed, 116 deletions(-) delete mode 100644 src/drivers/thunderbolt/Kconfig delete mode 100644 src/drivers/thunderbolt/Makefile.inc delete mode 100644 src/drivers/thunderbolt/thunderbolt.c diff --git a/src/drivers/thunderbolt/Kconfig b/src/drivers/thunderbolt/Kconfig deleted file mode 100644 index f64e6cb0a9..0000000000 --- a/src/drivers/thunderbolt/Kconfig +++ /dev/null @@ -1,4 +0,0 @@ -config DRIVERS_THUNDERBOLT - bool - help - Thunderbolt support diff --git a/src/drivers/thunderbolt/Makefile.inc b/src/drivers/thunderbolt/Makefile.inc deleted file mode 100644 index 623b8973d0..0000000000 --- a/src/drivers/thunderbolt/Makefile.inc +++ /dev/null @@ -1 +0,0 @@ -ramstage-$(CONFIG_DRIVERS_THUNDERBOLT) += thunderbolt.c diff --git a/src/drivers/thunderbolt/thunderbolt.c b/src/drivers/thunderbolt/thunderbolt.c deleted file mode 100644 index db463e0e58..0000000000 --- a/src/drivers/thunderbolt/thunderbolt.c +++ /dev/null @@ -1,110 +0,0 @@ -/* - * This file is part of the coreboot project. - * - * Copyright (C) 2019 System76. - * Copyright (C) 2017-2018 Intel Corporation. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; version 2 of the License. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - */ - -#include -#include -#include -#include -#include -#include -#include - -static void slot_dev_read_resources(struct device *dev) -{ - struct resource *resource; - - // Add 256 MiB of memory space - resource = new_resource(dev, 0x10); - resource->size = 1 << 28; - resource->align = 22; - resource->gran = 22; - resource->limit = 0xffffffff; - resource->flags |= IORESOURCE_MEM; - - // Add 256 MiB of prefetchable memory space - resource = new_resource(dev, 0x14); - resource->size = 1 << 28; - resource->align = 22; - resource->gran = 22; - resource->limit = 0xffffffff; - resource->flags |= IORESOURCE_MEM | IORESOURCE_PREFETCH; - - // Add 8 KiB of I/O space - resource = new_resource(dev, 0x18); - resource->size = 1 << 13; - resource->align = 12; - resource->gran = 12; - resource->limit = 0xffff; - resource->flags |= IORESOURCE_IO; -} - -static struct device_operations slot_dev_ops = { - .read_resources = slot_dev_read_resources, -}; - -static bool tbt_is_hotplug_bridge(struct device *dev) { - return PCI_SLOT(dev->path.pci.devfn) == 1; -} - -static void tbt_pciexp_scan_bridge(struct device *dev) { - printk(BIOS_DEBUG, "%s: %s: scan bridge\n", __func__, dev_path(dev)); - - bool is_hotplug = tbt_is_hotplug_bridge(dev); - if (is_hotplug) { - /* Add hotplug buses, must happen before bus scan */ - printk(BIOS_DEBUG, "%s: %s: add hotplug buses\n", __func__, dev_path(dev)); - dev->hotplug_buses = 32; - } - - /* Normal PCIe Scan */ - pciexp_scan_bridge(dev); - - if (is_hotplug) { - /* Add dummy slot to preserve resources, must happen after bus scan */ - printk(BIOS_DEBUG, "%s: %s: add dummy device\n", __func__, dev_path(dev)); - struct device *slot; - struct device_path slot_path = { .type = DEVICE_PATH_NONE }; - slot = alloc_dev(dev->link_list, &slot_path); - slot->ops = &slot_dev_ops; - } -} - -static struct pci_operations pcie_ops = { - .set_subsystem = pci_dev_set_subsystem, -}; - -static struct device_operations device_ops = { - .read_resources = pci_bus_read_resources, - .set_resources = pci_dev_set_resources, - .enable_resources = pci_bus_enable_resources, - .init = 0, - .scan_bus = tbt_pciexp_scan_bridge, - .enable = 0, - .reset_bus = pci_bus_reset, - .ops_pci = &pcie_ops, -}; - -static const unsigned short pcie_device_ids[] = { - // JHL7540 Thunderbolt 3 Bridge - 0x15e7, - 0 -}; - -static const struct pci_driver tbt_pcie __pci_driver = { - .ops = &device_ops, - .vendor = PCI_VENDOR_ID_INTEL, - .devices = pcie_device_ids, -}; diff --git a/src/mainboard/system76/cml-u/Kconfig b/src/mainboard/system76/cml-u/Kconfig index 4b51708bdc..58adab8c4b 100644 --- a/src/mainboard/system76/cml-u/Kconfig +++ b/src/mainboard/system76/cml-u/Kconfig @@ -4,7 +4,6 @@ config BOARD_SPECIFIC_OPTIONS def_bool y select ADD_FSP_BINARIES select BOARD_ROMSIZE_KB_16384 - select DRIVERS_THUNDERBOLT select EC_ACPI select EXCLUDE_EMMC_INTERFACE select HAVE_ACPI_RESUME