[ar71xx] WRT160NL: more mtd parser cleanup
[openwrt.git] / target / linux / brcm47xx / patches-2.6.28 / 400-arch-bcm47xx.patch
index ae7bd74..ef6b712 100644 (file)
@@ -1,15 +1,13 @@
-diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig
 --- a/arch/mips/Kconfig
 +++ b/arch/mips/Kconfig
 @@ -53,6 +53,7 @@ config BCM47XX
        select SSB_DRIVER_MIPS
        select SSB_DRIVER_EXTIF
        select SSB_EMBEDDED
-+      select SSB_B43_PCI_BRIDGE
++      select SSB_B43_PCI_BRIDGE if PCI
        select SSB_PCICORE_HOSTMODE if PCI
        select GENERIC_GPIO
        select SYS_HAS_EARLY_PRINTK
-diff --git a/arch/mips/bcm47xx/Makefile b/arch/mips/bcm47xx/Makefile
 --- a/arch/mips/bcm47xx/Makefile
 +++ b/arch/mips/bcm47xx/Makefile
 @@ -3,4 +3,4 @@
@@ -18,7 +16,6 @@ diff --git a/arch/mips/bcm47xx/Makefile b/arch/mips/bcm47xx/Makefile
  
 -obj-y := gpio.o irq.o prom.o serial.o setup.o time.o wgt634u.o
 +obj-y := cfe_env.o gpio.o irq.o nvram.o prom.o serial.o setup.o time.o wgt634u.o
-diff --git a/arch/mips/bcm47xx/irq.c b/arch/mips/bcm47xx/irq.c
 --- a/arch/mips/bcm47xx/irq.c
 +++ b/arch/mips/bcm47xx/irq.c
 @@ -1,5 +1,6 @@
@@ -48,7 +45,6 @@ diff --git a/arch/mips/bcm47xx/irq.c b/arch/mips/bcm47xx/irq.c
  void plat_irq_dispatch(void)
  {
        u32 cause;
-diff --git a/arch/mips/bcm47xx/nvram.c b/arch/mips/bcm47xx/nvram.c
 --- a/arch/mips/bcm47xx/nvram.c
 +++ b/arch/mips/bcm47xx/nvram.c
 @@ -24,10 +24,10 @@
@@ -64,7 +60,7 @@ diff --git a/arch/mips/bcm47xx/nvram.c b/arch/mips/bcm47xx/nvram.c
  
  static char nvram_buf[NVRAM_SPACE];
  static int cfe_env;
-@@ -36,7 +36,7 @@ extern char *cfe_env_get(char *nv_buf, const char *name);
+@@ -36,7 +36,7 @@ extern char *cfe_env_get(char *nv_buf, c
  /* Probe for NVRAM header */
  static void __init early_nvram_init(void)
  {
@@ -73,7 +69,6 @@ diff --git a/arch/mips/bcm47xx/nvram.c b/arch/mips/bcm47xx/nvram.c
        struct nvram_header *header;
        int i;
        u32 base, lim, off;
-diff --git a/arch/mips/bcm47xx/setup.c b/arch/mips/bcm47xx/setup.c
 --- a/arch/mips/bcm47xx/setup.c
 +++ b/arch/mips/bcm47xx/setup.c
 @@ -2,7 +2,7 @@
@@ -124,18 +119,44 @@ diff --git a/arch/mips/bcm47xx/setup.c b/arch/mips/bcm47xx/setup.c
  {
        int i = 0;
  
-@@ -73,52 +83,141 @@ static void str2eaddr(char *str, char *dest)
+@@ -73,52 +83,142 @@ static void str2eaddr(char *str, char *d
        }
  }
  
 -static int bcm47xx_get_invariants(struct ssb_bus *bus,
 -                                 struct ssb_init_invariants *iv)
 +static void bcm47xx_fill_sprom(struct ssb_sprom *sprom)
-+{
+ {
+-      char buf[100];
 +      char *s;
-+
+-      /* Fill boardinfo structure */
+-      memset(&(iv->boardinfo), 0 , sizeof(struct ssb_boardinfo));
 +      memset(sprom, 0xFF, sizeof(struct ssb_sprom));
-+
+-      if (cfe_getenv("boardvendor", buf, sizeof(buf)) >= 0)
+-              iv->boardinfo.type = (u16)simple_strtoul(buf, NULL, 0);
+-      if (cfe_getenv("boardtype", buf, sizeof(buf)) >= 0)
+-              iv->boardinfo.type = (u16)simple_strtoul(buf, NULL, 0);
+-      if (cfe_getenv("boardrev", buf, sizeof(buf)) >= 0)
+-              iv->boardinfo.rev = (u16)simple_strtoul(buf, NULL, 0);
+-
+-      /* Fill sprom structure */
+-      memset(&(iv->sprom), 0, sizeof(struct ssb_sprom));
+-      iv->sprom.revision = 3;
+-
+-      if (cfe_getenv("et0macaddr", buf, sizeof(buf)) >= 0)
+-              str2eaddr(buf, iv->sprom.et0mac);
+-      if (cfe_getenv("et1macaddr", buf, sizeof(buf)) >= 0)
+-              str2eaddr(buf, iv->sprom.et1mac);
+-      if (cfe_getenv("et0phyaddr", buf, sizeof(buf)) >= 0)
+-              iv->sprom.et0phyaddr = simple_strtoul(buf, NULL, 10);
+-      if (cfe_getenv("et1phyaddr", buf, sizeof(buf)) >= 0)
+-              iv->sprom.et1phyaddr = simple_strtoul(buf, NULL, 10);
+-      if (cfe_getenv("et0mdcport", buf, sizeof(buf)) >= 0)
+-              iv->sprom.et0mdcport = simple_strtoul(buf, NULL, 10);
+-      if (cfe_getenv("et1mdcport", buf, sizeof(buf)) >= 0)
+-              iv->sprom.et1mdcport = simple_strtoul(buf, NULL, 10);
 +      sprom->revision = 1;
 +      if ((s = nvram_get("il0macaddr")))
 +              e_aton(s, sprom->il0mac);
@@ -188,35 +209,7 @@ diff --git a/arch/mips/bcm47xx/setup.c b/arch/mips/bcm47xx/setup.c
 +}
 +
 +static int bcm47xx_get_invariants(struct ssb_bus *bus, struct ssb_init_invariants *iv)
- {
--      char buf[100];
--
--      /* Fill boardinfo structure */
--      memset(&(iv->boardinfo), 0 , sizeof(struct ssb_boardinfo));
--
--      if (cfe_getenv("boardvendor", buf, sizeof(buf)) >= 0)
--              iv->boardinfo.type = (u16)simple_strtoul(buf, NULL, 0);
--      if (cfe_getenv("boardtype", buf, sizeof(buf)) >= 0)
--              iv->boardinfo.type = (u16)simple_strtoul(buf, NULL, 0);
--      if (cfe_getenv("boardrev", buf, sizeof(buf)) >= 0)
--              iv->boardinfo.rev = (u16)simple_strtoul(buf, NULL, 0);
--
--      /* Fill sprom structure */
--      memset(&(iv->sprom), 0, sizeof(struct ssb_sprom));
--      iv->sprom.revision = 3;
--
--      if (cfe_getenv("et0macaddr", buf, sizeof(buf)) >= 0)
--              str2eaddr(buf, iv->sprom.et0mac);
--      if (cfe_getenv("et1macaddr", buf, sizeof(buf)) >= 0)
--              str2eaddr(buf, iv->sprom.et1mac);
--      if (cfe_getenv("et0phyaddr", buf, sizeof(buf)) >= 0)
--              iv->sprom.et0phyaddr = simple_strtoul(buf, NULL, 10);
--      if (cfe_getenv("et1phyaddr", buf, sizeof(buf)) >= 0)
--              iv->sprom.et1phyaddr = simple_strtoul(buf, NULL, 10);
--      if (cfe_getenv("et0mdcport", buf, sizeof(buf)) >= 0)
--              iv->sprom.et0mdcport = simple_strtoul(buf, NULL, 10);
--      if (cfe_getenv("et1mdcport", buf, sizeof(buf)) >= 0)
--              iv->sprom.et1mdcport = simple_strtoul(buf, NULL, 10);
++{
 +      char *s;
 +
 +      iv->boardinfo.vendor = SSB_BOARDVENDOR_BCM;
@@ -247,15 +240,15 @@ diff --git a/arch/mips/bcm47xx/setup.c b/arch/mips/bcm47xx/setup.c
 +              panic(msg, err);
 +      }
 +      mcore = &ssb_bcm47xx.mipscore;
-+
-+      s = nvram_get("kernel_args");
-+      if (s && !strncmp(s, "console=ttyS1", 13)) {
-+              struct ssb_serial_port port;
  
 -      err = ssb_bus_ssbbus_register(&ssb_bcm47xx, SSB_ENUM_BASE,
 -                                    bcm47xx_get_invariants);
 -      if (err)
 -              panic("Failed to initialize SSB bus (err %d)\n", err);
++      s = nvram_get("kernel_args");
++      if (s && !strncmp(s, "console=ttyS1", 13)) {
++              struct ssb_serial_port port;
++
 +              printk("Swapping serial ports!\n");
 +              /* swap serial ports */
 +              memcpy(&port, &mcore->serial_ports[0], sizeof(port));
@@ -269,6 +262,7 @@ diff --git a/arch/mips/bcm47xx/setup.c b/arch/mips/bcm47xx/setup.c
 +
 +              memset(&s, 0, sizeof(s));
 +              s.line = i;
++              s.mapbase = (unsigned int) port->regs;
 +              s.membase = port->regs;
 +              s.irq = port->irq + 2;
 +              s.uartclk = port->baud_base;
@@ -301,7 +295,6 @@ diff --git a/arch/mips/bcm47xx/setup.c b/arch/mips/bcm47xx/setup.c
 +      return 0;
 +}
 +device_initcall(bcm47xx_register_gpiodev);
-diff --git a/arch/mips/bcm47xx/time.c b/arch/mips/bcm47xx/time.c
 --- a/arch/mips/bcm47xx/time.c
 +++ b/arch/mips/bcm47xx/time.c
 @@ -22,11 +22,17 @@
This page took 0.0258 seconds and 4 git commands to generate.