ppc.h 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  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_8xx)
  14. #include <asm/8xx_immap.h>
  15. #endif
  16. #ifdef CONFIG_MPC86xx
  17. #include <mpc86xx.h>
  18. #include <asm/immap_86xx.h>
  19. #endif
  20. #ifdef CONFIG_MPC85xx
  21. #include <mpc85xx.h>
  22. #include <asm/immap_85xx.h>
  23. #endif
  24. #ifdef CONFIG_MPC83xx
  25. #include <mpc83xx.h>
  26. #include <asm/immap_83xx.h>
  27. #endif
  28. #ifdef CONFIG_SOC_DA8XX
  29. #include <asm/arch/hardware.h>
  30. #endif
  31. #ifdef CONFIG_FSL_LSCH3
  32. #include <asm/arch/immap_lsch3.h>
  33. #endif
  34. #ifdef CONFIG_FSL_LSCH2
  35. #include <asm/arch/immap_lsch2.h>
  36. #endif
  37. #if defined(CONFIG_8xx)
  38. uint get_immr(uint);
  39. #endif
  40. uint get_pvr(void);
  41. uint get_svr(void);
  42. uint rd_ic_cst(void);
  43. void wr_ic_cst(uint);
  44. void wr_ic_adr(uint);
  45. uint rd_dc_cst(void);
  46. void wr_dc_cst(uint);
  47. void wr_dc_adr(uint);
  48. #if defined(CONFIG_MPC85xx) || \
  49. defined(CONFIG_MPC86xx) || \
  50. defined(CONFIG_MPC83xx)
  51. unsigned char in8(unsigned int);
  52. void out8(unsigned int, unsigned char);
  53. unsigned short in16(unsigned int);
  54. unsigned short in16r(unsigned int);
  55. void out16(unsigned int, unsigned short value);
  56. void out16r(unsigned int, unsigned short value);
  57. unsigned long in32(unsigned int);
  58. unsigned long in32r(unsigned int);
  59. void out32(unsigned int, unsigned long value);
  60. void out32r(unsigned int, unsigned long value);
  61. void ppcDcbf(unsigned long value);
  62. void ppcDcbi(unsigned long value);
  63. void ppcSync(void);
  64. void ppcDcbz(unsigned long value);
  65. #endif
  66. #if defined(CONFIG_MPC83xx)
  67. void ppcDWload(unsigned int *addr, unsigned int *ret);
  68. void ppcDWstore(unsigned int *addr, unsigned int *value);
  69. void disable_addr_trans(void);
  70. void enable_addr_trans(void);
  71. #if defined(CONFIG_DDR_ECC) && !defined(CONFIG_ECC_INIT_VIA_DDRCONTROLLER)
  72. void ddr_enable_ecc(unsigned int dram_size);
  73. #endif
  74. #endif
  75. #if defined(CONFIG_MPC85xx)
  76. typedef MPC85xx_SYS_INFO sys_info_t;
  77. void get_sys_info(sys_info_t *);
  78. void ft_fixup_cpu(void *, u64);
  79. void ft_fixup_num_cores(void *);
  80. #endif
  81. #if defined(CONFIG_MPC86xx)
  82. ulong get_bus_freq(ulong);
  83. typedef MPC86xx_SYS_INFO sys_info_t;
  84. void get_sys_info(sys_info_t *);
  85. static inline ulong get_ddr_freq(ulong dummy)
  86. {
  87. return get_bus_freq(dummy);
  88. }
  89. #else
  90. ulong get_ddr_freq(ulong);
  91. #endif
  92. #endif /* !__ASSEMBLY__ */
  93. #ifdef CONFIG_PPC
  94. /*
  95. * Has to be included outside of the #ifndef __ASSEMBLY__ section.
  96. * Otherwise might lead to compilation errors in assembler files.
  97. */
  98. #include <asm/cache.h>
  99. #endif
  100. #endif