summaryrefslogtreecommitdiffstats
path: root/Documentation/eisa.txt
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@s-opensource.com>2017-05-14 12:27:55 -0400
committerJonathan Corbet <corbet@lwn.net>2017-07-14 15:51:34 -0400
commit72fd15c01554694bd8d69652cc9bb77c2cda193b (patch)
tree57ed33c2247bd755b082131d02cf661bbcc9b540 /Documentation/eisa.txt
parentef16bcc7f72d5084f2da551c1d88374c014f76a0 (diff)
eisa.txt: standardize document format
Each text file under Documentation follows a different format. Some doesn't even have titles! Change its representation to follow the adopted standard, using ReST markups for it to be parseable by Sphinx: - use ReST notation for titles; - identify literal blocks; - use :Author: for document authorship; - use the proper notation for tables; - adjust whitespaces where needed. Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com> Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Diffstat (limited to 'Documentation/eisa.txt')
-rw-r--r--Documentation/eisa.txt273
1 files changed, 150 insertions, 123 deletions
diff --git a/Documentation/eisa.txt b/Documentation/eisa.txt
index a55e4910924e..2806e5544e43 100644
--- a/Documentation/eisa.txt
+++ b/Documentation/eisa.txt
@@ -1,4 +1,8 @@
1EISA bus support (Marc Zyngier <maz@wild-wind.fr.eu.org>) 1================
2EISA bus support
3================
4
5:Author: Marc Zyngier <maz@wild-wind.fr.eu.org>
2 6
3This document groups random notes about porting EISA drivers to the 7This document groups random notes about porting EISA drivers to the
4new EISA/sysfs API. 8new EISA/sysfs API.
@@ -14,168 +18,189 @@ detection code is generally also used to probe ISA cards). Moreover,
14most EISA drivers are among the oldest Linux drivers so, as you can 18most EISA drivers are among the oldest Linux drivers so, as you can
15imagine, some dust has settled here over the years. 19imagine, some dust has settled here over the years.
16 20
17The EISA infrastructure is made up of three parts : 21The EISA infrastructure is made up of three parts:
18 22
19 - The bus code implements most of the generic code. It is shared 23 - The bus code implements most of the generic code. It is shared
20 among all the architectures that the EISA code runs on. It 24 among all the architectures that the EISA code runs on. It
21 implements bus probing (detecting EISA cards available on the bus), 25 implements bus probing (detecting EISA cards available on the bus),
22 allocates I/O resources, allows fancy naming through sysfs, and 26 allocates I/O resources, allows fancy naming through sysfs, and
23 offers interfaces for driver to register. 27 offers interfaces for driver to register.
24 28
25 - The bus root driver implements the glue between the bus hardware 29 - The bus root driver implements the glue between the bus hardware
26 and the generic bus code. It is responsible for discovering the 30 and the generic bus code. It is responsible for discovering the
27 device implementing the bus, and setting it up to be latter probed 31 device implementing the bus, and setting it up to be latter probed
28 by the bus code. This can go from something as simple as reserving 32 by the bus code. This can go from something as simple as reserving
29 an I/O region on x86, to the rather more complex, like the hppa 33 an I/O region on x86, to the rather more complex, like the hppa
30 EISA code. This is the part to implement in order to have EISA 34 EISA code. This is the part to implement in order to have EISA
31 running on an "new" platform. 35 running on an "new" platform.
32 36
33 - The driver offers the bus a list of devices that it manages, and 37 - The driver offers the bus a list of devices that it manages, and
34 implements the necessary callbacks to probe and release devices 38 implements the necessary callbacks to probe and release devices
35 whenever told to. 39 whenever told to.
36 40
37Every function/structure below lives in <linux/eisa.h>, which depends 41Every function/structure below lives in <linux/eisa.h>, which depends
38heavily on <linux/device.h>. 42heavily on <linux/device.h>.
39 43
40** Bus root driver : 44Bus root driver
45===============
46
47::
41 48
42int eisa_root_register (struct eisa_root_device *root); 49 int eisa_root_register (struct eisa_root_device *root);
43 50
44The eisa_root_register function is used to declare a device as the 51The eisa_root_register function is used to declare a device as the
45root of an EISA bus. The eisa_root_device structure holds a reference 52root of an EISA bus. The eisa_root_device structure holds a reference
46to this device, as well as some parameters for probing purposes. 53to this device, as well as some parameters for probing purposes::
47 54
48struct eisa_root_device { 55 struct eisa_root_device {
49 struct device *dev; /* Pointer to bridge device */ 56 struct device *dev; /* Pointer to bridge device */
50 struct resource *res; 57 struct resource *res;
51 unsigned long bus_base_addr; 58 unsigned long bus_base_addr;
52 int slots; /* Max slot number */ 59 int slots; /* Max slot number */
53 int force_probe; /* Probe even when no slot 0 */ 60 int force_probe; /* Probe even when no slot 0 */
54 u64 dma_mask; /* from bridge device */ 61 u64 dma_mask; /* from bridge device */
55 int bus_nr; /* Set by eisa_root_register */ 62 int bus_nr; /* Set by eisa_root_register */
56 struct resource eisa_root_res; /* ditto */ 63 struct resource eisa_root_res; /* ditto */
57}; 64 };
58 65
59node : used for eisa_root_register internal purpose 66============= ======================================================
60dev : pointer to the root device 67node used for eisa_root_register internal purpose
61res : root device I/O resource 68dev pointer to the root device
62bus_base_addr : slot 0 address on this bus 69res root device I/O resource
63slots : max slot number to probe 70bus_base_addr slot 0 address on this bus
64force_probe : Probe even when slot 0 is empty (no EISA mainboard) 71slots max slot number to probe
65dma_mask : Default DMA mask. Usually the bridge device dma_mask. 72force_probe Probe even when slot 0 is empty (no EISA mainboard)
66bus_nr : unique bus id, set by eisa_root_register 73dma_mask Default DMA mask. Usually the bridge device dma_mask.
67 74bus_nr unique bus id, set by eisa_root_register
68** Driver : 75============= ======================================================
69 76
70int eisa_driver_register (struct eisa_driver *edrv); 77Driver
71void eisa_driver_unregister (struct eisa_driver *edrv); 78======
79
80::
81
82 int eisa_driver_register (struct eisa_driver *edrv);
83 void eisa_driver_unregister (struct eisa_driver *edrv);
72 84
73Clear enough ? 85Clear enough ?
74 86
75struct eisa_device_id { 87::
76 char sig[EISA_SIG_LEN]; 88
77 unsigned long driver_data; 89 struct eisa_device_id {
78}; 90 char sig[EISA_SIG_LEN];
79 91 unsigned long driver_data;
80struct eisa_driver { 92 };
81 const struct eisa_device_id *id_table; 93
82 struct device_driver driver; 94 struct eisa_driver {
83}; 95 const struct eisa_device_id *id_table;
84 96 struct device_driver driver;
85id_table : an array of NULL terminated EISA id strings, 97 };
86 followed by an empty string. Each string can 98
87 optionally be paired with a driver-dependent value 99=============== ====================================================
88 (driver_data). 100id_table an array of NULL terminated EISA id strings,
89 101 followed by an empty string. Each string can
90driver : a generic driver, such as described in 102 optionally be paired with a driver-dependent value
91 Documentation/driver-model/driver.txt. Only .name, 103 (driver_data).
92 .probe and .remove members are mandatory. 104
93 105driver a generic driver, such as described in
94An example is the 3c59x driver : 106 Documentation/driver-model/driver.txt. Only .name,
95 107 .probe and .remove members are mandatory.
96static struct eisa_device_id vortex_eisa_ids[] = { 108=============== ====================================================
97 { "TCM5920", EISA_3C592_OFFSET }, 109
98 { "TCM5970", EISA_3C597_OFFSET }, 110An example is the 3c59x driver::
99 { "" } 111
100}; 112 static struct eisa_device_id vortex_eisa_ids[] = {
101 113 { "TCM5920", EISA_3C592_OFFSET },
102static struct eisa_driver vortex_eisa_driver = { 114 { "TCM5970", EISA_3C597_OFFSET },
103 .id_table = vortex_eisa_ids, 115 { "" }
104 .driver = { 116 };
105 .name = "3c59x", 117
106 .probe = vortex_eisa_probe, 118 static struct eisa_driver vortex_eisa_driver = {
107 .remove = vortex_eisa_remove 119 .id_table = vortex_eisa_ids,
108 } 120 .driver = {
109}; 121 .name = "3c59x",
110 122 .probe = vortex_eisa_probe,
111** Device : 123 .remove = vortex_eisa_remove
124 }
125 };
126
127Device
128======
112 129
113The sysfs framework calls .probe and .remove functions upon device 130The sysfs framework calls .probe and .remove functions upon device
114discovery and removal (note that the .remove function is only called 131discovery and removal (note that the .remove function is only called
115when driver is built as a module). 132when driver is built as a module).
116 133
117Both functions are passed a pointer to a 'struct device', which is 134Both functions are passed a pointer to a 'struct device', which is
118encapsulated in a 'struct eisa_device' described as follows : 135encapsulated in a 'struct eisa_device' described as follows::
119 136
120struct eisa_device { 137 struct eisa_device {
121 struct eisa_device_id id; 138 struct eisa_device_id id;
122 int slot; 139 int slot;
123 int state; 140 int state;
124 unsigned long base_addr; 141 unsigned long base_addr;
125 struct resource res[EISA_MAX_RESOURCES]; 142 struct resource res[EISA_MAX_RESOURCES];
126 u64 dma_mask; 143 u64 dma_mask;
127 struct device dev; /* generic device */ 144 struct device dev; /* generic device */
128}; 145 };
129 146
130id : EISA id, as read from device. id.driver_data is set from the 147======== ============================================================
131 matching driver EISA id. 148id EISA id, as read from device. id.driver_data is set from the
132slot : slot number which the device was detected on 149 matching driver EISA id.
133state : set of flags indicating the state of the device. Current 150slot slot number which the device was detected on
134 flags are EISA_CONFIG_ENABLED and EISA_CONFIG_FORCED. 151state set of flags indicating the state of the device. Current
135res : set of four 256 bytes I/O regions allocated to this device 152 flags are EISA_CONFIG_ENABLED and EISA_CONFIG_FORCED.
136dma_mask: DMA mask set from the parent device. 153res set of four 256 bytes I/O regions allocated to this device
137dev : generic device (see Documentation/driver-model/device.txt) 154dma_mask DMA mask set from the parent device.
155dev generic device (see Documentation/driver-model/device.txt)
156======== ============================================================
138 157
139You can get the 'struct eisa_device' from 'struct device' using the 158You can get the 'struct eisa_device' from 'struct device' using the
140'to_eisa_device' macro. 159'to_eisa_device' macro.
141 160
142** Misc stuff : 161Misc stuff
162==========
163
164::
143 165
144void eisa_set_drvdata (struct eisa_device *edev, void *data); 166 void eisa_set_drvdata (struct eisa_device *edev, void *data);
145 167
146Stores data into the device's driver_data area. 168Stores data into the device's driver_data area.
147 169
148void *eisa_get_drvdata (struct eisa_device *edev): 170::
171
172 void *eisa_get_drvdata (struct eisa_device *edev):
149 173
150Gets the pointer previously stored into the device's driver_data area. 174Gets the pointer previously stored into the device's driver_data area.
151 175
152int eisa_get_region_index (void *addr); 176::
177
178 int eisa_get_region_index (void *addr);
153 179
154Returns the region number (0 <= x < EISA_MAX_RESOURCES) of a given 180Returns the region number (0 <= x < EISA_MAX_RESOURCES) of a given
155address. 181address.
156 182
157** Kernel parameters : 183Kernel parameters
184=================
158 185
159eisa_bus.enable_dev : 186eisa_bus.enable_dev
187 A comma-separated list of slots to be enabled, even if the firmware
188 set the card as disabled. The driver must be able to properly
189 initialize the device in such conditions.
160 190
161A comma-separated list of slots to be enabled, even if the firmware 191eisa_bus.disable_dev
162set the card as disabled. The driver must be able to properly 192 A comma-separated list of slots to be enabled, even if the firmware
163initialize the device in such conditions. 193 set the card as enabled. The driver won't be called to handle this
194 device.
164 195
165eisa_bus.disable_dev : 196virtual_root.force_probe
197 Force the probing code to probe EISA slots even when it cannot find an
198 EISA compliant mainboard (nothing appears on slot 0). Defaults to 0
199 (don't force), and set to 1 (force probing) when either
200 CONFIG_ALPHA_JENSEN or CONFIG_EISA_VLB_PRIMING are set.
166 201
167A comma-separated list of slots to be enabled, even if the firmware 202Random notes
168set the card as enabled. The driver won't be called to handle this 203============
169device.
170
171virtual_root.force_probe :
172
173Force the probing code to probe EISA slots even when it cannot find an
174EISA compliant mainboard (nothing appears on slot 0). Defaults to 0
175(don't force), and set to 1 (force probing) when either
176CONFIG_ALPHA_JENSEN or CONFIG_EISA_VLB_PRIMING are set.
177
178** Random notes :
179 204
180Converting an EISA driver to the new API mostly involves *deleting* 205Converting an EISA driver to the new API mostly involves *deleting*
181code (since probing is now in the core EISA code). Unfortunately, most 206code (since probing is now in the core EISA code). Unfortunately, most
@@ -194,9 +219,11 @@ routine.
194For example, switching your favorite EISA SCSI card to the "hotplug" 219For example, switching your favorite EISA SCSI card to the "hotplug"
195model is "the right thing"(tm). 220model is "the right thing"(tm).
196 221
197** Thanks : 222Thanks
223======
224
225I'd like to thank the following people for their help:
198 226
199I'd like to thank the following people for their help :
200- Xavier Benigni for lending me a wonderful Alpha Jensen, 227- Xavier Benigni for lending me a wonderful Alpha Jensen,
201- James Bottomley, Jeff Garzik for getting this stuff into the kernel, 228- James Bottomley, Jeff Garzik for getting this stuff into the kernel,
202- Andries Brouwer for contributing numerous EISA ids, 229- Andries Brouwer for contributing numerous EISA ids,