Merge branch 'for-5.15-printk-index' into for-linus
This commit is contained in:
182
Documentation/ABI/obsolete/sysfs-bus-iio
Normal file
182
Documentation/ABI/obsolete/sysfs-bus-iio
Normal file
@@ -0,0 +1,182 @@
|
||||
What: /sys/bus/iio/devices/iio:deviceX/buffer/length
|
||||
KernelVersion: 2.6.35
|
||||
Contact: linux-iio@vger.kernel.org
|
||||
Description:
|
||||
Number of scans contained by the buffer.
|
||||
|
||||
Since Kernel 5.11, multiple buffers are supported.
|
||||
so, it is better to use, instead:
|
||||
/sys/bus/iio/devices/iio:deviceX/bufferY/length
|
||||
|
||||
What: /sys/bus/iio/devices/iio:deviceX/buffer/enable
|
||||
KernelVersion: 2.6.35
|
||||
Contact: linux-iio@vger.kernel.org
|
||||
Description:
|
||||
Actually start the buffer capture up. Will start trigger
|
||||
if first device and appropriate.
|
||||
|
||||
Since Kernel 5.11, multiple buffers are supported.
|
||||
so, it is better to use, instead:
|
||||
/sys/bus/iio/devices/iio:deviceX/bufferY/enable
|
||||
|
||||
What: /sys/bus/iio/devices/iio:deviceX/scan_elements
|
||||
KernelVersion: 2.6.37
|
||||
Contact: linux-iio@vger.kernel.org
|
||||
Description:
|
||||
Directory containing interfaces for elements that will be
|
||||
captured for a single triggered sample set in the buffer.
|
||||
|
||||
Since kernel 5.11 the scan_elements attributes are merged into
|
||||
the bufferY directory, to be configurable per buffer.
|
||||
|
||||
What: /sys/.../iio:deviceX/scan_elements/in_accel_x_en
|
||||
What: /sys/.../iio:deviceX/scan_elements/in_accel_y_en
|
||||
What: /sys/.../iio:deviceX/scan_elements/in_accel_z_en
|
||||
What: /sys/.../iio:deviceX/scan_elements/in_anglvel_x_en
|
||||
What: /sys/.../iio:deviceX/scan_elements/in_anglvel_y_en
|
||||
What: /sys/.../iio:deviceX/scan_elements/in_anglvel_z_en
|
||||
What: /sys/.../iio:deviceX/scan_elements/in_magn_x_en
|
||||
What: /sys/.../iio:deviceX/scan_elements/in_magn_y_en
|
||||
What: /sys/.../iio:deviceX/scan_elements/in_magn_z_en
|
||||
What: /sys/.../iio:deviceX/scan_elements/in_rot_from_north_magnetic_en
|
||||
What: /sys/.../iio:deviceX/scan_elements/in_rot_from_north_true_en
|
||||
What: /sys/.../iio:deviceX/scan_elements/in_rot_from_north_magnetic_tilt_comp_en
|
||||
What: /sys/.../iio:deviceX/scan_elements/in_rot_from_north_true_tilt_comp_en
|
||||
What: /sys/.../iio:deviceX/scan_elements/in_timestamp_en
|
||||
What: /sys/.../iio:deviceX/scan_elements/in_voltageY_supply_en
|
||||
What: /sys/.../iio:deviceX/scan_elements/in_voltageY_en
|
||||
What: /sys/.../iio:deviceX/scan_elements/in_voltageY-voltageZ_en
|
||||
What: /sys/.../iio:deviceX/scan_elements/in_voltageY_i_en
|
||||
What: /sys/.../iio:deviceX/scan_elements/in_voltageY_q_en
|
||||
What: /sys/.../iio:deviceX/scan_elements/in_voltage_i_en
|
||||
What: /sys/.../iio:deviceX/scan_elements/in_voltage_q_en
|
||||
What: /sys/.../iio:deviceX/scan_elements/in_incli_x_en
|
||||
What: /sys/.../iio:deviceX/scan_elements/in_incli_y_en
|
||||
What: /sys/.../iio:deviceX/scan_elements/in_pressureY_en
|
||||
What: /sys/.../iio:deviceX/scan_elements/in_pressure_en
|
||||
What: /sys/.../iio:deviceX/scan_elements/in_rot_quaternion_en
|
||||
What: /sys/.../iio:deviceX/scan_elements/in_proximity_en
|
||||
KernelVersion: 2.6.37
|
||||
Contact: linux-iio@vger.kernel.org
|
||||
Description:
|
||||
Scan element control for triggered data capture.
|
||||
|
||||
Since kernel 5.11 the scan_elements attributes are merged into
|
||||
the bufferY directory, to be configurable per buffer.
|
||||
|
||||
What: /sys/.../iio:deviceX/scan_elements/in_accel_type
|
||||
What: /sys/.../iio:deviceX/scan_elements/in_anglvel_type
|
||||
What: /sys/.../iio:deviceX/scan_elements/in_magn_type
|
||||
What: /sys/.../iio:deviceX/scan_elements/in_incli_type
|
||||
What: /sys/.../iio:deviceX/scan_elements/in_voltageY_type
|
||||
What: /sys/.../iio:deviceX/scan_elements/in_voltage_type
|
||||
What: /sys/.../iio:deviceX/scan_elements/in_voltageY_supply_type
|
||||
What: /sys/.../iio:deviceX/scan_elements/in_voltageY_i_type
|
||||
What: /sys/.../iio:deviceX/scan_elements/in_voltageY_q_type
|
||||
What: /sys/.../iio:deviceX/scan_elements/in_voltage_i_type
|
||||
What: /sys/.../iio:deviceX/scan_elements/in_voltage_q_type
|
||||
What: /sys/.../iio:deviceX/scan_elements/in_timestamp_type
|
||||
What: /sys/.../iio:deviceX/scan_elements/in_pressureY_type
|
||||
What: /sys/.../iio:deviceX/scan_elements/in_pressure_type
|
||||
What: /sys/.../iio:deviceX/scan_elements/in_rot_quaternion_type
|
||||
What: /sys/.../iio:deviceX/scan_elements/in_proximity_type
|
||||
KernelVersion: 2.6.37
|
||||
Contact: linux-iio@vger.kernel.org
|
||||
Description:
|
||||
Description of the scan element data storage within the buffer
|
||||
and hence the form in which it is read from user-space.
|
||||
Form is [be|le]:[s|u]bits/storagebits[>>shift].
|
||||
be or le specifies big or little endian. s or u specifies if
|
||||
signed (2's complement) or unsigned. bits is the number of bits
|
||||
of data and storagebits is the space (after padding) that it
|
||||
occupies in the buffer. shift if specified, is the shift that
|
||||
needs to be applied prior to masking out unused bits. Some
|
||||
devices put their data in the middle of the transferred elements
|
||||
with additional information on both sides. Note that some
|
||||
devices will have additional information in the unused bits
|
||||
so to get a clean value, the bits value must be used to mask
|
||||
the buffer output value appropriately. The storagebits value
|
||||
also specifies the data alignment. So s48/64>>2 will be a
|
||||
signed 48 bit integer stored in a 64 bit location aligned to
|
||||
a 64 bit boundary. To obtain the clean value, shift right 2
|
||||
and apply a mask to zero the top 16 bits of the result.
|
||||
For other storage combinations this attribute will be extended
|
||||
appropriately.
|
||||
|
||||
Since kernel 5.11 the scan_elements attributes are merged into
|
||||
the bufferY directory, to be configurable per buffer.
|
||||
|
||||
What: /sys/.../iio:deviceX/scan_elements/in_voltageY_index
|
||||
What: /sys/.../iio:deviceX/scan_elements/in_voltageY_supply_index
|
||||
What: /sys/.../iio:deviceX/scan_elements/in_voltageY_i_index
|
||||
What: /sys/.../iio:deviceX/scan_elements/in_voltageY_q_index
|
||||
What: /sys/.../iio:deviceX/scan_elements/in_voltage_i_index
|
||||
What: /sys/.../iio:deviceX/scan_elements/in_voltage_q_index
|
||||
What: /sys/.../iio:deviceX/scan_elements/in_accel_x_index
|
||||
What: /sys/.../iio:deviceX/scan_elements/in_accel_y_index
|
||||
What: /sys/.../iio:deviceX/scan_elements/in_accel_z_index
|
||||
What: /sys/.../iio:deviceX/scan_elements/in_anglvel_x_index
|
||||
What: /sys/.../iio:deviceX/scan_elements/in_anglvel_y_index
|
||||
What: /sys/.../iio:deviceX/scan_elements/in_anglvel_z_index
|
||||
What: /sys/.../iio:deviceX/scan_elements/in_magn_x_index
|
||||
What: /sys/.../iio:deviceX/scan_elements/in_magn_y_index
|
||||
What: /sys/.../iio:deviceX/scan_elements/in_magn_z_index
|
||||
What: /sys/.../iio:deviceX/scan_elements/in_rot_from_north_magnetic_index
|
||||
What: /sys/.../iio:deviceX/scan_elements/in_rot_from_north_true_index
|
||||
What: /sys/.../iio:deviceX/scan_elements/in_rot_from_north_magnetic_tilt_comp_index
|
||||
What: /sys/.../iio:deviceX/scan_elements/in_rot_from_north_true_tilt_comp_index
|
||||
What: /sys/.../iio:deviceX/scan_elements/in_incli_x_index
|
||||
What: /sys/.../iio:deviceX/scan_elements/in_incli_y_index
|
||||
What: /sys/.../iio:deviceX/scan_elements/in_timestamp_index
|
||||
What: /sys/.../iio:deviceX/scan_elements/in_pressureY_index
|
||||
What: /sys/.../iio:deviceX/scan_elements/in_pressure_index
|
||||
What: /sys/.../iio:deviceX/scan_elements/in_rot_quaternion_index
|
||||
What: /sys/.../iio:deviceX/scan_elements/in_proximity_index
|
||||
KernelVersion: 2.6.37
|
||||
Description:
|
||||
A single positive integer specifying the position of this
|
||||
scan element in the buffer. Note these are not dependent on
|
||||
what is enabled and may not be contiguous. Thus for user-space
|
||||
to establish the full layout these must be used in conjunction
|
||||
with all _en attributes to establish which channels are present,
|
||||
and the relevant _type attributes to establish the data storage
|
||||
format.
|
||||
|
||||
Since kernel 5.11 the scan_elements attributes are merged into
|
||||
the bufferY directory, to be configurable per buffer.
|
||||
|
||||
What: /sys/bus/iio/devices/iio:deviceX/buffer/watermark
|
||||
KernelVersion: 4.2
|
||||
Contact: linux-iio@vger.kernel.org
|
||||
Description:
|
||||
A single positive integer specifying the maximum number of scan
|
||||
elements to wait for.
|
||||
|
||||
Poll will block until the watermark is reached.
|
||||
|
||||
Blocking read will wait until the minimum between the requested
|
||||
read amount or the low water mark is available.
|
||||
|
||||
Non-blocking read will retrieve the available samples from the
|
||||
buffer even if there are less samples then watermark level. This
|
||||
allows the application to block on poll with a timeout and read
|
||||
the available samples after the timeout expires and thus have a
|
||||
maximum delay guarantee.
|
||||
|
||||
Since Kernel 5.11, multiple buffers are supported.
|
||||
so, it is better to use, instead:
|
||||
/sys/bus/iio/devices/iio:deviceX/bufferY/watermark
|
||||
|
||||
What: /sys/bus/iio/devices/iio:deviceX/buffer/data_available
|
||||
KernelVersion: 4.16
|
||||
Contact: linux-iio@vger.kernel.org
|
||||
Description:
|
||||
A read-only value indicating the bytes of data available in the
|
||||
buffer. In the case of an output buffer, this indicates the
|
||||
amount of empty space available to write data to. In the case of
|
||||
an input buffer, this indicates the amount of data available for
|
||||
reading.
|
||||
|
||||
Since Kernel 5.11, multiple buffers are supported.
|
||||
so, it is better to use, instead:
|
||||
/sys/bus/iio/devices/iio:deviceX/bufferY/data_available
|
||||
@@ -731,26 +731,6 @@ Description:
|
||||
is the irq number of "sdma3", and M is irq number of "sdma4" in
|
||||
the /proc/interrupts file.
|
||||
|
||||
|
||||
sysfs interface for Intel(R) X722 iWARP i40iw driver
|
||||
----------------------------------------------------
|
||||
|
||||
What: /sys/class/infiniband/i40iwX/hw_rev
|
||||
What: /sys/class/infiniband/i40iwX/hca_type
|
||||
What: /sys/class/infiniband/i40iwX/board_id
|
||||
Date: Jan, 2016
|
||||
KernelVersion: v4.10
|
||||
Contact: linux-rdma@vger.kernel.org
|
||||
Description:
|
||||
=============== ==== ========================
|
||||
hw_rev: (RO) Hardware revision number
|
||||
|
||||
hca_type: (RO) Show HCA type (I40IW)
|
||||
|
||||
board_id: (RO) I40IW board ID
|
||||
=============== ==== ========================
|
||||
|
||||
|
||||
sysfs interface for QLogic qedr NIC Driver
|
||||
------------------------------------------
|
||||
|
||||
|
||||
13
Documentation/ABI/stable/sysfs-driver-w1_ds2438
Normal file
13
Documentation/ABI/stable/sysfs-driver-w1_ds2438
Normal file
@@ -0,0 +1,13 @@
|
||||
What: /sys/bus/w1/devices/.../page1
|
||||
Date: April 2021
|
||||
Contact: Luiz Sampaio <sampaio.ime@gmail.com>
|
||||
Description: read the contents of the page1 of the DS2438
|
||||
see Documentation/w1/slaves/w1_ds2438.rst for detailed information
|
||||
Users: any user space application which wants to communicate with DS2438
|
||||
|
||||
What: /sys/bus/w1/devices/.../offset
|
||||
Date: April 2021
|
||||
Contact: Luiz Sampaio <sampaio.ime@gmail.com>
|
||||
Description: write the contents to the offset register of the DS2438
|
||||
see Documentation/w1/slaves/w1_ds2438.rst for detailed information
|
||||
Users: any user space application which wants to communicate with DS2438
|
||||
@@ -8,6 +8,8 @@ Description:
|
||||
c_chmask capture channel mask
|
||||
c_srate capture sampling rate
|
||||
c_ssize capture sample size (bytes)
|
||||
c_sync capture synchronization type (async/adaptive)
|
||||
fb_max maximum extra bandwidth in async mode
|
||||
p_chmask playback channel mask
|
||||
p_srate playback sampling rate
|
||||
p_ssize playback sample size (bytes)
|
||||
|
||||
@@ -207,6 +207,14 @@ Contact: ogabbay@kernel.org
|
||||
Description: Sets the PCI power state. Valid values are "1" for D0 and "2"
|
||||
for D3Hot
|
||||
|
||||
What: /sys/kernel/debug/habanalabs/hl<n>/skip_reset_on_timeout
|
||||
Date: Jun 2021
|
||||
KernelVersion: 5.13
|
||||
Contact: ynudelman@habana.ai
|
||||
Description: Sets the skip reset on timeout option for the device. Value of
|
||||
"0" means device will be reset in case some CS has timed out,
|
||||
otherwise it will not be reset.
|
||||
|
||||
What: /sys/kernel/debug/habanalabs/hl<n>/stop_on_err
|
||||
Date: Mar 2020
|
||||
KernelVersion: 5.6
|
||||
|
||||
@@ -57,6 +57,7 @@ Description:
|
||||
What: /sys/bus/counter/devices/counterX/countY/count_mode_available
|
||||
What: /sys/bus/counter/devices/counterX/countY/error_noise_available
|
||||
What: /sys/bus/counter/devices/counterX/countY/function_available
|
||||
What: /sys/bus/counter/devices/counterX/countY/prescaler_available
|
||||
What: /sys/bus/counter/devices/counterX/countY/signalZ_action_available
|
||||
KernelVersion: 5.2
|
||||
Contact: linux-iio@vger.kernel.org
|
||||
@@ -154,6 +155,15 @@ Description:
|
||||
Count Y. If possible, this should match the name of the
|
||||
respective channel as it appears in the device datasheet.
|
||||
|
||||
What: /sys/bus/counter/devices/counterX/countY/prescaler
|
||||
KernelVersion: 5.2
|
||||
Contact: linux-iio@vger.kernel.org
|
||||
Description:
|
||||
Configure the prescaler value associated with Count Y.
|
||||
On the FlexTimer, the counter clock source passes through a
|
||||
prescaler (i.e. a counter). This acts like a clock
|
||||
divider.
|
||||
|
||||
What: /sys/bus/counter/devices/counterX/countY/preset
|
||||
KernelVersion: 5.2
|
||||
Contact: linux-iio@vger.kernel.org
|
||||
@@ -193,6 +203,15 @@ Description:
|
||||
both edges:
|
||||
Any state transition.
|
||||
|
||||
What: /sys/bus/counter/devices/counterX/countY/spike_filter_ns
|
||||
KernelVersion: 5.14
|
||||
Contact: linux-iio@vger.kernel.org
|
||||
Description:
|
||||
If the counter device supports programmable spike filter this
|
||||
attribute indicates the value in nanoseconds where noise pulses
|
||||
shorter or equal to configured value are ignored. Value 0 means
|
||||
filter is disabled.
|
||||
|
||||
What: /sys/bus/counter/devices/counterX/name
|
||||
KernelVersion: 5.2
|
||||
Contact: linux-iio@vger.kernel.org
|
||||
@@ -215,11 +234,45 @@ Description:
|
||||
Read-only attribute that indicates the total number of Signals
|
||||
belonging to the Counter.
|
||||
|
||||
What: /sys/bus/counter/devices/counterX/signalY/signal
|
||||
What: /sys/bus/counter/devices/counterX/signalY/cable_fault
|
||||
KernelVersion: 5.7
|
||||
Contact: linux-iio@vger.kernel.org
|
||||
Description:
|
||||
Read-only attribute that indicates whether a differential
|
||||
encoder cable fault (not connected or loose wires) is detected
|
||||
for the respective channel of Signal Y. Valid attribute values
|
||||
are boolean. Detection must first be enabled via the
|
||||
corresponding cable_fault_enable attribute.
|
||||
|
||||
What: /sys/bus/counter/devices/counterX/signalY/cable_fault_enable
|
||||
KernelVersion: 5.7
|
||||
Contact: linux-iio@vger.kernel.org
|
||||
Description:
|
||||
Whether detection of differential encoder cable faults for the
|
||||
respective channel of Signal Y is enabled. Valid attribute
|
||||
values are boolean.
|
||||
|
||||
What: /sys/bus/counter/devices/counterX/signalY/filter_clock_prescaler
|
||||
KernelVersion: 5.7
|
||||
Contact: linux-iio@vger.kernel.org
|
||||
Description:
|
||||
Filter clock factor for input Signal Y. This prescaler value
|
||||
affects the inputs of both quadrature pair signals.
|
||||
|
||||
What: /sys/bus/counter/devices/counterX/signalY/index_polarity
|
||||
KernelVersion: 5.2
|
||||
Contact: linux-iio@vger.kernel.org
|
||||
Description:
|
||||
Signal data of Signal Y represented as a string.
|
||||
Active level of index input Signal Y; irrelevant in
|
||||
non-synchronous load mode.
|
||||
|
||||
What: /sys/bus/counter/devices/counterX/signalY/index_polarity_available
|
||||
What: /sys/bus/counter/devices/counterX/signalY/synchronous_mode_available
|
||||
KernelVersion: 5.2
|
||||
Contact: linux-iio@vger.kernel.org
|
||||
Description:
|
||||
Discrete set of available values for the respective Signal Y
|
||||
configuration are listed in this file.
|
||||
|
||||
What: /sys/bus/counter/devices/counterX/signalY/name
|
||||
KernelVersion: 5.2
|
||||
@@ -228,3 +281,31 @@ Description:
|
||||
Read-only attribute that indicates the device-specific name of
|
||||
Signal Y. If possible, this should match the name of the
|
||||
respective signal as it appears in the device datasheet.
|
||||
|
||||
What: /sys/bus/counter/devices/counterX/signalY/signal
|
||||
KernelVersion: 5.2
|
||||
Contact: linux-iio@vger.kernel.org
|
||||
Description:
|
||||
Signal data of Signal Y represented as a string.
|
||||
|
||||
What: /sys/bus/counter/devices/counterX/signalY/synchronous_mode
|
||||
KernelVersion: 5.2
|
||||
Contact: linux-iio@vger.kernel.org
|
||||
Description:
|
||||
Configure the counter associated with Signal Y for
|
||||
non-synchronous or synchronous load mode. Synchronous load mode
|
||||
cannot be selected in non-quadrature (Pulse-Direction) clock
|
||||
mode.
|
||||
|
||||
non-synchronous:
|
||||
A logic low level is the active level at this index
|
||||
input. The index function (as enabled via preset_enable)
|
||||
is performed directly on the active level of the index
|
||||
input.
|
||||
|
||||
synchronous:
|
||||
Intended for interfacing with encoder Index output in
|
||||
quadrature clock mode. The active level is configured
|
||||
via index_polarity. The index function (as enabled via
|
||||
preset_enable) is performed synchronously with the
|
||||
quadrature clock on the active level of the index input.
|
||||
|
||||
@@ -1,61 +0,0 @@
|
||||
What: /sys/bus/counter/devices/counterX/signalY/cable_fault
|
||||
KernelVersion: 5.7
|
||||
Contact: linux-iio@vger.kernel.org
|
||||
Description:
|
||||
Read-only attribute that indicates whether a differential
|
||||
encoder cable fault (not connected or loose wires) is detected
|
||||
for the respective channel of Signal Y. Valid attribute values
|
||||
are boolean. Detection must first be enabled via the
|
||||
corresponding cable_fault_enable attribute.
|
||||
|
||||
What: /sys/bus/counter/devices/counterX/signalY/cable_fault_enable
|
||||
KernelVersion: 5.7
|
||||
Contact: linux-iio@vger.kernel.org
|
||||
Description:
|
||||
Whether detection of differential encoder cable faults for the
|
||||
respective channel of Signal Y is enabled. Valid attribute
|
||||
values are boolean.
|
||||
|
||||
What: /sys/bus/counter/devices/counterX/signalY/filter_clock_prescaler
|
||||
KernelVersion: 5.7
|
||||
Contact: linux-iio@vger.kernel.org
|
||||
Description:
|
||||
Filter clock factor for input Signal Y. This prescaler value
|
||||
affects the inputs of both quadrature pair signals.
|
||||
|
||||
What: /sys/bus/counter/devices/counterX/signalY/index_polarity
|
||||
KernelVersion: 5.2
|
||||
Contact: linux-iio@vger.kernel.org
|
||||
Description:
|
||||
Active level of index input Signal Y; irrelevant in
|
||||
non-synchronous load mode.
|
||||
|
||||
What: /sys/bus/counter/devices/counterX/signalY/index_polarity_available
|
||||
What: /sys/bus/counter/devices/counterX/signalY/synchronous_mode_available
|
||||
KernelVersion: 5.2
|
||||
Contact: linux-iio@vger.kernel.org
|
||||
Description:
|
||||
Discrete set of available values for the respective Signal Y
|
||||
configuration are listed in this file.
|
||||
|
||||
What: /sys/bus/counter/devices/counterX/signalY/synchronous_mode
|
||||
KernelVersion: 5.2
|
||||
Contact: linux-iio@vger.kernel.org
|
||||
Description:
|
||||
Configure the counter associated with Signal Y for
|
||||
non-synchronous or synchronous load mode. Synchronous load mode
|
||||
cannot be selected in non-quadrature (Pulse-Direction) clock
|
||||
mode.
|
||||
|
||||
non-synchronous:
|
||||
A logic low level is the active level at this index
|
||||
input. The index function (as enabled via preset_enable)
|
||||
is performed directly on the active level of the index
|
||||
input.
|
||||
|
||||
synchronous:
|
||||
Intended for interfacing with encoder Index output in
|
||||
quadrature clock mode. The active level is configured
|
||||
via index_polarity. The index function (as enabled via
|
||||
preset_enable) is performed synchronously with the
|
||||
quadrature clock on the active level of the index input.
|
||||
@@ -1,16 +0,0 @@
|
||||
What: /sys/bus/counter/devices/counterX/countY/prescaler_available
|
||||
KernelVersion: 5.2
|
||||
Contact: linux-iio@vger.kernel.org
|
||||
Description:
|
||||
Discrete set of available values for the respective Count Y
|
||||
configuration are listed in this file. Values are delimited by
|
||||
newline characters.
|
||||
|
||||
What: /sys/bus/counter/devices/counterX/countY/prescaler
|
||||
KernelVersion: 5.2
|
||||
Contact: linux-iio@vger.kernel.org
|
||||
Description:
|
||||
Configure the prescaler value associated with Count Y.
|
||||
On the FlexTimer, the counter clock source passes through a
|
||||
prescaler (i.e. a counter). This acts like a clock
|
||||
divider.
|
||||
@@ -24,3 +24,106 @@ Description:
|
||||
(RO) "Persistent Only Capacity" as bytes. Represents the
|
||||
identically named field in the Identify Memory Device Output
|
||||
Payload in the CXL-2.0 specification.
|
||||
|
||||
What: /sys/bus/cxl/devices/*/devtype
|
||||
Date: June, 2021
|
||||
KernelVersion: v5.14
|
||||
Contact: linux-cxl@vger.kernel.org
|
||||
Description:
|
||||
CXL device objects export the devtype attribute which mirrors
|
||||
the same value communicated in the DEVTYPE environment variable
|
||||
for uevents for devices on the "cxl" bus.
|
||||
|
||||
What: /sys/bus/cxl/devices/portX/uport
|
||||
Date: June, 2021
|
||||
KernelVersion: v5.14
|
||||
Contact: linux-cxl@vger.kernel.org
|
||||
Description:
|
||||
CXL port objects are enumerated from either a platform firmware
|
||||
device (ACPI0017 and ACPI0016) or PCIe switch upstream port with
|
||||
CXL component registers. The 'uport' symlink connects the CXL
|
||||
portX object to the device that published the CXL port
|
||||
capability.
|
||||
|
||||
What: /sys/bus/cxl/devices/portX/dportY
|
||||
Date: June, 2021
|
||||
KernelVersion: v5.14
|
||||
Contact: linux-cxl@vger.kernel.org
|
||||
Description:
|
||||
CXL port objects are enumerated from either a platform firmware
|
||||
device (ACPI0017 and ACPI0016) or PCIe switch upstream port with
|
||||
CXL component registers. The 'dportY' symlink identifies one or
|
||||
more downstream ports that the upstream port may target in its
|
||||
decode of CXL memory resources. The 'Y' integer reflects the
|
||||
hardware port unique-id used in the hardware decoder target
|
||||
list.
|
||||
|
||||
What: /sys/bus/cxl/devices/decoderX.Y
|
||||
Date: June, 2021
|
||||
KernelVersion: v5.14
|
||||
Contact: linux-cxl@vger.kernel.org
|
||||
Description:
|
||||
CXL decoder objects are enumerated from either a platform
|
||||
firmware description, or a CXL HDM decoder register set in a
|
||||
PCIe device (see CXL 2.0 section 8.2.5.12 CXL HDM Decoder
|
||||
Capability Structure). The 'X' in decoderX.Y represents the
|
||||
cxl_port container of this decoder, and 'Y' represents the
|
||||
instance id of a given decoder resource.
|
||||
|
||||
What: /sys/bus/cxl/devices/decoderX.Y/{start,size}
|
||||
Date: June, 2021
|
||||
KernelVersion: v5.14
|
||||
Contact: linux-cxl@vger.kernel.org
|
||||
Description:
|
||||
The 'start' and 'size' attributes together convey the physical
|
||||
address base and number of bytes mapped in the decoder's decode
|
||||
window. For decoders of devtype "cxl_decoder_root" the address
|
||||
range is fixed. For decoders of devtype "cxl_decoder_switch" the
|
||||
address is bounded by the decode range of the cxl_port ancestor
|
||||
of the decoder's cxl_port, and dynamically updates based on the
|
||||
active memory regions in that address space.
|
||||
|
||||
What: /sys/bus/cxl/devices/decoderX.Y/locked
|
||||
Date: June, 2021
|
||||
KernelVersion: v5.14
|
||||
Contact: linux-cxl@vger.kernel.org
|
||||
Description:
|
||||
CXL HDM decoders have the capability to lock the configuration
|
||||
until the next device reset. For decoders of devtype
|
||||
"cxl_decoder_root" there is no standard facility to unlock them.
|
||||
For decoders of devtype "cxl_decoder_switch" a secondary bus
|
||||
reset, of the PCIe bridge that provides the bus for this
|
||||
decoders uport, unlocks / resets the decoder.
|
||||
|
||||
What: /sys/bus/cxl/devices/decoderX.Y/target_list
|
||||
Date: June, 2021
|
||||
KernelVersion: v5.14
|
||||
Contact: linux-cxl@vger.kernel.org
|
||||
Description:
|
||||
Display a comma separated list of the current decoder target
|
||||
configuration. The list is ordered by the current configured
|
||||
interleave order of the decoder's dport instances. Each entry in
|
||||
the list is a dport id.
|
||||
|
||||
What: /sys/bus/cxl/devices/decoderX.Y/cap_{pmem,ram,type2,type3}
|
||||
Date: June, 2021
|
||||
KernelVersion: v5.14
|
||||
Contact: linux-cxl@vger.kernel.org
|
||||
Description:
|
||||
When a CXL decoder is of devtype "cxl_decoder_root", it
|
||||
represents a fixed memory window identified by platform
|
||||
firmware. A fixed window may only support a subset of memory
|
||||
types. The 'cap_*' attributes indicate whether persistent
|
||||
memory, volatile memory, accelerator memory, and / or expander
|
||||
memory may be mapped behind this decoder's memory window.
|
||||
|
||||
What: /sys/bus/cxl/devices/decoderX.Y/target_type
|
||||
Date: June, 2021
|
||||
KernelVersion: v5.14
|
||||
Contact: linux-cxl@vger.kernel.org
|
||||
Description:
|
||||
When a CXL decoder is of devtype "cxl_decoder_switch", it can
|
||||
optionally decode either accelerator memory (type-2) or expander
|
||||
memory (type-3). The 'target_type' attribute indicates the
|
||||
current setting which may dynamically change based on what
|
||||
memory regions are activated in this decode hierarchy.
|
||||
|
||||
@@ -455,6 +455,19 @@ Contact: linux-iio@vger.kernel.org
|
||||
Description:
|
||||
Hardware applied calibration offset (assumed to fix production
|
||||
inaccuracies).
|
||||
icm42600: For this device values are real physical offsets
|
||||
expressed in SI units (m/s^2 for accelerometers and rad/s
|
||||
for gyroscope)/
|
||||
|
||||
What: /sys/bus/iio/devices/iio:deviceX/in_accel_calibbias_available
|
||||
What: /sys/bus/iio/devices/iio:deviceX/in_anglvel_calibbias_available
|
||||
KernelVersion: 5.8
|
||||
Contact: linux-iio@vger.kernel.org
|
||||
Description:
|
||||
Available values of calibbias. Maybe expressed as either of:
|
||||
|
||||
- a small discrete set of values like "0 2 4 6 8"
|
||||
- a range specified as "[min step max]"
|
||||
|
||||
What: /sys/bus/iio/devices/iio:deviceX/in_voltageY_calibscale
|
||||
What: /sys/bus/iio/devices/iio:deviceX/in_voltageY_supply_calibscale
|
||||
@@ -652,6 +665,25 @@ Description:
|
||||
Output frequency for channel Y in Hz. The number must always be
|
||||
specified and unique if the output corresponds to a single
|
||||
channel.
|
||||
Some drivers have additional constraints:
|
||||
ADF4371 has an integrated VCO with fundamendal output
|
||||
frequency ranging from 4000000000 Hz 8000000000 Hz.
|
||||
|
||||
out_altvoltage0_frequency:
|
||||
A divide by 1, 2, 4, 8, 16, 32 or circuit generates
|
||||
frequencies from 62500000 Hz to 8000000000 Hz.
|
||||
out_altvoltage1_frequency:
|
||||
This channel duplicates the channel 0 frequency
|
||||
out_altvoltage2_frequency:
|
||||
A frequency doubler generates frequencies from
|
||||
8000000000 Hz to 16000000000 Hz.
|
||||
out_altvoltage3_frequency:
|
||||
A frequency quadrupler generates frequencies from
|
||||
16000000000 Hz to 32000000000 Hz.
|
||||
|
||||
Note: writes to one of the channels will affect the frequency of
|
||||
all the other channels, since it involves changing the VCO
|
||||
fundamental output frequency.
|
||||
|
||||
What: /sys/bus/iio/devices/iio:deviceX/out_altvoltageY_phase
|
||||
KernelVersion: 3.4.0
|
||||
@@ -663,6 +695,17 @@ Description:
|
||||
specified and unique if the output corresponds to a single
|
||||
channel.
|
||||
|
||||
What: /sys/bus/iio/devices/iio:deviceX/out_currentY_raw
|
||||
Date: May 2012
|
||||
KernelVersion: 3.5
|
||||
Contact: Johan Hovold <jhovold@gmail.com>
|
||||
Description:
|
||||
Set/get output current for channel Y. Units after application
|
||||
of scale and offset are milliamps.
|
||||
For some devices current channels are used to specify
|
||||
current supplied to elements used in taking a measurement
|
||||
of a different type. E.g. LED currents.
|
||||
|
||||
What: /sys/bus/iio/devices/iio:deviceX/events
|
||||
KernelVersion: 2.6.35
|
||||
Contact: linux-iio@vger.kernel.org
|
||||
@@ -1195,16 +1238,12 @@ Description:
|
||||
The name of the trigger source being used, as per string given
|
||||
in /sys/class/iio/triggerY/name.
|
||||
|
||||
What: /sys/bus/iio/devices/iio:deviceX/buffer/length
|
||||
KernelVersion: 2.6.35
|
||||
What: /sys/bus/iio/devices/iio:deviceX/bufferY/length
|
||||
KernelVersion: 5.11
|
||||
Contact: linux-iio@vger.kernel.org
|
||||
Description:
|
||||
Number of scans contained by the buffer.
|
||||
|
||||
What: /sys/bus/iio/devices/iio:deviceX/buffer/enable
|
||||
KernelVersion: 2.6.35
|
||||
What: /sys/bus/iio/devices/iio:deviceX/bufferY/enable
|
||||
KernelVersion: 5.11
|
||||
Contact: linux-iio@vger.kernel.org
|
||||
@@ -1212,8 +1251,6 @@ Description:
|
||||
Actually start the buffer capture up. Will start trigger
|
||||
if first device and appropriate.
|
||||
|
||||
What: /sys/bus/iio/devices/iio:deviceX/scan_elements
|
||||
KernelVersion: 2.6.37
|
||||
What: /sys/bus/iio/devices/iio:deviceX/bufferY
|
||||
KernelVersion: 5.11
|
||||
Contact: linux-iio@vger.kernel.org
|
||||
@@ -1224,34 +1261,6 @@ Description:
|
||||
Since kernel 5.11 the scan_elements attributes are merged into
|
||||
the bufferY directory, to be configurable per buffer.
|
||||
|
||||
What: /sys/.../iio:deviceX/scan_elements/in_accel_x_en
|
||||
What: /sys/.../iio:deviceX/scan_elements/in_accel_y_en
|
||||
What: /sys/.../iio:deviceX/scan_elements/in_accel_z_en
|
||||
What: /sys/.../iio:deviceX/scan_elements/in_anglvel_x_en
|
||||
What: /sys/.../iio:deviceX/scan_elements/in_anglvel_y_en
|
||||
What: /sys/.../iio:deviceX/scan_elements/in_anglvel_z_en
|
||||
What: /sys/.../iio:deviceX/scan_elements/in_magn_x_en
|
||||
What: /sys/.../iio:deviceX/scan_elements/in_magn_y_en
|
||||
What: /sys/.../iio:deviceX/scan_elements/in_magn_z_en
|
||||
What: /sys/.../iio:deviceX/scan_elements/in_rot_from_north_magnetic_en
|
||||
What: /sys/.../iio:deviceX/scan_elements/in_rot_from_north_true_en
|
||||
What: /sys/.../iio:deviceX/scan_elements/in_rot_from_north_magnetic_tilt_comp_en
|
||||
What: /sys/.../iio:deviceX/scan_elements/in_rot_from_north_true_tilt_comp_en
|
||||
What: /sys/.../iio:deviceX/scan_elements/in_timestamp_en
|
||||
What: /sys/.../iio:deviceX/scan_elements/in_voltageY_supply_en
|
||||
What: /sys/.../iio:deviceX/scan_elements/in_voltageY_en
|
||||
What: /sys/.../iio:deviceX/scan_elements/in_voltageY-voltageZ_en
|
||||
What: /sys/.../iio:deviceX/scan_elements/in_voltageY_i_en
|
||||
What: /sys/.../iio:deviceX/scan_elements/in_voltageY_q_en
|
||||
What: /sys/.../iio:deviceX/scan_elements/in_voltage_i_en
|
||||
What: /sys/.../iio:deviceX/scan_elements/in_voltage_q_en
|
||||
What: /sys/.../iio:deviceX/scan_elements/in_incli_x_en
|
||||
What: /sys/.../iio:deviceX/scan_elements/in_incli_y_en
|
||||
What: /sys/.../iio:deviceX/scan_elements/in_pressureY_en
|
||||
What: /sys/.../iio:deviceX/scan_elements/in_pressure_en
|
||||
What: /sys/.../iio:deviceX/scan_elements/in_rot_quaternion_en
|
||||
What: /sys/.../iio:deviceX/scan_elements/in_proximity_en
|
||||
KernelVersion: 2.6.37
|
||||
What: /sys/.../iio:deviceX/bufferY/in_accel_x_en
|
||||
What: /sys/.../iio:deviceX/bufferY/in_accel_y_en
|
||||
What: /sys/.../iio:deviceX/bufferY/in_accel_z_en
|
||||
@@ -1284,23 +1293,6 @@ Contact: linux-iio@vger.kernel.org
|
||||
Description:
|
||||
Scan element control for triggered data capture.
|
||||
|
||||
What: /sys/.../iio:deviceX/scan_elements/in_accel_type
|
||||
What: /sys/.../iio:deviceX/scan_elements/in_anglvel_type
|
||||
What: /sys/.../iio:deviceX/scan_elements/in_magn_type
|
||||
What: /sys/.../iio:deviceX/scan_elements/in_incli_type
|
||||
What: /sys/.../iio:deviceX/scan_elements/in_voltageY_type
|
||||
What: /sys/.../iio:deviceX/scan_elements/in_voltage_type
|
||||
What: /sys/.../iio:deviceX/scan_elements/in_voltageY_supply_type
|
||||
What: /sys/.../iio:deviceX/scan_elements/in_voltageY_i_type
|
||||
What: /sys/.../iio:deviceX/scan_elements/in_voltageY_q_type
|
||||
What: /sys/.../iio:deviceX/scan_elements/in_voltage_i_type
|
||||
What: /sys/.../iio:deviceX/scan_elements/in_voltage_q_type
|
||||
What: /sys/.../iio:deviceX/scan_elements/in_timestamp_type
|
||||
What: /sys/.../iio:deviceX/scan_elements/in_pressureY_type
|
||||
What: /sys/.../iio:deviceX/scan_elements/in_pressure_type
|
||||
What: /sys/.../iio:deviceX/scan_elements/in_rot_quaternion_type
|
||||
What: /sys/.../iio:deviceX/scan_elements/in_proximity_type
|
||||
KernelVersion: 2.6.37
|
||||
What: /sys/.../iio:deviceX/bufferY/in_accel_type
|
||||
What: /sys/.../iio:deviceX/bufferY/in_anglvel_type
|
||||
What: /sys/.../iio:deviceX/bufferY/in_magn_type
|
||||
@@ -1347,33 +1339,6 @@ Description:
|
||||
If the type parameter can take one of a small set of values,
|
||||
this attribute lists them.
|
||||
|
||||
What: /sys/.../iio:deviceX/scan_elements/in_voltageY_index
|
||||
What: /sys/.../iio:deviceX/scan_elements/in_voltageY_supply_index
|
||||
What: /sys/.../iio:deviceX/scan_elements/in_voltageY_i_index
|
||||
What: /sys/.../iio:deviceX/scan_elements/in_voltageY_q_index
|
||||
What: /sys/.../iio:deviceX/scan_elements/in_voltage_i_index
|
||||
What: /sys/.../iio:deviceX/scan_elements/in_voltage_q_index
|
||||
What: /sys/.../iio:deviceX/scan_elements/in_accel_x_index
|
||||
What: /sys/.../iio:deviceX/scan_elements/in_accel_y_index
|
||||
What: /sys/.../iio:deviceX/scan_elements/in_accel_z_index
|
||||
What: /sys/.../iio:deviceX/scan_elements/in_anglvel_x_index
|
||||
What: /sys/.../iio:deviceX/scan_elements/in_anglvel_y_index
|
||||
What: /sys/.../iio:deviceX/scan_elements/in_anglvel_z_index
|
||||
What: /sys/.../iio:deviceX/scan_elements/in_magn_x_index
|
||||
What: /sys/.../iio:deviceX/scan_elements/in_magn_y_index
|
||||
What: /sys/.../iio:deviceX/scan_elements/in_magn_z_index
|
||||
What: /sys/.../iio:deviceX/scan_elements/in_rot_from_north_magnetic_index
|
||||
What: /sys/.../iio:deviceX/scan_elements/in_rot_from_north_true_index
|
||||
What: /sys/.../iio:deviceX/scan_elements/in_rot_from_north_magnetic_tilt_comp_index
|
||||
What: /sys/.../iio:deviceX/scan_elements/in_rot_from_north_true_tilt_comp_index
|
||||
What: /sys/.../iio:deviceX/scan_elements/in_incli_x_index
|
||||
What: /sys/.../iio:deviceX/scan_elements/in_incli_y_index
|
||||
What: /sys/.../iio:deviceX/scan_elements/in_timestamp_index
|
||||
What: /sys/.../iio:deviceX/scan_elements/in_pressureY_index
|
||||
What: /sys/.../iio:deviceX/scan_elements/in_pressure_index
|
||||
What: /sys/.../iio:deviceX/scan_elements/in_rot_quaternion_index
|
||||
What: /sys/.../iio:deviceX/scan_elements/in_proximity_index
|
||||
KernelVersion: 2.6.37
|
||||
What: /sys/.../iio:deviceX/bufferY/in_voltageY_index
|
||||
What: /sys/.../iio:deviceX/bufferY/in_voltageY_supply_index
|
||||
What: /sys/.../iio:deviceX/bufferY/in_voltageY_i_index
|
||||
@@ -1613,8 +1578,6 @@ Description:
|
||||
Specifies number of seconds in which we compute the steps
|
||||
that occur in order to decide if the consumer is making steps.
|
||||
|
||||
What: /sys/bus/iio/devices/iio:deviceX/buffer/watermark
|
||||
KernelVersion: 4.2
|
||||
What: /sys/bus/iio/devices/iio:deviceX/bufferY/watermark
|
||||
KernelVersion: 5.11
|
||||
Contact: linux-iio@vger.kernel.org
|
||||
@@ -1633,8 +1596,6 @@ Description:
|
||||
the available samples after the timeout expires and thus have a
|
||||
maximum delay guarantee.
|
||||
|
||||
What: /sys/bus/iio/devices/iio:deviceX/buffer/data_available
|
||||
KernelVersion: 4.16
|
||||
What: /sys/bus/iio/devices/iio:deviceX/bufferY/data_available
|
||||
KernelVersion: 5.11
|
||||
Contact: linux-iio@vger.kernel.org
|
||||
|
||||
@@ -1,28 +1,3 @@
|
||||
What: /sys/bus/iio/devices/iio:deviceX/out_altvoltageY_frequency
|
||||
KernelVersion:
|
||||
Contact: linux-iio@vger.kernel.org
|
||||
Description:
|
||||
Stores the PLL frequency in Hz for channel Y.
|
||||
Reading returns the actual frequency in Hz.
|
||||
The ADF4371 has an integrated VCO with fundamendal output
|
||||
frequency ranging from 4000000000 Hz 8000000000 Hz.
|
||||
|
||||
out_altvoltage0_frequency:
|
||||
A divide by 1, 2, 4, 8, 16, 32 or circuit generates
|
||||
frequencies from 62500000 Hz to 8000000000 Hz.
|
||||
out_altvoltage1_frequency:
|
||||
This channel duplicates the channel 0 frequency
|
||||
out_altvoltage2_frequency:
|
||||
A frequency doubler generates frequencies from
|
||||
8000000000 Hz to 16000000000 Hz.
|
||||
out_altvoltage3_frequency:
|
||||
A frequency quadrupler generates frequencies from
|
||||
16000000000 Hz to 32000000000 Hz.
|
||||
|
||||
Note: writes to one of the channels will affect the frequency of
|
||||
all the other channels, since it involves changing the VCO
|
||||
fundamental output frequency.
|
||||
|
||||
What: /sys/bus/iio/devices/iio:deviceX/out_altvoltageY_name
|
||||
KernelVersion:
|
||||
Contact: linux-iio@vger.kernel.org
|
||||
@@ -34,11 +9,3 @@ Description:
|
||||
out_altvoltage2_name: RF16x
|
||||
out_altvoltage3_name: RF32x
|
||||
|
||||
What: /sys/bus/iio/devices/iio:deviceX/out_altvoltageY_powerdown
|
||||
KernelVersion:
|
||||
Contact: linux-iio@vger.kernel.org
|
||||
Description:
|
||||
This attribute allows the user to power down the PLL and it's
|
||||
RFOut buffers.
|
||||
Writing 1 causes the specified channel to power down.
|
||||
Clearing returns to normal operation.
|
||||
|
||||
@@ -18,6 +18,8 @@ Description:
|
||||
respectively which simply helper channels containing the
|
||||
calculated difference in the value of stage 1 - 2 and 3 - 4.
|
||||
The values are expressed in 24-bit twos complement.
|
||||
The LED current for the stage is controlled via
|
||||
out_currentY_raw.
|
||||
|
||||
What: /sys/bus/iio/devices/iio:deviceX/in_intensityY_offset
|
||||
Date: May 2016
|
||||
@@ -35,11 +37,3 @@ Contact: Andrew F. Davis <afd@ti.com>
|
||||
Description:
|
||||
Get and set the resistance and the capacitance settings for the
|
||||
Transimpedance Amplifier during the associated stage.
|
||||
|
||||
What: /sys/bus/iio/devices/iio:deviceX/out_currentY_raw
|
||||
Date: May 2016
|
||||
KernelVersion:
|
||||
Contact: Andrew F. Davis <afd@ti.com>
|
||||
Description:
|
||||
Get and set the LED current for the specified LED active during
|
||||
this stage. Y is the specific stage number.
|
||||
|
||||
@@ -1,20 +0,0 @@
|
||||
What: /sys/bus/iio/devices/iio:deviceX/in_accel_x_calibbias
|
||||
What: /sys/bus/iio/devices/iio:deviceX/in_accel_y_calibbias
|
||||
What: /sys/bus/iio/devices/iio:deviceX/in_accel_z_calibbias
|
||||
What: /sys/bus/iio/devices/iio:deviceX/in_anglvel_x_calibbias
|
||||
What: /sys/bus/iio/devices/iio:deviceX/in_anglvel_y_calibbias
|
||||
What: /sys/bus/iio/devices/iio:deviceX/in_anglvel_z_calibbias
|
||||
KernelVersion: 5.8
|
||||
Contact: linux-iio@vger.kernel.org
|
||||
Description:
|
||||
Hardware applied calibration offset (assumed to fix production
|
||||
inaccuracies). Values represent a real physical offset expressed
|
||||
in SI units (m/s^2 for accelerometer and rad/s for gyroscope).
|
||||
|
||||
What: /sys/bus/iio/devices/iio:deviceX/in_accel_calibbias_available
|
||||
What: /sys/bus/iio/devices/iio:deviceX/in_anglvel_calibbias_available
|
||||
KernelVersion: 5.8
|
||||
Contact: linux-iio@vger.kernel.org
|
||||
Description:
|
||||
Range of available values for hardware offset. Values in SI
|
||||
units (m/s^2 for accelerometer and rad/s for gyroscope).
|
||||
@@ -41,14 +41,6 @@ Description:
|
||||
Get the current light zone (0..4) as defined by the
|
||||
in_illuminance0_threshY_{falling,rising} thresholds.
|
||||
|
||||
What: /sys/bus/iio/devices/iio:deviceX/out_currentY_raw
|
||||
Date: May 2012
|
||||
KernelVersion: 3.5
|
||||
Contact: Johan Hovold <jhovold@gmail.com>
|
||||
Description:
|
||||
Get output current for channel Y (0..255), that is,
|
||||
out_currentY_currentZ_raw, where Z is the current zone.
|
||||
|
||||
What: /sys/bus/iio/devices/iio:deviceX/out_currentY_currentZ_raw
|
||||
Date: May 2012
|
||||
KernelVersion: 3.5
|
||||
@@ -59,3 +51,6 @@ Description:
|
||||
|
||||
These values correspond to the ALS-mapper target registers for
|
||||
ALS-mapper Y + 1.
|
||||
|
||||
Note that out_currentY_raw provides the current for the
|
||||
current zone.
|
||||
|
||||
@@ -39,9 +39,11 @@ KernelVersion: v5.9
|
||||
Contact: linuxppc-dev <linuxppc-dev@lists.ozlabs.org>, nvdimm@lists.linux.dev,
|
||||
Description:
|
||||
(RO) Report various performance stats related to papr-scm NVDIMM
|
||||
device. Each stat is reported on a new line with each line
|
||||
composed of a stat-identifier followed by it value. Below are
|
||||
currently known dimm performance stats which are reported:
|
||||
device. This attribute is only available for NVDIMM devices
|
||||
that support reporting NVDIMM performance stats. Each stat is
|
||||
reported on a new line with each line composed of a
|
||||
stat-identifier followed by it value. Below are currently known
|
||||
dimm performance stats which are reported:
|
||||
|
||||
* "CtlResCt" : Controller Reset Count
|
||||
* "CtlResTm" : Controller Reset Elapsed Time
|
||||
|
||||
31
Documentation/ABI/testing/sysfs-bus-spi-devices-spi-nor
Normal file
31
Documentation/ABI/testing/sysfs-bus-spi-devices-spi-nor
Normal file
@@ -0,0 +1,31 @@
|
||||
What: /sys/bus/spi/devices/.../spi-nor/jedec_id
|
||||
Date: April 2021
|
||||
KernelVersion: 5.14
|
||||
Contact: linux-mtd@lists.infradead.org
|
||||
Description: (RO) The JEDEC ID of the SPI NOR flash as reported by the
|
||||
flash device.
|
||||
|
||||
|
||||
What: /sys/bus/spi/devices/.../spi-nor/manufacturer
|
||||
Date: April 2021
|
||||
KernelVersion: 5.14
|
||||
Contact: linux-mtd@lists.infradead.org
|
||||
Description: (RO) Manufacturer of the SPI NOR flash.
|
||||
|
||||
|
||||
What: /sys/bus/spi/devices/.../spi-nor/partname
|
||||
Date: April 2021
|
||||
KernelVersion: 5.14
|
||||
Contact: linux-mtd@lists.infradead.org
|
||||
Description: (RO) Part name of the SPI NOR flash.
|
||||
|
||||
|
||||
What: /sys/bus/spi/devices/.../spi-nor/sfdp
|
||||
Date: April 2021
|
||||
KernelVersion: 5.14
|
||||
Contact: linux-mtd@lists.infradead.org
|
||||
Description: (RO) This attribute is only present if the SPI NOR flash
|
||||
device supports the "Read SFDP" command (5Ah).
|
||||
|
||||
If present, it contains the complete SFDP (serial flash
|
||||
discoverable parameters) binary data of the flash.
|
||||
@@ -1,4 +1,4 @@
|
||||
What: /sys/bus/thunderbolt/devices/.../domainX/boot_acl
|
||||
What: /sys/bus/thunderbolt/devices/.../domainX/boot_acl
|
||||
Date: Jun 2018
|
||||
KernelVersion: 4.17
|
||||
Contact: thunderbolt-software@lists.01.org
|
||||
@@ -21,7 +21,7 @@ Description: Holds a comma separated list of device unique_ids that
|
||||
If a device is authorized automatically during boot its
|
||||
boot attribute is set to 1.
|
||||
|
||||
What: /sys/bus/thunderbolt/devices/.../domainX/deauthorization
|
||||
What: /sys/bus/thunderbolt/devices/.../domainX/deauthorization
|
||||
Date: May 2021
|
||||
KernelVersion: 5.12
|
||||
Contact: Mika Westerberg <mika.westerberg@linux.intel.com>
|
||||
@@ -30,7 +30,7 @@ Description: This attribute tells whether the system supports
|
||||
de-authorize PCIe tunnel by writing 0 to authorized
|
||||
attribute under each device.
|
||||
|
||||
What: /sys/bus/thunderbolt/devices/.../domainX/iommu_dma_protection
|
||||
What: /sys/bus/thunderbolt/devices/.../domainX/iommu_dma_protection
|
||||
Date: Mar 2019
|
||||
KernelVersion: 4.21
|
||||
Contact: thunderbolt-software@lists.01.org
|
||||
@@ -39,7 +39,7 @@ Description: This attribute tells whether the system uses IOMMU
|
||||
it is not (DMA protection is solely based on Thunderbolt
|
||||
security levels).
|
||||
|
||||
What: /sys/bus/thunderbolt/devices/.../domainX/security
|
||||
What: /sys/bus/thunderbolt/devices/.../domainX/security
|
||||
Date: Sep 2017
|
||||
KernelVersion: 4.13
|
||||
Contact: thunderbolt-software@lists.01.org
|
||||
@@ -61,7 +61,7 @@ Description: This attribute holds current Thunderbolt security level
|
||||
the BIOS.
|
||||
======= ==================================================
|
||||
|
||||
What: /sys/bus/thunderbolt/devices/.../authorized
|
||||
What: /sys/bus/thunderbolt/devices/.../authorized
|
||||
Date: Sep 2017
|
||||
KernelVersion: 4.13
|
||||
Contact: thunderbolt-software@lists.01.org
|
||||
@@ -95,14 +95,14 @@ Description: This attribute is used to authorize Thunderbolt devices
|
||||
EKEYREJECTED if the challenge response did not match.
|
||||
== ========================================================
|
||||
|
||||
What: /sys/bus/thunderbolt/devices/.../boot
|
||||
What: /sys/bus/thunderbolt/devices/.../boot
|
||||
Date: Jun 2018
|
||||
KernelVersion: 4.17
|
||||
Contact: thunderbolt-software@lists.01.org
|
||||
Description: This attribute contains 1 if Thunderbolt device was already
|
||||
authorized on boot and 0 otherwise.
|
||||
|
||||
What: /sys/bus/thunderbolt/devices/.../generation
|
||||
What: /sys/bus/thunderbolt/devices/.../generation
|
||||
Date: Jan 2020
|
||||
KernelVersion: 5.5
|
||||
Contact: Christian Kellner <christian@kellner.me>
|
||||
@@ -110,7 +110,7 @@ Description: This attribute contains the generation of the Thunderbolt
|
||||
controller associated with the device. It will contain 4
|
||||
for USB4.
|
||||
|
||||
What: /sys/bus/thunderbolt/devices/.../key
|
||||
What: /sys/bus/thunderbolt/devices/.../key
|
||||
Date: Sep 2017
|
||||
KernelVersion: 4.13
|
||||
Contact: thunderbolt-software@lists.01.org
|
||||
@@ -213,12 +213,15 @@ Description: When new NVM image is written to the non-active NVM
|
||||
restarted with the new NVM firmware. If the image
|
||||
verification fails an error code is returned instead.
|
||||
|
||||
This file will accept writing values "1" or "2"
|
||||
This file will accept writing values "1", "2" or "3".
|
||||
|
||||
- Writing "1" will flush the image to the storage
|
||||
area and authenticate the image in one action.
|
||||
- Writing "2" will run some basic validation on the image
|
||||
and flush it to the storage area.
|
||||
- Writing "3" will authenticate the image that is
|
||||
currently written in the storage area. This is only
|
||||
supported with USB4 devices and retimers.
|
||||
|
||||
When read holds status of the last authentication
|
||||
operation if an error occurred during the process. This
|
||||
@@ -226,6 +229,20 @@ Description: When new NVM image is written to the non-active NVM
|
||||
based mailbox before the device is power cycled. Writing
|
||||
0 here clears the status.
|
||||
|
||||
What: /sys/bus/thunderbolt/devices/.../nvm_authenticate_on_disconnect
|
||||
Date: Oct 2020
|
||||
KernelVersion: v5.9
|
||||
Contact: Mario Limonciello <mario.limonciello@dell.com>
|
||||
Description: For supported devices, automatically authenticate the new Thunderbolt
|
||||
image when the device is disconnected from the host system.
|
||||
|
||||
This file will accept writing values "1" or "2"
|
||||
|
||||
- Writing "1" will flush the image to the storage
|
||||
area and prepare the device for authentication on disconnect.
|
||||
- Writing "2" will run some basic validation on the image
|
||||
and flush it to the storage area.
|
||||
|
||||
What: /sys/bus/thunderbolt/devices/<xdomain>.<service>/key
|
||||
Date: Jan 2018
|
||||
KernelVersion: 4.15
|
||||
@@ -276,6 +293,39 @@ Contact: thunderbolt-software@lists.01.org
|
||||
Description: This contains XDomain service specific settings as
|
||||
bitmask. Format: %x
|
||||
|
||||
What: /sys/bus/thunderbolt/devices/usb4_portX/link
|
||||
Date: Sep 2021
|
||||
KernelVersion: v5.14
|
||||
Contact: Mika Westerberg <mika.westerberg@linux.intel.com>
|
||||
Description: Returns the current link mode. Possible values are
|
||||
"usb4", "tbt" and "none".
|
||||
|
||||
What: /sys/bus/thunderbolt/devices/usb4_portX/offline
|
||||
Date: Sep 2021
|
||||
KernelVersion: v5.14
|
||||
Contact: Rajmohan Mani <rajmohan.mani@intel.com>
|
||||
Description: Writing 1 to this attribute puts the USB4 port into
|
||||
offline mode. Only allowed when there is nothing
|
||||
connected to the port (link attribute returns "none").
|
||||
Once the port is in offline mode it does not receive any
|
||||
hotplug events. This is used to update NVM firmware of
|
||||
on-board retimers. Writing 0 puts the port back to
|
||||
online mode.
|
||||
|
||||
This attribute is only visible if the platform supports
|
||||
powering on retimers when there is no cable connected.
|
||||
|
||||
What: /sys/bus/thunderbolt/devices/usb4_portX/rescan
|
||||
Date: Sep 2021
|
||||
KernelVersion: v5.14
|
||||
Contact: Rajmohan Mani <rajmohan.mani@intel.com>
|
||||
Description: When the USB4 port is in offline mode writing 1 to this
|
||||
attribute forces rescan of the sideband for on-board
|
||||
retimers. Each retimer appear under the USB4 port as if
|
||||
the USB4 link was up. These retimers act in the same way
|
||||
as if the cable was connected so upgrading their NVM
|
||||
firmware can be done the usual way.
|
||||
|
||||
What: /sys/bus/thunderbolt/devices/<device>:<port>.<index>/device
|
||||
Date: Oct 2020
|
||||
KernelVersion: v5.9
|
||||
@@ -308,17 +358,3 @@ Date: Oct 2020
|
||||
KernelVersion: v5.9
|
||||
Contact: Mika Westerberg <mika.westerberg@linux.intel.com>
|
||||
Description: Retimer vendor identifier read from the hardware.
|
||||
|
||||
What: /sys/bus/thunderbolt/devices/.../nvm_authenticate_on_disconnect
|
||||
Date: Oct 2020
|
||||
KernelVersion: v5.9
|
||||
Contact: Mario Limonciello <mario.limonciello@dell.com>
|
||||
Description: For supported devices, automatically authenticate the new Thunderbolt
|
||||
image when the device is disconnected from the host system.
|
||||
|
||||
This file will accept writing values "1" or "2"
|
||||
|
||||
- Writing "1" will flush the image to the storage
|
||||
area and prepare the device for authentication on disconnect.
|
||||
- Writing "2" will run some basic validation on the image
|
||||
and flush it to the storage area.
|
||||
|
||||
@@ -154,17 +154,6 @@ Description:
|
||||
files hold a string value (enable or disable) indicating whether
|
||||
or not USB3 hardware LPM U1 or U2 is enabled for the device.
|
||||
|
||||
What: /sys/bus/usb/devices/.../removable
|
||||
Date: February 2012
|
||||
Contact: Matthew Garrett <mjg@redhat.com>
|
||||
Description:
|
||||
Some information about whether a given USB device is
|
||||
physically fixed to the platform can be inferred from a
|
||||
combination of hub descriptor bits and platform-specific data
|
||||
such as ACPI. This file will read either "removable" or
|
||||
"fixed" if the information is available, and "unknown"
|
||||
otherwise.
|
||||
|
||||
What: /sys/bus/usb/devices/.../ltm_capable
|
||||
Date: July 2012
|
||||
Contact: Sarah Sharp <sarah.a.sharp@linux.intel.com>
|
||||
|
||||
@@ -197,8 +197,24 @@ Description:
|
||||
Drivers may emit a CHANGE uevent when a password is set or unset
|
||||
userspace may check it again.
|
||||
|
||||
On Dell systems, if Admin password is set, then all BIOS attributes
|
||||
On Dell and Lenovo systems, if Admin password is set, then all BIOS attributes
|
||||
require password validation.
|
||||
On Lenovo systems if you change the Admin password the new password is not active until
|
||||
the next boot.
|
||||
|
||||
Lenovo specific class extensions
|
||||
------------------------------
|
||||
|
||||
On Lenovo systems the following additional settings are available:
|
||||
|
||||
lenovo_encoding:
|
||||
The encoding method that is used. This can be either "ascii"
|
||||
or "scancode". Default is set to "ascii"
|
||||
|
||||
lenovo_kbdlang:
|
||||
The keyboard language method that is used. This is generally a
|
||||
two char code (e.g. "us", "fr", "gr") and may vary per platform.
|
||||
Default is set to "us"
|
||||
|
||||
What: /sys/class/firmware-attributes/*/attributes/pending_reboot
|
||||
Date: February 2021
|
||||
|
||||
19
Documentation/ABI/testing/sysfs-class-spi-eeprom
Normal file
19
Documentation/ABI/testing/sysfs-class-spi-eeprom
Normal file
@@ -0,0 +1,19 @@
|
||||
What: /sys/class/spi_master/spi<bus>/spi<bus>.<dev>/fram
|
||||
Date: June 2021
|
||||
KernelVersion: 5.14
|
||||
Contact: Jiri Prchal <jiri.prchal@aksignal.cz>
|
||||
Description:
|
||||
Contains the FRAM binary data. Same as EEPROM, just another file
|
||||
name to indicate that it employs ferroelectric process.
|
||||
It performs write operations at bus speed - no write delays.
|
||||
|
||||
What: /sys/class/spi_master/spi<bus>/spi<bus>.<dev>/sernum
|
||||
Date: May 2021
|
||||
KernelVersion: 5.14
|
||||
Contact: Jiri Prchal <jiri.prchal@aksignal.cz>
|
||||
Description:
|
||||
Contains the serial number of the Cypress FRAM (FM25VN) if it is
|
||||
present. It will be displayed as a 8 byte hex string, as read
|
||||
from the device.
|
||||
|
||||
This is a read-only attribute.
|
||||
78
Documentation/ABI/testing/sysfs-devices-platform-soc-ipa
Normal file
78
Documentation/ABI/testing/sysfs-devices-platform-soc-ipa
Normal file
@@ -0,0 +1,78 @@
|
||||
What: /sys/devices/platform/soc@X/XXXXXXX.ipa/
|
||||
Date: June 2021
|
||||
KernelVersion: v5.14
|
||||
Contact: Alex Elder <elder@kernel.org>
|
||||
Description:
|
||||
The /sys/devices/platform/soc@X/XXXXXXX.ipa/ directory
|
||||
contains read-only attributes exposing information about
|
||||
an IPA device. The X values could vary, but are typically
|
||||
"soc@0/1e40000.ipa".
|
||||
|
||||
What: .../XXXXXXX.ipa/version
|
||||
Date: June 2021
|
||||
KernelVersion: v5.14
|
||||
Contact: Alex Elder <elder@kernel.org>
|
||||
Description:
|
||||
The .../XXXXXXX.ipa/version file contains the IPA hardware
|
||||
version, as a period-separated set of two or three integers
|
||||
(e.g., "3.5.1" or "4.2").
|
||||
|
||||
What: .../XXXXXXX.ipa/feature/
|
||||
Date: June 2021
|
||||
KernelVersion: v5.14
|
||||
Contact: Alex Elder <elder@kernel.org>
|
||||
Description:
|
||||
The .../XXXXXXX.ipa/feature/ directory contains a set of
|
||||
attributes describing features implemented by the IPA
|
||||
hardware.
|
||||
|
||||
What: .../XXXXXXX.ipa/feature/rx_offload
|
||||
Date: June 2021
|
||||
KernelVersion: v5.14
|
||||
Contact: Alex Elder <elder@kernel.org>
|
||||
Description:
|
||||
The .../XXXXXXX.ipa/feature/rx_offload file contains a
|
||||
string indicating the type of receive checksum offload
|
||||
that is supported by the hardware. The possible values
|
||||
are "MAPv4" or "MAPv5".
|
||||
|
||||
What: .../XXXXXXX.ipa/feature/tx_offload
|
||||
Date: June 2021
|
||||
KernelVersion: v5.14
|
||||
Contact: Alex Elder <elder@kernel.org>
|
||||
Description:
|
||||
The .../XXXXXXX.ipa/feature/tx_offload file contains a
|
||||
string indicating the type of transmit checksum offload
|
||||
that is supported by the hardware. The possible values
|
||||
are "MAPv4" or "MAPv5".
|
||||
|
||||
What: .../XXXXXXX.ipa/modem/
|
||||
Date: June 2021
|
||||
KernelVersion: v5.14
|
||||
Contact: Alex Elder <elder@kernel.org>
|
||||
Description:
|
||||
The .../XXXXXXX.ipa/modem/ directory contains a set of
|
||||
attributes describing properties of the modem execution
|
||||
environment reachable by the IPA hardware.
|
||||
|
||||
What: .../XXXXXXX.ipa/modem/rx_endpoint_id
|
||||
Date: June 2021
|
||||
KernelVersion: v5.14
|
||||
Contact: Alex Elder <elder@kernel.org>
|
||||
Description:
|
||||
The .../XXXXXXX.ipa/feature/rx_endpoint_id file contains
|
||||
the AP endpoint ID that receives packets originating from
|
||||
the modem execution environment. The "rx" is from the
|
||||
perspective of the AP; this endpoint is considered an "IPA
|
||||
producer". An endpoint ID is a small unsigned integer.
|
||||
|
||||
What: .../XXXXXXX.ipa/modem/tx_endpoint_id
|
||||
Date: June 2021
|
||||
KernelVersion: v5.14
|
||||
Contact: Alex Elder <elder@kernel.org>
|
||||
Description:
|
||||
The .../XXXXXXX.ipa/feature/tx_endpoint_id file contains
|
||||
the AP endpoint ID used to transmit packets destined for
|
||||
the modem execution environment. The "tx" is from the
|
||||
perspective of the AP; this endpoint is considered an "IPA
|
||||
consumer". An endpoint ID is a small unsigned integer.
|
||||
18
Documentation/ABI/testing/sysfs-devices-removable
Normal file
18
Documentation/ABI/testing/sysfs-devices-removable
Normal file
@@ -0,0 +1,18 @@
|
||||
What: /sys/devices/.../removable
|
||||
Date: May 2021
|
||||
Contact: Rajat Jain <rajatxjain@gmail.com>
|
||||
Description:
|
||||
Information about whether a given device can be removed from the
|
||||
platform by the user. This is determined by its subsystem in a
|
||||
bus / platform-specific way. This attribute is only present for
|
||||
devices that can support determining such information:
|
||||
|
||||
"removable": device can be removed from the platform by the user
|
||||
"fixed": device is fixed to the platform / cannot be removed
|
||||
by the user.
|
||||
"unknown": The information is unavailable / cannot be deduced.
|
||||
|
||||
Currently this is only supported by USB (which infers the
|
||||
information from a combination of hub descriptor bits and
|
||||
platform-specific data such as ACPI) and PCI (which gets this
|
||||
from ACPI / device tree).
|
||||
@@ -995,6 +995,132 @@ Description: This entry shows the target state of an UFS UIC link
|
||||
|
||||
The file is read only.
|
||||
|
||||
What: /sys/bus/platform/drivers/ufshcd/*/monitor/monitor_enable
|
||||
Date: January 2021
|
||||
Contact: Can Guo <cang@codeaurora.org>
|
||||
Description: This file shows the status of performance monitor enablement
|
||||
and it can be used to start/stop the monitor. When the monitor
|
||||
is stopped, the performance data collected is also cleared.
|
||||
|
||||
What: /sys/bus/platform/drivers/ufshcd/*/monitor/monitor_chunk_size
|
||||
Date: January 2021
|
||||
Contact: Can Guo <cang@codeaurora.org>
|
||||
Description: This file tells the monitor to focus on requests transferring
|
||||
data of specific chunk size (in Bytes). 0 means any chunk size.
|
||||
It can only be changed when monitor is disabled.
|
||||
|
||||
What: /sys/bus/platform/drivers/ufshcd/*/monitor/read_total_sectors
|
||||
Date: January 2021
|
||||
Contact: Can Guo <cang@codeaurora.org>
|
||||
Description: This file shows how many sectors (in 512 Bytes) have been
|
||||
sent from device to host after monitor gets started.
|
||||
|
||||
The file is read only.
|
||||
|
||||
What: /sys/bus/platform/drivers/ufshcd/*/monitor/read_total_busy
|
||||
Date: January 2021
|
||||
Contact: Can Guo <cang@codeaurora.org>
|
||||
Description: This file shows how long (in micro seconds) has been spent
|
||||
sending data from device to host after monitor gets started.
|
||||
|
||||
The file is read only.
|
||||
|
||||
What: /sys/bus/platform/drivers/ufshcd/*/monitor/read_nr_requests
|
||||
Date: January 2021
|
||||
Contact: Can Guo <cang@codeaurora.org>
|
||||
Description: This file shows how many read requests have been sent after
|
||||
monitor gets started.
|
||||
|
||||
The file is read only.
|
||||
|
||||
What: /sys/bus/platform/drivers/ufshcd/*/monitor/read_req_latency_max
|
||||
Date: January 2021
|
||||
Contact: Can Guo <cang@codeaurora.org>
|
||||
Description: This file shows the maximum latency (in micro seconds) of
|
||||
read requests after monitor gets started.
|
||||
|
||||
The file is read only.
|
||||
|
||||
What: /sys/bus/platform/drivers/ufshcd/*/monitor/read_req_latency_min
|
||||
Date: January 2021
|
||||
Contact: Can Guo <cang@codeaurora.org>
|
||||
Description: This file shows the minimum latency (in micro seconds) of
|
||||
read requests after monitor gets started.
|
||||
|
||||
The file is read only.
|
||||
|
||||
What: /sys/bus/platform/drivers/ufshcd/*/monitor/read_req_latency_avg
|
||||
Date: January 2021
|
||||
Contact: Can Guo <cang@codeaurora.org>
|
||||
Description: This file shows the average latency (in micro seconds) of
|
||||
read requests after monitor gets started.
|
||||
|
||||
The file is read only.
|
||||
|
||||
What: /sys/bus/platform/drivers/ufshcd/*/monitor/read_req_latency_sum
|
||||
Date: January 2021
|
||||
Contact: Can Guo <cang@codeaurora.org>
|
||||
Description: This file shows the total latency (in micro seconds) of
|
||||
read requests sent after monitor gets started.
|
||||
|
||||
The file is read only.
|
||||
|
||||
What: /sys/bus/platform/drivers/ufshcd/*/monitor/write_total_sectors
|
||||
Date: January 2021
|
||||
Contact: Can Guo <cang@codeaurora.org>
|
||||
Description: This file shows how many sectors (in 512 Bytes) have been sent
|
||||
from host to device after monitor gets started.
|
||||
|
||||
The file is read only.
|
||||
|
||||
What: /sys/bus/platform/drivers/ufshcd/*/monitor/write_total_busy
|
||||
Date: January 2021
|
||||
Contact: Can Guo <cang@codeaurora.org>
|
||||
Description: This file shows how long (in micro seconds) has been spent
|
||||
sending data from host to device after monitor gets started.
|
||||
|
||||
The file is read only.
|
||||
|
||||
What: /sys/bus/platform/drivers/ufshcd/*/monitor/write_nr_requests
|
||||
Date: January 2021
|
||||
Contact: Can Guo <cang@codeaurora.org>
|
||||
Description: This file shows how many write requests have been sent after
|
||||
monitor gets started.
|
||||
|
||||
The file is read only.
|
||||
|
||||
What: /sys/bus/platform/drivers/ufshcd/*/monitor/write_req_latency_max
|
||||
Date: January 2021
|
||||
Contact: Can Guo <cang@codeaurora.org>
|
||||
Description: This file shows the maximum latency (in micro seconds) of write
|
||||
requests after monitor gets started.
|
||||
|
||||
The file is read only.
|
||||
|
||||
What: /sys/bus/platform/drivers/ufshcd/*/monitor/write_req_latency_min
|
||||
Date: January 2021
|
||||
Contact: Can Guo <cang@codeaurora.org>
|
||||
Description: This file shows the minimum latency (in micro seconds) of write
|
||||
requests after monitor gets started.
|
||||
|
||||
The file is read only.
|
||||
|
||||
What: /sys/bus/platform/drivers/ufshcd/*/monitor/write_req_latency_avg
|
||||
Date: January 2021
|
||||
Contact: Can Guo <cang@codeaurora.org>
|
||||
Description: This file shows the average latency (in micro seconds) of write
|
||||
requests after monitor gets started.
|
||||
|
||||
The file is read only.
|
||||
|
||||
What: /sys/bus/platform/drivers/ufshcd/*/monitor/write_req_latency_sum
|
||||
Date: January 2021
|
||||
Contact: Can Guo <cang@codeaurora.org>
|
||||
Description: This file shows the total latency (in micro seconds) of write
|
||||
requests after monitor gets started.
|
||||
|
||||
The file is read only.
|
||||
|
||||
What: /sys/bus/platform/drivers/ufshcd/*/device_descriptor/wb_presv_us_en
|
||||
Date: June 2020
|
||||
Contact: Asutosh Das <asutoshd@codeaurora.org>
|
||||
|
||||
@@ -56,6 +56,10 @@ Description:
|
||||
- System RAM
|
||||
- ACPI Tables
|
||||
- ACPI Non-volatile Storage
|
||||
- Unusable memory
|
||||
- Persistent Memory (legacy)
|
||||
- Persistent Memory
|
||||
- Soft Reserved
|
||||
- reserved
|
||||
|
||||
Following shell snippet can be used to display that memory
|
||||
|
||||
@@ -203,7 +203,34 @@ Description: Shows total written kbytes issued to disk.
|
||||
What: /sys/fs/f2fs/<disk>/features
|
||||
Date: July 2017
|
||||
Contact: "Jaegeuk Kim" <jaegeuk@kernel.org>
|
||||
Description: Shows all enabled features in current device.
|
||||
Description: <deprecated: should use /sys/fs/f2fs/<disk>/feature_list/
|
||||
Shows all enabled features in current device.
|
||||
Supported features:
|
||||
encryption, blkzoned, extra_attr, projquota, inode_checksum,
|
||||
flexible_inline_xattr, quota_ino, inode_crtime, lost_found,
|
||||
verity, sb_checksum, casefold, readonly, compression, pin_file.
|
||||
|
||||
What: /sys/fs/f2fs/<disk>/feature_list/
|
||||
Date: June 2021
|
||||
Contact: "Jaegeuk Kim" <jaegeuk@kernel.org>
|
||||
Description: Expand /sys/fs/f2fs/<disk>/features to meet sysfs rule.
|
||||
Supported on-disk features:
|
||||
encryption, block_zoned (aka blkzoned), extra_attr,
|
||||
project_quota (aka projquota), inode_checksum,
|
||||
flexible_inline_xattr, quota_ino, inode_crtime, lost_found,
|
||||
verity, sb_checksum, casefold, readonly, compression.
|
||||
Note that, pin_file is moved into /sys/fs/f2fs/features/.
|
||||
|
||||
What: /sys/fs/f2fs/features/
|
||||
Date: July 2017
|
||||
Contact: "Jaegeuk Kim" <jaegeuk@kernel.org>
|
||||
Description: Shows all enabled kernel features.
|
||||
Supported features:
|
||||
encryption, block_zoned, extra_attr, project_quota,
|
||||
inode_checksum, flexible_inline_xattr, quota_ino,
|
||||
inode_crtime, lost_found, verity, sb_checksum,
|
||||
casefold, readonly, compression, test_dummy_encryption_v2,
|
||||
atomic_write, pin_file, encrypted_casefold.
|
||||
|
||||
What: /sys/fs/f2fs/<disk>/inject_rate
|
||||
Date: May 2016
|
||||
@@ -438,3 +465,31 @@ Description: Show the count of inode newly enabled for compression since mount.
|
||||
Note that when the compression is disabled for the files, this count
|
||||
doesn't decrease. If you write "0" here, you can initialize
|
||||
compr_new_inode to "0".
|
||||
|
||||
What: /sys/fs/f2fs/<disk>/atgc_candidate_ratio
|
||||
Date: May 2021
|
||||
Contact: "Chao Yu" <yuchao0@huawei.com>
|
||||
Description: When ATGC is on, it controls candidate ratio in order to limit total
|
||||
number of potential victim in all candidates, the value should be in
|
||||
range of [0, 100], by default it was initialized as 20(%).
|
||||
|
||||
What: /sys/fs/f2fs/<disk>/atgc_candidate_count
|
||||
Date: May 2021
|
||||
Contact: "Chao Yu" <yuchao0@huawei.com>
|
||||
Description: When ATGC is on, it controls candidate count in order to limit total
|
||||
number of potential victim in all candidates, by default it was
|
||||
initialized as 10 (sections).
|
||||
|
||||
What: /sys/fs/f2fs/<disk>/atgc_age_weight
|
||||
Date: May 2021
|
||||
Contact: "Chao Yu" <yuchao0@huawei.com>
|
||||
Description: When ATGC is on, it controls age weight to balance weight proportion
|
||||
in between aging and valid blocks, the value should be in range of
|
||||
[0, 100], by default it was initialized as 60(%).
|
||||
|
||||
What: /sys/fs/f2fs/<disk>/atgc_age_threshold
|
||||
Date: May 2021
|
||||
Contact: "Chao Yu" <yuchao0@huawei.com>
|
||||
Description: When ATGC is on, it controls age threshold to bypass GCing young
|
||||
candidates whose age is not beyond the threshold, by default it was
|
||||
initialized as 604800 seconds (equals to 7 days).
|
||||
|
||||
55
Documentation/ABI/testing/sysfs-platform-dell-privacy-wmi
Normal file
55
Documentation/ABI/testing/sysfs-platform-dell-privacy-wmi
Normal file
@@ -0,0 +1,55 @@
|
||||
What: /sys/bus/wmi/devices/6932965F-1671-4CEB-B988-D3AB0A901919/dell_privacy_supported_type
|
||||
Date: Apr 2021
|
||||
KernelVersion: 5.13
|
||||
Contact: "perry.yuan@dell.com>"
|
||||
Description:
|
||||
Display which dell hardware level privacy devices are supported
|
||||
“Dell Privacy” is a set of HW, FW, and SW features to enhance
|
||||
Dell’s commitment to platform privacy for MIC, Camera, and
|
||||
ePrivacy screens.
|
||||
The supported hardware privacy devices are:
|
||||
Attributes:
|
||||
Microphone Mute:
|
||||
Identifies the local microphone can be muted by hardware, no applications
|
||||
is available to capture system mic sound
|
||||
|
||||
Camera Shutter:
|
||||
Identifies camera shutter controlled by hardware, which is a micromechanical
|
||||
shutter assembly that is built onto the camera module to block capturing images
|
||||
from outside the laptop
|
||||
|
||||
supported:
|
||||
The privacy device is supported by this system
|
||||
|
||||
unsupported:
|
||||
The privacy device is not supported on this system
|
||||
|
||||
For example to check which privacy devices are supported:
|
||||
|
||||
# cat /sys/bus/wmi/drivers/dell-privacy/6932965F-1671-4CEB-B988-D3AB0A901919/dell_privacy_supported_type
|
||||
[Microphone Mute] [supported]
|
||||
[Camera Shutter] [supported]
|
||||
[ePrivacy Screen] [unsupported]
|
||||
|
||||
What: /sys/bus/wmi/devices/6932965F-1671-4CEB-B988-D3AB0A901919/dell_privacy_current_state
|
||||
Date: Apr 2021
|
||||
KernelVersion: 5.13
|
||||
Contact: "perry.yuan@dell.com>"
|
||||
Description:
|
||||
Allow user space to check current dell privacy device state.
|
||||
Describes the Device State class exposed by BIOS which can be
|
||||
consumed by various applications interested in knowing the Privacy
|
||||
feature capabilities
|
||||
Attributes:
|
||||
muted:
|
||||
Identifies the privacy device is turned off and cannot send stream to OS applications
|
||||
|
||||
unmuted:
|
||||
Identifies the privacy device is turned on ,audio or camera driver can get
|
||||
stream from mic and camera module to OS applications
|
||||
|
||||
For example to check all supported current privacy device states:
|
||||
|
||||
# cat /sys/bus/wmi/drivers/dell-privacy/6932965F-1671-4CEB-B988-D3AB0A901919/dell_privacy_current_state
|
||||
[Microphone] [unmuted]
|
||||
[Camera Shutter] [unmuted]
|
||||
@@ -295,7 +295,7 @@ and let the driver restart normal I/O processing.
|
||||
A driver can still return a critical failure for this function if
|
||||
it can't get the device operational after reset. If the platform
|
||||
previously tried a soft reset, it might now try a hard reset (power
|
||||
cycle) and then call slot_reset() again. It the device still can't
|
||||
cycle) and then call slot_reset() again. If the device still can't
|
||||
be recovered, there is nothing more that can be done; the platform
|
||||
will typically report a "permanent failure" in such a case. The
|
||||
device will be considered "dead" in this case.
|
||||
|
||||
@@ -21,7 +21,7 @@ Any code that happens after the end of a given RCU grace period is guaranteed
|
||||
to see the effects of all accesses prior to the beginning of that grace
|
||||
period that are within RCU read-side critical sections.
|
||||
Similarly, any code that happens before the beginning of a given RCU grace
|
||||
period is guaranteed to see the effects of all accesses following the end
|
||||
period is guaranteed to not see the effects of all accesses following the end
|
||||
of that grace period that are within RCU read-side critical sections.
|
||||
|
||||
Note well that RCU-sched read-side critical sections include any region
|
||||
@@ -339,14 +339,14 @@ The diagram below shows the path of ordering if the leftmost
|
||||
leftmost ``rcu_node`` structure offlines its last CPU and if the next
|
||||
``rcu_node`` structure has no online CPUs).
|
||||
|
||||
.. kernel-figure:: TreeRCU-gp-init-1.svg
|
||||
.. kernel-figure:: TreeRCU-gp-init-2.svg
|
||||
|
||||
The final ``rcu_gp_init()`` pass through the ``rcu_node`` tree traverses
|
||||
breadth-first, setting each ``rcu_node`` structure's ``->gp_seq`` field
|
||||
to the newly advanced value from the ``rcu_state`` structure, as shown
|
||||
in the following diagram.
|
||||
|
||||
.. kernel-figure:: TreeRCU-gp-init-1.svg
|
||||
.. kernel-figure:: TreeRCU-gp-init-3.svg
|
||||
|
||||
This change will also cause each CPU's next call to
|
||||
``__note_gp_changes()`` to notice that a new grace period has started,
|
||||
|
||||
@@ -211,27 +211,40 @@ over a rather long period of time, but improvements are always welcome!
|
||||
of the system, especially to real-time workloads running on
|
||||
the rest of the system.
|
||||
|
||||
7. As of v4.20, a given kernel implements only one RCU flavor,
|
||||
which is RCU-sched for PREEMPTION=n and RCU-preempt for PREEMPTION=y.
|
||||
If the updater uses call_rcu() or synchronize_rcu(),
|
||||
then the corresponding readers may use rcu_read_lock() and
|
||||
rcu_read_unlock(), rcu_read_lock_bh() and rcu_read_unlock_bh(),
|
||||
or any pair of primitives that disables and re-enables preemption,
|
||||
for example, rcu_read_lock_sched() and rcu_read_unlock_sched().
|
||||
If the updater uses synchronize_srcu() or call_srcu(),
|
||||
then the corresponding readers must use srcu_read_lock() and
|
||||
srcu_read_unlock(), and with the same srcu_struct. The rules for
|
||||
the expedited primitives are the same as for their non-expedited
|
||||
counterparts. Mixing things up will result in confusion and
|
||||
broken kernels, and has even resulted in an exploitable security
|
||||
issue.
|
||||
7. As of v4.20, a given kernel implements only one RCU flavor, which
|
||||
is RCU-sched for PREEMPTION=n and RCU-preempt for PREEMPTION=y.
|
||||
If the updater uses call_rcu() or synchronize_rcu(), then
|
||||
the corresponding readers may use: (1) rcu_read_lock() and
|
||||
rcu_read_unlock(), (2) any pair of primitives that disables
|
||||
and re-enables softirq, for example, rcu_read_lock_bh() and
|
||||
rcu_read_unlock_bh(), or (3) any pair of primitives that disables
|
||||
and re-enables preemption, for example, rcu_read_lock_sched() and
|
||||
rcu_read_unlock_sched(). If the updater uses synchronize_srcu()
|
||||
or call_srcu(), then the corresponding readers must use
|
||||
srcu_read_lock() and srcu_read_unlock(), and with the same
|
||||
srcu_struct. The rules for the expedited RCU grace-period-wait
|
||||
primitives are the same as for their non-expedited counterparts.
|
||||
|
||||
One exception to this rule: rcu_read_lock() and rcu_read_unlock()
|
||||
may be substituted for rcu_read_lock_bh() and rcu_read_unlock_bh()
|
||||
in cases where local bottom halves are already known to be
|
||||
disabled, for example, in irq or softirq context. Commenting
|
||||
such cases is a must, of course! And the jury is still out on
|
||||
whether the increased speed is worth it.
|
||||
If the updater uses call_rcu_tasks() or synchronize_rcu_tasks(),
|
||||
then the readers must refrain from executing voluntary
|
||||
context switches, that is, from blocking. If the updater uses
|
||||
call_rcu_tasks_trace() or synchronize_rcu_tasks_trace(), then
|
||||
the corresponding readers must use rcu_read_lock_trace() and
|
||||
rcu_read_unlock_trace(). If an updater uses call_rcu_tasks_rude()
|
||||
or synchronize_rcu_tasks_rude(), then the corresponding readers
|
||||
must use anything that disables interrupts.
|
||||
|
||||
Mixing things up will result in confusion and broken kernels, and
|
||||
has even resulted in an exploitable security issue. Therefore,
|
||||
when using non-obvious pairs of primitives, commenting is
|
||||
of course a must. One example of non-obvious pairing is
|
||||
the XDP feature in networking, which calls BPF programs from
|
||||
network-driver NAPI (softirq) context. BPF relies heavily on RCU
|
||||
protection for its data structures, but because the BPF program
|
||||
invocation happens entirely within a single local_bh_disable()
|
||||
section in a NAPI poll cycle, this usage is safe. The reason
|
||||
that this usage is safe is that readers can use anything that
|
||||
disables BH when updaters use call_rcu() or synchronize_rcu().
|
||||
|
||||
8. Although synchronize_rcu() is slower than is call_rcu(), it
|
||||
usually results in simpler code. So, unless update performance is
|
||||
|
||||
@@ -89,13 +89,35 @@ you can use ``+=`` operator. For example::
|
||||
|
||||
In this case, the key ``foo`` has ``bar``, ``baz`` and ``qux``.
|
||||
|
||||
However, a sub-key and a value can not co-exist under a parent key.
|
||||
For example, following config is NOT allowed.::
|
||||
Moreover, sub-keys and a value can coexist under a parent key.
|
||||
For example, following config is allowed.::
|
||||
|
||||
foo = value1
|
||||
foo.bar = value2 # !ERROR! subkey "bar" and value "value1" can NOT co-exist
|
||||
foo.bar := value2 # !ERROR! even with the override operator, this is NOT allowed.
|
||||
foo.bar = value2
|
||||
foo := value3 # This will update foo's value.
|
||||
|
||||
Note, since there is no syntax to put a raw value directly under a
|
||||
structured key, you have to define it outside of the brace. For example::
|
||||
|
||||
foo {
|
||||
bar = value1
|
||||
bar {
|
||||
baz = value2
|
||||
qux = value3
|
||||
}
|
||||
}
|
||||
|
||||
Also, the order of the value node under a key is fixed. If there
|
||||
are a value and subkeys, the value is always the first child node
|
||||
of the key. Thus if user specifies subkeys first, e.g.::
|
||||
|
||||
foo.bar = value1
|
||||
foo = value2
|
||||
|
||||
In the program (and /proc/bootconfig), it will be shown as below::
|
||||
|
||||
foo = value2
|
||||
foo.bar = value1
|
||||
|
||||
Comments
|
||||
--------
|
||||
|
||||
@@ -17,36 +17,37 @@ level logical devices like device mapper.
|
||||
|
||||
HOWTO
|
||||
=====
|
||||
|
||||
Throttling/Upper Limit policy
|
||||
-----------------------------
|
||||
- Enable Block IO controller::
|
||||
Enable Block IO controller::
|
||||
|
||||
CONFIG_BLK_CGROUP=y
|
||||
|
||||
- Enable throttling in block layer::
|
||||
Enable throttling in block layer::
|
||||
|
||||
CONFIG_BLK_DEV_THROTTLING=y
|
||||
|
||||
- Mount blkio controller (see cgroups.txt, Why are cgroups needed?)::
|
||||
Mount blkio controller (see cgroups.txt, Why are cgroups needed?)::
|
||||
|
||||
mount -t cgroup -o blkio none /sys/fs/cgroup/blkio
|
||||
|
||||
- Specify a bandwidth rate on particular device for root group. The format
|
||||
for policy is "<major>:<minor> <bytes_per_second>"::
|
||||
Specify a bandwidth rate on particular device for root group. The format
|
||||
for policy is "<major>:<minor> <bytes_per_second>"::
|
||||
|
||||
echo "8:16 1048576" > /sys/fs/cgroup/blkio/blkio.throttle.read_bps_device
|
||||
|
||||
Above will put a limit of 1MB/second on reads happening for root group
|
||||
on device having major/minor number 8:16.
|
||||
This will put a limit of 1MB/second on reads happening for root group
|
||||
on device having major/minor number 8:16.
|
||||
|
||||
- Run dd to read a file and see if rate is throttled to 1MB/s or not::
|
||||
Run dd to read a file and see if rate is throttled to 1MB/s or not::
|
||||
|
||||
# dd iflag=direct if=/mnt/common/zerofile of=/dev/null bs=4K count=1024
|
||||
1024+0 records in
|
||||
1024+0 records out
|
||||
4194304 bytes (4.2 MB) copied, 4.0001 s, 1.0 MB/s
|
||||
|
||||
Limits for writes can be put using blkio.throttle.write_bps_device file.
|
||||
Limits for writes can be put using blkio.throttle.write_bps_device file.
|
||||
|
||||
Hierarchical Cgroups
|
||||
====================
|
||||
@@ -79,85 +80,89 @@ following::
|
||||
|
||||
Various user visible config options
|
||||
===================================
|
||||
CONFIG_BLK_CGROUP
|
||||
- Block IO controller.
|
||||
|
||||
CONFIG_BFQ_CGROUP_DEBUG
|
||||
- Debug help. Right now some additional stats file show up in cgroup
|
||||
CONFIG_BLK_CGROUP
|
||||
Block IO controller.
|
||||
|
||||
CONFIG_BFQ_CGROUP_DEBUG
|
||||
Debug help. Right now some additional stats file show up in cgroup
|
||||
if this option is enabled.
|
||||
|
||||
CONFIG_BLK_DEV_THROTTLING
|
||||
- Enable block device throttling support in block layer.
|
||||
CONFIG_BLK_DEV_THROTTLING
|
||||
Enable block device throttling support in block layer.
|
||||
|
||||
Details of cgroup files
|
||||
=======================
|
||||
|
||||
Proportional weight policy files
|
||||
--------------------------------
|
||||
- blkio.weight
|
||||
- Specifies per cgroup weight. This is default weight of the group
|
||||
on all the devices until and unless overridden by per device rule.
|
||||
(See blkio.weight_device).
|
||||
Currently allowed range of weights is from 10 to 1000.
|
||||
|
||||
- blkio.weight_device
|
||||
- One can specify per cgroup per device rules using this interface.
|
||||
These rules override the default value of group weight as specified
|
||||
by blkio.weight.
|
||||
blkio.bfq.weight
|
||||
Specifies per cgroup weight. This is default weight of the group
|
||||
on all the devices until and unless overridden by per device rule
|
||||
(see `blkio.bfq.weight_device` below).
|
||||
|
||||
Currently allowed range of weights is from 1 to 1000. For more details,
|
||||
see Documentation/block/bfq-iosched.rst.
|
||||
|
||||
blkio.bfq.weight_device
|
||||
Specifes per cgroup per device weights, overriding the default group
|
||||
weight. For more details, see Documentation/block/bfq-iosched.rst.
|
||||
|
||||
Following is the format::
|
||||
|
||||
# echo dev_maj:dev_minor weight > blkio.weight_device
|
||||
# echo dev_maj:dev_minor weight > blkio.bfq.weight_device
|
||||
|
||||
Configure weight=300 on /dev/sdb (8:16) in this cgroup::
|
||||
|
||||
# echo 8:16 300 > blkio.weight_device
|
||||
# cat blkio.weight_device
|
||||
# echo 8:16 300 > blkio.bfq.weight_device
|
||||
# cat blkio.bfq.weight_device
|
||||
dev weight
|
||||
8:16 300
|
||||
|
||||
Configure weight=500 on /dev/sda (8:0) in this cgroup::
|
||||
|
||||
# echo 8:0 500 > blkio.weight_device
|
||||
# cat blkio.weight_device
|
||||
# echo 8:0 500 > blkio.bfq.weight_device
|
||||
# cat blkio.bfq.weight_device
|
||||
dev weight
|
||||
8:0 500
|
||||
8:16 300
|
||||
|
||||
Remove specific weight for /dev/sda in this cgroup::
|
||||
|
||||
# echo 8:0 0 > blkio.weight_device
|
||||
# cat blkio.weight_device
|
||||
# echo 8:0 0 > blkio.bfq.weight_device
|
||||
# cat blkio.bfq.weight_device
|
||||
dev weight
|
||||
8:16 300
|
||||
|
||||
- blkio.time
|
||||
- disk time allocated to cgroup per device in milliseconds. First
|
||||
blkio.time
|
||||
Disk time allocated to cgroup per device in milliseconds. First
|
||||
two fields specify the major and minor number of the device and
|
||||
third field specifies the disk time allocated to group in
|
||||
milliseconds.
|
||||
|
||||
- blkio.sectors
|
||||
- number of sectors transferred to/from disk by the group. First
|
||||
blkio.sectors
|
||||
Number of sectors transferred to/from disk by the group. First
|
||||
two fields specify the major and minor number of the device and
|
||||
third field specifies the number of sectors transferred by the
|
||||
group to/from the device.
|
||||
|
||||
- blkio.io_service_bytes
|
||||
- Number of bytes transferred to/from the disk by the group. These
|
||||
blkio.io_service_bytes
|
||||
Number of bytes transferred to/from the disk by the group. These
|
||||
are further divided by the type of operation - read or write, sync
|
||||
or async. First two fields specify the major and minor number of the
|
||||
device, third field specifies the operation type and the fourth field
|
||||
specifies the number of bytes.
|
||||
|
||||
- blkio.io_serviced
|
||||
- Number of IOs (bio) issued to the disk by the group. These
|
||||
blkio.io_serviced
|
||||
Number of IOs (bio) issued to the disk by the group. These
|
||||
are further divided by the type of operation - read or write, sync
|
||||
or async. First two fields specify the major and minor number of the
|
||||
device, third field specifies the operation type and the fourth field
|
||||
specifies the number of IOs.
|
||||
|
||||
- blkio.io_service_time
|
||||
- Total amount of time between request dispatch and request completion
|
||||
blkio.io_service_time
|
||||
Total amount of time between request dispatch and request completion
|
||||
for the IOs done by this cgroup. This is in nanoseconds to make it
|
||||
meaningful for flash devices too. For devices with queue depth of 1,
|
||||
this time represents the actual service time. When queue_depth > 1,
|
||||
@@ -170,8 +175,8 @@ Proportional weight policy files
|
||||
specifies the operation type and the fourth field specifies the
|
||||
io_service_time in ns.
|
||||
|
||||
- blkio.io_wait_time
|
||||
- Total amount of time the IOs for this cgroup spent waiting in the
|
||||
blkio.io_wait_time
|
||||
Total amount of time the IOs for this cgroup spent waiting in the
|
||||
scheduler queues for service. This can be greater than the total time
|
||||
elapsed since it is cumulative io_wait_time for all IOs. It is not a
|
||||
measure of total time the cgroup spent waiting but rather a measure of
|
||||
@@ -185,24 +190,24 @@ Proportional weight policy files
|
||||
minor number of the device, third field specifies the operation type
|
||||
and the fourth field specifies the io_wait_time in ns.
|
||||
|
||||
- blkio.io_merged
|
||||
- Total number of bios/requests merged into requests belonging to this
|
||||
blkio.io_merged
|
||||
Total number of bios/requests merged into requests belonging to this
|
||||
cgroup. This is further divided by the type of operation - read or
|
||||
write, sync or async.
|
||||
|
||||
- blkio.io_queued
|
||||
- Total number of requests queued up at any given instant for this
|
||||
blkio.io_queued
|
||||
Total number of requests queued up at any given instant for this
|
||||
cgroup. This is further divided by the type of operation - read or
|
||||
write, sync or async.
|
||||
|
||||
- blkio.avg_queue_size
|
||||
- Debugging aid only enabled if CONFIG_BFQ_CGROUP_DEBUG=y.
|
||||
blkio.avg_queue_size
|
||||
Debugging aid only enabled if CONFIG_BFQ_CGROUP_DEBUG=y.
|
||||
The average queue size for this cgroup over the entire time of this
|
||||
cgroup's existence. Queue size samples are taken each time one of the
|
||||
queues of this cgroup gets a timeslice.
|
||||
|
||||
- blkio.group_wait_time
|
||||
- Debugging aid only enabled if CONFIG_BFQ_CGROUP_DEBUG=y.
|
||||
blkio.group_wait_time
|
||||
Debugging aid only enabled if CONFIG_BFQ_CGROUP_DEBUG=y.
|
||||
This is the amount of time the cgroup had to wait since it became busy
|
||||
(i.e., went from 0 to 1 request queued) to get a timeslice for one of
|
||||
its queues. This is different from the io_wait_time which is the
|
||||
@@ -212,8 +217,8 @@ Proportional weight policy files
|
||||
will only report the group_wait_time accumulated till the last time it
|
||||
got a timeslice and will not include the current delta.
|
||||
|
||||
- blkio.empty_time
|
||||
- Debugging aid only enabled if CONFIG_BFQ_CGROUP_DEBUG=y.
|
||||
blkio.empty_time
|
||||
Debugging aid only enabled if CONFIG_BFQ_CGROUP_DEBUG=y.
|
||||
This is the amount of time a cgroup spends without any pending
|
||||
requests when not being served, i.e., it does not include any time
|
||||
spent idling for one of the queues of the cgroup. This is in
|
||||
@@ -221,8 +226,8 @@ Proportional weight policy files
|
||||
the stat will only report the empty_time accumulated till the last
|
||||
time it had a pending request and will not include the current delta.
|
||||
|
||||
- blkio.idle_time
|
||||
- Debugging aid only enabled if CONFIG_BFQ_CGROUP_DEBUG=y.
|
||||
blkio.idle_time
|
||||
Debugging aid only enabled if CONFIG_BFQ_CGROUP_DEBUG=y.
|
||||
This is the amount of time spent by the IO scheduler idling for a
|
||||
given cgroup in anticipation of a better request than the existing ones
|
||||
from other queues/cgroups. This is in nanoseconds. If this is read
|
||||
@@ -230,60 +235,60 @@ Proportional weight policy files
|
||||
idle_time accumulated till the last idle period and will not include
|
||||
the current delta.
|
||||
|
||||
- blkio.dequeue
|
||||
- Debugging aid only enabled if CONFIG_BFQ_CGROUP_DEBUG=y. This
|
||||
blkio.dequeue
|
||||
Debugging aid only enabled if CONFIG_BFQ_CGROUP_DEBUG=y. This
|
||||
gives the statistics about how many a times a group was dequeued
|
||||
from service tree of the device. First two fields specify the major
|
||||
and minor number of the device and third field specifies the number
|
||||
of times a group was dequeued from a particular device.
|
||||
|
||||
- blkio.*_recursive
|
||||
- Recursive version of various stats. These files show the
|
||||
blkio.*_recursive
|
||||
Recursive version of various stats. These files show the
|
||||
same information as their non-recursive counterparts but
|
||||
include stats from all the descendant cgroups.
|
||||
|
||||
Throttling/Upper limit policy files
|
||||
-----------------------------------
|
||||
- blkio.throttle.read_bps_device
|
||||
- Specifies upper limit on READ rate from the device. IO rate is
|
||||
blkio.throttle.read_bps_device
|
||||
Specifies upper limit on READ rate from the device. IO rate is
|
||||
specified in bytes per second. Rules are per device. Following is
|
||||
the format::
|
||||
|
||||
echo "<major>:<minor> <rate_bytes_per_second>" > /cgrp/blkio.throttle.read_bps_device
|
||||
|
||||
- blkio.throttle.write_bps_device
|
||||
- Specifies upper limit on WRITE rate to the device. IO rate is
|
||||
blkio.throttle.write_bps_device
|
||||
Specifies upper limit on WRITE rate to the device. IO rate is
|
||||
specified in bytes per second. Rules are per device. Following is
|
||||
the format::
|
||||
|
||||
echo "<major>:<minor> <rate_bytes_per_second>" > /cgrp/blkio.throttle.write_bps_device
|
||||
|
||||
- blkio.throttle.read_iops_device
|
||||
- Specifies upper limit on READ rate from the device. IO rate is
|
||||
blkio.throttle.read_iops_device
|
||||
Specifies upper limit on READ rate from the device. IO rate is
|
||||
specified in IO per second. Rules are per device. Following is
|
||||
the format::
|
||||
|
||||
echo "<major>:<minor> <rate_io_per_second>" > /cgrp/blkio.throttle.read_iops_device
|
||||
|
||||
- blkio.throttle.write_iops_device
|
||||
- Specifies upper limit on WRITE rate to the device. IO rate is
|
||||
blkio.throttle.write_iops_device
|
||||
Specifies upper limit on WRITE rate to the device. IO rate is
|
||||
specified in io per second. Rules are per device. Following is
|
||||
the format::
|
||||
|
||||
echo "<major>:<minor> <rate_io_per_second>" > /cgrp/blkio.throttle.write_iops_device
|
||||
|
||||
Note: If both BW and IOPS rules are specified for a device, then IO is
|
||||
subjected to both the constraints.
|
||||
Note: If both BW and IOPS rules are specified for a device, then IO is
|
||||
subjected to both the constraints.
|
||||
|
||||
- blkio.throttle.io_serviced
|
||||
- Number of IOs (bio) issued to the disk by the group. These
|
||||
blkio.throttle.io_serviced
|
||||
Number of IOs (bio) issued to the disk by the group. These
|
||||
are further divided by the type of operation - read or write, sync
|
||||
or async. First two fields specify the major and minor number of the
|
||||
device, third field specifies the operation type and the fourth field
|
||||
specifies the number of IOs.
|
||||
|
||||
- blkio.throttle.io_service_bytes
|
||||
- Number of bytes transferred to/from the disk by the group. These
|
||||
blkio.throttle.io_service_bytes
|
||||
Number of bytes transferred to/from the disk by the group. These
|
||||
are further divided by the type of operation - read or write, sync
|
||||
or async. First two fields specify the major and minor number of the
|
||||
device, third field specifies the operation type and the fourth field
|
||||
@@ -291,6 +296,6 @@ Note: If both BW and IOPS rules are specified for a device, then IO is
|
||||
|
||||
Common files among various policies
|
||||
-----------------------------------
|
||||
- blkio.reset_stats
|
||||
- Writing an int to this file will result in resetting all the stats
|
||||
blkio.reset_stats
|
||||
Writing an int to this file will result in resetting all the stats
|
||||
for that cgroup.
|
||||
|
||||
@@ -56,6 +56,7 @@ v1 is available under :ref:`Documentation/admin-guide/cgroup-v1/index.rst <cgrou
|
||||
5-3-3. IO Latency
|
||||
5-3-3-1. How IO Latency Throttling Works
|
||||
5-3-3-2. IO Latency Interface Files
|
||||
5-3-4. IO Priority
|
||||
5-4. PID
|
||||
5-4-1. PID Interface Files
|
||||
5-5. Cpuset
|
||||
@@ -952,6 +953,21 @@ All cgroup core files are prefixed with "cgroup."
|
||||
it's possible to delete a frozen (and empty) cgroup, as well as
|
||||
create new sub-cgroups.
|
||||
|
||||
cgroup.kill
|
||||
A write-only single value file which exists in non-root cgroups.
|
||||
The only allowed value is "1".
|
||||
|
||||
Writing "1" to the file causes the cgroup and all descendant cgroups to
|
||||
be killed. This means that all processes located in the affected cgroup
|
||||
tree will be killed via SIGKILL.
|
||||
|
||||
Killing a cgroup tree will deal with concurrent forks appropriately and
|
||||
is protected against migrations.
|
||||
|
||||
In a threaded cgroup, writing this file fails with EOPNOTSUPP as
|
||||
killing cgroups is a process directed operation, i.e. it affects
|
||||
the whole thread-group.
|
||||
|
||||
Controllers
|
||||
===========
|
||||
|
||||
@@ -1866,6 +1882,60 @@ IO Latency Interface Files
|
||||
duration of time between evaluation events. Windows only elapse
|
||||
with IO activity. Idle periods extend the most recent window.
|
||||
|
||||
IO Priority
|
||||
~~~~~~~~~~~
|
||||
|
||||
A single attribute controls the behavior of the I/O priority cgroup policy,
|
||||
namely the blkio.prio.class attribute. The following values are accepted for
|
||||
that attribute:
|
||||
|
||||
no-change
|
||||
Do not modify the I/O priority class.
|
||||
|
||||
none-to-rt
|
||||
For requests that do not have an I/O priority class (NONE),
|
||||
change the I/O priority class into RT. Do not modify
|
||||
the I/O priority class of other requests.
|
||||
|
||||
restrict-to-be
|
||||
For requests that do not have an I/O priority class or that have I/O
|
||||
priority class RT, change it into BE. Do not modify the I/O priority
|
||||
class of requests that have priority class IDLE.
|
||||
|
||||
idle
|
||||
Change the I/O priority class of all requests into IDLE, the lowest
|
||||
I/O priority class.
|
||||
|
||||
The following numerical values are associated with the I/O priority policies:
|
||||
|
||||
+-------------+---+
|
||||
| no-change | 0 |
|
||||
+-------------+---+
|
||||
| none-to-rt | 1 |
|
||||
+-------------+---+
|
||||
| rt-to-be | 2 |
|
||||
+-------------+---+
|
||||
| all-to-idle | 3 |
|
||||
+-------------+---+
|
||||
|
||||
The numerical value that corresponds to each I/O priority class is as follows:
|
||||
|
||||
+-------------------------------+---+
|
||||
| IOPRIO_CLASS_NONE | 0 |
|
||||
+-------------------------------+---+
|
||||
| IOPRIO_CLASS_RT (real-time) | 1 |
|
||||
+-------------------------------+---+
|
||||
| IOPRIO_CLASS_BE (best effort) | 2 |
|
||||
+-------------------------------+---+
|
||||
| IOPRIO_CLASS_IDLE | 3 |
|
||||
+-------------------------------+---+
|
||||
|
||||
The algorithm to set the I/O priority class for a request is as follows:
|
||||
|
||||
- Translate the I/O priority class policy into a number.
|
||||
- Change the request I/O priority class into the maximum of the I/O priority
|
||||
class policy number and the numerical I/O priority class.
|
||||
|
||||
PID
|
||||
---
|
||||
|
||||
|
||||
@@ -12,7 +12,6 @@ first sector should contain valid superblock from previous invocation.
|
||||
Constructor parameters:
|
||||
|
||||
1. type of the cache device - "p" or "s"
|
||||
|
||||
- p - persistent memory
|
||||
- s - SSD
|
||||
2. the underlying device that will be cached
|
||||
@@ -21,7 +20,6 @@ Constructor parameters:
|
||||
size)
|
||||
5. the number of optional parameters (the parameters with an argument
|
||||
count as two)
|
||||
|
||||
start_sector n (default: 0)
|
||||
offset from the start of cache device in 512-byte sectors
|
||||
high_watermark n (default: 50)
|
||||
@@ -53,6 +51,27 @@ Constructor parameters:
|
||||
|
||||
- some underlying devices perform better with fua, some
|
||||
with nofua. The user should test it
|
||||
cleaner
|
||||
when this option is activated (either in the constructor
|
||||
arguments or by a message), the cache will not promote
|
||||
new writes (however, writes to already cached blocks are
|
||||
promoted, to avoid data corruption due to misordered
|
||||
writes) and it will gradually writeback any cached
|
||||
data. The userspace can then monitor the cleaning
|
||||
process with "dmsetup status". When the number of cached
|
||||
blocks drops to zero, userspace can unload the
|
||||
dm-writecache target and replace it with dm-linear or
|
||||
other targets.
|
||||
max_age n
|
||||
specifies the maximum age of a block in milliseconds. If
|
||||
a block is stored in the cache for too long, it will be
|
||||
written to the underlying device and cleaned up.
|
||||
metadata_only
|
||||
only metadata is promoted to the cache. This option
|
||||
improves performance for heavier REQ_META workloads.
|
||||
pause_writeback n (default: 3000)
|
||||
pause writeback if there was some write I/O redirected to
|
||||
the origin volume in the last n milliseconds
|
||||
|
||||
Status:
|
||||
1. error indicator - 0 if there was no error, otherwise error number
|
||||
@@ -77,3 +96,5 @@ Messages:
|
||||
5. resume the device, so that it will use the linear
|
||||
target
|
||||
6. the cache device is now inactive and it can be deleted
|
||||
cleaner
|
||||
See above "cleaner" constructor documentation.
|
||||
|
||||
@@ -76,6 +76,11 @@ to change, such as less cores in the CPU list, then N and any ranges using N
|
||||
will also change. Use the same on a small 4 core system, and "16-N" becomes
|
||||
"16-3" and now the same boot input will be flagged as invalid (start > end).
|
||||
|
||||
The special case-tolerant group name "all" has a meaning of selecting all CPUs,
|
||||
so that "nohz_full=all" is the equivalent of "nohz_full=0-N".
|
||||
|
||||
The semantics of "N" and "all" is supported on a level of bitmaps and holds for
|
||||
all users of bitmap_parse().
|
||||
|
||||
This document may not be entirely up to date and comprehensive. The command
|
||||
"modinfo -p ${modulename}" shows a current list of all parameters of a loadable
|
||||
|
||||
@@ -113,7 +113,7 @@
|
||||
the GPE dispatcher.
|
||||
This facility can be used to prevent such uncontrolled
|
||||
GPE floodings.
|
||||
Format: <byte>
|
||||
Format: <byte> or <bitmap-list>
|
||||
|
||||
acpi_no_auto_serialize [HW,ACPI]
|
||||
Disable auto-serialization of AML methods
|
||||
@@ -301,6 +301,9 @@
|
||||
allowed anymore to lift isolation
|
||||
requirements as needed. This option
|
||||
does not override iommu=pt
|
||||
force_enable - Force enable the IOMMU on platforms known
|
||||
to be buggy with IOMMU enabled. Use this
|
||||
option with care.
|
||||
|
||||
amd_iommu_dump= [HW,X86-64]
|
||||
Enable AMD IOMMU driver option to dump the ACPI table
|
||||
@@ -497,16 +500,21 @@
|
||||
ccw_timeout_log [S390]
|
||||
See Documentation/s390/common_io.rst for details.
|
||||
|
||||
cgroup_disable= [KNL] Disable a particular controller
|
||||
Format: {name of the controller(s) to disable}
|
||||
cgroup_disable= [KNL] Disable a particular controller or optional feature
|
||||
Format: {name of the controller(s) or feature(s) to disable}
|
||||
The effects of cgroup_disable=foo are:
|
||||
- foo isn't auto-mounted if you mount all cgroups in
|
||||
a single hierarchy
|
||||
- foo isn't visible as an individually mountable
|
||||
subsystem
|
||||
- if foo is an optional feature then the feature is
|
||||
disabled and corresponding cgroup files are not
|
||||
created
|
||||
{Currently only "memory" controller deal with this and
|
||||
cut the overhead, others just disable the usage. So
|
||||
only cgroup_disable=memory is actually worthy}
|
||||
Specifying "pressure" disables per-cgroup pressure
|
||||
stall information accounting feature
|
||||
|
||||
cgroup_no_v1= [KNL] Disable cgroup controllers and named hierarchies in v1
|
||||
Format: { { controller | "all" | "named" }
|
||||
@@ -581,6 +589,28 @@
|
||||
loops can be debugged more effectively on production
|
||||
systems.
|
||||
|
||||
clocksource.max_cswd_read_retries= [KNL]
|
||||
Number of clocksource_watchdog() retries due to
|
||||
external delays before the clock will be marked
|
||||
unstable. Defaults to three retries, that is,
|
||||
four attempts to read the clock under test.
|
||||
|
||||
clocksource.verify_n_cpus= [KNL]
|
||||
Limit the number of CPUs checked for clocksources
|
||||
marked with CLOCK_SOURCE_VERIFY_PERCPU that
|
||||
are marked unstable due to excessive skew.
|
||||
A negative value says to check all CPUs, while
|
||||
zero says not to check any. Values larger than
|
||||
nr_cpu_ids are silently truncated to nr_cpu_ids.
|
||||
The actual CPUs are chosen randomly, with
|
||||
no replacement if the same CPU is chosen twice.
|
||||
|
||||
clocksource-wdtest.holdoff= [KNL]
|
||||
Set the time in seconds that the clocksource
|
||||
watchdog test waits before commencing its tests.
|
||||
Defaults to zero when built as a module and to
|
||||
10 seconds when built into the kernel.
|
||||
|
||||
clearcpuid=BITNUM[,BITNUM...] [X86]
|
||||
Disable CPUID feature X for the kernel. See
|
||||
arch/x86/include/asm/cpufeatures.h for the valid bit
|
||||
@@ -1092,6 +1122,11 @@
|
||||
the driver will use only 32-bit accessors to read/write
|
||||
the device registers.
|
||||
|
||||
liteuart,<addr>
|
||||
Start an early console on a litex serial port at the
|
||||
specified address. The serial port must already be
|
||||
setup and configured. Options are not yet supported.
|
||||
|
||||
meson,<addr>
|
||||
Start an early, polled-mode console on a meson serial
|
||||
port at the specified address. The serial port must
|
||||
@@ -1567,6 +1602,23 @@
|
||||
Documentation/admin-guide/mm/hugetlbpage.rst.
|
||||
Format: size[KMG]
|
||||
|
||||
hugetlb_free_vmemmap=
|
||||
[KNL] Reguires CONFIG_HUGETLB_PAGE_FREE_VMEMMAP
|
||||
enabled.
|
||||
Allows heavy hugetlb users to free up some more
|
||||
memory (6 * PAGE_SIZE for each 2MB hugetlb page).
|
||||
Format: { on | off (default) }
|
||||
|
||||
on: enable the feature
|
||||
off: disable the feature
|
||||
|
||||
Built with CONFIG_HUGETLB_PAGE_FREE_VMEMMAP_DEFAULT_ON=y,
|
||||
the default is on.
|
||||
|
||||
This is not compatible with memory_hotplug.memmap_on_memory.
|
||||
If both parameters are enabled, hugetlb_free_vmemmap takes
|
||||
precedence over memory_hotplug.memmap_on_memory.
|
||||
|
||||
hung_task_panic=
|
||||
[KNL] Should the hung task detector generate panics.
|
||||
Format: 0 | 1
|
||||
@@ -1987,7 +2039,7 @@
|
||||
forcing Dual Address Cycle for PCI cards supporting
|
||||
greater than 32-bit addressing.
|
||||
|
||||
iommu.strict= [ARM64] Configure TLB invalidation behaviour
|
||||
iommu.strict= [ARM64, X86] Configure TLB invalidation behaviour
|
||||
Format: { "0" | "1" }
|
||||
0 - Lazy mode.
|
||||
Request that DMA unmap operations use deferred
|
||||
@@ -1998,6 +2050,10 @@
|
||||
1 - Strict mode (default).
|
||||
DMA unmap operations invalidate IOMMU hardware TLBs
|
||||
synchronously.
|
||||
Note: on x86, the default behaviour depends on the
|
||||
equivalent driver-specific parameters, but a strict
|
||||
mode explicitly specified by either method takes
|
||||
precedence.
|
||||
|
||||
iommu.passthrough=
|
||||
[ARM64, X86] Configure DMA to bypass the IOMMU by default.
|
||||
@@ -2833,6 +2889,10 @@
|
||||
Note that even when enabled, there are a few cases where
|
||||
the feature is not effective.
|
||||
|
||||
This is not compatible with hugetlb_free_vmemmap. If
|
||||
both parameters are enabled, hugetlb_free_vmemmap takes
|
||||
precedence over memory_hotplug.memmap_on_memory.
|
||||
|
||||
memtest= [KNL,X86,ARM,PPC,RISCV] Enable memtest
|
||||
Format: <integer>
|
||||
default : 0 <disable>
|
||||
@@ -3569,6 +3629,12 @@
|
||||
off: turn off poisoning (default)
|
||||
on: turn on poisoning
|
||||
|
||||
page_reporting.page_reporting_order=
|
||||
[KNL] Minimal page reporting order
|
||||
Format: <integer>
|
||||
Adjust the minimal page reporting order. The page
|
||||
reporting is disabled when it exceeds (MAX_ORDER-1).
|
||||
|
||||
panic= [KNL] Kernel behaviour on panic: delay <timeout>
|
||||
timeout > 0: seconds before rebooting
|
||||
timeout = 0: wait forever
|
||||
@@ -4293,6 +4359,11 @@
|
||||
whole algorithm to behave better in low memory
|
||||
condition.
|
||||
|
||||
rcutree.rcu_delay_page_cache_fill_msec= [KNL]
|
||||
Set the page-cache refill delay (in milliseconds)
|
||||
in response to low-memory conditions. The range
|
||||
of permitted values is in the range 0:100000.
|
||||
|
||||
rcutree.jiffies_till_first_fqs= [KNL]
|
||||
Set delay from grace-period initialization to
|
||||
first attempt to force quiescent states.
|
||||
@@ -5611,12 +5682,25 @@
|
||||
Note, echoing 1 into this file without the
|
||||
tracepoint_printk kernel cmdline option has no effect.
|
||||
|
||||
The tp_printk_stop_on_boot (see below) can also be used
|
||||
to stop the printing of events to console at
|
||||
late_initcall_sync.
|
||||
|
||||
** CAUTION **
|
||||
|
||||
Having tracepoints sent to printk() and activating high
|
||||
frequency tracepoints such as irq or sched, can cause
|
||||
the system to live lock.
|
||||
|
||||
tp_printk_stop_on_boot[FTRACE]
|
||||
When tp_printk (above) is set, it can cause a lot of noise
|
||||
on the console. It may be useful to only include the
|
||||
printing of events during boot up, as user space may
|
||||
make the system inoperable.
|
||||
|
||||
This command line option will stop the printing of events
|
||||
to console at the late_initcall_sync() time frame.
|
||||
|
||||
traceoff_on_warning
|
||||
[FTRACE] enable this option to disable tracing when a
|
||||
warning is hit. This turns off "tracing_on". Tracing can
|
||||
|
||||
@@ -101,17 +101,6 @@ this results in concentration of disk activity in a small time interval which
|
||||
occurs only once every 10 minutes, or whenever the disk is forced to spin up by
|
||||
a cache miss. The disk can then be spun down in the periods of inactivity.
|
||||
|
||||
If you want to find out which process caused the disk to spin up, you can
|
||||
gather information by setting the flag /proc/sys/vm/block_dump. When this flag
|
||||
is set, Linux reports all disk read and write operations that take place, and
|
||||
all block dirtyings done to files. This makes it possible to debug why a disk
|
||||
needs to spin up, and to increase battery life even more. The output of
|
||||
block_dump is written to the kernel output, and it can be retrieved using
|
||||
"dmesg". When you use block_dump and your kernel logging level also includes
|
||||
kernel debugging messages, you probably want to turn off klogd, otherwise
|
||||
the output of block_dump will be logged, causing disk activity that is not
|
||||
normally there.
|
||||
|
||||
|
||||
Configuration
|
||||
-------------
|
||||
|
||||
@@ -39,7 +39,7 @@ in principle, they should work in any architecture where these
|
||||
subsystems are present.
|
||||
|
||||
A periodic hrtimer runs to generate interrupts and kick the watchdog
|
||||
task. An NMI perf event is generated every "watchdog_thresh"
|
||||
job. An NMI perf event is generated every "watchdog_thresh"
|
||||
(compile-time initialized to 10 and configurable through sysctl of the
|
||||
same name) seconds to check for hardlockups. If any CPU in the system
|
||||
does not receive any hrtimer interrupt during that time the
|
||||
@@ -47,7 +47,7 @@ does not receive any hrtimer interrupt during that time the
|
||||
generate a kernel warning or call panic, depending on the
|
||||
configuration.
|
||||
|
||||
The watchdog task is a high priority kernel thread that updates a
|
||||
The watchdog job runs in a stop scheduling thread that updates a
|
||||
timestamp every time it is scheduled. If that timestamp is not updated
|
||||
for 2*watchdog_thresh seconds (the softlockup threshold) the
|
||||
'softlockup detector' (coded inside the hrtimer callback function)
|
||||
|
||||
@@ -60,6 +60,10 @@ HugePages_Surp
|
||||
the pool above the value in ``/proc/sys/vm/nr_hugepages``. The
|
||||
maximum number of surplus huge pages is controlled by
|
||||
``/proc/sys/vm/nr_overcommit_hugepages``.
|
||||
Note: When the feature of freeing unused vmemmap pages associated
|
||||
with each hugetlb page is enabled, the number of surplus huge pages
|
||||
may be temporarily larger than the maximum number of surplus huge
|
||||
pages when the system is under memory pressure.
|
||||
Hugepagesize
|
||||
is the default hugepage size (in Kb).
|
||||
Hugetlb
|
||||
@@ -80,6 +84,10 @@ returned to the huge page pool when freed by a task. A user with root
|
||||
privileges can dynamically allocate more or free some persistent huge pages
|
||||
by increasing or decreasing the value of ``nr_hugepages``.
|
||||
|
||||
Note: When the feature of freeing unused vmemmap pages associated with each
|
||||
hugetlb page is enabled, we can fail to free the huge pages triggered by
|
||||
the user when ths system is under memory pressure. Please try again later.
|
||||
|
||||
Pages that are used as huge pages are reserved inside the kernel and cannot
|
||||
be used for other purposes. Huge pages cannot be swapped out under
|
||||
memory pressure.
|
||||
@@ -145,6 +153,9 @@ default_hugepagesz
|
||||
|
||||
will all result in 256 2M huge pages being allocated. Valid default
|
||||
huge page size is architecture dependent.
|
||||
hugetlb_free_vmemmap
|
||||
When CONFIG_HUGETLB_PAGE_FREE_VMEMMAP is set, this enables freeing
|
||||
unused vmemmap pages associated with each HugeTLB page.
|
||||
|
||||
When multiple huge page sizes are supported, ``/proc/sys/vm/nr_hugepages``
|
||||
indicates the current number of pre-allocated huge pages of the default size.
|
||||
|
||||
@@ -357,6 +357,19 @@ creates ZONE_MOVABLE as following.
|
||||
Unfortunately, there is no information to show which memory block belongs
|
||||
to ZONE_MOVABLE. This is TBD.
|
||||
|
||||
Memory offlining can fail when dissolving a free huge page on ZONE_MOVABLE
|
||||
and the feature of freeing unused vmemmap pages associated with each hugetlb
|
||||
page is enabled.
|
||||
|
||||
This can happen when we have plenty of ZONE_MOVABLE memory, but not enough
|
||||
kernel memory to allocate vmemmmap pages. We may even be able to migrate
|
||||
huge page contents, but will not be able to dissolve the source huge page.
|
||||
This will prevent an offline operation and is unfortunate as memory offlining
|
||||
is expected to succeed on movable zones. Users that depend on memory hotplug
|
||||
to succeed for movable zones should carefully consider whether the memory
|
||||
savings gained from this feature are worth the risk of possibly not being
|
||||
able to offline memory in certain situations.
|
||||
|
||||
.. note::
|
||||
Techniques that rely on long-term pinnings of memory (especially, RDMA and
|
||||
vfio) are fundamentally problematic with ZONE_MOVABLE and, therefore, memory
|
||||
|
||||
@@ -21,6 +21,8 @@ There are four components to pagemap:
|
||||
* Bit 55 pte is soft-dirty (see
|
||||
:ref:`Documentation/admin-guide/mm/soft-dirty.rst <soft_dirty>`)
|
||||
* Bit 56 page exclusively mapped (since 4.2)
|
||||
* Bit 57 pte is uffd-wp write-protected (since 5.13) (see
|
||||
:ref:`Documentation/admin-guide/mm/userfaultfd.rst <userfaultfd>`)
|
||||
* Bits 57-60 zero
|
||||
* Bit 61 page is file-page or shared-anon (since 3.5)
|
||||
* Bit 62 page swapped
|
||||
|
||||
@@ -77,7 +77,8 @@ events, except page fault notifications, may be generated:
|
||||
|
||||
- ``UFFD_FEATURE_MINOR_HUGETLBFS`` indicates that the kernel supports
|
||||
``UFFDIO_REGISTER_MODE_MINOR`` registration for hugetlbfs virtual memory
|
||||
areas.
|
||||
areas. ``UFFD_FEATURE_MINOR_SHMEM`` is the analogous feature indicating
|
||||
support for shmem virtual memory areas.
|
||||
|
||||
The userland application should set the feature flags it intends to use
|
||||
when invoking the ``UFFDIO_API`` ioctl, to request that those features be
|
||||
|
||||
@@ -347,81 +347,8 @@ for tickless systems. It follows the same basic strategy as the ``menu`` `one
|
||||
<menu-gov_>`_: it always tries to find the deepest idle state suitable for the
|
||||
given conditions. However, it applies a different approach to that problem.
|
||||
|
||||
First, it does not use sleep length correction factors, but instead it attempts
|
||||
to correlate the observed idle duration values with the available idle states
|
||||
and use that information to pick up the idle state that is most likely to
|
||||
"match" the upcoming CPU idle interval. Second, it does not take the tasks
|
||||
that were running on the given CPU in the past and are waiting on some I/O
|
||||
operations to complete now at all (there is no guarantee that they will run on
|
||||
the same CPU when they become runnable again) and the pattern detection code in
|
||||
it avoids taking timer wakeups into account. It also only uses idle duration
|
||||
values less than the current time till the closest timer (with the scheduler
|
||||
tick excluded) for that purpose.
|
||||
|
||||
Like in the ``menu`` governor `case <menu-gov_>`_, the first step is to obtain
|
||||
the *sleep length*, which is the time until the closest timer event with the
|
||||
assumption that the scheduler tick will be stopped (that also is the upper bound
|
||||
on the time until the next CPU wakeup). That value is then used to preselect an
|
||||
idle state on the basis of three metrics maintained for each idle state provided
|
||||
by the ``CPUIdle`` driver: ``hits``, ``misses`` and ``early_hits``.
|
||||
|
||||
The ``hits`` and ``misses`` metrics measure the likelihood that a given idle
|
||||
state will "match" the observed (post-wakeup) idle duration if it "matches" the
|
||||
sleep length. They both are subject to decay (after a CPU wakeup) every time
|
||||
the target residency of the idle state corresponding to them is less than or
|
||||
equal to the sleep length and the target residency of the next idle state is
|
||||
greater than the sleep length (that is, when the idle state corresponding to
|
||||
them "matches" the sleep length). The ``hits`` metric is increased if the
|
||||
former condition is satisfied and the target residency of the given idle state
|
||||
is less than or equal to the observed idle duration and the target residency of
|
||||
the next idle state is greater than the observed idle duration at the same time
|
||||
(that is, it is increased when the given idle state "matches" both the sleep
|
||||
length and the observed idle duration). In turn, the ``misses`` metric is
|
||||
increased when the given idle state "matches" the sleep length only and the
|
||||
observed idle duration is too short for its target residency.
|
||||
|
||||
The ``early_hits`` metric measures the likelihood that a given idle state will
|
||||
"match" the observed (post-wakeup) idle duration if it does not "match" the
|
||||
sleep length. It is subject to decay on every CPU wakeup and it is increased
|
||||
when the idle state corresponding to it "matches" the observed (post-wakeup)
|
||||
idle duration and the target residency of the next idle state is less than or
|
||||
equal to the sleep length (i.e. the idle state "matching" the sleep length is
|
||||
deeper than the given one).
|
||||
|
||||
The governor walks the list of idle states provided by the ``CPUIdle`` driver
|
||||
and finds the last (deepest) one with the target residency less than or equal
|
||||
to the sleep length. Then, the ``hits`` and ``misses`` metrics of that idle
|
||||
state are compared with each other and it is preselected if the ``hits`` one is
|
||||
greater (which means that that idle state is likely to "match" the observed idle
|
||||
duration after CPU wakeup). If the ``misses`` one is greater, the governor
|
||||
preselects the shallower idle state with the maximum ``early_hits`` metric
|
||||
(or if there are multiple shallower idle states with equal ``early_hits``
|
||||
metric which also is the maximum, the shallowest of them will be preselected).
|
||||
[If there is a wakeup latency constraint coming from the `PM QoS framework
|
||||
<cpu-pm-qos_>`_ which is hit before reaching the deepest idle state with the
|
||||
target residency within the sleep length, the deepest idle state with the exit
|
||||
latency within the constraint is preselected without consulting the ``hits``,
|
||||
``misses`` and ``early_hits`` metrics.]
|
||||
|
||||
Next, the governor takes several idle duration values observed most recently
|
||||
into consideration and if at least a half of them are greater than or equal to
|
||||
the target residency of the preselected idle state, that idle state becomes the
|
||||
final candidate to ask for. Otherwise, the average of the most recent idle
|
||||
duration values below the target residency of the preselected idle state is
|
||||
computed and the governor walks the idle states shallower than the preselected
|
||||
one and finds the deepest of them with the target residency within that average.
|
||||
That idle state is then taken as the final candidate to ask for.
|
||||
|
||||
Still, at this point the governor may need to refine the idle state selection if
|
||||
it has not decided to `stop the scheduler tick <idle-cpus-and-tick_>`_. That
|
||||
generally happens if the target residency of the idle state selected so far is
|
||||
less than the tick period and the tick has not been stopped already (in a
|
||||
previous iteration of the idle loop). Then, like in the ``menu`` governor
|
||||
`case <menu-gov_>`_, the sleep length used in the previous computations may not
|
||||
reflect the real time until the closest timer event and if it really is greater
|
||||
than that time, a shallower state with a suitable target residency may need to
|
||||
be selected.
|
||||
|
||||
.. kernel-doc:: drivers/cpuidle/governors/teo.c
|
||||
:doc: teo-description
|
||||
|
||||
.. _idle-states-representation:
|
||||
|
||||
|
||||
@@ -365,6 +365,9 @@ argument is passed to the kernel in the command line.
|
||||
inclusive) including both turbo and non-turbo P-states (see
|
||||
`Turbo P-states Support`_).
|
||||
|
||||
This attribute is present only if the value exposed by it is the same
|
||||
for all of the CPUs in the system.
|
||||
|
||||
The value of this attribute is not affected by the ``no_turbo``
|
||||
setting described `below <no_turbo_attr_>`_.
|
||||
|
||||
@@ -374,6 +377,9 @@ argument is passed to the kernel in the command line.
|
||||
Ratio of the `turbo range <turbo_>`_ size to the size of the entire
|
||||
range of supported P-states, in percent.
|
||||
|
||||
This attribute is present only if the value exposed by it is the same
|
||||
for all of the CPUs in the system.
|
||||
|
||||
This attribute is read-only.
|
||||
|
||||
.. _no_turbo_attr:
|
||||
|
||||
@@ -1297,11 +1297,11 @@ This parameter can be used to control the soft lockup detector.
|
||||
= =================================
|
||||
|
||||
The soft lockup detector monitors CPUs for threads that are hogging the CPUs
|
||||
without rescheduling voluntarily, and thus prevent the 'watchdog/N' threads
|
||||
from running. The mechanism depends on the CPUs ability to respond to timer
|
||||
interrupts which are needed for the 'watchdog/N' threads to be woken up by
|
||||
the watchdog timer function, otherwise the NMI watchdog — if enabled — can
|
||||
detect a hard lockup condition.
|
||||
without rescheduling voluntarily, and thus prevent the 'migration/N' threads
|
||||
from running, causing the watchdog work fail to execute. The mechanism depends
|
||||
on the CPUs ability to respond to timer interrupts which are needed for the
|
||||
watchdog work to be queued by the watchdog timer function, otherwise the NMI
|
||||
watchdog — if enabled — can detect a hard lockup condition.
|
||||
|
||||
|
||||
stack_erasing
|
||||
|
||||
@@ -25,7 +25,6 @@ files can be found in mm/swap.c.
|
||||
Currently, these files are in /proc/sys/vm:
|
||||
|
||||
- admin_reserve_kbytes
|
||||
- block_dump
|
||||
- compact_memory
|
||||
- compaction_proactiveness
|
||||
- compact_unevictable_allowed
|
||||
@@ -64,7 +63,7 @@ Currently, these files are in /proc/sys/vm:
|
||||
- overcommit_ratio
|
||||
- page-cluster
|
||||
- panic_on_oom
|
||||
- percpu_pagelist_fraction
|
||||
- percpu_pagelist_high_fraction
|
||||
- stat_interval
|
||||
- stat_refresh
|
||||
- numa_stat
|
||||
@@ -106,13 +105,6 @@ On x86_64 this is about 128MB.
|
||||
Changing this takes effect whenever an application requests memory.
|
||||
|
||||
|
||||
block_dump
|
||||
==========
|
||||
|
||||
block_dump enables block I/O debugging when set to a nonzero value. More
|
||||
information on block I/O debugging is in Documentation/admin-guide/laptops/laptop-mode.rst.
|
||||
|
||||
|
||||
compact_memory
|
||||
==============
|
||||
|
||||
@@ -790,22 +782,24 @@ panic_on_oom=2+kdump gives you very strong tool to investigate
|
||||
why oom happens. You can get snapshot.
|
||||
|
||||
|
||||
percpu_pagelist_fraction
|
||||
========================
|
||||
percpu_pagelist_high_fraction
|
||||
=============================
|
||||
|
||||
This is the fraction of pages at most (high mark pcp->high) in each zone that
|
||||
are allocated for each per cpu page list. The min value for this is 8. It
|
||||
means that we don't allow more than 1/8th of pages in each zone to be
|
||||
allocated in any single per_cpu_pagelist. This entry only changes the value
|
||||
of hot per cpu pagelists. User can specify a number like 100 to allocate
|
||||
1/100th of each zone to each per cpu page list.
|
||||
This is the fraction of pages in each zone that are can be stored to
|
||||
per-cpu page lists. It is an upper boundary that is divided depending
|
||||
on the number of online CPUs. The min value for this is 8 which means
|
||||
that we do not allow more than 1/8th of pages in each zone to be stored
|
||||
on per-cpu page lists. This entry only changes the value of hot per-cpu
|
||||
page lists. A user can specify a number like 100 to allocate 1/100th of
|
||||
each zone between per-cpu lists.
|
||||
|
||||
The batch value of each per cpu pagelist is also updated as a result. It is
|
||||
set to pcp->high/4. The upper limit of batch is (PAGE_SHIFT * 8)
|
||||
The batch value of each per-cpu page list remains the same regardless of
|
||||
the value of the high fraction so allocation latencies are unaffected.
|
||||
|
||||
The initial value is zero. Kernel does not use this value at boot time to set
|
||||
the high water marks for each per cpu page list. If the user writes '0' to this
|
||||
sysctl, it will revert to this default behavior.
|
||||
The initial value is zero. Kernel uses this value to set the high pcp->high
|
||||
mark based on the low watermark for the zone and the number of local
|
||||
online CPUs. If the user writes '0' to this sysctl, it will revert to
|
||||
this default behavior.
|
||||
|
||||
|
||||
stat_interval
|
||||
@@ -936,12 +930,12 @@ allocations, THP and hugetlbfs pages.
|
||||
|
||||
To make it sensible with respect to the watermark_scale_factor
|
||||
parameter, the unit is in fractions of 10,000. The default value of
|
||||
15,000 on !DISCONTIGMEM configurations means that up to 150% of the high
|
||||
watermark will be reclaimed in the event of a pageblock being mixed due
|
||||
to fragmentation. The level of reclaim is determined by the number of
|
||||
fragmentation events that occurred in the recent past. If this value is
|
||||
smaller than a pageblock then a pageblocks worth of pages will be reclaimed
|
||||
(e.g. 2MB on 64-bit x86). A boost factor of 0 will disable the feature.
|
||||
15,000 means that up to 150% of the high watermark will be reclaimed in the
|
||||
event of a pageblock being mixed due to fragmentation. The level of reclaim
|
||||
is determined by the number of fragmentation events that occurred in the
|
||||
recent past. If this value is smaller than a pageblock then a pageblocks
|
||||
worth of pages will be reclaimed (e.g. 2MB on 64-bit x86). A boost factor
|
||||
of 0 will disable the feature.
|
||||
|
||||
|
||||
watermark_scale_factor
|
||||
|
||||
@@ -256,6 +256,35 @@ Note names of the NVMem devices ``nvm_activeN`` and ``nvm_non_activeN``
|
||||
depend on the order they are registered in the NVMem subsystem. N in
|
||||
the name is the identifier added by the NVMem subsystem.
|
||||
|
||||
Upgrading on-board retimer NVM when there is no cable connected
|
||||
---------------------------------------------------------------
|
||||
If the platform supports, it may be possible to upgrade the retimer NVM
|
||||
firmware even when there is nothing connected to the USB4
|
||||
ports. When this is the case the ``usb4_portX`` devices have two special
|
||||
attributes: ``offline`` and ``rescan``. The way to upgrade the firmware
|
||||
is to first put the USB4 port into offline mode::
|
||||
|
||||
# echo 1 > /sys/bus/thunderbolt/devices/0-0/usb4_port1/offline
|
||||
|
||||
This step makes sure the port does not respond to any hotplug events,
|
||||
and also ensures the retimers are powered on. The next step is to scan
|
||||
for the retimers::
|
||||
|
||||
# echo 1 > /sys/bus/thunderbolt/devices/0-0/usb4_port1/rescan
|
||||
|
||||
This enumerates and adds the on-board retimers. Now retimer NVM can be
|
||||
upgraded in the same way than with cable connected (see previous
|
||||
section). However, the retimer is not disconnected as we are offline
|
||||
mode) so after writing ``1`` to ``nvm_authenticate`` one should wait for
|
||||
5 or more seconds before running rescan again::
|
||||
|
||||
# echo 1 > /sys/bus/thunderbolt/devices/0-0/usb4_port1/rescan
|
||||
|
||||
This point if everything went fine, the port can be put back to
|
||||
functional state again::
|
||||
|
||||
# echo 0 > /sys/bus/thunderbolt/devices/0-0/usb4_port1/offline
|
||||
|
||||
Upgrading NVM when host controller is in safe mode
|
||||
--------------------------------------------------
|
||||
If the existing NVM is not properly authenticated (or is missing) the
|
||||
|
||||
@@ -553,20 +553,36 @@ throughput sustainable with bfq, because updating the blkio.bfq.*
|
||||
stats is rather costly, especially for some of the stats enabled by
|
||||
CONFIG_BFQ_CGROUP_DEBUG.
|
||||
|
||||
Parameters to set
|
||||
-----------------
|
||||
Parameters
|
||||
----------
|
||||
|
||||
For each group, there is only the following parameter to set.
|
||||
For each group, the following parameters can be set:
|
||||
|
||||
weight (namely blkio.bfq.weight or io.bfq-weight): the weight of the
|
||||
group inside its parent. Available values: 1..1000 (default 100). The
|
||||
linear mapping between ioprio and weights, described at the beginning
|
||||
of the tunable section, is still valid, but all weights higher than
|
||||
IOPRIO_BE_NR*10 are mapped to ioprio 0.
|
||||
weight
|
||||
This specifies the default weight for the cgroup inside its parent.
|
||||
Available values: 1..1000 (default: 100).
|
||||
|
||||
Recall that, if low-latency is set, then BFQ automatically raises the
|
||||
weight of the queues associated with interactive and soft real-time
|
||||
applications. Unset this tunable if you need/want to control weights.
|
||||
For cgroup v1, it is set by writing the value to `blkio.bfq.weight`.
|
||||
|
||||
For cgroup v2, it is set by writing the value to `io.bfq.weight`.
|
||||
(with an optional prefix of `default` and a space).
|
||||
|
||||
The linear mapping between ioprio and weights, described at the beginning
|
||||
of the tunable section, is still valid, but all weights higher than
|
||||
IOPRIO_BE_NR*10 are mapped to ioprio 0.
|
||||
|
||||
Recall that, if low-latency is set, then BFQ automatically raises the
|
||||
weight of the queues associated with interactive and soft real-time
|
||||
applications. Unset this tunable if you need/want to control weights.
|
||||
|
||||
weight_device
|
||||
This specifies a per-device weight for the cgroup. The syntax is
|
||||
`minor:major weight`. A weight of `0` may be used to reset to the default
|
||||
weight.
|
||||
|
||||
For cgroup v1, it is set by writing the value to `blkio.bfq.weight_device`.
|
||||
|
||||
For cgroup v2, the file name is `io.bfq.weight`.
|
||||
|
||||
|
||||
[1]
|
||||
|
||||
@@ -12,6 +12,19 @@ BPF instruction-set.
|
||||
The Cilium project also maintains a `BPF and XDP Reference Guide`_
|
||||
that goes into great technical depth about the BPF Architecture.
|
||||
|
||||
libbpf
|
||||
======
|
||||
|
||||
Libbpf is a userspace library for loading and interacting with bpf programs.
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 1
|
||||
|
||||
libbpf/libbpf
|
||||
libbpf/libbpf_api
|
||||
libbpf/libbpf_build
|
||||
libbpf/libbpf_naming_convention
|
||||
|
||||
BPF Type Format (BTF)
|
||||
=====================
|
||||
|
||||
@@ -84,6 +97,7 @@ Other
|
||||
:maxdepth: 1
|
||||
|
||||
ringbuf
|
||||
llvm_reloc
|
||||
|
||||
.. Links:
|
||||
.. _networking-filter: ../networking/filter.rst
|
||||
|
||||
14
Documentation/bpf/libbpf/libbpf.rst
Normal file
14
Documentation/bpf/libbpf/libbpf.rst
Normal file
@@ -0,0 +1,14 @@
|
||||
.. SPDX-License-Identifier: (LGPL-2.1 OR BSD-2-Clause)
|
||||
|
||||
libbpf
|
||||
======
|
||||
|
||||
This is documentation for libbpf, a userspace library for loading and
|
||||
interacting with bpf programs.
|
||||
|
||||
All general BPF questions, including kernel functionality, libbpf APIs and
|
||||
their application, should be sent to bpf@vger.kernel.org mailing list.
|
||||
You can `subscribe <http://vger.kernel.org/vger-lists.html#bpf>`_ to the
|
||||
mailing list search its `archive <https://lore.kernel.org/bpf/>`_.
|
||||
Please search the archive before asking new questions. It very well might
|
||||
be that this was already addressed or answered before.
|
||||
27
Documentation/bpf/libbpf/libbpf_api.rst
Normal file
27
Documentation/bpf/libbpf/libbpf_api.rst
Normal file
@@ -0,0 +1,27 @@
|
||||
.. SPDX-License-Identifier: (LGPL-2.1 OR BSD-2-Clause)
|
||||
|
||||
API
|
||||
===
|
||||
|
||||
This documentation is autogenerated from header files in libbpf, tools/lib/bpf
|
||||
|
||||
.. kernel-doc:: tools/lib/bpf/libbpf.h
|
||||
:internal:
|
||||
|
||||
.. kernel-doc:: tools/lib/bpf/bpf.h
|
||||
:internal:
|
||||
|
||||
.. kernel-doc:: tools/lib/bpf/btf.h
|
||||
:internal:
|
||||
|
||||
.. kernel-doc:: tools/lib/bpf/xsk.h
|
||||
:internal:
|
||||
|
||||
.. kernel-doc:: tools/lib/bpf/bpf_tracing.h
|
||||
:internal:
|
||||
|
||||
.. kernel-doc:: tools/lib/bpf/bpf_core_read.h
|
||||
:internal:
|
||||
|
||||
.. kernel-doc:: tools/lib/bpf/bpf_endian.h
|
||||
:internal:
|
||||
37
Documentation/bpf/libbpf/libbpf_build.rst
Normal file
37
Documentation/bpf/libbpf/libbpf_build.rst
Normal file
@@ -0,0 +1,37 @@
|
||||
.. SPDX-License-Identifier: (LGPL-2.1 OR BSD-2-Clause)
|
||||
|
||||
Building libbpf
|
||||
===============
|
||||
|
||||
libelf and zlib are internal dependencies of libbpf and thus are required to link
|
||||
against and must be installed on the system for applications to work.
|
||||
pkg-config is used by default to find libelf, and the program called
|
||||
can be overridden with PKG_CONFIG.
|
||||
|
||||
If using pkg-config at build time is not desired, it can be disabled by
|
||||
setting NO_PKG_CONFIG=1 when calling make.
|
||||
|
||||
To build both static libbpf.a and shared libbpf.so:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
$ cd src
|
||||
$ make
|
||||
|
||||
To build only static libbpf.a library in directory build/ and install them
|
||||
together with libbpf headers in a staging directory root/:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
$ cd src
|
||||
$ mkdir build root
|
||||
$ BUILD_STATIC_ONLY=y OBJDIR=build DESTDIR=root make install
|
||||
|
||||
To build both static libbpf.a and shared libbpf.so against a custom libelf
|
||||
dependency installed in /build/root/ and install them together with libbpf
|
||||
headers in a build directory /build/root/:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
$ cd src
|
||||
$ PKG_CONFIG_PATH=/build/root/lib64/pkgconfig DESTDIR=/build/root make
|
||||
162
Documentation/bpf/libbpf/libbpf_naming_convention.rst
Normal file
162
Documentation/bpf/libbpf/libbpf_naming_convention.rst
Normal file
@@ -0,0 +1,162 @@
|
||||
.. SPDX-License-Identifier: (LGPL-2.1 OR BSD-2-Clause)
|
||||
|
||||
API naming convention
|
||||
=====================
|
||||
|
||||
libbpf API provides access to a few logically separated groups of
|
||||
functions and types. Every group has its own naming convention
|
||||
described here. It's recommended to follow these conventions whenever a
|
||||
new function or type is added to keep libbpf API clean and consistent.
|
||||
|
||||
All types and functions provided by libbpf API should have one of the
|
||||
following prefixes: ``bpf_``, ``btf_``, ``libbpf_``, ``xsk_``,
|
||||
``btf_dump_``, ``ring_buffer_``, ``perf_buffer_``.
|
||||
|
||||
System call wrappers
|
||||
--------------------
|
||||
|
||||
System call wrappers are simple wrappers for commands supported by
|
||||
sys_bpf system call. These wrappers should go to ``bpf.h`` header file
|
||||
and map one to one to corresponding commands.
|
||||
|
||||
For example ``bpf_map_lookup_elem`` wraps ``BPF_MAP_LOOKUP_ELEM``
|
||||
command of sys_bpf, ``bpf_prog_attach`` wraps ``BPF_PROG_ATTACH``, etc.
|
||||
|
||||
Objects
|
||||
-------
|
||||
|
||||
Another class of types and functions provided by libbpf API is "objects"
|
||||
and functions to work with them. Objects are high-level abstractions
|
||||
such as BPF program or BPF map. They're represented by corresponding
|
||||
structures such as ``struct bpf_object``, ``struct bpf_program``,
|
||||
``struct bpf_map``, etc.
|
||||
|
||||
Structures are forward declared and access to their fields should be
|
||||
provided via corresponding getters and setters rather than directly.
|
||||
|
||||
These objects are associated with corresponding parts of ELF object that
|
||||
contains compiled BPF programs.
|
||||
|
||||
For example ``struct bpf_object`` represents ELF object itself created
|
||||
from an ELF file or from a buffer, ``struct bpf_program`` represents a
|
||||
program in ELF object and ``struct bpf_map`` is a map.
|
||||
|
||||
Functions that work with an object have names built from object name,
|
||||
double underscore and part that describes function purpose.
|
||||
|
||||
For example ``bpf_object__open`` consists of the name of corresponding
|
||||
object, ``bpf_object``, double underscore and ``open`` that defines the
|
||||
purpose of the function to open ELF file and create ``bpf_object`` from
|
||||
it.
|
||||
|
||||
All objects and corresponding functions other than BTF related should go
|
||||
to ``libbpf.h``. BTF types and functions should go to ``btf.h``.
|
||||
|
||||
Auxiliary functions
|
||||
-------------------
|
||||
|
||||
Auxiliary functions and types that don't fit well in any of categories
|
||||
described above should have ``libbpf_`` prefix, e.g.
|
||||
``libbpf_get_error`` or ``libbpf_prog_type_by_name``.
|
||||
|
||||
AF_XDP functions
|
||||
-------------------
|
||||
|
||||
AF_XDP functions should have an ``xsk_`` prefix, e.g.
|
||||
``xsk_umem__get_data`` or ``xsk_umem__create``. The interface consists
|
||||
of both low-level ring access functions and high-level configuration
|
||||
functions. These can be mixed and matched. Note that these functions
|
||||
are not reentrant for performance reasons.
|
||||
|
||||
ABI
|
||||
==========
|
||||
|
||||
libbpf can be both linked statically or used as DSO. To avoid possible
|
||||
conflicts with other libraries an application is linked with, all
|
||||
non-static libbpf symbols should have one of the prefixes mentioned in
|
||||
API documentation above. See API naming convention to choose the right
|
||||
name for a new symbol.
|
||||
|
||||
Symbol visibility
|
||||
-----------------
|
||||
|
||||
libbpf follow the model when all global symbols have visibility "hidden"
|
||||
by default and to make a symbol visible it has to be explicitly
|
||||
attributed with ``LIBBPF_API`` macro. For example:
|
||||
|
||||
.. code-block:: c
|
||||
|
||||
LIBBPF_API int bpf_prog_get_fd_by_id(__u32 id);
|
||||
|
||||
This prevents from accidentally exporting a symbol, that is not supposed
|
||||
to be a part of ABI what, in turn, improves both libbpf developer- and
|
||||
user-experiences.
|
||||
|
||||
ABI versionning
|
||||
---------------
|
||||
|
||||
To make future ABI extensions possible libbpf ABI is versioned.
|
||||
Versioning is implemented by ``libbpf.map`` version script that is
|
||||
passed to linker.
|
||||
|
||||
Version name is ``LIBBPF_`` prefix + three-component numeric version,
|
||||
starting from ``0.0.1``.
|
||||
|
||||
Every time ABI is being changed, e.g. because a new symbol is added or
|
||||
semantic of existing symbol is changed, ABI version should be bumped.
|
||||
This bump in ABI version is at most once per kernel development cycle.
|
||||
|
||||
For example, if current state of ``libbpf.map`` is:
|
||||
|
||||
.. code-block:: c
|
||||
|
||||
LIBBPF_0.0.1 {
|
||||
global:
|
||||
bpf_func_a;
|
||||
bpf_func_b;
|
||||
local:
|
||||
\*;
|
||||
};
|
||||
|
||||
, and a new symbol ``bpf_func_c`` is being introduced, then
|
||||
``libbpf.map`` should be changed like this:
|
||||
|
||||
.. code-block:: c
|
||||
|
||||
LIBBPF_0.0.1 {
|
||||
global:
|
||||
bpf_func_a;
|
||||
bpf_func_b;
|
||||
local:
|
||||
\*;
|
||||
};
|
||||
LIBBPF_0.0.2 {
|
||||
global:
|
||||
bpf_func_c;
|
||||
} LIBBPF_0.0.1;
|
||||
|
||||
, where new version ``LIBBPF_0.0.2`` depends on the previous
|
||||
``LIBBPF_0.0.1``.
|
||||
|
||||
Format of version script and ways to handle ABI changes, including
|
||||
incompatible ones, described in details in [1].
|
||||
|
||||
Stand-alone build
|
||||
-------------------
|
||||
|
||||
Under https://github.com/libbpf/libbpf there is a (semi-)automated
|
||||
mirror of the mainline's version of libbpf for a stand-alone build.
|
||||
|
||||
However, all changes to libbpf's code base must be upstreamed through
|
||||
the mainline kernel tree.
|
||||
|
||||
License
|
||||
-------------------
|
||||
|
||||
libbpf is dual-licensed under LGPL 2.1 and BSD 2-Clause.
|
||||
|
||||
Links
|
||||
-------------------
|
||||
|
||||
[1] https://www.akkadia.org/drepper/dsohowto.pdf
|
||||
(Chapter 3. Maintaining APIs and ABIs).
|
||||
240
Documentation/bpf/llvm_reloc.rst
Normal file
240
Documentation/bpf/llvm_reloc.rst
Normal file
@@ -0,0 +1,240 @@
|
||||
.. SPDX-License-Identifier: (LGPL-2.1 OR BSD-2-Clause)
|
||||
|
||||
====================
|
||||
BPF LLVM Relocations
|
||||
====================
|
||||
|
||||
This document describes LLVM BPF backend relocation types.
|
||||
|
||||
Relocation Record
|
||||
=================
|
||||
|
||||
LLVM BPF backend records each relocation with the following 16-byte
|
||||
ELF structure::
|
||||
|
||||
typedef struct
|
||||
{
|
||||
Elf64_Addr r_offset; // Offset from the beginning of section.
|
||||
Elf64_Xword r_info; // Relocation type and symbol index.
|
||||
} Elf64_Rel;
|
||||
|
||||
For example, for the following code::
|
||||
|
||||
int g1 __attribute__((section("sec")));
|
||||
int g2 __attribute__((section("sec")));
|
||||
static volatile int l1 __attribute__((section("sec")));
|
||||
static volatile int l2 __attribute__((section("sec")));
|
||||
int test() {
|
||||
return g1 + g2 + l1 + l2;
|
||||
}
|
||||
|
||||
Compiled with ``clang -target bpf -O2 -c test.c``, the following is
|
||||
the code with ``llvm-objdump -dr test.o``::
|
||||
|
||||
0: 18 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 r1 = 0 ll
|
||||
0000000000000000: R_BPF_64_64 g1
|
||||
2: 61 11 00 00 00 00 00 00 r1 = *(u32 *)(r1 + 0)
|
||||
3: 18 02 00 00 00 00 00 00 00 00 00 00 00 00 00 00 r2 = 0 ll
|
||||
0000000000000018: R_BPF_64_64 g2
|
||||
5: 61 20 00 00 00 00 00 00 r0 = *(u32 *)(r2 + 0)
|
||||
6: 0f 10 00 00 00 00 00 00 r0 += r1
|
||||
7: 18 01 00 00 08 00 00 00 00 00 00 00 00 00 00 00 r1 = 8 ll
|
||||
0000000000000038: R_BPF_64_64 sec
|
||||
9: 61 11 00 00 00 00 00 00 r1 = *(u32 *)(r1 + 0)
|
||||
10: 0f 10 00 00 00 00 00 00 r0 += r1
|
||||
11: 18 01 00 00 0c 00 00 00 00 00 00 00 00 00 00 00 r1 = 12 ll
|
||||
0000000000000058: R_BPF_64_64 sec
|
||||
13: 61 11 00 00 00 00 00 00 r1 = *(u32 *)(r1 + 0)
|
||||
14: 0f 10 00 00 00 00 00 00 r0 += r1
|
||||
15: 95 00 00 00 00 00 00 00 exit
|
||||
|
||||
There are four relations in the above for four ``LD_imm64`` instructions.
|
||||
The following ``llvm-readelf -r test.o`` shows the binary values of the four
|
||||
relocations::
|
||||
|
||||
Relocation section '.rel.text' at offset 0x190 contains 4 entries:
|
||||
Offset Info Type Symbol's Value Symbol's Name
|
||||
0000000000000000 0000000600000001 R_BPF_64_64 0000000000000000 g1
|
||||
0000000000000018 0000000700000001 R_BPF_64_64 0000000000000004 g2
|
||||
0000000000000038 0000000400000001 R_BPF_64_64 0000000000000000 sec
|
||||
0000000000000058 0000000400000001 R_BPF_64_64 0000000000000000 sec
|
||||
|
||||
Each relocation is represented by ``Offset`` (8 bytes) and ``Info`` (8 bytes).
|
||||
For example, the first relocation corresponds to the first instruction
|
||||
(Offset 0x0) and the corresponding ``Info`` indicates the relocation type
|
||||
of ``R_BPF_64_64`` (type 1) and the entry in the symbol table (entry 6).
|
||||
The following is the symbol table with ``llvm-readelf -s test.o``::
|
||||
|
||||
Symbol table '.symtab' contains 8 entries:
|
||||
Num: Value Size Type Bind Vis Ndx Name
|
||||
0: 0000000000000000 0 NOTYPE LOCAL DEFAULT UND
|
||||
1: 0000000000000000 0 FILE LOCAL DEFAULT ABS test.c
|
||||
2: 0000000000000008 4 OBJECT LOCAL DEFAULT 4 l1
|
||||
3: 000000000000000c 4 OBJECT LOCAL DEFAULT 4 l2
|
||||
4: 0000000000000000 0 SECTION LOCAL DEFAULT 4 sec
|
||||
5: 0000000000000000 128 FUNC GLOBAL DEFAULT 2 test
|
||||
6: 0000000000000000 4 OBJECT GLOBAL DEFAULT 4 g1
|
||||
7: 0000000000000004 4 OBJECT GLOBAL DEFAULT 4 g2
|
||||
|
||||
The 6th entry is global variable ``g1`` with value 0.
|
||||
|
||||
Similarly, the second relocation is at ``.text`` offset ``0x18``, instruction 3,
|
||||
for global variable ``g2`` which has a symbol value 4, the offset
|
||||
from the start of ``.data`` section.
|
||||
|
||||
The third and fourth relocations refers to static variables ``l1``
|
||||
and ``l2``. From ``.rel.text`` section above, it is not clear
|
||||
which symbols they really refers to as they both refers to
|
||||
symbol table entry 4, symbol ``sec``, which has ``STT_SECTION`` type
|
||||
and represents a section. So for static variable or function,
|
||||
the section offset is written to the original insn
|
||||
buffer, which is called ``A`` (addend). Looking at
|
||||
above insn ``7`` and ``11``, they have section offset ``8`` and ``12``.
|
||||
From symbol table, we can find that they correspond to entries ``2``
|
||||
and ``3`` for ``l1`` and ``l2``.
|
||||
|
||||
In general, the ``A`` is 0 for global variables and functions,
|
||||
and is the section offset or some computation result based on
|
||||
section offset for static variables/functions. The non-section-offset
|
||||
case refers to function calls. See below for more details.
|
||||
|
||||
Different Relocation Types
|
||||
==========================
|
||||
|
||||
Six relocation types are supported. The following is an overview and
|
||||
``S`` represents the value of the symbol in the symbol table::
|
||||
|
||||
Enum ELF Reloc Type Description BitSize Offset Calculation
|
||||
0 R_BPF_NONE None
|
||||
1 R_BPF_64_64 ld_imm64 insn 32 r_offset + 4 S + A
|
||||
2 R_BPF_64_ABS64 normal data 64 r_offset S + A
|
||||
3 R_BPF_64_ABS32 normal data 32 r_offset S + A
|
||||
4 R_BPF_64_NODYLD32 .BTF[.ext] data 32 r_offset S + A
|
||||
10 R_BPF_64_32 call insn 32 r_offset + 4 (S + A) / 8 - 1
|
||||
|
||||
For example, ``R_BPF_64_64`` relocation type is used for ``ld_imm64`` instruction.
|
||||
The actual to-be-relocated data (0 or section offset)
|
||||
is stored at ``r_offset + 4`` and the read/write
|
||||
data bitsize is 32 (4 bytes). The relocation can be resolved with
|
||||
the symbol value plus implicit addend. Note that the ``BitSize`` is 32 which
|
||||
means the section offset must be less than or equal to ``UINT32_MAX`` and this
|
||||
is enforced by LLVM BPF backend.
|
||||
|
||||
In another case, ``R_BPF_64_ABS64`` relocation type is used for normal 64-bit data.
|
||||
The actual to-be-relocated data is stored at ``r_offset`` and the read/write data
|
||||
bitsize is 64 (8 bytes). The relocation can be resolved with
|
||||
the symbol value plus implicit addend.
|
||||
|
||||
Both ``R_BPF_64_ABS32`` and ``R_BPF_64_NODYLD32`` types are for 32-bit data.
|
||||
But ``R_BPF_64_NODYLD32`` specifically refers to relocations in ``.BTF`` and
|
||||
``.BTF.ext`` sections. For cases like bcc where llvm ``ExecutionEngine RuntimeDyld``
|
||||
is involved, ``R_BPF_64_NODYLD32`` types of relocations should not be resolved
|
||||
to actual function/variable address. Otherwise, ``.BTF`` and ``.BTF.ext``
|
||||
become unusable by bcc and kernel.
|
||||
|
||||
Type ``R_BPF_64_32`` is used for call instruction. The call target section
|
||||
offset is stored at ``r_offset + 4`` (32bit) and calculated as
|
||||
``(S + A) / 8 - 1``.
|
||||
|
||||
Examples
|
||||
========
|
||||
|
||||
Types ``R_BPF_64_64`` and ``R_BPF_64_32`` are used to resolve ``ld_imm64``
|
||||
and ``call`` instructions. For example::
|
||||
|
||||
__attribute__((noinline)) __attribute__((section("sec1")))
|
||||
int gfunc(int a, int b) {
|
||||
return a * b;
|
||||
}
|
||||
static __attribute__((noinline)) __attribute__((section("sec1")))
|
||||
int lfunc(int a, int b) {
|
||||
return a + b;
|
||||
}
|
||||
int global __attribute__((section("sec2")));
|
||||
int test(int a, int b) {
|
||||
return gfunc(a, b) + lfunc(a, b) + global;
|
||||
}
|
||||
|
||||
Compiled with ``clang -target bpf -O2 -c test.c``, we will have
|
||||
following code with `llvm-objdump -dr test.o``::
|
||||
|
||||
Disassembly of section .text:
|
||||
|
||||
0000000000000000 <test>:
|
||||
0: bf 26 00 00 00 00 00 00 r6 = r2
|
||||
1: bf 17 00 00 00 00 00 00 r7 = r1
|
||||
2: 85 10 00 00 ff ff ff ff call -1
|
||||
0000000000000010: R_BPF_64_32 gfunc
|
||||
3: bf 08 00 00 00 00 00 00 r8 = r0
|
||||
4: bf 71 00 00 00 00 00 00 r1 = r7
|
||||
5: bf 62 00 00 00 00 00 00 r2 = r6
|
||||
6: 85 10 00 00 02 00 00 00 call 2
|
||||
0000000000000030: R_BPF_64_32 sec1
|
||||
7: 0f 80 00 00 00 00 00 00 r0 += r8
|
||||
8: 18 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 r1 = 0 ll
|
||||
0000000000000040: R_BPF_64_64 global
|
||||
10: 61 11 00 00 00 00 00 00 r1 = *(u32 *)(r1 + 0)
|
||||
11: 0f 10 00 00 00 00 00 00 r0 += r1
|
||||
12: 95 00 00 00 00 00 00 00 exit
|
||||
|
||||
Disassembly of section sec1:
|
||||
|
||||
0000000000000000 <gfunc>:
|
||||
0: bf 20 00 00 00 00 00 00 r0 = r2
|
||||
1: 2f 10 00 00 00 00 00 00 r0 *= r1
|
||||
2: 95 00 00 00 00 00 00 00 exit
|
||||
|
||||
0000000000000018 <lfunc>:
|
||||
3: bf 20 00 00 00 00 00 00 r0 = r2
|
||||
4: 0f 10 00 00 00 00 00 00 r0 += r1
|
||||
5: 95 00 00 00 00 00 00 00 exit
|
||||
|
||||
The first relocation corresponds to ``gfunc(a, b)`` where ``gfunc`` has a value of 0,
|
||||
so the ``call`` instruction offset is ``(0 + 0)/8 - 1 = -1``.
|
||||
The second relocation corresponds to ``lfunc(a, b)`` where ``lfunc`` has a section
|
||||
offset ``0x18``, so the ``call`` instruction offset is ``(0 + 0x18)/8 - 1 = 2``.
|
||||
The third relocation corresponds to ld_imm64 of ``global``, which has a section
|
||||
offset ``0``.
|
||||
|
||||
The following is an example to show how R_BPF_64_ABS64 could be generated::
|
||||
|
||||
int global() { return 0; }
|
||||
struct t { void *g; } gbl = { global };
|
||||
|
||||
Compiled with ``clang -target bpf -O2 -g -c test.c``, we will see a
|
||||
relocation below in ``.data`` section with command
|
||||
``llvm-readelf -r test.o``::
|
||||
|
||||
Relocation section '.rel.data' at offset 0x458 contains 1 entries:
|
||||
Offset Info Type Symbol's Value Symbol's Name
|
||||
0000000000000000 0000000700000002 R_BPF_64_ABS64 0000000000000000 global
|
||||
|
||||
The relocation says the first 8-byte of ``.data`` section should be
|
||||
filled with address of ``global`` variable.
|
||||
|
||||
With ``llvm-readelf`` output, we can see that dwarf sections have a bunch of
|
||||
``R_BPF_64_ABS32`` and ``R_BPF_64_ABS64`` relocations::
|
||||
|
||||
Relocation section '.rel.debug_info' at offset 0x468 contains 13 entries:
|
||||
Offset Info Type Symbol's Value Symbol's Name
|
||||
0000000000000006 0000000300000003 R_BPF_64_ABS32 0000000000000000 .debug_abbrev
|
||||
000000000000000c 0000000400000003 R_BPF_64_ABS32 0000000000000000 .debug_str
|
||||
0000000000000012 0000000400000003 R_BPF_64_ABS32 0000000000000000 .debug_str
|
||||
0000000000000016 0000000600000003 R_BPF_64_ABS32 0000000000000000 .debug_line
|
||||
000000000000001a 0000000400000003 R_BPF_64_ABS32 0000000000000000 .debug_str
|
||||
000000000000001e 0000000200000002 R_BPF_64_ABS64 0000000000000000 .text
|
||||
000000000000002b 0000000400000003 R_BPF_64_ABS32 0000000000000000 .debug_str
|
||||
0000000000000037 0000000800000002 R_BPF_64_ABS64 0000000000000000 gbl
|
||||
0000000000000040 0000000400000003 R_BPF_64_ABS32 0000000000000000 .debug_str
|
||||
......
|
||||
|
||||
The .BTF/.BTF.ext sections has R_BPF_64_NODYLD32 relocations::
|
||||
|
||||
Relocation section '.rel.BTF' at offset 0x538 contains 1 entries:
|
||||
Offset Info Type Symbol's Value Symbol's Name
|
||||
0000000000000084 0000000800000004 R_BPF_64_NODYLD32 0000000000000000 gbl
|
||||
|
||||
Relocation section '.rel.BTF.ext' at offset 0x548 contains 2 entries:
|
||||
Offset Info Type Symbol's Value Symbol's Name
|
||||
000000000000002c 0000000200000004 R_BPF_64_NODYLD32 0000000000000000 .text
|
||||
0000000000000040 0000000200000004 R_BPF_64_NODYLD32 0000000000000000 .text
|
||||
@@ -146,7 +146,6 @@ Legacy
|
||||
|
||||
irq_domain_add_simple()
|
||||
irq_domain_add_legacy()
|
||||
irq_domain_add_legacy_isa()
|
||||
irq_domain_create_simple()
|
||||
irq_domain_create_legacy()
|
||||
|
||||
|
||||
@@ -24,11 +24,8 @@ String Conversions
|
||||
.. kernel-doc:: lib/vsprintf.c
|
||||
:export:
|
||||
|
||||
.. kernel-doc:: include/linux/kernel.h
|
||||
:functions: kstrtol
|
||||
|
||||
.. kernel-doc:: include/linux/kernel.h
|
||||
:functions: kstrtoul
|
||||
.. kernel-doc:: include/linux/kstrtox.h
|
||||
:functions: kstrtol kstrtoul
|
||||
|
||||
.. kernel-doc:: lib/kstrtox.c
|
||||
:export:
|
||||
|
||||
@@ -107,9 +107,6 @@ also ``CONFIG_DYNAMIC_DEBUG`` in the case of pr_debug()) is defined.
|
||||
Function reference
|
||||
==================
|
||||
|
||||
.. kernel-doc:: kernel/printk/printk.c
|
||||
:functions: printk
|
||||
|
||||
.. kernel-doc:: include/linux/printk.h
|
||||
:functions: pr_emerg pr_alert pr_crit pr_err pr_warn pr_notice pr_info
|
||||
:functions: printk pr_emerg pr_alert pr_crit pr_err pr_warn pr_notice pr_info
|
||||
pr_fmt pr_debug pr_devel pr_cont
|
||||
|
||||
@@ -125,6 +125,17 @@ used when printing stack backtraces. The specifier takes into
|
||||
consideration the effect of compiler optimisations which may occur
|
||||
when tail-calls are used and marked with the noreturn GCC attribute.
|
||||
|
||||
If the pointer is within a module, the module name and optionally build ID is
|
||||
printed after the symbol name with an extra ``b`` appended to the end of the
|
||||
specifier.
|
||||
|
||||
::
|
||||
%pS versatile_init+0x0/0x110 [module_name]
|
||||
%pSb versatile_init+0x0/0x110 [module_name ed5019fdf5e53be37cb1ba7899292d7e143b259e]
|
||||
%pSRb versatile_init+0x9/0x110 [module_name ed5019fdf5e53be37cb1ba7899292d7e143b259e]
|
||||
(with __builtin_extract_return_addr() translation)
|
||||
%pBb prev_fn_of_versatile_init+0x88/0x88 [module_name ed5019fdf5e53be37cb1ba7899292d7e143b259e]
|
||||
|
||||
Probed Pointers from BPF / tracing
|
||||
----------------------------------
|
||||
|
||||
|
||||
@@ -58,9 +58,6 @@ And optionally
|
||||
|
||||
.driver_data - cpufreq driver specific data.
|
||||
|
||||
.resolve_freq - Returns the most appropriate frequency for a target
|
||||
frequency. Doesn't change the frequency though.
|
||||
|
||||
.get_intermediate and target_intermediate - Used to switch to stable
|
||||
frequency while changing CPU frequency.
|
||||
|
||||
@@ -71,9 +68,6 @@ And optionally
|
||||
.exit - A pointer to a per-policy cleanup function called during
|
||||
CPU_POST_DEAD phase of cpu hotplug process.
|
||||
|
||||
.stop_cpu - A pointer to a per-policy stop function called during
|
||||
CPU_DOWN_PREPARE phase of cpu hotplug process.
|
||||
|
||||
.suspend - A pointer to a per-policy suspend function which is called
|
||||
with interrupts disabled and _after_ the governor is stopped for the
|
||||
policy.
|
||||
|
||||
@@ -447,11 +447,10 @@ When a test fails due to a failed ``kmalloc``::
|
||||
|
||||
When a test fails due to a missing KASAN report::
|
||||
|
||||
# kmalloc_double_kzfree: EXPECTATION FAILED at lib/test_kasan.c:629
|
||||
Expected kasan_data->report_expected == kasan_data->report_found, but
|
||||
kasan_data->report_expected == 1
|
||||
kasan_data->report_found == 0
|
||||
not ok 28 - kmalloc_double_kzfree
|
||||
# kmalloc_double_kzfree: EXPECTATION FAILED at lib/test_kasan.c:974
|
||||
KASAN failure expected in "kfree_sensitive(ptr)", but none occurred
|
||||
not ok 44 - kmalloc_double_kzfree
|
||||
|
||||
|
||||
At the end the cumulative status of all KASAN tests is printed. On success::
|
||||
|
||||
|
||||
@@ -27,75 +27,57 @@ Error reports
|
||||
A typical data race report looks like this::
|
||||
|
||||
==================================================================
|
||||
BUG: KCSAN: data-race in generic_permission / kernfs_refresh_inode
|
||||
BUG: KCSAN: data-race in test_kernel_read / test_kernel_write
|
||||
|
||||
write to 0xffff8fee4c40700c of 4 bytes by task 175 on cpu 4:
|
||||
kernfs_refresh_inode+0x70/0x170
|
||||
kernfs_iop_permission+0x4f/0x90
|
||||
inode_permission+0x190/0x200
|
||||
link_path_walk.part.0+0x503/0x8e0
|
||||
path_lookupat.isra.0+0x69/0x4d0
|
||||
filename_lookup+0x136/0x280
|
||||
user_path_at_empty+0x47/0x60
|
||||
vfs_statx+0x9b/0x130
|
||||
__do_sys_newlstat+0x50/0xb0
|
||||
__x64_sys_newlstat+0x37/0x50
|
||||
do_syscall_64+0x85/0x260
|
||||
entry_SYSCALL_64_after_hwframe+0x44/0xa9
|
||||
write to 0xffffffffc009a628 of 8 bytes by task 487 on cpu 0:
|
||||
test_kernel_write+0x1d/0x30
|
||||
access_thread+0x89/0xd0
|
||||
kthread+0x23e/0x260
|
||||
ret_from_fork+0x22/0x30
|
||||
|
||||
read to 0xffff8fee4c40700c of 4 bytes by task 166 on cpu 6:
|
||||
generic_permission+0x5b/0x2a0
|
||||
kernfs_iop_permission+0x66/0x90
|
||||
inode_permission+0x190/0x200
|
||||
link_path_walk.part.0+0x503/0x8e0
|
||||
path_lookupat.isra.0+0x69/0x4d0
|
||||
filename_lookup+0x136/0x280
|
||||
user_path_at_empty+0x47/0x60
|
||||
do_faccessat+0x11a/0x390
|
||||
__x64_sys_access+0x3c/0x50
|
||||
do_syscall_64+0x85/0x260
|
||||
entry_SYSCALL_64_after_hwframe+0x44/0xa9
|
||||
read to 0xffffffffc009a628 of 8 bytes by task 488 on cpu 6:
|
||||
test_kernel_read+0x10/0x20
|
||||
access_thread+0x89/0xd0
|
||||
kthread+0x23e/0x260
|
||||
ret_from_fork+0x22/0x30
|
||||
|
||||
value changed: 0x00000000000009a6 -> 0x00000000000009b2
|
||||
|
||||
Reported by Kernel Concurrency Sanitizer on:
|
||||
CPU: 6 PID: 166 Comm: systemd-journal Not tainted 5.3.0-rc7+ #1
|
||||
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.12.0-1 04/01/2014
|
||||
CPU: 6 PID: 488 Comm: access_thread Not tainted 5.12.0-rc2+ #1
|
||||
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.14.0-2 04/01/2014
|
||||
==================================================================
|
||||
|
||||
The header of the report provides a short summary of the functions involved in
|
||||
the race. It is followed by the access types and stack traces of the 2 threads
|
||||
involved in the data race.
|
||||
involved in the data race. If KCSAN also observed a value change, the observed
|
||||
old value and new value are shown on the "value changed" line respectively.
|
||||
|
||||
The other less common type of data race report looks like this::
|
||||
|
||||
==================================================================
|
||||
BUG: KCSAN: data-race in e1000_clean_rx_irq+0x551/0xb10
|
||||
BUG: KCSAN: data-race in test_kernel_rmw_array+0x71/0xd0
|
||||
|
||||
race at unknown origin, with read to 0xffff933db8a2ae6c of 1 bytes by interrupt on cpu 0:
|
||||
e1000_clean_rx_irq+0x551/0xb10
|
||||
e1000_clean+0x533/0xda0
|
||||
net_rx_action+0x329/0x900
|
||||
__do_softirq+0xdb/0x2db
|
||||
irq_exit+0x9b/0xa0
|
||||
do_IRQ+0x9c/0xf0
|
||||
ret_from_intr+0x0/0x18
|
||||
default_idle+0x3f/0x220
|
||||
arch_cpu_idle+0x21/0x30
|
||||
do_idle+0x1df/0x230
|
||||
cpu_startup_entry+0x14/0x20
|
||||
rest_init+0xc5/0xcb
|
||||
arch_call_rest_init+0x13/0x2b
|
||||
start_kernel+0x6db/0x700
|
||||
race at unknown origin, with read to 0xffffffffc009bdb0 of 8 bytes by task 515 on cpu 2:
|
||||
test_kernel_rmw_array+0x71/0xd0
|
||||
access_thread+0x89/0xd0
|
||||
kthread+0x23e/0x260
|
||||
ret_from_fork+0x22/0x30
|
||||
|
||||
value changed: 0x0000000000002328 -> 0x0000000000002329
|
||||
|
||||
Reported by Kernel Concurrency Sanitizer on:
|
||||
CPU: 0 PID: 0 Comm: swapper/0 Not tainted 5.3.0-rc7+ #2
|
||||
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.12.0-1 04/01/2014
|
||||
CPU: 2 PID: 515 Comm: access_thread Not tainted 5.12.0-rc2+ #1
|
||||
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.14.0-2 04/01/2014
|
||||
==================================================================
|
||||
|
||||
This report is generated where it was not possible to determine the other
|
||||
racing thread, but a race was inferred due to the data value of the watched
|
||||
memory location having changed. These can occur either due to missing
|
||||
instrumentation or e.g. DMA accesses. These reports will only be generated if
|
||||
``CONFIG_KCSAN_REPORT_RACE_UNKNOWN_ORIGIN=y`` (selected by default).
|
||||
memory location having changed. These reports always show a "value changed"
|
||||
line. A common reason for reports of this type are missing instrumentation in
|
||||
the racing thread, but could also occur due to e.g. DMA accesses. Such reports
|
||||
are shown only if ``CONFIG_KCSAN_REPORT_RACE_UNKNOWN_ORIGIN=y``, which is
|
||||
enabled by default.
|
||||
|
||||
Selective analysis
|
||||
~~~~~~~~~~~~~~~~~~
|
||||
@@ -106,7 +88,8 @@ the below options are available:
|
||||
|
||||
* KCSAN understands the ``data_race(expr)`` annotation, which tells KCSAN that
|
||||
any data races due to accesses in ``expr`` should be ignored and resulting
|
||||
behaviour when encountering a data race is deemed safe.
|
||||
behaviour when encountering a data race is deemed safe. Please see
|
||||
`"Marking Shared-Memory Accesses" in the LKMM`_ for more information.
|
||||
|
||||
* Disabling data race detection for entire functions can be accomplished by
|
||||
using the function attribute ``__no_kcsan``::
|
||||
@@ -128,6 +111,8 @@ the below options are available:
|
||||
|
||||
KCSAN_SANITIZE := n
|
||||
|
||||
.. _"Marking Shared-Memory Accesses" in the LKMM: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/tools/memory-model/Documentation/access-marking.txt
|
||||
|
||||
Furthermore, it is possible to tell KCSAN to show or hide entire classes of
|
||||
data races, depending on preferences. These can be changed via the following
|
||||
Kconfig options:
|
||||
|
||||
@@ -14,6 +14,7 @@ KUnit - Unit Testing for the Linux Kernel
|
||||
style
|
||||
faq
|
||||
tips
|
||||
running_tips
|
||||
|
||||
What is KUnit?
|
||||
==============
|
||||
|
||||
@@ -22,14 +22,19 @@ not require any virtualization support: it is just a regular program.
|
||||
What is a .kunitconfig?
|
||||
=======================
|
||||
|
||||
It's just a defconfig that kunit_tool looks for in the base directory.
|
||||
kunit_tool uses it to generate a .config as you might expect. In addition, it
|
||||
verifies that the generated .config contains the CONFIG options in the
|
||||
.kunitconfig; the reason it does this is so that it is easy to be sure that a
|
||||
CONFIG that enables a test actually ends up in the .config.
|
||||
It's just a defconfig that kunit_tool looks for in the build directory
|
||||
(``.kunit`` by default). kunit_tool uses it to generate a .config as you might
|
||||
expect. In addition, it verifies that the generated .config contains the CONFIG
|
||||
options in the .kunitconfig; the reason it does this is so that it is easy to
|
||||
be sure that a CONFIG that enables a test actually ends up in the .config.
|
||||
|
||||
How do I use kunit_tool?
|
||||
========================
|
||||
It's also possible to pass a separate .kunitconfig fragment to kunit_tool,
|
||||
which is useful if you have several different groups of tests you wish
|
||||
to run independently, or if you want to use pre-defined test configs for
|
||||
certain subsystems.
|
||||
|
||||
Getting Started with kunit_tool
|
||||
===============================
|
||||
|
||||
If a kunitconfig is present at the root directory, all you have to do is:
|
||||
|
||||
@@ -48,10 +53,177 @@ However, you most likely want to use it with the following options:
|
||||
|
||||
.. note::
|
||||
This command will work even without a .kunitconfig file: if no
|
||||
.kunitconfig is present, a default one will be used instead.
|
||||
.kunitconfig is present, a default one will be used instead.
|
||||
|
||||
If you wish to use a different .kunitconfig file (such as one provided for
|
||||
testing a particular subsystem), you can pass it as an option.
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
./tools/testing/kunit/kunit.py run --kunitconfig=fs/ext4/.kunitconfig
|
||||
|
||||
For a list of all the flags supported by kunit_tool, you can run:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
./tools/testing/kunit/kunit.py run --help
|
||||
|
||||
Configuring, Building, and Running Tests
|
||||
========================================
|
||||
|
||||
It's also possible to run just parts of the KUnit build process independently,
|
||||
which is useful if you want to make manual changes to part of the process.
|
||||
|
||||
A .config can be generated from a .kunitconfig by using the ``config`` argument
|
||||
when running kunit_tool:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
./tools/testing/kunit/kunit.py config
|
||||
|
||||
Similarly, if you just want to build a KUnit kernel from the current .config,
|
||||
you can use the ``build`` argument:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
./tools/testing/kunit/kunit.py build
|
||||
|
||||
And, if you already have a built UML kernel with built-in KUnit tests, you can
|
||||
run the kernel and display the test results with the ``exec`` argument:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
./tools/testing/kunit/kunit.py exec
|
||||
|
||||
The ``run`` command which is discussed above is equivalent to running all three
|
||||
of these in sequence.
|
||||
|
||||
All of these commands accept a number of optional command-line arguments. The
|
||||
``--help`` flag will give a complete list of these, or keep reading this page
|
||||
for a guide to some of the more useful ones.
|
||||
|
||||
Parsing Test Results
|
||||
====================
|
||||
|
||||
KUnit tests output their results in TAP (Test Anything Protocol) format.
|
||||
kunit_tool will, when running tests, parse this output and print a summary
|
||||
which is much more pleasant to read. If you wish to look at the raw test
|
||||
results in TAP format, you can pass the ``--raw_output`` argument.
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
./tools/testing/kunit/kunit.py run --raw_output
|
||||
|
||||
.. note::
|
||||
The raw output from test runs may contain other, non-KUnit kernel log
|
||||
lines.
|
||||
|
||||
If you have KUnit results in their raw TAP format, you can parse them and print
|
||||
the human-readable summary with the ``parse`` command for kunit_tool. This
|
||||
accepts a filename for an argument, or will read from standard input.
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
# Reading from a file
|
||||
./tools/testing/kunit/kunit.py parse /var/log/dmesg
|
||||
# Reading from stdin
|
||||
dmesg | ./tools/testing/kunit/kunit.py parse
|
||||
|
||||
This is very useful if you wish to run tests in a configuration not supported
|
||||
by kunit_tool (such as on real hardware, or an unsupported architecture).
|
||||
|
||||
Filtering Tests
|
||||
===============
|
||||
|
||||
It's possible to run only a subset of the tests built into a kernel by passing
|
||||
a filter to the ``exec`` or ``run`` commands. For example, if you only wanted
|
||||
to run KUnit resource tests, you could use:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
./tools/testing/kunit/kunit.py run 'kunit-resource*'
|
||||
|
||||
This uses the standard glob format for wildcards.
|
||||
|
||||
Running Tests on QEMU
|
||||
=====================
|
||||
|
||||
kunit_tool supports running tests on QEMU as well as via UML (as mentioned
|
||||
elsewhere). The default way of running tests on QEMU requires two flags:
|
||||
|
||||
``--arch``
|
||||
Selects a collection of configs (Kconfig as well as QEMU configs
|
||||
options, etc) that allow KUnit tests to be run on the specified
|
||||
architecture in a minimal way; this is usually not much slower than
|
||||
using UML. The architecture argument is the same as the name of the
|
||||
option passed to the ``ARCH`` variable used by Kbuild. Not all
|
||||
architectures are currently supported by this flag, but can be handled
|
||||
by the ``--qemu_config`` discussed later. If ``um`` is passed (or this
|
||||
this flag is ignored) the tests will run via UML. Non-UML architectures,
|
||||
e.g. i386, x86_64, arm, um, etc. Non-UML run on QEMU.
|
||||
|
||||
``--cross_compile``
|
||||
Specifies the use of a toolchain by Kbuild. The argument passed here is
|
||||
the same passed to the ``CROSS_COMPILE`` variable used by Kbuild. As a
|
||||
reminder this will be the prefix for the toolchain binaries such as gcc
|
||||
for example ``sparc64-linux-gnu-`` if you have the sparc toolchain
|
||||
installed on your system, or
|
||||
``$HOME/toolchains/microblaze/gcc-9.2.0-nolibc/microblaze-linux/bin/microblaze-linux-``
|
||||
if you have downloaded the microblaze toolchain from the 0-day website
|
||||
to a directory in your home directory called ``toolchains``.
|
||||
|
||||
In many cases it is likely that you may want to run an architecture which is
|
||||
not supported by the ``--arch`` flag, or you may want to just run KUnit tests
|
||||
on QEMU using a non-default configuration. For this use case, you can write
|
||||
your own QemuConfig. These QemuConfigs are written in Python. They must have an
|
||||
import line ``from ..qemu_config import QemuArchParams`` at the top of the file
|
||||
and the file must contain a variable called ``QEMU_ARCH`` that has an instance
|
||||
of ``QemuArchParams`` assigned to it. An example can be seen in
|
||||
``tools/testing/kunit/qemu_configs/x86_64.py``.
|
||||
|
||||
Once you have a QemuConfig you can pass it into kunit_tool using the
|
||||
``--qemu_config`` flag; when used this flag replaces the ``--arch`` flag. If we
|
||||
were to do this with the ``x86_64.py`` example from above, the invocation would
|
||||
look something like this:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
./tools/testing/kunit/kunit.py run \
|
||||
--timeout=60 \
|
||||
--jobs=12 \
|
||||
--qemu_config=./tools/testing/kunit/qemu_configs/x86_64.py
|
||||
|
||||
Other Useful Options
|
||||
====================
|
||||
|
||||
kunit_tool has a number of other command-line arguments which can be useful
|
||||
when adapting it to fit your environment or needs.
|
||||
|
||||
Some of the more useful ones are:
|
||||
|
||||
``--help``
|
||||
Lists all of the available options. Note that different commands
|
||||
(``config``, ``build``, ``run``, etc) will have different supported
|
||||
options. Place ``--help`` before the command to list common options,
|
||||
and after the command for options specific to that command.
|
||||
|
||||
``--build_dir``
|
||||
Specifies the build directory that kunit_tool will use. This is where
|
||||
the .kunitconfig file is located, as well as where the .config and
|
||||
compiled kernel will be placed. Defaults to ``.kunit``.
|
||||
|
||||
``--make_options``
|
||||
Specifies additional options to pass to ``make`` when compiling a
|
||||
kernel (with the ``build`` or ``run`` commands). For example, to enable
|
||||
compiler warnings, you can pass ``--make_options W=1``.
|
||||
|
||||
``--alltests``
|
||||
Builds a UML kernel with all config options enabled using ``make
|
||||
allyesconfig``. This allows you to run as many tests as is possible,
|
||||
but is very slow and prone to breakage as new options are added or
|
||||
modified. In most cases, enabling all tests which have satisfied
|
||||
dependencies by adding ``CONFIG_KUNIT_ALL_TESTS=1`` to your
|
||||
.kunitconfig is preferable.
|
||||
|
||||
There are several other options (and new ones are often added), so do check
|
||||
``--help`` if you're looking for something not mentioned here.
|
||||
|
||||
259
Documentation/dev-tools/kunit/running_tips.rst
Normal file
259
Documentation/dev-tools/kunit/running_tips.rst
Normal file
@@ -0,0 +1,259 @@
|
||||
.. SPDX-License-Identifier: GPL-2.0
|
||||
|
||||
============================
|
||||
Tips For Running KUnit Tests
|
||||
============================
|
||||
|
||||
Using ``kunit.py run`` ("kunit tool")
|
||||
=====================================
|
||||
|
||||
Running from any directory
|
||||
--------------------------
|
||||
|
||||
It can be handy to create a bash function like:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
function run_kunit() {
|
||||
( cd "$(git rev-parse --show-toplevel)" && ./tools/testing/kunit/kunit.py run $@ )
|
||||
}
|
||||
|
||||
.. note::
|
||||
Early versions of ``kunit.py`` (before 5.6) didn't work unless run from
|
||||
the kernel root, hence the use of a subshell and ``cd``.
|
||||
|
||||
Running a subset of tests
|
||||
-------------------------
|
||||
|
||||
``kunit.py run`` accepts an optional glob argument to filter tests. Currently
|
||||
this only matches against suite names, but this may change in the future.
|
||||
|
||||
Say that we wanted to run the sysctl tests, we could do so via:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
$ echo -e 'CONFIG_KUNIT=y\nCONFIG_KUNIT_ALL_TESTS=y' > .kunit/.kunitconfig
|
||||
$ ./tools/testing/kunit/kunit.py run 'sysctl*'
|
||||
|
||||
We're paying the cost of building more tests than we need this way, but it's
|
||||
easier than fiddling with ``.kunitconfig`` files or commenting out
|
||||
``kunit_suite``'s.
|
||||
|
||||
However, if we wanted to define a set of tests in a less ad hoc way, the next
|
||||
tip is useful.
|
||||
|
||||
Defining a set of tests
|
||||
-----------------------
|
||||
|
||||
``kunit.py run`` (along with ``build``, and ``config``) supports a
|
||||
``--kunitconfig`` flag. So if you have a set of tests that you want to run on a
|
||||
regular basis (especially if they have other dependencies), you can create a
|
||||
specific ``.kunitconfig`` for them.
|
||||
|
||||
E.g. kunit has one for its tests:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
$ ./tools/testing/kunit/kunit.py run --kunitconfig=lib/kunit/.kunitconfig
|
||||
|
||||
Alternatively, if you're following the convention of naming your
|
||||
file ``.kunitconfig``, you can just pass in the dir, e.g.
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
$ ./tools/testing/kunit/kunit.py run --kunitconfig=lib/kunit
|
||||
|
||||
.. note::
|
||||
This is a relatively new feature (5.12+) so we don't have any
|
||||
conventions yet about on what files should be checked in versus just
|
||||
kept around locally. It's up to you and your maintainer to decide if a
|
||||
config is useful enough to submit (and therefore have to maintain).
|
||||
|
||||
.. note::
|
||||
Having ``.kunitconfig`` fragments in a parent and child directory is
|
||||
iffy. There's discussion about adding an "import" statement in these
|
||||
files to make it possible to have a top-level config run tests from all
|
||||
child directories. But that would mean ``.kunitconfig`` files are no
|
||||
longer just simple .config fragments.
|
||||
|
||||
One alternative would be to have kunit tool recursively combine configs
|
||||
automagically, but tests could theoretically depend on incompatible
|
||||
options, so handling that would be tricky.
|
||||
|
||||
Generating code coverage reports under UML
|
||||
------------------------------------------
|
||||
|
||||
.. note::
|
||||
TODO(brendanhiggins@google.com): There are various issues with UML and
|
||||
versions of gcc 7 and up. You're likely to run into missing ``.gcda``
|
||||
files or compile errors. We know one `faulty GCC commit
|
||||
<https://github.com/gcc-mirror/gcc/commit/8c9434c2f9358b8b8bad2c1990edf10a21645f9d>`_
|
||||
but not how we'd go about getting this fixed. The compile errors still
|
||||
need some investigation.
|
||||
|
||||
.. note::
|
||||
TODO(brendanhiggins@google.com): for recent versions of Linux
|
||||
(5.10-5.12, maybe earlier), there's a bug with gcov counters not being
|
||||
flushed in UML. This translates to very low (<1%) reported coverage. This is
|
||||
related to the above issue and can be worked around by replacing the
|
||||
one call to ``uml_abort()`` (it's in ``os_dump_core()``) with a plain
|
||||
``exit()``.
|
||||
|
||||
|
||||
This is different from the "normal" way of getting coverage information that is
|
||||
documented in Documentation/dev-tools/gcov.rst.
|
||||
|
||||
Instead of enabling ``CONFIG_GCOV_KERNEL=y``, we can set these options:
|
||||
|
||||
.. code-block:: none
|
||||
|
||||
CONFIG_DEBUG_KERNEL=y
|
||||
CONFIG_DEBUG_INFO=y
|
||||
CONFIG_GCOV=y
|
||||
|
||||
|
||||
Putting it together into a copy-pastable sequence of commands:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
# Append coverage options to the current config
|
||||
$ echo -e "CONFIG_DEBUG_KERNEL=y\nCONFIG_DEBUG_INFO=y\nCONFIG_GCOV=y" >> .kunit/.kunitconfig
|
||||
$ ./tools/testing/kunit/kunit.py run
|
||||
# Extract the coverage information from the build dir (.kunit/)
|
||||
$ lcov -t "my_kunit_tests" -o coverage.info -c -d .kunit/
|
||||
|
||||
# From here on, it's the same process as with CONFIG_GCOV_KERNEL=y
|
||||
# E.g. can generate an HTML report in a tmp dir like so:
|
||||
$ genhtml -o /tmp/coverage_html coverage.info
|
||||
|
||||
|
||||
If your installed version of gcc doesn't work, you can tweak the steps:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
$ ./tools/testing/kunit/kunit.py run --make_options=CC=/usr/bin/gcc-6
|
||||
$ lcov -t "my_kunit_tests" -o coverage.info -c -d .kunit/ --gcov-tool=/usr/bin/gcov-6
|
||||
|
||||
|
||||
Running tests manually
|
||||
======================
|
||||
|
||||
Running tests without using ``kunit.py run`` is also an important use case.
|
||||
Currently it's your only option if you want to test on architectures other than
|
||||
UML.
|
||||
|
||||
As running the tests under UML is fairly straightforward (configure and compile
|
||||
the kernel, run the ``./linux`` binary), this section will focus on testing
|
||||
non-UML architectures.
|
||||
|
||||
|
||||
Running built-in tests
|
||||
----------------------
|
||||
|
||||
When setting tests to ``=y``, the tests will run as part of boot and print
|
||||
results to dmesg in TAP format. So you just need to add your tests to your
|
||||
``.config``, build and boot your kernel as normal.
|
||||
|
||||
So if we compiled our kernel with:
|
||||
|
||||
.. code-block:: none
|
||||
|
||||
CONFIG_KUNIT=y
|
||||
CONFIG_KUNIT_EXAMPLE_TEST=y
|
||||
|
||||
Then we'd see output like this in dmesg signaling the test ran and passed:
|
||||
|
||||
.. code-block:: none
|
||||
|
||||
TAP version 14
|
||||
1..1
|
||||
# Subtest: example
|
||||
1..1
|
||||
# example_simple_test: initializing
|
||||
ok 1 - example_simple_test
|
||||
ok 1 - example
|
||||
|
||||
Running tests as modules
|
||||
------------------------
|
||||
|
||||
Depending on the tests, you can build them as loadable modules.
|
||||
|
||||
For example, we'd change the config options from before to
|
||||
|
||||
.. code-block:: none
|
||||
|
||||
CONFIG_KUNIT=y
|
||||
CONFIG_KUNIT_EXAMPLE_TEST=m
|
||||
|
||||
Then after booting into our kernel, we can run the test via
|
||||
|
||||
.. code-block:: none
|
||||
|
||||
$ modprobe kunit-example-test
|
||||
|
||||
This will then cause it to print TAP output to stdout.
|
||||
|
||||
.. note::
|
||||
The ``modprobe`` will *not* have a non-zero exit code if any test
|
||||
failed (as of 5.13). But ``kunit.py parse`` would, see below.
|
||||
|
||||
.. note::
|
||||
You can set ``CONFIG_KUNIT=m`` as well, however, some features will not
|
||||
work and thus some tests might break. Ideally tests would specify they
|
||||
depend on ``KUNIT=y`` in their ``Kconfig``'s, but this is an edge case
|
||||
most test authors won't think about.
|
||||
As of 5.13, the only difference is that ``current->kunit_test`` will
|
||||
not exist.
|
||||
|
||||
Pretty-printing results
|
||||
-----------------------
|
||||
|
||||
You can use ``kunit.py parse`` to parse dmesg for test output and print out
|
||||
results in the same familiar format that ``kunit.py run`` does.
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
$ ./tools/testing/kunit/kunit.py parse /var/log/dmesg
|
||||
|
||||
|
||||
Retrieving per suite results
|
||||
----------------------------
|
||||
|
||||
Regardless of how you're running your tests, you can enable
|
||||
``CONFIG_KUNIT_DEBUGFS`` to expose per-suite TAP-formatted results:
|
||||
|
||||
.. code-block:: none
|
||||
|
||||
CONFIG_KUNIT=y
|
||||
CONFIG_KUNIT_EXAMPLE_TEST=m
|
||||
CONFIG_KUNIT_DEBUGFS=y
|
||||
|
||||
The results for each suite will be exposed under
|
||||
``/sys/kernel/debug/kunit/<suite>/results``.
|
||||
So using our example config:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
$ modprobe kunit-example-test > /dev/null
|
||||
$ cat /sys/kernel/debug/kunit/example/results
|
||||
... <TAP output> ...
|
||||
|
||||
# After removing the module, the corresponding files will go away
|
||||
$ modprobe -r kunit-example-test
|
||||
$ cat /sys/kernel/debug/kunit/example/results
|
||||
/sys/kernel/debug/kunit/example/results: No such file or directory
|
||||
|
||||
Generating code coverage reports
|
||||
--------------------------------
|
||||
|
||||
See Documentation/dev-tools/gcov.rst for details on how to do this.
|
||||
|
||||
The only vaguely KUnit-specific advice here is that you probably want to build
|
||||
your tests as modules. That way you can isolate the coverage from tests from
|
||||
other code executed during boot, e.g.
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
# Reset coverage counters before running the test.
|
||||
$ echo 0 > /sys/kernel/debug/gcov/reset
|
||||
$ modprobe kunit-example-test
|
||||
@@ -36,7 +36,7 @@ A good starting point for a ``.kunitconfig`` is the KUnit defconfig:
|
||||
.. code-block:: bash
|
||||
|
||||
cd $PATH_TO_LINUX_REPO
|
||||
cp arch/um/configs/kunit_defconfig .kunitconfig
|
||||
cp tools/testing/kunit/configs/default.config .kunitconfig
|
||||
|
||||
You can then add any other Kconfig options you wish, e.g.:
|
||||
|
||||
@@ -236,5 +236,7 @@ Next Steps
|
||||
==========
|
||||
* Check out the Documentation/dev-tools/kunit/tips.rst page for tips on
|
||||
writing idiomatic KUnit tests.
|
||||
* Check out the :doc:`running_tips` page for tips on
|
||||
how to make running KUnit tests easier.
|
||||
* Optional: see the :doc:`usage` page for a more
|
||||
in-depth explanation of KUnit.
|
||||
|
||||
@@ -467,10 +467,9 @@ fictitious example for ``sha1sum(1)``
|
||||
|
||||
.. code-block:: c
|
||||
|
||||
/* Note: the cast is to satisfy overly strict type-checking. */
|
||||
#define TEST_SHA1(in, want) \
|
||||
sha1sum(in, out); \
|
||||
KUNIT_EXPECT_STREQ_MSG(test, (char *)out, want, "sha1sum(%s)", in);
|
||||
KUNIT_EXPECT_STREQ_MSG(test, out, want, "sha1sum(%s)", in);
|
||||
|
||||
char out[40];
|
||||
TEST_SHA1("hello world", "2aae6c35c94fcfb415dbe95f408b9ce91ee846ed");
|
||||
@@ -509,7 +508,7 @@ In some cases, it can be helpful to write a *table-driven test* instead, e.g.
|
||||
};
|
||||
for (i = 0; i < ARRAY_SIZE(cases); ++i) {
|
||||
sha1sum(cases[i].str, out);
|
||||
KUNIT_EXPECT_STREQ_MSG(test, (char *)out, cases[i].sha1,
|
||||
KUNIT_EXPECT_STREQ_MSG(test, out, cases[i].sha1,
|
||||
"sha1sum(%s)", cases[i].str);
|
||||
}
|
||||
|
||||
@@ -570,7 +569,7 @@ Reusing the same ``cases`` array from above, we can write the test as a
|
||||
struct sha1_test_case *test_param = (struct sha1_test_case *)(test->param_value);
|
||||
|
||||
sha1sum(test_param->str, out);
|
||||
KUNIT_EXPECT_STREQ_MSG(test, (char *)out, test_param->sha1,
|
||||
KUNIT_EXPECT_STREQ_MSG(test, out, test_param->sha1,
|
||||
"sha1sum(%s)", test_param->str);
|
||||
}
|
||||
|
||||
@@ -611,17 +610,45 @@ non-UML architectures:
|
||||
None of these are reasons not to run your KUnit tests on real hardware; they are
|
||||
only things to be aware of when doing so.
|
||||
|
||||
The biggest impediment will likely be that certain KUnit features and
|
||||
infrastructure may not support your target environment. For example, at this
|
||||
time the KUnit Wrapper (``tools/testing/kunit/kunit.py``) does not work outside
|
||||
of UML. Unfortunately, there is no way around this. Using UML (or even just a
|
||||
particular architecture) allows us to make a lot of assumptions that make it
|
||||
possible to do things which might otherwise be impossible.
|
||||
Currently, the KUnit Wrapper (``tools/testing/kunit/kunit.py``) (aka
|
||||
kunit_tool) only fully supports running tests inside of UML and QEMU; however,
|
||||
this is only due to our own time limitations as humans working on KUnit. It is
|
||||
entirely possible to support other emulators and even actual hardware, but for
|
||||
now QEMU and UML is what is fully supported within the KUnit Wrapper. Again, to
|
||||
be clear, this is just the Wrapper. The actualy KUnit tests and the KUnit
|
||||
library they are written in is fully architecture agnostic and can be used in
|
||||
virtually any setup, you just won't have the benefit of typing a single command
|
||||
out of the box and having everything magically work perfectly.
|
||||
|
||||
Nevertheless, all core KUnit framework features are fully supported on all
|
||||
architectures, and using them is straightforward: all you need to do is to take
|
||||
your kunitconfig, your Kconfig options for the tests you would like to run, and
|
||||
merge them into whatever config your are using for your platform. That's it!
|
||||
Again, all core KUnit framework features are fully supported on all
|
||||
architectures, and using them is straightforward: Most popular architectures
|
||||
are supported directly in the KUnit Wrapper via QEMU. Currently, supported
|
||||
architectures on QEMU include:
|
||||
|
||||
* i386
|
||||
* x86_64
|
||||
* arm
|
||||
* arm64
|
||||
* alpha
|
||||
* powerpc
|
||||
* riscv
|
||||
* s390
|
||||
* sparc
|
||||
|
||||
In order to run KUnit tests on one of these architectures via QEMU with the
|
||||
KUnit wrapper, all you need to do is specify the flags ``--arch`` and
|
||||
``--cross_compile`` when invoking the KUnit Wrapper. For example, we could run
|
||||
the default KUnit tests on ARM in the following manner (assuming we have an ARM
|
||||
toolchain installed):
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
tools/testing/kunit/kunit.py run --timeout=60 --jobs=12 --arch=arm --cross_compile=arm-linux-gnueabihf-
|
||||
|
||||
Alternatively, if you want to run your tests on real hardware or in some other
|
||||
emulation environment, all you need to do is to take your kunitconfig, your
|
||||
Kconfig options for the tests you would like to run, and merge them into
|
||||
whatever config your are using for your platform. That's it!
|
||||
|
||||
For example, let's say you have the following kunitconfig:
|
||||
|
||||
|
||||
@@ -1,27 +0,0 @@
|
||||
System Control and Power Interface (SCPI) Message Protocol
|
||||
(in addition to the standard binding in [0])
|
||||
----------------------------------------------------------
|
||||
Required properties
|
||||
|
||||
- compatible : should be "amlogic,meson-gxbb-scpi"
|
||||
|
||||
AMLOGIC SRAM and Shared Memory for SCPI
|
||||
------------------------------------
|
||||
|
||||
Required properties:
|
||||
- compatible : should be "amlogic,meson-gxbb-sram"
|
||||
|
||||
Each sub-node represents the reserved area for SCPI.
|
||||
|
||||
Required sub-node properties:
|
||||
- compatible : should be "amlogic,meson-gxbb-scp-shmem" for SRAM based shared
|
||||
memory on Amlogic GXBB SoC.
|
||||
|
||||
Sensor bindings for the sensors based on SCPI Message Protocol
|
||||
--------------------------------------------------------------
|
||||
SCPI provides an API to access the various sensors on the SoC.
|
||||
|
||||
Required properties:
|
||||
- compatible : should be "amlogic,meson-gxbb-scpi-sensors".
|
||||
|
||||
[0] Documentation/devicetree/bindings/arm/arm,scpi.txt
|
||||
@@ -167,6 +167,7 @@ properties:
|
||||
- description: Boards with the Amlogic Meson SM1 S905X3/D3/Y3 SoC
|
||||
items:
|
||||
- enum:
|
||||
- bananapi,bpi-m5
|
||||
- hardkernel,odroid-c4
|
||||
- hardkernel,odroid-hc4
|
||||
- khadas,vim3l
|
||||
|
||||
@@ -1,239 +0,0 @@
|
||||
System Control and Management Interface (SCMI) Message Protocol
|
||||
----------------------------------------------------------
|
||||
|
||||
The SCMI is intended to allow agents such as OSPM to manage various functions
|
||||
that are provided by the hardware platform it is running on, including power
|
||||
and performance functions.
|
||||
|
||||
This binding is intended to define the interface the firmware implementing
|
||||
the SCMI as described in ARM document number ARM DEN 0056A ("ARM System Control
|
||||
and Management Interface Platform Design Document")[0] provide for OSPM in
|
||||
the device tree.
|
||||
|
||||
Required properties:
|
||||
|
||||
The scmi node with the following properties shall be under the /firmware/ node.
|
||||
|
||||
- compatible : shall be "arm,scmi" or "arm,scmi-smc" for smc/hvc transports
|
||||
- mboxes: List of phandle and mailbox channel specifiers. It should contain
|
||||
exactly one or two mailboxes, one for transmitting messages("tx")
|
||||
and another optional for receiving the notifications("rx") if
|
||||
supported.
|
||||
- shmem : List of phandle pointing to the shared memory(SHM) area as per
|
||||
generic mailbox client binding.
|
||||
- #address-cells : should be '1' if the device has sub-nodes, maps to
|
||||
protocol identifier for a given sub-node.
|
||||
- #size-cells : should be '0' as 'reg' property doesn't have any size
|
||||
associated with it.
|
||||
- arm,smc-id : SMC id required when using smc or hvc transports
|
||||
|
||||
Optional properties:
|
||||
|
||||
- mbox-names: shall be "tx" or "rx" depending on mboxes entries.
|
||||
|
||||
- interrupts : when using smc or hvc transports, this optional
|
||||
property indicates that msg completion by the platform is indicated
|
||||
by an interrupt rather than by the return of the smc call. This
|
||||
should not be used except when the platform requires such behavior.
|
||||
|
||||
- interrupt-names : if "interrupts" is present, interrupt-names must also
|
||||
be present and have the value "a2p".
|
||||
|
||||
See Documentation/devicetree/bindings/mailbox/mailbox.txt for more details
|
||||
about the generic mailbox controller and client driver bindings.
|
||||
|
||||
The mailbox is the only permitted method of calling the SCMI firmware.
|
||||
Mailbox doorbell is used as a mechanism to alert the presence of a
|
||||
messages and/or notification.
|
||||
|
||||
Each protocol supported shall have a sub-node with corresponding compatible
|
||||
as described in the following sections. If the platform supports dedicated
|
||||
communication channel for a particular protocol, the 3 properties namely:
|
||||
mboxes, mbox-names and shmem shall be present in the sub-node corresponding
|
||||
to that protocol.
|
||||
|
||||
Clock/Performance bindings for the clocks/OPPs based on SCMI Message Protocol
|
||||
------------------------------------------------------------
|
||||
|
||||
This binding uses the common clock binding[1].
|
||||
|
||||
Required properties:
|
||||
- #clock-cells : Should be 1. Contains the Clock ID value used by SCMI commands.
|
||||
|
||||
Power domain bindings for the power domains based on SCMI Message Protocol
|
||||
------------------------------------------------------------
|
||||
|
||||
This binding for the SCMI power domain providers uses the generic power
|
||||
domain binding[2].
|
||||
|
||||
Required properties:
|
||||
- #power-domain-cells : Should be 1. Contains the device or the power
|
||||
domain ID value used by SCMI commands.
|
||||
|
||||
Regulator bindings for the SCMI Regulator based on SCMI Message Protocol
|
||||
------------------------------------------------------------
|
||||
An SCMI Regulator is permanently bound to a well defined SCMI Voltage Domain,
|
||||
and should be always positioned as a root regulator.
|
||||
It does not support any current operation.
|
||||
|
||||
SCMI Regulators are grouped under a 'regulators' node which in turn is a child
|
||||
of the SCMI Voltage protocol node inside the desired SCMI instance node.
|
||||
|
||||
This binding uses the common regulator binding[6].
|
||||
|
||||
Required properties:
|
||||
- reg : shall identify an existent SCMI Voltage Domain.
|
||||
|
||||
Sensor bindings for the sensors based on SCMI Message Protocol
|
||||
--------------------------------------------------------------
|
||||
SCMI provides an API to access the various sensors on the SoC.
|
||||
|
||||
Required properties:
|
||||
- #thermal-sensor-cells: should be set to 1. This property follows the
|
||||
thermal device tree bindings[3].
|
||||
|
||||
Valid cell values are raw identifiers (Sensor ID)
|
||||
as used by the firmware. Refer to platform details
|
||||
for your implementation for the IDs to use.
|
||||
|
||||
Reset signal bindings for the reset domains based on SCMI Message Protocol
|
||||
------------------------------------------------------------
|
||||
|
||||
This binding for the SCMI reset domain providers uses the generic reset
|
||||
signal binding[5].
|
||||
|
||||
Required properties:
|
||||
- #reset-cells : Should be 1. Contains the reset domain ID value used
|
||||
by SCMI commands.
|
||||
|
||||
SRAM and Shared Memory for SCMI
|
||||
-------------------------------
|
||||
|
||||
A small area of SRAM is reserved for SCMI communication between application
|
||||
processors and SCP.
|
||||
|
||||
The properties should follow the generic mmio-sram description found in [4]
|
||||
|
||||
Each sub-node represents the reserved area for SCMI.
|
||||
|
||||
Required sub-node properties:
|
||||
- reg : The base offset and size of the reserved area with the SRAM
|
||||
- compatible : should be "arm,scmi-shmem" for Non-secure SRAM based
|
||||
shared memory
|
||||
|
||||
[0] http://infocenter.arm.com/help/topic/com.arm.doc.den0056a/index.html
|
||||
[1] Documentation/devicetree/bindings/clock/clock-bindings.txt
|
||||
[2] Documentation/devicetree/bindings/power/power-domain.yaml
|
||||
[3] Documentation/devicetree/bindings/thermal/thermal*.yaml
|
||||
[4] Documentation/devicetree/bindings/sram/sram.yaml
|
||||
[5] Documentation/devicetree/bindings/reset/reset.txt
|
||||
[6] Documentation/devicetree/bindings/regulator/regulator.yaml
|
||||
|
||||
Example:
|
||||
|
||||
sram@50000000 {
|
||||
compatible = "mmio-sram";
|
||||
reg = <0x0 0x50000000 0x0 0x10000>;
|
||||
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
ranges = <0 0x0 0x50000000 0x10000>;
|
||||
|
||||
cpu_scp_lpri: scp-shmem@0 {
|
||||
compatible = "arm,scmi-shmem";
|
||||
reg = <0x0 0x200>;
|
||||
};
|
||||
|
||||
cpu_scp_hpri: scp-shmem@200 {
|
||||
compatible = "arm,scmi-shmem";
|
||||
reg = <0x200 0x200>;
|
||||
};
|
||||
};
|
||||
|
||||
mailbox@40000000 {
|
||||
....
|
||||
#mbox-cells = <1>;
|
||||
reg = <0x0 0x40000000 0x0 0x10000>;
|
||||
};
|
||||
|
||||
firmware {
|
||||
|
||||
...
|
||||
|
||||
scmi {
|
||||
compatible = "arm,scmi";
|
||||
mboxes = <&mailbox 0 &mailbox 1>;
|
||||
mbox-names = "tx", "rx";
|
||||
shmem = <&cpu_scp_lpri &cpu_scp_hpri>;
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
|
||||
scmi_devpd: protocol@11 {
|
||||
reg = <0x11>;
|
||||
#power-domain-cells = <1>;
|
||||
};
|
||||
|
||||
scmi_dvfs: protocol@13 {
|
||||
reg = <0x13>;
|
||||
#clock-cells = <1>;
|
||||
};
|
||||
|
||||
scmi_clk: protocol@14 {
|
||||
reg = <0x14>;
|
||||
#clock-cells = <1>;
|
||||
};
|
||||
|
||||
scmi_sensors0: protocol@15 {
|
||||
reg = <0x15>;
|
||||
#thermal-sensor-cells = <1>;
|
||||
};
|
||||
|
||||
scmi_reset: protocol@16 {
|
||||
reg = <0x16>;
|
||||
#reset-cells = <1>;
|
||||
};
|
||||
|
||||
scmi_voltage: protocol@17 {
|
||||
reg = <0x17>;
|
||||
|
||||
regulators {
|
||||
regulator_devX: regulator@0 {
|
||||
reg = <0x0>;
|
||||
regulator-max-microvolt = <3300000>;
|
||||
};
|
||||
|
||||
regulator_devY: regulator@9 {
|
||||
reg = <0x9>;
|
||||
regulator-min-microvolt = <500000>;
|
||||
regulator-max-microvolt = <4200000>;
|
||||
};
|
||||
|
||||
...
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
cpu@0 {
|
||||
...
|
||||
reg = <0 0>;
|
||||
clocks = <&scmi_dvfs 0>;
|
||||
};
|
||||
|
||||
hdlcd@7ff60000 {
|
||||
...
|
||||
reg = <0 0x7ff60000 0 0x1000>;
|
||||
clocks = <&scmi_clk 4>;
|
||||
power-domains = <&scmi_devpd 1>;
|
||||
resets = <&scmi_reset 10>;
|
||||
};
|
||||
|
||||
thermal-zones {
|
||||
soc_thermal {
|
||||
polling-delay-passive = <100>;
|
||||
polling-delay = <1000>;
|
||||
/* sensor ID */
|
||||
thermal-sensors = <&scmi_sensors0 3>;
|
||||
...
|
||||
};
|
||||
};
|
||||
@@ -1,219 +0,0 @@
|
||||
System Control and Power Interface (SCPI) Message Protocol
|
||||
----------------------------------------------------------
|
||||
|
||||
Firmware implementing the SCPI described in ARM document number ARM DUI 0922B
|
||||
("ARM Compute Subsystem SCP: Message Interface Protocols")[0] can be used
|
||||
by Linux to initiate various system control and power operations.
|
||||
|
||||
Required properties:
|
||||
|
||||
- compatible : should be
|
||||
* "arm,scpi" : For implementations complying to SCPI v1.0 or above
|
||||
* "arm,scpi-pre-1.0" : For implementations complying to all
|
||||
unversioned releases prior to SCPI v1.0
|
||||
- mboxes: List of phandle and mailbox channel specifiers
|
||||
All the channels reserved by remote SCP firmware for use by
|
||||
SCPI message protocol should be specified in any order
|
||||
- shmem : List of phandle pointing to the shared memory(SHM) area between the
|
||||
processors using these mailboxes for IPC, one for each mailbox
|
||||
SHM can be any memory reserved for the purpose of this communication
|
||||
between the processors.
|
||||
|
||||
See Documentation/devicetree/bindings/mailbox/mailbox.txt
|
||||
for more details about the generic mailbox controller and
|
||||
client driver bindings.
|
||||
|
||||
Clock bindings for the clocks based on SCPI Message Protocol
|
||||
------------------------------------------------------------
|
||||
|
||||
This binding uses the common clock binding[1].
|
||||
|
||||
Container Node
|
||||
==============
|
||||
Required properties:
|
||||
- compatible : should be "arm,scpi-clocks"
|
||||
All the clocks provided by SCP firmware via SCPI message
|
||||
protocol much be listed as sub-nodes under this node.
|
||||
|
||||
Sub-nodes
|
||||
=========
|
||||
Required properties:
|
||||
- compatible : shall include one of the following
|
||||
"arm,scpi-dvfs-clocks" - all the clocks that are variable and index based.
|
||||
These clocks don't provide an entire range of values between the
|
||||
limits but only discrete points within the range. The firmware
|
||||
provides the mapping for each such operating frequency and the
|
||||
index associated with it. The firmware also manages the
|
||||
voltage scaling appropriately with the clock scaling.
|
||||
"arm,scpi-variable-clocks" - all the clocks that are variable and provide full
|
||||
range within the specified range. The firmware provides the
|
||||
range of values within a specified range.
|
||||
|
||||
Other required properties for all clocks(all from common clock binding):
|
||||
- #clock-cells : Should be 1. Contains the Clock ID value used by SCPI commands.
|
||||
- clock-output-names : shall be the corresponding names of the outputs.
|
||||
- clock-indices: The identifying number for the clocks(i.e.clock_id) in the
|
||||
node. It can be non linear and hence provide the mapping of identifiers
|
||||
into the clock-output-names array.
|
||||
|
||||
SRAM and Shared Memory for SCPI
|
||||
-------------------------------
|
||||
|
||||
A small area of SRAM is reserved for SCPI communication between application
|
||||
processors and SCP.
|
||||
|
||||
The properties should follow the generic mmio-sram description found in [3]
|
||||
|
||||
Each sub-node represents the reserved area for SCPI.
|
||||
|
||||
Required sub-node properties:
|
||||
- reg : The base offset and size of the reserved area with the SRAM
|
||||
- compatible : should be "arm,scp-shmem" for Non-secure SRAM based
|
||||
shared memory
|
||||
|
||||
Sensor bindings for the sensors based on SCPI Message Protocol
|
||||
--------------------------------------------------------------
|
||||
SCPI provides an API to access the various sensors on the SoC.
|
||||
|
||||
Required properties:
|
||||
- compatible : should be "arm,scpi-sensors".
|
||||
- #thermal-sensor-cells: should be set to 1. This property follows the
|
||||
thermal device tree bindings[2].
|
||||
|
||||
Valid cell values are raw identifiers (Sensor ID)
|
||||
as used by the firmware. Refer to platform details
|
||||
for your implementation for the IDs to use.
|
||||
|
||||
Power domain bindings for the power domains based on SCPI Message Protocol
|
||||
------------------------------------------------------------
|
||||
|
||||
This binding uses the generic power domain binding[4].
|
||||
|
||||
PM domain providers
|
||||
===================
|
||||
|
||||
Required properties:
|
||||
- #power-domain-cells : Should be 1. Contains the device or the power
|
||||
domain ID value used by SCPI commands.
|
||||
- num-domains: Total number of power domains provided by SCPI. This is
|
||||
needed as the SCPI message protocol lacks a mechanism to
|
||||
query this information at runtime.
|
||||
|
||||
PM domain consumers
|
||||
===================
|
||||
|
||||
Required properties:
|
||||
- power-domains : A phandle and PM domain specifier as defined by bindings of
|
||||
the power controller specified by phandle.
|
||||
|
||||
[0] http://infocenter.arm.com/help/topic/com.arm.doc.dui0922b/index.html
|
||||
[1] Documentation/devicetree/bindings/clock/clock-bindings.txt
|
||||
[2] Documentation/devicetree/bindings/thermal/thermal*.yaml
|
||||
[3] Documentation/devicetree/bindings/sram/sram.yaml
|
||||
[4] Documentation/devicetree/bindings/power/power-domain.yaml
|
||||
|
||||
Example:
|
||||
|
||||
sram: sram@50000000 {
|
||||
compatible = "arm,juno-sram-ns", "mmio-sram";
|
||||
reg = <0x0 0x50000000 0x0 0x10000>;
|
||||
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
ranges = <0 0x0 0x50000000 0x10000>;
|
||||
|
||||
cpu_scp_lpri: scp-shmem@0 {
|
||||
compatible = "arm,juno-scp-shmem";
|
||||
reg = <0x0 0x200>;
|
||||
};
|
||||
|
||||
cpu_scp_hpri: scp-shmem@200 {
|
||||
compatible = "arm,juno-scp-shmem";
|
||||
reg = <0x200 0x200>;
|
||||
};
|
||||
};
|
||||
|
||||
mailbox: mailbox0@40000000 {
|
||||
....
|
||||
#mbox-cells = <1>;
|
||||
};
|
||||
|
||||
scpi_protocol: scpi@2e000000 {
|
||||
compatible = "arm,scpi";
|
||||
mboxes = <&mailbox 0 &mailbox 1>;
|
||||
shmem = <&cpu_scp_lpri &cpu_scp_hpri>;
|
||||
|
||||
clocks {
|
||||
compatible = "arm,scpi-clocks";
|
||||
|
||||
scpi_dvfs: scpi_clocks@0 {
|
||||
compatible = "arm,scpi-dvfs-clocks";
|
||||
#clock-cells = <1>;
|
||||
clock-indices = <0>, <1>, <2>;
|
||||
clock-output-names = "atlclk", "aplclk","gpuclk";
|
||||
};
|
||||
scpi_clk: scpi_clocks@3 {
|
||||
compatible = "arm,scpi-variable-clocks";
|
||||
#clock-cells = <1>;
|
||||
clock-indices = <3>, <4>;
|
||||
clock-output-names = "pxlclk0", "pxlclk1";
|
||||
};
|
||||
};
|
||||
|
||||
scpi_sensors0: sensors {
|
||||
compatible = "arm,scpi-sensors";
|
||||
#thermal-sensor-cells = <1>;
|
||||
};
|
||||
|
||||
scpi_devpd: scpi-power-domains {
|
||||
compatible = "arm,scpi-power-domains";
|
||||
num-domains = <2>;
|
||||
#power-domain-cells = <1>;
|
||||
};
|
||||
};
|
||||
|
||||
cpu@0 {
|
||||
...
|
||||
reg = <0 0>;
|
||||
clocks = <&scpi_dvfs 0>;
|
||||
};
|
||||
|
||||
hdlcd@7ff60000 {
|
||||
...
|
||||
reg = <0 0x7ff60000 0 0x1000>;
|
||||
clocks = <&scpi_clk 4>;
|
||||
power-domains = <&scpi_devpd 1>;
|
||||
};
|
||||
|
||||
thermal-zones {
|
||||
soc_thermal {
|
||||
polling-delay-passive = <100>;
|
||||
polling-delay = <1000>;
|
||||
|
||||
/* sensor ID */
|
||||
thermal-sensors = <&scpi_sensors0 3>;
|
||||
...
|
||||
};
|
||||
};
|
||||
|
||||
In the above example, the #clock-cells is set to 1 as required.
|
||||
scpi_dvfs has 3 output clocks namely: atlclk, aplclk, and gpuclk with 0,
|
||||
1 and 2 as clock-indices. scpi_clk has 2 output clocks namely: pxlclk0
|
||||
and pxlclk1 with 3 and 4 as clock-indices.
|
||||
|
||||
The first consumer in the example is cpu@0 and it has '0' as the clock
|
||||
specifier which points to the first entry in the output clocks of
|
||||
scpi_dvfs i.e. "atlclk".
|
||||
|
||||
Similarly the second example is hdlcd@7ff60000 and it has pxlclk1 as input
|
||||
clock. '4' in the clock specifier here points to the second entry
|
||||
in the output clocks of scpi_clocks i.e. "pxlclk1"
|
||||
|
||||
The thermal-sensors property in the soc_thermal node uses the
|
||||
temperature sensor provided by SCP firmware to setup a thermal
|
||||
zone. The ID "3" is the sensor identifier for the temperature sensor
|
||||
as used by the firmware.
|
||||
|
||||
The num-domains property in scpi-power-domains domain specifies that
|
||||
SCPI provides 2 power domains. The hdlcd node uses the power domain with
|
||||
domain ID 1.
|
||||
46
Documentation/devicetree/bindings/arm/arm,scu.yaml
Normal file
46
Documentation/devicetree/bindings/arm/arm,scu.yaml
Normal file
@@ -0,0 +1,46 @@
|
||||
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
|
||||
%YAML 1.2
|
||||
---
|
||||
$id: http://devicetree.org/schemas/arm/arm,scu.yaml#
|
||||
$schema: http://devicetree.org/meta-schemas/core.yaml#
|
||||
|
||||
title: ARM Snoop Control Unit (SCU)
|
||||
|
||||
maintainers:
|
||||
- Linus Walleij <linus.walleij@linaro.org>
|
||||
|
||||
description: |
|
||||
As part of the MPCore complex, Cortex-A5 and Cortex-A9 are provided
|
||||
with a Snoop Control Unit. The register range is usually 256 (0x100)
|
||||
bytes.
|
||||
|
||||
References:
|
||||
- Cortex-A9: see DDI0407E Cortex-A9 MPCore Technical Reference Manual
|
||||
Revision r2p0
|
||||
- Cortex-A5: see DDI0434B Cortex-A5 MPCore Technical Reference Manual
|
||||
Revision r0p1
|
||||
- ARM11 MPCore: see DDI0360F ARM 11 MPCore Processor Technical Reference
|
||||
Manial Revision r2p0
|
||||
|
||||
properties:
|
||||
compatible:
|
||||
enum:
|
||||
- arm,cortex-a9-scu
|
||||
- arm,cortex-a5-scu
|
||||
- arm,arm11mp-scu
|
||||
|
||||
reg:
|
||||
maxItems: 1
|
||||
|
||||
required:
|
||||
- compatible
|
||||
- reg
|
||||
|
||||
additionalProperties: false
|
||||
|
||||
examples:
|
||||
- |
|
||||
scu@a0410000 {
|
||||
compatible = "arm,cortex-a9-scu";
|
||||
reg = <0xa0410000 0x100>;
|
||||
};
|
||||
@@ -18,6 +18,7 @@ properties:
|
||||
- description: BCM2711 based Boards
|
||||
items:
|
||||
- enum:
|
||||
- raspberrypi,400
|
||||
- raspberrypi,4-model-b
|
||||
- const: brcm,bcm2711
|
||||
|
||||
|
||||
@@ -257,6 +257,13 @@ properties:
|
||||
|
||||
where voltage is in V, frequency is in MHz.
|
||||
|
||||
performance-domains:
|
||||
maxItems: 1
|
||||
description:
|
||||
List of phandles and performance domain specifiers, as defined by
|
||||
bindings of the performance domain provider. See also
|
||||
dvfs/performance-domain.yaml.
|
||||
|
||||
power-domains:
|
||||
description:
|
||||
List of phandles and PM domain specifiers, as defined by bindings of the
|
||||
|
||||
@@ -1,31 +0,0 @@
|
||||
OP-TEE Device Tree Bindings
|
||||
|
||||
OP-TEE is a piece of software using hardware features to provide a Trusted
|
||||
Execution Environment. The security can be provided with ARM TrustZone, but
|
||||
also by virtualization or a separate chip.
|
||||
|
||||
We're using "linaro" as the first part of the compatible property for
|
||||
the reference implementation maintained by Linaro.
|
||||
|
||||
* OP-TEE based on ARM TrustZone required properties:
|
||||
|
||||
- compatible : should contain "linaro,optee-tz"
|
||||
|
||||
- method : The method of calling the OP-TEE Trusted OS. Permitted
|
||||
values are:
|
||||
|
||||
"smc" : SMC #0, with the register assignments specified
|
||||
in drivers/tee/optee/optee_smc.h
|
||||
|
||||
"hvc" : HVC #0, with the register assignments specified
|
||||
in drivers/tee/optee/optee_smc.h
|
||||
|
||||
|
||||
|
||||
Example:
|
||||
firmware {
|
||||
optee {
|
||||
compatible = "linaro,optee-tz";
|
||||
method = "smc";
|
||||
};
|
||||
};
|
||||
@@ -0,0 +1,58 @@
|
||||
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
|
||||
%YAML 1.2
|
||||
---
|
||||
$id: http://devicetree.org/schemas/arm/firmware/linaro,optee-tz.yaml#
|
||||
$schema: http://devicetree.org/meta-schemas/core.yaml#
|
||||
|
||||
title: OP-TEE Device Tree Bindings
|
||||
|
||||
maintainers:
|
||||
- Jens Wiklander <jens.wiklander@linaro.org>
|
||||
|
||||
description: |
|
||||
OP-TEE is a piece of software using hardware features to provide a Trusted
|
||||
Execution Environment. The security can be provided with ARM TrustZone, but
|
||||
also by virtualization or a separate chip.
|
||||
|
||||
We're using "linaro" as the first part of the compatible property for
|
||||
the reference implementation maintained by Linaro.
|
||||
|
||||
properties:
|
||||
$nodename:
|
||||
const: optee
|
||||
|
||||
compatible:
|
||||
const: linaro,optee-tz
|
||||
|
||||
method:
|
||||
enum: [smc, hvc]
|
||||
description: |
|
||||
The method of calling the OP-TEE Trusted OS depending on smc or hvc
|
||||
instruction usage.
|
||||
SMC #0, register assignments
|
||||
or
|
||||
HVC #0, register assignments
|
||||
register assignments are specified in drivers/tee/optee/optee_smc.h
|
||||
|
||||
required:
|
||||
- compatible
|
||||
- method
|
||||
|
||||
additionalProperties: false
|
||||
|
||||
examples:
|
||||
- |
|
||||
firmware {
|
||||
optee {
|
||||
compatible = "linaro,optee-tz";
|
||||
method = "smc";
|
||||
};
|
||||
};
|
||||
|
||||
- |
|
||||
firmware {
|
||||
optee {
|
||||
compatible = "linaro,optee-tz";
|
||||
method = "hvc";
|
||||
};
|
||||
};
|
||||
@@ -86,13 +86,11 @@ This binding uses the common clock binding[1].
|
||||
|
||||
Required properties:
|
||||
- compatible: Should be one of:
|
||||
"fsl,imx8qm-clock"
|
||||
"fsl,imx8qxp-clock"
|
||||
"fsl,imx8qm-clk"
|
||||
"fsl,imx8qxp-clk"
|
||||
followed by "fsl,scu-clk"
|
||||
- #clock-cells: Should be either
|
||||
2: Contains the Resource and Clock ID value.
|
||||
or
|
||||
1: Contains the Clock ID value. (DEPRECATED)
|
||||
- #clock-cells: Should be 2.
|
||||
Contains the Resource and Clock ID value.
|
||||
- clocks: List of clock specifiers, must contain an entry for
|
||||
each required entry in clock-names
|
||||
- clock-names: Should include entries "xtal_32KHz", "xtal_24MHz"
|
||||
|
||||
@@ -197,6 +197,7 @@ properties:
|
||||
- boundary,imx6q-nitrogen6x
|
||||
- compulab,cm-fx6 # CompuLab CM-FX6
|
||||
- dmo,imx6q-edmqmx6 # Data Modul eDM-QMX6 Board
|
||||
- ds,imx6q-sbc # Da Sheng COM-9XX Modules
|
||||
- embest,imx6q-marsboard # Embest MarS Board i.MX6Dual
|
||||
- emtrion,emcon-mx6 # emCON-MX6D or emCON-MX6Q SoM
|
||||
- emtrion,emcon-mx6-avari # emCON-MX6D or emCON-MX6Q SoM on Avari Base
|
||||
@@ -400,6 +401,17 @@ properties:
|
||||
- const: armadeus,imx6dl-apf6 # APF6 (Solo) SoM
|
||||
- const: fsl,imx6dl
|
||||
|
||||
- description: i.MX6DL based congatec QMX6 Boards
|
||||
items:
|
||||
- enum:
|
||||
- ge,imx6dl-b105v2 # General Electric B105v2
|
||||
- ge,imx6dl-b105pv2 # General Electric B105Pv2
|
||||
- ge,imx6dl-b125v2 # General Electric B125v2
|
||||
- ge,imx6dl-b125pv2 # General Electric B125Pv2
|
||||
- ge,imx6dl-b155v2 # General Electric B155v2
|
||||
- const: congatec,qmx6
|
||||
- const: fsl,imx6dl
|
||||
|
||||
- description: i.MX6DL based DFI FS700-M60-6DL Board
|
||||
items:
|
||||
- const: dfi,fs700-m60-6dl
|
||||
@@ -685,6 +697,7 @@ properties:
|
||||
- gw,imx8mm-gw71xx-0x # i.MX8MM Gateworks Development Kit
|
||||
- gw,imx8mm-gw72xx-0x # i.MX8MM Gateworks Development Kit
|
||||
- gw,imx8mm-gw73xx-0x # i.MX8MM Gateworks Development Kit
|
||||
- gw,imx8mm-gw7901 # i.MX8MM Gateworks Board
|
||||
- kontron,imx8mm-n801x-som # i.MX8MM Kontron SL (N801X) SOM
|
||||
- variscite,var-som-mx8mm # i.MX8MM Variscite VAR-SOM-MX8MM module
|
||||
- const: fsl,imx8mm
|
||||
|
||||
@@ -11,6 +11,8 @@ maintainers:
|
||||
- Daniele Alessandrelli <daniele.alessandrelli@intel.com>
|
||||
|
||||
properties:
|
||||
$nodename:
|
||||
const: '/'
|
||||
compatible:
|
||||
items:
|
||||
- enum:
|
||||
|
||||
@@ -17,6 +17,7 @@ properties:
|
||||
- items:
|
||||
- enum:
|
||||
- linksys,nslu2
|
||||
- welltech,epbx100
|
||||
- const: intel,ixp42x
|
||||
- items:
|
||||
- enum:
|
||||
|
||||
@@ -1,26 +0,0 @@
|
||||
System Control and Power Interface (SCPI) Message Protocol
|
||||
(in addition to the standard binding in [0])
|
||||
|
||||
Juno SRAM and Shared Memory for SCPI
|
||||
------------------------------------
|
||||
|
||||
Required properties:
|
||||
- compatible : should be "arm,juno-sram-ns" for Non-secure SRAM
|
||||
|
||||
Each sub-node represents the reserved area for SCPI.
|
||||
|
||||
Required sub-node properties:
|
||||
- reg : The base offset and size of the reserved area with the SRAM
|
||||
- compatible : should be "arm,juno-scp-shmem" for Non-secure SRAM based
|
||||
shared memory on Juno platforms
|
||||
|
||||
Sensor bindings for the sensors based on SCPI Message Protocol
|
||||
--------------------------------------------------------------
|
||||
Required properties:
|
||||
- compatible : should be "arm,scpi-sensors".
|
||||
- #thermal-sensor-cells: should be set to 1.
|
||||
For Juno R0 and Juno R1 refer to [1] for the
|
||||
sensor identifiers
|
||||
|
||||
[0] Documentation/devicetree/bindings/arm/arm,scpi.txt
|
||||
[1] http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0922b/apas03s22.html
|
||||
@@ -1,86 +0,0 @@
|
||||
Texas Instruments System Control Interface (TI-SCI) Message Protocol
|
||||
--------------------------------------------------------------------
|
||||
|
||||
Texas Instrument's processors including those belonging to Keystone generation
|
||||
of processors have separate hardware entity which is now responsible for the
|
||||
management of the System on Chip (SoC) system. These include various system
|
||||
level functions as well.
|
||||
|
||||
An example of such an SoC is K2G, which contains the system control hardware
|
||||
block called Power Management Micro Controller (PMMC). This hardware block is
|
||||
initialized early into boot process and provides services to Operating Systems
|
||||
on multiple processors including ones running Linux.
|
||||
|
||||
See http://processors.wiki.ti.com/index.php/TISCI for protocol definition.
|
||||
|
||||
TI-SCI controller Device Node:
|
||||
=============================
|
||||
|
||||
The TI-SCI node describes the Texas Instrument's System Controller entity node.
|
||||
This parent node may optionally have additional children nodes which describe
|
||||
specific functionality such as clocks, power domain, reset or additional
|
||||
functionality as may be required for the SoC. This hierarchy also describes the
|
||||
relationship between the TI-SCI parent node to the child node.
|
||||
|
||||
Required properties:
|
||||
-------------------
|
||||
- compatible: should be "ti,k2g-sci" for TI 66AK2G SoC
|
||||
should be "ti,am654-sci" for for TI AM654 SoC
|
||||
- mbox-names:
|
||||
"rx" - Mailbox corresponding to receive path
|
||||
"tx" - Mailbox corresponding to transmit path
|
||||
|
||||
- mboxes: Mailboxes corresponding to the mbox-names. Each value of the mboxes
|
||||
property should contain a phandle to the mailbox controller device
|
||||
node and an args specifier that will be the phandle to the intended
|
||||
sub-mailbox child node to be used for communication.
|
||||
|
||||
See Documentation/devicetree/bindings/mailbox/mailbox.txt for more details
|
||||
about the generic mailbox controller and client driver bindings. Also see
|
||||
Documentation/devicetree/bindings/mailbox/ti,message-manager.txt for typical
|
||||
controller that is used to communicate with this System controllers.
|
||||
|
||||
Optional Properties:
|
||||
-------------------
|
||||
- reg-names:
|
||||
debug_messages - Map the Debug message region
|
||||
- reg: register space corresponding to the debug_messages
|
||||
- ti,system-reboot-controller: If system reboot can be triggered by SoC reboot
|
||||
- ti,host-id: Integer value corresponding to the host ID assigned by Firmware
|
||||
for identification of host processing entities such as virtual
|
||||
machines
|
||||
|
||||
Example (K2G):
|
||||
-------------
|
||||
pmmc: pmmc {
|
||||
compatible = "ti,k2g-sci";
|
||||
ti,host-id = <2>;
|
||||
mbox-names = "rx", "tx";
|
||||
mboxes= <&msgmgr &msgmgr_proxy_pmmc_rx>,
|
||||
<&msgmgr &msgmgr_proxy_pmmc_tx>;
|
||||
reg-names = "debug_messages";
|
||||
reg = <0x02921800 0x800>;
|
||||
};
|
||||
|
||||
|
||||
TI-SCI Client Device Node:
|
||||
=========================
|
||||
|
||||
Client nodes are maintained as children of the relevant TI-SCI device node.
|
||||
|
||||
Example (K2G):
|
||||
-------------
|
||||
pmmc: pmmc {
|
||||
compatible = "ti,k2g-sci";
|
||||
...
|
||||
|
||||
my_clk_node: clk_node {
|
||||
...
|
||||
...
|
||||
};
|
||||
|
||||
my_pd_node: pd_node {
|
||||
...
|
||||
...
|
||||
};
|
||||
};
|
||||
129
Documentation/devicetree/bindings/arm/keystone/ti,sci.yaml
Normal file
129
Documentation/devicetree/bindings/arm/keystone/ti,sci.yaml
Normal file
@@ -0,0 +1,129 @@
|
||||
# SPDX-License-Identifier: (GPL-2.0-only or BSD-2-Clause)
|
||||
%YAML 1.2
|
||||
---
|
||||
$id: http://devicetree.org/schemas/arm/keystone/ti,sci.yaml#
|
||||
$schema: http://devicetree.org/meta-schemas/core.yaml#
|
||||
|
||||
title: TI-SCI controller device node bindings
|
||||
|
||||
maintainers:
|
||||
- Nishanth Menon <nm@ti.com>
|
||||
|
||||
description: |
|
||||
Texas Instrument's processors including those belonging to Keystone generation
|
||||
of processors have separate hardware entity which is now responsible for the
|
||||
management of the System on Chip (SoC) system. These include various system
|
||||
level functions as well.
|
||||
|
||||
An example of such an SoC is K2G, which contains the system control hardware
|
||||
block called Power Management Micro Controller (PMMC). This hardware block is
|
||||
initialized early into boot process and provides services to Operating Systems
|
||||
on multiple processors including ones running Linux.
|
||||
|
||||
See http://processors.wiki.ti.com/index.php/TISCI for protocol definition.
|
||||
|
||||
The TI-SCI node describes the Texas Instrument's System Controller entity node.
|
||||
This parent node may optionally have additional children nodes which describe
|
||||
specific functionality such as clocks, power domain, reset or additional
|
||||
functionality as may be required for the SoC. This hierarchy also describes the
|
||||
relationship between the TI-SCI parent node to the child node.
|
||||
|
||||
properties:
|
||||
$nodename:
|
||||
pattern: "^system-controller@[0-9a-f]+$"
|
||||
|
||||
compatible:
|
||||
oneOf:
|
||||
- description: System controller on TI 66AK2G SoC and other K3 SoCs
|
||||
items:
|
||||
- const: ti,k2g-sci
|
||||
- description: System controller on TI AM654 SoC
|
||||
items:
|
||||
- const: ti,am654-sci
|
||||
|
||||
reg-names:
|
||||
description: |
|
||||
Specifies the debug messages memory mapped region that is optionally
|
||||
made available from TI-SCI controller.
|
||||
const: debug_messages
|
||||
|
||||
reg:
|
||||
minItems: 1
|
||||
|
||||
mbox-names:
|
||||
description: |
|
||||
Specifies the mailboxes used to communicate with TI-SCI Controller
|
||||
made available from TI-SCI controller.
|
||||
items:
|
||||
- const: rx
|
||||
- const: tx
|
||||
|
||||
mboxes:
|
||||
minItems: 2
|
||||
|
||||
ti,system-reboot-controller:
|
||||
description: Determines If system reboot can be triggered by SoC reboot
|
||||
type: boolean
|
||||
|
||||
ti,host-id:
|
||||
$ref: /schemas/types.yaml#/definitions/uint32
|
||||
description: |
|
||||
Value corresponding to the host ID assigned by Firmware
|
||||
for identification of host processing entities such as virtual machines.
|
||||
|
||||
power-controller:
|
||||
type: object
|
||||
$ref: /schemas/soc/ti/sci-pm-domain.yaml#
|
||||
|
||||
clock-controller:
|
||||
type: object
|
||||
$ref: /schemas/clock/ti,sci-clk.yaml#
|
||||
|
||||
reset-controller:
|
||||
type: object
|
||||
$ref: /schemas/reset/ti,sci-reset.yaml#
|
||||
|
||||
required:
|
||||
- compatible
|
||||
- mbox-names
|
||||
- mboxes
|
||||
|
||||
additionalProperties: false
|
||||
|
||||
examples:
|
||||
- |
|
||||
pmmc: system-controller@2921800 {
|
||||
compatible = "ti,k2g-sci";
|
||||
ti,system-reboot-controller;
|
||||
mbox-names = "rx", "tx";
|
||||
mboxes= <&msgmgr 5 2>,
|
||||
<&msgmgr 0 0>;
|
||||
reg-names = "debug_messages";
|
||||
reg = <0x02921800 0x800>;
|
||||
};
|
||||
|
||||
- |
|
||||
dmsc: system-controller@44083000 {
|
||||
compatible = "ti,k2g-sci";
|
||||
ti,host-id = <12>;
|
||||
mbox-names = "rx", "tx";
|
||||
mboxes= <&secure_proxy_main 11>,
|
||||
<&secure_proxy_main 13>;
|
||||
reg-names = "debug_messages";
|
||||
reg = <0x44083000 0x1000>;
|
||||
|
||||
k3_pds: power-controller {
|
||||
compatible = "ti,sci-pm-domain";
|
||||
#power-domain-cells = <2>;
|
||||
};
|
||||
|
||||
k3_clks: clock-controller {
|
||||
compatible = "ti,k2g-sci-clk";
|
||||
#clock-cells = <2>;
|
||||
};
|
||||
|
||||
k3_reset: reset-controller {
|
||||
compatible = "ti,sci-reset";
|
||||
#reset-cells = <2>;
|
||||
};
|
||||
};
|
||||
@@ -122,6 +122,10 @@ properties:
|
||||
- enum:
|
||||
- mediatek,mt8195-evb
|
||||
- const: mediatek,mt8195
|
||||
- description: Google Burnet (HP Chromebook x360 11MK G3 EE)
|
||||
items:
|
||||
- const: google,burnet
|
||||
- const: mediatek,mt8183
|
||||
- description: Google Krane (Lenovo IdeaPad Duet, 10e,...)
|
||||
items:
|
||||
- enum:
|
||||
@@ -133,9 +137,19 @@ properties:
|
||||
items:
|
||||
- const: google,damu
|
||||
- const: mediatek,mt8183
|
||||
- description: Google Juniper (Acer Chromebook Spin 311)
|
||||
- description: Google Fennel (Lenovo IdeaPad 3 Chromebook)
|
||||
items:
|
||||
- const: google,juniper-sku16
|
||||
- enum:
|
||||
- google,fennel-sku0
|
||||
- google,fennel-sku1
|
||||
- google,fennel-sku6
|
||||
- const: google,fennel
|
||||
- const: mediatek,mt8183
|
||||
- description: Google Juniper (Acer Chromebook Spin 311) / Kenzo (Acer Chromebook 311)
|
||||
items:
|
||||
- enum:
|
||||
- google,juniper-sku16
|
||||
- google,juniper-sku17
|
||||
- const: google,juniper
|
||||
- const: mediatek,mt8183
|
||||
- description: Google Kakadu (ASUS Chromebook Detachable CM3)
|
||||
@@ -144,6 +158,10 @@ properties:
|
||||
- const: google,kakadu-rev2
|
||||
- const: google,kakadu
|
||||
- const: mediatek,mt8183
|
||||
- description: Google Kappa (HP Chromebook 11a)
|
||||
items:
|
||||
- const: google,kappa
|
||||
- const: mediatek,mt8183
|
||||
- description: Google Kodama (Lenovo 10e Chromebook Tablet)
|
||||
items:
|
||||
- enum:
|
||||
@@ -153,6 +171,13 @@ properties:
|
||||
- google,kodama-sku32
|
||||
- const: google,kodama
|
||||
- const: mediatek,mt8183
|
||||
- description: Google Willow (Acer Chromebook 311 C722/C722T)
|
||||
items:
|
||||
- enum:
|
||||
- google,willow-sku0
|
||||
- google,willow-sku1
|
||||
- const: google,willow
|
||||
- const: mediatek,mt8183
|
||||
- items:
|
||||
- enum:
|
||||
- mediatek,mt8183-pumpkin
|
||||
|
||||
@@ -25,6 +25,7 @@ PROPERTIES
|
||||
"qcom,saw2"
|
||||
A more specific value could be one of:
|
||||
"qcom,apq8064-saw2-v1.1-cpu"
|
||||
"qcom,msm8226-saw2-v2.1-cpu"
|
||||
"qcom,msm8974-saw2-v2.1-cpu"
|
||||
"qcom,apq8084-saw2-v2.1-cpu"
|
||||
|
||||
|
||||
@@ -36,17 +36,20 @@ description: |
|
||||
msm8992
|
||||
msm8994
|
||||
msm8996
|
||||
sa8155p
|
||||
sc7180
|
||||
sc7280
|
||||
sdm630
|
||||
sdm660
|
||||
sdm845
|
||||
sdx55
|
||||
sm8150
|
||||
sm8250
|
||||
sm8350
|
||||
|
||||
The 'board' element must be one of the following strings:
|
||||
|
||||
adp
|
||||
cdp
|
||||
cp01-c1
|
||||
dragonboard
|
||||
@@ -178,6 +181,7 @@ properties:
|
||||
- items:
|
||||
- enum:
|
||||
- qcom,sc7280-idp
|
||||
- google,senor
|
||||
- const: qcom,sc7280
|
||||
|
||||
- items:
|
||||
@@ -198,6 +202,16 @@ properties:
|
||||
- qcom,ipq6018-cp01-c1
|
||||
- const: qcom,ipq6018
|
||||
|
||||
- items:
|
||||
- enum:
|
||||
- qcom,sa8155p-adp
|
||||
- const: qcom,sa8155p
|
||||
|
||||
- items:
|
||||
- enum:
|
||||
- qcom,sm8150-mtp
|
||||
- const: qcom,sm8150
|
||||
|
||||
- items:
|
||||
- enum:
|
||||
- qcom,qrb5165-rb5
|
||||
|
||||
@@ -302,6 +302,24 @@ properties:
|
||||
- renesas,rzn1d400-db # RZN1D-DB (RZ/N1D Demo Board for the RZ/N1D 400 pins package)
|
||||
- const: renesas,r9a06g032
|
||||
|
||||
- description: RZ/G2UL (R9A07G043)
|
||||
items:
|
||||
- enum:
|
||||
- renesas,r9a07g043u11 # RZ/G2UL Type-1
|
||||
- renesas,r9a07g043u12 # RZ/G2UL Type-2
|
||||
- const: renesas,r9a07g043
|
||||
|
||||
- description: RZ/G2{L,LC} (R9A07G044)
|
||||
items:
|
||||
- enum:
|
||||
- renesas,smarc-evk # SMARC EVK
|
||||
- enum:
|
||||
- renesas,r9a07g044c1 # Single Cortex-A55 RZ/G2LC
|
||||
- renesas,r9a07g044c2 # Dual Cortex-A55 RZ/G2LC
|
||||
- renesas,r9a07g044l1 # Single Cortex-A55 RZ/G2L
|
||||
- renesas,r9a07g044l2 # Dual Cortex-A55 RZ/G2L
|
||||
- const: renesas,r9a07g044
|
||||
|
||||
additionalProperties: true
|
||||
|
||||
...
|
||||
|
||||
@@ -600,6 +600,11 @@ properties:
|
||||
- const: zkmagic,a95x-z2
|
||||
- const: rockchip,rk3318
|
||||
|
||||
- description: Rockchip RK3568 Evaluation board
|
||||
items:
|
||||
- const: rockchip,rk3568-evb1-v10
|
||||
- const: rockchip,rk3568
|
||||
|
||||
additionalProperties: true
|
||||
|
||||
...
|
||||
|
||||
@@ -1,16 +0,0 @@
|
||||
Rockchip power-management-unit:
|
||||
-------------------------------
|
||||
|
||||
The pmu is used to turn off and on different power domains of the SoCs
|
||||
This includes the power to the CPU cores.
|
||||
|
||||
Required node properties:
|
||||
- compatible value : = "rockchip,rk3066-pmu";
|
||||
- reg : physical base address and the size of the registers window
|
||||
|
||||
Example:
|
||||
|
||||
pmu@20004000 {
|
||||
compatible = "rockchip,rk3066-pmu";
|
||||
reg = <0x20004000 0x100>;
|
||||
};
|
||||
55
Documentation/devicetree/bindings/arm/rockchip/pmu.yaml
Normal file
55
Documentation/devicetree/bindings/arm/rockchip/pmu.yaml
Normal file
@@ -0,0 +1,55 @@
|
||||
# SPDX-License-Identifier: GPL-2.0
|
||||
%YAML 1.2
|
||||
---
|
||||
$id: http://devicetree.org/schemas/arm/rockchip/pmu.yaml#
|
||||
$schema: http://devicetree.org/meta-schemas/core.yaml#
|
||||
|
||||
title: Rockchip Power Management Unit (PMU)
|
||||
|
||||
maintainers:
|
||||
- Elaine Zhang <zhangqing@rock-chips.com>
|
||||
- Heiko Stuebner <heiko@sntech.de>
|
||||
|
||||
description: |
|
||||
The PMU is used to turn on and off different power domains of the SoCs.
|
||||
This includes the power to the CPU cores.
|
||||
|
||||
select:
|
||||
properties:
|
||||
compatible:
|
||||
contains:
|
||||
enum:
|
||||
- rockchip,px30-pmu
|
||||
- rockchip,rk3066-pmu
|
||||
- rockchip,rk3288-pmu
|
||||
- rockchip,rk3399-pmu
|
||||
|
||||
required:
|
||||
- compatible
|
||||
|
||||
properties:
|
||||
compatible:
|
||||
items:
|
||||
- enum:
|
||||
- rockchip,px30-pmu
|
||||
- rockchip,rk3066-pmu
|
||||
- rockchip,rk3288-pmu
|
||||
- rockchip,rk3399-pmu
|
||||
- const: syscon
|
||||
- const: simple-mfd
|
||||
|
||||
reg:
|
||||
maxItems: 1
|
||||
|
||||
required:
|
||||
- compatible
|
||||
- reg
|
||||
|
||||
additionalProperties: true
|
||||
|
||||
examples:
|
||||
- |
|
||||
pmu@20004000 {
|
||||
compatible = "rockchip,rk3066-pmu", "syscon", "simple-mfd";
|
||||
reg = <0x20004000 0x100>;
|
||||
};
|
||||
@@ -1,28 +0,0 @@
|
||||
* ARM Snoop Control Unit (SCU)
|
||||
|
||||
As part of the MPCore complex, Cortex-A5 and Cortex-A9 are provided
|
||||
with a Snoop Control Unit. The register range is usually 256 (0x100)
|
||||
bytes.
|
||||
|
||||
References:
|
||||
|
||||
- Cortex-A9: see DDI0407E Cortex-A9 MPCore Technical Reference Manual
|
||||
Revision r2p0
|
||||
- Cortex-A5: see DDI0434B Cortex-A5 MPCore Technical Reference Manual
|
||||
Revision r0p1
|
||||
- ARM11 MPCore: see DDI0360F ARM 11 MPCore Processor Technical Reference
|
||||
Manial Revision r2p0
|
||||
|
||||
- compatible : Should be:
|
||||
"arm,cortex-a9-scu"
|
||||
"arm,cortex-a5-scu"
|
||||
"arm,arm11mp-scu"
|
||||
|
||||
- reg : Specify the base address and the size of the SCU register window.
|
||||
|
||||
Example:
|
||||
|
||||
scu@a0410000 {
|
||||
compatible = "arm,cortex-a9-scu";
|
||||
reg = <0xa0410000 0x100>;
|
||||
};
|
||||
@@ -224,6 +224,12 @@ properties:
|
||||
- const: empire-electronix,m712
|
||||
- const: allwinner,sun5i-a13
|
||||
|
||||
- description: Forlinx OKA40i-C Development board
|
||||
items:
|
||||
- const: forlinx,oka40i-c
|
||||
- const: forlinx,feta40i-c
|
||||
- const: allwinner,sun8i-r40
|
||||
|
||||
- description: FriendlyARM NanoPi A64
|
||||
items:
|
||||
- const: friendlyarm,nanopi-a64
|
||||
@@ -269,6 +275,11 @@ properties:
|
||||
- const: friendlyarm,nanopi-r1
|
||||
- const: allwinner,sun8i-h3
|
||||
|
||||
- description: FriendlyARM NanoPi R1S H5
|
||||
items:
|
||||
- const: friendlyarm,nanopi-r1s-h5
|
||||
- const: allwinner,sun50i-h5
|
||||
|
||||
- description: FriendlyARM ZeroPi
|
||||
items:
|
||||
- const: friendlyarm,zeropi
|
||||
|
||||
@@ -301,6 +301,33 @@ patternProperties:
|
||||
|
||||
additionalProperties: false
|
||||
|
||||
core-domain:
|
||||
type: object
|
||||
description: |
|
||||
The vast majority of hardware blocks of Tegra SoC belong to a
|
||||
Core power domain, which has a dedicated voltage rail that powers
|
||||
the blocks.
|
||||
|
||||
properties:
|
||||
operating-points-v2:
|
||||
description:
|
||||
Should contain level, voltages and opp-supported-hw property.
|
||||
The supported-hw is a bitfield indicating SoC speedo or process
|
||||
ID mask.
|
||||
|
||||
"#power-domain-cells":
|
||||
const: 0
|
||||
|
||||
required:
|
||||
- operating-points-v2
|
||||
- "#power-domain-cells"
|
||||
|
||||
additionalProperties: false
|
||||
|
||||
core-supply:
|
||||
description:
|
||||
Phandle to voltage regulator connected to the SoC Core power rail.
|
||||
|
||||
required:
|
||||
- compatible
|
||||
- reg
|
||||
@@ -325,6 +352,7 @@ examples:
|
||||
tegra_pmc: pmc@7000e400 {
|
||||
compatible = "nvidia,tegra210-pmc";
|
||||
reg = <0x7000e400 0x400>;
|
||||
core-supply = <®ulator>;
|
||||
clocks = <&tegra_car TEGRA210_CLK_PCLK>, <&clk32k_in>;
|
||||
clock-names = "pclk", "clk32k_in";
|
||||
#clock-cells = <1>;
|
||||
@@ -338,17 +366,24 @@ examples:
|
||||
nvidia,core-power-req-active-high;
|
||||
nvidia,sys-clock-req-active-high;
|
||||
|
||||
pd_core: core-domain {
|
||||
operating-points-v2 = <&core_opp_table>;
|
||||
#power-domain-cells = <0>;
|
||||
};
|
||||
|
||||
powergates {
|
||||
pd_audio: aud {
|
||||
clocks = <&tegra_car TEGRA210_CLK_APE>,
|
||||
<&tegra_car TEGRA210_CLK_APB2APE>;
|
||||
resets = <&tegra_car 198>;
|
||||
power-domains = <&pd_core>;
|
||||
#power-domain-cells = <0>;
|
||||
};
|
||||
|
||||
pd_xusbss: xusba {
|
||||
clocks = <&tegra_car TEGRA210_CLK_XUSB_SS>;
|
||||
resets = <&tegra_car TEGRA210_CLK_XUSB_SS>;
|
||||
power-domains = <&pd_core>;
|
||||
#power-domain-cells = <0>;
|
||||
};
|
||||
};
|
||||
|
||||
@@ -1,57 +0,0 @@
|
||||
NVIDIA Tegra Activity Monitor
|
||||
|
||||
The activity monitor block collects statistics about the behaviour of other
|
||||
components in the system. This information can be used to derive the rate at
|
||||
which the external memory needs to be clocked in order to serve all requests
|
||||
from the monitored clients.
|
||||
|
||||
Required properties:
|
||||
- compatible: should be "nvidia,tegra<chip>-actmon"
|
||||
- reg: offset and length of the register set for the device
|
||||
- interrupts: standard interrupt property
|
||||
- clocks: Must contain a phandle and clock specifier pair for each entry in
|
||||
clock-names. See ../../clock/clock-bindings.txt for details.
|
||||
- clock-names: Must include the following entries:
|
||||
- actmon
|
||||
- emc
|
||||
- resets: Must contain an entry for each entry in reset-names. See
|
||||
../../reset/reset.txt for details.
|
||||
- reset-names: Must include the following entries:
|
||||
- actmon
|
||||
- operating-points-v2: See ../bindings/opp/opp.txt for details.
|
||||
- interconnects: Should contain entries for memory clients sitting on
|
||||
MC->EMC memory interconnect path.
|
||||
- interconnect-names: Should include name of the interconnect path for each
|
||||
interconnect entry. Consult TRM documentation for
|
||||
information about available memory clients, see MEMORY
|
||||
CONTROLLER section.
|
||||
|
||||
For each opp entry in 'operating-points-v2' table:
|
||||
- opp-supported-hw: bitfield indicating SoC speedo ID mask
|
||||
- opp-peak-kBps: peak bandwidth of the memory channel
|
||||
|
||||
Example:
|
||||
dfs_opp_table: opp-table {
|
||||
compatible = "operating-points-v2";
|
||||
|
||||
opp@12750000 {
|
||||
opp-hz = /bits/ 64 <12750000>;
|
||||
opp-supported-hw = <0x000F>;
|
||||
opp-peak-kBps = <51000>;
|
||||
};
|
||||
...
|
||||
};
|
||||
|
||||
actmon@6000c800 {
|
||||
compatible = "nvidia,tegra124-actmon";
|
||||
reg = <0x0 0x6000c800 0x0 0x400>;
|
||||
interrupts = <GIC_SPI 45 IRQ_TYPE_LEVEL_HIGH>;
|
||||
clocks = <&tegra_car TEGRA124_CLK_ACTMON>,
|
||||
<&tegra_car TEGRA124_CLK_EMC>;
|
||||
clock-names = "actmon", "emc";
|
||||
resets = <&tegra_car 119>;
|
||||
reset-names = "actmon";
|
||||
operating-points-v2 = <&dfs_opp_table>;
|
||||
interconnects = <&mc TEGRA124_MC_MPCORER &emc>;
|
||||
interconnect-names = "cpu";
|
||||
};
|
||||
@@ -20,13 +20,13 @@ during retention, system won't boot without this):
|
||||
compatible = "ste,dbx500-backupram"
|
||||
|
||||
scu:
|
||||
see binding for arm/scu.txt
|
||||
see binding for arm/arm,scu.yaml
|
||||
|
||||
interrupt-controller:
|
||||
see binding for interrupt-controller/arm,gic.txt
|
||||
|
||||
timer:
|
||||
see binding for timer/arm,twd.txt
|
||||
see binding for timer/arm,twd-timer.yaml
|
||||
|
||||
clocks:
|
||||
see binding for clocks/ux500.txt
|
||||
|
||||
@@ -20,7 +20,6 @@ properties:
|
||||
|
||||
reg:
|
||||
minItems: 2
|
||||
maxItems: 3
|
||||
items:
|
||||
- description: AHCI registers
|
||||
- description: SATA configuration and IPFS registers
|
||||
|
||||
@@ -53,6 +53,17 @@ required:
|
||||
- reg
|
||||
- interrupts
|
||||
- clocks
|
||||
- power-domains
|
||||
|
||||
if:
|
||||
not:
|
||||
properties:
|
||||
compatible:
|
||||
contains:
|
||||
const: renesas,sata-r8a7779
|
||||
then:
|
||||
required:
|
||||
- resets
|
||||
|
||||
additionalProperties: false
|
||||
|
||||
|
||||
@@ -51,7 +51,6 @@ properties:
|
||||
|
||||
clocks:
|
||||
minItems: 2
|
||||
maxItems: 4
|
||||
items:
|
||||
- description: High Frequency Oscillator (usually at 24MHz)
|
||||
- description: Low Frequency Oscillator (usually at 32kHz)
|
||||
@@ -60,7 +59,6 @@ properties:
|
||||
|
||||
clock-names:
|
||||
minItems: 2
|
||||
maxItems: 4
|
||||
items:
|
||||
- const: hosc
|
||||
- const: losc
|
||||
|
||||
@@ -1,313 +0,0 @@
|
||||
Broadcom iProc Family Clocks
|
||||
|
||||
This binding uses the common clock binding:
|
||||
Documentation/devicetree/bindings/clock/clock-bindings.txt
|
||||
|
||||
The iProc clock controller manages clocks that are common to the iProc family.
|
||||
An SoC from the iProc family may have several PPLs, e.g., ARMPLL, GENPLL,
|
||||
LCPLL0, MIPIPLL, and etc., all derived from an onboard crystal. Each PLL
|
||||
comprises of several leaf clocks
|
||||
|
||||
Required properties for a PLL and its leaf clocks:
|
||||
|
||||
- compatible:
|
||||
Should have a value of the form "brcm,<soc>-<pll>". For example, GENPLL on
|
||||
Cygnus has a compatible string of "brcm,cygnus-genpll"
|
||||
|
||||
- #clock-cells:
|
||||
Have a value of <1> since there are more than 1 leaf clock of a given PLL
|
||||
|
||||
- reg:
|
||||
Define the base and range of the I/O address space that contain the iProc
|
||||
clock control registers required for the PLL
|
||||
|
||||
- clocks:
|
||||
The input parent clock phandle for the PLL. For most iProc PLLs, this is an
|
||||
onboard crystal with a fixed rate
|
||||
|
||||
- clock-output-names:
|
||||
An ordered list of strings defining the names of the clocks
|
||||
|
||||
Example:
|
||||
|
||||
osc: oscillator {
|
||||
#clock-cells = <0>;
|
||||
compatible = "fixed-clock";
|
||||
clock-frequency = <25000000>;
|
||||
};
|
||||
|
||||
genpll: genpll {
|
||||
#clock-cells = <1>;
|
||||
compatible = "brcm,cygnus-genpll";
|
||||
reg = <0x0301d000 0x2c>, <0x0301c020 0x4>;
|
||||
clocks = <&osc>;
|
||||
clock-output-names = "genpll", "axi21", "250mhz", "ihost_sys",
|
||||
"enet_sw", "audio_125", "can";
|
||||
};
|
||||
|
||||
Required properties for ASIU clocks:
|
||||
|
||||
ASIU clocks are a special case. These clocks are derived directly from the
|
||||
reference clock of the onboard crystal
|
||||
|
||||
- compatible:
|
||||
Should have a value of the form "brcm,<soc>-asiu-clk". For example, ASIU
|
||||
clocks for Cygnus have a compatible string of "brcm,cygnus-asiu-clk"
|
||||
|
||||
- #clock-cells:
|
||||
Have a value of <1> since there are more than 1 ASIU clocks
|
||||
|
||||
- reg:
|
||||
Define the base and range of the I/O address space that contain the iProc
|
||||
clock control registers required for ASIU clocks
|
||||
|
||||
- clocks:
|
||||
The input parent clock phandle for the ASIU clock, i.e., the onboard
|
||||
crystal
|
||||
|
||||
- clock-output-names:
|
||||
An ordered list of strings defining the names of the ASIU clocks
|
||||
|
||||
Example:
|
||||
|
||||
osc: oscillator {
|
||||
#clock-cells = <0>;
|
||||
compatible = "fixed-clock";
|
||||
clock-frequency = <25000000>;
|
||||
};
|
||||
|
||||
asiu_clks: asiu_clks {
|
||||
#clock-cells = <1>;
|
||||
compatible = "brcm,cygnus-asiu-clk";
|
||||
reg = <0x0301d048 0xc>, <0x180aa024 0x4>;
|
||||
clocks = <&osc>;
|
||||
clock-output-names = "keypad", "adc/touch", "pwm";
|
||||
};
|
||||
|
||||
Cygnus
|
||||
------
|
||||
PLL and leaf clock compatible strings for Cygnus are:
|
||||
"brcm,cygnus-armpll"
|
||||
"brcm,cygnus-genpll"
|
||||
"brcm,cygnus-lcpll0"
|
||||
"brcm,cygnus-mipipll"
|
||||
"brcm,cygnus-asiu-clk"
|
||||
"brcm,cygnus-audiopll"
|
||||
|
||||
The following table defines the set of PLL/clock index and ID for Cygnus.
|
||||
These clock IDs are defined in:
|
||||
"include/dt-bindings/clock/bcm-cygnus.h"
|
||||
|
||||
Clock Source (Parent) Index ID
|
||||
--- ----- ----- ---------
|
||||
crystal N/A N/A N/A
|
||||
|
||||
armpll crystal N/A N/A
|
||||
|
||||
keypad crystal (ASIU) 0 BCM_CYGNUS_ASIU_KEYPAD_CLK
|
||||
adc/tsc crystal (ASIU) 1 BCM_CYGNUS_ASIU_ADC_CLK
|
||||
pwm crystal (ASIU) 2 BCM_CYGNUS_ASIU_PWM_CLK
|
||||
|
||||
genpll crystal 0 BCM_CYGNUS_GENPLL
|
||||
axi21 genpll 1 BCM_CYGNUS_GENPLL_AXI21_CLK
|
||||
250mhz genpll 2 BCM_CYGNUS_GENPLL_250MHZ_CLK
|
||||
ihost_sys genpll 3 BCM_CYGNUS_GENPLL_IHOST_SYS_CLK
|
||||
enet_sw genpll 4 BCM_CYGNUS_GENPLL_ENET_SW_CLK
|
||||
audio_125 genpll 5 BCM_CYGNUS_GENPLL_AUDIO_125_CLK
|
||||
can genpll 6 BCM_CYGNUS_GENPLL_CAN_CLK
|
||||
|
||||
lcpll0 crystal 0 BCM_CYGNUS_LCPLL0
|
||||
pcie_phy lcpll0 1 BCM_CYGNUS_LCPLL0_PCIE_PHY_REF_CLK
|
||||
ddr_phy lcpll0 2 BCM_CYGNUS_LCPLL0_DDR_PHY_CLK
|
||||
sdio lcpll0 3 BCM_CYGNUS_LCPLL0_SDIO_CLK
|
||||
usb_phy lcpll0 4 BCM_CYGNUS_LCPLL0_USB_PHY_REF_CLK
|
||||
smart_card lcpll0 5 BCM_CYGNUS_LCPLL0_SMART_CARD_CLK
|
||||
ch5_unused lcpll0 6 BCM_CYGNUS_LCPLL0_CH5_UNUSED
|
||||
|
||||
mipipll crystal 0 BCM_CYGNUS_MIPIPLL
|
||||
ch0_unused mipipll 1 BCM_CYGNUS_MIPIPLL_CH0_UNUSED
|
||||
ch1_lcd mipipll 2 BCM_CYGNUS_MIPIPLL_CH1_LCD
|
||||
ch2_v3d mipipll 3 BCM_CYGNUS_MIPIPLL_CH2_V3D
|
||||
ch3_unused mipipll 4 BCM_CYGNUS_MIPIPLL_CH3_UNUSED
|
||||
ch4_unused mipipll 5 BCM_CYGNUS_MIPIPLL_CH4_UNUSED
|
||||
ch5_unused mipipll 6 BCM_CYGNUS_MIPIPLL_CH5_UNUSED
|
||||
|
||||
audiopll crystal 0 BCM_CYGNUS_AUDIOPLL
|
||||
ch0_audio audiopll 1 BCM_CYGNUS_AUDIOPLL_CH0
|
||||
ch1_audio audiopll 2 BCM_CYGNUS_AUDIOPLL_CH1
|
||||
ch2_audio audiopll 3 BCM_CYGNUS_AUDIOPLL_CH2
|
||||
|
||||
Hurricane 2
|
||||
------
|
||||
PLL and leaf clock compatible strings for Hurricane 2 are:
|
||||
"brcm,hr2-armpll"
|
||||
|
||||
The following table defines the set of PLL/clock for Hurricane 2:
|
||||
|
||||
Clock Source Index ID
|
||||
--- ----- ----- ---------
|
||||
crystal N/A N/A N/A
|
||||
|
||||
armpll crystal N/A N/A
|
||||
|
||||
|
||||
Northstar and Northstar Plus
|
||||
------
|
||||
PLL and leaf clock compatible strings for Northstar and Northstar Plus are:
|
||||
"brcm,nsp-armpll"
|
||||
"brcm,nsp-genpll"
|
||||
"brcm,nsp-lcpll0"
|
||||
|
||||
The following table defines the set of PLL/clock index and ID for Northstar and
|
||||
Northstar Plus. These clock IDs are defined in:
|
||||
"include/dt-bindings/clock/bcm-nsp.h"
|
||||
|
||||
Clock Source Index ID
|
||||
--- ----- ----- ---------
|
||||
crystal N/A N/A N/A
|
||||
|
||||
armpll crystal N/A N/A
|
||||
|
||||
genpll crystal 0 BCM_NSP_GENPLL
|
||||
phy genpll 1 BCM_NSP_GENPLL_PHY_CLK
|
||||
ethernetclk genpll 2 BCM_NSP_GENPLL_ENET_SW_CLK
|
||||
usbclk genpll 3 BCM_NSP_GENPLL_USB_PHY_REF_CLK
|
||||
iprocfast genpll 4 BCM_NSP_GENPLL_IPROCFAST_CLK
|
||||
sata1 genpll 5 BCM_NSP_GENPLL_SATA1_CLK
|
||||
sata2 genpll 6 BCM_NSP_GENPLL_SATA2_CLK
|
||||
|
||||
lcpll0 crystal 0 BCM_NSP_LCPLL0
|
||||
pcie_phy lcpll0 1 BCM_NSP_LCPLL0_PCIE_PHY_REF_CLK
|
||||
sdio lcpll0 2 BCM_NSP_LCPLL0_SDIO_CLK
|
||||
ddr_phy lcpll0 3 BCM_NSP_LCPLL0_DDR_PHY_CLK
|
||||
|
||||
Northstar 2
|
||||
-----------
|
||||
PLL and leaf clock compatible strings for Northstar 2 are:
|
||||
"brcm,ns2-genpll-scr"
|
||||
"brcm,ns2-genpll-sw"
|
||||
"brcm,ns2-lcpll-ddr"
|
||||
"brcm,ns2-lcpll-ports"
|
||||
|
||||
The following table defines the set of PLL/clock index and ID for Northstar 2.
|
||||
These clock IDs are defined in:
|
||||
"include/dt-bindings/clock/bcm-ns2.h"
|
||||
|
||||
Clock Source Index ID
|
||||
--- ----- ----- ---------
|
||||
crystal N/A N/A N/A
|
||||
|
||||
genpll_scr crystal 0 BCM_NS2_GENPLL_SCR
|
||||
scr genpll_scr 1 BCM_NS2_GENPLL_SCR_SCR_CLK
|
||||
fs genpll_scr 2 BCM_NS2_GENPLL_SCR_FS_CLK
|
||||
audio_ref genpll_scr 3 BCM_NS2_GENPLL_SCR_AUDIO_CLK
|
||||
ch3_unused genpll_scr 4 BCM_NS2_GENPLL_SCR_CH3_UNUSED
|
||||
ch4_unused genpll_scr 5 BCM_NS2_GENPLL_SCR_CH4_UNUSED
|
||||
ch5_unused genpll_scr 6 BCM_NS2_GENPLL_SCR_CH5_UNUSED
|
||||
|
||||
genpll_sw crystal 0 BCM_NS2_GENPLL_SW
|
||||
rpe genpll_sw 1 BCM_NS2_GENPLL_SW_RPE_CLK
|
||||
250 genpll_sw 2 BCM_NS2_GENPLL_SW_250_CLK
|
||||
nic genpll_sw 3 BCM_NS2_GENPLL_SW_NIC_CLK
|
||||
chimp genpll_sw 4 BCM_NS2_GENPLL_SW_CHIMP_CLK
|
||||
port genpll_sw 5 BCM_NS2_GENPLL_SW_PORT_CLK
|
||||
sdio genpll_sw 6 BCM_NS2_GENPLL_SW_SDIO_CLK
|
||||
|
||||
lcpll_ddr crystal 0 BCM_NS2_LCPLL_DDR
|
||||
pcie_sata_usb lcpll_ddr 1 BCM_NS2_LCPLL_DDR_PCIE_SATA_USB_CLK
|
||||
ddr lcpll_ddr 2 BCM_NS2_LCPLL_DDR_DDR_CLK
|
||||
ch2_unused lcpll_ddr 3 BCM_NS2_LCPLL_DDR_CH2_UNUSED
|
||||
ch3_unused lcpll_ddr 4 BCM_NS2_LCPLL_DDR_CH3_UNUSED
|
||||
ch4_unused lcpll_ddr 5 BCM_NS2_LCPLL_DDR_CH4_UNUSED
|
||||
ch5_unused lcpll_ddr 6 BCM_NS2_LCPLL_DDR_CH5_UNUSED
|
||||
|
||||
lcpll_ports crystal 0 BCM_NS2_LCPLL_PORTS
|
||||
wan lcpll_ports 1 BCM_NS2_LCPLL_PORTS_WAN_CLK
|
||||
rgmii lcpll_ports 2 BCM_NS2_LCPLL_PORTS_RGMII_CLK
|
||||
ch2_unused lcpll_ports 3 BCM_NS2_LCPLL_PORTS_CH2_UNUSED
|
||||
ch3_unused lcpll_ports 4 BCM_NS2_LCPLL_PORTS_CH3_UNUSED
|
||||
ch4_unused lcpll_ports 5 BCM_NS2_LCPLL_PORTS_CH4_UNUSED
|
||||
ch5_unused lcpll_ports 6 BCM_NS2_LCPLL_PORTS_CH5_UNUSED
|
||||
|
||||
BCM63138
|
||||
--------
|
||||
PLL and leaf clock compatible strings for BCM63138 are:
|
||||
"brcm,bcm63138-armpll"
|
||||
|
||||
Stingray
|
||||
-----------
|
||||
PLL and leaf clock compatible strings for Stingray are:
|
||||
"brcm,sr-genpll0"
|
||||
"brcm,sr-genpll1"
|
||||
"brcm,sr-genpll2"
|
||||
"brcm,sr-genpll3"
|
||||
"brcm,sr-genpll4"
|
||||
"brcm,sr-genpll5"
|
||||
"brcm,sr-genpll6"
|
||||
|
||||
"brcm,sr-lcpll0"
|
||||
"brcm,sr-lcpll1"
|
||||
"brcm,sr-lcpll-pcie"
|
||||
|
||||
|
||||
The following table defines the set of PLL/clock index and ID for Stingray.
|
||||
These clock IDs are defined in:
|
||||
"include/dt-bindings/clock/bcm-sr.h"
|
||||
|
||||
Clock Source Index ID
|
||||
--- ----- ----- ---------
|
||||
crystal N/A N/A N/A
|
||||
crmu_ref25m crystal N/A N/A
|
||||
|
||||
genpll0 crystal 0 BCM_SR_GENPLL0
|
||||
clk_125m genpll0 1 BCM_SR_GENPLL0_125M_CLK
|
||||
clk_scr genpll0 2 BCM_SR_GENPLL0_SCR_CLK
|
||||
clk_250 genpll0 3 BCM_SR_GENPLL0_250M_CLK
|
||||
clk_pcie_axi genpll0 4 BCM_SR_GENPLL0_PCIE_AXI_CLK
|
||||
clk_paxc_axi_x2 genpll0 5 BCM_SR_GENPLL0_PAXC_AXI_X2_CLK
|
||||
clk_paxc_axi genpll0 6 BCM_SR_GENPLL0_PAXC_AXI_CLK
|
||||
|
||||
genpll1 crystal 0 BCM_SR_GENPLL1
|
||||
clk_pcie_tl genpll1 1 BCM_SR_GENPLL1_PCIE_TL_CLK
|
||||
clk_mhb_apb genpll1 2 BCM_SR_GENPLL1_MHB_APB_CLK
|
||||
|
||||
genpll2 crystal 0 BCM_SR_GENPLL2
|
||||
clk_nic genpll2 1 BCM_SR_GENPLL2_NIC_CLK
|
||||
clk_ts_500_ref genpll2 2 BCM_SR_GENPLL2_TS_500_REF_CLK
|
||||
clk_125_nitro genpll2 3 BCM_SR_GENPLL2_125_NITRO_CLK
|
||||
clk_chimp genpll2 4 BCM_SR_GENPLL2_CHIMP_CLK
|
||||
clk_nic_flash genpll2 5 BCM_SR_GENPLL2_NIC_FLASH_CLK
|
||||
clk_fs genpll2 6 BCM_SR_GENPLL2_FS_CLK
|
||||
|
||||
genpll3 crystal 0 BCM_SR_GENPLL3
|
||||
clk_hsls genpll3 1 BCM_SR_GENPLL3_HSLS_CLK
|
||||
clk_sdio genpll3 2 BCM_SR_GENPLL3_SDIO_CLK
|
||||
|
||||
genpll4 crystal 0 BCM_SR_GENPLL4
|
||||
clk_ccn genpll4 1 BCM_SR_GENPLL4_CCN_CLK
|
||||
clk_tpiu_pll genpll4 2 BCM_SR_GENPLL4_TPIU_PLL_CLK
|
||||
clk_noc genpll4 3 BCM_SR_GENPLL4_NOC_CLK
|
||||
clk_chclk_fs4 genpll4 4 BCM_SR_GENPLL4_CHCLK_FS4_CLK
|
||||
clk_bridge_fscpu genpll4 5 BCM_SR_GENPLL4_BRIDGE_FSCPU_CLK
|
||||
|
||||
genpll5 crystal 0 BCM_SR_GENPLL5
|
||||
clk_fs4_hf genpll5 1 BCM_SR_GENPLL5_FS4_HF_CLK
|
||||
clk_crypto_ae genpll5 2 BCM_SR_GENPLL5_CRYPTO_AE_CLK
|
||||
clk_raid_ae genpll5 3 BCM_SR_GENPLL5_RAID_AE_CLK
|
||||
|
||||
genpll6 crystal 0 BCM_SR_GENPLL6
|
||||
clk_48_usb genpll6 1 BCM_SR_GENPLL6_48_USB_CLK
|
||||
|
||||
lcpll0 crystal 0 BCM_SR_LCPLL0
|
||||
clk_sata_refp lcpll0 1 BCM_SR_LCPLL0_SATA_REFP_CLK
|
||||
clk_sata_refn lcpll0 2 BCM_SR_LCPLL0_SATA_REFN_CLK
|
||||
clk_sata_350 lcpll0 3 BCM_SR_LCPLL0_SATA_350_CLK
|
||||
clk_sata_500 lcpll0 4 BCM_SR_LCPLL0_SATA_500_CLK
|
||||
|
||||
lcpll1 crystal 0 BCM_SR_LCPLL1
|
||||
clk_wan lcpll1 1 BCM_SR_LCPLL1_WAN_CLK
|
||||
clk_usb_ref lcpll1 2 BCM_SR_LCPLL1_USB_REF_CLK
|
||||
clk_crmu_ts lcpll1 3 BCM_SR_LCPLL1_CRMU_TS_CLK
|
||||
|
||||
lcpll_pcie crystal 0 BCM_SR_LCPLL_PCIE
|
||||
clk_pcie_phy_ref lcpll1 1 BCM_SR_LCPLL_PCIE_PHY_REF_CLK
|
||||
395
Documentation/devicetree/bindings/clock/brcm,iproc-clocks.yaml
Normal file
395
Documentation/devicetree/bindings/clock/brcm,iproc-clocks.yaml
Normal file
@@ -0,0 +1,395 @@
|
||||
# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
|
||||
%YAML 1.2
|
||||
---
|
||||
$id: http://devicetree.org/schemas/clock/brcm,iproc-clocks.yaml#
|
||||
$schema: http://devicetree.org/meta-schemas/core.yaml#
|
||||
|
||||
title: Broadcom iProc Family Clocks
|
||||
|
||||
maintainers:
|
||||
- Ray Jui <rjui@broadcom.com>
|
||||
- Scott Branden <sbranden@broadcom.com>
|
||||
|
||||
description: |
|
||||
The iProc clock controller manages clocks that are common to the iProc family.
|
||||
An SoC from the iProc family may have several PLLs, e.g., ARMPLL, GENPLL,
|
||||
LCPLL0, MIPIPLL, and etc., all derived from an onboard crystal. Each PLL
|
||||
comprises of several leaf clocks
|
||||
|
||||
ASIU clocks are a special case. These clocks are derived directly from the
|
||||
reference clock of the onboard crystal.
|
||||
|
||||
properties:
|
||||
compatible:
|
||||
enum:
|
||||
- brcm,bcm63138-armpll
|
||||
- brcm,cygnus-armpll
|
||||
- brcm,cygnus-genpll
|
||||
- brcm,cygnus-lcpll0
|
||||
- brcm,cygnus-mipipll
|
||||
- brcm,cygnus-asiu-clk
|
||||
- brcm,cygnus-audiopll
|
||||
- brcm,hr2-armpll
|
||||
- brcm,nsp-armpll
|
||||
- brcm,nsp-genpll
|
||||
- brcm,nsp-lcpll0
|
||||
- brcm,ns2-genpll-scr
|
||||
- brcm,ns2-genpll-sw
|
||||
- brcm,ns2-lcpll-ddr
|
||||
- brcm,ns2-lcpll-ports
|
||||
- brcm,sr-genpll0
|
||||
- brcm,sr-genpll1
|
||||
- brcm,sr-genpll2
|
||||
- brcm,sr-genpll3
|
||||
- brcm,sr-genpll4
|
||||
- brcm,sr-genpll5
|
||||
- brcm,sr-genpll6
|
||||
- brcm,sr-lcpll0
|
||||
- brcm,sr-lcpll1
|
||||
- brcm,sr-lcpll-pcie
|
||||
|
||||
reg:
|
||||
minItems: 1
|
||||
maxItems: 3
|
||||
items:
|
||||
- description: base register
|
||||
- description: power register
|
||||
- description: ASIU or split status register
|
||||
|
||||
clocks:
|
||||
description: The input parent clock phandle for the PLL / ASIU clock. For
|
||||
most iProc PLLs, this is an onboard crystal with a fixed rate.
|
||||
maxItems: 1
|
||||
|
||||
'#clock-cells':
|
||||
const: 1
|
||||
|
||||
clock-output-names:
|
||||
minItems: 1
|
||||
maxItems: 45
|
||||
|
||||
allOf:
|
||||
- if:
|
||||
properties:
|
||||
compatible:
|
||||
contains:
|
||||
enum:
|
||||
- brcm,cygnus-armpll
|
||||
- brcm,cygnus-genpll
|
||||
- brcm,cygnus-lcpll0
|
||||
- brcm,cygnus-mipipll
|
||||
- brcm,cygnus-asiu-clk
|
||||
- brcm,cygnus-audiopll
|
||||
then:
|
||||
properties:
|
||||
clock-output-names:
|
||||
description: |
|
||||
The following table defines the set of PLL/clock index and ID for Cygnus.
|
||||
These clock IDs are defined in:
|
||||
"include/dt-bindings/clock/bcm-cygnus.h"
|
||||
|
||||
Clock Source (Parent) Index ID
|
||||
----- --------------- ----- --
|
||||
crystal N/A N/A N/A
|
||||
|
||||
armpll crystal N/A N/A
|
||||
|
||||
keypad crystal (ASIU) 0 BCM_CYGNUS_ASIU_KEYPAD_CLK
|
||||
adc/tsc crystal (ASIU) 1 BCM_CYGNUS_ASIU_ADC_CLK
|
||||
pwm crystal (ASIU) 2 BCM_CYGNUS_ASIU_PWM_CLK
|
||||
|
||||
genpll crystal 0 BCM_CYGNUS_GENPLL
|
||||
axi21 genpll 1 BCM_CYGNUS_GENPLL_AXI21_CLK
|
||||
250mhz genpll 2 BCM_CYGNUS_GENPLL_250MHZ_CLK
|
||||
ihost_sys genpll 3 BCM_CYGNUS_GENPLL_IHOST_SYS_CLK
|
||||
enet_sw genpll 4 BCM_CYGNUS_GENPLL_ENET_SW_CLK
|
||||
audio_125 genpll 5 BCM_CYGNUS_GENPLL_AUDIO_125_CLK
|
||||
can genpll 6 BCM_CYGNUS_GENPLL_CAN_CLK
|
||||
|
||||
lcpll0 crystal 0 BCM_CYGNUS_LCPLL0
|
||||
pcie_phy lcpll0 1 BCM_CYGNUS_LCPLL0_PCIE_PHY_REF_CLK
|
||||
ddr_phy lcpll0 2 BCM_CYGNUS_LCPLL0_DDR_PHY_CLK
|
||||
sdio lcpll0 3 BCM_CYGNUS_LCPLL0_SDIO_CLK
|
||||
usb_phy lcpll0 4 BCM_CYGNUS_LCPLL0_USB_PHY_REF_CLK
|
||||
smart_card lcpll0 5 BCM_CYGNUS_LCPLL0_SMART_CARD_CLK
|
||||
ch5_unused lcpll0 6 BCM_CYGNUS_LCPLL0_CH5_UNUSED
|
||||
|
||||
mipipll crystal 0 BCM_CYGNUS_MIPIPLL
|
||||
ch0_unused mipipll 1 BCM_CYGNUS_MIPIPLL_CH0_UNUSED
|
||||
ch1_lcd mipipll 2 BCM_CYGNUS_MIPIPLL_CH1_LCD
|
||||
ch2_v3d mipipll 3 BCM_CYGNUS_MIPIPLL_CH2_V3D
|
||||
ch3_unused mipipll 4 BCM_CYGNUS_MIPIPLL_CH3_UNUSED
|
||||
ch4_unused mipipll 5 BCM_CYGNUS_MIPIPLL_CH4_UNUSED
|
||||
ch5_unused mipipll 6 BCM_CYGNUS_MIPIPLL_CH5_UNUSED
|
||||
|
||||
audiopll crystal 0 BCM_CYGNUS_AUDIOPLL
|
||||
ch0_audio audiopll 1 BCM_CYGNUS_AUDIOPLL_CH0
|
||||
ch1_audio audiopll 2 BCM_CYGNUS_AUDIOPLL_CH1
|
||||
ch2_audio audiopll 3 BCM_CYGNUS_AUDIOPLL_CH2
|
||||
- if:
|
||||
properties:
|
||||
compatible:
|
||||
contains:
|
||||
enum:
|
||||
- brcm,hr2-armpll
|
||||
then:
|
||||
properties:
|
||||
clock-output-names:
|
||||
description: |
|
||||
The following table defines the set of PLL/clock for Hurricane 2:
|
||||
|
||||
Clock Source Index ID
|
||||
----- ------ ----- --
|
||||
crystal N/A N/A N/A
|
||||
|
||||
armpll crystal N/A N/A
|
||||
- if:
|
||||
properties:
|
||||
compatible:
|
||||
contains:
|
||||
enum:
|
||||
- brcm,nsp-armpll
|
||||
- brcm,nsp-genpll
|
||||
- brcm,nsp-lcpll0
|
||||
then:
|
||||
properties:
|
||||
clock-output-names:
|
||||
description: |
|
||||
The following table defines the set of PLL/clock index and ID for Northstar and
|
||||
Northstar Plus. These clock IDs are defined in:
|
||||
"include/dt-bindings/clock/bcm-nsp.h"
|
||||
|
||||
Clock Source Index ID
|
||||
----- ------ ----- --
|
||||
crystal N/A N/A N/A
|
||||
|
||||
armpll crystal N/A N/A
|
||||
|
||||
genpll crystal 0 BCM_NSP_GENPLL
|
||||
phy genpll 1 BCM_NSP_GENPLL_PHY_CLK
|
||||
ethernetclk genpll 2 BCM_NSP_GENPLL_ENET_SW_CLK
|
||||
usbclk genpll 3 BCM_NSP_GENPLL_USB_PHY_REF_CLK
|
||||
iprocfast genpll 4 BCM_NSP_GENPLL_IPROCFAST_CLK
|
||||
sata1 genpll 5 BCM_NSP_GENPLL_SATA1_CLK
|
||||
sata2 genpll 6 BCM_NSP_GENPLL_SATA2_CLK
|
||||
|
||||
lcpll0 crystal 0 BCM_NSP_LCPLL0
|
||||
pcie_phy lcpll0 1 BCM_NSP_LCPLL0_PCIE_PHY_REF_CLK
|
||||
sdio lcpll0 2 BCM_NSP_LCPLL0_SDIO_CLK
|
||||
ddr_phy lcpll0 3 BCM_NSP_LCPLL0_DDR_PHY_CLK
|
||||
- if:
|
||||
properties:
|
||||
compatible:
|
||||
contains:
|
||||
enum:
|
||||
- brcm,ns2-genpll-scr
|
||||
- brcm,ns2-genpll-sw
|
||||
- brcm,ns2-lcpll-ddr
|
||||
- brcm,ns2-lcpll-ports
|
||||
then:
|
||||
properties:
|
||||
clock-output-names:
|
||||
description: |
|
||||
The following table defines the set of PLL/clock index and ID for Northstar 2.
|
||||
These clock IDs are defined in:
|
||||
"include/dt-bindings/clock/bcm-ns2.h"
|
||||
|
||||
Clock Source Index ID
|
||||
----- ------ ----- --
|
||||
crystal N/A N/A N/A
|
||||
|
||||
genpll_scr crystal 0 BCM_NS2_GENPLL_SCR
|
||||
scr genpll_scr 1 BCM_NS2_GENPLL_SCR_SCR_CLK
|
||||
fs genpll_scr 2 BCM_NS2_GENPLL_SCR_FS_CLK
|
||||
audio_ref genpll_scr 3 BCM_NS2_GENPLL_SCR_AUDIO_CLK
|
||||
ch3_unused genpll_scr 4 BCM_NS2_GENPLL_SCR_CH3_UNUSED
|
||||
ch4_unused genpll_scr 5 BCM_NS2_GENPLL_SCR_CH4_UNUSED
|
||||
ch5_unused genpll_scr 6 BCM_NS2_GENPLL_SCR_CH5_UNUSED
|
||||
|
||||
genpll_sw crystal 0 BCM_NS2_GENPLL_SW
|
||||
rpe genpll_sw 1 BCM_NS2_GENPLL_SW_RPE_CLK
|
||||
250 genpll_sw 2 BCM_NS2_GENPLL_SW_250_CLK
|
||||
nic genpll_sw 3 BCM_NS2_GENPLL_SW_NIC_CLK
|
||||
chimp genpll_sw 4 BCM_NS2_GENPLL_SW_CHIMP_CLK
|
||||
port genpll_sw 5 BCM_NS2_GENPLL_SW_PORT_CLK
|
||||
sdio genpll_sw 6 BCM_NS2_GENPLL_SW_SDIO_CLK
|
||||
|
||||
lcpll_ddr crystal 0 BCM_NS2_LCPLL_DDR
|
||||
pcie_sata_usb lcpll_ddr 1 BCM_NS2_LCPLL_DDR_PCIE_SATA_USB_CLK
|
||||
ddr lcpll_ddr 2 BCM_NS2_LCPLL_DDR_DDR_CLK
|
||||
ch2_unused lcpll_ddr 3 BCM_NS2_LCPLL_DDR_CH2_UNUSED
|
||||
ch3_unused lcpll_ddr 4 BCM_NS2_LCPLL_DDR_CH3_UNUSED
|
||||
ch4_unused lcpll_ddr 5 BCM_NS2_LCPLL_DDR_CH4_UNUSED
|
||||
ch5_unused lcpll_ddr 6 BCM_NS2_LCPLL_DDR_CH5_UNUSED
|
||||
|
||||
lcpll_ports crystal 0 BCM_NS2_LCPLL_PORTS
|
||||
wan lcpll_ports 1 BCM_NS2_LCPLL_PORTS_WAN_CLK
|
||||
rgmii lcpll_ports 2 BCM_NS2_LCPLL_PORTS_RGMII_CLK
|
||||
ch2_unused lcpll_ports 3 BCM_NS2_LCPLL_PORTS_CH2_UNUSED
|
||||
ch3_unused lcpll_ports 4 BCM_NS2_LCPLL_PORTS_CH3_UNUSED
|
||||
ch4_unused lcpll_ports 5 BCM_NS2_LCPLL_PORTS_CH4_UNUSED
|
||||
ch5_unused lcpll_ports 6 BCM_NS2_LCPLL_PORTS_CH5_UNUSED
|
||||
- if:
|
||||
properties:
|
||||
compatible:
|
||||
contains:
|
||||
enum:
|
||||
- brcm,sr-genpll0
|
||||
- brcm,sr-genpll1
|
||||
- brcm,sr-genpll2
|
||||
- brcm,sr-genpll3
|
||||
- brcm,sr-genpll4
|
||||
- brcm,sr-genpll5
|
||||
- brcm,sr-genpll6
|
||||
- brcm,sr-lcpll0
|
||||
- brcm,sr-lcpll1
|
||||
- brcm,sr-lcpll-pcie
|
||||
then:
|
||||
properties:
|
||||
clock-output-names:
|
||||
description: |
|
||||
The following table defines the set of PLL/clock index and ID for Stingray.
|
||||
These clock IDs are defined in:
|
||||
"include/dt-bindings/clock/bcm-sr.h"
|
||||
|
||||
Clock Source Index ID
|
||||
----- ------ ----- --
|
||||
crystal N/A N/A N/A
|
||||
crmu_ref25m crystal N/A N/A
|
||||
|
||||
genpll0 crystal 0 BCM_SR_GENPLL0
|
||||
clk_125m genpll0 1 BCM_SR_GENPLL0_125M_CLK
|
||||
clk_scr genpll0 2 BCM_SR_GENPLL0_SCR_CLK
|
||||
clk_250 genpll0 3 BCM_SR_GENPLL0_250M_CLK
|
||||
clk_pcie_axi genpll0 4 BCM_SR_GENPLL0_PCIE_AXI_CLK
|
||||
clk_paxc_axi_x2 genpll0 5 BCM_SR_GENPLL0_PAXC_AXI_X2_CLK
|
||||
clk_paxc_axi genpll0 6 BCM_SR_GENPLL0_PAXC_AXI_CLK
|
||||
|
||||
genpll1 crystal 0 BCM_SR_GENPLL1
|
||||
clk_pcie_tl genpll1 1 BCM_SR_GENPLL1_PCIE_TL_CLK
|
||||
clk_mhb_apb genpll1 2 BCM_SR_GENPLL1_MHB_APB_CLK
|
||||
|
||||
genpll2 crystal 0 BCM_SR_GENPLL2
|
||||
clk_nic genpll2 1 BCM_SR_GENPLL2_NIC_CLK
|
||||
clk_ts_500_ref genpll2 2 BCM_SR_GENPLL2_TS_500_REF_CLK
|
||||
clk_125_nitro genpll2 3 BCM_SR_GENPLL2_125_NITRO_CLK
|
||||
clk_chimp genpll2 4 BCM_SR_GENPLL2_CHIMP_CLK
|
||||
clk_nic_flash genpll2 5 BCM_SR_GENPLL2_NIC_FLASH_CLK
|
||||
clk_fs genpll2 6 BCM_SR_GENPLL2_FS_CLK
|
||||
|
||||
genpll3 crystal 0 BCM_SR_GENPLL3
|
||||
clk_hsls genpll3 1 BCM_SR_GENPLL3_HSLS_CLK
|
||||
clk_sdio genpll3 2 BCM_SR_GENPLL3_SDIO_CLK
|
||||
|
||||
genpll4 crystal 0 BCM_SR_GENPLL4
|
||||
clk_ccn genpll4 1 BCM_SR_GENPLL4_CCN_CLK
|
||||
clk_tpiu_pll genpll4 2 BCM_SR_GENPLL4_TPIU_PLL_CLK
|
||||
clk_noc genpll4 3 BCM_SR_GENPLL4_NOC_CLK
|
||||
clk_chclk_fs4 genpll4 4 BCM_SR_GENPLL4_CHCLK_FS4_CLK
|
||||
clk_bridge_fscpu genpll4 5 BCM_SR_GENPLL4_BRIDGE_FSCPU_CLK
|
||||
|
||||
genpll5 crystal 0 BCM_SR_GENPLL5
|
||||
clk_fs4_hf genpll5 1 BCM_SR_GENPLL5_FS4_HF_CLK
|
||||
clk_crypto_ae genpll5 2 BCM_SR_GENPLL5_CRYPTO_AE_CLK
|
||||
clk_raid_ae genpll5 3 BCM_SR_GENPLL5_RAID_AE_CLK
|
||||
|
||||
genpll6 crystal 0 BCM_SR_GENPLL6
|
||||
clk_48_usb genpll6 1 BCM_SR_GENPLL6_48_USB_CLK
|
||||
|
||||
lcpll0 crystal 0 BCM_SR_LCPLL0
|
||||
clk_sata_refp lcpll0 1 BCM_SR_LCPLL0_SATA_REFP_CLK
|
||||
clk_sata_refn lcpll0 2 BCM_SR_LCPLL0_SATA_REFN_CLK
|
||||
clk_sata_350 lcpll0 3 BCM_SR_LCPLL0_SATA_350_CLK
|
||||
clk_sata_500 lcpll0 4 BCM_SR_LCPLL0_SATA_500_CLK
|
||||
|
||||
lcpll1 crystal 0 BCM_SR_LCPLL1
|
||||
clk_wan lcpll1 1 BCM_SR_LCPLL1_WAN_CLK
|
||||
clk_usb_ref lcpll1 2 BCM_SR_LCPLL1_USB_REF_CLK
|
||||
clk_crmu_ts lcpll1 3 BCM_SR_LCPLL1_CRMU_TS_CLK
|
||||
|
||||
lcpll_pcie crystal 0 BCM_SR_LCPLL_PCIE
|
||||
clk_pcie_phy_ref lcpll1 1 BCM_SR_LCPLL_PCIE_PHY_REF_CLK
|
||||
- if:
|
||||
properties:
|
||||
compatible:
|
||||
contains:
|
||||
const: brcm,cygnus-genpll
|
||||
then:
|
||||
properties:
|
||||
clock-output-names:
|
||||
items:
|
||||
- const: genpll
|
||||
- const: axi21
|
||||
- const: 250mhz
|
||||
- const: ihost_sys
|
||||
- const: enet_sw
|
||||
- const: audio_125
|
||||
- const: can
|
||||
- if:
|
||||
properties:
|
||||
compatible:
|
||||
contains:
|
||||
const: brcm,nsp-lcpll0
|
||||
then:
|
||||
properties:
|
||||
clock-output-names:
|
||||
items:
|
||||
- const: lcpll0
|
||||
- const: pcie_phy
|
||||
- const: sdio
|
||||
- const: ddr_phy
|
||||
- if:
|
||||
properties:
|
||||
compatible:
|
||||
contains:
|
||||
const: brcm,nsp-genpll
|
||||
then:
|
||||
properties:
|
||||
clock-output-names:
|
||||
items:
|
||||
- const: genpll
|
||||
- const: phy
|
||||
- const: ethernetclk
|
||||
- const: usbclk
|
||||
- const: iprocfast
|
||||
- const: sata1
|
||||
- const: sata2
|
||||
|
||||
required:
|
||||
- reg
|
||||
- clocks
|
||||
- '#clock-cells'
|
||||
- clock-output-names
|
||||
|
||||
additionalProperties: false
|
||||
|
||||
examples:
|
||||
- |
|
||||
osc1: oscillator {
|
||||
#clock-cells = <0>;
|
||||
compatible = "fixed-clock";
|
||||
clock-frequency = <25000000>;
|
||||
};
|
||||
|
||||
genpll@301d000 {
|
||||
#clock-cells = <1>;
|
||||
compatible = "brcm,cygnus-genpll";
|
||||
reg = <0x301d000 0x2c>, <0x301c020 0x4>;
|
||||
clocks = <&os1c>;
|
||||
clock-output-names = "genpll", "axi21", "250mhz", "ihost_sys",
|
||||
"enet_sw", "audio_125", "can";
|
||||
};
|
||||
- |
|
||||
osc2: oscillator {
|
||||
#clock-cells = <0>;
|
||||
compatible = "fixed-clock";
|
||||
clock-frequency = <25000000>;
|
||||
};
|
||||
|
||||
asiu_clks@301d048 {
|
||||
#clock-cells = <1>;
|
||||
compatible = "brcm,cygnus-asiu-clk";
|
||||
reg = <0x301d048 0xc>, <0x180aa024 0x4>;
|
||||
clocks = <&osc2>;
|
||||
clock-output-names = "keypad", "adc/touch", "pwm";
|
||||
};
|
||||
@@ -1,19 +0,0 @@
|
||||
Binding for simple gpio clock multiplexer.
|
||||
|
||||
This binding uses the common clock binding[1].
|
||||
|
||||
[1] Documentation/devicetree/bindings/clock/clock-bindings.txt
|
||||
|
||||
Required properties:
|
||||
- compatible : shall be "gpio-mux-clock".
|
||||
- clocks: list of two references to parent clocks.
|
||||
- #clock-cells : from common clock binding; shall be set to 0.
|
||||
- select-gpios : GPIO reference for selecting the parent clock.
|
||||
|
||||
Example:
|
||||
clock {
|
||||
compatible = "gpio-mux-clock";
|
||||
clocks = <&parentclk1>, <&parentclk2>;
|
||||
#clock-cells = <0>;
|
||||
select-gpios = <&gpio 1 GPIO_ACTIVE_HIGH>;
|
||||
};
|
||||
45
Documentation/devicetree/bindings/clock/gpio-mux-clock.yaml
Normal file
45
Documentation/devicetree/bindings/clock/gpio-mux-clock.yaml
Normal file
@@ -0,0 +1,45 @@
|
||||
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
|
||||
%YAML 1.2
|
||||
---
|
||||
$id: http://devicetree.org/schemas/clock/gpio-mux-clock.yaml#
|
||||
$schema: http://devicetree.org/meta-schemas/core.yaml#
|
||||
|
||||
title: Simple GPIO clock multiplexer
|
||||
|
||||
maintainers:
|
||||
- Sergej Sawazki <ce3a@gmx.de>
|
||||
|
||||
properties:
|
||||
compatible:
|
||||
const: gpio-mux-clock
|
||||
|
||||
clocks:
|
||||
items:
|
||||
- description: First parent clock
|
||||
- description: Second parent clock
|
||||
|
||||
'#clock-cells':
|
||||
const: 0
|
||||
|
||||
select-gpios:
|
||||
description: GPIO reference for selecting the parent clock.
|
||||
maxItems: 1
|
||||
|
||||
required:
|
||||
- compatible
|
||||
- clocks
|
||||
- '#clock-cells'
|
||||
- select-gpios
|
||||
|
||||
additionalProperties: false
|
||||
|
||||
examples:
|
||||
- |
|
||||
#include <dt-bindings/gpio/gpio.h>
|
||||
|
||||
clock {
|
||||
compatible = "gpio-mux-clock";
|
||||
clocks = <&parentclk1>, <&parentclk2>;
|
||||
#clock-cells = <0>;
|
||||
select-gpios = <&gpio 1 GPIO_ACTIVE_HIGH>;
|
||||
};
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user