Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp6826136ybf; Fri, 6 Mar 2020 05:20:37 -0800 (PST) X-Google-Smtp-Source: ADFU+vsXaKRF4/MAzBbcVf7KhQOJY1v+JRIcGkyxBZB4wMol7eB72fLwjYXVLZl7tG48C1mj34/N X-Received: by 2002:a9d:7a97:: with SMTP id l23mr2464599otn.302.1583500837147; Fri, 06 Mar 2020 05:20:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1583500837; cv=none; d=google.com; s=arc-20160816; b=G16ywYCEsVOcwkk3PI7eXKAMrzCXiIDzFIhAMY9I3GQqlHur2mksVGu2THRMJhKcTx M35dtIaTib3FnJtK6wU1h5IfOq7ot3zfwX/mY5ta15ERQI/+rVox7GgrU2SsIzl2paER jOLDJPT/Ynio1Zxo/aNLXXBa9wDRTaPNSGOqYh0DU1NtUYLwfUxIVLn8na6rR55zqOm5 H0P0qYlexhhe6CiT8v8PyHylMZK5tr4sy37m6MU1lqmCrOzpG6EldaCRN90KL6LFMg2R puC/gtlNJiLbFw62k4Ixa99g8w325/05LCxKH0O/Qi6F+K+FeSuT8u9SCkPhz0N5kWqK RIZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:message-id:content-transfer-encoding :mime-version:date:subject:cc:from; bh=Nw5AMVLCi2Zv4ygQp+b4fgWHBcBTUNTab77zEv25jR0=; b=EzT/4cui4YR3uYsexOWq80wXg1XBZxSBVunZNxBR4pNtYAibpFwO7otv3YPsDOwnJh TQoi/gMKfBNxfcEpBJ010YYhNi8XgHvirYhnaBvirgIPbYmUAKf/EFsmxMd4noWc27V4 brVaH+LBJNBOghlhYjqQ5Cr0IhFZNoqtkxwsajncpW1hDnIEOsQ9JBbe4BQK1xDnY/j/ m7EhX0BHy+oNMkSFRW0CFuSyJQ4yaZAk7l2c6Zp+JjAqQbNEOpFsp9prZnjcL4oYBC2R sKiqz3ZmsZ3zFmQGDB7/lCxlJBX+754S3mboGpc9g9OoUg0WRfWWagWEsIrSHm7nKSRg qPRw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b1si1387766otq.81.2020.03.06.05.20.23; Fri, 06 Mar 2020 05:20:37 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726646AbgCFNUE (ORCPT + 99 others); Fri, 6 Mar 2020 08:20:04 -0500 Received: from mail.baikalelectronics.com ([87.245.175.226]:36666 "EHLO mail.baikalelectronics.ru" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726240AbgCFNUD (ORCPT ); Fri, 6 Mar 2020 08:20:03 -0500 Received: from localhost (unknown [127.0.0.1]) by mail.baikalelectronics.ru (Postfix) with ESMTP id 1B875803087C; Fri, 6 Mar 2020 13:20:01 +0000 (UTC) X-Virus-Scanned: amavisd-new at baikalelectronics.ru Received: from mail.baikalelectronics.ru ([127.0.0.1]) by localhost (mail.baikalelectronics.ru [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id AuQSr6ZhEDbM; Fri, 6 Mar 2020 16:20:00 +0300 (MSK) From: CC: Serge Semin , Serge Semin , Alexey Malahov , Maxim Kaurkin , Pavel Parkhomenko , Ramil Zaripov , Ekaterina Skachko , Vadim Vlasov , Thomas Bogendoerfer , Paul Burton , Ralf Baechle , Jarkko Nikula , Andy Shevchenko , Mika Westerberg , Rob Herring , Mark Rutland , Wolfram Sang , , , Subject: [PATCH 0/6] i2c: designeware: Add Baikal-T1 SoC DW I2C specifics support Date: Fri, 6 Mar 2020 16:19:49 +0300 MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-ClientProxiedBy: MAIL.baikal.int (192.168.51.25) To mail (192.168.51.25) Message-Id: <20200306132001.1B875803087C@mail.baikalelectronics.ru> To: unlisted-recipients:; (no To-header on input) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Serge Semin There are three DW I2C controllers embedded into the Baikal-T1 SoC. Two of them are normal with standard DW I2C IP-core configurations and registers accessible over normal MMIO space - so they are acceptable by the available DW I2C driver with no modification. But there is a third, which is a bit different. Its registers are indirectly accessed be means of "command/data in/data out" registers tuple. In order to have it also supported by the DW I2C driver, we must modify the code a bit. This is a main purpose of this patchset. First of all traditionally we replaced the legacy plain text-based dt-binding file with yaml-based one. Then we found and fixed a bug in the DW I2C FIFO size detection algorithm which tried to do it too early before dw_readl/dw_writel methods could be used. Finally we introduced a platform-specific flag ACCESS_INDIRECT, which would enable the indirect access to the DW I2C registers implemented for one of the Baikal-T1 SoC DW I2C controllers. See the commit message of the corresponding patch for details. This patchset is rebased and tested on the mainline Linux kernel 5.6-rc4: commit 98d54f81e36b ("Linux 5.6-rc4"). Signed-off-by: Serge Semin Signed-off-by: Alexey Malahov Cc: Maxim Kaurkin Cc: Pavel Parkhomenko Cc: Ramil Zaripov Cc: Ekaterina Skachko Cc: Vadim Vlasov Cc: Thomas Bogendoerfer Cc: Paul Burton Cc: Ralf Baechle Cc: Jarkko Nikula Cc: Andy Shevchenko Cc: Mika Westerberg Cc: Rob Herring Cc: Mark Rutland Cc: Wolfram Sang Cc: linux-i2c@vger.kernel.org Cc: devicetree@vger.kernel.org Cc: linux-kernel@vger.kernel.org Serge Semin (6): scripts/dtc: check: Add additional i2c reg flags support dt-bindings: i2c: Replace DW I2C legacy bindings with YAML-based one dt-bindings: i2c: dw: Add Baikal-T1 SoC I2C controller i2c: designware: Detect the FIFO size in the common code i2c: designware: Discard i2c_dw_read_comp_param() function i2c: designware: Add Baikal-T1 SoC I2C controller support .../bindings/i2c/i2c-designware.txt | 73 -------- .../bindings/i2c/snps,designware-i2c.yaml | 158 ++++++++++++++++++ drivers/i2c/busses/i2c-designware-common.c | 107 ++++++++++-- drivers/i2c/busses/i2c-designware-core.h | 16 +- drivers/i2c/busses/i2c-designware-master.c | 3 + drivers/i2c/busses/i2c-designware-platdrv.c | 25 +-- drivers/i2c/busses/i2c-designware-slave.c | 3 + scripts/dtc/checks.c | 13 +- 8 files changed, 280 insertions(+), 118 deletions(-) delete mode 100644 Documentation/devicetree/bindings/i2c/i2c-designware.txt create mode 100644 Documentation/devicetree/bindings/i2c/snps,designware-i2c.yaml -- 2.25.1