From patchwork Fri Jan 19 20:12:43 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Marangi X-Patchwork-Id: 13524139 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 4D861C4725D for ; Fri, 19 Jan 2024 20:14:42 +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:Message-ID:Date:Subject:To :From:Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=O5bfLZvijFs9OmHN2UCmo0doyxW5TXk8p/2Abzl+LJ4=; b=VugGCb2EUcfGyI RD102xbx6mbkI3kYELQDikpiX0SH8d+OCRXJVpgvEk+oLC5864O0NvQ+SDWQYF3BqgeScP4Fk6DsA KQPKPKkahZ764Dwo++metwx55BMo7Cm905jrWp6dJSas9mw7s16Ssb5H6AjUEvmzkykz0KmxgN3To +m1TwX4bubKK0GdGyMw3zHC0Ip7qwY8SmZ52TVMUYCRItTftFUDEMn4uvsllnadUIIkvbbxV/v027 fX11bu0U8hOHLfUMPd7WHb5lAgasf07GlG1yyG0wywkG0osr3c2Za0MrtY0JBLLLtBFa6mNc7T9lg 1EwYMq+e77NCUw0neMgg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rQvFn-006XfA-1J; Fri, 19 Jan 2024 20:14:15 +0000 Received: from mail-wr1-x429.google.com ([2a00:1450:4864:20::429]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rQvFj-006Xd8-2g for linux-arm-kernel@lists.infradead.org; Fri, 19 Jan 2024 20:14:13 +0000 Received: by mail-wr1-x429.google.com with SMTP id ffacd0b85a97d-337d05b8942so1157650f8f.3 for ; Fri, 19 Jan 2024 12:14:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1705695248; x=1706300048; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:from:to:cc:subject:date:message-id:reply-to; bh=mMGLhwG85B2w0NThmk2zDLj49Bo1ipFv4zuCwGP7AlE=; b=h8lr6VSVqYJu8GLth8LUHGg+hpPtchGYGjK2RY/Z5TADx+VqrjLYg1xfkCVR1ug66/ 8/q66PIIVLlS6Lsm4oOyOq3pq3C5FOtLhQ3VHbbe7tvQ1/0luRDNAv7Kn4G5fGIIGiiL rfTLtFcORrb6mYIeDD2/aO0S7koe5a12QcnQ7DC6CwQSlg9rddzNF4PmgmTky2Oxs17g +v6vTY1vel7BQyHfBFHUvXnQsxPsK7YkYKu8DCUJ7zjd9IIkgCWxmVxuEJnAXwT256Ez EOA9WZoQIF1W94wpBKy1lEX0t8FiuGef9WidhKVcP2uXdTYlDbKiJfgXZYVDSPcIwn/V 6YTg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705695248; x=1706300048; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=mMGLhwG85B2w0NThmk2zDLj49Bo1ipFv4zuCwGP7AlE=; b=gSu9rQFoLvIlRidWjuNKGeL6QBpypTY6TElYe+EM7wosKgxXb9cNjWWW9mr+wLfegR PNYzMUZ0laqLcb+e8D7vYElE4swK9F8ymiTMmSLJqLYKyRtomGryxiiI7PxoFrYTfGLg PHbBwPVpWeQlNBGIm3H2BPw9mguqAM3IfbllJjSRQ1e6ONIb/4cqHO4LA+s4v9+OYOBl i4gqtRAu0npD0eif8CjRw5ILU/DL05ILk6CJUtUcKZVoJGPJ4BZ9m67MUz45+xq3B0Kq xSeWhYUjculZniTjvf08D9qnBgPU/Bkl/68h3vJ2QCVzPNDaxp+AUbjsa1i/qjTf+HPt iGcg== X-Gm-Message-State: AOJu0YzBL/HSdNjvdOSQS3rkhFzG0vbyTL1/GM5Vjhl5YorbOzy1OF7t rUcjXImyyk1hYGpQ+MwWVQzprpDTGE2UZIr/557/Tw6NgIlVl8CMhYXXvzO5 X-Google-Smtp-Source: AGHT+IGKrhhaNGUIfdV8IaXzr4TapkJavnd/VbMPYmXsGgBSUz+zxWC9LbIaz64fEZkqwJmRKMggPQ== X-Received: by 2002:a5d:4903:0:b0:337:bc26:5d43 with SMTP id x3-20020a5d4903000000b00337bc265d43mr152768wrq.4.1705695248319; Fri, 19 Jan 2024 12:14:08 -0800 (PST) Received: from localhost.localdomain (93-34-89-13.ip49.fastwebnet.it. [93.34.89.13]) by smtp.googlemail.com with ESMTPSA id q5-20020adff505000000b00339214d70b5sm2084788wro.85.2024.01.19.12.14.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Jan 2024 12:14:07 -0800 (PST) From: Christian Marangi To: Russell King , Arnd Bergmann , Andrew Morton , Geert Uytterhoeven , "Kirill A. Shutemov" , Jonathan Corbet , Thomas Gleixner , Randy Dunlap , Christian Marangi , "Mike Rapoport (IBM)" , Eric DeVolder , Nathan Chancellor , "Russell King (Oracle)" , Kees Cook , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Bjorn Andersson , Konrad Dybcio , Linus Walleij , John Crispin Subject: [PATCH 0/2] ARM: decompressor: support AUTO_ZRELADDR and appended DTB Date: Fri, 19 Jan 2024 21:12:43 +0100 Message-ID: <20240119201356.7903-1-ansuelsmth@gmail.com> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240119_121411_869632_9D415E48 X-CRM114-Status: GOOD ( 17.72 ) 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org This series try to address a long lasting problem with legacy device that require an appended DTB and the use of AUTO_ZRELADDR. With these device AUTO_ZRELADDR is not possible if for some reason at the start of the RAM it's needed to reserve some space. (example qcom SoC that allocate reserved space for SMEM) In the current implementation with appended DTB and AUTO_ZRELADDR, the memory start is only derived from the PC register and it can't be changed by declaring additional info in the DTS. In a normal setup, we have an intentional undocumented chosen property to handle this and the memory node to declare the start of the memory. With this applied and ARM_ATAG_DTB_COMPAT_IGNORE_MEM enabled (more info in the related patch) ipq806x can boot right away with AUTO_ZRELADDR enabled and a correct memory node defined in DTS. It's needed to ignore MEM ATAGs as most of the time the values from the bootloader are hardcoded and OEM didn't care to actually provide them resulting in funny situation where a Netgear R7800 with 512Mb of RAM have Uboot passing 1.7GB of RAM with ATAGS. I'm open to any suggestion on how this can be improved and I would love some additional testing on other legacy platform but I assume this will permit many legacy device to be correctly supported without having to hardcode address. Christian Marangi (2): ARM: decompressor: support memory start validation for appended DTB ARM: decompressor: add option to ignore MEM ATAGs arch/arm/Kconfig | 12 ++++++++++++ arch/arm/boot/compressed/atags_to_fdt.c | 10 ++++++++++ arch/arm/boot/compressed/head.S | 22 ++++++++++++++++++++++ 3 files changed, 44 insertions(+)