From patchwork Fri Dec 21 15:31:09 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ioana Ciornei X-Patchwork-Id: 10740613 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 A296C6C5 for ; Fri, 21 Dec 2018 15:31:47 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8F3D0283E7 for ; Fri, 21 Dec 2018 15:31:47 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8037E283FE; Fri, 21 Dec 2018 15:31:47 +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=-3.7 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,RCVD_IN_SORBS_WEB 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 321E4283E7 for ; Fri, 21 Dec 2018 15:31:47 +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=rN6pSeudU2tOzP4hdYaMBPo+4KhVHPrnCF5Zc5ZjHPk=; b=EIDrZ84fkmqoL8 EMCe+CD07CmSwTY685DTvuGBm6c3hhnj9azOvzROJmlAPiSN7uEmhkgrcHB5QuGQgSYG2HZSPqRQ3 0EC4HSicAlJ5+d1Cl9E2DNwLbPpC2Uswe/2h4Lfv+jCpSXcpM+ZnRPbF8WqmqNmNN/y+lFf0q+TUp JzsGYrLDAjZm2XvJsB2lBGFpl2rlXtJWEzueZYaWzus1lWO3rsHOwd+xnjzCZ1X51lte+erj9fSah RyxdFxA5Lg1mA2Asez6qCdM5HyIMth7Q6iLvAyUtfNNjIJvUwX9BtrpRZ8hQSmgOvHMsVgkiCHamp YgCqdVCJFVwFUVn4pkHQ==; 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 1gaMm8-0006In-9R; Fri, 21 Dec 2018 15:31:44 +0000 Received: from mail-eopbgr40049.outbound.protection.outlook.com ([40.107.4.49] helo=EUR03-DB5-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gaMlo-0005da-6f for linux-arm-kernel@lists.infradead.org; Fri, 21 Dec 2018 15:31:25 +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=EgLxbuvJZcf3yQ7cACTLuYwoOpt5DrqhYCGNnThVRAo=; b=UmxogrM2uAFPoU9MmhckRx5b6Q8QjRdT7DsdfV4rcLlBjTVl4m5Rx2HKuiNTAiOGp9ccUhK1TWUo1NQbUSrptak/BG8AbnvllROoNEuVI/DFf5vpjD2yMJonNIWxUkV2yNWrPcOKh8u8/wBqtUoD+3HhGG+B2mPGrlboeo5sIYs= Received: from VI1PR0402MB2800.eurprd04.prod.outlook.com (10.172.255.18) by VI1PR0402MB3488.eurprd04.prod.outlook.com (52.134.4.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1425.22; Fri, 21 Dec 2018 15:31:09 +0000 Received: from VI1PR0402MB2800.eurprd04.prod.outlook.com ([fe80::95a2:5df5:8d7b:22e9]) by VI1PR0402MB2800.eurprd04.prod.outlook.com ([fe80::95a2:5df5:8d7b:22e9%6]) with mapi id 15.20.1446.022; Fri, 21 Dec 2018 15:31:09 +0000 From: Ioana Ciornei To: Leo Li , "linux-arm-kernel@lists.infradead.org" , "devicetree@vger.kernel.org" Subject: [PATCH 1/3] arm64: dts: add dpaa2-console node for DPAA2 platforms Thread-Topic: [PATCH 1/3] arm64: dts: add dpaa2-console node for DPAA2 platforms Thread-Index: AQHUmUIyF6ylLjPS3UibJyYT5PgWGw== Date: Fri, 21 Dec 2018 15:31:09 +0000 Message-ID: <1545406240-3061-2-git-send-email-ioana.ciornei@nxp.com> References: <1545406240-3061-1-git-send-email-ioana.ciornei@nxp.com> In-Reply-To: <1545406240-3061-1-git-send-email-ioana.ciornei@nxp.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: VI1PR0801CA0082.eurprd08.prod.outlook.com (2603:10a6:800:7d::26) To VI1PR0402MB2800.eurprd04.prod.outlook.com (2603:10a6:800:ad::18) authentication-results: spf=none (sender IP is ) smtp.mailfrom=ioana.ciornei@nxp.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [86.34.165.90] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; VI1PR0402MB3488; 6:YaSNjSv889VOJyrkFS7X+u0Pcr1Wz6g492X0xDgM8Nw99x2TRAendTLnfl3mUtmcxBGFkpotyDFD1mfImXtcjpY5BEsJg2jtQ4P1qpauHoB4Uu24ibH7fN03/bMfrJ2XlyJnoI+//8oaXuKHH4c3Gt1gOYVLFHphHnNPdHhgwsdXi3YyxooWsVJHuZ0bK8bcLilKbjw6X1Zb2xlmCX0I/9Lv+bPQx4fqQeZNHpMpmUg7fHXAWX+rwjjgQ9Xy1OS9ZxHZF4Q1JpLeNtALUCVOgDxHYPY+k5blLzcJqU0vxyIDCYzHAHTMXNUCiuQI3Jx8Nj5USFMBk2QcsN0CnVyerCA5rl5ICkXXCSpMbwYZwsqCm0dBehGO/zNTyijIlmYRf8lz/cEhXQE4xibuel0B9gWc1wRW/NPVwWKgXbGkhPI92y34U7sx7mO05RVLeaKcAHihGw8x1wUHBnmnqxDhKA==; 5:f4YCXJdiqUmF3tRvKk8ENshVC6lyDydG4c9RE7wX6pjZhptduOHyREwgLRJ3X87eakkllkxrZRGBKP+8vyUn8FW8XrrqbLjH/m6oZH3ll5p9seOXMnCSS9Z/iYIp4N8swRw+cyPNh5GDhPmNDhAzM/Hf6gHk7Rdt4A8xaXt+SIo=; 7:BVhi1Cpx3EOUu3TxWHlxvSjdE16b56oCEfUy8b+gWmgCcz7M3XiQzLuSz3yyefdiS5DiJoJFU7YLfUac1UHaI2OBmog5Kjxk5Ip2RAdfJYJ4PFzv+oXZswgVZrvHb55WNqXdXb6CR0FWfM9jijnmfg== x-ms-office365-filtering-correlation-id: c7911344-1ccd-4b8b-59b8-08d6675954fd x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020); SRVR:VI1PR0402MB3488; x-ms-traffictypediagnostic: VI1PR0402MB3488: x-microsoft-antispam-prvs: x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(3230021)(999002)(5005026)(6040522)(2401047)(8121501046)(3231475)(944501520)(52105112)(93006095)(93001095)(10201501046)(3002001)(6055026)(149066)(150057)(6041310)(20161123558120)(20161123562045)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(201708071742011)(7699051)(76991095); SRVR:VI1PR0402MB3488; BCL:0; PCL:0; RULEID:; SRVR:VI1PR0402MB3488; x-forefront-prvs: 0893636978 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(376002)(39860400002)(366004)(346002)(136003)(396003)(199004)(189003)(6512007)(53936002)(2906002)(71200400001)(71190400001)(575784001)(86362001)(2201001)(26005)(97736004)(256004)(102836004)(6486002)(110136005)(186003)(386003)(68736007)(99286004)(316002)(52116002)(305945005)(446003)(76176011)(36756003)(6116002)(25786009)(11346002)(66066001)(8936002)(105586002)(6436002)(106356001)(2616005)(476003)(54906003)(81166006)(81156014)(14454004)(44832011)(3846002)(6506007)(8676002)(478600001)(5660300001)(486006)(2501003)(4326008)(7736002); DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR0402MB3488; H:VI1PR0402MB2800.eurprd04.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: Ly3GmqiyT2wswRBByp1XXFH/VJrWDFl0ktPgJQunpckLaFUJgYzfcvm7vTrMxRvtvPuWPZYGHDQ6Sq5WeaTbiqUCtf98VyW1X0TpZpBxS7RA5paOfBxCH+7+q/FzqHo/Ac0NydNg+qVR8L9ey8POea0mmf3MWBwYscSlsv22SVIYAMmTC9KZawsedS3A1/NLqDJ+KSO2iUBqjtcnEfcPdiyxRVI1Jpvn4OUU8/uoQdvXBMUsLP4RGGVA90lLgwis9olv+nVTIQ2Ldnbh6zSp7hyg/iyVygORIdSYCNw8JJQh9dBIsz2Wx6Zuuoi5lvMV spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: c7911344-1ccd-4b8b-59b8-08d6675954fd X-MS-Exchange-CrossTenant-originalarrivaltime: 21 Dec 2018 15:31:09.7956 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0402MB3488 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181221_073124_243727_6C052FBF X-CRM114-Status: GOOD ( 12.05 ) 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: Ioana Ciocoi Radulescu , Roy Pledge , "linux-kernel@vger.kernel.org" , "robh+dt@kernel.org" , Ioana Ciornei , "shawnguo@kernel.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 Add the dpaa2-console device tree node for the following DPAA2 based platforms: LS1088A, LS2080A and LS2088A. Signed-off-by: Ioana Ciornei --- arch/arm64/boot/dts/freescale/fsl-ls1088a.dtsi | 5 +++++ arch/arm64/boot/dts/freescale/fsl-ls208xa.dtsi | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/arch/arm64/boot/dts/freescale/fsl-ls1088a.dtsi b/arch/arm64/boot/dts/freescale/fsl-ls1088a.dtsi index e73e55f..664e337 100644 --- a/arch/arm64/boot/dts/freescale/fsl-ls1088a.dtsi +++ b/arch/arm64/boot/dts/freescale/fsl-ls1088a.dtsi @@ -569,6 +569,11 @@ clock-names = "apb_pclk", "wdog_clk"; }; + dpaa2-console@0x08340020 { + compatible = "dpaa2-console"; + reg = <0x00000000 0x08340020 0 0x2>; + }; + fsl_mc: fsl-mc@80c000000 { compatible = "fsl,qoriq-mc"; reg = <0x00000008 0x0c000000 0 0x40>, /* MC portal base */ diff --git a/arch/arm64/boot/dts/freescale/fsl-ls208xa.dtsi b/arch/arm64/boot/dts/freescale/fsl-ls208xa.dtsi index d188774..6db6ea4 100644 --- a/arch/arm64/boot/dts/freescale/fsl-ls208xa.dtsi +++ b/arch/arm64/boot/dts/freescale/fsl-ls208xa.dtsi @@ -333,6 +333,11 @@ }; }; + dpaa2-console@0x08340020 { + compatible = "dpaa2-console"; + reg = <0x00000000 0x08340020 0 0x2>; + }; + fsl_mc: fsl-mc@80c000000 { compatible = "fsl,qoriq-mc"; reg = <0x00000008 0x0c000000 0 0x40>, /* MC portal base */ From patchwork Fri Dec 21 15:31:11 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ioana Ciornei X-Patchwork-Id: 10740615 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 3DF4C6C5 for ; Fri, 21 Dec 2018 15:31:59 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2D6AD283E7 for ; Fri, 21 Dec 2018 15:31:59 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 214C628405; Fri, 21 Dec 2018 15:31:59 +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=-3.7 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,RCVD_IN_SORBS_WEB 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 B4583283E7 for ; Fri, 21 Dec 2018 15:31:58 +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=tXHeGgqt/r5dn9tFek38vp27oYyr9qIGuxCf7lb4PV8=; b=LkJCdWIGULhH7N F2Dmf9eYkZBW+GHgQRMKSfBQIfBcMryS3qjsYymg8tfedy5JEQUqTfNFxdTMFeyG6hkKCpX0iZBqQ /1t/KBffpjjyHfw/XjHbaXJqOFwAwFDiWTUUWZ8V2SktUitsySOmzuMeszxasp1pXzWpRRTvcPTV4 oA7ry/Vqc8RLEl7YeBKTRaDQtXKf7qBItOTkYk406X3FmdEcL9bmSTL28dccs02niQfCtHKTo0tkj 4NDIia1bZeWBXrD2Amk2+KeF0aUoxBtrX3t21THyfblYuBrpO38qfW2+p8fg4NoRtsrLd9G22OprP Vq3cSRwmyhrPoBAYpxtw==; 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 1gaMmJ-0006St-5I; Fri, 21 Dec 2018 15:31:55 +0000 Received: from mail-eopbgr40049.outbound.protection.outlook.com ([40.107.4.49] helo=EUR03-DB5-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gaMlp-0005da-TP for linux-arm-kernel@lists.infradead.org; Fri, 21 Dec 2018 15:31:29 +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=81h2cMsCBY2h2iuWH1X4RfhsOnpIPlqnz+l+kE9IEYI=; b=lb1nuT+hqz4iQXp2lEPJMe9YhgLBcLCLvNx6RBRDdeEJXZwov7+2EEh5aSOG0i8iOsMC2d6Xj5zbrv4hWIW0MpkC0muQlnDpb5iZFIgjubKyjn0hT96s696kkhRmB3qpK+s2mujaa92xhqqmUEPZmfdxiQa+EyZWSdAv/Sksr+Q= Received: from VI1PR0402MB2800.eurprd04.prod.outlook.com (10.172.255.18) by VI1PR0402MB3488.eurprd04.prod.outlook.com (52.134.4.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1425.22; Fri, 21 Dec 2018 15:31:11 +0000 Received: from VI1PR0402MB2800.eurprd04.prod.outlook.com ([fe80::95a2:5df5:8d7b:22e9]) by VI1PR0402MB2800.eurprd04.prod.outlook.com ([fe80::95a2:5df5:8d7b:22e9%6]) with mapi id 15.20.1446.022; Fri, 21 Dec 2018 15:31:11 +0000 From: Ioana Ciornei To: Leo Li , "linux-arm-kernel@lists.infradead.org" , "devicetree@vger.kernel.org" Subject: [PATCH 2/3] Documentation: DT: Add entry for DPAA2 console Thread-Topic: [PATCH 2/3] Documentation: DT: Add entry for DPAA2 console Thread-Index: AQHUmUIzLDDB55qxuECeWDzF4+LHLA== Date: Fri, 21 Dec 2018 15:31:11 +0000 Message-ID: <1545406240-3061-3-git-send-email-ioana.ciornei@nxp.com> References: <1545406240-3061-1-git-send-email-ioana.ciornei@nxp.com> In-Reply-To: <1545406240-3061-1-git-send-email-ioana.ciornei@nxp.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: VI1PR0801CA0082.eurprd08.prod.outlook.com (2603:10a6:800:7d::26) To VI1PR0402MB2800.eurprd04.prod.outlook.com (2603:10a6:800:ad::18) authentication-results: spf=none (sender IP is ) smtp.mailfrom=ioana.ciornei@nxp.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [86.34.165.90] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; VI1PR0402MB3488; 6:POxdqlUplTmz8766PFxntSlH3lzRV/7LaMg6agtR4UhZGpNGS3O1wRLzbMIy+nCcGh9QADdZV/QR9J7YRBFcO2bGfVodCnQgoCvC6PO3P2RmNau0iYVt5BXPEzPEnUD8SvQeHxbPMcAvQF5zCv2uR03Ati/WmlZdgDG1tiPtpsoA2H1eVMW8zGpsljMBL8E8FvgVI+q/1Et5lUaCZfJ+FdRJopAe5zgFwimXWzDp3RKwOy5rp9OCCXALUaOaMGblHaO0UJ0V7yjA5lKXJHvFXIkiKaalyyPwQP/nVaw+nzsCg6Z7jomDlIuerI0ZYTV5oixA031/PA4fUVN5ecxAO5729zG9tTYqRQ5ss+bAR1n/KgvC/l7UtXpPK8nWdXmWDJXV4Xl/LwI9Ie11f4/LKoPpzmBDtDy+IzHWkoCQRYppNppq8l/QLYSA/RJK/poS92O7jxOgkCqiQCRrelNDcA==; 5:QevsTvBuhRTmjb6N8ki/2IpjtreMbCTtbkHGcy07mshV0FOJu6Ci6arNQF2Mrjp03LYtxmdto3G4nI6wXp1i9HJeChjAnYdFLlWA/RFOi1ILovOW38Iz4SpF+yN1Q/cOms65nsoawv7faqflKKLzKniw4caeEWydi+E9cv531Gs=; 7:1UXyyQVacT4cVTbl31rVZQC1jPc/4GgZPk1sUpQt5ElAqJLAcGDIwminzikLUyv2CP4DOTBfgL018h5KAYkE31RRFiHMYyPfskpT1Z0ngpBZpH4nWg+1RDc2xXZXuomGZhy3SqwqwMAABlXT/ceWbg== x-ms-office365-filtering-correlation-id: aa78f0c2-9626-4802-af5d-08d667595635 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020); SRVR:VI1PR0402MB3488; x-ms-traffictypediagnostic: VI1PR0402MB3488: x-microsoft-antispam-prvs: x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(3230021)(999002)(5005026)(6040522)(2401047)(8121501046)(3231475)(944501520)(52105112)(93006095)(93001095)(10201501046)(3002001)(6055026)(149066)(150057)(6041310)(20161123558120)(20161123562045)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(201708071742011)(7699051)(76991095); SRVR:VI1PR0402MB3488; BCL:0; PCL:0; RULEID:; SRVR:VI1PR0402MB3488; x-forefront-prvs: 0893636978 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(376002)(39860400002)(366004)(346002)(136003)(396003)(199004)(189003)(6512007)(53936002)(2906002)(71200400001)(71190400001)(86362001)(2201001)(26005)(97736004)(256004)(102836004)(6486002)(110136005)(186003)(386003)(68736007)(99286004)(316002)(52116002)(305945005)(446003)(76176011)(36756003)(6116002)(25786009)(11346002)(66066001)(8936002)(105586002)(6436002)(106356001)(2616005)(476003)(54906003)(81166006)(81156014)(14454004)(44832011)(3846002)(6506007)(8676002)(478600001)(5660300001)(486006)(2501003)(4326008)(7736002); DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR0402MB3488; H:VI1PR0402MB2800.eurprd04.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: 9BYQCVVW7LV10Rc8crgdBLsW6jllZLyVVfprcFUrpTSJ4mZNfwT1eKeeM/DM7aE/Xo3SUXylanrAFjkycLtDtu4QrSxrHN3zOJ55zlW9jE4DPo9KiGW4iUfTXapajEncwztgiVsA9WO7VK3HYfpc9inTRvNsKSPK1HjZjUfsyle9qt84cA4kmsuWYCErDpOmLnCeGPRn/dOEZRyTSUGOALstdw/MjTc+unSiai6Qwrwkk0+Wcrv2ofWCNl2vwj/GKOCeQGD4rmwl03f/d/oUM8v53LC46trqadaV6K7vWIYaIrbIsQlhD5260VAeB8G8 spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: aa78f0c2-9626-4802-af5d-08d667595635 X-MS-Exchange-CrossTenant-originalarrivaltime: 21 Dec 2018 15:31:11.7956 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0402MB3488 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181221_073126_268873_60BDE02E X-CRM114-Status: GOOD ( 14.07 ) 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: Ioana Ciocoi Radulescu , Roy Pledge , "linux-kernel@vger.kernel.org" , "robh+dt@kernel.org" , Ioana Ciornei , "shawnguo@kernel.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 This patch adds a devicetree binding documentation for FSL's DPAA2 console. Signed-off-by: Ioana Ciornei --- Documentation/devicetree/bindings/misc/dpaa2-console.txt | 11 +++++++++++ MAINTAINERS | 1 + 2 files changed, 12 insertions(+) create mode 100644 Documentation/devicetree/bindings/misc/dpaa2-console.txt diff --git a/Documentation/devicetree/bindings/misc/dpaa2-console.txt b/Documentation/devicetree/bindings/misc/dpaa2-console.txt new file mode 100644 index 0000000..f4e16b1 --- /dev/null +++ b/Documentation/devicetree/bindings/misc/dpaa2-console.txt @@ -0,0 +1,11 @@ +DPAA2 console support + +Required properties: + + - compatible + Value type: + Definition: Must be "dpaa2-console". + - reg + Value type: + Definition: A standard property. Specifies the region where the MCFBA + (MC firmware base address) register can be found. diff --git a/MAINTAINERS b/MAINTAINERS index 7b76a80..229d4fb 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -5969,6 +5969,7 @@ M: Li Yang L: linuxppc-dev@lists.ozlabs.org L: linux-arm-kernel@lists.infradead.org S: Maintained +F: Documentation/devicetree/bindings/misc/dpaa2-console.txt F: Documentation/devicetree/bindings/soc/fsl/ F: drivers/soc/fsl/ F: include/linux/fsl/ From patchwork Fri Dec 21 15:31:13 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ioana Ciornei X-Patchwork-Id: 10740617 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 5302C1399 for ; Fri, 21 Dec 2018 15:32:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 403BC283E2 for ; Fri, 21 Dec 2018 15:32:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 340B8283EE; Fri, 21 Dec 2018 15:32:19 +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=-3.7 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,RCVD_IN_SORBS_WEB 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 95F46283E2 for ; Fri, 21 Dec 2018 15:32:18 +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=dWzwR3iixmqrh7pxlmPco2jBnfP0NiGzXCUYnUOtRts=; b=qT2VHq4VmQI+HO vJ+NOGZg39RpJeJ6dMG8l1ddYyLu5oV0HxGpKO5XxOE39CaqVKT7xIkM3JOUhjjX7wfRjpENtOSjU 2sZUIwsKHqtmXenbtyluqKpCXqvXQcxIIWPTIhTanBhi3RuGnbRseZZQs8GIbkdHflJuOVdkO8++F EhR5FbGpc2qWtmUESvfkG6A2b8d1yw6PjvPuq9rIgUoQTnOqrMExQC8+SJM6RLhsmxLVbooey7PwM Gu2HjhTyRzfuCLz158/n/fYpqk6pP2t+XMvfj5Fq3s5Igc6+lArGfFrwDSjqD7NhhBStiKJHRQsyd EBp3gcbrqjkizZKT5Zvw==; 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 1gaMma-0006kf-7v; Fri, 21 Dec 2018 15:32:12 +0000 Received: from mail-eopbgr40049.outbound.protection.outlook.com ([40.107.4.49] helo=EUR03-DB5-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gaMlt-0005da-Os for linux-arm-kernel@lists.infradead.org; Fri, 21 Dec 2018 15:31:34 +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=CFM2tQwGJF8eQRG0oAa6pjooJV+4+Ndr/Du0/0nWvFU=; b=ju6ieaqZHSgHigpwNe5VeRXvzuhvIeugaxNrye40NjH1lxvdGAFsgQNspRu/n1rbWrSzy3vWUgtMsbSOH82iwYBXdVP6+CnamnSSZsQp3A7/UQ081K2nKX2d1gA6alGLkCI3dCJ7UQiP+6IZKUOzf3tn/Qq1bhlf7aptk2Iaz84= Received: from VI1PR0402MB2800.eurprd04.prod.outlook.com (10.172.255.18) by VI1PR0402MB3488.eurprd04.prod.outlook.com (52.134.4.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1425.22; Fri, 21 Dec 2018 15:31:13 +0000 Received: from VI1PR0402MB2800.eurprd04.prod.outlook.com ([fe80::95a2:5df5:8d7b:22e9]) by VI1PR0402MB2800.eurprd04.prod.outlook.com ([fe80::95a2:5df5:8d7b:22e9%6]) with mapi id 15.20.1446.022; Fri, 21 Dec 2018 15:31:13 +0000 From: Ioana Ciornei To: Leo Li , "linux-arm-kernel@lists.infradead.org" , "devicetree@vger.kernel.org" Subject: [PATCH 3/3] soc: fsl: add DPAA2 console support Thread-Topic: [PATCH 3/3] soc: fsl: add DPAA2 console support Thread-Index: AQHUmUI0CNZtplWE40CdxaJlcs+b1A== Date: Fri, 21 Dec 2018 15:31:13 +0000 Message-ID: <1545406240-3061-4-git-send-email-ioana.ciornei@nxp.com> References: <1545406240-3061-1-git-send-email-ioana.ciornei@nxp.com> In-Reply-To: <1545406240-3061-1-git-send-email-ioana.ciornei@nxp.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: VI1PR0801CA0082.eurprd08.prod.outlook.com (2603:10a6:800:7d::26) To VI1PR0402MB2800.eurprd04.prod.outlook.com (2603:10a6:800:ad::18) authentication-results: spf=none (sender IP is ) smtp.mailfrom=ioana.ciornei@nxp.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [86.34.165.90] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; VI1PR0402MB3488; 6:P/gRuC9Cf9obWn6CSl1heMYZPQDUkI5velM1yVYW5IduZ8xDQxD8B1WCwWgj67jUgECOdrkmYI/iC5BdEj0Kt7NX7w9hUltcBjTepgNEVPfOXUIbbl+Dtr/HY65hh16+5OIA+VsFDuvblbXwAaiMveL1H1pQCa0ScpDEqOqYCnmVVLT7IYFLwdZRuYwZ4esrzD8NRqYrGHPazxGSpZQ0fVp+FJnCgowTaa8NpA3nEgAaM4wJy7Gnjza6Ox55U3tmUjUrfkRP0S2j8dz4LI7EbgaOxVwyYPh37zX6YqADj5ZuttFgmymjo928ESRohOu3GT+tkK65VkVBcoIcg2qoa5ucmwGu7tCDUXrtPhaKG2l+ZUuD2ZcM3on735GccB/HwYVMtCcShYYCd2pyPcDwynmEnYQdyM2aPL4jrY3HXdy2NaeAGyqnAlUwmQLGd/8nrSSoAO6futReDcPXD2liTw==; 5:GKrxl0klzzWroUBcUJ+vtcOre7hbjdeZ+UrXMUxTRmj/xZEW0p9ZLNWQRmuqAgbfTjd7Q/wQyXKQsA661IFeeWuhqHMGBv6NcIRSYAZa2b1cXo4GRgEpZHUSdtC3znkCdXCZc1psNsCIxGZVUJQTh8HTp/zMOq7oliuW1OsthHM=; 7:vZOwh46xzXuvX0vXPoGI40IBu1XSGrFtoJQKwl9IMNbQ21q+RFuWXLmxy8OKa4McnabWmVH7F51bePLM9dXxZrgmbuXlWpMWAOnR2Jtwvxg+whLrWUVFMxosjG4OHxiAyK4XH+5rlU+pK8uhYkpVtg== x-ms-office365-filtering-correlation-id: 54743026-e872-437c-4419-08d66759570c x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020); SRVR:VI1PR0402MB3488; x-ms-traffictypediagnostic: VI1PR0402MB3488: x-microsoft-antispam-prvs: x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(3230021)(999002)(5005026)(6040522)(2401047)(8121501046)(3231475)(944501520)(52105112)(93006095)(93001095)(10201501046)(3002001)(6055026)(149066)(150057)(6041310)(20161123558120)(20161123562045)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(201708071742011)(7699051)(76991095); SRVR:VI1PR0402MB3488; BCL:0; PCL:0; RULEID:; SRVR:VI1PR0402MB3488; x-forefront-prvs: 0893636978 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(376002)(39860400002)(366004)(346002)(136003)(396003)(199004)(189003)(6512007)(53936002)(2906002)(71200400001)(71190400001)(86362001)(2201001)(26005)(14444005)(97736004)(256004)(102836004)(6486002)(110136005)(186003)(386003)(68736007)(99286004)(316002)(52116002)(305945005)(446003)(76176011)(36756003)(6116002)(25786009)(11346002)(66066001)(8936002)(105586002)(6436002)(106356001)(2616005)(476003)(54906003)(81166006)(81156014)(14454004)(44832011)(3846002)(6506007)(8676002)(478600001)(5660300001)(486006)(2501003)(4326008)(7736002); DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR0402MB3488; H:VI1PR0402MB2800.eurprd04.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: XLCFTzfgxKKlr2QED8X2sXgwPANQg6N8lAdXDsVdkeICiTZqvzg9XErFXe9zm7RBdhPSe7AmwcjA4VBK8ydM3tEDmHhQZSqqeOdKVGyLupgb1CciZsytD0B1p0PpJjrPG1f+JeIlGSiCs059WwD6ztfvv9uzpg4CR0Uq+5YZBBlvBZiacWWXrDhx0283AhA11FJSseeWxOqeP4tz5SBTGRQ81glMi3Q2G+1L/pWflRBkHdsJ71tQg1bwheZcyZSmx9aF+S8xnM3pJfLOchbxavVtq6mF0fHGGGua7zJdUMEHBJEZtoo/QeaTHuGR2JSp spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 54743026-e872-437c-4419-08d66759570c X-MS-Exchange-CrossTenant-originalarrivaltime: 21 Dec 2018 15:31:13.2175 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0402MB3488 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181221_073130_212613_5FB1D3B6 X-CRM114-Status: GOOD ( 22.11 ) 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: Ioana Ciocoi Radulescu , Roy Pledge , "linux-kernel@vger.kernel.org" , "robh+dt@kernel.org" , Ioana Ciornei , "shawnguo@kernel.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 This patch adds DPAA2 MC and AIOP console log support. The platform driver probes on the "dpaa2-console" device tree node which describes the base firmware address needed in order to infer the start address of both firmware logs: MC and AIOP. It then exports two misc char devices which can be used to dump the needed logs. Signed-off-by: Ioana Ciornei Signed-off-by: Roy Pledge --- drivers/soc/fsl/Kconfig | 10 ++ drivers/soc/fsl/Makefile | 1 + drivers/soc/fsl/dpaa2-console.c | 306 ++++++++++++++++++++++++++++++++++++++++ 3 files changed, 317 insertions(+) create mode 100644 drivers/soc/fsl/dpaa2-console.c diff --git a/drivers/soc/fsl/Kconfig b/drivers/soc/fsl/Kconfig index 8f80e8b..94229a0 100644 --- a/drivers/soc/fsl/Kconfig +++ b/drivers/soc/fsl/Kconfig @@ -28,4 +28,14 @@ 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 DPAA2_CONSOLE + tristate "QorIQ DPAA2 console driver" + depends on OF && (ARCH_LAYERSCAPE || (COMPILE_TEST && (ARM || ARM64 || X86_LOCAL_APIC || PPC))) + default y + help + Console driver for DPAA2 platforms. Exports 2 char devices, + /dev/dpaa2_mc_console and /dev/dpaa2_aiop_console, + which can be used to dump the Management Complex and AIOP + firmware logs. endmenu diff --git a/drivers/soc/fsl/Makefile b/drivers/soc/fsl/Makefile index 803ef1b..57762c9 100644 --- a/drivers/soc/fsl/Makefile +++ b/drivers/soc/fsl/Makefile @@ -7,3 +7,4 @@ obj-$(CONFIG_QUICC_ENGINE) += qe/ obj-$(CONFIG_CPM) += qe/ obj-$(CONFIG_FSL_GUTS) += guts.o obj-$(CONFIG_FSL_MC_DPIO) += dpio/ +obj-$(CONFIG_DPAA2_CONSOLE) += dpaa2-console.o diff --git a/drivers/soc/fsl/dpaa2-console.c b/drivers/soc/fsl/dpaa2-console.c new file mode 100644 index 0000000..b088834 --- /dev/null +++ b/drivers/soc/fsl/dpaa2-console.c @@ -0,0 +1,306 @@ +// SPDX-License-Identifier: (GPL-2.0+ OR BSD-3-Clause) +/* Copyright 2015-2016 Freescale Semiconductor Inc. + * Copyright 2018 NXP + */ + +#define pr_fmt(fmt) "dpaa2-console: " fmt + +#include +#include +#include +#include +#include +#include +#include +#include + +MODULE_LICENSE("Dual BSD/GPL"); +MODULE_AUTHOR("Roy Pledge "); +MODULE_DESCRIPTION("DPAA2 console driver"); + +/* MC firmware base low/high registers indexes */ +#define MCFBALR_OFFSET 0 +#define MCFBAHR_OFFSET 1 + +/* Bit masks used to get the most/least significant part of the MC base addr */ +#define MC_FW_ADDR_MASK_HIGH 0x1FFFF +#define MC_FW_ADDR_MASK_LOW 0xE0000000 + +#define MC_BUFFER_OFFSET 0x01000000 +#define MC_BUFFER_SIZE (1024 * 1024 * 16) +#define MC_OFFSET_DELTA MC_BUFFER_OFFSET + +#define AIOP_BUFFER_OFFSET 0x06000000 +#define AIOP_BUFFER_SIZE (1024 * 1024 * 16) +#define AIOP_OFFSET_DELTA 0 + +#define LOG_HEADER_FLAG_BUFFER_WRAPAROUND 0x80000000 +#define LAST_BYTE(a) ((a) & ~(LOG_HEADER_FLAG_BUFFER_WRAPAROUND)) + +/* MC and AIOP Magic words */ +#define MAGIC_MC 0x4d430100 +#define MAGIC_AIOP 0x41494F50 + +struct log_header { + __le32 magic_word; + char reserved[4]; + __le32 buf_start; + __le32 buf_length; + __le32 last_byte; +}; + +struct console_data { + char *map_addr; + struct log_header *hdr; + char *start_addr; + char *end_addr; + char *end_of_data; + char *cur_ptr; +}; + +struct resource mc_base_addr; + +static inline void adjust_end(struct console_data *cd) +{ + u32 last_byte = readl(&cd->hdr->last_byte); + + cd->end_of_data = cd->start_addr + LAST_BYTE(last_byte); +} + +static u64 get_mc_fw_base_address(void) +{ + u64 mcfwbase = 0ULL; + u32 *mcfbaregs; + + mcfbaregs = (u32 *)ioremap(mc_base_addr.start, + resource_size(&mc_base_addr)); + if (!mcfbaregs) { + pr_err("could not map MC Firmaware Base registers\n"); + return -EIO; + } + + mcfwbase = readl(mcfbaregs + MCFBAHR_OFFSET) & MC_FW_ADDR_MASK_HIGH; + mcfwbase <<= 32; + mcfwbase |= readl(mcfbaregs + MCFBALR_OFFSET) & MC_FW_ADDR_MASK_LOW; + iounmap(mcfbaregs); + + pr_debug("MC base address at 0x%016llx\n", mcfwbase); + return mcfwbase; +} + +static ssize_t dpaa2_console_size(struct console_data *cd) +{ + ssize_t size; + + if (cd->cur_ptr <= cd->end_of_data) + size = cd->end_of_data - cd->cur_ptr; + else + size = (cd->end_addr - cd->cur_ptr) + + (cd->end_of_data - cd->start_addr); + + return size; +} + +static int dpaa2_generic_console_open(struct inode *node, struct file *fp, + u64 offset, u64 size, + u32 expected_magic, + u32 offset_delta) +{ + u32 read_magic, wrapped, last_byte, buf_start, buf_length; + struct console_data *cd; + u64 base_addr; + int err; + + cd = kmalloc(sizeof(*cd), GFP_KERNEL); + if (!cd) + return -ENOMEM; + + base_addr = get_mc_fw_base_address(); + if (base_addr < 0) + return -EIO; + + cd->map_addr = ioremap(base_addr + offset, size); + if (!cd->map_addr) { + pr_err("cannot map console log memory\n"); + err = -EIO; + goto err_ioremap; + } + + cd->hdr = (struct log_header *)cd->map_addr; + read_magic = readl(&cd->hdr->magic_word); + last_byte = readl(&cd->hdr->last_byte); + buf_start = readl(&cd->hdr->buf_start); + buf_length = readl(&cd->hdr->buf_length); + + if (read_magic != expected_magic) { + pr_warn("expected = %08x, read = %08x\n", + expected_magic, read_magic); + err = -EIO; + goto err_magic; + } + + cd->start_addr = cd->map_addr + buf_start - offset_delta; + cd->end_addr = cd->start_addr + buf_length; + + wrapped = last_byte & LOG_HEADER_FLAG_BUFFER_WRAPAROUND; + + adjust_end(cd); + if (wrapped && cd->end_of_data != cd->end_addr) + cd->cur_ptr = cd->end_of_data + 1; + else + cd->cur_ptr = cd->start_addr; + + fp->private_data = cd; + + return 0; + +err_magic: + iounmap(cd->map_addr); + +err_ioremap: + kfree(cd); + + return err; +} + +static int dpaa2_mc_console_open(struct inode *node, struct file *fp) +{ + return dpaa2_generic_console_open(node, fp, + MC_BUFFER_OFFSET, MC_BUFFER_SIZE, + MAGIC_MC, MC_OFFSET_DELTA); +} + +static int dpaa2_aiop_console_open(struct inode *node, struct file *fp) +{ + return dpaa2_generic_console_open(node, fp, + AIOP_BUFFER_OFFSET, AIOP_BUFFER_SIZE, + MAGIC_AIOP, AIOP_OFFSET_DELTA); +} + +static int dpaa2_console_close(struct inode *node, struct file *fp) +{ + struct console_data *cd = fp->private_data; + + iounmap(cd->map_addr); + kfree(cd); + return 0; +} + +static ssize_t dpaa2_console_read(struct file *fp, char __user *buf, + size_t count, loff_t *f_pos) +{ + struct console_data *cd = fp->private_data; + size_t bytes = dpaa2_console_size(cd); + size_t bytes_end = cd->end_addr - cd->cur_ptr; + size_t written = 0; + + /* Check if we need to adjust the end of data addr */ + adjust_end(cd); + + if (cd->end_of_data == cd->cur_ptr) + return 0; + + if (count < bytes) + bytes = count; + + if (bytes > bytes_end) { + if (copy_to_user(buf, cd->cur_ptr, bytes_end)) + return -EFAULT; + buf += bytes_end; + cd->cur_ptr = cd->start_addr; + bytes -= bytes_end; + written += bytes_end; + } + + if (copy_to_user(buf, cd->cur_ptr, bytes)) + return -EFAULT; + cd->cur_ptr += bytes; + written += bytes; + + return written; +} + +static const struct file_operations dpaa2_mc_console_fops = { + .owner = THIS_MODULE, + .open = dpaa2_mc_console_open, + .release = dpaa2_console_close, + .read = dpaa2_console_read, +}; + +static struct miscdevice dpaa2_mc_console_dev = { + .minor = MISC_DYNAMIC_MINOR, + .name = "dpaa2_mc_console", + .fops = &dpaa2_mc_console_fops +}; + +static const struct file_operations dpaa2_aiop_console_fops = { + .owner = THIS_MODULE, + .open = dpaa2_aiop_console_open, + .release = dpaa2_console_close, + .read = dpaa2_console_read, +}; + +static struct miscdevice dpaa2_aiop_console_dev = { + .minor = MISC_DYNAMIC_MINOR, + .name = "dpaa2_aiop_console", + .fops = &dpaa2_aiop_console_fops +}; + +static int dpaa2_console_probe(struct platform_device *pdev) +{ + int error; + + error = of_address_to_resource(pdev->dev.of_node, 0, &mc_base_addr); + if (error < 0) { + pr_err("of_address_to_resource() failed for %pOF with %d\n", + pdev->dev.of_node, error); + return error; + } + + error = misc_register(&dpaa2_mc_console_dev); + if (error) { + pr_err("dpaa2-console: cannot register device %s\n", + dpaa2_mc_console_dev.name); + goto err_register_mc; + } + + error = misc_register(&dpaa2_aiop_console_dev); + if (error) { + pr_err("dpaa2-console: cannot register device %s\n", + dpaa2_aiop_console_dev.name); + goto err_register_aiop; + } + + return 0; + +err_register_aiop: + misc_deregister(&dpaa2_mc_console_dev); +err_register_mc: + return error; +} + +static int dpaa2_console_remove(struct platform_device *pdev) +{ + misc_deregister(&dpaa2_mc_console_dev); + misc_deregister(&dpaa2_aiop_console_dev); + + return 0; +} + +static const struct of_device_id dpaa2_console_match_table[] = { + { .compatible = "dpaa2-console",}, + {}, +}; + +MODULE_DEVICE_TABLE(of, dpaa2_console_match_table); + +static struct platform_driver dpaa2_console_driver = { + .driver = { + .name = "dpaa2-console", + .pm = NULL, + .of_match_table = dpaa2_console_match_table, + }, + .probe = dpaa2_console_probe, + .remove = dpaa2_console_remove, +}; +module_platform_driver(dpaa2_console_driver);