From owner-freebsd-current@FreeBSD.ORG Fri May 24 10:51:59 2013 Return-Path: Delivered-To: current@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 30A53C21 for ; Fri, 24 May 2013 10:51:59 +0000 (UTC) (envelope-from alexander.fedorov@rtlservice.com) Received: from mail-ob0-x233.google.com (mail-ob0-x233.google.com [IPv6:2607:f8b0:4003:c01::233]) by mx1.freebsd.org (Postfix) with ESMTP id F3EE638B for ; Fri, 24 May 2013 10:51:58 +0000 (UTC) Received: by mail-ob0-f179.google.com with SMTP id wo10so1847186obc.38 for ; Fri, 24 May 2013 03:51:58 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:x-gm-message-state; bh=cjUQ/zO8NRkim7A45Xjc+nk0YGtObT4dpgj6yFH3n30=; b=n2A/FRkULJ/zQvHGD8qRQovGs+AcW/Qfh0W2nafAZ7OkeInHHzFd0S6mPErJUpUm6Z q8tpc+HpcO+qngo+iX0r/zBhkff1WUcEo6XvTO2u7YVxo6hCVAiiZoWLnY+lWjSkX7dX dqCOH3OyJCZAFb2sM0icPKPD6LDhHcXIRLu7xX750Y7lza+ieCpSK/qM8zwJUfV0WEe1 2qK0JY4wdHVydWkbj2EB70SUhVff6i9xvRTRjogpnL+jMi1t+28Nh0OcryEuDIWf63kY d6sGoe8PZI3godKXjlceQOgSI5EUZENbnrfAIMAFkfq5BPVuY0F51DJ0kO8aUngH8yaB JeDQ== MIME-Version: 1.0 X-Received: by 10.60.79.198 with SMTP id l6mr11171249oex.47.1369392718485; Fri, 24 May 2013 03:51:58 -0700 (PDT) Received: by 10.60.26.168 with HTTP; Fri, 24 May 2013 03:51:58 -0700 (PDT) In-Reply-To: References: Date: Fri, 24 May 2013 14:51:58 +0400 Message-ID: Subject: Re: [PATCH] NAND Framework ONFI chip detection From: Alexander Fedorov To: current@freebsd.org Content-Type: multipart/mixed; boundary=089e0118289e8b1e9704dd749619 X-Gm-Message-State: ALoCoQneagaT9w07d0d9Jfct3D5kaImzbA6gWCzw+z9jGqQKkVUMhGXwP8pqCaPGQf8LR9350JZy X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 May 2013 10:51:59 -0000 --089e0118289e8b1e9704dd749619 Content-Type: text/plain; charset=ISO-8859-1 Hi, current! I received a positive feedback from Grzegorz Bernacki (semihalf). He said that my patch is ok. Can anyone commit a proposed patch? 2013/5/21 Alexander Fedorov : > 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? --089e0118289e8b1e9704dd749619 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_hh38xdmz1 SW5kZXg6IG5hbmQuaAo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09Ci0tLSBuYW5kLmgJKHJldmlzaW9uIDI1MDg1NykKKysr IG5hbmQuaAkod29ya2luZyBjb3B5KQpAQCAtMjE5LDcgKzIxOSw3IEBACiAJdWludDE2X3QJdmVu ZG9yX3JldjsKIAl1aW50OF90CQl2ZW5kb3Jfc3BlY1s4XTsKIAl1aW50MTZfdAljcmM7Ci19Owor fV9fYXR0cmlidXRlX18oKHBhY2tlZCkpOwogCiBzdHJ1Y3QgbmFuZF9lY2NfZGF0YSB7CiAJaW50 CWVjY3NpemU7CQkvKiBOdW1iZXIgb2YgZGF0YSBieXRlcyBwZXIgRUNDIHN0ZXAgKi8KSW5kZXg6 IG5hbmRidXMuYwo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09Ci0tLSBuYW5kYnVzLmMJKHJldmlzaW9uIDI1MDg1NykKKysr IG5hbmRidXMuYwkod29ya2luZyBjb3B5KQpAQCAtMzMxLDcgKzMzMSw3IEBACiBuYW5kX3Byb2Jl X29uZmkoZGV2aWNlX3QgYnVzLCB1aW50OF90ICpvbmZpX2NvbXBsaWFudCkKIHsKIAlkZXZpY2Vf dCBuZmM7Ci0JY2hhciBvbmZpX2lkW10gPSB7J28nLCAnbicsICdmJywgJ2knLCAnXDAnfTsKKwlj aGFyIG9uZmlfaWRbXSA9IHsnTycsICdOJywgJ0YnLCAnSScsICdcMCd9OwogCWludCBpOwogCiAJ bmFuZF9kZWJ1ZyhOREJHX0JVUywicHJvYmluZyBPTkZJIik7Cg== --089e0118289e8b1e9704dd749619--