From patchwork Tue Jul 25 03:50:58 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Manoj Sai X-Patchwork-Id: 2941 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pf1-f197.google.com (mail-pf1-f197.google.com [209.85.210.197]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 9835E3F37D for ; Tue, 25 Jul 2023 05:51:16 +0200 (CEST) Received: by mail-pf1-f197.google.com with SMTP id d2e1a72fcca58-682a4f1253asf3475023b3a.0 for ; Mon, 24 Jul 2023 20:51:16 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1690257075; cv=pass; d=google.com; s=arc-20160816; b=tHUHxk1nnZ8EIuk7QYRCrJOtR3B9zijAp4PhsPs1SO5XupzO4HCZ23ntb/zcDXVO7X fuTCYChCzuNpU3G1DFuPDHPp+m+j7At6nBdzACTu7N2GDoq2iU69zKWgqjpDwGawOFm1 YkW3zcS8mGNeolqohEG8+avJXo5hakNUsEX05m8WfUtPQDk0JG4tYhd/S+YUJpSC5WfV tDaKKUn1ihMSSfAGxXWEI90yxGuCSkGgUYpUPdOuBLDlFK+oDhdzvUAEic4uHltR04NU mgo/LQ1GzcQuZY0MSv/K1TrzR7xOn6YLzI0z0meW9ACVXZTNgee+FIa04+y+6Y7qM3eI Lhtw== 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:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=2HSC18xrOvygqQiFbFp49Pqm/jO5h2cRwGKRaGWfMe8=; fh=ZtU/xXInpIejK4L8YauyoYBdqqK+nRzYacYy4t7Zzbc=; b=jkvM5tyRxsfxBCkuykYvA7uUgTwjrOgBxbXuTEeo5hPPYb8lKGiwiRFPOKjMA3GJQa afLKPdem0niNGR+fcVk3BRCLT0FBmI7t9yCb2dDlAMdVdWtqV5Qwl+k9S8yUhXBJ8dNa qU6g/dhLFWq5QqaxN2rYdCI+Noe7Ar0YcVLe3rnO1zYEdKV/FQGHTLcL7ulWLYerEHxJ 8Xn2KNVq2c9+mIDMyI/3XrLbxKKqzK8vbTll99ml3Xb5+os1/3ZT4AiLLnTYate1hwpN rsvIDjgDCzXnNhkR1EyACRRgHSKiqAuscxzw78BCz2OySnKZ5V2mhDaobACr+JGY8tGk liZQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b="Jkpfv6/6"; 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=1690257075; x=1690861875; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:x-original-authentication-results :x-original-sender:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=2HSC18xrOvygqQiFbFp49Pqm/jO5h2cRwGKRaGWfMe8=; b=HQFe16X/mQFPdBDrrgjN/QKke8+eU01vx/nGJyACugLo0S+ogjnnWyhix8piM7b2fz LEXEkOGI1hArr5PNU1oqw1Vo3pPPEZ5+7rwKrJU/YlvOZHie9Rv81CMX3fR9Kqsozg8j xZoUFlIZOMXpIVttryB1giuI8iokdHvIkw+wk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690257075; x=1690861875; 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: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=2HSC18xrOvygqQiFbFp49Pqm/jO5h2cRwGKRaGWfMe8=; b=RzQdXSOL+6o9SIXJ9uT5diiKfPwp73tC6iIhBeT68yd9tI+QNfUDGXBs55xPrel362 VuaOwwWbfnBmwXkXro7FWg2IfBIVz/tvKWI7Ky+C0JjjzCDnKzmcU6hcVgB2lLQk8PHN akXsCHgSwj4xCnO58q9dB2xcS+KT50QzBIKufksda067SmMLSj/gmjR04VWllsUhsbS7 PXDWxv3V8+GTTrwCTicz9JbpzdMIq5QFvWC0WwzIQMVrHu1deG2uo7STOIr6m9//GZIg K94K2y0Ga/MWWs6FNiGzK70t9gmvyKWtYc8GTtbGynhOQGzjxO6SZTpX9Drb/BbURtSc Q0qQ== X-Gm-Message-State: ABy/qLa1HpHs7IFKoSTTbSMP1vhV4J5ja/cfaoUQyGM0Q7zRwH9xLR1Q 65FSzisnpPgIYqjkfDdQmsKYHtRV X-Google-Smtp-Source: APBJJlE9zyIuW8oyskXecB6TrB7lzvuJkcs968c3tHSxm/WBMUSkGd4paMrbxc/vwDnt5x8iq49Ylg== X-Received: by 2002:a05:6a00:80f:b0:67f:830f:b809 with SMTP id m15-20020a056a00080f00b0067f830fb809mr1655568pfk.3.1690257075144; Mon, 24 Jul 2023 20:51:15 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a62:1c16:0:b0:66a:44a0:cbb0 with SMTP id c22-20020a621c16000000b0066a44a0cbb0ls3615907pfc.0.-pod-prod-00-us; Mon, 24 Jul 2023 20:51:14 -0700 (PDT) X-Received: by 2002:a05:6a00:3a24:b0:668:98a1:5e9d with SMTP id fj36-20020a056a003a2400b0066898a15e9dmr1603542pfb.6.1690257074240; Mon, 24 Jul 2023 20:51:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690257074; cv=none; d=google.com; s=arc-20160816; b=aFL0B40h//y4TwtCvVZTeqksu43xLJmjdTaOuiAoaCO4H+jsEfBqDzApLlxUj9hdxJ N/v02YJG2xPQmYdWrJeVbulvWu5v64zfT9ETcCCdDN/jx0U79cNfNbwQptdUARc1fOHw Pru0CXGi2JkAUdiCvRAqjHHXOItyzhhfE9kvEp07mO4Q6c2V9VJrM5AiDMul8YXSBvfH LKAiFD7AmhRD/vhytvi0+mV5LWgABkEG7nNFH1AMZ2Een59EwZ64DfYXCbtk+9c9zplr KNgZMFfjPn8HhZbkgqRAWGaRQlljWlS2EfFYA+6BqAoh4l/crfMw6aey6JfZ7v0gqq6R dAig== 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=76n2fUzBzrLyUyMz30iEYvhw3+Fg6IfE9yWOEUmQJQ8=; fh=ZtU/xXInpIejK4L8YauyoYBdqqK+nRzYacYy4t7Zzbc=; b=cLcC8F901N/Ta8EJ1Z0ix1jHV7WdDxczRgHdyBeAsBjdFzERfBQZZlATlWTygex9cr FpXweTrkucpDrT0b58vMAElhmQOS157eTWduQFW1RQInuTuCZWTH4idxLntWeEpNOUsh f3Vlwh4vkwRU4nV7fYh3eB7tcQwVkM8vj/A0d8IBBFWGYtGp8yVNlmXcjMPJZ75Me5rG 81tV6uKCxAv3YwS3qSh+SvrFX+snyFmJMrK29edd5KRJFDrTCvXdTLLe0v/CMZdWD9O+ tQWO4hPImjYded8nW0YdJjA1mkAN0TBnR4uVj7Ssacq4Io5B9SB6DFhZRhUWhTgX31Sa wJrw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b="Jkpfv6/6"; 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 p1-20020a056a000a0100b006821133916csor3623465pfh.6.2023.07.24.20.51.14 for (Google Transport Security); Mon, 24 Jul 2023 20:51:14 -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:6a20:4312:b0:128:ffb7:dcfe with SMTP id h18-20020a056a20431200b00128ffb7dcfemr1239049pzk.1.1690257073870; Mon, 24 Jul 2023 20:51:13 -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.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 Jul 2023 20:51:13 -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 1/4] rockchip: Add support to generate GZIP compressed U-boot binary Date: Tue, 25 Jul 2023 09:20:58 +0530 Message-Id: <20230725035101.281325-2-abbaraju.manojsai@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230725035101.281325-1-abbaraju.manojsai@amarulasolutions.com> References: <20230630121146.513345-1-abbaraju.manojsai@amarulasolutions.com> <20230725035101.281325-1-abbaraju.manojsai@amarulasolutions.com> MIME-Version: 1.0 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="Jkpfv6/6"; 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 Content-Type: text/plain; charset="UTF-8" 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: , Add support for generating a GZIP-compressed U-boot binary with the help of binman, if CONFIG_SPL_GZIP is selected. Signed-off-by: Manoj Sai Reviewed-by: Simon Glass Reviewed-by: Kever Yang --- arch/arm/dts/rockchip-u-boot.dtsi | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/arch/arm/dts/rockchip-u-boot.dtsi b/arch/arm/dts/rockchip-u-boot.dtsi index 2878b80926..524d638e5b 100644 --- a/arch/arm/dts/rockchip-u-boot.dtsi +++ b/arch/arm/dts/rockchip-u-boot.dtsi @@ -48,10 +48,17 @@ type = "standalone"; os = "U-Boot"; arch = "arm64"; +#if defined(CONFIG_SPL_GZIP) + compression = "gzip"; +#else compression = "none"; +#endif load = ; entry = ; u-boot-nodtb { +#if defined(CONFIG_SPL_GZIP) + compress = "gzip"; +#endif }; #ifdef CONFIG_SPL_FIT_SIGNATURE hash { From patchwork Tue Jul 25 03:50:59 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Manoj Sai X-Patchwork-Id: 2942 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-il1-f197.google.com (mail-il1-f197.google.com [209.85.166.197]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id EB5E43F37D for ; Tue, 25 Jul 2023 05:51:19 +0200 (CEST) Received: by mail-il1-f197.google.com with SMTP id e9e14a558f8ab-348cc2cc7ebsf15797945ab.0 for ; Mon, 24 Jul 2023 20:51:19 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1690257079; cv=pass; d=google.com; s=arc-20160816; b=j8e5aHaaaRtXtrx5RRn2a9a70+8buwduE5On0BstGPMVuIf2Ph+X0hihDotjuCTaG0 TY8jvF8r80WI2uz4ohOsyT5zI9cyRUWvX2ohI4nmg8S6KTxgnJ1X7v/Ddmoc2K22gD1L d4eMB2TJ4xOkrN7lguA8nG9quISNy9QwYR6H2WOyJHJKNA8Yiho5WSexXRtof45Rx8hw e3aobqrphp0QPPLJsCRUR9BplTCX0NVTiJgkh15fpNHHCRgB7V0oXJ6mwDPXPuvi+y8e cH/HLNZjaviuOW39aU/EdBDnNGEgdgqCV9zOSAWWGqs1CMA36VFR4UC8TYc/gykoJQiv sTbg== 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:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=Wq8nhYLGBkqE0efgfZYy53iheD4wxiAySjca+/JEo7I=; fh=ZtU/xXInpIejK4L8YauyoYBdqqK+nRzYacYy4t7Zzbc=; b=PLkoOtRk/iP2bi4gHAPQSfvzSD1dxnxQyy9Lke1R/RacRHF5Ivt2+AbEQYhBEqK/zZ esOloNYL7JnsgKW5PDuhuatwySerFfMPF3rlVZ9ho5fMj0/qclGtq26+e2ePloXhPTP2 KV3N00G5AWJLOTqpIbs2tuPwyJ7w4sqDm56D18NeMv2Haw9XBsGEpSxbYLAMtgjfkCcN YZ1mJ1iAdTXX3QQy/U6B73VtFpxaNHVY8RNyYkV05J7nCbri7fl7PhMjFMeXdJofasej EZBQKQn4HVboTeyY0xP/k4pcTNhflEuqlYxcMwAFeJVOwHsWyMHnGVTrKWiYki1c27Um wrQA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=ISiuCPFd; 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=1690257079; x=1690861879; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:x-original-authentication-results :x-original-sender:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=Wq8nhYLGBkqE0efgfZYy53iheD4wxiAySjca+/JEo7I=; b=QLKi1jzn7hh3i4B/4mc7Yf/kOkMYxAg5UKbipmIZxkWFYg3nC7hYmMpgTfK5ak1oGh 5XzSUBC2MCSzl3kIHWGit6fN9zI7yH3ngGhgQX6Z5gsb0w9O4ruDNad5oeq0hgQywgj+ f7g+H2EEoccjwlQhuzZ8qxpfFNulHEB1ET7aY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690257079; x=1690861879; 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: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=Wq8nhYLGBkqE0efgfZYy53iheD4wxiAySjca+/JEo7I=; b=Eaww7zcFFNLAWVIA7vlOE+oINmXUZzmt5cHkmV2ePH5VKYShysOiSR7KFlX3eAkkAK cJuuTb/ukkcgyJCQu6tSGgzzqj6lVZpHt1Qv1t9iLo6aNTCVG4C/V7KyaM2nGmPr5wnd qlGOPZk2dgxhUd1NEWToJy82Hut72a1OTywli5XTQCE1X5oyqTHPttneT6HHnfc7bvSx 5dWstQ0hivTZBYF26BG9Pnkh8O05BshG+n/6UTUqBB/avNNKKl3zcoypwXp9qz2dUkt+ cZQG/51fdT7Ai5wc3JlahIORAglzeGgMqIIJQi0eweET6AjMugo7WkiAFQxp3i+KoRkQ 7cjQ== X-Gm-Message-State: ABy/qLYGh6sxkFqdKJVeuQie3jn8RW7k0uBc6MJmSiy3pnz+NoWSyWCF 0uD4A7/GSqyBRGfSAwY99Lx14+YRLUoWWYvT X-Google-Smtp-Source: APBJJlELs9x5gsQyV+G2hzez+0w0uNhE6hxor64rljWhXFt6weVUwtaKuCSbcyVKb3IxJ+QslQOsMw== X-Received: by 2002:a05:6e02:11a8:b0:348:ccd2:ce19 with SMTP id 8-20020a056e0211a800b00348ccd2ce19mr1535817ilj.29.1690257078787; Mon, 24 Jul 2023 20:51:18 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a92:950b:0:b0:33f:e2d6:58e6 with SMTP id y11-20020a92950b000000b0033fe2d658e6ls907563ilh.1.-pod-prod-05-us; Mon, 24 Jul 2023 20:51:18 -0700 (PDT) X-Received: by 2002:a05:6e02:1a4c:b0:346:c04e:ca25 with SMTP id u12-20020a056e021a4c00b00346c04eca25mr1967806ilv.14.1690257078106; Mon, 24 Jul 2023 20:51:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690257078; cv=none; d=google.com; s=arc-20160816; b=MHcdrURfroRmB6nBmAcD/2S7cLnoTY3bUwrzXhrNxSk+antR6gpH3hsPvMxCv7jdSc KKdNaD5/WGiAHi102QdYur7khNmySKzp1QwP5x5b6RHtJgt2s7WLjhipfzFmeO6ZtOUO q2ygliuQiNBhdQt4wO8Kd6E8zwZunMIeAPGLY0Fx4DZRWrYyDYxRevmAps/1QYIhurL/ ErKiN6kltjj9ViTjloL49SNMCgv1hBt4BhpPF1MJlkn5a7Da4/0W4RiIHCWe/9Q2Qe+S KAMwv9GR1kxwales4FyVNi1kJV/l06YkMRsozU23UXuVN2DDugZdQaKSgtytBno8SdMl GXYg== 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=wGmQRCOv5KndXdVKBwlS7DDsH2J1pMMArHwkkLw2Q18=; fh=ZtU/xXInpIejK4L8YauyoYBdqqK+nRzYacYy4t7Zzbc=; b=BoK322caU2DKVobR/tFXDOxt8tDdfXhYPdRbOh+89QBh8JimfqUxBVb7BvfW0VET5w +oK6k7DTS/B+4eZxP/LwOdEZpRv7Mqj4UWYyggvLJpWECRO1CJFD7IOBYidRH1YtzbiL l3NidNlO342tRkZKRX17pA91qAukfK88aXGlA9/RiyqcFrge8cWJu5cz/O4tNZJQcTzR OIDO/0iJghRsIL4noKCA2KBDGtmCe+XCMxB5CZivMCr1J8zEmaLhCWI66zaSPU/PJL60 bSRauKG9yaI4fi3syadU7r3fCHQ4kkFZafr93hEufiSZTPxT/e+F1P29HViB35gEOMqE KwHQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=ISiuCPFd; 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 y23-20020a626417000000b00668738aa037sor3285667pfb.8.2023.07.24.20.51.18 for (Google Transport Security); Mon, 24 Jul 2023 20:51:18 -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:c89:b0:67a:b045:e295 with SMTP id a9-20020a056a000c8900b0067ab045e295mr13280173pfv.0.1690257077574; Mon, 24 Jul 2023 20:51:17 -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.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 Jul 2023 20:51:17 -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 2/4] rockchip: Add support to generate LZMA compressed U-boot binary Date: Tue, 25 Jul 2023 09:20:59 +0530 Message-Id: <20230725035101.281325-3-abbaraju.manojsai@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230725035101.281325-1-abbaraju.manojsai@amarulasolutions.com> References: <20230630121146.513345-1-abbaraju.manojsai@amarulasolutions.com> <20230725035101.281325-1-abbaraju.manojsai@amarulasolutions.com> MIME-Version: 1.0 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=ISiuCPFd; 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 Content-Type: text/plain; charset="UTF-8" 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: , Add support for generating a LZMA-compressed U-boot binary with the help of binman, if CONFIG_SPL_LZMA is selected. Signed-off-by: Manoj Sai Reviewed-by: Simon Glass Reviewed-by: Kever Yang --- arch/arm/dts/rockchip-u-boot.dtsi | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/arch/arm/dts/rockchip-u-boot.dtsi b/arch/arm/dts/rockchip-u-boot.dtsi index 524d638e5b..34282bdfb2 100644 --- a/arch/arm/dts/rockchip-u-boot.dtsi +++ b/arch/arm/dts/rockchip-u-boot.dtsi @@ -50,6 +50,8 @@ arch = "arm64"; #if defined(CONFIG_SPL_GZIP) compression = "gzip"; +#elif defined(CONFIG_SPL_LZMA) + compression = "lzma"; #else compression = "none"; #endif @@ -58,6 +60,8 @@ u-boot-nodtb { #if defined(CONFIG_SPL_GZIP) compress = "gzip"; +#elif defined(CONFIG_SPL_LZMA) + compress = "lzma"; #endif }; #ifdef CONFIG_SPL_FIT_SIGNATURE From patchwork Tue Jul 25 03:51:00 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Manoj Sai X-Patchwork-Id: 2943 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-oo1-f72.google.com (mail-oo1-f72.google.com [209.85.161.72]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 39C313F37D for ; Tue, 25 Jul 2023 05:51:24 +0200 (CEST) Received: by mail-oo1-f72.google.com with SMTP id 006d021491bc7-566ed1c021bsf7216791eaf.3 for ; Mon, 24 Jul 2023 20:51:24 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1690257083; cv=pass; d=google.com; s=arc-20160816; b=BjSonw6GlW6R0gls+8bS7XVy87dos5QRK3uGM2HkHPn8uhwFubtN1vXB/GOS9f9pue 3DH0boq/BPSaUn94hBwrtAHDzWbqrr5Ik5mNiXPRscLCy/gqK9dXb05ysnz4gJB/qDRd 0P470MTTSW7ytZqFO7PWnWfGf0Q4i+DISFa5+LlygWNQX4V9fGxgzempPfraQioHzntg ZZo7qPp7Gg76WExb35MTtX2pE84mnpUyAWOi5G9QmILJfhsXpNlnPcIbPvknKhSFSuO3 ySS7eU/xpnm6XhoHV6AFIhbV53LiROkYFoU1cbIdqevdIvbAABbecBs2hKYkMLpPveW5 5W/g== 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:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=cG65ZQhCN1R/c2OFsxn8mjPRdD/Fs8ZZksb3BNd10M8=; fh=ZtU/xXInpIejK4L8YauyoYBdqqK+nRzYacYy4t7Zzbc=; b=ObyfOhFnGDNYDKnTvPI/EdoXZxjclb8Iayhx1/qdrhHANW5eUPKCtUoBPwdO1H5WFE 6xQ1+ozW8NkLuF0tJS0ozjmVj9fJFFwUTtHMxDUvodHONUEd6HjQQx/4AHriVSxuax1q wiOFr8Mfs7xSzZLmw+ygwO6niCr6k5zPH9v0Hp1xVCfCK3QPDA7cgdswFHW8TkjSuAXI Qscv0POZt/mVIU/6VLVQDlHb41PwC8GTLpQSM/TamtqjOwc2F94uY4T+vkAjLVmhj1Mi a+QxkvH0fb03Ggi3enVlr4xp20oUJY9e8B0Aj527XiOfOb25i/rQFwnFIlYlW8r6kjZR y/qQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=UwJh1Ma5; 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=1690257083; x=1690861883; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:x-original-authentication-results :x-original-sender:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=cG65ZQhCN1R/c2OFsxn8mjPRdD/Fs8ZZksb3BNd10M8=; b=q8wQBlveUtQdppiera0n6MbnJbkq7wSYWe2ggLiYcauJbfRJIBKB2C/7PGq0F00t+R iiMhJuZq49MAk+5Aw2y4tf8KfNCkx7kPKMpkRmPwNhqEYLQp7i0WIhmjboMkzDcU/gEI cnNvtr5Gcskzc213C17TOIFWODKv3yP8d04+U= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690257083; x=1690861883; 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: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=cG65ZQhCN1R/c2OFsxn8mjPRdD/Fs8ZZksb3BNd10M8=; b=Bxu3/MG5wocsnaMIZ6TQzMGyexWp+HYHE5quCnAz1Xen3Zp5pYNsybW5tdckbEFmMp ymqzswcMZOwUZ6ntZitpeol1pNnL9R1mpupGtySgLX5sr3XdfmqpF+HsF6zzpPl4oe1j W7pNs4ifWipcFwUkxhLHjt3gDuHaij3P1SIsp1Xi8V1FETVv9ZL/xMqds19COa8DR3oD 8UI7w6nn/OjwKf7qNnGu72ucITaBOMktKeUDMkLABid7TERMvI7KaP+CuuI+HxZF4RMj Lhyc7Y1hIbYI3SLdZY8YGPpfhVZoT0ObSUSgV/X7l0u7qhbYaAlbJpULF/D3fMRHyH7n P+AQ== X-Gm-Message-State: ABy/qLYNAnFvvFxI456MlLM3U+ZH/Wmp2SsV6fxe+T+dvA3fRsC1BS5q ++wEheNz8u/dq46OpUsR3MNXyAvK X-Google-Smtp-Source: APBJJlFdrUtS3s+D1i61c6GdlbDGopEQYOmOFYL3SBys3V8kBP68QhP/AOjX0pj3xyLRWlEAXofT/g== X-Received: by 2002:a05:6808:1451:b0:3a5:ae6b:135e with SMTP id x17-20020a056808145100b003a5ae6b135emr7152063oiv.53.1690257083079; Mon, 24 Jul 2023 20:51:23 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a4a:4146:0:b0:566:468c:c3b3 with SMTP id x67-20020a4a4146000000b00566468cc3b3ls4574421ooa.2.-pod-prod-06-us; Mon, 24 Jul 2023 20:51:22 -0700 (PDT) X-Received: by 2002:a05:6358:3421:b0:130:faea:a81f with SMTP id h33-20020a056358342100b00130faeaa81fmr3581917rwd.28.1690257082151; Mon, 24 Jul 2023 20:51:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690257082; cv=none; d=google.com; s=arc-20160816; b=ekuzD6nXtu9IpQ82xkpJ+jumkhmEiM0W1NXsmxI/XwsyI+kezUVOGw67AY+ukp9ktx JUGVuYtWIxqthN0CmWix3dwwtPxkCwKR5CSJGfBWn0QbV4xYJaCRbPOBAjCYN8N87NNB UoshVzAbHUwrDKcncu4pWkOd/g2QKSoSvu+HS+iggvq2mkdLRx15KBh0355NdCJ+Rc2F U2SYBm9VT3GmHzh5KKO8STZBHBDD6WmWWTwBiKYI3l8lnJVj8Ztao7mzWWLGJY7CzugF m2btog1Cd0VSUuSK5eB5E7aOvIxMlhjD6ittJiLAkngJfqMT764/NxaZeImfzS9IzaA2 mDFg== 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=yIa8d6yNhllal3Gsc+yZ4Zl9rn7KgOVc9e6456YxTsY=; fh=ZtU/xXInpIejK4L8YauyoYBdqqK+nRzYacYy4t7Zzbc=; b=WeEefjDt4KBMfOIrT3dHFaVoKkAoNfpv9pPqXyF2EXsNSA3IKuIBUcKfu3ZL67+njE y52/9nFF2Dg6+dwr9F9rYXhyWb7bDtLDNG6GCswbJ+sUf0H0NNouM+xU7/g5tBLcmqbL eu8rEGDpuryhUr0VuxiQ+0wl4OIfIfKkwiUYSpgKnM04oMLLB+i/DZTG5saPj0dAWZPz Jj8K90nRNrd8UlAeuBxrzD4t0CpYaTYuKberTKJGYeqrF9yiCWRXNGahHlAFIUGjdB9c XpqFeRJcFfF9fCgThxotaB9OLKKmDhjxs1K1wEPH7lAclvDGowrvphsqYbZtSzykHzxc B+ZQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=UwJh1Ma5; 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 o28-20020a637e5c000000b005302f7dc13fsor3832681pgn.2.2023.07.24.20.51.22 for (Google Transport Security); Mon, 24 Jul 2023 20:51:22 -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:6a20:b28f:b0:134:b28f:b581 with SMTP id ei15-20020a056a20b28f00b00134b28fb581mr12262235pzb.28.1690257081869; Mon, 24 Jul 2023 20:51:21 -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.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 Jul 2023 20:51:21 -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 3/4] spl: fit: support for booting a GZIP-compressed U-boot binary Date: Tue, 25 Jul 2023 09:21:00 +0530 Message-Id: <20230725035101.281325-4-abbaraju.manojsai@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230725035101.281325-1-abbaraju.manojsai@amarulasolutions.com> References: <20230630121146.513345-1-abbaraju.manojsai@amarulasolutions.com> <20230725035101.281325-1-abbaraju.manojsai@amarulasolutions.com> MIME-Version: 1.0 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=UwJh1Ma5; 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 Content-Type: text/plain; charset="UTF-8" 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: , If GZIP Compression support is enabled, GZIP compressed U-Boot binary will be at a specified RAM location which is defined at CONFIG_SYS_LOAD_ADDR and will be assign it as the source address. gunzip function in spl_load_fit_image ,will decompress the GZIP compressed U-Boot binary which is placed at source address(CONFIG_SYS_LOAD_ADDR) to the default CONFIG_SYS_TEXT_BASE location. spl_load_fit_image function will load the decompressed U-Boot binary, which is placed at the CONFIG_SYS_TEXT_BASE location. Signed-off-by: Manoj Sai Signed-off-by: Suniel Mahesh Reviewed-by: Simon Glass Reviewed-by: Kever Yang --- common/spl/spl_fit.c | 7 +++++-- include/spl.h | 10 ++++++++++ 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/common/spl/spl_fit.c b/common/spl/spl_fit.c index 730639f756..d728ac71fc 100644 --- a/common/spl/spl_fit.c +++ b/common/spl/spl_fit.c @@ -239,7 +239,7 @@ static int spl_load_fit_image(struct spl_load_info *info, ulong sector, bool external_data = false; if (IS_ENABLED(CONFIG_SPL_FPGA) || - (IS_ENABLED(CONFIG_SPL_OS_BOOT) && IS_ENABLED(CONFIG_SPL_GZIP))) { + (IS_ENABLED(CONFIG_SPL_OS_BOOT) && spl_decompression_enabled())) { if (fit_image_get_type(fit, node, &type)) puts("Cannot get image type.\n"); else @@ -281,7 +281,10 @@ static int spl_load_fit_image(struct spl_load_info *info, ulong sector, return 0; } - src_ptr = map_sysmem(ALIGN(load_addr, ARCH_DMA_MINALIGN), len); + if ((IS_ENABLED(CONFIG_SPL_GZIP) && image_comp == IH_COMP_GZIP)) + src_ptr = map_sysmem(ALIGN(CONFIG_SYS_LOAD_ADDR, ARCH_DMA_MINALIGN), len); + else + src_ptr = map_sysmem(ALIGN(load_addr, ARCH_DMA_MINALIGN), len); length = len; overhead = get_aligned_image_overhead(info, offset); diff --git a/include/spl.h b/include/spl.h index 92bcaa90a4..088479e357 100644 --- a/include/spl.h +++ b/include/spl.h @@ -897,4 +897,14 @@ struct legacy_img_hdr *spl_get_load_buffer(ssize_t offset, size_t size); void board_boot_order(u32 *spl_boot_list); void spl_save_restore_data(void); + +/* + * spl_decompression_enabled() - check decompression support is enabled for SPL build + * + * Returns true if decompression support is enabled, else False + */ +static inline bool spl_decompression_enabled(void) +{ + return (IS_ENABLED(CONFIG_SPL_GZIP) || IS_ENABLED(CONFIG_SPL_LZMA)); +} #endif From patchwork Tue Jul 25 03:51:01 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Manoj Sai X-Patchwork-Id: 2944 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-yb1-f199.google.com (mail-yb1-f199.google.com [209.85.219.199]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 9E1983F37D for ; Tue, 25 Jul 2023 05:51:29 +0200 (CEST) Received: by mail-yb1-f199.google.com with SMTP id 3f1490d57ef6-cbcffb18afesf4701659276.2 for ; Mon, 24 Jul 2023 20:51:29 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1690257088; cv=pass; d=google.com; s=arc-20160816; b=W9mMoZ9CD2w2gp3gqqf7GIdaZgRgy72fb2i0q7OAKBKUyVeXSuDeX8aglw5swcwhx+ tYFgTktUe3r0nk1vzjNVQ40BP2KItxgYW4NHLylivXT4z1HgQKB0kl3wuKMkPq3yxz/D n40C8hoURGYT1MZ5iM1yTmZGFUyZ0RkA+ZmKs+NmKYpG6uyRmk3Niu/tWGu0W7/8aCA4 lHk2zoaUernMO3foFiBc3wS4FKP1mzjwPoVZC8Dy86wVva06rrnIgUM+iH8Ik+CtPA4E 5XUZIr7FgFpUZTHIXgw3si6pWWkzhab17ymqsJGZj8GsRUMO+L+yrNk7KZEPGdSencj2 sbIg== 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:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=1Kys+wblqTGpcDsjjUtHtQmBaF6hjO+Dmmh42z6Y/zM=; fh=ZtU/xXInpIejK4L8YauyoYBdqqK+nRzYacYy4t7Zzbc=; b=Xi2YXaCXNjRjwNOyJT1URcLuss0HJZiGenomAEE9XiVHh2oVt/fvhjG7x3RVZyeNaV JZmcPYZ5m0HhzIV0fpZT5NgZ66VOuXeY6xgd9RDaCxw8ljbEt8eF2Ym5kPjAspaa88oX 2DiRZsovRUr7sMySHfePCgga6sJEIM3DzZpTyScPlIw3rD9WYLhqLRhDBQZicaPY+AHv TD2w6Y684rR9dQwHZhEow1UehKM/Y4GdVFYFOg42YmSeC1n1o97i6e3luEh2y0GHNGe1 48Ep0tX1GUuTrwHQfiPxcNVmDGF97QNwwKiPKVNni5cW0nVTjOX8WxWm2Y/yTw2Owow0 RNqg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b="IQ9vT/fZ"; 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=1690257088; x=1690861888; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:x-original-authentication-results :x-original-sender:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=1Kys+wblqTGpcDsjjUtHtQmBaF6hjO+Dmmh42z6Y/zM=; b=lRJw5gln7vxPUC22YFTTsUdGjbgCE6NCo3sgaBvEwwVkG+sQtyx14/cXmNvvF6XuqK ulRK7EcEKi8dYCxz4VFalx1dr3C848ZH4iwayCot3dV4sGfsALgePznEKfzsUZbzPhll NBghAAkANeKV1c3gQ7jXZhavr4ImMWkDn2jN4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690257088; x=1690861888; 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: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=1Kys+wblqTGpcDsjjUtHtQmBaF6hjO+Dmmh42z6Y/zM=; b=VB8IQ4hBeuGDwid5DwqplvDLUY6Q6Ob4ovSsHo+2BGQ+kBhGpHN7AWJZ4j3ZCswDDe IfJXJ+pNWVtM15smrCoYeqoaGTn+t6AWDVau/TiEVG2OVLElJRJre1Sor0edqoEpRZDg 4xX+BxycFM1CWBro1tmyL/pSW+PebtELtFbnq2F82339eGDm3k7J/7m5YhltqowOSvgz xY/SK1aEWpYvIhI8hV72macBQ3xMIW2bhPYeM5RrrrMfN/b++Qulj246pkroHd6w0e3I ZZPKQPtdYqyd01ZPp5wUohq3BTAO02ciXfHTvZrzu8bhQiFV/2tRvTAMvWAOaiARHteT OESw== X-Gm-Message-State: ABy/qLb1i64i6Nd8nR8nIkrj6iv8gg4FtZurXsh6Kk5NjYFSYDpMd3PD bl9t86O6HSGEFgfIq+fxgJmjG0gf X-Google-Smtp-Source: APBJJlEMmX+3Mg1CJPjwrXQHlkq8A0aS4RySnp4v67wFTC8mHjPY6zoajOmbxCGRc7g3GGAS7aRorw== X-Received: by 2002:a5b:1c7:0:b0:c60:3ea7:2305 with SMTP id f7-20020a5b01c7000000b00c603ea72305mr8334091ybp.26.1690257088680; Mon, 24 Jul 2023 20:51:28 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a05:6902:124a:b0:cd0:61bf:eb6c with SMTP id t10-20020a056902124a00b00cd061bfeb6cls856162ybu.1.-pod-prod-09-us; Mon, 24 Jul 2023 20:51:28 -0700 (PDT) X-Received: by 2002:a0d:c9c5:0:b0:583:51de:e219 with SMTP id l188-20020a0dc9c5000000b0058351dee219mr7780019ywd.17.1690257087857; Mon, 24 Jul 2023 20:51:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690257087; cv=none; d=google.com; s=arc-20160816; b=pClreZcyGfDtP1mvnHQherFa1j6JI4X7s2i/GMHyIWCFzWWXUyefCJ979Un1oxiK8L +89lC4ejstVgiNCdgQN3UIN6+OxOHbIu+iVrpugqsCuWrY4mLxOnsJsOs/zGu3whlcRi sQxUcBzPExGwwUc2RECIL4RJpqJWOKsURip4zuf6RtTP1uxHz5l/rWqGA+ojA2qhzxW6 +AdmHvVssLBbfe4kVynilwYyRIGr42IDrWxxn07ySPt/TWzqr1p0ijCK1+HePMmNRoyP cCn5HK0vQzV1V3tP28KWTgPwe1dlf3qtroJGRsVYbQNVOOfqi0MBtkRxBYK0b9Nl9ABE YRTg== 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=VVvm8TQGzRMMrDOBUY2u6TjgURnLNSkn0nDML4vqTu0=; fh=ZtU/xXInpIejK4L8YauyoYBdqqK+nRzYacYy4t7Zzbc=; b=pzzzo3GL6seWSEESpEsUjpkVPYCo2WOpFkT2EbB/VXLXlWYJsbgC0zDzbCEygGN2gp WbfBD2bUguYhrnWS3+VxNmCiUQAfBxOp99/y+pLq+QNR2pb7x2hTUdluKget3ODcAbuV kuMAV3xxHZTbZjIy99rgFYQDDc58sqCLiH7ZcWoLzs+gVaGCpvxR1wEGCwIQA9xQZoma c070ppRm0OIa5RAdfscn+2l1DNXirePDmXHgPaPIhPF9H7oT8NzRJ5u+L9TtyNZviu39 CBKh14XSQnAnCM9l2qm6J91NTY3NY0eYCafYIp/pr1GY9yN/D4XRAKR+vgV9/3w8Fz5X V+Dw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b="IQ9vT/fZ"; 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 i185-20020a8191c2000000b0057000a48f13sor3005243ywg.1.2023.07.24.20.51.27 for (Google Transport Security); Mon, 24 Jul 2023 20:51:27 -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:a25:2f85:0:b0:d0a:7e3:fa0 with SMTP id v127-20020a252f85000000b00d0a07e30fa0mr5350203ybv.53.1690257087461; Mon, 24 Jul 2023 20:51:27 -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.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 Jul 2023 20:51:27 -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 4/4] spl: fit: support for booting a LZMA-compressed U-boot binary Date: Tue, 25 Jul 2023 09:21:01 +0530 Message-Id: <20230725035101.281325-5-abbaraju.manojsai@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230725035101.281325-1-abbaraju.manojsai@amarulasolutions.com> References: <20230630121146.513345-1-abbaraju.manojsai@amarulasolutions.com> <20230725035101.281325-1-abbaraju.manojsai@amarulasolutions.com> MIME-Version: 1.0 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="IQ9vT/fZ"; 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 Content-Type: text/plain; charset="UTF-8" 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: , If LZMA Compression support is enabled, LZMA compressed U-Boot binary will be placed at a specified RAM location which is defined at CONFIG_SYS_LOAD_ADDR and will be assigned as the source address. image_decomp() function, will decompress the LZMA compressed U-Boot binary which is placed at source address(CONFIG_SYS_LOAD_ADDR) to the default CONFIG_SYS_TEXT_BASE location. spl_load_fit_image function will load the decompressed U-Boot binary, which is placed at the CONFIG_SYS_TEXT_BASE location. Signed-off-by: Manoj Sai Signed-off-by: Suniel Mahesh Reviewed-by: Simon Glass --- common/spl/spl_fit.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/common/spl/spl_fit.c b/common/spl/spl_fit.c index d728ac71fc..208d2f761e 100644 --- a/common/spl/spl_fit.c +++ b/common/spl/spl_fit.c @@ -246,7 +246,7 @@ static int spl_load_fit_image(struct spl_load_info *info, ulong sector, debug("%s ", genimg_get_type_name(type)); } - if (IS_ENABLED(CONFIG_SPL_GZIP)) { + if (IS_ENABLED(CONFIG_SPL_GZIP) || IS_ENABLED(CONFIG_SPL_LZMA)) { fit_image_get_comp(fit, node, &image_comp); debug("%s ", genimg_get_comp_name(image_comp)); } @@ -280,8 +280,8 @@ static int spl_load_fit_image(struct spl_load_info *info, ulong sector, __func__, fit_get_name(fit, node, NULL)); return 0; } - - if ((IS_ENABLED(CONFIG_SPL_GZIP) && image_comp == IH_COMP_GZIP)) + if ((IS_ENABLED(CONFIG_SPL_GZIP) && image_comp == IH_COMP_GZIP) || + (IS_ENABLED(CONFIG_SPL_LZMA) && image_comp == IH_COMP_LZMA)) src_ptr = map_sysmem(ALIGN(CONFIG_SYS_LOAD_ADDR, ARCH_DMA_MINALIGN), len); else src_ptr = map_sysmem(ALIGN(load_addr, ARCH_DMA_MINALIGN), len); @@ -329,6 +329,16 @@ static int spl_load_fit_image(struct spl_load_info *info, ulong sector, return -EIO; } length = size; + } else if (IS_ENABLED(CONFIG_SPL_LZMA) && image_comp == IH_COMP_LZMA) { + size = CONFIG_SYS_BOOTM_LEN; + ulong loadEnd; + + if (image_decomp(IH_COMP_LZMA, CONFIG_SYS_LOAD_ADDR, 0, 0, + load_ptr, src, length, size, &loadEnd)) { + puts("Uncompressing error\n"); + return -EIO; + } + length = loadEnd - CONFIG_SYS_LOAD_ADDR; } else { memcpy(load_ptr, src, length); }