Please pull powerpc.git merge branch
Linus, Please do git pull \ git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc.git merge to get two more bug-fixes that the Cell guys would like to see in 2.6.24 (and which only affect Cell). The changes are less than the diffstat might indicate since a couple of functions got moved from one file to another by the second commit listed below. Thanks, Paul. arch/powerpc/platforms/cell/Kconfig |5 ++ arch/powerpc/platforms/cell/Makefile |1 arch/powerpc/platforms/cell/spu_notify.c | 67 ++ arch/powerpc/platforms/cell/spu_syscalls.c | 14 + arch/powerpc/platforms/cell/spufs/context.c | 16 -- arch/powerpc/platforms/cell/spufs/sched.c| 29 +++ arch/powerpc/platforms/cell/spufs/syscalls.c |1 arch/powerpc/platforms/ps3/os-area.c | 40 include/asm-powerpc/spu.h|4 ++ 9 files changed, 129 insertions(+), 48 deletions(-) create mode 100644 arch/powerpc/platforms/cell/spu_notify.c commit ec5d2dfe72cf4808ae4ecee03454a4d91dfcbe0c Author: Geoff Levand [EMAIL PROTECTED] Date: Mon Dec 24 04:41:01 2007 +1100 [POWERPC] PS3: Fix printing of os-area magic numbers Fix a bug in the printing of the os-area magic numbers which assumed that magic numbers were zero terminated strings. The magic numbers are represented in memory as integers. If the os-area sections are not initialized correctly they could contained random data that would be printed to the display. Also unify the handling of header and db magic numbers and make both of type array of u8. Signed-off-by: Geoff Levand [EMAIL PROTECTED] Signed-off-by: Paul Mackerras [EMAIL PROTECTED] commit aed3a8c9bb1a8623a618232087c5ff62718e3b9a Author: Bob Nelson [EMAIL PROTECTED] Date: Sat Dec 15 01:27:30 2007 +1100 [POWERPC] Oprofile: Remove dependency on spufs module This removes an OProfile dependency on the spufs module. This dependency was causing a problem for multiplatform systems that are built with support for Oprofile on Cell but try to load the oprofile module on a non-Cell system. Signed-off-by: Bob Nelson [EMAIL PROTECTED] Signed-off-by: Arnd Bergmann [EMAIL PROTECTED] Acked-by: Jeremy Kerr [EMAIL PROTECTED] Signed-off-by: Paul Mackerras [EMAIL PROTECTED] ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev
Re: [PATCH 0/5] Version 17, series to add device tree naming to i2c
Hi John, Le 27/12/2007, Jon Smirl écrit: On 12/19/07, Jon Smirl [EMAIL PROTECTED] wrote: Another rework of the i2c for powerpc device tree patch. This version implements standard alias naming only on the powerpc platform and only for the device tree names. The old naming mechanism of i2c_client.name,driver_name is left in place and not changed for non-powerpc platforms. This patch is fully capable of dynamically loading the i2c modules. You can modprobe in the i2c-mpc driver and the i2c modules described in the device tree will be automatically loaded. Modules also work if compiled in. Are there any further objections to this patch? Can it all go in through the powerpc trees or do the i2c people want to send it on? I am on vacation until January 4th. I will review your patchset the week following my return. Thanks for your patience, -- Jean Delvare ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev
Re: Problems with arch/powerpc
On Fri, 28 Dec 2007 01:18:48 -0500 Sean MacLennan [EMAIL PROTECTED] wrote: And one more thought, could uClibc be causing problems with the new kernel? It just seems strange that kernel stuff seems to work (e.g. no problems mounting a usbkey) yet a simple setjmp in a user mode app reeks havoc. We are going to be moving away from uClibc in the short term (I am the only one left using it). So if this could be an issue I might have to bite the bullet and switch now. Does the setjmp call use floating point instructions? I'm wondering if the APU isn't enabled for the FPU on the Yosemite board for some reason. If that wasn't enabled, weird things would happen. josh ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev
[PATCH/RFC] Add support for PowerQUICC watchdog
The PowerQUICC series has a watchdog which can be activated by the boot loader and then needs to be reset in regular intervals. Once the watchdog is enabled, it can't be disabled anymore. This patch adds support for this kind of watchdog. An early init function is provided to manually reset the watchdog in early board setup. Later, a kernel timer is used to reset the watchdog until the watchdog driver is opened from user space. This replaces mpc8xx_wdt.c (only usable for ARCH=ppc) and mpc83xx_wdt.c (untested on this platform). Signed-off-by: Jochen Friedrich [EMAIL PROTECTED] --- arch/powerpc/platforms/8xx/mpc86xads_setup.c |5 + arch/powerpc/platforms/8xx/mpc885ads_setup.c |5 + arch/powerpc/sysdev/Makefile |3 + arch/powerpc/sysdev/pq_wdt.c | 204 +++ arch/powerpc/sysdev/pq_wdt.h | 28 drivers/watchdog/Kconfig | 13 ++- drivers/watchdog/Makefile|1 + drivers/watchdog/pq_wdt.c| 222 ++ 8 files changed, 480 insertions(+), 1 deletions(-) create mode 100644 arch/powerpc/sysdev/pq_wdt.c create mode 100644 arch/powerpc/sysdev/pq_wdt.h create mode 100644 drivers/watchdog/pq_wdt.c diff --git a/arch/powerpc/platforms/8xx/mpc86xads_setup.c b/arch/powerpc/platforms/8xx/mpc86xads_setup.c index 4901283..c468ec2 100644 --- a/arch/powerpc/platforms/8xx/mpc86xads_setup.c +++ b/arch/powerpc/platforms/8xx/mpc86xads_setup.c @@ -38,6 +38,7 @@ #include asm/prom.h #include sysdev/commproc.h +#include sysdev/pq_wdt.h static void init_smc1_uart_ioports(struct fs_uart_platform_info* fpi); static void init_smc2_uart_ioports(struct fs_uart_platform_info* fpi); @@ -251,6 +252,10 @@ static void __init mpc86xads_setup_arch(void) mpc86xads_board_setup(); ROOT_DEV = Root_NFS; + +#if defined(CONFIG_PQ_WDT) || defined(CONFIG_PQ_WDT_MODULE) + pq_wdt_early_init(); +#endif } static int __init mpc86xads_probe(void) diff --git a/arch/powerpc/platforms/8xx/mpc885ads_setup.c b/arch/powerpc/platforms/8xx/mpc885ads_setup.c index 2cf1b6a..f076b67 100644 --- a/arch/powerpc/platforms/8xx/mpc885ads_setup.c +++ b/arch/powerpc/platforms/8xx/mpc885ads_setup.c @@ -41,6 +41,7 @@ #include asm/udbg.h #include sysdev/commproc.h +#include sysdev/pq_wdt.h static u32 __iomem *bcsr, *bcsr5; @@ -246,6 +247,10 @@ static void __init mpc885ads_setup_arch(void) m8xx_pcmcia_ops.hw_ctrl = pcmcia_hw_setup; m8xx_pcmcia_ops.voltage_set = pcmcia_set_voltage; #endif + +#if defined(CONFIG_PQ_WDT) || defined(CONFIG_PQ_WDT_MODULE) + pq_wdt_early_init(); +#endif } static int __init mpc885ads_probe(void) diff --git a/arch/powerpc/sysdev/Makefile b/arch/powerpc/sysdev/Makefile index 99a77d7..84f190e 100644 --- a/arch/powerpc/sysdev/Makefile +++ b/arch/powerpc/sysdev/Makefile @@ -35,5 +35,8 @@ obj-$(CONFIG_CPM) += cpm_common.o obj-$(CONFIG_CPM2) += cpm2_common.o cpm2_pic.o obj-$(CONFIG_PPC_DCR) += dcr.o obj-$(CONFIG_8xx) += mpc8xx_pic.o commproc.o +ifneq ($(CONFIG_PQ_WDT),) +obj-y += pq_wdt.o +endif obj-$(CONFIG_UCODE_PATCH) += micropatch.o endif diff --git a/arch/powerpc/sysdev/pq_wdt.c b/arch/powerpc/sysdev/pq_wdt.c new file mode 100644 index 000..0adbe42 --- /dev/null +++ b/arch/powerpc/sysdev/pq_wdt.c @@ -0,0 +1,204 @@ +/* + * pq_wdt.c - Freescale PowerQUICC watchdog driver + * + * Author: Florian Schirmer [EMAIL PROTECTED] + * + * 2002 (c) Florian Schirmer [EMAIL PROTECTED] This file is licensed under + * the terms of the GNU General Public License version 2. This program + * is licensed as is without any warranty of any kind, whether express + * or implied. + * + * 2007 (c) Jochen Friedrich [EMAIL PROTECTED] ported to ARCH=powerpc and + * extended to be useful on any Power QUICC 1/2/2pro which have the same + * style of watchdog. + */ +#include linux/kernel.h +#include linux/module.h +#include linux/init.h +#include linux/sched.h +#include linux/irq.h +#include linux/of.h +#include asm/irq.h +#include asm/io.h +#include asm/prom.h + +#include pq_wdt.h + +struct pq_wdt { + __be32 res0; + __be32 swcrr; /* System watchdog control register */ + __be32 swcnr; /* System watchdog count register */ + u8 res1[2]; + __be16 swsrr; /* System watchdog service register */ +}; + +static int wdt_timeout; +static int wdt_freq; +static struct pq_wdt __iomem *wdt_reg; +static int wdt_scale; + +void pq_wdt_reset(void) +{ + if (!wdt_reg) + return; + + out_be16(wdt_reg-swsrr, 0x556c); /* write magic1 */ + out_be16(wdt_reg-swsrr, 0xaa39); /* write magic2 */ +} +EXPORT_SYMBOL(pq_wdt_reset); + +static void wdt_timer_func(unsigned long data); + +static struct timer_list wdt_timer = + TIMER_INITIALIZER(wdt_timer_func, 0, 0); + +void pq_wdt_stop_timer(void) +{ +
[PATCH/RFC] Add support for freescale watchdog to CPM serial driver.
If a freescale watchdog device node is present, reset the watchdog while waiting for serial input. Signed-off-by: Jochen Friedrich [EMAIL PROTECTED] --- arch/powerpc/boot/cpm-serial.c | 33 - 1 files changed, 32 insertions(+), 1 deletions(-) diff --git a/arch/powerpc/boot/cpm-serial.c b/arch/powerpc/boot/cpm-serial.c index 28296fa..d85f038 100644 --- a/arch/powerpc/boot/cpm-serial.c +++ b/arch/powerpc/boot/cpm-serial.c @@ -6,6 +6,9 @@ * * It is assumed that the firmware (or the platform file) has already set * up the port. + * + * If a watchdog node exists, periodically reset the watchdog while waiting + * for console input. */ #include types.h @@ -50,7 +53,16 @@ struct cpm_bd { u8 *addr; /* Buffer address in host memory */ }; +struct pq_wdt { + u32 res0; + u32 swcrr; /* System watchdog control register */ + u32 swcnr; /* System watchdog count register */ + u8 res1[2]; + u16 swsrr; /* System watchdog service register */ +}; + static void *cpcr; +static struct pq_wdt *wdt; static struct cpm_param *param; static struct cpm_smc *smc; static struct cpm_scc *scc; @@ -154,6 +166,11 @@ static void cpm_serial_putc(unsigned char c) static unsigned char cpm_serial_tstc(void) { + if (wdt) { + out_be16(wdt-swsrr, 0x556c); + out_be16(wdt-swsrr, 0xaa39); + } + barrier(); return !(rbdf-sc 0x8000); } @@ -178,7 +195,7 @@ int cpm_console_init(void *devp, struct serial_console_data *scdp) void *reg_virt[2]; int is_smc = 0, is_cpm2 = 0, n; unsigned long reg_phys; - void *parent, *muram; + void *parent, *muram, *watchdog; if (dt_is_compatible(devp, fsl,cpm1-smc-uart)) { is_smc = 1; @@ -260,6 +277,20 @@ int cpm_console_init(void *devp, struct serial_console_data *scdp) if (n 4) return -1; + watchdog = finddevice(/soc/wdt); + if (watchdog (dt_is_compatible(watchdog, fsl,pq1-wdt) || +dt_is_compatible(watchdog, fsl,pq2-wdt) || +dt_is_compatible(watchdog, fsl,pq2pro-wdt))) { + n = getprop(watchdog, virtual-reg, reg_virt, +sizeof(reg_virt)); + if (n (int)sizeof(reg_virt)) { + if (!dt_xlate_reg(watchdog, 0, reg_phys, NULL)) + return -1; + reg_virt[0] = (void *)reg_phys; + } + wdt = reg_virt[0]; + } + scdp-open = cpm_serial_open; scdp-putc = cpm_serial_putc; scdp-getc = cpm_serial_getc; -- 1.5.3.7 ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev
[PATCH] [POWERPC] pasemi: Distribute interrupts evenly across cpus
[POWERPC] pasemi: Distribute interrupts evenly across cpus By default the OpenPIC on PWRficient will bias to one core (since that will improve changes of the other core being able to stay idle/powered down). However, this conflicts with most irq load balancing schemes, since setting an interrupt to be delivered to either core doesn't really result in the load being shared. It also doesn't work well with the soft irq disable feature of PPC, since EE will stay on until the first interrupt is taken while soft disabled, but the PIC doesn't know that when choosing the target. There's a conf0 bit to specify that deliveries should be evenly spread (round robin) between the cores. Running in that mode makes more sense for Linux. Signed-off-by: Olof Johansson [EMAIL PROTECTED] diff --git a/arch/powerpc/platforms/pasemi/setup.c b/arch/powerpc/platforms/pasemi/setup.c index 932b2ec..6c37457 100644 --- a/arch/powerpc/platforms/pasemi/setup.c +++ b/arch/powerpc/platforms/pasemi/setup.c @@ -224,7 +224,7 @@ static __init void pas_init_IRQ(void) openpic_addr = of_read_number(opprop, naddr); printk(KERN_DEBUG OpenPIC addr: %lx\n, openpic_addr); - mpic_flags = MPIC_PRIMARY | MPIC_LARGE_VECTORS; + mpic_flags = MPIC_PRIMARY | MPIC_LARGE_VECTORS | MPIC_NO_BIAS; nmiprop = of_get_property(mpic_node, nmi-source, NULL); if (nmiprop) diff --git a/arch/powerpc/sysdev/mpic.c b/arch/powerpc/sysdev/mpic.c index 5a9d8c1..f88ff09 100644 --- a/arch/powerpc/sysdev/mpic.c +++ b/arch/powerpc/sysdev/mpic.c @@ -1279,6 +1279,11 @@ void __init mpic_init(struct mpic *mpic) mpic_read(mpic-gregs, MPIC_INFO(GREG_GLOBAL_CONF_0)) | MPIC_GREG_GCONF_8259_PTHROU_DIS); + if (mpic-flags MPIC_NO_BIAS) + mpic_write(mpic-gregs, MPIC_INFO(GREG_GLOBAL_CONF_0), + mpic_read(mpic-gregs, MPIC_INFO(GREG_GLOBAL_CONF_0)) + | MPIC_GREG_GCONF_NO_BIAS); + /* Set current processor priority to 0 */ mpic_cpu_write(MPIC_INFO(CPU_CURRENT_TASK_PRI), 0); diff --git a/include/asm-powerpc/mpic.h b/include/asm-powerpc/mpic.h index e7ac810..943c5a3 100644 --- a/include/asm-powerpc/mpic.h +++ b/include/asm-powerpc/mpic.h @@ -22,6 +22,7 @@ #define MPIC_GREG_GLOBAL_CONF_00x00020 #defineMPIC_GREG_GCONF_RESET 0x8000 #defineMPIC_GREG_GCONF_8259_PTHROU_DIS 0x2000 +#defineMPIC_GREG_GCONF_NO_BIAS 0x1000 #defineMPIC_GREG_GCONF_BASE_MASK 0x000f #defineMPIC_GREG_GCONF_MCK 0x0800 #define MPIC_GREG_GLOBAL_CONF_10x00030 @@ -350,6 +351,8 @@ struct mpic #define MPIC_LARGE_VECTORS 0x0100 /* Enable delivery of prio 15 interrupts as MCK instead of EE */ #define MPIC_ENABLE_MCK0x0200 +/* Disable bias among target selection, spread interrupts evenly */ +#define MPIC_NO_BIAS 0x0400 /* MPIC HW modification ID */ #define MPIC_REGSET_MASK 0xf000 ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev
[PATCHv3] powerpc: DBox2 Board Support
This patch adds device tree source, default config and setup code for DBox2 devices. Signed-off-by: Jochen Friedrich [EMAIL PROTECTED] --- arch/powerpc/boot/Makefile |4 +- arch/powerpc/boot/cuboot-dbox2.c | 280 arch/powerpc/boot/dts/dbox2.dts | 251 arch/powerpc/configs/dbox2_defconfig | 1034 ++ arch/powerpc/platforms/8xx/Kconfig |7 + arch/powerpc/platforms/8xx/Makefile |1 + arch/powerpc/platforms/8xx/dbox2_setup.c | 173 + 7 files changed, 1749 insertions(+), 1 deletions(-) create mode 100644 arch/powerpc/boot/cuboot-dbox2.c create mode 100644 arch/powerpc/boot/dts/dbox2.dts create mode 100644 arch/powerpc/configs/dbox2_defconfig create mode 100644 arch/powerpc/platforms/8xx/dbox2_setup.c diff --git a/arch/powerpc/boot/Makefile b/arch/powerpc/boot/Makefile index 18e3271..4c9ec63 100644 --- a/arch/powerpc/boot/Makefile +++ b/arch/powerpc/boot/Makefile @@ -55,7 +55,8 @@ src-wlib := string.S crt0.S stdio.c main.c flatdevtree.c flatdevtree_misc.c \ src-plat := of.c cuboot-52xx.c cuboot-83xx.c cuboot-85xx.c holly.c \ cuboot-ebony.c treeboot-ebony.c prpmc2800.c \ ps3-head.S ps3-hvcall.S ps3.c treeboot-bamboo.c cuboot-8xx.c \ - cuboot-pq2.c cuboot-sequoia.c treeboot-walnut.c cuboot-bamboo.c \ + cuboot-pq2.c cuboot-sequoia.c treeboot-walnut.c \ + cuboot-bamboo.c cuboot-dbox2.c \ fixed-head.S ep88xc.c cuboot-hpc2.c src-boot := $(src-wlib) $(src-plat) empty.c @@ -159,6 +160,7 @@ image-$(CONFIG_EBONY) += treeImage.ebony cuImage.ebony image-$(CONFIG_BAMBOO) += treeImage.bamboo cuImage.bamboo image-$(CONFIG_SEQUOIA)+= cuImage.sequoia image-$(CONFIG_WALNUT) += treeImage.walnut +image-$(CONFIG_DBOX2) += cuImage.dbox2 endif # For 32-bit powermacs, build the COFF and miboot images diff --git a/arch/powerpc/boot/cuboot-dbox2.c b/arch/powerpc/boot/cuboot-dbox2.c new file mode 100644 index 000..e54cef2 --- /dev/null +++ b/arch/powerpc/boot/cuboot-dbox2.c @@ -0,0 +1,280 @@ +/* + * Old U-boot compatibility for dbox2 + * + * Copyright (c) 2007 Jochen Friedrich [EMAIL PROTECTED] + * + * Based on cuboot-8xx.c. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 as published + * by the Free Software Foundation. + */ + +#include ops.h +#include stdio.h +#include cuboot.h +#include io.h + +#define TARGET_8xx +#include ppcboot.h + +static bd_t bd; + +#defineMAX_PROP_LEN256 /* What should this be? */ +#define DBOX2_VENDOR_OFFSET(0x1ffe0) + +enum dbox2_mid { + DBOX2_MID_UNKNOWN = 0, + DBOX2_MID_NOKIA = 1, + DBOX2_MID_PHILIPS = 2, + DBOX2_MID_SAGEM = 3, +}; + +struct dbox2_board_info { + enum dbox2_mid mid; + char *model; + char *avs; + char *demux; + char *fp; + u32 cs3start; + u32 cs3size; + u32 cs5start; + u32 cs5size; + u32 cs6start; + u32 cs6size; + u32 cs7start; + u32 cs7size; + u32 demux0cs; + u32 demux0start; + u32 demux0size; + u32 demux1cs; + u32 demux1start; + u32 demux1size; + u32 fp_id; +}; + +static struct dbox2_board_info dbox2_board_info[] = { + { + .mid= DBOX2_MID_NOKIA, + .model = nokia,dbox2, + .avs= sony,cxa2092, + .demux = c-cube,gtx, + .fp = [EMAIL PROTECTED], + .cs3start = 0x0c00, + .cs3size= 0x0004, + .cs5start = 0x0800, + .cs5size= 0x0020, + .cs6start = 0x0b00, + .cs6size= 0x8000, + .cs7start = 0x0840, + .cs7size= 0x8000, + .demux0cs = 7, + .demux0start= 0x, + .demux0size = 0x3000, + .demux1cs = 5, + .demux1start= 0x, + .demux1size = 0x0020, + .fp_id = 0x5a, + }, + { + .mid= DBOX2_MID_PHILIPS, + .model = philips,dbox2, + .avs= stm,stv6412, + .demux = c-cube,enx, + .fp = [EMAIL PROTECTED], + .cs3start = 0x0c04, + .cs3size= 0x0004, + .cs5start = 0x0800, + .cs5size= 0x8000, + .cs6start = 0x0b00, + .cs6size= 0x8000, + .cs7start =
Re: Problems with arch/powerpc
Josh Boyer wrote: Does the setjmp call use floating point instructions? I'm wondering if the APU isn't enabled for the FPU on the Yosemite board for some reason. If that wasn't enabled, weird things would happen. That was it! The cputable did not have an entry for the 440EP Rev C! So the FPU flag was not being set. Cheers, Sean ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev
Re: SCSI errors on powerpc with 2.6.24-rc6-mm1
On Fri, 28 Dec 2007 13:05:39 +0530 Balbir Singh [EMAIL PROTECTED] wrote: FUJITA Tomonori wrote: [snip] Thanks, Can you try this? diff --git a/lib/iommu-helper.c b/lib/iommu-helper.c index e7d8544..495575a 100644 --- a/lib/iommu-helper.c +++ b/lib/iommu-helper.c @@ -8,15 +8,20 @@ static unsigned long find_next_zero_area(unsigned long *map, unsigned long size, unsigned long start, -unsigned int nr) +unsigned int nr, +unsigned long align_mask) { unsigned long index, end, i; again: index = find_next_zero_bit(map, size, start); + + /* Align allocation */ + index = (index + align_mask) ~align_mask; + end = index + nr; - if (end size) + if (end = size) return -1; - for (i = index + 1; i end; i++) { + for (i = index; i end; i++) { if (test_bit(i, map)) { start = i+1; goto again; @@ -50,9 +55,8 @@ unsigned long iommu_area_alloc(unsigned long *map, unsigned long size, { unsigned long index; again: - index = find_next_zero_area(map, size, start, nr); + index = find_next_zero_area(map, size, start, nr, align_mask); if (index != -1) { - index = (index + align_mask) ~align_mask; if (is_span_boundary(index, nr, shift, boundary_size)) { /* we could do more effectively */ start = index + 1; This on top of -mm? Or on top of the reverted iommu patch. Oops, it's for -mm. Thanks, ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev
External int in dts
I have an FPGA which uses external int 1, which is interrupt 24 on UIC0. I tried the following entry in various places: FPGA0: fpga { compatible = pika,fpga; interrupts = 18 4; interrupt-parent = UIC0; }; Any hints, or is this the wrong way to enable an external int? Cheers, Sean ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev
Re: Problems with arch/powerpc
On Fri, 28 Dec 2007 11:28:02 -0500 Sean MacLennan [EMAIL PROTECTED] wrote: Josh Boyer wrote: Does the setjmp call use floating point instructions? I'm wondering if the APU isn't enabled for the FPU on the Yosemite board for some reason. If that wasn't enabled, weird things would happen. That was it! The cputable did not have an entry for the 440EP Rev C! So the FPU flag was not being set. Cool! Care to send a patch to add that entry? josh ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev
Re: External int in dts
On Friday 28 December 2007, Sean MacLennan wrote: I have an FPGA which uses external int 1, which is interrupt 24 on UIC0. I tried the following entry in various places: FPGA0: fpga { compatible = pika,fpga; interrupts = 18 4; Is the interrupt level sensitive and active high? Then 4 is correct here. But if it is active low then you should use 8 here. Best regards, Stefan = DENX Software Engineering GmbH, MD: Wolfgang Denk Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: +49-8142-66989-0 Fax: +49-8142-66989-80 Email: [EMAIL PROTECTED] = ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev
Re: [2.6.24 patch] restore Cell OProfile support
* Adrian Bunk ([EMAIL PROTECTED]) wrote: This patch restores the Cell OProfile support that was killed by commit 09cadedbdc01f1a4bea1f427d4fb4642eaa19da9. Signed-off-by: Adrian Bunk [EMAIL PROTECTED] Same here : why isn't this on by default when SPU_FS and OPROFILE are enabled ? --- kernel/Kconfig.instrumentation |8 1 file changed, 8 insertions(+) 6d1446d35d367fdbdd2a0a29e0d156646ff40630 diff --git a/kernel/Kconfig.instrumentation b/kernel/Kconfig.instrumentation index a76635d..9d143e6 100644 --- a/kernel/Kconfig.instrumentation +++ b/kernel/Kconfig.instrumentation @@ -53,2 +53,10 @@ config HARDWARE_PM +config OPROFILE_CELL + bool OProfile for Cell Broadband Engine + depends on PPC (SPU_FS = y OPROFILE = m) || (SPU_FS = y OPROFILE = y) + default y + help + Profiling of Cell BE SPUs requires special support enabled + by this option. + config KPROBES -- Mathieu Desnoyers Computer Engineering Ph.D. Student, Ecole Polytechnique de Montreal OpenPGP key fingerprint: 8CD5 52C3 8E3C 4140 715F BA06 3F25 A8FE 3BAE 9A68 ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev
[2.6.24 patch] restore Cell OProfile support
This patch restores the Cell OProfile support that was killed by commit 09cadedbdc01f1a4bea1f427d4fb4642eaa19da9. Signed-off-by: Adrian Bunk [EMAIL PROTECTED] --- kernel/Kconfig.instrumentation |8 1 file changed, 8 insertions(+) 6d1446d35d367fdbdd2a0a29e0d156646ff40630 diff --git a/kernel/Kconfig.instrumentation b/kernel/Kconfig.instrumentation index a76635d..9d143e6 100644 --- a/kernel/Kconfig.instrumentation +++ b/kernel/Kconfig.instrumentation @@ -53,2 +53,10 @@ config HARDWARE_PM +config OPROFILE_CELL + bool OProfile for Cell Broadband Engine + depends on PPC (SPU_FS = y OPROFILE = m) || (SPU_FS = y OPROFILE = y) + default y + help + Profiling of Cell BE SPUs requires special support enabled + by this option. + config KPROBES ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev
Re: External int in dts
Stefan Roese wrote: On Friday 28 December 2007, Sean MacLennan wrote: I have an FPGA which uses external int 1, which is interrupt 24 on UIC0. I tried the following entry in various places: FPGA0: fpga { compatible = pika,fpga; interrupts = 18 4; Is the interrupt level sensitive and active high? Then 4 is correct here. But if it is active low then you should use 8 here. It was active low. Thank you. I got it working. You do need some glue logic. Basically the following two lines (ignoring all error checking): np = of_find_compatible_node(NULL, NULL, pika,fpga); irq = irq_of_parse_and_map(np, 0); Simple! Cheers, Sean ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev
Re: Please pull powerpc.git merge branch
Paul Mackerras wrote: Linus, Please do git pull \ git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc.git merge This broke Cell builds. arch/powerpc/platforms/cell/spufs/sched.c:200: multiple definition of `.notify_spus_active' arch/powerpc/platforms/cell/spu_syscalls.c:149: first defined here commit aed3a8c9bb1a8623a618232087c5ff62718e3b9a Author: Bob Nelson [EMAIL PROTECTED] Date: Sat Dec 15 01:27:30 2007 +1100 [POWERPC] Oprofile: Remove dependency on spufs module Looking at the code, it seems just when CONFIG_SPU_FS=y, not when =m. I'll try to make a fix. -Geoff ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev
[PATCH v2 1/4] USB: add Cypress c67x00 low level interface code
From: Grant Likely [EMAIL PROTECTED] This patch adds the low level support code for the Cypress c67x00 family of OTG controllers. The low level code is responsible for register access and implements the software protocol for communicating with the c67x00 device. Signed-off-by: Grant Likely [EMAIL PROTECTED] --- drivers/usb/c67x00/c67x00-ll-hpi.c | 516 drivers/usb/c67x00/c67x00.h| 242 + 2 files changed, 758 insertions(+), 0 deletions(-) diff --git a/drivers/usb/c67x00/c67x00-ll-hpi.c b/drivers/usb/c67x00/c67x00-ll-hpi.c new file mode 100644 index 000..d6a95d6 --- /dev/null +++ b/drivers/usb/c67x00/c67x00-ll-hpi.c @@ -0,0 +1,516 @@ +/* + * c67x00-ll-hpi.c: Cypress C67X00 USB Low level interface using HPI + * + * Copyright (C) 2006-2007 Barco N.V. + *Derived from the Cypress cy7c67200/300 ezusb linux driver and + *based on multiple host controller drivers inside the linux kernel. + * + * 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. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301 USA. + */ + +#include asm/io.h +#include asm/byteorder.h +#include c67x00.h + +/* -- */ +/* Interface definitions */ + +#define COMM_ACK 0x0FED +#define COMM_NAK 0xDEAD + +#define COMM_CTRL_REG_ADDR 0x01BC +#define COMM_CTRL_REG_DATA 0x01BE +#define COMM_CTRL_REG_LOGIC0x01C0 +#define COMM_WRITE_CTRL_REG0xCE03 +#define COMM_READ_CTRL_REG 0xCE02 + +#define COMM_RESET 0xFA50 +#define COMM_EXEC_INT 0xCE01 +#define COMM_INT_NUM 0x01C2 +/* Registers 0 to COMM_REGS-1 */ +#define COMM_R(x) (0x01C4 + 2 * (x)) + +#define HUSB_SIE_pCurrentTDPtr(x) ( (x) ? 0x01B2 : 0x01B0 ) +#define HUSB_SIE_pTDListDone_Sem(x)( (x) ? 0x01B8 : 0x01B6 ) +#define HUSB_pEOT 0x01B4 + +/* Software interrupts */ +/* 114, 115: */ +#define HUSB_SIE_INIT_INT(x) ( (x) ? 0x0073 : 0x0072 ) +#define HUSB_RESET_INT 0x0074 /* 116 */ + +#define SUSB_INIT_INT 0x0071 +/* - + * HPI implementation + * + * The c67x00 chip also support control via SPI or HSS serial + * interfaces. However, this driver assumes that register access can + * be performed from IRQ context. While this is a safe assuption with + * the HPI interface, it is not true for the serial interfaces. + */ + +/* HPI registers */ +#define HPI_DATA 0 +#define HPI_MAILBOX1 +#define HPI_ADDR 2 +#define HPI_STATUS 3 + +static inline u16 hpi_read_reg(struct c67x00_device *dev, int reg) +{ + return __raw_readw(dev-hpi.base + reg * dev-hpi.regstep); +} + +static inline void hpi_write_reg(struct c67x00_device *dev, int reg, u16 value) +{ + __raw_writew(value, dev-hpi.base + reg * dev-hpi.regstep); +} + +static inline u16 hpi_read_word_nolock(struct c67x00_device *dev, u16 reg) +{ + hpi_write_reg(dev, HPI_ADDR, reg); + return hpi_read_reg(dev, HPI_DATA); +} + +static inline u16 hpi_read_word(struct c67x00_device *dev, u16 reg) +{ + u16 value; + unsigned long flags; + + spin_lock_irqsave(dev-hw_lock, flags); + value = hpi_read_word_nolock(dev, reg); + spin_unlock_irqrestore(dev-hw_lock, flags); + + return value; +} + +static inline void hpi_write_word_nolock(struct c67x00_device *dev, u16 reg, +u16 value) +{ + hpi_write_reg(dev, HPI_ADDR, reg); + hpi_write_reg(dev, HPI_DATA, value); +} + +static inline void hpi_write_word(struct c67x00_device *dev, u16 reg, u16 value) +{ + unsigned long flags; + + spin_lock_irqsave(dev-hw_lock, flags); + hpi_write_word_nolock(dev, reg, value); + spin_unlock_irqrestore(dev-hw_lock, flags); +} + +/* + * Only data is little endian, addr has cpu endianess + */ +static inline void hpi_write_words_le16(struct c67x00_device *dev, u16 addr, + u16 * data, u16 count) +{ + unsigned long flags; + int i; + + spin_lock_irqsave(dev-hw_lock, flags); + + hpi_write_reg(dev, HPI_ADDR, addr); + for (i
[PATCH v2 0/4] Add C67x00 USB HCD driver.
This patch series is based on the c67x00 work done by Peter Korsgaard and posted back in April this year. I posted my first rework to the series on Nov 23. This version addresses the comments that I received then. The Cypress c67x00 is an OTG controller so it can behave as either a host or gadget controller. This series implements the HCD behaviour. The c67x00 is found on a number of the Xilinx MLxxx series of boards. I've been performing my testing on a board derived from the ML403. I'd like to get this driver queued up for inclusion in 2.6.25. I think it is ready. This series can also be pulled from my git tree here: git://git.secretlab.ca/git/linux-2.6-virtex.git virtex-c67x00 For those who are interested in the progression from Peter's original series to this one, the full history of my changes can be found in here: git://git.secretlab.ca/git/linux-2.6-virtex.git virtex-c67x00-historical Thanks, g. Grant Likely (4): USB: add Cypress c67x00 low level interface code USB: add Cypress c67x00 OTG controller core driver USB: add Cypress c67x00 OTG controller HCD driver USB: add Cypress c67x00 OTG controller driver to Kconfig and Makefiles drivers/usb/Makefile |2 + drivers/usb/c67x00/Makefile| 11 + drivers/usb/c67x00/c67x00-drv.c| 278 + drivers/usb/c67x00/c67x00-hcd.c| 392 drivers/usb/c67x00/c67x00-hcd.h| 137 drivers/usb/c67x00/c67x00-ll-hpi.c | 516 +++ drivers/usb/c67x00/c67x00-sched.c | 1205 drivers/usb/c67x00/c67x00.h| 242 drivers/usb/host/Kconfig | 12 + include/linux/usb/c67x00.h | 45 ++ 10 files changed, 2840 insertions(+), 0 deletions(-) create mode 100644 drivers/usb/c67x00/Makefile create mode 100644 drivers/usb/c67x00/c67x00-drv.c create mode 100644 drivers/usb/c67x00/c67x00-hcd.c create mode 100644 drivers/usb/c67x00/c67x00-hcd.h create mode 100644 drivers/usb/c67x00/c67x00-ll-hpi.c create mode 100644 drivers/usb/c67x00/c67x00-sched.c create mode 100644 drivers/usb/c67x00/c67x00.h create mode 100644 include/linux/usb/c67x00.h -- Grant Likely, B.Sc. P.Eng. Secret Lab Technologies Ltd. ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev
[PATCH v2 4/4] USB: add Cypress c67x00 OTG controller driver to Kconfig and Makefiles
From: Grant Likely [EMAIL PROTECTED] add c67x00 driver to build Signed-off-by: Grant Likely [EMAIL PROTECTED] --- drivers/usb/Makefile|2 ++ drivers/usb/c67x00/Makefile | 11 +++ drivers/usb/host/Kconfig| 12 3 files changed, 25 insertions(+), 0 deletions(-) diff --git a/drivers/usb/Makefile b/drivers/usb/Makefile index 516a640..a419c42 100644 --- a/drivers/usb/Makefile +++ b/drivers/usb/Makefile @@ -17,6 +17,8 @@ obj-$(CONFIG_USB_SL811_HCD) += host/ obj-$(CONFIG_USB_U132_HCD) += host/ obj-$(CONFIG_USB_R8A66597_HCD) += host/ +obj-$(CONFIG_USB_C67X00_HCD) += c67x00/ + obj-$(CONFIG_USB_ACM) += class/ obj-$(CONFIG_USB_PRINTER) += class/ diff --git a/drivers/usb/c67x00/Makefile b/drivers/usb/c67x00/Makefile new file mode 100644 index 000..7e6eb0b --- /dev/null +++ b/drivers/usb/c67x00/Makefile @@ -0,0 +1,11 @@ +# +# Makefile for Cypress C67X00 USB Controller +# + +ifeq ($(CONFIG_USB_DEBUG),y) + EXTRA_CFLAGS+= -DDEBUG +endif + +obj-$(CONFIG_USB_C67X00_HCD) += c67x00.o + +c67x00-objs := c67x00-drv.o c67x00-ll-hpi.o c67x00-hcd.o c67x00-sched.o diff --git a/drivers/usb/host/Kconfig b/drivers/usb/host/Kconfig index 49a91c5..49521d1 100644 --- a/drivers/usb/host/Kconfig +++ b/drivers/usb/host/Kconfig @@ -261,3 +261,15 @@ config USB_R8A66597_HCD To compile this driver as a module, choose M here: the module will be called r8a66597-hcd. +config USB_C67X00_HCD + tristate Cypress C67x00 HCD support + depends on USB + help + The Cypress C67x00 (EZ-Host/EZ-OTG) chips are dual-role + host/peripheral/OTG USB controllers. + + Enable this option to support this chip in host controller mode. + If unsure, say N. + + To compile this driver as a module, choose M here: the + module will be called c67x00. ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev
[PATCH v2 2/4] USB: add Cypress c67x00 OTG controller core driver
From: Grant Likely [EMAIL PROTECTED] This patch add the core driver for the c67x00 USB OTG controller. The core driver is responsible for the platform bus binding and creating either USB HCD or USB Gadget instances for each of the serial interface engines on the chip. This driver does not directly implement the HCD or gadget behaviours; it just controls access to the chip. Signed-off-by: Grant Likely [EMAIL PROTECTED] --- drivers/usb/c67x00/c67x00-drv.c | 278 +++ include/linux/usb/c67x00.h | 45 ++ 2 files changed, 323 insertions(+), 0 deletions(-) diff --git a/drivers/usb/c67x00/c67x00-drv.c b/drivers/usb/c67x00/c67x00-drv.c new file mode 100644 index 000..be90002 --- /dev/null +++ b/drivers/usb/c67x00/c67x00-drv.c @@ -0,0 +1,278 @@ +/* + * c67x00-drv.c: Cypress C67X00 USB Common infrastructure + * + * Copyright (C) 2006-2007 Barco N.V. + *Derived from the Cypress cy7c67200/300 ezusb linux driver and + *based on multiple host controller drivers inside the linux kernel. + * + * 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. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301 USA. + */ + +/* + * This file implements the common infrastructure for using the c67x00. + * It is both the link between the platform configuration and subdrivers and + * the link between the common hardware parts and the subdrivers (e.g. + * interrupt handling). + * + * The c67x00 has 2 SIE's (serial interface engine) wich can be configured + * to be host, device or OTG (with some limitations, E.G. only SIE1 can be OTG). + * + * Depending on the platform configuration, the SIE's are created (setup_sie) + * and the corresponding subdriver is initialized (c67x00_probe_sie). + */ + +#include linux/device.h +#include linux/list.h +#include linux/usb.h +#include linux/usb/c67x00.h +#include asm/io.h + +#include c67x00.h + +static struct platform_driver c67x00_driver; + +static void +c67x00_setup_sie(struct c67x00_sie *sie, struct c67x00_device *dev, int sie_num) +{ + static unsigned int id = 0; + + /* Fill in needed attributes */ + sie-pdev = platform_device_register_simple(c67x00_sie, + id++, NULL, 0); + /* driver used in hub.c: hub_port_init */ + sie-pdev-dev.driver = c67x00_driver.driver; + spin_lock_init(sie-lock); + sie-dev = dev; + sie-sie_num = sie_num; + sie-mode = c67x00_sie_config(dev-pdata-sie_config, sie_num); +} + +static void c67x00_teardown_sie(struct c67x00_sie *sie) +{ + sie-pdev-dev.driver = NULL; + platform_device_unregister(sie-pdev); +} + +/* -- */ + +static void c67x00_probe_sie(struct c67x00_sie *sie) +{ + switch (c67x00_sie_config(sie-dev-pdata-sie_config, sie-sie_num)) { + case C67X00_SIE_HOST: + c67x00_hcd_probe(sie); + break; + + case C67X00_SIE_UNUSED: + dev_info(sie_dev(sie), +Not using SIE %d as requested\n, sie-sie_num); + break; + + default: + dev_err(sie_dev(sie), + Unsupported configuration: 0x%x for SIE %d\n, + c67x00_sie_config(sie-dev-pdata-sie_config, + sie-sie_num), sie-sie_num); + break; + } +} + +static void c67x00_remove_sie(struct c67x00_sie *sie) +{ + switch (c67x00_sie_config(sie-dev-pdata-sie_config, sie-sie_num)) { + case C67X00_SIE_HOST: + c67x00_hcd_remove(sie); + break; + + default: + break; + } +} + +/* -- */ + +static irqreturn_t c67x00_irq(int irq, void *__dev) +{ + struct c67x00_device *c67x00 = __dev; + struct c67x00_sie *sie; + u16 msg; + int i, count = 8; + + c67x00-int_status = c67x00_ll_hpi_status(c67x00); + if (!c67x00-int_status) + return IRQ_NONE; + + while (c67x00-int_status != 0 (count-- = 0)) { + c67x00_ll_irq(c67x00); + for (i = 0; i C67X00_SIES; i++) { + sie = c67x00-sie[i]; + msg = 0; + spin_lock(sie-lock); +
[PATCH v2 3/4] USB: add Cypress c67x00 OTG controller HCD driver
From: Grant Likely [EMAIL PROTECTED] This patch adds HDC support for the Cypress c67x00 family of devices. Signed-off-by: Grant Likely [EMAIL PROTECTED] --- drivers/usb/c67x00/c67x00-hcd.c | 392 drivers/usb/c67x00/c67x00-hcd.h | 137 drivers/usb/c67x00/c67x00-sched.c | 1205 + 3 files changed, 1734 insertions(+), 0 deletions(-) diff --git a/drivers/usb/c67x00/c67x00-hcd.c b/drivers/usb/c67x00/c67x00-hcd.c new file mode 100644 index 000..5fabd3c --- /dev/null +++ b/drivers/usb/c67x00/c67x00-hcd.c @@ -0,0 +1,392 @@ +/* + * c67x00-hcd.c: Cypress C67X00 USB Host Controller Driver + * + * Copyright (C) 2006-2007 Barco N.V. + *Derived from the Cypress cy7c67200/300 ezusb linux driver and + *based on multiple host controller drivers inside the linux kernel. + * + * 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. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301 USA. + */ + +#include linux/device.h +#include linux/platform_device.h +#include linux/usb.h + +#include c67x00.h +#include c67x00-hcd.h + +/* -- + * Root Hub Support + */ + +static __u8 c67x00_hub_des[] = { + 0x09, /* __u8 bLength; */ + 0x29, /* __u8 bDescriptorType; Hub-descriptor */ + 0x02, /* __u8 bNbrPorts; */ + 0x00, /* __u16 wHubCharacteristics; */ + 0x00, /* (per-port OC, no power switching) */ + 0x32, /* __u8 bPwrOn2pwrGood; 2ms */ + 0x00, /* __u8 bHubContrCurrent; 0 mA */ + 0x00, /* __u8 DeviceRemovable; ** 7 Ports max ** */ + 0xff, /* __u8 PortPwrCtrlMask; ** 7 ports max ** */ +}; + +#define OK(x) len = (x); break + +static void c67x00_hub_reset_host_port(struct c67x00_sie *sie, int port) +{ + struct c67x00_hcd *c67x00 = sie-private_data; + unsigned long flags; + + c67x00_ll_husb_reset(sie, port); + + spin_lock_irqsave(c67x00-lock, flags); + c67x00_ll_husb_reset_port(sie, port); + spin_unlock_irqrestore(c67x00-lock, flags); + + c67x00_ll_set_husb_eot(sie-dev, DEFAULT_EOT); +} + +static int c67x00_hub_status_data(struct usb_hcd *hcd, char *buf) +{ + struct c67x00_hcd *c67x00 = hcd_to_c67x00_hcd(hcd); + struct c67x00_sie *sie = c67x00-sie; + u16 status; + int i; + + *buf = 0; + status = c67x00_ll_husb_get_status(sie); + for (i=0; iC67X00_PORTS; i++) + if (status PORT_CONNECT_CHANGE(i)) + *buf |= (1 i); + + /* bit 0 denotes hub change, b1..n port change */ + *buf = 1; + + return !!*buf; +} + +static int c67x00_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue, + u16 wIndex, char *buf, u16 wLength) +{ + struct c67x00_hcd *c67x00 = hcd_to_c67x00_hcd(hcd); + struct c67x00_sie *sie = c67x00-sie; + u16 status, usb_status; + int len = 0; + unsigned int port = wIndex-1; + u16 wPortChange, wPortStatus; + + switch (typeReq) { + + case GetHubStatus: + *(__le32 *) buf = cpu_to_le32(0); + len = 4;/* hub power */ + break; + case GetPortStatus: + if (wIndex C67X00_PORTS) + return -EPIPE; + + status = c67x00_ll_husb_get_status(sie); + usb_status = c67x00_ll_get_usb_ctl(sie); + + wPortChange = 0; + if (status PORT_CONNECT_CHANGE(port)) + wPortChange |= USB_PORT_STAT_C_CONNECTION; + + wPortStatus = USB_PORT_STAT_POWER; + if (!(status PORT_SE0_STATUS(port))) + wPortStatus |= USB_PORT_STAT_CONNECTION; + if (usb_status LOW_SPEED_PORT(port)) { + wPortStatus |= USB_PORT_STAT_LOW_SPEED; + c67x00-low_speed_ports |= (1 port); + } else + c67x00-low_speed_ports = ~(1 port); + + if (usb_status SOF_EOP_EN(port)) + wPortStatus |= USB_PORT_STAT_ENABLE; + + *(__le16 *) buf =
Re: [PATCH/RFC] Add support for PowerQUICC watchdog
Hi Jochen, Just a couple of suggestions. On Fri, 28 Dec 2007 16:13:11 +0100 Jochen Friedrich [EMAIL PROTECTED] wrote: +int __init pq_wdt_early_init(void) +{ + data = of_get_property(soc, bus-frequency, NULL); + if (!data) { + of_node_put(soc); + printk(KERN_ERR Could not find bus-frequency in soc node\n); + ret = -ENODEV; + goto out; + } + of_node_put(soc); If you move the of_node_put(soc) just above the if (!data) then you won't need to repeat it. +static struct of_platform_driver pq_wdt_driver = { + .owner = THIS_MODULE, + .name = pq-wdt, + .match_table= pq_wdt_match, + .probe = pq_wdt_probe, + .remove = pq_wdt_remove, +}; We are removing the owner and name fields from struct of_platform_driver, so the preferred initialization looks like this: static struct of_platform_driver pq_wdt_driver = { .match_table= pq_wdt_match, .probe = pq_wdt_probe, .remove = pq_wdt_remove, .driver = { .name = pq-wdt, .owner = THIS_MODULE, } }; or similar. -- Cheers, Stephen Rothwell[EMAIL PROTECTED] http://www.canb.auug.org.au/~sfr/ pgp84ie4KdPEY.pgp Description: PGP signature ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev
Re: [PATCH v2 2/4] USB: add Cypress c67x00 OTG controller core driver
Hi Grant, Just one nit ... On Fri, 28 Dec 2007 16:52:36 -0700 Grant Likely [EMAIL PROTECTED] wrote: +static int __devinit c67x00_drv_probe(struct platform_device *pdev) +{ + struct c67x00_device *c67x00; + struct c67x00_platform_data *pdata; + struct resource *res, *res2; + int ret, i; + + res = platform_get_resource(pdev, IORESOURCE_MEM, 0); + if (!res) + return -ENODEV; + + res2 = platform_get_resource(pdev, IORESOURCE_IRQ, 0); + if (!res2) + return -ENODEV; + + pdata = (struct c67x00_platform_data*)pdev-dev.platform_data; This cast is unnecessary. -- Cheers, Stephen Rothwell[EMAIL PROTECTED] http://www.canb.auug.org.au/~sfr/ pgpgMfPZ45Gvo.pgp Description: PGP signature ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev
Re: [PATCH v2 3/4] USB: add Cypress c67x00 OTG controller HCD driver
Hi Grant, Just did a superficial look over this. On Fri, 28 Dec 2007 16:52:41 -0700 Grant Likely [EMAIL PROTECTED] wrote: +++ b/drivers/usb/c67x00/c67x00-hcd.c + +#define OK(x)len = (x); break I was going to say URK! but it looks like it is not used, so just remove it. +static int c67x00_hub_status_data(struct usb_hcd *hcd, char *buf) +{ + struct c67x00_hcd *c67x00 = hcd_to_c67x00_hcd(hcd); + struct c67x00_sie *sie = c67x00-sie; + u16 status; + int i; + + *buf = 0; + status = c67x00_ll_husb_get_status(sie); + for (i=0; iC67X00_PORTS; i++) Spacing. +static int c67x00_hcd_get_frame(struct usb_hcd *hcd) +{ + struct c67x00_hcd *c67x00 = hcd_to_c67x00_hcd(hcd); + u16 temp_val; + dev_dbg(c67x00_hcd_dev(c67x00), %s\n, __FUNCTION__); We normally put a blank line between declarations and code. -- Cheers, Stephen Rothwell[EMAIL PROTECTED] http://www.canb.auug.org.au/~sfr/ pgpcV3VvQLraW.pgp Description: PGP signature ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev