-
Notifications
You must be signed in to change notification settings - Fork 280
Udpate H2 and C6 clocks. Remove i2c_clock for all chips but ESP32 #592
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
||
let pcr = unsafe { &*crate::peripherals::PCR::PTR }; | ||
|
||
// switch spimem to PLL 64Mhz clock | ||
unsafe { | ||
pcr.mspi_conf.modify(|_, w| w.mspi_clk_sel().bits(0b10)); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed this as @playfulFence and I couldn't find the source of this.
H2 and C6 are the same in esp-idf:
pcr.ahb_freq_conf | ||
.modify(|_, w| w.ahb_div_num().bits(_div - 1)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We were duplicating the clk_ll_ahb_set_divider
fn
esp-hal-common/src/clock/mod.rs
Outdated
#[cfg(any(esp32c6, esp32h2))] | ||
Pll48MHz, | ||
#[cfg(esp32h2)] | ||
Pll64MHz, | ||
#[cfg(esp32c6)] | ||
Pll80MHz, | ||
#[cfg(esp32h2)] | ||
Pll96MHz, | ||
#[cfg(esp32c6)] | ||
Pll160MHz, | ||
#[cfg(esp32c6)] | ||
Pll240MHz, | ||
#[cfg(not(any(esp32c2, esp32c6, esp32h2)))] | ||
Pll320MHz, | ||
#[cfg(not(esp32h2))] | ||
Pll480MHz, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pll_48m_clock: HertzU32::MHz(48), | ||
crypto_clock: HertzU32::MHz(96), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See CRYPTO_CLK
of the Resets and clocks chapter of the H2 TRM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks for cleaning this all up!
Gathered some information about I2C clocks in the different chips in this HackMD: https://hackmd.io/@SergioGasquez/r1dvX1AHh
Checked the I2C freq for some devices:
Draft PR until PACs are updated (esp-rs/esp-pacs#130 and esp-rs/esp-pacs#129)