dxd - dynax driver framework 3.0.0d222
cross platform open source driver development framework
Loading...
Searching...
No Matches
dx::usb::ezusb Namespace Reference

the Cypress EZ-USB firmware download, shared with the kernel More...

Classes

struct  an21
 the chip's CPU control register (bit 0: reset) and where its internal RAM ends More...
struct  fx2

Enumerations

enum  request : uint8_t { internal = 0xa0 , external = 0xa3 }

Functions

template<typename chip_t, typename poke_t>
bool load (const uint8_t *loader, size_t loader_size, const uint8_t *firmware, size_t firmware_size, poke_t &&poke)
template<typename apply_t>
bool records (const uint8_t *image, size_t size, apply_t &&apply)

Detailed Description

the Cypress EZ-USB firmware download, shared with the kernel

An EZ-USB (AN21xx, FX, FX2) enumerates with its on-chip loader alone; its firmware goes into RAM over vendor requests and runs once the CPU's reset bit is released, whereupon the firmware re-enumerates the device under its own identity. Two requests serve the download: internal (0xa0) is the loader's own and reaches the internal RAM only, external (0xa3) is served by a second stage loader the caller downloads first, and reaches the external RAM. An image is the data records of the vendor's Intel HEX file as the build packs them (embed_file: address (2 bytes, high first), length, data); the caller supplies the images and the poke - the platform's vendor control request - this header the walk and the sequence, which is fxload's.

Enumeration Type Documentation

◆ request

Enumerator
internal 

the on-chip loader: internal RAM and the CPUCS register

external 

a second stage loader: external RAM

Function Documentation

◆ load()

template<typename chip_t, typename poke_t>
bool dx::usb::ezusb::load ( const uint8_t * loader,
size_t loader_size,
const uint8_t * firmware,
size_t firmware_size,
poke_t && poke )

the download: poke(request, address, data, length) is the vendor control request to the device; the CPU is held in reset while its internal RAM is written, the second stage loader runs while the firmware's external part goes through it, and the firmware runs at the end - the device then re-enumerates by itself. Without a loader the firmware is written internally alone

Here is the call graph for this function:

◆ records()

template<typename apply_t>
bool dx::usb::ezusb::records ( const uint8_t * image,
size_t size,
apply_t && apply )

walks an image's records and hands every one to apply(address, data, length); false on a record running past the image, or when apply refuses one - the walk ends there

Here is the caller graph for this function:

(c) copyright 2009 dynamic acoustics e.U. generated on

a closed source license may be obtained by requesting a written permission from dynamic acoustics e.U.
however - governmental use generally and military use especially is strictly prohibited though.