From nobody Sun Feb 8 09:37:21 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4080FEB64DA for ; Fri, 16 Jun 2023 09:26:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231860AbjFPJ0L (ORCPT ); Fri, 16 Jun 2023 05:26:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41396 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344133AbjFPJYz (ORCPT ); Fri, 16 Jun 2023 05:24:55 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7B4CA270E; Fri, 16 Jun 2023 02:24:51 -0700 (PDT) Date: Fri, 16 Jun 2023 09:24:47 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1686907487; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=AV6KkFtgrM2z233LjJh0pvjZzz7p2tEBabShKhguHIU=; b=GltytqPbDYjI3ykBmgF4MUl+rFPEKlZlZqaSB5tIh+sHOCmrTjatQKzQBL7DKxoVf/wfcd G/psAhq5DCW7UfgOYdtmq2FH4uuqmCqFSAmreIDY1k+fTo5YyhGjA6ACsrq3igm13sE4/L dNJ1PNIsJRkaCo5I+KKDxXoYfTvPVnNElsnDMo0sCZfAXXgVTYfVkS+Gl4L5BT6hpVcV4a ciTeDjJox7pQ9hNJesEle/olNE79RvOmg0ldtkAHchdknPlhVLdlDllo4yVP4hwYc8w4bY rtMJzVlWFWEiAfpk4z/CDkBeT/aWlOXBUa2GRcQ3bU/XcfdwfOK38mDnHtDlwQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1686907487; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=AV6KkFtgrM2z233LjJh0pvjZzz7p2tEBabShKhguHIU=; b=PLCqIyRcb6jQuPir0pVr8YZ6N1hZbBXIaFWZmMTFZs7bD13LA56mQINzr99JJ4KFDv0dL1 85Rpoj4WFYjowICw== From: "tip-bot2 for Thomas Gleixner" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: x86/boot] sh/cpu: Switch to arch_cpu_finalize_init() Cc: Thomas Gleixner , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20230613224545.371697797@linutronix.de> References: <20230613224545.371697797@linutronix.de> MIME-Version: 1.0 Message-ID: <168690748709.404.14314407199380002907.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The following commit has been merged into the x86/boot branch of tip: Commit-ID: 01eb454e9bfe593f320ecbc9aaec60bf87cd453d Gitweb: https://git.kernel.org/tip/01eb454e9bfe593f320ecbc9aaec60bf8= 7cd453d Author: Thomas Gleixner AuthorDate: Wed, 14 Jun 2023 01:39:33 +02:00 Committer: Thomas Gleixner CommitterDate: Fri, 16 Jun 2023 10:16:00 +02:00 sh/cpu: Switch to arch_cpu_finalize_init() check_bugs() is about to be phased out. Switch over to the new arch_cpu_finalize_init() implementation. No functional change. Signed-off-by: Thomas Gleixner Link: https://lore.kernel.org/r/20230613224545.371697797@linutronix.de --- arch/sh/Kconfig | 1 +- arch/sh/include/asm/bugs.h | 74 +-------------------------------- arch/sh/include/asm/processor.h | 2 +- arch/sh/kernel/idle.c | 1 +- arch/sh/kernel/setup.c | 55 ++++++++++++++++++++++++- 5 files changed, 59 insertions(+), 74 deletions(-) delete mode 100644 arch/sh/include/asm/bugs.h diff --git a/arch/sh/Kconfig b/arch/sh/Kconfig index 9652d36..e339745 100644 --- a/arch/sh/Kconfig +++ b/arch/sh/Kconfig @@ -6,6 +6,7 @@ config SUPERH select ARCH_ENABLE_MEMORY_HOTREMOVE if SPARSEMEM && MMU select ARCH_HAVE_NMI_SAFE_CMPXCHG if (GUSA_RB || CPU_SH4A) select ARCH_HAS_BINFMT_FLAT if !MMU + select ARCH_HAS_CPU_FINALIZE_INIT select ARCH_HAS_CURRENT_STACK_POINTER select ARCH_HAS_GIGANTIC_PAGE select ARCH_HAS_GCOV_PROFILE_ALL diff --git a/arch/sh/include/asm/bugs.h b/arch/sh/include/asm/bugs.h deleted file mode 100644 index fe52abb..0000000 --- a/arch/sh/include/asm/bugs.h +++ /dev/null @@ -1,74 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -#ifndef __ASM_SH_BUGS_H -#define __ASM_SH_BUGS_H - -/* - * This is included by init/main.c to check for architecture-dependent bug= s. - * - * Needs: - * void check_bugs(void); - */ - -/* - * I don't know of any Super-H bugs yet. - */ - -#include - -extern void select_idle_routine(void); - -static void __init check_bugs(void) -{ - extern unsigned long loops_per_jiffy; - char *p =3D &init_utsname()->machine[2]; /* "sh" */ - - select_idle_routine(); - - current_cpu_data.loops_per_jiffy =3D loops_per_jiffy; - - switch (current_cpu_data.family) { - case CPU_FAMILY_SH2: - *p++ =3D '2'; - break; - case CPU_FAMILY_SH2A: - *p++ =3D '2'; - *p++ =3D 'a'; - break; - case CPU_FAMILY_SH3: - *p++ =3D '3'; - break; - case CPU_FAMILY_SH4: - *p++ =3D '4'; - break; - case CPU_FAMILY_SH4A: - *p++ =3D '4'; - *p++ =3D 'a'; - break; - case CPU_FAMILY_SH4AL_DSP: - *p++ =3D '4'; - *p++ =3D 'a'; - *p++ =3D 'l'; - *p++ =3D '-'; - *p++ =3D 'd'; - *p++ =3D 's'; - *p++ =3D 'p'; - break; - case CPU_FAMILY_UNKNOWN: - /* - * Specifically use CPU_FAMILY_UNKNOWN rather than - * default:, so we're able to have the compiler whine - * about unhandled enumerations. - */ - break; - } - - printk("CPU: %s\n", get_cpu_subtype(¤t_cpu_data)); - -#ifndef __LITTLE_ENDIAN__ - /* 'eb' means 'Endian Big' */ - *p++ =3D 'e'; - *p++ =3D 'b'; -#endif - *p =3D '\0'; -} -#endif /* __ASM_SH_BUGS_H */ diff --git a/arch/sh/include/asm/processor.h b/arch/sh/include/asm/processo= r.h index 85a6c1c..73fba7c 100644 --- a/arch/sh/include/asm/processor.h +++ b/arch/sh/include/asm/processor.h @@ -166,6 +166,8 @@ extern unsigned int instruction_size(unsigned int insn); #define instruction_size(insn) (2) #endif =20 +void select_idle_routine(void); + #endif /* __ASSEMBLY__ */ =20 #include diff --git a/arch/sh/kernel/idle.c b/arch/sh/kernel/idle.c index d662503..045d93f 100644 --- a/arch/sh/kernel/idle.c +++ b/arch/sh/kernel/idle.c @@ -15,6 +15,7 @@ #include #include #include +#include #include #include =20 diff --git a/arch/sh/kernel/setup.c b/arch/sh/kernel/setup.c index af977ec..cf7c0f7 100644 --- a/arch/sh/kernel/setup.c +++ b/arch/sh/kernel/setup.c @@ -43,6 +43,7 @@ #include #include #include +#include #include #include =20 @@ -354,3 +355,57 @@ int test_mode_pin(int pin) { return sh_mv.mv_mode_pins() & pin; } + +void __init arch_cpu_finalize_init(void) +{ + char *p =3D &init_utsname()->machine[2]; /* "sh" */ + + select_idle_routine(); + + current_cpu_data.loops_per_jiffy =3D loops_per_jiffy; + + switch (current_cpu_data.family) { + case CPU_FAMILY_SH2: + *p++ =3D '2'; + break; + case CPU_FAMILY_SH2A: + *p++ =3D '2'; + *p++ =3D 'a'; + break; + case CPU_FAMILY_SH3: + *p++ =3D '3'; + break; + case CPU_FAMILY_SH4: + *p++ =3D '4'; + break; + case CPU_FAMILY_SH4A: + *p++ =3D '4'; + *p++ =3D 'a'; + break; + case CPU_FAMILY_SH4AL_DSP: + *p++ =3D '4'; + *p++ =3D 'a'; + *p++ =3D 'l'; + *p++ =3D '-'; + *p++ =3D 'd'; + *p++ =3D 's'; + *p++ =3D 'p'; + break; + case CPU_FAMILY_UNKNOWN: + /* + * Specifically use CPU_FAMILY_UNKNOWN rather than + * default:, so we're able to have the compiler whine + * about unhandled enumerations. + */ + break; + } + + pr_info("CPU: %s\n", get_cpu_subtype(¤t_cpu_data)); + +#ifndef __LITTLE_ENDIAN__ + /* 'eb' means 'Endian Big' */ + *p++ =3D 'e'; + *p++ =3D 'b'; +#endif + *p =3D '\0'; +}