1 /* SPDX-License-Identifier: GPL-2.0 */
6 * Privileged Space Mapping Buffer (PMB) definitions
8 #define PMB_PASCR 0xff000070
9 #define PMB_IRMCR 0xff000078
11 #define PASCR_SE 0x80000000
13 #define PMB_ADDR 0xf6100000
14 #define PMB_DATA 0xf7100000
16 #define NR_PMB_ENTRIES 16
18 #define PMB_E_MASK 0x0000000f
21 #define PMB_PFN_MASK 0xff000000
23 #define PMB_SZ_16M 0x00000000
24 #define PMB_SZ_64M 0x00000010
25 #define PMB_SZ_128M 0x00000080
26 #define PMB_SZ_512M 0x00000090
27 #define PMB_SZ_MASK PMB_SZ_512M
28 #define PMB_C 0x00000008
29 #define PMB_WT 0x00000001
30 #define PMB_UB 0x00000200
31 #define PMB_CACHE_MASK (PMB_C | PMB_WT | PMB_UB)
32 #define PMB_V 0x00000100
34 #define PMB_NO_ENTRY (-1)
37 #include <linux/errno.h>
38 #include <linux/threads.h>
41 /* Default "unsigned long" context */
42 typedef unsigned long mm_context_id_t
[NR_CPUS
];
49 unsigned long end_brk
;
51 #ifdef CONFIG_BINFMT_ELF_FDPIC
52 unsigned long exec_fdpic_loadmap
;
53 unsigned long interp_fdpic_loadmap
;
58 /* arch/sh/mm/pmb.c */
59 bool __in_29bit_mode(void);
62 int pmb_bolt_mapping(unsigned long virt
, phys_addr_t phys
,
63 unsigned long size
, pgprot_t prot
);
64 void __iomem
*pmb_remap_caller(phys_addr_t phys
, unsigned long size
,
65 pgprot_t prot
, void *caller
);
66 int pmb_unmap(void __iomem
*addr
);
71 pmb_bolt_mapping(unsigned long virt
, phys_addr_t phys
,
72 unsigned long size
, pgprot_t prot
)
77 static inline void __iomem
*
78 pmb_remap_caller(phys_addr_t phys
, unsigned long size
,
79 pgprot_t prot
, void *caller
)
84 static inline int pmb_unmap(void __iomem
*addr
)
89 #define pmb_init(addr) do { } while (0)
92 #define __in_29bit_mode() (1)
94 #define __in_29bit_mode() (0)
97 #endif /* CONFIG_PMB */
99 static inline void __iomem
*
100 pmb_remap(phys_addr_t phys
, unsigned long size
, pgprot_t prot
)
102 return pmb_remap_caller(phys
, size
, prot
, __builtin_return_address(0));
105 #endif /* __ASSEMBLY__ */