bcm53xx: add support for the PCIe controller
[openwrt/svn-archive/archive.git] / target / linux / bcm53xx / patches-3.14 / 040-ARM-BCM5301X-initial-support-for-the-BCM5301X-BCM470.patch
1 From 5b293ebe757213993ae93b6cbbf5e1d09b75ac2f Mon Sep 17 00:00:00 2001
2 From: Hauke Mehrtens <hauke@hauke-m.de>
3 Date: Tue, 4 Feb 2014 00:01:43 +0100
4 Subject: [PATCH 1/3] ARM: BCM5301X: initial support for the BCM5301X/BCM470X
5 SoCs with ARM CPU
6
7 This patch adds support for the BCM5301X/BCM470X SoCs with an ARM CPUs.
8 Currently just booting to a shell is working and nothing else, no
9 Ethernet, wifi, flash, ...
10 I have some pending patches to make Ethernet work for this device.
11 Mostly device tree support for bcma is missing.
12
13 This SoC is used in small office and home router with Broadcom SoCs
14 it's internal name is Northstar. This code should support the BCM4707,
15 BCM4708, BCM4709, BCM53010, BCM53011 and BCM53012 SoC. It uses one or
16 two ARM Cortex A9 Cores, some highlights are 2 PCIe 2.0 controllers,
17 4 Gigabit Ethernet MACs and a USB 3.0 host controller.
18
19 This SoC uses a dual core CPU, but this is currently not implemented.
20 More information about this SoC can be found here:
21 http://www.anandtech.com/show/5925/broadcom-announces-bcm4708x-and-bcm5301x-socs-for-80211ac-routers
22
23 Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
24 Acked-by: Arnd Bergmann <arnd@arndb.de>
25 Acked-by: Christian Daudt <bcm@fixthebug.org>
26 Signed-off-by: Matt Porter <mporter@linaro.org>
27 ---
28 Documentation/devicetree/bindings/arm/bcm4708.txt | 8 ++++++
29 MAINTAINERS | 8 ++++++
30 arch/arm/configs/multi_v7_defconfig | 1 +
31 arch/arm/mach-bcm/Kconfig | 26 +++++++++++++++++++
32 arch/arm/mach-bcm/Makefile | 1 +
33 arch/arm/mach-bcm/bcm_5301x.c | 28 +++++++++++++++++++++
34 6 files changed, 72 insertions(+)
35 create mode 100644 Documentation/devicetree/bindings/arm/bcm4708.txt
36 create mode 100644 arch/arm/mach-bcm/bcm_5301x.c
37
38 --- /dev/null
39 +++ b/Documentation/devicetree/bindings/arm/bcm4708.txt
40 @@ -0,0 +1,8 @@
41 +Broadcom BCM4708 device tree bindings
42 +-------------------------------------------
43 +
44 +Boards with the BCM4708 SoC shall have the following properties:
45 +
46 +Required root node property:
47 +
48 +compatible = "brcm,bcm4708";
49 --- a/MAINTAINERS
50 +++ b/MAINTAINERS
51 @@ -1883,6 +1883,14 @@ F: arch/arm/boot/dts/bcm2835*
52 F: arch/arm/configs/bcm2835_defconfig
53 F: drivers/*/*bcm2835*
54
55 +BROADCOM BCM5301X ARM ARCHICTURE
56 +M: Hauke Mehrtens <hauke@hauke-m.de>
57 +L: linux-arm-kernel@lists.infradead.org
58 +S: Maintained
59 +F: arch/arm/mach-bcm/bcm_5301x.c
60 +F: arch/arm/boot/dts/bcm5301x.dtsi
61 +F: arch/arm/boot/dts/bcm470*
62 +
63 BROADCOM TG3 GIGABIT ETHERNET DRIVER
64 M: Nithin Nayak Sujir <nsujir@broadcom.com>
65 M: Michael Chan <mchan@broadcom.com>
66 --- a/arch/arm/configs/multi_v7_defconfig
67 +++ b/arch/arm/configs/multi_v7_defconfig
68 @@ -11,6 +11,7 @@ CONFIG_ARCH_MVEBU=y
69 CONFIG_MACH_ARMADA_370=y
70 CONFIG_MACH_ARMADA_XP=y
71 CONFIG_ARCH_BCM=y
72 +CONFIG_ARCH_BCM_5301X=y
73 CONFIG_ARCH_BCM_MOBILE=y
74 CONFIG_ARCH_BERLIN=y
75 CONFIG_MACH_BERLIN_BG2=y
76 --- a/arch/arm/mach-bcm/Kconfig
77 +++ b/arch/arm/mach-bcm/Kconfig
78 @@ -32,6 +32,32 @@ config ARCH_BCM_MOBILE
79 BCM11130, BCM11140, BCM11351, BCM28145 and
80 BCM28155 variants.
81
82 +config ARCH_BCM_5301X
83 + bool "Broadcom BCM470X / BCM5301X ARM SoC" if ARCH_MULTI_V7
84 + depends on MMU
85 + select ARM_GIC
86 + select CACHE_L2X0
87 + select HAVE_ARM_SCU if SMP
88 + select HAVE_ARM_TWD if SMP
89 + select HAVE_SMP
90 + select COMMON_CLK
91 + select GENERIC_CLOCKEVENTS
92 + select ARM_GLOBAL_TIMER
93 + select CLKSRC_ARM_GLOBAL_TIMER_SCHED_CLOCK
94 + select MIGHT_HAVE_PCI
95 + help
96 + Support for Broadcom BCM470X and BCM5301X SoCs with ARM CPU cores.
97 +
98 + This is a network SoC line mostly used in home routers and
99 + wifi access points, it's internal name is Northstar.
100 + This inclused the following SoC: BCM53010, BCM53011, BCM53012,
101 + BCM53014, BCM53015, BCM53016, BCM53017, BCM53018, BCM4707,
102 + BCM4708 and BCM4709.
103 +
104 + Do not confuse this with the BCM4760 which is a totally
105 + different SoC or with the older BCM47XX and BCM53XX based
106 + network SoC using a MIPS CPU, they are supported by arch/mips/bcm47xx
107 +
108 endmenu
109
110 endif
111 --- a/arch/arm/mach-bcm/Makefile
112 +++ b/arch/arm/mach-bcm/Makefile
113 @@ -13,3 +13,4 @@
114 obj-$(CONFIG_ARCH_BCM_MOBILE) := board_bcm281xx.o bcm_kona_smc.o bcm_kona_smc_asm.o kona.o
115 plus_sec := $(call as-instr,.arch_extension sec,+sec)
116 AFLAGS_bcm_kona_smc_asm.o :=-Wa,-march=armv7-a$(plus_sec)
117 +obj-$(CONFIG_ARCH_BCM_5301X) += bcm_5301x.o
118 --- /dev/null
119 +++ b/arch/arm/mach-bcm/bcm_5301x.c
120 @@ -0,0 +1,28 @@
121 +/*
122 + * Broadcom BCM470X / BCM5301X ARM platform code.
123 + *
124 + * Copyright 2013 Hauke Mehrtens <hauke@hauke-m.de>
125 + *
126 + * Licensed under the GNU/GPL. See COPYING for details.
127 + */
128 +#include <linux/of_platform.h>
129 +#include <asm/hardware/cache-l2x0.h>
130 +
131 +#include <asm/mach/arch.h>
132 +
133 +
134 +static void __init bcm5301x_dt_init(void)
135 +{
136 + l2x0_of_init(0, ~0UL);
137 + of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
138 +}
139 +
140 +static const char __initconst *bcm5301x_dt_compat[] = {
141 + "brcm,bcm4708",
142 + NULL,
143 +};
144 +
145 +DT_MACHINE_START(BCM5301X, "BCM5301X")
146 + .init_machine = bcm5301x_dt_init,
147 + .dt_compat = bcm5301x_dt_compat,
148 +MACHINE_END