Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp1251197pxx; Tue, 27 Oct 2020 11:51:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwP7V30oRj4GVC4doXln57YwXMbW9Hegb5skBhhXhuclReQx0ym9F1iKvzE+WtvJ8pbKbWY X-Received: by 2002:a17:906:935a:: with SMTP id p26mr3788597ejw.30.1603824697446; Tue, 27 Oct 2020 11:51:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603824697; cv=none; d=google.com; s=arc-20160816; b=NpbySVurniBn82SYTSECxa+0dRfpKTGFAEs8swEQB1jN8g3p49NiwLJCVFR0h+90Te Z5FiA6x7wForycBIR8zPhze9A45qMHnzIKmdd398sENebFF4Pqsu0CCgFyzOl68rj1Fl Moq9cXSYtpkWs72ESgiD2YgyHKhiBvNNVKyw6dgmoHfoLs+9WLbXOdrlAQ5V7FrZYg9R WfMhhdGBfqNdgOmraAp6DUtCk+oacDbr2K/LAWj3HuUw0mWAjnbl+vC0JYmTWhE6NHoJ m1WHtBVt543t/rR9RuoPdPE0xoTssgVfoA7pfwvibeWCEi8X2d7hcCPenLgb5879pXLd NO4A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=UxPt/OG64BhPZR1vAROdnqBlMo2fN4xAsEH+kzUgh88=; b=lTLUTrQtTByatzQlT+ObO65996fO/pQSlBOZgFrbT5tqBzAkN5WBYVJgNhSHD6WqrX dPh7ZHkZvFtDJjLgut4bQh3AlDOXyvNi0NKJqr+eyyx8J34A2bXw0tq959g56go9k6ES 9Zh0ENSCRfam37uQ5m0UPVnahyIoehBGGtY/HaaqvbcqPlbubyo7NWAwVTb1uE9m9Cgw pG0YA85f9T6prYYkHkPGMlDX3ewigxoZhyZFqEEYzIPEPT+V3tg6E9JvcXf7TkspjEY8 87C4hjaP+8keWCJ+OS7vg7Rxx/ZydhFOTaWGmCiC/fQBzJcDQUbC7BbMHcQ2oG7OdbLe nJnw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=2QdUMr0h; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w10si1687062eja.274.2020.10.27.11.51.14; Tue, 27 Oct 2020 11:51:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-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=@kernel.org header.s=default header.b=2QdUMr0h; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2443658AbgJ0Abe (ORCPT + 99 others); Mon, 26 Oct 2020 20:31:34 -0400 Received: from mail.kernel.org ([198.145.29.99]:53686 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2409600AbgJZXwA (ORCPT ); Mon, 26 Oct 2020 19:52:00 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id E823C20882; Mon, 26 Oct 2020 23:51:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603756319; bh=xrteNirigUZc9HRoT/v/LZx8ZHqqq4+FtG69/NB7AcI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=2QdUMr0hwjVkwiq0gxXbdK3huS9HOaV6ZJfupiTu0ra2klv5XLxArqoc1NPufqelw Xl+lf1cEIvXLSPwf2BeVVbuqNTtQZz/cl+rw90haGEXBiOZO4TSmPJMq6sFvxFo7WM qMRiMlt4kX0CwFjm9ysWb6z6V5eHlTLt0cjHuVDg= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Grygorii Strashko , Santosh Shilimkar , Sasha Levin , linux-arm-kernel@lists.infradead.org Subject: [PATCH AUTOSEL 5.9 141/147] soc: ti: k3: ringacc: add am65x sr2.0 support Date: Mon, 26 Oct 2020 19:48:59 -0400 Message-Id: <20201026234905.1022767-141-sashal@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201026234905.1022767-1-sashal@kernel.org> References: <20201026234905.1022767-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Grygorii Strashko [ Upstream commit 95e7be062aea6d2e09116cd4d28957d310c04781 ] 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 errate w/a only for the AM65x SR1.0. This also makes obsolete "ti,dma-ring-reset-quirk" DT property. Signed-off-by: Grygorii Strashko Signed-off-by: Santosh Shilimkar Signed-off-by: Sasha Levin --- drivers/soc/ti/k3-ringacc.c | 33 ++++++++++++++++++++++++++++++--- 1 file changed, 30 insertions(+), 3 deletions(-) diff --git a/drivers/soc/ti/k3-ringacc.c b/drivers/soc/ti/k3-ringacc.c index 6dcc21dde0cb7..1147dc4c1d596 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)) -- 2.25.1