1 /* SPDX-License-Identifier: GPL-2.0 */ << 2 #ifndef _LINUX_EISA_H 1 #ifndef _LINUX_EISA_H 3 #define _LINUX_EISA_H 2 #define _LINUX_EISA_H 4 3 5 #include <linux/ioport.h> 4 #include <linux/ioport.h> 6 #include <linux/device.h> 5 #include <linux/device.h> 7 #include <linux/mod_devicetable.h> 6 #include <linux/mod_devicetable.h> 8 7 9 #define EISA_MAX_SLOTS 8 8 #define EISA_MAX_SLOTS 8 10 9 11 #define EISA_MAX_RESOURCES 4 10 #define EISA_MAX_RESOURCES 4 12 11 13 /* A few EISA constants/offsets... */ 12 /* A few EISA constants/offsets... */ 14 13 15 #define EISA_DMA1_STATUS 8 14 #define EISA_DMA1_STATUS 8 16 #define EISA_INT1_CTRL 0x20 15 #define EISA_INT1_CTRL 0x20 17 #define EISA_INT1_MASK 0x21 16 #define EISA_INT1_MASK 0x21 18 #define EISA_INT2_CTRL 0xA0 17 #define EISA_INT2_CTRL 0xA0 19 #define EISA_INT2_MASK 0xA1 18 #define EISA_INT2_MASK 0xA1 20 #define EISA_DMA2_STATUS 0xD0 19 #define EISA_DMA2_STATUS 0xD0 21 #define EISA_DMA2_WRITE_SINGLE 0xD4 20 #define EISA_DMA2_WRITE_SINGLE 0xD4 22 #define EISA_EXT_NMI_RESET_CTRL 0x461 21 #define EISA_EXT_NMI_RESET_CTRL 0x461 23 #define EISA_INT1_EDGE_LEVEL 0x4D0 22 #define EISA_INT1_EDGE_LEVEL 0x4D0 24 #define EISA_INT2_EDGE_LEVEL 0x4D1 23 #define EISA_INT2_EDGE_LEVEL 0x4D1 25 #define EISA_VENDOR_ID_OFFSET 0xC80 24 #define EISA_VENDOR_ID_OFFSET 0xC80 26 #define EISA_CONFIG_OFFSET 0xC84 25 #define EISA_CONFIG_OFFSET 0xC84 27 26 28 #define EISA_CONFIG_ENABLED 1 27 #define EISA_CONFIG_ENABLED 1 29 #define EISA_CONFIG_FORCED 2 28 #define EISA_CONFIG_FORCED 2 30 29 31 /* There is not much we can say about an EISA 30 /* There is not much we can say about an EISA device, apart from 32 * signature, slot number, and base address. d 31 * signature, slot number, and base address. dma_mask is set by 33 * default to parent device mask..*/ 32 * default to parent device mask..*/ 34 33 35 struct eisa_device { 34 struct eisa_device { 36 struct eisa_device_id id; 35 struct eisa_device_id id; 37 int slot; 36 int slot; 38 int state; 37 int state; 39 unsigned long base_addr; 38 unsigned long base_addr; 40 struct resource res[EISA_MAX_RES 39 struct resource res[EISA_MAX_RESOURCES]; 41 u64 dma_mask; 40 u64 dma_mask; 42 struct device dev; /* generic 41 struct device dev; /* generic device */ 43 #ifdef CONFIG_EISA_NAMES 42 #ifdef CONFIG_EISA_NAMES 44 char pretty_name[50]; 43 char pretty_name[50]; 45 #endif 44 #endif 46 }; 45 }; 47 46 48 #define to_eisa_device(n) container_of(n, stru 47 #define to_eisa_device(n) container_of(n, struct eisa_device, dev) 49 48 50 static inline int eisa_get_region_index (void 49 static inline int eisa_get_region_index (void *addr) 51 { 50 { 52 unsigned long x = (unsigned long) addr 51 unsigned long x = (unsigned long) addr; 53 52 54 x &= 0xc00; 53 x &= 0xc00; 55 return (x >> 12); 54 return (x >> 12); 56 } 55 } 57 56 58 struct eisa_driver { 57 struct eisa_driver { 59 const struct eisa_device_id *id_table; 58 const struct eisa_device_id *id_table; 60 struct device_driver driver; 59 struct device_driver driver; 61 }; 60 }; 62 61 63 #define to_eisa_driver(drv) container_of_const !! 62 #define to_eisa_driver(drv) container_of(drv,struct eisa_driver, driver) 64 63 65 /* These external functions are only available 64 /* These external functions are only available when EISA support is enabled. */ 66 #ifdef CONFIG_EISA 65 #ifdef CONFIG_EISA 67 66 68 extern struct bus_type eisa_bus_type; 67 extern struct bus_type eisa_bus_type; 69 int eisa_driver_register (struct eisa_driver * 68 int eisa_driver_register (struct eisa_driver *edrv); 70 void eisa_driver_unregister (struct eisa_drive 69 void eisa_driver_unregister (struct eisa_driver *edrv); 71 70 72 #else /* !CONFIG_EISA */ 71 #else /* !CONFIG_EISA */ 73 72 74 static inline int eisa_driver_register (struct 73 static inline int eisa_driver_register (struct eisa_driver *edrv) { return 0; } 75 static inline void eisa_driver_unregister (str 74 static inline void eisa_driver_unregister (struct eisa_driver *edrv) { } 76 75 77 #endif /* !CONFIG_EISA */ 76 #endif /* !CONFIG_EISA */ 78 77 79 /* Mimics pci.h... */ 78 /* Mimics pci.h... */ 80 static inline void *eisa_get_drvdata (struct e 79 static inline void *eisa_get_drvdata (struct eisa_device *edev) 81 { 80 { 82 return dev_get_drvdata(&edev->dev); 81 return dev_get_drvdata(&edev->dev); 83 } 82 } 84 83 85 static inline void eisa_set_drvdata (struct ei 84 static inline void eisa_set_drvdata (struct eisa_device *edev, void *data) 86 { 85 { 87 dev_set_drvdata(&edev->dev, data); 86 dev_set_drvdata(&edev->dev, data); 88 } 87 } 89 88 90 /* The EISA root device. There's rumours about 89 /* The EISA root device. There's rumours about machines with multiple 91 * busses (PA-RISC ?), so we try to handle tha 90 * busses (PA-RISC ?), so we try to handle that. */ 92 91 93 struct eisa_root_device { 92 struct eisa_root_device { 94 struct device *dev; /* Pointer to 93 struct device *dev; /* Pointer to bridge device */ 95 struct resource *res; 94 struct resource *res; 96 unsigned long bus_base_addr; 95 unsigned long bus_base_addr; 97 int slots; /* Max slot n 96 int slots; /* Max slot number */ 98 int force_probe; /* Probe 97 int force_probe; /* Probe even when no slot 0 */ 99 u64 dma_mask; /* from bri 98 u64 dma_mask; /* from bridge device */ 100 int bus_nr; /* Set by eis 99 int bus_nr; /* Set by eisa_root_register */ 101 struct resource eisa_root_res; /* dit 100 struct resource eisa_root_res; /* ditto */ 102 }; 101 }; 103 102 104 int eisa_root_register (struct eisa_root_devic 103 int eisa_root_register (struct eisa_root_device *root); 105 104 106 #ifdef CONFIG_EISA 105 #ifdef CONFIG_EISA 107 extern int EISA_bus; 106 extern int EISA_bus; 108 #else 107 #else 109 # define EISA_bus 0 108 # define EISA_bus 0 110 #endif 109 #endif 111 110 112 #endif 111 #endif 113 112
Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.