From patchwork Wed Jul 29 11:02:04 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Grzegorz Jaszczyk X-Patchwork-Id: 247242 Delivered-To: patch@linaro.org Received: by 2002:a92:d244:0:0:0:0:0 with SMTP id v4csp1360914ilg; Wed, 29 Jul 2020 04:02:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwKUyltScknzbK5w0XyVfLy19vlg2kKAK/R11Ge42HEa1On9kzlId8Y7+HttDqeq0g4boWR X-Received: by 2002:aa7:cc98:: with SMTP id p24mr27826982edt.333.1596020572621; Wed, 29 Jul 2020 04:02:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596020572; cv=none; d=google.com; s=arc-20160816; b=F8wPpOqJ/xc9z7vaJxofzG6uk4UuM/my2ykKPM7nKsA3H6hOdILSb5itwqS3b0K7qM Tu2qONYsAcTH/gkoJtziZECo/4iuTU4FLPGNzy4a9aq0df0eVscIRaBtpY/4AveOrg6Y RJPxs5wAbGKunK7uYdoNBx2iRdetLC6hqn/O5tB/i/pIJiPZApk/VsT2AfZVOAWMKWud CRmHy7WtcWVni4Ne+hbZ+I0Wbw036l2NdApVFt9rCM9NeYjXIGm84njH7/0KAAK9aR4D nJ7CzgE+2lyLTUb7rzLj46hf3olfP7fB5Jazsg9GsKkRNyLK5TYNtcEvKND6abAzHryZ 2Mww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=Ue92o8vmM4zCFeyRi4hlpzGK8fvXI3JfJrlh4FPdWS4=; b=bJ1JtEZu6+L7NWb4qJtvWVtzT+Qpj/qCxkXgfBOKvol0GivZ/zdjc4QbDW4Uwaivj/ rEzwwemkkzhp4fnciagV3VBwLjGeaZbwFRse8PPMabxqEaDC06rBQZE3F8FqjpvBBCjz buliu064frrcS/Hf5NBdyeN4VAC2LQM3NvlgIrzT6Vn+HloItM96sb1OvPWknLrvXduf j2HktQpI3G5PpjWjDKwR/A7LmsaLyxgOTGKB2MY8GsgUda9GC8LIHJDiDiq3gpE6O851 jtojC0m6D3c2DYbdZ7XcPv7kpkCdXVUn/x4ZwWCh7f9WDlyUu/XNxdri+ByokIiM2jtZ J52w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="g/PNy1qF"; 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=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id pv15si836548ejb.596.2020.07.29.04.02.52; Wed, 29 Jul 2020 04:02:52 -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=@linaro.org header.s=google header.b="g/PNy1qF"; 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=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726774AbgG2LCr (ORCPT + 6 others); Wed, 29 Jul 2020 07:02:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56076 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726645AbgG2LCo (ORCPT ); Wed, 29 Jul 2020 07:02:44 -0400 Received: from mail-lj1-x243.google.com (mail-lj1-x243.google.com [IPv6:2a00:1450:4864:20::243]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7E896C061794 for ; Wed, 29 Jul 2020 04:02:44 -0700 (PDT) Received: by mail-lj1-x243.google.com with SMTP id 185so14336207ljj.7 for ; Wed, 29 Jul 2020 04:02:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=Ue92o8vmM4zCFeyRi4hlpzGK8fvXI3JfJrlh4FPdWS4=; b=g/PNy1qFqTJBHeGKgAYok9s3LuXQ9ykatgG++wn3rNwJGtrgzfFgrB3XU3q1ZBQqQ0 hBqc2vNRHxNqKN/Z2CZgHma8TbGzu2XpkcjLn2ATxKygyzqKtjDr/YvQ4dl8jW3jFCk3 tYeWxabXSwvTF6DqDOt2Rf8HVqTn0ZY4t7y7W1609ScaJnU+33aDPtr3IWKC9M/6YQPx o2KCMyipV4p/mIMtBERsUQfSfSPKmx4RuhR4v8qFY6we0XO4S0irY2GjEbaWgiasznCA TU5a4hkrR2JDz7SuG8J0gQwEGV2lAErW6KuYRFwBllMXtY5qKzdLMHUHu+fNMM8fOc15 Ww+g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=Ue92o8vmM4zCFeyRi4hlpzGK8fvXI3JfJrlh4FPdWS4=; b=ElvWie0XYtwnhx3pyam/SBd6wTTVkbY/OtGYFxjRmCPlxMiXIBD5s1/ejKjZkXIf9B HkjcoDe56tA7I/0WxU5MgbiMB1J7OZmZ0QjAqU2zQM6dUUojoXUC/1R3yOKal3VY1a8N wXJwAVgspmG5MmCwPRQ8Bw8fjWdS/uR6Q/B4WGZHPlWc0vunEjkBpgJ2fDYeopXtKOxg O3Vwh8sN6vwwDdm7UNAOAK6wrp58kyjEourFFW3XGmPupG1YFvh7uCmrIbpGcd9BA/Mc HvDSgWxN80vQiYONdTgE3vptRzyhNZ4Em5h5GDeAOgr0YwjTIAC7dyQEl5BjVK+GnV2h jJeA== X-Gm-Message-State: AOAM532nJlwpVu8dzkcs2SHzf0nSAdlGsIbGxegDZOfj/8MKRpqT7X90 1/c3P2M2TqUwvoeFMFCa4BNLxeugcmkUaA== X-Received: by 2002:a2e:8702:: with SMTP id m2mr9178359lji.183.1596020562795; Wed, 29 Jul 2020 04:02:42 -0700 (PDT) Received: from gilgamesh.semihalf.com (193-106-246-138.noc.fibertech.net.pl. [193.106.246.138]) by smtp.gmail.com with ESMTPSA id e12sm329283ljk.74.2020.07.29.04.02.41 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 29 Jul 2020 04:02:42 -0700 (PDT) From: Grzegorz Jaszczyk To: ssantosh@kernel.org, s-anna@ti.com Cc: grzegorz.jaszczyk@linaro.org, santosh.shilimkar@oracle.com, robh+dt@kernel.org, lee.jones@linaro.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org, wmills@ti.com, praneeth@ti.com, "Andrew F . Davis" , Tero Kristo Subject: [PATCH 2/6] soc: ti: pruss: Add a platform driver for PRUSS in TI SoCs Date: Wed, 29 Jul 2020 13:02:04 +0200 Message-Id: <1596020528-19510-3-git-send-email-grzegorz.jaszczyk@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1596020528-19510-1-git-send-email-grzegorz.jaszczyk@linaro.org> References: <1596020528-19510-1-git-send-email-grzegorz.jaszczyk@linaro.org> Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org From: Suman Anna The Programmable Real-Time Unit - Industrial Communication Subsystem (PRU-ICSS) is present on various TI SoCs such as AM335x or AM437x or the Keystone 66AK2G. Each SoC can have one or more PRUSS instances that may or may not be identical. For example, AM335x SoCs have a single PRUSS, while AM437x has two PRUSS instances PRUSS1 and PRUSS0, with the PRUSS0 being a cut-down version of the PRUSS1. The PRUSS consists of dual 32-bit RISC cores called the Programmable Real-Time Units (PRUs), some shared, data and instruction memories, some internal peripheral modules, and an interrupt controller. The programmable nature of the PRUs provide flexibility to implement custom peripheral interfaces, fast real-time responses, or specialized data handling. The PRU-ICSS functionality is achieved through three different platform drivers addressing a specific portion of the PRUSS. Some sub-modules of the PRU-ICSS IP reuse some of the existing drivers (like davinci mdio driver or the generic syscon driver). This design provides flexibility in representing the different modules of PRUSS accordingly, and at the same time allowing the PRUSS driver to add some instance specific configuration within an SoC. The PRUSS platform driver deals with the overall PRUSS and is used for managing the subsystem level resources like various memories and the CFG module. It is responsible for the creation and deletion of the platform devices for the child PRU devices and other child devices (like Interrupt Controller, MDIO node and some syscon nodes) so that they can be managed by specific platform drivers. The PRUSS interrupt controller is managed by an irqchip driver, while the individual PRU RISC cores are managed by a PRU remoteproc driver. The driver currently supports the AM335x SoC, and support for other TI SoCs will be added in subsequent patches. Signed-off-by: Suman Anna Signed-off-by: Andrew F. Davis Signed-off-by: Tero Kristo Signed-off-by: Grzegorz Jaszczyk --- drivers/soc/ti/Kconfig | 11 ++++ drivers/soc/ti/Makefile | 1 + drivers/soc/ti/pruss.c | 147 +++++++++++++++++++++++++++++++++++++++++++ include/linux/pruss_driver.h | 48 ++++++++++++++ 4 files changed, 207 insertions(+) create mode 100644 drivers/soc/ti/pruss.c create mode 100644 include/linux/pruss_driver.h -- 2.7.4 diff --git a/drivers/soc/ti/Kconfig b/drivers/soc/ti/Kconfig index e192fb7..b934bc3 100644 --- a/drivers/soc/ti/Kconfig +++ b/drivers/soc/ti/Kconfig @@ -101,6 +101,17 @@ config TI_K3_SOCINFO platforms to provide information about the SoC family and variant to user space. +config TI_PRUSS + tristate "TI PRU-ICSS Subsystem Platform drivers" + depends on SOC_AM33XX + select MFD_SYSCON + help + TI PRU-ICSS Subsystem platform specific support. + + Say Y or M here to support the Programmable Realtime Unit (PRU) + processors on various TI SoCs. It's safe to say N here if you're + not interested in the PRU or if you are unsure. + endif # SOC_TI config TI_SCI_INTA_MSI_DOMAIN diff --git a/drivers/soc/ti/Makefile b/drivers/soc/ti/Makefile index 1110e5c..18129aa 100644 --- a/drivers/soc/ti/Makefile +++ b/drivers/soc/ti/Makefile @@ -12,3 +12,4 @@ obj-$(CONFIG_TI_SCI_PM_DOMAINS) += ti_sci_pm_domains.o obj-$(CONFIG_TI_SCI_INTA_MSI_DOMAIN) += ti_sci_inta_msi.o obj-$(CONFIG_TI_K3_RINGACC) += k3-ringacc.o obj-$(CONFIG_TI_K3_SOCINFO) += k3-socinfo.o +obj-$(CONFIG_TI_PRUSS) += pruss.o diff --git a/drivers/soc/ti/pruss.c b/drivers/soc/ti/pruss.c new file mode 100644 index 0000000..c071bb2 --- /dev/null +++ b/drivers/soc/ti/pruss.c @@ -0,0 +1,147 @@ +// SPDX-License-Identifier: GPL-2.0-only +/* + * PRU-ICSS platform driver for various TI SoCs + * + * Copyright (C) 2014-2020 Texas Instruments Incorporated - http://www.ti.com/ + * Author(s): + * Suman Anna + * Andrew F. Davis + */ + +#include +#include +#include +#include +#include +#include +#include +#include + +static int pruss_probe(struct platform_device *pdev) +{ + struct device *dev = &pdev->dev; + struct device_node *np = dev_of_node(dev); + struct device_node *child; + struct pruss *pruss; + struct resource res; + int ret, i, index; + const char *mem_names[PRUSS_MEM_MAX] = { "dram0", "dram1", "shrdram2" }; + + ret = dma_set_coherent_mask(dev, DMA_BIT_MASK(32)); + if (ret) { + dev_err(dev, "failed to set the DMA coherent mask"); + return ret; + } + + pruss = devm_kzalloc(dev, sizeof(*pruss), GFP_KERNEL); + if (!pruss) + return -ENOMEM; + + pruss->dev = dev; + + child = of_get_child_by_name(np, "memories"); + if (!child) { + dev_err(dev, "%pOF is missing its 'memories' node\n", child); + return -ENODEV; + } + + for (i = 0; i < ARRAY_SIZE(mem_names); i++) { + index = of_property_match_string(child, "reg-names", + mem_names[i]); + if (index < 0) { + of_node_put(child); + return index; + } + + if (of_address_to_resource(child, index, &res)) { + of_node_put(child); + return -EINVAL; + } + + pruss->mem_regions[i].va = devm_ioremap(dev, res.start, + resource_size(&res)); + if (!pruss->mem_regions[i].va) { + dev_err(dev, "failed to parse and map memory resource %d %s\n", + i, mem_names[i]); + of_node_put(child); + return -ENOMEM; + } + pruss->mem_regions[i].pa = res.start; + pruss->mem_regions[i].size = resource_size(&res); + + dev_dbg(dev, "memory %8s: pa %pa size 0x%zx va %pK\n", + mem_names[i], &pruss->mem_regions[i].pa, + pruss->mem_regions[i].size, pruss->mem_regions[i].va); + } + of_node_put(child); + + platform_set_drvdata(pdev, pruss); + + pm_runtime_enable(dev); + ret = pm_runtime_get_sync(dev); + if (ret < 0) { + dev_err(dev, "couldn't enable module\n"); + pm_runtime_put_noidle(dev); + goto rpm_disable; + } + + child = of_get_child_by_name(np, "cfg"); + if (!child) { + dev_err(dev, "%pOF is missing its 'cfg' node\n", child); + ret = -ENODEV; + goto rpm_put; + } + + pruss->cfg_regmap = syscon_node_to_regmap(child); + of_node_put(child); + if (IS_ERR(pruss->cfg_regmap)) { + ret = -ENODEV; + goto rpm_put; + } + + ret = devm_of_platform_populate(dev); + if (ret) { + dev_err(dev, "failed to register child devices\n"); + goto rpm_put; + } + + return 0; + +rpm_put: + pm_runtime_put_sync(dev); +rpm_disable: + pm_runtime_disable(dev); + return ret; +} + +static int pruss_remove(struct platform_device *pdev) +{ + struct device *dev = &pdev->dev; + + devm_of_platform_depopulate(dev); + + pm_runtime_put_sync(dev); + pm_runtime_disable(dev); + + return 0; +} + +static const struct of_device_id pruss_of_match[] = { + { .compatible = "ti,am3356-pruss" }, + {}, +}; +MODULE_DEVICE_TABLE(of, pruss_of_match); + +static struct platform_driver pruss_driver = { + .driver = { + .name = "pruss", + .of_match_table = pruss_of_match, + }, + .probe = pruss_probe, + .remove = pruss_remove, +}; +module_platform_driver(pruss_driver); + +MODULE_AUTHOR("Suman Anna "); +MODULE_DESCRIPTION("PRU-ICSS Subsystem Driver"); +MODULE_LICENSE("GPL v2"); diff --git a/include/linux/pruss_driver.h b/include/linux/pruss_driver.h new file mode 100644 index 0000000..0701fe1 --- /dev/null +++ b/include/linux/pruss_driver.h @@ -0,0 +1,48 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +/* + * PRU-ICSS sub-system specific definitions + * + * Copyright (C) 2014-2020 Texas Instruments Incorporated - http://www.ti.com/ + * Suman Anna + */ + +#ifndef _PRUSS_DRIVER_H_ +#define _PRUSS_DRIVER_H_ + +#include + +/* + * enum pruss_mem - PRUSS memory range identifiers + */ +enum pruss_mem { + PRUSS_MEM_DRAM0 = 0, + PRUSS_MEM_DRAM1, + PRUSS_MEM_SHRD_RAM2, + PRUSS_MEM_MAX, +}; + +/** + * struct pruss_mem_region - PRUSS memory region structure + * @va: kernel virtual address of the PRUSS memory region + * @pa: physical (bus) address of the PRUSS memory region + * @size: size of the PRUSS memory region + */ +struct pruss_mem_region { + void __iomem *va; + phys_addr_t pa; + size_t size; +}; + +/** + * struct pruss - PRUSS parent structure + * @dev: pruss device pointer + * @cfg_regmap: regmap for config region + * @mem_regions: data for each of the PRUSS memory regions + */ +struct pruss { + struct device *dev; + struct regmap *cfg_regmap; + struct pruss_mem_region mem_regions[PRUSS_MEM_MAX]; +}; + +#endif /* _PRUSS_DRIVER_H_ */ From patchwork Wed Jul 29 11:02:05 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Grzegorz Jaszczyk X-Patchwork-Id: 247246 Delivered-To: patch@linaro.org Received: by 2002:a92:d244:0:0:0:0:0 with SMTP id v4csp1361544ilg; Wed, 29 Jul 2020 04:03:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxIcM6bR+H23OGPwdGs6g6fULqKh+PkDIEqltKh94cLPaI5nhsQyFim4gx4eQYB0AEndTqT X-Received: by 2002:a17:906:b150:: with SMTP id bt16mr21714733ejb.89.1596020611852; Wed, 29 Jul 2020 04:03:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596020611; cv=none; d=google.com; s=arc-20160816; b=IVD21KjuTF3GGnNgPlV4rqlPHvLQiiv7yZKehBOcaecnsSqc6pMFyMsuyNLWIxDQct I0XwCwl5SlOrc8yd9egnl1vNK1xdjrM4rKpGmqiB+w9Fp9yAv4QlMR+cbqfwLgJvHJRK AfzWjtGzQFtT638ShB08TzG3uyddkbKWPoOItt8V0XL6QBWQ9wt+tvI63AtQhpssBbHm kubCMkz/0UBnzdHbukmR0xvNCR6tmONGuCNsvnAnGhTCyd8pSJvQAVOa8PoiR0XdHlvC 0ejpYjIdoqv6WAp83VG74VRnqD9ICXViXCSKlKJPNQS4Vav2pUP4+TXbzhCWImiCvVE8 393A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=Yee6qgJdq7q4hHcTlE+UoNb1R6ONA6jnPjk4iWaQESo=; b=V8y0rdHMFXHL2pBZ2ZXKadS0gLLjHbftYkpicf1vuwIKBE9mrOSlimhuwNdbasmd5b v+Jwey6F11zn6+SSLSuMF744Z2XEHGP6agj0tvBnm0u8tK4MxyUxLx9OMWsTUgwiXJOH XlWKBZQAdWyeelxeqt3DFRIK+Bkuf8JEmS7dkUC40kRhOC3730T3xrDMmbv2X4LOi/at +eg4fYp9FDY8az5nfIbIBEvMqDc6oCEBozinJEA63lgeCJTP/wTh+eoh8ME/r3b/XTLo rMGj7lIpzq1gi/E+jz44zGtAJZQ10rGVr1hz86B+HbbqmKP4SyYdeCNRN90m3btdthyA Ol1w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="HIA/wMQ0"; 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=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ce15si1146353edb.291.2020.07.29.04.03.31; Wed, 29 Jul 2020 04:03:31 -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=@linaro.org header.s=google header.b="HIA/wMQ0"; 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=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726724AbgG2LD1 (ORCPT + 6 others); Wed, 29 Jul 2020 07:03:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56090 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726797AbgG2LCr (ORCPT ); Wed, 29 Jul 2020 07:02:47 -0400 Received: from mail-lj1-x241.google.com (mail-lj1-x241.google.com [IPv6:2a00:1450:4864:20::241]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ED8BCC0619D4 for ; Wed, 29 Jul 2020 04:02:46 -0700 (PDT) Received: by mail-lj1-x241.google.com with SMTP id r19so24519181ljn.12 for ; Wed, 29 Jul 2020 04:02:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=Yee6qgJdq7q4hHcTlE+UoNb1R6ONA6jnPjk4iWaQESo=; b=HIA/wMQ08IF71QrwvX9sk9BBYoLvfOzUHeBd/6WYUrzI43D1F/BAM7nC01i1AWHwac DEQDy5JeTgggiXmQpgDYYY40VWflRBGJ3VTCXAPZYBotqfYPEMHeRW2HaqoCgYlCpoZS r6PRil7f7+kyW4WR1ZErkwm9zrI0TrnaLPCqaFYlYcvnkrsRkNYgj32i3AlNfevIgaaH 6x5PkoPbVdUU+ndKbI3vIgRdLBGLWtwkoCGwBw0ccWeBdkYe4gwjwNoYsRgXW9W3tQPy P743tcczP3nGofn81HtBGEBW5IqbdpzB+iPN8tiScsP5Xi1CR9XrXsoh+vlwbHySEfd+ eVtg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=Yee6qgJdq7q4hHcTlE+UoNb1R6ONA6jnPjk4iWaQESo=; b=C8uygJ0mVd3mml8iOfiHgO0x9rz6GOR2vs4Zz+sHAl0+KSrXPlGa2yCVvpUmJ6tMw2 RFM9sBYC+BuW2MslfWo/URvuWU5xxuXCCy6ftMCQo7TGEY/cEfoTFOXmLeg8bVaryHgz MBSzZoopPoANEtVp8Bfiddn9W/7S5iwhZjaPkzEuql7zrk8TDr3j3fhlkWgqZ0XNy8oQ QuYPgvX6nxas9CoEtTs8M4EMkfiV7Jo3J1HxcRASMtEAOK0LaP355fATlRJ2ct7XjyIC mPYYVEpGKelUnibmISuHk0y2chBIe+YU5FbBbYj2rEFG8Hp27yqd7p02en58/zWt4t3C ua5g== X-Gm-Message-State: AOAM533EuMr9BcK8juQ9YMtlq+Hr8siMxeniy6/CArSGoNDhfPfarZwQ eCKZ/yGB23AOQ6RccUuiLXFk9w== X-Received: by 2002:a2e:9c8e:: with SMTP id x14mr13574093lji.451.1596020565351; Wed, 29 Jul 2020 04:02:45 -0700 (PDT) Received: from gilgamesh.semihalf.com (193-106-246-138.noc.fibertech.net.pl. [193.106.246.138]) by smtp.gmail.com with ESMTPSA id e12sm329283ljk.74.2020.07.29.04.02.44 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 29 Jul 2020 04:02:44 -0700 (PDT) From: Grzegorz Jaszczyk To: ssantosh@kernel.org, s-anna@ti.com Cc: grzegorz.jaszczyk@linaro.org, santosh.shilimkar@oracle.com, robh+dt@kernel.org, lee.jones@linaro.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org, wmills@ti.com, praneeth@ti.com, "Andrew F . Davis" Subject: [PATCH 3/6] soc: ti: pruss: Add support for PRU-ICSSs on AM437x SoCs Date: Wed, 29 Jul 2020 13:02:05 +0200 Message-Id: <1596020528-19510-4-git-send-email-grzegorz.jaszczyk@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1596020528-19510-1-git-send-email-grzegorz.jaszczyk@linaro.org> References: <1596020528-19510-1-git-send-email-grzegorz.jaszczyk@linaro.org> Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org From: Suman Anna The AM437x SoCs have two different PRU-ICSS subsystems: PRU-ICSS1 and a smaller PRU-ICSS0. Enhance the PRUSS platform driver to support both the PRU-ICSS sub-systems on these SoCs. The PRU-ICSS1 on AM437x is very similar to the PRU-ICSS on AM33xx except for few minor differences - increased Instruction RAM, increased Shared Data RAM2, and 1 less interrupt (PRUSS host interrupt 7 which is redirected to the other PRUSS) towards the MPU INTC. The PRU-ICSS0 is a cut-down version of the IP, with less DRAM per PRU, no Shared DRAM etc. It also does not have direct access to L3 bus regions, there is a single interface to L3 for both PRUSS0 and PRUSS1, and it would have to go through the PRUSS1's interface. The PRUSS_SYSCFG register is reserved on PRUSS0, so any external access requires the programming the corresponding PRUSS_SYSCFG register in PRUSS1. It does have its own dedicated I/O lines though. Note that this instance does not support any PRU Ethernet related use cases. The adaptation uses SoC-specific compatibles in the driver and uses a newly introduced pruss_match_private_data structure and the pruss_get_private_data() function to retrieve a PRUSS instance specific data using a device-name based lookup logic. The reset and the L3 external access are managed by the parent interconnect ti-sysc bus driver so that PRUSS1 and PRUSS0 can be independently supported. Signed-off-by: Suman Anna Signed-off-by: Andrew F. Davis Signed-off-by: Grzegorz Jaszczyk --- drivers/soc/ti/Kconfig | 2 +- drivers/soc/ti/pruss.c | 35 ++++++++++++++++++++++++++++++++++- 2 files changed, 35 insertions(+), 2 deletions(-) -- 2.7.4 diff --git a/drivers/soc/ti/Kconfig b/drivers/soc/ti/Kconfig index b934bc3..40d6a22 100644 --- a/drivers/soc/ti/Kconfig +++ b/drivers/soc/ti/Kconfig @@ -103,7 +103,7 @@ config TI_K3_SOCINFO config TI_PRUSS tristate "TI PRU-ICSS Subsystem Platform drivers" - depends on SOC_AM33XX + depends on SOC_AM33XX || SOC_AM43XX select MFD_SYSCON help TI PRU-ICSS Subsystem platform specific support. diff --git a/drivers/soc/ti/pruss.c b/drivers/soc/ti/pruss.c index c071bb2..04938ba 100644 --- a/drivers/soc/ti/pruss.c +++ b/drivers/soc/ti/pruss.c @@ -17,6 +17,14 @@ #include #include +/** + * struct pruss_private_data - PRUSS driver private data + * @has_no_sharedram: flag to indicate the absence of PRUSS Shared Data RAM + */ +struct pruss_private_data { + bool has_no_sharedram; +}; + static int pruss_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; @@ -25,8 +33,15 @@ static int pruss_probe(struct platform_device *pdev) struct pruss *pruss; struct resource res; int ret, i, index; + const struct pruss_private_data *data; const char *mem_names[PRUSS_MEM_MAX] = { "dram0", "dram1", "shrdram2" }; + data = of_device_get_match_data(&pdev->dev); + if (IS_ERR(data)) { + dev_err(dev, "missing private data\n"); + return -ENODEV; + } + ret = dma_set_coherent_mask(dev, DMA_BIT_MASK(32)); if (ret) { dev_err(dev, "failed to set the DMA coherent mask"); @@ -45,7 +60,14 @@ static int pruss_probe(struct platform_device *pdev) return -ENODEV; } - for (i = 0; i < ARRAY_SIZE(mem_names); i++) { + for (i = 0; i < PRUSS_MEM_MAX; i++) { + /* + * On AM437x one of two PRUSS units don't contain Shared RAM, + * skip it + */ + if (data && data->has_no_sharedram && i == PRUSS_MEM_SHRD_RAM2) + continue; + index = of_property_match_string(child, "reg-names", mem_names[i]); if (index < 0) { @@ -126,8 +148,19 @@ static int pruss_remove(struct platform_device *pdev) return 0; } +/* instance-specific driver private data */ +static const struct pruss_private_data am437x_pruss1_data = { + .has_no_sharedram = false, +}; + +static const struct pruss_private_data am437x_pruss0_data = { + .has_no_sharedram = true, +}; + static const struct of_device_id pruss_of_match[] = { { .compatible = "ti,am3356-pruss" }, + { .compatible = "ti,am4376-pruss0", .data = &am437x_pruss0_data, }, + { .compatible = "ti,am4376-pruss1", .data = &am437x_pruss1_data, }, {}, }; MODULE_DEVICE_TABLE(of, pruss_of_match); From patchwork Wed Jul 29 11:02:06 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Grzegorz Jaszczyk X-Patchwork-Id: 247243 Delivered-To: patch@linaro.org Received: by 2002:a92:d244:0:0:0:0:0 with SMTP id v4csp1361091ilg; Wed, 29 Jul 2020 04:03:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwNLAVoHrT9DliOuPOt4o/2Eg/uLfr1oPymymtJ/gYKI+qtRRnxIsVn98rBfVYPUDOGJr9B X-Received: by 2002:a17:906:a081:: with SMTP id q1mr28415225ejy.499.1596020581767; Wed, 29 Jul 2020 04:03:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596020581; cv=none; d=google.com; s=arc-20160816; b=A3uEhYmosnAb3MR+eWstNuJmOSK7cwWhpG7LlhQcgdZhupXUc/aUlQ7sWFKm6dFFWI +AhNm60KZUDQaqquut2NURnW3+Pjs1UI84Z8YM0WNdQrWyBHaxhE+sJDqaMoj4Ic8xwK l+Pgx7uUJ6uEbQD55x14M9/KtUXSix2gYWnZ5JH+8fvtL5wmk8tt8LYHWFvpMOePcnpa 2XBwmimdJiT1Xzw5Qi+N+C4tplVCfMKB/wY9R9mu1rIJzXqvmfz9oBAFCCYE7YMxHLlH nhcufq0rnV8YZB43CoBdNWS5tQoYREzEU9OhZ+qFmYukF1OXEAU4wIs0dHdQs3kbXnng S9jA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=QiFmk3KSZQ39stE85or5bcAb3a7bPvoIf0tQyJ62VJ0=; b=YpOarhisOBJuPMT6mUjAmaWqh42477vU/M/jnHf3hpq2E81rOELMwz4ynMyohHTXG7 cYgV6ElIMA8PYq4/LJesca3WPQ85CcWCvawENLNy0lSu6uXnjfeYC0U9fXS0x4oLE0ie H3FlYjT0cLpk65knDqIIs57Sv0j2MDzQUJRVIzuS52wozHkLDNtJCaaH6tbCjQBSVNBt How4H2kYulzYh+adI+oxcWe6I5+uzR87bbaRgx1O+XiTRxnBopqIKVzTv3lDWUB4lCMV xoGZskG9pbMREWOdLCtjcDC+CWMx9pmGYCwLu08heoav/I5q+5HgZFwwpfZiCq121E3t WjBw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="sjN/+9P1"; 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=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id cf15si1033818edb.350.2020.07.29.04.03.01; Wed, 29 Jul 2020 04:03:01 -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=@linaro.org header.s=google header.b="sjN/+9P1"; 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=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726751AbgG2LC7 (ORCPT + 6 others); Wed, 29 Jul 2020 07:02:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56098 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726816AbgG2LCu (ORCPT ); Wed, 29 Jul 2020 07:02:50 -0400 Received: from mail-lf1-x144.google.com (mail-lf1-x144.google.com [IPv6:2a00:1450:4864:20::144]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EB3A9C0619D5 for ; Wed, 29 Jul 2020 04:02:48 -0700 (PDT) Received: by mail-lf1-x144.google.com with SMTP id b11so12775094lfe.10 for ; Wed, 29 Jul 2020 04:02:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=QiFmk3KSZQ39stE85or5bcAb3a7bPvoIf0tQyJ62VJ0=; b=sjN/+9P1NpBZqS3azkNDN3xCe1tY/7xLBJ2o7Xs3c2Q8VnqJzIAUgsawV/A8lampUZ 5zj0+/hWnT6eeRFphtbjTGufo95GIyWm+x1dLe9VjSlRdFhiv+bE15ysqb7LjWuxFn4X glVKT1jE5XZBOY0UVx/wxfbnwPD+Y9AyVlZmbbqOCo5zhy5yx1o44tMKMva0dpxThKdS m93Mna9G4TTwqk02ddF9tz/G78xCqut7P768i43+rVRNMcewe8CkrbHT+VSPLZKlR8OT Jfi2HRWV0Kvmi800RnmJM2YYnZX+FExF1/5DHpTBDgLRZ6uU4bbfLfvWRT8ypxlXs46H 4JSg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=QiFmk3KSZQ39stE85or5bcAb3a7bPvoIf0tQyJ62VJ0=; b=t2JKliRiJUMfnR/R7auC5kODSppK65zYSBe2PlxgEEwP4HSOalxiDjW3HAkuIqW8Z7 hczIKZQMHaFje0751uSL/JygtkhtHZhBdUKSAXJNkOTz18PiimaaDH4xkqmi3MU+sLFJ pauCm/Y2zvp7tENAPXdOfC3cJWlUqARTyNFVW17Mm4jOJsJBWaXkw9wlrK/5sutUcABk S/odH8lilV04gIOwTccYOrX0gQ5sqR4UilWd9dJUbZrFWnf8JR07liZTnXRrPILcUrOx cHLE1Zb7TDqxgvZyqMXSJtcWAvwHHIpHWoHFH2wsjp4uEgqtpmTLUOVOtD2C16v5V5ag nqPw== X-Gm-Message-State: AOAM5325ryREeGOaOzhf5CeciyzJEAoIyU1X0XY6T5VON4CZoBLsdNUR rHW+gKoTipAvrlYfAVQX8JmWkA== X-Received: by 2002:a05:6512:6d6:: with SMTP id u22mr16807134lff.13.1596020567419; Wed, 29 Jul 2020 04:02:47 -0700 (PDT) Received: from gilgamesh.semihalf.com (193-106-246-138.noc.fibertech.net.pl. [193.106.246.138]) by smtp.gmail.com with ESMTPSA id e12sm329283ljk.74.2020.07.29.04.02.46 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 29 Jul 2020 04:02:46 -0700 (PDT) From: Grzegorz Jaszczyk To: ssantosh@kernel.org, s-anna@ti.com Cc: grzegorz.jaszczyk@linaro.org, santosh.shilimkar@oracle.com, robh+dt@kernel.org, lee.jones@linaro.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org, wmills@ti.com, praneeth@ti.com Subject: [PATCH 4/6] soc: ti: pruss: Add support for PRU-ICSS subsystems on AM57xx SoCs Date: Wed, 29 Jul 2020 13:02:06 +0200 Message-Id: <1596020528-19510-5-git-send-email-grzegorz.jaszczyk@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1596020528-19510-1-git-send-email-grzegorz.jaszczyk@linaro.org> References: <1596020528-19510-1-git-send-email-grzegorz.jaszczyk@linaro.org> Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org From: Suman Anna The AM57xx family of SoCs supports two PRU-ICSS instances, each of which has two PRU processor cores. The two PRU-ICSS instances are identical to each other, and are very similar to the PRU-ICSS1 of AM33xx/AM43xx except for a few minor differences like the RAM sizes and the number of interrupts coming into the MPU INTC. They do not have a programmable module reset line unlike those present on AM33xx/AM43xx SoCs. The modules are reset just like any other IP with the SoC's global cold/warm resets. Each PRU-ICSS's INTC is also preceded by a Crossbar that enables multiple external events to be routed to a specific number of input interrupt events. Any interrupt event directed towards PRUSS needs this crossbar to be setup properly on the firmware side. The existing PRUSS platform driver has been enhanced to support these AM57xx PRU-ICSS instances through new AM57xx specific compatible for properly probing and booting all the different PRU cores in each PRU-ICSS processor subsystem. A build dependency with SOC_DRA7XX is also added to enable the driver to be built in AM57xx-only configuration (there is no separate Kconfig option for AM57xx vs DRA7xx). Signed-off-by: Suman Anna Signed-off-by: Grzegorz Jaszczyk --- drivers/soc/ti/Kconfig | 2 +- drivers/soc/ti/pruss.c | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) -- 2.7.4 diff --git a/drivers/soc/ti/Kconfig b/drivers/soc/ti/Kconfig index 40d6a22..99dbc14 100644 --- a/drivers/soc/ti/Kconfig +++ b/drivers/soc/ti/Kconfig @@ -103,7 +103,7 @@ config TI_K3_SOCINFO config TI_PRUSS tristate "TI PRU-ICSS Subsystem Platform drivers" - depends on SOC_AM33XX || SOC_AM43XX + depends on SOC_AM33XX || SOC_AM43XX || SOC_DRA7XX select MFD_SYSCON help TI PRU-ICSS Subsystem platform specific support. diff --git a/drivers/soc/ti/pruss.c b/drivers/soc/ti/pruss.c index 04938ba..5df4caa 100644 --- a/drivers/soc/ti/pruss.c +++ b/drivers/soc/ti/pruss.c @@ -161,6 +161,7 @@ static const struct of_device_id pruss_of_match[] = { { .compatible = "ti,am3356-pruss" }, { .compatible = "ti,am4376-pruss0", .data = &am437x_pruss0_data, }, { .compatible = "ti,am4376-pruss1", .data = &am437x_pruss1_data, }, + { .compatible = "ti,am5728-pruss" }, {}, }; MODULE_DEVICE_TABLE(of, pruss_of_match); From patchwork Wed Jul 29 11:02:07 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Grzegorz Jaszczyk X-Patchwork-Id: 247244 Delivered-To: patch@linaro.org Received: by 2002:a92:d244:0:0:0:0:0 with SMTP id v4csp1361293ilg; Wed, 29 Jul 2020 04:03:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz2IPwZiSKbeA6B0UxalSNqO0Co9Sw0MO5YQE1SLrPNVDVLe+Ej1dpwGG2KihfBDHgbqi79 X-Received: by 2002:aa7:ccd5:: with SMTP id y21mr29739116edt.91.1596020596883; Wed, 29 Jul 2020 04:03:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596020596; cv=none; d=google.com; s=arc-20160816; b=c4THCk8IWRf2itBhua0IfVD7GdYt2XcPsciu8v37vW2qpQPxnBPuleGFCU6BaIIXaY oxShIncZioTbQSZiyFwhVB69IUQXW9BETouc/Yj/WZBfS/ruYo+QwmNCa495z9IhrNEz o+iREkL9jocaYO6C77FSd8GBRdkfcqUebwKQB4ENLXAbsTqXvE3gMyf5XqKo34rm2rlw Wap/olvRy53EH43AA4QMTZYGZ+Dn5BxQ5yYSudiWf8MYQZDVZ3ASGrNEQf9fmFwZR4x8 huiTkWytmhMgXwfqxdR5Rk8viyYExplj8K8vOow+oKQjA/mqly83LaSIEwLpx8OzmZcI GzQA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=FyosKiUG1TEw/awaC9dtkQGLFQT+7T/cshoI2oy7Wsk=; b=G/ay+S3JaQTKC0b6GbyQBC43ev2CeLeFkIwcXJtBYmLn7gBuF/ugGeGyXAn49AZAib LSeCLVqomUXxbCIYUDceQ9mDtJncsz7eyBxcIpikox/ucYalme7zfPpwImrYCi8JCi31 huWbw2yXSe9ppp2qC09Pw0pmbTEo/jAZh4/ou83bqd1Fb7Sys19KQ1i6hjNUjpDYjAoQ FcTj0J3cUpOmz1Leg00aqzjXIcyGgg8ZTLiYRyzGP64KizRu5Hdh37mdWkjUv59XEhwr kkXIpXKeTtdh5am6S+ahKUHL4wEqYLg4A6UekiJj9bBirBv8Z7OBEoNTBPbPgTTYMaBU RDgw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Bm9FpQwJ; 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=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bi22si1152002edb.398.2020.07.29.04.03.16; Wed, 29 Jul 2020 04:03:16 -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=@linaro.org header.s=google header.b=Bm9FpQwJ; 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=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726816AbgG2LDA (ORCPT + 6 others); Wed, 29 Jul 2020 07:03:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56114 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726821AbgG2LCy (ORCPT ); Wed, 29 Jul 2020 07:02:54 -0400 Received: from mail-lf1-x141.google.com (mail-lf1-x141.google.com [IPv6:2a00:1450:4864:20::141]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C1D38C061794 for ; Wed, 29 Jul 2020 04:02:52 -0700 (PDT) Received: by mail-lf1-x141.google.com with SMTP id v15so8231399lfg.6 for ; Wed, 29 Jul 2020 04:02:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=FyosKiUG1TEw/awaC9dtkQGLFQT+7T/cshoI2oy7Wsk=; b=Bm9FpQwJkxa0g3btzp9YwxLVyI5W3BkWDQ9/hNloBuojKm6pp+k5TaHmeRe7YubDPj 3Lkh6IN8F6YwHAVK383LGm2196M9bjOnBJFiYaWXvBvchtmjyZH5WroS5B0mxa+oli97 jW4fswZouyyugZFUTNJ1DnjX/mrRI3dpd4TmMnObbiDDLUPjNHTB4Jj4hrUxos2ZN646 bXykKbRrIrtnGycLbU9GJhBuxl3QmuFPL8D4LG5ELAxNXiIg/Gnr2xe7ygPyAtzDi99e Qz1HYbHaP2Uw9TmuOGeHmnJlPNPAzdl2kR4dk+1uYyCMfyMlYySd35uUCzpvawtKZq4Z vdiw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=FyosKiUG1TEw/awaC9dtkQGLFQT+7T/cshoI2oy7Wsk=; b=kv71tbLOQoq6fVZQSo/y5dZJVayre3rfPE4gQWnJzYopKtNU4drizbFx6Hlmm7y6fL 5ZDWxLGC1AQ7Ml88w+hJ0/XTDRo8vJBb/ade6mLmysVHOktRzknBg4jPp3TYYMT/cvZc HVGAMu91pEfBoeT7n44EJVbiLr1QrSumrOxozMe/d+ls8V1PZJNvf7OGYMpggOhTFKJk atQOgopuWQDmCcN1Yzn/4ADKvnGZfHXPINAtvpjAHQNCwX8ZPplXZqg74GtVASw3YvDq wd53qD9FejQePnct/pl5CMToh5+BhIgj/ZRKuHaLynq5/QTzJcYghsLrcsZvPbzTDVfL BnqA== X-Gm-Message-State: AOAM530rFOGuy/i+LZJychp/V8MTieDklppwmskIc7fg2ykkHz0Q7N43 uRpMDbWhTNlJTACFVI0xCSeBOg== X-Received: by 2002:a19:228a:: with SMTP id i132mr17056699lfi.178.1596020571254; Wed, 29 Jul 2020 04:02:51 -0700 (PDT) Received: from gilgamesh.semihalf.com (193-106-246-138.noc.fibertech.net.pl. [193.106.246.138]) by smtp.gmail.com with ESMTPSA id e12sm329283ljk.74.2020.07.29.04.02.50 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 29 Jul 2020 04:02:50 -0700 (PDT) From: Grzegorz Jaszczyk To: ssantosh@kernel.org, s-anna@ti.com Cc: grzegorz.jaszczyk@linaro.org, santosh.shilimkar@oracle.com, robh+dt@kernel.org, lee.jones@linaro.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org, wmills@ti.com, praneeth@ti.com, "Andrew F . Davis" Subject: [PATCH 5/6] soc: ti: pruss: Add support for PRU-ICSS subsystems on 66AK2G SoC Date: Wed, 29 Jul 2020 13:02:07 +0200 Message-Id: <1596020528-19510-6-git-send-email-grzegorz.jaszczyk@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1596020528-19510-1-git-send-email-grzegorz.jaszczyk@linaro.org> References: <1596020528-19510-1-git-send-email-grzegorz.jaszczyk@linaro.org> Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org From: Suman Anna The 66AK2G SoC supports two PRU-ICSS instances, named PRUSS0 and PRUSS1, each of which has two PRU processor cores. The two PRU-ICSS instances are identical to each other with few minor SoC integration differences, and are very similar to the PRU-ICSS1 of AM57xx/AM43xx. The Shared Data RAM size is larger and the number of interrupts coming into MPU INTC is like the instances on AM437x. There are also few other differences attributing to integration in Keystone architecture (like no SYSCFG register or PRCM handshake protocols). Other IP level differences include different constant table, differences in system event interrupt input sources etc. They also do not have a programmable module reset line like those present on AM33xx/AM43xx SoCs. The modules are reset just like any other IP with the SoC's global cold/warm resets. The existing PRUSS platform driver has been enhanced to support these 66AK2G PRU-ICSS instances through new 66AK2G specific compatible for properly probing and booting all the different PRU cores in each PRU-ICSS processor subsystem. A build dependency with ARCH_KEYSTONE is added to enable the driver to be built in K2G-only configuration. Signed-off-by: Andrew F. Davis Signed-off-by: Suman Anna Signed-off-by: Grzegorz Jaszczyk --- drivers/soc/ti/Kconfig | 2 +- drivers/soc/ti/pruss.c | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) -- 2.7.4 diff --git a/drivers/soc/ti/Kconfig b/drivers/soc/ti/Kconfig index 99dbc14..c290343 100644 --- a/drivers/soc/ti/Kconfig +++ b/drivers/soc/ti/Kconfig @@ -103,7 +103,7 @@ config TI_K3_SOCINFO config TI_PRUSS tristate "TI PRU-ICSS Subsystem Platform drivers" - depends on SOC_AM33XX || SOC_AM43XX || SOC_DRA7XX + depends on SOC_AM33XX || SOC_AM43XX || SOC_DRA7XX || ARCH_KEYSTONE select MFD_SYSCON help TI PRU-ICSS Subsystem platform specific support. diff --git a/drivers/soc/ti/pruss.c b/drivers/soc/ti/pruss.c index 5df4caa..d5f128e 100644 --- a/drivers/soc/ti/pruss.c +++ b/drivers/soc/ti/pruss.c @@ -162,6 +162,7 @@ static const struct of_device_id pruss_of_match[] = { { .compatible = "ti,am4376-pruss0", .data = &am437x_pruss0_data, }, { .compatible = "ti,am4376-pruss1", .data = &am437x_pruss1_data, }, { .compatible = "ti,am5728-pruss" }, + { .compatible = "ti,k2g-pruss" }, {}, }; MODULE_DEVICE_TABLE(of, pruss_of_match); From patchwork Wed Jul 29 11:02:08 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Grzegorz Jaszczyk X-Patchwork-Id: 247245 Delivered-To: patch@linaro.org Received: by 2002:a92:d244:0:0:0:0:0 with SMTP id v4csp1361313ilg; Wed, 29 Jul 2020 04:03:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx6MrRtfF7RkZsGjIekqm4jDotnHu7qT6LRPYPVmeipXk3/NPJMr/WVCGSrP/aOD6FKxF6K X-Received: by 2002:a17:906:c04f:: with SMTP id bm15mr20101681ejb.207.1596020598142; Wed, 29 Jul 2020 04:03:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596020598; cv=none; d=google.com; s=arc-20160816; b=CnUJ9RxzvyvMgi3QzL0cdTiRNOfArjHenMST/VgUPqioH+v+FfFPQw17kNFU8ZRuMD bDoc2il81MwjqOdaE7ek5Z7HuUD+99Q5PTUKgAnzwWLGcI9kzfQBQqTHRRVG5/8cOAUP ccBbGa2DcdXYHcVrCDQ53K2o5/BmiSwGm+xT1Axu3vqaDmrskNceSxm+ZudyIrRA2fvS WDTo9myYkyV72txZfps7obliQs87Y26O81hP322q+3li3dsP3MhkcNqEEymal0IDNA+9 IdvtFkU8+qqVVzDyq+OQIqOVis3pNQzi9OI9OzP95UWw2TGjgQER5bAtjmQ58v+/ZQjI WFcw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=gf7cv2SFIbdtlnGIIkL7k9OE8WL9LTH6+emgR/zQp4Y=; b=JB+DBM2aP4rC0ayDrITr8gg0JyvL4DfZfuVvHGr4yVkZdH85hoVdUOhwDpaihh77CN ja0hnnE4x33gQPLkUnJWKsvVCfnCyZvH0XD44YwkUxdJWjJySzWUg8hm+HrDZfiCXzvl r9qFHcIJnHH5YU8dduIBu1fsgtxGgSEN4zY7d3whZAKB5qe/c7IuZUM7haxdYInKf1dm S6iENv8BJ2UDfjmaFxBcDXJI31ddU+YQKXEsaXnmmxRjSk5PgKPwYnGdltkGXZikUlPO 5eGeu7Y1dNvLTa3P+d07hFdNiFkVzJt/mK9PeuwHzzYitc890izodswT79eOF68LajcW S/qQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ZLHbE57X; 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=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bi22si1152002edb.398.2020.07.29.04.03.17; Wed, 29 Jul 2020 04:03:18 -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=@linaro.org header.s=google header.b=ZLHbE57X; 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=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726909AbgG2LDR (ORCPT + 6 others); Wed, 29 Jul 2020 07:03:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56128 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726842AbgG2LC4 (ORCPT ); Wed, 29 Jul 2020 07:02:56 -0400 Received: from mail-lj1-x242.google.com (mail-lj1-x242.google.com [IPv6:2a00:1450:4864:20::242]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7F9C3C0619DA for ; Wed, 29 Jul 2020 04:02:55 -0700 (PDT) Received: by mail-lj1-x242.google.com with SMTP id b25so24557559ljp.6 for ; Wed, 29 Jul 2020 04:02:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=gf7cv2SFIbdtlnGIIkL7k9OE8WL9LTH6+emgR/zQp4Y=; b=ZLHbE57Xrx/TPW6fyBjKZ4HFPTD8aCMjiF/g9R77/NYupMLxx0EkeWq8hl66ENUsJn AvubfKp5u5Gv7drFCny8A1HL+Yd5qU8PG6b2Yp+6K8v0iufbi1Z1XkAG0pG1m8Y2MVN8 s6KGiIvAnieDGi8/CFOkjP2KEUnPozZ1X7o3voWYEXDwhZd2QXKenDTQff6spCGx2rdR +rEF9n9gnL+Rp0fQGFDQ38POtiTNTI4QpNfbRQw34nA8z67m6VhIUFSKreBbuQdbfx4O cxRqko6iBR8sYfvOIK80V3I3xSbbPwJGocWUinntbJUpLAQLee9Ene5dMwcxjbR2JJWU HVsw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=gf7cv2SFIbdtlnGIIkL7k9OE8WL9LTH6+emgR/zQp4Y=; b=BMW+lVUqWNX7AVWxKCrL/+FV3Z9Mrvpa+jTP8fqSwgfMQ9GsFNL1Yb/+298DfDQ5HT o2B35iF2GQTE8aHv4Fh42BzNvT38+IxKLEkC31adY1HnRvcVivia+8L80TUlhwbcgTW8 lnXnIDpxNZRnwxjleBQd+MtOTCyuBUIq8NEHCT1MC2qKkl2AgpyXBxd+7gidmP8TXBZl 0q7QMMpuoFGFcFpMuqAdem1Y+n2FBO874JjB8vKSMfgKILKu1r8bFTH3J/ljqOzXeUvY SQoc55MmfX6/RZkPNi9lfpiuprSfpfwZGhzAAWNMDMjeeH2QjxcbOsNJTq7Ll3oFG3LE JdRA== X-Gm-Message-State: AOAM530oUBZlbHVCk68jHK9pXdnsDSBhhGbNOVzBfKp1ncz3L/5NHmlN BWKxSggriOf92Tz77cFXcnv/HA== X-Received: by 2002:a05:651c:319:: with SMTP id a25mr15139192ljp.272.1596020573965; Wed, 29 Jul 2020 04:02:53 -0700 (PDT) Received: from gilgamesh.semihalf.com (193-106-246-138.noc.fibertech.net.pl. [193.106.246.138]) by smtp.gmail.com with ESMTPSA id e12sm329283ljk.74.2020.07.29.04.02.52 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 29 Jul 2020 04:02:53 -0700 (PDT) From: Grzegorz Jaszczyk To: ssantosh@kernel.org, s-anna@ti.com Cc: grzegorz.jaszczyk@linaro.org, santosh.shilimkar@oracle.com, robh+dt@kernel.org, lee.jones@linaro.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org, wmills@ti.com, praneeth@ti.com Subject: [PATCH 6/6] soc: ti: pruss: enable support for ICSSG subsystems on K3 AM65x SoCs Date: Wed, 29 Jul 2020 13:02:08 +0200 Message-Id: <1596020528-19510-7-git-send-email-grzegorz.jaszczyk@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1596020528-19510-1-git-send-email-grzegorz.jaszczyk@linaro.org> References: <1596020528-19510-1-git-send-email-grzegorz.jaszczyk@linaro.org> Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org From: Suman Anna The K3 AM65x family of SoCs have the next generation of the PRU-ICSS processor subsystem capable of supporting Gigabit Ethernet, and is commonly referred to as ICSSG. These SoCs contain typically three ICSSG instances named ICSSG0, ICSSG1 and ICSSG2. The three ICSSGs are identical to each other for the most part with minor SoC integration differences and capabilities. The ICSSG2 supports slightly enhanced features like SGMII mode Ethernet, while the ICSS0 and ICSSG1 instances are limited to MII mode only. The ICSSGs on K3 AM65x SoCs are in general super-sets of the PRUSS on the AM57xx/66AK2G SoCs. They include two additional auxiliary PRU cores called RTUs and few other additional sub-modules. The interrupt integration is also different on the K3 AM65x SoCs and are propagated through various SoC-level Interrupt Router and Interrupt Aggregator blocks. Other IP level differences include different constant tables, differences in system event interrupt input sources etc. They also do not have a programmable module reset line like those present on AM33xx/AM43xx SoCs. The modules are reset just like any other IP with the SoC's global cold/warm resets. The existing pruss platform driver has been updated to support these new ICSSG instances through new AM65x specific compatibles. A build dependency with ARCH_K3 is added to enable building all the existing PRUSS platform drivers for this ARMv8 platform. Signed-off-by: Suman Anna Signed-off-by: Grzegorz Jaszczyk --- drivers/soc/ti/Kconfig | 2 +- drivers/soc/ti/pruss.c | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) -- 2.7.4 diff --git a/drivers/soc/ti/Kconfig b/drivers/soc/ti/Kconfig index c290343..f5b82ff 100644 --- a/drivers/soc/ti/Kconfig +++ b/drivers/soc/ti/Kconfig @@ -103,7 +103,7 @@ config TI_K3_SOCINFO config TI_PRUSS tristate "TI PRU-ICSS Subsystem Platform drivers" - depends on SOC_AM33XX || SOC_AM43XX || SOC_DRA7XX || ARCH_KEYSTONE + depends on SOC_AM33XX || SOC_AM43XX || SOC_DRA7XX || ARCH_KEYSTONE || ARCH_K3 select MFD_SYSCON help TI PRU-ICSS Subsystem platform specific support. diff --git a/drivers/soc/ti/pruss.c b/drivers/soc/ti/pruss.c index d5f128e..ccc9783 100644 --- a/drivers/soc/ti/pruss.c +++ b/drivers/soc/ti/pruss.c @@ -163,6 +163,7 @@ static const struct of_device_id pruss_of_match[] = { { .compatible = "ti,am4376-pruss1", .data = &am437x_pruss1_data, }, { .compatible = "ti,am5728-pruss" }, { .compatible = "ti,k2g-pruss" }, + { .compatible = "ti,am654-icssg" }, {}, }; MODULE_DEVICE_TABLE(of, pruss_of_match);