From: Andrew Lunn <andrew@lunn.ch>
To: Sebastian Hesselbarth <sebastian.hesselbarth@googlemail.com>,
Jason Cooper <jason@lakedaemon.net>,
rjw@rjwysocki.net, viresh.kumar@linaro.org
Cc: linux-pm@vger.kernel.org,
linux ARM <linux-arm-kernel@lists.infradead.org>,
Andrew Lunn <andrew@lunn.ch>
Subject: [PATCH v3 2/4] mvebu: Dove: Instantiate cpufreq driver.
Date: Thu, 31 Oct 2013 20:18:29 +0100 [thread overview]
Message-ID: <1383247111-26834-2-git-send-email-andrew@lunn.ch> (raw)
In-Reply-To: <1383247111-26834-1-git-send-email-andrew@lunn.ch>
Add a platform driver definition to instantiate the dove cpufreq
driver. Also indicate the ARCH has cpufreq support, so allowing the
cpufreq framework to be enabled.
Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Tested-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
---
Make resource names consistent.
Fix length of ranges
---
arch/arm/Kconfig | 1 +
arch/arm/mach-dove/board-dt.c | 2 ++
arch/arm/mach-dove/common.c | 36 ++++++++++++++++++++++++++++++++++
arch/arm/mach-dove/common.h | 1 +
arch/arm/mach-dove/include/mach/dove.h | 1 +
5 files changed, 41 insertions(+)
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 1ad6fb6c094d..774441504092 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -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
diff --git a/arch/arm/mach-dove/board-dt.c b/arch/arm/mach-dove/board-dt.c
index 49f72a848423..98202de399c0 100644
--- a/arch/arm/mach-dove/board-dt.c
+++ b/arch/arm/mach-dove/board-dt.c
@@ -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);
diff --git a/arch/arm/mach-dove/common.c b/arch/arm/mach-dove/common.c
index c122bcff9f7c..323fcd4b27b6 100644
--- a/arch/arm/mach-dove/common.c
+++ b/arch/arm/mach-dove/common.c
@@ -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)
{
/*
diff --git a/arch/arm/mach-dove/common.h b/arch/arm/mach-dove/common.h
index 1d725224d146..5c9a77bdd442 100644
--- a/arch/arm/mach-dove/common.h
+++ b/arch/arm/mach-dove/common.h
@@ -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
diff --git a/arch/arm/mach-dove/include/mach/dove.h b/arch/arm/mach-dove/include/mach/dove.h
index 0c4b35f4ee5b..48db186ae6bc 100644
--- a/arch/arm/mach-dove/include/mach/dove.h
+++ b/arch/arm/mach-dove/include/mach/dove.h
@@ -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)
--
1.8.4.rc3
next prev parent reply other threads:[~2013-10-31 19:23 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-10-31 19:18 [PATCH v3 1/4] cpufreq: Add a cpufreq driver for Marvell Dove Andrew Lunn
2013-10-31 19:18 ` Andrew Lunn [this message]
2013-10-31 23:52 ` [PATCH v3 2/4] mvebu: Dove: Instantiate cpufreq driver Viresh Kumar
2013-10-31 19:18 ` [PATCH v3 3/4] mvebu: Dove: Enable cpufreq driver in defconfig Andrew Lunn
2013-10-31 23:52 ` Viresh Kumar
2013-10-31 19:18 ` [PATCH v3 4/4] mvebu: Dove: Add clocks and DFS interrupt to cpu node in DT Andrew Lunn
2013-10-31 22:26 ` Rafael J. Wysocki
2013-10-31 23:51 ` Viresh Kumar
2013-11-01 9:07 ` Andrew Lunn
2013-11-01 13:16 ` Rafael J. Wysocki
2013-11-01 13:14 ` Andrew Lunn
2013-11-01 22:52 ` Rafael J. Wysocki
2013-11-24 2:51 ` Jason Cooper
2013-10-31 23:46 ` [PATCH v3 1/4] cpufreq: Add a cpufreq driver for Marvell Dove Viresh Kumar
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1383247111-26834-2-git-send-email-andrew@lunn.ch \
--to=andrew@lunn.ch \
--cc=jason@lakedaemon.net \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-pm@vger.kernel.org \
--cc=rjw@rjwysocki.net \
--cc=sebastian.hesselbarth@googlemail.com \
--cc=viresh.kumar@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).