I need to use higher data rate for my current projects (at least 1Mbps), but I run into limitation of 500 000kbs for ttymxc2. I believe that this is because the UART clock setting in Linux is 8 000 000, I can see this in /sys/class/tty/ttymxc2/uartclk. How can I modify this setting? Can I do that somehow through device tree or is this somewhere hard coded inside kernel sources?
Thanks for any help,
Which hardware (carrier board) and software version are you using? Are you using an official bsp of toradex or self compiled one?
I’m using self compiled one from Toradex repository “toradex_4.9-1.0.x-imx” and Toradex Iris carrier board.
i tried the 2.7b4 20171004 (kernel 4.1.44) and could set up a speed of 921600. What did you change when you compiled the toradex_4.9-1.0.x-imx branch?
I didn’t change anything, could you please look into /sys/class/tty/ttymxcX/uartclk what is the value?
Also, how did you try that? If I use “stty” I get this error:
# stty -F /dev/ttymxc2 921600
stty: /dev/ttymxc2: cannot perform all requested operations
460800bps work correctly
cat /sys/class/tty/ttymxc2/uartclk gave this value
I set up the the speed with the following command
stty -F /dev/ttymxc2 921600 and if check with i get this answer: speed 921600 baud; line = 0.
Can you use the 4.1-2.0 kernel since the new bsp is not official yet?
Thank you for your help so far. I did some testing with 2.7b4 and 921600 really works fine and value in uartclk is also 80 000 000. Than I tried again my self compiled “toradex_4.9-1.0.x-imx” and I found that the value in uartclk file is 8 000 000 (10 times lower) than in 2.7b4, do you have any idea how that could be possible? Do you know from where is coming this value?
The NXP L4.9.11 i.MX 7 BSP indeed hard codes some UART clocks differently then the old BSP. Apparently the configuration through device tree caused issues when using earlycon/earlyprintk. However, since Toradex only uses the first UART as serial console, the hard coded clock configuration for UART3/5/6 is not required.
I pushed two patches to our -next git tree which revert the commits and should configure the clock according to device tree again.