€•šWŒsphinx.addnodes”Œdocument”“”)”}”(Œ rawsource”Œ”Œchildren”]”(Œ translations”Œ LanguagesNode”“”)”}”(hhh]”(hŒ pending_xref”“”)”}”(hhh]”Œdocutils.nodes”ŒText”“”ŒChinese (Simplified)”…””}”(hhŒparent”hubaŒ attributes”}”(Œids”]”Œclasses”]”Œnames”]”Œdupnames”]”Œbackrefs”]”Œ refdomain”Œstd”Œreftype”Œdoc”Œ reftarget”Œ#/translations/zh_CN/hid/amd-sfh-hid”Œmodname”NŒ classname”NŒ refexplicit”ˆuŒtagname”hhh ubh)”}”(hhh]”hŒChinese (Traditional)”…””}”(hhhh2ubah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ#/translations/zh_TW/hid/amd-sfh-hid”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒItalian”…””}”(hhhhFubah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ#/translations/it_IT/hid/amd-sfh-hid”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒJapanese”…””}”(hhhhZubah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ#/translations/ja_JP/hid/amd-sfh-hid”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒKorean”…””}”(hhhhnubah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ#/translations/ko_KR/hid/amd-sfh-hid”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒSpanish”…””}”(hhhh‚ubah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ#/translations/sp_SP/hid/amd-sfh-hid”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubeh}”(h]”h ]”h"]”h$]”h&]”Œcurrent_language”ŒEnglish”uh1h hhŒ _document”hŒsource”NŒline”NubhŒcomment”“”)”}”(hŒ SPDX-License-Identifier: GPL-2.0”h]”hŒ SPDX-License-Identifier: GPL-2.0”…””}”(hhhh£ubah}”(h]”h ]”h"]”h$]”h&]”Œ xml:space”Œpreserve”uh1h¡hhhžhhŸŒ=/var/lib/git/docbuild/linux/Documentation/hid/amd-sfh-hid.rst”h KubhŒsection”“”)”}”(hhh]”(hŒtitle”“”)”}”(hŒAMD Sensor Fusion Hub”h]”hŒAMD Sensor Fusion Hub”…””}”(hh½hh»hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h¹hh¶hžhhŸh³h KubhŒ paragraph”“”)”}”(hX3AMD Sensor Fusion Hub (SFH) is part of an SOC starting from Ryzen-based platforms. The solution is working well on several OEM products. AMD SFH uses HID over PCIe bus. In terms of architecture it resembles ISH, however the major difference is all the HID reports are generated as part of the kernel driver.”h]”hX3AMD Sensor Fusion Hub (SFH) is part of an SOC starting from Ryzen-based platforms. The solution is working well on several OEM products. AMD SFH uses HID over PCIe bus. In terms of architecture it resembles ISH, however the major difference is all the HID reports are generated as part of the kernel driver.”…””}”(hhÍhhËhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÉhŸh³h Khh¶hžhubhµ)”}”(hhh]”(hº)”}”(hŒ Block Diagram”h]”hŒ Block Diagram”…””}”(hhÞhhÜhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h¹hhÙhžhhŸh³h K ubhŒ literal_block”“”)”}”(hXT --------------------------------- | HID User Space Applications | - ------------------------------- --------------------------------------------- --------------------------------- | HID Core | --------------------------------- --------------------------------- | AMD HID Transport | --------------------------------- -------------------------------- | AMD HID Client | | with HID Report Generator| -------------------------------- -------------------------------- | AMD MP2 PCIe Driver | -------------------------------- OS --------------------------------------------- Hardware + Firmware -------------------------------- | SFH MP2 Processor | --------------------------------”h]”hXT --------------------------------- | HID User Space Applications | - ------------------------------- --------------------------------------------- --------------------------------- | HID Core | --------------------------------- --------------------------------- | AMD HID Transport | --------------------------------- -------------------------------- | AMD HID Client | | with HID Report Generator| -------------------------------- -------------------------------- | AMD MP2 PCIe Driver | -------------------------------- OS --------------------------------------------- Hardware + Firmware -------------------------------- | SFH MP2 Processor | --------------------------------”…””}”(hhhhìubah}”(h]”h ]”h"]”h$]”h&]”h±h²uh1hêhŸh³h KhhÙhžhubeh}”(h]”Œ block-diagram”ah ]”h"]”Œ block diagram”ah$]”h&]”uh1h´hh¶hžhhŸh³h K ubhµ)”}”(hhh]”(hº)”}”(hŒAMD HID Transport Layer”h]”hŒAMD HID Transport Layer”…””}”(hjhjhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h¹hjhžhhŸh³h K.ubhÊ)”}”(hXVAMD SFH transport is also implemented as a bus. Each client application executing in the AMD MP2 is registered as a device on this bus. Here, MP2 is an ARM core connected to x86 for processing sensor data. The layer, which binds each device (AMD SFH HID driver) identifies the device type and registers with the HID core. Transport layer attaches a constant "struct hid_ll_driver" object with each device. Once a device is registered with HID core, the callbacks provided via this struct are used by HID core to communicate with the device. AMD HID Transport layer implements the synchronous calls.”h]”hXZAMD SFH transport is also implemented as a bus. Each client application executing in the AMD MP2 is registered as a device on this bus. Here, MP2 is an ARM core connected to x86 for processing sensor data. The layer, which binds each device (AMD SFH HID driver) identifies the device type and registers with the HID core. Transport layer attaches a constant “struct hid_ll_driver†object with each device. Once a device is registered with HID core, the callbacks provided via this struct are used by HID core to communicate with the device. AMD HID Transport layer implements the synchronous calls.”…””}”(hjhjhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÉhŸh³h K/hjhžhubeh}”(h]”Œamd-hid-transport-layer”ah ]”h"]”Œamd hid transport layer”ah$]”h&]”uh1h´hh¶hžhhŸh³h K.ubhµ)”}”(hhh]”(hº)”}”(hŒAMD HID Client Layer”h]”hŒAMD HID Client Layer”…””}”(hj.hj,hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h¹hj)hžhhŸh³h K7ubhÊ)”}”(hXÆThis layer is responsible to implement HID requests and descriptors. As firmware is OS agnostic, HID client layer fills the HID request structure and descriptors. HID client layer is complex as it is interface between MP2 PCIe layer and HID. HID client layer initializes the MP2 PCIe layer and holds the instance of MP2 layer. It identifies the number of sensors connected using MP2-PCIe layer. Based on that allocates the DRAM address for each and every sensor and passes it to MP2-PCIe driver. On enumeration of each sensor, client layer fills the HID Descriptor structure and HID input report structure. HID Feature report structure is optional. The report descriptor structure varies from sensor to sensor.”h]”hXÆThis layer is responsible to implement HID requests and descriptors. As firmware is OS agnostic, HID client layer fills the HID request structure and descriptors. HID client layer is complex as it is interface between MP2 PCIe layer and HID. HID client layer initializes the MP2 PCIe layer and holds the instance of MP2 layer. It identifies the number of sensors connected using MP2-PCIe layer. Based on that allocates the DRAM address for each and every sensor and passes it to MP2-PCIe driver. On enumeration of each sensor, client layer fills the HID Descriptor structure and HID input report structure. HID Feature report structure is optional. The report descriptor structure varies from sensor to sensor.”…””}”(hj<hj:hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÉhŸh³h K8hj)hžhubeh}”(h]”Œamd-hid-client-layer”ah ]”h"]”Œamd hid client layer”ah$]”h&]”uh1h´hh¶hžhhŸh³h K7ubhµ)”}”(hhh]”(hº)”}”(hŒAMD MP2 PCIe layer”h]”hŒAMD MP2 PCIe layer”…””}”(hjUhjShžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h¹hjPhžhhŸh³h KBubhÊ)”}”(hŒ›MP2 PCIe Layer is responsible for making all transactions with the firmware over PCIe. The connection establishment between firmware and PCIe happens here.”h]”hŒ›MP2 PCIe Layer is responsible for making all transactions with the firmware over PCIe. The connection establishment between firmware and PCIe happens here.”…””}”(hjchjahžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÉhŸh³h KChjPhžhubhÊ)”}”(hŒºThe communication between X86 and MP2 is split into three parts. 1. Command transfer via the C2P mailbox registers. 2. Data transfer via DRAM. 3. Supported sensor info via P2C registers.”h]”hŒºThe communication between X86 and MP2 is split into three parts. 1. Command transfer via the C2P mailbox registers. 2. Data transfer via DRAM. 3. Supported sensor info via P2C registers.”…””}”(hjqhjohžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÉhŸh³h KFhjPhžhubhÊ)”}”(hX¶Commands are sent to MP2 using C2P Mailbox registers. Writing into C2P Message registers generates interrupt to MP2. The client layer allocates the physical memory and the same is sent to MP2 via the PCI layer. MP2 firmware writes the command output to the access DRAM memory which the client layer has allocated. Firmware always writes minimum of 32 bytes into DRAM. So as a protocol driver shall allocate minimum of 32 bytes DRAM space.”h]”hX¶Commands are sent to MP2 using C2P Mailbox registers. Writing into C2P Message registers generates interrupt to MP2. The client layer allocates the physical memory and the same is sent to MP2 via the PCI layer. MP2 firmware writes the command output to the access DRAM memory which the client layer has allocated. Firmware always writes minimum of 32 bytes into DRAM. So as a protocol driver shall allocate minimum of 32 bytes DRAM space.”…””}”(hjhj}hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÉhŸh³h KKhjPhžhubeh}”(h]”Œamd-mp2-pcie-layer”ah ]”h"]”Œamd mp2 pcie layer”ah$]”h&]”uh1h´hh¶hžhhŸh³h KBubhµ)”}”(hhh]”(hº)”}”(hŒEnumeration and Probing flow”h]”hŒEnumeration and Probing flow”…””}”(hj˜hj–hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h¹hj“hžhhŸh³h KRubhë)”}”(hXU HID AMD AMD AMD -PCIe MP2 Core Transport Client layer layer FW | | | | | | | | on Boot Driver Loaded | | | | | | | | | MP2-PCIe Int | | | | | | | | |---Get Number of sensors-> | | | | | Read P2C | | | | Register | | | | | | | | | Loop(for No of Sensors) | | | | |----------------------| | | | | | Create HID Descriptor| | | | | | Create Input report | | | | | | Descriptor Map | | | | | | the MP2 FW Index to | | | | | | HID Index | | | | | | Allocate the DRAM | Enable | | | | address | Sensors | | | |----------------------| | | | | HID transport| | Enable | | |<--Probe------| |---Sensor CMD--> | | | Create the | | | | | HID device | | | | | (MFD) | | | | | by Populating| | | | | the HID | | | | | ll_driver | | | | HID | | | | | add | | | | |Device | | | | |<------------- | | | |”h]”hXU HID AMD AMD AMD -PCIe MP2 Core Transport Client layer layer FW | | | | | | | | on Boot Driver Loaded | | | | | | | | | MP2-PCIe Int | | | | | | | | |---Get Number of sensors-> | | | | | Read P2C | | | | Register | | | | | | | | | Loop(for No of Sensors) | | | | |----------------------| | | | | | Create HID Descriptor| | | | | | Create Input report | | | | | | Descriptor Map | | | | | | the MP2 FW Index to | | | | | | HID Index | | | | | | Allocate the DRAM | Enable | | | | address | Sensors | | | |----------------------| | | | | HID transport| | Enable | | |<--Probe------| |---Sensor CMD--> | | | Create the | | | | | HID device | | | | | (MFD) | | | | | by Populating| | | | | the HID | | | | | ll_driver | | | | HID | | | | | add | | | | |Device | | | | |<------------- | | | |”…””}”(hhhj¤ubah}”(h]”h ]”h"]”h$]”h&]”h±h²uh1hêhŸh³h KUhj“hžhubeh}”(h]”Œenumeration-and-probing-flow”ah ]”h"]”Œenumeration and probing flow”ah$]”h&]”uh1h´hh¶hžhhŸh³h KRubhµ)”}”(hhh]”(hº)”}”(hŒ0Data Flow from Application to the AMD SFH Driver”h]”hŒ0Data Flow from Application to the AMD SFH Driver”…””}”(hj¿hj½hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h¹hjºhžhhŸh³h Kyubhë)”}”(hXa | | | | | | | | | | | | | | | | | | | | | | | | | |HID_req | | | | |get_report | | | | |------------->| | | | | | HID_get_input| | | | | report | | | | |------------->|------------------------| | | | | | Read the DRAM data for| | | | | | requested sensor and | | | | | | create the HID input | | | | | | report | | | | | |------------------------| | | | |Data received | | | | | in HID report| | | To |<-------------|<-------------| | | Applications| | | | | <-------| | | | |”h]”hXa | | | | | | | | | | | | | | | | | | | | | | | | | |HID_req | | | | |get_report | | | | |------------->| | | | | | HID_get_input| | | | | report | | | | |------------->|------------------------| | | | | | Read the DRAM data for| | | | | | requested sensor and | | | | | | create the HID input | | | | | | report | | | | | |------------------------| | | | |Data received | | | | | in HID report| | | To |<-------------|<-------------| | | Applications| | | | | <-------| | | | |”…””}”(hhhjËubah}”(h]”h ]”h"]”h$]”h&]”h±h²uh1hêhŸh³h K}hjºhžhubeh}”(h]”Œ0data-flow-from-application-to-the-amd-sfh-driver”ah ]”h"]”Œ0data flow from application to the amd sfh driver”ah$]”h&]”uh1h´hh¶hžhhŸh³h Kyubeh}”(h]”Œamd-sensor-fusion-hub”ah ]”h"]”Œamd sensor fusion hub”ah$]”h&]”uh1h´hhhžhhŸh³h Kubeh}”(h]”h ]”h"]”h$]”h&]”Œsource”h³uh1hŒcurrent_source”NŒ current_line”NŒsettings”Œdocutils.frontend”ŒValues”“”)”}”(h¹NŒ generator”NŒ datestamp”NŒ source_link”NŒ source_url”NŒ toc_backlinks”Œentry”Œfootnote_backlinks”KŒ sectnum_xform”KŒstrip_comments”NŒstrip_elements_with_classes”NŒ strip_classes”NŒ report_level”KŒ halt_level”KŒexit_status_level”KŒdebug”NŒwarning_stream”NŒ traceback”ˆŒinput_encoding”Œ utf-8-sig”Œinput_encoding_error_handler”Œstrict”Œoutput_encoding”Œutf-8”Œoutput_encoding_error_handler”j Œerror_encoding”ŒUTF-8”Œerror_encoding_error_handler”Œbackslashreplace”Œ language_code”Œen”Œrecord_dependencies”NŒconfig”NŒ id_prefix”hŒauto_id_prefix”Œid”Œ dump_settings”NŒdump_internals”NŒdump_transforms”NŒdump_pseudo_xml”NŒexpose_internals”NŒstrict_visitor”NŒ_disable_config”NŒ_source”h³Œ _destination”NŒ _config_files”]”Œ7/var/lib/git/docbuild/linux/Documentation/docutils.conf”aŒpep_references”NŒ pep_base_url”Œhttps://peps.python.org/”Œpep_file_url_template”Œpep-%04d”Œrfc_references”NŒ rfc_base_url”Œ&https://datatracker.ietf.org/doc/html/”Œ tab_width”KŒtrim_footnote_reference_space”‰Œfile_insertion_enabled”ˆŒ raw_enabled”KŒline_length_limit”M'Œsyntax_highlight”Œlong”Œ smart_quotes”ˆŒsmartquotes_locales”]”Œcharacter_level_inline_markup”‰Œdoctitle_xform”‰Œ docinfo_xform”KŒsectsubtitle_xform”‰Œ image_loading”Œlink”Œembed_stylesheet”‰Œcloak_email_addresses”ˆŒsection_self_link”‰Œ embed_images”‰Œenv”NubŒreporter”NŒindirect_targets”]”Œsubstitution_defs”}”Œsubstitution_names”}”Œrefnames”}”Œrefids”}”Œnameids”}”(jæjãhÿhüj&j#jMjJjjj·j´jÞjÛuŒ nametypes”}”(jæNhÿNj&NjMNjNj·NjÞNuh}”(jãh¶hühÙj#jjJj)jjPj´j“jÛjºuŒ footnote_refs”}”Œ citation_refs”}”Œ autofootnotes”]”Œautofootnote_refs”]”Œsymbol_footnotes”]”Œsymbol_footnote_refs”]”Œ footnotes”]”Œ citations”]”Œautofootnote_start”KŒsymbol_footnote_start”KŒ id_counter”Œ collections”ŒCounter”“”}”…”R”Œparse_messages”]”Œtransform_messages”]”Œ transformer”NŒ include_log”]”Œ decoration”Nhžhub.