aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sh/boards
diff options
context:
space:
mode:
authorPaul Mundt <lethal@linux-sh.org>2007-08-20 00:03:41 -0400
committerPaul Mundt <lethal@linux-sh.org>2007-09-20 22:57:51 -0400
commit8786c952c1682a132e99b736beae4523e409b13d (patch)
treefec83f758cf197fb4515675ceb8c023ecd60dc20 /arch/sh/boards
parent2eb0303c2cd536d7f15c7f3bafc848b850a447f0 (diff)
sh: heartbeat driver update.
Add some flags for the heartbeat driver, and kill off some duplication in the bit positions for the boards that don't have special cases. This also allows for variable access widths and inversion. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/sh/boards')
-rw-r--r--arch/sh/boards/renesas/r7780rp/setup.c16
-rw-r--r--arch/sh/boards/se/7206/setup.c8
-rw-r--r--arch/sh/boards/se/770x/setup.c8
-rw-r--r--arch/sh/boards/se/7722/setup.c9
-rw-r--r--arch/sh/boards/se/7751/setup.c8
-rw-r--r--arch/sh/boards/se/7780/setup.c7
6 files changed, 36 insertions, 20 deletions
diff --git a/arch/sh/boards/renesas/r7780rp/setup.c b/arch/sh/boards/renesas/r7780rp/setup.c
index adb529d01bae..1062346e1d34 100644
--- a/arch/sh/boards/renesas/r7780rp/setup.c
+++ b/arch/sh/boards/renesas/r7780rp/setup.c
@@ -19,6 +19,7 @@
19#include <asm/machvec.h> 19#include <asm/machvec.h>
20#include <asm/r7780rp.h> 20#include <asm/r7780rp.h>
21#include <asm/clock.h> 21#include <asm/clock.h>
22#include <asm/heartbeat.h>
22#include <asm/io.h> 23#include <asm/io.h>
23 24
24static struct resource r8a66597_usb_host_resources[] = { 25static struct resource r8a66597_usb_host_resources[] = {
@@ -108,16 +109,23 @@ static struct platform_device cf_ide_device = {
108 }, 109 },
109}; 110};
110 111
111static unsigned char heartbeat_bit_pos[] = { 2, 1, 0, 3, 6, 5, 4, 7 };
112
113static struct resource heartbeat_resources[] = { 112static struct resource heartbeat_resources[] = {
114 [0] = { 113 [0] = {
115 .start = PA_OBLED, 114 .start = PA_OBLED,
116 .end = PA_OBLED + ARRAY_SIZE(heartbeat_bit_pos) - 1, 115 .end = PA_OBLED + 8 - 1,
117 .flags = IORESOURCE_MEM, 116 .flags = IORESOURCE_MEM,
118 }, 117 },
119}; 118};
120 119
120#ifndef CONFIG_SH_R7785RP
121static unsigned char heartbeat_bit_pos[] = { 2, 1, 0, 3, 6, 5, 4, 7 };
122
123static struct heartbeat_data heartbeat_data = {
124 .bit_pos = heartbeat_bit_pos,
125 .nr_bits = ARRAY_SIZE(heartbeat_bit_pos),
126};
127#endif
128
121static struct platform_device heartbeat_device = { 129static struct platform_device heartbeat_device = {
122 .name = "heartbeat", 130 .name = "heartbeat",
123 .id = -1, 131 .id = -1,
@@ -125,7 +133,7 @@ static struct platform_device heartbeat_device = {
125 /* R7785RP has a slightly more sensible FPGA.. */ 133 /* R7785RP has a slightly more sensible FPGA.. */
126#ifndef CONFIG_SH_R7785RP 134#ifndef CONFIG_SH_R7785RP
127 .dev = { 135 .dev = {
128 .platform_data = heartbeat_bit_pos, 136 .platform_data = heartbeat_data,
129 }, 137 },
130#endif 138#endif
131 .num_resources = ARRAY_SIZE(heartbeat_resources), 139 .num_resources = ARRAY_SIZE(heartbeat_resources),
diff --git a/arch/sh/boards/se/7206/setup.c b/arch/sh/boards/se/7206/setup.c
index a074b62505ef..5f041f86e3dd 100644
--- a/arch/sh/boards/se/7206/setup.c
+++ b/arch/sh/boards/se/7206/setup.c
@@ -14,6 +14,7 @@
14#include <asm/se7206.h> 14#include <asm/se7206.h>
15#include <asm/io.h> 15#include <asm/io.h>
16#include <asm/machvec.h> 16#include <asm/machvec.h>
17#include <asm/heartbeat.h>
17 18
18static struct resource smc91x_resources[] = { 19static struct resource smc91x_resources[] = {
19 [0] = { 20 [0] = {
@@ -37,6 +38,11 @@ static struct platform_device smc91x_device = {
37 38
38static unsigned char heartbeat_bit_pos[] = { 8, 9, 10, 11, 12, 13, 14, 15 }; 39static unsigned char heartbeat_bit_pos[] = { 8, 9, 10, 11, 12, 13, 14, 15 };
39 40
41static struct heartbeat_data heartbeat_data = {
42 .bit_pos = heartbeat_bit_pos,
43 .nr_bits = ARRAY_SIZE(heartbeat_bit_pos),
44};
45
40static struct resource heartbeat_resources[] = { 46static struct resource heartbeat_resources[] = {
41 [0] = { 47 [0] = {
42 .start = PA_LED, 48 .start = PA_LED,
@@ -49,7 +55,7 @@ static struct platform_device heartbeat_device = {
49 .name = "heartbeat", 55 .name = "heartbeat",
50 .id = -1, 56 .id = -1,
51 .dev = { 57 .dev = {
52 .platform_data = heartbeat_bit_pos, 58 .platform_data = heartbeat_data,
53 }, 59 },
54 .num_resources = ARRAY_SIZE(heartbeat_resources), 60 .num_resources = ARRAY_SIZE(heartbeat_resources),
55 .resource = heartbeat_resources, 61 .resource = heartbeat_resources,
diff --git a/arch/sh/boards/se/770x/setup.c b/arch/sh/boards/se/770x/setup.c
index 2962da148f3f..5172f994a1be 100644
--- a/arch/sh/boards/se/770x/setup.c
+++ b/arch/sh/boards/se/770x/setup.c
@@ -12,6 +12,7 @@
12#include <asm/se.h> 12#include <asm/se.h>
13#include <asm/io.h> 13#include <asm/io.h>
14#include <asm/smc37c93x.h> 14#include <asm/smc37c93x.h>
15#include <asm/heartbeat.h>
15 16
16void init_se_IRQ(void); 17void init_se_IRQ(void);
17 18
@@ -90,6 +91,11 @@ static struct platform_device cf_ide_device = {
90 91
91static unsigned char heartbeat_bit_pos[] = { 8, 9, 10, 11, 12, 13, 14, 15 }; 92static unsigned char heartbeat_bit_pos[] = { 8, 9, 10, 11, 12, 13, 14, 15 };
92 93
94static struct heartbeat_data heartbeat_data = {
95 .bit_pos = heartbeat_bit_pos,
96 .nr_bits = ARRAY_SIZE(heartbeat_bit_pos),
97};
98
93static struct resource heartbeat_resources[] = { 99static struct resource heartbeat_resources[] = {
94 [0] = { 100 [0] = {
95 .start = PA_LED, 101 .start = PA_LED,
@@ -102,7 +108,7 @@ static struct platform_device heartbeat_device = {
102 .name = "heartbeat", 108 .name = "heartbeat",
103 .id = -1, 109 .id = -1,
104 .dev = { 110 .dev = {
105 .platform_data = heartbeat_bit_pos, 111 .platform_data = heartbeat_data,
106 }, 112 },
107 .num_resources = ARRAY_SIZE(heartbeat_resources), 113 .num_resources = ARRAY_SIZE(heartbeat_resources),
108 .resource = heartbeat_resources, 114 .resource = heartbeat_resources,
diff --git a/arch/sh/boards/se/7722/setup.c b/arch/sh/boards/se/7722/setup.c
index 495fc7e2b60f..8f1c8a617bb5 100644
--- a/arch/sh/boards/se/7722/setup.c
+++ b/arch/sh/boards/se/7722/setup.c
@@ -18,12 +18,10 @@
18#include <asm/io.h> 18#include <asm/io.h>
19 19
20/* Heartbeat */ 20/* Heartbeat */
21static unsigned char heartbeat_bit_pos[] = { 0, 1, 2, 3, 4, 5, 6, 7 };
22
23static struct resource heartbeat_resources[] = { 21static struct resource heartbeat_resources[] = {
24 [0] = { 22 [0] = {
25 .start = PA_LED, 23 .start = PA_LED,
26 .end = PA_LED + ARRAY_SIZE(heartbeat_bit_pos) - 1, 24 .end = PA_LED + 8 - 1,
27 .flags = IORESOURCE_MEM, 25 .flags = IORESOURCE_MEM,
28 }, 26 },
29}; 27};
@@ -31,9 +29,6 @@ static struct resource heartbeat_resources[] = {
31static struct platform_device heartbeat_device = { 29static struct platform_device heartbeat_device = {
32 .name = "heartbeat", 30 .name = "heartbeat",
33 .id = -1, 31 .id = -1,
34 .dev = {
35 .platform_data = heartbeat_bit_pos,
36 },
37 .num_resources = ARRAY_SIZE(heartbeat_resources), 32 .num_resources = ARRAY_SIZE(heartbeat_resources),
38 .resource = heartbeat_resources, 33 .resource = heartbeat_resources,
39}; 34};
@@ -109,7 +104,7 @@ static void __init se7722_setup(char **cmdline_p)
109 ctrl_outl(0x00051001, MSTPCR0); 104 ctrl_outl(0x00051001, MSTPCR0);
110 ctrl_outl(0x00000000, MSTPCR1); 105 ctrl_outl(0x00000000, MSTPCR1);
111 /* KEYSC, VOU, BEU, CEU, VEU, VPU, LCDC */ 106 /* KEYSC, VOU, BEU, CEU, VEU, VPU, LCDC */
112 ctrl_outl(0xffffbfC0, MSTPCR2); 107 ctrl_outl(0xffffbfC0, MSTPCR2);
113 108
114 ctrl_outw(0x0000, PORT_PECR); /* PORT E 1 = IRQ5 ,E 0 = BS */ 109 ctrl_outw(0x0000, PORT_PECR); /* PORT E 1 = IRQ5 ,E 0 = BS */
115 ctrl_outw(0x1000, PORT_PJCR); /* PORT J 1 = IRQ1,J 0 =IRQ0 */ 110 ctrl_outw(0x1000, PORT_PJCR); /* PORT J 1 = IRQ1,J 0 =IRQ0 */
diff --git a/arch/sh/boards/se/7751/setup.c b/arch/sh/boards/se/7751/setup.c
index 7873d07e40c1..5ed196827b0a 100644
--- a/arch/sh/boards/se/7751/setup.c
+++ b/arch/sh/boards/se/7751/setup.c
@@ -13,9 +13,15 @@
13#include <asm/machvec.h> 13#include <asm/machvec.h>
14#include <asm/se7751.h> 14#include <asm/se7751.h>
15#include <asm/io.h> 15#include <asm/io.h>
16#include <asm/heartbeat.h>
16 17
17static unsigned char heartbeat_bit_pos[] = { 8, 9, 10, 11, 12, 13, 14, 15 }; 18static unsigned char heartbeat_bit_pos[] = { 8, 9, 10, 11, 12, 13, 14, 15 };
18 19
20static struct heartbeat_data heartbeat_data = {
21 .bit_pos = heartbeat_bit_pos,
22 .nr_bits = ARRAY_SIZE(heartbeat_bit_pos),
23};
24
19static struct resource heartbeat_resources[] = { 25static struct resource heartbeat_resources[] = {
20 [0] = { 26 [0] = {
21 .start = PA_LED, 27 .start = PA_LED,
@@ -28,7 +34,7 @@ static struct platform_device heartbeat_device = {
28 .name = "heartbeat", 34 .name = "heartbeat",
29 .id = -1, 35 .id = -1,
30 .dev = { 36 .dev = {
31 .platform_data = heartbeat_bit_pos, 37 .platform_data = heartbeat_data,
32 }, 38 },
33 .num_resources = ARRAY_SIZE(heartbeat_resources), 39 .num_resources = ARRAY_SIZE(heartbeat_resources),
34 .resource = heartbeat_resources, 40 .resource = heartbeat_resources,
diff --git a/arch/sh/boards/se/7780/setup.c b/arch/sh/boards/se/7780/setup.c
index 723f2fd4d55b..15c3ea4de920 100644
--- a/arch/sh/boards/se/7780/setup.c
+++ b/arch/sh/boards/se/7780/setup.c
@@ -16,12 +16,10 @@
16#include <asm/io.h> 16#include <asm/io.h>
17 17
18/* Heartbeat */ 18/* Heartbeat */
19static unsigned char heartbeat_bit_pos[] = { 0, 1, 2, 3, 4, 5, 6, 7 };
20
21static struct resource heartbeat_resources[] = { 19static struct resource heartbeat_resources[] = {
22 [0] = { 20 [0] = {
23 .start = PA_LED, 21 .start = PA_LED,
24 .end = PA_LED + ARRAY_SIZE(heartbeat_bit_pos) - 1, 22 .end = PA_LED + 8 - 1,
25 .flags = IORESOURCE_MEM, 23 .flags = IORESOURCE_MEM,
26 }, 24 },
27}; 25};
@@ -29,9 +27,6 @@ static struct resource heartbeat_resources[] = {
29static struct platform_device heartbeat_device = { 27static struct platform_device heartbeat_device = {
30 .name = "heartbeat", 28 .name = "heartbeat",
31 .id = -1, 29 .id = -1,
32 .dev = {
33 .platform_data = heartbeat_bit_pos,
34 },
35 .num_resources = ARRAY_SIZE(heartbeat_resources), 30 .num_resources = ARRAY_SIZE(heartbeat_resources),
36 .resource = heartbeat_resources, 31 .resource = heartbeat_resources,
37}; 32};