From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from mail.microcatalog.org.uk ([217.6.246.34] helo=root.phytec.de) by canuck.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1QwYTw-00017R-9c for barebox@lists.infradead.org; Thu, 25 Aug 2011 11:52:25 +0000 From: =?UTF-8?q?Teresa=20G=C3=A1mez?= Date: Thu, 25 Aug 2011 13:52:12 +0200 Message-Id: <1314273132-4060-1-git-send-email-t.gamez@phytec.de> 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-bounces@lists.infradead.org Errors-To: barebox-bounces+u.kleine-koenig=pengutronix.de@lists.infradead.org Subject: [PATCHv2] cfi_flash: support of u32 cmd To: s.hauer@pengutronix.de Cc: barebox@lists.infradead.org U29tZSBOT1IgZmxhc2ggY2hpcHMgaGF2ZSBjb21tYW5kcyB3aXRoIGxlbmd0aCBncmVhdGVyIHRo YW4gdGhlIG1heGltdW0KdmFsdWUgc2l6ZSBvZiB1Y2hhci4KCkJhc2VkIG9uIGFuIFUtQm9vdCBQ YXRjaCBieSBWYXNpbGl5IExlb2VuZW5rbyA8dmFzaWxpeS5sZW9uZW5rb0BtYWlsLnJ1PgoKT25s eSB0ZXN0ZWQgd2l0aCBsaXR0bGUgZW5kaWFuIG9uIGFuIGludGVsIGNmaV9mbGFzaC4KClNpZ25l ZC1vZmYtYnk6IFRlcmVzYSBHw6FtZXogPHQuZ2FtZXpAcGh5dGVjLmRlPgotLS0KIGRyaXZlcnMv bm9yL2NmaV9mbGFzaC5jICAgICAgIHwgICAzNSArKysrKysrKysrKysrKysrKysrKysrKysrKy0t LS0tLS0tLQogZHJpdmVycy9ub3IvY2ZpX2ZsYXNoLmggICAgICAgfCAgIDExICsrKysrKystLS0t CiBkcml2ZXJzL25vci9jZmlfZmxhc2hfYW1kLmMgICB8ICAgIDggKysrKy0tLS0KI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