From patchwork Mon Feb 4 15:53:54 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roger Quadros X-Patchwork-Id: 10796005 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 5DB8E13B5 for ; Mon, 4 Feb 2019 15:55:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 47E4B2B706 for ; Mon, 4 Feb 2019 15:55:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 371112B941; Mon, 4 Feb 2019 15:55:06 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C54D02B706 for ; Mon, 4 Feb 2019 15:55:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728942AbfBDPzE (ORCPT ); Mon, 4 Feb 2019 10:55:04 -0500 Received: from fllv0016.ext.ti.com ([198.47.19.142]:58638 "EHLO fllv0016.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728760AbfBDPzE (ORCPT ); Mon, 4 Feb 2019 10:55:04 -0500 Received: from lelv0266.itg.ti.com ([10.180.67.225]) by fllv0016.ext.ti.com (8.15.2/8.15.2) with ESMTP id x14Fs8kW050028; Mon, 4 Feb 2019 09:54:08 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1549295648; bh=7XIKbA+SuSh0yU8UNFz9F69GDO1qdn7kJ4Z9VhkYcm0=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=gvNp3Ad7jd2B9xzO4DNmzj6mK7beaWPj+TD7EsMzBsbincJwi7oer/2L+EwWFQLfv /xTmukgxgy1RZP0TgGi4c8rFFb6LrYM31C3vmH5EnAFhnDcyyJZBVVPFt5LIrsiVvm WLBEkJTHYMVrIFoJsn9hxM+amX/P0AD00+zK+BVk= Received: from DLEE115.ent.ti.com (dlee115.ent.ti.com [157.170.170.26]) by lelv0266.itg.ti.com (8.15.2/8.15.2) with ESMTPS id x14Fs8jH040312 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 4 Feb 2019 09:54:08 -0600 Received: from DLEE106.ent.ti.com (157.170.170.36) by DLEE115.ent.ti.com (157.170.170.26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10; Mon, 4 Feb 2019 09:54:08 -0600 Received: from dflp33.itg.ti.com (10.64.6.16) by DLEE106.ent.ti.com (157.170.170.36) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1591.10 via Frontend Transport; Mon, 4 Feb 2019 09:54:08 -0600 Received: from localhost.localdomain (ileax41-snat.itg.ti.com [10.172.224.153]) by dflp33.itg.ti.com (8.14.3/8.13.8) with ESMTP id x14Fs1mM012077; Mon, 4 Feb 2019 09:54:05 -0600 From: Roger Quadros To: CC: , , , , , , , , , , , Roger Quadros Subject: [PATCH 1/4] dt-binding: bus: ti-sysc: Add support for PRUSS SYSC type Date: Mon, 4 Feb 2019 17:53:54 +0200 Message-ID: <1549295637-24890-2-git-send-email-rogerq@ti.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1549295637-24890-1-git-send-email-rogerq@ti.com> References: <1549295637-24890-1-git-send-email-rogerq@ti.com> MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The PRUSS module has a SYSCFG which is unique. Add support for it. Signed-off-by: Roger Quadros --- Documentation/devicetree/bindings/bus/ti-sysc.txt | 1 + include/dt-bindings/bus/ti-sysc.h | 11 +++++++++++ 2 files changed, 12 insertions(+) diff --git a/Documentation/devicetree/bindings/bus/ti-sysc.txt b/Documentation/devicetree/bindings/bus/ti-sysc.txt index 85a23f5..fe1dfb1 100644 --- a/Documentation/devicetree/bindings/bus/ti-sysc.txt +++ b/Documentation/devicetree/bindings/bus/ti-sysc.txt @@ -38,6 +38,7 @@ Required standard properties: "ti,sysc-dra7-mcasp" "ti,sysc-usb-host-fs" "ti,sysc-dra7-mcan" + "ti,sysc-pruss" - reg shall have register areas implemented for the interconnect target module in question such as revision, sysc and syss diff --git a/include/dt-bindings/bus/ti-sysc.h b/include/dt-bindings/bus/ti-sysc.h index 7138384..8ec78e8 100644 --- a/include/dt-bindings/bus/ti-sysc.h +++ b/include/dt-bindings/bus/ti-sysc.h @@ -17,6 +17,17 @@ #define SYSC_DRA7_MCAN_ENAWAKEUP (1 << 4) +/* SYSCONFIG specific to PRUSS */ +#define SYSC_PRUSS_SUB_MWAIT (1 << 5) +#define SYSC_PRUSS_STANDBY_INIT (1 << 4) + +#define SYSC_PRUSS_STANDBY_FORCE (0 << 2) +#define SYSC_PRUSS_STANDBY_NO (1 << 2) +#define SYSC_PRUSS_STANDBY_SMART (2 << 2) +#define SYSC_PRUSS_STANDBY_MASK (3 << 2) + +#define SYSC_PRUSS_IDLE_MASK 3 + /* SYSCONFIG STANDBYMODE/MIDLEMODE/SIDLEMODE supported by hardware */ #define SYSC_IDLE_FORCE 0 #define SYSC_IDLE_NO 1 From patchwork Mon Feb 4 15:53:55 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roger Quadros X-Patchwork-Id: 10796017 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 DB09113B5 for ; Mon, 4 Feb 2019 15:57:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C77BB2B929 for ; Mon, 4 Feb 2019 15:57:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BAD6A2B99D; Mon, 4 Feb 2019 15:57:06 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 334222B929 for ; Mon, 4 Feb 2019 15:57:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731569AbfBDP5F (ORCPT ); Mon, 4 Feb 2019 10:57:05 -0500 Received: from fllv0015.ext.ti.com ([198.47.19.141]:58004 "EHLO fllv0015.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731564AbfBDP5F (ORCPT ); Mon, 4 Feb 2019 10:57:05 -0500 Received: from fllv0035.itg.ti.com ([10.64.41.0]) by fllv0015.ext.ti.com (8.15.2/8.15.2) with ESMTP id x14FsClj058478; Mon, 4 Feb 2019 09:54:12 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1549295652; bh=sRfewLSOCmw7X5qCkG4/3mIaDUuGix6nNN9Q8VQTNZM=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=ikogvVIeA3JC9x0NIyrI7heL35FKKtW68Wzv7wehJbObbgbFK5Wur8uLWZ5L6xGNx apelH7Ln4bZerE3iwWsfdzThxtipE1iGqj8gwZaKzqLcNU0q/RsZOe0irXWyQi6PZF k8hIRZFyc9iMNqg6Sxvw5k9pw/WnhbE/hm8bPuWg= Received: from DLEE104.ent.ti.com (dlee104.ent.ti.com [157.170.170.34]) by fllv0035.itg.ti.com (8.15.2/8.15.2) with ESMTPS id x14FsBJt087388 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 4 Feb 2019 09:54:12 -0600 Received: from DLEE100.ent.ti.com (157.170.170.30) by DLEE104.ent.ti.com (157.170.170.34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10; Mon, 4 Feb 2019 09:54:11 -0600 Received: from dflp33.itg.ti.com (10.64.6.16) by DLEE100.ent.ti.com (157.170.170.30) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1591.10 via Frontend Transport; Mon, 4 Feb 2019 09:54:11 -0600 Received: from localhost.localdomain (ileax41-snat.itg.ti.com [10.172.224.153]) by dflp33.itg.ti.com (8.14.3/8.13.8) with ESMTP id x14Fs1mN012077; Mon, 4 Feb 2019 09:54:08 -0600 From: Roger Quadros To: CC: , , , , , , , , , , , Roger Quadros Subject: [PATCH 2/4] bus: ti-sysc: Add support for PRUSS SYSC type Date: Mon, 4 Feb 2019 17:53:55 +0200 Message-ID: <1549295637-24890-3-git-send-email-rogerq@ti.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1549295637-24890-1-git-send-email-rogerq@ti.com> References: <1549295637-24890-1-git-send-email-rogerq@ti.com> MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The PRUSS module has a SYSCFG which is unique. Add support for it. Signed-off-by: Roger Quadros --- drivers/bus/ti-sysc.c | 77 +++++++++++++++++++++++++++++++++++ include/dt-bindings/bus/ti-sysc.h | 11 ----- include/linux/platform_data/ti-sysc.h | 1 + 3 files changed, 78 insertions(+), 11 deletions(-) diff --git a/drivers/bus/ti-sysc.c b/drivers/bus/ti-sysc.c index f94d335..5b9c81a 100644 --- a/drivers/bus/ti-sysc.c +++ b/drivers/bus/ti-sysc.c @@ -622,6 +622,50 @@ static void sysc_show_registers(struct sysc *ddata) buf); } +static int sysc_enable_pruss(struct sysc *sysc) +{ + int i; + u32 reg; + bool ready; + + /* configure for Smart Idle & Smart Standby */ + reg = sysc_read(sysc, sysc->offsets[SYSC_SYSCONFIG]); + reg &= ~(SYSC_PRUSS_STANDBY_MASK | SYSC_PRUSS_IDLE_MASK); + reg |= SYSC_PRUSS_STANDBY_SMART | SYSC_IDLE_SMART; + sysc_write(sysc, sysc->offsets[SYSC_SYSCONFIG], reg); + + /* bring out of Standby */ + reg = sysc_read(sysc, sysc->offsets[SYSC_SYSCONFIG]); + reg &= ~SYSC_PRUSS_STANDBY_INIT; + sysc_write(sysc, sysc->offsets[SYSC_SYSCONFIG], reg); + + /* wait till we are ready for transactions - delay is arbitrary */ + for (i = 0; i < 10; i++) { + reg = sysc_read(sysc, sysc->offsets[SYSC_SYSCONFIG]); + ready = !(reg & SYSC_PRUSS_SUB_MWAIT); + if (ready) + break; + udelay(5); + } + + if (!ready) { + dev_err(sysc->dev, "not ready for transaction\n"); + return -ETIMEDOUT; + } + + return 0; +} + +static void sysc_disable_pruss(struct sysc *sysc) +{ + u32 reg; + + /* initiate Standby */ + reg = sysc_read(sysc, sysc->offsets[SYSC_SYSCONFIG]); + reg |= SYSC_PRUSS_STANDBY_INIT; + sysc_write(sysc, sysc->offsets[SYSC_SYSCONFIG], reg); +} + static int __maybe_unused sysc_runtime_suspend(struct device *dev) { struct ti_sysc_platform_data *pdata; @@ -649,6 +693,9 @@ static int __maybe_unused sysc_runtime_suspend(struct device *dev) goto idled; } + if (ddata->cap->type == TI_SYSC_PRUSS) + sysc_disable_pruss(ddata); + for (i = 0; i < ddata->nr_clocks; i++) { if (IS_ERR_OR_NULL(ddata->clocks[i])) continue; @@ -704,6 +751,9 @@ static int __maybe_unused sysc_runtime_resume(struct device *dev) return error; } + if (ddata->cap->type == TI_SYSC_PRUSS) + sysc_enable_pruss(ddata); + awake: ddata->enabled = true; @@ -1573,6 +1623,26 @@ static const struct sysc_capabilities sysc_dra7_mcan = { .regbits = &sysc_regbits_dra7_mcan, }; +/* + * PRUSS on AM33x and later + */ +static const struct sysc_regbits sysc_regbits_pruss = { + .midle_shift = -ENODEV, + .clkact_shift = -ENODEV, + .sidle_shift = -ENODEV, + .enwkup_shift = -ENODEV, + .srst_shift = -ENODEV, + .autoidle_shift = -ENODEV, + .dmadisable_shift = -ENODEV, + .emufree_shift = -ENODEV, +}; + +static const struct sysc_capabilities sysc_pruss = { + .type = TI_SYSC_PRUSS, + .sysc_mask = SYSC_PRUSS_STANDBY_INIT | SYSC_PRUSS_SUB_MWAIT, + .regbits = &sysc_regbits_pruss, +}; + static int sysc_init_pdata(struct sysc *ddata) { struct ti_sysc_platform_data *pdata = dev_get_platdata(ddata->dev); @@ -1702,6 +1772,10 @@ static int sysc_probe(struct platform_device *pdev) INIT_DELAYED_WORK(&ddata->idle_work, ti_sysc_idle); + /* FIXME: how to ensure PRUSS stays enabled? */ + if (ddata->cap->type == TI_SYSC_PRUSS) + goto skip_pm_put; + /* At least earlycon won't survive without deferred idle */ if (ddata->cfg.quirks & (SYSC_QUIRK_NO_IDLE_ON_INIT | SYSC_QUIRK_NO_RESET_ON_INIT)) { @@ -1710,6 +1784,8 @@ static int sysc_probe(struct platform_device *pdev) pm_runtime_put(&pdev->dev); } +skip_pm_put: + if (!of_get_available_child_count(ddata->dev->of_node)) reset_control_assert(ddata->rsts); @@ -1766,6 +1842,7 @@ static const struct of_device_id sysc_match[] = { { .compatible = "ti,sysc-usb-host-fs", .data = &sysc_omap4_usb_host_fs, }, { .compatible = "ti,sysc-dra7-mcan", .data = &sysc_dra7_mcan, }, + { .compatible = "ti,sysc-pruss", .data = &sysc_pruss, }, { }, }; MODULE_DEVICE_TABLE(of, sysc_match); diff --git a/include/dt-bindings/bus/ti-sysc.h b/include/dt-bindings/bus/ti-sysc.h index 8ec78e8..7138384 100644 --- a/include/dt-bindings/bus/ti-sysc.h +++ b/include/dt-bindings/bus/ti-sysc.h @@ -17,17 +17,6 @@ #define SYSC_DRA7_MCAN_ENAWAKEUP (1 << 4) -/* SYSCONFIG specific to PRUSS */ -#define SYSC_PRUSS_SUB_MWAIT (1 << 5) -#define SYSC_PRUSS_STANDBY_INIT (1 << 4) - -#define SYSC_PRUSS_STANDBY_FORCE (0 << 2) -#define SYSC_PRUSS_STANDBY_NO (1 << 2) -#define SYSC_PRUSS_STANDBY_SMART (2 << 2) -#define SYSC_PRUSS_STANDBY_MASK (3 << 2) - -#define SYSC_PRUSS_IDLE_MASK 3 - /* SYSCONFIG STANDBYMODE/MIDLEMODE/SIDLEMODE supported by hardware */ #define SYSC_IDLE_FORCE 0 #define SYSC_IDLE_NO 1 diff --git a/include/linux/platform_data/ti-sysc.h b/include/linux/platform_data/ti-sysc.h index 1ea3aab..56098e7 100644 --- a/include/linux/platform_data/ti-sysc.h +++ b/include/linux/platform_data/ti-sysc.h @@ -15,6 +15,7 @@ enum ti_sysc_module_type { TI_SYSC_OMAP4_MCASP, TI_SYSC_OMAP4_USB_HOST_FS, TI_SYSC_DRA7_MCAN, + TI_SYSC_PRUSS, }; struct ti_sysc_cookie { From patchwork Mon Feb 4 15:53:56 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roger Quadros X-Patchwork-Id: 10796009 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 8D4626C2 for ; Mon, 4 Feb 2019 15:55:15 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 79A302B929 for ; Mon, 4 Feb 2019 15:55:15 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6D4512B99D; Mon, 4 Feb 2019 15:55:15 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B2F9B2B929 for ; Mon, 4 Feb 2019 15:55:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729614AbfBDPzI (ORCPT ); Mon, 4 Feb 2019 10:55:08 -0500 Received: from lelv0143.ext.ti.com ([198.47.23.248]:37316 "EHLO lelv0143.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728291AbfBDPzF (ORCPT ); Mon, 4 Feb 2019 10:55:05 -0500 Received: from lelv0265.itg.ti.com ([10.180.67.224]) by lelv0143.ext.ti.com (8.15.2/8.15.2) with ESMTP id x14FsFBf070399; Mon, 4 Feb 2019 09:54:15 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1549295655; bh=6FrKqDbSMoNVkUUaesse/Kx/d9p17JD+XnpCc17GwSU=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=gPv36YFfM5oWwpjnSmMNmQYTBSYt5NnoLnH/w7WdB7gdqPPT4JK/F29DXdoKQLVmz pAnPwdPVv3Ge6cRTgc9nv65D8tARRO7+ITnaHEME5EvAlOLWSQ/5YIrB/WWZaRUQgv /BPUqsiBquMAULTdYA50xbhq4uzGoItolKErDqpo= Received: from DFLE108.ent.ti.com (dfle108.ent.ti.com [10.64.6.29]) by lelv0265.itg.ti.com (8.15.2/8.15.2) with ESMTPS id x14FsFnF019128 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 4 Feb 2019 09:54:15 -0600 Received: from DFLE110.ent.ti.com (10.64.6.31) by DFLE108.ent.ti.com (10.64.6.29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10; Mon, 4 Feb 2019 09:54:14 -0600 Received: from dflp33.itg.ti.com (10.64.6.16) by DFLE110.ent.ti.com (10.64.6.31) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1591.10 via Frontend Transport; Mon, 4 Feb 2019 09:54:14 -0600 Received: from localhost.localdomain (ileax41-snat.itg.ti.com [10.172.224.153]) by dflp33.itg.ti.com (8.14.3/8.13.8) with ESMTP id x14Fs1mO012077; Mon, 4 Feb 2019 09:54:11 -0600 From: Roger Quadros To: CC: , , , , , , , , , , , Roger Quadros Subject: [PATCH 3/4] ARM: dts: dra7: add PRU-ICSS modules Date: Mon, 4 Feb 2019 17:53:56 +0200 Message-ID: <1549295637-24890-4-git-send-email-rogerq@ti.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1549295637-24890-1-git-send-email-rogerq@ti.com> References: <1549295637-24890-1-git-send-email-rogerq@ti.com> MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Suman Anna Add the DT nodes for the PRU-ICSS1 and PRU-ICSS2 processor subsystems that are present on AM57xx family of SoCs. Each PRU-ICSS instance is represented by a pruss-soc-bus node and a child PRUSS subsystem node. The two PRU-ICSSs are identical to each other. They are not supported on DRA7xx SoCs in general, so the nodes are added in disabled state to the common dra7 DTS file. They should be enabled only in the AM57xx related board files. The PRU-ICSSs on AM57xx are very similar to the PRUSS in AM33xx and AM437x except for variations in the RAM sizes and the number of interrupts coming into the MPU INTC. The interrupt events into the PRU-ICSS also requires programming of the corresponding crossbars properly. The default names for the firmware images for each PRU core are defined as follows (these can be adjusted either in derivative board dts files or through sysfs at runtime if required): PRU-ICSS1 PRU0 Core: am57xx-pru1_0-fw PRU-ICSS1 PRU1 Core: am57xx-pru1_1-fw PRU-ICSS2 PRU0 Core: am57xx-pru2_0-fw PRU-ICSS2 PRU1 Core: am57xx-pru2_1-fw Two PRU system events "vring" and "kick" have been added to each PRU node in each of the PRU-ICSS1 and PRU-ICSS2 remote processor subsystems to enable the virtio/rpmsg communication between MPU and that PRU core. The PRU system events is the preferred approach over using OMAP mailboxes, as it eliminates an external peripheral access from the PRU-side, and keeps the interrupt generation internal to the PRUSS. The difference from MPU would be minimal in using one versus the other. Mailboxes can still be used if desired. Either approach would require that an appropriate firmware image is loaded/booted on the PRU. Signed-off-by: Suman Anna Signed-off-by: Roger Quadros --- arch/arm/boot/dts/dra7.dtsi | 194 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 194 insertions(+) diff --git a/arch/arm/boot/dts/dra7.dtsi b/arch/arm/boot/dts/dra7.dtsi index 2bc9add..2458e7a 100644 --- a/arch/arm/boot/dts/dra7.dtsi +++ b/arch/arm/boot/dts/dra7.dtsi @@ -167,6 +167,200 @@ l4_per3: interconnect@48800000 { }; + pru_icss1: target-module@4b200000 { + compatible = "ti,sysc-pruss", "ti,sysc"; + reg = <0x4b226000 0x4>, + <0x4b226004 0x4>; + reg-names = "rev", "sysc"; + ti,no-reset-on-init; + /* Domains (P, C): coreaon_pwrdm, l4per2_clkdm */ + clocks = <&l4per2_clkctrl DRA7_L4PER2_PRUSS1_CLKCTRL 0>; + clock-names = "fck"; + #address-cells = <1>; + #size-cells = <1>; + ranges = <0x00000000 0x4b200000 0x20000000>; + + pruss1: pruss@4b200000 { + compatible = "ti,am5728-pruss"; + reg = <0x0000 0x2000>, + <0x2000 0x2000>, + <0x10000 0x8000>; + reg-names = "dram0", "dram1", + "shrdram2"; + #address-cells = <1>; + #size-cells = <1>; + ranges; + + pruss1_cfg: cfg@26000 { + compatible = "syscon"; + reg = <0x26000 0x2000>; + }; + + pruss1_iep: iep@2e000 { + compatible = "syscon"; + reg = <0x2e000 0x31c>; + }; + + pruss1_mii_rt: mii_rt@32000 { + compatible = "syscon"; + reg = <0x32000 0x58>; + }; + + pruss1_intc: intc@20000 { + compatible = "ti,am5728-pruss-intc"; + reg = <0x20000 0x2000>; + reg-names = "intc"; + interrupt-controller; + #interrupt-cells = <1>; + interrupts = , + , + , + , + , + , + , + ; + interrupt-names = "host2", "host3", "host4", + "host5", "host6", "host7", + "host8", "host9"; + }; + + pru1_0: pru@34000 { + compatible = "ti,am5728-pru"; + reg = <0x34000 0x3000>, + <0x22000 0x400>, + <0x22400 0x100>; + reg-names = "iram", "control", "debug"; + gpcfg = <&pruss1_cfg 0x8>; + firmware-name = "am57xx-pru1_0-fw"; + interrupt-parent = <&pruss1_intc>; + interrupts = <16>, <17>; + interrupt-names = "vring", "kick"; + }; + + pru1_1: pru@38000 { + compatible = "ti,am5728-pru"; + reg = <0x38000 0x3000>, + <0x24000 0x400>, + <0x24400 0x100>; + reg-names = "iram", "control", "debug"; + gpcfg = <&pruss1_cfg 0xc>; + firmware-name = "am57xx-pru1_1-fw"; + interrupt-parent = <&pruss1_intc>; + interrupts = <18>, <19>; + interrupt-names = "vring", "kick"; + }; + + pruss1_mdio: mdio@32400 { + compatible = "ti,davinci_mdio"; + reg = <0x32400 0x90>; + #address-cells = <1>; + #size-cells = <0>; + clocks = <&dpll_gmac_h13x2_ck>; + clock-names = "fck"; + bus_freq = <1000000>; + status = "disabled"; + }; + }; + }; + + pru_icss2: target_module@4b280000 { + compatible = "ti,sysc-pruss", "ti,sysc"; + reg = <0x4b2a6000 0x4>, + <0x4b2a6004 0x4>; + reg-names = "rev", "sysc"; + ti,no-reset-on-init; + /* Domains (P, C): coreaon_pwrdm, l4per2_clkdm */ + clocks = <&l4per2_clkctrl DRA7_L4PER2_PRUSS2_CLKCTRL 0>; + clock-names = "fck"; + #address-cells = <1>; + #size-cells = <1>; + ranges = <0x00000000 0x4b280000 0x20000000>; + + pruss2: pruss@4b280000 { + compatible = "ti,am5728-pruss"; + reg = <0 0x2000>, + <0x2000 0x2000>, + <0x10000 0x8000>; + reg-names = "dram0", "dram1", + "shrdram2"; + #address-cells = <1>; + #size-cells = <1>; + ranges; + + pruss2_cfg: cfg@26000 { + compatible = "syscon"; + reg = <0x26000 0x2000>; + }; + + pruss2_iep: iep@2e000 { + compatible = "syscon"; + reg = <0x2e000 0x31c>; + }; + + pruss2_mii_rt: mii_rt@32000 { + compatible = "syscon"; + reg = <0x32000 0x58>; + }; + + pruss2_intc: intc@20000 { + compatible = "ti,am5728-pruss-intc"; + reg = <0x20000 0x2000>; + reg-names = "intc"; + interrupt-controller; + #interrupt-cells = <1>; + interrupts = , + , + , + , + , + , + , + ; + interrupt-names = "host2", "host3", "host4", + "host5", "host6", "host7", + "host8", "host9"; + }; + + pru2_0: pru@34000 { + compatible = "ti,am5728-pru"; + reg = <0x34000 0x3000>, + <0x22000 0x400>, + <0x22400 0x100>; + reg-names = "iram", "control", "debug"; + gpcfg = <&pruss2_cfg 0x8>; + firmware-name = "am57xx-pru2_0-fw"; + interrupt-parent = <&pruss2_intc>; + interrupts = <16>, <17>; + interrupt-names = "vring", "kick"; + }; + + pru2_1: pru@38000 { + compatible = "ti,am5728-pru"; + reg = <0x38000 0x3000>, + <0x24000 0x400>, + <0x24400 0x100>; + reg-names = "iram", "control", "debug"; + gpcfg = <&pruss2_cfg 0xc>; + firmware-name = "am57xx-pru2_1-fw"; + interrupt-parent = <&pruss2_intc>; + interrupts = <18>, <19>; + interrupt-names = "vring", "kick"; + }; + + pruss2_mdio: mdio@32400 { + compatible = "ti,davinci_mdio"; + reg = <0x32400 0x90>; + #address-cells = <1>; + #size-cells = <0>; + clocks = <&dpll_gmac_h13x2_ck>; + clock-names = "fck"; + bus_freq = <1000000>; + status = "disabled"; + }; + }; + }; + axi@0 { compatible = "simple-bus"; #size-cells = <1>; From patchwork Mon Feb 4 15:53:57 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roger Quadros X-Patchwork-Id: 10796011 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 9A96B13B5 for ; Mon, 4 Feb 2019 15:55:16 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 880342B941 for ; Mon, 4 Feb 2019 15:55:16 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7BAA02BA7B; Mon, 4 Feb 2019 15:55:16 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1067D2B941 for ; Mon, 4 Feb 2019 15:55:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728252AbfBDPzP (ORCPT ); Mon, 4 Feb 2019 10:55:15 -0500 Received: from lelv0142.ext.ti.com ([198.47.23.249]:46378 "EHLO lelv0142.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728760AbfBDPzO (ORCPT ); Mon, 4 Feb 2019 10:55:14 -0500 Received: from fllv0034.itg.ti.com ([10.64.40.246]) by lelv0142.ext.ti.com (8.15.2/8.15.2) with ESMTP id x14FsMGq119417; Mon, 4 Feb 2019 09:54:22 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1549295662; bh=BiXMQuMZ9eiNysfRIHNum8sRRwJ1Hp4E3fwt8m4C9Ww=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=NVAj96SuPPmLr+hnpwmLPHpqX9vHHSuFc7tkFW6m4JY53WK2RiuZJ2uc1RP4GlZUZ OTPWPz3dLUaaSQ5T0nN18HMNZEw/kXhxa5JeJpoMvOPUQ7YKUxs/6CYvo5+by93e2m oxpG9Nen5tgiBlXkC4A+7SyZgOeFTydt5oBIqPhE= Received: from DLEE110.ent.ti.com (dlee110.ent.ti.com [157.170.170.21]) by fllv0034.itg.ti.com (8.15.2/8.15.2) with ESMTPS id x14FsM8W112040 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 4 Feb 2019 09:54:22 -0600 Received: from DLEE110.ent.ti.com (157.170.170.21) by DLEE110.ent.ti.com (157.170.170.21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10; Mon, 4 Feb 2019 09:54:17 -0600 Received: from dflp33.itg.ti.com (10.64.6.16) by DLEE110.ent.ti.com (157.170.170.21) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1591.10 via Frontend Transport; Mon, 4 Feb 2019 09:54:17 -0600 Received: from localhost.localdomain (ileax41-snat.itg.ti.com [10.172.224.153]) by dflp33.itg.ti.com (8.14.3/8.13.8) with ESMTP id x14Fs1mP012077; Mon, 4 Feb 2019 09:54:14 -0600 From: Roger Quadros To: CC: , , , , , , , , , , , Roger Quadros Subject: [PATCH 4/4] ARM: dts: am57xx-idk-common: Enable PRU-ICSS nodes Date: Mon, 4 Feb 2019 17:53:57 +0200 Message-ID: <1549295637-24890-5-git-send-email-rogerq@ti.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1549295637-24890-1-git-send-email-rogerq@ti.com> References: <1549295637-24890-1-git-send-email-rogerq@ti.com> MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Suman Anna The two PRU-ICSS processor subsystem bus nodes and their corresponding subsystem nodes were left in disabled state in the base dra7.dts file. The PRU-ICSSs are supported on only the AM57xx SoCs, so enable these nodes (both PRU-ICSS1 and PRU-ICSS2 instances) to support them on all the AM571x, AM572x and AM574x IDK boards. The PRU nodes are already enabled in the base dts file, and so become effective automatically with the enabling of these PRU-ICSS nodes. The corresponding PRU nodes can be disabled later on if there are no use-cases defined to use a particular PRU core or the whole PRU-ICSS subsystem itself if both its PRU cores are unused. Signed-off-by: Suman Anna Signed-off-by: Roger Quadros --- arch/arm/boot/dts/am57xx-idk-common.dtsi | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/arch/arm/boot/dts/am57xx-idk-common.dtsi b/arch/arm/boot/dts/am57xx-idk-common.dtsi index f7bd264..6991412 100644 --- a/arch/arm/boot/dts/am57xx-idk-common.dtsi +++ b/arch/arm/boot/dts/am57xx-idk-common.dtsi @@ -492,3 +492,11 @@ &cpu0 { vdd-supply = <&smps12_reg>; }; + +&pruss1 { + status = "okay"; +}; + +&pruss2 { + status = "okay"; +};