From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from mail-wr0-x244.google.com ([2a00:1450:400c:c0c::244]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fJJRa-0002jH-7L for barebox@lists.infradead.org; Thu, 17 May 2018 13:59:49 +0000 Received: by mail-wr0-x244.google.com with SMTP id w18-v6so2052075wrn.6 for ; Thu, 17 May 2018 06:59:41 -0700 (PDT) From: Peter Mamonov Date: Thu, 17 May 2018 16:58:52 +0300 Message-Id: <20180517135858.16202-10-pmamonov@gmail.com> In-Reply-To: <20180517135858.16202-1-pmamonov@gmail.com> References: <20180517135858.16202-1-pmamonov@gmail.com> List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "barebox" Errors-To: barebox-bounces+u.kleine-koenig=pengutronix.de@lists.infradead.org Subject: [RFC PATCH 09/15] MIPS: import 64-bit address conversion macros To: barebox@lists.infradead.org Cc: Peter Mamonov Signed-off-by: Peter Mamonov --- arch/mips/include/asm/addrspace.h | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/arch/mips/include/asm/addrspace.h b/arch/mips/include/asm/addrspace.h index 04d0f95db..688620472 100644 --- a/arch/mips/include/asm/addrspace.h +++ b/arch/mips/include/asm/addrspace.h @@ -78,6 +78,26 @@ #define CKSEG2ADDR(a) (CPHYSADDR(a) | CKSEG2) #define CKSEG3ADDR(a) (CPHYSADDR(a) | CKSEG3) +/* + * Cache modes for XKPHYS address conversion macros + */ +#define K_CALG_COH_EXCL1_NOL2 0 +#define K_CALG_COH_SHRL1_NOL2 1 +#define K_CALG_UNCACHED 2 +#define K_CALG_NONCOHERENT 3 +#define K_CALG_COH_EXCL 4 +#define K_CALG_COH_SHAREABLE 5 +#define K_CALG_NOTUSED 6 +#define K_CALG_UNCACHED_ACCEL 7 + +/* + * 64-bit address conversions + */ +#define PHYS_TO_XKSEG_UNCACHED(p) PHYS_TO_XKPHYS(K_CALG_UNCACHED, (p)) +#define PHYS_TO_XKSEG_CACHED(p) PHYS_TO_XKPHYS(K_CALG_COH_SHAREABLE, (p)) +#define XKPHYS_TO_PHYS(p) ((p) & TO_PHYS_MASK) +#define PHYS_TO_XKPHYS(cm, a) (XKPHYS | (_ACAST64_(cm) << 59) | (a)) + #else #define CKSEG0ADDR(a) (CPHYSADDR(a) | KSEG0) -- 2.17.0 _______________________________________________ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox