Skip to main content

TpuDevice

Struct TpuDevice 

Source
pub struct TpuDevice<K: KernelFns> { /* private fields */ }
Expand description

TPU device handle.

Implementations§

Source§

impl<K: KernelFns> TpuDevice<K>

Source

pub const fn new( tdma_base: NonNull<u8>, tiu_base: NonNull<u8>, config: TpuConfig, kfns: K, ) -> Self

Create a new TPU device handle.

Source

pub fn initialize(&mut self) -> Result<(), TpuError>

Source

pub fn probe_setting(&mut self)

Source

pub fn clear_interrupt(&mut self) -> u32

Clear TDMA interrupt and return status bits.

Source

pub fn irq_handle(&mut self) -> u32

Source

pub fn program_tdma_descriptor(&mut self, desc_offset: u32, num_tdma: u32)

Program TDMA descriptor base and fire.

Source

pub fn program_tiu_descriptor(&mut self, desc_offset: u64, lane: TiuLaneNum)

Program TIU descriptor base and fire.

Source

pub fn resync_cmd_id(&mut self)

Reset TIU/TDMA sync IDs.

Source

pub fn suspend(&mut self) -> Result<(), TpuError>

Suspend TPU.

Source

pub fn resume(&mut self) -> Result<(), TpuError>

Resume TPU.

Source

pub fn open(&mut self) -> Result<(), TpuError>

Source

pub fn reset(&mut self) -> Result<(), TpuError>

Source

pub fn platform_init(&mut self) -> Result<(), TpuError>

Source

pub fn platform_deinit(&mut self)

Source

pub fn pmu_enable( &mut self, enable: bool, event: TpuPmuEvent, ) -> Result<(), TpuError>

Source

pub fn run_dmabuf( &mut self, dmabuf_paddr: PhysAddr, header: &DmaHeader, descs: &[CpuSyncDesc], ) -> Result<(), TpuError>

Run a DMA buffer.

Source

pub fn run_pio(&mut self, info: &TpuTdmaPioInfo) -> Result<(), TpuError>

Run a TDMA PIO transfer.

Source

pub fn tdma_base(&self) -> NonNull<u8>

Source

pub fn tiu_base(&self) -> NonNull<u8>

Source

pub fn get_tdma_sync_status(&self) -> TdmaSyncStatus

Source

pub fn get_tiu_ctrl_status(&self) -> TiuCtrlStatus

Source

pub fn is_idle(&self) -> bool

Source

pub fn wait_idle(&mut self) -> Result<(), TpuError>

Source

pub fn emergency_stop(&mut self)

Auto Trait Implementations§

§

impl<K> Freeze for TpuDevice<K>
where K: Freeze,

§

impl<K> RefUnwindSafe for TpuDevice<K>
where K: RefUnwindSafe,

§

impl<K> !Send for TpuDevice<K>

§

impl<K> !Sync for TpuDevice<K>

§

impl<K> Unpin for TpuDevice<K>
where K: Unpin,

§

impl<K> UnsafeUnpin for TpuDevice<K>
where K: UnsafeUnpin,

§

impl<K> UnwindSafe for TpuDevice<K>
where K: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.