From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from smtp08.smtpout.orange.fr ([80.12.242.130] helo=smtp.smtpout.orange.fr) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1Y9JbJ-00054m-EF for barebox@lists.infradead.org; Thu, 08 Jan 2015 20:22:44 +0000 From: Robert Jarzmik Date: Thu, 8 Jan 2015 21:22:01 +0100 Message-Id: <1420748521-9890-1-git-send-email-robert.jarzmik@free.fr> MIME-Version: 1.0 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 Sender: "barebox" Errors-To: barebox-bounces+u.kleine-koenig=pengutronix.de@lists.infradead.org Subject: [PATCH v3] mtd: nand: add mrvl-nand driver To: barebox@lists.infradead.org, Ezequiel Garcia , Sascha Hauer VGhlIGRyaXZlciBpcyB0YWtlbiBmcm9tIHRoZSBMaW51eCBrZXJuZWwsIHdpdGggdGhlIGZvbGxv d2luZyBjaGFuZ2VzIDoKIC0gYWxsIERNQSByZW1vdmVkCiAtIGFsbCBhc3luY2hyb25vdXMgaGFu ZGxpbmcgcmVtb3ZlZCwgaW5jbHVkaW5nIHRoZSBpbnRlcnJ1cHQgaGFuZGxlciwKICAgYW5kIHRo ZSBhc3luY2hyb25vdXMgc3RhdGUgaGFuZGxpbmcKIC0gcHhhIGFybWFkYSBzdXBwb3J0IHJlbW92 ZWQKCk1vc3QgdGhlIGtlcm5lbCBzdHJ1Y3R1cmUgd2FzIGtlcHQsIHRvIGVhc2UgdXAgZnV0dXJl IGZpeGVzIGludGVncmF0aW9uCmZyb20gdGhlIGtlcm5lbCBkcml2ZXIuCgpUaGUgZHJpdmVyIGlz IHRlc3RlZCBvbiBhIHB4YTN4eCBzeXN0ZW0gZGV2ZWxvcG1lbnQKYm9hcmQgKGFrYS4genlsb25p dGUpLCBhbmQgcmVhZGluZywgd3JpdGluZywgZXJhc2luZywgYW5kIGJhZCB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