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 --- a/arch/mips/bcm963xx/setup.c
21 +++ b/arch/mips/bcm963xx/setup.c
23 #include <asm/bootinfo.h>
25 #include <asm/mach-bcm963xx/bootloaders.h>
26 +#include <asm/mach-bcm963xx/board.h>
28 extern void brcm_time_init(void);
29 extern int boot_loader_type;
31 _machine_halt = brcm_machine_halt;
32 pm_power_off = brcm_machine_halt;
34 - /* mpi initialization */
36 + /* BCM96345 has no MPI */
37 + if (!ISBCM(0x6345)) {
38 + /* mpi initialization */
42 --- a/arch/mips/bcm963xx/time.c
43 +++ b/arch/mips/bcm963xx/time.c
45 #include <6348_intr.h>
46 #include <bcm_map_part.h>
48 +#include <asm/mach-bcm963xx/board.h>
57 +#define BCM96345_CPU_CLOCK 140000000
58 void __init plat_time_init(void)
60 unsigned long cpu_clock;
62 - cpu_clock = calculateCpuSpeed();
63 + cpu_clock = ISBCM(0x6345) ? BCM96345_CPU_CLOCK : calculateCpuSpeed();
65 printk("CPU frequency %lu.%02lu MHz\n", cpu_clock / 1000000,
66 (cpu_clock % 1000000) * 100 / 1000000);
67 --- a/arch/mips/pci/pci-bcm96348.c
68 +++ b/arch/mips/pci/pci-bcm96348.c
70 #include <linux/kernel.h>
71 #include <linux/init.h>
73 +#include <asm/mach-bcm963xx/6348_map_part.h>
74 +#include <asm/mach-bcm963xx/board.h>
77 static struct resource bcm_pci_io_resource = {
80 static __init int bcm96348_pci_init(void)
82 - /* Avoid ISA compat ranges. */
83 - PCIBIOS_MIN_IO = 0x00000000;
84 - PCIBIOS_MIN_MEM = 0x00000000;
86 - /* Set I/O resource limits. */
87 - ioport_resource.end = 0x1fffffff;
88 - iomem_resource.end = 0xffffffff;
89 + if (!ISBCM(0x6345)) {
90 + /* Avoid ISA compat ranges. */
91 + PCIBIOS_MIN_IO = 0x00000000;
92 + PCIBIOS_MIN_MEM = 0x00000000;
94 + /* Set I/O resource limits. */
95 + ioport_resource.end = 0x1fffffff;
96 + iomem_resource.end = 0xffffffff;
98 - register_pci_controller(&bcm96348_controller);
100 + register_pci_controller(&bcm96348_controller);
106 arch_initcall(bcm96348_pci_init);
107 --- a/include/asm-mips/mach-bcm963xx/board.h
108 +++ b/include/asm-mips/mach-bcm963xx/board.h
111 extern int boot_loader_type;
113 +#define ISBCM(x) (((PERF->RevID & 0xFFFF0000) >> 16) == x)
115 #endif /* _BOARD_H */