Browse Source
Here is the "big" set of char/misc and other driver subsystem changes for 6.11-rc1. Nothing major in here, just loads of new drivers and updates. Included in here are: - IIO api updates and new drivers added - wait_interruptable_timeout() api cleanups for some drivers - MODULE_DESCRIPTION() additions for loads of drivers - parport out-of-bounds fix - interconnect driver updates and additions - mhi driver updates and additions - w1 driver fixes - binder speedups and fixes - eeprom driver updates - coresight driver updates - counter driver update - new misc driver additions - other minor api updates All of these, EXCEPT for the final Kconfig build fix for 32bit systems, have been in linux-next for a while with no reported issues. The Kconfig fixup went in 29 hours ago, so might have missed the latest linux-next, but was acked by everyone involved. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> -----BEGIN PGP SIGNATURE----- iG0EABECAC0WIQT0tgzFv3jCIUoxPcsxR9QN2y37KQUCZppR4w8cZ3JlZ0Brcm9h aC5jb20ACgkQMUfUDdst+ykwoQCeIaW3nbOiNTmOupvEnZwrN3yVNs8An3Q5L+Br 1LpTASaU6A8pN81Z1m5g =6U1z -----END PGP SIGNATURE----- Merge tag 'char-misc-6.11-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc Pull char / misc and other driver updates from Greg KH: "Here is the "big" set of char/misc and other driver subsystem changes for 6.11-rc1. Nothing major in here, just loads of new drivers and updates. Included in here are: - IIO api updates and new drivers added - wait_interruptable_timeout() api cleanups for some drivers - MODULE_DESCRIPTION() additions for loads of drivers - parport out-of-bounds fix - interconnect driver updates and additions - mhi driver updates and additions - w1 driver fixes - binder speedups and fixes - eeprom driver updates - coresight driver updates - counter driver update - new misc driver additions - other minor api updates All of these, EXCEPT for the final Kconfig build fix for 32bit systems, have been in linux-next for a while with no reported issues. The Kconfig fixup went in 29 hours ago, so might have missed the latest linux-next, but was acked by everyone involved" * tag 'char-misc-6.11-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc: (330 commits) misc: Kconfig: exclude mrvl-cn10k-dpi compilation for 32-bit systems misc: delete Makefile.rej binder: fix hang of unregistered readers misc: Kconfig: add a new dependency for MARVELL_CN10K_DPI virtio: add missing MODULE_DESCRIPTION() macro agp: uninorth: add missing MODULE_DESCRIPTION() macro spmi: add missing MODULE_DESCRIPTION() macros dev/parport: fix the array out-of-bounds risk samples: configfs: add missing MODULE_DESCRIPTION() macro misc: mrvl-cn10k-dpi: add Octeon CN10K DPI administrative driver misc: keba: Fix missing AUXILIARY_BUS dependency slimbus: Fix struct and documentation alignment in stream.c MAINTAINERS: CC dri-devel list on Qualcomm FastRPC patches misc: fastrpc: use coherent pool for untranslated Compute Banks misc: fastrpc: support complete DMA pool access to the DSP misc: fastrpc: add missing MODULE_DESCRIPTION() macro misc: fastrpc: Add missing dev_err newlines misc: fastrpc: Use memdup_user() nvmem: core: Implement force_ro sysfs attribute nvmem: Use sysfs_emit() for type attribute ...master
![torvalds@linux-foundation.org](/assets/img/avatar_default.png)
420 changed files with 15654 additions and 3115 deletions
@ -0,0 +1,25 @@
|
||||
What: /sys/devices/pciXXXX:XX/0000:XX:XX.X/0000:XX:XX.X/version |
||||
Date: June 2024 |
||||
KernelVersion: 6.11 |
||||
Contact: Gerhard Engleder <eg@keba.com> |
||||
Description: Version of the FPGA configuration bitstream as printable string. |
||||
This file is read only. |
||||
Users: KEBA |
||||
|
||||
What: /sys/devices/pciXXXX:XX/0000:XX:XX.X/0000:XX:XX.X/keep_cfg |
||||
Date: June 2024 |
||||
KernelVersion: 6.11 |
||||
Contact: Gerhard Engleder <eg@keba.com> |
||||
Description: Flag which signals if FPGA shall keep or reload configuration |
||||
bitstream on reset. Normal FPGA behavior and default is to keep |
||||
configuration bitstream and to only reset the configured logic. |
||||
|
||||
Reloading configuration on reset enables an update of the |
||||
configuration bitstream with a simple reboot. Otherwise it is |
||||
necessary to power cycle the device to reload the new |
||||
configuration bitstream. |
||||
|
||||
This file is read/write. The values are as follows: |
||||
1 = keep configuration bitstream on reset, default |
||||
0 = reload configuration bitstream on reset |
||||
Users: KEBA |
@ -0,0 +1,18 @@
|
||||
What: /sys/bus/iio/devices/iio:deviceX/in_accel_power_mode |
||||
KernelVersion: 6.11 |
||||
Contact: linux-iio@vger.kernel.org |
||||
Description: |
||||
Accelerometer power mode. Setting this attribute will set the |
||||
requested power mode to use if the ODR support it. If ODR |
||||
support only 1 mode, power mode will be enforced. |
||||
Reading this attribute will return the current accelerometer |
||||
power mode if the sensor is on, or the requested value if the |
||||
sensor is off. The value between real and requested value can |
||||
be different for ODR supporting only 1 mode. |
||||
|
||||
What: /sys/bus/iio/devices/iio:deviceX/in_accel_power_mode_available |
||||
KernelVersion: 6.11 |
||||
Contact: linux-iio@vger.kernel.org |
||||
Description: |
||||
List of available accelerometer power modes that can be set in |
||||
in_accel_power_mode attribute. |
@ -0,0 +1,148 @@
|
||||
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) |
||||
%YAML 1.2 |
||||
--- |
||||
$id: http://devicetree.org/schemas/iio/adc/adi,ad7380.yaml# |
||||
$schema: http://devicetree.org/meta-schemas/core.yaml# |
||||
|
||||
title: Analog Devices Simultaneous Sampling Analog to Digital Converters |
||||
|
||||
maintainers: |
||||
- Michael Hennerich <Michael.Hennerich@analog.com> |
||||
- Nuno Sá <nuno.sa@analog.com> |
||||
|
||||
description: | |
||||
* https://www.analog.com/en/products/ad7380.html |
||||
* https://www.analog.com/en/products/ad7381.html |
||||
* https://www.analog.com/en/products/ad7383.html |
||||
* https://www.analog.com/en/products/ad7384.html |
||||
* https://www.analog.com/en/products/ad7380-4.html |
||||
* https://www.analog.com/en/products/ad7381-4.html |
||||
* https://www.analog.com/en/products/ad7383-4.html |
||||
* https://www.analog.com/en/products/ad7384-4.html |
||||
|
||||
$ref: /schemas/spi/spi-peripheral-props.yaml# |
||||
|
||||
properties: |
||||
compatible: |
||||
enum: |
||||
- adi,ad7380 |
||||
- adi,ad7381 |
||||
- adi,ad7383 |
||||
- adi,ad7384 |
||||
- adi,ad7380-4 |
||||
- adi,ad7381-4 |
||||
- adi,ad7383-4 |
||||
- adi,ad7384-4 |
||||
|
||||
reg: |
||||
maxItems: 1 |
||||
|
||||
spi-max-frequency: |
||||
maximum: 80000000 |
||||
spi-cpol: true |
||||
spi-cpha: true |
||||
|
||||
vcc-supply: |
||||
description: A 3V to 3.6V supply that powers the chip. |
||||
|
||||
vlogic-supply: |
||||
description: |
||||
A 1.65V to 3.6V supply for the logic pins. |
||||
|
||||
refio-supply: |
||||
description: |
||||
A 2.5V to 3.3V supply for the external reference voltage. When omitted, |
||||
the internal 2.5V reference is used. |
||||
|
||||
aina-supply: |
||||
description: |
||||
The common mode voltage supply for the AINA- pin on pseudo-differential |
||||
chips. |
||||
|
||||
ainb-supply: |
||||
description: |
||||
The common mode voltage supply for the AINB- pin on pseudo-differential |
||||
chips. |
||||
|
||||
ainc-supply: |
||||
description: |
||||
The common mode voltage supply for the AINC- pin on pseudo-differential |
||||
chips. |
||||
|
||||
aind-supply: |
||||
description: |
||||
The common mode voltage supply for the AIND- pin on pseudo-differential |
||||
chips. |
||||
|
||||
interrupts: |
||||
description: |
||||
When the device is using 1-wire mode, this property is used to optionally |
||||
specify the ALERT interrupt. |
||||
maxItems: 1 |
||||
|
||||
required: |
||||
- compatible |
||||
- reg |
||||
- vcc-supply |
||||
- vlogic-supply |
||||
|
||||
unevaluatedProperties: false |
||||
|
||||
allOf: |
||||
# pseudo-differential chips require common mode voltage supplies, |
||||
# true differential chips don't use them |
||||
- if: |
||||
properties: |
||||
compatible: |
||||
enum: |
||||
- adi,ad7383 |
||||
- adi,ad7384 |
||||
- adi,ad7383-4 |
||||
- adi,ad7384-4 |
||||
then: |
||||
required: |
||||
- aina-supply |
||||
- ainb-supply |
||||
else: |
||||
properties: |
||||
aina-supply: false |
||||
ainb-supply: false |
||||
- if: |
||||
properties: |
||||
compatible: |
||||
enum: |
||||
- adi,ad7383-4 |
||||
- adi,ad7384-4 |
||||
then: |
||||
required: |
||||
- ainc-supply |
||||
- aind-supply |
||||
else: |
||||
properties: |
||||
ainc-supply: false |
||||
aind-supply: false |
||||
|
||||
examples: |
||||
- | |
||||
#include <dt-bindings/interrupt-controller/irq.h> |
||||
|
||||
spi { |
||||
#address-cells = <1>; |
||||
#size-cells = <0>; |
||||
|
||||
adc@0 { |
||||
compatible = "adi,ad7380"; |
||||
reg = <0>; |
||||
|
||||
spi-cpol; |
||||
spi-cpha; |
||||
spi-max-frequency = <80000000>; |
||||
|
||||
interrupts = <27 IRQ_TYPE_EDGE_FALLING>; |
||||
interrupt-parent = <&gpio0>; |
||||
|
||||
vcc-supply = <&supply_3_3V>; |
||||
vlogic-supply = <&supply_3_3V>; |
||||
refio-supply = <&supply_2_5V>; |
||||
}; |
||||
}; |
@ -0,0 +1,33 @@
|
||||
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) |
||||
%YAML 1.2 |
||||
--- |
||||
$id: http://devicetree.org/schemas/iio/adc/mediatek,mt6359-auxadc.yaml# |
||||
$schema: http://devicetree.org/meta-schemas/core.yaml# |
||||
|
||||
title: MediaTek MT6350 series PMIC AUXADC |
||||
|
||||
maintainers: |
||||
- AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> |
||||
|
||||
description: |
||||
The Auxiliary Analog/Digital Converter (AUXADC) is an ADC found |
||||
in some MediaTek PMICs, performing various PMIC related measurements |
||||
such as battery and PMIC internal voltage regulators temperatures, |
||||
accessory detection resistance (usually, for a 3.5mm audio jack) |
||||
other than voltages for various PMIC internal components. |
||||
|
||||
properties: |
||||
compatible: |
||||
enum: |
||||
- mediatek,mt6357-auxadc |
||||
- mediatek,mt6358-auxadc |
||||
- mediatek,mt6359-auxadc |
||||
|
||||
"#io-channel-cells": |
||||
const: 1 |
||||
|
||||
required: |
||||
- compatible |
||||
- "#io-channel-cells" |
||||
|
||||
additionalProperties: false |
@ -0,0 +1,155 @@
|
||||
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) |
||||
%YAML 1.2 |
||||
--- |
||||
$id: http://devicetree.org/schemas/iio/adc/ti,ads1119.yaml# |
||||
$schema: http://devicetree.org/meta-schemas/core.yaml# |
||||
|
||||
title: Texas Instruments ADS1119 ADC |
||||
|
||||
maintainers: |
||||
- João Paulo Gonçalves <jpaulo.silvagoncalves@gmail.com> |
||||
|
||||
description: |
||||
The TI ADS1119 is a precision 16-bit ADC over I2C that offers single-ended and |
||||
differential measurements using a multiplexed input. It features a programmable |
||||
gain, a programmable sample rate, an internal oscillator and voltage reference, |
||||
and a 50/60Hz rejection filter. |
||||
|
||||
properties: |
||||
compatible: |
||||
const: ti,ads1119 |
||||
|
||||
reg: |
||||
maxItems: 1 |
||||
|
||||
interrupts: |
||||
maxItems: 1 |
||||
|
||||
reset-gpios: |
||||
maxItems: 1 |
||||
|
||||
avdd-supply: true |
||||
dvdd-supply: true |
||||
|
||||
vref-supply: |
||||
description: |
||||
ADC external reference voltage (VREF). |
||||
|
||||
"#address-cells": |
||||
const: 1 |
||||
|
||||
"#size-cells": |
||||
const: 0 |
||||
|
||||
"#io-channel-cells": |
||||
const: 1 |
||||
|
||||
required: |
||||
- compatible |
||||
- reg |
||||
- "#address-cells" |
||||
- "#size-cells" |
||||
- avdd-supply |
||||
- dvdd-supply |
||||
|
||||
patternProperties: |
||||
"^channel@([0-6])$": |
||||
$ref: adc.yaml |
||||
type: object |
||||
properties: |
||||
reg: |
||||
minimum: 0 |
||||
maximum: 6 |
||||
|
||||
diff-channels: |
||||
description: |
||||
Differential input channels AIN0-AIN1, AIN2-AIN3 and AIN1-AIN2. |
||||
oneOf: |
||||
- items: |
||||
- const: 0 |
||||
- const: 1 |
||||
- items: |
||||
- const: 2 |
||||
- const: 3 |
||||
- items: |
||||
- const: 1 |
||||
- const: 2 |
||||
|
||||
single-channel: |
||||
description: |
||||
Single-ended input channels AIN0, AIN1, AIN2 and AIN3. |
||||
minimum: 0 |
||||
maximum: 3 |
||||
|
||||
oneOf: |
||||
- required: |
||||
- diff-channels |
||||
- required: |
||||
- single-channel |
||||
|
||||
required: |
||||
- reg |
||||
|
||||
unevaluatedProperties: false |
||||
|
||||
additionalProperties: false |
||||
|
||||
examples: |
||||
- | |
||||
|
||||
#include <dt-bindings/gpio/gpio.h> |
||||
#include <dt-bindings/interrupt-controller/irq.h> |
||||
|
||||
i2c { |
||||
#address-cells = <1>; |
||||
#size-cells = <0>; |
||||
|
||||
adc@40 { |
||||
compatible = "ti,ads1119"; |
||||
reg = <0x40>; |
||||
interrupt-parent = <&gpio1>; |
||||
interrupts = <25 IRQ_TYPE_EDGE_FALLING>; |
||||
reset-gpios = <&gpio1 10 GPIO_ACTIVE_LOW>; |
||||
avdd-supply = <®_avdd_ads1119>; |
||||
dvdd-supply = <®_dvdd_ads1119>; |
||||
vref-supply = <®_vref_ads1119>; |
||||
#address-cells = <1>; |
||||
#size-cells = <0>; |
||||
#io-channel-cells = <1>; |
||||
|
||||
channel@0 { |
||||
reg = <0>; |
||||
single-channel = <0>; |
||||
}; |
||||
|
||||
channel@1 { |
||||
reg = <1>; |
||||
diff-channels = <0 1>; |
||||
}; |
||||
|
||||
channel@2 { |
||||
reg = <2>; |
||||
single-channel = <3>; |
||||
}; |
||||
|
||||
channel@3 { |
||||
reg = <3>; |
||||
single-channel = <1>; |
||||
}; |
||||
|
||||
channel@4 { |
||||
reg = <4>; |
||||
single-channel = <2>; |
||||
}; |
||||
|
||||
channel@5 { |
||||
reg = <5>; |
||||
diff-channels = <1 2>; |
||||
}; |
||||
|
||||
channel@6 { |
||||
reg = <6>; |
||||
diff-channels = <2 3>; |
||||
}; |
||||
}; |
||||
}; |
@ -0,0 +1,70 @@
|
||||
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) |
||||
%YAML 1.2 |
||||
--- |
||||
$id: http://devicetree.org/schemas/iio/chemical/sciosense,ens160.yaml# |
||||
$schema: http://devicetree.org/meta-schemas/core.yaml# |
||||
|
||||
title: ScioSense ENS160 multi-gas sensor |
||||
|
||||
maintainers: |
||||
- Gustavo Silva <gustavograzs@gmail.com> |
||||
|
||||
description: | |
||||
Digital Multi-Gas Sensor for Monitoring Indoor Air Quality. |
||||
|
||||
Datasheet: |
||||
https://www.sciosense.com/wp-content/uploads/2023/12/ENS160-Datasheet.pdf |
||||
|
||||
properties: |
||||
compatible: |
||||
enum: |
||||
- sciosense,ens160 |
||||
|
||||
reg: |
||||
maxItems: 1 |
||||
|
||||
interrupts: |
||||
maxItems: 1 |
||||
|
||||
vdd-supply: true |
||||
vddio-supply: true |
||||
|
||||
required: |
||||
- compatible |
||||
- reg |
||||
|
||||
allOf: |
||||
- $ref: /schemas/spi/spi-peripheral-props.yaml# |
||||
|
||||
unevaluatedProperties: false |
||||
|
||||
examples: |
||||
- | |
||||
#include <dt-bindings/interrupt-controller/irq.h> |
||||
i2c { |
||||
#address-cells = <1>; |
||||
#size-cells = <0>; |
||||
|
||||
gas-sensor@52 { |
||||
compatible = "sciosense,ens160"; |
||||
reg = <0x52>; |
||||
interrupt-parent = <&gpio0>; |
||||
interrupts = <19 IRQ_TYPE_EDGE_FALLING>; |
||||
}; |
||||
}; |
||||
- | |
||||
#include <dt-bindings/interrupt-controller/irq.h> |
||||
spi { |
||||
#address-cells = <1>; |
||||
#size-cells = <0>; |
||||
|
||||
gas-sensor@0 { |
||||
compatible = "sciosense,ens160"; |
||||
reg = <0>; |
||||
spi-max-frequency = <10000000>; |
||||
interrupt-parent = <&gpio>; |
||||
interrupts = <19 IRQ_TYPE_EDGE_FALLING>; |
||||
}; |
||||
}; |
||||
|
||||
... |
@ -0,0 +1,51 @@
|
||||
# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause |
||||
%YAML 1.2 |
||||
--- |
||||
$id: http://devicetree.org/schemas/interconnect/mediatek,mt8183-emi.yaml# |
||||
$schema: http://devicetree.org/meta-schemas/core.yaml# |
||||
|
||||
title: MediaTek External Memory Interface (EMI) Interconnect |
||||
|
||||
maintainers: |
||||
- AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> |
||||
|
||||
description: | |
||||
EMI interconnect providers support system bandwidth requirements through |
||||
Dynamic Voltage Frequency Scaling Resource Collector (DVFSRC) hardware. |
||||
The provider is able to communicate with the DVFSRC through Secure Monitor |
||||
Call (SMC). |
||||
|
||||
ICC provider ICC Nodes |
||||
---- ---- |
||||
_________ |CPU | |--- |VPU | |
||||
_____ | |----- ---- | ---- |
||||
| |->| DRAM | ---- | ---- |
||||
|DRAM |->|scheduler|----- |GPU | |--- |DISP| |
||||
| |->| (EMI) | ---- | ---- |
||||
|_____|->|_________|---. ----- | ---- |
||||
/|\ `-|MMSYS|--|--- |VDEC| |
||||
| ----- | ---- |
||||
| | ---- |
||||
| change DRAM freq |--- |VENC| |
||||
-------- | ---- |
||||
SMC --> | DVFSRC | | ---- |
||||
-------- |--- |IMG | |
||||
| ---- |
||||
| ---- |
||||
|--- |CAM | |
||||
---- |
||||
|
||||
properties: |
||||
compatible: |
||||
enum: |
||||
- mediatek,mt8183-emi |
||||
- mediatek,mt8195-emi |
||||
|
||||
'#interconnect-cells': |
||||
const: 1 |
||||
|
||||
required: |
||||
- compatible |
||||
- '#interconnect-cells' |
||||
|
||||
unevaluatedProperties: false |
@ -0,0 +1,101 @@
|
||||
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) |
||||
%YAML 1.2 |
||||
--- |
||||
$id: http://devicetree.org/schemas/interconnect/qcom,msm8953.yaml# |
||||
$schema: http://devicetree.org/meta-schemas/core.yaml# |
||||
|
||||
title: Qualcomm MSM8953 Network-On-Chip interconnect |
||||
|
||||
maintainers: |
||||
- Barnabas Czeman <barnabas.czeman@mainlining.org> |
||||
|
||||
description: | |
||||
The Qualcomm MSM8953 interconnect providers support adjusting the |
||||
bandwidth requirements between the various NoC fabrics. |
||||
|
||||
See also: |
||||
- dt-bindings/interconnect/qcom,msm8953.h |
||||
|
||||
properties: |
||||
compatible: |
||||
enum: |
||||
- qcom,msm8953-bimc |
||||
- qcom,msm8953-pcnoc |
||||
- qcom,msm8953-snoc |
||||
|
||||
reg: |
||||
maxItems: 1 |
||||
|
||||
clocks: |
||||
maxItems: 1 |
||||
|
||||
clock-names: |
||||
maxItems: 1 |
||||
|
||||
'#interconnect-cells': |
||||
const: 2 |
||||
|
||||
patternProperties: |
||||
'^interconnect-[a-z0-9\-]+$': |
||||
type: object |
||||
$ref: qcom,rpm-common.yaml# |
||||
unevaluatedProperties: false |
||||
description: |
||||
The interconnect providers do not have a separate QoS register space, |
||||
but share parent's space. |
||||
|
||||
properties: |
||||
compatible: |
||||
const: qcom,msm8953-snoc-mm |
||||
|
||||
required: |
||||
- compatible |
||||
- '#interconnect-cells' |
||||
|
||||
required: |
||||
- compatible |
||||
- reg |
||||
- '#interconnect-cells' |
||||
|
||||
allOf: |
||||
- $ref: qcom,rpm-common.yaml# |
||||
- if: |
||||
properties: |
||||
compatible: |
||||
const: qcom,msm8953-pcnoc |
||||
|
||||
then: |
||||
properties: |
||||
clocks: |
||||
items: |
||||
- description: PCNOC USB3 AXI Clock. |
||||
|
||||
clock-names: |
||||
const: pcnoc_usb3_axi |
||||
|
||||
required: |
||||
- clocks |
||||
- clock-names |
||||
else: |
||||
properties: |
||||
clocks: false |
||||
clock-names: false |
||||
|
||||
additionalProperties: false |
||||
|
||||
examples: |
||||
- | |
||||
#include <dt-bindings/clock/qcom,gcc-msm8953.h> |
||||
|
||||
snoc: interconnect@580000 { |
||||
compatible = "qcom,msm8953-snoc"; |
||||
reg = <0x580000 0x16080>; |
||||
|
||||
#interconnect-cells = <2>; |
||||
|
||||
snoc_mm: interconnect-snoc { |
||||
compatible = "qcom,msm8953-snoc-mm"; |
||||
|
||||
#interconnect-cells = <2>; |
||||
}; |
||||
}; |
@ -0,0 +1,443 @@
|
||||
.. SPDX-License-Identifier: GPL-2.0 |
||||
|
||||
================ |
||||
ADIS16480 driver |
||||
================ |
||||
|
||||
This driver supports Analog Device's IMUs on SPI bus. |
||||
|
||||
1. Supported devices |
||||
==================== |
||||
|
||||
* `ADIS16375 <https://www.analog.com/ADIS16375>`_ |
||||
* `ADIS16480 <https://www.analog.com/ADIS16480>`_ |
||||
* `ADIS16485 <https://www.analog.com/ADIS16485>`_ |
||||
* `ADIS16488 <https://www.analog.com/ADIS16488>`_ |
||||
* `ADIS16490 <https://www.analog.com/ADIS16490>`_ |
||||
* `ADIS16495 <https://www.analog.com/ADIS16495>`_ |
||||
* `ADIS16497 <https://www.analog.com/ADIS16497>`_ |
||||
* `ADIS16545 <https://www.analog.com/ADIS16545>`_ |
||||
* `ADIS16547 <https://www.analog.com/ADIS16547>`_ |
||||
|
||||
Each supported device is a complete inertial system that includes a triaxial |
||||
gyroscope and a triaxial accelerometer. Each inertial sensor in device combines |
||||
with signal conditioning that optimizes dynamic performance. The factory |
||||
calibration characterizes each sensor for sensitivity, bias, and alignment. As |
||||
a result, each sensor has its own dynamic compensation formulas that provide |
||||
accurate sensor measurements. |
||||
|
||||
2. Device attributes |
||||
==================== |
||||
|
||||
Accelerometer, gyroscope measurements are always provided. Furthermore, the |
||||
driver offers the capability to retrieve the delta angle and the delta velocity |
||||
measurements computed by the device. |
||||
|
||||
The delta angle measurements represent a calculation of angular displacement |
||||
between each sample update, while the delta velocity measurements represent a |
||||
calculation of linear velocity change between each sample update. |
||||
|
||||
Finally, temperature data are provided which show a coarse measurement of |
||||
the temperature inside of the IMU device. This data is most useful for |
||||
monitoring relative changes in the thermal environment. |
||||
|
||||
ADIS16480 and ADIS16488 also provide access to barometric pressure data and |
||||
triaxial magnetometer measurements. |
||||
|
||||
Each IIO device, has a device folder under ``/sys/bus/iio/devices/iio:deviceX``, |
||||
where X is the IIO index of the device. Under these folders reside a set of |
||||
device files, depending on the characteristics and features of the hardware |
||||
device in questions. These files are consistently generalized and documented in |
||||
the IIO ABI documentation. |
||||
|
||||
The following tables show the adis16480 related device files, found in the |
||||
specific device folder path ``/sys/bus/iio/devices/iio:deviceX``. |
||||
|
||||
**Available only for ADIS16480 and ADIS16488:** |
||||
|
||||
+------------------------------------------+---------------------------------------------------------+ |
||||
| 3-Axis Magnetometer related device files | Description | |
||||
+------------------------------------------+---------------------------------------------------------+ |
||||
| in_magn_scale | Scale for the magnetometer channels. | |
||||
+------------------------------------------+---------------------------------------------------------+ |
||||
| in_magn_x_calibbias | Calibration offset for the X-axis magnetometer channel. | |
||||
+------------------------------------------+---------------------------------------------------------+ |
||||
| in_magn_x_filter_low_pass_3db_frequency | Bandwidth for the X-axis magnetometer channel. | |
||||
+------------------------------------------+---------------------------------------------------------+ |
||||
| in_magn_x_raw | Raw X-axis magnetometer channel value. | |
||||
+------------------------------------------+---------------------------------------------------------+ |
||||
| in_magn_y_calibbias | Calibration offset for the Y-axis magnetometer channel. | |
||||
+------------------------------------------+---------------------------------------------------------+ |
||||
| in_magn_y_filter_low_pass_3db_frequency | Bandwidth for the Y-axis magnetometer channel. | |
||||
+------------------------------------------+---------------------------------------------------------+ |
||||
| in_magn_y_raw | Raw Y-axis magnetometer channel value. | |
||||
+------------------------------------------+---------------------------------------------------------+ |
||||
| in_magn_z_calibbias | Calibration offset for the Z-axis magnetometer channel. | |
||||
+------------------------------------------+---------------------------------------------------------+ |
||||
| in_magn_z_filter_low_pass_3db_frequency | Bandwidth for the Z-axis magnetometer channel. | |
||||
+------------------------------------------+---------------------------------------------------------+ |
||||
| in_magn_z_raw | Raw Z-axis magnetometer channel value. | |
||||
+------------------------------------------+---------------------------------------------------------+ |
||||
|
||||
+------------------------------------------+-----------------------------------------------------+ |
||||
| Barometric pressure sensor related files | Description | |
||||
+------------------------------------------+-----------------------------------------------------+ |
||||
| in_pressure0_calibbias | Calibration offset for barometric pressure channel. | |
||||
+------------------------------------------+-----------------------------------------------------+ |
||||
| in_pressure0_raw | Raw barometric pressure channel value. | |
||||
+------------------------------------------+-----------------------------------------------------+ |
||||
| in_pressure0_scale | Scale for the barometric pressure sensor channel. | |
||||
+------------------------------------------+-----------------------------------------------------+ |
||||
|
||||
**Available for all supported devices:** |
||||
|
||||
+-------------------------------------------+----------------------------------------------------------+ |
||||
| 3-Axis Accelerometer related device files | Description | |
||||
+-------------------------------------------+----------------------------------------------------------+ |
||||
| in_accel_scale | Scale for the accelerometer channels. | |
||||
+-------------------------------------------+----------------------------------------------------------+ |
||||
| in_accel_x_calibbias | Calibration offset for the X-axis accelerometer channel. | |
||||
+-------------------------------------------+----------------------------------------------------------+ |
||||
| in_accel_x_calibscale | Calibration scale for the X-axis accelerometer channel. | |
||||
+-------------------------------------------+----------------------------------------------------------+ |
||||
| in_accel_x_filter_low_pass_3db_frequency | Bandwidth for the X-axis accelerometer channel. | |
||||
+-------------------------------------------+----------------------------------------------------------+ |
||||
| in_accel_x_raw | Raw X-axis accelerometer channel value. | |
||||
+-------------------------------------------+----------------------------------------------------------+ |
||||
| in_accel_y_calibbias | Calibration offset for the Y-axis accelerometer channel. | |
||||
+-------------------------------------------+----------------------------------------------------------+ |
||||
| in_accel_y_calibscale | Calibration scale for the Y-axis accelerometer channel. | |
||||
+-------------------------------------------+----------------------------------------------------------+ |
||||
| in_accel_y_filter_low_pass_3db_frequency | Bandwidth for the Y-axis accelerometer channel. | |
||||
+-------------------------------------------+----------------------------------------------------------+ |
||||
| in_accel_y_raw | Raw Y-axis accelerometer channel value. | |
||||
+-------------------------------------------+----------------------------------------------------------+ |
||||
| in_accel_z_calibbias | Calibration offset for the Z-axis accelerometer channel. | |
||||
+-------------------------------------------+----------------------------------------------------------+ |
||||
| in_accel_z_calibscale | Calibration scale for the Z-axis accelerometer channel. | |
||||
+-------------------------------------------+----------------------------------------------------------+ |
||||
| in_accel_z_filter_low_pass_3db_frequency | Bandwidth for the Z-axis accelerometer channel. | |
||||
+-------------------------------------------+----------------------------------------------------------+ |
||||
| in_accel_z_raw | Raw Z-axis accelerometer channel value. | |
||||
+-------------------------------------------+----------------------------------------------------------+ |
||||
| in_deltavelocity_scale | Scale for delta velocity channels. | |
||||
+-------------------------------------------+----------------------------------------------------------+ |
||||
| in_deltavelocity_x_raw | Raw X-axis delta velocity channel value. | |
||||
+-------------------------------------------+----------------------------------------------------------+ |
||||
| in_deltavelocity_y_raw | Raw Y-axis delta velocity channel value. | |
||||
+-------------------------------------------+----------------------------------------------------------+ |
||||
| in_deltavelocity_z_raw | Raw Z-axis delta velocity channel value. | |
||||
+-------------------------------------------+----------------------------------------------------------+ |
||||
|
||||
+--------------------------------------------+------------------------------------------------------+ |
||||
| 3-Axis Gyroscope related device files | Description | |
||||
+--------------------------------------------+------------------------------------------------------+ |
||||
| in_anglvel_scale | Scale for the gyroscope channels. | |
||||
+--------------------------------------------+------------------------------------------------------+ |
||||
| in_anglvel_x_calibbias | Calibration offset for the X-axis gyroscope channel. | |
||||
+--------------------------------------------+------------------------------------------------------+ |
||||
| in_anglvel_x_calibscale | Calibration scale for the X-axis gyroscope channel. | |
||||
+--------------------------------------------+------------------------------------------------------+ |
||||
| in_anglvel_x_filter_low_pass_3db_frequency | Bandwidth for the X-axis gyroscope channel. | |
||||
+--------------------------------------------+------------------------------------------------------+ |
||||
| in_anglvel_x_raw | Raw X-axis gyroscope channel value. | |
||||
+--------------------------------------------+------------------------------------------------------+ |
||||
| in_anglvel_y_calibbias | Calibration offset for the Y-axis gyroscope channel. | |
||||
+--------------------------------------------+------------------------------------------------------+ |
||||
| in_anglvel_y_calibscale | Calibration scale for the Y-axis gyroscope channel. | |
||||
+--------------------------------------------+------------------------------------------------------+ |
||||
| in_anglvel_y_filter_low_pass_3db_frequency | Bandwidth for the Y-axis gyroscope channel. | |
||||
+--------------------------------------------+------------------------------------------------------+ |
||||
| in_anglvel_y_raw | Raw Y-axis gyroscope channel value. | |
||||
+--------------------------------------------+------------------------------------------------------+ |
||||
| in_anglvel_z_calibbias | Calibration offset for the Z-axis gyroscope channel. | |
||||
+--------------------------------------------+------------------------------------------------------+ |
||||
| in_anglvel_z_calibscale | Calibration scale for the Z-axis gyroscope channel. | |
||||
+--------------------------------------------+------------------------------------------------------+ |
||||
| in_anglvel_z_filter_low_pass_3db_frequency | Bandwidth for the Z-axis gyroscope channel. | |
||||
+--------------------------------------------+------------------------------------------------------+ |
||||
| in_anglvel_z_raw | Raw Z-axis gyroscope channel value. | |
||||
+--------------------------------------------+------------------------------------------------------+ |
||||
| in_deltaangl_scale | Scale for delta angle channels. | |
||||
+--------------------------------------------+------------------------------------------------------+ |
||||
| in_deltaangl_x_raw | Raw X-axis delta angle channel value. | |
||||
+--------------------------------------------+------------------------------------------------------+ |
||||
| in_deltaangl_y_raw | Raw Y-axis delta angle channel value. | |
||||
+--------------------------------------------+------------------------------------------------------+ |
||||
| in_deltaangl_z_raw | Raw Z-axis delta angle channel value. | |
||||
+--------------------------------------------+------------------------------------------------------+ |
||||
|
||||
+----------------------------------+-------------------------------------------+ |
||||
| Temperature sensor related files | Description | |
||||
+----------------------------------+-------------------------------------------+ |
||||
| in_temp0_raw | Raw temperature channel value. | |
||||
+----------------------------------+-------------------------------------------+ |
||||
| in_temp0_offset | Offset for the temperature sensor channel.| |
||||
+----------------------------------+-------------------------------------------+ |
||||
| in_temp0_scale | Scale for the temperature sensor channel. | |
||||
+----------------------------------+-------------------------------------------+ |
||||
|
||||
+-------------------------------+---------------------------------------------------------+ |
||||
| Miscellaneous device files | Description | |
||||
+-------------------------------+---------------------------------------------------------+ |
||||
| name | Name of the IIO device. | |
||||
+-------------------------------+---------------------------------------------------------+ |
||||
| sampling_frequency | Currently selected sample rate. | |
||||
+-------------------------------+---------------------------------------------------------+ |
||||
|
||||
The following table shows the adis16480 related device debug files, found in the |
||||
specific device debug folder path ``/sys/kernel/debug/iio/iio:deviceX``. |
||||
|
||||
+----------------------+-------------------------------------------------------------------------+ |
||||
| Debugfs device files | Description | |
||||
+----------------------+-------------------------------------------------------------------------+ |
||||
| serial_number | The serial number of the chip in hexadecimal format. | |
||||
+----------------------+-------------------------------------------------------------------------+ |
||||
| product_id | Chip specific product id (e.g. 16480, 16488, 16545, etc.). | |
||||
+----------------------+-------------------------------------------------------------------------+ |
||||
| flash_count | The number of flash writes performed on the device. | |
||||
+----------------------+-------------------------------------------------------------------------+ |
||||
| firmware_revision | String containing the firmware revision in the following format ##.##. | |
||||
+----------------------+-------------------------------------------------------------------------+ |
||||
| firmware_date | String containing the firmware date in the following format mm-dd-yyyy. | |
||||
+----------------------+-------------------------------------------------------------------------+ |
||||
|
||||
Channels processed values |
||||
------------------------- |
||||
|
||||
A channel value can be read from its _raw attribute. The value returned is the |
||||
raw value as reported by the devices. To get the processed value of the channel, |
||||
apply the following formula: |
||||
|
||||
.. code-block:: bash |
||||
|
||||
processed value = (_raw + _offset) * _scale |
||||
|
||||
Where _offset and _scale are device attributes. If no _offset attribute is |
||||
present, simply assume its value is 0. |
||||
|
||||
The adis16480 driver offers data for 7 types of channels, the table below shows |
||||
the measurement units for the processed value, which are defined by the IIO |
||||
framework: |
||||
|
||||
+--------------------------------------+---------------------------+ |
||||
| Channel type | Measurement unit | |
||||
+--------------------------------------+---------------------------+ |
||||
| Acceleration on X, Y, and Z axis | Meters per Second squared | |
||||
+--------------------------------------+---------------------------+ |
||||
| Angular velocity on X, Y and Z axis | Radians per second | |
||||
+--------------------------------------+---------------------------+ |
||||
| Delta velocity on X. Y, and Z axis | Meters per Second | |
||||
+--------------------------------------+---------------------------+ |
||||
| Delta angle on X, Y, and Z axis | Radians | |
||||
+--------------------------------------+---------------------------+ |
||||
| Temperature | Millidegrees Celsius | |
||||
+--------------------------------------+---------------------------+ |
||||
| Magnetic field along X, Y and Z axis | Gauss | |
||||
+--------------------------------------+---------------------------+ |
||||
| Barometric pressure | kilo Pascal | |
||||
+--------------------------------------+---------------------------+ |
||||
|
||||
Usage examples |
||||
-------------- |
||||
|
||||
Show device name: |
||||
|
||||
.. code-block:: bash |
||||
|
||||
root:/sys/bus/iio/devices/iio:device0> cat name |
||||
adis16545-1 |
||||
|
||||
Show accelerometer channels value: |
||||
|
||||
.. code-block:: bash |
||||
|
||||
root:/sys/bus/iio/devices/iio:device0> cat in_accel_x_raw |
||||
1376728 |
||||
root:/sys/bus/iio/devices/iio:device0> cat in_accel_y_raw |
||||
4487621 |
||||
root:/sys/bus/iio/devices/iio:device0> cat in_accel_z_raw |
||||
262773792 |
||||
root:/sys/bus/iio/devices/iio:device0> cat in_accel_scale |
||||
0.000000037 |
||||
|
||||
- X-axis acceleration = in_accel_x_raw * in_accel_scale = 0.050938936 m/s^2 |
||||
- Y-axis acceleration = in_accel_y_raw * in_accel_scale = 0.166041977 m/s^2 |
||||
- Z-axis acceleration = in_accel_z_raw * in_accel_scale = 9.722630304 m/s^2 |
||||
|
||||
Show gyroscope channels value: |
||||
|
||||
.. code-block:: bash |
||||
|
||||
root:/sys/bus/iio/devices/iio:device0> cat in_anglvel_x_raw |
||||
-1041702 |
||||
root:/sys/bus/iio/devices/iio:device0> cat in_anglvel_y_raw |
||||
-273013 |
||||
root:/sys/bus/iio/devices/iio:device0> cat in_anglvel_z_raw |
||||
2745116 |
||||
root:/sys/bus/iio/devices/iio:device0> cat in_anglvel_scale |
||||
0.000000001 |
||||
|
||||
- X-axis angular velocity = in_anglvel_x_raw * in_anglvel_scale = −0.001041702 rad/s |
||||
- Y-axis angular velocity = in_anglvel_y_raw * in_anglvel_scale = −0.000273013 rad/s |
||||
- Z-axis angular velocity = in_anglvel_z_raw * in_anglvel_scale = 0.002745116 rad/s |
||||
|
||||
Set calibration offset for accelerometer channels: |
||||
|
||||
.. code-block:: bash |
||||
|
||||
root:/sys/bus/iio/devices/iio:device0> cat in_accel_x_calibbias |
||||
0 |
||||
|
||||
root:/sys/bus/iio/devices/iio:device0> echo 5000 > in_accel_x_calibbias |
||||
root:/sys/bus/iio/devices/iio:device0> cat in_accel_x_calibbias |
||||
5000 |
||||
|
||||
Set calibration offset for gyroscope channels: |
||||
|
||||
.. code-block:: bash |
||||
|
||||
root:/sys/bus/iio/devices/iio:device0> cat in_anglvel_y_calibbias |
||||
0 |
||||
|
||||
root:/sys/bus/iio/devices/iio:device0> echo -5000 > in_anglvel_y_calibbias |
||||
root:/sys/bus/iio/devices/iio:device0> cat in_anglvel_y_calibbias |
||||
-5000 |
||||
|
||||
Set sampling frequency: |
||||
|
||||
.. code-block:: bash |
||||
|
||||
root:/sys/bus/iio/devices/iio:device0> cat sampling_frequency |
||||
4250.000000 |
||||
|
||||
root:/sys/bus/iio/devices/iio:device0> echo 1000 > sampling_frequency |
||||
1062.500000 |
||||
|
||||
Set bandwidth for accelerometer channels: |
||||
|
||||
.. code-block:: bash |
||||
|
||||
root:/sys/bus/iio/devices/iio:device0> cat in_accel_x_filter_low_pass_3db_frequency |
||||
0 |
||||
|
||||
root:/sys/bus/iio/devices/iio:device0> echo 300 > in_accel_x_filter_low_pass_3db_frequency |
||||
root:/sys/bus/iio/devices/iio:device0> cat in_accel_x_filter_low_pass_3db_frequency |
||||
300 |
||||
|
||||
Show serial number: |
||||
|
||||
.. code-block:: bash |
||||
|
||||
root:/sys/kernel/debug/iio/iio:device0> cat serial_number |
||||
0x000c |
||||
|
||||
Show product id: |
||||
|
||||
.. code-block:: bash |
||||
|
||||
root:/sys/kernel/debug/iio/iio:device0> cat product_id |
||||
16545 |
||||
|
||||
Show flash count: |
||||
|
||||
.. code-block:: bash |
||||
|
||||
root:/sys/kernel/debug/iio/iio:device0> cat flash_count |
||||
88 |
||||
|
||||
Show firmware revision: |
||||
|
||||
.. code-block:: bash |
||||
|
||||
root:/sys/kernel/debug/iio/iio:device0> cat firmware_revision |
||||
1.4 |
||||
|
||||
Show firmware date: |
||||
|
||||
.. code-block:: bash |
||||
|
||||
root:/sys/kernel/debug/iio/iio:device0> cat firmware_date |
||||
09-23-2023 |
||||
|
||||
3. Device buffers |
||||
================= |
||||
|
||||
This driver supports IIO buffers. |
||||
|
||||
All devices support retrieving the raw acceleration, gyroscope and temperature |
||||
measurements using buffers. |
||||
|
||||
The following device families also support retrieving the delta velocity, delta |
||||
angle and temperature measurements using buffers: |
||||
|
||||
- ADIS16545 |
||||
- ADIS16547 |
||||
|
||||
However, when retrieving acceleration or gyroscope data using buffers, delta |
||||
readings will not be available and vice versa. This is because the device only |
||||
allows to read either acceleration and gyroscope data or delta velocity and |
||||
delta angle data at a time and switching between these two burst data selection |
||||
modes is time consuming. |
||||
|
||||
Usage examples |
||||
-------------- |
||||
|
||||
Set device trigger in current_trigger, if not already set: |
||||
|
||||
.. code-block:: bash |
||||
|
||||
root:/sys/bus/iio/devices/iio:device0> cat trigger/current_trigger |
||||
|
||||
root:/sys/bus/iio/devices/iio:device0> echo adis16545-1-dev0 > trigger/current_trigger |
||||
root:/sys/bus/iio/devices/iio:device0> cat trigger/current_trigger |
||||
adis16545-1-dev0 |
||||
|
||||
Select channels for buffer read: |
||||
|
||||
.. code-block:: bash |
||||
|
||||
root:/sys/bus/iio/devices/iio:device0> echo 1 > scan_elements/in_deltavelocity_x_en |
||||
root:/sys/bus/iio/devices/iio:device0> echo 1 > scan_elements/in_deltavelocity_y_en |
||||
root:/sys/bus/iio/devices/iio:device0> echo 1 > scan_elements/in_deltavelocity_z_en |
||||
root:/sys/bus/iio/devices/iio:device0> echo 1 > scan_elements/in_temp0_en |
||||
|
||||
Set the number of samples to be stored in the buffer: |
||||
|
||||
.. code-block:: bash |
||||
|
||||
root:/sys/bus/iio/devices/iio:device0> echo 10 > buffer/length |
||||
|
||||
Enable buffer readings: |
||||
|
||||
.. code-block:: bash |
||||
|
||||
root:/sys/bus/iio/devices/iio:device0> echo 1 > buffer/enable |
||||
|
||||
Obtain buffered data:: |
||||
|
||||
root:/sys/bus/iio/devices/iio:device0> hexdump -C /dev/iio\:device0 |
||||
... |
||||
00006aa0 09 62 00 00 ff ff fc a4 00 00 01 69 00 03 3c 08 |.b.........i..<.| |
||||
00006ab0 09 61 00 00 00 00 02 96 00 00 02 8f 00 03 37 50 |.a............7P| |
||||
00006ac0 09 61 00 00 00 00 12 3d 00 00 0b 89 00 03 2c 0b |.a.....=......,.| |
||||
00006ad0 09 61 00 00 00 00 1e dc 00 00 16 dd 00 03 25 bf |.a............%.| |
||||
00006ae0 09 61 00 00 00 00 1e e3 00 00 1b bf 00 03 27 0b |.a............'.| |
||||
00006af0 09 61 00 00 00 00 15 50 00 00 19 44 00 03 30 fd |.a.....P...D..0.| |
||||
00006b00 09 61 00 00 00 00 09 0e 00 00 14 41 00 03 3d 7f |.a.........A..=.| |
||||
00006b10 09 61 00 00 ff ff ff f0 00 00 0e bc 00 03 48 d0 |.a............H.| |
||||
00006b20 09 63 00 00 00 00 00 9f 00 00 0f 37 00 03 4c fe |.c.........7..L.| |
||||
00006b30 09 64 00 00 00 00 0b f6 00 00 18 92 00 03 43 22 |.d............C"| |
||||
00006b40 09 64 00 00 00 00 18 df 00 00 22 33 00 03 33 ab |.d........"3..3.| |
||||
00006b50 09 63 00 00 00 00 1e 81 00 00 26 be 00 03 29 60 |.c........&...)`| |
||||
00006b60 09 63 00 00 00 00 1b 13 00 00 22 2f 00 03 23 91 |.c........"/..#.| |
||||
... |
||||
|
||||
See ``Documentation/iio/iio_devbuf.rst`` for more information about how buffered |
||||
data is structured. |
||||
|
||||
4. IIO Interfacing Tools |
||||
======================== |
||||
|
||||
See ``Documentation/iio/iio_tools.rst`` for the description of the available IIO |
||||
interfacing tools. |
@ -0,0 +1,54 @@
|
||||
.. SPDX-License-Identifier: GPL-2.0 |
||||
|
||||
=================================== |
||||
High-speed DMABUF interface for IIO |
||||
=================================== |
||||
|
||||
1. Overview |
||||
=========== |
||||
|
||||
The Industrial I/O subsystem supports access to buffers through a |
||||
file-based interface, with read() and write() access calls through the |
||||
IIO device's dev node. |
||||
|
||||
It additionally supports a DMABUF based interface, where the userspace |
||||
can attach DMABUF objects (externally created) to an IIO buffer, and |
||||
subsequently use them for data transfers. |
||||
|
||||
A userspace application can then use this interface to share DMABUF |
||||
objects between several interfaces, allowing it to transfer data in a |
||||
zero-copy fashion, for instance between IIO and the USB stack. |
||||
|
||||
The userspace application can also memory-map the DMABUF objects, and |
||||
access the sample data directly. The advantage of doing this vs. the |
||||
read() interface is that it avoids an extra copy of the data between the |
||||
kernel and userspace. This is particularly useful for high-speed devices |
||||
which produce several megabytes or even gigabytes of data per second. |
||||
It does however increase the userspace-kernelspace synchronization |
||||
overhead, as the DMA_BUF_SYNC_START and DMA_BUF_SYNC_END IOCTLs have to |
||||
be used for data integrity. |
||||
|
||||
2. User API |
||||
=========== |
||||
|
||||
As part of this interface, three new IOCTLs have been added. These three |
||||
IOCTLs have to be performed on the IIO buffer's file descriptor, which |
||||
can be obtained using the IIO_BUFFER_GET_FD_IOCTL() ioctl. |
||||
|
||||
``IIO_BUFFER_DMABUF_ATTACH_IOCTL(int fd)`` |
||||
Attach the DMABUF object, identified by its file descriptor, to the |
||||
IIO buffer. Returns zero on success, and a negative errno value on |
||||
error. |
||||
|
||||
``IIO_BUFFER_DMABUF_DETACH_IOCTL(int fd)`` |
||||
Detach the given DMABUF object, identified by its file descriptor, |
||||
from the IIO buffer. Returns zero on success, and a negative errno |
||||
value on error. |
||||
|
||||
Note that closing the IIO buffer's file descriptor will |
||||
automatically detach all previously attached DMABUF objects. |
||||
|
||||
``IIO_BUFFER_DMABUF_ENQUEUE_IOCTL(struct iio_dmabuf *iio_dmabuf)`` |
||||
Enqueue a previously attached DMABUF object to the buffer queue. |
||||
Enqueued DMABUFs will be read from (if output buffer) or written to |
||||
(if input buffer) as long as the buffer is enabled. |
@ -0,0 +1,27 @@
|
||||
.. SPDX-License-Identifier: GPL-2.0 |
||||
|
||||
===================== |
||||
IIO Interfacing Tools |
||||
===================== |
||||
|
||||
1. Linux Kernel Tools |
||||
===================== |
||||
|
||||
Linux Kernel provides some userspace tools that can be used to retrieve data |
||||
from IIO sysfs: |
||||
|
||||
* lsiio: example application that provides a list of IIO devices and triggers |
||||
* iio_event_monitor: example application that reads events from an IIO device |
||||
and prints them |
||||
* iio_generic_buffer: example application that reads data from buffer |
||||
* iio_utils: set of APIs, typically used to access sysfs files. |
||||
|
||||
2. LibIIO |
||||
========= |
||||
|
||||
LibIIO is a C/C++ library that provides generic access to IIO devices. The |
||||
library abstracts the low-level details of the hardware, and provides a simple |
||||
yet complete programming interface that can be used for advanced projects. |
||||
|
||||
For more information about LibIIO, please see: |
||||
https://github.com/analogdevicesinc/libiio |
@ -0,0 +1,52 @@
|
||||
.. SPDX-License-Identifier: GPL-2.0 |
||||
|
||||
=============================================== |
||||
Marvell CN10K DMA packet interface (DPI) driver |
||||
=============================================== |
||||
|
||||
Overview |
||||
======== |
||||
|
||||
DPI is a DMA packet interface hardware block in Marvell's CN10K silicon. |
||||
DPI hardware comprises a physical function (PF), its virtual functions, |
||||
mailbox logic, and a set of DMA engines & DMA command queues. |
||||
|
||||
DPI PF function is an administrative function which services the mailbox |
||||
requests from its VF functions and provisions DMA engine resources to |
||||
it's VF functions. |
||||
|
||||
mrvl_cn10k_dpi.ko misc driver loads on DPI PF device and services the |
||||
mailbox commands submitted by the VF devices and accordingly initializes |
||||
the DMA engines and VF device's DMA command queues. Also, driver creates |
||||
/dev/mrvl-cn10k-dpi node to set DMA engine and PEM (PCIe interface) port |
||||
attributes like fifo length, molr, mps & mrrs. |
||||
|
||||
DPI PF driver is just an administrative driver to setup its VF device's |
||||
queues and provisions the hardware resources, it cannot initiate any |
||||
DMA operations. Only VF devices are provisioned with DMA capabilities. |
||||
|
||||
Driver location |
||||
=============== |
||||
|
||||
drivers/misc/mrvl_cn10k_dpi.c |
||||
|
||||
Driver IOCTLs |
||||
============= |
||||
|
||||
:c:macro::`DPI_MPS_MRRS_CFG` |
||||
ioctl that sets max payload size & max read request size parameters of |
||||
a pem port to which DMA engines are wired. |
||||
|
||||
|
||||
:c:macro::`DPI_ENGINE_CFG` |
||||
ioctl that sets DMA engine's fifo sizes & max outstanding load request |
||||
thresholds. |
||||
|
||||
User space code example |
||||
======================= |
||||
|
||||
DPI VF devices are probed and accessed from user space applications using |
||||
vfio-pci driver. Below is a sample dpi dma application to demonstrate on |
||||
how applications use mailbox and ioctl services from DPI PF kernel driver. |
||||
|
||||
https://github.com/MarvellEmbeddedProcessors/dpi-sample-app |
@ -0,0 +1,176 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0-only */ |
||||
/*
|
||||
* Copyright 2024 Google LLC |
||||
* |
||||
* dbitmap - dynamically sized bitmap library. |
||||
* |
||||
* Used by the binder driver to optimize the allocation of the smallest |
||||
* available descriptor ID. Each bit in the bitmap represents the state |
||||
* of an ID, with the exception of BIT(0) which is used exclusively to |
||||
* reference binder's context manager. |
||||
* |
||||
* A dbitmap can grow or shrink as needed. This part has been designed |
||||
* considering that users might need to briefly release their locks in |
||||
* order to allocate memory for the new bitmap. These operations then, |
||||
* are verified to determine if the grow or shrink is sill valid. |
||||
* |
||||
* This library does not provide protection against concurrent access |
||||
* by itself. Binder uses the proc->outer_lock for this purpose. |
||||
*/ |
||||
|
||||
#ifndef _LINUX_DBITMAP_H |
||||
#define _LINUX_DBITMAP_H |
||||
#include <linux/bitmap.h> |
||||
|
||||
#define NBITS_MIN BITS_PER_TYPE(unsigned long) |
||||
|
||||
struct dbitmap { |
||||
unsigned int nbits; |
||||
unsigned long *map; |
||||
}; |
||||
|
||||
static inline int dbitmap_enabled(struct dbitmap *dmap) |
||||
{ |
||||
return !!dmap->nbits; |
||||
} |
||||
|
||||
static inline void dbitmap_free(struct dbitmap *dmap) |
||||
{ |
||||
dmap->nbits = 0; |
||||
kfree(dmap->map); |
||||
} |
||||
|
||||
/* Returns the nbits that a dbitmap can shrink to, 0 if not possible. */ |
||||
static inline unsigned int dbitmap_shrink_nbits(struct dbitmap *dmap) |
||||
{ |
||||
unsigned int bit; |
||||
|
||||
if (dmap->nbits <= NBITS_MIN) |
||||
return 0; |
||||
|
||||
/*
|
||||
* Determine if the bitmap can shrink based on the position of |
||||
* its last set bit. If the bit is within the first quarter of |
||||
* the bitmap then shrinking is possible. In this case, the |
||||
* bitmap should shrink to half its current size. |
||||
*/ |
||||
bit = find_last_bit(dmap->map, dmap->nbits); |
||||
if (bit < (dmap->nbits >> 2)) |
||||
return dmap->nbits >> 1; |
||||
|
||||
/*
|
||||
* Note that find_last_bit() returns dmap->nbits when no bits |
||||
* are set. While this is technically not possible here since |
||||
* BIT(0) is always set, this check is left for extra safety. |
||||
*/ |
||||
if (bit == dmap->nbits) |
||||
return NBITS_MIN; |
||||
|
||||
return 0; |
||||
} |
||||
|
||||
/* Replace the internal bitmap with a new one of different size */ |
||||
static inline void |
||||
dbitmap_replace(struct dbitmap *dmap, unsigned long *new, unsigned int nbits) |
||||
{ |
||||
bitmap_copy(new, dmap->map, min(dmap->nbits, nbits)); |
||||
kfree(dmap->map); |
||||
dmap->map = new; |
||||
dmap->nbits = nbits; |
||||
} |
||||
|
||||
static inline void |
||||
dbitmap_shrink(struct dbitmap *dmap, unsigned long *new, unsigned int nbits) |
||||
{ |
||||
if (!new) |
||||
return; |
||||
|
||||
/*
|
||||
* Verify that shrinking to @nbits is still possible. The @new |
||||
* bitmap might have been allocated without locks, so this call |
||||
* could now be outdated. In this case, free @new and move on. |
||||
*/ |
||||
if (!dbitmap_enabled(dmap) || dbitmap_shrink_nbits(dmap) != nbits) { |
||||
kfree(new); |
||||
return; |
||||
} |
||||
|
||||
dbitmap_replace(dmap, new, nbits); |
||||
} |
||||
|
||||
/* Returns the nbits that a dbitmap can grow to. */ |
||||
static inline unsigned int dbitmap_grow_nbits(struct dbitmap *dmap) |
||||
{ |
||||
return dmap->nbits << 1; |
||||
} |
||||
|
||||
static inline void |
||||
dbitmap_grow(struct dbitmap *dmap, unsigned long *new, unsigned int nbits) |
||||
{ |
||||
/*
|
||||
* Verify that growing to @nbits is still possible. The @new |
||||
* bitmap might have been allocated without locks, so this call |
||||
* could now be outdated. In this case, free @new and move on. |
||||
*/ |
||||
if (!dbitmap_enabled(dmap) || nbits <= dmap->nbits) { |
||||
kfree(new); |
||||
return; |
||||
} |
||||
|
||||
/*
|
||||
* Check for ENOMEM after confirming the grow operation is still |
||||
* required. This ensures we only disable the dbitmap when it's |
||||
* necessary. Once the dbitmap is disabled, binder will fallback |
||||
* to slow_desc_lookup_olocked(). |
||||
*/ |
||||
if (!new) { |
||||
dbitmap_free(dmap); |
||||
return; |
||||
} |
||||
|
||||
dbitmap_replace(dmap, new, nbits); |
||||
} |
||||
|
||||
/*
|
||||
* Finds and sets the first zero bit in the bitmap. Upon success @bit |
||||
* is populated with the index and 0 is returned. Otherwise, -ENOSPC |
||||
* is returned to indicate that a dbitmap_grow() is needed. |
||||
*/ |
||||
static inline int |
||||
dbitmap_acquire_first_zero_bit(struct dbitmap *dmap, unsigned long *bit) |
||||
{ |
||||
unsigned long n; |
||||
|
||||
n = find_first_zero_bit(dmap->map, dmap->nbits); |
||||
if (n == dmap->nbits) |
||||
return -ENOSPC; |
||||
|
||||
*bit = n; |
||||
set_bit(n, dmap->map); |
||||
|
||||
return 0; |
||||
} |
||||
|
||||
static inline void |
||||
dbitmap_clear_bit(struct dbitmap *dmap, unsigned long bit) |
||||
{ |
||||
/* BIT(0) should always set for the context manager */ |
||||
if (bit) |
||||
clear_bit(bit, dmap->map); |
||||
} |
||||
|
||||
static inline int dbitmap_init(struct dbitmap *dmap) |
||||
{ |
||||
dmap->map = bitmap_zalloc(NBITS_MIN, GFP_KERNEL); |
||||
if (!dmap->map) { |
||||
dmap->nbits = 0; |
||||
return -ENOMEM; |
||||
} |
||||
|
||||
dmap->nbits = NBITS_MIN; |
||||
/* BIT(0) is reserved for the context manager */ |
||||
set_bit(0, dmap->map); |
||||
|
||||
return 0; |
||||
} |
||||
#endif |
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue