9 #include "amd_pci_int_defs.h"
10 #include "amd_pci_int_types.h"
47 printk(
BIOS_ERR,
"Warning: Can't write PCI_INTR 0xC00/0xC01 registers because\n"
48 "'mainboard_picr_data' or 'mainboard_intr_data' tables are NULL\n");
53 printk(
BIOS_DEBUG,
"PCI_INTR tables: Writing registers C00/C01 for PIC mode PCI IRQ routing:\n"
54 "\tPCI_INTR_INDEX\t\tPCI_INTR_DATA\n");
64 printk(
BIOS_DEBUG,
"PCI_INTR tables: Writing registers C00/C01 for APIC mode PCI IRQ routing:\n"
65 "\tPCI_INTR_INDEX\t\tPCI_INTR_DATA\n");
93 " 'mainboard_pirq_data' structure does not exist\n");
107 if (target_dev ==
NULL)
115 if (int_pin < 1 || int_pin > 4)
124 pci_intr_idx = 0xBAD;
131 printk(
BIOS_SPEW,
"\tFound this device in pirq_data table entry %d\n", i);
139 if (pci_intr_idx == 0xBAD) {
140 printk(
BIOS_SPEW,
"PCI Devfn (0x%x) not found in pirq_data table\n", devfn);
142 }
else if (pci_intr_idx == 0x1F) {
143 printk(
BIOS_SPEW,
"Got index 0x1F (Not Connected), perhaps this device was defined wrong?\n");
146 printk(
BIOS_ERR,
"%s: got 0xC00/0xC01 table index 0x%x, max is 0x%x\n",
154 printk(
BIOS_SPEW,
"Got IRQ 0x1F (disabled), perhaps this device was defined wrong?\n");
175 "\tINT_LINE\t: 0x%X (IRQ %d)\n",
176 pci_intr_idx,
intr_types[pci_intr_idx], int_line, int_line);
178 printk(
BIOS_DEBUG,
"PCI_CFG IRQ: Finished writing PCI config space IRQ assignments\n");
const char * intr_types[]
#define printk(level,...)
void outb(u8 val, u16 port)
DEVTREE_CONST struct device *DEVTREE_CONST all_devices
Linked list of ALL devices.
void i8259_configure_irq_trigger(int int_num, int is_level_triggered)
Configure IRQ triggering in the i8259 compatible Interrupt Controller.
#define IRQ_LEVEL_TRIGGERED
static __always_inline u8 pci_read_config8(const struct device *dev, u16 reg)
static __always_inline void pci_write_config8(const struct device *dev, u16 reg, u8 val)
#define BIOS_DEBUG
BIOS_DEBUG - Verbose output.
#define BIOS_ERR
BIOS_ERR - System in incomplete state.
#define BIOS_SPEW
BIOS_SPEW - Excessively verbose output.
#define BIOS_WARNING
BIOS_WARNING - Bad configuration.
#define PCI_INTERRUPT_PIN
#define PCI_INTERRUPT_LINE
const char * pin_to_str(int pin)
Take an INT_PIN number (0, 1 - 4) and convert it to a string ("NO PIN", "PIN A" - "PIN D")
int get_pci_irq_pins(struct device *dev, struct device **parent_bdg)
Given a device structure 'dev', find its interrupt pin and its parent bridge 'parent_bdg' device stru...
void write_pci_int_idx(u8 index, int mode, u8 data)
void write_pci_cfg_irqs(void)
void write_pci_int_table(void)
u8 read_pci_int_idx(u8 index, int mode)
const struct pirq_struct * pirq_data_ptr
#define FCH_INT_TABLE_SIZE
DEVTREE_CONST struct device * next