source: trunk/target/linux/brcm63xx/patches-3.3/401-MIPS-BCM63XX-register-ohci-device.patch @ 31550

Last change on this file since 31550 was 31550, checked in by florian, 5 years ago

[brcm63xx] use a define for the poll and debounce interval

File size: 4.0 KB
  • arch/mips/bcm63xx/Kconfig

    From ab96f20ca1c3c8e7e5acd82d1e50823a5d572675 Mon Sep 17 00:00:00 2001
    From: Maxime Bizon <mbizon@freebox.fr>
    Date: Tue, 24 May 2011 21:47:41 +0200
    Subject: [PATCH 24/63] MIPS: BCM63XX: register ohci device.
    
    ---
     arch/mips/bcm63xx/Kconfig                          |    9 ++--
     arch/mips/bcm63xx/Makefile                         |    2 +-
     arch/mips/bcm63xx/boards/board_bcm963xx.c          |    4 ++
     arch/mips/bcm63xx/dev-usb-ohci.c                   |   50 ++++++++++++++++++++
     .../asm/mach-bcm63xx/bcm63xx_dev_usb_ohci.h        |    6 ++
     5 files changed, 65 insertions(+), 6 deletions(-)
     create mode 100644 arch/mips/bcm63xx/dev-usb-ohci.c
     create mode 100644 arch/mips/include/asm/mach-bcm63xx/bcm63xx_dev_usb_ohci.h
    
    a b menu "CPU support" 
    44config BCM63XX_CPU_6338 
    55        bool "support 6338 CPU" 
    66        select HW_HAS_PCI 
    7         select USB_ARCH_HAS_OHCI 
    8         select USB_OHCI_BIG_ENDIAN_DESC 
    9         select USB_OHCI_BIG_ENDIAN_MMIO 
     7        select USB_ARCH_HAS_OHCI if USB_SUPPORT 
    108 
    119config BCM63XX_CPU_6345 
    1210        bool "support 6345 CPU" 
    13         select USB_OHCI_BIG_ENDIAN_DESC 
    14         select USB_OHCI_BIG_ENDIAN_MMIO 
    1511 
    1612config BCM63XX_CPU_6348 
    1713        bool "support 6348 CPU" 
    1814        select HW_HAS_PCI 
     15        select USB_ARCH_HAS_OHCI if USB_SUPPORT 
    1916 
    2017config BCM63XX_CPU_6358 
    2118        bool "support 6358 CPU" 
    2219        select HW_HAS_PCI 
     20        select USB_ARCH_HAS_OHCI if USB_SUPPORT 
    2321 
    2422config BCM63XX_CPU_6368 
    2523        bool "support 6368 CPU" 
    2624        select HW_HAS_PCI 
     25        select USB_ARCH_HAS_OHCI if USB_SUPPORT 
    2726endmenu 
    2827 
    2928source "arch/mips/bcm63xx/boards/Kconfig" 
  • arch/mips/bcm63xx/Makefile

    a b  
    11obj-y           += clk.o cpu.o cs.o gpio.o irq.o prom.o setup.o timer.o \ 
    22                   dev-dsp.o dev-enet.o dev-pcmcia.o dev-spi.o dev-trng.o \ 
    3                    dev-uart.o dev-wdt.o 
     3                   dev-uart.o dev-usb-ohci.o dev-wdt.o 
    44obj-$(CONFIG_EARLY_PRINTK)      += early_printk.o 
    55 
    66obj-y           += boards/ 
  • arch/mips/bcm63xx/boards/board_bcm963xx.c

    a b  
    2828#include <bcm63xx_dev_dsp.h> 
    2929#include <bcm63xx_dev_pcmcia.h> 
    3030#include <bcm63xx_dev_spi.h> 
     31#include <bcm63xx_dev_usb_ohci.h> 
    3132#include <board_bcm963xx.h> 
    3233#include <bcm_tag.h> 
    3334 
    int __init board_register_devices(void) 
    944945            !board_get_mac_address(board.enet1.mac_addr)) 
    945946                bcm63xx_enet_register(1, &board.enet1); 
    946947 
     948        if (board.has_ohci0) 
     949                bcm63xx_ohci_register(); 
     950 
    947951        if (board.has_dsp) 
    948952                bcm63xx_dsp_register(&board.dsp); 
    949953 
  • new file arch/mips/bcm63xx/dev-usb-ohci.c

    - +  
     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 */ 
     8 
     9#include <linux/init.h> 
     10#include <linux/kernel.h> 
     11#include <linux/platform_device.h> 
     12#include <bcm63xx_cpu.h> 
     13#include <bcm63xx_dev_usb_ohci.h> 
     14 
     15static struct resource ohci_resources[] = { 
     16        { 
     17                .start          = -1, /* filled at runtime */ 
     18                .end            = -1, /* filled at runtime */ 
     19                .flags          = IORESOURCE_MEM, 
     20        }, 
     21        { 
     22                .start          = -1, /* filled at runtime */ 
     23                .flags          = IORESOURCE_IRQ, 
     24        }, 
     25}; 
     26 
     27static u64 ohci_dmamask = ~(u32)0; 
     28 
     29static struct platform_device bcm63xx_ohci_device = { 
     30        .name           = "bcm63xx_ohci", 
     31        .id             = 0, 
     32        .num_resources  = ARRAY_SIZE(ohci_resources), 
     33        .resource       = ohci_resources, 
     34        .dev            = { 
     35                .dma_mask               = &ohci_dmamask, 
     36                .coherent_dma_mask      = 0xffffffff, 
     37        }, 
     38}; 
     39 
     40int __init bcm63xx_ohci_register(void) 
     41{ 
     42        if (!BCMCPU_IS_6348() && !BCMCPU_IS_6358() && !BCMCPU_IS_6368()) 
     43                return 0; 
     44 
     45        ohci_resources[0].start = bcm63xx_regset_address(RSET_OHCI0); 
     46        ohci_resources[0].end = ohci_resources[0].start; 
     47        ohci_resources[0].end += RSET_OHCI_SIZE - 1; 
     48        ohci_resources[1].start = bcm63xx_get_irq_number(IRQ_OHCI0); 
     49        return platform_device_register(&bcm63xx_ohci_device); 
     50} 
  • new file arch/mips/include/asm/mach-bcm63xx/bcm63xx_dev_usb_ohci.h

    - +  
     1#ifndef BCM63XX_DEV_USB_OHCI_H_ 
     2#define BCM63XX_DEV_USB_OHCI_H_ 
     3 
     4int bcm63xx_ohci_register(void); 
     5 
     6#endif /* BCM63XX_DEV_USB_OHCI_H_ */ 
Note: See TracBrowser for help on using the repository browser.