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 phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 3D191C61DA4 for ; Sat, 11 Mar 2023 10:57:46 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 0643085B68; Sat, 11 Mar 2023 11:57:44 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kernel.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.b="RLfdL4ha"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 9FE35859AB; Sat, 11 Mar 2023 11:57:42 +0100 (CET) Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) (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 B7A2685B6E for ; Sat, 11 Mar 2023 11:57:39 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kernel.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=pali@kernel.org Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 5131DB824A8; Sat, 11 Mar 2023 10:57:39 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id ECC24C433A0; Sat, 11 Mar 2023 10:57:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1678532258; bh=j455yMK8S71HN46yEeMSYsoxpCUeaT2fKZSNErtbc6s=; h=From:To:Cc:Subject:Date:From; b=RLfdL4haHGjV3k1bn1CvgAiKPy6pRNEO9PKd0RdJFuX1Kencpzzz0TQ2Ua3uuNS0+ 5exOfy7aDJ3lEPOwZWLTcx4KfVkn5DygBoEUU393ss2eoa3ialRmE6hxCs0jBQFLgr 2N4AJvemInfjI9+ORZOVEm6CWEj6CHuY+qRZIYZtDiBfgLBZQGRsnjXVCtRtBiUkuu q5hMvDZHtiw5ospm4O9jwTfp3yc84ljJyimGYglk1JmnFEH7vfyB9VeBF/4L2I0b0j on9XYQwUfEV+GtcSMnxxvtNXZl8GGVPplIlxFgUIbB6z2TEm9gG2N4HaUO3S40kyka RLyGu8dzfvFCw== Received: by pali.im (Postfix) id 4584376B; Sat, 11 Mar 2023 11:57:35 +0100 (CET) From: =?UTF-8?q?Pali=20Roh=C3=A1r?= To: Stefan Roese , Tony Dinh , Walter Schweizer , Siddarth Gore , Michael Walle , Dave Purdy , Stefan Herbrechtsmeier , Luka Perkov , Simon Guinot , Evgeni Dobrev , Chris Packham Cc: u-boot@lists.denx.de (open list) Subject: [PATCH RFC u-boot-mvebu] arm: kirkwood: Move internal registers in arch_very_early_init() function Date: Sat, 11 Mar 2023 11:57:01 +0100 Message-Id: <20230311105701.19090-1-pali@kernel.org> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 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.103.8 at phobos.denx.de X-Virus-Status: Clean Same change as was done for mvebu in commit 5bb2c550b11e ("arm: mvebu: Move internal registers in arch_very_early_init() function") but for kirkwood. Signed-off-by: Pali Rohár --- Hello! Please test this RFC patch on more Kirkwood boards if there is any issue with it. --- arch/arm/mach-kirkwood/Kconfig | 2 ++ arch/arm/mach-kirkwood/Makefile | 1 + arch/arm/mach-kirkwood/cpu.c | 3 --- arch/arm/mach-kirkwood/lowlevel.S | 12 ++++++++++++ 4 files changed, 15 insertions(+), 3 deletions(-) create mode 100644 arch/arm/mach-kirkwood/lowlevel.S diff --git a/arch/arm/mach-kirkwood/Kconfig b/arch/arm/mach-kirkwood/Kconfig index c8a193dd4cdf..ba39e9ae416e 100644 --- a/arch/arm/mach-kirkwood/Kconfig +++ b/arch/arm/mach-kirkwood/Kconfig @@ -5,9 +5,11 @@ config FEROCEON_88FR131 config KW88F6192 bool + select ARCH_VERY_EARLY_INIT config KW88F6281 bool + select ARCH_VERY_EARLY_INIT config SHEEVA_88SV131 bool diff --git a/arch/arm/mach-kirkwood/Makefile b/arch/arm/mach-kirkwood/Makefile index 3b2eef8d5419..0fb5a2326f5f 100644 --- a/arch/arm/mach-kirkwood/Makefile +++ b/arch/arm/mach-kirkwood/Makefile @@ -6,6 +6,7 @@ obj-y = cpu.o obj-y += cache.o +obj-y += lowlevel.o obj-y += mpp.o # cpu.o and cache.o contain CP15 instructions which cannot be run in diff --git a/arch/arm/mach-kirkwood/cpu.c b/arch/arm/mach-kirkwood/cpu.c index df3e8f11782a..2b493b36c20d 100644 --- a/arch/arm/mach-kirkwood/cpu.c +++ b/arch/arm/mach-kirkwood/cpu.c @@ -189,9 +189,6 @@ int arch_cpu_init(void) struct kwcpu_registers *cpureg = (struct kwcpu_registers *)KW_CPU_REG_BASE; - /* Linux expects the internal registers to be at 0xf1000000 */ - writel(KW_REGS_PHY_BASE, KW_OFFSET_REG); - /* Enable and invalidate L2 cache in write through mode */ writel(readl(&cpureg->l2_cfg) | 0x18, &cpureg->l2_cfg); invalidate_l2_cache(); diff --git a/arch/arm/mach-kirkwood/lowlevel.S b/arch/arm/mach-kirkwood/lowlevel.S new file mode 100644 index 000000000000..3b339f97f056 --- /dev/null +++ b/arch/arm/mach-kirkwood/lowlevel.S @@ -0,0 +1,12 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ + +#include +#include + +ENTRY(arch_very_early_init) + /* Move internal registers from KW_OFFSET_REG to KW_REGS_PHY_BASE */ + ldr r0, =KW_REGS_PHY_BASE + ldr r1, =KW_OFFSET_REG + str r0, [r1] + bx lr +ENDPROC(arch_very_early_init) -- 2.20.1