From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from smtp3-g21.free.fr ([2a01:e0c:1:1599::12]) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1RzdaN-0005Yz-LD for barebox@lists.infradead.org; Tue, 21 Feb 2012 00:28:04 +0000 Received: from localhost.localdomain (unknown [82.233.81.124]) by smtp3-g21.free.fr (Postfix) with ESMTP id 5A014A61C4 for ; Tue, 21 Feb 2012 01:27:58 +0100 (CET) From: =?UTF-8?q?Eric=20B=C3=A9nard?= Date: Tue, 21 Feb 2012 01:27:38 +0100 Message-Id: <1329784059-6006-6-git-send-email-eric@eukrea.com> In-Reply-To: <1329784059-6006-1-git-send-email-eric@eukrea.com> References: <1329784059-6006-1-git-send-email-eric@eukrea.com> 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-bounces@lists.infradead.org Errors-To: barebox-bounces+u.kleine-koenig=pengutronix.de@lists.infradead.org Subject: [PATCH 6/7] mx53-loco: add board revision support To: barebox@lists.infradead.org LSB0aGlzIGlzIHRha2VuIGZyb20gZnJlZXNjYWxlLW14MzUtMy1zdGFjay8zc3RhY2suYyBhbmQg YWxsb3dzCnRoaXMgYm9hcmQgdG8gcnVuIEZyZWVzY2FsZSdzIGtlcm5lbCB3aGljaCByZWxpZXMg b24gdGhlIHN5c3RlbQpyZXZpc2lvbiB0byBjb25maWd1cmUgdGhlIGNvcnJlY3QgUE1JQy4KCi0g T24gcmV2MCBib2FyZHMgKHdpdGggREE5MDUzKSwgdGhlIGxvZyBpcyA6CmRldGVjdGVkIGkuTVg1 MyByZXYgMi4xCk1DSU1YNTMtU1RBUlQgYm9hcmQgMS4wCgpPbiBuZXdlciBib2FyZHMgKHJldiBB IG9yIEIgd2l0aCBNQzM0NzA4KSwgdGhlIGxvZyBpcyA6Cm1jMzQ3MDgtaTJjQG1jMzQ3MD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Km1jMzQ3MDg7CisJaW50IHJl djsKKworCW1jMzQ3MDggPSBtYzM0NzA4X2dldCgpOworCWlmICghbWMzNDcwOCkgeworCQkvKiBz byB3ZSBoYXZlIGEgREE5MDUzIGJhc2VkIGJvYXJkICovCisJCXByaW50ZigiTUNJTVg1My1TVEFS VCBib2FyZCAxLjBcbiIpOworCQlhcm1saW51eF9zZXRfcmV2aXNpb24obG9jb19zeXN0ZW1fcmV2 KTsKKwkJcmV0dXJuIDA7CisJfQorCisJLyogZ2V0IHRoZSBib2FyZCByZXZpc2lvbiBmcm9tIGZ1 c2UgKi8KKwlyZXYgPSByZWFkbChNWDUzX0lJTV9CQVNFX0FERFIgKyAweDg3OCk7CisJc2V0X2Jv YXJkX3JldihyZXYpOworCXByaW50ZigiTUNJTVg1My1TVEFSVC1SIGJvYXJkIDEuMCByZXYgJWNc biIsIChyZXYgPT0gMSkgPyAnQScgOiAnQicgKTsKKwlhcm1saW51eF9zZXRfcmV2aXNpb24obG9j b19zeXN0ZW1fcmV2KTsKKworCXJldHVybiAwOworfQorCitsYXRlX2luaXRjYWxsKGxvY29fcG1p Y19pbml0KTsKLS0gCjEuNy43LjYKCgpfX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fXwpiYXJlYm94IG1haWxpbmcgbGlzdApiYXJlYm94QGxpc3RzLmluZnJhZGVh ZC5vcmcKaHR0cDovL2xpc3RzLmluZnJhZGVhZC5vcmcvbWFpbG1hbi9saXN0aW5mby9iYXJlYm94 Cg==