From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from metis.ext.pengutronix.de ([2001:67c:670:201:290:27ff:fe1d:cc33]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jppAT-0005Rh-51 for barebox@lists.infradead.org; Mon, 29 Jun 2020 08:29:33 +0000 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> <2007203678.240919.1593419006986.JavaMail.zimbra@kalray.eu> From: Ahmad Fatoum Message-ID: Date: Mon, 29 Jun 2020 10:29:31 +0200 MIME-Version: 1.0 In-Reply-To: <2007203678.240919.1593419006986.JavaMail.zimbra@kalray.eu> Content-Language: en-US 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: =?UTF-8?Q?Cl=c3=a9ment_Leger?= Cc: Barebox List SGVsbG8gQ2xlbWVudCwKCk9uIDYvMjkvMjAgMTA6MjMgQU0sIENsw6ltZW50IExlZ2VyIHdyb3Rl Ogo+IEhpIEFobWFkCj4gCj4gLS0tLS0gT24gMjkgSnVuLCAyMDIwLCBhdCAxMDoxNSwgQWhtYWQg RmF0b3VtIGEuZmF0b3VtQHBlbmd1dHJvbml4LmRlIHdyb3RlOgo+IAo+PiBIZWxsbywKPj4KPj4g T24gNi8yNC8yMCA5OjE1IEFNLCBDbMOpbWVudCBMZWdlciB3cm90ZToKPj4+PiBZb3UgYWxyZWFk eSBmbHVzaGVkIG91dCB0aGUgZGNhY2hlIGNvbnRlbnRzIHRvIHRoZSBwb2ludCBvZiB1bmlmaWNh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ICAgICAgICAgICAgICAgICB8ClN0ZXVlcndhbGRlciBTdHIuIDIxICAgICAg ICAgICAgICAgICAgICAgICB8IGh0dHA6Ly93d3cucGVuZ3V0cm9uaXguZGUvICB8CjMxMTM3IEhp bGRlc2hlaW0sIEdlcm1hbnkgICAgICAgICAgICAgICAgICB8IFBob25lOiArNDktNTEyMS0yMDY5 MTctMCAgICB8CkFtdHNnZXJpY2h0IEhpbGRlc2hlaW0sIEhSQSAyNjg2ICAgICAgICAgICB8IEZh eDogICArNDktNTEyMS0yMDY5MTctNTU1NSB8CgpfX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fXwpiYXJlYm94IG1haWxpbmcgbGlzdApiYXJlYm94QGxpc3RzLmlu ZnJhZGVhZC5vcmcKaHR0cDovL2xpc3RzLmluZnJhZGVhZC5vcmcvbWFpbG1hbi9saXN0aW5mby9i YXJlYm94Cg==