~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/arch/powerpc/platforms/embedded6xx/gamecube.c

Version: ~ [ linux-5.4-rc7 ] ~ [ linux-5.3.11 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.84 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.154 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.201 ] ~ [ linux-4.8.17 ] ~ [ linux-4.7.10 ] ~ [ linux-4.6.7 ] ~ [ linux-4.5.7 ] ~ [ linux-4.4.201 ] ~ [ linux-4.3.6 ] ~ [ linux-4.2.8 ] ~ [ linux-4.1.52 ] ~ [ linux-4.0.9 ] ~ [ linux-3.19.8 ] ~ [ linux-3.18.140 ] ~ [ linux-3.17.8 ] ~ [ linux-3.16.77 ] ~ [ linux-3.15.10 ] ~ [ linux-3.14.79 ] ~ [ linux-3.13.11 ] ~ [ linux-3.12.74 ] ~ [ linux-3.11.10 ] ~ [ linux-3.10.108 ] ~ [ linux-3.9.11 ] ~ [ linux-3.8.13 ] ~ [ linux-3.7.10 ] ~ [ linux-3.6.11 ] ~ [ linux-3.5.7 ] ~ [ linux-3.4.113 ] ~ [ linux-3.3.8 ] ~ [ linux-3.2.102 ] ~ [ linux-3.1.10 ] ~ [ linux-3.0.101 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.5 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /*
  2  * arch/powerpc/platforms/embedded6xx/gamecube.c
  3  *
  4  * Nintendo GameCube board-specific support
  5  * Copyright (C) 2004-2009 The GameCube Linux Team
  6  * Copyright (C) 2007,2008,2009 Albert Herranz
  7  *
  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.
 12  *
 13  */
 14 
 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>
 21 
 22 #include <asm/io.h>
 23 #include <asm/machdep.h>
 24 #include <asm/prom.h>
 25 #include <asm/time.h>
 26 #include <asm/udbg.h>
 27 
 28 #include "flipper-pic.h"
 29 #include "usbgecko_udbg.h"
 30 
 31 
 32 static void __noreturn gamecube_spin(void)
 33 {
 34         /* spin until power button pressed */
 35         for (;;)
 36                 cpu_relax();
 37 }
 38 
 39 static void __noreturn gamecube_restart(char *cmd)
 40 {
 41         local_irq_disable();
 42         flipper_platform_reset();
 43         gamecube_spin();
 44 }
 45 
 46 static void gamecube_power_off(void)
 47 {
 48         local_irq_disable();
 49         gamecube_spin();
 50 }
 51 
 52 static void __noreturn gamecube_halt(void)
 53 {
 54         gamecube_restart(NULL);
 55 }
 56 
 57 static int __init gamecube_probe(void)
 58 {
 59         if (!of_machine_is_compatible("nintendo,gamecube"))
 60                 return 0;
 61 
 62         pm_power_off = gamecube_power_off;
 63 
 64         ug_udbg_init();
 65 
 66         return 1;
 67 }
 68 
 69 static void gamecube_shutdown(void)
 70 {
 71         flipper_quiesce();
 72 }
 73 
 74 define_machine(gamecube) {
 75         .name                   = "gamecube",
 76         .probe                  = gamecube_probe,
 77         .restart                = gamecube_restart,
 78         .halt                   = gamecube_halt,
 79         .init_IRQ               = flipper_pic_probe,
 80         .get_irq                = flipper_pic_get_irq,
 81         .calibrate_decr         = generic_calibrate_decr,
 82         .progress               = udbg_progress,
 83         .machine_shutdown       = gamecube_shutdown,
 84 };
 85 
 86 
 87 static const struct of_device_id gamecube_of_bus[] = {
 88         { .compatible = "nintendo,flipper", },
 89         { },
 90 };
 91 
 92 static int __init gamecube_device_probe(void)
 93 {
 94         if (!machine_is(gamecube))
 95                 return 0;
 96 
 97         of_platform_bus_probe(NULL, gamecube_of_bus, NULL);
 98         return 0;
 99 }
100 device_initcall(gamecube_device_probe);
101 
102 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | Wiki (Japanese) | Wiki (English) | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

osdn.jp