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 C4D08C38142 for ; Sat, 21 Jan 2023 21:04:19 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 0780585477; Sat, 21 Jan 2023 22:04:17 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=reject dis=none) header.from=diskos.nl 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; secure) header.d=diskos.nl header.i=@diskos.nl header.b="mgV2IWYC"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 924FE85565; Sat, 21 Jan 2023 22:04:14 +0100 (CET) Received: from smtp.delft.diskos.nl (smtp.delft.diskos.nl [45.80.169.141]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 9A11E85203 for ; Sat, 21 Jan 2023 22:04:11 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=reject dis=none) header.from=diskos.nl Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=joost@diskos.nl Received: from [10.135.128.1] (smtp.delft.diskos.nl [45.80.169.141]) by smtp.delft.diskos.nl (Postfix) with ESMTPSA id 389248F8C1; Sat, 21 Jan 2023 22:04:10 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=diskos.nl; s=mail; t=1674335050; bh=dFZJ/sPBuVkCn3QD8HuOxRHHoKVKbciF302BUZx0b4Q=; h=Date:From:Subject:To:Cc:In-Reply-To:References:From; b=mgV2IWYC0/qcyT3bTYf1Q8ajqQjuMaM37BNGMAx4rvT6lb52MqG/ALRdXY+Apq2hw G83rw6LJ0i8kAPZfblAgphgJfPX4AJYpNo3bRTTsqhTU+yO8eGgxoMuJbYfuOjiBzB Ioc7q1HclANJu1dVcQisRLMmvq12x50Lny5akr1ST6T53s6rBM/74lGduT48TQokxq 69kLcHtaVlQgmCekPLOUOtUX9EFsmroAZ3HbwPezmKbmWUEiQl2ZURpTVyDxQO0IiO LjaTRnP7ze+sbdTjUUcUHAJcCDhD30LAcCpHrUgtidFhiIIY6tTcgHrNC2vwiSZ1yM pIhrTFvhT5U2Q== Date: Sat, 21 Jan 2023 22:04:04 +0100 From: Joost van Zwieten Subject: Re: reset-loop on Odroid U2: cros-ec communications failure To: Simon Glass Cc: u-boot@lists.denx.de Message-Id: In-Reply-To: References: X-Mailer: geary/3.38.1 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed 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 On Fri, Jan 20, 2023 at 15:11, Simon Glass wrote: > Hi Joost, > > On Fri, 20 Jan 2023 at 15:00, Joost van Zwieten > wrote: >> >> >> >> On Fri, Jan 13, 2023 at 11:00, Simon Glass wrote: >> > Hi Joost, >> > >> > On Mon, 9 Jan 2023 at 06:31, Joost van Zwieten >> > wrote: >> >> >> >> Dear maintainers, >> >> >> >> U-Boot on my Odroid U2 fails to initialize as of commit >> >> e44d7e73fe0d649693d8d0a110cd7632bc919273 (introduced after >> >> v2022.10). I >> >> get the following output: >> >> >> >> U-Boot 2022.10-00565-ge44d7e73fe-dirty (Jan 09 2023 - >> 01:04:19 >> >> +0100) >> >> >> >> CPU: Exynos4412 @ 1 GHz >> >> Model: Odroid based on Exynos4412 >> >> Type: u3 >> >> DRAM: 2 GiB >> >> Core: 101 devices, 12 uclasses, devicetree: separate >> >> LDO20@VDDQ_EMMC_1.8V: set 1800000 uV; enabling >> >> LDO22@VDDQ_EMMC_2.8V: set 2800000 uV; enabling >> >> LDO21@TFLASH_2.8V: set 2800000 uV; enabling >> >> MMC: SAMSUNG SDHCI: 2, EXYNOS DWMMC: 0 >> >> Loading Environment from MMC... *** Warning - bad CRC, using >> >> default environment >> >> >> >> cros-ec communications failure -96 >> >> >> >> Please reset with Power+Refresh >> >> >> >> Cannot init cros-ec device >> >> resetting ... >> >> >> >> This repeats indefinitely. I'm building U-Boot using the default >> >> config >> >> for board `odroid` and boot the Odroid from an SD card with >> firmware >> >> (`bl1`, `bl2` and `tzsw`) from Hardkernel's clone of the u-boot >> >> repository [1]. There are no peripherals connected apart from >> the SD >> >> card and the serial console. Please let me know if you need more >> >> information. >> > >> > board_late_init() is presumably enabled with >> CONFIG_BOARD_LATE_INIT >> > and the code in board/samsung/common/board.c is being called. >> > >> > -96 is -EPFNOSUPPORT which means that the CROS_EC uclass is >> missing. >> > >> > So either enable CROS_EC so you have the uclass, or disable >> > BOARD_LATE_INIT so it doesn't matter. >> > >> >> >> >> Best, Joost >> >> >> >> [1]: >> >> >> >> >> https://github.com/hardkernel/u-boot/tree/33e05ffb159141b640571e91470172d83a2a1273/sd_fuse >> >> >> >> >> > >> > Regards, >> > Simon >> >> Hi Simon, >> >> Thanks. Both solutions work. With `CROS_EC` enabled >> `uclass_first_device_err(UCLASS_CROS_EC, &dev)` returns `ENODEV`. >> Since >> `board_late_init()` seems to do legitimate work for this board >> (defining the `mmcbootdev` environment variable) I think enabling >> `CROS_EC` is the way to go. Should this be part of the defconfig for >> odroid? If so, I can send a patch. > > Yes that seems OK to me. > > Regards, > Simon I've send a patch. I'm still a bit puzzled by this problem, though. Is it correct that `uclass_first_device_err(UCLASS_CROS_EC, ...)` always returns `-EPFNOSUPPORT` when `CROS_EC` is disabled in the `.config`? If so, I don't see how U-Boot is going to function properly on any board that hits `board_late_init()` (board/samsung/common/board.c) with `BOARD_LATE_INIT=y` and `CROS_EC` undefined and perhaps the best solution is to run the CROS_EC related statements only if `CROS_EC` is actually defined. I'm not sure about the implications of this proposal further down the road, though. Best, Joost