fimc-is-regs.h 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /*
  3. * Samsung EXYNOS4x12 FIMC-IS (Imaging Subsystem) driver
  4. *
  5. * Copyright (C) 2013 Samsung Electronics Co., Ltd.
  6. *
  7. * Authors: Sylwester Nawrocki <s.nawrocki@samsung.com>
  8. * Younghwan Joo <yhwan.joo@samsung.com>
  9. */
  10. #ifndef FIMC_IS_REG_H_
  11. #define FIMC_IS_REG_H_
  12. /* WDT_ISP register */
  13. #define REG_WDT_ISP 0x00170000
  14. /* MCUCTL registers base offset */
  15. #define MCUCTL_BASE 0x00180000
  16. /* MCU Controller Register */
  17. #define MCUCTL_REG_MCUCTRL (MCUCTL_BASE + 0x00)
  18. #define MCUCTRL_MSWRST (1 << 0)
  19. /* Boot Base Offset Address Register */
  20. #define MCUCTL_REG_BBOAR (MCUCTL_BASE + 0x04)
  21. /* Interrupt Generation Register 0 from Host CPU to VIC */
  22. #define MCUCTL_REG_INTGR0 (MCUCTL_BASE + 0x08)
  23. /* __n = 0...9 */
  24. #define INTGR0_INTGC(__n) (1 << ((__n) + 16))
  25. /* __n = 0...5 */
  26. #define INTGR0_INTGD(__n) (1 << (__n))
  27. /* Interrupt Clear Register 0 from Host CPU to VIC */
  28. #define MCUCTL_REG_INTCR0 (MCUCTL_BASE + 0x0c)
  29. /* __n = 0...9 */
  30. #define INTCR0_INTGC(__n) (1 << ((__n) + 16))
  31. /* __n = 0...5 */
  32. #define INTCR0_INTCD(__n) (1 << ((__n) + 16))
  33. /* Interrupt Mask Register 0 from Host CPU to VIC */
  34. #define MCUCTL_REG_INTMR0 (MCUCTL_BASE + 0x10)
  35. /* __n = 0...9 */
  36. #define INTMR0_INTMC(__n) (1 << ((__n) + 16))
  37. /* __n = 0...5 */
  38. #define INTMR0_INTMD(__n) (1 << (__n))
  39. /* Interrupt Status Register 0 from Host CPU to VIC */
  40. #define MCUCTL_REG_INTSR0 (MCUCTL_BASE + 0x14)
  41. /* __n (bit number) = 0...4 */
  42. #define INTSR0_GET_INTSD(x, __n) (((x) >> (__n)) & 0x1)
  43. /* __n (bit number) = 0...9 */
  44. #define INTSR0_GET_INTSC(x, __n) (((x) >> ((__n) + 16)) & 0x1)
  45. /* Interrupt Mask Status Register 0 from Host CPU to VIC */
  46. #define MCUCTL_REG_INTMSR0 (MCUCTL_BASE + 0x18)
  47. /* __n (bit number) = 0...4 */
  48. #define INTMSR0_GET_INTMSD(x, __n) (((x) >> (__n)) & 0x1)
  49. /* __n (bit number) = 0...9 */
  50. #define INTMSR0_GET_INTMSC(x, __n) (((x) >> ((__n) + 16)) & 0x1)
  51. /* Interrupt Generation Register 1 from ISP CPU to Host IC */
  52. #define MCUCTL_REG_INTGR1 (MCUCTL_BASE + 0x1c)
  53. /* __n = 0...9 */
  54. #define INTGR1_INTGC(__n) (1 << (__n))
  55. /* Interrupt Clear Register 1 from ISP CPU to Host IC */
  56. #define MCUCTL_REG_INTCR1 (MCUCTL_BASE + 0x20)
  57. /* __n = 0...9 */
  58. #define INTCR1_INTCC(__n) (1 << (__n))
  59. /* Interrupt Mask Register 1 from ISP CPU to Host IC */
  60. #define MCUCTL_REG_INTMR1 (MCUCTL_BASE + 0x24)
  61. /* __n = 0...9 */
  62. #define INTMR1_INTMC(__n) (1 << (__n))
  63. /* Interrupt Status Register 1 from ISP CPU to Host IC */
  64. #define MCUCTL_REG_INTSR1 (MCUCTL_BASE + 0x28)
  65. /* Interrupt Mask Status Register 1 from ISP CPU to Host IC */
  66. #define MCUCTL_REG_INTMSR1 (MCUCTL_BASE + 0x2c)
  67. /* Interrupt Clear Register 2 from ISP BLK's interrupts to Host IC */
  68. #define MCUCTL_REG_INTCR2 (MCUCTL_BASE + 0x30)
  69. /* __n = 0...5 */
  70. #define INTCR2_INTCC(__n) (1 << ((__n) + 16))
  71. /* Interrupt Mask Register 2 from ISP BLK's interrupts to Host IC */
  72. #define MCUCTL_REG_INTMR2 (MCUCTL_BASE + 0x34)
  73. /* __n = 0...25 */
  74. #define INTMR2_INTMCIS(__n) (1 << (__n))
  75. /* Interrupt Status Register 2 from ISP BLK's interrupts to Host IC */
  76. #define MCUCTL_REG_INTSR2 (MCUCTL_BASE + 0x38)
  77. /* Interrupt Mask Status Register 2 from ISP BLK's interrupts to Host IC */
  78. #define MCUCTL_REG_INTMSR2 (MCUCTL_BASE + 0x3c)
  79. /* General Purpose Output Control Register (0~17) */
  80. #define MCUCTL_REG_GPOCTLR (MCUCTL_BASE + 0x40)
  81. /* __n = 0...17 */
  82. #define GPOCTLR_GPOG(__n) (1 << (__n))
  83. /* General Purpose Pad Output Enable Register (0~17) */
  84. #define MCUCTL_REG_GPOENCTLR (MCUCTL_BASE + 0x44)
  85. /* __n = 0...17 */
  86. #define GPOENCTLR_GPOEN(__n) (1 << (__n))
  87. /* General Purpose Input Control Register (0~17) */
  88. #define MCUCTL_REG_GPICTLR (MCUCTL_BASE + 0x48)
  89. /* Shared registers between ISP CPU and the host CPU - ISSRxx */
  90. /* ISSR(1): Command Host -> IS */
  91. /* ISSR(1): Sensor ID for Command, ISSR2...5 = Parameter 1...4 */
  92. /* ISSR(10): Reply IS -> Host */
  93. /* ISSR(11): Sensor ID for Reply, ISSR12...15 = Parameter 1...4 */
  94. /* ISSR(20): ISP_FRAME_DONE : SENSOR ID */
  95. /* ISSR(21): ISP_FRAME_DONE : PARAMETER 1 */
  96. /* ISSR(24): SCALERC_FRAME_DONE : SENSOR ID */
  97. /* ISSR(25): SCALERC_FRAME_DONE : PARAMETER 1 */
  98. /* ISSR(28): 3DNR_FRAME_DONE : SENSOR ID */
  99. /* ISSR(29): 3DNR_FRAME_DONE : PARAMETER 1 */
  100. /* ISSR(32): SCALERP_FRAME_DONE : SENSOR ID */
  101. /* ISSR(33): SCALERP_FRAME_DONE : PARAMETER 1 */
  102. /* __n = 0...63 */
  103. #define MCUCTL_REG_ISSR(__n) (MCUCTL_BASE + 0x80 + ((__n) * 4))
  104. /* PMU ISP register offsets */
  105. #define REG_CMU_RESET_ISP_SYS_PWR_REG 0x1174
  106. #define REG_CMU_SYSCLK_ISP_SYS_PWR_REG 0x13b8
  107. #define REG_PMU_ISP_ARM_SYS 0x1050
  108. #define REG_PMU_ISP_ARM_CONFIGURATION 0x2280
  109. #define REG_PMU_ISP_ARM_STATUS 0x2284
  110. #define REG_PMU_ISP_ARM_OPTION 0x2288
  111. void fimc_is_fw_clear_irq1(struct fimc_is *is, unsigned int bit);
  112. void fimc_is_fw_clear_irq2(struct fimc_is *is);
  113. int fimc_is_hw_get_params(struct fimc_is *is, unsigned int num);
  114. void fimc_is_hw_set_intgr0_gd0(struct fimc_is *is);
  115. int fimc_is_hw_wait_intmsr0_intmsd0(struct fimc_is *is);
  116. void fimc_is_hw_set_sensor_num(struct fimc_is *is);
  117. void fimc_is_hw_set_isp_buf_mask(struct fimc_is *is, unsigned int mask);
  118. void fimc_is_hw_stream_on(struct fimc_is *is);
  119. void fimc_is_hw_stream_off(struct fimc_is *is);
  120. int fimc_is_hw_set_param(struct fimc_is *is);
  121. int fimc_is_hw_change_mode(struct fimc_is *is);
  122. void fimc_is_hw_close_sensor(struct fimc_is *is, unsigned int index);
  123. void fimc_is_hw_get_setfile_addr(struct fimc_is *is);
  124. void fimc_is_hw_load_setfile(struct fimc_is *is);
  125. void fimc_is_hw_subip_power_off(struct fimc_is *is);
  126. int fimc_is_itf_s_param(struct fimc_is *is, bool update);
  127. int fimc_is_itf_mode_change(struct fimc_is *is);
  128. #endif /* FIMC_IS_REG_H_ */