From owner-freebsd-mips@FreeBSD.ORG Wed May 6 11:12:22 2009 Return-Path: Delivered-To: freebsd-mips@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6A100106564A for ; Wed, 6 May 2009 11:12:22 +0000 (UTC) (envelope-from ray@ddteam.net) Received: from qw-out-2122.google.com (qw-out-2122.google.com [74.125.92.25]) by mx1.freebsd.org (Postfix) with ESMTP id 18D898FC0C for ; Wed, 6 May 2009 11:12:21 +0000 (UTC) (envelope-from ray@ddteam.net) Received: by qw-out-2122.google.com with SMTP id 3so16690qwe.7 for ; Wed, 06 May 2009 04:12:20 -0700 (PDT) Received: by 10.224.19.131 with SMTP id a3mr1417197qab.17.1241608339209; Wed, 06 May 2009 04:12:19 -0700 (PDT) Received: from terran.mk.farlep.net (i183-101-19-89.vpdn.way.kv.chereda.net [89.19.101.183]) by mx.google.com with ESMTPS id 7sm5835899ywo.26.2009.05.06.04.12.16 (version=SSLv3 cipher=RC4-MD5); Wed, 06 May 2009 04:12:18 -0700 (PDT) Sender: Alex RAY Date: Wed, 6 May 2009 14:12:08 +0300 From: Alexandr Rybalko To: freebsd-mips@freebsd.org Message-Id: <20090506141208.9ea79d6a.ray@dlink.ua> Organization: D-Link X-Mailer: Sylpheed 2.6.0 (GTK+ 2.14.7; i386-portbld-freebsd7.1) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: BCM5354 D-Link DIR-320 X-BeenThere: freebsd-mips@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting FreeBSD to MIPS List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 May 2009 11:12:22 -0000 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@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: nfslock: pseudo-device mem: nexus0: nexus_hinted_child: discovered hinted child siba0 at maddr 0x18000000 (65536) clock0: 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: at mem 0x18000000-0x18006fff on nexus0 siba_attach: entry siba0: corid=0800 regions count 4 0=18000000x1000 1=1fc00000x400000 2=1c000000x2000000 3=1a000000x2000000 siba0: corid=0806 regions count 1 0=18001000x1000 siba0: corid=0816 regions count 1 0=18002000x1000 siba0: corid=0819 regions count=2 func=1 base 18003000x0200 func=2 base 18003800x0100 siba0: corid=080f regions count 4 0=18004000x1000 1=00000000x8000000 2=10000000x8000000 3=80000000x20000000 siba0: corid=0812 regions count 1 0=18005000x1000 siba0: corid=081c regions count 1 0=18006000x1000 siba_cc0: 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: 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: on bfe0 bfeswitch0: 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: at mem 0x18002000-0x18002fff on siba0 ehci0: 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: on ehci0 siba_sdram0: at mem 0x18004000-0x18004fff on siba0 siba0: at device 5 (no driver attached) siba0: 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: at usbus0 uhub0: 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 aka Alex RAY From owner-freebsd-mips@FreeBSD.ORG Thu May 7 18:57:43 2009 Return-Path: Delivered-To: freebsd-mips@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CE42B1065673 for ; Thu, 7 May 2009 18:57:43 +0000 (UTC) (envelope-from gonzo@freebsd.org) Received: from core.tav.kiev.ua (tavex.colocall.com [62.149.10.42]) by mx1.freebsd.org (Postfix) with ESMTP id 5B8458FC08 for ; Thu, 7 May 2009 18:57:43 +0000 (UTC) (envelope-from gonzo@freebsd.org) Received: from [76.77.86.2] (helo=[10.80.5.136]) by core.tav.kiev.ua with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.52 (FreeBSD)) id 1M28K7-000OLo-FJ; Thu, 07 May 2009 21:28:00 +0300 Message-ID: <4A032821.1040800@freebsd.org> Date: Thu, 07 May 2009 11:27:45 -0700 From: Oleksandr Tymoshenko User-Agent: Thunderbird 2.0.0.21 (Windows/20090302) MIME-Version: 1.0 To: Alexandr Rybalko References: <20090506141208.9ea79d6a.ray@dlink.ua> In-Reply-To: <20090506141208.9ea79d6a.ray@dlink.ua> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Core-Spam-Level: / X-Core-Spam-Report: Spam detection software, running on the system "core.tav.kiev.ua", has identified this incoming email as possible spam. The original message has been attached to this so you can view it (if it isn't spam) or label similar future email. If you have any questions, see The administrator of that system for details. Content preview: Alexandr Rybalko wrote: > 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. Yes, looks like it. I just skimmed the code and will confirm/test it a bit later. [...] Content analysis details: (0.3 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.8 ALL_TRUSTED Passed through trusted hosts only via SMTP 0.0 BAYES_50 BODY: Bayesian spam probability is 40 to 60% [score: 0.5001] 2.1 AWL AWL: From: address is in the auto white-list Cc: freebsd-mips@freebsd.org Subject: Re: BCM5354 D-Link DIR-320 X-BeenThere: freebsd-mips@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting FreeBSD to MIPS List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 May 2009 18:57:44 -0000 Alexandr Rybalko wrote: > 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. Yes, looks like it. I just skimmed the code and will confirm/test it a bit later. > > 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 > 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 .. skipped .. These faults should not happen. I think pmap internal data is messed in some way. So there is no simple answer, this problem requires more debugging