From patchwork Fri Sep 20 15:28:08 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jean-Jacques Hiblot X-Patchwork-Id: 1165291 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=quarantine dis=none) header.from=ti.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=ti.com header.i=@ti.com header.b="bY+AmXN+"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 46ZdCC2Zjrz9s00 for ; Sat, 21 Sep 2019 01:37:59 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id CD56DC21E1D; Fri, 20 Sep 2019 15:37:55 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=KHOP_BIG_TO_CC, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 502E2C21C51; Fri, 20 Sep 2019 15:37:53 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 47F0AC21DF9; Fri, 20 Sep 2019 15:29:10 +0000 (UTC) Received: from fllv0015.ext.ti.com (fllv0015.ext.ti.com [198.47.19.141]) by lists.denx.de (Postfix) with ESMTPS id 9989FC21E42 for ; Fri, 20 Sep 2019 15:29:07 +0000 (UTC) Received: from fllv0035.itg.ti.com ([10.64.41.0]) by fllv0015.ext.ti.com (8.15.2/8.15.2) with ESMTP id x8KFSbaw012640; Fri, 20 Sep 2019 10:28:37 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1568993317; bh=XgiG6hwhtSCcqF6Q+2Qmm5YI5wUqG6dFwg1orRVAhxs=; h=From:To:CC:Subject:Date; b=bY+AmXN+IBBqqrf+EWp0S9hyMqd5pzPdq7SpHNoqoFbO2/Ek9Bf33PcFuN2Ox4kG6 QBknN1DVjtg2WcAW5aXGWRP4HEMRpz6zGL9Tw8mqGqLwCtMOF3Bu/Ldvcg2rEs2fDe Pg7hWWY/sBHr54jp2J6u+YAnawU3kbLNotG5KtJg= Received: from DLEE104.ent.ti.com (dlee104.ent.ti.com [157.170.170.34]) by fllv0035.itg.ti.com (8.15.2/8.15.2) with ESMTP id x8KFSbvn065061; Fri, 20 Sep 2019 10:28:37 -0500 Received: from DLEE105.ent.ti.com (157.170.170.35) by DLEE104.ent.ti.com (157.170.170.34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5; Fri, 20 Sep 2019 10:28:32 -0500 Received: from fllv0039.itg.ti.com (10.64.41.19) by DLEE105.ent.ti.com (157.170.170.35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5 via Frontend Transport; Fri, 20 Sep 2019 10:28:32 -0500 Received: from localhost (ileax41-snat.itg.ti.com [10.172.224.153]) by fllv0039.itg.ti.com (8.15.2/8.15.2) with ESMTP id x8KFSanE116569; Fri, 20 Sep 2019 10:28:36 -0500 From: Jean-Jacques Hiblot To: , , Date: Fri, 20 Sep 2019 17:28:08 +0200 Message-ID: <20190920152824.18958-1-jjhiblot@ti.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 X-Mailman-Approved-At: Fri, 20 Sep 2019 15:37:52 +0000 Cc: Maxime Ripard , "NXP i.MX U-Boot Team" , Chris Packham , Marek Vasut , Marek Vasut , Stefan Roese , Stephen Warren , Hans de Goede , Alexander Graf , u-boot@lists.denx.de, Heinrich Schuchardt , Maxime Ripard Subject: [U-Boot] [PATCH v5 00/15] Add support for applications of overlays in SPL X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 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" The purpose of this series is to provide the SPL with ability to apply overlays for u-boot. Our use-case is the support of the daughter boards of the AM65x EVM. In Linux, each board is supported by a unique overlay. The presence of the boards is detected at runtime, and some useful features (like USB) are implemented on those daughter boards. Instead of providing multiple dtbs and fall in a combinatorial pit, we propose to use DT overlays. Patch #2 "spl: fit: Add support for applying DT overlay" has been posted a few weeks ago by Michal Simek. Patch #3 to #6 amend Michal's patch. Patch #7 to #9 are simple fixes for the Makefile Patch #10 is used to reduce the complexity of the Makefile by having FIT generator scripts provide their dependencies Patch #12-#13 allow to use the board driver in SPL Patch #14-#15 adds a way to dynamically select the DT overlays. That is were we would use HW detection to select the required overlays. In that case, the board driver code tells what overlay it needs (it gives the name of the node). On arm, if overlay are supported, this series increases the size of the SPL by 3.2 kB. Travis build : https://travis-ci.org/jjhiblot/u-boot/builds/567779404 Changes in v5: - Do not allocate the buffer if not needed (no overlay). - Add a Kconfig option for the buffer size - board_get_fit_loadable() returns an error code instead of a NULL string in case of failure - reword some commit logs Changes in v4: - use CONFIG_IS_ENABLED() instead of #idef - make sure that the temp buffer is freed in all cases - Use the board driver infrastructure to get the image names from the board code. - Remove a patch that passed the board name to the FIT generator. If needed the generator can get it from elsewhere - Add a fix to not load the firmware twice (once as a firmware and once as a loadable) Changes in v3: - Add a new config option: SPL_LOAD_FIT_APPLY_OVERLAY. By default, it is not selected. - removed the RFC prefix. This work will be needed soon by TI's AM65x platform. and can probably benefit other modular platforms - removed the last patch that provided an example of how to use this with on a DRA76. - removed the patch that made u-boot.img a symlink to u-boot.itb because it breaks the build of many platforms (because files required to build the ITB are missing) - removed the patch to reduce the footprint of the am335x SPL. (already merged) - Made the boot flow more permissive (don't fail immediately if an overlay is not present) and more verbose when an error occures - handle the dependencies of the FIT generation in a more generic way - use a dedicated kconfig option to enable the application of the overlays by the SPL. Changes in v2: - depend on SPL_DM - update the commit log - reworked board_fit_get_additionnal_images() and how it used in spl_fit.c - removed dtbo generation from dtso files and use .dts extension for the overlays - add dynamic allocation usage in a separate patch - defconfig change for the am335x_evm Jean-Jacques Hiblot (14): spl: fit: don't load the firmware twice spl: fit: Make room in the FDT before applying overlays spl: fit: allocate a temporary buffer to load the overlays spl: fit: Do not fail immediately if an overlay is not available spl: fit: be more verbose when an error occurs when applying the overlays Makefile.lib: include /__symbols__ in dtb if SPL_LOAD_FIT_APPLY_OVERLAY is enabled Makefile: Fix tests for CONFIG_SPL_LOAD_FIT and CONFIG_SPL_FIT_GENERATOR Makefile: Fix u-boot.itb generation when building outside the source tree Makefile: Query the SPL Fit Generator for its dependencies spl: fit: constify the output parameter of spl_fit_get_image_name() drivers: board: Make the board drivers available in SPL drivers: board: Add get_fit_loadable() include: board: provide empty stubs when the BOARD option is not selected spl: fit: Allow the board to tell if more images must be loaded from FIT Michal Simek (1): spl: fit: Add support for applying DT overlay Kconfig | 18 +++ Makefile | 23 ++-- arch/arm/mach-imx/mkimage_fit_atf.sh | 5 + arch/arm/mach-rockchip/make_fit_atf.py | 7 ++ board/sunxi/mksunxi_fit_atf.sh | 4 + .../lion_rk3368/fit_spl_atf.its | 6 +- .../puma_rk3399/fit_spl_atf.sh | 6 + common/spl/spl_fit.c | 113 ++++++++++++++++-- drivers/Makefile | 2 +- drivers/board/Kconfig | 3 + drivers/board/Makefile | 2 +- drivers/board/board-uclass.c | 11 ++ include/board.h | 74 ++++++++++++ scripts/Makefile.lib | 4 + 14 files changed, 251 insertions(+), 27 deletions(-)