Skip to content

Refactor board configurations #1

@danngreen

Description

@danngreen

Goal:

  1. Allow selection of board with build system. This will allow us to build for multiple boards without changing any source code (currently you have to change a using namespace Board =...

  2. Allow specifying custom board config file, which may be outside of mp1-boot source dir. For instance, including mp1-boot in another project

  3. Allowing adding new options to board config without forcing all board config files to be updated.

Proposal:

Goals 1 and 2 can be done by building with make BOARD_CONF=xxx, where xxx can be a known board (DK2 or OSD32), or a path to a custom board_conf.hh file. This has been roughly implemented in the ssbl-option branch (still needs work).

Goal 3 can be addressed by changing namespace Board to struct Board, which inherits from a struct of constexpr members with default values. A new field can be added to the default struct, and all boards will inherit the default. Thus creating new fields won't break existing board configs.

With Board as a class type, it can be passed as a template parameter, which might be useful for checks like if constexpr (requires {typename Board::SomeThing})

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions