ppc.h 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. /*
  2. * Ugly header containing required header files. This could be adjusted
  3. * so that including asm/arch/hardware includes the correct file.
  4. *
  5. * (C) Copyright 2000-2009
  6. * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
  7. *
  8. * SPDX-License-Identifier: GPL-2.0+
  9. */
  10. #ifndef __ASM_PPC_H
  11. #define __ASM_PPC_H
  12. #ifndef __ASSEMBLY__
  13. #if defined(CONFIG_5xx)
  14. #include <asm/5xx_immap.h>
  15. #elif defined(CONFIG_MPC5xxx)
  16. #include <mpc5xxx.h>
  17. #elif defined(CONFIG_MPC512X)
  18. #include <asm/immap_512x.h>
  19. #elif defined(CONFIG_MPC8260)
  20. #if defined(CONFIG_MPC8247) || defined(CONFIG_MPC8272)
  21. #define CONFIG_MPC8272_FAMILY 1
  22. #endif
  23. #include <asm/immap_8260.h>
  24. #endif
  25. #ifdef CONFIG_MPC86xx
  26. #include <mpc86xx.h>
  27. #include <asm/immap_86xx.h>
  28. #endif
  29. #ifdef CONFIG_MPC85xx
  30. #include <mpc85xx.h>
  31. #include <asm/immap_85xx.h>
  32. #endif
  33. #ifdef CONFIG_MPC83xx
  34. #include <mpc83xx.h>
  35. #include <asm/immap_83xx.h>
  36. #endif
  37. #ifdef CONFIG_4xx
  38. #include <asm/ppc4xx.h>
  39. #endif
  40. #ifdef CONFIG_SOC_DA8XX
  41. #include <asm/arch/hardware.h>
  42. #endif
  43. #ifdef CONFIG_FSL_LSCH3
  44. #include <asm/arch/immap_lsch3.h>
  45. #endif
  46. #ifdef CONFIG_FSL_LSCH2
  47. #include <asm/arch/immap_lsch2.h>
  48. #endif
  49. #if defined(CONFIG_5xx)
  50. uint get_immr(uint);
  51. #endif
  52. #if defined(CONFIG_MPC5xxx)
  53. uint get_svr(void);
  54. #endif
  55. uint get_pvr(void);
  56. uint get_svr(void);
  57. uint rd_ic_cst(void);
  58. void wr_ic_cst(uint);
  59. void wr_ic_adr(uint);
  60. uint rd_dc_cst(void);
  61. void wr_dc_cst(uint);
  62. void wr_dc_adr(uint);
  63. #if defined(CONFIG_4xx) || \
  64. defined(CONFIG_MPC5xxx) || \
  65. defined(CONFIG_MPC85xx) || \
  66. defined(CONFIG_MPC86xx) || \
  67. defined(CONFIG_MPC83xx)
  68. unsigned char in8(unsigned int);
  69. void out8(unsigned int, unsigned char);
  70. unsigned short in16(unsigned int);
  71. unsigned short in16r(unsigned int);
  72. void out16(unsigned int, unsigned short value);
  73. void out16r(unsigned int, unsigned short value);
  74. unsigned long in32(unsigned int);
  75. unsigned long in32r(unsigned int);
  76. void out32(unsigned int, unsigned long value);
  77. void out32r(unsigned int, unsigned long value);
  78. void ppcDcbf(unsigned long value);
  79. void ppcDcbi(unsigned long value);
  80. void ppcSync(void);
  81. void ppcDcbz(unsigned long value);
  82. #endif
  83. #if defined(CONFIG_MPC83xx)
  84. void ppcDWload(unsigned int *addr, unsigned int *ret);
  85. void ppcDWstore(unsigned int *addr, unsigned int *value);
  86. void disable_addr_trans(void);
  87. void enable_addr_trans(void);
  88. #if defined(CONFIG_DDR_ECC) && !defined(CONFIG_ECC_INIT_VIA_DDRCONTROLLER)
  89. void ddr_enable_ecc(unsigned int dram_size);
  90. #endif
  91. #endif
  92. #if defined(CONFIG_MPC5xxx)
  93. int prt_mpc5xxx_clks(void);
  94. #endif
  95. #if defined(CONFIG_MPC85xx)
  96. typedef MPC85xx_SYS_INFO sys_info_t;
  97. void get_sys_info(sys_info_t *);
  98. void ft_fixup_cpu(void *, u64);
  99. void ft_fixup_num_cores(void *);
  100. #endif
  101. #if defined(CONFIG_MPC86xx)
  102. ulong get_bus_freq(ulong);
  103. typedef MPC86xx_SYS_INFO sys_info_t;
  104. void get_sys_info(sys_info_t *);
  105. static inline ulong get_ddr_freq(ulong dummy)
  106. {
  107. return get_bus_freq(dummy);
  108. }
  109. #else
  110. ulong get_ddr_freq(ulong);
  111. #endif
  112. #endif /* !__ASSEMBLY__ */
  113. #ifdef CONFIG_PPC
  114. /*
  115. * Has to be included outside of the #ifndef __ASSEMBLY__ section.
  116. * Otherwise might lead to compilation errors in assembler files.
  117. */
  118. #include <asm/cache.h>
  119. #endif
  120. #endif