Warning, /cpukit/libdrvmgr/README.md is written in an unsupported language. File is not indexed.
0001 DRIVER MANAGER
0002 ==============
0003
0004 See documentation in Cobham Gaisler Driver manual available at
0005 http://www.gaisler.com/anonftp/rcc/doc/.
0006
0007
0008 INITIALIZATION
0009 ==============
0010 The Driver Manager can be initialized in two different ways:
0011 1. during RTEMS startup
0012 2. started by user, typically in the Init task
0013
0014 The driver manager is initalized during RTEMS startup in the
0015 rtems_initialize_device_drivers() function when RTEMS is
0016 configured with driver manager support.
0017
0018 When RTEMS is not configured with the driver manager, the manager
0019 may still be initialized by the user after system startup, typically
0020 from the Init() task.
0021
0022 The main difference between the two ways is when interrupt
0023 is enabled. Interrupt is enabled for the first time by RTEMS when
0024 the Init task is started. This means, for the first case, that
0025 drivers can not use interrupt services until after the
0026 initialization phase is over and the user request services from
0027 the drivers. For the second case of initialization, this means
0028 that driver must take extra care during initialization when interrupt
0029 is enabled so that spurious interrupts are not generated and that the
0030 system does not hang in an infinite IRQ loop.
0031
0032 Most of the problems above are solved for the two methods by
0033 specifying in which initialization levels IRQ handling is done.
0034 See Level 1 and Level 2 below.
0035
0036 Other differences are that IRQ, System Clock Timer, debug Console
0037 and Console can be initialized with the help of the driver manager
0038 when initialized during start up. Between Level0 and Level1 the
0039 RTEMS I/O Manager drivers are initialized. The LEON3 BSP therefore
0040 has two different versions of the basic drivers.
0041
0042
0043 LEVEL0
0044 ------
0045 The level of uninitialized devices that have been united with a
0046 driver.
0047
0048
0049 LEVEL1 - FIND/RESET/IRQ Clear
0050 -----------------------------
0051 The driver is, for the first time, informed of the presence of a
0052 device. Only basic initialization.
0053
0054 - Find all hardware needed for IRQ, Console, Timer and hardware
0055 that need to be reset.
0056 - Reset hardware, so that interrupts are not generated by mistake
0057 when enabled later on.
0058 - Init low level non-interrupt (polling-mode) services needed by
0059 drivers init LEVEL2 and onwards, such as
0060 * Debug UART console for printk()
0061 * Timer API (non-IRQ)
0062 * GPIO (non-IRQ)
0063 * Special non-main memory configuration, washing
0064 - Register IRQ controller at BSP IRQ library
0065 - Register Timer for system clock
0066 - Register Console UART
0067
0068 During this initialization level interrupts may not be registered,
0069 enabled or disabled at the IRQ controller, but all IRQ sources
0070 should be cleared to avoid spurious interrupts later on.
0071
0072
0073 AFTER LEVEL1 - if initialized during startup
0074 --------------------------------------------
0075 The statically configured drivers are initialized as normal by RTEMS. The
0076 hardware was found in LEVEL1.
0077
0078 CONFIGURE_BSP_PREREQUISITE_DRIVERS may initialize IRQ driver, or
0079 IRQ lib initialized when IRQ controller was registered during LEVEL1.
0080
0081
0082 LEVEL2
0083 ------
0084 Initialize other device drivers than IRQ, Timer, console:
0085 - ISR can be registered, enabled, disabled at IRQ controller
0086 (IRQ is still masked by CPU interrupt level if initialized during
0087 RTEMS startup)
0088 - Timer API that does not require IRQ can be used
0089 - printf() can be used
0090
0091 For standard peripherals this is the first initialization.
0092
0093
0094 LEVEL3
0095 ------
0096 Initialize drivers that require features/APIs provided by drivers
0097 in LEVEL2.
0098
0099 Such features may involve services that require IRQ to be implemented.
0100
0101
0102 LEVEL4
0103 ------
0104 Unused extra level.
0105
0106
0107
0108 LEVEL INACTIVE - NOT ENABLED DEVICES
0109 ------------------------------------
0110 List of devices that experienced:
0111 - no driver found for device (not united)
0112 - ignored (not united with a driver, forced by user)
0113 - an error was reported by device driver during initialization