xref: /openbmc/u-boot/arch/powerpc/include/asm/ppc.h (revision 7c1fb0a7)
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_8xx)
17 #include <asm/8xx_immap.h>
18 #if defined(CONFIG_MPC859) || defined(CONFIG_MPC859T) || \
19 	defined(CONFIG_MPC866) ||  defined(CONFIG_MPC866P)
20 # define CONFIG_MPC866_FAMILY 1
21 #elif defined(CONFIG_MPC885)
22 # define CONFIG_MPC885_FAMILY   1
23 #endif
24 #if defined(CONFIG_MPC860) || defined(CONFIG_MPC860T) || \
25 	defined(CONFIG_MPC866_FAMILY) || defined(CONFIG_MPC885_FAMILY)
26 # define CONFIG_MPC86x 1
27 #endif
28 #elif defined(CONFIG_5xx)
29 #include <asm/5xx_immap.h>
30 #elif defined(CONFIG_MPC5xxx)
31 #include <mpc5xxx.h>
32 #elif defined(CONFIG_MPC512X)
33 #include <asm/immap_512x.h>
34 #elif defined(CONFIG_MPC8260)
35 #if defined(CONFIG_MPC8247) || defined(CONFIG_MPC8272)
36 #define CONFIG_MPC8272_FAMILY	1
37 #endif
38 #include <asm/immap_8260.h>
39 #endif
40 #ifdef CONFIG_MPC86xx
41 #include <mpc86xx.h>
42 #include <asm/immap_86xx.h>
43 #endif
44 #ifdef CONFIG_MPC85xx
45 #include <mpc85xx.h>
46 #include <asm/immap_85xx.h>
47 #endif
48 #ifdef CONFIG_MPC83xx
49 #include <mpc83xx.h>
50 #include <asm/immap_83xx.h>
51 #endif
52 #ifdef	CONFIG_4xx
53 #include <asm/ppc4xx.h>
54 #endif
55 #ifdef CONFIG_SOC_DA8XX
56 #include <asm/arch/hardware.h>
57 #endif
58 #ifdef CONFIG_FSL_LSCH3
59 #include <asm/arch/immap_lsch3.h>
60 #endif
61 #ifdef CONFIG_FSL_LSCH2
62 #include <asm/arch/immap_lsch2.h>
63 #endif
64 
65 /*
66  * enable common handling for all TQM8xxL/M boards:
67  * - CONFIG_TQM8xxM will be defined for all TQM8xxM boards
68  * - CONFIG_TQM8xxL will be defined for all TQM8xxL _and_ TQM8xxM boards
69  *                  and for the TQM885D board
70  */
71 #if defined(CONFIG_TQM823M) || defined(CONFIG_TQM850M) || \
72 	defined(CONFIG_TQM855M) || defined(CONFIG_TQM860M) || \
73 	defined(CONFIG_TQM862M) || defined(CONFIG_TQM866M)
74 # ifndef CONFIG_TQM8xxM
75 #  define CONFIG_TQM8xxM
76 # endif
77 #endif
78 #if defined(CONFIG_TQM823L) || defined(CONFIG_TQM850L) || \
79 	defined(CONFIG_TQM855L) || defined(CONFIG_TQM860L) || \
80 	defined(CONFIG_TQM862L) || defined(CONFIG_TQM8xxM) || \
81 	defined(CONFIG_TQM885D)
82 # ifndef CONFIG_TQM8xxL
83 #  define CONFIG_TQM8xxL
84 # endif
85 #endif
86 
87 #if defined(CONFIG_5xx) || defined(CONFIG_8xx)
88 uint get_immr(uint);
89 #endif
90 #if defined(CONFIG_MPC5xxx)
91 uint get_svr(void);
92 #endif
93 uint get_pvr(void);
94 uint get_svr(void);
95 uint rd_ic_cst(void);
96 void wr_ic_cst(uint);
97 void wr_ic_adr(uint);
98 uint rd_dc_cst(void);
99 void wr_dc_cst(uint);
100 void wr_dc_adr(uint);
101 
102 #if defined(CONFIG_4xx)	|| \
103 	defined(CONFIG_MPC5xxx)	|| \
104 	defined(CONFIG_MPC85xx)	|| \
105 	defined(CONFIG_MPC86xx)	|| \
106 	defined(CONFIG_MPC83xx)
107 unsigned char	in8(unsigned int);
108 void		out8(unsigned int, unsigned char);
109 unsigned short	in16(unsigned int);
110 unsigned short	in16r(unsigned int);
111 void		out16(unsigned int, unsigned short value);
112 void		out16r(unsigned int, unsigned short value);
113 unsigned long	in32(unsigned int);
114 unsigned long	in32r(unsigned int);
115 void		out32(unsigned int, unsigned long value);
116 void		out32r(unsigned int, unsigned long value);
117 void		ppcDcbf(unsigned long value);
118 void		ppcDcbi(unsigned long value);
119 void		ppcSync(void);
120 void		ppcDcbz(unsigned long value);
121 #endif
122 #if defined(CONFIG_MPC83xx)
123 void		ppcDWload(unsigned int *addr, unsigned int *ret);
124 void		ppcDWstore(unsigned int *addr, unsigned int *value);
125 void disable_addr_trans(void);
126 void enable_addr_trans(void);
127 #if defined(CONFIG_DDR_ECC) && !defined(CONFIG_ECC_INIT_VIA_DDRCONTROLLER)
128 void ddr_enable_ecc(unsigned int dram_size);
129 #endif
130 #endif
131 
132 #if defined(CONFIG_MPC5xxx)
133 int	prt_mpc5xxx_clks(void);
134 #endif
135 
136 #if defined(CONFIG_MPC85xx)
137 typedef MPC85xx_SYS_INFO sys_info_t;
138 void get_sys_info(sys_info_t *);
139 void ft_fixup_cpu(void *, u64);
140 void ft_fixup_num_cores(void *);
141 #endif
142 #if defined(CONFIG_MPC86xx)
143 ulong get_bus_freq(ulong);
144 typedef MPC86xx_SYS_INFO sys_info_t;
145 void   get_sys_info(sys_info_t *);
146 static inline ulong get_ddr_freq(ulong dummy)
147 {
148 	return get_bus_freq(dummy);
149 }
150 #else
151 ulong get_ddr_freq(ulong);
152 #endif
153 
154 #endif /* !__ASSEMBLY__ */
155 
156 #ifdef CONFIG_PPC
157 /*
158  * Has to be included outside of the #ifndef __ASSEMBLY__ section.
159  * Otherwise might lead to compilation errors in assembler files.
160  */
161 #include <asm/cache.h>
162 #endif
163 
164 #endif
165