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 bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1iNcfh-0006Bq-ME for barebox@lists.infradead.org; Thu, 24 Oct 2019 12:56:59 +0000 Date: Thu, 24 Oct 2019 14:56:55 +0200 From: Michael Tretter Message-ID: <20191024145655.1c939d37@litschi.hi.pengutronix.de> In-Reply-To: <1571912781-17152-4-git-send-email-thomas.haemmerle@wolfvision.net> References: <1571912781-17152-1-git-send-email-thomas.haemmerle@wolfvision.net> <1571912781-17152-4-git-send-email-thomas.haemmerle@wolfvision.net> 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 3/5] firmware: zynqmp-fpga: introduce driver to load bitstream to FPGA To: Thomas =?UTF-8?B?SMOkbW1lcmxl?= Cc: "barebox@lists.infradead.org" T24gVGh1LCAyNCBPY3QgMjAxOSAxMDoyNjo1MSArMDAwMCwgVGhvbWFzIEjDpG1tZXJsZSB3cm90 ZToKPiBGcm9tOiBUaG9tYXMgSGFlbW1lcmxlIDx0aG9tYXMuaGFlbW1lcmxlQHdvbGZ2aXNpb24u bmV0Pgo+IAo+IFRoZSBkcml2ZXIgcHJvdmlkZXMgZnVuY3Rpb25hbGl0aWVzIHRvIGNoZWNrIGFu ZCBsb2FkIGEgYml0c3RyZWFtIHRvIEZQR0EuCj4gQSBib29sZWFuIHBhcmFtZXRlciB0byBjaGVj ayBpZiBGUEdBIGlzIGFscmVhZHkgcHJvZ3JhbW1lZCBpcwo+IGFkZGVkLgo+IAo+IFNpZ25lZC1v ZmYtYnk6IFRob21hcyBIYWVtbWVybGUgPHRob21hcy5oYWVtbWVybGVAd29sZnZpc2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