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.

AM335x GPIO1 clock enable fails

Hi,

 We met one issue on AM335X: Fail to enable GPIO1 clock.

The code logic is as following:

Read CM_PER_GPIO1_CLKCTRL Register ---> Set CM_PER_GPIO1_CLKCTRL .MODULEMODE = 2;

-->Wait time out, Check if CM_PER_GPIO1_CLKCTRL .IDLEST = 0;

When issue happen, CM_PER_GPIO1_CLKCTRL .IDLEST is not 0.

Could you help to check why it will fail to enable GPIO1 clock?   Any condition will have this fail? Is there any special setting to set?

//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

    UINT32   timeout = 2000000;
        volatile unsigned int *pmodulemode;
        UINT32 val = 0;
        
        pmodulemode = (volatile unsigned int*)((UCHAR*)g_pPrcmRegs +
                                      s_rgDeviceLookupTable[devId].CLKCTRL_REG);
        val = ((INREG32(pmodulemode) & ~ClKCTRL_MODULEMODE_MASK) |
               ((bEnable)? ClKCTRL_MODULEMODE_EN : ClKCTRL_MODULEMODE_DIS));
        OUTREG32(pmodulemode, val);
        if (bEnable){
            while((timeout) && (INREG32(pmodulemode) & ClKCTRL_IDLEST_DIS))
                timeout--;
            if (timeout == 0)
                OALMSG(1,(L"_PrcmHwEnableModuleClocks: CANNOT enable clock for devId=%d\r\n", devId));
        }

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

Error: _PrcmHwEnableModuleClocks: CANNOT enable clock for devId=26(GPIO1)

Rose