From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from fmmailgate02.web.de ([217.72.192.227]) by canuck.infradead.org with esmtp (Exim 4.72 #1 (Red Hat Linux)) id 1PUwr7-00085k-Kv for barebox@lists.infradead.org; Tue, 21 Dec 2010 07:41:59 +0000 Date: Tue, 21 Dec 2010 08:41:55 +0100 From: Sascha Hauer Message-ID: <20101221074155.GU6017@pengutronix.de> References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: 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: Re: [PATCH 6] ARM: support big/little endian switching in "bootz". To: Krzysztof Halasa Cc: barebox@lists.infradead.org SGkgS3J6eXN6dG9mLAoKT24gTW9uLCBEZWMgMjAsIDIwMTAgYXQgMTE6NTg6MTFQTSArMDEwMCwg S3J6eXN6dG9mIEhhbGFzYSB3cm90ZToKPiBBUk06IHN1cHBvcnQgYmlnL2xpdHRsZSBlbmRpYW4g c3dpdGNoaW5nIGluICJib290eiIuCj4gUGVyaGFwcyBvbmUgc2hvdWxkIG1ha2UgdGhpcyBjb25k aXRpb25hbD8gTW9zdGx5IGZvciBiaWctZW5kaWFuCj4gQmFyZWJveCBsb2FkaW5nIGxpdHRsZS1l bmRpYW4gKGUuZy4gYXJtZWwgRGViaWFuKSBMaW51eC4KCk1ha2luZyBpdCBjb25kaXRpb25hbCBj b3VsZCByZXF1aXJlIGEgbG90IG9mIGlmZGVmcywgbWF5YmUgeW91IGNvdWxkCmp1c3QgZG8uLi4K Cj4gCj4gU2lnbmVkLW9mZi1ieTogS3J6eXN6dG9mIEhhxYJhc2EgPGtoY0BwbS53YXcucGw+Cj4g Cj4gZGlmZiAtLWdpdCBhL2FyY2gvYXJtL2xpYi9hcm1saW51eC5jIGIvYXJjaC9hcm0vbGliL2Fy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wlpZiAoc3dhcCkgewo+ ICsJCXUzMiByZWc7Cj4gKwkJX19hc21fXyBfX3ZvbGF0aWxlX18oIm1yYyBwMTUsIDAsICUwLCBj MSwgYzAiIDogIj1yIiAocmVnKSk7Cj4gKwkJcmVnIF49IENSX0I7IC8qIHN3YXAgYmlnLWVuZGlh biBmbGFnICovCj4gKwkJX19hc21fXyBfX3ZvbGF0aWxlX18oIm1jciBwMTUsIDAsICUwLCBjMSwg YzAiIDo6ICJyIiAocmVnKSk7Cj4gKwl9Cj4gKwo+ICAJdGhlS2VybmVsKDAsIGFybWxpbnV4X2Fy Y2hpdGVjdHVyZSwgYXJtbGludXhfYm9vdHBhcmFtcyk7Cj4gIAo+ICAJcmV0dXJuIDA7Cj4gCj4g X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KPiBiYXJlYm94 IG1haWxpbmcgbGlzdAo+IGJhcmVib3hAbGlzdHMuaW5mcmFkZWFkLm9yZwo+IGh0dHA6Ly9saXN0 cy5pbmZyYWRlYWQub3JnL21haWxtYW4vbGlzdGluZm8vYmFyZWJveAoKLS0gClBlbmd1dHJvbml4 IGUuSy4gICAgICAgICAgICAgICAgICAgICAgICAgICB8ICAgICAgICAgICAgICAgICAgICAgICAg ICAgICB8CkluZHVzdHJpYWwgTGludXggU29sdXRpb25zICAgICAgICAgICAgICAgICB8IGh0dHA6 Ly93d3cucGVuZ3V0cm9uaXguZGUvICB8ClBlaW5lciBTdHIuIDYtOCwgMzExMzcgSGlsZGVzaGVp bSwgR2VybWFueSB8IFBob25lOiArNDktNTEyMS0yMDY5MTctMCAgICB8CkFtdHNnZXJpY2h0IEhp bGRlc2hlaW0sIEhSQSAyNjg2ICAgICAgICAgICB8IEZheDogICArNDktNTEyMS0yMDY5MTctNTU1 NSB8CgpfX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fXwpiYXJl Ym94IG1haWxpbmcgbGlzdApiYXJlYm94QGxpc3RzLmluZnJhZGVhZC5vcmcKaHR0cDovL2xpc3Rz LmluZnJhZGVhZC5vcmcvbWFpbG1hbi9saXN0aW5mby9iYXJlYm94Cg==