hfi_venus_io.h 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. /*
  2. * Copyright (c) 2012-2016, The Linux Foundation. All rights reserved.
  3. * Copyright (C) 2017 Linaro Ltd.
  4. *
  5. * This program is free software; you can redistribute it and/or modify
  6. * it under the terms of the GNU General Public License version 2 and
  7. * only version 2 as published by the Free Software Foundation.
  8. *
  9. * This program is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. * GNU General Public License for more details.
  13. *
  14. */
  15. #ifndef __VENUS_HFI_VENUS_IO_H__
  16. #define __VENUS_HFI_VENUS_IO_H__
  17. #define VBIF_BASE 0x80000
  18. #define VBIF_AXI_HALT_CTRL0 (VBIF_BASE + 0x208)
  19. #define VBIF_AXI_HALT_CTRL1 (VBIF_BASE + 0x20c)
  20. #define VBIF_AXI_HALT_CTRL0_HALT_REQ BIT(0)
  21. #define VBIF_AXI_HALT_CTRL1_HALT_ACK BIT(0)
  22. #define VBIF_AXI_HALT_ACK_TIMEOUT_US 500000
  23. #define CPU_BASE 0xc0000
  24. #define CPU_CS_BASE (CPU_BASE + 0x12000)
  25. #define CPU_IC_BASE (CPU_BASE + 0x1f000)
  26. #define CPU_CS_A2HSOFTINTCLR (CPU_CS_BASE + 0x1c)
  27. #define VIDC_CTRL_INIT (CPU_CS_BASE + 0x48)
  28. #define VIDC_CTRL_INIT_RESERVED_BITS31_1_MASK 0xfffffffe
  29. #define VIDC_CTRL_INIT_RESERVED_BITS31_1_SHIFT 1
  30. #define VIDC_CTRL_INIT_CTRL_MASK 0x1
  31. #define VIDC_CTRL_INIT_CTRL_SHIFT 0
  32. /* HFI control status */
  33. #define CPU_CS_SCIACMDARG0 (CPU_CS_BASE + 0x4c)
  34. #define CPU_CS_SCIACMDARG0_MASK 0xff
  35. #define CPU_CS_SCIACMDARG0_SHIFT 0x0
  36. #define CPU_CS_SCIACMDARG0_ERROR_STATUS_MASK 0xfe
  37. #define CPU_CS_SCIACMDARG0_ERROR_STATUS_SHIFT 0x1
  38. #define CPU_CS_SCIACMDARG0_INIT_STATUS_MASK 0x1
  39. #define CPU_CS_SCIACMDARG0_INIT_STATUS_SHIFT 0x0
  40. #define CPU_CS_SCIACMDARG0_PC_READY BIT(8)
  41. #define CPU_CS_SCIACMDARG0_INIT_IDLE_MSG_MASK BIT(30)
  42. /* HFI queue table info */
  43. #define CPU_CS_SCIACMDARG1 (CPU_CS_BASE + 0x50)
  44. /* HFI queue table address */
  45. #define CPU_CS_SCIACMDARG2 (CPU_CS_BASE + 0x54)
  46. /* Venus cpu */
  47. #define CPU_CS_SCIACMDARG3 (CPU_CS_BASE + 0x58)
  48. #define SFR_ADDR (CPU_CS_BASE + 0x5c)
  49. #define MMAP_ADDR (CPU_CS_BASE + 0x60)
  50. #define UC_REGION_ADDR (CPU_CS_BASE + 0x64)
  51. #define UC_REGION_SIZE (CPU_CS_BASE + 0x68)
  52. #define CPU_IC_SOFTINT (CPU_IC_BASE + 0x18)
  53. #define CPU_IC_SOFTINT_H2A_MASK 0x8000
  54. #define CPU_IC_SOFTINT_H2A_SHIFT 0xf
  55. /* Venus wrapper */
  56. #define WRAPPER_BASE 0x000e0000
  57. #define WRAPPER_HW_VERSION (WRAPPER_BASE + 0x00)
  58. #define WRAPPER_HW_VERSION_MAJOR_VERSION_MASK 0x78000000
  59. #define WRAPPER_HW_VERSION_MAJOR_VERSION_SHIFT 28
  60. #define WRAPPER_HW_VERSION_MINOR_VERSION_MASK 0xfff0000
  61. #define WRAPPER_HW_VERSION_MINOR_VERSION_SHIFT 16
  62. #define WRAPPER_HW_VERSION_STEP_VERSION_MASK 0xffff
  63. #define WRAPPER_CLOCK_CONFIG (WRAPPER_BASE + 0x04)
  64. #define WRAPPER_INTR_STATUS (WRAPPER_BASE + 0x0c)
  65. #define WRAPPER_INTR_STATUS_A2HWD_MASK 0x10
  66. #define WRAPPER_INTR_STATUS_A2HWD_SHIFT 0x4
  67. #define WRAPPER_INTR_STATUS_A2H_MASK 0x4
  68. #define WRAPPER_INTR_STATUS_A2H_SHIFT 0x2
  69. #define WRAPPER_INTR_MASK (WRAPPER_BASE + 0x10)
  70. #define WRAPPER_INTR_MASK_A2HWD_BASK 0x10
  71. #define WRAPPER_INTR_MASK_A2HWD_SHIFT 0x4
  72. #define WRAPPER_INTR_MASK_A2HVCODEC_MASK 0x8
  73. #define WRAPPER_INTR_MASK_A2HVCODEC_SHIFT 0x3
  74. #define WRAPPER_INTR_MASK_A2HCPU_MASK 0x4
  75. #define WRAPPER_INTR_MASK_A2HCPU_SHIFT 0x2
  76. #define WRAPPER_INTR_CLEAR (WRAPPER_BASE + 0x14)
  77. #define WRAPPER_INTR_CLEAR_A2HWD_MASK 0x10
  78. #define WRAPPER_INTR_CLEAR_A2HWD_SHIFT 0x4
  79. #define WRAPPER_INTR_CLEAR_A2H_MASK 0x4
  80. #define WRAPPER_INTR_CLEAR_A2H_SHIFT 0x2
  81. #define WRAPPER_POWER_STATUS (WRAPPER_BASE + 0x44)
  82. #define WRAPPER_VDEC_VCODEC_POWER_CONTROL (WRAPPER_BASE + 0x48)
  83. #define WRAPPER_VENC_VCODEC_POWER_CONTROL (WRAPPER_BASE + 0x4c)
  84. #define WRAPPER_VDEC_VENC_AHB_BRIDGE_SYNC_RESET (WRAPPER_BASE + 0x64)
  85. #define WRAPPER_CPU_CLOCK_CONFIG (WRAPPER_BASE + 0x2000)
  86. #define WRAPPER_CPU_AXI_HALT (WRAPPER_BASE + 0x2008)
  87. #define WRAPPER_CPU_AXI_HALT_HALT BIT(16)
  88. #define WRAPPER_CPU_AXI_HALT_STATUS (WRAPPER_BASE + 0x200c)
  89. #define WRAPPER_CPU_AXI_HALT_STATUS_IDLE BIT(24)
  90. #define WRAPPER_CPU_CGC_DIS (WRAPPER_BASE + 0x2010)
  91. #define WRAPPER_CPU_STATUS (WRAPPER_BASE + 0x2014)
  92. #define WRAPPER_CPU_STATUS_WFI BIT(0)
  93. #define WRAPPER_SW_RESET (WRAPPER_BASE + 0x3000)
  94. /* Venus 4xx */
  95. #define WRAPPER_VCODEC0_MMCC_POWER_STATUS (WRAPPER_BASE + 0x90)
  96. #define WRAPPER_VCODEC0_MMCC_POWER_CONTROL (WRAPPER_BASE + 0x94)
  97. #define WRAPPER_VCODEC1_MMCC_POWER_STATUS (WRAPPER_BASE + 0x110)
  98. #define WRAPPER_VCODEC1_MMCC_POWER_CONTROL (WRAPPER_BASE + 0x114)
  99. #endif