Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Generic Generic NCR5380 driver defines |
| 3 | * |
| 4 | * Copyright 1993, Drew Eckhardt |
| 5 | * Visionary Computing |
| 6 | * (Unix and Linux consulting and custom programming) |
| 7 | * drew@colorado.edu |
| 8 | * +1 (303) 440-4894 |
| 9 | * |
| 10 | * NCR53C400 extensions (c) 1994,1995,1996, Kevin Lentin |
| 11 | * K.Lentin@cs.monash.edu.au |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 12 | */ |
| 13 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 14 | #ifndef GENERIC_NCR5380_H |
| 15 | #define GENERIC_NCR5380_H |
| 16 | |
Ondrej Zary | 702a98c | 2010-08-10 18:01:16 -0700 | [diff] [blame] | 17 | #ifndef SCSI_G_NCR5380_MEM |
Finn Thain | aa2e2cb | 2016-01-03 16:05:48 +1100 | [diff] [blame] | 18 | #define DRV_MODULE_NAME "g_NCR5380" |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 19 | |
Finn Thain | 54d8fe4 | 2016-01-03 16:05:06 +1100 | [diff] [blame] | 20 | #define NCR5380_read(reg) \ |
| 21 | inb(instance->io_port + (reg)) |
| 22 | #define NCR5380_write(reg, value) \ |
| 23 | outb(value, instance->io_port + (reg)) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 24 | |
Ondrej Zary | 1215079 | 2016-01-03 16:06:15 +1100 | [diff] [blame] | 25 | #define NCR5380_implementation_fields \ |
| 26 | int c400_ctl_status; \ |
| 27 | int c400_blk_cnt; \ |
Ondrej Zary | aeb5115 | 2016-01-03 16:06:17 +1100 | [diff] [blame] | 28 | int c400_host_buf; \ |
| 29 | int io_width; |
Al Viro | c818cb6 | 2006-03-24 03:15:37 -0800 | [diff] [blame] | 30 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 31 | #else |
Ondrej Zary | 702a98c | 2010-08-10 18:01:16 -0700 | [diff] [blame] | 32 | /* therefore SCSI_G_NCR5380_MEM */ |
Finn Thain | aa2e2cb | 2016-01-03 16:05:48 +1100 | [diff] [blame] | 33 | #define DRV_MODULE_NAME "g_NCR5380_mmio" |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 34 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 35 | #define NCR53C400_mem_base 0x3880 |
| 36 | #define NCR53C400_host_buffer 0x3900 |
Finn Thain | 9d37640 | 2016-03-23 21:10:10 +1100 | [diff] [blame] | 37 | #define NCR53C400_region_size 0x3a00 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 38 | |
Finn Thain | 54d8fe4 | 2016-01-03 16:05:06 +1100 | [diff] [blame] | 39 | #define NCR5380_read(reg) \ |
| 40 | readb(((struct NCR5380_hostdata *)shost_priv(instance))->iomem + \ |
| 41 | NCR53C400_mem_base + (reg)) |
| 42 | #define NCR5380_write(reg, value) \ |
| 43 | writeb(value, ((struct NCR5380_hostdata *)shost_priv(instance))->iomem + \ |
| 44 | NCR53C400_mem_base + (reg)) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 45 | |
| 46 | #define NCR5380_implementation_fields \ |
Ondrej Zary | 1215079 | 2016-01-03 16:06:15 +1100 | [diff] [blame] | 47 | void __iomem *iomem; \ |
Finn Thain | 9d37640 | 2016-03-23 21:10:10 +1100 | [diff] [blame] | 48 | resource_size_t iomem_size; \ |
Ondrej Zary | 1215079 | 2016-01-03 16:06:15 +1100 | [diff] [blame] | 49 | int c400_ctl_status; \ |
| 50 | int c400_blk_cnt; \ |
| 51 | int c400_host_buf; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 52 | |
Al Viro | c818cb6 | 2006-03-24 03:15:37 -0800 | [diff] [blame] | 53 | #endif |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 54 | |
Finn Thain | ff3d457 | 2016-01-03 16:05:25 +1100 | [diff] [blame] | 55 | #define NCR5380_dma_xfer_len(instance, cmd, phase) \ |
Finn Thain | 7e9ec8d | 2016-03-23 21:10:11 +1100 | [diff] [blame] | 56 | generic_NCR5380_dma_xfer_len(instance, cmd) |
Finn Thain | 6c4b88c | 2016-03-23 21:10:17 +1100 | [diff] [blame] | 57 | #define NCR5380_dma_recv_setup generic_NCR5380_pread |
| 58 | #define NCR5380_dma_send_setup generic_NCR5380_pwrite |
Finn Thain | 8053b0e | 2016-03-23 21:10:19 +1100 | [diff] [blame] | 59 | #define NCR5380_dma_residual(instance) (0) |
Finn Thain | ff3d457 | 2016-01-03 16:05:25 +1100 | [diff] [blame] | 60 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 61 | #define NCR5380_intr generic_NCR5380_intr |
| 62 | #define NCR5380_queue_command generic_NCR5380_queue_command |
| 63 | #define NCR5380_abort generic_NCR5380_abort |
| 64 | #define NCR5380_bus_reset generic_NCR5380_bus_reset |
Finn Thain | 8c32513 | 2014-11-12 16:11:58 +1100 | [diff] [blame] | 65 | #define NCR5380_info generic_NCR5380_info |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 66 | |
Finn Thain | e5d55d1 | 2016-03-23 21:10:16 +1100 | [diff] [blame] | 67 | #define NCR5380_io_delay(x) udelay(x) |
| 68 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 69 | #define BOARD_NCR5380 0 |
| 70 | #define BOARD_NCR53C400 1 |
| 71 | #define BOARD_NCR53C400A 2 |
| 72 | #define BOARD_DTC3181E 3 |
Ondrej Zary | c6084cb | 2016-01-03 16:06:19 +1100 | [diff] [blame] | 73 | #define BOARD_HP_C2502 4 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 74 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 75 | #endif /* GENERIC_NCR5380_H */ |
| 76 | |