summaryrefslogtreecommitdiff
path: root/firmware/target/arm/s5l8702/clocking-s5l8702.c
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/target/arm/s5l8702/clocking-s5l8702.c')
-rw-r--r--firmware/target/arm/s5l8702/clocking-s5l8702.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/firmware/target/arm/s5l8702/clocking-s5l8702.c b/firmware/target/arm/s5l8702/clocking-s5l8702.c
index 3ef70ba1de..b7fa45fcf5 100644
--- a/firmware/target/arm/s5l8702/clocking-s5l8702.c
+++ b/firmware/target/arm/s5l8702/clocking-s5l8702.c
@@ -213,6 +213,14 @@ void set_clocking_level(int level)
213 udelay(50); /* TBC: probably not needed */ 213 udelay(50); /* TBC: probably not needed */
214} 214}
215 215
216void clockgate_enable(int gate, bool enable)
217{
218 int i = (gate >> 5) & 1;
219 uint32_t bit = 1 << (gate & 0x1f);
220 if (enable) PWRCON(i) &= ~bit;
221 else PWRCON(i) |= bit;
222}
223
216#ifdef BOOTLOADER 224#ifdef BOOTLOADER
217int pll_config(int pll, int op_mode, int p, int m, int s, int lock_time) 225int pll_config(int pll, int op_mode, int p, int m, int s, int lock_time)
218{ 226{
@@ -299,14 +307,6 @@ void cg16_config(volatile uint16_t* cg16,
299 while (*cg16 != val16); 307 while (*cg16 != val16);
300} 308}
301 309
302void clockgate_enable(int gate, bool enable)
303{
304 int i = (gate >> 5) & 1;
305 uint32_t bit = 1 << (gate & 0x1f);
306 if (enable) PWRCON(i) &= ~bit;
307 else PWRCON(i) |= bit;
308}
309
310/* Configures EClk for USEC_TIMER. DRAM refresh also depends on EClk, 310/* Configures EClk for USEC_TIMER. DRAM refresh also depends on EClk,
311 * this clock should be initialized by the bootloader, so USEC_TIMER 311 * this clock should be initialized by the bootloader, so USEC_TIMER
312 * is ready to use for RB. 312 * is ready to use for RB.