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 29EEFC32772 for ; Thu, 18 Aug 2022 08:28:26 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 4305984A90; Thu, 18 Aug 2022 10:28:24 +0200 (CEST) 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="UldsuQs2"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id B0D9884A91; Thu, 18 Aug 2022 10:28:22 +0200 (CEST) Received: from mail-lj1-x229.google.com (mail-lj1-x229.google.com [IPv6:2a00:1450:4864:20::229]) (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 4A88684A71 for ; Thu, 18 Aug 2022 10:28:20 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=matwey.kornilov@gmail.com Received: by mail-lj1-x229.google.com with SMTP id v10so1013503ljh.9 for ; Thu, 18 Aug 2022 01:28:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc; bh=EsoDlzadgb6ffth7Khr8+PqBUUwghHT/fo+T0rFm9zs=; b=UldsuQs2/t8pmdgXf4MO4Hx8+9sAU2i8qUpvzylJcBfHuYX+eQNmxG8aSViGzXuG/y 56v2/ugAlFjNtiqMGIMe6bsQGsh72jk4oaeQhN4bigKe1uNCwDhqqSwhcHnjlHVc/4DS mqJWhdl65gr1n4jSSSyFkK8vtxL4oOlUayREyw5Q/SXr7wFwQVzlxlbjQ12Tt427qNbJ o34B3nAZ/Dvxkj91q3x8V1eOgNNrgjPZKf1stfNuDcLYhZ8wQxbncQnJ7eTypNbnb+Wo XFW7nXMK0GlmC48HsT7IybKJwtkHks4g2qVNAqDqJZQyOHXcusrFuYZMgLTF+TOJxD0n OdIg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc; bh=EsoDlzadgb6ffth7Khr8+PqBUUwghHT/fo+T0rFm9zs=; b=aWjC1O03l3fOEi8YTzS3snpVj2TjtIcflpSqziaGl2Z17Eb8k8iRHy5ra1TsnOx1ej 9eSyELCRbrmlP0Bm3CYZGM44uB1DL+ctHPqpAHGWdVz1GdRoqsWRH2GlBIXIhHB/5LQh uVuSKLqh+llc6ttkL3qdN8OVyIetdbyI+CEunbC/2dUw+axY7/VppkYpC6cuxyijKjHA /ACYnOT2Pcyyf4odFQ/8a19ALQUCr7okqL3GkDoPl3FboZbXhBjIiN5aBv7oJ8S0Yb79 5GH5Qmkkc4gKDBMPcnvI2KJ9Ou81s4I6Fcb0SejKCgOnfpQQfYeyyJsR1jX2y8NHXhfJ ZULw== X-Gm-Message-State: ACgBeo1q+mOS8T1EPlqPuLXUXJZB78rTImBtjgrxYufl3+lwxXRNWOCv bj5gmu8puvIrnHf6pHij+Es= X-Google-Smtp-Source: AA6agR5D+3LVp8QcqIXMyHOqYzkG1BFKxCZgVIvrMhVH2f9KdwI6BmopEvnIIC+WmrIfhnkumozY3A== X-Received: by 2002:a2e:844a:0:b0:255:46b9:5e86 with SMTP id u10-20020a2e844a000000b0025546b95e86mr528533ljh.388.1660811299511; Thu, 18 Aug 2022 01:28:19 -0700 (PDT) Received: from oak.local ([2001:470:28:561:f5c1:40f8:1e6f:3cb]) by smtp.gmail.com with ESMTPSA id i6-20020a2ea366000000b0025e57b40009sm131486ljn.89.2022.08.18.01.28.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Aug 2022 01:28:18 -0700 (PDT) From: "Matwey V. Kornilov" To: nm@ti.com, u-boot@lists.denx.de, robertcnelson@gmail.com, trini@konsulko.com Subject: Re: [BISECTED] BeagleBone Black doesn't boot after a58147c2dbbf Date: Thu, 18 Aug 2022 11:28:05 +0300 Message-Id: <20220818082805.6575-1-matwey.kornilov@gmail.com> X-Mailer: git-send-email 2.35.3 In-Reply-To: References: 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.6 at phobos.denx.de X-Virus-Status: Clean I've played a little and now I believe that the issue is that EEPROM read addr pointer is somehow corrupted due to 1-byte address write. The EEPROM is definitely have two-byte read address accoring the datasheet. I've failed to unravel exact rule what is happening when only one address byte is set, but was able to read random places of EEPROM. However, the following diff makes the board bootable. diff --git a/board/ti/common/board_detect.c b/board/ti/common/board_detect.c index ed34991377..26edddccc6 100644 --- a/board/ti/common/board_detect.c +++ b/board/ti/common/board_detect.c @@ -86,7 +86,6 @@ __weak void gpi2c_init(void) static int __maybe_unused ti_i2c_eeprom_get(int bus_addr, int dev_addr, u32 header, u32 size, uint8_t *ep) { - u32 hdr_read = 0xdeadbeef; int rc; #if CONFIG_IS_ENABLED(DM_I2C) @@ -113,10 +112,10 @@ static int __maybe_unused ti_i2c_eeprom_get(int bus_addr, int dev_addr, * We must allow for fall through to check the data if 2 byte * addressing works */ - (void)dm_i2c_read(dev, 0, (uint8_t *)&hdr_read, 4); + rc = dm_i2c_read(dev, 0, ep, size); /* Corrupted data??? */ - if (hdr_read != header) { + if (rc || (*((u32*)ep) != header)) { /* * read the eeprom header using i2c again, but use only a * 2 byte address (some newer boards need this..) @@ -125,16 +124,13 @@ static int __maybe_unused ti_i2c_eeprom_get(int bus_addr, int dev_addr, if (rc) return rc; - rc = dm_i2c_read(dev, 0, (uint8_t *)&hdr_read, 4); + rc = dm_i2c_read(dev, 0, ep, size); if (rc) return rc; } - if (hdr_read != header) + if (*((u32*)ep) != header) return -1; - rc = dm_i2c_read(dev, 0, ep, size); - if (rc) - return rc; #else u32 byte;