pub struct FelHandle<'h> { /* private fields */ }
Expand description
FEL device handle.
Implementations
sourceimpl<'h> FelHandle<'h>
impl<'h> FelHandle<'h>
sourcepub fn write_uboot_image(&self, uboot: &[u8]) -> Result<(u32, u32), Error>
pub fn write_uboot_image(&self, uboot: &[u8]) -> Result<(u32, u32), Error>
This function tests a given buffer for a valid U-Boot image. Upon success, the image data gets transferred to the default memory address stored within the image header; and the function returns the U-Boot entry point (offset) and size values, in that order.
sourceimpl<'h> FelHandle<'h>
impl<'h> FelHandle<'h>
sourcepub fn get_soc_info(&self) -> &Info
pub fn get_soc_info(&self) -> &Info
Gets the SoC information from the FEL device.
Note: This is a no-op. The SoC information is acquired during initialization.
sourcepub fn get_version_info(&self) -> &Version
pub fn get_version_info(&self) -> &Version
Gets the SoC version information from the FEL device.
Note: This is a no-op. The SoC information is acquired during initialization.
sourcepub fn read_sid(&self) -> Result<Option<[u32; 4]>, Error>
pub fn read_sid(&self) -> Result<Option<[u32; 4]>, Error>
Reads the SID from the SoC if it has one.
sourcepub fn read_words(&self, offset: u32, words: &mut [u32]) -> Result<(), Error>
pub fn read_words(&self, offset: u32, words: &mut [u32]) -> Result<(), Error>
Read words chunk from the FEL device memory.
sourcepub fn write_words(&self, offset: u32, words: &[u32]) -> Result<(), Error>
pub fn write_words(&self, offset: u32, words: &[u32]) -> Result<(), Error>
Write words chunk to the FEL device memory.
sourcepub fn rmr_request(&self, entry_point: u32, aarch64: bool) -> Result<(), Error>
pub fn rmr_request(&self, entry_point: u32, aarch64: bool) -> Result<(), Error>
Perform FEL RMR request.
This function stores a given entry point to the RVBAR
address for CPU0, and then writes
the Reset Management Register to request a warm boot.
It is useful with some AArch64 transitions, e.g. when passing control to ARM Trusted
Firmware (ATF) during the boot process of Pine64.
The code was inspired by U-boot
Methods from Deref<Target = UsbHandle<'h>>
sourcepub fn fel_fill(&self, offset: u32, num_bytes: u32, byte: u8) -> Result<(), Error>
pub fn fel_fill(&self, offset: u32, num_bytes: u32, byte: u8) -> Result<(), Error>
Fill memory at the given offset.
It will fill num_size
bytes with the given byte.
sourcepub fn fel_read(&self, offset: u32, buf: &mut [u8]) -> Result<(), Error>
pub fn fel_read(&self, offset: u32, buf: &mut [u8]) -> Result<(), Error>
Reads from the FEL device memory at the given offset.
It will fill all the given buffer, but it will panic if the buffer overflows total memory address space.