# UART

Source: [https://docs.qualcomm.com/doc/80-70014-8/topic/uart.html](https://docs.qualcomm.com/doc/80-70014-8/topic/uart.html)

UART devices transmit data asynchronously. Hence, a clock signal does not synchronize the
            output of bits from the transmitting UART to the sampling of bits by the receiving UART.
            Instead of a clock signal, the transmitting UART adds start and stop bits to the data
            packet being transferred. These bits define the beginning and end of the data packet, so
            the receiving UART knows when to start reading the bits.

When the receiving UART detects a start bit, it starts to read the incoming bits at a
            specific frequency known as the baud rate. The baud rate is a measure of the speed of
            data transfer, expressed in bits per second (bps). Both UARTs must operate at about the
            same baud rate. The baud rate between the transmitting and receiving UARTs can only
            differ by about 10% before the timing of bits gets too far off. Both UARTs must be
            configured to transmit and receive the same data packet structure.

Figure : Data transfer between two UART devices
            
            ![Image illustrates data transfer between two UART devices.](data:image/png;base64,UklGRiARAABXRUJQVlA4TBQRAAAv4IJ/AC/kILLduHlfP4ewSKETlMUj0+nNwVEbSZIUWdkXlpqhM1qOs3iqfotlGbZtG0mO+2SWdJ67zZt1Ov9kkzZkTto7gM//Y5ttkkSEPySRZBvDt2SbJBFBEtsiwt+FPMm2iCCJJJJEBNtsiwj7nCTJk2zb52TbNgZJzr2de5MkT7LNtoiwjWEbw5+XJ9m2zylP+pK/RGMAjQXgogBtARpQhgaNxAI0KMAFbQAULjQoQLYFoHC1AiQakCgKjQVowIdq9aIAFCgNoE2BLg0mj+sjJBrQ4EEBEvf34f1Rx+MuFAZtG0lK+MOeufn2AETEBBD9pmrKYrgOMj9AtA64GSixb4qAeBbAs5gjW6RWSRus6sCrdHtIHlhXTjv8YTW4GpCEk6ak3gXEiwhijly0CXZr0g37/jezY0x7StKZZ1kMzKt2ir7L7IY4Uba4/Z+cNs7vl+Zi2zrN4RKy3lT0cO3Wbg4aui60NEo5jDDNxV7EYu91yJ44eA/ZZhHhH0czv9EMMqOZPk8c0X9atG2FCaNz285wF8l6+ggiYuQbYgC2bZv//84SBIAIOhgRkiBJkqTGAR3xU5WpuYbZfWPV1Z8amF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/S8CAP8dD9Mg4D0Hfh16GoH9OvQN3yrIqKJ5qiCjnLbQYmepR1Hc9PPUf9Z/67/13/pv/bf+W/+t/9Z/JNsuqWKOjuKB9qnSScjfoaNoGNWOO3MOpZs3HFJLFd3/zdBJePMtMoiVnAXfM+3mY/jqUwDYffeHGQcjeNZi6EMniuMQImWfeCmRSxvPzyAA8LPHABCy6ZwK8D9eW/sUwH+UDrm18fQMAnh3B2fa/+J/EbuB36bpRd3Z8DlAmAq5tvHkMB1WRxBG9zl0PSFMGF0vDXJv49GZzNImoPfjCEIBfDMI0yD3Nh6dMXRQRCvKOA0RYBrk3saTMxxBKGYWSycOfZiq4i93XDWq6uASiqniihT3Np6cg0O/zeQuUsilcxD0WnOkeRZUqbjwyUNs1WS4t/HsfmH4bm1t7ZgAxzCd5z/Xlh0lWoaNhc9lWHFiKffLpsw/mI3niRhYjnnYXi3xdkkL1OdggzYeZCYmv4SwnVWMOQS/nQa5t/H4vv4uhE3m13Hm39Mg88t4dt9BnQC881P0Uv0zDxcNzcs98NuYBplbxtO7BuYFsxIjAKAZjnhgN5sNIMpuKmReGQ/wKsavjgFg99sd+gV5EMAjai3dRw89TIfMKeMxX4eeTlC5Dn3zUXTjK699chIZKRsVBYfUjUsOrQeapy7IwZXrdBSbxnhXW41y4a62p/6z/lv/rf/+DPod/Kax4Ll/8czbdoPLAPUFTwmgcOo/67/XVpFztadiquGuqz3lS428oz8VUgxbjgZVQy1K36QEnfrP+m/9t/5b/63/KOqgSqUFxgYo0uXXmbJdUKXqAqNSUKQinv6lAsjIWZCAlNzXpFJ3ZVRdlFsqktI2vmZVrz9i9v9ZTNVO8PprHv6/DuW8FoX/h1dB)

The parameters that determine successful transmission are as follows.

- **Baud rate**: The speed at which the data is transmitted is mentioned using the
                baud rate and measured in bits per second. Both the transmitting UART and the
                receiving UART must agree on the baud rate for a successful data transmission.
- **Start bit**: It is a synchronization bit that is added before the actual data.
                The start bit marks the beginning of the data packet.
- **Stop bit**: This bit marks the end of the data packet. It is usually two bits
                long but often only one bit is used.
- **Parity bit**: It allows the receiver to check whether the received data is
                correct. Parity is a low – level error checking system and comes in two varieties:
                Even parity and odd parity.
- **Data bits**: The actual data being transmitted from sender to receiver. The
                length of the data frame can be anywhere between 5 and 9 (9 bits if parity is not
                used and only 8 bits if parity is used).
- **Flow control**: It is controlled by `cts_n/rfr_n` lines. Flow
                control is optional, and `cts_n/rfr_n` pair is optional.

The following figure shows a sample UART data packet.
Figure : UART data packet
                
                <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<!-- Generated by Microsoft Visio, SVG Export uart-data-packet.svg Page-1 -->
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:ev="http://www.w3.org/2001/xml-events" xmlns:v="http://schemas.microsoft.com/visio/2003/SVGExtensions/" width="8.08333in" height="3.61841in" viewbox="0 0 582 260.526" xml:space="preserve" color-interpolation-filters="sRGB" class="st5"><v:documentproperties v:langid="1033" v:viewmarkup="false">	<v:userdefs>		<v:ud v:nameu="msvNoAutoConnect" v:val="VT0(1):26"></v:ud>	</v:userdefs></v:documentproperties>
<style>.svg-1 .st1 { fill: #ffffff; stroke: #000000; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1 }
.svg-1 .st2 { fill: #000000; font-family: Arial; font-size: 0.833336em }
.svg-1 .st3 { stroke: #000000; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1 }
.svg-1 .st4 { fill: none; stroke: none; stroke-linecap: round; stroke-linejoin: round; stroke-width: 0.75 }
.svg-1 .st5 { fill: none; fill-rule: evenodd; font-size: 12px; overflow: visible; stroke-linecap: square; stroke-miterlimit: 3 }</style>
<g v:mid="0" v:index="1" v:groupcontext="foregroundPage">	<title>Page-1</title>	<v:pageproperties v:drawingscale="1" v:pagescale="1" v:drawingunits="19" v:shadowoffsetx="9" v:shadowoffsety="-9"></v:pageproperties>	<g id="shape1-1" v:mid="1" v:groupcontext="shape" transform="translate(18.5,-109.17)">		<title>Rectangle</title>		<desc>1 start bit</desc>		<v:userdefs>			<v:ud v:nameu="visVersion" v:val="VT0(15):26"></v:ud>		</v:userdefs>		<v:textblock v:margins="rect(4,4,4,4)"></v:textblock>		<v:textrect cx="34.9359" cy="242.289" width="69.88" height="36.4731"></v:textrect>		<rect x="0" y="224.052" width="69.8718" height="36.4731" class="st1"></rect>		<text x="14.37" y="245.29" class="st2" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>1 start bit</text>		</g>	<g id="shape2-4" v:mid="2" v:groupcontext="shape" transform="translate(88.3718,-109.17)">		<title>Rectangle.2</title>		<desc>5 to 9 data bits</desc>		<v:userdefs>			<v:ud v:nameu="visVersion" v:val="VT0(15):26"></v:ud>		</v:userdefs>		<v:textblock v:margins="rect(4,4,4,4)"></v:textblock>		<v:textrect cx="153.718" cy="242.289" width="307.44" height="36.4731"></v:textrect>		<rect x="0" y="224.052" width="307.436" height="36.4731" class="st1"></rect>		<text x="120.92" y="245.29" class="st2" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>5 to 9 data bits</text>		</g>	<g id="shape3-7" v:mid="3" v:groupcontext="shape" transform="translate(395.808,-109.17)">		<title>Rectangle.3</title>		<desc>0 to 1 parity bits</desc>		<v:userdefs>			<v:ud v:nameu="visVersion" v:val="VT0(15):26"></v:ud>		</v:userdefs>		<v:textblock v:margins="rect(4,4,4,4)"></v:textblock>		<v:textrect cx="41.9231" cy="242.289" width="83.85" height="36.4731"></v:textrect>		<rect x="0" y="224.052" width="83.8462" height="36.4731" class="st1"></rect>		<text x="6.63" y="245.29" class="st2" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>0 to 1 parity bits</text>		</g>	<g id="shape4-10" v:mid="4" v:groupcontext="shape" transform="translate(479.654,-109.17)">		<title>Rectangle.4</title>		<desc>1 to 2 stop bits</desc>		<v:userdefs>			<v:ud v:nameu="visVersion" v:val="VT0(15):26"></v:ud>		</v:userdefs>		<v:textblock v:margins="rect(4,4,4,4)"></v:textblock>		<v:textrect cx="41.9231" cy="242.289" width="83.85" height="36.4731"></v:textrect>		<rect x="0" y="224.052" width="83.8462" height="36.4731" class="st1"></rect>		<text x="9.4" y="245.29" class="st2" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>1 to 2 stop bits</text>		</g>	<g id="shape8-13" v:mid="8" v:groupcontext="shape" transform="translate(281.513,41.1547) rotate(90)">		<title>Left Brace</title>		<v:userdefs>			<v:ud v:nameu="visVersion" v:prompt="" v:val="VT0(15):26"></v:ud>		</v:userdefs>		<path d="M64.3 260.53 A86.0818 90.7894 0 0 1 32.15 206.27 L32.15 -10.73 L0 -10.73 L32.15 -10.73 L32.15 -227.74 A86.0818					 90.7894 0 0 1 64.3 -281.99" class="st3"></path>	</g>	<g id="shape9-16" v:mid="9" v:groupcontext="shape" transform="translate(135.282,216.261) rotate(-90)">		<title>Left Brace.9</title>		<v:userdefs>			<v:ud v:nameu="visVersion" v:prompt="" v:val="VT0(15):26"></v:ud>		</v:userdefs>		<path d="M56.28 260.53 A75.347 51.4494 0 0 1 28.14 229.78 L28.14 106.81 L0 106.81 L28.14 106.81 L28.14 -16.17 A75.347					 51.4494 0 0 1 56.28 -46.91" class="st3"></path>	</g>	<g id="shape11-19" v:mid="11" v:groupcontext="shape" transform="translate(257.32,-220.671)">		<title>Sheet.11</title>		<desc>Packet</desc>		<v:textblock v:margins="rect(4,4,4,4)"></v:textblock>		<v:textrect cx="34.9359" cy="249.786" width="69.88" height="21.4796"></v:textrect>		<rect x="0" y="239.046" width="69.8718" height="21.4796" class="st4"></rect>		<text x="19.65" y="252.79" class="st2" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>Packet</text>		</g>	<g id="shape17-22" v:mid="17" v:groupcontext="shape" transform="translate(200.096,-18.375)">		<title>Sheet.17</title>		<desc>Data frame</desc>		<v:textblock v:margins="rect(4,4,4,4)"></v:textblock>		<v:textrect cx="41.9231" cy="247.638" width="83.85" height="25.7755"></v:textrect>		<rect x="0" y="234.75" width="83.8462" height="25.7755" class="st4"></rect>		<text x="17.19" y="250.64" class="st2" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>Data frame</text>		</g></g>
</svg>

## UART features

Source: [https://docs.qualcomm.com/doc/80-70014-8/topic/uart.html](https://docs.qualcomm.com/doc/80-70014-8/topic/uart.html)

This section describes the UART transfer modes for applications that use low-speed and
            high-speed transfer modes (FIFO/DMA).

### Linux

The UART core supports the following features:
- FIFO, and CPU DMA modes.
- Supports baud rates from 300 bps up to 4 Mbps.

The two modes of transfer speed are as follows.
- High-speed mode: DMA transfers data between its Rx/Tx buffers and system
                        memory. Better performance is achieved with high-speed UART drivers
                        supporting higher baud rates and bigger data packages. For example, the
                        Bluetooth wireless technology connectivity module.
- Low-speed mode: the FIFO mode is used to transfer data between its Rx/Tx
                        buffers and system memory.

### Boot

- UART operates in FIFO mode.
- Rx/Tx 5 bits to 8 bits per character.
- Supports a maximum baud rate of 115200.

### aDSP

- Supports FIFO mode for transfers.
- Rx/Tx 5 bits to 8 bits per character.
- Supported baud rates: 115200, 230400, 460800, 921600, 1000000, 3000000, and
                    6000000.

## UART interface

Source: [https://docs.qualcomm.com/doc/80-70014-8/topic/uart.html](https://docs.qualcomm.com/doc/80-70014-8/topic/uart.html)

This section covers the paths of UART driver configurations for the different
            subsystems.

### Linux

| File type | Description |
| --- | --- |
| Device tree source | For device tree properties of chipset configurations of QUP v3<br>                                serial engine interface device nodes, and low and high-speed UART<br>                                device nodes, see [https://git.linaro.org/kernel-org/linux-next.git/tree/arch/arm64/boot/dts/qcom/sc7280.dtsi](https://git.linaro.org/kernel-org/linux-next.git/tree/arch/arm64/boot/dts/qcom/sc7280.dtsi). |
| `Pinctrl` settings | For device tree properties of GPIO settings for the QUP v3 serial<br>                                engine interface for UART device nodes, see the following file<br>                                    paths.<ul class="ul" id="uart_interface__ul_hsz_14w_41c"><br>                                    <li class="li">The pin control table for the corresponding QUP v3 serial<br>                                        engine is at <span class="ph filepath">&lt;workspace_path_of_LINUX_kernel_image&gt;\sources\kernel\kernel_platform\kernel\arch\arm64\boot\dts\qcom\&lt;chipset&gt;.dts</span>.</li><br><br>                                    <li class="li">For DTSI configuration examples to override the chipset,<br>                                            see <a href="https://github.com/torvalds/linux/blob/master/arch/arm64/boot/dts/qcom/qcs6490-rb3gen2.dts" target="_blank" class="xref cursorpointer" onclick="Window.BookmapComponent.navigateExternalFile('https://github.com/torvalds/linux/blob/master/arch/arm64/boot/dts/qcom/qcs6490-rb3gen2.dts')">https://github.com/torvalds/linux/blob/master/arch/arm64/boot/dts/qcom/qcs6490-rb3gen2.dts</a>.</li><br><br>                                </ul> |
| TrustZone settings | For TrustZone access control settings to load the QUP v3 serial<br>                                engine UART firmware for different subsystems, see /firmware/qualcomm-linux-spf-1-0\_ap\_standard\_oem\_nomodem/TZ.XF.5.0/trustzone\_images/core/settings/buses/qup\_accesscontrol/qupv3/config/&lt;chipset&gt;/QUPAC\_Access.c. |

### Boot (UEFI-only)

| File type | Description |
| --- | --- |
| QUP v3 serial engine configuration | For QUP v3 serial engine configurations in the boot subsystem to<br>                                enable the UART serial engine, see /firmware/qualcomm-linux-spf-1-0\_ap\_standard\_oem\_nomodem/BOOT.MXF.1.0.c1/boot\_images/boot/QcomPkg/SocPkg/&lt;chipset&gt;/Settings/UART/UartSettings.c |
| TrustZone settings | For TrustZone access control settings in QUP v3 serial engine<br>                                firmware to configure UART for different subsystems, see /firmware/qualcomm-linux-spf-1-0\_ap\_standard\_oem\_nomodem/TZ.XF.5.0/trustzone\_images/core/settings/buses/qup\_accesscontrol/qupv3/config/&lt;chipset&gt;/QUPAC\_Access.c |

### aDSP/SLPI

| File type | Description |
| --- | --- |
| QUP v3 serial engine configuration | For QUP v3 serial engine configuration settings in the aDSP<br>                                subsystem to enable UART, see the following files.<ul class="ul" id="uart_interface__ul_lrk_1hn_rzb"><br>                                    <li class="li"><span class="ph filepath">/firmware/qualcomm-linux-spf-1-0_ap_standard_oem_nomodem/ADSP.HT.5.5.c8/adsp_proc/core/settings/buses/qup_common/config/&lt;chipset&gt;/adsp/ssc/qup_devcfg.c</span></li><br><br>                                    <li class="li"><span class="ph filepath">/firmware/qualcomm-linux-spf-1-0_ap_standard_oem_nomodem/ADSP.HT.5.5.c8/adsp_proc/core/settings/buses/qup_fw/config/&lt;chipset&gt;/fw_devcfg.c</span></li><br><br>                                </ul> |
| Firmware configuration settings | For QUP v3 serial engine firmware settings to configure UART in<br>                                aDSP software, see the following files.<ul class="ul" id="uart_interface__ul_wpr_p5j_51c"><br>                                    <li class="li"><span class="ph filepath">/firmware/qualcomm-linux-spf-1-0_ap_standard_oem_nomodem/ADSP.HT.5.5.c8/adsp_proc/core/settings/buses/qup_fw/config/&lt;chipset&gt;/fw_devcfg.c</span></li><br><br>                                    <li class="li"><span class="ph filepath">/firmware/qualcomm-linux-spf-1-0_ap_standard_oem_nomodem/ADSP.HT.5.5.c8/adsp_proc/core/settings/buses/qup_fw/config/&lt;chipset&gt;/fw_devcfg.xml</span></li><br><br>                                </ul> |

### UART APIs

Source: [https://docs.qualcomm.com/doc/80-70014-8/topic/uart.html](https://docs.qualcomm.com/doc/80-70014-8/topic/uart.html)

UART APIs for the following subsystems are listed in this section.

### Linux

- For information on Linux APIs, see [https://github.com/torvalds/linux/blob/master/include/linux/tty.h](https://github.com/torvalds/linux/blob/master/include/linux/tty.h).

### Boot

For information on APIs, see the QcomPkg/Library/UartQupv3Lib/UartApi.h file.

- Initializes UART port.
    1. Opens the UART port.
    2. Configures the corresponding clocks, interrupts, and GPIO.
    3. Do not call the function from the ISR context.

        {{uart_open(uart_handle* h, uart_port_id id, uart_open_config* config); }}Copy to clipboard
- Transmits the data from the given buffer for an asynchronous call. The buffer is
                    queued for
                    Tx.

        uart_transmit(uart_handle h, char* buf, uint32 bytes_to_tx, void* cb_data);Copy to clipboard
- Queues the buffer provided for receiving the data from an asynchronous call.
    1. Call `uart_receive` immediately after
                                `uart_open` to queue a buffer.
    2. There can be a maximum of two buffers queued at a time. Do not call the
                            function from the ISR context.

        uart_receive(uart_handle h, char* buf, uint32 buf_size, void* cb_data);Copy to clipboard
- De-initializes the UART port.
    1. Releases clock, interrupt, and GPIO handle related to this UART.
    2. Cancels all pending transfers.
    3. Do not call the function call from ISR context

         uart_close(uart_handle h);Copy to clipboard

### aDSP

- Initializes UART port. Opens the UART port and configures the corresponding
                    clocks, interrupts, and
                    GPIO.

        uart_open(uart_handle* h, uart_port_id id, uart_open_config* config); Copy to clipboard
- Powers on the UART core by clocking on all the resources.

        uart_power_on(uart_handle h);Copy to clipboard
- Transmits the data from the given buffer with an asynchronous call. The buffer
                    is queued for
                    Tx.

        uart_transmit(uart_handle h, uint8* buf, uint32 bytes_to_tx, void* cb_data); Copy to clipboard
- Queues the buffer provided for receiving the data with an asynchronous call.

        uart_receive(uart_handle h, uint8* buf, uint32 buf_size, void* cb_data); Copy to clipboard
- Powers down the UART core by clocking off all the resources. The client ensures
                    that all pending transmit requests are completed. If `wake_on_rx`
                    is enabled, then the wake-up interrupt is registered.

        uart_power_off(uart_handle h, boolean wake_on_rx, UART_WAKEUP_CALLBACK wake_cb, void* wake_cb_data); Copy to clipboard
- De-initializes the UART port. Releases clock, interrupt, and GPIO handle related
                    to UART, and cancels pending transfers.

        uart_close(uart_handle h); Copy to clipboard

## UART software

Source: [https://docs.qualcomm.com/doc/80-70014-8/topic/uart.html](https://docs.qualcomm.com/doc/80-70014-8/topic/uart.html)

This section provides information on the UART device tree configuration, and
            documentation for the device nodes.

### Linux

For information on Kernel device instances, see [https://github.com/torvalds/linux/blob/master/Documentation/devicetree/bindings/serial/qcom%2Cserial-geni-qcom.yaml](https://github.com/torvalds/linux/blob/master/Documentation/devicetree/bindings/serial/qcom%2Cserial-geni-qcom.yaml).

For information on the UART driver files,
                see [https://github.com/torvalds/linux/blob/master/drivers/tty/serial/qcom_geni_serial.c](https://github.com/torvalds/linux/blob/master/drivers/tty/serial/qcom_geni_serial.c)

    uart7: serial@99c000 {
    /* Manufacturer model of serial driver */
    compatible = "qcom,geni-uart";
    /* SE address and size */
    reg = <0 0x0099c000 0 0x4000>;
    /*Clocks for SE */
    clocks = <&gcc GCC_QUPV3_WRAP0_S7_CLK>;
    clock-names = "se";
    /* pinctrl setting */
    pinctrl-names = "default";
    pinctrl-0 = <&qup_uart7_cts>, <&qup_uart7_rts>, <&qup_uart7_tx>, <&qup_uart7_rx>;
    interrupts = <GIC_SPI 608 IRQ_TYPE_LEVEL_HIGH>;
    power-domains = <&rpmhpd SC7280_CX>;
    operating-points-v2 = <&qup_opp_table>;
    interconnects = <&clk_virt MASTER_QUP_CORE_0 0 &clk_virt SLAVE_QUP_CORE_0 0>,
    <&gem_noc MASTER_APPSS_PROC 0 &cnoc2 SLAVE_QUP_0 0>;			interconnect-names = "qup-core", "qup-config";
    /* To enable QUPV3 serial engine instance for UART protocol, change Status to OK */			status = "disabled";		};	}Copy to clipboard

For configuration settings of the serial engine GPIOs, see [https://git.linaro.org/kernel-org/linux-next.git/tree/arch/arm64/boot/dts/qcom/sc7280.dtsi](https://git.linaro.org/kernel-org/linux-next.git/tree/arch/arm64/boot/dts/qcom/sc7280.dtsi).

    qup_uart7_cts: qup-uart7-cts-state {			pins = "gpio28";			function = "qup07";		};
    		qup_uart7_rts: qup-uart7-rts-state {			pins = "gpio29";			function = "qup07";		};
    		qup_uart7_tx: qup-uart7-tx-state {			pins = "gpio30";			function = "qup07";		};
    		qup_uart7_rx: qup-uart7-rx-state {			pins = "gpio31";			function = "qup07";		};
    Copy to clipboard

The TrustZone configurations must be aligned in the QUPAC\_Access.c file to ensure that the GPIO/QUP v3 can be
                used. The TrustZone images can be accessed at /firmware/qualcomm-linux-spf-1-0\_ap\_standard\_oem\_nomodem/TZ.XF.5.0/trustzone\_images/core/settings/buses/qup\_accesscontrol/qupv3/config/&lt;chipset&gt;/QUPAC\_Access.c.
                Modify the required settings or see the default settings assigned for particular
                instances of the QUP v3 serial engine.

QUP v3 supports both 4-wire UART with
                flow-control enabled, and 2-wire UART without flow control enabled. The following
                example for TrustZone access controls entry for both. The QUP v3 serial engine
                configurations to enable the UART protocol are as follows:
- Default configuration enabled for SE7 as HS
                        UART

        { QUPV3_0_SE7, QUPV3_PROTOCOL_UART_4W, QUPV3_MODE_FIFO, AC_HLOS, TRUE, TRUE, FALSE }, Copy to clipboard
- 2-wire UART configuration for
                        SE5

        uart5: serial@994000 {
        compatible = "qcom,geni-uart";
        reg = <0 0x00994000 0 0x4000>;
        clocks = <&gcc GCC_QUPV3_WRAP0_S5_CLK>;
        clock-names = "se";
        pinctrl-names = "default";
        pinctrl-0 =  <&qup_uart5_tx>, <&qup_uart5_rx>;
        interrupts = <GIC_SPI 606 IRQ_TYPE_LEVEL_HIGH>;
        power-domains = <&rpmhpd SC7280_CX>;
        operating-points-v2 = <&qup_opp_table>;
        interconnects = <&clk_virt MASTER_QUP_CORE_0 0 &clk_virt SLAVE_QUP_CORE_0 0>,
            <&gem_noc MASTER_APPSS_PROC 0 &cnoc2 SLAVE_QUP_0 0>;
        interconnect-names = "qup-core", "qup-config";
        status = "disabled";
        };Copy to clipboard

        { QUPV3_0_SE5, QUPV3_PROTOCOL_UART_2W, QUPV3_MODE_FIFO,
        AC_HLOS, TRUE, FALSE, FALSE },Copy to clipboard

### Boot

The QUP v3 serial engine can be configured to UART in boot using
                    the /firmware/qualcomm-linux-spf-1-0\_ap\_standard\_oem\_nomodem/BOOT.MXF.1.0.c1/boot\_images/boot/QcomPkg/SocPkg/&lt;chipset&gt;/Settings/UART/UartSettings.c
                file.

    UART_PROPERTIES devices =
    {
       // MAIN_PORT
       0x00994000,    // Serial Engine Base address
       0x009C0000,// qup_common base address
       0x2001c161,  // GPIO TX pin Config
       0x2000c171,  // GPIO RX Pin Config
       0,           // gpio_cts_config
       0,           // gpio_rfr_config
       0,           // clock_id_index
       (void*)0,        // bus_clock_id
       (void*)CLK_QUPV3_WRAP0_S5,     // core_clock_id
       0,          // irq number not used
       0,  //TCSR base
       0,  // TCSR offset
       0   // TCSR value
    
    };
    Copy to clipboard

**GPIO configuration**
The GPIO configuration is listed in the
                    following table.

| Bits | Parameters |
| :---: | --- |
| [0:3] | GPIO function |
| [4:13] | GPIO number |
| [14] | Direction |
| [15:17] | Pull type |
| [18:21] | Drive strength |

Each GPIO should be configured based on the following bit
                    fields.

    <!--
    GPIO configuration calculation
    
    GPIO DIR values
    GPIO_INPUT = 0x0
    GPIO_OUTPUT = 0x1
    
    GPIO_PULL values
    GPIO_NO_PULL = 0, /**< -- Do not specify a pull. */
    GPIO_PULL_DOWN = 0x1, /**< -- Pull the GPIO down. */
    GPIO_KEEPER_ENABLE = 0x2, /**< -- Keeper Enable. */
    GPIO_PULL_UP = 0x3, /**< -- Pull the GPIO up. */
    
    GPIO_DRV_STRENGTH values
    GPIO_2P0MA = 0, /**< -- Specify a 2 mA drive. */
    GPIO_4P0MA = 0x1, /**< -- Specify a 4 mA drive. */
    GPIO_6P0MA = 0x2, /**< -- Specify a 6 mA drive. */
    GPIO_8P0MA = 0x3, /**< -- Specify a 8 mA drive. */
    
    GPIO_FUNC_SELECT_Value
    GPIO_FS_VAL =0, //Specifies GPIO function
    
    GPIO_FS_VAL =0X1, //Specify NON GPIO function( UART/SPI/I2C)
    GPIO configuration = (GPIO_NUM & 0xFF) << 0x10 |
    (GPIO_FS_VAL & 0xF) << 0xC |
    (GPIO_DRV_STRENGTH & 0xF) << 0x8 |
    (GPIO_PULL & 0xF) << 0x4 |
    (GPIO_DIR & 0xF)
    
    -->
    /*
    | RESERVED | GPIO NUM | DRIVE | FUNC | PULL | DIR |
    -------------------------------------------------------------------------
    | 0000 | 0000 | 0001 | 1110 | 0001 | 0001 | 0010 | 0001 |
    -------------------------------------------------------------------------
    */Copy to clipboard

### aDSP

Firmware loading of SSC QUP is performed during the bootup sequence of the aDSP
                subsystem. Hence, the configuration file is present in the aDSP build at /firmware/qualcomm-linux-spf-1-0\_ap\_standard\_oem\_nomodem/ADSP.HT.5.5.c8/adsp\_proc/core/settings/buses/qup\_fw/config/&lt;chipset&gt;/fw\_devcfg.c.

The following configuration is a sample of SSC QUP SE5/6 loaded with the UART
                firmware in the FIFO
                mode.

                       offset,        protocol,   mode,  load_fw, dfs_mode
    se_cfg se0_cfg = { 0x80000, SE_PROTOCOL_I3C,    GSI,     TRUE, TRUE  };
    se_cfg se1_cfg = { 0x84000, SE_PROTOCOL_I2C,    GSI,     TRUE, TRUE  };
    se_cfg se2_cfg = { 0x88000, SE_PROTOCOL_I2C,    GSI,     TRUE, TRUE  };
    se_cfg se3_cfg = { 0x8C000, SE_PROTOCOL_I2C,    GSI,     FALSE, TRUE  };
    se_cfg se4_cfg = { 0x90000, SE_PROTOCOL_SPI,   	GSI,     TRUE, TRUE };
    se_cfg se5_cfg = { 0x94000, SE_PROTOCOL_UART,   FIFO,    TRUE,FALSE };
    se_cfg se6_cfg = { 0x98000, SE_PROTOCOL_UART,   FIFO,    TRUE,FALSE  };
    Copy to clipboard

GPIO configuration: Each serial engine in the QUP common driver is configured with
                the default GPIO configuration per protocol in the chipset-specific configurations.
                The GPIO configuration is picked up by the QUP common driver as per the protocol
                loaded in the serial engine from /firmware/qualcomm-linux-spf-1-0\_ap\_standard\_oem\_nomodem/ADSP.HT.5.5.c8/adsp\_proc/core/settings/buses/qup\_common/config/&lt;chipset&gt;/adsp/ssc/qup\_instance\_mapping.c.
                The default GPIO configuration can be overwritten as follows.

    {      .instance_id          =  6 ,         //Instance ID
            .qup              =  QUP_SSC,    //QUP Type
            .se_index         =  5,          //SE ID
            .se_data          =  NULL,       //devcfg_map
            .protocol_io_cfg  =  {
                                    TLMM_MAP(TLMM_GPIO_KEEPER ,TLMM_GPIO_2MA,TLMM_GPIO_KEEPER ),              //SLEEP CFG
                                    TLMM_MAP(TLMM_GPIO_NO_PULL,TLMM_GPIO_6MA,TLMM_GPIO_KEEPER ),              //SPI CFG
                                    TLMM_MAP(TLMM_GPIO_NO_PULL,TLMM_GPIO_2MA,TLMM_GPIO_NO_PULL),              //UART CFG
                                    TLMM_MAP(TLMM_GPIO_PULL_UP,TLMM_GPIO_2MA,TLMM_GPIO_NO_PULL),              //I2C CFG
                                    TLMM_MAP(TLMM_GPIO_PULL_UP,TLMM_GPIO_2MA,TLMM_GPIO_KEEPER )               //I3C CFG
                                 },
            .se_exclusive     =  TRUE,
    }
    Copy to clipboard

TLMM\_MAP is a macro to initialize the active and sleep state GPIO configurations. For
                example, sample usage of the TLMM\_MAP macro.

    TLMM_MAP (active state pull type, drive strength, sleep state pull type)Copy to clipboard

## UART tools

Source: [https://docs.qualcomm.com/doc/80-70014-8/topic/uart.html](https://docs.qualcomm.com/doc/80-70014-8/topic/uart.html)

This section provides information on various test tools and methods for the UART serial
            interface driver to confirm the UART data transfers.

### Linux

For more details, see [https://docs.kernel.org/admin-guide/serial-console.html](https://docs.kernel.org/admin-guide/serial-console.html).

## UART configuration

Source: [https://docs.qualcomm.com/doc/80-70014-8/topic/uart.html](https://docs.qualcomm.com/doc/80-70014-8/topic/uart.html)

The section provides information on how to enable UART in the kernel.

### Linux

The following driver kernel configurations are required to support the UART
                    interface.
- UART driver: [https://github.com/torvalds/linux/blob/master/drivers/tty/serial/qcom_geni_serial.c](https://github.com/torvalds/linux/blob/master/drivers/tty/serial/qcom_geni_serial.c)
- Kernel `defconfig` file path:
                            &lt;workspace\_path\_of\_LINUX\_kernel\_image&gt;\sources\kernel
                            \kernel\_platform\kernel\arch\arm64/configs/qcom\_defconfig

The following kernel configurations are to be enabled.
- `CONFIG_QCOM_GENI_SE=y`
- `CONFIG_SERIAL_QCOM_GENI=y`

To enable a serial node for the loopback validation, apply the following patch to the
                    /arch/arm64/boot/dts/qcom/&lt;chipset&gt;.dtsi
                file.

    --- a/arch/arm64/boot/dts/qcom/<chipset>.dtsi
    +++ b/arch/arm64/boot/dts/qcom/<chipset>.dtsi
    @@ -70,6 +70,7 @@
     		spi13 = &spi13;
     		spi14 = &spi14;
     		spi15 = &spi15;
    +		serial1 = &uart7;
    }; 

    +
    +&uart7 {
    +	status = "ok";
    +}; 
    Copy to clipboard

Note: The kernel configuration and device tree changes must be
                compiled. The compiled images are loaded to the target to verify the interface. For
                information on interface verification, see [UART verification](https://docs.qualcomm.com/doc/80-70014-8/topic/uart.html#uart_verification).

### Boot/aDSP

For customizations, see the [UART software](https://docs.qualcomm.com/doc/80-70014-8/topic/uart.html#uart_software) section.

## UART customization

Source: [https://docs.qualcomm.com/doc/80-70014-8/topic/uart.html](https://docs.qualcomm.com/doc/80-70014-8/topic/uart.html)

For information on customizing UART software, see [QUP v3 access control customization](https://docs.qualcomm.com/doc/80-70014-8/topic/overview-of-wired-interfaces.html#customize-access-control-of-qup).

## UART verification

Source: [https://docs.qualcomm.com/doc/80-70014-8/topic/uart.html](https://docs.qualcomm.com/doc/80-70014-8/topic/uart.html)

This section describes the validation procedure for the UART drivers, and the test
            results for the Qualcomm drivers.

### Linux

To enable the UART nodes, do the following and compile.
1. To change the UART status to OK and aliases to the
                        specific UART node, edit the [https://git.linaro.org/kernel-org/linux-next.git/tree/arch/arm64/boot/dts/qcom/sc7280.dtsi](https://git.linaro.org/kernel-org/linux-next.git/tree/arch/arm64/boot/dts/qcom/sc7280.dtsi) file.
Note: The
                            SSH shell or serial console must be enabled to run the commands and
                            display the output on the SSH shell (console)
                        window.

        aliases {
        i2c0 = &i2c0;
        spi15 = &spi15;
        ++serial1 = &uart7;
        };
        uart7: serial@99c000 {
        compatible = "qcom,geni-uart";
        reg = <0 0x0099c000 0 0x4000>;
        clocks = <&gcc GCC_QUPV3_WRAP0_S7_CLK>;
        clock-names = "se";
        pinctrl-names = "default";
        pinctrl-0 = <&qup_uart7_cts>, <&qup_uart7_rts>, <&qup_uart7_tx>,
        <&qup_uart7_rx>;
        interrupts = <GIC_SPI 608 IRQ_TYPE_LEVEL_HIGH>;
        power-domains = <&rpmhpd SC7280_CX>;
        operating-points-v2 = <&qup_opp_table>;
        interconnects = <&clk_virt MASTER_QUP_CORE_0 0 &clk_virt SLAVE_QUP_CORE_0
        0>,
        <&gem_noc MASTER_APPSS_PROC 0 &cnoc2 SLAVE_QUP_0 0>;
        interconnect-names = "qup-core", "qup-config";
        ++status = "ok";
        };Copy to clipboard
2. Disable the `if` condition in the qcom\_geni\_serial.c at [https://github.com/torvalds/linux/blob/master/drivers/tty/serial/qcom_geni_serial.c](https://github.com/torvalds/linux/blob/master/drivers/tty/serial/qcom_geni_serial.c) file for the loopback
                        test.

        //if (mctrl & TIOCM_LOOP) // Disabling the if condition for loopback test
        port->loopback = RX_TX_CTS_RTS_SORTED;Copy to clipboard

To validate the QUP v3 UART registration functionality in the Linux kernel, ensure
                that the UART is correctly registered with the TTY stack.

1. Disable the UART default use case in [https://github.com/torvalds/linux/blob/master/arch/arm64/boot/dts/qcom/qcs6490-rb3gen2.dts](https://github.com/torvalds/linux/blob/master/arch/arm64/boot/dts/qcom/qcs6490-rb3gen2.dts).

        bluetooth: bluetooth {
        
               ++      status = "disabled";
        Copy to clipboard

The following output is
                        displayed.

        ls /dev/ttyHS1
        /dev/ttyHS1
        dmesg | grep ttyH
        [    3.355487] 99c000.serial: ttyHS1 at MMIO 0x99c000 (irq = 137, base_baud = 0) is a MSMCopy to clipboard
2. To verify the UART driver, do the following:
    1. Enter the SSH shell. For more information on how to operate SSH,
                                see [https://docs.qualcomm.com/bundle/publicresource/topics/80-70014-254/how_to.html#how-to-ssh-](https://docs.qualcomm.com/bundle/publicresource/topics/80-70014-254/how_to.html#how-to-ssh-).
    2. Register the
                                UART.

            ls /dev/ttyHSCopy to clipboard

The
                                following is a sample
                                output.

            /lib # ls /dev/ttyHS*
            /dev/ttyHS1
            Copy to clipboard

The `ttyHS1` port is mapped based on the
                                aliases added for the `serial1 = &uart7` and the
                                serial engine instance enabled.

The UART devices registered in the kernel are listed. The UART driver follows the
                test sequence to enable loopback.

After enabling the UART node on the DUT, run the following commands to verify the
                UART instance enabled in the DTSI file. 
Note: Open two shells
                    or terminals to write and read the data for the UART loopback.

1. Enter the SSH shell. For more information on how to operate SSH, see [https://docs.qualcomm.com/bundle/publicresource/topics/80-70014-254/how_to.html#how-to-ssh-](https://docs.qualcomm.com/bundle/publicresource/topics/80-70014-254/how_to.html#how-to-ssh-).
2. Transfer data with the `echo`
                        command.

        echo "This Document Is Very Much Helpful" > /dev/ttyHS1Copy to clipboard
3. Dump or read any data to the UART device
                        node.

        cat /dev/ttyHS1Copy to clipboard

## UART debugging

Source: [https://docs.qualcomm.com/doc/80-70014-8/topic/uart.html](https://docs.qualcomm.com/doc/80-70014-8/topic/uart.html)

This section provides information about enabling the debug logs in the UART software
            driver.

### Linux

UART driver logging is enabled through the dynamic debugging method. Enable
                    `CONFIG_DYNAMIC_DEBUG`
                    in &lt;workspace\_path\_of\_LINUX\_kernel\_image&gt;\sources\kernel
                    \kernel\_platform\kernel\arch\arm64/configs/qcom\_defconfig to support
                the dynamic debugging for kernel drivers.

To enable and view the UART driver logs in the kernel logs (`dmesg`),
                run the following
                command.

    mount -t debugfs none /sys/kernel/debug
    echo -n "file qcom_geni_serial.c +p" > /sys/kernel/debug/dynamic_debug/control
    echo -n "file qcom-geni-se.c +p" > /sys/kernel/debug/dynamic_debug/control
    echo -n "file serial_core.c +p" > /sys/kernel/debug/dynamic_debug/control
    echo -n "file gpi.c +p" > /sys/kernel/debug/dynamic_debug/control
    Copy to clipboard

## UART examples

Source: [https://docs.qualcomm.com/doc/80-70014-8/topic/uart.html](https://docs.qualcomm.com/doc/80-70014-8/topic/uart.html)

For information on the upstream device tree reference, see [https://git.linaro.org/kernel-org/linux-next.git/tree/arch/arm64/boot/dts/qcom/sc7280.dtsi](https://git.linaro.org/kernel-org/linux-next.git/tree/arch/arm64/boot/dts/qcom/sc7280.dtsi).

For information on the Qualcomm Linux chip product device-tree node, see [https://git.linaro.org/kernel-org/linux-next.git/tree/arch/arm64/boot/dts/qcom/qcs6490-rb3gen2.dts](https://git.linaro.org/kernel-org/linux-next.git/tree/arch/arm64/boot/dts/qcom/qcs6490-rb3gen2.dts).

Last Published: Jul 13, 2024

[Previous Topic
Getting started](https://docs.qualcomm.com/bundle/publicresource/80-70014-8/topics/get-started.md) [Next Topic
SPI](https://docs.qualcomm.com/bundle/publicresource/80-70014-8/topics/spi.md)