Skip to contentSkip to conversation

clk: socfpga: Fix the smplsel on Arria10 and Stratix10

PATCH Applied Dinh Nguyen 2 participants 2 messages Jun 8, 2017 – Jun 20, 2017

Subsystems (2)
lore
Share & tools
lore

Dinh Nguyen

author maintainer
#0 lore raw

PATCH v2 1/1 clk: socfpga: Fix the smplsel on Arria10 and Stratix10

The smplsel bits for the SDMMC clock on Arria10 and Stratix10 platforms are offset by 1 additional bit.

Add a new macro SYSMGR_SDMMC_CTRL_SET_AS10 for usage on the Arria10 and Stratix10 platforms.

Fixes 5611a5ba8e54 ("clk: socfpga: update clk.h so for Arria10 platform to use")

---
v2: Add a Fixes tag

---
 drivers/clk/socfpga/clk-gate-a10.c | 2 +-
 drivers/clk/socfpga/clk.h          | 3 +++
 2 files changed, 4 insertions(+), 1 deletion(-)
drivers/clk/socfpga/clk-gate-a10.c +1 -1
index c2d5727..36376c5 100644
@@ -86,7 +86,7 @@ static int socfpga_clk_prepare(struct clk_hw *hwclk)
 			}
 		}
 
-		hs_timing = SYSMGR_SDMMC_CTRL_SET(clk_phase[0], clk_phase[1]);
+		hs_timing = SYSMGR_SDMMC_CTRL_SET_AS10(clk_phase[0], clk_phase[1]);
 		if (!IS_ERR(socfpgaclk->sys_mgr_base_addr))
 			regmap_write(socfpgaclk->sys_mgr_base_addr,
 				     SYSMGR_SDMMCGRP_CTRL_OFFSET, hs_timing);
drivers/clk/socfpga/clk.h +3 -0
index 814c724..9cf1230 100644
@@ -32,6 +32,9 @@
 #define SYSMGR_SDMMC_CTRL_SET(smplsel, drvsel) \
 	((((smplsel) & 0x7) << 3) | (((drvsel) & 0x7) << 0))
 
+#define SYSMGR_SDMMC_CTRL_SET_AS10(smplsel, drvsel) \
+	((((smplsel) & 0x7) << 4) | (((drvsel) & 0x7) << 0))
+
 extern void __iomem *clk_mgr_base_addr;
 extern void __iomem *clk_mgr_a10_base_addr;
 
Signature · 1 line
2.7.4
Applied
#1 lore raw
Quoted 9 lines · Dinh Nguyen

The smplsel bits for the SDMMC clock on Arria10 and Stratix10 platforms are offset by 1 additional bit.

Add a new macro SYSMGR_SDMMC_CTRL_SET_AS10 for usage on the Arria10 and Stratix10 platforms.

Fixes 5611a5ba8e54 ("clk: socfpga: update clk.h so for Arria10 platform to use")

---

Applied to clk-next

Signature · 2 lines
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project