From 48415d5cf6f317aa7d7c30623ed2b36b29710d8e Mon Sep 17 00:00:00 2001 From: "Ronald G. Minnich" Date: Sun, 18 Jun 2006 01:29:42 +0000 Subject: add irq mapper support for OLPC and other boards that need this mapping done for the gx2 north. tested on OLPC. git-svn-id: svn://svn.coreboot.org/coreboot/trunk@2323 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1 --- src/mainboard/olpc/rev_a/Config.lb | 1 + src/northbridge/amd/gx2/chip.h | 1 + src/northbridge/amd/gx2/northbridge.c | 28 +++++++++++++++++++++++++++- 3 files changed, 29 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/mainboard/olpc/rev_a/Config.lb b/src/mainboard/olpc/rev_a/Config.lb index 86b1c0e482..98ff136b82 100644 --- a/src/mainboard/olpc/rev_a/Config.lb +++ b/src/mainboard/olpc/rev_a/Config.lb @@ -124,6 +124,7 @@ dir /pc80 config chip.h chip northbridge/amd/gx2 + register "irq_map" = "0xaa5b"; device apic_cluster 0 on chip cpu/amd/model_gx2 device apic 0 on end diff --git a/src/northbridge/amd/gx2/chip.h b/src/northbridge/amd/gx2/chip.h index 4e7ac3c1d7..46e6ae87be 100644 --- a/src/northbridge/amd/gx2/chip.h +++ b/src/northbridge/amd/gx2/chip.h @@ -1,5 +1,6 @@ struct northbridge_amd_gx2_config { + uint16_t irqmap; }; extern struct chip_operations northbridge_amd_gx2_ops; diff --git a/src/northbridge/amd/gx2/northbridge.c b/src/northbridge/amd/gx2/northbridge.c index fca31979dd..c52277a95a 100644 --- a/src/northbridge/amd/gx2/northbridge.c +++ b/src/northbridge/amd/gx2/northbridge.c @@ -169,7 +169,7 @@ setup_gx2_cache(void) void setup_gx2(void) { - int i; + unsigned long tmp, tmp2; msr_t msr; unsigned long size_kb, membytes; @@ -417,11 +417,36 @@ static struct device_operations cpu_bus_ops = { void chipsetInit (void); +/* note that dev is NOT used -- yet */ +static void irq_init(struct device *dev, uint16_t irq_map) { + + /* Set up IRQ steering */ + uint32_t pciAddr = 0x80000000 | (CHIPSET_DEV_NUM << 11) | 0x5C; + + printk_debug("OLPC REVA ENTER %s\n", __FUNCTION__); + + /* The IRQ steering values (in hex) are effectively dcba, where: + * represents the IRQ for INTA, + * represents the IRQ for INTB, + * represents the IRQ for INTC, and + * represents the IRQ for INTD. + * Thus, a value of irq_map = 0xAA5B translates to: + * INTA = IRQB (IRQ 11) + * INTB = IRQ5 (IRQ 5) + * INTC = IRQA (IRQ 10) + * INTD = IRQA (IRQ 10) + */ + outl(pciAddr & ~3, 0xCF8); + outl(irq_map, 0xCFC); +} + + static void enable_dev(struct device *dev) { printk_debug("gx2 north: enable_dev\n"); /* Set the operations if it is a special bus type */ if (dev->path.type == DEVICE_PATH_PCI_DOMAIN) { + struct northbridge_amd_gx2_config *nb = (struct northbridge_amd_gx2_config *)dev->chip_info; extern void cpubug(void); printk_debug("DEVICE_PATH_PCI_DOMAIN\n"); /* cpubug MUST be called before setup_gx2(), so we force the issue here */ @@ -432,6 +457,7 @@ static void enable_dev(struct device *dev) /* do this here for now -- this chip really breaks our device model */ setup_realmode_idt(); do_vsmbios(); + irq_init(dev, nb->irqmap); graphics_init(); dev->ops = &pci_domain_ops; pci_set_method(dev); -- cgit v1.2.3