xref: /openbmc/u-boot/arch/arm/lib/asm-offsets.c (revision 254d68b6011c33af189d006243920c296592fca7)
1*254d68b6SMasahiro Yamada /*
2*254d68b6SMasahiro Yamada  * Adapted from Linux v2.6.36 kernel: arch/powerpc/kernel/asm-offsets.c
3*254d68b6SMasahiro Yamada  *
4*254d68b6SMasahiro Yamada  * This program is used to generate definitions needed by
5*254d68b6SMasahiro Yamada  * assembly language modules.
6*254d68b6SMasahiro Yamada  *
7*254d68b6SMasahiro Yamada  * We use the technique used in the OSF Mach kernel code:
8*254d68b6SMasahiro Yamada  * generate asm statements containing #defines,
9*254d68b6SMasahiro Yamada  * compile this file to assembler, and then extract the
10*254d68b6SMasahiro Yamada  * #defines from the assembly-language output.
11*254d68b6SMasahiro Yamada  *
12*254d68b6SMasahiro Yamada  * SPDX-License-Identifier:	GPL-2.0+
13*254d68b6SMasahiro Yamada  */
14*254d68b6SMasahiro Yamada 
15*254d68b6SMasahiro Yamada #include <common.h>
16*254d68b6SMasahiro Yamada #include <linux/kbuild.h>
17*254d68b6SMasahiro Yamada 
18*254d68b6SMasahiro Yamada #if defined(CONFIG_MB86R0x)
19*254d68b6SMasahiro Yamada #include <asm/arch/mb86r0x.h>
20*254d68b6SMasahiro Yamada #endif
21*254d68b6SMasahiro Yamada #if defined(CONFIG_MX25) || defined(CONFIG_MX27) || defined(CONFIG_MX35) \
22*254d68b6SMasahiro Yamada 	|| defined(CONFIG_MX51) || defined(CONFIG_MX53)
23*254d68b6SMasahiro Yamada #include <asm/arch/imx-regs.h>
24*254d68b6SMasahiro Yamada #endif
25*254d68b6SMasahiro Yamada 
26*254d68b6SMasahiro Yamada int main(void)
27*254d68b6SMasahiro Yamada {
28*254d68b6SMasahiro Yamada 	/*
29*254d68b6SMasahiro Yamada 	 * TODO : Check if each entry in this file is really necessary.
30*254d68b6SMasahiro Yamada 	 *   - struct mb86r0x_ddr2
31*254d68b6SMasahiro Yamada 	 *   - struct mb86r0x_memc
32*254d68b6SMasahiro Yamada 	 *   - struct esdramc_regs
33*254d68b6SMasahiro Yamada 	 *   - struct max_regs
34*254d68b6SMasahiro Yamada 	 *   - struct aips_regs
35*254d68b6SMasahiro Yamada 	 *   - struct aipi_regs
36*254d68b6SMasahiro Yamada 	 *   - struct clkctl
37*254d68b6SMasahiro Yamada 	 *   - struct dpll
38*254d68b6SMasahiro Yamada 	 * are used only for generating asm-offsets.h.
39*254d68b6SMasahiro Yamada 	 * It means their offset addresses are referenced only from assembly
40*254d68b6SMasahiro Yamada 	 * code. Is it better to define the macros directly in headers?
41*254d68b6SMasahiro Yamada 	 */
42*254d68b6SMasahiro Yamada 
43*254d68b6SMasahiro Yamada #if defined(CONFIG_MB86R0x)
44*254d68b6SMasahiro Yamada 	/* ddr2 controller */
45*254d68b6SMasahiro Yamada 	DEFINE(DDR2_DRIC, offsetof(struct mb86r0x_ddr2c, dric));
46*254d68b6SMasahiro Yamada 	DEFINE(DDR2_DRIC1, offsetof(struct mb86r0x_ddr2c, dric1));
47*254d68b6SMasahiro Yamada 	DEFINE(DDR2_DRIC2, offsetof(struct mb86r0x_ddr2c, dric2));
48*254d68b6SMasahiro Yamada 	DEFINE(DDR2_DRCA, offsetof(struct mb86r0x_ddr2c, drca));
49*254d68b6SMasahiro Yamada 	DEFINE(DDR2_DRCM, offsetof(struct mb86r0x_ddr2c, drcm));
50*254d68b6SMasahiro Yamada 	DEFINE(DDR2_DRCST1, offsetof(struct mb86r0x_ddr2c, drcst1));
51*254d68b6SMasahiro Yamada 	DEFINE(DDR2_DRCST2, offsetof(struct mb86r0x_ddr2c, drcst2));
52*254d68b6SMasahiro Yamada 	DEFINE(DDR2_DRCR, offsetof(struct mb86r0x_ddr2c, drcr));
53*254d68b6SMasahiro Yamada 	DEFINE(DDR2_DRCF, offsetof(struct mb86r0x_ddr2c, drcf));
54*254d68b6SMasahiro Yamada 	DEFINE(DDR2_DRASR, offsetof(struct mb86r0x_ddr2c, drasr));
55*254d68b6SMasahiro Yamada 	DEFINE(DDR2_DRIMS, offsetof(struct mb86r0x_ddr2c, drims));
56*254d68b6SMasahiro Yamada 	DEFINE(DDR2_DROS, offsetof(struct mb86r0x_ddr2c, dros));
57*254d68b6SMasahiro Yamada 	DEFINE(DDR2_DRIBSODT1, offsetof(struct mb86r0x_ddr2c, dribsodt1));
58*254d68b6SMasahiro Yamada 	DEFINE(DDR2_DROABA, offsetof(struct mb86r0x_ddr2c, droaba));
59*254d68b6SMasahiro Yamada 	DEFINE(DDR2_DROBS, offsetof(struct mb86r0x_ddr2c, drobs));
60*254d68b6SMasahiro Yamada 
61*254d68b6SMasahiro Yamada 	/* clock reset generator */
62*254d68b6SMasahiro Yamada 	DEFINE(CRG_CRPR, offsetof(struct mb86r0x_crg, crpr));
63*254d68b6SMasahiro Yamada 	DEFINE(CRG_CRHA, offsetof(struct mb86r0x_crg, crha));
64*254d68b6SMasahiro Yamada 	DEFINE(CRG_CRPA, offsetof(struct mb86r0x_crg, crpa));
65*254d68b6SMasahiro Yamada 	DEFINE(CRG_CRPB, offsetof(struct mb86r0x_crg, crpb));
66*254d68b6SMasahiro Yamada 	DEFINE(CRG_CRHB, offsetof(struct mb86r0x_crg, crhb));
67*254d68b6SMasahiro Yamada 	DEFINE(CRG_CRAM, offsetof(struct mb86r0x_crg, cram));
68*254d68b6SMasahiro Yamada 
69*254d68b6SMasahiro Yamada 	/* chip control module */
70*254d68b6SMasahiro Yamada 	DEFINE(CCNT_CDCRC, offsetof(struct mb86r0x_ccnt, cdcrc));
71*254d68b6SMasahiro Yamada 
72*254d68b6SMasahiro Yamada 	/* external bus interface */
73*254d68b6SMasahiro Yamada 	DEFINE(MEMC_MCFMODE0, offsetof(struct mb86r0x_memc, mcfmode[0]));
74*254d68b6SMasahiro Yamada 	DEFINE(MEMC_MCFMODE2, offsetof(struct mb86r0x_memc, mcfmode[2]));
75*254d68b6SMasahiro Yamada 	DEFINE(MEMC_MCFMODE4, offsetof(struct mb86r0x_memc, mcfmode[4]));
76*254d68b6SMasahiro Yamada 	DEFINE(MEMC_MCFTIM0, offsetof(struct mb86r0x_memc, mcftim[0]));
77*254d68b6SMasahiro Yamada 	DEFINE(MEMC_MCFTIM2, offsetof(struct mb86r0x_memc, mcftim[2]));
78*254d68b6SMasahiro Yamada 	DEFINE(MEMC_MCFTIM4, offsetof(struct mb86r0x_memc, mcftim[4]));
79*254d68b6SMasahiro Yamada 	DEFINE(MEMC_MCFAREA0, offsetof(struct mb86r0x_memc, mcfarea[0]));
80*254d68b6SMasahiro Yamada 	DEFINE(MEMC_MCFAREA2, offsetof(struct mb86r0x_memc, mcfarea[2]));
81*254d68b6SMasahiro Yamada 	DEFINE(MEMC_MCFAREA4, offsetof(struct mb86r0x_memc, mcfarea[4]));
82*254d68b6SMasahiro Yamada #endif
83*254d68b6SMasahiro Yamada 
84*254d68b6SMasahiro Yamada #if defined(CONFIG_MX25)
85*254d68b6SMasahiro Yamada 	/* Clock Control Module */
86*254d68b6SMasahiro Yamada 	DEFINE(CCM_CCTL, offsetof(struct ccm_regs, cctl));
87*254d68b6SMasahiro Yamada 	DEFINE(CCM_CGCR0, offsetof(struct ccm_regs, cgr0));
88*254d68b6SMasahiro Yamada 	DEFINE(CCM_CGCR1, offsetof(struct ccm_regs, cgr1));
89*254d68b6SMasahiro Yamada 	DEFINE(CCM_CGCR2, offsetof(struct ccm_regs, cgr2));
90*254d68b6SMasahiro Yamada 	DEFINE(CCM_PCDR2, offsetof(struct ccm_regs, pcdr[2]));
91*254d68b6SMasahiro Yamada 	DEFINE(CCM_MCR, offsetof(struct ccm_regs, mcr));
92*254d68b6SMasahiro Yamada 
93*254d68b6SMasahiro Yamada 	/* Enhanced SDRAM Controller */
94*254d68b6SMasahiro Yamada 	DEFINE(ESDRAMC_ESDCTL0, offsetof(struct esdramc_regs, ctl0));
95*254d68b6SMasahiro Yamada 	DEFINE(ESDRAMC_ESDCFG0, offsetof(struct esdramc_regs, cfg0));
96*254d68b6SMasahiro Yamada 	DEFINE(ESDRAMC_ESDMISC, offsetof(struct esdramc_regs, misc));
97*254d68b6SMasahiro Yamada 
98*254d68b6SMasahiro Yamada 	/* Multi-Layer AHB Crossbar Switch */
99*254d68b6SMasahiro Yamada 	DEFINE(MAX_MPR0, offsetof(struct max_regs, mpr0));
100*254d68b6SMasahiro Yamada 	DEFINE(MAX_SGPCR0, offsetof(struct max_regs, sgpcr0));
101*254d68b6SMasahiro Yamada 	DEFINE(MAX_MPR1, offsetof(struct max_regs, mpr1));
102*254d68b6SMasahiro Yamada 	DEFINE(MAX_SGPCR1, offsetof(struct max_regs, sgpcr1));
103*254d68b6SMasahiro Yamada 	DEFINE(MAX_MPR2, offsetof(struct max_regs, mpr2));
104*254d68b6SMasahiro Yamada 	DEFINE(MAX_SGPCR2, offsetof(struct max_regs, sgpcr2));
105*254d68b6SMasahiro Yamada 	DEFINE(MAX_MPR3, offsetof(struct max_regs, mpr3));
106*254d68b6SMasahiro Yamada 	DEFINE(MAX_SGPCR3, offsetof(struct max_regs, sgpcr3));
107*254d68b6SMasahiro Yamada 	DEFINE(MAX_MPR4, offsetof(struct max_regs, mpr4));
108*254d68b6SMasahiro Yamada 	DEFINE(MAX_SGPCR4, offsetof(struct max_regs, sgpcr4));
109*254d68b6SMasahiro Yamada 	DEFINE(MAX_MGPCR0, offsetof(struct max_regs, mgpcr0));
110*254d68b6SMasahiro Yamada 	DEFINE(MAX_MGPCR1, offsetof(struct max_regs, mgpcr1));
111*254d68b6SMasahiro Yamada 	DEFINE(MAX_MGPCR2, offsetof(struct max_regs, mgpcr2));
112*254d68b6SMasahiro Yamada 	DEFINE(MAX_MGPCR3, offsetof(struct max_regs, mgpcr3));
113*254d68b6SMasahiro Yamada 	DEFINE(MAX_MGPCR4, offsetof(struct max_regs, mgpcr4));
114*254d68b6SMasahiro Yamada 
115*254d68b6SMasahiro Yamada 	/* AHB <-> IP-Bus Interface */
116*254d68b6SMasahiro Yamada 	DEFINE(AIPS_MPR_0_7, offsetof(struct aips_regs, mpr_0_7));
117*254d68b6SMasahiro Yamada 	DEFINE(AIPS_MPR_8_15, offsetof(struct aips_regs, mpr_8_15));
118*254d68b6SMasahiro Yamada #endif
119*254d68b6SMasahiro Yamada 
120*254d68b6SMasahiro Yamada #if defined(CONFIG_MX27)
121*254d68b6SMasahiro Yamada 	DEFINE(AIPI1_PSR0, IMX_AIPI1_BASE + offsetof(struct aipi_regs, psr0));
122*254d68b6SMasahiro Yamada 	DEFINE(AIPI1_PSR1, IMX_AIPI1_BASE + offsetof(struct aipi_regs, psr1));
123*254d68b6SMasahiro Yamada 	DEFINE(AIPI2_PSR0, IMX_AIPI2_BASE + offsetof(struct aipi_regs, psr0));
124*254d68b6SMasahiro Yamada 	DEFINE(AIPI2_PSR1, IMX_AIPI2_BASE + offsetof(struct aipi_regs, psr1));
125*254d68b6SMasahiro Yamada 
126*254d68b6SMasahiro Yamada 	DEFINE(CSCR, IMX_PLL_BASE + offsetof(struct pll_regs, cscr));
127*254d68b6SMasahiro Yamada 	DEFINE(MPCTL0, IMX_PLL_BASE + offsetof(struct pll_regs, mpctl0));
128*254d68b6SMasahiro Yamada 	DEFINE(SPCTL0, IMX_PLL_BASE + offsetof(struct pll_regs, spctl0));
129*254d68b6SMasahiro Yamada 	DEFINE(PCDR0, IMX_PLL_BASE + offsetof(struct pll_regs, pcdr0));
130*254d68b6SMasahiro Yamada 	DEFINE(PCDR1, IMX_PLL_BASE + offsetof(struct pll_regs, pcdr1));
131*254d68b6SMasahiro Yamada 	DEFINE(PCCR0, IMX_PLL_BASE + offsetof(struct pll_regs, pccr0));
132*254d68b6SMasahiro Yamada 	DEFINE(PCCR1, IMX_PLL_BASE + offsetof(struct pll_regs, pccr1));
133*254d68b6SMasahiro Yamada 
134*254d68b6SMasahiro Yamada 	DEFINE(ESDCTL0_ROF, offsetof(struct esdramc_regs, esdctl0));
135*254d68b6SMasahiro Yamada 	DEFINE(ESDCFG0_ROF, offsetof(struct esdramc_regs, esdcfg0));
136*254d68b6SMasahiro Yamada 	DEFINE(ESDCTL1_ROF, offsetof(struct esdramc_regs, esdctl1));
137*254d68b6SMasahiro Yamada 	DEFINE(ESDCFG1_ROF, offsetof(struct esdramc_regs, esdcfg1));
138*254d68b6SMasahiro Yamada 	DEFINE(ESDMISC_ROF, offsetof(struct esdramc_regs, esdmisc));
139*254d68b6SMasahiro Yamada 
140*254d68b6SMasahiro Yamada 	DEFINE(GPCR, IMX_SYSTEM_CTL_BASE +
141*254d68b6SMasahiro Yamada 		offsetof(struct system_control_regs, gpcr));
142*254d68b6SMasahiro Yamada 	DEFINE(FMCR, IMX_SYSTEM_CTL_BASE +
143*254d68b6SMasahiro Yamada 		offsetof(struct system_control_regs, fmcr));
144*254d68b6SMasahiro Yamada #endif
145*254d68b6SMasahiro Yamada 
146*254d68b6SMasahiro Yamada #if defined(CONFIG_MX35)
147*254d68b6SMasahiro Yamada 	/* Round up to make sure size gives nice stack alignment */
148*254d68b6SMasahiro Yamada 	DEFINE(CLKCTL_CCMR, offsetof(struct ccm_regs, ccmr));
149*254d68b6SMasahiro Yamada 	DEFINE(CLKCTL_PDR0, offsetof(struct ccm_regs, pdr0));
150*254d68b6SMasahiro Yamada 	DEFINE(CLKCTL_PDR1, offsetof(struct ccm_regs, pdr1));
151*254d68b6SMasahiro Yamada 	DEFINE(CLKCTL_PDR2, offsetof(struct ccm_regs, pdr2));
152*254d68b6SMasahiro Yamada 	DEFINE(CLKCTL_PDR3, offsetof(struct ccm_regs, pdr3));
153*254d68b6SMasahiro Yamada 	DEFINE(CLKCTL_PDR4, offsetof(struct ccm_regs, pdr4));
154*254d68b6SMasahiro Yamada 	DEFINE(CLKCTL_RCSR, offsetof(struct ccm_regs, rcsr));
155*254d68b6SMasahiro Yamada 	DEFINE(CLKCTL_MPCTL, offsetof(struct ccm_regs, mpctl));
156*254d68b6SMasahiro Yamada 	DEFINE(CLKCTL_PPCTL, offsetof(struct ccm_regs, ppctl));
157*254d68b6SMasahiro Yamada 	DEFINE(CLKCTL_ACMR, offsetof(struct ccm_regs, acmr));
158*254d68b6SMasahiro Yamada 	DEFINE(CLKCTL_COSR, offsetof(struct ccm_regs, cosr));
159*254d68b6SMasahiro Yamada 	DEFINE(CLKCTL_CGR0, offsetof(struct ccm_regs, cgr0));
160*254d68b6SMasahiro Yamada 	DEFINE(CLKCTL_CGR1, offsetof(struct ccm_regs, cgr1));
161*254d68b6SMasahiro Yamada 	DEFINE(CLKCTL_CGR2, offsetof(struct ccm_regs, cgr2));
162*254d68b6SMasahiro Yamada 	DEFINE(CLKCTL_CGR3, offsetof(struct ccm_regs, cgr3));
163*254d68b6SMasahiro Yamada 
164*254d68b6SMasahiro Yamada 	/* Multi-Layer AHB Crossbar Switch */
165*254d68b6SMasahiro Yamada 	DEFINE(MAX_MPR0, offsetof(struct max_regs, mpr0));
166*254d68b6SMasahiro Yamada 	DEFINE(MAX_SGPCR0, offsetof(struct max_regs, sgpcr0));
167*254d68b6SMasahiro Yamada 	DEFINE(MAX_MPR1, offsetof(struct max_regs, mpr1));
168*254d68b6SMasahiro Yamada 	DEFINE(MAX_SGPCR1, offsetof(struct max_regs, sgpcr1));
169*254d68b6SMasahiro Yamada 	DEFINE(MAX_MPR2, offsetof(struct max_regs, mpr2));
170*254d68b6SMasahiro Yamada 	DEFINE(MAX_SGPCR2, offsetof(struct max_regs, sgpcr2));
171*254d68b6SMasahiro Yamada 	DEFINE(MAX_MPR3, offsetof(struct max_regs, mpr3));
172*254d68b6SMasahiro Yamada 	DEFINE(MAX_SGPCR3, offsetof(struct max_regs, sgpcr3));
173*254d68b6SMasahiro Yamada 	DEFINE(MAX_MPR4, offsetof(struct max_regs, mpr4));
174*254d68b6SMasahiro Yamada 	DEFINE(MAX_SGPCR4, offsetof(struct max_regs, sgpcr4));
175*254d68b6SMasahiro Yamada 	DEFINE(MAX_MGPCR0, offsetof(struct max_regs, mgpcr0));
176*254d68b6SMasahiro Yamada 	DEFINE(MAX_MGPCR1, offsetof(struct max_regs, mgpcr1));
177*254d68b6SMasahiro Yamada 	DEFINE(MAX_MGPCR2, offsetof(struct max_regs, mgpcr2));
178*254d68b6SMasahiro Yamada 	DEFINE(MAX_MGPCR3, offsetof(struct max_regs, mgpcr3));
179*254d68b6SMasahiro Yamada 	DEFINE(MAX_MGPCR4, offsetof(struct max_regs, mgpcr4));
180*254d68b6SMasahiro Yamada 	DEFINE(MAX_MGPCR5, offsetof(struct max_regs, mgpcr5));
181*254d68b6SMasahiro Yamada 
182*254d68b6SMasahiro Yamada 	/* AHB <-> IP-Bus Interface */
183*254d68b6SMasahiro Yamada 	DEFINE(AIPS_MPR_0_7, offsetof(struct aips_regs, mpr_0_7));
184*254d68b6SMasahiro Yamada 	DEFINE(AIPS_MPR_8_15, offsetof(struct aips_regs, mpr_8_15));
185*254d68b6SMasahiro Yamada 	DEFINE(AIPS_PACR_0_7, offsetof(struct aips_regs, pacr_0_7));
186*254d68b6SMasahiro Yamada 	DEFINE(AIPS_PACR_8_15, offsetof(struct aips_regs, pacr_8_15));
187*254d68b6SMasahiro Yamada 	DEFINE(AIPS_PACR_16_23, offsetof(struct aips_regs, pacr_16_23));
188*254d68b6SMasahiro Yamada 	DEFINE(AIPS_PACR_24_31, offsetof(struct aips_regs, pacr_24_31));
189*254d68b6SMasahiro Yamada 	DEFINE(AIPS_OPACR_0_7, offsetof(struct aips_regs, opacr_0_7));
190*254d68b6SMasahiro Yamada 	DEFINE(AIPS_OPACR_8_15, offsetof(struct aips_regs, opacr_8_15));
191*254d68b6SMasahiro Yamada 	DEFINE(AIPS_OPACR_16_23, offsetof(struct aips_regs, opacr_16_23));
192*254d68b6SMasahiro Yamada 	DEFINE(AIPS_OPACR_24_31, offsetof(struct aips_regs, opacr_24_31));
193*254d68b6SMasahiro Yamada 	DEFINE(AIPS_OPACR_32_39, offsetof(struct aips_regs, opacr_32_39));
194*254d68b6SMasahiro Yamada #endif
195*254d68b6SMasahiro Yamada 
196*254d68b6SMasahiro Yamada #if defined(CONFIG_MX51) || defined(CONFIG_MX53)
197*254d68b6SMasahiro Yamada 	/* Round up to make sure size gives nice stack alignment */
198*254d68b6SMasahiro Yamada 	DEFINE(CLKCTL_CCMR, offsetof(struct clkctl, ccr));
199*254d68b6SMasahiro Yamada 	DEFINE(CLKCTL_CCDR, offsetof(struct clkctl, ccdr));
200*254d68b6SMasahiro Yamada 	DEFINE(CLKCTL_CSR, offsetof(struct clkctl, csr));
201*254d68b6SMasahiro Yamada 	DEFINE(CLKCTL_CCSR, offsetof(struct clkctl, ccsr));
202*254d68b6SMasahiro Yamada 	DEFINE(CLKCTL_CACRR, offsetof(struct clkctl, cacrr));
203*254d68b6SMasahiro Yamada 	DEFINE(CLKCTL_CBCDR, offsetof(struct clkctl, cbcdr));
204*254d68b6SMasahiro Yamada 	DEFINE(CLKCTL_CBCMR, offsetof(struct clkctl, cbcmr));
205*254d68b6SMasahiro Yamada 	DEFINE(CLKCTL_CSCMR1, offsetof(struct clkctl, cscmr1));
206*254d68b6SMasahiro Yamada 	DEFINE(CLKCTL_CSCMR2, offsetof(struct clkctl, cscmr2));
207*254d68b6SMasahiro Yamada 	DEFINE(CLKCTL_CSCDR1, offsetof(struct clkctl, cscdr1));
208*254d68b6SMasahiro Yamada 	DEFINE(CLKCTL_CS1CDR, offsetof(struct clkctl, cs1cdr));
209*254d68b6SMasahiro Yamada 	DEFINE(CLKCTL_CS2CDR, offsetof(struct clkctl, cs2cdr));
210*254d68b6SMasahiro Yamada 	DEFINE(CLKCTL_CDCDR, offsetof(struct clkctl, cdcdr));
211*254d68b6SMasahiro Yamada 	DEFINE(CLKCTL_CHSCCDR, offsetof(struct clkctl, chsccdr));
212*254d68b6SMasahiro Yamada 	DEFINE(CLKCTL_CSCDR2, offsetof(struct clkctl, cscdr2));
213*254d68b6SMasahiro Yamada 	DEFINE(CLKCTL_CSCDR3, offsetof(struct clkctl, cscdr3));
214*254d68b6SMasahiro Yamada 	DEFINE(CLKCTL_CSCDR4, offsetof(struct clkctl, cscdr4));
215*254d68b6SMasahiro Yamada 	DEFINE(CLKCTL_CWDR, offsetof(struct clkctl, cwdr));
216*254d68b6SMasahiro Yamada 	DEFINE(CLKCTL_CDHIPR, offsetof(struct clkctl, cdhipr));
217*254d68b6SMasahiro Yamada 	DEFINE(CLKCTL_CDCR, offsetof(struct clkctl, cdcr));
218*254d68b6SMasahiro Yamada 	DEFINE(CLKCTL_CTOR, offsetof(struct clkctl, ctor));
219*254d68b6SMasahiro Yamada 	DEFINE(CLKCTL_CLPCR, offsetof(struct clkctl, clpcr));
220*254d68b6SMasahiro Yamada 	DEFINE(CLKCTL_CISR, offsetof(struct clkctl, cisr));
221*254d68b6SMasahiro Yamada 	DEFINE(CLKCTL_CIMR, offsetof(struct clkctl, cimr));
222*254d68b6SMasahiro Yamada 	DEFINE(CLKCTL_CCOSR, offsetof(struct clkctl, ccosr));
223*254d68b6SMasahiro Yamada 	DEFINE(CLKCTL_CGPR, offsetof(struct clkctl, cgpr));
224*254d68b6SMasahiro Yamada 	DEFINE(CLKCTL_CCGR0, offsetof(struct clkctl, ccgr0));
225*254d68b6SMasahiro Yamada 	DEFINE(CLKCTL_CCGR1, offsetof(struct clkctl, ccgr1));
226*254d68b6SMasahiro Yamada 	DEFINE(CLKCTL_CCGR2, offsetof(struct clkctl, ccgr2));
227*254d68b6SMasahiro Yamada 	DEFINE(CLKCTL_CCGR3, offsetof(struct clkctl, ccgr3));
228*254d68b6SMasahiro Yamada 	DEFINE(CLKCTL_CCGR4, offsetof(struct clkctl, ccgr4));
229*254d68b6SMasahiro Yamada 	DEFINE(CLKCTL_CCGR5, offsetof(struct clkctl, ccgr5));
230*254d68b6SMasahiro Yamada 	DEFINE(CLKCTL_CCGR6, offsetof(struct clkctl, ccgr6));
231*254d68b6SMasahiro Yamada 	DEFINE(CLKCTL_CMEOR, offsetof(struct clkctl, cmeor));
232*254d68b6SMasahiro Yamada #if defined(CONFIG_MX53)
233*254d68b6SMasahiro Yamada 	DEFINE(CLKCTL_CCGR7, offsetof(struct clkctl, ccgr7));
234*254d68b6SMasahiro Yamada #endif
235*254d68b6SMasahiro Yamada 
236*254d68b6SMasahiro Yamada 	/* DPLL */
237*254d68b6SMasahiro Yamada 	DEFINE(PLL_DP_CTL, offsetof(struct dpll, dp_ctl));
238*254d68b6SMasahiro Yamada 	DEFINE(PLL_DP_CONFIG, offsetof(struct dpll, dp_config));
239*254d68b6SMasahiro Yamada 	DEFINE(PLL_DP_OP, offsetof(struct dpll, dp_op));
240*254d68b6SMasahiro Yamada 	DEFINE(PLL_DP_MFD, offsetof(struct dpll, dp_mfd));
241*254d68b6SMasahiro Yamada 	DEFINE(PLL_DP_MFN, offsetof(struct dpll, dp_mfn));
242*254d68b6SMasahiro Yamada 	DEFINE(PLL_DP_HFS_OP, offsetof(struct dpll, dp_hfs_op));
243*254d68b6SMasahiro Yamada 	DEFINE(PLL_DP_HFS_MFD, offsetof(struct dpll, dp_hfs_mfd));
244*254d68b6SMasahiro Yamada 	DEFINE(PLL_DP_HFS_MFN, offsetof(struct dpll, dp_hfs_mfn));
245*254d68b6SMasahiro Yamada #endif
246*254d68b6SMasahiro Yamada 
247*254d68b6SMasahiro Yamada 	return 0;
248*254d68b6SMasahiro Yamada }
249