From patchwork Thu Nov 22 11:38:56 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roger Quadros X-Patchwork-Id: 151750 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp627800ljp; Thu, 22 Nov 2018 03:39:28 -0800 (PST) X-Google-Smtp-Source: AFSGD/UhTLaaZUakHUSldIC/O0/TnZ7W/jCWmLRXIY3ISUaJ5c1QCHoOhbmNOefr4+p3FYjp/FE1 X-Received: by 2002:a17:902:9a02:: with SMTP id v2mr11150899plp.180.1542886768770; Thu, 22 Nov 2018 03:39:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542886768; cv=none; d=google.com; s=arc-20160816; b=HFZLLVAjvBI2rR+5cTiZfzunSfm1SUNqh1WaaPKhmtZ+OjlYqrHap+9XyAmWeGXHg3 chsDSZWQFHlTvSCLcZRSRtO+YMVKfLTHmink+nn/3E0LA+YYKugNoYBb7mas7q7YnK7R STq7u2NqQ2uZD7fSAomzMv1uDQ94mX+pGm957xnIPY1feEl0PxjbkvT1ga6B58qtmCRE Q2/x44k4JNO66sr6d6lkXQnBnjcq6InOQ7iDx3Mm3QxYsUHGm2AV4VL61drc4zjRHJbN XElmyCnS0hWTQQ2FQES5u8BPQAhpc0cQXSkXS2jZLGDFVRpsIFfs8jsIt2U7slX7oEHx KPUg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:cc :to:from; bh=pyBz96iTwtnJ8EJc/fpAgrpHjryC1XSxkD2alWtcG6w=; b=hdvlr/SD7VZ4iJEC8RRgawfkTsANl/lsfpuqQIxFx8tRZD3SvVVrdl6XfRAqesjIZZ hmruwexHm8XBP4Po5ERgrRMiIi6R7lLswgiSqrVYDecsD+r+tpfw75/iwRNPWBLKG51u 8URaeWXKqzKeZQFKTgAP/ktjjobexxNm7GP7TaoCi++7KKuiPH9dU1PAzKsqALggGvPe rzFeEexppH9yI27OowMvqPmZyQXs7ZQQxSzRzmWrFEpfrpwjHpMhu1iv8c4uxuuPI3YQ NBObXI9qtG8B8BDFbXfayCdWFVvV4oBJ/Rs51f6xmbd5Fq8tX0/mEH6a/fgyqWXcJqC9 VuHA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=NONE dis=QUARANTINE) 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 g10si33829255plm.1.2018.11.22.03.39.28; Thu, 22 Nov 2018 03:39:28 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=NONE dis=QUARANTINE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2403786AbeKVWS0 (ORCPT + 32 others); Thu, 22 Nov 2018 17:18:26 -0500 Received: from fllv0016.ext.ti.com ([198.47.19.142]:58368 "EHLO fllv0016.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732166AbeKVWS0 (ORCPT ); Thu, 22 Nov 2018 17:18:26 -0500 Received: from lelv0265.itg.ti.com ([10.180.67.224]) by fllv0016.ext.ti.com (8.15.2/8.15.2) with ESMTP id wAMBdKre008338; Thu, 22 Nov 2018 05:39:20 -0600 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 wAMBdKi3076698 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 22 Nov 2018 05:39:20 -0600 Received: from DFLE107.ent.ti.com (10.64.6.28) 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.1591.10; Thu, 22 Nov 2018 05:39:18 -0600 Received: from dflp33.itg.ti.com (10.64.6.16) by DFLE107.ent.ti.com (10.64.6.28) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1591.10 via Frontend Transport; Thu, 22 Nov 2018 05:39:18 -0600 Received: from dlelxv97.itg.ti.com (dlelxv97.itg.ti.com [172.17.2.193]) by dflp33.itg.ti.com (8.14.3/8.13.8) with ESMTP id wAMBdIVa027052; Thu, 22 Nov 2018 05:39:18 -0600 Received: from localhost.localdomain (vboxa0400828d.dhcp.ti.com [172.22.239.63]) by dlelxv97.itg.ti.com (8.14.3/8.13.8) with ESMTP id wAMBdDex013203; Thu, 22 Nov 2018 05:39:14 -0600 From: Roger Quadros To: CC: , , , , , , , , , , , , , , , , Subject: [PATCH 00/17] Add support for TI PRU ICSS Date: Thu, 22 Nov 2018 13:38:56 +0200 Message-ID: <1542886753-17625-1-git-send-email-rogerq@ti.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, The Programmable Real-Time Unit and Industrial Communication Subsystem (PRU-ICSS) is present on various TI SoCs such as AM335x, AM437x, AM57x, Keystone 66AK2G, etc. A PRUSS consists of dual 32-bit RISC cores (Programmable Real-Time Units, or PRUs), data and instruction RAMs, shard RAM, and interrupt controller and some internal peripheral modules to facilitate industrial communication. The programmable nature of the PRUs provide flexibility to implement custom peripheral interfaces, fast real-time responses, or specialized data handling. The common peripheral modules include the following, - an MII_RT module with two MII ports for Ethernet - an MDIO port for external Ethernet PHYs - an Industrial Ethernet Peripheral (IEP) to manage/generate Industrial Ethernet functions - an Enhanced Capture Module (eCAP) - an Industrial Ethernet Timer with 7/9 capture and 16 compare events - a 16550-compatible UART to support PROFIBUS A typical usage scenario would be to load the application firmware into one or more of the PRU cores, initialize one or more of the peripherals and perform I/O through shared RAM (or MSMC RAM) from either a Kernel driver or directly from userspace. With this two-part series we should be able to use the kernel RPMSG driver along with firmware and user-space examples in the pru-software-support-package [1]. We will also be able to get Dual Ethernet functionality using a kernel driver which will be posted later. The kernel code will be split into the following sections 1) soc: pruss_soc_bus: The sole purpose of this driver is to handle platform specific Power management quirks and allow the child node (i.e entire PRUSS) to be unbound from the default kernel driver and bound to something else. e.g. uio_pruss, while allowing to manage PM in the kernel. 2) soc: pruss: This is the driver for the entire ICSS. Its main purpose is to populate the different modules and handle platform specific quirks. It will also manage the interrupt controller and provide kernel APIs to change ICSS specific knobs in the CFG space e.g. GP_MUX. 3) remoteproc: pru: This provides a remoteproc interface for the PRU cores. With this we can load firmware, start/stop PRU from kernel or userspace. It adds support for virtio RPMSG. It also provides some kernel APIs (e.g. pru_rproc_set_ctable()) that are PRU specific and required for in-kernel applications (e.g. ethernet) 4) ARM: OMAP: DTS: Platform data and device tree files. Due to the large number of patches patches are split this into 2 email threads. This thread covers (1), (3) and (4). A second thread will cover the remoteproc driver (3). The series only adds platform support for AM335x to keep patch count small. Support for other platforms (AM43x, AM57x, K2G) will be added later. Testing: To test the code with example firmware you can try the LAB5 tutorial http://processors.wiki.ti.com/index.php/PRU_Training:_Hands-on_Labs#LAB_5:_RPMsg_Communication_between_ARM_and_PRU with the pru-software-support package at [2] and the sample rpmsg-client driver. NOTE: you no longer need to build and run PRU_Halt example as shown in the tutorial. cheers, -roger [1] https://git.ti.com/pru-software-support-package NOTE: The repo needs update to the INTC resource data structures The updates that are required are listed in the below repo with one example fixed. [2] https://github.com/rogerq/pru-software-support-package/commits/upstream/pruss Andrew F. Davis (1): soc: ti: pruss: add pruss_{request,release}_mem_region() API Roger Quadros (2): soc: ti: pruss: add pruss_cfg_read()/update() API soc: ti: pruss: export pruss_intc_configure/unconfigure APIs Suman Anna (13): dt-bindings: remoteproc: Add TI PRUSS bindings soc: ti: pruss: Define platform data for PRUSS bus driver soc: ti: pruss: Add pruss_soc_bus platform driver soc: ti: pruss: Fix system suspend/MStandby config issues soc: ti: pruss: Configure SYSCFG properly during probe/remove soc: ti: pruss: Add a platform driver for PRUSS in TI SoCs soc: ti: pruss: enable OCP master ports in SYSCFG always soc: ti: pruss: Add a PRUSS irqchip driver for PRUSS interrupts soc: ti: pruss_intc: Add API to trigger a PRU sysevent ARM: OMAP2+: use pdata quirks for PRUSS reset lines on AM335x ARM: dts: AM33xx: Add the PRU-ICSS DT nodes ARM: dts: AM33xx: Add PRU system events for virtio ARM: dts: am335x-*: Enable PRU-ICSS nodes Tero Kristo (1): soc: ti: pruss: add pruss_get()/put() API .../devicetree/bindings/soc/ti/ti,pruss.txt | 360 ++++++++++++ arch/arm/boot/dts/am335x-bone-common.dtsi | 8 + arch/arm/boot/dts/am335x-evm.dts | 8 + arch/arm/boot/dts/am335x-evmsk.dts | 8 + arch/arm/boot/dts/am335x-icev2.dts | 8 + arch/arm/boot/dts/am33xx.dtsi | 78 +++ arch/arm/mach-omap2/pdata-quirks.c | 11 + drivers/soc/ti/Kconfig | 12 + drivers/soc/ti/Makefile | 1 + drivers/soc/ti/pruss.c | 306 +++++++++++ drivers/soc/ti/pruss.h | 36 ++ drivers/soc/ti/pruss_intc.c | 604 +++++++++++++++++++++ drivers/soc/ti/pruss_soc_bus.c | 279 ++++++++++ include/linux/platform_data/ti-pruss.h | 25 + include/linux/pruss.h | 235 ++++++++ 15 files changed, 1979 insertions(+) create mode 100644 Documentation/devicetree/bindings/soc/ti/ti,pruss.txt create mode 100644 drivers/soc/ti/pruss.c create mode 100644 drivers/soc/ti/pruss.h create mode 100644 drivers/soc/ti/pruss_intc.c create mode 100644 drivers/soc/ti/pruss_soc_bus.c create mode 100644 include/linux/platform_data/ti-pruss.h create mode 100644 include/linux/pruss.h -- Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki