Custom firmware (SDCC + fx2lib) implements all stock vendor commands (0x80-0x94) plus new commands for spectrum sweep (0xB0), raw BCM4500 register access (0xB1/0xB2), and blind scan (0xB3). Compiles to 6.3KB of code with healthy RAM margins. RAM loader (fw_load.py) uses the FX2 0xA0 vendor request to load firmware into RAM without touching EEPROM -- power cycle restores factory firmware. Supports Intel HEX and raw binary formats.
231 lines
5.4 KiB
Plaintext
231 lines
5.4 KiB
Plaintext
; USB Descriptors for Genpix SkyWalker-1 Custom Firmware
|
|
;
|
|
; VID=0x09C0, PID=0x0203
|
|
; Single interface, EP2 IN bulk 512-byte for TS data
|
|
|
|
.module DEV_DSCR
|
|
|
|
; descriptor types
|
|
DSCR_DEVICE_TYPE=1
|
|
DSCR_CONFIG_TYPE=2
|
|
DSCR_STRING_TYPE=3
|
|
DSCR_INTERFACE_TYPE=4
|
|
DSCR_ENDPOINT_TYPE=5
|
|
DSCR_DEVQUAL_TYPE=6
|
|
|
|
; for the repeating interfaces
|
|
DSCR_INTERFACE_LEN=9
|
|
DSCR_ENDPOINT_LEN=7
|
|
|
|
; endpoint types
|
|
ENDPOINT_TYPE_CONTROL=0
|
|
ENDPOINT_TYPE_ISO=1
|
|
ENDPOINT_TYPE_BULK=2
|
|
ENDPOINT_TYPE_INT=3
|
|
|
|
.globl _dev_dscr, _dev_qual_dscr, _highspd_dscr, _fullspd_dscr, _dev_strings, _dev_strings_end
|
|
.area DSCR_AREA (CODE)
|
|
|
|
_dev_dscr:
|
|
.db dev_dscr_end-_dev_dscr ; len
|
|
.db DSCR_DEVICE_TYPE ; type
|
|
.dw 0x0002 ; usb 2.0
|
|
.db 0xff ; class (vendor specific)
|
|
.db 0xff ; subclass (vendor specific)
|
|
.db 0xff ; protocol (vendor specific)
|
|
.db 64 ; packet size (ep0)
|
|
.dw 0xC009 ; vendor id 0x09C0 (byte-swapped)
|
|
.dw 0x0302 ; product id 0x0203 (byte-swapped)
|
|
.dw 0x0100 ; version id
|
|
.db 1 ; manufacturer str idx
|
|
.db 2 ; product str idx
|
|
.db 3 ; serial str idx
|
|
.db 1 ; n configurations
|
|
dev_dscr_end:
|
|
|
|
_dev_qual_dscr:
|
|
.db dev_qualdscr_end-_dev_qual_dscr
|
|
.db DSCR_DEVQUAL_TYPE
|
|
.dw 0x0002 ; usb 2.0
|
|
.db 0xff
|
|
.db 0xff
|
|
.db 0xff
|
|
.db 64 ; max packet
|
|
.db 1 ; n configs
|
|
.db 0 ; extra reserved byte
|
|
dev_qualdscr_end:
|
|
|
|
; --- High speed configuration descriptor ---
|
|
_highspd_dscr:
|
|
.db highspd_dscr_end-_highspd_dscr
|
|
.db DSCR_CONFIG_TYPE
|
|
.db (highspd_dscr_realend-_highspd_dscr) % 256 ; total length lsb
|
|
.db (highspd_dscr_realend-_highspd_dscr) / 256 ; total length msb
|
|
.db 1 ; n interfaces
|
|
.db 1 ; config number
|
|
.db 0 ; config string
|
|
.db 0x80 ; attrs = bus powered, no wakeup
|
|
.db 0xFA ; max power = 500mA (0xFA * 2 = 500)
|
|
highspd_dscr_end:
|
|
|
|
; interface 0
|
|
.db DSCR_INTERFACE_LEN
|
|
.db DSCR_INTERFACE_TYPE
|
|
.db 0 ; index
|
|
.db 0 ; alt setting idx
|
|
.db 1 ; n endpoints (EP2 IN only)
|
|
.db 0xff ; class (vendor specific)
|
|
.db 0xff
|
|
.db 0xff
|
|
.db 4 ; string index
|
|
|
|
; endpoint 2 IN (0x82) -- MPEG-2 transport stream bulk
|
|
.db DSCR_ENDPOINT_LEN
|
|
.db DSCR_ENDPOINT_TYPE
|
|
.db 0x82 ; ep2 dir=IN and address
|
|
.db ENDPOINT_TYPE_BULK ; type
|
|
.db 0x00 ; max packet LSB
|
|
.db 0x02 ; max packet size=512 bytes
|
|
.db 0x00 ; polling interval
|
|
|
|
highspd_dscr_realend:
|
|
|
|
.even
|
|
; --- Full speed configuration descriptor ---
|
|
_fullspd_dscr:
|
|
.db fullspd_dscr_end-_fullspd_dscr
|
|
.db DSCR_CONFIG_TYPE
|
|
.db (fullspd_dscr_realend-_fullspd_dscr) % 256 ; total length lsb
|
|
.db (fullspd_dscr_realend-_fullspd_dscr) / 256 ; total length msb
|
|
.db 1 ; n interfaces
|
|
.db 1 ; config number
|
|
.db 0 ; config string
|
|
.db 0x80 ; attrs = bus powered, no wakeup
|
|
.db 0xFA ; max power = 500mA
|
|
fullspd_dscr_end:
|
|
|
|
; interface 0
|
|
.db DSCR_INTERFACE_LEN
|
|
.db DSCR_INTERFACE_TYPE
|
|
.db 0 ; index
|
|
.db 0 ; alt setting idx
|
|
.db 1 ; n endpoints
|
|
.db 0xff ; class (vendor specific)
|
|
.db 0xff
|
|
.db 0xff
|
|
.db 4 ; string index
|
|
|
|
; endpoint 2 IN (0x82) -- bulk 64 byte at full speed
|
|
.db DSCR_ENDPOINT_LEN
|
|
.db DSCR_ENDPOINT_TYPE
|
|
.db 0x82 ; ep2 dir=IN and address
|
|
.db ENDPOINT_TYPE_BULK ; type
|
|
.db 0x40 ; max packet LSB = 64
|
|
.db 0x00 ; max packet size MSB
|
|
.db 0x00 ; polling interval
|
|
|
|
fullspd_dscr_realend:
|
|
|
|
.even
|
|
_dev_strings:
|
|
|
|
; string 0 -- language descriptor
|
|
_string0:
|
|
.db string0end-_string0
|
|
.db DSCR_STRING_TYPE
|
|
.db 0x09, 0x04 ; English (US)
|
|
string0end:
|
|
|
|
; string 1 -- manufacturer
|
|
_string1:
|
|
.db string1end-_string1
|
|
.db DSCR_STRING_TYPE
|
|
.ascii 'G'
|
|
.db 0
|
|
.ascii 'e'
|
|
.db 0
|
|
.ascii 'n'
|
|
.db 0
|
|
.ascii 'p'
|
|
.db 0
|
|
.ascii 'i'
|
|
.db 0
|
|
.ascii 'x'
|
|
.db 0
|
|
string1end:
|
|
|
|
; string 2 -- product
|
|
_string2:
|
|
.db string2end-_string2
|
|
.db DSCR_STRING_TYPE
|
|
.ascii 'S'
|
|
.db 0
|
|
.ascii 'k'
|
|
.db 0
|
|
.ascii 'y'
|
|
.db 0
|
|
.ascii 'W'
|
|
.db 0
|
|
.ascii 'a'
|
|
.db 0
|
|
.ascii 'l'
|
|
.db 0
|
|
.ascii 'k'
|
|
.db 0
|
|
.ascii 'e'
|
|
.db 0
|
|
.ascii 'r'
|
|
.db 0
|
|
.ascii '-'
|
|
.db 0
|
|
.ascii '1'
|
|
.db 0
|
|
.ascii ' '
|
|
.db 0
|
|
.ascii 'C'
|
|
.db 0
|
|
.ascii 'u'
|
|
.db 0
|
|
.ascii 's'
|
|
.db 0
|
|
.ascii 't'
|
|
.db 0
|
|
.ascii 'o'
|
|
.db 0
|
|
.ascii 'm'
|
|
.db 0
|
|
string2end:
|
|
|
|
; string 3 -- serial number
|
|
_string3:
|
|
.db string3end-_string3
|
|
.db DSCR_STRING_TYPE
|
|
.ascii '0'
|
|
.db 0
|
|
.ascii '0'
|
|
.db 0
|
|
.ascii '0'
|
|
.db 0
|
|
.ascii '1'
|
|
.db 0
|
|
string3end:
|
|
|
|
; string 4 -- interface
|
|
_string4:
|
|
.db string4end-_string4
|
|
.db DSCR_STRING_TYPE
|
|
.ascii 'D'
|
|
.db 0
|
|
.ascii 'V'
|
|
.db 0
|
|
.ascii 'B'
|
|
.db 0
|
|
.ascii '-'
|
|
.db 0
|
|
.ascii 'S'
|
|
.db 0
|
|
string4end:
|
|
|
|
_dev_strings_end:
|
|
.dw 0x0000
|