Opened on 08/15/19 at 18:41:04
Last modified on 02/03/22 at 19:30:15
#3784 assigned project
Beagle BSP: Add a flattened device tree based initialization
Reported by: | Christian Mauderer | Owned by: | Christian Mauderer |
---|---|---|---|
Priority: | normal | Milestone: | Indefinite |
Component: | bsps | Version: | |
Severity: | normal | Keywords: | SoC, BSP, small |
Cc: | Blocked By: | #3782 | |
Blocking: |
Description (last modified by Christian Mauderer)
Introduction
RTEMS currently has multiple BSPs for various Beagle Boards:
- beagleboardorig ./bsps/arm/beagle
- beagleboardxm ./bsps/arm/beagle
- beagleboneblack ./bsps/arm/beagle
- beaglebonewhite ./bsps/arm/beagle
There are a lot of hard coded values in the drivers like the used pins or the register addresses. Applications have to initialize the drivers by calling special functions like bbb_register_i2c_1(...)
.
Other operating systems like Linux or FreeBSD use a flattened device tree (FDT) for this kind of stuff. Due to the FDT they are able to support all the board variants with only a single BSP.
Target of this project would be to create a FDT based initialization for the Beagle BSPs. Depending on the result it might can be possible to eliminate some of the BSPs mentioned above.
Work Overview
RTEMS already supports FDT for other BSPs. So there is no need to add a complete FDT library. The library is also already included in Beagle for use together with libbsd.
Roughly the following steps would be necessary:
- Parse the pinmux settings from FDT and create a two part driver for a 'pinctrl-single' compatible FDT entry. One part should be generic so that it can be used for other BSPs too and one part will have to be device specific (similar to FreeBSD or Linux). This would solve #3782.
- Remove pinmux initialization from all drivers.
- Initialize drivers based on the FDT (instead of functions like bbb_register_i2c_1(...)). This means that a lot of headers with hardcoded register addresses will have to be changed.
- Taking a more detailed look at the FDT what else could be initialized from it. Candidates are clocks, RAM size, ...
- Update the documentation to show the changes.
- Care should be taken that it is possible to remove drivers in case someone wants to write a really small BSP. There are multiple approaches for that. See https://lists.rtems.org/pipermail/devel/2019-August/027288.html for a discussion about that.
- Make sure there is a reasonable error message if no or an invalid FDT is provided.
Requirements
- Minimal requirement for that project is one Beagle variant (e.g. BBB). I would suggest more if possible. There also should be a Beagleboard XM simulator that can be used as a second variant.
- Some possibility to debug the application. In this case it should be possible to use the simulator for this. But plan enough time to set it up. An alternative is a hardware debugger like a J-Link (EDU), some OpenOCD based solution like Flyswatter or another debugger solution.
- Good ability to read C code. This project will need a lot of it to adapt the drivers.
- Basic knowledge about how to use U-Boot. You'll need it for testing different FDTs.
Update 2020
Also there is still quite a bit left (Updating drivers, improving error messages, ...), a lot of work has been done on this project during GSoC 2020. Not everything has been merged yet because of other structural changes that have to take place first. If you are interested in working on that project, you have to be aware of the work from 2020:
https://gs-niteesh.github.io/finalreport/
Any new work should be based on that.
Change History (5)
comment:1 Changed on 12/27/20 at 09:08:53 by G S Niteesh Babu <niteesh.gs@…>
comment:2 Changed on 01/07/21 at 13:19:48 by Christian Mauderer
Description: | modified (diff) |
---|
comment:5 Changed on 02/03/22 at 19:30:15 by Gedare Bloom
Keywords: | small added |
---|
In 9d2ed41/rtems: