diff options
author | Aurelien Jarno <aurelien@aurel32.net> | 2007-09-25 09:40:12 -0400 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2007-10-11 18:46:02 -0400 |
commit | 1c0c13eb935c95fd2ca0b0aca6dd4860487fb242 (patch) | |
tree | a274a6e2e56f519900fb35c544ddf279f38ca8d6 /arch/mips/bcm47xx/setup.c | |
parent | ea202c632a52c4a83f1bd82d8d06bc8e04f2689a (diff) |
[MIPS] Add support for BCM47XX CPUs.
Note that the BCM4710 does not support the wait instruction, this
is not a mistake in the code.
It originally comes from the OpenWrt patches.
Cc: Michael Buesch <mb@bu3sch.de>
Cc: Felix Fietkau <nbd@openwrt.org>
Cc: Florian Schirmer <jolt@tuxbox.org>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch/mips/bcm47xx/setup.c')
-rw-r--r-- | arch/mips/bcm47xx/setup.c | 79 |
1 files changed, 79 insertions, 0 deletions
diff --git a/arch/mips/bcm47xx/setup.c b/arch/mips/bcm47xx/setup.c new file mode 100644 index 000000000000..dfc580aae958 --- /dev/null +++ b/arch/mips/bcm47xx/setup.c | |||
@@ -0,0 +1,79 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2004 Florian Schirmer <jolt@tuxbox.org> | ||
3 | * Copyright (C) 2005 Waldemar Brodkorb <wbx@openwrt.org> | ||
4 | * Copyright (C) 2006 Felix Fietkau <nbd@openwrt.org> | ||
5 | * Copyright (C) 2006 Michael Buesch <mb@bu3sch.de> | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or modify it | ||
8 | * under the terms of the GNU General Public License as published by the | ||
9 | * Free Software Foundation; either version 2 of the License, or (at your | ||
10 | * option) any later version. | ||
11 | * | ||
12 | * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED | ||
13 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF | ||
14 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN | ||
15 | * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, | ||
16 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | ||
17 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF | ||
18 | * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON | ||
19 | * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
20 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | ||
21 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
22 | * | ||
23 | * You should have received a copy of the GNU General Public License along | ||
24 | * with this program; if not, write to the Free Software Foundation, Inc., | ||
25 | * 675 Mass Ave, Cambridge, MA 02139, USA. | ||
26 | */ | ||
27 | |||
28 | #include <linux/types.h> | ||
29 | #include <linux/ssb/ssb.h> | ||
30 | #include <asm/reboot.h> | ||
31 | #include <asm/time.h> | ||
32 | #include <bcm47xx.h> | ||
33 | |||
34 | struct ssb_bus ssb_bcm47xx; | ||
35 | EXPORT_SYMBOL(ssb_bcm47xx); | ||
36 | |||
37 | static void bcm47xx_machine_restart(char *command) | ||
38 | { | ||
39 | printk(KERN_ALERT "Please stand by while rebooting the system...\n"); | ||
40 | local_irq_disable(); | ||
41 | /* Set the watchdog timer to reset immediately */ | ||
42 | ssb_chipco_watchdog_timer_set(&ssb_bcm47xx.chipco, 1); | ||
43 | while (1) | ||
44 | cpu_relax(); | ||
45 | } | ||
46 | |||
47 | static void bcm47xx_machine_halt(void) | ||
48 | { | ||
49 | /* Disable interrupts and watchdog and spin forever */ | ||
50 | local_irq_disable(); | ||
51 | ssb_chipco_watchdog_timer_set(&ssb_bcm47xx.chipco, 0); | ||
52 | while (1) | ||
53 | cpu_relax(); | ||
54 | } | ||
55 | |||
56 | static int bcm47xx_get_invariants(struct ssb_bus *bus, | ||
57 | struct ssb_init_invariants *iv) | ||
58 | { | ||
59 | /* TODO: fill ssb_init_invariants using boardtype/boardrev | ||
60 | * CFE environment variables. | ||
61 | */ | ||
62 | return 0; | ||
63 | } | ||
64 | |||
65 | void __init plat_mem_setup(void) | ||
66 | { | ||
67 | int err; | ||
68 | |||
69 | err = ssb_bus_ssbbus_register(&ssb_bcm47xx, SSB_ENUM_BASE, | ||
70 | bcm47xx_get_invariants); | ||
71 | if (err) | ||
72 | panic("Failed to initialize SSB bus (err %d)\n", err); | ||
73 | |||
74 | _machine_restart = bcm47xx_machine_restart; | ||
75 | _machine_halt = bcm47xx_machine_halt; | ||
76 | pm_power_off = bcm47xx_machine_halt; | ||
77 | board_time_init = bcm47xx_time_init; | ||
78 | } | ||
79 | |||