Received: by 2002:ab2:3350:0:b0:1f4:6588:b3a7 with SMTP id o16csp360622lqe; Sat, 6 Apr 2024 04:35:40 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWVaDuYScLDqdSaJ/CoaksP1/df9FWevlf7F1HO0487+dm1gu81zWE7wPtswI0xRrpHjAyeGDjNa3rEMn+2HbOgC5POde/xFOaQEusrwA== X-Google-Smtp-Source: AGHT+IFHSr25LsFznQkUpFUPi/cCQYfjZTIoJIr1QtUVPpC3YHJXzBsaW7OZAafh1/xTXlV0pDin X-Received: by 2002:ac2:5636:0:b0:516:be9d:11ac with SMTP id b22-20020ac25636000000b00516be9d11acmr3607766lff.13.1712403340095; Sat, 06 Apr 2024 04:35:40 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712403340; cv=pass; d=google.com; s=arc-20160816; b=k5DWdOAWHc5U+zt9prEfdUXsHLbKK4V0KikK5qrGpX6lX3DWM+FNylExIu5ZIDIH3Y U85dWwHkSGULz5I8aQl15MTMXZzVwCFJvMjwltQ5WqEN5cjZy+XOw8GtPOxmcjCLhfQt QwQLn9OE9H5ao2cDA9F/j/T1h2zpxc9j5NgtUTig/8L6AQjXc0cOtGOl28HpSyoKAgq4 ts+hmSqKBaxrk0KGv1fb1qG1SfQ1i28lz/S19Rpjo3Dyrj78us3Ujn7fqrviFx4JPDAc Jlipfzh8FnMz3xXlVZW2oVVAh3vZsrrgKOPv9SoK7DfxPalcNHea8QzKzlm9MKK5RYUj SFoA== 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=y4lLdDmgkpynxnWnWOrqxoyzlfkmM7nde53ndIvgpZs=; b=L16x3EUmjr5MCwvLiv3hVMUf2ucdonpTmW5BWziYIiIFEw+mOckE8c/5DVnm0QZntR Y13yh0q2jNtuAJISOWcWK/juJ5/63agC9N+QF5YAjelVWDULlCD+2JEBF77eGPkbn2IQ InCLiqjNUZBkkHKavCb6jse3CJS/xDHSdjA+1ub3lt256v7ikcP1r/pxiVN5/5UQs3sV /4yfO4yAZDjt/oB9y0cPBUtWyJwCCTeSHn6nCqWOGWimipjpVGj0gCrFeSi05Ws9AELm GIjtrememcI3ksEwu6A+O7O6TW8+gsRI+6h73st3cf19wryus/4ll7Zsq+oIYxTRD1oP dz2g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=O4CTEJzK; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-133912-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-133912-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id sa10-20020a1709076d0a00b00a472e17f7c2si1756877ejc.47.2024.04.06.04.35.40 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 06 Apr 2024 04:35:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-133912-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=O4CTEJzK; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-133912-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-133912-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 am.mirrors.kernel.org (Postfix) with ESMTPS id C15761F21B57 for ; Sat, 6 Apr 2024 11:35:39 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id BDE7C2E645; Sat, 6 Apr 2024 11:35:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="O4CTEJzK" 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 EB65D2CCA0 for ; Sat, 6 Apr 2024 11:35:22 +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=1712403323; cv=none; b=o7b/I3YMWgHhhEf5I5YqpGfYj8ndkKfGTwF3tlO3LJNaV6hagPRiGb2e8VZ6x7dEBYpvFrCIkjmLvh1demuouBY7Py015TYGY1qOUKLF+JInYwY4ISxhQa8oWi4jM2yzXDyE/dpWf2CL4pF3ileUjqf5LwKY4yiiEbZCRcaVXd0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712403323; c=relaxed/simple; bh=pFynrsYJOJ+5eJpGClthQv/4eVfcqNbrm44H7lrcyi4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=U90cNSHPniHs5NeU70BkC3SsjbWNyEEkch/TOrwhtujiLtR1iAMh10S9dI9JoMCcgSviJB92EX34/XmT1OysOVFe4GeBc12z8D8yHGSlnzOGXtjdozmY2JxoOA6ZjtIPgPCB7JTQ+qXfsdLmQMQwqQFdn5cA/awjOz0XZHn2siY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=O4CTEJzK; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id DC128C433F1; Sat, 6 Apr 2024 11:35:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1712403322; bh=pFynrsYJOJ+5eJpGClthQv/4eVfcqNbrm44H7lrcyi4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=O4CTEJzKCq0QwjZWEpBOFtuASv2SkLVYz3MRBuGvJ/ReH8U04k7rSV78aUSwyEF2T EUk5pA29fS13562QJZU0NtHAGQ32uu7l+DdUSlHiC1D+AV2dDvxTqf/7g1KaIykefB 65cui7Iijh+o2G8aJgRr9JLhvMFEmpDebc5+nGBwGM5ERDP9THwjgohpHVKObDK1hM SLtq9iGP9iLvceLdcxMPnFgQxvbpaLgTy6D1BadHVFetf+Fr8y178JZ0n1gvso++l5 RsW7Aiz79I7Bt0nyO44hKEruFP401sfXpPxcA7tzx0JVRznNJb1XiceDWr/DA/luOQ nT1hhTtWK7M1Q== From: Jisheng Zhang To: Paul Walmsley , Palmer Dabbelt , Albert Ou , Daniel Lezcano , Thomas Gleixner , Samuel Holland Cc: linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 1/3] riscv: nommu: remove PAGE_OFFSET hardcoding Date: Sat, 6 Apr 2024 19:21:57 +0800 Message-ID: <20240406112159.1634-2-jszhang@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240406112159.1634-1-jszhang@kernel.org> References: <20240406112159.1634-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