Received: by 2002:a05:7412:b10a:b0:f3:1519:9f41 with SMTP id az10csp954564rdb; Fri, 1 Dec 2023 03:17:04 -0800 (PST) X-Google-Smtp-Source: AGHT+IGQdMqlbVphGqWqi4G7cRUI7oW17pN5ikTT0tqu7F2mTOx4qkgw+5YC4cr7OPg86uTpvDW+ X-Received: by 2002:a17:90b:4b88:b0:285:c1e1:66b with SMTP id lr8-20020a17090b4b8800b00285c1e1066bmr16986315pjb.37.1701429424377; Fri, 01 Dec 2023 03:17:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701429424; cv=none; d=google.com; s=arc-20160816; b=lDzZ+XiXNwhYg6GpnPnpkW8mdmsKDVbR/OvLQMoalKlrSCek2oT19Yq6TgJlC3UyC2 NKa7ogS5l+wu1SFvc7Y8bQpPax8TdbZ2gVIPlZZSejff519aR4AmeqnvyFseh0qf/iwk 5Kje35prF8tJMA7olla0/2S5OQ1MrNKog6CEe1f4tANcoQHBhRzf3eytW2V/X2Oqg7Vc Qnhvr0azehKNM4HBywl06jYTM9AKzYoCdtXWfYIXQ7nfeZuiVYoeRIMIuJwvy5kMw4Ca Ema0CrxmIJIVysCjEcAtaJqx6kYi6E3cEIhkT9So7KFneLbfhTnx414TkjKblwtcqNEc +J3w== 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 Return-Path: Received: from groat.vger.email (groat.vger.email. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id p5-20020a170902e74500b001cfaf9bf847si3427934plf.352.2023.12.01.03.16.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Dec 2023 03:17:04 -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 C6B268266388; Fri, 1 Dec 2023 03:16:13 -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=20Lebrun?= , 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 Content-Transfer-Encoding: 8bit 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:16:14 -0800 (PST) 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. */ -- 2.42.0