]> git.kernelconcepts.de Git - karo-tx-linux.git/blob - arch/powerpc/include/asm/abs_addr.h
powerpc: Remove FW_FEATURE ISERIES from arch code
[karo-tx-linux.git] / arch / powerpc / include / asm / abs_addr.h
1 #ifndef _ASM_POWERPC_ABS_ADDR_H
2 #define _ASM_POWERPC_ABS_ADDR_H
3 #ifdef __KERNEL__
4
5
6 /*
7  * c 2001 PPC 64 Team, IBM Corp
8  *
9  * This program is free software; you can redistribute it and/or
10  * modify it under the terms of the GNU General Public License
11  * as published by the Free Software Foundation; either version
12  * 2 of the License, or (at your option) any later version.
13  */
14
15 #include <linux/memblock.h>
16
17 #include <asm/types.h>
18 #include <asm/page.h>
19 #include <asm/prom.h>
20
21 struct mschunks_map {
22         unsigned long num_chunks;
23         unsigned long chunk_size;
24         unsigned long chunk_shift;
25         unsigned long chunk_mask;
26         u32 *mapping;
27 };
28
29 extern struct mschunks_map mschunks_map;
30
31 /* Chunks are 256 KB */
32 #define MSCHUNKS_CHUNK_SHIFT    (18)
33 #define MSCHUNKS_CHUNK_SIZE     (1UL << MSCHUNKS_CHUNK_SHIFT)
34 #define MSCHUNKS_OFFSET_MASK    (MSCHUNKS_CHUNK_SIZE - 1)
35
36 static inline unsigned long chunk_to_addr(unsigned long chunk)
37 {
38         return chunk << MSCHUNKS_CHUNK_SHIFT;
39 }
40
41 static inline unsigned long addr_to_chunk(unsigned long addr)
42 {
43         return addr >> MSCHUNKS_CHUNK_SHIFT;
44 }
45
46 static inline unsigned long phys_to_abs(unsigned long pa)
47 {
48         return pa;
49 }
50
51 /* Convenience macros */
52 #define virt_to_abs(va) phys_to_abs(__pa(va))
53 #define abs_to_virt(aa) __va(aa)
54
55 #endif /* __KERNEL__ */
56 #endif /* _ASM_POWERPC_ABS_ADDR_H */