zsphinx.addnodesdocument)}( rawsourcechildren]( translations LanguagesNode)}(hhh](h pending_xref)}(hhh]docutils.nodesTextChinese (Simplified)}parenthsba attributes}(ids]classes]names]dupnames]backrefs] refdomainstdreftypedoc reftarget(/translations/zh_CN/misc-devices/amd-sbimodnameN classnameN refexplicitutagnamehhh ubh)}(hhh]hChinese (Traditional)}hh2sbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget(/translations/zh_TW/misc-devices/amd-sbimodnameN classnameN refexplicituh1hhh ubh)}(hhh]hItalian}hhFsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget(/translations/it_IT/misc-devices/amd-sbimodnameN classnameN refexplicituh1hhh ubh)}(hhh]hJapanese}hhZsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget(/translations/ja_JP/misc-devices/amd-sbimodnameN classnameN refexplicituh1hhh ubh)}(hhh]hKorean}hhnsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget(/translations/ko_KR/misc-devices/amd-sbimodnameN classnameN refexplicituh1hhh ubh)}(hhh]hSpanish}hhsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget(/translations/sp_SP/misc-devices/amd-sbimodnameN classnameN refexplicituh1hhh ubeh}(h]h ]h"]h$]h&]current_languageEnglishuh1h hh _documenthsourceNlineNubhcomment)}(h SPDX-License-Identifier: GPL-2.0h]h SPDX-License-Identifier: GPL-2.0}hhsbah}(h]h ]h"]h$]h&] xml:spacepreserveuh1hhhhhhB/var/lib/git/docbuild/linux/Documentation/misc-devices/amd-sbi.rsthKubhsection)}(hhh](htitle)}(hAMD SIDE BAND interfaceh]hAMD SIDE BAND interface}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhhhhhKubh paragraph)}(hXjSome AMD Zen based processors supports system management functionality via side-band interface (SBI) called Advanced Platform Management Link (APML). APML is an I2C/I3C based 2-wire processor target interface. APML is used to communicate with the Remote Management Interface (SB Remote Management Interface (SB-RMI) and SB Temperature Sensor Interface (SB-TSI)).h]hXjSome AMD Zen based processors supports system management functionality via side-band interface (SBI) called Advanced Platform Management Link (APML). APML is an I2C/I3C based 2-wire processor target interface. APML is used to communicate with the Remote Management Interface (SB Remote Management Interface (SB-RMI) and SB Temperature Sensor Interface (SB-TSI)).}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhhhhubh)}(hMore details on the interface can be found in chapter "5 Advanced Platform Management Link (APML)" of the family/model PPR [1]_.h](hMore details on the interface can be found in chapter “5 Advanced Platform Management Link (APML)” of the family/model PPR }(hhhhhNhNubhfootnote_reference)}(h[1]_h]h1}(hhhhhNhNubah}(h]id1ah ]h"]h$]h&]refidid2docnamemisc-devices/amd-sbiuh1hhhٌresolvedKubh.}(hhhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhhhhubhfootnote)}(hrhttps://www.amd.com/content/dam/amd/en/documents/epyc-technical-docs/programmer-references/55898_B1_pub_0_50.zip h](hlabel)}(h1h]h1}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh)}(hphttps://www.amd.com/content/dam/amd/en/documents/epyc-technical-docs/programmer-references/55898_B1_pub_0_50.ziph]h reference)}(hjh]hphttps://www.amd.com/content/dam/amd/en/documents/epyc-technical-docs/programmer-references/55898_B1_pub_0_50.zip}(hjhhhNhNubah}(h]h ]h"]h$]h&]refurijuh1jhjubah}(h]h ]h"]h$]h&]uh1hhhhKhjubeh}(h]hah ]h"]1ah$]h&]hahhuh1jhhhKhhhhhKubh)}(hhh](h)}(h SBRMI deviceh]h SBRMI device}(hj;hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj8hhhhhKubh)}(hapml_sbrmi driver under the drivers/misc/amd-sbi creates miscdevice /dev/sbrmi-* to let user space programs run APML mailbox, CPUID, MCAMSR and register xfer commands.h]hapml_sbrmi driver under the drivers/misc/amd-sbi creates miscdevice /dev/sbrmi-* to let user space programs run APML mailbox, CPUID, MCAMSR and register xfer commands.}(hjIhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj8hhubh)}(hRegister sets is common across APML protocols. IOCTL is providing synchronization among protocols as transactions may create race condition.h]hRegister sets is common across APML protocols. IOCTL is providing synchronization among protocols as transactions may create race condition.}(hjWhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj8hhubh)}(h]$ ls -al /dev/sbrmi-3c crw------- 1 root root 10, 53 Jul 10 11:13 /dev/sbrmi-3ch]h]$ ls -al /dev/sbrmi-3c crw------- 1 root root 10, 53 Jul 10 11:13 /dev/sbrmi-3c}(hjehhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj8hhubh)}(hyapml_sbrmi driver registers hwmon sensors for monitoring power_cap_max, current power consumption and managing power_cap.h]hyapml_sbrmi driver registers hwmon sensors for monitoring power_cap_max, current power consumption and managing power_cap.}(hjshhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK"hj8hhubhdefinition_list)}(hhh](hdefinition_list_item)}(hCharacteristics of the dev node: * Differnet xfer protocols are defined: * Mailbox * CPUID * MCA_MSR * Register xfer h](hterm)}(h Characteristics of the dev node:h]h Characteristics of the dev node:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhK*hjubh definition)}(hhh]h bullet_list)}(hhh]h list_item)}(hfDiffernet xfer protocols are defined: * Mailbox * CPUID * MCA_MSR * Register xfer h]j)}(hhh]j)}(hRDiffernet xfer protocols are defined: * Mailbox * CPUID * MCA_MSR * Register xfer h](j)}(h%Differnet xfer protocols are defined:h]h%Differnet xfer protocols are defined:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhK*hjubj)}(hhh]j)}(hhh](j)}(hMailboxh]h)}(hjh]hMailbox}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK'hjubah}(h]h ]h"]h$]h&]uh1jhjubj)}(hCPUIDh]h)}(hjh]hCPUID}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK(hjubah}(h]h ]h"]h$]h&]uh1jhjubj)}(hMCA_MSRh]h)}(hjh]hMCA_MSR}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK)hjubah}(h]h ]h"]h$]h&]uh1jhjubj)}(hRegister xfer h]h)}(h Register xferh]h Register xfer}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK*hj ubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]bullet*uh1jhhhK'hjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhhhK*hjubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]j*j+uh1jhhhK&hjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhhhK*hjubj)}(hAccess restrictions: * Only root user is allowed to open the file. * APML Mailbox messages and Register xfer access are read-write, * CPUID and MCA_MSR access is read-only. h](j)}(hAccess restrictions:h]hAccess restrictions:}(hjZhhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhK/hjVubj)}(hhh]j)}(hhh](j)}(h+Only root user is allowed to open the file.h]h)}(hjph]h+Only root user is allowed to open the file.}(hjrhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK-hjnubah}(h]h ]h"]h$]h&]uh1jhjkubj)}(h>APML Mailbox messages and Register xfer access are read-write,h]h)}(hjh]h>APML Mailbox messages and Register xfer access are read-write,}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK.hjubah}(h]h ]h"]h$]h&]uh1jhjkubj)}(h'CPUID and MCA_MSR access is read-only. h]h)}(h&CPUID and MCA_MSR access is read-only.h]h&CPUID and MCA_MSR access is read-only.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK/hjubah}(h]h ]h"]h$]h&]uh1jhjkubeh}(h]h ]h"]h$]h&]j*j+uh1jhhhK-hjhubah}(h]h ]h"]h$]h&]uh1jhjVubeh}(h]h ]h"]h$]h&]uh1jhhhK/hjhhubeh}(h]h ]h"]h$]h&]uh1jhj8hhhNhNubeh}(h] sbrmi-deviceah ]h"] sbrmi deviceah$]h&]uh1hhhhhhhhKubh)}(hhh](h)}(h Driver IOCTLsh]h Driver IOCTLs}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhK2ubhindex)}(hhh]h}(h]h ]h"]h$]h&]entries](singleSBRMI_IOCTL_MBOX_CMD (C macro)c.SBRMI_IOCTL_MBOX_CMDhNtauh1jhjhhhNhNubhdesc)}(hhh](hdesc_signature)}(hSBRMI_IOCTL_MBOX_CMDh]hdesc_signature_line)}(hSBRMI_IOCTL_MBOX_CMDh]h desc_name)}(hSBRMI_IOCTL_MBOX_CMDh]h desc_sig_name)}(hjh]hSBRMI_IOCTL_MBOX_CMD}(hjhhhNhNubah}(h]h ]nah"]h$]h&]uh1j hj ubah}(h]h ](sig-namedescnameeh"]h$]h&]hhuh1jhjhhhhhK4ubah}(h]h ]h"]h$]h&]hh add_permalinkuh1jsphinx_line_type declaratorhjhhhhhK4ubah}(h]jah ](sig sig-objecteh"]h$]h&] is_multiline _toc_parts) _toc_namehuh1jhhhK4hjhhubh desc_content)}(hhh]h}(h]h ]h"]h$]h&]uh1j9hjhhhhhK4ubeh}(h]h ](cmacroeh"]h$]h&]domainjGobjtypejHdesctypejHnoindex noindexentrynocontentsentryuh1jhhhjhNhNubh)}(h**Parameters**h]hstrong)}(hjTh]h Parameters}(hjXhhhNhNubah}(h]h ]h"]h$]h&]uh1jVhjRubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/misc-devices/amd-sbi:53: ./include/uapi/misc/amd-apml.hhKRhjhhubj)}(hhh]j)}(h**struct** apml_mbox_msg Pointer to the :c:type:`struct apml_mbox_msg ` that will contain the protocol information h](j)}(h**struct** apml_mbox_msgh](jW)}(h **struct**h]hstruct}(hjwhhhNhNubah}(h]h ]h"]h$]h&]uh1jVhjsubh apml_mbox_msg}(hjshhhNhNubeh}(h]h ]h"]h$]h&]uh1jha/var/lib/git/docbuild/linux/Documentation/misc-devices/amd-sbi:53: ./include/uapi/misc/amd-apml.hhKVhjoubj)}(hhh]h)}(hhPointer to the :c:type:`struct apml_mbox_msg ` that will contain the protocol informationh](hPointer to the }(hjhhhNhNubh)}(h.:c:type:`struct apml_mbox_msg `h]hliteral)}(hjh]hstruct apml_mbox_msg}(hjhhhNhNubah}(h]h ](xrefjGc-typeeh"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]refdoch refdomainjGreftypetype refexplicitrefwarn c:parent_keysphinx.domains.c LookupKey)}data]sb reftarget apml_mbox_msguh1hha/var/lib/git/docbuild/linux/Documentation/misc-devices/amd-sbi:53: ./include/uapi/misc/amd-apml.hhKUhjubh+ that will contain the protocol information}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhjhKUhjubah}(h]h ]h"]h$]h&]uh1jhjoubeh}(h]h ]h"]h$]h&]uh1jhjhKVhjlubah}(h]h ]h"]h$]h&]uh1jhjhhha/var/lib/git/docbuild/linux/Documentation/misc-devices/amd-sbi:53: ./include/uapi/misc/amd-apml.hhNubh)}(hX**Description** IOCTL command for APML messages using generic _IOWR The IOCTL provides userspace access to AMD sideband mailbox protocol - Mailbox message read/write(0x0~0xFF) - returning "-EFAULT" if none of the above "-EPROTOTYPE" error is returned to provide additional error detailsh](jW)}(h**Description**h]h Description}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jVhjubhX IOCTL command for APML messages using generic _IOWR The IOCTL provides userspace access to AMD sideband mailbox protocol - Mailbox message read/write(0x0~0xFF) - returning “-EFAULT” if none of the above “-EPROTOTYPE” error is returned to provide additional error details}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/misc-devices/amd-sbi:53: ./include/uapi/misc/amd-apml.hhKXhjhhubj)}(hhh]h}(h]h ]h"]h$]h&]entries](jSBRMI_IOCTL_CPUID_CMD (C macro)c.SBRMI_IOCTL_CPUID_CMDhNtauh1jhjhhhNhNubj)}(hhh](j)}(hSBRMI_IOCTL_CPUID_CMDh]j)}(hSBRMI_IOCTL_CPUID_CMDh]j)}(hSBRMI_IOCTL_CPUID_CMDh]j)}(hjh]hSBRMI_IOCTL_CPUID_CMD}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1j hjubah}(h]h ](j j!eh"]h$]h&]hhuh1jhjhhhhhK7ubah}(h]h ]h"]h$]h&]hhj+uh1jj,j-hjhhhhhK7ubah}(h]j ah ](j1j2eh"]h$]h&]j6j7)j8huh1jhhhK7hjhhubj:)}(hhh]h}(h]h ]h"]h$]h&]uh1j9hjhhhhhK7ubeh}(h]h ](jGmacroeh"]h$]h&]jLjGjMjIjNjIjOjPjQuh1jhhhjhNhNubh)}(h**Parameters**h]jW)}(hjOh]h Parameters}(hjQhhhNhNubah}(h]h ]h"]h$]h&]uh1jVhjMubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/misc-devices/amd-sbi:56: ./include/uapi/misc/amd-apml.hhKdhjhhubj)}(hhh]j)}(h**struct** apml_cpuid_msg Pointer to the :c:type:`struct apml_cpuid_msg ` that will contain the protocol information h](j)}(h**struct** apml_cpuid_msgh](jW)}(h **struct**h]hstruct}(hjphhhNhNubah}(h]h ]h"]h$]h&]uh1jVhjlubh apml_cpuid_msg}(hjlhhhNhNubeh}(h]h ]h"]h$]h&]uh1jha/var/lib/git/docbuild/linux/Documentation/misc-devices/amd-sbi:56: ./include/uapi/misc/amd-apml.hhKhhjhubj)}(hhh]h)}(hjPointer to the :c:type:`struct apml_cpuid_msg ` that will contain the protocol informationh](hPointer to the }(hjhhhNhNubh)}(h0:c:type:`struct apml_cpuid_msg `h]j)}(hjh]hstruct apml_cpuid_msg}(hjhhhNhNubah}(h]h ](jjGc-typeeh"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]refdoch refdomainjGreftypetype refexplicitrefwarnjjjapml_cpuid_msguh1hha/var/lib/git/docbuild/linux/Documentation/misc-devices/amd-sbi:56: ./include/uapi/misc/amd-apml.hhKghjubh+ that will contain the protocol information}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhjhKghjubah}(h]h ]h"]h$]h&]uh1jhjhubeh}(h]h ]h"]h$]h&]uh1jhjhKhhjeubah}(h]h ]h"]h$]h&]uh1jhjhhha/var/lib/git/docbuild/linux/Documentation/misc-devices/amd-sbi:56: ./include/uapi/misc/amd-apml.hhNubh)}(hXC**Description** IOCTL command for APML messages using generic _IOWR The IOCTL provides userspace access to AMD sideband cpuid protocol - CPUID protocol to get CPU details for Function/Ext Function at thread level - returning "-EFAULT" if none of the above "-EPROTOTYPE" error is returned to provide additional error detailsh](jW)}(h**Description**h]h Description}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jVhjubhX< IOCTL command for APML messages using generic _IOWR The IOCTL provides userspace access to AMD sideband cpuid protocol - CPUID protocol to get CPU details for Function/Ext Function at thread level - returning “-EFAULT” if none of the above “-EPROTOTYPE” error is returned to provide additional error details}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/misc-devices/amd-sbi:56: ./include/uapi/misc/amd-apml.hhKjhjhhubj)}(hhh]h}(h]h ]h"]h$]h&]entries](j SBRMI_IOCTL_MCAMSR_CMD (C macro)c.SBRMI_IOCTL_MCAMSR_CMDhNtauh1jhjhhhNhNubj)}(hhh](j)}(hSBRMI_IOCTL_MCAMSR_CMDh]j)}(hSBRMI_IOCTL_MCAMSR_CMDh]j)}(hSBRMI_IOCTL_MCAMSR_CMDh]j)}(hjh]hSBRMI_IOCTL_MCAMSR_CMD}(hj hhhNhNubah}(h]h ]jah"]h$]h&]uh1j hjubah}(h]h ](j j!eh"]h$]h&]hhuh1jhjhhhhhK:ubah}(h]h ]h"]h$]h&]hhj+uh1jj,j-hjhhhhhK:ubah}(h]jah ](j1j2eh"]h$]h&]j6j7)j8huh1jhhhK:hjhhubj:)}(hhh]h}(h]h ]h"]h$]h&]uh1j9hjhhhhhK:ubeh}(h]h ](jGmacroeh"]h$]h&]jLjGjMj6jNj6jOjPjQuh1jhhhjhNhNubh)}(h**Parameters**h]jW)}(hj<h]h Parameters}(hj>hhhNhNubah}(h]h ]h"]h$]h&]uh1jVhj:ubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/misc-devices/amd-sbi:59: ./include/uapi/misc/amd-apml.hhKwhjhhubj)}(hhh]j)}(h**struct** apml_mcamsr_msg Pointer to the :c:type:`struct apml_mcamsr_msg ` that will contain the protocol information h](j)}(h**struct** apml_mcamsr_msgh](jW)}(h **struct**h]hstruct}(hj]hhhNhNubah}(h]h ]h"]h$]h&]uh1jVhjYubh apml_mcamsr_msg}(hjYhhhNhNubeh}(h]h ]h"]h$]h&]uh1jha/var/lib/git/docbuild/linux/Documentation/misc-devices/amd-sbi:59: ./include/uapi/misc/amd-apml.hhK{hjUubj)}(hhh]h)}(hlPointer to the :c:type:`struct apml_mcamsr_msg ` that will contain the protocol informationh](hPointer to the }(hjyhhhNhNubh)}(h2:c:type:`struct apml_mcamsr_msg `h]j)}(hjh]hstruct apml_mcamsr_msg}(hjhhhNhNubah}(h]h ](jjGc-typeeh"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]refdoch refdomainjGreftypetype refexplicitrefwarnjjjapml_mcamsr_msguh1hha/var/lib/git/docbuild/linux/Documentation/misc-devices/amd-sbi:59: ./include/uapi/misc/amd-apml.hhKzhjyubh+ that will contain the protocol information}(hjyhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhjhKzhjvubah}(h]h ]h"]h$]h&]uh1jhjUubeh}(h]h ]h"]h$]h&]uh1jhjuhK{hjRubah}(h]h ]h"]h$]h&]uh1jhjhhha/var/lib/git/docbuild/linux/Documentation/misc-devices/amd-sbi:59: ./include/uapi/misc/amd-apml.hhNubh)}(hX=**Description** IOCTL command for APML messages using generic _IOWR The IOCTL provides userspace access to AMD sideband MCAMSR protocol - MCAMSR protocol to get MCA bank details for Function at thread level - returning "-EFAULT" if none of the above "-EPROTOTYPE" error is returned to provide additional error detailsh](jW)}(h**Description**h]h Description}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jVhjubhX6 IOCTL command for APML messages using generic _IOWR The IOCTL provides userspace access to AMD sideband MCAMSR protocol - MCAMSR protocol to get MCA bank details for Function at thread level - returning “-EFAULT” if none of the above “-EPROTOTYPE” error is returned to provide additional error details}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/misc-devices/amd-sbi:59: ./include/uapi/misc/amd-apml.hhK}hjhhubj)}(hhh]h}(h]h ]h"]h$]h&]entries](j"SBRMI_IOCTL_REG_XFER_CMD (C macro)c.SBRMI_IOCTL_REG_XFER_CMDhNtauh1jhjhhhNhNubj)}(hhh](j)}(hSBRMI_IOCTL_REG_XFER_CMDh]j)}(hSBRMI_IOCTL_REG_XFER_CMDh]j)}(hSBRMI_IOCTL_REG_XFER_CMDh]j)}(hjh]hSBRMI_IOCTL_REG_XFER_CMD}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1j hjubah}(h]h ](j j!eh"]h$]h&]hhuh1jhjhhhhhK=ubah}(h]h ]h"]h$]h&]hhj+uh1jj,j-hjhhhhhK=ubah}(h]jah ](j1j2eh"]h$]h&]j6j7)j8huh1jhhhK=hjhhubj:)}(hhh]h}(h]h ]h"]h$]h&]uh1j9hjhhhhhK=ubeh}(h]h ](jGmacroeh"]h$]h&]jLjGjMj#jNj#jOjPjQuh1jhhhjhNhNubh)}(h**Parameters**h]jW)}(hj)h]h Parameters}(hj+hhhNhNubah}(h]h ]h"]h$]h&]uh1jVhj'ubah}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/misc-devices/amd-sbi:62: ./include/uapi/misc/amd-apml.hhKhjhhubj)}(hhh]j)}(h**struct** apml_reg_xfer_msg Pointer to the :c:type:`struct apml_reg_xfer_msg ` that will contain the protocol information h](j)}(h**struct** apml_reg_xfer_msgh](jW)}(h **struct**h]hstruct}(hjJhhhNhNubah}(h]h ]h"]h$]h&]uh1jVhjFubh apml_reg_xfer_msg}(hjFhhhNhNubeh}(h]h ]h"]h$]h&]uh1jha/var/lib/git/docbuild/linux/Documentation/misc-devices/amd-sbi:62: ./include/uapi/misc/amd-apml.hhKhjBubj)}(hhh]h)}(hpPointer to the :c:type:`struct apml_reg_xfer_msg ` that will contain the protocol informationh](hPointer to the }(hjfhhhNhNubh)}(h6:c:type:`struct apml_reg_xfer_msg `h]j)}(hjph]hstruct apml_reg_xfer_msg}(hjrhhhNhNubah}(h]h ](jjGc-typeeh"]h$]h&]uh1jhjnubah}(h]h ]h"]h$]h&]refdoch refdomainjGreftypetype refexplicitrefwarnjjjapml_reg_xfer_msguh1hha/var/lib/git/docbuild/linux/Documentation/misc-devices/amd-sbi:62: ./include/uapi/misc/amd-apml.hhKhjfubh+ that will contain the protocol information}(hjfhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhjhKhjcubah}(h]h ]h"]h$]h&]uh1jhjBubeh}(h]h ]h"]h$]h&]uh1jhjbhKhj?ubah}(h]h ]h"]h$]h&]uh1jhjhhha/var/lib/git/docbuild/linux/Documentation/misc-devices/amd-sbi:62: ./include/uapi/misc/amd-apml.hhNubh)}(h**Description** IOCTL command for APML messages using generic _IOWR The IOCTL provides userspace access to AMD sideband register xfer protocol - Register xfer protocol to get/set hardware register for given offseth](jW)}(h**Description**h]h Description}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jVhjubh IOCTL command for APML messages using generic _IOWR The IOCTL provides userspace access to AMD sideband register xfer protocol - Register xfer protocol to get/set hardware register for given offset}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hha/var/lib/git/docbuild/linux/Documentation/misc-devices/amd-sbi:62: ./include/uapi/misc/amd-apml.hhKhjhhubeh}(h] driver-ioctlsah ]h"] driver ioctlsah$]h&]uh1hhhhhhhhK2ubh)}(hhh](h)}(hUser-space usageh]hUser-space usage}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhKBubh)}(hYTo access side band interface from a C program. First, user need to include the headers::h]hXTo access side band interface from a C program. First, user need to include the headers:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKDhjhhubh literal_block)}(h#include h]h#include }hjsbah}(h]h ]h"]h$]h&]hhuh1jhhhKGhjhhubh)}(hVWhich defines the supported IOCTL and data structure to be passed from the user space.h]hVWhich defines the supported IOCTL and data structure to be passed from the user space.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKIhjhhubh)}(h.Next thing, open the device file, as follows::h]h-Next thing, open the device file, as follows:}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKLhjhhubj)}(hcint file; file = open("/dev/sbrmi-*", O_RDWR); if (file < 0) { /* ERROR HANDLING */ exit(1); }h]hcint file; file = open("/dev/sbrmi-*", O_RDWR); if (file < 0) { /* ERROR HANDLING */ exit(1); }}hjsbah}(h]h ]h"]h$]h&]hhuh1jhhhKNhjhhubh)}(h!The following IOCTLs are defined:h]h!The following IOCTLs are defined:}(hj)hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKVhjhhubh)}(hX``#define SB_BASE_IOCTL_NR 0xF9`` ``#define SBRMI_IOCTL_MBOX_CMD _IOWR(SB_BASE_IOCTL_NR, 0, struct apml_mbox_msg)`` ``#define SBRMI_IOCTL_CPUID_CMD _IOWR(SB_BASE_IOCTL_NR, 1, struct apml_cpuid_msg)`` ``#define SBRMI_IOCTL_MCAMSR_CMD _IOWR(SB_BASE_IOCTL_NR, 2, struct apml_mcamsr_msg)`` ``#define SBRMI_IOCTL_REG_XFER_CMD _IOWR(SB_BASE_IOCTL_NR, 3, struct apml_reg_xfer_msg)``h](j)}(h.``#define SB_BASE_IOCTL_NR 0xF9``h]h*#define SB_BASE_IOCTL_NR 0xF9}(hj;hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj7ubh }(hj7hhhNhNubj)}(hZ``#define SBRMI_IOCTL_MBOX_CMD _IOWR(SB_BASE_IOCTL_NR, 0, struct apml_mbox_msg)``h]hV#define SBRMI_IOCTL_MBOX_CMD _IOWR(SB_BASE_IOCTL_NR, 0, struct apml_mbox_msg)}(hjMhhhNhNubah}(h]h ]h"]h$]h&]uh1jhj7ubh }hj7sbj)}(h[``#define SBRMI_IOCTL_CPUID_CMD _IOWR(SB_BASE_IOCTL_NR, 1, struct apml_cpuid_msg)``h]hW#define SBRMI_IOCTL_CPUID_CMD _IOWR(SB_BASE_IOCTL_NR, 1, struct apml_cpuid_msg)}(hj_hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj7ubh }hj7sbj)}(h\``#define SBRMI_IOCTL_MCAMSR_CMD _IOWR(SB_BASE_IOCTL_NR, 2, struct apml_mcamsr_msg)``h]hX#define SBRMI_IOCTL_MCAMSR_CMD _IOWR(SB_BASE_IOCTL_NR, 2, struct apml_mcamsr_msg)}(hjqhhhNhNubah}(h]h ]h"]h$]h&]uh1jhj7ubh }hj7sbj)}(h^``#define SBRMI_IOCTL_REG_XFER_CMD _IOWR(SB_BASE_IOCTL_NR, 3, struct apml_reg_xfer_msg)``h]hZ#define SBRMI_IOCTL_REG_XFER_CMD _IOWR(SB_BASE_IOCTL_NR, 3, struct apml_reg_xfer_msg)}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhj7ubeh}(h]h ]h"]h$]h&]uh1hhhhKXhjhhubh)}(huUser space C-APIs are made available by esmi_oob_library, hosted at [2]_ which is provided by the E-SMS project [3]_.h](hDUser space C-APIs are made available by esmi_oob_library, hosted at }(hjhhhNhNubh)}(h[2]_h]h2}(hjhhhNhNubah}(h]id3ah ]h"]h$]h&]hid5hhuh1hhjhKubh( which is provided by the E-SMS project }(hjhhhNhNubh)}(h[3]_h]h3}(hjhhhNhNubah}(h]id4ah ]h"]h$]h&]hid6hhuh1hhjhKubh.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhK_hjhhubj)}(h'https://github.com/amd/esmi_oob_libraryh](j)}(h2h]h2}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh)}(hjh]j)}(hjh]h'https://github.com/amd/esmi_oob_library}(hjhhhNhNubah}(h]h ]h"]h$]h&]refurijuh1jhjubah}(h]h ]h"]h$]h&]uh1hhhhKbhjubeh}(h]jah ]h"]2ah$]h&]jahhuh1jhhhKbhjhhhKubj)}(h+https://www.amd.com/en/developer/e-sms.htmlh](j)}(h3h]h3}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh)}(hjh]j)}(hjh]h+https://www.amd.com/en/developer/e-sms.html}(hjhhhNhNubah}(h]h ]h"]h$]h&]refurijuh1jhjubah}(h]h ]h"]h$]h&]uh1hhhhKchjubeh}(h]jah ]h"]3ah$]h&]jahhuh1jhhhKchjhhhKubeh}(h]user-space-usageah ]h"]user-space usageah$]h&]uh1hhhhhhhhKBubeh}(h]amd-side-band-interfaceah ]h"]amd side band interfaceah$]h&]uh1hhhhhhhhKubeh}(h]h ]h"]h$]h&]sourcehuh1hcurrent_sourceN current_lineNsettingsdocutils.frontendValues)}(hN generatorN datestampN source_linkN source_urlN toc_backlinksentryfootnote_backlinksK sectnum_xformKstrip_commentsNstrip_elements_with_classesN strip_classesN report_levelK halt_levelKexit_status_levelKdebugNwarning_streamN tracebackinput_encoding utf-8-siginput_encoding_error_handlerstrictoutput_encodingutf-8output_encoding_error_handlerj`error_encodingutf-8error_encoding_error_handlerbackslashreplace language_codeenrecord_dependenciesNconfigN id_prefixhauto_id_prefixid dump_settingsNdump_internalsNdump_transformsNdump_pseudo_xmlNexpose_internalsNstrict_visitorN_disable_configN_sourceh _destinationN _config_files]7/var/lib/git/docbuild/linux/Documentation/docutils.confafile_insertion_enabled raw_enabledKline_length_limitM'pep_referencesN pep_base_urlhttps://peps.python.org/pep_file_url_templatepep-%04drfc_referencesN rfc_base_url&https://datatracker.ietf.org/doc/html/ tab_widthKtrim_footnote_reference_spacesyntax_highlightlong smart_quotessmartquotes_locales]character_level_inline_markupdoctitle_xform docinfo_xformKsectsubtitle_xform image_loadinglinkembed_stylesheetcloak_email_addressessection_self_linkenvNubreporterNindirect_targets]substitution_defs}substitution_names}refnames}(1]ha2]ja3]jaurefids}nameids}(j:j7j5hjjjjj2j/jjj*ju nametypes}(j:j5jjj2jj*uh}(j7hhhhjjj8jjjjj jjjjjj/jjjjjjjjju footnote_refs}(j]haj]jaj]jau citation_refs} autofootnotes]autofootnote_refs]symbol_footnotes]symbol_footnote_refs] footnotes](jjje citations]autofootnote_startKsymbol_footnote_startK id_counter collectionsCounter}jnKsRparse_messages]transform_messages] transformerN include_log] decorationNhhub.