source: rtems/cpukit/libdrvmgr/README @ 1e039fb3

5
Last change on this file since 1e039fb3 was bf2c3f8b, checked in by Daniel Hellstrom <daniel@…>, on 04/13/15 at 08:47:22

DRVMGR: updated README

  • Property mode set to 100644
File size: 3.7 KB
Line 
1DRIVER MANAGER
2==============
3
4See documentation in Cobham Gaisler Driver manual available at
5http://www.gaisler.com/anonftp/rcc/doc/.
6
7
8INITIALIZATION
9==============
10The Driver Manager can be intialized in two different ways:
11 1. during RTEMS startup
12 2. started by user, typically in the Init task
13
14The driver manager is initalized during RTEMS startup in the
15rtems_initialize_device_drivers() function when RTEMS is
16configured with driver manager support.
17
18When RTEMS is not configured with the driver manager, the manager
19may still be initialized by the user after system startup, typically
20from the Init() task.
21
22The main difference between the two ways is when interrupt
23is enabled. Interrupt is enabled for the first time by RTEMS when
24the Init task is started. This means, for the first case, that
25drivers can not use interrupt services until after the
26initialization phase is over and the user request services from
27the drivers. For the second case of initialization, this means
28that driver must take extra care during initialization when interrupt
29is enabled so that spurious interrupts are not generated and that the
30system does not hang in an infinite IRQ loop.
31
32Most of the problems above are solved for the two methods by
33specifying in which initialization levels IRQ handling is done.
34See Level 1 and Level 2 below.
35
36Other differences is that IRQ, System Clock Timer, debug Console
37and Console can be initialized by the help of the driver manager
38when initialized during start up. Between Level0 and Level1 the
39RTEMS I/O Manager drivers are initialized. The LEON3 BSP has
40therefore two different versions of the basic drivers.
41
42
43LEVEL0
44------
45The level of uninitialized devices that have been united with a
46driver.
47
48
49LEVEL1 - FIND/RESET/IRQ Clear
50-----------------------------
51The driver is for the first time informed of the presence of a
52device. Only basic initialization.
53
54- Find all hardware needed for IRQ, Console, Timer and hardware
55  that need to be reset.
56- Reset hardware, so that interrupts are not generated by mistake
57  when enabled later on.
58- Init low level non-interrupt (polling-mode) services needed by
59  drivers init LEVEL2 and onwards, such as
60   * Debug UART console for printk()
61   * Timer API (non-IRQ)
62   * GPIO (non-IRQ)
63   * Special non-main memory configuration, washing
64- Register IRQ controller at BSP IRQ library
65- Register Timer for system clock
66- Register Console UART
67
68During this intialization level interrupts may not be registered,
69enabled or disabled at the IRQ controller. But, all IRQ sources
70should be cleared to avoid spurious interrupts later on.
71
72
73AFTER LEVEL1 - if initialized during startup
74--------------------------------------------
75The statically configured drivers are initialized as normally by RTEMS. The
76hardware was found in LEVEL1.
77
78CONFIGURE_BSP_PREREQUISITE_DRIVERS may initialize IRQ driver, or
79IRQ lib initialized when IRQ controller was registered during LEVEL1.
80
81
82LEVEL2
83------
84Initialize other device drivers than IRQ, Timer, console:
85- ISR can be registered, enabled, disabled at IRQ controller
86   (IRQ is still masked by CPU interrupt level if initialized during
87   RTEMS startup)
88- Timer API that does not require IRQ can be used
89- printf() can be used
90
91For standard peripherals this is the first initialization.
92
93
94LEVEL3
95------
96Initialize drivers that require features/APIs provided by drivers
97in LEVEL2.
98
99Such features may involve services that require IRQ to be implemented.
100
101
102LEVEL4
103------
104Unused extra level.
105
106
107
108LEVEL INACTIVE - NOT ENABLED DEVICES
109------------------------------------
110List of devices that experienced:
111 - no driver found for device (not united)
112 - ignored (not united with a driver, forced by user)
113 - an error was reported by device driver during initialization
Note: See TracBrowser for help on using the repository browser.