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.90_1 #2 (Red Hat Linux)) id 1fOV7e-0000k2-4E for barebox@lists.infradead.org; Thu, 31 May 2018 21:28:40 +0000 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= Date: Thu, 31 May 2018 23:28:17 +0200 Message-Id: <20180531212817.32604-1-u.kleine-koenig@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: [PATCH] kwbimage_v0: add support to detect and boot a mvebu v0 image To: barebox@lists.infradead.org VGhlIGRpZmZlcmVuY2VzIGJldHdlZW4gdjAgYW5kIHYxIG9mIHRoZSBtdmVidSBrd2JpbWFnZSBh cmUgc21hbGwgZW5vdWdoCnRoYXQgdGhlIGZ1bmN0aW9uIHRvIGJvb3Qgc3VjaCBhbiBpbWFnZSBj YW4gYmUgc2hhcmVkIGJldHdlZW4gYm90aAp2YXJpYW50cy4KClNpZ25lZC1vZmYtYnk6IFV3ZSBL bGVpbmUtS8O2bmlnIDx1LmtsZWluZS1rb2VuaWdAcGVuZ3V0cm9uaXguZGU+Ci0tLQogYXJjaC9h cm0vbWFjaC1tdmVidS9rd2Jvb3RpbWFnZS5jIHwgMTEgKysrKysrKysrLS0KIGNvbW1vbi9maWxl dHlwZS5jICAgICAgICAgICAgICAgICB8IDIyICsrKysrKysrKysrKysrKysrLS0tLS0KIGluY2x1 ZGUvZmlsZXR5cGUuaCAgICAgICAgICAgICAgICB8ICAxICsKIDMgZmlsZXMgY2hhbmdlZCwgMjcg aW5zZXJ0aW9ucygrKSwgNyBkZWxldGlvbnMoLSkKCmRpZmYgLS1naXQgYS9hcmNoL2FybS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