Orange Pi5 kernel

Deprecated Linux kernel 5.10.110 for OrangePi 5/5B/5+ boards

3 Commits   0 Branches   0 Tags
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   1) .. SPDX-License-Identifier: GPL-2.0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   2) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   3) =======================================================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   4) Legacy Documentation of CPU Performance Scaling Drivers
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   5) =======================================================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   6) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   7) Included below are historic documents describing assorted
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   8) :doc:`CPU performance scaling <cpufreq>` drivers.  They are reproduced verbatim,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   9) with the original white space formatting and indentation preserved, except for
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  10) the added leading space character in every line of text.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  11) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  12) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  13) AMD PowerNow! Drivers
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  14) =====================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  15) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  16) ::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  17) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  18)  PowerNow! and Cool'n'Quiet are AMD names for frequency
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  19)  management capabilities in AMD processors. As the hardware
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  20)  implementation changes in new generations of the processors,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  21)  there is a different cpu-freq driver for each generation.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  22) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  23)  Note that the driver's will not load on the "wrong" hardware,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  24)  so it is safe to try each driver in turn when in doubt as to
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  25)  which is the correct driver.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  26) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  27)  Note that the functionality to change frequency (and voltage)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  28)  is not available in all processors. The drivers will refuse
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  29)  to load on processors without this capability. The capability
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  30)  is detected with the cpuid instruction.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  31) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  32)  The drivers use BIOS supplied tables to obtain frequency and
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  33)  voltage information appropriate for a particular platform.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  34)  Frequency transitions will be unavailable if the BIOS does
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  35)  not supply these tables.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  36) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  37)  6th Generation: powernow-k6
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  38) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  39)  7th Generation: powernow-k7: Athlon, Duron, Geode.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  40) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  41)  8th Generation: powernow-k8: Athlon, Athlon 64, Opteron, Sempron.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  42)  Documentation on this functionality in 8th generation processors
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  43)  is available in the "BIOS and Kernel Developer's Guide", publication
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  44)  26094, in chapter 9, available for download from www.amd.com.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  45) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  46)  BIOS supplied data, for powernow-k7 and for powernow-k8, may be
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  47)  from either the PSB table or from ACPI objects. The ACPI support
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  48)  is only available if the kernel config sets CONFIG_ACPI_PROCESSOR.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  49)  The powernow-k8 driver will attempt to use ACPI if so configured,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  50)  and fall back to PST if that fails.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  51)  The powernow-k7 driver will try to use the PSB support first, and
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  52)  fall back to ACPI if the PSB support fails. A module parameter,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  53)  acpi_force, is provided to force ACPI support to be used instead
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  54)  of PSB support.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  55) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  56) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  57) ``cpufreq-nforce2``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  58) ===================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  59) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  60) ::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  61) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  62)  The cpufreq-nforce2 driver changes the FSB on nVidia nForce2 platforms.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  63) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  64)  This works better than on other platforms, because the FSB of the CPU
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  65)  can be controlled independently from the PCI/AGP clock.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  66) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  67)  The module has two options:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  68) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  69)  	fid: 	 multiplier * 10 (for example 8.5 = 85)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  70)  	min_fsb: minimum FSB
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  71) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  72)  If not set, fid is calculated from the current CPU speed and the FSB.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  73)  min_fsb defaults to FSB at boot time - 50 MHz.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  74) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  75)  IMPORTANT: The available range is limited downwards!
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  76)             Also the minimum available FSB can differ, for systems
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  77)             booting with 200 MHz, 150 should always work.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  78) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  79) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  80) ``pcc-cpufreq``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  81) ===============
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  82) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  83) ::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  84) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  85)  /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  86)   *  pcc-cpufreq.txt - PCC interface documentation
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  87)   *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  88)   *  Copyright (C) 2009 Red Hat, Matthew Garrett <mjg@redhat.com>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  89)   *  Copyright (C) 2009 Hewlett-Packard Development Company, L.P.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  90)   *      Nagananda Chumbalkar <nagananda.chumbalkar@hp.com>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  91)   */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  92) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  93) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  94)  			Processor Clocking Control Driver
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  95)  			---------------------------------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  96) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  97)  Contents:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  98)  ---------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  99)  1.	Introduction
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 100)  1.1	PCC interface
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 101)  1.1.1	Get Average Frequency
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 102)  1.1.2	Set Desired Frequency
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 103)  1.2	Platforms affected
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 104)  2.	Driver and /sys details
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 105)  2.1	scaling_available_frequencies
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 106)  2.2	cpuinfo_transition_latency
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 107)  2.3	cpuinfo_cur_freq
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 108)  2.4	related_cpus
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 109)  3.	Caveats
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 110) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 111)  1. Introduction:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 112)  ----------------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 113)  Processor Clocking Control (PCC) is an interface between the platform
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 114)  firmware and OSPM. It is a mechanism for coordinating processor
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 115)  performance (ie: frequency) between the platform firmware and the OS.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 116) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 117)  The PCC driver (pcc-cpufreq) allows OSPM to take advantage of the PCC
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 118)  interface.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 119) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 120)  OS utilizes the PCC interface to inform platform firmware what frequency the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 121)  OS wants for a logical processor. The platform firmware attempts to achieve
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 122)  the requested frequency. If the request for the target frequency could not be
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 123)  satisfied by platform firmware, then it usually means that power budget
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 124)  conditions are in place, and "power capping" is taking place.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 125) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 126)  1.1 PCC interface:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 127)  ------------------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 128)  The complete PCC specification is available here:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 129)  https://acpica.org/sites/acpica/files/Processor-Clocking-Control-v1p0.pdf
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 130) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 131)  PCC relies on a shared memory region that provides a channel for communication
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 132)  between the OS and platform firmware. PCC also implements a "doorbell" that
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 133)  is used by the OS to inform the platform firmware that a command has been
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 134)  sent.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 135) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 136)  The ACPI PCCH() method is used to discover the location of the PCC shared
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 137)  memory region. The shared memory region header contains the "command" and
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 138)  "status" interface. PCCH() also contains details on how to access the platform
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 139)  doorbell.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 140) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 141)  The following commands are supported by the PCC interface:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 142)  * Get Average Frequency
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 143)  * Set Desired Frequency
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 144) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 145)  The ACPI PCCP() method is implemented for each logical processor and is
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 146)  used to discover the offsets for the input and output buffers in the shared
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 147)  memory region.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 148) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 149)  When PCC mode is enabled, the platform will not expose processor performance
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 150)  or throttle states (_PSS, _TSS and related ACPI objects) to OSPM. Therefore,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 151)  the native P-state driver (such as acpi-cpufreq for Intel, powernow-k8 for
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 152)  AMD) will not load.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 153) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 154)  However, OSPM remains in control of policy. The governor (eg: "ondemand")
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 155)  computes the required performance for each processor based on server workload.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 156)  The PCC driver fills in the command interface, and the input buffer and
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 157)  communicates the request to the platform firmware. The platform firmware is
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 158)  responsible for delivering the requested performance.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 159) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 160)  Each PCC command is "global" in scope and can affect all the logical CPUs in
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 161)  the system. Therefore, PCC is capable of performing "group" updates. With PCC
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 162)  the OS is capable of getting/setting the frequency of all the logical CPUs in
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 163)  the system with a single call to the BIOS.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 164) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 165)  1.1.1 Get Average Frequency:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 166)  ----------------------------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 167)  This command is used by the OSPM to query the running frequency of the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 168)  processor since the last time this command was completed. The output buffer
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 169)  indicates the average unhalted frequency of the logical processor expressed as
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 170)  a percentage of the nominal (ie: maximum) CPU frequency. The output buffer
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 171)  also signifies if the CPU frequency is limited by a power budget condition.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 172) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 173)  1.1.2 Set Desired Frequency:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 174)  ----------------------------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 175)  This command is used by the OSPM to communicate to the platform firmware the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 176)  desired frequency for a logical processor. The output buffer is currently
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 177)  ignored by OSPM. The next invocation of "Get Average Frequency" will inform
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 178)  OSPM if the desired frequency was achieved or not.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 179) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 180)  1.2 Platforms affected:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 181)  -----------------------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 182)  The PCC driver will load on any system where the platform firmware:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 183)  * supports the PCC interface, and the associated PCCH() and PCCP() methods
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 184)  * assumes responsibility for managing the hardware clocking controls in order
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 185)  to deliver the requested processor performance
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 186) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 187)  Currently, certain HP ProLiant platforms implement the PCC interface. On those
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 188)  platforms PCC is the "default" choice.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 189) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 190)  However, it is possible to disable this interface via a BIOS setting. In
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 191)  such an instance, as is also the case on platforms where the PCC interface
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 192)  is not implemented, the PCC driver will fail to load silently.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 193) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 194)  2. Driver and /sys details:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 195)  ---------------------------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 196)  When the driver loads, it merely prints the lowest and the highest CPU
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 197)  frequencies supported by the platform firmware.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 198) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 199)  The PCC driver loads with a message such as:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 200)  pcc-cpufreq: (v1.00.00) driver loaded with frequency limits: 1600 MHz, 2933
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 201)  MHz
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 202) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 203)  This means that the OPSM can request the CPU to run at any frequency in
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 204)  between the limits (1600 MHz, and 2933 MHz) specified in the message.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 205) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 206)  Internally, there is no need for the driver to convert the "target" frequency
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 207)  to a corresponding P-state.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 208) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 209)  The VERSION number for the driver will be of the format v.xy.ab.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 210)  eg: 1.00.02
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 211)     ----- --
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 212)      |    |
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 213)      |    -- this will increase with bug fixes/enhancements to the driver
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 214)      |-- this is the version of the PCC specification the driver adheres to
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 215) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 216) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 217)  The following is a brief discussion on some of the fields exported via the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 218)  /sys filesystem and how their values are affected by the PCC driver:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 219) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 220)  2.1 scaling_available_frequencies:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 221)  ----------------------------------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 222)  scaling_available_frequencies is not created in /sys. No intermediate
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 223)  frequencies need to be listed because the BIOS will try to achieve any
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 224)  frequency, within limits, requested by the governor. A frequency does not have
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 225)  to be strictly associated with a P-state.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 226) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 227)  2.2 cpuinfo_transition_latency:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 228)  -------------------------------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 229)  The cpuinfo_transition_latency field is 0. The PCC specification does
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 230)  not include a field to expose this value currently.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 231) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 232)  2.3 cpuinfo_cur_freq:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 233)  ---------------------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 234)  A) Often cpuinfo_cur_freq will show a value different than what is declared
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 235)  in the scaling_available_frequencies or scaling_cur_freq, or scaling_max_freq.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 236)  This is due to "turbo boost" available on recent Intel processors. If certain
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 237)  conditions are met the BIOS can achieve a slightly higher speed than requested
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 238)  by OSPM. An example:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 239) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 240)  scaling_cur_freq	: 2933000
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 241)  cpuinfo_cur_freq	: 3196000
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 242) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 243)  B) There is a round-off error associated with the cpuinfo_cur_freq value.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 244)  Since the driver obtains the current frequency as a "percentage" (%) of the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 245)  nominal frequency from the BIOS, sometimes, the values displayed by
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 246)  scaling_cur_freq and cpuinfo_cur_freq may not match. An example:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 247) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 248)  scaling_cur_freq	: 1600000
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 249)  cpuinfo_cur_freq	: 1583000
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 250) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 251)  In this example, the nominal frequency is 2933 MHz. The driver obtains the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 252)  current frequency, cpuinfo_cur_freq, as 54% of the nominal frequency:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 253) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 254)  	54% of 2933 MHz = 1583 MHz
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 255) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 256)  Nominal frequency is the maximum frequency of the processor, and it usually
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 257)  corresponds to the frequency of the P0 P-state.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 258) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 259)  2.4 related_cpus:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 260)  -----------------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 261)  The related_cpus field is identical to affected_cpus.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 262) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 263)  affected_cpus	: 4
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 264)  related_cpus	: 4
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 265) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 266)  Currently, the PCC driver does not evaluate _PSD. The platforms that support
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 267)  PCC do not implement SW_ALL. So OSPM doesn't need to perform any coordination
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 268)  to ensure that the same frequency is requested of all dependent CPUs.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 269) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 270)  3. Caveats:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 271)  -----------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 272)  The "cpufreq_stats" module in its present form cannot be loaded and
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 273)  expected to work with the PCC driver. Since the "cpufreq_stats" module
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 274)  provides information wrt each P-state, it is not applicable to the PCC driver.