Skip to content

Commit

Permalink
hal/imxrt106x: fix enet PLL init
Browse files Browse the repository at this point in the history
- correct clk0 enable bit
- add bypass during clock frequency change

JIRA: RTOS-507
  • Loading branch information
julianuziemblo committed Oct 3, 2024
1 parent a1a6787 commit b0501bf
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions hal/armv7m/imxrt/10xx/imxrt10xx.c
Original file line number Diff line number Diff line change
Expand Up @@ -969,7 +969,7 @@ void _imxrt_ccmInitEnetPll(u8 enclk0, u8 enclk1, u8 enclk2, u8 div0, u8 div1)
u32 enet_pll = ((div1 & 0x3) << 2) | (div0 & 0x3);

if (enclk0 != 0) {
enet_pll |= 1 << 12;
enet_pll |= 1 << 13;
}

if (enclk1 != 0) {
Expand All @@ -980,10 +980,14 @@ void _imxrt_ccmInitEnetPll(u8 enclk0, u8 enclk1, u8 enclk2, u8 div0, u8 div1)
enet_pll |= 1 << 21;
}

*(imxrt_common.ccm_analog + ccm_analog_pll_enet) = enet_pll;
*(imxrt_common.ccm_analog + ccm_analog_pll_enet) = 1 << 16; /* enable bypass during clock frequency change */

*(imxrt_common.ccm_analog + ccm_analog_pll_enet) |= enet_pll;

while ((*(imxrt_common.ccm_analog + ccm_analog_pll_enet) & (1 << 31)) == 0) {
}

*(imxrt_common.ccm_analog + ccm_analog_pll_enet) &= ~(1 << 16);
}


Expand Down

0 comments on commit b0501bf

Please sign in to comment.