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: 118956 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp4365157qgn; Wed, 15 Nov 2017 06:13:42 -0800 (PST) X-Google-Smtp-Source: AGs4zMb2Am9C8vfPGOEM2fJcmSLnOQhsay1VaJn0D6SFBwOnfWCNYcW0EvfE/TXiT6ZFjywuIBiT X-Received: by 10.101.75.78 with SMTP id k14mr15604828pgt.272.1510755222558; Wed, 15 Nov 2017 06:13:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510755222; cv=none; d=google.com; s=arc-20160816; b=qeEcGcjDkcYY7VO8NL3ZL/lzMqOIYMy1OcQTI+WO7gt4xE2vVLb1qwDlrfYHMer6RP 1qFB0rBJxfMjOHM1FF+q5vuYmBkpD3t/ibcecSrlA9OotF9EJgaGcjhFPT/ViMFLifdm zTSY3Nml5sBmHpQg/VeIeVkfhNfvUjGTYmya7phvNhQUIhVIAquRo5hmPqazSwIXPidY PalECvgi4gTO4ZfNDDpr9liTzxGoZJik+lmsz4i1q3MrtFpfSCuQvKHwFNcyAupEL5Rn LYD66rbb4o6Sodf+fdSYd9io2hXU5ekiiu1XLv74YGFSPTQqmzdW1dhvs6+2ZKlAv7IC Z2rA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=VfukUrF+wqtkxD2tZARF3u3TwoQvFoxXOK5pVzXc9hs=; b=my5vWElG7EhIM7e3biEFG8ZvCT2Xtb93QcqOWXtYfeD1ZvWwEsGx+3aLvNd3rsNmoH jRxH0c6At3fvoqq95NcSO4yavRmQgyWMEgIC54lYECHCes3hq0M5Ku7W/Vs08QZMWqZF dsldpsV3xDR1L03Gq/EGKD9DHtaOa47ThJzaq6HBiIp54DMpNG31qFhKFr7lfHWqQItT SdB1AMSSAHRFGgwZ+sxCMnDDm9c2mwkO+RrhzsQZo+JfqHNtFXfJd5lFWKR8Nv46v2C+ LNTmfKUTaat/HNIVLk9Ogq4paighrqicLDXDcXHUQDUH5GGnCm1X+Ynz7O2T4N2v/2NW vCyw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=OU/1uCzr; 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=fail (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 g1si18864254pln.619.2017.11.15.06.13.42; Wed, 15 Nov 2017 06:13:42 -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=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=OU/1uCzr; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757977AbdKOONe (ORCPT + 6 others); Wed, 15 Nov 2017 09:13:34 -0500 Received: from mail-wr0-f196.google.com ([209.85.128.196]:50804 "EHLO mail-wr0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757323AbdKOON0 (ORCPT ); Wed, 15 Nov 2017 09:13:26 -0500 Received: by mail-wr0-f196.google.com with SMTP id p96so20547624wrb.7 for ; Wed, 15 Nov 2017 06:13:26 -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=PLiWTqy2xvxMPea0gi9d6tdT60pM94/5+Fcu1tsac2K8JoInrRo2mmDDXlkyHNGj3l R2jtq81806qPUcVVLLRGCBwQwE+PwdID5Nk91ixTq5NQPMqIsTPpsAlrA0/xrmTISENE YRqLXp2thU1MxFXc+xq0Lsq1GA4ciqFecy8oKet37LG18/jGS0327PVSN08dLIxugk1L DixSVRNnNEkdnaDYpNpxvimuXj3KdAlZ/ofBqoFGsODv1uJ+9jtqzk7x5AgsygTMtf9W p2LCeZGpc7ICc2V2uXGEy84Kohu/69r3ZAux9GRI7vlLCwZKXipurefhGIlSKRU4xZkl DDnw== X-Gm-Message-State: AJaThX6j28wWSZtmyIuO2YjL0ArTQGsXrB0iSWt5dhE0TShcOldEkXw8 DyzechifD6IAfWrQuOrNV2nyKQ== 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 Cc: sdharia@codeaurora.org, bp@suse.de, poeschel@lemonage.de, treding@nvidia.com, andreas.noever@gmail.com, alan@linux.intel.com, mathieu.poirier@linaro.org, daniel@ffwll.ch, jkosina@suse.cz, sharon.dvir1@mail.huji.ac.il, joe@perches.com, davem@davemloft.net, james.hogan@imgtec.com, michael.opdenacker@free-electrons.com, robh+dt@kernel.org, pawel.moll@arm.com, mark.rutland@arm.com, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, vinod.koul@intel.com, arnd@arndb.de, Srinivas Kandagatla Subject: [PATCH v7 01/13] Documentation: Add SLIMbus summary 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> Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org 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 -- 2.15.0 -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html 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.