Intel Vision Processing base enabling
Subsystems (6)
PATCH v4 34/34 misc: HDDL device management for IA host
In reply to [email protected]From: "C, Udhayakumar" <[email protected]>
Add IA host hddl device management driver for Intel Edge.AI Computer Vision platforms.
About Intel Edge.AI Computer Vision platforms:
---------------------------------------------
The Intel Edge.AI Computer Vision platforms are vision processing systems targeting machine vision applications for connected devices.
They are based on ARM A53 CPU running Linux and acts as a PCIe endpoint device.
High-level architecture:
------------------------
Remote Host IA CPU Local Host ARM CPU
------------------------------- ---------------------------- | * Send time as xlink packet | |* Sync time with IA host | | * receive sensor details | |* Prepare and share sensor| | and register as i2c or | | details to IA host as | | xlink smbus slaves | | xlink packets | ------------------------------- ---------------------------- | hddl server | <=====> | hddl client | ------------------------------- xlink ----------------------------
hddl device module:
-------------------
The HDDL client driver acts as an software RTC to sync with network time. It abstracts xlink protocol to communicate with remote host. This driver exports the details about sensors available in the platform to remote host as xlink packets.
This driver also handles device connect/disconnect events and identifies board id and soc id using gpio's, based on platform configuration.
- Remote Host driver
* Intended for IA CPU
* It is based on xlink Framework
* Driver path:
{tree}/drivers/misc/hddl_device/hddl_device_server.c
Local arm host and Remote IA host drivers communicates using XLINK protocol.
--- .../misc-devices/hddl_device_server.rst | 205 +++++ Documentation/misc-devices/index.rst | 1 + drivers/misc/hddl_device/Kconfig | 12 + drivers/misc/hddl_device/Makefile | 2 + drivers/misc/hddl_device/hddl_device_rh.c | 837 ++++++++++++++++++ 5 files changed, 1057 insertions(+) create mode 100644 Documentation/misc-devices/hddl_device_server.rst create mode 100644 drivers/misc/hddl_device/hddl_device_rh.c
Documentation/misc-devices/hddl_device_server.rst new file +205 -0
@@ -0,0 +1,205 @@ +.. SPDX-License-Identifier: GPL-2.0 + +Kernel driver: hddl_device_server +================================= + +Supported chips: + * Intel Edge.AI Computer Vision platforms: Keem Bay + +Authors: + - Thalaiappan, Rathina <[email protected]> + - Udhayakumar C <[email protected]> + +High-level architecture +======================= +:: + + Remote Host IA CPU Local Host ARM CPU + ------------------------------- ---------------------------- + | * Send time as xlink packet | |* Sync time with IA host | + | * receive sensor details | |* Prepare and share sensor| + | and register as i2c or | | details to IA host as | + | xlink smbus slaves | | xlink packets | + ------------------------------- ---------------------------- + | hddl server | <=====> | hddl client | + ------------------------------- xlink ---------------------------- + +Overview +======== + +This driver supports hddl device management for Intel Edge.AI Computer Vision +platforms. This driver runs in IA host + +This driver supports the following features: + + - Receives deatils of temperature sensor, current sensor and fan controller + present in Intel Edge.AI Computer Vision platforms. + - Send Time sync data to Intel Edge.AI Computer Vision platform. + - Handles device connect and disconnect events. + - Get free slave address for memory mapped thermal sensors present in SoC + (Documentation/hwmon/intel_tsens_sensors.rst) and share it with Intel + Edge.AI Computer Vision platform. + - Registers i2c slave device for slaves present in Intel Edge.AI Computer + Vision platform + +Keem Bay platform has +Onchip sensors: + + - Media Subsystem (mss) temperature sensor + - NN subsystem (nce) temperature sensor + - Compute subsystem (cse) temperature sensor + - SOC(Maximum of mss, nce and cse). + +Onboard sensors: + + - two lm75 temperature sensors + - emc2103 fan controller + - ina3221 current sensor + +Driver Structure +================ + +The driver provides a platform device where the ``probe`` and ``remove`` +operations are provided. + + - probe: spawn kernel thread to monitor new PCIE devices. + + - init task: Poll for new PCIE device with time interval of 5 seconds and + creates connect task to setup new device. + + - connect task: Connect task is the main entity which connects to hddl + device client using xlink and does the basic initialisation and handshaking. + Additionally it also monitors the hddl device client link down/link up + events and reinitialise the drivers accordingly in the server side. + + - remove: unregister i2c client devices, i2c adapters and close xlink + channel. + +HDDL Server Sequence - Basic Setup and handshaking with HDDL Device Client +========================================================================== +:: + + ,-----. ,---------. ,------------. ,------------------. + |probe| |Init task| |connect task| |hddl device client| + `--+--' `----+----' `-----+------' `--------+---------' + ----. | | | + | "Init char dev"| | | + <---' | | | + | | | | + | ,----------------------!. | | + | |Initialize char device|_\ | | + | |for ioctls | | | + | `------------------------' | | + | "Creates kthread" | | | + |------------------->| | | + | | | | + | ,-----------------------!. | | + | |creates kernel thread |_\ | | + | |to check for new device | | | + | `-------------------------' | | + ,---------------------!. ----. | | + |check for new device |_\ | | | + |with time interval of | <---' | | + |5 seconds | | | | + `-----------------------' | | | + ,---------------------!. | | | + |if new device found?.|_\ | | | + |creates connect task | |-------------------->| | + |to setup new device | | | | + `-----------------------' | | | + | ,-------------------!. |----. | + | |setup xlink channel|_\| | | + | |to communicate with ||<---' | + | |client || | + | `---------------------'| | + | | | share time data | + | | | to client | + | | | --------------------------> + | | | | + | | | receives board id | + | | | <-------------------------- + | | | | + | | | Gets total number of | + | | | sensors available in SoC | + | | | <-------------------------- + | | | | + | ,-----------------------!. | | + | |For each sensors get |_\| | + | |sensor type, name, trip || <-------------------------- + | |temp, trip type || | + | `-------------------------'| | + | | | Send complete. | + | | | --------------------------> + | | | | + | | |----. | + | | | | Register xlink i2c | + | | |<---' adapters. | + | | | | + | | | | + | | | send slave addr for | + | | | each salve in SoC | + | | | --------------------------> + | | | | + | | |----. | + | | | | Register i2c clients.| + | | |<---' | + | | | | + | | |----. + | | | | poll for device status + | | |<---' + ,--+--. ,----+----. ,-----+------. ,--------+---------. + |probe| |Init task| |connect task| |hddl device client| + `-----' `---------' `------------' `------------------' + + +XLINK i2c sequence: +=================== +:: + + ,-----------------. ,--------. ,---------. ,-----. + |xlink-i2c-adapter| |I2C core| |i2c-slave| |xlink| + `--------+--------' `---+----' `----+----' `--+--' + | | | | + |---------------------->| | | + | | | | + | ,--------------------------!. | | + | |Initialize xlink based i2c|_\ | | + | |adapters. | | | + | `----------------------------' | | + | | | | + | | <------------------| | + | | | | + | | ,----------------------!. | + | | |Linux i2c slave device|_\ | + | | |standard request | | + | | `------------------------' | + | i2c request from | | | + | clients. | | | + |<----------------------| | | + | | | | + | | | | + |-------------------------------------------------------------->| + | | | | + | | ,----------------------------!. | + | | |I2C request is sent as xlink|_\ | + | | |packet to SoC | | + | | `------------------------------' | + | | | | + |<--------------------------------------------------------------| + | | | | + | | ,------------------------------!. | + | | |I2C response from SoC as xlink|_\ | + | | |packet | | + | | `--------------------------------' | + | | | | + |---------------------->| | | + | | | | + | ,---------------------------!. | | + | |xlink response is converted|_\ | | + | |to standard i2c response. | | | + | `-----------------------------' | | + | | i2c response | | + | | ------------------>| | + ,--------+--------. ,---+----. ,----+----. ,--+--. + |xlink-i2c-adapter| |I2C core| |i2c-slave| |xlink| + `-----------------' `--------' `---------' `-----'
Documentation/misc-devices/index.rst +1 -0
@@ -20,6 +20,7 @@ fit into other categories. eeprom c2port hddl_device_client.rst + hddl_device_server.rst ibmvmc ics932s401 isl29003
drivers/misc/hddl_device/Kconfig +12 -0
@@ -12,3 +12,15 @@ config HDDL_DEVICE_CLIENT the device connect/disconnect programming sequence. Say Y if using a processor that includes the Intel VPU such as Keem Bay. If unsure, say N. + +config HDDL_DEVICE_SERVER + tristate "Support for hddl device server" + depends on XLINK_CORE && !HDDL_DEVICE_CLIENT + help + This option enables HDDL device server module. + + This driver is used for sharing time sync data to local host and + retrives the sensors available on the platform. This also handles + the device connect/disconnect programming sequence. + Say Y if using a processor that includes the Intel VPU such as + Keem Bay. If unsure, say N.
drivers/misc/hddl_device/Makefile +2 -0
@@ -3,3 +3,5 @@ obj-$(CONFIG_HDDL_DEVICE_CLIENT) += hddl_device_client.o hddl_device_client-objs += hddl_device_lh.o hddl_device.o +obj-$(CONFIG_HDDL_DEVICE_SERVER) += hddl_device_server.o +hddl_device_server-objs += hddl_device_rh.o hddl_device.o
drivers/misc/hddl_device/hddl_device_rh.c new file +837 -0
837 lines not on this page · raw message
Signature · 1 line
2.17.1
PATCH v3 33/34 misc: Hddl device management for local host
In reply to [email protected]From: "C, Udhayakumar" <[email protected]>
Add local host hddl device management for Intel Edge.AI Computer Vision platforms.
About Intel Edge.AI Computer Vision platforms:
---------------------------------------------
The Intel Edge.AI Computer Vision platforms are vision processing systems targeting machine vision applications for connected devices.
They are based on ARM A53 CPU running Linux and acts as a PCIe endpoint device.
High-level architecture:
------------------------
Remote Host IA CPU Local Host ARM CPU
------------------------------- ---------------------------- | * Send time as xlink packet | |* Sync time with IA host | | * receive sensor details | |* Prepare and share sensor| | and register as i2c or | | details to IA host as | | xlink smbus slaves | | xlink packets | ------------------------------- ---------------------------- | hddl server | <=====> | hddl client | ------------------------------- xlink ----------------------------
hddl device module:
-------------------
The HDDL client driver acts as an software RTC to sync with network time. It abstracts xlink protocol to communicate with remote host. This driver exports the details about sensors available in the platform to remote host as xlink packets.
This driver also handles device connect/disconnect events and identifies board id and soc id using gpio's, based on platform configuration.
- Local Host driver
* Intended for ARM CPU
* It is based on xlink Framework
* Driver path:
{tree}/drivers/misc/hddl_device/hddl_device_client.c
Local arm host and Remote IA host drivers communicates using XLINK protocol.
--- .../misc-devices/hddl_device_client.rst | 212 +++++ Documentation/misc-devices/index.rst | 1 + Documentation/vpu/index.rst | 1 + MAINTAINERS | 1 + drivers/misc/Kconfig | 1 + drivers/misc/Makefile | 1 + drivers/misc/hddl_device/Kconfig | 14 + drivers/misc/hddl_device/Makefile | 5 + drivers/misc/hddl_device/hddl_device.c | 565 +++++++++++++ drivers/misc/hddl_device/hddl_device_lh.c | 764 ++++++++++++++++++ drivers/misc/hddl_device/hddl_device_util.h | 52 ++ 11 files changed, 1617 insertions(+) create mode 100644 Documentation/misc-devices/hddl_device_client.rst create mode 100644 drivers/misc/hddl_device/Kconfig create mode 100644 drivers/misc/hddl_device/Makefile create mode 100644 drivers/misc/hddl_device/hddl_device.c create mode 100644 drivers/misc/hddl_device/hddl_device_lh.c create mode 100644 drivers/misc/hddl_device/hddl_device_util.h
Documentation/misc-devices/hddl_device_client.rst new file +212 -0
@@ -0,0 +1,212 @@ +.. SPDX-License-Identifier: GPL-2.0 + +================================= +Kernel driver: hddl_device_client +================================= + +Supported chips: + * Intel Edge.AI Computer Vision platforms: Keem Bay + +Authors: + - Thalaiappan, Rathina <[email protected]> + - Udhayakumar C <[email protected]> + + +Overview +======== + +This driver supports hddl device management for Intel Edge.AI Computer Vision +platforms. + +This driver supports the following features: + + - Exports deatils 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 + Vision platform + +Keem Bay platform has +Onchip sensors: + + - Media Subsystem (mss) temperature sensor + - NN subsystem (nce) temperature sensor + - Compute subsystem (cse) temperature sensor + - SOC(Maximum of mss, nce and cse). + +Onboard sensors: + + - two lm75 temperature sensors + - emc2103 fan controller + - ina3221 current sensor + +High-level architecture +======================= +:: + + Remote Host IA CPU Local Host ARM CPU + ------------------------------- ---------------------------- + | * Send time as xlink packet | |* Sync time with IA host | + | * receive sensor details | |* Prepare and share sensor| + | and register as i2c or | | details to IA host as | + | xlink smbus slaves | | xlink packets | + ------------------------------- ---------------------------- + | hddl server | <=====> | hddl client | + ------------------------------- xlink ---------------------------- + +Driver Structure +================ + +The driver provides a platform device where the ``probe`` and ``remove`` +operations are provided. + + - probe: Gets list of external sensors from device-tree entries, identify + board id and soc id based on configuration from device-tree entries and + spawn kernel thread to monitor new PCIE devices. + + - init task: Poll for new PCIE device with time interval of 5 seconds and + creates connect task to setup new device. + + - connect task: Connect task is the main entity which connects to hddl + device server using xlink and does the basic initialisation and handshaking. + Additionally it also monitors the hddl device server link down/link up + events and reinitialise the drivers accordingly in the client side. + + - remove: unregister i2c client devices, i2c adapters and close xlink + channel. + +HDDL Client Sequence – Basic Setup and handshaking with HDDL Device Server +========================================================================== +:: + + ,-----. ,---------. ,------------. ,------------------. + |probe| |Init task| |connect task| |hddl device server| + `--+--' `----+----' `-----+------' `--------+---------' + ----. | | | + | "Parse DT" | | | + <---' | | | + | | | | + | ,------------------!. | | | + | |Get sensor details|_\ | | | + | |from device tree | | | | + | `--------------------' | | | + ----. | | | + | "Identify Board Id"| | | + <---' | | | + | | | | + | "Creates kthread" | | | + |----------------------->| | | + | | | | + | ,-----------------------!. | | + | |creates kernel thread |_\ | | + | |to check for new device | | | + | `-------------------------' | | + ,---------------------!. ----. | | + |check for new device |_\ | | | + |with time interval of | <---' | | + |5 seconds | | | | + `-----------------------' | | | + ,---------------------!. | | | + |if new device found?.|_\ | | | + |creates connect task | |-------------------->| | + |to setup new device | | | | + `-----------------------' | | | + | ,-------------------!. |----. | + | |setup xlink channel|_\| | | + | |to communicate with ||<---' | + | |server || | + | `---------------------'| | + | | | Get time data | + | | | from server | + | | | <-------------------------- + | | | | + | | | share board id | + | | | --------------------------> + | | | | + | | | share total number of | + | | | sensors available in SoC | + | | | --------------------------> + | | | | + | ,-----------------------!. | | + | |For each sensors share |_\| | + | |sensor type, name, trip || --------------------------> + | |temp, trip type || | + | `-------------------------'| | + | | | Receives Send complete. | + | | | <-------------------------- + | | | | + | | |----. | + | | | | Register xlink i2c | + | | |<---' adapters. | + | | | | + | | | | + | | | Receives slave addr for | + | | | each salve in SoC | + | | | <-------------------------- + | | | | + | | |----. | + | | | | Register i2c clients.| + | | |<---' | + | | | | + | | |----. + | | | | poll for device status + | | |<---' + ,--+--. ,----+----. ,-----+------. ,--------+---------. + |probe| |Init task| |connect task| |hddl device server| + `-----' `---------' `------------' `------------------' + + +XLINK i2c sequence: +=================== +:: + + ,-----------------. ,--------. ,-----. ,---------. + |xlink-i2c-adapter| |I2C core| |xlink| |i2c-slave| + `--------+--------' `---+----' `--+--' `----+----' + | | | | + |---------------------->| | | + | | | | + | ,--------------------------!. | | + | |Initialize xlink based i2c|_\ | | + | |adapters. | | | + | `----------------------------' | | + | | | | + |<-----------------------------------------| | + | | | | + | ,--------------------------------!. | | + | |I2C request is received as xlink|_\ | | + | |packet from IA host | | | + | `----------------------------------' | | + | | | | + |---------------------->| | | + | | | | + | | ,---------------------------------!. + | | |xlink I2C request is converted to|_\ + | | |standard i2c request | + | | `-----------------------------------' + | | | | + | | ----------------------------------->| + | | | | + | | ,----------------------!. | + | | |Linux i2c slave device|_\ | + | | |standard request | | + | | `------------------------' | + | | | | + | | <-----------------------------------| + | | | | + | | ,----------------------!. | + | | |Linux i2c slave device|_\ | + | | |standard response | | + | | `------------------------' | + | I2C response | | | + |<----------------------| | | + | | | | + | | | ,-------------------------!. + |----------------------------------------->| |I2C response is converted|_\ + | | | |to xlink packet | + ,--------+--------. ,---+----. ,--+-`---------------------------' + |xlink-i2c-adapter| |I2C core| |xlink| |i2c-slave| + `-----------------' `--------' `-----' `---------'
Documentation/misc-devices/index.rst +1 -0
@@ -19,6 +19,7 @@ fit into other categories. bh1770glc eeprom c2port + hddl_device_client.rst ibmvmc ics932s401 isl29003
Documentation/vpu/index.rst +1 -0
@@ -17,3 +17,4 @@ This documentation contains information for the Intel VPU stack. xlink-pcie xlink-ipc xlink-core + hddl_device_client
MAINTAINERS +1 -0
@@ -1988,6 +1988,7 @@ F: drivers/misc/intel_tsens/ ARM/INTEL TSENS SUPPORT M: Udhayakumar C <[email protected]> S: Supported +F: drivers/misc/hddl_device/ F: drivers/misc/intel_tsens/ ARM/INTEL RESEARCH IMOTE/STARGATE 2 MACHINE SUPPORT
drivers/misc/Kconfig +1 -0
@@ -487,4 +487,5 @@ source "drivers/misc/xlink-core/Kconfig" source "drivers/misc/vpumgr/Kconfig" source "drivers/misc/intel_tsens/Kconfig" source "drivers/misc/xlink-smbus/Kconfig" +source "drivers/misc/hddl_device/Kconfig" endmenu
drivers/misc/Makefile +1 -0
@@ -63,3 +63,4 @@ obj-$(CONFIG_XLINK_CORE) += xlink-core/ obj-$(CONFIG_VPUMGR) += vpumgr/ obj-y += intel_tsens/ obj-$(CONFIG_XLINK_SMBUS) += xlink-smbus/ +obj-y += hddl_device/
drivers/misc/hddl_device/Kconfig new file +14 -0
@@ -0,0 +1,14 @@ +# Copyright (C) 2020 Intel Corporation +# SPDX-License-Identifier: GPL-2.0-only + +config HDDL_DEVICE_CLIENT + tristate "Support for hddl device client" + depends on XLINK_CORE && INTEL_TSENS_LOCAL_HOST + help + This option enables HDDL device client module. + + This driver is used for sharing time sync data to local host and + retrives the sensors available on the platform. This also handles + the device connect/disconnect programming sequence. + Say Y if using a processor that includes the Intel VPU such as + Keem Bay. If unsure, say N.
drivers/misc/hddl_device/Makefile new file +5 -0
@@ -0,0 +1,5 @@ +# Copyright (C) 2020 Intel Corporation +# SPDX-License-Identifier: GPL-2.0-only + +obj-$(CONFIG_HDDL_DEVICE_CLIENT) += hddl_device_client.o +hddl_device_client-objs += hddl_device_lh.o hddl_device.o
drivers/misc/hddl_device/hddl_device.c new file +565 -0
565 lines not on this page · raw message
drivers/misc/hddl_device/hddl_device_lh.c new file +764 -0
764 lines not on this page · raw message
drivers/misc/hddl_device/hddl_device_util.h new file +52 -0
52 lines not on this page · raw message
Signature · 1 line
2.17.1
PATCH v3 34/34 misc: HDDL device management for IA host
In reply to [email protected]From: "C, Udhayakumar" <[email protected]>
Add IA host hddl device management driver for Intel Edge.AI Computer Vision platforms.
About Intel Edge.AI Computer Vision platforms:
---------------------------------------------
The Intel Edge.AI Computer Vision platforms are vision processing systems targeting machine vision applications for connected devices.
They are based on ARM A53 CPU running Linux and acts as a PCIe endpoint device.
High-level architecture:
------------------------
Remote Host IA CPU Local Host ARM CPU
------------------------------- ---------------------------- | * Send time as xlink packet | |* Sync time with IA host | | * receive sensor details | |* Prepare and share sensor| | and register as i2c or | | details to IA host as | | xlink smbus slaves | | xlink packets | ------------------------------- ---------------------------- | hddl server | <=====> | hddl client | ------------------------------- xlink ----------------------------
hddl device module:
-------------------
The HDDL client driver acts as an software RTC to sync with network time. It abstracts xlink protocol to communicate with remote host. This driver exports the details about sensors available in the platform to remote host as xlink packets.
This driver also handles device connect/disconnect events and identifies board id and soc id using gpio's, based on platform configuration.
- Remote Host driver
* Intended for IA CPU
* It is based on xlink Framework
* Driver path:
{tree}/drivers/misc/hddl_device/hddl_device_server.c
Local arm host and Remote IA host drivers communicates using XLINK protocol.
--- .../misc-devices/hddl_device_server.rst | 205 +++++ Documentation/misc-devices/index.rst | 1 + drivers/misc/hddl_device/Kconfig | 12 + drivers/misc/hddl_device/Makefile | 2 + drivers/misc/hddl_device/hddl_device_rh.c | 837 ++++++++++++++++++ 5 files changed, 1057 insertions(+) create mode 100644 Documentation/misc-devices/hddl_device_server.rst create mode 100644 drivers/misc/hddl_device/hddl_device_rh.c
Documentation/misc-devices/hddl_device_server.rst new file +205 -0
@@ -0,0 +1,205 @@ +.. SPDX-License-Identifier: GPL-2.0 + +Kernel driver: hddl_device_server +================================= + +Supported chips: + * Intel Edge.AI Computer Vision platforms: Keem Bay + +Authors: + - Thalaiappan, Rathina <[email protected]> + - Udhayakumar C <[email protected]> + +High-level architecture +======================= +:: + + Remote Host IA CPU Local Host ARM CPU + ------------------------------- ---------------------------- + | * Send time as xlink packet | |* Sync time with IA host | + | * receive sensor details | |* Prepare and share sensor| + | and register as i2c or | | details to IA host as | + | xlink smbus slaves | | xlink packets | + ------------------------------- ---------------------------- + | hddl server | <=====> | hddl client | + ------------------------------- xlink ---------------------------- + +Overview +======== + +This driver supports hddl device management for Intel Edge.AI Computer Vision +platforms. This driver runs in IA host + +This driver supports the following features: + + - Receives deatils of temperature sensor, current sensor and fan controller + present in Intel Edge.AI Computer Vision platforms. + - Send Time sync data to Intel Edge.AI Computer Vision platform. + - Handles device connect and disconnect events. + - Get free slave address for memory mapped thermal sensors present in SoC + (Documentation/hwmon/intel_tsens_sensors.rst) and share it with Intel + Edge.AI Computer Vision platform. + - Registers i2c slave device for slaves present in Intel Edge.AI Computer + Vision platform + +Keem Bay platform has +Onchip sensors: + + - Media Subsystem (mss) temperature sensor + - NN subsystem (nce) temperature sensor + - Compute subsystem (cse) temperature sensor + - SOC(Maximum of mss, nce and cse). + +Onboard sensors: + + - two lm75 temperature sensors + - emc2103 fan controller + - ina3221 current sensor + +Driver Structure +================ + +The driver provides a platform device where the ``probe`` and ``remove`` +operations are provided. + + - probe: spawn kernel thread to monitor new PCIE devices. + + - init task: Poll for new PCIE device with time interval of 5 seconds and + creates connect task to setup new device. + + - connect task: Connect task is the main entity which connects to hddl + device client using xlink and does the basic initialisation and handshaking. + Additionally it also monitors the hddl device client link down/link up + events and reinitialise the drivers accordingly in the server side. + + - remove: unregister i2c client devices, i2c adapters and close xlink + channel. + +HDDL Server Sequence - Basic Setup and handshaking with HDDL Device Client +========================================================================== +:: + + ,-----. ,---------. ,------------. ,------------------. + |probe| |Init task| |connect task| |hddl device client| + `--+--' `----+----' `-----+------' `--------+---------' + ----. | | | + | "Init char dev"| | | + <---' | | | + | | | | + | ,----------------------!. | | + | |Initialize char device|_\ | | + | |for ioctls | | | + | `------------------------' | | + | "Creates kthread" | | | + |------------------->| | | + | | | | + | ,-----------------------!. | | + | |creates kernel thread |_\ | | + | |to check for new device | | | + | `-------------------------' | | + ,---------------------!. ----. | | + |check for new device |_\ | | | + |with time interval of | <---' | | + |5 seconds | | | | + `-----------------------' | | | + ,---------------------!. | | | + |if new device found?.|_\ | | | + |creates connect task | |-------------------->| | + |to setup new device | | | | + `-----------------------' | | | + | ,-------------------!. |----. | + | |setup xlink channel|_\| | | + | |to communicate with ||<---' | + | |client || | + | `---------------------'| | + | | | share time data | + | | | to client | + | | | --------------------------> + | | | | + | | | receives board id | + | | | <-------------------------- + | | | | + | | | Gets total number of | + | | | sensors available in SoC | + | | | <-------------------------- + | | | | + | ,-----------------------!. | | + | |For each sensors get |_\| | + | |sensor type, name, trip || <-------------------------- + | |temp, trip type || | + | `-------------------------'| | + | | | Send complete. | + | | | --------------------------> + | | | | + | | |----. | + | | | | Register xlink i2c | + | | |<---' adapters. | + | | | | + | | | | + | | | send slave addr for | + | | | each salve in SoC | + | | | --------------------------> + | | | | + | | |----. | + | | | | Register i2c clients.| + | | |<---' | + | | | | + | | |----. + | | | | poll for device status + | | |<---' + ,--+--. ,----+----. ,-----+------. ,--------+---------. + |probe| |Init task| |connect task| |hddl device client| + `-----' `---------' `------------' `------------------' + + +XLINK i2c sequence: +=================== +:: + + ,-----------------. ,--------. ,---------. ,-----. + |xlink-i2c-adapter| |I2C core| |i2c-slave| |xlink| + `--------+--------' `---+----' `----+----' `--+--' + | | | | + |---------------------->| | | + | | | | + | ,--------------------------!. | | + | |Initialize xlink based i2c|_\ | | + | |adapters. | | | + | `----------------------------' | | + | | | | + | | <------------------| | + | | | | + | | ,----------------------!. | + | | |Linux i2c slave device|_\ | + | | |standard request | | + | | `------------------------' | + | i2c request from | | | + | clients. | | | + |<----------------------| | | + | | | | + | | | | + |-------------------------------------------------------------->| + | | | | + | | ,----------------------------!. | + | | |I2C request is sent as xlink|_\ | + | | |packet to SoC | | + | | `------------------------------' | + | | | | + |<--------------------------------------------------------------| + | | | | + | | ,------------------------------!. | + | | |I2C response from SoC as xlink|_\ | + | | |packet | | + | | `--------------------------------' | + | | | | + |---------------------->| | | + | | | | + | ,---------------------------!. | | + | |xlink response is converted|_\ | | + | |to standard i2c response. | | | + | `-----------------------------' | | + | | i2c response | | + | | ------------------>| | + ,--------+--------. ,---+----. ,----+----. ,--+--. + |xlink-i2c-adapter| |I2C core| |i2c-slave| |xlink| + `-----------------' `--------' `---------' `-----'
Documentation/misc-devices/index.rst +1 -0
@@ -20,6 +20,7 @@ fit into other categories. eeprom c2port hddl_device_client.rst + hddl_device_server.rst ibmvmc ics932s401 isl29003
drivers/misc/hddl_device/Kconfig +12 -0
@@ -12,3 +12,15 @@ config HDDL_DEVICE_CLIENT the device connect/disconnect programming sequence. Say Y if using a processor that includes the Intel VPU such as Keem Bay. If unsure, say N. + +config HDDL_DEVICE_SERVER + tristate "Support for hddl device server" + depends on XLINK_CORE && !HDDL_DEVICE_CLIENT + help + This option enables HDDL device server module. + + This driver is used for sharing time sync data to local host and + retrives the sensors available on the platform. This also handles + the device connect/disconnect programming sequence. + Say Y if using a processor that includes the Intel VPU such as + Keem Bay. If unsure, say N.
drivers/misc/hddl_device/Makefile +2 -0
@@ -3,3 +3,5 @@ obj-$(CONFIG_HDDL_DEVICE_CLIENT) += hddl_device_client.o hddl_device_client-objs += hddl_device_lh.o hddl_device.o +obj-$(CONFIG_HDDL_DEVICE_SERVER) += hddl_device_server.o +hddl_device_server-objs += hddl_device_rh.o hddl_device.o
drivers/misc/hddl_device/hddl_device_rh.c new file +837 -0
837 lines not on this page · raw message
Signature · 1 line
2.17.1