Update of /cvsroot/gc-linux/linux/arch/powerpc/platforms/embedded6xx
In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv5134/arch/powerpc/platforms/embedded6xx
Added Files:
wii.c wii_dev.c
Log Message:
Added wii platform, specifically.
The platform now:
- uses flipper-pic
- uses device tree for configuration settings
- populates platform devices from device tree instead of drivers
--- NEW FILE: wii_dev.c ---
/*
* arch/powerpc/platforms/embedded6xx/wii_dev.c
*
* Nintendo Wii platform device setup.
* Copyright (C) 2008 The GameCube Linux Team
* Copyright (C) 2008 Albert Herranz
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
*/
#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/of_platform.h>
#include <asm/machdep.h>
static struct of_device_id wii_of_bus[] = {
{ .compatible = "nintendo,hollywood", },
{ },
};
/*
*
*/
static int __init wii_device_probe(void)
{
struct device_node *np;
if (!machine_is(wii))
return 0;
of_platform_bus_probe(NULL, wii_of_bus, NULL);
np = of_find_compatible_node(NULL, NULL, "nintendo,mem2");
if (np) {
of_platform_device_create(np, NULL, NULL);
of_node_put(np);
}
return 0;
}
device_initcall(wii_device_probe);
--- NEW FILE: wii.c ---
/*
* arch/powerpc/platforms/embedded6xx/wii.c
*
* Nintendo Wii board-specific support
* Copyright (C) 2008 The GameCube Linux Team
* Copyright (C) 2008 Albert Herranz
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
*/
#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/irq.h>
#include <linux/seq_file.h>
#include <linux/kexec.h>
#include <asm/io.h>
#include <asm/machdep.h>
#include <asm/prom.h>
#include <asm/time.h>
#include <asm/starlet.h>
#include <asm/udbg.h>
#include "flipper-pic.h"
#include "usbgecko_udbg.h"
static void wii_restart(char *cmd)
{
starlet_stm_restart();
local_irq_disable();
/* spin until power button pressed */
for (;;)
cpu_relax();
}
static void wii_power_off(void)
{
starlet_stm_power_off();
local_irq_disable();
/* spin until power button pressed */
for (;;)
cpu_relax();
}
static void wii_halt(void)
{
wii_restart(NULL);
}
static void wii_show_cpuinfo(struct seq_file *m)
{
seq_printf(m, "vendor\t\t: IBM\n");
seq_printf(m, "machine\t\t: Nintendo Wii\n");
}
static void wii_setup_arch(void)
{
}
static void __init wii_init_early(void)
{
ug_udbg_init();
}
static int __init wii_probe(void)
{
unsigned long dt_root;
dt_root = of_get_flat_dt_root();
if (!of_flat_dt_is_compatible(dt_root, "nintendo,wii"))
return 0;
return 1;
}
#ifdef CONFIG_KEXEC
static void wii_shutdown(void)
{
/* currently not used */
}
static int wii_kexec_prepare(struct kimage *image)
{
return 0;
}
#endif /* CONFIG_KEXEC */
define_machine(wii) {
.name = "wii",
.probe = wii_probe,
.setup_arch = wii_setup_arch,
.init_early = wii_init_early,
.show_cpuinfo = wii_show_cpuinfo,
.restart = wii_restart,
.power_off = wii_power_off,
.halt = wii_halt,
.init_IRQ = flipper_pic_probe,
.get_irq = flipper_pic_get_irq,
.calibrate_decr = generic_calibrate_decr,
.progress = udbg_progress,
#ifdef CONFIG_KEXEC
.machine_shutdown = wii_shutdown,
.machine_kexec_prepare = wii_kexec_prepare,
.machine_kexec = default_machine_kexec,
#endif
};
|