ddk750_chip.h 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. #ifndef DDK750_CHIP_H__
  2. #define DDK750_CHIP_H__
  3. #define DEFAULT_INPUT_CLOCK 14318181 /* Default reference clock */
  4. #ifndef SM750LE_REVISION_ID
  5. #define SM750LE_REVISION_ID ((unsigned char)0xfe)
  6. #endif
  7. #include <linux/io.h>
  8. /* This is all the chips recognized by this library */
  9. typedef enum _logical_chip_type_t {
  10. SM_UNKNOWN,
  11. SM718,
  12. SM750,
  13. SM750LE,
  14. }
  15. logical_chip_type_t;
  16. typedef enum _clock_type_t {
  17. MXCLK_PLL,
  18. PRIMARY_PLL,
  19. SECONDARY_PLL,
  20. VGA0_PLL,
  21. VGA1_PLL,
  22. }
  23. clock_type_t;
  24. typedef struct _pll_value_t {
  25. clock_type_t clockType;
  26. unsigned long inputFreq; /* Input clock frequency to the PLL */
  27. /* Use this when clockType = PANEL_PLL */
  28. unsigned long M;
  29. unsigned long N;
  30. unsigned long OD;
  31. unsigned long POD;
  32. }
  33. pll_value_t;
  34. /* input struct to initChipParam() function */
  35. typedef struct _initchip_param_t {
  36. unsigned short powerMode; /* Use power mode 0 or 1 */
  37. unsigned short chipClock; /**
  38. * Speed of main chip clock in MHz unit
  39. * 0 = keep the current clock setting
  40. * Others = the new main chip clock
  41. */
  42. unsigned short memClock; /**
  43. * Speed of memory clock in MHz unit
  44. * 0 = keep the current clock setting
  45. * Others = the new memory clock
  46. */
  47. unsigned short masterClock; /**
  48. * Speed of master clock in MHz unit
  49. * 0 = keep the current clock setting
  50. * Others = the new master clock
  51. */
  52. unsigned short setAllEngOff; /**
  53. * 0 = leave all engine state untouched.
  54. * 1 = make sure they are off: 2D, Overlay,
  55. * video alpha, alpha, hardware cursors
  56. */
  57. unsigned char resetMemory; /**
  58. * 0 = Do not reset the memory controller
  59. * 1 = Reset the memory controller
  60. */
  61. /* More initialization parameter can be added if needed */
  62. }
  63. initchip_param_t;
  64. logical_chip_type_t getChipType(void);
  65. unsigned int calcPllValue(unsigned int request, pll_value_t *pll);
  66. unsigned int formatPllReg(pll_value_t *pPLL);
  67. void ddk750_set_mmio(void __iomem *, unsigned short, char);
  68. unsigned int ddk750_getVMSize(void);
  69. int ddk750_initHw(initchip_param_t *);
  70. #endif