From owner-freebsd-drivers@FreeBSD.ORG Tue Nov 27 08:50:03 2007 Return-Path: Delivered-To: freebsd-drivers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D834B16A417 for ; Tue, 27 Nov 2007 08:50:03 +0000 (UTC) (envelope-from Benjamin.Close@clearchain.com) Received: from ipmail04.adl2.internode.on.net (ipmail04.adl2.internode.on.net [203.16.214.57]) by mx1.freebsd.org (Postfix) with ESMTP id 5D34113C503 for ; Tue, 27 Nov 2007 08:50:02 +0000 (UTC) (envelope-from Benjamin.Close@clearchain.com) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Ah4FADxmS0d5LTGL/2dsb2JhbACBWw X-IronPort-AV: E=Sophos;i="4.23,218,1194183000"; d="scan'208";a="4538528" Received: from ppp121-45-49-139.lns11.adl2.internode.on.net (HELO mail.clearchain.com) ([121.45.49.139]) by ipmail04.adl2.internode.on.net with ESMTP; 27 Nov 2007 19:20:01 +1030 Received: from [192.168.155.249] (draco.internal.clearchain.com [192.168.155.249]) (authenticated bits=0) by mail.clearchain.com (8.13.8/8.13.8) with ESMTP id lAR8nwdv097183 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 27 Nov 2007 19:19:58 +1030 (CST) (envelope-from Benjamin.Close@clearchain.com) Message-ID: <474BDA2E.7060003@clearchain.com> Date: Tue, 27 Nov 2007 19:19:50 +1030 From: Benjamin Close User-Agent: Thunderbird 2.0.0.9 (Windows/20071031) MIME-Version: 1.0 To: Joshua Hyatt References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV version 0.91.2, clamav-milter version 0.91.2 on pegasus.clearchain.com X-Virus-Status: Clean X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by milter-greylist-2.0.2 (mail.clearchain.com [192.168.154.1]); Tue, 27 Nov 2007 19:19:58 +1030 (CST) Cc: freebsd-drivers@freebsd.org Subject: Re: GPIO X-BeenThere: freebsd-drivers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Writing device drivers for FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Nov 2007 08:50:04 -0000 Joshua Hyatt wrote: > I have a Soekris Net4801 computer running FreeBSD 6.2, which is an x86-based system using the AMD Geode SC1100 processor. It has a number of GPIO connections directly connected to the processor that I am interested in using. > > However, I am unfamiliar with writing a driver for FreeBSD, and all of my attempts thus far have resulted in failure. There is a led driver that uses the SPIO of the SC1100 for FreeBSD that works, with the source code located at /usr/src/sys/dev/led/, but it is write-only. > > If someone could guide me in adding a function to read the status of the gpio connection to led.c, or has a better suggestion of how to do this, it would be greatly appreciated. > > Thanks, > Joshua Hyatt > Hi Joshua, I think the bit you might be missing is dev/led is merely an intermediate driver that other drivers use. Things like dev/auxio make use of dev/led via led_create(). Hence if you look in dev/auxio/auxio.c at the auxio_led_func you can see that the function is actually doing both a read and write of the bus via auxio_led_read & auxio_led_write. In general, to read from general io registers you need to to use one of the bus_space * methods (BUS_SPACE(9)) but before you can do that you need to setup a bus resource via bus_alloc_resource_any. And perhaps an interrupt if required. Have a look at tha auxio driver, it'll probably make things a lot clearer - dev/led would have left you wondering where the actual work was done :) Cheers, Benjamin From owner-freebsd-drivers@FreeBSD.ORG Tue Nov 27 19:39:07 2007 Return-Path: Delivered-To: freebsd-drivers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B2ADD16A468 for ; Tue, 27 Nov 2007 19:39:07 +0000 (UTC) (envelope-from sbruno@miralink.com) Received: from plato.miralink.com (mail.miralink.com [70.103.185.20]) by mx1.freebsd.org (Postfix) with ESMTP id 7E6A213C4E1 for ; Tue, 27 Nov 2007 19:39:07 +0000 (UTC) (envelope-from sbruno@miralink.com) Received: from localhost (localhost.localdomain [127.0.0.1]) by plato.miralink.com (Postfix) with ESMTP id 2B05861AB92; Tue, 27 Nov 2007 11:39:07 -0800 (PST) Received: from plato.miralink.com ([127.0.0.1]) by localhost (plato.miralink.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 11431-10; Tue, 27 Nov 2007 11:39:06 -0800 (PST) Received: from [10.0.0.40] (iago.office.miralink.com [10.0.0.40]) by plato.miralink.com (Postfix) with ESMTP id 2363061AB77; Tue, 27 Nov 2007 11:39:06 -0800 (PST) Message-ID: <474C7259.40301@miralink.com> Date: Tue, 27 Nov 2007 11:39:05 -0800 From: Sean Bruno User-Agent: Thunderbird 1.5.0.12 (X11/20071019) MIME-Version: 1.0 To: freebsd-drivers@freebsd.org Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-DSPAM-Result: Innocent X-DSPAM-Processed: Tue Nov 27 11:39:06 2007 X-DSPAM-Confidence: 0.7829 X-DSPAM-Probability: 0.0000 X-DSPAM-Signature: 474c725a140722051017194 X-DSPAM-Factors: 27, X-Virus-Scanned: amavisd-new at X-Spam-Status: No, score=-4.499 tagged_above=-10 required=6.6 autolearn=ham tests=[ALL_TRUSTED=-1.8, BAYES_00=-2.599, DSPAM_HAM=-0.1] X-Spam-Score: -4.499 X-Spam-Level: Cc: freebsdnic@mailbox.intel.com Subject: Intel(em) driver witness error X-BeenThere: freebsd-drivers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Writing device drivers for FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Nov 2007 19:39:07 -0000 While debugging a completely unrelated issue, I'm getting a witness lock from the most recent RELENG_6 em(intel) driver in CVS: em0: Link is Down em0: link state changed to DOWN acquiring duplicate lock of same type: "network driver" 1st em0 @ dev/em/if_em.c:1464 2nd em0 @ dev/em/if_em.c:1492 KDB: stack backtrace: kdb_backtrace(38,c08db960,c08e41b8,c08e41b8,c08aa504,...) at kdb_backtrace+0x29 witness_checkorder(c4c79adc,9,c0837749,5d4) at witness_checkorder+0x578 _mtx_lock_flags(c4c79adc,0,c0837740,5d4,c4c79800,...) at _mtx_lock_flags+0x78 em_intr(c4c79800) at em_intr+0xdb ithread_execute_handlers(c4c89860,c4bb2300) at ithread_execute_handlers+0xe6 ithread_loop(c4c88c50,e35ead38,c4c88c50,c05c086c,0,...) at ithread_loop+0x66 fork_exit(c05c086c,c4c88c50,e35ead38) at fork_exit+0xa0 fork_trampoline() at fork_trampoline+0x8 --- trap 0x1, eip = 0, esp = 0xe35ead6c, ebp = 0 --- The Locks are "EM_CORE_LOCK" and "EM_TX_LOCK" from if_em.h ... It doesn't appear that the locks are around the same mutex. Sean From owner-freebsd-drivers@FreeBSD.ORG Tue Nov 27 19:52:06 2007 Return-Path: Delivered-To: freebsd-drivers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9238916A418 for ; Tue, 27 Nov 2007 19:52:06 +0000 (UTC) (envelope-from sbruno@miralink.com) Received: from plato.miralink.com (mail.miralink.com [70.103.185.20]) by mx1.freebsd.org (Postfix) with ESMTP id 71E2913C465 for ; Tue, 27 Nov 2007 19:52:06 +0000 (UTC) (envelope-from sbruno@miralink.com) Received: from localhost (localhost.localdomain [127.0.0.1]) by plato.miralink.com (Postfix) with ESMTP id 3326061AB79 for ; Tue, 27 Nov 2007 11:52:06 -0800 (PST) Received: from plato.miralink.com ([127.0.0.1]) by localhost (plato.miralink.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 14131-01 for ; Tue, 27 Nov 2007 11:52:05 -0800 (PST) Received: from [10.0.0.40] (iago.office.miralink.com [10.0.0.40]) by plato.miralink.com (Postfix) with ESMTP id CDA3661AB77 for ; Tue, 27 Nov 2007 11:52:05 -0800 (PST) Message-ID: <474C7565.70101@miralink.com> Date: Tue, 27 Nov 2007 11:52:05 -0800 From: Sean Bruno User-Agent: Thunderbird 1.5.0.12 (X11/20071019) MIME-Version: 1.0 To: freebsd-drivers@freebsd.org Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-DSPAM-Result: Innocent X-DSPAM-Processed: Tue Nov 27 11:52:06 2007 X-DSPAM-Confidence: 0.7852 X-DSPAM-Probability: 0.0000 X-DSPAM-Signature: 474c7566192291804284693 X-DSPAM-Factors: 27, X-Virus-Scanned: amavisd-new at X-Spam-Status: No, score=-4.499 tagged_above=-10 required=6.6 autolearn=ham tests=[ALL_TRUSTED=-1.8, BAYES_00=-2.599, DSPAM_HAM=-0.1] X-Spam-Score: -4.499 X-Spam-Level: Subject: freebsdnic@mailbox.intel.com not a valid email address X-BeenThere: freebsd-drivers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Writing device drivers for FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Nov 2007 19:52:06 -0000 I tried to send a message to the email address in the man page for em(4). And it bounced. Whom is the real author? Sean From owner-freebsd-drivers@FreeBSD.ORG Wed Nov 28 06:26:48 2007 Return-Path: Delivered-To: freebsd-drivers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7C5DD16A418 for ; Wed, 28 Nov 2007 06:26:48 +0000 (UTC) (envelope-from benjsc@clearchain.com) Received: from ipmail05.adl2.internode.on.net (ipmail05.adl2.internode.on.net [203.16.214.145]) by mx1.freebsd.org (Postfix) with ESMTP id 0AC7A13C4D5 for ; Wed, 28 Nov 2007 06:26:47 +0000 (UTC) (envelope-from benjsc@clearchain.com) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Ah4FAMqUTEd5LVTB/2dsb2JhbACBW4xt X-IronPort-AV: E=Sophos;i="4.23,222,1194183000"; d="scan'208";a="4803964" Received: from ppp121-45-84-193.lns10.adl6.internode.on.net (HELO mail.clearchain.com) ([121.45.84.193]) by ipmail05.adl2.internode.on.net with ESMTP; 28 Nov 2007 16:40:39 +1030 Received: from www.clearchain.com (localhost [127.0.0.1]) by mail.clearchain.com (8.13.8/8.13.8) with ESMTP id lAS6AaTH008125; Wed, 28 Nov 2007 16:40:37 +1030 (CST) (envelope-from benjsc@clearchain.com) Received: from 130.220.79.98 (proxying for 10.230.172.21) (SquirrelMail authenticated user benjsc) by www.clearchain.com with HTTP; Wed, 28 Nov 2007 16:40:37 +1030 (CST) Message-ID: <37200.130.220.79.98.1196230237.squirrel@www.clearchain.com> In-Reply-To: <474C7565.70101@miralink.com> References: <474C7565.70101@miralink.com> Date: Wed, 28 Nov 2007 16:40:37 +1030 (CST) From: benjsc@clearchain.com To: "Sean Bruno" User-Agent: SquirrelMail/1.4.9a MIME-Version: 1.0 Content-Type: text/plain;charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Priority: 3 (Normal) Importance: Normal X-Virus-Scanned: ClamAV version 0.91.2, clamav-milter version 0.91.2 on pegasus.clearchain.com X-Virus-Status: Clean X-Greylist: Sender is SPF-compliant, not delayed by milter-greylist-2.0.2 (mail.clearchain.com [127.0.0.1]); Wed, 28 Nov 2007 16:40:37 +1030 (CST) Cc: freebsd-drivers@freebsd.org Subject: Re: freebsdnic@mailbox.intel.com not a valid email address X-BeenThere: freebsd-drivers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Writing device drivers for FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Nov 2007 06:26:48 -0000 > I tried to send a message to the email address in the man page for > em(4). And it bounced. Whom is the real author? > > Sean > _______________________________________________ > freebsd-drivers@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-drivers > To unsubscribe, send any mail to "freebsd-drivers-unsubscribe@freebsd.org" > Your best bet is to send to jfv@freebsd.org as he's the last one to make changes to the driver: http://www.freebsd.org/cgi/cvsweb.cgi/src/sys/dev/em/ It looks like the last commit made to if_em.c may fix the reversal though it's not yet been MFC'd to 6/7. Cheers, Benjamin