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 07593C433F5 for ; Sun, 28 Nov 2021 15:42:10 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 11D8A80F6F; Sun, 28 Nov 2021 16:42:08 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=akkea.ca 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=akkea.ca header.i=@akkea.ca header.b="vYv9KrdS"; dkim=pass (1024-bit key) header.d=akkea.ca header.i=@akkea.ca header.b="V3ZKS7wE"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 3183A80F9D; Sun, 28 Nov 2021 16:42:06 +0100 (CET) Received: from node.akkea.ca (li1434-30.members.linode.com [45.33.107.30]) (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 5A1CB8083E for ; Sun, 28 Nov 2021 16:42:02 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=akkea.ca Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=angus@akkea.ca Received: from localhost (localhost [127.0.0.1]) by node.akkea.ca (Postfix) with ESMTP id 035144E2006; Sun, 28 Nov 2021 15:42:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=akkea.ca; s=mail; t=1638114121; bh=Ou1FuUsbk/AGN7Bmw7LmhMZmT7RT7QR4zvZNWgW0B8E=; h=Date:From:To:Cc:Subject:In-Reply-To:References; b=vYv9KrdSXr+18byZ2F0/Tkxgk6pgv4q9FMaCJWugTETS9AC0Kk7R6WaOrSVT96aDw X+fG9u9wad9jN69SVUcCOabqb6rpDf8jTB/JQz6QhFM9PYau2ihxrLnraoQJlzCBdJ BTH8k8Hw1640D2RlxTBkGnoBnETsQIPFWIOO10D4= Received: from node.akkea.ca ([127.0.0.1]) by localhost (mail.akkea.ca [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id dI1fLvoJ4DQr; Sun, 28 Nov 2021 15:41:59 +0000 (UTC) Received: from www.akkea.ca (li1434-30.members.linode.com [45.33.107.30]) by node.akkea.ca (Postfix) with ESMTPSA id 8526A4E2003; Sun, 28 Nov 2021 15:41:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=akkea.ca; s=mail; t=1638114119; bh=Ou1FuUsbk/AGN7Bmw7LmhMZmT7RT7QR4zvZNWgW0B8E=; h=Date:From:To:Cc:Subject:In-Reply-To:References; b=V3ZKS7wEnkNMfnjuyFx8TLfI4kXfvkKHDBBc2Iz8EUgcnxfTCTUFA30HM1jAMcp63 MCNVYHOIH4LHVBkNLHlYkXNKfZDytEQBJubQBqc8nAxHN0+xCi99y/kUmDD5qHWa9b kJeDEbIVmIP1Ry4MkYeQPpl6RP6ggcehkwLAFA/I= MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Sun, 28 Nov 2021 07:41:59 -0800 From: Angus Ainslie To: Fabio Estevam Cc: Angus Ainslie , U-Boot-Denx , Simon Glass , kernel@puri.sm Subject: Re: [PATCH] mxc_gpio: on imx8m read the DR instead of the PSR In-Reply-To: References: <20211128145143.1433262-1-angus@akkea.ca> Message-ID: X-Sender: angus@akkea.ca User-Agent: Roundcube Webmail/1.3.6 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.37 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 Hi Fabio, On 2021-11-28 07:21, Fabio Estevam wrote: > Hi Angus, > > On Sun, Nov 28, 2021 at 12:18 PM Angus Ainslie > wrote: > >> I have tried it with the SION bit set but I thought it would be better >> if the dts would match the linux dts and return the same result. > > Just to confirm: with the SION bit set, you read the correct values, > right? > I just tried it again and setting the SION does not read back the correct values. I believe the changes below [1] should be the correct ones for my dts. u-boot=> gpio status Bank GPIO1_: GPIO1_0: output: 0 [x] csi_en.gpio-hog GPIO1_3: output: 1 [x] sdcard_pwr.gpio-hog GPIO1_4: output: 1 [x] audio_pwr.gpio-hog GPIO1_12: output: 0 [x] hub_nreset.gpio-hog GPIO1_14: output: 1 [x] hub_pwr.gpio-hog Bank GPIO3_: GPIO3_17: output: 0 [x] chg_en.gpio-hog GPIO3_24: output: 0 [x] tps_reset.gpio-hog u-boot=> gpio set GPIO1_12 gpio: pin GPIO1_12 (gpio 12) value is 1 Warning: value of pin is still 0 The gpio-hog should also have set hub_nreset.gpio-hog to 1. [1] diff --git a/arch/arm/dts/imx8mq-librem5.dts b/arch/arm/dts/imx8mq-librem5.dts index b28420654f..b60a8538af 100644 --- a/arch/arm/dts/imx8mq-librem5.dts +++ b/arch/arm/dts/imx8mq-librem5.dts @@ -56,29 +56,29 @@ &iomuxc { pinctrl_hog1: hoggrp1 { fsl,pins = < - MX8MQ_IOMUXC_GPIO1_IO00_GPIO1_IO0 0x83 /* CAMERA_PWR_EN_3V3 */ - MX8MQ_IOMUXC_GPIO1_IO03_GPIO1_IO3 0x83 /* TF_PWR_3V3_EN */ - MX8MQ_IOMUXC_GPIO1_IO04_GPIO1_IO4 0x83 /* AUDIO_POWER_EN_3V3 */ - MX8MQ_IOMUXC_GPIO1_IO05_GPIO1_IO5 0x83 /* DSI_EN_3V3 */ - MX8MQ_IOMUXC_GPIO1_IO11_GPIO1_IO11 0x3f - MX8MQ_IOMUXC_GPIO1_IO12_GPIO1_IO12 0x3f - MX8MQ_IOMUXC_GPIO1_IO14_GPIO1_IO14 0x83 /* HUB_PWR_3V3_EN */ - MX8MQ_IOMUXC_ENET_MDC_GPIO1_IO16 0xC0 - MX8MQ_IOMUXC_ENET_MDIO_GPIO1_IO17 0xC0 - MX8MQ_IOMUXC_ENET_TD1_GPIO1_IO20 0x83 /* DSI_BIAS_EN */ - MX8MQ_IOMUXC_ENET_TXC_GPIO1_IO23 0x83 /* FLASH_EN */ + MX8MQ_IOMUXC_GPIO1_IO00_GPIO1_IO0 0x40000083 /* CAMERA_PWR_EN_3V3 */ + MX8MQ_IOMUXC_GPIO1_IO03_GPIO1_IO3 0x40000083 /* TF_PWR_3V3_EN */ + MX8MQ_IOMUXC_GPIO1_IO04_GPIO1_IO4 0x40000083 /* AUDIO_POWER_EN_3V3 */ + MX8MQ_IOMUXC_GPIO1_IO05_GPIO1_IO5 0x40000083 /* DSI_EN_3V3 */ + MX8MQ_IOMUXC_GPIO1_IO11_GPIO1_IO11 0x4000003f + MX8MQ_IOMUXC_GPIO1_IO12_GPIO1_IO12 0x4000003f + MX8MQ_IOMUXC_GPIO1_IO14_GPIO1_IO14 0x40000083 /* HUB_PWR_3V3_EN */ + MX8MQ_IOMUXC_ENET_MDC_GPIO1_IO16 0x400000C0 + MX8MQ_IOMUXC_ENET_MDIO_GPIO1_IO17 0x400000C0 + MX8MQ_IOMUXC_ENET_TD1_GPIO1_IO20 0x40000083 /* DSI_BIAS_EN */ + MX8MQ_IOMUXC_ENET_TXC_GPIO1_IO23 0x40000083 /* FLASH_EN */ >; }; pinctrl_hog3: hoggrp3 { fsl,pins = < - MX8MQ_IOMUXC_NAND_CE1_B_GPIO3_IO2 0x3 /* CHG_EN */ - MX8MQ_IOMUXC_NAND_CE3_B_GPIO3_IO4 0x3 /* CHG_OTG_OUT_EN */ - MX8MQ_IOMUXC_NAND_DATA04_GPIO3_IO10 0x83 /* WIFI3V3_EN */ - MX8MQ_IOMUXC_NAND_DATA06_GPIO3_IO12 0x83 /* GPS3V3_EN */ - MX8MQ_IOMUXC_NAND_DQS_GPIO3_IO14 0x83 /* BACKLINGE_EN */ - MX8MQ_IOMUXC_NAND_WP_B_GPIO3_IO18 0x83 /* 4G_PWR_EN */ - MX8MQ_IOMUXC_SAI5_RXD3_GPIO3_IO24 0x83 /* TPS_RESET */ + MX8MQ_IOMUXC_NAND_CE1_B_GPIO3_IO2 0x40000003 /* CHG_EN */ + MX8MQ_IOMUXC_NAND_CE3_B_GPIO3_IO4 0x40000003 /* CHG_OTG_OUT_EN */ + MX8MQ_IOMUXC_NAND_DATA04_GPIO3_IO10 0x40000083 /* WIFI3V3_EN */ + MX8MQ_IOMUXC_NAND_DATA06_GPIO3_IO12 0x40000083 /* GPS3V3_EN */ + MX8MQ_IOMUXC_NAND_DQS_GPIO3_IO14 0x40000083 /* BACKLINGE_EN */ + MX8MQ_IOMUXC_NAND_WP_B_GPIO3_IO18 0x40000083 /* 4G_PWR_EN */ > If so, the fix is just to set the SION bit in both Linux and U-Boot. > > There were several attempts to change the mxc gpio driver like you > proposed, and the response > have been always to set the SION bit, which works well in Linux and > U-Boot.