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 | |
Finn Thain | 4d8c08c | 2016-01-03 16:05:09 +1100 | [diff] [blame] | 17 | #ifdef CONFIG_SCSI_GENERIC_NCR53C400 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 18 | #define BIOSPARAM |
| 19 | #define NCR5380_BIOSPARAM generic_NCR5380_biosparam |
| 20 | #else |
| 21 | #define NCR5380_BIOSPARAM NULL |
| 22 | #endif |
| 23 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 24 | #ifndef CMD_PER_LUN |
| 25 | #define CMD_PER_LUN 2 |
| 26 | #endif |
| 27 | |
| 28 | #ifndef CAN_QUEUE |
| 29 | #define CAN_QUEUE 16 |
| 30 | #endif |
| 31 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 32 | #define __STRVAL(x) #x |
| 33 | #define STRVAL(x) __STRVAL(x) |
| 34 | |
Ondrej Zary | 702a98c | 2010-08-10 18:01:16 -0700 | [diff] [blame] | 35 | #ifndef SCSI_G_NCR5380_MEM |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 36 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 37 | #define NCR5380_map_type int |
| 38 | #define NCR5380_map_name port |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 39 | #define NCR53C400_register_offset 0 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 40 | |
Finn Thain | 4d8c08c | 2016-01-03 16:05:09 +1100 | [diff] [blame] | 41 | #ifdef CONFIG_SCSI_GENERIC_NCR53C400 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 42 | #define NCR5380_region_size 16 |
| 43 | #else |
| 44 | #define NCR5380_region_size 8 |
| 45 | #endif |
| 46 | |
Finn Thain | 54d8fe4 | 2016-01-03 16:05:06 +1100 | [diff] [blame] | 47 | #define NCR5380_read(reg) \ |
| 48 | inb(instance->io_port + (reg)) |
| 49 | #define NCR5380_write(reg, value) \ |
| 50 | outb(value, instance->io_port + (reg)) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 51 | |
Finn Thain | 54d8fe4 | 2016-01-03 16:05:06 +1100 | [diff] [blame] | 52 | #define NCR5380_implementation_fields /* none */ |
Al Viro | c818cb6 | 2006-03-24 03:15:37 -0800 | [diff] [blame] | 53 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 54 | #else |
Ondrej Zary | 702a98c | 2010-08-10 18:01:16 -0700 | [diff] [blame] | 55 | /* therefore SCSI_G_NCR5380_MEM */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 56 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 57 | #define NCR5380_map_type unsigned long |
| 58 | #define NCR5380_map_name base |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 59 | #define NCR53C400_register_offset 0x108 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 60 | #define NCR53C400_mem_base 0x3880 |
| 61 | #define NCR53C400_host_buffer 0x3900 |
| 62 | #define NCR5380_region_size 0x3a00 |
| 63 | |
Finn Thain | 54d8fe4 | 2016-01-03 16:05:06 +1100 | [diff] [blame] | 64 | #define NCR5380_read(reg) \ |
| 65 | readb(((struct NCR5380_hostdata *)shost_priv(instance))->iomem + \ |
| 66 | NCR53C400_mem_base + (reg)) |
| 67 | #define NCR5380_write(reg, value) \ |
| 68 | writeb(value, ((struct NCR5380_hostdata *)shost_priv(instance))->iomem + \ |
| 69 | NCR53C400_mem_base + (reg)) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 70 | |
| 71 | #define NCR5380_implementation_fields \ |
Al Viro | c818cb6 | 2006-03-24 03:15:37 -0800 | [diff] [blame] | 72 | void __iomem *iomem; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 73 | |
Al Viro | c818cb6 | 2006-03-24 03:15:37 -0800 | [diff] [blame] | 74 | #endif |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 75 | |
Finn Thain | ff3d457 | 2016-01-03 16:05:25 +1100 | [diff] [blame^] | 76 | #define NCR5380_dma_xfer_len(instance, cmd, phase) \ |
| 77 | generic_NCR5380_dma_xfer_len(cmd) |
| 78 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 79 | #define NCR5380_intr generic_NCR5380_intr |
| 80 | #define NCR5380_queue_command generic_NCR5380_queue_command |
| 81 | #define NCR5380_abort generic_NCR5380_abort |
| 82 | #define NCR5380_bus_reset generic_NCR5380_bus_reset |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 83 | #define NCR5380_pread generic_NCR5380_pread |
| 84 | #define NCR5380_pwrite generic_NCR5380_pwrite |
Finn Thain | 8c32513 | 2014-11-12 16:11:58 +1100 | [diff] [blame] | 85 | #define NCR5380_info generic_NCR5380_info |
| 86 | #define NCR5380_show_info generic_NCR5380_show_info |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 87 | |
| 88 | #define BOARD_NCR5380 0 |
| 89 | #define BOARD_NCR53C400 1 |
| 90 | #define BOARD_NCR53C400A 2 |
| 91 | #define BOARD_DTC3181E 3 |
| 92 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 93 | #endif /* GENERIC_NCR5380_H */ |
| 94 | |