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 1fNPwH-0002Rl-79 for barebox@lists.infradead.org; Mon, 28 May 2018 21:44:27 +0000 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= Date: Mon, 28 May 2018 23:43:59 +0200 Message-Id: <20180528214400.28252-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/2] dove: move memory controller remapping before RAM detection To: barebox@lists.infradead.org Q29tcGFyZWQgdG8gb3RoZXIgbXZlYnUgY3B1cyB0aGUgbWVtb3J5IGNvbnRyb2xsZXIgcmVnaXN0 ZXJzIGFyZSBpbgp0aGVpciBvd24gcmVnaXN0ZXIgd2luZG93IHRoYXQgY2FuIGJlIG1vdmVkIGlu ZGVwZW5kZW50bHkgb2YgdGhlIG1idXMKcmVnaXN0ZXIgd2luZG93LgoKU2luY2UgY29tbWl0IGYw NWM2ZTA5NWNmOCB0aGUgYXZhaWxhYmxlIFJBTSBjb25maWd1cmVkIGJ5IHRoZSBib290IFJPTQpp cyByZWFkIG91dCBlYXJsaWVyLiBUaGlzIGhhcHBlbnMgdG8gYmUgYmVmb3JlIHRoZSBtZW1vcnkg Y29udHJvbGxlcgpyZWdpc3RlciB3aW5kb3cgaXMgbW92ZWQgYW5kIHNvIGRvdmVfbWVtb3J5X2Zp bmQoKSBmYWlscy4gVG8gZml4IHRoaXMKbW92ZSB0aGUgbWVtb3J5IGNvbnRyb2xsZXIgd2luZG93 IHRvZ2V0aGVyIHdpdGggdGhlIG1idXMgd2luZG93LgoKVGhpcyBjaGFuZ2UgY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