From patchwork Mon Aug 21 23:48:12 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Suman Anna X-Patchwork-Id: 9913955 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id AAFAD603FF for ; Mon, 21 Aug 2017 23:48:54 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9A7231FFB2 for ; Mon, 21 Aug 2017 23:48:54 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8F63923B24; Mon, 21 Aug 2017 23:48:54 +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=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID 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 158541FFB2 for ; Mon, 21 Aug 2017 23:48:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754168AbdHUXsw (ORCPT ); Mon, 21 Aug 2017 19:48:52 -0400 Received: from lelnx193.ext.ti.com ([198.47.27.77]:45841 "EHLO lelnx193.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754015AbdHUXsu (ORCPT ); Mon, 21 Aug 2017 19:48:50 -0400 Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by lelnx193.ext.ti.com (8.15.1/8.15.1) with ESMTP id v7LNmKZ5028079; Mon, 21 Aug 2017 18:48:20 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ti.com; s=ti-com-17Q1; t=1503359301; bh=U99UCTDwiXrTUv+WZDAmfNqlj38dWgCw1fQCsEdw37k=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=AgROb4TD99/tf7QApNfnmeVDJHsz4XaOfirII3d5Bpqe2BzhU0KQLslnGJMPMUCsS 4NgfW8ijpEy/addvEhX0OBjxePXw/J88Q8kHFysNF/JOaKqoIqgRHMJ5mY7bvZuoKi fbQvhu3/ZCgEEjLs7D0jTHfCO9dsFgDwNRz6brcs= Received: from DFLE105.ent.ti.com (dfle105.ent.ti.com [10.64.6.26]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id v7LNmKxF005764; Mon, 21 Aug 2017 18:48:20 -0500 Received: from DFLE104.ent.ti.com (10.64.6.25) by DFLE105.ent.ti.com (10.64.6.26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.1.845.34; Mon, 21 Aug 2017 18:48:20 -0500 Received: from dlep33.itg.ti.com (157.170.170.75) by DFLE104.ent.ti.com (10.64.6.25) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.845.34 via Frontend Transport; Mon, 21 Aug 2017 18:48:20 -0500 Received: from legion.dal.design.ti.com (legion.dal.design.ti.com [128.247.22.53]) by dlep33.itg.ti.com (8.14.3/8.13.8) with ESMTP id v7LNmKfk025298; Mon, 21 Aug 2017 18:48:20 -0500 Received: from localhost (irmo.dhcp.ti.com [128.247.58.153]) by legion.dal.design.ti.com (8.11.7p1+Sun/8.11.7) with ESMTP id v7LNmK307082; Mon, 21 Aug 2017 18:48:20 -0500 (CDT) From: Suman Anna To: Tony Lindgren CC: Paul Walmsley , , , Tero Kristo , Suman Anna Subject: [PATCH 2/8] ARM: DRA7: hwmod data: Add MMU data for DSPs Date: Mon, 21 Aug 2017 18:48:12 -0500 Message-ID: <20170821234818.4755-3-s-anna@ti.com> X-Mailer: git-send-email 2.13.1 In-Reply-To: <20170821234818.4755-1-s-anna@ti.com> References: <20170821234818.4755-1-s-anna@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 Add the data structures for representing the MMUs within the DSP processor subsystems present in DRA7xx/AM57xx SoCs. The DRA7xx family of SoCs usually have one or two DSPs. The DRA74x/DRA76x family has two DSPs, while DRA72x/DRA71x has only a single DSP. Each DSP subsystem has two MMUs, one for the processor core and the other for the internal EDMA block. The hwmod data for the second DSP is only added for DRA74x/DRA76x family of SoCs. Both these MMUs share a common reset line, the MMU on the EDMA port is expected to be mirror-programmed alongside the primary MMU. The reset data is added to both the MMUs to allow the omap_hwmod layer to skip the enabling and idling of these devices, as that would require the reset be released, which is outside the scope of the hwmod core code. The other PRCM data fields are also skipped for both the second MMUs, this will be handled as part of the primary MMU enabling sequence. The pdata quirks will also not be added for the second MMU as the OMAP IOMMU driver releases the reset once and is expected to program both the MMUs together. Signed-off-by: Suman Anna --- arch/arm/mach-omap2/omap_hwmod_7xx_data.c | 109 ++++++++++++++++++++++++++++++ 1 file changed, 109 insertions(+) diff --git a/arch/arm/mach-omap2/omap_hwmod_7xx_data.c b/arch/arm/mach-omap2/omap_hwmod_7xx_data.c index bf55802448ac..63ad0d3217dc 100644 --- a/arch/arm/mach-omap2/omap_hwmod_7xx_data.c +++ b/arch/arm/mach-omap2/omap_hwmod_7xx_data.c @@ -1821,6 +1821,77 @@ static struct omap_hwmod_class dra7xx_mmu_hwmod_class = { .sysc = &dra7xx_mmu_sysc, }; +/* DSP MMUs */ +static struct omap_hwmod_rst_info dra7xx_mmu_dsp_resets[] = { + { .name = "mmu_cache", .rst_shift = 1 }, +}; + +/* mmu0 - dsp1 */ +static struct omap_hwmod dra7xx_mmu0_dsp1_hwmod = { + .name = "mmu0_dsp1", + .class = &dra7xx_mmu_hwmod_class, + .clkdm_name = "dsp1_clkdm", + .rst_lines = dra7xx_mmu_dsp_resets, + .rst_lines_cnt = ARRAY_SIZE(dra7xx_mmu_dsp_resets), + .main_clk = "dpll_dsp_m2_ck", + .prcm = { + .omap4 = { + .clkctrl_offs = DRA7XX_CM_DSP1_DSP1_CLKCTRL_OFFSET, + .rstctrl_offs = DRA7XX_RM_DSP1_RSTCTRL_OFFSET, + .context_offs = DRA7XX_RM_DSP1_DSP1_CONTEXT_OFFSET, + .modulemode = MODULEMODE_HWCTRL, + }, + }, +}; + +/* mmu1 - dsp1 */ +static struct omap_hwmod dra7xx_mmu1_dsp1_hwmod = { + .name = "mmu1_dsp1", + .class = &dra7xx_mmu_hwmod_class, + .clkdm_name = "dsp1_clkdm", + .rst_lines = dra7xx_mmu_dsp_resets, + .rst_lines_cnt = ARRAY_SIZE(dra7xx_mmu_dsp_resets), + .main_clk = "dpll_dsp_m2_ck", + .prcm = { + .omap4 = { + .rstctrl_offs = DRA7XX_RM_DSP1_RSTCTRL_OFFSET, + }, + }, +}; + +/* mmu0 - dsp2 */ +static struct omap_hwmod dra7xx_mmu0_dsp2_hwmod = { + .name = "mmu0_dsp2", + .class = &dra7xx_mmu_hwmod_class, + .clkdm_name = "dsp2_clkdm", + .rst_lines = dra7xx_mmu_dsp_resets, + .rst_lines_cnt = ARRAY_SIZE(dra7xx_mmu_dsp_resets), + .main_clk = "dpll_dsp_m2_ck", + .prcm = { + .omap4 = { + .clkctrl_offs = DRA7XX_CM_DSP2_DSP2_CLKCTRL_OFFSET, + .rstctrl_offs = DRA7XX_RM_DSP2_RSTCTRL_OFFSET, + .context_offs = DRA7XX_RM_DSP2_DSP2_CONTEXT_OFFSET, + .modulemode = MODULEMODE_HWCTRL, + }, + }, +}; + +/* mmu1 - dsp2 */ +static struct omap_hwmod dra7xx_mmu1_dsp2_hwmod = { + .name = "mmu1_dsp2", + .class = &dra7xx_mmu_hwmod_class, + .clkdm_name = "dsp2_clkdm", + .rst_lines = dra7xx_mmu_dsp_resets, + .rst_lines_cnt = ARRAY_SIZE(dra7xx_mmu_dsp_resets), + .main_clk = "dpll_dsp_m2_ck", + .prcm = { + .omap4 = { + .rstctrl_offs = DRA7XX_RM_DSP2_RSTCTRL_OFFSET, + }, + }, +}; + /* IPU MMUs */ static struct omap_hwmod_rst_info dra7xx_mmu_ipu_resets[] = { { .name = "mmu_cache", .rst_shift = 2 }, @@ -2964,6 +3035,38 @@ static struct omap_hwmod_ocp_if dra7xx_l3_main_1__l4_cfg = { .user = OCP_USER_MPU | OCP_USER_SDMA, }; +/* l3_main_1 -> mmu0_dsp1 */ +static struct omap_hwmod_ocp_if dra7xx_l3_main_1__mmu0_dsp1 = { + .master = &dra7xx_l3_main_1_hwmod, + .slave = &dra7xx_mmu0_dsp1_hwmod, + .clk = "l3_iclk_div", + .user = OCP_USER_MPU | OCP_USER_SDMA, +}; + +/* l3_main_1 -> mmu1_dsp1 */ +static struct omap_hwmod_ocp_if dra7xx_l3_main_1__mmu1_dsp1 = { + .master = &dra7xx_l3_main_1_hwmod, + .slave = &dra7xx_mmu1_dsp1_hwmod, + .clk = "l3_iclk_div", + .user = OCP_USER_MPU | OCP_USER_SDMA, +}; + +/* l3_main_1 -> mmu0_dsp2 */ +static struct omap_hwmod_ocp_if dra7xx_l3_main_1__mmu0_dsp2 = { + .master = &dra7xx_l3_main_1_hwmod, + .slave = &dra7xx_mmu0_dsp2_hwmod, + .clk = "l3_iclk_div", + .user = OCP_USER_MPU | OCP_USER_SDMA, +}; + +/* l3_main_1 -> mmu1_dsp2 */ +static struct omap_hwmod_ocp_if dra7xx_l3_main_1__mmu1_dsp2 = { + .master = &dra7xx_l3_main_1_hwmod, + .slave = &dra7xx_mmu1_dsp2_hwmod, + .clk = "l3_iclk_div", + .user = OCP_USER_MPU | OCP_USER_SDMA, +}; + /* l3_main_1 -> mmu_ipu1 */ static struct omap_hwmod_ocp_if dra7xx_l3_main_1__mmu_ipu1 = { .master = &dra7xx_l3_main_1_hwmod, @@ -4089,6 +4192,8 @@ static struct omap_hwmod_ocp_if *dra7xx_hwmod_ocp_ifs[] __initdata = { &dra7xx_l4_per1__mmc2, &dra7xx_l4_per1__mmc3, &dra7xx_l4_per1__mmc4, + &dra7xx_l3_main_1__mmu0_dsp1, + &dra7xx_l3_main_1__mmu1_dsp1, &dra7xx_l3_main_1__mmu_ipu1, &dra7xx_l3_main_1__mmu_ipu2, &dra7xx_l4_cfg__mpu, @@ -4153,11 +4258,15 @@ static struct omap_hwmod_ocp_if *dra7xx_gp_hwmod_ocp_ifs[] __initdata = { /* SoC variant specific hwmod links */ static struct omap_hwmod_ocp_if *dra76x_hwmod_ocp_ifs[] __initdata = { &dra7xx_l4_per3__usb_otg_ss4, + &dra7xx_l3_main_1__mmu0_dsp2, + &dra7xx_l3_main_1__mmu1_dsp2, NULL, }; static struct omap_hwmod_ocp_if *dra74x_hwmod_ocp_ifs[] __initdata = { &dra7xx_l4_per3__usb_otg_ss4, + &dra7xx_l3_main_1__mmu0_dsp2, + &dra7xx_l3_main_1__mmu1_dsp2, NULL, };