Skip to content

Commit

Permalink
Revert "rtiocrg.c: pipistrello also has pll_reset"
Browse files Browse the repository at this point in the history
This reverts commit bdee914.
jordens committed Jul 28, 2015
1 parent bdee914 commit f0a7078
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions soc/runtime/rtiocrg.c
Original file line number Diff line number Diff line change
@@ -10,7 +10,9 @@ void rtiocrg_init(void)
char b;
int clk;

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

int rtiocrg_check(void)
{
#ifdef CSR_RTIO_CRG_PLL_RESET_ADDR
return rtio_crg_pll_locked_read();
#else
return 1;
#endif
}

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

current_clk = rtio_crg_clock_sel_read();
if(clk == current_clk) {
#ifdef CSR_RTIO_CRG_PLL_RESET_ADDR
busywait_us(150);
if(!rtio_crg_pll_locked_read())
return 0;
#endif
return 1;
}
#ifdef CSR_RTIO_CRG_PLL_RESET_ADDR
rtio_crg_pll_reset_write(1);
#endif
rtio_crg_clock_sel_write(clk);
#ifdef CSR_RTIO_CRG_PLL_RESET_ADDR
rtio_crg_pll_reset_write(0);
busywait_us(150);
if(!rtio_crg_pll_locked_read())
return 0;
#endif
return 1;
}

0 comments on commit f0a7078

Please sign in to comment.