#ethernet #board #si-five #driver #cadence #macb #fu740

nightly cadence-macb

cadence-macb ethernet rust driver on SiFive FU740 board

1 unstable release

0.1.0 Feb 23, 2023

#1207 in Hardware support

GPL-2.0 license

130KB
2.5K SLoC

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

Dependencies

~88KB