1 From d1259cf42ce84246c695f06b44d58e3aca0a480b Mon Sep 17 00:00:00 2001
2 From: Axel Gembe <ago@bastart.eu.org>
3 Date: Sat, 17 May 2008 14:59:35 +0200
4 Subject: [PATCH] bcm96345: correct some 6345 specific stuff
6 This fixes some problems with the 6345 support and adds a macro for CPU
7 identification that is easier on the eyes. The first thing it does is to not
8 initialize MPI on the 6345 as it does not have PCI. The second thing it does is
9 to use a static value for the CPU frequency of the 6345 chip to provide an
12 Signed-off-by: Axel Gembe <ago@bastart.eu.org>
14 arch/mips/bcm963xx/setup.c | 8 ++++++--
15 arch/mips/bcm963xx/time.c | 5 ++++-
16 arch/mips/pci/pci-bcm96348.c | 21 +++++++++++++--------
17 include/asm-mips/mach-bcm963xx/board.h | 2 ++
18 4 files changed, 25 insertions(+), 11 deletions(-)
20 Index: linux-2.6.25.4/arch/mips/bcm963xx/setup.c
21 ===================================================================
22 --- linux-2.6.25.4.orig/arch/mips/bcm963xx/setup.c
23 +++ linux-2.6.25.4/arch/mips/bcm963xx/setup.c
25 #include <asm/bootinfo.h>
27 #include <asm/mach-bcm963xx/bootloaders.h>
28 +#include <asm/mach-bcm963xx/board.h>
30 extern void brcm_time_init(void);
31 extern int boot_loader_type;
32 @@ -465,6 +466,9 @@ void __init plat_mem_setup(void)
33 _machine_halt = brcm_machine_halt;
34 pm_power_off = brcm_machine_halt;
36 - /* mpi initialization */
38 + /* BCM96345 has no MPI */
39 + if (!ISBCM(0x6345)) {
40 + /* mpi initialization */
44 Index: linux-2.6.25.4/arch/mips/bcm963xx/time.c
45 ===================================================================
46 --- linux-2.6.25.4.orig/arch/mips/bcm963xx/time.c
47 +++ linux-2.6.25.4/arch/mips/bcm963xx/time.c
49 #include <6348_intr.h>
50 #include <bcm_map_part.h>
52 +#include <asm/mach-bcm963xx/board.h>
57 @@ -63,11 +65,12 @@ static inline unsigned long __init calcu
61 +#define BCM96345_CPU_CLOCK 140000000
62 void __init plat_time_init(void)
64 unsigned long cpu_clock;
66 - cpu_clock = calculateCpuSpeed();
67 + cpu_clock = ISBCM(0x6345) ? BCM96345_CPU_CLOCK : calculateCpuSpeed();
69 printk("CPU frequency %lu.%02lu MHz\n", cpu_clock / 1000000,
70 (cpu_clock % 1000000) * 100 / 1000000);
71 Index: linux-2.6.25.4/arch/mips/pci/pci-bcm96348.c
72 ===================================================================
73 --- linux-2.6.25.4.orig/arch/mips/pci/pci-bcm96348.c
74 +++ linux-2.6.25.4/arch/mips/pci/pci-bcm96348.c
76 #include <linux/kernel.h>
77 #include <linux/init.h>
79 +#include <asm/mach-bcm963xx/6348_map_part.h>
80 +#include <asm/mach-bcm963xx/board.h>
83 static struct resource bcm_pci_io_resource = {
84 @@ -47,16 +49,19 @@ struct pci_controller bcm96348_controlle
86 static __init int bcm96348_pci_init(void)
88 - /* Avoid ISA compat ranges. */
89 - PCIBIOS_MIN_IO = 0x00000000;
90 - PCIBIOS_MIN_MEM = 0x00000000;
92 - /* Set I/O resource limits. */
93 - ioport_resource.end = 0x1fffffff;
94 - iomem_resource.end = 0xffffffff;
95 + if (!ISBCM(0x6345)) {
96 + /* Avoid ISA compat ranges. */
97 + PCIBIOS_MIN_IO = 0x00000000;
98 + PCIBIOS_MIN_MEM = 0x00000000;
100 + /* Set I/O resource limits. */
101 + ioport_resource.end = 0x1fffffff;
102 + iomem_resource.end = 0xffffffff;
104 - register_pci_controller(&bcm96348_controller);
106 + register_pci_controller(&bcm96348_controller);
112 arch_initcall(bcm96348_pci_init);
113 Index: linux-2.6.25.4/include/asm-mips/mach-bcm963xx/board.h
114 ===================================================================
115 --- linux-2.6.25.4.orig/include/asm-mips/mach-bcm963xx/board.h
116 +++ linux-2.6.25.4/include/asm-mips/mach-bcm963xx/board.h
117 @@ -369,5 +369,7 @@ void kerSysWakeupMonitorTask( void );
119 extern int boot_loader_type;
121 +#define ISBCM(x) (((PERF->RevID & 0xFFFF0000) >> 16) == x)
123 #endif /* _BOARD_H */