* Re: [patch 6/6] Walnut zImage wrapper
From: Josh Boyer @ 2007-09-24 12:25 UTC (permalink / raw)
To: Wolfgang Grandegger; +Cc: linuxppc-dev, David Gibson
In-Reply-To: <46F7AB94.9060007@grandegger.com>
On Mon, 24 Sep 2007 14:20:36 +0200
Wolfgang Grandegger <wg@grandegger.com> wrote:
> Josh Boyer wrote:
> > On Mon, 24 Sep 2007 09:49:33 +0200
> > Wolfgang Grandegger <wg@grandegger.com> wrote:
> >> The addition of treeboot-walnut.c breaks compilation of Linux-2.6 for
> >> the lite5200 using the ppc_6xx toolchain of the ELDK 4.1:
> >>
> >> MODPOST vmlinux.o
> >> WARNING: vmlinux.o(.text+0x14): Section mismatch: reference to
> >> .init.text:prom_init (between '__start' and '__after_mmu_off')
> >> WARNING: vmlinux.o(.text+0x28): Section mismatch: reference to
> >> .init.text:early_init (between '__start' and '__after_mmu_off')
> >> WARNING: vmlinux.o(.text+0x340c): Section mismatch: reference to
> >> .init.text:machine_init (between 'start_here' and 'set_context')
> >> WARNING: vmlinux.o(.text+0x3414): Section mismatch: reference to
> >> .init.text:MMU_init (between 'start_here' and 'set_context')
> >> WARNING: vmlinux.o(.text+0x343e): Section mismatch: reference to
> >> .init.text:start_kernel (between 'start_here' and 'set_context')
> >> WARNING: vmlinux.o(.text+0x3442): Section mismatch: reference to
> >> .init.text:start_kernel (between 'start_here' and 'set_context')
> >> GEN .version
> >> CHK include/linux/compile.h
> >> UPD include/linux/compile.h
> >> CC init/version.o
> >> LD init/built-in.o
> >> LD vmlinux
> >> SYSMAP System.map
> >> BOOTAS arch/powerpc/boot/string.o
> >> BOOTAS arch/powerpc/boot/crt0.o
> >> BOOTCC arch/powerpc/boot/stdio.o
> >> BOOTCC arch/powerpc/boot/main.o
> >> BOOTCC arch/powerpc/boot/flatdevtree.o
> >> BOOTCC arch/powerpc/boot/flatdevtree_misc.o
> >> BOOTCC arch/powerpc/boot/ns16550.o
> >> BOOTCC arch/powerpc/boot/serial.o
> >> BOOTCC arch/powerpc/boot/simple_alloc.o
> >> BOOTAS arch/powerpc/boot/div64.o
> >> BOOTAS arch/powerpc/boot/util.o
> >> BOOTCC arch/powerpc/boot/gunzip_util.o
> >> BOOTCC arch/powerpc/boot/elf_util.o
> >> BOOTCC arch/powerpc/boot/inffast.o
> >> BOOTCC arch/powerpc/boot/inflate.o
> >> BOOTCC arch/powerpc/boot/inftrees.o
> >> BOOTCC arch/powerpc/boot/devtree.o
> >> BOOTCC arch/powerpc/boot/oflib.o
> >> BOOTCC arch/powerpc/boot/ofconsole.o
> >> BOOTCC arch/powerpc/boot/4xx.o
> >> BOOTCC arch/powerpc/boot/ebony.o
> >> BOOTCC arch/powerpc/boot/mv64x60.o
> >> BOOTCC arch/powerpc/boot/mpsc.o
> >> BOOTCC arch/powerpc/boot/mv64x60_i2c.o
> >> BOOTCC arch/powerpc/boot/cuboot.o
> >> BOOTCC arch/powerpc/boot/bamboo.o
> >> BOOTAR arch/powerpc/boot/wrapper.a
> >> BOOTCC arch/powerpc/boot/of.o
> >> BOOTCC arch/powerpc/boot/cuboot-83xx.o
> >> BOOTCC arch/powerpc/boot/cuboot-85xx.o
> >> BOOTCC arch/powerpc/boot/holly.o
> >> BOOTCC arch/powerpc/boot/cuboot-ebony.o
> >> BOOTCC arch/powerpc/boot/treeboot-ebony.o
> >> BOOTCC arch/powerpc/boot/prpmc2800.o
> >> BOOTAS arch/powerpc/boot/ps3-head.o
> >> BOOTAS arch/powerpc/boot/ps3-hvcall.o
> >> BOOTCC arch/powerpc/boot/ps3.o
> >> BOOTCC arch/powerpc/boot/treeboot-bamboo.o
> >> BOOTCC arch/powerpc/boot/cuboot-sequoia.o
> >> BOOTCC arch/powerpc/boot/treeboot-walnut.o
> >> {standard input}: Assembler messages:
> >> {standard input}:184: Error: Unrecognized opcode: `mfdcr'
> >> {standard input}:185: Error: Unrecognized opcode: `mfdcr'
> >> {standard input}:186: Error: Unrecognized opcode: `mfdcr'
> >> {standard input}:217: Error: Unrecognized opcode: `mtdcr'
> >> make[1]: *** [arch/powerpc/boot/treeboot-walnut.o] Error 1
> >> make: *** [uImage] Error 2
> >>
> >> It looks like the ppc_6xx toolchain does not know the opcode above. I
> >> wonder why files for other PowerPC sub-archs like 4xx are compiled with
> >> the wrong compiler. Have I missed something?
> >
> > No, you haven't missed anything. I need a one line patch to fix it.
> > Could you try the patch below to make sure it works for you?
>
> It works for me with one typo corrected (see below).
Ah, yes. That's what I get for coding before coffee.
Thanks Wolfgang.
josh
^ permalink raw reply
* 2.6.23-rc7-mm1 -- powerpc rtas panic
From: Andy Whitcroft @ 2007-09-24 12:35 UTC (permalink / raw)
To: Andrew Morton; +Cc: linuxppc-dev, linux-kernel
In-Reply-To: <20070924021716.9bfe7dfb.akpm@linux-foundation.org>
Seeing the following from an older power LPAR, pretty sure we had
this in the previous -mm also:
Unable to handle kernel paging request for data at address 0x00000000
Faulting instruction address: 0xc000000000047ac8
cpu 0x0: Vector: 300 (Data Access) at [c00000000058f750]
pc: c000000000047ac8: .pSeries_log_error+0x364/0x420
lr: c000000000047a4c: .pSeries_log_error+0x2e8/0x420
sp: c00000000058f9d0
msr: 8000000000001032
dar: 0
dsisr: 42000000
current = 0xc0000000004a9b30
paca = 0xc0000000004aa700
pid = 0, comm = swapper
enter ? for help
[c00000000058faf0] c000000000021164 .rtas_call+0x200/0x250
[c00000000058fba0] c000000000049cd0 .early_enable_eeh+0x168/0x360
[c00000000058fc70] c00000000002f674 .traverse_pci_devices+0x8c/0x138
[c00000000058fd10] c000000000460ce8 .eeh_init+0x1a8/0x200
[c00000000058fdb0] c00000000045fb70 .pSeries_setup_arch+0x128/0x234
[c00000000058fe40] c00000000044f830 .setup_arch+0x214/0x24c
[c00000000058fee0] c000000000446a38 .start_kernel+0xd4/0x3e4
[c00000000058ff90] c000000000373194 .start_here_common+0x54/0x58
This machine is a:
processor : 0
cpu : POWER4+ (gq)
clock : 1703.965296MHz
revision : 19.0
[...]
timebase : 212995662
machine : CHRP IBM,7040-681
-apw
^ permalink raw reply
* Re: [PATCH0/4] Various bug fixes
From: Marcelo Tosatti @ 2007-09-24 12:43 UTC (permalink / raw)
To: Jochen Friedrich, Paul Mackerras; +Cc: linux-kernel, linuxppc-embedded
In-Reply-To: <46F6C9B0.8020200@scram.de>
Paul, please apply.
On Sun, Sep 23, 2007 at 10:16:48PM +0200, Jochen Friedrich wrote:
> Here is a series fixing some bugs for 8xx powerpc CPUs.
>
> 1. [POWERPC] Fix copy'n'paste typo in commproc.c
> 2. [PPC] Fix cpm_dpram_addr returning phys mem instead of virt mem
> 3. [PPC] Compile fix for 8xx CPM Ehernet driver
> 4. [POWERPC] Fix cpm_uart driver
>
> This series can be pulled from git://git.bocc.de/dbox2.git ppc-fixes
>
> Thanks,
> Jochen
^ permalink raw reply
* DMA Generic Task API
From: Pedro Luis D. L. @ 2007-09-24 14:06 UTC (permalink / raw)
To: linuxppc-embedded
Hello,
As I wrote before, I'm trying to use the DMA API to copy audio data to the =
PSC1 which has a digital - analog - converter attached to it.
I read the explanation that Sylvain wrote at: http://ozlabs.org/pipermail/l=
inuxppc-dev/2007-May/036229.html and programmed the following code:
static void SPI_setup(void)
{
int psc_num =3D 1;
phys_addr_t rx_fifo;
phys_addr_t tx_fifo;
struct bcom_bd *bd;
uint32 SICR;
psc =3D ioremap(MPC52xx_PA(MPC52xx_PSCx_OFFSET(1)), MPC52xx_PSC_SIZE);
=09
gpio =3D ioremap(MPC52xx_PA(MPC52xx_GPIO_OFFSET), MPC52xx_GPIO_SIZE);
=09
cdm =3D ioremap(MPC52xx_PA(MPC52xx_CDM_OFFSET), MPC52xx_CDM_SIZE);
switch(psc_num) {
case 1:
initiator_tx =3D BCOM_INITIATOR_PSC1_TX;
initiator_rx =3D BCOM_INITIATOR_PSC1_RX;
break;
case 2:
initiator_tx =3D BCOM_INITIATOR_PSC2_TX;
initiator_rx =3D BCOM_INITIATOR_PSC2_RX;
break;
default:
panic("snd-SPImgt.o: invalid value for psc_num (%i)\n",psc_num);
break;
};
=09
printk("Before gpio->port_config\n");
gpio->port_config |=3D PORT_CONFIG_PSC1;
printk("Before cdm->clk_enables\n");
cdm->clk_enables |=3D PSC1_CLK_EN;
printk("Before cdm->mclken_div_psc1\n");
cdm->mclken_div_psc1 =3D MCLKEN_DIV;
=09
SICR =3D 0x02000000;
SICR |=3D 0x00002000;
SICR |=3D 0x0090C000;
=09
psc->command =3D 0x0A;
psc->sicr =3D SICR;
psc->ctur =3D 0x00;
psc->ctlr =3D 0x84;
psc->ccr &=3D 0xFF0000FF;
psc->rfalarm =3D 0x000C; /* alarm occurs if 12 bytes space in the RxFIFO =
*/
psc->tfalarm =3D 0x0010; /* alarm occurs if 16 bytes are in the TxFIFO */
psc->rfcntl &=3D 0xF8; /* set granularity to 0 */
psc->tfcntl &=3D 0xF8; /* set granularity to 0 */
psc->isr_imr.isr =3D 0x01;
psc->isr_imr.imr =3D 0x00; /* enable TxRDY interrupt */=20
psc->mode =3D 0x00; /* set RX interrupt to RxRDY */
psc->command =3D 0x05; /* enable Tx and Rx */
psc->tfdata =3D 0xF001;
wait(1000);
psc->tfdata =3D 0xF000;
printk("Before bcom_gen_bd_rx_init\n");
rx_bcom =3D bcom_gen_bd_rx_init(64, (phys_addr_t)&(psc->rfdata), initiato=
r_rx, 6, 1024);
printk("Before bcom_gen_bd_tx_init\n");
tx_bcom =3D bcom_gen_bd_tx_init(64, (phys_addr_t)&(psc->tfdata), initiato=
r_tx, 6);
printk("txtask is %d rxtask is %d\n", tx_bcom->tasknum, rx_bcom->tasknum);
r_irq =3D bcom_get_task_irq(rx_bcom);
t_irq =3D bcom_get_task_irq(tx_bcom);
=09
printk("t_irq is %d r_irq is %d\n", t_irq, r_irq);
if (request_irq(r_irq, &SPI_rx_irq, IRQF_DISABLED, "SPI rx dma", NULL)) {
printk(KERN_ERR "SPI: SDMA rx irq allocation failed\n");
return;
} else printk("SPI: SDA rx irq allocation succeded\n");
if (request_irq(t_irq, &SPI_tx_irq, IRQF_DISABLED, "SPI tx dma", NULL)) {
printk(KERN_ERR "SPI: SDMA tx irq allocation failed\n");
return;
} else printk("SPI: SDA tx irq allocation succeded\n");
bcom_gen_bd_tx_reset(tx_bcom);
bcom_gen_bd_rx_reset(rx_bcom);
bcom_retrieve_buffer(tx_bcom, NULL, NULL);
bd =3D bcom_prepare_next_buffer(tx_bcom);
bd->status =3D 1024;
bd->data[0] =3D (void *)SPI_tx_silence.pa;
bcom_submit_next_buffer(tx_bcom, (void *)SPI_tx_silence.pa);
bcom_dump_bdring(tx_bcom);
bcom_dump_bdring(rx_bcom);
printk("Tasks enabled\n");
psc->command =3D MPC52xx_PSC_TX_ENABLE | MPC52xx_PSC_RX_ENABLE;
=09
}
Although everything seems to be executed without problems, the interrupt ro=
utines are never called, and no data seems to be copied to the PSC.
Could it be that I don=B4t understand the purpose of bd->data and bd->stat=
us correctly? Is there any other Documentation or example code I can take a=
look and learn how to use the API?
Thanks,
Pedro L. Dominguez
carcadiz@hotmail.com
_________________________________________________________________
Consigue el nuevo Windows Live Messenger
http://get.live.com/messenger/overview=
^ permalink raw reply
* Cypress C67x00 driver connects ?
From: Robertson, Joseph M. @ 2007-09-24 14:29 UTC (permalink / raw)
To: linuxppc-embedded
[-- Attachment #1: Type: text/plain, Size: 1933 bytes --]
Hi,
Can I connect the c67x00 driver directly to the USB bus?
I have a device, a virtex4 fpga, with no PCI bus. I have a fpga bus to the cypress chip (c67300).
I have compiled the core USB code (but no uhci ohci).
It loads ok, detects and loads 2 host sies. I get interrupts for all that (and the 3 mailbox puts I do).
But I was just connecting to 'platfom_bus_type'. After all that I get no more interrupts.
The kernel drivers textbook doesn't quite match anymore, links to .hotplug in structs have moved.
Pointers to websites and papers appreciated.
I am using a custom kernel tree, 2.6.17.1, some of Grant Likely stuff is already in there (from the original developer on this project).
Thanks,
Joe Robertson
Joseph.Robertson@sanmina-sci.com
CONFIDENTIALITY
This e-mail message and any attachments thereto, is intended only for use by the addressee(s) named herein and may contain legally privileged and/or confidential information. If you are not the intended recipient of this e-mail message, you are hereby notified that any dissemination, distribution or copying of this e-mail message, and any attachments thereto, is strictly prohibited. If you have received this e-mail message in error, please immediately notify the sender and permanently delete the original and any copies of this email and any prints thereof.
ABSENT AN EXPRESS STATEMENT TO THE CONTRARY HEREINABOVE, THIS E-MAIL IS NOT INTENDED AS A SUBSTITUTE FOR A WRITING. Notwithstanding the Uniform Electronic Transactions Act or the applicability of any other law of similar substance and effect, absent an express statement to the contrary hereinabove, this e-mail message its contents, and any attachments hereto are not intended to represent an offer or acceptance to enter into a contract and are not otherwise intended to bind the sender, Sanmina-SCI Corporation (or any of its subsidiaries), or any other person or entity.
[-- Attachment #2: Type: text/html, Size: 2423 bytes --]
^ permalink raw reply
* Re: [patch 3/3] mpc8349emitx.dts: Add ds1339 RTC
From: Scott Wood @ 2007-09-24 14:52 UTC (permalink / raw)
To: Peter Korsgaard, Scott Wood, linuxppc-dev, Timur Tabi
In-Reply-To: <20070924050709.GM8058@localhost.localdomain>
David Gibson wrote:
>> i2c@3100 {
>> + #address-cells = <1>;
>> + #size-cells = <0>;
>> device_type = "i2c";
>
> Hrm... we probably want an "i2c" device_type class, but I don't think
> we've actually defined one, which is a problem
Right... but we need to get the kernel to stop expecting the device type
to be there before we yell at people for including it. :-)
> The fact that NVRAM+RTC chips are so common is a bit of an issue from
> the point of view of defining a device class binding - a device can't
> have type "rtc" and "nvram".
This is one of the reasons that I'd prefer to use compatible for such
things.
-Scott
^ permalink raw reply
* Re: [PATCH4/4] [POWERPC] Fix cpm_uart driver
From: Scott Wood @ 2007-09-24 15:57 UTC (permalink / raw)
To: Jochen Friedrich; +Cc: linux-kernel, linuxppc-embedded
In-Reply-To: <46F6C9DC.90008@scram.de>
Jochen Friedrich wrote:
>
> In cpm_uart_core, functions cpm_uart_init_bd and cpm_uart_init_scc
> an offset into DP RAM is calculated by substracting a physical
> memory constant from an virtual address. This patch fixes the
> problem by converting the virtual address into a physical
> first.
Huh? DPRAM_BASE is a virtual address. With this patch, you'd be
subtracting a virtual address from a physical address.
-Scott
^ permalink raw reply
* Problems compiling Linux for MPC8272ADS
From: Manil Gaouar @ 2007-09-24 16:26 UTC (permalink / raw)
To: linuxppc-dev
Hi there,
I am trying to compile the latest Linux from the git repos: git clone
git://www.denx.de/git/linux-2.6-denx.git linux-2.6-denx, I checked out
the code a few weeks ago and was able to build my uImage no problems. I
did a git pull this morning and I can not compile anymore, here is the
error message I have:
BOOTCC arch/powerpc/boot/ps3.o
BOOTCC arch/powerpc/boot/treeboot-bamboo.o
BOOTCC arch/powerpc/boot/cuboot-sequoia.o
BOOTCC arch/powerpc/boot/treeboot-walnut.o
{standard input}: Assembler messages:
{standard input}:184: Error: Unrecognized opcode: `mfdcr'
{standard input}:185: Error: Unrecognized opcode: `mfdcr'
{standard input}:186: Error: Unrecognized opcode: `mfdcr'
{standard input}:217: Error: Unrecognized opcode: `mtdcr'
make[1]: *** [arch/powerpc/boot/treeboot-walnut.o] Error 1
make: *** [uImage] Error 2
here are the commands I am using:
make mrproper
make ARCH=3Dpowerpc CROSS_COMPILE=3Dppc_6xx- mpc8272_ads_defconfig
make ARCH=3Dpowerpc CROSS_COMPILE=3Dppc_6xx- uImage
Do you have any ideas, or I should check out the 2.6.22 stable release
instead and try again???
Thx
^ permalink raw reply
* Re: Problems compiling Linux for MPC8272ADS
From: Alan Bennett @ 2007-09-24 16:46 UTC (permalink / raw)
To: Manil Gaouar; +Cc: linuxppc-dev
In-Reply-To: <9A1468054ED2FD40907CC3B2C1871D400106CC90@hermes.versatel.com>
I added this to my boot/Makefile near the other mcpu=440 lines. I
believe there may be a fix coming?
$(obj)/treeboot-walnut.o: BOOTCFLAGS += -mcpu=440
$(obj)/4xx.o: BOOTCFLAGS += -mcpu=440
$(obj)/ebony.o: BOOTCFLAGS += -mcpu=440
On 9/24/07, Manil Gaouar <mgaouar@solacom.com> wrote:
> Hi there,
>
> I am trying to compile the latest Linux from the git repos: git clone
> git://www.denx.de/git/linux-2.6-denx.git linux-2.6-denx, I checked out
> the code a few weeks ago and was able to build my uImage no problems. I
> did a git pull this morning and I can not compile anymore, here is the
> error message I have:
>
> BOOTCC arch/powerpc/boot/ps3.o
> BOOTCC arch/powerpc/boot/treeboot-bamboo.o
> BOOTCC arch/powerpc/boot/cuboot-sequoia.o
> BOOTCC arch/powerpc/boot/treeboot-walnut.o
> {standard input}: Assembler messages:
> {standard input}:184: Error: Unrecognized opcode: `mfdcr'
> {standard input}:185: Error: Unrecognized opcode: `mfdcr'
> {standard input}:186: Error: Unrecognized opcode: `mfdcr'
> {standard input}:217: Error: Unrecognized opcode: `mtdcr'
> make[1]: *** [arch/powerpc/boot/treeboot-walnut.o] Error 1
> make: *** [uImage] Error 2
>
> here are the commands I am using:
>
> make mrproper
> make ARCH=powerpc CROSS_COMPILE=ppc_6xx- mpc8272_ads_defconfig
> make ARCH=powerpc CROSS_COMPILE=ppc_6xx- uImage
>
> Do you have any ideas, or I should check out the 2.6.22 stable release
> instead and try again???
>
> Thx
> _______________________________________________
> Linuxppc-dev mailing list
> Linuxppc-dev@ozlabs.org
> https://ozlabs.org/mailman/listinfo/linuxppc-dev
>
^ permalink raw reply
* Re: Problems compiling Linux for MPC8272ADS
From: Josh Boyer @ 2007-09-24 16:56 UTC (permalink / raw)
To: Manil Gaouar; +Cc: linuxppc-dev
In-Reply-To: <9A1468054ED2FD40907CC3B2C1871D400106CC90@hermes.versatel.com>
On Mon, 24 Sep 2007 12:26:24 -0400
"Manil Gaouar" <mgaouar@solacom.com> wrote:
> Hi there,
>
> I am trying to compile the latest Linux from the git repos: git clone
> git://www.denx.de/git/linux-2.6-denx.git linux-2.6-denx, I checked out
> the code a few weeks ago and was able to build my uImage no problems. I
> did a git pull this morning and I can not compile anymore, here is the
> error message I have:
>
> BOOTCC arch/powerpc/boot/ps3.o
> BOOTCC arch/powerpc/boot/treeboot-bamboo.o
> BOOTCC arch/powerpc/boot/cuboot-sequoia.o
> BOOTCC arch/powerpc/boot/treeboot-walnut.o
> {standard input}: Assembler messages:
> {standard input}:184: Error: Unrecognized opcode: `mfdcr'
> {standard input}:185: Error: Unrecognized opcode: `mfdcr'
> {standard input}:186: Error: Unrecognized opcode: `mfdcr'
> {standard input}:217: Error: Unrecognized opcode: `mtdcr'
> make[1]: *** [arch/powerpc/boot/treeboot-walnut.o] Error 1
> make: *** [uImage] Error 2
>
> here are the commands I am using:
>
> make mrproper
> make ARCH=powerpc CROSS_COMPILE=ppc_6xx- mpc8272_ads_defconfig
> make ARCH=powerpc CROSS_COMPILE=ppc_6xx- uImage
>
> Do you have any ideas, or I should check out the 2.6.22 stable release
> instead and try again???
Apply this:
[POWERPC] 4xx: Fix Walnut wrapper compile errors
Pass the appropriate -mcpu flag to the treeboot-walnut.o object to prevent
some toolchains from erroring out with unknown opcodes
Signed-off-by: Josh Boyer <jwboyer@linux.vnet.ibm.com>
diff --git a/arch/powerpc/boot/Makefile b/arch/powerpc/boot/Makefile
index c1582b6..ac516a1 100644
--- a/arch/powerpc/boot/Makefile
+++ b/arch/powerpc/boot/Makefile
@@ -33,6 +33,7 @@ BOOTCFLAGS += -I$(obj) -I$(srctree)/$(obj)
$(obj)/4xx.o: BOOTCFLAGS += -mcpu=440
$(obj)/ebony.o: BOOTCFLAGS += -mcpu=440
+$(obj)/treeboot-walnut.o: BOOTCFLAGS += -mcpu=405
zlib := inffast.c inflate.c inftrees.c
zlibheader := inffast.h inffixed.h inflate.h inftrees.h infutil.h
^ permalink raw reply related
* Re: [PATCH4/4] [POWERPC] Fix cpm_uart driver
From: Jochen Friedrich @ 2007-09-24 17:06 UTC (permalink / raw)
To: Scott Wood; +Cc: linux-kernel, linuxppc-embedded
In-Reply-To: <46F7DE85.7000401@freescale.com>
Scott Wood schrieb:
> Jochen Friedrich wrote:
>>
>> In cpm_uart_core, functions cpm_uart_init_bd and cpm_uart_init_scc
>> an offset into DP RAM is calculated by substracting a physical
>> memory constant from an virtual address. This patch fixes the
>> problem by converting the virtual address into a physical
>> first.
>
> Huh? DPRAM_BASE is a virtual address. With this patch, you'd be
> subtracting a virtual address from a physical address.
Thanks for pointing me to it. So the bug is in cpm_uart_cpm1.h assigning
a physical memory to DPRAM_BASE (at least on ARC=ppc). cpm_uart_cpm2.h
seems to be correct though. I'll submit a new patch for this.
Thanks,
Jochen
^ permalink raw reply
* [PATCH#2 0/4] Various bug fixes
From: Jochen Friedrich @ 2007-09-24 17:12 UTC (permalink / raw)
To: linuxppc-embedded; +Cc: linux-kernel
Here is a series fixing some bugs for 8xx powerpc CPUs.
1. [POWERPC] Fix copy'n'paste typo in commproc.c
2. [PPC] Fix cpm_dpram_addr returning phys mem instead of virt mem
3. [PPC] Compile fix for 8xx CPM Ehernet driver
4. [POWERPC] Fix cpm_uart driver (updated)
This series can be pulled from git://git.bocc.de/dbox2.git ppc-fixes
Thanks,
Jochen
^ permalink raw reply
* [PATCH#2 1/4] [POWERPC] Fix copy'n'paste typo in commproc.c
From: Jochen Friedrich @ 2007-09-24 17:13 UTC (permalink / raw)
To: linuxppc-embedded; +Cc: linux-kernel
[-- Attachment #1: Type: text/plain, Size: 984 bytes --]
The powerpc version of commproc.c exports cpm_dpram_addr twice
and cpm_dpram_phys not at all due to a typo. This patch fixes this
problem.
CC arch/powerpc/sysdev/commproc.o
arch/powerpc/sysdev/commproc.c:398: error: redefinition of '__kcrctab_cpm_dpram_addr'
arch/powerpc/sysdev/commproc.c:392: error: previous definition of '__kcrctab_cpm_dpram_addr' was here
arch/powerpc/sysdev/commproc.c:398: error: redefinition of '__kstrtab_cpm_dpram_addr'
arch/powerpc/sysdev/commproc.c:392: error: previous definition of '__kstrtab_cpm_dpram_addr' was here
arch/powerpc/sysdev/commproc.c:398: error: redefinition of '__ksymtab_cpm_dpram_addr'
arch/powerpc/sysdev/commproc.c:392: error: previous definition of '__ksymtab_cpm_dpram_addr' was here
make[1]: *** [arch/powerpc/sysdev/commproc.o] Error 1
make: *** [arch/powerpc/sysdev] Error 2
Signed-off-by: Jochen Friedrich <jochen@scram.de>
---
arch/powerpc/sysdev/commproc.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
[-- Attachment #2: ef0b35e6f35cd911148c86f0b73cce536968d5b5.diff --]
[-- Type: text/x-patch, Size: 355 bytes --]
diff --git a/arch/powerpc/sysdev/commproc.c b/arch/powerpc/sysdev/commproc.c
index 4f67b89..dd5417a 100644
--- a/arch/powerpc/sysdev/commproc.c
+++ b/arch/powerpc/sysdev/commproc.c
@@ -395,4 +395,4 @@ uint cpm_dpram_phys(u8* addr)
{
return (dpram_pbase + (uint)(addr - dpram_vbase));
}
-EXPORT_SYMBOL(cpm_dpram_addr);
+EXPORT_SYMBOL(cpm_dpram_phys);
^ permalink raw reply related
* [PATCH#2 2/4] [PPC] Fix cpm_dpram_addr returning phys mem instead of virt mem
From: Jochen Friedrich @ 2007-09-24 17:14 UTC (permalink / raw)
To: linuxppc-embedded; +Cc: linux-kernel
[-- Attachment #1: Type: text/plain, Size: 514 bytes --]
cpm_dpram_addr returns physical memory of the DP RAM instead of
iomapped virtual memory. As there usually is a 1:1 MMU map of
the IMMR area, this is often not noticed. However, cpm_dpram_phys
assumes this iomapped virtual memory and returns garbage on the
1:1 mapped memory causing CPM1 uart console to fail.
This patch fixes the problem (copied from the powerpc tree).
Signed-off-by: Jochen Friedrich <jochen@scram.de>
---
arch/ppc/8xx_io/commproc.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
[-- Attachment #2: e99a679ff14fb0073efd9220f5aa933e47516202.diff --]
[-- Type: text/x-patch, Size: 399 bytes --]
diff --git a/arch/ppc/8xx_io/commproc.c b/arch/ppc/8xx_io/commproc.c
index 7088428..9da880b 100644
--- a/arch/ppc/8xx_io/commproc.c
+++ b/arch/ppc/8xx_io/commproc.c
@@ -459,7 +459,7 @@ EXPORT_SYMBOL(cpm_dpdump);
void *cpm_dpram_addr(unsigned long offset)
{
- return ((immap_t *)IMAP_ADDR)->im_cpm.cp_dpmem + offset;
+ return (void *)(dpram_vbase + offset);
}
EXPORT_SYMBOL(cpm_dpram_addr);
^ permalink raw reply related
* [PATCH#2 3/4] [PPC] Compile fix for 8xx CPM Ehernet driver
From: Jochen Friedrich @ 2007-09-24 17:15 UTC (permalink / raw)
To: linuxppc-embedded; +Cc: linux-kernel
[-- Attachment #1: Type: text/plain, Size: 492 bytes --]
Add #include <asm/cacheflush.h> for flush_dcache_range
to make the driver compile again.
CC arch/ppc/8xx_io/enet.o
arch/ppc/8xx_io/enet.c: In function 'scc_enet_start_xmit':
arch/ppc/8xx_io/enet.c:240: error: implicit declaration of function
'flush_dcache_range'
make[1]: *** [arch/ppc/8xx_io/enet.o] Error 1
make: *** [arch/ppc/8xx_io] Error 2
Signed-off-by: Jochen Friedrich <jochen@scram.de>
---
arch/ppc/8xx_io/enet.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
[-- Attachment #2: bf5c2f419c8f731109b1c39e390338dcea780e94.diff --]
[-- Type: text/x-patch, Size: 308 bytes --]
diff --git a/arch/ppc/8xx_io/enet.c b/arch/ppc/8xx_io/enet.c
index 703d47e..eace3bc 100644
--- a/arch/ppc/8xx_io/enet.c
+++ b/arch/ppc/8xx_io/enet.c
@@ -44,6 +44,7 @@
#include <asm/mpc8xx.h>
#include <asm/uaccess.h>
#include <asm/commproc.h>
+#include <asm/cacheflush.h>
/*
* Theory of Operation
^ permalink raw reply related
* [PATCH#2 4/4] [POWERPC] Fix cpm_uart driver
From: Jochen Friedrich @ 2007-09-24 17:15 UTC (permalink / raw)
To: linuxppc-embedded; +Cc: linux-kernel
[-- Attachment #1: Type: text/plain, Size: 486 bytes --]
in cpm_uart_cpm1.h, DPRAM_BASE is assigned an address derived from cpmp.
On ARC=ppc, this is a physical address with 1:1 DMA mapping which can't
be used for arithmetric compare operations with virtual addresses
returned by cpm_dpram_addr. This patch changes the assignment to use
cpm_dpram_addr as well, like in cpm_uart_cpm2.h.
Signed-off-by: Jochen Friedrich <jochen@scram.de>
---
drivers/serial/cpm_uart/cpm_uart_cpm1.h | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
[-- Attachment #2: e99364db4224fcfaf74389d1b59ec0637d899c17.diff --]
[-- Type: text/x-patch, Size: 452 bytes --]
diff --git a/drivers/serial/cpm_uart/cpm_uart_cpm1.h b/drivers/serial/cpm_uart/cpm_uart_cpm1.h
index a99e45e..2a64778 100644
--- a/drivers/serial/cpm_uart/cpm_uart_cpm1.h
+++ b/drivers/serial/cpm_uart/cpm_uart_cpm1.h
@@ -37,6 +37,6 @@ static inline void cpm_set_smc_fcr(volatile smc_uart_t * up)
up->smc_tfcr = SMC_EB;
}
-#define DPRAM_BASE ((unsigned char *)&cpmp->cp_dpmem[0])
+#define DPRAM_BASE ((unsigned char *)cpm_dpram_addr(0))
#endif
^ permalink raw reply related
* Re: [apw@shadowen.org: 2.6.23-rc6-mm1 -- powerpc pSeries_log_error panic in rtas_call/early_enable_eeh]
From: Linas Vepstas @ 2007-09-24 17:21 UTC (permalink / raw)
To: Anton Blanchard, Andy Whitcroft, linuxppc-dev
In-Reply-To: <20070923161740.GA12488@kryten>
I just got back from vacation.
I'll give this a whirl shortly.
--linas
On Sun, Sep 23, 2007 at 11:17:40AM -0500, Anton Blanchard wrote:
>
> Hi Linas,
>
> Looks like EEH could be involved :)
>
> Anton
>
> ----- Forwarded message from Andy Whitcroft <apw@shadowen.org> -----
>
> From: Andy Whitcroft <apw@shadowen.org>
> To: Andrew Morton <akpm@linux-foundation.org>
> Subject: 2.6.23-rc6-mm1 -- powerpc pSeries_log_error panic in
> rtas_call/early_enable_eeh
> X-SPF-Guess: neutral
> Cc: linuxppc-dev@ozlabs.org, linux-kernel@vger.kernel.org
> X-BeenThere: linuxppc-dev@ozlabs.org
> X-Mailman-Version: 2.1.9
> List-Id: Linux on PowerPC Developers Mail List <linuxppc-dev.ozlabs.org>
> List-Unsubscribe: <https://ozlabs.org/mailman/listinfo/linuxppc-dev>,
> <mailto:linuxppc-dev-request@ozlabs.org?subject=unsubscribe>
> List-Archive: <http://ozlabs.org/pipermail/linuxppc-dev>
> List-Post: <mailto:linuxppc-dev@ozlabs.org>
> List-Help: <mailto:linuxppc-dev-request@ozlabs.org?subject=help>
> List-Subscribe: <https://ozlabs.org/mailman/listinfo/linuxppc-dev>,
> <mailto:linuxppc-dev-request@ozlabs.org?subject=subscribe>
>
> Seeing the following panic booting an old powerpc LPAR:
>
> Unable to handle kernel paging request for data at address 0x00000000
> Faulting instruction address: 0xc000000000047b48
> cpu 0x0: Vector: 300 (Data Access) at [c0000000006a3750]
> pc: c000000000047b48: .pSeries_log_error+0x364/0x420
> lr: c000000000047acc: .pSeries_log_error+0x2e8/0x420
> sp: c0000000006a39d0
> msr: 8000000000001032
> dar: 0
> dsisr: 42000000
> current = 0xc0000000005acab0
> paca = 0xc0000000005ad700
> pid = 0, comm = swapper
> enter ? for help
> [c0000000006a3af0] c000000000021164 .rtas_call+0x200/0x250
> [c0000000006a3ba0] c000000000049d50 .early_enable_eeh+0x168/0x360
> [c0000000006a3c70] c00000000002f674 .traverse_pci_devices+0x8c/0x138
> [c0000000006a3d10] c000000000560ce8 .eeh_init+0x1a8/0x200
> [c0000000006a3db0] c00000000055fb70 .pSeries_setup_arch+0x128/0x234
> [c0000000006a3e40] c00000000054f830 .setup_arch+0x214/0x24c
> [c0000000006a3ee0] c000000000546a38 .start_kernel+0xd4/0x3e4
> [c0000000006a3f90] c00000000045adc4 .start_here_common+0x54/0x58
> 0:mon>
>
> This machine is:
>
> # cat /proc/cpuinfo
> processor : 0
> cpu : POWER4+ (gq)
> clock : 1703.965296MHz
> revision : 19.0
>
> [...]
> machine : CHRP IBM,7040-681
>
> -apw
> _______________________________________________
> Linuxppc-dev mailing list
> Linuxppc-dev@ozlabs.org
> https://ozlabs.org/mailman/listinfo/linuxppc-dev
>
> ----- End forwarded message -----
^ permalink raw reply
* Re: [PATCH4/4] [POWERPC] Fix cpm_uart driver
From: Scott Wood @ 2007-09-24 18:22 UTC (permalink / raw)
To: Jochen Friedrich; +Cc: linux-kernel, linuxppc-embedded
In-Reply-To: <46F7EE95.1040509@scram.de>
Jochen Friedrich wrote:
> Scott Wood schrieb:
>> Jochen Friedrich wrote:
>>>
>>> In cpm_uart_core, functions cpm_uart_init_bd and cpm_uart_init_scc
>>> an offset into DP RAM is calculated by substracting a physical
>>> memory constant from an virtual address. This patch fixes the
>>> problem by converting the virtual address into a physical
>>> first.
>>
>> Huh? DPRAM_BASE is a virtual address. With this patch, you'd be
>> subtracting a virtual address from a physical address.
>
> Thanks for pointing me to it. So the bug is in cpm_uart_cpm1.h assigning
> a physical memory to DPRAM_BASE (at least on ARC=ppc). cpm_uart_cpm2.h
> seems to be correct though. I'll submit a new patch for this.
cpmp is a physical address on arch/ppc?
/me looks at arch/ppc/8xx_io/commproc.c
Yikes. Please don't change cpm_uart_cpm1.h, as it's correct for
arch/powerpc, and there are numerous other places that assume cpmp is
virtual (including in the very same function that assigns it a physical
address).
You could fix arch/ppc if you want, though it may be easier to wait for
it to die, and insist on identity maps in the meantime. :-)
-Scott
^ permalink raw reply
* [PATCH] Make instruction dumping work in real mode.
From: Scott Wood @ 2007-09-24 19:01 UTC (permalink / raw)
To: paulus; +Cc: linuxppc-dev
On non-book-E, if a faulting PC is in the first few pages, and it's not an
ITLB miss, it's likely executing in real mode, probably at an exception vector.
Rather than print a useless XXXXXXXX, it is assumed that this is the case, and
the address is treated as physical. This helps when debugging corruption at
the beginning of memory.
Signed-off-by: Scott Wood <scottwood@freescale.com>
---
arch/powerpc/kernel/process.c | 8 ++++++++
1 files changed, 8 insertions(+), 0 deletions(-)
diff --git a/arch/powerpc/kernel/process.c b/arch/powerpc/kernel/process.c
index 57c589c..7cb94d7 100644
--- a/arch/powerpc/kernel/process.c
+++ b/arch/powerpc/kernel/process.c
@@ -354,6 +354,14 @@ static void show_instructions(struct pt_regs *regs)
if (!(i % 8))
printk("\n");
+#ifndef CONFIG_BOOKE
+ /* If the address is in the first couple pages, it's
+ * likely executing in real mode.
+ */
+ if (regs->nip < 0x4000)
+ pc += (unsigned long)phys_to_virt(KERNELBASE);
+#endif
+
/* We use __get_user here *only* to avoid an OOPS on a
* bad address because the pc *should* only be a
* kernel address.
--
1.5.3.1
^ permalink raw reply related
* Re: [PATCH4/4] [POWERPC] Fix cpm_uart driver
From: Dan Malek @ 2007-09-24 19:16 UTC (permalink / raw)
To: Scott Wood; +Cc: linuxppc-embedded, linux-kernel
In-Reply-To: <46F80049.2030509@freescale.com>
On Sep 24, 2007, at 11:22 AM, Scott Wood wrote:
> cpmp is a physical address on arch/ppc?
No, it's a well known ioremaped() address
into the IMMR space. The only physical
addresses in any of the CPM/CPM2 are
those required to by the buffer descriptors.
There are DPRAM offsets, but they should
be just that, offsets from either a virtual
or physical base address as required.
Too many people screw around in this
CPM support code without fully understanding
the original implementation or its intended
use with the peripheral drivers. A "better
idea" often breaks all drivers except the one
that is being changed.
-- Dan
^ permalink raw reply
* [PATCH 0/3] usb: ehci ppc device-tree-aware driver
From: Valentine Barshak @ 2007-09-24 19:25 UTC (permalink / raw)
To: linuxppc-dev; +Cc: linux-usb-devel
Some PowerPC systems have a built-in EHCI controller.
This is a device tree aware version of the EHCI controller driver.
Currently it's been tested on the PowerPC 440EPx Sequoia board.
Other platforms can be added later.
The code is based on the ehci-ppc-soc driver by Stefan Roese <sr@denx.de>.
^ permalink raw reply
* [PATCH 1/3] usb: add device-tree-aware ehci driver
From: Valentine Barshak @ 2007-09-24 19:26 UTC (permalink / raw)
To: linuxppc-dev; +Cc: linux-usb-devel
In-Reply-To: <20070924192519.GA4192@ru.mvista.com>
This adds device-tree-aware ehci-ppc-of driver.
The code is based on the ehci-ppc-soc driver by
Stefan Roese <sr@denx.de>.
Signed-off-by: Stefan Roese <sr@denx.de>
Signed-off-by: Valentine Barshak <vbarshak@ru.mvista.com>
---
drivers/usb/host/Kconfig | 8 +
drivers/usb/host/ehci-hcd.c | 16 ++
drivers/usb/host/ehci-ppc-of.c | 243 +++++++++++++++++++++++++++++++++++++++++
drivers/usb/host/ehci.h | 2
4 files changed, 267 insertions(+), 2 deletions(-)
diff -ruN linux-2.6.orig/drivers/usb/host/ehci.h linux-2.6/drivers/usb/host/ehci.h
--- linux-2.6.orig/drivers/usb/host/ehci.h 2007-09-24 14:55:44.000000000 +0400
+++ linux-2.6/drivers/usb/host/ehci.h 2007-09-24 23:07:16.000000000 +0400
@@ -725,7 +725,7 @@
* definition below can die once the 4xx support is
* finally ported over.
*/
-#if defined(CONFIG_PPC)
+#if defined(CONFIG_PPC) && !defined(CONFIG_PPC_MERGE)
#define readl_be(addr) in_be32((__force unsigned *)addr)
#define writel_be(val, addr) out_be32((__force unsigned *)addr, val)
#endif
diff -ruN linux-2.6.orig/drivers/usb/host/ehci-hcd.c linux-2.6/drivers/usb/host/ehci-hcd.c
--- linux-2.6.orig/drivers/usb/host/ehci-hcd.c 2007-09-24 14:55:44.000000000 +0400
+++ linux-2.6/drivers/usb/host/ehci-hcd.c 2007-09-24 23:07:16.000000000 +0400
@@ -944,11 +944,16 @@
#define PS3_SYSTEM_BUS_DRIVER ps3_ehci_driver
#endif
-#ifdef CONFIG_440EPX
+#if defined(CONFIG_440EPX) && !defined(CONFIG_PPC_MERGE)
#include "ehci-ppc-soc.c"
#define PLATFORM_DRIVER ehci_ppc_soc_driver
#endif
+#ifdef CONFIG_USB_EHCI_HCD_PPC_OF
+#include "ehci-ppc-of.c"
+#define OF_PLATFORM_DRIVER ehci_hcd_ppc_of_driver
+#endif
+
#if !defined(PCI_DRIVER) && !defined(PLATFORM_DRIVER) && \
!defined(PS3_SYSTEM_BUS_DRIVER)
#error "missing bus glue for ehci-hcd"
@@ -963,6 +968,12 @@
sizeof(struct ehci_qh), sizeof(struct ehci_qtd),
sizeof(struct ehci_itd), sizeof(struct ehci_sitd));
+#ifdef OF_PLATFORM_DRIVER
+ retval = of_register_platform_driver(&OF_PLATFORM_DRIVER);
+ if (retval < 0)
+ return retval;
+#endif
+
#ifdef PLATFORM_DRIVER
retval = platform_driver_register(&PLATFORM_DRIVER);
if (retval < 0)
@@ -998,6 +1009,9 @@
static void __exit ehci_hcd_cleanup(void)
{
+#ifdef OF_PLATFORM_DRIVER
+ of_unregister_platform_driver(&OF_PLATFORM_DRIVER);
+#endif
#ifdef PLATFORM_DRIVER
platform_driver_unregister(&PLATFORM_DRIVER);
#endif
diff -ruN linux-2.6.orig/drivers/usb/host/ehci-ppc-of.c linux-2.6/drivers/usb/host/ehci-ppc-of.c
--- linux-2.6.orig/drivers/usb/host/ehci-ppc-of.c 1970-01-01 03:00:00.000000000 +0300
+++ linux-2.6/drivers/usb/host/ehci-ppc-of.c 2007-09-24 23:13:31.000000000 +0400
@@ -0,0 +1,243 @@
+/*
+ * EHCI HCD (Host Controller Driver) for USB.
+ *
+ * Bus Glue for PPC On-Chip EHCI driver on the of_platform bus
+ * Tested on AMCC PPC 440EPx
+ *
+ * Valentine Barshak <vbarshak@ru.mvista.com>
+ *
+ * Based on "ehci-ppc-soc.c" by Stefan Roese <sr@denx.de>
+ * and "ohci-ppc-of.c" by Sylvain Munaut <tnt@246tNt.com>
+ *
+ * This file is licenced under the GPL.
+ */
+
+#include <linux/signal.h>
+
+#include <linux/of.h>
+#include <linux/of_platform.h>
+
+/* called during probe() after chip reset completes */
+static int ehci_ppc_of_setup(struct usb_hcd *hcd)
+{
+ struct ehci_hcd *ehci = hcd_to_ehci(hcd);
+ int retval;
+
+ retval = ehci_halt(ehci);
+ if (retval)
+ return retval;
+
+ retval = ehci_init(hcd);
+ if (retval)
+ return retval;
+
+ ehci->sbrn = 0x20;
+ return ehci_reset(ehci);
+}
+
+
+static const struct hc_driver ehci_ppc_of_hc_driver = {
+ .description = hcd_name,
+ .product_desc = "OF EHCI",
+ .hcd_priv_size = sizeof(struct ehci_hcd),
+
+ /*
+ * generic hardware linkage
+ */
+ .irq = ehci_irq,
+ .flags = HCD_MEMORY | HCD_USB2,
+
+ /*
+ * basic lifecycle operations
+ */
+ .reset = ehci_ppc_of_setup,
+ .start = ehci_run,
+ .stop = ehci_stop,
+ .shutdown = ehci_shutdown,
+
+ /*
+ * managing i/o requests and associated device resources
+ */
+ .urb_enqueue = ehci_urb_enqueue,
+ .urb_dequeue = ehci_urb_dequeue,
+ .endpoint_disable = ehci_endpoint_disable,
+
+ /*
+ * scheduling support
+ */
+ .get_frame_number = ehci_get_frame,
+
+ /*
+ * root hub support
+ */
+ .hub_status_data = ehci_hub_status_data,
+ .hub_control = ehci_hub_control,
+#ifdef CONFIG_PM
+ .hub_suspend = ehci_hub_suspend,
+ .hub_resume = ehci_hub_resume,
+#endif
+};
+
+
+/*
+ * 440EPx Errata USBH_3
+ * Fix: Enable Break Memory Transfer (BMT) in INSNREG3
+ */
+#define PPC440EPX_EHCI0_INSREG_BMT (0x1 << 0)
+static int __devinit
+ppc44x_enable_bmt(struct device_node *dn)
+{
+ __iomem u32 *insreg_virt;
+
+ insreg_virt = of_iomap(dn, 1);
+ if (!insreg_virt)
+ return -EINVAL;
+
+ out_be32(insreg_virt + 3, PPC440EPX_EHCI0_INSREG_BMT);
+
+ iounmap(insreg_virt);
+ return 0;
+}
+
+
+static int __devinit
+ehci_hcd_ppc_of_probe(struct of_device *op, const struct of_device_id *match)
+{
+ struct device_node *dn = op->node;
+ struct usb_hcd *hcd;
+ struct ehci_hcd *ehci;
+ struct resource res;
+ int irq;
+ int rv;
+
+ if (usb_disabled())
+ return -ENODEV;
+
+ dev_dbg(&op->dev, "initializing PPC-OF USB Controller\n");
+
+ rv = of_address_to_resource(dn, 0, &res);
+ if (rv)
+ return rv;
+
+ hcd = usb_create_hcd(&ehci_ppc_of_hc_driver, &op->dev, "PPC-OF USB");
+ if (!hcd)
+ return -ENOMEM;
+
+ hcd->rsrc_start = res.start;
+ hcd->rsrc_len = res.end - res.start + 1;
+
+ if (!request_mem_region(hcd->rsrc_start, hcd->rsrc_len, hcd_name)) {
+ printk(KERN_ERR __FILE__ ": request_mem_region failed\n");
+ rv = -EBUSY;
+ goto err_rmr;
+ }
+
+ irq = irq_of_parse_and_map(dn, 0);
+ if (irq == NO_IRQ) {
+ printk(KERN_ERR __FILE__ ": irq_of_parse_and_map failed\n");
+ rv = -EBUSY;
+ goto err_irq;
+ }
+
+ hcd->regs = ioremap(hcd->rsrc_start, hcd->rsrc_len);
+ if (!hcd->regs) {
+ printk(KERN_ERR __FILE__ ": ioremap failed\n");
+ rv = -ENOMEM;
+ goto err_ioremap;
+ }
+
+ ehci = hcd_to_ehci(hcd);
+
+ if (of_get_property(dn, "big-endian", NULL)) {
+ ehci->big_endian_mmio = 1;
+ ehci->big_endian_desc = 1;
+ }
+ if (of_get_property(dn, "big-endian-regs", NULL))
+ ehci->big_endian_mmio = 1;
+ if (of_get_property(dn, "big-endian-desc", NULL))
+ ehci->big_endian_desc = 1;
+
+ ehci->caps = hcd->regs;
+ ehci->regs = hcd->regs +
+ HC_LENGTH(ehci_readl(ehci, &ehci->caps->hc_capbase));
+
+ /* cache this readonly data; minimize chip reads */
+ ehci->hcs_params = ehci_readl(ehci, &ehci->caps->hcs_params);
+
+ if (of_device_is_compatible(dn, "ibm,usb-ehci-440epx")) {
+ rv = ppc44x_enable_bmt(dn);
+ ehci_dbg(ehci, "Break Memory Transfer (BMT) is %senabled!\n",
+ rv ? "NOT ": "");
+ }
+
+ rv = usb_add_hcd(hcd, irq, 0);
+ if (rv == 0)
+ return 0;
+
+ iounmap(hcd->regs);
+err_ioremap:
+ irq_dispose_mapping(irq);
+err_irq:
+ release_mem_region(hcd->rsrc_start, hcd->rsrc_len);
+err_rmr:
+ usb_put_hcd(hcd);
+
+ return rv;
+}
+
+
+static int ehci_hcd_ppc_of_remove(struct of_device *op)
+{
+ struct usb_hcd *hcd = dev_get_drvdata(&op->dev);
+ dev_set_drvdata(&op->dev, NULL);
+
+ dev_dbg(&op->dev, "stopping PPC-OF USB Controller\n");
+
+ usb_remove_hcd(hcd);
+
+ iounmap(hcd->regs);
+ irq_dispose_mapping(hcd->irq);
+ release_mem_region(hcd->rsrc_start, hcd->rsrc_len);
+
+ usb_put_hcd(hcd);
+
+ return 0;
+}
+
+
+static int ehci_hcd_ppc_of_shutdown(struct of_device *op)
+{
+ struct usb_hcd *hcd = dev_get_drvdata(&op->dev);
+
+ if (hcd->driver->shutdown)
+ hcd->driver->shutdown(hcd);
+
+ return 0;
+}
+
+
+static struct of_device_id ehci_hcd_ppc_of_match[] = {
+ {
+ .compatible = "usb-ehci",
+ },
+ {},
+};
+MODULE_DEVICE_TABLE(of, ehci_hcd_ppc_of_match);
+
+
+static struct of_platform_driver ehci_hcd_ppc_of_driver = {
+ .name = "ppc-of-ehci",
+ .match_table = ehci_hcd_ppc_of_match,
+ .probe = ehci_hcd_ppc_of_probe,
+ .remove = ehci_hcd_ppc_of_remove,
+ .shutdown = ehci_hcd_ppc_of_shutdown,
+#ifdef CONFIG_PM
+ /*.suspend = ehci_hcd_ppc_of_drv_suspend,*/
+ /*.resume = ehci_hcd_ppc_of_drv_resume,*/
+#endif
+ .driver = {
+ .name = "ppc-of-ehci",
+ .owner = THIS_MODULE,
+ },
+};
+
diff -ruN linux-2.6.orig/drivers/usb/host/Kconfig linux-2.6/drivers/usb/host/Kconfig
--- linux-2.6.orig/drivers/usb/host/Kconfig 2007-09-24 14:55:44.000000000 +0400
+++ linux-2.6/drivers/usb/host/Kconfig 2007-09-24 23:07:16.000000000 +0400
@@ -84,6 +84,14 @@
---help---
Variation of ARC USB block used in some Freescale chips.
+config USB_EHCI_HCD_PPC_OF
+ bool "EHCI support for PPC USB controller on OF platform bus"
+ depends on USB_EHCI_HCD && PPC_OF
+ default y
+ ---help---
+ Enables support for the USB controller PowerPC present on the
+ OpenFirmware platform bus.
+
config USB_ISP116X_HCD
tristate "ISP116X HCD support"
depends on USB
^ permalink raw reply
* [PATCH 2/3] usb: ehci-ppc-of dts bindings.
From: Valentine Barshak @ 2007-09-24 19:27 UTC (permalink / raw)
To: linuxppc-dev; +Cc: linux-usb-devel
In-Reply-To: <20070924192519.GA4192@ru.mvista.com>
Adds EHCI OF bindings to documentation.
Signed-off-by: Valentine Barshak <vbarshak@ru.mvista.com>
---
Documentation/powerpc/booting-without-of.txt | 28 +++++++++++++++++++++++++++
1 files changed, 28 insertions(+)
diff -ruN linux-2.6.orig/Documentation/powerpc/booting-without-of.txt linux-2.6/Documentation/powerpc/booting-without-of.txt
--- linux-2.6.orig/Documentation/powerpc/booting-without-of.txt 2007-09-24 14:55:04.000000000 +0400
+++ linux-2.6/Documentation/powerpc/booting-without-of.txt 2007-09-24 22:42:35.000000000 +0400
@@ -52,6 +52,7 @@
i) Freescale QUICC Engine module (QE)
j) CFI or JEDEC memory-mapped NOR flash
k) Global Utilities Block
+ l) USB EHCI controllers
VII - Specifying interrupt information for devices
1) interrupts property
@@ -1848,6 +1849,33 @@
fsl,has-rstcr;
};
+ l) USB EHCI controllers
+
+ Required properties:
+ - compatible : should be "usb-ehci".
+ - reg : should contain at least address and length of the standard EHCI
+ register set for the device. Optional platform-dependent registers
+ (debug-port or other) can be also specified here, but only after
+ definition of standard EHCI registers.
+ - interrupts : one EHCI interrupt should be described here.
+ If device registers are implemented in big endian mode, the device
+ node should have "big-endian-regs" property.
+ If controller implementation operates with big endian descriptors,
+ "big-endian-desc" property should be specified.
+ If both big endian registers and descriptors are used by the controller
+ implementation, "big-endian" property can be specified instead of having
+ both "big-endian-regs" and "big-endian-desc".
+
+ Example (Sequoia 440EPx):
+ ehci@e0000300 {
+ compatible = "ibm,usb-ehci-440epx", "usb-ehci";
+ interrupt-parent = <&UIC0>;
+ interrupts = <1a 4>;
+ reg = <0 e0000300 90 0 e0000390 70>;
+ big-endian;
+ };
+
+
More devices will be defined as this spec matures.
VII - Specifying interrupt information for devices
^ permalink raw reply
* Re: [PATCH4/4] [POWERPC] Fix cpm_uart driver
From: Scott Wood @ 2007-09-24 19:29 UTC (permalink / raw)
To: Dan Malek; +Cc: linuxppc-embedded, linux-kernel
In-Reply-To: <FF1A2486-BE77-49F8-99F3-B09B4EEAF50D@embeddedalley.com>
Dan Malek wrote:
>
> On Sep 24, 2007, at 11:22 AM, Scott Wood wrote:
>
>> cpmp is a physical address on arch/ppc?
>
> No, it's a well known ioremaped() address into the IMMR space.
Maybe that's how it was, but the current code initializes it (more or
less) directly with IMAP_ADDR, which also gets fed into ioremap.
One of the two has got to be wrong.
-Scott
^ permalink raw reply
* [PATCH 3/3] Add PowerPC 440EPx Sequoia ehci dts entry
From: Valentine Barshak @ 2007-09-24 19:29 UTC (permalink / raw)
To: linuxppc-dev; +Cc: linux-usb-devel
In-Reply-To: <20070924192519.GA4192@ru.mvista.com>
Adds USB EHCI entry to PowerPC 440EPx Sequoia DTS.
Signed-off-by: Valentine Barshak <vbarshak@ru.mvista.com>
---
arch/powerpc/boot/dts/sequoia.dts | 8 ++++++++
1 files changed, 8 insertions(+)
diff -ruN linux-2.6.orig/arch/powerpc/boot/dts/sequoia.dts linux-2.6/arch/powerpc/boot/dts/sequoia.dts
--- linux-2.6.orig/arch/powerpc/boot/dts/sequoia.dts 2007-09-24 14:55:15.000000000 +0400
+++ linux-2.6/arch/powerpc/boot/dts/sequoia.dts 2007-09-24 21:50:24.000000000 +0400
@@ -122,6 +122,14 @@
interrupt-map-mask = <ffffffff>;
};
+ USB0: ehci@e0000300 {
+ compatible = "ibm,usb-ehci-440epx", "usb-ehci";
+ interrupt-parent = <&UIC0>;
+ interrupts = <1a 4>;
+ reg = <0 e0000300 90 0 e0000390 70>;
+ big-endian;
+ };
+
POB0: opb {
compatible = "ibm,opb-440epx", "ibm,opb";
#address-cells = <1>;
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox