fimc-is-regs.h 5.7 KB

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