From: Albert H. <he...@us...> - 2009-02-01 18:29:46
|
Update of /cvsroot/gc-linux/linux/arch/powerpc/platforms/embedded6xx In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv17186/arch/powerpc/platforms/embedded6xx Modified Files: Kconfig Makefile flipper-pic.c flipper-pic.h gamecube.c gamecube_dev.c gcn-rsw.c gcnvi_udbg.c gcnvi_udbg.h starlet-es.c starlet-gpio.c starlet-ipc.c starlet-malloc.c starlet-stm.c usbgecko_udbg.c usbgecko_udbg.h wii.c wii_dev.c Log Message: Merge 2.6.28. Also: - run checkpatch against the non-broken source code - add GPIO driver fixes - implement getgeo for the special block drivers - small fixes Index: flipper-pic.c =================================================================== RCS file: /cvsroot/gc-linux/linux/arch/powerpc/platforms/embedded6xx/flipper-pic.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- flipper-pic.c 4 Apr 2008 19:17:51 -0000 1.2 +++ flipper-pic.c 1 Feb 2009 18:29:35 -0000 1.3 @@ -2,8 +2,8 @@ * arch/powerpc/platforms/embedded6xx/flipper-pic.c * * Nintendo GameCube/Wii interrupt controller support. - * Copyright (C) 2004-2008 The GameCube Linux Team - * Copyright (C) 2007,2008 Albert Herranz + * Copyright (C) 2004-2009 The GameCube Linux Team + * Copyright (C) 2007,2008,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 @@ -24,7 +24,7 @@ #define DRV_MODULE_NAME "flipper-pic" #define drv_printk(level, format, arg...) \ - printk(level DRV_MODULE_NAME ": " format , ## arg) + printk(level DRV_MODULE_NAME ": " format , ## arg) /* @@ -156,7 +156,7 @@ if (irq_status == 0) return -1; /* no more IRQs pending */ - __asm __volatile ("cntlzw %0,%1": "=r"(irq) : "r"(irq_status)); + __asm__ __volatile__("cntlzw %0,%1" : "=r"(irq) : "r"(irq_status)); return irq_linear_revmap(flipper_irq_host, 31 - irq); } Index: flipper-pic.h =================================================================== RCS file: /cvsroot/gc-linux/linux/arch/powerpc/platforms/embedded6xx/flipper-pic.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- flipper-pic.h 4 Apr 2008 19:17:51 -0000 1.2 +++ flipper-pic.h 1 Feb 2009 18:29:35 -0000 1.3 @@ -2,8 +2,8 @@ * arch/powerpc/platforms/embedded6xx/flipper-pic.h * * Nintendo GameCube/Wii interrupt controller support. - * Copyright (C) 2004-2008 The GameCube Linux Team - * Copyright (C) 2007,2008 Albert Herranz + * Copyright (C) 2004-2009 The GameCube Linux Team + * Copyright (C) 2007,2008,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 @@ -15,11 +15,7 @@ #ifndef __FLIPPER_PIC_H #define __FLIPPER_PIC_H -#ifdef CONFIG_WII -#define FLIPPER_NR_IRQS (15) -#else -#define FLIPPER_NR_IRQS (14) -#endif +#define FLIPPER_NR_IRQS 32 /* * Each interrupt has a corresponding bit in both @@ -29,12 +25,12 @@ * the corresponding bit in IMR. ACK'ing a request simply involves * asserting the corresponding bit in ICR. */ -#define FLIPPER_ICR 0x00 +#define FLIPPER_ICR 0x00 #define FLIPPER_ICR_RSS (1<<16) /* reset switch state */ -#define FLIPPER_IMR 0x04 +#define FLIPPER_IMR 0x04 -#define FLIPPER_RESET 0x24 +#define FLIPPER_RESET 0x24 unsigned int flipper_pic_get_irq(void); void __init flipper_pic_probe(void); @@ -43,5 +39,3 @@ int flipper_is_reset_button_pressed(void); #endif - - Index: gcn-rsw.c =================================================================== RCS file: /cvsroot/gc-linux/linux/arch/powerpc/platforms/embedded6xx/gcn-rsw.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- gcn-rsw.c 4 Apr 2008 19:42:49 -0000 1.4 +++ gcn-rsw.c 1 Feb 2009 18:29:35 -0000 1.5 @@ -2,9 +2,9 @@ * arch/powerpc/platforms/embedded6xx/gcn-rsw.c * * Nintendo GameCube/Wii reset switch (RSW) driver. - * Copyright (C) 2004-2008 The GameCube Linux Team + * Copyright (C) 2004-2009 The GameCube Linux Team * Copyright (C) 2004 Stefan Esser - * Copyright (C) 2004,2005,2008 Albert Herranz + * Copyright (C) 2004,2005,2008,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 @@ -41,14 +41,14 @@ #define RSW_NORMAL_TIMEOUT 3 /* seconds */ #define RSW_EMERGENCY_PUSHES 10 -typedef enum { +enum rsw_state { IDLE = 0, /* nothing to do */ NORMAL_RESET, /* reboot requested */ EMERGENCY_RESET, /* try emergency reboot */ -} rsw_state_t; +}; struct rsw_drvdata { - rsw_state_t state; + enum rsw_state state; struct timer_list timer; unsigned long jiffies; int pushes; @@ -65,7 +65,7 @@ /* * Tells if the reset button is pressed. */ -static int rsw_is_button_pressed(void __iomem * io_base) +static int rsw_is_button_pressed(void __iomem *io_base) { u32 icr = in_be32(io_base + FLIPPER_ICR); @@ -73,9 +73,6 @@ return !(icr & FLIPPER_ICR_RSS); } -/* from kernel/sys.c */ -extern void ctrl_alt_del(void); - /* * Invokes a normal system restart. */ @@ -309,4 +306,3 @@ MODULE_DESCRIPTION(DRV_DESCRIPTION); MODULE_AUTHOR(DRV_AUTHOR); MODULE_LICENSE("GPL"); - Index: gamecube_dev.c =================================================================== RCS file: /cvsroot/gc-linux/linux/arch/powerpc/platforms/embedded6xx/gamecube_dev.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- gamecube_dev.c 4 Apr 2008 19:42:49 -0000 1.2 +++ gamecube_dev.c 1 Feb 2009 18:29:35 -0000 1.3 @@ -2,8 +2,8 @@ * arch/powerpc/platforms/embedded6xx/gamecube_dev.c * * Nintendo GameCube platform device setup. - * Copyright (C) 2008 The GameCube Linux Team - * Copyright (C) 2008 Albert Herranz + * Copyright (C) 2008-2009 The GameCube Linux Team + * Copyright (C) 2008,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 @@ -32,4 +32,3 @@ return 0; } device_initcall(gamecube_device_probe); - Index: starlet-stm.c =================================================================== RCS file: /cvsroot/gc-linux/linux/arch/powerpc/platforms/embedded6xx/starlet-stm.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- starlet-stm.c 13 Sep 2008 19:42:53 -0000 1.4 +++ starlet-stm.c 1 Feb 2009 18:29:35 -0000 1.5 @@ -2,8 +2,8 @@ * arch/powerpc/platforms/embedded6xx/starlet-stm.c * * Nintendo Wii starlet STM routines - * Copyright (C) 2008 The GameCube Linux Team - * Copyright (C) 2008 Albert Herranz + * Copyright (C) 2008-2009 The GameCube Linux Team + * Copyright (C) 2008,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 @@ -30,14 +30,14 @@ #define STARLET_DEV_STM_IMMEDIATE "/dev/stm/immediate" #define drv_printk(level, format, arg...) \ - printk(level "starlet-stm: " format , ## arg) + printk(level "starlet-stm: " format , ## arg) static const char dev_stm_immediate[] = STARLET_DEV_STM_IMMEDIATE; /* private aligned buffer for restart/power_off operations */ static u32 starlet_stm_buf[(STARLET_IPC_DMA_ALIGN+1)/sizeof(u32)] - __attribute__ ((aligned (STARLET_IPC_DMA_ALIGN+1))); + __attribute__ ((aligned(STARLET_IPC_DMA_ALIGN+1))); /* * @@ -68,8 +68,8 @@ starlet_close(fd); done: - if (error < 0) - DBG("%s: error=%d (%x)\n", __func__, error, error); + if (error < 0) + DBG("%s: error=%d (%x)\n", __func__, error, error); } /* @@ -79,7 +79,7 @@ { starlet_stm_common_restart(STARLET_STM_HOTRESET, 0); } -//EXPORT_SYMBOL_GPL(starlet_stm_restart); +/*EXPORT_SYMBOL_GPL(starlet_stm_restart);*/ /* * @@ -88,6 +88,6 @@ { starlet_stm_common_restart(STARLET_STM_SHUTDOWN, 0); } -//EXPORT_SYMBOL_GPL(starlet_stm_power_off); +/*EXPORT_SYMBOL_GPL(starlet_stm_power_off);*/ Index: starlet-es.c =================================================================== RCS file: /cvsroot/gc-linux/linux/arch/powerpc/platforms/embedded6xx/starlet-es.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- starlet-es.c 15 Nov 2008 20:10:14 -0000 1.4 +++ starlet-es.c 1 Feb 2009 18:29:35 -0000 1.5 @@ -2,8 +2,8 @@ * arch/powerpc/platforms/embedded6xx/starlet-es.c * * Nintendo Wii starlet ES routines - * Copyright (C) 2008 The GameCube Linux Team - * Copyright (C) 2008 Albert Herranz + * Copyright (C) 2008-2009 The GameCube Linux Team + * Copyright (C) 2008,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 @@ -28,7 +28,7 @@ #define DBG(fmt, arg...) pr_debug(fmt, ##arg) #define drv_printk(level, format, arg...) \ - printk(level DRV_MODULE_NAME ": " format , ## arg) + printk(level DRV_MODULE_NAME ": " format , ## arg) struct starlet_es_device { int fd; @@ -56,7 +56,7 @@ #if 0 struct starlet_es_ticket { char issuer[0x40]; - u8 fill[63]; //TODO: not really fill + u8 fill[63]; /* TODO: not really fill */ u8 title_key[16]; u8 fill2; u64 ticketid; @@ -124,7 +124,7 @@ size_t nelems = sizeof(es_small_buf) / sizeof(u32); drv_printk(KERN_INFO, "es_small_buf[%d]= {\n", nelems); - for(i=0; i < nelems; i++) + for (i = 0; i < nelems; i++) drv_printk(KERN_INFO, "%08x, ", es_small_buf[i]); drv_printk(KERN_INFO, "\n}\n"); @@ -171,11 +171,10 @@ error = starlet_ioctlv(es_dev->fd, ES_IOCTLV_GETTITLECOUNT, 0, NULL, 1, io); - if (error) { + if (error) DBG("%s: error=%d (%08x)\n", __func__, error, error); - } else { + else *count = *count_buf; - } es_small_buf_put(count_buf); @@ -205,9 +204,8 @@ error = starlet_ioctlv(es_dev->fd, ES_IOCTLV_GETTITLES, 1, in, 1, io); - if (error) { + if (error) DBG("%s: error=%d (%08x)\n", __func__, error, error); - } es_small_buf_put(count_buf); @@ -244,11 +242,10 @@ error = starlet_ioctlv(es_dev->fd, ES_IOCTLV_GETTICKETVIEWCOUNT, 1, in, 1, io); - if (error) { + if (error) DBG("%s: error=%d (%08x)\n", __func__, error, error); - } else { + else *count = *count_buf; - } starlet_kfree(title_buf); es_small_buf_put(count_buf); @@ -292,9 +289,8 @@ error = starlet_ioctlv(es_dev->fd, ES_IOCTLV_GETTICKETVIEWS, 2, in, 1, io); - if (error) { + if (error) DBG("%s: error=%d (%08x)\n", __func__, error, error); - } es_small_buf_put(count_buf); starlet_kfree(title_buf); @@ -327,9 +323,8 @@ error = starlet_ioctlv_and_reboot(es_dev->fd, ES_IOCTLV_LAUNCHTITLE, 2, in, 0, NULL); - if (error) { + if (error) DBG("%s: error=%d (%08x)\n", __func__, error, error); - } starlet_kfree(title_buf); Index: gamecube.c =================================================================== RCS file: /cvsroot/gc-linux/linux/arch/powerpc/platforms/embedded6xx/gamecube.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- gamecube.c 13 Sep 2008 19:42:53 -0000 1.4 +++ gamecube.c 1 Feb 2009 18:29:35 -0000 1.5 @@ -2,8 +2,8 @@ * arch/powerpc/platforms/embedded6xx/gamecube.c * * Nintendo GameCube board-specific support - * Copyright (C) 2004-2008 The GameCube Linux Team - * Copyright (C) 2007,2008 Albert Herranz + * Copyright (C) 2004-2009 The GameCube Linux Team + * Copyright (C) 2007,2008,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 @@ -67,13 +67,13 @@ static int __init gamecube_probe(void) { - unsigned long dt_root; + unsigned long dt_root; - dt_root = of_get_flat_dt_root(); - if (!of_flat_dt_is_compatible(dt_root, "nintendo,gamecube")) - return 0; + dt_root = of_get_flat_dt_root(); + if (!of_flat_dt_is_compatible(dt_root, "nintendo,gamecube")) + return 0; - return 1; + return 1; } static void gamecube_shutdown(void) Index: Makefile =================================================================== RCS file: /cvsroot/gc-linux/linux/arch/powerpc/platforms/embedded6xx/Makefile,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- Makefile 15 Nov 2008 20:10:14 -0000 1.7 +++ Makefile 1 Feb 2009 18:29:35 -0000 1.8 @@ -11,9 +11,8 @@ obj-$(CONFIG_WII) += wii.o wii_dev.o \ starlet-ipc.o starlet-malloc.o \ starlet-stm.o starlet-es.o -obj-$(CONFIG_WII_GPIO) += starlet-gpio.o obj-$(CONFIG_FLIPPER_PIC) += flipper-pic.o -obj-$(CONFIG_GAMECUBE_RSW) += gcn-rsw.o obj-$(CONFIG_USBGECKO_UDBG) += usbgecko_udbg.o obj-$(CONFIG_GAMECUBE_VIDEO_UDBG) += gcnvi_udbg.o - +obj-$(CONFIG_GAMECUBE_RSW) += gcn-rsw.o +obj-$(CONFIG_WII_GPIO) += starlet-gpio.o Index: starlet-malloc.c =================================================================== RCS file: /cvsroot/gc-linux/linux/arch/powerpc/platforms/embedded6xx/starlet-malloc.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- starlet-malloc.c 2 Jul 2008 20:38:06 -0000 1.1 +++ starlet-malloc.c 1 Feb 2009 18:29:35 -0000 1.2 @@ -2,8 +2,8 @@ * arch/powerpc/platforms/embedded6xx/starlet-malloc.c * * Nintendo Wii starlet memory allocation library - * Copyright (C) 2008 The GameCube Linux Team - * Copyright (C) 2008 Albert Herranz + * Copyright (C) 2008-2009 The GameCube Linux Team + * Copyright (C) 2008,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 @@ -44,7 +44,7 @@ static char starlet_malloc_lib_version[] = "0.1i"; #define drv_printk(level, format, arg...) \ - printk(level LIB_MODULE_NAME ": " format , ## arg) + printk(level LIB_MODULE_NAME ": " format , ## arg) #define STARLET_IOH_ALIGN 31 @@ -196,7 +196,7 @@ return 0; err_rh_create: - iounmap(ioh->base); + iounmap(ioh->base); err_rh_attach_region: rh_destroy(ioh->rheap); err: @@ -210,7 +210,7 @@ */ static struct starlet_ioh *starlet_ioh_get(void) { - if (unlikely(!starlet_ioh)) + if (unlikely(!starlet_ioh)) drv_printk(KERN_ERR, "uninitialized ioh instance!\n"); return starlet_ioh; } @@ -274,7 +274,7 @@ return; offset = ptr - ioh->base; - + spin_lock_irqsave(&ioh->lock, flags); rh_free(ioh->rheap, offset); spin_unlock_irqrestore(&ioh->lock, flags); Index: starlet-gpio.c =================================================================== RCS file: /cvsroot/gc-linux/linux/arch/powerpc/platforms/embedded6xx/starlet-gpio.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- starlet-gpio.c 15 Nov 2008 20:10:14 -0000 1.1 +++ starlet-gpio.c 1 Feb 2009 18:29:35 -0000 1.2 @@ -2,8 +2,8 @@ * arch/powerpc/platforms/embedded6xx/starlet-gpio.c * * Nintendo Wii starlet GPIO driver - * Copyright (C) 2008 The GameCube Linux Team - * Copyright (C) 2008 Albert Herranz + * Copyright (C) 2008-2009 The GameCube Linux Team + * Copyright (C) 2008,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 @@ -90,7 +90,7 @@ return 0; } -int stgpio_add32(struct device_node *np) +static int stgpio_add32(struct device_node *np) { struct of_mm_gpio_chip *mm_gc; struct of_gpio_chip *of_gc; Index: gcnvi_udbg.c =================================================================== RCS file: /cvsroot/gc-linux/linux/arch/powerpc/platforms/embedded6xx/gcnvi_udbg.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- gcnvi_udbg.c 15 Nov 2008 20:10:14 -0000 1.1 +++ gcnvi_udbg.c 1 Feb 2009 18:29:35 -0000 1.2 @@ -2,8 +2,8 @@ * arch/powerpc/platforms/embedded6xx/gcnvi_udbg.c * * Nintendo GameCube/Wii framebuffer udbg output support. - * Copyright (C) 2008 The GameCube Linux Team - * Copyright (C) 2008 Albert Herranz + * Copyright (C) 2008-2009 The GameCube Linux Team + * Copyright (C) 2008,2009 Albert Herranz * * Based on arch/ppc/platforms/gcn-con.c * @@ -60,7 +60,7 @@ int scrolled_lines; }; -static struct console_data *default_console = NULL; +static struct console_data *default_console; #if 0 static int console_set_color(int background, int foreground) @@ -90,9 +90,9 @@ else color = con->background; #if FONT_YFACTOR == 2 - // pixel doubling: we write u32 + /* pixel doubling: we write u32 */ ptr[ay * 2 * con->stride / 4 + ax] = color; - // line doubling + /* line doubling */ ptr[(ay * 2 + 1) * con->stride / 4 + ax] = color; #else ptr[ay * con->stride / 4 + ax] = color; @@ -110,7 +110,8 @@ else color2x[1] = con->background; ptr[ay * con->stride / 4 + ax] = - (color2x[0] & 0xFFFF00FF) | (color2x[1] & 0x0000FF00); + (color2x[0] & 0xFFFF00FF) | + (color2x[1] & 0x0000FF00); } #endif } @@ -140,7 +141,7 @@ con->framebuffer + con->stride * (FONT_YSIZE * FONT_YFACTOR + FONT_YGAP), con->stride * con->yres - FONT_YSIZE); - cnt = (con->stride * (FONT_YSIZE * FONT_YFACTOR + FONT_YGAP)) / 4; + cnt = (con->stride * (FONT_YSIZE*FONT_YFACTOR + FONT_YGAP)) / 4; ptr = (unsigned long *)(con->framebuffer + con->stride * (con->yres - FONT_YSIZE)); while (cnt--) @@ -205,21 +206,20 @@ 0x02800000, 0x000000FF, 0x00FF00FF, 0x00FF00FF }; -static void vi_setup_video(void __iomem * io_base, unsigned long xfb_start) +static void vi_setup_video(void __iomem *io_base, unsigned long xfb_start) { const u32 *regs = vi_Mode640X480NtscYUV16; int i; /* initialize video registers */ - for (i = 0; i < 7; i++) { + for (i = 0; i < 7; i++) out_be32(io_base + i * sizeof(__u32), regs[i]); - } + out_be32(io_base + VI_TFBR, regs[VI_TFBR / sizeof(__u32)]); out_be32(io_base + VI_BFBR, regs[VI_BFBR / sizeof(__u32)]); out_be32(io_base + VI_DPV, regs[VI_DPV / sizeof(__u32)]); - for (i = 16; i < 32; i++) { + for (i = 16; i < 32; i++) out_be32(io_base + i * sizeof(__u32), regs[i]); - } /* set framebuffer address, interlaced mode */ out_be32(io_base + VI_TFBL, 0x10000000 | (xfb_start >> 5)); @@ -310,6 +310,6 @@ console_init(&gcnvi_udbg_console, screen_base, SCREEN_WIDTH, SCREEN_HEIGHT, 2 * SCREEN_WIDTH); - //udbg_putc = gcnvi_udbg_putc; + udbg_putc = gcnvi_udbg_putc; printk(KERN_INFO "gcnvi_udbg: ready\n"); } Index: usbgecko_udbg.c =================================================================== RCS file: /cvsroot/gc-linux/linux/arch/powerpc/platforms/embedded6xx/usbgecko_udbg.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- usbgecko_udbg.c 25 Nov 2008 19:09:31 -0000 1.4 +++ usbgecko_udbg.c 1 Feb 2009 18:29:35 -0000 1.5 @@ -2,8 +2,8 @@ * arch/powerpc/platforms/embedded6xx/usbgecko_udbg.c * * udbg serial input/output routines for the USB Gecko adapter. - * Copyright (C) 2008 The GameCube Linux Team - * Copyright (C) 2008 Albert Herranz + * Copyright (C) 2008-2009 The GameCube Linux Team + * Copyright (C) 2008,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 @@ -48,29 +48,29 @@ */ static u32 ug_io_transaction(u32 in) { - u32 __iomem *csr_reg = ug_io_base + EXI_CSR; - u32 __iomem *data_reg = ug_io_base + EXI_DATA; - u32 __iomem *cr_reg = ug_io_base + EXI_CR; - u32 csr, data, cr; + u32 __iomem *csr_reg = ug_io_base + EXI_CSR; + u32 __iomem *data_reg = ug_io_base + EXI_DATA; + u32 __iomem *cr_reg = ug_io_base + EXI_CR; + u32 csr, data, cr; - /* select */ - csr = EXI_CSR_CLK_32MHZ | EXI_CSR_CS_0; - out_be32(csr_reg, csr); + /* select */ + csr = EXI_CSR_CLK_32MHZ | EXI_CSR_CS_0; + out_be32(csr_reg, csr); - /* read/write */ - data = in; - out_be32(data_reg, data); - cr = EXI_CR_TLEN(2) | EXI_CR_READ_WRITE | EXI_CR_TSTART; - out_be32(cr_reg, cr); + /* read/write */ + data = in; + out_be32(data_reg, data); + cr = EXI_CR_TLEN(2) | EXI_CR_READ_WRITE | EXI_CR_TSTART; + out_be32(cr_reg, cr); - while(in_be32(cr_reg) & EXI_CR_TSTART) - barrier(); + while (in_be32(cr_reg) & EXI_CR_TSTART) + barrier(); - /* deselect */ - out_be32(csr_reg, 0); + /* deselect */ + out_be32(csr_reg, 0); /* result */ - data = in_be32(data_reg); + data = in_be32(data_reg); return data; } @@ -83,7 +83,7 @@ if (!ug_io_base) return 0; - return (ug_io_transaction(0x90000000) == 0x04700000); + return ug_io_transaction(0x90000000) == 0x04700000; } /* @@ -91,7 +91,7 @@ */ static int ug_is_txfifo_ready(void) { - return (ug_io_transaction(0xc0000000) & 0x04000000); + return ug_io_transaction(0xc0000000) & 0x04000000; } /* @@ -117,10 +117,10 @@ if (ch == '\n') ug_putc('\r'); - while(!ug_is_txfifo_ready() && count--) - barrier(); + while (!ug_is_txfifo_ready() && count--) + barrier(); if (count) - ug_raw_putc(ch); + ug_raw_putc(ch); } #if 0 @@ -129,7 +129,7 @@ */ static void ug_puts(char *s) { - while(*s) + while (*s) ug_putc(*s++); } #endif @@ -139,7 +139,7 @@ */ static int ug_is_rxfifo_ready(void) { - return (ug_io_transaction(0xd0000000) & 0x04000000); + return ug_io_transaction(0xd0000000) & 0x04000000; } /* @@ -166,9 +166,9 @@ if (!ug_io_base) return -1; - while(!ug_is_rxfifo_ready() && count--) - barrier(); - return ug_raw_getc(); + while (!ug_is_rxfifo_ready() && count--) + barrier(); + return ug_raw_getc(); } /* @@ -191,7 +191,7 @@ { int ch; - while((ch = ug_getc()) == -1) + while ((ch = ug_getc()) == -1) barrier(); return ch; } @@ -203,7 +203,7 @@ { if (!ug_is_rxfifo_ready()) return -1; - return ug_getc(); + return ug_getc(); } /* @@ -255,8 +255,8 @@ goto done; } - for(np = NULL; - (np = of_find_compatible_node(np, NULL, "usbgecko,usbgecko")); ) + for (np = NULL; + (np = of_find_compatible_node(np, NULL, "usbgecko,usbgecko"));) if (np == stdout) break; @@ -293,7 +293,7 @@ * USB Gecko early debug support initialization for udbg. * */ -void __init udbg_init_debug_usbgecko(void) +void __init udbg_init_usbgecko(void) { unsigned long vaddr, paddr; @@ -316,4 +316,3 @@ } #endif /* CONFIG_PPC_EARLY_DEBUG_USBGECKO */ - Index: gcnvi_udbg.h =================================================================== RCS file: /cvsroot/gc-linux/linux/arch/powerpc/platforms/embedded6xx/gcnvi_udbg.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- gcnvi_udbg.h 15 Nov 2008 20:10:14 -0000 1.1 +++ gcnvi_udbg.h 1 Feb 2009 18:29:35 -0000 1.2 @@ -2,8 +2,8 @@ * arch/powerpc/platforms/embedded6xx/gcnvi_udbg.h * * Nintendo GameCube/Wii framebuffer udbg output support. - * Copyright (C) 2008 The GameCube Linux Team - * Copyright (C) 2008 Albert Herranz + * Copyright (C) 2008-2009 The GameCube Linux Team + * Copyright (C) 2008,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 @@ -28,4 +28,3 @@ #endif /* CONFIG_GAMECUBE_VIDEO_UDBG */ #endif /* __GCNVI_UDBG_H */ - Index: usbgecko_udbg.h =================================================================== RCS file: /cvsroot/gc-linux/linux/arch/powerpc/platforms/embedded6xx/usbgecko_udbg.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- usbgecko_udbg.h 27 Mar 2008 22:35:24 -0000 1.1 +++ usbgecko_udbg.h 1 Feb 2009 18:29:35 -0000 1.2 @@ -2,8 +2,8 @@ * arch/powerpc/platforms/embedded6xx/usbgecko_udbg.h * * udbg serial input/output routines for the USB Gecko adapter. - * Copyright (C) 2008 The GameCube Linux Team - * Copyright (C) 2008 Albert Herranz + * Copyright (C) 2008-2009 The GameCube Linux Team + * Copyright (C) 2008,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 @@ -27,13 +27,10 @@ #endif /* CONFIG_USBGECKO_UDBG */ - #ifdef CONFIG_PPC_EARLY_DEBUG_USBGECKO -void __init udbg_init_debug_usbgecko(void); +void __init udbg_init_usbgecko(void); #endif /* CONFIG_PPC_EARLY_DEBUG_USBGECKO */ - #endif /* __USBGECKO_UDBG_H */ - Index: Kconfig =================================================================== RCS file: /cvsroot/gc-linux/linux/arch/powerpc/platforms/embedded6xx/Kconfig,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- Kconfig 15 Nov 2008 20:10:14 -0000 1.6 +++ Kconfig 1 Feb 2009 18:29:35 -0000 1.7 @@ -96,8 +96,8 @@ depends on EMBEDDED6xx select GAMECUBE_COMMON help - Select GAMECUBE if configuring for the Nintendo GameCube. - More information at: <http://gc-linux.sourceforge.net/> + Select GAMECUBE if configuring for the Nintendo GameCube. + More information at: <http://gc-linux.sourceforge.net/> config WII bool "Nintendo-Wii" @@ -105,8 +105,8 @@ select GAMECUBE_COMMON select PPC_LIB_RHEAP help - Select WII if configuring for the Nintendo Wii. - More information at: <http://gc-linux.sourceforge.net/> + Select WII if configuring for the Nintendo Wii. + More information at: <http://gc-linux.sourceforge.net/> config FLIPPER_PIC bool @@ -114,19 +114,9 @@ config GAMECUBE_COMMON bool - select FLIPPER_PIC select NOT_COHERENT_CACHE + select FLIPPER_PIC default n - -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 GAMECUBE_UDBG bool "Nintendo GameCube/Wii udbg support" @@ -135,23 +125,23 @@ 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 an USB serial-to-spi converter that can be plugged + 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 @@ -161,11 +151,21 @@ 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 @@ -174,6 +174,6 @@ 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.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- wii_dev.c 13 Sep 2008 19:42:53 -0000 1.4 +++ wii_dev.c 1 Feb 2009 18:29:35 -0000 1.5 @@ -2,8 +2,8 @@ * arch/powerpc/platforms/embedded6xx/wii_dev.c * * Nintendo Wii platform device setup. - * Copyright (C) 2008 The GameCube Linux Team - * Copyright (C) 2008 Albert Herranz + * Copyright (C) 2008-2009 The GameCube Linux Team + * Copyright (C) 2008,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 Index: wii.c =================================================================== RCS file: /cvsroot/gc-linux/linux/arch/powerpc/platforms/embedded6xx/wii.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- wii.c 25 Nov 2008 19:09:31 -0000 1.3 +++ wii.c 1 Feb 2009 18:29:35 -0000 1.4 @@ -2,8 +2,8 @@ * arch/powerpc/platforms/embedded6xx/wii.c * * Nintendo Wii board-specific support - * Copyright (C) 2008 The GameCube Linux Team - * Copyright (C) 2008 Albert Herranz + * Copyright (C) 2008-2009 The GameCube Linux Team + * Copyright (C) 2008,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 @@ -71,13 +71,13 @@ static int __init wii_probe(void) { - unsigned long dt_root; + unsigned long dt_root; - dt_root = of_get_flat_dt_root(); - if (!of_flat_dt_is_compatible(dt_root, "nintendo,wii")) - return 0; + dt_root = of_get_flat_dt_root(); + if (!of_flat_dt_is_compatible(dt_root, "nintendo,wii")) + return 0; - return 1; + return 1; } #ifdef CONFIG_KEXEC Index: starlet-ipc.c =================================================================== RCS file: /cvsroot/gc-linux/linux/arch/powerpc/platforms/embedded6xx/starlet-ipc.c,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- starlet-ipc.c 13 Sep 2008 19:42:53 -0000 1.6 +++ starlet-ipc.c 1 Feb 2009 18:29:35 -0000 1.7 @@ -2,8 +2,8 @@ * arch/powerpc/platforms/embedded6xx/starlet-ipc.c * * Nintendo Wii starlet IPC driver - * Copyright (C) 2008 The GameCube Linux Team - * Copyright (C) 2008 Albert Herranz + * Copyright (C) 2008-2009 The GameCube Linux Team + * Copyright (C) 2008,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 @@ -14,7 +14,7 @@ #define DEBUG -//#define DBG(fmt, arg...) pr_debug(fmt, ##arg) +/*#define DBG(fmt, arg...) pr_debug(fmt, ##arg)*/ #define DBG(fmt, arg...) drv_printk(KERN_INFO, fmt, ##arg) #include <linux/kernel.h> @@ -42,7 +42,7 @@ static char starlet_ipc_driver_version[] = "0.2i"; #define drv_printk(level, format, arg...) \ - printk(level DRV_MODULE_NAME ": " format , ## arg) + printk(level DRV_MODULE_NAME ": " format , ## arg) /* * Hardware registers @@ -82,7 +82,7 @@ /* * Update control and status register. */ -static inline void starlet_ipc_update_csr(void __iomem * io_base, u32 val) +static inline void starlet_ipc_update_csr(void __iomem *io_base, u32 val) { u32 csr; @@ -96,7 +96,7 @@ /* * Put data for starlet in the transmit fifo. */ -static inline void starlet_ipc_sendto(void __iomem * io_base, u32 data) +static inline void starlet_ipc_sendto(void __iomem *io_base, u32 data) { out_be32(io_base + STARLET_IPC_TXBUF, data); } @@ -104,7 +104,7 @@ /* * Get data from starlet out the receive fifo. */ -static inline u32 starlet_ipc_recvfrom(void __iomem * io_base) +static inline u32 starlet_ipc_recvfrom(void __iomem *io_base) { return in_be32(io_base + STARLET_IPC_RXBUF); } @@ -112,7 +112,7 @@ /* * Issue an end-of-interrupt sequence. */ -static void starlet_ipc_eoi(void __iomem * io_base) +static void starlet_ipc_eoi(void __iomem *io_base) { starlet_ipc_update_csr(io_base, STARLET_IPC_CSR_INT); } @@ -141,13 +141,13 @@ #define __case_string(_s) \ case _s: \ str = #_s; \ - break; + break; static char *stipc_cmd_string(u32 cmd) { char *str = "unknown"; - switch(cmd) { + switch (cmd) { __case_string(STARLET_IOS_OPEN) __case_string(STARLET_IOS_CLOSE) __case_string(STARLET_IOS_IOCTL) @@ -168,7 +168,7 @@ , stipc_cmd_string(req->cmd), req->cmd, req->result, req->result, - (req->result == 0xdeadbeef)?" /* pending */":"", + (req->result == 0xdeadbeef) ? " /* pending */" : "", jiffies_to_msecs(jiffies - req->jiffies) / 1000, (void *)req->dma_addr ); @@ -617,11 +617,10 @@ fd, request, ibuf, ilen, obuf, olen); - if (!error) { + if (!error) starlet_ipc_call_nowait(req, callback, arg); - } else { + else starlet_ipc_free_request(req); - } if (error) DBG("%s: error=%d (%x)\n", __func__, error, error); @@ -730,11 +729,10 @@ error = starlet_ioctl_prepare(req, fd, request, ibuf, ilen, obuf, olen); - if (!error) { + if (!error) starlet_ipc_call_nowait(req, callback, arg); - } else { + else starlet_ipc_free_request(req); - } if (error) DBG("%s: error=%d (%x)\n", __func__, error, error); @@ -770,13 +768,13 @@ struct starlet_iovec *p; p = iovec; nents = req->sgl_nents_in; - while(nents--) { + while (nents--) { DBG("%s: in: dma_addr=%p, dma_len=%u\n", __func__, (void *)p->dma_addr, p->dma_len); p++; } nents = req->sgl_nents_io; - while(nents--) { + while (nents--) { DBG("%s: io: dma_addr=%p, dma_len=%u\n", __func__, (void *)p->dma_addr, p->dma_len); p++; @@ -930,11 +928,10 @@ error = starlet_ioctlv_prepare(req, fd, request, nents_in, sgl_in, nents_io, sgl_io); - if (!error) { + if (!error) starlet_ipc_call_nowait(req, callback, arg); - } else { + else starlet_ipc_free_request(req); - } if (error < 0) DBG("%s: error=%d (%x)\n", __func__, error, error); @@ -1010,13 +1007,13 @@ struct starlet_iovec *p; p = iovec; nents = req->sgl_nents_in; - while(nents--) { + while (nents--) { DBG("%s: in: dma_addr=%p, dma_len=%u\n", __func__, (void *)p->dma_addr, p->dma_len); p++; } nents = req->sgl_nents_io; - while(nents--) { + while (nents--) { DBG("%s: io: dma_addr=%p, dma_len=%u\n", __func__, (void *)p->dma_addr, p->dma_len); p++; @@ -1166,11 +1163,10 @@ error = starlet_ioh_ioctlv_prepare(req, fd, request, nents_in, ioh_sgl_in, nents_io, ioh_sgl_io); - if (!error) { + if (!error) starlet_ipc_call_nowait(req, callback, arg); - } else { + else starlet_ipc_free_request(req); - } if (error < 0) DBG("%s: error=%d (%x)\n", __func__, error, error); @@ -1210,7 +1206,7 @@ } spin_unlock_irqrestore(&ipc_dev->list_lock, flags); - mod_timer(&ipc_dev->timer, jiffies + STARLET_IPC_WATCHDOG_TIME); + mod_timer(&ipc_dev->timer, jiffies + STARLET_IPC_WATCHDOG_TIME); #endif } @@ -1231,7 +1227,7 @@ void *gpio; /* close any open file descriptors, just in case */ - for(fd = 0; fd < 24; fd++) + for (fd = 0; fd < 24; fd++) starlet_close(fd); /* |