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