From owner-freebsd-embedded@FreeBSD.ORG Thu Jan 8 16:09:27 2015 Return-Path: Delivered-To: freebsd-embedded@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 79536659 for ; Thu, 8 Jan 2015 16:09:27 +0000 (UTC) Received: from mail-lb0-f176.google.com (mail-lb0-f176.google.com [209.85.217.176]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F3B97253 for ; Thu, 8 Jan 2015 16:09:26 +0000 (UTC) Received: by mail-lb0-f176.google.com with SMTP id p9so3671194lbv.7 for ; Thu, 08 Jan 2015 08:09:23 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:date:message-id:subject:from:to:cc :content-type; bh=lpBopkcDGRJdUc22by4jbqsea6mzmDyImPtdF1ZjkOY=; b=ey/BvzOnF1nVt65hsF0nx2Cm2M+/PhPW9zk4T8dZ8lJHFFNt+F0frxV6HYFNmGcVJV MDEHDzp1p3A30Jua4OuLvIupFHqdGJ6P/z0BkpE4VR9AZrCIPfbf0h3hthUAmaWTeDg4 g039UShIATBUu7rvmwgkWJihUZoMEzkKEYCDurC+BWkDJ5ZJub4nz6e3LP5RiJwZ0mnN LTJ0e+1IHY+7VYf7K7IbdCJ3By69fiumLpHU14Wi+fS+yTzKSVxCs4vSO3dyoElTrYXH pBbYkz4czRXedJ2hbhLK65SVQhWBtn7Ars6V6MFBloo05LMoJWB2fNLC/hGRSPScEE2V mqAg== X-Gm-Message-State: ALoCoQkUdO+0NFLmwGbO/SXiN0msGs0TcqyF27QaBps5Zes0gA8UTv88bnM05X9gf8GEAwSTtkGr MIME-Version: 1.0 X-Received: by 10.112.170.132 with SMTP id am4mr14666786lbc.74.1420733363671; Thu, 08 Jan 2015 08:09:23 -0800 (PST) Received: by 10.25.14.208 with HTTP; Thu, 8 Jan 2015 08:09:23 -0800 (PST) Date: Thu, 8 Jan 2015 17:09:23 +0100 Message-ID: Subject: [PATCH] Add support for 64-bit AHCI BAR. From: =?UTF-8?Q?Micha=C5=82_Stanek?= To: freebsd-current@freebsd.org Content-Type: multipart/mixed; boundary=001a11c37818767c02050c264381 X-Content-Filtered-By: Mailman/MimeDel 2.1.18-1 Cc: freebsd-embedded@freebsd.org X-BeenThere: freebsd-embedded@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Dedicated and Embedded Systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Jan 2015 16:09:27 -0000 --001a11c37818767c02050c264381 Content-Type: text/plain; charset=UTF-8 Hello all, I ran into an issue with AHCI BAR allocation on arm64. The AHCI PCI driver in sys/dev/ahci/ahci_pci.c assumes that ABAR (AHCI Base Address) register is located at offset 0x24 (BAR5) in the PCI header. Specification for AHCI confirms this is indeed the default address of the main BAR. However, if AHCI uses 64-bit base addresses, then this register consists of two dwords starting at offset 0x20 - BAR4 and BAR5. This is the case on our arm64 target and possibly other platforms using 64-bit BARs for AHCI. The following patch adds a check for the extended BAR in ahci_pci_attach() and sets the 'rid' in bus_alloc_resource_any accordingly. It fixes the allocation error on our platform. Please review and test this patch on other platforms. If there are no issues then it will be committed in a week. Thanks, Michal Stanek --001a11c37818767c02050c264381 Content-Type: text/x-patch; charset=US-ASCII; name="ahci_64bit_bar.patch" Content-Disposition: attachment; filename="ahci_64bit_bar.patch" Content-Transfer-Encoding: base64 X-Attachment-Id: f_i4obv96a0 RnJvbSBjYWI2MGNkN2ZjNWE1MTdkZjRkOGM1NWRhNWU4NzI4OGM0MWE5ODVhIE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBNaWNoYWwgU3RhbmVrIDxtc3RAc2VtaWhhbGYuY29tPgpEYXRl OiBXZWQsIDcgSmFuIDIwMTUgMTg6Mjg6MTggKzAxMDAKU3ViamVjdDogW1BBVENIXSBBZGQgc3Vw cG9ydCBmb3IgNjQtYml0IEFIQ0kgQkFSLgoKLS0tCiBzeXMvZGV2L2FoY2kvYWhjaV9wY2kuYyB8 IDExICsrKysrKysrKy0tCiAxIGZpbGUgY2hhbmdlZCwgOSBpbnNlcnRpb25zKCspLCAyIGRlbGV0 aW9ucygtKQoKZGlmZiAtLWdpdCBhL3N5cy9kZXYvYWhjaS9haGNpX3BjaS5jIGIvc3lzL2Rldi9h aGNpL2FoY2lfcGNpLmMKaW5kZXggYWYyNjk1MS4uNDM3MjNhNiAxMDA2NDQKLS0tIGEvc3lzL2Rl di9haGNpL2FoY2lfcGNpLmMKKysrIGIvc3lzL2Rldi9haGNpL2FoY2lfcGNpLmMKQEAgLTM3Myw2 ICszNzMsNyBAQCBhaGNpX3BjaV9hdHRhY2goZGV2aWNlX3QgZGV2KQogCWludAllcnJvciwgaTsK IAl1aW50MzJfdCBkZXZpZCA9IHBjaV9nZXRfZGV2aWQoZGV2KTsKIAl1aW50OF90IHJldmlkID0g cGNpX2dldF9yZXZpZChkZXYpOworCXN0cnVjdCBwY2lfbWFwICptYXA7CiAKIAlpID0gMDsKIAl3 aGlsZSAoYWhjaV9pZHNbaV0uaWQgIT0gMCAmJgpAQCAtMzg2LDEyICszODcsMTggQEAgYWhjaV9w Y2lfYXR0YWNoKGRldmljZV90IGRldikKIAkgICAgcGNpX2dldF9zdWJ2ZW5kb3IoZGV2KSA9PSAw eDEwNDMgJiYKIAkgICAgcGNpX2dldF9zdWJkZXZpY2UoZGV2KSA9PSAweDgxZTQpCiAJCWN0bHIt PnF1aXJrcyB8PSBBSENJX1FfU0FUQTFfVU5JVDA7Ci0JLyogaWYgd2UgaGF2ZSBhIG1lbW9yeSBC QVIoNSkgd2UgYXJlIGxpa2VseSBvbiBhbiBBSENJIHBhcnQgKi8KIAljdGxyLT52ZW5kb3JpZCA9 IHBjaV9nZXRfdmVuZG9yKGRldik7CiAJY3Rsci0+ZGV2aWNlaWQgPSBwY2lfZ2V0X2RldmljZShk ZXYpOwogCWN0bHItPnN1YnZlbmRvcmlkID0gcGNpX2dldF9zdWJ2ZW5kb3IoZGV2KTsKIAljdGxy LT5zdWJkZXZpY2VpZCA9IHBjaV9nZXRfc3ViZGV2aWNlKGRldik7Ci0JY3Rsci0+cl9yaWQgPSBQ Q0lSX0JBUig1KTsKKworCS8qIEFIQ0kgQmFzZSBBZGRyZXNzIGlzIEJBUig1KSBieSBkZWZhdWx0 LCB1bmxlc3MgQkFScyBhcmUgNjQtYml0ICovCisJbWFwID0gcGNpX2ZpbmRfYmFyKGRldiwgUENJ Ul9CQVIoNCkpOworCWlmIChtYXAgIT0gTlVMTCAmJgorCSAgICAoKG1hcC0+cG1fdmFsdWUgJiBQ Q0lNX0JBUl9NRU1fVFlQRSkgPT0gUENJTV9CQVJfTUVNXzY0KSkKKwkJY3Rsci0+cl9yaWQgPSBQ Q0lSX0JBUig0KTsKKwllbHNlCisJCWN0bHItPnJfcmlkID0gUENJUl9CQVIoNSk7CiAJaWYgKCEo Y3Rsci0+cl9tZW0gPSBidXNfYWxsb2NfcmVzb3VyY2VfYW55KGRldiwgU1lTX1JFU19NRU1PUlks CiAJICAgICZjdGxyLT5yX3JpZCwgUkZfQUNUSVZFKSkpCiAJCXJldHVybiBFTlhJTzsKLS0gCjIu Mi4xCgo= --001a11c37818767c02050c264381-- From owner-freebsd-embedded@FreeBSD.ORG Thu Jan 8 16:36:29 2015 Return-Path: Delivered-To: freebsd-embedded@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 667CE317 for ; Thu, 8 Jan 2015 16:36:29 +0000 (UTC) Received: from mail-qc0-f174.google.com (mail-qc0-f174.google.com [209.85.216.174]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1EB147AA for ; Thu, 8 Jan 2015 16:36:28 +0000 (UTC) Received: by mail-qc0-f174.google.com with SMTP id c9so2858544qcz.5 for ; Thu, 08 Jan 2015 08:36:21 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:subject:mime-version:content-type:from :in-reply-to:date:cc:message-id:references:to; bh=ZzaechhwzsQVRdnZh+sAdTqcPwviNDapHFOSENSMJhU=; b=b3NmYlg7JccFTR+JE845ayaw2uX7Xg0cBMXfGs69dA2N8TCVy6j02LBtsaK77FDk8f BAImLgx4CQOBJZ5pgy+4WmejxXh0z1mmEYw9MIxFEEfdmeYuK4F/vHJNg9pAPr0gn47z KusJqWFP6g1xvngIX/PqQId+lcpb6sAlC0iHR4TwRyjhbLqxAtwdxLRcmUizHR0qZ1vO I7G/fUj86pUGnhwcZ+b556ZnkxgBQkrD9mCoCB5umT/g98kqAbAH5Rp+awJtDV8tZn+c qQUYJtdwF3L1KsLouWy/zvC+3vWxNAHPWY8qNsT50GV5C3/2tX3Wj/AAuUO2hKVpG7AY tqUg== X-Gm-Message-State: ALoCoQlyb6NHce0yXktcpMN21omfQdhaUCNjNP3vGpJRDg0oHomfM2nNDw099ZnpKckQmtZIxY+l X-Received: by 10.224.30.74 with SMTP id t10mr17817944qac.8.1420734981621; Thu, 08 Jan 2015 08:36:21 -0800 (PST) Received: from [10.64.26.233] ([69.53.236.236]) by mx.google.com with ESMTPSA id p69sm4408559qga.27.2015.01.08.08.36.20 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 08 Jan 2015 08:36:20 -0800 (PST) Sender: Warner Losh Subject: Re: [PATCH] Add support for 64-bit AHCI BAR. Mime-Version: 1.0 (Mac OS X Mail 8.1 \(1993\)) Content-Type: multipart/signed; boundary="Apple-Mail=_61119F4E-BF62-4B0C-9CDA-1C08065117EA"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Pgp-Agent: GPGMail 2.5b3 From: Warner Losh In-Reply-To: Date: Thu, 8 Jan 2015 09:36:16 -0700 Message-Id: <83015CF1-7D55-4881-8CE9-BC42645A3763@bsdimp.com> References: To: =?utf-8?Q?Micha=C5=82_Stanek?= X-Mailer: Apple Mail (2.1993) Cc: freebsd-current@freebsd.org, freebsd-embedded@freebsd.org X-BeenThere: freebsd-embedded@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Dedicated and Embedded Systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Jan 2015 16:36:29 -0000 --Apple-Mail=_61119F4E-BF62-4B0C-9CDA-1C08065117EA Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On Jan 8, 2015, at 9:09 AM, Micha=C5=82 Stanek = wrote: >=20 > This looks good to my eyes=E2=80=A6 Given the ordering of the words in = the BAR, you won=E2=80=99t get false positives. It uses the PCI bus code to make = the determination, which eliminates duplication of code in drivers=E2=80=A6 = I like it. Warner --Apple-Mail=_61119F4E-BF62-4B0C-9CDA-1C08065117EA Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQIcBAEBCgAGBQJUrrIBAAoJEGwc0Sh9sBEA+DsQAJed3kQ+uiKDmKRgrKFGkhj+ HqvyJLds5YxM5vMKuhu/k9i8fKBwB/utLV9aYBfERs8UvWihLzpZe0Y72WCgDjZI U5cO7l3Sxww15xF4ohFXSTF9yjZl2OnwjwA/yszDICqCoDh6LZ/8KRKWWrc52hjb tl4kbCkGBtdwZgRDWdtvmi/qn4tGy1xfk7Vd6VqI//4G2eol0qM8cgMEIfqeRMsO aRlmutOktXnpQfj49zah0xi0bgvrD49B8ED6eL8hDuufNSwL8M1rBdV18mirq24a 5JllROD0SefN0nHJ7IKd+ZfWbMm6xZQEucvNhHfFhQ9jaqUruKDiYCcbP7io/2GW Z7b3546iInSEatuv6pdijz3aq08mcr00sZuQLxsysl0Vx12udDs9TV/8RTDs7iRW ROM0GpBQ/S5Lsv82hOdXxpfHjxbXRQUdeqkIJt1C9dNNEthKreYQdIIAWQb15nmE WdAiT/xvRaYg5PNIj2x3Swczq347HdIdVYo9rcdvtZeBIjHQO0pus+xusvpxD1eC MawNUTNFKfQAynGNp+NEnAC19CXCs4s1YRzAysf1FZpF4Gc6Il0un2wpN3y+HVPg nG3FwXlZy47udyB8c4/NT5Vo9S5uN8D36Grid17/Wj08mWyYGTZe//pFi77lyVp8 gUaNTnOeIGJ+JSnj4lrW =9pWr -----END PGP SIGNATURE----- --Apple-Mail=_61119F4E-BF62-4B0C-9CDA-1C08065117EA-- From owner-freebsd-embedded@FreeBSD.ORG Thu Jan 8 20:40:08 2015 Return-Path: Delivered-To: freebsd-embedded@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 823091B5; Thu, 8 Jan 2015 20:40:08 +0000 (UTC) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EA8406A8; Thu, 8 Jan 2015 20:40:07 +0000 (UTC) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.14.9/8.14.9) with ESMTP id t08Ke1Yl051145 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 8 Jan 2015 22:40:01 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.9.2 kib.kiev.ua t08Ke1Yl051145 Received: (from kostik@localhost) by tom.home (8.14.9/8.14.9/Submit) id t08Ke0Om051139; Thu, 8 Jan 2015 22:40:00 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Thu, 8 Jan 2015 22:40:00 +0200 From: Konstantin Belousov To: Micha?? Stanek Subject: Re: [PATCH] Add support for 64-bit AHCI BAR. Message-ID: <20150108203959.GR42409@kib.kiev.ua> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.0 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on tom.home Cc: freebsd-current@freebsd.org, freebsd-embedded@freebsd.org X-BeenThere: freebsd-embedded@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Dedicated and Embedded Systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Jan 2015 20:40:08 -0000 On Thu, Jan 08, 2015 at 05:09:23PM +0100, Micha?? Stanek wrote: > Hello all, > > I ran into an issue with AHCI BAR allocation on arm64. The AHCI PCI driver > in sys/dev/ahci/ahci_pci.c assumes that ABAR (AHCI Base Address) register > is located at offset 0x24 (BAR5) in the PCI header. Specification for AHCI > confirms this is indeed the default address of the main BAR. Yes, at least rev. 1.3 of AHCI just states that ABAR must be at offset 0x24. > However, if > AHCI uses 64-bit base addresses, then this register consists of two dwords > starting at offset 0x20 - BAR4 and BAR5. This is the case on our arm64 > target and possibly other platforms using 64-bit BARs for AHCI. Is it specified anywhere, or just a quirk of the specific implementation ? If it is a quirk, would it make sense to also check the vendor or device id before applying the logic ? > > The following patch adds a check for the extended BAR in ahci_pci_attach() > and sets the 'rid' in bus_alloc_resource_any accordingly. It fixes the > allocation error on our platform. > > Please review and test this patch on other platforms. If there are no > issues then it will be committed in a week. > From owner-freebsd-embedded@FreeBSD.ORG Fri Jan 9 02:27:18 2015 Return-Path: Delivered-To: freebsd-embedded@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4F93EAEC for ; Fri, 9 Jan 2015 02:27:18 +0000 (UTC) Received: from COL004-OMC1S18.hotmail.com (col004-omc1s18.hotmail.com [65.55.34.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (Client CN "*.outlook.com", Issuer "MSIT Machine Auth CA 2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0DB70E14 for ; Fri, 9 Jan 2015 02:27:17 +0000 (UTC) Received: from COL130-W50 ([65.55.34.9]) by COL004-OMC1S18.hotmail.com over TLS secured channel with Microsoft SMTPSVC(7.5.7601.22751); Thu, 8 Jan 2015 18:26:11 -0800 X-TMN: [z4MIrv7zVamDbUzeZP2KL5QpBNBqCxHn32AuAxRwPWk=] X-Originating-Email: [m.vale@live.com.au] Message-ID: From: Michael Vale To: "freebsd-embedded@freebsd.org" Subject: Ubiquiti Bullet M (and Rocket M) Date: Fri, 9 Jan 2015 13:26:10 +1100 Importance: Normal MIME-Version: 1.0 X-OriginalArrivalTime: 09 Jan 2015 02:26:11.0319 (UTC) FILETIME=[A2249070:01D02BB3] Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.18-1 X-BeenThere: freebsd-embedded@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Dedicated and Embedded Systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Jan 2015 02:27:18 -0000 Hi. I've used the PICOSTATION_M2HP kernel config in -HEAD and produced some ima= ges for the UBNT XM series. Now they boot okay=2C but arge0 doesn't attach so there is no ethernetworki= ng..=2C and something is wrong with the random number generator=2C if i try= and cat /dev/random it says Resource temporarily unavailable=2C as a resul= t=2C I cannot enable WPA in hostap. Everything else appears to be running as it should. Here is a log of my boot process U-Boot 1.1.4.2-s594 (Dec 5 2012 - 15:23:07) Board: Ubiquiti Networks XM board (rev 0.0 e202)DRAM: 32 MBFlash: 8 MBPCI= e WLAN Module found (#1).Net: eth0=2C eth1Hit any key to stop autoboot: = 0 ## Booting image at 9f050000 ... Image Name: FreeBSD Created: = 2015-01-09 2:08:14 UTC Image Type: MIPS Linux Kernel Image (lzma comp= ressed) Data Size: 929588 Bytes =3D 907.8 kB Load Address: 80050000 = Entry Point: 80050100 Verifying Checksum ... OK Uncompressing Kernel= Image ... OK Starting kernel ... CPU platform: Atheros AR7240 rev 2CPU Frequency=3D390 MHzCPU DDR Frequency= =3D390 MHzCPU AHB Frequency=3D195 MHzplatform frequency: 390 MHzCPU referen= ce clock: 5 MHzCPU MDIO clock: 5 MHzarguments: a0 =3D 00000006 a1 =3D a1= f4bfb0 a2 =3D a1f4c460 a3 =3D 00000000Cmd line:argv is invalidEnvironment= :envp is invalidCache info: picache_stride =3D 4096 picache_loopcount = =3D 16 pdcache_stride =3D 4096 pdcache_loopcount =3D 8cpu0: MIPS Techn= ologies processor v116.147 MMU: Standard TLB=2C 16 entries L1 i-cache: 4 = ways of 512 sets=2C 32 bytes per line L1 d-cache: 4 ways of 256 sets=2C 32= bytes per line Config1=3D0x9ee3519e Config3=3D0x20KDB: debugger backends: ddbKDB: current backend: ddbCopyr= ight (c) 1992-2015 The FreeBSD Project.Copyright (c) 1979=2C 1980=2C 1983= =2C 1986=2C 1988=2C 1989=2C 1991=2C 1992=2C 1993=2C 1994 The Regents= of the University of California. All rights reserved.FreeBSD is a register= ed trademark of The FreeBSD Foundation.FreeBSD 11.0-CURRENT #3 r276847M: Fr= i Jan 9 13:07:32 AEDT 2015 masked@charlotte:/usr/obj/mips/mips.mips/usr= /src/sys/PICOSTATION_M2HP mipsgcc version 4.2.1 20070831 patched [FreeBSD]r= eal memory =3D 33554432 (32768K bytes)avail memory =3D 28241920 (26MB)rand= om device not loaded/active=3B using insecure pseudo-random number generato= rrandom: entropy device infrastructure driverrandom: selecting highest prio= rity adaptor nexus0: clock0: on nexus0Timecounter "MIPS32" frequency 195000000 Hz quality 800Event t= imer "MIPS32" frequency 195000000 Hz quality 800argemdio0: at mem 0x1a000000-0x1a000ff= f on nexus0mdio0: on argemdio0mdioproxy0: on mdio0arswitch0: on mdio0arswitch0: = attaching PHY 0 failedarswitch0: attaching PHY 1 failedarswitch0: attaching= PHY 2 failedarswitch0: attaching PHY 3 faileddevice_attach: arswitch0 atta= ch returned 6apb0 at irq 4 on nexus0uart0: <16550 or compatible> at mem 0x1= 8020003-0x1802001a irq 3 on apb0uart0: console (115200=2Cn=2C8=2C1)gpio0: <= Atheros AR71XX GPIO driver> at mem 0x18040000-0x18040fff irq 2 on apb0gpio0= : [GIANT-LOCKED]gpio0: gpio pinmask=3D0x1883gpioc0: on gp= io0gpiobus0: on gpio0gpioled0: at pin(s) 0 on gpiobus= 0gpioled1: at pin(s) 1 on gpiobus0gpioled2: at pin(s)= 11 on gpiobus0gpioled3: at pin(s) 7 on gpiobus0pcib0 at irq 0 o= n nexus0pcib0: found EEPROM at 0x1fff1000 on 0.0.0pcib0: EEPROM firmware: 0= x1fff1000 @ 4096 bytespcib0: device EEPROM 'pcib.0.bus.0.0.0.eeprom_firmwar= e' registeredpci0: on pcib0pci0: at device 0.0 (no driv= er attached)arge0: at mem 0x19= 000000-0x19000fff irq 2 on nexus0arge0: Overriding MAC from EEPROMmiiproxy0= : on arge0arge0: can't attach proxyarge0: fini= shing attachment=2C phymask 0010=2C proxy null arge0: unable to attach PHY = 4: 6device_attach: arge0 attach returned 6arge1: at mem 0x1a000000-0x1a000fff irq 3 on nexus0arge1: finis= hing attachment=2C phymask 0000=2C proxy null arge1: Ethernet address: 00:1= 5:6d:dd:2e:f4spi0: at mem 0x1f000000-0x1f00000f on nexus0spibu= s0: on spi0mx25l0: at cs 0 on spibus0mx2= 5l0: m25p64=2C sector 65536 bytes=2C 128 sectorsar71xx_wdog0: on nexus0ar71xx_wdog0: Previous reset was due to watchdo= g timeoutTimecounters tick every 1.000 msecmap/rootfs.uncompress: GEOM_ULZM= A image foundmap/rootfs.uncompress: 171 x 131072 blocksTrying to mount root= from ufs:/dev/map/rootfs.uncompress []...warning: no time-of-day clock reg= istered=2C system time will not be set accuratelyJan 9 02:07:48 init: logi= n_getclass: unknown class 'daemon'*** Populating /var ..*** Loading configu= ration files ..*** Restoring from /dev/map/cfg .. gunzip: invalid compresse= d data--crc erroretc/cfg/manifestetc/master.passwdetc/groupetc/cfg/rc.conf7= blocks*** Completed.*** setting up hostname*** Load kernel modulesrandom: = SOFT: yarrow init()random: selecting highest priority adaptor ath0:= at device 0.0 on pci0ath0: ath_pci_attach: EEPROM firmware = @ 0x8047d000ath0: [HT] enabling HT modesath0: [HT] 1 stream STBC receive en= abledath0: [HT] 1 RX streams=3B 1 TX streamsath0: AR9280 mac 128.2 RF5133 p= hy 13.0ath0: 2GHz radio: 0x0000=3B 5GHz radio: 0x00c0*** bringing up loopba= ck ..*** Default password/login databases ..*** Starting networking via /et= c/rc.d/base/netdev.ath.0.txq_mcastq_maxdepth: 512 -> 32sysctl: unknown oid = 'dev.ath.1.txq_mcastq_maxdepth': No such file or directorydev.ath.0.hal.for= ce_full_reset: 0 -> 1sysctl: unknown oid 'dev.ath.1.hal.force_full_reset': = No such file or directory*** Interface: arge1: start*** Interface: arge1: d= one*** Interface: wlan0: startwlan0: Ethernet address: 00:15:6d:dc:2e:f3ar5= 416PerCalibrationN: NF calibration didn't finish=3B delaying CCA*** Interfa= ce: wlan0: done*** Interface: bridge0: startbridge0: Ethernet address: 02:3= 2:ce:f5:ba:d0wlan0: promiscuous mode enabledbridge0: link state changed to = UParge1: promiscuous mode enabled*** Interface: bridge0: done*** inetd*** D= one! FreeBSD/mips (freebsd-wifi-build) (ttyu0) login:=20 = From owner-freebsd-embedded@FreeBSD.ORG Fri Jan 9 02:39:35 2015 Return-Path: Delivered-To: freebsd-embedded@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AE8E1D5 for ; Fri, 9 Jan 2015 02:39:35 +0000 (UTC) Received: from COL004-OMC1S8.hotmail.com (col004-omc1s8.hotmail.com [65.55.34.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (Client CN "*.outlook.com", Issuer "MSIT Machine Auth CA 2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 84B67EEB for ; Fri, 9 Jan 2015 02:39:35 +0000 (UTC) Received: from COL130-W24 ([65.55.34.8]) by COL004-OMC1S8.hotmail.com over TLS secured channel with Microsoft SMTPSVC(7.5.7601.22751); Thu, 8 Jan 2015 18:38:29 -0800 X-TMN: [sbkcIy50Sm0EpsoNC5pHuJfbgO3Y/Nl3+ya8Ox2EEHU=] X-Originating-Email: [m.vale@live.com.au] Message-ID: From: Michael Vale To: "freebsd-embedded@freebsd.org" Subject: RE: Ubiquiti Bullet M (and Rocket M) Date: Fri, 9 Jan 2015 13:38:29 +1100 Importance: Normal In-Reply-To: References: MIME-Version: 1.0 X-OriginalArrivalTime: 09 Jan 2015 02:38:29.0813 (UTC) FILETIME=[5A51CE50:01D02BB5] Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.18-1 X-BeenThere: freebsd-embedded@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Dedicated and Embedded Systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Jan 2015 02:39:35 -0000 Adrian just noted that the random module must be compiled into the kernel. = I've confirmed it works=2C so if somebody wants to add device random to PI= COSTATION_M2HP kernel config that'd be sweet. > From: m.vale@live.com.au > To: freebsd-embedded@freebsd.org > Subject: Ubiquiti Bullet M (and Rocket M) > Date: Fri=2C 9 Jan 2015 13:26:10 +1100 >=20 > Hi. > I've used the PICOSTATION_M2HP kernel config in -HEAD and produced some i= mages for the UBNT XM series. > Now they boot okay=2C but arge0 doesn't attach so there is no ethernetwor= king..=2C and something is wrong with the random number generator=2C if i t= ry and cat /dev/random it says Resource temporarily unavailable=2C as a res= ult=2C I cannot enable WPA in hostap. > Everything else appears to be running as it should. > Here is a log of my boot process > U-Boot 1.1.4.2-s594 (Dec 5 2012 - 15:23:07) > Board: Ubiquiti Networks XM board (rev 0.0 e202)DRAM: 32 MBFlash: 8 MBP= CIe WLAN Module found (#1).Net: eth0=2C eth1Hit any key to stop autoboot:= 0 ## Booting image at 9f050000 ... Image Name: FreeBSD Created: = 2015-01-09 2:08:14 UTC Image Type: MIPS Linux Kernel Image (lzma co= mpressed) Data Size: 929588 Bytes =3D 907.8 kB Load Address: 8005000= 0 Entry Point: 80050100 Verifying Checksum ... OK Uncompressing Kern= el Image ... OK > Starting kernel ... > CPU platform: Atheros AR7240 rev 2CPU Frequency=3D390 MHzCPU DDR Frequenc= y=3D390 MHzCPU AHB Frequency=3D195 MHzplatform frequency: 390 MHzCPU refere= nce clock: 5 MHzCPU MDIO clock: 5 MHzarguments: a0 =3D 00000006 a1 =3D a= 1f4bfb0 a2 =3D a1f4c460 a3 =3D 00000000Cmd line:argv is invalidEnvironmen= t:envp is invalidCache info: picache_stride =3D 4096 picache_loopcount= =3D 16 pdcache_stride =3D 4096 pdcache_loopcount =3D 8cpu0: MIPS Tech= nologies processor v116.147 MMU: Standard TLB=2C 16 entries L1 i-cache: 4= ways of 512 sets=2C 32 bytes per line L1 d-cache: 4 ways of 256 sets=2C 3= 2 bytes per line Config1=3D0x9ee3519e Config3=3D0x20KDB: debugger backends: ddbKDB: current backend: ddbCopy= right (c) 1992-2015 The FreeBSD Project.Copyright (c) 1979=2C 1980=2C 1983= =2C 1986=2C 1988=2C 1989=2C 1991=2C 1992=2C 1993=2C 1994 The Regents= of the University of California. All rights reserved.FreeBSD is a register= ed trademark of The FreeBSD Foundation.FreeBSD 11.0-CURRENT #3 r276847M: Fr= i Jan =20 > 9 13:07:32 AEDT 2015 masked@charlotte:/usr/obj/mips/mips.mips/usr/src= /sys/PICOSTATION_M2HP mipsgcc version 4.2.1 20070831 patched [FreeBSD]real = memory =3D 33554432 (32768K bytes)avail memory =3D 28241920 (26MB)random d= evice not loaded/active=3B using insecure pseudo-random number generatorran= dom: entropy device infrastructure driverrandom: selecting highest priority= adaptor nexus0: clock0: = on nexus0Timecounter "MIPS32" frequency 195000000 Hz quality 800Event timer= "MIPS32" frequency 195000000 Hz quality 800argemdio0: at mem 0x1a000000-0x1a000fff on= nexus0mdio0: on argemdio0mdioproxy0: = on mdio0arswitch0: on mdio0arswitch0: atta= ching PHY 0 failedarswitch0: attaching PHY 1 failedarswitch0: attaching PHY= 2 failedarswitch0: attaching PHY 3 faileddevice_attach: arswitch0 attach r= eturned 6apb0 at irq 4 on nexus0uar > t0: <16550 or compatible> at mem 0x18020003-0x1802001a irq 3 on apb0uart= 0: console (115200=2Cn=2C8=2C1)gpio0: at mem 0= x18040000-0x18040fff irq 2 on apb0gpio0: [GIANT-LOCKED]gpio0: gpio pinmask= =3D0x1883gpioc0: on gpio0gpiobus0: on gpio0gpi= oled0: at pin(s) 0 on gpiobus0gpioled1: at pin(s) 1 o= n gpiobus0gpioled2: at pin(s) 11 on gpiobus0gpioled3: = at pin(s) 7 on gpiobus0pcib0 at irq 0 on nexus0pcib0: found EEPROM at 0x1f= ff1000 on 0.0.0pcib0: EEPROM firmware: 0x1fff1000 @ 4096 bytespcib0: device= EEPROM 'pcib.0.bus.0.0.0.eeprom_firmware' registeredpci0: on pci= b0pci0: at device 0.0 (no driver attached)arge0: at mem 0x19000000-0x19000fff irq 2 on nexus0ar= ge0: Overriding MAC from EEPROMmiiproxy0: on a= rge0arge0: can't attach proxyarge0: finishing attachment=2C phymask 0010=2C= proxy null arge0: unable to attach PHY=20 > 4: 6device_attach: arge0 attach returned 6arge1: at mem 0x1a000000-0x1a000fff irq 3 on nexus0arge1: fi= nishing attachment=2C phymask 0000=2C proxy null arge1: Ethernet address: 0= 0:15:6d:dd:2e:f4spi0: at mem 0x1f000000-0x1f00000f on nexus0sp= ibus0: on spi0mx25l0: at cs 0 on spibus0= mx25l0: m25p64=2C sector 65536 bytes=2C 128 sectorsar71xx_wdog0: on nexus0ar71xx_wdog0: Previous reset was due to watc= hdog timeoutTimecounters tick every 1.000 msecmap/rootfs.uncompress: GEOM_U= LZMA image foundmap/rootfs.uncompress: 171 x 131072 blocksTrying to mount r= oot from ufs:/dev/map/rootfs.uncompress []...warning: no time-of-day clock = registered=2C system time will not be set accuratelyJan 9 02:07:48 init: l= ogin_getclass: unknown class 'daemon'*** Populating /var ..*** Loading conf= iguration files ..*** Restoring from /dev/map/cfg .. gunzip: invalid compre= ssed data--crc erroretc/cfg/manifes > tetc/master.passwdetc/groupetc/cfg/rc.conf7 blocks*** Completed.*** sett= ing up hostname*** Load kernel modulesrandom: SOFT: yarrow init()random: se= lecting highest priority adaptor ath0: at device 0.0= on pci0ath0: ath_pci_attach: EEPROM firmware @ 0x8047d000ath0: [HT] enabli= ng HT modesath0: [HT] 1 stream STBC receive enabledath0: [HT] 1 RX streams= =3B 1 TX streamsath0: AR9280 mac 128.2 RF5133 phy 13.0ath0: 2GHz radio: 0x0= 000=3B 5GHz radio: 0x00c0*** bringing up loopback ..*** Default password/lo= gin databases ..*** Starting networking via /etc/rc.d/base/netdev.ath.0.txq= _mcastq_maxdepth: 512 -> 32sysctl: unknown oid 'dev.ath.1.txq_mcastq_maxdep= th': No such file or directorydev.ath.0.hal.force_full_reset: 0 -> 1sysctl:= unknown oid 'dev.ath.1.hal.force_full_reset': No such file or directory***= Interface: arge1: start*** Interface: arge1: done*** Interface: wlan0: sta= rtwlan0: Ethernet address: 00:15:6d:dc:2e:f3ar5416PerCalibrationN: NF calib= ration didn't finish=3B delaying > CCA*** Interface: wlan0: done*** Interface: bridge0: startbridge0: Ethe= rnet address: 02:32:ce:f5:ba:d0wlan0: promiscuous mode enabledbridge0: link= state changed to UParge1: promiscuous mode enabled*** Interface: bridge0: = done*** inetd*** Done! > FreeBSD/mips (freebsd-wifi-build) (ttyu0) > login:=20 > =20 > _______________________________________________ > freebsd-embedded@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-embedded > To unsubscribe=2C send any mail to "freebsd-embedded-unsubscribe@freebsd.= org" = From owner-freebsd-embedded@FreeBSD.ORG Fri Jan 9 02:57:48 2015 Return-Path: Delivered-To: freebsd-embedded@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 41BD6577 for ; Fri, 9 Jan 2015 02:57:48 +0000 (UTC) Received: from mail-qg0-x233.google.com (mail-qg0-x233.google.com [IPv6:2607:f8b0:400d:c04::233]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 10429CC for ; Fri, 9 Jan 2015 02:57:47 +0000 (UTC) Received: by mail-qg0-f51.google.com with SMTP id i50so6296265qgf.10 for ; Thu, 08 Jan 2015 18:57:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=b0JmDnYS3rAVyUzmEop4jpqWcW/YsgQVCXbbjhGn2pw=; b=iluRnhRg8HFj0gAm9fdULlWwnykkXto9mo0k15sxBRZqyoVaiguyh9+1/TUCM1R3tG ROIBFP6aSuYLQ9nU5XdePeWMH0QAt9wgC27DXkEdyso4qmBUG/XdNEP5fY/FgJW6PiQJ 2r5Vr9uagxbvymgdsh7d/ZRdtJ3TE6N9sb3itWCbQ3oYJWP71ohO3+AjprQgZf61qw2s HPKx4UtyIr+rkopwQr8BF/E3daMUkvincjBmlIzCDwTbLUFix9zER55EPH3VM9yapq0e NHkElEkvq4fMeGE8ZrRMcLAjHDsJnqIcq4wUFGOCYeAoCFG3eW5wXjbJEDIndjxKMbEU zBvg== MIME-Version: 1.0 X-Received: by 10.229.197.129 with SMTP id ek1mr12768227qcb.8.1420772267114; Thu, 08 Jan 2015 18:57:47 -0800 (PST) Sender: hiren.panchasara@gmail.com Received: by 10.96.73.69 with HTTP; Thu, 8 Jan 2015 18:57:47 -0800 (PST) In-Reply-To: References: Date: Thu, 8 Jan 2015 18:57:47 -0800 X-Google-Sender-Auth: 5EE0QQ1tQftqI-iu3dPW-yXboZU Message-ID: Subject: Re: Ubiquiti Bullet M (and Rocket M) From: hiren panchasara To: Michael Vale Content-Type: text/plain; charset=UTF-8 Cc: "freebsd-embedded@freebsd.org" X-BeenThere: freebsd-embedded@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Dedicated and Embedded Systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Jan 2015 02:57:48 -0000 On Thu, Jan 8, 2015 at 6:38 PM, Michael Vale wrote: > Adrian just noted that the random module must be compiled into the kernel. I've confirmed it works, so if somebody wants to add device random to PICOSTATION_M2HP kernel config that'd be sweet. I'll add "device random" to its parent AR724X_BASE as apparently others will also need it. Did arge0 attach? if not, you may need to map your mtdparts to the hints correctly. cheers, Hiren From owner-freebsd-embedded@FreeBSD.ORG Fri Jan 9 05:58:54 2015 Return-Path: Delivered-To: freebsd-embedded@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 41851C5C for ; Fri, 9 Jan 2015 05:58:54 +0000 (UTC) Received: from COL004-OMC1S11.hotmail.com (col004-omc1s11.hotmail.com [65.55.34.21]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (Client CN "*.outlook.com", Issuer "MSIT Machine Auth CA 2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1F7E0331 for ; Fri, 9 Jan 2015 05:58:54 +0000 (UTC) Received: from COL130-W64 ([65.55.34.9]) by COL004-OMC1S11.hotmail.com over TLS secured channel with Microsoft SMTPSVC(7.5.7601.22751); Thu, 8 Jan 2015 21:57:48 -0800 X-TMN: [lQN+pFf+6s77qsLDnyDXLEQQi7TaRRJ0YDy1EoTteBs=] X-Originating-Email: [m.vale@live.com.au] Message-ID: From: Michael Vale To: "freebsd-embedded@freebsd.org" Subject: FW: Ubiquiti Bullet M (and Rocket M) Date: Fri, 9 Jan 2015 16:57:48 +1100 Importance: Normal In-Reply-To: References: , , , MIME-Version: 1.0 X-OriginalArrivalTime: 09 Jan 2015 05:57:48.0444 (UTC) FILETIME=[323815C0:01D02BD1] Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.18-1 X-BeenThere: freebsd-embedded@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Dedicated and Embedded Systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Jan 2015 05:58:54 -0000 From: m.vale@live.com.au To: hiren@freebsd.org Subject: RE: Ubiquiti Bullet M (and Rocket M) Date: Fri=2C 9 Jan 2015 16:38:46 +1100 =0A= =0A= =0A= okay=2C i got arge0 to attach=2C i submitted a pull request on github. > Date: Thu=2C 8 Jan 2015 18:57:47 -0800 > Subject: Re: Ubiquiti Bullet M (and Rocket M) > From: hiren@FreeBSD.org > To: m.vale@live.com.au > CC: freebsd-embedded@freebsd.org >=20 > On Thu=2C Jan 8=2C 2015 at 6:38 PM=2C Michael Vale w= rote: > > Adrian just noted that the random module must be compiled into the kern= el. I've confirmed it works=2C so if somebody wants to add device random t= o PICOSTATION_M2HP kernel config that'd be sweet. >=20 > I'll add "device random" to its parent AR724X_BASE as apparently > others will also need it. >=20 > Did arge0 attach? if not=2C you may need to map your mtdparts to the > hints correctly. >=20 > cheers=2C > Hiren = From owner-freebsd-embedded@FreeBSD.ORG Fri Jan 9 07:17:55 2015 Return-Path: Delivered-To: freebsd-embedded@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E0B968DC for ; Fri, 9 Jan 2015 07:17:55 +0000 (UTC) Received: from mail-qc0-x231.google.com (mail-qc0-x231.google.com [IPv6:2607:f8b0:400d:c01::231]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 98DCFC2C for ; Fri, 9 Jan 2015 07:17:55 +0000 (UTC) Received: by mail-qc0-f177.google.com with SMTP id x3so7026104qcv.8 for ; Thu, 08 Jan 2015 23:17:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=89uywZhv8Va9oBIbPBj5CinpCFaJwScqXHkAknQs2F4=; b=b9YuEgTTqcLLExpsfnz5NvKtwBMN9fUEDB2NegWbobiF29B9UM2kOdCfMTRf1NVaJR 33FMfWKKaOChkv3dcO2PIMmb61VI/oSQiV6fotWMK9Y2SvEmM3+Moq5f2TYgxfiSey5/ +F/PW5SlbPIS5x9V5v6CXWJ8Wd6BWGw8mdsbDza3m8FbSs4scPNhg/Q1DFll2IwsnIl5 TSyKtYb0q2kSWvxxFlleTX22xL1aLPzCuMX1ABGSfDQzYgD0vVr3Wpci7OokEkeA07pl dNPqczBXj6rA055sNyoIOnhqOkXWjh54iPLCgbl7tKENuqQPGlCOjtYDPxfYl97iqpXL FvEw== MIME-Version: 1.0 X-Received: by 10.140.48.197 with SMTP id o63mr22676475qga.81.1420787874773; Thu, 08 Jan 2015 23:17:54 -0800 (PST) Sender: hiren.panchasara@gmail.com Received: by 10.96.73.69 with HTTP; Thu, 8 Jan 2015 23:17:54 -0800 (PST) In-Reply-To: References: Date: Thu, 8 Jan 2015 23:17:54 -0800 X-Google-Sender-Auth: EFhF5Loq-x8v1USmCmF7GlVD9-Q Message-ID: Subject: Re: FW: Ubiquiti Bullet M (and Rocket M) From: hiren panchasara To: Michael Vale Content-Type: text/plain; charset=UTF-8 Cc: "freebsd-embedded@freebsd.org" X-BeenThere: freebsd-embedded@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Dedicated and Embedded Systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Jan 2015 07:17:56 -0000 On Thu, Jan 8, 2015 at 9:57 PM, Michael Vale wrote: > > okay, i got arge0 to attach, i submitted a pull request on github. Cool, what was the problem? cheers, Hiren From owner-freebsd-embedded@FreeBSD.ORG Fri Jan 9 07:22:18 2015 Return-Path: Delivered-To: freebsd-embedded@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 378D3940; Fri, 9 Jan 2015 07:22:18 +0000 (UTC) Received: from COL004-OMC1S6.hotmail.com (col004-omc1s6.hotmail.com [65.55.34.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (Client CN "*.outlook.com", Issuer "MSIT Machine Auth CA 2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0F68BCD8; Fri, 9 Jan 2015 07:22:17 +0000 (UTC) Received: from COL130-W60 ([65.55.34.9]) by COL004-OMC1S6.hotmail.com over TLS secured channel with Microsoft SMTPSVC(7.5.7601.22751); Thu, 8 Jan 2015 23:21:11 -0800 X-TMN: [OXlYmBdqhTmT1rxy4hW/gZL5tnwTJh9E] X-Originating-Email: [m.vale@live.com.au] Message-ID: From: Michael Vale To: hiren panchasara Subject: RE: Ubiquiti Bullet M (and Rocket M) Date: Fri, 9 Jan 2015 18:21:11 +1100 Importance: Normal In-Reply-To: References: , , , , , MIME-Version: 1.0 X-OriginalArrivalTime: 09 Jan 2015 07:21:11.0592 (UTC) FILETIME=[D853E280:01D02BDC] Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.18-1 Cc: "freebsd-embedded@freebsd.org" X-BeenThere: freebsd-embedded@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Dedicated and Embedded Systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Jan 2015 07:22:18 -0000 the argemdio.0.maddr hint was set to arge1 not arge0 > Date: Thu=2C 8 Jan 2015 23:17:54 -0800 > Subject: Re: FW: Ubiquiti Bullet M (and Rocket M) > From: hiren@FreeBSD.org > To: m.vale@live.com.au > CC: freebsd-embedded@freebsd.org >=20 > On Thu=2C Jan 8=2C 2015 at 9:57 PM=2C Michael Vale w= rote: > > > > okay=2C i got arge0 to attach=2C i submitted a pull request on github. >=20 > Cool=2C what was the problem? >=20 > cheers=2C > Hiren = From owner-freebsd-embedded@FreeBSD.ORG Fri Jan 9 17:07:43 2015 Return-Path: Delivered-To: freebsd-embedded@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 261378E0 for ; Fri, 9 Jan 2015 17:07:43 +0000 (UTC) Received: from mail-la0-f45.google.com (mail-la0-f45.google.com [209.85.215.45]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 90B5EFC0 for ; Fri, 9 Jan 2015 17:07:42 +0000 (UTC) Received: by mail-la0-f45.google.com with SMTP id gq15so15585914lab.4 for ; Fri, 09 Jan 2015 09:07:40 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=tbW06j24Msk/hqcMjVgSIBtrUMnpecH0Uq5ubK2zwsw=; b=XEXfrm1ZiRY9VgftzrD7GB3UnOk5shcGXywfY1+z6GunTSCUG7yCW5VBZHAqYlUitp whmIDq6hj2sisnJEzOrFXMXvgV3OjRcpNmIE5fmwHLXxJW6W2UutCxak5uuO7XUyAG4c ol89ScokjtHGbFqQ3vXjoDCbmIasX50qgO+PQCMjkkrtLJhnf3q+Vp/l4WeoKWOCj6sw hh6VbhbO6S6vwLLAJdMf0J2t7ML1CmuLFHh/4lCAr3MN41FwtC+EE8PEfwt7gLUspHHn jYZX1e+H/Z4lAmTAnO1X3dSlj3o5M5LnVnQDXIHA17ASpqPx5WpK1Ss9H/7wwyN+6kGH NJeg== X-Gm-Message-State: ALoCoQkPGnLwrhOAXMskQDzW7STy0BgcunQt6sjUCAa/OH46eOCJB4GTrX++jrLhuNFOC2cqkLud MIME-Version: 1.0 X-Received: by 10.112.24.130 with SMTP id u2mr22471245lbf.57.1420823259891; Fri, 09 Jan 2015 09:07:39 -0800 (PST) Received: by 10.25.14.208 with HTTP; Fri, 9 Jan 2015 09:07:39 -0800 (PST) In-Reply-To: <20150108203959.GR42409@kib.kiev.ua> References: <20150108203959.GR42409@kib.kiev.ua> Date: Fri, 9 Jan 2015 18:07:39 +0100 Message-ID: Subject: Re: [PATCH] Add support for 64-bit AHCI BAR. From: =?UTF-8?Q?Micha=C5=82_Stanek?= To: Konstantin Belousov Content-Type: multipart/mixed; boundary=001a1134babcb1f795050c3b31f1 X-Content-Filtered-By: Mailman/MimeDel 2.1.18-1 Cc: freebsd-current@freebsd.org, freebsd-embedded@freebsd.org X-BeenThere: freebsd-embedded@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Dedicated and Embedded Systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Jan 2015 17:07:43 -0000 --001a1134babcb1f795050c3b31f1 Content-Type: text/plain; charset=UTF-8 2015-01-08 21:40 GMT+01:00 Konstantin Belousov : > > However, if > > AHCI uses 64-bit base addresses, then this register consists of two > dwords > > starting at offset 0x20 - BAR4 and BAR5. This is the case on our arm64 > > target and possibly other platforms using 64-bit BARs for AHCI. > Is it specified anywhere, or just a quirk of the specific implementation ? > If it is a quirk, would it make sense to also check the vendor or device > id before applying the logic ? > > Yes, indeed it is a quirk as I just found out that our platform vendor actually uses BAR(0) as AHCI ABAR, while BAR(4) is used for something else. I found it implemented as a quirk in Linux AHCI code. The BAR is still 64-bit but in a different position than AHCI spec stated. I changed it as you suggested, the new patch is in the attachment. Please take a look. > > > The following patch adds a check for the extended BAR in > ahci_pci_attach() > > and sets the 'rid' in bus_alloc_resource_any accordingly. It fixes the > > allocation error on our platform. > > > > Please review and test this patch on other platforms. If there are no > > issues then it will be committed in a week. > > > --001a1134babcb1f795050c3b31f1 Content-Type: text/x-patch; charset=US-ASCII; name="0001-Add-quirk-for-Cavium-AHCI-BAR-location.patch" Content-Disposition: attachment; filename="0001-Add-quirk-for-Cavium-AHCI-BAR-location.patch" Content-Transfer-Encoding: base64 X-Attachment-Id: f_i4pt4emp0 RnJvbSBiNjIyMDg4NGQ5ZTcxZDdjNGZjMWMyYTIyYWRlMzc0ZmMwMjNjODMxIE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBNaWNoYWwgU3RhbmVrIDxtc3RAc2VtaWhhbGYuY29tPgpEYXRl OiBGcmksIDkgSmFuIDIwMTUgMTc6MjA6MzggKzAxMDAKU3ViamVjdDogW1BBVENIXSBBZGQgcXVp cmsgZm9yIENhdml1bSBBSENJIEJBUiBsb2NhdGlvbgoKLS0tCiBzeXMvZGV2L2FoY2kvYWhjaV9w Y2kuYyB8IDkgKysrLS0tLS0tCiAxIGZpbGUgY2hhbmdlZCwgMyBpbnNlcnRpb25zKCspLCA2IGRl bGV0aW9ucygtKQoKZGlmZiAtLWdpdCBhL3N5cy9kZXYvYWhjaS9haGNpX3BjaS5jIGIvc3lzL2Rl di9haGNpL2FoY2lfcGNpLmMKaW5kZXggNDM3MjNhNi4uZGNlNGFjYiAxMDA2NDQKLS0tIGEvc3lz L2Rldi9haGNpL2FoY2lfcGNpLmMKKysrIGIvc3lzL2Rldi9haGNpL2FoY2lfcGNpLmMKQEAgLTM3 Myw3ICszNzMsNiBAQCBhaGNpX3BjaV9hdHRhY2goZGV2aWNlX3QgZGV2KQogCWludAllcnJvciwg aTsKIAl1aW50MzJfdCBkZXZpZCA9IHBjaV9nZXRfZGV2aWQoZGV2KTsKIAl1aW50OF90IHJldmlk ID0gcGNpX2dldF9yZXZpZChkZXYpOwotCXN0cnVjdCBwY2lfbWFwICptYXA7CiAKIAlpID0gMDsK IAl3aGlsZSAoYWhjaV9pZHNbaV0uaWQgIT0gMCAmJgpAQCAtMzkyLDExICszOTEsOSBAQCBhaGNp X3BjaV9hdHRhY2goZGV2aWNlX3QgZGV2KQogCWN0bHItPnN1YnZlbmRvcmlkID0gcGNpX2dldF9z dWJ2ZW5kb3IoZGV2KTsKIAljdGxyLT5zdWJkZXZpY2VpZCA9IHBjaV9nZXRfc3ViZGV2aWNlKGRl dik7CiAKLQkvKiBBSENJIEJhc2UgQWRkcmVzcyBpcyBCQVIoNSkgYnkgZGVmYXVsdCwgdW5sZXNz IEJBUnMgYXJlIDY0LWJpdCAqLwotCW1hcCA9IHBjaV9maW5kX2JhcihkZXYsIFBDSVJfQkFSKDQp KTsKLQlpZiAobWFwICE9IE5VTEwgJiYKLQkgICAgKChtYXAtPnBtX3ZhbHVlICYgUENJTV9CQVJf TUVNX1RZUEUpID09IFBDSU1fQkFSX01FTV82NCkpCi0JCWN0bHItPnJfcmlkID0gUENJUl9CQVIo NCk7CisJLyogRGVmYXVsdCBBSENJIEJhc2UgQWRkcmVzcyBpcyBCQVIoNSksIENhdml1bSB1c2Vz IEJBUigwKSAqLworCWlmIChjdGxyLT52ZW5kb3JpZCA9PSAweDE3N2QgJiYgY3Rsci0+ZGV2aWNl aWQgPT0gMHhhMDFjKQorCQljdGxyLT5yX3JpZCA9IFBDSVJfQkFSKDApOwogCWVsc2UKIAkJY3Rs ci0+cl9yaWQgPSBQQ0lSX0JBUig1KTsKIAlpZiAoIShjdGxyLT5yX21lbSA9IGJ1c19hbGxvY19y ZXNvdXJjZV9hbnkoZGV2LCBTWVNfUkVTX01FTU9SWSwKLS0gCjIuMi4xCgo= --001a1134babcb1f795050c3b31f1-- From owner-freebsd-embedded@FreeBSD.ORG Fri Jan 9 17:27:22 2015 Return-Path: Delivered-To: freebsd-embedded@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 96763F25; Fri, 9 Jan 2015 17:27:22 +0000 (UTC) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 392A724E; Fri, 9 Jan 2015 17:27:22 +0000 (UTC) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.14.9/8.14.9) with ESMTP id t09HRGOp065236 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 9 Jan 2015 19:27:16 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.9.2 kib.kiev.ua t09HRGOp065236 Received: (from kostik@localhost) by tom.home (8.14.9/8.14.9/Submit) id t09HRFLV065235; Fri, 9 Jan 2015 19:27:15 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Fri, 9 Jan 2015 19:27:15 +0200 From: Konstantin Belousov To: Micha?? Stanek Subject: Re: [PATCH] Add support for 64-bit AHCI BAR. Message-ID: <20150109172715.GU42409@kib.kiev.ua> References: <20150108203959.GR42409@kib.kiev.ua> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.0 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on tom.home Cc: freebsd-current@freebsd.org, freebsd-embedded@freebsd.org X-BeenThere: freebsd-embedded@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Dedicated and Embedded Systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Jan 2015 17:27:22 -0000 On Fri, Jan 09, 2015 at 06:07:39PM +0100, Micha?? Stanek wrote: > 2015-01-08 21:40 GMT+01:00 Konstantin Belousov : > > > > However, if > > > AHCI uses 64-bit base addresses, then this register consists of two > > dwords > > > starting at offset 0x20 - BAR4 and BAR5. This is the case on our arm64 > > > target and possibly other platforms using 64-bit BARs for AHCI. > > Is it specified anywhere, or just a quirk of the specific implementation ? > > If it is a quirk, would it make sense to also check the vendor or device > > id before applying the logic ? > > > > > Yes, indeed it is a quirk as I just found out that our platform vendor > actually uses BAR(0) as AHCI ABAR, while BAR(4) is used for something else. > I found it implemented as a quirk in Linux AHCI code. > The BAR is still 64-bit but in a different position than AHCI spec stated. > I changed it as you suggested, the new patch is in the attachment. Please > take a look. This is probably technically correct (I am not AHCI code author), but note that we have more structured quirks mechanism than directly checking vendor and device id. Look at the ahci_ids table and the quirks member. Add a bit declaring the need of the quirk and test the bit, instead of the vendor/devid. > > > > > > The following patch adds a check for the extended BAR in > > ahci_pci_attach() > > > and sets the 'rid' in bus_alloc_resource_any accordingly. It fixes the > > > allocation error on our platform. > > > > > > Please review and test this patch on other platforms. If there are no > > > issues then it will be committed in a week. > > > > > > From b6220884d9e71d7c4fc1c2a22ade374fc023c831 Mon Sep 17 00:00:00 2001 > From: Michal Stanek > Date: Fri, 9 Jan 2015 17:20:38 +0100 > Subject: [PATCH] Add quirk for Cavium AHCI BAR location > > --- > sys/dev/ahci/ahci_pci.c | 9 +++------ > 1 file changed, 3 insertions(+), 6 deletions(-) > > diff --git a/sys/dev/ahci/ahci_pci.c b/sys/dev/ahci/ahci_pci.c > index 43723a6..dce4acb 100644 > --- a/sys/dev/ahci/ahci_pci.c > +++ b/sys/dev/ahci/ahci_pci.c > @@ -373,7 +373,6 @@ ahci_pci_attach(device_t dev) > int error, i; > uint32_t devid = pci_get_devid(dev); > uint8_t revid = pci_get_revid(dev); > - struct pci_map *map; > > i = 0; > while (ahci_ids[i].id != 0 && > @@ -392,11 +391,9 @@ ahci_pci_attach(device_t dev) > ctlr->subvendorid = pci_get_subvendor(dev); > ctlr->subdeviceid = pci_get_subdevice(dev); > > - /* AHCI Base Address is BAR(5) by default, unless BARs are 64-bit */ > - map = pci_find_bar(dev, PCIR_BAR(4)); > - if (map != NULL && > - ((map->pm_value & PCIM_BAR_MEM_TYPE) == PCIM_BAR_MEM_64)) > - ctlr->r_rid = PCIR_BAR(4); > + /* Default AHCI Base Address is BAR(5), Cavium uses BAR(0) */ > + if (ctlr->vendorid == 0x177d && ctlr->deviceid == 0xa01c) > + ctlr->r_rid = PCIR_BAR(0); > else > ctlr->r_rid = PCIR_BAR(5); > if (!(ctlr->r_mem = bus_alloc_resource_any(dev, SYS_RES_MEMORY, > -- > 2.2.1 >