iommu.h 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. #ifndef CELL_IOMMU_H
  2. #define CELL_IOMMU_H
  3. /* some constants */
  4. enum {
  5. /* segment table entries */
  6. IOST_VALID_MASK = 0x8000000000000000ul,
  7. IOST_TAG_MASK = 0x3000000000000000ul,
  8. IOST_PT_BASE_MASK = 0x000003fffffff000ul,
  9. IOST_NNPT_MASK = 0x0000000000000fe0ul,
  10. IOST_PS_MASK = 0x000000000000000ful,
  11. IOST_PS_4K = 0x1,
  12. IOST_PS_64K = 0x3,
  13. IOST_PS_1M = 0x5,
  14. IOST_PS_16M = 0x7,
  15. /* iopt tag register */
  16. IOPT_VALID_MASK = 0x0000000200000000ul,
  17. IOPT_TAG_MASK = 0x00000001fffffffful,
  18. /* iopt cache register */
  19. IOPT_PROT_MASK = 0xc000000000000000ul,
  20. IOPT_PROT_NONE = 0x0000000000000000ul,
  21. IOPT_PROT_READ = 0x4000000000000000ul,
  22. IOPT_PROT_WRITE = 0x8000000000000000ul,
  23. IOPT_PROT_RW = 0xc000000000000000ul,
  24. IOPT_COHERENT = 0x2000000000000000ul,
  25. IOPT_ORDER_MASK = 0x1800000000000000ul,
  26. /* order access to same IOID/VC on same address */
  27. IOPT_ORDER_ADDR = 0x0800000000000000ul,
  28. /* similar, but only after a write access */
  29. IOPT_ORDER_WRITES = 0x1000000000000000ul,
  30. /* Order all accesses to same IOID/VC */
  31. IOPT_ORDER_VC = 0x1800000000000000ul,
  32. IOPT_RPN_MASK = 0x000003fffffff000ul,
  33. IOPT_HINT_MASK = 0x0000000000000800ul,
  34. IOPT_IOID_MASK = 0x00000000000007fful,
  35. IOSTO_ENABLE = 0x8000000000000000ul,
  36. IOSTO_ORIGIN = 0x000003fffffff000ul,
  37. IOSTO_HW = 0x0000000000000800ul,
  38. IOSTO_SW = 0x0000000000000400ul,
  39. IOCMD_CONF_TE = 0x0000800000000000ul,
  40. /* memory mapped registers */
  41. IOC_PT_CACHE_DIR = 0x000,
  42. IOC_ST_CACHE_DIR = 0x800,
  43. IOC_PT_CACHE_REG = 0x910,
  44. IOC_ST_ORIGIN = 0x918,
  45. IOC_CONF = 0x930,
  46. /* The high bit needs to be set on every DMA address,
  47. only 2GB are addressable */
  48. CELL_DMA_VALID = 0x80000000,
  49. CELL_DMA_MASK = 0x7fffffff,
  50. };
  51. void cell_init_iommu(void);
  52. #endif