[PATCH] doc: Begin adding a best practices document for board ports

Heinrich Schuchardt heinrich.schuchardt at canonical.com
Tue Aug 8 22:12:12 CEST 2023


On 8/8/23 00:15, Tom Rini wrote:
> To help guide developers down the right path, begin a document that
> lists some best practices to follow when creating a new board port.
> 
> Signed-off-by: Tom Rini <trini at konsulko.com>
> ---
>   doc/develop/board_best_practices.rst | 26 ++++++++++++++++++++++++++
>   doc/develop/index.rst                |  1 +
>   2 files changed, 27 insertions(+)
>   create mode 100644 doc/develop/board_best_practices.rst
> 
> diff --git a/doc/develop/board_best_practices.rst b/doc/develop/board_best_practices.rst
> new file mode 100644
> index 000000000000..835ea86dedb2
> --- /dev/null
> +++ b/doc/develop/board_best_practices.rst
> @@ -0,0 +1,26 @@
> +.. SPDX-License-Identifier: GPL-2.0+:
> +
> +Best Practices for Board Ports
> +==============================
> +
> +In addition to the regular best practices such as using :doc:`checkpatch` and
> +following :doc:`docstyle` and :doc:`codingstyle` there are some things which
> +are specific to creating a new board port.
> +
> +* Implement :doc:`bootstd` to ensure that the most number of operating systems

This looks helpful. Just a few suggestions:

"to ensure that most operating systems will be supported by the platform."

> +  will be available for the platform.
> +
> +* The platform defconfig file must be generated via `make savedefconfig`.
> +
> +* The Kconfig and Kbuild infrastructure supports using "fragments" tha can be

%s/tha/that/

> +  used to make changes on top of a defconfig file.  These can be useful for

Maybe: %s/to make/to apply/

> +  many things such as:
> +
> +  * Supporting different firmware locations (e.g. eMMC, SD, QSPI).
> +
> +  * Multiple board variants when runtime detection is not desired.
> +
> +  * Supporting different build types such as production and development.
> +
> +  And when used should reside in the board directory itself rather than the

%s/And when used should/Kconfig fragments should/

%s/rather than the/rather than in the/

Best regards

Heinrich

> +  top-level `configs/` directory.
> diff --git a/doc/develop/index.rst b/doc/develop/index.rst
> index 263d404b4ca8..5b230d0321f2 100644
> --- a/doc/develop/index.rst
> +++ b/doc/develop/index.rst
> @@ -9,6 +9,7 @@ General
>   .. toctree::
>      :maxdepth: 1
>   
> +   board_best_practices
>      codingstyle
>      designprinciples
>      docstyle


More information about the U-Boot mailing list