Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

arm: vexpress: Remove obsolete RTSM DCSCB support

The Arm Versatile DCSCB support is unused as the compatible
"arm,rtsm,dcscb" is unused in any .dts file. It was only ever
implemented on a s/w model (RTSM).

Signed-off-by: Rob Herring (Arm) <robh@kernel.org>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20240510123238.3904779-1-robh@kernel.org
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>

authored by

Rob Herring (Arm) and committed by
Sudeep Holla
eb3f614a 1613e604

-219
-1
arch/arm/configs/vexpress_defconfig
··· 14 14 CONFIG_BLK_DEV_INITRD=y 15 15 CONFIG_PROFILING=y 16 16 CONFIG_ARCH_VEXPRESS=y 17 - CONFIG_ARCH_VEXPRESS_DCSCB=y 18 17 CONFIG_ARCH_VEXPRESS_TC2_PM=y 19 18 CONFIG_SMP=y 20 19 CONFIG_HAVE_ARM_ARCH_TIMER=y
-9
arch/arm/mach-versatile/Kconfig
··· 278 278 build a working kernel, you must also enable relevant core 279 279 tile support or Flattened Device Tree based support options. 280 280 281 - config ARCH_VEXPRESS_DCSCB 282 - bool "Dual Cluster System Control Block (DCSCB) support" 283 - depends on MCPM 284 - select ARM_CCI400_PORT_CTRL 285 - help 286 - Support for the Dual Cluster System Configuration Block (DCSCB). 287 - This is needed to provide CPU and cluster power management 288 - on RTSM implementing big.LITTLE. 289 - 290 281 config ARCH_VEXPRESS_SPC 291 282 bool "Versatile Express Serial Power Controller (SPC)" 292 283 select PM_OPP
-3
arch/arm/mach-versatile/Makefile
··· 16 16 17 17 # vexpress 18 18 obj-$(CONFIG_ARCH_VEXPRESS) := v2m.o 19 - obj-$(CONFIG_ARCH_VEXPRESS_DCSCB) += dcscb.o dcscb_setup.o 20 - CFLAGS_dcscb.o += -march=armv7-a 21 - CFLAGS_REMOVE_dcscb.o = -pg 22 19 obj-$(CONFIG_ARCH_VEXPRESS_SPC) += spc.o 23 20 CFLAGS_REMOVE_spc.o = -pg 24 21 obj-$(CONFIG_ARCH_VEXPRESS_TC2_PM) += tc2_pm.o
-173
arch/arm/mach-versatile/dcscb.c
··· 1 - // SPDX-License-Identifier: GPL-2.0-only 2 - /* 3 - * dcscb.c - Dual Cluster System Configuration Block 4 - * 5 - * Created by: Nicolas Pitre, May 2012 6 - * Copyright: (C) 2012-2013 Linaro Limited 7 - */ 8 - 9 - #include <linux/init.h> 10 - #include <linux/kernel.h> 11 - #include <linux/io.h> 12 - #include <linux/errno.h> 13 - #include <linux/of_address.h> 14 - #include <linux/vexpress.h> 15 - #include <linux/arm-cci.h> 16 - 17 - #include <asm/mcpm.h> 18 - #include <asm/proc-fns.h> 19 - #include <asm/cacheflush.h> 20 - #include <asm/cputype.h> 21 - #include <asm/cp15.h> 22 - 23 - #include "vexpress.h" 24 - 25 - #define RST_HOLD0 0x0 26 - #define RST_HOLD1 0x4 27 - #define SYS_SWRESET 0x8 28 - #define RST_STAT0 0xc 29 - #define RST_STAT1 0x10 30 - #define EAG_CFG_R 0x20 31 - #define EAG_CFG_W 0x24 32 - #define KFC_CFG_R 0x28 33 - #define KFC_CFG_W 0x2c 34 - #define DCS_CFG_R 0x30 35 - 36 - static void __iomem *dcscb_base; 37 - static int dcscb_allcpus_mask[2]; 38 - 39 - static int dcscb_cpu_powerup(unsigned int cpu, unsigned int cluster) 40 - { 41 - unsigned int rst_hold, cpumask = (1 << cpu); 42 - 43 - pr_debug("%s: cpu %u cluster %u\n", __func__, cpu, cluster); 44 - if (cluster >= 2 || !(cpumask & dcscb_allcpus_mask[cluster])) 45 - return -EINVAL; 46 - 47 - rst_hold = readl_relaxed(dcscb_base + RST_HOLD0 + cluster * 4); 48 - rst_hold &= ~(cpumask | (cpumask << 4)); 49 - writel_relaxed(rst_hold, dcscb_base + RST_HOLD0 + cluster * 4); 50 - return 0; 51 - } 52 - 53 - static int dcscb_cluster_powerup(unsigned int cluster) 54 - { 55 - unsigned int rst_hold; 56 - 57 - pr_debug("%s: cluster %u\n", __func__, cluster); 58 - if (cluster >= 2) 59 - return -EINVAL; 60 - 61 - /* remove cluster reset and add individual CPU's reset */ 62 - rst_hold = readl_relaxed(dcscb_base + RST_HOLD0 + cluster * 4); 63 - rst_hold &= ~(1 << 8); 64 - rst_hold |= dcscb_allcpus_mask[cluster]; 65 - writel_relaxed(rst_hold, dcscb_base + RST_HOLD0 + cluster * 4); 66 - return 0; 67 - } 68 - 69 - static void dcscb_cpu_powerdown_prepare(unsigned int cpu, unsigned int cluster) 70 - { 71 - unsigned int rst_hold; 72 - 73 - pr_debug("%s: cpu %u cluster %u\n", __func__, cpu, cluster); 74 - BUG_ON(cluster >= 2 || !((1 << cpu) & dcscb_allcpus_mask[cluster])); 75 - 76 - rst_hold = readl_relaxed(dcscb_base + RST_HOLD0 + cluster * 4); 77 - rst_hold |= (1 << cpu); 78 - writel_relaxed(rst_hold, dcscb_base + RST_HOLD0 + cluster * 4); 79 - } 80 - 81 - static void dcscb_cluster_powerdown_prepare(unsigned int cluster) 82 - { 83 - unsigned int rst_hold; 84 - 85 - pr_debug("%s: cluster %u\n", __func__, cluster); 86 - BUG_ON(cluster >= 2); 87 - 88 - rst_hold = readl_relaxed(dcscb_base + RST_HOLD0 + cluster * 4); 89 - rst_hold |= (1 << 8); 90 - writel_relaxed(rst_hold, dcscb_base + RST_HOLD0 + cluster * 4); 91 - } 92 - 93 - static void dcscb_cpu_cache_disable(void) 94 - { 95 - /* Disable and flush the local CPU cache. */ 96 - v7_exit_coherency_flush(louis); 97 - } 98 - 99 - static void dcscb_cluster_cache_disable(void) 100 - { 101 - /* Flush all cache levels for this cluster. */ 102 - v7_exit_coherency_flush(all); 103 - 104 - /* 105 - * A full outer cache flush could be needed at this point 106 - * on platforms with such a cache, depending on where the 107 - * outer cache sits. In some cases the notion of a "last 108 - * cluster standing" would need to be implemented if the 109 - * outer cache is shared across clusters. In any case, when 110 - * the outer cache needs flushing, there is no concurrent 111 - * access to the cache controller to worry about and no 112 - * special locking besides what is already provided by the 113 - * MCPM state machinery is needed. 114 - */ 115 - 116 - /* 117 - * Disable cluster-level coherency by masking 118 - * incoming snoops and DVM messages: 119 - */ 120 - cci_disable_port_by_cpu(read_cpuid_mpidr()); 121 - } 122 - 123 - static const struct mcpm_platform_ops dcscb_power_ops = { 124 - .cpu_powerup = dcscb_cpu_powerup, 125 - .cluster_powerup = dcscb_cluster_powerup, 126 - .cpu_powerdown_prepare = dcscb_cpu_powerdown_prepare, 127 - .cluster_powerdown_prepare = dcscb_cluster_powerdown_prepare, 128 - .cpu_cache_disable = dcscb_cpu_cache_disable, 129 - .cluster_cache_disable = dcscb_cluster_cache_disable, 130 - }; 131 - 132 - extern void dcscb_power_up_setup(unsigned int affinity_level); 133 - 134 - static int __init dcscb_init(void) 135 - { 136 - struct device_node *node; 137 - unsigned int cfg; 138 - int ret; 139 - 140 - if (!cci_probed()) 141 - return -ENODEV; 142 - 143 - node = of_find_compatible_node(NULL, NULL, "arm,rtsm,dcscb"); 144 - if (!node) 145 - return -ENODEV; 146 - dcscb_base = of_iomap(node, 0); 147 - of_node_put(node); 148 - if (!dcscb_base) 149 - return -EADDRNOTAVAIL; 150 - cfg = readl_relaxed(dcscb_base + DCS_CFG_R); 151 - dcscb_allcpus_mask[0] = (1 << (((cfg >> 16) >> (0 << 2)) & 0xf)) - 1; 152 - dcscb_allcpus_mask[1] = (1 << (((cfg >> 16) >> (1 << 2)) & 0xf)) - 1; 153 - 154 - ret = mcpm_platform_register(&dcscb_power_ops); 155 - if (!ret) 156 - ret = mcpm_sync_init(dcscb_power_up_setup); 157 - if (ret) { 158 - iounmap(dcscb_base); 159 - return ret; 160 - } 161 - 162 - pr_info("VExpress DCSCB support installed\n"); 163 - 164 - /* 165 - * Future entries into the kernel can now go 166 - * through the cluster entry vectors. 167 - */ 168 - vexpress_flags_set(__pa_symbol(mcpm_entry_point)); 169 - 170 - return 0; 171 - } 172 - 173 - early_initcall(dcscb_init);
-33
arch/arm/mach-versatile/dcscb_setup.S
··· 1 - /* SPDX-License-Identifier: GPL-2.0-only */ 2 - /* 3 - * Created by: Dave Martin, 2012-06-22 4 - * Copyright: (C) 2012-2013 Linaro Limited 5 - */ 6 - 7 - #include <linux/linkage.h> 8 - 9 - 10 - ENTRY(dcscb_power_up_setup) 11 - 12 - cmp r0, #0 @ check affinity level 13 - beq 2f 14 - 15 - /* 16 - * Enable cluster-level coherency, in preparation for turning on the MMU. 17 - * The ACTLR SMP bit does not need to be set here, because cpu_resume() 18 - * already restores that. 19 - * 20 - * A15/A7 may not require explicit L2 invalidation on reset, dependent 21 - * on hardware integration decisions. 22 - * For now, this code assumes that L2 is either already invalidated, 23 - * or invalidation is not required. 24 - */ 25 - 26 - b cci_enable_port_for_self 27 - 28 - 2: @ Implementation-specific local CPU setup operations should go here, 29 - @ if any. In this case, there is nothing to do. 30 - 31 - bx lr 32 - 33 - ENDPROC(dcscb_power_up_setup)