Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 21 May 2013 21:03:46 +0400
From:      Alexander Fedorov <alexander.fedorov@rtlservice.com>
To:        current@freebsd.org
Subject:   [PATCH] NAND Framework ONFI chip detection
Message-ID:  <CAOcOT_z9wCPj7yf-TjGjdyQf7mEQZug0ppAGGZMwpe2H5Sgxbg@mail.gmail.com>

next in thread | raw e-mail | index | archive | help
--089e01294e7cb3300004dd3d6e23
Content-Type: text/plain; charset=ISO-8859-1

Hi all!

I'm writing NAND Flash controller driver for my Hackberry board.
And I found that NAND Framework does not properly detecting ONFI
compiliant chips.

First, ONFI specification says (p. 40
http://www.onfi.org/~/media/ONFI/specs/ONFI_1_0_Gold.pdf):

>The ONFI signature is the ASCII encoding of 'ONFI' where 'O' = 4Fh, 'N' = 4Eh, 'F' = 46h, 'I' = 49h.

But, current code check it for 'o', 'n', 'f', 'I'.

Second, function "onfi_read_parameter" (nand_generic.c) read
parameters page using this construction:
>NANDBUS_READ_BUFFER(nandbus, params, sizeof(struct onfi_params));

So, structure onfi_params must be declared as packed.

Proposed patch solves the problem for me.
Is this patch ok?

--089e01294e7cb3300004dd3d6e23
Content-Type: application/octet-stream; 
	name="nand_framework_onfi_probing.patch"
Content-Disposition: attachment; 
	filename="nand_framework_onfi_probing.patch"
Content-Transfer-Encoding: base64
X-Attachment-Id: f_hgzc5ous0

SW5kZXg6IG5hbmQuaAo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09Ci0tLSBuYW5kLmgJKHJldmlzaW9uIDI1MDg1NykKKysr
IG5hbmQuaAkod29ya2luZyBjb3B5KQpAQCAtMjE5LDcgKzIxOSw3IEBACiAJdWludDE2X3QJdmVu
ZG9yX3JldjsKIAl1aW50OF90CQl2ZW5kb3Jfc3BlY1s4XTsKIAl1aW50MTZfdAljcmM7Ci19Owor
fV9fYXR0cmlidXRlX18oKHBhY2tlZCkpOwogCiBzdHJ1Y3QgbmFuZF9lY2NfZGF0YSB7CiAJaW50
CWVjY3NpemU7CQkvKiBOdW1iZXIgb2YgZGF0YSBieXRlcyBwZXIgRUNDIHN0ZXAgKi8KSW5kZXg6
IG5hbmRidXMuYwo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09Ci0tLSBuYW5kYnVzLmMJKHJldmlzaW9uIDI1MDg1NykKKysr
IG5hbmRidXMuYwkod29ya2luZyBjb3B5KQpAQCAtMzMxLDcgKzMzMSw3IEBACiBuYW5kX3Byb2Jl
X29uZmkoZGV2aWNlX3QgYnVzLCB1aW50OF90ICpvbmZpX2NvbXBsaWFudCkKIHsKIAlkZXZpY2Vf
dCBuZmM7Ci0JY2hhciBvbmZpX2lkW10gPSB7J28nLCAnbicsICdmJywgJ2knLCAnXDAnfTsKKwlj
aGFyIG9uZmlfaWRbXSA9IHsnTycsICdOJywgJ0YnLCAnSScsICdcMCd9OwogCWludCBpOwogCiAJ
bmFuZF9kZWJ1ZyhOREJHX0JVUywicHJvYmluZyBPTkZJIik7Cg==
--089e01294e7cb3300004dd3d6e23--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAOcOT_z9wCPj7yf-TjGjdyQf7mEQZug0ppAGGZMwpe2H5Sgxbg>