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 1fdXuk-0002YC-9r for barebox@lists.infradead.org; Thu, 12 Jul 2018 09:29:31 +0000 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= Date: Thu, 12 Jul 2018 11:29:11 +0200 Message-Id: <20180712092911.8475-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] net/e1000: allow to overwrite flash size from device tree To: barebox@lists.infradead.org V2hlbiBiYXJlYm94IHByb2JlcyB0aGUgZTEwMDAgZHJpdmVyIGFuZCB0aGUgZmxhc2ggb24gdGhl IGkyMTAgZGV2aWNlIGlzCnVucHJvZ3JhbW1lZCwgdGhlIGRyaXZlciBhc3N1bWVzIHRoZSBmbGFz aCBoYXMgYSBzaXplIG9mIG9ubHkgNCBraUIuClRoaXMgaXMgYW5ub3lpbmcgYmVjYXVzZSB0byBw cm9ncmFtIHRoZSBmbGFzaCBhbiBpbWFnZSBtdXN0IGJlIHdyaXR0ZW4KdGhhdCBpcyBiaWdnZXIg dGhhbiA0IGtpQi4gU28geW91IGZpcnN0IGhhdmUgdG8gZmxhc2ggdGhlIGZpcnN0IHNlY3Rvcgp0 byBtYWtlIGJhcmVib3ggZGV0ZWN0IHRoZSByaWdodCBzaXplIG9uIHRoZSBuZXh0IGJvb3QuIFRo ZW4gcmVzZXQgdGhlCmJvYXJkIHRvIGJlIGFibGUgdG8gd3JpdGUgdGhlIHJlbWFpbmluZyBkYXRh LgoKVG8gd29yayBhcm91bmQgdGhhdCBsaW1pdGF0aW9uLCB0cnkgdG8gcmV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