All of lore.kernel.org
 help / color / mirror / Atom feed
From: mark gross <mgross@linux.intel.com>
To: Randy Dunlap <rdunlap@infradead.org>
Cc: mgross@linux.intel.com, markgross@kernel.org, arnd@arndb.de,
	bp@suse.de, damien.lemoal@wdc.com, dragan.cvetic@xilinx.com,
	gregkh@linuxfoundation.org, corbet@lwn.net,
	leonard.crestez@nxp.com, palmerdabbelt@google.com,
	paul.walmsley@sifive.com, peng.fan@nxp.com, robh+dt@kernel.org,
	shawnguo@kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 01/22] Add Vision Processing Unit (VPU) documentation.
Date: Thu, 7 Jan 2021 12:16:14 -0800	[thread overview]
Message-ID: <20210107201614.GA93149@linux.intel.com> (raw)
In-Reply-To: <34734a1c-2cd8-89de-4630-753f49c5fdfa@infradead.org>

On Fri, Dec 18, 2020 at 03:30:18PM -0800, Randy Dunlap wrote:
> Hi--
> 
> On 12/1/20 2:34 PM, mgross@linux.intel.com wrote:
> > From: mark gross <mgross@linux.intel.com>
> > 
> > 
> > Reviewed-by: Mark Gross <mgross@linux.intel.com>
> > Signed-off-by: Mark Gross <mgross@linux.intel.com>
> 
> My reading of submitting-patches.rst seems to indicate that
> the Reviewer and Submitter are probably not the same person.
> 
> Are you sure that you reviewed it?
> 
> 
> > ---
> >  Documentation/index.rst                  |   3 +-
> >  Documentation/vpu/index.rst              |  16 ++
> >  Documentation/vpu/vpu-stack-overview.rst | 267 +++++++++++++++++++++++
> >  3 files changed, 285 insertions(+), 1 deletion(-)
> >  create mode 100644 Documentation/vpu/index.rst
> >  create mode 100644 Documentation/vpu/vpu-stack-overview.rst
> > 
> > diff --git a/Documentation/index.rst b/Documentation/index.rst
> > index 57719744774c..0a2cc0204e8f 100644
> > --- a/Documentation/index.rst
> > +++ b/Documentation/index.rst
> > @@ -1,4 +1,4 @@
> > -.. SPDX-License-Identifier: GPL-2.0
> > +.. SPDX-License-Identifier: GPL-2.0-only
> 
> That looks both inappropriate for this patch and incorrect AFAICT.
> 
> >  
> >  
> >  .. The Linux Kernel documentation master file, created by
> > @@ -137,6 +137,7 @@ needed).
> >     misc-devices/index
> >     scheduler/index
> >     mhi/index
> > +   vpu/index
> >  
> >  Architecture-agnostic documentation
> >  -----------------------------------
> > diff --git a/Documentation/vpu/index.rst b/Documentation/vpu/index.rst
> > new file mode 100644
> > index 000000000000..7e290e048910
> > --- /dev/null
> > +++ b/Documentation/vpu/index.rst
> > @@ -0,0 +1,16 @@
> > +.. SPDX-License-Identifier: GPL-2.0-only
> 
> license-rules.rst says:
> 
> 	For 'GNU General Public License (GPL) version 2 only' use:
> 	  SPDX-License-Identifier: GPL-2.0
> 
> > +
> > +============================================
> > +Vision Processor Unit Documentation
> > +============================================
> > +
> > +This documentation contains information for the Intel VPU stack.
> > +
> > +.. class:: toc-title
> > +
> > +	   Table of contents
> > +
> > +.. toctree::
> > +   :maxdepth: 2
> > +
> > +   vpu-stack-overview
> > diff --git a/Documentation/vpu/vpu-stack-overview.rst b/Documentation/vpu/vpu-stack-overview.rst
> > new file mode 100644
> > index 000000000000..53c06a7d9a52
> > --- /dev/null
> > +++ b/Documentation/vpu/vpu-stack-overview.rst
> > @@ -0,0 +1,267 @@
> > +.. SPDX-License-Identifier: GPL-2.0-only
> 
> Nope.
> 
> > +
> > +======================
> > +Intel VPU architecture
> > +======================
> > +
> > +Overview
> > +========
> > +
> > +The Intel Movidius acquisition has developed a Vision Processing Unit (VPU)
> > +roadmap of products starting with Keem Bay (KMB).  The HW configurations the
> 
> s/HW/hardware/
> 
> > +VPU can support include:
> > +
> > +1. Standalone smart camera that does local CV processing in camera
> 
> Tell us what CV is before using it.
> 
> > +2. Standalone appliance or SBC device connected to a network and tethered
> 
> Tell us what SBC is before using it. (yeah, I know)
> 
> > +   cameras doing local CV processing
> > +3. Embedded in a USB dongle or M.2 as an CV accelerator.
> > +4. Multiple VPU enabled SOC's on a PCIE card as a CV accelerator in a larger IA
> 
>                                       PCIe (?)
> 
> > +   box or server.
> > +
> > +Keem Bay is the first instance of this family of products. This document
> > +provides an architectural overview of the SW stack supporting the VPU enabled
> 
> s/SW/software/
> 
> > +products.
> > +
> > +Keem Bay (KMB) is a Computer Vision AI processing SoC based on ARM A53 CPU that
> > +provides Edge neural network acceleration (inference) and includes a Vision
> > +Processing Unit (VPU) hardware.  The ARM CPU SubSystem (CPUSS) interfaces
> > +locally to the VPU and enables integration/interfacing with a remote host over
> > +PCIe or USB or Ethernet interfaces. The interface between the CPUSS and the VPU
> > +is implemented with HW FIFOs (Control) and coherent memory mapping (Data) such
> > +that zero copy processing can happen within the VPU.
> > +
> > +The KMB can be used in all 4 of the above classes of designs.
> > +
> > +We refer to the 'local host' as being the ARM part of the SoC, while the
> > +'remote host' as the IA system hosting the KMB device(s).  The KMB SoC boots
> > +from an eMMC via uBoot and ARM Linux compatible device tree interface with an
> > +expectation to fully boot within hundreds of milliseconds.  There is also
> > +support for downloading the kernel and root file system image from a remote
> > +host.
> > +
> > +The eMMC can be updated with standard mender update process.
> 
>                                          Mender
> 
> > +See https://github.com/mendersoftware/mender
> > +
> > +The VPU is started and controlled from the A53 local host.  Its firmware image
> > +is loaded using the drive FW helper KAPI's.
> 
> s/FW/firmware/
> 
> > +
> > +The VPU IP FW payload consists of a SPARC ISA RTEMS bootloader and/or
> > +application binary.
> > +
> > +The interface allowing (remote or local) host clients  to access VPU IP
> 
>                                                         ^^drop one space
> 
> > +capabilities is realized through an abstracted programming model, which
> > +provides Remote Proxy APIs for a host CPU application to dynamically create and
> > +execute CV and NN workloads on the VPU. All frameworks exposed through
> 
> Tell us what NN is.
> 
> > +programming model’s APIs are contained in the pre-compiled standard firmware
> > +image.
> > +
> > +There is a significant SW stack built up to support KMB and the use cases.  The
> > +rest of this documentation provides an overview of the components of the stack.
> > +
> > +Keem Bay IPC
> > +============
> > +
> > +Directly interfaces with the KMB HW FIFOs to provide zero copy processing from
> > +the VPU.  It implements the lowest level protocol for interacting with the VPU.
> > +
> > +The Keem Bay IPC mechanism is based on shared memory and hardware FIFOs,
> 
>                                                                      FIFOs.
> 
> > +specifically there are:
> 
>    Specifically
> 
> > +
> > +* Two 128-entry HW FIFOs, one for the CPU and one for the VPU.
> > +* Two shared memory regions, used as memory pool for allocating IPC buffers
> 
> end with a period since the previous line did that.
> 
> > +
> > +An IPC channel is a software abstraction allowing communication multiplexing,
> > +so that multiple applications / users can concurrently communicated to the VPU.
> 
>                                                           communicate
> 
> > +IPC channels area conceptually similar to socket ports.
> > +
> > +There is a total of 1024 channels, each one identified by a channel ID, ranging
> 
>          are
> 
> > +from 0 to 1023.
> > +
> > +Channels are divided in two categories:
> > +
> > +* High-Speed (HS) channels, having IDs in the 0-9 range.
> > +* General-Purpose (GP) channels, having IDs in the 10-1023 range.
> > +
> > +HS channels have higher priority over GP channels and can be used by
> > +applications requiring higher throughput or lower latency.
> > +
> > +Since all the channels share the same HW resources (i.e., the HW FIFOs and the
> > +IPC memory pools), the Keem Bay IPC driver uses software queues to give a
> > +higher priority to HS channels.
> > +
> > +The driver supports a build-time configurable number of communication channels
> > +defined in a so called Channel Mapping Table.
> 
>                 so-called
> 
> > +
> > +An IPC channel is full duplex: a pending operation from a certain channel does
> > +not block other operations on the same channel, regardless of their operation
> > +mode (blocking or non-blocking).
> > +
> > +Operation mode is individually selectable for each channel, per operation
> > +direction (read or write). All operations for that direction comply to
> > +selection.
> > +
> > +
> > +Keem Bay-VPU-IPC
> > +================
> > +
> > +This is the MMIO driver of the VPU IP block inside the SOC. It is a control
> > +driver mapping IPC channel communication to Xlink virtual channels.
> > +
> > +This driver provides the following functionality to other drivers in the
> > +communication stack:
> > +
> > +* VPU IP execution control (firmware load, start, reset)
> > +* VPU IP event notifications (device connected, device disconnected, WDT event)
> > +* VPU IP device status query (OFF, BUSY, READY, ERROR, RECOVERY)
> > +* Communication via the IPC protocol (wrapping the Keem Bay IPC driver and
> > +  exposing it to higher level Xlink layer)
> > +
> > +In addition to the above, the driver exposes SoC information (like stepping,
> > +device ID, etc.) to user-space via sysfs.
> > +
> > +This driver depends on the 'Keem Bay IPC' driver, which enables the Keem Bay
> > +IPC communication protocol.
> > +
> > +The driver uses the Firmware API to load the VPU firmware from user-space.
> > +
> > +Xlink-IPC
> > +=========
> > +This component is implementing the IPC specific Xlink protocol. It maps channel
> 
>         component implements          IPC-specific
> 
> 
> > +IDs to HW FIFO entries, using the Keem Bay VPU IPC driver.
> > +
> > +Some of the main functions this driver provides:
> > +
> > +* establishing a connection with an IPC device
> > +* obtaining a list with the available devices
> > +* obtaining the status for a device
> > +* booting a device
> > +* resetting a device
> > +* opening and closing channels
> > +* issuing read and write operations
> > +
> > +Xlink-core
> > +==========
> > +
> > +This component implements an abstracted set of control and communication APIs
> > +based on channel identification. It is intended to support VPU technology both
> > +at SoC level as well as at IP level, over multiple interfaces.
> > +
> > +It provides symmetrical services, where the producer and the consumer have
> > +the same privileges.
> > +
> > +Xlink driver has the ability to abstract several types of communication
> > +channels underneath, allowing the usage of different interfaces with the same
> > +function calls.
> > +
> > +Xlink services are available to both kernel and user space clients and include:
> > +
> > +* interface abstract control and communication API
> > +* multi device support
> > +* concurrent communication across 4096 communication channels (from 0 to
> > +  0xFFF), with customizable properties
> > +* full duplex channels with multiprocess and multithread support
> > +* channel IDs can be mapped to desired physical interface (PCIE, USB, ETH, IPC)
> 
>                                                               PCIe
> 
> > +  via a Channel Mapping Table
> > +* asynchronous fast pass through mode: remote host data packets are directly
> 
>                        passthrough
> 
> > +  dispatched using interrupt systems running on local host to IPC calls for low
> > +  overhead
> > +* channel handshaking mechanism for peer to peer communication, without the
> > +  need of static channel preallocation
> > +* channel resource management
> > +* asynchronous data and device notifications to subscribers
> > +
> > +Xlink transports: PCIe, USB, ETH, IPCXLink-PCIe
> 
>                                      IPC,
> 
> > +
> > +XLink-PCIE
> 
>          PCIe
> 
> > +==========
> > +This is an endpoint driver that is mapping Xlink channel IDs to PCIE channels.
> 
>                               that maps                            PCIe
> 
> > +
> > +This component ensures (remote)host-to-(local)host communication, and VPU IP
> > +communication via an asynchronous pass through mode, where PCIE data loads are
> 
>                                      passthrough              PCIe
> 
> 
> > +directly dispatched to Xlink-IPC.
> > +
> > +The component builds and advertises Device IDs that can are used by local host
> 
>                                                   that are used
> 
> > +application in case of multi device scenarios.
> > +
> > +XLink-USB
> > +==========
> > +This is an endpoint driver that is mapping Xlink channel IDs to bidirectional
> 
>                               that maps
> 
> > +USB endpoints and supports CDC USB class protocol. More than one Xlink channels
> 
>                                                                           channel
> 
> > +can be mapped to a single USB endpoint.
> > +
> > +This component ensures host-to-host communication, and, as well, asynchronous
> > +pass through communication, where USB transfer packets are directly dispatched
> 
>   passthrough
> 
> > +to Xlink-IPC.
> > +
> > +The component builds and advertises Device IDs that can are used by local host
> 
>                                                   that are used
> 
> > +application in case of multi device scenarios.
> > +
> > +XLink-ETH
> > +=========
> > +
> > +This is an endpoint driver that is mapping Xlink channel IDs to Ethernet
> 
>                               that maps
> 
> > +sockets.
> > +
> > +This component ensures host-to-host communication, and, as well, asynchronous
> > +pass through communication, where Ethernet data loads are directly dispatched to
> 
>    passthrough
> 
> > +Xlink-IPC.
> > +
> > +The component builds and advertises Device IDs that can are used by local host
> 
>                                                   that are used
> 
> > +application in case of multi device scenarios.
> > +
> > +Assorted drivers that depend on this stack:
> > +
> > +Xlink-SMB
> > +=========
> > +The Intel Edge.AI Computer Vision platforms have to be monitored using platform
> > +devices like sensors, fan controller, IO expander etc. Some of these devices
> > +are memory mapped and some are i2c based. Either of these devices are not
> 
>                                   I2C-based. None of these devices is
> 
> > +directly accessible to the host.
> > +
> > +The host here refers to the server to which the vision accelerators are
> > +connected over PCIe Interface. The Host needs to do a consolidated action based
> > +on the parameters of platform devices. In general, most of the standard devices
> > +(includes sensors, fan controller, IO expander etc) are I2C/SMBus based and are
> 
>                                                                SMBus-based
> 
> > +used to provide the status of the accelerator. Standard drivers for these
> > +devices are available based on i2c/smbus APIs.
> 
>                                   I2C/SMBus
> 
> > +
> > +Instead of changing the sensor drivers to adapt to PCIe interface, a generic
> > +i2c adapter "xlink-smbus" which underneath uses xlink as physical medium is
> 
>    I2C                                             Xlink
> 
> > +used. With xlink-smbus, the drivers for the platform devices doesn't need to
> 
>                                                                 don't
> 
> > +undergo any interface change.
> > +
> > +TSEN
> > +====
> > +
> > +Thermal sensor driver for exporting thermal events to the local Arm64 host as
> > +well as to the remote X86 host if in the PCIe add in CV accelerator
> 
>                                                  add-in
> 
> > +configuration.
> > +
> > +The driver receiving the junction temperature from different heating points
> 
>               receives
> 
> > +inside the SOC. The driver will receive the temperature on SMBUS connection and
> 
>                                                               SMBus
> 
> > +forward over xlink-smb when in a remote host configuration.
> > +
> > +In Keem Bay, the four thermal junction temperature points are, Media Subsystem
> 
>                                                                 ^no comma
> 
> > +(mss), NN subsystem (nce), Compute subsystem (cse) and SOC(Maximum of mss, nce
> 
>                                                       and SOC (maximum of mss, nce
> > +and cse)
> 
>        cse).
> 
> > +
> > +HDDL
> > +====
> > +
> > +- Exports details of temperature sensor, current sensor and fan controller
> > +  present in Intel Edge.AI Computer Vision platforms to IA host.
> > +- Enable Time sync of Intel Edge.AI Computer Vision platform with IA host.
> > +- Handles device connect and disconnect events.
> > +- Receives slave address from the IA host for memory mapped thermal sensors
> > +  present in SoC (Documentation/hwmon/intel_tsens_sensors.rst).
> > +- Registers i2c slave device for slaves present in Intel Edge.AI Computer
> 
>                I2C
> 
> > +  Vision platform
> > +
> > +
> > +VPUMGR (VPU Manager)
> > +====================
> > +
> > +Bridges firmware on VPU side and applications on CPU user-space, it assists
> > +firmware on VPU side serving multiple user space application processes on CPU
> > +side concurrently while also performing necessary data buffer management on
> > +behalf of VPU IP.
> > 
> 
> 
> -- 
> ~Randy
Thanks for the great feedback I've just applied it to my tree for the next
posting.

--mark


  reply	other threads:[~2021-01-07 20:18 UTC|newest]

Thread overview: 67+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-01 22:34 [PATCH 00/22] Intel Vision Processing Unit base enabling part 1 mgross
2020-12-01 22:34 ` [PATCH 01/22] Add Vision Processing Unit (VPU) documentation mgross
2020-12-18 23:30   ` Randy Dunlap
2021-01-07 20:16     ` mark gross [this message]
2020-12-01 22:34 ` [PATCH 02/22] dt-bindings: Add bindings for Keem Bay IPC driver mgross
2020-12-07 16:01   ` Rob Herring
2020-12-07 18:22     ` mark gross
2020-12-07 18:42     ` Daniele Alessandrelli
2020-12-07 20:31       ` Jassi Brar
2020-12-09  0:12         ` mark gross
2020-12-09 16:49           ` Jassi Brar
2020-12-09 17:33       ` Rob Herring
2020-12-01 22:34 ` [PATCH 03/22] keembay-ipc: Add Keem Bay IPC module mgross
2020-12-02  6:16   ` Greg KH
2020-12-02 17:42     ` mark gross
2020-12-02 19:01       ` Greg KH
2020-12-05  3:35         ` mark gross
2020-12-05  8:40           ` Greg KH
2020-12-05 16:37             ` Gross, Mark
2020-12-07  1:36               ` mark gross
2020-12-02  6:19   ` Greg KH
2020-12-08 18:59     ` Daniele Alessandrelli
2020-12-08 19:48       ` Greg KH
2020-12-10 18:38         ` Daniele Alessandrelli
2020-12-11  8:22           ` Greg KH
2020-12-11 17:26             ` Gross, Mark
2020-12-01 22:34 ` [PATCH 04/22] dt-bindings: Add bindings for Keem Bay VPU IPC driver mgross
2020-12-07 15:57   ` Rob Herring
2020-12-07 21:28     ` mark gross
2020-12-01 22:34 ` [PATCH 05/22] keembay-vpu-ipc: Add Keem Bay VPU IPC module mgross
2020-12-01 22:34 ` [PATCH 06/22] misc: xlink-pcie: Add documentation for XLink PCIe driver mgross
2020-12-18 22:59   ` Randy Dunlap
2020-12-19  0:07     ` mark gross
2020-12-01 22:34 ` [PATCH 07/22] misc: xlink-pcie: lh: Add PCIe EPF driver for Local Host mgross
2020-12-01 22:34 ` [PATCH 08/22] misc: xlink-pcie: lh: Add PCIe EP DMA functionality mgross
2020-12-01 22:34 ` [PATCH 09/22] misc: xlink-pcie: lh: Add core communication logic mgross
2020-12-02  6:18   ` Greg KH
2020-12-02 16:46     ` Thokala, Srikanth
2020-12-01 22:34 ` [PATCH 10/22] misc: xlink-pcie: lh: Prepare changes for adding remote host driver mgross
2020-12-01 22:35 ` [PATCH 11/22] misc: xlink-pcie: rh: Add PCIe EP driver for Remote Host mgross
2020-12-01 22:35 ` [PATCH 12/22] misc: xlink-pcie: rh: Add core communication logic mgross
2020-12-01 22:35 ` [PATCH 13/22] misc: xlink-pcie: Add XLink API interface mgross
2020-12-01 22:35 ` [PATCH 14/22] misc: xlink-pcie: Add asynchronous event notification support for XLink mgross
2020-12-01 22:35 ` [PATCH 15/22] xlink-ipc: Add xlink ipc device tree bindings mgross
2020-12-07 15:58   ` Rob Herring
2020-12-07 21:41     ` mark gross
2020-12-01 22:35 ` [PATCH 16/22] xlink-ipc: Add xlink ipc driver mgross
2020-12-07  2:32   ` Joe Perches
2020-12-11 11:33     ` Kelly, Seamus
2020-12-11 12:14       ` gregkh
2020-12-11 17:12         ` Gross, Mark
2020-12-07 19:53   ` Randy Dunlap
2020-12-01 22:35 ` [PATCH 17/22] xlink-core: Add xlink core device tree bindings mgross
2020-12-07 16:02   ` Rob Herring
2020-12-01 22:35 ` [PATCH 18/22] xlink-core: Add xlink core driver xLink mgross
2020-12-07 21:50   ` Randy Dunlap
2020-12-01 22:35 ` [PATCH 19/22] xlink-core: Enable xlink protocol over pcie mgross
2020-12-01 22:35 ` [PATCH 20/22] xlink-core: Enable VPU IP management and runtime control mgross
2020-12-01 22:35 ` [PATCH 21/22] xlink-core: add async channel and events mgross
2020-12-07  2:55   ` Joe Perches
2020-12-11 11:34     ` Kelly, Seamus
2020-12-01 22:35 ` [PATCH 22/22] xlink-core: factorize xlink_ioctl function by creating sub-functions for each ioctl command mgross
2020-12-07  3:05   ` Joe Perches
2020-12-07 21:59     ` mark gross
2020-12-09  8:30   ` Joe Perches
2020-12-11 11:36     ` Kelly, Seamus
  -- strict thread matches above, loose matches on Subject: below --
2020-11-30 23:06 [PATCH 00/22] Intel Vision Processing Unit base enabling part 1 mgross
2020-11-30 23:06 ` [PATCH 01/22] Add Vision Processing Unit (VPU) documentation mgross

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210107201614.GA93149@linux.intel.com \
    --to=mgross@linux.intel.com \
    --cc=arnd@arndb.de \
    --cc=bp@suse.de \
    --cc=corbet@lwn.net \
    --cc=damien.lemoal@wdc.com \
    --cc=dragan.cvetic@xilinx.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=leonard.crestez@nxp.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=markgross@kernel.org \
    --cc=palmerdabbelt@google.com \
    --cc=paul.walmsley@sifive.com \
    --cc=peng.fan@nxp.com \
    --cc=rdunlap@infradead.org \
    --cc=robh+dt@kernel.org \
    --cc=shawnguo@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.