This is an old revision of the document!


Board support framework

In the past, there's been a confusion, or merging, of support for the SoC and for the board. This resulted from the developers making for a single board. While this worked for the initial development, it acts as a barrier to entry for additional boards for the same SoC.

The AT91 subport has move too using the proposed solution. In this table, we're porting to board foo.

File Name Change Contents
arm/at91/kb920x_machdep.c Rename to at91_machdep.c Contains arminit(), support routines and variables, as well as new at91_ramsize() (more generally, any common routines needed by the board routines
arm/conf/FOO New Sample config file for a foo board. This lists the devices that are on the board, as well as the optional parts of FreeBSD that are used by the author of this config file for their application. Constants that are the same for all versions of the foo board aren't listed here.
arm/at91/std.foo New Lists all the constants needed for the board. Also brings the board into the build with the line 'device at91_board_foo'. As of this writing, only one board is compiled at a time.
arm/at91/files.at91 Change Add a line mapping at91_board_foo into the system. 'arm/at91/board_foo.c optional at91_board_foo' is the typical way.
arm/at91/board_foo.c New Contains the board_init() routine for this board. This routine is responsible for tweaking the enabled devices/GPIO pints for this board. Typically, the boot loader will configure these, but often times it is necessary to do that here when the boot loader doesn't. It is rare that NO tweaks will be needed at all. In addition to tweaking the configured devices, this routine would be responsible for communicating things like the MAC address, if the SD connector has all 4 wires, what the GPIO lines are for this or that function to the common SoC init code.
arm/at91/at91boards.h New Contains a list of common routines defined in at91_machdep.c that board init routines can use, as well as a list of functions that a board must implement. Currently, it is only board_init() that must be defined by the board routines.
#$FreeBSD: head/sys/arm/at91/std.foo 185307 2008-11-25 19:05:46Z imp $

include "../at91/std.at91"

options         STARTUP_PAGETABLE_ADDR=0x20800000
makeoptions     KERNPHYSADDR=0x20000000
options         KERNPHYSADDR=0x20000000
makeoptions     KERNVIRTADDR=0xc0000000
options         KERNVIRTADDR=0xc0000000

device          at91_board_foo
long board_init(void)
{
        /* Boot loader configures everything we need */
        return (at91_ramsize());
}

In the future, I'd like to modify at91boards.h such that it can build one board, or support for multiple boards. There's a boot-loader supplied thing that will allow the early boot code to select the right one.

In the future, I'd like there to be more sharing between the arminit routines.

I'm also thinking that we need to have each board provide its own init routine that drives the configuration process:

long board_init(void)
{
        /* Setup data structures for SoC code to do its thing */
        at91rm9200_soc_init(<params>);
        /* Tweak the peripheral lines, etc */
}
  • freebsdarmboards.1227655220.txt.gz
  • Last modified: 2008/11/25 23:20
  • by GavinAtkinson