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/driver-api/soundwire/bramodnameN classnameN refexplicitutagnamehhh ubh)}(hhh]hChinese (Traditional)}hh2sbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget,/translations/zh_TW/driver-api/soundwire/bramodnameN classnameN refexplicituh1hhh ubh)}(hhh]hItalian}hhFsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget,/translations/it_IT/driver-api/soundwire/bramodnameN classnameN refexplicituh1hhh ubh)}(hhh]hJapanese}hhZsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget,/translations/ja_JP/driver-api/soundwire/bramodnameN classnameN refexplicituh1hhh ubh)}(hhh]hKorean}hhnsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget,/translations/ko_KR/driver-api/soundwire/bramodnameN classnameN refexplicituh1hhh ubh)}(hhh]hSpanish}hhsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget,/translations/sp_SP/driver-api/soundwire/bramodnameN classnameN refexplicituh1hhh ubeh}(h]h ]h"]h$]h&]current_languageEnglishuh1h hh _documenthsourceNlineNubhsection)}(hhh](htitle)}(hBulk Register Access (BRA)h]hBulk Register Access (BRA)}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhhhF/var/lib/git/docbuild/linux/Documentation/driver-api/soundwire/bra.rsthKubh)}(hhh](h)}(h Conventionsh]h Conventions}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhhhhhKubh paragraph)}(hvCapitalized words used in this documentation are intentional and refer to concepts of the SoundWire 1.x specification.h]hvCapitalized words used in this documentation are intentional and refer to concepts of the SoundWire 1.x specification.}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhhhhubeh}(h] conventionsah ]h"] conventionsah$]h&]uh1hhhhhhhhKubh)}(hhh](h)}(h Introductionh]h Introduction}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhhhhhK ubh)}(hThe SoundWire 1.x specification provides a mechanism to speed-up command/control transfers by reclaiming parts of the audio bandwidth. The Bulk Register Access (BRA) protocol is a standard solution based on the Bulk Payload Transport (BPT) definitions.h]hThe SoundWire 1.x specification provides a mechanism to speed-up command/control transfers by reclaiming parts of the audio bandwidth. The Bulk Register Access (BRA) protocol is a standard solution based on the Bulk Payload Transport (BPT) definitions.}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhhhhubh)}(hThe regular control channel uses Column 0 and can only send/retrieve one byte per frame with write/read commands. With a typical 48kHz frame rate, only 48kB/s can be transferred.h]hThe regular control channel uses Column 0 and can only send/retrieve one byte per frame with write/read commands. With a typical 48kHz frame rate, only 48kB/s can be transferred.}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhhhhubh)}(hThe optional Bulk Register Access capability can transmit up to 12 Mbits/s and reduce transfer times by several orders of magnitude, but has multiple design constraints:h]hThe optional Bulk Register Access capability can transmit up to 12 Mbits/s and reduce transfer times by several orders of magnitude, but has multiple design constraints:}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhhhhubh block_quote)}(hX (1) Each frame can only support a read or a write transfer, with a 10-byte overhead per frame (header and footer response). (2) The read/writes SHALL be from/to contiguous register addresses in the same frame. A fragmented register space decreases the efficiency of the protocol by requiring multiple BRA transfers scheduled in different frames. (3) The targeted Peripheral device SHALL support the optional Data Port 0, and likewise the Manager SHALL expose audio-like Ports to insert BRA packets in the audio payload using the concepts of Sample Interval, HSTART, HSTOP, etc. (4) The BRA transport efficiency depends on the available bandwidth. If there are no on-going audio transfers, the entire frame minus Column 0 can be reclaimed for BRA. The frame shape also impacts efficiency: since Column0 cannot be used for BTP/BRA, the frame should rely on a large number of columns and minimize the number of rows. The bus clock should be as high as possible. (5) The number of bits transferred per frame SHALL be a multiple of 8 bits. Padding bits SHALL be inserted if necessary at the end of the data. (6) The regular read/write commands can be issued in parallel with BRA transfers. This is convenient to e.g. deal with alerts, jack detection or change the volume during firmware download, but accessing the same address with two independent protocols has to be avoided to avoid undefined behavior. (7) Some implementations may not be capable of handling the bandwidth of the BRA protocol, e.g. in the case of a slow I2C bus behind the SoundWire IP. In this case, the transfers may need to be spaced in time or flow-controlled. (8) Each BRA packet SHALL be marked as 'Active' when valid data is to be transmitted. This allows for software to allocate a BRA stream but not transmit/discard data while processing the results or preparing the next batch of data, or allowing the peripheral to deal with the previous transfer. In addition BRA transfer can be started early on without data being ready. (9) Up to 470 bytes may be transmitted per frame. (10) The address is represented with 32 bits and does not rely on the paging registers used for the regular command/control protocol in Column 0. h]henumerated_list)}(hhh](h list_item)}(hxEach frame can only support a read or a write transfer, with a 10-byte overhead per frame (header and footer response). h]h)}(hwEach frame can only support a read or a write transfer, with a 10-byte overhead per frame (header and footer response).h]hwEach frame can only support a read or a write transfer, with a 10-byte overhead per frame (header and footer response).}(hj,hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj(ubah}(h]h ]h"]h$]h&]uh1j&hj#ubj')}(hThe read/writes SHALL be from/to contiguous register addresses in the same frame. A fragmented register space decreases the efficiency of the protocol by requiring multiple BRA transfers scheduled in different frames. h]h)}(hThe read/writes SHALL be from/to contiguous register addresses in the same frame. A fragmented register space decreases the efficiency of the protocol by requiring multiple BRA transfers scheduled in different frames.h]hThe read/writes SHALL be from/to contiguous register addresses in the same frame. A fragmented register space decreases the efficiency of the protocol by requiring multiple BRA transfers scheduled in different frames.}(hjDhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj@ubah}(h]h ]h"]h$]h&]uh1j&hj#ubj')}(hThe targeted Peripheral device SHALL support the optional Data Port 0, and likewise the Manager SHALL expose audio-like Ports to insert BRA packets in the audio payload using the concepts of Sample Interval, HSTART, HSTOP, etc. h]h)}(hThe targeted Peripheral device SHALL support the optional Data Port 0, and likewise the Manager SHALL expose audio-like Ports to insert BRA packets in the audio payload using the concepts of Sample Interval, HSTART, HSTOP, etc.h]hThe targeted Peripheral device SHALL support the optional Data Port 0, and likewise the Manager SHALL expose audio-like Ports to insert BRA packets in the audio payload using the concepts of Sample Interval, HSTART, HSTOP, etc.}(hj\hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK#hjXubah}(h]h ]h"]h$]h&]uh1j&hj#ubj')}(hXyThe BRA transport efficiency depends on the available bandwidth. If there are no on-going audio transfers, the entire frame minus Column 0 can be reclaimed for BRA. The frame shape also impacts efficiency: since Column0 cannot be used for BTP/BRA, the frame should rely on a large number of columns and minimize the number of rows. The bus clock should be as high as possible. h]h)}(hXxThe BRA transport efficiency depends on the available bandwidth. If there are no on-going audio transfers, the entire frame minus Column 0 can be reclaimed for BRA. The frame shape also impacts efficiency: since Column0 cannot be used for BTP/BRA, the frame should rely on a large number of columns and minimize the number of rows. The bus clock should be as high as possible.h]hXxThe BRA transport efficiency depends on the available bandwidth. If there are no on-going audio transfers, the entire frame minus Column 0 can be reclaimed for BRA. The frame shape also impacts efficiency: since Column0 cannot be used for BTP/BRA, the frame should rely on a large number of columns and minimize the number of rows. The bus clock should be as high as possible.}(hjthhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK(hjpubah}(h]h ]h"]h$]h&]uh1j&hj#ubj')}(hThe number of bits transferred per frame SHALL be a multiple of 8 bits. Padding bits SHALL be inserted if necessary at the end of the data. h]h)}(hThe number of bits transferred per frame SHALL be a multiple of 8 bits. Padding bits SHALL be inserted if necessary at the end of the data.h]hThe number of bits transferred per frame SHALL be a multiple of 8 bits. Padding bits SHALL be inserted if necessary at the end of the data.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK0hjubah}(h]h ]h"]h$]h&]uh1j&hj#ubj')}(hX&The regular read/write commands can be issued in parallel with BRA transfers. This is convenient to e.g. deal with alerts, jack detection or change the volume during firmware download, but accessing the same address with two independent protocols has to be avoided to avoid undefined behavior. h]h)}(hX%The regular read/write commands can be issued in parallel with BRA transfers. This is convenient to e.g. deal with alerts, jack detection or change the volume during firmware download, but accessing the same address with two independent protocols has to be avoided to avoid undefined behavior.h]hX%The regular read/write commands can be issued in parallel with BRA transfers. This is convenient to e.g. deal with alerts, jack detection or change the volume during firmware download, but accessing the same address with two independent protocols has to be avoided to avoid undefined behavior.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK4hjubah}(h]h ]h"]h$]h&]uh1j&hj#ubj')}(hSome implementations may not be capable of handling the bandwidth of the BRA protocol, e.g. in the case of a slow I2C bus behind the SoundWire IP. In this case, the transfers may need to be spaced in time or flow-controlled. h]h)}(hSome implementations may not be capable of handling the bandwidth of the BRA protocol, e.g. in the case of a slow I2C bus behind the SoundWire IP. In this case, the transfers may need to be spaced in time or flow-controlled.h]hSome implementations may not be capable of handling the bandwidth of the BRA protocol, e.g. in the case of a slow I2C bus behind the SoundWire IP. In this case, the transfers may need to be spaced in time or flow-controlled.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK:hjubah}(h]h ]h"]h$]h&]uh1j&hj#ubj')}(hXnEach BRA packet SHALL be marked as 'Active' when valid data is to be transmitted. This allows for software to allocate a BRA stream but not transmit/discard data while processing the results or preparing the next batch of data, or allowing the peripheral to deal with the previous transfer. In addition BRA transfer can be started early on without data being ready. h]h)}(hXmEach BRA packet SHALL be marked as 'Active' when valid data is to be transmitted. This allows for software to allocate a BRA stream but not transmit/discard data while processing the results or preparing the next batch of data, or allowing the peripheral to deal with the previous transfer. In addition BRA transfer can be started early on without data being ready.h]hXqEach BRA packet SHALL be marked as ‘Active’ when valid data is to be transmitted. This allows for software to allocate a BRA stream but not transmit/discard data while processing the results or preparing the next batch of data, or allowing the peripheral to deal with the previous transfer. In addition BRA transfer can be started early on without data being ready.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK?hjubah}(h]h ]h"]h$]h&]uh1j&hj#ubj')}(h.Up to 470 bytes may be transmitted per frame. h]h)}(h-Up to 470 bytes may be transmitted per frame.h]h-Up to 470 bytes may be transmitted per frame.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKFhjubah}(h]h ]h"]h$]h&]uh1j&hj#ubj')}(hThe address is represented with 32 bits and does not rely on the paging registers used for the regular command/control protocol in Column 0. h]h)}(hThe address is represented with 32 bits and does not rely on the paging registers used for the regular command/control protocol in Column 0.h]hThe address is represented with 32 bits and does not rely on the paging registers used for the regular command/control protocol in Column 0.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKHhjubah}(h]h ]h"]h$]h&]uh1j&hj#ubeh}(h]h ]h"]h$]h&]enumtypearabicprefix(suffix)uh1j!hjubah}(h]h ]h"]h$]h&]uh1jhhhKhhhhubeh}(h] introductionah ]h"] introductionah$]h&]uh1hhhhhhhhK ubh)}(hhh](h)}(hError checkingh]hError checking}(hj5hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj2hhhhhKNubh)}(hFirmware download is one of the key usages of the Bulk Register Access protocol. To make sure the binary data integrity is not compromised by transmission or programming errors, each BRA packet provides:h]hFirmware download is one of the key usages of the Bulk Register Access protocol. To make sure the binary data integrity is not compromised by transmission or programming errors, each BRA packet provides:}(hjChhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKPhj2hhubj)}(hX`(1) A CRC on the 7-byte header. This CRC helps the Peripheral Device check if it is addressed and set the start address and number of bytes. The Peripheral Device provides a response in Byte 7. (2) A CRC on the data block (header excluded). This CRC is transmitted as the last-but-one byte in the packet, prior to the footer response. h]j")}(hhh](j')}(hA CRC on the 7-byte header. This CRC helps the Peripheral Device check if it is addressed and set the start address and number of bytes. The Peripheral Device provides a response in Byte 7. h]h)}(hA CRC on the 7-byte header. This CRC helps the Peripheral Device check if it is addressed and set the start address and number of bytes. The Peripheral Device provides a response in Byte 7.h]hA CRC on the 7-byte header. This CRC helps the Peripheral Device check if it is addressed and set the start address and number of bytes. The Peripheral Device provides a response in Byte 7.}(hj\hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKThjXubah}(h]h ]h"]h$]h&]uh1j&hjUubj')}(hA CRC on the data block (header excluded). This CRC is transmitted as the last-but-one byte in the packet, prior to the footer response. h]h)}(hA CRC on the data block (header excluded). This CRC is transmitted as the last-but-one byte in the packet, prior to the footer response.h]hA CRC on the data block (header excluded). This CRC is transmitted as the last-but-one byte in the packet, prior to the footer response.}(hjthhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKXhjpubah}(h]h ]h"]h$]h&]uh1j&hjUubeh}(h]h ]h"]h$]h&]jjj j!j"j#uh1j!hjQubah}(h]h ]h"]h$]h&]uh1jhhhKThj2hhubhdefinition_list)}(hhh](hdefinition_list_item)}(hAThe header response can be one of: (a) Ack (b) Nak (c) Not Ready h](hterm)}(h"The header response can be one of:h]h"The header response can be one of:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhK_hjubh definition)}(hhh]j")}(hhh](j')}(hAckh]h)}(hjh]hAck}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK]hjubah}(h]h ]h"]h$]h&]uh1j&hjubj')}(hNakh]h)}(hjh]hNak}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK^hjubah}(h]h ]h"]h$]h&]uh1j&hjubj')}(h Not Ready h]h)}(h Not Readyh]h Not Ready}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK_hjubah}(h]h ]h"]h$]h&]uh1j&hjubeh}(h]h ]h"]h$]h&]j loweralphaj j!j"j#uh1j!hjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhhhK_hjubj)}(h}The footer response can be one of: (1) Ack (2) Nak (CRC failure) (3) Good (operation completed) (4) Bad (operation failed) h](j)}(h"The footer response can be one of:h]h"The footer response can be one of:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhKehjubj)}(hhh]j")}(hhh](j')}(hAckh]h)}(hj*h]hAck}(hj,hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKbhj(ubah}(h]h ]h"]h$]h&]uh1j&hj%ubj')}(hNak (CRC failure)h]h)}(hjAh]hNak (CRC failure)}(hjChhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKchj?ubah}(h]h ]h"]h$]h&]uh1j&hj%ubj')}(hGood (operation completed)h]h)}(hjXh]hGood (operation completed)}(hjZhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKdhjVubah}(h]h ]h"]h$]h&]uh1j&hj%ubj')}(hBad (operation failed) h]h)}(hBad (operation failed)h]hBad (operation failed)}(hjqhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKehjmubah}(h]h ]h"]h$]h&]uh1j&hj%ubeh}(h]h ]h"]h$]h&]jjj j!j"j#uh1j!hj"ubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhhhKehjhhubeh}(h]h ]h"]h$]h&]uh1jhj2hhhNhNubeh}(h]error-checkingah ]h"]error checkingah$]h&]uh1hhhhhhhhKNubh)}(hhh](h)}(h Example frameh]h Example frame}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhKhubh)}(hThe example below is not to scale and makes simplifying assumptions for clarity. The different chunks in the BRA packets are not required to start on a new SoundWire Row, and the scale of data may vary.h]hThe example below is not to scale and makes simplifying assumptions for clarity. The different chunks in the BRA packets are not required to start on a new SoundWire Row, and the scale of data may vary.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKjhjhhubj)}(hX):: +---+--------------------------------------------+ + | | + | BRA HEADER | + | | + +--------------------------------------------+ + C | HEADER CRC | + O +--------------------------------------------+ + M | HEADER RESPONSE | + M +--------------------------------------------+ + A | | + N | | + D | DATA | + | | + | | + | | + +--------------------------------------------+ + | DATA CRC | + +--------------------------------------------+ + | FOOTER RESPONSE | +---+--------------------------------------------+ h]h literal_block)}(hX+---+--------------------------------------------+ + | | + | BRA HEADER | + | | + +--------------------------------------------+ + C | HEADER CRC | + O +--------------------------------------------+ + M | HEADER RESPONSE | + M +--------------------------------------------+ + A | | + N | | + D | DATA | + | | + | | + | | + +--------------------------------------------+ + | DATA CRC | + +--------------------------------------------+ + | FOOTER RESPONSE | +---+--------------------------------------------+h]hX+---+--------------------------------------------+ + | | + | BRA HEADER | + | | + +--------------------------------------------+ + C | HEADER CRC | + O +--------------------------------------------+ + M | HEADER RESPONSE | + M +--------------------------------------------+ + A | | + N | | + D | DATA | + | | + | | + | | + +--------------------------------------------+ + | DATA CRC | + +--------------------------------------------+ + | FOOTER RESPONSE | +---+--------------------------------------------+}hjsbah}(h]h ]h"]h$]h&] xml:spacepreserveuh1jhhhKphjubah}(h]h ]h"]h$]h&]uh1jhhhKnhjhhubh)}(hsAssuming the frame uses N columns, the configuration shown above can be programmed by setting the DP0 registers as:h]hsAssuming the frame uses N columns, the configuration shown above can be programmed by setting the DP0 registers as:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubj)}(hJ- HSTART = 1 - HSTOP = N - 1 - Sampling Interval = N - WordLength = N - 1 h]h bullet_list)}(hhh](j')}(h HSTART = 1h]h)}(hjh]h HSTART = 1}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1j&hjubj')}(h HSTOP = N - 1h]h)}(hjh]h HSTOP = N - 1}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1j&hjubj')}(hSampling Interval = Nh]h)}(hj'h]hSampling Interval = N}(hj)hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj%ubah}(h]h ]h"]h$]h&]uh1j&hjubj')}(hWordLength = N - 1 h]h)}(hWordLength = N - 1h]hWordLength = N - 1}(hj@hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj<ubah}(h]h ]h"]h$]h&]uh1j&hjubeh}(h]h ]h"]h$]h&]bullet-uh1jhhhKhjubah}(h]h ]h"]h$]h&]uh1jhhhKhjhhubeh}(h] example-frameah ]h"] example frameah$]h&]uh1hhhhhhhhKhubh)}(hhh](h)}(hAddressing restrictionsh]hAddressing restrictions}(hjmhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjjhhhhhKubh)}(hXThe Device Number specified in the Header follows the SoundWire definitions, and broadcast and group addressing are permitted. For now the Linux implementation only allows for a single BPT transfer to a single device at a time. This might be revisited at a later point as an optimization to send the same firmware to multiple devices, but this would only be beneficial for single-link solutions.h]hXThe Device Number specified in the Header follows the SoundWire definitions, and broadcast and group addressing are permitted. For now the Linux implementation only allows for a single BPT transfer to a single device at a time. This might be revisited at a later point as an optimization to send the same firmware to multiple devices, but this would only be beneficial for single-link solutions.}(hj{hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjjhhubh)}(hXIn the case of multiple Peripheral devices attached to different Managers, the broadcast and group addressing is not supported by the SoundWire specification. Each device must be handled with separate BRA streams, possibly in parallel - the links are really independent.h]hXIn the case of multiple Peripheral devices attached to different Managers, the broadcast and group addressing is not supported by the SoundWire specification. Each device must be handled with separate BRA streams, possibly in parallel - the links are really independent.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjjhhubeh}(h]addressing-restrictionsah ]h"]addressing restrictionsah$]h&]uh1hhhhhhhhKubh)}(hhh](h)}(hUnsupported featuresh]hUnsupported features}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhKubh)}(hThe Bulk Register Access specification provides a number of capabilities that are not supported in known implementations, such as:h]hThe Bulk Register Access specification provides a number of capabilities that are not supported in known implementations, such as:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubj)}(hX (1) Transfers initiated by a Peripheral Device. The BRA Initiator is always the Manager Device. (2) Flow-control capabilities and retransmission based on the 'NotReady' header response require extra buffering in the SoundWire IP and are not implemented. h]j")}(hhh](j')}(h\Transfers initiated by a Peripheral Device. The BRA Initiator is always the Manager Device. h]h)}(h[Transfers initiated by a Peripheral Device. The BRA Initiator is always the Manager Device.h]h[Transfers initiated by a Peripheral Device. The BRA Initiator is always the Manager Device.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1j&hjubj')}(hFlow-control capabilities and retransmission based on the 'NotReady' header response require extra buffering in the SoundWire IP and are not implemented. h]h)}(hFlow-control capabilities and retransmission based on the 'NotReady' header response require extra buffering in the SoundWire IP and are not implemented.h]hFlow-control capabilities and retransmission based on the ‘NotReady’ header response require extra buffering in the SoundWire IP and are not implemented.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1j&hjubeh}(h]h ]h"]h$]h&]jjj j!j"j#uh1j!hjubah}(h]h ]h"]h$]h&]uh1jhhhKhjhhubeh}(h]unsupported-featuresah ]h"]unsupported featuresah$]h&]uh1hhhhhhhhKubh)}(hhh](h)}(hBi-directional handlingh]hBi-directional handling}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj hhhhhKubh)}(hXfThe BRA protocol can handle writes as well as reads, and in each packet the header and footer response are provided by the Peripheral Target device. On the Peripheral device, the BRA protocol is handled by a single DP0 data port, and at the low-level the bus ownership can will change for header/footer response as well as the data transmitted during a read.h]hXfThe BRA protocol can handle writes as well as reads, and in each packet the header and footer response are provided by the Peripheral Target device. On the Peripheral device, the BRA protocol is handled by a single DP0 data port, and at the low-level the bus ownership can will change for header/footer response as well as the data transmitted during a read.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj hhubh)}(hXSOn the host side, most implementations rely on a Port-like concept, with two FIFOs consuming/generating data transfers in parallel (Host->Peripheral and Peripheral->Host). The amount of data consumed/produced by these FIFOs is not symmetrical, as a result hardware typically inserts markers to help software and hardware interpret raw datah]hXSOn the host side, most implementations rely on a Port-like concept, with two FIFOs consuming/generating data transfers in parallel (Host->Peripheral and Peripheral->Host). The amount of data consumed/produced by these FIFOs is not symmetrical, as a result hardware typically inserts markers to help software and hardware interpret raw data}(hj(hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj hhubh)}(h Each packet will typically have:h]h Each packet will typically have:}(hj6hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj hhubj)}(h(1) a 'Start of Packet' indicator. (2) an 'End of Packet' indicator. (3) a packet identifier to correlate the data requested and transmitted, and the error status for each frame h]j")}(hhh](j')}(ha 'Start of Packet' indicator. h]h)}(ha 'Start of Packet' indicator.h]h"a ‘Start of Packet’ indicator.}(hjOhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjKubah}(h]h ]h"]h$]h&]uh1j&hjHubj')}(han 'End of Packet' indicator. h]h)}(han 'End of Packet' indicator.h]h!an ‘End of Packet’ indicator.}(hjghhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjcubah}(h]h ]h"]h$]h&]uh1j&hjHubj')}(hia packet identifier to correlate the data requested and transmitted, and the error status for each frame h]h)}(hha packet identifier to correlate the data requested and transmitted, and the error status for each frameh]hha packet identifier to correlate the data requested and transmitted, and the error status for each frame}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj{ubah}(h]h ]h"]h$]h&]uh1j&hjHubeh}(h]h ]h"]h$]h&]jjj j!j"j#uh1j!hjDubah}(h]h ]h"]h$]h&]uh1jhhhKhj hhubh)}(hXCHardware implementations can check errors at the frame level, and retry a transfer in case of errors. However, as for the flow-control case, this requires extra buffering and intelligence in the hardware. The Linux support assumes that the entire transfer is cancelled if a single error is detected in one of the responses.h]hXCHardware implementations can check errors at the frame level, and retry a transfer in case of errors. However, as for the flow-control case, this requires extra buffering and intelligence in the hardware. The Linux support assumes that the entire transfer is cancelled if a single error is detected in one of the responses.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj hhubh)}(hhh](h)}(hAbstraction requiredh]hAbstraction required}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhKubh)}(hThere are no standard registers or mandatory implementation at the Manager level, so the low-level BPT/BRA details must be hidden in Manager-specific code. For example the Cadence IP format above is not known to the codec drivers.h]hThere are no standard registers or mandatory implementation at the Manager level, so the low-level BPT/BRA details must be hidden in Manager-specific code. For example the Cadence IP format above is not known to the codec drivers.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubh)}(hLikewise, codec drivers should not have to know the frame size. The computation of CRC and handling of responses is handled in helpers and Manager-specific code.h]hLikewise, codec drivers should not have to know the frame size. The computation of CRC and handling of responses is handled in helpers and Manager-specific code.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubh)}(hXThe host BRA driver may also have restrictions on pages allocated for DMA, or other host-DSP communication protocols. The codec driver should not be aware of any of these restrictions, since it might be reused in combination with different implementations of Manager IPs.h]hXThe host BRA driver may also have restrictions on pages allocated for DMA, or other host-DSP communication protocols. The codec driver should not be aware of any of these restrictions, since it might be reused in combination with different implementations of Manager IPs.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubeh}(h]abstraction-requiredah ]h"]abstraction requiredah$]h&]uh1hhj hhhhhKubh)}(hhh](h)}(h.Concurrency between BRA and regular read/writeh]h.Concurrency between BRA and regular read/write}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhKubh)}(hThe existing 'nread/nwrite' API already relies on a notion of start address and number of bytes, so it would be possible to extend this API with a 'hint' requesting BPT/BRA be used.h]hThe existing ‘nread/nwrite’ API already relies on a notion of start address and number of bytes, so it would be possible to extend this API with a ‘hint’ requesting BPT/BRA be used.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubh)}(hXHowever BRA transfers could be quite long, and the use of a single mutex for regular read/write and BRA is a show-stopper. Independent operation of the control/command and BRA transfers is a fundamental requirement, e.g. to change the volume level with the existing regmap interface while downloading firmware. The integration must however ensure that there are no concurrent access to the same address with the command/control protocol and the BRA protocol.h]hXHowever BRA transfers could be quite long, and the use of a single mutex for regular read/write and BRA is a show-stopper. Independent operation of the control/command and BRA transfers is a fundamental requirement, e.g. to change the volume level with the existing regmap interface while downloading firmware. The integration must however ensure that there are no concurrent access to the same address with the command/control protocol and the BRA protocol.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubh)}(hIn addition, the 'sdw_msg' structure hard-codes support for 16-bit addresses and paging registers which are irrelevant for BPT/BRA support based on native 32-bit addresses. A separate API with 'sdw_bpt_msg' makes more sense.h]hIn addition, the ‘sdw_msg’ structure hard-codes support for 16-bit addresses and paging registers which are irrelevant for BPT/BRA support based on native 32-bit addresses. A separate API with ‘sdw_bpt_msg’ makes more sense.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubh)}(hXOne possible strategy to speed-up all initialization tasks would be to start a BRA transfer for firmware download, then deal with all the "regular" read/writes in parallel with the command channel, and last to wait for the BRA transfers to complete. This would allow for a degree of overlap instead of a purely sequential solution. As such, the BRA API must support async transfers and expose a separate wait function.h]hXOne possible strategy to speed-up all initialization tasks would be to start a BRA transfer for firmware download, then deal with all the “regular” read/writes in parallel with the command channel, and last to wait for the BRA transfers to complete. This would allow for a degree of overlap instead of a purely sequential solution. As such, the BRA API must support async transfers and expose a separate wait function.}(hj+hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubeh}(h].concurrency-between-bra-and-regular-read-writeah ]h"].concurrency between bra and regular read/writeah$]h&]uh1hhj hhhhhKubeh}(h]bi-directional-handlingah ]h"]bi-directional handlingah$]h&]uh1hhhhhhhhKubh)}(hhh](h)}(hPeripheral/bus interfaceh]hPeripheral/bus interface}(hjLhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjIhhhhhKubh)}(h7The bus interface for BPT/BRA is made of two functions:h]h7The bus interface for BPT/BRA is made of two functions:}(hjZhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjIhhubj)}(hX  - sdw_bpt_send_async(bpt_message) This function sends the data using the Manager implementation-defined capabilities (typically DMA or IPC protocol). Queueing is currently not supported, the caller needs to wait for completion of the requested transfer. - sdw_bpt_wait() This function waits for the entire message provided by the codec driver in the 'send_async' stage. Intermediate status for smaller chunks will not be provided back to the codec driver, only a return code will be provided. h](j)}(hX - sdw_bpt_send_async(bpt_message) This function sends the data using the Manager implementation-defined capabilities (typically DMA or IPC protocol). Queueing is currently not supported, the caller needs to wait for completion of the requested transfer. h]j)}(hhh]j')}(hsdw_bpt_send_async(bpt_message) This function sends the data using the Manager implementation-defined capabilities (typically DMA or IPC protocol). Queueing is currently not supported, the caller needs to wait for completion of the requested transfer. h](h)}(hsdw_bpt_send_async(bpt_message)h]hsdw_bpt_send_async(bpt_message)}(hjwhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjsubh)}(hsThis function sends the data using the Manager implementation-defined capabilities (typically DMA or IPC protocol).h]hsThis function sends the data using the Manager implementation-defined capabilities (typically DMA or IPC protocol).}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjsubh)}(hgQueueing is currently not supported, the caller needs to wait for completion of the requested transfer.h]hgQueueing is currently not supported, the caller needs to wait for completion of the requested transfer.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjsubeh}(h]h ]h"]h$]h&]uh1j&hjpubah}(h]h ]h"]h$]h&]jZj[uh1jhhhKhjlubah}(h]h ]h"]h$]h&]uh1jhhhKhjhubj)}(hhh]j')}(hsdw_bpt_wait() This function waits for the entire message provided by the codec driver in the 'send_async' stage. Intermediate status for smaller chunks will not be provided back to the codec driver, only a return code will be provided. h](h)}(hsdw_bpt_wait()h]hsdw_bpt_wait()}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjubj)}(hThis function waits for the entire message provided by the codec driver in the 'send_async' stage. Intermediate status for smaller chunks will not be provided back to the codec driver, only a return code will be provided. h]h)}(hThis function waits for the entire message provided by the codec driver in the 'send_async' stage. Intermediate status for smaller chunks will not be provided back to the codec driver, only a return code will be provided.h]hThis function waits for the entire message provided by the codec driver in the ‘send_async’ stage. Intermediate status for smaller chunks will not be provided back to the codec driver, only a return code will be provided.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjubah}(h]h ]h"]h$]h&]uh1jhhhMhjubeh}(h]h ]h"]h$]h&]uh1j&hjubah}(h]h ]h"]h$]h&]jZj[uh1jhhhMhjhubeh}(h]h ]h"]h$]h&]uh1jhhhKhjIhhubh)}(hhh](h)}(h Regmap useh]h Regmap use}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhMubh)}(hXXExisting codec drivers rely on regmap to download firmware to Peripherals. regmap exposes an async interface similar to the send/wait API suggested above, so at a high-level it would seem natural to combine BRA and regmap. The regmap layer could check if BRA is available or not, and use a regular read-write command channel in the latter case.h]hXXExisting codec drivers rely on regmap to download firmware to Peripherals. regmap exposes an async interface similar to the send/wait API suggested above, so at a high-level it would seem natural to combine BRA and regmap. The regmap layer could check if BRA is available or not, and use a regular read-write command channel in the latter case.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjhhubh)}(h8The regmap integration will be handled in a second step.h]h8The regmap integration will be handled in a second step.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjhhubeh}(h] regmap-useah ]h"] regmap useah$]h&]uh1hhjIhhhhhMubeh}(h]peripheral-bus-interfaceah ]h"]peripheral/bus interfaceah$]h&]uh1hhhhhhhhKubh)}(hhh](h)}(hBRA stream modelh]hBRA stream model}(hj2hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj/hhhhhMubh)}(hiFor regular audio transfers, the machine driver exposes a dailink connecting CPU DAI(s) and Codec DAI(s).h]hiFor regular audio transfers, the machine driver exposes a dailink connecting CPU DAI(s) and Codec DAI(s).}(hj@hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj/hhubh)}(h'This model is not required BRA support:h]h'This model is not required BRA support:}(hjNhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj/hhubj)}(hX(1) The SoundWire DAIs are mainly wrappers for SoundWire Data Ports, with possibly some analog or audio conversion capabilities bolted behind the Data Port. In the context of BRA, the DP0 is the destination. DP0 registers are standard and can be programmed blindly without knowing what Peripheral is connected to each link. In addition, if there are multiple Peripherals on a link and some of them do not support DP0, the write commands to program DP0 registers will generate harmless COMMAND_IGNORED responses that will be wired-ORed with responses from Peripherals which support DP0. In other words, the DP0 programming can be done with broadcast commands, and the information on the Target device can be added only in the BRA Header. (2) At the CPU level, the DAI concept is not useful for BRA; the machine driver will not create a dailink relying on DP0. The only concept that is needed is the notion of port. (3) The stream concept relies on a set of master_rt and slave_rt concepts. All of these entities represent ports and not DAIs. (4) With the assumption that a single BRA stream is used per link, that stream can connect master ports as well as all peripheral DP0 ports. (5) BRA transfers only make sense in the context of one Manager/Link, so the BRA stream handling does not rely on the concept of multi-link aggregation allowed by regular DAI links. h]j")}(hhh](j')}(hXThe SoundWire DAIs are mainly wrappers for SoundWire Data Ports, with possibly some analog or audio conversion capabilities bolted behind the Data Port. In the context of BRA, the DP0 is the destination. DP0 registers are standard and can be programmed blindly without knowing what Peripheral is connected to each link. In addition, if there are multiple Peripherals on a link and some of them do not support DP0, the write commands to program DP0 registers will generate harmless COMMAND_IGNORED responses that will be wired-ORed with responses from Peripherals which support DP0. In other words, the DP0 programming can be done with broadcast commands, and the information on the Target device can be added only in the BRA Header. h]h)}(hXThe SoundWire DAIs are mainly wrappers for SoundWire Data Ports, with possibly some analog or audio conversion capabilities bolted behind the Data Port. In the context of BRA, the DP0 is the destination. DP0 registers are standard and can be programmed blindly without knowing what Peripheral is connected to each link. In addition, if there are multiple Peripherals on a link and some of them do not support DP0, the write commands to program DP0 registers will generate harmless COMMAND_IGNORED responses that will be wired-ORed with responses from Peripherals which support DP0. In other words, the DP0 programming can be done with broadcast commands, and the information on the Target device can be added only in the BRA Header.h]hXThe SoundWire DAIs are mainly wrappers for SoundWire Data Ports, with possibly some analog or audio conversion capabilities bolted behind the Data Port. In the context of BRA, the DP0 is the destination. DP0 registers are standard and can be programmed blindly without knowing what Peripheral is connected to each link. In addition, if there are multiple Peripherals on a link and some of them do not support DP0, the write commands to program DP0 registers will generate harmless COMMAND_IGNORED responses that will be wired-ORed with responses from Peripherals which support DP0. In other words, the DP0 programming can be done with broadcast commands, and the information on the Target device can be added only in the BRA Header.}(hjghhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM!hjcubah}(h]h ]h"]h$]h&]uh1j&hj`ubj')}(hAt the CPU level, the DAI concept is not useful for BRA; the machine driver will not create a dailink relying on DP0. The only concept that is needed is the notion of port. h]h)}(hAt the CPU level, the DAI concept is not useful for BRA; the machine driver will not create a dailink relying on DP0. The only concept that is needed is the notion of port.h]hAt the CPU level, the DAI concept is not useful for BRA; the machine driver will not create a dailink relying on DP0. The only concept that is needed is the notion of port.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM/hj{ubah}(h]h ]h"]h$]h&]uh1j&hj`ubj')}(h{The stream concept relies on a set of master_rt and slave_rt concepts. All of these entities represent ports and not DAIs. h]h)}(hzThe stream concept relies on a set of master_rt and slave_rt concepts. All of these entities represent ports and not DAIs.h]hzThe stream concept relies on a set of master_rt and slave_rt concepts. All of these entities represent ports and not DAIs.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM3hjubah}(h]h ]h"]h$]h&]uh1j&hj`ubj')}(hWith the assumption that a single BRA stream is used per link, that stream can connect master ports as well as all peripheral DP0 ports. h]h)}(hWith the assumption that a single BRA stream is used per link, that stream can connect master ports as well as all peripheral DP0 ports.h]hWith the assumption that a single BRA stream is used per link, that stream can connect master ports as well as all peripheral DP0 ports.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM6hjubah}(h]h ]h"]h$]h&]uh1j&hj`ubj')}(hBRA transfers only make sense in the context of one Manager/Link, so the BRA stream handling does not rely on the concept of multi-link aggregation allowed by regular DAI links. h]h)}(hBRA transfers only make sense in the context of one Manager/Link, so the BRA stream handling does not rely on the concept of multi-link aggregation allowed by regular DAI links.h]hBRA transfers only make sense in the context of one Manager/Link, so the BRA stream handling does not rely on the concept of multi-link aggregation allowed by regular DAI links.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM:hjubah}(h]h ]h"]h$]h&]uh1j&hj`ubeh}(h]h ]h"]h$]h&]jjj j!j"j#uh1j!hj\ubah}(h]h ]h"]h$]h&]uh1jhhhM!hj/hhubeh}(h]bra-stream-modelah ]h"]bra stream modelah$]h&]uh1hhhhhhhhMubh)}(hhh](h)}(hAudio DMA supporth]hAudio DMA support}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhM?ubh)}(hXSome DMAs, such as HDaudio, require an audio format field to be set. This format is in turn used to define acceptable bursts. BPT/BRA support is not fully compatible with these definitions in that the format and bandwidth may vary between read and write commands.h]hXSome DMAs, such as HDaudio, require an audio format field to be set. This format is in turn used to define acceptable bursts. BPT/BRA support is not fully compatible with these definitions in that the format and bandwidth may vary between read and write commands.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMAhjhhubh)}(hXIn addition, on Intel HDaudio Intel platforms the DMAs need to be programmed with a PCM format matching the bandwidth of the BPT/BRA transfer. The format is based on 192kHz 32-bit samples, and the number of channels varies to adjust the bandwidth. The notion of channel is completely notional since the data is not typical audio PCM. Programming such channels helps reserve enough bandwidth and adjust FIFO sizes to avoid xruns.h]hXIn addition, on Intel HDaudio Intel platforms the DMAs need to be programmed with a PCM format matching the bandwidth of the BPT/BRA transfer. The format is based on 192kHz 32-bit samples, and the number of channels varies to adjust the bandwidth. The notion of channel is completely notional since the data is not typical audio PCM. Programming such channels helps reserve enough bandwidth and adjust FIFO sizes to avoid xruns.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMFhjhhubh)}(hAlignment requirements are currently not enforced at the core level but at the platform-level, e.g. for Intel the data sizes must be multiples of 32 bytes.h]hAlignment requirements are currently not enforced at the core level but at the platform-level, e.g. for Intel the data sizes must be multiples of 32 bytes.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMNhjhhubeh}(h]audio-dma-supportah ]h"]audio dma supportah$]h&]uh1hhhhhhhhM?ubeh}(h]bulk-register-access-braah ]h"]bulk register access (bra)ah$]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}refids}nameids}(j7j4hhj/j,jjjgjdjjjjjFjCjjj>j;j,j)j$j!jjj/j,u nametypes}(j7h݉j/jjgjjjFjj>j,j$jj/uh}(j4hhhj,hjj2jdjjjjjjjCj jjj;jj)jIj!jjj/j,ju footnote_refs} citation_refs} autofootnotes]autofootnote_refs]symbol_footnotes]symbol_footnote_refs] footnotes] citations]autofootnote_startKsymbol_footnote_startK id_counter collectionsCounter}Rparse_messages]transform_messages] transformerN include_log] decorationNhhub.