This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

AM625: How to support 1.333 (1333000) MHz bps on UART5 in Linux

Part Number: AM625

Tool/software:

Hi, 

My project is using AM6251 SoC and we have to support baud rate 1333000 bps on UART5 from *Linux* kernel.  The Linux version is 11 and I think it should came from TI's SDK. I've found some forum articles talking about how to support 1333000 (1.333 MHz) bps, but thoese are for MCU + SDK not for Linux.

Per my understanding, a might working solution would be changing the UART5_CLK_CTRL from its default value /4 to /1, then the fclk feeding into the UART5 would become 192 MHz / 1 = 192 MHz instead of the default 48 MHz. With the new fclk = 192 MHz, using the divisor = 9 and mode = 16x, it should produce 192 MHz / 16 / 9 = 1.333 MHz.

But I have no idea how to archive this in Linux.  I checked the 8250_omap.c UART driver soruce code but have not found a clue conducting the Linux kernel, perhaps by adding some attributes in the device tree, to change the UART5_CLK_CTRL value.

Please be kindly to sort us out.

Kr,

woody

  • Hi Woody,

    I didn't test this, but adding the following devicetree change in the &main_uart5 node in your devicetree should set the uart5 fclk to 192MHz.

    &main_uart5 {
            ...
            assigned-clocks = <&k3_clks 156 0>;
            assigned-clock-parents = <&k3_clks 156 1>;
            assigned-clock-rates = <192000000>;
            ...
    };

  • Thanks Bin for your support. I'll be trying what you suggested DTS changes and report the result.  Here I want to understand a lit bit more, from what file (DTS or driver souce code) I can see/check the information about individual k3_clks like <156 0> and <156 1>? From the k3-am62p-main.dtsi, I see that the k3_clks was merely defined as:

    k3_clks: clock-controller {
    compatible = "ti,k2g-sci-clk";
    #clock-cells = <2>;
    bootph-all;
    };

    But no information tells what <156 0> and <156 1> means. How the magic happen?

    Thanks in advance!  

  • Hi Di,

    The kernel devicetree binding doc: Docmentation/devicetree/bindings/clock/ti,sci-clk.txt explains what those numbers are:

    - #clock-cells: Shall be 2.
      In clock consumers, this cell represents the device ID and clock ID exposed by the PM firmware.

    The device ID and clock ID for AM62x devices are listed in the link below.

    https://software-dl.ti.com/tisci/esd/latest/5_soc_doc/am62x/clocks.html