From mboxrd@z Thu Jan 1 00:00:00 1970 Delivery-date: Wed, 30 Aug 2023 16:46:46 +0200 Received: from metis.ext.pengutronix.de ([2001:67c:670:201:290:27ff:fe1d:cc33]) by lore.white.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qbMT1-00Ek8M-GZ for lore@lore.pengutronix.de; Wed, 30 Aug 2023 16:46:46 +0200 Received: from bombadil.infradead.org ([2607:7c80:54:3::133]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qbMSy-00089W-Ts for lore@pengutronix.de; Wed, 30 Aug 2023 16:46:45 +0200 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: Content-Type:In-Reply-To:From:References:Cc:To:Subject:MIME-Version:Date: Message-ID:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=OFHxnDhhyncjEeLUFuHcpgrTQRaPvJZfSNKdBM+pEEA=; b=KbQfUzbWFXSUt546Tq15011NHw lt099n7Wz2Ev0kcApdw9Tlth5bzdYPck7pnM7/J0Fj38teefjCvkh9AkwLGVtmNsF/4oZzxM4zcm7 Nx8rNBARJiwBfNdKN64ojqYuG73C+Mdl6/oHD4StXo9K2c/vQHMYdcJfStdVXtViS1J5NdIyYfU3P 7M++LWBq7/U9a8hGCGL/ePxx4hYqCIvbas/5hZ+j4+AsFId+mFEbCcXKmawbRUp+AJ6oZUV8BpGrY XIRO67Fzs0zOahkfso885CuUFGtK6zw99HsRUltcFc6Q8fexQZXJDszhjUMKCvFA+ivQk4JyHVkaQ VT/PN1vw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qbMRy-00DhAx-38; Wed, 30 Aug 2023 14:45:42 +0000 Received: from metis.ext.pengutronix.de ([2001:67c:670:201:290:27ff:fe1d:cc33]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qbMRv-00DhAT-1V for barebox@lists.infradead.org; Wed, 30 Aug 2023 14:45:40 +0000 Received: from ptz.office.stw.pengutronix.de ([2a0a:edc0:0:900:1d::77] helo=[127.0.0.1]) by metis.ext.pengutronix.de with esmtp (Exim 4.92) (envelope-from ) id 1qbMRu-0007uD-7l; Wed, 30 Aug 2023 16:45:38 +0200 Message-ID: <0a2a2679-8e4f-eaf9-4b2e-096ef1d1f040@pengutronix.de> Date: Wed, 30 Aug 2023 16:45:37 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Content-Language: en-US To: Alexander Shiyan Cc: Barebox List References: <76a7bbec-5dff-c138-5c70-9b152558fe2f@pengutronix.de> From: Ahmad Fatoum In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230830_074539_499406_35D486B2 X-CRM114-Status: GOOD ( 22.28 ) X-BeenThere: barebox@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "barebox" X-SA-Exim-Connect-IP: 2607:7c80:54:3::133 X-SA-Exim-Mail-From: barebox-bounces+lore=pengutronix.de@lists.infradead.org X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on metis.ext.pengutronix.de X-Spam-Level: X-Spam-Status: No, score=-5.5 required=4.0 tests=AWL,BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE autolearn=unavailable autolearn_force=no version=3.4.2 Subject: Re: imx8mm & genimage X-SA-Exim-Version: 4.2.1 (built Wed, 08 May 2019 21:11:16 +0000) X-SA-Exim-Scanned: Yes (on metis.ext.pengutronix.de) Hello Alexander, On 30.08.23 16:41, Alexander Shiyan wrote: > Hello Ahmad. > > "in-partition-table = false" helps me, now boot OK. > 33K is valid offset for imx8mm, and we do not overlap GPT (or MBR) due > to the "holes" option. I think it would be nicer though to have barebox on SD-Card sit inside a regular GPT partition now that this is possible without holes shenanigans, but I haven't found the time to do it in DistroKit (actual customer products boot from eMMC or NOR). Cheers, Ahmad > > Thanks! > > ср, 30 авг. 2023 г. в 17:25, Ahmad Fatoum : >> >> Hello Alexander, >> >> On 30.08.23 16:02, Alexander Shiyan wrote: >>> Hello. >>> >>> I can't figure out how to correctly write the configuration for >>> genimage for the imx8mm CPU. >>> This way of writing works fine: >>> dd if=barebox-nxp-imx8mm-mgqs.img of=/dev/sdc bs=1024 seek=33 skip=33 >>> >>> For genimage I use the following but it doesn't work... >> >> What doesn't work? I would have assumed that genimage refused to build >> an image with below description. >> >>> >>> image imx8mm-mgqs-sdcard.img { >>> hdimage { >>> partition-table-type = "gpt" >>> } >>> >>> partition boot { >>> image = "barebox-nxp-imx8mm-mgqs.img" >>> holes = {"(0; 33K)"} >>> offset = 0 >>> partition-type-uuid = 0fc63daf-8483-4772-8e79-3d69d8477de4 >> >> I don't think a GPT partition can exist at offset 0, because that would >> overlap the GPT header itself. What you want instead is either: >> >> - add barebox in non-partitioned space outside of the partition table: >> That is done with in-partition-table = false, see e.g. DistroKit[1] >> >> - add barebox in a GPT partition at the correct offset (32K?) and strip away >> its first 32K bytes. The only way to achieve this currently with genimage >> is to add an explicit file rule and use >> exec-post = "dd ... of=$IMAGEOUTFILE.skipped && mv $IMAGEOUTFILE.skipped $IMAGEOUTFILE" >> It would surely be nice to give genimage a partition { skip = [...] } option, >> if you feel inclined :-) >> >> For eMMC, the barebox update handler will take care to switch on the >> eMMC boot and install barebox and do any skipping of bytes if necessary (e.g. on i.MX8MN/P). >> >> [1]: https://git.pengutronix.de/cgit/DistroKit/tree/configs/platform-v8a/config/images/imx8m.config?h=next&id=d4e41181cc388d528bbccb5e9ba96a6120980a55 >> >> Cheers, >> Ahmad >> >> >>> } >>> >>> partition env { >>> image = "/dev/null" >>> offset = 8M >>> partition-type-uuid = 6c3737f2-07f8-45d1-ad45-15d260aab24d >>> size = 32K >>> } >>> >>> partition root { >>> image = "rootfs.ext4" >>> partition-type-uuid = b921b045-1df0-41c3-af44-4c6f280d3fae >>> } >>> } >>> >>> >> >> -- >> Pengutronix e.K. | | >> Steuerwalder Str. 21 | http://www.pengutronix.de/ | >> 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | >> Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | >> > -- Pengutronix e.K. | | Steuerwalder Str. 21 | http://www.pengutronix.de/ | 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |