blob: 9a8afe1132235b8f28aef4fc949cac238d79ee65 [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
Christophe Leroy069fa832017-07-06 10:23:22 +020016#if defined(CONFIG_8xx)
17#include <asm/8xx_immap.h>
18#if defined(CONFIG_MPC866)
19# define CONFIG_MPC866_FAMILY 1
20#elif defined(CONFIG_MPC885)
21# define CONFIG_MPC885_FAMILY 1
22#endif
23#endif
Simon Glass76135792017-05-17 08:23:05 -060024#ifdef CONFIG_MPC86xx
25#include <mpc86xx.h>
26#include <asm/immap_86xx.h>
27#endif
28#ifdef CONFIG_MPC85xx
29#include <mpc85xx.h>
30#include <asm/immap_85xx.h>
31#endif
32#ifdef CONFIG_MPC83xx
33#include <mpc83xx.h>
34#include <asm/immap_83xx.h>
35#endif
Simon Glass76135792017-05-17 08:23:05 -060036#ifdef CONFIG_SOC_DA8XX
37#include <asm/arch/hardware.h>
38#endif
39#ifdef CONFIG_FSL_LSCH3
40#include <asm/arch/immap_lsch3.h>
41#endif
42#ifdef CONFIG_FSL_LSCH2
43#include <asm/arch/immap_lsch2.h>
44#endif
45
Christophe Leroy069fa832017-07-06 10:23:22 +020046#if defined(CONFIG_8xx)
47uint get_immr(uint);
48#endif
Simon Glass243182c2017-05-17 08:23:06 -060049uint get_pvr(void);
50uint get_svr(void);
51uint rd_ic_cst(void);
52void wr_ic_cst(uint);
53void wr_ic_adr(uint);
54uint rd_dc_cst(void);
55void wr_dc_cst(uint);
56void wr_dc_adr(uint);
57
Heiko Schocher20280122017-06-27 16:49:14 +020058#if defined(CONFIG_MPC85xx) || \
Simon Glass243182c2017-05-17 08:23:06 -060059 defined(CONFIG_MPC86xx) || \
60 defined(CONFIG_MPC83xx)
61unsigned char in8(unsigned int);
62void out8(unsigned int, unsigned char);
63unsigned short in16(unsigned int);
64unsigned short in16r(unsigned int);
65void out16(unsigned int, unsigned short value);
66void out16r(unsigned int, unsigned short value);
67unsigned long in32(unsigned int);
68unsigned long in32r(unsigned int);
69void out32(unsigned int, unsigned long value);
70void out32r(unsigned int, unsigned long value);
71void ppcDcbf(unsigned long value);
72void ppcDcbi(unsigned long value);
73void ppcSync(void);
74void ppcDcbz(unsigned long value);
75#endif
76#if defined(CONFIG_MPC83xx)
77void ppcDWload(unsigned int *addr, unsigned int *ret);
78void ppcDWstore(unsigned int *addr, unsigned int *value);
79void disable_addr_trans(void);
80void enable_addr_trans(void);
81#if defined(CONFIG_DDR_ECC) && !defined(CONFIG_ECC_INIT_VIA_DDRCONTROLLER)
82void ddr_enable_ecc(unsigned int dram_size);
83#endif
84#endif
85
Simon Glass243182c2017-05-17 08:23:06 -060086#if defined(CONFIG_MPC85xx)
87typedef MPC85xx_SYS_INFO sys_info_t;
88void get_sys_info(sys_info_t *);
89void ft_fixup_cpu(void *, u64);
90void ft_fixup_num_cores(void *);
91#endif
92#if defined(CONFIG_MPC86xx)
93ulong get_bus_freq(ulong);
94typedef MPC86xx_SYS_INFO sys_info_t;
95void get_sys_info(sys_info_t *);
96static inline ulong get_ddr_freq(ulong dummy)
97{
98 return get_bus_freq(dummy);
99}
100#else
101ulong get_ddr_freq(ulong);
102#endif
103
Simon Glass76135792017-05-17 08:23:05 -0600104#endif /* !__ASSEMBLY__ */
105
Simon Glass243182c2017-05-17 08:23:06 -0600106#ifdef CONFIG_PPC
107/*
108 * Has to be included outside of the #ifndef __ASSEMBLY__ section.
109 * Otherwise might lead to compilation errors in assembler files.
110 */
111#include <asm/cache.h>
112#endif
113
Simon Glass76135792017-05-17 08:23:05 -0600114#endif