btashton commented on a change in pull request #1677: URL: https://github.com/apache/incubator-nuttx/pull/1677#discussion_r483873686
########## File path: Documentation/guides/drivers.rst ########## @@ -0,0 +1,211 @@ +.. include:: /substitutions.rst +.. _drivers: + +Drivers +======= + +Some NuttX boards don't have full support for all the on-chip peripherals. If you need support for this hardware, +you will either need to port a driver from another chip, or write one yourself. This section discusses how to do that. + +Porting a Driver +---------------- + +Often support for on-chip peripherals exists in a closely related chip, or even a different family or from a different +manufacturer. Many chips are made up of different Intellectual Property (IP) blocks that are licensed from vendors like +Cadence, Synopsys, and others. The IP blocks may be similar enough to use another chip's driver with little +modification. + +* Find a similar driver in NuttX source code: + + * Look at register names listed in the datasheet for the peripheral. + * Search the NuttX codebase for the register names (try several different ones). + * Note that you'll have to compare the datasheet to the header and code files to see if there are differences; there + will usually be some differences between architectures, and they can be significant. + +* Find a similar driver in U-Boot source code: + + * Only for inspiration, you can't copy code because of license incompatibility. + * But you can debug to see how the driver works. + * `U-Boot <https://www.denx.de/wiki/U-Boot>`_ drivers are often easier to understand than BSD Unix drivers because + U-Boot is simpler. + +* Find a similar driver in Zephyr or BSD Unix (OpenBSD, FreeBSD, NetBSD): + + * If you find one, you can borrow code directly (Apache 2.0 and BSD licenses are compatible). Review comment: It is license compatible, for instance we could decided to include a 3rd party Apache 2.0 compression library and the resulting binary would be under Apache 2.0 but we just cannot say that code is ASF code. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected]
