2 * arch/powerpc/platforms/embedded6xx/gamecube.c
4 * Nintendo GameCube board-specific support
5 * Copyright (C) 2004-2009 The GameCube Linux Team
6 * Copyright (C) 2007,2008,2009 Albert Herranz
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License
10 * as published by the Free Software Foundation; either version 2
11 * of the License, or (at your option) any later version.
15 #include <linux/kernel.h>
16 #include <linux/init.h>
17 #include <linux/irq.h>
18 #include <linux/kexec.h>
19 #include <linux/seq_file.h>
20 #include <linux/of_platform.h>
23 #include <asm/machdep.h>
28 #include "flipper-pic.h"
29 #include "usbgecko_udbg.h"
32 static void gamecube_spin(void)
34 /* spin until power button pressed */
39 static void gamecube_restart(char *cmd
)
42 flipper_platform_reset();
46 static void gamecube_power_off(void)
52 static void gamecube_halt(void)
54 gamecube_restart(NULL
);
57 static void __init
gamecube_init_early(void)
62 static int __init
gamecube_probe(void)
64 unsigned long dt_root
;
66 dt_root
= of_get_flat_dt_root();
67 if (!of_flat_dt_is_compatible(dt_root
, "nintendo,gamecube"))
70 pm_power_off
= gamecube_power_off
;
75 static void gamecube_shutdown(void)
80 define_machine(gamecube
) {
82 .probe
= gamecube_probe
,
83 .init_early
= gamecube_init_early
,
84 .restart
= gamecube_restart
,
85 .halt
= gamecube_halt
,
86 .init_IRQ
= flipper_pic_probe
,
87 .get_irq
= flipper_pic_get_irq
,
88 .calibrate_decr
= generic_calibrate_decr
,
89 .progress
= udbg_progress
,
90 .machine_shutdown
= gamecube_shutdown
,
94 static const struct of_device_id gamecube_of_bus
[] = {
95 { .compatible
= "nintendo,flipper", },
99 static int __init
gamecube_device_probe(void)
101 if (!machine_is(gamecube
))
104 of_platform_bus_probe(NULL
, gamecube_of_bus
, NULL
);
107 device_initcall(gamecube_device_probe
);