summaryrefslogtreecommitdiff
path: root/recipes/u-boot/u-boot-1.1.4/at32stk1000/ap7000-add-spi-device-and-lcdc-base-address.patch
blob: fa8c8f701f8cf0f353507dd387ba2b116cd36ecc (plain)
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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
diff -uprN u-boot-orig/cpu/at32ap7xxx/ap7000/devices.c u-boot/cpu/at32ap7xxx/ap7000/devices.c
--- u-boot-orig/cpu/at32ap7xxx/ap7000/devices.c	2007-01-01 19:26:46.000000000 +0100
+++ u-boot/cpu/at32ap7xxx/ap7000/devices.c	2006-12-22 14:51:26.000000000 +0100
@@ -223,6 +223,46 @@ static const struct resource macb1_resou
 	},
 };
 #endif
+#if defined(CFG_SPI0)
+static const struct resource spi0_resource[] = {
+	{
+		.type	= RESOURCE_CLOCK,
+		.u	= {
+			.clock	= { CLOCK_APBA, 0 },
+		},
+	}, {
+		.type	= RESOURCE_GPIO,
+		.u	= {
+			.gpio	= { 6, DEVICE_PIOA, GPIO_FUNC_A, 0 },
+		},
+	}, {
+		.type	= RESOURCE_GPIO,
+		.u	= {
+			.gpio	= { 1, DEVICE_PIOA, GPIO_FUNC_B, 20 },
+		},
+	},
+};
+#endif
+#if defined(CFG_SPI1)
+static const struct resource spi1_resource[] = {
+	{
+		.type	= RESOURCE_CLOCK,
+		.u	= {
+			.clock	= { CLOCK_APBA, 1 },
+		},
+	}, {
+		.type	= RESOURCE_GPIO,
+		.u	= {
+			.gpio	= { 6, DEVICE_PIOB, GPIO_FUNC_B, 0 },
+		},
+	}, {
+		.type	= RESOURCE_GPIO,
+		.u	= {
+			.gpio	= { 1, DEVICE_PIOA, GPIO_FUNC_A, 27 },
+		},
+	},
+};
+#endif
 #if defined(CFG_LCDC)
 static const struct resource lcdc_resource[] = {
 	{
@@ -230,6 +270,16 @@ static const struct resource lcdc_resour
 		.u	= {
 			.clock	= { CLOCK_AHB, 7 },
 		},
+	}, {
+		.type	= RESOURCE_GPIO,
+		.u	= {
+			.gpio = { 13, DEVICE_PIOC, GPIO_FUNC_A, 19 },
+		},
+	}, {
+		.type	= RESOURCE_GPIO,
+		.u	= {
+			.gpio = { 18, DEVICE_PIOD, GPIO_FUNC_A, 0 },
+		},
 	},
 };
 #endif
@@ -390,6 +440,20 @@ const struct device chip_device[] = {
 		.resource	= macb0_resource,
 	},
 #endif
+#if defined(CFG_SPI0)
+	[DEVICE_SPI0] = {
+		.regs		= (void *)SPI0_BASE,
+		.nr_resources	= ARRAY_SIZE(spi0_resource),
+		.resource	= spi0_resource,
+	},
+#endif
+#if defined(CFG_SPI1)
+	[DEVICE_SPI1] = {
+		.regs		= (void *)SPI1_BASE,
+		.nr_resources	= ARRAY_SIZE(spi1_resource),
+		.resource	= spi1_resource,
+	},
+#endif
 #if defined(CFG_MACB1)
 	[DEVICE_MACB1] = {
 		.regs		= (void *)MACB1_BASE,
@@ -399,6 +463,7 @@ const struct device chip_device[] = {
 #endif
 #if defined(CFG_LCDC)
 	[DEVICE_LCDC] = {
+		.regs		= (void *)LCDC_BASE,
 		.nr_resources	= ARRAY_SIZE(lcdc_resource),
 		.resource	= lcdc_resource,
 	},
diff -uprN u-boot-orig/include/asm-avr32/arch-ap7000/platform.h u-boot/include/asm-avr32/arch-ap7000/platform.h
--- u-boot-orig/include/asm-avr32/arch-ap7000/platform.h	2007-01-01 19:26:46.000000000 +0100
+++ u-boot/include/asm-avr32/arch-ap7000/platform.h	2006-12-22 14:20:39.000000000 +0100
@@ -66,6 +66,12 @@ enum device_id {
 #if defined(CFG_MACB1)
 	DEVICE_MACB1,
 #endif
+#if defined(CFG_SPI0)
+	DEVICE_SPI0,
+#endif
+#if defined(CFG_SPI1)
+	DEVICE_SPI1,
+#endif
 #if defined(CFG_LCDC)
 	DEVICE_LCDC,
 #endif