source: rtems-docs/bsp_howto/ide_controller.rst @ 548f844

4.115
Last change on this file since 548f844 was b350509, checked in by Amar Takhar <amar@…>, on 01/17/16 at 05:47:50

Split document into seperate files by section.

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