xref: /linux/arch/parisc/include/asm/fixmap.h (revision 4f2c0a4acffbec01079c28f839422e64ddeff004)
1b2441318SGreg Kroah-Hartman /* SPDX-License-Identifier: GPL-2.0 */
2deae26bfSKyle McMartin #ifndef _ASM_FIXMAP_H
3deae26bfSKyle McMartin #define _ASM_FIXMAP_H
4deae26bfSKyle McMartin 
5deae26bfSKyle McMartin /*
6deae26bfSKyle McMartin  * This file defines the locations of the fixed mappings on parisc.
7deae26bfSKyle McMartin  *
8deae26bfSKyle McMartin  * All of the values in this file are machine virtual addresses.
9deae26bfSKyle McMartin  *
10deae26bfSKyle McMartin  * All of the values in this file must be <4GB (because of assembly
11deae26bfSKyle McMartin  * loading restrictions).  If you place this region anywhere above
12*c64c782eSJohn David Anglin  * __PAGE_OFFSET, you must adjust the memory map accordingly
13*c64c782eSJohn David Anglin  */
14deae26bfSKyle McMartin 
15*c64c782eSJohn David Anglin /*
16*c64c782eSJohn David Anglin  * The tmpalias region is used in kernel space to copy/clear/flush data
17*c64c782eSJohn David Anglin  * from pages congruently mapped with user space. It is comprised of
18*c64c782eSJohn David Anglin  * a pair regions. The size of these regions is determined by the largest
19*c64c782eSJohn David Anglin  * cache aliasing boundary for machines that support equivalent aliasing.
20*c64c782eSJohn David Anglin  *
21*c64c782eSJohn David Anglin  * The c3750 with PA8700 processor returns an alias value of 11. This
22*c64c782eSJohn David Anglin  * indicates that it has an alias boundary of 4 MB. It also supports
23*c64c782eSJohn David Anglin  * non-equivalent aliasing without a performance penalty.
24*c64c782eSJohn David Anglin  *
25*c64c782eSJohn David Anglin  * Machines with PA8800/PA8900 processors return an alias value of 0.
26*c64c782eSJohn David Anglin  * This indicates the alias boundary is unknown and may be larger than
27*c64c782eSJohn David Anglin  * 16 MB. Non-equivalent aliasing is not supported.
28*c64c782eSJohn David Anglin  *
29*c64c782eSJohn David Anglin  * Here we assume the maximum alias boundary is 4 MB.
30*c64c782eSJohn David Anglin  */
31*c64c782eSJohn David Anglin #define TMPALIAS_SIZE_BITS	22	/* 4 MB */
32*c64c782eSJohn David Anglin #define TMPALIAS_MAP_START	((__PAGE_OFFSET) - (2 << TMPALIAS_SIZE_BITS))
33ccfbc68dSSven Schnelle 
34ccfbc68dSSven Schnelle #define FIXMAP_SIZE		(FIX_BITMAP_COUNT << PAGE_SHIFT)
35ccfbc68dSSven Schnelle #define FIXMAP_START		(TMPALIAS_MAP_START - FIXMAP_SIZE)
36deae26bfSKyle McMartin /* This is the kernel area for all maps (vmalloc, dma etc.)  most
37deae26bfSKyle McMartin  * usually, it extends up to TMPALIAS_MAP_START.  Virtual addresses
38deae26bfSKyle McMartin  * 0..GATEWAY_PAGE_SIZE are reserved for the gateway page */
39deae26bfSKyle McMartin #define KERNEL_MAP_START	(GATEWAY_PAGE_SIZE)
40ccfbc68dSSven Schnelle #define KERNEL_MAP_END		(FIXMAP_START)
41deae26bfSKyle McMartin 
42deae26bfSKyle McMartin #ifndef __ASSEMBLY__
43ccfbc68dSSven Schnelle 
44ccfbc68dSSven Schnelle 
45ccfbc68dSSven Schnelle enum fixed_addresses {
46ccfbc68dSSven Schnelle 	/* Support writing RO kernel text via kprobes, jump labels, etc. */
47ccfbc68dSSven Schnelle 	FIX_TEXT_POKE0,
48fc697dc0SSven Schnelle 	FIX_TEXT_KEXEC,
49ccfbc68dSSven Schnelle 	FIX_BITMAP_COUNT
50ccfbc68dSSven Schnelle };
51ccfbc68dSSven Schnelle 
524255f0d2SHelge Deller extern void *parisc_vmalloc_start;
53deae26bfSKyle McMartin #define PCXL_DMA_MAP_SIZE	(8*1024*1024)
544255f0d2SHelge Deller #define VMALLOC_START		((unsigned long)parisc_vmalloc_start)
55deae26bfSKyle McMartin #define VMALLOC_END		(KERNEL_MAP_END)
56ccfbc68dSSven Schnelle 
57ccfbc68dSSven Schnelle #define __fix_to_virt(_x) (FIXMAP_START + ((_x) << PAGE_SHIFT))
58ccfbc68dSSven Schnelle 
59ccfbc68dSSven Schnelle void set_fixmap(enum fixed_addresses idx, phys_addr_t phys);
60ccfbc68dSSven Schnelle void clear_fixmap(enum fixed_addresses idx);
61ccfbc68dSSven Schnelle 
62deae26bfSKyle McMartin #endif /*__ASSEMBLY__*/
63deae26bfSKyle McMartin 
64deae26bfSKyle McMartin #endif /*_ASM_FIXMAP_H*/
65