From mboxrd@z Thu Jan 1 00:00:00 1970 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E41CEC433EF for ; Tue, 31 May 2022 04:52:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=WdjaYgeM+CZftohVU3zLi1Eeh2VGt1nq9Ymdtfvj1f0=; b=c6UM+ZaZvtcHQn WmtWo7/0KpoM3pcRMXR+/cL9Ahkwkq6uGRSbZYmP9UyI2cJ2wc2diuBoScACKTDaxMsLGDq2bd14m sryFd+seuv8+G4zxhh7xpqKOmEfvzzE6oXeq2dXukUtVvsz94uryIJso8FL+NomZoYeVPdstUdgSR LNyMkp1ySsSkigiT3FU6dnY0r6D/qvQhfvGrLSJ8SfvIq3qG80rGewEKnE99uXCYeW9i2r0J/5zUh Nai8AvePZCjvzkP88B8rK8ssXVOFZJp1dnenLsW31Im3clron9GmkrlHM6DLr3qt4hRshM9Mj2yfe SA75DgOBmbc7hr/euSIA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nvtqM-009G0w-OO; Tue, 31 May 2022 04:50:58 +0000 Received: from wout3-smtp.messagingengine.com ([64.147.123.19]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nvtqB-009FwG-UD for linux-arm-kernel@lists.infradead.org; Tue, 31 May 2022 04:50:49 +0000 Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.west.internal (Postfix) with ESMTP id BB4333200935; Tue, 31 May 2022 00:50:45 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Tue, 31 May 2022 00:50:47 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sholland.org; h= cc:cc:content-transfer-encoding:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:sender :subject:subject:to:to; s=fm2; t=1653972645; x=1654059045; bh=FW jZmI4EaR1XZe8Uu9VR6zEl9VrAmbrBoz7dMVCbOZc=; b=Yf3f6anEAJsfy/RfKH PrSfWvx9acPMXnwF2eQ5g72tm0NHUl2EzsiP/Xc6VMnx8ALZQMxcIt6GywWStDVh kuYq4g+Ipv/K6HTWylHK7DIUntjP6Y7OIrIlXt+lRG0Qee8gEZdEkSu8UaDmOeaQ 9LcAdDXeRSms+Jtt6UUvpkPO2HmqbjmTYLgJe4Mxp/UDGj8lQcFSwnexGf5JYPYh +R41X7bCrL5qr28kKudQItKl0jpi9Jncl2CjrMeuKgZHA6pCHZMp0z4tYt82JazN rsiR+FWI3XlVnzqhLiaWFBT0ehJhD+QFRSkawJm9QiheAfptfTdQxp8dnvhJlYib Q8nA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; t=1653972645; x=1654059045; bh=FWjZmI4EaR1XZ e8Uu9VR6zEl9VrAmbrBoz7dMVCbOZc=; b=G72N9V5vr7ojnqjYAJ0VpxsMEFnTy 7j8Rio2+pmIKiotZWukVm6ZGUssAizpOjyhe2cyC7+GRruSZHqfQdE8VJeVBBGJr Y4jjuXomtA67UNgNbOZXwkvxrJpzsnBGPorVsqm4AL8LpZKvFqNhLYym9n0DHTon fST6M63NaBlL9CyqWyt00yZu2h8j8NHvKbgJlaUcZvYGpaEjFUZISijp7WrMZ6bn N2hhJ8kgdz47wiMlCTeGiAy4Ce1BhWmB7GI1PprXFQLSNoYFy6IbOk3my57rYlFh ylVlGrhEyxZ2/dEhvfiydwgxG7LP7AsQQYZRArkDUYVFKxTQ/MSojCLCw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrkeejgdeklecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvfevufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpefurghmuhgv lhcujfholhhlrghnugcuoehsrghmuhgvlhesshhhohhllhgrnhgurdhorhhgqeenucggtf frrghtthgvrhhnpedukeetueduhedtleetvefguddvvdejhfefudelgfduveeggeehgfdu feeitdevteenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhroh hmpehsrghmuhgvlhesshhhohhllhgrnhgurdhorhhg X-ME-Proxy: Feedback-ID: i0ad843c9:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 31 May 2022 00:50:44 -0400 (EDT) From: Samuel Holland To: Chen-Yu Tsai , Jernej Skrabec Cc: Russell King , Samuel Holland , Bartosz Dudziak , Bjorn Andersson , Krzysztof Kozlowski , Lorenzo Pieralisi , Luca Weiss , Maxime Ripard , Rob Herring , Robin Murphy , Stephan Gerhold , Thierry Reding , Vinod Koul , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-sunxi@lists.linux.dev Subject: [PATCH 1/3] ARM: sunxi: Remove A31 and A23/A33 platform SMP code Date: Mon, 30 May 2022 23:50:36 -0500 Message-Id: <20220531045038.42230-2-samuel@sholland.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220531045038.42230-1-samuel@sholland.org> References: <20220531045038.42230-1-samuel@sholland.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220530_215048_057338_5E30A497 X-CRM114-Status: GOOD ( 18.99 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org U-Boot has provided PSCI on Allwinner A31 and A23/A33 since May 2015, commit 014414f53695 ("ARM: sunxi: Enable PSCI for sun8i"). Since we can assume PSCI is available on these platforms, the custom SMP bringup code is no longer used, and it can be removed. The platform SMP code has a hidden dependency on the legacy PRCM bindings, so it would be broken anyway when those are retired. Signed-off-by: Samuel Holland --- arch/arm/mach-sunxi/Makefile | 1 - arch/arm/mach-sunxi/platsmp.c | 194 ---------------------------------- 2 files changed, 195 deletions(-) delete mode 100644 arch/arm/mach-sunxi/platsmp.c diff --git a/arch/arm/mach-sunxi/Makefile b/arch/arm/mach-sunxi/Makefile index 146e623c54d3..e5dc8530e98c 100644 --- a/arch/arm/mach-sunxi/Makefile +++ b/arch/arm/mach-sunxi/Makefile @@ -3,4 +3,3 @@ CFLAGS_mc_smp.o += -march=armv7-a obj-$(CONFIG_ARCH_SUNXI) += sunxi.o obj-$(CONFIG_ARCH_SUNXI_MC_SMP) += mc_smp.o headsmp.o -obj-$(CONFIG_SMP) += platsmp.o diff --git a/arch/arm/mach-sunxi/platsmp.c b/arch/arm/mach-sunxi/platsmp.c deleted file mode 100644 index 052097e78e6e..000000000000 --- a/arch/arm/mach-sunxi/platsmp.c +++ /dev/null @@ -1,194 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0 -/* - * SMP support for Allwinner SoCs - * - * Copyright (C) 2013 Maxime Ripard - * - * Maxime Ripard - * - * Based on code - * Copyright (C) 2012-2013 Allwinner Ltd. - * - */ - -#include -#include -#include -#include -#include -#include -#include - -#define CPUCFG_CPU_PWR_CLAMP_STATUS_REG(cpu) ((cpu) * 0x40 + 0x64) -#define CPUCFG_CPU_RST_CTRL_REG(cpu) (((cpu) + 1) * 0x40) -#define CPUCFG_CPU_CTRL_REG(cpu) (((cpu) + 1) * 0x40 + 0x04) -#define CPUCFG_CPU_STATUS_REG(cpu) (((cpu) + 1) * 0x40 + 0x08) -#define CPUCFG_GEN_CTRL_REG 0x184 -#define CPUCFG_PRIVATE0_REG 0x1a4 -#define CPUCFG_PRIVATE1_REG 0x1a8 -#define CPUCFG_DBG_CTL0_REG 0x1e0 -#define CPUCFG_DBG_CTL1_REG 0x1e4 - -#define PRCM_CPU_PWROFF_REG 0x100 -#define PRCM_CPU_PWR_CLAMP_REG(cpu) (((cpu) * 4) + 0x140) - -static void __iomem *cpucfg_membase; -static void __iomem *prcm_membase; - -static DEFINE_SPINLOCK(cpu_lock); - -static void __init sun6i_smp_prepare_cpus(unsigned int max_cpus) -{ - struct device_node *node; - - node = of_find_compatible_node(NULL, NULL, "allwinner,sun6i-a31-prcm"); - if (!node) { - pr_err("Missing A31 PRCM node in the device tree\n"); - return; - } - - prcm_membase = of_iomap(node, 0); - of_node_put(node); - if (!prcm_membase) { - pr_err("Couldn't map A31 PRCM registers\n"); - return; - } - - node = of_find_compatible_node(NULL, NULL, - "allwinner,sun6i-a31-cpuconfig"); - if (!node) { - pr_err("Missing A31 CPU config node in the device tree\n"); - return; - } - - cpucfg_membase = of_iomap(node, 0); - of_node_put(node); - if (!cpucfg_membase) - pr_err("Couldn't map A31 CPU config registers\n"); - -} - -static int sun6i_smp_boot_secondary(unsigned int cpu, - struct task_struct *idle) -{ - u32 reg; - int i; - - if (!(prcm_membase && cpucfg_membase)) - return -EFAULT; - - spin_lock(&cpu_lock); - - /* Set CPU boot address */ - writel(__pa_symbol(secondary_startup), - cpucfg_membase + CPUCFG_PRIVATE0_REG); - - /* Assert the CPU core in reset */ - writel(0, cpucfg_membase + CPUCFG_CPU_RST_CTRL_REG(cpu)); - - /* Assert the L1 cache in reset */ - reg = readl(cpucfg_membase + CPUCFG_GEN_CTRL_REG); - writel(reg & ~BIT(cpu), cpucfg_membase + CPUCFG_GEN_CTRL_REG); - - /* Disable external debug access */ - reg = readl(cpucfg_membase + CPUCFG_DBG_CTL1_REG); - writel(reg & ~BIT(cpu), cpucfg_membase + CPUCFG_DBG_CTL1_REG); - - /* Power up the CPU */ - for (i = 0; i <= 8; i++) - writel(0xff >> i, prcm_membase + PRCM_CPU_PWR_CLAMP_REG(cpu)); - mdelay(10); - - /* Clear CPU power-off gating */ - reg = readl(prcm_membase + PRCM_CPU_PWROFF_REG); - writel(reg & ~BIT(cpu), prcm_membase + PRCM_CPU_PWROFF_REG); - mdelay(1); - - /* Deassert the CPU core reset */ - writel(3, cpucfg_membase + CPUCFG_CPU_RST_CTRL_REG(cpu)); - - /* Enable back the external debug accesses */ - reg = readl(cpucfg_membase + CPUCFG_DBG_CTL1_REG); - writel(reg | BIT(cpu), cpucfg_membase + CPUCFG_DBG_CTL1_REG); - - spin_unlock(&cpu_lock); - - return 0; -} - -static const struct smp_operations sun6i_smp_ops __initconst = { - .smp_prepare_cpus = sun6i_smp_prepare_cpus, - .smp_boot_secondary = sun6i_smp_boot_secondary, -}; -CPU_METHOD_OF_DECLARE(sun6i_a31_smp, "allwinner,sun6i-a31", &sun6i_smp_ops); - -static void __init sun8i_smp_prepare_cpus(unsigned int max_cpus) -{ - struct device_node *node; - - node = of_find_compatible_node(NULL, NULL, "allwinner,sun8i-a23-prcm"); - if (!node) { - pr_err("Missing A23 PRCM node in the device tree\n"); - return; - } - - prcm_membase = of_iomap(node, 0); - of_node_put(node); - if (!prcm_membase) { - pr_err("Couldn't map A23 PRCM registers\n"); - return; - } - - node = of_find_compatible_node(NULL, NULL, - "allwinner,sun8i-a23-cpuconfig"); - if (!node) { - pr_err("Missing A23 CPU config node in the device tree\n"); - return; - } - - cpucfg_membase = of_iomap(node, 0); - of_node_put(node); - if (!cpucfg_membase) - pr_err("Couldn't map A23 CPU config registers\n"); - -} - -static int sun8i_smp_boot_secondary(unsigned int cpu, - struct task_struct *idle) -{ - u32 reg; - - if (!(prcm_membase && cpucfg_membase)) - return -EFAULT; - - spin_lock(&cpu_lock); - - /* Set CPU boot address */ - writel(__pa_symbol(secondary_startup), - cpucfg_membase + CPUCFG_PRIVATE0_REG); - - /* Assert the CPU core in reset */ - writel(0, cpucfg_membase + CPUCFG_CPU_RST_CTRL_REG(cpu)); - - /* Assert the L1 cache in reset */ - reg = readl(cpucfg_membase + CPUCFG_GEN_CTRL_REG); - writel(reg & ~BIT(cpu), cpucfg_membase + CPUCFG_GEN_CTRL_REG); - - /* Clear CPU power-off gating */ - reg = readl(prcm_membase + PRCM_CPU_PWROFF_REG); - writel(reg & ~BIT(cpu), prcm_membase + PRCM_CPU_PWROFF_REG); - mdelay(1); - - /* Deassert the CPU core reset */ - writel(3, cpucfg_membase + CPUCFG_CPU_RST_CTRL_REG(cpu)); - - spin_unlock(&cpu_lock); - - return 0; -} - -static const struct smp_operations sun8i_smp_ops __initconst = { - .smp_prepare_cpus = sun8i_smp_prepare_cpus, - .smp_boot_secondary = sun8i_smp_boot_secondary, -}; -CPU_METHOD_OF_DECLARE(sun8i_a23_smp, "allwinner,sun8i-a23", &sun8i_smp_ops); -- 2.35.1 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel