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.

Linux/AM5728: UART register access error

Part Number: AM5728

Tool/software: Linux

On our custom board, we want to use uart6. the insmod modules is failed when we  configure the UART 0x48068000 register in modules.

We read the CM_IPU1_CLKSTCTRL \CM_IPU_CLKSTCTRL and CM_IPU_UART6_CLKCTRL, then write 2 to CM_IPU_UART6_CLKCTRL register to enable UART6 module, but the  UART6_CLKCTRL-IDLEST is always 3.

It seems the UART6 is not working. Does any else register  need to set before configure the CM_IPU_UART6_CLKCTRL? Thank you!

root@am57xx-evm:~# devmem2 0x4a005500                                           
/dev/mem opened.                                                                
Memory mapped at address 0xb6f06000.                                            
Read at address  0x4A005500 (0xb6f06500): 0x00000003                            
root@am57xx-evm:~# devmem2 0x4a005520                                           
/dev/mem opened.                                                                
Memory mapped at address 0xb6fce000.                                            
Read at address  0x4A005520 (0xb6fce520): 0x01070000                            
root@am57xx-evm:~# devmem2 0x4a005540                                           
/dev/mem opened.                                                                
Memory mapped at address 0xb6f59000.                                            
Read at address  0x4A005540 (0xb6f59540): 0x00000003                            
root@am57xx-evm:~# devmem2 0x4a005580                                           
/dev/mem opened.                                                                
Memory mapped at address 0xb6fcb000.                                            
Read at address  0x4A005580 (0xb6fcb580): 0x00030000                            
root@am57xx-evm:~# devmem2 0x4a005580 w 2                                       
/dev/mem opened.                                                                
Memory mapped at address 0xb6f97000.                                            
Read at address  0x4A005580 (0xb6f97580): 0x00030000                            
Write at address 0x4A005580 (0xb6f97580): 0x00000002, readback 0x00000002       
root@am57xx-evm:~# devmem2 0x4a005580                                           
/dev/mem opened.                                                                
Memory mapped at address 0xb6fa3000.                                            
Read at address  0x4A005580 (0xb6fa3580): 0x00030002

  • Hi,

    the insmod modules is failed when we configure the UART 0x48068000 register in modules.


    Can you share the debug output of this error? Also which Linux SDK are you using?

    What happens if you try to read/write to any of the uart registers, for example try: devmem2 0x48068000

    Best Regards,
    Yordan
  • the linux is:
    root@am57xx-evm:~# uname -a
    Linux am57xx-evm 4.4.41-rt50-g968d071ce9 #10 SMP PREEMPT RT Wed Jul 18 14:51:31 CST 2018 armv7l GNU/Linux
    when we read uart6 use devmem2 the message is:
    root@am57xx-evm:~# devmem2 0x48068000
    /dev/mem opened.
    Memory mapped at address 0xb6f52000.[ 76.567268] Unhandled fault: asynchronous external abort (0x1211) at 0x00000000
    [ 76.567271] pgd = dfd0d500
    [ 76.567273] ------------[ cut here ]------------
    [ 76.567287] [00000000] *pgd=9fd0f003, *pmd=fb8af003

    [ 76.591470] WARNING: CPU: 1 PID: 28 at drivers/bus/omap_l3_noc.c:147 l3_interrupt_handler+0x25c/0x36c()
    [ 76.601075] 44000000.ocp:L3 Custom Error: MASTER MPU TARGET L4_PER1_P3 (Read): Data Access in User mode during Functional access
    [ 76.612697] Modules linked in:Bus error (core dumped) arc4 rtl8192cu rtl_usb rtl8192c_common rtlwifi mac80211 cfg80211 xhci_plat_hcd xhci_)

    [ 76.673783] CPU: 1 PID: 28 Comm: irq/23-l3-app-i Tainted: G O 4.4.41-rt50-g968d071ce9 #10
    [ 76.673786] Hardware name: Generic DRA74X (Flattened Device Tree)
    [ 76.673791] Backtrace:
    [ 76.673807] [<c0013100>] (dump_backtrace) from [<c00132fc>] (show_stack+0x18/0x1c)
    [ 76.673817] r7:c02e7a0c r6:20080113 r5:00000000 r4:c093e2b4
    [ 76.673827] [<c00132e4>] (show_stack) from [<c02bb384>] (dump_stack+0x8c/0xa0)
    [ 76.673837] [<c02bb2f8>] (dump_stack) from [<c0034794>] (warn_slowpath_common+0x88/0xb8)
    [ 76.673845] r7:c02e7a0c r6:00000093 r5:00000009 r4:ee651e28
    [ 76.673854] [<c003470c>] (warn_slowpath_common) from [<c00347fc>] (warn_slowpath_fmt+0x38/0x40)
    [ 76.673862] r8:ee62e590 r7:c0828920 r6:00000002 r5:c08289e0 r4:c0828a84
    [ 76.673870] [<c00347c8>] (warn_slowpath_fmt) from [<c02e7a0c>] (l3_interrupt_handler+0x25c/0x36c)

    when we write 2 to CM_IPU_UART6_CLKCTRL register to enable UART6 module, but the read data always 0x00030002, UART6_CLKCTRL-IDLEST is always 3 that mean the module is disabled and cannot be accessed.

    we want to know how to chance the module state to '0' that is fully functional state?

    root@am57xx-evm:~# devmem2 0x4a005580 w 2
    /dev/mem opened.
    Memory mapped at address 0xb6f97000.
    Read at address 0x4A005580 (0xb6f97580): 0x00030000
    Write at address 0x4A005580 (0xb6f97580): 0x00000002, readback 0x00000002
    root@am57xx-evm:~# devmem2 0x4a005580
    /dev/mem opened.
    Memory mapped at address 0xb6fa3000.
    Read at address 0x4A005580 (0xb6fa3580): 0x00030002
  • Try enabling UART6 from the dts. That is add:
    &uart3 {
    status = "okay";
    }

    In arch/arm/boot/dts/am57xx-beagle-x15-common.dtsi.

    Best Regards,
    Yordan
  • hi,Yordan

            Thank you for the reply! we add the 'status = okey', it work well. we want to know , what register we should to configure that can enable the UART6 module? thank you !

  • In the Linux environment you really should not use register access to configure modules. It is the job of drivers to bridge between HW (Sitara) and SW (Linux). To configure or use something you should NOT be asking "How do I use X on a Sitara" but you should be asking "How do I use X in Linux?"

    To answer your question: 1) make sure you have uart6 pins defined in the device tree pinmux node 2) make sure nothing else is configured for the same pins 3) make sure to add the node as Yordan suggested:

    &uart6 {
    status = "okay";
    }

    No register access required.