From patchwork Wed Nov 15 14:10:31 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 10059497 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id D78D260231 for ; Wed, 15 Nov 2017 14:13:45 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CA6F62A03E for ; Wed, 15 Nov 2017 14:13:45 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BEEE32A040; Wed, 15 Nov 2017 14:13:45 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_NONE,T_DKIM_INVALID autolearn=no version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E1E542A03E for ; Wed, 15 Nov 2017 14:13:44 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 381942675C7; Wed, 15 Nov 2017 15:13:32 +0100 (CET) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id 43CFC2675BA; Wed, 15 Nov 2017 15:13:28 +0100 (CET) Received: from mail-wr0-f193.google.com (mail-wr0-f193.google.com [209.85.128.193]) by alsa0.perex.cz (Postfix) with ESMTP id D240D2675B8 for ; Wed, 15 Nov 2017 15:13:25 +0100 (CET) Received: by mail-wr0-f193.google.com with SMTP id o14so1671939wrf.9 for ; Wed, 15 Nov 2017 06:13:25 -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:in-reply-to:references; bh=DrbxEZolSAwkMENSUF4Gz/rU/iFd3p/OJFr+Pff2UgE=; b=OU/1uCzrIDdq1HCAyM8lsyNZzLPUs29RkffO2MZqO3y3oB4R6mKIMZbJpPbuMs9zuR 2ukr0ADr7fbho4F4w97GQSx1awvMYF3DeJ+NkuTyUs28COL9sVjTibcpyp8cVyMQOlnf 1XvlcS6/EbTiDi6eNMBEGQ0awADZQWhZOrcOg= 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=DrbxEZolSAwkMENSUF4Gz/rU/iFd3p/OJFr+Pff2UgE=; b=uarCP8XJGvLibGP8bre/NJDEfvVlZUBbWMcyl3ZYc7xdfF4+h/Fm7yH3+al8LixcCa 3ygqznqnHaQJ8LHfE1IcHDtb5YOZSpCcDXuyb25kkmkEO7Db/wYralxPjNzVKmp0AMXH sTHKj87MD99B7Qba3uTLnn8eDgF9W5XS5v36Hq5tgpYtbQPKwH6S49Me3hOI3ObEY+Kv saLODt3z9fuzvD3UAVXJfLTrS3K2LK9OkOx3sxg620POwqYHJn/txT8lWXc+px8BjrVa lblV3v1pFCagXD8h2V31+uXlTXzYmSg2qA52l5rkU9NFEbcGSYhJ3yPg2bsUawNLrQZv wghQ== X-Gm-Message-State: AJaThX6RGeKB7QOyAavUXEY79dHp4DctH5F6b/fx54amA8f6ql39IO0p kEmHkU5g0WtUuxhVq6LNir7XPA== X-Google-Smtp-Source: AGs4zMa8PNhTftmHM5SUeDIbwhQkxuCZ1Mhno50BMNF2QW0EpFH7oQqJf1AX9+QbnngvQO4gzlvjFA== X-Received: by 10.223.164.135 with SMTP id g7mr13342979wrb.211.1510755205200; Wed, 15 Nov 2017 06:13:25 -0800 (PST) Received: from localhost.localdomain (cpc90716-aztw32-2-0-cust92.18-1.cable.virginm.net. [86.26.100.93]) by smtp.gmail.com with ESMTPSA id m11sm56707wrf.56.2017.11.15.06.13.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 15 Nov 2017 06:13:24 -0800 (PST) From: srinivas.kandagatla@linaro.org To: gregkh@linuxfoundation.org, broonie@kernel.org, alsa-devel@alsa-project.org Date: Wed, 15 Nov 2017 14:10:31 +0000 Message-Id: <20171115141043.29202-2-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.15.0 In-Reply-To: <20171115141043.29202-1-srinivas.kandagatla@linaro.org> References: <20171115141043.29202-1-srinivas.kandagatla@linaro.org> Cc: mark.rutland@arm.com, michael.opdenacker@free-electrons.com, poeschel@lemonage.de, Srinivas Kandagatla , andreas.noever@gmail.com, arnd@arndb.de, vinod.koul@intel.com, bp@suse.de, devicetree@vger.kernel.org, james.hogan@imgtec.com, pawel.moll@arm.com, linux-arm-msm@vger.kernel.org, sharon.dvir1@mail.huji.ac.il, robh+dt@kernel.org, sdharia@codeaurora.org, alan@linux.intel.com, treding@nvidia.com, mathieu.poirier@linaro.org, jkosina@suse.cz, linux-kernel@vger.kernel.org, daniel@ffwll.ch, joe@perches.com, davem@davemloft.net Subject: [alsa-devel] [PATCH v7 01/13] Documentation: Add SLIMbus summary X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP From: Sagar Dharia SLIMbus (Serial Low Power Interchip Media Bus) is a specification developed by MIPI (Mobile Industry Processor Interface) alliance. SLIMbus is a 2-wire implementation, which is used to communicate with peripheral components like audio-codec. The summary of SLIMbus and API is documented in the 'summary' file. Signed-off-by: Sagar Dharia Signed-off-by: Srinivas Kandagatla --- Documentation/driver-api/slimbus/index.rst | 15 ++++ Documentation/driver-api/slimbus/summary.rst | 108 +++++++++++++++++++++++++++ 2 files changed, 123 insertions(+) create mode 100644 Documentation/driver-api/slimbus/index.rst create mode 100644 Documentation/driver-api/slimbus/summary.rst diff --git a/Documentation/driver-api/slimbus/index.rst b/Documentation/driver-api/slimbus/index.rst new file mode 100644 index 000000000000..586f979659e6 --- /dev/null +++ b/Documentation/driver-api/slimbus/index.rst @@ -0,0 +1,15 @@ +===================== +SLIMbus Documentation +===================== + +.. toctree:: + :maxdepth: 1 + + summary + +.. only:: subproject + + Indices + ======= + + * :ref:`genindex` diff --git a/Documentation/driver-api/slimbus/summary.rst b/Documentation/driver-api/slimbus/summary.rst new file mode 100644 index 000000000000..d379d1e6be06 --- /dev/null +++ b/Documentation/driver-api/slimbus/summary.rst @@ -0,0 +1,108 @@ +============================ +Linux kernel SLIMbus support +============================ + +Overview +======== + +What is SLIMbus? +---------------- +SLIMbus (Serial Low Power Interchip Media Bus) is a specification developed by +MIPI (Mobile Industry Processor Interface) alliance. The bus uses master/slave +configuration, and is a 2-wire multi-drop implementation (clock, and data). + +Currently, SLIMbus is used to interface between application processors of SoCs +(System-on-Chip) and peripheral components (typically codec).SLIMbus uses +Time-Division-Multiplexing to accommodate multiple data channels, and +a control channel. + +The control channel is used for various control functions such as bus +management, configuration and status updates.These messages can be unicast (e.g. +reading/writing device specific values), or multicast (e.g. data channel +reconfiguration sequence is a broadcast message announced to all devices) + +A data channel is used for data-transfer between 2 Slimbus devices. Data +channel uses dedicated ports on the device. + +Hardware description: +--------------------- +Slimbus specification has different types of device classifications based on +their capabilities. +A manager device is responsible for enumeration, configuration, and dynamic +channel allocation. Every bus has 1 active manager. + +A generic device is a device providing application functionality (e.g. codec). + +Framer device is responsible for clocking the bus, and transmitting frame-sync +and framing information on the bus. + +Each SLIMbus component has an interface device for monitoring physical layer. + +Typically each SoC contains SLIMbus component having 1 manager, 1 framer device, +1 generic device (for data channel support), and 1 interface device. +External peripheral SLIMbus component usually has 1 generic device (for +functionality/data channel support), and an associated interface device. +The generic device's registers are mapped as 'value elements' so that they can +be written/read using Slimbus control channel exchanging control/status type of +information. +In case there are multiple framer devices on the same bus, manager device is +responsible to select the active-framer for clocking the bus. + +Per specification, Slimbus uses "clock gears" to do power management based on +current frequency and bandwidth requirements. There are 10 clock gears and each +gear changes the Slimbus frequency to be twice its previous gear. + +Each device has a 6-byte enumeration-address and the manager assigns every +device with a 1-byte logical address after the devices report presence on the +bus. + +Software description: +--------------------- +There are 2 types of SLIMbus drivers: + +slim_controller represents a 'controller' for SLIMbus. This driver should +implement duties needed by the SoC (manager device, associated +interface device for monitoring the layers and reporting errors, default +framer device). + +slim_device represents the 'generic device/component' for SLIMbus, and a +slim_driver should implement driver for that slim_device. + +Device notifications to the driver: +----------------------------------- +Since SLIMbus devices have mechanisms for reporting their presence, the +framework allows drivers to bind when corresponding devices report their +presence on the bus. +However, it is possible that the driver needs to be probed +first so that it can enable corresponding SLIMbus device (e.g. power it up and/or +take it out of reset). To support that behavior, the framework allows drivers +to probe first as well (e.g. using standard DeviceTree compatbility field). +This creates the necessity for the driver to know when the device is functional +(i.e. reported present). device_up callback is used for that reason when the +device reports present and is assigned a logical address by the controller. + +Similarly, SLIMbus devices 'report absent' when they go down. A 'device_down' +callback notifies the driver when the device reports absent and its logical +address assignment is invalidated by the controller. + +Another notification "boot_device" is used to notify the slim_driver when +controller resets the bus. This notification allows the driver to take necessary +steps to boot the device so that it's functional after the bus has been reset. + +Clock-pause: +------------ +SLIMbus mandates that a reconfiguration sequence (known as clock-pause) be +broadcast to all active devices on the bus before the bus can enter low-power +mode. Controller uses this sequence when it decides to enter low-power mode so +that corresponding clocks and/or power-rails can be turned off to save power. +Clock-pause is exited by waking up framer device (if controller driver initiates +exiting low power mode), or by toggling the data line (if a slave device wants +to initiate it). + +Messaging APIs: +--------------- +The framework supports APIs to exchange control-information with a SLIMbus +device. APIs can be synchronous or asynchronous. +From controller's perspective, multiple buffers can be queued to/from +hardware for sending/receiving data using slim_ctrl_buf circular buffer. +The header file has more documentation about messaging APIs.