From: Albert H. <he...@us...> - 2009-10-25 18:50:37
|
Update of /cvsroot/gc-linux/linux/arch/powerpc/platforms/embedded6xx In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv31074/arch/powerpc/platforms/embedded6xx Modified Files: Kconfig Makefile starlet-es.c starlet-gpio.c starlet-ipc.c starlet-malloc.c starlet-stm.c usbgecko_udbg.c wii.c wii_dev.c Added Files: hollywood-pic.c hollywood-pic.h starlet-mipc.c Log Message: Merge gc-linux-v2.6.30. --- NEW FILE: hollywood-pic.h --- /* * arch/powerpc/platforms/embedded6xx/hollywood-pic.h * * Nintendo Wii "hollywood" interrupt controller support. * Copyright (C) 2009 The GameCube Linux Team * Copyright (C) 2009 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. * */ #ifndef __HOLLYWOOD_PIC_H #define __HOLLYWOOD_PIC_H extern unsigned int hollywood_pic_get_irq(void); extern void hollywood_pic_probe(void); extern void hollywood_quiesce(void); #endif Index: starlet-stm.c =================================================================== RCS file: /cvsroot/gc-linux/linux/arch/powerpc/platforms/embedded6xx/starlet-stm.c,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** starlet-stm.c 28 Mar 2009 20:44:19 -0000 1.6 --- starlet-stm.c 25 Oct 2009 18:50:27 -0000 1.7 *************** *** 17,21 **** #include <linux/kernel.h> #include <linux/dma-mapping.h> ! #include <asm/starlet.h> --- 17,21 ---- #include <linux/kernel.h> #include <linux/dma-mapping.h> ! #include <asm/starlet-ios.h> *************** *** 77,81 **** } else { halt: ! for(;;) cpu_relax(); } --- 77,81 ---- } else { halt: ! for (;;) cpu_relax(); } Index: starlet-es.c =================================================================== RCS file: /cvsroot/gc-linux/linux/arch/powerpc/platforms/embedded6xx/starlet-es.c,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** starlet-es.c 28 Mar 2009 20:44:19 -0000 1.6 --- starlet-es.c 25 Oct 2009 18:50:27 -0000 1.7 *************** *** 2,6 **** * arch/powerpc/platforms/embedded6xx/starlet-es.c * ! * Nintendo Wii starlet ES routines * Copyright (C) 2008-2009 The GameCube Linux Team * Copyright (C) 2008,2009 Albert Herranz --- 2,6 ---- * arch/powerpc/platforms/embedded6xx/starlet-es.c * ! * Nintendo Wii starlet ES driver * Copyright (C) 2008-2009 The GameCube Linux Team * Copyright (C) 2008,2009 Albert Herranz *************** *** 19,22 **** --- 19,23 ---- #include <linux/scatterlist.h> #include <asm/starlet.h> + #include <asm/starlet-ios.h> #define DRV_MODULE_NAME "starlet-es" *************** *** 24,28 **** #define DRV_AUTHOR "Albert Herranz" ! static const char starlet_es_driver_version[] = "0.2i"; #define DBG(fmt, arg...) pr_debug(fmt, ##arg) --- 25,29 ---- #define DRV_AUTHOR "Albert Herranz" ! static const char starlet_es_driver_version[] = "0.3i"; #define DBG(fmt, arg...) pr_debug(fmt, ##arg) *************** *** 586,589 **** --- 587,593 ---- int retval; + if (starlet_get_ipc_flavour() != STARLET_IPC_IOS) + return -ENODEV; + es_dev = kzalloc(sizeof(*es_dev), GFP_KERNEL); if (!es_dev) { *************** *** 632,636 **** static struct of_device_id starlet_es_of_match[] = { ! { .compatible = "nintendo,starlet-es" }, { }, }; --- 636,640 ---- static struct of_device_id starlet_es_of_match[] = { ! { .compatible = "nintendo,starlet-ios-es" }, { }, }; --- NEW FILE: hollywood-pic.c --- /* * arch/powerpc/platforms/embedded6xx/hollywood-pic.c * * Nintendo Wii "hollywood" interrupt controller support. * Copyright (C) 2009 The GameCube Linux Team * Copyright (C) 2009 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/of.h> #include <asm/io.h> #include <asm/starlet-mini.h> #include "hollywood-pic.h" #define DRV_MODULE_NAME "hollywood-pic" #define drv_printk(level, format, arg...) \ printk(level DRV_MODULE_NAME ": " format , ## arg) #define HOLLYWOOD_NR_IRQS 32 /* * Each interrupt has a corresponding bit in both * the Interrupt Cause (ICR) and Interrupt Mask (IMR) registers. * * Enabling/disabling an interrupt line involves asserting/clearing * the corresponding bit in IMR. ACK'ing a request simply involves * asserting the corresponding bit in ICR. */ #define HW_BROADWAY_ICR 0x00 #define HW_BROADWAY_IMR 0x04 /* * IRQ chip hooks. * */ static void hollywood_pic_mask_and_ack(unsigned int virq) { int irq = virq_to_hw(virq); void __iomem *io_base = get_irq_chip_data(virq); mipc_clear_bit(irq, io_base + HW_BROADWAY_IMR); mipc_set_bit(irq, io_base + HW_BROADWAY_ICR); mipc_wmb(); } static void hollywood_pic_ack(unsigned int virq) { int irq = virq_to_hw(virq); void __iomem *io_base = get_irq_chip_data(virq); mipc_set_bit(irq, io_base + HW_BROADWAY_ICR); mipc_wmb(); } static void hollywood_pic_mask(unsigned int virq) { int irq = virq_to_hw(virq); void __iomem *io_base = get_irq_chip_data(virq); mipc_clear_bit(irq, io_base + HW_BROADWAY_IMR); mipc_wmb(); } static void hollywood_pic_unmask(unsigned int virq) { int irq = virq_to_hw(virq); void __iomem *io_base = get_irq_chip_data(virq); mipc_set_bit(irq, io_base + HW_BROADWAY_IMR); mipc_wmb(); } static struct irq_chip hollywood_pic = { .typename = "hollywood-pic", .ack = hollywood_pic_ack, .mask_ack = hollywood_pic_mask_and_ack, .mask = hollywood_pic_mask, .unmask = hollywood_pic_unmask, }; /* * IRQ host hooks. * */ static struct irq_host *hollywood_irq_host; static int hollywood_pic_map(struct irq_host *h, unsigned int virq, irq_hw_number_t hwirq) { set_irq_chip_data(virq, h->host_data); set_irq_chip_and_handler(virq, &hollywood_pic, handle_level_irq); return 0; } static void hollywood_pic_unmap(struct irq_host *h, unsigned int irq) { set_irq_chip_data(irq, NULL); set_irq_chip(irq, NULL); } static struct irq_host_ops hollywood_irq_host_ops = { .map = hollywood_pic_map, .unmap = hollywood_pic_unmap, }; static unsigned int __hollywood_pic_get_irq(struct irq_host *h) { void __iomem *io_base = h->host_data; int irq; u32 irq_status; irq_status = mipc_in_be32(io_base + HW_BROADWAY_ICR) & mipc_in_be32(io_base + HW_BROADWAY_IMR); if (irq_status == 0) return NO_IRQ_IGNORE; /* no more IRQs pending */ __asm__ __volatile__("cntlzw %0,%1" : "=r"(irq) : "r"(irq_status)); return irq_linear_revmap(h, 31 - irq); } static void hollywood_pic_irq_cascade(unsigned int cascade_virq, struct irq_desc *desc) { struct irq_host *irq_host = get_irq_data(cascade_virq); unsigned int virq; spin_lock(&desc->lock); desc->chip->mask(cascade_virq); /* IRQ_LEVEL */ spin_unlock(&desc->lock); virq = __hollywood_pic_get_irq(irq_host); if (virq != NO_IRQ_IGNORE) generic_handle_irq(virq); else drv_printk(KERN_ERR, "spurious interrupt!\n"); spin_lock(&desc->lock); desc->chip->ack(cascade_virq); /* IRQ_LEVEL */ if (!(desc->status & IRQ_DISABLED) && desc->chip->unmask) desc->chip->unmask(cascade_virq); spin_unlock(&desc->lock); } /* * Platform hooks. * */ static void __hollywood_quiesce(void __iomem *io_base) { /* mask and ack all IRQs */ mipc_out_be32(io_base + HW_BROADWAY_IMR, 0); mipc_out_be32(io_base + HW_BROADWAY_ICR, ~0); mipc_wmb(); } struct irq_host *hollywood_pic_init(struct device_node *np) { struct irq_host *irq_host; struct resource res; void __iomem *io_base; int retval; retval = of_address_to_resource(np, 0, &res); if (retval) { drv_printk(KERN_ERR, "no io memory range found\n"); return NULL; } io_base = mipc_ioremap(res.start, resource_size(&res)); if (!io_base) { drv_printk(KERN_ERR, "ioremap failed\n"); return NULL; } drv_printk(KERN_INFO, "controller at 0x%p\n", io_base); __hollywood_quiesce(io_base); irq_host = irq_alloc_host(np, IRQ_HOST_MAP_LINEAR, HOLLYWOOD_NR_IRQS, &hollywood_irq_host_ops, NO_IRQ_IGNORE); if (!irq_host) { drv_printk(KERN_ERR, "failed to allocate irq_host\n"); return NULL; } irq_host->host_data = io_base; return irq_host; } unsigned int hollywood_pic_get_irq(void) { return __hollywood_pic_get_irq(hollywood_irq_host); } /* * Probe function. * */ void hollywood_pic_probe(void) { struct irq_host *host; struct device_node *np; const u32 *interrupts; int cascade_virq; for_each_compatible_node(np, NULL, "nintendo,hollywood-pic") { interrupts = of_get_property(np, "interrupts", NULL); if (interrupts) { host = hollywood_pic_init(np); BUG_ON(!host); cascade_virq = irq_of_parse_and_map(np, 0); set_irq_data(cascade_virq, host); set_irq_chained_handler(cascade_virq, hollywood_pic_irq_cascade); } } } /** * hollywood_quiesce() - quiesce hollywood irq controller * * Mask and ack all interrupt sources. * */ void hollywood_quiesce(void) { void __iomem *io_base = hollywood_irq_host->host_data; __hollywood_quiesce(io_base); } Index: Makefile =================================================================== RCS file: /cvsroot/gc-linux/linux/arch/powerpc/platforms/embedded6xx/Makefile,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** Makefile 25 Oct 2009 18:33:46 -0000 1.9 --- Makefile 25 Oct 2009 18:50:27 -0000 1.10 *************** *** 8,9 **** --- 8,20 ---- obj-$(CONFIG_PPC_PRPMC2800) += prpmc2800.o obj-$(CONFIG_PPC_C2K) += c2k.o + obj-$(CONFIG_GAMECUBE) += gamecube.o gamecube_dev.o + obj-$(CONFIG_WII) += wii.o wii_dev.o + obj-$(CONFIG_WII_GPIO) += starlet-gpio.o + obj-$(CONFIG_STARLET_MINI) += starlet-mipc.o + obj-$(CONFIG_STARLET_IOS) += starlet-ipc.o starlet-malloc.o \ + starlet-stm.o starlet-es.o + obj-$(CONFIG_FLIPPER_PIC) += flipper-pic.o + obj-$(CONFIG_HOLLYWOOD_PIC) += hollywood-pic.o + obj-$(CONFIG_USBGECKO_UDBG) += usbgecko_udbg.o + obj-$(CONFIG_GAMECUBE_VIDEO_UDBG) += gcnvi_udbg.o + obj-$(CONFIG_GAMECUBE_RSW) += gcn-rsw.o Index: starlet-malloc.c =================================================================== RCS file: /cvsroot/gc-linux/linux/arch/powerpc/platforms/embedded6xx/starlet-malloc.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** starlet-malloc.c 1 Feb 2009 18:29:35 -0000 1.2 --- starlet-malloc.c 25 Oct 2009 18:50:27 -0000 1.3 *************** *** 35,39 **** #include <linux/kernel.h> #include <linux/resource.h> ! #include <asm/starlet.h> --- 35,39 ---- #include <linux/kernel.h> #include <linux/resource.h> ! #include <asm/starlet-ios.h> Index: starlet-gpio.c =================================================================== RCS file: /cvsroot/gc-linux/linux/arch/powerpc/platforms/embedded6xx/starlet-gpio.c,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** starlet-gpio.c 2 Mar 2009 18:54:57 -0000 1.4 --- starlet-gpio.c 25 Oct 2009 18:50:27 -0000 1.5 *************** *** 19,22 **** --- 19,28 ---- #include <linux/of_platform.h> + #define DRV_MODULE_NAME "starlet-gpio" + + #define drv_printk(level, format, arg...) \ + printk(level DRV_MODULE_NAME ": " format , ## arg) + + struct stgpio_chip { struct of_mm_gpio_chip mmchip; *************** *** 98,101 **** --- 104,108 ---- struct stgpio_chip *st_gc; const unsigned long *prop; + int error; st_gc = kzalloc(sizeof(*st_gc), GFP_KERNEL); *************** *** 120,124 **** gc->set = stgpio_set; ! return of_mm_gpiochip_add(np, mm_gc); } --- 127,135 ---- gc->set = stgpio_set; ! error = of_mm_gpiochip_add(np, mm_gc); ! if (!error) ! drv_printk(KERN_INFO, "%s: added %u gpios at %p\n", ! np->name, gc->ngpio, mm_gc->regs); ! return error; } *************** *** 131,136 **** error = stgpio_add32(np); if (error < 0) ! printk(KERN_ERR "starlet-gpio: error %d adding gpios" ! " for %s\n", error, np->full_name); } return 0; /* whatever */ --- 142,147 ---- error = stgpio_add32(np); if (error < 0) ! drv_printk(KERN_ERR, "error %d adding gpios" ! " for %s\n", error, np->full_name); } return 0; /* whatever */ Index: usbgecko_udbg.c =================================================================== RCS file: /cvsroot/gc-linux/linux/arch/powerpc/platforms/embedded6xx/usbgecko_udbg.c,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** usbgecko_udbg.c 1 Feb 2009 18:29:35 -0000 1.5 --- usbgecko_udbg.c 25 Oct 2009 18:50:27 -0000 1.6 *************** *** 307,311 **** vaddr = 0xc0000000 | paddr; ! setbat(1, vaddr, paddr, 128*1024, _PAGE_IO); ug_io_base = (void __iomem *)(vaddr | 0x6814); --- 307,311 ---- vaddr = 0xc0000000 | paddr; ! setbat(1, vaddr, paddr, 128*1024, PAGE_KERNEL_NCG); ug_io_base = (void __iomem *)(vaddr | 0x6814); Index: starlet-ipc.c =================================================================== RCS file: /cvsroot/gc-linux/linux/arch/powerpc/platforms/embedded6xx/starlet-ipc.c,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** starlet-ipc.c 28 Mar 2009 20:44:19 -0000 1.8 --- starlet-ipc.c 25 Oct 2009 18:50:27 -0000 1.9 *************** *** 34,37 **** --- 34,38 ---- #include <asm/time.h> #include <asm/starlet.h> + #include <asm/starlet-ios.h> *************** *** 446,450 **** int result; ! __spin_event_timeout(req->jiffies == 0 && !test_bit(__REBOOT, &ipc_dev->flags), usecs, result, counter) --- 447,451 ---- int result; ! __spin_event_timeout(req->jiffies == 0 && !test_bit(__REBOOT, &ipc_dev->flags), usecs, result, counter) *************** *** 1479,1482 **** --- 1480,1486 ---- int retval; + if (starlet_get_ipc_flavour() != STARLET_IPC_IOS) + return -ENODEV; + ipc_dev = kzalloc(sizeof(*ipc_dev), GFP_KERNEL); if (!ipc_dev) { *************** *** 1560,1564 **** static struct of_device_id starlet_ipc_of_match[] = { ! { .compatible = "nintendo,starlet-ipc" }, { }, }; --- 1564,1568 ---- static struct of_device_id starlet_ipc_of_match[] = { ! { .compatible = "nintendo,starlet-ios-ipc" }, { }, }; Index: Kconfig =================================================================== RCS file: /cvsroot/gc-linux/linux/arch/powerpc/platforms/embedded6xx/Kconfig,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** Kconfig 25 Oct 2009 18:45:35 -0000 1.9 --- Kconfig 25 Oct 2009 18:50:27 -0000 1.10 *************** *** 91,92 **** --- 91,198 ---- bool "Enable MPC10x store gathering" depends on MPC10X_BRIDGE + + config GAMECUBE + bool "Nintendo-GameCube" + depends on EMBEDDED6xx + select GAMECUBE_COMMON + help + Select GAMECUBE if configuring for the Nintendo GameCube. + More information at: <http://gc-linux.sourceforge.net/> + + config WII + bool "Nintendo-Wii" + depends on EMBEDDED6xx + select GAMECUBE_COMMON + select PPC_LIB_RHEAP if STARLET_IOS + select USB_ARCH_HAS_EHCI if STARLET_MINI + select USB_ARCH_HAS_OHCI if STARLET_MINI + select HAVE_GENERIC_DMA_COHERENT + help + Select WII if configuring for the Nintendo Wii. + More information at: <http://gc-linux.sourceforge.net/> + + config STARLET_IOS + bool "Nintendo Wii Starlet IOS support" + depends on WII + default y + + config STARLET_MINI + bool "Team Twiizers 'mini' firmware support" + depends on WII && EXPERIMENTAL + default y + + config FLIPPER_PIC + bool + depends on GAMECUBE_COMMON + default y + + config HOLLYWOOD_PIC + bool + depends on STARLET_MINI + default y + + config GAMECUBE_COMMON + bool + select NOT_COHERENT_CACHE + select FLIPPER_PIC + default n + + config GAMECUBE_UDBG + bool "Nintendo GameCube/Wii udbg support" + depends on GAMECUBE_COMMON + default n + help + If you say yes to this option, you will be able to choose between + several udbg drivers available for the Nintendo GameCube/Wii. + + If in doubt, say N here. + + choice + prompt "Nintendo GameCube/Wii udbg drivers" + depends on GAMECUBE_UDBG + + config USBGECKO_UDBG + bool "USB Gecko udbg console for the Nintendo GameCube/Wii" + help + If you say yes to this option, support will be included for the + USB Gecko adapter as an udbg console. + The USB Gecko is a EXI to USB Serial converter that can be plugged + into a memcard slot in the Nintendo GameCube/Wii. + + This driver bypasses the EXI layer completely. + + If in doubt, say N here. + + config GAMECUBE_VIDEO_UDBG + bool "Nintendo GameCube/Wii framebuffer udbg console" + select FONTS + select FONT_8x16 + help + If you say yes to this option, support will be included for a + framebuffer based udbg console for the Nintendo GameCube/Wii. + + If in doubt, say N here. + + endchoice + + config GAMECUBE_RSW + bool "Nintendo GameCube/Wii reset switch/button" + depends on GAMECUBE_COMMON + default y + help + If you say yes to this option, support will be included for the + reset switch/button of the Nintendo GameCube/Wii. + + If in doubt, say Y here. + + config WII_GPIO + bool "Nintendo Wii GPIO support" + depends on GPIOLIB + default y + help + If you say yes to this option, support will be included for the + Nintendo Wii GPIO lines that control, for example, the sensor + bar IR leds, the front led, or the eject switch of the disk unit. + + If in doubt, say Y here. + Index: wii_dev.c =================================================================== RCS file: /cvsroot/gc-linux/linux/arch/powerpc/platforms/embedded6xx/wii_dev.c,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** wii_dev.c 1 Feb 2009 18:29:35 -0000 1.5 --- wii_dev.c 25 Oct 2009 18:50:27 -0000 1.6 *************** *** 21,24 **** --- 21,30 ---- static struct of_device_id wii_of_bus[] = { { .compatible = "nintendo,hollywood", }, + #ifdef CONFIG_STARLET_IOS + { .compatible = "nintendo,starlet-ios-ipc", }, + #endif + #ifdef CONFIG_STARLET_MINI + { .compatible = "twiizers,starlet-mini-ipc", }, + #endif { }, }; Index: wii.c =================================================================== RCS file: /cvsroot/gc-linux/linux/arch/powerpc/platforms/embedded6xx/wii.c,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** wii.c 28 Mar 2009 20:44:19 -0000 1.5 --- wii.c 25 Oct 2009 18:50:27 -0000 1.6 *************** *** 19,22 **** --- 19,23 ---- #include <linux/kexec.h> #include <linux/exi.h> + #include <linux/gpio.h> #include <asm/io.h> *************** *** 25,28 **** --- 26,31 ---- #include <asm/time.h> #include <asm/starlet.h> + #include <asm/starlet-ios.h> + #include <asm/starlet-mini.h> #include <asm/udbg.h> *************** *** 32,36 **** ! static void wii_restart(char *cmd) { local_irq_disable(); --- 35,50 ---- ! static enum starlet_ipc_flavour starlet_ipc_flavour; ! ! static void wii_death_loop(void) ! { ! local_irq_disable(); ! for (;;) ! cpu_relax(); ! } ! ! #ifdef CONFIG_STARLET_IOS ! ! static void wii_ios_restart(char *cmd) { local_irq_disable(); *************** *** 46,50 **** } ! static void wii_power_off(void) { local_irq_disable(); --- 60,64 ---- } ! static void wii_ios_power_off(void) { local_irq_disable(); *************** *** 58,64 **** } static void wii_halt(void) { ! wii_restart(NULL); } --- 72,149 ---- } + #else + + static void wii_ios_restart(char *cmd) + { + wii_death_loop(); + } + + static void wii_ios_power_off(void) + { + wii_death_loop(); + } + + #endif /* CONFIG_STARLET_IOS */ + + #ifdef CONFIG_STARLET_MINI + + static void wii_mipc_restart(char *cmd) + { + void __iomem *hw_resets; + + local_irq_disable(); + + hw_resets = mipc_ioremap(0x0d800194, 4); + if (hw_resets) { + /* clear the system reset pin to cause a reset */ + mipc_clear_bit(0, hw_resets); + mipc_wmb(); + mipc_iounmap(hw_resets); + } + + for (;;) + cpu_relax(); + } + + static void wii_mipc_power_off(void) + { + void __iomem *gpio; + + local_irq_disable(); + + gpio = mipc_ioremap(0x0d8000e0, 3*4); + if (gpio) { + /* make sure that the poweroff GPIO is configured as output */ + mipc_out_be32(gpio + 4, mipc_in_be32(gpio + 4) | 0x2); + + /* drive the poweroff GPIO high */ + mipc_out_be32(gpio + 0, mipc_in_be32(gpio + 0) | 0x2); + mipc_wmb(); + mipc_iounmap(gpio); + } + + for (;;) + cpu_relax(); + } + + #else + + static void wii_mipc_restart(char *cmd) + { + wii_death_loop(); + } + + static void wii_mipc_power_off(void) + { + wii_death_loop(); + } + + #endif /* CONFIG_STARLET_MINI */ + static void wii_halt(void) { ! if (ppc_md.restart) ! ppc_md.restart(NULL); ! wii_death_loop(); } *************** *** 69,76 **** --- 154,187 ---- } + int starlet_discover_ipc_flavour(void) + { + struct mipc_infohdr *hdrp; + int error; + + error = mipc_discover(&hdrp); + if (!error) { + starlet_ipc_flavour = STARLET_IPC_MINI; + ppc_md.restart = wii_mipc_restart; + ppc_md.power_off = wii_mipc_power_off; + } else { + starlet_ipc_flavour = STARLET_IPC_IOS; + ppc_md.restart = wii_ios_restart; + ppc_md.power_off = wii_ios_power_off; + } + + return 0; + } + + enum starlet_ipc_flavour starlet_get_ipc_flavour(void) + { + return starlet_ipc_flavour; + } + static void __init wii_setup_arch(void) { ug_udbg_init(); gcnvi_udbg_init(); + + starlet_discover_ipc_flavour(); } *************** *** 155,163 **** local_irq_disable(); /* * Reload IOS to make sure that I/O resources are freed before * the final kexec phase. ! */ ! starlet_es_reload_ios_and_discard(); default_machine_kexec(image); --- 266,277 ---- local_irq_disable(); + #ifdef CONFIG_STARLET_IOS /* * Reload IOS to make sure that I/O resources are freed before * the final kexec phase. ! */ ! if (starlet_get_ipc_flavour() == STARLET_IPC_IOS) ! starlet_es_reload_ios_and_discard(); ! #endif default_machine_kexec(image); *************** *** 173,178 **** .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, --- 287,290 ---- --- NEW FILE: starlet-mipc.c --- /* * arch/powerpc/platforms/embedded6xx/starlet-mipc.c * * IPC driver for the 'mini' firmware replacement for Starlet * Copyright (C) 2009 The GameCube Linux Team * Copyright (C) 2009 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/module.h> #include <linux/init.h> #include <linux/of_platform.h> [...1189 lines suppressed...] static int __init mipc_init_module(void) { drv_printk(KERN_INFO, "%s - version %s\n", DRV_DESCRIPTION, mipc_driver_version); return of_register_platform_driver(&mipc_of_driver); } static void __exit mipc_exit_module(void) { of_unregister_platform_driver(&mipc_of_driver); } module_init(mipc_init_module); module_exit(mipc_exit_module); MODULE_DESCRIPTION(DRV_DESCRIPTION); MODULE_AUTHOR(DRV_AUTHOR); MODULE_LICENSE("GPL"); |