From owner-freebsd-embedded@FreeBSD.ORG Sun Dec 4 00:29:18 2011 Return-Path: Delivered-To: freebsd-embedded@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A6983106566C; Sun, 4 Dec 2011 00:29:18 +0000 (UTC) (envelope-from stb@lassitu.de) Received: from gilb.zs64.net (gilb.zs64.net [IPv6:2001:470:1f0b:105e::1ea]) by mx1.freebsd.org (Postfix) with ESMTP id 13EFD8FC13; Sun, 4 Dec 2011 00:29:18 +0000 (UTC) Received: by gilb.zs64.net (Postfix, from stb@lassitu.de) id 46760110318; Sun, 4 Dec 2011 01:29:17 +0100 (CET) Mime-Version: 1.0 (Apple Message framework v1251.1) Content-Type: text/plain; charset=iso-8859-1 From: Stefan Bethke In-Reply-To: Date: Sun, 4 Dec 2011 01:29:16 +0100 Content-Transfer-Encoding: quoted-printable Message-Id: References: <68ABED76-CB1F-405A-8036-EC254F7511FA@lassitu.de> <3B3DB17D-BF87-40EE-B1C1-445F178E8844@lassitu.de> <86030CEE-6839-4B96-ACDC-2BA9AC1E4AE4@lassitu.de> <2D625CC9-A0E3-47AA-A504-CE8FB2F90245@lassitu.de> <203BF1C8-D528-40C9-8611-9C7AC7E43BAB@lassitu.de> <3C0E9CA3-E130-4E9A-ABCC-1782E28999D1@lassitu.de> <2B8826C7-00C7-4117-B424-4A86F1346DFF@bsdimp.com> <20111130231311.4a154bc5.ray@ddteam.net> <20111202164539.fff3ea91.ray@dlink.ua> <20111202191122.GK25601@funkthat.com> <2DB1EAFF-BFEA-4104-8F5A-E4D00BFDF8F9@lassitu.de> To: Adrian Chadd X-Mailer: Apple Mail (2.1251.1) Cc: Aleksandr Rybalko , freebsd-embedded@freebsd.org Subject: Re: TL-WR1043: switch X-BeenThere: freebsd-embedded@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Dedicated and Embedded Systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Dec 2011 00:29:18 -0000 Am 03.12.2011 um 22:36 schrieb Stefan Bethke: > Am 03.12.2011 um 16:47 schrieb Adrian Chadd: >=20 >> Hi, >>=20 >> Initial comments (yes, I broke my own rule..) >>=20 >> * Don't get rid of SCL_PIN / SDA_PIN: instead rename them to >> blah_PIN_DEFAULT, and use those defines instead of hardcoding 0 and = 1. >> I have a "thing" for avoiding hard-coded constants, and this makes it >> more obvious that those 0/1 values are pins rather than true/false. >> * We should break this out into separate diffs - let's focus right = now >> on fixing/extending the i2c bus code to work with the "strict" flag >> you've introduced. The rest of the diff is GPIO stuff. That way we >> can commit it in two parts. >=20 > = http://www.lassitu.de/freebsd/iicbus-optional-relaxed-bus-semantics.patch I've updated the patch. >> Stuff to look at later: >>=20 >> * The gpio default stuff is fine (but luis has send me some alternate >> hint code to look at too!) - however, the capabilities are either in >> or out. What about pullup, pulldown, etc? >=20 > I'd be happy to review and test luis' code. >=20 > The code that I added does instantiate each pin with DEFAULT_CAPS = (read and write), sets the name and sets the pin to either read or = write. =46rom ar71xx_gpio.c and ar71xxreg.h it seems that these devices = only support input and output and no other modes. My latest version of the patch is in = http://www.lassitu.de/freebsd/ar71xx_gpio-configure-by-hint.patch >=20 >> * Is there any way to make that "configure GPIO from hint" function >> generic? Or should we worry about that later on? (eg so the rt305x = CPU >> support from ray@ can also use this?) >=20 > sys/dev/gpio/gpiobus.c has no method to set the pin capabilities, only = to report the ones the underlying device offers. So every driver needs = to do it's confuration itself. The code itself certainly could be = factored out. >=20 >> And my final question: >>=20 >> Does this actually now work for mainipulating the switch phy? If so: >>=20 >> * how does it work; >=20 > I have a userland program that can read and write switch registers = (and PHY registers through that interface). See below. >=20 >> * do we get per-physical-switch-port statistics somehow? >=20 > They're there, and the OpenWrt driver has code to read them. I = haven't gotten round to implement that. >=20 >> * how do I tinker with it next week when I'm over in Melbourne, >> talking about this stuff to a group of researchers that want to use >> the 1043nd? :) With the code from tonight at = http://www.lassitu.de/freebsd/rtl8366ctl.tbz, and all three patches from = http://www.lassitu.de/freebsd/, I can do this: # rtl8366ctl info RTL8366RB rev: 3 MTU: 9216 Storm control: disabled VLAN: off # rtl8366ctl port port speed dupl neg. learn aging VLAN 0: 1000bT-FDX auto 0 1: 1000bT-FDX auto 0 2: no link 0 3: no link 0 4: no link 0 5: 1000bT-FDX 0 # rtl8366ctl phy info PHY EUI:ver.rev link caps 0 000732:22.1 100bTX-FDX 100bTX 10bTX-FDX 10bTX 1000bTX-FDX 1 000732:22.1 100bTX-FDX 100bTX 10bTX-FDX 10bTX 1000bTX-FDX 1000bTX 2 000732:22.1=20 3 000732:22.1=20 4 000732:22.1=20 # rtl8366ctl vlan VLAN VID PCP FID 0 1 2 3 4 5 0 1 0 0 # # # # # # =20 1 2 0 0 - - - - - - =20 2 3 0 0 - - - - - - =20 3 4 0 0 - - - - - - =20 4 5 0 0 - - - - - - =20 5 6 0 0 - - - - - - =20 6 7 0 0 - - - - - - =20 7 8 0 0 - - - - - - =20 8 9 0 0 - - - - - - =20 9 10 0 0 - - - - - - =20 10 11 0 0 - - - - - - =20 11 12 0 0 - - - - - - =20 12 13 0 0 - - - - - - =20 13 14 0 0 - - - - - - =20 14 15 0 0 - - - - - - =20 15 16 0 0 - - - - - - =20 This is with the power on default. I can now set up a sensible VLAN config for port 1-4 LAN, port 0 WAN and = port 5 (CPU) as member of LAN plus tagged member of WAN: # rtl8366ctl portvlan 0=3D1 0=3D1 # rtl8366ctl portvlan 5=3D0,1t 5=3D0,1t # rtl8366ctl vlan VLAN VID PCP FID 0 1 2 3 4 5 0 1 0 0 - # # # # # =20 1 2 0 0 # - - - - T =20 2 3 0 0 - - - - - - =20 3 4 0 0 - - - - - - =20 4 5 0 0 - - - - - - =20 5 6 0 0 - - - - - - =20 6 7 0 0 - - - - - - =20 7 8 0 0 - - - - - - =20 8 9 0 0 - - - - - - =20 9 10 0 0 - - - - - - =20 10 11 0 0 - - - - - - =20 11 12 0 0 - - - - - - =20 12 13 0 0 - - - - - - =20 13 14 0 0 - - - - - - =20 14 15 0 0 - - - - - - =20 15 16 0 0 - - - - - - =20 I've started looking into Alexsandrs code. I have a couple of = questions, but I think I can make my code work as a switch driver and = integrate it into that framework. Stefan --=20 Stefan Bethke Fon +49 151 14070811 From owner-freebsd-embedded@FreeBSD.ORG Sun Dec 4 00:39:40 2011 Return-Path: Delivered-To: freebsd-embedded@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 976481065670 for ; Sun, 4 Dec 2011 00:39:40 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-vx0-f182.google.com (mail-vx0-f182.google.com [209.85.220.182]) by mx1.freebsd.org (Postfix) with ESMTP id 4784C8FC13 for ; Sun, 4 Dec 2011 00:39:39 +0000 (UTC) Received: by vcbfk1 with SMTP id fk1so5057831vcb.13 for ; Sat, 03 Dec 2011 16:39:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; 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; bh=sfWL4g9dLPnM0+IOAkw2quF4eiYFC8wz5LPnhg+6cac=; b=qk8bvcUhMoMg2zg+XeYPmuKFnDWN4qPQy10Uns+5YM45xZSRrCpW9o1uXE0Tgidzme 4qiQHFkfvJzlBHB0SNLn5EERIOVYWgj37wO/oPNt6aJePJ6fQx0jxW5zZHe7UFzGuVXq U4ILMUa5exNWu0tSPaF60PM5H788LA8Qe2WyA= MIME-Version: 1.0 Received: by 10.52.66.35 with SMTP id c3mr2264435vdt.17.1322959179646; Sat, 03 Dec 2011 16:39:39 -0800 (PST) Sender: adrian.chadd@gmail.com Received: by 10.52.109.10 with HTTP; Sat, 3 Dec 2011 16:39:39 -0800 (PST) In-Reply-To: References: <68ABED76-CB1F-405A-8036-EC254F7511FA@lassitu.de> <3B3DB17D-BF87-40EE-B1C1-445F178E8844@lassitu.de> <86030CEE-6839-4B96-ACDC-2BA9AC1E4AE4@lassitu.de> <2D625CC9-A0E3-47AA-A504-CE8FB2F90245@lassitu.de> <203BF1C8-D528-40C9-8611-9C7AC7E43BAB@lassitu.de> <3C0E9CA3-E130-4E9A-ABCC-1782E28999D1@lassitu.de> <2B8826C7-00C7-4117-B424-4A86F1346DFF@bsdimp.com> <20111130231311.4a154bc5.ray@ddteam.net> <20111202164539.fff3ea91.ray@dlink.ua> <20111202191122.GK25601@funkthat.com> <2DB1EAFF-BFEA-4104-8F5A-E4D00BFDF8F9@lassitu.de> Date: Sun, 4 Dec 2011 08:39:39 +0800 X-Google-Sender-Auth: co4BTO27bQzb-SWYf3BdvxdYt_8 Message-ID: From: Adrian Chadd To: Stefan Bethke Content-Type: text/plain; charset=ISO-8859-1 Cc: Aleksandr Rybalko , freebsd-embedded@freebsd.org Subject: Re: TL-WR1043: switch X-BeenThere: freebsd-embedded@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Dedicated and Embedded Systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Dec 2011 00:39:40 -0000 Wow, very cool, thanks! It's tempting to leave this stuff as userland for now, as there's likely all kinds of strange knobs which are very platform dependent. But then we can't leverage it for other bits of the system (eg if later on we want to support some of the NAT/PPTP/ACL offloading some of these switch phys support.) (And I know ray will slap me for that, as I think he also has a userland program available to do PHY register twiddling.. :) Still, having a standalone program too in order to do debugging is great, so thanks! Adrian From owner-freebsd-embedded@FreeBSD.ORG Sun Dec 4 02:06:04 2011 Return-Path: Delivered-To: freebsd-embedded@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 54360106566B for ; Sun, 4 Dec 2011 02:06:04 +0000 (UTC) (envelope-from wblock@wonkity.com) Received: from wonkity.com (wonkity.com [67.158.26.137]) by mx1.freebsd.org (Postfix) with ESMTP id F2DC08FC0A for ; Sun, 4 Dec 2011 02:06:03 +0000 (UTC) Received: from wonkity.com (localhost [127.0.0.1]) by wonkity.com (8.14.5/8.14.5) with ESMTP id pB4263up043786 for ; Sat, 3 Dec 2011 19:06:03 -0700 (MST) (envelope-from wblock@wonkity.com) Received: from localhost (wblock@localhost) by wonkity.com (8.14.5/8.14.5/Submit) with ESMTP id pB42630a043783 for ; Sat, 3 Dec 2011 19:06:03 -0700 (MST) (envelope-from wblock@wonkity.com) Date: Sat, 3 Dec 2011 19:06:03 -0700 (MST) From: Warren Block To: freebsd-embedded@freebsd.org Message-ID: User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; format=flowed; charset=US-ASCII X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.7 (wonkity.com [127.0.0.1]); Sat, 03 Dec 2011 19:06:03 -0700 (MST) Subject: RFT: Arduino 1.0 X-BeenThere: freebsd-embedded@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Dedicated and Embedded Systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Dec 2011 02:06:04 -0000 https://github.com/wblock/Arduino-port-for-FreeBSD has the updated port for Arduino 1.0. Only cursory testing done, but no problems noticed yet. If no problems are reported, I'll enter a PR for it in a few days. From owner-freebsd-embedded@FreeBSD.ORG Sun Dec 4 11:56:48 2011 Return-Path: Delivered-To: freebsd-embedded@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 02648106566B for ; Sun, 4 Dec 2011 11:56:48 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-iy0-f182.google.com (mail-iy0-f182.google.com [209.85.210.182]) by mx1.freebsd.org (Postfix) with ESMTP id C193D8FC13 for ; Sun, 4 Dec 2011 11:56:47 +0000 (UTC) Received: by iafi7 with SMTP id i7so2038462iaf.13 for ; Sun, 04 Dec 2011 03:56:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; 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; bh=fDL3k9ynJSX/R8pymvxpz+xhsn/IeZkCK+e7OW4sTbI=; b=JFi9N0qNSAeyjcDcpfW752bVaxCrucUEJCqpugyCgAJpMFWWFpeAo9uQK/1JdZxQEc /Hn3zpRUOarf4ONYeBLa0n4k2MrvxLsHUJW/AnldI+ZKJ7RbkPhVnnTjr+J4qaSQMfky fZiNDV1A43f9WW1Hp1NZ0yEuqM46qZRAkhoFc= MIME-Version: 1.0 Received: by 10.50.42.166 with SMTP id p6mr6002249igl.17.1322999807123; Sun, 04 Dec 2011 03:56:47 -0800 (PST) Sender: adrian.chadd@gmail.com Received: by 10.50.42.196 with HTTP; Sun, 4 Dec 2011 03:56:47 -0800 (PST) In-Reply-To: <3C0E9CA3-E130-4E9A-ABCC-1782E28999D1@lassitu.de> References: <68ABED76-CB1F-405A-8036-EC254F7511FA@lassitu.de> <3B3DB17D-BF87-40EE-B1C1-445F178E8844@lassitu.de> <86030CEE-6839-4B96-ACDC-2BA9AC1E4AE4@lassitu.de> <2D625CC9-A0E3-47AA-A504-CE8FB2F90245@lassitu.de> <203BF1C8-D528-40C9-8611-9C7AC7E43BAB@lassitu.de> <3C0E9CA3-E130-4E9A-ABCC-1782E28999D1@lassitu.de> Date: Sun, 4 Dec 2011 19:56:47 +0800 X-Google-Sender-Auth: 7Zx3sXZqw9c_LBFEi-ymQ3VMsWw Message-ID: From: Adrian Chadd To: Stefan Bethke Content-Type: text/plain; charset=ISO-8859-1 Cc: freebsd-embedded@freebsd.org Subject: Re: TL-WR1043: switch X-BeenThere: freebsd-embedded@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Dedicated and Embedded Systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Dec 2011 11:56:48 -0000 Hi, I've committed the i2c bus change in r228257. Thanks! Next - let's allow the iicbus pins to be overridden; would you please submit a patch which implements that part of your work? Then the only bits that are left are the GPIO bits. Thanks, Adrian From owner-freebsd-embedded@FreeBSD.ORG Sun Dec 4 12:02:13 2011 Return-Path: Delivered-To: freebsd-embedded@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 360CC1065677; Sun, 4 Dec 2011 12:02:13 +0000 (UTC) (envelope-from stb@lassitu.de) Received: from gilb.zs64.net (gilb.zs64.net [IPv6:2001:470:1f0b:105e::1ea]) by mx1.freebsd.org (Postfix) with ESMTP id EEE0A8FC1F; Sun, 4 Dec 2011 12:02:12 +0000 (UTC) Received: by gilb.zs64.net (Postfix, from stb@lassitu.de) id E2D3111410A; Sun, 4 Dec 2011 13:02:11 +0100 (CET) Mime-Version: 1.0 (Apple Message framework v1251.1) Content-Type: text/plain; charset=iso-8859-1 From: Stefan Bethke In-Reply-To: Date: Sun, 4 Dec 2011 13:02:11 +0100 Content-Transfer-Encoding: 7bit Message-Id: <6387ABA5-AC55-49DD-9058-E45CC0A3E0A0@lassitu.de> References: <68ABED76-CB1F-405A-8036-EC254F7511FA@lassitu.de> <3B3DB17D-BF87-40EE-B1C1-445F178E8844@lassitu.de> <86030CEE-6839-4B96-ACDC-2BA9AC1E4AE4@lassitu.de> <2D625CC9-A0E3-47AA-A504-CE8FB2F90245@lassitu.de> <203BF1C8-D528-40C9-8611-9C7AC7E43BAB@lassitu.de> <3C0E9CA3-E130-4E9A-ABCC-1782E28999D1@lassitu.de> To: Adrian Chadd X-Mailer: Apple Mail (2.1251.1) Cc: freebsd-embedded@freebsd.org Subject: Re: TL-WR1043: switch X-BeenThere: freebsd-embedded@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Dedicated and Embedded Systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Dec 2011 12:02:13 -0000 Am 04.12.2011 um 12:56 schrieb Adrian Chadd: > Hi, > > I've committed the i2c bus change in r228257. Thanks! Thank you! > Next - let's allow the iicbus pins to be overridden; would you please > submit a patch which implements that part of your work? http://www.lassitu.de/freebsd/gpioiic-hint-for-scl-sda-pins.patch Stefan -- Stefan Bethke Fon +49 151 14070811 From owner-freebsd-embedded@FreeBSD.ORG Sun Dec 4 12:11:07 2011 Return-Path: Delivered-To: freebsd-embedded@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 820851065672 for ; Sun, 4 Dec 2011 12:11:07 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-iy0-f182.google.com (mail-iy0-f182.google.com [209.85.210.182]) by mx1.freebsd.org (Postfix) with ESMTP id 4B3ED8FC24 for ; Sun, 4 Dec 2011 12:11:06 +0000 (UTC) Received: by iafi7 with SMTP id i7so2057608iaf.13 for ; Sun, 04 Dec 2011 04:11:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; 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; bh=dgIG65BcsvZwv9ukNC5Gs4YQqj+zbMpk79v0OpvWoZk=; b=FxlAAJSP8A53esSkLu4OunT0tiWqUjyEAknJvXZzNahKQtqXXkPFWjPki3QoQa6iEP q5UFoRo5+FJzvNfCnBwdo2fNYHRFBlHNgbhjhiajT6cdtA4LNnNxQ4rYPf+PNY0AA7LD Uzt5ni5gK6/Onj17Rvz/nSAtpaYUWLjTfXfl8= MIME-Version: 1.0 Received: by 10.231.61.210 with SMTP id u18mr1362427ibh.86.1323000665941; Sun, 04 Dec 2011 04:11:05 -0800 (PST) Sender: adrian.chadd@gmail.com Received: by 10.50.42.196 with HTTP; Sun, 4 Dec 2011 04:11:05 -0800 (PST) In-Reply-To: <6387ABA5-AC55-49DD-9058-E45CC0A3E0A0@lassitu.de> References: <68ABED76-CB1F-405A-8036-EC254F7511FA@lassitu.de> <3B3DB17D-BF87-40EE-B1C1-445F178E8844@lassitu.de> <86030CEE-6839-4B96-ACDC-2BA9AC1E4AE4@lassitu.de> <2D625CC9-A0E3-47AA-A504-CE8FB2F90245@lassitu.de> <203BF1C8-D528-40C9-8611-9C7AC7E43BAB@lassitu.de> <3C0E9CA3-E130-4E9A-ABCC-1782E28999D1@lassitu.de> <6387ABA5-AC55-49DD-9058-E45CC0A3E0A0@lassitu.de> Date: Sun, 4 Dec 2011 20:11:05 +0800 X-Google-Sender-Auth: 0Y7miT-qHlwVKAqxqUq3ekw4Leo Message-ID: From: Adrian Chadd To: Stefan Bethke Content-Type: text/plain; charset=ISO-8859-1 Cc: freebsd-embedded@freebsd.org Subject: Re: TL-WR1043: switch X-BeenThere: freebsd-embedded@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Dedicated and Embedded Systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Dec 2011 12:11:07 -0000 On 4 December 2011 20:02, Stefan Bethke wrote: >> Next - let's allow the iicbus pins to be overridden; would you please >> submit a patch which implements that part of your work? > > http://www.lassitu.de/freebsd/gpioiic-hint-for-scl-sda-pins.patch Committed in r228258. Thanks! I'll see if I can give this a run on Wednesday sometime; otherwise I won't be able to really thoroughly test all of this stuff until mid-December. Thankyou again! Adrian From owner-freebsd-embedded@FreeBSD.ORG Sun Dec 4 12:14:35 2011 Return-Path: Delivered-To: freebsd-embedded@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BEACB106564A for ; Sun, 4 Dec 2011 12:14:35 +0000 (UTC) (envelope-from stb@lassitu.de) Received: from gilb.zs64.net (gilb.zs64.net [IPv6:2001:470:1f0b:105e::1ea]) by mx1.freebsd.org (Postfix) with ESMTP id 8AB2A8FC0C for ; Sun, 4 Dec 2011 12:14:35 +0000 (UTC) Received: by gilb.zs64.net (Postfix, from stb@lassitu.de) id D7BE71148C6 for ; Sun, 4 Dec 2011 13:14:34 +0100 (CET) From: Stefan Bethke Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Date: Sun, 4 Dec 2011 13:14:34 +0100 Message-Id: To: freebsd-embedded@freebsd.org Mime-Version: 1.0 (Apple Message framework v1251.1) X-Mailer: Apple Mail (2.1251.1) Subject: ar71xx_gpio.c touches SPI_CS1 and 2? X-BeenThere: freebsd-embedded@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Dedicated and Embedded Systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Dec 2011 12:14:35 -0000 I was looking into why I can't manipulate the USB led on my TL-WR1043ND, = and came across the SPI chip selects, which share GPIO 0 and 1, = respectively. The USB led is hooked up to GPIO 1. sys/mips/atheros/ar71xx_gpio.c:ar71xx_gpio_attach(device_t dev) enables = both chip selects, and detach disables them again. Two points: - how can we express different uses for those two pins on a per-board = config? - disabling the function is not correct for the gpio driver, I would = think. If you load and unload it as a module, I expect losing access to = the flash. Stefan --=20 Stefan Bethke Fon +49 151 14070811 From owner-freebsd-embedded@FreeBSD.ORG Sun Dec 4 13:01:33 2011 Return-Path: Delivered-To: freebsd-embedded@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 28C5E1065688 for ; Sun, 4 Dec 2011 13:01:33 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-iy0-f182.google.com (mail-iy0-f182.google.com [209.85.210.182]) by mx1.freebsd.org (Postfix) with ESMTP id EA3E08FC08 for ; Sun, 4 Dec 2011 13:01:32 +0000 (UTC) Received: by iafi7 with SMTP id i7so2120386iaf.13 for ; Sun, 04 Dec 2011 05:01:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; 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; bh=Rzy05RHR1E7+l2qOSWG6eZYlNwAfRIPO2lxMKGAfL0Q=; b=beEIInmoS+8FZXTUi173Ri49jGdUmPFrqqCI5Uuo4EUcLiKK91xO6CFsCV1lyyliAN 1LhtmdjQZGKeldFqAAq0NIkkeGH2BI8yGHTsjuF7Ft+DGEyG0e/mBFEHo4Wm3tsie4yt 4M8N5wWWJ1+lnZzLkonD/qZZEQURU/ASC1X7s= MIME-Version: 1.0 Received: by 10.42.161.10 with SMTP id r10mr5952442icx.22.1323003692254; Sun, 04 Dec 2011 05:01:32 -0800 (PST) Sender: adrian.chadd@gmail.com Received: by 10.50.42.196 with HTTP; Sun, 4 Dec 2011 05:01:32 -0800 (PST) In-Reply-To: References: Date: Sun, 4 Dec 2011 21:01:32 +0800 X-Google-Sender-Auth: pyaE9thlqhfeWGVhVqUcOSrdPsA Message-ID: From: Adrian Chadd To: Stefan Bethke Content-Type: text/plain; charset=ISO-8859-1 Cc: freebsd-embedded@freebsd.org Subject: Re: ar71xx_gpio.c touches SPI_CS1 and 2? X-BeenThere: freebsd-embedded@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Dedicated and Embedded Systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Dec 2011 13:01:33 -0000 Well, the real question is whether the SPI CS pins are actually the ones being used or not. I'm pretty sure the SPI flash is actually being talked to via bitbanged GPIO, rather than the actual ar71xx/ar91xx SPI interface. So those chip selects aren't strictly needed. They may be needed for the mikrotik routerboard's though, I recall gonzo@ talking about something like that. I think we can just work around this by having a boot-time machine dependent "function mask" hint which we set to define which on-board peripherals are enabled. It can be machdep rather than generic, as we'd likely set it up early - eg, ar71xx_machdep.c::platform_start(). The only downside which i haven't yet thought through is whether to: * just write a raw value to the function register, which means we would override whatever the bootloader revision says; or * have two hints - one "clear these bits" and one "set these bits" in the GPIO function register, so we can override what the bootloader code does at startup. That way if it, for example, initialises the sound pins, we don't have to know that unless we want to use the GPIO pins shared by the sound interface. How's that sound? Too dirty? :) Adrian From owner-freebsd-embedded@FreeBSD.ORG Sun Dec 4 13:59:07 2011 Return-Path: Delivered-To: freebsd-embedded@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B9CB7106564A; Sun, 4 Dec 2011 13:59:07 +0000 (UTC) (envelope-from stb@lassitu.de) Received: from gilb.zs64.net (gilb.zs64.net [IPv6:2001:470:1f0b:105e::1ea]) by mx1.freebsd.org (Postfix) with ESMTP id 81F928FC0C; Sun, 4 Dec 2011 13:59:07 +0000 (UTC) Received: by gilb.zs64.net (Postfix, from stb@lassitu.de) id B4E3BAC6DC; Sun, 4 Dec 2011 14:59:06 +0100 (CET) Mime-Version: 1.0 (Apple Message framework v1251.1) Content-Type: text/plain; charset=windows-1252 From: Stefan Bethke In-Reply-To: Date: Sun, 4 Dec 2011 14:59:05 +0100 Content-Transfer-Encoding: quoted-printable Message-Id: <7FF1FBB8-2A6B-49E1-88ED-E46ED23DAD87@lassitu.de> References: To: Adrian Chadd X-Mailer: Apple Mail (2.1251.1) Cc: freebsd-embedded@freebsd.org Subject: Re: ar71xx_gpio.c touches SPI_CS1 and 2? X-BeenThere: freebsd-embedded@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Dedicated and Embedded Systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Dec 2011 13:59:07 -0000 Am 04.12.2011 um 14:01 schrieb Adrian Chadd: > Well, the real question is whether the SPI CS pins are actually the > ones being used or not. I'll try and break CS1 and see what happens=85 > I'm pretty sure the SPI flash is actually being talked to via > bitbanged GPIO, rather than the actual ar71xx/ar91xx SPI interface. > So those chip selects aren't strictly needed. I couldn't tell. The register definitions in ar71xxreg.h seem to = indicate that there is hardware support for SPI, and that CS1 and CS2 = (but not CS0) share the pins with GPIO, but looking at the code in = ar71xx_spi.c seems to do bit banging for transmit and register read for = reception. Does the SPI support only have a shift register for = reception? > They may be needed for the mikrotik routerboard's though, I recall > gonzo@ talking about something like that. >=20 > I think we can just work around this by having a boot-time machine > dependent "function mask" hint which we set to define which on-board > peripherals are enabled. > It can be machdep rather than generic, as we'd likely set it up early > - eg, ar71xx_machdep.c::platform_start(). >=20 > The only downside which i haven't yet thought through is whether to: >=20 > * just write a raw value to the function register, which means we > would override whatever the bootloader revision says; or > * have two hints - one "clear these bits" and one "set these bits" in > the GPIO function register, so we can override what the bootloader > code does at startup. That way if it, for example, initialises the > sound pins, we don't have to know that unless we want to use the GPIO > pins shared by the sound interface. >=20 > How's that sound? Too dirty? :) Hhm. How about the ar71xx_spi.c driver claiming CS0 and optionally CS1 and = CS2 (again via hint?), and setting the GPIO function bits accordingly? = Or only activate CS1 and CS2 if we have SPI bus children that claim = them? Stefan --=20 Stefan Bethke Fon +49 151 14070811 From owner-freebsd-embedded@FreeBSD.ORG Sun Dec 4 17:21:53 2011 Return-Path: Delivered-To: freebsd-embedded@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5A300106566C for ; Sun, 4 Dec 2011 17:21:53 +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 117B38FC17 for ; Sun, 4 Dec 2011 17:21:52 +0000 (UTC) Received: from [10.0.0.150] (150.imp.bsdimp.com [10.0.0.150] (may be forged)) (authenticated bits=0) by harmony.bsdimp.com (8.14.4/8.14.3) with ESMTP id pB4HJtEs032243 (version=TLSv1/SSLv3 cipher=DHE-DSS-AES128-SHA bits=128 verify=NO); Sun, 4 Dec 2011 10:19:58 -0700 (MST) (envelope-from imp@bsdimp.com) Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii From: Warner Losh In-Reply-To: Date: Sun, 4 Dec 2011 10:19:53 -0700 Content-Transfer-Encoding: quoted-printable Message-Id: <2B6F6CAC-F4EF-4958-A435-579A69862AE5@bsdimp.com> References: To: Stefan Bethke X-Mailer: Apple Mail (2.1084) X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (harmony.bsdimp.com [10.0.0.6]); Sun, 04 Dec 2011 10:19:58 -0700 (MST) Cc: freebsd-embedded@FreeBSD.org Subject: Re: ar71xx_gpio.c touches SPI_CS1 and 2? X-BeenThere: freebsd-embedded@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Dedicated and Embedded Systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Dec 2011 17:21:53 -0000 On Dec 4, 2011, at 5:14 AM, Stefan Bethke wrote: > I was looking into why I can't manipulate the USB led on my = TL-WR1043ND, and came across the SPI chip selects, which share GPIO 0 = and 1, respectively. The USB led is hooked up to GPIO 1. >=20 > sys/mips/atheros/ar71xx_gpio.c:ar71xx_gpio_attach(device_t dev) = enables both chip selects, and detach disables them again. >=20 > Two points: >=20 > - how can we express different uses for those two pins on a per-board = config? >=20 > - disabling the function is not correct for the gpio driver, I would = think. If you load and unload it as a module, I expect losing access to = the flash. When I was looking into this question for the Atmel chips, I was torn. = On the one hand, it would be nice if there was a pin mux device. On the = other hand, it didn't map well into the device model. I finally settled = on having per-board functions that setup the pins. This is also the = model followed by linux. Either the boot loader or the board-dependent = code would do the setup. Warner From owner-freebsd-embedded@FreeBSD.ORG Sun Dec 4 23:16:47 2011 Return-Path: Delivered-To: embedded@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7548C106566B for ; Sun, 4 Dec 2011 23:16:47 +0000 (UTC) (envelope-from stb@lassitu.de) Received: from gilb.zs64.net (gilb.zs64.net [IPv6:2001:470:1f0b:105e::1ea]) by mx1.freebsd.org (Postfix) with ESMTP id 3FB558FC16 for ; Sun, 4 Dec 2011 23:16:47 +0000 (UTC) Received: by gilb.zs64.net (Postfix, from stb@lassitu.de) id B5627114647; Mon, 5 Dec 2011 00:16:45 +0100 (CET) Mime-Version: 1.0 (Apple Message framework v1251.1) Content-Type: text/plain; charset=us-ascii From: Stefan Bethke In-Reply-To: <20111110014904.0e8caf2c.ray@ddteam.net> Date: Mon, 5 Dec 2011 00:16:45 +0100 Content-Transfer-Encoding: quoted-printable Message-Id: <2B013790-6DB4-4E1A-857C-5EC39F4F71C9@lassitu.de> References: <20111110014904.0e8caf2c.ray@ddteam.net> To: Aleksandr Rybalko X-Mailer: Apple Mail (2.1251.1) Cc: embedded@freebsd.org Subject: Re: Ethernet switch framework X-BeenThere: freebsd-embedded@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Dedicated and Embedded Systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Dec 2011 23:16:47 -0000 Hi Alexsandr, I'v now created a driver for my RTL8366RB, and I can load and unload it, = and have it initialize the switch. I've tried to understand how the pieces fit together in your switch = framework, and how I would integrate my driver with it. Any chance you = could give me quick run through how the userland device, the switch bus = and the individual switch drivers are talking to each other? Thanks, Stefan --=20 Stefan Bethke Fon +49 151 14070811 From owner-freebsd-embedded@FreeBSD.ORG Sun Dec 4 23:22:57 2011 Return-Path: Delivered-To: freebsd-embedded@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C78C2106566B for ; Sun, 4 Dec 2011 23:22:57 +0000 (UTC) (envelope-from stb@lassitu.de) Received: from gilb.zs64.net (gilb.zs64.net [IPv6:2001:470:1f0b:105e::1ea]) by mx1.freebsd.org (Postfix) with ESMTP id 87E8F8FC0A for ; Sun, 4 Dec 2011 23:22:57 +0000 (UTC) Received: by gilb.zs64.net (Postfix, from stb@lassitu.de) id C8DAF114691 for ; Mon, 5 Dec 2011 00:22:56 +0100 (CET) Content-Type: text/plain; charset=windows-1252 Mime-Version: 1.0 (Apple Message framework v1251.1) From: Stefan Bethke In-Reply-To: Date: Mon, 5 Dec 2011 00:22:56 +0100 Content-Transfer-Encoding: quoted-printable Message-Id: References: <68ABED76-CB1F-405A-8036-EC254F7511FA@lassitu.de> <3B3DB17D-BF87-40EE-B1C1-445F178E8844@lassitu.de> <86030CEE-6839-4B96-ACDC-2BA9AC1E4AE4@lassitu.de> <2D625CC9-A0E3-47AA-A504-CE8FB2F90245@lassitu.de> <203BF1C8-D528-40C9-8611-9C7AC7E43BAB@lassitu.de> <3C0E9CA3-E130-4E9A-ABCC-1782E28999D1@lassitu.de> <6387ABA5-AC55-49DD-9058-E45CC0A3E0A0@lassitu.de> To: freebsd-embedded@freebsd.org X-Mailer: Apple Mail (2.1251.1) Subject: Re: TL-WR1043: switch X-BeenThere: freebsd-embedded@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Dedicated and Embedded Systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Dec 2011 23:22:57 -0000 Limping along=85 You can find a first version of a kernel driver at http://www.lassitu.de/freebsd/rtl8366rb.c http://www.lassitu.de/freebsd/rtl8366rbvar.h It has no external interface, but it does set up a sensible VLAN config = for the TL-WR1043RB. As soon as I figure out how Aleksandrs switch framework works, I'll try = and integrate it. Stefan --=20 Stefan Bethke Fon +49 151 14070811 From owner-freebsd-embedded@FreeBSD.ORG Mon Dec 5 01:29:42 2011 Return-Path: Delivered-To: freebsd-embedded@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0C54C106564A for ; Mon, 5 Dec 2011 01:29:42 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-vw0-f54.google.com (mail-vw0-f54.google.com [209.85.212.54]) by mx1.freebsd.org (Postfix) with ESMTP id B53998FC13 for ; Mon, 5 Dec 2011 01:29:41 +0000 (UTC) Received: by vbbfr13 with SMTP id fr13so5659222vbb.13 for ; Sun, 04 Dec 2011 17:29:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; 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 :content-transfer-encoding; bh=jw5AFtcUJKJgcI8mIEDMk+oDGXQ9m+KoIMpR0pws4HA=; b=py6uPK3UKIu4VFZGSqJdZGdkolnT/AvzgBB3HRQrpGOO4cGN6cRmR16jO5COBIOc2n LrmenAV2WfJf8wGGkeB1aHRqcBjNHX2w7IXE3Susb0gBgN2WLmaLgVRAkCGd7OP+4ot3 jnRFtE4swk0uHBVdYDkUZuka1ncTT9WbluFqw= MIME-Version: 1.0 Received: by 10.52.94.227 with SMTP id df3mr3968919vdb.51.1323048581077; Sun, 04 Dec 2011 17:29:41 -0800 (PST) Sender: adrian.chadd@gmail.com Received: by 10.52.109.10 with HTTP; Sun, 4 Dec 2011 17:29:41 -0800 (PST) In-Reply-To: <2B6F6CAC-F4EF-4958-A435-579A69862AE5@bsdimp.com> References: <2B6F6CAC-F4EF-4958-A435-579A69862AE5@bsdimp.com> Date: Mon, 5 Dec 2011 09:29:41 +0800 X-Google-Sender-Auth: iSOu5FwPU68xUPG8EiARjPZ1zZk Message-ID: From: Adrian Chadd To: Warner Losh Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: freebsd-embedded@freebsd.org Subject: Re: ar71xx_gpio.c touches SPI_CS1 and 2? X-BeenThere: freebsd-embedded@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Dedicated and Embedded Systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Dec 2011 01:29:42 -0000 On 5 December 2011 01:19, Warner Losh wrote: > When I was looking into this question for the Atmel chips, I was torn. = =A0On the one hand, it would be nice if there was a pin mux device. =A0On t= he other hand, it didn't map well into the device model. =A0I finally settl= ed on having per-board functions that setup the pins. =A0This is also the m= odel followed by linux. =A0Either the boot loader or the board-dependent co= de would do the setup. I think we should have a per-board set of hints which lets us dictate non-default GPIO functions and config. That way we can override what's going on in the board config without having to write C code. As i said, something like this: hint.blah.gpiofunction_set=3D"0x10000000" hint.blah.gpiofunction_clear=3D"0x00130000" It'd also be useful if the device drivers would do this themselves - eg the ar71xx USB device driver could ensure that the relevant GPIO function wire were enabled. But we may need to _disable_ some of these default pins (eg if the eeprom has enabled the digital sound function block on the SoC) so i still think having the above would work. Adrian From owner-freebsd-embedded@FreeBSD.ORG Mon Dec 5 01:33:21 2011 Return-Path: Delivered-To: freebsd-embedded@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1FB5F1065677 for ; Mon, 5 Dec 2011 01:33:21 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-vw0-f54.google.com (mail-vw0-f54.google.com [209.85.212.54]) by mx1.freebsd.org (Postfix) with ESMTP id C84298FC16 for ; Mon, 5 Dec 2011 01:33:20 +0000 (UTC) Received: by vbbfr13 with SMTP id fr13so5661214vbb.13 for ; Sun, 04 Dec 2011 17:33:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; 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 :content-transfer-encoding; bh=k1lwgW0AfsuUZ0VZ4JVWlLcTWnGxgG6MZ4uTR45WBR0=; b=T5r9QS1vVTwQ6kPXxvk9fGDi/AsCx5DA49pMauGB/jzKVTwSHtMz8DudAsp5kpctT4 yxbQDHT5jWgz/VoGrhzAc6ucWuwlvORICPaQBXZ58TqB1diQ7fwmm6sandjOcjvNKvJQ YyTYUcooYdF1k/W4NAlGt5vmQVhv18L6lIxPI= MIME-Version: 1.0 Received: by 10.52.20.35 with SMTP id k3mr3976321vde.34.1323048799987; Sun, 04 Dec 2011 17:33:19 -0800 (PST) Sender: adrian.chadd@gmail.com Received: by 10.52.109.10 with HTTP; Sun, 4 Dec 2011 17:33:19 -0800 (PST) In-Reply-To: <7FF1FBB8-2A6B-49E1-88ED-E46ED23DAD87@lassitu.de> References: <7FF1FBB8-2A6B-49E1-88ED-E46ED23DAD87@lassitu.de> Date: Mon, 5 Dec 2011 09:33:19 +0800 X-Google-Sender-Auth: m_yjnEtZcK7V1knmV5Ovfp4-uhk Message-ID: From: Adrian Chadd To: Stefan Bethke Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: freebsd-embedded@freebsd.org Subject: Re: ar71xx_gpio.c touches SPI_CS1 and 2? X-BeenThere: freebsd-embedded@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Dedicated and Embedded Systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Dec 2011 01:33:21 -0000 On 4 December 2011 21:59, Stefan Bethke wrote: >> I'm pretty sure the SPI flash is actually being talked to via >> bitbanged GPIO, rather than the actual ar71xx/ar91xx SPI interface. >> So those chip selects aren't strictly needed. > > I couldn't tell. =A0The register definitions in ar71xxreg.h seem to indic= ate that there is hardware support for SPI, and that CS1 and CS2 (but not C= S0) share the pins with GPIO, but looking at the code in ar71xx_spi.c seems= to do bit banging for transmit and register read for reception. =A0Does th= e SPI support only have a shift register for reception? I'm wrong. ar71xx_spi.c actually does use the SPI block. Ask me about that after mid-december. I have the atheros SoC datasheets; I just have no time to figure it out. Maybe ask ray@, he also has access to these datasheets now. (No we can't give them out. Yes, you can sign an NDA with Qualcomm Atheros to get access to some of this documentation.) > Hhm. > > How about the ar71xx_spi.c driver claiming CS0 and optionally CS1 and CS2= (again via hint?), and setting the GPIO function bits accordingly? =A0Or o= nly activate CS1 and CS2 if we have SPI bus children that claim them? Let's just have a hint that says "claim CS1 / claim CS2" for the ar71xx spi code. I think that'll be enough. We can then get rid of that function_enable call in ar71xx_gpio.c. The trick here is making sure we properly lock access to the function register? :) Adrian From owner-freebsd-embedded@FreeBSD.ORG Mon Dec 5 11:06:56 2011 Return-Path: Delivered-To: freebsd-embedded@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 784C71065670 for ; Mon, 5 Dec 2011 11:06:56 +0000 (UTC) (envelope-from owner-bugmaster@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 4CC858FC0A for ; Mon, 5 Dec 2011 11:06:56 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.5/8.14.5) with ESMTP id pB5B6ufF081143 for ; Mon, 5 Dec 2011 11:06:56 GMT (envelope-from owner-bugmaster@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.5/8.14.5/Submit) id pB5B6tab081141 for freebsd-embedded@FreeBSD.org; Mon, 5 Dec 2011 11:06:55 GMT (envelope-from owner-bugmaster@FreeBSD.org) Date: Mon, 5 Dec 2011 11:06:55 GMT Message-Id: <201112051106.pB5B6tab081141@freefall.freebsd.org> X-Authentication-Warning: freefall.freebsd.org: gnats set sender to owner-bugmaster@FreeBSD.org using -f From: FreeBSD bugmaster To: freebsd-embedded@FreeBSD.org Cc: Subject: Current problem reports assigned to freebsd-embedded@FreeBSD.org X-BeenThere: freebsd-embedded@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Dedicated and Embedded Systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Dec 2011 11:06:56 -0000 Note: to view an individual PR, use: http://www.freebsd.org/cgi/query-pr.cgi?pr=(number). The following is a listing of current problems submitted by FreeBSD users. These represent problem reports covering all versions including experimental development code and obsolete releases. S Tracker Resp. Description -------------------------------------------------------------------------------- o misc/52256 embedded [picobsd] picobsd build script does not read in user/s o kern/42728 embedded [picobsd] many problems in src/usr.sbin/ppp/* after c 2 problems total. From owner-freebsd-embedded@FreeBSD.ORG Mon Dec 5 15:09:43 2011 Return-Path: Delivered-To: freebsd-embedded@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8B0EF106566C for ; Mon, 5 Dec 2011 15:09:43 +0000 (UTC) (envelope-from stb@lassitu.de) Received: from gilb.zs64.net (gilb.zs64.net [IPv6:2001:470:1f0b:105e::1ea]) by mx1.freebsd.org (Postfix) with ESMTP id 572C08FC18 for ; Mon, 5 Dec 2011 15:09:43 +0000 (UTC) Received: by gilb.zs64.net (Postfix, from stb@lassitu.de) id 164781110C6 for ; Mon, 5 Dec 2011 16:09:42 +0100 (CET) From: Stefan Bethke Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Date: Mon, 5 Dec 2011 16:09:41 +0100 Message-Id: To: freebsd-embedded@freebsd.org Mime-Version: 1.0 (Apple Message framework v1084) X-Mailer: Apple Mail (2.1084) Subject: 24 of 32 MB available? X-BeenThere: freebsd-embedded@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Dedicated and Embedded Systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Dec 2011 15:09:43 -0000 KDB: debugger backends: ddb KDB: current backend: ddb Copyright (c) 1992-2011 The FreeBSD Project. Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994 The Regents of the University of California. All rights = reserved. FreeBSD is a registered trademark of The FreeBSD Foundation. FreeBSD 10.0-CURRENT #43 r228258M: Thu Jan 1 01:00:00 CET 1970 = stb@dummy:/home/stb/working/tp-wr1043/obj/mipseb/mips.mipseb/home/stb/work= ing/tp-wr1043/src/sys/TP-WN1043ND mips real memory =3D 33554432 (32768K bytes) Physical memory chunk(s): 0x005f5000 - 0x01f3bfff, 26505216 bytes (6471 pages) avail memory =3D 26112000 (24MB) Stupid question: what are those 8 MB used for? Why can't they be made = available? Stefan --=20 Stefan Bethke Fon +49 151 14070811 From owner-freebsd-embedded@FreeBSD.ORG Mon Dec 5 15:12:34 2011 Return-Path: Delivered-To: freebsd-embedded@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 65F30106566B for ; Mon, 5 Dec 2011 15:12:34 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-vw0-f54.google.com (mail-vw0-f54.google.com [209.85.212.54]) by mx1.freebsd.org (Postfix) with ESMTP id 1E70B8FC08 for ; Mon, 5 Dec 2011 15:12:33 +0000 (UTC) Received: by vbbfr13 with SMTP id fr13so6374879vbb.13 for ; Mon, 05 Dec 2011 07:12:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; 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 :content-transfer-encoding; bh=hZRWrwaeAPDEvQB8kfT5LKjljsB4mD3H0dMDaAvHOLo=; b=VKp9OllM1DcqrdM3CDH1GEcVvUdmJJ4/wWq0jOZHmUQ1l2ix8DHXo5hYr+4D+w2sp4 3yqO+jWRbYSogCndSjjTEfBBLGb1O4AIBElwUBTfOlNrogN13uGMsp/q1IedqXNsmWrf QGHd2pkQsLulqjsseJTGiexk4ZO7fdKwLVWfY= MIME-Version: 1.0 Received: by 10.52.20.35 with SMTP id k3mr5476096vde.34.1323097953251; Mon, 05 Dec 2011 07:12:33 -0800 (PST) Sender: adrian.chadd@gmail.com Received: by 10.52.109.10 with HTTP; Mon, 5 Dec 2011 07:12:33 -0800 (PST) In-Reply-To: References: Date: Mon, 5 Dec 2011 23:12:33 +0800 X-Google-Sender-Auth: reNHDi9yiNQ-w8RDxqK3Ksa-XZY Message-ID: From: Adrian Chadd To: Stefan Bethke Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: freebsd-embedded@freebsd.org Subject: Re: 24 of 32 MB available? X-BeenThere: freebsd-embedded@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Dedicated and Embedded Systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Dec 2011 15:12:34 -0000 On 5 December 2011 23:09, Stefan Bethke wrote: > Stupid question: what are those 8 MB used for? =A0Why can't they be made = available? The kernel is 5MB, the rest is housekeeping. Adrian From owner-freebsd-embedded@FreeBSD.ORG Mon Dec 5 15:13:11 2011 Return-Path: Delivered-To: freebsd-embedded@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0520D106564A for ; Mon, 5 Dec 2011 15:13:11 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-vx0-f182.google.com (mail-vx0-f182.google.com [209.85.220.182]) by mx1.freebsd.org (Postfix) with ESMTP id B53C28FC16 for ; Mon, 5 Dec 2011 15:13:10 +0000 (UTC) Received: by vcbfk1 with SMTP id fk1so6378130vcb.13 for ; Mon, 05 Dec 2011 07:13:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; 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; bh=YIOBPsSvgTblVWNEERDd7E8HTAG0FoFS6Ammdx87BEo=; b=pYJmyGRNXAHZW+puOFr0eFbFql1PU4RoC0YibRnbjR4KKrtClrK6I5QZJ/660t3QHs JNVh0CURjKCGE2tfuIPkzos0MMcbGDRL9YT9isQNTuIsXkS3mL0ATTujNG4/WdszY3yw 1XNZuvFy95wbFX8Tb5Y8Z3AIy9oDQytATT2nE= MIME-Version: 1.0 Received: by 10.52.66.35 with SMTP id c3mr5551406vdt.17.1323097989959; Mon, 05 Dec 2011 07:13:09 -0800 (PST) Sender: adrian.chadd@gmail.com Received: by 10.52.109.10 with HTTP; Mon, 5 Dec 2011 07:13:09 -0800 (PST) In-Reply-To: References: Date: Mon, 5 Dec 2011 23:13:09 +0800 X-Google-Sender-Auth: l11zO1_F9GqWmcMJj5ril4PJnIc Message-ID: From: Adrian Chadd To: Stefan Bethke Content-Type: text/plain; charset=ISO-8859-1 Cc: freebsd-embedded@freebsd.org Subject: Re: 24 of 32 MB available? X-BeenThere: freebsd-embedded@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Dedicated and Embedded Systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Dec 2011 15:13:11 -0000 I wonder why this happens: > FreeBSD 10.0-CURRENT #43 r228258M: Thu Jan 1 01:00:00 CET 1970 adrian From owner-freebsd-embedded@FreeBSD.ORG Mon Dec 5 16:06:22 2011 Return-Path: Delivered-To: freebsd-embedded@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 705C3106564A; Mon, 5 Dec 2011 16:06:22 +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 18B358FC15; Mon, 5 Dec 2011 16:06:22 +0000 (UTC) Received: from 150.imp.bsdimp.com (150.imp.bsdimp.com [10.0.0.150] (may be forged)) (authenticated bits=0) by harmony.bsdimp.com (8.14.4/8.14.3) with ESMTP id pB5G1olm044579 (version=TLSv1/SSLv3 cipher=DHE-DSS-AES128-SHA bits=128 verify=NO); Mon, 5 Dec 2011 09:01:50 -0700 (MST) (envelope-from imp@bsdimp.com) Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii From: Warner Losh In-Reply-To: Date: Mon, 5 Dec 2011 09:01:50 -0700 Content-Transfer-Encoding: quoted-printable Message-Id: <9681BA0F-B8DE-479C-98B8-6DA702A489CA@bsdimp.com> References: <2B6F6CAC-F4EF-4958-A435-579A69862AE5@bsdimp.com> To: Adrian Chadd X-Mailer: Apple Mail (2.1084) X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (harmony.bsdimp.com [10.0.0.6]); Mon, 05 Dec 2011 09:01:51 -0700 (MST) Cc: freebsd-embedded@freebsd.org Subject: Re: ar71xx_gpio.c touches SPI_CS1 and 2? X-BeenThere: freebsd-embedded@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Dedicated and Embedded Systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Dec 2011 16:06:22 -0000 On Dec 4, 2011, at 6:29 PM, Adrian Chadd wrote: > On 5 December 2011 01:19, Warner Losh wrote: >=20 >> When I was looking into this question for the Atmel chips, I was = torn. On the one hand, it would be nice if there was a pin mux device. = On the other hand, it didn't map well into the device model. I finally = settled on having per-board functions that setup the pins. This is also = the model followed by linux. Either the boot loader or the = board-dependent code would do the setup. >=20 > I think we should have a per-board set of hints which lets us dictate > non-default GPIO functions and config. You are thinking too narrowly here. It should be thought of as = assigning pin function rather than some GPIO thing. On the Atmel, you = can set multiplex functions (either GPIO, or Ethernet Tx+ for this pin, = etc). I too have wanted per-board hints, possibly several sets in one kernel, = but never had the time to bring that to fruition. > That way we can override what's going on in the board config without > having to write C code. >=20 > As i said, something like this: >=20 > hint.blah.gpiofunction_set=3D"0x10000000" > hint.blah.gpiofunction_clear=3D"0x00130000" For the AR71xx, that might suffice, but it isn't adequate in general. I = also really don't like the names, since it is more of a pin function = than a GPIO function. > It'd also be useful if the device drivers would do this themselves - > eg the ar71xx USB device driver could ensure that the relevant GPIO > function wire were enabled. No. That's wrong, at least generally. The USB driver has no business = setting these things up. That's for the board level init code. The = board level init code can pass data to the USB driver saying that it set = things up for USB and the driver can then fail to attach when those pins = are setup for other things. Having tried to get all the Atmel drivers to automagically set = themselves up turned out to be a total fiasco. I tried it when I was = bringing the boards at Timing Solutions up. It worked great for the = eval board, but turned into a night mare of special case hacks when I = moved the code over to the custom board we were developing. I'd = strongly suggest that the driver is not the place to do this, any more = than the driver is the place to assign PCI resources: this sort of thing = belongs at a higher level. > But we may need to _disable_ some of these > default pins (eg if the eeprom has enabled the digital sound function > block on the SoC) so i still think having the above would work. Right, that's why I think that the board init code should be the one to = muck with the pins. Wether that is done via hints or hard-coded 'C' I = don't care too much for, but inside the driver is definitely the wrong = place to do it. Warner= From owner-freebsd-embedded@FreeBSD.ORG Mon Dec 5 17:13:49 2011 Return-Path: Delivered-To: freebsd-embedded@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 95995106566C; Mon, 5 Dec 2011 17:13:49 +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 4D8DA8FC12; Mon, 5 Dec 2011 17:13:49 +0000 (UTC) Received: from [10.30.101.55] ([209.117.142.2]) (authenticated bits=0) by harmony.bsdimp.com (8.14.4/8.14.3) with ESMTP id pB5H5kTE045353 (version=TLSv1/SSLv3 cipher=DHE-DSS-AES128-SHA bits=128 verify=NO); Mon, 5 Dec 2011 10:05:47 -0700 (MST) (envelope-from imp@bsdimp.com) Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii From: Warner Losh In-Reply-To: Date: Mon, 5 Dec 2011 10:05:39 -0700 Content-Transfer-Encoding: quoted-printable Message-Id: <5A5E3A5A-A508-4A32-BD0B-F37262A8626B@bsdimp.com> References: To: Adrian Chadd X-Mailer: Apple Mail (2.1084) X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (harmony.bsdimp.com [10.0.0.6]); Mon, 05 Dec 2011 10:05:48 -0700 (MST) Cc: freebsd-embedded@freebsd.org Subject: Re: 24 of 32 MB available? X-BeenThere: freebsd-embedded@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Dedicated and Embedded Systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Dec 2011 17:13:49 -0000 On Dec 5, 2011, at 8:12 AM, Adrian Chadd wrote: > On 5 December 2011 23:09, Stefan Bethke wrote: >> Stupid question: what are those 8 MB used for? Why can't they be = made available? >=20 > The kernel is 5MB, the rest is housekeeping. The early wired pages are part of that housekeeping, as are kernel = symbols. Warner From owner-freebsd-embedded@FreeBSD.ORG Tue Dec 6 00:04:28 2011 Return-Path: Delivered-To: freebsd-embedded@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A0F55106564A for ; Tue, 6 Dec 2011 00:04:28 +0000 (UTC) (envelope-from linimon@lonesome.com) Received: from mail.soaustin.net (pancho.soaustin.net [76.74.250.40]) by mx1.freebsd.org (Postfix) with ESMTP id 85A668FC12 for ; Tue, 6 Dec 2011 00:04:28 +0000 (UTC) Received: by mail.soaustin.net (Postfix, from userid 502) id C10D65619E; Mon, 5 Dec 2011 17:57:00 -0600 (CST) Date: Mon, 5 Dec 2011 17:57:00 -0600 From: Mark Linimon To: Oleksandr Tymoshenko Message-ID: <20111205235700.GC18310@lonesome.com> References: <4ED6FD47.6050704@bluezbox.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4ED6FD47.6050704@bluezbox.com> User-Agent: Mutt/1.5.20 (2009-06-14) Cc: freebsd-embedded@freebsd.org Subject: Re: Ports cross-compilation X-BeenThere: freebsd-embedded@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Dedicated and Embedded Systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Dec 2011 00:04:28 -0000 On Wed, Nov 30, 2011 at 08:06:31PM -0800, Oleksandr Tymoshenko wrote: > - Different sets of patches are required for cross-compilation and > native build (use PATCHFILES?) Yes, probably PATCHFILES. > - Create bare-bone version of bsd.port.mk called bsd.xdev.mk. It > should contain target called "xpackage" that would manage > dependencies, install port to ${BUILDROOT}, generate package-related > files and create a package. No package registration. We have a lot of > stuff in bsd.port.mk that could be reused - > fetch/checksum/dependencies. Writing them from scratch makes no sense. Well, the problem would be keeping bsd.xdev.mk in sync with bsd.port.mk. It would almost instantly go stale -- despite people's perceptions, a lot of changes do go into it. Fixing might be more tractable than you think, but probably only just a little :-) As observed earlier, pkgng will fix numerous sins in bsd.port.mk. mcl From owner-freebsd-embedded@FreeBSD.ORG Tue Dec 6 00:09:29 2011 Return-Path: Delivered-To: freebsd-embedded@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EA5601065670 for ; Tue, 6 Dec 2011 00:09:29 +0000 (UTC) (envelope-from linimon@lonesome.com) Received: from mail.soaustin.net (pancho.soaustin.net [76.74.250.40]) by mx1.freebsd.org (Postfix) with ESMTP id CD2528FC1F for ; Tue, 6 Dec 2011 00:09:28 +0000 (UTC) Received: by mail.soaustin.net (Postfix, from userid 502) id 72F375615E; Mon, 5 Dec 2011 17:52:19 -0600 (CST) Date: Mon, 5 Dec 2011 17:52:19 -0600 From: Mark Linimon To: Stefan Bethke Message-ID: <20111205235219.GB18310@lonesome.com> References: <4ED6FD47.6050704@bluezbox.com> <96407605-79A9-4AE3-AC2F-13BD97943153@lassitu.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <96407605-79A9-4AE3-AC2F-13BD97943153@lassitu.de> User-Agent: Mutt/1.5.20 (2009-06-14) Cc: linimon@FreeBSD.org, freebsd-embedded@freebsd.org Subject: Re: Ports cross-compilation X-BeenThere: freebsd-embedded@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Dedicated and Embedded Systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Dec 2011 00:09:30 -0000 On Thu, Dec 01, 2011 at 08:44:49AM +0100, Stefan Bethke wrote: > Has anyone set up a ports build for mips yet, perhaps in an emulator? Someone asked me about building in an emulator (I think it was arm) a couple of months ago, as they had an emulator instance up and running. Unfortunately I task-switched without writing down who that was. If anyone has instances available, we can give it a shot. The newer codebase on pointyhat-west can be told "build only this list of ports". Of course, the Right solution is to add some kind of metadata. I've toyed with the idea of how to do that but don't have any concrete idea. mcl From owner-freebsd-embedded@FreeBSD.ORG Tue Dec 6 01:44:12 2011 Return-Path: Delivered-To: freebsd-embedded@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 91FD91065670 for ; Tue, 6 Dec 2011 01:44:12 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-vw0-f54.google.com (mail-vw0-f54.google.com [209.85.212.54]) by mx1.freebsd.org (Postfix) with ESMTP id 4E9B28FC14 for ; Tue, 6 Dec 2011 01:44:11 +0000 (UTC) Received: by vbbfr13 with SMTP id fr13so7132377vbb.13 for ; Mon, 05 Dec 2011 17:44:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; 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; bh=oUJnO5U8WGCvhYatFdEgIC1WTSb1NSsN0a2NrRMXsyg=; b=K1RJO96oqpM3Hq6LEYq07mxIpw6Qx+abbMLX/na3BOKD/2MwjNsbQnn/BV9HRBVhdt MK0luPoEI8C8EdTa/X19ykVW9QOphrhsg5tN8vJziUCbwOlvcWnWe/PHayJzEyyZ9zgn GvVISKhVHVQaEdkAq0omPvTt0jcaD2MpktSkA= MIME-Version: 1.0 Received: by 10.52.66.35 with SMTP id c3mr7314878vdt.17.1323135851544; Mon, 05 Dec 2011 17:44:11 -0800 (PST) Sender: adrian.chadd@gmail.com Received: by 10.52.109.10 with HTTP; Mon, 5 Dec 2011 17:44:11 -0800 (PST) In-Reply-To: <9681BA0F-B8DE-479C-98B8-6DA702A489CA@bsdimp.com> References: <2B6F6CAC-F4EF-4958-A435-579A69862AE5@bsdimp.com> <9681BA0F-B8DE-479C-98B8-6DA702A489CA@bsdimp.com> Date: Tue, 6 Dec 2011 09:44:11 +0800 X-Google-Sender-Auth: 88_Hg1BJQ8whLHBEy_2v3IT7uhk Message-ID: From: Adrian Chadd To: Warner Losh Content-Type: text/plain; charset=ISO-8859-1 Cc: freebsd-embedded@freebsd.org Subject: Re: ar71xx_gpio.c touches SPI_CS1 and 2? X-BeenThere: freebsd-embedded@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Dedicated and Embedded Systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Dec 2011 01:44:12 -0000 We're aligned in our thinking btw - it was just my choice of terminology that was poor. The reason I chose the term "GPIO" is because the pins tend to do dual-duty as either GPIO or non-GP IO pins; on the ar71xx these are configured via one nice register. On the 8 bit AVRs at least, the pin personality is configured in a variety of locations rather than just one location. So I'd like to see this done in ether the kernel config or hints, rather than by per-board C code (which is what openwrt/linux currently does.) That way we can just ship one source tree without individual C files, one per board. I'd prefer to stuff it inside a "boarddep" part of hints, that gets read by the platform startup code and initialises the IO pin personality as needed, far before the device drivers get their grubby fingers into it. This includes setting up the UART/JTAG personalities too, so I'd want it to be done very early on (maybe in platform_start(), before it starts using the UART. The firmware should have already set this up but there may be some boards out there which just disable the UART entirely in production.. ? Adrian From owner-freebsd-embedded@FreeBSD.ORG Tue Dec 6 03:55:19 2011 Return-Path: Delivered-To: freebsd-embedded@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 842931065673; Tue, 6 Dec 2011 03:55:19 +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 B10E38FC16; Tue, 6 Dec 2011 03:55:18 +0000 (UTC) Received: from [10.0.0.150] (150.imp.bsdimp.com [10.0.0.150] (may be forged)) (authenticated bits=0) by harmony.bsdimp.com (8.14.4/8.14.3) with ESMTP id pB63stvG052011 (version=TLSv1/SSLv3 cipher=DHE-DSS-AES128-SHA bits=128 verify=NO); Mon, 5 Dec 2011 20:55:05 -0700 (MST) (envelope-from imp@bsdimp.com) Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii From: Warner Losh In-Reply-To: <20111205235219.GB18310@lonesome.com> Date: Mon, 5 Dec 2011 20:54:55 -0700 Content-Transfer-Encoding: 7bit Message-Id: <1F03AEDA-7B01-4AF9-83B5-415B9226DF0F@bsdimp.com> References: <4ED6FD47.6050704@bluezbox.com> <96407605-79A9-4AE3-AC2F-13BD97943153@lassitu.de> <20111205235219.GB18310@lonesome.com> To: Mark Linimon X-Mailer: Apple Mail (2.1084) X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (harmony.bsdimp.com [10.0.0.6]); Mon, 05 Dec 2011 20:55:09 -0700 (MST) Cc: linimon@freebsd.org, freebsd-embedded@freebsd.org Subject: Re: Ports cross-compilation X-BeenThere: freebsd-embedded@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Dedicated and Embedded Systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Dec 2011 03:55:19 -0000 On Dec 5, 2011, at 4:52 PM, Mark Linimon wrote: > On Thu, Dec 01, 2011 at 08:44:49AM +0100, Stefan Bethke wrote: >> Has anyone set up a ports build for mips yet, perhaps in an emulator? > > Someone asked me about building in an emulator (I think it was arm) a > couple of months ago, as they had an emulator instance up and running. > Unfortunately I task-switched without writing down who that was. > > If anyone has instances available, we can give it a shot. The newer > codebase on pointyhat-west can be told "build only this list of ports". > Of course, the Right solution is to add some kind of metadata. I've > toyed with the idea of how to do that but don't have any concrete idea. Well, the ONLY_FOR_ARCH stuff might be a good first-order clue. Warner From owner-freebsd-embedded@FreeBSD.ORG Tue Dec 6 19:20:32 2011 Return-Path: Delivered-To: freebsd-embedded@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3418A106566B; Tue, 6 Dec 2011 19:20:32 +0000 (UTC) (envelope-from linimon@lonesome.com) Received: from mail.soaustin.net (pancho.soaustin.net [76.74.250.40]) by mx1.freebsd.org (Postfix) with ESMTP id 153988FC08; Tue, 6 Dec 2011 19:20:31 +0000 (UTC) Received: by mail.soaustin.net (Postfix, from userid 502) id 8F8565619E; Tue, 6 Dec 2011 13:20:31 -0600 (CST) Date: Tue, 6 Dec 2011 13:20:31 -0600 From: Mark Linimon To: Warner Losh Message-ID: <20111206192031.GB5672@lonesome.com> References: <4ED6FD47.6050704@bluezbox.com> <96407605-79A9-4AE3-AC2F-13BD97943153@lassitu.de> <20111205235219.GB18310@lonesome.com> <1F03AEDA-7B01-4AF9-83B5-415B9226DF0F@bsdimp.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1F03AEDA-7B01-4AF9-83B5-415B9226DF0F@bsdimp.com> User-Agent: Mutt/1.5.20 (2009-06-14) Cc: linimon@freebsd.org, freebsd-embedded@freebsd.org Subject: Re: Ports cross-compilation X-BeenThere: freebsd-embedded@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Dedicated and Embedded Systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Dec 2011 19:20:32 -0000 On Mon, Dec 05, 2011 at 08:54:55PM -0700, Warner Losh wrote: > Well, the ONLY_FOR_ARCH stuff might be a good first-order clue. This is why I want to move away from NOT_FOR_ARCHS and move exclusively to ONLY_FOR_ARCHS; for embedded, the former is exactly The Wrong Thing. Unfortunately, NOT_FOR_ARCHS is all over the tree. The other problem is that if the port merely breaks on compiling (rather than there being missing pieces that prevent it from even getting that far) the 'best practice' is to set BROKEN conditionally, instead of *ARCH*. But the tree is rife with examples where the one approach is done rather than the other. To see an example of the union of the above: http://pointyhat.freebsd.org/errorlogs/sparc64-9-latest/duds.verbose That's the union of all cases of "do not try to build me" for sparc64-9. Obviously a lot of the things are common to all archs, and one metadata entry can cause many lines (e.g. "no linux on sparc64"), but it gives a rough idea of the scope of the task (1794 entries). mcl From owner-freebsd-embedded@FreeBSD.ORG Thu Dec 8 12:52:40 2011 Return-Path: Delivered-To: embedded@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2FDD5106564A for ; Thu, 8 Dec 2011 12:52:40 +0000 (UTC) (envelope-from ray@dlink.ua) Received: from smtp.dlink.ua (smtp.dlink.ua [193.138.187.146]) by mx1.freebsd.org (Postfix) with ESMTP id E35A38FC18 for ; Thu, 8 Dec 2011 12:52:39 +0000 (UTC) Received: from terran.dlink.ua (unknown [192.168.10.90]) (Authenticated sender: ray) by smtp.dlink.ua (Postfix) with ESMTPSA id 1630BC4934; Thu, 8 Dec 2011 14:36:17 +0200 (EET) Date: Thu, 8 Dec 2011 14:36:30 +0200 From: Aleksandr Rybalko To: Stefan Bethke Message-Id: <20111208143630.8bfa62c9.ray@dlink.ua> In-Reply-To: <2B013790-6DB4-4E1A-857C-5EC39F4F71C9@lassitu.de> References: <20111110014904.0e8caf2c.ray@ddteam.net> <2B013790-6DB4-4E1A-857C-5EC39F4F71C9@lassitu.de> Organization: D-Link X-Mailer: Sylpheed 2.7.1 (GTK+ 2.20.1; i386-portbld-freebsd8.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: embedded@freebsd.org Subject: Re: Ethernet switch framework X-BeenThere: freebsd-embedded@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Dedicated and Embedded Systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Dec 2011 12:52:40 -0000 On Mon, 5 Dec 2011 00:16:45 +0100 Stefan Bethke wrote: >> Hi Alexsandr, >> >> I'v now created a driver for my RTL8366RB, and I can load and unload >> it, and have it initialize the switch. >> >> I've tried to understand how the pieces fit together in your switch >> framework, and how I would integrate my driver with it. Any chance >> you could give me quick run through how the userland device, the >> switch bus and the individual switch drivers are talking to each >> other? Hi Stefan, sorry for delay, need at least two more clones of myself :) no problem, but currently switch framework very broken :) But let me explain how it must works. sys/dev/switch: switch.c - core logic switch_if.m - newbus methods to call from core to drv switchb_if.m - newbus methods to call from drv to core switch_ioctl.h - driver IOCTL, exported to userland for switchctl switch_${busglue}.c - glue to attach to different buses (mii, obio, iicbus, spi), currently works (somehow) mii and obio. ${family}_switch.c - switch driver ${family}_switchreg.h - switch registers definitions ${family}_switchvar.h - per driver structures sbin/switchctl - still dumb tool for switch manipulation most useful thing of it - get/set reg :) Ohh, need write many manuals for it, but still busy with servers @job. Anyway, questions/comments are welcomed! >> >> >> Thanks, >> Stefan >> >> -- >> Stefan Bethke Fon +49 151 14070811 >> >> >> WBW -- Alexandr Rybalko aka Alex RAY