~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/include/linux/tc.h

Version: ~ [ linux-6.11-rc3 ] ~ [ linux-6.10.4 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.45 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.104 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.164 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.223 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.281 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.319 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /*
  2  *      Interface to the TURBOchannel related routines.
  3  *
  4  *      Copyright (c) 1998  Harald Koerfgen
  5  *      Copyright (c) 2005  James Simmons
  6  *      Copyright (c) 2006  Maciej W. Rozycki
  7  *
  8  *      Based on:
  9  *
 10  *      "TURBOchannel Firmware Specification", EK-TCAAD-FS-004
 11  *
 12  *      from Digital Equipment Corporation.
 13  *
 14  *      This file is subject to the terms and conditions of the GNU
 15  *      General Public License.  See the file "COPYING" in the main
 16  *      directory of this archive for more details.
 17  */
 18 #ifndef _LINUX_TC_H
 19 #define _LINUX_TC_H
 20 
 21 #include <linux/compiler.h>
 22 #include <linux/device.h>
 23 #include <linux/ioport.h>
 24 #include <linux/types.h>
 25 
 26 /*
 27  * Offsets for the ROM header locations for TURBOchannel cards.
 28  */
 29 #define TC_OLDCARD      0x3c0000
 30 #define TC_NEWCARD      0x000000
 31 
 32 #define TC_ROM_WIDTH    0x3e0
 33 #define TC_ROM_STRIDE   0x3e4
 34 #define TC_ROM_SIZE     0x3e8
 35 #define TC_SLOT_SIZE    0x3ec
 36 #define TC_PATTERN0     0x3f0
 37 #define TC_PATTERN1     0x3f4
 38 #define TC_PATTERN2     0x3f8
 39 #define TC_PATTERN3     0x3fc
 40 #define TC_FIRM_VER     0x400
 41 #define TC_VENDOR       0x420
 42 #define TC_MODULE       0x440
 43 #define TC_FIRM_TYPE    0x460
 44 #define TC_FLAGS        0x470
 45 #define TC_ROM_OBJECTS  0x480
 46 
 47 /*
 48  * Information obtained through the get_tcinfo() PROM call.
 49  */
 50 struct tcinfo {
 51         s32             revision;       /* Hardware revision level. */
 52         s32             clk_period;     /* Clock period in nanoseconds. */
 53         s32             slot_size;      /* Slot size in megabytes. */
 54         s32             io_timeout;     /* I/O timeout in cycles. */
 55         s32             dma_range;      /* DMA address range in megabytes. */
 56         s32             max_dma_burst;  /* Maximum DMA burst length. */
 57         s32             parity;         /* System module supports TC parity. */
 58         s32             reserved[4];
 59 };
 60 
 61 /*
 62  * TURBOchannel bus.
 63  */
 64 struct tc_bus {
 65         struct list_head devices;       /* List of devices on this bus. */
 66         struct resource resource[2];    /* Address space routed to this bus. */
 67 
 68         struct device   dev;
 69         char            name[13];
 70         resource_size_t slot_base;
 71         resource_size_t ext_slot_base;
 72         resource_size_t ext_slot_size;
 73         int             num_tcslots;
 74         struct tcinfo   info;
 75 };
 76 
 77 /*
 78  * TURBOchannel device.
 79  */
 80 struct tc_dev {
 81         struct list_head node;          /* Node in list of all TC devices. */
 82         struct tc_bus   *bus;           /* Bus this device is on. */
 83         struct tc_driver *driver;       /* Which driver has allocated this
 84                                            device. */
 85         struct device   dev;            /* Generic device interface. */
 86         struct resource resource;       /* Address space of this device. */
 87         u64             dma_mask;       /* DMA addressable range. */
 88         char            vendor[9];
 89         char            name[9];
 90         char            firmware[9];
 91         int             interrupt;
 92         int             slot;
 93 };
 94 
 95 #define to_tc_dev(n) container_of(n, struct tc_dev, dev)
 96 
 97 struct tc_device_id {
 98         char            vendor[9];
 99         char            name[9];
100 };
101 
102 /*
103  * TURBOchannel driver.
104  */
105 struct tc_driver {
106         struct list_head node;
107         const struct tc_device_id *id_table;
108         struct device_driver driver;
109 };
110 
111 #define to_tc_driver(drv) container_of_const(drv, struct tc_driver, driver)
112 
113 /*
114  * Return TURBOchannel clock frequency in Hz.
115  */
116 static inline unsigned long tc_get_speed(struct tc_bus *tbus)
117 {
118         return 100000 * (10000 / (unsigned long)tbus->info.clk_period);
119 }
120 
121 #ifdef CONFIG_TC
122 
123 extern const struct bus_type tc_bus_type;
124 
125 extern int tc_register_driver(struct tc_driver *tdrv);
126 extern void tc_unregister_driver(struct tc_driver *tdrv);
127 
128 #else /* !CONFIG_TC */
129 
130 static inline int tc_register_driver(struct tc_driver *tdrv) { return 0; }
131 static inline void tc_unregister_driver(struct tc_driver *tdrv) { }
132 
133 #endif /* CONFIG_TC */
134 
135 /*
136  * These have to be provided by the architecture.
137  */
138 extern int tc_preadb(u8 *valp, void __iomem *addr);
139 extern int tc_bus_get_info(struct tc_bus *tbus);
140 extern void tc_device_get_irq(struct tc_dev *tdev);
141 
142 #endif /* _LINUX_TC_H */
143 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php