forked from djmuhlestein/fx2lib
-
Notifications
You must be signed in to change notification settings - Fork 6
Adding GPIO MPSSE support to FX2. #24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
RacingTornado
wants to merge
1
commit into
mithro:linux-descriptors
Choose a base branch
from
RacingTornado:mpsse_gpio_merge_8
base: linux-descriptors
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| #!/bin/bash -e | ||
|
|
||
| DEVS=$(lsusb|grep -E '(2a19|16c0|04b4|1d50|fb9a|1443)' |sed 's/:.*//;s/Bus //;s/Device //;s/ /\//') | ||
|
|
||
| if [ -z "$1" ]; then | ||
| echo "$0: usage: $0 <file>" | ||
| exit 1; | ||
| fi | ||
|
|
||
| for dev in $DEVS;do | ||
| echo "Downloading $1 to $dev" | ||
| /sbin/fxload -D /dev/bus/usb/$dev -t fx2lp -I $1 | ||
| done | ||
|
|
||
| exit 0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| FX2LIBDIR=../../ | ||
| BASENAME = ftdi_mpsse | ||
| SOURCES=ftdi_mpsse.c mpsse_utils.c | ||
| PID=0x1004 | ||
| CODE_SIZE = --code-size 0x3000 | ||
| XRAM_LOC = --xram-loc 0x3200 | ||
| XRAM_SIZE = --xram-size 0x700 | ||
| INT2JT =-Wl"-b INT2JT=0x3100" | ||
| include $(FX2LIBDIR)lib/fx2.mk | ||
| include $(FX2LIBDIR)lib/fx2-cdesc.mk | ||
| fx2_download: | ||
| ../download.sh build/$(BASENAME).ihx |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,216 @@ | ||
| /* | ||
| The descriptors below setup an FTDI device with a VID | ||
| of 0x0403, and PID of 0x6010.In this particular case | ||
| endpoint 1 is used to transfer data in and out of the device | ||
| since it can be easily accessed by the CPU and is not used | ||
| for other purposes(Typically used for transferring small aamount | ||
| of data which is what we need) | ||
| Bus 003 Device 039: ID 0403:6010 | ||
| Future Technology Devices International, Ltd FT2232C Dual USB-UART/FIFO IC | ||
| vbDevice Descriptor: | ||
| bLength 18 | ||
| bDescriptorType 1 | ||
| bcdUSB 2.00 | ||
| bDeviceClass 0 (Defined at Interface level) | ||
| bDeviceSubClass 0 | ||
| bDeviceProtocol 0 | ||
| bMaxPacketSize0 64 | ||
| idVendor 0x0403 Future Technology Devices International, Ltd | ||
| idProduct 0x6010 FT2232C Dual USB-UART/FIFO IC | ||
| bcdDevice 7.00 | ||
| iManufacturer 1 | ||
| iProduct 2 | ||
| iSerial 3 | ||
| bNumConfigurations 1 | ||
| Configuration Descriptor: | ||
| bLength 9 | ||
| bDescriptorType 2 | ||
| wTotalLength 55 | ||
| bNumInterfaces 2 | ||
| bConfigurationValue 1 | ||
| iConfiguration 0 | ||
| bmAttributes 0x80 | ||
| (Bus Powered) | ||
| MaxPower 100mA | ||
| Interface Descriptor: | ||
| bLength 9 | ||
| bDescriptorType 4 | ||
| bInterfaceNumber 0 | ||
| bAlternateSetting 0 | ||
| bNumEndpoints 2 | ||
| bInterfaceClass 255 Vendor Specific Class | ||
| bInterfaceSubClass 255 Vendor Specific Subclass | ||
| bInterfaceProtocol 255 Vendor Specific Protocol | ||
| iInterface 2 | ||
| Endpoint Descriptor: | ||
| bLength 7 | ||
| bDescriptorType 5 | ||
| bEndpointAddress 0x81 EP 1 IN | ||
| bmAttributes 2 | ||
| Transfer Type Bulk | ||
| Synch Type None | ||
| Usage Type Data | ||
| wMaxPacketSize 0x0200 1x 512 bytes | ||
| bInterval 0 | ||
| Endpoint Descriptor: | ||
| bLength 7 | ||
| bDescriptorType 5 | ||
| bEndpointAddress 0x02 EP 2 OUT | ||
| bmAttributes 2 | ||
| Transfer Type Bulk | ||
| Synch Type None | ||
| Usage Type Data | ||
| wMaxPacketSize 0x0200 1x 512 bytes | ||
| bInterval 0 | ||
| Interface Descriptor: | ||
| bLength 9 | ||
| bDescriptorType 4 | ||
| bInterfaceNumber 1 | ||
| bAlternateSetting 0 | ||
| bNumEndpoints 2 | ||
| bInterfaceClass 255 Vendor Specific Class | ||
| bInterfaceSubClass 255 Vendor Specific Subclass | ||
| bInterfaceProtocol 255 Vendor Specific Protocol | ||
| iInterface 2 | ||
| Endpoint Descriptor: | ||
| bLength 7 | ||
| bDescriptorType 5 | ||
| bEndpointAddress 0x83 EP 3 IN | ||
| bmAttributes 2 | ||
| Transfer Type Bulk | ||
| Synch Type None | ||
| Usage Type Data | ||
| wMaxPacketSize 0x0200 1x 512 bytes | ||
| bInterval 0 | ||
| Endpoint Descriptor: | ||
| bLength 7 | ||
| bDescriptorType 5 | ||
| bEndpointAddress 0x04 EP 4 OUT | ||
| bmAttributes 2 | ||
| Transfer Type Bulk | ||
| Synch Type None | ||
| Usage Type Data | ||
| wMaxPacketSize 0x0200 1x 512 bytes | ||
| bInterval 0 | ||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
| */ | ||
| #include "descriptors.h" | ||
|
|
||
| __code __at(0x3e00) struct usb_descriptors code_descriptors = | ||
| { | ||
| .device = { | ||
| .bLength = USB_DT_DEVICE_SIZE, | ||
| .bDescriptorType = USB_DT_DEVICE, | ||
| .bcdUSB = USB_BCD_V20, | ||
| .bDeviceClass = USB_CLASS_VENDOR_SPEC, | ||
| .bDeviceSubClass = USB_SUBCLASS_VENDOR_SPEC, | ||
| .bDeviceProtocol = 0xff, | ||
| .bMaxPacketSize0 = 64, | ||
| .idVendor = 0x0403, | ||
| .idProduct = 0x6010, | ||
| .bcdDevice = 0x0007, | ||
| .iManufacturer = USB_STRING_INDEX(0), | ||
| .iProduct = USB_STRING_INDEX(1), | ||
| .iSerialNumber = USB_STRING_INDEX_NONE, | ||
| .bNumConfigurations = 1, | ||
| }, | ||
| .qualifier = { | ||
| .bLength = USB_DT_DEVICE_QUALIFIER_SIZE, | ||
| .bDescriptorType = USB_DT_DEVICE_QUALIFIER, | ||
| .bcdUSB = USB_BCD_V20, | ||
| .bDeviceClass = USB_CLASS_VENDOR_SPEC, | ||
| .bDeviceSubClass = USB_SUBCLASS_VENDOR_SPEC, | ||
| .bDeviceProtocol = 0xff, | ||
| .bMaxPacketSize0 = 64, | ||
| .bNumConfigurations = 1, | ||
| .bRESERVED = 0, | ||
| }, | ||
| .highspeed = { | ||
| .config = { | ||
| .bLength = USB_DT_CONFIG_SIZE, | ||
| .bDescriptorType = USB_DT_CONFIG, | ||
| .wTotalLength = sizeof(descriptors.highspeed), | ||
| .bNumInterfaces = 1, | ||
| .bConfigurationValue = 1, | ||
| .iConfiguration = 0, | ||
| .bmAttributes = USB_CONFIG_ATT_ONE, | ||
| .bMaxPower = 0x32, // FIXME: ??? | ||
| }, | ||
| .interface = { | ||
| .bLength = USB_DT_INTERFACE_SIZE, | ||
| .bDescriptorType = USB_DT_INTERFACE, | ||
| .bInterfaceNumber = 0, | ||
| .bAlternateSetting = 0, | ||
| .bNumEndpoints = 2, | ||
| .bInterfaceClass = USB_CLASS_VENDOR_SPEC, | ||
| .bInterfaceSubClass = USB_SUBCLASS_VENDOR_SPEC, | ||
| .bInterfaceProtocol = USB_PROTOCOL_VENDOR_SPEC, | ||
| .iInterface = USB_STRING_INDEX(2), | ||
| }, | ||
| .endpoints = { | ||
| { | ||
| .bLength = USB_DT_ENDPOINT_SIZE, | ||
| .bDescriptorType = USB_DT_ENDPOINT, | ||
| .bEndpointAddress = USB_ENDPOINT_NUMBER(0x2) | USB_DIR_OUT, | ||
| .bmAttributes = USB_ENDPOINT_XFER_BULK, | ||
| .wMaxPacketSize = 512, | ||
| .bInterval = 0, | ||
| }, | ||
| { | ||
| .bLength = USB_DT_ENDPOINT_SIZE, | ||
| .bDescriptorType = USB_DT_ENDPOINT, | ||
| .bEndpointAddress = USB_ENDPOINT_NUMBER(0x1) | USB_DIR_IN, | ||
| .bmAttributes = USB_ENDPOINT_XFER_BULK, | ||
| .wMaxPacketSize = 512, | ||
| .bInterval = 0, | ||
| }, | ||
| }, | ||
| }, | ||
| .fullspeed = { | ||
| .config = { | ||
| .bLength = USB_DT_CONFIG_SIZE, | ||
| .bDescriptorType = USB_DT_CONFIG, | ||
| .wTotalLength = sizeof(descriptors.fullspeed), | ||
| .bNumInterfaces = 1, | ||
| .bConfigurationValue = 1, | ||
| .iConfiguration = 0, | ||
| .bmAttributes = USB_CONFIG_ATT_ONE, | ||
| .bMaxPower = 0x32, // FIXME: ??? | ||
| }, | ||
| .interface = { | ||
| .bLength = USB_DT_INTERFACE_SIZE, | ||
| .bDescriptorType = USB_DT_INTERFACE, | ||
| .bInterfaceNumber = 0, | ||
| .bAlternateSetting = 0, | ||
| .bNumEndpoints = 2, | ||
| .bInterfaceClass = USB_CLASS_VENDOR_SPEC, | ||
| .bInterfaceSubClass = USB_SUBCLASS_VENDOR_SPEC, | ||
| .bInterfaceProtocol = 0xff, | ||
| .iInterface = 3, | ||
| }, | ||
| .endpoints = { | ||
| { | ||
| .bLength = USB_DT_ENDPOINT_SIZE, | ||
| .bDescriptorType = USB_DT_ENDPOINT, | ||
| .bEndpointAddress = USB_ENDPOINT_NUMBER(0x2) | USB_DIR_OUT, | ||
| .bmAttributes = USB_ENDPOINT_XFER_BULK, | ||
| .wMaxPacketSize = 64, | ||
| .bInterval = 0, | ||
| }, | ||
| { | ||
| .bLength = USB_DT_ENDPOINT_SIZE, | ||
| .bDescriptorType = USB_DT_ENDPOINT, | ||
| .bEndpointAddress = USB_ENDPOINT_NUMBER(0x6) | USB_DIR_IN, | ||
| .bmAttributes = USB_ENDPOINT_XFER_BULK, | ||
| .wMaxPacketSize = 64, | ||
| .bInterval = 0, | ||
| }, | ||
| }, | ||
| }, | ||
| #include "build/descriptors_stringtable.inc" | ||
| }; | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| #include <stddef.h> | ||
|
|
||
| #include "build/descriptors_stringtable.h" | ||
|
|
||
| #include <linux/ch9.h> | ||
| #include <linux/ch9-extra.h> | ||
|
|
||
| #ifndef DESCRIPTORS_H_ | ||
| #define DESCRIPTORS_H_ | ||
|
|
||
| struct usb_section { | ||
| struct usb_config_descriptor config; | ||
| struct usb_interface_descriptor interface; | ||
| struct usb_endpoint_descriptor endpoints[2]; | ||
| }; | ||
|
|
||
| struct usb_descriptors { | ||
| struct usb_device_descriptor device; | ||
| struct usb_qualifier_descriptor qualifier; | ||
| struct usb_section highspeed; | ||
| struct usb_section fullspeed; | ||
| struct usb_descriptors_stringtable stringtable; | ||
| }; | ||
|
|
||
| __xdata __at(DSCR_AREA) struct usb_descriptors descriptors; | ||
|
|
||
| __code __at(DSCR_AREA+offsetof(struct usb_descriptors, device)) WORD dev_dscr; | ||
| __code __at(DSCR_AREA+offsetof(struct usb_descriptors, qualifier)) WORD dev_qual_dscr; | ||
| __code __at(DSCR_AREA+offsetof(struct usb_descriptors, highspeed)) WORD highspd_dscr; | ||
| __code __at(DSCR_AREA+offsetof(struct usb_descriptors, fullspeed)) WORD fullspd_dscr; | ||
| __code __at(DSCR_AREA+offsetof(struct usb_descriptors, stringtable)) WORD dev_strings; | ||
|
|
||
| #endif // DESCRIPTORS_H_ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| Hi | ||
| There | ||
| iFrame |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.......