system.h 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. /* SPDX-License-Identifier: GPL-2.0+ */
  2. /*
  3. * (C) Copyright 2012 Samsung Electronics
  4. * Donghwa Lee <dh09.lee@samsung.com>
  5. */
  6. #ifndef __ASM_ARM_ARCH_SYSTEM_H_
  7. #define __ASM_ARM_ARCH_SYSTEM_H_
  8. #ifndef __ASSEMBLY__
  9. struct exynos4_sysreg {
  10. unsigned char res1[0x210];
  11. unsigned int display_ctrl;
  12. unsigned int display_ctrl2;
  13. unsigned int camera_control;
  14. unsigned int audio_endian;
  15. unsigned int jtag_con;
  16. };
  17. struct exynos5_sysreg {
  18. unsigned char res1[0x214];
  19. unsigned int disp1blk_cfg;
  20. unsigned int disp2blk_cfg;
  21. unsigned int hdcp_e_fuse;
  22. unsigned int gsclblk_cfg0;
  23. unsigned int gsclblk_cfg1;
  24. unsigned int reserved;
  25. unsigned int ispblk_cfg;
  26. unsigned int usb20phy_cfg;
  27. unsigned char res2[0x29c];
  28. unsigned int mipi_dphy;
  29. unsigned int dptx_dphy;
  30. unsigned int phyclk_sel;
  31. };
  32. #endif
  33. #define USB20_PHY_CFG_HOST_LINK_EN (1 << 0)
  34. /*
  35. * This instruction causes an event to be signaled to all cores
  36. * within a multiprocessor system. If SEV is implemented,
  37. * WFE must also be implemented.
  38. */
  39. #define sev() __asm__ __volatile__ ("sev\n\t" : : );
  40. /*
  41. * If the Event Register is not set, WFE suspends execution until
  42. * one of the following events occurs:
  43. * - an IRQ interrupt, unless masked by the CPSR I-bit
  44. * - an FIQ interrupt, unless masked by the CPSR F-bit
  45. * - an Imprecise Data abort, unless masked by the CPSR A-bit
  46. * - a Debug Entry request, if Debug is enabled
  47. * - an Event signaled by another processor using the SEV instruction.
  48. * If the Event Register is set, WFE clears it and returns immediately.
  49. * If WFE is implemented, SEV must also be implemented.
  50. */
  51. #define wfe() __asm__ __volatile__ ("wfe\n\t" : : );
  52. /* Move 0xd3 value to CPSR register to enable SVC mode */
  53. #define svc32_mode_en() __asm__ __volatile__ \
  54. ("@ I&F disable, Mode: 0x13 - SVC\n\t" \
  55. "msr cpsr_c, #0x13|0xC0\n\t" : : )
  56. /* Set program counter with the given value */
  57. #define set_pc(x) __asm__ __volatile__ ("mov pc, %0\n\t" : : "r"(x))
  58. /* Branch to the given location */
  59. #define branch_bx(x) __asm__ __volatile__ ("bx %0\n\t" : : "r"(x))
  60. /* Read Main Id register */
  61. #define mrc_midr(x) __asm__ __volatile__ \
  62. ("mrc p15, 0, %0, c0, c0, 0\n\t" : "=r"(x) : )
  63. /* Read Multiprocessor Affinity Register */
  64. #define mrc_mpafr(x) __asm__ __volatile__ \
  65. ("mrc p15, 0, %0, c0, c0, 5\n\t" : "=r"(x) : )
  66. /* Read System Control Register */
  67. #define mrc_sctlr(x) __asm__ __volatile__ \
  68. ("mrc p15, 0, %0, c1, c0, 0\n\t" : "=r"(x) : )
  69. /* Read Auxiliary Control Register */
  70. #define mrc_auxr(x) __asm__ __volatile__ \
  71. ("mrc p15, 0, %0, c1, c0, 1\n\t" : "=r"(x) : )
  72. /* Read L2 Control register */
  73. #define mrc_l2_ctlr(x) __asm__ __volatile__ \
  74. ("mrc p15, 1, %0, c9, c0, 2\n\t" : "=r"(x) : )
  75. /* Read L2 Auxilliary Control register */
  76. #define mrc_l2_aux_ctlr(x) __asm__ __volatile__ \
  77. ("mrc p15, 1, %0, c15, c0, 0\n\t" : "=r"(x) : )
  78. /* Write System Control Register */
  79. #define mcr_sctlr(x) __asm__ __volatile__ \
  80. ("mcr p15, 0, %0, c1, c0, 0\n\t" : : "r"(x))
  81. /* Write Auxiliary Control Register */
  82. #define mcr_auxr(x) __asm__ __volatile__ \
  83. ("mcr p15, 0, %0, c1, c0, 1\n\t" : : "r"(x))
  84. /* Invalidate all instruction caches to PoU */
  85. #define mcr_icache(x) __asm__ __volatile__ \
  86. ("mcr p15, 0, %0, c7, c5, 0\n\t" : : "r"(x))
  87. /* Invalidate unified TLB */
  88. #define mcr_tlb(x) __asm__ __volatile__ \
  89. ("mcr p15, 0, %0, c8, c7, 0\n\t" : : "r"(x))
  90. /* Write L2 Control register */
  91. #define mcr_l2_ctlr(x) __asm__ __volatile__ \
  92. ("mcr p15, 1, %0, c9, c0, 2\n\t" : : "r"(x))
  93. /* Write L2 Auxilliary Control register */
  94. #define mcr_l2_aux_ctlr(x) __asm__ __volatile__ \
  95. ("mcr p15, 1, %0, c15, c0, 0\n\t" : : "r"(x))
  96. void set_usbhost_mode(unsigned int mode);
  97. void set_system_display_ctrl(void);
  98. int exynos_lcd_early_init(const void *blob);
  99. #endif /* _EXYNOS4_SYSTEM_H */