source: trunk/target/linux/brcm63xx/patches-2.6.37/007-usb-ohci-support.patch @ 25629

Last change on this file since 25629 was 25629, checked in by florian, 6 years ago

[brcm63xx] add support for 2.6.37, patches from KanjiMonster

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

    The bcm63xx SOC has an integrated OHCI controller, this patch adds
    platform device registration and change board code to register ohci
    device when necessary.
    
    Signed-off-by: Maxime Bizon <mbizon@freebox.fr>
    ---
     arch/mips/bcm63xx/Kconfig                          |    6 ++
     arch/mips/bcm63xx/Makefile                         |    3 +-
     arch/mips/bcm63xx/boards/board_bcm963xx.c          |    4 ++
     arch/mips/bcm63xx/dev-usb-ohci.c                   |   49 ++++++++++++++++++++
     .../asm/mach-bcm63xx/bcm63xx_dev_usb_ohci.h        |    6 ++
     5 files changed, 67 insertions(+), 1 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 config BCM63XX_CPU_6345 
    1616config BCM63XX_CPU_6348 
    1717        bool "support 6348 CPU" 
    1818        select HW_HAS_PCI 
     19        select USB_ARCH_HAS_OHCI 
     20        select USB_OHCI_BIG_ENDIAN_DESC 
     21        select USB_OHCI_BIG_ENDIAN_MMIO 
    1922 
    2023config BCM63XX_CPU_6358 
    2124        bool "support 6358 CPU" 
    2225        select HW_HAS_PCI 
     26        select USB_ARCH_HAS_OHCI 
     27        select USB_OHCI_BIG_ENDIAN_DESC 
     28        select USB_OHCI_BIG_ENDIAN_MMIO 
    2329endmenu 
    2430 
    2531source "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 \ 
    2                    dev-dsp.o dev-enet.o dev-pcmcia.o dev-uart.o dev-wdt.o 
     2                   dev-dsp.o dev-enet.o dev-pcmcia.o dev-uart.o dev-wdt.o \ 
     3                   dev-usb-ohci.o 
    34obj-$(CONFIG_EARLY_PRINTK)      += early_printk.o 
    45 
    56obj-y           += boards/ 
  • arch/mips/bcm63xx/boards/board_bcm963xx.c

    a b  
    2525#include <bcm63xx_dev_enet.h> 
    2626#include <bcm63xx_dev_dsp.h> 
    2727#include <bcm63xx_dev_pcmcia.h> 
     28#include <bcm63xx_dev_usb_ohci.h> 
    2829#include <board_bcm963xx.h> 
    2930 
    3031#define PFX     "board_bcm963xx: " 
    int __init board_register_devices(void) 
    877878            !board_get_mac_address(board.enet1.mac_addr)) 
    878879                bcm63xx_enet_register(1, &board.enet1); 
    879880 
     881        if (board.has_ohci0) 
     882                bcm63xx_ohci_register(); 
     883 
    880884        if (board.has_dsp) 
    881885                bcm63xx_dsp_register(&board.dsp); 
    882886 
  • 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) 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_ohci.h> 
     14 
     15static struct resource ohci_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 ohci_dmamask = ~(u32)0; 
     27 
     28static struct platform_device bcm63xx_ohci_device = { 
     29        .name           = "bcm63xx_ohci", 
     30        .id             = 0, 
     31        .num_resources  = ARRAY_SIZE(ohci_resources), 
     32        .resource       = ohci_resources, 
     33        .dev            = { 
     34                .dma_mask               = &ohci_dmamask, 
     35                .coherent_dma_mask      = 0xffffffff, 
     36        }, 
     37}; 
     38 
     39int __init bcm63xx_ohci_register(void) 
     40{ 
     41        if (!BCMCPU_IS_6348() && !BCMCPU_IS_6358()) 
     42                return 0; 
     43 
     44        ohci_resources[0].start = bcm63xx_regset_address(RSET_OHCI0); 
     45        ohci_resources[0].end = ohci_resources[0].start; 
     46        ohci_resources[0].end += RSET_OHCI_SIZE - 1; 
     47        ohci_resources[1].start = bcm63xx_get_irq_number(IRQ_OHCI0); 
     48        return platform_device_register(&bcm63xx_ohci_device); 
     49} 
  • 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.