Commit e40192da authored by Gregory CLEMENT's avatar Gregory CLEMENT Committed by Thomas Bogendoerfer

MIPS: spaces: Define a couple of handy macros

Define CKSEGX_SIZE to represent the size of each KSEG segment.

Introduce CKSEG0ADDR_OR_64BIT and CKSEG1ADDR_OR_64BIT to get an XPHYS
address in 64bits and CKSEG[01]ADDR() in 32 bits mode.
Co-developed-by: default avatarJiaxun Yang <jiaxun.yang@flygoat.com>
Signed-off-by: default avatarGregory CLEMENT <gregory.clement@bootlin.com>
Signed-off-by: default avatarThomas Bogendoerfer <tsbogend@alpha.franken.de>
parent 6d74e0fc
...@@ -47,6 +47,11 @@ ...@@ -47,6 +47,11 @@
*/ */
#define KSEGX(a) ((_ACAST32_(a)) & _ACAST32_(0xe0000000)) #define KSEGX(a) ((_ACAST32_(a)) & _ACAST32_(0xe0000000))
/*
* Gives the size of each kernel segment
*/
#define CSEGX_SIZE 0x20000000
/* /*
* Returns the physical address of a CKSEGx / XKPHYS address * Returns the physical address of a CKSEGx / XKPHYS address
*/ */
......
...@@ -49,6 +49,8 @@ ...@@ -49,6 +49,8 @@
#define HIGHMEM_START _AC(0x20000000, UL) #define HIGHMEM_START _AC(0x20000000, UL)
#endif #endif
#define CKSEG0ADDR_OR_64BIT(x) CKSEG0ADDR(x)
#define CKSEG1ADDR_OR_64BIT(x) CKSEG1ADDR(x)
#endif /* CONFIG_32BIT */ #endif /* CONFIG_32BIT */
#ifdef CONFIG_64BIT #ifdef CONFIG_64BIT
...@@ -82,6 +84,8 @@ ...@@ -82,6 +84,8 @@
#define TO_CAC(x) (CAC_BASE | ((x) & TO_PHYS_MASK)) #define TO_CAC(x) (CAC_BASE | ((x) & TO_PHYS_MASK))
#define TO_UNCAC(x) (UNCAC_BASE | ((x) & TO_PHYS_MASK)) #define TO_UNCAC(x) (UNCAC_BASE | ((x) & TO_PHYS_MASK))
#define CKSEG0ADDR_OR_64BIT(x) TO_CAC(x)
#define CKSEG1ADDR_OR_64BIT(x) TO_UNCAC(x)
#endif /* CONFIG_64BIT */ #endif /* CONFIG_64BIT */
/* /*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment