stream_id_lsch3.h 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. /* SPDX-License-Identifier: GPL-2.0+ */
  2. /*
  3. * Copyright 2014 Freescale Semiconductor, Inc.
  4. *
  5. */
  6. #ifndef __FSL_STREAM_ID_H
  7. #define __FSL_STREAM_ID_H
  8. /*
  9. * Stream IDs on NXP Chassis-3 (for example ls2080a, ls1088a, ls2088a)
  10. * devices are not hardwired and are programmed by sw. There are a limited
  11. * number of stream IDs available, and the partitioning of them is scenario
  12. * dependent. This header defines the partitioning between legacy,
  13. * PCI, and DPAA2 devices.
  14. *
  15. * This partitioning can be customized in this file depending
  16. * on the specific hardware config:
  17. *
  18. * -non-PCI legacy, platform devices (USB, SD/MMC, SATA, DMA)
  19. * -all legacy devices get a unique stream ID assigned and programmed in
  20. * their AMQR registers by u-boot
  21. *
  22. * -PCIe
  23. * -there is a range of stream IDs set aside for PCI in this
  24. * file. U-boot will scan the PCI bus and for each device discovered:
  25. * -allocate a streamID
  26. * -set a PEXn LUT table entry mapping 'requester ID' to 'stream ID'
  27. * -set a msi-map entry in the PEXn controller node in the
  28. * device tree (see Documentation/devicetree/bindings/pci/pci-msi.txt
  29. * for more info on the msi-map definition)
  30. * -set a iommu-map entry in the PEXn controller node in the
  31. * device tree (see Documentation/devicetree/bindings/pci/pci-iommu.txt
  32. * for more info on the iommu-map definition)
  33. *
  34. * -DPAA2
  35. * -u-boot will allocate a range of stream IDs to be used by the Management
  36. * Complex for containers and will set these values in the MC DPC image.
  37. * -the MC is responsible for allocating and setting up 'isolation context
  38. * IDs (ICIDs) based on the allocated stream IDs for all DPAA2 devices.
  39. *
  40. * On Chasis-3 SoCs stream IDs are programmed in AMQ registers (32-bits) for
  41. * each of the different bus masters. The relationship between
  42. * the AMQ registers and stream IDs is defined in the table below:
  43. * AMQ bit streamID bit
  44. * ---------------------------
  45. * PL[18] 9 // privilege bit
  46. * BMT[17] 8 // bypass translation
  47. * VA[16] 7 // reserved
  48. * [15] - // unused
  49. * ICID[14:7] - // unused
  50. * ICID[6:0] 6-0 // isolation context id
  51. * ----------------------------
  52. *
  53. */
  54. #define AMQ_PL_MASK (0x1 << 18) /* priviledge bit */
  55. #define AMQ_BMT_MASK (0x1 << 17) /* bypass bit */
  56. #define FSL_INVALID_STREAM_ID 0
  57. #define FSL_BYPASS_AMQ (AMQ_PL_MASK | AMQ_BMT_MASK)
  58. /* legacy devices */
  59. #define FSL_USB1_STREAM_ID 1
  60. #define FSL_USB2_STREAM_ID 2
  61. #define FSL_SDMMC_STREAM_ID 3
  62. #define FSL_SATA1_STREAM_ID 4
  63. #if defined(CONFIG_ARCH_LS2080A)
  64. #define FSL_SATA2_STREAM_ID 5
  65. #endif
  66. #if defined(CONFIG_ARCH_LS2080A)
  67. #define FSL_DMA_STREAM_ID 6
  68. #elif defined(CONFIG_ARCH_LS1088A)
  69. #define FSL_DMA_STREAM_ID 5
  70. #endif
  71. /* PCI - programmed in PEXn_LUT */
  72. #define FSL_PEX_STREAM_ID_START 7
  73. #if defined(CONFIG_ARCH_LS2080A)
  74. #define FSL_PEX_STREAM_ID_END 22
  75. #elif defined(CONFIG_ARCH_LS1088A)
  76. #define FSL_PEX_STREAM_ID_END 18
  77. #endif
  78. /* DPAA2 - set in MC DPC and alloced by MC */
  79. #define FSL_DPAA2_STREAM_ID_START 23
  80. #define FSL_DPAA2_STREAM_ID_END 63
  81. #endif