summaryrefslogtreecommitdiffstats
path: root/arch/ppc/mach-mpc85xx/include/mach/mmu.h
blob: e2ecc62ef03edf80d7db1dad439baefd181d5ede (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
/*
 * Copyright 2012 GE Intelligent Platforms, Inc.
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * Version 2 as published by the Free Software Foundation.
 */

#ifndef _MPC85XX_MMU_H_
#define _MPC85XX_MMU_H_

#ifdef CONFIG_E500
#include <asm/mmu.h>

#ifndef __ASSEMBLY__
extern int e500_find_free_tlbcam(void);
extern void e500_read_tlbcam_entry(int idx, u32 *valid, u32 *tsize,
		unsigned long *epn, phys_addr_t *rpn);
extern void e500_read_tlbcam_entry(int idx, u32 *valid, u32 *tsize,
		unsigned long *epn, phys_addr_t *rpn);
extern void e500_set_tlb(u8 tlb, u32 epn, u64 rpn, u8 perms, u8 wimge,
		u8 ts, u8 esel, u8 tsize, u8 iprot);
extern void e500_disable_tlb(u8 esel);
extern void e500_invalidate_tlb(u8 tlb);
extern void e500_init_tlbs(void);
extern int e500_find_tlb_idx(void *addr, u8 tlbsel);
extern void e500_init_used_tlb_cams(void);

extern unsigned int e500_setup_ddr_tlbs(unsigned int memsize_in_meg);
extern void e500_write_tlb(u32 _mas0, u32 _mas1, u32 _mas2, u32 _mas3,
			u32 _mas7);

#define FSL_SET_TLB_ENTRY(_tlb, _epn, _rpn, _perms, _wimge, _ts, _esel, _sz,\
			_iprot) \
	{ .mas0 = FSL_BOOKE_MAS0(_tlb, _esel, 0), \
	  .mas1 = FSL_BOOKE_MAS1(1, _iprot, 0, _ts, _sz), \
	  .mas2 = FSL_BOOKE_MAS2(_epn, _wimge), \
	  .mas3 = FSL_BOOKE_MAS3(_rpn, 0, _perms), \
	  .mas7 = FSL_BOOKE_MAS7(_rpn), }

struct fsl_e_tlb_entry {
	u32	mas0;
	u32	mas1;
	u32	mas2;
	u32	mas3;
	u32	mas7;
};
extern struct fsl_e_tlb_entry tlb_table[];
extern int num_tlb_entries;
#endif
#endif
#endif /* _MPC85XX_MMU_H_ */