7 #include <linux/string.h>
8 #include <linux/module.h>
10 #include <linux/slab.h>
12 #include <linux/errno.h>
15 #include <linux/device.h>
23 #define DRV_NAME "icside"
25 #define ICS_IDENT_OFFSET 0x2280
27 #define ICS_ARCIN_V5_INTRSTAT 0x0000
28 #define ICS_ARCIN_V5_INTROFFSET 0x0004
29 #define ICS_ARCIN_V5_IDEOFFSET 0x2800
30 #define ICS_ARCIN_V5_IDEALTOFFSET 0x2b80
31 #define ICS_ARCIN_V5_IDESTEPPING 6
33 #define ICS_ARCIN_V6_IDEOFFSET_1 0x2000
34 #define ICS_ARCIN_V6_INTROFFSET_1 0x2200
35 #define ICS_ARCIN_V6_INTRSTAT_1 0x2290
36 #define ICS_ARCIN_V6_IDEALTOFFSET_1 0x2380
37 #define ICS_ARCIN_V6_IDEOFFSET_2 0x3000
38 #define ICS_ARCIN_V6_INTROFFSET_2 0x3200
39 #define ICS_ARCIN_V6_INTRSTAT_2 0x3290
40 #define ICS_ARCIN_V6_IDEALTOFFSET_2 0x3380
41 #define ICS_ARCIN_V6_IDESTEPPING 6
49 static struct cardinfo icside_cardinfo_v5 = {
55 static struct cardinfo icside_cardinfo_v6_1 = {
61 static struct cardinfo icside_cardinfo_v6_2 = {
77 #define ICS_TYPE_A3IN 0
78 #define ICS_TYPE_A3USER 1
80 #define ICS_TYPE_V5 15
81 #define ICS_TYPE_NOTYPE ((unsigned int)-1)
87 static void icside_irqenable_arcin_v5 (
struct expansion_card *ec,
int irqnr)
97 static void icside_irqdisable_arcin_v5 (
struct expansion_card *ec,
int irqnr)
106 .irqdisable = icside_irqdisable_arcin_v5,
114 static void icside_irqenable_arcin_v6 (
struct expansion_card *ec,
int irqnr)
136 static void icside_irqdisable_arcin_v6 (
struct expansion_card *ec,
int irqnr)
159 .irqdisable = icside_irqdisable_arcin_v6,
160 .irqpending = icside_irqpending_arcin_v6,
197 static const struct ide_port_ops icside_v6_no_dma_port_ops = {
198 .maskproc = icside_maskproc,
201 #ifdef CONFIG_BLK_DEV_IDEDMA_ICS
239 unsigned long cycle_time = 0;
240 int use_dma_info = 0;
272 ide_set_drivedata(drive, (
void *)cycle_time);
276 2000 / (cycle_time ? cycle_time : (
unsigned long) -1));
281 .maskproc = icside_maskproc,
284 static void icside_dma_host_set(
ide_drive_t *drive,
int on)
328 icside_maskproc(drive, 0);
370 static const struct ide_dma_ops icside_v6_dma_ops = {
372 .dma_setup = icside_dma_setup,
373 .dma_start = icside_dma_start,
374 .dma_end = icside_dma_end,
375 .dma_test_irq = icside_dma_test_irq,
431 icside_irqdisable_arcin_v5(ec, 0);
433 icside_setup_ports(&
hw, base, &icside_cardinfo_v5, ec);
455 .init_dma = icside_dma_off_init,
456 .port_ops = &icside_v6_no_dma_port_ops,
466 void __iomem *ioc_base, *easi_base;
468 unsigned int sel = 0;
479 easi_base = ioc_base;
505 icside_irqdisable_arcin_v6(ec, 0);
507 icside_setup_ports(&
hw[0], easi_base, &icside_cardinfo_v6_1, ec);
508 icside_setup_ports(&
hw[1], easi_base, &icside_cardinfo_v6_2, ec);
518 #ifdef CONFIG_BLK_DEV_IDEDMA_ICS
522 d.
dma_ops = &icside_v6_dma_ops;
572 switch (state->
type) {
584 ret = icside_register_v5(state, ec);
588 ret = icside_register_v6(state, ec);
611 switch (state->
type) {
616 icside_irqdisable_arcin_v5(ec, 0);
625 icside_irqdisable_arcin_v6(ec, 0);
661 static const struct ecard_id icside_ids[] = {
668 .probe = icside_probe,
670 .shutdown = icside_shutdown,
671 .id_table = icside_ids,
677 static int __init icside_init(
void)
682 static void __exit icside_exit(
void)