Received: by 2002:ab2:6816:0:b0:1f9:5764:f03e with SMTP id t22csp2898871lqo; Mon, 20 May 2024 23:52:14 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWkha3XBHur0wrROWvLGfvK2K5oihu6wupcd+iH47cVBDKgM0elOWRhbMUq3/9kO7Zpi6eB+YBTHaCPfXmuyQydgIyGcaLn+sEiW/Fb7w== X-Google-Smtp-Source: AGHT+IGrN2OQhvVTJmjwhAKdIu67AepNpj+f+DKkaZq4pdVY4TVNbxQTPYzwkIGl18hOcOAL3ihR X-Received: by 2002:a05:620a:4416:b0:792:d2aa:5d1 with SMTP id af79cd13be357-792d2aa069cmr3250727485a.34.1716274334625; Mon, 20 May 2024 23:52:14 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716274334; cv=pass; d=google.com; s=arc-20160816; b=CWQf6/s7up+kY+1O9hTZekWK8EocePPf63GOAH1McbS3raawXexLBuO80xY6UtuENk g2abraoslVeAC4LnU5dspRCBRxJYrvOz5k6866SXbA8fBihyCEjA1q9jVLeOz6qwp6cV djKmbBAoYcWM/hmZfbm9PTh4RlFOkL9KiValQ2l+mwjMOb8vBjkJDdeUf+UCXvlJ96ZM nlrPVDeZcncwLgg7mquHPx3WuYwRVbCeeVuXeyiijY/zisFXK0VWSm3XnQclViT9s1vb o2PKDGVhq4/NRKIpdbHojuS8XYhGCxIurYciRJ9ODNavC6C7X4t2AyCYeloTc2rn6PK+ XfEg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=vOkWGMmTQVEt7UvShsfEX9Q7OP2nXlbFbaBQoutTKvo=; fh=XLgtmaQ/1tmRIofhqK8b0PvNiDcqxAsNjH0Cntt2rYc=; b=WV6niOS5dukvtnt3Up0zrq+TXCxVrCT2JmPnxxjCOecUOqLsDmBu3X1vAgxVMP0Iu9 fXdvx61ueyA5aAYqnMLRo7vIiproXAeTMtL5f7xQlHbjAok0cvX1uJ3APO+Z6Z5Igrnv gzaolLEbn/Td99Z5TLcF/g0JxUhz9SfvpVFa3SDJIMNRxP89Fjs48P3B56wzYgoS/emA 26WG9Mlp0tR/FT/ncUHuNFl/nZA4nYnVuaQOWx2JCxhmSyi5n7i5ALN8wTUKQMHDw4ht ftR1EHX1OkUkP70KlB9EnQA1Z5I2xuoQftlAUNMw+f6xJAHdTgH285rVkIOHcW364cVV 1i2w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=mPHjtAxr; arc=pass (i=1 spf=pass spfdomain=chromium.org dkim=pass dkdomain=chromium.org dmarc=pass fromdomain=chromium.org); spf=pass (google.com: domain of linux-kernel+bounces-184535-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-184535-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id af79cd13be357-792bf29a30fsi143473485a.214.2024.05.20.23.52.14 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 May 2024 23:52:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-184535-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=mPHjtAxr; arc=pass (i=1 spf=pass spfdomain=chromium.org dkim=pass dkdomain=chromium.org dmarc=pass fromdomain=chromium.org); spf=pass (google.com: domain of linux-kernel+bounces-184535-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-184535-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 45BB61C20A19 for ; Tue, 21 May 2024 06:52:13 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8656953399; Tue, 21 May 2024 06:51:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="mPHjtAxr" Received: from mail-pl1-f170.google.com (mail-pl1-f170.google.com [209.85.214.170]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 83F3E51C30 for ; Tue, 21 May 2024 06:51:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.170 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716274281; cv=none; b=fM7V9haVojhTtmkZTQ1yaMD9+xtP9WVH8Z2HqaavRftaoW+Jt3/OF28lxBYzw5/J9cbtacTY7ddHql2ImaAoxgyPPpNHME7YP+blAyC7KJF93mDLQyb6luSonYyJpxiEe3gV3vunOu+fFI3qUcMqre9lUuObCXI9NO96JrsYaug= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716274281; c=relaxed/simple; bh=OH4cLngpr688D6c6flc0xYeuNkIFvmRIGHw0APLbxfU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=RqfsgtBKsSGpKVciE6yKl7Pjj4h6WZk8mWXa3QViwAhRs06sLdNLDBWLFO56j25En0bwIyGxCQLD6MYLGXDduJ9/t0c8LPRtmwBtJNbPlRVfaPsISSwddJU2oT7FmdNsYA9ryRAFkSDL0/NkSZ7Z6RdJytM4jGswOVopD1fp/+Q= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=mPHjtAxr; arc=none smtp.client-ip=209.85.214.170 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Received: by mail-pl1-f170.google.com with SMTP id d9443c01a7336-1ed0abbf706so30538905ad.2 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=vger.kernel.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=mPHjtAxrxDL2UF6NtlHhTc8chXwN6GdzHjoecsCaQg41uxN5ztOYmcZLbjzNRWuNIS DOQvYYjUa6mFMNcdklStrv0BYe9yg85cQ3+Nu9yCnvk7G2VJsvJ9QIa9T6UcuTYYClBA WumyskxqVLCSfWzfrbwvZdaBn/pngV+DBCwIw= 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=L/rh9xJJM92X377RzGvr1qrRb3IhsSzygka3JOJbvWZ7VXuGRN0GNqntWQFZ1fpmz2 0o/p1z0a3Kg4s54q65q5hql7+kaPlImO4aZfC9kDKIsh60aKX7XHMAP1JQBOazR7T/ur IUwEtNh4syBjHN3BmFrtAqQVtGqkMvTIR06u7MdUmoIiMUfJgIyunQSysRi5TEAjhQlb Vb4MTj+jpwd8ThM5KQOkU0ZmMN95iKP0mZ7G57nWCrcEVxa4RljwA1UlF5v1Tl5A6PN6 fJVnBX+hWVdET9/CiI1RcwR7OWr0YC4qt5pL7rgX1+jix5HybiuMuUzxKdx5G1L2xCFr ViiA== X-Forwarded-Encrypted: i=1; AJvYcCVOyipmkD6fAXojE0MYehSp2r4slGcEwXPKXWDhCxqfpKSKja68v6qqXksQwX+Qm4UwJ1N00dg8W84+mTuGiKpmvNZxYn/2cT8JOr84 X-Gm-Message-State: AOJu0YzgK6XWicqyz6hYyxQpsseCAof7yXnGg8THDUENqupasTOu+fDz 90UDopZBPAc+KfNDWiBlOh/zx33HCBI7bo/9zr7nf9P1DpdNUkDgIDRVvZRuJ754hrIv1VUIcLc = 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> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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