ppc.h 2.6 KB

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