brcm47xx: fix for boardflags by xMff
authorHauke Mehrtens <hauke@hauke-m.de>
Tue, 20 Jul 2010 19:41:17 +0000 (19:41 +0000)
committerHauke Mehrtens <hauke@hauke-m.de>
Tue, 20 Jul 2010 19:41:17 +0000 (19:41 +0000)
and checkpatch.pl fixes

SVN-Revision: 22318

12 files changed:
target/linux/brcm47xx/patches-2.6.34/011-MIPS-BCM47xx-Really-fix-128MB-RAM-problem.patch
target/linux/brcm47xx/patches-2.6.34/012-MIPS-BCM47xx-Fill-more-values-into-ssb-sprom.patch
target/linux/brcm47xx/patches-2.6.34/013-MIPS-BCM47xx-Activate-SSB_B43_PCI_BRIDGE-by-default.patch
target/linux/brcm47xx/patches-2.6.34/014-MIPS-BCM47xx-Setup-and-register-serial-early.patch
target/linux/brcm47xx/patches-2.6.34/015-MIPS-BCM47xx-Remove-CFE-console.patch
target/linux/brcm47xx/patches-2.6.34/400-arch-bcm47xx.patch
target/linux/brcm47xx/patches-2.6.35/011-MIPS-BCM47xx-Really-fix-128MB-RAM-problem.patch
target/linux/brcm47xx/patches-2.6.35/012-MIPS-BCM47xx-Fill-more-values-into-ssb-sprom.patch
target/linux/brcm47xx/patches-2.6.35/013-MIPS-BCM47xx-Activate-SSB_B43_PCI_BRIDGE-by-default.patch
target/linux/brcm47xx/patches-2.6.35/014-MIPS-BCM47xx-Setup-and-register-serial-early.patch
target/linux/brcm47xx/patches-2.6.35/015-MIPS-BCM47xx-Remove-CFE-console.patch
target/linux/brcm47xx/patches-2.6.35/400-arch-bcm47xx.patch

index eab10b6d2ba7a3c918cd08d814408135403906c7..98b12019c2e94818bc067d9e6c8c4223e05c2c28 100644 (file)
@@ -1,4 +1,4 @@
-From cf731bb198bdaa4ce741536252ea99518887b721 Mon Sep 17 00:00:00 2001
+From bf93090747e3d23e5354bd8da52f85d96c0f6606 Mon Sep 17 00:00:00 2001
 From: Hauke Mehrtens <hauke@hauke-m.de>
 Date: Sun, 18 Jul 2010 12:49:41 +0200
 Subject: [PATCH 1/5] MIPS: BCM47xx: Really fix 128MB RAM problem
@@ -33,7 +33,7 @@ Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
         * want to reuse the memory used by CFE (around 4MB). That means cfe_*
         * functions stop to work at some point during the boot, we should only
         * call them at the beginning of the boot.
-+       * 
++       *
 +       * BCM47XX uses 128MB for addressing the ram, if the system contains
 +       * less that that amount of ram it remaps the ram more often into the
 +       * available space.
@@ -45,7 +45,7 @@ Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
        for (mem = (1 << 20); mem < (128 << 20); mem += (1 << 20)) {
 +              if (((unsigned long)(prom_init) + mem) > max) {
 +                      mem = (128 << 20);
-+                      printk("assume 128MB RAM\n");
++                      printk(KERN_DEBUG "assume 128MB RAM\n");
 +                      break;
 +              }
                if (*(unsigned long *)((unsigned long)(prom_init) + mem) ==
index d3831d105d11aa742b4cc6e6f91f622616ca6e33..f3213d6f63a243e557b8c2d88833e1740707e37e 100644 (file)
@@ -1,4 +1,4 @@
-From 493d4a90850509e5f09b4799d4fc234b734a9d30 Mon Sep 17 00:00:00 2001
+From f382c623892dad1c6a9ebc0e12d01fd45ee50db8 Mon Sep 17 00:00:00 2001
 From: Hauke Mehrtens <hauke@hauke-m.de>
 Date: Sun, 18 Jul 2010 13:34:32 +0200
 Subject: [PATCH 2/5] MIPS: BCM47xx: Fill more values into ssb sprom
@@ -10,19 +10,19 @@ drivers needs them.
 
 Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
 ---
- arch/mips/bcm47xx/setup.c |  125 +++++++++++++++++++++++++++++++++------------
- 1 files changed, 92 insertions(+), 33 deletions(-)
+ arch/mips/bcm47xx/setup.c |  130 +++++++++++++++++++++++++++++++++-----------
+ 1 files changed, 97 insertions(+), 33 deletions(-)
 
 --- a/arch/mips/bcm47xx/setup.c
 +++ b/arch/mips/bcm47xx/setup.c
-@@ -74,6 +74,89 @@ static void str2eaddr(char *str, char *d
+@@ -74,6 +74,94 @@ static void str2eaddr(char *str, char *d
        }
  }
  
 +static void bcm47xx_fill_sprom(struct ssb_sprom *sprom)
 +{
 +      char buf[100];
-+      u64 boardflags;
++      u32 boardflags;
 +
 +      memset(sprom, 0, sizeof(struct ssb_sprom));
 +
@@ -93,19 +93,24 @@ Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
 +
 +      if (nvram_getenv("boardflags", buf, sizeof(buf)) >= 0 ||
 +          cfe_getenv("boardflags", buf, sizeof(buf)) >= 0)
-+              boardflags = simple_strtoll(buf, NULL, 0);
++              boardflags = simple_strtoul(buf, NULL, 0);
 +      if (boardflags) {
-+              sprom->boardflags_lo = (boardflags & 0x000000000000FFFFLLU);
-+              sprom->boardflags_hi = (boardflags & 0x00000000FFFF0000LLU) >> 16;
-+              sprom->boardflags2_lo = (boardflags & 0x0000FFFF00000000LLU) >> 32;
-+              sprom->boardflags2_hi = (boardflags & 0xFFFF000000000000LLU) >> 48;
++              sprom->boardflags_lo = (boardflags & 0x0000FFFFU);
++              sprom->boardflags_hi = (boardflags & 0xFFFF0000U) >> 16;
++      }
++      if (nvram_getenv("boardflags2", buf, sizeof(buf)) >= 0 ||
++          cfe_getenv("boardflags2", buf, sizeof(buf)) >= 0)
++              boardflags = simple_strtoul(buf, NULL, 0);
++      if (boardflags) {
++              sprom->boardflags2_lo = (boardflags & 0x0000FFFFU);
++              sprom->boardflags2_hi = (boardflags & 0xFFFF0000U) >> 16;
 +      }
 +}
 +
  static int bcm47xx_get_invariants(struct ssb_bus *bus,
                                   struct ssb_init_invariants *iv)
  {
-@@ -82,43 +165,19 @@ static int bcm47xx_get_invariants(struct
+@@ -82,43 +170,19 @@ static int bcm47xx_get_invariants(struct
        /* Fill boardinfo structure */
        memset(&(iv->boardinfo), 0 , sizeof(struct ssb_boardinfo));
  
index 3c4f82301674c5b7fb70ab78eb61505b01888270..6bcd55f4c96ae51f769dad18c98d0a1d835f8720 100644 (file)
@@ -1,4 +1,4 @@
-From 13f9cbc3c26be8071d33206dd931431e84e83068 Mon Sep 17 00:00:00 2001
+From e6feb5dc2c1bb28582fa3e1445f9d90114e39724 Mon Sep 17 00:00:00 2001
 From: Hauke Mehrtens <hauke@hauke-m.de>
 Date: Sun, 18 Jul 2010 13:58:09 +0200
 Subject: [PATCH 3/5] MIPS: BCM47xx: Activate SSB_B43_PCI_BRIDGE by default
index 1aed45c3c2e7a724252fa7f8f7d583894ddbd518..5ee1bafc6e8751d91c3a2f312f02ea44a280f875 100644 (file)
@@ -1,4 +1,4 @@
-From 09ebc2952d9d3df6b9c548d9943dc8bcffb87540 Mon Sep 17 00:00:00 2001
+From 3902bba103634d3256dac557020d7974f0d08aff 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/5] MIPS: BCM47xx: Setup and register serial early
@@ -9,8 +9,8 @@ Set it up and register it for early serial support.
 Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
 ---
  arch/mips/Kconfig         |    1 -
- arch/mips/bcm47xx/setup.c |   3+++++++++++++++++++++++++++++++++++-
- 2 files changed, 35 insertions(+), 2 deletions(-)
+ arch/mips/bcm47xx/setup.c |   37 ++++++++++++++++++++++++++++++++++++-
+ 2 files changed, 36 insertions(+), 2 deletions(-)
 
 --- a/arch/mips/Kconfig
 +++ b/arch/mips/Kconfig
@@ -33,7 +33,7 @@ Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
  #include <asm/bootinfo.h>
  #include <asm/reboot.h>
  #include <asm/time.h>
-@@ -184,12 +186,44 @@ static int bcm47xx_get_invariants(struct
+@@ -189,12 +191,45 @@ static int bcm47xx_get_invariants(struct
  
  void __init plat_mem_setup(void)
  {
@@ -52,10 +52,11 @@ Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
 +      if (!strncmp(buf, "console=ttyS1", 13)) {
 +              struct ssb_serial_port port;
 +
-+              printk("Swapping serial ports!\n");
++              printk(KERN_DEBUG "Swapping serial ports!\n");
 +              /* swap serial ports */
 +              memcpy(&port, &mcore->serial_ports[0], sizeof(port));
-+              memcpy(&mcore->serial_ports[0], &mcore->serial_ports[1], sizeof(port));
++              memcpy(&mcore->serial_ports[0], &mcore->serial_ports[1],
++                     sizeof(port));
 +              memcpy(&mcore->serial_ports[1], &port, sizeof(port));
 +      }
 +
@@ -75,7 +76,7 @@ Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
 +
 +              early_serial_setup(&s);
 +      }
-+      printk("Serial init done.\n");
++      printk(KERN_DEBUG "Serial init done.\n");
  
        _machine_restart = bcm47xx_machine_restart;
        _machine_halt = bcm47xx_machine_halt;
index f7e73a45ae301ccfb317adbf6f97f41f29679262..4a365fde84f44bb0bbbc8c0ec04c6c607d2a115b 100644 (file)
@@ -1,4 +1,4 @@
-From 4863132bcb6c87152ea474297329048cc8516ad2 Mon Sep 17 00:00:00 2001
+From 83b4ed2d1789609565822335ea27026d46fbb477 Mon Sep 17 00:00:00 2001
 From: Hauke Mehrtens <hauke@hauke-m.de>
 Date: Sun, 18 Jul 2010 15:11:26 +0200
 Subject: [PATCH 5/5] MIPS: BCM47xx: Remove CFE console
index accc0cb1e304114bae521a565578396c620b9f9f..0c407e8b221465816cd2b2d3f46d4ef032897fe0 100644 (file)
@@ -33,7 +33,7 @@
 +EXPORT_SYMBOL(nvram_get);
 --- a/arch/mips/bcm47xx/setup.c
 +++ b/arch/mips/bcm47xx/setup.c
-@@ -229,3 +229,20 @@ void __init plat_mem_setup(void)
+@@ -235,3 +235,20 @@ void __init plat_mem_setup(void)
        _machine_halt = bcm47xx_machine_halt;
        pm_power_off = bcm47xx_machine_halt;
  }
index eab10b6d2ba7a3c918cd08d814408135403906c7..98b12019c2e94818bc067d9e6c8c4223e05c2c28 100644 (file)
@@ -1,4 +1,4 @@
-From cf731bb198bdaa4ce741536252ea99518887b721 Mon Sep 17 00:00:00 2001
+From bf93090747e3d23e5354bd8da52f85d96c0f6606 Mon Sep 17 00:00:00 2001
 From: Hauke Mehrtens <hauke@hauke-m.de>
 Date: Sun, 18 Jul 2010 12:49:41 +0200
 Subject: [PATCH 1/5] MIPS: BCM47xx: Really fix 128MB RAM problem
@@ -33,7 +33,7 @@ Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
         * want to reuse the memory used by CFE (around 4MB). That means cfe_*
         * functions stop to work at some point during the boot, we should only
         * call them at the beginning of the boot.
-+       * 
++       *
 +       * BCM47XX uses 128MB for addressing the ram, if the system contains
 +       * less that that amount of ram it remaps the ram more often into the
 +       * available space.
@@ -45,7 +45,7 @@ Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
        for (mem = (1 << 20); mem < (128 << 20); mem += (1 << 20)) {
 +              if (((unsigned long)(prom_init) + mem) > max) {
 +                      mem = (128 << 20);
-+                      printk("assume 128MB RAM\n");
++                      printk(KERN_DEBUG "assume 128MB RAM\n");
 +                      break;
 +              }
                if (*(unsigned long *)((unsigned long)(prom_init) + mem) ==
index d3831d105d11aa742b4cc6e6f91f622616ca6e33..f3213d6f63a243e557b8c2d88833e1740707e37e 100644 (file)
@@ -1,4 +1,4 @@
-From 493d4a90850509e5f09b4799d4fc234b734a9d30 Mon Sep 17 00:00:00 2001
+From f382c623892dad1c6a9ebc0e12d01fd45ee50db8 Mon Sep 17 00:00:00 2001
 From: Hauke Mehrtens <hauke@hauke-m.de>
 Date: Sun, 18 Jul 2010 13:34:32 +0200
 Subject: [PATCH 2/5] MIPS: BCM47xx: Fill more values into ssb sprom
@@ -10,19 +10,19 @@ drivers needs them.
 
 Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
 ---
- arch/mips/bcm47xx/setup.c |  125 +++++++++++++++++++++++++++++++++------------
- 1 files changed, 92 insertions(+), 33 deletions(-)
+ arch/mips/bcm47xx/setup.c |  130 +++++++++++++++++++++++++++++++++-----------
+ 1 files changed, 97 insertions(+), 33 deletions(-)
 
 --- a/arch/mips/bcm47xx/setup.c
 +++ b/arch/mips/bcm47xx/setup.c
-@@ -74,6 +74,89 @@ static void str2eaddr(char *str, char *d
+@@ -74,6 +74,94 @@ static void str2eaddr(char *str, char *d
        }
  }
  
 +static void bcm47xx_fill_sprom(struct ssb_sprom *sprom)
 +{
 +      char buf[100];
-+      u64 boardflags;
++      u32 boardflags;
 +
 +      memset(sprom, 0, sizeof(struct ssb_sprom));
 +
@@ -93,19 +93,24 @@ Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
 +
 +      if (nvram_getenv("boardflags", buf, sizeof(buf)) >= 0 ||
 +          cfe_getenv("boardflags", buf, sizeof(buf)) >= 0)
-+              boardflags = simple_strtoll(buf, NULL, 0);
++              boardflags = simple_strtoul(buf, NULL, 0);
 +      if (boardflags) {
-+              sprom->boardflags_lo = (boardflags & 0x000000000000FFFFLLU);
-+              sprom->boardflags_hi = (boardflags & 0x00000000FFFF0000LLU) >> 16;
-+              sprom->boardflags2_lo = (boardflags & 0x0000FFFF00000000LLU) >> 32;
-+              sprom->boardflags2_hi = (boardflags & 0xFFFF000000000000LLU) >> 48;
++              sprom->boardflags_lo = (boardflags & 0x0000FFFFU);
++              sprom->boardflags_hi = (boardflags & 0xFFFF0000U) >> 16;
++      }
++      if (nvram_getenv("boardflags2", buf, sizeof(buf)) >= 0 ||
++          cfe_getenv("boardflags2", buf, sizeof(buf)) >= 0)
++              boardflags = simple_strtoul(buf, NULL, 0);
++      if (boardflags) {
++              sprom->boardflags2_lo = (boardflags & 0x0000FFFFU);
++              sprom->boardflags2_hi = (boardflags & 0xFFFF0000U) >> 16;
 +      }
 +}
 +
  static int bcm47xx_get_invariants(struct ssb_bus *bus,
                                   struct ssb_init_invariants *iv)
  {
-@@ -82,43 +165,19 @@ static int bcm47xx_get_invariants(struct
+@@ -82,43 +170,19 @@ static int bcm47xx_get_invariants(struct
        /* Fill boardinfo structure */
        memset(&(iv->boardinfo), 0 , sizeof(struct ssb_boardinfo));
  
index 3c4f82301674c5b7fb70ab78eb61505b01888270..6bcd55f4c96ae51f769dad18c98d0a1d835f8720 100644 (file)
@@ -1,4 +1,4 @@
-From 13f9cbc3c26be8071d33206dd931431e84e83068 Mon Sep 17 00:00:00 2001
+From e6feb5dc2c1bb28582fa3e1445f9d90114e39724 Mon Sep 17 00:00:00 2001
 From: Hauke Mehrtens <hauke@hauke-m.de>
 Date: Sun, 18 Jul 2010 13:58:09 +0200
 Subject: [PATCH 3/5] MIPS: BCM47xx: Activate SSB_B43_PCI_BRIDGE by default
index 1aed45c3c2e7a724252fa7f8f7d583894ddbd518..5ee1bafc6e8751d91c3a2f312f02ea44a280f875 100644 (file)
@@ -1,4 +1,4 @@
-From 09ebc2952d9d3df6b9c548d9943dc8bcffb87540 Mon Sep 17 00:00:00 2001
+From 3902bba103634d3256dac557020d7974f0d08aff 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/5] MIPS: BCM47xx: Setup and register serial early
@@ -9,8 +9,8 @@ Set it up and register it for early serial support.
 Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
 ---
  arch/mips/Kconfig         |    1 -
- arch/mips/bcm47xx/setup.c |   3+++++++++++++++++++++++++++++++++++-
- 2 files changed, 35 insertions(+), 2 deletions(-)
+ arch/mips/bcm47xx/setup.c |   37 ++++++++++++++++++++++++++++++++++++-
+ 2 files changed, 36 insertions(+), 2 deletions(-)
 
 --- a/arch/mips/Kconfig
 +++ b/arch/mips/Kconfig
@@ -33,7 +33,7 @@ Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
  #include <asm/bootinfo.h>
  #include <asm/reboot.h>
  #include <asm/time.h>
-@@ -184,12 +186,44 @@ static int bcm47xx_get_invariants(struct
+@@ -189,12 +191,45 @@ static int bcm47xx_get_invariants(struct
  
  void __init plat_mem_setup(void)
  {
@@ -52,10 +52,11 @@ Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
 +      if (!strncmp(buf, "console=ttyS1", 13)) {
 +              struct ssb_serial_port port;
 +
-+              printk("Swapping serial ports!\n");
++              printk(KERN_DEBUG "Swapping serial ports!\n");
 +              /* swap serial ports */
 +              memcpy(&port, &mcore->serial_ports[0], sizeof(port));
-+              memcpy(&mcore->serial_ports[0], &mcore->serial_ports[1], sizeof(port));
++              memcpy(&mcore->serial_ports[0], &mcore->serial_ports[1],
++                     sizeof(port));
 +              memcpy(&mcore->serial_ports[1], &port, sizeof(port));
 +      }
 +
@@ -75,7 +76,7 @@ Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
 +
 +              early_serial_setup(&s);
 +      }
-+      printk("Serial init done.\n");
++      printk(KERN_DEBUG "Serial init done.\n");
  
        _machine_restart = bcm47xx_machine_restart;
        _machine_halt = bcm47xx_machine_halt;
index f7e73a45ae301ccfb317adbf6f97f41f29679262..4a365fde84f44bb0bbbc8c0ec04c6c607d2a115b 100644 (file)
@@ -1,4 +1,4 @@
-From 4863132bcb6c87152ea474297329048cc8516ad2 Mon Sep 17 00:00:00 2001
+From 83b4ed2d1789609565822335ea27026d46fbb477 Mon Sep 17 00:00:00 2001
 From: Hauke Mehrtens <hauke@hauke-m.de>
 Date: Sun, 18 Jul 2010 15:11:26 +0200
 Subject: [PATCH 5/5] MIPS: BCM47xx: Remove CFE console
index accc0cb1e304114bae521a565578396c620b9f9f..0c407e8b221465816cd2b2d3f46d4ef032897fe0 100644 (file)
@@ -33,7 +33,7 @@
 +EXPORT_SYMBOL(nvram_get);
 --- a/arch/mips/bcm47xx/setup.c
 +++ b/arch/mips/bcm47xx/setup.c
-@@ -229,3 +229,20 @@ void __init plat_mem_setup(void)
+@@ -235,3 +235,20 @@ void __init plat_mem_setup(void)
        _machine_halt = bcm47xx_machine_halt;
        pm_power_off = bcm47xx_machine_halt;
  }