Date:2010-07-20 21:41:17 (8 years 4 months ago)
Author:hauke
Commit:0474d29e5e7d175370d3e485a58c6e06aeba6f7e
Message:brcm47xx: fix for boardflags by xMff and checkpatch.pl fixes

git-svn-id: svn://svn.openwrt.org/openwrt/trunk@22318 3c298f89-4303-0410-b956-a3cf2f4a3e73
Files: target/linux/brcm47xx/patches-2.6.34/011-MIPS-BCM47xx-Really-fix-128MB-RAM-problem.patch (3 diffs)
target/linux/brcm47xx/patches-2.6.34/012-MIPS-BCM47xx-Fill-more-values-into-ssb-sprom.patch (3 diffs)
target/linux/brcm47xx/patches-2.6.34/013-MIPS-BCM47xx-Activate-SSB_B43_PCI_BRIDGE-by-default.patch (1 diff)
target/linux/brcm47xx/patches-2.6.34/014-MIPS-BCM47xx-Setup-and-register-serial-early.patch (5 diffs)
target/linux/brcm47xx/patches-2.6.34/015-MIPS-BCM47xx-Remove-CFE-console.patch (1 diff)
target/linux/brcm47xx/patches-2.6.34/400-arch-bcm47xx.patch (1 diff)
target/linux/brcm47xx/patches-2.6.35/011-MIPS-BCM47xx-Really-fix-128MB-RAM-problem.patch (3 diffs)
target/linux/brcm47xx/patches-2.6.35/012-MIPS-BCM47xx-Fill-more-values-into-ssb-sprom.patch (3 diffs)
target/linux/brcm47xx/patches-2.6.35/013-MIPS-BCM47xx-Activate-SSB_B43_PCI_BRIDGE-by-default.patch (1 diff)
target/linux/brcm47xx/patches-2.6.35/014-MIPS-BCM47xx-Setup-and-register-serial-early.patch (5 diffs)
target/linux/brcm47xx/patches-2.6.35/015-MIPS-BCM47xx-Remove-CFE-console.patch (1 diff)
target/linux/brcm47xx/patches-2.6.35/400-arch-bcm47xx.patch (1 diff)

Change Details

target/linux/brcm47xx/patches-2.6.34/011-MIPS-BCM47xx-Really-fix-128MB-RAM-problem.patch
1From cf731bb198bdaa4ce741536252ea99518887b721 Mon Sep 17 00:00:00 2001
1From bf93090747e3d23e5354bd8da52f85d96c0f6606 Mon Sep 17 00:00:00 2001
22From: Hauke Mehrtens <hauke@hauke-m.de>
33Date: Sun, 18 Jul 2010 12:49:41 +0200
44Subject: [PATCH 1/5] MIPS: BCM47xx: Really fix 128MB RAM problem
...... 
3333      * want to reuse the memory used by CFE (around 4MB). That means cfe_*
3434      * functions stop to work at some point during the boot, we should only
3535      * call them at the beginning of the boot.
36+ *
36+ *
3737+ * BCM47XX uses 128MB for addressing the ram, if the system contains
3838+ * less that that amount of ram it remaps the ram more often into the
3939+ * available space.
...... 
4545     for (mem = (1 << 20); mem < (128 << 20); mem += (1 << 20)) {
4646+ if (((unsigned long)(prom_init) + mem) > max) {
4747+ mem = (128 << 20);
48+ printk("assume 128MB RAM\n");
48+ printk(KERN_DEBUG "assume 128MB RAM\n");
4949+ break;
5050+ }
5151         if (*(unsigned long *)((unsigned long)(prom_init) + mem) ==
target/linux/brcm47xx/patches-2.6.34/012-MIPS-BCM47xx-Fill-more-values-into-ssb-sprom.patch
1From 493d4a90850509e5f09b4799d4fc234b734a9d30 Mon Sep 17 00:00:00 2001
1From f382c623892dad1c6a9ebc0e12d01fd45ee50db8 Mon Sep 17 00:00:00 2001
22From: Hauke Mehrtens <hauke@hauke-m.de>
33Date: Sun, 18 Jul 2010 13:34:32 +0200
44Subject: [PATCH 2/5] MIPS: BCM47xx: Fill more values into ssb sprom
...... 
1010
1111Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
1212---
13 arch/mips/bcm47xx/setup.c | 125 +++++++++++++++++++++++++++++++++------------
14 1 files changed, 92 insertions(+), 33 deletions(-)
13 arch/mips/bcm47xx/setup.c | 130 +++++++++++++++++++++++++++++++++-----------
14 1 files changed, 97 insertions(+), 33 deletions(-)
1515
1616--- a/arch/mips/bcm47xx/setup.c
1717+++ b/arch/mips/bcm47xx/setup.c
18@@ -74,6 +74,89 @@ static void str2eaddr(char *str, char *d
18@@ -74,6 +74,94 @@ static void str2eaddr(char *str, char *d
1919     }
2020 }
2121
2222+static void bcm47xx_fill_sprom(struct ssb_sprom *sprom)
2323+{
2424+ char buf[100];
25+ u64 boardflags;
25+ u32 boardflags;
2626+
2727+ memset(sprom, 0, sizeof(struct ssb_sprom));
2828+
...... 
9393+
9494+ if (nvram_getenv("boardflags", buf, sizeof(buf)) >= 0 ||
9595+ cfe_getenv("boardflags", buf, sizeof(buf)) >= 0)
96+ boardflags = simple_strtoll(buf, NULL, 0);
96+ boardflags = simple_strtoul(buf, NULL, 0);
9797+ if (boardflags) {
98+ sprom->boardflags_lo = (boardflags & 0x000000000000FFFFLLU);
99+ sprom->boardflags_hi = (boardflags & 0x00000000FFFF0000LLU) >> 16;
100+ sprom->boardflags2_lo = (boardflags & 0x0000FFFF00000000LLU) >> 32;
101+ sprom->boardflags2_hi = (boardflags & 0xFFFF000000000000LLU) >> 48;
98+ sprom->boardflags_lo = (boardflags & 0x0000FFFFU);
99+ sprom->boardflags_hi = (boardflags & 0xFFFF0000U) >> 16;
100+ }
101+ if (nvram_getenv("boardflags2", buf, sizeof(buf)) >= 0 ||
102+ cfe_getenv("boardflags2", buf, sizeof(buf)) >= 0)
103+ boardflags = simple_strtoul(buf, NULL, 0);
104+ if (boardflags) {
105+ sprom->boardflags2_lo = (boardflags & 0x0000FFFFU);
106+ sprom->boardflags2_hi = (boardflags & 0xFFFF0000U) >> 16;
102107+ }
103108+}
104109+
105110 static int bcm47xx_get_invariants(struct ssb_bus *bus,
106111                    struct ssb_init_invariants *iv)
107112 {
108@@ -82,43 +165,19 @@ static int bcm47xx_get_invariants(struct
113@@ -82,43 +170,19 @@ static int bcm47xx_get_invariants(struct
109114     /* Fill boardinfo structure */
110115     memset(&(iv->boardinfo), 0 , sizeof(struct ssb_boardinfo));
111116
target/linux/brcm47xx/patches-2.6.34/013-MIPS-BCM47xx-Activate-SSB_B43_PCI_BRIDGE-by-default.patch
1From 13f9cbc3c26be8071d33206dd931431e84e83068 Mon Sep 17 00:00:00 2001
1From e6feb5dc2c1bb28582fa3e1445f9d90114e39724 Mon Sep 17 00:00:00 2001
22From: Hauke Mehrtens <hauke@hauke-m.de>
33Date: Sun, 18 Jul 2010 13:58:09 +0200
44Subject: [PATCH 3/5] MIPS: BCM47xx: Activate SSB_B43_PCI_BRIDGE by default
target/linux/brcm47xx/patches-2.6.34/014-MIPS-BCM47xx-Setup-and-register-serial-early.patch
1From 09ebc2952d9d3df6b9c548d9943dc8bcffb87540 Mon Sep 17 00:00:00 2001
1From 3902bba103634d3256dac557020d7974f0d08aff Mon Sep 17 00:00:00 2001
22From: Hauke Mehrtens <hauke@hauke-m.de>
33Date: Sun, 18 Jul 2010 14:59:24 +0200
44Subject: [PATCH 4/5] MIPS: BCM47xx: Setup and register serial early
...... 
99Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
1010---
1111 arch/mips/Kconfig | 1 -
12 arch/mips/bcm47xx/setup.c | 36 +++++++++++++++++++++++++++++++++++-
13 2 files changed, 35 insertions(+), 2 deletions(-)
12 arch/mips/bcm47xx/setup.c | 37 ++++++++++++++++++++++++++++++++++++-
13 2 files changed, 36 insertions(+), 2 deletions(-)
1414
1515--- a/arch/mips/Kconfig
1616+++ b/arch/mips/Kconfig
...... 
3333 #include <asm/bootinfo.h>
3434 #include <asm/reboot.h>
3535 #include <asm/time.h>
36@@ -184,12 +186,44 @@ static int bcm47xx_get_invariants(struct
36@@ -189,12 +191,45 @@ static int bcm47xx_get_invariants(struct
3737
3838 void __init plat_mem_setup(void)
3939 {
...... 
5252+ if (!strncmp(buf, "console=ttyS1", 13)) {
5353+ struct ssb_serial_port port;
5454+
55+ printk("Swapping serial ports!\n");
55+ printk(KERN_DEBUG "Swapping serial ports!\n");
5656+ /* swap serial ports */
5757+ memcpy(&port, &mcore->serial_ports[0], sizeof(port));
58+ memcpy(&mcore->serial_ports[0], &mcore->serial_ports[1], sizeof(port));
58+ memcpy(&mcore->serial_ports[0], &mcore->serial_ports[1],
59+ sizeof(port));
5960+ memcpy(&mcore->serial_ports[1], &port, sizeof(port));
6061+ }
6162+
...... 
7576+
7677+ early_serial_setup(&s);
7778+ }
78+ printk("Serial init done.\n");
79+ printk(KERN_DEBUG "Serial init done.\n");
7980
8081     _machine_restart = bcm47xx_machine_restart;
8182     _machine_halt = bcm47xx_machine_halt;
target/linux/brcm47xx/patches-2.6.34/015-MIPS-BCM47xx-Remove-CFE-console.patch
1From 4863132bcb6c87152ea474297329048cc8516ad2 Mon Sep 17 00:00:00 2001
1From 83b4ed2d1789609565822335ea27026d46fbb477 Mon Sep 17 00:00:00 2001
22From: Hauke Mehrtens <hauke@hauke-m.de>
33Date: Sun, 18 Jul 2010 15:11:26 +0200
44Subject: [PATCH 5/5] MIPS: BCM47xx: Remove CFE console
target/linux/brcm47xx/patches-2.6.34/400-arch-bcm47xx.patch
3333+EXPORT_SYMBOL(nvram_get);
3434--- a/arch/mips/bcm47xx/setup.c
3535+++ b/arch/mips/bcm47xx/setup.c
36@@ -229,3 +229,20 @@ void __init plat_mem_setup(void)
36@@ -235,3 +235,20 @@ void __init plat_mem_setup(void)
3737     _machine_halt = bcm47xx_machine_halt;
3838     pm_power_off = bcm47xx_machine_halt;
3939 }
target/linux/brcm47xx/patches-2.6.35/011-MIPS-BCM47xx-Really-fix-128MB-RAM-problem.patch
1From cf731bb198bdaa4ce741536252ea99518887b721 Mon Sep 17 00:00:00 2001
1From bf93090747e3d23e5354bd8da52f85d96c0f6606 Mon Sep 17 00:00:00 2001
22From: Hauke Mehrtens <hauke@hauke-m.de>
33Date: Sun, 18 Jul 2010 12:49:41 +0200
44Subject: [PATCH 1/5] MIPS: BCM47xx: Really fix 128MB RAM problem
...... 
3333      * want to reuse the memory used by CFE (around 4MB). That means cfe_*
3434      * functions stop to work at some point during the boot, we should only
3535      * call them at the beginning of the boot.
36+ *
36+ *
3737+ * BCM47XX uses 128MB for addressing the ram, if the system contains
3838+ * less that that amount of ram it remaps the ram more often into the
3939+ * available space.
...... 
4545     for (mem = (1 << 20); mem < (128 << 20); mem += (1 << 20)) {
4646+ if (((unsigned long)(prom_init) + mem) > max) {
4747+ mem = (128 << 20);
48+ printk("assume 128MB RAM\n");
48+ printk(KERN_DEBUG "assume 128MB RAM\n");
4949+ break;
5050+ }
5151         if (*(unsigned long *)((unsigned long)(prom_init) + mem) ==
target/linux/brcm47xx/patches-2.6.35/012-MIPS-BCM47xx-Fill-more-values-into-ssb-sprom.patch
1From 493d4a90850509e5f09b4799d4fc234b734a9d30 Mon Sep 17 00:00:00 2001
1From f382c623892dad1c6a9ebc0e12d01fd45ee50db8 Mon Sep 17 00:00:00 2001
22From: Hauke Mehrtens <hauke@hauke-m.de>
33Date: Sun, 18 Jul 2010 13:34:32 +0200
44Subject: [PATCH 2/5] MIPS: BCM47xx: Fill more values into ssb sprom
...... 
1010
1111Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
1212---
13 arch/mips/bcm47xx/setup.c | 125 +++++++++++++++++++++++++++++++++------------
14 1 files changed, 92 insertions(+), 33 deletions(-)
13 arch/mips/bcm47xx/setup.c | 130 +++++++++++++++++++++++++++++++++-----------
14 1 files changed, 97 insertions(+), 33 deletions(-)
1515
1616--- a/arch/mips/bcm47xx/setup.c
1717+++ b/arch/mips/bcm47xx/setup.c
18@@ -74,6 +74,89 @@ static void str2eaddr(char *str, char *d
18@@ -74,6 +74,94 @@ static void str2eaddr(char *str, char *d
1919     }
2020 }
2121
2222+static void bcm47xx_fill_sprom(struct ssb_sprom *sprom)
2323+{
2424+ char buf[100];
25+ u64 boardflags;
25+ u32 boardflags;
2626+
2727+ memset(sprom, 0, sizeof(struct ssb_sprom));
2828+
...... 
9393+
9494+ if (nvram_getenv("boardflags", buf, sizeof(buf)) >= 0 ||
9595+ cfe_getenv("boardflags", buf, sizeof(buf)) >= 0)
96+ boardflags = simple_strtoll(buf, NULL, 0);
96+ boardflags = simple_strtoul(buf, NULL, 0);
9797+ if (boardflags) {
98+ sprom->boardflags_lo = (boardflags & 0x000000000000FFFFLLU);
99+ sprom->boardflags_hi = (boardflags & 0x00000000FFFF0000LLU) >> 16;
100+ sprom->boardflags2_lo = (boardflags & 0x0000FFFF00000000LLU) >> 32;
101+ sprom->boardflags2_hi = (boardflags & 0xFFFF000000000000LLU) >> 48;
98+ sprom->boardflags_lo = (boardflags & 0x0000FFFFU);
99+ sprom->boardflags_hi = (boardflags & 0xFFFF0000U) >> 16;
100+ }
101+ if (nvram_getenv("boardflags2", buf, sizeof(buf)) >= 0 ||
102+ cfe_getenv("boardflags2", buf, sizeof(buf)) >= 0)
103+ boardflags = simple_strtoul(buf, NULL, 0);
104+ if (boardflags) {
105+ sprom->boardflags2_lo = (boardflags & 0x0000FFFFU);
106+ sprom->boardflags2_hi = (boardflags & 0xFFFF0000U) >> 16;
102107+ }
103108+}
104109+
105110 static int bcm47xx_get_invariants(struct ssb_bus *bus,
106111                    struct ssb_init_invariants *iv)
107112 {
108@@ -82,43 +165,19 @@ static int bcm47xx_get_invariants(struct
113@@ -82,43 +170,19 @@ static int bcm47xx_get_invariants(struct
109114     /* Fill boardinfo structure */
110115     memset(&(iv->boardinfo), 0 , sizeof(struct ssb_boardinfo));
111116
target/linux/brcm47xx/patches-2.6.35/013-MIPS-BCM47xx-Activate-SSB_B43_PCI_BRIDGE-by-default.patch
1From 13f9cbc3c26be8071d33206dd931431e84e83068 Mon Sep 17 00:00:00 2001
1From e6feb5dc2c1bb28582fa3e1445f9d90114e39724 Mon Sep 17 00:00:00 2001
22From: Hauke Mehrtens <hauke@hauke-m.de>
33Date: Sun, 18 Jul 2010 13:58:09 +0200
44Subject: [PATCH 3/5] MIPS: BCM47xx: Activate SSB_B43_PCI_BRIDGE by default
target/linux/brcm47xx/patches-2.6.35/014-MIPS-BCM47xx-Setup-and-register-serial-early.patch
1From 09ebc2952d9d3df6b9c548d9943dc8bcffb87540 Mon Sep 17 00:00:00 2001
1From 3902bba103634d3256dac557020d7974f0d08aff Mon Sep 17 00:00:00 2001
22From: Hauke Mehrtens <hauke@hauke-m.de>
33Date: Sun, 18 Jul 2010 14:59:24 +0200
44Subject: [PATCH 4/5] MIPS: BCM47xx: Setup and register serial early
...... 
99Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
1010---
1111 arch/mips/Kconfig | 1 -
12 arch/mips/bcm47xx/setup.c | 36 +++++++++++++++++++++++++++++++++++-
13 2 files changed, 35 insertions(+), 2 deletions(-)
12 arch/mips/bcm47xx/setup.c | 37 ++++++++++++++++++++++++++++++++++++-
13 2 files changed, 36 insertions(+), 2 deletions(-)
1414
1515--- a/arch/mips/Kconfig
1616+++ b/arch/mips/Kconfig
...... 
3333 #include <asm/bootinfo.h>
3434 #include <asm/reboot.h>
3535 #include <asm/time.h>
36@@ -184,12 +186,44 @@ static int bcm47xx_get_invariants(struct
36@@ -189,12 +191,45 @@ static int bcm47xx_get_invariants(struct
3737
3838 void __init plat_mem_setup(void)
3939 {
...... 
5252+ if (!strncmp(buf, "console=ttyS1", 13)) {
5353+ struct ssb_serial_port port;
5454+
55+ printk("Swapping serial ports!\n");
55+ printk(KERN_DEBUG "Swapping serial ports!\n");
5656+ /* swap serial ports */
5757+ memcpy(&port, &mcore->serial_ports[0], sizeof(port));
58+ memcpy(&mcore->serial_ports[0], &mcore->serial_ports[1], sizeof(port));
58+ memcpy(&mcore->serial_ports[0], &mcore->serial_ports[1],
59+ sizeof(port));
5960+ memcpy(&mcore->serial_ports[1], &port, sizeof(port));
6061+ }
6162+
...... 
7576+
7677+ early_serial_setup(&s);
7778+ }
78+ printk("Serial init done.\n");
79+ printk(KERN_DEBUG "Serial init done.\n");
7980
8081     _machine_restart = bcm47xx_machine_restart;
8182     _machine_halt = bcm47xx_machine_halt;
target/linux/brcm47xx/patches-2.6.35/015-MIPS-BCM47xx-Remove-CFE-console.patch
1From 4863132bcb6c87152ea474297329048cc8516ad2 Mon Sep 17 00:00:00 2001
1From 83b4ed2d1789609565822335ea27026d46fbb477 Mon Sep 17 00:00:00 2001
22From: Hauke Mehrtens <hauke@hauke-m.de>
33Date: Sun, 18 Jul 2010 15:11:26 +0200
44Subject: [PATCH 5/5] MIPS: BCM47xx: Remove CFE console
target/linux/brcm47xx/patches-2.6.35/400-arch-bcm47xx.patch
3333+EXPORT_SYMBOL(nvram_get);
3434--- a/arch/mips/bcm47xx/setup.c
3535+++ b/arch/mips/bcm47xx/setup.c
36@@ -229,3 +229,20 @@ void __init plat_mem_setup(void)
36@@ -235,3 +235,20 @@ void __init plat_mem_setup(void)
3737     _machine_halt = bcm47xx_machine_halt;
3838     pm_power_off = bcm47xx_machine_halt;
3939 }

Archive Download the corresponding diff file



interactive