From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from mail.x-arc.co.uk ([217.6.246.34] helo=root.phytec.de) by canuck.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1Qw9GE-00073X-OB for barebox@lists.infradead.org; Wed, 24 Aug 2011 08:56:36 +0000 Received: from idefix.phytec.de (idefix.phytec.de [172.16.0.10]) by root.phytec.de (Postfix) with ESMTP id 87D6BBF0CA for ; Wed, 24 Aug 2011 11:00:24 +0200 (CEST) From: =?UTF-8?q?Teresa=20G=C3=A1mez?= Date: Wed, 24 Aug 2011 10:56:15 +0200 Message-Id: <1314176175-22795-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: [PATCH] cfi_flash: support of u32 cmd To: barebox@lists.infradead.org U29tZSBOT1IgZmxhc2ggY2hpcHMgaGF2ZSBjb21tYW5kcyB3aXRoIGxlbmd0aCBncmVhdGVyIHRo YW4gdGhlIG1heGltdW0KdmFsdWUgc2l6ZSBvZiB1Y2hhci4KCkJhc2VkIG9uIGFuIFUtQm9vdCBQ YXRjaCBieSBWYXNpbGl5IExlb2VuZW5rbyA8dmFzaWxpeS5sZW9uZW5rb0BtYWlsLnJ1PgoKT25s eSB0ZXN0ZWQgd2l0aCBsaXR0bGUgZW5kaWFuIG9uIGFuIGludGVsIGNmaV9mbGFzaC4KClNpZ25l ZC1vZmYtYnk6IFRlcmVzYSBHw6FtZXogPHQuZ2FtZXpAcGh5dGVjLmRlPgotLS0KIGRyaXZlcnMv bm9yL2NmaV9mbGFzaC5jICAgICAgIHwgICAzOCArKysrKysrKysrKysrKysrKysrKysrKysrKysr Ky0tLS0tLS0tLQogZHJpdmVycy9ub3IvY2ZpX2ZsYXNoLmggICAgIC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