Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id CBA54EB64DA for ; Wed, 5 Jul 2023 23:26:29 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 68D5885D4E; Thu, 6 Jul 2023 01:26:27 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=denx.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1688599587; bh=ta2w0afKb1Plg9+t/TaZEtVOMNjzXtjZ9Gzh1Cr75jE=; h=From:To:Cc:Subject:Date:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From; b=LglMY+fjkZ4CQaQly3jcJJilXxHlCWHqvWtLKn+kKKJLHUS41OQbicLziGiyrVDY0 8E3VwTRFPwNCApCZGyk1v5uXRSiTPWw7IQVBraeo7IHcr8tCREBQ9L4lhkp7reyXW4 i4YayhSfQwGQYV83hnAM6PMUqHKbKy0tSIb+AP1OZYY4BxMUxU+U7wk8mSo2ZiOV+y dJqyBGp9Zgw4mrSpFLfaqOPkAyyl1sfSM95Jb3n/tQho9U0Q4/qw85KL68m5DQE3C0 hA2MJfgf+F2nMRvLvp6yBgt2AzekNUGtxFM2fFLeIopPXMY24zwHoWeNhIBA50F8R9 M4w3v5YBAnmXw== Received: from tr.lan (ip-86-49-120-218.bb.vodafone.cz [86.49.120.218]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: marex@denx.de) by phobos.denx.de (Postfix) with ESMTPSA id F04CA856C4; Thu, 6 Jul 2023 01:26:25 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1688599586; bh=ta2w0afKb1Plg9+t/TaZEtVOMNjzXtjZ9Gzh1Cr75jE=; h=From:To:Cc:Subject:Date:From; b=m1NEGW0xcTiM+loEzPE3U+dWUz6s91o8P9jkbN/ea3n00MhjYfuXC49Duvy3nwQF4 AoaaZ8sbM9oMpPPgg1yM7SYEBYSMj4SveZgZHvqWr0C8SXQxZ7AK5Rux1+093oJYOb 6GYNco74GrYMzi4vAtpo+AiLvp9zNTWqLX1QdXfnXxaqPda5wYjnO5VfCv1skirp/w fiMZY/t7QAkJ+dJqSnVsK5jDJzSyiEMKQ9IjInMtFlxJA5PbPPhDB3EbdcDFMKRBag v2Cm0yz1sX0YshO/Qv4skbyjlz5N4MpRlXpQso2pYTGusac6gtdacdT9HUt9SEK4ku OxN+LfvPiL6zw== From: Marek Vasut To: u-boot@lists.denx.de Cc: trini@konsulko.com, Marek Vasut , Fabio Estevam , Peng Fan , Stefano Babic Subject: [PATCH] ARM: dts: imx: Fix eMMC boot on Data Modul i.MX8M Plus eDM SBC Date: Thu, 6 Jul 2023 01:26:10 +0200 Message-Id: <20230705232610.243310-1-marex@denx.de> X-Mailer: git-send-email 2.40.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean In case the i.MX8M Plus starts from eMMC BOOT1/BOOT2 HW partitions, the flash.bin container is stored at offset 0 from the start, that means the fitImage itb is at offset 0x2c0 instead of 0x300 sectors from the start. Handle this difference in custom spl_mmc_get_uboot_raw_sector() . Signed-off-by: Marek Vasut --- Cc: Fabio Estevam Cc: Peng Fan Cc: Stefano Babic --- board/data_modul/imx8mp_edm_sbc/spl.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/board/data_modul/imx8mp_edm_sbc/spl.c b/board/data_modul/imx8mp_edm_sbc/spl.c index c30185e48d4..2fdd95a730c 100644 --- a/board/data_modul/imx8mp_edm_sbc/spl.c +++ b/board/data_modul/imx8mp_edm_sbc/spl.c @@ -107,6 +107,20 @@ void board_boot_order(u32 *spl_boot_list) spl_boot_list[4] = BOOT_DEVICE_NONE; } +unsigned long spl_mmc_get_uboot_raw_sector(struct mmc *mmc, unsigned long sect) +{ + const u32 boot_dev = spl_boot_device(); + int part; + + if (boot_dev == BOOT_DEVICE_MMC2) { /* eMMC */ + part = spl_mmc_emmc_boot_partition(mmc); + if (part == 1 || part == 2) /* eMMC BOOT1/BOOT2 HW partitions */ + return sect - 0x40; + } + + return sect; +} + static struct dram_timing_info *dram_timing_info[8] = { &dmo_imx8mp_sbc_dram_timing_32_32, /* 32 Gbit x32 */ NULL, /* 32 Gbit x16 */ -- 2.40.1