From owner-freebsd-embedded@FreeBSD.ORG Tue Sep 18 23:35:05 2007 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 D977916A41B for ; Tue, 18 Sep 2007 23:35:05 +0000 (UTC) (envelope-from jb@what-creek.com) Received: from what-creek.com (what-creek.com [66.111.37.70]) by mx1.freebsd.org (Postfix) with ESMTP id 975E913C48D for ; Tue, 18 Sep 2007 23:35:05 +0000 (UTC) (envelope-from jb@what-creek.com) Received: by what-creek.com (Postfix, from userid 102) id 9AB6D7318A; Tue, 18 Sep 2007 23:20:20 +0000 (GMT) Date: Tue, 18 Sep 2007 23:20:20 +0000 From: John Birrell To: "M. Warner Losh" Message-ID: <20070918232020.GA96782@what-creek.com> References: <0FCFCF6165E968449991746EB91D614D913E8E@antipi.jnpr.net> <20070918.145034.669287571.imp@bsdimp.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20070918.145034.669287571.imp@bsdimp.com> User-Agent: Mutt/1.4.2.3i Cc: embedded@freebsd.org Subject: Re: NOR flash drivers in 6.1? 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, 18 Sep 2007 23:35:05 -0000 On Tue, Sep 18, 2007 at 02:50:34PM -0600, M. Warner Losh wrote: > There is a NAND driver that's floating around done by John Birrell a > few years ago. We used it at Timing Solutions for one x86 board that > had NAND flash and no hard disk. However, I'm not aware of a NOR > driver, specifically. The specs for NAND and NOR memory are readily > available, so wouldn't be a big deal to get data necessary to > read/write/erase them. NOR is very much simpler than NAND. NOR flash is memory mapped whereas NAND reads and writes are clocked via a single byte address. NAND has to handle bad tracks. This means that NOR flash drivers are pretty simple. I used to have one for an Intel 386EX evaluation board. I only ever used the NOR for booting, never writing from the application. With GEOM in FreeBSD, writing a NOR driver is a simple exercise. All the file system stuff is handled by GEOM and above, leaving just the low level IO to be handled by the driver. All you have to do is locate the NOR flash and read from it. :-P Writing probably requires you to write the entire flash block. I doubt that NOR flash is designed for read/write like a file system would expect to do. -- John Birrell