aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sh/include/asm/mmu.h
diff options
context:
space:
mode:
authorAndrea Bastoni <bastoni@cs.unc.edu>2010-05-30 19:16:45 -0400
committerAndrea Bastoni <bastoni@cs.unc.edu>2010-05-30 19:16:45 -0400
commitada47b5fe13d89735805b566185f4885f5a3f750 (patch)
tree644b88f8a71896307d71438e9b3af49126ffb22b /arch/sh/include/asm/mmu.h
parent43e98717ad40a4ae64545b5ba047c7b86aa44f4f (diff)
parent3280f21d43ee541f97f8cda5792150d2dbec20d5 (diff)
Merge branch 'wip-2.6.34' into old-private-masterarchived-private-master
Diffstat (limited to 'arch/sh/include/asm/mmu.h')
-rw-r--r--arch/sh/include/asm/mmu.h82
1 files changed, 55 insertions, 27 deletions
diff --git a/arch/sh/include/asm/mmu.h b/arch/sh/include/asm/mmu.h
index f5963037c9d6..56e4418c19b9 100644
--- a/arch/sh/include/asm/mmu.h
+++ b/arch/sh/include/asm/mmu.h
@@ -7,12 +7,18 @@
7#define PMB_PASCR 0xff000070 7#define PMB_PASCR 0xff000070
8#define PMB_IRMCR 0xff000078 8#define PMB_IRMCR 0xff000078
9 9
10#define PASCR_SE 0x80000000
11
10#define PMB_ADDR 0xf6100000 12#define PMB_ADDR 0xf6100000
11#define PMB_DATA 0xf7100000 13#define PMB_DATA 0xf7100000
12#define PMB_ENTRY_MAX 16 14
15#define NR_PMB_ENTRIES 16
16
13#define PMB_E_MASK 0x0000000f 17#define PMB_E_MASK 0x0000000f
14#define PMB_E_SHIFT 8 18#define PMB_E_SHIFT 8
15 19
20#define PMB_PFN_MASK 0xff000000
21
16#define PMB_SZ_16M 0x00000000 22#define PMB_SZ_16M 0x00000000
17#define PMB_SZ_64M 0x00000010 23#define PMB_SZ_64M 0x00000010
18#define PMB_SZ_128M 0x00000080 24#define PMB_SZ_128M 0x00000080
@@ -21,11 +27,15 @@
21#define PMB_C 0x00000008 27#define PMB_C 0x00000008
22#define PMB_WT 0x00000001 28#define PMB_WT 0x00000001
23#define PMB_UB 0x00000200 29#define PMB_UB 0x00000200
30#define PMB_CACHE_MASK (PMB_C | PMB_WT | PMB_UB)
24#define PMB_V 0x00000100 31#define PMB_V 0x00000100
25 32
26#define PMB_NO_ENTRY (-1) 33#define PMB_NO_ENTRY (-1)
27 34
28#ifndef __ASSEMBLY__ 35#ifndef __ASSEMBLY__
36#include <linux/errno.h>
37#include <linux/threads.h>
38#include <asm/page.h>
29 39
30/* Default "unsigned long" context */ 40/* Default "unsigned long" context */
31typedef unsigned long mm_context_id_t[NR_CPUS]; 41typedef unsigned long mm_context_id_t[NR_CPUS];
@@ -43,36 +53,54 @@ typedef struct {
43#endif 53#endif
44} mm_context_t; 54} mm_context_t;
45 55
46struct pmb_entry; 56#ifdef CONFIG_PMB
57/* arch/sh/mm/pmb.c */
58bool __in_29bit_mode(void);
59
60void pmb_init(void);
61int pmb_bolt_mapping(unsigned long virt, phys_addr_t phys,
62 unsigned long size, pgprot_t prot);
63void __iomem *pmb_remap_caller(phys_addr_t phys, unsigned long size,
64 pgprot_t prot, void *caller);
65int pmb_unmap(void __iomem *addr);
47 66
48struct pmb_entry { 67#else
49 unsigned long vpn;
50 unsigned long ppn;
51 unsigned long flags;
52 68
53 /* 69static inline int
54 * 0 .. NR_PMB_ENTRIES for specific entry selection, or 70pmb_bolt_mapping(unsigned long virt, phys_addr_t phys,
55 * PMB_NO_ENTRY to search for a free one 71 unsigned long size, pgprot_t prot)
56 */ 72{
57 int entry; 73 return -EINVAL;
74}
58 75
59 struct pmb_entry *next; 76static inline void __iomem *
60 /* Adjacent entry link for contiguous multi-entry mappings */ 77pmb_remap_caller(phys_addr_t phys, unsigned long size,
61 struct pmb_entry *link; 78 pgprot_t prot, void *caller)
62}; 79{
80 return NULL;
81}
82
83static inline int pmb_unmap(void __iomem *addr)
84{
85 return -EINVAL;
86}
87
88#define pmb_init(addr) do { } while (0)
89
90#ifdef CONFIG_29BIT
91#define __in_29bit_mode() (1)
92#else
93#define __in_29bit_mode() (0)
94#endif
95
96#endif /* CONFIG_PMB */
97
98static inline void __iomem *
99pmb_remap(phys_addr_t phys, unsigned long size, pgprot_t prot)
100{
101 return pmb_remap_caller(phys, size, prot, __builtin_return_address(0));
102}
63 103
64/* arch/sh/mm/pmb.c */
65int __set_pmb_entry(unsigned long vpn, unsigned long ppn,
66 unsigned long flags, int *entry);
67int set_pmb_entry(struct pmb_entry *pmbe);
68void clear_pmb_entry(struct pmb_entry *pmbe);
69struct pmb_entry *pmb_alloc(unsigned long vpn, unsigned long ppn,
70 unsigned long flags);
71void pmb_free(struct pmb_entry *pmbe);
72long pmb_remap(unsigned long virt, unsigned long phys,
73 unsigned long size, unsigned long flags);
74void pmb_unmap(unsigned long addr);
75#endif /* __ASSEMBLY__ */ 104#endif /* __ASSEMBLY__ */
76 105
77#endif /* __MMU_H */ 106#endif /* __MMU_H */
78