blob: 4d9af6c37ce56dbd40c413c2b2aac185bc06284e [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
Simon Glass76135792017-05-17 08:23:05 -060016#ifdef CONFIG_MPC86xx
17#include <mpc86xx.h>
18#include <asm/immap_86xx.h>
19#endif
20#ifdef CONFIG_MPC85xx
21#include <mpc85xx.h>
22#include <asm/immap_85xx.h>
23#endif
24#ifdef CONFIG_MPC83xx
25#include <mpc83xx.h>
26#include <asm/immap_83xx.h>
27#endif
28#ifdef CONFIG_4xx
29#include <asm/ppc4xx.h>
30#endif
31#ifdef CONFIG_SOC_DA8XX
32#include <asm/arch/hardware.h>
33#endif
34#ifdef CONFIG_FSL_LSCH3
35#include <asm/arch/immap_lsch3.h>
36#endif
37#ifdef CONFIG_FSL_LSCH2
38#include <asm/arch/immap_lsch2.h>
39#endif
40
Simon Glass243182c2017-05-17 08:23:06 -060041uint get_pvr(void);
42uint get_svr(void);
43uint rd_ic_cst(void);
44void wr_ic_cst(uint);
45void wr_ic_adr(uint);
46uint rd_dc_cst(void);
47void wr_dc_cst(uint);
48void wr_dc_adr(uint);
49
50#if defined(CONFIG_4xx) || \
Simon Glass243182c2017-05-17 08:23:06 -060051 defined(CONFIG_MPC85xx) || \
52 defined(CONFIG_MPC86xx) || \
53 defined(CONFIG_MPC83xx)
54unsigned char in8(unsigned int);
55void out8(unsigned int, unsigned char);
56unsigned short in16(unsigned int);
57unsigned short in16r(unsigned int);
58void out16(unsigned int, unsigned short value);
59void out16r(unsigned int, unsigned short value);
60unsigned long in32(unsigned int);
61unsigned long in32r(unsigned int);
62void out32(unsigned int, unsigned long value);
63void out32r(unsigned int, unsigned long value);
64void ppcDcbf(unsigned long value);
65void ppcDcbi(unsigned long value);
66void ppcSync(void);
67void ppcDcbz(unsigned long value);
68#endif
69#if defined(CONFIG_MPC83xx)
70void ppcDWload(unsigned int *addr, unsigned int *ret);
71void ppcDWstore(unsigned int *addr, unsigned int *value);
72void disable_addr_trans(void);
73void enable_addr_trans(void);
74#if defined(CONFIG_DDR_ECC) && !defined(CONFIG_ECC_INIT_VIA_DDRCONTROLLER)
75void ddr_enable_ecc(unsigned int dram_size);
76#endif
77#endif
78
Simon Glass243182c2017-05-17 08:23:06 -060079#if defined(CONFIG_MPC85xx)
80typedef MPC85xx_SYS_INFO sys_info_t;
81void get_sys_info(sys_info_t *);
82void ft_fixup_cpu(void *, u64);
83void ft_fixup_num_cores(void *);
84#endif
85#if defined(CONFIG_MPC86xx)
86ulong get_bus_freq(ulong);
87typedef MPC86xx_SYS_INFO sys_info_t;
88void get_sys_info(sys_info_t *);
89static inline ulong get_ddr_freq(ulong dummy)
90{
91 return get_bus_freq(dummy);
92}
93#else
94ulong get_ddr_freq(ulong);
95#endif
96
Simon Glass76135792017-05-17 08:23:05 -060097#endif /* !__ASSEMBLY__ */
98
Simon Glass243182c2017-05-17 08:23:06 -060099#ifdef CONFIG_PPC
100/*
101 * Has to be included outside of the #ifndef __ASSEMBLY__ section.
102 * Otherwise might lead to compilation errors in assembler files.
103 */
104#include <asm/cache.h>
105#endif
106
Simon Glass76135792017-05-17 08:23:05 -0600107#endif