{"id":2175817,"url":"http://patchwork.ozlabs.org/api/1.0/patches/2175817/?format=json","project":{"id":18,"url":"http://patchwork.ozlabs.org/api/1.0/projects/18/?format=json","name":"U-Boot","link_name":"uboot","list_id":"u-boot.lists.denx.de","list_email":"u-boot@lists.denx.de","web_url":null,"scm_url":null,"webscm_url":null},"msgid":"<20251218233654.3938385-2-trini@konsulko.com>","date":"2025-12-18T23:30:56","name":"[PATCHv1,1/3] lzma: Add Kconfig options to optimize for size","commit_ref":"e7797f450ad26bca32c12ae55e3d43438b74f910","pull_url":null,"state":"accepted","archived":false,"hash":"a1d39dc22ddb77c8706f2ea73cbe4bbec733968a","submitter":{"id":65875,"url":"http://patchwork.ozlabs.org/api/1.0/people/65875/?format=json","name":"Tom Rini","email":"trini@konsulko.com"},"delegate":{"id":3651,"url":"http://patchwork.ozlabs.org/api/1.0/users/3651/?format=json","username":"trini","first_name":"Tom","last_name":"Rini","email":"trini@ti.com"},"mbox":"http://patchwork.ozlabs.org/project/uboot/patch/20251218233654.3938385-2-trini@konsulko.com/mbox/","series":[{"id":485932,"url":"http://patchwork.ozlabs.org/api/1.0/series/485932/?format=json","date":"2025-12-18T23:30:55","name":"lzma: Update to 25.01 release of LZMA SDK","version":1,"mbox":"http://patchwork.ozlabs.org/series/485932/mbox/"}],"check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/2175817/checks/","tags":{},"headers":{"Return-Path":"<u-boot-bounces@lists.denx.de>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@legolas.ozlabs.org","Authentication-Results":["legolas.ozlabs.org;\n\tdkim=pass (1024-bit key;\n unprotected) header.d=konsulko.com header.i=@konsulko.com header.a=rsa-sha256\n header.s=google header.b=HHKtsSGt;\n\tdkim-atps=neutral","legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de\n (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de;\n envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org)","phobos.denx.de;\n dmarc=pass (p=none dis=none) header.from=konsulko.com","phobos.denx.de;\n spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de","phobos.denx.de;\n\tdkim=pass (1024-bit key;\n unprotected) header.d=konsulko.com header.i=@konsulko.com\n header.b=\"HHKtsSGt\";\n\tdkim-atps=neutral","phobos.denx.de;\n dmarc=pass (p=none dis=none) header.from=konsulko.com","phobos.denx.de;\n spf=pass smtp.mailfrom=trini@konsulko.com"],"Received":["from phobos.denx.de (phobos.denx.de\n [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4dXRsQ1LwXz1xty\n\tfor <incoming@patchwork.ozlabs.org>; Fri, 19 Dec 2025 10:37:14 +1100 (AEDT)","from h2850616.stratoserver.net (localhost [IPv6:::1])\n\tby phobos.denx.de (Postfix) with ESMTP id A62E98309A;\n\tFri, 19 Dec 2025 00:37:04 +0100 (CET)","by phobos.denx.de (Postfix, from userid 109)\n id DC36F83710; Fri, 19 Dec 2025 00:37:01 +0100 (CET)","from mail-oa1-x35.google.com (mail-oa1-x35.google.com\n [IPv6:2001:4860:4864:20::35])\n (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits))\n (No client certificate requested)\n by phobos.denx.de (Postfix) with ESMTPS id 74273836A3\n for <u-boot@lists.denx.de>; Fri, 19 Dec 2025 00:36:59 +0100 (CET)","by mail-oa1-x35.google.com with SMTP id\n 586e51a60fabf-3f5c9275b31so747746fac.0\n for <u-boot@lists.denx.de>; Thu, 18 Dec 2025 15:36:59 -0800 (PST)","from bill-the-cat.. (fixed-189-203-103-235.totalplay.net.\n [189.203.103.235]) by smtp.gmail.com with ESMTPSA id\n 586e51a60fabf-3fdaab5ccb9sm449605fac.10.2025.12.18.15.36.57\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Thu, 18 Dec 2025 15:36:57 -0800 (PST)"],"X-Spam-Checker-Version":"SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de","X-Spam-Level":"","X-Spam-Status":"No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED,\n DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED,\n SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=konsulko.com; s=google; t=1766101018; x=1766705818; darn=lists.denx.de;\n h=content-transfer-encoding:mime-version:references:in-reply-to\n :message-id:date:subject:cc:to:from:from:to:cc:subject:date\n :message-id:reply-to;\n bh=iKAxKj5LoBPRCCu2ngsT/CSQv4EloClSMlWNBL52PnA=;\n b=HHKtsSGtM2pTe+SBaGncD7SGIz/EliUEzx+TtxuUHBCvZjW6jI6w8ZUd20ndhMVuvW\n KfxAPNLo2QP4+B05KgQQrD+omxTOxv9TUOKkFa+ylUPDL/jyrBFJ5UjtctbJ70JeB+/E\n zEW1Iql37TdRlgYik+3Z2bc55vLDogNfJ1IMQ=","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20230601; t=1766101018; x=1766705818;\n h=content-transfer-encoding:mime-version:references:in-reply-to\n :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from\n :to:cc:subject:date:message-id:reply-to;\n bh=iKAxKj5LoBPRCCu2ngsT/CSQv4EloClSMlWNBL52PnA=;\n b=QvQiCQMisVvDWgsBmeoehb4LIItNx5pBrBEyV9ASi5s1luyL6TQfJdqZC8/dwn937v\n X8uJnZDBgUQRGjcl+wm6vXOpipuubr3avBIsiBccSMEUAOyju8mZtwCurmPHLDLw+6/J\n NfU0f01dDM6fNZ42/a2F9ADHTxPWadbLUitOkuX8PB1gXsPBEoZz/gHJZQ5Ler9Hzwqi\n n7M/yAOTp2bbRF/W7jUFede27Q97MFAAtjW0xZlfgm5BYlvUvM9C1dzXAiRh32Jj2exy\n SsCobq3zwsGyr4Fwp58S1U/yTNlSwgrPijdpU8S612zM5lkrDhqBdcQgvcS4N7538wa4\n 8y6Q==","X-Gm-Message-State":"AOJu0YwiKe8IUyAeS0sX42v5JIK90gOUDimfeIVedB3LVJuB5HJDUtyO\n 9Bez961NktxIEjjFj7H6O5oY/CJHtePKS5gS1Mc1QHM58yGywfNOqTjrGmoE1Ism/lFaRnLq2Bl\n o5kVEjdc=","X-Gm-Gg":"AY/fxX46IQUi5YtvFLtuDMKdesoaDa/BJiCET6HKjLPS6oIGtl/7wDFo5z6jYl9Vs0o\n fkHjE5VfUdpShNLUZSBXtGS/6NPp4hutUktH8DKGNCDTOBlGPe8iG9lbeXknaa25rp1l+TH8M94\n bBskPKh9N+Q1zMv548YfcCOKGLpGEAr6Q//gH7foWLyS07aWqANTEGywJhiC2+MDY4xWBuBQSfn\n 2bOYSCxwYpQIr85s0B3EJe5RMxhQBvgAwJHH6YDhkKblhmgt+/F/0P20/yP61Tgt8wTOsI8qqg8\n 1u5hTFY2bRIkRQw+QbW9pAN1exZmi+uRBrGW5HkdiDFaDt/QdIvi4E2+3bAypNvLSLtyUfewaRM\n hQW41J4HyyvC+o7Nyfh7lN88MRg1w565nDW+VPviyJowAsRxH+LyZj7cR0CpDJSsMm46Wsr7BQ/\n zo99mZp0Jv0OTYXN1BaHMJhgnuCI/recl/PVGJu+Aj6cdMzvQIsPbi","X-Google-Smtp-Source":"\n AGHT+IFjt8CNjrwKmpWZdDonWrUrWFJ6XvUPb7tr0XIKHp+r0WTQfIlUgadOHl4nULyk6pjxjOKQ0A==","X-Received":"by 2002:a05:6871:6681:b0:3f5:b16e:82c6 with SMTP id\n 586e51a60fabf-3fda547c27amr748916fac.52.1766101018086;\n Thu, 18 Dec 2025 15:36:58 -0800 (PST)","From":"Tom Rini <trini@konsulko.com>","To":"u-boot@lists.denx.de","Cc":"Darek <x64x6a@gmail.com>,\n\tStefan Roese <stefan.roese@mailbox.org>","Subject":"[PATCHv1 1/3] lzma: Add Kconfig options to optimize for size","Date":"Thu, 18 Dec 2025 17:30:56 -0600","Message-ID":"<20251218233654.3938385-2-trini@konsulko.com>","X-Mailer":"git-send-email 2.43.0","In-Reply-To":"<20251218233654.3938385-1-trini@konsulko.com>","References":"<20251218232255.3934258-1-trini@konsulko.com>\n <20251218233654.3938385-1-trini@konsulko.com>","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","X-BeenThere":"u-boot@lists.denx.de","X-Mailman-Version":"2.1.39","Precedence":"list","List-Id":"U-Boot discussion <u-boot.lists.denx.de>","List-Unsubscribe":"<https://lists.denx.de/options/u-boot>,\n <mailto:u-boot-request@lists.denx.de?subject=unsubscribe>","List-Archive":"<https://lists.denx.de/pipermail/u-boot/>","List-Post":"<mailto:u-boot@lists.denx.de>","List-Help":"<mailto:u-boot-request@lists.denx.de?subject=help>","List-Subscribe":"<https://lists.denx.de/listinfo/u-boot>,\n <mailto:u-boot-request@lists.denx.de?subject=subscribe>","Errors-To":"u-boot-bounces@lists.denx.de","Sender":"\"U-Boot\" <u-boot-bounces@lists.denx.de>","X-Virus-Scanned":"clamav-milter 0.103.8 at phobos.denx.de","X-Virus-Status":"Clean"},"content":"Currently, our LZMA library has an option for optimizing for size,\nrather than speed. It is a minimal savings today, and has not been worth\nenabling. As this will change in the near future, add options now to\nallow disabling it in full U-Boot or in SPL, and enable these on\ngardena-smart-gateway-mt7688 which is very close to the size limit\ntoday.\n\nSigned-off-by: Tom Rini <trini@konsulko.com>\n---\nCc: Stefan Roese <stefan.roese@mailbox.org>\n---\n configs/gardena-smart-gateway-mt7688_defconfig |  2 ++\n lib/Kconfig                                    | 14 ++++++++++++++\n lib/lzma/Makefile                              |  1 +\n 3 files changed, 17 insertions(+)","diff":"diff --git a/configs/gardena-smart-gateway-mt7688_defconfig b/configs/gardena-smart-gateway-mt7688_defconfig\nindex 3c2bcc6a3c44..aba8a2ffd1de 100644\n--- a/configs/gardena-smart-gateway-mt7688_defconfig\n+++ b/configs/gardena-smart-gateway-mt7688_defconfig\n@@ -101,4 +101,6 @@ CONFIG_MT7621_SPI=y\n CONFIG_WDT=y\n CONFIG_WDT_MT7621=y\n CONFIG_LZMA=y\n+CONFIG_LZMA_SIZE_OPTIMIZATION=y\n CONFIG_SPL_LZMA=y\n+CONFIG_SPL_LZMA_SIZE_OPTIMIZATION=y\ndiff --git a/lib/Kconfig b/lib/Kconfig\nindex fe0b878a206b..96032eaddf95 100644\n--- a/lib/Kconfig\n+++ b/lib/Kconfig\n@@ -838,6 +838,13 @@ config LZMA\n \t  ratio and fairly fast decompression speed. See also\n \t  CONFIG_CMD_LZMADEC which provides a decode command.\n \n+config LZMA_SIZE_OPTIMIZATION\n+\tbool \"Optimize the LZMA algorithm for smaller binary size\"\n+\thelp\n+\t  This enables building the LZMA library optimized for size, rather\n+\t  than performance. This can be a loss of 15-20% in decompression\n+\t  speed, but a savings of close to two kilobytes in many cases.\n+\n config LZO\n \tbool \"Enable LZO decompression support\"\n \thelp\n@@ -932,6 +939,13 @@ config SPL_LZMA\n \thelp\n \t  This enables support for LZMA compression algorithm for SPL boot.\n \n+config SPL_LZMA_SIZE_OPTIMIZATION\n+\tbool \"Optimize the LZMA algorithm for smaller binary size in SPL\"\n+\thelp\n+\t  This enables building the LZMA library optimized for size, rather\n+\t  than performance. This can be a loss of 15-20% in decompression\n+\t  speed, but a savings of close to two kilobytes in many cases.\n+\n config TPL_LZMA\n \tbool \"Enable LZMA decompression support for TPL build\"\n \tdepends on TPL\ndiff --git a/lib/lzma/Makefile b/lib/lzma/Makefile\nindex c2fd3e494541..b8ad570ab1c2 100644\n--- a/lib/lzma/Makefile\n+++ b/lib/lzma/Makefile\n@@ -7,5 +7,6 @@\n # Wolfgang Denk, DENX Software Engineering, wd@denx.de.\n \n ccflags-y += -D_LZMA_PROB32\n+ccflags-$(CONFIG_$(PHASE_)LZMA_SIZE_OPTIMIZATION) += -D_LZMA_SIZE_OPT\n \n obj-y += LzmaDec.o LzmaTools.o\n","prefixes":["PATCHv1","1/3"]}