Received: by 2002:ab2:4a89:0:b0:1f4:a8b6:6e69 with SMTP id w9csp212816lqj; Wed, 10 Apr 2024 08:22:27 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCU6M8oFetAcT3LZjWGKvF3NkiSAjSxdDOI7o2YjxgobRNiwYbGZm6vKJfet/GAxxjOpnkRkPFHH2UzY/ZCq6JS4fQkP9Mx/CZFz5Yi3uQ== X-Google-Smtp-Source: AGHT+IFcUstpyXQrAdh8S0Xp0XBwETFVV+6IJFFAs46HGQyAZJGjtxEdsmHSgUWogmT8rnUseLtS X-Received: by 2002:a92:c24a:0:b0:36a:1132:8bc7 with SMTP id k10-20020a92c24a000000b0036a11328bc7mr3344441ilo.24.1712762547099; Wed, 10 Apr 2024 08:22:27 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712762547; cv=pass; d=google.com; s=arc-20160816; b=xWEHL7HP63RbOAWFYlTpWA7u0hW+j72TWiXAC+owqQ4mf+L+h0CoZvH69jKrJNY3ds FKWBXU4mM1oCIOPgU49FCGM5z4Qmvaz4n4HxVkLcnfxSF2syylBq4VN2LoKbb1uDMiDJ rsIqq5SgvTtEnOhFktQSTXYXnJvK0KOCc+4QsmMG51mPzjsXyeflsMNn5SY3QJgXtOlG vkXy6xnkSVXJfrrsTvfAykyT1qMCwx+p5WHieZbRCjj91FJg5qNpOKuJsgVY1kZTlEPH g3SUQirOp7PX8weJmV4RadlbJ/nyPeWcljUD5VUBf6wQIIGj40lFa/L9DYCfNKci+w9E cpGQ== 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=viB+J4PK9dwlvkYWU8eN2et/m2VhnFCJnzfGlNe6jXY=; fh=ZDv16L4GR/JiymbJKAxndXNob7k/mCHOX4rM4CpKjls=; b=fSrUK4fA6HGUG5orw1RHpwpRNwIc4dWiKtFPNaZ7h6jAysL2W2Vg7pjDFRxOfRZx/2 fGp5kOT32/+Q07lFChCX8bwHPJi1bmnkadxQzxIXLAPmz+MKytCqilrGp946ftxnE5un U0kG37+ZpdthQHYPxl2Cj/zz9US10cP9S8jxmBytZWZNBxWArXt1+fhNeXhOc+d9OtNu 50DQSGgnTSTPP+kn5F8UFUDugPxGB45hyboV1jhFVrpkikD8qCzX7MQsi9jkq24hG8YP gMUz0FfYX9YDWaHFrN1UgFWjFZs+iE3QKP6YlK1hSYjy3ZHk8hmz6xCO0PjnHCr2+XJu LUBw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=FAber0OZ; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-138765-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-138765-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id i136-20020a636d8e000000b005b7160263f2si10859298pgc.154.2024.04.10.08.22.26 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Apr 2024 08:22:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-138765-linux.lists.archive=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=@kernel.org header.s=k20201202 header.b=FAber0OZ; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-138765-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-138765-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 7C898B2FAF7 for ; Wed, 10 Apr 2024 14:39:33 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 271F215ADB0; Wed, 10 Apr 2024 14:37:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="FAber0OZ" 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 5011F16D9D7 for ; Wed, 10 Apr 2024 14:37:13 +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=1712759834; cv=none; b=BdGOKi7n5npEwWldJDlYdj1uSK4cSdv42/7IIozME+d6QhX6FFQ4s9pmL3alu+z6lNMBfbBIXsqFw6m+sNWkKt+O0zrsJJVyeRMBfZTs4NYvMFNeshEDAmK6te8+nyZCWJg/OgKb2NyqQ9wnSbIWXx88yOjYYFGMNazD9d7IL2Q= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712759834; c=relaxed/simple; bh=pFynrsYJOJ+5eJpGClthQv/4eVfcqNbrm44H7lrcyi4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=L4iZ405hkqvpBB5RX0OcNwF1Z4PmN66ULQduKkII2XLbZbUlwXzI1sleFF2bWRV/SWhcTkPtMSZ22brCGNh3243XyqwB0Y1xWyWI2T9Jfq9pkkvA8X6de5T//3idu9inWV1ON6aZip7nkbbm98E21N+l2UbAWn1ptjHymtFJWHs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=FAber0OZ; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 14443C433F1; Wed, 10 Apr 2024 14:37:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1712759833; bh=pFynrsYJOJ+5eJpGClthQv/4eVfcqNbrm44H7lrcyi4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FAber0OZ+baRX6voEIYTgtB2eFPc3Y+1fQEr016XnTykIihv9Xr4GP3QBkkIYIgk7 AXXXzylli3I3oLJ52+0TJwbskZxkamEaymffPo6EnUU+baUR45FKXgzg3ADs5fmysU a2BYjLWvxTRHCZVGsyUiEBJIVN6zYEZ09VJ36ePLxymvrN7kWOML7MtmPsrtyH3v/N CXPT4ZbWKfJ4XApVf7+m64kFV/TPasLCiaA676XRjGdugxALST5LpywebwkDnn1aSY 1i7uLEoel5O662a5xf06e1y/YiedfZxOrsyaEhUdOAsxhOAhq7iN+kY8L2n/tlf+dM qUSoMB72mfokg== From: Jisheng Zhang To: Paul Walmsley , Palmer Dabbelt , Albert Ou , Daniel Lezcano , Thomas Gleixner , Samuel Holland , Conor Dooley Cc: linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v3 1/2] riscv: nommu: remove PAGE_OFFSET hardcoding Date: Wed, 10 Apr 2024 22:23:46 +0800 Message-ID: <20240410142347.964-2-jszhang@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240410142347.964-1-jszhang@kernel.org> References: <20240410142347.964-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..b4af1df86352 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