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.87 #1 (Red Hat Linux)) id 1cdakY-0000VG-5Z for barebox@lists.infradead.org; Tue, 14 Feb 2017 10:54:23 +0000 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= Date: Tue, 14 Feb 2017 11:53:56 +0100 Message-Id: <20170214105358.6666-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 1/3] mvebu: simplify detection and fixup of MV78230-A0 To: barebox@lists.infradead.org U2lnbmVkLW9mZi1ieTogVXdlIEtsZWluZS1Lw7ZuaWcgPHUua2xlaW5lLWtvZW5pZ0BwZW5ndXRy b25peC5kZT4KLS0tCiBhcmNoL2FybS9tYWNoLW12ZWJ1L2FybWFkYS0zNzAteHAuYyB8IDMxICsr KysrKysrKysrKy0tLS0tLS0tLS0tLS0tLS0tLS0KIDEgZmlsZSBjaGFuZ2VkLCAxMiBpbnNlcnRp b25zKCspLCAxOSBkZWxldGlvbnMoLSkKCmRpZmYgLS1naXQgYS9hcmNoL2FybS9tYWNoLW12ZWJ1 L2FybWFkYS0zNzAteHAuYyBiL2FyY2gvYXJtL21hY2gtbXZlYnUvYXJtYWRhLTM3MC14cC5jCmlu ZGV4IGMzNjJjZmRhYmUyMi4uY2MwZDdiZDYxMmU2IDEwMDY0NAotLS0gYS9hcmNoL2FybS9tYWNo LW12ZWJ1L2FybWFkYS0zNzAteHAuYworKysgYi9hcmNoL2FybS9tYWNoLW12ZWJ1L2FybWFkYS0z NzAteHAuYwpAQCAtNTQsMzEgKzU0LDI0IEBAIHN0YXRpYyBjb25zdCBzdHJ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