I'm trying to get the DSI PLL to lock in U-Boot. I have tried to follow the steps in section 15.6.7.7.2 (including those leading into it in tables 15-96 and 15-97), but am unsuccessful.
My external oscillator is 26MHz. Printing out a few pertinent clock registers gives:
PRM_CLKSRC_CTRL = 0x00000080
PRM_CLKSEL = 0x00000003
CM_CLKSEL2_PLL = 0x0001b00c
CM_CLKEN_PLL = 0x00370037
CM_CLKSEL_DSS = 0x00001009
CM_AUTOIDLE_DSS = 0x00000000
CM_SLEEPDEP_DSS = 0x00000000
CM_CLKSTCTRL_DSS = 0x00000000
CM_FCLKEN_DSS = 0x00000007
CM_ICLKEN_DSS = 0x00000001
CM_IDLEST_DSS = 0x00000001
I believe this confirms the following (correct me if I'm wrong, please):
- SYS_CLK is at 13MHz
- DSS2_ALWON_FCLK is also 13MHz.
- Clocks are on to DSS to configure it.
Following Table 15-96 I reset DSI (which according to 15.5.5.1 also resets the DSI PLL), then wait for DSI to finish resetting (DSI_SYSSTATUS bit 0 goes to 1), then although Tabl 15-96 doesn't specify it, I wait for the DSI PLL to finish resetting (DSI_PLL_STATUS bit 0 goes to 1). By the way, after failing to get the DSI PLL to reset, I had to look at the Linux driver code to discover that in order for the DSI PLL to finish resetting, DISPC_CONTROL register bit 27 had to be set!
So now I think I should be ready to configure the DSI PLL, which I do as follows:
- DSI_CLK_CTRL = 0x80000000;
- Wait until DSI_CLK_CTRL[29:28] becomes 0x2.
- DSI_PLL_CONFIGURATION1 = 0x02a8ab0d - RegM4 = 5, RegM3 = 5, RegM = 171, RegN = 6, StopMode selected
- DSI_PLL_CONFIGURATION2 = 0x5600e - Exactly as from table 15-98
- DSI_PLL_CONTROL = 0x00000000 - Manual Mode
- DSI_PLL_GO = 0x1 -- Kick of the lock attempt
- Wait until DSI_PLL_GO bit 0 becomes 0 -- Lock state machine has finished
- Wait until locked: DSI_PLL_STATUS bit 1 becomes 1 -- but it never becomes 1
Things I have tried to coax it to lock, or at least confirm that it should lock:
- The Linux driver sets DSI_PLL_CONFIGURATION2 differently for locking, then switches to the above. I have tried their value, which would be 0x0010200e.
- The DSI_PLL_CONFIGURATION2[4:1].DSI_PLL_FREQSEL value of 0x7 is supposed to be valid for PLL reference clock between 1.75MHz and 2.1MHz. Using DSS2_ALWON_FLCK as 13MHz and RegN as 6, we have 13MHz/(6+1) = 1.857MHz, which is within tolerances.
- I have tried ranging RegN from 3 to 14 to see if the input clock was out of range, but that didn't succeed in getting it to lock.
- In Linux the above values for the configuration are known to work (have read them from /debug/omapdss/dsi and /debug/omapdss/clk).
Any idea what I might be missing or what I might have done wrong?
Any suggestions as to what to look at next?
Thanks
Chris