From patchwork Fri Dec 1 11:14:46 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gregory CLEMENT X-Patchwork-Id: 172429 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:bcd1:0:b0:403:3b70:6f57 with SMTP id r17csp1041265vqy; Fri, 1 Dec 2023 03:16:45 -0800 (PST) X-Google-Smtp-Source: AGHT+IFLCtjbIKhQXdBFv7uX5Dd1NuTGXuv65Ss7Q+TdGUdasWyEu+JSMWTkTYPkvPpFry9GkS+w X-Received: by 2002:a05:6358:2911:b0:16d:f743:4107 with SMTP id y17-20020a056358291100b0016df7434107mr28397032rwb.3.1701429404988; Fri, 01 Dec 2023 03:16:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701429404; cv=none; d=google.com; s=arc-20160816; b=RJkuCmAhZik6kNWSv2FHPeS+CkAMPbQJthS3AvWrpaMaW4m9Z+GHaNXKwF1Wy5vGa+ 0/bhrMC/o8coeabA2W1z/clOBames6KOKa0HjM9+7W/F0/pAf5NOhPJCSgbuDknllL+x PWq+5g9ST9SLP+HuoKaIHr9QHpTji+w0hGkYPOH9l1/yVhIy8Q8nKKBqLA674L1xMVAJ aOLJn1jcvMrThQi9RSa59yYvY9SnIwxZpjx0GmfYaMs4NHDE5KaenaplHDvUyGA0ccSk zKTLwKCCKg/Jog0mtIKen2ImRCkV9KFMkYF8qC+RLrIwoiWjQ/WslD3ewF0z/FZcNUvm ZHpA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=mwMGUZspLb3scKoCxR0kEqf6HvwmvWkmRHeYsxLYvU8=; fh=t1bsw/gEI8w3DN7ouBpAewoQyybWh2yxEgAHixB9Iis=; b=0uXTPWSRO/OvQHmNXZPdJkFZBidbXjPgnt/RamZNgDdVR8cf9/v0oALVcyHcm1ZPEq VB4GhjszudMq2sAgZ+sJ6/QknNCQGY5YMt6B1baRJ9nEhbofJe+Wf6UYpu1RP1XCCUoG HpSYCWrgSL/mrBYxQDVS1NpGTRlg91/3PRGEvymLQVlvzwKKC/B72OWoRTrS536lxdeo A6zlBbkIPAdXJeZiNlVq8uRCi30gQtfF6NQC5RKL/+ERrbAAsDW3jfQimXQWQDPUuzih mX1lsS+djlshKqUQAB5dXrf5Z1SOgZvrQyOMUWA8nWNW8xbjAeKXk8KYXdh37HTHiObb HHiA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=fgzihX1c; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from groat.vger.email (groat.vger.email. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id q23-20020a656857000000b005bdf5961dd2si3173853pgt.400.2023.12.01.03.16.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Dec 2023 03:16:44 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) client-ip=2620:137:e000::3:5; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=fgzihX1c; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id 54C868266309; Fri, 1 Dec 2023 03:15:59 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1378560AbjLALPk (ORCPT + 99 others); Fri, 1 Dec 2023 06:15:40 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36022 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1378504AbjLALPU (ORCPT ); Fri, 1 Dec 2023 06:15:20 -0500 Received: from relay6-d.mail.gandi.net (relay6-d.mail.gandi.net [IPv6:2001:4b98:dc4:8::226]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4976310D8; Fri, 1 Dec 2023 03:15:25 -0800 (PST) Received: by mail.gandi.net (Postfix) with ESMTPSA id 24268C000C; Fri, 1 Dec 2023 11:15:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1701429324; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=mwMGUZspLb3scKoCxR0kEqf6HvwmvWkmRHeYsxLYvU8=; b=fgzihX1c1UqV0SL6jO3hqG4IniDL2MBT476VKZEk5eDHgFmD4ZuqUuQD50im18Y5gEsOVk dFigKAqRlhhoG4AGfVD4kw/R7p5K3AqPf/GE3c1NhgLPls+KcQ2TXXWkpcmxDJ1h2Fu8Ri VHPpnCBTjWIV3ffmY4NkP6qfXB+lDch2xU4ZuWJLhsyuda5XHokF4T7IU6LMnPnKPgfP4q qLpi6L3S0aO9AD/Fdb5x+/sEvO+NYiCOoTtLCp6WOQuVPTupzl1VSMh7GccNs6/KcU1R+a IIrYwnDH/QVnNWSR7UDJn2D4gxfvBSb/h3diVy5KY+Gp0IMIVbXphi3B4VTXNg== From: Gregory CLEMENT To: Paul Burton , Thomas Bogendoerfer , linux-mips@vger.kernel.org, Jiaxun Yang , Rob Herring , Krzysztof Kozlowski , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Vladimir Kondratiev , Tawfik Bayouk , Alexandre Belloni , =?utf-8?q?Th=C3=A9o_Lebr?= =?utf-8?q?un?= , Thomas Petazzoni Subject: [PATCH v3 03/22] MIPS: spaces: Define a couple of handy macros Date: Fri, 1 Dec 2023 12:14:46 +0100 Message-ID: <20231201111512.803120-4-gregory.clement@bootlin.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231201111512.803120-1-gregory.clement@bootlin.com> References: <20231201111512.803120-1-gregory.clement@bootlin.com> MIME-Version: 1.0 X-GND-Sasl: gregory.clement@bootlin.com X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Fri, 01 Dec 2023 03:15:59 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1784078039728607281 X-GMAIL-MSGID: 1784078039728607281 From: Jiaxun Yang KSEGX_SIZE is defined to size of each KSEG segment. TO_CAC and TO_UNCAC are brought to 32bit builds as well, TO_PHYS remains to be 64bit only as we want people to use __pa to avoid mixup compat address space. Signed-off-by: Jiaxun Yang --- arch/mips/include/asm/addrspace.h | 5 +++++ arch/mips/include/asm/mach-generic/spaces.h | 5 +++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/arch/mips/include/asm/addrspace.h b/arch/mips/include/asm/addrspace.h index 59a48c60a065c..03a5e2c8b5dc9 100644 --- a/arch/mips/include/asm/addrspace.h +++ b/arch/mips/include/asm/addrspace.h @@ -47,6 +47,11 @@ */ #define KSEGX(a) ((_ACAST32_(a)) & _ACAST32_(0xe0000000)) +/* + * Gives the size of each kernel segment + */ +#define KSEGX_SIZE 0x20000000 + /* * Returns the physical address of a CKSEGx / XKPHYS address */ diff --git a/arch/mips/include/asm/mach-generic/spaces.h b/arch/mips/include/asm/mach-generic/spaces.h index b247575c5e699..05db19521e817 100644 --- a/arch/mips/include/asm/mach-generic/spaces.h +++ b/arch/mips/include/asm/mach-generic/spaces.h @@ -79,11 +79,12 @@ #endif #define TO_PHYS(x) ( ((x) & TO_PHYS_MASK)) -#define TO_CAC(x) (CAC_BASE | ((x) & TO_PHYS_MASK)) -#define TO_UNCAC(x) (UNCAC_BASE | ((x) & TO_PHYS_MASK)) #endif /* CONFIG_64BIT */ +#define TO_CAC(x) (CAC_BASE | ((x) & TO_PHYS_MASK)) +#define TO_UNCAC(x) (UNCAC_BASE | ((x) & TO_PHYS_MASK)) + /* * This handles the memory map. */