From owner-freebsd-mips@FreeBSD.ORG Tue Mar 29 07:15:44 2011 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 CEE6A1065676 for ; Tue, 29 Mar 2011 07:15:44 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-wy0-f182.google.com (mail-wy0-f182.google.com [74.125.82.182]) by mx1.freebsd.org (Postfix) with ESMTP id 668008FC0C for ; Tue, 29 Mar 2011 07:15:44 +0000 (UTC) Received: by wyf23 with SMTP id 23so4136287wyf.13 for ; Tue, 29 Mar 2011 00:15:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:date:message-id:subject:from:to :content-type; bh=oXUn2Nvt2PzbTiZVRb9kF00i9+CobqeW9LL4r0sK1Ww=; b=dnnYU+4/X8fWGy8Qer5bzhIl+Ca9+b1EdcRuT+nOAvbbTfVEq+OT5sxYaakYVSZSXO H+zf5Zm5Xq3fD1ZAckhGH0JsKwoh/aX3f71M1ePWg9/tV797H+xD8cT34EvRMMHd5a5d rUsUXJ28kyKRw0pOlH6ghzK01KiVYo2GSVVEk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=rjxy+EEopWTmrlo6Nw5dtvlWkSrgtsYu8u7Xv26XQi9eFtsfTeQD2tuOpkt4llJV2b HUZsviO9wv7tXrN0tWE+OrdYaP34aiOrPaRWOu6IPSx/aii5wmK4201i3aZKB7cX0v5s 3ayfaBNnNHeNurvsq8Yv7qMY86ME5olF4uY0s= MIME-Version: 1.0 Received: by 10.227.104.2 with SMTP id m2mr4737794wbo.35.1301382943196; Tue, 29 Mar 2011 00:15:43 -0700 (PDT) Received: by 10.227.135.137 with HTTP; Tue, 29 Mar 2011 00:15:43 -0700 (PDT) Date: Tue, 29 Mar 2011 15:15:43 +0800 Message-ID: From: Adrian Chadd To: freebsd-mips@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Subject: linker weirdness for MIPS kernel? 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: Tue, 29 Mar 2011 07:15:45 -0000 Hi guys, I'm trying to use modules on my MIPS boards and I'm hitting a snag. # kldload ./wlan.ko # kldload ./ath_hal.ko # kldload ./ath_rate_sample.ko link_elf_obj: symbol ieee80211_iterate_nodes undefined (1) linker_load_file: Unsupported file type kldload: can't load ./ath_rate_sample.ko: Exec format error # nm ./wlan.ko | grep ieee80211_iterate_nodes 00015edc t ieee80211_iterate_nodes # kldstat Id Refs Address Size Name 1 7 0x80000000 80000000 kernel 2 1 0xc7b4e000 538e4 wlan.ko 3 1 0xc7ba2000 70b88 ath_hal.ko # So the wlan module is loaded, it has that symbol internally, but the linker isn't gluing them together. That (1) is a local patch of mine to figure out where it's broken - here, it's broken in link_elf_obj.c:1038 . Ie, it's the first loop in relocate_file(). I'm not up to date on how all this ELF and kernel module/linker magic works, could someone please give me a hand diagnosing why this is happening? Thanks, Adrian From owner-freebsd-mips@FreeBSD.ORG Tue Mar 29 11:35:16 2011 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 51DB51065678 for ; Tue, 29 Mar 2011 11:35:16 +0000 (UTC) (envelope-from c.jayachandran@gmail.com) Received: from mail-wy0-f182.google.com (mail-wy0-f182.google.com [74.125.82.182]) by mx1.freebsd.org (Postfix) with ESMTP id DB76E8FC12 for ; Tue, 29 Mar 2011 11:35:15 +0000 (UTC) Received: by wyf23 with SMTP id 23so60072wyf.13 for ; Tue, 29 Mar 2011 04:35:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=5VsSb/RrNbHOoZEWIAQPFyyzgBg7Al1HdKWu7uKQ1yM=; b=uk0KvXMjaXZvPkwKvQfZJoMMk0hiryWG9FeF4cYjRfPQCUkcVqJ3jMesx4RRxxdVOV 2fUc/Kmyh9hMKeuSe62ZXjBaG7XbKHZdDwxew69og2lBo3MYT9eDi36pBg8Xtm0JvYpo An+8qr958tn7/rCo8UdPDxpWDl8+/qS1WhTWY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=R0UxH5ImBp5wz5mFvRZuQAiIEa6LsYF9bRXOq1ab8u/088RQ9cBJXcAuMOWQQYojTN i7ZchKbRuo5EAljHXFOqCdllhmAHpVL3Gyd0eEsA0wca5lvodEc8smDJVxhX/uJJC8XQ 5i7tzBB2bpS+mjOMqWkUOqLbAy4UPXljq06UQ= MIME-Version: 1.0 Received: by 10.227.203.76 with SMTP id fh12mr5145820wbb.110.1301398514815; Tue, 29 Mar 2011 04:35:14 -0700 (PDT) Received: by 10.227.9.23 with HTTP; Tue, 29 Mar 2011 04:35:14 -0700 (PDT) In-Reply-To: References: Date: Tue, 29 Mar 2011 17:05:14 +0530 Message-ID: From: "Jayachandran C." To: Adrian Chadd Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: freebsd-mips@freebsd.org Subject: Re: linker weirdness for MIPS kernel? 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: Tue, 29 Mar 2011 11:35:16 -0000 On Tue, Mar 29, 2011 at 12:45 PM, Adrian Chadd wro= te: > Hi guys, > > I'm trying to use modules on my MIPS boards and I'm hitting a snag. > > # kldload ./wlan.ko > # kldload ./ath_hal.ko > # kldload ./ath_rate_sample.ko > link_elf_obj: symbol ieee80211_iterate_nodes undefined (1) > linker_load_file: Unsupported file type > kldload: can't load ./ath_rate_sample.ko: Exec format error > # nm ./wlan.ko =A0| grep ieee80211_iterate_nodes > 00015edc t ieee80211_iterate_nodes > # kldstat > Id Refs Address =A0 =A0Size =A0 =A0 Name > =A01 =A0 =A07 0x80000000 80000000 kernel > =A02 =A0 =A01 0xc7b4e000 538e4 =A0 =A0wlan.ko > =A03 =A0 =A01 0xc7ba2000 70b88 =A0 =A0ath_hal.ko > # > > So the wlan module is loaded, it has that symbol internally, but the link= er > isn't gluing them together. That (1) is a local patch of mine to figure o= ut > where it's broken - here, it's broken in link_elf_obj.c:1038 . Ie, it's t= he > first loop in relocate_file(). > > I'm not up to date on how all this ELF and kernel module/linker magic wor= ks, > could someone please give me a hand diagnosing why this is happening? There was an issue we had seen in link_elf.c in another context, the value = we have for linker_kernel_file->address is not correct for mips, it should be actually the KERNLOADADDR in config file. Not really sure if your problem is related, but here is a small hack/patch = to try: diff --git a/sys/kern/link_elf.c b/sys/kern/link_elf.c index 1e0bac1..14dfe9e 100644 --- a/sys/kern/link_elf.c +++ b/sys/kern/link_elf.c @@ -323,7 +323,11 @@ link_elf_init(void* arg) if (dp !=3D NULL) parse_dynamic(ef); +#ifdef __mips__ + linker_kernel_file->address =3D (caddr_t) 0xffffffff80100000; +#else linker_kernel_file->address =3D (caddr_t) KERNBASE; +#endif linker_kernel_file->size =3D -(intptr_t)linker_kernel_file->address= ; if (modptr !=3D NULL) { -- JC. From owner-freebsd-mips@FreeBSD.ORG Wed Mar 30 05:54:32 2011 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 9576A106566B for ; Wed, 30 Mar 2011 05:54:32 +0000 (UTC) (envelope-from mohun106@gmail.com) Received: from mail-yx0-f182.google.com (mail-yx0-f182.google.com [209.85.213.182]) by mx1.freebsd.org (Postfix) with ESMTP id 4CCB78FC19 for ; Wed, 30 Mar 2011 05:54:32 +0000 (UTC) Received: by yxl31 with SMTP id 31so458310yxl.13 for ; Tue, 29 Mar 2011 22:54:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=yHxJnp7To1++NkQvhAcgfkf7/tI+Vq8EaoEi4s2nx30=; b=QYlQSix8Z7VU0vYuFJRIg9hNj8Xne5tyOUTKSMiqB1FekfjtgKIB2hj9pC2jc6lU8X GycFjLSXyEZ8tr0rkypjUkFp54uHf3mQvLXUDfn0LTToyFU6zGZQmmsSFPshUPsSCBin VTtj1LGsK6cYR4oIR6E40lL2qelE6stEU+dRU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=ZSK1bwP5FGJuRxKXO8fceH9gUEwmnBPG3UrjW02edcxjATAjt+f5OdOX2KVw9X9RPf F9OHkrPoEh13CgfI/Na5o+xpTpe/dWzgpoji4OzIEXklggvIaganTiFDGIB4KxS0B39n y0Ov889XpCfabDDSQaHv+DTsmAXmgtMHfWIyg= MIME-Version: 1.0 Received: by 10.101.95.8 with SMTP id x8mr592380anl.3.1301463077746; Tue, 29 Mar 2011 22:31:17 -0700 (PDT) Received: by 10.100.173.20 with HTTP; Tue, 29 Mar 2011 22:31:17 -0700 (PDT) In-Reply-To: References: Date: Wed, 30 Mar 2011 11:01:17 +0530 Message-ID: From: Radha Mohan To: "Jayachandran C." Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: Adrian Chadd , freebsd-mips@freebsd.org Subject: Re: linker weirdness for MIPS kernel? 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, 30 Mar 2011 05:54:32 -0000 Hi JC, Incidentally I am also trying to load modules under FreeBSD on my MIPS plat= form, but I am getting following error. # /sbin/kldload -v ext2fs linker_load_file: Unsupported file type kldload:can't load ext2fs: Exec format error For me all the modules give me this error. >From what I understood going through the module loading code is the linker_load_file() function is trying for all the registered classes (elf64_obj and elf64 in my case). But the relocatable header type is handled in the link_elf_obj.c only and not link_elf.c . There is still some support lacking for the mips64 relocation in terms of getting "mapbase" (currently its taking only amd64 architecture into consideration)and handling addend (ELF_RELOC_RELA), R_MIPS_64, R_MIPS_HIGHER and R_MIPS_HIGHEST. regards, Radha Mohan On Tue, Mar 29, 2011 at 5:05 PM, Jayachandran C. wrote: > > On Tue, Mar 29, 2011 at 12:45 PM, Adrian Chadd w= rote: > > Hi guys, > > > > I'm trying to use modules on my MIPS boards and I'm hitting a snag. > > > > # kldload ./wlan.ko > > # kldload ./ath_hal.ko > > # kldload ./ath_rate_sample.ko > > link_elf_obj: symbol ieee80211_iterate_nodes undefined (1) > > linker_load_file: Unsupported file type > > kldload: can't load ./ath_rate_sample.ko: Exec format error > > # nm ./wlan.ko =A0| grep ieee80211_iterate_nodes > > 00015edc t ieee80211_iterate_nodes > > # kldstat > > Id Refs Address =A0 =A0Size =A0 =A0 Name > > =A01 =A0 =A07 0x80000000 80000000 kernel > > =A02 =A0 =A01 0xc7b4e000 538e4 =A0 =A0wlan.ko > > =A03 =A0 =A01 0xc7ba2000 70b88 =A0 =A0ath_hal.ko > > # > > > > So the wlan module is loaded, it has that symbol internally, but the li= nker > > isn't gluing them together. That (1) is a local patch of mine to figure= out > > where it's broken - here, it's broken in link_elf_obj.c:1038 . Ie, it's= the > > first loop in relocate_file(). > > > > I'm not up to date on how all this ELF and kernel module/linker magic w= orks, > > could someone please give me a hand diagnosing why this is happening? > > There was an issue we had seen in link_elf.c in another context, the valu= e we > have for linker_kernel_file->address is not correct for mips, it should b= e > actually the KERNLOADADDR in config file. > > Not really sure if your problem is related, but here is a small hack/patc= h to > try: > > diff --git a/sys/kern/link_elf.c b/sys/kern/link_elf.c > index 1e0bac1..14dfe9e 100644 > --- a/sys/kern/link_elf.c > +++ b/sys/kern/link_elf.c > @@ -323,7 +323,11 @@ link_elf_init(void* arg) > > =A0 =A0 =A0 =A0if (dp !=3D NULL) > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0parse_dynamic(ef); > +#ifdef __mips__ > + =A0 =A0 =A0 linker_kernel_file->address =3D (caddr_t) 0xffffffff8010000= 0; > +#else > =A0 =A0 =A0 =A0linker_kernel_file->address =3D (caddr_t) KERNBASE; > +#endif > =A0 =A0 =A0 =A0linker_kernel_file->size =3D -(intptr_t)linker_kernel_file= ->address; > > =A0 =A0 =A0 =A0if (modptr !=3D NULL) { > -- > > > JC. > From owner-freebsd-mips@FreeBSD.ORG Thu Mar 31 08:26:07 2011 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 9B0D8106566C for ; Thu, 31 Mar 2011 08:26:07 +0000 (UTC) (envelope-from freebsd-mips@dino.sk) Received: from loki.netlab.sk (ns3.netlab.sk [84.245.65.11]) by mx1.freebsd.org (Postfix) with ESMTP id 111A98FC08 for ; Thu, 31 Mar 2011 08:26:06 +0000 (UTC) Received: from atom.dino.sk (fw1.dino.sk [84.245.95.252]) (AUTH: LOGIN milan, TLS: TLSv1/SSLv3,128bits,AES128-SHA) by loki.netlab.sk with ESMTPSA; Thu, 31 Mar 2011 10:15:48 +0200 id 00033C05.4D943834.000163B9 Date: Thu, 31 Mar 2011 10:15:54 +0200 From: Milan Obuch To: freebsd-mips@freebsd.org Message-ID: <20110331101554.68171eed@atom.dino.sk> X-Mailer: Claws Mail 3.7.8 (GTK+ 2.22.1; amd64-portbld-freebsd8.2) Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAGFBMVEX+/v7++v6YOTrq8PCcuIX989UvOSj++v0BNCbpAAAAB3RJTUUHsQwfFzs7RBhzUQAAAhJJREFUOI1dU8GOqzAMNKIoV1bvwD1i0ysqrHplIdBrVSX7ATSbd03VVvn9tQNtQy0hjAdn7LED4AAcPtWm9RV+MPSfxhBLx9ajd6X/ngB6/mTwnRSZua7i7Ca+0ctZKo4Qmz+JY13X6I3nFZBxIYW1PbgfQ5RP8g0XlltEWGf3cV03joYpRnFbvYDKbXjZlXyyhEZA4lI+cN3NaVXE4VKjSwTExO10eTEkkJVqIAD5z0nUBQJluQDRSQjcrBiHAJxZlAH5CUMBMC7OcJ4LMQNnxhZ1HYPscMc6J4UlWRMNwzOpCcAHKSICd1EDn83abdREIbXsHkD1OinP1aCUCOEVRaa1lMcvywUWdYgk13JQUpYNKmvXQ8Kw5ML9YI5h8SakctBc7E/IYuLhYd/zZIk+1gM1vNweQBvHE0j+oYah3sMqAytQYlZk6+ANaaawJdu3OFzYGMZ3iGpa3qMlq9ZH0VZTgrCtw/ngdYkEIIpSbP1bWQAdFdX9vocBdkH2qVjVmuMu3gI5rjs814EUdrCZgWlPaxZZ3RiLFUtr+ud0PXwp2dnQSNXgePt6AZpBj6UMJ7VQkzN4utVeaSW1Dhn/kblGrKeMvNGnzwX4zuEDarYz1KdPtR60Gul0Gued+515SJXhCsl+Tx/3kY/UDvicPll9mfu50t3tvQ/thZpJYgeuwdSKNJ6tCD98MCgoxLDaPxbwqqwPWaWiAAAAAElFTkSuQmCC X-Face: ak5rwz4-aUa>hPFZlcg,bXxn.(TN}e9DGFrKU\.i_'B[&5=pAd9o"j)5VSUYW:BRQG#^42Ev$Il|; Ztn=,C X-Operating-System: FreeBSD/amd64 8.2-STABLE Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: TP link MR3220 status, boot from flash via u-boot question 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, 31 Mar 2011 08:26:07 -0000 Hi, I am working with cheap TP-link router, MR3220, current feature and status summary is UART (console) works. GPIO works. USB works. Ethernet works, both interfaces. Switch connected to the second ethernet interface is not yet tested. SPI flash works. PCI seems to be working too. Wifi needs some attachment code patch. I am going to prepare summary of patches against -current necessary to make this work somewhere, if anybody is interested meanwhile, just ask me. I am able to build kernel with root fs mounted via NFS, put on USB flash or md image embedded into kernel, but still need to download it into device via TFTP. MR3220 has u-boot, I found in OpenWRT repository utilities page at https://dev.openwrt.org/browser/trunk/tools/firmware-utils/src and there mktplinkfw.c source, which builds and creates images, but it does not work for me yet. Actually, for building images mips on i386 I replaced some byteswap macro with ntohl call as a quick hack, which seems to produce correct results, at least I can inspect images from TP-link (original firmware) and OpenWRT (replacement), both showing correct (reasonable, at least) entries for load address etc, but my image does not start correctly... Has anybody any experience with firmware images for TP-link's devices or any idea how could this be debugged? All I got is just a message telling 'Starting...' or some such, which tells me nothing :( Regards, Milan From owner-freebsd-mips@FreeBSD.ORG Thu Mar 31 08:37:13 2011 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 1D45F106564A for ; Thu, 31 Mar 2011 08:37:13 +0000 (UTC) (envelope-from stas@FreeBSD.org) Received: from mx0.deglitch.com (cl-414.sto-01.se.sixxs.net [IPv6:2001:16d8:ff00:19d::2]) by mx1.freebsd.org (Postfix) with ESMTP id C39D28FC0C for ; Thu, 31 Mar 2011 08:37:12 +0000 (UTC) Received: from orion.SpringDaemons.com (c-71-198-23-89.hsd1.ca.comcast.net [71.198.23.89]) by mx0.deglitch.com (Postfix) with ESMTPA id 424838FC2D; Thu, 31 Mar 2011 12:37:09 +0400 (MSD) Received: from orion (localhost [127.0.0.1]) by orion.SpringDaemons.com (Postfix) with SMTP id 6D9B939D4E; Thu, 31 Mar 2011 01:39:14 -0700 (PDT) Date: Thu, 31 Mar 2011 01:39:07 -0700 From: Stanislav Sedov To: Milan Obuch Message-Id: <20110331013907.6fcd1a6e.stas@FreeBSD.org> In-Reply-To: <20110331101554.68171eed@atom.dino.sk> References: <20110331101554.68171eed@atom.dino.sk> Organization: The FreeBSD Project X-Mailer: carrier-pigeon Mime-Version: 1.0 Content-Type: multipart/signed; protocol="application/pgp-signature"; micalg="PGP-SHA1"; boundary="Signature=_Thu__31_Mar_2011_01_39_07_-0700_EsS2ENv3R=oGw/A8" Cc: freebsd-mips@freebsd.org Subject: Re: TP link MR3220 status, boot from flash via u-boot question 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, 31 Mar 2011 08:37:13 -0000 --Signature=_Thu__31_Mar_2011_01_39_07_-0700_EsS2ENv3R=oGw/A8 Content-Type: text/plain; charset=US-ASCII Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, 31 Mar 2011 10:15:54 +0200 Milan Obuch mentioned: > Has anybody any experience with firmware images for TP-link's devices > or any idea how could this be debugged? All I got is just a message > telling 'Starting...' or some such, which tells me nothing :( >=20 Hi, Milan! Seems like a great progress! Thanks! I don't have any experience with TP-link routers, but in such cases JTAG comes really handy. Does this device have any JTAG attachment you can possibly use? --=20 Stanislav Sedov ST4096-RIPE () ascii ribbon campaign - against html e-mail=20 /\ www.asciiribbon.org - against proprietary attachments --Signature=_Thu__31_Mar_2011_01_39_07_-0700_EsS2ENv3R=oGw/A8 Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- iQIcBAEBAgAGBQJNlD2xAAoJEL8lojEJL9nwHpEP+wbb4xJATrJfZFvOD73AWJpE OY53JiLEBi+KPjC/xmWSmtxjDgG310OI5TSpzuhLuMW8MsgazE9JFrGbIewY+feC 1WXRgaoJ1jexHHK6RepRFfoVwTUN1Sqv68pW8bFEMQ0570/41jnzoV/Z8JqVtEny oT8+OuNNe+64LId1/WEh3/SkievjmEyJJb+jOW5Rktxj3wnUqktAlI5Eqn4LlAhL yxgFnAP5iJ9eTlOdyaWNt/JZXGrnYWhH9El3LVAy2Xz7+qGok0qwNMMQlp2dLaDz mB1EDqLeFe+5jEdbu0myyW9Bxnqu3pVAYPY0ZUNoR7p3LinuTcG4MGvy73xy0PwQ a1fhfcqiXeNOijM5qfli3crJRmhDLdWfGxI0vNsviWaoXCfsL2eFYl2/xO6pCB18 I3sZp2w72p4uIqIxkti3nfA4BVJTPngEFvvGsHsLynzj+N2QqanulusuA5e+sFER HM2+/CTFIKDBeQavvBovfF8DOhhy7DkmthIeVrXWDrpYxJeD/AIu5swjqEdz22Lj ziVERmlqt4gWmZj/zDY2AWQ5PQ3bnt2aI5o9XvNdrTDu0YdLpS73jtuoin6QfekX KUEkn/qr1r+SOBFJntbYmk1jKH6G/7mRJzSVUy8zp4aNHWqt7vo/G59kfUX7kALp Fs+P6TExmyLTikpKhoZ2 =zRSK -----END PGP SIGNATURE----- --Signature=_Thu__31_Mar_2011_01_39_07_-0700_EsS2ENv3R=oGw/A8-- From owner-freebsd-mips@FreeBSD.ORG Thu Mar 31 09:15:31 2011 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 AA634106566B; Thu, 31 Mar 2011 09:15:31 +0000 (UTC) (envelope-from freebsd-mips@dino.sk) Received: from loki.netlab.sk (ns3.netlab.sk [84.245.65.11]) by mx1.freebsd.org (Postfix) with ESMTP id 438338FC0C; Thu, 31 Mar 2011 09:15:31 +0000 (UTC) Received: from atom.dino.sk (fw1.dino.sk [84.245.95.252]) (AUTH: LOGIN milan, TLS: TLSv1/SSLv3,128bits,AES128-SHA) by loki.netlab.sk with ESMTPSA; Thu, 31 Mar 2011 11:15:16 +0200 id 00033C21.4D944624.00016713 Date: Thu, 31 Mar 2011 11:15:22 +0200 From: Milan Obuch To: Stanislav Sedov Message-ID: <20110331111522.25b1ce6b@atom.dino.sk> In-Reply-To: <20110331013907.6fcd1a6e.stas@FreeBSD.org> References: <20110331101554.68171eed@atom.dino.sk> <20110331013907.6fcd1a6e.stas@FreeBSD.org> X-Mailer: Claws Mail 3.7.8 (GTK+ 2.22.1; amd64-portbld-freebsd8.2) Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAGFBMVEX+/v7++v6YOTrq8PCcuIX989UvOSj++v0BNCbpAAAAB3RJTUUHsQwfFzs7RBhzUQAAAhJJREFUOI1dU8GOqzAMNKIoV1bvwD1i0ysqrHplIdBrVSX7ATSbd03VVvn9tQNtQy0hjAdn7LED4AAcPtWm9RV+MPSfxhBLx9ajd6X/ngB6/mTwnRSZua7i7Ca+0ctZKo4Qmz+JY13X6I3nFZBxIYW1PbgfQ5RP8g0XlltEWGf3cV03joYpRnFbvYDKbXjZlXyyhEZA4lI+cN3NaVXE4VKjSwTExO10eTEkkJVqIAD5z0nUBQJluQDRSQjcrBiHAJxZlAH5CUMBMC7OcJ4LMQNnxhZ1HYPscMc6J4UlWRMNwzOpCcAHKSICd1EDn83abdREIbXsHkD1OinP1aCUCOEVRaa1lMcvywUWdYgk13JQUpYNKmvXQ8Kw5ML9YI5h8SakctBc7E/IYuLhYd/zZIk+1gM1vNweQBvHE0j+oYah3sMqAytQYlZk6+ANaaawJdu3OFzYGMZ3iGpa3qMlq9ZH0VZTgrCtw/ngdYkEIIpSbP1bWQAdFdX9vocBdkH2qVjVmuMu3gI5rjs814EUdrCZgWlPaxZZ3RiLFUtr+ud0PXwp2dnQSNXgePt6AZpBj6UMJ7VQkzN4utVeaSW1Dhn/kblGrKeMvNGnzwX4zuEDarYz1KdPtR60Gul0Gued+515SJXhCsl+Tx/3kY/UDvicPll9mfu50t3tvQ/thZpJYgeuwdSKNJ6tCD98MCgoxLDaPxbwqqwPWaWiAAAAAElFTkSuQmCC X-Face: ak5rwz4-aUa>hPFZlcg,bXxn.(TN}e9DGFrKU\.i_'B[&5=pAd9o"j)5VSUYW:BRQG#^42Ev$Il|; Ztn=,C X-Operating-System: FreeBSD/amd64 8.2-STABLE Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: freebsd-mips@freebsd.org Subject: Re: TP link MR3220 status, boot from flash via u-boot question 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, 31 Mar 2011 09:15:31 -0000 On Thu, 31 Mar 2011 01:39:07 -0700, Stanislav Sedov wrote: > On Thu, 31 Mar 2011 10:15:54 +0200 > Milan Obuch mentioned: > > > Has anybody any experience with firmware images for TP-link's > > devices or any idea how could this be debugged? All I got is just a > > message telling 'Starting...' or some such, which tells me > > nothing :( > > > > Hi, Milan! > > Seems like a great progress! Thanks! > I don't have any experience with TP-link routers, but in such > cases JTAG comes really handy. Does this device have any JTAG > attachment you can possibly use? > No, there is no JTAG. There is even no serial console when purchased, you need to open the device and solder four-pin header or cable directly to board to get it... See http://eko.one.pl/?p=openwrt-mr3420 (in Polish, last paragraph on page), or near the end of page at http://wiki.openwrt.org/toh/tp-link/tl-mr3420 for some hint. Regards, Milan From owner-freebsd-mips@FreeBSD.ORG Thu Mar 31 10:39:38 2011 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 BDA39106564A for ; Thu, 31 Mar 2011 10:39:38 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-ww0-f50.google.com (mail-ww0-f50.google.com [74.125.82.50]) by mx1.freebsd.org (Postfix) with ESMTP id 519E78FC12 for ; Thu, 31 Mar 2011 10:39:37 +0000 (UTC) Received: by wwc33 with SMTP id 33so2518851wwc.31 for ; Thu, 31 Mar 2011 03:39:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=r3KUaEkpuYxrJqnUGPng2UfTXfwK/mIRvXw4LqxshMY=; b=VD5UGzv2oNJnjg6VYweiGwOqyovHYAYodnyPLK8rrCRX/XUiKR1Dp+9JJA32T0tIfs kgfE0kRhq1JOK5Wx9PjawzmVHxXWvb75Wkx3YzWiNOhbXeIJ1VUtznazm+Noz7qpSrrB xOzHgrAlMmh022RHIxQqbb/hufvuDnsmj95w8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; b=xCJbEVKz8VogeEllDkPYiAUyEyNArYjsJ1N5cbOYKGQhBxgFsPT4mPVvOiE/Jcft1J h+bKTlUZkQxvE/mMqXEjnZCgkwKIKugFOGt3ZIapivPPDOsxRh7NJVyHiA3z7TS/U9fS ClcL9w/hTP/Ti2ydIINob+lf6SqAa0U2rniuo= MIME-Version: 1.0 Received: by 10.227.196.10 with SMTP id ee10mr2559733wbb.209.1301567976214; Thu, 31 Mar 2011 03:39:36 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.227.135.137 with HTTP; Thu, 31 Mar 2011 03:39:36 -0700 (PDT) In-Reply-To: <20110331101554.68171eed@atom.dino.sk> References: <20110331101554.68171eed@atom.dino.sk> Date: Thu, 31 Mar 2011 18:39:36 +0800 X-Google-Sender-Auth: Q53TKfwPMRL5yBlao1e0rhExluQ Message-ID: From: Adrian Chadd To: Milan Obuch Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: freebsd-mips@freebsd.org Subject: Re: TP link MR3220 status, boot from flash via u-boot question 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, 31 Mar 2011 10:39:38 -0000 Hi, I've got freebsd working on the WR-1043ND which is a tplink 11n router w/ uboot. I'll go find my notes and put them online, along with a config file and whatever else is needed. I'll have to commit a dirty hack to the kernel config to let users set the flash address to yank the ethernet MAC address from. Ew. Adrian From owner-freebsd-mips@FreeBSD.ORG Thu Mar 31 12:26:51 2011 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 59248106564A; Thu, 31 Mar 2011 12:26:51 +0000 (UTC) (envelope-from freebsd-mips@dino.sk) Received: from loki.netlab.sk (ns3.netlab.sk [84.245.65.11]) by mx1.freebsd.org (Postfix) with ESMTP id A5BF98FC16; Thu, 31 Mar 2011 12:26:50 +0000 (UTC) Received: from atom.dino.sk (fw1.dino.sk [84.245.95.252]) (AUTH: LOGIN milan, TLS: TLSv1/SSLv3,128bits,AES128-SHA) by loki.netlab.sk with ESMTPSA; Thu, 31 Mar 2011 14:26:34 +0200 id 00033C14.4D9472FA.00017298 Date: Thu, 31 Mar 2011 14:26:40 +0200 From: Milan Obuch To: Adrian Chadd Message-ID: <20110331142640.07f2101b@atom.dino.sk> In-Reply-To: References: <20110331101554.68171eed@atom.dino.sk> X-Mailer: Claws Mail 3.7.8 (GTK+ 2.22.1; amd64-portbld-freebsd8.2) Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAGFBMVEX+/v7++v6YOTrq8PCcuIX989UvOSj++v0BNCbpAAAAB3RJTUUHsQwfFzs7RBhzUQAAAhJJREFUOI1dU8GOqzAMNKIoV1bvwD1i0ysqrHplIdBrVSX7ATSbd03VVvn9tQNtQy0hjAdn7LED4AAcPtWm9RV+MPSfxhBLx9ajd6X/ngB6/mTwnRSZua7i7Ca+0ctZKo4Qmz+JY13X6I3nFZBxIYW1PbgfQ5RP8g0XlltEWGf3cV03joYpRnFbvYDKbXjZlXyyhEZA4lI+cN3NaVXE4VKjSwTExO10eTEkkJVqIAD5z0nUBQJluQDRSQjcrBiHAJxZlAH5CUMBMC7OcJ4LMQNnxhZ1HYPscMc6J4UlWRMNwzOpCcAHKSICd1EDn83abdREIbXsHkD1OinP1aCUCOEVRaa1lMcvywUWdYgk13JQUpYNKmvXQ8Kw5ML9YI5h8SakctBc7E/IYuLhYd/zZIk+1gM1vNweQBvHE0j+oYah3sMqAytQYlZk6+ANaaawJdu3OFzYGMZ3iGpa3qMlq9ZH0VZTgrCtw/ngdYkEIIpSbP1bWQAdFdX9vocBdkH2qVjVmuMu3gI5rjs814EUdrCZgWlPaxZZ3RiLFUtr+ud0PXwp2dnQSNXgePt6AZpBj6UMJ7VQkzN4utVeaSW1Dhn/kblGrKeMvNGnzwX4zuEDarYz1KdPtR60Gul0Gued+515SJXhCsl+Tx/3kY/UDvicPll9mfu50t3tvQ/thZpJYgeuwdSKNJ6tCD98MCgoxLDaPxbwqqwPWaWiAAAAAElFTkSuQmCC X-Face: ak5rwz4-aUa>hPFZlcg,bXxn.(TN}e9DGFrKU\.i_'B[&5=pAd9o"j)5VSUYW:BRQG#^42Ev$Il|; Ztn=,C X-Operating-System: FreeBSD/amd64 8.2-STABLE Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: freebsd-mips@freebsd.org Subject: Re: TP link MR3220 status, boot from flash via u-boot question 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, 31 Mar 2011 12:26:51 -0000 On Thu, 31 Mar 2011 18:39:36 +0800, Adrian Chadd wrote: > Hi, > > I've got freebsd working on the WR-1043ND which is a tplink 11n > router w/ uboot. I'll go find my notes and put them online, along > with a config file and whatever else is needed. > Hi, I am watching freebsd-wifi-build on googlecode and just noticed new config there... Is your 11n wifi already working too? I would be glad to compare your results with mine, so we could unify our efforts. Right now, kernel load from flash in u-boot is a show stopper for me, so if you could address this one first, it would help me really much. > I'll have to commit a dirty hack to the kernel config to let users > set the flash address to yank the ethernet MAC address from. Ew. > I've got most of my patches from Luiz (loos), maybe you are in contact already... I use already the same MAC as other firmwares do. Regards, Milan From owner-freebsd-mips@FreeBSD.ORG Thu Mar 31 21:18:02 2011 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 DB8BE10656D3 for ; Thu, 31 Mar 2011 21:18:02 +0000 (UTC) (envelope-from c.jayachandran@gmail.com) Received: from mail-wy0-f182.google.com (mail-wy0-f182.google.com [74.125.82.182]) by mx1.freebsd.org (Postfix) with ESMTP id 6B3DC8FC2C for ; Thu, 31 Mar 2011 21:18:02 +0000 (UTC) Received: by wyf23 with SMTP id 23so2894572wyf.13 for ; Thu, 31 Mar 2011 14:18:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=UOq/a0vRwN4DRC9dLWJ5IRh5YjazRR66EfSlxgiVSlM=; b=P7Jh3QTHVcaB0U1ZvbwGnT1geJ5uw/k4luNsKoEsRpXKyjY6wYvUK/oqSQZOnG/4Pw vORlB8VcVyozGW2WedelujDrQeSS/kca1TravOcnNGkIcl3V7m/yeqAwPA9WJupaEpm8 hn7yI9JstZ5ZJ3mwm9bZj+UjkooKQ6ipnlmIk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=vkrO6iTrF1Bnji6ihwvoXZtF5UkmZITyofrisuTZB2a/ROGFp7RUQMyssn3GICj4YJ VvldKWW2U9kKLKwKXhTpu+1her8FzokGMEuZ0MucjbpvXKdyYlxa0FMtPXLokwqZcj3U Mx39I/7tZOmyF5fV/iXGHZHR39K1oTHL60Brg= MIME-Version: 1.0 Received: by 10.227.140.11 with SMTP id g11mr3224863wbu.57.1301606281384; Thu, 31 Mar 2011 14:18:01 -0700 (PDT) Received: by 10.227.155.141 with HTTP; Thu, 31 Mar 2011 14:18:01 -0700 (PDT) In-Reply-To: References: Date: Thu, 31 Mar 2011 14:18:01 -0700 Message-ID: From: "Jayachandran C." To: Radha Mohan Content-Type: text/plain; charset=ISO-8859-1 Cc: Adrian Chadd , freebsd-mips@freebsd.org Subject: Re: linker weirdness for MIPS kernel? 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, 31 Mar 2011 21:18:02 -0000 On Tue, Mar 29, 2011 at 10:31 PM, Radha Mohan wrote: > Hi JC, > > Incidentally I am also trying to load modules under FreeBSD on my MIPS platform, > but I am getting following error. > > # /sbin/kldload -v ext2fs > linker_load_file: Unsupported file type > kldload:can't load ext2fs: Exec format error > > For me all the modules give me this error. > > From what I understood going through the module loading code is the > linker_load_file() > function is trying for all the registered classes (elf64_obj and elf64 > in my case). But the > relocatable header type is handled in the link_elf_obj.c only and not > link_elf.c . > > There is still some support lacking for the mips64 relocation in terms > of getting "mapbase" > (currently its taking only amd64 architecture into consideration)and > handling addend (ELF_RELOC_RELA), > R_MIPS_64, R_MIPS_HIGHER and R_MIPS_HIGHEST. Is this on the 64bit kernel or on the 32bit version? I don't use kernel modules in our XLR setup. I am a bit overloaded now with other stuff, but if you have any patches to fix this, I can help test and merge them... JC. From owner-freebsd-mips@FreeBSD.ORG Thu Mar 31 21:57:49 2011 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 E8FCB106564A; Thu, 31 Mar 2011 21:57:48 +0000 (UTC) (envelope-from ray@ddteam.net) Received: from mail-fx0-f54.google.com (mail-fx0-f54.google.com [209.85.161.54]) by mx1.freebsd.org (Postfix) with ESMTP id 225288FC08; Thu, 31 Mar 2011 21:57:47 +0000 (UTC) Received: by fxm11 with SMTP id 11so2865507fxm.13 for ; Thu, 31 Mar 2011 14:57:47 -0700 (PDT) Received: by 10.223.85.195 with SMTP id p3mr395366fal.0.1301608666939; Thu, 31 Mar 2011 14:57:46 -0700 (PDT) Received: from rnote.ddteam.net (159-87-133-95.pool.ukrtel.net [95.133.87.159]) by mx.google.com with ESMTPS id j12sm573244fax.33.2011.03.31.14.57.44 (version=SSLv3 cipher=OTHER); Thu, 31 Mar 2011 14:57:45 -0700 (PDT) Date: Fri, 1 Apr 2011 00:57:33 +0300 From: Aleksandr Rybalko To: Milan Obuch Message-Id: <20110401005733.3598e82c.ray@ddteam.net> In-Reply-To: <20110331142640.07f2101b@atom.dino.sk> References: <20110331101554.68171eed@atom.dino.sk> <20110331142640.07f2101b@atom.dino.sk> X-Mailer: Sylpheed 3.1.0 (GTK+ 2.22.1; amd64-portbld-freebsd9.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: freebsd-mips@freebsd.org Subject: [RFC] Re: TP link MR3220 status, boot from flash via u-boot question 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, 31 Mar 2011 21:57:49 -0000 On Thu, 31 Mar 2011 14:26:40 +0200 Milan Obuch wrote: > On Thu, 31 Mar 2011 18:39:36 +0800, Adrian Chadd > wrote: > > > Hi, > > > > I've got freebsd working on the WR-1043ND which is a tplink 11n > > router w/ uboot. I'll go find my notes and put them online, along > > with a config file and whatever else is needed. > > > > Hi, > I am watching freebsd-wifi-build on googlecode and just noticed new > config there... Is your 11n wifi already working too? I would be glad > to compare your results with mine, so we could unify our efforts. > Right now, kernel load from flash in u-boot is a show stopper for me, > so if you could address this one first, it would help me really much. Draft for wiki page 'Run from NOR flash with U-Boot' Keywords: U-Boot, embedded 1. Ask U-Boot: "what do you support to boot?" Normally, U-Boot use special image for kernel/ramfs packing. But we need to know which compression support U-Boot that fleshed to our target board. First way: use mkimage utility (/usr/ports/devel/u-boot) and make test images for all supported by mkimage compression types. mkimage -A ${TARGET} -O linux -T kernel \ -C ${COMPRESSION_TYPE} \ -a ${RAM_START_ADDRESS} \ -e ${RAM_START_ADDRESS} \ -n 'FreeBSD Kernel Image' \ -d SOME_SMALL_FILE_NAME \ test.uboot Then for each file, do transfer to board and run from image with `bootm' command. And check what U-Boot answer you, if answer like "Unimplemented compression type ?", then you know :). Second way: >From running Linux or U-Boot get first 64k block from kernel partition in flash. Break your mkimage utility: avoid exit when we do "show info" (key -i) CRC failed. And check compression type of 64k file we get from device. Or just delete U-Boot image header from file dd if=64k.file of=just_kern bs=64 skip=1 and check with file(1) utility 2. Create image 2.1. More canonical way, we have mkimage, gzip or bz2 and compiled kernel, maybe kernel.bin also. gzip --best --force vmlinux.bin for ELF kernel: mkimage -A mips -O linux -T kernel \ -C gzip \ -a ${LOAD_ADDRESS} \ -e ${START_ADDRESS} \ -n 'FreeBSD Kernel Image' \ -d kernel \ kernel.uboot LOAD_ADDRESS - in most cases this is RAM base address START_ADDRESS = LOAD_ADDRESS + ELF_HEADER_SIZE (0x1000 for ELF image) for kernel.bin: LOAD_ADDRESS = RAM_BASE_ADDRESS + 0x1000 START_ADDRESS = RAM_BASE_ADDRESS + 0x1000 Don't forget to check/change KERNLOADADDR of kernel config file. KERNLOADADDR must be equal to START_ADDRESS. 2.2. Longest way, but have smallest footprint, used only if U-Boot support LZMA. Problem 1: Current version of mkimage from ports, don't support LZMA. So we need new: http://my.ddteam.net/files/u-boot.new.tar.gz Problem 2: Devices I know support only old LZMA. I use LZMA 4.17. Then mkimage, like in 2.2., but -C lzma. 3. Now we have kernel U-Boot image, so transfer it to device and try with `bootm' command. 4. If all fine, write image to flash kernel partition. Hope this help :) > > > I'll have to commit a dirty hack to the kernel config to let users > > set the flash address to yank the ethernet MAC address from. Ew. > > > > I've got most of my patches from Luiz (loos), maybe you are in contact > already... I use already the same MAC as other firmwares do. > > Regards, > Milan > _______________________________________________ > freebsd-mips@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-mips > To unsubscribe, send any mail to > "freebsd-mips-unsubscribe@freebsd.org" Wait for comments! WBW -- Aleksandr Rybalko From owner-freebsd-mips@FreeBSD.ORG Fri Apr 1 01:38:39 2011 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 86869106564A for ; Fri, 1 Apr 2011 01:38:39 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-wy0-f182.google.com (mail-wy0-f182.google.com [74.125.82.182]) by mx1.freebsd.org (Postfix) with ESMTP id 19AF98FC13 for ; Fri, 1 Apr 2011 01:38:38 +0000 (UTC) Received: by wyf23 with SMTP id 23so3052995wyf.13 for ; Thu, 31 Mar 2011 18:38:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=gSIuQrktfVbVxTijjn3rHxS3wmNadarIk7iA1PmlIMA=; b=nQUwqHrza4WC9U0zVJGKpdMPulCGlKkUlP6fxgnJal/YC/z/W7K+2rHmMKFWBUGWAS Ornprr/84hhLe8c5XXLgtF7Jz+23OQUW67lN7eDGvVdJPS/5l87A6+79kOMYbvGLt037 Vk8nzoQONkErEKZ94T0gHP5QzN7i6noFyeLC0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; b=Fswp5tynmPiGhpM+KPu9cVPG9MD0rhgUMs/wmVmVUjbwHBdRWwdJtDSAbwlsywuUGv DCn//21YuZist1Q31clP43PHbXQCFz/PkHOxVrrupVUDr+iotzKX5qrux9Mzvugdn/Yb Gx64rw7mRZAJg0jedoIOx7FNN5xSwFMrknWmA= MIME-Version: 1.0 Received: by 10.227.173.141 with SMTP id p13mr3463693wbz.64.1301621917922; Thu, 31 Mar 2011 18:38:37 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.227.135.137 with HTTP; Thu, 31 Mar 2011 18:38:37 -0700 (PDT) In-Reply-To: <20110331142640.07f2101b@atom.dino.sk> References: <20110331101554.68171eed@atom.dino.sk> <20110331142640.07f2101b@atom.dino.sk> Date: Fri, 1 Apr 2011 09:38:37 +0800 X-Google-Sender-Auth: N54ykHHPydOFchKerCtUrjnnrl8 Message-ID: From: Adrian Chadd To: Milan Obuch Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: freebsd-mips@freebsd.org Subject: Re: TP link MR3220 status, boot from flash via u-boot question 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: Fri, 01 Apr 2011 01:38:39 -0000 I've not tested that config (yet) on -HEAD, I've just committed what I had from my GIT tree in preparation for testing out the AR913x. Yes, I have 11n working, but not on the WN-1043nd. I need to port over the HAL changes from my GIT tree for the AR9130 WMAC. Adrian On 31 March 2011 20:26, Milan Obuch wrote: > On Thu, 31 Mar 2011 18:39:36 +0800, Adrian Chadd > wrote: > > > Hi, > > > > I've got freebsd working on the WR-1043ND which is a tplink 11n > > router w/ uboot. I'll go find my notes and put them online, along > > with a config file and whatever else is needed. > > > > Hi, > I am watching freebsd-wifi-build on googlecode and just noticed new > config there... Is your 11n wifi already working too? I would be glad > to compare your results with mine, so we could unify our efforts. Right > now, kernel load from flash in u-boot is a show stopper for me, so if > you could address this one first, it would help me really much. > > > I'll have to commit a dirty hack to the kernel config to let users > > set the flash address to yank the ethernet MAC address from. Ew. > > > > I've got most of my patches from Luiz (loos), maybe you are in contact > already... I use already the same MAC as other firmwares do. > > Regards, > Milan > From owner-freebsd-mips@FreeBSD.ORG Fri Apr 1 18:09:36 2011 Return-Path: Delivered-To: mips@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DEA2C1065670 for ; Fri, 1 Apr 2011 18:09:36 +0000 (UTC) (envelope-from aduane@juniper.net) Received: from exprod7og113.obsmtp.com (exprod7og113.obsmtp.com [64.18.2.179]) by mx1.freebsd.org (Postfix) with ESMTP id 53E7E8FC08 for ; Fri, 1 Apr 2011 18:09:36 +0000 (UTC) Received: from source ([66.129.224.36]) (using TLSv1) by exprod7ob113.postini.com ([64.18.6.12]) with SMTP ID DSNKTZYU315SK54TpkD0aKgBvSLrORfQwc6s@postini.com; Fri, 01 Apr 2011 11:09:36 PDT Received: from p-emfe02-wf.jnpr.net (172.28.145.25) by P-EMHUB03-HQ.jnpr.net (172.24.192.37) with Microsoft SMTP Server (TLS) id 8.2.254.0; Fri, 1 Apr 2011 11:07:19 -0700 Received: from EMBX01-WF.jnpr.net ([fe80::1914:3299:33d9:e43b]) by p-emfe02-wf.jnpr.net ([fe80::c126:c633:d2dc:8090%11]) with mapi; Fri, 1 Apr 2011 14:08:54 -0400 From: Andrew Duane To: "mips@freebsd.org" Date: Fri, 1 Apr 2011 14:08:07 -0400 Thread-Topic: Blatant simple bug in Cavium SDK USB code? Thread-Index: AQHL8JY4dh+1a5sMXUirJ/xJKmTjLJRJTlXE Message-ID: References: In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Cc: Subject: Blatant simple bug in Cavium SDK USB code? 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: Fri, 01 Apr 2011 18:09:36 -0000 In the routine cvmx_usb_initialize in sys/contrib/octeon-sdk/cvmx-usb.c, I'= m pretty sure there's a silly little bug that really BADLY breaks the USB d= river for some of us. Near the top, after it finds board type and sets the clock type, as part of= the structure initialization, there is: memset(usb, 0, sizeof(usb)); Tell me that is not supposed to be: memset(usb, 0, sizeof(*usb)); The existing code only zeros 4/8 bytes, instead of the 23KB of the structur= e. -- Andrew Duane Juniper Networks 978-589-0551 10 Technology Park Dr aduane@juniper.net Westford, MA 01886-3418 From owner-freebsd-mips@FreeBSD.ORG Fri Apr 1 18:46:02 2011 Return-Path: Delivered-To: mips@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2800A1065674 for ; Fri, 1 Apr 2011 18:46:02 +0000 (UTC) (envelope-from juli@clockworksquid.com) Received: from mail-yx0-f182.google.com (mail-yx0-f182.google.com [209.85.213.182]) by mx1.freebsd.org (Postfix) with ESMTP id DFA658FC25 for ; Fri, 1 Apr 2011 18:46:01 +0000 (UTC) Received: by yxl31 with SMTP id 31so1775394yxl.13 for ; Fri, 01 Apr 2011 11:46:01 -0700 (PDT) Received: by 10.150.63.19 with SMTP id l19mr4765941yba.71.1301683561128; Fri, 01 Apr 2011 11:46:01 -0700 (PDT) MIME-Version: 1.0 Sender: juli@clockworksquid.com Received: by 10.151.13.12 with HTTP; Fri, 1 Apr 2011 11:45:41 -0700 (PDT) In-Reply-To: References: From: Juli Mallett Date: Fri, 1 Apr 2011 11:45:41 -0700 X-Google-Sender-Auth: iONzqFjxGxnWXpZ4N0LvE2wRdws Message-ID: To: Andrew Duane Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: "mips@freebsd.org" Subject: Re: Blatant simple bug in Cavium SDK USB code? 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: Fri, 01 Apr 2011 18:46:02 -0000 Hey Andrew, On Fri, Apr 1, 2011 at 11:08, Andrew Duane wrote: > > In the routine cvmx_usb_initialize in sys/contrib/octeon-sdk/cvmx-usb.c, = I'm pretty sure there's a silly little bug that really BADLY breaks the USB= driver for some of us. > > Near the top, after it finds board type and sets the clock type, as part = of the structure initialization, there is: > > =A0 =A0memset(usb, 0, sizeof(usb)); > > Tell me that is not supposed to be: > > =A0 =A0memset(usb, 0, sizeof(*usb)); > > The existing code only zeros 4/8 bytes, instead of the 23KB of the struct= ure. Ouch, nice catch. Is that the only thing keeping the USB driver from working for you? I thought it had rotted some behind other controller changes and also had some problems with stalls, but perhaps the culprit was initialization all along. I'll check in that fix soon, but would like to hear from you as to whether you have any additional fixes for USB (or even bugs to report.) I've BCC'd some Cavium people who will no doubt appreciate the bug report! Thanks, Juli. From owner-freebsd-mips@FreeBSD.ORG Fri Apr 1 18:57:04 2011 Return-Path: Delivered-To: mips@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5F39C1065675; Fri, 1 Apr 2011 18:57:04 +0000 (UTC) (envelope-from bhanuprakashbodireddy@gmail.com) Received: from mail-pz0-f54.google.com (mail-pz0-f54.google.com [209.85.210.54]) by mx1.freebsd.org (Postfix) with ESMTP id E83518FC22; Fri, 1 Apr 2011 18:57:03 +0000 (UTC) Received: by pzk27 with SMTP id 27so910984pzk.13 for ; Fri, 01 Apr 2011 11:57:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=YbMZhVwMz4KsFi1fpEBUVS71V9hu/zr0W54vWcXpEic=; b=IvcNHyFzZXChbc8gX5GCbX4A6Lxv1mJwaBeU03lCjkb4Dp3uRQYQOGL/HBu10QqrbZ 53aPr7OPm7GtMmgXFMlDjbx0fj3uwW1/I5jkrfYW1rzfQkXHyracgS5JRp8JAA3bEUve qczBlCIjEge5wOBI4jAV5jISm6DOnlagKJkEY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=kNJ4lRFzzGjrM6aVflUqKj9MZu2yqskEOqAoVGB/Kx42mG75xRPWyc2IxgorwO1e0d VnbmiRRluN2/+/U9SsK7AH3gf5xU5Cdox5KTjUA75u7+AY7xeFqIqeti9qWwgamoySrs QkahynR9xEGEtsgws/iuMB9QBBozIWbqAPDlQ= MIME-Version: 1.0 Received: by 10.142.142.4 with SMTP id p4mr3572397wfd.43.1301684223601; Fri, 01 Apr 2011 11:57:03 -0700 (PDT) Received: by 10.142.222.3 with HTTP; Fri, 1 Apr 2011 11:57:03 -0700 (PDT) In-Reply-To: References: Date: Fri, 1 Apr 2011 11:57:03 -0700 Message-ID: From: bhanuprakash bodireddy To: Andrew Duane Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: "mips@freebsd.org" Subject: Re: Blatant simple bug in Cavium SDK USB code? 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: Fri, 01 Apr 2011 18:57:04 -0000 Hi Andrew, That was definitely a good catch. Thanks for pointing that, Also if you have any other issues with USB code in contrib/octeon-sdk/*, please do let us know. Thanks, Bhanu Prakash. On Fri, Apr 1, 2011 at 11:45 AM, Juli Mallett wrote: > Hey Andrew, > > On Fri, Apr 1, 2011 at 11:08, Andrew Duane wrote: > > > > In the routine cvmx_usb_initialize in sys/contrib/octeon-sdk/cvmx-usb.c, > I'm pretty sure there's a silly little bug that really BADLY breaks the USB > driver for some of us. > > > > Near the top, after it finds board type and sets the clock type, as part > of the structure initialization, there is: > > > > memset(usb, 0, sizeof(usb)); > > > > Tell me that is not supposed to be: > > > > memset(usb, 0, sizeof(*usb)); > > > > The existing code only zeros 4/8 bytes, instead of the 23KB of the > structure. > > Ouch, nice catch. Is that the only thing keeping the USB driver from > working for you? I thought it had rotted some behind other controller > changes and also had some problems with stalls, but perhaps the > culprit was initialization all along. I'll check in that fix soon, > but would like to hear from you as to whether you have any additional > fixes for USB (or even bugs to report.) > > I've BCC'd some Cavium people who will no doubt appreciate the bug report! > > Thanks, > Juli. > From owner-freebsd-mips@FreeBSD.ORG Fri Apr 1 18:59:10 2011 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 906CF106564A for ; Fri, 1 Apr 2011 18:59:10 +0000 (UTC) (envelope-from mahan@mahan.org) Received: from ns.mahan.org (ns.mahan.org [67.116.10.138]) by mx1.freebsd.org (Postfix) with ESMTP id 68D548FC12 for ; Fri, 1 Apr 2011 18:59:10 +0000 (UTC) Received: from Patrick-Mahans-MacBook-Pro.local (crowTrobot [67.116.10.140]) by ns.mahan.org (8.13.6/8.13.6) with ESMTP id p31IiuWD041374 for ; Fri, 1 Apr 2011 11:44:56 -0700 (PDT) (envelope-from mahan@mahan.org) Message-ID: <4D961CB0.6080802@mahan.org> Date: Fri, 01 Apr 2011 11:42:56 -0700 From: Patrick Mahan User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.2.15) Gecko/20110303 Thunderbird/3.1.9 MIME-Version: 1.0 To: freebsd-mips@freebsd.org References: In-Reply-To: X-Enigmail-Version: 1.1.1 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Subject: Re: Blatant simple bug in Cavium SDK USB code? 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: Fri, 01 Apr 2011 18:59:10 -0000 On 4/1/11 11:08 AM, Andrew Duane wrote: > > In the routine cvmx_usb_initialize in sys/contrib/octeon-sdk/cvmx-usb.c, I'm pretty sure there's a silly little bug that really BADLY breaks the USB driver for some of us. > > Near the top, after it finds board type and sets the clock type, as part of the structure initialization, there is: > > memset(usb, 0, sizeof(usb)); > > Tell me that is not supposed to be: > > memset(usb, 0, sizeof(*usb)); > > The existing code only zeros 4/8 bytes, instead of the 23KB of the structure. > Ugh... Looks like this is an original bug from Cavium. No wonder I always had issues working with the USB in u-boot off of the SDK. I see this is my 1.9 Cavium SDK. Not sure if it is on a more recent version. Patrick From owner-freebsd-mips@FreeBSD.ORG Fri Apr 1 19:05:23 2011 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 E55721065674 for ; Fri, 1 Apr 2011 19:05:23 +0000 (UTC) (envelope-from bhanuprakashbodireddy@gmail.com) Received: from mail-px0-f172.google.com (mail-px0-f172.google.com [209.85.212.172]) by mx1.freebsd.org (Postfix) with ESMTP id B51D08FC15 for ; Fri, 1 Apr 2011 19:05:23 +0000 (UTC) Received: by pxi6 with SMTP id 6so2427258pxi.17 for ; Fri, 01 Apr 2011 12:05:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=xkpzpbPjoqM9af4EXxuJuc14k1siRbeAmmw00YMjG4E=; b=uoGOj17VFd9JfgVcmXDUz+J5lI+fOXTgT73q6jJa1Xz156i6WkHrYA7nv55CquDz32 aTvDjbX4Fmnv8Gc1AI42+f/wkp0dM95VzduIbfHplkoSkNcIHttBOIi5puXgHiRvrOZA OCeGD5FC8J8KmHOnLadVjkW4BCnoVunCnQa6c= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=ds2dfLqgFaIjd7BrnJwFvhTxLLztwIs8het4ZKAH7zUhp/cKcHvZ7o0xJCvLOtz45g aKNKP6FskxTvjwX07sDgCUsmOR0B/DfwUH5SvH2Qmt60v3bXf00ttioeHzoSsUFy3vrU hAjsG7hKVh24p0bm48cc9RXXfdWH16AFEdhHs= MIME-Version: 1.0 Received: by 10.142.76.16 with SMTP id y16mr3282184wfa.157.1301684722192; Fri, 01 Apr 2011 12:05:22 -0700 (PDT) Received: by 10.142.222.3 with HTTP; Fri, 1 Apr 2011 12:05:22 -0700 (PDT) In-Reply-To: <4D961CB0.6080802@mahan.org> References: <4D961CB0.6080802@mahan.org> Date: Fri, 1 Apr 2011 12:05:22 -0700 Message-ID: From: bhanuprakash bodireddy To: Patrick Mahan Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: freebsd-mips@freebsd.org Subject: Re: Blatant simple bug in Cavium SDK USB code? 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: Fri, 01 Apr 2011 19:05:24 -0000 On Fri, Apr 1, 2011 at 11:42 AM, Patrick Mahan wrote: > > > On 4/1/11 11:08 AM, Andrew Duane wrote: > > > > In the routine cvmx_usb_initialize in sys/contrib/octeon-sdk/cvmx-usb.c, > I'm pretty sure there's a silly little bug that really BADLY breaks the USB > driver for some of us. > > > > Near the top, after it finds board type and sets the clock type, as part > of the structure initialization, there is: > > > > memset(usb, 0, sizeof(usb)); > > > > Tell me that is not supposed to be: > > > > memset(usb, 0, sizeof(*usb)); > > > > The existing code only zeros 4/8 bytes, instead of the 23KB of the > structure. > > > > Ugh... Looks like this is an original bug from Cavium. No wonder I always > had issues working with the USB in u-boot off of the SDK. > > I see this is my 1.9 Cavium SDK. Not sure if it is on a more recent > version. > We already have 2.0 Simple Exec support merged on to Mainline. Unfortunately this bug wasn't detected. Thanks, Bhanu prakash. > > Patrick > _______________________________________________ > freebsd-mips@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-mips > To unsubscribe, send any mail to "freebsd-mips-unsubscribe@freebsd.org" > From owner-freebsd-mips@FreeBSD.ORG Fri Apr 1 20:04:29 2011 Return-Path: Delivered-To: mips@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A6AB9106566C; Fri, 1 Apr 2011 20:04:29 +0000 (UTC) (envelope-from aduane@juniper.net) Received: from exprod7og115.obsmtp.com (exprod7og115.obsmtp.com [64.18.2.217]) by mx1.freebsd.org (Postfix) with ESMTP id 3EB548FC0A; Fri, 1 Apr 2011 20:04:28 +0000 (UTC) Received: from source ([66.129.224.36]) (using TLSv1) by exprod7ob115.postini.com ([64.18.6.12]) with SMTP ID DSNKTZYvzAn4BaIGNY6/5s/3Yo7t2gbebQ5D@postini.com; Fri, 01 Apr 2011 13:04:29 PDT Received: from p-emfe01-wf.jnpr.net (172.28.145.24) by P-EMHUB03-HQ.jnpr.net (172.24.192.37) with Microsoft SMTP Server (TLS) id 8.2.254.0; Fri, 1 Apr 2011 13:02:22 -0700 Received: from EMBX01-WF.jnpr.net ([fe80::1914:3299:33d9:e43b]) by p-emfe01-wf.jnpr.net ([fe80::d0d1:653d:5b91:a123%11]) with mapi; Fri, 1 Apr 2011 16:03:56 -0400 From: Andrew Duane To: Juli Mallett Date: Fri, 1 Apr 2011 16:03:55 -0400 Thread-Topic: Blatant simple bug in Cavium SDK USB code? Thread-Index: AcvwnQ1yYeQ8T8nMRTawf5rZ4yQXtAACPFEi Message-ID: References: , In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Cc: "mips@freebsd.org" Subject: RE: Blatant simple bug in Cavium SDK USB code? 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: Fri, 01 Apr 2011 20:04:29 -0000 This isn't even close to the only problem I'm having. I don't make it out o= f cvmx_usb_initialize at all. One of two things happens: 1) The code completes and device_probe returns ENXIO so the routine bails o= ut and USB doesn't work. 2) Something goes insane and I either get a load fault halfway through the = routine touching one of the USB registers (CVMX_USBCX_GAHBCFG I think), or = I get an instruction exception in some worker routine buried in the middle. Ouch indeed.... -- Andrew Duane Juniper Networks 978-589-0551 10 Technology Park Dr aduane@juniper.net Westford, MA 01886-3418 ________________________________________ From: juli@clockworksquid.com [juli@clockworksquid.com] On Behalf Of Juli M= allett [jmallett@FreeBSD.org] Sent: Friday, April 01, 2011 2:45 PM To: Andrew Duane Cc: mips@freebsd.org Subject: Re: Blatant simple bug in Cavium SDK USB code? Hey Andrew, On Fri, Apr 1, 2011 at 11:08, Andrew Duane wrote: > > In the routine cvmx_usb_initialize in sys/contrib/octeon-sdk/cvmx-usb.c, = I'm pretty sure there's a silly little bug that really BADLY breaks the USB= driver for some of us. > > Near the top, after it finds board type and sets the clock type, as part = of the structure initialization, there is: > > memset(usb, 0, sizeof(usb)); > > Tell me that is not supposed to be: > > memset(usb, 0, sizeof(*usb)); > > The existing code only zeros 4/8 bytes, instead of the 23KB of the struct= ure. Ouch, nice catch. Is that the only thing keeping the USB driver from working for you? I thought it had rotted some behind other controller changes and also had some problems with stalls, but perhaps the culprit was initialization all along. I'll check in that fix soon, but would like to hear from you as to whether you have any additional fixes for USB (or even bugs to report.) I've BCC'd some Cavium people who will no doubt appreciate the bug report! Thanks, Juli. From owner-freebsd-mips@FreeBSD.ORG Fri Apr 1 21:23:50 2011 Return-Path: Delivered-To: mips@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2E127106566B; Fri, 1 Apr 2011 21:23:50 +0000 (UTC) (envelope-from bhanuprakashbodireddy@gmail.com) Received: from mail-px0-f172.google.com (mail-px0-f172.google.com [209.85.212.172]) by mx1.freebsd.org (Postfix) with ESMTP id C19C68FC08; Fri, 1 Apr 2011 21:23:49 +0000 (UTC) Received: by pxi6 with SMTP id 6so2505057pxi.17 for ; Fri, 01 Apr 2011 14:23:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=BQINit/xlDuNeOt9g3If5dESMml5qDAC9i8cVfZjf98=; b=cZcG6Up7yw6h6UPYPnmWDJAOp3yq3plWoUrc/3CIA9DrzyuJvczRs6FdGJH8RnFUzz apxflxN/HPr0oQtEpUqJz4ok/qLx8fdmI/iuWe06GXF1NbVREPD+f0KF6oI6QI6eHIBj 6M3+NDHY8uwPNIIDfJA5XxvoV3c5JuIe9oUDw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=RoqsWcKiuGgJJiLSQBLFyqaNYW8v0bertjrwdgBuO5FgAfVtSwPqU2ywPmiaio3w2d lYKQKeDS3UtGR9k1RNisXCLdWd2QMTZzc35+vbaVSZBZao+pez3MBGac49VT7ucCT0pn /Ky4FckCwtfkV5DjYfZ3onJT5Aw8OrN8JcwqU= MIME-Version: 1.0 Received: by 10.142.76.16 with SMTP id y16mr3387165wfa.157.1301693029461; Fri, 01 Apr 2011 14:23:49 -0700 (PDT) Received: by 10.142.222.3 with HTTP; Fri, 1 Apr 2011 14:23:49 -0700 (PDT) In-Reply-To: References: Date: Fri, 1 Apr 2011 14:23:49 -0700 Message-ID: From: bhanuprakash bodireddy To: Andrew Duane Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: "mips@freebsd.org" Subject: Re: Blatant simple bug in Cavium SDK USB code? 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: Fri, 01 Apr 2011 21:23:50 -0000 Hi Andrew, We are yet to add the USB support to mainline. I have sent USB support patches to Juli and she had reviewed them earlier. But some of the routines are yet to be rewritten(due to other issues) and hence the support is still missing. Thanks, Bhanu Prakash. On Fri, Apr 1, 2011 at 1:03 PM, Andrew Duane wrote: > This isn't even close to the only problem I'm having. I don't make it out > of cvmx_usb_initialize at all. One of two things happens: > > 1) The code completes and device_probe returns ENXIO so the routine bails > out and USB doesn't work. > 2) Something goes insane and I either get a load fault halfway through the > routine touching one of the USB registers (CVMX_USBCX_GAHBCFG I think), or I > get an instruction exception in some worker routine buried in the middle. > > Ouch indeed.... > > -- > Andrew Duane Juniper Networks > 978-589-0551 10 Technology Park Dr > aduane@juniper.net Westford, MA 01886-3418 > > ________________________________________ > From: juli@clockworksquid.com [juli@clockworksquid.com] On Behalf Of Juli > Mallett [jmallett@FreeBSD.org] > Sent: Friday, April 01, 2011 2:45 PM > To: Andrew Duane > Cc: mips@freebsd.org > Subject: Re: Blatant simple bug in Cavium SDK USB code? > > Hey Andrew, > > On Fri, Apr 1, 2011 at 11:08, Andrew Duane wrote: > > > > In the routine cvmx_usb_initialize in sys/contrib/octeon-sdk/cvmx-usb.c, > I'm pretty sure there's a silly little bug that really BADLY breaks the USB > driver for some of us. > > > > Near the top, after it finds board type and sets the clock type, as part > of the structure initialization, there is: > > > > memset(usb, 0, sizeof(usb)); > > > > Tell me that is not supposed to be: > > > > memset(usb, 0, sizeof(*usb)); > > > > The existing code only zeros 4/8 bytes, instead of the 23KB of the > structure. > > Ouch, nice catch. Is that the only thing keeping the USB driver from > working for you? I thought it had rotted some behind other controller > changes and also had some problems with stalls, but perhaps the > culprit was initialization all along. I'll check in that fix soon, > but would like to hear from you as to whether you have any additional > fixes for USB (or even bugs to report.) > > I've BCC'd some Cavium people who will no doubt appreciate the bug report! > > Thanks, > Juli. > _______________________________________________ > freebsd-mips@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-mips > To unsubscribe, send any mail to "freebsd-mips-unsubscribe@freebsd.org" > From owner-freebsd-mips@FreeBSD.ORG Fri Apr 1 22:19:05 2011 Return-Path: Delivered-To: mips@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ED4B1106566B for ; Fri, 1 Apr 2011 22:19:05 +0000 (UTC) (envelope-from juli@clockworksquid.com) Received: from mail-yi0-f54.google.com (mail-yi0-f54.google.com [209.85.218.54]) by mx1.freebsd.org (Postfix) with ESMTP id B57898FC1B for ; Fri, 1 Apr 2011 22:19:05 +0000 (UTC) Received: by yie12 with SMTP id 12so1855877yie.13 for ; Fri, 01 Apr 2011 15:19:05 -0700 (PDT) Received: by 10.150.63.19 with SMTP id l19mr4978800yba.71.1301696345124; Fri, 01 Apr 2011 15:19:05 -0700 (PDT) MIME-Version: 1.0 Sender: juli@clockworksquid.com Received: by 10.151.13.12 with HTTP; Fri, 1 Apr 2011 15:18:44 -0700 (PDT) In-Reply-To: References: From: Juli Mallett Date: Fri, 1 Apr 2011 15:18:44 -0700 X-Google-Sender-Auth: q2-S191AswnKp4mGIGAjpQE3ihA Message-ID: To: bhanuprakash bodireddy Content-Type: text/plain; charset=ISO-8859-1 Cc: "mips@freebsd.org" Subject: Re: Blatant simple bug in Cavium SDK USB code? 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: Fri, 01 Apr 2011 22:19:06 -0000 Following up to Andrew, On Fri, Apr 1, 2011 at 14:23, bhanuprakash bodireddy wrote: > On Fri, Apr 1, 2011 at 1:03 PM, Andrew Duane wrote: >> >> This isn't even close to the only problem I'm having. I don't make it out >> of cvmx_usb_initialize at all. One of two things happens: > > We are yet to add the USB support to mainline. I have sent USB support > patches to Juli and she had reviewed them earlier. > But some of the routines are yet to be rewritten(due to other issues) and > hence the support is still missing. The outstanding patches are for Octeon 2 only, so if you're using CN5XXX you'll have to wait for someone to fix up the SDK-based USB driver. HPS did a great job on it initially, even working without hardware, and we managed to get it mostly working, but there were/are remaining issues that somebody with interest, time and hardware will need to solve. My USB need has disappeared and I've been short on time, so it hasn't been a priority for me. (I can't speak to CN3XXX as I don't have any usable CN3XXX hardware presently and it doesn't seem worth investing as much effort in.) Oleksandr has Octeon hardware with USB, and there's a system with USB in the Netperf cluster (although obviously that isn't really convenient for USB testing, but can be used for basic controller work) and Alexander Kabaev has expressed an interest in USB in the past. There's a D-Link Ukraine developer who has done some work with the DWC_OTG driver from Linux for Octeon and some other boards with similar hardware. Adrian Chadd should be getting Octeon hardware in the near future, including USB. So there's enough people with the right skills and hardware out there, it's just a matter of someone having enough time and interest to work on it. Juli. From owner-freebsd-mips@FreeBSD.ORG Fri Apr 1 23:39:36 2011 Return-Path: Delivered-To: mips@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 514791065670; Fri, 1 Apr 2011 23:39:36 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id E3D6A8FC08; Fri, 1 Apr 2011 23:39:35 +0000 (UTC) Received: from 63.imp.bsdimp.com (63.imp.bsdimp.com [10.0.0.63]) (authenticated bits=0) by harmony.bsdimp.com (8.14.4/8.14.3) with ESMTP id p31NYQNO046080 (version=TLSv1/SSLv3 cipher=DHE-DSS-AES128-SHA bits=128 verify=NO); Fri, 1 Apr 2011 17:34:27 -0600 (MDT) (envelope-from imp@bsdimp.com) Mime-Version: 1.0 (Apple Message framework v1082) Content-Type: text/plain; charset=us-ascii From: Warner Losh In-Reply-To: Date: Fri, 1 Apr 2011 17:34:26 -0600 Content-Transfer-Encoding: quoted-printable Message-Id: References: To: Juli Mallett X-Mailer: Apple Mail (2.1082) X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (harmony.bsdimp.com [10.0.0.6]); Fri, 01 Apr 2011 17:34:27 -0600 (MDT) Cc: "mips@freebsd.org" Subject: Re: Blatant simple bug in Cavium SDK USB code? 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: Fri, 01 Apr 2011 23:39:36 -0000 On Apr 1, 2011, at 4:18 PM, Juli Mallett wrote: > Following up to Andrew, >=20 > On Fri, Apr 1, 2011 at 14:23, bhanuprakash bodireddy > wrote: >> On Fri, Apr 1, 2011 at 1:03 PM, Andrew Duane = wrote: >>>=20 >>> This isn't even close to the only problem I'm having. I don't make = it out >>> of cvmx_usb_initialize at all. One of two things happens: >>=20 >> We are yet to add the USB support to mainline. I have sent USB = support >> patches to Juli and she had reviewed them earlier. >> But some of the routines are yet to be rewritten(due to other issues) = and >> hence the support is still missing. >=20 > The outstanding patches are for Octeon 2 only, so if you're using > CN5XXX you'll have to wait for someone to fix up the SDK-based USB > driver. HPS did a great job on it initially, even working without > hardware, and we managed to get it mostly working, but there were/are > remaining issues that somebody with interest, time and hardware will > need to solve. My USB need has disappeared and I've been short on > time, so it hasn't been a priority for me. (I can't speak to CN3XXX > as I don't have any usable CN3XXX hardware presently and it doesn't > seem worth investing as much effort in.) I have some here, and it is only interesting to me because it is my = regression testbed... > Oleksandr has Octeon hardware with USB, and there's a system with USB > in the Netperf cluster (although obviously that isn't really > convenient for USB testing, but can be used for basic controller work) > and Alexander Kabaev has expressed an interest in USB in the past. > There's a D-Link Ukraine developer who has done some work with the > DWC_OTG driver from Linux for Octeon and some other boards with > similar hardware. Adrian Chadd should be getting Octeon hardware in > the near future, including USB. So there's enough people with the > right skills and hardware out there, it's just a matter of someone > having enough time and interest to work on it I have gear in my garage too that could be used, but I'm ENOTIME for = projects like this... Warner >=20 From owner-freebsd-mips@FreeBSD.ORG Sat Apr 2 00:20:45 2011 Return-Path: Delivered-To: mips@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E7004106566B; Sat, 2 Apr 2011 00:20:44 +0000 (UTC) (envelope-from aduane@juniper.net) Received: from exprod7og105.obsmtp.com (exprod7og105.obsmtp.com [64.18.2.163]) by mx1.freebsd.org (Postfix) with ESMTP id DAB208FC12; Sat, 2 Apr 2011 00:20:43 +0000 (UTC) Received: from source ([66.129.224.36]) (using TLSv1) by exprod7ob105.postini.com ([64.18.6.12]) with SMTP ID DSNKTZZr26XQNdO+8cfka9ykfkgU/yPoWzhj@postini.com; Fri, 01 Apr 2011 17:20:44 PDT Received: from p-emfe01-wf.jnpr.net (172.28.145.24) by P-EMHUB02-HQ.jnpr.net (172.24.192.36) with Microsoft SMTP Server (TLS) id 8.2.254.0; Fri, 1 Apr 2011 17:16:34 -0700 Received: from EMBX01-WF.jnpr.net ([fe80::1914:3299:33d9:e43b]) by p-emfe01-wf.jnpr.net ([fe80::d0d1:653d:5b91:a123%11]) with mapi; Fri, 1 Apr 2011 20:18:08 -0400 From: Andrew Duane To: Juli Mallett , bhanuprakash bodireddy Date: Fri, 1 Apr 2011 20:15:12 -0400 Thread-Topic: Blatant simple bug in Cavium SDK USB code? Thread-Index: AcvwutEqVYVCtpK8Q9C0opKHDjU+IAAEDdp/ Message-ID: References: , In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Cc: "mips@freebsd.org" Subject: RE: Blatant simple bug in Cavium SDK USB code? 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: Sat, 02 Apr 2011 00:20:45 -0000 I have USB hardware, and some familiarity with at least the bottom half of = the code. I know nothing of the scheduling, perdiodic stuff, the USB protoc= ol itself. But I can probably look at the hardware and driver aspects of it= . My hardware is very simple, a direct connect between the 5650 and a sing= le USB plug on the chassis. There's a similar platform I have someone else = working on that has a 4-port hub too, to look at "some day". We got a driver from a 3rd party company called Synopsis I think, I doubt t= here's any way we can use it, but I should be able to get the bottom half g= oing to at least recognize a stick. -- Andrew Duane Juniper Networks 978-589-0551 10 Technology Park Dr aduane@juniper.net Westford, MA 01886-3418 ________________________________________ From: juli@clockworksquid.com [juli@clockworksquid.com] On Behalf Of Juli M= allett [jmallett@FreeBSD.org] Sent: Friday, April 01, 2011 6:18 PM To: bhanuprakash bodireddy Cc: Andrew Duane; mips@freebsd.org Subject: Re: Blatant simple bug in Cavium SDK USB code? Following up to Andrew, On Fri, Apr 1, 2011 at 14:23, bhanuprakash bodireddy wrote: > On Fri, Apr 1, 2011 at 1:03 PM, Andrew Duane wrote: >> >> This isn't even close to the only problem I'm having. I don't make it ou= t >> of cvmx_usb_initialize at all. One of two things happens: > > We are yet to add the USB support to mainline. I have sent USB support > patches to Juli and she had reviewed them earlier. > But some of the routines are yet to be rewritten(due to other issues) and > hence the support is still missing. The outstanding patches are for Octeon 2 only, so if you're using CN5XXX you'll have to wait for someone to fix up the SDK-based USB driver. HPS did a great job on it initially, even working without hardware, and we managed to get it mostly working, but there were/are remaining issues that somebody with interest, time and hardware will need to solve. My USB need has disappeared and I've been short on time, so it hasn't been a priority for me. (I can't speak to CN3XXX as I don't have any usable CN3XXX hardware presently and it doesn't seem worth investing as much effort in.) Oleksandr has Octeon hardware with USB, and there's a system with USB in the Netperf cluster (although obviously that isn't really convenient for USB testing, but can be used for basic controller work) and Alexander Kabaev has expressed an interest in USB in the past. There's a D-Link Ukraine developer who has done some work with the DWC_OTG driver from Linux for Octeon and some other boards with similar hardware. Adrian Chadd should be getting Octeon hardware in the near future, including USB. So there's enough people with the right skills and hardware out there, it's just a matter of someone having enough time and interest to work on it. Juli. From owner-freebsd-mips@FreeBSD.ORG Sat Apr 2 00:27:31 2011 Return-Path: Delivered-To: mips@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1DB6110656EA for ; Sat, 2 Apr 2011 00:27:30 +0000 (UTC) (envelope-from juli@clockworksquid.com) Received: from mail-gx0-f182.google.com (mail-gx0-f182.google.com [209.85.161.182]) by mx1.freebsd.org (Postfix) with ESMTP id E132E8FC08 for ; Sat, 2 Apr 2011 00:27:29 +0000 (UTC) Received: by gxk28 with SMTP id 28so1884341gxk.13 for ; Fri, 01 Apr 2011 17:27:29 -0700 (PDT) Received: by 10.151.20.16 with SMTP id x16mr4589000ybi.128.1301704049164; Fri, 01 Apr 2011 17:27:29 -0700 (PDT) MIME-Version: 1.0 Sender: juli@clockworksquid.com Received: by 10.151.13.12 with HTTP; Fri, 1 Apr 2011 17:27:09 -0700 (PDT) In-Reply-To: References: From: Juli Mallett Date: Fri, 1 Apr 2011 17:27:09 -0700 X-Google-Sender-Auth: aJalNfOgf3rYMk_TIi9pxmCND58 Message-ID: To: Andrew Duane Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: "mips@freebsd.org" Subject: Re: Blatant simple bug in Cavium SDK USB code? 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: Sat, 02 Apr 2011 00:27:31 -0000 On Fri, Apr 1, 2011 at 17:15, Andrew Duane wrote: > I have USB hardware, and some familiarity with at least the bottom half o= f the code. I know nothing of the scheduling, perdiodic stuff, the USB prot= ocol itself. But I can probably look at the hardware and driver aspects of = it. =A0My hardware is very simple, a direct connect between the 5650 and a = single USB plug on the chassis. There's a similar platform I have someone e= lse working on that has a 4-port hub too, to look at "some day". > > We got a driver from a 3rd party company called Synopsis I think, I doubt= there's any way we can use it, but I should be able to get the bottom half= going to at least recognize a stick. That's the DWC_OTG driver. It's BSD-licensed (or nearly so) in Octeon Linux, but probably GPL tainted in at least a few places. Someone was working on porting it to FreeBSD, but I believe they abandoned that approach in favor of writing a driver from scratch. It should be easy enough to port to FreeBSD, although I understand that Elite USB Hackers probably wouldn't find a from-scratch driver very difficult given the amount of code-as-documentation that's available in that for. Good luck!