From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id CD7BCC001B0 for ; Tue, 8 Aug 2023 20:36:24 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id F058A865BC; Tue, 8 Aug 2023 22:36:22 +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="IIQa1Bz0"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id D933286679; Tue, 8 Aug 2023 22:36:21 +0200 (CEST) Received: from mail-yw1-x112f.google.com (mail-yw1-x112f.google.com [IPv6:2607:f8b0:4864:20::112f]) (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 CDC4A8073D for ; Tue, 8 Aug 2023 22:36:19 +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-x112f.google.com with SMTP id 00721157ae682-583d63ca1e9so70381517b3.1 for ; Tue, 08 Aug 2023 13:36:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=konsulko.com; s=google; t=1691526978; x=1692131778; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=NawLgYt3nxq1kdcif9ij3JnlfZCM7COHqUya3rs2a80=; b=IIQa1Bz0lix7ETOENJvdxERUUjD3eiisobUIO1XNBWgtKxdctarXgbeaHhGELG7qXZ 51I1rboeC4w6FmlmfeO/2jICQIABId1P6wcneADlEZJBuPZtlAqMnlCMaIHW+dbAoaJJ g2gFPfWosj//YVboPx4twQD7+419eTJpf3veg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691526978; x=1692131778; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=NawLgYt3nxq1kdcif9ij3JnlfZCM7COHqUya3rs2a80=; b=e6GvxhOyZYU8SKOTKWtK70Pf1oK9gHioNoYE24e5pYA7P+PMtM1Zm7bYHopBW4xTHU 52S/tZJOlX1TvoVRTD+XtM8KUrNcNl55xV7gmUvRTGlItXBRppOySNAlEVabb64LYCf1 5qr181dbUmqOHaHFPM753TtIv0wdAuacGhI13OuI1RoozNArGabHaE5vEVXC3tTV7go7 HGx2M31+qXEZh3eN64a4nRo2AF/iB36bHvyUbf6u3ei+m9KBZdzKNblvTmqBhOG2zx/Z EuaOSL9qcxdGnnuQW4A5QUnv8ObRyckPguexM7ZNH3w2Zac6zPpPB3jhLMaKpZyZKV31 nV6g== X-Gm-Message-State: AOJu0Yxksg5RV1YmBftYMc0RH0qY6upiQVEpEPraf7fdRxJds42VRJ+2 o7P29+rbJga6+kCRc5veQZwXpXEp6BwmoGpPLy7YxQ== X-Google-Smtp-Source: AGHT+IHuOv9Ylxvl/tGEFU7vo+UFG5tj/sHt37v74Vk5kIRK0p65eLBkYkHT5Fw5G9uV3uRtn6nXTQ== X-Received: by 2002:a0d:dfd7:0:b0:571:bd3e:73ca with SMTP id i206-20020a0ddfd7000000b00571bd3e73camr847352ywe.16.1691526978423; Tue, 08 Aug 2023 13:36:18 -0700 (PDT) Received: from bill-the-cat.lan (2603-6081-7b00-6400-2db6-4152-97dc-8c4e.res6.spectrum.com. [2603:6081:7b00:6400:2db6:4152:97dc:8c4e]) by smtp.gmail.com with ESMTPSA id d203-20020a0ddbd4000000b005842447e843sm3583226ywe.10.2023.08.08.13.36.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Aug 2023 13:36:18 -0700 (PDT) From: Tom Rini To: u-boot@lists.denx.de Cc: Heinrich Schuchardt Subject: [v2] doc: Begin adding a best practices document for board ports Date: Tue, 8 Aug 2023 16:36:16 -0400 Message-Id: <20230808203616.1148322-1-trini@konsulko.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230807221510.673890-1-trini@konsulko.com> References: <20230807221510.673890-1-trini@konsulko.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 --- Cc: Heinrich Schuchardt Changes in v2: - Apply feedback from Heinrich --- 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..b012ac59e232 --- /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 most operating systems will be + supported by the platform. + +* The platform defconfig file must be generated via `make savedefconfig`. + +* The Kconfig and Kbuild infrastructure supports using "fragments" that can be + used to apply 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. + + Kconfig fragments should reside in the board directory itself rather than in + 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 -- 2.34.1