€•”GŒsphinx.addnodes”Œdocument”“”)”}”(Œ rawsource”Œ”Œchildren”]”(Œ translations”Œ LanguagesNode”“”)”}”(hhh]”(hŒ pending_xref”“”)”}”(hhh]”Œdocutils.nodes”ŒText”“”ŒChinese (Simplified)”…””}”Œparent”hsbaŒ attributes”}”(Œids”]”Œclasses”]”Œnames”]”Œdupnames”]”Œbackrefs”]”Œ refdomain”Œstd”Œreftype”Œdoc”Œ reftarget”Œ(/translations/zh_CN/driver-api/switchtec”Œmodname”NŒ classname”NŒ refexplicit”ˆuŒtagname”hhh ubh)”}”(hhh]”hŒChinese (Traditional)”…””}”hh2sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ(/translations/zh_TW/driver-api/switchtec”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒItalian”…””}”hhFsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ(/translations/it_IT/driver-api/switchtec”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒJapanese”…””}”hhZsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ(/translations/ja_JP/driver-api/switchtec”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒKorean”…””}”hhnsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ(/translations/ko_KR/driver-api/switchtec”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒSpanish”…””}”hh‚sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ(/translations/sp_SP/driver-api/switchtec”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubeh}”(h]”h ]”h"]”h$]”h&]”Œcurrent_language”ŒEnglish”uh1h hhŒ _document”hŒsource”NŒline”NubhŒsection”“”)”}”(hhh]”(hŒtitle”“”)”}”(hŒLinux Switchtec Support”h]”hŒLinux Switchtec Support”…””}”(hh¨hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h¦hh£hžhhŸŒB/var/lib/git/docbuild/linux/Documentation/driver-api/switchtec.rst”h KubhŒ paragraph”“”)”}”(hŒúMicrosemi's "Switchtec" line of PCI switch devices is already supported by the kernel with standard PCI switch drivers. However, the Switchtec device advertises a special management endpoint which enables some additional functionality. This includes:”h]”hXMicrosemi’s “Switchtec†line of PCI switch devices is already supported by the kernel with standard PCI switch drivers. However, the Switchtec device advertises a special management endpoint which enables some additional functionality. This includes:”…””}”(hh¹hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h·hŸh¶h Khh£hžhubhŒ bullet_list”“”)”}”(hhh]”(hŒ list_item”“”)”}”(hŒPacket and Byte Counters”h]”h¸)”}”(hhÐh]”hŒPacket and Byte Counters”…””}”(hhÒhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h·hŸh¶h K hhÎubah}”(h]”h ]”h"]”h$]”h&]”uh1hÌhhÉhžhhŸh¶h NubhÍ)”}”(hŒFirmware Upgrades”h]”h¸)”}”(hhçh]”hŒFirmware Upgrades”…””}”(hhéhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h·hŸh¶h K hhåubah}”(h]”h ]”h"]”h$]”h&]”uh1hÌhhÉhžhhŸh¶h NubhÍ)”}”(hŒEvent and Error logs”h]”h¸)”}”(hhþh]”hŒEvent and Error logs”…””}”(hjhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h·hŸh¶h K hhüubah}”(h]”h ]”h"]”h$]”h&]”uh1hÌhhÉhžhhŸh¶h NubhÍ)”}”(hŒQuerying port link status”h]”h¸)”}”(hjh]”hŒQuerying port link status”…””}”(hjhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h·hŸh¶h K hjubah}”(h]”h ]”h"]”h$]”h&]”uh1hÌhhÉhžhhŸh¶h NubhÍ)”}”(hŒCustom user firmware commands ”h]”h¸)”}”(hŒCustom user firmware commands”h]”hŒCustom user firmware commands”…””}”(hj.hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h·hŸh¶h Khj*ubah}”(h]”h ]”h"]”h$]”h&]”uh1hÌhhÉhžhhŸh¶h Nubeh}”(h]”h ]”h"]”h$]”h&]”Œbullet”Œ*”uh1hÇhŸh¶h K hh£hžhubh¸)”}”(hŒ:The switchtec kernel module implements this functionality.”h]”hŒ:The switchtec kernel module implements this functionality.”…””}”(hjJhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h·hŸh¶h Khh£hžhubh¢)”}”(hhh]”(h§)”}”(hŒ Interface”h]”hŒ Interface”…””}”(hj[hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h¦hjXhžhhŸh¶h Kubh¸)”}”(hX”The primary means of communicating with the Switchtec management firmware is through the Memory-mapped Remote Procedure Call (MRPC) interface. Commands are submitted to the interface with a 4-byte command identifier and up to 1KB of command specific data. The firmware will respond with a 4-byte return code and up to 1KB of command-specific data. The interface only processes a single command at a time.”h]”hX”The primary means of communicating with the Switchtec management firmware is through the Memory-mapped Remote Procedure Call (MRPC) interface. Commands are submitted to the interface with a 4-byte command identifier and up to 1KB of command specific data. The firmware will respond with a 4-byte return code and up to 1KB of command-specific data. The interface only processes a single command at a time.”…””}”(hjihžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h·hŸh¶h KhjXhžhubeh}”(h]”Œ interface”ah ]”h"]”Œ interface”ah$]”h&]”uh1h¡hh£hžhhŸh¶h Kubh¢)”}”(hhh]”(h§)”}”(hŒUserspace Interface”h]”hŒUserspace Interface”…””}”(hj‚hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h¦hjhžhhŸh¶h Kubh¸)”}”(hŒŽThe MRPC interface will be exposed to userspace through a simple char device: /dev/switchtec#, one for each management endpoint in the system.”h]”hŒŽThe MRPC interface will be exposed to userspace through a simple char device: /dev/switchtec#, one for each management endpoint in the system.”…””}”(hjhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h·hŸh¶h K!hjhžhubh¸)”}”(hŒ,The char device has the following semantics:”h]”hŒ,The char device has the following semantics:”…””}”(hjžhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h·hŸh¶h K$hjhžhubhÈ)”}”(hhh]”(hÍ)”}”(hŒóA write must consist of at least 4 bytes and no more than 1028 bytes. The first 4 bytes will be interpreted as the Command ID and the remainder will be used as the input data. A write will send the command to the firmware to begin processing. ”h]”h¸)”}”(hŒòA write must consist of at least 4 bytes and no more than 1028 bytes. The first 4 bytes will be interpreted as the Command ID and the remainder will be used as the input data. A write will send the command to the firmware to begin processing.”h]”hŒòA write must consist of at least 4 bytes and no more than 1028 bytes. The first 4 bytes will be interpreted as the Command ID and the remainder will be used as the input data. A write will send the command to the firmware to begin processing.”…””}”(hj³hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h·hŸh¶h K&hj¯ubah}”(h]”h ]”h"]”h$]”h&]”uh1hÌhj¬hžhhŸh¶h NubhÍ)”}”(hŒ˜Each write must be followed by exactly one read. Any double write will produce an error and any read that doesn't follow a write will produce an error. ”h]”h¸)”}”(hŒ—Each write must be followed by exactly one read. Any double write will produce an error and any read that doesn't follow a write will produce an error.”h]”hŒ™Each write must be followed by exactly one read. Any double write will produce an error and any read that doesn’t follow a write will produce an error.”…””}”(hjËhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h·hŸh¶h K+hjÇubah}”(h]”h ]”h"]”h$]”h&]”uh1hÌhj¬hžhhŸh¶h NubhÍ)”}”(hXA read will block until the firmware completes the command and return the 4-byte Command Return Value plus up to 1024 bytes of output data. (The length will be specified by the size parameter of the read call -- reading less than 4 bytes will produce an error.) ”h]”h¸)”}”(hXA read will block until the firmware completes the command and return the 4-byte Command Return Value plus up to 1024 bytes of output data. (The length will be specified by the size parameter of the read call -- reading less than 4 bytes will produce an error.)”h]”hXA read will block until the firmware completes the command and return the 4-byte Command Return Value plus up to 1024 bytes of output data. (The length will be specified by the size parameter of the read call -- reading less than 4 bytes will produce an error.)”…””}”(hjãhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h·hŸh¶h K/hjßubah}”(h]”h ]”h"]”h$]”h&]”uh1hÌhj¬hžhhŸh¶h NubhÍ)”}”(hŒˆThe poll call will also be supported for userspace applications that need to do other things while waiting for the command to complete. ”h]”h¸)”}”(hŒ‡The poll call will also be supported for userspace applications that need to do other things while waiting for the command to complete.”h]”hŒ‡The poll call will also be supported for userspace applications that need to do other things while waiting for the command to complete.”…””}”(hjûhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h·hŸh¶h K4hj÷ubah}”(h]”h ]”h"]”h$]”h&]”uh1hÌhj¬hžhhŸh¶h Nubeh}”(h]”h ]”h"]”h$]”h&]”jHjIuh1hÇhŸh¶h K&hjhžhubh¸)”}”(hŒ6The following IOCTLs are also supported by the device:”h]”hŒ6The following IOCTLs are also supported by the device:”…””}”(hjhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h·hŸh¶h K7hjhžhubhÈ)”}”(hhh]”(hÍ)”}”(hŒ^SWITCHTEC_IOCTL_FLASH_INFO - Retrieve firmware length and number of partitions in the device. ”h]”h¸)”}”(hŒ]SWITCHTEC_IOCTL_FLASH_INFO - Retrieve firmware length and number of partitions in the device.”h]”hŒ]SWITCHTEC_IOCTL_FLASH_INFO - Retrieve firmware length and number of partitions in the device.”…””}”(hj*hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h·hŸh¶h K9hj&ubah}”(h]”h ]”h"]”h$]”h&]”uh1hÌhj#hžhhŸh¶h NubhÍ)”}”(hŒeSWITCHTEC_IOCTL_FLASH_PART_INFO - Retrieve address and lengeth for any specified partition in flash. ”h]”h¸)”}”(hŒdSWITCHTEC_IOCTL_FLASH_PART_INFO - Retrieve address and lengeth for any specified partition in flash.”h]”hŒdSWITCHTEC_IOCTL_FLASH_PART_INFO - Retrieve address and lengeth for any specified partition in flash.”…””}”(hjBhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h·hŸh¶h Kubah}”(h]”h ]”h"]”h$]”h&]”uh1hÌhj#hžhhŸh¶h NubhÍ)”}”(hŒ]SWITCHTEC_IOCTL_EVENT_SUMMARY - Read a structure of bitmaps indicating all uncleared events. ”h]”h¸)”}”(hŒ\SWITCHTEC_IOCTL_EVENT_SUMMARY - Read a structure of bitmaps indicating all uncleared events.”h]”hŒ\SWITCHTEC_IOCTL_EVENT_SUMMARY - Read a structure of bitmaps indicating all uncleared events.”…””}”(hjZhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h·hŸh¶h K?hjVubah}”(h]”h ]”h"]”h$]”h&]”uh1hÌhj#hžhhŸh¶h NubhÍ)”}”(hXkSWITCHTEC_IOCTL_EVENT_CTL - Get the current count, clear and set flags for any event. This ioctl takes in a switchtec_ioctl_event_ctl struct with the event_id, index and flags set (index being the partition or PFF number for non-global events). It returns whether the event has occurred, the number of times and any event specific data. The flags can be used to clear the count or enable and disable actions to happen when the event occurs. By using the SWITCHTEC_IOCTL_EVENT_FLAG_EN_POLL flag, you can set an event to trigger a poll command to return with POLLPRI. In this way, userspace can wait for events to occur. ”h]”h¸)”}”(hXjSWITCHTEC_IOCTL_EVENT_CTL - Get the current count, clear and set flags for any event. This ioctl takes in a switchtec_ioctl_event_ctl struct with the event_id, index and flags set (index being the partition or PFF number for non-global events). It returns whether the event has occurred, the number of times and any event specific data. The flags can be used to clear the count or enable and disable actions to happen when the event occurs. By using the SWITCHTEC_IOCTL_EVENT_FLAG_EN_POLL flag, you can set an event to trigger a poll command to return with POLLPRI. In this way, userspace can wait for events to occur.”h]”hXjSWITCHTEC_IOCTL_EVENT_CTL - Get the current count, clear and set flags for any event. This ioctl takes in a switchtec_ioctl_event_ctl struct with the event_id, index and flags set (index being the partition or PFF number for non-global events). It returns whether the event has occurred, the number of times and any event specific data. The flags can be used to clear the count or enable and disable actions to happen when the event occurs. By using the SWITCHTEC_IOCTL_EVENT_FLAG_EN_POLL flag, you can set an event to trigger a poll command to return with POLLPRI. In this way, userspace can wait for events to occur.”…””}”(hjrhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h·hŸh¶h KBhjnubah}”(h]”h ]”h"]”h$]”h&]”uh1hÌhj#hžhhŸh¶h NubhÍ)”}”(hŒÖSWITCHTEC_IOCTL_PFF_TO_PORT and SWITCHTEC_IOCTL_PORT_TO_PFF convert between PCI Function Framework number (used by the event system) and Switchtec Logic Port ID and Partition number (which is more user friendly). ”h]”h¸)”}”(hŒÔSWITCHTEC_IOCTL_PFF_TO_PORT and SWITCHTEC_IOCTL_PORT_TO_PFF convert between PCI Function Framework number (used by the event system) and Switchtec Logic Port ID and Partition number (which is more user friendly).”h]”hŒÔSWITCHTEC_IOCTL_PFF_TO_PORT and SWITCHTEC_IOCTL_PORT_TO_PFF convert between PCI Function Framework number (used by the event system) and Switchtec Logic Port ID and Partition number (which is more user friendly).”…””}”(hjŠhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h·hŸh¶h KMhj†ubah}”(h]”h ]”h"]”h$]”h&]”uh1hÌhj#hžhhŸh¶h Nubeh}”(h]”h ]”h"]”h$]”h&]”jHjIuh1hÇhŸh¶h K9hjhžhubeh}”(h]”Œuserspace-interface”ah ]”h"]”Œuserspace interface”ah$]”h&]”uh1h¡hh£hžhhŸh¶h Kubh¢)”}”(hhh]”(h§)”}”(hŒ#Non-Transparent Bridge (NTB) Driver”h]”hŒ#Non-Transparent Bridge (NTB) Driver”…””}”(hj¯hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h¦hj¬hžhhŸh¶h KTubh¸)”}”(hŒúAn NTB hardware driver is provided for the Switchtec hardware in ntb_hw_switchtec. Currently, it only supports switches configured with exactly 2 NT partitions and zero or more non-NT partitions. It also requires the following configuration settings:”h]”hŒúAn NTB hardware driver is provided for the Switchtec hardware in ntb_hw_switchtec. Currently, it only supports switches configured with exactly 2 NT partitions and zero or more non-NT partitions. It also requires the following configuration settings:”…””}”(hj½hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h·hŸh¶h KVhj¬hžhubhÈ)”}”(hhh]”(hÍ)”}”(hŒ¡Both NT partitions must be able to access each other's GAS spaces. Thus, the bits in the GAS Access Vector under Management Settings must be set to support this.”h]”h¸)”}”(hŒ¡Both NT partitions must be able to access each other's GAS spaces. Thus, the bits in the GAS Access Vector under Management Settings must be set to support this.”h]”hŒ£Both NT partitions must be able to access each other’s GAS spaces. Thus, the bits in the GAS Access Vector under Management Settings must be set to support this.”…””}”(hjÒhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h·hŸh¶h K[hjÎubah}”(h]”h ]”h"]”h$]”h&]”uh1hÌhjËhžhhŸh¶h NubhÍ)”}”(hŒOKernel configuration MUST include support for NTB (CONFIG_NTB needs to be set) ”h]”h¸)”}”(hŒNKernel configuration MUST include support for NTB (CONFIG_NTB needs to be set)”h]”hŒNKernel configuration MUST include support for NTB (CONFIG_NTB needs to be set)”…””}”(hjêhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h·hŸh¶h K^hjæubah}”(h]”h ]”h"]”h$]”h&]”uh1hÌhjËhžhhŸh¶h Nubeh}”(h]”h ]”h"]”h$]”h&]”jHjIuh1hÇhŸh¶h K[hj¬hžhubh¸)”}”(hŒƒNT EP BAR 2 will be dynamically configured as a Direct Window, and the configuration file does not need to configure it explicitly.”h]”hŒƒNT EP BAR 2 will be dynamically configured as a Direct Window, and the configuration file does not need to configure it explicitly.”…””}”(hjhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h·hŸh¶h Kahj¬hžhubh¸)”}”(hŒºPlease refer to Documentation/driver-api/ntb.rst in Linux source tree for an overall understanding of the Linux NTB stack. ntb_hw_switchtec works as an NTB Hardware Driver in this stack.”h]”hŒºPlease refer to Documentation/driver-api/ntb.rst in Linux source tree for an overall understanding of the Linux NTB stack. ntb_hw_switchtec works as an NTB Hardware Driver in this stack.”…””}”(hjhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h·hŸh¶h Kdhj¬hžhubeh}”(h]”Œ!non-transparent-bridge-ntb-driver”ah ]”h"]”Œ#non-transparent bridge (ntb) driver”ah$]”h&]”uh1h¡hh£hžhhŸh¶h KTubeh}”(h]”Œlinux-switchtec-support”ah ]”h"]”Œlinux switchtec support”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”jSŒ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Œfile_insertion_enabled”ˆŒ raw_enabled”KŒline_length_limit”M'Œ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”‰Œ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”‰Œenv”NubŒreporter”NŒindirect_targets”]”Œsubstitution_defs”}”Œsubstitution_names”}”Œrefnames”}”Œrefids”}”Œnameids”}”(j-j*j|jyj©j¦j%j"uŒ nametypes”}”(j-‰j|‰j©‰j%‰uh}”(j*h£jyjXj¦jj"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.