18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0+ */
28c2ecf20Sopenharmony_ci/************************************************************************
38c2ecf20Sopenharmony_ci *
48c2ecf20Sopenharmony_ci *	USBVEND.H		Vendor-specific USB definitions
58c2ecf20Sopenharmony_ci *
68c2ecf20Sopenharmony_ci *	NOTE: This must be kept in sync with the Edgeport firmware and
78c2ecf20Sopenharmony_ci *	must be kept backward-compatible with older firmware.
88c2ecf20Sopenharmony_ci *
98c2ecf20Sopenharmony_ci ************************************************************************
108c2ecf20Sopenharmony_ci *
118c2ecf20Sopenharmony_ci *	Copyright (C) 1998 Inside Out Networks, Inc.
128c2ecf20Sopenharmony_ci *
138c2ecf20Sopenharmony_ci ************************************************************************/
148c2ecf20Sopenharmony_ci
158c2ecf20Sopenharmony_ci#if !defined(_USBVEND_H)
168c2ecf20Sopenharmony_ci#define	_USBVEND_H
178c2ecf20Sopenharmony_ci
188c2ecf20Sopenharmony_ci/************************************************************************
198c2ecf20Sopenharmony_ci *
208c2ecf20Sopenharmony_ci *		D e f i n e s   /   T y p e d e f s
218c2ecf20Sopenharmony_ci *
228c2ecf20Sopenharmony_ci ************************************************************************/
238c2ecf20Sopenharmony_ci
248c2ecf20Sopenharmony_ci//
258c2ecf20Sopenharmony_ci// Definitions of USB product IDs
268c2ecf20Sopenharmony_ci//
278c2ecf20Sopenharmony_ci
288c2ecf20Sopenharmony_ci#define	USB_VENDOR_ID_ION	0x1608		// Our VID
298c2ecf20Sopenharmony_ci#define	USB_VENDOR_ID_TI	0x0451		// TI VID
308c2ecf20Sopenharmony_ci#define USB_VENDOR_ID_AXIOHM	0x05D9		/* Axiohm VID */
318c2ecf20Sopenharmony_ci
328c2ecf20Sopenharmony_ci//
338c2ecf20Sopenharmony_ci// Definitions of USB product IDs (PID)
348c2ecf20Sopenharmony_ci// We break the USB-defined PID into an OEM Id field (upper 6 bits)
358c2ecf20Sopenharmony_ci// and a Device Id (bottom 10 bits). The Device Id defines what
368c2ecf20Sopenharmony_ci// device this actually is regardless of what the OEM wants to
378c2ecf20Sopenharmony_ci// call it.
388c2ecf20Sopenharmony_ci//
398c2ecf20Sopenharmony_ci
408c2ecf20Sopenharmony_ci// ION-device OEM IDs
418c2ecf20Sopenharmony_ci#define	ION_OEM_ID_ION		0		// 00h Inside Out Networks
428c2ecf20Sopenharmony_ci#define	ION_OEM_ID_NLYNX	1		// 01h NLynx Systems
438c2ecf20Sopenharmony_ci#define	ION_OEM_ID_GENERIC	2		// 02h Generic OEM
448c2ecf20Sopenharmony_ci#define	ION_OEM_ID_MAC		3		// 03h Mac Version
458c2ecf20Sopenharmony_ci#define	ION_OEM_ID_MEGAWOLF	4		// 04h Lupusb OEM Mac version (MegaWolf)
468c2ecf20Sopenharmony_ci#define	ION_OEM_ID_MULTITECH	5		// 05h Multitech Rapidports
478c2ecf20Sopenharmony_ci#define	ION_OEM_ID_AGILENT	6		// 06h AGILENT board
488c2ecf20Sopenharmony_ci
498c2ecf20Sopenharmony_ci
508c2ecf20Sopenharmony_ci// ION-device Device IDs
518c2ecf20Sopenharmony_ci// Product IDs - assigned to match middle digit of serial number (No longer true)
528c2ecf20Sopenharmony_ci
538c2ecf20Sopenharmony_ci#define ION_DEVICE_ID_80251_NETCHIP	0x020	// This bit is set in the PID if this edgeport hardware$
548c2ecf20Sopenharmony_ci						// is based on the 80251+Netchip.
558c2ecf20Sopenharmony_ci
568c2ecf20Sopenharmony_ci#define ION_DEVICE_ID_GENERATION_1	0x00	// Value for 930 based edgeports
578c2ecf20Sopenharmony_ci#define ION_DEVICE_ID_GENERATION_2	0x01	// Value for 80251+Netchip.
588c2ecf20Sopenharmony_ci#define ION_DEVICE_ID_GENERATION_3	0x02	// Value for Texas Instruments TUSB5052 chip
598c2ecf20Sopenharmony_ci#define ION_DEVICE_ID_GENERATION_4	0x03	// Watchport Family of products
608c2ecf20Sopenharmony_ci#define ION_GENERATION_MASK		0x03
618c2ecf20Sopenharmony_ci
628c2ecf20Sopenharmony_ci#define ION_DEVICE_ID_HUB_MASK		0x0080	// This bit in the PID designates a HUB device
638c2ecf20Sopenharmony_ci						// for example 8C would be a 421 4 port hub
648c2ecf20Sopenharmony_ci						// and 8D would be a 2 port embedded hub
658c2ecf20Sopenharmony_ci
668c2ecf20Sopenharmony_ci#define EDGEPORT_DEVICE_ID_MASK			0x0ff	// Not including OEM or GENERATION fields
678c2ecf20Sopenharmony_ci
688c2ecf20Sopenharmony_ci#define	ION_DEVICE_ID_UNCONFIGURED_EDGE_DEVICE	0x000	// In manufacturing only
698c2ecf20Sopenharmony_ci#define ION_DEVICE_ID_EDGEPORT_4		0x001	// Edgeport/4 RS232
708c2ecf20Sopenharmony_ci#define	ION_DEVICE_ID_EDGEPORT_8R		0x002	// Edgeport with RJ45 no Ring
718c2ecf20Sopenharmony_ci#define ION_DEVICE_ID_RAPIDPORT_4		0x003	// Rapidport/4
728c2ecf20Sopenharmony_ci#define ION_DEVICE_ID_EDGEPORT_4T		0x004	// Edgeport/4 RS232 for Telxon (aka "Fleetport")
738c2ecf20Sopenharmony_ci#define ION_DEVICE_ID_EDGEPORT_2		0x005	// Edgeport/2 RS232
748c2ecf20Sopenharmony_ci#define ION_DEVICE_ID_EDGEPORT_4I		0x006	// Edgeport/4 RS422
758c2ecf20Sopenharmony_ci#define ION_DEVICE_ID_EDGEPORT_2I		0x007	// Edgeport/2 RS422/RS485
768c2ecf20Sopenharmony_ci#define	ION_DEVICE_ID_EDGEPORT_8RR		0x008	// Edgeport with RJ45 with Data and RTS/CTS only
778c2ecf20Sopenharmony_ci//	ION_DEVICE_ID_EDGEPORT_8_HANDBUILT	0x009	// Hand-built Edgeport/8 (Placeholder, used in middle digit of serial number only!)
788c2ecf20Sopenharmony_ci//	ION_DEVICE_ID_MULTIMODEM_4X56		0x00A	// MultiTech version of RP/4 (Placeholder, used in middle digit of serial number only!)
798c2ecf20Sopenharmony_ci#define	ION_DEVICE_ID_EDGEPORT_PARALLEL_PORT	0x00B	// Edgeport/(4)21 Parallel port (USS720)
808c2ecf20Sopenharmony_ci#define	ION_DEVICE_ID_EDGEPORT_421		0x00C	// Edgeport/421 Hub+RS232+Parallel
818c2ecf20Sopenharmony_ci#define	ION_DEVICE_ID_EDGEPORT_21		0x00D	// Edgeport/21  RS232+Parallel
828c2ecf20Sopenharmony_ci#define ION_DEVICE_ID_EDGEPORT_8_DUAL_CPU	0x00E	// Half of an Edgeport/8 (the kind with 2 EP/4s on 1 PCB)
838c2ecf20Sopenharmony_ci#define ION_DEVICE_ID_EDGEPORT_8		0x00F	// Edgeport/8 (single-CPU)
848c2ecf20Sopenharmony_ci#define ION_DEVICE_ID_EDGEPORT_2_DIN		0x010	// Edgeport/2 RS232 with Apple DIN connector
858c2ecf20Sopenharmony_ci#define ION_DEVICE_ID_EDGEPORT_4_DIN		0x011	// Edgeport/4 RS232 with Apple DIN connector
868c2ecf20Sopenharmony_ci#define ION_DEVICE_ID_EDGEPORT_16_DUAL_CPU	0x012	// Half of an Edgeport/16 (the kind with 2 EP/8s)
878c2ecf20Sopenharmony_ci#define ION_DEVICE_ID_EDGEPORT_COMPATIBLE	0x013	// Edgeport Compatible, for NCR, Axiohm etc. testing
888c2ecf20Sopenharmony_ci#define ION_DEVICE_ID_EDGEPORT_8I		0x014	// Edgeport/8 RS422 (single-CPU)
898c2ecf20Sopenharmony_ci#define ION_DEVICE_ID_EDGEPORT_1		0x015	// Edgeport/1 RS232
908c2ecf20Sopenharmony_ci#define ION_DEVICE_ID_EPOS44			0x016	// Half of an EPOS/44 (TIUMP BASED)
918c2ecf20Sopenharmony_ci#define ION_DEVICE_ID_EDGEPORT_42		0x017	// Edgeport/42
928c2ecf20Sopenharmony_ci#define ION_DEVICE_ID_EDGEPORT_412_8		0x018	// Edgeport/412 8 port part
938c2ecf20Sopenharmony_ci#define ION_DEVICE_ID_EDGEPORT_412_4		0x019	// Edgeport/412	4 port part
948c2ecf20Sopenharmony_ci#define ION_DEVICE_ID_EDGEPORT_22I		0x01A	// Edgeport/22I is an Edgeport/4 with ports 1&2 RS422 and ports 3&4 RS232
958c2ecf20Sopenharmony_ci
968c2ecf20Sopenharmony_ci// Compact Form factor TI based devices  2c, 21c, 22c, 221c
978c2ecf20Sopenharmony_ci#define ION_DEVICE_ID_EDGEPORT_2C		0x01B	// Edgeport/2c is a TI based Edgeport/2 - Small I2c
988c2ecf20Sopenharmony_ci#define ION_DEVICE_ID_EDGEPORT_221C		0x01C	// Edgeport/221c is a TI based Edgeport/2 with lucent chip and
998c2ecf20Sopenharmony_ci							// 2 external hub ports - Large I2C
1008c2ecf20Sopenharmony_ci#define ION_DEVICE_ID_EDGEPORT_22C		0x01D	// Edgeport/22c is a TI based Edgeport/2 with
1018c2ecf20Sopenharmony_ci							// 2 external hub ports - Large I2C
1028c2ecf20Sopenharmony_ci#define ION_DEVICE_ID_EDGEPORT_21C		0x01E	// Edgeport/21c is a TI based Edgeport/2 with lucent chip
1038c2ecf20Sopenharmony_ci							// Small I2C
1048c2ecf20Sopenharmony_ci
1058c2ecf20Sopenharmony_ci
1068c2ecf20Sopenharmony_ci/*
1078c2ecf20Sopenharmony_ci *  DANGER DANGER The 0x20 bit was used to indicate a 8251/netchip GEN 2 device.
1088c2ecf20Sopenharmony_ci *  Since the MAC, Linux, and Optimal drivers still used the old code
1098c2ecf20Sopenharmony_ci *  I suggest that you skip the 0x20 bit when creating new PIDs
1108c2ecf20Sopenharmony_ci */
1118c2ecf20Sopenharmony_ci
1128c2ecf20Sopenharmony_ci
1138c2ecf20Sopenharmony_ci// Generation 3 devices -- 3410 based edgport/1 (256 byte I2C)
1148c2ecf20Sopenharmony_ci#define ION_DEVICE_ID_TI3410_EDGEPORT_1		0x040	// Edgeport/1 RS232
1158c2ecf20Sopenharmony_ci#define ION_DEVICE_ID_TI3410_EDGEPORT_1I	0x041	// Edgeport/1i- RS422 model
1168c2ecf20Sopenharmony_ci
1178c2ecf20Sopenharmony_ci// Ti based software switchable RS232/RS422/RS485 devices
1188c2ecf20Sopenharmony_ci#define ION_DEVICE_ID_EDGEPORT_4S		0x042	// Edgeport/4s - software switchable model
1198c2ecf20Sopenharmony_ci#define ION_DEVICE_ID_EDGEPORT_8S		0x043	// Edgeport/8s - software switchable model
1208c2ecf20Sopenharmony_ci
1218c2ecf20Sopenharmony_ci// Usb to Ethernet dongle
1228c2ecf20Sopenharmony_ci#define ION_DEVICE_ID_EDGEPORT_E		0x0E0	// Edgeport/E Usb to Ethernet
1238c2ecf20Sopenharmony_ci
1248c2ecf20Sopenharmony_ci// Edgeport TI based devices
1258c2ecf20Sopenharmony_ci#define ION_DEVICE_ID_TI_EDGEPORT_4		0x0201	// Edgeport/4 RS232
1268c2ecf20Sopenharmony_ci#define ION_DEVICE_ID_TI_EDGEPORT_2		0x0205	// Edgeport/2 RS232
1278c2ecf20Sopenharmony_ci#define ION_DEVICE_ID_TI_EDGEPORT_4I		0x0206	// Edgeport/4i RS422
1288c2ecf20Sopenharmony_ci#define ION_DEVICE_ID_TI_EDGEPORT_2I		0x0207	// Edgeport/2i RS422/RS485
1298c2ecf20Sopenharmony_ci#define ION_DEVICE_ID_TI_EDGEPORT_421		0x020C	// Edgeport/421 4 hub 2 RS232 + Parallel (lucent on a different hub port)
1308c2ecf20Sopenharmony_ci#define ION_DEVICE_ID_TI_EDGEPORT_21		0x020D	// Edgeport/21 2 RS232 + Parallel (lucent on a different hub port)
1318c2ecf20Sopenharmony_ci#define ION_DEVICE_ID_TI_EDGEPORT_416		0x0212  // Edgeport/416
1328c2ecf20Sopenharmony_ci#define ION_DEVICE_ID_TI_EDGEPORT_1		0x0215	// Edgeport/1 RS232
1338c2ecf20Sopenharmony_ci#define ION_DEVICE_ID_TI_EDGEPORT_42		0x0217	// Edgeport/42 4 hub 2 RS232
1348c2ecf20Sopenharmony_ci#define ION_DEVICE_ID_TI_EDGEPORT_22I		0x021A	// Edgeport/22I is an Edgeport/4 with ports 1&2 RS422 and ports 3&4 RS232
1358c2ecf20Sopenharmony_ci#define ION_DEVICE_ID_TI_EDGEPORT_2C		0x021B	// Edgeport/2c RS232
1368c2ecf20Sopenharmony_ci#define ION_DEVICE_ID_TI_EDGEPORT_221C		0x021C	// Edgeport/221c is a TI based Edgeport/2 with lucent chip and
1378c2ecf20Sopenharmony_ci							// 2 external hub ports - Large I2C
1388c2ecf20Sopenharmony_ci#define ION_DEVICE_ID_TI_EDGEPORT_22C		0x021D	// Edgeport/22c is a TI based Edgeport/2 with
1398c2ecf20Sopenharmony_ci							// 2 external hub ports - Large I2C
1408c2ecf20Sopenharmony_ci#define ION_DEVICE_ID_TI_EDGEPORT_21C		0x021E	// Edgeport/21c is a TI based Edgeport/2 with lucent chip
1418c2ecf20Sopenharmony_ci
1428c2ecf20Sopenharmony_ci// Generation 3 devices -- 3410 based edgport/1 (256 byte I2C)
1438c2ecf20Sopenharmony_ci#define ION_DEVICE_ID_TI_TI3410_EDGEPORT_1	0x0240	// Edgeport/1 RS232
1448c2ecf20Sopenharmony_ci#define ION_DEVICE_ID_TI_TI3410_EDGEPORT_1I	0x0241	// Edgeport/1i- RS422 model
1458c2ecf20Sopenharmony_ci
1468c2ecf20Sopenharmony_ci// Ti based software switchable RS232/RS422/RS485 devices
1478c2ecf20Sopenharmony_ci#define ION_DEVICE_ID_TI_EDGEPORT_4S		0x0242	// Edgeport/4s - software switchable model
1488c2ecf20Sopenharmony_ci#define ION_DEVICE_ID_TI_EDGEPORT_8S		0x0243	// Edgeport/8s - software switchable model
1498c2ecf20Sopenharmony_ci#define ION_DEVICE_ID_TI_EDGEPORT_8		0x0244	// Edgeport/8 (single-CPU)
1508c2ecf20Sopenharmony_ci#define ION_DEVICE_ID_TI_EDGEPORT_416B		0x0247	// Edgeport/416
1518c2ecf20Sopenharmony_ci
1528c2ecf20Sopenharmony_ci
1538c2ecf20Sopenharmony_ci/************************************************************************
1548c2ecf20Sopenharmony_ci *
1558c2ecf20Sopenharmony_ci *                        Generation 4 devices
1568c2ecf20Sopenharmony_ci *
1578c2ecf20Sopenharmony_ci ************************************************************************/
1588c2ecf20Sopenharmony_ci
1598c2ecf20Sopenharmony_ci// Watchport based on 3410 both 1-wire and binary products (16K I2C)
1608c2ecf20Sopenharmony_ci#define ION_DEVICE_ID_WP_UNSERIALIZED		0x300	// Watchport based on 3410 both 1-wire and binary products
1618c2ecf20Sopenharmony_ci#define ION_DEVICE_ID_WP_PROXIMITY		0x301	// Watchport/P Discontinued
1628c2ecf20Sopenharmony_ci#define ION_DEVICE_ID_WP_MOTION			0x302	// Watchport/M
1638c2ecf20Sopenharmony_ci#define ION_DEVICE_ID_WP_MOISTURE		0x303	// Watchport/W
1648c2ecf20Sopenharmony_ci#define ION_DEVICE_ID_WP_TEMPERATURE		0x304	// Watchport/T
1658c2ecf20Sopenharmony_ci#define ION_DEVICE_ID_WP_HUMIDITY		0x305	// Watchport/H
1668c2ecf20Sopenharmony_ci
1678c2ecf20Sopenharmony_ci#define ION_DEVICE_ID_WP_POWER			0x306	// Watchport
1688c2ecf20Sopenharmony_ci#define ION_DEVICE_ID_WP_LIGHT			0x307	// Watchport
1698c2ecf20Sopenharmony_ci#define ION_DEVICE_ID_WP_RADIATION		0x308	// Watchport
1708c2ecf20Sopenharmony_ci#define ION_DEVICE_ID_WP_ACCELERATION		0x309	// Watchport/A
1718c2ecf20Sopenharmony_ci#define ION_DEVICE_ID_WP_DISTANCE		0x30A	// Watchport/D Discontinued
1728c2ecf20Sopenharmony_ci#define ION_DEVICE_ID_WP_PROX_DIST		0x30B	// Watchport/D uses distance sensor
1738c2ecf20Sopenharmony_ci							// Default to /P function
1748c2ecf20Sopenharmony_ci
1758c2ecf20Sopenharmony_ci#define ION_DEVICE_ID_PLUS_PWR_HP4CD		0x30C	// 5052 Plus Power HubPort/4CD+ (for Dell)
1768c2ecf20Sopenharmony_ci#define ION_DEVICE_ID_PLUS_PWR_HP4C		0x30D	// 5052 Plus Power HubPort/4C+
1778c2ecf20Sopenharmony_ci#define ION_DEVICE_ID_PLUS_PWR_PCI		0x30E	// 3410 Plus Power PCI Host Controller 4 port
1788c2ecf20Sopenharmony_ci
1798c2ecf20Sopenharmony_ci
1808c2ecf20Sopenharmony_ci//
1818c2ecf20Sopenharmony_ci// Definitions for AXIOHM USB product IDs
1828c2ecf20Sopenharmony_ci//
1838c2ecf20Sopenharmony_ci#define	USB_VENDOR_ID_AXIOHM			0x05D9	// Axiohm VID
1848c2ecf20Sopenharmony_ci
1858c2ecf20Sopenharmony_ci#define AXIOHM_DEVICE_ID_MASK			0xffff
1868c2ecf20Sopenharmony_ci#define AXIOHM_DEVICE_ID_EPIC_A758		0xA758
1878c2ecf20Sopenharmony_ci#define AXIOHM_DEVICE_ID_EPIC_A794		0xA794
1888c2ecf20Sopenharmony_ci#define AXIOHM_DEVICE_ID_EPIC_A225		0xA225
1898c2ecf20Sopenharmony_ci
1908c2ecf20Sopenharmony_ci
1918c2ecf20Sopenharmony_ci//
1928c2ecf20Sopenharmony_ci// Definitions for NCR USB product IDs
1938c2ecf20Sopenharmony_ci//
1948c2ecf20Sopenharmony_ci#define	USB_VENDOR_ID_NCR			0x0404	// NCR VID
1958c2ecf20Sopenharmony_ci
1968c2ecf20Sopenharmony_ci#define NCR_DEVICE_ID_MASK			0xffff
1978c2ecf20Sopenharmony_ci#define NCR_DEVICE_ID_EPIC_0202			0x0202
1988c2ecf20Sopenharmony_ci#define NCR_DEVICE_ID_EPIC_0203			0x0203
1998c2ecf20Sopenharmony_ci#define NCR_DEVICE_ID_EPIC_0310			0x0310
2008c2ecf20Sopenharmony_ci#define NCR_DEVICE_ID_EPIC_0311			0x0311
2018c2ecf20Sopenharmony_ci#define NCR_DEVICE_ID_EPIC_0312			0x0312
2028c2ecf20Sopenharmony_ci
2038c2ecf20Sopenharmony_ci
2048c2ecf20Sopenharmony_ci//
2058c2ecf20Sopenharmony_ci// Definitions for SYMBOL USB product IDs
2068c2ecf20Sopenharmony_ci//
2078c2ecf20Sopenharmony_ci#define USB_VENDOR_ID_SYMBOL			0x05E0	// Symbol VID
2088c2ecf20Sopenharmony_ci#define SYMBOL_DEVICE_ID_MASK			0xffff
2098c2ecf20Sopenharmony_ci#define SYMBOL_DEVICE_ID_KEYFOB			0x0700
2108c2ecf20Sopenharmony_ci
2118c2ecf20Sopenharmony_ci
2128c2ecf20Sopenharmony_ci//
2138c2ecf20Sopenharmony_ci// Definitions for other product IDs
2148c2ecf20Sopenharmony_ci#define ION_DEVICE_ID_MT4X56USB			0x1403	// OEM device
2158c2ecf20Sopenharmony_ci#define ION_DEVICE_ID_E5805A			0x1A01  // OEM device (rebranded Edgeport/4)
2168c2ecf20Sopenharmony_ci
2178c2ecf20Sopenharmony_ci
2188c2ecf20Sopenharmony_ci#define	GENERATION_ID_FROM_USB_PRODUCT_ID(ProductId)				\
2198c2ecf20Sopenharmony_ci			((__u16) ((ProductId >> 8) & (ION_GENERATION_MASK)))
2208c2ecf20Sopenharmony_ci
2218c2ecf20Sopenharmony_ci#define	MAKE_USB_PRODUCT_ID(OemId, DeviceId)					\
2228c2ecf20Sopenharmony_ci			((__u16) (((OemId) << 10) || (DeviceId)))
2238c2ecf20Sopenharmony_ci
2248c2ecf20Sopenharmony_ci#define	DEVICE_ID_FROM_USB_PRODUCT_ID(ProductId)				\
2258c2ecf20Sopenharmony_ci			((__u16) ((ProductId) & (EDGEPORT_DEVICE_ID_MASK)))
2268c2ecf20Sopenharmony_ci
2278c2ecf20Sopenharmony_ci#define	OEM_ID_FROM_USB_PRODUCT_ID(ProductId)					\
2288c2ecf20Sopenharmony_ci			((__u16) (((ProductId) >> 10) & 0x3F))
2298c2ecf20Sopenharmony_ci
2308c2ecf20Sopenharmony_ci//
2318c2ecf20Sopenharmony_ci// Definitions of parameters for download code. Note that these are
2328c2ecf20Sopenharmony_ci// specific to a given version of download code and must change if the
2338c2ecf20Sopenharmony_ci// corresponding download code changes.
2348c2ecf20Sopenharmony_ci//
2358c2ecf20Sopenharmony_ci
2368c2ecf20Sopenharmony_ci// TxCredits value below which driver won't bother sending (to prevent too many small writes).
2378c2ecf20Sopenharmony_ci// Send only if above 25%
2388c2ecf20Sopenharmony_ci#define EDGE_FW_GET_TX_CREDITS_SEND_THRESHOLD(InitialCredit, MaxPacketSize) (max(((InitialCredit) / 4), (MaxPacketSize)))
2398c2ecf20Sopenharmony_ci
2408c2ecf20Sopenharmony_ci#define	EDGE_FW_BULK_MAX_PACKET_SIZE		64	// Max Packet Size for Bulk In Endpoint (EP1)
2418c2ecf20Sopenharmony_ci#define EDGE_FW_BULK_READ_BUFFER_SIZE		1024	// Size to use for Bulk reads
2428c2ecf20Sopenharmony_ci
2438c2ecf20Sopenharmony_ci#define	EDGE_FW_INT_MAX_PACKET_SIZE		32	// Max Packet Size for Interrupt In Endpoint
2448c2ecf20Sopenharmony_ci							// Note that many units were shipped with MPS=16, we
2458c2ecf20Sopenharmony_ci							// force an upgrade to this value).
2468c2ecf20Sopenharmony_ci#define EDGE_FW_INT_INTERVAL			2	// 2ms polling on IntPipe
2478c2ecf20Sopenharmony_ci
2488c2ecf20Sopenharmony_ci
2498c2ecf20Sopenharmony_ci//
2508c2ecf20Sopenharmony_ci// Definitions of I/O Networks vendor-specific requests
2518c2ecf20Sopenharmony_ci// for default endpoint
2528c2ecf20Sopenharmony_ci//
2538c2ecf20Sopenharmony_ci//	bmRequestType = 01000000	Set vendor-specific, to device
2548c2ecf20Sopenharmony_ci//	bmRequestType = 11000000	Get vendor-specific, to device
2558c2ecf20Sopenharmony_ci//
2568c2ecf20Sopenharmony_ci// These are the definitions for the bRequest field for the
2578c2ecf20Sopenharmony_ci// above bmRequestTypes.
2588c2ecf20Sopenharmony_ci//
2598c2ecf20Sopenharmony_ci// For the read/write Edgeport memory commands, the parameters
2608c2ecf20Sopenharmony_ci// are as follows:
2618c2ecf20Sopenharmony_ci//		wValue = 16-bit address
2628c2ecf20Sopenharmony_ci//		wIndex = unused (though we could put segment 00: or FF: here)
2638c2ecf20Sopenharmony_ci//		wLength = # bytes to read/write (max 64)
2648c2ecf20Sopenharmony_ci//
2658c2ecf20Sopenharmony_ci
2668c2ecf20Sopenharmony_ci#define USB_REQUEST_ION_RESET_DEVICE	0	// Warm reboot Edgeport, retaining USB address
2678c2ecf20Sopenharmony_ci#define USB_REQUEST_ION_GET_EPIC_DESC	1	// Get Edgeport Compatibility Descriptor
2688c2ecf20Sopenharmony_ci// unused				2	// Unused, available
2698c2ecf20Sopenharmony_ci#define USB_REQUEST_ION_READ_RAM	3	// Read  EdgePort RAM at specified addr
2708c2ecf20Sopenharmony_ci#define USB_REQUEST_ION_WRITE_RAM	4	// Write EdgePort RAM at specified addr
2718c2ecf20Sopenharmony_ci#define USB_REQUEST_ION_READ_ROM	5	// Read  EdgePort ROM at specified addr
2728c2ecf20Sopenharmony_ci#define USB_REQUEST_ION_WRITE_ROM	6	// Write EdgePort ROM at specified addr
2738c2ecf20Sopenharmony_ci#define USB_REQUEST_ION_EXEC_DL_CODE	7	// Begin execution of RAM-based download
2748c2ecf20Sopenharmony_ci						// code by jumping to address in wIndex:wValue
2758c2ecf20Sopenharmony_ci//					8	// Unused, available
2768c2ecf20Sopenharmony_ci#define USB_REQUEST_ION_ENABLE_SUSPEND	9	// Enable/Disable suspend feature
2778c2ecf20Sopenharmony_ci						// (wValue != 0: Enable; wValue = 0: Disable)
2788c2ecf20Sopenharmony_ci
2798c2ecf20Sopenharmony_ci#define USB_REQUEST_ION_SEND_IOSP	10	// Send an IOSP command to the edgeport over the control pipe
2808c2ecf20Sopenharmony_ci#define USB_REQUEST_ION_RECV_IOSP	11	// Receive an IOSP command from the edgeport over the control pipe
2818c2ecf20Sopenharmony_ci
2828c2ecf20Sopenharmony_ci
2838c2ecf20Sopenharmony_ci#define USB_REQUEST_ION_DIS_INT_TIMER	0x80	// Sent to Axiohm to enable/ disable
2848c2ecf20Sopenharmony_ci						// interrupt token timer
2858c2ecf20Sopenharmony_ci						// wValue = 1, enable (default)
2868c2ecf20Sopenharmony_ci						// wValue = 0, disable
2878c2ecf20Sopenharmony_ci
2888c2ecf20Sopenharmony_ci//
2898c2ecf20Sopenharmony_ci// Define parameter values for our vendor-specific commands
2908c2ecf20Sopenharmony_ci//
2918c2ecf20Sopenharmony_ci
2928c2ecf20Sopenharmony_ci//
2938c2ecf20Sopenharmony_ci// Edgeport Compatibility Descriptor
2948c2ecf20Sopenharmony_ci//
2958c2ecf20Sopenharmony_ci// This descriptor is only returned by Edgeport-compatible devices
2968c2ecf20Sopenharmony_ci// supporting the EPiC spec. True ION devices do not return this
2978c2ecf20Sopenharmony_ci// descriptor, but instead return STALL on receipt of the
2988c2ecf20Sopenharmony_ci// GET_EPIC_DESC command. The driver interprets a STALL to mean that
2998c2ecf20Sopenharmony_ci// this is a "real" Edgeport.
3008c2ecf20Sopenharmony_ci//
3018c2ecf20Sopenharmony_ci
3028c2ecf20Sopenharmony_cistruct edge_compatibility_bits {
3038c2ecf20Sopenharmony_ci	// This __u32 defines which Vendor-specific commands/functionality
3048c2ecf20Sopenharmony_ci	// the device supports on the default EP0 pipe.
3058c2ecf20Sopenharmony_ci
3068c2ecf20Sopenharmony_ci	__u32	VendEnableSuspend	:  1;	// 0001 Set if device supports ION_ENABLE_SUSPEND
3078c2ecf20Sopenharmony_ci	__u32	VendUnused		: 31;	// Available for future expansion, must be 0
3088c2ecf20Sopenharmony_ci
3098c2ecf20Sopenharmony_ci	// This __u32 defines which IOSP commands are supported over the
3108c2ecf20Sopenharmony_ci	// bulk pipe EP1.
3118c2ecf20Sopenharmony_ci
3128c2ecf20Sopenharmony_ci											// xxxx Set if device supports:
3138c2ecf20Sopenharmony_ci	__u32	IOSPOpen		:  1;	// 0001	OPEN / OPEN_RSP (Currently must be 1)
3148c2ecf20Sopenharmony_ci	__u32	IOSPClose		:  1;	// 0002	CLOSE
3158c2ecf20Sopenharmony_ci	__u32	IOSPChase		:  1;	// 0004	CHASE / CHASE_RSP
3168c2ecf20Sopenharmony_ci	__u32	IOSPSetRxFlow		:  1;	// 0008	SET_RX_FLOW
3178c2ecf20Sopenharmony_ci	__u32	IOSPSetTxFlow		:  1;	// 0010	SET_TX_FLOW
3188c2ecf20Sopenharmony_ci	__u32	IOSPSetXChar		:  1;	// 0020	SET_XON_CHAR/SET_XOFF_CHAR
3198c2ecf20Sopenharmony_ci	__u32	IOSPRxCheck		:  1;	// 0040	RX_CHECK_REQ/RX_CHECK_RSP
3208c2ecf20Sopenharmony_ci	__u32	IOSPSetClrBreak		:  1;	// 0080	SET_BREAK/CLEAR_BREAK
3218c2ecf20Sopenharmony_ci	__u32	IOSPWriteMCR		:  1;	// 0100	MCR register writes (set/clr DTR/RTS)
3228c2ecf20Sopenharmony_ci	__u32	IOSPWriteLCR		:  1;	// 0200	LCR register writes (wordlen/stop/parity)
3238c2ecf20Sopenharmony_ci	__u32	IOSPSetBaudRate		:  1;	// 0400	setting Baud rate (writes to LCR.80h and DLL/DLM register)
3248c2ecf20Sopenharmony_ci	__u32	IOSPDisableIntPipe	:  1;	// 0800 Do not use the interrupt pipe for TxCredits or RxButesAvailable
3258c2ecf20Sopenharmony_ci	__u32	IOSPRxDataAvail		:  1;   // 1000 Return status of RX Fifo (Data available in Fifo)
3268c2ecf20Sopenharmony_ci	__u32	IOSPTxPurge		:  1;	// 2000 Purge TXBuffer and/or Fifo in Edgeport hardware
3278c2ecf20Sopenharmony_ci	__u32	IOSPUnused		: 18;	// Available for future expansion, must be 0
3288c2ecf20Sopenharmony_ci
3298c2ecf20Sopenharmony_ci	// This __u32 defines which 'general' features are supported
3308c2ecf20Sopenharmony_ci
3318c2ecf20Sopenharmony_ci	__u32	TrueEdgeport		:  1;	// 0001	Set if device is a 'real' Edgeport
3328c2ecf20Sopenharmony_ci											// (Used only by driver, NEVER set by an EPiC device)
3338c2ecf20Sopenharmony_ci	__u32	GenUnused		: 31;	// Available for future expansion, must be 0
3348c2ecf20Sopenharmony_ci};
3358c2ecf20Sopenharmony_ci
3368c2ecf20Sopenharmony_ci#define EDGE_COMPATIBILITY_MASK0	0x0001
3378c2ecf20Sopenharmony_ci#define EDGE_COMPATIBILITY_MASK1	0x3FFF
3388c2ecf20Sopenharmony_ci#define EDGE_COMPATIBILITY_MASK2	0x0001
3398c2ecf20Sopenharmony_ci
3408c2ecf20Sopenharmony_cistruct edge_compatibility_descriptor {
3418c2ecf20Sopenharmony_ci	__u8	Length;				// Descriptor Length (per USB spec)
3428c2ecf20Sopenharmony_ci	__u8	DescType;			// Descriptor Type (per USB spec, =DEVICE type)
3438c2ecf20Sopenharmony_ci	__u8	EpicVer;			// Version of EPiC spec supported
3448c2ecf20Sopenharmony_ci						// (Currently must be 1)
3458c2ecf20Sopenharmony_ci	__u8	NumPorts;			// Number of serial ports supported
3468c2ecf20Sopenharmony_ci	__u8	iDownloadFile;			// Index of string containing download code filename
3478c2ecf20Sopenharmony_ci						// 0=no download, FF=download compiled into driver.
3488c2ecf20Sopenharmony_ci	__u8	Unused[3];			// Available for future expansion, must be 0
3498c2ecf20Sopenharmony_ci						// (Currently must be 0).
3508c2ecf20Sopenharmony_ci	__u8	MajorVersion;			// Firmware version: xx.
3518c2ecf20Sopenharmony_ci	__u8	MinorVersion;			//  yy.
3528c2ecf20Sopenharmony_ci	__le16	BuildNumber;			//  zzzz (LE format)
3538c2ecf20Sopenharmony_ci
3548c2ecf20Sopenharmony_ci	// The following structure contains __u32s, with each bit
3558c2ecf20Sopenharmony_ci	// specifying whether the EPiC device supports the given
3568c2ecf20Sopenharmony_ci	// command or functionality.
3578c2ecf20Sopenharmony_ci	struct edge_compatibility_bits	Supports;
3588c2ecf20Sopenharmony_ci};
3598c2ecf20Sopenharmony_ci
3608c2ecf20Sopenharmony_ci// Values for iDownloadFile
3618c2ecf20Sopenharmony_ci#define	EDGE_DOWNLOAD_FILE_NONE		0	// No download requested
3628c2ecf20Sopenharmony_ci#define	EDGE_DOWNLOAD_FILE_INTERNAL	0xFF	// Download the file compiled into driver (930 version)
3638c2ecf20Sopenharmony_ci#define	EDGE_DOWNLOAD_FILE_I930		0xFF	// Download the file compiled into driver (930 version)
3648c2ecf20Sopenharmony_ci#define	EDGE_DOWNLOAD_FILE_80251	0xFE	// Download the file compiled into driver (80251 version)
3658c2ecf20Sopenharmony_ci
3668c2ecf20Sopenharmony_ci
3678c2ecf20Sopenharmony_ci
3688c2ecf20Sopenharmony_ci/*
3698c2ecf20Sopenharmony_ci *	Special addresses for READ/WRITE_RAM/ROM
3708c2ecf20Sopenharmony_ci */
3718c2ecf20Sopenharmony_ci
3728c2ecf20Sopenharmony_ci// Version 1 (original) format of DeviceParams
3738c2ecf20Sopenharmony_ci#define	EDGE_MANUF_DESC_ADDR_V1		0x00FF7F00
3748c2ecf20Sopenharmony_ci#define	EDGE_MANUF_DESC_LEN_V1		sizeof(EDGE_MANUF_DESCRIPTOR_V1)
3758c2ecf20Sopenharmony_ci
3768c2ecf20Sopenharmony_ci// Version 2 format of DeviceParams. This format is longer (3C0h)
3778c2ecf20Sopenharmony_ci// and starts lower in memory, at the uppermost 1K in ROM.
3788c2ecf20Sopenharmony_ci#define	EDGE_MANUF_DESC_ADDR		0x00FF7C00
3798c2ecf20Sopenharmony_ci#define	EDGE_MANUF_DESC_LEN		sizeof(struct edge_manuf_descriptor)
3808c2ecf20Sopenharmony_ci
3818c2ecf20Sopenharmony_ci// Boot params descriptor
3828c2ecf20Sopenharmony_ci#define	EDGE_BOOT_DESC_ADDR		0x00FF7FC0
3838c2ecf20Sopenharmony_ci#define	EDGE_BOOT_DESC_LEN		sizeof(struct edge_boot_descriptor)
3848c2ecf20Sopenharmony_ci
3858c2ecf20Sopenharmony_ci// Define the max block size that may be read or written
3868c2ecf20Sopenharmony_ci// in a read/write RAM/ROM command.
3878c2ecf20Sopenharmony_ci#define	MAX_SIZE_REQ_ION_READ_MEM	((__u16)64)
3888c2ecf20Sopenharmony_ci#define	MAX_SIZE_REQ_ION_WRITE_MEM	((__u16)64)
3898c2ecf20Sopenharmony_ci
3908c2ecf20Sopenharmony_ci
3918c2ecf20Sopenharmony_ci//
3928c2ecf20Sopenharmony_ci// Notes for the following two ION vendor-specific param descriptors:
3938c2ecf20Sopenharmony_ci//
3948c2ecf20Sopenharmony_ci//	1.	These have a standard USB descriptor header so they look like a
3958c2ecf20Sopenharmony_ci//		normal descriptor.
3968c2ecf20Sopenharmony_ci//	2.	Any strings in the structures are in USB-defined string
3978c2ecf20Sopenharmony_ci//		descriptor format, so that they may be separately retrieved,
3988c2ecf20Sopenharmony_ci//		if necessary, with a minimum of work on the 930. This also
3998c2ecf20Sopenharmony_ci//		requires them to be in UNICODE format, which, for English at
4008c2ecf20Sopenharmony_ci//		least, simply means extending each __u8 into a __u16.
4018c2ecf20Sopenharmony_ci//	3.	For all fields, 00 means 'uninitialized'.
4028c2ecf20Sopenharmony_ci//	4.	All unused areas should be set to 00 for future expansion.
4038c2ecf20Sopenharmony_ci//
4048c2ecf20Sopenharmony_ci
4058c2ecf20Sopenharmony_ci// This structure is ver 2 format. It contains ALL USB descriptors as
4068c2ecf20Sopenharmony_ci// well as the configuration parameters that were in the original V1
4078c2ecf20Sopenharmony_ci// structure. It is NOT modified when new boot code is downloaded; rather,
4088c2ecf20Sopenharmony_ci// these values are set or modified by manufacturing. It is located at
4098c2ecf20Sopenharmony_ci// xC00-xFBF (length 3C0h) in the ROM.
4108c2ecf20Sopenharmony_ci// This structure is a superset of the v1 structure and is arranged so
4118c2ecf20Sopenharmony_ci// that all of the v1 fields remain at the same address. We are just
4128c2ecf20Sopenharmony_ci// adding more room to the front of the structure to hold the descriptors.
4138c2ecf20Sopenharmony_ci//
4148c2ecf20Sopenharmony_ci// The actual contents of this structure are defined in a 930 assembly
4158c2ecf20Sopenharmony_ci// file, converted to a binary image, and then written by the serialization
4168c2ecf20Sopenharmony_ci// program. The C definition of this structure just defines a dummy
4178c2ecf20Sopenharmony_ci// area for general USB descriptors and the descriptor tables (the root
4188c2ecf20Sopenharmony_ci// descriptor starts at xC00). At the bottom of the structure are the
4198c2ecf20Sopenharmony_ci// fields inherited from the v1 structure.
4208c2ecf20Sopenharmony_ci
4218c2ecf20Sopenharmony_ci#define MAX_SERIALNUMBER_LEN	12
4228c2ecf20Sopenharmony_ci#define MAX_ASSEMBLYNUMBER_LEN	14
4238c2ecf20Sopenharmony_ci
4248c2ecf20Sopenharmony_cistruct edge_manuf_descriptor {
4258c2ecf20Sopenharmony_ci
4268c2ecf20Sopenharmony_ci	__u16	RootDescTable[0x10];			// C00 Root of descriptor tables (just a placeholder)
4278c2ecf20Sopenharmony_ci	__u8	DescriptorArea[0x2E0];			// C20 Descriptors go here, up to 2E0h (just a placeholder)
4288c2ecf20Sopenharmony_ci
4298c2ecf20Sopenharmony_ci							//     Start of v1-compatible section
4308c2ecf20Sopenharmony_ci	__u8	Length;					// F00 Desc length for what follows, per USB (= C0h )
4318c2ecf20Sopenharmony_ci	__u8	DescType;				// F01 Desc type, per USB (=DEVICE type)
4328c2ecf20Sopenharmony_ci	__u8	DescVer;				// F02 Desc version/format (currently 2)
4338c2ecf20Sopenharmony_ci	__u8	NumRootDescEntries;			// F03 # entries in RootDescTable
4348c2ecf20Sopenharmony_ci
4358c2ecf20Sopenharmony_ci	__u8	RomSize;				// F04 Size of ROM/E2PROM in K
4368c2ecf20Sopenharmony_ci	__u8	RamSize;				// F05 Size of external RAM in K
4378c2ecf20Sopenharmony_ci	__u8	CpuRev;					// F06 CPU revision level (chg only if s/w visible)
4388c2ecf20Sopenharmony_ci	__u8	BoardRev;				// F07 PCB revision level (chg only if s/w visible)
4398c2ecf20Sopenharmony_ci
4408c2ecf20Sopenharmony_ci	__u8	NumPorts;				// F08 Number of ports
4418c2ecf20Sopenharmony_ci	__u8	DescDate[3];				// F09 MM/DD/YY when descriptor template was compiler,
4428c2ecf20Sopenharmony_ci							//     so host can track changes to USB-only descriptors.
4438c2ecf20Sopenharmony_ci
4448c2ecf20Sopenharmony_ci	__u8	SerNumLength;				// F0C USB string descriptor len
4458c2ecf20Sopenharmony_ci	__u8	SerNumDescType;				// F0D USB descriptor type (=STRING type)
4468c2ecf20Sopenharmony_ci	__le16	SerialNumber[MAX_SERIALNUMBER_LEN];	// F0E "01-01-000100" Unicode Serial Number
4478c2ecf20Sopenharmony_ci
4488c2ecf20Sopenharmony_ci	__u8	AssemblyNumLength;			// F26 USB string descriptor len
4498c2ecf20Sopenharmony_ci	__u8	AssemblyNumDescType;			// F27 USB descriptor type (=STRING type)
4508c2ecf20Sopenharmony_ci	__le16	AssemblyNumber[MAX_ASSEMBLYNUMBER_LEN];	// F28 "350-1000-01-A " assembly number
4518c2ecf20Sopenharmony_ci
4528c2ecf20Sopenharmony_ci	__u8	OemAssyNumLength;			// F44 USB string descriptor len
4538c2ecf20Sopenharmony_ci	__u8	OemAssyNumDescType;			// F45 USB descriptor type (=STRING type)
4548c2ecf20Sopenharmony_ci	__le16	OemAssyNumber[MAX_ASSEMBLYNUMBER_LEN];	// F46 "xxxxxxxxxxxxxx" OEM assembly number
4558c2ecf20Sopenharmony_ci
4568c2ecf20Sopenharmony_ci	__u8	ManufDateLength;			// F62 USB string descriptor len
4578c2ecf20Sopenharmony_ci	__u8	ManufDateDescType;			// F63 USB descriptor type (=STRING type)
4588c2ecf20Sopenharmony_ci	__le16	ManufDate[6];				// F64 "MMDDYY" manufacturing date
4598c2ecf20Sopenharmony_ci
4608c2ecf20Sopenharmony_ci	__u8	Reserved3[0x4D];			// F70 -- unused, set to 0 --
4618c2ecf20Sopenharmony_ci
4628c2ecf20Sopenharmony_ci	__u8	UartType;				// FBD Uart Type
4638c2ecf20Sopenharmony_ci	__u8	IonPid;					// FBE Product ID, == LSB of USB DevDesc.PID
4648c2ecf20Sopenharmony_ci							//      (Note: Edgeport/4s before 11/98 will have
4658c2ecf20Sopenharmony_ci							//       00 here instead of 01)
4668c2ecf20Sopenharmony_ci	__u8	IonConfig;				// FBF Config byte for ION manufacturing use
4678c2ecf20Sopenharmony_ci							// FBF end of structure, total len = 3C0h
4688c2ecf20Sopenharmony_ci
4698c2ecf20Sopenharmony_ci};
4708c2ecf20Sopenharmony_ci
4718c2ecf20Sopenharmony_ci
4728c2ecf20Sopenharmony_ci#define MANUF_DESC_VER_1	1	// Original definition of MANUF_DESC
4738c2ecf20Sopenharmony_ci#define MANUF_DESC_VER_2	2	// Ver 2, starts at xC00h len 3C0h
4748c2ecf20Sopenharmony_ci
4758c2ecf20Sopenharmony_ci
4768c2ecf20Sopenharmony_ci// Uart Types
4778c2ecf20Sopenharmony_ci// Note: Since this field was added only recently, all Edgeport/4 units
4788c2ecf20Sopenharmony_ci// shipped before 11/98 will have 00 in this field. Therefore,
4798c2ecf20Sopenharmony_ci// both 00 and 01 values mean '654.
4808c2ecf20Sopenharmony_ci#define MANUF_UART_EXAR_654_EARLY	0	// Exar 16C654 in Edgeport/4s before 11/98
4818c2ecf20Sopenharmony_ci#define MANUF_UART_EXAR_654		1	// Exar 16C654
4828c2ecf20Sopenharmony_ci#define MANUF_UART_EXAR_2852		2	// Exar 16C2852
4838c2ecf20Sopenharmony_ci
4848c2ecf20Sopenharmony_ci//
4858c2ecf20Sopenharmony_ci// Note: The CpuRev and BoardRev values do not conform to manufacturing
4868c2ecf20Sopenharmony_ci// revisions; they are to be incremented only when the CPU or hardware
4878c2ecf20Sopenharmony_ci// changes in a software-visible way, such that the 930 software or
4888c2ecf20Sopenharmony_ci// the host driver needs to handle the hardware differently.
4898c2ecf20Sopenharmony_ci//
4908c2ecf20Sopenharmony_ci
4918c2ecf20Sopenharmony_ci// Values of bottom 5 bits of CpuRev & BoardRev for
4928c2ecf20Sopenharmony_ci// Implementation 0 (ie, 930-based)
4938c2ecf20Sopenharmony_ci#define	MANUF_CPU_REV_AD4		1	// 930 AD4, with EP1 Rx bug (needs RXSPM)
4948c2ecf20Sopenharmony_ci#define	MANUF_CPU_REV_AD5		2	// 930 AD5, with above bug (supposedly) fixed
4958c2ecf20Sopenharmony_ci#define	MANUF_CPU_80251			0x20	// Intel 80251
4968c2ecf20Sopenharmony_ci
4978c2ecf20Sopenharmony_ci
4988c2ecf20Sopenharmony_ci#define MANUF_BOARD_REV_A		1	// Original version, == Manuf Rev A
4998c2ecf20Sopenharmony_ci#define MANUF_BOARD_REV_B		2	// Manuf Rev B, wakeup interrupt works
5008c2ecf20Sopenharmony_ci#define MANUF_BOARD_REV_C		3	// Manuf Rev C, 2/4 ports, rs232/rs422
5018c2ecf20Sopenharmony_ci#define MANUF_BOARD_REV_GENERATION_2	0x20	// Second generaiton edgeport
5028c2ecf20Sopenharmony_ci
5038c2ecf20Sopenharmony_ci
5048c2ecf20Sopenharmony_ci// Values of bottom 5 bits of CpuRev & BoardRev for
5058c2ecf20Sopenharmony_ci// Implementation 1 (ie, 251+Netchip-based)
5068c2ecf20Sopenharmony_ci#define	MANUF_CPU_REV_1			1	// C251TB Rev 1 (Need actual Intel rev here)
5078c2ecf20Sopenharmony_ci
5088c2ecf20Sopenharmony_ci#define MANUF_BOARD_REV_A		1	// First rev of 251+Netchip design
5098c2ecf20Sopenharmony_ci
5108c2ecf20Sopenharmony_ci#define	MANUF_SERNUM_LENGTH		sizeof(((struct edge_manuf_descriptor *)0)->SerialNumber)
5118c2ecf20Sopenharmony_ci#define	MANUF_ASSYNUM_LENGTH		sizeof(((struct edge_manuf_descriptor *)0)->AssemblyNumber)
5128c2ecf20Sopenharmony_ci#define	MANUF_OEMASSYNUM_LENGTH		sizeof(((struct edge_manuf_descriptor *)0)->OemAssyNumber)
5138c2ecf20Sopenharmony_ci#define	MANUF_MANUFDATE_LENGTH		sizeof(((struct edge_manuf_descriptor *)0)->ManufDate)
5148c2ecf20Sopenharmony_ci
5158c2ecf20Sopenharmony_ci#define	MANUF_ION_CONFIG_DIAG_NO_LOOP	0x20	// As below but no ext loopback test
5168c2ecf20Sopenharmony_ci#define	MANUF_ION_CONFIG_DIAG		0x40	// 930 based device: 1=Run h/w diags, 0=norm
5178c2ecf20Sopenharmony_ci						// TIUMP Device    : 1=IONSERIAL needs to run Final Test
5188c2ecf20Sopenharmony_ci#define	MANUF_ION_CONFIG_MASTER		0x80	// 930 based device:  1=Master mode, 0=Normal
5198c2ecf20Sopenharmony_ci						// TIUMP Device    :  1=First device on a multi TIUMP Device
5208c2ecf20Sopenharmony_ci
5218c2ecf20Sopenharmony_ci//
5228c2ecf20Sopenharmony_ci// This structure describes parameters for the boot code, and
5238c2ecf20Sopenharmony_ci// is programmed along with new boot code. These are values
5248c2ecf20Sopenharmony_ci// which are specific to a given build of the boot code. It
5258c2ecf20Sopenharmony_ci// is exactly 64 bytes long and is fixed at address FF:xFC0
5268c2ecf20Sopenharmony_ci// - FF:xFFF. Note that the 930-mandated UCONFIG bytes are
5278c2ecf20Sopenharmony_ci// included in this structure.
5288c2ecf20Sopenharmony_ci//
5298c2ecf20Sopenharmony_cistruct edge_boot_descriptor {
5308c2ecf20Sopenharmony_ci	__u8		Length;			// C0 Desc length, per USB (= 40h)
5318c2ecf20Sopenharmony_ci	__u8		DescType;		// C1 Desc type, per USB (= DEVICE type)
5328c2ecf20Sopenharmony_ci	__u8		DescVer;		// C2 Desc version/format
5338c2ecf20Sopenharmony_ci	__u8		Reserved1;		// C3 -- unused, set to 0 --
5348c2ecf20Sopenharmony_ci
5358c2ecf20Sopenharmony_ci	__le16		BootCodeLength;		// C4 Boot code goes from FF:0000 to FF:(len-1)
5368c2ecf20Sopenharmony_ci						//	  (LE format)
5378c2ecf20Sopenharmony_ci
5388c2ecf20Sopenharmony_ci	__u8		MajorVersion;		// C6 Firmware version: xx.
5398c2ecf20Sopenharmony_ci	__u8		MinorVersion;		// C7			yy.
5408c2ecf20Sopenharmony_ci	__le16		BuildNumber;		// C8			zzzz (LE format)
5418c2ecf20Sopenharmony_ci
5428c2ecf20Sopenharmony_ci	__u16		EnumRootDescTable;	// CA Root of ROM-based descriptor table
5438c2ecf20Sopenharmony_ci	__u8		NumDescTypes;		// CC Number of supported descriptor types
5448c2ecf20Sopenharmony_ci
5458c2ecf20Sopenharmony_ci	__u8		Reserved4;		// CD Fix Compiler Packing
5468c2ecf20Sopenharmony_ci
5478c2ecf20Sopenharmony_ci	__le16		Capabilities;		// CE-CF Capabilities flags (LE format)
5488c2ecf20Sopenharmony_ci	__u8		Reserved2[0x28];	// D0 -- unused, set to 0 --
5498c2ecf20Sopenharmony_ci	__u8		UConfig0;		// F8 930-defined CPU configuration byte 0
5508c2ecf20Sopenharmony_ci	__u8		UConfig1;		// F9 930-defined CPU configuration byte 1
5518c2ecf20Sopenharmony_ci	__u8		Reserved3[6];		// FA -- unused, set to 0 --
5528c2ecf20Sopenharmony_ci						// FF end of structure, total len = 80
5538c2ecf20Sopenharmony_ci};
5548c2ecf20Sopenharmony_ci
5558c2ecf20Sopenharmony_ci
5568c2ecf20Sopenharmony_ci#define BOOT_DESC_VER_1		1	// Original definition of BOOT_PARAMS
5578c2ecf20Sopenharmony_ci#define BOOT_DESC_VER_2		2	// 2nd definition, descriptors not included in boot
5588c2ecf20Sopenharmony_ci
5598c2ecf20Sopenharmony_ci
5608c2ecf20Sopenharmony_ci	// Capabilities flags
5618c2ecf20Sopenharmony_ci
5628c2ecf20Sopenharmony_ci#define	BOOT_CAP_RESET_CMD	0x0001	// If set, boot correctly supports ION_RESET_DEVICE
5638c2ecf20Sopenharmony_ci
5648c2ecf20Sopenharmony_ci
5658c2ecf20Sopenharmony_ci/************************************************************************
5668c2ecf20Sopenharmony_ci                 T I   U M P   D E F I N I T I O N S
5678c2ecf20Sopenharmony_ci ***********************************************************************/
5688c2ecf20Sopenharmony_ci
5698c2ecf20Sopenharmony_ci// Chip definitions in I2C
5708c2ecf20Sopenharmony_ci#define UMP5152			0x52
5718c2ecf20Sopenharmony_ci#define UMP3410			0x10
5728c2ecf20Sopenharmony_ci
5738c2ecf20Sopenharmony_ci
5748c2ecf20Sopenharmony_ci//************************************************************************
5758c2ecf20Sopenharmony_ci//	TI I2C Format Definitions
5768c2ecf20Sopenharmony_ci//************************************************************************
5778c2ecf20Sopenharmony_ci#define I2C_DESC_TYPE_INFO_BASIC	0x01
5788c2ecf20Sopenharmony_ci#define I2C_DESC_TYPE_FIRMWARE_BASIC	0x02
5798c2ecf20Sopenharmony_ci#define I2C_DESC_TYPE_DEVICE		0x03
5808c2ecf20Sopenharmony_ci#define I2C_DESC_TYPE_CONFIG		0x04
5818c2ecf20Sopenharmony_ci#define I2C_DESC_TYPE_STRING		0x05
5828c2ecf20Sopenharmony_ci#define I2C_DESC_TYPE_FIRMWARE_AUTO	0x07	// for 3410 download
5838c2ecf20Sopenharmony_ci#define I2C_DESC_TYPE_CONFIG_KLUDGE	0x14	// for 3410
5848c2ecf20Sopenharmony_ci#define I2C_DESC_TYPE_WATCHPORT_VERSION	0x15	// firmware version number for watchport
5858c2ecf20Sopenharmony_ci#define I2C_DESC_TYPE_WATCHPORT_CALIBRATION_DATA 0x16	// Watchport Calibration Data
5868c2ecf20Sopenharmony_ci
5878c2ecf20Sopenharmony_ci#define I2C_DESC_TYPE_FIRMWARE_BLANK	0xf2
5888c2ecf20Sopenharmony_ci
5898c2ecf20Sopenharmony_ci// Special section defined by ION
5908c2ecf20Sopenharmony_ci#define I2C_DESC_TYPE_ION		0	// Not defined by TI
5918c2ecf20Sopenharmony_ci
5928c2ecf20Sopenharmony_ci
5938c2ecf20Sopenharmony_cistruct ti_i2c_desc {
5948c2ecf20Sopenharmony_ci	__u8	Type;			// Type of descriptor
5958c2ecf20Sopenharmony_ci	__le16	Size;			// Size of data only not including header
5968c2ecf20Sopenharmony_ci	__u8	CheckSum;		// Checksum (8 bit sum of data only)
5978c2ecf20Sopenharmony_ci	__u8	Data[];		// Data starts here
5988c2ecf20Sopenharmony_ci} __attribute__((packed));
5998c2ecf20Sopenharmony_ci
6008c2ecf20Sopenharmony_ci// for 5152 devices only (type 2 record)
6018c2ecf20Sopenharmony_ci// for 3410 the version is stored in the WATCHPORT_FIRMWARE_VERSION descriptor
6028c2ecf20Sopenharmony_cistruct ti_i2c_firmware_rec {
6038c2ecf20Sopenharmony_ci	__u8	Ver_Major;		// Firmware Major version number
6048c2ecf20Sopenharmony_ci	__u8	Ver_Minor;		// Firmware Minor version number
6058c2ecf20Sopenharmony_ci	__u8	Data[];		// Download starts here
6068c2ecf20Sopenharmony_ci} __attribute__((packed));
6078c2ecf20Sopenharmony_ci
6088c2ecf20Sopenharmony_ci
6098c2ecf20Sopenharmony_cistruct watchport_firmware_version {
6108c2ecf20Sopenharmony_ci// Added 2 bytes for version number
6118c2ecf20Sopenharmony_ci	__u8	Version_Major;		//  Download Version (for Watchport)
6128c2ecf20Sopenharmony_ci	__u8	Version_Minor;
6138c2ecf20Sopenharmony_ci} __attribute__((packed));
6148c2ecf20Sopenharmony_ci
6158c2ecf20Sopenharmony_ci
6168c2ecf20Sopenharmony_ci// Structure of header of download image in fw_down.h
6178c2ecf20Sopenharmony_cistruct ti_i2c_image_header {
6188c2ecf20Sopenharmony_ci	__le16	Length;
6198c2ecf20Sopenharmony_ci	__u8	CheckSum;
6208c2ecf20Sopenharmony_ci} __attribute__((packed));
6218c2ecf20Sopenharmony_ci
6228c2ecf20Sopenharmony_cistruct ti_basic_descriptor {
6238c2ecf20Sopenharmony_ci	__u8	Power;		// Self powered
6248c2ecf20Sopenharmony_ci				// bit 7: 1 - power switching supported
6258c2ecf20Sopenharmony_ci				//        0 - power switching not supported
6268c2ecf20Sopenharmony_ci				//
6278c2ecf20Sopenharmony_ci				// bit 0: 1 - self powered
6288c2ecf20Sopenharmony_ci				//        0 - bus powered
6298c2ecf20Sopenharmony_ci				//
6308c2ecf20Sopenharmony_ci				//
6318c2ecf20Sopenharmony_ci	__u16	HubVid;		// VID HUB
6328c2ecf20Sopenharmony_ci	__u16	HubPid;		// PID HUB
6338c2ecf20Sopenharmony_ci	__u16	DevPid;		// PID Edgeport
6348c2ecf20Sopenharmony_ci	__u8	HubTime;	// Time for power on to power good
6358c2ecf20Sopenharmony_ci	__u8	HubCurrent;	// HUB Current = 100ma
6368c2ecf20Sopenharmony_ci} __attribute__((packed));
6378c2ecf20Sopenharmony_ci
6388c2ecf20Sopenharmony_ci
6398c2ecf20Sopenharmony_ci// CPU / Board Rev Definitions
6408c2ecf20Sopenharmony_ci#define TI_CPU_REV_5052			2	// 5052 based edgeports
6418c2ecf20Sopenharmony_ci#define TI_CPU_REV_3410			3	// 3410 based edgeports
6428c2ecf20Sopenharmony_ci
6438c2ecf20Sopenharmony_ci#define TI_BOARD_REV_TI_EP		0	// Basic ti based edgeport
6448c2ecf20Sopenharmony_ci#define TI_BOARD_REV_COMPACT		1	// Compact board
6458c2ecf20Sopenharmony_ci#define TI_BOARD_REV_WATCHPORT		2	// Watchport
6468c2ecf20Sopenharmony_ci
6478c2ecf20Sopenharmony_ci
6488c2ecf20Sopenharmony_ci#define TI_GET_CPU_REVISION(x)		(__u8)((((x)>>4)&0x0f))
6498c2ecf20Sopenharmony_ci#define TI_GET_BOARD_REVISION(x)	(__u8)(((x)&0x0f))
6508c2ecf20Sopenharmony_ci
6518c2ecf20Sopenharmony_ci#define TI_I2C_SIZE_MASK		0x1f  // 5 bits
6528c2ecf20Sopenharmony_ci#define TI_GET_I2C_SIZE(x)		((((x) & TI_I2C_SIZE_MASK)+1)*256)
6538c2ecf20Sopenharmony_ci
6548c2ecf20Sopenharmony_ci#define TI_MAX_I2C_SIZE			(16 * 1024)
6558c2ecf20Sopenharmony_ci
6568c2ecf20Sopenharmony_ci#define TI_MANUF_VERSION_0		0
6578c2ecf20Sopenharmony_ci
6588c2ecf20Sopenharmony_ci// IonConig2 flags
6598c2ecf20Sopenharmony_ci#define TI_CONFIG2_RS232		0x01
6608c2ecf20Sopenharmony_ci#define TI_CONFIG2_RS422		0x02
6618c2ecf20Sopenharmony_ci#define TI_CONFIG2_RS485		0x04
6628c2ecf20Sopenharmony_ci#define TI_CONFIG2_SWITCHABLE		0x08
6638c2ecf20Sopenharmony_ci
6648c2ecf20Sopenharmony_ci#define TI_CONFIG2_WATCHPORT		0x10
6658c2ecf20Sopenharmony_ci
6668c2ecf20Sopenharmony_ci
6678c2ecf20Sopenharmony_cistruct edge_ti_manuf_descriptor {
6688c2ecf20Sopenharmony_ci	__u8 IonConfig;		//  Config byte for ION manufacturing use
6698c2ecf20Sopenharmony_ci	__u8 IonConfig2;	//  Expansion
6708c2ecf20Sopenharmony_ci	__u8 Version;		//  Version
6718c2ecf20Sopenharmony_ci	__u8 CpuRev_BoardRev;	//  CPU revision level (0xF0) and Board Rev Level (0x0F)
6728c2ecf20Sopenharmony_ci	__u8 NumPorts;		//  Number of ports	for this UMP
6738c2ecf20Sopenharmony_ci	__u8 NumVirtualPorts;	//  Number of Virtual ports
6748c2ecf20Sopenharmony_ci	__u8 HubConfig1;	//  Used to configure the Hub
6758c2ecf20Sopenharmony_ci	__u8 HubConfig2;	//  Used to configure the Hub
6768c2ecf20Sopenharmony_ci	__u8 TotalPorts;	//  Total Number of Com Ports for the entire device (All UMPs)
6778c2ecf20Sopenharmony_ci	__u8 Reserved;		//  Reserved
6788c2ecf20Sopenharmony_ci} __attribute__((packed));
6798c2ecf20Sopenharmony_ci
6808c2ecf20Sopenharmony_ci
6818c2ecf20Sopenharmony_ci#endif		// if !defined(_USBVEND_H)
682