Skip to content

Commit afed24d

Browse files
committed
更新 rdrive 依赖项至 0.15.2,修复物理地址转换函数,改进电源管理接口的错误处理。
1 parent 0dbf8e0 commit afed24d

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

Cargo.lock

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

platforms/axplat-aarch64-dyn/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,6 @@ heapless = "0.8"
1919
log = "0.4"
2020
memory_addr = "0.3"
2121
pie-boot = {version = "0.2.7"}
22-
rdrive = "0.14"
22+
rdrive = "0.15"
2323
smccc = "0.2"
2424
spin = "0.10"

platforms/axplat-aarch64-dyn/src/console.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ pub(crate) fn setup_early() -> Option<()> {
1313
let choson = fdt.chosen()?;
1414
let node = choson.debugcon()?;
1515
fn phys_to_virt(p: usize) -> *mut u8 {
16-
p as _
16+
axplat::mem::phys_to_virt(p.into()).as_mut_ptr()
1717
}
1818

1919
let mut uart = any_uart::Uart::new_by_fdt_node(&node, phys_to_virt)?;

platforms/axplat-aarch64-dyn/src/power.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use axplat::power::PowerIf;
66
use log::{debug, error};
77
use rdrive::{
88
DriverGeneric, KError, PlatformDevice, driver::power::Interface, module_driver,
9-
register::FdtInfo,
9+
probe::OnProbeError, register::FdtInfo,
1010
};
1111
use smccc::{Hvc, Smc, psci};
1212
use spin::Once;
@@ -95,11 +95,11 @@ impl Interface for Psci {
9595
}
9696
}
9797

98-
fn probe(fdt: FdtInfo<'_>, _dev: PlatformDevice) -> Result<(), Box<dyn Error>> {
98+
fn probe(fdt: FdtInfo<'_>, _dev: PlatformDevice) -> Result<(), OnProbeError> {
9999
let method = fdt
100100
.node
101101
.find_property("method")
102-
.ok_or("fdt no method property")?
102+
.ok_or(OnProbeError::Other("fdt no method property".into()))?
103103
.str();
104104
let method = Method::try_from(method)?;
105105
METHOD.call_once(|| method);

0 commit comments

Comments
 (0)