From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from smtp05.smtpout.orange.fr ([80.12.242.127] helo=smtp.smtpout.orange.fr) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1Y6nlv-00083u-7x for barebox@lists.infradead.org; Thu, 01 Jan 2015 21:59:15 +0000 From: Robert Jarzmik Date: Thu, 1 Jan 2015 22:58:36 +0100 Message-Id: <1420149516-29457-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] mtd: nand: add pxa3xx-nand driver To: barebox@lists.infradead.org VGhlIGRyaXZlciBpcyB0YWtlbiBmcm9tIHRoZSBMaW51eCBrZXJuZWwsIHdpdGggdGhlIGZvbGxv d2luZyBjaGFuZ2VzIDoKIC0gYWxsIERNQSByZW1vdmVkCiAtIGFsbCBhc3luY2hyb25vdXMgaGFu ZGxpbmcgcmVtb3ZlZCwgaW5jbHVkaW5nIHRoZSBpbnRlcnJ1cHQgaGFuZGxlciwKICAgYW5kIHRo ZSBhc3luY2hyb25vdXMgc3RhdGUgaGFuZGxpbmcKIC0gcHhhIGFybWFkYSBzdXBwb3J0IHJlbW92 ZWQKCk1vc3QgdGhlIGtlcm5lbCBzdHJ1Y3R1cmUgd2FzIGtlcHQsIHRvIGVhc2UgdXAgZnV0dXJl IGZpeGVzIGludGVncmF0aW9uCmZyb20gdGhlIGtlcm5lbCBkcml2ZXIuCgpUaGUgZHJpdmVyIGlz IHRlc3RlZCBvbiBhIHB4YTN4eCBzeXN0ZW0gZGV2ZWxvcG1lbnQKYm9hcmQgKGFrYS4genlsb25p dGUpLCBhbmQgcmVhZGluZywgd3JpdGluZywgZXJhc2luZywgYW5kIGJhZCBibG9jawptYW5hZ2Vt ZW50I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