uboot/arch/arm/mach-at91/include/mach/atmel_usba_udc.h
<<
>>
Prefs
   1/*
   2 * Copyright (C) 2005-2013 Atmel Corporation
   3 *                         Bo Shen <voice.shen@atmel.com>
   4 *
   5 * SPDX-License-Identifier:     GPL-2.0+
   6 */
   7
   8#ifndef __ATMEL_USBA_UDC_H__
   9#define __ATMEL_USBA_UDC_H__
  10
  11#include <linux/usb/atmel_usba_udc.h>
  12
  13#define EP(nam, idx, maxpkt, maxbk, dma, isoc)          \
  14        [idx] = {                                       \
  15                .name   = nam,                          \
  16                .index  = idx,                          \
  17                .fifo_size      = maxpkt,               \
  18                .nr_banks       = maxbk,                \
  19                .can_dma        = dma,                  \
  20                .can_isoc       = isoc,                 \
  21        }
  22
  23#if defined(CONFIG_AT91SAM9G45) || defined(CONFIG_AT91SAM9M10G45) || \
  24        defined(CONFIG_AT91SAM9X5)
  25static struct usba_ep_data usba_udc_ep[] = {
  26        EP("ep0", 0, 64, 1, 0, 0),
  27        EP("ep1", 1, 1024, 2, 1, 1),
  28        EP("ep2", 2, 1024, 2, 1, 1),
  29        EP("ep3", 3, 1024, 3, 1, 0),
  30        EP("ep4", 4, 1024, 3, 1, 0),
  31        EP("ep5", 5, 1024, 3, 1, 1),
  32        EP("ep6", 6, 1024, 3, 1, 1),
  33};
  34#elif defined(CONFIG_SAMA5D2) || defined(CONFIG_SAMA5D3) || \
  35        defined(CONFIG_SAMA5D4)
  36static struct usba_ep_data usba_udc_ep[] = {
  37        EP("ep0", 0, 64, 1, 0, 0),
  38        EP("ep1", 1, 1024, 3, 1, 0),
  39        EP("ep2", 2, 1024, 3, 1, 0),
  40        EP("ep3", 3, 1024, 2, 1, 0),
  41        EP("ep4", 4, 1024, 2, 1, 0),
  42        EP("ep5", 5, 1024, 2, 1, 0),
  43        EP("ep6", 6, 1024, 2, 1, 0),
  44        EP("ep7", 7, 1024, 2, 1, 0),
  45        EP("ep8", 8, 1024, 2, 0, 0),
  46        EP("ep9", 9, 1024, 2, 0, 0),
  47        EP("ep10", 10, 1024, 2, 0, 0),
  48        EP("ep11", 11, 1024, 2, 0, 0),
  49        EP("ep12", 12, 1024, 2, 0, 0),
  50        EP("ep13", 13, 1024, 2, 0, 0),
  51        EP("ep14", 14, 1024, 2, 0, 0),
  52        EP("ep15", 15, 1024, 2, 0, 0),
  53};
  54#else
  55# error "NO usba_udc_ep defined"
  56#endif
  57
  58#undef EP
  59
  60struct usba_platform_data pdata = {
  61        .num_ep = ARRAY_SIZE(usba_udc_ep),
  62        .ep     = usba_udc_ep,
  63};
  64
  65#endif
  66