From patchwork Tue Feb 5 12:01:20 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vignesh Raghavendra X-Patchwork-Id: 1036675 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=quarantine dis=none) header.from=ti.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=ti.com header.i=@ti.com header.b="eB9ce82S"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 43v38X3wsqz9sMM for ; Tue, 5 Feb 2019 23:01:48 +1100 (AEDT) Received: by lists.denx.de (Postfix, from userid 105) id 2C65DC21F7A; Tue, 5 Feb 2019 12:01:46 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 92036C21F00; Tue, 5 Feb 2019 12:01:22 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 2FEC5C21F1D; Tue, 5 Feb 2019 12:01:20 +0000 (UTC) Received: from lelv0143.ext.ti.com (lelv0143.ext.ti.com [198.47.23.248]) by lists.denx.de (Postfix) with ESMTPS id BB613C21F00 for ; Tue, 5 Feb 2019 12:00:34 +0000 (UTC) Received: from fllv0035.itg.ti.com ([10.64.41.0]) by lelv0143.ext.ti.com (8.15.2/8.15.2) with ESMTP id x15C0Wep122211; Tue, 5 Feb 2019 06:00:32 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1549368032; bh=unbm9VXw2OQ9SQfFK3OyfWkIr/x3MpWH8UAG3I315e4=; h=From:To:CC:Subject:Date; b=eB9ce82SWhuJTy6CchIR4SgfNN2bwHpcwq6LunEcUQb1Nn2q241sKWcwJlh9PAHSM qSAMcBLXMoYmOJhocUHmfC67zZ+ptp3BLSmL9e+iP5SQEwFQX8QoqJEi8QvnGvum0g v23mEBlCACXe2TqdQZrvGNLFhLZH7YCEtJaWftns= Received: from DFLE100.ent.ti.com (dfle100.ent.ti.com [10.64.6.21]) by fllv0035.itg.ti.com (8.15.2/8.15.2) with ESMTPS id x15C0W4K077779 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 5 Feb 2019 06:00:32 -0600 Received: from DFLE113.ent.ti.com (10.64.6.34) 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.1591.10; Tue, 5 Feb 2019 06:00:32 -0600 Received: from dlep33.itg.ti.com (157.170.170.75) by DFLE113.ent.ti.com (10.64.6.34) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1591.10 via Frontend Transport; Tue, 5 Feb 2019 06:00:32 -0600 Received: from a0132425.india.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by dlep33.itg.ti.com (8.14.3/8.13.8) with ESMTP id x15C0Uia011117; Tue, 5 Feb 2019 06:00:30 -0600 From: Vignesh R To: Tom Rini Date: Tue, 5 Feb 2019 17:31:20 +0530 Message-ID: <20190205120127.13901-1-vigneshr@ti.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Cc: u-boot@lists.denx.de Subject: [U-Boot] [PATCH v4 0/7] AM65x: Add DMA support X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" This series adds DMA support for TI's AM654 SoC. v4: Convert debug prints to pr_debug()s Collect R-bs v3: Minor comment/whitespace cleanups as pointed out by Tom Rini v2: Align DT bindings with latest proposed bindings as pointed out by Peter. Merge drivers/soc/keystone into drivers/soc/ti Background: The AM65x TRM (http://www.ti.com/lit/pdf/spruid7b) describes the Data Movement Architecture which is implmented by the k3-udma driver. This DMA architecture is a big departure from 'traditional' architecture where we had either EDMA or sDMA as system DMA. Packet DMAs were used as dedicated DMAs to service only networking (K2) or USB (am335x) while other peripherals were serviced by EDMA. In AM65x the UDMA (Unified DMA) is used for all data movment within the SoC, tasked to service all peripherals (UART, McSPI, McASP, networking, etc). The NAVSS/UDMA is built around CPPI5 (Communications Port Programming Interface) and it supports Packet mode (similar to CPPI4.1 in K2 for networking) and TR mode (similar to EDMA descriptor). The data movement is done within a PSI-L fabric, all peripherals (including the UDMA-P). peripherals are not addressed by their I/O register as with traditional DMAs but with their PSI-L thread ID. To be able to use the DMA the following generic steps need to be taken: - configure a DMA channel (tchan for TX, rchan for RX) - channel mode: Packet or TR mode - for memcpy a tchan and rchan pair is used. - for packet mode RX we also need to configure a receive flow to configure the packet receiption - the source and destination threads must be paired - at minimum one pair of rings need to be configured: - tx: transfer ring and transfer completion ring - rx: free descriptor ring and receive ring When the channel setup is completed we only interract with the rings: - TX: push a descriptor to t_ring and wait for it to be pushed to the tc_ring by the UDMA-P - RX: push a descriptor to the fd_ring and wait for UDMA-P to push it back to the r_ring. Resources Management and configuration of channel and ring is handled by sending TI-SCI msgs to remote core. Patches are based on kernel patches here: https://patchwork.kernel.org/cover/10612465/ Grygorii Strashko (5): firmware: ti_sci: Add support for NAVSS resource management soc: ti: k3: add navss ringacc driver soc: ti: k3: add CPPI5 description and helpers arm64: dts: ti: k3-am65: add mcu navss nodes configs: am65x_evm_a53: Enable DMA related configs Vignesh R (2): dma: ti: add driver to K3 UDMA soc: keystone: Merge into ti specific directory arch/arm/dts/k3-am65-wakeup.dtsi | 2 +- arch/arm/dts/k3-am654-base-board-u-boot.dtsi | 47 + arch/arm/mach-keystone/Kconfig | 8 + configs/am65x_evm_a53_defconfig | 4 +- drivers/Kconfig | 2 + drivers/dma/Kconfig | 2 + drivers/dma/Makefile | 2 + drivers/dma/ti/Kconfig | 14 + drivers/dma/ti/Makefile | 3 + drivers/dma/ti/k3-udma-hwdef.h | 184 ++ drivers/dma/ti/k3-udma.c | 1730 +++++++++++++++++ drivers/firmware/ti_sci.c | 760 +++++++- drivers/firmware/ti_sci.h | 642 ++++++ drivers/soc/Kconfig | 5 + drivers/soc/Makefile | 2 +- drivers/soc/keystone/Makefile | 3 - drivers/soc/ti/Kconfig | 26 + drivers/soc/ti/Makefile | 4 + drivers/soc/ti/k3-navss-ringacc.c | 1057 ++++++++++ .../soc/{keystone => ti}/keystone_serdes.c | 0 include/configs/ti_armv7_keystone2.h | 3 - include/dt-bindings/dma/k3-udma.h | 31 + include/linux/soc/ti/cppi5.h | 995 ++++++++++ include/linux/soc/ti/k3-navss-ringacc.h | 236 +++ include/linux/soc/ti/ti-udma.h | 24 + include/linux/soc/ti/ti_sci_protocol.h | 300 +++ scripts/config_whitelist.txt | 1 - 27 files changed, 6066 insertions(+), 21 deletions(-) create mode 100644 drivers/dma/ti/Kconfig create mode 100644 drivers/dma/ti/Makefile create mode 100644 drivers/dma/ti/k3-udma-hwdef.h create mode 100644 drivers/dma/ti/k3-udma.c create mode 100644 drivers/soc/Kconfig delete mode 100644 drivers/soc/keystone/Makefile create mode 100644 drivers/soc/ti/Kconfig create mode 100644 drivers/soc/ti/Makefile create mode 100644 drivers/soc/ti/k3-navss-ringacc.c rename drivers/soc/{keystone => ti}/keystone_serdes.c (100%) create mode 100644 include/dt-bindings/dma/k3-udma.h create mode 100644 include/linux/soc/ti/cppi5.h create mode 100644 include/linux/soc/ti/k3-navss-ringacc.h create mode 100644 include/linux/soc/ti/ti-udma.h