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 1fRCz6-0005xQ-7Q for barebox@lists.infradead.org; Fri, 08 Jun 2018 08:43:01 +0000 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= Date: Fri, 8 Jun 2018 10:42:44 +0200 Message-Id: <20180608084244.12816-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] mvebu: create bbu handler for kwb images and use it on cubox To: barebox@lists.infradead.org U2lnbmVkLW9mZi1ieTogVXdlIEtsZWluZS1Lw7ZuaWcgPHUua2xlaW5lLWtvZW5pZ0BwZW5ndXRy b25peC5kZT4KLS0tCkhlbGxvLAoKdG9nZXRoZXIgd2l0aCB0aGUgZml4dXAgZm9yIHdyaXRlX2Zp bGVfZmxhc2ggdG8gbm90IHVzZSBPX1RSVU5DIGFuZApPX0NSRUFULCB0aGlzIHdhcyB0ZXN0ZWQg b24gdG9wIG9mIG5leHQuCgpCZXN0IHJlZ2FyZHMKVXdlCgogYXJjaC9hcm0vYm9hcmRzL3NvbGlk cnVuLWN1Ym94L2JvYXJkLmMgfCAxNSArKysrKystCiBhcmNoL2FybS9tYWNoLW12ZWJ1L01ha2Vm aWxlICAgICAgICAgICB8ICAxICsKIGFyY2gvYXJtL21hY2gtbXZlYnUvaW5jbHVkZS9tYWNoL2Ji dS5oIHwgIDMgKysKIGFyY2gvYXJtL21hY2gtbXZlYnUva3diX2JidS5jICAgICAgICAgIHwgNTQg KysrKysrKysrKysrKysrKysrKysrKysrKysKIDQgZmlsZXMgY2hhbmdlZCwgNzIgaW5zZ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