Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0+ */
0002 /************************************************************************
0003  *
0004  *  USBVEND.H       Vendor-specific USB definitions
0005  *
0006  *  NOTE: This must be kept in sync with the Edgeport firmware and
0007  *  must be kept backward-compatible with older firmware.
0008  *
0009  ************************************************************************
0010  *
0011  *  Copyright (C) 1998 Inside Out Networks, Inc.
0012  *
0013  ************************************************************************/
0014 
0015 #if !defined(_USBVEND_H)
0016 #define _USBVEND_H
0017 
0018 /************************************************************************
0019  *
0020  *      D e f i n e s   /   T y p e d e f s
0021  *
0022  ************************************************************************/
0023 
0024 //
0025 // Definitions of USB product IDs
0026 //
0027 
0028 #define USB_VENDOR_ID_ION   0x1608      // Our VID
0029 #define USB_VENDOR_ID_TI    0x0451      // TI VID
0030 #define USB_VENDOR_ID_AXIOHM    0x05D9      /* Axiohm VID */
0031 
0032 //
0033 // Definitions of USB product IDs (PID)
0034 // We break the USB-defined PID into an OEM Id field (upper 6 bits)
0035 // and a Device Id (bottom 10 bits). The Device Id defines what
0036 // device this actually is regardless of what the OEM wants to
0037 // call it.
0038 //
0039 
0040 // ION-device OEM IDs
0041 #define ION_OEM_ID_ION      0       // 00h Inside Out Networks
0042 #define ION_OEM_ID_NLYNX    1       // 01h NLynx Systems
0043 #define ION_OEM_ID_GENERIC  2       // 02h Generic OEM
0044 #define ION_OEM_ID_MAC      3       // 03h Mac Version
0045 #define ION_OEM_ID_MEGAWOLF 4       // 04h Lupusb OEM Mac version (MegaWolf)
0046 #define ION_OEM_ID_MULTITECH    5       // 05h Multitech Rapidports
0047 #define ION_OEM_ID_AGILENT  6       // 06h AGILENT board
0048 
0049 
0050 // ION-device Device IDs
0051 // Product IDs - assigned to match middle digit of serial number (No longer true)
0052 
0053 #define ION_DEVICE_ID_80251_NETCHIP 0x020   // This bit is set in the PID if this edgeport hardware$
0054                         // is based on the 80251+Netchip.
0055 
0056 #define ION_DEVICE_ID_GENERATION_1  0x00    // Value for 930 based edgeports
0057 #define ION_DEVICE_ID_GENERATION_2  0x01    // Value for 80251+Netchip.
0058 #define ION_DEVICE_ID_GENERATION_3  0x02    // Value for Texas Instruments TUSB5052 chip
0059 #define ION_DEVICE_ID_GENERATION_4  0x03    // Watchport Family of products
0060 #define ION_GENERATION_MASK     0x03
0061 
0062 #define ION_DEVICE_ID_HUB_MASK      0x0080  // This bit in the PID designates a HUB device
0063                         // for example 8C would be a 421 4 port hub
0064                         // and 8D would be a 2 port embedded hub
0065 
0066 #define EDGEPORT_DEVICE_ID_MASK         0x0ff   // Not including OEM or GENERATION fields
0067 
0068 #define ION_DEVICE_ID_UNCONFIGURED_EDGE_DEVICE  0x000   // In manufacturing only
0069 #define ION_DEVICE_ID_EDGEPORT_4        0x001   // Edgeport/4 RS232
0070 #define ION_DEVICE_ID_EDGEPORT_8R       0x002   // Edgeport with RJ45 no Ring
0071 #define ION_DEVICE_ID_RAPIDPORT_4       0x003   // Rapidport/4
0072 #define ION_DEVICE_ID_EDGEPORT_4T       0x004   // Edgeport/4 RS232 for Telxon (aka "Fleetport")
0073 #define ION_DEVICE_ID_EDGEPORT_2        0x005   // Edgeport/2 RS232
0074 #define ION_DEVICE_ID_EDGEPORT_4I       0x006   // Edgeport/4 RS422
0075 #define ION_DEVICE_ID_EDGEPORT_2I       0x007   // Edgeport/2 RS422/RS485
0076 #define ION_DEVICE_ID_EDGEPORT_8RR      0x008   // Edgeport with RJ45 with Data and RTS/CTS only
0077 //  ION_DEVICE_ID_EDGEPORT_8_HANDBUILT  0x009   // Hand-built Edgeport/8 (Placeholder, used in middle digit of serial number only!)
0078 //  ION_DEVICE_ID_MULTIMODEM_4X56       0x00A   // MultiTech version of RP/4 (Placeholder, used in middle digit of serial number only!)
0079 #define ION_DEVICE_ID_EDGEPORT_PARALLEL_PORT    0x00B   // Edgeport/(4)21 Parallel port (USS720)
0080 #define ION_DEVICE_ID_EDGEPORT_421      0x00C   // Edgeport/421 Hub+RS232+Parallel
0081 #define ION_DEVICE_ID_EDGEPORT_21       0x00D   // Edgeport/21  RS232+Parallel
0082 #define ION_DEVICE_ID_EDGEPORT_8_DUAL_CPU   0x00E   // Half of an Edgeport/8 (the kind with 2 EP/4s on 1 PCB)
0083 #define ION_DEVICE_ID_EDGEPORT_8        0x00F   // Edgeport/8 (single-CPU)
0084 #define ION_DEVICE_ID_EDGEPORT_2_DIN        0x010   // Edgeport/2 RS232 with Apple DIN connector
0085 #define ION_DEVICE_ID_EDGEPORT_4_DIN        0x011   // Edgeport/4 RS232 with Apple DIN connector
0086 #define ION_DEVICE_ID_EDGEPORT_16_DUAL_CPU  0x012   // Half of an Edgeport/16 (the kind with 2 EP/8s)
0087 #define ION_DEVICE_ID_EDGEPORT_COMPATIBLE   0x013   // Edgeport Compatible, for NCR, Axiohm etc. testing
0088 #define ION_DEVICE_ID_EDGEPORT_8I       0x014   // Edgeport/8 RS422 (single-CPU)
0089 #define ION_DEVICE_ID_EDGEPORT_1        0x015   // Edgeport/1 RS232
0090 #define ION_DEVICE_ID_EPOS44            0x016   // Half of an EPOS/44 (TIUMP BASED)
0091 #define ION_DEVICE_ID_EDGEPORT_42       0x017   // Edgeport/42
0092 #define ION_DEVICE_ID_EDGEPORT_412_8        0x018   // Edgeport/412 8 port part
0093 #define ION_DEVICE_ID_EDGEPORT_412_4        0x019   // Edgeport/412 4 port part
0094 #define ION_DEVICE_ID_EDGEPORT_22I      0x01A   // Edgeport/22I is an Edgeport/4 with ports 1&2 RS422 and ports 3&4 RS232
0095 
0096 // Compact Form factor TI based devices  2c, 21c, 22c, 221c
0097 #define ION_DEVICE_ID_EDGEPORT_2C       0x01B   // Edgeport/2c is a TI based Edgeport/2 - Small I2c
0098 #define ION_DEVICE_ID_EDGEPORT_221C     0x01C   // Edgeport/221c is a TI based Edgeport/2 with lucent chip and
0099                             // 2 external hub ports - Large I2C
0100 #define ION_DEVICE_ID_EDGEPORT_22C      0x01D   // Edgeport/22c is a TI based Edgeport/2 with
0101                             // 2 external hub ports - Large I2C
0102 #define ION_DEVICE_ID_EDGEPORT_21C      0x01E   // Edgeport/21c is a TI based Edgeport/2 with lucent chip
0103                             // Small I2C
0104 
0105 
0106 /*
0107  *  DANGER DANGER The 0x20 bit was used to indicate a 8251/netchip GEN 2 device.
0108  *  Since the MAC, Linux, and Optimal drivers still used the old code
0109  *  I suggest that you skip the 0x20 bit when creating new PIDs
0110  */
0111 
0112 
0113 // Generation 3 devices -- 3410 based edgport/1 (256 byte I2C)
0114 #define ION_DEVICE_ID_TI3410_EDGEPORT_1     0x040   // Edgeport/1 RS232
0115 #define ION_DEVICE_ID_TI3410_EDGEPORT_1I    0x041   // Edgeport/1i- RS422 model
0116 
0117 // Ti based software switchable RS232/RS422/RS485 devices
0118 #define ION_DEVICE_ID_EDGEPORT_4S       0x042   // Edgeport/4s - software switchable model
0119 #define ION_DEVICE_ID_EDGEPORT_8S       0x043   // Edgeport/8s - software switchable model
0120 
0121 // Usb to Ethernet dongle
0122 #define ION_DEVICE_ID_EDGEPORT_E        0x0E0   // Edgeport/E Usb to Ethernet
0123 
0124 // Edgeport TI based devices
0125 #define ION_DEVICE_ID_TI_EDGEPORT_4     0x0201  // Edgeport/4 RS232
0126 #define ION_DEVICE_ID_TI_EDGEPORT_2     0x0205  // Edgeport/2 RS232
0127 #define ION_DEVICE_ID_TI_EDGEPORT_4I        0x0206  // Edgeport/4i RS422
0128 #define ION_DEVICE_ID_TI_EDGEPORT_2I        0x0207  // Edgeport/2i RS422/RS485
0129 #define ION_DEVICE_ID_TI_EDGEPORT_421       0x020C  // Edgeport/421 4 hub 2 RS232 + Parallel (lucent on a different hub port)
0130 #define ION_DEVICE_ID_TI_EDGEPORT_21        0x020D  // Edgeport/21 2 RS232 + Parallel (lucent on a different hub port)
0131 #define ION_DEVICE_ID_TI_EDGEPORT_416       0x0212  // Edgeport/416
0132 #define ION_DEVICE_ID_TI_EDGEPORT_1     0x0215  // Edgeport/1 RS232
0133 #define ION_DEVICE_ID_TI_EDGEPORT_42        0x0217  // Edgeport/42 4 hub 2 RS232
0134 #define ION_DEVICE_ID_TI_EDGEPORT_22I       0x021A  // Edgeport/22I is an Edgeport/4 with ports 1&2 RS422 and ports 3&4 RS232
0135 #define ION_DEVICE_ID_TI_EDGEPORT_2C        0x021B  // Edgeport/2c RS232
0136 #define ION_DEVICE_ID_TI_EDGEPORT_221C      0x021C  // Edgeport/221c is a TI based Edgeport/2 with lucent chip and
0137                             // 2 external hub ports - Large I2C
0138 #define ION_DEVICE_ID_TI_EDGEPORT_22C       0x021D  // Edgeport/22c is a TI based Edgeport/2 with
0139                             // 2 external hub ports - Large I2C
0140 #define ION_DEVICE_ID_TI_EDGEPORT_21C       0x021E  // Edgeport/21c is a TI based Edgeport/2 with lucent chip
0141 
0142 // Generation 3 devices -- 3410 based edgport/1 (256 byte I2C)
0143 #define ION_DEVICE_ID_TI_TI3410_EDGEPORT_1  0x0240  // Edgeport/1 RS232
0144 #define ION_DEVICE_ID_TI_TI3410_EDGEPORT_1I 0x0241  // Edgeport/1i- RS422 model
0145 
0146 // Ti based software switchable RS232/RS422/RS485 devices
0147 #define ION_DEVICE_ID_TI_EDGEPORT_4S        0x0242  // Edgeport/4s - software switchable model
0148 #define ION_DEVICE_ID_TI_EDGEPORT_8S        0x0243  // Edgeport/8s - software switchable model
0149 #define ION_DEVICE_ID_TI_EDGEPORT_8     0x0244  // Edgeport/8 (single-CPU)
0150 #define ION_DEVICE_ID_TI_EDGEPORT_416B      0x0247  // Edgeport/416
0151 
0152 
0153 /************************************************************************
0154  *
0155  *                        Generation 4 devices
0156  *
0157  ************************************************************************/
0158 
0159 // Watchport based on 3410 both 1-wire and binary products (16K I2C)
0160 #define ION_DEVICE_ID_WP_UNSERIALIZED       0x300   // Watchport based on 3410 both 1-wire and binary products
0161 #define ION_DEVICE_ID_WP_PROXIMITY      0x301   // Watchport/P Discontinued
0162 #define ION_DEVICE_ID_WP_MOTION         0x302   // Watchport/M
0163 #define ION_DEVICE_ID_WP_MOISTURE       0x303   // Watchport/W
0164 #define ION_DEVICE_ID_WP_TEMPERATURE        0x304   // Watchport/T
0165 #define ION_DEVICE_ID_WP_HUMIDITY       0x305   // Watchport/H
0166 
0167 #define ION_DEVICE_ID_WP_POWER          0x306   // Watchport
0168 #define ION_DEVICE_ID_WP_LIGHT          0x307   // Watchport
0169 #define ION_DEVICE_ID_WP_RADIATION      0x308   // Watchport
0170 #define ION_DEVICE_ID_WP_ACCELERATION       0x309   // Watchport/A
0171 #define ION_DEVICE_ID_WP_DISTANCE       0x30A   // Watchport/D Discontinued
0172 #define ION_DEVICE_ID_WP_PROX_DIST      0x30B   // Watchport/D uses distance sensor
0173                             // Default to /P function
0174 
0175 #define ION_DEVICE_ID_PLUS_PWR_HP4CD        0x30C   // 5052 Plus Power HubPort/4CD+ (for Dell)
0176 #define ION_DEVICE_ID_PLUS_PWR_HP4C     0x30D   // 5052 Plus Power HubPort/4C+
0177 #define ION_DEVICE_ID_PLUS_PWR_PCI      0x30E   // 3410 Plus Power PCI Host Controller 4 port
0178 
0179 
0180 //
0181 // Definitions for AXIOHM USB product IDs
0182 //
0183 #define USB_VENDOR_ID_AXIOHM            0x05D9  // Axiohm VID
0184 
0185 #define AXIOHM_DEVICE_ID_MASK           0xffff
0186 #define AXIOHM_DEVICE_ID_EPIC_A758      0xA758
0187 #define AXIOHM_DEVICE_ID_EPIC_A794      0xA794
0188 #define AXIOHM_DEVICE_ID_EPIC_A225      0xA225
0189 
0190 
0191 //
0192 // Definitions for NCR USB product IDs
0193 //
0194 #define USB_VENDOR_ID_NCR           0x0404  // NCR VID
0195 
0196 #define NCR_DEVICE_ID_MASK          0xffff
0197 #define NCR_DEVICE_ID_EPIC_0202         0x0202
0198 #define NCR_DEVICE_ID_EPIC_0203         0x0203
0199 #define NCR_DEVICE_ID_EPIC_0310         0x0310
0200 #define NCR_DEVICE_ID_EPIC_0311         0x0311
0201 #define NCR_DEVICE_ID_EPIC_0312         0x0312
0202 
0203 
0204 //
0205 // Definitions for SYMBOL USB product IDs
0206 //
0207 #define USB_VENDOR_ID_SYMBOL            0x05E0  // Symbol VID
0208 #define SYMBOL_DEVICE_ID_MASK           0xffff
0209 #define SYMBOL_DEVICE_ID_KEYFOB         0x0700
0210 
0211 
0212 //
0213 // Definitions for other product IDs
0214 #define ION_DEVICE_ID_MT4X56USB         0x1403  // OEM device
0215 #define ION_DEVICE_ID_E5805A            0x1A01  // OEM device (rebranded Edgeport/4)
0216 
0217 
0218 #define GENERATION_ID_FROM_USB_PRODUCT_ID(ProductId)                \
0219             ((__u16) ((ProductId >> 8) & (ION_GENERATION_MASK)))
0220 
0221 #define MAKE_USB_PRODUCT_ID(OemId, DeviceId)                    \
0222             ((__u16) (((OemId) << 10) || (DeviceId)))
0223 
0224 #define DEVICE_ID_FROM_USB_PRODUCT_ID(ProductId)                \
0225             ((__u16) ((ProductId) & (EDGEPORT_DEVICE_ID_MASK)))
0226 
0227 #define OEM_ID_FROM_USB_PRODUCT_ID(ProductId)                   \
0228             ((__u16) (((ProductId) >> 10) & 0x3F))
0229 
0230 //
0231 // Definitions of parameters for download code. Note that these are
0232 // specific to a given version of download code and must change if the
0233 // corresponding download code changes.
0234 //
0235 
0236 // TxCredits value below which driver won't bother sending (to prevent too many small writes).
0237 // Send only if above 25%
0238 #define EDGE_FW_GET_TX_CREDITS_SEND_THRESHOLD(InitialCredit, MaxPacketSize) (max(((InitialCredit) / 4), (MaxPacketSize)))
0239 
0240 #define EDGE_FW_BULK_MAX_PACKET_SIZE        64  // Max Packet Size for Bulk In Endpoint (EP1)
0241 #define EDGE_FW_BULK_READ_BUFFER_SIZE       1024    // Size to use for Bulk reads
0242 
0243 #define EDGE_FW_INT_MAX_PACKET_SIZE     32  // Max Packet Size for Interrupt In Endpoint
0244                             // Note that many units were shipped with MPS=16, we
0245                             // force an upgrade to this value).
0246 #define EDGE_FW_INT_INTERVAL            2   // 2ms polling on IntPipe
0247 
0248 
0249 //
0250 // Definitions of I/O Networks vendor-specific requests
0251 // for default endpoint
0252 //
0253 //  bmRequestType = 01000000    Set vendor-specific, to device
0254 //  bmRequestType = 11000000    Get vendor-specific, to device
0255 //
0256 // These are the definitions for the bRequest field for the
0257 // above bmRequestTypes.
0258 //
0259 // For the read/write Edgeport memory commands, the parameters
0260 // are as follows:
0261 //      wValue = 16-bit address
0262 //      wIndex = unused (though we could put segment 00: or FF: here)
0263 //      wLength = # bytes to read/write (max 64)
0264 //
0265 
0266 #define USB_REQUEST_ION_RESET_DEVICE    0   // Warm reboot Edgeport, retaining USB address
0267 #define USB_REQUEST_ION_GET_EPIC_DESC   1   // Get Edgeport Compatibility Descriptor
0268 // unused               2   // Unused, available
0269 #define USB_REQUEST_ION_READ_RAM    3   // Read  EdgePort RAM at specified addr
0270 #define USB_REQUEST_ION_WRITE_RAM   4   // Write EdgePort RAM at specified addr
0271 #define USB_REQUEST_ION_READ_ROM    5   // Read  EdgePort ROM at specified addr
0272 #define USB_REQUEST_ION_WRITE_ROM   6   // Write EdgePort ROM at specified addr
0273 #define USB_REQUEST_ION_EXEC_DL_CODE    7   // Begin execution of RAM-based download
0274                         // code by jumping to address in wIndex:wValue
0275 //                  8   // Unused, available
0276 #define USB_REQUEST_ION_ENABLE_SUSPEND  9   // Enable/Disable suspend feature
0277                         // (wValue != 0: Enable; wValue = 0: Disable)
0278 
0279 #define USB_REQUEST_ION_SEND_IOSP   10  // Send an IOSP command to the edgeport over the control pipe
0280 #define USB_REQUEST_ION_RECV_IOSP   11  // Receive an IOSP command from the edgeport over the control pipe
0281 
0282 
0283 #define USB_REQUEST_ION_DIS_INT_TIMER   0x80    // Sent to Axiohm to enable/ disable
0284                         // interrupt token timer
0285                         // wValue = 1, enable (default)
0286                         // wValue = 0, disable
0287 
0288 //
0289 // Define parameter values for our vendor-specific commands
0290 //
0291 
0292 //
0293 // Edgeport Compatibility Descriptor
0294 //
0295 // This descriptor is only returned by Edgeport-compatible devices
0296 // supporting the EPiC spec. True ION devices do not return this
0297 // descriptor, but instead return STALL on receipt of the
0298 // GET_EPIC_DESC command. The driver interprets a STALL to mean that
0299 // this is a "real" Edgeport.
0300 //
0301 
0302 struct edge_compatibility_bits {
0303     // This __u32 defines which Vendor-specific commands/functionality
0304     // the device supports on the default EP0 pipe.
0305 
0306     __u32   VendEnableSuspend   :  1;   // 0001 Set if device supports ION_ENABLE_SUSPEND
0307     __u32   VendUnused      : 31;   // Available for future expansion, must be 0
0308 
0309     // This __u32 defines which IOSP commands are supported over the
0310     // bulk pipe EP1.
0311 
0312                                             // xxxx Set if device supports:
0313     __u32   IOSPOpen        :  1;   // 0001 OPEN / OPEN_RSP (Currently must be 1)
0314     __u32   IOSPClose       :  1;   // 0002 CLOSE
0315     __u32   IOSPChase       :  1;   // 0004 CHASE / CHASE_RSP
0316     __u32   IOSPSetRxFlow       :  1;   // 0008 SET_RX_FLOW
0317     __u32   IOSPSetTxFlow       :  1;   // 0010 SET_TX_FLOW
0318     __u32   IOSPSetXChar        :  1;   // 0020 SET_XON_CHAR/SET_XOFF_CHAR
0319     __u32   IOSPRxCheck     :  1;   // 0040 RX_CHECK_REQ/RX_CHECK_RSP
0320     __u32   IOSPSetClrBreak     :  1;   // 0080 SET_BREAK/CLEAR_BREAK
0321     __u32   IOSPWriteMCR        :  1;   // 0100 MCR register writes (set/clr DTR/RTS)
0322     __u32   IOSPWriteLCR        :  1;   // 0200 LCR register writes (wordlen/stop/parity)
0323     __u32   IOSPSetBaudRate     :  1;   // 0400 setting Baud rate (writes to LCR.80h and DLL/DLM register)
0324     __u32   IOSPDisableIntPipe  :  1;   // 0800 Do not use the interrupt pipe for TxCredits or RxButesAvailable
0325     __u32   IOSPRxDataAvail     :  1;   // 1000 Return status of RX Fifo (Data available in Fifo)
0326     __u32   IOSPTxPurge     :  1;   // 2000 Purge TXBuffer and/or Fifo in Edgeport hardware
0327     __u32   IOSPUnused      : 18;   // Available for future expansion, must be 0
0328 
0329     // This __u32 defines which 'general' features are supported
0330 
0331     __u32   TrueEdgeport        :  1;   // 0001 Set if device is a 'real' Edgeport
0332                                             // (Used only by driver, NEVER set by an EPiC device)
0333     __u32   GenUnused       : 31;   // Available for future expansion, must be 0
0334 };
0335 
0336 #define EDGE_COMPATIBILITY_MASK0    0x0001
0337 #define EDGE_COMPATIBILITY_MASK1    0x3FFF
0338 #define EDGE_COMPATIBILITY_MASK2    0x0001
0339 
0340 struct edge_compatibility_descriptor {
0341     __u8    Length;             // Descriptor Length (per USB spec)
0342     __u8    DescType;           // Descriptor Type (per USB spec, =DEVICE type)
0343     __u8    EpicVer;            // Version of EPiC spec supported
0344                         // (Currently must be 1)
0345     __u8    NumPorts;           // Number of serial ports supported
0346     __u8    iDownloadFile;          // Index of string containing download code filename
0347                         // 0=no download, FF=download compiled into driver.
0348     __u8    Unused[3];          // Available for future expansion, must be 0
0349                         // (Currently must be 0).
0350     __u8    MajorVersion;           // Firmware version: xx.
0351     __u8    MinorVersion;           //  yy.
0352     __le16  BuildNumber;            //  zzzz (LE format)
0353 
0354     // The following structure contains __u32s, with each bit
0355     // specifying whether the EPiC device supports the given
0356     // command or functionality.
0357     struct edge_compatibility_bits  Supports;
0358 };
0359 
0360 // Values for iDownloadFile
0361 #define EDGE_DOWNLOAD_FILE_NONE     0   // No download requested
0362 #define EDGE_DOWNLOAD_FILE_INTERNAL 0xFF    // Download the file compiled into driver (930 version)
0363 #define EDGE_DOWNLOAD_FILE_I930     0xFF    // Download the file compiled into driver (930 version)
0364 #define EDGE_DOWNLOAD_FILE_80251    0xFE    // Download the file compiled into driver (80251 version)
0365 
0366 
0367 
0368 /*
0369  *  Special addresses for READ/WRITE_RAM/ROM
0370  */
0371 
0372 // Version 1 (original) format of DeviceParams
0373 #define EDGE_MANUF_DESC_ADDR_V1     0x00FF7F00
0374 #define EDGE_MANUF_DESC_LEN_V1      sizeof(EDGE_MANUF_DESCRIPTOR_V1)
0375 
0376 // Version 2 format of DeviceParams. This format is longer (3C0h)
0377 // and starts lower in memory, at the uppermost 1K in ROM.
0378 #define EDGE_MANUF_DESC_ADDR        0x00FF7C00
0379 #define EDGE_MANUF_DESC_LEN     sizeof(struct edge_manuf_descriptor)
0380 
0381 // Boot params descriptor
0382 #define EDGE_BOOT_DESC_ADDR     0x00FF7FC0
0383 #define EDGE_BOOT_DESC_LEN      sizeof(struct edge_boot_descriptor)
0384 
0385 // Define the max block size that may be read or written
0386 // in a read/write RAM/ROM command.
0387 #define MAX_SIZE_REQ_ION_READ_MEM   ((__u16)64)
0388 #define MAX_SIZE_REQ_ION_WRITE_MEM  ((__u16)64)
0389 
0390 
0391 //
0392 // Notes for the following two ION vendor-specific param descriptors:
0393 //
0394 //  1.  These have a standard USB descriptor header so they look like a
0395 //      normal descriptor.
0396 //  2.  Any strings in the structures are in USB-defined string
0397 //      descriptor format, so that they may be separately retrieved,
0398 //      if necessary, with a minimum of work on the 930. This also
0399 //      requires them to be in UNICODE format, which, for English at
0400 //      least, simply means extending each __u8 into a __u16.
0401 //  3.  For all fields, 00 means 'uninitialized'.
0402 //  4.  All unused areas should be set to 00 for future expansion.
0403 //
0404 
0405 // This structure is ver 2 format. It contains ALL USB descriptors as
0406 // well as the configuration parameters that were in the original V1
0407 // structure. It is NOT modified when new boot code is downloaded; rather,
0408 // these values are set or modified by manufacturing. It is located at
0409 // xC00-xFBF (length 3C0h) in the ROM.
0410 // This structure is a superset of the v1 structure and is arranged so
0411 // that all of the v1 fields remain at the same address. We are just
0412 // adding more room to the front of the structure to hold the descriptors.
0413 //
0414 // The actual contents of this structure are defined in a 930 assembly
0415 // file, converted to a binary image, and then written by the serialization
0416 // program. The C definition of this structure just defines a dummy
0417 // area for general USB descriptors and the descriptor tables (the root
0418 // descriptor starts at xC00). At the bottom of the structure are the
0419 // fields inherited from the v1 structure.
0420 
0421 #define MAX_SERIALNUMBER_LEN    12
0422 #define MAX_ASSEMBLYNUMBER_LEN  14
0423 
0424 struct edge_manuf_descriptor {
0425 
0426     __u16   RootDescTable[0x10];            // C00 Root of descriptor tables (just a placeholder)
0427     __u8    DescriptorArea[0x2E0];          // C20 Descriptors go here, up to 2E0h (just a placeholder)
0428 
0429                             //     Start of v1-compatible section
0430     __u8    Length;                 // F00 Desc length for what follows, per USB (= C0h )
0431     __u8    DescType;               // F01 Desc type, per USB (=DEVICE type)
0432     __u8    DescVer;                // F02 Desc version/format (currently 2)
0433     __u8    NumRootDescEntries;         // F03 # entries in RootDescTable
0434 
0435     __u8    RomSize;                // F04 Size of ROM/E2PROM in K
0436     __u8    RamSize;                // F05 Size of external RAM in K
0437     __u8    CpuRev;                 // F06 CPU revision level (chg only if s/w visible)
0438     __u8    BoardRev;               // F07 PCB revision level (chg only if s/w visible)
0439 
0440     __u8    NumPorts;               // F08 Number of ports
0441     __u8    DescDate[3];                // F09 MM/DD/YY when descriptor template was compiler,
0442                             //     so host can track changes to USB-only descriptors.
0443 
0444     __u8    SerNumLength;               // F0C USB string descriptor len
0445     __u8    SerNumDescType;             // F0D USB descriptor type (=STRING type)
0446     __le16  SerialNumber[MAX_SERIALNUMBER_LEN]; // F0E "01-01-000100" Unicode Serial Number
0447 
0448     __u8    AssemblyNumLength;          // F26 USB string descriptor len
0449     __u8    AssemblyNumDescType;            // F27 USB descriptor type (=STRING type)
0450     __le16  AssemblyNumber[MAX_ASSEMBLYNUMBER_LEN]; // F28 "350-1000-01-A " assembly number
0451 
0452     __u8    OemAssyNumLength;           // F44 USB string descriptor len
0453     __u8    OemAssyNumDescType;         // F45 USB descriptor type (=STRING type)
0454     __le16  OemAssyNumber[MAX_ASSEMBLYNUMBER_LEN];  // F46 "xxxxxxxxxxxxxx" OEM assembly number
0455 
0456     __u8    ManufDateLength;            // F62 USB string descriptor len
0457     __u8    ManufDateDescType;          // F63 USB descriptor type (=STRING type)
0458     __le16  ManufDate[6];               // F64 "MMDDYY" manufacturing date
0459 
0460     __u8    Reserved3[0x4D];            // F70 -- unused, set to 0 --
0461 
0462     __u8    UartType;               // FBD Uart Type
0463     __u8    IonPid;                 // FBE Product ID, == LSB of USB DevDesc.PID
0464                             //      (Note: Edgeport/4s before 11/98 will have
0465                             //       00 here instead of 01)
0466     __u8    IonConfig;              // FBF Config byte for ION manufacturing use
0467                             // FBF end of structure, total len = 3C0h
0468 
0469 };
0470 
0471 
0472 #define MANUF_DESC_VER_1    1   // Original definition of MANUF_DESC
0473 #define MANUF_DESC_VER_2    2   // Ver 2, starts at xC00h len 3C0h
0474 
0475 
0476 // Uart Types
0477 // Note: Since this field was added only recently, all Edgeport/4 units
0478 // shipped before 11/98 will have 00 in this field. Therefore,
0479 // both 00 and 01 values mean '654.
0480 #define MANUF_UART_EXAR_654_EARLY   0   // Exar 16C654 in Edgeport/4s before 11/98
0481 #define MANUF_UART_EXAR_654     1   // Exar 16C654
0482 #define MANUF_UART_EXAR_2852        2   // Exar 16C2852
0483 
0484 //
0485 // Note: The CpuRev and BoardRev values do not conform to manufacturing
0486 // revisions; they are to be incremented only when the CPU or hardware
0487 // changes in a software-visible way, such that the 930 software or
0488 // the host driver needs to handle the hardware differently.
0489 //
0490 
0491 // Values of bottom 5 bits of CpuRev & BoardRev for
0492 // Implementation 0 (ie, 930-based)
0493 #define MANUF_CPU_REV_AD4       1   // 930 AD4, with EP1 Rx bug (needs RXSPM)
0494 #define MANUF_CPU_REV_AD5       2   // 930 AD5, with above bug (supposedly) fixed
0495 #define MANUF_CPU_80251         0x20    // Intel 80251
0496 
0497 
0498 #define MANUF_BOARD_REV_A       1   // Original version, == Manuf Rev A
0499 #define MANUF_BOARD_REV_B       2   // Manuf Rev B, wakeup interrupt works
0500 #define MANUF_BOARD_REV_C       3   // Manuf Rev C, 2/4 ports, rs232/rs422
0501 #define MANUF_BOARD_REV_GENERATION_2    0x20    // Second generaiton edgeport
0502 
0503 
0504 // Values of bottom 5 bits of CpuRev & BoardRev for
0505 // Implementation 1 (ie, 251+Netchip-based)
0506 #define MANUF_CPU_REV_1         1   // C251TB Rev 1 (Need actual Intel rev here)
0507 
0508 #define MANUF_BOARD_REV_A       1   // First rev of 251+Netchip design
0509 
0510 #define MANUF_SERNUM_LENGTH     sizeof(((struct edge_manuf_descriptor *)0)->SerialNumber)
0511 #define MANUF_ASSYNUM_LENGTH        sizeof(((struct edge_manuf_descriptor *)0)->AssemblyNumber)
0512 #define MANUF_OEMASSYNUM_LENGTH     sizeof(((struct edge_manuf_descriptor *)0)->OemAssyNumber)
0513 #define MANUF_MANUFDATE_LENGTH      sizeof(((struct edge_manuf_descriptor *)0)->ManufDate)
0514 
0515 #define MANUF_ION_CONFIG_DIAG_NO_LOOP   0x20    // As below but no ext loopback test
0516 #define MANUF_ION_CONFIG_DIAG       0x40    // 930 based device: 1=Run h/w diags, 0=norm
0517                         // TIUMP Device    : 1=IONSERIAL needs to run Final Test
0518 #define MANUF_ION_CONFIG_MASTER     0x80    // 930 based device:  1=Master mode, 0=Normal
0519                         // TIUMP Device    :  1=First device on a multi TIUMP Device
0520 
0521 //
0522 // This structure describes parameters for the boot code, and
0523 // is programmed along with new boot code. These are values
0524 // which are specific to a given build of the boot code. It
0525 // is exactly 64 bytes long and is fixed at address FF:xFC0
0526 // - FF:xFFF. Note that the 930-mandated UCONFIG bytes are
0527 // included in this structure.
0528 //
0529 struct edge_boot_descriptor {
0530     __u8        Length;         // C0 Desc length, per USB (= 40h)
0531     __u8        DescType;       // C1 Desc type, per USB (= DEVICE type)
0532     __u8        DescVer;        // C2 Desc version/format
0533     __u8        Reserved1;      // C3 -- unused, set to 0 --
0534 
0535     __le16      BootCodeLength;     // C4 Boot code goes from FF:0000 to FF:(len-1)
0536                         //    (LE format)
0537 
0538     __u8        MajorVersion;       // C6 Firmware version: xx.
0539     __u8        MinorVersion;       // C7           yy.
0540     __le16      BuildNumber;        // C8           zzzz (LE format)
0541 
0542     __u16       EnumRootDescTable;  // CA Root of ROM-based descriptor table
0543     __u8        NumDescTypes;       // CC Number of supported descriptor types
0544 
0545     __u8        Reserved4;      // CD Fix Compiler Packing
0546 
0547     __le16      Capabilities;       // CE-CF Capabilities flags (LE format)
0548     __u8        Reserved2[0x28];    // D0 -- unused, set to 0 --
0549     __u8        UConfig0;       // F8 930-defined CPU configuration byte 0
0550     __u8        UConfig1;       // F9 930-defined CPU configuration byte 1
0551     __u8        Reserved3[6];       // FA -- unused, set to 0 --
0552                         // FF end of structure, total len = 80
0553 };
0554 
0555 
0556 #define BOOT_DESC_VER_1     1   // Original definition of BOOT_PARAMS
0557 #define BOOT_DESC_VER_2     2   // 2nd definition, descriptors not included in boot
0558 
0559 
0560     // Capabilities flags
0561 
0562 #define BOOT_CAP_RESET_CMD  0x0001  // If set, boot correctly supports ION_RESET_DEVICE
0563 
0564 
0565 /************************************************************************
0566                  T I   U M P   D E F I N I T I O N S
0567  ***********************************************************************/
0568 
0569 // Chip definitions in I2C
0570 #define UMP5152         0x52
0571 #define UMP3410         0x10
0572 
0573 
0574 //************************************************************************
0575 //  TI I2C Format Definitions
0576 //************************************************************************
0577 #define I2C_DESC_TYPE_INFO_BASIC    0x01
0578 #define I2C_DESC_TYPE_FIRMWARE_BASIC    0x02
0579 #define I2C_DESC_TYPE_DEVICE        0x03
0580 #define I2C_DESC_TYPE_CONFIG        0x04
0581 #define I2C_DESC_TYPE_STRING        0x05
0582 #define I2C_DESC_TYPE_FIRMWARE_AUTO 0x07    // for 3410 download
0583 #define I2C_DESC_TYPE_CONFIG_KLUDGE 0x14    // for 3410
0584 #define I2C_DESC_TYPE_WATCHPORT_VERSION 0x15    // firmware version number for watchport
0585 #define I2C_DESC_TYPE_WATCHPORT_CALIBRATION_DATA 0x16   // Watchport Calibration Data
0586 
0587 #define I2C_DESC_TYPE_FIRMWARE_BLANK    0xf2
0588 
0589 // Special section defined by ION
0590 #define I2C_DESC_TYPE_ION       0   // Not defined by TI
0591 
0592 
0593 struct ti_i2c_desc {
0594     __u8    Type;           // Type of descriptor
0595     __le16  Size;           // Size of data only not including header
0596     __u8    CheckSum;       // Checksum (8 bit sum of data only)
0597     __u8    Data[];     // Data starts here
0598 } __attribute__((packed));
0599 
0600 // for 5152 devices only (type 2 record)
0601 // for 3410 the version is stored in the WATCHPORT_FIRMWARE_VERSION descriptor
0602 struct ti_i2c_firmware_rec {
0603     __u8    Ver_Major;      // Firmware Major version number
0604     __u8    Ver_Minor;      // Firmware Minor version number
0605     __u8    Data[];     // Download starts here
0606 } __attribute__((packed));
0607 
0608 
0609 struct watchport_firmware_version {
0610 // Added 2 bytes for version number
0611     __u8    Version_Major;      //  Download Version (for Watchport)
0612     __u8    Version_Minor;
0613 } __attribute__((packed));
0614 
0615 
0616 // Structure of header of download image in fw_down.h
0617 struct ti_i2c_image_header {
0618     __le16  Length;
0619     __u8    CheckSum;
0620 } __attribute__((packed));
0621 
0622 struct ti_basic_descriptor {
0623     __u8    Power;      // Self powered
0624                 // bit 7: 1 - power switching supported
0625                 //        0 - power switching not supported
0626                 //
0627                 // bit 0: 1 - self powered
0628                 //        0 - bus powered
0629                 //
0630                 //
0631     __u16   HubVid;     // VID HUB
0632     __u16   HubPid;     // PID HUB
0633     __u16   DevPid;     // PID Edgeport
0634     __u8    HubTime;    // Time for power on to power good
0635     __u8    HubCurrent; // HUB Current = 100ma
0636 } __attribute__((packed));
0637 
0638 
0639 // CPU / Board Rev Definitions
0640 #define TI_CPU_REV_5052         2   // 5052 based edgeports
0641 #define TI_CPU_REV_3410         3   // 3410 based edgeports
0642 
0643 #define TI_BOARD_REV_TI_EP      0   // Basic ti based edgeport
0644 #define TI_BOARD_REV_COMPACT        1   // Compact board
0645 #define TI_BOARD_REV_WATCHPORT      2   // Watchport
0646 
0647 
0648 #define TI_GET_CPU_REVISION(x)      (__u8)((((x)>>4)&0x0f))
0649 #define TI_GET_BOARD_REVISION(x)    (__u8)(((x)&0x0f))
0650 
0651 #define TI_I2C_SIZE_MASK        0x1f  // 5 bits
0652 #define TI_GET_I2C_SIZE(x)      ((((x) & TI_I2C_SIZE_MASK)+1)*256)
0653 
0654 #define TI_MAX_I2C_SIZE         (16 * 1024)
0655 
0656 #define TI_MANUF_VERSION_0      0
0657 
0658 // IonConig2 flags
0659 #define TI_CONFIG2_RS232        0x01
0660 #define TI_CONFIG2_RS422        0x02
0661 #define TI_CONFIG2_RS485        0x04
0662 #define TI_CONFIG2_SWITCHABLE       0x08
0663 
0664 #define TI_CONFIG2_WATCHPORT        0x10
0665 
0666 
0667 struct edge_ti_manuf_descriptor {
0668     __u8 IonConfig;     //  Config byte for ION manufacturing use
0669     __u8 IonConfig2;    //  Expansion
0670     __u8 Version;       //  Version
0671     __u8 CpuRev_BoardRev;   //  CPU revision level (0xF0) and Board Rev Level (0x0F)
0672     __u8 NumPorts;      //  Number of ports for this UMP
0673     __u8 NumVirtualPorts;   //  Number of Virtual ports
0674     __u8 HubConfig1;    //  Used to configure the Hub
0675     __u8 HubConfig2;    //  Used to configure the Hub
0676     __u8 TotalPorts;    //  Total Number of Com Ports for the entire device (All UMPs)
0677     __u8 Reserved;      //  Reserved
0678 } __attribute__((packed));
0679 
0680 
0681 #endif      // if !defined(_USBVEND_H)