brcm47xx: update early printk patches
[openwrt.git] / target / linux / brcm47xx / patches-3.10 / 082-MIPS-BCM47XX-add-EARLY_PRINTK_8250-support.patch
1 commit 22250a38f970c173acb1b3fb30e6dce1430f697b
2 Author: Hauke Mehrtens <hauke@hauke-m.de>
3 Date:   Thu Sep 19 22:48:35 2013 +0200
4
5     MIPS: BCM47XX: add EARLY_PRINTK_8250 support
6     
7     The BCM47xx SoCs have a 8250 serial compatible console at address
8     0x18000300 and an other at 0x18000400. On most devices 0x18000300 is
9     wired to some pins on the board, we should use that.
10     This is the smae for the AI (bcma) and the SB (ssb) bus, this is some
11     offset on the chip common core.
12     
13     Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
14
15 --- a/arch/mips/Kconfig
16 +++ b/arch/mips/Kconfig
17 @@ -117,6 +117,8 @@ config BCM47XX
18         select NO_EXCEPT_FILL
19         select SYS_SUPPORTS_32BIT_KERNEL
20         select SYS_SUPPORTS_LITTLE_ENDIAN
21 +       select SYS_HAS_EARLY_PRINTK
22 +       select EARLY_PRINTK_8250 if EARLY_PRINTK
23         help
24          Support for BCM47XX based boards
25  
26 --- a/arch/mips/bcm47xx/prom.c
27 +++ b/arch/mips/bcm47xx/prom.c
28 @@ -28,6 +28,8 @@
29  #include <linux/types.h>
30  #include <linux/kernel.h>
31  #include <linux/spinlock.h>
32 +#include <linux/ssb/ssb_driver_chipcommon.h>
33 +#include <linux/ssb/ssb_regs.h>
34  #include <linux/smp.h>
35  #include <asm/bootinfo.h>
36  #include <bcm47xx.h>
37 @@ -94,9 +96,16 @@ static __init void prom_init_mem(void)
38         add_memory_region(0, mem, BOOT_MEM_RAM);
39  }
40  
41 +/*
42 + * This is the first serial on the chip common core, it is at this position
43 + * for sb (ssb) and ai (bcma) bus.
44 + */
45 +#define BCM47XX_SERIAL_ADDR (SSB_ENUM_BASE + SSB_CHIPCO_UART0_DATA)
46 +
47  void __init prom_init(void)
48  {
49         prom_init_mem();
50 +       setup_8250_early_printk_port(CKSEG1ADDR(BCM47XX_SERIAL_ADDR), 0, 0);
51  }
52  
53  void __init prom_free_prom_memory(void)