@@ -495,6 +495,7 @@ config ARCH_IXP4XX
config ARCH_DOVE
bool "Marvell Dove"
+ select ARCH_HAS_CPUFREQ
select ARCH_REQUIRE_GPIOLIB
select CPU_PJ4
select GENERIC_CLOCKEVENTS
@@ -70,6 +70,8 @@ static void __init dove_dt_init(void)
/* Setup clocks for legacy devices */
dove_legacy_clk_init();
+ dove_cpufreq_init();
+
/* Internal devices not ported to DT yet */
dove_pcie_init(1, 1);
@@ -344,6 +344,42 @@ void __init dove_sdio1_init(void)
platform_device_register(&dove_sdio1);
}
+/*****************************************************************************
+ * CPU Frequency
+ ****************************************************************************/
+static struct resource dove_cpufreq_resources[] = {
+ [0] = {
+ .start = DOVE_PMU_PHYS_BASE,
+ .end = DOVE_PMU_PHYS_BASE + 0x7,
+ .flags = IORESOURCE_MEM,
+ .name = "cpufreq: DFS"
+ },
+ [1] = {
+ .start = DOVE_PMU_PHYS_BASE + 0x8000,
+ .end = DOVE_PMU_PHYS_BASE + 0x8003,
+ .flags = IORESOURCE_MEM,
+ .name = "cpufreq: PMU CR"
+ },
+ [2] = {
+ .start = DOVE_PMU_PHYS_BASE + 0x0044,
+ .end = DOVE_PMU_PHYS_BASE + 0x0047,
+ .flags = IORESOURCE_MEM,
+ .name = "cpufreq: PMU Clk Div"
+ },
+};
+
+static struct platform_device dove_cpufreq_device = {
+ .name = "dove-cpufreq",
+ .id = -1,
+ .num_resources = ARRAY_SIZE(dove_cpufreq_resources),
+ .resource = dove_cpufreq_resources,
+};
+
+void __init dove_cpufreq_init(void)
+{
+ platform_device_register(&dove_cpufreq_device);
+}
+
void __init dove_setup_cpu_wins(void)
{
/*
@@ -44,6 +44,7 @@ void dove_spi1_init(void);
void dove_i2c_init(void);
void dove_sdio0_init(void);
void dove_sdio1_init(void);
+void dove_cpufreq_init(void);
void dove_restart(enum reboot_mode, const char *);
#endif
@@ -144,6 +144,7 @@
#define DOVE_SD0_GPIO_SEL (1 << 0)
/* Power Management */
+#define DOVE_PMU_PHYS_BASE (DOVE_SB_REGS_PHYS_BASE + 0xd0000)
#define DOVE_PMU_VIRT_BASE (DOVE_SB_REGS_VIRT_BASE + 0xd0000)
#define DOVE_PMU_SIG_CTRL (DOVE_PMU_VIRT_BASE + 0x802c)