BCM5354 D-Link DIR-320

Alexandr Rybalko ray at dlink.ua
Wed May 6 11:12:22 UTC 2009


Good day to all!

bfe driver ported as client of siba bus, it`s worked, but work not done.
To dirty code :)

Question to FreeBSD MIPS guru:
Maybe problem in me low experience in FreeBSD internals, but I thing bus_dmamem_alloc and bus_dmamem_load
ignore "alignment" attribute passed to bus_dma_tag_create.

BFE need DMA descriptors page to be aligned to 4096, but I done this alignment only with set descriptors count from 128 to 512

Next question, how I can start init (without "write fault at 0x2003821"), if someone know




boot -tftp -raw -addr=0x807963c0 -max=0x770000 192.168.0.90:kernel.tramp.bin 
cmd = boot -tftp -raw -addr=0x807963c0 -max=0x770000 192.168.0.90:kernel.tramp.bin 
Loader:raw Filesys:tftp Dev:eth0 File:192.168.0.90:kernel.tramp.bin Options:(null) 
Loading: entry point=807963C0 
...... 3773973 bytes read
Entry at 0x807963c0
Closing network.
Starting program at 0x807963c0
entry: mips_init()
  picache_stride    = 4096
  picache_loopcount = 4
  pdcache_stride    = 4096
  pdcache_loopcount = 4
cpu0: Broadcom processor v41.144
  MMU: Standard TLB, 32 entries
  L1 i-cache: 4 ways of 256 sets, 16 bytes per line
  L1 d-cache: 2 ways of 512 sets, 16 bytes per line
Va=0xc0000000 Ve=ffffc000
init kernel_segmap va >> = 768 nkpt:120
avail_start:0x439000 avail_end:0x2000000
KDB: debugger backends: ddb
KDB: current backend: ddb
hz=100 cyl_per_hz:240000 cyl_per_usec:240 freq:240000000
cyl_per_hz:2400000 cyl_per_sec:240000000 Copyright (c) 1992-2009 The
FreeBSD Project. Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989,
1991, 1992, 1993, 1994 The Regents of the University of California. All
rights reserved. FreeBSD is a registered trademark of The FreeBSD
Foundation. FreeBSD 8.0-CURRENT #226 r105:114M: Wed May  6 13:00:54
EEST 2009
root at terran.mk.farlep.net:/usr/home/ray/Projects/MIPS/FreeBSD/obj/mips/usr/home/ray/Projects/MIPS/FreeBSD/src/sys/BCM4704
real memory  = 32763904 (31996K bytes) Physical memory chunk(s):
0x00439000 - 0x01f44fff, 28360704 bytes (6924 pages)
avail memory = 28008448 (26MB)
null: <null device, zero device>
nfslock: pseudo-device
mem: <memory>
nexus0: <MIPS32 root nexus>
nexus_hinted_child: discovered hinted child siba0 at maddr 0x18000000
(65536) clock0: <Generic MIPS32 ticker> on nexus0
Establish HARD IRQ 5: filt 0x80239734 handler 0 arg 0
clock0: [FILTER]
siba0: start 18000000 len 00010000
siba0: idlo = 600422dd
siba0: idhi = 42439004
siba0:  chipcore id = 00000800
siba0: ccid = 07025354, cc_id = 5354, cc_rev = 0002
siba0: 7 cores detected.
siba0: after remapping: start 18000000 len 00007000
siba0: <Sonics SiliconBackplane rev 0x0> at mem 0x18000000-0x18006fff
on nexus0 siba_attach: entry
siba0: <ChipCommon> corid=0800 regions count 4 0=18000000x1000
1=1fc00000x400000 2=1c000000x2000000 3=1a000000x2000000 
siba0: <Ethernet core> corid=0806 regions count 1 0=18001000x1000
siba0: <MIPS 3302 core> corid=0816 regions count 1 0=18002000x1000
siba0: <USB 2.0 Host> corid=0819 regions count=2 func=1 base 18003000x0200 func=2 base 18003800x0100 
siba0: <SDRAM/DDR controller> corid=080f regions count 4 0=18004000x1000 1=00000000x8000000 2=10000000x8000000
3=80000000x20000000 
siba0: <IEEE 802.11> corid=0812 regions count 1 0=18005000x1000 
siba0: <Roboswitch> corid=081c regions count 1 0=18006000x1000 
siba_cc0: <ChipCommon core> at mem 0x18000000-0x18000fff irq 0 on siba0 
Establish HARD IRQ 0: filt 0 handler 0x802479b0 arg 0xc0815e80 
siba_cc0: [GIANT-LOCKED] 
siba_cc0: [ITHREAD] 
bfe0: <Broadcom 44xx Ethernet Chip> at mem 0x18001000-0x18001fff irq 1 on siba0 
bfe_robo_config_vlan: Add port 1 untagged to VLAN=1 
bfe_robo_config_vlan: Add port 2 untagged to VLAN=1
bfe_robo_config_vlan: Add port 3 untagged to VLAN=1
bfe_robo_config_vlan: Add port 4 untagged to VLAN=1
bfe_robo_config_vlan: Add port 5 untagged CPU MII to VLAN=1
bfe_robo_config_vlan: Add port 0 untagged to VLAN=2
bfe_robo_config_vlan: Add port 5 tagged CPU MII to VLAN=2
miibus0: <MII bus> on bfe0
bfeswitch0: <BCM5325 10/100baseTX Switch PHY> PHY 0 on miibus0
bfeswitch0:  100baseTX-FDX
bfe0: Ethernet address: 00:1b:11:31:df:0a
Establish HARD IRQ 2: filt 0 handler 0x8024c21c arg 0xc0872000
bfe0: [MPSAFE]
bfe0: [ITHREAD]
siba_mips0: <MIPS 3302 processor> at mem 0x18002000-0x18002fff on siba0
ehci0: <SiBa integrated EHCI controller> at mem 0x18003000-0x18003fff irq 4 on siba0 
Establish HARD IRQ 4: filt 0 handler 0x802477b0 arg 0xc087b000 
ehci0: [MPSAFE]
ehci0: [ITHREAD]
usbus0: EHCI version 1.0
usbus0: <Broadcom Integrated USB 2.0 controller> on ehci0
siba_sdram0: <SDRAM/DDR core> at mem 0x18004000-0x18004fff on siba0
siba0: <IEEE 802.11> at device 5 (no driver attached)
siba0: <Roboswitch> at device 6 (no driver attached)
Device configuration finished.
Timecounter "MIPS32" frequency 240000000 Hz quality 800
Timecounters tick every 10.000 msec
usbus0: 480Mbps High Speed USB v2.0
bootpc_init: wired to interface 'bfe0'
Sending DHCP Discover packet from interface bfe0 (00:1b:11:31:df:0a)
ugen0.1: <Broadcom> at usbus0
uhub0: <Broadcom EHCI root HUB, class 9/0, rev 2.00/1.00, addr 1> on
usbus0 Received DHCP Offer packet on bfe0 from 0.0.0.0 (accepted) (no root path) 
uhub0: 2 ports with 2 removable, self powered
Sending DHCP Request packet from interface bfe0 (00:1b:11:31:df:0a)
Received DHCP Ack packet on bfe0 from 0.0.0.0 (accepted) (got root path)
bfe0 at 192.168.0.1 server 0.0.0.0
subnet mask 255.255.255.0 rootfs
192.168.0.90:/usr/home/ray/Projects/MIPS/FreeBSD/rootfs-mips Adjusted
interface bfe0 Trying to mount root from nfs:
NFS ROOT: 192.168.0.90:/usr/home/ray/Projects/MIPS/FreeBSD/rootfs-mips
warning: no time-of-day clock registered, system time will not be set accurately 
warning: no time-of-day clock registered, system time will not be set accurately 
start_init: trying /sbin/init
trap type 3 (TLB miss (store) - kernel mode)
badaddr = 0x7fffefff, pc = 0x80243400, ra = 0x800bdc2c, sp = 0xc0659e00, sr = 0xff03, pid = 1, ASID = 0x2
trap type 3 (TLB miss (store) - kernel mode)
badaddr = 0xc36f4000, pc = 0x80243060, ra = 0x80243208, sp = 0xc0659d60, sr = 0xff03, pid = 1, ASID = 0x2
trap type 3 (TLB miss (store) - kernel mode)
badaddr = 0xc36b4000, pc = 0x80243060, ra = 0x80243208, sp = 0xc0659d60, sr = 0xff03, pid = 1, ASID = 0x2
trap type 3 (TLB miss (store) - kernel mode)
badaddr = 0x10004000, pc = 0x802435c8, ra = 0x802432cc, sp = 0xc0659b28, sr = 0xff03, pid = 1, ASID = 0x2
trap type 3 (TLB miss (store) - kernel mode)
badaddr = 0x7fffefe0, pc = 0x802435c8, ra = 0x802432cc, sp = 0xc0659bc8, sr = 0xff03, pid = 1, ASID = 0x2
trap type 3 (TLB miss (store) - kernel mode)
badaddr = 0x7fffdfc4, pc = 0x802435c8, ra = 0x802432cc, sp = 0xc0659bc8, sr = 0xff03, pid = 1, ASID = 0x2
trap type 25 (address error (store) - user mode)
badaddr = 0x2003821, pc = 0x4001b4, ra = 0, sp = 0x7fffded8, sr = 0x12, pid = 1, ASID = 0x2
ADDRESS_ERR: pid 1 (init), uid 0: pc 0x4001b8 got a write fault at 0x2003821
Trapframe Register Dump:
	zero: 00000000	at: 00000000	v0: 02003821	v1: 00000008
	a0: 7fffdf04	a1: 00000000	a2: 00000000	a3: 00000000
	t0: 00000000	t1: 00000000	t2: 00000000	t3: 00000000
	t4: 00000000	t5: 00000000	t6: 00000000	t7: 00000000
	t8: 00000000	t9: 00400178	s0: 00000002	s1: 7fffdf14
	s2: 7fffdf08	s3: 00000000	s4: 00000000	s5: 00000000
	s6: 00000000	s7: 00000000	k0: 00000000	k1: 00000000
	gp: 1000ba70	sp: 7fffded8	s8: 00000000	ra: 00000000
	sr: 00000012	mullo: 00000000	mulhi: 00000000	badvaddr: 02003821
	cause: 80000014	pc: 004001b4
Page table info for pc address 0x4001b8: pde = 0x80502000, pte = 0x4002081a
Dumping 4 words starting at pc address 0x4001b8: 
ac510000 8c840004 1080000e 00000000
trap type 25 (address error (store) - user mode)
badaddr = 0x2003821, pc = 0x4001b4, ra = 0, sp = 0x7fffded8, sr = 0x13, pid = 1, ASID = 0x2
ADDRESS_ERR: pid 1 (init), uid 0: pc 0x4001b8 got a write fault at 0x2003821
Trapframe Register Dump:
	zero: 00000000	at: 00000000	v0: 02003821	v1: 00000008
	a0: 7fffdf04	a1: 00000000	a2: 00000000	a3: 00000000
	t0: 00000000	t1: 00000000	t2: 00000000	t3: 00000000
	t4: 00000000	t5: 00000000	t6: 00000000	t7: 00000000
	t8: 00000000	t9: 00400178	s0: 00000002	s1: 7fffdf14
	s2: 7fffdf08	s3: 00000000	s4: 00000000	s5: 00000000
	s6: 00000000	s7: 00000000	k0: 00000000	k1: 00000000
	gp: 1000ba70	sp: 7fffded8	s8: 00000000	ra: 00000000
	sr: 00000013	mullo: 00000000	mulhi: 00000000	badvaddr: 02003821
	cause: 80008014	pc: 004001b4
Page table info for pc address 0x4001b8: pde = 0x80502000, pte = 0x4002081a
Dumping 4 words starting at pc address 0x4001b8: 
ac510000 8c840004 1080000e 00000000
trap type 25 (address error (store) - user mode)
badaddr = 0x2003821, pc = 0x4001b4, ra = 0, sp = 0x7fffded8, sr = 0x13, pid = 1, ASID = 0x2
ADDRESS_ERR: pid 1 (init), uid 0: pc 0x4001b8 got a write fault at 0x2003821
Trapframe Register Dump:
	zero: 00000000	at: 00000000	v0: 02003821	v1: 00000008
	a0: 7fffdf04	a1: 00000000	a2: 00000000	a3: 00000000
	t0: 00000000	t1: 00000000	t2: 00000000	t3: 00000000
	t4: 00000000	t5: 00000000	t6: 00000000	t7: 00000000
	t8: 00000000	t9: 00400178	s0: 00000002	s1: 7fffdf14
	s2: 7fffdf08	s3: 00000000	s4: 00000000	s5: 00000000
	s6: 00000000	s7: 00000000	k0: 00000000	k1: 00000000
	gp: 1000ba70	sp: 7fffded8	s8: 00000000	ra: 00000000
	sr: 00000013	mullo: 00000000	mulhi: 00000000	badvaddr: 02003821
	cause: 80008014	pc: 004001b4
Page table info for pc address 0x4001b8: pde = 0x80502000, pte = 0x4002081a
Dumping 4 words starting at pc address 0x4001b8: 
ac510000 8c840004 1080000e 00000000
trap type 25 (address error (store) - user mode)
badaddr = 0x2003821, pc = 0x4001b4, ra = 0, sp = 0x7fffded8, sr = 0x13, pid = 1, ASID = 0x2
Trapframe Register Dump:
	zero: 00000000	at: 00000000	v0: 02003821	v1: 00000008
	a0: 7fffdf04	a1: 00000000	a2: 00000000	a3: 00000000
	t0: 00000000	t1: 00000000	t2: 00000000	t3: 00000000
	t4: 00000000	t5: 00000000	t6: 00000000	t7: 00000000
	t8: 00000000	t9: 00400178	s0: 00000002	s1: 7fffdf14
	s2: 7fffdf08	s3: 00000000	s4: 00000000	s5: 00000000
	s6: 00000000	s7: 00000000	k0: 00000000	k1: 00000000
	gp: 1000ba70	sp: 7fffded8	s8: 00000000	ra: 00000000
	sr: 00000013	mullo: 00000000	mulhi: 00000000	badvaddr: 02003821
	cause: 80008014	pc: 004001b4
panic: too many faults at 0x2003821

KDB: enter: panic
trap type 9 (breakpoint - kernel mode)
badaddr = 0x2003821, pc = 0x8012ce30, ra = 0x8012ce28, sp = 0xc0659d80, sr = 0x3, pid = 1, ASID = 0x2
[thread pid 1 tid 100001 ]
Stopped at      kdb_enter+0x50: lui     at,0x802e
db> 


-- 
Alexandr Rybalko <ray at dlink.ua>
aka Alex RAY <ray at ddteam.net>


More information about the freebsd-mips mailing list