aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-bcm
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2016-08-01 18:27:08 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2016-08-01 18:27:08 -0400
commitfbae5cbb43512446ba15a3b90039cb127d22ee95 (patch)
tree29f539576bc46537d7013d0ec0f4c2082dbca278 /arch/arm/mach-bcm
parent6f888fe31dfcda4cb25018b0af3f50049fcf0b7f (diff)
parent4756f881ba303e4dada613feeacf44d26c3e35b9 (diff)
Merge tag 'armsoc-soc' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc
Pull ARM SoC platform updates from Olof Johansson: "Improved and new platform support for various SoCs: New SoC support: - Broadcom BCM23550 - Freescale i.MX7Solo - Qualcomm MDM9615 - Renesas r8a7792 Improvements: - convert clps711x to multiplatform - debug uart improvements for Atmel platforms - Tango platform improvements: HOTPLUG_CPU, Suspend-to-ram - OMAP tweaks and improvements to hwmod - OMAP support for kexec on SMP" * tag 'armsoc-soc' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (109 commits) ARM: davinci: fix build break because of undeclared dm365_evm_snd_data ARM: s3c64xx: smartq: Avoid sparse warnings ARM: sti: Implement dummy L2 cache's write_sec ARM: STi: Update machine _namestr to be more generic. arm: meson: explicitly select clk drivers ARM: tango: add Suspend-to-RAM support ARM: hisi: consolidate the hisilicon machine entries ARM: tango: fix CONFIG_HOTPLUG_CPU=n build MAINTAINERS: Update BCM281XX/BCM11XXX/BCM216XX entry MAINTAINERS: Update BCM63XX entry MAINTAINERS: Add NS2 entry MAINTAINERS: Fix nsp false-positives MAINTAINERS: Change L to M for Broadcom ARM/ARM64 SoC entries ARM: debug: Enable DEBUG_BCM_5301X for Northstar Plus SoCs ARM: clps711x: Switch to MULTIPLATFORM ARM: clps711x: Remove boards support ARM: clps711x: Add basic DT support ARM: clps711x: Reduce static map size ARM: SAMSUNG: Constify iomem address passed to s5p_init_cpu ARM: oxnas: Change OX810SE default driver config ...
Diffstat (limited to 'arch/arm/mach-bcm')
-rw-r--r--arch/arm/mach-bcm/Kconfig12
-rw-r--r--arch/arm/mach-bcm/Makefile5
-rw-r--r--arch/arm/mach-bcm/board_bcm21664.c43
-rw-r--r--arch/arm/mach-bcm/board_bcm23550.c25
-rw-r--r--arch/arm/mach-bcm/kona_l2_cache.c1
-rw-r--r--arch/arm/mach-bcm/platsmp.c58
6 files changed, 98 insertions, 46 deletions
diff --git a/arch/arm/mach-bcm/Kconfig b/arch/arm/mach-bcm/Kconfig
index 5f63f513d9c9..34f0fca0b847 100644
--- a/arch/arm/mach-bcm/Kconfig
+++ b/arch/arm/mach-bcm/Kconfig
@@ -112,9 +112,17 @@ config ARCH_BCM_21664
112 Enable support for the BCM21664 family, which includes 112 Enable support for the BCM21664 family, which includes
113 BCM21663 and BCM21664 variants. 113 BCM21663 and BCM21664 variants.
114 114
115config ARCH_BCM_23550
116 bool "Broadcom BCM23550 SoC"
117 depends on ARCH_MULTI_V7
118 select ARCH_BCM_MOBILE
119 select HAVE_SMP
120 help
121 Enable support for the BCM23550.
122
115config ARCH_BCM_MOBILE_L2_CACHE 123config ARCH_BCM_MOBILE_L2_CACHE
116 bool "Broadcom mobile SoC level 2 cache support" 124 bool "Broadcom mobile SoC level 2 cache support"
117 depends on ARCH_BCM_MOBILE 125 depends on ARCH_BCM_281XX || ARCH_BCM_21664
118 default y 126 default y
119 select CACHE_L2X0 127 select CACHE_L2X0
120 select ARCH_BCM_MOBILE_SMC 128 select ARCH_BCM_MOBILE_SMC
@@ -129,7 +137,7 @@ config ARCH_BCM_MOBILE_SMP
129 select HAVE_ARM_SCU 137 select HAVE_ARM_SCU
130 select ARM_ERRATA_764369 138 select ARM_ERRATA_764369
131 help 139 help
132 SMP support for the BCM281XX and BCM21664 SoC families. 140 SMP support for the BCM281XX, BCM21664 and BCM23550 SoC families.
133 Provided as an option so SMP support for SoCs of this type 141 Provided as an option so SMP support for SoCs of this type
134 can be disabled for an SMP-enabled kernel. 142 can be disabled for an SMP-enabled kernel.
135 143
diff --git a/arch/arm/mach-bcm/Makefile b/arch/arm/mach-bcm/Makefile
index 7d665151c772..980f5850097c 100644
--- a/arch/arm/mach-bcm/Makefile
+++ b/arch/arm/mach-bcm/Makefile
@@ -26,7 +26,10 @@ obj-$(CONFIG_ARCH_BCM_281XX) += board_bcm281xx.o
26# BCM21664 26# BCM21664
27obj-$(CONFIG_ARCH_BCM_21664) += board_bcm21664.o 27obj-$(CONFIG_ARCH_BCM_21664) += board_bcm21664.o
28 28
29# BCM281XX and BCM21664 SMP support 29# BCM23550
30obj-$(CONFIG_ARCH_BCM_23550) += board_bcm23550.o
31
32# BCM281XX, BCM21664 and BCM23550 SMP support
30obj-$(CONFIG_ARCH_BCM_MOBILE_SMP) += platsmp.o 33obj-$(CONFIG_ARCH_BCM_MOBILE_SMP) += platsmp.o
31 34
32# BCM281XX and BCM21664 L2 cache control 35# BCM281XX and BCM21664 L2 cache control
diff --git a/arch/arm/mach-bcm/board_bcm21664.c b/arch/arm/mach-bcm/board_bcm21664.c
index 0d7034c57334..c5bf01641172 100644
--- a/arch/arm/mach-bcm/board_bcm21664.c
+++ b/arch/arm/mach-bcm/board_bcm21664.c
@@ -11,52 +11,10 @@
11 * GNU General Public License for more details. 11 * GNU General Public License for more details.
12 */ 12 */
13 13
14#include <linux/of_address.h>
15#include <linux/io.h>
16
17#include <asm/mach/arch.h> 14#include <asm/mach/arch.h>
18 15
19#include "kona_l2_cache.h" 16#include "kona_l2_cache.h"
20 17
21#define RSTMGR_DT_STRING "brcm,bcm21664-resetmgr"
22
23#define RSTMGR_REG_WR_ACCESS_OFFSET 0
24#define RSTMGR_REG_CHIP_SOFT_RST_OFFSET 4
25
26#define RSTMGR_WR_PASSWORD 0xa5a5
27#define RSTMGR_WR_PASSWORD_SHIFT 8
28#define RSTMGR_WR_ACCESS_ENABLE 1
29
30static void bcm21664_restart(enum reboot_mode mode, const char *cmd)
31{
32 void __iomem *base;
33 struct device_node *resetmgr;
34
35 resetmgr = of_find_compatible_node(NULL, NULL, RSTMGR_DT_STRING);
36 if (!resetmgr) {
37 pr_emerg("Couldn't find " RSTMGR_DT_STRING "\n");
38 return;
39 }
40 base = of_iomap(resetmgr, 0);
41 if (!base) {
42 pr_emerg("Couldn't map " RSTMGR_DT_STRING "\n");
43 return;
44 }
45
46 /*
47 * A soft reset is triggered by writing a 0 to bit 0 of the soft reset
48 * register. To write to that register we must first write the password
49 * and the enable bit in the write access enable register.
50 */
51 writel((RSTMGR_WR_PASSWORD << RSTMGR_WR_PASSWORD_SHIFT) |
52 RSTMGR_WR_ACCESS_ENABLE,
53 base + RSTMGR_REG_WR_ACCESS_OFFSET);
54 writel(0, base + RSTMGR_REG_CHIP_SOFT_RST_OFFSET);
55
56 /* Wait for reset */
57 while (1);
58}
59
60static void __init bcm21664_init(void) 18static void __init bcm21664_init(void)
61{ 19{
62 kona_l2_cache_init(); 20 kona_l2_cache_init();
@@ -69,6 +27,5 @@ static const char * const bcm21664_dt_compat[] = {
69 27
70DT_MACHINE_START(BCM21664_DT, "BCM21664 Broadcom Application Processor") 28DT_MACHINE_START(BCM21664_DT, "BCM21664 Broadcom Application Processor")
71 .init_machine = bcm21664_init, 29 .init_machine = bcm21664_init,
72 .restart = bcm21664_restart,
73 .dt_compat = bcm21664_dt_compat, 30 .dt_compat = bcm21664_dt_compat,
74MACHINE_END 31MACHINE_END
diff --git a/arch/arm/mach-bcm/board_bcm23550.c b/arch/arm/mach-bcm/board_bcm23550.c
new file mode 100644
index 000000000000..0ac01debd077
--- /dev/null
+++ b/arch/arm/mach-bcm/board_bcm23550.c
@@ -0,0 +1,25 @@
1/*
2 * Copyright (C) 2016 Broadcom
3 *
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License as
6 * published by the Free Software Foundation version 2.
7 *
8 * This program is distributed "as is" WITHOUT ANY WARRANTY of any
9 * kind, whether express or implied; without even the implied warranty
10 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 */
13
14#include <linux/of_platform.h>
15
16#include <asm/mach/arch.h>
17
18static const char * const bcm23550_dt_compat[] = {
19 "brcm,bcm23550",
20 NULL,
21};
22
23DT_MACHINE_START(BCM23550_DT, "BCM23550 Broadcom Application Processor")
24 .dt_compat = bcm23550_dt_compat,
25MACHINE_END
diff --git a/arch/arm/mach-bcm/kona_l2_cache.c b/arch/arm/mach-bcm/kona_l2_cache.c
index b31970377c20..59ad86304092 100644
--- a/arch/arm/mach-bcm/kona_l2_cache.c
+++ b/arch/arm/mach-bcm/kona_l2_cache.c
@@ -17,6 +17,7 @@
17#include <asm/hardware/cache-l2x0.h> 17#include <asm/hardware/cache-l2x0.h>
18 18
19#include "bcm_kona_smc.h" 19#include "bcm_kona_smc.h"
20#include "kona_l2_cache.h"
20 21
21void __init kona_l2_cache_init(void) 22void __init kona_l2_cache_init(void)
22{ 23{
diff --git a/arch/arm/mach-bcm/platsmp.c b/arch/arm/mach-bcm/platsmp.c
index cfae9c71fb74..33c4d8349f95 100644
--- a/arch/arm/mach-bcm/platsmp.c
+++ b/arch/arm/mach-bcm/platsmp.c
@@ -19,6 +19,7 @@
19#include <linux/io.h> 19#include <linux/io.h>
20#include <linux/jiffies.h> 20#include <linux/jiffies.h>
21#include <linux/of.h> 21#include <linux/of.h>
22#include <linux/of_address.h>
22#include <linux/sched.h> 23#include <linux/sched.h>
23#include <linux/smp.h> 24#include <linux/smp.h>
24 25
@@ -255,6 +256,57 @@ static int kona_boot_secondary(unsigned int cpu, struct task_struct *idle)
255 return -ENXIO; 256 return -ENXIO;
256} 257}
257 258
259/* Cluster Dormant Control command to bring CPU into a running state */
260#define CDC_CMD 6
261#define CDC_CMD_OFFSET 0
262#define CDC_CMD_REG(cpu) (CDC_CMD_OFFSET + 4*(cpu))
263
264/*
265 * BCM23550 has a Cluster Dormant Control block that keeps the core in
266 * idle state. A command needs to be sent to the block to bring the CPU
267 * into running state.
268 */
269static int bcm23550_boot_secondary(unsigned int cpu, struct task_struct *idle)
270{
271 void __iomem *cdc_base;
272 struct device_node *dn;
273 char *name;
274 int ret;
275
276 /* Make sure a CDC node exists before booting the
277 * secondary core.
278 */
279 name = "brcm,bcm23550-cdc";
280 dn = of_find_compatible_node(NULL, NULL, name);
281 if (!dn) {
282 pr_err("unable to find cdc node\n");
283 return -ENODEV;
284 }
285
286 cdc_base = of_iomap(dn, 0);
287 of_node_put(dn);
288
289 if (!cdc_base) {
290 pr_err("unable to remap cdc base register\n");
291 return -ENOMEM;
292 }
293
294 /* Boot the secondary core */
295 ret = kona_boot_secondary(cpu, idle);
296 if (ret)
297 goto out;
298
299 /* Bring this CPU to RUN state so that nIRQ nFIQ
300 * signals are unblocked.
301 */
302 writel_relaxed(CDC_CMD, cdc_base + CDC_CMD_REG(cpu));
303
304out:
305 iounmap(cdc_base);
306
307 return ret;
308}
309
258static int nsp_boot_secondary(unsigned int cpu, struct task_struct *idle) 310static int nsp_boot_secondary(unsigned int cpu, struct task_struct *idle)
259{ 311{
260 int ret; 312 int ret;
@@ -283,6 +335,12 @@ static const struct smp_operations bcm_smp_ops __initconst = {
283CPU_METHOD_OF_DECLARE(bcm_smp_bcm281xx, "brcm,bcm11351-cpu-method", 335CPU_METHOD_OF_DECLARE(bcm_smp_bcm281xx, "brcm,bcm11351-cpu-method",
284 &bcm_smp_ops); 336 &bcm_smp_ops);
285 337
338static const struct smp_operations bcm23550_smp_ops __initconst = {
339 .smp_boot_secondary = bcm23550_boot_secondary,
340};
341CPU_METHOD_OF_DECLARE(bcm_smp_bcm23550, "brcm,bcm23550",
342 &bcm23550_smp_ops);
343
286static const struct smp_operations nsp_smp_ops __initconst = { 344static const struct smp_operations nsp_smp_ops __initconst = {
287 .smp_prepare_cpus = bcm_smp_prepare_cpus, 345 .smp_prepare_cpus = bcm_smp_prepare_cpus,
288 .smp_boot_secondary = nsp_boot_secondary, 346 .smp_boot_secondary = nsp_boot_secondary,