xref: /openbmc/linux/arch/sh/include/asm/mmu.h (revision b6dcefde)
1 #ifndef __MMU_H
2 #define __MMU_H
3 
4 /*
5  * Privileged Space Mapping Buffer (PMB) definitions
6  */
7 #define PMB_PASCR		0xff000070
8 #define PMB_IRMCR		0xff000078
9 
10 #define PASCR_SE		0x80000000
11 
12 #define PMB_ADDR		0xf6100000
13 #define PMB_DATA		0xf7100000
14 #define PMB_ENTRY_MAX		16
15 #define PMB_E_MASK		0x0000000f
16 #define PMB_E_SHIFT		8
17 
18 #define PMB_PFN_MASK		0xff000000
19 
20 #define PMB_SZ_16M		0x00000000
21 #define PMB_SZ_64M		0x00000010
22 #define PMB_SZ_128M		0x00000080
23 #define PMB_SZ_512M		0x00000090
24 #define PMB_SZ_MASK		PMB_SZ_512M
25 #define PMB_C			0x00000008
26 #define PMB_WT			0x00000001
27 #define PMB_UB			0x00000200
28 #define PMB_V			0x00000100
29 
30 #define PMB_NO_ENTRY		(-1)
31 
32 #ifndef __ASSEMBLY__
33 
34 /* Default "unsigned long" context */
35 typedef unsigned long mm_context_id_t[NR_CPUS];
36 
37 typedef struct {
38 #ifdef CONFIG_MMU
39 	mm_context_id_t		id;
40 	void			*vdso;
41 #else
42 	unsigned long		end_brk;
43 #endif
44 #ifdef CONFIG_BINFMT_ELF_FDPIC
45 	unsigned long		exec_fdpic_loadmap;
46 	unsigned long		interp_fdpic_loadmap;
47 #endif
48 } mm_context_t;
49 
50 struct pmb_entry;
51 
52 struct pmb_entry {
53 	unsigned long vpn;
54 	unsigned long ppn;
55 	unsigned long flags;
56 
57 	/*
58 	 * 0 .. NR_PMB_ENTRIES for specific entry selection, or
59 	 * PMB_NO_ENTRY to search for a free one
60 	 */
61 	int entry;
62 
63 	struct pmb_entry *next;
64 	/* Adjacent entry link for contiguous multi-entry mappings */
65 	struct pmb_entry *link;
66 };
67 
68 /* arch/sh/mm/pmb.c */
69 long pmb_remap(unsigned long virt, unsigned long phys,
70 	       unsigned long size, unsigned long flags);
71 void pmb_unmap(unsigned long addr);
72 int pmb_init(void);
73 #endif /* __ASSEMBLY__ */
74 
75 #endif /* __MMU_H */
76