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...> - 2008-07-02 20:38:38
|
Update of /cvsroot/gc-linux/linux/arch/powerpc/platforms/embedded6xx In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv32110/arch/powerpc/platforms/embedded6xx Modified Files: starlet-ipc.c Log Message: - move memory allocation functions to starlet-malloc - add gfp_t flags to starlet_ipc_alloc_request - bootstrap malloc library from ipc initialization code - change (experiment) a bit with the irq completion logic for ipc - use per call type automatic completion handlers - separate the allocation and preparation of ipc requests - close the 24 file descriptors on startup - comment out part of the debugging code - add (disabled) watchdog code to report long-standing ipc requests Index: starlet-ipc.c =================================================================== RCS file: /cvsroot/gc-linux/linux/arch/powerpc/platforms/embedded6xx/starlet-ipc.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- starlet-ipc.c 12 Apr 2008 17:22:28 -0000 1.4 +++ starlet-ipc.c 2 Jul 2008 20:38:46 -0000 1.5 @@ -14,7 +14,8 @@ #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> #include <linux/module.h> @@ -22,6 +23,7 @@ #include <linux/of_platform.h> [...1326 lines suppressed...] + int error; - retval = of_address_to_resource(odev->node, 0, &res); - if (retval) { + error = of_address_to_resource(odev->node, 0, &mem[0]); + if (error) { drv_printk(KERN_ERR, "no io memory range found\n"); return -ENODEV; } + error = of_address_to_resource(odev->node, 1, &mem[1]); + if (error) { + drv_printk(KERN_ERR, "missing ioh memory area (%d)\n", error); + return -ENODEV; + } - return starlet_ipc_do_probe(&odev->dev, &res, + return starlet_ipc_do_probe(&odev->dev, mem, irq_of_parse_and_map(odev->node, 0)); } |
From: Albert H. <he...@us...> - 2008-07-02 20:38:02
|
Update of /cvsroot/gc-linux/linux/arch/powerpc/platforms/embedded6xx In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv31712/arch/powerpc/platforms/embedded6xx Modified Files: Makefile Kconfig Added Files: starlet-malloc.c Log Message: - add io heap library based on the existing kernel remote heap Index: Makefile =================================================================== RCS file: /cvsroot/gc-linux/linux/arch/powerpc/platforms/embedded6xx/Makefile,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- Makefile 12 Apr 2008 17:31:33 -0000 1.4 +++ Makefile 2 Jul 2008 20:38:06 -0000 1.5 @@ -8,7 +8,7 @@ obj-$(CONFIG_FLIPPER_PIC) += flipper-pic.o obj-$(CONFIG_GAMECUBE) += gamecube.o gamecube_dev.o obj-$(CONFIG_WII) += wii.o wii_dev.o \ - starlet-ipc.o starlet-stm.o \ - starlet-es.o + starlet-ipc.o starlet-malloc.o \ + starlet-stm.o starlet-es.o obj-$(CONFIG_GAMECUBE_RSW) += gcn-rsw.o obj-$(CONFIG_USBGECKO_UDBG) += usbgecko_udbg.o --- NEW FILE: starlet-malloc.c --- /* * 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 * * 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. * */ /* * Notes from the trenches: * * writes from broadway to mem2 * - 8 or 16 bit writes to mem2 modify 64 bits * - writing 0xaa results in 0xaaffffffaaffffff being written * - writing 0xaabb results in 0xaabbffffaabbffff being written * - 32 bit writes work fine * writes from starlet to mem1 * - data must be 4 byte aligned, length must be 4 byte aligned * * write protected area (reads after writes do not return written info) * 0x13620000 - 0x14000000 * */ #define DEBUG #define DBG(fmt, arg...) pr_debug(fmt, ##arg) #include <linux/kernel.h> #include <linux/resource.h> #include <asm/starlet.h> #define LIB_MODULE_NAME "starlet-malloc" #define LIB_DESCRIPTION "Nintendo Wii starlet malloc library" #define LIB_AUTHOR "Albert Herranz" static char starlet_malloc_lib_version[] = "0.1i"; #define drv_printk(level, format, arg...) \ printk(level LIB_MODULE_NAME ": " format , ## arg) #define STARLET_IOH_ALIGN 31 /* * Simple aligned kzalloc and free. * * Based on the idea proposed by Satya Kiran Popuri * http://www.cs.uic.edu/~spopuri/amalloc.html */ /** * */ static void *kzalloc_aligned(size_t size, gfp_t flags, size_t align) { void *ptr, *aligned_ptr; size_t aligned_size; /* not a power of two */ if (align & (align - 1)) return NULL; /* worst case allocation size */ aligned_size = size + align - 1; /* add extra space to store allocation delta */ aligned_size += sizeof(size_t); /* allocate all space */ ptr = kzalloc(aligned_size, flags); if (!ptr) return NULL; /* calculate the aligned address, making room for the delta value */ aligned_ptr = PTR_ALIGN(ptr + sizeof(size_t), align); /* save the delta before the address returned to caller */ *((size_t *)aligned_ptr - 1) = aligned_ptr - ptr; return aligned_ptr; } static void kfree_aligned(void *aligned_ptr) { void *ptr; size_t delta; if (!aligned_ptr) return; /* retrieve extra allocation delta */ delta = *((size_t *)aligned_ptr - 1); /* calculate original allocation area start */ ptr = aligned_ptr - delta; kfree(ptr); } /** * */ void *starlet_kzalloc(size_t size, gfp_t flags) { return kzalloc_aligned(size, flags, STARLET_IPC_DMA_ALIGN+1); } /** * */ void starlet_kfree(void *ptr) { kfree_aligned(ptr); } /* * Functions for special input/output buffer allocations. * * Starlet seems to have a limitation when doing non-32 bit writes to MEM1. * This can cause up to a 3 byte data loss when starlet delivers * data of an unaligned size. * Writes to MEM2 don't have such a limitation. * * We use special buffers when we need to retrieve data of an unaligned size * from starlet. * */ static int starlet_ioh_init(struct starlet_ioh *ioh, struct resource *mem) { size_t size = mem->end - mem->start + 1; rh_info_t *rheap; int error = -ENOMEM; ioh->base = ioremap_flags(mem->start, size, _PAGE_GUARDED); if (!ioh->base) { drv_printk(KERN_ERR, "unable to ioremap ioh area\n"); goto err; } ioh->base_phys = mem->start; ioh->size = size; { void *first = NULL, *last = NULL; u32 *p; p = ioh->base + size; do { p--; *p = 0xdeadbabe; } while (p != ioh->base); __dma_sync(ioh->base, size, DMA_TO_DEVICE); p = ioh->base + size; do { p--; if (*p != 0xdeadbabe) { if (!last) last = p; first = p; } } while (p != ioh->base); if (first) drv_printk(KERN_INFO, "unreliable writes from" " %p to %p\n", first, last); } rheap = rh_create(STARLET_IOH_ALIGN+1); if (IS_ERR(rheap)) { error = PTR_ERR(rheap); goto err_rh_create; } ioh->rheap = rheap; error = rh_attach_region(rheap, 0, size); if (error) goto err_rh_attach_region; spin_lock_init(&ioh->lock); drv_printk(KERN_INFO, "ioh at 0x%08lx, mapped to 0x%p, size %uk\n", ioh->base_phys, ioh->base, ioh->size / 1024); return 0; err_rh_create: iounmap(ioh->base); err_rh_attach_region: rh_destroy(ioh->rheap); err: return error; } static struct starlet_ioh *starlet_ioh; /** * */ static struct starlet_ioh *starlet_ioh_get(void) { if (unlikely(!starlet_ioh)) drv_printk(KERN_ERR, "uninitialized ioh instance!\n"); return starlet_ioh; } unsigned long starlet_ioh_virt_to_phys(void *ptr) { struct starlet_ioh *ioh = starlet_ioh_get(); unsigned long offset; if (!ioh || !ptr) return 0; offset = ptr - ioh->base; return ioh->base_phys + offset; } /** * */ void *starlet_ioh_kzalloc_aligned(size_t size, size_t align) { struct starlet_ioh *ioh = starlet_ioh_get(); unsigned long offset; void *ptr; unsigned long flags; if (!ioh) return NULL; spin_lock_irqsave(&ioh->lock, flags); offset = rh_alloc_align(ioh->rheap, size, align, NULL); spin_unlock_irqrestore(&ioh->lock, flags); if (IS_ERR_VALUE(offset)) return NULL; ptr = ioh->base + offset; memset(ptr, 0, size); return ptr; } /** * */ void *starlet_ioh_kzalloc(size_t size) { return starlet_ioh_kzalloc_aligned(size, STARLET_IOH_ALIGN+1); } /** * */ void starlet_ioh_kfree(void *ptr) { struct starlet_ioh *ioh = starlet_ioh_get(); unsigned long offset; unsigned long flags; if (!ioh || !ptr) return; offset = ptr - ioh->base; spin_lock_irqsave(&ioh->lock, flags); rh_free(ioh->rheap, offset); spin_unlock_irqrestore(&ioh->lock, flags); } int starlet_ioh_dma_map_sg(struct device *dev, struct starlet_ioh_sg *sgl, int nents, enum dma_data_direction direction) { struct starlet_ioh_sg *sg; int i; BUG_ON(direction == DMA_NONE); starlet_ioh_for_each_sg(sgl, sg, nents, i) { if (!sg->buf || sg->len == 0) continue; __dma_sync(sg->buf, sg->len, direction); } return nents; } void starlet_ioh_dma_unmap_sg(struct device *dev, struct starlet_ioh_sg *sgl, int nents, enum dma_data_direction direction) { /* nothing to do */ } void starlet_ioh_sg_init_table(struct starlet_ioh_sg *sgl, unsigned int nents) { memset(sgl, 0, nents * sizeof(*sgl)); } /** * * @buf: must have been allocated using one of the starlet_ioh_* alloc * functions. */ void starlet_ioh_sg_set_buf(struct starlet_ioh_sg *sg, void *buf, size_t len) { struct starlet_ioh *ioh = starlet_ioh_get(); unsigned long offset; if (buf && len) { offset = buf - ioh->base; sg->buf = buf; sg->len = len; sg->dma_addr = ioh->base_phys + offset; } else { sg->buf = NULL; sg->len = 0; sg->dma_addr = 0; } } /** * */ int starlet_malloc_lib_bootstrap(struct resource *mem) { struct starlet_ioh *ioh; int error; if (starlet_ioh) { drv_printk(KERN_WARNING, "already bootstrapped\n"); return 0; } drv_printk(KERN_INFO, "%s - version %s\n", LIB_DESCRIPTION, starlet_malloc_lib_version); ioh = kzalloc(sizeof(*ioh), GFP_KERNEL); if (!ioh) { drv_printk(KERN_ERR, "failed to allocate ioh\n"); return -ENOMEM; } error = starlet_ioh_init(ioh, mem); if (error) kfree(ioh); else starlet_ioh = ioh; return error; } Index: Kconfig =================================================================== RCS file: /cvsroot/gc-linux/linux/arch/powerpc/platforms/embedded6xx/Kconfig,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- Kconfig 27 Mar 2008 22:35:24 -0000 1.3 +++ Kconfig 2 Jul 2008 20:38:06 -0000 1.4 @@ -60,6 +60,7 @@ depends on EMBEDDED6xx select GAMECUBE_COMMON select WANT_DEVICE_TREE + select PPC_LIB_RHEAP help Select WII if configuring for the Nintendo Wii. More information at: <http://gc-linux.sourceforge.net/> |
From: Albert H. <he...@us...> - 2008-07-02 20:36:59
|
Update of /cvsroot/gc-linux/linux/include/asm-powerpc In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv31297/include/asm-powerpc Modified Files: starlet.h Log Message: - rename functions: start_ios_* -> starlet_* - add io heap library based on the existing kernel remote heap Index: starlet.h =================================================================== RCS file: /cvsroot/gc-linux/linux/include/asm-powerpc/starlet.h,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- starlet.h 12 Apr 2008 17:22:29 -0000 1.4 +++ starlet.h 2 Jul 2008 20:37:05 -0000 1.5 @@ -17,23 +17,44 @@ #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/platform_device.h> #include <linux/scatterlist.h> +#include <linux/timer.h> +#include <asm/rheap.h> #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; + struct dma_pool *dma_pool; /* to allocate requests */ + struct starlet_ioh *ioh; /* to allocate special io buffers */ spinlock_t list_lock; struct list_head outstanding_list; @@ -41,11 +62,14 @@ 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; @@ -55,31 +79,31 @@ struct starlet_ipc_request { /* begin starlet firmware request format */ - u32 cmd; - s32 result; - union { + u32 cmd; /* 0x00 */ + s32 result; /* 0x04 */ + union { /* 0x08 */ s32 fd; u32 req_cmd; }; union { struct { - dma_addr_t pathname; - u32 mode; + dma_addr_t pathname; /* 0x0c */ + u32 mode; /* 0x10 */ } open; struct { - u32 request; - dma_addr_t ibuf; - u32 ilen; - dma_addr_t obuf; - u32 olen; + u32 request; /* 0x0c */ + dma_addr_t ibuf; /* 0x10 */ + u32 ilen; /* 0x14 */ + dma_addr_t obuf; /* 0x18 */ + u32 olen; /* 0x1c */ } ioctl; struct { - u32 request; - u32 argc_in; - u32 argc_out; - dma_addr_t iovec_da; + u32 request; /* 0x0c */ + u32 argc_in; /* 0x10 */ + u32 argc_io; /* 0x14 */ + dma_addr_t iovec_da; /* 0x18 */ } ioctlv; - u32 argv[5]; + u32 argv[5]; /* 0x0c,0x10,0x14,0x18,0x1c */ }; /* end starlet firmware request format */ @@ -89,14 +113,24 @@ struct starlet_iovec *iovec; size_t iovec_size; - struct scatterlist *sgl_in; unsigned sgl_nents_in; - struct scatterlist *sgl_out; - unsigned sgl_nents_out; + 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; @@ -104,47 +138,83 @@ -/* from starlet-ipc.c */ +/* 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 void *starlet_ipc_request_priv(struct starlet_ipc_request *req); + +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_ios_open(const char *pathname, int flags); -extern int starlet_ios_close(int fd); +extern int starlet_open(const char *pathname, int flags); +extern int starlet_close(int fd); -extern int starlet_ios_ioctl(int fd, int request, +extern int starlet_ioctl(int fd, int request, void *ibuf, size_t ilen, void *obuf, size_t olen); -extern int starlet_ios_ioctl_nowait(int fd, int request, +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 void starlet_ios_ioctl_complete(struct starlet_ipc_request *req); -extern int starlet_ios_ioctlv(int fd, int request, +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_ios_ioctlv_nowait(int fd, int request, +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_ios_ioctlv_and_reboot(int fd, int request, +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 void starlet_ios_ioctlv_complete(struct starlet_ipc_request *req); + +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 */ |
From: Albert H. <he...@us...> - 2008-07-02 20:36:15
|
Update of /cvsroot/gc-linux/linux/arch/powerpc/boot/dts In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv31033/arch/powerpc/boot/dts Modified Files: wii.dts Log Message: - add mem2 area for io heap - add device entry for starlet usb host controller - add command-line configuration examples - default to root fs over 2nd partition in front SD card Index: wii.dts =================================================================== RCS file: /cvsroot/gc-linux/linux/arch/powerpc/boot/dts/wii.dts,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- wii.dts 12 Apr 2008 17:37:52 -0000 1.5 +++ wii.dts 2 Jul 2008 20:36:22 -0000 1.6 @@ -19,7 +19,21 @@ #size-cells = <1>; chosen { - bootargs = "root=/dev/ram0 video=gcnfb:tv=auto ip=on force_keyboard_port=4"; + +/* + * ramdisk command-line example + */ +/* bootargs = "root=/dev/ram0 video=gcnfb:tv=NTSC ip=on force_keyboard_port=4"; */ + +/* + * nfsroot command-line example + */ +/* bootargs = "root=/dev/nfs nfsroot=192.168.001.253:/nfsroot/cube.etch ip=on video=gcnfb:tv=NTSC force_keyboard_port=4"; */ + +/* + * root filesystem on second partition of front SD card example + */ + bootargs = "root=/dev/rvlsda2 video=gcnfb:tv=NTSC force_keyboard_port=4 placeholder_for_additional_kernel_options_targetted_at_hexedit_lovers"; linux,crashkernel-base = <0>; linux,crashkernel-size = <0>; linux,stdout-path = "/exi@0d006800/usbgecko@0d006814"; @@ -61,7 +75,7 @@ /* MEM2 memory, discontiguous */ mem2 { compatible = "nintendo,hollywood-mem2"; - reg = <10000000 3400000>; /* 52M of MEM2 RAM */ + reg = <10000000 33e0000>; /* ~51.8M of MEM2 RAM */ }; /* External Interface bus */ @@ -89,7 +103,8 @@ compatible = "nintendo,hollywood"; clock-frequency = <e7be2c0>; /* 243MHz */ ranges = <0c000000 0c000000 00010000 - 0d000000 0d000000 00010000>; + 0d000000 0d000000 00010000 + 133e0000 133e0000 00020000>; video@0c002000 { compatible = "nintendo,hollywood-video"; @@ -117,7 +132,8 @@ starlet-ipc@0d000000 { compatible = "nintendo,starlet-ipc"; - reg = <0d000000 40>; + reg = <0d000000 40 /* IPC */ + 133e0000 20000>; /* MEM2 ioh 128K */ interrupts = <0e>; interrupt-parent = <&pic>; @@ -135,6 +151,10 @@ compatible = "nintendo,starlet-keyboard"; }; + starlet-hcd { + compatible = "nintendo,starlet-hcd"; + }; + serial@0d006400 { compatible = "nintendo,hollywood-serial"; reg = <0d006400 100>; |
From: Albert H. <he...@us...> - 2008-07-02 20:05:54
|
Update of /cvsroot/gc-linux/linux/drivers/usb/host In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv18855/drivers/usb/host Log Message: Directory /cvsroot/gc-linux/linux/drivers/usb/host added to the repository |
From: Albert H. <he...@us...> - 2008-07-02 19:23:22
|
Update of /cvsroot/gc-linux/linux/drivers/usb In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv2074/drivers/usb Log Message: Directory /cvsroot/gc-linux/linux/drivers/usb added to the repository |
From: Albert H. <he...@us...> - 2008-04-12 17:37:47
|
Update of /cvsroot/gc-linux/linux/arch/powerpc/boot/dts In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv20655/arch/powerpc/boot/dts Modified Files: wii.dts Log Message: Added 'starlet-es' and 'starlet-keyboard' devices to the dts. Index: wii.dts =================================================================== RCS file: /cvsroot/gc-linux/linux/arch/powerpc/boot/dts/wii.dts,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- wii.dts 4 Apr 2008 19:41:44 -0000 1.4 +++ wii.dts 12 Apr 2008 17:37:52 -0000 1.5 @@ -123,10 +123,18 @@ }; + starlet-es { + compatible = "nintendo,starlet-es"; + }; + starlet-sd { compatible = "nintendo,starlet-sd"; }; + starlet-keyboard { + compatible = "nintendo,starlet-keyboard"; + }; + serial@0d006400 { compatible = "nintendo,hollywood-serial"; reg = <0d006400 100>; |
From: Albert H. <he...@us...> - 2008-04-12 17:33:59
|
Update of /cvsroot/gc-linux/linux/arch/powerpc/configs In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv19080/arch/powerpc/configs Modified Files: wii_defconfig Log Message: Added 'rvl-stkbd' driver supporting USB keyboards through IOS. Index: wii_defconfig =================================================================== RCS file: /cvsroot/gc-linux/linux/arch/powerpc/configs/wii_defconfig,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- wii_defconfig 4 Apr 2008 19:41:44 -0000 1.4 +++ wii_defconfig 12 Apr 2008 17:34:03 -0000 1.5 @@ -1,7 +1,7 @@ # # Automatically generated make config: don't edit # Linux kernel version: 2.6.24 -# Sun Mar 30 20:03:57 2008 +# Wed Apr 9 19:50:51 2008 # # CONFIG_PPC64 is not set @@ -432,6 +432,7 @@ # CONFIG_KEYBOARD_XTKBD is not set # CONFIG_KEYBOARD_NEWTON is not set # CONFIG_KEYBOARD_STOWAWAY is not set +CONFIG_KEYBOARD_WII=y # CONFIG_INPUT_MOUSE is not set CONFIG_INPUT_JOYSTICK=y # CONFIG_JOYSTICK_ANALOG is not set |
From: Albert H. <he...@us...> - 2008-04-12 17:33:59
|
Update of /cvsroot/gc-linux/linux/drivers/input/keyboard In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv19080/drivers/input/keyboard Added Files: Kconfig Makefile rvl-stkbd.c Log Message: Added 'rvl-stkbd' driver supporting USB keyboards through IOS. --- NEW FILE: Makefile --- # # Makefile for the input core drivers. # # Each configuration option enables a list of files. obj-$(CONFIG_KEYBOARD_ATKBD) += atkbd.o obj-$(CONFIG_KEYBOARD_SUNKBD) += sunkbd.o obj-$(CONFIG_KEYBOARD_LKKBD) += lkkbd.o obj-$(CONFIG_KEYBOARD_XTKBD) += xtkbd.o obj-$(CONFIG_KEYBOARD_AMIGA) += amikbd.o obj-$(CONFIG_KEYBOARD_ATARI) += atakbd.o obj-$(CONFIG_KEYBOARD_LOCOMO) += locomokbd.o obj-$(CONFIG_KEYBOARD_NEWTON) += newtonkbd.o obj-$(CONFIG_KEYBOARD_STOWAWAY) += stowaway.o obj-$(CONFIG_KEYBOARD_CORGI) += corgikbd.o obj-$(CONFIG_KEYBOARD_SPITZ) += spitzkbd.o obj-$(CONFIG_KEYBOARD_HIL) += hil_kbd.o obj-$(CONFIG_KEYBOARD_HIL_OLD) += hilkbd.o obj-$(CONFIG_KEYBOARD_OMAP) += omap-keypad.o obj-$(CONFIG_KEYBOARD_PXA27x) += pxa27x_keyboard.o obj-$(CONFIG_KEYBOARD_AAED2000) += aaed2000_kbd.o obj-$(CONFIG_KEYBOARD_GPIO) += gpio_keys.o obj-$(CONFIG_KEYBOARD_HP6XX) += jornada680_kbd.o obj-$(CONFIG_KEYBOARD_HP7XX) += jornada720_kbd.o obj-$(CONFIG_KEYBOARD_MAPLE) += maple_keyb.o obj-$(CONFIG_KEYBOARD_BFIN) += bf54x-keys.o obj-$(CONFIG_KEYBOARD_WII) += rvl-stkbd.o --- NEW FILE: Kconfig --- # # Input core configuration # menuconfig INPUT_KEYBOARD bool "Keyboards" if EMBEDDED || !X86 default y help Say Y here, and a list of supported keyboards will be displayed. This option doesn't affect the kernel. If unsure, say Y. if INPUT_KEYBOARD config KEYBOARD_ATKBD tristate "AT keyboard" if EMBEDDED || !X86_PC default y select SERIO select SERIO_LIBPS2 select SERIO_I8042 if X86_PC select SERIO_GSCPS2 if GSC help Say Y here if you want to use a standard AT or PS/2 keyboard. Usually you'll need this, unless you have a different type keyboard (USB, ADB or other). This also works for AT and PS/2 keyboards connected over a PS/2 to serial converter. If unsure, say Y. To compile this driver as a module, choose M here: the module will be called atkbd. config KEYBOARD_ATKBD_HP_KEYCODES bool "Use HP keyboard scancodes" depends on PARISC && KEYBOARD_ATKBD default y help Say Y here if you have a PA-RISC machine and want to use an AT or PS/2 keyboard, and your keyboard uses keycodes that are specific to PA-RISC keyboards. Say N if you use a standard keyboard. config KEYBOARD_ATKBD_RDI_KEYCODES bool "Use PrecisionBook keyboard scancodes" depends on KEYBOARD_ATKBD_HP_KEYCODES default n help If you have an RDI PrecisionBook, say Y here if you want to use its built-in keyboard (as opposed to an external keyboard). The PrecisionBook has five keys that conflict with those used by most AT and PS/2 keyboards. These are as follows: PrecisionBook Standard AT or PS/2 F1 F12 Left Ctrl Left Alt Caps Lock Left Ctrl Right Ctrl Caps Lock Left 102nd key (the key to the right of Left Shift) If you say N here, and use the PrecisionBook keyboard, then each key in the left-hand column will be interpreted as the corresponding key in the right-hand column. If you say Y here, and use an external keyboard, then each key in the right-hand column will be interpreted as the key shown in the left-hand column. config KEYBOARD_SUNKBD tristate "Sun Type 4 and Type 5 keyboard" select SERIO help Say Y here if you want to use a Sun Type 4 or Type 5 keyboard, connected either to the Sun keyboard connector or to an serial (RS-232) port via a simple adapter. To compile this driver as a module, choose M here: the module will be called sunkbd. config KEYBOARD_LKKBD tristate "DECstation/VAXstation LK201/LK401 keyboard" select SERIO help Say Y here if you want to use a LK201 or LK401 style serial keyboard. This keyboard is also useable on PCs if you attach it with the inputattach program. The connector pinout is described within lkkbd.c. To compile this driver as a module, choose M here: the module will be called lkkbd. config KEYBOARD_LOCOMO tristate "LoCoMo Keyboard Support" depends on SHARP_LOCOMO && INPUT_KEYBOARD help Say Y here if you are running Linux on a Sharp Zaurus Collie or Poodle based PDA To compile this driver as a module, choose M here: the module will be called locomokbd. config KEYBOARD_XTKBD tristate "XT keyboard" select SERIO help Say Y here if you want to use the old IBM PC/XT keyboard (or compatible) on your system. This is only possible with a parallel port keyboard adapter, you cannot connect it to the keyboard port on a PC that runs Linux. To compile this driver as a module, choose M here: the module will be called xtkbd. config KEYBOARD_NEWTON tristate "Newton keyboard" select SERIO help Say Y here if you have a Newton keyboard on a serial port. To compile this driver as a module, choose M here: the module will be called newtonkbd. config KEYBOARD_STOWAWAY tristate "Stowaway keyboard" select SERIO help Say Y here if you have a Stowaway keyboard on a serial port. Stowaway compatible keyboards like Dicota Input-PDA keyboard are also supported by this driver. To compile this driver as a module, choose M here: the module will be called stowaway. config KEYBOARD_CORGI tristate "Corgi keyboard" depends on PXA_SHARPSL default y help Say Y here to enable the keyboard on the Sharp Zaurus SL-C7xx series of PDAs. To compile this driver as a module, choose M here: the module will be called corgikbd. config KEYBOARD_SPITZ tristate "Spitz keyboard" depends on PXA_SHARPSL default y help Say Y here to enable the keyboard on the Sharp Zaurus SL-C1000, SL-C3000 and Sl-C3100 series of PDAs. To compile this driver as a module, choose M here: the module will be called spitzkbd. config KEYBOARD_AMIGA tristate "Amiga keyboard" depends on AMIGA help Say Y here if you are running Linux on any AMIGA and have a keyboard attached. To compile this driver as a module, choose M here: the module will be called amikbd. config ATARI_KBD_CORE bool config KEYBOARD_ATARI tristate "Atari keyboard" depends on ATARI select ATARI_KBD_CORE help Say Y here if you are running Linux on any Atari and have a keyboard attached. To compile this driver as a module, choose M here: the module will be called atakbd. config KEYBOARD_HIL_OLD tristate "HP HIL keyboard support (simple driver)" depends on GSC || HP300 default y help The "Human Interface Loop" is a older, 8-channel USB-like controller used in several Hewlett Packard models. This driver was adapted from the one written for m68k/hp300, and implements support for a keyboard attached to the HIL port, but not for any other types of HIL input devices like mice or tablets. However, it has been thoroughly tested and is stable. If you want full HIL support including support for multiple keyboards, mice, and tablets, you have to enable the "HP System Device Controller i8042 Support" in the input/serio submenu. config KEYBOARD_HIL tristate "HP HIL keyboard support" depends on GSC || HP300 default y select HP_SDC select HIL_MLC select SERIO help The "Human Interface Loop" is a older, 8-channel USB-like controller used in several Hewlett Packard models. This driver implements support for HIL-keyboards attached to your machine, so normally you should say Y here. config KEYBOARD_HP6XX tristate "HP Jornada 6xx keyboard" depends on SH_HP6XX select INPUT_POLLDEV help Say Y here if you have a HP Jornada 620/660/680/690 and want to support the built-in keyboard. To compile this driver as a module, choose M here: the module will be called jornada680_kbd. config KEYBOARD_HP7XX tristate "HP Jornada 7xx keyboard" depends on SA1100_JORNADA720_SSP && SA1100_SSP help Say Y here if you have a HP Jornada 710/720/728 and want to support the built-in keyboard. To compile this driver as a module, choose M here: the module will be called jornada720_kbd. config KEYBOARD_OMAP tristate "TI OMAP keypad support" depends on (ARCH_OMAP1 || ARCH_OMAP2) help Say Y here if you want to use the OMAP keypad. To compile this driver as a module, choose M here: the module will be called omap-keypad. config KEYBOARD_PXA27x tristate "PXA27x keyboard support" depends on PXA27x help Enable support for PXA27x matrix keyboard controller To compile this driver as a module, choose M here: the module will be called pxa27x_keyboard. config KEYBOARD_AAED2000 tristate "AAED-2000 keyboard" depends on MACH_AAED2000 select INPUT_POLLDEV default y help Say Y here to enable the keyboard on the Agilent AAED-2000 development board. To compile this driver as a module, choose M here: the module will be called aaed2000_kbd. config KEYBOARD_GPIO tristate "GPIO Buttons" depends on GENERIC_GPIO help This driver implements support for buttons connected to GPIO pins of various CPUs (and some other chips). Say Y here if your device has buttons connected directly to such GPIO pins. Your board-specific setup logic must also provide a platform device, with configuration data saying which GPIOs are used. To compile this driver as a module, choose M here: the module will be called gpio-keys. config KEYBOARD_MAPLE tristate "Maple bus keyboard" depends on SH_DREAMCAST && MAPLE help Say Y here if you have a Dreamcast console running Linux and have a keyboard attached to its Maple bus. To compile this driver as a module, choose M here: the module will be called maple_keyb. config KEYBOARD_BFIN tristate "Blackfin BF54x keypad support" depends on (BF54x && !BF544) help Say Y here if you want to use the BF54x keypad. To compile this driver as a module, choose M here: the module will be called bf54x-keys. config KEYBOARD_WII tristate "Nintendo Wii USB keyboard IOS glue" depends on WII help Say Y here if you have a Nintendo Wii console running Linux and have a keyboard attached to one of its USB ports. This driver uses the IOS interface glue to access the USB keyboard. To compile this driver as a module, choose M here: the module will be called rvl-stkbd. endif --- NEW FILE: rvl-stkbd.c --- /* * drivers/input/keyboard/rvl-stkbd.c * * Nintendo Wii starlet keyboard driver. * 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. * */ /* * NOTES: * The keyboard driver requires at least IOS30 installed. * LED support is pending. */ #define DEBUG #define DBG(fmt, arg...) pr_debug(fmt, ##arg) #include <linux/init.h> #include <linux/input.h> #include <linux/kernel.h> #include <linux/kthread.h> #include <linux/module.h> #include <linux/of_platform.h> #include <asm/starlet.h> #define DRV_MODULE_NAME "rvl-stkbd" #define DRV_DESCRIPTION "Nintendo Wii starlet keyboard driver" #define DRV_AUTHOR "Albert Herranz" static char stkbd_driver_version[] = "0.1i"; #define drv_printk(level, format, arg...) \ printk(level DRV_MODULE_NAME ": " format , ## arg) /* * Keyboard events from IOS. */ #define STKBD_EV_CONNECT 0x00000000 #define STKBD_EV_DISCONNECT 0x00000001 #define STKBD_EV_REPORT 0x00000002 struct stkbd_event { u32 type; u32 _unk1; union { struct { u8 modifiers; u8 reserved; u8 keys[6]; } report; u8 raw_report[8]; }; } __attribute__((packed)); /* * Keyboard device. */ enum { __STKBD_RUNNING=1, /* device is opened and running */ __STKBD_WAITING_REPORT /* waiting for IOS report */ }; struct stkbd_keyboard { int fd; struct stkbd_event *event; u8 old_raw_report[8]; unsigned long flags; #define STKBD_RUNNING (1 << __STKBD_RUNNING) #define STKBD_WAITING_REPORT (1 << __STKBD_WAITING_REPORT) char name[32]; struct input_dev *idev; unsigned int usage; struct device *dev; }; /* device path in IOS for the USB keyboard */ static char stkbd_dev_path[] = "/dev/usb/kbd"; /* * Keycodes are standard USB keyboard HID keycodes. * We use the same table as in drivers/hid/usbhid/usbkbd.c. */ #define NR_SCANCODES 256 static unsigned char stkbd_keycode[NR_SCANCODES] = { /*000*/ KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, /*004*/ KEY_A, KEY_B, KEY_C, KEY_D, /*008*/ KEY_E, KEY_F, KEY_G, KEY_H, /*012*/ KEY_I, KEY_J, KEY_K, KEY_L, /*016*/ KEY_M, KEY_N, KEY_O, KEY_P, /*020*/ KEY_Q, KEY_R, KEY_S, KEY_T, /*024*/ KEY_U, KEY_V, KEY_W, KEY_X, /*028*/ KEY_Y, KEY_Z, KEY_1, KEY_2, /*032*/ KEY_3, KEY_4, KEY_5, KEY_6, /*036*/ KEY_7, KEY_8, KEY_9, KEY_0, /*040*/ KEY_ENTER, KEY_ESC, KEY_BACKSPACE, KEY_TAB, /*044*/ KEY_SPACE, KEY_MINUS, KEY_EQUAL, KEY_LEFTBRACE, /*048*/ KEY_RIGHTBRACE, KEY_BACKSLASH, KEY_BACKSLASH, KEY_SEMICOLON, /*052*/ KEY_APOSTROPHE, KEY_GRAVE, KEY_COMMA, KEY_DOT, /*056*/ KEY_SLASH, KEY_CAPSLOCK, KEY_F1, KEY_F2, /*060*/ KEY_F3, KEY_F4, KEY_F5, KEY_F6, /*064*/ KEY_F7, KEY_F8, KEY_F9, KEY_F10, /*068*/ KEY_F11, KEY_F12, KEY_SYSRQ, KEY_SCROLLLOCK, /*072*/ KEY_PAUSE, KEY_INSERT, KEY_HOME, KEY_PAGEUP, /*076*/ KEY_DELETE, KEY_END, KEY_PAGEDOWN, KEY_RIGHT, /*080*/ KEY_LEFT, KEY_DOWN, KEY_UP, KEY_NUMLOCK, /*084*/ KEY_KPSLASH, KEY_KPASTERISK, KEY_KPMINUS, KEY_KPPLUS, /*088*/ KEY_KPENTER, KEY_KP1, KEY_KP2, KEY_KP3, /*092*/ KEY_KP4, KEY_KP5, KEY_KP6, KEY_KP7, /*096*/ KEY_KP8, KEY_KP9, KEY_KP0, KEY_KPDOT, /*100*/ KEY_102ND, KEY_COMPOSE, KEY_POWER, KEY_KPEQUAL, /*104*/ KEY_F13, KEY_F14, KEY_F15, KEY_F16, /*108*/ KEY_F17, KEY_F18, KEY_F19, KEY_F20, /*112*/ KEY_F21, KEY_F22, KEY_F23, KEY_F24, /*116*/ KEY_OPEN, KEY_HELP, KEY_PROPS, KEY_FRONT, /*120*/ KEY_STOP, KEY_AGAIN, KEY_UNDO, KEY_CUT, /*124*/ KEY_COPY, KEY_PASTE, KEY_FIND, KEY_MUTE, /*128*/ KEY_VOLUMEUP, KEY_VOLUMEDOWN, KEY_RESERVED, KEY_RESERVED, /*132*/ KEY_RESERVED, KEY_KPCOMMA, KEY_RESERVED, KEY_RO, /*136*/ KEY_KATAKANAHIRAGANA, KEY_YEN, KEY_HENKAN, KEY_MUHENKAN, /*140*/ KEY_KPJPCOMMA, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, /*144*/ KEY_HANGEUL, KEY_HANJA, KEY_KATAKANA, KEY_HIRAGANA, /*148*/ KEY_ZENKAKUHANKAKU, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, /*152*/ KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, /*156*/ KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, /*160*/ KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, /*164*/ KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, /*168*/ KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, /*172*/ KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, /*176*/ KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, /*180*/ KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, /*184*/ KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, /*188*/ KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, /*192*/ KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, /*196*/ KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, /*200*/ KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, /*204*/ KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, /*208*/ KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, /*212*/ KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, /*216*/ KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, /*220*/ KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, /*224*/ KEY_LEFTCTRL, KEY_LEFTSHIFT, KEY_LEFTALT, KEY_LEFTMETA, /*228*/ KEY_RIGHTCTRL, KEY_RIGHTSHIFT, KEY_RIGHTALT, KEY_RIGHTMETA, /*232*/ KEY_PLAYPAUSE, KEY_STOPCD, KEY_PREVIOUSSONG, KEY_NEXTSONG, /*236*/ KEY_EJECTCD, KEY_VOLUMEUP, KEY_VOLUMEDOWN, KEY_MUTE, /*240*/ KEY_WWW, KEY_BACK, KEY_FORWARD, KEY_STOP, /*244*/ KEY_FIND, KEY_SCROLLUP, KEY_SCROLLDOWN, KEY_EDIT, /*248*/ KEY_SLEEP, KEY_SCROLLLOCK, KEY_REFRESH, KEY_CALC, /*252*/ KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, }; static int stkbd_wait_for_events(struct stkbd_keyboard *kbd); static void stkbd_dispatch_report(struct stkbd_keyboard *kbd) { struct stkbd_event *event = kbd->event; u8 *new = event->raw_report; u8 *old = kbd->old_raw_report; int i; /* * The report is a standard USB HID report for a keyboard. * Modifiers come in byte 0 as variable data and map to * positions 224-231 of the USB HID keyboard/keypad page. */ for (i = 0; i < 8; i++) input_report_key(kbd->idev, stkbd_keycode[i + 224], (new[0] >> i) & 1); /* * Byte 1 is reserved and ignored here. * Bytes 2 to 7 contain the indexes of up to 6 keys pressed. * A value of 01 for an index means "Keyboard ErrorRollOver" and is * reported when the keyboard is in error (for example, when too * many keys are simultaneously pressed). * Index values less than or equal to 03 can be safely ignored. */ for (i = 2; i < 8; i++) { /* released keys are old indexes not found in new array */ if (old[i] > 3 && memscan(new + 2, old[i], 6) == new + 8) { if (stkbd_keycode[old[i]]) input_report_key(kbd->idev, stkbd_keycode[old[i]], 0); else drv_printk(KERN_WARNING, "unknown key" " (scancode %#x) released.", old[i]); } /* pressed keys are new indexes not found in old array */ if (new[i] > 3 && memscan(old + 2, new[i], 6) == old + 8) { if (stkbd_keycode[new[i]]) input_report_key(kbd->idev, stkbd_keycode[new[i]], 1); else drv_printk(KERN_WARNING, "unknown key" " (scancode %#x) pressed.", new[i]); } } input_sync(kbd->idev); memcpy(old, new, 8); } static int stkbd_dispatch_ipc_request(struct starlet_ipc_request *req) { struct stkbd_keyboard *kbd; struct stkbd_event *event; int error; /* complete and free the ipc request, retrieving our data first */ starlet_ios_ioctl_complete(req); kbd = req->done_data; error = req->result; starlet_ipc_free_request(req); clear_bit(__STKBD_WAITING_REPORT, &kbd->flags); if (kbd->fd == -1) return -ENODEV; if (error) { DBG("%s: error=%d (%x)\n", __func__, error, error); } else { event = kbd->event; switch(event->type) { case STKBD_EV_CONNECT: drv_printk(KERN_INFO, "keyboard connected\n"); break; case STKBD_EV_DISCONNECT: drv_printk(KERN_INFO, "keyboard disconnected\n"); break; case STKBD_EV_REPORT: if (test_bit(__STKBD_RUNNING, &kbd->flags)) stkbd_dispatch_report(kbd); break; } error = stkbd_wait_for_events(kbd); } return error; } static int stkbd_wait_for_events(struct stkbd_keyboard *kbd) { struct stkbd_event *event = kbd->event; int error = 0; if (!test_and_set_bit(__STKBD_WAITING_REPORT, &kbd->flags)) { error = starlet_ios_ioctl_nowait(kbd->fd, 0, NULL, 0, event, sizeof(*event), stkbd_dispatch_ipc_request, kbd); if (error) drv_printk(KERN_ERR, "ioctl error %d (%04x)\n", error, error); } return error; } /* * Input driver hooks. * */ static DEFINE_MUTEX(open_lock); static int stkbd_open(struct input_dev *idev) { struct stkbd_keyboard *kbd = input_get_drvdata(idev); int error = 0; if (!kbd) return -ENODEV; mutex_lock(&open_lock); kbd->usage++; set_bit(__STKBD_RUNNING, &kbd->flags); mutex_unlock(&open_lock); return error; } static void stkbd_close(struct input_dev *idev) { struct stkbd_keyboard *kbd = input_get_drvdata(idev); if (!kbd) return; mutex_lock(&open_lock); kbd->usage--; if (kbd->usage == 0) clear_bit(__STKBD_RUNNING, &kbd->flags); mutex_unlock(&open_lock); } static void stkbd_setup_keyboard(struct input_dev *idev) { int i; set_bit(EV_KEY, idev->evbit); set_bit(EV_REP, idev->evbit); for (i = 0; i < 255; ++i) set_bit(stkbd_keycode[i], idev->keybit); clear_bit(0, idev->keybit); } static int stkbd_init_input_dev(struct stkbd_keyboard *kbd) { struct input_dev *idev; int error; idev = input_allocate_device(); if (!idev) { drv_printk(KERN_ERR, "failed to allocate input_dev\n"); return -ENOMEM; } idev->dev.parent = kbd->dev; strcpy(kbd->name, "USB keyboard"); idev->name = kbd->name; input_set_drvdata(idev, kbd); kbd->idev = idev; stkbd_setup_keyboard(idev); idev->open = stkbd_open; idev->close = stkbd_close; error = input_register_device(kbd->idev); if (error) { input_free_device(kbd->idev); return error; } return 0; } static void stkbd_exit_input_dev(struct stkbd_keyboard *kbd) { input_free_device(kbd->idev); } /* * Setup routines. * */ static int stkbd_init(struct stkbd_keyboard *kbd) { struct stkbd_event *event; int error; event = starlet_kzalloc(sizeof(*event), GFP_KERNEL); if (!event) { drv_printk(KERN_ERR, "failed to allocate stkbd_event\n"); error = -ENOMEM; goto err; } kbd->event = event; kbd->fd = starlet_ios_open(stkbd_dev_path, 0); if (kbd->fd < 0) { drv_printk(KERN_ERR, "unable to open device %s\n", stkbd_dev_path); error = kbd->fd; goto err_event; } error = stkbd_init_input_dev(kbd); if (error) goto err_fd; /* start to grab events from the keyboard */ error = stkbd_wait_for_events(kbd); if (error) goto err_input_dev; return 0; err_input_dev: stkbd_exit_input_dev(kbd); err_fd: starlet_ios_close(kbd->fd); err_event: starlet_kfree(event); err: return error; } static void stkbd_exit(struct stkbd_keyboard *kbd) { stkbd_exit_input_dev(kbd); starlet_ios_close(kbd->fd); starlet_kfree(kbd->event); } /* * Driver model helper routines. * */ static int stkbd_do_probe(struct device *dev) { struct stkbd_keyboard *kbd; int error; kbd = kzalloc(sizeof(*kbd), GFP_KERNEL); if (!kbd) { drv_printk(KERN_ERR, "failed to allocate stkbd_keyboard\n"); return -ENOMEM; } dev_set_drvdata(dev, kbd); kbd->dev = dev; error = stkbd_init(kbd); if (error) { dev_set_drvdata(dev, NULL); kfree(kbd); } return error; } static int stkbd_do_remove(struct device *dev) { struct stkbd_keyboard *kbd = dev_get_drvdata(dev); if (kbd) { stkbd_exit(kbd); dev_set_drvdata(dev, NULL); kfree(kbd); return 0; } return -ENODEV; } /* * OF platform driver hooks. * */ static int __init stkbd_of_probe(struct of_device *odev, const struct of_device_id *match) { return stkbd_do_probe(&odev->dev); } static int __exit stkbd_of_remove(struct of_device *odev) { return stkbd_do_remove(&odev->dev); } static struct of_device_id stkbd_of_match[] = { { .compatible = "nintendo,starlet-keyboard" }, { }, }; MODULE_DEVICE_TABLE(of, stkbd_of_match); static struct of_platform_driver stkbd_of_driver = { .owner = THIS_MODULE, .name = DRV_MODULE_NAME, .match_table = stkbd_of_match, .probe = stkbd_of_probe, .remove = stkbd_of_remove, }; /* * Module interface hooks. * */ static int __init stkbd_init_module(void) { drv_printk(KERN_INFO, "%s - version %s\n", DRV_DESCRIPTION, stkbd_driver_version); return of_register_platform_driver(&stkbd_of_driver); } static void __exit stkbd_exit_module(void) { of_unregister_platform_driver(&stkbd_of_driver); } module_init(stkbd_init_module); module_exit(stkbd_exit_module); MODULE_DESCRIPTION(DRV_DESCRIPTION); MODULE_AUTHOR(DRV_AUTHOR); MODULE_LICENSE("GPL"); |
From: Albert H. <he...@us...> - 2008-04-12 17:32:45
|
Update of /cvsroot/gc-linux/linux/drivers/block In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv18366/drivers/block Modified Files: rvl-stsd.c Log Message: Use GFP_ATOMIC for request allocations during hardware register io. Use GFP_NOIO for command/reply allocations during block io. Properly size the small buffer to avoid discarding data located near the small buffer during cache invalidation operations. The small buffer is now at least a cache line long. Index: rvl-stsd.c =================================================================== RCS file: /cvsroot/gc-linux/linux/drivers/block/rvl-stsd.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- rvl-stsd.c 4 Apr 2008 19:30:40 -0000 1.1 +++ rvl-stsd.c 12 Apr 2008 17:32:50 -0000 1.2 @@ -649,7 +649,7 @@ /* * REVISIT maybe use a dma pool or small buffer for query data */ - query = starlet_kzalloc(sizeof(*query), GFP_KERNEL); + query = starlet_kzalloc(sizeof(*query), GFP_ATOMIC); if (!query) return -ENOMEM; @@ -683,7 +683,7 @@ * */ -static u32 stsd_small_buf[1] +static u32 stsd_small_buf[L1_CACHE_BYTES / sizeof(u32)] __attribute__ ((aligned(STARLET_IPC_DMA_ALIGN + 1))); static const size_t stsd_small_buf_size = sizeof(stsd_small_buf_size); static DEFINE_MUTEX(stsd_small_buf_lock); @@ -693,9 +693,11 @@ u32 *buf; if (!mutex_trylock(&stsd_small_buf_lock)) - buf = starlet_kzalloc(stsd_small_buf_size, GFP_KERNEL); - else + buf = starlet_kzalloc(stsd_small_buf_size, GFP_NOIO); + else { + memset(stsd_small_buf, 0, stsd_small_buf_size); buf = stsd_small_buf; + } return buf; } @@ -938,11 +940,11 @@ if (buf_len > reply_len) return -EINVAL; - cmd = starlet_kzalloc(sizeof(*cmd), GFP_KERNEL); + cmd = starlet_kzalloc(sizeof(*cmd), GFP_NOIO); if (!cmd) return -ENOMEM; - reply = starlet_kzalloc(reply_len, GFP_KERNEL); + reply = starlet_kzalloc(reply_len, GFP_NOIO); if (!reply) { starlet_kfree(cmd); return -ENOMEM; |
From: Albert H. <he...@us...> - 2008-04-12 17:31:28
|
Update of /cvsroot/gc-linux/linux/arch/powerpc/platforms/embedded6xx In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv17922/arch/powerpc/platforms/embedded6xx Modified Files: Makefile Added Files: starlet-es.c Log Message: Added driver 'starlet-es' to talk to the IOS ES (Encryption Services?) module. The driver is basically designed to allow launching a different IOS version. This is needed by the new keyboard driver which requires IOS30 but runs under IOS9 when launched through the tphack. --- NEW FILE: starlet-es.c --- /* * arch/powerpc/platforms/embedded6xx/starlet-es.c * * Nintendo Wii starlet ES routines * 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. * */ #define DEBUG #include <linux/kernel.h> #include <linux/of_platform.h> #include <linux/scatterlist.h> #include <asm/starlet.h> #define DRV_MODULE_NAME "starlet-es" #define DRV_DESCRIPTION "Nintendo Wii starlet ES driver" #define DRV_AUTHOR "Albert Herranz" static const char starlet_es_driver_version[] = "0.1i"; #define DBG(fmt, arg...) pr_debug(fmt, ##arg) #define drv_printk(level, format, arg...) \ printk(level DRV_MODULE_NAME ": " format , ## arg) struct starlet_es_device { int fd; struct device *dev; }; struct starlet_es_ticket_limit { u32 tag; u32 value; } __attribute__((packed)); struct starlet_es_ticket_view { u32 view; u64 ticketid; u32 devicetype; u64 title; u16 access_mask; u8 reserved[0x3c]; u8 cidx_mask[0x40]; u16 padding; struct starlet_es_ticket_limit limits[8]; } __attribute__((packed)); #if 0 struct starlet_es_ticket { char issuer[0x40]; u8 fill[63]; //TODO: not really fill u8 title_key[16]; u8 fill2; u64 ticketid; u32 devicetype; u64 title; u16 access_mask; u8 reserved[0x3c]; u8 cidx_mask[0x40]; u16 padding; struct starlet_es_ticket_limit limits[8]; } __attribute__((packed)); #endif /* * /dev/es * */ #define ES_IOCTLV_LAUNCHTITLE 0x08 #define ES_IOCTLV_GETTITLECOUNT 0x0e #define ES_IOCTLV_GETTITLES 0x0f #define ES_IOCTLV_GETTICKETVIEWCOUNT 0x12 #define ES_IOCTLV_GETTICKETVIEWS 0x13 static const char dev_es[] = "/dev/es"; /* * Handy small buffer routines. * We use a small static aligned buffer to avoid allocations for short-lived * operations involving 1 to 4 byte data transfers to/from IOS. * */ static u32 es_small_buf[L1_CACHE_BYTES / sizeof(u32)] __attribute__ ((aligned(STARLET_IPC_DMA_ALIGN + 1))); static const size_t es_small_buf_size = sizeof(es_small_buf_size); static DEFINE_MUTEX(es_small_buf_lock); static u32 *es_small_buf_get(void) { u32 *buf; if (!mutex_trylock(&es_small_buf_lock)) buf = starlet_kzalloc(es_small_buf_size, GFP_KERNEL); else { memset(es_small_buf, 0, es_small_buf_size); buf = es_small_buf; } return buf; } static void es_small_buf_put(u32 *buf) { if (buf == es_small_buf) mutex_unlock(&es_small_buf_lock); else starlet_kfree(buf); } #if 0 static void es_small_buf_dump(void) { int i; 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++) drv_printk(KERN_INFO, "%08x, ", es_small_buf[i]); drv_printk(KERN_INFO, "\n}\n"); } #endif /* * * */ static struct starlet_es_device *starlet_es_device_instance; /** * */ struct starlet_es_device *starlet_es_get_device(void) { if (!starlet_es_device_instance) drv_printk(KERN_ERR, "uninitialized device instance!\n"); return starlet_es_device_instance; } EXPORT_SYMBOL_GPL(starlet_es_get_device); /** * */ int starlet_es_get_title_count(unsigned long *count) { struct starlet_es_device *es_dev = starlet_es_get_device(); struct scatterlist out[1]; u32 *count_buf; int error; if (!es_dev) return -ENODEV; count_buf = es_small_buf_get(); if (!count_buf) return -ENOMEM; *count_buf = 0; sg_init_table(out, 1); sg_set_buf(out, count_buf, sizeof(*count_buf)); error = starlet_ios_ioctlv(es_dev->fd, ES_IOCTLV_GETTITLECOUNT, 0, NULL, 1, out); if (error) { DBG("%s: error=%d (%08x)\n", __func__, error, error); } else { *count = *count_buf; } es_small_buf_put(count_buf); return error; } /** * */ int starlet_es_get_titles(u64 *titles, unsigned long count) { struct starlet_es_device *es_dev = starlet_es_get_device(); struct scatterlist in[1], out[1]; u32 *count_buf; int error; if (!es_dev) return -ENODEV; count_buf = es_small_buf_get(); if (!count_buf) return -ENOMEM; *count_buf = count; sg_init_table(in, 1); sg_set_buf(in, count_buf, sizeof(*count_buf)); sg_init_table(out, 1); sg_set_buf(out, titles, sizeof(*titles)*count); error = starlet_ios_ioctlv(es_dev->fd, ES_IOCTLV_GETTITLES, 1, in, 1, out); if (error) { DBG("%s: error=%d (%08x)\n", __func__, error, error); } es_small_buf_put(count_buf); return error; } /** * */ int starlet_es_get_ticket_view_count(u64 title, unsigned long *count) { struct starlet_es_device *es_dev = starlet_es_get_device(); struct scatterlist in[1], out[1]; u64 *title_buf; u32 *count_buf; int error; if (!es_dev) return -ENODEV; title_buf = starlet_kzalloc(sizeof(*title_buf), GFP_KERNEL); if (!title_buf) return -ENOMEM; count_buf = es_small_buf_get(); if (!count_buf) { starlet_kfree(title_buf); return -ENOMEM; } *title_buf = title; sg_init_table(in, 1); sg_set_buf(in, title_buf, sizeof(*title_buf)); sg_init_table(out, 1); sg_set_buf(out, count_buf, sizeof(*count_buf)); error = starlet_ios_ioctlv(es_dev->fd, ES_IOCTLV_GETTICKETVIEWCOUNT, 1, in, 1, out); if (error) { DBG("%s: error=%d (%08x)\n", __func__, error, error); } else { *count = *count_buf; } starlet_kfree(title_buf); es_small_buf_put(count_buf); return error; } /** * */ int starlet_es_get_ticket_views(u64 title, struct starlet_es_ticket_view *views, unsigned long count) { struct starlet_es_device *es_dev = starlet_es_get_device(); struct scatterlist in[2], out[1]; u32 *count_buf; u64 *title_buf; int error; if (!es_dev) return -ENODEV; title_buf = starlet_kzalloc(sizeof(*title_buf), GFP_KERNEL); if (!title_buf) return -ENOMEM; count_buf = es_small_buf_get(); if (!count_buf) { starlet_kfree(title_buf); return -ENOMEM; } *title_buf = title; *count_buf = count; sg_init_table(in, 2); sg_set_buf(&in[0], title_buf, sizeof(*title_buf)); sg_set_buf(&in[1], count_buf, sizeof(*count_buf)); sg_init_table(out, 1); sg_set_buf(&out[0], views, sizeof(*views)*count); error = starlet_ios_ioctlv(es_dev->fd, ES_IOCTLV_GETTICKETVIEWS, 2, in, 1, out); if (error) { DBG("%s: error=%d (%08x)\n", __func__, error, error); } es_small_buf_put(count_buf); starlet_kfree(title_buf); return error; } /** * */ int starlet_es_launch_title_view(u64 title, struct starlet_es_ticket_view *view) { struct starlet_es_device *es_dev = starlet_es_get_device(); struct scatterlist in[2]; u64 *title_buf; int error; if (!es_dev) return -ENODEV; title_buf = starlet_kzalloc(sizeof(*title_buf), GFP_KERNEL); if (!title_buf) return -ENOMEM; *title_buf = title; sg_init_table(in, 2); sg_set_buf(&in[0], title_buf, sizeof(*title_buf)); sg_set_buf(&in[1], view, sizeof(*view)); error = starlet_ios_ioctlv_and_reboot(es_dev->fd, ES_IOCTLV_LAUNCHTITLE, 2, in, 0, NULL); if (error) { DBG("%s: error=%d (%08x)\n", __func__, error, error); } starlet_kfree(title_buf); return error; } /* * Setup routines. * */ #define STARLET_ES_IOS_MIN 30 #define STARLET_ES_IOS_MAX 35 static int starlet_es_find_newest_title(struct starlet_es_device *es_dev, u64 *title, u64 title_min, u64 title_max) { u64 *titles; u64 candidate; unsigned long count; int found, i; int error; error = starlet_es_get_title_count(&count); if (error) return error; titles = starlet_kzalloc(sizeof(*titles)*count, GFP_KERNEL); if (!titles) { DBG("%s: out of memory\n", __func__); return -ENOMEM; } error = starlet_es_get_titles(titles, count); if (error) { starlet_kfree(titles); return error; } found = 0; candidate = title_min; for (i = 0; i < count; i++) { if (titles[i] > candidate && titles[i] <= title_max) { candidate = titles[i]; found = 1; } } starlet_kfree(titles); if (!found) return 0; *title = candidate; return 1; } static int starlet_es_launch_title(struct starlet_es_device *es_dev, u64 title) { struct starlet_es_ticket_view *views; unsigned long count; int error; error = starlet_es_get_ticket_view_count(title, &count); if (error) return error; views = starlet_kzalloc(sizeof(*views)*count, GFP_KERNEL); if (!views) { DBG("%s: out of memory\n", __func__); return -ENOMEM; } error = starlet_es_get_ticket_views(title, views, count); if (error) { starlet_kfree(views); return error; } drv_printk(KERN_INFO, "launching IOS%u\n", (u32)(title & 0xffffffff)); error = starlet_es_launch_title_view(title, views); /* first view */ starlet_kfree(views); return error; } static int starlet_es_load_preferred_ios(struct starlet_es_device *es_dev, u64 ios_min, u64 ios_max) { u64 title; int error; error = starlet_es_find_newest_title(es_dev, &title, ios_min, ios_max); if (!error) return -EINVAL; if (error > 0) error = starlet_es_launch_title(es_dev, title); return error; } static int starlet_es_init(struct starlet_es_device *es_dev) { u64 ios_min, ios_max; int error; error = starlet_ios_open(dev_es, 0); if (error >= 0) { starlet_es_device_instance = es_dev; es_dev->fd = error; ios_min = 0x100000000ULL | STARLET_ES_IOS_MIN; ios_max = 0x100000000ULL | STARLET_ES_IOS_MAX; error = starlet_es_load_preferred_ios(es_dev, ios_min, ios_max); if (error) { drv_printk(KERN_WARNING, "unable to load preferred" " IOS version (min %llx, max %llx)\n", ios_min, ios_max); } } return error; } static void starlet_es_exit(struct starlet_es_device *es_dev) { starlet_es_device_instance = NULL; starlet_ios_close(es_dev->fd); es_dev->fd = -1; } /* * Driver model helper routines. * */ static int starlet_es_do_probe(struct device *dev) { struct starlet_es_device *es_dev; int retval; es_dev = kzalloc(sizeof(*es_dev), GFP_KERNEL); if (!es_dev) { drv_printk(KERN_ERR, "failed to allocate es_dev\n"); return -ENOMEM; } dev_set_drvdata(dev, es_dev); es_dev->dev = dev; retval = starlet_es_init(es_dev); if (retval) { dev_set_drvdata(dev, NULL); kfree(es_dev); } return retval; } static int starlet_es_do_remove(struct device *dev) { struct starlet_es_device *es_dev = dev_get_drvdata(dev); if (es_dev) { starlet_es_exit(es_dev); dev_set_drvdata(dev, NULL); kfree(es_dev); return 0; } return -ENODEV; } /* * OF platform driver hooks. * */ static int starlet_es_of_probe(struct of_device *odev, const struct of_device_id *dev_id) { return starlet_es_do_probe(&odev->dev); } static int starlet_es_of_remove(struct of_device *odev) { return starlet_es_do_remove(&odev->dev); } static struct of_device_id starlet_es_of_match[] = { { .compatible = "nintendo,starlet-es" }, { }, }; MODULE_DEVICE_TABLE(of, starlet_es_of_match); static struct of_platform_driver starlet_es_of_driver = { .owner = THIS_MODULE, .name = DRV_MODULE_NAME, .match_table = starlet_es_of_match, .probe = starlet_es_of_probe, .remove = starlet_es_of_remove, }; /* * Kernel module interface hooks. * */ static int __init starlet_es_init_module(void) { drv_printk(KERN_INFO, "%s - version %s\n", DRV_DESCRIPTION, starlet_es_driver_version); return of_register_platform_driver(&starlet_es_of_driver); } static void __exit starlet_es_exit_module(void) { of_unregister_platform_driver(&starlet_es_of_driver); } module_init(starlet_es_init_module); module_exit(starlet_es_exit_module); MODULE_DESCRIPTION(DRV_DESCRIPTION); MODULE_AUTHOR(DRV_AUTHOR); MODULE_LICENSE("GPL"); Index: Makefile =================================================================== RCS file: /cvsroot/gc-linux/linux/arch/powerpc/platforms/embedded6xx/Makefile,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- Makefile 26 Mar 2008 20:02:27 -0000 1.3 +++ Makefile 12 Apr 2008 17:31:33 -0000 1.4 @@ -8,6 +8,7 @@ obj-$(CONFIG_FLIPPER_PIC) += flipper-pic.o obj-$(CONFIG_GAMECUBE) += gamecube.o gamecube_dev.o obj-$(CONFIG_WII) += wii.o wii_dev.o \ - starlet-ipc.o starlet-stm.o + starlet-ipc.o starlet-stm.o \ + starlet-es.o obj-$(CONFIG_GAMECUBE_RSW) += gcn-rsw.o obj-$(CONFIG_USBGECKO_UDBG) += usbgecko_udbg.o |
From: Albert H. <he...@us...> - 2008-04-12 17:22:25
|
Update of /cvsroot/gc-linux/linux/include/asm-powerpc In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv14323/include/asm-powerpc Modified Files: starlet.h Log Message: Made function starlet_ios_ioctl_complete non-static. Added support for rebooting IOS (needed by new keyboard support). Added function starlet_ios_ioctlv_and_reboot. Changed IPC allocations to GFP_NOIO, as IPC requests are used for IO. Renamed retval to error where applicable. Activated DEBUG and reduced debug noise. Error results are displayed now in case of errors during IPC calls. Fixed off-by-one buffer length error that prevented the dvd stop motor to work properly (thanks to mth). Index: starlet.h =================================================================== RCS file: /cvsroot/gc-linux/linux/include/asm-powerpc/starlet.h,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- starlet.h 4 Apr 2008 19:19:55 -0000 1.3 +++ starlet.h 12 Apr 2008 17:22:29 -0000 1.4 @@ -25,6 +25,8 @@ #define STARLET_IPC_DMA_ALIGN 0x1f /* 32 bytes */ +struct starlet_ipc_request; + struct starlet_ipc_device { unsigned long flags; @@ -39,8 +41,9 @@ struct list_head pending_list; unsigned long nr_pending; - struct device *dev; + struct starlet_ipc_request *req; /* for requests causing a ios reboot */ + struct device *dev; }; struct starlet_iovec { @@ -48,7 +51,6 @@ u32 dma_len; }; -struct starlet_ipc_request; typedef int (*starlet_ipc_callback_t)(struct starlet_ipc_request *req); struct starlet_ipc_request { @@ -123,6 +125,7 @@ void *obuf, size_t olen, starlet_ipc_callback_t callback, void *arg); +extern void starlet_ios_ioctl_complete(struct starlet_ipc_request *req); extern int starlet_ios_ioctlv(int fd, int request, unsigned int nents_in, @@ -136,6 +139,11 @@ struct scatterlist *sgl_out, starlet_ipc_callback_t callback, void *arg); +extern int starlet_ios_ioctlv_and_reboot(int fd, int request, + unsigned int nents_in, + struct scatterlist *sgl_in, + unsigned int nents_out, + struct scatterlist *sgl_out); extern void starlet_ios_ioctlv_complete(struct starlet_ipc_request *req); /* from starlet-stm.c */ |
From: Albert H. <he...@us...> - 2008-04-12 17:22:24
|
Update of /cvsroot/gc-linux/linux/arch/powerpc/platforms/embedded6xx In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv14323/arch/powerpc/platforms/embedded6xx Modified Files: starlet-ipc.c Log Message: Made function starlet_ios_ioctl_complete non-static. Added support for rebooting IOS (needed by new keyboard support). Added function starlet_ios_ioctlv_and_reboot. Changed IPC allocations to GFP_NOIO, as IPC requests are used for IO. Renamed retval to error where applicable. Activated DEBUG and reduced debug noise. Error results are displayed now in case of errors during IPC calls. Fixed off-by-one buffer length error that prevented the dvd stop motor to work properly (thanks to mth). Index: starlet-ipc.c =================================================================== RCS file: /cvsroot/gc-linux/linux/arch/powerpc/platforms/embedded6xx/starlet-ipc.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- starlet-ipc.c 4 Apr 2008 19:19:47 -0000 1.3 +++ starlet-ipc.c 12 Apr 2008 17:22:28 -0000 1.4 @@ -12,7 +12,7 @@ * */ -#undef DEBUG +#define DEBUG #define DBG(fmt, arg...) pr_debug(fmt, ##arg) @@ -68,6 +68,7 @@ /* starlet_ipc_device flags */ enum { __TX_INUSE = 0, /* tx buffer in use flag */ + __REBOOT, /* request causes IOS reboot */ }; /* @@ -212,8 +213,10 @@ static void starlet_ipc_debug_print_request(struct starlet_ipc_request *req) { +#if 0 DBG("cmd=%x, result=%x, fd=%x, dma_addr=%p\n", req->cmd, req->result, req->fd, (void *)req->dma_addr); +#endif } static struct starlet_ipc_request * @@ -222,7 +225,7 @@ struct starlet_ipc_request *req; dma_addr_t dma_addr; - req = dma_pool_alloc(ipc_dev->dma_pool, GFP_KERNEL, &dma_addr); + req = dma_pool_alloc(ipc_dev->dma_pool, GFP_NOIO, &dma_addr); if (req) { memset(req, 0, sizeof(*req)); req->ipc_dev = ipc_dev; @@ -326,10 +329,21 @@ ipc_dev->nr_pending--; } spin_unlock_irqrestore(&ipc_dev->list_lock, flags); - if (req) + if (req) { starlet_ipc_start_request(req); - else - clear_bit(__TX_INUSE, &ipc_dev->flags); + } else { + if (!test_and_clear_bit(__TX_INUSE, &ipc_dev->flags)) { + /* we get two consecutive TBEIs on reboot */ + if (test_and_clear_bit(__REBOOT, &ipc_dev->flags)) { + req = ipc_dev->req; + ipc_dev->req = NULL; + if (req) { + starlet_ipc_complete_request(req); + req->result = 0; + } + } + } + } return IRQ_HANDLED; } @@ -467,7 +481,7 @@ dma_addr_t dma_addr; char *local_pathname = NULL; size_t len; - int retval = -ENOMEM; + int error = -ENOMEM; if (!ipc_dev) return -ENODEV; @@ -495,7 +509,7 @@ req->cmd = STARLET_IOS_OPEN; req->open.pathname = dma_addr; /* bus address */ req->open.mode = flags; - retval = starlet_ipc_call(req); + error = starlet_ipc_call(req); dma_unmap_single(ipc_dev->dev, dma_addr, len, DMA_TO_DEVICE); @@ -506,7 +520,9 @@ starlet_ipc_free_request(req); } - return retval; + if (error < 0) + DBG("%s: error=%d (%x)\n", __func__, error, error); + return error; } EXPORT_SYMBOL_GPL(starlet_ios_open); @@ -517,7 +533,7 @@ { struct starlet_ipc_device *ipc_dev = starlet_ipc_get_device(); struct starlet_ipc_request *req; - int retval = -ENOMEM; + int error = -ENOMEM; if (!ipc_dev) return -ENODEV; @@ -526,10 +542,10 @@ if (req) { req->cmd = STARLET_IOS_CLOSE; req->fd = fd; - retval = starlet_ipc_call(req); + error = starlet_ipc_call(req); starlet_ipc_free_request(req); } - return retval; + return error; } EXPORT_SYMBOL_GPL(starlet_ios_close); @@ -560,11 +576,13 @@ req->ioctl.obuf = obuf; req->ioctl.olen = olen; +#if 0 DBG("%s: fd=%d, request=%x," " ibuf=%x, ilen=%u, obuf=%x, olen=%u\n" , __func__, req->fd, req->ioctl.request, req->ioctl.ibuf, req->ioctl.ilen, req->ioctl.obuf, req->ioctl.olen); +#endif } return req; @@ -586,15 +604,17 @@ dma_addr_t obuf, size_t olen) { struct starlet_ipc_request *req; - int retval = -ENOMEM; + int error = -ENOMEM; req = starlet_ios_ioctl_dma_prepare(fd, request, ibuf, ilen, obuf, olen); if (req) { - retval = starlet_ipc_call(req); + error = starlet_ipc_call(req); starlet_ios_ioctl_dma_complete(req); starlet_ipc_free_request(req); } - return retval; + if (error) + DBG("%s: error=%d (%x)\n", __func__, error, error); + return error; } EXPORT_SYMBOL_GPL(starlet_ios_ioctl_dma); @@ -607,14 +627,14 @@ starlet_ipc_callback_t callback, void *arg) { struct starlet_ipc_request *req; - int retval = -ENOMEM; + int error = -ENOMEM; req = starlet_ios_ioctl_dma_prepare(fd, request, ibuf, ilen, obuf, olen); if (req) { starlet_ipc_call_nowait(req, callback, arg); - retval = 0; + error = 0; } - return retval; + return error; } EXPORT_SYMBOL_GPL(starlet_ios_ioctl_dma_nowait); @@ -654,7 +674,7 @@ /** * */ -static void starlet_ios_ioctl_complete(struct starlet_ipc_request *req) +void starlet_ios_ioctl_complete(struct starlet_ipc_request *req) { struct starlet_ipc_device *ipc_dev = starlet_ipc_get_device(); dma_addr_t ibuf_ba, obuf_ba; @@ -680,15 +700,17 @@ void *obuf, size_t olen) { struct starlet_ipc_request *req; - int retval = -ENOMEM; + int error = -ENOMEM; req = starlet_ios_ioctl_prepare(fd, request, ibuf, ilen, obuf, olen); if (req) { - retval = starlet_ipc_call(req); + error = starlet_ipc_call(req); starlet_ios_ioctl_complete(req); starlet_ipc_free_request(req); } - return retval; + if (error < 0) + DBG("%s: error=%d (%x)\n", __func__, error, error); + return error; } EXPORT_SYMBOL_GPL(starlet_ios_ioctl); @@ -701,14 +723,14 @@ starlet_ipc_callback_t callback, void *arg) { struct starlet_ipc_request *req; - int retval = -ENOMEM; + int error = -ENOMEM; req = starlet_ios_ioctl_prepare(fd, request, ibuf, ilen, obuf, olen); if (req) { starlet_ipc_call_nowait(req, callback, arg); - retval = 0; + error = 0; } - return retval; + return error; } EXPORT_SYMBOL_GPL(starlet_ios_ioctl_nowait); @@ -741,7 +763,7 @@ nents = nents_in + nents_out; if (nents > 0) { iovec_size = nents * sizeof(*iovec); - iovec = starlet_kzalloc(iovec_size, GFP_KERNEL); + iovec = starlet_kzalloc(iovec_size, GFP_NOIO); if (!iovec) return NULL; } else { @@ -789,12 +811,13 @@ req->ioctlv.argc_out = nents_out; req->ioctlv.iovec_da = iovec_da; +#if 0 DBG("%s: fd=%d, request=%d," " argc_in=%u, argc_out=%u, iovec_da=%08x\n" , __func__, req->fd, req->ioctlv.request, req->ioctlv.argc_in, req->ioctlv.argc_out, req->ioctlv.iovec_da); - +#endif } else { if (iovec) starlet_kfree(iovec); @@ -836,17 +859,19 @@ struct scatterlist *sgl_out) { struct starlet_ipc_request *req; - int retval = -ENOMEM; + int error = -ENOMEM; req = starlet_ios_ioctlv_prepare(fd, request, nents_in, sgl_in, nents_out, sgl_out); if (req) { - retval = starlet_ipc_call(req); + error = starlet_ipc_call(req); starlet_ios_ioctlv_complete(req); starlet_ipc_free_request(req); } - return retval; + if (error < 0) + DBG("%s: error=%d (%x)\n", __func__, error, error); + return error; } EXPORT_SYMBOL_GPL(starlet_ios_ioctlv); @@ -861,19 +886,50 @@ starlet_ipc_callback_t callback, void *arg) { struct starlet_ipc_request *req; - int retval = -ENOMEM; + int error = -ENOMEM; req = starlet_ios_ioctlv_prepare(fd, request, nents_in, sgl_in, nents_out, sgl_out); if (req) { starlet_ipc_call_nowait(req, callback, arg); - retval = 0; + error = 0; } - return retval; + return error; } EXPORT_SYMBOL_GPL(starlet_ios_ioctlv_nowait); +/** + * + */ +int starlet_ios_ioctlv_and_reboot(int fd, int request, + unsigned int nents_in, + struct scatterlist *sgl_in, + unsigned int nents_out, + struct scatterlist *sgl_out) +{ + struct starlet_ipc_device *ipc_dev; + struct starlet_ipc_request *req; + int error = -ENOMEM; + + req = starlet_ios_ioctlv_prepare(fd, request, + nents_in, sgl_in, + nents_out, sgl_out); + if (req) { + ipc_dev = req->ipc_dev; + ipc_dev->req = req; + set_bit(__REBOOT, &ipc_dev->flags); + error = starlet_ipc_call(req); + starlet_ios_ioctlv_complete(req); + starlet_ipc_free_request(req); + } + if (error < 0) + DBG("%s: error=%d (%x)\n", __func__, error, error); + return error; +} +EXPORT_SYMBOL_GPL(starlet_ios_ioctlv_and_reboot); + + /* * Setup routines. @@ -885,7 +941,7 @@ */ static void starlet_ios_fixups(void) { - static u32 buf[7] + static u32 buf[8] __attribute__ ((aligned(STARLET_IPC_DMA_ALIGN + 1))); struct scatterlist in[6], out[1]; int fd; |
From: Albert H. <he...@us...> - 2008-04-04 19:42:45
|
Update of /cvsroot/gc-linux/linux/arch/powerpc/platforms/embedded6xx In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv1447/arch/powerpc/platforms/embedded6xx Modified Files: gamecube_dev.c gcn-rsw.c Log Message: Whitespace/comments/documentation cleanup. Index: gcn-rsw.c =================================================================== RCS file: /cvsroot/gc-linux/linux/arch/powerpc/platforms/embedded6xx/gcn-rsw.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- gcn-rsw.c 27 Mar 2008 22:35:24 -0000 1.3 +++ gcn-rsw.c 4 Apr 2008 19:42:49 -0000 1.4 @@ -22,11 +22,7 @@ #include <linux/spinlock.h> #include <linux/delay.h> #include <linux/reboot.h> - -#ifdef CONFIG_KEXEC #include <linux/kexec.h> -#endif - /* for flipper hardware registers */ #include "flipper-pic.h" @@ -175,8 +171,10 @@ } /* - * Initializes the driver. + * Setup routines. + * */ + static int rsw_init(struct rsw_drvdata *drvdata, struct resource *mem, int irq) { int retval; @@ -197,9 +195,6 @@ return retval; } -/* - * Deinitializes the driver. - */ static void rsw_exit(struct rsw_drvdata *drvdata) { free_irq(drvdata->irq, drvdata); @@ -210,8 +205,10 @@ } /* - * Common probe function for a reset button device. + * Driver model helper routines. + * */ + static int rsw_do_probe(struct device *dev, struct resource *mem, int irq) { struct rsw_drvdata *drvdata; @@ -233,9 +230,6 @@ return retval; } -/* - * Common remove function for a reset button device. - */ static int rsw_do_remove(struct device *dev) { struct rsw_drvdata *drvdata = dev_get_drvdata(dev); @@ -254,9 +248,6 @@ * */ -/* - * Driver model probe function. - */ static int __init rsw_of_probe(struct of_device *odev, const struct of_device_id *match) { @@ -273,9 +264,6 @@ &mem, irq_of_parse_and_map(odev->node, 0)); } -/* - * Driver model remove function. - */ static int __exit rsw_of_remove(struct of_device *odev) { return rsw_do_remove(&odev->dev); @@ -298,9 +286,11 @@ }; /* - * Module initialization function. + * Kernel module hooks. + * */ -static int rsw_init_module(void) + +static int __init rsw_init_module(void) { drv_printk(KERN_INFO, "%s - version %s\n", DRV_DESCRIPTION, rsw_driver_version); @@ -308,10 +298,7 @@ return of_register_platform_driver(&rsw_of_driver); } -/* - * Module deinitialization function. - */ -static void rsw_exit_module(void) +static void __exit rsw_exit_module(void) { of_unregister_platform_driver(&rsw_of_driver); } Index: gamecube_dev.c =================================================================== RCS file: /cvsroot/gc-linux/linux/arch/powerpc/platforms/embedded6xx/gamecube_dev.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- gamecube_dev.c 26 Mar 2008 19:48:46 -0000 1.1 +++ gamecube_dev.c 4 Apr 2008 19:42:49 -0000 1.2 @@ -23,9 +23,6 @@ { }, }; -/* - * - */ static int __init gamecube_device_probe(void) { if (!machine_is(gamecube)) |
From: Albert H. <he...@us...> - 2008-04-04 19:41:41
|
Update of /cvsroot/gc-linux/linux/arch/powerpc/boot/dts In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv886/arch/powerpc/boot/dts Modified Files: wii.dts Log Message: Updated DTS and config. Index: wii.dts =================================================================== RCS file: /cvsroot/gc-linux/linux/arch/powerpc/boot/dts/wii.dts,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- wii.dts 27 Mar 2008 22:35:22 -0000 1.3 +++ wii.dts 4 Apr 2008 19:41:44 -0000 1.4 @@ -120,6 +120,11 @@ reg = <0d000000 40>; interrupts = <0e>; interrupt-parent = <&pic>; + + }; + + starlet-sd { + compatible = "nintendo,starlet-sd"; }; serial@0d006400 { |
From: Albert H. <he...@us...> - 2008-04-04 19:41:41
|
Update of /cvsroot/gc-linux/linux/arch/powerpc/configs In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv886/arch/powerpc/configs Modified Files: wii_defconfig Log Message: Updated DTS and config. Index: wii_defconfig =================================================================== RCS file: /cvsroot/gc-linux/linux/arch/powerpc/configs/wii_defconfig,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- wii_defconfig 26 Mar 2008 20:14:54 -0000 1.3 +++ wii_defconfig 4 Apr 2008 19:41:44 -0000 1.4 @@ -1,7 +1,7 @@ # # Automatically generated make config: don't edit # Linux kernel version: 2.6.24 -# Tue Mar 25 23:28:40 2008 +# Sun Mar 30 20:03:57 2008 # # CONFIG_PPC64 is not set @@ -346,6 +346,7 @@ CONFIG_BLK_DEV=y # CONFIG_BLK_DEV_FD is not set CONFIG_GAMECUBE_SD=y +CONFIG_WII_SD=y CONFIG_WII_MEM2=y # CONFIG_BLK_DEV_COW_COMMON is not set CONFIG_BLK_DEV_LOOP=y @@ -653,22 +654,7 @@ # CONFIG_HID_DEBUG is not set # CONFIG_HIDRAW is not set # CONFIG_USB_SUPPORT is not set -CONFIG_MMC=y -# CONFIG_MMC_DEBUG is not set -# CONFIG_MMC_UNSAFE_RESUME is not set - -# -# MMC/SD Card Drivers -# -CONFIG_MMC_BLOCK=y -CONFIG_MMC_BLOCK_BOUNCE=y -# CONFIG_SDIO_UART is not set - -# -# MMC/SD Host Controller Drivers -# -# CONFIG_MMC_WBSD is not set -CONFIG_MMC_STARLET=y +# CONFIG_MMC is not set # CONFIG_NEW_LEDS is not set # CONFIG_EDAC is not set CONFIG_RTC_LIB=y |
From: Albert H. <he...@us...> - 2008-04-04 19:30:39
|
Update of /cvsroot/gc-linux/linux/drivers/block In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv27735/drivers/block Modified Files: Kconfig Makefile Added Files: rvl-stsd.c Log Message: Added support for the front SD card slot. Index: Makefile =================================================================== RCS file: /cvsroot/gc-linux/linux/drivers/block/Makefile,v retrieving revision 1.18 retrieving revision 1.19 diff -u -d -r1.18 -r1.19 --- Makefile 4 Mar 2008 06:06:07 -0000 1.18 +++ Makefile 4 Apr 2008 19:30:40 -0000 1.19 @@ -17,6 +17,7 @@ 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) += rd.o obj-$(CONFIG_BLK_DEV_LOOP) += loop.o obj-$(CONFIG_BLK_DEV_PS2) += ps2esdi.o Index: Kconfig =================================================================== RCS file: /cvsroot/gc-linux/linux/drivers/block/Kconfig,v retrieving revision 1.31 retrieving revision 1.32 diff -u -d -r1.31 -r1.32 --- Kconfig 26 Mar 2008 20:06:36 -0000 1.31 +++ Kconfig 4 Apr 2008 19:30:40 -0000 1.32 @@ -127,6 +127,22 @@ To compile this driver as a module, choose M here: the module will be called gcn-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. + + 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 --- NEW FILE: rvl-stsd.c --- /* * 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 * * Based on drivers/block/gcn-sd.c * * Copyright (C) 2004-2008 The GameCube Linux Team * Copyright (C) 2004,2005 Rob Reylink * Copyright (C) 2005 Todd Jeffreys * Copyright (C) 2005,2006,2007,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. * [...1689 lines suppressed...] STSD_MAJOR); return -EIO; } return of_register_platform_driver(&stsd_of_driver); } static void __exit stsd_exit_module(void) { of_unregister_platform_driver(&stsd_of_driver); unregister_blkdev(STSD_MAJOR, DRV_MODULE_NAME); } module_init(stsd_init_module); module_exit(stsd_exit_module); MODULE_AUTHOR(DRV_AUTHOR); MODULE_DESCRIPTION(DRV_DESCRIPTION); MODULE_LICENSE("GPL"); |
From: Albert H. <he...@us...> - 2008-04-04 19:20:23
|
Update of /cvsroot/gc-linux/linux/arch/powerpc/platforms/embedded6xx In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv22259/arch/powerpc/platforms/embedded6xx Modified Files: starlet-ipc.c Log Message: - added starlet_kzalloc/starlet_kfree interfaces - added async ipc calls - added async ioctl api - added ioctlv apis - added useful hardware fixups - stop dvd motor (to preserve the dvd unit) - disconnect wiimote (to preserve batteries) - turn off the front blue light (to preserve the led) - added module information Index: starlet-ipc.c =================================================================== RCS file: /cvsroot/gc-linux/linux/arch/powerpc/platforms/embedded6xx/starlet-ipc.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- starlet-ipc.c 26 Mar 2008 20:14:58 -0000 1.2 +++ starlet-ipc.c 4 Apr 2008 19:19:47 -0000 1.3 @@ -12,6 +12,10 @@ * */ +#undef DEBUG + +#define DBG(fmt, arg...) pr_debug(fmt, ##arg) + #include <linux/kernel.h> #include <linux/module.h> #include <linux/init.h> @@ -20,6 +24,7 @@ [...1079 lines suppressed...] { drv_printk(KERN_INFO, "%s - version %s\n", DRV_DESCRIPTION, @@ -783,9 +1112,6 @@ return of_register_platform_driver(&starlet_ipc_of_driver); } -/* - * - */ static void __exit starlet_ipc_exit_module(void) { of_unregister_platform_driver(&starlet_ipc_of_driver); @@ -794,4 +1120,7 @@ module_init(starlet_ipc_init_module); module_exit(starlet_ipc_exit_module); +MODULE_DESCRIPTION(DRV_DESCRIPTION); +MODULE_AUTHOR(DRV_AUTHOR); +MODULE_LICENSE("GPL"); |
From: Albert H. <he...@us...> - 2008-04-04 19:20:05
|
Update of /cvsroot/gc-linux/linux/include/asm-powerpc In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv22259/include/asm-powerpc Modified Files: starlet.h Log Message: - added starlet_kzalloc/starlet_kfree interfaces - added async ipc calls - added async ioctl api - added ioctlv apis - added useful hardware fixups - stop dvd motor (to preserve the dvd unit) - disconnect wiimote (to preserve batteries) - turn off the front blue light (to preserve the led) - added module information Index: starlet.h =================================================================== RCS file: /cvsroot/gc-linux/linux/include/asm-powerpc/starlet.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- starlet.h 26 Mar 2008 20:15:23 -0000 1.2 +++ starlet.h 4 Apr 2008 19:19:55 -0000 1.3 @@ -20,6 +20,7 @@ #include <linux/dmapool.h> #include <linux/list.h> #include <linux/platform_device.h> +#include <linux/scatterlist.h> #define STARLET_IPC_DMA_ALIGN 0x1f /* 32 bytes */ @@ -42,15 +43,100 @@ }; +struct starlet_iovec { + dma_addr_t dma_addr; + u32 dma_len; +}; + +struct starlet_ipc_request; +typedef int (*starlet_ipc_callback_t)(struct starlet_ipc_request *req); + +struct starlet_ipc_request { + /* begin starlet firmware request format */ + u32 cmd; + s32 result; + union { + s32 fd; + u32 req_cmd; + }; + union { + struct { + dma_addr_t pathname; + u32 mode; + } open; + struct { + u32 request; + dma_addr_t ibuf; + u32 ilen; + dma_addr_t obuf; + u32 olen; + } ioctl; + struct { + u32 request; + u32 argc_in; + u32 argc_out; + dma_addr_t iovec_da; + } ioctlv; + u32 argv[5]; + }; + /* end starlet firmware request format */ + + dma_addr_t dma_addr; /* request dma address */ + + /* ioctlv related data */ + struct starlet_iovec *iovec; + size_t iovec_size; + + struct scatterlist *sgl_in; + unsigned sgl_nents_in; + struct scatterlist *sgl_out; + unsigned sgl_nents_out; + + void *done_data; + starlet_ipc_callback_t done; + + struct list_head node; /* for queueing */ + + struct starlet_ipc_device *ipc_dev; +}; + + + /* from starlet-ipc.c */ +extern void *starlet_kzalloc(size_t size, gfp_t flags); +extern void starlet_kfree(void *ptr); + extern struct starlet_ipc_device *starlet_ipc_get_device(void); +extern void *starlet_ipc_request_priv(struct starlet_ipc_request *req); +extern void starlet_ipc_free_request(struct starlet_ipc_request *req); + extern int starlet_ios_open(const char *pathname, int flags); extern int starlet_ios_close(int fd); + extern int starlet_ios_ioctl(int fd, int request, void *ibuf, size_t ilen, void *obuf, size_t olen); +extern int starlet_ios_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_ios_ioctlv(int fd, int request, + unsigned int nents_in, + struct scatterlist *sgl_in, + unsigned int nents_out, + struct scatterlist *sgl_out); +extern int starlet_ios_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 void starlet_ios_ioctlv_complete(struct starlet_ipc_request *req); /* from starlet-stm.c */ |
From: Albert H. <he...@us...> - 2008-04-04 19:17:50
|
Update of /cvsroot/gc-linux/linux/drivers/block In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv21747/drivers/block Modified Files: gcn-sd.c Log Message: Trivial: - whitespace cleanups - remove obvious documentation - added some comments Index: gcn-sd.c =================================================================== RCS file: /cvsroot/gc-linux/linux/drivers/block/gcn-sd.c,v retrieving revision 1.14 retrieving revision 1.15 diff -u -d -r1.14 -r1.15 --- gcn-sd.c 27 Mar 2008 22:35:28 -0000 1.14 +++ gcn-sd.c 4 Apr 2008 19:17:53 -0000 1.15 @@ -1,7 +1,7 @@ /* * drivers/block/gcn-sd.c * - * MMC/SD card block driver for the Nintendo GameCube + * MMC/SD card block driver for the Nintendo GameCube/Wii * Copyright (C) 2004-2008 The GameCube Linux Team * Copyright (C) 2004,2005 Rob Reylink * Copyright (C) 2005 Todd Jeffreys @@ -78,10 +78,6 @@ "Todd Jeffreys, " \ "Albert Herranz" -MODULE_AUTHOR(DRV_AUTHOR); -MODULE_DESCRIPTION(DRV_DESCRIPTION); -MODULE_LICENSE("GPL"); - static char sd_driver_version[] = "4.1i"; #define sd_printk(level, format, arg...) \ @@ -177,8 +173,6 @@ #define KERNEL_SECTOR_SHIFT 9 #define KERNEL_SECTOR_SIZE (1 << KERNEL_SECTOR_SHIFT) /*512 */ -unsigned long unclean_slots = 0; - enum { __SD_MEDIA_CHANGED = 0, __SD_BAD_CARD, @@ -1737,3 +1731,7 @@ module_init(sd_init_module); module_exit(sd_exit_module); +MODULE_AUTHOR(DRV_AUTHOR); +MODULE_DESCRIPTION(DRV_DESCRIPTION); +MODULE_LICENSE("GPL"); + |
From: Albert H. <he...@us...> - 2008-04-04 19:17:50
|
Update of /cvsroot/gc-linux/linux/arch/powerpc/kernel In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv21747/arch/powerpc/kernel Modified Files: head_32.S Log Message: Trivial: - whitespace cleanups - remove obvious documentation - added some comments Index: head_32.S =================================================================== RCS file: /cvsroot/gc-linux/linux/arch/powerpc/kernel/head_32.S,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- head_32.S 26 Mar 2008 19:39:41 -0000 1.2 +++ head_32.S 4 Apr 2008 19:17:51 -0000 1.3 @@ -1267,9 +1267,9 @@ #ifdef CONFIG_PPC_EARLY_DEBUG_USBGECKO setup_usbgecko_bat: /* prepare a BAT for early io */ - lis r8, 0x0c00 /* DBAT3 for IO mem */ + lis r8, 0x0c00 ori r8, r8, 0x002a /* uncached, guarded ,rw */ - lis r11, 0xcc00 /* DBAT3 for IO mem */ + lis r11, 0xcc00 ori r11, r11, 0x3 /* 128K */ #ifdef CONFIG_WII oris r8, r8, 0x0100 |
From: Albert H. <he...@us...> - 2008-04-04 19:17:50
|
Update of /cvsroot/gc-linux/linux/arch/powerpc/platforms/embedded6xx In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv21747/arch/powerpc/platforms/embedded6xx Modified Files: flipper-pic.h flipper-pic.c usbgecko_udbg.c wii_dev.c Log Message: Trivial: - whitespace cleanups - remove obvious documentation - added some comments Index: wii_dev.c =================================================================== RCS file: /cvsroot/gc-linux/linux/arch/powerpc/platforms/embedded6xx/wii_dev.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- wii_dev.c 27 Mar 2008 22:35:26 -0000 1.2 +++ wii_dev.c 4 Apr 2008 19:17:51 -0000 1.3 @@ -23,9 +23,6 @@ { }, }; -/* - * - */ static int __init wii_device_probe(void) { struct device_node *np; Index: usbgecko_udbg.c =================================================================== RCS file: /cvsroot/gc-linux/linux/arch/powerpc/platforms/embedded6xx/usbgecko_udbg.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- usbgecko_udbg.c 26 Mar 2008 19:39:41 -0000 1.1 +++ usbgecko_udbg.c 4 Apr 2008 19:17:51 -0000 1.2 @@ -261,8 +261,7 @@ #ifdef CONFIG_PPC_EARLY_DEBUG_USBGECKO /* - * USB Gecko early udbg support initialization. - * The USB Gecko must be inserted in memcard slot B for early debugging. + * USB Gecko early debug support initialization for udbg. * */ void __init udbg_init_debug_usbgecko(void) Index: flipper-pic.h =================================================================== RCS file: /cvsroot/gc-linux/linux/arch/powerpc/platforms/embedded6xx/flipper-pic.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- flipper-pic.h 26 Mar 2008 19:34:23 -0000 1.1 +++ flipper-pic.h 4 Apr 2008 19:17:51 -0000 1.2 @@ -15,6 +15,12 @@ #ifndef __FLIPPER_PIC_H #define __FLIPPER_PIC_H +#ifdef CONFIG_WII +#define FLIPPER_NR_IRQS (15) +#else +#define FLIPPER_NR_IRQS (14) +#endif + /* * Each interrupt has a corresponding bit in both * the Interrupt Cause (ICR) and Interrupt Mask (IMR) registers. @@ -23,12 +29,6 @@ * the corresponding bit in IMR. ACK'ing a request simply involves * asserting the corresponding bit in ICR. */ -#ifdef CONFIG_WII -#define FLIPPER_NR_IRQS (15) -#else -#define FLIPPER_NR_IRQS (14) -#endif - #define FLIPPER_ICR 0x00 #define FLIPPER_ICR_RSS (1<<16) /* reset switch state */ Index: flipper-pic.c =================================================================== RCS file: /cvsroot/gc-linux/linux/arch/powerpc/platforms/embedded6xx/flipper-pic.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- flipper-pic.c 26 Mar 2008 19:34:23 -0000 1.1 +++ flipper-pic.c 4 Apr 2008 19:17:51 -0000 1.2 @@ -27,11 +27,11 @@ printk(level DRV_MODULE_NAME ": " format , ## arg) -static struct irq_host *flipper_irq_host; - /* + * IRQ chip hooks. * */ + static void flipper_pic_mask_and_ack(unsigned int virq) { int irq = virq_to_hw(virq); @@ -41,9 +41,6 @@ set_bit(irq, io_base + FLIPPER_ICR); } -/* - * - */ static void flipper_pic_ack(unsigned int virq) { int irq = virq_to_hw(virq); @@ -52,9 +49,6 @@ set_bit(irq, io_base + FLIPPER_ICR); } -/* - * - */ static void flipper_pic_mask(unsigned int virq) { int irq = virq_to_hw(virq); @@ -63,9 +57,6 @@ clear_bit(irq, io_base + FLIPPER_IMR); } -/* - * - */ static void flipper_pic_unmask(unsigned int virq) { int irq = virq_to_hw(virq); @@ -74,9 +65,7 @@ set_bit(irq, io_base + FLIPPER_IMR); } -/* - * - */ + static struct irq_chip flipper_pic = { .typename = "flipper-pic", .ack = flipper_pic_ack, @@ -86,8 +75,12 @@ }; /* + * IRQ host hooks. * */ + +static struct irq_host *flipper_irq_host; + static int flipper_pic_map(struct irq_host *h, unsigned int virq, irq_hw_number_t hwirq) { @@ -96,18 +89,12 @@ return 0; } -/* - * - */ static void flipper_pic_unmap(struct irq_host *h, unsigned int irq) { set_irq_chip_data(irq, NULL); set_irq_chip(irq, NULL); } -/* - * - */ static int flipper_pic_match(struct irq_host *h, struct device_node *np) { return 1; @@ -121,8 +108,10 @@ }; /* + * Platform hooks. * */ + struct irq_host * __init flipper_pic_init(struct device_node *np) { struct irq_host *irq_host; @@ -156,9 +145,6 @@ return irq_host; } -/* - * - */ unsigned int flipper_pic_get_irq(void) { void __iomem *io_base = flipper_irq_host->host_data; @@ -175,8 +161,10 @@ } /* + * Probe function. * */ + void __init flipper_pic_probe(void) { struct device_node *np; @@ -193,12 +181,12 @@ } /* - * Misc functions provided by the flipper chipset. + * Misc functions related to the flipper chipset. * */ /* - * + * Resets the platform. */ void flipper_platform_reset(void) { @@ -211,7 +199,7 @@ } /* - * Tells if the reset button is pressed. + * Returns non-zero if the reset button is pressed. */ int flipper_is_reset_button_pressed(void) { |
From: Albert H. <he...@us...> - 2008-04-04 19:17:50
|
Update of /cvsroot/gc-linux/linux/arch/powerpc/boot/dts In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv21747/arch/powerpc/boot/dts Modified Files: gamecube.dts Log Message: Trivial: - whitespace cleanups - remove obvious documentation - added some comments Index: gamecube.dts =================================================================== RCS file: /cvsroot/gc-linux/linux/arch/powerpc/boot/dts/gamecube.dts,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- gamecube.dts 27 Mar 2008 22:35:20 -0000 1.3 +++ gamecube.dts 4 Apr 2008 19:17:50 -0000 1.4 @@ -74,7 +74,7 @@ }; /* devices contained int the flipper chipset */ - soc { + soc { #address-cells = <1>; #size-cells = <1>; #interrupt-cells = <1>; |
From: Albert H. <he...@us...> - 2008-03-27 22:37:31
|
Update of /cvsroot/gc-linux/linux/sound/ppc In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv15970/sound/ppc Modified Files: gcn-ai.c gcn-mic.c Log Message: Small cleanups: - Added copyright notices to the DTS files. - Renamed DTS node names and compatible properties as per segher suggestion. - s/-isobel/i/ from version strings. - Added missing arch/powerpc/platforms/embedded6xx/usbgecko_udbg.h file. - s/DVD/Disk/ on gcn-di.c. - Use "exi" instead of "exi-driver" in exi-driver messages. Index: gcn-mic.c =================================================================== RCS file: /cvsroot/gc-linux/linux/sound/ppc/gcn-mic.c,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- gcn-mic.c 26 Mar 2008 20:15:24 -0000 1.6 +++ gcn-mic.c 27 Mar 2008 22:35:48 -0000 1.7 @@ -37,7 +37,7 @@ MODULE_DESCRIPTION(DRV_DESCRIPTION); MODULE_LICENSE("GPL"); -static char mic_driver_version[] = "0.1-isobel"; +static char mic_driver_version[] = "0.1i"; #define mic_printk(level, format, arg...) \ printk(level DRV_MODULE_NAME ": " format , ## arg) Index: gcn-ai.c =================================================================== RCS file: /cvsroot/gc-linux/linux/sound/ppc/gcn-ai.c,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- gcn-ai.c 26 Mar 2008 20:15:24 -0000 1.11 +++ gcn-ai.c 27 Mar 2008 22:35:47 -0000 1.12 @@ -36,7 +36,7 @@ "Steven Looman, " \ "Albert Herranz" -static char ai_driver_version[] = "1.0-isobel"; +static char ai_driver_version[] = "1.0i"; #define drv_printk(level, format, arg...) \ printk(level DRV_MODULE_NAME ": " format , ## arg) @@ -556,7 +556,8 @@ static struct of_device_id ai_of_match[] = { - { .compatible = "nintendo,ai" }, + { .compatible = "nintendo,flipper-audio" }, + { .compatible = "nintendo,hollywood-audio" }, { }, }; |
From: Albert H. <he...@us...> - 2008-03-27 22:36:54
|
Update of /cvsroot/gc-linux/linux/drivers/video In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv15970/drivers/video Modified Files: gcnfb.c Log Message: Small cleanups: - Added copyright notices to the DTS files. - Renamed DTS node names and compatible properties as per segher suggestion. - s/-isobel/i/ from version strings. - Added missing arch/powerpc/platforms/embedded6xx/usbgecko_udbg.h file. - s/DVD/Disk/ on gcn-di.c. - Use "exi" instead of "exi-driver" in exi-driver messages. Index: gcnfb.c =================================================================== RCS file: /cvsroot/gc-linux/linux/drivers/video/gcnfb.c,v retrieving revision 1.18 retrieving revision 1.19 diff -u -d -r1.18 -r1.19 --- gcnfb.c 26 Mar 2008 20:15:21 -0000 1.18 +++ gcnfb.c 27 Mar 2008 22:35:42 -0000 1.19 @@ -34,13 +34,12 @@ #include "gcngx.h" #define DRV_MODULE_NAME "gcn-vifb" -#define DRV_DESCRIPTION "Nintendo GameCube/Wii Video Interface (VI)" \ - " frame buffer driver" +#define DRV_DESCRIPTION "Nintendo GameCube/Wii Video Interface (VI) driver" #define DRV_AUTHOR "Michael Steil <mi...@c6...>, " \ "Todd Jeffreys <to...@vo...>, " \ "Albert Herranz" -static char vifb_driver_version[] = "1.0-isobel"; +static char vifb_driver_version[] = "1.0i"; #define drv_printk(level, format, arg...) \ printk(level DRV_MODULE_NAME ": " format , ## arg) @@ -938,7 +937,7 @@ if (!options || !*options) return 0; - drv_printk(KERN_DEBUG, "options = %s\n", options); + drv_printk(KERN_DEBUG, "options: %s\n", options); while ((this_opt = strsep(&options, ",")) != NULL) { if (!*this_opt) @@ -1010,7 +1009,8 @@ static struct of_device_id vifb_of_match[] = { - { .compatible = "nintendo,vifb", }, + { .compatible = "nintendo,flipper-video", }, + { .compatible = "nintendo,hollywood-video", }, { }, }; |