Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp2843423lqp; Mon, 25 Mar 2024 10:45:20 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCV27czlcAn/RaLh8Y+Xjw35v3b4Wo7atGmLguva0orOMOD1xwIy6w8t4xCCy8+HqJFhJmB5LKvCEHWKZfWUoiXps3SVIx0G5yi7YQi4tA== X-Google-Smtp-Source: AGHT+IEV+3zCzWY4wE8iAhmpca9XLrcpTtik2YKK3GoG/GfeCxEMfn6+ZTPuvs6hG866eRap1Rhc X-Received: by 2002:a05:6214:e89:b0:696:801a:9864 with SMTP id hf9-20020a0562140e8900b00696801a9864mr7824322qvb.13.1711388720058; Mon, 25 Mar 2024 10:45:20 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711388720; cv=pass; d=google.com; s=arc-20160816; b=Tf5m4llpWMud+Bvm2z4ixHHSMnHxKjOqC4ylm/nexswSoHZpGYRQ6xgO8WWRfoXy2v Q75qYtCQzb+TT3GiOExIMoDIaS36gELiI99SomelardhMQ9aij0WQ8YX2y7YlC+xkKXo Dh4yNrJZITdrDdeSFi0wfPDU/8xUjpC9w74vUYOhhxJmvmUwJ8b+DgncRnvbGJD0gbrs DtdESf/bNF1iXwCMm0oMNRGBNhmQUM5tPWRosMaCYo/AGqJEM7WaGyD0I+lDOGhLw3b3 +JprMw/kfQoLGgAqOlbLL9OTDUTWEMC5s53aXhbP3MME4Wqjp4a5M6Cywj6F8O728FrL ojZQ== 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=xnbnPpcUy7BlSIkpF1h3I/qxybuXSHQgbMbyZ0zndjI=; fh=m+lkMSgpAsPrsBPjNkIveMqClHfEKCUqtpjmyG590AA=; b=Gu/S0M8/SV2XWgm3iCwG5JHb8iABAtL/zqoFNZWfbRZzoHJOetLleXHbtfAR9MqqL8 B3ZqokhDMBTiXxhJ+6JUuZF/E1yvyhWLU/6x4s5afDNgbGJNJckDcLSe38zukn1yz+Lw +euW9HkGNZ/N7oZoa2+Rk9gCTGpNzyjBGg2/hPLitgCBe80x52aDtNw8XFrI/JvTlJS0 9RGFdoJfW19HTqJx07sJMKSRuvU1DiN/zeH6FMgVC2UW69wMISEPU7TAr6xPbZvwQpNT Q6PNOzPRBPLIWQXiwdXlIlvEd66EKS8qPWmlgqiwFNtCwj76CW8WpnP9ksush94Ird7t 7Nng==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=D1xjklQ9; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-117515-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-117515-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id q8-20020ad45ca8000000b0068cbacd748fsi8481050qvh.520.2024.03.25.10.45.19 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Mar 2024 10:45:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-117515-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=D1xjklQ9; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-117515-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-117515-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.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 C55961C3F61E for ; Mon, 25 Mar 2024 17:45:19 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0CFDA101CA; Mon, 25 Mar 2024 16:53:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="D1xjklQ9" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 21C1E6AA1 for ; Mon, 25 Mar 2024 16:53:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711385619; cv=none; b=m1hrDyhGcMtQFz3GXHSMTszL8spA7TX9st/mowAVWH6eTucd5Mu+svDaFYs18Xb3OSq1QP2cfscZ6O9hvRQhXzIAjkklawapfaGgC5xwWdyQPUeR1zr01BvE/G3fylvKhYfNMMdVuh2uZ6/K/ZL70oDgCigHOIuBoABd+BPmhHE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711385619; c=relaxed/simple; bh=vNJUUGgBYsqzd1U+c0XNtNNwoWAwHgq0i6v5JcQYy7Y=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=O/WBTYpf9S3A/7GLOr8PjtmejaEurQk14s3AX4LpcLXvWBUbt/MtSWTv3cIJjizfbpTFrD5wIshEDXwoP/3z+EUOBUcASIx+RvLYlc0YWiQ9ib3CtAnbRAvaFanHJs0tbjlQ4xheFqAFmONjJhUnvBywcfuu5rfaL88YTkeP2f8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=D1xjklQ9; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1A506C43390; Mon, 25 Mar 2024 16:53:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1711385618; bh=vNJUUGgBYsqzd1U+c0XNtNNwoWAwHgq0i6v5JcQYy7Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=D1xjklQ9T3CUCWED7yfG2ZMg+v7PSjM3W4B+DkuMr25oQbcUGTDaIrKYJdh3ggagm /xhQgXW0roNkItDioF6LE49k7MEfmjwU+knmOqmuoh4VKTFM5T68nKzKidhNR1oxNK Jy340vIkQYcantibiT87kBrAZhlsSq6dI/Ch8NywMF5SUtB2Ywz8P/SliUSjpNz9TM JYuvx7BYR1UikX4XBeXLuMArHIgUOs+WzYLygvAYlpjBZz/lPo9L0efBqBHh3IFWr4 WmFIC4zK/kEZ/KsIUTbtFcWrBTKU9t+/V8KG0BJ73eoKMPnAh1LqWL0nKfZtKujtxN oQUreGyV/GmxQ== From: Jisheng Zhang To: Paul Walmsley , Palmer Dabbelt , Albert Ou , Daniel Lezcano , Thomas Gleixner Cc: linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/5] riscv: nommu: remove PAGE_OFFSET hardcoding Date: Tue, 26 Mar 2024 00:40:17 +0800 Message-ID: <20240325164021.3229-2-jszhang@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240325164021.3229-1-jszhang@kernel.org> References: <20240325164021.3229-1-jszhang@kernel.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 Currently, PAGE_OFFSET is hardcoded as 0x8000_0000, it works fine since there's only one nommu platform in the mainline. However, there are many cases where the (S)DRAM base address isn't 0x8000_0000, so remove the hardcoding value, and introduce DRAM_BASE which will be set by users during configuring. DRAM_BASE is 0x8000_0000 by default. Signed-off-by: Jisheng Zhang --- arch/riscv/Kconfig | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig index 7895c77545f1..afd51dbdc253 100644 --- a/arch/riscv/Kconfig +++ b/arch/riscv/Kconfig @@ -247,10 +247,16 @@ config MMU Select if you want MMU-based virtualised addressing space support by paged memory management. If unsure, say 'Y'. +if !MMU +config DRAM_BASE + hex '(S)DRAM Base Address' + default 0x80000000 +endif + config PAGE_OFFSET hex default 0xC0000000 if 32BIT && MMU - default 0x80000000 if !MMU + default DRAM_BASE if !MMU default 0xff60000000000000 if 64BIT config KASAN_SHADOW_OFFSET -- 2.43.0