2008-05-18 17:32:16 +00:00
|
|
|
From d1259cf42ce84246c695f06b44d58e3aca0a480b Mon Sep 17 00:00:00 2001
|
|
|
|
From: Axel Gembe <ago@bastart.eu.org>
|
|
|
|
Date: Sat, 17 May 2008 14:59:35 +0200
|
|
|
|
Subject: [PATCH] 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 <ago@bastart.eu.org>
|
|
|
|
---
|
|
|
|
arch/mips/bcm963xx/setup.c | 8 ++++++--
|
|
|
|
arch/mips/bcm963xx/time.c | 5 ++++-
|
|
|
|
arch/mips/pci/pci-bcm96348.c | 21 +++++++++++++--------
|
|
|
|
include/asm-mips/mach-bcm963xx/board.h | 2 ++
|
|
|
|
4 files changed, 25 insertions(+), 11 deletions(-)
|
|
|
|
|
2008-06-17 12:57:04 +00:00
|
|
|
--- a/arch/mips/bcm963xx/setup.c
|
|
|
|
+++ b/arch/mips/bcm963xx/setup.c
|
2008-05-18 17:32:16 +00:00
|
|
|
@@ -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;
|
2008-06-17 12:57:04 +00:00
|
|
|
@@ -465,6 +466,9 @@
|
2008-05-18 17:32:16 +00:00
|
|
|
_machine_halt = brcm_machine_halt;
|
|
|
|
pm_power_off = brcm_machine_halt;
|
|
|
|
|
|
|
|
- /* mpi initialization */
|
|
|
|
- mpi_init();
|
|
|
|
+ /* BCM96345 has no MPI */
|
|
|
|
+ if (!ISBCM(0x6345)) {
|
|
|
|
+ /* mpi initialization */
|
|
|
|
+ mpi_init();
|
|
|
|
+ }
|
|
|
|
}
|
2008-06-17 12:57:04 +00:00
|
|
|
--- a/arch/mips/bcm963xx/time.c
|
|
|
|
+++ b/arch/mips/bcm963xx/time.c
|
2008-05-19 08:33:22 +00:00
|
|
|
@@ -40,6 +40,8 @@
|
2008-05-18 17:32:16 +00:00
|
|
|
#include <6348_intr.h>
|
|
|
|
#include <bcm_map_part.h>
|
|
|
|
#include <bcm_intr.h>
|
|
|
|
+#include <asm/mach-bcm963xx/board.h>
|
|
|
|
+
|
|
|
|
|
|
|
|
/*
|
|
|
|
* calculateCpuSpeed()
|
2008-06-17 12:57:04 +00:00
|
|
|
@@ -63,11 +65,12 @@
|
2008-05-18 17:32:16 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
+#define BCM96345_CPU_CLOCK 140000000
|
|
|
|
void __init plat_time_init(void)
|
|
|
|
{
|
|
|
|
unsigned long cpu_clock;
|
|
|
|
|
|
|
|
- cpu_clock = calculateCpuSpeed();
|
|
|
|
+ cpu_clock = ISBCM(0x6345) ? BCM96345_CPU_CLOCK : calculateCpuSpeed();
|
|
|
|
|
|
|
|
printk("CPU frequency %lu.%02lu MHz\n", cpu_clock / 1000000,
|
|
|
|
(cpu_clock % 1000000) * 100 / 1000000);
|
2008-06-17 12:57:04 +00:00
|
|
|
--- a/arch/mips/pci/pci-bcm96348.c
|
|
|
|
+++ b/arch/mips/pci/pci-bcm96348.c
|
2008-05-18 17:32:16 +00:00
|
|
|
@@ -21,6 +21,8 @@
|
|
|
|
#include <linux/kernel.h>
|
|
|
|
#include <linux/init.h>
|
|
|
|
|
|
|
|
+#include <asm/mach-bcm963xx/6348_map_part.h>
|
|
|
|
+#include <asm/mach-bcm963xx/board.h>
|
|
|
|
#include <bcmpci.h>
|
|
|
|
|
|
|
|
static struct resource bcm_pci_io_resource = {
|
2008-06-17 12:57:04 +00:00
|
|
|
@@ -47,16 +49,19 @@
|
2008-05-18 17:32:16 +00:00
|
|
|
|
|
|
|
static __init int bcm96348_pci_init(void)
|
|
|
|
{
|
|
|
|
- /* Avoid ISA compat ranges. */
|
|
|
|
- PCIBIOS_MIN_IO = 0x00000000;
|
|
|
|
- PCIBIOS_MIN_MEM = 0x00000000;
|
2008-05-19 08:33:22 +00:00
|
|
|
-
|
|
|
|
- /* Set I/O resource limits. */
|
|
|
|
- ioport_resource.end = 0x1fffffff;
|
|
|
|
- iomem_resource.end = 0xffffffff;
|
2008-05-18 17:32:16 +00:00
|
|
|
+ if (!ISBCM(0x6345)) {
|
|
|
|
+ /* Avoid ISA compat ranges. */
|
|
|
|
+ PCIBIOS_MIN_IO = 0x00000000;
|
|
|
|
+ PCIBIOS_MIN_MEM = 0x00000000;
|
2008-05-19 08:33:22 +00:00
|
|
|
+
|
2008-05-18 17:32:16 +00:00
|
|
|
+ /* Set I/O resource limits. */
|
|
|
|
+ ioport_resource.end = 0x1fffffff;
|
|
|
|
+ iomem_resource.end = 0xffffffff;
|
|
|
|
|
|
|
|
- register_pci_controller(&bcm96348_controller);
|
|
|
|
- return 0;
|
|
|
|
+ register_pci_controller(&bcm96348_controller);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
arch_initcall(bcm96348_pci_init);
|
2008-06-17 12:57:04 +00:00
|
|
|
--- a/include/asm-mips/mach-bcm963xx/board.h
|
|
|
|
+++ b/include/asm-mips/mach-bcm963xx/board.h
|
|
|
|
@@ -369,5 +369,7 @@
|
2008-05-18 17:32:16 +00:00
|
|
|
|
|
|
|
extern int boot_loader_type;
|
|
|
|
|
|
|
|
+#define ISBCM(x) (((PERF->RevID & 0xFFFF0000) >> 16) == x)
|
|
|
|
+
|
|
|
|
#endif /* _BOARD_H */
|
|
|
|
|