From patchwork Wed Nov 7 00:32:38 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Elder X-Patchwork-Id: 150353 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp4548029ljp; Tue, 6 Nov 2018 16:33:06 -0800 (PST) X-Google-Smtp-Source: AJdET5c/3SwNTkjess50tY6OiMUmlPWzbYBaY13PLbAAzn1lfAm9TjE68nzG1eAjx7R7aG4eVWKR X-Received: by 2002:a17:902:e005:: with SMTP id ca5-v6mr28034265plb.195.1541550785932; Tue, 06 Nov 2018 16:33:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541550785; cv=none; d=google.com; s=arc-20160816; b=MQ2hRZ+uCocWlbm3BYEiaSuZAuEhnG0fuNs81OhjMNUemeltw/SHGnkwqZUWIvrsIs wRUo0oVpDSzzV+jNCobLlu4I35FhkeohRC5U1pPjrzHxNnE/h61+tSatI3vsQHXUmypD gbK8C1dWVQRmfqWUlFRQGhER9IuDKIp3LN1C1wj2/+3MT7oGN/j4QgWdQOeHqlWxumUN Pb490HUHFSO+eTahq8k0lMXRlXd/YWzwKE2ASOSPc7mSQDzh5ii27k0VUlc0yfsEqJVA MFwpKAFQ/F9vz42ZkVqLIKStqUopZh5ulXthzGKFmlKzb26scQv9XV5Zg46pLB81ejTe J+xg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature; bh=IEvQGaTEyTQoVgI42OBCj+DpBFTSscNNlEYbOyUpznE=; b=exAOZsoeYbeg51xxcxUjj1WD7ALyxf53bEuncZbsQbpTqNkXeV2Hnj/Q+WUhcD4Qm0 OejyvDc1zCLfRUql+A8fjgG6hO/8I7qZ0zHmJv53/O6Ez5qGYlCsthynM6YB/I1kQP2H NdW3NMP1xzZGSrRvkHGu1WtK+sOP5uNdYV1wGU9OMVswojlXBsfLxhHfwRqLr75eNyZA g+KiZmxhqdXINbCaedZSnW+VqqpVXaOVY7JDStHOAoJ/eE9g+D4Jy2Ih30LL9SZyYpJp jSD0s7PYcvJ29goJCRTpminkJH49Yy6PvS5KuHzVLJFIfxtorXmks3owV71XzfIunSHb y3Kg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=GFePTUyf; spf=pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 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. [209.132.180.67]) by mx.google.com with ESMTP id j28si15111152pgm.160.2018.11.06.16.33.05; Tue, 06 Nov 2018 16:33:05 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=GFePTUyf; spf=pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 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 S2388737AbeKGKA6 (ORCPT + 6 others); Wed, 7 Nov 2018 05:00:58 -0500 Received: from mail-it1-f193.google.com ([209.85.166.193]:53833 "EHLO mail-it1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388735AbeKGKA6 (ORCPT ); Wed, 7 Nov 2018 05:00:58 -0500 Received: by mail-it1-f193.google.com with SMTP id r12-v6so17841034ita.3 for ; Tue, 06 Nov 2018 16:33:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=IEvQGaTEyTQoVgI42OBCj+DpBFTSscNNlEYbOyUpznE=; b=GFePTUyfzSNSkfg919edcXJxTSGdeI34Uo/U5L3524jLl1o+GG/9CRELIW5IYAmsqO qxq9vkrAHCGg2mUPEZ/j0KhLxxyp0X2oCVdZF6d4I9sJdLrTxuEXnfJ9/TpF3bDBADsd Ki1dZIH97vNAEy7xP881FqCIwL3YEQB/t4Mrc= 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; bh=IEvQGaTEyTQoVgI42OBCj+DpBFTSscNNlEYbOyUpznE=; b=AZrz3U7gI4mJ1vE981FceXNArFGlNw/eIdR4G2r4jpE2a6+XENmAwswl90KQ70P40e gtsbcE3l7GIg/hsgByLqrt3GxyMQ5QvV8eqOHGW0LUbobDFJlZM4Tioh/x2hLufSa4Qt Oj68upZ+zRjImGgrY8XnnsgS44Qi2IW42bn+0+p6g4yDydx8AadAqZMy8gVFU/N23uvB ksA/UHrgJys/TcIIwc+Zsrv5+asCnT4pcNemQ9HKHjcTFYMPllo6F1uZdqA0+LqYJuWr +76WZuv+eTz9EGs033hbe481XZcQscNPa9VzC1OtnINOAopreqDEWKMw2GBhRwz2gQdO 6BUQ== X-Gm-Message-State: AGRZ1gISlhNob3omOoxPcEtEjNACi5t0RSAXTO+D1eteQtkySgjUXUDL wMesjOF+9jpTMR7id3viBZ9XHQ== X-Received: by 2002:a24:9717:: with SMTP id k23-v6mr131730ite.94.1541550783558; Tue, 06 Nov 2018 16:33:03 -0800 (PST) Received: from shibby.gateway.innflux.com ([66.228.239.218]) by smtp.gmail.com with ESMTPSA id e184-v6sm1061128ite.9.2018.11.06.16.32.56 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 06 Nov 2018 16:33:02 -0800 (PST) From: Alex Elder To: davem@davemloft.net, arnd@arndb.de, bjorn.andersson@linaro.org, ilias.apalodimas@linaro.org, robh+dt@kernel.org, mark.rutland@arm.com Cc: netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, syadagir@codeaurora.org, mjavid@codeaurora.org Subject: [RFC PATCH 00/12] net: introduce Qualcomm IPA driver Date: Tue, 6 Nov 2018 18:32:38 -0600 Message-Id: <20181107003250.5832-1-elder@linaro.org> X-Mailer: git-send-email 2.17.1 Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org This series presents the driver for the Qualcomm IP Accelerator (IPA). The IPA is a hardware component present in some Qualcomm SoCs that allows network functions--such as routing, filtering, network address translation and aggregation--to be performed without active involvement of the main application processor (AP). Initially, these advanced features are not supported; the IPA driver simply provides a network interface that makes the modem's LTE network available to the AP. In addition, support is only provided for the IPA found in the Qualcomm SDM845 SoC. This code is derived from a driver developed internally by Qualcomm. A version of the original source can be seen here: https://source.codeaurora.org/quic/la/kernel/msm-4.9/tree in the "drivers/platform/msm/ipa" directory. Many were involved in developing this, but the following individuals deserve explicit acknowledgement for their substantial contributions: Abhishek Choubey Ady Abraham Chaitanya Pratapa David Arinzon Ghanim Fodi Gidon Studinski Ravi Gummadidala Shihuan Liu Skylar Chang The code has undergone considerable rework to prepare it for incorporation into upstream Linux. Parts of it bear little resemblance to the original driver. Still, some work remains to be done. The current code and its design had a preliminary review, and some changes to the data path implementation were recommended. These have not yet been addressed: - Use NAPI for all interfaces, not just RX (and WAN data) endpoints. - Do more work in the NAPI poll function, including collecting completed TX requests and posting buffers for RX. - Do not use periodic NOP requests as a way to avoid TX interrupts. - The NAPI context should be associated with the hardware interrupt (it is now associated with something abstracted from the hardware). - Use threaded interrupts, to avoid the need for using spinlocks and atomic variables for synchronizing between workqueue and interrupt context. - Have runtime power management enable and disable IPA clock and interconnects. Many thanks to Arnd Bergmann, Ilias Apalodimas, and Bjorn Andersson for their early feedback. While there clearly remains work to do on this, we felt that things are far enough along that it would be helpful to solicit broader input on the code. Major issues are best addressed as soon as possible, and even minor issues when identified help in setting priorities. This code is dependent on the following two sets of code, which have been posted for review but are not yet accepted upstream: - Interconnect framework: https://lkml.org/lkml/2018/8/31/444 - SDM845 interconnect provider driver: https://lkml.org/lkml/2018/8/24/25 In addition, it depends on four more bits of code that have not yet been posted for upstream review, but are expected to be available soon: - clk-rpmh support for IPA from David Dai - SDM845 reserved memory from Bjorn Andersson - list_cut_end() from Alex Elder - FIELD_MAX() in "bitfield.h" from Alex Elder This code (including its dependencies) is available in buildable form here, based on kernel v4.19: remote: ssh://git@git.linaro.org/people/alex.elder/linux.git branch: qualcomm_ipa-v1 59562facd61a arm64: dts: sdm845: add IPA information -Alex Alex Elder (12): dt-bindings: soc: qcom: add IPA bindings soc: qcom: ipa: DMA helpers soc: qcom: ipa: generic software interface soc: qcom: ipa: immediate commands soc: qcom: ipa: IPA interrupts and the microcontroller soc: qcom: ipa: QMI modem communication soc: qcom: ipa: IPA register abstraction soc: qcom: ipa: utility functions soc: qcom: ipa: main IPA source file soc: qcom: ipa: data path soc: qcom: ipa: IPA rmnet interface soc: qcom: ipa: build and "ipa_i.h" .../devicetree/bindings/soc/qcom/qcom,ipa.txt | 136 ++ .../bindings/soc/qcom/qcom,rmnet-ipa.txt | 15 + drivers/net/ipa/Kconfig | 30 + drivers/net/ipa/Makefile | 7 + drivers/net/ipa/gsi.c | 1685 ++++++++++++++ drivers/net/ipa/gsi.h | 195 ++ drivers/net/ipa/gsi_reg.h | 563 +++++ drivers/net/ipa/ipa_dma.c | 61 + drivers/net/ipa/ipa_dma.h | 61 + drivers/net/ipa/ipa_dp.c | 1994 +++++++++++++++++ drivers/net/ipa/ipa_i.h | 573 +++++ drivers/net/ipa/ipa_interrupts.c | 307 +++ drivers/net/ipa/ipa_main.c | 1400 ++++++++++++ drivers/net/ipa/ipa_qmi.c | 406 ++++ drivers/net/ipa/ipa_qmi.h | 12 + drivers/net/ipa/ipa_qmi_msg.c | 587 +++++ drivers/net/ipa/ipa_qmi_msg.h | 233 ++ drivers/net/ipa/ipa_reg.c | 972 ++++++++ drivers/net/ipa/ipa_reg.h | 614 +++++ drivers/net/ipa/ipa_uc.c | 336 +++ drivers/net/ipa/ipa_utils.c | 1035 +++++++++ drivers/net/ipa/ipahal.c | 541 +++++ drivers/net/ipa/ipahal.h | 253 +++ drivers/net/ipa/msm_rmnet.h | 120 + drivers/net/ipa/rmnet_config.h | 31 + drivers/net/ipa/rmnet_ipa.c | 805 +++++++ 26 files changed, 12972 insertions(+) create mode 100644 Documentation/devicetree/bindings/soc/qcom/qcom,ipa.txt create mode 100644 Documentation/devicetree/bindings/soc/qcom/qcom,rmnet-ipa.txt create mode 100644 drivers/net/ipa/Kconfig create mode 100644 drivers/net/ipa/Makefile create mode 100644 drivers/net/ipa/gsi.c create mode 100644 drivers/net/ipa/gsi.h create mode 100644 drivers/net/ipa/gsi_reg.h create mode 100644 drivers/net/ipa/ipa_dma.c create mode 100644 drivers/net/ipa/ipa_dma.h create mode 100644 drivers/net/ipa/ipa_dp.c create mode 100644 drivers/net/ipa/ipa_i.h create mode 100644 drivers/net/ipa/ipa_interrupts.c create mode 100644 drivers/net/ipa/ipa_main.c create mode 100644 drivers/net/ipa/ipa_qmi.c create mode 100644 drivers/net/ipa/ipa_qmi.h create mode 100644 drivers/net/ipa/ipa_qmi_msg.c create mode 100644 drivers/net/ipa/ipa_qmi_msg.h create mode 100644 drivers/net/ipa/ipa_reg.c create mode 100644 drivers/net/ipa/ipa_reg.h create mode 100644 drivers/net/ipa/ipa_uc.c create mode 100644 drivers/net/ipa/ipa_utils.c create mode 100644 drivers/net/ipa/ipahal.c create mode 100644 drivers/net/ipa/ipahal.h create mode 100644 drivers/net/ipa/msm_rmnet.h create mode 100644 drivers/net/ipa/rmnet_config.h create mode 100644 drivers/net/ipa/rmnet_ipa.c -- 2.17.1