Source code directories

BSPs always include a viable startup program binary, and source code you can use if you need to build your own image with a modified or new startup program.

Typically, the directory structure for the startup code source code is as follows:


The diagrams below show the directory structures for the source code for x86 and for ARM architectures.

Figure 1. Startup source code directory structure (x86).

The x86 startup has an apic/ directory, and a bios directory for systems that have the older BIOS firmware. The startup will use either the old 8259 method for interrupt control, or the newer Advanced Programmable Interrupt Controller (APIC). The method is selected during the mkifs process, or, if more than one bootable image is available, by the bootable image you select.

Figure 2. Startup source code directory structure (ARM).

These directory trees show only the directories you should always find in the startup program source code directories. Note the following about the source code directory tree:

  • The only directory that will always be found under hardware/ is startup/.
  • The hardware/ directory will usually also include the ipl/ directory, but on systems that always use U-Boot, this directory may be absent because it isn't needed.

    Similarly, the flash/ directory will be present only if the system will use a Flash filesystem.

  • In most cases, the hardware directory also includes other subdirectories such as dev* directories for device drivers (e.g., audio, eMMC), a devnp directory for networking, and spi and i2c directories with the source code that supports these technologies.


The boards/ directory has platform-specific source code:

  • It has a subdirectory for the specific board type (e.g., imx6x/), which has the board-specific startup API source code, and subdirectories (e.g., mini-can/, sabreARD/) with even more specific source API files to support specific board variants, and specific technologies.
  • The build/ file is in one of these directories (e.g., src/hardware/boards/imx6x/sabreARD/build).

The lib/ directory has the generic (common to all platforms) startup API source files, and:

  • an architecture-specific subdirectory (e.g., arm/, x86/) with the startup API source specific to the current board architecture.
  • a public/ subdirectory, with header files.