Received: by 10.213.65.68 with SMTP id h4csp1371787imn; Mon, 26 Mar 2018 06:22:02 -0700 (PDT) X-Google-Smtp-Source: AG47ELufJbSb4kXfSUb08d/1RaKMiLUalRIzaCsVLRDhYLCR0YT/nuL1eUBMLUvEC5XPbIjYVHl6 X-Received: by 2002:a17:902:8697:: with SMTP id g23-v6mr41746414plo.393.1522070521954; Mon, 26 Mar 2018 06:22:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522070521; cv=none; d=google.com; s=arc-20160816; b=aMocF7NEQ7oekbBze+BDfYxfmnqJ6cf0lmsh9S490UjDaJdcLgz2sAOhy+N7SCGooZ JJmJxeVlL0bc7OB3dToBVVshC4xdXFjmjqMzz1P3N+6Rxe3rCvSXjdWAsCt07Bte7MkX xm18A9V7mREZK6qTbFgERMpXnwGw5tKvBEPhlUJUEBt27FASH4IQM7Rj6GhjoiwrHVzA OFGItrP/meTXg+ekHWsOE5FS8/dWH9o5kIbhfIV6rSLDA4YcRI/VsqWad4DTXEYGalfG KnegMoJCAMGc9q7xnEDuf8903vkbAExqqFFsBs1EqztY5vJk1cv9Z/szgOW3fVmaE/Tq RoRQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-disposition :content-transfer-encoding:mime-version:robot-unsubscribe:robot-id :git-commit-id:subject:to:references:in-reply-to:reply-to:cc :message-id:from:date:arc-authentication-results; bh=q1tK5zrnfcWUyl5dDjKbjMe0sXhFHxLVGnX0S4E8Scc=; b=xWKjEI6fgGafSQMVAn9ObPHyuOpuSErd/+wCBD0q7XFOs8upWlYZjVDdlhOHVAJM2E oR2+PUCIeyzA74F1JKRFmjQEvkahEllDG0KDOKIFTSXjRbn9bSX7zNR1xFimTsxWMtW2 V6V7e0+lWMjzv3VbA52Etv3ZYHfmJ6pe20QDSJ/Ctt8pcAR6ztcWWy7Ld03n+STBPifJ AXOIU+GBsF56HMQ/JYxC60wTYVw6RxgKbXtlrh2QxmFuNYr19QxDHf/n3m/+xvHUD90a 4nCROBQdxk7lKAvjrpNe/Gu9jxCpR2pFl9KlTMUYNAtwJXC7+aJAyYqmtPVHedVrfWqK g4/g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e8-v6si15381633pli.219.2018.03.26.06.21.47; Mon, 26 Mar 2018 06:22:01 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752027AbeCZNUD (ORCPT + 99 others); Mon, 26 Mar 2018 09:20:03 -0400 Received: from terminus.zytor.com ([198.137.202.136]:42753 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751489AbeCZNUB (ORCPT ); Mon, 26 Mar 2018 09:20:01 -0400 Received: from terminus.zytor.com (localhost [127.0.0.1]) by terminus.zytor.com (8.15.2/8.15.2) with ESMTP id w2QDJn2j256838; Mon, 26 Mar 2018 06:19:49 -0700 Received: (from tipbot@localhost) by terminus.zytor.com (8.15.2/8.15.2/Submit) id w2QDJn7O256835; Mon, 26 Mar 2018 06:19:49 -0700 Date: Mon, 26 Mar 2018 06:19:49 -0700 X-Authentication-Warning: terminus.zytor.com: tipbot set sender to tipbot@zytor.com using -f From: tip-bot for Ivan Gorinov Message-ID: Cc: andy.shevchenko@gmail.com, ivan.gorinov@intel.com, tglx@linutronix.de, frowand.list@gmail.com, mark.rutland@arm.com, robh+dt@kernel.org, linux-kernel@vger.kernel.org, hpa@zytor.com, mingo@kernel.org Reply-To: ivan.gorinov@intel.com, tglx@linutronix.de, andy.shevchenko@gmail.com, linux-kernel@vger.kernel.org, robh+dt@kernel.org, hpa@zytor.com, mingo@kernel.org, frowand.list@gmail.com, mark.rutland@arm.com In-Reply-To: References: To: linux-tip-commits@vger.kernel.org Subject: [tip:x86/platform] x86/devicetree: Use CPU description from Device Tree Git-Commit-ID: 4e07db9c8db87e3b71be4c3cd626ddc9bacd5a1e X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=ham autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on terminus.zytor.com Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: 4e07db9c8db87e3b71be4c3cd626ddc9bacd5a1e Gitweb: https://git.kernel.org/tip/4e07db9c8db87e3b71be4c3cd626ddc9bacd5a1e Author: Ivan Gorinov AuthorDate: Thu, 22 Mar 2018 14:35:47 -0700 Committer: Thomas Gleixner CommitDate: Mon, 26 Mar 2018 15:13:32 +0200 x86/devicetree: Use CPU description from Device Tree Current x86 Device Tree implementation does not support multiprocessing. Use new DT bindings to describe the processors. Signed-off-by: Ivan Gorinov Signed-off-by: Thomas Gleixner Reviewed-by: Andy Shevchenko Cc: Mark Rutland Cc: Rob Herring Cc: Frank Rowand Link: https://lkml.kernel.org/r/c291fb2cef51b730b59916d7745be0eaa4378c6c.1521753738.git.ivan.gorinov@intel.com --- arch/x86/kernel/devicetree.c | 45 ++++++++++++++++++++++++++++++++------------ 1 file changed, 33 insertions(+), 12 deletions(-) diff --git a/arch/x86/kernel/devicetree.c b/arch/x86/kernel/devicetree.c index 5cd387fcc777..c9d2b19749b8 100644 --- a/arch/x86/kernel/devicetree.c +++ b/arch/x86/kernel/devicetree.c @@ -131,34 +131,52 @@ static void __init dtb_setup_hpet(void) #endif } +#ifdef CONFIG_X86_LOCAL_APIC + +static void __init dtb_cpu_setup(void) +{ + struct device_node *dn; + u32 apic_id, version; + int ret; + + version = GET_APIC_VERSION(apic_read(APIC_LVR)); + for_each_node_by_type(dn, "cpu") { + ret = of_property_read_u32(dn, "reg", &apic_id); + if (ret < 0) { + pr_warn("%pOF: missing local APIC ID\n", dn); + continue; + } + generic_processor_info(apic_id, version); + } +} + static void __init dtb_lapic_setup(void) { -#ifdef CONFIG_X86_LOCAL_APIC struct device_node *dn; struct resource r; + unsigned long lapic_addr = APIC_DEFAULT_PHYS_BASE; int ret; dn = of_find_compatible_node(NULL, NULL, "intel,ce4100-lapic"); - if (!dn) - return; - - ret = of_address_to_resource(dn, 0, &r); - if (WARN_ON(ret)) - return; + if (dn) { + ret = of_address_to_resource(dn, 0, &r); + if (WARN_ON(ret)) + return; + lapic_addr = r.start; + } /* Did the boot loader setup the local APIC ? */ if (!boot_cpu_has(X86_FEATURE_APIC)) { - if (apic_force_enable(r.start)) + if (apic_force_enable(lapic_addr)) return; } smp_found_config = 1; pic_mode = 1; - register_lapic_address(r.start); - generic_processor_info(boot_cpu_physical_apicid, - GET_APIC_VERSION(apic_read(APIC_LVR))); -#endif + register_lapic_address(lapic_addr); } +#endif /* CONFIG_X86_LOCAL_APIC */ + #ifdef CONFIG_X86_IO_APIC static unsigned int ioapic_id; @@ -259,7 +277,10 @@ static void __init dtb_ioapic_setup(void) {} static void __init dtb_apic_setup(void) { +#ifdef CONFIG_X86_LOCAL_APIC dtb_lapic_setup(); + dtb_cpu_setup(); +#endif dtb_ioapic_setup(); }