From: Albert H. <he...@us...> - 2008-09-13 19:43:17
|
Update of /cvsroot/gc-linux/linux/arch/powerpc/platforms/embedded6xx In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv13650/arch/powerpc/platforms/embedded6xx Modified Files: Kconfig Makefile gamecube.c starlet-es.c starlet-ipc.c starlet-stm.c wii_dev.c Log Message: Merged 2.6.25. Queued small fixes for: - starlet-es - starlet-ipc - starlet-stm - rvl-stsd - rvl-sthcd - gcn-ai Index: starlet-stm.c =================================================================== RCS file: /cvsroot/gc-linux/linux/arch/powerpc/platforms/embedded6xx/starlet-stm.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- starlet-stm.c 2 Jul 2008 20:39:11 -0000 1.3 +++ starlet-stm.c 13 Sep 2008 19:42:53 -0000 1.4 @@ -12,10 +12,13 @@ * */ +#define DBG(fmt, arg...) drv_printk(KERN_INFO, fmt, ##arg) + #include <linux/kernel.h> #include <linux/dma-mapping.h> #include <asm/starlet.h> + /* * /dev/stm/immediate * @@ -26,6 +29,9 @@ #define STARLET_DEV_STM_IMMEDIATE "/dev/stm/immediate" +#define drv_printk(level, format, arg...) \ + printk(level "starlet-stm: " format , ## arg) + static const char dev_stm_immediate[] = STARLET_DEV_STM_IMMEDIATE; @@ -41,13 +47,29 @@ u32 *buf = starlet_stm_buf; size_t len = sizeof(starlet_stm_buf); int fd; + int error; + + /* REVISIT, use polled ipc calls here */ + + + drv_printk(KERN_INFO, "trying IPC restart...\n"); fd = starlet_open(dev_stm_immediate, 0); - if (fd >= 0) { - *buf = value; - starlet_ioctl(fd, request, buf, len, buf, len); - starlet_close(fd); + if (fd < 0) { + drv_printk(KERN_ERR, "failed to open %s\n", dev_stm_immediate); + error = fd; + goto done; } + + *buf = value; + error = starlet_ioctl(fd, request, buf, len, buf, len); + if (error < 0) + drv_printk(KERN_ERR, "ioctl %d failed\n", request); + starlet_close(fd); + +done: + if (error < 0) + DBG("%s: error=%d (%x)\n", __func__, error, error); } /* Index: starlet-es.c =================================================================== RCS file: /cvsroot/gc-linux/linux/arch/powerpc/platforms/embedded6xx/starlet-es.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- starlet-es.c 2 Jul 2008 20:41:41 -0000 1.2 +++ starlet-es.c 13 Sep 2008 19:42:53 -0000 1.3 @@ -478,10 +478,17 @@ drv_printk(KERN_WARNING, "unable to load preferred" " IOS version (min %llx, max %llx)\n", ios_min, ios_max); - } else { - starlet_nwc24_stop_scheduler(); } } + + /* + * Try to disable the Nintendo Wifi Connect 24 scheduler. + * And do this even if we failed to load our preferred IOS. + * + * When the scheduler kicks in, starlet IPC calls from Broadway fail. + */ + starlet_nwc24_stop_scheduler(); + return error; } Index: gamecube.c =================================================================== RCS file: /cvsroot/gc-linux/linux/arch/powerpc/platforms/embedded6xx/gamecube.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- gamecube.c 26 Mar 2008 19:48:45 -0000 1.3 +++ gamecube.c 13 Sep 2008 19:42:53 -0000 1.4 @@ -76,12 +76,12 @@ return 1; } -#ifdef CONFIG_KEXEC static void gamecube_shutdown(void) { /* currently not used */ } +#ifdef CONFIG_KEXEC static int gamecube_kexec_prepare(struct kimage *image) { return 0; @@ -102,8 +102,8 @@ .get_irq = flipper_pic_get_irq, .calibrate_decr = generic_calibrate_decr, .progress = udbg_progress, -#ifdef CONFIG_KEXEC .machine_shutdown = gamecube_shutdown, +#ifdef CONFIG_KEXEC .machine_kexec_prepare = gamecube_kexec_prepare, .machine_kexec = default_machine_kexec, #endif Index: Makefile =================================================================== RCS file: /cvsroot/gc-linux/linux/arch/powerpc/platforms/embedded6xx/Makefile,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- Makefile 2 Jul 2008 20:38:06 -0000 1.5 +++ Makefile 13 Sep 2008 19:42:53 -0000 1.6 @@ -3,6 +3,7 @@ # obj-$(CONFIG_MPC7448HPC2) += mpc7448_hpc2.o obj-$(CONFIG_LINKSTATION) += linkstation.o ls_uart.o +obj-$(CONFIG_STORCENTER) += storcenter.o obj-$(CONFIG_PPC_HOLLY) += holly.o obj-$(CONFIG_PPC_PRPMC2800) += prpmc2800.o obj-$(CONFIG_FLIPPER_PIC) += flipper-pic.o Index: Kconfig =================================================================== RCS file: /cvsroot/gc-linux/linux/arch/powerpc/platforms/embedded6xx/Kconfig,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- Kconfig 2 Jul 2008 20:38:06 -0000 1.4 +++ Kconfig 13 Sep 2008 19:42:53 -0000 1.5 @@ -9,6 +9,8 @@ select FSL_SOC select PPC_UDBG_16550 if SERIAL_8250 select DEFAULT_UIMAGE + select MPC10X_OPENPIC + select MPC10X_BRIDGE help Select LINKSTATION if configuring for one of PPC- (MPC8241) based NAS systems from Buffalo Technology. So far only @@ -16,13 +18,25 @@ Linkstation-I HD-HLAN and HD-HGLAN versions, and PPC-based Terastation systems should be supported too. +config STORCENTER + bool "IOMEGA StorCenter" + depends on EMBEDDED6xx + select MPIC + select FSL_SOC + select PPC_UDBG_16550 if SERIAL_8250 + select MPC10X_OPENPIC + select MPC10X_BRIDGE + help + Select STORCENTER if configuring for the iomega StorCenter + with an 8241 CPU in it. + config MPC7448HPC2 bool "Freescale MPC7448HPC2(Taiga)" depends on EMBEDDED6xx select TSI108_BRIDGE select DEFAULT_UIMAGE select PPC_UDBG_16550 - select WANT_DEVICE_TREE + select TSI108_BRIDGE help Select MPC7448HPC2 if configuring for Freescale MPC7448HPC2 (Taiga) platform @@ -32,7 +46,7 @@ depends on EMBEDDED6xx select TSI108_BRIDGE select PPC_UDBG_16550 - select WANT_DEVICE_TREE + select TSI108_BRIDGE help Select PPC_HOLLY if configuring for an IBM 750GX/CL Eval Board with TSI108/9 bridge (Hickory/Holly) @@ -42,7 +56,6 @@ depends on EMBEDDED6xx select MV64X60 select NOT_COHERENT_CACHE - select WANT_DEVICE_TREE help This option enables support for the Motorola PrPMC2800 board @@ -50,7 +63,6 @@ bool "Nintendo-GameCube" depends on EMBEDDED6xx select GAMECUBE_COMMON - select WANT_DEVICE_TREE help Select GAMECUBE if configuring for the Nintendo GameCube. More information at: <http://gc-linux.sourceforge.net/> @@ -59,7 +71,6 @@ bool "Nintendo-Wii" depends on EMBEDDED6xx select GAMECUBE_COMMON - select WANT_DEVICE_TREE select PPC_LIB_RHEAP help Select WII if configuring for the Nintendo Wii. @@ -67,17 +78,13 @@ config TSI108_BRIDGE bool - depends on MPC7448HPC2 || PPC_HOLLY select PCI select MPIC select MPIC_WEIRD - default y config MPC10X_BRIDGE bool - depends on LINKSTATION select PPC_INDIRECT_PCI - default y config MV64X60 bool @@ -86,8 +93,6 @@ config MPC10X_OPENPIC bool - depends on LINKSTATION - default y config MPC10X_STORE_GATHERING bool "Enable MPC10x store gathering" Index: wii_dev.c =================================================================== RCS file: /cvsroot/gc-linux/linux/arch/powerpc/platforms/embedded6xx/wii_dev.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- wii_dev.c 4 Apr 2008 19:17:51 -0000 1.3 +++ wii_dev.c 13 Sep 2008 19:42:53 -0000 1.4 @@ -37,7 +37,7 @@ of_platform_device_create(np, NULL, NULL); of_node_put(np); } - + return 0; } device_initcall(wii_device_probe); Index: starlet-ipc.c =================================================================== RCS file: /cvsroot/gc-linux/linux/arch/powerpc/platforms/embedded6xx/starlet-ipc.c,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- starlet-ipc.c 2 Jul 2008 20:38:46 -0000 1.5 +++ starlet-ipc.c 13 Sep 2008 19:42:53 -0000 1.6 @@ -26,6 +26,7 @@ #include <linux/jiffies.h> #include <linux/dmapool.h> #include <linux/dma-mapping.h> +#include <linux/random.h> #include <linux/scatterlist.h> #include <linux/string.h> #include <asm/io.h> @@ -194,6 +195,7 @@ memset(req, 0, sizeof(*req)); req->ipc_dev = ipc_dev; req->result = 0xdeadbeef; + req->sig = ipc_dev->random_id; req->dma_addr = dma_addr; INIT_LIST_HEAD(&req->node); } @@ -229,7 +231,7 @@ unsigned long flags; spin_lock_irqsave(&ipc_dev->list_lock, flags); - list_del(&req->node); + list_del_init(&req->node); ipc_dev->nr_outstanding--; spin_unlock_irqrestore(&ipc_dev->list_lock, flags); @@ -268,6 +270,14 @@ spin_lock_irqsave(&ipc_dev->list_lock, flags); list_for_each_entry(req, &ipc_dev->outstanding_list, node) { + if (req && req->sig != ipc_dev->random_id) { + drv_printk(KERN_ERR, "IPC trash detected\n"); + ipc_dev->nr_outstanding = 0; + INIT_LIST_HEAD(&ipc_dev->outstanding_list); + INIT_LIST_HEAD(&req->node); + spin_unlock_irqrestore(&ipc_dev->list_lock, flags); + return NULL; + } if (req && req_bus_addr == req->dma_addr) { spin_unlock_irqrestore(&ipc_dev->list_lock, flags); return req; @@ -500,7 +510,7 @@ } EXPORT_SYMBOL_GPL(starlet_open); -/** +/* * */ int starlet_close(int fd) @@ -559,7 +569,7 @@ return 0; } -/** +/* * */ int starlet_ioctl_dma(int fd, int request, @@ -1266,10 +1276,13 @@ starlet_close(fd); } - /* try to turn off the front led (not starlet-related but anyway...) */ + /* + * Try to turn off the front led and sensor bar. + * (not strictly starlet-only stuff but anyway...) + */ gpio = ioremap(0x0d8000c0, 4); if (gpio) { - out_be32(gpio, in_be32(gpio) & ~0x20); + out_be32(gpio, in_be32(gpio) & ~0x120); iounmap(gpio); } } @@ -1280,6 +1293,8 @@ size_t size, io_size; int error; + ipc_dev->random_id = get_random_int(); + error = starlet_malloc_lib_bootstrap(&mem[1]); if (error) return error; @@ -1388,7 +1403,11 @@ struct starlet_ipc_device *ipc_dev = dev_get_drvdata(dev); if (ipc_dev) { - starlet_ipc_quiesce(ipc_dev); + /* + * We can't shutdown IPC as we need it to reboot the + * machine. + * Thus, no starlet_ipc_quiesce(ipc_dev); here, sorry. + */ return 0; } return -ENODEV; |