From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f44.google.com (mail-wm1-f44.google.com [209.85.128.44]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7F982346A07 for ; Mon, 13 Jul 2026 19:25:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.44 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783970713; cv=none; b=IBkkZmjmsJfw7J0XS7peLgOK9+HNbsdLfZ7bu5GCE73Iiba2m6cVMyH0Yr762f5ZqKG0AFfSpZonBOMsRq536GrcnDxurfTEdNKQVPkIMJKxQ/sC+Q5zO/KARYy0mBhKYNTgwltyKMah8mk4MmHyVZ/946iG/iwbY/cNr2LO9cY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783970713; c=relaxed/simple; bh=Ukmpls2pjtetm8cQVOv6j++10BiGkqGEv58iIWFCvlg=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=TdpNmriFx5+CPEgysL8+FuvJs8LcrPjRsKsDEGowfFo/1tAOeff8Bu/Mdk4bb/ShpmA1N+9bhkkfbtrDEmkNuVFX+XR7ABnhuErPXbgM17UcZCT0u4yurLYRrxAl1t/lJ7q907q//s8PV/jbzOGTVOue4uZCofin0+4GiEPcVAg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=gA3vkZsJ; arc=none smtp.client-ip=209.85.128.44 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="gA3vkZsJ" Received: by mail-wm1-f44.google.com with SMTP id 5b1f17b1804b1-493b1710405so18975185e9.2 for ; Mon, 13 Jul 2026 12:25:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1783970711; x=1784575511; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to:content-type; bh=z+xB3TUCO9UrjdGLJb+39sEEHPhvQQhEnyMJTNd+wdw=; b=gA3vkZsJTxqg0Cd2DELiOP8m0mVO7JLUBmMisuzjt/9hUVH4846Yea9kSMkPUnfDFD MPaaf/cK1e9MpA7tyhmi0QS1CwrcZVHVADYpI8+F6cMwZwM3eodyNnER7ZzGw67t7hB8 Qzvyskwjb5ef58Cbtv8KZBoZ3Kh/DtdMxrie2i9/xwPkNHg9RDva1/Hh+y5mgTXah/na cThP2d8wgapNvQAUFYmpAy1OGo+jnMp9oBerXU/zjp8rAdX8ki6jHclgpmin/Jy6vU+X RElhEZmdZ94CS9s5HBnzITZXzQe28dgQ6MhkFjAuGGGL71gPOkxI5dc3s+mSpVEvuq3Y WEgw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1783970711; x=1784575511; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=z+xB3TUCO9UrjdGLJb+39sEEHPhvQQhEnyMJTNd+wdw=; b=bMkfCBUrRYPsFYxWuIYHPUr+LDivrUGyebm+oNhIqrfKAojF60kLcVyHCmQnaF+vI5 W1AF5TKwQctquZEI/VAudD5tvmRyH6oGvVcDVhshbaZ/xIIDKB73eKqmeezeexFQT1GM zbxCBnAcWqn9mFGd/hNJWbbKGgdloWE3F9SzfhHQguVvor9Ahr6SAoU49gXbQr3J03qj Z5ymGC7Mn67/mGoEyNfVY67aTeSasF1DYkZ5vsjHTktdK1UaoEftskVVpxkb5gwH8Cwv b7CV86ey4dkxyImETqu0wm3TDn5ioG1BiYdv2ASVMTCoqM19BZmajM+XsmEr3ABbrIeR qCyw== X-Forwarded-Encrypted: i=1; AHgh+RqAuYe5bBZ5xR3DKomuErUpvH+8OGj1126a6OvbLJaMJYAiwvA+b0U4kpSbeYV102XqhOVfpz3Q4ZZtjxU=@vger.kernel.org X-Gm-Message-State: AOJu0YweEi4801uwWjSbuLoQohUJtHvd6MR5lk2FuNU8HW6VziafhATi pcZ2+Y5B03jpLCJvfTpUbI4NxB7A2uAmH0WlkF8TQc/n3E4AEqJt0otX X-Gm-Gg: AfdE7ckwAfGS90TbtM2F/ACDF0jKr2Wpclw1pCyuB8KNjlZTJVnqCLPfdtugs2kyVwv zxoUrPS+ARQWlcuXgRbGbzAvBRkGPyy7bFrQyhaSFbussWKWvLvvfloK+WwM+DAv5Tg/Z8mKCMM uO7DBihGStaSu78Kjf6HithaWpHgtXOhU9XLV1MXocfP82073NkXsEabYqxOJKE3tk+lSdJ9WOY 4eRKE6a3gocQWF4SOdzf+3I/PDgu5EBWo1yra5LJfZe+pHHLnX4gYkMhCzMJZMThZzfgXQYP9GT XAiBV1Pzo9cJUiwuzX/WrKEPLBf8Zz8EKEFBb96pdBFMK4tie64f5hWeSrnH0+QLiCDdOL+eNvh 7VgTEGKGkzlldNOWNyE9c3zk4GYd3E5wGMVJkRqc8OJFFDjp0daOpt+zVJdA/wf6BfVYKKAAR9g vQUDPA+b2R8UZACksYPG5cny+vjP7jQjbFEpNBRMpjIiGKz7Fe5v9O8XowOLNYnY/P+D+d5QhgW xYwXJh77ZU05Zp9nNka0yZc86bycuKIIbzKVutVUeNLZriD/j9yxPdDct5zQvdk7QlDGvfa0e4D 55kc/36L3JdapFYgtUeq X-Received: by 2002:a05:600c:6095:b0:493:e983:806e with SMTP id 5b1f17b1804b1-495158c68c7mr8361975e9.3.1783970710468; Mon, 13 Jul 2026 12:25:10 -0700 (PDT) Received: from localhost.localdomain (dynamic-2a02-3100-a4a7-df01-9434-c79e-9028-76f8.310.pool.telefonica.de. [2a02:3100:a4a7:df01:9434:c79e:9028:76f8]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4950a322c86sm15376195e9.11.2026.07.13.12.25.09 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 13 Jul 2026 12:25:09 -0700 (PDT) From: Karl Mehltretter To: Vladimir Zapolskiy , Piotr Wojtaszczyk Cc: Arnd Bergmann , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Karl Mehltretter Subject: [PATCH v2] ARM: lpc32xx: only run SoC init on LPC32xx hardware Date: Mon, 13 Jul 2026 21:25:06 +0200 Message-Id: <20260713192506.7782-1-kmehltretter@gmail.com> X-Mailer: git-send-email 2.39.5 (Apple Git-154) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit lpc32xx_check_uid() and lpc32xx_pm_init() are arch_initcalls that poke LPC32xx-only registers. Since the multiplatform conversion they also run on other ARCH_MULTI_V5 boards where access faults e.g. on versatile: Unable to handle kernel paging request at virtual address f4004130 PC is at lpc32xx_check_uid+0x2c/0x9c Drop the arch_initcall() registrations and call both functions directly from lpc3250_machine_init(), the machine's .init_machine hook. The calls are placed in link order (common.c, pm.c, phy3250.c) to keep their previous relative ordering. Fixes: 75bf1bd7d2f9 ("ARM: lpc32xx: allow multiplatform build") Suggested-by: Arnd Bergmann Signed-off-by: Karl Mehltretter --- v2: - Rather than guarding the two arch_initcalls, drop the initcalls entirely and call both functions from lpc3250_machine_init(), which is already guarded properly. (Suggested by Arnd.) arch/arm/mach-lpc32xx/common.c | 5 +---- arch/arm/mach-lpc32xx/common.h | 2 ++ arch/arm/mach-lpc32xx/phy3250.c | 2 ++ arch/arm/mach-lpc32xx/pm.c | 5 +---- 4 files changed, 6 insertions(+), 8 deletions(-) diff --git a/arch/arm/mach-lpc32xx/common.c b/arch/arm/mach-lpc32xx/common.c index 304ea61a0716..35ed3569c5a3 100644 --- a/arch/arm/mach-lpc32xx/common.c +++ b/arch/arm/mach-lpc32xx/common.c @@ -106,7 +106,7 @@ void __init lpc32xx_map_io(void) iotable_init(lpc32xx_io_desc, ARRAY_SIZE(lpc32xx_io_desc)); } -static int __init lpc32xx_check_uid(void) +void __init lpc32xx_check_uid(void) { u32 uid[4]; @@ -119,7 +119,4 @@ static int __init lpc32xx_check_uid(void) system_serial_low = uid[0]; system_serial_high = uid[1]; } - - return 1; } -arch_initcall(lpc32xx_check_uid); diff --git a/arch/arm/mach-lpc32xx/common.h b/arch/arm/mach-lpc32xx/common.h index 32f0ad217807..06b20bea324e 100644 --- a/arch/arm/mach-lpc32xx/common.h +++ b/arch/arm/mach-lpc32xx/common.h @@ -16,6 +16,8 @@ * Other arch specific structures and functions */ extern void __init lpc32xx_map_io(void); +extern void __init lpc32xx_check_uid(void); +extern void __init lpc32xx_pm_init(void); extern void __init lpc32xx_serial_init(void); /* diff --git a/arch/arm/mach-lpc32xx/phy3250.c b/arch/arm/mach-lpc32xx/phy3250.c index 66701bf43248..ddc6333ca55d 100644 --- a/arch/arm/mach-lpc32xx/phy3250.c +++ b/arch/arm/mach-lpc32xx/phy3250.c @@ -71,6 +71,8 @@ static const struct of_dev_auxdata lpc32xx_auxdata_lookup[] __initconst = { static void __init lpc3250_machine_init(void) { + lpc32xx_check_uid(); + lpc32xx_pm_init(); lpc32xx_serial_init(); of_platform_default_populate(NULL, lpc32xx_auxdata_lookup, NULL); diff --git a/arch/arm/mach-lpc32xx/pm.c b/arch/arm/mach-lpc32xx/pm.c index 2572bd89a5e8..9b5c5e1462ed 100644 --- a/arch/arm/mach-lpc32xx/pm.c +++ b/arch/arm/mach-lpc32xx/pm.c @@ -120,7 +120,7 @@ static const struct platform_suspend_ops lpc32xx_pm_ops = { #define EMC_DYN_MEM_CTRL_OFS 0x20 #define EMC_SRMMC (1 << 3) #define EMC_CTRL_REG io_p2v(LPC32XX_EMC_BASE + EMC_DYN_MEM_CTRL_OFS) -static int __init lpc32xx_pm_init(void) +void __init lpc32xx_pm_init(void) { /* * Setup SDRAM self-refresh clock to automatically disable o @@ -129,7 +129,4 @@ static int __init lpc32xx_pm_init(void) __raw_writel(__raw_readl(EMC_CTRL_REG) | EMC_SRMMC, EMC_CTRL_REG); suspend_set_ops(&lpc32xx_pm_ops); - - return 0; } -arch_initcall(lpc32xx_pm_init); -- 2.39.5 (Apple Git-154)