~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/arch/mips/bcm63xx/dev-usb-usbd.c

Version: ~ [ linux-6.11.5 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.58 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.114 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.169 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.228 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.284 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.322 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /*
  2  * This file is subject to the terms and conditions of the GNU General Public
  3  * License.  See the file "COPYING" in the main directory of this archive
  4  * for more details.
  5  *
  6  * Copyright (C) 2008 Maxime Bizon <mbizon@freebox.fr>
  7  * Copyright (C) 2012 Kevin Cernekee <cernekee@gmail.com>
  8  * Copyright (C) 2012 Broadcom Corporation
  9  */
 10 
 11 #include <linux/init.h>
 12 #include <linux/kernel.h>
 13 #include <linux/platform_device.h>
 14 #include <linux/dma-mapping.h>
 15 #include <bcm63xx_cpu.h>
 16 #include <bcm63xx_dev_usb_usbd.h>
 17 
 18 #define NUM_MMIO                2
 19 #define NUM_IRQ                 7
 20 
 21 static struct resource usbd_resources[NUM_MMIO + NUM_IRQ];
 22 
 23 static u64 usbd_dmamask = DMA_BIT_MASK(32);
 24 
 25 static struct platform_device bcm63xx_usbd_device = {
 26         .name           = "bcm63xx_udc",
 27         .id             = -1,
 28         .num_resources  = ARRAY_SIZE(usbd_resources),
 29         .resource       = usbd_resources,
 30         .dev            = {
 31                 .dma_mask               = &usbd_dmamask,
 32                 .coherent_dma_mask      = DMA_BIT_MASK(32),
 33         },
 34 };
 35 
 36 int __init bcm63xx_usbd_register(const struct bcm63xx_usbd_platform_data *pd)
 37 {
 38         const int irq_list[NUM_IRQ] = { IRQ_USBD,
 39                 IRQ_USBD_RXDMA0, IRQ_USBD_TXDMA0,
 40                 IRQ_USBD_RXDMA1, IRQ_USBD_TXDMA1,
 41                 IRQ_USBD_RXDMA2, IRQ_USBD_TXDMA2 };
 42         int i;
 43 
 44         if (!BCMCPU_IS_6328() && !BCMCPU_IS_6368())
 45                 return 0;
 46 
 47         usbd_resources[0].start = bcm63xx_regset_address(RSET_USBD);
 48         usbd_resources[0].end = usbd_resources[0].start + RSET_USBD_SIZE - 1;
 49         usbd_resources[0].flags = IORESOURCE_MEM;
 50 
 51         usbd_resources[1].start = bcm63xx_regset_address(RSET_USBDMA);
 52         usbd_resources[1].end = usbd_resources[1].start + RSET_USBDMA_SIZE - 1;
 53         usbd_resources[1].flags = IORESOURCE_MEM;
 54 
 55         for (i = 0; i < NUM_IRQ; i++) {
 56                 struct resource *r = &usbd_resources[NUM_MMIO + i];
 57 
 58                 r->start = r->end = bcm63xx_get_irq_number(irq_list[i]);
 59                 r->flags = IORESOURCE_IRQ;
 60         }
 61 
 62         platform_device_add_data(&bcm63xx_usbd_device, pd, sizeof(*pd));
 63 
 64         return platform_device_register(&bcm63xx_usbd_device);
 65 }
 66 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php