From patchwork Tue Jul 25 03:50:57 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Manoj Sai X-Patchwork-Id: 2940 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-yw1-f200.google.com (mail-yw1-f200.google.com [209.85.128.200]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id D3EDB3F37D for ; Tue, 25 Jul 2023 05:51:12 +0200 (CEST) Received: by mail-yw1-f200.google.com with SMTP id 00721157ae682-5704e551e8bsf62031387b3.3 for ; Mon, 24 Jul 2023 20:51:12 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1690257072; cv=pass; d=google.com; s=arc-20160816; b=rEpbb7EXJWrGgp5FvfjCwpwk8YXgqo0PDT55vZmyBbahK2JRsjvASfJvUGPyXxgs55 nn1ALZ5SINXwD1YK91ZnavFjYWtUdCo1R84HLLT3XIBDzcK9PRgRGtSV9m08EtlelCPK 707hJfBwkRMArqTYXZixQxWgwgGGL2KfzsAESp48b4IldLCxpsPs6crZIhy7OfBuXgQE aiUclajnGXc2gdkBlS0DPPsjvC2NpuhzXr6oSPEuYFDvBEw5/F5FIchPdBDQJZX1Do/t EOcXI7k2H387j6BFUz7KdnP8JdDqxSISHw3W+ChCCb52iJv5WMqAY1lA2zGuA9sb87rS IfCA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=JCRhGugFG46xLmiqzIUPIV2QMRwK3+JvYcYvDzlKSYg=; fh=ZtU/xXInpIejK4L8YauyoYBdqqK+nRzYacYy4t7Zzbc=; b=1JOLE9vR719+B+RypS2SWJ+CoOAuhRFwt/r70uSgqZJ8lNpN+sDw9SqDtKUNWpJD4q Oq94vAVZ4A8mKubZk7E7FMxpqOJGKXbyJIhbpTHkEha4O3z3QdiPezItRiAMyyUGCLic F++bGylbYOSAZ0F03xEC5gTHDQpPVr7OOSd5x3v08XgJbSFbcyoubDUkeQ+tVEOGy5Dk 35B6d6862QtyFdKMTAv+vwBYU8Ccy0Sy4YrhYcH1dJUgCJ7k1HAMZ0Eyi0uHSSYpVA2N ApAp/TUl+v7U5j1czozNE3G6QHFkmnLg7R8czgqXzkge2qs6EeqbqSoaktSa9iJl+5Co f3ig== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=E57I+rrG; spf=pass (google.com: domain of abbaraju.manojsai@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=abbaraju.manojsai@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; t=1690257072; x=1690861872; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:x-original-authentication-results :x-original-sender: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=JCRhGugFG46xLmiqzIUPIV2QMRwK3+JvYcYvDzlKSYg=; b=BtO5mUuhCN8A37o+qVs5pJleWL11+a9t6pKVwseYp+xRJV6YEY9b4Omvab2BhAZt33 Be0A1+z8dmylJvlAKg60VnIz7gZX+9wU0pYt3Zi7eMU4HklNxGLoxd2oXIoi/BBv/GeU RX0IhWLT6UfwAOzi6+cJOb06t62P7P8o4YCkE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690257072; x=1690861872; h=list-unsubscribe:list-archive:list-help:list-post :x-spam-checked-in-group:list-id:mailing-list:precedence :x-original-authentication-results:x-original-sender :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-beenthere:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=JCRhGugFG46xLmiqzIUPIV2QMRwK3+JvYcYvDzlKSYg=; b=HeDA+97woc+5MJ/TDMW0d6rFyXsrpspiuksrK13KECtS4RhwfXoU+M6COzJ1Gzd7vj igb3r/rwyj+exHb05nLkVJlT6SByNQMvLadaLESmzT0dteCW+9cinWsziAd2uK97XBtM inKp14/Nussy4Zoi7iipDDpP7/CA3Io78Qwd04jDoBJI4zZ+d+uYhE8wGIT5JztxIsN5 Kzk3QCTz709y8Df+w+m+SIGPt4RbbtJG8VCqW1peNnW8DPNYC521rInosBab9fzcHRPK Jyj277hG+9CKgJGIA1DH0bBpUrmxei0+zo2ZP8ZaNUn0qOV+eN3dgjDLpTaggKHCpFJE R1RA== X-Gm-Message-State: ABy/qLbz7XasciTiB1GDVKB45VZ0hsFlsPfa4GGfEnaC5AGWTmmMfwBH fAs4rS90yr8+IqWRKThPuYqUHB0G X-Google-Smtp-Source: APBJJlHBxuZCSrqPvZY8DCERGGXn37RnaeDg01S17jPOkDt7kLuXuMVDVcKVZ5rj8grdWzqgaYP6/A== X-Received: by 2002:a25:2f4c:0:b0:d12:ab1:d88a with SMTP id v73-20020a252f4c000000b00d120ab1d88amr3885156ybv.40.1690257071689; Mon, 24 Jul 2023 20:51:11 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a05:6902:150d:b0:d17:32a2:e3ff with SMTP id q13-20020a056902150d00b00d1732a2e3ffls568213ybu.1.-pod-prod-01-us; Mon, 24 Jul 2023 20:51:11 -0700 (PDT) X-Received: by 2002:a0d:d491:0:b0:583:af98:6fb3 with SMTP id w139-20020a0dd491000000b00583af986fb3mr6319067ywd.15.1690257070781; Mon, 24 Jul 2023 20:51:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690257070; cv=none; d=google.com; s=arc-20160816; b=tqY6iLWHj1qwlIENOFeELjw7vMzoXCe7B7dO9fDs+yq5H8V+ujWCx0BL5MICmC5Hf2 ++aAfQD/DVf6q5/TJkpIuhtJV7VZk1gjnTrX9cw0LZwX+0o3gFOZ39vQYQlwNVDsVWVK PfN92EvKrtGcFm83ja4ekw5QX2OrZ8k4R6JFtEx2ugI5mMJPPd5j17H+E3AKHCdh0Kee F+9uyIgRU9+BrqjGREtN6tj4BwAWd6svQxeWgiXQTEVt8noQ6fOw80cqiTa7+0TPm8gr g1tPU7SkhuhIICZTgUafW93tGOnaLJ927VovkHNc09L5yqpIkksQ0SV5LpO7xTPuQKPJ kmIA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=exaiOX64Mg+Hjppn8r+fOTmYE1ZLHQXKeP8r923xRu8=; fh=ZtU/xXInpIejK4L8YauyoYBdqqK+nRzYacYy4t7Zzbc=; b=ElIJuZmGEGzAV7Lvri1pVWMf5RbmGDSurRH/3RHppYK1fCM0kcsxG7oR7xfleKrOYU 5wg4NqZkk7mlvcITi8gjTSczurEDibdFqKh3zHJmJtX3VLjNTXOGwm7iu8hyZZKvBGrR n5Kq+MPX0qqOYM/IExC6Op74+/YYjsQ48i+1wscdAdsoRi3/3Bo3dwYpgAma+8wFajfb CUHx7jTVOrgOfG9SYvZK3BeThL1j4n9/OKXwdAUiXGj4uFusHBKpFQ/ys5yWNb0IneHC nCQH06lDx5b3fyVrkhwFN4sMNkifUCPZd4KZCbamqN/IUSw2HqowiA0cwMigwvHJXs8W h3nA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=E57I+rrG; spf=pass (google.com: domain of abbaraju.manojsai@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=abbaraju.manojsai@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com Received: from mail-sor-f41.google.com (mail-sor-f41.google.com. [209.85.220.41]) by mx.google.com with SMTPS id g16-20020aa79dd0000000b0068664fcb79bsor2528197pfq.8.2023.07.24.20.51.10 for (Google Transport Security); Mon, 24 Jul 2023 20:51:10 -0700 (PDT) Received-SPF: pass (google.com: domain of abbaraju.manojsai@amarulasolutions.com designates 209.85.220.41 as permitted sender) client-ip=209.85.220.41; X-Received: by 2002:a05:6a00:ad2:b0:668:8705:a456 with SMTP id c18-20020a056a000ad200b006688705a456mr12573549pfl.23.1690257070370; Mon, 24 Jul 2023 20:51:10 -0700 (PDT) Received: from localhost.localdomain ([49.204.25.25]) by smtp.gmail.com with ESMTPSA id j18-20020aa78d12000000b00679fef56287sm8658399pfe.147.2023.07.24.20.51.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 Jul 2023 20:51:10 -0700 (PDT) From: Manoj Sai To: Simon Glass , Philipp Tomsich , Kever Yang , u-boot@lists.denx.de Cc: Da Xue , dsx724 , linux-amarula@amarulasolutions.com, Jagan Teki , Suniel Mahesh , Manoj Sai Subject: [PATCH v2 0/4] support for booting the compressed U-boot binary on Rockchip based ARM64 SOC's Date: Tue, 25 Jul 2023 09:20:57 +0530 Message-Id: <20230725035101.281325-1-abbaraju.manojsai@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230630121146.513345-1-abbaraju.manojsai@amarulasolutions.com> References: <20230630121146.513345-1-abbaraju.manojsai@amarulasolutions.com> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" X-Original-Sender: abbaraju.manojsai@amarulasolutions.com X-Original-Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=E57I+rrG; spf=pass (google.com: domain of abbaraju.manojsai@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=abbaraju.manojsai@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com Precedence: list Mailing-list: list linux-amarula@amarulasolutions.com; contact linux-amarula+owners@amarulasolutions.com List-ID: X-Spam-Checked-In-Group: linux-amarula@amarulasolutions.com X-Google-Group-Id: 476853432473 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , This patchset adds the support on Rockchip based ARM64 SOC's that compress the U-BOOT proper along with dtb and ATF in FIT image format.Second stage bootloader(SPL) loads the compressed binaries, uncompress them and handover control to the next stage. Changes for V2 :- - Removed the need to create gzip and lzma compressed U-boot-nodtb files using Makefile and added a changeset that "compress" field to u-boot-nodtb node and "compression" field to u-boot Node in the FIT image, with the help of this change binman will create the compressed Binaries. Size Comparision between compressed and uncompressed binaries :- size of uncompressed binary :- 9.4 MB (94,26,432 bytes) manoj:u-boot$ ls -lb u-boot-rockchip.bin -rw-rw-r-- 1 manoj manoj 9426432 Jul 25 07:42 u-boot-rockchip.bin size of GZIP compressed binary :- 9.0 MB (89,85,088 bytes) manoj:u-boot$ ls -lb u-boot-rockchip.bin -rw-rw-r-- 1 manoj manoj 8985088 Jul 25 07:42 u-boot-rockchip.bin size of LZMA compressed binary :- 9.0 MB (90,06,080 bytes) manoj:u-boot$ ls -lb u-boot-rockchip.bin -rw-rw-r-- 1 manoj manoj 9006080 Jul 25 07:47 u-boot-rockchip.bin - modified to use the CONFIG_SYS_LOAD_ADDR as the source RAM address to store the compressed U-Boot binary which will be defined in the machine defconfig file in place of creating a new RAM address for a specific board using Kconfig. so patchset related to adding a new RAM address to store compressed binary has been removed in V2 patchset. - Removed the patchset related to adding the u-boot-nodtb.bin.gz and u-boot-nodtb.bin.lzma as input binary to binman. -- Test results of Booting time using bootstage command in Uboot command prompt on roc-rk3399-pc board :- 1) Uncompressed U-BOOT : Total boot time ≈ 12.3 seconds => bootstage report Timer summary in microseconds (10 records): Mark Elapsed Stage 0 0 reset 1,824,330 1,824,330 board_init_f 2,921,678 1,097,348 board_init_r 5,179,369 2,257,691 eth_common_init 5,478,307 298,938 eth_initialize 5,478,484 177 main_loop 5,478,641 157 usb_start 12,017,936 6,539,295 cli_loop Accumulated time: 15,899 dm_r 694,371 dm_f 2) GZIP Compressed U-BOOT : Total boot time ≈ 13.5 seconds => bootstage report Timer summary in microseconds (10 records): Mark Elapsed Stage 0 0 reset 2,591,355 2,591,355 board_init_f 3,689,407 1,098,052 board_init_r 5,947,314 2,257,907 eth_common_init 6,246,250 298,936 eth_initialize 6,246,427 177 main_loop 6,246,585 158 usb_start 12,785,936 6,539,351 cli_loop Accumulated time: 15,902 dm_r 694,779 dm_f 2) LZMA Compressed U-BOOT : Total boot time ≈ 23.5 seconds => bootstage report Timer summary in microseconds (10 records): Mark Elapsed Stage 0 0 reset 6,376,405 6,376,405 board_init_f 7,471,967 1,095,562 board_init_r 9,726,257 2,254,290 eth_common_init 10,024,873 298,616 eth_initialize 10,025,049 176 main_loop 10,025,208 159 usb_start 16,564,906 6,539,698 cli_loop Accumulated time: 15,851 dm_r 693,323 dm_f Patch 1/4 generate a GZIP-compressed U-boot binary using binman if CONFIG_SPL_GZIP selected Patch 2/4 generate a LZMA-compressed U-boot binary using binman if CONFIG_SPL_LZMA selected Patch 3/4 uncompress the gzip U-BOOT binary and load the binaries if gzip compression supoort is enabled Patch 4/4 uncompress the lzma U-BOOT binary and load the binaries if lzma compression supoort is enabled Manoj Sai (4): rockchip: Add support to generate GZIP compressed U-boot binary rockchip: Add support to generate LZMA compressed U-boot binary spl: fit: support for booting a GZIP-compressed U-boot binary spl: fit: support for booting a LZMA-compressed U-boot binary arch/arm/dts/rockchip-u-boot.dtsi | 11 +++++++++++ common/spl/spl_fit.c | 21 +++++++++++++++++---- include/spl.h | 10 ++++++++++ 3 files changed, 38 insertions(+), 4 deletions(-)