xref: /rk3399_rockchip-uboot/arch/powerpc/include/asm/global_data.h (revision 1a4596601fd395f3afb8f82f3f840c5e00bdd57a)
1a47a12beSStefan Roese /*
291a76751SWolfgang Denk  * (C) Copyright 2002-2010
3a47a12beSStefan Roese  * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
4a47a12beSStefan Roese  *
5*1a459660SWolfgang Denk  * SPDX-License-Identifier:	GPL-2.0+
6a47a12beSStefan Roese  */
7a47a12beSStefan Roese 
8a47a12beSStefan Roese #ifndef	__ASM_GBL_DATA_H
9a47a12beSStefan Roese #define __ASM_GBL_DATA_H
10a47a12beSStefan Roese 
11a47a12beSStefan Roese #include "config.h"
12a47a12beSStefan Roese #include "asm/types.h"
13a47a12beSStefan Roese 
145cb48582SSimon Glass /* Architecture-specific global data */
155cb48582SSimon Glass struct arch_global_data {
16e9adeca3SSimon Glass #if defined(CONFIG_FSL_ESDHC)
17e9adeca3SSimon Glass 	u32 sdhc_clk;
18e9adeca3SSimon Glass #endif
191206c184SSimon Glass #if defined(CONFIG_8xx)
201206c184SSimon Glass 	unsigned long brg_clk;
211206c184SSimon Glass #endif
221206c184SSimon Glass #if defined(CONFIG_CPM2)
23748cd059SSimon Glass 	/* There are many clocks on the MPC8260 - see page 9-5 */
24748cd059SSimon Glass 	unsigned long vco_out;
25748cd059SSimon Glass 	unsigned long cpm_clk;
26748cd059SSimon Glass 	unsigned long scc_clk;
271206c184SSimon Glass 	unsigned long brg_clk;
281206c184SSimon Glass #endif
29c6731fe2SSimon Glass 	/* TODO: sjg@chromium.org: Should these be unslgned long? */
30a47a12beSStefan Roese #if defined(CONFIG_MPC83xx)
31a47a12beSStefan Roese 	/* There are other clocks in the MPC83XX */
32a47a12beSStefan Roese 	u32 csb_clk;
337c619ddcSIlya Yanok # if defined(CONFIG_MPC8308) || defined(CONFIG_MPC831x) || \
347c619ddcSIlya Yanok 	defined(CONFIG_MPC834x) || defined(CONFIG_MPC837x)
35a47a12beSStefan Roese 	u32 tsec1_clk;
36a47a12beSStefan Roese 	u32 tsec2_clk;
37a47a12beSStefan Roese 	u32 usbdr_clk;
38a88731a6SGerlando Falauto # elif defined(CONFIG_MPC8309)
39a88731a6SGerlando Falauto 	u32 usbdr_clk;
40a47a12beSStefan Roese # endif
41a47a12beSStefan Roese # if defined(CONFIG_MPC834x)
42a47a12beSStefan Roese 	u32 usbmph_clk;
43a47a12beSStefan Roese # endif /* CONFIG_MPC834x */
44a47a12beSStefan Roese # if defined(CONFIG_MPC8315)
45a47a12beSStefan Roese 	u32 tdm_clk;
46a47a12beSStefan Roese # endif
47a47a12beSStefan Roese 	u32 core_clk;
48a47a12beSStefan Roese 	u32 enc_clk;
49a47a12beSStefan Roese 	u32 lbiu_clk;
50a47a12beSStefan Roese 	u32 lclk_clk;
517c619ddcSIlya Yanok # if defined(CONFIG_MPC8308) || defined(CONFIG_MPC831x) || \
527c619ddcSIlya Yanok 	defined(CONFIG_MPC837x)
53a47a12beSStefan Roese 	u32 pciexp1_clk;
54a47a12beSStefan Roese 	u32 pciexp2_clk;
55a47a12beSStefan Roese # endif
56a47a12beSStefan Roese # if defined(CONFIG_MPC837x) || defined(CONFIG_MPC8315)
57a47a12beSStefan Roese 	u32 sata_clk;
58a47a12beSStefan Roese # endif
59a47a12beSStefan Roese # if defined(CONFIG_MPC8360)
60a47a12beSStefan Roese 	u32 mem_sec_clk;
61a47a12beSStefan Roese # endif /* CONFIG_MPC8360 */
62a47a12beSStefan Roese #endif
6367ac13b1SSimon Glass #if defined(CONFIG_MPC85xx) || defined(CONFIG_MPC86xx)
6467ac13b1SSimon Glass 	u32 lbc_clk;
6567ac13b1SSimon Glass 	void *cpu;
6667ac13b1SSimon Glass #endif /* CONFIG_MPC85xx || CONFIG_MPC86xx */
67609e6ec3SSimon Glass #if defined(CONFIG_MPC83xx) || defined(CONFIG_MPC85xx) || \
68609e6ec3SSimon Glass 		defined(CONFIG_MPC86xx)
69609e6ec3SSimon Glass 	u32 i2c1_clk;
70609e6ec3SSimon Glass 	u32 i2c2_clk;
71609e6ec3SSimon Glass #endif
7245bae2e3SSimon Glass #if defined(CONFIG_QE)
7345bae2e3SSimon Glass 	u32 qe_clk;
7445bae2e3SSimon Glass 	u32 brg_clk;
7545bae2e3SSimon Glass 	uint mp_alloc_base;
7645bae2e3SSimon Glass 	uint mp_alloc_top;
7745bae2e3SSimon Glass #endif /* CONFIG_QE */
788670dbc9SSimon Glass #if defined(CONFIG_FSL_LAW)
798670dbc9SSimon Glass 	u32 used_laws;
808670dbc9SSimon Glass #endif
817c80c6c5SSimon Glass #if defined(CONFIG_E500)
827c80c6c5SSimon Glass 	u32 used_tlb_cams[(CONFIG_SYS_NUM_TLBCAMS+31)/32];
837c80c6c5SSimon Glass #endif
84b2877496SSimon Glass #if defined(CONFIG_MPC5xxx)
85b2877496SSimon Glass 	unsigned long ipb_clk;
86b2877496SSimon Glass #endif
87fefb098bSSimon Glass #if defined(CONFIG_MPC512X)
88fefb098bSSimon Glass 	u32 ips_clk;
89fefb098bSSimon Glass 	u32 csb_clk;
90fefb098bSSimon Glass #endif /* CONFIG_MPC512X */
913c4c308cSSimon Glass 	unsigned long reset_status;	/* reset status register at boot */
9243e60814SSimon Glass #if defined(CONFIG_MPC83xx)
9343e60814SSimon Glass 	unsigned long arbiter_event_attributes;
9443e60814SSimon Glass 	unsigned long arbiter_event_address;
9543e60814SSimon Glass #endif
966bb9ba72SSimon Glass #if defined(CONFIG_SYS_ALLOC_DPRAM) || defined(CONFIG_CPM2)
976bb9ba72SSimon Glass 	unsigned int dp_alloc_base;
986bb9ba72SSimon Glass 	unsigned int dp_alloc_top;
996bb9ba72SSimon Glass #endif
1003a1dc8f1SSimon Glass #if defined(CONFIG_4xx)
1013a1dc8f1SSimon Glass 	u32 uart_clk;
1023a1dc8f1SSimon Glass #endif /* CONFIG_4xx */
1037e15d6dbSSimon Glass #if defined(CONFIG_SYS_GT_6426x)
1047e15d6dbSSimon Glass 	unsigned int mirror_hack[16];
1057e15d6dbSSimon Glass #endif
106923a662fSSimon Glass #ifdef CONFIG_SYS_FPGA_COUNT
107923a662fSSimon Glass 	unsigned fpga_state[CONFIG_SYS_FPGA_COUNT];
108923a662fSSimon Glass #endif
109a0d3c820SSimon Glass #if defined(CONFIG_WD_MAX_RATE)
110a0d3c820SSimon Glass 	unsigned long long wdt_last;	/* trace watch-dog triggering rate */
111a0d3c820SSimon Glass #endif
112225ca83dSSimon Glass #if defined(CONFIG_LWMON) || defined(CONFIG_LWMON5)
113225ca83dSSimon Glass 	unsigned long kbd_status;
114225ca83dSSimon Glass #endif
115c6731fe2SSimon Glass };
116c6731fe2SSimon Glass 
1172ab575e0SSimon Glass #include <asm-generic/global_data.h>
118a47a12beSStefan Roese 
119a47a12beSStefan Roese #if 1
120a47a12beSStefan Roese #define DECLARE_GLOBAL_DATA_PTR     register volatile gd_t *gd asm ("r2")
121a47a12beSStefan Roese #else /* We could use plain global data, but the resulting code is bigger */
122a47a12beSStefan Roese #define XTRN_DECLARE_GLOBAL_DATA_PTR	extern
123a47a12beSStefan Roese #define DECLARE_GLOBAL_DATA_PTR     XTRN_DECLARE_GLOBAL_DATA_PTR \
124a47a12beSStefan Roese 				    gd_t *gd
125a47a12beSStefan Roese #endif
126a47a12beSStefan Roese 
127a47a12beSStefan Roese #endif /* __ASM_GBL_DATA_H */
128