Skip to content

Commit f0a7078

Browse files
committedJul 28, 2015
Revert "rtiocrg.c: pipistrello also has pll_reset"
This reverts commit bdee914.
1 parent bdee914 commit f0a7078

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed
 

Diff for: ‎soc/runtime/rtiocrg.c

+12
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@ void rtiocrg_init(void)
1010
char b;
1111
int clk;
1212

13+
#ifdef CSR_RTIO_CRG_PLL_RESET_ADDR
1314
rtio_crg_pll_reset_write(0);
15+
#endif
1416
b = 'i';
1517
clk = 0;
1618
fs_read("startup_clock", &b, 1, NULL);
@@ -31,7 +33,11 @@ void rtiocrg_init(void)
3133

3234
int rtiocrg_check(void)
3335
{
36+
#ifdef CSR_RTIO_CRG_PLL_RESET_ADDR
3437
return rtio_crg_pll_locked_read();
38+
#else
39+
return 1;
40+
#endif
3541
}
3642

3743
int rtiocrg_switch_clock(int clk)
@@ -40,16 +46,22 @@ int rtiocrg_switch_clock(int clk)
4046

4147
current_clk = rtio_crg_clock_sel_read();
4248
if(clk == current_clk) {
49+
#ifdef CSR_RTIO_CRG_PLL_RESET_ADDR
4350
busywait_us(150);
4451
if(!rtio_crg_pll_locked_read())
4552
return 0;
53+
#endif
4654
return 1;
4755
}
56+
#ifdef CSR_RTIO_CRG_PLL_RESET_ADDR
4857
rtio_crg_pll_reset_write(1);
58+
#endif
4959
rtio_crg_clock_sel_write(clk);
60+
#ifdef CSR_RTIO_CRG_PLL_RESET_ADDR
5061
rtio_crg_pll_reset_write(0);
5162
busywait_us(150);
5263
if(!rtio_crg_pll_locked_read())
5364
return 0;
65+
#endif
5466
return 1;
5567
}

0 commit comments

Comments
 (0)
Please sign in to comment.