From: Simon Glass Date: Tue, 28 Apr 2015 20:25:21 -0600 Subject: [U-Boot] [PATCH v2 19/20] x86: Tidy up the LAPIC init code In-Reply-To: <1430274322-14383-1-git-send-email-sjg@chromium.org> References: <1430274322-14383-1-git-send-email-sjg@chromium.org> Message-ID: <1430274322-14383-20-git-send-email-sjg@chromium.org> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de We don't need to support really old x86 CPUs, so drop this code. Signed-off-by: Simon Glass --- Changes in v2: None arch/x86/cpu/lapic.c | 20 ++++++++++++-------- arch/x86/include/asm/lapic.h | 7 ------- 2 files changed, 12 insertions(+), 15 deletions(-) diff --git a/arch/x86/cpu/lapic.c b/arch/x86/cpu/lapic.c index 4690603..0c9c324 100644 --- a/arch/x86/cpu/lapic.c +++ b/arch/x86/cpu/lapic.c @@ -15,7 +15,6 @@ void lapic_setup(void) { -#if NEED_LAPIC == 1 /* Only Pentium Pro and later have those MSR stuff */ debug("Setting up local apic: "); @@ -46,12 +45,17 @@ void lapic_setup(void) (LAPIC_LVT_REMOTE_IRR | LAPIC_SEND_PENDING | LAPIC_DELIVERY_MODE_NMI)); - debug("apic_id: 0x%02lx, ", lapicid()); -#else /* !NEED_LLAPIC */ - /* Only Pentium Pro and later have those MSR stuff */ - debug("Disabling local apic: "); - disable_lapic(); -#endif /* !NEED_LAPIC */ - debug("done.\n"); + debug("apic_id: 0x%02lx\n", lapicid()); post_code(POST_LAPIC); } + +void lapic_enable(void) +{ + msr_t msr; + + msr = msr_read(LAPIC_BASE_MSR); + msr.hi &= 0xffffff00; + msr.lo &= 0x000007ff; + msr.lo |= LAPIC_DEFAULT_BASE | LAPIC_BASE_MSR_ENABLE; + msr_write(LAPIC_BASE_MSR, msr); +} diff --git a/arch/x86/include/asm/lapic.h b/arch/x86/include/asm/lapic.h index 0a7f443..dff75c5 100644 --- a/arch/x86/include/asm/lapic.h +++ b/arch/x86/include/asm/lapic.h @@ -14,13 +14,6 @@ #include #include -/* See if I need to initialize the local apic */ -#if CONFIG_SMP || CONFIG_IOAPIC -# define NEED_LAPIC 1 -#else -# define NEED_LAPIC 0 -#endif - static inline __attribute__((always_inline)) unsigned long lapic_read(unsigned long reg) { -- 2.2.0.rc0.207.ga3a616c