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