rcar_lvds_regs.h 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. /*
  2. * rcar_lvds_regs.h -- R-Car LVDS Interface Registers Definitions
  3. *
  4. * Copyright (C) 2013-2015 Renesas Electronics Corporation
  5. *
  6. * Contact: Laurent Pinchart (laurent.pinchart@ideasonboard.com)
  7. *
  8. * This program is free software; you can redistribute it and/or modify
  9. * it under the terms of the GNU General Public License version 2
  10. * as published by the Free Software Foundation.
  11. */
  12. #ifndef __RCAR_LVDS_REGS_H__
  13. #define __RCAR_LVDS_REGS_H__
  14. #define LVDCR0 0x0000
  15. #define LVDCR0_DUSEL (1 << 15)
  16. #define LVDCR0_DMD (1 << 12) /* Gen2 only */
  17. #define LVDCR0_LVMD_MASK (0xf << 8)
  18. #define LVDCR0_LVMD_SHIFT 8
  19. #define LVDCR0_PLLON (1 << 4)
  20. #define LVDCR0_PWD (1 << 2) /* Gen3 only */
  21. #define LVDCR0_BEN (1 << 2) /* Gen2 only */
  22. #define LVDCR0_LVEN (1 << 1) /* Gen2 only */
  23. #define LVDCR0_LVRES (1 << 0)
  24. #define LVDCR1 0x0004
  25. #define LVDCR1_CKSEL (1 << 15) /* Gen2 only */
  26. #define LVDCR1_CHSTBY_GEN2(n) (3 << (2 + (n) * 2)) /* Gen2 only */
  27. #define LVDCR1_CHSTBY_GEN3(n) (1 << (2 + (n) * 2)) /* Gen3 only */
  28. #define LVDCR1_CLKSTBY_GEN2 (3 << 0) /* Gen2 only */
  29. #define LVDCR1_CLKSTBY_GEN3 (1 << 0) /* Gen3 only */
  30. #define LVDPLLCR 0x0008
  31. #define LVDPLLCR_CEEN (1 << 14)
  32. #define LVDPLLCR_FBEN (1 << 13)
  33. #define LVDPLLCR_COSEL (1 << 12)
  34. /* Gen2 */
  35. #define LVDPLLCR_PLLDLYCNT_150M (0x1bf << 0)
  36. #define LVDPLLCR_PLLDLYCNT_121M (0x22c << 0)
  37. #define LVDPLLCR_PLLDLYCNT_60M (0x77b << 0)
  38. #define LVDPLLCR_PLLDLYCNT_38M (0x69a << 0)
  39. #define LVDPLLCR_PLLDLYCNT_MASK (0x7ff << 0)
  40. /* Gen3 */
  41. #define LVDPLLCR_PLLDIVCNT_42M (0x014cb << 0)
  42. #define LVDPLLCR_PLLDIVCNT_85M (0x00a45 << 0)
  43. #define LVDPLLCR_PLLDIVCNT_128M (0x006c3 << 0)
  44. #define LVDPLLCR_PLLDIVCNT_148M (0x046c1 << 0)
  45. #define LVDPLLCR_PLLDIVCNT_MASK (0x7ffff << 0)
  46. #define LVDCTRCR 0x000c
  47. #define LVDCTRCR_CTR3SEL_ZERO (0 << 12)
  48. #define LVDCTRCR_CTR3SEL_ODD (1 << 12)
  49. #define LVDCTRCR_CTR3SEL_CDE (2 << 12)
  50. #define LVDCTRCR_CTR3SEL_MASK (7 << 12)
  51. #define LVDCTRCR_CTR2SEL_DISP (0 << 8)
  52. #define LVDCTRCR_CTR2SEL_ODD (1 << 8)
  53. #define LVDCTRCR_CTR2SEL_CDE (2 << 8)
  54. #define LVDCTRCR_CTR2SEL_HSYNC (3 << 8)
  55. #define LVDCTRCR_CTR2SEL_VSYNC (4 << 8)
  56. #define LVDCTRCR_CTR2SEL_MASK (7 << 8)
  57. #define LVDCTRCR_CTR1SEL_VSYNC (0 << 4)
  58. #define LVDCTRCR_CTR1SEL_DISP (1 << 4)
  59. #define LVDCTRCR_CTR1SEL_ODD (2 << 4)
  60. #define LVDCTRCR_CTR1SEL_CDE (3 << 4)
  61. #define LVDCTRCR_CTR1SEL_HSYNC (4 << 4)
  62. #define LVDCTRCR_CTR1SEL_MASK (7 << 4)
  63. #define LVDCTRCR_CTR0SEL_HSYNC (0 << 0)
  64. #define LVDCTRCR_CTR0SEL_VSYNC (1 << 0)
  65. #define LVDCTRCR_CTR0SEL_DISP (2 << 0)
  66. #define LVDCTRCR_CTR0SEL_ODD (3 << 0)
  67. #define LVDCTRCR_CTR0SEL_CDE (4 << 0)
  68. #define LVDCTRCR_CTR0SEL_MASK (7 << 0)
  69. #define LVDCHCR 0x0010
  70. #define LVDCHCR_CHSEL_CH(n, c) ((((c) - (n)) & 3) << ((n) * 4))
  71. #define LVDCHCR_CHSEL_MASK(n) (3 << ((n) * 4))
  72. #endif /* __RCAR_LVDS_REGS_H__ */