xref: /rk3399_rockchip-uboot/arch/powerpc/include/asm/global_data.h (revision 2ab575e05d715a1b9818b4a1f6a9d7ccb5bdb32a)
1a47a12beSStefan Roese /*
291a76751SWolfgang Denk  * (C) Copyright 2002-2010
3a47a12beSStefan Roese  * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
4a47a12beSStefan Roese  *
5a47a12beSStefan Roese  * See file CREDITS for list of people who contributed to this
6a47a12beSStefan Roese  * project.
7a47a12beSStefan Roese  *
8a47a12beSStefan Roese  * This program is free software; you can redistribute it and/or
9a47a12beSStefan Roese  * modify it under the terms of the GNU General Public License as
10a47a12beSStefan Roese  * published by the Free Software Foundation; either version 2 of
11a47a12beSStefan Roese  * the License, or (at your option) any later version.
12a47a12beSStefan Roese  *
13a47a12beSStefan Roese  * This program is distributed in the hope that it will be useful,
14a47a12beSStefan Roese  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15a47a12beSStefan Roese  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16a47a12beSStefan Roese  * GNU General Public License for more details.
17a47a12beSStefan Roese  *
18a47a12beSStefan Roese  * You should have received a copy of the GNU General Public License
19a47a12beSStefan Roese  * along with this program; if not, write to the Free Software
20a47a12beSStefan Roese  * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
21a47a12beSStefan Roese  * MA 02111-1307 USA
22a47a12beSStefan Roese  */
23a47a12beSStefan Roese 
24a47a12beSStefan Roese #ifndef	__ASM_GBL_DATA_H
25a47a12beSStefan Roese #define __ASM_GBL_DATA_H
26a47a12beSStefan Roese 
27a47a12beSStefan Roese #include "config.h"
28a47a12beSStefan Roese #include "asm/types.h"
29a47a12beSStefan Roese 
305cb48582SSimon Glass /* Architecture-specific global data */
315cb48582SSimon Glass struct arch_global_data {
32e9adeca3SSimon Glass #if defined(CONFIG_FSL_ESDHC)
33e9adeca3SSimon Glass 	u32 sdhc_clk;
34e9adeca3SSimon Glass #endif
351206c184SSimon Glass #if defined(CONFIG_8xx)
361206c184SSimon Glass 	unsigned long brg_clk;
371206c184SSimon Glass #endif
381206c184SSimon Glass #if defined(CONFIG_CPM2)
39748cd059SSimon Glass 	/* There are many clocks on the MPC8260 - see page 9-5 */
40748cd059SSimon Glass 	unsigned long vco_out;
41748cd059SSimon Glass 	unsigned long cpm_clk;
42748cd059SSimon Glass 	unsigned long scc_clk;
431206c184SSimon Glass 	unsigned long brg_clk;
441206c184SSimon Glass #endif
45c6731fe2SSimon Glass 	/* TODO: sjg@chromium.org: Should these be unslgned long? */
46a47a12beSStefan Roese #if defined(CONFIG_MPC83xx)
47a47a12beSStefan Roese 	/* There are other clocks in the MPC83XX */
48a47a12beSStefan Roese 	u32 csb_clk;
497c619ddcSIlya Yanok # if defined(CONFIG_MPC8308) || defined(CONFIG_MPC831x) || \
507c619ddcSIlya Yanok 	defined(CONFIG_MPC834x) || defined(CONFIG_MPC837x)
51a47a12beSStefan Roese 	u32 tsec1_clk;
52a47a12beSStefan Roese 	u32 tsec2_clk;
53a47a12beSStefan Roese 	u32 usbdr_clk;
54a88731a6SGerlando Falauto # elif defined(CONFIG_MPC8309)
55a88731a6SGerlando Falauto 	u32 usbdr_clk;
56a47a12beSStefan Roese # endif
57a47a12beSStefan Roese # if defined(CONFIG_MPC834x)
58a47a12beSStefan Roese 	u32 usbmph_clk;
59a47a12beSStefan Roese # endif /* CONFIG_MPC834x */
60a47a12beSStefan Roese # if defined(CONFIG_MPC8315)
61a47a12beSStefan Roese 	u32 tdm_clk;
62a47a12beSStefan Roese # endif
63a47a12beSStefan Roese 	u32 core_clk;
64a47a12beSStefan Roese 	u32 enc_clk;
65a47a12beSStefan Roese 	u32 lbiu_clk;
66a47a12beSStefan Roese 	u32 lclk_clk;
677c619ddcSIlya Yanok # if defined(CONFIG_MPC8308) || defined(CONFIG_MPC831x) || \
687c619ddcSIlya Yanok 	defined(CONFIG_MPC837x)
69a47a12beSStefan Roese 	u32 pciexp1_clk;
70a47a12beSStefan Roese 	u32 pciexp2_clk;
71a47a12beSStefan Roese # endif
72a47a12beSStefan Roese # if defined(CONFIG_MPC837x) || defined(CONFIG_MPC8315)
73a47a12beSStefan Roese 	u32 sata_clk;
74a47a12beSStefan Roese # endif
75a47a12beSStefan Roese # if defined(CONFIG_MPC8360)
76a47a12beSStefan Roese 	u32 mem_sec_clk;
77a47a12beSStefan Roese # endif /* CONFIG_MPC8360 */
78a47a12beSStefan Roese #endif
7967ac13b1SSimon Glass #if defined(CONFIG_MPC85xx) || defined(CONFIG_MPC86xx)
8067ac13b1SSimon Glass 	u32 lbc_clk;
8167ac13b1SSimon Glass 	void *cpu;
8267ac13b1SSimon Glass #endif /* CONFIG_MPC85xx || CONFIG_MPC86xx */
83609e6ec3SSimon Glass #if defined(CONFIG_MPC83xx) || defined(CONFIG_MPC85xx) || \
84609e6ec3SSimon Glass 		defined(CONFIG_MPC86xx)
85609e6ec3SSimon Glass 	u32 i2c1_clk;
86609e6ec3SSimon Glass 	u32 i2c2_clk;
87609e6ec3SSimon Glass #endif
8845bae2e3SSimon Glass #if defined(CONFIG_QE)
8945bae2e3SSimon Glass 	u32 qe_clk;
9045bae2e3SSimon Glass 	u32 brg_clk;
9145bae2e3SSimon Glass 	uint mp_alloc_base;
9245bae2e3SSimon Glass 	uint mp_alloc_top;
9345bae2e3SSimon Glass #endif /* CONFIG_QE */
948670dbc9SSimon Glass #if defined(CONFIG_FSL_LAW)
958670dbc9SSimon Glass 	u32 used_laws;
968670dbc9SSimon Glass #endif
977c80c6c5SSimon Glass #if defined(CONFIG_E500)
987c80c6c5SSimon Glass 	u32 used_tlb_cams[(CONFIG_SYS_NUM_TLBCAMS+31)/32];
997c80c6c5SSimon Glass #endif
100b2877496SSimon Glass #if defined(CONFIG_MPC5xxx)
101b2877496SSimon Glass 	unsigned long ipb_clk;
102b2877496SSimon Glass #endif
103fefb098bSSimon Glass #if defined(CONFIG_MPC512X)
104fefb098bSSimon Glass 	u32 ips_clk;
105fefb098bSSimon Glass 	u32 csb_clk;
106fefb098bSSimon Glass #endif /* CONFIG_MPC512X */
1071c356135SSimon Glass #if defined(CONFIG_MPC8220)
1081c356135SSimon Glass 	unsigned long inp_clk;
1091c356135SSimon Glass 	unsigned long vco_clk;
1101c356135SSimon Glass 	unsigned long pev_clk;
1111c356135SSimon Glass 	unsigned long flb_clk;
1121c356135SSimon Glass #endif
1133c4c308cSSimon Glass 	unsigned long reset_status;	/* reset status register at boot */
11443e60814SSimon Glass #if defined(CONFIG_MPC83xx)
11543e60814SSimon Glass 	unsigned long arbiter_event_attributes;
11643e60814SSimon Glass 	unsigned long arbiter_event_address;
11743e60814SSimon Glass #endif
1186bb9ba72SSimon Glass #if defined(CONFIG_SYS_ALLOC_DPRAM) || defined(CONFIG_CPM2)
1196bb9ba72SSimon Glass 	unsigned int dp_alloc_base;
1206bb9ba72SSimon Glass 	unsigned int dp_alloc_top;
1216bb9ba72SSimon Glass #endif
1223a1dc8f1SSimon Glass #if defined(CONFIG_4xx)
1233a1dc8f1SSimon Glass 	u32 uart_clk;
1243a1dc8f1SSimon Glass #endif /* CONFIG_4xx */
1257e15d6dbSSimon Glass #if defined(CONFIG_SYS_GT_6426x)
1267e15d6dbSSimon Glass 	unsigned int mirror_hack[16];
1277e15d6dbSSimon Glass #endif
128923a662fSSimon Glass #ifdef CONFIG_SYS_FPGA_COUNT
129923a662fSSimon Glass 	unsigned fpga_state[CONFIG_SYS_FPGA_COUNT];
130923a662fSSimon Glass #endif
131a0d3c820SSimon Glass #if defined(CONFIG_WD_MAX_RATE)
132a0d3c820SSimon Glass 	unsigned long long wdt_last;	/* trace watch-dog triggering rate */
133a0d3c820SSimon Glass #endif
134225ca83dSSimon Glass #if defined(CONFIG_LWMON) || defined(CONFIG_LWMON5)
135225ca83dSSimon Glass 	unsigned long kbd_status;
136225ca83dSSimon Glass #endif
137c6731fe2SSimon Glass };
138c6731fe2SSimon Glass 
139*2ab575e0SSimon Glass #include <asm-generic/global_data.h>
140a47a12beSStefan Roese 
141a47a12beSStefan Roese #if 1
142a47a12beSStefan Roese #define DECLARE_GLOBAL_DATA_PTR     register volatile gd_t *gd asm ("r2")
143a47a12beSStefan Roese #else /* We could use plain global data, but the resulting code is bigger */
144a47a12beSStefan Roese #define XTRN_DECLARE_GLOBAL_DATA_PTR	extern
145a47a12beSStefan Roese #define DECLARE_GLOBAL_DATA_PTR     XTRN_DECLARE_GLOBAL_DATA_PTR \
146a47a12beSStefan Roese 				    gd_t *gd
147a47a12beSStefan Roese #endif
148a47a12beSStefan Roese 
149a47a12beSStefan Roese #endif /* __ASM_GBL_DATA_H */
150