mmu.h 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. /*
  2. * Copyright (C) 2004, 2007-2010, 2011-2012 Synopsys, Inc. (www.synopsys.com)
  3. *
  4. * This program is free software; you can redistribute it and/or modify
  5. * it under the terms of the GNU General Public License version 2 as
  6. * published by the Free Software Foundation.
  7. */
  8. #ifndef _ASM_ARC_MMU_H
  9. #define _ASM_ARC_MMU_H
  10. #if defined(CONFIG_ARC_MMU_V1)
  11. #define CONFIG_ARC_MMU_VER 1
  12. #elif defined(CONFIG_ARC_MMU_V2)
  13. #define CONFIG_ARC_MMU_VER 2
  14. #elif defined(CONFIG_ARC_MMU_V3)
  15. #define CONFIG_ARC_MMU_VER 3
  16. #endif
  17. /* MMU Management regs */
  18. #define ARC_REG_MMU_BCR 0x06f
  19. #define ARC_REG_TLBPD0 0x405
  20. #define ARC_REG_TLBPD1 0x406
  21. #define ARC_REG_TLBINDEX 0x407
  22. #define ARC_REG_TLBCOMMAND 0x408
  23. #define ARC_REG_PID 0x409
  24. #define ARC_REG_SCRATCH_DATA0 0x418
  25. /* Bits in MMU PID register */
  26. #define MMU_ENABLE (1 << 31) /* Enable MMU for process */
  27. /* Error code if probe fails */
  28. #define TLB_LKUP_ERR 0x80000000
  29. /* TLB Commands */
  30. #define TLBWrite 0x1
  31. #define TLBRead 0x2
  32. #define TLBGetIndex 0x3
  33. #define TLBProbe 0x4
  34. #if (CONFIG_ARC_MMU_VER >= 2)
  35. #define TLBWriteNI 0x5 /* write JTLB without inv uTLBs */
  36. #define TLBIVUTLB 0x6 /* explicitly inv uTLBs */
  37. #endif
  38. #ifndef __ASSEMBLY__
  39. typedef struct {
  40. unsigned long asid; /* Pvt Addr-Space ID for mm */
  41. #ifdef CONFIG_ARC_TLB_DBG
  42. struct task_struct *tsk;
  43. #endif
  44. } mm_context_t;
  45. #ifdef CONFIG_ARC_DBG_TLB_PARANOIA
  46. void tlb_paranoid_check(unsigned int pid_sw, unsigned long address);
  47. #else
  48. #define tlb_paranoid_check(a, b)
  49. #endif
  50. void arc_mmu_init(void);
  51. extern char *arc_mmu_mumbojumbo(int cpu_id, char *buf, int len);
  52. void __init read_decode_mmu_bcr(void);
  53. #endif /* !__ASSEMBLY__ */
  54. #endif