diff options
author | Kevin Paul Herbert <kph@meraki.net> | 2014-12-24 18:43:20 -0800 |
---|---|---|
committer | Alexandru Gagniuc <mr.nuke.me@gmail.com> | 2015-02-15 08:50:22 +0100 |
commit | bde6d309dfafe58732ec46314a2d4c08974b62d4 (patch) | |
tree | 17ba00565487ddfbb5759c96adfbb3fffe2a4550 /src/mainboard/tyan | |
parent | 4b10dec1a66122b515b2191f823d7fd379ec655f (diff) |
x86: Change MMIO addr in readN(addr)/writeN(addr, val) to pointer
On x86, change the type of the address parameter in
read8()/read16/read32()/write8()/write16()/write32() to be a
pointer, instead of unsigned long.
Change-Id: Ic26dd8a72d82828b69be3c04944710681b7bd330
Signed-off-by: Kevin Paul Herbert <kph@meraki.net>
Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
Reviewed-on: http://review.coreboot.org/7784
Tested-by: build bot (Jenkins)
Diffstat (limited to 'src/mainboard/tyan')
-rw-r--r-- | src/mainboard/tyan/s2735/mptable.c | 8 | ||||
-rw-r--r-- | src/mainboard/tyan/s2850/mptable.c | 2 | ||||
-rw-r--r-- | src/mainboard/tyan/s2875/mptable.c | 2 | ||||
-rw-r--r-- | src/mainboard/tyan/s2880/mptable.c | 8 | ||||
-rw-r--r-- | src/mainboard/tyan/s2881/mptable.c | 8 | ||||
-rw-r--r-- | src/mainboard/tyan/s2882/mptable.c | 8 | ||||
-rw-r--r-- | src/mainboard/tyan/s2885/mptable.c | 8 | ||||
-rw-r--r-- | src/mainboard/tyan/s2891/mptable.c | 9 | ||||
-rw-r--r-- | src/mainboard/tyan/s2892/mptable.c | 9 | ||||
-rw-r--r-- | src/mainboard/tyan/s2895/mptable.c | 12 | ||||
-rw-r--r-- | src/mainboard/tyan/s2912/mptable.c | 3 | ||||
-rw-r--r-- | src/mainboard/tyan/s2912_fam10/mptable.c | 3 | ||||
-rw-r--r-- | src/mainboard/tyan/s4880/mptable.c | 8 | ||||
-rw-r--r-- | src/mainboard/tyan/s4882/mptable.c | 8 | ||||
-rw-r--r-- | src/mainboard/tyan/s8226/mptable.c | 10 |
15 files changed, 66 insertions, 40 deletions
diff --git a/src/mainboard/tyan/s2735/mptable.c b/src/mainboard/tyan/s2735/mptable.c index 907372809f..1d1c2e7615 100644 --- a/src/mainboard/tyan/s2735/mptable.c +++ b/src/mainboard/tyan/s2735/mptable.c @@ -17,7 +17,7 @@ static void *smp_write_config_table(void *v) smp_write_processors(mc); mptable_write_buses(mc, NULL, &isa_bus); /*I/O APICs: APIC ID Version State Address*/ - smp_write_ioapic(mc, 8, 0x20, IO_APIC_ADDR); + smp_write_ioapic(mc, 8, 0x20, VIO_APIC_VADDR); { device_t dev; struct resource *res; @@ -25,14 +25,16 @@ static void *smp_write_config_table(void *v) if (dev) { res = find_resource(dev, PCI_BASE_ADDRESS_0); if (res) { - smp_write_ioapic(mc, 0x09, 0x20, res->base); + smp_write_ioapic(mc, 0x09, 0x20, + res2mmio(res, 0, 0)); } } dev = dev_find_slot(1, PCI_DEVFN(0x1c,0)); if (dev) { res = find_resource(dev, PCI_BASE_ADDRESS_0); if (res) { - smp_write_ioapic(mc, 0x0a, 0x20, res->base); + smp_write_ioapic(mc, 0x0a, 0x20, + res2mmio(res, 0, 0)); } } } diff --git a/src/mainboard/tyan/s2850/mptable.c b/src/mainboard/tyan/s2850/mptable.c index 371d9a3ced..c3fdeef679 100644 --- a/src/mainboard/tyan/s2850/mptable.c +++ b/src/mainboard/tyan/s2850/mptable.c @@ -87,7 +87,7 @@ static void *smp_write_config_table(void *v) #endif apicid_8111 = apicid_base+0; - smp_write_ioapic(mc, apicid_8111, 0x11, IO_APIC_ADDR); + smp_write_ioapic(mc, apicid_8111, 0x11, VIO_APIC_VADDR); mptable_add_isa_interrupts(mc, bus_isa, apicid_8111, 0); diff --git a/src/mainboard/tyan/s2875/mptable.c b/src/mainboard/tyan/s2875/mptable.c index 90299a746b..c8b12bdb1e 100644 --- a/src/mainboard/tyan/s2875/mptable.c +++ b/src/mainboard/tyan/s2875/mptable.c @@ -104,7 +104,7 @@ static void *smp_write_config_table(void *v) apicid_base = CONFIG_MAX_PHYSICAL_CPUS; #endif apicid_8111 = apicid_base+0; - smp_write_ioapic(mc, apicid_8111, 0x11, IO_APIC_ADDR); + smp_write_ioapic(mc, apicid_8111, 0x11, VIO_APIC_VADDR); mptable_add_isa_interrupts(mc, bus_isa, apicid_8111, 0); diff --git a/src/mainboard/tyan/s2880/mptable.c b/src/mainboard/tyan/s2880/mptable.c index 32fc639dab..10db9bbd57 100644 --- a/src/mainboard/tyan/s2880/mptable.c +++ b/src/mainboard/tyan/s2880/mptable.c @@ -117,7 +117,7 @@ static void *smp_write_config_table(void *v) apicid_8111 = apicid_base+0; apicid_8131_1 = apicid_base+1; apicid_8131_2 = apicid_base+2; - smp_write_ioapic(mc, apicid_8111, 0x11, IO_APIC_ADDR); + smp_write_ioapic(mc, apicid_8111, 0x11, VIO_APIC_VADDR); { device_t dev; @@ -126,14 +126,16 @@ static void *smp_write_config_table(void *v) if (dev) { res = find_resource(dev, PCI_BASE_ADDRESS_0); if (res) { - smp_write_ioapic(mc, apicid_8131_1, 0x11, res->base); + smp_write_ioapic(mc, apicid_8131_1, 0x11, + res2mmio(res, 0, 0)); } } dev = dev_find_slot(bus_chain_0, PCI_DEVFN(0x2,1)); if (dev) { res = find_resource(dev, PCI_BASE_ADDRESS_0); if (res) { - smp_write_ioapic(mc, apicid_8131_2, 0x11, res->base); + smp_write_ioapic(mc, apicid_8131_2, 0x11, + res2mmio(res, 0, 0)); } } diff --git a/src/mainboard/tyan/s2881/mptable.c b/src/mainboard/tyan/s2881/mptable.c index 7df5e874b4..8948b7cb77 100644 --- a/src/mainboard/tyan/s2881/mptable.c +++ b/src/mainboard/tyan/s2881/mptable.c @@ -33,7 +33,7 @@ static void *smp_write_config_table(void *v) mptable_write_buses(mc, NULL, &bus_isa); /*I/O APICs: APIC ID Version State Address*/ - smp_write_ioapic(mc, apicid_8111, 0x11, IO_APIC_ADDR); + smp_write_ioapic(mc, apicid_8111, 0x11, VIO_APIC_VADDR); { device_t dev; struct resource *res; @@ -41,14 +41,16 @@ static void *smp_write_config_table(void *v) if (dev) { res = find_resource(dev, PCI_BASE_ADDRESS_0); if (res) { - smp_write_ioapic(mc, apicid_8131_1, 0x11, res->base); + smp_write_ioapic(mc, apicid_8131_1, 0x11, + res2mmio(res, 0, 0)); } } dev = dev_find_slot(bus_8131_0, PCI_DEVFN(sbdn3+1,1)); if (dev) { res = find_resource(dev, PCI_BASE_ADDRESS_0); if (res) { - smp_write_ioapic(mc, apicid_8131_2, 0x11, res->base); + smp_write_ioapic(mc, apicid_8131_2, 0x11, + res2mmio(res, 0, 0)); } } diff --git a/src/mainboard/tyan/s2882/mptable.c b/src/mainboard/tyan/s2882/mptable.c index 6c0796525f..d29c775e5a 100644 --- a/src/mainboard/tyan/s2882/mptable.c +++ b/src/mainboard/tyan/s2882/mptable.c @@ -116,7 +116,7 @@ static void *smp_write_config_table(void *v) apicid_8131_1 = apicid_base+1; apicid_8131_2 = apicid_base+2; - smp_write_ioapic(mc, apicid_8111, 0x11, IO_APIC_ADDR); + smp_write_ioapic(mc, apicid_8111, 0x11, VIO_APIC_VADDR); { device_t dev; struct resource *res; @@ -124,14 +124,16 @@ static void *smp_write_config_table(void *v) if (dev) { res = find_resource(dev, PCI_BASE_ADDRESS_0); if (res) { - smp_write_ioapic(mc, apicid_8131_1, 0x11, res->base); + smp_write_ioapic(mc, apicid_8131_1, 0x11, + res2mmio(res, 0, 0)); } } dev = dev_find_slot(bus_chain_0, PCI_DEVFN(0x2,1)); if (dev) { res = find_resource(dev, PCI_BASE_ADDRESS_0); if (res) { - smp_write_ioapic(mc, apicid_8131_2, 0x11, res->base); + smp_write_ioapic(mc, apicid_8131_2, 0x11, + res2mmio(res, 0, 0)); } } diff --git a/src/mainboard/tyan/s2885/mptable.c b/src/mainboard/tyan/s2885/mptable.c index 26081c7234..fe0f8d839a 100644 --- a/src/mainboard/tyan/s2885/mptable.c +++ b/src/mainboard/tyan/s2885/mptable.c @@ -36,7 +36,7 @@ static void *smp_write_config_table(void *v) mptable_write_buses(mc, NULL, &bus_isa); /*I/O APICs: APIC ID Version State Address*/ - smp_write_ioapic(mc, apicid_8111, 0x11, IO_APIC_ADDR); //8111 + smp_write_ioapic(mc, apicid_8111, 0x11, VIO_APIC_VADDR); //8111 { device_t dev; struct resource *res; @@ -44,14 +44,16 @@ static void *smp_write_config_table(void *v) if (dev) { res = find_resource(dev, PCI_BASE_ADDRESS_0); if (res) { - smp_write_ioapic(mc, apicid_8131_1, 0x11, res->base); + smp_write_ioapic(mc, apicid_8131_1, 0x11, + res2mmio(res, 0, 0)); } } dev = dev_find_slot(bus_8131_0, PCI_DEVFN(sbdn3+1,1)); if (dev) { res = find_resource(dev, PCI_BASE_ADDRESS_0); if (res) { - smp_write_ioapic(mc, apicid_8131_2, 0x11, res->base); + smp_write_ioapic(mc, apicid_8131_2, 0x11, + res2mmio(res, 0, 0)); } } } diff --git a/src/mainboard/tyan/s2891/mptable.c b/src/mainboard/tyan/s2891/mptable.c index cb49434bf0..a8f5157b76 100644 --- a/src/mainboard/tyan/s2891/mptable.c +++ b/src/mainboard/tyan/s2891/mptable.c @@ -47,7 +47,8 @@ static void *smp_write_config_table(void *v) if (dev) { res = find_resource(dev, PCI_BASE_ADDRESS_1); if (res) { - smp_write_ioapic(mc, apicid_ck804, 0x11, res->base); + smp_write_ioapic(mc, apicid_ck804, 0x11, + res2mmio(res, 0, 0)); } /* Initialize interrupt mapping*/ @@ -67,14 +68,16 @@ static void *smp_write_config_table(void *v) if (dev) { res = find_resource(dev, PCI_BASE_ADDRESS_0); if (res) { - smp_write_ioapic(mc, apicid_8131_1, 0x11, res->base); + smp_write_ioapic(mc, apicid_8131_1, 0x11, + res2mmio(res, 0, 0)); } } dev = dev_find_slot(bus_8131_0, PCI_DEVFN(sbdn3+1,1)); if (dev) { res = find_resource(dev, PCI_BASE_ADDRESS_0); if (res) { - smp_write_ioapic(mc, apicid_8131_2, 0x11, res->base); + smp_write_ioapic(mc, apicid_8131_2, 0x11, + res2mmio(res, 0, 0)); } } diff --git a/src/mainboard/tyan/s2892/mptable.c b/src/mainboard/tyan/s2892/mptable.c index 882ac69d26..014e3f2ccf 100644 --- a/src/mainboard/tyan/s2892/mptable.c +++ b/src/mainboard/tyan/s2892/mptable.c @@ -47,7 +47,8 @@ static void *smp_write_config_table(void *v) if (dev) { res = find_resource(dev, PCI_BASE_ADDRESS_1); if (res) { - smp_write_ioapic(mc, apicid_ck804, 0x11, res->base); + smp_write_ioapic(mc, apicid_ck804, 0x11, + res2mmio(res, 0, 0)); } /* Initialize interrupt mapping*/ @@ -67,14 +68,16 @@ static void *smp_write_config_table(void *v) if (dev) { res = find_resource(dev, PCI_BASE_ADDRESS_0); if (res) { - smp_write_ioapic(mc, apicid_8131_1, 0x11, res->base); + smp_write_ioapic(mc, apicid_8131_1, 0x11, + res2mmio(res, 0, 0)); } } dev = dev_find_slot(bus_8131_0, PCI_DEVFN(sbdn3+1,1)); if (dev) { res = find_resource(dev, PCI_BASE_ADDRESS_0); if (res) { - smp_write_ioapic(mc, apicid_8131_2, 0x11, res->base); + smp_write_ioapic(mc, apicid_8131_2, 0x11, + res2mmio(res, 0, 0)); } } diff --git a/src/mainboard/tyan/s2895/mptable.c b/src/mainboard/tyan/s2895/mptable.c index 20fa92cdfc..1abab1bfc1 100644 --- a/src/mainboard/tyan/s2895/mptable.c +++ b/src/mainboard/tyan/s2895/mptable.c @@ -55,7 +55,8 @@ static void *smp_write_config_table(void *v) if (dev) { res = find_resource(dev, PCI_BASE_ADDRESS_1); if (res) { - smp_write_ioapic(mc, apicid_ck804, 0x11, res->base); + smp_write_ioapic(mc, apicid_ck804, 0x11, + res2mmio(res, 0, 0)); } /* Initialize interrupt mapping*/ @@ -75,14 +76,16 @@ static void *smp_write_config_table(void *v) if (dev) { res = find_resource(dev, PCI_BASE_ADDRESS_0); if (res) { - smp_write_ioapic(mc, apicid_8131_1, 0x11, res->base); + smp_write_ioapic(mc, apicid_8131_1, 0x11, + res2mmio(res, 0, 0)); } } dev = dev_find_slot(bus_8131_0, PCI_DEVFN(sbdn3+1,1)); if (dev) { res = find_resource(dev, PCI_BASE_ADDRESS_0); if (res) { - smp_write_ioapic(mc, apicid_8131_2, 0x11, res->base); + smp_write_ioapic(mc, apicid_8131_2, 0x11, + res2mmio(res, 0, 0)); } } @@ -91,7 +94,8 @@ static void *smp_write_config_table(void *v) if (dev) { res = find_resource(dev, PCI_BASE_ADDRESS_1); if (res) { - smp_write_ioapic(mc, apicid_ck804b, 0x11, res->base); + smp_write_ioapic(mc, apicid_ck804b, 0x11, + res2mmio(res, 0, 0)); } dword = 0x0000d218; // Why does the factory BIOS have 0? diff --git a/src/mainboard/tyan/s2912/mptable.c b/src/mainboard/tyan/s2912/mptable.c index 133ce43ead..2163307ac9 100644 --- a/src/mainboard/tyan/s2912/mptable.c +++ b/src/mainboard/tyan/s2912/mptable.c @@ -56,7 +56,8 @@ static void *smp_write_config_table(void *v) if (dev) { res = find_resource(dev, PCI_BASE_ADDRESS_1); if (res) { - smp_write_ioapic(mc, m->apicid_mcp55, 0x11, res->base); + smp_write_ioapic(mc, m->apicid_mcp55, 0x11, + res2mmio(res, 0, 0)); } dword = 0x43c6c643; diff --git a/src/mainboard/tyan/s2912_fam10/mptable.c b/src/mainboard/tyan/s2912_fam10/mptable.c index e15387d345..b31730353f 100644 --- a/src/mainboard/tyan/s2912_fam10/mptable.c +++ b/src/mainboard/tyan/s2912_fam10/mptable.c @@ -56,7 +56,8 @@ static void *smp_write_config_table(void *v) if (dev) { res = find_resource(dev, PCI_BASE_ADDRESS_1); if (res) { - smp_write_ioapic(mc, m->apicid_mcp55, 0x11, res->base); + smp_write_ioapic(mc, m->apicid_mcp55, 0x11, + res2mmio(res, 0, 0)); } dword = 0x43c6c643; diff --git a/src/mainboard/tyan/s4880/mptable.c b/src/mainboard/tyan/s4880/mptable.c index dcc0fd871c..b315c40678 100644 --- a/src/mainboard/tyan/s4880/mptable.c +++ b/src/mainboard/tyan/s4880/mptable.c @@ -118,7 +118,7 @@ static void *smp_write_config_table(void *v) apicid_8131_1 = apicid_base+1; apicid_8131_2 = apicid_base+2; - smp_write_ioapic(mc, apicid_8111, 0x11, IO_APIC_ADDR); + smp_write_ioapic(mc, apicid_8111, 0x11, VIO_APIC_VADDR); { device_t dev; struct resource *res; @@ -126,14 +126,16 @@ static void *smp_write_config_table(void *v) if (dev) { res = find_resource(dev, PCI_BASE_ADDRESS_0); if (res) { - smp_write_ioapic(mc, apicid_8131_1, 0x11, res->base); + smp_write_ioapic(mc, apicid_8131_1, 0x11, + res2mmio(res, 0, 0)); } } dev = dev_find_slot(bus_chain_0, PCI_DEVFN(0x2,1)); if (dev) { res = find_resource(dev, PCI_BASE_ADDRESS_0); if (res) { - smp_write_ioapic(mc, apicid_8131_2, 0x11, res->base); + smp_write_ioapic(mc, apicid_8131_2, 0x11, + res2mmio(res, 0, 0)); } } diff --git a/src/mainboard/tyan/s4882/mptable.c b/src/mainboard/tyan/s4882/mptable.c index 350b55ca04..7bde3495b5 100644 --- a/src/mainboard/tyan/s4882/mptable.c +++ b/src/mainboard/tyan/s4882/mptable.c @@ -117,7 +117,7 @@ static void *smp_write_config_table(void *v) apicid_8111 = apicid_base+0; apicid_8131_1 = apicid_base+1; apicid_8131_2 = apicid_base+2; - smp_write_ioapic(mc, apicid_8111, 0x11, IO_APIC_ADDR); + smp_write_ioapic(mc, apicid_8111, 0x11, VIO_APIC_VADDR); { device_t dev; struct resource *res; @@ -125,14 +125,16 @@ static void *smp_write_config_table(void *v) if (dev) { res = find_resource(dev, PCI_BASE_ADDRESS_0); if (res) { - smp_write_ioapic(mc, apicid_8131_1, 0x11, res->base); + smp_write_ioapic(mc, apicid_8131_1, 0x11, + res2mmio(res, 0, 0)); } } dev = dev_find_slot(bus_chain_0, PCI_DEVFN(0x2,1)); if (dev) { res = find_resource(dev, PCI_BASE_ADDRESS_0); if (res) { - smp_write_ioapic(mc, apicid_8131_2, 0x11, res->base); + smp_write_ioapic(mc, apicid_8131_2, 0x11, + res2mmio(res, 0, 0)); } } diff --git a/src/mainboard/tyan/s8226/mptable.c b/src/mainboard/tyan/s8226/mptable.c index 5ec4a35bf1..63ec044811 100644 --- a/src/mainboard/tyan/s8226/mptable.c +++ b/src/mainboard/tyan/s8226/mptable.c @@ -35,7 +35,7 @@ static void *smp_write_config_table(void *v) u32 apicid_sp5100; u32 apicid_sr5650; device_t dev; - u32 dword; + u32 *dword; mc = (void *)(((char *)v) + SMP_FLOATING_TABLE_LEN); mptable_init(mc, LOCAL_APIC_ADDR); @@ -59,7 +59,7 @@ static void *smp_write_config_table(void *v) dev = dev_find_slot(0, PCI_DEVFN(0x14, 0)); if (dev) { /* Set SP5100 IOAPIC ID */ - dword = pci_read_config32(dev, 0x74) & 0xfffffff0; + dword = (u32 *)(pci_read_config32(dev, 0x74) & 0xfffffff0); smp_write_ioapic(mc, apicid_sp5100, 0x20, dword); #ifdef UNUSED_CODE @@ -72,8 +72,8 @@ static void *smp_write_config_table(void *v) pci_write_config8(dev, 0x63, byte); /* SATA */ dword = pci_read_config32(dev, 0xAC); - dword &= ~(7 << 26); - dword |= 6 << 26; /* 0: INTA, ...., 7: INTH */ + dword = dword & ~(7 << 26); + dword = dword | (6 << 26); /* 0: INTA, ...., 7: INTH */ /* dword |= 1<<22; PIC and APIC co exists */ pci_write_config32(dev, 0xAC, dword); #endif @@ -96,7 +96,7 @@ static void *smp_write_config_table(void *v) dev = dev_find_slot(0, PCI_DEVFN(0, 0)); if (dev) { pci_write_config32(dev, 0xF8, 0x1); - dword = pci_read_config32(dev, 0xFC) & 0xfffffff0; + dword = (u32 *)(pci_read_config32(dev, 0xFC) & 0xfffffff0); smp_write_ioapic(mc, apicid_sr5650, 0x20, dword); } |