From owner-freebsd-embedded@FreeBSD.ORG Tue Sep 18 20:51:08 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 79B4B16A417 for ; Tue, 18 Sep 2007 20:51:08 +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 1ACF513C46A for ; Tue, 18 Sep 2007 20:51:08 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.1/8.13.4) with ESMTP id l8IKoIpZ035183; Tue, 18 Sep 2007 14:50:18 -0600 (MDT) (envelope-from imp@bsdimp.com) Date: Tue, 18 Sep 2007 14:50:34 -0600 (MDT) Message-Id: <20070918.145034.669287571.imp@bsdimp.com> To: aduane@juniper.net From: "M. Warner Losh" In-Reply-To: <0FCFCF6165E968449991746EB91D614D913E8E@antipi.jnpr.net> References: <0FCFCF6165E968449991746EB91D614D913E8E@antipi.jnpr.net> X-Mailer: Mew version 5.2 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-2.0 (harmony.bsdimp.com [127.0.0.1]); Tue, 18 Sep 2007 14:50:19 -0600 (MDT) 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 20:51:08 -0000 In message: <0FCFCF6165E968449991746EB91D614D913E8E@antipi.jnpr.net> "Andrew Duane" writes: : We just changed a design on a board, and I'm now looking at putting our : filesystems on a Spansion NOR flash. Are there any drivers for this : readily available? I doubt the vendor will have anything to help me. Andrew, 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. A quick search of the intel site shows: http://www.intel.com/design/flcomp/datashts/315567.htm to be one of the places to get data on these part. Spansion is the new name for AMD's flash memory. In the past I know that AMD and Intel flash memories operated the same for both NAND and NOR. A quick peek at Linux's mtd driver confirms this. I don't see any Spansion stuff in the mtd version that I have, but plenty of AMD stuff. The following page suggests has tons of datasheets for Spansion memory, continuing the trend from AMD and other flash memory makers of providing fairly complete docs for years: http://www.spansion.com/flash_memory_products/support/technical_documents/flash_datasheets.html The s29ws-j_00_a6_e datasheet has command lists and the like that would be necessary to write a driver for this part. I didn't check any others, but I'm sure at least some of them would have this information. Since the commands are simple, the harder part would be the 'bridge' code that's necessary to send/receive commands and data to/from the card. There are some experimental reports that suggest doing this in an abstract way is very slow. Linux's MTD driver suggests that it is possible to do in an abstract manner without too much of a hit. Of course, your biggest issue may be tuning your application to operate in an extremely limited write environment. JB's nand driver did some primitive wear averaging, which likely is sufficient for low data write rates on larger parts when using ufs. However, higher data rates likely need a filesystem that's optimized for flash. Warner P.S. I've wanted to do a Flash layer for FreeBSD for some time, but could never find someone to fund it.