FreeBSD, Electronics and more
On the last part we left with our kernel panic-ing because it was unable to find a timer source.
Since then a lot have change in the FreeBSD source tree. The last big update on allwinner files (Revision 295464), introduce a lots of changes.
First, it switches most of the Allwinner boards that we support to use the GNU DTS file from Linux 4.5-rc1 (See commit 295436), previously some custom made DTS were used (and still are for the Cubieboard and BananaPi). Using the GNU DTS files have one big advantage: when a new board is out, most of the time a DTS is made along a commited to Linux, If we support the SoC on the board we don't have anything else to do to support the board (at least on a basic level).
But to support thoses files we need to update our drivers probe method. When the kernel boot and if it have a dtb provided, it will call each driver probe method for each node to find the correct driver to attach to it. The driver probe method will simply compare the compatible string property of the node to see if it is something that it supports.
Since we used some custom DTS before, the compatible string was also custom so we have to change that, nothing really hard. I also convert the custom DTS to use the same compatible string to be the same as the GNU ones.
Some drivers requires other driver to already be attached, almost all on chip peripheral need to enable a clock or to have interrupts working so the order of device probe/attach is important. The FreeBSD kernel will make multiple pass on each driver and you can set your driver to be probed/attached at a certain pass, so I've changed some of the drivers to use EARLY_DRIVER_MODULE macros and the correct pass. This wasn't needed with our custom DTS because the node are sorted so everything is good while in the GNU ones the nodes are sorted by peripheral addresses.
One other change is that now the A20 use the ARM Generic Timer and not the custom Allwinner one.
There is still a lot of changes comming that are currently in review :
Also Jared McNeill is currently porting his DMA controller driver and codec driver from NetBSD to FreeBSD.