From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stefano Babic Date: Tue, 9 Jun 2020 11:19:17 +0200 Subject: [EXT] [PATCH v2 1/1] imx: rom api: fix image offset computation In-Reply-To: <48f8ad36-3cb1-a2cd-0ce4-2f5584e99df5@armadeus.com> References: <20200513140228.8552-1-sebastien.szymanski@armadeus.com> <20200608172223.997138006B@phobos.denx.de> <48f8ad36-3cb1-a2cd-0ce4-2f5584e99df5@armadeus.com> Message-ID: <38a4a180-1410-9a95-e0f5-c9290afedd02@denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On 09.06.20 10:31, S?bastien Szymanski wrote: > Hi, > > On 6/9/20 6:03 AM, Ye Li wrote: >> Hi S?bastien, >> >>> -----Original Message----- >>> From: U-Boot On Behalf Of >>> sbabic at denx.de >>> Sent: 2020?6?9? 1:22 >>> To: S?bastien Szymanski ; u- >>> boot at lists.denx.de >>> Subject: [EXT] [PATCH v2 1/1] imx: rom api: fix image offset computation >>> >>> Caution: EXT Email >>> >>>> When not booting from FlexSPI, the offset computation is: >>>> offset = image_offset + >>> CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR * 512 >>>> - 0x8000; When booting from SD card or eMMC user partition, >>>> image_offset is 0x8000. It is useless to add and remove 0x8000. >>>> When booting from other device, image_offset is 0 so this computation is >>> wrong. >>>> Simplfy this computation to work on all booting devices. >>>> Signed-off-by: S?bastien Szymanski >>> Applied to u-boot-imx, master, thanks ! >> >> I just notice this patch. Can you elaborate the problem you met? >> Because from my view, your change is wrong. >> 1. Removing the image_offset will break secondary (redundant) boot support for sd and emmc. >> 2. When booting from emmc boot partition, the image_offset is 0. But the flash.bin >> generated by mkimage with imximage-8mp-lpddr4.cfg is for sd. It expects to be burn at 32KB offset. >> The fit offset 0x60000 has already included the 32KB offset. So when you burn this flash.bin >> to emmc boot partition at offset 0, the fit offset should subtract the 32KB (0x60000 - 0x8000). > > You are right ! > When I tried, I used a .cfg file without SECOND_LOADER and flashed > proper U-Boot "by hand" at offset 0x60000 which is wrong. > > Stefano, can you drop my patch please ? I revert it immediately - thanks Ye to have checked this before I send my PR. Stefano > > Sorry :/ > > Regards, > >> >> Best regards, >> Ye Li >>> >>> Best regards, >>> Stefano Babic >>> >>> -- >>> ========================================================== >>> =========== >>> DENX Software Engineering GmbH, Managing Director: Wolfgang Denk >>> HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany >>> Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de >>> ========================================================== >>> =========== > > -- ===================================================================== DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de =====================================================================