blob: 4e1c5965e42cedd66118c7828e391d762220c35c [file] [log] [blame]
Simon Glass76135792017-05-17 08:23:05 -06001/*
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
Simon Glass243182c2017-05-17 08:23:06 -060065/*
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)
88uint get_immr(uint);
89#endif
90#if defined(CONFIG_MPC5xxx)
91uint get_svr(void);
92#endif
93uint get_pvr(void);
94uint get_svr(void);
95uint rd_ic_cst(void);
96void wr_ic_cst(uint);
97void wr_ic_adr(uint);
98uint rd_dc_cst(void);
99void wr_dc_cst(uint);
100void 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)
107unsigned char in8(unsigned int);
108void out8(unsigned int, unsigned char);
109unsigned short in16(unsigned int);
110unsigned short in16r(unsigned int);
111void out16(unsigned int, unsigned short value);
112void out16r(unsigned int, unsigned short value);
113unsigned long in32(unsigned int);
114unsigned long in32r(unsigned int);
115void out32(unsigned int, unsigned long value);
116void out32r(unsigned int, unsigned long value);
117void ppcDcbf(unsigned long value);
118void ppcDcbi(unsigned long value);
119void ppcSync(void);
120void ppcDcbz(unsigned long value);
121#endif
122#if defined(CONFIG_MPC83xx)
123void ppcDWload(unsigned int *addr, unsigned int *ret);
124void ppcDWstore(unsigned int *addr, unsigned int *value);
125void disable_addr_trans(void);
126void enable_addr_trans(void);
127#if defined(CONFIG_DDR_ECC) && !defined(CONFIG_ECC_INIT_VIA_DDRCONTROLLER)
128void ddr_enable_ecc(unsigned int dram_size);
129#endif
130#endif
131
132#if defined(CONFIG_MPC5xxx)
133int prt_mpc5xxx_clks(void);
134#endif
135
136#if defined(CONFIG_MPC85xx)
137typedef MPC85xx_SYS_INFO sys_info_t;
138void get_sys_info(sys_info_t *);
139void ft_fixup_cpu(void *, u64);
140void ft_fixup_num_cores(void *);
141#endif
142#if defined(CONFIG_MPC86xx)
143ulong get_bus_freq(ulong);
144typedef MPC86xx_SYS_INFO sys_info_t;
145void get_sys_info(sys_info_t *);
146static inline ulong get_ddr_freq(ulong dummy)
147{
148 return get_bus_freq(dummy);
149}
150#else
151ulong get_ddr_freq(ulong);
152#endif
153
Simon Glass76135792017-05-17 08:23:05 -0600154#endif /* !__ASSEMBLY__ */
155
Simon Glass243182c2017-05-17 08:23:06 -0600156#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
Simon Glass76135792017-05-17 08:23:05 -0600164#endif