source: rtems/doc/bsp_howto/ide-ctrl.t @ 51eacee9

4.104.114.84.95
Last change on this file since 51eacee9 was 51eacee9, checked in by Joel Sherrill <joel.sherrill@…>, on 10/28/02 at 13:44:39

2002-10-24 Eugeny S. Mints <Eugeny.Mints@…>

  • ata.t, ide-ctrl.t: New file.
  • .cvsignore: Added new .texi files.
  • Makefile.am:: Added new files to generate.
  • bsp_howto.texi: Added new chapters.
  • stamp-vti, version.texi: Regenerated.
  • Property mode set to 100644
File size: 5.5 KB
Line 
1@c
2@c  COPYRIGHT (c) 1988-2002.
3@c  On-Line Applications Research Corporation (OAR).
4@c  All rights reserved.
5@c
6@c  $Id$
7@c
8
9@chapter IDE Controller Driver
10
11@section Introduction
12
13The IDE Controller driver is responsible for providing an
14interface to an IDE Controller.  The capabilities provided by this
15driver are:
16
17@itemize @bullet
18@item Read IDE Controller register 
19@item Write IDE Controller register
20@item Read data block through IDE Controller Data Register
21@item Write data block through IDE Controller Data Register
22@end itemize
23
24The reference implementation for an IDE Controller driver can
25be found in @code{$RTEMS_SRC_ROOT/c/src/libchip/ide}. This driver
26is based on the libchip concept and allows to work with any of the IDE
27Controller chips simply by appropriate configuration of BSP. Drivers for a
28paticular IDE Controller chips locate in the following directories: drivers
29for well-known IDE Controller chips locate into
30@code{$RTEMS_SRC_ROOT/c/src/libchip/ide}, drivers for IDE Controller chips
31integrated with CPU locate into
32@code{$RTEMS_SRC_ROOT/c/src/lib/libcpu/myCPU} and
33drivers for custom IDE Controller chips (for example, implemented on FPGA)
34locate into @code{$RTEMS_SRC_ROOT/c/src/lib/libbsp/myBSP}.
35There is a README file in these directories for each supported
36IDE Controller chip. Each of these README explains how to configure a BSP
37for that particular IDE Controller chip.
38
39@section Initialization
40
41IDE Controller chips used by a BSP are statically confiured into
42@code{IDE_Controller_Table}. The @code{ide_controller_initialize} routine is
43responsible for initialization of all configured IDE controller chips.
44Initialization order of the chips based on the order the chips are defined in
45the @code{IDE_Controller_Table}. 
46
47The following actions are performed by the IDE Controller driver
48initialization routine:
49
50@example
51@group
52rtems_device_driver ide_controller_initialize(
53  rtems_device_major_number  major,
54  rtems_device_minor_number  minor_arg,
55  void                      *arg
56)
57@{
58   for each IDE Controller chip configured in IDE_Controller_Table
59     if (BSP dependant probe(if exists) AND device probe for this IDE chip
60        indicates it is present)
61       perform initialization of the particular chip
62       register device with configured name for this chip
63@}
64@end group
65@end example
66
67@section Read IDE Controller Register
68
69The @code{ide_controller_read_register} routine reads the content of the IDE
70Controller chip register. IDE Controller chip is selected via the minor
71number. This routine is not allowed to be called from an application.
72
73@example
74@group
75void ide_controller_read_register(rtems_device_minor_number minor,
76                                  unsigned32 reg, unsiged32 *value)
77@{
78  get IDE Controller chip configuration information from
79  IDE_Controller_Table by minor number
80
81  invoke read register routine for the chip
82@}
83@end group
84@end example
85
86@section Write IDE Controller Register
87
88The @code{ide_controller_write_register} routine writes IDE Controller chip
89register with specified value. IDE Controller chip is selected via the minor
90number. This routine is not allowed to be called from an application.
91
92@example
93@group
94void ide_controller_write_register(rtems_device_minor_number minor,
95                                   unsigned32 reg, unsiged32 value)
96@{
97  get IDE Controller chip configuration information from
98  IDE_Controller_Table by minor number
99
100  invoke write register routine for the chip
101@}
102@end group
103@end example
104
105@section Read Data Block Through IDE Controller Data Register
106
107The @code{ide_controller_read_data_block} provides multiple consequent read
108of the IDE Controller Data Register. IDE Controller chip is selected via the
109minor number. The same functionality may be achieved via separate multiple
110calls of @code{ide_controller_read_register} routine but
111@code{ide_controller_read_data_block} allows to escape functions call
112overhead. This routine is not allowed to be called from an application.
113
114@example
115@group
116void ide_controller_read_data_block(rtems_device_minor_number  minor,
117                                    unsigned16                 block_size,
118                                    blkdev_sg_buffer          *bufs,
119                                    rtems_unsigned32          *cbuf,
120                                    rtems_unsigned32          *pos)
121@{
122  get IDE Controller chip configuration information from
123  IDE_Controller_Table by minor number
124
125  invoke read data block routine for the chip 
126@}
127@end group
128@end example
129
130@section Write Data Block Through IDE Controller Data Register
131
132The @code{ide_controller_write_data_block} provides multiple consequent write
133into the IDE Controller Data Register. IDE Controller chip is selected via the
134minor number. The same functionality may be achieved via separate multiple
135calls of @code{ide_controller_write_register} routine but
136@code{ide_controller_write_data_block} allows to escape functions call
137overhead. This routine is not allowed to be called from an application.
138
139@example
140@group
141void ide_controller_write_data_block(rtems_device_minor_number  minor,
142                                     unsigned16                 block_size,
143                                     blkdev_sg_buffer          *bufs,
144                                     rtems_unsigned32          *cbuf,
145                                     rtems_unsigned32          *pos)
146@{
147  get IDE Controller chip configuration information from
148  IDE_Controller_Table by minor number
149
150  invoke write data block routine for the chip 
151@}
152@end group
153@end example
Note: See TracBrowser for help on using the repository browser.