Received: by 2002:a05:7412:ba23:b0:fa:4c10:6cad with SMTP id jp35csp2216990rdb; Sun, 21 Jan 2024 12:30:34 -0800 (PST) X-Google-Smtp-Source: AGHT+IFytNSAe1afTP48YCnKwD7KKKWr3nYXRRr/x8Ipj19k/BSEpgQLkBSRONU5Uj7iCt/O8c25 X-Received: by 2002:a05:6808:1488:b0:3bd:a1ec:e5ee with SMTP id e8-20020a056808148800b003bda1ece5eemr3829895oiw.19.1705869033844; Sun, 21 Jan 2024 12:30:33 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1705869033; cv=pass; d=google.com; s=arc-20160816; b=UKgbOncNoB478L00fjk7dY/JVu6ApHrYLu8/3iA+ZJu0G+doPm6BH/wadS5HsnP+Fz +59ToRG8qkEp3E+8bBkjGWmNh0JUnDnwNArRkmJHYZrCjStp1SkFYB6bp8+zbtoboRDD 6YgdBCkjiN1gOVYdgvfzSOACbqPok3Sys2+rRBODgGTnEt0NdY6bJZym209Gg5/TrLdH XIUB6xfxS9nXQJbVj9nKTf9YNPtun5T8wsWNZvQk2m/lCB/8DodbozOgfA1E/zF1jRR7 PgGKXY/mIp0qqaaZAeQhBQzPozlTD9U7W4xttXg/X4aKrIBc8sIHAHl84tPdD0tposPN zRSg== 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:message-id:date:subject:to:from :dkim-signature; bh=4kWLX6UP/f8j7PC87iA+ocN+7ezu0AHr8NQjFXggguQ=; fh=8W6oR0xuLQV+BWL/p2seEhiW5fxTUbYjGlVe63WkZwo=; b=oFUqNZrDRr7BjuQviTEAtFbOg6ObypPmJJ5Ly+QCBbnhwYaslPUwE3Mdw4usgIcafM kOAe9FIMaqhT6+0zHo2cxgvVpmnzb5tfesk6Qy5ktUtyx1wANyjAUJDZp9ga+4ahqV/D EzYj6aC18MQQs8H31jS3zaSPePzKVChkB9SXIIyDVWsgV+k7mAam2LSWh0MKNhY2Be57 s9v99vrouROGwLMn/cvzBbfD3AWE+VbsGlG0sh3gnFvnvnO11eC88qVgQ1zMs6P+zDWF iEwWv5oIB50zs44FBXgZNLzSfG+hhK7FKCS4msqvYTJy39aY23K/mBwMIPa9WN4vJuMX y4YQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=IAXNAELt; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-32180-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-32180-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id d18-20020a170902b71200b001d7313028e5si2791667pls.430.2024.01.21.12.30.33 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 21 Jan 2024 12:30:33 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-32180-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=IAXNAELt; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-32180-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-32180-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com 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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 667D6281D2E for ; Sun, 21 Jan 2024 20:30:33 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id BF89D383A3; Sun, 21 Jan 2024 20:30:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="IAXNAELt" Received: from mail-wm1-f48.google.com (mail-wm1-f48.google.com [209.85.128.48]) (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 65271111E for ; Sun, 21 Jan 2024 20:30:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.48 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705869026; cv=none; b=SKXvEdP1pY581IUj8Z6VT0BLKi/Ykq7ods8lKBQYW6nq294A35W8C/rlaWIhwR5aE669pZUpcWDSrypOl60AEIsbTFu7Vm4AGsIzmRpXOpZmajy9+GAI98MXivjf/PvJDcj7RBxWlXHkkFu7qbJnTGj6moGsw+hQjBTjt6ZHEjA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705869026; c=relaxed/simple; bh=2/1fsYmKDZN1wvsh6DuQbpj2D7/RgQxj/Mhh3EyrEQQ=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=HXqzJdYmwsww8TQ/s1xtDCWr7rYJUsnVLBG6oVucy+ZwUw8Jj5ZQLpLtBBSINr7hyWfoCv94NQgmuedLVtlG2dzHhaXAwuMcI2mvCpBX/Pkxj/R0jgozOMp57GHHKGNe09wHNs/dJCwSJk2lPILZ1exfANhznBLTGLsNFiO6wo4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=IAXNAELt; arc=none smtp.client-ip=209.85.128.48 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-wm1-f48.google.com with SMTP id 5b1f17b1804b1-40e5afc18f5so28919335e9.3 for ; Sun, 21 Jan 2024 12:30:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1705869023; x=1706473823; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:from:to:cc:subject:date:message-id:reply-to; bh=4kWLX6UP/f8j7PC87iA+ocN+7ezu0AHr8NQjFXggguQ=; b=IAXNAELtmIyIig/TtYDftZgN3brWTtUt3P7JD+RDkOgf8pApgrYbxC0cABQsYYkTFo DOY/Kohe//abeGFAfe/m74x08xh2RLlruWVq4kkyfRgvcP9JT1EokW0/pV+Tev0fTLLH 9377i9h4nrzv1GVzZXlU6sgPqj0FIjHeWIwwaSo2brttteV5MWKMQcVo/27r3+pEhh9q 2RWM3lMS5welNdwGdOaUN4hhiBYCQph6059jEpTktbVLqzWGxGSrVwyA9NS1pEH2T+Q5 bIcEJ3KX1D8squYVathnj1wqdGPJERqDuvX5zKLNjDj2nTY6Fj6dB/xRScRUpK7vHecn mM5g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705869023; x=1706473823; 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=4kWLX6UP/f8j7PC87iA+ocN+7ezu0AHr8NQjFXggguQ=; b=FJO9tRnsUObjeOCc2N7NwVhKRy9xhpKVK9L5Y5EE77D3jNuG6ki9lartni6UQm/vU8 VnyMDn2JE1aJePUFBb2x89UfsSP1Sm90HflDDoJHwLJXLohRfXryOdxm/iBYSK/fnkPJ zkcU4hNjgkoL1raa0dR6wFJk/TjWl/muDYdj0UhVslsRyedxOUxzmw+oYCN1dzO7fgaA k62I/swlHkjyxeUokp1KGaRam8YazDRoFoI+hdCH8scpwpFiKGV/tHm9FDPeLAJKOi8O SSbime6maFKRDN10HHNTAgMIJxKd4MmNyGwxF8S2eAcjA09e8F8qXNHXSYmwhZDxJWWK 2c5g== X-Gm-Message-State: AOJu0YxOA6bRRwFzFCJEwWxh2aZN9yLa3Ywysf5ODDUbAmvvHuC0BZRE p5K12tQYhaYep5Jbc4YRN9JgHCmE6vNvOOOCiV8LMktAKfHl/Pve X-Received: by 2002:a05:600c:2d11:b0:40e:6247:5f7 with SMTP id x17-20020a05600c2d1100b0040e624705f7mr1681171wmf.45.1705869023163; Sun, 21 Jan 2024 12:30:23 -0800 (PST) Received: from localhost.localdomain (93-34-89-13.ip49.fastwebnet.it. [93.34.89.13]) by smtp.googlemail.com with ESMTPSA id j5-20020a05600c1c0500b0040e9f7dadc6sm9021967wms.25.2024.01.21.12.30.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 21 Jan 2024 12:30:22 -0800 (PST) From: Christian Marangi To: Russell King , Arnd Bergmann , Andrew Morton , Geert Uytterhoeven , Linus Walleij , "Kirill A. Shutemov" , Thomas Gleixner , Jonathan Corbet , Marc Zyngier , Christian Marangi , "Mike Rapoport (IBM)" , Eric DeVolder , Nathan Chancellor , Kees Cook , "Russell King (Oracle)" , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Bjorn Andersson , Konrad Dybcio , John Crispin Subject: [PATCH v2 0/2] ARM: decompressor: support AUTO_ZRELADDR and appended DTB Date: Sun, 21 Jan 2024 21:29:32 +0100 Message-ID: <20240121203009.9257-1-ansuelsmth@gmail.com> X-Mailer: git-send-email 2.43.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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. While MEM ATAG may be broken, other ATAG like serial number or bootargs might still be useful for partition declaration (cmdlinepart) or other info hence DTB_COMPAT is still needed in these case and can't be disabled. 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. Changes v2: - Add Review and Ack Tags - Use IS_ENABLED instead of global variable 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 | 4 ++++ arch/arm/boot/compressed/head.S | 22 ++++++++++++++++++++++ 3 files changed, 38 insertions(+) -- 2.43.0