/arch/powerpc/include/asm/tce.h

http://github.com/mirrors/linux · C Header · 38 lines · 18 code · 8 blank · 12 comment · 0 complexity · 5ac33181097b41db4ead92fa998d6e22 MD5 · raw file

  1. /* SPDX-License-Identifier: GPL-2.0-or-later */
  2. /*
  3. * Copyright (C) 2001 Mike Corrigan & Dave Engebretsen, IBM Corporation
  4. * Rewrite, cleanup:
  5. * Copyright (C) 2004 Olof Johansson <olof@lixom.net>, IBM Corporation
  6. */
  7. #ifndef _ASM_POWERPC_TCE_H
  8. #define _ASM_POWERPC_TCE_H
  9. #ifdef __KERNEL__
  10. #include <asm/iommu.h>
  11. /*
  12. * Tces come in two formats, one for the virtual bus and a different
  13. * format for PCI. PCI TCEs can have hardware or software maintianed
  14. * coherency.
  15. */
  16. #define TCE_VB 0
  17. #define TCE_PCI 1
  18. /* TCE page size is 4096 bytes (1 << 12) */
  19. #define TCE_SHIFT 12
  20. #define TCE_PAGE_SIZE (1 << TCE_SHIFT)
  21. #define TCE_ENTRY_SIZE 8 /* each TCE is 64 bits */
  22. #define TCE_RPN_MASK 0xfffffffffful /* 40-bit RPN (4K pages) */
  23. #define TCE_RPN_SHIFT 12
  24. #define TCE_VALID 0x800 /* TCE valid */
  25. #define TCE_ALLIO 0x400 /* TCE valid for all lpars */
  26. #define TCE_PCI_WRITE 0x2 /* write from PCI allowed */
  27. #define TCE_PCI_READ 0x1 /* read from PCI allowed */
  28. #define TCE_VB_WRITE 0x1 /* write from VB allowed */
  29. #endif /* __KERNEL__ */
  30. #endif /* _ASM_POWERPC_TCE_H */