diff options
author | Nobuhiro Iwamatsu <iwamatsu@nigauri.org> | 2007-03-26 01:27:43 -0400 |
---|---|---|
committer | Paul Mundt <lethal@hera.kernel.org> | 2007-05-06 22:10:54 -0400 |
commit | c86c5a910451dd5a30e62a9e36d8e9b3c7a0c1d1 (patch) | |
tree | 69acbb65e61a8895dfdebfd70dc58f5d8d9dbe38 /arch/sh/boards | |
parent | 00e8c494a1603eac0a2cae9836e624a752ad45b1 (diff) |
sh: L-BOX RE2 support.
This adds support for the L-BOX RE2 router.
http://www.nttcom.co.jp/l-box/
L-BOX RE2 is a SH7751R-based router. It has CF, Cardbus, serial,
and LAN x2. This is one of the very few SH boards that a general
person can obtain now.
The L-BOX shipped with a 2.4.28 kernel, this is a rewritten patch
adding it to current git.
Signed-off-by: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/sh/boards')
-rw-r--r-- | arch/sh/boards/lboxre2/Makefile | 5 | ||||
-rw-r--r-- | arch/sh/boards/lboxre2/irq.c | 31 | ||||
-rw-r--r-- | arch/sh/boards/lboxre2/setup.c | 84 |
3 files changed, 120 insertions, 0 deletions
diff --git a/arch/sh/boards/lboxre2/Makefile b/arch/sh/boards/lboxre2/Makefile new file mode 100644 index 000000000000..e9ed140c06f6 --- /dev/null +++ b/arch/sh/boards/lboxre2/Makefile | |||
@@ -0,0 +1,5 @@ | |||
1 | # | ||
2 | # Makefile for the L-BOX RE2 specific parts of the kernel | ||
3 | # Copyright (c) 2007 Nobuhiro Iwamatsu | ||
4 | |||
5 | obj-y := setup.o irq.o | ||
diff --git a/arch/sh/boards/lboxre2/irq.c b/arch/sh/boards/lboxre2/irq.c new file mode 100644 index 000000000000..5a1c3bbe7b50 --- /dev/null +++ b/arch/sh/boards/lboxre2/irq.c | |||
@@ -0,0 +1,31 @@ | |||
1 | /* | ||
2 | * linux/arch/sh/boards/lboxre2/irq.c | ||
3 | * | ||
4 | * Copyright (C) 2007 Nobuhiro Iwamatsu | ||
5 | * | ||
6 | * NTT COMWARE L-BOX RE2 Support. | ||
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 | */ | ||
13 | #include <linux/init.h> | ||
14 | #include <linux/interrupt.h> | ||
15 | #include <linux/irq.h> | ||
16 | #include <asm/irq.h> | ||
17 | #include <asm/io.h> | ||
18 | #include <asm/lboxre2.h> | ||
19 | |||
20 | /* | ||
21 | * Initialize IRQ setting | ||
22 | */ | ||
23 | void __init init_lboxre2_IRQ(void) | ||
24 | { | ||
25 | make_imask_irq(IRQ_CF1); | ||
26 | make_imask_irq(IRQ_CF0); | ||
27 | make_imask_irq(IRQ_INTD); | ||
28 | make_imask_irq(IRQ_ETH1); | ||
29 | make_imask_irq(IRQ_ETH0); | ||
30 | make_imask_irq(IRQ_INTA); | ||
31 | } | ||
diff --git a/arch/sh/boards/lboxre2/setup.c b/arch/sh/boards/lboxre2/setup.c new file mode 100644 index 000000000000..fc3cba3f0606 --- /dev/null +++ b/arch/sh/boards/lboxre2/setup.c | |||
@@ -0,0 +1,84 @@ | |||
1 | /* | ||
2 | * linux/arch/sh/boards/lbox/setup.c | ||
3 | * | ||
4 | * Copyright (C) 2007 Nobuhiro Iwamatsu | ||
5 | * | ||
6 | * NTT COMWARE L-BOX RE2 Support | ||
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 | */ | ||
13 | |||
14 | #include <linux/init.h> | ||
15 | #include <linux/platform_device.h> | ||
16 | #include <linux/pata_platform.h> | ||
17 | #include <asm/machvec.h> | ||
18 | #include <asm/lboxre2.h> | ||
19 | #include <asm/io.h> | ||
20 | |||
21 | static struct resource cf_ide_resources[] = { | ||
22 | [0] = { | ||
23 | .start = 0x1f0, | ||
24 | .end = 0x1f0 + 8 , | ||
25 | .flags = IORESOURCE_IO, | ||
26 | }, | ||
27 | [1] = { | ||
28 | .start = 0x1f0 + 0x206, | ||
29 | .end = 0x1f0 +8 + 0x206 + 8, | ||
30 | .flags = IORESOURCE_IO, | ||
31 | }, | ||
32 | [2] = { | ||
33 | .start = IRQ_CF0, | ||
34 | .flags = IORESOURCE_IRQ, | ||
35 | }, | ||
36 | }; | ||
37 | |||
38 | static struct platform_device cf_ide_device = { | ||
39 | .name = "pata_platform", | ||
40 | .id = -1, | ||
41 | .num_resources = ARRAY_SIZE(cf_ide_resources), | ||
42 | .resource = cf_ide_resources, | ||
43 | }; | ||
44 | |||
45 | static struct platform_device *lboxre2_devices[] __initdata = { | ||
46 | &cf_ide_device, | ||
47 | }; | ||
48 | |||
49 | static int __init lboxre2_devices_setup(void) | ||
50 | { | ||
51 | u32 cf0_io_base; /* Boot CF base address */ | ||
52 | pgprot_t prot; | ||
53 | unsigned long paddrbase, psize; | ||
54 | |||
55 | /* open I/O area window */ | ||
56 | paddrbase = virt_to_phys((void*)CONFIG_CF0_BASE_ADDR); | ||
57 | psize = PAGE_SIZE; | ||
58 | prot = PAGE_KERNEL_PCC( 1 , _PAGE_PCC_IO16); | ||
59 | cf0_io_base = (u32)p3_ioremap(paddrbase, psize, prot.pgprot); | ||
60 | if (!cf0_io_base) { | ||
61 | printk(KERN_ERR "%s : can't open CF I/O window!\n" , __func__ ); | ||
62 | return -ENOMEM; | ||
63 | } | ||
64 | |||
65 | cf_ide_resources[0].start += cf0_io_base ; | ||
66 | cf_ide_resources[0].end += cf0_io_base ; | ||
67 | cf_ide_resources[1].start += cf0_io_base ; | ||
68 | cf_ide_resources[1].end += cf0_io_base ; | ||
69 | |||
70 | return platform_add_devices(lboxre2_devices, | ||
71 | ARRAY_SIZE(lboxre2_devices)); | ||
72 | |||
73 | } | ||
74 | device_initcall(lboxre2_devices_setup); | ||
75 | |||
76 | /* | ||
77 | * The Machine Vector | ||
78 | */ | ||
79 | struct sh_machine_vector mv_lboxre2 __initmv = { | ||
80 | .mv_name = "L-BOX RE2", | ||
81 | .mv_nr_irqs = 72, | ||
82 | .mv_init_irq = init_lboxre2_IRQ, | ||
83 | }; | ||
84 | ALIAS_MV(lboxre2) | ||