[−][src]Struct aw_fel::FelHandle
FEL device handle.
Fields
usb_handle: UsbHandle<'h>
soc_version: Version
soc_info: Info
Methods
impl<'h> FelHandle<'h>
[src]
impl<'h> FelHandle<'h>
pub fn write_uboot_image(&self, uboot: &[u8]) -> Result<(u32, u32), Error>
[src]
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.
pub fn write_and_execute_spl(&self, spl: &[u8]) -> Result<(), Error>
[src]
pub fn write_and_execute_spl(&self, spl: &[u8]) -> Result<(), Error>
Writes U-Boot SPL into memory and executes it.
impl<'h> FelHandle<'h>
[src]
impl<'h> FelHandle<'h>
pub fn get_soc_info(&self) -> &Info
[src]
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.
pub fn get_version_info(&self) -> &Version
[src]
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.
fn enable_l2_cache(&self) -> Result<(), Error>
[src]
fn enable_l2_cache(&self) -> Result<(), Error>
Enables the L2 cache.
fn get_stack_info(&self) -> Result<(u32, u32), Error>
[src]
fn get_stack_info(&self) -> Result<(u32, u32), Error>
Gets stack information.
The result will be a tuple. The first element will be the SP_irq
, while the second element
will be the nuser mode SP
.
fn default_mmu_translation_table() -> [u32; 4096]
[src]
fn default_mmu_translation_table() -> [u32; 4096]
Generates a default MMU translation table.
fn backup_and_disable_mmu(&self) -> Result<Option<[u32; 4096]>, Error>
[src]
fn backup_and_disable_mmu(&self) -> Result<Option<[u32; 4096]>, Error>
Backup MMU translation table and disable it.
fn restore_and_enable_mmu(&self, tt: [u32; 4096]) -> Result<(), Error>
[src]
fn restore_and_enable_mmu(&self, tt: [u32; 4096]) -> Result<(), Error>
fn get_ttbr0(&self) -> Result<u32, Error>
[src]
fn get_ttbr0(&self) -> Result<u32, Error>
Gets the TTBR0
register.
fn set_ttbr0(&self, val: u32) -> Result<(), Error>
[src]
fn set_ttbr0(&self, val: u32) -> Result<(), Error>
Sets the TTBR0
register to the given value.
fn get_ttbcr(&self) -> Result<u32, Error>
[src]
fn get_ttbcr(&self) -> Result<u32, Error>
Gets the TTBCR
register.
fn set_ttbcr(&self, val: u32) -> Result<(), Error>
[src]
fn set_ttbcr(&self, val: u32) -> Result<(), Error>
Sets the TTBCR
register to the given value.
fn get_dacr(&self) -> Result<u32, Error>
[src]
fn get_dacr(&self) -> Result<u32, Error>
Gets the DACR
register.
fn set_dacr(&self, val: u32) -> Result<(), Error>
[src]
fn set_dacr(&self, val: u32) -> Result<(), Error>
Sets the DACR
register to the given value.
fn get_sctlr(&self) -> Result<u32, Error>
[src]
fn get_sctlr(&self) -> Result<u32, Error>
Gets the SCTLR
register.
fn set_sctlr(&self, val: u32) -> Result<(), Error>
[src]
fn set_sctlr(&self, val: u32) -> Result<(), Error>
Sets the SCTLR
register to the given value.
fn read_arm_cp_reg(
&self,
coproc: u32,
opc1: u32,
cr_n: u32,
cr_m: u32,
opc2: u32
) -> Result<u32, Error>
[src]
fn read_arm_cp_reg(
&self,
coproc: u32,
opc1: u32,
cr_n: u32,
cr_m: u32,
opc2: u32
) -> Result<u32, Error>
Reads the given ARM register.
fn write_arm_cp_reg(
&self,
coproc: u32,
opc1: u32,
cr_n: u32,
cr_m: u32,
opc2: u32,
val: u32
) -> Result<(), Error>
[src]
fn write_arm_cp_reg(
&self,
coproc: u32,
opc1: u32,
cr_n: u32,
cr_m: u32,
opc2: u32,
val: u32
) -> Result<(), Error>
Writes the given value to the given ARM register.
pub fn read_sid(&self) -> Result<Option<[u32; 4]>, Error>
[src]
pub fn read_sid(&self) -> Result<Option<[u32; 4]>, Error>
Reads the SID from the SoC if it has one.
pub fn read_words(&self, offset: u32, words: &mut [u32]) -> Result<(), Error>
[src]
pub fn read_words(&self, offset: u32, words: &mut [u32]) -> Result<(), Error>
Read words chunk from the FEL device memory.
pub fn write_words(&self, offset: u32, words: &[u32]) -> Result<(), Error>
[src]
pub fn write_words(&self, offset: u32, words: &[u32]) -> Result<(), Error>
Write words chunk to the FEL device memory.
fn read_words_chunk(&self, offset: u32, words: &mut [u32]) -> Result<(), Error>
[src]
fn read_words_chunk(&self, offset: u32, words: &mut [u32]) -> Result<(), Error>
Read words chunk from the FEL device memory.
fn write_words_chunk(&self, offset: u32, words: &[u32]) -> Result<(), Error>
[src]
fn write_words_chunk(&self, offset: u32, words: &[u32]) -> Result<(), Error>
Write words chunk to the FEL device memory.
pub fn rmr_request(&self, entry_point: u32, aarch64: bool) -> Result<(), Error>
[src]
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>>
pub fn fel_fill(
&self,
offset: u32,
num_bytes: u32,
byte: u8
) -> Result<(), Error>
[src]
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.
pub fn fel_read(&self, offset: u32, buf: &mut [u8]) -> Result<(), Error>
[src]
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.
pub fn fel_write(&self, offset: u32, buf: &[u8]) -> Result<(), Error>
[src]
pub fn fel_write(&self, offset: u32, buf: &[u8]) -> Result<(), Error>
Writes to the FEL device memory at the given offset.
It will panic if the buffer overflows total memory address space.
pub fn fel_execute(&self, offset: u32) -> Result<(), Error>
[src]
pub fn fel_execute(&self, offset: u32) -> Result<(), Error>
Makes the FEL device execute the code at the given address.
fn get_fel_version(&self) -> Result<Version, Error>
[src]
fn get_fel_version(&self) -> Result<Version, Error>
Gets the SoC version information.
fn read_fel_status(&self) -> Result<(), Error>
[src]
fn read_fel_status(&self) -> Result<(), Error>
Reads the FEL status.
fn send_fel_request(
&self,
req_type: u32,
addr: u32,
len: u32
) -> Result<(), Error>
[src]
fn send_fel_request(
&self,
req_type: u32,
addr: u32,
len: u32
) -> Result<(), Error>
Sends a FEL request.
fn usb_read(&self, data: &mut [u8]) -> Result<(), Error>
[src]
fn usb_read(&self, data: &mut [u8]) -> Result<(), Error>
Reads the given data from the USB.
fn usb_write(&self, data: &[u8]) -> Result<(), Error>
[src]
fn usb_write(&self, data: &[u8]) -> Result<(), Error>
Writes the given data to the USB.
fn send_usb_request(&self, req_type: u16, len: u32) -> Result<(), Error>
[src]
fn send_usb_request(&self, req_type: u16, len: u32) -> Result<(), Error>
Sends the request type USB request.
fn read_usb_response(&self) -> Result<(), Error>
[src]
fn read_usb_response(&self) -> Result<(), Error>
Reads and discards the USB response. It will check if the response is correct.
Trait Implementations
impl<'h> Debug for FelHandle<'h>
[src]
impl<'h> Debug for FelHandle<'h>
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl<'h> Deref for FelHandle<'h>
[src]
impl<'h> Deref for FelHandle<'h>
Auto Trait Implementations
Blanket Implementations
impl<T> From for T
[src]
impl<T> From for T
impl<T, U> Into for T where
U: From<T>,
[src]
impl<T, U> Into for T where
U: From<T>,
impl<T, U> TryFrom for T where
T: From<U>,
[src]
impl<T, U> TryFrom for T where
T: From<U>,
type Error = !
try_from
)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
try_from
)Performs the conversion.
impl<T> Borrow for T where
T: ?Sized,
[src]
impl<T> Borrow for T where
T: ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
impl<T> BorrowMut for T where
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
try_from
)The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
try_from
)Performs the conversion.
impl<T> Any for T where
T: 'static + ?Sized,
[src]
impl<T> Any for T where
T: 'static + ?Sized,
fn get_type_id(&self) -> TypeId
[src]
fn get_type_id(&self) -> TypeId
🔬 This is a nightly-only experimental API. (get_type_id
)
this method will likely be replaced by an associated static
Gets the TypeId
of self
. Read more