--- /dev/null
+/* arch/arm/mach-rk29/include/mach/rk29_pmu.h
+ *
+ * Copyright (C) 2010 ROCKCHIP, Inc.
+ *
+ * This software is licensed under the terms of the GNU General Public
+ * License version 2, as published by the Free Software Foundation, and
+ * may be copied, distributed, and modified under those terms.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ */
+
+#ifndef __ARCH_ARM_MACH_RK29_PMU_H
+
+#include <linux/irqflags.h>
+#include <asm/io.h>
+#include <mach/rk29_iomap.h>
+
+#define PMU_WAKEUP_EN0 0x00
+#define PMU_WAKEUP_EN1 0x04
+#define PMU_WAKEUP_EN2 0x08
+#define PMU_PD_CON 0x10
+#define PMU_MISC_CON 0x14
+#define PMU_PLL_CNT 0x18
+#define PMU_PD_ST 0x1c
+#define PMU_INT_ST 0x20
+
+enum pmu_power_domain {
+ PD_ARM_CORE = 0,
+ PD_NEON,
+ PD_ETM_DBG,
+ PD_L2_CACHE,
+ PD_VCODEC,
+ PD_DISPLAY,
+ PD_GPU,
+ PD_PERIPHERAL,
+ PD_MINI,
+};
+
+static inline void pmu_set_power_domain(enum pmu_power_domain pd, bool on)
+{
+ unsigned long flags;
+
+ local_irq_save(flags);
+ if (on)
+ writel(readl(RK29_PMU_BASE + PMU_PD_CON) & ~(1 << pd), RK29_PMU_BASE + PMU_PD_CON);
+ else
+ writel(readl(RK29_PMU_BASE + PMU_PD_CON) | (1 << pd), RK29_PMU_BASE + PMU_PD_CON);
+ local_irq_restore(flags);
+}
+
+static inline bool pmu_power_domain_is_on(enum pmu_power_domain pd)
+{
+ return !(readl(RK29_PMU_BASE + PMU_PD_ST) & (1 << pd));
+}
+
+#endif
#define RK29_CRU_PHYS 0x20000000
#define RK29_CRU_BASE RK29_ADDR_BASE1
#define RK29_CRU_SIZE SZ_4K
-#define RK29_PMU_PHYS 0x20004000
-#define RK29_PMU_SIZE SZ_16K
+#define RK29_PMU_PHYS 0x20004000
+#define RK29_PMU_BASE (RK29_ADDR_BASE1 + 0x4000)
+#define RK29_PMU_SIZE SZ_4K
#define RK29_GRF_BASE (RK29_ADDR_BASE1+0x8000)
#define RK29_GRF_PHYS 0x20008000
#define RK29_GRF_SIZE SZ_16K