]>
Commit | Line | Data |
---|---|---|
b2441318 | 1 | /* SPDX-License-Identifier: GPL-2.0 */ |
1da177e4 LT |
2 | #ifndef _CRIS_ARCH_PAGE_H |
3 | #define _CRIS_ARCH_PAGE_H | |
4 | ||
1da177e4 LT |
5 | |
6 | #ifdef __KERNEL__ | |
7 | ||
8 | /* This handles the memory map.. */ | |
9 | #ifdef CONFIG_CRIS_LOW_MAP | |
10 | #define PAGE_OFFSET KSEG_6 /* kseg_6 is mapped to physical ram */ | |
11 | #else | |
12 | #define PAGE_OFFSET KSEG_C /* kseg_c is mapped to physical ram */ | |
13 | #endif | |
14 | ||
15 | /* macros to convert between really physical and virtual addresses | |
581b4fdc JN |
16 | * by stripping a selected bit, we can convert between KSEG_x and |
17 | * 0x40000000 where the DRAM really resides | |
1da177e4 LT |
18 | */ |
19 | ||
20 | #ifdef CONFIG_CRIS_LOW_MAP | |
21 | /* we have DRAM virtually at 0x6 */ | |
22 | #define __pa(x) ((unsigned long)(x) & 0xdfffffff) | |
23 | #define __va(x) ((void *)((unsigned long)(x) | 0x20000000)) | |
24 | #else | |
25 | /* we have DRAM virtually at 0xc */ | |
26 | #define __pa(x) ((unsigned long)(x) & 0x7fffffff) | |
27 | #define __va(x) ((void *)((unsigned long)(x) | 0x80000000)) | |
28 | #endif | |
29 | ||
30 | #endif | |
31 | #endif |