From owner-freebsd-mips@FreeBSD.ORG Mon Nov 2 04:17:04 2009 Return-Path: Delivered-To: freebsd-mips@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 64D30106568F; Mon, 2 Nov 2009 04:17:04 +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 049A48FC16; Mon, 2 Nov 2009 04:17:03 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.3/8.14.1) with ESMTP id nA248Q2E062002; Sun, 1 Nov 2009 21:08:31 -0700 (MST) (envelope-from imp@bsdimp.com) Date: Sun, 01 Nov 2009 21:08:43 -0700 (MST) Message-Id: <20091101.210843.-726381605.imp@bsdimp.com> To: lihong@ieee.org From: "M. Warner Losh" In-Reply-To: <1257126338.3097.7.camel@localhost> References: <1257124725.3097.2.camel@localhost> <20091102012345.GA49898@citylink.fud.org.nz> <1257126338.3097.7.camel@localhost> 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 Cc: gonzo@freebsd.org, freebsd-mips@freebsd.org, andy@fud.org.nz Subject: Re: Add Wistron RPAA-82 board support X-BeenThere: freebsd-mips@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting FreeBSD to MIPS List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Nov 2009 04:17:04 -0000 In message: <1257126338.3097.7.camel@localhost> Eric writes: : On Mon, 2009-11-02 at 14:23 +1300, Andrew Thompson wrote: : > On Mon, Nov 02, 2009 at 09:18:45AM +0800, Eric wrote: : > > On Wed, 2009-10-28 at 22:52 -0700, Oleksandr Tymoshenko wrote: : > > > There are some excessive code in the patch. e.g. GEOM will take care for : > > > use that data offset and size are sector-size aligned/multiple. So I reworked : > > > your patch a little bit: : > > > http://people.freebsd.org/~gonzo/mips/mx25.diff : > > > : > > > Could you, please, test it and let me know if it works for you. : > > > : > > > Thanks! : > > : > > It cannot format redboot partition by newfs: : > > uhub1: 2 ports with 2 removable, self powered : > > redboot/fbsd-root.uzip: 6144 x 8192 blocks : > > Trying to mount root from ufs:/dev/redboot/fbsd-root.uzip : > > warning: no time-of-day clock registered, system time will not be set : > > accurately : > > start_init: trying /etc/init : > > eval: cannot create /flash/hostid: Read-only file system : > > /etc/rc: WARNING: could not store hostuuid in /flash/hostid. : > > mount: /dev/ufs/config : No such file or directory : > > Mounting /etc/fstab filesystems failed, startup aborted : > > ERROR: ABORTING BOOT (sending SIGTERM to parent)! : > > Oct 27 01:58:39 init: /bin/sh on /etc/rc terminated abnormally, going to : > > single user mode : > > Enter full pathname of shell or RETURN for /bin/sh: : > > # : > > # : > > # df : > > Filesystem 512-blocks Used Avail Capacity Mounted on : > > /dev/redboot/fbsd-root.uzip 98078 62252 27980 69% / : > > devfs 2 2 0 100% /dev : > > # ls /dev/redboot : > > FIS directory RedBoot config fbsd-kern fbsd-root.uzip vmlinux.bin.l7 : > > RedBoot fbsd-data fbsd-root rootfs : > > # newfs -n -o space -L config -O 1 -b 4096 -f 512 /dev/redboot/fbsd-data : > > /dev/redboot/fbsd-data: 0.6MB (1280 sectors) block size 4096, fragment : > > size 512 : > > using 4 cylinder groups of 0.16MB, 41 blks, 96 inodes. : > > super-block backups (for fsck -b #) at: : > > newfs: wtfs: 20480 bytes at sector 32: Invalid argument : > : > The problem here is the flash sector size is 64k. Pretending the flash : > has a 512b sector isnt the right way, you would be better off having a : > geom class to do the transformation+caching. : > : > : > Andrew : : So, the better way is that add a new geom class to support different : erase and program size? : I referred XOR flash sys/dev/cfi/cfi_disk.c at first. It set disk sector : size to 512 even erase size is 128k. Yea. That's not quite right... when I did the spi flash, I exported the actual write sector size. on SPI flash, however, you don't have to erase it: the controller will do that for you (it is less efficient, however). We do need to have a good geom layer that does this. We also need a good flash file system as well... Warner