[PATCH v2 3/4] ARM: am335x: Enable TSC/ADC clock

Trent Piepho trent.piepho at synapse.com
Fri Sep 25 19:43:14 EDT 2020


Now that there is a Barebox driver for the ADC, enable the clock to the
TSC/ADC block.

This machine doesn't use common clock framework clocks in Barebox, and
instead enables any clock that might get used.  Enalbing the clock could
be made conditional based on enabling the driver, but none of the other
clocks do this.

Signed-off-by: Trent Piepho <trent.piepho at synapse.com>
---
 arch/arm/mach-omap/am33xx_clock.c              | 4 ++++
 arch/arm/mach-omap/include/mach/am33xx-clock.h | 1 +
 2 files changed, 5 insertions(+)

diff --git a/arch/arm/mach-omap/am33xx_clock.c b/arch/arm/mach-omap/am33xx_clock.c
index 0a4903827..8fa2c70aa 100644
--- a/arch/arm/mach-omap/am33xx_clock.c
+++ b/arch/arm/mach-omap/am33xx_clock.c
@@ -165,6 +165,10 @@ void am33xx_enable_per_clocks(void)
 	__raw_writel(PRCM_MOD_EN, CM_PER_USB0_CLKCTRL);
 	while ((__raw_readl(CM_PER_USB0_CLKCTRL) & 0x30000) != 0x0);
 
+	/* TSC & ADC */
+	__raw_writel(PRCM_MOD_EN, CM_WKUP_ADC_TSC_CLKCTRL);
+	while (__raw_readl(CM_WKUP_ADC_TSC_CLKCTRL) != PRCM_MOD_EN);
+
 	clkdcoldo = __raw_readl(CM_CLKDCOLDO_DPLL_PER);
 	clkdcoldo = clkdcoldo | 0x100;
 	__raw_writel(clkdcoldo, CM_CLKDCOLDO_DPLL_PER);
diff --git a/arch/arm/mach-omap/include/mach/am33xx-clock.h b/arch/arm/mach-omap/include/mach/am33xx-clock.h
index 284d5f8cf..e71ecbcd2 100644
--- a/arch/arm/mach-omap/include/mach/am33xx-clock.h
+++ b/arch/arm/mach-omap/include/mach/am33xx-clock.h
@@ -138,6 +138,7 @@
 #define CM_PER_I2C1_CLKCTRL             (CM_PER + 0x48) /* I2C1 */
 #define CM_PER_I2C2_CLKCTRL             (CM_PER + 0x44) /* I2C2 */
 #define CM_WKUP_GPIO0_CLKCTRL           (CM_WKUP + 0x8) /* GPIO0 */
+#define CM_WKUP_ADC_TSC_CLKCTRL         (CM_WKUP + 0xbc)/* TSCADC */
 
 #define CM_PER_MMC0_CLKCTRL             (CM_PER + 0x3C)
 #define CM_PER_MMC1_CLKCTRL             (CM_PER + 0xF4)
-- 
2.26.2




More information about the barebox mailing list