Subject: IBM Workpad Z50 and PCIC probe
To: None <port-hpcmips@NetBSD.org>
From: Matt Dainty <matt@bodgit-n-scarper.com>
List: port-hpcmips
Date: 01/09/2005 22:45:47
To try and work out why the PCIC probe does what it does, I tried to
trigger some of the debug-looking messages in sys/dev/ic/i82365.c
(including around the hpcmips-related comment ~ line 278), I just
uncommented the DEBUG config option and rebuilt. Didn't get the
messages, but it magically found both controllers again. Rebuilt without
DEBUG and it goes back to one controller again.

I found the pcic_debug flag in i82365.c to enable what I was after, as
well as the __find_pcic() debug code in
sys/arch/hpcmips/isa/isa_machdep.c it seems to find the same controller
many times at various memory addresses and even without the DEBUG config
option, finds the two controllers again.

I've attached my capture with all the debug up to the root device
prompt, below.

Just idly browsing the linux source tree for some clues if there's
something unusual in the pcic probe, I saw that the ISA port window is
defined to be 0x15000000-0x18000000 instead of 0x14000000-0x18000000 for
the Workpad, although I haven't built and booted a Linux kernel yet to
see what it does on the Workpad hardware. Would that ISA range make any
difference? I don't understand why the pcic hardware is appearing at
multiple memory locations although I understand in a basic fashion why
the I/O ports are memory-mapped on MIPS hardware.

I've trimmed the kernel config down so it should only contain config for
the Workpad hardware, this doesn't seem to make any difference. Enabling
arbitrary options seem to change when it works, maybe it's a subtle
timing issue between jumping from WinCE and probing the hardware?

Is there anyone who might be able to offer some clues?

Matt

Boot below:

--------HPCBOOT--------
sysinfo.dwPageSize = 1024
MemoryManager: LockPages
FileManager: FAT
hpcboot build number: 12
IBM WorkPad z50 2601 1AU (cpu=0x04104300 machine=0x02410101)
[progress] 2
[0] 0x80000000 size 0x04000000
_WIN32_WCE = 211
GetVersionEx
Windows CE 2.11
GetSystemInfo:
wProcessorArchitecture      0x1
wProcessorLevel             0x4
wProcessorRevision          0xc60
dwPageSize                  0x400
dwAllocationGranularity     0x00010000
dwProcessorType             0xfa0
Display: 640x480 16bpp
VR41
[progress] 3
[progress] 4
open file "\Storage Card\netbsd.gz"(1192186 byte).
[progress] 5
Loader: ELF
[progress] 6
file size: +0x25a900+[(symbol block: header 1076 symbol 103424 string 94578 byte) = 0x309a6] = 0x28b5a6 byte
address translation table 2688 pages.(21504 byte)
allocated 2688 page. mapped 2688 page.
[progress] 7
2nd bootloader vaddr=0x0033fc00 paddr=0x03b3b800
2nd bootloader copy done.
[progress] 8
[1] vaddr 0x80001000 file size 0x25a900 mem size 0x293f84
        ->load 0x80001000+0x00293f84=0x80294f84 ofs=0x00001000+0x25a900
[zero clear] ->0x8025b900+0x00039684=0x80294f84
        ->load 0x80294f84+0x00000434=0x802953b8
        ->load 0x802953b8+0x00019400=0x802ae7b8 ofs=0x0029809c+0x19400
        ->load 0x802ae7b8+0x00017172=0x802c592a ofs=0x002b149c+0x17172
[progress] 9
load link 2646 zero clear link 1.
kernel entry address: 0x80001000
framebuffer: 640x480 type=5 linebytes=1280 addr=0xaa000000
console = 2
[progress] 10
jump to 0x83b3b800 (info=0x83b3b400, pvec=0x83899c00)
mem_cluster_cnt = 3
mem_clusters[0] = {0x0,0x297000}
mem_clusters[1] = {0x297000,0xd69000}
mem_clusters[2] = {0x2000000,0x2000000}
loading 0x297000,0xd69000
loading 0x2000000,0x2000000
Copyright (c) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
    The NetBSD Foundation, Inc.  All rights reserved.
Copyright (c) 1982, 1986, 1989, 1991, 1993
    The Regents of the University of California.  All rights reserved.
 
NetBSD 2.99.12 (WORKPAD) #7: Sun Jan  9 21:17:07 GMT 2005
        matt@lister.bodgit-n-scarper.com:/home/matt/netbsd/obj.hpcmips/sys/arch/hpcmips/compile/WORKPAD
IBM WorkPad z50 2601 1AU (NEC VR4121 rev0.0 131.072MHz)
total memory = 49152 KB
total memory banks = 3
memory bank 0 = 0x00000000 2652KB(0x00297000)
memory bank 1 = 0x00297000 13732KB(0x00d69000)
memory bank 2 = 0x02000000 32768KB(0x02000000)
avail memory = 45216 KB
mainbus0 (root)
cpu0 at mainbus0: NEC VR4100 CPU (0xc60) Rev. 6.0 with software emulated floating point
cpu0: 16KB/16B direct-mapped L1 Instruction cache, 32 TLB entries
cpu0: 8KB/16B direct-mapped write-back L1 Data cache
vr4102ip0 at mainbus0
vrbcu0 at vr4102ip0 addr 0x0b000000-001f
vrbcu0: CPU 131.072MHz, bus 32.768MHz, ram 32.768MHz
vrcmu0 at vr4102ip0 addr 0x0b000060-007f
vrgiu0 at vr4102ip0 addr 0x0b000100-011f
                                             3         2         1
                                            10987654321098765432109876543210
WIN setting:                                iiiiiiiiiiiiiiiiHiiiEohiioiiiEEE
I/O setting:                                iiiiiiiiiiiiiiiiiiiiioiiioiiiiii
       data:......||.........|||||||||||||||..|..||||.||||.|.||.|.......|||.
button0 at vrgiu0 port=1 id=12 active=low sense=edge
button2 at vrgiu0 port=2 id=16 active=low sense=edge
pwctl3 at vrgiu0 port=49 id=6 on=1
ite8181_probe: vendor id=1283 product id=8181
vrdmaau0 at vr4102ip0 addr 0x0b000020-0037
vrdcu0 at vr4102ip0 addr 0x0b000040-004b
com0 at vr4102ip0 addr 0x0c000000-0007: ns16550a, working fifo
com0: console
com0: pwctl 0
vrrtc0 at vr4102ip0 addr 0x0b0000c0-00df
vrkiu0 at vr4102ip0 addr 0x0b000180-019f
hpckbd0 at vrkiu0
wskbd0 at hpckbd0 mux 1
vrpmu0 at vr4102ip0 addr 0x0b0000a0-00bf
vrpmu: Deadman's switch detected
vrdsu0 at vr4102ip0 addr 0x0b0000e0-00e7
vrled0 at vr4102ip0 addr 0x0b000240-024f
vrpiu0 at vr4102ip0 addr 0x0b000120-013f, 0x0b0002a0-02bf
wsmouse0 at vrpiu0 mux 0
vrdsiu_mouse0 at vr4102ip0 addr 0x0b0001a0-01bf
wsmouse1 at vrdsiu_mouse0 mux 0
ite8181_probe: vendor id=1283 product id=8181
ite8181video0 at vr4102ip0 addr 0x0a000000-7fffff: ITE8181 Rev.04
ite8181video0: framebuffer address: 0xaa000000
ite8181video0: ite8181 lcd control is DISABLED.
ite8181_init_brightness
ite8181_init_contrast
hpcfb0 at ite8181video0
wsdisplay0 at hpcfb0 kbdmux 1
wsmux1: connecting to wsdisplay0
wskbd0: connecting to wsdisplay0
vraiu0 at vr4102ip0 addr 0x0b000160-017f
audio0 at vraiu0: half duplex
vrisab0 at vrgiu0
Finding PCIC. Trying ISA port 0x14000000-0x18000000 step 0x1000000
0x14000000
found 1 socket at 0xb40003e0(base from 0x3e0)
 
found 2 socket at 0xb40003e0(base from 0x3e0)
 
found 3 socket at 0xb40003e0(base from 0x3e0)
 
found 4 socket at 0xb40003e0(base from 0x3e0)
0x14000000
found 1 socket at 0xb40003e2(base from 0x3e2)
 
found 1 socket at 0xb40003e2(base from 0x3e2)
0x15000000
found 1 socket at 0xb50003e0(base from 0x10003e0)
 
found 2 socket at 0xb50003e0(base from 0x10003e0)
 
found 3 socket at 0xb50003e0(base from 0x10003e0)
 
found 4 socket at 0xb50003e0(base from 0x10003e0)
0x15000000
found 1 socket at 0xb50003e2(base from 0x10003e2)
 
found 1 socket at 0xb50003e2(base from 0x10003e2)
0x16000000
found 1 socket at 0xb60003e0(base from 0x20003e0)
 
found 2 socket at 0xb60003e0(base from 0x20003e0)
 
found 3 socket at 0xb60003e0(base from 0x20003e0)
 
found 4 socket at 0xb60003e0(base from 0x20003e0)
0x16000000
found 1 socket at 0xb60003e2(base from 0x20003e2)
 
found 1 socket at 0xb60003e2(base from 0x20003e2)
0x17000000
found 1 socket at 0xb70003e0(base from 0x30003e0)
 
found 2 socket at 0xb70003e0(base from 0x30003e0)
 
found 3 socket at 0xb70003e0(base from 0x30003e0)
 
found 4 socket at 0xb70003e0(base from 0x30003e0)
0x17000000
found 1 socket at 0xb70003e2(base from 0x30003e2)
 
found 1 socket at 0xb70003e2(base from 0x30003e2)
: ISA port 0x15000000-0x18000000 mem 0x10000000-0x14000000
isa0 at vrisab0
pcic0 at isa0 port 0x3e0-0x3e1 iomem 0x70000-0x73fff irq 589827
pcic ident regs:socket 0 ident reg 0x83
socket 0 ident reg 0x83
socket 1 ident reg 0x83
socket 1 ident reg 0x83
socket 2 ident reg 0x83
socket 2 ident reg 0x83
socket 3 ident reg 0x83
socket 3 ident reg 0x83
pcic0: controller 0 (Intel 82365SL Revision 1) has sockets A and B
pcic0: controller 1 (Intel 82365SL Revision 1) has sockets A and B
pcmcia0 at pcic0 controller 0 socket 0
pcmcia1 at pcic0 controller 0 socket 1
pcmcia at pcic0 controller 1 socket 0 not configured
pcmcia at pcic0 controller 1 socket 1 not configured
btnmgr0 at mainbus0
wskbd1 at btnmgr0 mux 1
wskbd1: connecting to wsdisplay0
hpcapm0 at mainbus0: pseudo power management module
apmdev0 at hpcapm0: Power Management spec V1.2
ISA IRQ 3 -> vrgiu0 port 9, level high through
pcic0: using irq 589827 for socket events
pcic0: attach finish socket 0
pcic0: attach finish vendor 0x02
pcic0: attach finish socket 1
pcic0: attach finish vendor 0x02
pcic0: insertion event
pcic_delay: "pccen1" 0x83ed2330, sleep 201 ms
pcic_delay: "pccen2" 0x83ed2330, sleep 20 ms
pcic_chip_mem_map window 0 bus 70000+0+400 at card addr 0
mem8 1
pcic_chip_do_mem_map window 0: 0070 8070 7f90
wdc0 at pcmcia1 function 0: < LEXAR ATA FLASH CARD    , TWISTER, TTE01>
pcic_chip_io_alloc alloc port 15000400+10
pcic_chip_io_map window 0 auto port 15000400+10
pcic0: port 0x15000400-0x1500040f
pcic_chip_do_io_map win 0 addr 15000400 size 10 width 0
wdc0: i/o mapped mode
ISA IRQ 3 -> vrgiu0 port 9, level high through
pcmcia1: card irq 3
pcic_chip_mem_map window 0 bus 70000+200+14 at card addr 0
mem8 1
pcic_chip_do_mem_map window 0: 0070 8070 7f90
pcic0: pcic_chip_socket_settype 40 type io 63
atabus0 at wdc0 channel 0
pcic0: intr
wd0 at atabus0 drive 0pcic0: intr
: <LEXAR ATA FLASH>
wd0: drive supports 4-sector PIO transfers, LBA addressing
wd0: 246 MB, 984 cyl, 16 head, 32 sec, 512 bytes/sect x 503808 sectors
pcic0: intr
vrpiu:AD: 950, 106, 2
hpcapm: battery life 80%
hpcapm: battery state high
giu data: ......||.........|||||||||||||||..|..||||.||||.|.||.|.......|||.
pcic0: intr
wd0: drive supports PIO mode 4
pcic_chip_socket_disable
pcic_delay: "pccwr1" 0x83ed2330, sleep 300 ms
boot device: wd0
root device (default wd0a):