iMX8M set serial baudrate in Linux

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

iMX8M set serial baudrate in Linux

2,190件の閲覧回数
gavinl
Contributor I

We would like to take advantage of the high baudrate that iMX8M supports in Linux. What I found out is the stty can only set baudrate to 921600 (stty -F /dev/ttymxc0 921600), it can't set any baudrate higher than it.
I tried to use devmem to directly set /dev/ttymxc0, but the write value doesn't match the read back value. Please help give me a clue. Thanks

echo "devmem write/read to verify"
devmem 0x30860080 32 1
devmem 0x30860084 32 0x4127
devmem 0x3086008c 32 0x7c00
devmem 0x30860090 32 0xa9e
devmem 0x308600a4 32 3
devmem 0x308600a8 32 4
devmem 0x30860080 32 0x2001
devmem 0x308600b8 32 0xa50b
echo "----------"
devmem 0x30860080
devmem 0x30860084
devmem 0x3086008c
devmem 0x30860090
devmem 0x308600a4
devmem 0x308600a8
devmem 0x30860080
devmem 0x308600b8

0 件の賞賛
4 返答(返信)

2,157件の閲覧回数
nxf63675
NXP TechSupport
NXP TechSupport

Hi Gavinl,


Modify the baud rate from userspace is not possible, this need to be modifying on the kernel from the core code, you may find helpful the next post:

https://community.nxp.com/t5/i-MX-Processors-Knowledge-Base/Building-Linux-Kernel/ta-p/1110576#toc-h...


Hope this helps you.

Regards,

Israel.

0 件の賞賛

2,152件の閲覧回数
gavinl
Contributor I

I know I can change it in kernel space, but don't understand why can't I modified NXP registers in userspace, I can do it in the ARM production from other companies. What makes NXP products can't be modified in userspace?

0 件の賞賛

2,177件の閲覧回数
gavinl
Contributor I

Found the supported baudrate in drivers/tty/tty_baudrate.c

static const speed_t baud_table[] = {
	0, 50, 75, 110, 134, 150, 200, 300, 600, 1200, 1800, 2400,
	4800, 9600, 19200, 38400, 57600, 115200, 230400, 460800,
#ifdef __sparc__
	76800, 153600, 307200, 614400, 921600, 500000, 576000,
	1000000, 1152000, 1500000, 2000000
#else
	500000, 576000, 921600, 1000000, 1152000, 1500000, 2000000,
	2500000, 3000000, 3500000, 4000000
#endif
};

But still don't understand why devmem can't write to memory mapped registers

0 件の賞賛

2,185件の閲覧回数
gavinl
Contributor I

with stty -F /dev/ttymxc0 the_baudrate, I can use devmem to verify the UBIR and UBMR registers are programmed.
Don't know why devmem can't write to those registers, I even write a Linux user side program to write memory mapped registers and I can't write to those registers also.
Is there anyone know the reason? I have my program attached.

0 件の賞賛