From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from mail.visioncatalog.de ([217.6.246.34] helo=root.phytec.de) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1UwBKH-0008Pw-Pv for barebox@lists.infradead.org; Mon, 08 Jul 2013 13:18:02 +0000 Received: from idefix.phytec.de (idefix.phytec.de [172.16.0.10]) by root.phytec.de (Postfix) with ESMTP id 4D123BF0FE for ; Mon, 8 Jul 2013 15:11:24 +0200 (CEST) From: =?UTF-8?q?Teresa=20G=C3=A1mez?= Date: Mon, 8 Jul 2013 15:17:09 +0200 Message-Id: <1373289430-6965-11-git-send-email-t.gamez@phytec.de> In-Reply-To: <1373289430-6965-1-git-send-email-t.gamez@phytec.de> References: <1373289430-6965-1-git-send-email-t.gamez@phytec.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 11/12] ARM OMAP: get barebox partion information from boardcode To: barebox@lists.infradead.org VGhlIHNpemUgYW5kIG9mZnNldCBvZiB0aGUgYmFyZWJveCBwYXJ0aXRpb24gaW4gbmFuZCBhbmQg c3BpIG5vciBmbGFzaAptYXkgdmFyeSBvbiBkaWZmZXJlbnQgYm9hcmRzLiBNYWtlIGl0IHBvc3Np YmxlIHRvIHBhc3MgdGhpcyBpbmZvcm1hdGlvbgpvdmVyIGJvYXJkZmlsZSBpZiBuZWVkZWQuCgpT aWduZWQtb2ZmLWJ5OiBUZXJlc2EgR8OhbWV6IDx0LmdhbWV6QHBoeXRlYy5kZT4KLS0tCiBhcmNo L2FybS9tYWNoLW9tYXAvaW5jbHVkZS9tYWNoL2dlbmVyaWMuaCB8ICAgMTYgKysrKysrKysrKysr CiBhcmNoL2FybS9tYWNoLW9tYXAveGxvYWQuYyAgICAgICAgICAgICAgIC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