This list is closed, nobody may subscribe to it.
2004 |
Jan
(53) |
Feb
(78) |
Mar
(34) |
Apr
(26) |
May
(25) |
Jun
(34) |
Jul
(16) |
Aug
(16) |
Sep
(2) |
Oct
(58) |
Nov
(13) |
Dec
(32) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2005 |
Jan
(62) |
Feb
(4) |
Mar
(40) |
Apr
(9) |
May
(13) |
Jun
(26) |
Jul
(32) |
Aug
(24) |
Sep
(18) |
Oct
(18) |
Nov
(14) |
Dec
|
2006 |
Jan
(15) |
Feb
(2) |
Mar
(23) |
Apr
(2) |
May
(2) |
Jun
(13) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
|
2007 |
Jan
(1) |
Feb
(45) |
Mar
|
Apr
(13) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
(31) |
Dec
(5) |
2008 |
Jan
(6) |
Feb
(34) |
Mar
(113) |
Apr
(40) |
May
(19) |
Jun
(5) |
Jul
(41) |
Aug
(13) |
Sep
(53) |
Oct
(4) |
Nov
(53) |
Dec
|
2009 |
Jan
(1) |
Feb
(29) |
Mar
(66) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(163) |
Nov
|
Dec
(91) |
From: Albert H. <he...@us...> - 2009-02-01 18:30:02
|
Update of /cvsroot/gc-linux/linux/drivers/video In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv17186/drivers/video Modified Files: Kconfig Makefile gcnfb.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: gcnfb.c =================================================================== RCS file: /cvsroot/gc-linux/linux/drivers/video/gcnfb.c,v retrieving revision 1.21 retrieving revision 1.22 diff -u -d -r1.21 -r1.22 --- gcnfb.c 25 Nov 2008 19:09:31 -0000 1.21 +++ gcnfb.c 1 Feb 2009 18:29:35 -0000 1.22 @@ -2,10 +2,10 @@ * drivers/video/gcn-vifb.c * * Nintendo GameCube/Wii Video Interface (VI) frame buffer driver - * Copyright (C) 2004-2008 The GameCube Linux Team + * Copyright (C) 2004-2009 The GameCube Linux Team * Copyright (C) 2004 Michael Steil <mi...@c6...> * Copyright (C) 2004,2005 Todd Jeffreys <to...@vo...> - * Copyright (C) 2006,2007,2008 Albert Herranz + * Copyright (C) 2006,2007,2008,2009 Albert Herranz * * Based on vesafb (c) 1998 Gerd Knorr <kr...@go...> * @@ -25,24 +25,21 @@ #include <linux/mm.h> #include <linux/module.h> #include <linux/of_platform.h> -//#include <linux/slab.h> #include <linux/string.h> #include <linux/tty.h> #include <linux/wait.h> -#include <asm/io.h> - -#include "gcngx.h" +#include <linux/io.h> #define DRV_MODULE_NAME "gcn-vifb" #define DRV_DESCRIPTION "Nintendo GameCube/Wii Video Interface (VI) driver" #define DRV_AUTHOR "Michael Steil <mi...@c6...>, " \ - "Todd Jeffreys <to...@vo...>, " \ + "Todd Jeffreys <to...@vo...>, " \ "Albert Herranz" static char vifb_driver_version[] = "1.0i"; #define drv_printk(level, format, arg...) \ - printk(level DRV_MODULE_NAME ": " format , ## arg) + printk(level DRV_MODULE_NAME ": " format , ## arg) /* @@ -206,7 +203,7 @@ /* * setup parameters */ -static struct vi_video_mode *vi_current_video_mode = NULL; +static struct vi_video_mode *vi_current_video_mode; static int ypan = 1; /* 0..nothing, 1..ypan */ /* FIXME: is this really needed? */ @@ -241,17 +238,17 @@ #define RGB2YUV_LUMA 16 #define RGB2YUV_CHROMA 128 -#define Yr ((int)( 0.299*(1<<RGB2YUV_SHIFT))) -#define Yg ((int)( 0.587*(1<<RGB2YUV_SHIFT))) -#define Yb ((int)( 0.114*(1<<RGB2YUV_SHIFT))) +#define Yr ((int)(0.299 * (1<<RGB2YUV_SHIFT))) +#define Yg ((int)(0.587 * (1<<RGB2YUV_SHIFT))) +#define Yb ((int)(0.114 * (1<<RGB2YUV_SHIFT))) -#define Ur ((int)(-0.169*(1<<RGB2YUV_SHIFT))) -#define Ug ((int)(-0.331*(1<<RGB2YUV_SHIFT))) -#define Ub ((int)( 0.500*(1<<RGB2YUV_SHIFT))) +#define Ur ((int)(-0.169 * (1<<RGB2YUV_SHIFT))) +#define Ug ((int)(-0.331 * (1<<RGB2YUV_SHIFT))) +#define Ub ((int)(0.500 * (1<<RGB2YUV_SHIFT))) -#define Vr ((int)( 0.500*(1<<RGB2YUV_SHIFT))) /* same as Ub */ -#define Vg ((int)(-0.419*(1<<RGB2YUV_SHIFT))) -#define Vb ((int)(-0.081*(1<<RGB2YUV_SHIFT))) +#define Vr ((int)(0.500 * (1<<RGB2YUV_SHIFT))) /* same as Ub */ +#define Vg ((int)(-0.419 * (1<<RGB2YUV_SHIFT))) +#define Vb ((int)(-0.081 * (1<<RGB2YUV_SHIFT))) /* * Converts two 16bpp rgb pixels into a dual yuy2 pixel. @@ -264,9 +261,8 @@ register int r, g, b; /* fast path, thanks to bohdy */ - if (!(rgb1 | rgb2)) { + if (!(rgb1 | rgb2)) return 0x00800080; /* black, black */ - } /* RGB565 */ r1 = ((rgb1 >> 11) & 0x1f); @@ -394,9 +390,8 @@ out_be32(io_base + VI_TFBL, 0x10000000 | (addr >> 5)); /* set bottom field */ - if (!vi_is_mode_progressive(info->var.vmode)) { + if (!vi_is_mode_progressive(info->var.vmode)) addr += info->fix.line_length; - } out_be32(io_base + VI_BFBL, 0x10000000 | (addr >> 5)); } @@ -514,7 +509,7 @@ */ unsigned int vifb_writel(unsigned int rgbrgb, void *address) { - uint16_t *rgb = (uint16_t *) & rgbrgb; + uint16_t *rgb = (uint16_t *)&rgbrgb; return fb_writel_real(rgbrgb16toycbycr(rgb[0], rgb[1]), address); } @@ -628,7 +623,7 @@ switch (cmd) { case FBIOWAITRETRACE: interruptible_sleep_on(&ctl->vtrace_waitq); - return (signal_pending(current) ? -EINTR : 0); + return signal_pending(current) ? -EINTR : 0; case FBIOFLIPHACK: /* * If arg == NULL then @@ -667,8 +662,8 @@ ctl->flip_pending = 1; spin_unlock_irqrestore(&ctl->lock, flags); interruptible_sleep_on(&ctl->vtrace_waitq); - return (signal_pending(current) ? - -EINTR : ctl->visible_page); + return signal_pending(current) ? + -EINTR : ctl->visible_page; } } spin_unlock_irqrestore(&ctl->lock, flags); @@ -707,7 +702,8 @@ /* XXX isobel, do not break old sdl */ var->yres_virtual > 2 * vi_current_video_mode->height || var->yres > vi_current_video_mode->height || - (vi_is_mode_progressive(var->vmode) && !vi_can_do_progressive(ctl))) { /* trying to set progressive? */ + (vi_is_mode_progressive(var->vmode) && + !vi_can_do_progressive(ctl))) { /* trying to set progressive? */ return -EINVAL; } return 0; @@ -715,32 +711,32 @@ static int vifb_mmap(struct fb_info *info, struct vm_area_struct *vma) { - unsigned long off; - unsigned long start; - u32 len; + unsigned long off; + unsigned long start; + u32 len; off = vma->vm_pgoff << PAGE_SHIFT; - /* frame buffer memory */ - start = info->fix.smem_start; - len = PAGE_ALIGN((start & ~PAGE_MASK) + info->fix.smem_len); - start &= PAGE_MASK; - if ((vma->vm_end - vma->vm_start + off) > len) - return -EINVAL; - off += start; - vma->vm_pgoff = off >> PAGE_SHIFT; + /* frame buffer memory */ + start = info->fix.smem_start; + len = PAGE_ALIGN((start & ~PAGE_MASK) + info->fix.smem_len); + start &= PAGE_MASK; + if ((vma->vm_end - vma->vm_start + off) > len) + return -EINVAL; + off += start; + vma->vm_pgoff = off >> PAGE_SHIFT; - /* this is an IO map, tell maydump to skip this VMA */ - vma->vm_flags |= VM_IO | VM_RESERVED; + /* this is an IO map, tell maydump to skip this VMA */ + vma->vm_flags |= VM_IO | VM_RESERVED; /* we share RAM between the cpu and the video hardware */ vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot); - if (io_remap_pfn_range(vma, vma->vm_start, off >> PAGE_SHIFT, - vma->vm_end - vma->vm_start, - vma->vm_page_prot)) - return -EAGAIN; - return 0; + if (io_remap_pfn_range(vma, vma->vm_start, off >> PAGE_SHIFT, + vma->vm_end - vma->vm_start, + vma->vm_page_prot)) + return -EAGAIN; + return 0; } @@ -1046,11 +1042,11 @@ MODULE_DEVICE_TABLE(of, vifb_of_match); static struct of_platform_driver vifb_of_driver = { - .owner = THIS_MODULE, - .name = DRV_MODULE_NAME, - .match_table = vifb_of_match, - .probe = vifb_of_probe, - .remove = vifb_of_remove, + .owner = THIS_MODULE, + .name = DRV_MODULE_NAME, + .match_table = vifb_of_match, + .probe = vifb_of_probe, + .remove = vifb_of_remove, }; /* @@ -1061,14 +1057,14 @@ static int __init vifb_init_module(void) { #ifndef MODULE - char *option = NULL; + char *option = NULL; - if (fb_get_options(DRV_MODULE_NAME, &option)) { - /* for backwards compatibility */ - if (fb_get_options("gcnfb", &option)) - return -ENODEV; - } - vifb_setup(option); + if (fb_get_options(DRV_MODULE_NAME, &option)) { + /* for backwards compatibility */ + if (fb_get_options("gcnfb", &option)) + return -ENODEV; + } + vifb_setup(option); #endif drv_printk(KERN_INFO, "%s - version %s\n", DRV_DESCRIPTION, Index: Makefile =================================================================== RCS file: /cvsroot/gc-linux/linux/drivers/video/Makefile,v retrieving revision 1.28 retrieving revision 1.29 diff -u -d -r1.28 -r1.29 --- Makefile 15 Nov 2008 20:10:15 -0000 1.28 +++ Makefile 1 Feb 2009 18:29:35 -0000 1.29 @@ -29,7 +29,6 @@ # Hardware specific drivers go first obj-$(CONFIG_FB_AMIGA) += amifb.o c2p.o -obj-$(CONFIG_FB_AM200EPD) += am200epd.o obj-$(CONFIG_FB_ARC) += arcfb.o obj-$(CONFIG_FB_CLPS711X) += clps711xfb.o obj-$(CONFIG_FB_CYBER2000) += cyber2000fb.o @@ -43,6 +42,7 @@ obj-$(CONFIG_FB_ATY128) += aty/ macmodes.o obj-$(CONFIG_FB_RADEON) += aty/ obj-$(CONFIG_FB_SIS) += sis/ +obj-$(CONFIG_FB_VIA) += via/ obj-$(CONFIG_FB_KYRO) += kyro/ obj-$(CONFIG_FB_SAVAGE) += savage/ obj-$(CONFIG_FB_GEODE) += geode/ @@ -98,6 +98,7 @@ obj-$(CONFIG_FB_ASILIANT) += asiliantfb.o obj-$(CONFIG_FB_PXA) += pxafb.o obj-$(CONFIG_FB_W100) += w100fb.o +obj-$(CONFIG_FB_TMIO) += tmiofb.o obj-$(CONFIG_FB_AU1100) += au1100fb.o obj-$(CONFIG_FB_AU1200) += au1200fb.o obj-$(CONFIG_FB_PMAG_AA) += pmag-aa-fb.o @@ -121,14 +122,13 @@ obj-$(CONFIG_FB_OMAP) += omap/ obj-$(CONFIG_XEN_FBDEV_FRONTEND) += xen-fbfront.o obj-$(CONFIG_FB_CARMINE) += carminefb.o +obj-$(CONFIG_FB_MB862XX) += mb862xx/ obj-$(CONFIG_FB_GAMECUBE) += gcnfb.o obj-$(CONFIG_FB_GAMECUBE_GX) += gcngx.o - # Platform or fallback drivers go here obj-$(CONFIG_FB_UVESA) += uvesafb.o obj-$(CONFIG_FB_VESA) += vesafb.o -obj-$(CONFIG_FB_IMAC) += imacfb.o obj-$(CONFIG_FB_EFI) += efifb.o obj-$(CONFIG_FB_VGA16) += vga16fb.o obj-$(CONFIG_FB_OF) += offb.o Index: Kconfig =================================================================== RCS file: /cvsroot/gc-linux/linux/drivers/video/Kconfig,v retrieving revision 1.30 retrieving revision 1.31 diff -u -d -r1.30 -r1.31 --- Kconfig 15 Nov 2008 20:10:15 -0000 1.30 +++ Kconfig 1 Feb 2009 18:29:35 -0000 1.31 @@ -76,6 +76,14 @@ select I2C default n +config FB_BOOT_VESA_SUPPORT + bool + depends on FB + default n + ---help--- + If true, at least one selected framebuffer driver can take advantage + of VESA video modes set at an early boot stage via the vga= parameter. + config FB_CFB_FILLRECT tristate depends on FB @@ -172,11 +180,6 @@ bool depends on FB -config FB_METRONOME - tristate - depends on FB - depends on FB_DEFERRED_IO - config FB_HECUBA tristate depends on FB @@ -259,16 +262,24 @@ select FB_CFB_COPYAREA select FB_CFB_IMAGEBLIT help - This is the frame buffer device driver for the Permedia2 AGP frame - buffer card from ASK, aka `Graphic Blaster Exxtreme'. There is a - product page at - <http://www.ask.com.hk/product/Permedia%202/permedia2.htm>. + This is the frame buffer device driver for cards based on + the 3D Labs Permedia, Permedia 2 and Permedia 2V chips. + The driver was tested on the following cards: + Diamond FireGL 1000 PRO AGP + ELSA Gloria Synergy PCI + Appian Jeronimo PRO (both heads) PCI + 3DLabs Oxygen ACX aka EONtronics Picasso P2 PCI + Techsource Raptor GFX-8P (aka Sun PGX-32) on SPARC + ASK Graphic Blaster Exxtreme AGP + + To compile this driver as a module, choose M here: the + module will be called pm2fb. config FB_PM2_FIFO_DISCONNECT bool "enable FIFO disconnect feature" depends on FB_PM2 && PCI help - Support the Permedia2 FIFO disconnect feature (see CONFIG_FB_PM2). + Support the Permedia2 FIFO disconnect feature. config FB_ARMCLCD tristate "ARM PrimeCell PL110 support" @@ -678,7 +689,7 @@ select FB_CFB_FILLRECT select FB_CFB_COPYAREA select FB_CFB_IMAGEBLIT - select VIDEO_SELECT + select FB_BOOT_VESA_SUPPORT help This is the frame buffer device driver for generic VESA 2.0 compliant graphic cards. The older VESA 1.2 cards are not supported. @@ -687,23 +698,14 @@ config FB_EFI bool "EFI-based Framebuffer Support" - depends on (FB = y) && X86 - select FB_CFB_FILLRECT - select FB_CFB_COPYAREA - select FB_CFB_IMAGEBLIT - help - This is the EFI frame buffer device driver. If the firmware on - your platform is UEFI2.0, select Y to add support for - Graphics Output Protocol for early console messages to appear. - -config FB_IMAC - bool "Intel-based Macintosh Framebuffer Support" depends on (FB = y) && X86 && EFI select FB_CFB_FILLRECT select FB_CFB_COPYAREA select FB_CFB_IMAGEBLIT help - This is the frame buffer device driver for the Intel-based Macintosh + This is the EFI frame buffer device driver. If the firmware on + your platform is EFI 1.10 or UEFI 2.0, select Y to add support for + using the EFI framebuffer as your console. config FB_N411 tristate "N411 Apollo/Hecuba devkit support" @@ -1124,6 +1126,7 @@ select FB_CFB_FILLRECT select FB_CFB_COPYAREA select FB_CFB_IMAGEBLIT + select FB_BOOT_VESA_SUPPORT help This driver supports the on-board graphics built in to the Intel 830M/845G/852GM/855GM/865G/915G/915GM/945G/945GM/965G/965GM chipsets. @@ -1476,6 +1479,7 @@ select FB_CFB_FILLRECT select FB_CFB_COPYAREA select FB_CFB_IMAGEBLIT + select FB_BOOT_VESA_SUPPORT help This is the frame buffer device driver for the SiS 300, 315, 330 and 340 series as well as XGI V3XT, V5, V8, Z7 graphics chipsets. @@ -1498,6 +1502,24 @@ (315/H/PRO, 55x, 650, 651, 740, 330, 661, 741, 760, 761) as well as XGI V3XT, V5, V8 and Z7. +config FB_VIA + tristate "VIA UniChrome (Pro) and Chrome9 display support" + depends on FB && PCI + select FB_CFB_FILLRECT + select FB_CFB_COPYAREA + select FB_CFB_IMAGEBLIT + select FB_SOFT_CURSOR + select I2C_ALGOBIT + select I2C + help + This is the frame buffer device driver for Graphics chips of VIA + UniChrome (Pro) Family (CLE266,PM800/CN400,P4M800CE/P4M800Pro/ + CN700/VN800,CX700/VX700,P4M890) and Chrome9 Family (K8M890,CN896 + /P4M900,VX800) + Say Y if you have a VIA UniChrome graphics board. + + To compile this driver as a module, choose M here: the + module will be called viafb. config FB_NEOMAGIC tristate "NeoMagic display support" depends on FB && PCI @@ -1527,25 +1549,25 @@ module will be called kyrofb. config FB_3DFX - tristate "3Dfx Banshee/Voodoo3 display support" + tristate "3Dfx Banshee/Voodoo3/Voodoo5 display support" depends on FB && PCI select FB_CFB_IMAGEBLIT select FB_CFB_FILLRECT select FB_CFB_COPYAREA help - This driver supports graphics boards with the 3Dfx Banshee/Voodoo3 - chips. Say Y if you have such a graphics board. + This driver supports graphics boards with the 3Dfx Banshee, + Voodoo3 or VSA-100 (aka Voodoo4/5) chips. Say Y if you have + such a graphics board. To compile this driver as a module, choose M here: the module will be called tdfxfb. config FB_3DFX_ACCEL - bool "3Dfx Banshee/Voodoo3 Acceleration functions (EXPERIMENTAL)" + bool "3Dfx Acceleration functions (EXPERIMENTAL)" depends on FB_3DFX && EXPERIMENTAL ---help--- - This will compile the 3Dfx Banshee/Voodoo3 frame buffer device - with acceleration functions. - + This will compile the 3Dfx Banshee/Voodoo3/VSA-100 frame buffer + device driver with acceleration functions. config FB_VOODOO1 tristate "3Dfx Voodoo Graphics (sst1) support" @@ -1583,7 +1605,6 @@ tristate "Cyberblade/i1 support" depends on FB && PCI && X86_32 && !64BIT select FB_CFB_IMAGEBLIT - select VIDEO_SELECT ---help--- This driver is supposed to support the Trident Cyberblade/i1 graphics core integrated in the VIA VT8601A North Bridge, @@ -1611,17 +1632,16 @@ select FB_CFB_COPYAREA select FB_CFB_IMAGEBLIT ---help--- - This driver is supposed to support graphics boards with the - Trident CyberXXXX/Image/CyberBlade chips mostly found in laptops + This is the frame buffer device driver for Trident PCI/AGP chipsets. + Supported chipset families are TGUI 9440/96XX, 3DImage, Blade3D + and Blade XP. + There are also integrated versions of these chips called CyberXXXX, + CyberImage or CyberBlade. These chips are mostly found in laptops but also on some motherboards. For more information, read <file:Documentation/fb/tridentfb.txt> - Cyberblade/i1 support will be removed soon, use the cyblafb driver - instead. - Say Y if you have such a graphics board. - To compile this driver as a module, choose M here: the module will be called tridentfb. @@ -1891,6 +1911,28 @@ ---help--- Frame buffer driver for the on-chip SH-Mobile LCD controller. +config FB_TMIO + tristate "Toshiba Mobile IO FrameBuffer support" + depends on FB && MFD_CORE + select FB_CFB_FILLRECT + select FB_CFB_COPYAREA + select FB_CFB_IMAGEBLIT + ---help--- + Frame buffer driver for the Toshiba Mobile IO integrated as found + on the Sharp SL-6000 series + + This driver is also available as a module ( = code which can be + inserted and removed from the running kernel whenever you want). The + module will be called tmiofb. If you want to compile it as a module, + say M here and read <file:Documentation/kbuild/modules.txt>. + + If unsure, say N. + +config FB_TMIO_ACCELL + bool "tmiofb acceleration" + depends on FB_TMIO + default y + config FB_S3C2410 tristate "S3C2410 LCD framebuffer support" depends on FB && ARCH_S3C2410 @@ -1989,19 +2031,6 @@ framebuffer. ML300 carries a 640*480 LCD display on the board, ML403 uses a standard DB15 VGA connector. -config FB_AM200EPD - tristate "AM-200 E-Ink EPD devkit support" - depends on FB && ARCH_PXA && MMU - select FB_SYS_FILLRECT - select FB_SYS_COPYAREA - select FB_SYS_IMAGEBLIT - select FB_SYS_FOPS - select FB_DEFERRED_IO - select FB_METRONOME - help - This enables support for the Metronome display controller used on - the E-Ink AM-200 EPD devkit. - config FB_COBALT tristate "Cobalt server LCD frame buffer support" depends on FB && MIPS_COBALT @@ -2056,6 +2085,51 @@ frame buffer driver. It communicates with a back-end in another domain. +config FB_METRONOME + tristate "E-Ink Metronome/8track controller support" + depends on FB + select FB_SYS_FILLRECT + select FB_SYS_COPYAREA + select FB_SYS_IMAGEBLIT + select FB_SYS_FOPS + select FB_DEFERRED_IO + help + This driver implements support for the E-Ink Metronome + controller. The pre-release name for this device was 8track + and could also have been called by some vendors as PVI-nnnn. + +config FB_MB862XX + tristate "Fujitsu MB862xx GDC support" + depends on FB + select FB_CFB_FILLRECT + select FB_CFB_COPYAREA + select FB_CFB_IMAGEBLIT + ---help--- + Frame buffer driver for Fujitsu Carmine/Coral-P(A)/Lime controllers. + +config FB_MB862XX_PCI_GDC + bool "Carmine/Coral-P(A) GDC" + depends on PCI && FB_MB862XX + ---help--- + This enables framebuffer support for Fujitsu Carmine/Coral-P(A) + PCI graphics controller devices. + +config FB_MB862XX_LIME + bool "Lime GDC" + depends on FB_MB862XX + depends on OF && !FB_MB862XX_PCI_GDC + select FB_FOREIGN_ENDIAN + select FB_LITTLE_ENDIAN + ---help--- + Framebuffer support for Fujitsu Lime GDC on host CPU bus. + +config FB_PRE_INIT_FB + bool "Don't reinitialize, use bootloader's GDC/Display configuration" + depends on FB_MB862XX_LIME + ---help--- + Select this option if display contents should be inherited as set by + the bootloader. + source "drivers/video/omap/Kconfig" source "drivers/video/backlight/Kconfig" |
From: Albert H. <he...@us...> - 2009-02-01 18:30:02
|
Update of /cvsroot/gc-linux/linux/arch/powerpc/platforms In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv17186/arch/powerpc/platforms Modified Files: Kconfig.cputype 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: Kconfig.cputype =================================================================== RCS file: /cvsroot/gc-linux/linux/arch/powerpc/platforms/Kconfig.cputype,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- Kconfig.cputype 15 Nov 2008 20:10:14 -0000 1.5 +++ Kconfig.cputype 1 Feb 2009 18:29:35 -0000 1.6 @@ -50,6 +50,7 @@ select PPC_UDBG_16550 select 4xx_SOC select PPC_PCI_CHOICE + select PHYS_64BIT config E200 bool "Freescale e200" @@ -128,18 +129,19 @@ config PTE_64BIT bool - depends on 44x || E500 - default y if 44x - default y if E500 && PHYS_64BIT + depends on 44x || E500 || PPC_86xx + default y if PHYS_64BIT config PHYS_64BIT - bool 'Large physical address support' if E500 - depends on 44x || E500 - select RESOURCES_64BIT - default y if 44x + bool 'Large physical address support' if E500 || PPC_86xx + depends on (44x || E500 || PPC_86xx) && !PPC_83xx && !PPC_82xx ---help--- This option enables kernel support for larger than 32-bit physical - addresses. This features is not be available on all e500 cores. + addresses. This feature may not be available on all cores. + + If you have more than 3.5GB of RAM or so, you also need to enable + SWIOTLB under Kernel Options for this to work. The actual number + is platform-dependent. If in doubt, say N here. |
From: Albert H. <he...@us...> - 2009-02-01 18:29:58
|
Update of /cvsroot/gc-linux/linux/drivers/serial In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv17186/drivers/serial Modified Files: Kconfig Makefile usbgecko.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: Makefile =================================================================== RCS file: /cvsroot/gc-linux/linux/drivers/serial/Makefile,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- Makefile 15 Nov 2008 20:10:15 -0000 1.4 +++ Makefile 1 Feb 2009 18:29:35 -0000 1.5 @@ -4,6 +4,16 @@ obj-$(CONFIG_SERIAL_CORE) += serial_core.o obj-$(CONFIG_SERIAL_21285) += 21285.o + +# These Sparc drivers have to appear before others such as 8250 +# which share ttySx minor node space. Otherwise console device +# names change and other unplesantries. +obj-$(CONFIG_SERIAL_SUNCORE) += suncore.o +obj-$(CONFIG_SERIAL_SUNHV) += sunhv.o +obj-$(CONFIG_SERIAL_SUNZILOG) += sunzilog.o +obj-$(CONFIG_SERIAL_SUNSU) += sunsu.o +obj-$(CONFIG_SERIAL_SUNSAB) += sunsab.o + obj-$(CONFIG_SERIAL_8250) += 8250.o obj-$(CONFIG_SERIAL_8250_PNP) += 8250_pnp.o obj-$(CONFIG_SERIAL_8250_GSC) += 8250_gsc.o @@ -31,16 +41,10 @@ obj-$(CONFIG_SERIAL_S3C2410) += s3c2410.o obj-$(CONFIG_SERIAL_S3C2412) += s3c2412.o obj-$(CONFIG_SERIAL_S3C2440) += s3c2440.o -obj-$(CONFIG_SERIAL_SUNCORE) += suncore.o -obj-$(CONFIG_SERIAL_SUNHV) += sunhv.o -obj-$(CONFIG_SERIAL_SUNZILOG) += sunzilog.o obj-$(CONFIG_SERIAL_IP22_ZILOG) += ip22zilog.o -obj-$(CONFIG_SERIAL_SUNSU) += sunsu.o -obj-$(CONFIG_SERIAL_SUNSAB) += sunsab.o obj-$(CONFIG_SERIAL_MUX) += mux.o obj-$(CONFIG_SERIAL_68328) += 68328serial.o obj-$(CONFIG_SERIAL_68360) += 68360serial.o -obj-$(CONFIG_SERIAL_COLDFIRE) += mcfserial.o obj-$(CONFIG_SERIAL_MCF) += mcf.o obj-$(CONFIG_SERIAL_PMACZILOG) += pmac_zilog.o obj-$(CONFIG_SERIAL_LH7A40X) += serial_lh7a40x.o Index: usbgecko.c =================================================================== RCS file: /cvsroot/gc-linux/linux/drivers/serial/usbgecko.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- usbgecko.c 27 Mar 2008 22:35:41 -0000 1.4 +++ usbgecko.c 1 Feb 2009 18:29:35 -0000 1.5 @@ -2,8 +2,8 @@ * drivers/serial/usbgecko.c * * Console and TTY driver 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 @@ -86,7 +86,7 @@ { struct exi_device *exi_device = adapter->exi_device; - if (exi_device) + if (exi_device) ug_exi_io_transaction(exi_device, i, o); } #endif @@ -102,12 +102,12 @@ ug_exi_io_transaction(exi_device, 0x9000, &data); exi_dev_give(exi_device); - return (data == 0x0470); + return data == 0x0470; } #if 0 /* - * + * */ static int ug_is_txfifo_empty(struct ug_adapter *adapter) { @@ -120,13 +120,13 @@ if (!exi_dev_try_take(exi_device)) { ug_exi_io_transaction(exi_device, 0xC000, &data); exi_dev_give(exi_device); - return (data & 0x0400); + return data & 0x0400; } return 0; } /* - * + * */ static int ug_is_rxfifo_empty(struct ug_adapter *adapter) { @@ -139,13 +139,13 @@ if (!exi_dev_try_take(exi_device)) { ug_exi_io_transaction(exi_device, 0xD000, &data); exi_dev_give(exi_device); - return (data & 0x0400); + return data & 0x0400; } return 0; } /* - * + * */ static int ug_putc(struct ug_adapter *adapter, char c) { @@ -158,13 +158,13 @@ if (!exi_dev_try_take(exi_device)) { ug_exi_io_transaction(exi_device, 0xB000|(c<<4), &data); exi_dev_give(exi_device); - return (data & 0x0400); + return data & 0x0400; } return 0; } /* - * + * */ static int ug_getc(struct ug_adapter *adapter, char *c) { @@ -187,7 +187,7 @@ #endif /* - * + * */ static int ug_safe_putc(struct ug_adapter *adapter, char c) { @@ -199,16 +199,16 @@ if (!exi_dev_try_take(exi_device)) { ug_exi_io_transaction(exi_device, 0xC000, &data); - if ((data & 0x0400)) + if ((data & 0x0400)) ug_exi_io_transaction(exi_device, 0xB000|(c<<4), &data); exi_dev_give(exi_device); - return (data & 0x0400); + return data & 0x0400; } return 0; } /* - * + * */ static int ug_safe_getc(struct ug_adapter *adapter, char *c) { @@ -244,12 +244,12 @@ * */ static void ug_console_write(struct console *co, const char *buf, - unsigned int count) + unsigned int count) { struct ug_adapter *adapter = co->data; char *b = (char *)buf; - while(count--) { + while (count--) { if (*b == '\n') ug_safe_putc(adapter, '\r'); ug_safe_putc(adapter, *b++); @@ -260,21 +260,21 @@ * */ static int ug_console_read(struct console *co, char *buf, - unsigned int count) + unsigned int count) { struct ug_adapter *adapter = co->data; int i; char c; i = count; - while(i--) { + while (i--) { ug_safe_getc(adapter, &c); *buf++ = c; } return count; } -static struct tty_driver *ug_tty_driver = NULL; +static struct tty_driver *ug_tty_driver; static struct tty_driver *ug_console_device(struct console *co, int *index) { @@ -283,24 +283,24 @@ } -static struct console ug_consoles[]= { - { - .name = DRV_MODULE_NAME "0", - .write = ug_console_write, - .read = ug_console_read, - .device = ug_console_device, - .flags = CON_PRINTBUFFER | CON_ENABLED, - .index = 0, - .data = &ug_adapters[0], +static struct console ug_consoles[] = { + { + .name = DRV_MODULE_NAME "0", + .write = ug_console_write, + .read = ug_console_read, + .device = ug_console_device, + .flags = CON_PRINTBUFFER | CON_ENABLED, + .index = 0, + .data = &ug_adapters[0], }, { - .name = DRV_MODULE_NAME "1", - .write = ug_console_write, - .read = ug_console_read, - .device = ug_console_device, - .flags = CON_PRINTBUFFER | CON_ENABLED, - .index = 1, - .data = &ug_adapters[1], + .name = DRV_MODULE_NAME "1", + .write = ug_console_write, + .read = ug_console_read, + .device = ug_console_device, + .flags = CON_PRINTBUFFER | CON_ENABLED, + .index = 1, + .data = &ug_adapters[1], }, }; @@ -323,7 +323,7 @@ set_task_state(current, TASK_RUNNING); chunk = 0; - while(!kthread_should_stop()) { + while (!kthread_should_stop()) { count = 0; adapter = tty->driver_data; if (adapter) @@ -415,7 +415,7 @@ index = tty->index; adapter = &ug_adapters[index]; - for(i = 0; i < count; i++) + for (i = 0; i < count; i++) ug_safe_putc(adapter, *b++); return count; } @@ -482,7 +482,7 @@ */ /* - * + * */ static int ug_probe(struct exi_device *exi_device) { @@ -494,7 +494,7 @@ if (exi_device->eid.id != EXI_ID_NONE) return -ENODEV; - if (!ug_check_adapter(exi_device)) + if (!ug_check_adapter(exi_device)) return -ENODEV; slot = to_channel(exi_get_exi_channel(exi_device)); @@ -531,9 +531,8 @@ console = &ug_consoles[slot]; adapter = console->data; - if (adapter->refcnt) { + if (adapter->refcnt) drv_printk(KERN_ERR, "adapter removed while in use!\n"); - } ug_tty_exit(); Index: Kconfig =================================================================== RCS file: /cvsroot/gc-linux/linux/drivers/serial/Kconfig,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- Kconfig 15 Nov 2008 20:10:15 -0000 1.5 +++ Kconfig 1 Feb 2009 18:29:35 -0000 1.6 @@ -9,7 +9,6 @@ # The new 8250/16550 serial drivers config SERIAL_8250 tristate "8250/16550 and compatible serial support" - depends on (BROKEN || !SPARC) select SERIAL_CORE ---help--- This selects whether you want to include the driver for the standard @@ -458,7 +457,7 @@ config SERIAL_SAMSUNG_DEBUG bool "Samsung SoC serial debug" - depends on SERIAL_SAMSUNG + depends on SERIAL_SAMSUNG && DEBUG_LL help Add support for debugging the serial driver. Since this is generally being used as a console, we use our own output @@ -994,24 +993,12 @@ bool "Support RTS/CTS on 68328 serial port" depends on SERIAL_68328 -config SERIAL_COLDFIRE - bool "ColdFire serial support (DEPRECATED)" - depends on COLDFIRE - help - This driver supports the built-in serial ports of the Motorola ColdFire - family of CPUs. - This driver is deprecated because it supports only the old interface - for serial drivers and features like magic keys are not working. - Please switch to the new style driver because this driver will be - removed soon. - config SERIAL_MCF - bool "Coldfire serial support (new style driver)" + bool "Coldfire serial support" depends on COLDFIRE select SERIAL_CORE help - This new serial driver supports the Freescale Coldfire serial ports - using the new serial driver subsystem. + This serial driver supports the Freescale Coldfire serial ports. config SERIAL_MCF_BAUDRATE int "Default baudrate for Coldfire serial ports" @@ -1136,42 +1123,6 @@ your boot loader (lilo or loadlin) about how to pass options to the kernel at boot time.) -config SERIAL_CPM_SCC1 - bool "Support for SCC1 serial port" - depends on SERIAL_CPM=y - help - Select this option to use SCC1 as a serial port - -config SERIAL_CPM_SCC2 - bool "Support for SCC2 serial port" - depends on SERIAL_CPM=y - help - Select this option to use SCC2 as a serial port - -config SERIAL_CPM_SCC3 - bool "Support for SCC3 serial port" - depends on SERIAL_CPM=y - help - Select this option to use SCC3 as a serial port - -config SERIAL_CPM_SCC4 - bool "Support for SCC4 serial port" - depends on SERIAL_CPM=y - help - Select this option to use SCC4 as a serial port - -config SERIAL_CPM_SMC1 - bool "Support for SMC1 serial port" - depends on SERIAL_CPM=y - help - Select this option to use SMC1 as a serial port - -config SERIAL_CPM_SMC2 - bool "Support for SMC2 serial port" - depends on SERIAL_CPM=y - help - Select this option to use SMC2 as a serial port - config SERIAL_SGI_L1_CONSOLE bool "SGI Altix L1 serial console support" depends on IA64_GENERIC || IA64_SGI_SN2 @@ -1325,7 +1276,7 @@ say Y or M. Otherwise, say N. config SERIAL_NETX - bool "NetX serial port support" + tristate "NetX serial port support" depends on ARM && ARCH_NETX select SERIAL_CORE help @@ -1337,7 +1288,7 @@ config SERIAL_NETX_CONSOLE bool "Console on NetX serial port" - depends on SERIAL_NETX + depends on SERIAL_NETX=y select SERIAL_CORE_CONSOLE help If you have enabled the serial port on the Hilscher NetX SoC @@ -1428,10 +1379,10 @@ help This is a driver for the USB Gecko adapter for the Nintendo GameCube and Wii gaming consoles. It provides a console and a tty interface. - + If you have an adapter like this, say Y here, otherwise say N. - - To compile this driver as a module, choose M here: the - module will be called usbgecko. + + To compile this driver as a module, choose M here: the + module will be called usbgecko. endmenu |
From: Albert H. <he...@us...> - 2009-02-01 18:29:54
|
Update of /cvsroot/gc-linux/linux/arch/powerpc/include/asm In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv17186/arch/powerpc/include/asm Modified Files: starlet.h udbg.h 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: starlet.h =================================================================== RCS file: /cvsroot/gc-linux/linux/arch/powerpc/include/asm/starlet.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- starlet.h 11 Jan 2009 20:07:04 -0000 1.1 +++ starlet.h 1 Feb 2009 18:29:34 -0000 1.2 @@ -2,8 +2,8 @@ * arch/powerpc/include/asm/starlet.h * * Nintendo Wii starlet processor definitions - * 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 @@ -187,10 +187,10 @@ extern int starlet_close(int fd); extern int starlet_ioctl(int fd, int request, - void *ibuf, size_t ilen, + void *ibuf, size_t ilen, void *obuf, size_t olen); extern int starlet_ioctl_nowait(int fd, int request, - void *ibuf, size_t ilen, + void *ibuf, size_t ilen, void *obuf, size_t olen, starlet_ipc_callback_t callback, void *arg); Index: udbg.h =================================================================== RCS file: /cvsroot/gc-linux/linux/arch/powerpc/include/asm/udbg.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- udbg.h 11 Jan 2009 20:07:04 -0000 1.1 +++ udbg.h 1 Feb 2009 18:29:34 -0000 1.2 @@ -50,7 +50,7 @@ extern void __init udbg_init_44x_as1(void); extern void __init udbg_init_40x_realmode(void); extern void __init udbg_init_cpm(void); -extern void __init udbg_init_debug_usbgecko(void); +extern void __init udbg_init_usbgecko(void); #endif /* __KERNEL__ */ #endif /* _ASM_POWERPC_UDBG_H */ |
From: Albert H. <he...@us...> - 2009-02-01 18:29:49
|
Update of /cvsroot/gc-linux/linux/drivers/block In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv17186/drivers/block Modified Files: Kconfig Makefile gcn-aram.c gcn-sd.c rvl-mem2.c rvl-stsd.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: gcn-aram.c =================================================================== RCS file: /cvsroot/gc-linux/linux/drivers/block/gcn-aram.c,v retrieving revision 1.18 retrieving revision 1.19 diff -u -d -r1.18 -r1.19 --- gcn-aram.c 13 Sep 2008 19:42:53 -0000 1.18 +++ gcn-aram.c 1 Feb 2009 18:29:35 -0000 1.19 @@ -2,9 +2,9 @@ * drivers/block/gcn-aram.c * * Nintendo GameCube Auxiliary RAM (ARAM) block driver - * Copyright (C) 2004-2008 The GameCube Linux Team + * Copyright (C) 2004-2009 The GameCube Linux Team * Copyright (C) 2005 Todd Jeffreys <to...@vo...> - * Copyright (C) 2005,2007,2008 Albert Herranz + * Copyright (C) 2005,2007,2008,2009 Albert Herranz * * Based on previous work by Franz Lehner. * @@ -23,7 +23,7 @@ #include <linux/major.h> #include <linux/module.h> #include <linux/of_platform.h> -#include <asm/io.h> +#include <linux/io.h> #define DRV_MODULE_NAME "gcn-aram" @@ -110,20 +110,18 @@ static inline enum dma_data_direction rq_dir_to_dma_dir(struct request *req) { - if (rq_data_dir(req) == READ) { + if (rq_data_dir(req) == READ) return DMA_FROM_DEVICE; - } else { + else return DMA_TO_DEVICE; - } } static inline int rq_dir_to_aram_dir(struct request *req) { - if (rq_data_dir(req) == READ) { + if (rq_data_dir(req) == READ) return AR_READ; - } else { + else return AR_WRITE; - } } static void aram_start_dma_transfer(struct aram_drvdata *drvdata, @@ -175,7 +173,7 @@ drvdata->req = NULL; spin_unlock_irqrestore(&drvdata->io_lock, flags); - + if (req) { __blk_end_request(req, 0, req->current_nr_sectors << 9); dma_unmap_single(drvdata->dev, @@ -200,7 +198,7 @@ unsigned long flags; req = elv_next_request(q); - while(req) { + while (req) { spin_lock_irqsave(&drvdata->io_lock, flags); /* we schedule a single request each time */ @@ -257,28 +255,28 @@ * */ -static int aram_open(struct inode *inode, struct file *filp) +static int aram_open(struct block_device *bdev, fmode_t mode) { - struct aram_drvdata *drvdata = inode->i_bdev->bd_disk->private_data; + struct aram_drvdata *drvdata = bdev->bd_disk->private_data; unsigned long flags; int retval = 0; spin_lock_irqsave(&drvdata->lock, flags); /* only allow a minor of 0 to be opened */ - if (iminor(inode)) { + if (MINOR(bdev->bd_dev)) { retval = -ENODEV; goto out; } /* honor exclusive open mode */ if (drvdata->ref_count == -1 || - (drvdata->ref_count && (filp->f_flags & O_EXCL))) { + (drvdata->ref_count && (mode & FMODE_EXCL))) { retval = -EBUSY; goto out; } - if ((filp->f_flags & O_EXCL)) + if ((mode & FMODE_EXCL)) drvdata->ref_count = -1; else drvdata->ref_count++; @@ -288,9 +286,9 @@ return retval; } -static int aram_release(struct inode *inode, struct file *filp) +static int aram_release(struct gendisk *disk, fmode_t mode) { - struct aram_drvdata *drvdata = inode->i_bdev->bd_disk->private_data; + struct aram_drvdata *drvdata = disk->private_data; unsigned long flags; spin_lock_irqsave(&drvdata->lock, flags); @@ -299,46 +297,23 @@ else drvdata->ref_count = 0; spin_unlock_irqrestore(&drvdata->lock, flags); - + return 0; } -static int aram_ioctl(struct inode *inode, struct file *file, - unsigned int cmd, unsigned long arg) +static int aram_getgeo(struct block_device *bdev, struct hd_geometry *geo) { - struct hd_geometry geo; - - switch (cmd) { - case BLKRAGET: - case BLKFRAGET: - case BLKROGET: - case BLKBSZGET: - case BLKSSZGET: - case BLKSECTGET: - case BLKGETSIZE: - case BLKGETSIZE64: - case BLKFLSBUF: - return ioctl_by_bdev(inode->i_bdev,cmd,arg); - case HDIO_GETGEO: - /* fake the entries */ - geo.heads = 16; - geo.sectors = 32; - geo.start = 0; - geo.cylinders = ARAM_BUFFERSIZE / (geo.heads * geo.sectors); - if (copy_to_user((void __user*)arg,&geo,sizeof(geo))) - return -EFAULT; - return 0; - default: - return -ENOTTY; - } + geo->cylinders = get_capacity(bdev->bd_disk) / (4 * 16); + geo->heads = 4; + geo->sectors = 16; + return 0; } - static struct block_device_operations aram_fops = { .owner = THIS_MODULE, .open = aram_open, .release = aram_release, - .ioctl = aram_ioctl, + .getgeo = aram_getgeo, }; @@ -358,7 +333,7 @@ retval = register_blkdev(ARAM_MAJOR, ARAM_NAME); if (retval) goto err_register_blkdev; - + retval = -ENOMEM; spin_lock_init(&drvdata->lock); spin_lock_init(&drvdata->io_lock); @@ -427,7 +402,7 @@ spin_unlock_irqrestore(&drvdata->io_lock, flags); /* wait until pending transfers are finished */ - while(in_be16(csr_reg) & DSP_CSR_DSPDMA) + while (in_be16(csr_reg) & DSP_CSR_DSPDMA) cpu_relax(); } @@ -474,15 +449,14 @@ { int retval; - drvdata->io_base = ioremap(mem->start, mem->end - mem->start + 1); + drvdata->io_base = ioremap(mem->start, mem->end - mem->start + 1); drvdata->irq = irq; retval = aram_init_blk_dev(drvdata); if (!retval) { retval = aram_init_irq(drvdata); - if (retval) { + if (retval) aram_exit_blk_dev(drvdata); - } } return retval; } @@ -558,11 +532,11 @@ struct resource res; int retval; - retval = of_address_to_resource(odev->node, 0, &res); - if (retval) { + retval = of_address_to_resource(odev->node, 0, &res); + if (retval) { drv_printk(KERN_ERR, "no io memory range found\n"); - return -ENODEV; - } + return -ENODEV; + } return aram_do_probe(&odev->dev, &res, irq_of_parse_and_map(odev->node, 0)); @@ -583,7 +557,7 @@ { .compatible = "nintendo,flipper-auxram" }, { }, }; - + MODULE_DEVICE_TABLE(of, aram_of_match); Index: gcn-sd.c =================================================================== RCS file: /cvsroot/gc-linux/linux/drivers/block/gcn-sd.c,v retrieving revision 1.15 retrieving revision 1.16 diff -u -d -r1.15 -r1.16 --- gcn-sd.c 4 Apr 2008 19:17:53 -0000 1.15 +++ gcn-sd.c 1 Feb 2009 18:29:35 -0000 1.16 @@ -2,10 +2,10 @@ * drivers/block/gcn-sd.c * * MMC/SD card block driver for the Nintendo GameCube/Wii - * Copyright (C) 2004-2008 The GameCube Linux Team + * Copyright (C) 2004-2009 The GameCube Linux Team * Copyright (C) 2004,2005 Rob Reylink * Copyright (C) 2005 Todd Jeffreys - * Copyright (C) 2005,2006,2007,2008 Albert Herranz + * Copyright (C) 2005,2006,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 @@ -74,9 +74,9 @@ #define DRV_MODULE_NAME "gcn-sd" #define DRV_DESCRIPTION "MMC/SD card block driver for the Nintendo GameCube/Wii" -#define DRV_AUTHOR "Rob Reylink, " \ +#define DRV_AUTHOR "Rob Reylink, " \ "Todd Jeffreys, " \ - "Albert Herranz" + "Albert Herranz" static char sd_driver_version[] = "4.1i"; @@ -85,7 +85,7 @@ #ifdef SD_DEBUG # define DBG(fmt, args...) \ - printk(KERN_ERR "%s: " fmt, __FUNCTION__ , ## args) + printk(KERN_ERR "%s: " fmt, __func__ , ## args) #else # define DBG(fmt, args...) #endif @@ -272,7 +272,7 @@ return crc; } -#define UNSTUFF_BITS(resp,start,size) \ +#define UNSTUFF_BITS(resp, start, size) \ ({ \ const int __size = size; \ const u32 __mask = (__size < 32 ? 1 << __size : 0) - 1; \ @@ -427,7 +427,7 @@ /* */ static inline unsigned int ms_to_cycles(unsigned int ms, unsigned int clock) { - return (ms * (clock / 1000)); + return ms * (clock / 1000); } /* */ @@ -577,17 +577,19 @@ /* * */ -static int sd_write_data(struct sd_host *host, void *data, size_t len, int token) +static int sd_write_data(struct sd_host *host, void *data, size_t len, + int token) { u16 crc; - u8 t; + u8 t, *d; + size_t l; int retval = 0; /* FIXME, rewrite this a bit */ { crc = 0; - u8 *d = data; - int l = len; + d = data; + l = len; while (l-- > 0) crc = crc_xmodem_update(crc, *d++); @@ -714,6 +716,8 @@ { struct sd_command *cmd = &host->cmd; u16 crc, calc_crc = 0xffff; + u8 *d; + size_t l; int retval; /* build raw command */ @@ -741,8 +745,8 @@ /* FIXME, rewrite this a bit */ { calc_crc = 0; - u8 *d = data; - int l = len; + d = data; + l = len; while (l-- > 0) calc_crc = crc_xmodem_update(calc_crc, *d++); @@ -797,9 +801,8 @@ /* burn extra cycles and deselect card */ sd_end_command(host); - if (retval < 0) { + if (retval < 0) DBG("write, offset=%d, len=%d\n", arg, len); - } return retval; } @@ -885,8 +888,8 @@ * */ static inline int sd_write_single_block(struct sd_host *host, - unsigned long start, - void *data, size_t len) + unsigned long start, + void *data, size_t len) { int retval; @@ -1006,7 +1009,7 @@ } /* - * + * */ static int sd_welcome_card(struct sd_host *host) { @@ -1052,7 +1055,7 @@ host->card.cid.prod_name, (unsigned long)((host->card.csd.capacity * (1 << host->card.csd.read_blkbits)) / 1024), - 1 << host->card.csd.read_blkbits, + 1 << host->card.csd.read_blkbits, host->card.cid.serial); retval = 0; @@ -1152,7 +1155,7 @@ /* * Verifies if a request should be dispatched or not. - * + * * Returns: * <0 in case of error. * 0 if request passes the checks @@ -1195,7 +1198,7 @@ if (retval) return 0; - switch(rq_data_dir(req)) { + switch (rq_data_dir(req)) { case WRITE: retval = sd_write_request(host, req); break; @@ -1212,11 +1215,11 @@ */ static int sd_io_thread(void *param) { - struct sd_host *host = param; + struct sd_host *host = param; struct request *req; - int uptodate; unsigned long flags; - int retval; + int nr_sectors; + int error; #if 0 /* @@ -1224,13 +1227,13 @@ * above. At least, be nice with other processes trying to use the * cpu. */ - set_user_nice(current, 0); + set_user_nice(current, 0); #endif - current->flags |= PF_NOFREEZE|PF_MEMALLOC; + current->flags |= PF_NOFREEZE|PF_MEMALLOC; mutex_lock(&host->io_mutex); - for(;;) { + for (;;) { req = NULL; set_current_state(TASK_INTERRUPTIBLE); @@ -1250,11 +1253,11 @@ continue; } set_current_state(TASK_INTERRUPTIBLE); - retval = sd_do_request(host, req); + nr_sectors = sd_do_request(host, req); + error = (nr_sectors < 0) ? nr_sectors : 0; - uptodate = (retval > 0)?1:0; spin_lock_irqsave(&host->queue_lock, flags); - end_queued_request(req, uptodate); + __blk_end_request(req, error, nr_sectors << 9); spin_unlock_irqrestore(&host->queue_lock, flags); } mutex_unlock(&host->io_mutex); @@ -1282,9 +1285,9 @@ /* * Opens the drive device. */ -static int sd_open(struct inode *inode, struct file *filp) +static int sd_open(struct block_device *bdev, fmode_t mode) { - struct sd_host *host = inode->i_bdev->bd_disk->private_data; + struct sd_host *host = bdev->bd_disk->private_data; int retval = 0; if (!host || !host->exi_device) @@ -1292,13 +1295,13 @@ /* honor exclusive open mode */ if (host->refcnt == -1 || - (host->refcnt && (filp->f_flags & O_EXCL))) { + (host->refcnt && (mode & FMODE_EXCL))) { retval = -EBUSY; goto out; } /* this takes care of revalidating the media if needed */ - check_disk_change(inode->i_bdev); + check_disk_change(bdev); if (!host->card.csd.capacity) { retval = -ENOMEDIUM; goto out; @@ -1306,7 +1309,7 @@ down(&open_lock); - if ((filp->f_flags & O_EXCL)) + if ((mode & FMODE_EXCL)) host->refcnt = -1; else host->refcnt++; @@ -1321,9 +1324,9 @@ /* * Releases the drive device. */ -static int sd_release(struct inode *inode, struct file *filp) +static int sd_release(struct gendisk *disk, fmode_t mode) { - struct sd_host *host = inode->i_bdev->bd_disk->private_data; + struct sd_host *host = disk->private_data; if (!host) return -ENXIO; @@ -1332,15 +1335,14 @@ if (host->refcnt > 0) host->refcnt--; - else { + else host->refcnt = 0; - } up(&open_lock); - /* lazy removal of unreferenced zombies */ - if (!host->refcnt && !host->exi_device) - kfree(host); + /* lazy removal of unreferenced zombies */ + if (!host->refcnt && !host->exi_device) + kfree(host); return 0; } @@ -1365,11 +1367,10 @@ /* check if the serial number of the card changed */ last_serial = host->card.cid.serial; retval = sd_read_cid(host); - if (!retval && last_serial == host->card.cid.serial && last_serial) { + if (!retval && last_serial == host->card.cid.serial && last_serial) clear_bit(__SD_MEDIA_CHANGED, &host->flags); - } else { + else set_bit(__SD_MEDIA_CHANGED, &host->flags); - } return (host->flags & SD_MEDIA_CHANGED) ? 1 : 0; } @@ -1410,51 +1411,22 @@ return retval; } -/* - * Ioctl. - */ -static int sd_ioctl(struct inode *inode, struct file *filp, - unsigned int cmd, unsigned long arg) +static int sd_getgeo(struct block_device *bdev, struct hd_geometry *geo) { - struct block_device *bdev = inode->i_bdev; - struct hd_geometry geo; - - switch (cmd) { -#if 0 - case BLKRAGET: - case BLKFRAGET: - case BLKROGET: - case BLKBSZGET: - case BLKSSZGET: - case BLKSECTGET: - case BLKGETSIZE: - case BLKGETSIZE64: - case BLKFLSBUF: - return ioctl_by_bdev(bdev, cmd, arg); -#endif - case HDIO_GETGEO: - /* fake the entries */ - geo.cylinders = get_capacity(bdev->bd_disk) / (4 * 16); - geo.heads = 4; - geo.sectors = 16; - geo.start = get_start_sect(bdev); - - if (copy_to_user((void __user *)arg, &geo, sizeof(geo))) - return -EFAULT; - return 0; - default: - return -ENOTTY; - } - return -EINVAL; + geo->cylinders = get_capacity(bdev->bd_disk) / (4 * 16); + geo->heads = 4; + geo->sectors = 16; + return 0; } + static struct block_device_operations sd_fops = { .owner = THIS_MODULE, .open = sd_open, .release = sd_release, .revalidate_disk = sd_revalidate_disk, .media_changed = sd_media_changed, - .ioctl = sd_ioctl, + .getgeo = sd_getgeo, }; /* @@ -1576,7 +1548,7 @@ } retval = sd_init_io_thread(host); - if (retval) + if (retval) goto err_blk_dev; add_disk(host->disk); Index: Kconfig =================================================================== RCS file: /cvsroot/gc-linux/linux/drivers/block/Kconfig,v retrieving revision 1.34 retrieving revision 1.35 diff -u -d -r1.34 -r1.35 --- Kconfig 15 Nov 2008 20:10:14 -0000 1.34 +++ Kconfig 1 Feb 2009 18:29:35 -0000 1.35 @@ -21,7 +21,8 @@ ---help--- If you want to use the floppy disk drive(s) of your PC under Linux, say Y. Information about this driver, especially important for IBM - Thinkpad users, is contained in <file:Documentation/floppy.txt>. + Thinkpad users, is contained in + <file:Documentation/blockdev/floppy.txt>. That file also contains the location of the Floppy driver FAQ as well as location of the fdutils package used to configure additional parameters of the driver at run time. @@ -55,15 +56,42 @@ To compile this driver as a module, choose M here: the module will be called z2ram. +config GAMECUBE_SD + tristate "Nintendo GameCube/Wii MMC/SD card" + depends on GAMECUBE_EXI + help + This enables support for using SD and MMC cards through + the Nintendo SD Card Adapter (DOL-019) or compatible hardware. + + You probably want to compile FAT support, and the required + codepages, or mount will complain. See Filesystems -> DOS/FAT/NT + filesystems and Filesystems -> Native Language Support + + Say Y if you want to include this driver in the kernel. + + To compile this driver as a module, choose M here: the + module will be called gcn-sd. + +config GAMECUBE_ARAM + tristate "Nintendo GameCube Auxiliary RAM (ARAM)" + depends on GAMECUBE + help + This enables support for using the 16MB of ARAM found in the + Nintendo GameCube as a block device. + Say Y if you want to include this driver in the kernel. + + To compile this driver as a module, choose M here: the + module will be called gcn-aram. + config GAMECUBE_DI - tristate "Nintendo GameCube Drive Interface (DI)" + tristate "Nintendo GameCube Disk Interface (DI)" depends on GAMECUBE help - This enables support for using DVD-R media on - the Nintendo GameCube DVD drive. + This enables support for using the DVD drive unit found + in the Nintendo GameCube. Say Y if you want to include this driver in the kernel. - - To compile this driver as a module, choose M here: the + + To compile this driver as a module, choose M here: the module will be called gcn-di. config GAMECUBE_DVD @@ -73,21 +101,10 @@ This enables support for using the mini-DVD drive on the Nintendo Gamecube. Say Y if you want to include this driver in the kernel. - + To compile this driver as a module, choose M here: the module will be called gcn-dvd -config GAMECUBE_ARAM - tristate "Nintendo GameCube Auxiliary RAM (ARAM)" - depends on GAMECUBE - help - This enables support for using the 16MB of ARAM found in the - Nintendo GameCube as a ramdisk or as a swap partition. - Say Y if you want to include this driver in the kernel. - - To compile this driver as a module, choose M here: the - module will be called gcn-aram. - config GAMECUBE_MEMCARD tristate "Nintendo GameCube/Wii memory card (EXPERIMENTAL)" depends on GAMECUBE_EXI && EXPERIMENTAL && BROKEN @@ -95,54 +112,36 @@ This enables support for using memory cards compatible with the Nintendo GameCube. Say Y if you want to include this driver in the kernel. - + To compile this driver as a module, choose M here: the module will be called gcn-memcard. -config GAMECUBE_SD - tristate "Nintendo GameCube/Wii MMC/SD card" - depends on GAMECUBE_EXI +config WII_MEM2 + tristate "Nintendo Wii MEM2" + depends on WII help - This enables support for using SD and MMC cards through - the Nintendo SD Card Adapter (DOL-019) or compatible hardware. - - Currently, only read support is enabled. - - You probably want to compile FAT support, and the required - codepages, or mount will complain. See Filesystems -> DOS/FAT/NT - filesystems and Filesystems -> Native Language Support - + This enables support for using the MEM2 found in the + Nintendo Wii as a block device. Say Y if you want to include this driver in the kernel. - + To compile this driver as a module, choose M here: the - module will be called gcn-sd. + module will be called rvl-mem2. -config WII_SD + config WII_SD tristate "Nintendo Wii front slot MMC/SD" depends on WII help - This enables support for MMC/SD cards using the front slot of - the Nintendo Wii. - + This enables support for MMC/SD cards using the front SD card + slot of the Nintendo Wii. + You probably want to compile FAT support, and the required codepages, or mount will complain. See Filesystems -> DOS/FAT/NT filesystems and Filesystems -> Native Language Support Say Y if you want to include this driver in the kernel. - - To compile this driver as a module, choose M here: the - module will be called rvl-stsd. -config WII_MEM2 - tristate "Nintendo Wii MEM2" - depends on WII - help - This enables support for using the MEM2 found in the - Nintendo Wii as a ramdisk or as a swap partition. - Say Y if you want to include this driver in the kernel. - To compile this driver as a module, choose M here: the - module will be called rvl-mem2. + module will be called rvl-stsd. config BLK_DEV_XD tristate "XT hard disk support" @@ -165,7 +164,7 @@ your computer's parallel port. Most of them are actually IDE devices using a parallel port IDE adapter. This option enables the PARIDE subsystem which contains drivers for many of these external drives. - Read <file:Documentation/paride.txt> for more information. + Read <file:Documentation/blockdev/paride.txt> for more information. If you have said Y to the "Parallel-port support" configuration option, you may share a single port between your printer and other @@ -203,9 +202,9 @@ help This is the driver for Compaq Smart Array controllers. Everyone using these boards should say Y here. See the file - <file:Documentation/cpqarray.txt> for the current list of boards - supported by this driver, and for further information on the use of - this driver. + <file:Documentation/blockdev/cpqarray.txt> for the current list of + boards supported by this driver, and for further information on the + use of this driver. config BLK_CPQ_CISS_DA tristate "Compaq Smart Array 5xxx support" @@ -213,7 +212,7 @@ help This is the driver for Compaq Smart Array 5xxx controllers. Everyone using these boards should say Y here. - See <file:Documentation/cciss.txt> for the current list of + See <file:Documentation/blockdev/cciss.txt> for the current list of boards supported by this driver, and for further information on the use of this driver. @@ -224,7 +223,7 @@ help When enabled (Y), this option allows SCSI tape drives and SCSI medium changers (tape robots) to be accessed via a Compaq 5xxx array - controller. (See <file:Documentation/cciss.txt> for more details.) + controller. (See <file:Documentation/blockdev/cciss.txt> for more details.) "SCSI support" and "SCSI tape support" must also be enabled for this option to work. @@ -238,8 +237,8 @@ help This driver adds support for the Mylex DAC960, AcceleRAID, and eXtremeRAID PCI RAID controllers. See the file - <file:Documentation/README.DAC960> for further information about - this driver. + <file:Documentation/blockdev/README.DAC960> for further information + about this driver. To compile this driver as a module, choose M here: the module will be called DAC960. @@ -367,9 +366,9 @@ userland (making server and client physically the same computer, communicating using the loopback network device). - Read <file:Documentation/nbd.txt> for more information, especially - about where to find the server code, which runs in user space and - does not need special kernel support. + Read <file:Documentation/blockdev/nbd.txt> for more information, + especially about where to find the server code, which runs in user + space and does not need special kernel support. Note that this has nothing to do with the network file systems NFS or Coda; you can say N here even if you intend to use NFS or Coda. @@ -410,8 +409,8 @@ store a copy of a minimal root file system off of a floppy into RAM during the initial install of Linux. - Note that the kernel command line option "ramdisk=XX" is now - obsolete. For details, read <file:Documentation/ramdisk.txt>. + Note that the kernel command line option "ramdisk=XX" is now obsolete. + For details, read <file:Documentation/blockdev/ramdisk.txt>. To compile this driver as a module, choose M here: the module will be called rd. Index: rvl-mem2.c =================================================================== RCS file: /cvsroot/gc-linux/linux/drivers/block/rvl-mem2.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- rvl-mem2.c 27 Mar 2008 22:35:35 -0000 1.4 +++ rvl-mem2.c 1 Feb 2009 18:29:35 -0000 1.5 @@ -2,10 +2,10 @@ * drivers/block/rvl-mem2.c * * Nintendo Wii MEM2 block 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 * - * Based on gcn-mem2.c. + * Based on gcn-aram.c. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -20,7 +20,7 @@ #include <linux/blkdev.h> #include <linux/fcntl.h> /* O_ACCMODE */ #include <linux/hdreg.h> /* HDIO_GETGEO */ -#include <asm/io.h> +#include <linux/io.h> #define DRV_MODULE_NAME "rvl-mem2" @@ -70,10 +70,10 @@ struct request *req; unsigned long mem2_addr; size_t len; - int uptodate; + int error; req = elv_next_request(q); - while(req) { + while (req) { if (blk_fs_request(req)) { /* calculate the MEM2 address and length */ mem2_addr = req->sector << 9; @@ -84,24 +84,25 @@ drv_printk(KERN_ERR, "bad access: block=%lu," " size=%u\n", (unsigned long)req->sector, len); - uptodate = 0; + error = -EIO; } else { - switch(rq_data_dir(req)) { + switch (rq_data_dir(req)) { case READ: memcpy(req->buffer, - drvdata->io_base + mem2_addr, len); + drvdata->io_base + mem2_addr, + len); break; case WRITE: memcpy(drvdata->io_base + mem2_addr, req->buffer, len); break; } - uptodate = 1; + error = 0; } + blk_end_request(req, error, len); } else { - uptodate = 0; + end_request(req, 0); } - end_queued_request(req, uptodate); req = elv_next_request(q); } } @@ -109,28 +110,28 @@ /* * Opens the MEM2 device. */ -static int mem2_open(struct inode *inode, struct file *filp) +static int mem2_open(struct block_device *bdev, fmode_t mode) { - struct mem2_drvdata *drvdata = inode->i_bdev->bd_disk->private_data; + struct mem2_drvdata *drvdata = bdev->bd_disk->private_data; unsigned long flags; int retval = 0; spin_lock_irqsave(&drvdata->lock, flags); /* only allow a minor of 0 to be opened */ - if (iminor(inode)) { + if (MINOR(bdev->bd_dev)) { retval = -ENODEV; goto out; } /* honor exclusive open mode */ if (drvdata->ref_count == -1 || - (drvdata->ref_count && (filp->f_flags & O_EXCL))) { + (drvdata->ref_count && (mode & FMODE_EXCL))) { retval = -EBUSY; goto out; } - if ((filp->f_flags & O_EXCL)) + if ((mode & FMODE_EXCL)) drvdata->ref_count = -1; else drvdata->ref_count++; @@ -143,9 +144,9 @@ /* * Closes the MEM2 device. */ -static int mem2_release(struct inode *inode, struct file *filp) +static int mem2_release(struct gendisk *disk, fmode_t mode) { - struct mem2_drvdata *drvdata = inode->i_bdev->bd_disk->private_data; + struct mem2_drvdata *drvdata = disk->private_data; unsigned long flags; spin_lock_irqsave(&drvdata->lock, flags); @@ -154,42 +155,16 @@ else drvdata->ref_count = 0; spin_unlock_irqrestore(&drvdata->lock, flags); - + return 0; } -/* - * Minimal ioctl for the MEM2 device. - */ -static int mem2_ioctl(struct inode *inode, struct file *filp, - unsigned int cmd, unsigned long arg) +static int mem2_getgeo(struct block_device *bdev, struct hd_geometry *geo) { - struct mem2_drvdata *drvdata = inode->i_bdev->bd_disk->private_data; - struct hd_geometry geo; - - switch (cmd) { - case BLKRAGET: - case BLKFRAGET: - case BLKROGET: - case BLKBSZGET: - case BLKSSZGET: - case BLKSECTGET: - case BLKGETSIZE: - case BLKGETSIZE64: - case BLKFLSBUF: - return ioctl_by_bdev(inode->i_bdev,cmd,arg); - case HDIO_GETGEO: - /* fake the entries */ - geo.heads = 16; - geo.sectors = 32; - geo.start = 0; - geo.cylinders = drvdata->size / (geo.heads * geo.sectors); - if (copy_to_user((void __user*)arg,&geo,sizeof(geo))) - return -EFAULT; - return 0; - default: - return -ENOTTY; - } + geo->cylinders = get_capacity(bdev->bd_disk) / (4 * 16); + geo->heads = 4; + geo->sectors = 16; + return 0; } @@ -197,7 +172,7 @@ .owner = THIS_MODULE, .open = mem2_open, .release = mem2_release, - .ioctl = mem2_ioctl, + .getgeo = mem2_getgeo, }; @@ -215,7 +190,7 @@ retval = register_blkdev(MEM2_MAJOR, MEM2_NAME); if (retval) goto err_register_blkdev; - + retval = -ENOMEM; spin_lock_init(&drvdata->lock); queue = blk_init_queue(mem2_do_request, &drvdata->lock); @@ -286,9 +261,8 @@ } retval = mem2_init_blk_dev(drvdata); - if (retval) { + if (retval) iounmap(drvdata->io_base); - } return retval; } Index: Makefile =================================================================== RCS file: /cvsroot/gc-linux/linux/drivers/block/Makefile,v retrieving revision 1.21 retrieving revision 1.22 diff -u -d -r1.21 -r1.22 --- Makefile 15 Nov 2008 20:10:14 -0000 1.21 +++ Makefile 1 Feb 2009 18:29:35 -0000 1.22 @@ -11,11 +11,11 @@ obj-$(CONFIG_PS3_DISK) += ps3disk.o obj-$(CONFIG_ATARI_FLOPPY) += ataflop.o obj-$(CONFIG_AMIGA_Z2RAM) += z2ram.o +obj-$(CONFIG_GAMECUBE_SD) += gcn-sd.o +obj-$(CONFIG_GAMECUBE_ARAM) += gcn-aram.o obj-$(CONFIG_GAMECUBE_DI) += gcn-di/ obj-$(CONFIG_GAMECUBE_DVD) += gcn-dvd/ -obj-$(CONFIG_GAMECUBE_ARAM) += gcn-aram.o obj-$(CONFIG_GAMECUBE_MEMCARD) += gcn-memcard.o -obj-$(CONFIG_GAMECUBE_SD) += gcn-sd.o obj-$(CONFIG_WII_MEM2) += rvl-mem2.o obj-$(CONFIG_WII_SD) += rvl-stsd.o obj-$(CONFIG_BLK_DEV_RAM) += brd.o Index: rvl-stsd.c =================================================================== RCS file: /cvsroot/gc-linux/linux/drivers/block/rvl-stsd.c,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- rvl-stsd.c 15 Nov 2008 20:10:14 -0000 1.5 +++ rvl-stsd.c 1 Feb 2009 18:29:35 -0000 1.6 @@ -2,8 +2,8 @@ * drivers/block/rvl-stsd.c * * Block driver for the Nintendo Wii SD front slot. - * 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 drivers/block/gcn-sd.c * @@ -21,7 +21,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_ERR, fmt, ##arg) #include <linux/blkdev.h> @@ -51,7 +51,7 @@ #define DRV_DESCRIPTION "Block driver for the Nintendo Wii SD front slot" #define DRV_AUTHOR "Albert Herranz" -static char stsd_driver_version[] = "0.2i"; +static char stsd_driver_version[] = "0.3i"; #define drv_printk(level, format, arg...) \ printk(level DRV_MODULE_NAME ": " format , ## arg) @@ -125,7 +125,9 @@ */ /* we are recycling the stuff already in "../mmc/host/sdhci.h" */ -#define STSD_TIMEOUT_CONTROL_DIV(a) (((a)-13)&0xf) /* TMCLK*2^a a=[13..27] */ + +/* TMCLK*2^a a=[13..27] */ +#define STSD_TIMEOUT_CONTROL_DIV(a) (((a)-13)&0xf) static char stsd_dev_sdio_slot0[] = "/dev/sdio/slot0"; @@ -244,13 +246,13 @@ #define __case_string(_s) \ case _s: \ str = #_s; \ - break; + break; static char *stsd_opcode_string(u32 opcode) { char *str = "unknown"; - switch(opcode) { + switch (opcode) { __case_string(MMC_GO_IDLE_STATE) __case_string(MMC_SEND_OP_COND) __case_string(MMC_ALL_SEND_CID) @@ -285,9 +287,9 @@ __case_string(MMC_FAST_IO) __case_string(MMC_GO_IRQ_STATE) __case_string(MMC_LOCK_UNLOCK) -//__case_string(SD_SEND_RELATIVE_ADDR) -//__case_string(SD_SEND_IF_COND) -//__case_string(SD_SWITCH) +/*__case_string(SD_SEND_RELATIVE_ADDR)*/ +/*__case_string(SD_SEND_IF_COND)*/ +/*__case_string(SD_SWITCH)*/ __case_string(SD_IO_SEND_OP_COND) __case_string(SD_IO_RW_DIRECT) __case_string(SD_IO_RW_EXTENDED) @@ -300,7 +302,7 @@ { char *str = "unknown"; - switch(rsptype) { + switch (rsptype) { __case_string(STSD_RSPTYPE_NONE) __case_string(STSD_RSPTYPE_R1) __case_string(STSD_RSPTYPE_R1B) @@ -319,7 +321,7 @@ { char *str = "unknown"; - switch(cmdtype) { + switch (cmdtype) { __case_string(STSD_CMDTYPE_BC) __case_string(STSD_CMDTYPE_BCR) __case_string(STSD_CMDTYPE_AC) @@ -333,7 +335,7 @@ { char *str = "unknown"; - switch(statusbit) { + switch (statusbit) { __case_string(R1_OUT_OF_RANGE) __case_string(R1_ADDRESS_ERROR) __case_string(R1_BLOCK_LEN_ERROR) @@ -364,34 +366,34 @@ { char *str = "unknown"; - switch(R1_CURRENT_STATE(status)) { - case 0: - str = "IDLE"; - break; - case 1: - str ="READY"; - break; - case 2: - str ="IDENT"; - break; - case 3: - str ="STANDBY"; - break; - case 4: - str ="TRANSFER"; - break; - case 5: - str = "SEND"; - break; - case 6: - str = "RECEIVE"; - break; - case 7: - str = "PROGRAM"; - break; - case 8: - str = "DISCONNECT"; - break; + switch (R1_CURRENT_STATE(status)) { + case 0: + str = "IDLE"; + break; + case 1: + str = "READY"; + break; + case 2: + str = "IDENT"; + break; + case 3: + str = "STANDBY"; + break; + case 4: + str = "TRANSFER"; + break; + case 5: + str = "SEND"; + break; + case 6: + str = "RECEIVE"; + break; + case 7: + str = "PROGRAM"; + break; + case 8: + str = "DISCONNECT"; + break; } return str; @@ -400,7 +402,8 @@ { u32 i, bit; - drv_printk(KERN_INFO, "card state %s\n", stsd_card_state_string(status)); + drv_printk(KERN_INFO, "card state %s\n", + stsd_card_state_string(status)); i = 13; for (i = 13; i <= 31; i++) { @@ -469,40 +472,40 @@ static void stsd_dump_hs_regs(struct stsd_host *host) { - drv_printk(KERN_DEBUG, "============== REGISTER DUMP ==============\n"); + drv_printk(KERN_DEBUG, "============== REGISTER DUMP ==============\n"); - drv_printk(KERN_DEBUG, "Sys addr: 0x%08x | Version: 0x%08x\n", - stsd_hsr_in_u32(host, SDHCI_DMA_ADDRESS), - stsd_hsr_in_u16(host, SDHCI_HOST_VERSION)); - drv_printk(KERN_DEBUG, "Blk size: 0x%08x | Blk cnt: 0x%08x\n", - stsd_hsr_in_u16(host, SDHCI_BLOCK_SIZE), - stsd_hsr_in_u16(host, SDHCI_BLOCK_COUNT)); - drv_printk(KERN_DEBUG, "Argument: 0x%08x | Trn mode: 0x%08x\n", - stsd_hsr_in_u32(host, SDHCI_ARGUMENT), - stsd_hsr_in_u16(host, SDHCI_TRANSFER_MODE)); - drv_printk(KERN_DEBUG, "Present: 0x%08x | Host ctl: 0x%08x\n", - stsd_hsr_in_u32(host, SDHCI_PRESENT_STATE), - stsd_hsr_in_u8(host, SDHCI_HOST_CONTROL)); - drv_printk(KERN_DEBUG, "Power: 0x%08x | Blk gap: 0x%08x\n", - stsd_hsr_in_u8(host, SDHCI_POWER_CONTROL), - stsd_hsr_in_u8(host, SDHCI_BLOCK_GAP_CONTROL)); - drv_printk(KERN_DEBUG, "Wake-up: 0x%08x | Clock: 0x%08x\n", - stsd_hsr_in_u8(host, SDHCI_WAKE_UP_CONTROL), - stsd_hsr_in_u16(host, SDHCI_CLOCK_CONTROL)); - drv_printk(KERN_DEBUG, "Timeout: 0x%08x | Int stat: 0x%08x\n", - stsd_hsr_in_u8(host, SDHCI_TIMEOUT_CONTROL), - stsd_hsr_in_u32(host, SDHCI_INT_STATUS)); - drv_printk(KERN_DEBUG, "Int enab: 0x%08x | Sig enab: 0x%08x\n", - stsd_hsr_in_u32(host, SDHCI_INT_ENABLE), - stsd_hsr_in_u32(host, SDHCI_SIGNAL_ENABLE)); - drv_printk(KERN_DEBUG, "AC12 err: 0x%08x | Slot int: 0x%08x\n", - stsd_hsr_in_u16(host, SDHCI_ACMD12_ERR), - stsd_hsr_in_u16(host, SDHCI_SLOT_INT_STATUS)); - drv_printk(KERN_DEBUG, "Caps: 0x%08x | Max curr: 0x%08x\n", - stsd_hsr_in_u32(host, SDHCI_CAPABILITIES), - stsd_hsr_in_u32(host, SDHCI_MAX_CURRENT)); + drv_printk(KERN_DEBUG, "Sys addr: 0x%08x | Version: 0x%08x\n", + stsd_hsr_in_u32(host, SDHCI_DMA_ADDRESS), + stsd_hsr_in_u16(host, SDHCI_HOST_VERSION)); + drv_printk(KERN_DEBUG, "Blk size: 0x%08x | Blk cnt: 0x%08x\n", + stsd_hsr_in_u16(host, SDHCI_BLOCK_SIZE), + stsd_hsr_in_u16(host, SDHCI_BLOCK_COUNT)); + drv_printk(KERN_DEBUG, "Argument: 0x%08x | Trn mode: 0x%08x\n", + stsd_hsr_in_u32(host, SDHCI_ARGUMENT), + stsd_hsr_in_u16(host, SDHCI_TRANSFER_MODE)); + drv_printk(KERN_DEBUG, "Present: 0x%08x | Host ctl: 0x%08x\n", + stsd_hsr_in_u32(host, SDHCI_PRESENT_STATE), + stsd_hsr_in_u8(host, SDHCI_HOST_CONTROL)); + drv_printk(KERN_DEBUG, "Power: 0x%08x | Blk gap: 0x%08x\n", + stsd_hsr_in_u8(host, SDHCI_POWER_CONTROL), + stsd_hsr_in_u8(host, SDHCI_BLOCK_GAP_CONTROL)); + drv_printk(KERN_DEBUG, "Wake-up: 0x%08x | Clock: 0x%08x\n", + stsd_hsr_in_u8(host, SDHCI_WAKE_UP_CONTROL), + stsd_hsr_in_u16(host, SDHCI_CLOCK_CONTROL)); + drv_printk(KERN_DEBUG, "Timeout: 0x%08x | Int stat: 0x%08x\n", + stsd_hsr_in_u8(host, SDHCI_TIMEOUT_CONTROL), + stsd_hsr_in_u32(host, SDHCI_INT_STATUS)); + drv_printk(KERN_DEBUG, "Int enab: 0x%08x | Sig enab: 0x%08x\n", + stsd_hsr_in_u32(host, SDHCI_INT_ENABLE), + stsd_hsr_in_u32(host, SDHCI_SIGNAL_ENABLE)); + drv_printk(KERN_DEBUG, "AC12 err: 0x%08x | Slot int: 0x%08x\n", + stsd_hsr_in_u16(host, SDHCI_ACMD12_ERR), + stsd_hsr_in_u16(host, SDHCI_SLOT_INT_STATUS)); + drv_printk(KERN_DEBUG, "Caps: 0x%08x | Max curr: 0x%08x\n", + stsd_hsr_in_u32(host, SDHCI_CAPABILITIES), + stsd_hsr_in_u32(host, SDHCI_MAX_CURRENT)); - drv_printk(KERN_DEBUG, "===========================================\n"); + drv_printk(KERN_DEBUG, "===========================================\n"); } #endif /* DEBUG */ @@ -513,7 +516,7 @@ * Borrowed from MMC layer. */ -#define UNSTUFF_BITS(resp,start,size) \ +#define UNSTUFF_BITS(resp, start, size) \ ({ \ const int __size = size; \ const u32 __mask = (__size < 32 ? 1 << __size : 0) - 1; \ @@ -625,7 +628,7 @@ return -EINVAL; } - //stsd_print_csd(csd); + /*stsd_print_csd(csd);*/ return 0; } @@ -674,7 +677,7 @@ break; case SD_SEND_IF_COND: /* WEIRD */ - //rsptype = STSD_RSPTYPE_R7; + /*rsptype = STSD_RSPTYPE_R7;*/ rsptype = STSD_RSPTYPE_R6; break; default: @@ -689,6 +692,11 @@ set_bit(__STSD_BAD_CARD, &host->flags); } +static inline void stsd_card_unset_bad(struct stsd_host *host) +{ + clear_bit(__STSD_BAD_CARD, &host->flags); +} + static inline int stsd_card_is_bad(struct stsd_host *host) { return test_bit(__STSD_BAD_CARD, &host->flags); @@ -835,7 +843,7 @@ } -static int stsd_hsr_in(struct stsd_host *host, +static int stsd_hsr_in(struct stsd_host *host, u32 reg, void *buf, size_t size) { u32 *local_buf; @@ -851,19 +859,19 @@ error = __stsd_hsr_in(host, reg, local_buf, size); if (!error) { - switch(size) { - case 1: - *(u8 *)buf = *local_buf & 0xff; - break; - case 2: - *(u16 *)buf = *local_buf & 0xffff; - break; - case 4: - *(u32 *)buf = *local_buf; - break; - default: - BUG(); - break; + switch (size) { + case 1: + *(u8 *)buf = *local_buf & 0xff; + break; + case 2: + *(u16 *)buf = *local_buf & 0xffff; + break; + case 4: + *(u32 *)buf = *local_buf; + break; + default: + BUG(); + break; } } @@ -872,7 +880,7 @@ return error; } -static int stsd_hsr_out(struct stsd_host *host, +static int stsd_hsr_out(struct stsd_host *host, u32 reg, void *buf, size_t size) { u32 *local_buf; @@ -886,19 +894,19 @@ if (!local_buf) return -ENOMEM; - switch(size) { - case 1: - *local_buf = *(u8 *)buf; - break; - case 2: - *local_buf = *(u16 *)buf; - break; - case 4: - *local_buf = *(u32 *)buf; - break; - default: - BUG(); - break; + switch (size) { + case 1: + *local_buf = *(u8 *)buf; + break; + case 2: + *local_buf = *(u16 *)buf; + break; + case 4: + *local_buf = *(u32 *)buf; + break; + default: + BUG(); + break; } error = __stsd_hsr_out(host, reg, local_buf, size); @@ -931,7 +939,7 @@ __declare_stsd_hsr_wait_for_resp(u16); #define __declare_stsd_hsr_in(_type) \ -static inline _type stsd_hsr_in_##_type(struct stsd_host *host, u32 reg) \ +static inline _type stsd_hsr_in_##_type(struct stsd_host *host, u32 reg) \ { \ _type val; \ \ @@ -1077,11 +1085,16 @@ static int stsd_reset_card(struct stsd_host *host) { + struct mmc_card *card = &host->card; int error; u32 status; + stsd_card_unset_bad(host); stsd_card_unset_sdhc(host); stsd_card_unset_manual_setup(host); + + memset(&card->cid, 0, sizeof(struct mmc_cid)); + memset(&card->csd, 0, sizeof(struct mmc_csd)); host->card.rca = 0; error = stsd_ioctl_small_read(host, STSD_IOCTL_RESET, @@ -1132,7 +1145,7 @@ reply_len = 4 * sizeof(u32); if (buf_len > reply_len) return -EINVAL; - + cmd = starlet_kzalloc(sizeof(*cmd), GFP_NOIO); if (!cmd) return -ENOMEM; @@ -1191,7 +1204,7 @@ { int error; - error = stsd_send_command(host, MMC_APP_CMD, STSD_CMDTYPE_AC, + error = stsd_send_command(host, MMC_APP_CMD, STSD_CMDTYPE_AC, host->card.rca << 16, NULL, 0); if (!error) { error = stsd_send_command(host, opcode, type, arg, @@ -1214,7 +1227,7 @@ u8 *p, crc; const size_t size = 128/8*sizeof(u8); - error = stsd_send_command(host, request, STSD_CMDTYPE_AC, + error = stsd_send_command(host, request, STSD_CMDTYPE_AC, host->card.rca << 16, buf, size); if (!error) { @@ -1262,7 +1275,7 @@ const size_t size = 128/8*sizeof(u8); /* WEIRD, don't use CMDTYPE_BCR for MMC_ALL_SEND_CID */ - return stsd_send_command(host, MMC_ALL_SEND_CID, 0, + return stsd_send_command(host, MMC_ALL_SEND_CID, 0, host->card.rca << 16, host->card.raw_cid, size); } @@ -1272,7 +1285,7 @@ int error; u32 reply; - error = stsd_send_command(host, MMC_SET_RELATIVE_ADDR, STSD_CMDTYPE_AC, + error = stsd_send_command(host, MMC_SET_RELATIVE_ADDR, STSD_CMDTYPE_AC, rca, &reply, sizeof(reply)); if (!error) { host->card.rca = reply >> 16; @@ -1314,7 +1327,7 @@ val = SD_BUS_WIDTH_1; error = stsd_send_app_command(host, SD_APP_SET_BUS_WIDTH, - STSD_CMDTYPE_AC, + STSD_CMDTYPE_AC, val, NULL, 0); if (error) DBG("%s: error=%d (%08x)\n", __func__, error, error); @@ -1430,7 +1443,7 @@ int error; /* WEIRD, don't use CMDTYPE_BC for MMC_GO_IDLE_STATE */ - error = stsd_send_command(host, MMC_GO_IDLE_STATE, 0, + error = stsd_send_command(host, MMC_GO_IDLE_STATE, 0, 0, NULL, 0); if (error) goto done; @@ -1440,7 +1453,7 @@ /* WEIRD, don't use CMDTYPE_BC for SD_SEND_IF_COND */ arg = STSD_VHS_27_36 | check_pattern; - error = stsd_send_command(host, SD_SEND_IF_COND, 0, + error = stsd_send_command(host, SD_SEND_IF_COND, 0, arg, &resp, sizeof(resp)); if (error) goto done; @@ -1463,19 +1476,19 @@ #define STSD_OCR_HCS (1<<30) /* Host Capacity Support */ #define STSD_OCR_CCS (1<<30) /* Card Capacity Support */ - for(i=0; i<100; i++) { + for (i = 0; i < 100; i++) { /* WEIRD, don't use CMDTYPE_BCR for MMC_APP_CMD */ - error = stsd_send_command(host, MMC_APP_CMD, STSD_CMDTYPE_AC, + error = stsd_send_command(host, MMC_APP_CMD, STSD_CMDTYPE_AC, 0, NULL, 0); if (error) goto done; /* WEIRD, don't use CMDTYPE_BCR for SD_APP_OP_COND */ - error = stsd_send_command(host, SD_APP_OP_COND, 0, + error = stsd_send_command(host, SD_APP_OP_COND, 0, STSD_OCR_HCS| MMC_VDD_32_33|MMC_VDD_33_34, &resp, sizeof(resp)); - if (error) + if (error) goto done; if ((resp[0] & MMC_CARD_BUSY) != 0) { @@ -1497,11 +1510,11 @@ } error = stsd_cmd_all_send_cid(host); - if (error) + if (error) goto done; error = stsd_cmd_set_relative_addr(host, 0); - if (error) + if (error) goto done; done: @@ -1551,7 +1564,7 @@ stsd_reset_card(host); error = stsd_get_status(host, &status); - if (error) + if (error) goto err_bad_card; if (!stsd_card_status_is_inserted(status)) { drv_printk(KERN_ERR, "no card found\n"); @@ -1627,7 +1640,7 @@ host->card.cid.prod_name, (unsigned long)((host->card.csd.capacity / 1024) * (1 << host->card.csd.read_blkbits)), - 1 << host->card.csd.read_blkbits, + 1 << host->card.csd.read_blkbits, host->card.cid.serial); error = 0; @@ -1654,7 +1667,7 @@ struct stsd_command *cmd = xfer->cmd; int error; - xfer->direction = (write)?DMA_TO_DEVICE:DMA_FROM_DEVICE; + xfer->direction = (write) ? DMA_TO_DEVICE : DMA_FROM_DEVICE; xfer->size = nr_blocks * xfer->blk_size; if (xfer->size > xfer->bounce_buf_size) { @@ -1683,7 +1696,8 @@ starlet_ioh_sg_init_table(xfer->io, 1); starlet_ioh_sg_set_buf(&xfer->io[0], xfer->reply, xfer->reply_len); - cmd->opcode = (write)?MMC_WRITE_MULTIPLE_BLOCK:MMC_READ_MULTIPLE_BLOCK; + cmd->opcode = (write) ? MMC_WRITE_MULTIPLE_BLOCK : + MMC_READ_MULTIPLE_BLOCK; cmd->arg = start; cmd->cmdtype = STSD_CMDTYPE_AC; /* STSD_CMDTYPE_ADTC */ cmd->rsptype = stsd_opcode_to_rsptype(cmd->opcode); @@ -1749,35 +1763,33 @@ if (uptodate <= 0) return uptodate; - write = (rq_data_dir(req) == READ)?0:1; + write = (rq_data_dir(req) == READ) ? 0 : 1; start = req->sector; if (!stsd_card_is_sdhc(host)) start <<= KERNEL_SECTOR_SHIFT; nr_blocks = req->current_nr_sectors; - uptodate = 1; error = stsd_do_block_transfer(host, write, start, req->buffer, nr_blocks); - if (error) { - DBG("%s: error=%d (%08x), start=%lu, \n", __func__, error, error, start); - uptodate = error; - } + if (error) + DBG("%s: error=%d (%08x), start=%lu, \n", __func__, + error, error, start); - return uptodate; + return error; } static int stsd_io_thread(void *param) { - struct stsd_host *host = param; + struct stsd_host *host = param; struct request *req; - int uptodate; unsigned long flags; + int error; - current->flags |= PF_NOFREEZE|PF_MEMALLOC; + current->flags |= PF_NOFREEZE|PF_MEMALLOC; mutex_lock(&host->io_mutex); - for(;;) { + for (;;) { req = NULL; set_current_state(TASK_INTERRUPTIBLE); @@ -1797,10 +1809,10 @@ continue; } set_current_state(TASK_INTERRUPTIBLE); - uptodate = stsd_do_request(host, req); + error = stsd_do_request(host, req); spin_lock_irqsave(&host->queue_lock, flags); - end_queued_request(req, uptodate); + __blk_end_request(req, error, blk_rq_bytes(req)); spin_unlock_irqrestore(&host->queue_lock, flags); } mutex_unlock(&host->io_mutex); @@ -1822,9 +1834,9 @@ static DECLARE_MUTEX(open_lock); -static int stsd_open(struct inode *inode, struct file *filp) +static int stsd_open(struct block_device *bdev, fmode_t mode) { - struct stsd_host *host = inode->i_bdev->bd_disk->private_data; + struct stsd_host *host = bdev->bd_disk->private_data; int error = 0; if (!host || host->fd < 0) @@ -1832,13 +1844,13 @@ /* honor exclusive open mode */ if (host->refcnt == -1 || - (host->refcnt && (filp->f_flags & O_EXCL))) { + (host->refcnt && (mode & FMODE_EXCL))) { error = -EBUSY; goto out; } /* this takes care of revalidating the media if needed */ - check_disk_change(inode->i_bdev); + check_disk_change(bdev); if (!host->card.csd.capacity) { error = -ENOMEDIUM; goto out; @@ -1846,7 +1858,7 @@ down(&open_lock); - if ((filp->f_flags & O_EXCL)) + if ((mode & FMODE_EXCL)) host->refcnt = -1; else host->refcnt++; @@ -1858,9 +1870,9 @@ } -static int stsd_release(struct inode *inode, struct file *filp) +static int stsd_release(struct gendisk *disk, fmode_t mode) { - struct stsd_host *host = inode->i_bdev->bd_disk->private_data; + struct stsd_host *host = disk->private_data; if (!host) return -ENXIO; @@ -1869,14 +1881,13 @@ if (host->refcnt > 0) host->refcnt--; - else { + else host->refcnt = 0; - } up(&open_lock); - if (!host->refcnt && host->fd == -1) - kfree(host); + if (!host->refcnt && host->fd == -1) + kfree(host); return 0; } @@ -1910,11 +1921,10 @@ mutex_unlock(&host->io_mutex); - if (!error && last_serial == host->card.cid.serial && last_serial) { + if (!error && last_serial == host->card.cid.serial && last_serial) clear_bit(__STSD_MEDIA_CHANGED, &host->flags); - } else { + else set_bit(__STSD_MEDIA_CHANGED, &host->flags); - } return (host->flags & STSD_MEDIA_CHANGED) ? 1 : 0; } @@ -1943,7 +1953,7 @@ if (error < 0) drv_printk(KERN_ERR, "error = %d\n", error); error = -ENOMEDIUM; - goto out; + /* FALL THROUGH */ } /* inform the block layer about various sizes */ @@ -1959,27 +1969,12 @@ return error; } -static int stsd_ioctl(struct inode *inode, struct file *filp, - unsigned int cmd, unsigned long arg) +static int stsd_getgeo(struct block_device *bdev, struct hd_geometry *geo) { - struct block_device *bdev = inode->i_bdev; - struct hd_geometry geo; - - switch (cmd) { - case HDIO_GETGEO: - /* fake the entries */ - geo.cylinders = get_capacity(bdev->bd_disk) / (4 * 16); - geo.heads = 4; - geo.sectors = 16; - geo.start = get_start_sect(bdev); - - if (copy_to_user((void __user *)arg, &geo, sizeof(geo))) - return -EFAULT; - return 0; - default: - return -ENOTTY; - } - return -EINVAL; + geo->cylinders = get_capacity(bdev->bd_disk) / (4 * 16); + geo->heads = 4; + geo->sectors = 16; + return 0; } static struct block_device_operations stsd_fops = { @@ -1988,7 +1983,7 @@ .release = stsd_release, .revalidate_disk = stsd_revalidate_disk, .media_changed = stsd_media_changed, - .ioctl = stsd_ioctl, + .getgeo = stsd_getgeo, }; /* @@ -2151,7 +2146,7 @@ #endif error = stsd_init_io_thread(host); - if (error) + if (error) goto err_xfer; add_disk(host->disk); @@ -2272,7 +2267,7 @@ static int __init stsd_init_module(void) { - drv_printk(KERN_INFO, "%s - version %s\n", DRV_DESCRIPTION, + drv_printk(KERN_INFO, "%s - version %s\n", DRV_DESCRIPTION, stsd_driver_version); if (register_blkdev(STSD_MAJOR, DRV_MODULE_NAME)) { |
From: Albert H. <he...@us...> - 2009-02-01 18:29:48
|
Update of /cvsroot/gc-linux/linux/drivers/net In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv17186/drivers/net Modified Files: Kconfig Makefile gcn-bba.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: gcn-bba.c =================================================================== RCS file: /cvsroot/gc-linux/linux/drivers/net/gcn-bba.c,v retrieving revision 1.15 retrieving revision 1.16 diff -u -d -r1.15 -r1.16 --- gcn-bba.c 14 Sep 2008 19:20:29 -0000 1.15 +++ gcn-bba.c 1 Feb 2009 18:29:35 -0000 1.16 @@ -2,9 +2,9 @@ * drivers/net/gcn-bba.c * * Nintendo GameCube Broadband Adapter (BBA) driver - * Copyright (C) 2004-2008 The GameCube Linux Team + * Copyright (C) 2004-2009 The GameCube Linux Team * Copyright (C) 2005 Todd Jeffreys - * Copyright (C) 2004,2005,2006,2007,2008 Albert Herranz + * Copyright (C) 2004,2005,2006,2007,2008,2009 Albert Herranz * * Based on previous work by Stefan Esser, Franz Lehner, Costis and tmbinc. * @@ -34,9 +34,9 @@ #include <linux/spinlock.h> #include <linux/kthread.h> #include <linux/wait.h> +#include <linux/io.h> #include <linux/exi.h> #include <asm/system.h> -#include <asm/io.h> #define DRV_MODULE_NAME "gcn-bba" @@ -48,11 +48,11 @@ #define bba_printk(level, format, arg...) \ - printk(level DRV_MODULE_NAME ": " format , ## arg) + printk(level DRV_MODULE_NAME ": " format , ## arg) #ifdef BBA_DEBUG # define DBG(fmt, args...) \ - printk(KERN_ERR "%s: " fmt, __FUNCTION__ , ## args) + printk(KERN_ERR "%s: " fmt, __func__ , ## args) #else # define DBG(fmt, args...) #endif @@ -166,7 +166,7 @@ } #define bba_in12(reg) (bba_in16(reg) & 0x0fff) -#define bba_out12(reg,val) do { bba_out16((reg),(val)&0x0fff); } while(0) +#define bba_out12(reg, val) do { bba_out16(reg, (val)&0x0fff); } while (0) static inline void bba_ins_nosel(int reg, void *val, int len) { @@ -254,11 +254,11 @@ #define BBA_BP 0x0a/*+0x0b*/ /* Boundary Page Pointer Register */ #define BBA_TLBP 0x0c/*+0x0d*/ /* TX Low Boundary Page Pointer Register */ -#define BBA_TWP 0x0e/*+0x0f*/ /* Transmit Buffer Write Page Pointer Register */ -#define BBA_TRP 0x12/*+0x13*/ /* Transmit Buffer Read Page Pointer Register */ +#define BBA_TWP 0x0e/*+0x0f*/ /* Transmit Buf Write Page Pointer Register */ +#define BBA_TRP 0x12/*+0x13*/ /* Transmit Buf Read Page Pointer Register */ #define BBA_RWP 0x16/*+0x17*/ /* Receive Buffer Write Page Pointer Register */ #define BBA_RRP 0x18/*+0x19*/ /* Receive Buffer Read Page Pointer Register */ -#define BBA_RHBP 0x1a/*+0x1b*/ /* Receive High Boundary Page Pointer Register */ +#define BBA_RHBP 0x1a/*+0x1b*/ /* Receive High Boundary Page Ptr Register */ #define BBA_RXINTT 0x14/*+0x15*/ /* Receive Interrupt Timer Register */ @@ -277,7 +277,7 @@ #define BBA_NWAYC_LTE (1<<7) /* LTE, Link Test Enable */ #define BBA_GCA 0x32 /* GMAC Configuration A Register, RW, 00h */ -#define BBA_GCA_ARXERRB (1<<3) /* ARXERRB, Accept RX packet with error */ +#define BBA_GCA_ARXERRB (1<<3) /* ARXERRB, Accept RX pkt with error */ #define BBA_MISC 0x3d /* MISC Control Register 1, RW, 3ch */ #define BBA_MISC_BURSTDMA (1<<0) @@ -340,18 +340,20 @@ #define BBA_INIT_RWP BBA_INIT_BP #define BBA_INIT_RRP BBA_INIT_BP -#if defined(__BIG_ENDIAN_BITFIELD) -#define X(a,b) b,a -#else -#define X(a,b) a,b -#endif - enum { __BBA_RBFIM_OFF = 0, }; struct bba_descr { - u32 X(X(next_packet_ptr:12, packet_len:12), status:8); +#if defined(__BIG_ENDIAN_BITFIELD) + __u32 status:8, + packet_len : 12, + next_packet_ptr : 12; +#else + __u32 next_packet_ptr:12, + packet_len : 12, + status : 8; +#endif } __attribute((packed)); @@ -539,19 +541,19 @@ unsigned long flags; int retval = NETDEV_TX_OK; - static u8 pad[ETH_ZLEN] __attribute__ ((aligned (EXI_DMA_ALIGN+1))); + static u8 pad[ETH_ZLEN] __attribute__ ((aligned(EXI_DMA_ALIGN+1))); int pad_len; exi_dev_take(priv->exi_device); /* if the TXFIFO is in use, we'll try it later when free */ - if (bba_in8(BBA_NCRA) & (BBA_NCRA_ST0 | BBA_NCRA_ST1)) { + if (bba_in8(BBA_NCRA) & (BBA_NCRA_ST0 | BBA_NCRA_ST1)) { retval = NETDEV_TX_BUSY; goto out; - } + } spin_lock_irqsave(&priv->lock, flags); - skb = priv->tx_skb; + skb = priv->tx_skb; priv->tx_skb = NULL; spin_unlock_irqrestore(&priv->lock, flags); @@ -659,7 +661,7 @@ while (netif_running(dev) && received < budget && rrp != rwp) { bba_ins(rrp << 8, &descr, sizeof(descr)); - le32_to_cpus((u32 *) & descr); + le32_to_cpus((u32 *) &descr); size = descr.packet_len - 4; /* ignore CRC */ lrps = descr.status; @@ -725,9 +727,8 @@ priv->rx_work = 0; /* re-enable RBFI if it was disabled before */ - if (test_and_clear_bit(__BBA_RBFIM_OFF, &priv->flags)) { + if (test_and_clear_bit(__BBA_RBFIM_OFF, &priv->flags)) bba_out8(BBA_IMR, bba_in8(BBA_IMR) | BBA_IMR_RBFIM); - } exi_dev_give(priv->exi_device); @@ -740,10 +741,10 @@ static int bba_io_thread(void *bba_priv) { struct bba_private *priv = bba_priv; -// struct task_struct *me = current; -// struct sched_param param = { .sched_priority = MAX_RT_PRIO-1 }; +/* struct task_struct *me = current; */ +/* struct sched_param param = { .sched_priority = MAX_RT_PRIO-1 }; */ -// sched_setscheduler(me, SCHED_FIFO, ¶m); +/* sched_setscheduler(me, SCHED_FIFO, ¶m); */ set_user_nice(current, -20); current->flags |= PF_NOFREEZE; @@ -754,7 +755,7 @@ * The bba is often used to access the root filesystem. */ - while(!kthread_should_stop()) { + while (!kthread_should_stop()) { /* * We want to get scheduled at least once every 2 minutes * to avoid a softlockup spurious message... @@ -776,7 +777,7 @@ * Handles interrupt work from the network device. * Caller has already taken the exi channel. */ -static void inline bba_interrupt(struct net_device *dev) +static void bba_interrupt(struct net_device *dev) { struct bba_private *priv = (struct bba_private *)dev->priv; u8 ir, imr, status, lrps, ltps; @@ -791,7 +792,7 @@ bba_out8(BBA_IR, status); bba_out8(BBA_IMR, 0x00); goto out; - } + } while (status) { bba_out8(BBA_IR, status); @@ -820,15 +821,12 @@ bba_tx_err(ltps, dev); } - if (status & BBA_IR_FIFOEI) { + if (status & BBA_IR_FIFOEI) DBG("FIFOEI\n"); - } - if (status & BBA_IR_BUSEI) { + if (status & BBA_IR_BUSEI) DBG("BUSEI\n"); - } - if (status & BBA_IR_FRAGI) { + if (status & BBA_IR_FRAGI) DBG("FRAGI\n"); - } ir = bba_in8(BBA_IR); imr = bba_in8(BBA_IMR); @@ -841,9 +839,8 @@ DBG("a lot of interrupt work (%d loops)\n", loops); /* wake up xmit queue in case transmitter is idle */ - if ((bba_in8(BBA_NCRA) & (BBA_NCRA_ST0 | BBA_NCRA_ST1)) == 0) { + if ((bba_in8(BBA_NCRA) & (BBA_NCRA_ST0 | BBA_NCRA_ST1)) == 0) netif_wake_queue(dev); - } out: return; @@ -856,9 +853,8 @@ static void bba_retrieve_ether_addr(struct net_device *dev) { bba_ins(BBA_NAFR_PAR0, dev->dev_addr, ETH_ALEN); - if (!is_valid_ether_addr(dev->dev_addr)) { + if (!is_valid_ether_addr(dev->dev_addr)) random_ether_addr(dev->dev_addr); - } } /* @@ -942,7 +938,7 @@ bba_out8(BBA_IR, 0xFF); /* enable all interrupts */ - bba_out8(BBA_IMR, 0xFF & ~(BBA_IMR_FIFOEIM /*| BBA_IMR_REIM*/ )); + bba_out8(BBA_IMR, 0xFF & ~(BBA_IMR_FIFOEIM /*| BBA_IMR_REIM*/)); /* unknown, short command registers 0x02 */ /* XXX enable interrupts on the EXI glue logic */ @@ -977,7 +973,7 @@ c2 = (i2 + 0xc8) ^ (c0 + ((revid_eth_0 + revid_0 * 0x23) ^ 0x19)); c3 = (i0 + 0xc1) ^ (i3 + ((revid_eth_1 + 0xc8) ^ 0x90)); - return ((c0 << 24) | (c1 << 16) | (c2 << 8) | c3); + return (c0 << 24) | (c1 << 16) | (c2 << 8) | c3; } /* @@ -1021,9 +1017,8 @@ /* command error interrupt, haven't seen one yet */ mask >>= 1; - if (status & mask) { + if (status & mask) goto out; - } /* challenge/response interrupt */ mask >>= 1; @@ -1065,7 +1060,7 @@ return 1; } -static struct net_device *bba_dev = NULL; +static struct net_device *bba_dev; static inline void bba_select(void) { @@ -1199,9 +1194,8 @@ { int ret = -ENODEV; - if (exi_device_get(exi_device)) { + if (exi_device_get(exi_device)) ret = bba_init_device(exi_device); - } return ret; } @@ -1221,7 +1215,7 @@ .eid_table = bba_eid_table, .frequency = BBA_EXI_FREQ, .probe = bba_probe, - .remove = bba_remove + .remove = bba_remove, }; /** Index: Makefile =================================================================== RCS file: /cvsroot/gc-linux/linux/drivers/net/Makefile,v retrieving revision 1.28 retrieving revision 1.29 diff -u -d -r1.28 -r1.29 --- Makefile 15 Nov 2008 20:10:15 -0000 1.28 +++ Makefile 1 Feb 2009 18:29:35 -0000 1.29 @@ -15,9 +15,12 @@ obj-$(CONFIG_CAN) += can/ obj-$(CONFIG_BONDING) += bonding/ obj-$(CONFIG_ATL1) += atlx/ +obj-$(CONFIG_ATL2) += atlx/ obj-$(CONFIG_ATL1E) += atl1e/ obj-$(CONFIG_GIANFAR) += gianfar_driver.o obj-$(CONFIG_TEHUTI) += tehuti.o +obj-$(CONFIG_ENIC) += enic/ +obj-$(CONFIG_JME) += jme.o gianfar_driver-objs := gianfar.o \ gianfar_ethtool.o \ @@ -128,6 +131,7 @@ obj-$(CONFIG_TSI108_ETH) += tsi108_eth.o obj-$(CONFIG_MV643XX_ETH) += mv643xx_eth.o obj-$(CONFIG_QLA3XXX) += qla3xxx.o +obj-$(CONFIG_QLGE) += qlge/ obj-$(CONFIG_PPP) += ppp_generic.o obj-$(CONFIG_PPP_ASYNC) += ppp_async.o @@ -224,6 +228,8 @@ obj-$(CONFIG_ENC28J60) += enc28j60.o obj-$(CONFIG_GAMECUBE_BBA) += gcn-bba.o +obj-$(CONFIG_XTENSA_XT2000_SONIC) += xtsonic.o + obj-$(CONFIG_MACB) += macb.o obj-$(CONFIG_ARM) += arm/ Index: Kconfig =================================================================== RCS file: /cvsroot/gc-linux/linux/drivers/net/Kconfig,v retrieving revision 1.34 retrieving revision 1.35 diff -u -d -r1.34 -r1.35 --- Kconfig 15 Nov 2008 20:10:15 -0000 1.34 +++ Kconfig 1 Feb 2009 18:29:35 -0000 1.35 @@ -473,6 +473,12 @@ This is the driver for the onboard card of MIPS Magnum 4000, Acer PICA, Olivetti M700-10 and a few other identical OEM systems. +config XTENSA_XT2000_SONIC + tristate "Xtensa XT2000 onboard SONIC Ethernet support" + depends on XTENSA_PLATFORM_XT2000 + help + This is the driver for the onboard card of the Xtensa XT2000 board. + config MIPS_AU1X00_ENET bool "MIPS AU1000 Ethernet support" depends on SOC_AU1X00 @@ -897,7 +903,7 @@ select CRC32 select MII depends on ARM || REDWOOD_5 || REDWOOD_6 || M32R || SUPERH || \ - SOC_AU1X00 || BLACKFIN || MN10300 + MIPS || BLACKFIN || MN10300 help This is a driver for SMC's 91x series of Ethernet chipsets, including the SMC91C94 and the SMC91C111. Say Y if you want it @@ -969,7 +975,7 @@ tristate "SMSC LAN911[5678] support" select CRC32 select MII - depends on ARCH_PXA || SUPERH + depends on ARM || SUPERH help This is a driver for SMSC's LAN911x series of Ethernet chipsets including the new LAN9115, LAN9116, LAN9117, and LAN9118. @@ -1395,7 +1401,8 @@ config CS89x0 tristate "CS89x0 support" - depends on NET_PCI && (ISA || MACH_IXDP2351 || ARCH_IXDP2X01 || ARCH_PNX010X) + depends on NET_ETHERNET && (ISA || EISA || MACH_IXDP2351 \ + || ARCH_IXDP2X01 || ARCH_PNX010X || MACH_MX31ADS) ---help--- Support for CS89x0 chipset based Ethernet cards. If you have a network (Ethernet) card of this type, say Y and read the @@ -1406,6 +1413,11 @@ To compile this driver as a module, choose M here. The module will be called cs89x0. +config CS89x0_NONISA_IRQ + def_bool y + depends on CS89x0 != n + depends on MACH_IXDP2351 || ARCH_IXDP2X01 || ARCH_PNX010X || MACH_MX31ADS + config TC35815 tristate "TOSHIBA TC35815 Ethernet support" depends on NET_PCI && PCI && MIPS @@ -1822,9 +1834,10 @@ config FEC_MPC52xx tristate "MPC52xx FEC driver" - depends on PPC_MERGE && PPC_MPC52xx && PPC_BESTCOMM_FEC + depends on PPC_MPC52xx && PPC_BESTCOMM select CRC32 select PHYLIB + select PPC_BESTCOMM_FEC ---help--- This option enables support for the MPC5200's on-chip Fast Ethernet Controller @@ -1849,6 +1862,17 @@ Say Y here if you want to use the NE2000 compatible controller on the Renesas H8/300 processor. +config ATL2 + tristate "Atheros L2 Fast Ethernet support" + depends on PCI + select CRC32 + select MII + help + This driver supports the Atheros L2 fast ethernet adapter. + + To compile this driver as a module, choose M here. The module + will be called atl2. + source "drivers/net/fs_enet/Kconfig" endif # NET_ETHERNET @@ -1936,15 +1960,6 @@ To compile this driver as a module, choose M here. The module will be called e1000. -config E1000_DISABLE_PACKET_SPLIT - bool "Disable Packet Split for PCI express adapters" - depends on E1000 - help - Say Y here if you want to use the legacy receive path for PCI express - hardware. - - If in doubt, say N. - config E1000E tristate "Intel(R) PRO/1000 PCI-Express Gigabit Ethernet support" depends on PCI && (!SPARC32 || BROKEN) @@ -2004,6 +2019,15 @@ If in doubt, say N. +config IGB_DCA + bool "Direct Cache Access (DCA) Support" + default y + depends on IGB && DCA && !(IGB=y && DCA=m) + ---help--- + Say Y here if you want to use Direct Cache Access (DCA) in the + driver. DCA is a method for warming the CPU cache before data + is used, with the intent of lessening the impact of cache misses. + source "drivers/net/ixp2000/Kconfig" config MYRI_SBUS @@ -2055,6 +2079,7 @@ tristate "Realtek 8169 gigabit ethernet support" depends on PCI select CRC32 + select MII ---help--- Say Y here if you have a Realtek 8169 PCI Gigabit Ethernet adapter. @@ -2271,7 +2296,7 @@ config MV643XX_ETH tristate "Marvell Discovery (643XX) and Orion ethernet support" depends on MV64360 || MV64X60 || (PPC_MULTIPLATFORM && PPC32) || PLAT_ORION - select MII + select PHYLIB help This driver supports the gigabit ethernet MACs in the Marvell Discovery PPC/MIPS chipset family (MV643XX) and @@ -2290,12 +2315,13 @@ will be called qla3xxx. config ATL1 - tristate "Attansic L1 Gigabit Ethernet support (EXPERIMENTAL)" - depends on PCI && EXPERIMENTAL + tristate "Atheros/Attansic L1 Gigabit Ethernet support" + depends on PCI select CRC32 select MII help - This driver supports the Attansic L1 gigabit ethernet adapter. + This driver supports the Atheros/Attansic L1 gigabit ethernet + adapter. To compile this driver as a module, choose M here. The module will be called atl1. @@ -2311,6 +2337,18 @@ To compile this driver as a module, choose M here. The module will be called atl1e. +config JME + tristate "JMicron(R) PCI-Express Gigabit Ethernet support" + depends on PCI + select CRC32 + select MII + ---help--- + This driver supports the PCI-Express gigabit ethernet adapters + based on JMicron JMC250 chipset. + + To compile this driver as a module, choose M here. The module + will be called jme. + endif # NETDEV_1000 # @@ -2386,6 +2424,13 @@ To compile the driver as a module, choose M here. The module will be called ehea. +config ENIC + tristate "Cisco 10G Ethernet NIC support" + depends on PCI && INET + select INET_LRO + help + This enables the support for the Cisco 10G Ethernet card. + config IXGBE tristate "Intel(R) 10GbE PCI Express adapters support" depends on PCI && INET @@ -2405,6 +2450,15 @@ To compile this driver as a module, choose M here. The module will be called ixgbe. +config IXGBE_DCA + bool "Direct Cache Access (DCA) Support" + default y + depends on IXGBE && DCA && !(IXGBE=y && DCA=m) + ---help--- + Say Y here if you want to use Direct Cache Access (DCA) in the + driver. DCA is a method for warming the CPU cache before data + is used, with the intent of lessening the impact of cache misses. + config IXGB tristate "Intel(R) PRO/10GbE support" depends on PCI @@ -2452,6 +2506,15 @@ To compile this driver as a module, choose M here. The module will be called myri10ge. +config MYRI10GE_DCA + bool "Direct Cache Access (DCA) Support" + default y + depends on MYRI10GE && DCA && !(MYRI10GE=y && DCA=m) + ---help--- + Say Y here if you want to use Direct Cache Access (DCA) in the + driver. DCA is a method for warming the CPU cache before data + is used, with the intent of lessening the impact of cache misses. + config NETXEN_NIC tristate "NetXen Multi port (1/10) Gigabit Ethernet NIC" depends on PCI @@ -2474,6 +2537,15 @@ This driver supports the on-chip 1/10Gbit Ethernet controller on PA Semi's PWRficient line of chips. +config MLX4_EN + tristate "Mellanox Technologies 10Gbit Ethernet support" + depends on PCI && INET + select MLX4_CORE + select INET_LRO + help + This driver supports Mellanox Technologies ConnectX Ethernet + devices. + config MLX4_CORE tristate depends on PCI @@ -2505,6 +2577,15 @@ To compile this driver as a module, choose M here: the module will be called bnx2x. This is recommended. +config QLGE + tristate "QLogic QLGE 10Gb Ethernet Driver Support" + depends on PCI + help + This driver supports QLogic ISP8XXX 10Gb Ethernet cards. + + To compile this driver as a module, choose M here: the module + will be called qlge. + source "drivers/net/sfc/Kconfig" endif # NETDEV_10000 |
From: Albert H. <he...@us...> - 2009-02-01 18:29:48
|
Update of /cvsroot/gc-linux/linux/drivers/usb In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv17186/drivers/usb Modified Files: Kconfig Makefile 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: Makefile =================================================================== RCS file: /cvsroot/gc-linux/linux/drivers/usb/Makefile,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- Makefile 14 Sep 2008 19:20:30 -0000 1.2 +++ Makefile 1 Feb 2009 18:29:35 -0000 1.3 @@ -17,9 +17,12 @@ obj-$(CONFIG_USB_U132_HCD) += host/ obj-$(CONFIG_USB_R8A66597_HCD) += host/ obj-$(CONFIG_USB_WII_HCD) += host/ +obj-$(CONFIG_USB_HWA_HCD) += host/ obj-$(CONFIG_USB_C67X00_HCD) += c67x00/ +obj-$(CONFIG_USB_WUSB) += wusbcore/ + obj-$(CONFIG_USB_ACM) += class/ obj-$(CONFIG_USB_PRINTER) += class/ Index: Kconfig =================================================================== RCS file: /cvsroot/gc-linux/linux/drivers/usb/Kconfig,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- Kconfig 15 Nov 2008 20:10:15 -0000 1.3 +++ Kconfig 1 Feb 2009 18:29:35 -0000 1.4 @@ -22,7 +22,7 @@ default y if PCMCIA && !M32R # sl811_cs default y if ARM # SL-811 default y if SUPERH # r8a66597-hcd - default y if WII # starlet-hcd + default y if WII # rvl-sthcd default PCI # many non-PCI SOC chips embed OHCI @@ -37,7 +37,8 @@ default y if PXA3xx default y if ARCH_EP93XX default y if ARCH_AT91 - default y if ARCH_PNX4008 + default y if ARCH_PNX4008 && I2C + default y if MFD_TC6393XB # PPC: default y if STB03xxx default y if PPC_MPC52xx @@ -98,6 +99,8 @@ source "drivers/usb/mon/Kconfig" +source "drivers/usb/wusbcore/Kconfig" + source "drivers/usb/host/Kconfig" source "drivers/usb/musb/Kconfig" |
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); /* |
From: Albert H. <he...@us...> - 2009-02-01 18:29:46
|
Update of /cvsroot/gc-linux/linux/include/linux In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv17186/include/linux Modified Files: exi.h fb.h 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: exi.h =================================================================== RCS file: /cvsroot/gc-linux/linux/include/linux/exi.h,v retrieving revision 1.16 retrieving revision 1.17 diff -u -d -r1.16 -r1.17 --- exi.h 24 Feb 2008 18:05:34 -0000 1.16 +++ exi.h 1 Feb 2009 18:29:35 -0000 1.17 @@ -2,10 +2,10 @@ * include/linux/exi.h * * Nintendo GameCube EXpansion Interface definitions - * Copyright (C) 2004-2008 The GameCube Linux Team + * Copyright (C) 2004-2009 The GameCube Linux Team * Copyright (C) 2004 Arthur Othieno <a.o...@bl...> * Copyright (C) 2004,2005 Todd Jeffreys <to...@vo...> - * Copyright (C) 2005,2007,2008 Albert Herranz + * Copyright (C) 2005,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 @@ -18,7 +18,7 @@ #define __EXI_H #include <linux/device.h> -#include <asm/io.h> +#include <linux/io.h> struct exi_channel; @@ -32,7 +32,7 @@ unsigned int device; #define EXI_DEVICE_ANY (~0) - + u32 id; #define EXI_ID_INVALID (~0) #define EXI_ID_NONE (EXI_ID_INVALID-1) @@ -53,7 +53,7 @@ struct device dev; }; -#define to_exi_device(n) container_of(n,struct exi_device,dev) +#define to_exi_device(n) container_of(n, struct exi_device, dev) struct exi_device *exi_get_exi_device(struct exi_channel *exi_channel, int device); @@ -65,14 +65,14 @@ char *name; struct exi_device_id *eid_table; int frequency; - + int (*probe) (struct exi_device *dev); void (*remove) (struct exi_device *dev); struct device_driver driver; }; -#define to_exi_driver(n) container_of(n,struct exi_driver,driver) +#define to_exi_driver(n) container_of(n, struct exi_driver, driver) /* @@ -89,7 +89,7 @@ { return dev_get_drvdata(&exi_dev->dev); } - + static inline void exi_set_drvdata(struct exi_device *exi_dev, void *data) { dev_set_drvdata(&exi_dev->dev, data); @@ -117,6 +117,9 @@ * */ +extern void exi_channel_init(struct exi_channel *exi_channel, + unsigned int channel); + extern struct exi_channel *to_exi_channel(unsigned int channel); extern unsigned int to_channel(struct exi_channel *exi_channel); @@ -128,7 +131,7 @@ #define EXI_EVENT_IRQ 0 #define EXI_EVENT_INSERT 1 #define EXI_EVENT_TC 2 - + typedef int (*exi_event_handler_t)(struct exi_channel *exi_channel, unsigned int event_id, void *data); @@ -241,7 +244,7 @@ * */ -/* +/* * Raw. */ extern void exi_select_raw(struct exi_channel *exi_channel, @@ -257,7 +260,7 @@ extern void exi_dma_transfer_raw(struct exi_channel *channel, dma_addr_t data, size_t len, int mode); -/* +/* * Standard. */ Index: fb.h =================================================================== RCS file: /cvsroot/gc-linux/linux/include/linux/fb.h,v retrieving revision 1.30 retrieving revision 1.31 diff -u -d -r1.30 -r1.31 --- fb.h 15 Nov 2008 20:10:15 -0000 1.30 +++ fb.h 1 Feb 2009 18:29:35 -0000 1.31 @@ -39,7 +39,7 @@ #define FBIOGET_DISPINFO 0x4618 #define FBIOWAITRETRACE 0x4619 -#define FBIOWAITPEFINISH 0x4620 +#define FBIOWAITPEFINISH 0x4620 #define FBIOVIRTTOPHYS 0x4621 #define FBIOFLIP 0x4622 #define FBIOFLIPHACK 0x4623 /* libsdl */ @@ -813,6 +813,7 @@ struct fb_info { int node; int flags; + struct mutex lock; /* Lock for open/release/ioctl funcs */ struct fb_var_screeninfo var; /* Current var */ struct fb_fix_screeninfo fix; /* Current fix */ struct fb_monspecs monspecs; /* Current Monitor specs */ @@ -904,8 +905,8 @@ # define fb_writel __raw_writel #else extern unsigned int vifb_writel(unsigned int, void *); -# define fb_writel(b,addr) vifb_writel(b,addr) -# define fb_writel_real(b,addr) /* __raw_writel */ (*(volatile u32 __iomem *) (addr) = (b)) +# define fb_writel(b, addr) vifb_writel(b, addr) +# define fb_writel_real(b, addr) (*(/*volatile*/ u32 __iomem *)(addr) = (b)) #endif #define fb_writeq __raw_writeq #define fb_memset memset_io |
From: Albert H. <he...@us...> - 2009-02-01 18:29:46
|
Update of /cvsroot/gc-linux/linux/arch/powerpc/boot In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv17186/arch/powerpc/boot Modified Files: Makefile gamecube.c ugecon.c ugecon.h wii.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: ugecon.h =================================================================== RCS file: /cvsroot/gc-linux/linux/arch/powerpc/boot/ugecon.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- ugecon.h 26 Mar 2008 19:45:15 -0000 1.1 +++ ugecon.h 1 Feb 2009 18:29:34 -0000 1.2 @@ -2,8 +2,8 @@ * arch/powerpc/boot/ugecon.h * * USB Gecko early bootwrapper console. - * 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 @@ -19,6 +19,7 @@ extern int ug_is_adapter_present(void); extern void ug_putc(char ch); +extern void ug_console_write(const char *buf, int len); #endif /* __UGECON_H */ Index: ugecon.c =================================================================== RCS file: /cvsroot/gc-linux/linux/arch/powerpc/boot/ugecon.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- ugecon.c 26 Mar 2008 19:45:14 -0000 1.1 +++ ugecon.c 1 Feb 2009 18:29:34 -0000 1.2 @@ -1,9 +1,9 @@ /* * arch/powerpc/boot/ugecon.c * - * USB Gecko early bootwrapper console. - * Copyright (C) 2008 The GameCube Linux Team - * Copyright (C) 2008 Albert Herranz + * USB Gecko bootwrapper console. + * 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 @@ -57,7 +57,7 @@ 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) + while (in_be32(cr_reg) & EXI_CR_TSTART) barrier(); /* deselect */ @@ -69,7 +69,7 @@ static int ug_is_txfifo_ready(void) { - return (ug_io_transaction(0xc0000000) & 0x04000000); + return ug_io_transaction(0xc0000000) & 0x04000000; } static void ug_raw_putc(char ch) @@ -77,17 +77,28 @@ ug_io_transaction(0xb0000000 | (ch << 20)); } -void ug_putc(char ch) +static void ug_putc(char ch) { int count = 16; if (!ug_io_base) return; - while(!ug_is_txfifo_ready() && count--) - barrier(); + while (!ug_is_txfifo_ready() && count--) + barrier(); if (count) - ug_raw_putc(ch); + ug_raw_putc(ch); +} + +void ug_console_write(const char *buf, int len) +{ + char *b = (char *)buf; + + while (len--) { + if (*b == '\n') + ug_putc('\r'); + ug_putc(*b++); + } } int ug_is_adapter_present(void) @@ -95,25 +106,23 @@ if (!ug_io_base) return 0; - return (ug_io_transaction(0x90000000) == 0x04700000); + return ug_io_transaction(0x90000000) == 0x04700000; } int ug_grab_io_base(void) { - u32 v; - void *devp; + u32 v; + void *devp; - devp = finddevice("/exi/usbgecko"); - if (devp == NULL) - goto err_out; - if (getprop(devp, "virtual-reg", &v, sizeof(v)) != sizeof(v)) - goto err_out; + devp = finddevice("/exi/usbgecko"); + if (devp == NULL) + goto err_out; + if (getprop(devp, "virtual-reg", &v, sizeof(v)) != sizeof(v)) + goto err_out; - ug_io_base = (u8 *)v; - return 0; + ug_io_base = (u8 *)v; + return 0; err_out: - return -1; + return -1; } - - Index: Makefile =================================================================== RCS file: /cvsroot/gc-linux/linux/arch/powerpc/boot/Makefile,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- Makefile 15 Nov 2008 20:10:14 -0000 1.6 +++ Makefile 1 Feb 2009 18:29:34 -0000 1.7 @@ -41,6 +41,7 @@ $(obj)/ebony.o: BOOTCFLAGS += -mcpu=405 $(obj)/cuboot-taishan.o: BOOTCFLAGS += -mcpu=405 $(obj)/cuboot-katmai.o: BOOTCFLAGS += -mcpu=405 +$(obj)/cuboot-acadia.o: BOOTCFLAGS += -mcpu=405 $(obj)/treeboot-walnut.o: BOOTCFLAGS += -mcpu=405 $(obj)/virtex405-head.o: BOOTAFLAGS += -mcpu=405 @@ -57,6 +58,7 @@ $(addprefix libfdt/,$(src-libfdt)) libfdt-wrapper.c \ ns16550.c serial.c simple_alloc.c div64.S util.S \ gunzip_util.c elf_util.c $(zlib) devtree.c oflib.c ofconsole.c \ + 4xx.c ebony.c mv64x60.c mpsc.c mv64x60_i2c.c cuboot.c bamboo.c \ cpm-serial.c stdlib.c mpc52xx-psc.c planetcore.c uartlite.c \ fsl-soc.c mpc8xx.c pq2.c ugecon.c src-plat := of.c cuboot-52xx.c cuboot-824x.c cuboot-83xx.c cuboot-85xx.c holly.c \ @@ -67,7 +69,7 @@ cuboot-katmai.c cuboot-rainier.c redboot-8xx.c ep8248e.c \ cuboot-warp.c cuboot-85xx-cpm2.c cuboot-yosemite.c simpleboot.c \ virtex405-head.S virtex.c redboot-83xx.c cuboot-sam440ep.c \ - gamecube.c wii.c + cuboot-acadia.c gamecube.c wii.c src-boot := $(src-wlib) $(src-plat) empty.c src-boot := $(addprefix $(obj)/, $(src-boot)) @@ -210,6 +212,7 @@ # Board ports in arch/powerpc/platform/40x/Kconfig image-$(CONFIG_EP405) += dtbImage.ep405 image-$(CONFIG_WALNUT) += treeImage.walnut +image-$(CONFIG_ACADIA) += cuImage.acadia # Board ports in arch/powerpc/platform/44x/Kconfig image-$(CONFIG_EBONY) += treeImage.ebony cuImage.ebony @@ -311,12 +314,18 @@ $(obj)/vmlinux.strip: vmlinux $(STRIP) -s -R .comment $< -o $@ +# The iseries hypervisor won't take an ET_DYN executable, so this +# changes the type (byte 17) in the file to ET_EXEC (2). $(obj)/zImage.iseries: vmlinux $(STRIP) -s -R .comment $< -o $@ + printf "\x02" | dd of=$@ conv=notrunc bs=1 seek=17 $(obj)/uImage: vmlinux $(wrapperbits) $(call if_changed,wrap,uboot) +$(obj)/cuImage.initrd.%: vmlinux $(obj)/%.dtb $(wrapperbits) + $(call if_changed,wrap,cuboot-$*,,$(obj)/$*.dtb,$(obj)/ramdisk.image.gz) + $(obj)/cuImage.%: vmlinux $(obj)/%.dtb $(wrapperbits) $(call if_changed,wrap,cuboot-$*,,$(obj)/$*.dtb) Index: wii.c =================================================================== RCS file: /cvsroot/gc-linux/linux/arch/powerpc/boot/wii.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- wii.c 13 Sep 2008 19:42:52 -0000 1.1 +++ wii.c 1 Feb 2009 18:29:34 -0000 1.2 @@ -2,8 +2,8 @@ * arch/powerpc/boot/wii.c * * Nintendo Wii platform - * Copyright (C) 2004-2008 The GameCube Linux Team - * Copyright (C) 2008 Albert Herranz + * Copyright (C) 2004-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 @@ -63,20 +63,6 @@ "); /* - * - */ -static void wii_console_write(const char *buf, int len) -{ - char *b = (char *)buf; - - while(len--) { - if (*b == '\n') - ug_putc('\r'); - ug_putc(*b++); - } -} - -/* * */ void platform_init(unsigned long r3, unsigned long r4, unsigned long r5) @@ -87,6 +73,6 @@ fdt_init(_dtb_start); if (!ug_grab_io_base() && ug_is_adapter_present()) - console_ops.write = wii_console_write; + console_ops.write = ug_console_write; } Index: gamecube.c =================================================================== RCS file: /cvsroot/gc-linux/linux/arch/powerpc/boot/gamecube.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- gamecube.c 13 Sep 2008 19:42:52 -0000 1.3 +++ gamecube.c 1 Feb 2009 18:29:34 -0000 1.4 @@ -2,8 +2,8 @@ * arch/powerpc/boot/gamecube.c * * Nintendo GameCube/Wii platforms - * Copyright (C) 2004-2008 The GameCube Linux Team - * Copyright (C) 2008 Albert Herranz + * Copyright (C) 2004-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 @@ -20,7 +20,6 @@ #include "ugecon.h" - BSS_STACK(8192); /* @@ -63,20 +62,6 @@ "); /* - * - */ -static void gamecube_console_write(const char *buf, int len) -{ - char *b = (char *)buf; - - while(len--) { - if (*b == '\n') - ug_putc('\r'); - ug_putc(*b++); - } -} - -/* * */ void platform_init(unsigned long r3, unsigned long r4, unsigned long r5) @@ -87,6 +72,6 @@ fdt_init(_dtb_start); if (!ug_grab_io_base() && ug_is_adapter_present()) - console_ops.write = gamecube_console_write; + console_ops.write = ug_console_write; } |
Update of /cvsroot/gc-linux/linux/drivers/block/gcn-di In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv17186/drivers/block/gcn-di Modified Files: Makefile drive_20010608.h drive_20010831.h drive_20020402.h drive_20020823.h drive_all.S gcn-di.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: drive_20010831.h =================================================================== RCS file: /cvsroot/gc-linux/linux/drivers/block/gcn-di/drive_20010831.h,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- drive_20010831.h 19 Jan 2006 00:31:40 -0000 1.3 +++ drive_20010831.h 1 Feb 2009 18:29:35 -0000 1.4 @@ -1,5 +1,4 @@ -static -const char drive_20010831_firmware[] = +static const char drive_20010831_firmware[] = "\xf7\x10\xff\xf7\xf4\x74\x25\xd0\x40\xf7\x20\x4c\x80\xf4\x74\x39" "\x9e\x08\xf7\x20\xd6\xfc\xf4\x74\x02\xb3\x08\xf7\x20\xd2\xfc\x80" "\x0c\xc4\xda\xfc\xfe\xc8\xda\xfc\xf5\x00\x01\xe9\x70\xc8\xda\xfc" Index: Makefile =================================================================== RCS file: /cvsroot/gc-linux/linux/drivers/block/gcn-di/Makefile,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- Makefile 10 Jul 2005 15:14:36 -0000 1.4 +++ Makefile 1 Feb 2009 18:29:35 -0000 1.5 @@ -21,9 +21,9 @@ -o $(obj)/$(@F).elf -e 0x40d000 $(obj)/$(@F).o; \ $(OCMN102) -I elf32-mn10200 -O binary $(obj)/$(@F).elf \ $(obj)/$(@F).bin; \ - (echo "static "; cat $(obj)/$(@F).bin | scripts/bin2c "$(subst .h,,$(@F))_firmware") > $@; \ + (echo -n "static "; cat $(obj)/$(@F).bin | scripts/bin2c "$(subst .h,,$(@F))_firmware") > $@; \ rm -f $(obj)/$(@F).o $(obj)/$(@F).elf $(obj)/$(@F).bin $(obj)/$(@F).s - + targets += drive_20010608.h $(obj)/drive_20010608.h: DRIVE_MODEL := 0x20010608 Index: drive_20010608.h =================================================================== RCS file: /cvsroot/gc-linux/linux/drivers/block/gcn-di/drive_20010608.h,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- drive_20010608.h 19 Jan 2006 00:31:40 -0000 1.5 +++ drive_20010608.h 1 Feb 2009 18:29:35 -0000 1.6 @@ -1,5 +1,4 @@ -static -const char drive_20010608_firmware[] = +static const char drive_20010608_firmware[] = "\xf7\x10\xff\xf7\xf4\x74\x25\xd0\x40\xf7\x20\x4c\x80\xf4\x74\x42" "\x9d\x08\xf7\x20\xd6\xfc\xf4\x74\x45\xb1\x08\xf7\x20\xd2\xfc\x80" "\x0c\xc4\xda\xfc\xfe\xc8\xda\xfc\xf5\x00\x01\xe9\x70\xc8\xda\xfc" Index: drive_20020823.h =================================================================== RCS file: /cvsroot/gc-linux/linux/drivers/block/gcn-di/drive_20020823.h,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- drive_20020823.h 19 Jan 2006 00:31:40 -0000 1.5 +++ drive_20020823.h 1 Feb 2009 18:29:35 -0000 1.6 @@ -1,5 +1,4 @@ -static -const char drive_20020823_firmware[] = +static const char drive_20020823_firmware[] = "\xf7\x10\xff\xf7\xf4\x74\x25\xd0\x40\xf7\x20\x4c\x80\xf4\x74\x32" "\x9d\x08\xf7\x20\xd6\xfc\xf4\x74\x75\xae\x08\xf7\x20\xd2\xfc\x80" "\x0c\xc4\xda\xfc\xfe\xc8\xda\xfc\xf5\x00\x01\xe9\x70\xc8\xda\xfc" Index: drive_all.S =================================================================== RCS file: /cvsroot/gc-linux/linux/drivers/block/gcn-di/drive_all.S,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- drive_all.S 19 Jan 2006 00:31:40 -0000 1.6 +++ drive_all.S 1 Feb 2009 18:29:35 -0000 1.7 @@ -1,7 +1,7 @@ /* * DVD+/-R compatible "cactus" firmware extensions - * Copyright (C) 2005-2006 The GameCube Linux Team - * Copyright (C) 2005,2006 Albert Herranz + * Copyright (C) 2005-2009 The GameCube Linux Team + * Copyright (C) 2005,2006,2009 Albert Herranz * * Originally based on analysis of Cobra 1.0 drive code released by tmbinc * on dextrose.com. @@ -282,7 +282,7 @@ * 1e| PSW | | | * 20| PC lo | | PC lo | <- a3 * 22| PC hi | | PC hi | - * : : | old a3 | + * : : | old a3 | * | ... | | | * +--------+ +--------+ <- (0x8ea1c) for drive 04 * normal context stack interrupt context stack Index: drive_20020402.h =================================================================== RCS file: /cvsroot/gc-linux/linux/drivers/block/gcn-di/drive_20020402.h,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- drive_20020402.h 19 Jan 2006 00:31:40 -0000 1.6 +++ drive_20020402.h 1 Feb 2009 18:29:35 -0000 1.7 @@ -1,5 +1,4 @@ -static -const char drive_20020402_firmware[] = +static const char drive_20020402_firmware[] = "\xf7\x10\xff\xf7\xf4\x74\x25\xd0\x40\xf7\x20\x4c\x80\xf4\x74\xd6" "\x9c\x08\xf7\x20\xd6\xfc\xf4\x74\x28\xae\x08\xf7\x20\xd2\xfc\x80" "\x0c\xc4\xda\xfc\xfe\xc8\xda\xfc\xf5\x00\x01\xe9\x70\xc8\xda\xfc" Index: gcn-di.c =================================================================== RCS file: /cvsroot/gc-linux/linux/drivers/block/gcn-di/gcn-di.c,v retrieving revision 1.24 retrieving revision 1.25 diff -u -d -r1.24 -r1.25 --- gcn-di.c 13 Sep 2008 19:42:53 -0000 1.24 +++ gcn-di.c 1 Feb 2009 18:29:35 -0000 1.25 @@ -2,8 +2,8 @@ * drivers/block/gcn-di/gcn-di.c * * Nintendo GameCube Disk Interface (DI) driver - * Copyright (C) 2005-2007 The GameCube Linux Team - * Copyright (C) 2005,2006,2007 Albert Herranz + * Copyright (C) 2005-2009 The GameCube Linux Team + * Copyright (C) 2005,2006,2007,2009 Albert Herranz * * Portions based on previous work by Scream|CT. * @@ -28,7 +28,7 @@ #include <linux/proc_fs.h> #include <linux/seq_file.h> #include <linux/timer.h> -#include <asm/io.h> +#include <linux/io.h> #define DI_DEBUG @@ -43,7 +43,7 @@ #ifdef DI_DEBUG # define DBG(fmt, args...) \ - printk(KERN_ERR "%s: " fmt, __FUNCTION__ , ## args) + printk(KERN_ERR "%s: " fmt, __func__ , ## args) #else # define DBG(fmt, args...) #endif @@ -164,7 +164,7 @@ */ struct di_opcode { u16 op; -#define DI_OP(id,flags) (((u8)(id)<<8)|((u8)(flags))) +#define DI_OP(id, flags) (((u8)(id)<<8)|((u8)(flags))) #define DI_OP_ID(op) ((u8)((op)>>8)) #define DI_OP_FLAGS(op) ((u8)(op)) @@ -277,15 +277,15 @@ static struct di_drive_info di_drive_info - __attribute__ ((aligned (DI_DMA_ALIGN+1))); + __attribute__ ((aligned(DI_DMA_ALIGN+1))); /* * We do not accept original media with this driver, as there is currently no * general need for that. * If you ever develop an application (a media player for example) which works - * with original media, just change di_accept_gods and recompile. + * with original media, just change di_accept_gods and recompile. */ -static const int di_accept_gods = 0; +static const int di_accept_gods; /* * Drive firmware extensions. @@ -349,7 +349,7 @@ * We just include here some of the available functions, in no particular * order. */ -#define CMDBUF(a,b,c,d) (((a)<<24)|((b)<<16)|((c)<<8)|(d)) +#define CMDBUF(a, b, c, d) (((a)<<24)|((b)<<16)|((c)<<8)|(d)) static struct di_opcode di_opcodes[] = { @@ -485,11 +485,10 @@ { BUG_ON(cmd->opidx > DI_OP_MAXOP && cmd->opidx != DI_OP_CUSTOM); - if (cmd->opidx == DI_OP_CUSTOM) { + if (cmd->opidx == DI_OP_CUSTOM) return cmd->data; - } else { + else return &di_opcodes[cmd->opidx]; - } } /* @@ -689,25 +688,25 @@ { char *s = "unknown"; - switch(DI_STATUS(drive_status)) { - case DI_STATUS_READY: - s = "ready"; - break; - case DI_STATUS_COVER_OPENED: - s = "cover opened"; - break; - case DI_STATUS_DISK_CHANGE: - s = "disk change"; - break; - case DI_STATUS_NO_DISK: - s = "no disk"; - break; - case DI_STATUS_MOTOR_STOP: - s = "motor stop"; - break; - case DI_STATUS_DISK_ID_NOT_READ: - s = "disk id not read"; - break; + switch (DI_STATUS(drive_status)) { + case DI_STATUS_READY: + s = "ready"; + break; + case DI_STATUS_COVER_OPENED: + s = "cover opened"; + break; + case DI_STATUS_DISK_CHANGE: + s = "disk change"; + break; + case DI_STATUS_NO_DISK: + s = "no disk"; + break; + case DI_STATUS_MOTOR_STOP: + s = "motor stop"; + break; + case DI_STATUS_DISK_ID_NOT_READ: + s = "disk id not read"; + break; } return s; } @@ -719,37 +718,37 @@ { char *s = "unknown"; - switch(DI_ERROR(drive_status)) { - case DI_ERROR_NO_ERROR: - s = "no error"; - break; - case DI_ERROR_MOTOR_STOPPED: - s = "motor stopped"; - break; - case DI_ERROR_DISK_ID_NOT_READ: - s = "disk id not read"; - break; - case DI_ERROR_MEDIUM_NOT_PRESENT: - s = "medium not present"; - break; - case DI_ERROR_SEEK_INCOMPLETE: - s = "seek incomplete"; - break; - case DI_ERROR_UNRECOVERABLE_READ: - s = "unrecoverable read"; - break; - case DI_ERROR_INVALID_COMMAND: - s = "invalid command"; - break; - case DI_ERROR_BLOCK_OUT_OF_RANGE: - s = "block out of range"; - break; - case DI_ERROR_INVALID_FIELD: - s = "invalid field"; - break; - case DI_ERROR_MEDIUM_CHANGED: - s = "medium changed"; - break; + switch (DI_ERROR(drive_status)) { + case DI_ERROR_NO_ERROR: + s = "no error"; + break; + case DI_ERROR_MOTOR_STOPPED: + s = "motor stopped"; + break; + case DI_ERROR_DISK_ID_NOT_READ: + s = "disk id not read"; + break; + case DI_ERROR_MEDIUM_NOT_PRESENT: + s = "medium not present"; + break; + case DI_ERROR_SEEK_INCOMPLETE: + s = "seek incomplete"; + break; + case DI_ERROR_UNRECOVERABLE_READ: + s = "unrecoverable read"; + break; + case DI_ERROR_INVALID_COMMAND: + s = "invalid command"; + break; + case DI_ERROR_BLOCK_OUT_OF_RANGE: + s = "block out of range"; + break; + case DI_ERROR_INVALID_FIELD: + s = "invalid field"; + break; + case DI_ERROR_MEDIUM_CHANGED: + s = "medium changed"; + break; } return s; @@ -796,11 +795,10 @@ { u16 op = di_op(cmd); - if ((op & DI_DIR_WRITE)) { + if ((op & DI_DIR_WRITE)) return DMA_TO_DEVICE; - } else { + else return DMA_FROM_DEVICE; - } } /* @@ -838,11 +836,11 @@ unsigned long timeout = jiffies + secs*HZ; /* busy-wait for transfer complete */ - while((in_be32(cr_reg) & DI_CR_TSTART) && time_before(jiffies, timeout)) { + while ((in_be32(cr_reg) & DI_CR_TSTART) && + time_before(jiffies, timeout)) cpu_relax(); - } - return (in_be32(cr_reg) & DI_CR_TSTART)?-EBUSY:0; + return (in_be32(cr_reg) & DI_CR_TSTART) ? -EBUSY : 0; } /* @@ -925,9 +923,8 @@ cmd->ddev->drive_status = 0; - if (tstart) { + if (tstart) out_be32(io_base + DI_CR, DI_CR_TSTART | (opcode->op & 0x6)); - } } static void di_command_done(struct di_command *cmd); @@ -1073,7 +1070,7 @@ DBG("command %s failed, %d retries left\n", opcode->name, cmd->retries); di_debug_print_drive_status(drive_status); - + cmd->retries--; di_run_command(cmd); goto out; @@ -1094,14 +1091,14 @@ di_command_done(cmd); /* update the driver status */ - switch(DI_ERROR(drive_status)) { - case DI_ERROR_MOTOR_STOPPED: - case DI_ERROR_MEDIUM_NOT_PRESENT: - case DI_ERROR_MEDIUM_CHANGED: - set_bit(__DI_MEDIA_CHANGED, &ddev->flags); - break; - default: - break; + switch (DI_ERROR(drive_status)) { + case DI_ERROR_MOTOR_STOPPED: + case DI_ERROR_MEDIUM_NOT_PRESENT: + case DI_ERROR_MEDIUM_CHANGED: + set_bit(__DI_MEDIA_CHANGED, &ddev->flags); + break; + default: + break; } } else { @@ -1125,9 +1122,8 @@ static void di_command_done(struct di_command *cmd) { /* if specified, call the completion routine */ - if (cmd->done) { + if (cmd->done) cmd->done(cmd); - } } /* @@ -1149,11 +1145,10 @@ if (cmd->retries > cmd->max_retries) cmd->retries = cmd->max_retries; - if (!(opcode->op & DI_MODE_DMA)) { + if (!(opcode->op & DI_MODE_DMA)) retval = di_start_command(cmd); - } else { + else retval = di_start_dma_command(cmd); - } return retval; } @@ -1167,9 +1162,8 @@ cmd->done_data = &complete; cmd->done = di_wait_done; - if (di_run_command(cmd) > 0) { + if (di_run_command(cmd) > 0) wait_for_completion(&complete); - } return cmd->result; } @@ -1194,16 +1188,14 @@ out_be32(sr_reg, sr | reason); spin_unlock_irqrestore(&ddev->io_lock, flags); - if (reason & DI_SR_TCINT) { + if (reason & DI_SR_TCINT) di_complete_transfer(ddev, DI_SR_TCINT); - } if (reason & DI_SR_BRKINT) { DBG("BRKINT\n"); di_complete_transfer(ddev, DI_SR_BRKINT); } - if (reason & DI_SR_DEINT) { + if (reason & DI_SR_DEINT) di_complete_transfer(ddev, DI_SR_DEINT); - } spin_lock_irqsave(&ddev->io_lock, flags); } @@ -1257,7 +1249,7 @@ /* * Misc routines. - * + * */ /* @@ -1363,7 +1355,7 @@ int chunk_size; const int max_chunk_size = 3 * sizeof(cmd.cmdbuf0); - while(len > 0) { + while (len > 0) { /* we can write in groups of 12 bytes at max */ if (len > max_chunk_size) chunk_size = max_chunk_size; @@ -1407,7 +1399,7 @@ static void di_fw_patch(struct di_device *ddev, struct di_drive_code *section, int nr_sections) { - while(nr_sections > 0) { + while (nr_sections > 0) { di_fw_patch_mem(ddev, section->address, section->code, section->len); section++; @@ -1422,31 +1414,31 @@ { ddev->drive_code = NULL; - switch(ddev->model) { - case 0x20020402: - ddev->drive_code = &drive_20020402; - break; - case 0x20010608: - ddev->drive_code = &drive_20010608; - break; - case 0x20020823: - ddev->drive_code = &drive_20020823; - break; - case 0x20010831: - ddev->drive_code = &drive_20010831; - break; - default: - drv_printk(KERN_ERR, "sorry, drive %x is not yet" - " supported\n", - di_drive_info.date); - break; + switch (ddev->model) { + case 0x20020402: + ddev->drive_code = &drive_20020402; + break; + case 0x20010608: + ddev->drive_code = &drive_20010608; + break; + case 0x20020823: + ddev->drive_code = &drive_20020823; + break; + case 0x20010831: + ddev->drive_code = &drive_20010831; + break; + default: + drv_printk(KERN_ERR, "sorry, drive %x is not yet" + " supported\n", + di_drive_info.date); + break; } - return (ddev->drive_code)?0:-EINVAL; + return (ddev->drive_code) ? 0 : -EINVAL; } /* - * + * */ static u8 parking_code[] = { 0xa0, /* sub d0, d0 */ @@ -1468,10 +1460,10 @@ /* calculate an appropiate load address for the parking code */ irq_handler = le32_to_cpu(di_fw_get_irq_handler(ddev)); - load_address = (irq_handler >= 0x400000)?0x008502:0x40c600; + load_address = (irq_handler >= 0x400000) ? 0x008502 : 0x40c600; /* get the original interrupt handler */ - irq_handler = (ddev->model != 0x20010831)?0x00080A74:0x00080AA4; + irq_handler = (ddev->model != 0x20010831) ? 0x00080A74 : 0x00080AA4; original_irq_handler = irq_handler; /* fix the parking code to match our drive model */ @@ -1623,7 +1615,7 @@ result = di_enable_debug_commands(ddev); } - return di_result_ok(result)?0:-EINVAL; + return di_result_ok(result) ? 0 : -EINVAL; } /* @@ -1660,10 +1652,10 @@ /* postpone a bit the motor off if there are pending commands */ spin_lock_irqsave(&ddev->lock, flags); if (!ddev->cmd) { - ddev->cmd = cmd = &ddev->status; + ddev->cmd = cmd = &ddev->status; spin_unlock_irqrestore(&ddev->lock, flags); di_op_stopmotor(cmd, ddev); - di_prepare_command(cmd, 1); + di_prepare_command(cmd, 1); } else { spin_unlock_irqrestore(&ddev->lock, flags); mod_timer(&ddev->motor_off_timer, jiffies + 1*HZ); @@ -1706,7 +1698,7 @@ /* don't use debug commands, let's hope a drivechip is there */ di_reset(ddev); } else { - while(attempts-- > 0) { + while (attempts-- > 0) { if (!test_bit(__DI_INTEROPERABLE, &ddev->flags)) di_make_interoperable(ddev); @@ -1755,7 +1747,7 @@ static int di_read_toc(struct di_device *ddev) { static struct di_disk_id disk_id - __attribute__ ((aligned (DI_DMA_ALIGN+1))); + __attribute__ ((aligned(DI_DMA_ALIGN+1))); struct di_command cmd; int accepted_media = 0; int retval = 0; @@ -1764,9 +1756,8 @@ di_cancel_motor_off(ddev); /* spin up the drive if needed */ - if ((ddev->flags & DI_MEDIA_CHANGED)) { + if ((ddev->flags & DI_MEDIA_CHANGED)) di_spin_up_drive(ddev, enable_extensions); - } /* check that disk id can be read and that the media is appropiate */ memset(&disk_id, 0, sizeof(disk_id)); @@ -1827,7 +1818,7 @@ struct di_device *ddev = cmd->ddev; struct request *req; unsigned long flags; - int error = (cmd->result & DI_SR_TCINT)?0:-EIO; + int error = (cmd->result & DI_SR_TCINT) ? 0 : -EIO; spin_lock_irqsave(&ddev->lock, flags); @@ -1880,9 +1871,8 @@ /* we can schedule just a single request each time */ if (ddev->req || ddev->cmd) { blk_stop_queue(q); - if (ddev->cmd) { + if (ddev->cmd) set_bit(__DI_START_QUEUE, &ddev->flags); - } spin_unlock_irqrestore(&ddev->lock, flags); break; } @@ -1918,26 +1908,20 @@ * */ -static int di_open(struct inode *inode, struct file *filp) +static int di_open(struct block_device *bdev, fmode_t mode) { - struct di_device *ddev = inode->i_bdev->bd_disk->private_data; + struct di_device *ddev = bdev->bd_disk->private_data; struct di_command *cmd; DECLARE_COMPLETION(complete); unsigned long flags; int retval = 0; /* this is a read only device */ - if (filp->f_mode & FMODE_WRITE) { + if (mode & FMODE_WRITE) { retval = -EROFS; goto out; } - /* only allow a minor of 0 to be opened */ - if (iminor(inode)) { - retval = -ENODEV; - goto out; - } - /* * If we have a pending command, that's a previously scheduled * motor off. Wait for it to terminate before going on. @@ -1954,22 +1938,22 @@ } /* this will take care of validating the media */ - check_disk_change(inode->i_bdev); + check_disk_change(bdev); if (!ddev->nr_sectors) { retval = -ENOMEDIUM; goto out; } - spin_lock_irqsave(&ddev->queue_lock, flags); + spin_lock_irqsave(&ddev->queue_lock, flags); /* honor exclusive open mode */ if (ddev->ref_count == -1 || - (ddev->ref_count && (filp->f_flags & O_EXCL))) { + (ddev->ref_count && (mode & FMODE_EXCL))) { retval = -EBUSY; goto out_unlock; } - if ((filp->f_flags & O_EXCL)) + if ((mode & FMODE_EXCL)) ddev->ref_count = -1; else ddev->ref_count++; @@ -1981,9 +1965,9 @@ } -static int di_release(struct inode *inode, struct file *filp) +static int di_release(struct gendisk *disk, fmode_t mode) { - struct di_device *ddev = inode->i_bdev->bd_disk->private_data; + struct di_device *ddev = disk->private_data; unsigned long flags; spin_lock_irqsave(&ddev->queue_lock, flags); @@ -2022,7 +2006,7 @@ return (ddev->flags & DI_MEDIA_CHANGED) ? 1 : 0; } -static int di_ioctl(struct inode *inode, struct file *filp, +static int di_ioctl(struct block_device *bdev, fmode_t mode, unsigned int cmd, unsigned long arg) { switch (cmd) { @@ -2060,7 +2044,7 @@ case BLKGETSIZE: case BLKGETSIZE64: case BLKFLSBUF: - return ioctl_by_bdev(inode->i_bdev,cmd,arg); + return ioctl_by_bdev(bdev, cmd, arg); default: return -EINVAL; } @@ -2195,9 +2179,9 @@ goto out; err_alloc_disk: - blk_cleanup_queue(ddev->queue); + blk_cleanup_queue(ddev->queue); err_blk_init_queue: - unregister_blkdev(DI_MAJOR, DI_NAME); + unregister_blkdev(DI_MAJOR, DI_NAME); err_register_blkdev: out: return retval; @@ -2237,19 +2221,18 @@ retval = di_init_blk_dev(ddev); if (!retval) { retval = di_init_irq(ddev); - if (retval) { + if (retval) di_exit_blk_dev(ddev); - } else { + else di_init_proc(ddev); - } } return retval; } static void di_exit(struct di_device *ddev) { - di_exit_blk_dev(ddev); - di_exit_irq(ddev); + di_exit_blk_dev(ddev); + di_exit_irq(ddev); di_exit_proc(ddev); if (ddev->io_base) { iounmap(ddev->io_base); @@ -2369,7 +2352,7 @@ static void __exit di_exit_module(void) { - of_unregister_platform_driver(&di_of_driver); + of_unregister_platform_driver(&di_of_driver); } module_init(di_init_module); @@ -2378,4 +2361,3 @@ MODULE_AUTHOR(DRV_AUTHOR); MODULE_DESCRIPTION(DRV_DESCRIPTION); MODULE_LICENSE("GPL"); - |
From: Albert H. <he...@us...> - 2009-02-01 18:29:46
|
Update of /cvsroot/gc-linux/linux/drivers/input/si In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv17186/drivers/input/si Modified Files: Kconfig Makefile gcn-keymap.h gcn-si.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: Makefile =================================================================== RCS file: /cvsroot/gc-linux/linux/drivers/input/si/Makefile,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- Makefile 6 Jul 2005 16:46:44 -0000 1.1 +++ Makefile 1 Feb 2009 18:29:35 -0000 1.2 @@ -1,5 +1,5 @@ # -# Makefile for the Nintendo GameCube Serial Interface. +# Makefile for the Nintendo GameCube/Wii Serial Interface (SI). # obj-$(CONFIG_GAMECUBE_SI) += gcn-si.o Index: gcn-keymap.h =================================================================== RCS file: /cvsroot/gc-linux/linux/drivers/input/si/gcn-keymap.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- gcn-keymap.h 26 Mar 2008 23:25:11 -0000 1.2 +++ gcn-keymap.h 1 Feb 2009 18:29:35 -0000 1.3 @@ -12,36 +12,68 @@ */ static unsigned char gamecube_keymap[] = { - /* 00 */ KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_HOME, KEY_END, - /* 08 */ KEY_PAGEUP, KEY_PAGEDOWN, KEY_SCROLLLOCK, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, - /* 10 */ KEY_A, KEY_B, KEY_C, KEY_D, KEY_E, KEY_F, KEY_G, KEY_H, - /* 18 */ KEY_I, KEY_J, KEY_K, KEY_L, KEY_M, KEY_N, KEY_O, KEY_P, - /* 20 */ KEY_Q, KEY_R, KEY_S, KEY_T, KEY_U, KEY_V, KEY_W, KEY_X, - /* 28 */ KEY_Y, KEY_Z, KEY_1, KEY_2, KEY_3, KEY_4, KEY_5, KEY_6, - /* 30 */ KEY_7, KEY_8, KEY_9, KEY_0, KEY_MINUS, KEY_EQUAL, KEY_RESERVED, KEY_KPASTERISK, - /* 38 */ KEY_LEFTBRACE, KEY_SEMICOLON, KEY_APOSTROPHE, KEY_RIGHTBRACE, KEY_COMMA, KEY_DOT, KEY_SLASH, KEY_BACKSLASH, - /* 40 */ KEY_F1, KEY_F2, KEY_F3, KEY_F4, KEY_F5, KEY_F6, KEY_F7, KEY_F8, - /* 48 */ KEY_F9, KEY_F10, KEY_F11, KEY_F12, KEY_ESC, KEY_INSERT, KEY_DELETE, KEY_GRAVE, - /* 50 */ KEY_BACKSPACE, KEY_TAB, KEY_RESERVED, KEY_CAPSLOCK, KEY_LEFTSHIFT, KEY_RIGHTSHIFT, KEY_LEFTCTRL, KEY_LEFTALT, - /* 58 */ KEY_RESERVED, KEY_SPACE, KEY_RESERVED, KEY_RESERVED, KEY_LEFT, KEY_DOWN, KEY_UP, KEY_RIGHT, - /* 60 */ KEY_RESERVED, KEY_ENTER, KEY_RESERVED, KEY_RESERVED, KEY_SEMICOLON, KEY_KPPLUS, KEY_RESERVED, KEY_RESERVED, - /* 68 */ KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, - /* 70 */ KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, - /* 78 */ KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, - /* 80 */ KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, - /* 88 */ KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, - /* 90 */ KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, - /* 98 */ KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, - /* a0 */ KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, - /* a8 */ KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, - /* b0 */ KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, - /* b8 */ KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, - /* c0 */ KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, - /* c8 */ KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, - /* d0 */ KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, - /* d8 */ KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, - /* e0 */ KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, - /* e8 */ KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, - /* f0 */ KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, - /* f8 */ KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED + /* 00 */ KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, + KEY_RESERVED, KEY_RESERVED, KEY_HOME, KEY_END, + /* 08 */ KEY_PAGEUP, KEY_PAGEDOWN, KEY_SCROLLLOCK, KEY_RESERVED, + KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, + /* 10 */ KEY_A, KEY_B, KEY_C, KEY_D, + KEY_E, KEY_F, KEY_G, KEY_H, + /* 18 */ KEY_I, KEY_J, KEY_K, KEY_L, + KEY_M, KEY_N, KEY_O, KEY_P, + /* 20 */ KEY_Q, KEY_R, KEY_S, KEY_T, + KEY_U, KEY_V, KEY_W, KEY_X, + /* 28 */ KEY_Y, KEY_Z, KEY_1, KEY_2, + KEY_3, KEY_4, KEY_5, KEY_6, + /* 30 */ KEY_7, KEY_8, KEY_9, KEY_0, + KEY_MINUS, KEY_EQUAL, KEY_RESERVED, KEY_KPASTERISK, + /* 38 */ KEY_LEFTBRACE, KEY_SEMICOLON, KEY_APOSTROPHE, KEY_RIGHTBRACE, + KEY_COMMA, KEY_DOT, KEY_SLASH, KEY_BACKSLASH, + /* 40 */ KEY_F1, KEY_F2, KEY_F3, KEY_F4, + KEY_F5, KEY_F6, KEY_F7, KEY_F8, + /* 48 */ KEY_F9, KEY_F10, KEY_F11, KEY_F12, + KEY_ESC, KEY_INSERT, KEY_DELETE, KEY_GRAVE, + /* 50 */ KEY_BACKSPACE, KEY_TAB, KEY_RESERVED, KEY_CAPSLOCK, + KEY_LEFTSHIFT, KEY_RIGHTSHIFT, KEY_LEFTCTRL, KEY_LEFTALT, + /* 58 */ KEY_RESERVED, KEY_SPACE, KEY_RESERVED, KEY_RESERVED, + KEY_LEFT, KEY_DOWN, KEY_UP, KEY_RIGHT, + /* 60 */ KEY_RESERVED, KEY_ENTER, KEY_RESERVED, KEY_RESERVED, + KEY_SEMICOLON, KEY_KPPLUS, KEY_RESERVED, KEY_RESERVED, + /* 68 */ KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, + KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, + /* 70 */ KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, + KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, + /* 78 */ KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, + KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, + /* 80 */ KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, + KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, + /* 88 */ KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, + KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, + /* 90 */ KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, + KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, + /* 98 */ KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, + KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, + /* a0 */ KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, + KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, + /* a8 */ KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, + KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, + /* b0 */ KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, + KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, + /* b8 */ KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, + KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, + /* c0 */ KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, + KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, + /* c8 */ KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, + KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, + /* d0 */ KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, + KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, + /* d8 */ KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, + KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, + /* e0 */ KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, + KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, + /* e8 */ KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, + KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, + /* f0 */ KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, + KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, + /* f8 */ KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, + KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED }; Index: gcn-si.c =================================================================== RCS file: /cvsroot/gc-linux/linux/drivers/input/si/gcn-si.c,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- gcn-si.c 13 Sep 2008 19:42:56 -0000 1.12 +++ gcn-si.c 1 Feb 2009 18:29:35 -0000 1.13 @@ -2,9 +2,9 @@ * drivers/input/gcn-si.c * * Nintendo GameCube/Wii Serial Interface (SI) driver. - * Copyright (C) 2004-2008 The GameCube Linux Team + * Copyright (C) 2004-2009 The GameCube Linux Team * Copyright (C) 2004 Steven Looman - * Copyright (C) 2005,2008 Albert Herranz + * Copyright (C) 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 @@ -45,10 +45,10 @@ static char si_driver_version[] = "1.0i"; #define drv_printk(level, format, arg...) \ - printk(level DRV_MODULE_NAME ": " format , ## arg) + printk(level DRV_MODULE_NAME ": " format , ## arg) -#define SI_MAX_PORTS 4 /* the four controller ports */ -#define SI_REFRESH_TIME HZ/100 /* polling interval */ +#define SI_MAX_PORTS 4 /* the four controller ports */ +#define SI_REFRESH_TIME (HZ/100) /* polling interval */ /* * Hardware registers @@ -106,11 +106,11 @@ struct input_dev *idev; struct timer_list timer; char name[32]; - + union { struct si_keyboard_status keyboard; }; - + }; struct si_drvdata { @@ -133,10 +133,9 @@ #else static int __init si_force_keyboard_port_setup(char *line) { - if (sscanf(line, "%d", &si_force_keyboard_port) != 1) { + if (sscanf(line, "%d", &si_force_keyboard_port) != 1) si_force_keyboard_port = -1; - } - return 1; + return 1; } __setup("force_keyboard_port=", si_force_keyboard_port_setup); #endif /* MODULE */ @@ -183,7 +182,7 @@ static void si_set_rumbling(void __iomem *io_base, unsigned int index, int rumble) { - out_be32(io_base + SICOUTBUF(index), 0x00400000 | (rumble)?1:0); + out_be32(io_base + SICOUTBUF(index), 0x00400000 | (rumble) ? 1 : 0); out_be32(io_base + SISR, 0x80000000); } @@ -192,7 +191,7 @@ unsigned long deadline = jiffies + 2*HZ; int borked = 0; - while(!(in_be32(io_base + SICOMCSR) & (1 << 31)) && !borked) { + while (!(in_be32(io_base + SICOMCSR) & (1 << 31)) && !borked) { cpu_relax(); borked = time_after(jiffies, deadline); } @@ -312,7 +311,7 @@ raw[1] >> 0 & 0xFF); break; - + case CTL_KEYBOARD: /* raw nibbles: @@ -320,7 +319,7 @@ where: [n] = fixed to n <nH> <nL> = high / low nibble of n-th key pressed - (0 if not pressed) + (0 if not pressed) <X> = <1H> xor <2H> xor <3H> <C> = counter: 0, 0, 1, 1, 2, 2, ..., F, F, 0, 0, ... */ @@ -388,9 +387,8 @@ void __iomem *io_base = port->drvdata->io_base; if (type == EV_FF) { - if (code == FF_RUMBLE) { + if (code == FF_RUMBLE) si_set_rumbling(io_base, index, value); - } } return value; @@ -501,7 +499,7 @@ } else if (port->id & ID_WIRELESS_BIT) { /* wireless pad */ port->type = CTL_PAD; - strcpy(port->name,(port->id & ID_WAVEBIRD_BIT) ? + strcpy(port->name, (port->id & ID_WAVEBIRD_BIT) ? "Nintendo Wavebird" : "wireless pad"); } else if (port->id == ID_KEYBOARD) { port->type = CTL_KEYBOARD; @@ -509,7 +507,7 @@ } else { port->type = CTL_UNKNOWN; if (port->id) { - sprintf(port->name, "unknown (%x)", + sprintf(port->name, "unknown (%x)", port->id); #ifdef HACK_FORCE_KEYBOARD_PORT if (index+1 == si_force_keyboard_port) { @@ -531,7 +529,7 @@ goto done; } - idev = input_allocate_device(); + idev = input_allocate_device(); if (!idev) { drv_printk(KERN_ERR, "failed to allocate input_dev\n"); retval = -ENOMEM; @@ -541,7 +539,7 @@ idev->open = si_open; idev->close = si_close; idev->name = port->name; - + switch (port->type) { case CTL_PAD: retval = si_setup_pad(idev); @@ -575,21 +573,29 @@ struct si_port *port; int index; int retval; + int error; drvdata->io_base = ioremap(mem->start, mem->end - mem->start + 1); for (index = 0; index < SI_MAX_PORTS; ++index) { port = &drvdata->ports[index]; - memset(port, 0, sizeof(*port)); + memset(port, 0, sizeof(*port)); port->index = index; port->drvdata = drvdata; retval = si_port_probe(port); - if (!retval) - input_register_device(port->idev); - - drv_printk(KERN_INFO, "port %d: %s\n", index+1, port->name); + if (!retval) { + error = input_register_device(port->idev); + if (error) { + drv_printk(KERN_ERR, + "input device registration failed" + " (%d) for port %d", error, index+1); + port->idev = NULL; + } else + drv_printk(KERN_INFO, "port %d: %s\n", + index+1, port->name); + } } si_setup_polling(drvdata); @@ -608,10 +614,10 @@ input_unregister_device(port->idev); } - if (drvdata->io_base) { - iounmap(drvdata->io_base); - drvdata->io_base = NULL; - } + if (drvdata->io_base) { + iounmap(drvdata->io_base); + drvdata->io_base = NULL; + } } /* @@ -621,36 +627,36 @@ static int si_do_probe(struct device *dev, struct resource *mem) { - struct si_drvdata *drvdata; - int retval; + struct si_drvdata *drvdata; + int retval; - drvdata = kzalloc(sizeof(*drvdata), GFP_KERNEL); - if (!drvdata) { - drv_printk(KERN_ERR, "failed to allocate si_drvdata\n"); - return -ENOMEM; - } - dev_set_drvdata(dev, drvdata); - drvdata->dev = dev; + drvdata = kzalloc(sizeof(*drvdata), GFP_KERNEL); + if (!drvdata) { + drv_printk(KERN_ERR, "failed to allocate si_drvdata\n"); + return -ENOMEM; + } + dev_set_drvdata(dev, drvdata); + drvdata->dev = dev; - retval = si_init(drvdata, mem); - if (retval) { - dev_set_drvdata(dev, NULL); - kfree(drvdata); - } - return retval; + retval = si_init(drvdata, mem); + if (retval) { + dev_set_drvdata(dev, NULL); + kfree(drvdata); + } + return retval; } static int si_do_remove(struct device *dev) { - struct si_drvdata *drvdata = dev_get_drvdata(dev); + struct si_drvdata *drvdata = dev_get_drvdata(dev); - if (drvdata) { - si_exit(drvdata); - dev_set_drvdata(dev, NULL); - kfree(drvdata); - return 0; - } - return -ENODEV; + if (drvdata) { + si_exit(drvdata); + dev_set_drvdata(dev, NULL); + kfree(drvdata); + return 0; + } + return -ENODEV; } @@ -660,40 +666,40 @@ */ static int __init si_of_probe(struct of_device *odev, - const struct of_device_id *match) + const struct of_device_id *match) { - struct resource mem; - int retval; + struct resource mem; + int retval; - retval = of_address_to_resource(odev->node, 0, &mem); - if (retval) { - drv_printk(KERN_ERR, "no io memory range found\n"); - return -ENODEV; - } + retval = of_address_to_resource(odev->node, 0, &mem); + if (retval) { + drv_printk(KERN_ERR, "no io memory range found\n"); + return -ENODEV; + } - return si_do_probe(&odev->dev, &mem); + return si_do_probe(&odev->dev, &mem); } static int __exit si_of_remove(struct of_device *odev) { - return si_do_remove(&odev->dev); + return si_do_remove(&odev->dev); } static struct of_device_id si_of_match[] = { - { .compatible = "nintendo,flipper-serial" }, - { .compatible = "nintendo,hollywood-serial" }, - { }, + { .compatible = "nintendo,flipper-serial" }, + { .compatible = "nintendo,hollywood-serial" }, + { }, }; MODULE_DEVICE_TABLE(of, si_of_match); static struct of_platform_driver si_of_driver = { - .owner = THIS_MODULE, - .name = DRV_MODULE_NAME, - .match_table = si_of_match, - .probe = si_of_probe, - .remove = si_of_remove, + .owner = THIS_MODULE, + .name = DRV_MODULE_NAME, + .match_table = si_of_match, + .probe = si_of_probe, + .remove = si_of_remove, }; @@ -704,15 +710,15 @@ static int __init si_init_module(void) { - drv_printk(KERN_INFO, "%s - version %s\n", DRV_DESCRIPTION, - si_driver_version); + drv_printk(KERN_INFO, "%s - version %s\n", DRV_DESCRIPTION, + si_driver_version); - return of_register_platform_driver(&si_of_driver); + return of_register_platform_driver(&si_of_driver); } static void __exit si_exit_module(void) { - of_unregister_platform_driver(&si_of_driver); + of_unregister_platform_driver(&si_of_driver); } module_init(si_init_module); Index: Kconfig =================================================================== RCS file: /cvsroot/gc-linux/linux/drivers/input/si/Kconfig,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- Kconfig 26 Mar 2008 20:02:28 -0000 1.2 +++ Kconfig 1 Feb 2009 18:29:35 -0000 1.3 @@ -1,5 +1,5 @@ # -# Nintendo GameCube Serial Interface (SI) support +# Nintendo GameCube/Wii Serial Interface (SI) configuration # config GAMECUBE_SI |
From: Albert H. <he...@us...> - 2009-02-01 18:29:45
|
Update of /cvsroot/gc-linux/linux/arch/powerpc/boot/dts In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv17186/arch/powerpc/boot/dts Modified Files: gamecube.dts wii.dts 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: gamecube.dts =================================================================== RCS file: /cvsroot/gc-linux/linux/arch/powerpc/boot/dts/gamecube.dts,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- gamecube.dts 15 Nov 2008 20:10:14 -0000 1.7 +++ gamecube.dts 1 Feb 2009 18:29:34 -0000 1.8 @@ -2,8 +2,8 @@ * arch/powerpc/boot/dts/gamecube.dts * * Nintendo GameCube platform device tree source - * Copyright (C) 2007-2008 The GameCube Linux Team - * Copyright (C) 2007,2008 Albert Herranz + * Copyright (C) 2007-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 Index: wii.dts =================================================================== RCS file: /cvsroot/gc-linux/linux/arch/powerpc/boot/dts/wii.dts,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- wii.dts 25 Nov 2008 19:09:31 -0000 1.10 +++ wii.dts 1 Feb 2009 18:29:34 -0000 1.11 @@ -2,8 +2,8 @@ * arch/powerpc/boot/dts/wii.dts * * Nintendo Wii platform device tree source - * 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 @@ -91,7 +91,7 @@ model = "hollywood"; compatible = "nintendo,hollywood"; clock-frequency = <e7be2c0>; /* 243MHz */ - ranges = <0c000000 0c000000 00010000 + ranges = <0c000000 0c000000 00010000 0d000000 0d000000 00010000 0d800000 0d800000 00001000 133e0000 133e0000 00020000>; @@ -159,11 +159,4 @@ compatible = "nintendo,starlet-hcd"; }; }; - - led { - compatible = "gpio-led"; - label = "tray"; - gpios = <&gpio0 5 0>; - }; }; - |
From: Albert H. <he...@us...> - 2009-02-01 18:29:45
|
Update of /cvsroot/gc-linux/linux/arch/powerpc/mm In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv17186/arch/powerpc/mm Modified Files: pgtable_32.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: pgtable_32.c =================================================================== RCS file: /cvsroot/gc-linux/linux/arch/powerpc/mm/pgtable_32.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- pgtable_32.c 15 Nov 2008 20:10:14 -0000 1.1 +++ pgtable_32.c 1 Feb 2009 18:29:35 -0000 1.2 @@ -73,7 +73,7 @@ #endif /* HAVE_TLBCAM */ #ifdef CONFIG_PTE_64BIT -/* 44x uses an 8kB pgdir because it has 8-byte Linux PTEs. */ +/* Some processors use an 8kB pgdir because they have 8-byte Linux PTEs. */ #define PGDIR_ORDER 1 #else #define PGDIR_ORDER 0 @@ -206,7 +206,8 @@ * */ if (!__map_without_bats) { - printk("__ioremap(): phys addr 0x%llx is RAM lr %p\n", + printk(KERN_WARNING + "__ioremap(): phys addr 0x%llx is RAM lr %p\n", (unsigned long long)p, __builtin_return_address(0)); return NULL; @@ -297,7 +298,7 @@ } /* - * Map in all of physical memory starting at KERNELBASE. + * Map in a big chunk of physical memory starting at KERNELBASE. */ void __init mapin_ram(void) { |
From: Albert H. <he...@us...> - 2009-02-01 18:29:45
|
Update of /cvsroot/gc-linux/linux/drivers/rtc In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv17186/drivers/rtc Modified Files: Kconfig Makefile rtc-gcn.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: Makefile =================================================================== RCS file: /cvsroot/gc-linux/linux/drivers/rtc/Makefile,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- Makefile 15 Nov 2008 20:10:15 -0000 1.4 +++ Makefile 1 Feb 2009 18:29:35 -0000 1.5 @@ -23,22 +23,29 @@ obj-$(CONFIG_RTC_DRV_BFIN) += rtc-bfin.o obj-$(CONFIG_RTC_DRV_CMOS) += rtc-cmos.o obj-$(CONFIG_RTC_DRV_DS1216) += rtc-ds1216.o +obj-$(CONFIG_RTC_DRV_DS1286) += rtc-ds1286.o obj-$(CONFIG_RTC_DRV_DS1302) += rtc-ds1302.o obj-$(CONFIG_RTC_DRV_DS1305) += rtc-ds1305.o obj-$(CONFIG_RTC_DRV_DS1307) += rtc-ds1307.o obj-$(CONFIG_RTC_DRV_DS1374) += rtc-ds1374.o +obj-$(CONFIG_RTC_DRV_DS1390) += rtc-ds1390.o obj-$(CONFIG_RTC_DRV_DS1511) += rtc-ds1511.o obj-$(CONFIG_RTC_DRV_DS1553) += rtc-ds1553.o obj-$(CONFIG_RTC_DRV_DS1672) += rtc-ds1672.o obj-$(CONFIG_RTC_DRV_DS1742) += rtc-ds1742.o +obj-$(CONFIG_RTC_DRV_DS3234) += rtc-ds3234.o obj-$(CONFIG_RTC_DRV_EP93XX) += rtc-ep93xx.o obj-$(CONFIG_RTC_DRV_FM3130) += rtc-fm3130.o obj-$(CONFIG_RTC_DRV_GCN) += rtc-gcn.o obj-$(CONFIG_RTC_DRV_ISL1208) += rtc-isl1208.o obj-$(CONFIG_RTC_DRV_M41T80) += rtc-m41t80.o obj-$(CONFIG_RTC_DRV_M41T94) += rtc-m41t94.o +obj-$(CONFIG_RTC_DRV_M48T35) += rtc-m48t35.o obj-$(CONFIG_RTC_DRV_M48T59) += rtc-m48t59.o obj-$(CONFIG_RTC_DRV_M48T86) += rtc-m48t86.o +obj-$(CONFIG_RTC_DRV_BQ4802) += rtc-bq4802.o +obj-$(CONFIG_RTC_DRV_SUN4V) += rtc-sun4v.o +obj-$(CONFIG_RTC_DRV_STARFIRE) += rtc-starfire.o obj-$(CONFIG_RTC_DRV_MAX6900) += rtc-max6900.o obj-$(CONFIG_RTC_DRV_MAX6902) += rtc-max6902.o obj-$(CONFIG_RTC_DRV_OMAP) += rtc-omap.o @@ -46,17 +53,21 @@ obj-$(CONFIG_RTC_DRV_PCF8583) += rtc-pcf8583.o obj-$(CONFIG_RTC_DRV_PL030) += rtc-pl030.o obj-$(CONFIG_RTC_DRV_PL031) += rtc-pl031.o +obj-$(CONFIG_RTC_DRV_PARISC) += rtc-parisc.o obj-$(CONFIG_RTC_DRV_PPC) += rtc-ppc.o obj-$(CONFIG_RTC_DRV_R9701) += rtc-r9701.o obj-$(CONFIG_RTC_DRV_RS5C313) += rtc-rs5c313.o obj-$(CONFIG_RTC_DRV_RS5C348) += rtc-rs5c348.o obj-$(CONFIG_RTC_DRV_RS5C372) += rtc-rs5c372.o +obj-$(CONFIG_RTC_DRV_RX8581) += rtc-rx8581.o obj-$(CONFIG_RTC_DRV_S35390A) += rtc-s35390a.o obj-$(CONFIG_RTC_DRV_S3C) += rtc-s3c.o obj-$(CONFIG_RTC_DRV_SA1100) += rtc-sa1100.o obj-$(CONFIG_RTC_DRV_SH) += rtc-sh.o obj-$(CONFIG_RTC_DRV_STK17TA8) += rtc-stk17ta8.o obj-$(CONFIG_RTC_DRV_TEST) += rtc-test.o +obj-$(CONFIG_RTC_DRV_TWL4030) += rtc-twl4030.o obj-$(CONFIG_RTC_DRV_V3020) += rtc-v3020.o obj-$(CONFIG_RTC_DRV_VR41XX) += rtc-vr41xx.o +obj-$(CONFIG_RTC_DRV_WM8350) += rtc-wm8350.o obj-$(CONFIG_RTC_DRV_X1205) += rtc-x1205.o Index: Kconfig =================================================================== RCS file: /cvsroot/gc-linux/linux/drivers/rtc/Kconfig,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- Kconfig 15 Nov 2008 20:10:15 -0000 1.4 +++ Kconfig 1 Feb 2009 18:29:35 -0000 1.5 @@ -171,10 +171,10 @@ will be called rtc-max6900. config RTC_DRV_RS5C372 - tristate "Ricoh RS5C372A/B, RV5C386, RV5C387A" + tristate "Ricoh R2025S/D, RS5C372A/B, RV5C386, RV5C387A" help If you say yes here you get support for the - Ricoh RS5C372A, RS5C372B, RV5C386, and RV5C387A RTC chips. + Ricoh R2025S/D, RS5C372A, RS5C372B, RV5C386, and RV5C387A RTC chips. This driver can also be built as a module. If so, the module will be called rtc-rs5c372. @@ -220,22 +220,22 @@ will be called rtc-pcf8583. config RTC_DRV_M41T80 - tristate "ST M41T80/81/82/83/84/85/87" + tristate "ST M41T65/M41T80/81/82/83/84/85/87" help - If you say Y here you will get support for the - ST M41T80 RTC chips series. Currently following chips are - supported: M41T80, M41T81, M41T82, M41T83, M41ST84, M41ST85 - and M41ST87. + If you say Y here you will get support for the ST M41T60 + and M41T80 RTC chips series. Currently, the following chips are + supported: M41T65, M41T80, M41T81, M41T82, M41T83, M41ST84, + M41ST85, and M41ST87. This driver can also be built as a module. If so, the module will be called rtc-m41t80. config RTC_DRV_M41T80_WDT - bool "ST M41T80 series RTC watchdog timer" + bool "ST M41T65/M41T80 series RTC watchdog timer" depends on RTC_DRV_M41T80 help If you say Y here you will get support for the - watchdog timer in ST M41T80 RTC chips series. + watchdog timer in the ST M41T60 and M41T80 RTC chips series. config RTC_DRV_TWL92330 boolean "TI TWL92330/Menelaus" @@ -246,6 +246,16 @@ platforms. The support is integrated with the rest of the Menelaus driver; it's not separate module. +config RTC_DRV_TWL4030 + tristate "TI TWL4030/TWL5030/TPS659x0" + depends on RTC_CLASS && TWL4030_CORE + help + If you say yes here you get support for the RTC on the + TWL4030 family chips, used mostly with OMAP3 platforms. + + This driver can also be built as a module. If so, the module + will be called rtc-twl4030. + config RTC_DRV_S35390A tristate "Seiko Instruments S-35390A" select BITREVERSE @@ -267,6 +277,14 @@ This driver can also be built as a module. If so the module will be called rtc-fm3130. +config RTC_DRV_RX8581 + tristate "Epson RX-8581" + help + If you say yes here you will get support for the Epson RX-8581. + + This driver can also be built as a module. If so the module + will be called rtc-rx8581. + endif # I2C comment "SPI RTC drivers" @@ -292,6 +310,17 @@ This driver can also be built as a module. If so, the module will be called rtc-ds1305. +config RTC_DRV_DS1390 + tristate "Dallas/Maxim DS1390/93/94" + help + If you say yes here you get support for the DS1390/93/94 chips. + + This driver only supports the RTC feature, and not other chip + features such as alarms and trickle charging. + + This driver can also be built as a module. If so, the module + will be called rtc-ds1390. + config RTC_DRV_MAX6902 tristate "Maxim MAX6902" help @@ -319,6 +348,15 @@ This driver can also be built as a module. If so, the module will be called rtc-rs5c348. +config RTC_DRV_DS3234 + tristate "Maxim/Dallas DS3234" + help + If you say yes here you get support for the + Maxim/Dallas DS3234 SPI RTC chip. + + This driver can also be built as a module. If so, the module + will be called rtc-ds3234. + endif # SPI_MASTER comment "Platform RTC drivers" @@ -329,7 +367,7 @@ config RTC_DRV_CMOS tristate "PC-style 'CMOS'" - depends on X86 || ALPHA || ARM || M32R || ATARI || PPC || MIPS + depends on X86 || ALPHA || ARM || M32R || ATARI || PPC || MIPS || SPARC64 default y if X86 help Say "yes" here to get direct support for the real time clock @@ -352,6 +390,11 @@ help If you say yes here you get support for the Dallas DS1216 RTC chips. +config RTC_DRV_DS1286 + tristate "Dallas DS1286" + help + If you say yes here you get support for the Dallas DS1286 RTC chips. + config RTC_DRV_DS1302 tristate "Dallas DS1302" depends on SH_SECUREEDGE5410 @@ -405,15 +448,36 @@ This driver can also be built as a module. If so, the module will be called rtc-m48t86. +config RTC_DRV_M48T35 + tristate "ST M48T35" + help + If you say Y here you will get support for the + ST M48T35 RTC chip. + + This driver can also be built as a module, if so, the module + will be called "rtc-m48t35". + config RTC_DRV_M48T59 - tristate "ST M48T59" + tristate "ST M48T59/M48T08/M48T02" help If you say Y here you will get support for the - ST M48T59 RTC chip. + ST M48T59 RTC chip and compatible ST M48T08 and M48T02. + + These chips are usually found in Sun SPARC and UltraSPARC + workstations. This driver can also be built as a module, if so, the module will be called "rtc-m48t59". +config RTC_DRV_BQ4802 + tristate "TI BQ4802" + help + If you say Y here you will get support for the TI + BQ4802 RTC chip. + + This driver can also be built as a module. If so, the module + will be called rtc-bq4802. + config RTC_DRV_V3020 tristate "EM Microelectronic V3020" help @@ -423,6 +487,16 @@ This driver can also be built as a module. If so, the module will be called rtc-v3020. +config RTC_DRV_WM8350 + tristate "Wolfson Microelectronics WM8350 RTC" + depends on MFD_WM8350 + help + If you say yes here you will get support for the RTC subsystem + of the Wolfson Microelectronics WM8350. + + This driver can also be built as a module. If so, the module + will be called "rtc-wm8350". + config RTC_DRV_GCN bool "Nintendo GameCube/Wii Real Time Clock and SRAM" depends on GAMECUBE_EXI @@ -585,12 +659,34 @@ help If you say yes here you get support for the Ricoh RS5C313 RTC chips. +config RTC_DRV_PARISC + tristate "PA-RISC firmware RTC support" + depends on PARISC + help + Say Y or M here to enable RTC support on PA-RISC systems using + firmware calls. If you do not know what you are doing, you should + just say Y. + config RTC_DRV_PPC tristate "PowerPC machine dependent RTC support" - depends on PPC_MERGE + depends on PPC help The PowerPC kernel has machine-specific functions for accessing the RTC. This exposes that functionality through the generic RTC class. +config RTC_DRV_SUN4V + bool "SUN4V Hypervisor RTC" + depends on SPARC64 + help + If you say Y here you will get support for the Hypervisor + based RTC on SUN4V systems. + +config RTC_DRV_STARFIRE + bool "Starfire RTC" + depends on SPARC64 + help + If you say Y here you will get support for the RTC found on + Starfire systems. + endif # RTC_CLASS Index: rtc-gcn.c =================================================================== RCS file: /cvsroot/gc-linux/linux/drivers/rtc/rtc-gcn.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- rtc-gcn.c 13 Sep 2008 19:42:56 -0000 1.3 +++ rtc-gcn.c 1 Feb 2009 18:29:35 -0000 1.4 @@ -2,8 +2,8 @@ * drivers/rtc/rtc-gcn.c * * Nintendo GameCube/Wii RTC/SRAM driver - * Copyright (C) 2004-2008 The GameCube Linux Team - * Copyright (C) 2005,2008 Albert Herranz + * Copyright (C) 2004-2009 The GameCube Linux Team + * Copyright (C) 2005,2008,2009 Albert Herranz * * Based on gamecube_time.c from Torben Nielsen. * @@ -290,17 +290,17 @@ static struct exi_device_id gcnrtc_eid_table[] = { - { - .channel = RTC_EXI_CHANNEL, - .device = RTC_EXI_DEVICE, - .id = RTC_EXI_GCN_ID - }, - { - .channel = RTC_EXI_CHANNEL, - .device = RTC_EXI_DEVICE, - .id = RTC_EXI_RVL_ID - }, - { }, + { + .channel = RTC_EXI_CHANNEL, + .device = RTC_EXI_DEVICE, + .id = RTC_EXI_GCN_ID + }, + { + .channel = RTC_EXI_CHANNEL, + .device = RTC_EXI_DEVICE, + .id = RTC_EXI_RVL_ID + }, + { }, }; static struct exi_driver gcnrtc_driver = { |
From: Albert H. <he...@us...> - 2009-02-01 18:29:44
|
Update of /cvsroot/gc-linux/linux/arch/powerpc In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv17186/arch/powerpc Modified Files: Kconfig Kconfig.debug 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: Kconfig =================================================================== RCS file: /cvsroot/gc-linux/linux/arch/powerpc/Kconfig,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- Kconfig 15 Nov 2008 20:10:13 -0000 1.5 +++ Kconfig 1 Feb 2009 18:29:34 -0000 1.6 @@ -19,8 +19,8 @@ default 64 if PPC64 default 32 if !PPC64 -config PPC_MERGE - def_bool y +config ARCH_PHYS_ADDR_T_64BIT + def_bool PPC64 || PHYS_64BIT config MMU bool @@ -108,8 +108,7 @@ config PPC bool default y - select HAVE_DYNAMIC_FTRACE - select HAVE_FTRACE + select HAVE_FUNCTION_TRACER select ARCH_WANT_OPTIONAL_GPIOLIB select HAVE_IDE select HAVE_IOREMAP_PROT @@ -227,6 +226,8 @@ source "init/Kconfig" +source "kernel/Kconfig.freezer" + source "arch/powerpc/sysdev/Kconfig" source "arch/powerpc/platforms/Kconfig" @@ -321,13 +322,11 @@ config CRASH_DUMP bool "Build a kdump crash kernel" - depends on PPC_MULTIPLATFORM && PPC64 + depends on PPC_MULTIPLATFORM && PPC64 && RELOCATABLE help Build a kernel suitable for use as a kdump capture kernel. - The kernel will be linked at a different address than normal, and - so can only be used for Kdump. - - Don't change this unless you know what you are doing. + The same kernel binary can be used as production kernel and dump + capture kernel. config PHYP_DUMP bool "Hypervisor-assisted dump (EXPERIMENTAL)" @@ -415,8 +414,11 @@ config FORCE_MAX_ZONEORDER int "Maximum zone order" + range 9 64 if PPC_64K_PAGES default "9" if PPC_64K_PAGES + range 13 64 if PPC64 && !PPC_64K_PAGES default "13" if PPC64 && !PPC_64K_PAGES + range 11 64 default "11" help The kernel memory allocator divides physically contiguous memory @@ -806,16 +808,27 @@ endmenu if PPC64 +config RELOCATABLE + bool "Build a relocatable kernel" + help + This builds a kernel image that is capable of running anywhere + in the RMA (real memory area) at any 16k-aligned base address. + The kernel is linked as a position-independent executable (PIE) + and contains dynamic relocations which are processed early + in the bootup process. + + One use is for the kexec on panic case where the recovery kernel + must live at a different physical address than the primary + kernel. + config PAGE_OFFSET hex default "0xc000000000000000" config KERNEL_START hex - default "0xc000000002000000" if CRASH_DUMP default "0xc000000000000000" config PHYSICAL_START hex - default "0x02000000" if CRASH_DUMP default "0x00000000" endif Index: Kconfig.debug =================================================================== RCS file: /cvsroot/gc-linux/linux/arch/powerpc/Kconfig.debug,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- Kconfig.debug 15 Nov 2008 20:10:14 -0000 1.4 +++ Kconfig.debug 1 Feb 2009 18:29:34 -0000 1.5 @@ -51,6 +51,11 @@ depends on DEBUG_KERNEL default n +config MSI_BITMAP_SELFTEST + bool "Run self-tests of the MSI bitmap code." + depends on DEBUG_KERNEL + default n + config XMON bool "Include xmon kernel debugger" depends on DEBUG_KERNEL |
From: Albert H. <he...@us...> - 2009-02-01 18:29:42
|
Update of /cvsroot/gc-linux/linux/sound/ppc In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv17186/sound/ppc Modified Files: Kconfig Makefile gcn-ai.c gcn-mic.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: gcn-mic.c =================================================================== RCS file: /cvsroot/gc-linux/linux/sound/ppc/gcn-mic.c,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- gcn-mic.c 13 Sep 2008 19:42:58 -0000 1.8 +++ gcn-mic.c 1 Feb 2009 18:29:35 -0000 1.9 @@ -2,8 +2,8 @@ * sound/ppc/gcn-mic.c * * Nintendo Microphone (DOL-022) driver - * Copyright (C) 2006-2008 The GameCube Linux Team - * Copyright (C) 2006,2007,2008 Albert Herranz + * Copyright (C) 2006-2009 The GameCube Linux Team + * Copyright (C) 2006,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 @@ -43,7 +43,7 @@ #ifdef MIC_DEBUG # define DBG(fmt, args...) \ - printk(KERN_ERR "%s: " fmt, __FUNCTION__ , ## args) + printk(KERN_ERR "%s: " fmt, __func__ , ## args) #else # define DBG(fmt, args...) #endif @@ -61,8 +61,8 @@ struct mic_device { - spinlock_t lock; - unsigned long flags; + spinlock_t lock; + unsigned long flags; u16 status; u16 control; @@ -76,8 +76,8 @@ #define MIC_CTL_PERIOD_128 (0x2<<13) #define MIC_CTL_START_SAMPLING (1<<15) - struct task_struct *io_thread; - wait_queue_head_t io_waitq; + struct task_struct *io_thread; + wait_queue_head_t io_waitq; atomic_t io_pending; struct snd_card *card; @@ -90,11 +90,11 @@ int running; #ifdef CONFIG_PROC_FS - struct proc_dir_entry *proc; + struct proc_dir_entry *proc; #endif /* CONFIG_PROC_FS */ - int refcnt; - struct exi_device *exi_device; + int refcnt; + struct exi_device *exi_device; }; @@ -106,9 +106,9 @@ struct exi_device *exi_device = dev->exi_device; u8 cmd = 0xff; - exi_dev_select(exi_device); - exi_dev_write(exi_device, &cmd, sizeof(cmd)); - exi_dev_deselect(exi_device); + exi_dev_select(exi_device); + exi_dev_write(exi_device, &cmd, sizeof(cmd)); + exi_dev_deselect(exi_device); } /* @@ -119,10 +119,10 @@ struct exi_device *exi_device = dev->exi_device; u8 cmd = 0x40; - exi_dev_select(exi_device); - exi_dev_write(exi_device, &cmd, sizeof(cmd)); - exi_dev_read(exi_device, &dev->status, sizeof(dev->status)); - exi_dev_deselect(exi_device); + exi_dev_select(exi_device); + exi_dev_write(exi_device, &cmd, sizeof(cmd)); + exi_dev_read(exi_device, &dev->status, sizeof(dev->status)); + exi_dev_deselect(exi_device); return dev->status; } @@ -141,9 +141,9 @@ DBG("control 0x80%02x%02x\n", cmd[1], cmd[2]); - exi_dev_select(exi_device); - exi_dev_write(exi_device, cmd, sizeof(cmd)); - exi_dev_deselect(exi_device); + exi_dev_select(exi_device); + exi_dev_write(exi_device, cmd, sizeof(cmd)); + exi_dev_deselect(exi_device); } @@ -155,12 +155,12 @@ struct exi_device *exi_device = dev->exi_device; u8 cmd = 0x20; - exi_dev_select(exi_device); - exi_dev_write(exi_device, &cmd, sizeof(cmd)); - exi_dev_read(exi_device, buf, len); - exi_dev_deselect(exi_device); + exi_dev_select(exi_device); + exi_dev_write(exi_device, &cmd, sizeof(cmd)); + exi_dev_read(exi_device, buf, len); + exi_dev_deselect(exi_device); -// DBG("mic cmd 0x20\n"); +/* DBG("mic cmd 0x20\n"); */ } /* @@ -181,19 +181,19 @@ { u16 control; - switch(rate) { - case 11025: - control = MIC_CTL_RATE_11025; - break; - case 22050: - control = MIC_CTL_RATE_22050; - break; - case 44100: - control = MIC_CTL_RATE_44100; - break; - default: - mic_printk(KERN_ERR, "unsupported rate: %d\n", rate); - return -EINVAL; + switch (rate) { + case 11025: + control = MIC_CTL_RATE_11025; + break; + case 22050: + control = MIC_CTL_RATE_22050; + break; + case 44100: + control = MIC_CTL_RATE_44100; + break; + default: + mic_printk(KERN_ERR, "unsupported rate: %d\n", rate); + return -EINVAL; } dev->control &= ~MIC_CTL_RATE_MASK; dev->control |= control; @@ -207,20 +207,20 @@ { u16 control; - switch(period_bytes) { - case 32: - control = MIC_CTL_PERIOD_32; - break; - case 64: - control = MIC_CTL_PERIOD_64; - break; - case 128: - control = MIC_CTL_PERIOD_128; - break; - default: - mic_printk(KERN_ERR, "unsupported period: %d bytes\n", - period_bytes); - return -EINVAL; + switch (period_bytes) { + case 32: + control = MIC_CTL_PERIOD_32; + break; + case 64: + control = MIC_CTL_PERIOD_64; + break; + case 128: + control = MIC_CTL_PERIOD_128; + break; + default: + mic_printk(KERN_ERR, "unsupported period: %d bytes\n", + period_bytes); + return -EINVAL; } dev->control &= ~MIC_CTL_PERIOD_MASK; dev->control |= control; @@ -237,7 +237,7 @@ */ static int mic_init_proc(struct mic_device *dev) { - return 0; + return 0; } /* @@ -259,24 +259,24 @@ static struct snd_pcm_hardware mic_snd_capture = { #if 0 - .info = (SNDRV_PCM_INFO_MMAP | - SNDRV_PCM_INFO_INTERLEAVED | SNDRV_PCM_INFO_NONINTERLEAVED | - SNDRV_PCM_INFO_BLOCK_TRANSFER | - SNDRV_PCM_INFO_MMAP_VALID), + .info = (SNDRV_PCM_INFO_MMAP | + SNDRV_PCM_INFO_INTERLEAVED | SNDRV_PCM_INFO_NONINTERLEAVED | + SNDRV_PCM_INFO_BLOCK_TRANSFER | + SNDRV_PCM_INFO_MMAP_VALID), #endif - .info = (SNDRV_PCM_INFO_INTERLEAVED | SNDRV_PCM_INFO_NONINTERLEAVED), - .formats = SNDRV_PCM_FMTBIT_S16_BE, - .rates = SNDRV_PCM_RATE_11025 | SNDRV_PCM_RATE_22050 | - SNDRV_PCM_RATE_44100, - .rate_min = 11025, - .rate_max = 44100, - .channels_min = 1, - .channels_max = 1, - .buffer_bytes_max = 32768, - .period_bytes_min = 32, - .period_bytes_max = 128, - .periods_min = 1, - .periods_max = 1024, + .info = (SNDRV_PCM_INFO_INTERLEAVED | SNDRV_PCM_INFO_NONINTERLEAVED), + .formats = SNDRV_PCM_FMTBIT_S16_BE, + .rates = SNDRV_PCM_RATE_11025 | SNDRV_PCM_RATE_22050 | + SNDRV_PCM_RATE_44100, + .rate_min = 11025, + .rate_max = 44100, + .channels_min = 1, + .channels_max = 1, + .buffer_bytes_max = 32768, + .period_bytes_min = 32, + .period_bytes_max = 128, + .periods_min = 1, + .periods_max = 1024, }; #if 0 @@ -315,16 +315,16 @@ */ static int mic_io_thread(void *param) { - struct mic_device *dev = param; + struct mic_device *dev = param; struct snd_pcm_substream *substream; int period_bytes; u16 status; - set_user_nice(current, -20); - set_current_state(TASK_RUNNING); + set_user_nice(current, -20); + set_current_state(TASK_RUNNING); - for(;;) { - wait_event(dev->io_waitq, atomic_read(&dev->io_pending) > 0); + for (;;) { + wait_event(dev->io_waitq, atomic_read(&dev->io_pending) > 0); atomic_dec(&dev->io_pending); if (kthread_should_stop()) @@ -340,7 +340,8 @@ if (!dev->c_left) { dev->c_cur = dev->c_orig; - dev->c_left = snd_pcm_lib_buffer_bytes(substream); + dev->c_left = + snd_pcm_lib_buffer_bytes(substream); } period_bytes = snd_pcm_lib_period_bytes(substream); @@ -355,19 +356,19 @@ exi_dev_take(dev->exi_device); if (status & 0x0200) { -DBG("0x0200\n"); + DBG("0x0200\n"); mic_hey(dev); mic_enable_sampling(dev, 1); mic_control(dev); } } else { - //mic_enable_sampling(dev, 0); + /* mic_enable_sampling(dev, 0); */ dev->control = 0; mic_control(dev); } exi_dev_give(dev->exi_device); - } - return 0; + } + return 0; } /* @@ -387,55 +388,55 @@ static int hw_rule_period_bytes_by_rate(struct snd_pcm_hw_params *params, struct snd_pcm_hw_rule *rule) { - struct snd_interval *period_bytes = + struct snd_interval *period_bytes = hw_param_interval(params, SNDRV_PCM_HW_PARAM_PERIOD_BYTES); - struct snd_interval *rate = + struct snd_interval *rate = hw_param_interval(params, SNDRV_PCM_HW_PARAM_RATE); -DBG("rate: min %d, max %d\n", rate->min, rate->max); + DBG("rate: min %d, max %d\n", rate->min, rate->max); if (rate->min == rate->max) { - if (rate->min >= 44100) { - struct snd_interval t = { - .min = 128, - .max = 128, - .integer = 1, - }; - return snd_interval_refine(period_bytes, &t); - } else if (rate->min >= 22050) { - struct snd_interval t = { - .min = 32, - .max = 32, - .integer = 1, - }; - return snd_interval_refine(period_bytes, &t); - } else { - struct snd_interval t = { - .min = 32, - .max = 32, - .integer = 1, - }; - return snd_interval_refine(period_bytes, &t); - } + if (rate->min >= 44100) { + struct snd_interval t = { + .min = 128, + .max = 128, + .integer = 1, + }; + return snd_interval_refine(period_bytes, &t); + } else if (rate->min >= 22050) { + struct snd_interval t = { + .min = 32, + .max = 32, + .integer = 1, + }; + return snd_interval_refine(period_bytes, &t); + } else { + struct snd_interval t = { + .min = 32, + .max = 32, + .integer = 1, + }; + return snd_interval_refine(period_bytes, &t); + } } return 0; } static int mic_snd_pcm_capture_open(struct snd_pcm_substream *substream) { - struct mic_device *dev = snd_pcm_substream_chip(substream); - struct snd_pcm_runtime *runtime = substream->runtime; + struct mic_device *dev = snd_pcm_substream_chip(substream); + struct snd_pcm_runtime *runtime = substream->runtime; unsigned long flags; int retval; -DBG("enter\n"); + DBG("enter\n"); spin_lock_irqsave(&dev->lock, flags); dev->running = 0; - dev->c_substream = substream; + dev->c_substream = substream; spin_unlock_irqrestore(&dev->lock, flags); - runtime->hw = mic_snd_capture; + runtime->hw = mic_snd_capture; #if 0 /* only 32, 64 and 128 */ @@ -450,24 +451,24 @@ hw_rule_period_bytes_by_rate, 0, SNDRV_PCM_HW_PARAM_RATE, -1); - /* align to 32 bytes */ + /* align to 32 bytes */ retval = snd_pcm_hw_constraint_step(runtime, 0, SNDRV_PCM_HW_PARAM_BUFFER_BYTES, 32); - return retval; + return retval; } static int mic_snd_pcm_capture_close(struct snd_pcm_substream *substream) { - struct mic_device *dev = snd_pcm_substream_chip(substream); + struct mic_device *dev = snd_pcm_substream_chip(substream); unsigned long flags; DBG("enter\n"); spin_lock_irqsave(&dev->lock, flags); dev->running = 0; - dev->c_substream = NULL; + dev->c_substream = NULL; spin_unlock_irqrestore(&dev->lock, flags); mic_wakeup_io_thread(dev); @@ -495,7 +496,7 @@ static int mic_snd_pcm_prepare(struct snd_pcm_substream *substream) { struct mic_device *dev = snd_pcm_substream_chip(substream); - struct snd_pcm_runtime *runtime = substream->runtime; + struct snd_pcm_runtime *runtime = substream->runtime; unsigned long flags; int retval; @@ -528,27 +529,28 @@ { struct mic_device *dev = snd_pcm_substream_chip(substream); - switch(cmd) { - case SNDRV_PCM_TRIGGER_START: - if (!dev->running) { -DBG("trigger start\n"); - dev->running = 1; - exi_dev_take(dev->exi_device); - mic_hey(dev); - mic_enable_sampling(dev, 1); - mic_control(dev); - exi_dev_give(dev->exi_device); - } - break; - case SNDRV_PCM_TRIGGER_STOP: -DBG("trigger stop\n"); - dev->running = 0; - break; + switch (cmd) { + case SNDRV_PCM_TRIGGER_START: + if (!dev->running) { + DBG("trigger start\n"); + dev->running = 1; + exi_dev_take(dev->exi_device); + mic_hey(dev); + mic_enable_sampling(dev, 1); + mic_control(dev); + exi_dev_give(dev->exi_device); + } + break; + case SNDRV_PCM_TRIGGER_STOP: + DBG("trigger stop\n"); + dev->running = 0; + break; } return 0; } -static snd_pcm_uframes_t mic_snd_pcm_pointer(struct snd_pcm_substream *substream) +static snd_pcm_uframes_t +mic_snd_pcm_pointer(struct snd_pcm_substream *substream) { struct mic_device *dev = snd_pcm_substream_chip(substream); size_t ptr; @@ -594,8 +596,8 @@ &mic_snd_pcm_capture_ops); snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_CONTINUOUS, - snd_dma_continuous_data - (GFP_KERNEL), + snd_dma_continuous_data + (GFP_KERNEL), 32*1024, 32*1024); return 0; } @@ -747,7 +749,7 @@ if (exi_device->eid.id != MIC_EXI_ID) return -ENODEV; - DBG("Microphone inserted\n"); + DBG("Microphone inserted\n"); dev = kzalloc(sizeof(*dev), GFP_KERNEL); if (!dev) @@ -774,7 +776,7 @@ { struct mic_device *dev = exi_get_drvdata(exi_device); - DBG("Microphone removed\n"); + DBG("Microphone removed\n"); if (dev) { mic_exit(dev); Index: Makefile =================================================================== RCS file: /cvsroot/gc-linux/linux/sound/ppc/Makefile,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- Makefile 24 Feb 2008 18:05:35 -0000 1.8 +++ Makefile 1 Feb 2009 18:29:35 -0000 1.9 @@ -11,4 +11,3 @@ obj-$(CONFIG_SND_PS3) += snd_ps3.o obj-$(CONFIG_SND_GAMECUBE) += snd-gcn.o obj-$(CONFIG_SND_GAMECUBE_MIC) += gcn-mic.o - Index: gcn-ai.c =================================================================== RCS file: /cvsroot/gc-linux/linux/sound/ppc/gcn-ai.c,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- gcn-ai.c 13 Sep 2008 19:42:58 -0000 1.13 +++ gcn-ai.c 1 Feb 2009 18:29:35 -0000 1.14 @@ -2,8 +2,8 @@ * sound/ppc/gcn-ai.c * * Nintendo GameCube/Wii Audio Interface (AI) driver - * 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 * * Based on work from mist, kirin, groepaz, Steve_-, isobel and others. * @@ -20,7 +20,7 @@ #include <linux/of_platform.h> #include <linux/interrupt.h> #include <linux/dma-mapping.h> -#include <asm/io.h> +#include <linux/io.h> #include <sound/core.h> #include <sound/pcm.h> #define SNDRV_GET_ID @@ -38,7 +38,7 @@ static char ai_driver_version[] = "1.0i"; #define drv_printk(level, format, arg...) \ - printk(level DRV_MODULE_NAME ": " format , ## arg) + printk(level DRV_MODULE_NAME ": " format , ## arg) /* @@ -87,13 +87,13 @@ struct snd_pcm_substream *playback_substream; struct snd_pcm_substream *capture_substream; - volatile int start_play; - volatile int stop_play; + int start_play; + int stop_play; dma_addr_t dma_addr; size_t period_size; int nperiods; - volatile int cur_period; + int cur_period; void __iomem *dsp_base; void __iomem *ai_base; @@ -175,7 +175,7 @@ static int index = SNDRV_DEFAULT_IDX1; /* index 0-MAX */ static char *id = SNDRV_DEFAULT_STR1; /* ID for this card */ -static struct snd_gcn *gcn_audio = NULL; +static struct snd_gcn *gcn_audio; static struct snd_pcm_hardware snd_gcn_playback = { .info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED | @@ -219,7 +219,7 @@ } static int snd_gcn_hw_params(struct snd_pcm_substream *substream, - struct snd_pcm_hw_params * hw_params) + struct snd_pcm_hw_params *hw_params) { return snd_pcm_lib_malloc_pages(substream, params_buffer_bytes(hw_params)); @@ -322,9 +322,9 @@ /* load next sample if we are not stopping */ if (!chip->stop_play) { - if (chip->cur_period < (chip->nperiods - 1)) { + if (chip->cur_period < (chip->nperiods - 1)) chip->cur_period++; - } else + else chip->cur_period = 0; addr = chip->playback_substream->runtime->dma_area @@ -349,7 +349,7 @@ csr &= ~(AI_CSR_PIINT | AI_CSR_ARINT | AI_CSR_DSPINT); out_be16(chip->dsp_base + AI_DSP_CSR, csr); local_irq_restore(flags); - + return IRQ_HANDLED; } @@ -365,7 +365,7 @@ .pointer = snd_gcn_pointer, }; -static int __devinit snd_gcn_new_pcm(struct snd_gcn * chip) +static int __devinit snd_gcn_new_pcm(struct snd_gcn *chip) { struct snd_pcm *pcm; int retval; @@ -586,7 +586,7 @@ static void __exit ai_exit_module(void) { - of_unregister_platform_driver(&ai_of_driver); + of_unregister_platform_driver(&ai_of_driver); } module_init(ai_init_module); Index: Kconfig =================================================================== RCS file: /cvsroot/gc-linux/linux/sound/ppc/Kconfig,v retrieving revision 1.16 retrieving revision 1.17 diff -u -d -r1.16 -r1.17 --- Kconfig 15 Nov 2008 20:10:15 -0000 1.16 +++ Kconfig 1 Feb 2009 18:29:35 -0000 1.17 @@ -53,7 +53,7 @@ depends on SND && GAMECUBE_COMMON help Say Y here to include support for audio on the Nintendo GameCube/Wii. - + To compile this driver as a module, choose M here: the module will be called snd-gcn. @@ -63,7 +63,7 @@ help If you say yes to this option, support will be included for the Nintendo GameCube Microphone (DOL-022). - + If in doubt, say N here. endif # SND_PPC |
From: Albert H. <he...@us...> - 2009-02-01 18:29:42
|
Update of /cvsroot/gc-linux/linux/drivers/misc In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv17186/drivers/misc Modified Files: Kconfig Makefile gcn-gqr.c gcn-mi.c gcn-mi.h 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: gcn-gqr.c =================================================================== RCS file: /cvsroot/gc-linux/linux/drivers/misc/gcn-gqr.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- gcn-gqr.c 24 Feb 2008 18:05:32 -0000 1.3 +++ gcn-gqr.c 1 Feb 2009 18:29:35 -0000 1.4 @@ -2,9 +2,9 @@ * drivers/misc/gcn-gqr.c * * Nintendo GameCube GQR driver - * Copyright (C) 2004-2008 The GameCube Linux Team + * Copyright (C) 2004-2009 The GameCube Linux Team * Copyright (C) 2004 Todd Jeffreys <to...@vo...> - * Copyright (C) 2007,2008 Albert Herranz + * 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 @@ -20,10 +20,10 @@ #include <linux/ctype.h> #include <linux/sysctl.h> #include <linux/types.h> -#include <asm/uaccess.h> +#include <linux/uaccess.h> static u32 gqr_values[8]; -static struct ctl_table_header *gqr_table_header = NULL; +static struct ctl_table_header *gqr_table_header; #define SPR_GQR0 912 #define SPR_GQR1 913 @@ -34,14 +34,14 @@ #define SPR_GQR6 918 #define SPR_GQR7 919 -#define MFSPR_CASE(i) case (i): *((u32*)table->data) = mfspr(SPR_GQR##i) -#define MTSPR_CASE(i) case (i): mtspr(SPR_GQR##i,*((u32*)table->data)) +#define MFSPR_CASE(i) case (i): (*((u32 *)table->data) = mfspr(SPR_GQR##i)) +#define MTSPR_CASE(i) case (i): mtspr(SPR_GQR##i, *((u32 *)table->data)) -static int proc_dogqr(ctl_table *table,int write,struct file *file, - void __user *buffer,size_t *lenp,loff_t *ppos) +static int proc_dogqr(ctl_table *table, int write, struct file *file, + void __user *buffer, size_t *lenp, loff_t *ppos) { int r; - + if (!write) { /* if they are reading, update the variable */ switch (table->data - (void *)gqr_values) { MFSPR_CASE(0); break; @@ -56,9 +56,9 @@ return -EFAULT; /* shouldn't happen */ } } - - r = proc_dointvec(table,write,file,buffer,lenp,ppos); - + + r = proc_dointvec(table, write, file, buffer, lenp, ppos); + if ((r == 0) && write) { /* if they are writing, update the reg */ switch (table->data - (void *)gqr_values) { MTSPR_CASE(0); break; @@ -73,7 +73,7 @@ return -EFAULT; /* shouldn't happen */ } } - + return r; } @@ -103,14 +103,15 @@ .ctl_name = CTL_UNNUMBERED, .procname = "gqr", .mode = 0555, - .child = gqr_members + .child = gqr_members, }, { .ctl_name = 0 } }; int __init gcngqr_init(void) { - if (!(gqr_table_header = register_sysctl_table(gqr_table))) { + gqr_table_header = register_sysctl_table(gqr_table); + if (!gqr_table_header) { printk(KERN_ERR "Unable to register GQR sysctl table\n"); return -ENOMEM; } Index: Kconfig =================================================================== RCS file: /cvsroot/gc-linux/linux/drivers/misc/Kconfig,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- Kconfig 15 Nov 2008 20:10:14 -0000 1.13 +++ Kconfig 1 Feb 2009 18:29:35 -0000 1.14 @@ -15,7 +15,7 @@ config ATMEL_PWM tristate "Atmel AT32/AT91 PWM support" - depends on AVR32 || ARCH_AT91 + depends on AVR32 || ARCH_AT91SAM9263 || ARCH_AT91SAM9RL || ARCH_AT91CAP9 help This option enables device driver support for the PWM channels on certain Atmel prcoessors. Pulse Width Modulation is used for @@ -58,23 +58,23 @@ config GAMECUBE_GQR tristate "Nintendo GameCube/Wii Graphic Quantization Registers (GQR)" depends on GAMECUBE_COMMON - ---help--- + help This option enables device driver support for the Gekko/Broadway - processor's Graphic Quantization Registers. - These registers are used with the psql and psqst instrutions. + processors' Graphic Quantization Registers. + These registers are used with the psql and psqst instructions. The registers will appear in /proc/sys/gqr. config GAMECUBE_MI tristate "Nintendo GameCube Memory Interface (MI)" - depends on GAMECUBE && BROKEN + depends on GAMECUBE help If you say yes to this option, support will be included for the Memory Interface (MI) of the Nintendo GameCube. - + The MI allows one to setup up to four protected memory regions, catching invalid accesses to them. The MI catches out of bounds memory accesses too. - + If in doubt, say N here. config IBM_ASM @@ -167,6 +167,7 @@ depends on NEW_LEDS depends on BACKLIGHT_CLASS_DEVICE depends on SERIO_I8042 + depends on RFKILL select ACPI_WMI ---help--- This is a driver for newer Acer (and Wistron) laptops. It adds @@ -248,10 +249,20 @@ To compile this driver as a module, choose M here: the module will be called hp-wmi. +config ICS932S401 + tristate "Integrated Circuits ICS932S401" + depends on I2C && EXPERIMENTAL + help + If you say yes here you get support for the Integrated Circuits + ICS932S401 clock control chips. + + This driver can also be built as a module. If so, the module + will be called ics932s401. + config MSI_LAPTOP tristate "MSI Laptop Extras" depends on X86 - depends on ACPI_EC + depends on ACPI depends on BACKLIGHT_CLASS_DEVICE ---help--- This is a driver for laptops built by MSI (MICRO-STAR @@ -267,10 +278,21 @@ If you have an MSI S270 laptop, say Y or M here. +config PANASONIC_LAPTOP + tristate "Panasonic Laptop Extras" + depends on X86 && INPUT && ACPI + depends on BACKLIGHT_CLASS_DEVICE + ---help--- + This driver adds support for access to backlight control and hotkeys + on Panasonic Let's Note laptops. + + If you have a Panasonic Let's note laptop (such as the R1(N variant), + R2, R3, R5, T2, W2 and Y2 series), say Y. + config COMPAL_LAPTOP tristate "Compal Laptop Extras" depends on X86 - depends on ACPI_EC + depends on ACPI depends on BACKLIGHT_CLASS_DEVICE ---help--- This is a driver for laptops built by Compal: @@ -431,6 +453,7 @@ depends on BACKLIGHT_CLASS_DEVICE depends on HWMON depends on EXPERIMENTAL + depends on RFKILL ---help--- This driver supports the Fn-Fx keys on Eee PC laptops. It also adds the ability to switch camera/wlan on/off. @@ -497,4 +520,6 @@ This option enables addition debugging code for the SGI GRU driver. If you are unsure, say N. +source "drivers/misc/c2port/Kconfig" + endif # MISC_DEVICES Index: Makefile =================================================================== RCS file: /cvsroot/gc-linux/linux/drivers/misc/Makefile,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- Makefile 15 Nov 2008 20:10:14 -0000 1.9 +++ Makefile 1 Feb 2009 18:29:35 -0000 1.10 @@ -14,6 +14,7 @@ obj-$(CONFIG_ATMEL_SSC) += atmel-ssc.o obj-$(CONFIG_ATMEL_TCLIB) += atmel_tclib.o obj-$(CONFIG_HP_WMI) += hp-wmi.o +obj-$(CONFIG_ICS932S401) += ics932s401.o obj-$(CONFIG_TC1100_WMI) += tc1100-wmi.o obj-$(CONFIG_LKDTM) += lkdtm.o obj-$(CONFIG_TIFM_CORE) += tifm_core.o @@ -23,6 +24,7 @@ obj-$(CONFIG_SONY_LAPTOP) += sony-laptop.o obj-$(CONFIG_THINKPAD_ACPI) += thinkpad_acpi.o obj-$(CONFIG_FUJITSU_LAPTOP) += fujitsu-laptop.o +obj-$(CONFIG_PANASONIC_LAPTOP) += panasonic-laptop.o obj-$(CONFIG_EEPROM_93CX6) += eeprom_93cx6.o obj-$(CONFIG_INTEL_MENLOW) += intel_menlow.o obj-$(CONFIG_ENCLOSURE_SERVICES) += enclosure.o @@ -30,6 +32,6 @@ obj-$(CONFIG_SGI_XP) += sgi-xp/ obj-$(CONFIG_SGI_GRU) += sgi-gru/ obj-$(CONFIG_HP_ILO) += hpilo.o +obj-$(CONFIG_C2PORT) += c2port/ obj-$(CONFIG_GAMECUBE_GQR) += gcn-gqr.o obj-$(CONFIG_GAMECUBE_MI) += gcn-mi.o - Index: gcn-mi.h =================================================================== RCS file: /cvsroot/gc-linux/linux/drivers/misc/gcn-mi.h,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- gcn-mi.h 15 Nov 2008 20:10:14 -0000 1.3 +++ gcn-mi.h 1 Feb 2009 18:29:35 -0000 1.4 @@ -2,8 +2,8 @@ * drivers/misc/gcn-mi.h * * Nintendo GameCube Memory Interface driver - * Copyright (C) 2004-2008 The GameCube Linux Team - * Copyright (C) 2004,2005,2008 Albert Herranz + * Copyright (C) 2004-2009 The GameCube Linux Team + * 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 Index: gcn-mi.c =================================================================== RCS file: /cvsroot/gc-linux/linux/drivers/misc/gcn-mi.c,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- gcn-mi.c 26 Mar 2008 20:15:20 -0000 1.8 +++ gcn-mi.c 1 Feb 2009 18:29:35 -0000 1.9 @@ -2,8 +2,8 @@ * drivers/misc/gcn-mi.c * * Nintendo GameCube Memory Interface (MI) driver. - * Copyright (C) 2004-2008 The GameCube Linux Team - * Copyright (C) 2004,2005,2007,2008 Albert Herranz + * Copyright (C) 2004-2009 The GameCube Linux Team + * Copyright (C) 2004,2005,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 @@ -21,14 +21,9 @@ #include <linux/interrupt.h> #include <linux/spinlock.h> #include <linux/proc_fs.h> -#include <asm/io.h> +#include <linux/io.h> #include "gcn-mi.h" -#ifdef CONFIG_PPC_MERGE -#include <platforms/embedded6xx/gamecube.h> -#else -#include <platforms/gamecube.h> -#endif #define MI_IRQ 7 @@ -63,7 +58,7 @@ unsigned long faults[MI_MAX_REGIONS+1]; unsigned long last_address; unsigned long last_address_faults; - spinlock_t lock; + spinlock_t lock; #ifdef CONFIG_PROC_FS struct proc_dir_entry *proc_file; #endif @@ -74,35 +69,12 @@ #define DRV_MODULE_NAME "gcn-mi" #define DRV_DESCRIPTION "Nintendo GameCube Memory Interface driver" #define DRV_AUTHOR "Albert Herranz" - + #define PFX DRV_MODULE_NAME ": " #define mi_printk(level, format, arg...) \ printk(level PFX format , ## arg) - -/** - * - */ -static int mi_setup_default_regions(void) -{ - int retval = 0; - -#ifndef MODULE -#ifdef CONFIG_KEXEC - retval = gcn_mi_region_protect(GCN_PRESERVE_TO, GCN_PRESERVE_TO + - PAGE_ALIGN(GCN_PRESERVE_SIZE), MI_PROT_RO); - if (retval < 0) { - mi_printk(KERN_ERR, "unable to protect" - " kexec reserved memory\n"); - } -#endif /* CONFIG_KEXEC */ - -#endif /* MODULE */ - - return retval; -} - -/** +/* * */ static irqreturn_t mi_handler(int this_irq, void *data) @@ -120,9 +92,9 @@ cause = in_be16(MI_ICR); /* a fault was detected in some of the registered regions */ - if ( (cause & 0xf) != 0) { + if ((cause & 0xf) != 0) { for (region = 0; region < MI_MAX_REGIONS; region++) { - if ( (cause & (1 << region)) != 0 ) { + if ((cause & (1 << region)) != 0) { priv->faults[region]++; mi_printk(KERN_INFO, "bad access on region #%d" " at 0x%lx\n", region, address); @@ -131,7 +103,7 @@ } /* a fault was detected out of any registered region */ - if ( (cause & (1 << 4)) != 0 ) { + if ((cause & (1 << 4)) != 0) { priv->faults[MI_MAX_REGIONS]++; if (address == priv->last_address) { priv->last_address_faults++; @@ -158,7 +130,7 @@ } #ifdef CONFIG_PROC_FS -/** +/* * */ static int mi_proc_read(char *page, char **start, @@ -171,7 +143,7 @@ len = sprintf(page, "# <region> <faults>\n"); for (region = 0; region < MI_MAX_REGIONS; region++) { - if ( (priv->regions_bitmap & (1<<region)) != 0 ) { + if ((priv->regions_bitmap & (1<<region)) != 0) { len += sprintf(page+len, "%d\t%lu\n", region, priv->faults[region]); } @@ -184,7 +156,7 @@ #endif /* CONFIG_PROC_FS */ -/** +/* * */ static int mi_setup_irq(struct mi_private *priv) @@ -192,16 +164,15 @@ int retval; retval = request_irq(priv->irq, mi_handler, 0, DRV_MODULE_NAME, priv); - if (retval) { + if (retval) mi_printk(KERN_ERR, "request of irq%d failed\n", priv->irq); - } else { + else out_be16(MI_IMR, (1<<4)); /* do not mask all MI interrupts */ - } return retval; } -/** +/* * */ static int mi_probe(struct device *device, struct resource *mem, int irq) @@ -243,7 +214,6 @@ #endif /* CONFIG_PROC_FS */ mi_private = priv; - mi_setup_default_regions(); return 0; @@ -254,7 +224,7 @@ return retval; } -/** +/* * */ static void mi_shutdown(struct mi_private *priv) @@ -262,7 +232,7 @@ gcn_mi_region_unprotect_all(); } -/** +/* * */ static void mi_remove(struct mi_private *priv) @@ -281,7 +251,7 @@ mi_private = NULL; } -/** +/* * */ static int __init mi_drv_probe(struct device *device) @@ -294,13 +264,13 @@ mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); if (!mem) return -ENODEV; - - mi_printk(KERN_INFO, "%s\n", DRV_DESCRIPTION); + + mi_printk(KERN_INFO, "%s\n", DRV_DESCRIPTION); return mi_probe(device, mem, irq); } -/** +/* * */ static int mi_drv_remove(struct device *device) @@ -315,7 +285,7 @@ return 0; } -/** +/* * */ static void mi_drv_shutdown(struct device *device) @@ -337,7 +307,7 @@ static struct resource mi_resources[] = { [0] = { .start = MI_BASE, - .end = MI_BASE + MI_SIZE -1, + .end = MI_BASE + MI_SIZE - 1, .flags = IORESOURCE_MEM, }, [1] = { @@ -354,7 +324,7 @@ .resource = mi_resources, }; -/** +/* * */ static int __init mi_init(void) @@ -362,14 +332,13 @@ int retval = 0; retval = driver_register(&mi_device_driver); - if (!retval) { + if (!retval) retval = platform_device_register(&mi_device); - } return retval; } -/** +/* * */ static void __exit mi_exit(void) @@ -382,9 +351,9 @@ module_exit(mi_exit); -/* Exported symbols */ +/* public interface */ -/** +/* * */ int gcn_mi_region_protect(unsigned long physlo, unsigned long physhi, int type) @@ -399,16 +368,14 @@ if (type < MI_PROT_NONE || type > MI_PROT_RW) return -EINVAL; - if ( (physlo & ~MI_PAGE_MASK) != 0 || (physhi & ~MI_PAGE_MASK) != 0 ) { + if ((physlo & ~MI_PAGE_MASK) != 0 || (physhi & ~MI_PAGE_MASK) != 0) return -EINVAL; - } free_regions = MI_MAX_REGIONS - priv->nr_regions; - if (free_regions <= 0) { + if (free_regions <= 0) return -ENOMEM; - } for (region = 0; region < MI_MAX_REGIONS; region++) { - if ( (priv->regions_bitmap & (1<<region)) == 0 ) + if ((priv->regions_bitmap & (1<<region)) == 0) break; } if (region >= MI_MAX_REGIONS) @@ -432,7 +399,7 @@ return region; } -/** +/* * */ int gcn_mi_region_unprotect(int region) @@ -444,12 +411,13 @@ if (region < 0 || region > MI_MAX_REGIONS) return -EINVAL; - + out_be16(MI_IMR, in_be16(MI_IMR) & ~(1 << region)); out_be32(MI_PROT_REGION0 + 4*region, 0); - out_be16(MI_PROT_TYPE, in_be16(MI_PROT_TYPE) | (MI_PROT_RW << 2*region)); + out_be16(MI_PROT_TYPE, + in_be16(MI_PROT_TYPE) | (MI_PROT_RW << 2*region)); - if ( (priv->regions_bitmap & (1<<region)) != 0 ) + if ((priv->regions_bitmap & (1<<region)) != 0) mi_printk(KERN_INFO, "region #%d unprotected\n", region); priv->regions_bitmap &= ~(1 << region); @@ -458,7 +426,7 @@ return 0; } -/** +/* * */ void gcn_mi_region_unprotect_all(void) @@ -466,12 +434,10 @@ int region; out_be16(MI_IMR, 0); - for (region = 0; region < MI_MAX_REGIONS; region++) { + for (region = 0; region < MI_MAX_REGIONS; region++) gcn_mi_region_unprotect(region); - } } MODULE_DESCRIPTION(DRV_DESCRIPTION); MODULE_AUTHOR(DRV_AUTHOR); MODULE_LICENSE("GPL"); - |
From: Albert H. <he...@us...> - 2009-02-01 18:29:42
|
Update of /cvsroot/gc-linux/linux/drivers/video/logo In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv17186/drivers/video/logo Modified Files: logo_gcn_clut224.ppm 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: logo_gcn_clut224.ppm =================================================================== RCS file: /cvsroot/gc-linux/linux/drivers/video/logo/logo_gcn_clut224.ppm,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- logo_gcn_clut224.ppm 20 Oct 2004 22:44:24 -0000 1.1 +++ logo_gcn_clut224.ppm 1 Feb 2009 18:29:35 -0000 1.2 @@ -1,19204 +1,1123 @@ P3 -# CREATOR: The GIMP's PNM Filter Version 1.0 80 80 255 -2 -2 -2 -2 -2 -2 -2 [...20293 lines suppressed...] +2 2 2 6 6 6 14 14 14 26 26 26 38 38 38 50 50 50 +54 54 55 58 58 58 54 54 55 42 42 42 30 30 30 18 18 17 +10 10 10 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 +2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 +2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 +2 2 2 2 2 2 +2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 +2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 +2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 +2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 6 6 6 +6 6 6 10 10 10 14 14 14 18 18 17 18 18 17 14 14 14 +10 10 10 6 6 6 2 2 2 2 2 2 2 2 2 2 2 2 +2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 +2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 +2 2 2 2 2 2 2 2 2 6 6 6 14 14 14 18 18 17 +22 22 22 22 22 22 18 18 17 14 14 14 10 10 10 6 6 6 +2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 +2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 +2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 +2 2 2 2 2 2 |
From: Albert H. <he...@us...> - 2009-02-01 18:29:41
|
Update of /cvsroot/gc-linux/linux/arch/powerpc/kernel In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv17186/arch/powerpc/kernel Modified Files: cputable.c head_32.S udbg.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: udbg.c =================================================================== RCS file: /cvsroot/gc-linux/linux/arch/powerpc/kernel/udbg.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- udbg.c 14 Sep 2008 19:20:27 -0000 1.3 +++ udbg.c 1 Feb 2009 18:29:35 -0000 1.4 @@ -60,7 +60,7 @@ #elif defined(CONFIG_PPC_EARLY_DEBUG_CPM) udbg_init_cpm(); #elif defined(CONFIG_PPC_EARLY_DEBUG_USBGECKO) - udbg_init_debug_usbgecko(); + udbg_init_usbgecko(); #endif #ifdef CONFIG_PPC_EARLY_DEBUG Index: head_32.S =================================================================== RCS file: /cvsroot/gc-linux/linux/arch/powerpc/kernel/head_32.S,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- head_32.S 15 Nov 2008 20:10:14 -0000 1.5 +++ head_32.S 1 Feb 2009 18:29:35 -0000 1.6 @@ -110,6 +110,12 @@ #ifdef CONFIG_PPC_MULTIPLATFORM cmpwi 0,r5,0 beq 1f + + /* find out where we are now */ + bcl 20,31,$+4 +0: mflr r8 /* r8 = runtime addr here */ + addis r8,r8,(_stext - 0b)@ha + addi r8,r8,(_stext - 0b)@l /* current runtime base addr */ bl prom_init trap #endif @@ -372,13 +378,13 @@ DataAccess: EXCEPTION_PROLOG mfspr r10,SPRN_DSISR + stw r10,_DSISR(r11) andis. r0,r10,0xa470 /* weird error? */ bne 1f /* if not, try to put a PTE */ mfspr r4,SPRN_DAR /* into the hash table */ rlwinm r3,r10,32-15,21,21 /* DSISR_STORE -> _PAGE_RW */ bl hash_page -1: stw r10,_DSISR(r11) - mr r5,r10 +1: lwz r5,_DSISR(r11) /* get DSISR value */ mfspr r4,SPRN_DAR EXC_XFER_EE_LITE(0x300, handle_page_fault) Index: cputable.c =================================================================== RCS file: /cvsroot/gc-linux/linux/arch/powerpc/kernel/cputable.c,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- cputable.c 25 Nov 2008 19:09:31 -0000 1.5 +++ cputable.c 1 Feb 2009 18:29:35 -0000 1.6 @@ -39,6 +39,7 @@ extern void __setup_cpu_440gx(unsigned long offset, struct cpu_spec* spec); extern void __setup_cpu_440grx(unsigned long offset, struct cpu_spec* spec); extern void __setup_cpu_440spe(unsigned long offset, struct cpu_spec* spec); +extern void __setup_cpu_440x5(unsigned long offset, struct cpu_spec* spec); extern void __setup_cpu_460ex(unsigned long offset, struct cpu_spec* spec); extern void __setup_cpu_460gt(unsigned long offset, struct cpu_spec* spec); extern void __setup_cpu_603(unsigned long offset, struct cpu_spec* spec); @@ -610,6 +611,7 @@ .icache_bsize = 32, .dcache_bsize = 32, .num_pmcs = 4, + .pmc_type = PPC_PMC_IBM, .cpu_setup = __setup_cpu_750cx, .machine_check = machine_check_generic, .platform = "ppc750", @@ -623,6 +625,7 @@ .icache_bsize = 32, .dcache_bsize = 32, .num_pmcs = 4, + .pmc_type = PPC_PMC_IBM, .cpu_setup = __setup_cpu_750cx, .machine_check = machine_check_generic, .platform = "ppc750", @@ -636,6 +639,7 @@ .icache_bsize = 32, .dcache_bsize = 32, .num_pmcs = 4, + .pmc_type = PPC_PMC_IBM, .cpu_setup = __setup_cpu_750cx, .machine_check = machine_check_generic, .platform = "ppc750", @@ -649,12 +653,13 @@ .icache_bsize = 32, .dcache_bsize = 32, .num_pmcs = 4, + .pmc_type = PPC_PMC_IBM, .cpu_setup = __setup_cpu_750, .machine_check = machine_check_generic, .platform = "ppc750", }, { /* 750CL (and "Broadway") */ - .pvr_mask = 0xfffff000, + .pvr_mask = 0xfffff0e0, .pvr_value = 0x00087000, .cpu_name = "750CL", .cpu_features = CPU_FTRS_750CL, @@ -662,6 +667,7 @@ .icache_bsize = 32, .dcache_bsize = 32, .num_pmcs = 4, + .pmc_type = PPC_PMC_IBM, .cpu_setup = __setup_cpu_750, .machine_check = machine_check_generic, .platform = "ppc750", @@ -675,6 +681,7 @@ .icache_bsize = 32, .dcache_bsize = 32, .num_pmcs = 4, + .pmc_type = PPC_PMC_IBM, .cpu_setup = __setup_cpu_750, .machine_check = machine_check_generic, .platform = "ppc750", @@ -688,6 +695,7 @@ .icache_bsize = 32, .dcache_bsize = 32, .num_pmcs = 4, + .pmc_type = PPC_PMC_IBM, .cpu_setup = __setup_cpu_750, .machine_check = machine_check_generic, .platform = "ppc750", @@ -701,6 +709,7 @@ .icache_bsize = 32, .dcache_bsize = 32, .num_pmcs = 4, + .pmc_type = PPC_PMC_IBM, .cpu_setup = __setup_cpu_750fx, .machine_check = machine_check_generic, .platform = "ppc750", @@ -714,6 +723,7 @@ .icache_bsize = 32, .dcache_bsize = 32, .num_pmcs = 4, + .pmc_type = PPC_PMC_IBM, .cpu_setup = __setup_cpu_750fx, .machine_check = machine_check_generic, .platform = "ppc750", @@ -727,6 +737,7 @@ .icache_bsize = 32, .dcache_bsize = 32, .num_pmcs = 4, + .pmc_type = PPC_PMC_IBM, .cpu_setup = __setup_cpu_750, .machine_check = machine_check_generic, .platform = "ppc750", @@ -741,6 +752,7 @@ .icache_bsize = 32, .dcache_bsize = 32, .num_pmcs = 4, + .pmc_type = PPC_PMC_G4, .cpu_setup = __setup_cpu_7400, .machine_check = machine_check_generic, .platform = "ppc7400", @@ -755,6 +767,7 @@ .icache_bsize = 32, .dcache_bsize = 32, .num_pmcs = 4, + .pmc_type = PPC_PMC_G4, .cpu_setup = __setup_cpu_7400, .machine_check = machine_check_generic, .platform = "ppc7400", @@ -769,6 +782,7 @@ .icache_bsize = 32, .dcache_bsize = 32, .num_pmcs = 4, + .pmc_type = PPC_PMC_G4, .cpu_setup = __setup_cpu_7410, .machine_check = machine_check_generic, .platform = "ppc7400", @@ -783,6 +797,7 @@ .icache_bsize = 32, .dcache_bsize = 32, .num_pmcs = 6, + .pmc_type = PPC_PMC_G4, .cpu_setup = __setup_cpu_745x, .oprofile_cpu_type = "ppc/7450", .oprofile_type = PPC_OPROFILE_G4, @@ -799,6 +814,7 @@ .icache_bsize = 32, .dcache_bsize = 32, .num_pmcs = 6, + .pmc_type = PPC_PMC_G4, .cpu_setup = __setup_cpu_745x, .oprofile_cpu_type = "ppc/7450", .oprofile_type = PPC_OPROFILE_G4, @@ -815,6 +831,7 @@ .icache_bsize = 32, .dcache_bsize = 32, .num_pmcs = 6, + .pmc_type = PPC_PMC_G4, .cpu_setup = __setup_cpu_745x, .oprofile_cpu_type = "ppc/7450", .oprofile_type = PPC_OPROFILE_G4, @@ -831,6 +848,7 @@ .icache_bsize = 32, .dcache_bsize = 32, .num_pmcs = 6, + .pmc_type = PPC_PMC_G4, .cpu_setup = __setup_cpu_745x, .oprofile_cpu_type = "ppc/7450", .oprofile_type = PPC_OPROFILE_G4, @@ -847,6 +865,7 @@ .icache_bsize = 32, .dcache_bsize = 32, .num_pmcs = 6, + .pmc_type = PPC_PMC_G4, .cpu_setup = __setup_cpu_745x, .oprofile_cpu_type = "ppc/7450", .oprofile_type = PPC_OPROFILE_G4, @@ -863,6 +882,7 @@ .icache_bsize = 32, .dcache_bsize = 32, .num_pmcs = 6, + .pmc_type = PPC_PMC_G4, .cpu_setup = __setup_cpu_745x, .oprofile_cpu_type = "ppc/7450", .oprofile_type = PPC_OPROFILE_G4, @@ -879,6 +899,7 @@ .icache_bsize = 32, .dcache_bsize = 32, .num_pmcs = 6, + .pmc_type = PPC_PMC_G4, .cpu_setup = __setup_cpu_745x, .oprofile_cpu_type = "ppc/7450", .oprofile_type = PPC_OPROFILE_G4, @@ -895,6 +916,7 @@ .icache_bsize = 32, .dcache_bsize = 32, .num_pmcs = 6, + .pmc_type = PPC_PMC_G4, .cpu_setup = __setup_cpu_745x, .oprofile_cpu_type = "ppc/7450", .oprofile_type = PPC_OPROFILE_G4, @@ -910,6 +932,7 @@ .icache_bsize = 32, .dcache_bsize = 32, .num_pmcs = 6, + .pmc_type = PPC_PMC_G4, .cpu_setup = __setup_cpu_745x, .oprofile_cpu_type = "ppc/7450", .oprofile_type = PPC_OPROFILE_G4, @@ -926,6 +949,7 @@ .icache_bsize = 32, .dcache_bsize = 32, .num_pmcs = 6, + .pmc_type = PPC_PMC_G4, .cpu_setup = __setup_cpu_745x, .oprofile_cpu_type = "ppc/7450", .oprofile_type = PPC_OPROFILE_G4, @@ -942,6 +966,7 @@ .icache_bsize = 32, .dcache_bsize = 32, .num_pmcs = 6, + .pmc_type = PPC_PMC_G4, .cpu_setup = __setup_cpu_745x, .oprofile_cpu_type = "ppc/7450", .oprofile_type = PPC_OPROFILE_G4, @@ -1253,6 +1278,19 @@ .machine_check = machine_check_4xx, .platform = "ppc405", }, + { + /* 405EZ */ + .pvr_mask = 0xffff0000, + .pvr_value = 0x41510000, + .cpu_name = "405EZ", + .cpu_features = CPU_FTRS_40X, + .cpu_user_features = PPC_FEATURE_32 | + PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC, + .icache_bsize = 32, + .dcache_bsize = 32, + .machine_check = machine_check_4xx, + .platform = "ppc405", + }, { /* default match */ .pvr_mask = 0x00000000, .pvr_value = 0x00000000, @@ -1463,6 +1501,8 @@ .cpu_user_features = COMMON_USER_BOOKE, .icache_bsize = 32, .dcache_bsize = 32, + .cpu_setup = __setup_cpu_440x5, + .machine_check = machine_check_440A, .platform = "ppc440", }, { /* 460EX */ |
From: Albert H. <he...@us...> - 2009-02-01 18:29:40
|
Update of /cvsroot/gc-linux/linux/fs In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv17186/fs Modified Files: Kconfig Makefile 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: Makefile =================================================================== RCS file: /cvsroot/gc-linux/linux/fs/Makefile,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- Makefile 15 Nov 2008 20:10:15 -0000 1.11 +++ Makefile 1 Feb 2009 18:29:35 -0000 1.12 @@ -7,8 +7,8 @@ obj-y := open.o read_write.o file_table.o super.o \ char_dev.o stat.o exec.o pipe.o namei.o fcntl.o \ - ioctl.o readdir.o select.o fifo.o locks.o dcache.o inode.o \ - attr.o bad_inode.o file.o filesystems.o namespace.o aio.o \ + ioctl.o readdir.o select.o fifo.o dcache.o inode.o \ + attr.o bad_inode.o file.o filesystems.o namespace.o \ seq_file.o xattr.o libfs.o fs-writeback.o \ pnode.o drop_caches.o splice.o sync.o utimes.o \ stack.o @@ -27,6 +27,8 @@ obj-$(CONFIG_SIGNALFD) += signalfd.o obj-$(CONFIG_TIMERFD) += timerfd.o obj-$(CONFIG_EVENTFD) += eventfd.o +obj-$(CONFIG_AIO) += aio.o +obj-$(CONFIG_FILE_LOCKING) += locks.o obj-$(CONFIG_COMPAT) += compat.o compat_ioctl.o nfsd-$(CONFIG_NFSD) := nfsctl.o @@ -69,7 +71,7 @@ # Do not add any filesystems before this line obj-$(CONFIG_REISERFS_FS) += reiserfs/ obj-$(CONFIG_EXT3_FS) += ext3/ # Before ext2 so root fs can be ext3 -obj-$(CONFIG_EXT4DEV_FS) += ext4/ # Before ext2 so root fs can be ext4dev +obj-$(CONFIG_EXT4_FS) += ext4/ # Before ext2 so root fs can be ext4 obj-$(CONFIG_JBD) += jbd/ obj-$(CONFIG_JBD2) += jbd2/ obj-$(CONFIG_EXT2_FS) += ext2/ @@ -79,8 +81,6 @@ obj-$(CONFIG_CODA_FS) += coda/ obj-$(CONFIG_MINIX_FS) += minix/ obj-$(CONFIG_FAT_FS) += fat/ -obj-$(CONFIG_MSDOS_FS) += msdos/ -obj-$(CONFIG_VFAT_FS) += vfat/ obj-$(CONFIG_BFS_FS) += bfs/ obj-$(CONFIG_ISO9660_FS) += isofs/ obj-$(CONFIG_GCDVD_FS) += gcdvdfs/ Index: Kconfig =================================================================== RCS file: /cvsroot/gc-linux/linux/fs/Kconfig,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- Kconfig 15 Nov 2008 20:10:15 -0000 1.13 +++ Kconfig 1 Feb 2009 18:29:35 -0000 1.14 @@ -6,61 +6,9 @@ if BLOCK -config EXT2_FS - tristate "Second extended fs support" - help - Ext2 is a standard Linux file system for hard disks. - - To compile this file system support as a module, choose M here: the - module will be called ext2. - - If unsure, say Y. - -config EXT2_FS_XATTR - bool "Ext2 extended attributes" - depends on EXT2_FS - help - Extended attributes are name:value pairs associated with inodes by - the kernel or by users (see the attr(5) manual page, or visit - <http://acl.bestbits.at/> for details). - - If unsure, say N. - -config EXT2_FS_POSIX_ACL - bool "Ext2 POSIX Access Control Lists" - depends on EXT2_FS_XATTR - select FS_POSIX_ACL - help - Posix Access Control Lists (ACLs) support permissions for users and - groups beyond the owner/group/world scheme. - - To learn more about Access Control Lists, visit the Posix ACLs for - Linux website <http://acl.bestbits.at/>. - - If you don't know what Access Control Lists are, say N - -config EXT2_FS_SECURITY - bool "Ext2 Security Labels" - depends on EXT2_FS_XATTR - help - Security labels support alternative access control models - implemented by security modules like SELinux. This option - enables an extended attribute handler for file security - labels in the ext2 filesystem. - - If you are not using a security module that requires using - extended attributes for file security labels, say N. - -config EXT2_FS_XIP - bool "Ext2 execute in place support" - depends on EXT2_FS && MMU - help - Execute in place can be used on memory-backed block devices. If you - enable this option, you can select to mount block devices which are - capable of this feature without using the page cache. - - If you do not use a block device that is capable of using this, - or if unsure, say N. +source "fs/ext2/Kconfig" +source "fs/ext3/Kconfig" +source "fs/ext4/Kconfig" config FS_XIP # execute in place @@ -68,211 +16,16 @@ depends on EXT2_FS_XIP default y -config EXT3_FS - tristate "Ext3 journalling file system support" - select JBD - help - This is the journalling version of the Second extended file system - (often called ext3), the de facto standard Linux file system - (method to organize files on a storage device) for hard disks. - - The journalling code included in this driver means you do not have - to run e2fsck (file system checker) on your file systems after a - crash. The journal keeps track of any changes that were being made - at the time the system crashed, and can ensure that your file system - is consistent without the need for a lengthy check. - - Other than adding the journal to the file system, the on-disk format - of ext3 is identical to ext2. It is possible to freely switch - between using the ext3 driver and the ext2 driver, as long as the - file system has been cleanly unmounted, or e2fsck is run on the file - system. - - To add a journal on an existing ext2 file system or change the - behavior of ext3 file systems, you can use the tune2fs utility ("man - tune2fs"). To modify attributes of files and directories on ext3 - file systems, use chattr ("man chattr"). You need to be using - e2fsprogs version 1.20 or later in order to create ext3 journals - (available at <http://sourceforge.net/projects/e2fsprogs/>). - - To compile this file system support as a module, choose M here: the - module will be called ext3. - -config EXT3_FS_XATTR - bool "Ext3 extended attributes" - depends on EXT3_FS - default y - help - Extended attributes are name:value pairs associated with inodes by - the kernel or by users (see the attr(5) manual page, or visit - <http://acl.bestbits.at/> for details). - - If unsure, say N. - - You need this for POSIX ACL support on ext3. - -config EXT3_FS_POSIX_ACL - bool "Ext3 POSIX Access Control Lists" - depends on EXT3_FS_XATTR - select FS_POSIX_ACL - help - Posix Access Control Lists (ACLs) support permissions for users and - groups beyond the owner/group/world scheme. - - To learn more about Access Control Lists, visit the Posix ACLs for - Linux website <http://acl.bestbits.at/>. - - If you don't know what Access Control Lists are, say N - -config EXT3_FS_SECURITY - bool "Ext3 Security Labels" - depends on EXT3_FS_XATTR - help - Security labels support alternative access control models - implemented by security modules like SELinux. This option - enables an extended attribute handler for file security - labels in the ext3 filesystem. - - If you are not using a security module that requires using - extended attributes for file security labels, say N. - -config EXT4DEV_FS - tristate "Ext4dev/ext4 extended fs support development (EXPERIMENTAL)" - depends on EXPERIMENTAL - select JBD2 - select CRC16 - help - Ext4dev is a predecessor filesystem of the next generation - extended fs ext4, based on ext3 filesystem code. It will be - renamed ext4 fs later, once ext4dev is mature and stabilized. - - Unlike the change from ext2 filesystem to ext3 filesystem, - the on-disk format of ext4dev is not the same as ext3 any more: - it is based on extent maps and it supports 48-bit physical block - numbers. These combined on-disk format changes will allow - ext4dev/ext4 to handle more than 16 TB filesystem volumes -- - a hard limit that ext3 cannot overcome without changing the - on-disk format. - - Other than extent maps and 48-bit block numbers, ext4dev also is - likely to have other new features such as persistent preallocation, - high resolution time stamps, and larger file support etc. These - features will be added to ext4dev gradually. - - To compile this file system support as a module, choose M here. The - module will be called ext4dev. - - If unsure, say N. - -config EXT4DEV_FS_XATTR - bool "Ext4dev extended attributes" - depends on EXT4DEV_FS - default y - help - Extended attributes are name:value pairs associated with inodes by - the kernel or by users (see the attr(5) manual page, or visit - <http://acl.bestbits.at/> for details). - - If unsure, say N. - - You need this for POSIX ACL support on ext4dev/ext4. - -config EXT4DEV_FS_POSIX_ACL - bool "Ext4dev POSIX Access Control Lists" - depends on EXT4DEV_FS_XATTR - select FS_POSIX_ACL - help - POSIX Access Control Lists (ACLs) support permissions for users and - groups beyond the owner/group/world scheme. - - To learn more about Access Control Lists, visit the POSIX ACLs for - Linux website <http://acl.bestbits.at/>. - - If you don't know what Access Control Lists are, say N - -config EXT4DEV_FS_SECURITY - bool "Ext4dev Security Labels" - depends on EXT4DEV_FS_XATTR - help - Security labels support alternative access control models - implemented by security modules like SELinux. This option - enables an extended attribute handler for file security - labels in the ext4dev/ext4 filesystem. - - If you are not using a security module that requires using - extended attributes for file security labels, say N. - -config JBD - tristate - help - This is a generic journalling layer for block devices. It is - currently used by the ext3 and OCFS2 file systems, but it could - also be used to add journal support to other file systems or block - devices such as RAID or LVM. - - If you are using the ext3 or OCFS2 file systems, you need to - say Y here. If you are not using ext3 OCFS2 then you will probably - want to say N. - - To compile this device as a module, choose M here: the module will be - called jbd. If you are compiling ext3 or OCFS2 into the kernel, - you cannot compile this code as a module. - -config JBD_DEBUG - bool "JBD (ext3) debugging support" - depends on JBD && DEBUG_FS - help - If you are using the ext3 journaled file system (or potentially any - other file system/device using JBD), this option allows you to - enable debugging output while the system is running, in order to - help track down any problems you are having. By default the - debugging output will be turned off. - - If you select Y here, then you will be able to turn on debugging - with "echo N > /sys/kernel/debug/jbd/jbd-debug", where N is a - number between 1 and 5, the higher the number, the more debugging - output is generated. To turn debugging off again, do - "echo 0 > /sys/kernel/debug/jbd/jbd-debug". - -config JBD2 - tristate - select CRC32 - help - This is a generic journaling layer for block devices that support - both 32-bit and 64-bit block numbers. It is currently used by - the ext4dev/ext4 filesystem, but it could also be used to add - journal support to other file systems or block devices such - as RAID or LVM. - - If you are using ext4dev/ext4, you need to say Y here. If you are not - using ext4dev/ext4 then you will probably want to say N. - - To compile this device as a module, choose M here. The module will be - called jbd2. If you are compiling ext4dev/ext4 into the kernel, - you cannot compile this code as a module. - -config JBD2_DEBUG - bool "JBD2 (ext4dev/ext4) debugging support" - depends on JBD2 && DEBUG_FS - help - If you are using the ext4dev/ext4 journaled file system (or - potentially any other filesystem/device using JBD2), this option - allows you to enable debugging output while the system is running, - in order to help track down any problems you are having. - By default, the debugging output will be turned off. - - If you select Y here, then you will be able to turn on debugging - with "echo N > /sys/kernel/debug/jbd2/jbd2-debug", where N is a - number between 1 and 5. The higher the number, the more debugging - output is generated. To turn debugging off again, do - "echo 0 > /sys/kernel/debug/jbd2/jbd2-debug". +source "fs/jbd/Kconfig" +source "fs/jbd2/Kconfig" config FS_MBCACHE # Meta block cache for Extended Attributes (ext2/ext3/ext4) tristate - depends on EXT2_FS_XATTR || EXT3_FS_XATTR || EXT4DEV_FS_XATTR - default y if EXT2_FS=y || EXT3_FS=y || EXT4DEV_FS=y - default m if EXT2_FS=m || EXT3_FS=m || EXT4DEV_FS=m + default y if EXT2_FS=y && EXT2_FS_XATTR + default y if EXT3_FS=y && EXT3_FS_XATTR + default y if EXT4_FS=y && EXT4_FS_XATTR + default m if EXT2_FS_XATTR || EXT3_FS_XATTR || EXT4_FS_XATTR config REISERFS_FS tristate "Reiserfs support" @@ -419,6 +172,14 @@ bool default n +config FILE_LOCKING + bool "Enable POSIX file locking API" if EMBEDDED + default y + help + This option enables standard file locking support, required + for filesystems like NFS and for the flock() system + call. Disabling this option saves about 11k. + source "fs/xfs/Kconfig" source "fs/gfs2/Kconfig" @@ -426,7 +187,7 @@ tristate "OCFS2 file system support" depends on NET && SYSFS select CONFIGFS_FS - select JBD + select JBD2 select CRC32 help OCFS2 is a general purpose extent based shared disk cluster file @@ -497,6 +258,16 @@ this option for debugging only as it is likely to decrease performance of the filesystem. +config OCFS2_COMPAT_JBD + bool "Use JBD for compatibility" + depends on OCFS2_FS + default n + select JBD + help + The ocfs2 filesystem now uses JBD2 for its journalling. JBD2 + is backwards compatible with JBD. It is safe to say N here. + However, if you really want to use the original JBD, say Y here. + endif # BLOCK config DNOTIFY @@ -633,7 +404,7 @@ N here. config FUSE_FS - tristate "Filesystem in Userspace support" + tristate "FUSE (Filesystem in Userspace) support" help With FUSE it is possible to implement a fully functional filesystem in a userspace program. @@ -716,6 +487,7 @@ config GCDVD_FS tristate "GCDVD file system support" + depends on BROKEN help This is the filesystem used on commercial Gamecube games. Say Y if you intend to mount GC DVD discs. @@ -1147,195 +919,7 @@ To compile the EFS file system support as a module, choose M here: the module will be called efs. -config JFFS2_FS - tristate "Journalling Flash File System v2 (JFFS2) support" - select CRC32 - depends on MTD - help - JFFS2 is the second generation of the Journalling Flash File System - for use on diskless embedded devices. It provides improved wear - levelling, compression and support for hard links. You cannot use - this on normal block devices, only on 'MTD' devices. - - Further information on the design and implementation of JFFS2 is - available at <http://sources.redhat.com/jffs2/>. - -config JFFS2_FS_DEBUG - int "JFFS2 debugging verbosity (0 = quiet, 2 = noisy)" - depends on JFFS2_FS - default "0" - help - This controls the amount of debugging messages produced by the JFFS2 - code. Set it to zero for use in production systems. For evaluation, - testing and debugging, it's advisable to set it to one. This will - enable a few assertions and will print debugging messages at the - KERN_DEBUG loglevel, where they won't normally be visible. Level 2 - is unlikely to be useful - it enables extra debugging in certain - areas which at one point needed debugging, but when the bugs were - located and fixed, the detailed messages were relegated to level 2. - - If reporting bugs, please try to have available a full dump of the - messages at debug level 1 while the misbehaviour was occurring. - -config JFFS2_FS_WRITEBUFFER - bool "JFFS2 write-buffering support" - depends on JFFS2_FS - default y - help - This enables the write-buffering support in JFFS2. - - This functionality is required to support JFFS2 on the following - types of flash devices: - - NAND flash - - NOR flash with transparent ECC - - DataFlash - -config JFFS2_FS_WBUF_VERIFY - bool "Verify JFFS2 write-buffer reads" - depends on JFFS2_FS_WRITEBUFFER - default n - help - This causes JFFS2 to read back every page written through the - write-buffer, and check for errors. - -config JFFS2_SUMMARY - bool "JFFS2 summary support (EXPERIMENTAL)" - depends on JFFS2_FS && EXPERIMENTAL - default n - help - This feature makes it possible to use summary information - for faster filesystem mount. - - The summary information can be inserted into a filesystem image - by the utility 'sumtool'. - - If unsure, say 'N'. - -config JFFS2_FS_XATTR - bool "JFFS2 XATTR support (EXPERIMENTAL)" - depends on JFFS2_FS && EXPERIMENTAL - default n - help - Extended attributes are name:value pairs associated with inodes by - the kernel or by users (see the attr(5) manual page, or visit - <http://acl.bestbits.at/> for details). - - If unsure, say N. - -config JFFS2_FS_POSIX_ACL - bool "JFFS2 POSIX Access Control Lists" - depends on JFFS2_FS_XATTR - default y - select FS_POSIX_ACL - help - Posix Access Control Lists (ACLs) support permissions for users and - groups beyond the owner/group/world scheme. - - To learn more about Access Control Lists, visit the Posix ACLs for - Linux website <http://acl.bestbits.at/>. - - If you don't know what Access Control Lists are, say N - -config JFFS2_FS_SECURITY - bool "JFFS2 Security Labels" - depends on JFFS2_FS_XATTR - default y - help - Security labels support alternative access control models - implemented by security modules like SELinux. This option - enables an extended attribute handler for file security - labels in the jffs2 filesystem. - - If you are not using a security module that requires using - extended attributes for file security labels, say N. - -config JFFS2_COMPRESSION_OPTIONS - bool "Advanced compression options for JFFS2" - depends on JFFS2_FS - default n - help - Enabling this option allows you to explicitly choose which - compression modules, if any, are enabled in JFFS2. Removing - compressors can mean you cannot read existing file systems, - and enabling experimental compressors can mean that you - write a file system which cannot be read by a standard kernel. - - If unsure, you should _definitely_ say 'N'. - -config JFFS2_ZLIB - bool "JFFS2 ZLIB compression support" if JFFS2_COMPRESSION_OPTIONS - select ZLIB_INFLATE - select ZLIB_DEFLATE - depends on JFFS2_FS - default y - help - Zlib is designed to be a free, general-purpose, legally unencumbered, - lossless data-compression library for use on virtually any computer - hardware and operating system. See <http://www.gzip.org/zlib/> for - further information. - - Say 'Y' if unsure. - -config JFFS2_LZO - bool "JFFS2 LZO compression support" if JFFS2_COMPRESSION_OPTIONS - select LZO_COMPRESS - select LZO_DECOMPRESS - depends on JFFS2_FS - default n - help - minilzo-based compression. Generally works better than Zlib. - - This feature was added in July, 2007. Say 'N' if you need - compatibility with older bootloaders or kernels. - -config JFFS2_RTIME - bool "JFFS2 RTIME compression support" if JFFS2_COMPRESSION_OPTIONS - depends on JFFS2_FS - default y - help - Rtime does manage to recompress already-compressed data. Say 'Y' if unsure. - -config JFFS2_RUBIN - bool "JFFS2 RUBIN compression support" if JFFS2_COMPRESSION_OPTIONS - depends on JFFS2_FS - default n - help - RUBINMIPS and DYNRUBIN compressors. Say 'N' if unsure. - -choice - prompt "JFFS2 default compression mode" if JFFS2_COMPRESSION_OPTIONS - default JFFS2_CMODE_PRIORITY - depends on JFFS2_FS - help - You can set here the default compression mode of JFFS2 from - the available compression modes. Don't touch if unsure. - -config JFFS2_CMODE_NONE - bool "no compression" - help - Uses no compression. - -config JFFS2_CMODE_PRIORITY - bool "priority" - help - Tries the compressors in a predefined order and chooses the first - successful one. - -config JFFS2_CMODE_SIZE - bool "size (EXPERIMENTAL)" - help - Tries all compressors and chooses the one which has the smallest - result. - -config JFFS2_CMODE_FAVOURLZO - bool "Favour LZO" - help - Tries all compressors and chooses the one which has the smallest - result but gives some preference to LZO (which has faster - decompression) at the expense of size. - -endchoice - +source "fs/jffs2/Kconfig" # UBIFS File system configuration source "fs/ubifs/Kconfig" @@ -1776,6 +1360,28 @@ If unsure, say N. +config SUNRPC_REGISTER_V4 + bool "Register local RPC services via rpcbind v4 (EXPERIMENTAL)" + depends on SUNRPC && EXPERIMENTAL + default n + help + Sun added support for registering RPC services at an IPv6 + address by creating two new versions of the rpcbind protocol + (RFC 1833). + + This option enables support in the kernel RPC server for + registering kernel RPC services via version 4 of the rpcbind + protocol. If you enable this option, you must run a portmapper + daemon that supports rpcbind protocol version 4. + + Serving NFS over IPv6 from knfsd (the kernel's NFS server) + requires that you enable this option and use a portmapper that + supports rpcbind version 4. + + If unsure, say N to get traditional behavior (register kernel + RPC services using only rpcbind version 2). Distributions + using the legacy Linux portmapper daemon must say N here. + config RPCSEC_GSS_KRB5 tristate "Secure RPC: Kerberos V mechanism (EXPERIMENTAL)" depends on SUNRPC && EXPERIMENTAL @@ -1870,148 +1476,7 @@ smbmount from samba 2.2.0 or later supports this. -config CIFS - tristate "CIFS support (advanced network filesystem, SMBFS successor)" - depends on INET - select NLS - help - This is the client VFS module for the Common Internet File System - (CIFS) protocol which is the successor to the Server Message Block - (SMB) protocol, the native file sharing mechanism for most early - PC operating systems. The CIFS protocol is fully supported by - file servers such as Windows 2000 (including Windows 2003, NT 4 - and Windows XP) as well by Samba (which provides excellent CIFS - server support for Linux and many other operating systems). Limited - support for OS/2 and Windows ME and similar servers is provided as - well. - - The cifs module provides an advanced network file system - client for mounting to CIFS compliant servers. It includes - support for DFS (hierarchical name space), secure per-user - session establishment via Kerberos or NTLM or NTLMv2, - safe distributed caching (oplock), optional packet - signing, Unicode and other internationalization improvements. - If you need to mount to Samba or Windows from this machine, say Y. - -config CIFS_STATS - bool "CIFS statistics" - depends on CIFS - help - Enabling this option will cause statistics for each server share - mounted by the cifs client to be displayed in /proc/fs/cifs/Stats - -config CIFS_STATS2 - bool "Extended statistics" - depends on CIFS_STATS - help - Enabling this option will allow more detailed statistics on SMB - request timing to be displayed in /proc/fs/cifs/DebugData and also - allow optional logging of slow responses to dmesg (depending on the - value of /proc/fs/cifs/cifsFYI, see fs/cifs/README for more details). - These additional statistics may have a minor effect on performance - and memory utilization. - - Unless you are a developer or are doing network performance analysis - or tuning, say N. - -config CIFS_WEAK_PW_HASH - bool "Support legacy servers which use weaker LANMAN security" - depends on CIFS - help - Modern CIFS servers including Samba and most Windows versions - (since 1997) support stronger NTLM (and even NTLMv2 and Kerberos) - security mechanisms. These hash the password more securely - than the mechanisms used in the older LANMAN version of the - SMB protocol but LANMAN based authentication is needed to - establish sessions with some old SMB servers. - - Enabling this option allows the cifs module to mount to older - LANMAN based servers such as OS/2 and Windows 95, but such - mounts may be less secure than mounts using NTLM or more recent - security mechanisms if you are on a public network. Unless you - have a need to access old SMB servers (and are on a private - network) you probably want to say N. Even if this support - is enabled in the kernel build, LANMAN authentication will not be - used automatically. At runtime LANMAN mounts are disabled but - can be set to required (or optional) either in - /proc/fs/cifs (see fs/cifs/README for more detail) or via an - option on the mount command. This support is disabled by - default in order to reduce the possibility of a downgrade - attack. - - If unsure, say N. - -config CIFS_UPCALL - bool "Kerberos/SPNEGO advanced session setup" - depends on CIFS && KEYS - help - Enables an upcall mechanism for CIFS which accesses - userspace helper utilities to provide SPNEGO packaged (RFC 4178) - Kerberos tickets which are needed to mount to certain secure servers - (for which more secure Kerberos authentication is required). If - unsure, say N. - -config CIFS_XATTR - bool "CIFS extended attributes" - depends on CIFS - help - Extended attributes are name:value pairs associated with inodes by - the kernel or by users (see the attr(5) manual page, or visit - <http://acl.bestbits.at/> for details). CIFS maps the name of - extended attributes beginning with the user namespace prefix - to SMB/CIFS EAs. EAs are stored on Windows servers without the - user namespace prefix, but their names are seen by Linux cifs clients - prefaced by the user namespace prefix. The system namespace - (used by some filesystems to store ACLs) is not supported at - this time. - - If unsure, say N. - -config CIFS_POSIX - bool "CIFS POSIX Extensions" - depends on CIFS_XATTR - help - Enabling this option will cause the cifs client to attempt to - negotiate a newer dialect with servers, such as Samba 3.0.5 - or later, that optionally can handle more POSIX like (rather - than Windows like) file behavior. It also enables - support for POSIX ACLs (getfacl and setfacl) to servers - (such as Samba 3.10 and later) which can negotiate - CIFS POSIX ACL support. If unsure, say N. - -config CIFS_DEBUG2 - bool "Enable additional CIFS debugging routines" - depends on CIFS - help - Enabling this option adds a few more debugging routines - to the cifs code which slightly increases the size of - the cifs module and can cause additional logging of debug - messages in some error paths, slowing performance. This - option can be turned off unless you are debugging - cifs problems. If unsure, say N. - -config CIFS_EXPERIMENTAL - bool "CIFS Experimental Features (EXPERIMENTAL)" - depends on CIFS && EXPERIMENTAL - help - Enables cifs features under testing. These features are - experimental and currently include DFS support and directory - change notification ie fcntl(F_DNOTIFY), as well as the upcall - mechanism which will be used for Kerberos session negotiation - and uid remapping. Some of these features also may depend on - setting a value of 1 to the pseudo-file /proc/fs/cifs/Experimental - (which is disabled by default). See the file fs/cifs/README - for more details. If unsure, say N. - -config CIFS_DFS_UPCALL - bool "DFS feature support (EXPERIMENTAL)" - depends on CIFS_EXPERIMENTAL - depends on KEYS - help - Enables an upcall mechanism for CIFS which contacts userspace - helper utilities to provide server name resolution (host names to - IP addresses) which is needed for implicit mounts of DFS junction - points. If unsure, say N. +source "fs/cifs/Kconfig" config NCP_FS tristate "NCP file system support (to mount NetWare volumes)" |
From: Albert H. <he...@us...> - 2009-02-01 18:29:40
|
Update of /cvsroot/gc-linux/linux/drivers/exi In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv17186/drivers/exi Modified Files: exi-driver.c exi-hw.c exi-hw.h 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: exi-driver.c =================================================================== RCS file: /cvsroot/gc-linux/linux/drivers/exi/exi-driver.c,v retrieving revision 1.17 retrieving revision 1.18 diff -u -d -r1.17 -r1.18 --- exi-driver.c 2 Jul 2008 20:42:39 -0000 1.17 +++ exi-driver.c 1 Feb 2009 18:29:35 -0000 1.18 @@ -2,10 +2,10 @@ * drivers/exi/exi-driver.c * * Nintendo GameCube EXternal Interface (EXI) driver model routines. - * Copyright (C) 2004-2008 The GameCube Linux Team + * Copyright (C) 2004-2009 The GameCube Linux Team * Copyright (C) 2004 Arthur Othieno <a.o...@bl...> * Copyright (C) 2004,2005 Todd Jeffreys <to...@vo...> - * Copyright (C) 2005,2006,2007,2008 Albert Herranz + * Copyright (C) 2005,2006,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 @@ -97,7 +97,7 @@ { struct exi_map_id_to_name *map = exi_map_id_to_name; - while(map->id) { + while (map->id) { if (map->id == id) return map->name; map++; @@ -212,9 +212,9 @@ */ struct exi_device *exi_device_get(struct exi_device *exi_device) { - if (exi_device) - get_device(&exi_device->dev); - return exi_device; + if (exi_device) + get_device(&exi_device->dev); + return exi_device; } EXPORT_SYMBOL(exi_device_get); @@ -226,8 +226,8 @@ */ void exi_device_put(struct exi_device *exi_device) { - if (exi_device) - put_device(&exi_device->dev); + if (exi_device) + put_device(&exi_device->dev); } EXPORT_SYMBOL(exi_device_put); @@ -239,7 +239,7 @@ struct exi_device *exi_get_exi_device(struct exi_channel *exi_channel, int device) { - // FIXME, maybe exi_device_get it too + /* REVISIT, take a ref here? */ return &exi_devices[to_channel(exi_channel)][device]; } EXPORT_SYMBOL(exi_get_exi_device); @@ -263,9 +263,8 @@ if (exi_driver->probe) retval = exi_driver->probe(exi_device); } - if (retval >= 0) { + if (retval >= 0) retval = 0; - } out: return retval; @@ -324,6 +323,7 @@ static void exi_device_rescan(struct exi_device *exi_device) { unsigned int id; + int error; /* now ID the device */ id = exi_get_id(exi_device); @@ -345,8 +345,12 @@ exi_device->dev.bus_id, id, exi_name_id(id)); exi_device->eid.id = id; - device_register(&exi_device->dev); - drv_printk(KERN_INFO, "add completed\n"); + error = device_register(&exi_device->dev); + if (error) { + drv_printk(KERN_INFO, "add failed (%d)\n", error); + exi_device->eid.id = EXI_ID_INVALID; + } else + drv_printk(KERN_INFO, "add completed\n"); } exi_update_ext_status(exi_get_exi_channel(exi_device)); @@ -397,13 +401,13 @@ unsigned int channel; int is_loaded, was_loaded; - while(!kthread_should_stop()) { + while (!kthread_should_stop()) { /* scan the memcard slot channels for device changes */ for (channel = 0; channel <= 1; ++channel) { exi_channel = to_exi_channel(channel); is_loaded = exi_get_ext_line(exi_channel); - was_loaded = (exi_channel->flags & EXI_EXT)?1:0; + was_loaded = (exi_channel->flags & EXI_EXT) ? 1 : 0; if (is_loaded ^ was_loaded) { exi_device = &exi_devices[channel][0]; @@ -417,10 +421,6 @@ return 0; } - -extern void exi_channel_init(struct exi_channel *exi_channel, - unsigned int channel); - /* * */ @@ -431,12 +431,9 @@ unsigned int channel, device; int retval; - extern unsigned long exi_running; - if (!test_and_set_bit(1, &exi_running)) { - retval = exi_hw_init(DRV_MODULE_NAME, mem, irq); - if (retval) - goto err_hw_init; - } + retval = exi_hw_init(DRV_MODULE_NAME, mem, irq); + if (retval) + goto err_hw_init; /* initialize devices */ for (channel = 0; channel < EXI_MAX_CHANNELS; ++channel) { @@ -465,17 +462,15 @@ /* setup a thread to manage plugable devices */ init_waitqueue_head(&exi_bus_waitq); exi_bus_task = kthread_run(exi_bus_thread, NULL, "kexid"); - if (IS_ERR(exi_bus_task)) { + if (IS_ERR(exi_bus_task)) drv_printk(KERN_WARNING, "failed to start exi kernel thread\n"); - } return 0; err_bus_register: err_device_register: - while(--channel > 0) { + while (--channel > 0) device_unregister(&exi_bus_devices[channel]); - } exi_hw_exit(mem, irq); err_hw_init: return retval; @@ -490,7 +485,7 @@ struct resource res; int retval; - drv_printk(KERN_INFO, "%s - version %s\n", DRV_DESCRIPTION, + drv_printk(KERN_INFO, "%s - version %s\n", DRV_DESCRIPTION, exi_driver_version); np = of_find_compatible_node(NULL, NULL, "nintendo,flipper-exi"); Index: exi-hw.h =================================================================== RCS file: /cvsroot/gc-linux/linux/drivers/exi/exi-hw.h,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- exi-hw.h 26 Mar 2008 20:15:11 -0000 1.11 +++ exi-hw.h 1 Feb 2009 18:29:35 -0000 1.12 @@ -2,9 +2,9 @@ * drivers/exi/exi-hw.h * * Nintendo GameCube EXpansion Interface support. Hardware routines. - * Copyright (C) 2004-2008 The GameCube Linux Team + * Copyright (C) 2004-2009 The GameCube Linux Team * Copyright (C) 2004,2005 Todd Jeffreys <to...@vo...> - * Copyright (C) 2005,2006,2007,2008 Albert Herranz + * Copyright (C) 2005,2006,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 @@ -140,9 +140,9 @@ * Declare simple transfer functions for single bytes, words and dwords, * and build a general transfer function based on that. */ -#define __declare__exi_transfer_raw(_type,_val,_data,_on_write,_on_read) \ +#define __declare__exi_transfer_raw(_type, _val, _data, _on_write, _on_read) \ static inline void __exi_transfer_raw_##_type(struct exi_channel *exi_channel,\ - _type *_data, int mode) \ + _type * _data, int mode) \ { \ u32 __iomem *csr_reg = exi_channel->io_base + EXI_CSR; \ u32 __iomem *data_reg = exi_channel->io_base + EXI_DATA; \ @@ -164,7 +164,7 @@ out_be32(cr_reg, _val); \ \ /* wait for transfer completion */ \ - while(in_be32(cr_reg) & EXI_CR_TSTART) \ + while (in_be32(cr_reg) & EXI_CR_TSTART) \ cpu_relax(); \ \ /* XXX check if we need that on immediate mode */ \ @@ -190,4 +190,6 @@ __declare__exi_transfer_raw_simple(u16) __declare__exi_transfer_raw_simple(u32) +extern wait_queue_head_t exi_bus_waitq; + #endif /* __EXI_HW_H */ Index: exi-hw.c =================================================================== RCS file: /cvsroot/gc-linux/linux/drivers/exi/exi-hw.c,v retrieving revision 1.18 retrieving revision 1.19 diff -u -d -r1.18 -r1.19 --- exi-hw.c 26 Mar 2008 20:15:11 -0000 1.18 +++ exi-hw.c 1 Feb 2009 18:29:35 -0000 1.19 @@ -2,9 +2,9 @@ * drivers/exi/exi-hw.c * * Nintendo GameCube EXpansion Interface support. Hardware routines. - * Copyright (C) 2004-2008 The GameCube Linux Team + * Copyright (C) 2004-2009 The GameCube Linux Team * Copyright (C) 2004,2005 Todd Jeffreys <to...@vo...> - * Copyright (C) 2005,2006,2007,2008 Albert Herranz + * Copyright (C) 2005,2006,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 @@ -43,28 +43,29 @@ * softirq context from the EXI event handlers. * * "take" operations in user context will sleep if necessary until the - * channel is "given". + * channel is "given". * * * 2. Transfers - * + * * The EXI Layer provides a transfer API to perform read and write * operations. * By default, transfers partially or totally suitable for DMA will be - * partially or totally processed through DMA. The EXI Layer takes care of + * partially or totally processed through DMA. The EXI Layer takes care of * splitting a transfer in several pieces so the best transfer method is * used each time. * * (1) A immediate mode transfer is atomic, but a DMA transfer is not. */ -//#define EXI_DEBUG 1 +/*#define EXI_DEBUG 1*/ #include <linux/types.h> #include <linux/dma-mapping.h> #include <linux/wait.h> #include <linux/delay.h> -#include <asm/io.h> +#include <linux/io.h> +#include <linux/spinlock.h> #include <linux/exi.h> #include "exi-hw.h" @@ -75,20 +76,15 @@ #ifdef EXI_DEBUG # define DBG(fmt, args...) \ - printk(KERN_ERR "%s: " fmt, __FUNCTION__ , ## args) + printk(KERN_ERR "%s: " fmt, __func__ , ## args) #else # define DBG(fmt, args...) #endif -extern wait_queue_head_t exi_bus_waitq; - static void exi_tasklet(unsigned long param); -/* for compatibility with the old exi-lite framework */ -unsigned long exi_running = 0; - /* io memory base for EXI */ static void __iomem *exi_io_mem; @@ -99,22 +95,22 @@ static struct exi_channel exi_channels[EXI_MAX_CHANNELS] = { [0] = { .channel = 0, - .lock = SPIN_LOCK_UNLOCKED, - .io_lock = SPIN_LOCK_UNLOCKED, + .lock = __SPIN_LOCK_UNLOCKED(exi_channels[0].lock), + .io_lock = __SPIN_LOCK_UNLOCKED(exi_channels[0].io_lock), .wait_queue = __WAIT_QUEUE_HEAD_INITIALIZER( exi_channels[0].wait_queue), }, [1] = { .channel = 1, - .lock = SPIN_LOCK_UNLOCKED, - .io_lock = SPIN_LOCK_UNLOCKED, + .lock = __SPIN_LOCK_UNLOCKED(exi_channels[1].lock), + .io_lock = __SPIN_LOCK_UNLOCKED(exi_channels[1].io_lock), .wait_queue = __WAIT_QUEUE_HEAD_INITIALIZER( exi_channels[1].wait_queue), }, [2] = { .channel = 2, - .lock = SPIN_LOCK_UNLOCKED, - .io_lock = SPIN_LOCK_UNLOCKED, + .lock = __SPIN_LOCK_UNLOCKED(exi_channels[2].lock), + .io_lock = __SPIN_LOCK_UNLOCKED(exi_channels[2].io_lock), .wait_queue = __WAIT_QUEUE_HEAD_INITIALIZER( exi_channels[2].wait_queue), }, @@ -122,7 +118,7 @@ /* handy iterator for exi channels */ #define exi_channel_for_each(pos) \ - for(pos = &exi_channels[0]; pos < &exi_channels[EXI_MAX_CHANNELS]; \ + for (pos = &exi_channels[0]; pos < &exi_channels[EXI_MAX_CHANNELS]; \ pos++) /* conversions between channel numbers and exi channel structures */ @@ -142,6 +138,7 @@ return __to_exi_channel(channel); } +EXPORT_SYMBOL(to_exi_channel); /** * to_channel - returns a channel number given an exi channel @@ -155,6 +152,7 @@ return __to_channel(exi_channel); } +EXPORT_SYMBOL(to_channel); /** * exi_channel_owner - returns the owner of the given channel @@ -202,6 +200,7 @@ out_be32(csr_reg, csr); spin_unlock_irqrestore(&exi_channel->io_lock, flags); } +EXPORT_SYMBOL(exi_select_raw); /** @@ -226,6 +225,7 @@ out_be32(csr_reg, csr); spin_unlock_irqrestore(&exi_channel->io_lock, flags); } +EXPORT_SYMBOL(exi_deselect_raw); /** * exi_transfer_raw - performs an exi transfer using immediate mode @@ -240,14 +240,14 @@ void exi_transfer_raw(struct exi_channel *exi_channel, void *data, size_t len, int mode) { - while(len >= 4) { + while (len >= 4) { __exi_transfer_raw_u32(exi_channel, data, mode); exi_channel->stats_xfers++; data += 4; len -= 4; } - switch(len) { + switch (len) { case 1: __exi_transfer_raw_u8(exi_channel, data, mode); exi_channel->stats_xfers++; @@ -267,6 +267,7 @@ break; } } +EXPORT_SYMBOL(exi_transfer_raw); /* * Internal. Start a transfer using "interrupt-driven immediate" mode. @@ -285,22 +286,22 @@ exi_channel->stats_xfers++; if ((mode & EXI_OP_WRITE)) { - switch(len) { - case 1: - val = *((u8*)data) << 24; - break; - case 2: - val = *((u16*)data) << 16; - break; - case 3: - val = *((u16*)data) << 16; - val |= *((u8*)data+2) << 8; - break; - case 4: - val = *((u32*)data); - break; - default: - break; + switch (len) { + case 1: + val = *((u8 *)data) << 24; + break; + case 2: + val = *((u16 *)data) << 16; + break; + case 3: + val = *((u16 *)data) << 16; + val |= *((u8 *)data+2) << 8; + break; + case 4: + val = *((u32 *)data); + break; + default: + break; } } @@ -312,7 +313,8 @@ spin_unlock_irqrestore(&exi_channel->io_lock, flags); /* start the transfer */ - out_be32(io_base + EXI_CR, EXI_CR_TSTART | EXI_CR_TLEN(len) | (mode&0xf)); + out_be32(io_base + EXI_CR, + EXI_CR_TSTART | EXI_CR_TLEN(len) | (mode&0xf)); } /* @@ -328,22 +330,22 @@ if ((mode&0xf) != EXI_OP_WRITE) { val = in_be32(io_base + EXI_DATA); - switch(len) { - case 1: - *((u8*)data) = (u8)(val >> 24); - break; - case 2: - *((u16*)data) = (u16)(val >> 16); - break; - case 3: - *((u16*)data) = (u16)(val >> 16); - *((u8*)data+2) = (u8)(val >> 8); - break; - case 4: - *((u32*)data) = (u32)(val); - break; - default: - break; + switch (len) { + case 1: + *((u8 *)data) = (u8)(val >> 24); + break; + case 2: + *((u16 *)data) = (u16)(val >> 16); + break; + case 3: + *((u16 *)data) = (u16)(val >> 16); + *((u8 *)data+2) = (u8)(val >> 8); + break; + case 4: + *((u32 *)data) = (u32)(val); + break; + default: + break; } } } @@ -402,7 +404,7 @@ spin_unlock_irqrestore(&exi_channel->io_lock, flags); /* busy-wait for transfer complete */ - while((in_be32(cr_reg)&EXI_CR_TSTART) && !borked) { + while ((in_be32(cr_reg)&EXI_CR_TSTART) && !borked) { cpu_relax(); borked = time_after(jiffies, deadline); } @@ -455,9 +457,8 @@ struct exi_channel *exi_channel; exi_channel_for_each(exi_channel) { - if (exi_channel->csr) { + if (exi_channel->csr) tasklet_schedule(&exi_channel->tasklet); - } } } @@ -476,8 +477,8 @@ exi_channel->flags &= ~EXI_DMABUSY; dma_unmap_single(&exi_channel->owner->dev, cmd->dma_addr, cmd->dma_len, - (cmd->opcode == EXI_OP_READ)? - DMA_FROM_DEVICE:DMA_TO_DEVICE); + (cmd->opcode == EXI_OP_READ) ? + DMA_FROM_DEVICE : DMA_TO_DEVICE); exi_channel->queued_cmd = NULL; } @@ -487,7 +488,7 @@ * Internal. Finish an "interrupt-driven immediate" transfer. * Caller holds the channel lock. * - * If more data is pending transfer, schedules a new transfer. + * If more data is pending transfer, it schedules a new transfer. * Returns zero if no more transfers are required, non-zero otherwise. * */ @@ -501,7 +502,7 @@ if (cmd) { BUG_ON((exi_channel->flags & EXI_DMABUSY)); - len = (cmd->bytes_left > 4)?4:cmd->bytes_left; + len = (cmd->bytes_left > 4) ? 4 : cmd->bytes_left; offset = cmd->len - cmd->bytes_left; exi_end_idi_transfer_raw(exi_channel, cmd->data + offset, len, @@ -510,8 +511,8 @@ if (balance && cmd->bytes_left > 0) { offset += len; - len = (cmd->bytes_left > balance)? - balance:cmd->bytes_left; + len = (cmd->bytes_left > balance) ? + balance : cmd->bytes_left; exi_transfer_raw(exi_channel, cmd->data + offset, len, cmd->opcode); cmd->bytes_left -= len; @@ -519,7 +520,7 @@ if (cmd->bytes_left > 0) { offset = cmd->len - cmd->bytes_left; - len = (cmd->bytes_left > 4)?4:cmd->bytes_left; + len = (cmd->bytes_left > 4) ? 4 : cmd->bytes_left; exi_start_idi_transfer_raw(exi_channel, cmd->data + offset, len, @@ -529,7 +530,7 @@ } } - return (exi_channel->queued_cmd)?1:0; + return (exi_channel->queued_cmd) ? 1 : 0; } /* @@ -573,7 +574,7 @@ */ static void exi_wait_for_transfer(struct exi_channel *exi_channel) { - while(exi_wait_for_transfer_one(exi_channel)) + while (exi_wait_for_transfer_one(exi_channel)) cpu_relax(); } #endif @@ -584,9 +585,8 @@ static void exi_command_done(struct exi_command *cmd) { /* if specified, call the completion routine */ - if (cmd->done) { + if (cmd->done) cmd->done(cmd); - } } /* @@ -601,7 +601,7 @@ BUG_ON(!exi_device); spin_lock_irqsave(&exi_channel->lock, flags); - while(exi_channel->owner) { + while (exi_channel->owner) { spin_unlock_irqrestore(&exi_channel->lock, flags); if (!wait) return -EBUSY; @@ -660,7 +660,7 @@ static int exi_cmd_transfer(struct exi_command *cmd) { static u8 exi_aligned_transfer_buf[EXI_DMA_ALIGN+1] - __attribute__ ((aligned (EXI_DMA_ALIGN+1))); + __attribute__ ((aligned(EXI_DMA_ALIGN+1))); struct exi_channel *exi_channel = cmd->exi_channel; struct exi_command *post_cmd = &exi_channel->post_cmd; void *pre_data, *data, *post_data; @@ -685,7 +685,7 @@ exi_channel->flags &= ~EXI_DMABUSY; cmd->bytes_left = cmd->len; - len = (cmd->bytes_left > 4)?4:cmd->bytes_left; + len = (cmd->bytes_left > 4) ? 4 : cmd->bytes_left; exi_start_idi_transfer_raw(exi_channel, data, len, opcode); result = 1; /* wait */ @@ -735,7 +735,7 @@ * DMA transfer using a specially aligned temporary buffer, * followed by a non-DMA transfer for the remaining bytes. */ - if ( pre_len + post_len > EXI_DMA_ALIGN ) { + if (pre_len + post_len > EXI_DMA_ALIGN) { post_len = pre_len + post_len - (EXI_DMA_ALIGN+1); post_data = pre_data + EXI_DMA_ALIGN+1; len = EXI_DMA_ALIGN+1; @@ -781,8 +781,8 @@ cmd->dma_len = len; cmd->dma_addr = dma_map_single(&exi_channel->owner->dev, data, len, - (cmd->opcode == EXI_OP_READ)? - DMA_FROM_DEVICE:DMA_TO_DEVICE); + (cmd->opcode == EXI_OP_READ) ? + DMA_FROM_DEVICE : DMA_TO_DEVICE); exi_start_dma_transfer_raw(exi_channel, cmd->dma_addr, len, opcode); @@ -812,7 +812,7 @@ if (cmd->opcode != EXI_OP_TAKE) WARN_ON(exi_channel->owner != exi_device); - switch(cmd->opcode) { + switch (cmd->opcode) { case EXI_OP_NOP: break; case EXI_OP_TAKE: @@ -896,6 +896,7 @@ cmd.flags |= EXI_CMD_NOWAIT; return exi_run_command(&cmd); } +EXPORT_SYMBOL(exi_take); /** * exi_give - releases an exi channel @@ -910,6 +911,7 @@ exi_op_give(&cmd, exi_device->exi_channel); return exi_run_command(&cmd); } +EXPORT_SYMBOL(exi_give); /** * exi_select - selects a exi device @@ -924,6 +926,7 @@ exi_op_select(&cmd, exi_device); exi_run_command(&cmd); } +EXPORT_SYMBOL(exi_select); /** * exi_deselect - deselects all devices on an exi channel @@ -939,6 +942,7 @@ exi_op_deselect(&cmd, exi_channel); exi_run_command(&cmd); } +EXPORT_SYMBOL(exi_deselect); /** * exi_transfer - Performs a read or write EXI transfer. @@ -958,7 +962,7 @@ cmd.flags |= flags; exi_run_command_and_wait(&cmd); } - +EXPORT_SYMBOL(exi_transfer); /* * Internal. Release several previously reserved channels, according to a @@ -969,7 +973,8 @@ struct exi_channel *exi_channel; unsigned int channel; - for(channel=0; channel_mask && channel < EXI_MAX_CHANNELS; channel++) { + for (channel = 0; channel_mask && channel < EXI_MAX_CHANNELS; + channel++) { if ((channel_mask & (1<<channel))) { channel_mask &= ~(1<<channel); exi_channel = __to_exi_channel(channel); @@ -990,7 +995,8 @@ unsigned long flags; int result = 0; - for(channel=0; channel_mask && channel < EXI_MAX_CHANNELS; channel++) { + for (channel = 0; channel_mask && channel < EXI_MAX_CHANNELS; + channel++) { if ((channel_mask & (1<<channel))) { channel_mask &= ~(1<<channel); exi_channel = __to_exi_channel(channel); @@ -1082,11 +1088,11 @@ } /* - * We won't lauch event handlers if any of the channels we + * We won't lauch event handlers if any of the channels we * provided on event registration is in use. */ - //exi_cond_trigger_event(exi_channel, EXI_EVENT_TC, EXI_CSR_TCINT); + /*exi_cond_trigger_event(exi_channel, EXI_EVENT_TC, EXI_CSR_TCINT);*/ exi_cond_trigger_event(exi_channel, EXI_EVENT_IRQ, EXI_CSR_EXIINT); exi_cond_trigger_event(exi_channel, EXI_EVENT_INSERT, EXI_CSR_EXTIN); } @@ -1126,20 +1132,17 @@ exi_channel->csr); /* ack all for this channel */ - out_be32(csr_reg, csr | status); + out_be32(csr_reg, csr | status); spin_unlock_irqrestore(&exi_channel->io_lock, flags); - if ((status & EXI_CSR_TCINT)) { + if ((status & EXI_CSR_TCINT)) exi_wait_for_transfer_one(exi_channel); - } - if ((status & EXI_CSR_EXTIN)) { + if ((status & EXI_CSR_EXTIN)) wake_up(&exi_bus_waitq); - } - if (exi_channel->csr && !exi_is_taken(exi_channel)) { + if (exi_channel->csr && !exi_is_taken(exi_channel)) tasklet_schedule(&exi_channel->tasklet); - } } return IRQ_HANDLED; } @@ -1163,7 +1166,8 @@ out_be32(csr_reg, csr | (EXI_CSR_EXTIN | EXI_CSR_EXTINMASK)); break; case EXI_EVENT_TC: - //out_be32(csr_reg, csr | (EXI_CSR_TCINT | EXI_CSR_TCINTMASK)); + /*out_be32(csr_reg, + csr | (EXI_CSR_TCINT | EXI_CSR_TCINTMASK));*/ break; case EXI_EVENT_IRQ: out_be32(csr_reg, csr | (EXI_CSR_EXIINT | EXI_CSR_EXIINTMASK)); @@ -1192,7 +1196,8 @@ out_be32(csr_reg, (csr | EXI_CSR_EXTIN) & ~EXI_CSR_EXTINMASK); break; case EXI_EVENT_TC: - //out_be32(csr_reg, (csr | EXI_CSR_TCINT) & ~EXI_CSR_TCINTMASK); + /*out_be32(csr_reg, + (csr | EXI_CSR_TCINT) & ~EXI_CSR_TCINTMASK);*/ break; case EXI_EVENT_IRQ: out_be32(csr_reg, (csr | EXI_CSR_EXIINT) & ~EXI_CSR_EXIINTMASK); @@ -1202,7 +1207,6 @@ return 0; } - /** * exi_event_register - Registers an event on a given channel. * @exi_channel: channel @@ -1240,7 +1244,7 @@ spin_unlock(&exi_channel->lock); return result; } - +EXPORT_SYMBOL(exi_event_register); /** * exi_event_unregister - Unregisters an event on a given channel. @@ -1268,6 +1272,7 @@ return result; } +EXPORT_SYMBOL(exi_event_unregister); /* * Internal. Quiesce a channel. @@ -1324,20 +1329,20 @@ /* * We return a EXI_ID_NONE if there is some unidentified device * inserted in memcard slot A or memcard slot B. - * This, for example, allows the SD/MMC driver to see cards. + * This, for example, allows the SD/MMC driver to see inserted cards. */ if (id == EXI_ID_INVALID) { if ((__to_channel(exi_channel) == 0 || __to_channel(exi_channel) == 1) && exi_device->eid.device == 0) { - if (in_be32(csr_reg) & EXI_CSR_EXT) { + if (in_be32(csr_reg) & EXI_CSR_EXT) id = EXI_ID_NONE; - } - } + } } return id; } +EXPORT_SYMBOL(exi_get_id); /* * Tells if there is a device inserted in one of the memory card slots. @@ -1345,7 +1350,7 @@ int exi_get_ext_line(struct exi_channel *exi_channel) { u32 __iomem *csr_reg = exi_channel->io_base + EXI_CSR; - return (in_be32(csr_reg) & EXI_CSR_EXT)?1:0; + return (in_be32(csr_reg) & EXI_CSR_EXT) ? 1 : 0; } /* @@ -1353,11 +1358,10 @@ */ void exi_update_ext_status(struct exi_channel *exi_channel) { - if (exi_get_ext_line(exi_channel)) { + if (exi_get_ext_line(exi_channel)) exi_channel->flags |= EXI_EXT; - } else { + else exi_channel->flags &= ~EXI_EXT; - } } /* @@ -1375,7 +1379,7 @@ return -ENOMEM; } - for(channel = 0; channel < EXI_MAX_CHANNELS; channel++) { + for (channel = 0; channel < EXI_MAX_CHANNELS; channel++) { exi_channel = __to_exi_channel(channel); /* initialize a channel structure */ @@ -1386,16 +1390,15 @@ exi_quiesce_all_channels(EXI_CSR_EXTINMASK); /* register the exi interrupt handler */ - result = request_irq(irq, exi_irq_handler, 0, module_name, NULL); - if (result) { + result = request_irq(irq, exi_irq_handler, 0, module_name, NULL); + if (result) drv_printk(KERN_ERR, "failed to register IRQ %d\n", irq); - } return result; } /* - * Pseudo-Internal. + * Pseudo-Internal. */ void exi_hw_exit(struct resource *mem, unsigned int irq) { @@ -1403,22 +1406,3 @@ iounmap(exi_io_mem); free_irq(irq, NULL); } - - -EXPORT_SYMBOL(to_exi_channel); -EXPORT_SYMBOL(to_channel); - -EXPORT_SYMBOL(exi_select_raw); -EXPORT_SYMBOL(exi_deselect_raw); -EXPORT_SYMBOL(exi_transfer_raw); - -EXPORT_SYMBOL(exi_take); -EXPORT_SYMBOL(exi_give); -EXPORT_SYMBOL(exi_select); -EXPORT_SYMBOL(exi_deselect); -EXPORT_SYMBOL(exi_transfer); - -EXPORT_SYMBOL(exi_get_id); -EXPORT_SYMBOL(exi_event_register); -EXPORT_SYMBOL(exi_event_unregister); - |
From: Albert H. <he...@us...> - 2009-02-01 18:29:40
|
Update of /cvsroot/gc-linux/linux/drivers/usb/host In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv17186/drivers/usb/host Modified Files: Kconfig Makefile rvl-sthcd.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: Makefile =================================================================== RCS file: /cvsroot/gc-linux/linux/drivers/usb/host/Makefile,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- Makefile 14 Sep 2008 19:20:31 -0000 1.2 +++ Makefile 1 Feb 2009 18:29:35 -0000 1.3 @@ -8,6 +8,8 @@ isp1760-objs := isp1760-hcd.o isp1760-if.o +obj-$(CONFIG_USB_WHCI_HCD) += whci/ + obj-$(CONFIG_PCI) += pci-quirks.o obj-$(CONFIG_USB_EHCI_HCD) += ehci-hcd.o @@ -20,3 +22,4 @@ obj-$(CONFIG_USB_R8A66597_HCD) += r8a66597-hcd.o obj-$(CONFIG_USB_ISP1760_HCD) += isp1760.o obj-$(CONFIG_USB_WII_HCD) += rvl-sthcd.o +obj-$(CONFIG_USB_HWA_HCD) += hwa-hc.o Index: Kconfig =================================================================== RCS file: /cvsroot/gc-linux/linux/drivers/usb/host/Kconfig,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- Kconfig 15 Nov 2008 20:10:15 -0000 1.4 +++ Kconfig 1 Feb 2009 18:29:35 -0000 1.5 @@ -110,35 +110,23 @@ config USB_ISP1760_HCD tristate "ISP 1760 HCD support" - depends on USB && EXPERIMENTAL + depends on USB && EXPERIMENTAL && (PCI || PPC_OF) ---help--- The ISP1760 chip is a USB 2.0 host controller. This driver does not support isochronous transfers or OTG. + This USB controller is usually attached to a non-DMA-Master + capable bus. NXP's eval kit brings this chip on PCI card + where the chip itself is behind a PLB to simulate such + a bus. To compile this driver as a module, choose M here: the - module will be called isp1760-hcd. - -config USB_ISP1760_PCI - bool "Support for the PCI bus" - depends on USB_ISP1760_HCD && PCI - ---help--- - Enables support for the device present on the PCI bus. - This should only be required if you happen to have the eval kit from - NXP and you are going to test it. - -config USB_ISP1760_OF - bool "Support for the OF platform bus" - depends on USB_ISP1760_HCD && PPC_OF - ---help--- - Enables support for the device present on the PowerPC - OpenFirmware platform bus. + module will be called isp1760. config USB_OHCI_HCD tristate "OHCI HCD support" depends on USB && USB_ARCH_HAS_OHCI select ISP1301_OMAP if MACH_OMAP_H2 || MACH_OMAP_H3 - select I2C if ARCH_PNX4008 ---help--- The Open Host Controller Interface (OHCI) is a standard for accessing USB 1.1 host controller hardware. It does more in hardware than Intel's @@ -312,16 +300,43 @@ help The Nintendo Wii includes a USB 1.1 host controller that can be accessed through the API provided by the starlet subsystem. - + Enable this option if you plan to use the internal Nintendo Wii bluetooth dongle or any USB peripheral connected to the external ports. - + USB devices using isochronous transfers are not supported. Use of USB hubs is partially supported. - + Use completely at you own risk. If unsure, say N. - + To compile this driver as a module, choose M here: the module will be called rvl-sthcd. +config USB_WHCI_HCD + tristate "Wireless USB Host Controller Interface (WHCI) driver (EXPERIMENTAL)" + depends on EXPERIMENTAL + depends on PCI && USB + select USB_WUSB + select UWB_WHCI + help + A driver for PCI-based Wireless USB Host Controllers that are + compliant with the WHCI specification. + + To compile this driver a module, choose M here: the module + will be called "whci-hcd". + +config USB_HWA_HCD + tristate "Host Wire Adapter (HWA) driver (EXPERIMENTAL)" + depends on EXPERIMENTAL + depends on USB + select USB_WUSB + select UWB_HWA + help + This driver enables you to connect Wireless USB devices to + your system using a Host Wire Adaptor USB dongle. This is an + UWB Radio Controller and WUSB Host Controller connected to + your machine via USB (specified in WUSB1.0). + + To compile this driver a module, choose M here: the module + will be called "hwa-hc". Index: rvl-sthcd.c =================================================================== RCS file: /cvsroot/gc-linux/linux/drivers/usb/host/rvl-sthcd.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- rvl-sthcd.c 25 Nov 2008 19:09:31 -0000 1.4 +++ rvl-sthcd.c 1 Feb 2009 18:29:35 -0000 1.5 @@ -2,9 +2,9 @@ * drivers/usb/host/rvl-sthcd.c * * USB Host Controller driver for the Nintendo Wii - * Copyright (C) 2008 The GameCube Linux Team + * Copyright (C) 2008-2009 The GameCube Linux Team * Copyright (C) 2008 Maarten ter Huurne - * Copyright (C) 2008 Albert Herranz + * 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 @@ -69,7 +69,7 @@ * we need additional ports here. */ #define STHCD_MAX_DEVIDS 15 -#define STHCD_MAX_PORTS STHCD_MAX_DEVIDS +#define STHCD_MAX_PORTS STHCD_MAX_DEVIDS /* * We get error -7008 after performing large transfers. @@ -247,7 +247,7 @@ { int i; for (i = 0; i < (size + 3) / 4; i += 4) { - u32 *data = &((u32*)buf)[i]; + u32 *data = &((u32 *)buf)[i]; printk(KERN_INFO " %08X %08X %08X %08X\n", data[0], data[1], data[2], data[3] ); @@ -399,7 +399,7 @@ USB_ENDPOINT_XFERTYPE_MASK; int error; - switch(xfer_type) { + switch (xfer_type) { case USB_ENDPOINT_XFER_CONTROL: error = sthcd_pep_alloc_ctrl_xfer_ctx(pep); break; @@ -422,7 +422,7 @@ unsigned int xfer_type = pep->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK; - switch(xfer_type) { + switch (xfer_type) { case USB_ENDPOINT_XFER_CONTROL: sthcd_pep_free_ctrl_xfer_ctx(pep); break; @@ -642,7 +642,7 @@ } /* - * + * * Context: interrupts disabled, hcd lock held */ static int sthcd_pep_setup_xfer(struct sthcd_pep *pep) @@ -768,7 +768,7 @@ static int sthcd_pep_xfer_callback(struct starlet_ipc_request *req); /* - * + * * Context: interrupts disabled, hcd lock held */ static int sthcd_pep_start_xfer(struct sthcd_pep *pep) @@ -826,7 +826,7 @@ __releases(sthcd->lock) __acquires(sthcd->lock) { struct usb_hcd *hcd = sthcd_to_hcd(sthcd); - + /* * Release the hcd lock here as the callback may need to * hold it again. @@ -927,25 +927,25 @@ goto err_setup_xfer; } - fake = 0; + fake = 0; if (pep->request == STHCD_IOCTLV_CONTROLREQ) { req = (struct usb_ctrlrequest *)urb->setup_packet; typeReq = (req->bRequestType << 8) | req->bRequest; wValue = le16_to_cpu(req->wValue); - switch(typeReq) { + switch (typeReq) { case DeviceOutRequest | USB_REQ_SET_ADDRESS: /* 0005 */ - if (urb->dev->devnum != 0) { + if (urb->dev->devnum != 0) { /* REVISIT, never reached */ - drv_printk(KERN_WARNING, + drv_printk(KERN_WARNING, "address change %u->%u\n", urb->dev->devnum, wValue); - } + } /* * We are guaranteed to have an udev because the takein * was successful. */ - pep->udev->devnum = wValue; + pep->udev->devnum = wValue; urb->actual_length = 0; /* clear the port reset count, we have an address */ @@ -1035,6 +1035,7 @@ struct urb *urb; int retval; unsigned long flags; + int error; starlet_ipc_free_request(req); @@ -1070,7 +1071,7 @@ sthcd_pep_print(pep); } - switch(status) { + switch (status) { case -7003: case -7004: /* endpoint stall */ @@ -1130,9 +1131,9 @@ sthcd_pep_finish_xfer(pep, xfer_len); /* - * Only schedule the next chunk if we didn't get a short xfer - * and the pep is still active - */ + * Only schedule the next chunk if we didn't get a short xfer + * and the pep is still active + */ if (xfer_len == pep->io_buf_len && pep_is_enabled(pep)) { retval = sthcd_pep_setup_next_xfer(pep); if (retval <= 0) { @@ -1157,7 +1158,7 @@ BUG_ON(!sthcd); BUG_ON(!urb); - int error = usb_hcd_check_unlink_urb(hcd, urb, status); + error = usb_hcd_check_unlink_urb(hcd, urb, status); if (!error) { usb_hcd_unlink_urb_from_ep(hcd, urb); @@ -1192,7 +1193,7 @@ int i; port = sthcd->ports; - for(i = 0; i < sthcd->nr_ports; i++, port++) { + for (i = 0; i < sthcd->nr_ports; i++, port++) { udev = &port->udev; if (!test_and_set_bit(__STHCD_PORT_INUSE, &port->flags)) return udev; @@ -1258,7 +1259,7 @@ } snprintf(pathname, sizeof(pathname), "/dev/usb/oh%u/%04x/%04x", - oh->index, udev->idVendor, udev->idProduct); + oh->index, udev->idVendor, udev->idProduct); error = starlet_open(pathname, 0); if (error < 0) { drv_printk(KERN_ERR, "open %s failed\n", pathname); @@ -1403,7 +1404,7 @@ } break; case GetHubDescriptor: /* 0xA006 */ - /* + /* * For the DeviceRemovable and PortPwrCtrlMask fields: * bit 0 is reserved. * bit 1 is the internal (oh1) port, which is non-removable. @@ -1442,7 +1443,7 @@ break; } - if (retval < 0) + if (retval < 0) DBG("%s: retval=%d (%x)\n", __func__, retval, retval); return retval; } @@ -1472,7 +1473,7 @@ if (test_bit(__STHCD_PORT_DOOMED, &port->flags)) { /* disconnect */ if (!!(port->status_change & USB_PORT_STAT_CONNECTION)) - port->status_change |= + port->status_change |= (USB_PORT_STAT_C_CONNECTION<<16); port->status_change &= ~USB_PORT_STAT_CONNECTION; } @@ -1486,7 +1487,7 @@ set_bit(__STHCD_PORT_DOOMED, &port->flags); } if (!(port->status_change & USB_PORT_STAT_ENABLE)) - port->status_change |= + port->status_change |= (USB_PORT_STAT_C_ENABLE << 16); port->status_change &= ~USB_PORT_STAT_RESET; port->status_change |= (USB_PORT_STAT_ENABLE | @@ -1586,7 +1587,7 @@ if (retval > 0) retval = 0; - if (retval < 0) + if (retval < 0) DBG("%s: retval=%d (%x)\n", __func__, retval, retval); return retval; } @@ -1613,19 +1614,18 @@ spin_lock_irqsave(&sthcd->lock, flags); port = sthcd->ports; - for(i = 0, *p = 0; i < sthcd->nr_ports; i++, port++) { + for (i = 0, *p = 0; i < sthcd->nr_ports; i++, port++) { if ((port->status_change & 0xffff0000) != 0) { *p |= 1 << (i+1); /* REVISIT */ - //break; } } *p = le16_to_cpu(*p); - result = (*p != 0)?2:0; + result = (*p != 0) ? 2 : 0; spin_unlock_irqrestore(&sthcd->lock, flags); -// DBG("%s: poll cycle, changes=%04x\n", __func__, *p); +/* DBG("%s: poll cycle, changes=%04x\n", __func__, *p); */ return result; } @@ -1644,7 +1644,7 @@ struct sthcd_port *port; unsigned long flags; int error; - + drv_printk(KERN_INFO, "inserting device %04X.%04X\n", idVendor, idProduct); @@ -1726,7 +1726,7 @@ goto done; } - params_in->req.bRequestType= requesttype; + params_in->req.bRequestType = requesttype; params_in->req.bRequest = request; params_in->req.wValue = cpu_to_le16p(&value); params_in->req.wIndex = cpu_to_le16p(&index); @@ -1778,7 +1778,7 @@ } snprintf(pathname, sizeof(pathname), "/dev/usb/oh%u/%04x/%04x", - oh->index, idVendor, idProduct); + oh->index, idVendor, idProduct); retval = starlet_open(pathname, 0); if (retval < 0) { drv_printk(KERN_ERR, "open %s failed\n", pathname); @@ -1787,7 +1787,7 @@ } fd = retval; - for (i=0; i < 3; i++) { + for (i = 0; i < 3; i++) { retval = sthcd_usb_control_msg(fd, USB_REQ_GET_DESCRIPTOR, USB_DIR_IN, USB_DT_DEVICE << 8, 0, @@ -1803,7 +1803,7 @@ if (retval >= USB_DT_DEVICE_SIZE) { /* tell if a hub was found */ - retval = (descriptor->bDeviceClass == USB_CLASS_HUB)?1:0; + retval = (descriptor->bDeviceClass == USB_CLASS_HUB) ? 1 : 0; } else { if (retval >= 0) retval = -EINVAL; /* short descriptor */ @@ -1854,7 +1854,7 @@ starlet_ioh_sg_init_table(in, 2); starlet_ioh_sg_entry(&in[0], ¶ms_in->devid_count); starlet_ioh_sg_entry(&in[1], ¶ms_in->_type); - + starlet_ioh_sg_init_table(io, 2); starlet_ioh_sg_entry(&io[0], ¶ms_io->devid_count); starlet_ioh_sg_set_buf(&io[1], ¶ms_io->devids, size); @@ -1895,7 +1895,7 @@ static int sthcd_oh_rescan(struct sthcd_oh *oh) { - static unsigned int poll_cycles = 0; + static unsigned int poll_cycles; struct usb_hcd *hcd = sthcd_to_hcd(oh->hcd); struct sthcd_devid *p; int nr_new_devids, i; @@ -1910,7 +1910,7 @@ nr_new_devids = error; changes = 0; - for(i = 0; i < oh->nr_devids; i++) { + for (i = 0; i < oh->nr_devids; i++) { p = &oh->devids[i]; if (!sthcd_devid_find(oh->new_devids, nr_new_devids, p)) { /* removal */ @@ -1921,7 +1921,7 @@ } } - for(i = 0; i < nr_new_devids; i++) { + for (i = 0; i < nr_new_devids; i++) { p = &oh->new_devids[i]; if (!sthcd_devid_find(oh->devids, oh->nr_devids, p)) { /* insertion */ @@ -1961,11 +1961,10 @@ } poll_cycles = 2; } else { - if (!poll_cycles) { + if (!poll_cycles) hcd->poll_rh = 0; - } else { + else poll_cycles--; - } #else usb_hcd_poll_rh_status(hcd); #endif @@ -2030,7 +2029,7 @@ oh = &sthcd->oh[0]; - while(!kthread_should_stop()) { + while (!kthread_should_stop()) { sthcd_oh_rescan(oh); /* re-check again after the configured interval */ @@ -2083,9 +2082,8 @@ /* device insertion/removal is managed by the rescan thread */ sthcd->rescan_task = kthread_run(sthcd_rescan_thread, sthcd, "ksthcd"); - if (IS_ERR(sthcd->rescan_task)) { + if (IS_ERR(sthcd->rescan_task)) drv_printk(KERN_ERR, "failed to start rescan thread\n"); - } return 0; } @@ -2170,7 +2168,7 @@ spin_lock_irqsave(&sthcd->lock, flags); error = usb_hcd_check_unlink_urb(hcd, urb, status); - if (error) + if (error) goto done; ep = urb->ep; @@ -2355,7 +2353,7 @@ if (usb_disabled()) return -ENODEV; - drv_printk(KERN_INFO, "%s - version %s\n", DRV_DESCRIPTION, + drv_printk(KERN_INFO, "%s - version %s\n", DRV_DESCRIPTION, sthcd_driver_version); return of_register_platform_driver(&sthcd_of_driver); |
From: Albert H. <he...@us...> - 2009-01-11 20:07:10
|
Update of /cvsroot/gc-linux/linux/arch/powerpc/include/asm In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv15225/arch/powerpc/include/asm Added Files: starlet.h udbg.h Log Message: Add two include files I missed on latest commit. --- NEW FILE: starlet.h --- /* * arch/powerpc/include/asm/starlet.h * * Nintendo Wii starlet processor definitions * 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. * */ #ifndef __ASM_POWERPC_STARLET_H #define __ASM_POWERPC_STARLET_H #include <linux/types.h> #include <linux/spinlock_types.h> #include <linux/platform_device.h> #include <linux/dmapool.h> #include <linux/dma-mapping.h> #include <linux/list.h> #include <linux/scatterlist.h> #include <linux/timer.h> #include <asm/rheap.h> #define STARLET_EINVAL -4 #define STARLET_IPC_DMA_ALIGN 0x1f /* 32 bytes */ struct starlet_ipc_request; /* input/output heap */ struct starlet_ioh { spinlock_t lock; rh_info_t *rheap; unsigned long base_phys; void *base; size_t size; }; /* pseudo-scatterlist support for the input/output heap */ struct starlet_ioh_sg { void *buf; size_t len; dma_addr_t dma_addr; }; /* inter-process communication device abstraction */ struct starlet_ipc_device { unsigned long flags; void __iomem *io_base; int irq; struct dma_pool *dma_pool; /* to allocate requests */ struct starlet_ioh *ioh; /* to allocate special io buffers */ unsigned int random_id; spinlock_t list_lock; struct list_head outstanding_list; unsigned long nr_outstanding; struct list_head pending_list; unsigned long nr_pending; struct timer_list timer; struct starlet_ipc_request *req; /* for requests causing a ios reboot */ struct device *dev; }; /* iovec entry suitable for ioctlv */ struct starlet_iovec { dma_addr_t dma_addr; u32 dma_len; }; typedef int (*starlet_ipc_callback_t)(struct starlet_ipc_request *req); struct starlet_ipc_request { /* begin starlet firmware request format */ u32 cmd; /* 0x00 */ s32 result; /* 0x04 */ union { /* 0x08 */ s32 fd; u32 req_cmd; }; union { struct { dma_addr_t pathname; /* 0x0c */ u32 mode; /* 0x10 */ } open; struct { u32 request; /* 0x0c */ dma_addr_t ibuf; /* 0x10 */ u32 ilen; /* 0x14 */ dma_addr_t obuf; /* 0x18 */ u32 olen; /* 0x1c */ } ioctl; struct { u32 request; /* 0x0c */ u32 argc_in; /* 0x10 */ u32 argc_io; /* 0x14 */ dma_addr_t iovec_da; /* 0x18 */ } ioctlv; u32 argv[5]; /* 0x0c,0x10,0x14,0x18,0x1c */ }; /* end starlet firmware request format */ /* * A signature is used to discard bogus requests from earlier * IPC instances. */ unsigned int sig; dma_addr_t dma_addr; /* request dma address */ /* ioctlv related data */ struct starlet_iovec *iovec; size_t iovec_size; unsigned sgl_nents_in; unsigned sgl_nents_io; union { struct scatterlist *sgl_in; struct starlet_ioh_sg *ioh_sgl_in; }; union { struct scatterlist *sgl_io; struct starlet_ioh_sg *ioh_sgl_io; }; void *done_data; starlet_ipc_callback_t done; starlet_ipc_callback_t complete; unsigned long jiffies; struct list_head node; /* for queueing */ struct starlet_ipc_device *ipc_dev; }; /* from starlet-malloc.c */ extern int starlet_malloc_lib_bootstrap(struct resource *mem); extern void *starlet_kzalloc(size_t size, gfp_t flags); extern void starlet_kfree(void *ptr); extern void *starlet_ioh_kzalloc(size_t size); extern void starlet_ioh_kfree(void *ptr); extern unsigned long starlet_ioh_virt_to_phys(void *ptr); extern void starlet_ioh_sg_init_table(struct starlet_ioh_sg *sgl, unsigned int nents); extern void starlet_ioh_sg_set_buf(struct starlet_ioh_sg *sg, void *buf, size_t len); #define starlet_ioh_for_each_sg(sgl, sg, nr, __i) \ for (__i = 0, sg = (sgl); __i < nr; __i++, sg++) extern int starlet_ioh_dma_map_sg(struct device *dev, struct starlet_ioh_sg *sgl, int nents, enum dma_data_direction direction); extern void starlet_ioh_dma_unmap_sg(struct device *dev, struct starlet_ioh_sg *sgl, int nents, enum dma_data_direction direction); /* from starlet-ipc.c */ extern struct starlet_ipc_device *starlet_ipc_get_device(void); extern struct starlet_ipc_request * starlet_ipc_alloc_request(struct starlet_ipc_device *ipc_dev, gfp_t flags); extern void starlet_ipc_free_request(struct starlet_ipc_request *req); extern int starlet_open(const char *pathname, int flags); extern int starlet_close(int fd); extern int starlet_ioctl(int fd, int request, void *ibuf, size_t ilen, void *obuf, size_t olen); extern int starlet_ioctl_nowait(int fd, int request, void *ibuf, size_t ilen, void *obuf, size_t olen, starlet_ipc_callback_t callback, void *arg); extern int starlet_ioctlv(int fd, int request, unsigned int nents_in, struct scatterlist *sgl_in, unsigned int nents_out, struct scatterlist *sgl_out); extern int starlet_ioctlv_nowait(int fd, int request, unsigned int nents_in, struct scatterlist *sgl_in, unsigned int nents_out, struct scatterlist *sgl_out, starlet_ipc_callback_t callback, void *arg); extern int starlet_ioctlv_and_reboot(int fd, int request, unsigned int nents_in, struct scatterlist *sgl_in, unsigned int nents_out, struct scatterlist *sgl_out); extern int starlet_ioh_ioctlv(int fd, int request, unsigned int nents_in, struct starlet_ioh_sg *ioh_sgl_in, unsigned int nents_io, struct starlet_ioh_sg *ioh_sgl_io); extern int starlet_ioh_ioctlv_nowait(int fd, int request, unsigned int nents_in, struct starlet_ioh_sg *ioh_sgl_in, unsigned int nents_io, struct starlet_ioh_sg *ioh_sgl_io, starlet_ipc_callback_t callback, void *arg); /* from starlet-stm.c */ extern void starlet_stm_restart(void); extern void starlet_stm_power_off(void); #endif /* __ASM_POWERPC_STARLET_H */ --- NEW FILE: udbg.h --- /* * (c) 2001, 2006 IBM Corporation. * * 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 _ASM_POWERPC_UDBG_H #define _ASM_POWERPC_UDBG_H #ifdef __KERNEL__ #include <linux/compiler.h> #include <linux/init.h> extern void (*udbg_putc)(char c); extern int (*udbg_getc)(void); extern int (*udbg_getc_poll)(void); extern void udbg_puts(const char *s); extern int udbg_write(const char *s, int n); extern int udbg_read(char *buf, int buflen); extern void register_early_udbg_console(void); extern void udbg_printf(const char *fmt, ...) __attribute__ ((format (printf, 1, 2))); extern void udbg_progress(char *s, unsigned short hex); extern void udbg_init_uart(void __iomem *comport, unsigned int speed, unsigned int clock); extern unsigned int udbg_probe_uart_speed(void __iomem *comport, unsigned int clock); struct device_node; extern void udbg_scc_init(int force_scc); extern int udbg_adb_init(int force_btext); extern void udbg_adb_init_early(void); extern void __init udbg_early_init(void); extern void __init udbg_init_debug_lpar(void); extern void __init udbg_init_pmac_realmode(void); extern void __init udbg_init_maple_realmode(void); extern void __init udbg_init_pas_realmode(void); extern void __init udbg_init_iseries(void); extern void __init udbg_init_rtas_panel(void); extern void __init udbg_init_rtas_console(void); extern void __init udbg_init_debug_beat(void); extern void __init udbg_init_btext(void); extern void __init udbg_init_44x_as1(void); extern void __init udbg_init_40x_realmode(void); extern void __init udbg_init_cpm(void); extern void __init udbg_init_debug_usbgecko(void); #endif /* __KERNEL__ */ #endif /* _ASM_POWERPC_UDBG_H */ |
From: Albert H. <he...@us...> - 2008-11-25 19:11:36
|
Update of /cvsroot/gc-linux/linux/arch/powerpc/platforms/embedded6xx In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv28930/arch/powerpc/platforms/embedded6xx Modified Files: usbgecko_udbg.c wii.c Log Message: Apply: gc-linux+fix_cputable-2.6.27.patch gcnfb+fix_mmap-2.6.27.patch usbgecko_udbg+safeness.patch rvl-sthcd+workaround_7005.patch Index: usbgecko_udbg.c =================================================================== RCS file: /cvsroot/gc-linux/linux/arch/powerpc/platforms/embedded6xx/usbgecko_udbg.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- usbgecko_udbg.c 15 Nov 2008 20:10:14 -0000 1.3 +++ usbgecko_udbg.c 25 Nov 2008 19:09:31 -0000 1.4 @@ -37,6 +37,9 @@ #define EXI_DATA 0x10 +#define UG_READ_ATTEMPTS 100 +#define UG_WRITE_ATTEMPTS 100 + static void __iomem *ug_io_base; @@ -106,7 +109,7 @@ */ static void ug_putc(char ch) { - int count = 16; + int count = UG_WRITE_ATTEMPTS; if (!ug_io_base) return; @@ -158,7 +161,7 @@ */ static int ug_getc(void) { - int count = 16; + int count = UG_READ_ATTEMPTS; if (!ug_io_base) return -1; @@ -214,10 +217,12 @@ reg = of_get_property(np, "reg", NULL); if (reg) { paddr = of_translate_address(np, reg); - if (paddr) + if (paddr) { ug_io_base = ioremap(paddr, reg[1]); + return ug_io_base; + } } - return ug_io_base; + return NULL; } /* @@ -225,19 +230,30 @@ */ void __init ug_udbg_init(void) { - struct device_node *np; + struct device_node *np = NULL; struct device_node *stdout; const char *path; - ug_io_base = NULL; + if (ug_io_base) + udbg_printf("%s: early -> final\n", __func__); + + if (!of_chosen) { + udbg_printf("%s: missing of_chosen\n", __func__); + goto done; + } path = of_get_property(of_chosen, "linux,stdout-path", NULL); - if (!path) - return; + if (!path) { + udbg_printf("%s: missing %s property", __func__, + "linux,stdout-path"); + goto done; + } stdout = of_find_node_by_path(path); - if (!stdout) - return; + if (!stdout) { + udbg_printf("%s: missing path %s", __func__, path); + goto done; + } for(np = NULL; (np = of_find_compatible_node(np, NULL, "usbgecko,usbgecko")); ) @@ -245,18 +261,30 @@ break; of_node_put(stdout); - if (!np) - return; + if (!np) { + udbg_printf("%s: stdout is not an usbgecko", __func__); + goto done; + } - ug_udbg_setup_io_base(np); - if (ug_is_adapter_present()) { + if (!ug_udbg_setup_io_base(np)) { + udbg_printf("%s: failed to setup io base", __func__); + goto done; + } + + if (!ug_is_adapter_present()) { + udbg_printf("usbgecko_udbg: not found\n"); + ug_io_base = NULL; + } else { udbg_putc = ug_udbg_putc; udbg_getc = ug_udbg_getc; udbg_getc_poll = ug_udbg_getc_poll; - printk(KERN_INFO "usbgecko_udbg: ready\n"); + udbg_printf("usbgecko_udbg: ready\n"); } - of_node_put(np); +done: + if (np) + of_node_put(np); + return; } #ifdef CONFIG_PPC_EARLY_DEBUG_USBGECKO Index: wii.c =================================================================== RCS file: /cvsroot/gc-linux/linux/arch/powerpc/platforms/embedded6xx/wii.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- wii.c 15 Nov 2008 20:10:14 -0000 1.2 +++ wii.c 25 Nov 2008 19:09:31 -0000 1.3 @@ -59,14 +59,14 @@ seq_printf(m, "machine\t\t: Nintendo Wii\n"); } -static void wii_setup_arch(void) +static void __init wii_setup_arch(void) { + ug_udbg_init(); + gcnvi_udbg_init(); } static void __init wii_init_early(void) { - ug_udbg_init(); - gcnvi_udbg_init(); } static int __init wii_probe(void) |