From patchwork Tue Feb 25 12:19:47 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wolfgang Wallner X-Patchwork-Id: 1244094 X-Patchwork-Delegate: bmeng.cn@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=br-automation.com Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 48RdL600jqz9sPk for ; Tue, 25 Feb 2020 23:20:10 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 21A64801A0; Tue, 25 Feb 2020 13:20:00 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=br-automation.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by phobos.denx.de (Postfix, from userid 109) id E547B80257; Tue, 25 Feb 2020 13:19:57 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_PASS, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from mail2.br-automation.com (mail2.br-automation.com [213.33.116.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id A0E67801A0 for ; Tue, 25 Feb 2020 13:19:54 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=br-automation.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=wolfgang.wallner@br-automation.com X-AuditID: c0a80110-f79ff70000001fe0-53-5e5510e9db8c Received: from brsmtp01.br-automation.co.at (Unknown_Domain [192.168.1.60]) by mail2.br-automation.com () with SMTP id 58.17.08160.9E0155E5; Tue, 25 Feb 2020 13:19:53 +0100 (CET) From: "Wolfgang Wallner" To: u-boot@lists.denx.de Cc: "Simon Glass" , "Bin Meng" , "Wolfgang Wallner" Subject: [PATCH 1/2] x86: cpu_x86: Make cpu_x86_get_count() non-static Date: Tue, 25 Feb 2020 13:19:47 +0100 Message-Id: <20200225121949.35950-2-wolfgang.wallner@br-automation.com> In-Reply-To: <20200225121949.35950-1-wolfgang.wallner@br-automation.com> X-Mailer: git-send-email 2.25.1 References: <20200225121949.35950-1-wolfgang.wallner@br-automation.com> MIME-Version: 1.0 X-MIMETrack: Itemize by SMTP Server on BRSMTPINTERN2/InternSMTP(Release 10.0.1FP3|August 09, 2019) at 25/02/2020 13:19:52, Serialize by Router on BRSMTPINTERN2/InternSMTP(Release 10.0.1FP3|August 09, 2019) at 25/02/2020 13:19:52, Itemize by SMTP Server on BRSMTP01/Eggelsberg/AT/B&R(Release 10.0.1FP3|August 09, 2019) at 02/25/2020 01:19:53 PM X-TNEFEvaluated: 1 X-Disclaimed: 39987 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrCLMWRmVeSWpSXmKPExsVyYAWjje5LgdA4g48/LC2m9sRbfNuyjdHi 7d5Odgdmj9kNF1k8ds66y+5x9s4OxgDmKC6blNSczLLUIn27BK6MLS+vMhVc56lYuuADUwPj Lq4uRk4OCQETiRufVjF3MXJxCAlsYZQ4OuM1M0iCTcBWovHIVjYQW0RAQuJX/1XGLkYODmaB Oomvs6JBwsICbhJ3b9xnAbFZBFQlFq6bxg5i8wq4S+yb+5ENpJxTwEPic086SJhZQFti2UKI 6RIC8hIzL30HKxcCKp845ylUq6DEyZlPWEDOkRC4zSTxeMMlNogGIYnTi89CNQtLfJh+mWkC o8AsJHNnIelfwMi0ilE8NzEzx0gvqUg3sbQkPzexJDM/Ty85P3cTIyQkBXYw7n6jfYiRiYPx EKMEB7OSCK83Y1CcEG9KYmVValF+fFFpTmrxIUZpDhYlcV7fq1pxQgLpiSWp2ampBalFMFkm Dk6pBkau7PN814WuHjVV/fBafv1aOzvhCZ3SqlItdxw9Hzr0KcUVPmrfliT0SOX7wdPii2qD Creeio4vOPV184N1TwPEHyQp3vvSyijeUXEx3TWr5m7zXW6ZSbeM9guoth9cO3+Vyl7Vu8In mV4rlIlNXdRndONUTY6/pUT+18231i9+X1KWu+UVj5kSS3FGoqEWc1FxIgANruJMNwIAAA== X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.30rc1 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.2 at phobos.denx.de X-Virus-Status: Clean The function cpu_x86_get_count() is also useful for other modules. Make it non-static and add a prototype + description. Signed-off-by: Wolfgang Wallner Reviewed-by: Bin Meng --- arch/x86/cpu/cpu_x86.c | 2 +- arch/x86/include/asm/cpu_x86.h | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/arch/x86/cpu/cpu_x86.c b/arch/x86/cpu/cpu_x86.c index 1aaf851bb4..3f2ba0881e 100644 --- a/arch/x86/cpu/cpu_x86.c +++ b/arch/x86/cpu/cpu_x86.c @@ -52,7 +52,7 @@ int cpu_x86_get_desc(struct udevice *dev, char *buf, int size) return 0; } -static int cpu_x86_get_count(struct udevice *dev) +int cpu_x86_get_count(struct udevice *dev) { int node, cpu; int num = 0; diff --git a/arch/x86/include/asm/cpu_x86.h b/arch/x86/include/asm/cpu_x86.h index 19223f2c3b..ae8f4dcd5d 100644 --- a/arch/x86/include/asm/cpu_x86.h +++ b/arch/x86/include/asm/cpu_x86.h @@ -30,6 +30,18 @@ int cpu_x86_bind(struct udevice *dev); */ int cpu_x86_get_desc(struct udevice *dev, char *buf, int size); +/** + * cpu_x86_get_count() - Get the number of cores for an x86 CPU + * + * This function is suitable to use as the get_count() method for + * the CPU uclass. + * + * @dev: Device to check (UCLASS_CPU) + * @return: Number of cores if successful, + * -ENOENT if not "/cpus" entry is found in the device tree + */ +int cpu_x86_get_count(struct udevice *dev); + /** * cpu_x86_get_vendor() - Get a vendor string for an x86 CPU *