From patchwork Thu Dec 12 13:05:37 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tero Kristo X-Patchwork-Id: 181472 Delivered-To: patch@linaro.org Received: by 2002:ac9:44c4:0:0:0:0:0 with SMTP id t4csp744101och; Thu, 12 Dec 2019 05:06:26 -0800 (PST) X-Google-Smtp-Source: APXvYqy0nhd17yJYrRl4dug2SfFW8hybndEGraItREtba1+a4Y8tqeMx0wzIPbNMhrh1Lfx4VaZq X-Received: by 2002:a05:6808:b1c:: with SMTP id s28mr5076933oij.2.1576155986795; Thu, 12 Dec 2019 05:06:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576155986; cv=none; d=google.com; s=arc-20160816; b=BsJtX8Pa86nBp3WBo1RfvGAWo2v3xZpQp8iewd39PK+Jhy1syD4wnWxfB4lcm5K2w6 SH1RReGdHdk3opD8aIxcwMqRtRC68o0A40uX/qYzoec8ZWS+pue1F03btYGFOpjmRRQx v6SiJsnVMHooMLPVM8erIy2PWjDoZHxb8Z/JXVb4K43sh53lALdBKlXqZyMvr/2jY+VN U1j+aAHNeWw89QUIQfhcm7FVAa0L443QkAza3Cg7BPj1UPWpInnhOZxEu9LBRxaqK2WW WIchTYn3/647IHWqV9YhkFfpvmWvCejM+uWbbu2zcyaJFDDBDeESHHaV8G9xa0OaDVpM v67Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=uFUNbB1DEpEuyWqLCJZY6Li5FRxlCr7qLzhPkUcN9WQ=; b=OTmQ5EFoP4JLoniMiwDmJzkjmGltrJeKMq53NrzZh6Ieu6+jesaaOY7lZt/ssE+Uiq 3V3H7YJtXrqGspltyhFXpXeen8SEuWVXqj+RnTdn0xCw+fg9vaj5+AIWlk7Eu/UVsQQh 0dfz1GBtePQrWPfG46wz0T1WR1Idc06H/xNRcoqHr0zHwkMnwO6mfMhzxKRjqEWbyIbP aJJLcbksxEaswTse8z/1Q/l7kQb7BaTPqY3QFOUoWyN7Uf+oTfRG4t+XHPOYSaCd3dlQ t+59EyVtqzRPo4/8hgi//ef7vOa+vYAA4ZFyU7Eh8/MsCc5ayVY+El2vimnu+f0r4A2T qyrg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b="IE3Y8/ne"; spf=pass (google.com: best guess record for domain of linux-omap-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-omap-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w64si2830708oif.51.2019.12.12.05.06.22; Thu, 12 Dec 2019 05:06:26 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-omap-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b="IE3Y8/ne"; spf=pass (google.com: best guess record for domain of linux-omap-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-omap-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729292AbfLLNGP (ORCPT + 4 others); Thu, 12 Dec 2019 08:06:15 -0500 Received: from lelv0143.ext.ti.com ([198.47.23.248]:34574 "EHLO lelv0143.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729297AbfLLNGP (ORCPT ); Thu, 12 Dec 2019 08:06:15 -0500 Received: from lelv0266.itg.ti.com ([10.180.67.225]) by lelv0143.ext.ti.com (8.15.2/8.15.2) with ESMTP id xBCD6Anr046806; Thu, 12 Dec 2019 07:06:10 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1576155970; bh=uFUNbB1DEpEuyWqLCJZY6Li5FRxlCr7qLzhPkUcN9WQ=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=IE3Y8/nec+mAFU50uyhzgdyMAgpP2nPVIHFx+BU4jpmP2qqa5LM4CQSlltkjLQO9R rx7JkyKfITsiq7kRJ71UFQ7l3VrweD/FA0duMUpMQgQ6gacEZPK4xdXj1R9aXbpZEZ JJpkkUKZptsoN5/Q+L+KWZo4S6uNpfb/QU0ySU8E= Received: from DFLE114.ent.ti.com (dfle114.ent.ti.com [10.64.6.35]) by lelv0266.itg.ti.com (8.15.2/8.15.2) with ESMTPS id xBCD6ADd052216 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 12 Dec 2019 07:06:10 -0600 Received: from DFLE100.ent.ti.com (10.64.6.21) by DFLE114.ent.ti.com (10.64.6.35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1847.3; Thu, 12 Dec 2019 07:06:09 -0600 Received: from lelv0327.itg.ti.com (10.180.67.183) by DFLE100.ent.ti.com (10.64.6.21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1847.3 via Frontend Transport; Thu, 12 Dec 2019 07:06:09 -0600 Received: from sokoban.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by lelv0327.itg.ti.com (8.15.2/8.15.2) with ESMTP id xBCD66KC069503; Thu, 12 Dec 2019 07:06:08 -0600 From: Tero Kristo To: , CC: , Subject: [PATCH 1/5] ARM: OMAP2+: pdata-quirks: add PRM data for reset support Date: Thu, 12 Dec 2019 15:05:37 +0200 Message-ID: <20191212130541.3657-2-t-kristo@ti.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191212130541.3657-1-t-kristo@ti.com> References: <20191212130541.3657-1-t-kristo@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 The parent clockdomain for reset must be in force wakeup mode, otherwise the reset may never complete. Add pdata quirks for this purpose for PRM driver. Signed-off-by: Tero Kristo Acked-by: Tony Lindgren --- arch/arm/mach-omap2/pdata-quirks.c | 8 ++++++++ 1 file changed, 8 insertions(+) -- 2.17.1 -- Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki diff --git a/arch/arm/mach-omap2/pdata-quirks.c b/arch/arm/mach-omap2/pdata-quirks.c index ca52271de5a8..d8260e61ef92 100644 --- a/arch/arm/mach-omap2/pdata-quirks.c +++ b/arch/arm/mach-omap2/pdata-quirks.c @@ -23,6 +23,7 @@ #include #include #include +#include #include "clockdomain.h" #include "common.h" @@ -408,6 +409,12 @@ void omap_pcs_legacy_init(int irq, void (*rearm)(void)) pcs_pdata.rearm = rearm; } +static struct ti_prm_platform_data ti_prm_pdata = { + .clkdm_deny_idle = clkdm_deny_idle, + .clkdm_allow_idle = clkdm_allow_idle, + .clkdm_lookup = clkdm_lookup, +}; + /* * GPIOs for TWL are initialized by the I2C bus and need custom * handing until DSS has device tree bindings. @@ -510,6 +517,7 @@ static struct of_dev_auxdata omap_auxdata_lookup[] = { /* Common auxdata */ OF_DEV_AUXDATA("ti,sysc", 0, NULL, &ti_sysc_pdata), OF_DEV_AUXDATA("pinctrl-single", 0, NULL, &pcs_pdata), + OF_DEV_AUXDATA("ti,omap-prm-inst", 0, NULL, &ti_prm_pdata), { /* sentinel */ }, }; From patchwork Thu Dec 12 13:05:38 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tero Kristo X-Patchwork-Id: 181473 Delivered-To: patch@linaro.org Received: by 2002:ac9:44c4:0:0:0:0:0 with SMTP id t4csp744107och; Thu, 12 Dec 2019 05:06:27 -0800 (PST) X-Google-Smtp-Source: APXvYqzv0DgREe40PHh/HCVU0Cw0QeGrFxqrscsQXHTKJW/60io2NAVBFzVuj7N+1LcVI1JuYm0U X-Received: by 2002:aca:1c09:: with SMTP id c9mr5093434oic.85.1576155987032; Thu, 12 Dec 2019 05:06:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576155987; cv=none; d=google.com; s=arc-20160816; b=JBZUmXOwK99PySChoXG6DCPhE/42oTP4tVG/aNZDsUuqr+GQ1hqW7i6QV+R7SX8eAS UtB4HwQpeF7bDUz8W2TsOvEocZpsXAl6HmqMA+7yUJM32KXUiVhzQb4zeZ1XGFgbUG2G TljkOMROjBfbrUUO5UYzzeZX0z6ANhsTadGXOqCNKfU+v/jQoanVsl3Px1rdSXgR45qX a9uOis3blG/vxjePk7pvfc5an/MDrIhllfKekmH11iEyMS1gT8v1b88kecJ9stJ3zDpm ta95bMsbqST8NUyauUMSSIS9atwgPWzN/HIWSuHgFGhpmr+OsXleTZjLw1lTVgJPR5WA cukQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=rnV8JdXQ9GTFl1cl3Aa4lIj+D8r8uXWsRNJQGRsuJ+0=; b=TNpQhiiZ+Ew6rF+S+FRyFCsHzpg+rQ+xR7eLQbP889c6mvmzBdRZNREd8dH5MdLmvr E6thZ2Fo/pVjIBOYnIvd3L6HYxR7w/TL7pbLDuJLwB86CBgdJQN72KrYtlQ+lKcMK3Ca V4G7Abd39H1VadpXspO2mHEGSHO1Uz8cY0rdTGNyuLump5CMVezV3lD8NCr6WG7qGp4b 0coTEx1NbvOpa81XDlSOgIm8ZhoRGqs6Navo+j3IyjfbaeSat5YlkrC4fAPMeiQwEtcS KzsvsyLno268eUPfVrPKUkyuZFB49wNj/tbNUp8HIyXnOFnBTJ5/H1Z8I5bFIPy6+jlp mtNA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=ePmbsAU1; spf=pass (google.com: best guess record for domain of linux-omap-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-omap-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w64si2830708oif.51.2019.12.12.05.06.26; Thu, 12 Dec 2019 05:06:27 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-omap-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=ePmbsAU1; spf=pass (google.com: best guess record for domain of linux-omap-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-omap-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729344AbfLLNGR (ORCPT + 4 others); Thu, 12 Dec 2019 08:06:17 -0500 Received: from lelv0143.ext.ti.com ([198.47.23.248]:34582 "EHLO lelv0143.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726263AbfLLNGR (ORCPT ); Thu, 12 Dec 2019 08:06:17 -0500 Received: from lelv0266.itg.ti.com ([10.180.67.225]) by lelv0143.ext.ti.com (8.15.2/8.15.2) with ESMTP id xBCD6Dp7046812; Thu, 12 Dec 2019 07:06:13 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1576155973; bh=rnV8JdXQ9GTFl1cl3Aa4lIj+D8r8uXWsRNJQGRsuJ+0=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=ePmbsAU1VK6Mp0pOn7iA32xV3TapPzjHUm7CalSirI6iK9K8zlah5nJ7dAPlHNzOk POh+SuWMbOnxIe/i7XBmKT3x/0cugMenHg2e5bIPTUO2/VO7bj2lXhexwFoY3XPSti j5eY2wQoqnzRr7f3SkWNeIshqT66P+mb9SpB2ppE= Received: from DFLE115.ent.ti.com (dfle115.ent.ti.com [10.64.6.36]) by lelv0266.itg.ti.com (8.15.2/8.15.2) with ESMTPS id xBCD6DYj052276 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 12 Dec 2019 07:06:13 -0600 Received: from DFLE100.ent.ti.com (10.64.6.21) by DFLE115.ent.ti.com (10.64.6.36) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1847.3; Thu, 12 Dec 2019 07:06:10 -0600 Received: from lelv0327.itg.ti.com (10.180.67.183) by DFLE100.ent.ti.com (10.64.6.21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1847.3 via Frontend Transport; Thu, 12 Dec 2019 07:06:10 -0600 Received: from sokoban.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by lelv0327.itg.ti.com (8.15.2/8.15.2) with ESMTP id xBCD66KD069503; Thu, 12 Dec 2019 07:06:09 -0600 From: Tero Kristo To: , CC: , Subject: [PATCH 2/5] ARM: OMAP4+: remove pdata quirks for omap4+ iommus Date: Thu, 12 Dec 2019 15:05:38 +0200 Message-ID: <20191212130541.3657-3-t-kristo@ti.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191212130541.3657-1-t-kristo@ti.com> References: <20191212130541.3657-1-t-kristo@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 IOMMU driver will be using ti-sysc bus driver for power management control going forward, and the pdata quirks are not needed for anything anymore. Signed-off-by: Tero Kristo --- arch/arm/mach-omap2/pdata-quirks.c | 14 -------------- 1 file changed, 14 deletions(-) -- 2.17.1 -- Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki diff --git a/arch/arm/mach-omap2/pdata-quirks.c b/arch/arm/mach-omap2/pdata-quirks.c index d8260e61ef92..88ca7f82510a 100644 --- a/arch/arm/mach-omap2/pdata-quirks.c +++ b/arch/arm/mach-omap2/pdata-quirks.c @@ -261,16 +261,6 @@ static void __init omap3_pandora_legacy_init(void) } #endif /* CONFIG_ARCH_OMAP3 */ -#if defined(CONFIG_ARCH_OMAP4) || defined(CONFIG_SOC_OMAP5) -static struct iommu_platform_data omap4_iommu_pdata = { - .reset_name = "mmu_cache", - .assert_reset = omap_device_assert_hardreset, - .deassert_reset = omap_device_deassert_hardreset, - .device_enable = omap_device_enable, - .device_idle = omap_device_idle, -}; -#endif - #if defined(CONFIG_SOC_AM33XX) || defined(CONFIG_SOC_AM43XX) static struct wkup_m3_platform_data wkup_m3_data = { .reset_name = "wkup_m3", @@ -495,10 +485,6 @@ static struct of_dev_auxdata omap_auxdata_lookup[] = { &wkup_m3_data), #endif #if defined(CONFIG_ARCH_OMAP4) || defined(CONFIG_SOC_OMAP5) - OF_DEV_AUXDATA("ti,omap4-iommu", 0x4a066000, "4a066000.mmu", - &omap4_iommu_pdata), - OF_DEV_AUXDATA("ti,omap4-iommu", 0x55082000, "55082000.mmu", - &omap4_iommu_pdata), OF_DEV_AUXDATA("ti,omap4-smartreflex-iva", 0x4a0db000, "4a0db000.smartreflex", &omap_sr_pdata[OMAP_SR_IVA]), OF_DEV_AUXDATA("ti,omap4-smartreflex-core", 0x4a0dd000, From patchwork Thu Dec 12 13:05:39 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tero Kristo X-Patchwork-Id: 181475 Delivered-To: patch@linaro.org Received: by 2002:ac9:44c4:0:0:0:0:0 with SMTP id t4csp744113och; Thu, 12 Dec 2019 05:06:27 -0800 (PST) X-Google-Smtp-Source: APXvYqy8OZCzhK/vmZbm3EKtIzE3ywWuwNaj4fZgw0IyOVJdiBjwIznGOyf+iEpkh2EMpeFWfuHJ X-Received: by 2002:a05:6808:3bc:: with SMTP id n28mr4623788oie.112.1576155987328; Thu, 12 Dec 2019 05:06:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576155987; cv=none; d=google.com; s=arc-20160816; b=tm2ZggmB1eg+bAqKgspBTlWvvy5fcGkEqfD7Qx76n+LrYhl+/bpqaY33bB0Vo/ebA8 n/481NpkXQ/Gf8l1oCgt0SZVy9ih/e2BEEvWLBdx8aLpm7TJbjSTDze5bKs1VTXaz6TM lV5LHPcLh+/yCqg7nNK5CaV3BaLyE0i2Kj+cRl8fachcF+xGlVdqRqsaDqtdoMUdb/TR DE4p3VI8a3hY2OXbVUSzk6sgFDdxCEMk9OEz32PRl+eBnZ0fdzs2RcDLGrNxfcH33pX+ e1UTdZnx+vvBut2fbdu6vUf2mSDs3h35D1bc+VpNiBgQ9leuwrYfuihbGmMWJ8IhfKXI uyTw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=DsV2XUtRQKQqXfzHmMrAeUB1kt+fzxattmAUdnmpsB8=; b=ZTIH1zm0Je1ClY7ibNq9jkCE/utlmCS4s1Q2g8qKE40vvwp/zfEbHDmiJm8r0HnLCg ezTSwETsH0VXhJI+bhc+eWEursRnS2AEeLF0iSj77u8A3TKFjICcvyzRUW+wm38O8XXw tTJ0K8wzw0lDwfur3cE2xuSNBnY8GSeLHtd2wO3lxfZicgS+xs7ACv/bkwBSbm+UxBjK Nh+H4AoBTnLKz81ZcBfScM7zQHJGcTgT//ytlgfwJJYQ6DzDTqhoSO/x5VI8mk1Jrt/P YbiG+2FftIyzBn7OjgxYE5tW1hkivkRMuKOEOxioEPgf0B+uC63c3Fxl5Yo2WgRZqa2J P/yA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=LI3VLNta; spf=pass (google.com: best guess record for domain of linux-omap-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-omap-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w64si2830708oif.51.2019.12.12.05.06.27; Thu, 12 Dec 2019 05:06:27 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-omap-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=LI3VLNta; spf=pass (google.com: best guess record for domain of linux-omap-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-omap-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726263AbfLLNGR (ORCPT + 4 others); Thu, 12 Dec 2019 08:06:17 -0500 Received: from fllv0016.ext.ti.com ([198.47.19.142]:57886 "EHLO fllv0016.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729297AbfLLNGR (ORCPT ); Thu, 12 Dec 2019 08:06:17 -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 xBCD6CsP123031; Thu, 12 Dec 2019 07:06:12 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1576155972; bh=DsV2XUtRQKQqXfzHmMrAeUB1kt+fzxattmAUdnmpsB8=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=LI3VLNtazdMdzWoJFEdVq+fvA79hZQzlixMACtMUD2GgJomNN5HNk5r3eRWV8UUYB wPm9uCVUPOZx6t3ctdv5i5nfexz0fBtuG2bQiHys3KeD+tqPzfd9hw+/NvYWf9dw+b 3nGuPe252SCY5CKzOW4xn9pvo6451rUFbJ8O/Fmw= Received: from DFLE110.ent.ti.com (dfle110.ent.ti.com [10.64.6.31]) by lelv0266.itg.ti.com (8.15.2/8.15.2) with ESMTPS id xBCD6C4T052265 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 12 Dec 2019 07:06:12 -0600 Received: from DFLE115.ent.ti.com (10.64.6.36) by DFLE110.ent.ti.com (10.64.6.31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1847.3; Thu, 12 Dec 2019 07:06:12 -0600 Received: from lelv0327.itg.ti.com (10.180.67.183) by DFLE115.ent.ti.com (10.64.6.36) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1847.3 via Frontend Transport; Thu, 12 Dec 2019 07:06:12 -0600 Received: from sokoban.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by lelv0327.itg.ti.com (8.15.2/8.15.2) with ESMTP id xBCD66KE069503; Thu, 12 Dec 2019 07:06:11 -0600 From: Tero Kristo To: , CC: , Subject: [PATCH 3/5] ARM: OMAP2+: Add workaround for DRA7 DSP MStandby errata i879 Date: Thu, 12 Dec 2019 15:05:39 +0200 Message-ID: <20191212130541.3657-4-t-kristo@ti.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191212130541.3657-1-t-kristo@ti.com> References: <20191212130541.3657-1-t-kristo@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 From: Suman Anna Errata Title: i879: DSP MStandby requires CD_EMU in SW_WKUP Description: The DSP requires the internal emulation clock to be actively toggling in order to successfully enter a low power mode via execution of the IDLE instruction and PRCM MStandby/Idle handshake. This assumes that other prerequisites and software sequence are followed. Workaround: The emulation clock to the DSP is free-running anytime CCS is connected via JTAG debugger to the DSP subsystem or when the CD_EMU clock domain is set in SW_WKUP mode. The CD_EMU domain can be set in SW_WKUP mode via the CM_EMU_CLKSTCTRL [1:0]CLKTRCTRL field. Implementation: This patch implements this workaround by denying the HW_AUTO mode for the EMU clockdomain during the power-up of any DSP processor and re-enabling the HW_AUTO mode during the shutdown of the last DSP processor (actually done during the enabling and disabling of the respective DSP MDMA MMUs). Reference counting has to be used to manage the independent sequencing between the multiple DSP processors. This switching is done at runtime rather than a static clockdomain flags value to meet the target power domain state for the EMU power domain during suspend. Note that the DSP MStandby behavior is not consistent across all boards prior to this fix. Please see commit 45f871eec6c0 ("ARM: OMAP2+: Extend DRA7 IPU1 MMU pdata quirks to DSP MDMA MMUs") for details. Signed-off-by: Suman Anna --- arch/arm/mach-omap2/omap-iommu.c | 43 +++++++++++++++++++++++++++++--- 1 file changed, 40 insertions(+), 3 deletions(-) -- 2.17.1 -- Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki diff --git a/arch/arm/mach-omap2/omap-iommu.c b/arch/arm/mach-omap2/omap-iommu.c index f1a6ece8108e..78247e6f4a72 100644 --- a/arch/arm/mach-omap2/omap-iommu.c +++ b/arch/arm/mach-omap2/omap-iommu.c @@ -11,14 +11,43 @@ #include "omap_hwmod.h" #include "omap_device.h" +#include "clockdomain.h" #include "powerdomain.h" +static void omap_iommu_dra7_emu_swsup_config(struct platform_device *pdev, + bool enable) +{ + static struct clockdomain *emu_clkdm; + static DEFINE_SPINLOCK(emu_lock); + static atomic_t count; + struct device_node *np = pdev->dev.of_node; + + if (!of_device_is_compatible(np, "ti,dra7-dsp-iommu")) + return; + + if (!emu_clkdm) { + emu_clkdm = clkdm_lookup("emu_clkdm"); + if (WARN_ON_ONCE(!emu_clkdm)) + return; + } + + spin_lock(&emu_lock); + + if (enable && (atomic_inc_return(&count) == 1)) + clkdm_deny_idle(emu_clkdm); + else if (!enable && (atomic_dec_return(&count) == 0)) + clkdm_allow_idle(emu_clkdm); + + spin_unlock(&emu_lock); +} + int omap_iommu_set_pwrdm_constraint(struct platform_device *pdev, bool request, u8 *pwrst) { struct powerdomain *pwrdm; struct omap_device *od; u8 next_pwrst; + int ret = 0; od = to_omap_device(pdev); if (!od) @@ -31,13 +60,21 @@ int omap_iommu_set_pwrdm_constraint(struct platform_device *pdev, bool request, if (!pwrdm) return -EINVAL; - if (request) + if (request) { *pwrst = pwrdm_read_next_pwrst(pwrdm); + omap_iommu_dra7_emu_swsup_config(pdev, true); + } if (*pwrst > PWRDM_POWER_RET) - return 0; + goto out; next_pwrst = request ? PWRDM_POWER_ON : *pwrst; - return pwrdm_set_next_pwrst(pwrdm, next_pwrst); + ret = pwrdm_set_next_pwrst(pwrdm, next_pwrst); + +out: + if (!request) + omap_iommu_dra7_emu_swsup_config(pdev, false); + + return ret; } From patchwork Thu Dec 12 13:05:40 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tero Kristo X-Patchwork-Id: 181474 Delivered-To: patch@linaro.org Received: by 2002:ac9:44c4:0:0:0:0:0 with SMTP id t4csp744124och; Thu, 12 Dec 2019 05:06:27 -0800 (PST) X-Google-Smtp-Source: APXvYqz695nKWvGWEDKdOnBgQHM3mqtC+mMao49wryXyL5dIqR1pK1FT3xGDG/F3vb7+yl/RIsRr X-Received: by 2002:aca:52c7:: with SMTP id g190mr4677655oib.84.1576155987579; Thu, 12 Dec 2019 05:06:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576155987; cv=none; d=google.com; s=arc-20160816; b=ZNzNnkbAR13M24uBHebSqj6kVjAPTdL4L7XKdg14YmXyhjtcR9drQ/2+SJkwoV0dOd zhXvcAGjTc3oeZesfDezFbtUfM8hfN8iuqkv6dbkpeQINKrZgRXFQmBB066VjLFn+qUN iC3mftjJdsysrTRGQEDKqWZy3v08R0DqmS400Z5WVZlftZzutChA948Kmg9aoGlqwAbf Am6VqLdivHg1LrhcVVaBFSVMENCaiGiaoUOr+nK0/3SwdARsYGEYwtAgAZuUdFlW0Xp0 b5NTdQqvgPtawWDO1owj6m8N2aNfXpPtmwOYiCteB0JqIRpVabr5F3LcCogl4mjI9yNf l3eA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=ti51rTV6c8ZSMS8P9ZaZrX2hos6jao0jMbrGOB4FUbk=; b=e9dvAntwjKfJ3o/uFZdQ0zU5sDAeie3Zfp2GZPZNHuQAsGX9paywQuXvo/LtdNt3ju iZJjs2eO/ambWmRXZrZ8MoSf9e0UbliVxoUaL4M3OzXIx+ohJKt0zda3ewu+/hH2TsQM 7NdY7ThD1ceMfUADe9Q4CotNYR7Xzk2rgWrdoqHSV+23AXkSiGcjSzhKd+i+xxU96B/C iKV6lIOz9+ygBUdkGCAzdpwoziZE8g1I/Gs4z3Y0+LONjcPQFITAv/Zv42a28mVTQDzN 7y0QpRIQ26g4DWfbvJ+NfXazim+AXk7S4T0WlidVNQB+KZ+3o1TJ4dD0SE9inNhO00G2 h5BA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=kP0VI02D; spf=pass (google.com: best guess record for domain of linux-omap-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-omap-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w64si2830708oif.51.2019.12.12.05.06.27; Thu, 12 Dec 2019 05:06:27 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-omap-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=kP0VI02D; spf=pass (google.com: best guess record for domain of linux-omap-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-omap-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729359AbfLLNGU (ORCPT + 4 others); Thu, 12 Dec 2019 08:06:20 -0500 Received: from fllv0015.ext.ti.com ([198.47.19.141]:42820 "EHLO fllv0015.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729297AbfLLNGT (ORCPT ); Thu, 12 Dec 2019 08:06:19 -0500 Received: from lelv0265.itg.ti.com ([10.180.67.224]) by fllv0015.ext.ti.com (8.15.2/8.15.2) with ESMTP id xBCD6EPi105801; Thu, 12 Dec 2019 07:06:14 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1576155974; bh=ti51rTV6c8ZSMS8P9ZaZrX2hos6jao0jMbrGOB4FUbk=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=kP0VI02D7shB2PJ+VamHrvEV3MSABBoVKktUX2cCdQoWaOwVLazROjboaBOiBRORS V/at1jwjyMdRVgdHSkVsGKNoLJQZEcoAXBesh1nEugetnV/W4oFVoK5qY3yz+XFANb j9LhXUHmKh+8As18NC9hk3z/jSbXDKqEjeEC1TBE= Received: from DFLE109.ent.ti.com (dfle109.ent.ti.com [10.64.6.30]) by lelv0265.itg.ti.com (8.15.2/8.15.2) with ESMTPS id xBCD6ETS074439 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 12 Dec 2019 07:06:14 -0600 Received: from DFLE111.ent.ti.com (10.64.6.32) by DFLE109.ent.ti.com (10.64.6.30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1847.3; Thu, 12 Dec 2019 07:06:13 -0600 Received: from lelv0327.itg.ti.com (10.180.67.183) by DFLE111.ent.ti.com (10.64.6.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1847.3 via Frontend Transport; Thu, 12 Dec 2019 07:06:13 -0600 Received: from sokoban.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by lelv0327.itg.ti.com (8.15.2/8.15.2) with ESMTP id xBCD66KF069503; Thu, 12 Dec 2019 07:06:12 -0600 From: Tero Kristo To: , CC: , Subject: [PATCH 4/5] ARM: OMAP2+: omap-iommu.c conversion to ti-sysc Date: Thu, 12 Dec 2019 15:05:40 +0200 Message-ID: <20191212130541.3657-5-t-kristo@ti.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191212130541.3657-1-t-kristo@ti.com> References: <20191212130541.3657-1-t-kristo@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 Convert omap2 iommu platform code to use ti-sysc instead of legacy omap-device / hwmod interfaces. Signed-off-by: Tero Kristo --- arch/arm/mach-omap2/omap-iommu.c | 99 ++++++++++++++++++++++++++------ 1 file changed, 80 insertions(+), 19 deletions(-) -- 2.17.1 -- Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki diff --git a/arch/arm/mach-omap2/omap-iommu.c b/arch/arm/mach-omap2/omap-iommu.c index 78247e6f4a72..54aff33e55e6 100644 --- a/arch/arm/mach-omap2/omap-iommu.c +++ b/arch/arm/mach-omap2/omap-iommu.c @@ -8,19 +8,27 @@ #include #include +#include +#include -#include "omap_hwmod.h" -#include "omap_device.h" #include "clockdomain.h" #include "powerdomain.h" +struct pwrdm_link { + struct device *dev; + struct powerdomain *pwrdm; + struct list_head node; +}; + +static DEFINE_SPINLOCK(iommu_lock); +static struct clockdomain *emu_clkdm; +static atomic_t emu_count; + static void omap_iommu_dra7_emu_swsup_config(struct platform_device *pdev, bool enable) { - static struct clockdomain *emu_clkdm; - static DEFINE_SPINLOCK(emu_lock); - static atomic_t count; struct device_node *np = pdev->dev.of_node; + unsigned long flags; if (!of_device_is_compatible(np, "ti,dra7-dsp-iommu")) return; @@ -31,34 +39,87 @@ static void omap_iommu_dra7_emu_swsup_config(struct platform_device *pdev, return; } - spin_lock(&emu_lock); + spin_lock_irqsave(&iommu_lock, flags); - if (enable && (atomic_inc_return(&count) == 1)) + if (enable && (atomic_inc_return(&emu_count) == 1)) clkdm_deny_idle(emu_clkdm); - else if (!enable && (atomic_dec_return(&count) == 0)) + else if (!enable && (atomic_dec_return(&emu_count) == 0)) clkdm_allow_idle(emu_clkdm); - spin_unlock(&emu_lock); + spin_unlock_irqrestore(&iommu_lock, flags); +} + +static struct powerdomain *_get_pwrdm(struct device *dev) +{ + struct clk *clk; + struct clk_hw_omap *hwclk; + struct clockdomain *clkdm; + struct powerdomain *pwrdm = NULL; + struct pwrdm_link *entry; + unsigned long flags; + static LIST_HEAD(cache); + + spin_lock_irqsave(&iommu_lock, flags); + + list_for_each_entry(entry, &cache, node) { + if (entry->dev == dev) { + pwrdm = entry->pwrdm; + break; + } + } + + spin_unlock_irqrestore(&iommu_lock, flags); + + if (pwrdm) + return pwrdm; + + clk = of_clk_get(dev->of_node->parent, 0); + if (!clk) { + dev_err(dev, "no fck found\n"); + return NULL; + } + + hwclk = to_clk_hw_omap(__clk_get_hw(clk)); + clk_put(clk); + if (!hwclk || !hwclk->clkdm_name) { + dev_err(dev, "no hwclk data\n"); + return NULL; + } + + clkdm = clkdm_lookup(hwclk->clkdm_name); + if (!clkdm) { + dev_err(dev, "clkdm not found: %s\n", hwclk->clkdm_name); + return NULL; + } + + pwrdm = clkdm_get_pwrdm(clkdm); + if (!pwrdm) { + dev_err(dev, "pwrdm not found: %s\n", clkdm->name); + return NULL; + } + + entry = kmalloc(sizeof(*entry), GFP_KERNEL); + if (entry) { + entry->dev = dev; + entry->pwrdm = pwrdm; + spin_lock_irqsave(&iommu_lock, flags); + list_add(&entry->node, &cache); + spin_unlock_irqrestore(&iommu_lock, flags); + } + + return pwrdm; } int omap_iommu_set_pwrdm_constraint(struct platform_device *pdev, bool request, u8 *pwrst) { struct powerdomain *pwrdm; - struct omap_device *od; u8 next_pwrst; int ret = 0; - od = to_omap_device(pdev); - if (!od) - return -ENODEV; - - if (od->hwmods_cnt != 1) - return -EINVAL; - - pwrdm = omap_hwmod_get_pwrdm(od->hwmods[0]); + pwrdm = _get_pwrdm(&pdev->dev); if (!pwrdm) - return -EINVAL; + return -ENODEV; if (request) { *pwrst = pwrdm_read_next_pwrst(pwrdm); From patchwork Thu Dec 12 13:05:41 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tero Kristo X-Patchwork-Id: 181476 Delivered-To: patch@linaro.org Received: by 2002:ac9:44c4:0:0:0:0:0 with SMTP id t4csp744132och; Thu, 12 Dec 2019 05:06:28 -0800 (PST) X-Google-Smtp-Source: APXvYqy3PHj4jaL43tej1mWUCduSG0ZJes9uTow/ccBTaVpvmwXTx05lPzkmSYnPI12rgTUEGdsj X-Received: by 2002:a9d:1d02:: with SMTP id m2mr7489001otm.45.1576155987908; Thu, 12 Dec 2019 05:06:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576155987; cv=none; d=google.com; s=arc-20160816; b=IB0keBMsERoX5N/LO7j21L0dg1RKRmRd1wyCYuEtpqZLtgZvQT06jJQRFYhN+pqcIy FnbeQTsnaHPXhe6erJLWKkky6ttxs3nr8Fr1CcduJzTi3hGDZGAEO57bH3Em95n790da TqPBBhbQ4CnqifaQGX9+R4gVuDWLHSRSfgfGhaVpnqsbQArdioBXCGEzbEPzaU8qGnYH Is8RFPTvQqZiYdYu7AS5KFo/XxTOKNDesrQJ64IcpDUPSu6QBvyuHbHi/rPKU8iT66l6 0r1JICD7+0DM+pyx7ZysF5JGff/m0bkhhA6ItAniQdymRwiOfqJ4501upKFs3w/kEP3d r4Yg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=dUt9cxzXT8ATche9ypvfUEfMBASy8mLvyF9jE25xr7I=; b=InvZwIjy04j8qQUN7wMm1lxITHd08BuFqj7BPQr2m8EYacFEi2zRBELiAqKa813uUc wsQDsTYTFyWoT4qgtnNBncV4gK65qq0xo+feh5bmRqxofjHUw0CnNpII9bgZ5l8bH4Gc Afs7KAUU8XfAQ41SirtEuNVbwL64VGwyL49JqyGd8bFK69fmMwPeifyuVZR2RM8HZpQx H+/E+xLmcyRzKf7lTxyxlxceHAvoRvRBxb73PBquWCToRhGvOPmNpLTPtxmHdDdKAAAr 7+GlUM2p7P1FFVr59M/qg0lWPGPsclFxNfYjWZZ581Xcgvl2FVhhKHkPCAT45SpQIH50 SagQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b="EfTX/xOn"; spf=pass (google.com: best guess record for domain of linux-omap-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-omap-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w64si2830708oif.51.2019.12.12.05.06.27; Thu, 12 Dec 2019 05:06:27 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-omap-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b="EfTX/xOn"; spf=pass (google.com: best guess record for domain of linux-omap-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-omap-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729373AbfLLNGV (ORCPT + 4 others); Thu, 12 Dec 2019 08:06:21 -0500 Received: from lelv0143.ext.ti.com ([198.47.23.248]:34598 "EHLO lelv0143.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729297AbfLLNGV (ORCPT ); Thu, 12 Dec 2019 08:06:21 -0500 Received: from fllv0034.itg.ti.com ([10.64.40.246]) by lelv0143.ext.ti.com (8.15.2/8.15.2) with ESMTP id xBCD6FjJ046822; Thu, 12 Dec 2019 07:06:15 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1576155975; bh=dUt9cxzXT8ATche9ypvfUEfMBASy8mLvyF9jE25xr7I=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=EfTX/xOn3867wEpyy2klKs6fBoCflFkiZEHSo0HfTKE9s6DikcL4Cp/NXfVO1jFvw yWoctgd/7PlwcJGaTdzD8UPRNWQoCt3AOsPfFp04Af1dfrTTxdViprD7E3yqA6yzCE pDQO1nZOh9luicibwUUfukTDPHzBtmQ5vIEpYk+w= Received: from DLEE115.ent.ti.com (dlee115.ent.ti.com [157.170.170.26]) by fllv0034.itg.ti.com (8.15.2/8.15.2) with ESMTPS id xBCD6FLW098104 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 12 Dec 2019 07:06:15 -0600 Received: from DLEE112.ent.ti.com (157.170.170.23) 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.1847.3; Thu, 12 Dec 2019 07:06:15 -0600 Received: from lelv0327.itg.ti.com (10.180.67.183) by DLEE112.ent.ti.com (157.170.170.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1847.3 via Frontend Transport; Thu, 12 Dec 2019 07:06:15 -0600 Received: from sokoban.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by lelv0327.itg.ti.com (8.15.2/8.15.2) with ESMTP id xBCD66KG069503; Thu, 12 Dec 2019 07:06:14 -0600 From: Tero Kristo To: , CC: , Subject: [PATCH 5/5] ARM: OMAP2+: use separate IOMMU pdata to fix DRA7 IPU1 boot Date: Thu, 12 Dec 2019 15:05:41 +0200 Message-ID: <20191212130541.3657-6-t-kristo@ti.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191212130541.3657-1-t-kristo@ti.com> References: <20191212130541.3657-1-t-kristo@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 From: Suman Anna The IPU1 MMU has been using common IOMMU pdata quirks defined and used by all IPU IOMMU devices on OMAP4 and beyond. Separate out the pdata for IPU1 MMU with the additional .set_pwrdm_constraint ops plugged in, so that the IPU1 power domain can be restricted to ON state during the boot and active period of the IPU1 remote processor. This eliminates the pre-conditions for the IPU1 boot issue as described in commit afe518400bdb ("iommu/omap: fix boot issue on remoteprocs with AMMU/Unicache"). NOTE: 1. RET is not a valid target power domain state on DRA7 platforms, and IPU power domain is normally programmed for OFF. The IPU1 still fails to boot though, and an unclearable l3_noc error is thrown currently on 4.14 kernel without this fix. This behavior is slightly different from previous 4.9 LTS kernel. 2. The fix is currently applied only to IPU1 on DRA7xx SoC, as the other affected processors on OMAP4/OMAP5/DRA7 are in domains that are not entering RET. IPU2 on DRA7 is in CORE power domain which is only programmed for ON power state. The fix can be easily scaled if these domains do hit RET in the future. 3. The issue was not seen on current DRA7 platforms if any of the DSP remote processors were booted and using one of the GPTimers 5, 6, 7 or 8 on previous 4.9 LTS kernel. This was due to the errata fix for i874 implemented in commit 1cbabcb9807e ("ARM: DRA7: clockdomain: Implement timer workaround for errata i874") which keeps the IPU1 power domain from entering RET when the timers are active. But the timer workaround did not make any difference on 4.14 kernel, and an l3_noc error was seen still without this fix. Signed-off-by: Suman Anna --- arch/arm/mach-omap2/pdata-quirks.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) -- 2.17.1 -- Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki diff --git a/arch/arm/mach-omap2/pdata-quirks.c b/arch/arm/mach-omap2/pdata-quirks.c index 88ca7f82510a..7c6e57e4bcb2 100644 --- a/arch/arm/mach-omap2/pdata-quirks.c +++ b/arch/arm/mach-omap2/pdata-quirks.c @@ -43,6 +43,17 @@ struct pdata_init { static struct of_dev_auxdata omap_auxdata_lookup[]; static struct twl4030_gpio_platform_data twl_gpio_auxdata; +#if IS_ENABLED(CONFIG_OMAP_IOMMU) +int omap_iommu_set_pwrdm_constraint(struct platform_device *pdev, bool request, + u8 *pwrst); +#else +static inline int omap_iommu_set_pwrdm_constraint(struct platform_device *pdev, + bool request, u8 *pwrst) +{ + return 0; +} +#endif + #ifdef CONFIG_MACH_NOKIA_N8X0 static void __init omap2420_n8x0_legacy_init(void) { @@ -276,6 +287,10 @@ static void __init omap5_uevm_legacy_init(void) #endif #ifdef CONFIG_SOC_DRA7XX +static struct iommu_platform_data dra7_ipu1_dsp_iommu_pdata = { + .set_pwrdm_constraint = omap_iommu_set_pwrdm_constraint, +}; + static struct omap_hsmmc_platform_data dra7_hsmmc_data_mmc1; static struct omap_hsmmc_platform_data dra7_hsmmc_data_mmc2; static struct omap_hsmmc_platform_data dra7_hsmmc_data_mmc3; @@ -499,6 +514,12 @@ static struct of_dev_auxdata omap_auxdata_lookup[] = { &dra7_hsmmc_data_mmc2), OF_DEV_AUXDATA("ti,dra7-hsmmc", 0x480ad000, "480ad000.mmc", &dra7_hsmmc_data_mmc3), + OF_DEV_AUXDATA("ti,dra7-dsp-iommu", 0x40d01000, "40d01000.mmu", + &dra7_ipu1_dsp_iommu_pdata), + OF_DEV_AUXDATA("ti,dra7-dsp-iommu", 0x41501000, "41501000.mmu", + &dra7_ipu1_dsp_iommu_pdata), + OF_DEV_AUXDATA("ti,dra7-iommu", 0x58882000, "58882000.mmu", + &dra7_ipu1_dsp_iommu_pdata), #endif /* Common auxdata */ OF_DEV_AUXDATA("ti,sysc", 0, NULL, &ti_sysc_pdata),