<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=big5">
<META content="MSHTML 6.00.2800.1555" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV>Hi,</DIV>
<DIV> </DIV>
<DIV>I have a Freescale MPC8245 machine running Montavista Linux (kernel
2.4.20).</DIV>
<DIV>There are two devices connected to the PCI bus: </DIV>
<DIV>a USB host controller (VIA VT6212L) and a single-chip network switch
(Broadcom BCM5650).</DIV>
<DIV> </DIV>
<DIV>Now BCM5650 is working but VT6212L is not.</DIV>
<DIV>I tried to modify the PCI code but met some problems.</DIV>
<DIV> </DIV>
<DIV>Here are the PCI information and boot message:</DIV>
<DIV> </DIV>
<DIV>Bus 0, device 0, devfn 0 (id 1057-0006, headertype
0x00)<BR> region 0: mask 0x00000008,
now at 0x00000000<BR> region 0: type
mem, size 0 (0MB)<BR> region 1: mask
0xfffff000, now at 0x00000000<BR>
region 1: type mem, size 4096
(4KB)<BR> region 2: mask 0x00000008,
now at 0x00000000<BR> region 2: type
mem, size 0 (0MB)<BR>Bus 0, device 16, devfn 0 (id 14e4-5650, headertype
0x00) <-- BCM5650<BR> region
0: mask 0xffff0004, now at
0xbfff0000<BR> region 0: type mem,
size 65536 (64KB)<BR> region 1: mask
0x000000ff, now at 0x00000000<BR>
region 1: type I/O, size 65284 (65284B)<BR>Bus 0, device 17, devfn 0 (id
1106-3038, headertype 0x00) <-- VT6212L (UHCI
1)<BR> region 4: mask 0xffffffe1, now
at 0x00bfffe0<BR> region 4: type I/O,
size 32 (32B)<BR>Bus 0, device 17, devfn 1 (id 1106-3038, headertype
0x00) <-- VT6212L (UHCI
2)<BR> region 4: mask 0xffffffe1, now
at 0x00bfffc0<BR> region 4: type I/O,
size 32 (32B)<BR>Bus 0, device 17, devfn 2 (id 1106-3104, headertype 0x00)
<-- VT6212L (EHCI)<BR> region 0:
mask 0xffffff00, now at 0xbffeff00<BR>
region 0: type mem, size 256 (256B)</DIV>
<DIV>--</DIV>
<DIV>PCI: Probing PCI hardware<BR>PCI:00:00.0 Resource 0 [00000000-ffffffff] is
unassigned<BR>PCI:00:00.0 Resource 1 [00000000-00000fff] is
unassigned<BR>PCI:00:00.0 Resource 2 [00000000-ffffffff] is unassigned<BR>PCI:
bridge rsrc 0..bfffff (100), parent c0179de4<BR>PCI: bridge rsrc
80000000..fcffffff (200), parent c0179e00<BR>PCI:00:10.0: Resource 0:
bfff0000-bfffffff (f=204) <-- BCM5650<BR>PCI:00:11.0:
Resource 4: 00bfffe0-00bfffff (f=101) <-- VT6212L (UHCI
1)<BR>PCI:00:11.1: Resource 4: 00bfffc0-00bfffdf (f=101) <--
VT6212L (UHCI 2)<BR>PCI:00:11.2: Resource 0: bffeff00-bffeffff
(f=200) <-- VT6212L (EHCI)</DIV>
<DIV>--</DIV>
<DIV> </DIV>
<DIV>It seems no problem with the allocated resource regions for VT6212L, but I
got "Timeout" message printed by USB driver.</DIV>
<DIV>So, I modify the function "mpc10x_bridge_set_resources" in
"arch/ppc/kernel/mpc10x_common.c":</DIV>
<DIV> </DIV>
<DIV> case
MPC10X_MEM_MAP_B:<BR>
pci_init_resource(&hose->io_resource,<BR>
0x00000000,<BR>
0xffff,
/* original value: 0x00bfffff,
*/<BR>
IORESOURCE_IO,<BR>
"PCI host bridge");</DIV>
<DIV>--</DIV>
<DIV>and the defination of MPC10X_MAPB_PCI_IO_END in
"include/asm/mpc10x.h":</DIV>
<DIV> </DIV>
<DIV>#define
MPC10X_MAPB_PCI_IO_END
(0x00010000 - 1) /* original value: (0x00c00000 - 1) */</DIV>
<DIV>--</DIV>
<DIV>After modification, the USB 1.x driver (UHCI) is working, and EHCI is still
not working.</DIV>
<DIV>BUT I don't know why the UHCI works if I do the above
modification?</DIV>
<DIV> </DIV>
<DIV>The PCI information after modification is shown below:</DIV>
<DIV> </DIV>
<DIV>Bus 0, device 17, function 0:<BR> Class
0c03: PCI device 1106:3038 (rev 97).<BR> IRQ
1.<BR> Master Capable.
Latency=128.<BR> I/O at 0xffe0
[0xffff].
<-- I/O change to 0xffe0<BR> Bus 0, device 17,
function 1:<BR> Class 0c03: PCI device 1106:3038 (rev
97).<BR> IRQ 1.<BR>
Master Capable. Latency=128.<BR> I/O at
0xffc0
[0xffdf].
<-- I/O change to 0xffc0<BR> Bus 0, device 17,
function 2:<BR> Class 0c03: PCI device 1106:3104 (rev
99).<BR> IRQ 1.<BR>
Master Capable. Latency=128.<BR>
Non-prefetchable 32 bit memory at 0xbffeff00 [0xbffeffff].</DIV>
<DIV>--</DIV>
<DIV> </DIV>
<DIV>I do the modification for the PCI memory configuration similar to the
modification for PCI I/O configuration:</DIV>
<DIV> </DIV>
<DIV>[arch/ppc/kernel/mpc10x_common.c]</DIV>
<DIV>case MPC10X_MEM_MAP_B:</DIV>
<DIV> ... snipped</DIV>
<DIV>
pci_init_resource
(&hose->mem_resources[0],<BR>
0x00000000,
/* original value: 0x80000000,
*/<BR>
0x000fffff,
/* original value: 0xfcffffff,
*/<BR>
IORESOURCE_MEM,<BR>
"PCI host bridge");</DIV>
<DIV>--</DIV>
<DIV>[include/asm/mpc10x.h]</DIV>
<DIV>#define MPC10X_MAPB_ISA_MEM_BASE
0x00000000 /* original value: 0x80000000 */</DIV>
<DIV>... snipped</DIV>
<DIV>#define MPC10X_MAPB_PCI_MEM_START
0x00000000 /* original value: 0x80000000
*/<BR>#define MPC10X_MAPB_PCI_MEM_END
(0x00100000 - 1) /* original value: (0xC0000000 - 1) */</DIV>
<DIV>--</DIV>
<DIV>Surprisingly, after this modification, the USB2.0 driver (EHCI) can
work.</DIV>
<DIV>BUT, the BCM5650 driver failed...</DIV>
<DIV> </DIV>
<DIV>Here are the PCI information and boot message:</DIV>
<DIV> </DIV>
<DIV> Bus 0, device 16, function
0:<BR> Class 0280: PCI device 14e4:5650 (rev
17).<BR> Master Capable.
Latency=128.<BR> Non-prefetchable 64 bit memory at
0xf0000 [0xfffff]. <-- BCM5650 PCI memory address change to
0xf0000<BR> Bus 0, device 17, function
0:<BR> Class 0c03: PCI device 1106:3038 (rev
97).<BR> IRQ 1.<BR>
Master Capable. Latency=128.<BR> I/O at
0xffe0 [0xffff].<BR> Bus 0, device 17, function
1:<BR> Class 0c03: PCI device 1106:3038 (rev
97).<BR> IRQ 1.<BR>
Master Capable. Latency=128.<BR> I/O at
0xffc0 [0xffdf].<BR> Bus 0, device 17, function
2:<BR> Class 0c03: PCI device 1106:3104 (rev
99).<BR> IRQ 1.<BR>
Master Capable. Latency=128.<BR>
Non-prefetchable 32 bit memory at 0xeff00 [0xeffff]. <-- EHCI PCI memory
address change to 0xeff00</DIV>
<DIV>--</DIV>
<DIV>PCI: bridge rsrc 0..ffff (100), parent c016fde4<BR>PCI: bridge rsrc
0..fffff (200), parent c016fe00<BR>PCI:00:10.0: Resource 0: 000f0000-000fffff
(f=204)<BR>PCI:00:11.0: Resource 4: 0000ffe0-0000ffff (f=101)<BR>PCI:00:11.1:
Resource 4: 0000ffc0-0000ffdf (f=101)<BR>PCI:00:11.2: Resource 0:
000eff00-000effff (f=200)</DIV>
<DIV>--</DIV>
<DIV>And the failure message during inserting BCM5650 driver into kernel
is:</DIV>
<DIV> </DIV>
<DIV>__ioremap(): phys addr f0000 is RAM lr c0011db0<BR>Oops: kernel access of
bad area, sig: 11<BR>NIP: C4881164 XER: 20000000 LR: C4887EDC SP: C3729C90 REGS:
c3729be0 TRAP: 0300<BR> Not tainted<BR>MSR: 00001032 EE: 0 PR: 0 FP:
0 ME: 1 IR/DR: 11<BR>DAR: 00000148, DSISR: 22000000<BR>TASK = c3728000[109]
'insmod' Last syscall: 128</DIV>
<DIV>... snipped</DIV>
<DIV>--</DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV>I have really no idea about this problem because I'm pretty new to PowerPC
and PCI architecture :'(</DIV>
<DIV>(So I think my modification may not reasonable)</DIV>
<DIV>Can anyone help me solve this problem ?</DIV>
<DIV>Any pointers and help would be greatly appreciated.</DIV>
<DIV> </DIV>
<DIV>Thank you!</DIV>
<DIV><FONT size=2><FONT size=3>Kenny</FONT></FONT></DIV>
<DIV><FONT size=2><FONT size=3></FONT> </DIV></FONT></BODY></HTML>