From patchwork Fri Nov 12 01:01:36 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jaewon Kim X-Patchwork-Id: 12692324 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 54B0BC433EF for ; Fri, 12 Nov 2021 01:08:03 +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 151B5610A5 for ; Fri, 12 Nov 2021 01:08:03 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 151B5610A5 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=samsung.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:References:MIME-Version:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=Vf5Tvn9M7quC+uALXipt3FTzLpIFSWuE94xB9DE3Saw=; b=TZepL2vQ+ujF88 qfZFZAC67ewYAt+t0ANPQ7f9DCD4C/IYAe8kJq+7t4OCXz3EFKjZTy2jR8qyOvZnF2Pzi2mNdVzrg 2wA8hpz3smL7e5kbn0DoYs97QjMLyupenECk2OusAPXOa6BJs5NXUxMnd7ZkX3SITzyko9DRMmIHh 1ORGiYNogeFHBzSwxAv4F7vcLvl8qWPP4i9CUbXVTrz9YJ7dCysRy4PL8DQYVQ1Nm5ScTWrNft7by y4eIgvD3iWUfXdvkPuo9/Dy7z19lvLO34rsNrUOUQscrowCTCC9sjQb3Ro8A6DJs7ZDknaFkkoD87 Qghr1GhrDQdIk/fd7vkw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mlL1j-0097sC-1T; Fri, 12 Nov 2021 01:06:47 +0000 Received: from mailout3.samsung.com ([203.254.224.33]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mlL1H-0097ju-C1 for linux-arm-kernel@lists.infradead.org; Fri, 12 Nov 2021 01:06:23 +0000 Received: from epcas2p2.samsung.com (unknown [182.195.41.54]) by mailout3.samsung.com (KnoxPortal) with ESMTP id 20211112010614epoutp038f8ddc38a3753fb796c14b77acc710b6~2pwmg6eKV0824008240epoutp039 for ; Fri, 12 Nov 2021 01:06:14 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout3.samsung.com 20211112010614epoutp038f8ddc38a3753fb796c14b77acc710b6~2pwmg6eKV0824008240epoutp039 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1636679174; bh=XT2BWSfKLYm4CaWRl3rGzWKNabqvzFUhjh/DD9Zdxi8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kl8pdQoyp7Qxm/tAt/rqD9JONXpy/F1GrBvH3uORRiP8uGL5Fnif7Oja1/364O9s4 xBzJaJklukrOSidWZs9sZyCvJEnx11HMVRgUNO2lCIYueP8sFCfBIcCW/sguqvrttv cBC99HMjNxZboe2JriHVmO1yKvKlTHlGceUwzmr4= Received: from epsnrtp3.localdomain (unknown [182.195.42.164]) by epcas2p1.samsung.com (KnoxPortal) with ESMTP id 20211112010613epcas2p120700b4e3247f0408566bb086943e11e~2pwmFhkLG3211832118epcas2p1L; Fri, 12 Nov 2021 01:06:13 +0000 (GMT) Received: from epsmges2p2.samsung.com (unknown [182.195.36.91]) by epsnrtp3.localdomain (Postfix) with ESMTP id 4Hr0lN3QnKz4x9QP; Fri, 12 Nov 2021 01:06:08 +0000 (GMT) Received: from epcas2p2.samsung.com ( [182.195.41.54]) by epsmges2p2.samsung.com (Symantec Messaging Gateway) with SMTP id 3A.60.10018.CFDBD816; Fri, 12 Nov 2021 10:06:04 +0900 (KST) Received: from epsmtrp2.samsung.com (unknown [182.195.40.14]) by epcas2p2.samsung.com (KnoxPortal) with ESMTPA id 20211112010603epcas2p26c076e65e0cb286cb53f06053165ef60~2pwcF68N-1493714937epcas2p2Y; Fri, 12 Nov 2021 01:06:03 +0000 (GMT) Received: from epsmgms1p1new.samsung.com (unknown [182.195.42.41]) by epsmtrp2.samsung.com (KnoxPortal) with ESMTP id 20211112010603epsmtrp2ece94b73b968b9885dc84d5b324701a7~2pwcE4m9U2332823328epsmtrp2V; Fri, 12 Nov 2021 01:06:03 +0000 (GMT) X-AuditID: b6c32a46-a0fff70000002722-35-618dbdfc816e Received: from epsmtip2.samsung.com ( [182.195.34.31]) by epsmgms1p1new.samsung.com (Symantec Messaging Gateway) with SMTP id 3E.6C.29871.BFDBD816; Fri, 12 Nov 2021 10:06:03 +0900 (KST) Received: from localhost.localdomain (unknown [10.229.9.51]) by epsmtip2.samsung.com (KnoxPortal) with ESMTPA id 20211112010603epsmtip2cf13b158e99a86f1d57c5f7043e27bb1~2pwb65RWg1607816078epsmtip2J; Fri, 12 Nov 2021 01:06:03 +0000 (GMT) From: Jaewon Kim To: Krzysztof Kozlowski , Wolfram Sang , Rob Herring Cc: linux-samsung-soc@vger.kernel.org, linux-i2c@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, chanho61.park@samsung.com, linux-arm-kernel@lists.infradead.org, Sam Protsenko , Jaewon Kim Subject: [PATCH v3 1/2] dt-bindings: i2c: exynos5: add exynosautov9-hsi2c compatible Date: Fri, 12 Nov 2021 10:01:36 +0900 Message-Id: <20211112010137.149174-2-jaewon02.kim@samsung.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20211112010137.149174-1-jaewon02.kim@samsung.com> MIME-Version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrCJsWRmVeSWpSXmKPExsWy7bCmme6fvb2JBkc2i1hc3q9tMf/IOVaL HQ1HWC02vv3BZLHp8TVWi46/XxgtLu+aw2Yx4/w+JovWvUfYLZ73AVl3989ldOD2mNXQy+ax aVUnm8eda3vYPDYvqffo27KK0ePzJrkAtqhsm4zUxJTUIoXUvOT8lMy8dFsl7+B453hTMwND XUNLC3MlhbzE3FRbJRefAF23zByg65QUyhJzSoFCAYnFxUr6djZF+aUlqQoZ+cUltkqpBSk5 BeYFesWJucWleel6eaklVoYGBkamQIUJ2RmNLQ0sBYd4KrYd3MPewDiTq4uRk0NCwERi0t5u 9i5GLg4hgR2MEkufrIJyPjFKbFvylw3C+cYo8fHob2aYlqM/N7JCJPYySjSd/sYM4XxklPi8 6jgjSBWbgLbE9/WLWUFsEYE6ie5drYwgRcwC05gkbk46wg6SEBYIkzi4aRYbiM0ioCoxZ+JS FhCbV8BOov/CDjaIdfISEyfcA6vnFLCX2Nq8hQmiRlDi5MwnYPXMQDXNW2eDXSEh0MohcWvJ MRaIZheJtctboe4Wlnh1fAs7hC0l8fndXqAFHEB2vcTXGw4QvT2MEmu6fjFB1NhL/Jq+hRWk hllAU2L9Ln2IcmWJI7eg1vJJdBz+yw4R5pXoaBOCaFSTuD/1HNT1MhKTjqyEGugh8WvpKSZI WE1ilJjwYTnTBEaFWUi+mYXkm1kIixcwMq9iFEstKM5NTy02KjCCR3Fyfu4mRnBy1XLbwTjl 7Qe9Q4xMHIyHGCU4mJVEeM8v7E0U4k1JrKxKLcqPLyrNSS0+xGgKDOuJzFKiyfnA9J5XEm9o YmlgYmZmaG5kamCuJM5rKZqdKCSQnliSmp2aWpBaBNPHxMEp1cC0WFSgsUprtbI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X3MSL65OVO2gv3nlaJTFuneFhm3Fd2Y 0jmmMQRwcFntmbGRY9axEiW3muzFbTWvc6SNny1iPKXye9lBT/uW0poTM5ja5hseashzeV2p +f3X9tC5ricuB6zJsdq7Ni3+qsMtKwlBjvxp9rI8uvGPb3jKPnnlc/Fw+yPzLdl35x3+N4eb 7+R/jzfFK95ZKqcHz7yaPFMrX8RnvoTYx9ln/wZOFH3Po3qtUXPLvGM6BzQU3nTVRV14f03R 2MdKiaU4I9FQi7moOBEAo8sbOfMCAAA= X-CMS-MailID: 20211112010603epcas2p26c076e65e0cb286cb53f06053165ef60 X-Msg-Generator: CA X-Sendblock-Type: AUTO_CONFIDENTIAL CMS-TYPE: 102P DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20211112010603epcas2p26c076e65e0cb286cb53f06053165ef60 References: <20211112010137.149174-1-jaewon02.kim@samsung.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211111_170619_838611_4902D1F2 X-CRM114-Status: GOOD ( 14.86 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org This patch adds new "samsung,exynosautov9-hsi2c" compatible. It is for i2c compatible with HSI2C available on Exynos SoC with USI. Signed-off-by: Jaewon Kim Reviewed-by: Krzysztof Kozlowski Reviewed-by: Sam Protsenko --- Documentation/devicetree/bindings/i2c/i2c-exynos5.txt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Documentation/devicetree/bindings/i2c/i2c-exynos5.txt b/Documentation/devicetree/bindings/i2c/i2c-exynos5.txt index 2dbc0b62daa6..39f4067d9d1f 100644 --- a/Documentation/devicetree/bindings/i2c/i2c-exynos5.txt +++ b/Documentation/devicetree/bindings/i2c/i2c-exynos5.txt @@ -14,6 +14,8 @@ Required properties: on Exynos5260 SoCs. -> "samsung,exynos7-hsi2c", for i2c compatible with HSI2C available on Exynos7 SoCs. + -> "samsung,exynosautov9-hsi2c", for i2c compatible with HSI2C available + on ExynosAutov9 SoCs. - reg: physical base address of the controller and length of memory mapped region. @@ -31,6 +33,11 @@ Optional properties: at 100khz. -> If specified, the bus operates in high-speed mode only if the clock-frequency is >= 1Mhz. + - samsung,sysreg : system registers controller phandle to control USI. + -> If I2C integrated to USI(Universal Serial Interface), this property + is required. When using Exynos USI block, it needs to select which type + of Serial IPs(UART, SPI, I2C) to use with system register. So, it + requires samsung,sysreg phandle and offset value of system register. Example: From patchwork Fri Nov 12 01:01:37 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jaewon Kim X-Patchwork-Id: 12692325 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4ECE1C433EF for ; Fri, 12 Nov 2021 01:08:23 +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 1747C610A5 for ; Fri, 12 Nov 2021 01:08:23 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 1747C610A5 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=samsung.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:References:MIME-Version:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=4UZw5x17e2pbq8qHlZW8pFpmNKi29RG6in7oMdN3EBs=; b=WQtcD1ic6Ko7nF uswL1pI70DIoBoeNFzpbuPi5c0uQEhiAJpoePo+XQhq8HQR9Nn4wea8y3qmpOXAMlwVaPCBpXsCtr aN+ipC+j2Rw+04d+WIK7jhbWeu9bFZ+zJel9Svo2+hjKi26F5VSQrW5mOADPEN92FoN1lxHgBaxSf 9MNgNQwA7qtArs2hfC4x8oczmQIRCvQI1g0ujuNWqbzsy9/zbax3n+OigATfLBi6Ll+FCRChclUbQ yDoN9Xkq12uqRrVcFIAJCUBqDTHg1S8gGKdL8RsGJlF/vhBtiX1XoTWkNG2gqThuhYQhCjCkbvTVc KK4fQ7dYlpexedf4uAAg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mlL1y-0097xw-Ew; Fri, 12 Nov 2021 01:07:02 +0000 Received: from mailout1.samsung.com ([203.254.224.24]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mlL1N-0097mM-C3 for linux-arm-kernel@lists.infradead.org; Fri, 12 Nov 2021 01:06:27 +0000 Received: from epcas2p2.samsung.com (unknown [182.195.41.54]) by mailout1.samsung.com (KnoxPortal) with ESMTP id 20211112010618epoutp0135525d925f725f2d6328d1bde3d0ee7b~2pwqayRlU0882608826epoutp01C for ; Fri, 12 Nov 2021 01:06:18 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.samsung.com 20211112010618epoutp0135525d925f725f2d6328d1bde3d0ee7b~2pwqayRlU0882608826epoutp01C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1636679178; bh=sMIpQvY0g2CWwnUxLVwcXn4g4440YdISvsNazNQY/gk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=VELMaKVjJigs16LfuCCLxD6cdjbqJInSUHarVt7cZx0hiYrGOyK/C+tiyehxYNjq5 GcnX6S1GetHDxflPYVov/NP6cBcW79FwwfVewLT762k7I6CBYcD00YqAvZHq1RX+8M hR7kfcPZwqtGpxoUS5tXoNJLEu3FBEDU/6drK2rg= Received: from epsnrtp1.localdomain (unknown [182.195.42.162]) by epcas2p4.samsung.com (KnoxPortal) with ESMTP id 20211112010618epcas2p4218f014a51c65a7ee935801277750754~2pwp4obp52822828228epcas2p4u; Fri, 12 Nov 2021 01:06:18 +0000 (GMT) Received: from epsmges2p3.samsung.com (unknown [182.195.36.88]) by epsnrtp1.localdomain (Postfix) with ESMTP id 4Hr0lQ28NXz4x9Q8; Fri, 12 Nov 2021 01:06:10 +0000 (GMT) Received: from epcas2p2.samsung.com ( [182.195.41.54]) by epsmges2p3.samsung.com (Symantec Messaging Gateway) with SMTP id 13.AF.10014.BFDBD816; Fri, 12 Nov 2021 10:06:03 +0900 (KST) Received: from epsmtrp2.samsung.com (unknown [182.195.40.14]) by epcas2p3.samsung.com (KnoxPortal) with ESMTPA id 20211112010603epcas2p339d1a6ef3df7cdbe61c87c8afa541fd0~2pwcP4-Ct0385403854epcas2p31; Fri, 12 Nov 2021 01:06:03 +0000 (GMT) Received: from epsmgms1p2.samsung.com (unknown [182.195.42.42]) by epsmtrp2.samsung.com (KnoxPortal) with ESMTP id 20211112010603epsmtrp227c72a234ce514d8976159d5a584bc52~2pwcPF1xg2332823328epsmtrp2W; Fri, 12 Nov 2021 01:06:03 +0000 (GMT) X-AuditID: b6c32a47-473ff7000000271e-0e-618dbdfb91c8 Received: from epsmtip2.samsung.com ( [182.195.34.31]) by epsmgms1p2.samsung.com (Symantec Messaging Gateway) with SMTP id 1D.B4.08738.BFDBD816; Fri, 12 Nov 2021 10:06:03 +0900 (KST) Received: from localhost.localdomain (unknown [10.229.9.51]) by epsmtip2.samsung.com (KnoxPortal) with ESMTPA id 20211112010603epsmtip2c7898062be1b3dbf4dfb10ddafc16bf4~2pwb_4gMg1614716147epsmtip29; Fri, 12 Nov 2021 01:06:03 +0000 (GMT) From: Jaewon Kim To: Krzysztof Kozlowski , Wolfram Sang , Rob Herring Cc: linux-samsung-soc@vger.kernel.org, linux-i2c@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, chanho61.park@samsung.com, linux-arm-kernel@lists.infradead.org, Sam Protsenko , Jaewon Kim Subject: [PATCH v3 2/2] i2c: exynos5: add support for ExynosAutov9 SoC Date: Fri, 12 Nov 2021 10:01:37 +0900 Message-Id: <20211112010137.149174-3-jaewon02.kim@samsung.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20211112010137.149174-1-jaewon02.kim@samsung.com> MIME-Version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrAJsWRmVeSWpSXmKPExsWy7bCmme7vvb2JBrtWmVpc3q9tMf/IOVaL HQ1HWC02vv3BZLHp8TVWi46/XxgtLu+aw2Yx4/w+JovWvUfYLZ73AVl3989ldOD2mNXQy+ax aVUnm8eda3vYPDYvqffo27KK0ePzJrkAtqhsm4zUxJTUIoXUvOT8lMy8dFsl7+B453hTMwND XUNLC3MlhbzE3FRbJRefAF23zByg65QUyhJzSoFCAYnFxUr6djZF+aUlqQoZ+cUltkqpBSk5 BeYFesWJucWleel6eaklVoYGBkamQIUJ2Rn//x9mKrhgV/H6QXgD4y/DLkZODgkBE4krk24x dzFycQgJ7GCUWLTvCyuE84lRYs+uWSwgVUICnxklrn9Kg+l49eckO0TRLkaJA/svs0IUfWSU eHJLFMRmE9CW+L5+MVhcRKBOontXKyNIA7PANCaJm5OOsIMkhAXcJN58OApkc3CwCKhK3Pqu CRLmFbCTuPBlBjPEMnmJiRPugZVzCthLbG3ewgRRIyhxcuYTsOOYgWqat84Ge0FCoJND4siu dlaIZheJ0x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jwZQYzxAZ5iYkT7rGD2JwC9hJbm7eAtQoB1fza/oUZol5Q4uTMJywgNjNQffPW2cwTGAVm IUnNQpJawMi0ilEytaA4Nz232LDAKC+1XK84Mbe4NC9dLzk/dxMjOAq0tHYw7ln1Qe8QIxMH 4yFGCQ5mJRHe8wt7E4V4UxIrq1KL8uOLSnNSiw8xSnOwKInzXug6GS8kkJ5YkpqdmlqQWgST ZeLglGpg8rufn5xZkm+htY3twzPdS3slmH+0b3ePXh7xdaK1xfU7hQkbJsRMFd/EcvZyQ1DF 543rBNtmCbzpdFyS06VwIFpQZYlpRtMt8WlJs/auVH0ephB25X8Q/8LnTxp9XNfe6poVqn0l MnuPYvIatsLweXpxnw5PPXhjwtt5E49tOLw9cadYl6QYC9eDtanZVlFLCku2zu7gXih/6G6N 7J+ilczPA25em1q892mLy9K/ndqOmnvKbBS3/SsoSvnsaijGsqyL1aLdhnnb9PpdN/NXCu7I kz0ftufJosMMJyQEzJJ4O2+KuMTukM4R/rNycVvc/mpDzoK3eRtrVRfnr22Qk2vtsnnzaefE i5/1dzVUKLEUZyQaajEXFScCAMFqGQPxAgAA X-CMS-MailID: 20211112010603epcas2p339d1a6ef3df7cdbe61c87c8afa541fd0 X-Msg-Generator: CA X-Sendblock-Type: AUTO_CONFIDENTIAL CMS-TYPE: 102P DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20211112010603epcas2p339d1a6ef3df7cdbe61c87c8afa541fd0 References: <20211112010137.149174-1-jaewon02.kim@samsung.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211111_170625_782004_E78715A0 X-CRM114-Status: GOOD ( 34.96 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Serial IPs(UART, I2C, SPI) are integrated into New IP-Core called USI(Universal Serial Interface). As it is integrated into USI, there are additinal HW changes. Registers to control USI and sysreg to set serial IPs have been added. Also, some timing registres have been changed. Signed-off-by: Jaewon Kim Reviewed-by: Krzysztof Kozlowski Reviewed-by: Sam Protsenko Tested-by: Sam Protsenko --- drivers/i2c/busses/i2c-exynos5.c | 135 ++++++++++++++++++++++++++++--- 1 file changed, 125 insertions(+), 10 deletions(-) diff --git a/drivers/i2c/busses/i2c-exynos5.c b/drivers/i2c/busses/i2c-exynos5.c index 97d4f3ac0abd..6ce94795a618 100644 --- a/drivers/i2c/busses/i2c-exynos5.c +++ b/drivers/i2c/busses/i2c-exynos5.c @@ -22,6 +22,8 @@ #include #include #include +#include +#include /* * HSI2C controller from Samsung supports 2 modes of operation @@ -166,9 +168,21 @@ #define EXYNOS5_I2C_TIMEOUT (msecs_to_jiffies(100)) +/* USI(Universal Serial Interface) Register map */ +#define USI_CON 0xc4 +#define USI_OPTION 0xc8 + +/* USI(Universal Serial Interface) Register bits */ +#define USI_CON_RESET BIT(0) + +/* SYSREG Register bit */ +#define SYSREG_USI_SW_CONF_MASK (0x7 << 0) +#define SYSREG_I2C_SW_CONF BIT(2) + enum i2c_type_exynos { I2C_TYPE_EXYNOS5, I2C_TYPE_EXYNOS7, + I2C_TYPE_EXYNOSAUTOV9, }; struct exynos5_i2c { @@ -199,6 +213,10 @@ struct exynos5_i2c { /* Version of HS-I2C Hardware */ const struct exynos_hsi2c_variant *variant; + + /* USI sysreg info */ + struct regmap *usi_sysreg; + unsigned int usi_offset; }; /** @@ -213,21 +231,31 @@ struct exynos5_i2c { struct exynos_hsi2c_variant { unsigned int fifo_depth; enum i2c_type_exynos hw; + bool has_usi; }; static const struct exynos_hsi2c_variant exynos5250_hsi2c_data = { .fifo_depth = 64, .hw = I2C_TYPE_EXYNOS5, + .has_usi = false, }; static const struct exynos_hsi2c_variant exynos5260_hsi2c_data = { .fifo_depth = 16, .hw = I2C_TYPE_EXYNOS5, + .has_usi = false, }; static const struct exynos_hsi2c_variant exynos7_hsi2c_data = { .fifo_depth = 16, .hw = I2C_TYPE_EXYNOS7, + .has_usi = false, +}; + +static const struct exynos_hsi2c_variant exynosautov9_hsi2c_data = { + .fifo_depth = 64, + .hw = I2C_TYPE_EXYNOSAUTOV9, + .has_usi = true, }; static const struct of_device_id exynos5_i2c_match[] = { @@ -243,6 +271,9 @@ static const struct of_device_id exynos5_i2c_match[] = { }, { .compatible = "samsung,exynos7-hsi2c", .data = &exynos7_hsi2c_data + }, { + .compatible = "samsung,exynosautov9-hsi2c", + .data = &exynosautov9_hsi2c_data }, {}, }; MODULE_DEVICE_TABLE(of, exynos5_i2c_match); @@ -281,6 +312,32 @@ static int exynos5_i2c_set_timing(struct exynos5_i2c *i2c, bool hs_timings) i2c->op_clock; int div, clk_cycle, temp; + /* + * In case of HSI2C controllers in EXYNOSAUTOV9 + * timing control formula changed. + * + * FSCL = IPCLK / ((CLK_DIV + 1) * 16) + * T_SCL_LOW = IPCLK * (CLK_DIV + 1) * (N + M) + * [N : number of 0's in the TSCL_H_HS] + * [M : number of 0's in the TSCL_L_HS] + * T_SCL_HIGH = IPCLK * (CLK_DIV + 1) * (N + M) + * [N : number of 1's in the TSCL_H_HS] + * [M : number of 1's in the TSCL_L_HS] + * + * result of (N + M) is always 8. + * In general use case, we don't need to control timing_s1, timing_s2. + */ + if (i2c->variant->hw == I2C_TYPE_EXYNOSAUTOV9) { + div = ((clkin / (16 * i2c->op_clock)) - 1); + i2c_timing_s3 = div << 16; + if (hs_timings) + writel(i2c_timing_s3, i2c->regs + HSI2C_TIMING_HS3); + else + writel(i2c_timing_s3, i2c->regs + HSI2C_TIMING_FS3); + + return 0; + } + /* * In case of HSI2C controller in Exynos5 series * FPCLK / FI2C = @@ -355,6 +412,20 @@ static int exynos5_hsi2c_clock_setup(struct exynos5_i2c *i2c) return exynos5_i2c_set_timing(i2c, true); } +static void exynos_usi_reset(struct exynos5_i2c *i2c) +{ + u32 val; + + val = readl(i2c->regs + USI_CON); + val |= USI_CON_RESET; + writel(val, i2c->regs + USI_CON); + udelay(1); + + val = readl(i2c->regs + USI_CON); + val &= ~USI_CON_RESET; + writel(val, i2c->regs + USI_CON); +} + /* * exynos5_i2c_init: configures the controller for I2C functionality * Programs I2C controller for Master mode operation @@ -385,6 +456,9 @@ static void exynos5_i2c_reset(struct exynos5_i2c *i2c) { u32 i2c_ctl; + if (i2c->variant->hw == I2C_TYPE_EXYNOSAUTOV9) + exynos_usi_reset(i2c); + /* Set and clear the bit for reset */ i2c_ctl = readl(i2c->regs + HSI2C_CTL); i2c_ctl |= HSI2C_SW_RST; @@ -422,7 +496,8 @@ static irqreturn_t exynos5_i2c_irq(int irqno, void *dev_id) writel(int_status, i2c->regs + HSI2C_INT_STATUS); /* handle interrupt related to the transfer status */ - if (i2c->variant->hw == I2C_TYPE_EXYNOS7) { + if (i2c->variant->hw == I2C_TYPE_EXYNOS7 || + i2c->variant->hw == I2C_TYPE_EXYNOSAUTOV9) { if (int_status & HSI2C_INT_TRANS_DONE) { i2c->trans_done = 1; i2c->state = 0; @@ -569,13 +644,13 @@ static void exynos5_i2c_bus_check(struct exynos5_i2c *i2c) { unsigned long timeout; - if (i2c->variant->hw != I2C_TYPE_EXYNOS7) + if (i2c->variant->hw == I2C_TYPE_EXYNOS5) return; /* - * HSI2C_MASTER_ST_LOSE state in EXYNOS7 variant before transaction - * indicates that bus is stuck (SDA is low). In such case bus recovery - * can be performed. + * HSI2C_MASTER_ST_LOSE state in EXYNOS7 or EXYNOSAUTOV9 variant before + * transaction indicates that bus is stuck (SDA is low). + * In such case bus recovery can be performed. */ timeout = jiffies + msecs_to_jiffies(100); for (;;) { @@ -611,10 +686,10 @@ static void exynos5_i2c_message_start(struct exynos5_i2c *i2c, int stop) unsigned long flags; unsigned short trig_lvl; - if (i2c->variant->hw == I2C_TYPE_EXYNOS7) - int_en |= HSI2C_INT_I2C_TRANS; - else + if (i2c->variant->hw == I2C_TYPE_EXYNOS5) int_en |= HSI2C_INT_I2C; + else + int_en |= HSI2C_INT_I2C_TRANS; i2c_ctl = readl(i2c->regs + HSI2C_CTL); i2c_ctl &= ~(HSI2C_TXCHON | HSI2C_RXCHON); @@ -738,6 +813,42 @@ static const struct i2c_algorithm exynos5_i2c_algorithm = { .functionality = exynos5_i2c_func, }; +static int exynos_usi_init(struct exynos5_i2c *i2c) +{ + struct device *dev = i2c->dev; + int ret; + + if (!i2c->variant->has_usi) + return 0; + + /* + * System Register has a field that can select the serial IP + * provided by USI. We need to set it to I2C to use I2C. + */ + i2c->usi_sysreg = syscon_regmap_lookup_by_phandle(dev->of_node, + "samsung,sysreg"); + if (IS_ERR(i2c->usi_sysreg)) { + dev_err(dev, "Cannot find sysreg\n"); + return PTR_ERR(i2c->usi_sysreg); + } + + ret = of_property_read_u32_index(dev->of_node, "samsung,sysreg", + 1, &i2c->usi_offset); + if (ret) { + dev_err(dev, "sysreg offset is not specified\n"); + return ret; + } + + ret = regmap_update_bits(i2c->usi_sysreg, i2c->usi_offset, + SYSREG_USI_SW_CONF_MASK, SYSREG_I2C_SW_CONF); + if (ret < 0) + return ret; + + exynos_usi_reset(i2c); + + return 0; +} + static int exynos5_i2c_probe(struct platform_device *pdev) { struct device_node *np = pdev->dev.of_node; @@ -777,6 +888,12 @@ static int exynos5_i2c_probe(struct platform_device *pdev) i2c->adap.algo_data = i2c; i2c->adap.dev.parent = &pdev->dev; + i2c->variant = of_device_get_match_data(&pdev->dev); + + ret = exynos_usi_init(i2c); + if (ret) + return ret; + /* Clear pending interrupts from u-boot or misc causes */ exynos5_i2c_clr_pend_irq(i2c); @@ -794,8 +911,6 @@ static int exynos5_i2c_probe(struct platform_device *pdev) goto err_clk; } - i2c->variant = of_device_get_match_data(&pdev->dev); - ret = exynos5_hsi2c_clock_setup(i2c); if (ret) goto err_clk;