#define EXYNOS5_ARM_CORE0_OPTION S5P_PMUREG(0x2008)
#define EXYNOS5_ARM_CORE1_OPTION S5P_PMUREG(0x2088)
#define EXYNOS5_FSYS_ARM_OPTION S5P_PMUREG(0x2208)
+#define EXYNOS5_ISP_ARM_CONFIGURATION S5P_PMUREG(0x2280)
+#define EXYNOS5_ISP_ARM_STATUS S5P_PMUREG(0x2284)
#define EXYNOS5_ISP_ARM_OPTION S5P_PMUREG(0x2288)
#define EXYNOS5_ARM_COMMON_OPTION S5P_PMUREG(0x2408)
#define EXYNOS5_TOP_PWR_OPTION S5P_PMUREG(0x2C48)
#define EXYNOS5_ISP_STATUS S5P_PMUREG(0x4024)
#define EXYNOS5_GSCL_OPTION S5P_PMUREG(0x4008)
#define EXYNOS5_ISP_CONFIGURATION S5P_PMUREG(0x4020)
+#define EXYNOS5_ISP_STATUS S5P_PMUREG(0x4024)
#define EXYNOS5_ISP_OPTION S5P_PMUREG(0x4028)
#define EXYNOS5_MFC_OPTION S5P_PMUREG(0x4048)
#define EXYNOS5_G3D_CONFIGURATION S5P_PMUREG(0x4060)
{ EXYNOS5_CMU_SYSCLK_MAU_SYS_PWR_REG, { 0x1, 0x1, 0x0} },
{ EXYNOS5_CMU_SYSCLK_GPS_SYS_PWR_REG, { 0x1, 0x0, 0x0} },
{ EXYNOS5_CMU_RESET_GSCL_SYS_PWR_REG, { 0x1, 0x0, 0x0} },
- { EXYNOS5_CMU_RESET_ISP_SYS_PWR_REG, { 0x1, 0x0, 0x0} },
+ /* CMU_RESET_ISP_SYS_PWR_REG handled in exynos5250_disable_isp() */
{ EXYNOS5_CMU_RESET_MFC_SYS_PWR_REG, { 0x1, 0x0, 0x0} },
{ EXYNOS5_CMU_RESET_G3D_SYS_PWR_REG, { 0x1, 0x0, 0x0} },
{ EXYNOS5_CMU_RESET_DISP1_SYS_PWR_REG, { 0x1, 0x0, 0x0} },
void __iomem *exynos5_list_diable_wfi_wfe[] = {
EXYNOS5_ARM_CORE1_OPTION,
EXYNOS5_FSYS_ARM_OPTION,
- EXYNOS5_ISP_ARM_OPTION,
};
static void exynos5_power_off(void)
exynos4_pmu_config[i].reg);
}
+#define ISP_DISABLE_TRIES 10
+
+/*
+ * Disable the image signal processor.
+ *
+ * We currently have no code in the kernel to manage the state of the ISP.
+ *
+ * The ISP's power sequencing code needs to be run in a very specific order
+ * and shouldn't necessarily be intertwined with the power on/power off code
+ * of the main CPU core. Until there is kernel code to manage the ISP, we'll
+ * just hardcode powering off the ISP here.
+ */
+static void exynos5250_disable_isp(void)
+{
+ int i;
+
+ /* Make sure ISP ARM is disabled; don't use WFI or WFE */
+ __raw_writel(0, EXYNOS5_ISP_ARM_OPTION);
+
+ /* Put the ISP ARM in reset */
+ __raw_writel(0x0, EXYNOS5_ISP_ARM_CONFIGURATION);
+ for (i = 0; i < ISP_DISABLE_TRIES; i++) {
+ if (!(__raw_readl(EXYNOS5_ISP_ARM_STATUS) & 0x1))
+ break;
+ usleep_range(80, 100);
+ }
+ WARN_ON(i == ISP_DISABLE_TRIES);
+
+ /* Reset the ISP CMU block in power-off/low power state */
+ __raw_writel(0x0, EXYNOS5_CMU_RESET_ISP_SYS_PWR_REG);
+
+ /* Turn off power to the ISP in normal mode */
+ __raw_writel(0x0, EXYNOS5_ISP_CONFIGURATION);
+ for (i = 0; i < ISP_DISABLE_TRIES; i++) {
+ if (!(__raw_readl(EXYNOS5_ISP_STATUS) & 0x7))
+ break;
+ usleep_range(80, 100);
+ }
+ WARN_ON(i == ISP_DISABLE_TRIES);
+}
+
static int __init exynos4_pmu_init(void)
{
exynos4_pmu_config = exynos4210_pmu_config;
exynos4_pmu_config = exynos4212_pmu_config;
pr_info("EXYNOS4212 PMU Initialize\n");
} else if (soc_is_exynos5250()) {
+ exynos5250_disable_isp();
+
exynos4_pmu_config = exynos5250_pmu_config;
pm_power_off = exynos5_power_off;
pr_info("EXYNOS5250 PMU Initialize\n");