blob: 05b3c01e5fc1ad9d5b2e08f9d6bf3fec08568843 [file] [log] [blame]
Tom Rini10e47792018-05-06 17:58:06 -04001/* SPDX-License-Identifier: GPL-2.0+ */
wdenk29e7f5a2004-03-12 00:14:09 +00002/*
3 * (C) Copyright 2003
4 * Gerry Hamel, geh@ti.com, Texas Instruments
5 *
Wolfgang Denk3f0137b2006-06-14 17:45:53 +02006 * (C) Copyright 2006
7 * Bryan O'Donoghue, bodonoghue@codehermit.ie, CodeHermit
wdenk29e7f5a2004-03-12 00:14:09 +00008 */
9
10#ifndef __USB_TTY_H__
11#define __USB_TTY_H__
12
Jean-Christophe PLAGNIOL-VILLARD8f6bcf42009-04-03 12:46:58 +020013#include <usbdevice.h>
Wolfgang Denk3f0137b2006-06-14 17:45:53 +020014#if defined(CONFIG_PPC)
Jean-Christophe PLAGNIOL-VILLARD8f6bcf42009-04-03 12:46:58 +020015#include <usb/mpc8xx_udc.h>
Marek Vasut85cc88a2011-11-26 07:20:07 +010016#elif defined(CONFIG_CPU_PXA27X)
Remy Bohmera954f1a2009-04-05 11:43:28 +020017#include <usb/pxa27x_udc.h>
Vipin KUMAR33cf5bd2012-03-06 23:39:37 +000018#elif defined(CONFIG_DW_UDC)
19#include <usb/designware_udc.h>
Marek Vasut9ba89972014-02-06 02:43:45 +010020#elif defined(CONFIG_CI_UDC)
21#include <usb/ci_udc.h>
Wolfgang Denk3f0137b2006-06-14 17:45:53 +020022#endif
wdenk29e7f5a2004-03-12 00:14:09 +000023
Troy Kiskydf446f52013-10-10 15:28:04 -070024#include <usb/udc.h>
Simon Glass50402412011-10-10 08:55:19 +000025#include <version.h>
wdenk29e7f5a2004-03-12 00:14:09 +000026
Wolfgang Denke2601822006-06-14 18:14:56 +020027/* If no VendorID/ProductID is defined in config.h, pretend to be Linux
Wolfgang Denk3f0137b2006-06-14 17:45:53 +020028 * DO NOT Reuse this Vendor/Product setup with protocol incompatible devices */
wdenk29e7f5a2004-03-12 00:14:09 +000029
Jean-Christophe PLAGNIOL-VILLARD6dfaee72008-12-07 09:45:35 +010030#ifndef CONFIG_USBD_VENDORID
31#define CONFIG_USBD_VENDORID 0x0525 /* Linux/NetChip */
32#endif
33#ifndef CONFIG_USBD_PRODUCTID_GSERIAL
34#define CONFIG_USBD_PRODUCTID_GSERIAL 0xa4a6 /* gserial */
35#endif
36#ifndef CONFIG_USBD_PRODUCTID_CDCACM
37#define CONFIG_USBD_PRODUCTID_CDCACM 0xa4a7 /* CDC ACM */
38#endif
39#ifndef CONFIG_USBD_MANUFACTURER
40#define CONFIG_USBD_MANUFACTURER "Das U-Boot"
41#endif
42#ifndef CONFIG_USBD_PRODUCT_NAME
43#define CONFIG_USBD_PRODUCT_NAME U_BOOT_VERSION
44#endif
wdenk29e7f5a2004-03-12 00:14:09 +000045
Jean-Christophe PLAGNIOL-VILLARD6dfaee72008-12-07 09:45:35 +010046#ifndef CONFIG_USBD_CONFIGURATION_STR
47#define CONFIG_USBD_CONFIGURATION_STR "TTY via USB"
48#endif
wdenk29e7f5a2004-03-12 00:14:09 +000049
Wolfgang Denke2601822006-06-14 18:14:56 +020050#define CONFIG_USBD_SERIAL_OUT_ENDPOINT UDC_OUT_ENDPOINT
Wolfgang Denk3f0137b2006-06-14 17:45:53 +020051#define CONFIG_USBD_SERIAL_OUT_PKTSIZE UDC_OUT_PACKET_SIZE
52#define CONFIG_USBD_SERIAL_IN_ENDPOINT UDC_IN_ENDPOINT
53#define CONFIG_USBD_SERIAL_IN_PKTSIZE UDC_IN_PACKET_SIZE
54#define CONFIG_USBD_SERIAL_INT_ENDPOINT UDC_INT_ENDPOINT
55#define CONFIG_USBD_SERIAL_INT_PKTSIZE UDC_INT_PACKET_SIZE
56#define CONFIG_USBD_SERIAL_BULK_PKTSIZE UDC_BULK_PACKET_SIZE
wdenk29e7f5a2004-03-12 00:14:09 +000057
Vipin KUMARbdb17702012-03-26 15:38:06 +053058#if defined(CONFIG_USBD_HS)
59#define CONFIG_USBD_SERIAL_BULK_HS_PKTSIZE UDC_BULK_HS_PACKET_SIZE
60#endif
61
wdenk29e7f5a2004-03-12 00:14:09 +000062#define USBTTY_DEVICE_CLASS COMMUNICATIONS_DEVICE_CLASS
wdenk29e7f5a2004-03-12 00:14:09 +000063
Wolfgang Denka1be4762008-05-20 16:00:29 +020064#define USBTTY_BCD_DEVICE 0x00
65#define USBTTY_MAXPOWER 0x00
wdenk29e7f5a2004-03-12 00:14:09 +000066
Wolfgang Denk3f0137b2006-06-14 17:45:53 +020067#define STR_LANG 0x00
68#define STR_MANUFACTURER 0x01
69#define STR_PRODUCT 0x02
70#define STR_SERIAL 0x03
71#define STR_CONFIG 0x04
72#define STR_DATA_INTERFACE 0x05
73#define STR_CTRL_INTERFACE 0x06
74#define STR_COUNT 0x07
wdenk29e7f5a2004-03-12 00:14:09 +000075
76#endif