This fixes some problems with the 6345 support and adds a macro for CPU
identification that is easier on the eyes. The first thing it does is to not
initialize MPI on the 6345 as it does not have PCI. The second thing it does is
to use a static value for the CPU frequency of the 6345 chip to provide an
accurate timer.
Signed-off-by: Axel Gembe <[EMAIL PROTECTED]>
---
.../linux/brcm63xx/patches/080-bcm96345_fix.patch | 88 ++++++++++++++++++++
1 files changed, 88 insertions(+), 0 deletions(-)
create mode 100644 target/linux/brcm63xx/patches/080-bcm96345_fix.patch
diff --git a/target/linux/brcm63xx/patches/080-bcm96345_fix.patch
b/target/linux/brcm63xx/patches/080-bcm96345_fix.patch
new file mode 100644
index 0000000..6736944
--- /dev/null
+++ b/target/linux/brcm63xx/patches/080-bcm96345_fix.patch
@@ -0,0 +1,88 @@
+From 27d68dc406dcd2fe7f211deb10e1fb47fefc6060 Mon Sep 17 00:00:00 2001
+From: Axel Gembe <[EMAIL PROTECTED]>
+Date: Wed, 14 May 2008 00:28:42 +0200
+Subject: [PATCH 7/8] bcm96345: correct some 6345 specific stuff
+
+This fixes some problems with the 6345 support and adds a macro for CPU
+identification that is easier on the eyes. The first thing it does is to not
+initialize MPI on the 6345 as it does not have PCI. The second thing it does is
+to use a static value for the CPU frequency of the 6345 chip to provide an
+accurate timer.
+
+Signed-off-by: Axel Gembe <[EMAIL PROTECTED]>
+---
+ arch/mips/bcm963xx/setup.c | 7 +++++++
+ arch/mips/bcm963xx/time.c | 10 +++++++++-
+ include/asm-mips/mach-bcm963xx/board.h | 2 ++
+ 3 files changed, 18 insertions(+), 1 deletions(-)
+
+diff --git a/arch/mips/bcm963xx/setup.c b/arch/mips/bcm963xx/setup.c
+index 5847278..f2ec854 100644
+--- a/arch/mips/bcm963xx/setup.c
++++ b/arch/mips/bcm963xx/setup.c
+@@ -43,6 +43,7 @@
+ #include <asm/bootinfo.h>
+ #include <asm/cpu.h>
+ #include <asm/mach-bcm963xx/bootloaders.h>
++#include <asm/mach-bcm963xx/board.h>
+
+ extern void brcm_time_init(void);
+ extern int boot_loader_type;
+@@ -380,6 +381,12 @@ static int mpi_init(void)
+ chipid = (PERF->RevID & 0xFFFF0000) >> 16;
+ chiprev = (PERF->RevID & 0xFF);
+
++ /* BCM96345 has no MPI */
++ if (ISBCM(0x6345))
++ return 0;
++
++ printk("Broadcom BCM963xx MPI\n");
++
+ if (boot_loader_type == BOOT_LOADER_CFE)
+ sdramsize = boot_mem_map.map[0].size;
+ else
+diff --git a/arch/mips/bcm963xx/time.c b/arch/mips/bcm963xx/time.c
+index 06a5f8c..72926d9 100644
+--- a/arch/mips/bcm963xx/time.c
++++ b/arch/mips/bcm963xx/time.c
+@@ -35,6 +35,8 @@
+ #include <asm/div64.h>
+ #include <asm/time.h>
+
++#include <asm/mach-bcm963xx/board.h>
++
+ #include <6348_map_part.h>
+ #include <6348_intr.h>
+ #include <bcm_map_part.h>
+@@ -65,9 +67,15 @@ static inline unsigned long __init calculateCpuSpeed(void)
+ }
+
+
++#define BCM96345_CPU_CLOCK 140000000
+ static inline unsigned long __init cal_r4koff(void)
+ {
+- mips_hpt_frequency = calculateCpuSpeed() / 2;
++ if (ISBCM(0x6345)) {
++ mips_hpt_frequency = BCM96345_CPU_CLOCK / 2;
++ } else {
++ mips_hpt_frequency = calculateCpuSpeed() / 2;
++ }
++
+ return (mips_hpt_frequency / HZ);
+ }
+
+diff --git a/include/asm-mips/mach-bcm963xx/board.h
b/include/asm-mips/mach-bcm963xx/board.h
+index e674cb1..73fa924 100644
+--- a/include/asm-mips/mach-bcm963xx/board.h
++++ b/include/asm-mips/mach-bcm963xx/board.h
+@@ -369,5 +369,7 @@ void kerSysWakeupMonitorTask( void );
+
+ extern int boot_loader_type;
+
++#define ISBCM(x) (((PERF->RevID & 0xFFFF0000) >> 16) == x)
++
+ #endif /* _BOARD_H */
+
+--
+1.5.5.1
+
--
1.5.5.1
_______________________________________________
openwrt-devel mailing list
[email protected]
http://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel