Skip to content

Cadence Macb ethernet driver in Rust on Sifive fu740 board

License

Notifications You must be signed in to change notification settings

rcore-os/cadence-macb-driver

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Cadence Macb ethernet driver

cadence-macb ethernet Rust driver on SiFive FU740 board.

Quick Start

Initialize ethernet driver

pub struct MEM;
impl MemMapping for MEM {
    fn dma_alloc_coherent(pages: usize) -> usize {
        ...
    }
    fn dma_free_coherent(paddr: usize, pages: usize) {
        ...
    }
}

let mut macb_device = cadence_macb::eth_macb::open::<MEM>(&mac).unwrap();

Sending network packets

cadence_macb::eth_macb_ops::macb_send(&mut macb_device, &packet);

Receiving network packets

cadence_macb::eth_macb_ops::macb_recv(&mut macb_device, &mut rx_buffer);

Reference

  • Linux and U-Boot C code

About

Cadence Macb ethernet driver in Rust on Sifive fu740 board

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Rust 100.0%