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 #endif 23 #ifdef CONFIG_MPC86xx 24 #include <mpc86xx.h> 25 #include <asm/immap_86xx.h> 26 #endif 27 #ifdef CONFIG_MPC85xx 28 #include <mpc85xx.h> 29 #include <asm/immap_85xx.h> 30 #endif 31 #ifdef CONFIG_MPC83xx 32 #include <mpc83xx.h> 33 #include <asm/immap_83xx.h> 34 #endif 35 #ifdef CONFIG_4xx 36 #include <asm/ppc4xx.h> 37 #endif 38 #ifdef CONFIG_SOC_DA8XX 39 #include <asm/arch/hardware.h> 40 #endif 41 #ifdef CONFIG_FSL_LSCH3 42 #include <asm/arch/immap_lsch3.h> 43 #endif 44 #ifdef CONFIG_FSL_LSCH2 45 #include <asm/arch/immap_lsch2.h> 46 #endif 47 48 #if defined(CONFIG_5xx) 49 uint get_immr(uint); 50 #endif 51 #if defined(CONFIG_MPC5xxx) 52 uint get_svr(void); 53 #endif 54 uint get_pvr(void); 55 uint get_svr(void); 56 uint rd_ic_cst(void); 57 void wr_ic_cst(uint); 58 void wr_ic_adr(uint); 59 uint rd_dc_cst(void); 60 void wr_dc_cst(uint); 61 void wr_dc_adr(uint); 62 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 93 #if defined(CONFIG_MPC5xxx) 94 int prt_mpc5xxx_clks(void); 95 #endif 96 97 #if defined(CONFIG_MPC85xx) 98 typedef MPC85xx_SYS_INFO sys_info_t; 99 void get_sys_info(sys_info_t *); 100 void ft_fixup_cpu(void *, u64); 101 void ft_fixup_num_cores(void *); 102 #endif 103 #if defined(CONFIG_MPC86xx) 104 ulong get_bus_freq(ulong); 105 typedef MPC86xx_SYS_INFO sys_info_t; 106 void get_sys_info(sys_info_t *); 107 static inline ulong get_ddr_freq(ulong dummy) 108 { 109 return get_bus_freq(dummy); 110 } 111 #else 112 ulong get_ddr_freq(ulong); 113 #endif 114 115 #endif /* !__ASSEMBLY__ */ 116 117 #ifdef CONFIG_PPC 118 /* 119 * Has to be included outside of the #ifndef __ASSEMBLY__ section. 120 * Otherwise might lead to compilation errors in assembler files. 121 */ 122 #include <asm/cache.h> 123 #endif 124 125 #endif 126