How arnurkabdylkak/sdio_rgmii_brd works
This repository is a bare-metal LiteX/VexRiscv port that brings up a CYW55500 Wi-Fi 6 module over SDIO on a Tang Primer 25K. The principal path is firmware boot and WHD initialization, firmware download, network scan and selection, WPA2 association/host-side handshake, then data-path handoff. The graph also preserves the custom SoC hardware, WHD’s SDIO and resource layers, and the documented packet-analysis utilities. Some runtime links are documented rather than visible in sampled implementation excerpts; those use the README as evidence.
Main entry points: main_whd.c WHD boot flow · whd_wifi_api.c WHD API · wpa2_eapol.c WPA2 handshake · cyhal_sdio_litex.c LiteX SDIO HAL
Components 21
FPGA platform
- LiteX SoC
sipeed_tang_primer_25k.py - SDIO controller
firmware/litex_sd_hw.h - Wi-Fi controls
firmware/litex_sd_hw.h
Firmware workflow
- WHD boot flow
firmware/main_whd.c - LiteX SDIO HAL
firmware/cyhal_sdio_litex.c - Bare-metal RTOS port
firmware/cy_rtos_litex.c - Scan and join
firmware/main_whd.c - Network interface port
firmware/whd_netif_litex.c
WHD driver
- WHD API
wifi-host-driver/WHD/COMPONENT_WIFI6/src/whd_wifi_api.c - WHD SDIO protocol
wifi-host-driver/WHD/COMPONENT_WIFI6/src/bus_protocols/whd_bus_sdio_protocol.c - Firmware resources
wifi-host-driver/WHD/COMPONENT_WIFI6/resources/resource_imp/whd_resources.c
Security and data
- WPA2 handshake
firmware/wpa2_eapol.c - WPA2 cryptography
firmware/wpa2_crypto.c - Data-path handoff
firmware/main_whd.c
Network utilities
- Handshake capture
tools/sniff_handshake.py - CCMP decoder
tools/decrypt_ccmp.py - ARP injection
tools/wifi_inject_arp.py - Ethernet utilities
tools/eth_ping.py
Other components
- Operator
- CYW55500 module
- Wi-Fi access point
Connections 23
- Operator → WHD boot flow: starts firmware
- WHD boot flow → LiteX SDIO HAL: initializes SDIO
firmware/main_whd.c - LiteX SDIO HAL → SDIO controller: accesses registers
firmware/cyhal_sdio_litex.c - WHD boot flow → WHD API: initializes WHD
firmware/main_whd.c - WHD boot flow → Bare-metal RTOS port: uses timing services
- WHD API → WHD SDIO protocol: dispatches bus operations
- WHD SDIO protocol → LiteX SDIO HAL: uses SDIO HAL
- WHD API → Firmware resources: loads resources
- Firmware resources → CYW55500 module: supplies firmware
- SDIO controller → CYW55500 module: transfers SDIO data
- Wi-Fi controls → CYW55500 module: controls power
- WHD boot flow → Scan and join: scans and selects
firmware/main_whd.c - Scan and join → WHD API: calls scan APIs
firmware/main_whd.c - Scan and join → Wi-Fi access point: discovers network
- WHD boot flow → WPA2 handshake: runs handshake
- WPA2 handshake → WPA2 cryptography: uses primitives
firmware/wpa2_eapol.c - WPA2 handshake → WHD API: uses WHD interface
firmware/wpa2_eapol.c - WHD boot flow → Network interface port: configures network port
- WHD boot flow → Data-path handoff: hands off data path
firmware/main_whd.c - Wi-Fi access point → Handshake capture: emits captured traffic
- Handshake capture → CCMP decoder: provides handshake data
- Operator → ARP injection: requests packet injection
- Operator → Ethernet utilities: runs diagnostics