https://github.com/amd/apml_modules
AMD APML modules, apml_sbtsi and apml_sbrmi registers to hwmon framework provding temperature and power metrics of the socket. They are extended by registering a misc_device, which provides ioctl interface to BMC admins.
Science Score: 13.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
○.zenodo.json file
-
○DOI references
-
○Academic publication links
-
○Committers with academic emails
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (12.6%) to scientific vocabulary
Keywords
Repository
AMD APML modules, apml_sbtsi and apml_sbrmi registers to hwmon framework provding temperature and power metrics of the socket. They are extended by registering a misc_device, which provides ioctl interface to BMC admins.
Statistics
- Stars: 33
- Watchers: 6
- Forks: 4
- Open Issues: 0
- Releases: 0
Topics
Metadata Files
README.md
.. SPDX-License-Identifier: GPL-2.0
amd apml modules (apmlsbtsi, apmlsbrmi and apml_alert)
amd-apml: APML interface drivers for BMC
EPYC processors from AMD provide APML interface for BMC users to monitor and configure the system parameters via the Advanced Platform Management List (APML) interface defined in EPYC processor PPR.
This chapter defines custom protocols over i2c/i3c bus - Mailbox - CPUID [RO] - MCA MSR {RO] - RMI/TSI register [RW]
modulei2ci3c based sbrmi and sbtsi modules, which are probed as i2c or i3c client devices, depending on the platforms DTS.
https://developer.amd.com/resources/epyc-resources/epyc-specifications
APMl library provides C API fo the user space application on top of this module.
Disclaimer
The amd apml modules are supported only on AMD Family 19h (including third-generation AMD EPYC processors (codenamed "Milan")) or later CPUs. Using the amd apml modules on earlier CPUs could produce unexpected results, and may cause the processor to operate outside of your motherboard or system specifications. Correspondingly, defaults to only executing on AMD Family 19h Model (0h ~ 1Fh & 30h ~ 3Fh) server line of processors.
Interface
Both apmlsbtsi and apmlsbrmi modules register a misc_device to provide ioctl interface to user space, allowing them to run these custom protocols.
apml_sbtsi module registers hwmon sensors for monitoring current temperature, managing max and min thresholds.
apmlsbrmi module registers hwmon sensors for monitoring powercapmax, current power consumption and managing powercap.
Build and Install
Kernel development packages for the running kernel need to be installed prior to building the amd apml modules. A Makefile is provided which should work with most kernel source trees.
To cross compile for arm based BMC
export CC=arm-openbmc-linux-gnueabi-gcc # Or similar
export ARCH=arm
KDIR=
To build the kernel module:
> make
To install the kernel module:
> sudo make modules_install
To clean the kernel module build directory:
> make clean
Note: There is a fix required in the upstream linux kerenl header to handle the i3c_dev. the patch is kept in patches/ folder of this repo.
Loading
If the apml modules were installed you should use the modprobe command to load the module.
> sudo modprobe apmlsbrmi apmlsbtsi
The apml modules can also be loaded using insmod if the module was not installed:
> sudo insmod ./apml_sbrmi.ko
> sudo insmod ./apml_sbtsi.ko
APML_ALERTL
Disclaimer: apml_alert module is currently experimental and may change in the future
EPYC processors from AMD provide APML ALERT_L for BMC users to monitor events.
|-------------------| | socket SBRMI|==== i2c/i3c bus | SBTSI|==== i2c/i3c bus | Alert_L|---- gpio line |-------------------|
APML Alert_L is asserted in multiple events: 1) Machine Check Exception occurs within the system 2) The processor alerts the SBI on system fatal error event 3) Set by hardware as a result of a 0x71/0x72/0x73 command completion 4) Set by firmware to indicate the completion of a mailbox operation 5) Temperature Alert
apml_alertl module defines an interface for user space to register their PID for notifications and an ISR which identifies the source of the interrupt and signals user space application.
apmlalertl module depends on apmlsbrmi module for identifying the source.
DTS node definition for Alert_L module
required: - compatible - status - gpios: GPIO associated with the Alert_L of the socket - sbrmi: Array of RMI devices on the system
Example:
/ { /* AlertL associated with socket 0 */ alertlsock0 { compatible = "apml-alertl"; status = "okay"; gpios = <&gpio0 ASPEEDGPIO(I, 7) GPIOACTIVELOW>; sbrmi = <&sbrmip01 &sbrmip1_1>; };
/* Alert_L associated with socket 1 */
alertl_sock1 {
compatible = "apml-alertl";
status = "okay";
gpios = <&gpio0 ASPEED_GPIO(U, 4) GPIO_ACTIVE_LOW>;
sbrmi = <&sbrmi_p1_1 &sbrmi_p0_1>;
};
};
Loading
To install apml_alertl driver builtin as module, user can use the modprobe or insmod command
> sudo modprobe apml_alertl
> sudo insmod ./apml_alertl.ko
Note: Dependency on apml_sbrmi.ko module
Unloading
> sudo rmmod apml_alertl
If the driver is inbuilt can be removed/inserted by running bind/unbind command.
> cd /sys/bus/platform/drivers/alertl
> echo alertl_rmi# > unbind/bind
USAGE
User need to register the PID of the process with the apmlalertl module, by writing the PID to the debugfs entry, /sys/kernel/debug/apmlalert/rasfatalpid
> echo $PID > /sys/kernel/debug/apmlalert/$alertsource
User application needs to wait for the signal from the apml_alertl module.
Signal from module carries a "struct kernel_siginfo" with following data
siint: is filled with the event data [15:0] = rasstatus register [23:16] = rmi static address
si_signo: 44
Currently the kernel driver send signal only in event, RAS status register bit set.
- In case of RAS fatal error the status register BIT(1) will set, and ISR clears the bit to avoid interfere with alerts during the ISR.
Future versions of the driver may include support for other events mentioned above.
Owner
- Name: AMD
- Login: amd
- Kind: organization
- Email: dl.DevSecOps-Github-Admin@amd.com
- Website: http://www.amd.com
- Repositories: 56
- Profile: https://github.com/amd
GitHub Events
Total
- Watch event: 6
- Member event: 2
- Push event: 1
- Fork event: 3
Last Year
- Watch event: 6
- Member event: 2
- Push event: 1
- Fork event: 3
Committers
Last synced: 9 months ago
Top Committers
| Name | Commits | |
|---|---|---|
| Akshay Gupta | A****a@a****m | 18 |
| Naveen Krishna Chatradhi | n****d@a****m | 6 |
| sathya priya kumar | s****k@a****m | 1 |
Committer Domains (Top 20 + Academic)
Issues and Pull Requests
Last synced: 9 months ago
All Time
- Total issues: 2
- Total pull requests: 1
- Average time to close issues: 9 months
- Average time to close pull requests: 8 months
- Total issue authors: 2
- Total pull request authors: 1
- Average comments per issue: 2.5
- Average comments per pull request: 2.0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 0
- Pull requests: 0
- Average time to close issues: N/A
- Average time to close pull requests: N/A
- Issue authors: 0
- Pull request authors: 0
- Average comments per issue: 0
- Average comments per pull request: 0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
- disjustin (1)
- JohnCenteno (1)
Pull Request Authors
- cyring (1)