diff options
Diffstat (limited to 'arch/sh/boards')
-rw-r--r-- | arch/sh/boards/board-magicpanelr2.c | 2 | ||||
-rw-r--r-- | arch/sh/boards/mach-dreamcast/setup.c | 2 | ||||
-rw-r--r-- | arch/sh/boards/mach-ecovec24/setup.c | 63 | ||||
-rw-r--r-- | arch/sh/boards/mach-landisk/gio.c | 10 | ||||
-rw-r--r-- | arch/sh/boards/mach-rsk/devices-rsk7203.c | 4 | ||||
-rw-r--r-- | arch/sh/boards/mach-rsk/setup.c | 23 |
6 files changed, 80 insertions, 24 deletions
diff --git a/arch/sh/boards/board-magicpanelr2.c b/arch/sh/boards/board-magicpanelr2.c index 0a37c8bfc959..99ffc5f1c0dd 100644 --- a/arch/sh/boards/board-magicpanelr2.c +++ b/arch/sh/boards/board-magicpanelr2.c | |||
@@ -205,8 +205,6 @@ static void __init setup_port_multiplexing(void) | |||
205 | 205 | ||
206 | static void __init mpr2_setup(char **cmdline_p) | 206 | static void __init mpr2_setup(char **cmdline_p) |
207 | { | 207 | { |
208 | __set_io_port_base(0xa0000000); | ||
209 | |||
210 | /* set Pin Select Register A: | 208 | /* set Pin Select Register A: |
211 | * /PCC_CD1, /PCC_CD2, PCC_BVD1, PCC_BVD2, | 209 | * /PCC_CD1, /PCC_CD2, PCC_BVD1, PCC_BVD2, |
212 | * /IOIS16, IRQ4, IRQ5, USB1d_SUSPEND | 210 | * /IOIS16, IRQ4, IRQ5, USB1d_SUSPEND |
diff --git a/arch/sh/boards/mach-dreamcast/setup.c b/arch/sh/boards/mach-dreamcast/setup.c index ebe99227d4e6..a4b7402d6176 100644 --- a/arch/sh/boards/mach-dreamcast/setup.c +++ b/arch/sh/boards/mach-dreamcast/setup.c | |||
@@ -42,8 +42,6 @@ static void __init dreamcast_setup(char **cmdline_p) | |||
42 | /* Acknowledge any previous events */ | 42 | /* Acknowledge any previous events */ |
43 | /* XXX */ | 43 | /* XXX */ |
44 | 44 | ||
45 | __set_io_port_base(0xa0000000); | ||
46 | |||
47 | /* Assign all virtual IRQs to the System ASIC int. handler */ | 45 | /* Assign all virtual IRQs to the System ASIC int. handler */ |
48 | for (i = HW_EVENT_IRQ_BASE; i < HW_EVENT_IRQ_MAX; i++) | 46 | for (i = HW_EVENT_IRQ_BASE; i < HW_EVENT_IRQ_MAX; i++) |
49 | set_irq_chip_and_handler(i, &systemasic_int, | 47 | set_irq_chip_and_handler(i, &systemasic_int, |
diff --git a/arch/sh/boards/mach-ecovec24/setup.c b/arch/sh/boards/mach-ecovec24/setup.c index 5f9881e16e2f..3b1ceb46fa54 100644 --- a/arch/sh/boards/mach-ecovec24/setup.c +++ b/arch/sh/boards/mach-ecovec24/setup.c | |||
@@ -18,6 +18,7 @@ | |||
18 | #include <linux/delay.h> | 18 | #include <linux/delay.h> |
19 | #include <linux/usb/r8a66597.h> | 19 | #include <linux/usb/r8a66597.h> |
20 | #include <linux/i2c.h> | 20 | #include <linux/i2c.h> |
21 | #include <linux/i2c/tsc2007.h> | ||
21 | #include <linux/input.h> | 22 | #include <linux/input.h> |
22 | #include <video/sh_mobile_lcdc.h> | 23 | #include <video/sh_mobile_lcdc.h> |
23 | #include <media/sh_mobile_ceu.h> | 24 | #include <media/sh_mobile_ceu.h> |
@@ -38,6 +39,20 @@ | |||
38 | * 0x1800_0000 MFI 16bit | 39 | * 0x1800_0000 MFI 16bit |
39 | */ | 40 | */ |
40 | 41 | ||
42 | /* SWITCH | ||
43 | *------------------------------ | ||
44 | * DS2[1] = FlashROM write protect ON : write protect | ||
45 | * OFF : No write protect | ||
46 | * DS2[2] = RMII / TS, SCIF ON : RMII | ||
47 | * OFF : TS, SCIF3 | ||
48 | * DS2[3] = Camera / Video ON : Camera | ||
49 | * OFF : NTSC/PAL (IN) | ||
50 | * DS2[5] = NTSC_OUT Clock ON : On board OSC | ||
51 | * OFF : SH7724 DV_CLK | ||
52 | * DS2[6-7] = MMC / SD ON-OFF : SD | ||
53 | * OFF-ON : MMC | ||
54 | */ | ||
55 | |||
41 | /* Heartbeat */ | 56 | /* Heartbeat */ |
42 | static unsigned char led_pos[] = { 0, 1, 2, 3 }; | 57 | static unsigned char led_pos[] = { 0, 1, 2, 3 }; |
43 | static struct heartbeat_data heartbeat_data = { | 58 | static struct heartbeat_data heartbeat_data = { |
@@ -70,7 +85,7 @@ static struct mtd_partition nor_flash_partitions[] = { | |||
70 | .name = "boot loader", | 85 | .name = "boot loader", |
71 | .offset = 0, | 86 | .offset = 0, |
72 | .size = (5 * 1024 * 1024), | 87 | .size = (5 * 1024 * 1024), |
73 | .mask_flags = MTD_CAP_ROM, | 88 | .mask_flags = MTD_WRITEABLE, /* force read-only */ |
74 | }, { | 89 | }, { |
75 | .name = "free-area", | 90 | .name = "free-area", |
76 | .offset = MTDPART_OFS_APPEND, | 91 | .offset = MTDPART_OFS_APPEND, |
@@ -376,6 +391,43 @@ static struct platform_device keysc_device = { | |||
376 | }, | 391 | }, |
377 | }; | 392 | }; |
378 | 393 | ||
394 | /* TouchScreen */ | ||
395 | #define IRQ0 32 | ||
396 | static int ts_get_pendown_state(void) | ||
397 | { | ||
398 | int val = 0; | ||
399 | gpio_free(GPIO_FN_INTC_IRQ0); | ||
400 | gpio_request(GPIO_PTZ0, NULL); | ||
401 | gpio_direction_input(GPIO_PTZ0); | ||
402 | |||
403 | val = gpio_get_value(GPIO_PTZ0); | ||
404 | |||
405 | gpio_free(GPIO_PTZ0); | ||
406 | gpio_request(GPIO_FN_INTC_IRQ0, NULL); | ||
407 | |||
408 | return val ? 0 : 1; | ||
409 | } | ||
410 | |||
411 | static int ts_init(void) | ||
412 | { | ||
413 | gpio_request(GPIO_FN_INTC_IRQ0, NULL); | ||
414 | return 0; | ||
415 | } | ||
416 | |||
417 | struct tsc2007_platform_data tsc2007_info = { | ||
418 | .model = 2007, | ||
419 | .x_plate_ohms = 180, | ||
420 | .get_pendown_state = ts_get_pendown_state, | ||
421 | .init_platform_hw = ts_init, | ||
422 | }; | ||
423 | |||
424 | static struct i2c_board_info ts_i2c_clients = { | ||
425 | I2C_BOARD_INFO("tsc2007", 0x48), | ||
426 | .type = "tsc2007", | ||
427 | .platform_data = &tsc2007_info, | ||
428 | .irq = IRQ0, | ||
429 | }; | ||
430 | |||
379 | static struct platform_device *ecovec_devices[] __initdata = { | 431 | static struct platform_device *ecovec_devices[] __initdata = { |
380 | &heartbeat_device, | 432 | &heartbeat_device, |
381 | &nor_flash_device, | 433 | &nor_flash_device, |
@@ -460,6 +512,11 @@ static void __init sh_eth_init(void) | |||
460 | #define IODRIVEA 0xA405018A | 512 | #define IODRIVEA 0xA405018A |
461 | static int __init arch_setup(void) | 513 | static int __init arch_setup(void) |
462 | { | 514 | { |
515 | /* enable STATUS0, STATUS2 and PDSTATUS */ | ||
516 | gpio_request(GPIO_FN_STATUS0, NULL); | ||
517 | gpio_request(GPIO_FN_STATUS2, NULL); | ||
518 | gpio_request(GPIO_FN_PDSTATUS, NULL); | ||
519 | |||
463 | /* enable SCIFA0 */ | 520 | /* enable SCIFA0 */ |
464 | gpio_request(GPIO_FN_SCIF0_TXD, NULL); | 521 | gpio_request(GPIO_FN_SCIF0_TXD, NULL); |
465 | gpio_request(GPIO_FN_SCIF0_RXD, NULL); | 522 | gpio_request(GPIO_FN_SCIF0_RXD, NULL); |
@@ -590,6 +647,10 @@ static int __init arch_setup(void) | |||
590 | */ | 647 | */ |
591 | gpio_request(GPIO_PTF4, NULL); | 648 | gpio_request(GPIO_PTF4, NULL); |
592 | gpio_direction_output(GPIO_PTF4, 1); | 649 | gpio_direction_output(GPIO_PTF4, 1); |
650 | |||
651 | /* enable TouchScreen */ | ||
652 | i2c_register_board_info(0, &ts_i2c_clients, 1); | ||
653 | set_irq_type(IRQ0, IRQ_TYPE_LEVEL_LOW); | ||
593 | } | 654 | } |
594 | 655 | ||
595 | /* enable CEU0 */ | 656 | /* enable CEU0 */ |
diff --git a/arch/sh/boards/mach-landisk/gio.c b/arch/sh/boards/mach-landisk/gio.c index 25cdf7358000..528013188196 100644 --- a/arch/sh/boards/mach-landisk/gio.c +++ b/arch/sh/boards/mach-landisk/gio.c | |||
@@ -14,7 +14,6 @@ | |||
14 | */ | 14 | */ |
15 | #include <linux/module.h> | 15 | #include <linux/module.h> |
16 | #include <linux/init.h> | 16 | #include <linux/init.h> |
17 | #include <linux/smp_lock.h> | ||
18 | #include <linux/kdev_t.h> | 17 | #include <linux/kdev_t.h> |
19 | #include <linux/cdev.h> | 18 | #include <linux/cdev.h> |
20 | #include <linux/fs.h> | 19 | #include <linux/fs.h> |
@@ -35,7 +34,7 @@ static int gio_open(struct inode *inode, struct file *filp) | |||
35 | int minor; | 34 | int minor; |
36 | int ret = -ENOENT; | 35 | int ret = -ENOENT; |
37 | 36 | ||
38 | lock_kernel(); | 37 | preempt_disable(); |
39 | minor = MINOR(inode->i_rdev); | 38 | minor = MINOR(inode->i_rdev); |
40 | if (minor < DEVCOUNT) { | 39 | if (minor < DEVCOUNT) { |
41 | if (openCnt > 0) { | 40 | if (openCnt > 0) { |
@@ -45,7 +44,7 @@ static int gio_open(struct inode *inode, struct file *filp) | |||
45 | ret = 0; | 44 | ret = 0; |
46 | } | 45 | } |
47 | } | 46 | } |
48 | unlock_kernel(); | 47 | preempt_enable(); |
49 | return ret; | 48 | return ret; |
50 | } | 49 | } |
51 | 50 | ||
@@ -60,8 +59,7 @@ static int gio_close(struct inode *inode, struct file *filp) | |||
60 | return 0; | 59 | return 0; |
61 | } | 60 | } |
62 | 61 | ||
63 | static int gio_ioctl(struct inode *inode, struct file *filp, | 62 | static long gio_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) |
64 | unsigned int cmd, unsigned long arg) | ||
65 | { | 63 | { |
66 | unsigned int data; | 64 | unsigned int data; |
67 | static unsigned int addr = 0; | 65 | static unsigned int addr = 0; |
@@ -129,7 +127,7 @@ static const struct file_operations gio_fops = { | |||
129 | .owner = THIS_MODULE, | 127 | .owner = THIS_MODULE, |
130 | .open = gio_open, /* open */ | 128 | .open = gio_open, /* open */ |
131 | .release = gio_close, /* release */ | 129 | .release = gio_close, /* release */ |
132 | .ioctl = gio_ioctl, /* ioctl */ | 130 | .unlocked_ioctl = gio_ioctl, |
133 | }; | 131 | }; |
134 | 132 | ||
135 | static int __init gio_init(void) | 133 | static int __init gio_init(void) |
diff --git a/arch/sh/boards/mach-rsk/devices-rsk7203.c b/arch/sh/boards/mach-rsk/devices-rsk7203.c index 4af3a771c058..c37617e63220 100644 --- a/arch/sh/boards/mach-rsk/devices-rsk7203.c +++ b/arch/sh/boards/mach-rsk/devices-rsk7203.c | |||
@@ -11,10 +11,6 @@ | |||
11 | #include <linux/types.h> | 11 | #include <linux/types.h> |
12 | #include <linux/platform_device.h> | 12 | #include <linux/platform_device.h> |
13 | #include <linux/interrupt.h> | 13 | #include <linux/interrupt.h> |
14 | #include <linux/mtd/mtd.h> | ||
15 | #include <linux/mtd/partitions.h> | ||
16 | #include <linux/mtd/physmap.h> | ||
17 | #include <linux/mtd/map.h> | ||
18 | #include <linux/smsc911x.h> | 14 | #include <linux/smsc911x.h> |
19 | #include <linux/gpio.h> | 15 | #include <linux/gpio.h> |
20 | #include <linux/leds.h> | 16 | #include <linux/leds.h> |
diff --git a/arch/sh/boards/mach-rsk/setup.c b/arch/sh/boards/mach-rsk/setup.c index af64d030a5c7..a5c0df785bfe 100644 --- a/arch/sh/boards/mach-rsk/setup.c +++ b/arch/sh/boards/mach-rsk/setup.c | |||
@@ -15,14 +15,12 @@ | |||
15 | #include <linux/mtd/mtd.h> | 15 | #include <linux/mtd/mtd.h> |
16 | #include <linux/mtd/partitions.h> | 16 | #include <linux/mtd/partitions.h> |
17 | #include <linux/mtd/physmap.h> | 17 | #include <linux/mtd/physmap.h> |
18 | #ifdef CONFIG_MTD | ||
18 | #include <linux/mtd/map.h> | 19 | #include <linux/mtd/map.h> |
20 | #endif | ||
19 | #include <asm/machvec.h> | 21 | #include <asm/machvec.h> |
20 | #include <asm/io.h> | 22 | #include <asm/io.h> |
21 | 23 | ||
22 | static const char *probes[] = { "cmdlinepart", NULL }; | ||
23 | |||
24 | static struct mtd_partition *parsed_partitions; | ||
25 | |||
26 | static struct mtd_partition rsk_partitions[] = { | 24 | static struct mtd_partition rsk_partitions[] = { |
27 | { | 25 | { |
28 | .name = "Bootloader", | 26 | .name = "Bootloader", |
@@ -41,6 +39,8 @@ static struct mtd_partition rsk_partitions[] = { | |||
41 | }; | 39 | }; |
42 | 40 | ||
43 | static struct physmap_flash_data flash_data = { | 41 | static struct physmap_flash_data flash_data = { |
42 | .parts = rsk_partitions, | ||
43 | .nr_parts = ARRAY_SIZE(rsk_partitions), | ||
44 | .width = 2, | 44 | .width = 2, |
45 | }; | 45 | }; |
46 | 46 | ||
@@ -60,7 +60,8 @@ static struct platform_device flash_device = { | |||
60 | }, | 60 | }, |
61 | }; | 61 | }; |
62 | 62 | ||
63 | static struct mtd_info *flash_mtd; | 63 | #ifdef CONFIG_MTD |
64 | static const char *probes[] = { "cmdlinepart", NULL }; | ||
64 | 65 | ||
65 | static struct map_info rsk_flash_map = { | 66 | static struct map_info rsk_flash_map = { |
66 | .name = "RSK+ Flash", | 67 | .name = "RSK+ Flash", |
@@ -68,6 +69,10 @@ static struct map_info rsk_flash_map = { | |||
68 | .bankwidth = 2, | 69 | .bankwidth = 2, |
69 | }; | 70 | }; |
70 | 71 | ||
72 | static struct mtd_info *flash_mtd; | ||
73 | |||
74 | static struct mtd_partition *parsed_partitions; | ||
75 | |||
71 | static void __init set_mtd_partitions(void) | 76 | static void __init set_mtd_partitions(void) |
72 | { | 77 | { |
73 | int nr_parts = 0; | 78 | int nr_parts = 0; |
@@ -77,14 +82,14 @@ static void __init set_mtd_partitions(void) | |||
77 | nr_parts = parse_mtd_partitions(flash_mtd, probes, | 82 | nr_parts = parse_mtd_partitions(flash_mtd, probes, |
78 | &parsed_partitions, 0); | 83 | &parsed_partitions, 0); |
79 | /* If there is no partition table, used the hard coded table */ | 84 | /* If there is no partition table, used the hard coded table */ |
80 | if (nr_parts <= 0) { | 85 | if (nr_parts > 0) { |
81 | flash_data.parts = rsk_partitions; | ||
82 | flash_data.nr_parts = ARRAY_SIZE(rsk_partitions); | ||
83 | } else { | ||
84 | flash_data.nr_parts = nr_parts; | 86 | flash_data.nr_parts = nr_parts; |
85 | flash_data.parts = parsed_partitions; | 87 | flash_data.parts = parsed_partitions; |
86 | } | 88 | } |
87 | } | 89 | } |
90 | #else | ||
91 | static inline void set_mtd_partitions(void) {} | ||
92 | #endif | ||
88 | 93 | ||
89 | static struct platform_device *rsk_devices[] __initdata = { | 94 | static struct platform_device *rsk_devices[] __initdata = { |
90 | &flash_device, | 95 | &flash_device, |