Yoshinori Sato | f36af3fd | 2006-11-05 16:21:09 +0900 | [diff] [blame] | 1 | /* |
| 2 | * |
| 3 | * linux/arch/sh/boards/se/7206/setup.c |
| 4 | * |
| 5 | * Copyright (C) 2006 Yoshinori Sato |
Paul Mundt | 3b4d953 | 2007-02-13 15:42:28 +0900 | [diff] [blame] | 6 | * Copyright (C) 2007 Paul Mundt |
Yoshinori Sato | f36af3fd | 2006-11-05 16:21:09 +0900 | [diff] [blame] | 7 | * |
| 8 | * Hitachi 7206 SolutionEngine Support. |
Yoshinori Sato | f36af3fd | 2006-11-05 16:21:09 +0900 | [diff] [blame] | 9 | */ |
Yoshinori Sato | f36af3fd | 2006-11-05 16:21:09 +0900 | [diff] [blame] | 10 | #include <linux/init.h> |
| 11 | #include <linux/platform_device.h> |
Yoshinori Sato | f36af3fd | 2006-11-05 16:21:09 +0900 | [diff] [blame] | 12 | #include <asm/se7206.h> |
Paul Mundt | 710ee0c | 2006-11-05 16:48:42 +0900 | [diff] [blame] | 13 | #include <asm/io.h> |
Yoshinori Sato | f36af3fd | 2006-11-05 16:21:09 +0900 | [diff] [blame] | 14 | #include <asm/machvec.h> |
Paul Mundt | 8786c95 | 2007-08-20 13:03:41 +0900 | [diff] [blame] | 15 | #include <asm/heartbeat.h> |
Yoshinori Sato | f36af3fd | 2006-11-05 16:21:09 +0900 | [diff] [blame] | 16 | |
| 17 | static struct resource smc91x_resources[] = { |
| 18 | [0] = { |
| 19 | .start = 0x300, |
| 20 | .end = 0x300 + 0x020 - 1, |
| 21 | .flags = IORESOURCE_MEM, |
| 22 | }, |
| 23 | [1] = { |
| 24 | .start = 64, |
| 25 | .end = 64, |
| 26 | .flags = IORESOURCE_IRQ, |
| 27 | }, |
| 28 | }; |
| 29 | |
| 30 | static struct platform_device smc91x_device = { |
| 31 | .name = "smc91x", |
| 32 | .id = -1, |
| 33 | .num_resources = ARRAY_SIZE(smc91x_resources), |
| 34 | .resource = smc91x_resources, |
| 35 | }; |
| 36 | |
Paul Mundt | 3b4d953 | 2007-02-13 15:42:28 +0900 | [diff] [blame] | 37 | static unsigned char heartbeat_bit_pos[] = { 8, 9, 10, 11, 12, 13, 14, 15 }; |
| 38 | |
Paul Mundt | 8786c95 | 2007-08-20 13:03:41 +0900 | [diff] [blame] | 39 | static struct heartbeat_data heartbeat_data = { |
| 40 | .bit_pos = heartbeat_bit_pos, |
| 41 | .nr_bits = ARRAY_SIZE(heartbeat_bit_pos), |
Paul Mundt | 7216ddc | 2007-09-13 13:01:15 +0900 | [diff] [blame^] | 42 | .regsize = 32, |
Paul Mundt | 8786c95 | 2007-08-20 13:03:41 +0900 | [diff] [blame] | 43 | }; |
| 44 | |
Paul Mundt | 3b4d953 | 2007-02-13 15:42:28 +0900 | [diff] [blame] | 45 | static struct resource heartbeat_resources[] = { |
| 46 | [0] = { |
| 47 | .start = PA_LED, |
Paul Mundt | a1fd306 | 2007-08-23 15:11:44 +0900 | [diff] [blame] | 48 | .end = PA_LED, |
Paul Mundt | 3b4d953 | 2007-02-13 15:42:28 +0900 | [diff] [blame] | 49 | .flags = IORESOURCE_MEM, |
| 50 | }, |
| 51 | }; |
| 52 | |
| 53 | static struct platform_device heartbeat_device = { |
| 54 | .name = "heartbeat", |
| 55 | .id = -1, |
| 56 | .dev = { |
Paul Mundt | a1fd306 | 2007-08-23 15:11:44 +0900 | [diff] [blame] | 57 | .platform_data = &heartbeat_data, |
Paul Mundt | 3b4d953 | 2007-02-13 15:42:28 +0900 | [diff] [blame] | 58 | }, |
| 59 | .num_resources = ARRAY_SIZE(heartbeat_resources), |
| 60 | .resource = heartbeat_resources, |
| 61 | }; |
| 62 | |
| 63 | static struct platform_device *se7206_devices[] __initdata = { |
| 64 | &smc91x_device, |
| 65 | &heartbeat_device, |
| 66 | }; |
| 67 | |
Yoshinori Sato | f36af3fd | 2006-11-05 16:21:09 +0900 | [diff] [blame] | 68 | static int __init se7206_devices_setup(void) |
| 69 | { |
Paul Mundt | 3b4d953 | 2007-02-13 15:42:28 +0900 | [diff] [blame] | 70 | return platform_add_devices(se7206_devices, ARRAY_SIZE(se7206_devices)); |
Yoshinori Sato | f36af3fd | 2006-11-05 16:21:09 +0900 | [diff] [blame] | 71 | } |
Yoshinori Sato | f36af3fd | 2006-11-05 16:21:09 +0900 | [diff] [blame] | 72 | __initcall(se7206_devices_setup); |
| 73 | |
Yoshinori Sato | f36af3fd | 2006-11-05 16:21:09 +0900 | [diff] [blame] | 74 | /* |
| 75 | * The Machine Vector |
| 76 | */ |
| 77 | |
Paul Mundt | 82f81f4 | 2007-05-15 15:19:34 +0900 | [diff] [blame] | 78 | static struct sh_machine_vector mv_se __initmv = { |
Yoshinori Sato | f36af3fd | 2006-11-05 16:21:09 +0900 | [diff] [blame] | 79 | .mv_name = "SolutionEngine", |
| 80 | .mv_nr_irqs = 256, |
| 81 | .mv_inb = se7206_inb, |
| 82 | .mv_inw = se7206_inw, |
Yoshinori Sato | f36af3fd | 2006-11-05 16:21:09 +0900 | [diff] [blame] | 83 | .mv_outb = se7206_outb, |
| 84 | .mv_outw = se7206_outw, |
Yoshinori Sato | f36af3fd | 2006-11-05 16:21:09 +0900 | [diff] [blame] | 85 | |
| 86 | .mv_inb_p = se7206_inb_p, |
| 87 | .mv_inw_p = se7206_inw, |
Yoshinori Sato | f36af3fd | 2006-11-05 16:21:09 +0900 | [diff] [blame] | 88 | .mv_outb_p = se7206_outb_p, |
| 89 | .mv_outw_p = se7206_outw, |
Yoshinori Sato | f36af3fd | 2006-11-05 16:21:09 +0900 | [diff] [blame] | 90 | |
| 91 | .mv_insb = se7206_insb, |
| 92 | .mv_insw = se7206_insw, |
Yoshinori Sato | f36af3fd | 2006-11-05 16:21:09 +0900 | [diff] [blame] | 93 | .mv_outsb = se7206_outsb, |
| 94 | .mv_outsw = se7206_outsw, |
Yoshinori Sato | f36af3fd | 2006-11-05 16:21:09 +0900 | [diff] [blame] | 95 | |
| 96 | .mv_init_irq = init_se7206_IRQ, |
Yoshinori Sato | f36af3fd | 2006-11-05 16:21:09 +0900 | [diff] [blame] | 97 | }; |