diff options
author | Nicholas Beck <nbeck@mpc-data.co.uk> | 2008-01-22 22:50:51 -0500 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2008-01-27 23:19:04 -0500 |
commit | 4862ec073975e28f432f164405e60fa6f5c9d071 (patch) | |
tree | b493b2a7fcd0abd8d13f24e63eaf4aaa9c89077e /arch/sh/boards | |
parent | 773c7bd69434a356af4363a61889ef975b256e32 (diff) |
sh: Add support for SDK7780 board.
Add support for Renesas Technology Europe SDK7780 board.
Signed-off-by: Nicholas Beck <nbeck@mpc-data.co.uk>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/sh/boards')
-rw-r--r-- | arch/sh/boards/renesas/sdk7780/Kconfig | 23 | ||||
-rw-r--r-- | arch/sh/boards/renesas/sdk7780/Makefile | 5 | ||||
-rw-r--r-- | arch/sh/boards/renesas/sdk7780/irq.c | 46 | ||||
-rw-r--r-- | arch/sh/boards/renesas/sdk7780/setup.c | 109 |
4 files changed, 183 insertions, 0 deletions
diff --git a/arch/sh/boards/renesas/sdk7780/Kconfig b/arch/sh/boards/renesas/sdk7780/Kconfig new file mode 100644 index 000000000000..e4f5b6985be1 --- /dev/null +++ b/arch/sh/boards/renesas/sdk7780/Kconfig | |||
@@ -0,0 +1,23 @@ | |||
1 | if SH_SDK7780 | ||
2 | |||
3 | choice | ||
4 | prompt "SDK7780 options" | ||
5 | default SH_SDK7780_BASE | ||
6 | |||
7 | config SH_SDK7780_STANDALONE | ||
8 | bool "SDK7780 board support" | ||
9 | depends on CPU_SUBTYPE_SH7780 | ||
10 | help | ||
11 | Selecting this option will enable support for the | ||
12 | standalone version of the SDK7780. If in doubt, say Y. | ||
13 | |||
14 | config SH_SDK7780_BASE | ||
15 | bool "SDK7780 with base-board support" | ||
16 | depends on CPU_SUBTYPE_SH7780 | ||
17 | help | ||
18 | Selecting this option will enable support for the expansion | ||
19 | baseboard devices. If in doubt, say Y. | ||
20 | |||
21 | endchoice | ||
22 | |||
23 | endif | ||
diff --git a/arch/sh/boards/renesas/sdk7780/Makefile b/arch/sh/boards/renesas/sdk7780/Makefile new file mode 100644 index 000000000000..3d8f0befc35d --- /dev/null +++ b/arch/sh/boards/renesas/sdk7780/Makefile | |||
@@ -0,0 +1,5 @@ | |||
1 | # | ||
2 | # Makefile for the SDK7780 specific parts of the kernel | ||
3 | # | ||
4 | obj-y := setup.o irq.o | ||
5 | |||
diff --git a/arch/sh/boards/renesas/sdk7780/irq.c b/arch/sh/boards/renesas/sdk7780/irq.c new file mode 100644 index 000000000000..87cdc578f6ff --- /dev/null +++ b/arch/sh/boards/renesas/sdk7780/irq.c | |||
@@ -0,0 +1,46 @@ | |||
1 | /* | ||
2 | * linux/arch/sh/boards/renesas/sdk7780/irq.c | ||
3 | * | ||
4 | * Renesas Technology Europe SDK7780 Support. | ||
5 | * | ||
6 | * Copyright (C) 2008 Nicholas Beck <nbeck@mpc-data.co.uk> | ||
7 | * | ||
8 | * This file is subject to the terms and conditions of the GNU General Public | ||
9 | * License. See the file "COPYING" in the main directory of this archive | ||
10 | * for more details. | ||
11 | */ | ||
12 | #include <linux/init.h> | ||
13 | #include <linux/irq.h> | ||
14 | #include <linux/io.h> | ||
15 | #include <asm/sdk7780.h> | ||
16 | |||
17 | enum { | ||
18 | UNUSED = 0, | ||
19 | /* board specific interrupt sources */ | ||
20 | SMC91C111, /* Ethernet controller */ | ||
21 | }; | ||
22 | |||
23 | static struct intc_vect fpga_vectors[] __initdata = { | ||
24 | INTC_IRQ(SMC91C111, IRQ_ETHERNET), | ||
25 | }; | ||
26 | |||
27 | static struct intc_mask_reg fpga_mask_registers[] __initdata = { | ||
28 | { 0, FPGA_IRQ0MR, 16, | ||
29 | { 0, 0, 0, 0, 0, 0, 0, 0, | ||
30 | 0, 0, 0, SMC91C111, 0, 0, 0, 0 } }, | ||
31 | }; | ||
32 | |||
33 | static DECLARE_INTC_DESC(fpga_intc_desc, "sdk7780-irq", fpga_vectors, | ||
34 | NULL, fpga_mask_registers, NULL, NULL); | ||
35 | |||
36 | void __init init_sdk7780_IRQ(void) | ||
37 | { | ||
38 | printk(KERN_INFO "Using SDK7780 interrupt controller.\n"); | ||
39 | |||
40 | ctrl_outw(0xFFFF, FPGA_IRQ0MR); | ||
41 | /* Setup IRL 0-3 */ | ||
42 | ctrl_outw(0x0003, FPGA_IMSR); | ||
43 | plat_irq_setup_pins(IRQ_MODE_IRL3210); | ||
44 | |||
45 | register_intc_controller(&fpga_intc_desc); | ||
46 | } | ||
diff --git a/arch/sh/boards/renesas/sdk7780/setup.c b/arch/sh/boards/renesas/sdk7780/setup.c new file mode 100644 index 000000000000..5df32f201870 --- /dev/null +++ b/arch/sh/boards/renesas/sdk7780/setup.c | |||
@@ -0,0 +1,109 @@ | |||
1 | /* | ||
2 | * arch/sh/boards/renesas/sdk7780/setup.c | ||
3 | * | ||
4 | * Renesas Solutions SH7780 SDK Support | ||
5 | * Copyright (C) 2008 Nicholas Beck <nbeck@mpc-data.co.uk> | ||
6 | * | ||
7 | * This file is subject to the terms and conditions of the GNU General Public | ||
8 | * License. See the file "COPYING" in the main directory of this archive | ||
9 | * for more details. | ||
10 | */ | ||
11 | #include <linux/init.h> | ||
12 | #include <linux/types.h> | ||
13 | #include <linux/platform_device.h> | ||
14 | #include <linux/pata_platform.h> | ||
15 | #include <asm/machvec.h> | ||
16 | #include <asm/sdk7780.h> | ||
17 | #include <asm/heartbeat.h> | ||
18 | #include <asm/io.h> | ||
19 | #include <asm/addrspace.h> | ||
20 | |||
21 | #define GPIO_PECR 0xFFEA0008 | ||
22 | |||
23 | //* Heartbeat */ | ||
24 | static struct heartbeat_data heartbeat_data = { | ||
25 | .regsize = 16, | ||
26 | }; | ||
27 | |||
28 | static struct resource heartbeat_resources[] = { | ||
29 | [0] = { | ||
30 | .start = PA_LED, | ||
31 | .end = PA_LED, | ||
32 | .flags = IORESOURCE_MEM, | ||
33 | }, | ||
34 | }; | ||
35 | |||
36 | static struct platform_device heartbeat_device = { | ||
37 | .name = "heartbeat", | ||
38 | .id = -1, | ||
39 | .dev = { | ||
40 | .platform_data = &heartbeat_data, | ||
41 | }, | ||
42 | .num_resources = ARRAY_SIZE(heartbeat_resources), | ||
43 | .resource = heartbeat_resources, | ||
44 | }; | ||
45 | |||
46 | /* SMC91x */ | ||
47 | static struct resource smc91x_eth_resources[] = { | ||
48 | [0] = { | ||
49 | .name = "smc91x-regs" , | ||
50 | .start = PA_LAN + 0x300, | ||
51 | .end = PA_LAN + 0x300 + 0x10 , | ||
52 | .flags = IORESOURCE_MEM, | ||
53 | }, | ||
54 | [1] = { | ||
55 | .start = IRQ_ETHERNET, | ||
56 | .end = IRQ_ETHERNET, | ||
57 | .flags = IORESOURCE_IRQ, | ||
58 | }, | ||
59 | }; | ||
60 | |||
61 | static struct platform_device smc91x_eth_device = { | ||
62 | .name = "smc91x", | ||
63 | .id = 0, | ||
64 | .dev = { | ||
65 | .dma_mask = NULL, /* don't use dma */ | ||
66 | .coherent_dma_mask = 0xffffffff, | ||
67 | }, | ||
68 | .num_resources = ARRAY_SIZE(smc91x_eth_resources), | ||
69 | .resource = smc91x_eth_resources, | ||
70 | }; | ||
71 | |||
72 | static struct platform_device *sdk7780_devices[] __initdata = { | ||
73 | &heartbeat_device, | ||
74 | &smc91x_eth_device, | ||
75 | }; | ||
76 | |||
77 | static int __init sdk7780_devices_setup(void) | ||
78 | { | ||
79 | return platform_add_devices(sdk7780_devices, | ||
80 | ARRAY_SIZE(sdk7780_devices)); | ||
81 | } | ||
82 | device_initcall(sdk7780_devices_setup); | ||
83 | |||
84 | static void __init sdk7780_setup(char **cmdline_p) | ||
85 | { | ||
86 | u16 ver = ctrl_inw(FPGA_FPVERR); | ||
87 | u16 dateStamp = ctrl_inw(FPGA_FPDATER); | ||
88 | |||
89 | printk(KERN_INFO "Renesas Technology Europe SDK7780 support.\n"); | ||
90 | printk(KERN_INFO "Board version: %d (revision %d), " | ||
91 | "FPGA version: %d (revision %d), datestamp : %d\n", | ||
92 | (ver >> 12) & 0xf, (ver >> 8) & 0xf, | ||
93 | (ver >> 4) & 0xf, ver & 0xf, | ||
94 | dateStamp); | ||
95 | |||
96 | /* Setup pin mux'ing for PCIC */ | ||
97 | ctrl_outw(0x0000, GPIO_PECR); | ||
98 | } | ||
99 | |||
100 | /* | ||
101 | * The Machine Vector | ||
102 | */ | ||
103 | static struct sh_machine_vector mv_se7780 __initmv = { | ||
104 | .mv_name = "Renesas SDK7780-R3" , | ||
105 | .mv_setup = sdk7780_setup, | ||
106 | .mv_nr_irqs = 111, | ||
107 | .mv_init_irq = init_sdk7780_IRQ, | ||
108 | }; | ||
109 | |||