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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 59533C25B75 for ; Tue, 21 May 2024 06:51:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=G8BPYjar/UiGmmPbNkUtwJ5uh2Ygw8JhyKDm1IOiPrs=; b=fnq5bKotynvOEF sjsj78ksdIBmXeeWVfsq/aZVWoZQIvLLr+h80IHsHfCl/p6LMzqBh7kS7jK2hw/Zho+dDiBCMbYFH J8Odj7SXJqyAvGiXqD+yMF7DbP+MJDdnE9NePiYTUs44fPIFQXqUv/Lz+pVd1Jl1DHQ+wY7EWOEbm s/cx2ntMXcINziphQQlIStbypQ+xvi9knEkAVWgiOQoUDrTV2HcupsyjnGQ7xS4QC79EnLry4bnAr 9BOaVc1oPUhzXsdPEiTphFVkw2jZSIG/QTpwISRGir2Ghf9fNbjGj0y7AaeIhoeKiQ6BqEP0eJcxN Y6v5MGG0RqwAVSL3cWZg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1s9JLK-0000000GVuw-40qJ; Tue, 21 May 2024 06:51:26 +0000 Received: from mail-pl1-x632.google.com ([2607:f8b0:4864:20::632]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1s9JLD-0000000GVtF-1Q6q for linux-arm-kernel@lists.infradead.org; Tue, 21 May 2024 06:51:20 +0000 Received: by mail-pl1-x632.google.com with SMTP id d9443c01a7336-1edc696df2bso34255445ad.0 for ; Mon, 20 May 2024 23:51:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1716274279; x=1716879079; darn=lists.infradead.org; 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=vOkWGMmTQVEt7UvShsfEX9Q7OP2nXlbFbaBQoutTKvo=; b=FUCXp6l3G61jtT97LjeDY1gv7DccEFDD+VBVofP9EnsQH5CqO4PzuBkK+kKkwbDdVq HPHm+LD5JWU509o6FqS5moHrLVp9S7Zawg2SI5859ZSaibbCpmdFafzGGJzyXs9wBBaB DicdIQKlGZZWwRSwnEBea+El8kIdAd/MfLglI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716274279; x=1716879079; 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=vOkWGMmTQVEt7UvShsfEX9Q7OP2nXlbFbaBQoutTKvo=; b=YmmBl84ctv2I1ensOleaBJz5IwurP93mtpipHu+kTZLJMjdJEAZ5hJuJ+j9OXONjsR jSw7aY3XpWKGvdAOFJfPtabV4mxt7d6k7qVjN5JYDuKBFaWn6BgNqljqn80olCGkhMq1 dI5Tncj8Fr4YGUDql+S9LKylPrj7LiAYueZmzK364P3uALLk81RyNREquR3k8rLIv3+g jZ66iZLveV4Bly+L5LZOKC8L5P2V/igQgFj64hq23IufbEGlZmnYViPx0ETFkIoj4dr6 L0t+01KKvgiUjkgiXvE73OVtDM0ibD+27mF9c/RIDg+dQAsENr8qmBRUclF6An0sKFdm EpOg== X-Forwarded-Encrypted: i=1; AJvYcCXFVZSfoYVfS5KMN0dC+dBKmfZ5xAcD2+HZTtPuXsv2gFWm3mrNfk/DdGO40KjViNQBN8af8LoLdkOtuQkq7g7RDDNfylLaiiPSh8ilBNHqPKaWh5E= X-Gm-Message-State: AOJu0YyRnPv8n06ConGRBc4IzHT2VTTu8nKOLsNgdjbjT1nkoEWBHEAi UK+6sCWMGTS/a7RD3j9GVUmioj3iJFi8YdwE6hbo6H+dqI5okn/VeJeO7B/5QQ== X-Google-Smtp-Source: AGHT+IEe1eZFm8OQhme98CfuDT2vPG0NOgmo3lGuwwSKsHDgjQxj8mKdLiIdPioZKeAtoWh2bQX69g== X-Received: by 2002:a05:6a21:998d:b0:1b1:d823:3ea2 with SMTP id adf61e73a8af0-1b1d8233f35mr6544797637.12.1716274278853; Mon, 20 May 2024 23:51:18 -0700 (PDT) Received: from wenstp920.tpe.corp.google.com ([2401:fa00:1:10:f8a5:77aa:5a0d:e30c]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-1f30644ad48sm23100985ad.169.2024.05.20.23.51.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 May 2024 23:51:18 -0700 (PDT) From: Chen-Yu Tsai To: Simon Glass , Masahiro Yamada , Nathan Chancellor , Nicolas Schier Cc: Chen-Yu Tsai , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-kbuild@vger.kernel.org Subject: [PATCH 2/2] scripts/make_fit: Add option to disable compression for DTBs Date: Tue, 21 May 2024 14:51:05 +0800 Message-ID: <20240521065107.30371-3-wenst@chromium.org> X-Mailer: git-send-email 2.45.0.215.g3402c0e53f-goog In-Reply-To: <20240521065107.30371-1-wenst@chromium.org> References: <20240521065107.30371-1-wenst@chromium.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240520_235119_399672_88DEA500 X-CRM114-Status: GOOD ( 16.65 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Old bootloaders found on RK3399 and MT8173 based Chromebooks only support compression for the kernel image in the FIT image, and not the DTBs. While compression could be disabled, aforementioned bootloaders also limit the kernel image size to 32 MiB, making compression necessary for any practical setup. Add an option to disable DTB compression to support this case. Signed-off-by: Chen-Yu Tsai --- scripts/Makefile.lib | 1 + scripts/make_fit.py | 11 ++++++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib index 9f06f6aaf7fc..84d9b0166cc0 100644 --- a/scripts/Makefile.lib +++ b/scripts/Makefile.lib @@ -522,6 +522,7 @@ quiet_cmd_fit = FIT $@ cmd_fit = $(MAKE_FIT) -o $@ --arch $(UIMAGE_ARCH) --os linux \ --name '$(UIMAGE_NAME)' \ $(if $(findstring 1,$(KBUILD_VERBOSE)),-v) \ + $(if $(FIT_DISABLE_DTB_COMPRESSION),--no-dtb-compression) \ --compress $(FIT_COMPRESSION) -k $< @$(word 2,$^) # XZ diff --git a/scripts/make_fit.py b/scripts/make_fit.py index 263147df80a4..626cf3422079 100755 --- a/scripts/make_fit.py +++ b/scripts/make_fit.py @@ -22,6 +22,10 @@ the entire FIT. Use -c to compress the data, using bzip2, gzip, lz4, lzma, lzo and zstd algorithms. +Use -C to disable compression for DTBs regardless of the setting of '-c'. +This is intended for old bootloaders that support compression of the +kernel image but not the devicetree blobs. + The resulting FIT can be booted by bootloaders which support FIT, such as U-Boot, Linuxboot, Tianocore, etc. @@ -64,6 +68,8 @@ def parse_args(): help='Specifies the architecture') parser.add_argument('-c', '--compress', type=str, default='none', help='Specifies the compression') + parser.add_argument('-C', '--no-dtb-compression', action='store_true', + help='Disables compression for included DTBs') parser.add_argument('-E', '--external', action='store_true', help='Convert the FIT to use external data') parser.add_argument('-n', '--name', type=str, required=True, @@ -247,7 +253,10 @@ def build_fit(args): if os.path.splitext(fname)[1] == '.dtb': seq += 1 size += os.path.getsize(fname) - model, compat = output_dtb(fsw, seq, fname, args.arch, args.compress) + compress = args.compress + if args.no_dtb_compression: + compress = 'none' + model, compat = output_dtb(fsw, seq, fname, args.arch, compress) entries.append([model, compat]) finish_fit(fsw, entries) -- 2.45.0.215.g3402c0e53f-goog _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel