source: trunk/target/linux/brcm63xx/patches-3.0/008-usb-ehci-support.patch @ 27880

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

[brcm63xx] improve BCM6345 support

  • runtime detect the amount of memory available
  • define EBI_BASE as MPI_BASE to get rid of chip-select specific hacks
  • fix GPIO control
File size: 3.4 KB
  • arch/mips/bcm63xx/Kconfig

    The bcm63xx SOC has an integrated EHCI controller, this patch adds
    platform device registration and change board code to register
    EHCI device when necessary.
    
    Signed-off-by: Maxime Bizon <mbizon@freebox.fr>
    ---
     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                   |   49 ++++++++++++++++++++
     .../asm/mach-bcm63xx/bcm63xx_dev_usb_ehci.h        |    6 ++
     5 files changed, 62 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 
    2626        select USB_ARCH_HAS_OHCI 
    2727        select USB_OHCI_BIG_ENDIAN_DESC 
    2828        select USB_OHCI_BIG_ENDIAN_MMIO 
     29        select USB_ARCH_HAS_EHCI 
     30        select USB_EHCI_BIG_ENDIAN_MMIO 
    2931endmenu 
    3032 
    3133source "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-uart.o dev-wdt.o \ 
    3                    dev-usb-ohci.o 
     3                   dev-usb-ohci.o dev-usb-ehci.o 
    44obj-$(CONFIG_EARLY_PRINTK)      += early_printk.o 
    55 
    66obj-y           += boards/ 
  • arch/mips/bcm63xx/boards/board_bcm963xx.c

    a b  
    2626#include <bcm63xx_dev_dsp.h> 
    2727#include <bcm63xx_dev_pcmcia.h> 
    2828#include <bcm63xx_dev_usb_ohci.h> 
     29#include <bcm63xx_dev_usb_ehci.h> 
    2930#include <board_bcm963xx.h> 
    3031 
    3132#define PFX     "board_bcm963xx: " 
    int __init board_register_devices(void) 
    884885            !board_get_mac_address(board.enet1.mac_addr)) 
    885886                bcm63xx_enet_register(1, &board.enet1); 
    886887 
     888        if (board.has_ehci0) 
     889                bcm63xx_ehci_register(); 
     890 
    887891        if (board.has_ohci0) 
    888892                bcm63xx_ohci_register(); 
    889893 
  • 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) 2010 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 & end filled at runtime */ 
     18                .flags          = IORESOURCE_MEM, 
     19        }, 
     20        { 
     21                /* start filled at runtime */ 
     22                .flags          = IORESOURCE_IRQ, 
     23        }, 
     24}; 
     25 
     26static u64 ehci_dmamask = ~(u32)0; 
     27 
     28static struct platform_device bcm63xx_ehci_device = { 
     29        .name           = "bcm63xx_ehci", 
     30        .id             = 0, 
     31        .num_resources  = ARRAY_SIZE(ehci_resources), 
     32        .resource       = ehci_resources, 
     33        .dev            = { 
     34                .dma_mask               = &ehci_dmamask, 
     35                .coherent_dma_mask      = 0xffffffff, 
     36        }, 
     37}; 
     38 
     39int __init bcm63xx_ehci_register(void) 
     40{ 
     41        if (!BCMCPU_IS_6358()) 
     42                return 0; 
     43 
     44        ehci_resources[0].start = bcm63xx_regset_address(RSET_EHCI0); 
     45        ehci_resources[0].end = ehci_resources[0].start; 
     46        ehci_resources[0].end += RSET_EHCI_SIZE - 1; 
     47        ehci_resources[1].start = bcm63xx_get_irq_number(IRQ_EHCI0); 
     48        return platform_device_register(&bcm63xx_ehci_device); 
     49} 
  • 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.