From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from zimbra2.kalray.eu ([92.103.151.219]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jpp4d-0004eY-4V for barebox@lists.infradead.org; Mon, 29 Jun 2020 08:23:32 +0000 Date: Mon, 29 Jun 2020 10:23:26 +0200 (CEST) From: =?utf-8?Q?Cl=C3=A9ment?= Leger Message-ID: <2007203678.240919.1593419006986.JavaMail.zimbra@kalray.eu> In-Reply-To: <40a7f463-db1b-1241-13e5-a8a454393c75@pengutronix.de> References: <20200623193506.13716-1-cleger@kalray.eu> <20200623193506.13716-5-cleger@kalray.eu> <2ba71698-8c76-ef33-145c-3a587327492e@pengutronix.de> <755055850.8699790.1592982949409.JavaMail.zimbra@kalray.eu> <40a7f463-db1b-1241-13e5-a8a454393c75@pengutronix.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: Re: [PATCH 4/4] kvx: add support for elf loading using bootm To: Ahmad Fatoum Cc: Barebox List SGkgQWhtYWQKCi0tLS0tIE9uIDI5IEp1biwgMjAyMCwgYXQgMTA6MTUsIEFobWFkIEZhdG91bSBh LmZhdG91bUBwZW5ndXRyb25peC5kZSB3cm90ZToKCj4gSGVsbG8sCj4gCj4gT24gNi8yNC8yMCA5 OjE1IEFNLCBDbMOpbWVudCBMZWdlciB3cm90ZToKPj4+IFlvdSBhbHJlYWR5IGZsdXNoZWQgb3V0 IHRoZSBkY2FjaGUgY29udGVudHMgdG8gdGhlIHBvaW50IG9mIHVuaWZpY2F0aW9uLgo+Pj4gV2hh dCBkbyB5b3UgZ2FpbiBieSBpbnZhbGlkYXRpbmcgaXQ/Cj4+IAo+PiBJbmRlZWQsIHRoaXMgaXMg bm90IHN0cmljdGx5IG5lY2Vz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AgICAgICAgICAgICAgIHwgaHR0 cDovL3d3dy5wZW5ndXRyb25peC5kZS8gIHwKPiAzMTEzNyBIaWxkZXNoZWltLCBHZXJtYW55ICAg ICAgICAgICAgICAgICAgfCBQaG9uZTogKzQ5LTUxMjEtMjA2OTE3LTAgICAgfAo+IEFtdHNnZXJp Y2h0IEhpbGRlc2hlaW0sIEhSQSAyNjg2ICAgICAgICAgICB8IEZheDogICArNDktNTEyMS0yMDY5 MTctNTU1NSB8CgpfX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f XwpiYXJlYm94IG1haWxpbmcgbGlzdApiYXJlYm94QGxpc3RzLmluZnJhZGVhZC5vcmcKaHR0cDov L2xpc3RzLmluZnJhZGVhZC5vcmcvbWFpbG1hbi9saXN0aW5mby9iYXJlYm94Cg==