1 From f6459ef9602c16b02516be4848a77d30ce75d168 Mon Sep 17 00:00:00 2001
2 From: notro <notro@tronnes.org>
3 Date: Wed, 9 Jul 2014 14:46:08 +0200
4 Subject: [PATCH 049/114] BCM2708: Add core Device Tree support
6 Add the bare minimum needed to boot BCM2708 from a Device Tree.
8 Signed-off-by: Noralf Tronnes <notro@tronnes.org>
10 BCM2708: DT: change 'axi' nodename to 'soc'
12 Change DT node named 'axi' to 'soc' so it matches ARCH_BCM2835.
13 The VC4 bootloader fills in certain properties in the 'axi' subtree,
14 but since this is part of an upstreaming effort, the name is changed.
16 Signed-off-by: Noralf Tronnes notro@tronnes.org
18 arch/arm/boot/dts/Makefile | 1 +
19 arch/arm/boot/dts/bcm2708-rpi-b.dts | 8 ++++++++
20 arch/arm/boot/dts/bcm2708.dtsi | 27 +++++++++++++++++++++++++++
21 arch/arm/mach-bcm2708/Kconfig | 8 ++++++++
22 arch/arm/mach-bcm2708/bcm2708.c | 24 ++++++++++++++++++++++++
23 5 files changed, 68 insertions(+)
24 create mode 100644 arch/arm/boot/dts/bcm2708-rpi-b.dts
25 create mode 100644 arch/arm/boot/dts/bcm2708.dtsi
27 diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile
28 index 38c89ca..c727f71 100644
29 --- a/arch/arm/boot/dts/Makefile
30 +++ b/arch/arm/boot/dts/Makefile
31 @@ -53,6 +53,7 @@ dtb-$(CONFIG_ARCH_AT91) += at91-sama5d4ek.dtb
33 dtb-$(CONFIG_ARCH_ATLAS6) += atlas6-evb.dtb
34 dtb-$(CONFIG_ARCH_AXXIA) += axm5516-amarillo.dtb
35 +dtb-$(CONFIG_BCM2708_DT) += bcm2708-rpi-b.dtb
36 dtb-$(CONFIG_ARCH_BCM2835) += bcm2835-rpi-b.dtb
37 dtb-$(CONFIG_ARCH_BCM_5301X) += bcm4708-netgear-r6250.dtb
38 dtb-$(CONFIG_ARCH_BCM_63XX) += bcm963138dvt.dtb
39 diff --git a/arch/arm/boot/dts/bcm2708-rpi-b.dts b/arch/arm/boot/dts/bcm2708-rpi-b.dts
41 index 0000000..e319c8e
43 +++ b/arch/arm/boot/dts/bcm2708-rpi-b.dts
47 +/include/ "bcm2708.dtsi"
50 + compatible = "brcm,bcm2708";
51 + model = "Raspberry Pi";
53 diff --git a/arch/arm/boot/dts/bcm2708.dtsi b/arch/arm/boot/dts/bcm2708.dtsi
55 index 0000000..50da059
57 +++ b/arch/arm/boot/dts/bcm2708.dtsi
59 +/include/ "skeleton.dtsi"
62 + compatible = "brcm,bcm2708";
67 + bootargs must be 1024 characters long because the
68 + VC bootloader can't expand it
70 + bootargs = "console=ttyAMA0 ";
74 + compatible = "simple-bus";
75 + #address-cells = <1>;
77 + ranges = <0x7e000000 0x20000000 0x02000000>;
81 + compatible = "simple-bus";
82 + #address-cells = <1>;
86 diff --git a/arch/arm/mach-bcm2708/Kconfig b/arch/arm/mach-bcm2708/Kconfig
87 index e151ed4..182e7ba 100644
88 --- a/arch/arm/mach-bcm2708/Kconfig
89 +++ b/arch/arm/mach-bcm2708/Kconfig
90 @@ -9,6 +9,14 @@ config MACH_BCM2708
92 Include support for the Broadcom(R) BCM2708 platform.
95 + bool "BCM2708 Device Tree support"
96 + depends on MACH_BCM2708
100 + Enable Device Tree support for BCM2708
103 bool "BCM2708 gpio support"
104 depends on MACH_BCM2708
105 diff --git a/arch/arm/mach-bcm2708/bcm2708.c b/arch/arm/mach-bcm2708/bcm2708.c
106 index ef12cb8..747e27a 100644
107 --- a/arch/arm/mach-bcm2708/bcm2708.c
108 +++ b/arch/arm/mach-bcm2708/bcm2708.c
110 #include <linux/cnt32_to_63.h>
111 #include <linux/io.h>
112 #include <linux/module.h>
113 +#include <linux/of_platform.h>
114 #include <linux/spi/spi.h>
115 #include <linux/w1-gpio.h>
117 @@ -734,6 +735,22 @@ static void bcm2708_power_off(void)
122 +static void __init bcm2708_dt_init(void)
127 + ret = of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
129 + pr_err("of_platform_populate failed: %d\n", ret);
134 +static void __init bcm2708_dt_init(void) { }
135 +#endif /* CONFIG_OF */
137 void __init bcm2708_init(void)
140 @@ -745,6 +762,7 @@ void __init bcm2708_init(void)
141 pm_power_off = bcm2708_power_off;
143 bcm2708_init_clocks();
146 bcm_register_device(&bcm2708_dmaman_device);
147 bcm_register_device(&bcm2708_vcio_device);
148 @@ -965,6 +983,11 @@ static void __init board_reserve(void)
152 +static const char * const bcm2708_compat[] = {
157 MACHINE_START(BCM2708, "BCM2708")
158 /* Maintainer: Broadcom Europe Ltd. */
159 .map_io = bcm2708_map_io,
160 @@ -974,6 +997,7 @@ MACHINE_START(BCM2708, "BCM2708")
161 .init_early = bcm2708_init_early,
162 .reserve = board_reserve,
163 .restart = bcm2708_restart,
164 + .dt_compat = bcm2708_compat,
167 module_param(boardrev, uint, 0644);