Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp902617imm; Wed, 11 Jul 2018 13:04:58 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdu4Zfs5Z3rMXx11f0fXfB6/7e/UzXhyCKEi9uHt3ZBkLgGrL7hzv/GUG1IAqX3dKyD6eIu X-Received: by 2002:a62:a018:: with SMTP id r24-v6mr75574pfe.144.1531339498895; Wed, 11 Jul 2018 13:04:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531339498; cv=none; d=google.com; s=arc-20160816; b=FuvPAMa1zsbwUata9EivL5LNTxclI9r+d8iH/q/DWCe7L8FJ8nSpslhsL5DFMxjX+T SBY2JsE7ivW1G2z5M1vOjnDkyRQljb52/F10+kWm3JXT8xS0Z7fG0URbOFMPjsi9ouIU aaH3D3c0M3tyuDuh2AmfWbZ3ylSdWnCYrUReGbktgHqeySlpZd4pTgEUEjL0q4Weasvl Bnr4LLXdLiz6pyWp8c/CfQhwho011KBUqoUVTBRm7j5Qzh1lnUD8wE31I1VScBy5h3XN X+kosNwChjpdsHnm4bfhgsRpMFbMHkLRMCZ+qmYQsi+PxrgyWo2xvcEuEV7In6qP9fXB lq7w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=Kq8nBZ16kSwFWYm2L/xXnofrqG23y29jYB4Ely/7apQ=; b=EgWcF+TKpoc2yODdifLIWgK/Jd2BbUqS5xmOiZ628ShxR7VyuY0P0CzNL2LRICNs/B DjZRgL2V1R+Y9TMIeWNXiNVkDwGlx7RyDK9WvL6RgiXQsYjhyF7XUNXnC/nVD9Hl7glG pRv0Xdq0Hsnu1gpfDy1bBP8qQiJaueXphdRO0vm5N/g2JSNjKuW9RjQvNPeS7mbDJSRz nITzxGS/eqLiMNYL4NO4v0Zh2mHvo6HFqxbPgCYzGEqmxaZHC9EVnwWIWxQhbmIGjMIy mmgpSdQGESmyy5fb2PmKG7RsdymKZFV3eOlIA9Hpr3N86w1dPeECXOPb1+Pbm2A/V0cB GVoQ== 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=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a9-v6si19222233pgf.380.2018.07.11.13.04.42; Wed, 11 Jul 2018 13:04:58 -0700 (PDT) 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=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387969AbeGKTgB (ORCPT + 99 others); Wed, 11 Jul 2018 15:36:01 -0400 Received: from mail-oi0-f67.google.com ([209.85.218.67]:45389 "EHLO mail-oi0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387634AbeGKTgB (ORCPT ); Wed, 11 Jul 2018 15:36:01 -0400 Received: by mail-oi0-f67.google.com with SMTP id q11-v6so25798036oic.12; Wed, 11 Jul 2018 12:30:14 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=Kq8nBZ16kSwFWYm2L/xXnofrqG23y29jYB4Ely/7apQ=; b=MME6pU+CFuISd4nY/z1WqmG6c9O+Hl0Whb25bUsL73hOqt3YBZuk/F9KV3dVOL5VYH FDakK2al8lIhQ+yT2K6ZVlV2pcgbvvgGorCPyd+ZwAE2UsDcTb7ZiE/OJwE+Mhen9WJX DJ3RXy97Mt8I/GYUMoQFY/jlyicyeCyJ174Ymp1mj2oIVxkH/Zl3bC3q+L0EgWqXRSWw GFGmcCFhxZactZKImX5IlUz4HAzuGi8ZAVTTNCMn3TIXJL2pOqe4vUQH78ZC2Qm0hdSg nJv07r7axyUUuPNgdcXKI4UmPX/P4GtmhTzk/l0QBg5+urKoc1LMpwQJzWFLSUGkky/h I9Vg== X-Gm-Message-State: AOUpUlEpO/P52dyKLdWxApBj8jZRZzTGbvLesYoqxpMQXDS3piBs/DuG t4gIaVSE7eYCBSTH+g1fZQ== X-Received: by 2002:aca:4ec6:: with SMTP id c189-v6mr717120oib.186.1531337413693; Wed, 11 Jul 2018 12:30:13 -0700 (PDT) Received: from localhost (24-223-123-72.static.usa-companies.net. [24.223.123.72]) by smtp.gmail.com with ESMTPSA id x5-v6sm5621004oix.3.2018.07.11.12.30.12 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 11 Jul 2018 12:30:12 -0700 (PDT) Date: Wed, 11 Jul 2018 13:30:11 -0600 From: Rob Herring To: Sujeev Dias Cc: Greg Kroah-Hartman , Arnd Bergmann , linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, Tony Truong , Siddartha Mohanadoss Subject: Re: [PATCH v2 1/7] mhi_bus: core: initial checkin for modem host interface bus driver Message-ID: <20180711193011.GA8659@rob-hp-laptop> References: <1524795811-21399-1-git-send-email-sdias@codeaurora.org> <1531166894-30984-1-git-send-email-sdias@codeaurora.org> <1531166894-30984-2-git-send-email-sdias@codeaurora.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1531166894-30984-2-git-send-email-sdias@codeaurora.org> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jul 09, 2018 at 01:08:08PM -0700, Sujeev Dias wrote: > This is the initial skeleton driver for mhi bus stack. MHI Host > Interface is a communication protocol to be used by the host to > control and communcate with modem over a high speed peripheral bus. > This module will allow host to communicate with external devices that > support MHI protocol. > > Signed-off-by: Sujeev Dias > Reviewed-by: Tony Truong > Signed-off-by: Siddartha Mohanadoss > --- > Documentation/00-INDEX | 2 + > Documentation/devicetree/bindings/bus/mhi.txt | 258 ++++++++++++ As Greg said, separate patch. > Documentation/mhi.txt | 235 +++++++++++ > drivers/bus/Kconfig | 8 + > drivers/bus/Makefile | 1 + > drivers/bus/mhi/Makefile | 6 + > drivers/bus/mhi/core/Makefile | 1 + > drivers/bus/mhi/core/mhi_init.c | 538 ++++++++++++++++++++++++++ > drivers/bus/mhi/core/mhi_internal.h | 238 ++++++++++++ > drivers/bus/mhi/core/mhi_main.c | 122 ++++++ > include/linux/mhi.h | 341 ++++++++++++++++ > include/linux/mod_devicetable.h | 12 + > 12 files changed, 1762 insertions(+) > create mode 100644 Documentation/devicetree/bindings/bus/mhi.txt > create mode 100644 Documentation/mhi.txt > create mode 100644 drivers/bus/mhi/Makefile > create mode 100644 drivers/bus/mhi/core/Makefile > create mode 100644 drivers/bus/mhi/core/mhi_init.c > create mode 100644 drivers/bus/mhi/core/mhi_internal.h > create mode 100644 drivers/bus/mhi/core/mhi_main.c > create mode 100644 include/linux/mhi.h > diff --git a/Documentation/devicetree/bindings/bus/mhi.txt b/Documentation/devicetree/bindings/bus/mhi.txt > new file mode 100644 > index 0000000..19deb84 > --- /dev/null > +++ b/Documentation/devicetree/bindings/bus/mhi.txt > @@ -0,0 +1,258 @@ > +MHI Host Interface > + > +MHI used by the host to control and communicate with modem over > +high speed peripheral bus. > + > +============== > +Node Structure > +============== > + > +Main node properties: > + > +- mhi,max-channels mhi is not a vendor. mhi-max-channels. Same for rest. Or maybe just drop 'mhi' completely. > + Usage: required > + Value type: > + Definition: Maximum number of channels supported by this controller > + > +- mhi,timeout > + Usage: optional > + Value type: > + Definition: Maximum timeout in ms wait for state and cmd completion Needs a unit suffix. > + > +- mhi,use-bb > + Usage: optional > + Value type: > + Definition: Set true, if PCIe controller does not have full access to host > + DDR, and we're using a dedicated memory pool like cma, or > + carveout pool. Pool must support atomic allocation. How is this related to PCI? "atomic allocation" has nothing to do with bindings. > + > +- mhi,buffer-len > + Usage: optional > + Value type: > + Definition: MHI automatically pre-allocate buffers for some channel. > + Set the length of buffer size to allocate. If not default > + size MHI_MAX_MTU will be used. > + > +============================ > +mhi channel node properties: > +============================ > + > +- reg > + Usage: required > + Value type: > + Definition: physical channel number > + > +- label > + Usage: required > + Value type: > + Definition: given name for the channel Why does the user need this? > + > +- mhi,num-elements > + Usage: optional > + Value type: > + Definition: Number of elements transfer ring support > + > +- mhi,event-ring > + Usage: required > + Value type: > + Definition: Event ring index associated with this channel > + > +- mhi,chan-dir > + Usage: required > + Value type: > + Definition: Channel direction as defined by enum dma_data_direction > + 0 = Bidirectional data transfer > + 1 = UL data transfer > + 2 = DL data transfer > + 3 = No direction, not a regular data transfer channel > + > +- mhi,ee > + Usage: required > + Value type: > + Definition: Channel execution enviornment as defined by enum MHI_EE > + 1 = Bootloader stage > + 2 = AMSS mode > + > +- mhi,pollcfg > + Usage: optional > + Value type: > + Definition: MHI poll configuration, valid only when burst mode is enabled > + 0 = Use default (device specific) polling configuration > + For UL channels, value specifies the timer to poll MHI context in > + milliseconds. > + For DL channels, the threshold to poll the MHI context in multiple of > + eight ring element. > + > +- mhi,data-type > + Usage: required > + Value type: > + Definition: Data transfer type accepted as defined by enum MHI_XFER_TYPE > + 0 = accept cpu address for buffer > + 1 = accept skb > + 2 = accept scatterlist > + 3 = offload channel, does not accept any transfer type > + > +- mhi,doorbell-mode > + Usage: required > + Value type: > + Definition: Channel doorbell mode configuration as defined by enum > + MHI_BRSTMODE > + 2 = burst mode disabled > + 3 = burst mode enabled > + > +- mhi,lpm-notify > + Usage: optional > + Value type: > + Definition: This channel master require low power mode enter and exit > + notifications from mhi bus master. > + > +- mhi,offload-chan > + Usage: optional > + Value type: > + Definition: Client managed channel, MHI host only involved in setting up > + the data path, not involved in active data path. > + > +- mhi,db-mode-switch > + Usage: optional > + Value type: > + Definition: Must switch to doorbell mode whenever MHI M0 state transition > + happens. > + > +- mhi,auto-queue > + Usage: optional > + Value type: > + Definition: MHI bus driver will pre-allocate buffers for this channel and > + queue to hardware. If set, client not allowed to queue buffers. Valid > + only for downlink direction. > + > +- mhi,auto-start > + Usage: optional > + Value type: > + Definition: MHI host driver to automatically start channels once mhi device > + driver probe is complete. This should be only set true if initial > + handshake iniaitead by external modem. typo > + > +========================== > +mhi event node properties: > +========================== > + > +- mhi,num-elements > + Usage: required > + Value type: > + Definition: Number of elements event ring support > + > +- mhi,intmod > + Usage: required > + Value type: > + Definition: interrupt moderation time in ms > + > +- mhi,msi > + Usage: required > + Value type: > + Definition: MSI associated with this event ring > + > +- mhi,chan > + Usage: optional > + Value type: > + Definition: Dedicated channel number, if it's a dedicated event ring > + > +- mhi,priority > + Usage: required > + Value type: > + Definition: Event ring priority, set to 1 for now > + > +- mhi,brstmode > + Usage: required > + Value type: > + Definition: Event doorbell mode configuration as defined by > + enum MHI_BRSTMODE > + 2 = burst mode disabled > + 3 = burst mode enabled > + > +- mhi,data-type > + Usage: optional > + Value type: > + Definition: Type of data this event ring will process as defined > + by enum mhi_er_data_type > + 0 = process data packets (default) > + 1 = process mhi control packets > + > +- mhi,hw-ev > + Usage: optional > + Value type: > + Definition: Event ring associated with hardware channels > + > +- mhi,client-manage > + Usage: optional > + Value type: > + Definition: Client manages the event ring (use by napi_poll) > + > +- mhi,offload > + Usage: optional > + Value type: > + Definition: Event ring associated with offload channel This is a lot of properties. I suspect that many of these should be implied by the modem device or be driver settings. If the modems are PCI devices, then you should be able to determine a lot from the PCI VID/PIDs. I'm not sure that a bus is appropriate here either. This looks like the next layer up. How's it different than a programming model for some ethernet NIC? Rob