AM3352: Sequence to disable a interface clock

Part Number: AM3352

Did not find description of how to disable a interface's clock.

I worked on UART1, it is initially enabled with register value is 0x02.  I write 0x0 to this register to disable it, returned value always is 0x10000, which means in transition, don't change to 0x30000.

There should be a operation sequency other than just setting disable bit in this register.

image.png

  • Hi,

    Are you developing on Processor SDK TI-RTOS? If yes, please read this: e2e.ti.com/.../notice-regarding-processor-sdk-ti-rtos-for-am335x-am437x-omap-l13x-c674x-k2g-amic110-amic120-devices

    Regards,

    Vaibhav

  • Hi Vaibhav,

    I want to manually disable one UART module clock to verify another issue. RTOS based code would be more readable, but I won't ask for that as it will be rejected and closed. 

    So I only need the operation steps description to do that, I can implement it by myself.

    Actually I checked AM335x Starterware and RTOS SDK, did not find such feature implementation to disable a module/interface clock.

  • Try the following Disable Sequence

    1. Ensure UART1 is idle before disabling:
      - TX FIFO and shift registers must be empty
      - RX FIFO must be empty
      - RX line must be idle [3]
    2. Changing control registers while the module is busy communicating will cause errors [4].
    3. Configure UART idle mode:
      1. Check `UART1.UART_SYSC[4:3]` IDLEMODE bits to ensure the module can acknowledge idle requests [3].
    4. Write MODULEMODE=0x0:
      1. CM_PER_UART1_CLKCTRL = 0x0;
    5. Poll IDLEST until it reaches 0x3
      1. while ((CM_PER_UART1_CLKCTRL & 0x30000) != 0x30000) {
        // Wait for transition to complete
        }
  • I think I followed up steps, except don't know how to check if RX line idle status, still keep in transition status. 

    Actually I just enabled UART1, did not connect it to external component, there is no data on data line.

    root@am335x-evm:~# dmesg |grep ttyS*
    [    0.000000] Kernel command line: root=PARTUUID=84550dbc-02 rootwait rw earlycon console=ttyO0,115200n8,115200
    [    0.034459] WARNING: Your 'console=ttyO0' has been replaced by 'ttyS0'
    [    1.619071] 48022000.serial: ttyS1 at MMIO 0x48022000 (irq = 18, base_baud = 3000000) is a 8250
    [    2.240622] 44e09000.serial: ttyS0 at MMIO 0x44e09000 (irq = 37, base_baud = 3000000) is a 8250
    [    2.258610] printk: console [ttyS0] enabled
    [    4.980157] systemd[1]: Created slice Slice /system/getty.
    [    5.064310] systemd[1]: Created slice Slice /system/serial-getty.
    root@am335x-evm:~# devmem2 0x48022054
    /dev/mem opened.
    Memory mapped at address 0xb6f36000.
    Read at address  0x48022054 (0xb6f36054): 0x00000009
    root@am335x-evm:~# devmem2 0x48022014
    /dev/mem opened.
    Memory mapped at address 0xb6ff7000.
    Read at address  0x48022014 (0xb6ff7014): 0x00000060
    root@am335x-evm:~# devmem2 0x44e0006c
    /dev/mem opened.
    Memory mapped at address 0xb6fd0000.
    Read at address  0x44E0006C (0xb6fd006c): 0x00000002
    root@am335x-evm:~# devmem2 0x44e0006c w 0
    /dev/mem opened.
    Memory mapped at address 0xb6f5e000.
    Read at address  0x44E0006C (0xb6f5e06c): 0x00000002
    Write at address 0x44E0006C (0xb6f5e06c): 0x00000000, readback 0x00000000
    root@am335x-evm:~# devmem2 0x44e0006c
    /dev/mem opened.
    Memory mapped at address 0xb6f04000.
    Read at address  0x44E0006C (0xb6f0406c): 0x00010000
    root@am335x-evm:~# 
    root@am335x-evm:~# devmem2 0x48022014
    /dev/mem opened.[ 1033.353309] 8<--- cut here ---
    [ 1033.357534] Unhandled fault: external abort on non-linefetch (0x1018) at 0xb6f78014
    [ 1033.365236] [b6f78014] *pgd=b133a831
    
    Memory mapped at address 0xb6f78000.
    Bus error (core dumped)
    root@am335x-evm:~# devmem2 0x48022054
    /dev/mem opened.[ 1058.553668] 8<--- cut here ---
    [ 1058.557871] Unhandled fault: external abort on non-linefetch (0x1018) at 0xb6f18054
    [ 1058.565578] [b6f18054] *pgd=bb811831
    
    Memory mapped at address 0xb6f18000.
    Bus error (core dumped)
    root@am335x-evm:~# 
    CTRL-A Z for help | 1
    

  • Hi Tony,

    Looking into this and will get back to you in sometime.

    Regards,

    Vaibhav

  • Hello,

    The subject matter expert is out of office until April 29th. Please expect a delayed response. Thank you.

  • Hi Tony,

    I want to manually disable one UART module clock to verify another issue.

    The clock management for AM335x is done by the clk drivers. I never looked into it to understand the clk enable/disable sequences, but if you just want to disable the clock for a UART, you can do so by unbinding the UART driver from the UART device in Linux sysfs.