drivers/generic/ioapic: Drop poor implementation

This disables MP table generation for the affected boards
since interrupt routing entries would now be completely missing.

The mechanism itself is flawed and redundant. The mapping
of integrated PCI devices' INTx pins to IOAPIC pins is
dependent of configuration registers and needs not appear
in the devicetree.cb files at all.

The write_smp_table implementation would skip writing
any entry delivering to destination IOAPIC ID 0. This
does not follow MP table specification.

There were duplicate calls to register_new_ioapic_gsi0(),
with another present under southbridge LPC device.

Change-Id: I383d55ba2bc0800423617215e0bfdfad5136e9ac
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/69488
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
This commit is contained in:
Kyösti Mälkki
2021-06-08 08:06:06 +03:00
parent 9202cab661
commit ca5a793ec3
14 changed files with 25 additions and 303 deletions

View File

@@ -1,2 +0,0 @@
config DRIVERS_GENERIC_IOAPIC
bool

View File

@@ -1 +0,0 @@
ramstage-$(CONFIG_DRIVERS_GENERIC_IOAPIC) += ioapic.c

View File

@@ -1,13 +0,0 @@
/* SPDX-License-Identifier: GPL-2.0-only */
#ifndef DRIVERS_GENERIC_IOAPIC_CHIP_H
#define DRIVERS_GENERIC_IOAPIC_CHIP_H
typedef struct drivers_generic_ioapic_config {
u32 version;
u8 apicid;
u8 have_isa_interrupts;
void *base;
} ioapic_config_t;
#endif

View File

@@ -1,42 +0,0 @@
/* SPDX-License-Identifier: GPL-2.0-only */
#include <device/device.h>
#include "chip.h"
#include <arch/ioapic.h>
static void ioapic_init(struct device *dev)
{
struct drivers_generic_ioapic_config *config = dev->chip_info;
if (!dev->enabled || !config)
return;
setup_ioapic(config->base, config->apicid);
}
static void ioapic_read_resources(struct device *dev)
{
struct drivers_generic_ioapic_config *config = (struct drivers_generic_ioapic_config *)dev->chip_info;
struct resource *res;
res = new_resource(dev, 0);
res->base = (resource_t)(uintptr_t)config->base;
res->size = 0x1000;
res->flags = IORESOURCE_MEM | IORESOURCE_ASSIGNED | IORESOURCE_FIXED;
}
static struct device_operations ioapic_operations = {
.read_resources = ioapic_read_resources,
.set_resources = noop_set_resources,
.init = ioapic_init,
};
static void enable_dev(struct device *dev)
{
dev->ops = &ioapic_operations;
}
struct chip_operations drivers_generic_ioapic_ops = {
CHIP_NAME("IOAPIC")
.enable_dev = enable_dev,
};