diff options
author | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-04-16 18:20:36 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-04-16 18:20:36 -0400 |
commit | 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 (patch) | |
tree | 0bba044c4ce775e45a88a51686b5d9f90697ea9d /drivers/ide/arm/bast-ide.c |
Linux-2.6.12-rc2v2.6.12-rc2
Initial git repository build. I'm not bothering with the full history,
even though we have it. We can create a separate "historical" git
archive of that later if we want to, and in the meantime it's about
3.2GB when imported into git - space that would just make the early
git days unnecessarily complicated, when we don't have a lot of good
infrastructure for it.
Let it rip!
Diffstat (limited to 'drivers/ide/arm/bast-ide.c')
-rw-r--r-- | drivers/ide/arm/bast-ide.c | 71 |
1 files changed, 71 insertions, 0 deletions
diff --git a/drivers/ide/arm/bast-ide.c b/drivers/ide/arm/bast-ide.c new file mode 100644 index 000000000000..9d474e5fd8dc --- /dev/null +++ b/drivers/ide/arm/bast-ide.c | |||
@@ -0,0 +1,71 @@ | |||
1 | /* linux/drivers/ide/arm/bast-ide.c | ||
2 | * | ||
3 | * Copyright (c) 2003-2004 Simtec Electronics | ||
4 | * Ben Dooks <ben@simtec.co.uk> | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License version 2 as | ||
8 | * published by the Free Software Foundation. | ||
9 | * | ||
10 | */ | ||
11 | |||
12 | #include <linux/module.h> | ||
13 | #include <linux/errno.h> | ||
14 | #include <linux/ide.h> | ||
15 | #include <linux/init.h> | ||
16 | |||
17 | #include <asm/mach-types.h> | ||
18 | |||
19 | #include <asm/io.h> | ||
20 | #include <asm/irq.h> | ||
21 | #include <asm/arch/map.h> | ||
22 | #include <asm/arch/bast-map.h> | ||
23 | #include <asm/arch/bast-irq.h> | ||
24 | |||
25 | /* list of registered interfaces */ | ||
26 | static ide_hwif_t *ifs[2]; | ||
27 | |||
28 | static int __init | ||
29 | bastide_register(unsigned int base, unsigned int aux, int irq, | ||
30 | ide_hwif_t **hwif) | ||
31 | { | ||
32 | hw_regs_t hw; | ||
33 | int i; | ||
34 | |||
35 | memset(&hw, 0, sizeof(hw)); | ||
36 | |||
37 | base += BAST_IDE_CS; | ||
38 | aux += BAST_IDE_CS; | ||
39 | |||
40 | for (i = IDE_DATA_OFFSET; i <= IDE_STATUS_OFFSET; i++) { | ||
41 | hw.io_ports[i] = (unsigned long)base; | ||
42 | base += 0x20; | ||
43 | } | ||
44 | |||
45 | hw.io_ports[IDE_CONTROL_OFFSET] = aux + (6 * 0x20); | ||
46 | hw.irq = irq; | ||
47 | |||
48 | ide_register_hw(&hw, hwif); | ||
49 | |||
50 | return 0; | ||
51 | } | ||
52 | |||
53 | static int __init bastide_init(void) | ||
54 | { | ||
55 | /* we can treat the VR1000 and the BAST the same */ | ||
56 | |||
57 | if (!(machine_is_bast() || machine_is_vr1000())) | ||
58 | return 0; | ||
59 | |||
60 | printk("BAST: IDE driver, (c) 2003-2004 Simtec Electronics\n"); | ||
61 | |||
62 | bastide_register(BAST_VA_IDEPRI, BAST_VA_IDEPRIAUX, IRQ_IDE0, &ifs[0]); | ||
63 | bastide_register(BAST_VA_IDESEC, BAST_VA_IDESECAUX, IRQ_IDE1, &ifs[1]); | ||
64 | return 0; | ||
65 | } | ||
66 | |||
67 | module_init(bastide_init); | ||
68 | |||
69 | MODULE_AUTHOR("Ben Dooks <ben@simtec.co.uk>"); | ||
70 | MODULE_LICENSE("GPL"); | ||
71 | MODULE_DESCRIPTION("Simtec BAST / Thorcom VR1000 IDE driver"); | ||