From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from vsmx012.vodafonemail.xion.oxcs.net ([153.92.174.90]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jrOQb-0005Z9-Sf for barebox@lists.infradead.org; Fri, 03 Jul 2020 16:20:43 +0000 From: giorgio.nicole@arcor.de Date: Fri, 3 Jul 2020 18:20:17 +0200 Message-Id: <20200703162017.8217-1-giorgio.nicole@arcor.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" Errors-To: barebox-bounces+u.kleine-koenig=pengutronix.de@lists.infradead.org Subject: [PATCH] imx-image: added support for the optional 'count' parameter of the 'check data' command in the DCD. To: barebox@lists.infradead.org Cc: Giorgio Dal Molin RnJvbTogR2lvcmdpbyBEYWwgTW9saW4gPGdpb3JnaW8ubmljb2xlQGFyY29yLmRlPgoKVGhlIGNv bW1hbmQgJ2NoZWNrIGRhdGEnIGNhbiBiZSB1c2VkIGluIHRoZSBEQ0QgdGFibGUgZm9yIGFuIElN WCBzb2MKdG8gdGVzdCB0aGUgY29udGVudCBvZiBtZW1vcnkgYWRkcmVzc2VzLCB0eXBpY2FsbHkg cmVnaXN0ZXJzIG9mIHNvbWUKc29jIGNvbnRyb2xsZXIuClRoaXMgY29tbWFuZCBzdXBwb3J0cyBh biBvcHRpb25hbCAnY291bnQnIHBhcmFtZXRlciB0aGF0LCB3aGVuIGdpdmVuLAp0ZWxscyB0aGUg Uk9NIGNvZGUgaG93IG1hbnkgdGltZXMgYXQgbW9zdCBpdCdzIGFsbG93ZWQgdG8gcG9sbCB0aGUK bWVtb3J5IGFkZHJlc3MgdG8gbWVldCB0aGUgZ2l2ZW4gbG9naWNhbCBjb25kaXRpb24uIElmIHRo ZSAnY291bnQnCmlzIG5vdCBwcmVzZW50IGluIHRoZSBjb21tYW5kIHRoZSBST00gcG9sb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