summaryrefslogtreecommitdiffstats
path: root/configs/platform-v7a/patches/barebox-2017.08.0/0002-vexpress-device-tree-support.patch
blob: fc7ad482615be2396e086a68190f2535667ae44b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
From: Michael Olbrich <m.olbrich@pengutronix.de>
Date: Sat, 10 Sep 2016 17:51:36 +0200
Subject: [PATCH] vexpress: device tree support

Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
---
 arch/arm/boards/vexpress/init.c   | 16 ++++++++++------
 arch/arm/dts/vexpress-v2p-ca9.dts | 27 +++++++++++++++++++++++++++
 2 files changed, 37 insertions(+), 6 deletions(-)
 create mode 100644 arch/arm/dts/vexpress-v2p-ca9.dts

diff --git a/arch/arm/boards/vexpress/init.c b/arch/arm/boards/vexpress/init.c
index f89dff939231..68ebbfab2633 100644
--- a/arch/arm/boards/vexpress/init.c
+++ b/arch/arm/boards/vexpress/init.c
@@ -71,10 +71,12 @@ static void vexpress_a9_legacy_mem_init(void)
 
 static void vexpress_a9_legacy_devices_init(void)
 {
-	add_cfi_flash_device(0, 0x40000000, SZ_64M, 0);
-	add_cfi_flash_device(1, 0x44000000, SZ_64M, 0);
-	add_generic_device("smc911x", DEVICE_ID_DYNAMIC, NULL, 0x4e000000,
-			64 * 1024, IORESOURCE_MEM, NULL);
+	if (!IS_ENABLED(CONFIG_OFDEVICE)) {
+		add_cfi_flash_device(0, 0x40000000, SZ_64M, 0);
+		add_cfi_flash_device(1, 0x44000000, SZ_64M, 0);
+		add_generic_device("smc911x", DEVICE_ID_DYNAMIC, NULL, 0x4e000000,
+				64 * 1024, IORESOURCE_MEM, NULL);
+	}
 	vexpress_a9_legacy_register_mmc(&mmci_plat);
 	armlinux_set_architecture(MACH_TYPE_VEXPRESS);
 }
@@ -107,8 +109,10 @@ static int vexpress_devices_init(void)
 	writel(1, v2m_sysreg_base + V2M_SYS_FLASH);
 	v2m_init->devices_init();
 
-	devfs_add_partition("nor0", 0x00000, 0x40000, DEVFS_PARTITION_FIXED, "self");
-	devfs_add_partition("nor0", 0x40000, 0x20000, DEVFS_PARTITION_FIXED, "env0");
+	if (!IS_ENABLED(CONFIG_OFDEVICE)) {
+		devfs_add_partition("nor0", 0x00000, 0x40000, DEVFS_PARTITION_FIXED, "self");
+		devfs_add_partition("nor0", 0x40000, 0x20000, DEVFS_PARTITION_FIXED, "env0");
+	}
 
 	if (IS_ENABLED(CONFIG_DEFAULT_ENVIRONMENT_GENERIC))
 		defaultenv_append_directory(defaultenv_vexpress);
diff --git a/arch/arm/dts/vexpress-v2p-ca9.dts b/arch/arm/dts/vexpress-v2p-ca9.dts
new file mode 100644
index 000000000000..541840ae22dc
--- /dev/null
+++ b/arch/arm/dts/vexpress-v2p-ca9.dts
@@ -0,0 +1,27 @@
+#include <arm/vexpress-v2p-ca9.dts>
+
+/ {
+	barebox_environment {
+		compatible = "barebox,environment";
+		device-path = &barebox_env;
+	};
+
+	smb@4000000 {
+		motherboard {
+			flash@0,00000000 {
+				#address-cells = <1>;
+				#size-cells = <1>;
+
+				partition@0 {
+					label = "barebox";
+					reg = <0x0 0x80000>;
+				};
+
+				barebox_env: partition@80000 {
+					label = "barebox-environment";
+					reg = <0x80000 0x80000>;
+				};
+			};
+		};
+	};
+};