From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from smtp12.smtpout.orange.fr ([80.12.242.134] helo=smtp.smtpout.orange.fr) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1YA49H-0004X5-AY for barebox@lists.infradead.org; Sat, 10 Jan 2015 22:04:51 +0000 From: Robert Jarzmik Date: Sat, 10 Jan 2015 23:04:09 +0100 Message-Id: <1420927449-31748-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 v4] mtd: nand: add mrvl-nand driver To: barebox@lists.infradead.org, Sascha Hauer , Ezequiel Garcia VGhlIGRyaXZlciBpcyB0YWtlbiBmcm9tIHRoZSBMaW51eCBrZXJuZWwsIHdpdGggdGhlIGZvbGxv d2luZyBjaGFuZ2VzIDoKIC0gYWxsIERNQSByZW1vdmVkCiAtIGFsbCBhc3luY2hyb25vdXMgaGFu ZGxpbmcgcmVtb3ZlZCwgaW5jbHVkaW5nIHRoZSBpbnRlcnJ1cHQgaGFuZGxlciwKICAgYW5kIHRo ZSBhc3luY2hyb25vdXMgc3RhdGUgaGFuZGxpbmcKIC0gcHhhIGFybWFkYSBzdXBwb3J0IHJlbW92 ZWQKCk1vc3QgdGhlIGtlcm5lbCBzdHJ1Y3R1cmUgd2FzIGtlcHQsIHRvIGVhc2UgdXAgZnV0dXJl IGZpeGVzIGludGVncmF0aW9uCmZyb20gdGhlIGtlcm5lbCBkcml2ZXIuCgpUaGUgZHJpdmVyIGlz IHRlc3RlZCBvbiBhIHB4YTN4eCBzeXN0ZW0gZGV2ZWxvcG1lbnQKYm9hcmQgKGFrYS4genlsb25p dGUpLCBhbmQgcmVhZGluZywgd3JpdGluZywgZXJhc2luZywgYW5kIGJhZCBibG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