icst.h 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. /*
  2. * Copyright (C) 2003 Deep Blue Solutions, Ltd, All Rights Reserved.
  3. *
  4. * This program is free software; you can redistribute it and/or modify
  5. * it under the terms of the GNU General Public License version 2 as
  6. * published by the Free Software Foundation.
  7. *
  8. * Support functions for calculating clocks/divisors for the ICST
  9. * clock generators. See http://www.idt.com/ for more information
  10. * on these devices.
  11. */
  12. #ifndef ICST_H
  13. #define ICST_H
  14. struct icst_params {
  15. unsigned long ref;
  16. unsigned long vco_max; /* inclusive */
  17. unsigned long vco_min; /* exclusive */
  18. unsigned short vd_min; /* inclusive */
  19. unsigned short vd_max; /* inclusive */
  20. unsigned char rd_min; /* inclusive */
  21. unsigned char rd_max; /* inclusive */
  22. const unsigned char *s2div; /* chip specific s2div array */
  23. const unsigned char *idx2s; /* chip specific idx2s array */
  24. };
  25. struct icst_vco {
  26. unsigned short v;
  27. unsigned char r;
  28. unsigned char s;
  29. };
  30. unsigned long icst_hz(const struct icst_params *p, struct icst_vco vco);
  31. struct icst_vco icst_hz_to_vco(const struct icst_params *p, unsigned long freq);
  32. /*
  33. * ICST307 VCO frequency must be between 6MHz and 200MHz (3.3 or 5V).
  34. * This frequency is pre-output divider.
  35. */
  36. #define ICST307_VCO_MIN 6000000
  37. #define ICST307_VCO_MAX 200000000
  38. extern const unsigned char icst307_s2div[];
  39. extern const unsigned char icst307_idx2s[];
  40. /*
  41. * ICST525 VCO frequency must be between 10MHz and 200MHz (3V) or 320MHz (5V).
  42. * This frequency is pre-output divider.
  43. */
  44. #define ICST525_VCO_MIN 10000000
  45. #define ICST525_VCO_MAX_3V 200000000
  46. #define ICST525_VCO_MAX_5V 320000000
  47. extern const unsigned char icst525_s2div[];
  48. extern const unsigned char icst525_idx2s[];
  49. #endif