source: trunk/target/linux/brcm47xx/patches-3.2/114-MIPS-BCM47xx-Setup-and-register-serial-early.patch @ 30943

Last change on this file since 30943 was 30943, checked in by hauke, 4 years ago

brcm47xx: add support for NAND flash on devices using bcma

This patch add support for the NAND flash on BCM5357 based devices like the WNR3500Lv2.

Thank you Tathagata Das <tathagata@…> for the patch

File size: 1.8 KB
  • arch/mips/bcm47xx/setup.c

    From 9be402f069cc259ad5795b77567d66c4e7f6bef6 Mon Sep 17 00:00:00 2001
    From: Hauke Mehrtens <hauke@hauke-m.de>
    Date: Sun, 18 Jul 2010 14:59:24 +0200
    Subject: [PATCH 4/6] MIPS: BCM47xx: Setup and register serial early
    
    Swap the first and second serial if console=ttyS1 was set.
    Set it up and register it for early serial support.
    
    This patch has been in OpenWRT for a long time.
    
    Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
    ---
     arch/mips/bcm47xx/setup.c |   39 ++++++++++++++++++++++++++++++++++++++-
     1 files changed, 38 insertions(+), 1 deletions(-)
    
    a b  
    3333#include <linux/ssb/ssb_embedded.h> 
    3434#include <linux/bcma/bcma_soc.h> 
    3535#include <linux/platform_device.h> 
     36#include <linux/serial.h> 
     37#include <linux/serial_8250.h> 
    3638#include <asm/bootinfo.h> 
    3739#include <asm/reboot.h> 
    3840#include <asm/time.h> 
    static int bcm47xx_get_invariants(struct 
    281283        return 0; 
    282284} 
    283285 
     286#ifdef CONFIG_SERIAL_8250 
     287static void __init bcm47xx_early_serial_setup(struct ssb_mipscore *mcore) 
     288{ 
     289        int i; 
     290 
     291        for (i = 0; i < mcore->nr_serial_ports; i++) { 
     292                struct ssb_serial_port *port = &(mcore->serial_ports[i]); 
     293                struct uart_port s; 
     294 
     295                memset(&s, 0, sizeof(s)); 
     296                s.line = i; 
     297                s.mapbase = (unsigned int) port->regs; 
     298                s.membase = port->regs; 
     299                s.irq = port->irq + 2; 
     300                s.uartclk = port->baud_base; 
     301                s.flags = UPF_BOOT_AUTOCONF | UPF_SHARE_IRQ; 
     302                s.iotype = SERIAL_IO_MEM; 
     303                s.regshift = port->reg_shift; 
     304 
     305                early_serial_setup(&s); 
     306        } 
     307        printk(KERN_DEBUG "Serial init done.\n"); 
     308} 
     309#endif 
     310 
    284311static void __init bcm47xx_register_ssb(void) 
    285312{ 
    286313        int err; 
    static void __init bcm47xx_register_ssb( 
    313340                        memcpy(&mcore->serial_ports[1], &port, sizeof(port)); 
    314341                } 
    315342        } 
     343 
     344#ifdef CONFIG_SERIAL_8250 
     345        bcm47xx_early_serial_setup(mcore); 
     346#endif 
    316347} 
    317348#endif 
    318349 
Note: See TracBrowser for help on using the repository browser.