From patchwork Mon Feb 4 09:10:02 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Pankaj Bansal X-Patchwork-Id: 10795199 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 44A5613B5 for ; Mon, 4 Feb 2019 09:10:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 353B92ABF2 for ; Mon, 4 Feb 2019 09:10:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 330112AD0E; Mon, 4 Feb 2019 09:10:28 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id C27682ABF2 for ; Mon, 4 Feb 2019 09:10:27 +0000 (UTC) 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:Content-ID:In-Reply-To: References:Message-ID:Date:Subject:To:From:Reply-To:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=5nk6Wip1IKJAJp9X1Xqqquzxx+YJLgDx983HAxlQDVw=; b=jEchfvk8+QPcEA Mt/oy46OulEvJ6LPS2s082qKdhZ6AiiIOeNh6schy0fQCBKFELE54wDnyGOLW5ccN91etKdtkxkM3 fnCSFnbgniNRE9fbCE3EGKueYS9NUzKc5DSIWO7cMWjEdG8OLr0t0Y5rGTr39Lnrlx/kmknj6x2MF DFb5f+OdkMZ6DWPrdJxzddnHMhFY84G6BDRJeIX6ZLSZ0PY6vu/UPYvlX51AZ1NFHiwqpL1GA35f+ 2DhtGeu8L3k9as1AynLGs+xk+SvFGGgnANMl7BgXUl3A8iOB2Rsz1QxDgZY3EBS7J8sVIza0tvBof lzSCduoVHiQBnqFKzhng==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gqaGl-0005JC-7l; Mon, 04 Feb 2019 09:10:23 +0000 Received: from mail-eopbgr150050.outbound.protection.outlook.com ([40.107.15.50] helo=EUR01-DB5-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gqaGV-00040E-Oq for linux-arm-kernel@lists.infradead.org; Mon, 04 Feb 2019 09:10:09 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=+xCn1TuqJK3ooi3+YgZ3ERaV+/AgrR/a1YnHqRGvXZs=; b=VzYAvzzvJvs4g7R6dMFD+eHpuypPwIwpOAwvNxTtycJls/c4pjQQBVX2eA4JrJo3kDqmLGmsB5pS0pLHhb0IDnApkj9o6C+OMubWPxFAuMWvgboGLT0Dgu4riR1q80oDmdQKmfwLMgAmyCV0FhaBcnNLMEBG7ReNrzx2wIV8DNM= Received: from VI1PR0401MB2496.eurprd04.prod.outlook.com (10.168.65.10) by VI1PR0401MB2640.eurprd04.prod.outlook.com (10.168.66.12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1580.17; Mon, 4 Feb 2019 09:10:02 +0000 Received: from VI1PR0401MB2496.eurprd04.prod.outlook.com ([fe80::208f:755e:b057:2cfe]) by VI1PR0401MB2496.eurprd04.prod.outlook.com ([fe80::208f:755e:b057:2cfe%8]) with mapi id 15.20.1580.019; Mon, 4 Feb 2019 09:10:02 +0000 From: Pankaj Bansal To: Leo Li Subject: [PATCH v3 1/2] dt-bindings: soc: fsl: Document Qixis FPGA usage Thread-Topic: [PATCH v3 1/2] dt-bindings: soc: fsl: Document Qixis FPGA usage Thread-Index: AQHUvGlp8uj3aRTwvE2rsi77vi3Hgg== Date: Mon, 4 Feb 2019 09:10:02 +0000 Message-ID: <20190204143449.25040-2-pankaj.bansal@nxp.com> References: <20190204143449.25040-1-pankaj.bansal@nxp.com> In-Reply-To: <20190204143449.25040-1-pankaj.bansal@nxp.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: BMXPR01CA0037.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00:c::23) To VI1PR0401MB2496.eurprd04.prod.outlook.com (2603:10a6:800:56::10) authentication-results: spf=none (sender IP is ) smtp.mailfrom=pankaj.bansal@nxp.com; x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.17.1 x-originating-ip: [92.120.1.69] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; VI1PR0401MB2640; 6:PxTxXbObeFy6uLRI2/mIF2m4jP1oKzmiY2O7h25six5uNCGuI6LfZ6z6HQmko3OloMh1cn9A4+AGp1ZHuyNOEqTQ7p8ai/KGLqBsW9KE6oYTKD2Z5K5XLAf83R8+UZFkx34RnA5r3dsZVubIh3eeIwhLG7OSrcIuCEN8rc/4HZ0EnrRQxdE4se3ttydtxkfP8k+isZ1QGm9M3qDSKshTCaGH6klqizFKW6T8SzjszKp/9wQRaKBA7yv3faXWQm5lmPvJRIyOJfH0PEPkuJBDEw+zemydcWfB2a8pr850fyyQ8rdTb9tbHikelWabARky4aCgEGk68Jn/dDkhe8dTcZS0AnmSYyfV4aTlmSDIWenoXWLqDbHZbp645N/YoK6gOgz/veCoIDAS3jhzpDgCKUjLW2dpJ9roNFOrTCgPswX6xbAzTTGbGXQb2QO4r4dLXn8Y3Pu3Qnb/EKM0ZBcJiA==; 5:InPSz1n5evyYfaZIVvd5F8ucMjBxkxzqd/zWa2zD/UcftljPh67dIC2vq/ONiUhRBSRqGgmIMJkyzdZEgWk3W4jJhY2LGRFCwix1+we9F7eNbhOoSyNEzLqs4OE2YcHnkKKrODUH0wdu87e354OiZ9u6P8EzhnDDODktLhQWZBEjLJVnK3r2vaLMun5Qdx3LggmP969V7oQDGlYvVf8+Ow==; 7:bCxK+ImMj72ySGrmdEhM58JFpRPC7l1dGOduzoxsV7qok0V5LGdnHE6ibp98K9gQ+mE40IZJ32n2Kni09U3P0H6SdYb8t0syXYX5M7zKIopxkArOkikPVbiCMvJgSji5Q+Q8Ba+nbtRFujzyPCjq6Q== x-ms-office365-filtering-correlation-id: 9249f6c5-8052-4a4e-a064-08d68a808b8a x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600110)(711020)(4605077)(4618075)(2017052603328)(7153060)(7193020); SRVR:VI1PR0401MB2640; x-ms-traffictypediagnostic: VI1PR0401MB2640: x-microsoft-antispam-prvs: x-forefront-prvs: 0938781D02 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(376002)(136003)(396003)(366004)(39860400002)(346002)(189003)(199004)(66066001)(37006003)(316002)(6636002)(36756003)(99286004)(2906002)(54906003)(6512007)(53936002)(478600001)(14454004)(76176011)(256004)(52116002)(6486002)(6436002)(7736002)(6506007)(386003)(102836004)(186003)(26005)(68736007)(105586002)(97736004)(106356001)(305945005)(3846002)(6116002)(486006)(8936002)(44832011)(50226002)(11346002)(446003)(81166006)(81156014)(8676002)(476003)(2616005)(86362001)(6862004)(1076003)(25786009)(71200400001)(71190400001)(4326008); DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR0401MB2640; H:VI1PR0401MB2496.eurprd04.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: eFYoPeRKfZbjrm4ExEeemSB04C3bNvs0mbzif7aO7jdKIe3b/U9s+NffLNtrs0r+jFY6NS6LHQOarn6udNgPGSg0eBWVe3Bi0LmVxej+EN2sEWL5zm7IHfwXY8pMbXLZY7QkbGRNlQ/5fu8OagScb5iAukqAbuYaNc3xdfdx3nstrehfPm1dlpawNuaClMB9WDMhJ1nHxZ3OKvrfn5COD9kXOUl9WGagL5pgItLRlyKJNx2JDMYpbL2uyIV3KzyughDe3xBIlmlDUvMuxpp+IpUbfpjm493NGT+8IKkWlpxKysE28zdZmufdguAgVXhowy5f12e97Dm4Mai8cE6KulOTuvPuENBAkQ7aG6hJXKJRzCcXHksIrudAPFTvJUTquzbJDt2oTd6i3qcA21B6fwt4Kci/TFbiMwk5NfI7Vsc= Content-ID: MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9249f6c5-8052-4a4e-a064-08d68a808b8a X-MS-Exchange-CrossTenant-originalarrivaltime: 04 Feb 2019 09:10:01.1600 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0401MB2640 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190204_011007_813708_AA31B144 X-CRM114-Status: GOOD ( 13.40 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Pankaj Bansal , "linuxppc-dev@lists.ozlabs.org" , "linux-arm-kernel@lists.infradead.org" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP an FPGA-based system controller, called “Qixis”, which manages several critical system features, including: • Reset sequencing • Power supply configuration • Board configuration • hardware configuration The qixis registers are accessible over one or more system-specific interfaces, typically I2C, JTAG or an embedded processor. Signed-off-by: Pankaj Bansal --- Notes: V3: - Added boardname based compatible field in bindings - Added bindings for MMIO based FPGA V2: - No change .../bindings/soc/fsl/qixis_ctrl.txt | 53 ++++++++++++++++++ 1 file changed, 53 insertions(+) diff --git a/Documentation/devicetree/bindings/soc/fsl/qixis_ctrl.txt b/Documentation/devicetree/bindings/soc/fsl/qixis_ctrl.txt new file mode 100644 index 000000000000..5d510df14be8 --- /dev/null +++ b/Documentation/devicetree/bindings/soc/fsl/qixis_ctrl.txt @@ -0,0 +1,53 @@ +* QIXIS FPGA block + +an FPGA-based system controller, called “Qixis”, which +manages several critical system features, including: +• Configuration switch monitoring +• Power on/off sequencing +• Reset sequencing +• Power supply configuration +• Board configuration +• hardware configuration +• Background power data collection (DCM) +• Fault monitoring +• RCW bypass SRAM (replace flash RCW with internal RCW) (NOR only) +• Dedicated functional validation blocks (POSt/IRS, triggered event, and so on) +• I2C master for remote board control even with no DUT available + +The qixis registers are accessible over one or more system-specific interfaces, +typically I2C, JTAG or an embedded processor. + +FPGA connected to I2C: +Required properties: + + - compatible: should be a board-specific string followed by a string + indicating the type of FPGA. Example: + "fsl,-fpga", "fsl,fpga-qixis-i2c" + - reg : i2c address of the qixis device. + +Example (LX2160A-QDS): + /* The FPGA node */ + fpga@66 { + compatible = "fsl,lx2160aqds-fpga", "fsl,fpga-qixis-i2c"; + reg = <0x66>; + #address-cells = <1>; + #size-cells = <0>; + } + +* Freescale on-board FPGA + +This is the memory-mapped registers for on board FPGA. + +Required properties: +- compatible: should be a board-specific string followed by a string + indicating the type of FPGA. Example: + "fsl,-fpga", "fsl,fpga-qixis" +- reg: should contain the address and the length of the FPGA register set. + +Example (LS2080A-RDB): + + cpld@3,0 { + compatible = "fsl,ls2080ardb-fpga", "fsl,fpga-qixis"; + reg = <0x3 0 0x10000>; + }; + From patchwork Mon Feb 4 09:10:04 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pankaj Bansal X-Patchwork-Id: 10795201 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 1275C13B5 for ; Mon, 4 Feb 2019 09:10:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0131C2AAB5 for ; Mon, 4 Feb 2019 09:10:43 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F383E2AD6E; Mon, 4 Feb 2019 09:10:42 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 475802AAB5 for ; Mon, 4 Feb 2019 09:10:42 +0000 (UTC) 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:In-Reply-To:References: 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: List-Owner; bh=Fpk+MMLiyHOFQbfC1Uea8Yy7DDifwuACAIugQtJ9lvk=; b=UiCfYHCq34xYXT APBXCjvIz74D+lDLZ+qytNtdcs7chCXQ3cMm1ltPbnabMJFL60ulKJCf+uE6qQfsNvQ4AcxKEScgY BdErdmLXP2SGqsDnnlsf/6LtZup48pp/PxXa3zzdwVbNAcpEaPD9m70XC0efNd/UyEXMtoJZBqZmu pI1allWy13SOLBjtnmSPJ9EML/kE+9Ro260QeTOHD5T8e0r6DbVeWK6SYCu7rKJlp6cXjKBEoV3F7 FarqWL+a3WFl9XDOw7JpQdq23LILtD9mSXcL/TkZKrzIuqqD0rCj8DwVh0U18MhfK2AUuYbQpgndO PZzgLNuob3pVgu5ilv3w==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gqaH0-0005cL-Qi; Mon, 04 Feb 2019 09:10:38 +0000 Received: from mail-eopbgr00061.outbound.protection.outlook.com ([40.107.0.61] helo=EUR02-AM5-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gqaGV-0004NR-SG for linux-arm-kernel@lists.infradead.org; Mon, 04 Feb 2019 09:10:09 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=zQlrlWaQuEhOTis0NBAUjBQuKzyqCo+n/zGPGbJESAM=; b=M6+vIV4EGa4h9BMykC/q1GP8C/X7u/COKeT9zN6SeM5VQ8SfF5h6bepS3EqkIxZhWhpbHUzae/pzEa4vQorRSqyYK1frABT5mFWqr7b6Ck1v4VA2O/Om/cFTmksHbOMINxq0yIZRL+YJuyOfh/yKQ50NgEyOXxJK4KyalWZn5TY= Received: from VI1PR0401MB2496.eurprd04.prod.outlook.com (10.168.65.10) by VI1PR0401MB2448.eurprd04.prod.outlook.com (10.168.64.143) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1580.22; Mon, 4 Feb 2019 09:10:04 +0000 Received: from VI1PR0401MB2496.eurprd04.prod.outlook.com ([fe80::208f:755e:b057:2cfe]) by VI1PR0401MB2496.eurprd04.prod.outlook.com ([fe80::208f:755e:b057:2cfe%8]) with mapi id 15.20.1580.019; Mon, 4 Feb 2019 09:10:04 +0000 From: Pankaj Bansal To: Leo Li Subject: [PATCH v3 2/2] drivers: soc: fsl: add qixis driver Thread-Topic: [PATCH v3 2/2] drivers: soc: fsl: add qixis driver Thread-Index: AQHUvGlq5QpFuw3iE0KaAu9EZS6m4A== Date: Mon, 4 Feb 2019 09:10:04 +0000 Message-ID: <20190204143449.25040-3-pankaj.bansal@nxp.com> References: <20190204143449.25040-1-pankaj.bansal@nxp.com> In-Reply-To: <20190204143449.25040-1-pankaj.bansal@nxp.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: BMXPR01CA0037.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00:c::23) To VI1PR0401MB2496.eurprd04.prod.outlook.com (2603:10a6:800:56::10) authentication-results: spf=none (sender IP is ) smtp.mailfrom=pankaj.bansal@nxp.com; x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.17.1 x-originating-ip: [92.120.1.69] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; VI1PR0401MB2448; 6:4xBxZ8EGaJIlvJ72ugQQX7v4LiejvXt8Tsvl4uOrVj3Ifa2/WDB0gwEfBKV0t7FbUXn+RXTHj+C6jCD6i4+MQJTcMoDKfm+hcacLuQUhuQK3sy/VQjPryF4VBAmMRmxV5G42MrwQ2sDVcIrul5n9bpOCxXvPhrL0adH3iUnWOWKHchqGB5RR7bbKvJYLYglfFO/8qWxXahf163riUlwpPBWBkUzLsjo24AMvUcCPadd8m+yAVdvKsuiPSoOge69o1/VpFz1yXU5GjNiGBhTGIZFTUfkw3jg9pq4/OaDss74K4Fx7vnSZbB1fm6yKuVUY1+BitO7S4Iw59VgzdM8AkHVtPTeYaS9AUua+ORAaeOqXh5VTQXrXbsHkE/dHpc6C7GHRtmIYnAWMk2kbZTAcOkH6teVVkaXGqPbpUONNPevB0Ow24kjy7j8TKjyldgVnF5gJLZlszHIjjl3IOuaWNQ==; 5:eQUv3AiP1sNumsW70OEorQ5FBtr4xH/EomYsfhgJALWg/sodjbdl4YnKsTjFoZwu9+3bVEoKVCeIUx2+Fcoj82B69v9al09QhOtEJBkvc8knETaqP6TZgx31GaFHg14AE6VdyFCQepcoDhFUteb8jCx8Q7JbT/LGijmN7thpayumlN/loQ2kVo2QCBxNyipyVSxJ8KY2sZoVUO5eIk5T9Q==; 7:hniWtLSAEnpSIUUk4jdVDs2mew+09b7LTAIjiuywyM1IcL0DzURRNwZngqa14SeKrsmTwxCOw0VxdLVYeddPoghyw+kKIQuSkUSNKLDTpaGa+DBwLfniPhCXnkVS2Kkh+w7vy2gnWDx1dqfwiBWfNQ== x-ms-office365-filtering-correlation-id: 1888f5b6-e3a4-4f31-7168-08d68a808c7d x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600110)(711020)(4605077)(4618075)(2017052603328)(7153060)(7193020); SRVR:VI1PR0401MB2448; x-ms-traffictypediagnostic: VI1PR0401MB2448: x-microsoft-antispam-prvs: x-forefront-prvs: 0938781D02 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(376002)(366004)(396003)(346002)(136003)(39860400002)(189003)(199004)(36756003)(6486002)(186003)(106356001)(6306002)(6116002)(476003)(14454004)(486006)(7736002)(305945005)(6512007)(966005)(44832011)(8936002)(6436002)(2616005)(3846002)(1076003)(26005)(50226002)(6506007)(386003)(99286004)(11346002)(446003)(102836004)(76176011)(81166006)(81156014)(8676002)(52116002)(86362001)(2906002)(316002)(71200400001)(6636002)(71190400001)(37006003)(478600001)(25786009)(54906003)(105586002)(68736007)(256004)(4326008)(6862004)(97736004)(66066001)(107886003)(53936002); DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR0401MB2448; H:VI1PR0401MB2496.eurprd04.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: g+wNJ1BdS+ZcWmhrcJGiIYZuvkBV1r9c6NrPz/aPPJpFFNggQ5Fzh+RR+0zkSnorVVrzgX2IxFf2t3OY5GWHZtqrc2B4zKdLOYBEpKKnusxK4GtLMKLiNzudOOBu6fMtjONmbwk1s9/qxak82x7688/3POr5a+SfnoZOFpS+UUpX8iMDywn5Su2o94oZmtt+NWyjdaM0NI6XunyuSOoWPZ0GXhA5gcpAw1mdhoYKnos7xrcNWpVxaZG3+uZkbOra5uY1qRS6hZP1mLkaBWgNFqGpXNyrnZGVuIOt68fkYRXzutJgz6wKUyhGnK3/sf8TcOc0wDNoFT1UgPfsZZsuJIXApRwrQnFCx3oC5WRDEz3NcVK/myAU7sBEx9sLFOMWtWku1L1WWJYE3rMGYHIh9iUSZcN8VpgEKIhsuxuEz70= MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1888f5b6-e3a4-4f31-7168-08d68a808c7d X-MS-Exchange-CrossTenant-originalarrivaltime: 04 Feb 2019 09:10:02.5892 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0401MB2448 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190204_011007_921040_9BCC2735 X-CRM114-Status: GOOD ( 16.92 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Pankaj Bansal , "linuxppc-dev@lists.ozlabs.org" , Wang Dongsheng , "linux-arm-kernel@lists.infradead.org" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP FPGA on LX2160AQDS/LX2160ARDB connected on I2C bus, so add qixis driver which is basically an i2c client driver to control FPGA. Also added platform driver for MMIO based FPGA, like the one available on LS2088ARDB/LS2088AQDS. Signed-off-by: Wang Dongsheng Signed-off-by: Pankaj Bansal --- Notes: V3: - Add MMIO based FPGA driver V2: - Modify the driver to not create platform devices corresponding to subnodes. because the subnodes are not actual devices. - Use mdio_mux_regmap_init/mdio_mux_regmap_uninit - Remove header file from include folder, as no qixis api is called from outside - Add regmap_exit in driver's remove function Dendencies: - https://www.mail-archive.com/netdev@vger.kernel.org/msg281274.html drivers/soc/fsl/Kconfig | 11 ++ drivers/soc/fsl/Makefile | 1 + drivers/soc/fsl/qixis_ctrl.c | 207 +++++++++++++++++++++++++++++++++ 3 files changed, 219 insertions(+) diff --git a/drivers/soc/fsl/Kconfig b/drivers/soc/fsl/Kconfig index 8f80e8bbf29e..75993be04e42 100644 --- a/drivers/soc/fsl/Kconfig +++ b/drivers/soc/fsl/Kconfig @@ -28,4 +28,15 @@ config FSL_MC_DPIO other DPAA2 objects. This driver does not expose the DPIO objects individually, but groups them under a service layer API. + +config FSL_QIXIS + tristate "QIXIS system controller driver" + depends on OF + select REGMAP_I2C + select REGMAP_MMIO + default n + help + Say y here to enable QIXIS system controller api. The qixis driver + provides FPGA functions to control system. + endmenu diff --git a/drivers/soc/fsl/Makefile b/drivers/soc/fsl/Makefile index 803ef1bfb5ff..47e0cfc66ca4 100644 --- a/drivers/soc/fsl/Makefile +++ b/drivers/soc/fsl/Makefile @@ -5,5 +5,6 @@ obj-$(CONFIG_FSL_DPAA) += qbman/ obj-$(CONFIG_QUICC_ENGINE) += qe/ obj-$(CONFIG_CPM) += qe/ +obj-$(CONFIG_FSL_QIXIS) += qixis_ctrl.o obj-$(CONFIG_FSL_GUTS) += guts.o obj-$(CONFIG_FSL_MC_DPIO) += dpio/ diff --git a/drivers/soc/fsl/qixis_ctrl.c b/drivers/soc/fsl/qixis_ctrl.c new file mode 100644 index 000000000000..36a3e1abc465 --- /dev/null +++ b/drivers/soc/fsl/qixis_ctrl.c @@ -0,0 +1,207 @@ +// SPDX-License-Identifier: GPL-2.0+ + +/* Freescale QIXIS system controller driver. + * + * Copyright 2015 Freescale Semiconductor, Inc. + * Copyright 2018-2019 NXP + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/* QIXIS MAP */ +struct fsl_qixis_regs { + u8 id; /* Identification Registers */ + u8 version; /* Version Register */ + u8 qixis_ver; /* QIXIS Version Register */ + u8 reserved1[0x1f]; +}; + +struct mdio_mux_data { + void *data; + struct list_head link; +}; + +struct qixis_priv { + struct regmap *regmap; + struct list_head mdio_mux_list; +}; + +static struct regmap_config qixis_regmap_config = { + .reg_bits = 8, + .val_bits = 8, +}; + +static int fsl_qixis_mdio_mux_init(struct device *dev, struct qixis_priv *priv) +{ + struct device_node *child; + struct mdio_mux_data *mux_data; + int ret; + + INIT_LIST_HEAD(&priv->mdio_mux_list); + for_each_child_of_node(dev->of_node, child) { + if (!of_node_name_prefix(child, "mdio-mux")) + continue; + + mux_data = devm_kzalloc(dev, sizeof(struct mdio_mux_data), + GFP_KERNEL); + if (!mux_data) + return -ENOMEM; + ret = mdio_mux_regmap_init(dev, child, &mux_data->data); + if (ret) + return ret; + list_add(&mux_data->link, &priv->mdio_mux_list); + } + + return 0; +} + +static int fsl_qixis_mdio_mux_uninit(struct qixis_priv *priv) +{ + struct list_head *pos; + struct mdio_mux_data *mux_data; + + list_for_each(pos, &priv->mdio_mux_list) { + mux_data = list_entry(pos, struct mdio_mux_data, link); + mdio_mux_regmap_uninit(mux_data->data); + } + + return 0; +} + +static int fsl_qixis_probe(struct platform_device *pdev) +{ + static struct fsl_qixis_regs __iomem *qixis; + struct qixis_priv *priv; + int ret; + u32 qver; + + qixis = of_iomap(pdev->dev.of_node, 0); + if (IS_ERR_OR_NULL(qixis)) { + pr_err("%s: Could not map qixis registers\n", __func__); + return -ENODEV; + } + + priv = devm_kzalloc(&pdev->dev, sizeof(struct qixis_priv), GFP_KERNEL); + if (!priv) + return -ENOMEM; + + priv->regmap = devm_regmap_init_mmio(&pdev->dev, qixis, + &qixis_regmap_config); + regmap_read(priv->regmap, offsetof(struct fsl_qixis_regs, qixis_ver), + &qver); + pr_info("Freescale QIXIS Version: 0x%08x\n", qver); + + ret = fsl_qixis_mdio_mux_init(&pdev->dev, priv); + if (ret) + goto error; + + platform_set_drvdata(pdev, priv); + + return 0; +error: + regmap_exit(priv->regmap); + + return ret; +} + +static int fsl_qixis_remove(struct platform_device *pdev) +{ + struct qixis_priv *priv; + + priv = platform_get_drvdata(pdev); + fsl_qixis_mdio_mux_uninit(priv); + regmap_exit(priv->regmap); + + return 0; +} + +static const struct of_device_id fsl_qixis_of_match[] = { + { .compatible = "fsl,fpga-qixis", }, + {}, +}; +MODULE_DEVICE_TABLE(of, fsl_qixis_of_match); + +static struct platform_driver fsl_qixis_driver = { + .driver = { + .name = "qixis_ctrl", + .owner = THIS_MODULE, + .of_match_table = of_match_ptr(fsl_qixis_of_match), + }, + .probe = fsl_qixis_probe, + .remove = fsl_qixis_remove, +}; +module_platform_driver(fsl_qixis_driver); + +static int fsl_qixis_i2c_probe(struct i2c_client *client) +{ + struct qixis_priv *priv; + int ret; + u32 qver; + + if (!i2c_check_functionality(client->adapter, I2C_FUNC_SMBUS_BYTE_DATA)) + return -EOPNOTSUPP; + + priv = devm_kzalloc(&client->dev, sizeof(struct qixis_priv), + GFP_KERNEL); + if (!priv) + return -ENOMEM; + + priv->regmap = regmap_init_i2c(client, &qixis_regmap_config); + regmap_read(priv->regmap, offsetof(struct fsl_qixis_regs, qixis_ver), + &qver); + pr_info("Freescale QIXIS Version: 0x%08x\n", qver); + + ret = fsl_qixis_mdio_mux_init(&client->dev, priv); + if (ret) + goto error; + + i2c_set_clientdata(client, priv); + + return 0; +error: + regmap_exit(priv->regmap); + + return ret; +} + +static int fsl_qixis_i2c_remove(struct i2c_client *client) +{ + struct qixis_priv *priv; + + priv = i2c_get_clientdata(client); + fsl_qixis_mdio_mux_uninit(priv); + regmap_exit(priv->regmap); + + return 0; +} + +static const struct of_device_id fsl_qixis_i2c_of_match[] = { + { .compatible = "fsl,fpga-qixis-i2c" }, + {} +}; +MODULE_DEVICE_TABLE(of, fsl_qixis_i2c_of_match); + +static struct i2c_driver fsl_qixis_i2c_driver = { + .driver = { + .name = "qixis_ctrl", + .owner = THIS_MODULE, + .of_match_table = of_match_ptr(fsl_qixis_i2c_of_match), + }, + .probe_new = fsl_qixis_i2c_probe, + .remove = fsl_qixis_i2c_remove, +}; +module_i2c_driver(fsl_qixis_i2c_driver); + +MODULE_AUTHOR("Wang Dongsheng "); +MODULE_DESCRIPTION("Freescale QIXIS system controller driver"); +MODULE_LICENSE("GPL"); +