From patchwork Fri Jan 10 07:35:11 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wolfgang Wallner X-Patchwork-Id: 1220857 X-Patchwork-Delegate: bmeng.cn@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=br-automation.com Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 47vFCC27NNz9sPn for ; Fri, 10 Jan 2020 18:35:51 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 4D1AC8171F; Fri, 10 Jan 2020 08:35:48 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=br-automation.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by phobos.denx.de (Postfix, from userid 109) id BA1E180E45; Fri, 10 Jan 2020 08:35:46 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=SPF_HELO_PASS, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from mail2.br-automation.com (mail2.br-automation.com [213.33.116.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 877F880E45 for ; Fri, 10 Jan 2020 08:35:44 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=br-automation.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=wolfgang.wallner@br-automation.com X-AuditID: c0a80110-56bff70000001e7e-72-5e182950f230 Received: from brsmtp01.br-automation.co.at (Unknown_Domain [192.168.1.60]) by mail2.br-automation.com () with SMTP id 8A.9A.07806.059281E5; Fri, 10 Jan 2020 08:35:44 +0100 (CET) From: "Wolfgang Wallner" To: u-boot@lists.denx.de Subject: [PATCH 1/3] gpio: intel_gpio: Pass pinctrl device to pcr_clrsetbits32() Date: Fri, 10 Jan 2020 08:35:11 +0100 Message-Id: <20200110073513.19472-2-wolfgang.wallner@br-automation.com> In-Reply-To: <20200110073513.19472-1-wolfgang.wallner@br-automation.com> X-Mailer: git-send-email 2.24.1 References: <20200110073513.19472-1-wolfgang.wallner@br-automation.com> MIME-Version: 1.0 X-MIMETrack: Itemize by SMTP Server on BRSMTPINTERN2/InternSMTP(Release 9.0.1FP5|November 22, 2015) at 10/01/2020 08:35:43, Serialize by Router on BRSMTPINTERN2/InternSMTP(Release 9.0.1FP5|November 22, 2015) at 10/01/2020 08:35:43, Itemize by SMTP Server on BRSMTP01/Eggelsberg/AT/B&R(Release 10.0.1FP3|August 09, 2019) at 01/10/2020 08:35:42 AM X-TNEFEvaluated: 1 X-Disclaimed: 33595 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrMLMWRmVeSWpSXmKPExsVyYAWjjW6ApkScwapudoupPfEW37ZsY7R4 u7eT3YHZY3bDRRaPnbPusnucvbODMYA5issmJTUnsyy1SN8ugStj3oL9jAUXOCsebTjN3MA4 naOLkYNDQsBEom2ydxcjF4eQwBZGiXvN31i6GDk52ARsJRqPbGUDsUUEJCR+9V9lBLGZBeok 5r/cDGYLCwRIzH32kh3EZhFQlfj3bToriM0r4C7xaetHNpD5nAIeEg+aFCFatSWWLXzNDGJL CMhLbP32CaxcCKj86YEJjBCtghInZz5hAblHQuA+k8T+BzOhGoQkTi8+ywxxs7DE/1W6ExgF ZiEZOwtJ+wJGplWM4rmJmTlGeklFuomlJfm5iSWZ+Xl6yfm5mxghASmwg3H3G+1DjEwcjIcY JTiYlUR4j94QixPiTUmsrEotyo8vKs1JLT7EKM3BoiTOe13yU6yQQHpiSWp2ampBahFMlomD U6qBMbHv2J4Q7T35LLUCpp8j7qzYMJcpL3998tkMzk+iWVvdla4+VzdWO9C7syM8I3sZm55e SOVFW63bNoFSpXGxJ5yTu76LXItlPN5y1nuXxT6dqVmG507XXNnNN8NB7kXQugiB/8fuKn1O 9tpetskn8tNZ4adTp2kekJ99SIhrW0rphrfn7EQXKrEUZyQaajEXFScCAKR/zlc2AgAA X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.26 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.101.4 at phobos.denx.de X-Virus-Status: Clean The function pcr_clrsetbits32() expects a device with a P2SB parent device. The currently passed device 'dev' is a gpio-controller with a device 'pinctrl' as parent. This does not match the expectations of pcr_clrsetbits32(). But he 'pinctrl'-device has a P2SB as parent. Pass the 'pinctrl' device instead of the 'dev' device to pcr_clrsetbits32(). Signed-off-by: Wolfgang Wallner Reviewed-by: Simon Glass Reviewed-by: Bin Meng --- drivers/gpio/intel_gpio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpio/intel_gpio.c b/drivers/gpio/intel_gpio.c index 4bf1c9ddc4..db63115628 100644 --- a/drivers/gpio/intel_gpio.c +++ b/drivers/gpio/intel_gpio.c @@ -39,7 +39,7 @@ static int intel_gpio_direction_output(struct udevice *dev, uint offset, struct udevice *pinctrl = dev_get_parent(dev); uint config_offset = intel_pinctrl_get_config_reg_addr(pinctrl, offset); - pcr_clrsetbits32(dev, config_offset, + pcr_clrsetbits32(pinctrl, config_offset, PAD_CFG0_MODE_MASK | PAD_CFG0_RX_STATE | PAD_CFG0_TX_DISABLE, PAD_CFG0_MODE_GPIO | PAD_CFG0_RX_DISABLE | From patchwork Fri Jan 10 07:35:12 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wolfgang Wallner X-Patchwork-Id: 1220858 X-Patchwork-Delegate: bmeng.cn@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=br-automation.com Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 47vFCM4zZzz9sR4 for ; Fri, 10 Jan 2020 18:35:59 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id E4D7181755; Fri, 10 Jan 2020 08:35:50 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=br-automation.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by phobos.denx.de (Postfix, from userid 109) id 04F1681734; Fri, 10 Jan 2020 08:35:50 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=SPF_HELO_PASS, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from mail2.br-automation.com (mail2.br-automation.com [213.33.116.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id B9A5280E45 for ; Fri, 10 Jan 2020 08:35:47 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=br-automation.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=wolfgang.wallner@br-automation.com X-AuditID: c0a80110-555ff70000001e7e-73-5e182953b137 Received: from brsmtp01.br-automation.co.at (Unknown_Domain [192.168.1.60]) by mail2.br-automation.com () with SMTP id CA.9A.07806.359281E5; Fri, 10 Jan 2020 08:35:47 +0100 (CET) From: "Wolfgang Wallner" To: u-boot@lists.denx.de Subject: [PATCH 2/3] gpio: intel_gpio: Clear tx state bit when setting output Date: Fri, 10 Jan 2020 08:35:12 +0100 Message-Id: <20200110073513.19472-3-wolfgang.wallner@br-automation.com> In-Reply-To: <20200110073513.19472-1-wolfgang.wallner@br-automation.com> X-Mailer: git-send-email 2.24.1 References: <20200110073513.19472-1-wolfgang.wallner@br-automation.com> MIME-Version: 1.0 X-MIMETrack: Itemize by SMTP Server on BRSMTPINTERN2/InternSMTP(Release 9.0.1FP5|November 22, 2015) at 10/01/2020 08:35:47, Serialize by Router on BRSMTPINTERN2/InternSMTP(Release 9.0.1FP5|November 22, 2015) at 10/01/2020 08:35:47, Itemize by SMTP Server on BRSMTP01/Eggelsberg/AT/B&R(Release 10.0.1FP3|August 09, 2019) at 01/10/2020 08:35:46 AM X-TNEFEvaluated: 1 X-Disclaimed: 27495 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrKLMWRmVeSWpSXmKPExsVyYAWjjW6wpkScwdT58hZTe+Itvm3Zxmjx dm8nuwOzx+yGiyweO2fdZfc4e2cHYwBzFJdNSmpOZllqkb5dAldG68Q5bAUb2Su2PXzA3sA4 i62LkZNDQsBEYuLBOUA2F4eQwBZGiQW/e1hAEmwCthKNR7aCFYkISEj86r/KCGIzC9RJzH+5 GcwWFvCVOLn1LhOIzSKgKrHty1Iwm1fAXWLfsn6gGg4OTgEPiQdNihCt2hLLFr5mhtgrL7H1 2ydWEFsIqPzpgQmMEK2CEidnPmEBuUdC4D6TROPixVANQhKnF5+FsoUlLiycwzaBUWAWkrmz kPQvYGRaxSiem5iZY6SXVKSbWFqSn5tYkpmfp5ecn7uJERKUAjsYd7/RPsTIxMF4iFGCg1lJ hPfoDbE4Id6UxMqq1KL8+KLSnNTiQ4zSHCxK4rzXJT/FCgmkJ5akZqemFqQWwWSZODilGhgT F1rxHNWsOpQqu2qOW3csj4RVV8mNU96rrJjdVz2YHL8t7vuyk3nxvra+a991bz1s8kmtYE4Q /0evyrzuPYGpsy0v1TXbnTNfu29SkJJUmvDrNZnFb322B+b16hQtv3JyzYkVDzqOL/b7EVHp YsLL3PFoRYy3/vaqxPy3mR+Vky7LNnF63FdiKc5INNRiLipOBADl89UGOAIAAA== X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.26 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.101.4 at phobos.denx.de X-Virus-Status: Clean Add missing 'PAD_CFG0_TX_STATE' to the clear mask for pcr_clrsetbits32(). Otherwise this bit cannot be cleared again after it has been set once. Signed-off-by: Wolfgang Wallner Reviewed-by: Simon Glass Reviewed-by: Bin Meng --- drivers/gpio/intel_gpio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpio/intel_gpio.c b/drivers/gpio/intel_gpio.c index db63115628..ec1a315ae2 100644 --- a/drivers/gpio/intel_gpio.c +++ b/drivers/gpio/intel_gpio.c @@ -41,7 +41,7 @@ static int intel_gpio_direction_output(struct udevice *dev, uint offset, pcr_clrsetbits32(pinctrl, config_offset, PAD_CFG0_MODE_MASK | PAD_CFG0_RX_STATE | - PAD_CFG0_TX_DISABLE, + PAD_CFG0_TX_DISABLE | PAD_CFG0_TX_STATE, PAD_CFG0_MODE_GPIO | PAD_CFG0_RX_DISABLE | (value ? PAD_CFG0_TX_STATE : 0)); From patchwork Fri Jan 10 07:35:13 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wolfgang Wallner X-Patchwork-Id: 1220859 X-Patchwork-Delegate: bmeng.cn@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=br-automation.com Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 47vFCZ2KhTz9sPn for ; Fri, 10 Jan 2020 18:36:10 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 3821880E45; Fri, 10 Jan 2020 08:35:57 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=br-automation.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by phobos.denx.de (Postfix, from userid 109) id 0257480E45; Fri, 10 Jan 2020 08:35:56 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=SPF_HELO_PASS, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from mail2.br-automation.com (mail2.br-automation.com [213.33.116.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id F2B2E81764 for ; Fri, 10 Jan 2020 08:35:50 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=br-automation.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=wolfgang.wallner@br-automation.com X-AuditID: c0a80110-555ff70000001e7e-75-5e18295669f0 Received: from brsmtp01.br-automation.co.at (Unknown_Domain [192.168.1.60]) by mail2.br-automation.com () with SMTP id 3B.9A.07806.659281E5; Fri, 10 Jan 2020 08:35:50 +0100 (CET) From: "Wolfgang Wallner" To: u-boot@lists.denx.de Subject: [PATCH 3/3] gpio: intel_gpio: Fix register/bit offsets intel_gpio_get_value() Date: Fri, 10 Jan 2020 08:35:13 +0100 Message-Id: <20200110073513.19472-4-wolfgang.wallner@br-automation.com> In-Reply-To: <20200110073513.19472-1-wolfgang.wallner@br-automation.com> X-Mailer: git-send-email 2.24.1 References: <20200110073513.19472-1-wolfgang.wallner@br-automation.com> MIME-Version: 1.0 X-MIMETrack: Itemize by SMTP Server on BRSMTPINTERN2/InternSMTP(Release 9.0.1FP5|November 22, 2015) at 10/01/2020 08:35:50, Serialize by Router on BRSMTPINTERN2/InternSMTP(Release 9.0.1FP5|November 22, 2015) at 10/01/2020 08:35:50, Itemize by SMTP Server on BRSMTP01/Eggelsberg/AT/B&R(Release 10.0.1FP3|August 09, 2019) at 01/10/2020 08:35:49 AM X-TNEFEvaluated: 1 X-Disclaimed: 12827 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrELMWRmVeSWpSXmKPExsVyYAWjjW6YpkScQf9tU4upPfEW37ZsY7R4 u7eT3YHZY3bDRRaPnbPusnucvbODMYA5issmJTUnsyy1SN8ugSujZetfpoLXXBWLZ31jbGB8 z9HFyMkhIWAicf70JrYuRi4OIYEtjBKrt35gAUmwCdhKNB7ZygZiiwhISPzqv8oIYjML1EnM f7kZzBYWCJOYs2UNWD2LgKrE4+mHgeIcHLwC7hLPXqWDmJwCHhIPmhQhOrUlli18zQyxVl5i 67dPrCC2EFD10wMTwCbyCghKnJz5hAWi5j6TxPafdhC2kMTpxWeZQUZKCAhLbGmLmMAoMAvJ 1FlIuhcwMq1iFM9NzMwx0ksq0k0sLcnPTSzJzM/TS87P3cQICUeBHYy732gfYmTiYDzEKMHB rCTCe/SGWJwQb0piZVVqUX58UWlOavEhRmkOFiVx3uuSn2KFBNITS1KzU1MLUotgskwcnFIN jLNXznGoUEmc4J53/Eb69wymsN2bVoi1K4s1HC/6KOjq861357nLSwS1+bKaBS9bn1zXsLLC TO/0p9LAed4Sts1x8l9unCvL+n5ZL7/Qeb2LyuF9Vz5NLVkU0RHH1aK45NadYmOu7eeC258k WmUeP2uQns0vlB+QfqH2R9TNXVcPSAaUuv79rsRSnJFoqMVcVJwIAAQDydo1AgAA X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.26 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.101.4 at phobos.denx.de X-Virus-Status: Clean Fix the following in intel_gpio_get_value(): * The value of the register is contained in the variable 'reg', not in 'mode'. The variable 'mode' contains only the configuration whether the gpio is currently an input or an output. * The correct bitmasks for the input and output value are PAD_CFG0_RX_STATE and PAD_CFG0_TX_STATE. Use them instead of the currently used PAD_CFG0_RX_STATE_BIT and PAD_CFG0_TX_STATE_BIT. Signed-off-by: Wolfgang Wallner Reviewed-by: Simon Glass Reviewed-by: Bin Meng --- drivers/gpio/intel_gpio.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpio/intel_gpio.c b/drivers/gpio/intel_gpio.c index ec1a315ae2..ef47b92ca4 100644 --- a/drivers/gpio/intel_gpio.c +++ b/drivers/gpio/intel_gpio.c @@ -59,9 +59,9 @@ static int intel_gpio_get_value(struct udevice *dev, uint offset) if (!mode) { rx_tx = reg & (PAD_CFG0_TX_DISABLE | PAD_CFG0_RX_DISABLE); if (rx_tx == PAD_CFG0_TX_DISABLE) - return mode & PAD_CFG0_RX_STATE_BIT ? 1 : 0; + return reg & PAD_CFG0_RX_STATE ? 1 : 0; else if (rx_tx == PAD_CFG0_RX_DISABLE) - return mode & PAD_CFG0_TX_STATE_BIT ? 1 : 0; + return reg & PAD_CFG0_TX_STATE ? 1 : 0; } return 0;