aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/drivers/clk/mmp
diff options
context:
space:
mode:
authorLubomir Rintel <lkundrak@v3.sk>2020-03-09 20:42:44 +0100
committerStephen Boyd <sboyd@kernel.org>2020-03-20 18:19:32 -0700
commit391bbbd2b28e9868e36080bd0fa44dcae81707a1 (patch)
tree8eef9cee05e8c0d2d50136679441d3e36a3c1f2c /drivers/clk/mmp
parentdt-bindings: clock: Add MMP3 compatible string (diff)
downloadwireguard-linux-391bbbd2b28e9868e36080bd0fa44dcae81707a1.tar.xz
wireguard-linux-391bbbd2b28e9868e36080bd0fa44dcae81707a1.zip
clk: mmp2: Check for MMP3
The MMP3's are similar enough to MMP2, but there are differencies, such are more clocks available on the newer model. We want to tell which platform are we on. Signed-off-by: Lubomir Rintel <lkundrak@v3.sk> Link: https://lkml.kernel.org/r/20200309194254.29009-8-lkundrak@v3.sk Signed-off-by: Stephen Boyd <sboyd@kernel.org>
Diffstat (limited to 'drivers/clk/mmp')
-rw-r--r--drivers/clk/mmp/clk-of-mmp2.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/clk/mmp/clk-of-mmp2.c b/drivers/clk/mmp/clk-of-mmp2.c
index 251d8d0e78ab..7594a8280b93 100644
--- a/drivers/clk/mmp/clk-of-mmp2.c
+++ b/drivers/clk/mmp/clk-of-mmp2.c
@@ -62,8 +62,14 @@
#define MPMU_UART_PLL 0x14
#define MPMU_PLL2_CR 0x34
+enum mmp2_clk_model {
+ CLK_MODEL_MMP2,
+ CLK_MODEL_MMP3,
+};
+
struct mmp2_clk_unit {
struct mmp_clk_unit unit;
+ enum mmp2_clk_model model;
void __iomem *mpmu_base;
void __iomem *apmu_base;
void __iomem *apbc_base;
@@ -326,6 +332,11 @@ static void __init mmp2_clk_init(struct device_node *np)
if (!pxa_unit)
return;
+ if (of_device_is_compatible(np, "marvell,mmp3-clock"))
+ pxa_unit->model = CLK_MODEL_MMP3;
+ else
+ pxa_unit->model = CLK_MODEL_MMP2;
+
pxa_unit->mpmu_base = of_iomap(np, 0);
if (!pxa_unit->mpmu_base) {
pr_err("failed to map mpmu registers\n");
@@ -365,3 +376,4 @@ free_memory:
}
CLK_OF_DECLARE(mmp2_clk, "marvell,mmp2-clock", mmp2_clk_init);
+CLK_OF_DECLARE(mmp3_clk, "marvell,mmp3-clock", mmp2_clk_init);