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: 19197 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:2bc4:b0:101:a8e8:374 with SMTP id hx4csp1260986dyb; Fri, 19 Jan 2024 12:16:09 -0800 (PST) X-Google-Smtp-Source: AGHT+IH8ZN/stX5J4EpNxbjj+sTKPARlZhp3SwFLKaQt4VIh5MfZ/JoR4EkvGanxEow3LxXR5ZJX X-Received: by 2002:a05:6a20:3d29:b0:19a:bd49:b756 with SMTP id y41-20020a056a203d2900b0019abd49b756mr426734pzi.75.1705695369548; Fri, 19 Jan 2024 12:16:09 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1705695369; cv=pass; d=google.com; s=arc-20160816; b=XdJ9qPJLeTBMc/yym2MGt/eAyTnIDtLL/slAlc8NvV/UKMFnlsMcjyz391MA6sIdN7 YthOEtA1oeMh+sCRLeKgt7zOt9n5ByYgiLFMdzuSM4ZfXvWTtZbiD8y9Lm5XUvE4xcyE LIWYmCn7mMqv+GlhWL1Hccpv/jfY1fRQeJJeuGrCEhpXqNXqYfaoXxj8D2F1yRKbwkXL fFxQrjFSTkW1Ymr+XgR15HRiZwr3UY543JZUJavUV/6+8EYocgpPYOgscPJ7jKo5RXcU Bxd88AJcq8FFJ9VOqUxH0RPCSS7r4FNkW+5uDGmDor6ogk01WTjKAlvrP5kc40Dq+zpa Hr/Q== 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=mMGLhwG85B2w0NThmk2zDLj49Bo1ipFv4zuCwGP7AlE=; fh=AzxL8H9Nc+PoOc11FezgGVhkenvx72SZcZi/yiG9gaw=; b=im3n533hGc66JoUNicuPyQOLQlMVIllTTecGQ0xyhsokJ43NAmepjwzh3PLcEpynDS 1mT0Tjf/7GTwN4juTr+zWfjvQMCaCBR0lWpIi8xIG+j5vug78I9vufFQ7UvMD5UTI8zB 6jy5cq/vfQ3QmtfW1PtOt1Znx2nB0Q9GryaTnPmVU+jFGE61gyG5sIZw0bHu/EOn9u4B mPPEBB2nA/q0stWiwTww3oR0iJ8oFVPo/N0UMrpnhCt1dW9/lJ1K5lP8sYTH4/L+8gY8 doXUaNEYV4biobEC3b3rlNoxyhPRDFkj++MHOorZt2El9FR01ZXmfXjCteDjMfeVs0R1 SMNA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=Cj39tQy5; 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-31537-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-31537-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id qe12-20020a17090b4f8c00b0028eafca02e7si4063103pjb.113.2024.01.19.12.16.09 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Jan 2024 12:16:09 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-31537-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=Cj39tQy5; 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-31537-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-31537-ouuuleilei=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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 8C8C7B22AFC for ; Fri, 19 Jan 2024 20:14:31 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C086C5789E; Fri, 19 Jan 2024 20:14:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Cj39tQy5" Received: from mail-wr1-f51.google.com (mail-wr1-f51.google.com [209.85.221.51]) (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 821F05788C for ; Fri, 19 Jan 2024 20:14:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.51 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705695253; cv=none; b=Nmc4R3c7eF2XuQI5EzLgU8ZhibBAS+3vgxgMLdTUvsOR/R+Pcs/K6pr478+VmiRAyL14LrOARVXmp1OJNcwLZOevS2vCT33kuo+FuoeY7hCDUYWhI0aB//fz1HPl5aCAD5QXwhU047arkA5sj4EJu3o0mu0MwcM7ChqNIxvLNIg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705695253; c=relaxed/simple; bh=3PSSN9zmx3qHvcJQwCDz4Bljr7sTESkoDwkyeh8+6NU=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=rh1snVfaGkYQWkkdXTtw1c+Ke5yX0U2IA4uND1gXCTh5AAL1z4LHw/s/Lw7zzORUzDUoiE0q5s8UABGmMwgxxC+z7508lpiuexCHoC1yQrH9pvQBoirIQpHyWgPIW5fw8SxLboFECRCjXOqa3QnkyuISublzfr5pVC76xpX4IYw= 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=Cj39tQy5; arc=none smtp.client-ip=209.85.221.51 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-wr1-f51.google.com with SMTP id ffacd0b85a97d-336c8ab0b20so1058770f8f.1 for ; Fri, 19 Jan 2024 12:14:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1705695248; x=1706300048; 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=mMGLhwG85B2w0NThmk2zDLj49Bo1ipFv4zuCwGP7AlE=; b=Cj39tQy5yMnyAbCiNO1Yp9mYGKqFK42t1z90cmheCcZr7iOfUPuQzpD5vCIAk4rYvJ XSC0l+51dbsyV7nth3i6PI/BtMyfub+sRudeTmp555iSFsT8P9szat8I0VaVOi2Qm5eH sXzUOpSf4oWsPfW+7X+WLF0mTb3Qvvz4k2/6Lg+BD0nj09gzn2i1WE/YiO5UCoIII9d4 0X92vpT/DTfYLNoYrcS5+UH5Y0rr8qhHaeNhbtADJxuM4c9VaUwKsaTaI7l/cfAIvYXA 7ZQrfVgstd+v6RwtFBenKk/eMwftq7qCj6W6CJhRS1SjE0iC7c6TLTTXZncmpejAT58I 1feg== 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=EEQjTHzC1cRn4s8R+sHXF6fW+//dv5cvEaZao/v3bZlztD2SkhG+elwDJaPDPhz169 pJLq8WzI4egMGhPyW3CiFQxj8gQNr7oavUT3eD1ZqTMfdBXekxD8bpTKANb+bPgm4EZp L/FkVvg3An7rU6fevgjDfx4ZNVXPYZAtJ7cBx5hYe0xkZ020BIGZp/qO/Od5Yd+ZzzHU AchKVpdQTlb5JowwyFPCQ5qerM2VK2SWUVtfgXX6LdH4EJr4gi3ElDCLzBVflhFTh8MU mavbfSvpQXpI3aJaVUEB52dHc7ZhA+rSQTZrGXgdiJhVa4uWSsRBioTT77+pM4wvvBcX +z6w== X-Gm-Message-State: AOJu0YwDnA1rG+ZzEL+BQN3jCdPH2Rjxy3wUufr9AmRO+fZV9MKNbdbZ DWmyDOJ3NsIXsqc1vMnMBvdsBinYLZ2YWxk4ZVzMQ+vUURsNvntO 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 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1788551227675832207 X-GMAIL-MSGID: 1788551227675832207 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(+)