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 282D7C433EF for ; Fri, 8 Jul 2022 23:10:36 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 7FFC0845C6; Sat, 9 Jul 2022 01:10:34 +0200 (CEST) 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="A8BdDjhq"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 8B216845CD; Sat, 9 Jul 2022 01:10:33 +0200 (CEST) Received: from mail-qk1-x732.google.com (mail-qk1-x732.google.com [IPv6:2607:f8b0:4864:20::732]) (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 2F66683A07 for ; Sat, 9 Jul 2022 01:10:31 +0200 (CEST) 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-qk1-x732.google.com with SMTP id v6so95811qkh.2 for ; Fri, 08 Jul 2022 16:10:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=konsulko.com; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=oHeMDzHxhYyW4Wbta07kUdrYxXhpbP31aoVQphFLpwg=; b=A8BdDjhquFCkDpQ60lWQTkogfzz/awmia2C/zADG6g+944UB/HFNGHWL9Zz8/toJvD DrxWmWHESHyLJtxekKIaT1iMIQYkFaMIod3pefwIjH/+bGJWI6WrKNUg80Fgbxzev7WJ PSFZQiFDyRFI0ZtM24ogeDi+SYxnxWJ3/dW+U= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=oHeMDzHxhYyW4Wbta07kUdrYxXhpbP31aoVQphFLpwg=; b=zwXCwNORg//IUi1znpRZxxB0T8+14vzCkgoRdwudbvHFeAjvxocinxPdjTFp+spt0B LrA0ALM2kuLfwcgc84CNd9BwYz9/WBW4UXtgXYDxsoHiaI5ZT5hlvXOuaXDY2A9bSFf9 I8gOzcRRKphQdqJnlcqhvM3O8Np9G8bkXzRNCSZOEoBQpShv1KS+iOUhP15tzNiSFMrw ZbBNakvB/P/a+aEwMoasl7trA0hDZhgUssMbPvLkMRD6uJ1ISZQZATouCO7NFy9Ea3Iw x7LB1t7mVVRJnDrR5b56qpetyw+yXT3OlwQ+rkq8FsmfjWlk7buSWqTHGRCWk/jZBCH6 OWAg== X-Gm-Message-State: AJIora91I1DvrKAecubGimqjRaD+4VvyJDKtSqSRvX0w8jC3MPyNwBbr /A/nKQms94DeAWFhbHBLrIc7HQ== X-Google-Smtp-Source: AGRyM1seIrIF+77Rx1gvK7TpKgxUd3sX27v4zR/ifLNn8Abf053fpHfi2Lyko+Rp8yJiStKOD7bOzg== X-Received: by 2002:a05:620a:220e:b0:6b5:4aaf:396d with SMTP id m14-20020a05620a220e00b006b54aaf396dmr4126701qkh.358.1657321829776; Fri, 08 Jul 2022 16:10:29 -0700 (PDT) Received: from bill-the-cat (cpe-65-184-195-139.ec.res.rr.com. [65.184.195.139]) by smtp.gmail.com with ESMTPSA id d21-20020a05620a159500b006af4f9b77fdsm19180qkk.44.2022.07.08.16.10.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Jul 2022 16:10:28 -0700 (PDT) Date: Fri, 8 Jul 2022 19:10:26 -0400 From: Tom Rini To: Pali =?iso-8859-1?Q?Roh=E1r?= , "Peng Fan (OSS)" Cc: "Peng Fan (OSS)" , Priyanka Jain , Qiang Zhao , Shengzhou Liu , Sinan Akman , u-boot@lists.denx.de Subject: Re: [PATCH v3] board: freescale: p1_p2_rdb_pc: Fix parsing inverted bits from boot input data Message-ID: <20220708231026.GZ1146598@bill-the-cat> References: <8d8a6be1-6033-5771-0e0e-f51de1488e69@oss.nxp.com> <20220616123707.8562-1-pali@kernel.org> <20220623130408.qlrlrkb2rno5ussd@pali> <20220703123913.szw7ljcxdcujr5ts@pali> <20220708224927.3hoh764atqijpngd@pali> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="ZIRKIbUHpDW8b64m" Content-Disposition: inline In-Reply-To: <20220708224927.3hoh764atqijpngd@pali> 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 --ZIRKIbUHpDW8b64m Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Jul 09, 2022 at 12:49:27AM +0200, Pali Roh=E1r wrote: > PING? >=20 > How many times you would ask me to again rebase this patch?? >=20 > On Sunday 03 July 2022 14:39:13 Pali Roh=E1r wrote: > > On Thursday 23 June 2022 15:04:08 Pali Roh=E1r wrote: > > > On Thursday 16 June 2022 14:37:07 Pali Roh=E1r wrote: > > > > On some boards upper 4 bits of i2c boot input data (register 0) are > > > > inverted. Information which bits are inverted is stored in register= 2. > > > >=20 > > > > So invert read input data back according to register 2 prior proces= sing > > > > them. This fixes printing "rom_loc: value" line during booting. > > > >=20 > > > > Signed-off-by: Pali Roh=E1r > > > > --- > > > > Changes in v3: > > > > * Rebased on top of the U-Boot next branch, commit a87a6fcd20c0e29f= e55bfbb6917c4aa1f1bbce74 > > >=20 > > > PING? > >=20 > > PING? > >=20 > > > > Changes in v2: > > > > * Use register 2 for detecting which bits needs to be inverted > > > > --- > > > > board/freescale/p1_p2_rdb_pc/p1_p2_rdb_pc.c | 6 ++++-- > > > > 1 file changed, 4 insertions(+), 2 deletions(-) > > > >=20 > > > > diff --git a/board/freescale/p1_p2_rdb_pc/p1_p2_rdb_pc.c b/board/fr= eescale/p1_p2_rdb_pc/p1_p2_rdb_pc.c > > > > index 6665aa4ba94e..d36306f35427 100644 > > > > --- a/board/freescale/p1_p2_rdb_pc/p1_p2_rdb_pc.c > > > > +++ b/board/freescale/p1_p2_rdb_pc/p1_p2_rdb_pc.c > > > > @@ -174,7 +174,7 @@ int checkboard(void) > > > > { > > > > struct cpld_data *cpld_data =3D (void *)(CONFIG_SYS_CPLD_BASE); > > > > ccsr_gur_t *gur =3D (void *)(CONFIG_SYS_MPC85xx_GUTS_ADDR); > > > > - u8 in, out, io_config, val; > > > > + u8 in, out, invert, io_config, val; > > > > int bus_num =3D CONFIG_SYS_SPD_BUS_NUM; > > > > =20 > > > > /* FIXME: This should just use the model from the device tree or = similar */ > > > > @@ -198,6 +198,7 @@ int checkboard(void) > > > > =20 > > > > if (dm_i2c_read(dev, 0, &in, 1) < 0 || > > > > dm_i2c_read(dev, 1, &out, 1) < 0 || > > > > + dm_i2c_read(dev, 2, &invert, 1) < 0 || > > > > dm_i2c_read(dev, 3, &io_config, 1) < 0) { > > > > printf("Error reading i2c boot information!\n"); > > > > return 0; /* Don't want to hang() on this error */ > > > > @@ -207,13 +208,14 @@ int checkboard(void) > > > > =20 > > > > if (i2c_read(CONFIG_SYS_I2C_PCA9557_ADDR, 0, 1, &in, 1) < 0 || > > > > i2c_read(CONFIG_SYS_I2C_PCA9557_ADDR, 1, 1, &out, 1) < 0 || > > > > + i2c_read(CONFIG_SYS_I2C_PCA9557_ADDR, 2, 1, &invert, 1) < 0 || > > > > i2c_read(CONFIG_SYS_I2C_PCA9557_ADDR, 3, 1, &io_config, 1) < = 0) { > > > > printf("Error reading i2c boot information!\n"); > > > > return 0; /* Don't want to hang() on this error */ > > > > } > > > > #endif > > > > =20 > > > > - val =3D (in & io_config) | (out & (~io_config)); > > > > + val =3D ((in ^ invert) & io_config) | (out & (~io_config)); > > > > =20 > > > > puts("rom_loc: "); > > > > if ((val & (~__SW_BOOT_MASK)) =3D=3D __SW_BOOT_SD) { Peng, this patch doesn't apply currently but also looks fairly obvious to adapt to top of tree. Please just make it apply when you pick this up, thanks. --=20 Tom --ZIRKIbUHpDW8b64m Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQGzBAABCgAdFiEEGjx/cOCPqxcHgJu/FHw5/5Y0tywFAmLIuV4ACgkQFHw5/5Y0 tywwxAv+PwEU4VHoy9L6ALav+hqhOEkngPUvC4MTOoDk4hussNEku4/TawBSNQ1l GZS/mqqX1LhXSFMPTorLklypKOO+uxFpYva59+venM5tlkzUA7LMRMAhDQapNGSq 5VTUHI4JaNrzVK3FXC2YFmLG0oTY+HA4QyoxoRgffDWAqSX8jLfi5wjs1vk5cDnK ei6GX8gEI8OuYeFwkZe4WxkbprEP6UF/ZU3NCmNW53zm2v/iFA+SBEkJir8ns74C swCCvc7X68ey0BHeH5SYNsw68E8oirNWEd8IFkwq/ya8qBjBAev7eyYJ86gZtgVu iGQYFZVj7sSrBPfl6vcBRhcu9NE5717gqfx/M+Py0MOt41fX26XBsGlij97ZA9Un 9rv+OXQm1BzLArT/jVJP8Ptn8qK6NJ5lfnGs3VMZSO0j+oj/YNOlJRJwt/lGlaDq dIWHwWQrenODUPwvQ2C0Y26NSsuqSzMUCWTCsUyaWJZPjjaJiIsnWyOBKUKU4Y5d FouH85Js =wkGM -----END PGP SIGNATURE----- --ZIRKIbUHpDW8b64m--