Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp518135ybv; Sat, 22 Feb 2020 08:25:41 -0800 (PST) X-Google-Smtp-Source: APXvYqzQmLj73cBEPuvI/w16SIAUlgvV9rEA0rQMKlpBzYHl4yW7dCRvchc6JEtLfyCp6RGKI+mD X-Received: by 2002:aca:5582:: with SMTP id j124mr6480360oib.20.1582388741222; Sat, 22 Feb 2020 08:25:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582388741; cv=none; d=google.com; s=arc-20160816; b=BxU5rca878j1HPCkH6huZzOvjgTAj2Cs0RKoKtwrWN92gVicqQicXYtbLw9IRQBFiJ jJv/CZlAVmUzchgubyMB4iu0ka3pZmBmiJIazLQbMH8LOUB9HWgk5vLZANqf9l0cx3X2 XUPrwSjyRB8KObr265LSsMaIsXqZ8Gbdw/8/ENdpmDAiNocoadTVZ+zNoEGtoywYUcLu zkIRyOtamTmLhsAh2xCDal/XlUYvi23WdV74Agl9bVoyYpEyD0g7y30iceTm0cJAVkBx 3ng0eufUq6v04etP05of3i6iww8OhwIkWSRe1G7a1PPuqNLKZjtEA8CHPCZ8dUz5kifW uNKg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=ToHubF4KECCMrwSTfQauUnB07RA2vKU+QmGUx0zj7dk=; b=VDeagzcW5rVbv29O7BUMjoEwbxvDr6qa0aSO7flcnDr7EzG+x98x9f6J+MuDdBQUHs zRFgb4ILq24JrmQN3mC7xDyjG+EvLyqLKB4Pmn5BovAYDgr6hIrJoCIMQ0JT/Bc7h+zF vjtUGo8qSI0geQRl6QGC4/u66Hp3Imjmu6QNt87ADR+U/EX1/Z4k9zu6FDMKuav8IGI5 zu+cJDZru/aH2Dho1HcRS8eLk59Ikav8J/S7Hg8VMm0+eBrT3t8GhCg3k6nwaEGJ3k/p LuhOtdCqeubrm7xBRYRH3kIQyuYBnF+S61cZaU8dS9qAhfo6O/OJcqYCztI1UWUaZwIH LKkQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=DCeJQWqM; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r1si3333425ota.259.2020.02.22.08.25.29; Sat, 22 Feb 2020 08:25:41 -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; dkim=pass header.i=@linaro.org header.s=google header.b=DCeJQWqM; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727854AbgBVQZP (ORCPT + 99 others); Sat, 22 Feb 2020 11:25:15 -0500 Received: from mail-pf1-f194.google.com ([209.85.210.194]:43064 "EHLO mail-pf1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727206AbgBVQZO (ORCPT ); Sat, 22 Feb 2020 11:25:14 -0500 Received: by mail-pf1-f194.google.com with SMTP id s1so2941599pfh.10 for ; Sat, 22 Feb 2020 08:25:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=ToHubF4KECCMrwSTfQauUnB07RA2vKU+QmGUx0zj7dk=; b=DCeJQWqMYEktzqwzYPWXrCtBjxlTN8VoLK6rTnVSJ+DyThaYmZG4zMy3J0uAcv5Xl6 NTFZV5I50yPOniS5gf0xWJH2PZ+CmoCgCyT0RGbxaOHZBpXWkLCoD58p/vpgq9wR7s6r vJwrEd4Qdlr+awqgO1zD6srjSxbvwRSNN/oYR4kEz8evxlBLsVi5CeOULy/e5DkSgF/b 1wrr6XV6qrvNLX4R699w4FgeGpTYIIqQoIEH34dlqPzw2pbaP9tiidjLStIO1d5eAO3d KUlN4/nws3fNhI+lLEsiGP+3hu+n5gtOQgjkxmo4yB6uOAVRNUDoMnlaqrhHzsLUZXSk QVkQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=ToHubF4KECCMrwSTfQauUnB07RA2vKU+QmGUx0zj7dk=; b=EY0/XqLlzQ5O8WoN1nfyRKDzx+Ek7TtVLAO8hqQ+HigZHbRDTgj8vYYc/R0mo+/v2/ zPSBze3/W3OYMNCv+e0D2r8va2AbShIH7V41T8OEQ1rLNWROOwWfr5qkg0lfH53f+eT0 oL+LlLB6YdgT1QuXOtnwbPjGpUdkVdISPSiMV0Oe9/wWc6SyJ+vFHBLi7C2qCvvzl1Mk x85ahM5MizvKbgcEKRwTPziKgLcStYyHHqjk3gU4co66zirfBuigcTGJY5jWnQG0L//3 UoBn6Hq7VI2MJJw5uhEQESvuq9S+cewt1thHRZs6D07nyccRv7Zw5tu4nt34HbxWxKSx PUcg== X-Gm-Message-State: APjAAAUYX1TTm2UFOgB/5A7HrK+z5I2Kyvr4fK8VAwfRcUWqgSGhfwsM Pt182M8C3RDR3PXTHm56+J0p X-Received: by 2002:a63:120f:: with SMTP id h15mr45746851pgl.235.1582388712857; Sat, 22 Feb 2020 08:25:12 -0800 (PST) Received: from localhost.localdomain ([2409:4072:801:b38c:89e8:305c:23c4:b77f]) by smtp.gmail.com with ESMTPSA id q17sm6851296pfg.123.2020.02.22.08.25.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 22 Feb 2020 08:25:12 -0800 (PST) From: Manivannan Sadhasivam To: matthias.bgg@gmail.com, robh+dt@kernel.org Cc: devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org, adamboardman@gmail.com, Manivannan Sadhasivam Subject: [PATCH 2/4] arm64: dts: mediatek: Add I2C support for MT6797 SoC Date: Sat, 22 Feb 2020 21:54:42 +0530 Message-Id: <20200222162444.11590-3-manivannan.sadhasivam@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200222162444.11590-1-manivannan.sadhasivam@linaro.org> References: <20200222162444.11590-1-manivannan.sadhasivam@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add I2C support for Mediatek MT6797 SoC. There are a total of 8 I2C controllers in this SoC (2 being shared) and they are same as the controllers present in MT6577 SoC. Hence, the driver support is added with DT fallback method. As per the datasheet, there are controllers with _imm prefix like i2c2_imm and i2c3_imm. These appears to be in different memory regions but sharing the same pins with i2c2 and i2c3 respectively. Since there is no clear evidence of what they really are, I've adapted the numbering/naming scheme from the downstream code by Mediatek. Signed-off-by: Manivannan Sadhasivam --- arch/arm64/boot/dts/mediatek/mt6797.dtsi | 220 +++++++++++++++++++++++ 1 file changed, 220 insertions(+) diff --git a/arch/arm64/boot/dts/mediatek/mt6797.dtsi b/arch/arm64/boot/dts/mediatek/mt6797.dtsi index 2b2a69c7567f..22f093960d27 100644 --- a/arch/arm64/boot/dts/mediatek/mt6797.dtsi +++ b/arch/arm64/boot/dts/mediatek/mt6797.dtsi @@ -155,6 +155,62 @@ ; }; }; + + i2c0_pins_a: i2c0 { + pins0 { + pinmux = , + ; + }; + }; + + i2c1_pins_a: i2c1 { + pins1 { + pinmux = , + ; + }; + }; + + i2c2_pins_a: i2c2 { + pins2 { + pinmux = , + ; + }; + }; + + i2c3_pins_a: i2c3 { + pins3 { + pinmux = , + ; + }; + }; + + i2c4_pins_a: i2c4 { + pins4 { + pinmux = , + ; + }; + }; + + i2c5_pins_a: i2c5 { + pins5 { + pinmux = , + ; + }; + }; + + i2c6_pins_a: i2c6 { + pins6 { + pinmux = , + ; + }; + }; + + i2c7_pins_a: i2c7 { + pins7 { + pinmux = , + ; + }; + }; }; scpsys: scpsys@10006000 { @@ -233,6 +289,170 @@ status = "disabled"; }; + i2c0: i2c@11007000 { + compatible = "mediatek,mt6797-i2c", + "mediatek,mt6577-i2c"; + id = <0>; + reg = <0 0x11007000 0 0x1000>, + <0 0x11000100 0 0x80>; + interrupts = ; + clocks = <&infrasys CLK_INFRA_I2C0>, + <&infrasys CLK_INFRA_AP_DMA>; + clock-names = "main", "dma"; + clock-div = <10>; + #address-cells = <1>; + #size-cells = <0>; + status = "disabled"; + }; + + i2c1: i2c@11008000 { + compatible = "mediatek,mt6797-i2c", + "mediatek,mt6577-i2c"; + id = <1>; + reg = <0 0x11008000 0 0x1000>, + <0 0x11000180 0 0x80>; + interrupts = ; + clocks = <&infrasys CLK_INFRA_I2C1>, + <&infrasys CLK_INFRA_AP_DMA>; + clock-names = "main", "dma"; + clock-div = <10>; + #address-cells = <1>; + #size-cells = <0>; + status = "disabled"; + }; + + i2c8: i2c@11009000 { + compatible = "mediatek,mt6797-i2c", + "mediatek,mt6577-i2c"; + id = <8>; + reg = <0 0x11009000 0 0x1000>, + <0 0x11000200 0 0x80>; + interrupts = ; + clocks = <&infrasys CLK_INFRA_I2C2>, + <&infrasys CLK_INFRA_AP_DMA>, + <&infrasys CLK_INFRA_I2C2_ARB>; + clock-names = "main", "dma", "arb"; + clock-div = <10>; + #address-cells = <1>; + #size-cells = <0>; + status = "disabled"; + }; + + i2c9: i2c@1100d000 { + compatible = "mediatek,mt6797-i2c", + "mediatek,mt6577-i2c"; + id = <9>; + reg = <0 0x1100d000 0 0x1000>, + <0 0x11000280 0 0x80>; + interrupts = ; + clocks = <&infrasys CLK_INFRA_I2C3>, + <&infrasys CLK_INFRA_AP_DMA>, + <&infrasys CLK_INFRA_I2C3_ARB>; + clock-names = "main", "dma", "arb"; + clock-div = <10>; + #address-cells = <1>; + #size-cells = <0>; + status = "disabled"; + }; + + i2c6: i2c@1100e000 { + compatible = "mediatek,mt6797-i2c", + "mediatek,mt6577-i2c"; + id = <6>; + reg = <0 0x1100e000 0 0x1000>, + <0 0x11000500 0 0x80>; + interrupts = ; + clocks = <&infrasys CLK_INFRA_I2C_APPM>, + <&infrasys CLK_INFRA_AP_DMA>; + clock-names = "main", "dma"; + clock-div = <10>; + #address-cells = <1>; + #size-cells = <0>; + status = "disabled"; + }; + + i2c7: i2c@11010000 { + compatible = "mediatek,mt6797-i2c", + "mediatek,mt6577-i2c"; + id = <7>; + reg = <0 0x11010000 0 0x1000>, + <0 0x11000580 0 0x80>; + interrupts = ; + clocks = <&infrasys CLK_INFRA_I2C_GPUPM>, + <&infrasys CLK_INFRA_AP_DMA>; + clock-names = "main", "dma"; + clock-div = <10>; + #address-cells = <1>; + #size-cells = <0>; + status = "disabled"; + }; + + i2c4: i2c@11011000 { + compatible = "mediatek,mt6797-i2c", + "mediatek,mt6577-i2c"; + id = <4>; + reg = <0 0x11011000 0 0x1000>, + <0 0x11000300 0 0x80>; + interrupts = ; + clocks = <&infrasys CLK_INFRA_I2C4>, + <&infrasys CLK_INFRA_AP_DMA>; + clock-names = "main", "dma"; + clock-div = <10>; + #address-cells = <1>; + #size-cells = <0>; + status = "disabled"; + }; + + i2c2: i2c@11013000 { + compatible = "mediatek,mt6797-i2c", + "mediatek,mt6577-i2c"; + id = <2>; + reg = <0 0x11013000 0 0x1000>, + <0 0x11000400 0 0x80>; + interrupts = ; + clocks = <&infrasys CLK_INFRA_I2C2_IMM>, + <&infrasys CLK_INFRA_AP_DMA>, + <&infrasys CLK_INFRA_I2C2_ARB>; + clock-names = "main", "dma", "arb"; + clock-div = <10>; + #address-cells = <1>; + #size-cells = <0>; + status = "disabled"; + }; + + i2c3: i2c@11014000 { + compatible = "mediatek,mt6797-i2c", + "mediatek,mt6577-i2c"; + id = <3>; + reg = <0 0x11014000 0 0x1000>, + <0 0x11000480 0 0x80>; + interrupts = ; + clocks = <&infrasys CLK_INFRA_I2C3_IMM>, + <&infrasys CLK_INFRA_AP_DMA>, + <&infrasys CLK_INFRA_I2C3_ARB>; + clock-names = "main", "dma", "arb"; + clock-div = <10>; + #address-cells = <1>; + #size-cells = <0>; + status = "disabled"; + }; + + i2c5: i2c@1101c000 { + compatible = "mediatek,mt6797-i2c", + "mediatek,mt6577-i2c"; + id = <5>; + reg = <0 0x1101c000 0 0x1000>, + <0 0x11000380 0 0x80>; + interrupts = ; + clocks = <&infrasys CLK_INFRA_I2C5>, + <&infrasys CLK_INFRA_AP_DMA>; + clock-names = "main", "dma"; + clock-div = <10>; + #address-cells = <1>; + #size-cells = <0>; + status = "disabled"; + }; + mmsys: mmsys_config@14000000 { compatible = "mediatek,mt6797-mmsys", "syscon"; reg = <0 0x14000000 0 0x1000>; -- 2.17.1