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 1fVFxy-0005ya-ST for barebox@lists.infradead.org; Tue, 19 Jun 2018 12:42:37 +0000 Message-ID: <1529412140.7211.22.camel@pengutronix.de> From: Lucas Stach Date: Tue, 19 Jun 2018 14:42:20 +0200 In-Reply-To: <5226f251-0465-e9ca-6f5a-c0b29f5eda39@cogentembedded.com> References: <20180619054307.30618-1-andrew.smirnov@gmail.com> <20180619054307.30618-2-andrew.smirnov@gmail.com> <1529398276.7211.10.camel@pengutronix.de> <5226f251-0465-e9ca-6f5a-c0b29f5eda39@cogentembedded.com> Content-Type: multipart/mixed; boundary="=-+FATZr79oMuUGs+gg/Oi" Mime-Version: 1.0 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "barebox" Errors-To: barebox-bounces+u.kleine-koenig=pengutronix.de@lists.infradead.org Subject: Re: [PATCH 2/2] ARM: i.MX: Add support for ZII RDU1 board To: Nikita Yushchenko , Andrey Smirnov , barebox@lists.infradead.org, Andrey Gusakov --=-+FATZr79oMuUGs+gg/Oi Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Am Dienstag, den 19.06.2018, 14:34 +0300 schrieb Nikita Yushchenko: > > > > > > + imx51_bbu_internal_spi_i2c_register_handler("spi", > > > > > > +     "/dev/dataflash0.barebox", > > > +     BBU_HANDLER_FLAG_DEFAULT); > > > > Did you test that this works? The Barebox partition has an offset and > > according the RM the BootROM looks at a specific location for the image > > header, so I think the Barebox image needs to be truncated for this to > > work. > > Yes, this works, together with this patch: > > https://github.com/CogentEmbedded/barebox-zodiac/commit/9b523e459e198960b94594b7185baa0dd2649feb > > I've copied this code from earlier version developed by Andrey Gusakov [CCed]. > > I did not try to change anything there, to ensure board stays bootable ;). But this isn't a generic fix that can be applied upstream. Nothing in the i.MX51 boot specification says that the first 1024 bytes of flash shouldn't be written and in fact this is cutting the Barebox image signature from the image written to flash, which is generally undesirable. And it probably also doesn't work with the barebox partition having an offset on the flash, as is done with this patch. I've added a ugly workaround in the BSP patchstack, which _might_ be acceptable upstream. See attached patch. Regards, Lucas --=-+FATZr79oMuUGs+gg/Oi Content-Disposition: attachment; filename*0=0001-bbu-add-flag-to-skip-writing-the-padding-before-the-.pat; filename*1=ch Content-Type: text/x-patch; name="0001-bbu-add-flag-to-skip-writing-the-padding-before-the-.patch"; charset="UTF-8" Content-Transfer-Encoding: base64 RnJvbSA1MjMxYTdiYTI1MDYzNGNhMDlmZGJhMTYwYjcxZWI0NDkxZDlmZjhkIE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBMdWNhcyBTdGFjaCA8bC5zdGFjaEBwZW5ndXRyb25peC5kZT4K RGF0ZTogTW9uLCA3IE1heSAyMDE4IDEyOjU0OjE1ICswMjAwClN1YmplY3Q6IFtQQVRDSF0gYmJ1 OiBhZGQgZmxhZyB0byBza2lwIHdyaXRpbmcgdGhlIHBhZGRpbmcgYmVmb3JlIHRoZSBmbGFzaAog aGVhZGVyCgpUaGlzIGlzIHVnbHksIGJ1dCBuZWVkZWQgYXMgb24gdGhlIFpJSSBSRFUxIGJvYXJk IHRoZSBmbGFzaCBob2xkcyBzb21lCmltcG9ydGFudCBkYXRhIGluIHRoZSBmaXJzdCAxMDI0IGJ5 dGVzLCBzbyB3ZSBuZWVkIHRvIGF2b2lkIHdyaXRpbmcKYW55dGhpbmcgaW50byB0aGlzLiBUaGlz IGlzIGltcGxlbWVudGVkIGJ5IGhhdmluZyB0aGUgYmFyZWJveCBwYXJ0aXRpb24Kc3RhcnQgYXQg dGhpcyBvZmZzZXQsIGJ1dCBCQlUgbmVlZHMgdG8gdHJ1bmNhdGUgdGhlIGltYWdlIGFjY29yZGlu Z2x5LgoKU2lnbmVkLW9mZi1ieTogTHVjYXMgU3RhY2ggPGwuc3RhY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IAoyLjE3LjEKCg== --=-+FATZr79oMuUGs+gg/Oi Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox --=-+FATZr79oMuUGs+gg/Oi--