stream_id_lsch3.h 3.0 KB

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