From patchwork Tue Aug 4 21:17:30 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Grygorii Strashko X-Patchwork-Id: 247437 Delivered-To: patch@linaro.org Received: by 2002:a92:cc90:0:0:0:0:0 with SMTP id x16csp705259ilo; Tue, 4 Aug 2020 14:18:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwIIuGQEfqB9QaREbzyCPBPIynNJ4oQlROAKgMCSf2VzvPFA05NLfekM1/FRYWxgiEDuYTV X-Received: by 2002:a17:906:1f88:: with SMTP id t8mr37098ejr.241.1596575880322; Tue, 04 Aug 2020 14:18:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596575880; cv=none; d=google.com; s=arc-20160816; b=UzK+onT8K+FG8+O4wg5Hi/L8XcLjyBxRlRAyo3r56t9UXYWJu3fKuFBcBlCRh+6BX5 25wB94UWDdrGViUr3N+MgzSewVkSNqU4dvNQmyvTmfkPk6kqhp6mREO4bsOln1ZV1Lh/ mFEtiQKSo0Q8mjMxleXbcmE/XEjGVME2lYRUne96RvTtAZ9YdIf6rvfxi9uYCpsFKdS9 //0x9MXA6UbybXHxR5QwEJ7XgU35pFn170sm/Lak0OsWLElXKE4rz3d8UoiQaCL1ffI5 LQtpKAsOQbHtLl+GQrosHtddQYGA4cUkxanXvLu60XaAgrilnTcPwUW+rjBSS07gdVdL zjyA== 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=+vywBnlWsnrTlfJ2+mD3dwrHiQ0eG840VMYxiTPmwbY=; b=M2cVQpmXGJKhtM288++t7BZnRmRG22jUwiR1T9zQHffpTBJkOHoexM5StUVz4cD2AB wQDN5XZCe4D5P41wIsyURKYz8p1aVVEStguMsafplbQ0NIzcixQCSxA6llpjpWQZJQ8F 9WyM93bP8tqNc0C9qc/aFD5lOLttO3ET02QIY/eO5PqIelkTMZ5PNid+jJtNYpNmcnF8 u7wEMXwKhzzm1O/gi7h957pdI/wd7as9in6QZJtbMzLGAE7URItMucedJa/tx4lIZWVV TWPf4rZ8VTNWrS0tyKay3S6QHAJrOezTIR7YE8CChtqTkiLiSrJUGsgCpLjl3yspH3r1 LsIA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=SJlzwGhk; spf=pass (google.com: domain of devicetree-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=devicetree-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. [23.128.96.18]) by mx.google.com with ESMTP id x7si13052655ejv.609.2020.08.04.14.18.00; Tue, 04 Aug 2020 14:18:00 -0700 (PDT) Received-SPF: pass (google.com: domain of devicetree-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=SJlzwGhk; spf=pass (google.com: domain of devicetree-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=devicetree-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 S1726970AbgHDVR7 (ORCPT + 6 others); Tue, 4 Aug 2020 17:17:59 -0400 Received: from lelv0142.ext.ti.com ([198.47.23.249]:47364 "EHLO lelv0142.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726350AbgHDVR5 (ORCPT ); Tue, 4 Aug 2020 17:17:57 -0400 Received: from fllv0034.itg.ti.com ([10.64.40.246]) by lelv0142.ext.ti.com (8.15.2/8.15.2) with ESMTP id 074LHp4C113639; Tue, 4 Aug 2020 16:17:51 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1596575871; bh=+vywBnlWsnrTlfJ2+mD3dwrHiQ0eG840VMYxiTPmwbY=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=SJlzwGhkX4AFnmSOYO5S8xjF/u+CGzCE8VApMGR8jdfxnqUYDjWWDJFwZRgtIJ0BJ PWSa75sbLTbS2swjpR4R7SO5ATKGC4+G/hYNHwduWxF/M4rYS+NUKHucQdQoR/g0Ag 9gL3e/SJ9JJWNkM7Obkb5wzr0JsdJYpeFIiQai1M= Received: from DFLE114.ent.ti.com (dfle114.ent.ti.com [10.64.6.35]) by fllv0034.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 074LHpDQ040157 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 4 Aug 2020 16:17:51 -0500 Received: from DFLE101.ent.ti.com (10.64.6.22) 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.1979.3; Tue, 4 Aug 2020 16:17:51 -0500 Received: from lelv0327.itg.ti.com (10.180.67.183) by DFLE101.ent.ti.com (10.64.6.22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1979.3 via Frontend Transport; Tue, 4 Aug 2020 16:17:51 -0500 Received: from localhost (ileax41-snat.itg.ti.com [10.172.224.153]) by lelv0327.itg.ti.com (8.15.2/8.15.2) with ESMTP id 074LHnRm046380; Tue, 4 Aug 2020 16:17:50 -0500 From: Grygorii Strashko To: Peter Ujfalusi , Santosh Shilimkar , , Rob Herring , Tero Kristo CC: Sekhar Nori , Dave Gerlach , Vignesh Raghavendra , , , , Grygorii Strashko Subject: [PATCH next 1/3] soc: ti: k3: ringacc: add am65x sr2.0 support Date: Wed, 5 Aug 2020 00:17:30 +0300 Message-ID: <20200804211732.2861-2-grygorii.strashko@ti.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200804211732.2861-1-grygorii.strashko@ti.com> References: <20200804211732.2861-1-grygorii.strashko@ti.com> MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org The AM65x SR2.0 Ringacc has fixed errata i2023 "RINGACC, UDMA: RINGACC and UDMA Ring State Interoperability Issue after Channel Teardown". This errata also fixed for J271E SoC. Use SOC bus data for K3 SoC identification and enable i2023 errata w/a only for the AM65x SR1.0. This also makes obsolete "ti,dma-ring-reset-quirk" DT property. Signed-off-by: Grygorii Strashko --- drivers/soc/ti/k3-ringacc.c | 33 ++++++++++++++++++++++++++++++--- 1 file changed, 30 insertions(+), 3 deletions(-) -- 2.17.1 diff --git a/drivers/soc/ti/k3-ringacc.c b/drivers/soc/ti/k3-ringacc.c index 6dcc21dde0cb..1147dc4c1d59 100644 --- a/drivers/soc/ti/k3-ringacc.c +++ b/drivers/soc/ti/k3-ringacc.c @@ -10,6 +10,7 @@ #include #include #include +#include #include #include #include @@ -208,6 +209,15 @@ struct k3_ringacc { const struct k3_ringacc_ops *ops; }; +/** + * struct k3_ringacc - Rings accelerator SoC data + * + * @dma_ring_reset_quirk: DMA reset w/a enable + */ +struct k3_ringacc_soc_data { + unsigned dma_ring_reset_quirk:1; +}; + static long k3_ringacc_ring_get_fifo_pos(struct k3_ring *ring) { return K3_RINGACC_FIFO_WINDOW_SIZE_BYTES - @@ -1051,9 +1061,6 @@ static int k3_ringacc_probe_dt(struct k3_ringacc *ringacc) return ret; } - ringacc->dma_ring_reset_quirk = - of_property_read_bool(node, "ti,dma-ring-reset-quirk"); - ringacc->tisci = ti_sci_get_by_phandle(node, "ti,sci"); if (IS_ERR(ringacc->tisci)) { ret = PTR_ERR(ringacc->tisci); @@ -1084,9 +1091,22 @@ static int k3_ringacc_probe_dt(struct k3_ringacc *ringacc) ringacc->rm_gp_range); } +static const struct k3_ringacc_soc_data k3_ringacc_soc_data_sr1 = { + .dma_ring_reset_quirk = 1, +}; + +static const struct soc_device_attribute k3_ringacc_socinfo[] = { + { .family = "AM65X", + .revision = "SR1.0", + .data = &k3_ringacc_soc_data_sr1 + }, + {/* sentinel */} +}; + static int k3_ringacc_init(struct platform_device *pdev, struct k3_ringacc *ringacc) { + const struct soc_device_attribute *soc; void __iomem *base_fifo, *base_rt; struct device *dev = &pdev->dev; struct resource *res; @@ -1103,6 +1123,13 @@ static int k3_ringacc_init(struct platform_device *pdev, if (ret) return ret; + soc = soc_device_match(k3_ringacc_socinfo); + if (soc && soc->data) { + const struct k3_ringacc_soc_data *soc_data = soc->data; + + ringacc->dma_ring_reset_quirk = soc_data->dma_ring_reset_quirk; + } + res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "rt"); base_rt = devm_ioremap_resource(dev, res); if (IS_ERR(base_rt))