mirror of
https://github.com/esp-rs/esp-hal.git
synced 2025-09-28 12:50:53 +00:00
ESP32-H2/ESP32-C6: Don't rely on the bootloader to deconfigure permission control (#3150)
* ESP32-H2/ESP32-C6: Don't rely on the bootloader to deconfigure permission control * CHANGELOG.md
This commit is contained in:
parent
7a6d381e19
commit
53d57bd01a
@ -54,6 +54,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||
|
||||
- I2C: Async functions are postfixed with `_async`, non-async functions are available in async-mode (#3056)
|
||||
|
||||
- ESP32-H2/ESP32-C6: Don't rely on the bootloader to deconfigure permission control (#3150)
|
||||
|
||||
### Fixed
|
||||
|
||||
- `DmaDescriptor` is now `#[repr(C)]` (#2988)
|
||||
|
@ -57,13 +57,13 @@ ufmt-write = "0.1.0"
|
||||
# IMPORTANT:
|
||||
# Each supported device MUST have its PAC included below along with a
|
||||
# corresponding feature.
|
||||
esp32 = { version = "0.35.0", features = ["critical-section", "rt"], git = "https://github.com/esp-rs/esp-pacs", rev = "0f3ea9f", optional = true }
|
||||
esp32c2 = { version = "0.24.0", features = ["critical-section", "rt"], git = "https://github.com/esp-rs/esp-pacs", rev = "0f3ea9f", optional = true }
|
||||
esp32c3 = { version = "0.27.0", features = ["critical-section", "rt"], git = "https://github.com/esp-rs/esp-pacs", rev = "0f3ea9f", optional = true }
|
||||
esp32c6 = { version = "0.18.0", features = ["critical-section", "rt"], git = "https://github.com/esp-rs/esp-pacs", rev = "0f3ea9f", optional = true }
|
||||
esp32h2 = { version = "0.14.0", features = ["critical-section", "rt"], git = "https://github.com/esp-rs/esp-pacs", rev = "0f3ea9f", optional = true }
|
||||
esp32s2 = { version = "0.26.0", features = ["critical-section", "rt"], git = "https://github.com/esp-rs/esp-pacs", rev = "0f3ea9f", optional = true }
|
||||
esp32s3 = { version = "0.30.0", features = ["critical-section", "rt"], git = "https://github.com/esp-rs/esp-pacs", rev = "0f3ea9f", optional = true }
|
||||
esp32 = { version = "0.35.0", features = ["critical-section", "rt"], git = "https://github.com/esp-rs/esp-pacs", rev = "5d133b594", optional = true }
|
||||
esp32c2 = { version = "0.24.0", features = ["critical-section", "rt"], git = "https://github.com/esp-rs/esp-pacs", rev = "5d133b594", optional = true }
|
||||
esp32c3 = { version = "0.27.0", features = ["critical-section", "rt"], git = "https://github.com/esp-rs/esp-pacs", rev = "5d133b594", optional = true }
|
||||
esp32c6 = { version = "0.18.0", features = ["critical-section", "rt"], git = "https://github.com/esp-rs/esp-pacs", rev = "5d133b594", optional = true }
|
||||
esp32h2 = { version = "0.14.0", features = ["critical-section", "rt"], git = "https://github.com/esp-rs/esp-pacs", rev = "5d133b594", optional = true }
|
||||
esp32s2 = { version = "0.26.0", features = ["critical-section", "rt"], git = "https://github.com/esp-rs/esp-pacs", rev = "5d133b594", optional = true }
|
||||
esp32s3 = { version = "0.30.0", features = ["critical-section", "rt"], git = "https://github.com/esp-rs/esp-pacs", rev = "5d133b594", optional = true }
|
||||
|
||||
[target.'cfg(target_arch = "riscv32")'.dependencies]
|
||||
riscv = { version = "0.12.1" }
|
||||
|
@ -467,6 +467,8 @@ pub struct Config {
|
||||
/// This function sets up the CPU clock and watchdog, then, returns the
|
||||
/// peripherals and clocks.
|
||||
pub fn init(config: Config) -> Peripherals {
|
||||
crate::soc::pre_init();
|
||||
|
||||
system::disable_peripherals();
|
||||
|
||||
let mut peripherals = Peripherals::take();
|
||||
|
@ -131,3 +131,5 @@ pub unsafe extern "C" fn ESP32Reset() -> ! {
|
||||
pub extern "Rust" fn __init_data() -> bool {
|
||||
false
|
||||
}
|
||||
|
||||
pub(crate) fn pre_init() {}
|
||||
|
@ -45,3 +45,5 @@ pub(crate) mod constants {
|
||||
/// RC FAST Clock value (Hertz).
|
||||
pub const RC_FAST_CLK: Rate = Rate::from_khz(17500);
|
||||
}
|
||||
|
||||
pub(crate) fn pre_init() {}
|
||||
|
@ -63,3 +63,5 @@ pub(crate) mod constants {
|
||||
/// RC FAST Clock value (Hertz).
|
||||
pub const RC_FAST_CLK: Rate = Rate::from_khz(17500);
|
||||
}
|
||||
|
||||
pub(crate) fn pre_init() {}
|
||||
|
@ -71,3 +71,23 @@ pub(crate) mod constants {
|
||||
/// RC FAST Clock value (Hertz).
|
||||
pub const RC_FAST_CLK: Rate = Rate::from_khz(17_500);
|
||||
}
|
||||
|
||||
pub(crate) fn pre_init() {
|
||||
// By default, these access path filters are enable and allow the access to
|
||||
// masters only if they are in TEE mode.
|
||||
//
|
||||
// Since all masters except HP CPU boot in REE mode, default setting of these
|
||||
// filters will deny the access by all masters except HP CPU.
|
||||
//
|
||||
// So, disabling these filters early.
|
||||
|
||||
crate::peripherals::LP_APM::regs()
|
||||
.func_ctrl()
|
||||
.write(|w| unsafe { w.bits(0x0) });
|
||||
crate::peripherals::LP_APM0::regs()
|
||||
.func_ctrl()
|
||||
.write(|w| unsafe { w.bits(0x0) });
|
||||
crate::peripherals::HP_APM::regs()
|
||||
.func_ctrl()
|
||||
.write(|w| unsafe { w.bits(0x0) });
|
||||
}
|
||||
|
@ -71,3 +71,23 @@ pub(crate) mod constants {
|
||||
/// RC FAST Clock value (Hertz).
|
||||
pub const RC_FAST_CLK: Rate = Rate::from_khz(17500);
|
||||
}
|
||||
|
||||
pub(crate) fn pre_init() {
|
||||
// By default, these access path filters are enable and allow the access to
|
||||
// masters only if they are in TEE mode.
|
||||
//
|
||||
// Since all masters except HP CPU boot in REE mode, default setting of these
|
||||
// filters will deny the access by all masters except HP CPU.
|
||||
//
|
||||
// So, disabling these filters early.
|
||||
|
||||
crate::peripherals::LP_APM::regs()
|
||||
.func_ctrl()
|
||||
.write(|w| unsafe { w.bits(0x0) });
|
||||
crate::peripherals::LP_APM0::regs()
|
||||
.func_ctrl()
|
||||
.write(|w| unsafe { w.bits(0x0) });
|
||||
crate::peripherals::HP_APM::regs()
|
||||
.func_ctrl()
|
||||
.write(|w| unsafe { w.bits(0x0) });
|
||||
}
|
||||
|
@ -51,6 +51,7 @@ crate::peripherals! {
|
||||
LP_ANA <= LP_ANA,
|
||||
LP_AON <= LP_AON,
|
||||
LP_APM <= LP_APM,
|
||||
LP_APM0 <= LP_APM0,
|
||||
LP_PERI <= LP_PERI,
|
||||
LP_TIMER <= LP_TIMER,
|
||||
LP_WDT <= LP_WDT,
|
||||
|
@ -165,3 +165,5 @@ pub unsafe fn cache_get_dcache_line_size() -> u32 {
|
||||
}
|
||||
Cache_Get_DCache_Line_Size()
|
||||
}
|
||||
|
||||
pub(crate) fn pre_init() {}
|
||||
|
@ -209,3 +209,5 @@ pub unsafe fn cache_get_dcache_line_size() -> u32 {
|
||||
}
|
||||
Cache_Get_DCache_Line_Size()
|
||||
}
|
||||
|
||||
pub(crate) fn pre_init() {}
|
||||
|
Loading…
x
Reference in New Issue
Block a user