From 4d6db954e706b0a1038fb2eea166c9bbe5485980 Mon Sep 17 00:00:00 2001 From: Stefan Reinauer Date: Sat, 13 Jun 2015 11:01:54 +0200 Subject: Move remap_bsp_lapic to AMD specific code MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It's not used outside of very old AMD CPUs. Change-Id: Ide51ef1a526df50d88bf229432d7d36bc777f9eb Signed-off-by: Stefan Reinauer Reviewed-on: http://review.coreboot.org/10538 Tested-by: build bot (Jenkins) Reviewed-by: Kyösti Mälkki Reviewed-by: Marc Jones --- src/northbridge/amd/amdfam10/northbridge.c | 15 +++++++++++++++ src/northbridge/amd/amdk8/northbridge.c | 15 +++++++++++++++ 2 files changed, 30 insertions(+) (limited to 'src/northbridge/amd') diff --git a/src/northbridge/amd/amdfam10/northbridge.c b/src/northbridge/amd/amdfam10/northbridge.c index b3ad08bdfc..f6f2641135 100644 --- a/src/northbridge/amd/amdfam10/northbridge.c +++ b/src/northbridge/amd/amdfam10/northbridge.c @@ -1112,6 +1112,21 @@ static void add_more_links(device_t dev, unsigned total_links) last->next = NULL; } +static void remap_bsp_lapic(struct bus *cpu_bus) +{ + struct device_path cpu_path; + device_t cpu; + u32 bsp_lapic_id = lapicid(); + + if (bsp_lapic_id) { + cpu_path.type = DEVICE_PATH_APIC; + cpu_path.apic.apic_id = 0; + cpu = find_dev_path(cpu_bus, &cpu_path); + if (cpu) + cpu->path.apic.apic_id = bsp_lapic_id; + } +} + static void cpu_bus_scan(device_t dev) { struct bus *cpu_bus; diff --git a/src/northbridge/amd/amdk8/northbridge.c b/src/northbridge/amd/amdk8/northbridge.c index 55f3c4dc7e..c4fd3fdcee 100644 --- a/src/northbridge/amd/amdk8/northbridge.c +++ b/src/northbridge/amd/amdk8/northbridge.c @@ -1102,6 +1102,21 @@ static void add_more_links(device_t dev, unsigned total_links) last->next = NULL; } +static void remap_bsp_lapic(struct bus *cpu_bus) +{ + struct device_path cpu_path; + device_t cpu; + u32 bsp_lapic_id = lapicid(); + + if (bsp_lapic_id) { + cpu_path.type = DEVICE_PATH_APIC; + cpu_path.apic.apic_id = 0; + cpu = find_dev_path(cpu_bus, &cpu_path); + if (cpu) + cpu->path.apic.apic_id = bsp_lapic_id; + } +} + static void cpu_bus_scan(device_t dev) { struct bus *cpu_bus; -- cgit v1.2.3