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 X-Spam-Level: X-Spam-Status: No, score=-18.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 919EEC07E95 for ; Sun, 4 Jul 2021 19:47:04 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 25EAC613B0 for ; Sun, 4 Jul 2021 19:47:03 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 25EAC613B0 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=amarulasolutions.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 9090182B20; Sun, 4 Jul 2021 21:47:01 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=amarulasolutions.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=amarulasolutions.com header.i=@amarulasolutions.com header.b="BFZWbu4M"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 71EEE82A29; Sun, 4 Jul 2021 21:47:00 +0200 (CEST) Received: from mail-ej1-x636.google.com (mail-ej1-x636.google.com [IPv6:2a00:1450:4864:20::636]) (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 BD47082A29 for ; Sun, 4 Jul 2021 21:46:57 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=amarulasolutions.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=michael@amarulasolutions.com Received: by mail-ej1-x636.google.com with SMTP id hc16so25633474ejc.12 for ; Sun, 04 Jul 2021 12:46:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=AQr10fByHfOkJYgtZVSdC6hbt2P4fMJN1bFQXlXYPk4=; b=BFZWbu4MMH8dlD6J9XXHR+4oH1agHrzC58TXfBWvSDeaQAPo6BURX26C4wSM9jFCKf 7kDRHJXce4mLaSgxsFR6rRA4JEpIUQO3sNo8Eybmzkr057Uk3BS28FYylqpdxPi6+jl9 8JiWfiLDJwdMTHwjoh72aBru5swCWyxJd5wKs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=AQr10fByHfOkJYgtZVSdC6hbt2P4fMJN1bFQXlXYPk4=; b=WKnH3mUtzJeto/zxxDVDw7QzEooROsOrrz9qoJMoRTI37Kakiaipu8n2niVbiVt1Hn 6hVUWZK5+zUTzeaxyxa9TCi45yQURe8G/x++eDyA6hhg4f6dPxznM/Ck881WEPyA6ixs qc7iW/l7aEhAYhUwtqPkSj7uPpTmKhKceh7HaykfBNQWSnfbbO0+J22W+M3lr0TULVj1 vdpEt7YPMpkl/mHPuagAiNCklW9n29HxWr/MA2xXUbGAhcFAXIwmfixxGZWwV1yz1Nel Bqce5M7OIDigA9NKKjHbrmcGm3UiN9KWS81lQHpu9wYaumvJzsD+CoX6V8dBvLBnjD8D POiA== X-Gm-Message-State: AOAM530cvYbPMVZjg1xCY2C4MB/EjqFE9bD9MjvZbvu5PXx+1kkDQFg+ BsvxtffKzr9HmI3209V74rEkTepqWv7Drw== X-Google-Smtp-Source: ABdhPJwL1PzX42ah4LfzB3HUGHkAbbq0BorLXZc/Lmz/wjeo6SZ3GYagaIxSK2zk8cDfe4++MYSJsg== X-Received: by 2002:a17:906:9bec:: with SMTP id de44mr3405448ejc.512.1625428016990; Sun, 04 Jul 2021 12:46:56 -0700 (PDT) Received: from panicking.amarulasolutions.com (mob-2-41-53-252.net.vodafone.it. [2.41.53.252]) by smtp.gmail.com with ESMTPSA id bq1sm3450143ejb.66.2021.07.04.12.46.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 04 Jul 2021 12:46:56 -0700 (PDT) From: Michael Trimarchi To: Stefano Babic , Fabio Estevam Cc: uboot-imx@nxp.com, u-boot@lists.denx.de Subject: [PATCH] arm: imx: Fix spl imx romapi for imx8mn Date: Sun, 4 Jul 2021 21:46:54 +0200 Message-Id: <20210704194654.4138946-1-michael@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 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.2 at phobos.denx.de X-Virus-Status: Clean We experimenting problems with imx8mn family cpu. We try to support boot0 and boot1 fallback. The condition to decide what function the bootrom should choose come from is_boot_from_stream_device This is a boot from mmcblk0boot0 with some debug U-Boot SPL 2020.04-5.4.70-2.3.2+gf3bcbdfc62 (Jul 03 2021 - 17:00:27 +0000) power_bd71837_init DDRINFO: start DRAM init DDRINFO: DRAM rate 1600MTS DDRINFO:ddrphy calibration done DDRINFO: ddrmix config done Normal Boot Trying to boot from BOOTROM ROM API interface 2 from boot 131073 Interface is 2 MMC and boot is 131073 and according to this static int is_boot_from_stream_device(u32 boot) +{ + u32 interface; + + interface = boot >> 16; + if (interface >= BT_DEV_TYPE_USB) + return 1; + + if (interface == BT_DEV_TYPE_MMC && (boot & 1)) + return 1; + + return 0; +} the return is 1, that does not allow us to boot. Boot from boot1 give 131072 that is boot1 this let device boot because is_boot_from_stream_device is 0 and romapi use spl_romapi_load_image_seekable Adjust the bootcondition let us boot from mmcblk0boot0 and mmcblk0boot1 without any problem mmc partconf 0 EXT_CSD[179], PARTITION_CONFIG: BOOT_ACK: 0x0 BOOT_PARTITION_ENABLE: 0x1 PARTITION_ACCESS: 0x0 and the board was fused already. Signed-off-by: Michael Trimarchi --- arch/arm/mach-imx/spl_imx_romapi.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/arm/mach-imx/spl_imx_romapi.c b/arch/arm/mach-imx/spl_imx_romapi.c index 7e6a05a6f3..36f8848d45 100644 --- a/arch/arm/mach-imx/spl_imx_romapi.c +++ b/arch/arm/mach-imx/spl_imx_romapi.c @@ -18,10 +18,11 @@ static int is_boot_from_stream_device(u32 boot) u32 interface; interface = boot >> 16; + if (interface >= BT_DEV_TYPE_USB) return 1; - if (interface == BT_DEV_TYPE_MMC && (boot & 1)) + if (!is_imx8mn() && interface == BT_DEV_TYPE_MMC && (boot & 1)) return 1; return 0; -- 2.25.1