source: trunk/target/linux/brcm63xx/patches-3.3/403-MIPS-BCM63XX-register-ehci-device.patch @ 31130

Last change on this file since 31130 was 31130, checked in by jogo, 5 years ago

bcm63xx: replace SPI driver with latest upstream version

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

    From a2d78246e4cb45b5978fc682aad19c0fff0cd20d Mon Sep 17 00:00:00 2001
    From: Maxime Bizon <mbizon@freebox.fr>
    Date: Tue, 24 May 2011 21:50:33 +0200
    Subject: [PATCH 26/63] MIPS: BCM63XX: register ehci device.
    
    ---
     arch/mips/bcm63xx/Kconfig                          |    2 +
     arch/mips/bcm63xx/Makefile                         |    2 +-
     arch/mips/bcm63xx/boards/board_bcm963xx.c          |    4 ++
     arch/mips/bcm63xx/dev-usb-ehci.c                   |   50 ++++++++++++++++++++
     .../asm/mach-bcm63xx/bcm63xx_dev_usb_ehci.h        |    6 ++
     5 files changed, 63 insertions(+), 1 deletions(-)
     create mode 100644 arch/mips/bcm63xx/dev-usb-ehci.c
     create mode 100644 arch/mips/include/asm/mach-bcm63xx/bcm63xx_dev_usb_ehci.h
    
    a b config BCM63XX_CPU_6358 
    1818        bool "support 6358 CPU" 
    1919        select HW_HAS_PCI 
    2020        select USB_ARCH_HAS_OHCI if USB_SUPPORT 
     21        select USB_ARCH_HAS_EHCI if USB_SUPPORT 
    2122 
    2223config BCM63XX_CPU_6368 
    2324        bool "support 6368 CPU" 
    2425        select HW_HAS_PCI 
    2526        select USB_ARCH_HAS_OHCI if USB_SUPPORT 
     27        select USB_ARCH_HAS_EHCI if USB_SUPPORT 
    2628endmenu 
    2729 
    2830source "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-uart.o \ 
    3                    dev-usb-ohci.o dev-wdt.o 
     3                   dev-usb-ehci.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  
    2929#include <bcm63xx_dev_pcmcia.h> 
    3030#include <bcm63xx_dev_spi.h> 
    3131#include <bcm63xx_dev_usb_ohci.h> 
     32#include <bcm63xx_dev_usb_ehci.h> 
    3233#include <board_bcm963xx.h> 
    3334#include <bcm_tag.h> 
    3435 
    int __init board_register_devices(void) 
    942943            !board_get_mac_address(board.enet1.mac_addr)) 
    943944                bcm63xx_enet_register(1, &board.enet1); 
    944945 
     946        if (board.has_ehci0) 
     947                bcm63xx_ehci_register(); 
     948 
    945949        if (board.has_ohci0) 
    946950                bcm63xx_ohci_register(); 
    947951 
  • new file arch/mips/bcm63xx/dev-usb-ehci.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_ehci.h> 
     14 
     15static struct resource ehci_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 ehci_dmamask = ~(u32)0; 
     28 
     29static struct platform_device bcm63xx_ehci_device = { 
     30        .name           = "bcm63xx_ehci", 
     31        .id             = 0, 
     32        .num_resources  = ARRAY_SIZE(ehci_resources), 
     33        .resource       = ehci_resources, 
     34        .dev            = { 
     35                .dma_mask               = &ehci_dmamask, 
     36                .coherent_dma_mask      = 0xffffffff, 
     37        }, 
     38}; 
     39 
     40int __init bcm63xx_ehci_register(void) 
     41{ 
     42        if (!BCMCPU_IS_6358() && !BCMCPU_IS_6368()) 
     43                return 0; 
     44 
     45        ehci_resources[0].start = bcm63xx_regset_address(RSET_EHCI0); 
     46        ehci_resources[0].end = ehci_resources[0].start; 
     47        ehci_resources[0].end += RSET_EHCI_SIZE - 1; 
     48        ehci_resources[1].start = bcm63xx_get_irq_number(IRQ_EHCI0); 
     49        return platform_device_register(&bcm63xx_ehci_device); 
     50} 
  • new file arch/mips/include/asm/mach-bcm63xx/bcm63xx_dev_usb_ehci.h

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