netripper

netripper

Mar 10th, 2010
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. // read clock freq from qsd8x50
  2.  
  3. unsigned get_freq(byte *pCsrBase, byte *pScpllBase)
  4. {
  5. unsigned freq, val, sel;
  6.  
  7. sel = readl(SPSS_CLK_SEL_ADDR(pCsrBase));
  8. switch ((sel & 6) >> 1)
  9. {
  10. case 1:
  11. val = readl(SCPLL_FSM_CTL_EXT_ADDR(pScpllBase));
  12. val = (val >> 3) & 0x3f;
  13. freq = val * 38400;
  14. return freq;
  15. break;
  16. case 2:
  17. return 128000;
  18. break;
  19. default:
  20. return -1;
  21. }
  22. }
Add Comment
Please, Sign In to add comment