From owner-freebsd-embedded@FreeBSD.ORG Thu Nov 7 08:33:11 2013 Return-Path: Delivered-To: freebsd-embedded@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id F0EFAC2C; Thu, 7 Nov 2013 08:33:11 +0000 (UTC) (envelope-from kp@vega.codepro.be) Received: from venus.codepro.be (venus.codepro.be [IPv6:2a01:4f8:162:1127::2]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B46B92546; Thu, 7 Nov 2013 08:33:11 +0000 (UTC) Received: from vega.codepro.be (unknown [172.16.1.3]) by venus.codepro.be (Postfix) with ESMTP id 11DFD9B14; Thu, 7 Nov 2013 09:33:09 +0100 (CET) Received: by vega.codepro.be (Postfix, from userid 1001) id 0BDDCDF3E; Thu, 7 Nov 2013 09:33:09 +0100 (CET) Date: Thu, 7 Nov 2013 09:33:09 +0100 From: Kristof Provost To: Ian Lepore Subject: Re: Incorrect struct onfi_params definition Message-ID: <20131107083308.GH58987@vega.codepro.be> References: <20131106212855.GF58987@vega.codepro.be> <1383782353.31172.183.camel@revolution.hippie.lan> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <1383782353.31172.183.camel@revolution.hippie.lan> X-PGP-Fingerprint: E114 D9EA 909E D469 8F57 17A5 7D15 91C6 9EFA F286 User-Agent: Mutt/1.5.22 (2013-10-16) Cc: Grzegorz Bernacki , freebsd-embedded@FreeBSD.org X-BeenThere: freebsd-embedded@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Dedicated and Embedded Systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Nov 2013 08:33:12 -0000 On 2013-11-06 16:59:13 (-0700), Ian Lepore wrote: > On Wed, 2013-11-06 at 22:28 +0100, Kristof Provost wrote: > > The definition of struct onfi_params in sys/dev/nand/nand.h is > > incorrect. The total structure size should be 256 bytes, but it's only > > 176 bytes. > > > There's more wrong with the onfi support than just that. The biggie is > that it doesn't handle packed/unaligned accesses and the endianess of > the data in the struct. I've got patches from like a year ago that I've > been meaning to dust off and check in. They address more than just the > onfi, and they contain a mix of unrelated stuff and style changes, so > there's some work involved in making them committable. > > I'll attach them here so you can at least get an idea what I'm talking > about and see if there's anything useful for you in them. > Thanks. I see these patches also fix the original problem I was chasing. I have an OpenRD board with a flash chip which claims to be ONFI but isn't. It replies 'ONFI' when I read the ID, but gives me empty parameters. The CRC check should at least detect that. I won't be able to test the ONFI case, but I'll try to pick the patches apart and submit them. Regards, Kristof