From patchwork Mon Aug 7 22:15:10 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Rini X-Patchwork-Id: 1818232 X-Patchwork-Delegate: xypron.glpk@gmx.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=konsulko.com header.i=@konsulko.com header.a=rsa-sha256 header.s=google header.b=iczrSDWb; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4RKVxr3jqRz1yYC for ; Tue, 8 Aug 2023 08:15:26 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id F1E61807D6; Tue, 8 Aug 2023 00:15:15 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=konsulko.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=konsulko.com header.i=@konsulko.com header.b="iczrSDWb"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 666C88083B; Tue, 8 Aug 2023 00:15:15 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-yw1-x112e.google.com (mail-yw1-x112e.google.com [IPv6:2607:f8b0:4864:20::112e]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 5ADD28075F for ; Tue, 8 Aug 2023 00:15:13 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=konsulko.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=trini@konsulko.com Received: by mail-yw1-x112e.google.com with SMTP id 00721157ae682-5841be7d15eso57394487b3.2 for ; Mon, 07 Aug 2023 15:15:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=konsulko.com; s=google; t=1691446512; x=1692051312; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=94pdrhsR8rqFAsSd+SNsErCtI6Ee3gNJPRuwy0etL1E=; b=iczrSDWbCcZx4Yl99497mOHvdt3NLhSfVM6m+rHqqhzJRB10dsi2h8/UOzNnb+Pa9J JG/d35vfAFGXprTagVYSMOximh0wMDImtn9T/9TxiamLkQ1ePhEctbx/F79wxOyUvJZN L+KW/njvaiTCqD+7z+5yE7RpnZMC0KOxOWKd4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691446512; x=1692051312; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=94pdrhsR8rqFAsSd+SNsErCtI6Ee3gNJPRuwy0etL1E=; b=RDM2bKPfKX2MQSJOSaM51nZ13/VQ0YT5QINz0oW3RLT8prHIq/nSnEKiEA0z99dwEg 8u55JXDexQLj37nFlMstnoaBaYtGuCGqZ6pSz9Gz32XFoDNfLDLMGN2DVIZO1vhu4Iap Ky13wYlZnrbGz6IYCy0PRRodRdfFfz5t9o8YihdBMjBehajeVnx/l7luAfP3mCIe9+6/ M/8f9X9pBCp26023kFv1Kh39lFSHWSAk6lUiGm634MVbmxQePaR5tYego4z5bTdUCXVe 5JmhEYZfh8FpuBnXEhNg8KG1hj7DwrZRvRLyLHN3mKEa/hf2EkJfjUDYvTHK3poajXwD XfTA== X-Gm-Message-State: AOJu0Yy1HUM4ZUnpSgZ/rIwWS2T1TOmjpm5xlb85zJOl8gZCB5kt/l4a 7qYEQvVrt/VDbCtqoi9MTVXdwB6yjgaT31HET7vwPQ== X-Google-Smtp-Source: AGHT+IFwuFY7xeUBZq6CSW8in+i2nvbX4/4N29VoQwDrF2jRohnlLs5MPlvHz+pGLe67EpL1JRATxw== X-Received: by 2002:a81:8383:0:b0:583:d1fa:1fc4 with SMTP id t125-20020a818383000000b00583d1fa1fc4mr13105801ywf.26.1691446511789; Mon, 07 Aug 2023 15:15:11 -0700 (PDT) Received: from bill-the-cat.lan (2603-6081-7b00-6400-3ce2-35b7-c17c-93f2.res6.spectrum.com. [2603:6081:7b00:6400:3ce2:35b7:c17c:93f2]) by smtp.gmail.com with ESMTPSA id e67-20020a816946000000b005869d49212fsm2945228ywc.32.2023.08.07.15.15.11 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Aug 2023 15:15:11 -0700 (PDT) From: Tom Rini To: u-boot@lists.denx.de Subject: [PATCH] doc: Begin adding a best practices document for board ports Date: Mon, 7 Aug 2023 18:15:10 -0400 Message-Id: <20230807221510.673890-1-trini@konsulko.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230711212048.1340990-2-j-kacines@ti.com> References: <20230711212048.1340990-2-j-kacines@ti.com> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean 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 --- 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 + 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 + used to make changes on top of a defconfig file. These can be useful for + 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 + 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