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 6CF25C4321E for ; Tue, 29 Nov 2022 13:32:12 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id D82288532C; Tue, 29 Nov 2022 14:32:09 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=konsulko.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=konsulko.com header.i=@konsulko.com header.b="Joyh+WTa"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 45E8B85324; Tue, 29 Nov 2022 14:32:07 +0100 (CET) Received: from mail-ej1-x62d.google.com (mail-ej1-x62d.google.com [IPv6:2a00:1450:4864:20::62d]) (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 AF10E852D0 for ; Tue, 29 Nov 2022 14:32:04 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=konsulko.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=trini@konsulko.com Received: by mail-ej1-x62d.google.com with SMTP id fy37so33735256ejc.11 for ; Tue, 29 Nov 2022 05:32:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=konsulko.com; s=google; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=5SqJap7mvOcHR2ggjIPqXCl0DtYl7Q801It2tccSlqs=; b=Joyh+WTasiUt2HUEdH/+AaelgeK2s61xOmwbOyjF2YR9EhPaT+7b9bKf19THfkyWRM A60pSj3KkGHJCw+eg69uCp05v6SHw1BT83H6oSafgqUQ5z375kzdpQxnZ8TLlWFD22Gc Lhc/R+0dKBB94ZSgu2XuUa/ZJa8qSMJjO+8Kk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=5SqJap7mvOcHR2ggjIPqXCl0DtYl7Q801It2tccSlqs=; b=TeEdZDKPctyKZ2h58vUedEY3fyXGsKCoG8vpFzALiBexhvmSReyzJc4Ucco8FGg5qP ZRiT2sXQNeoxsWOtqLsnJ1aSgSL5xg/j3td2jL7pBV7wD045tLEgVHDzXOPfBG4Wm22M 3redbIY54lcYYlhdzNLG7dqCqH7dW20Y9HpkmUcLEtP1at+ceFJpgMHBgV5+9dA9OHBv euRViDrarAFeng5nt+JQuynjVYejWmDwQzTO0iVrOQ/B3QfJRxKgarpnnlnVmjXeWo5c FNcs0RDzimnVY/WNjEBFONJMWeZ/4DTOiGm1HkgfUg7YKwTmsFYFXF8OvMFfE0XNVZY5 Ahfg== X-Gm-Message-State: ANoB5pkk6HF2LSyKCENyWaZbRgmPqfE+LmfNAHwUWEgFcD6D4HOVexA4 G6r38lFsj28z0TMtPgD3JZo0dQ== X-Google-Smtp-Source: AA0mqf6BcViRb1574rMMeBkBrKVTfHOIqiUjaGxxzzhW1ObTSkpz/K398RNtKU5p8TQRWQYu13tnEw== X-Received: by 2002:a17:907:d08c:b0:7b6:62c:dd57 with SMTP id vc12-20020a170907d08c00b007b6062cdd57mr38011555ejc.207.1669728724223; Tue, 29 Nov 2022 05:32:04 -0800 (PST) Received: from bill-the-cat (2603-6081-7b00-6400-69da-bdfc-6a2b-e036.res6.spectrum.com. [2603:6081:7b00:6400:69da:bdfc:6a2b:e036]) by smtp.gmail.com with ESMTPSA id u1-20020a1709061da100b007b7ae09683bsm6208950ejh.95.2022.11.29.05.32.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 29 Nov 2022 05:32:03 -0800 (PST) Date: Tue, 29 Nov 2022 08:31:59 -0500 From: Tom Rini To: "Matwey V. Kornilov" Cc: Neha Malcom Francis , u-boot@lists.denx.de, nm@ti.com, robertcnelson@gmail.com, vigneshr@ti.com Subject: Re: [RFC PATCH] board: ti: common: board_detect: Fix EEPROM read quirk for 2-byte Message-ID: <20221129133159.GR3787616@bill-the-cat> References: <20221129065010.123065-1-n-francis@ti.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="hu1ClgjWvfumRnAp" Content-Disposition: inline In-Reply-To: X-Clacks-Overhead: GNU Terry Pratchett 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 --hu1ClgjWvfumRnAp Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Nov 29, 2022 at 03:10:12PM +0300, Matwey V. Kornilov wrote: > =D0=B2=D1=82, 29 =D0=BD=D0=BE=D1=8F=D0=B1. 2022 =D0=B3. =D0=B2 09:50, Neh= a Malcom Francis : > > > > EEPROM detection logic in ti_i2c_eeprom_get() involves figuring out > > whether addressing is 1-byte or 2-byte. There are currently different > > behaviours seen across boards as documented in commit bf6376642fe8 > > ("board: ti: common: board_detect: Fix EEPROM read quirk"). Adding to > > the list, we see that there are 2-byte EEPROMs that read properly > > with 1-byte addressing with no offset. > > > > For ti_i2c_eeprom_am6_get where eeprom parse operation is dynamic, the > > earlier commit d2ab2a2bafd5 ("board: ti: common: board_detect: Fix > > EEPROM read quirk for AM6 style data") tried to resolve this by running > > ti_i2c_eeprom_get() twice. However this commit along with its former > > commit fails on J7 platforms where EEPROM successfully return back the > > header on 1-byte addressing and continues to do so until an offset is > > introduced. So the second read incorrectly determines the EEPROM as > > 1-byte addressing. > > > > A more generic solution is introduced here to solve > > this issue: 1-byte read without offset and 1-byte read with offset. If > > both passes, it follows 1-byte addressing else we proceed with 2-byte > > addressing check. > > > > Tested on J721E, J7200, DRA7xx, AM64x >=20 > I'll try to test this on the AM335x boards I have as soon as possible. I wonder if we should re-factor this code a bit and not have a single ti_i2c_eeprom_get but instead build for whichever sets of quirks a given family of boards has with their EEPROMs. I really worry that we're going to find that this change here breaks yet another different EEPROM than before. --=20 Tom --hu1ClgjWvfumRnAp Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQGzBAABCgAdFiEEGjx/cOCPqxcHgJu/FHw5/5Y0tywFAmOGCcgACgkQFHw5/5Y0 tyzp7AwAsh/T8V1puceruw2t7arcYQnkbE45CATbxGiVanxR+YgQcf/BB3IskOuL 3M0E6QhRxHaGyWsoc3SJSe12bI/LIQyXudBtz0RSwroOuDpkjZc5005hnl8TzmEi FMGIAoOcqE4gmaUZOLmvHLnY767fhpUBFES0paK3poHfz38XDekpLHJHR7CfHhM1 ch24Cx9Vgu0qlht7JBo3NqwlxCsGzY+cnJ/7GHXk8jM4elRutU1xTKYlYlDDAJau tZ/LggwxzKhKKwbUwqshBn3ZvjEzPMKt0utTkuXhU9RhYSzKuB3Z5SKPnyffJ5n1 tgFVK/9HsN2BJaVN0gidm0HMfynOrW0beIqlkimudH8EmNlTtaHQI/hslc1kbyRb E1zOkRvSAIWhz1Lh+u2npZA+MjnG4TelbP1N8z/2vHF18XWa17LkWw15nuUqf+HE 8fXR+MI6Vmmp4SaQiWMGsKTt73tkfXbP+q9tXo/ziTj2Yz5PPjED2oxb2Ngd9TZU 5Nl5SZgE =JQO5 -----END PGP SIGNATURE----- --hu1ClgjWvfumRnAp--