linux/arch/x86/kernel/early-quirks.c

// SPDX-License-Identifier: GPL-2.0
/* Various workarounds for chipset bugs.
   This code runs very early and can't use the regular PCI subsystem
   The entries are keyed to PCI bridges which usually identify chipsets
   uniquely.
   This is only for whole classes of chipsets with specific problems which
   need early invasive action (e.g. before the timers are initialized).
   Most PCI device specific workarounds can be done later and should be
   in standard PCI quirks
   Mainboard specific bugs should be handled by DMI entries.
   CPU specific bugs in setup.c */

#include <linux/pci.h>
#include <linux/acpi.h>
#include <linux/delay.h>
#include <linux/pci_ids.h>
#include <linux/bcma/bcma.h>
#include <linux/bcma/bcma_regs.h>
#include <linux/platform_data/x86/apple.h>
#include <drm/intel/i915_drm.h>
#include <drm/intel/i915_pciids.h>
#include <asm/pci-direct.h>
#include <asm/dma.h>
#include <asm/io_apic.h>
#include <asm/apic.h>
#include <asm/hpet.h>
#include <asm/iommu.h>
#include <asm/gart.h>
#include <asm/irq_remapping.h>
#include <asm/early_ioremap.h>

static void __init fix_hypertransport_config(int num, int slot, int func)
{}

static void __init via_bugs(int  num, int slot, int func)
{}

#ifdef CONFIG_ACPI
#ifdef CONFIG_X86_IO_APIC

static int __init nvidia_hpet_check(struct acpi_table_header *header)
{}
#endif /* CONFIG_X86_IO_APIC */
#endif /* CONFIG_ACPI */

static void __init nvidia_bugs(int num, int slot, int func)
{}

#if defined(CONFIG_ACPI) && defined(CONFIG_X86_IO_APIC)
static u32 __init ati_ixp4x0_rev(int num, int slot, int func)
{}

static void __init ati_bugs(int num, int slot, int func)
{}

static u32 __init ati_sbx00_rev(int num, int slot, int func)
{}

static void __init ati_bugs_contd(int num, int slot, int func)
{}
#else
static void __init ati_bugs(int num, int slot, int func)
{
}

static void __init ati_bugs_contd(int num, int slot, int func)
{
}
#endif

static void __init intel_remapping_check(int num, int slot, int func)
{}

/*
 * Systems with Intel graphics controllers set aside memory exclusively
 * for gfx driver use.  This memory is not marked in the E820 as reserved
 * or as RAM, and so is subject to overlap from E820 manipulation later
 * in the boot process.  On some systems, MMIO space is allocated on top,
 * despite the efforts of the "RAM buffer" approach, which simply rounds
 * memory boundaries up to 64M to try to catch space that may decode
 * as RAM and so is not suitable for MMIO.
 */

#define KB(x)
#define MB(x)

static resource_size_t __init i830_tseg_size(void)
{}

static resource_size_t __init i845_tseg_size(void)
{}

static resource_size_t __init i85x_tseg_size(void)
{}

static resource_size_t __init i830_mem_size(void)
{}

static resource_size_t __init i85x_mem_size(void)
{}

/*
 * On 830/845/85x the stolen memory base isn't available in any
 * register. We need to calculate it as TOM-TSEG_SIZE-stolen_size.
 */
static resource_size_t __init i830_stolen_base(int num, int slot, int func,
					       resource_size_t stolen_size)
{}

static resource_size_t __init i845_stolen_base(int num, int slot, int func,
					       resource_size_t stolen_size)
{}

static resource_size_t __init i85x_stolen_base(int num, int slot, int func,
					       resource_size_t stolen_size)
{}

static resource_size_t __init i865_stolen_base(int num, int slot, int func,
					       resource_size_t stolen_size)
{}

static resource_size_t __init gen3_stolen_base(int num, int slot, int func,
					       resource_size_t stolen_size)
{}

static resource_size_t __init gen11_stolen_base(int num, int slot, int func,
						resource_size_t stolen_size)
{}

static resource_size_t __init i830_stolen_size(int num, int slot, int func)
{}

static resource_size_t __init gen3_stolen_size(int num, int slot, int func)
{}

static resource_size_t __init gen6_stolen_size(int num, int slot, int func)
{}

static resource_size_t __init gen8_stolen_size(int num, int slot, int func)
{}

static resource_size_t __init chv_stolen_size(int num, int slot, int func)
{}

static resource_size_t __init gen9_stolen_size(int num, int slot, int func)
{}

struct intel_early_ops {};

static const struct intel_early_ops i830_early_ops __initconst =;

static const struct intel_early_ops i845_early_ops __initconst =;

static const struct intel_early_ops i85x_early_ops __initconst =;

static const struct intel_early_ops i865_early_ops __initconst =;

static const struct intel_early_ops gen3_early_ops __initconst =;

static const struct intel_early_ops gen6_early_ops __initconst =;

static const struct intel_early_ops gen8_early_ops __initconst =;

static const struct intel_early_ops gen9_early_ops __initconst =;

static const struct intel_early_ops chv_early_ops __initconst =;

static const struct intel_early_ops gen11_early_ops __initconst =;

/* Intel integrated GPUs for which we need to reserve "stolen memory" */
static const struct pci_device_id intel_early_ids[] __initconst =;

struct resource intel_graphics_stolen_res __ro_after_init =;
EXPORT_SYMBOL();

static void __init
intel_graphics_stolen(int num, int slot, int func,
		      const struct intel_early_ops *early_ops)
{}

static void __init intel_graphics_quirks(int num, int slot, int func)
{}

static void __init force_disable_hpet(int num, int slot, int func)
{}

#define BCM4331_MMIO_SIZE
#define BCM4331_PM_CAP
#define bcma_aread32(reg)
#define bcma_awrite32(reg, val)

static void __init apple_airport_reset(int bus, int slot, int func)
{}

#define QFLAG_APPLY_ONCE
#define QFLAG_APPLIED
#define QFLAG_DONE
struct chipset {};

static struct chipset early_qrk[] __initdata =;

static void __init early_pci_scan_bus(int bus);

/**
 * check_dev_quirk - apply early quirks to a given PCI device
 * @num: bus number
 * @slot: slot number
 * @func: PCI function
 *
 * Check the vendor & device ID against the early quirks table.
 *
 * If the device is single function, let early_pci_scan_bus() know so we don't
 * poke at this device again.
 */
static int __init check_dev_quirk(int num, int slot, int func)
{}

static void __init early_pci_scan_bus(int bus)
{}

void __init early_quirks(void)
{}