|
| 1 | +# Device Driver Model (DM) Documentation Index |
| 2 | + |
| 3 | +This directory contains comprehensive documentation for RT-Thread's Device Driver Model and related subsystems. |
| 4 | + |
| 5 | +## Core Documentation |
| 6 | + |
| 7 | +- **[README.md](README.md)** - Device Driver Model Overview (English) |
| 8 | + - DM architecture and concepts |
| 9 | + - Bus, driver, and platform device models |
| 10 | + - OFW/Device Tree integration |
| 11 | + - Common APIs and usage patterns |
| 12 | + - Migration guide |
| 13 | + |
| 14 | +- **[README_zh.md](README_zh.md)** - 设备驱动模型概述 (中文) |
| 15 | + - DM 架构和概念 |
| 16 | + - 总线、驱动和平台设备模型 |
| 17 | + - OFW/设备树集成 |
| 18 | + - 通用 API 和使用模式 |
| 19 | + - 迁移指南 |
| 20 | + |
| 21 | +## Module-Specific Documentation |
| 22 | + |
| 23 | +### Power Management |
| 24 | + |
| 25 | +#### Regulator Framework |
| 26 | +- **[regulator/README.md](regulator/README.md)** - Voltage/Current Regulator (English) |
| 27 | +- **[regulator/README_zh.md](regulator/README_zh.md)** - 电压/电流调节器 (中文) |
| 28 | + |
| 29 | +**Status**: ✅ Complete |
| 30 | +**Topics Covered**: |
| 31 | +- Consumer API with complete examples |
| 32 | +- Provider (driver) implementation guide |
| 33 | +- Device tree bindings (fixed, GPIO, SCMI) |
| 34 | +- Best practices and troubleshooting |
| 35 | +- Performance considerations |
| 36 | + |
| 37 | +#### Clock Framework |
| 38 | +- **clk/** - Clock Management Framework |
| 39 | + |
| 40 | +**Status**: 📝 To Be Documented |
| 41 | +**Planned Topics**: |
| 42 | +- Clock consumer API |
| 43 | +- Clock provider implementation |
| 44 | +- Clock tree management |
| 45 | +- Fixed-rate, PLL, mux, divider clocks |
| 46 | +- Device tree bindings |
| 47 | + |
| 48 | +#### Pin Control |
| 49 | +- **pinctrl/** - Pin Multiplexing and Configuration |
| 50 | + |
| 51 | +**Status**: 📝 To Be Documented |
| 52 | +**Planned Topics**: |
| 53 | +- Pin configuration API |
| 54 | +- Pin multiplexing |
| 55 | +- Pin control driver implementation |
| 56 | +- Device tree bindings |
| 57 | + |
| 58 | +#### Reset Controller |
| 59 | +- **reset/** - Reset Controller Framework |
| 60 | + |
| 61 | +**Status**: 📝 To Be Documented |
| 62 | +**Planned Topics**: |
| 63 | +- Reset consumer API |
| 64 | +- Reset provider implementation |
| 65 | +- Device tree bindings |
| 66 | + |
| 67 | +#### Power Domain |
| 68 | +- **pmdomain/** - Power Domain Management |
| 69 | + |
| 70 | +**Status**: 📝 To Be Documented |
| 71 | +**Planned Topics**: |
| 72 | +- Power domain consumer API |
| 73 | +- Power domain provider implementation |
| 74 | +- Domain hierarchy |
| 75 | +- Device tree bindings |
| 76 | + |
| 77 | +### Interrupt and Timing |
| 78 | + |
| 79 | +#### Platform Interrupt Controller |
| 80 | +- **pic/** - Platform Interrupt Controller |
| 81 | + |
| 82 | +**Status**: 📝 To Be Documented |
| 83 | +**Planned Topics**: |
| 84 | +- IRQ domain management |
| 85 | +- IRQ mapping |
| 86 | +- PIC driver implementation |
| 87 | + |
| 88 | +#### Hardware Timer |
| 89 | +- **hwtimer/** - Hardware Timer Framework (with DM support) |
| 90 | + |
| 91 | +**Status**: 📝 To Be Documented |
| 92 | +**Planned Topics**: |
| 93 | +- Timer API with DM |
| 94 | +- Timer driver implementation |
| 95 | +- Device tree bindings |
| 96 | + |
| 97 | +### Storage and Memory |
| 98 | + |
| 99 | +#### NVMEM |
| 100 | +- **nvmem/** - Non-Volatile Memory Framework |
| 101 | + |
| 102 | +**Status**: 📝 To Be Documented |
| 103 | +**Planned Topics**: |
| 104 | +- NVMEM consumer API |
| 105 | +- NVMEM provider implementation |
| 106 | +- EEPROM, OTP, eFuse support |
| 107 | +- Device tree bindings |
| 108 | + |
| 109 | +#### Block Devices |
| 110 | +- **block/** - Block Device Layer (with DM support) |
| 111 | + |
| 112 | +**Status**: 📝 To Be Documented |
| 113 | +**Planned Topics**: |
| 114 | +- Block device API with DM |
| 115 | +- Partition support |
| 116 | +- Device tree bindings |
| 117 | + |
| 118 | +#### MTD |
| 119 | +- **mtd/** - Memory Technology Device (with DM support) |
| 120 | + |
| 121 | +**Status**: 📝 To Be Documented |
| 122 | +**Planned Topics**: |
| 123 | +- MTD framework with DM |
| 124 | +- NOR/NAND flash support |
| 125 | +- Device tree bindings |
| 126 | + |
| 127 | +### Communication |
| 128 | + |
| 129 | +#### Mailbox |
| 130 | +- **mailbox/** - Mailbox/Doorbell Framework |
| 131 | + |
| 132 | +**Status**: 📝 To Be Documented |
| 133 | +**Planned Topics**: |
| 134 | +- Mailbox consumer API |
| 135 | +- Mailbox controller driver |
| 136 | +- Inter-processor communication |
| 137 | +- Device tree bindings |
| 138 | + |
| 139 | +#### DMA |
| 140 | +- **dma/** - DMA Engine Framework |
| 141 | + |
| 142 | +**Status**: 📝 To Be Documented |
| 143 | +**Planned Topics**: |
| 144 | +- DMA consumer API |
| 145 | +- DMA controller driver |
| 146 | +- DMA transfer types |
| 147 | +- Device tree bindings |
| 148 | + |
| 149 | +### Bus Controllers |
| 150 | + |
| 151 | +#### PCI |
| 152 | +- **pci/** - PCI Bus Support |
| 153 | + |
| 154 | +**Status**: 📝 To Be Documented |
| 155 | +**Planned Topics**: |
| 156 | +- PCI device enumeration |
| 157 | +- PCI driver implementation |
| 158 | +- PCIe host controller |
| 159 | +- Device tree bindings |
| 160 | + |
| 161 | +#### I2C (DM Extensions) |
| 162 | +- **i2c/** - I2C with DM Support |
| 163 | + |
| 164 | +**Status**: 📝 To Be Documented |
| 165 | +**Planned Topics**: |
| 166 | +- I2C with device tree |
| 167 | +- I2C controller driver with DM |
| 168 | + |
| 169 | +#### SPI (DM Extensions) |
| 170 | +- **spi/** - SPI with DM Support |
| 171 | + |
| 172 | +**Status**: 📝 To Be Documented |
| 173 | +**Planned Topics**: |
| 174 | +- SPI with device tree |
| 175 | +- SPI controller driver with DM |
| 176 | + |
| 177 | +### Specialized Hardware |
| 178 | + |
| 179 | +#### Thermal Management |
| 180 | +- **thermal/** - Thermal Management Framework |
| 181 | + |
| 182 | +**Status**: 📝 To Be Documented |
| 183 | +**Planned Topics**: |
| 184 | +- Thermal zone management |
| 185 | +- Thermal cooling devices |
| 186 | +- Trip points |
| 187 | +- Device tree bindings |
| 188 | + |
| 189 | +#### Multi-Function Device |
| 190 | +- **mfd/** - Multi-Function Device Framework |
| 191 | + |
| 192 | +**Status**: 📝 To Be Documented |
| 193 | +**Planned Topics**: |
| 194 | +- MFD parent device |
| 195 | +- Sub-device registration |
| 196 | +- Shared resources |
| 197 | +- Device tree bindings |
| 198 | + |
| 199 | +#### Industrial I/O |
| 200 | +- **iio/** - Industrial I/O Subsystem |
| 201 | + |
| 202 | +**Status**: 📝 To Be Documented |
| 203 | +**Planned Topics**: |
| 204 | +- IIO device framework |
| 205 | +- Channels and attributes |
| 206 | +- Buffered data capture |
| 207 | +- Device tree bindings |
| 208 | + |
| 209 | +#### PHY Framework |
| 210 | +- **phy/** - Physical Layer Framework |
| 211 | + |
| 212 | +**Status**: 📝 To Be Documented |
| 213 | +**Planned Topics**: |
| 214 | +- PHY consumer API |
| 215 | +- PHY provider implementation |
| 216 | +- USB, PCIe, SATA PHY support |
| 217 | +- Device tree bindings |
| 218 | + |
| 219 | +#### Ethernet PHY |
| 220 | +- **phye/** - Ethernet PHY Framework |
| 221 | + |
| 222 | +**Status**: 📝 To Be Documented |
| 223 | +**Planned Topics**: |
| 224 | +- Ethernet PHY management |
| 225 | +- MDIO bus |
| 226 | +- PHY drivers |
| 227 | +- Device tree bindings |
| 228 | + |
| 229 | +### System Support |
| 230 | + |
| 231 | +#### Open Firmware (OFW) |
| 232 | +- **ofw/** - Device Tree Support |
| 233 | + |
| 234 | +**Status**: ⚠️ Partially Documented |
| 235 | +**Existing**: [../ofw/dtc.md](../ofw/dtc.md) |
| 236 | +**Additional Planned Topics**: |
| 237 | +- FDT parsing internals |
| 238 | +- OFW API reference |
| 239 | +- Property reading helpers |
| 240 | +- IRQ and address translation |
| 241 | + |
| 242 | +#### Firmware |
| 243 | +- **firmware/** - Firmware Framework |
| 244 | + |
| 245 | +**Status**: 📝 To Be Documented |
| 246 | +**Planned Topics**: |
| 247 | +- ARM SCMI support |
| 248 | +- Firmware loading |
| 249 | +- Device tree bindings |
| 250 | + |
| 251 | +#### Hardware Cache |
| 252 | +- **hwcache/** - Hardware Cache Management |
| 253 | + |
| 254 | +**Status**: 📝 To Be Documented |
| 255 | +**Planned Topics**: |
| 256 | +- Cache controller framework |
| 257 | +- L2/L3 cache management |
| 258 | + |
| 259 | +#### Hardware Spinlock |
| 260 | +- **hwspinlock/** - Hardware Spinlock |
| 261 | + |
| 262 | +**Status**: 📝 To Be Documented |
| 263 | +**Planned Topics**: |
| 264 | +- Hardware spinlock API |
| 265 | +- Multi-core synchronization |
| 266 | + |
| 267 | +## Documentation Standards |
| 268 | + |
| 269 | +All module documentation should include: |
| 270 | + |
| 271 | +1. **Introduction** |
| 272 | + - General concept overview |
| 273 | + - RT-Thread specific implementation |
| 274 | + - Use cases |
| 275 | + |
| 276 | +2. **Kconfig Configuration** |
| 277 | + - All configuration options |
| 278 | + - Menuconfig location |
| 279 | + - Dependencies |
| 280 | + |
| 281 | +3. **Device Tree Bindings** |
| 282 | + - Standard properties |
| 283 | + - Example DTS nodes |
| 284 | + - Consumer usage examples |
| 285 | + |
| 286 | +4. **Application Layer API** |
| 287 | + - Complete function reference |
| 288 | + - Parameter descriptions |
| 289 | + - Return values |
| 290 | + - Usage examples |
| 291 | + |
| 292 | +5. **Driver Implementation Guide** |
| 293 | + - Key structures |
| 294 | + - Operations to implement |
| 295 | + - Complete driver examples |
| 296 | + - Best practices |
| 297 | + |
| 298 | +6. **Comprehensive Examples** |
| 299 | + - Real-world use cases |
| 300 | + - Complete working code |
| 301 | + - Error handling patterns |
| 302 | + |
| 303 | +7. **Troubleshooting** |
| 304 | + - Common issues |
| 305 | + - Debugging tips |
| 306 | + - Performance considerations |
| 307 | + |
| 308 | +8. **Architecture Diagrams** (SVG) |
| 309 | + - Component relationships |
| 310 | + - Data flow |
| 311 | + - Clear and professional formatting |
| 312 | + |
| 313 | +## Contributing |
| 314 | + |
| 315 | +When adding new module documentation: |
| 316 | + |
| 317 | +1. Follow the structure established by the regulator documentation |
| 318 | +2. Include both English and Chinese versions |
| 319 | +3. Provide complete, tested code examples |
| 320 | +4. Create clear SVG diagrams |
| 321 | +5. Cross-reference related modules |
| 322 | +6. Update this INDEX.md file |
| 323 | + |
| 324 | +## Status Legend |
| 325 | + |
| 326 | +- ✅ Complete - Full documentation available |
| 327 | +- ⚠️ Partial - Some documentation exists, needs completion |
| 328 | +- 📝 To Be Documented - Planned but not yet created |
| 329 | +- 🚧 In Progress - Currently being written |
| 330 | + |
| 331 | +## Priority Modules |
| 332 | + |
| 333 | +Based on usage frequency and importance: |
| 334 | + |
| 335 | +1. ✅ **regulator** - Complete |
| 336 | +2. **clk** - High priority (power management) |
| 337 | +3. **pinctrl** - High priority (hardware configuration) |
| 338 | +4. **reset** - High priority (hardware control) |
| 339 | +5. **ofw** - High priority (device tree) |
| 340 | +6. **pic** - Medium priority (interrupt handling) |
| 341 | +7. **dma** - Medium priority (data transfer) |
| 342 | +8. **nvmem** - Medium priority (persistent data) |
| 343 | +9. **mailbox** - Medium priority (IPC) |
| 344 | +10. **thermal** - Medium priority (power management) |
| 345 | + |
| 346 | +Other modules follow based on community needs and hardware support requirements. |
| 347 | + |
| 348 | +## Related Documentation |
| 349 | + |
| 350 | +- [Device Driver Framework](../framework/device.md) - Basic device model |
| 351 | +- [Device Tree Compiler](../ofw/dtc.md) - DTC tool usage |
| 352 | +- [I2C Driver](../i2c/i2c.md) - Traditional I2C (compare with DM) |
| 353 | +- [SPI Driver](../spi/spi.md) - Traditional SPI (compare with DM) |
| 354 | +- [PIN Driver](../pin/pin.md) - Traditional PIN (compare with DM) |
| 355 | + |
| 356 | +## External References |
| 357 | + |
| 358 | +- [Device Tree Specification](https://devicetree-specification.readthedocs.io/) |
| 359 | +- [Linux Kernel Driver Model](https://www.kernel.org/doc/html/latest/driver-api/driver-model/) |
| 360 | +- [Linux Device Tree Bindings](https://www.kernel.org/doc/Documentation/devicetree/bindings/) |
| 361 | +- RT-Thread Source: `components/drivers/` |
0 commit comments