From patchwork Wed Jan 15 11:54:16 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Codrin Ciubotariu X-Patchwork-Id: 11333883 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 2C8A6139A for ; Wed, 15 Jan 2020 11:54:57 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id E21942187F for ; Wed, 15 Jan 2020 11:54:56 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="OudCMr3r" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E21942187F Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=microchip.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:Subject:To :From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=1BCbEe4pbrFY56deJUqdoVXkSDpE+VTZj7JECRxEUO0=; b=OudCMr3rKrXV+2 OBiwDzCRQsCCrwSEltF+RkVuUaoSZN2apV8j8vkwlWmQhyrZ14s7BV9wa6MmNgFDxDHonO/TYo0Xt BR7yAF42DTl1I7sii8mq0YsEoL81FQSoFAo2bx/KYV5GxEiLCoU0qL8B+AL55qwBiCIpoa16fyyJ4 sIGev7ye1D8i1o0m0D/lfecaExXYCNW82punZ8+9X4NNsSiGWfkdiasirPLk/a+S2AM7wBPJlwINE 62RyW58QPPUhLR/nLjLqw5G1knaxQDqMgIsK97nzYMA/JOZ+zFNY03UUO4MPA+CsjVSmEF5nCZPrq dbgbk2dnDgMKZtcbFjSA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1irhGA-0004JJ-KR; Wed, 15 Jan 2020 11:54:54 +0000 Received: from esa6.microchip.iphmx.com ([216.71.154.253]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1irhG1-0004HI-J2 for linux-arm-kernel@lists.infradead.org; Wed, 15 Jan 2020 11:54:51 +0000 Received-SPF: Pass (esa6.microchip.iphmx.com: domain of Codrin.Ciubotariu@microchip.com designates 198.175.253.82 as permitted sender) identity=mailfrom; client-ip=198.175.253.82; receiver=esa6.microchip.iphmx.com; envelope-from="Codrin.Ciubotariu@microchip.com"; x-sender="Codrin.Ciubotariu@microchip.com"; x-conformance=spf_only; x-record-type="v=spf1"; x-record-text="v=spf1 mx a:ushub1.microchip.com a:smtpout.microchip.com -exists:%{i}.spf.microchip.iphmx.com include:servers.mcsv.net include:mktomail.com include:spf.protection.outlook.com ~all" Received-SPF: None (esa6.microchip.iphmx.com: no sender authenticity information available from domain of postmaster@email.microchip.com) identity=helo; client-ip=198.175.253.82; receiver=esa6.microchip.iphmx.com; envelope-from="Codrin.Ciubotariu@microchip.com"; x-sender="postmaster@email.microchip.com"; x-conformance=spf_only Authentication-Results: esa6.microchip.iphmx.com; dkim=none (message not signed) header.i=none; spf=Pass smtp.mailfrom=Codrin.Ciubotariu@microchip.com; spf=None smtp.helo=postmaster@email.microchip.com; dmarc=pass (p=none dis=none) d=microchip.com IronPort-SDR: pP7gQZMEpK7mEL9FDGYrQjSlY+YzgyrMlhYrl7RQfNvNfT4iKWfc4z4n2t2+dAeDU8jaQ0p4GJ 8d7ak7P+j5G8v2D4cn5xBMnEyDMcW3Lu352VHlAVYaN/Dtqvysx3+qrriLfYkophv8G9WC25fm 4YJ3zyN4545CJo5oxbbhb5Y+pdN83yE0+rpU4mke+Ka1r9a73GYKx17FFAa8UCS7xdVErSVrwk ir85t39bCC6h0J0nk4+clAq34x3V4xpxHvRDGhjV4a0BOCSwttqfkrQh4QQrdsjWNRY8/Pgy+6 /FI= X-IronPort-AV: E=Sophos;i="5.70,322,1574146800"; d="scan'208";a="60862973" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa6.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 15 Jan 2020 04:54:40 -0700 Received: from chn-vm-ex03.mchp-main.com (10.10.85.151) by chn-vm-ex01.mchp-main.com (10.10.85.143) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Wed, 15 Jan 2020 04:54:39 -0700 Received: from rob-ult-m19940.microchip.com (10.10.85.251) by chn-vm-ex03.mchp-main.com (10.10.85.151) with Microsoft SMTP Server id 15.1.1713.5 via Frontend Transport; Wed, 15 Jan 2020 04:54:36 -0700 From: Codrin Ciubotariu To: , , , Subject: [PATCH v3 0/6] i2c bus recovery for Microchip SoCs Date: Wed, 15 Jan 2020 13:54:16 +0200 Message-ID: <20200115115422.17097-1-codrin.ciubotariu@microchip.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200115_035445_665089_F7E41E2F X-CRM114-Status: UNSURE ( 8.91 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -2.3 (--) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-2.3 points) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [216.71.154.253 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: robh@kernel.org, alexandre.belloni@bootlin.com, kamel.bouhara@bootlin.com, wsa@the-dreams.de, linux@armlinux.org.uk, Ludovic.Desroches@microchip.com, Codrin Ciubotariu , peda@axentia.se Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org This patch series introduce the i2c bus recovery mechanism for the Microchip SoCs. Some SoCs have hardware support for recovery, while for those who don't the i2c-gpio bus recovery mechanism is used. Updated the corresponding dts to add i2c gpio pinctrl. The bus recovery is configured for the sama5d2/3/4 xplained and sama5d27 som1 EK boards in dts. Changes in v3: - addressed list comments: - removed pull-ups from gpios; - removed unused headers from i2c-at91.h; - fixed commit message and subject on patch 3/6; - added received tags; - rebased on top of i2c/for-next; Changes in v2: - integrated the HW CLEAR command patch; - call i2c_recover_bus() after an error occurs, if SDA is down; - added i2c gpio pinctrl in sama5d2 xplained and sama5d27 som1 EK boards; Codrin Ciubotariu (1): i2c: at91: Send bus clear command if SDA is down Kamel Bouhara (5): dt-bindings: i2c: at91: document optional bus recovery properties i2c: at91: implement i2c bus recovery ARM: at91/dt: sama5d3: add i2c gpio pinctrl ARM: at91/dt: sama5d4: add i2c gpio pinctrl ARM: at91/dt: sama5d2: add i2c gpio pinctrl .../devicetree/bindings/i2c/i2c-at91.txt | 10 ++ arch/arm/boot/dts/at91-sama5d2_ptc_ek.dts | 33 +++++- arch/arm/boot/dts/at91-sama5d2_xplained.dts | 33 +++++- arch/arm/boot/dts/sama5d3.dtsi | 33 +++++- arch/arm/boot/dts/sama5d4.dtsi | 33 +++++- drivers/i2c/busses/i2c-at91-core.c | 2 + drivers/i2c/busses/i2c-at91-master.c | 100 ++++++++++++++++++ drivers/i2c/busses/i2c-at91.h | 11 +- 8 files changed, 242 insertions(+), 13 deletions(-)