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
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:
Hope this helps you.
Regards,
Israel.
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?
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
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.