aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorArnd Bergmann <arnd@arndb.de>2014-03-17 09:45:28 -0400
committerArnd Bergmann <arnd@arndb.de>2014-03-17 09:45:28 -0400
commit3b325a494ba8835b9dc85c7dcc23b887c7deb119 (patch)
tree5e94675e5407066a286201121c62be656fbc8cf2 /arch
parent8efa50c5e1684b1168fa6b67de19c7f399cb1874 (diff)
parent7aa2077b55b530fac878e7c05fc970a778eb3950 (diff)
Merge tag 'armsoc/for-3.15/soc-3' of git://github.com/broadcom/mach-bcm into next/soc
Merge "ARM: mach-bcm: soc updates for 3.15 - part 2" from Matt Porter: - Add bcm21664 support - Use Kona Debug UART only on ARCH_BCM_MOBILE * tag 'armsoc/for-3.15/soc-3' of git://github.com/broadcom/mach-bcm: ARM: restrict BCM_KONA_UART to ARCH_BCM_MOBILE ARM: bcm21664: Add board support. Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/Kconfig.debug2
-rw-r--r--arch/arm/mach-bcm/Makefile6
-rw-r--r--arch/arm/mach-bcm/board_bcm21664.c78
3 files changed, 83 insertions, 3 deletions
diff --git a/arch/arm/Kconfig.debug b/arch/arm/Kconfig.debug
index f4b656f789b3..37fa20a18531 100644
--- a/arch/arm/Kconfig.debug
+++ b/arch/arm/Kconfig.debug
@@ -113,7 +113,7 @@ choice
113 113
114 config DEBUG_BCM_KONA_UART 114 config DEBUG_BCM_KONA_UART
115 bool "Kernel low-level debugging messages via BCM KONA UART" 115 bool "Kernel low-level debugging messages via BCM KONA UART"
116 depends on ARCH_BCM 116 depends on ARCH_BCM_MOBILE
117 select DEBUG_UART_8250 117 select DEBUG_UART_8250
118 help 118 help
119 Say Y here if you want kernel low-level debugging support 119 Say Y here if you want kernel low-level debugging support
diff --git a/arch/arm/mach-bcm/Makefile b/arch/arm/mach-bcm/Makefile
index 01649132c9f2..4e4a2ed6851e 100644
--- a/arch/arm/mach-bcm/Makefile
+++ b/arch/arm/mach-bcm/Makefile
@@ -1,5 +1,5 @@
1# 1#
2# Copyright (C) 2012-2013 Broadcom Corporation 2# Copyright (C) 2012-2014 Broadcom Corporation
3# 3#
4# This program is free software; you can redistribute it and/or 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 5# modify it under the terms of the GNU General Public License as
@@ -10,7 +10,9 @@
10# of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10# of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11# GNU General Public License for more details. 11# GNU General Public License for more details.
12 12
13obj-$(CONFIG_ARCH_BCM_MOBILE) := board_bcm281xx.o bcm_kona_smc.o bcm_kona_smc_asm.o kona.o 13obj-$(CONFIG_ARCH_BCM_MOBILE) := board_bcm281xx.o board_bcm21664.o \
14 bcm_kona_smc.o bcm_kona_smc_asm.o kona.o
15
14plus_sec := $(call as-instr,.arch_extension sec,+sec) 16plus_sec := $(call as-instr,.arch_extension sec,+sec)
15AFLAGS_bcm_kona_smc_asm.o :=-Wa,-march=armv7-a$(plus_sec) 17AFLAGS_bcm_kona_smc_asm.o :=-Wa,-march=armv7-a$(plus_sec)
16obj-$(CONFIG_ARCH_BCM_5301X) += bcm_5301x.o 18obj-$(CONFIG_ARCH_BCM_5301X) += bcm_5301x.o
diff --git a/arch/arm/mach-bcm/board_bcm21664.c b/arch/arm/mach-bcm/board_bcm21664.c
new file mode 100644
index 000000000000..acc1573fd005
--- /dev/null
+++ b/arch/arm/mach-bcm/board_bcm21664.c
@@ -0,0 +1,78 @@
1/*
2 * Copyright (C) 2014 Broadcom Corporation
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/clocksource.h>
15#include <linux/of_address.h>
16#include <linux/of_platform.h>
17
18#include <asm/mach/arch.h>
19
20#include "bcm_kona_smc.h"
21#include "kona.h"
22
23#define RSTMGR_DT_STRING "brcm,bcm21664-resetmgr"
24
25#define RSTMGR_REG_WR_ACCESS_OFFSET 0
26#define RSTMGR_REG_CHIP_SOFT_RST_OFFSET 4
27
28#define RSTMGR_WR_PASSWORD 0xa5a5
29#define RSTMGR_WR_PASSWORD_SHIFT 8
30#define RSTMGR_WR_ACCESS_ENABLE 1
31
32static void bcm21664_restart(enum reboot_mode mode, const char *cmd)
33{
34 void __iomem *base;
35 struct device_node *resetmgr;
36
37 resetmgr = of_find_compatible_node(NULL, NULL, RSTMGR_DT_STRING);
38 if (!resetmgr) {
39 pr_emerg("Couldn't find " RSTMGR_DT_STRING "\n");
40 return;
41 }
42 base = of_iomap(resetmgr, 0);
43 if (!base) {
44 pr_emerg("Couldn't map " RSTMGR_DT_STRING "\n");
45 return;
46 }
47
48 /*
49 * A soft reset is triggered by writing a 0 to bit 0 of the soft reset
50 * register. To write to that register we must first write the password
51 * and the enable bit in the write access enable register.
52 */
53 writel((RSTMGR_WR_PASSWORD << RSTMGR_WR_PASSWORD_SHIFT) |
54 RSTMGR_WR_ACCESS_ENABLE,
55 base + RSTMGR_REG_WR_ACCESS_OFFSET);
56 writel(0, base + RSTMGR_REG_CHIP_SOFT_RST_OFFSET);
57
58 /* Wait for reset */
59 while (1);
60}
61
62static void __init bcm21664_init(void)
63{
64 of_platform_populate(NULL, of_default_bus_match_table, NULL,
65 &platform_bus);
66 kona_l2_cache_init();
67}
68
69static const char * const bcm21664_dt_compat[] = {
70 "brcm,bcm21664",
71 NULL,
72};
73
74DT_MACHINE_START(BCM21664_DT, "BCM21664 Broadcom Application Processor")
75 .init_machine = bcm21664_init,
76 .restart = bcm21664_restart,
77 .dt_compat = bcm21664_dt_compat,
78MACHINE_END