From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from mail.phytec.de ([217.6.246.34] helo=root.phytec.de) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1cDuyp-0005An-Es for barebox@lists.infradead.org; Mon, 05 Dec 2016 15:15:01 +0000 Date: Mon, 5 Dec 2016 16:14:31 +0100 From: Stefan Lengfeld Message-ID: <20161205151431.GC14158@lws-christ> References: <1480949684-18520-1-git-send-email-andrew.smirnov@gmail.com> <1480949684-18520-3-git-send-email-andrew.smirnov@gmail.com> MIME-Version: 1.0 In-Reply-To: <1480949684-18520-3-git-send-email-andrew.smirnov@gmail.com> Content-Disposition: inline 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: Re: [PATCH 02/16] i.MX: ocotp: Add provisions for storing multiple MAC addresses To: Andrey Smirnov Cc: barebox@lists.infradead.org SGkgQW5kcmV5LAoKYSBzaW1pbGlhciBwYXRjaCB3YXMgcG9zdGVkIHNvbWUgZGF5cyBhZ28gdG8g c3VwcG9ydCB0d28gTUFDIGFkZHJlc3NlcyBmb3IgdGhlCmkuTVg2IFVsdHJhTGl0ZS4gU2VlCgog ICAgaHR0cDovL2xpc3RzLmluZnJhZGVhZC5vcmcvcGlwZXJtYWlsL2JhcmVib3gvMjAxNi1Ob3Zl bWJlci8wMjg2MjguaHRtbAoKWW91ciBhcHByb2FjaCB1c2VzIGFuIGV4dHJhIGRldmljZSBhdHRy aWJ1dGUgICdtYWNfaWR4JyB0byBzZWxlY3QgdGhlIG1lYW5pbmcKb2YgdGhlIGRldmljZSBhdHRy aWJ1dGUgJ21hY19hZGRyJzogV2hldGhlciBpdCBwb2ludHMgdG8gdGhlIE1BQzAgb3IgTUFDMS4g CgpJIGZpbmQgaXQgbGVzcyBlcnJvciBwcm9uZSBh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