From mboxrd@z Thu Jan 1 00:00:00 1970 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 64778C61DA4 for ; Thu, 23 Feb 2023 12:12:09 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 03F5985AB5; Thu, 23 Feb 2023 13:12:06 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="UBBXFOaq"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 64289855D9; Thu, 23 Feb 2023 13:12:03 +0100 (CET) Received: from mail-ot1-x32b.google.com (mail-ot1-x32b.google.com [IPv6:2607:f8b0:4864:20::32b]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 9085685AB5 for ; Thu, 23 Feb 2023 13:11:59 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=martin.p.rowe@gmail.com Received: by mail-ot1-x32b.google.com with SMTP id g6-20020a056830308600b0068d4b30536aso2173416ots.9 for ; Thu, 23 Feb 2023 04:11:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=YEEj3kgkrn31haT4XY80z1er9dEk99Eu4eTggiGHbcE=; b=UBBXFOaqitGLD00NPAOlrWG7OfxsRFEZEdTiLlRrA8dk4wwpAhzmbfgqHtzRAQKpi4 Jk1/9h5cqh0aoFRJXfJNLY03WzmfEpJbthJdosmDuOL5rNcPUQCr8INWp8Wjn7+BAa4n b7mZOq3Wwl0Hx6ze0AzWnojprscfKTHam0r2tL9KHfCEfpX0PZ0W2dRR7C+a+Vf6ODqO E0dSbNVfW7Ft8uGxZa2cfv1kwBc4Iz4Uy+/64sTvu9EJrV4Wl+L9ySaXD8FlRb7i8lOR IH9VHm4xtiCG18mDIPTQoWvbGtY67yLVJA2gEXesoLeAswv7Qj+pPxzQpgA34KoSp2wv yIQQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=YEEj3kgkrn31haT4XY80z1er9dEk99Eu4eTggiGHbcE=; b=QP7nQDj8p298bvhOyC4kkjKfFVFPkJ7krcssb3GIzN6zuJ0+AOJR0nmwgrqMpeHZmX R3lCqMizJ/Xh1SzLEYrnvGWuE4nD/PWw7Q8DMk/zKuppyD8xXoGVwbJyQlyXLEm5yQga tyq7Uk9N/7UQKQP8jl4mVinqonVt6Ua8etcGbaaXA3ppfsxsvgEMk2KJtBmx4aoNODat pO5tNuIQW5GvU+meHEMgItnfiQGjuR7XcXkibYn05WKw0Lybcl5452ozw5DLlFSjgrut errkh89c3NfjXrx0Hp01N/tnK9E90gI9YTlT6B/Za19ClDmGBD7w0q5+cf+d8P+c7mmy 9lvw== X-Gm-Message-State: AO0yUKVUHbjUW77PDRiaayA90m8TFvHy5nOCel0XqY8GLrqiDVybIFqu k2+7FPlB9U+1XYIwDz1kEFfyT/O2G2YcJg+3AAQ= X-Google-Smtp-Source: AK7set9r1MzCUyJ8QU4M2lEqd5msMS6BPhsCpBiLGaUfqXLc2k8DXp09cgUhk4/H6SrS2HjNq0NHqjDYZKpXntmND/s= X-Received: by 2002:a05:6830:33d1:b0:68d:4b7f:e993 with SMTP id q17-20020a05683033d100b0068d4b7fe993mr642168ott.3.1677154318122; Thu, 23 Feb 2023 04:11:58 -0800 (PST) MIME-Version: 1.0 References: <20230221201925.9644-1-pali@kernel.org> <20230221231405.ln5fvxuvgzmwmbl5@pali> <20230222075819.6f3vl7nlnpqwpg6e@pali> <20230222180307.7sxot7ivfx3elunx@pali> <20230222212356.abfhl7omg35hwizc@pali> In-Reply-To: <20230222212356.abfhl7omg35hwizc@pali> From: Martin Rowe Date: Thu, 23 Feb 2023 12:11:46 +0000 Message-ID: Subject: Re: [PATCH RFC u-boot-mvebu 00/59] arm: mvebu: Various fixes To: =?UTF-8?Q?Pali_Roh=C3=A1r?= Cc: Tony Dinh , u-boot@lists.denx.de, Stefan Roese , Josua Mayer Content-Type: text/plain; charset="UTF-8" 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.6 at phobos.denx.de X-Virus-Status: Clean > > > Have you tried booting from eMMC boot partition or eMMC user data > > > partition? Because all 3 options should work, but I'm not fully sure if > > > BootROM choose partition from eMMC register or if tries all 3 in some > > > order. This is something which needs to be checked and verified. > > > > I only tested from boot0, but will test the others as well. I've only > > ever seen it fallback, but I'll check the new changes and see if they > > can select the boot device. > > Ok. When testing, ensure that you erase uboots from other partitions or > check that it boots the correct version from the correction partition. BootROM always tries boot0, boot1, then user, regardless of partconf setting. SPL does use the partconf setting, though. So when I configure: boot0 - zeroed boot1 - u-boot (with local version 'boot1') user - u-boot (with local version 'user') mmc partconf 0 0 7 0 I see the output below. Note that BootROM tries boot0 first with two addresses, switches to boot1 (see 'boot1' following 2023.04-rc2), loads SPL, which then loads u-boot from user (see 'user' following 2023.04-rc2) ================================================= BootROM - 1.73 Booting from MMC BootROM: Bad header at offset 00000000 BootROM: Bad header at offset 00200000 Switching BootPartitions. U-Boot SPL 2023.04-rc2boot1-00098-g93408c61cd-dirty (Feb 23 2023 - 19:43:59 +1000) High speed PHY - Version: 2.0 EEPROM TLV detection failed: Using static config for Clearfog Pro. Detected Device ID 6828 board SerDes lanes topology details: | Lane # | Speed | Type | -------------------------------- | 0 | 3 | SATA0 | | 1 | 0 | SGMII1 | | 2 | 5 | PCIe1 | | 3 | 5 | USB3 HOST1 | | 4 | 5 | PCIe2 | | 5 | 0 | SGMII2 | -------------------------------- High speed PHY - Ended Successfully mv_ddr: 14.0.0 DDR3 Training Sequence - Switching XBAR Window to FastPath Window mv_ddr: completed successfully Trying to boot from MMC1 U-Boot 2023.04-rc2user-00098-g93408c61cd-dirty (Feb 23 2023 - 19:44:54 +1000) SoC: MV88F6828-A0 at 1600 MHz DRAM: 1 GiB (800 MHz, 32-bit, ECC not enabled) Core: 38 devices, 22 uclasses, devicetree: separate MMC: mv_sdh: 0 Loading Environment from MMC... *** Warning - bad CRC, using default environment Model: SolidRun Clearfog A1 Board: SolidRun Clearfog Pro Net: Warning: ethernet@70000 (eth1) using random MAC address - ae:50:98:34:2e:3e eth1: ethernet@70000 Warning: ethernet@30000 (eth2) using random MAC address - 0a:66:2b:f7:45:09 , eth2: ethernet@30000 Warning: ethernet@34000 (eth3) using random MAC address - d2:8e:11:7e:64:c0 , eth3: ethernet@34000 Hit any key to stop autoboot: 0 => ================================================= > > > Could you try to use SolidRun eMMC patch which SolidRun has for years in > > > its repository? > > > > > > https://github.com/SolidRun/u-boot/commit/19a96f7c40a8fc1d0a6546ac2418d966e5840a99 > > > > > > Probably same functionality is needed to implement also into > > > board_fix_fdt() function enabled by CONFIG_OF_BOARD_FIXUP. Look for > > > other boards how they use CONFIG_OF_BOARD_FIXUP. > > > > > > And if ... you can try to put this logic in board_late_init() function. > > > For inspiration look into Espressobin board which deactivates eMMC at > > > runtime by checking existence of eMMC: > > > https://source.denx.de/u-boot/u-boot/-/blob/master/board/Marvell/mvebu_armada-37xx/board.c I've not been able to get this to work. I enable CONFIG_OF_BOARD_FIXUP in my config and add the following to board/solidrun/clearfog/clearfog.c: +int board_fix_fdt(void *blob) + { + int offset; + offset = fdt_path_offset(blob, "/soc/internal-regs/sdhci@d8000"); + if (offset >= 0) { + printf("offset"); + fdt_delprop(blob, offset, "cd-gpios"); + fdt_setprop_empty(blob, offset, "non-removable"); + } + return 0; +} Then I boot from MMC and get the following: ================================================= BootROM - 1.73 Booting from MMC U-Boot SPL 2023.04-rc2-00098-g93408c61cd-dirty (Feb 23 2023 - 21:32:01 +1000) High speed PHY - Version: 2.0 EEPROM TLV detection failed: Using static config for Clearfog Pro. Detected Device ID 6828 board SerDes lanes topology details: | Lane # | Speed | Type | -------------------------------- | 0 | 3 | SATA0 | | 1 | 0 | SGMII1 | | 2 | 5 | PCIe1 | | 3 | 5 | USB3 HOST1 | | 4 | 5 | PCIe2 | | 5 | 0 | SGMII2 | -------------------------------- High speed PHY - Ended Successfully mv_ddr: 14.0.0 DDR3 Training Sequence - Switching XBAR Window to FastPath Window mv_ddr: completed successfully Trying to boot from MMC1 MMC: no card present spl: mmc init failed with error: -123 Trying to boot from BOOTROM Returning to BootROM (return address 0xffff05c4)... sdioSdhciSendCmd: Timeout for status update! sdioSdhciSendCmd: Timeout for status update! BootROM: Image checksum verification FAILED sdioSdhciSendCmd: Timeout for status update! sdioSdhciSendCmd: Timeout for status update! sdioSdhciSendCmd: Timeout for status update! sdioSdhciSendCmd: Timeout for status update! BootROM: Invalid header checksum Switching BootPartitions. sdioSdhciSendCmd: Timeout for status update! sdioSdhciSendCmd: Timeout for status update! sdioSdhciSendCmd: Timeout for status update! sdioSdhciSendCmd: Timeout for status update! BootROM: Invalid header checksum sdioSdhciSendCmd: Timeout for status update! sdioSdhciSendCmd: Timeout for status update! sdioSdhciSendCmd: Timeout for status update! sdioSdhciSendCmd: Timeout for status update! BootROM: Invalid header checksum Switching BootPartitions. ================================================= This is exactly the same error as I get without the board_fix_fdt change. I tried adding some printfs and returning 1 from the function, but I can't see any evidence that it is getting called in the SPL at all. I also see that SolidRun has dropped the patch you linked to in newer a38x branches, but can't see how else they're handling the eMMC detection. I could wrap the dts change with a kconfig, but anyone enabling that kconfig would also need to patch the kernel dtb, unless u-boot has a hook to patch the file before passing it to the kernel.