aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/boot/dcr.h
diff options
context:
space:
mode:
Diffstat (limited to 'arch/powerpc/boot/dcr.h')
-rw-r--r--arch/powerpc/boot/dcr.h59
1 files changed, 58 insertions, 1 deletions
diff --git a/arch/powerpc/boot/dcr.h b/arch/powerpc/boot/dcr.h
index 83b88aa92888..95b9f5344016 100644
--- a/arch/powerpc/boot/dcr.h
+++ b/arch/powerpc/boot/dcr.h
@@ -14,12 +14,20 @@
14#define DCRN_SDRAM0_CFGADDR 0x010 14#define DCRN_SDRAM0_CFGADDR 0x010
15#define DCRN_SDRAM0_CFGDATA 0x011 15#define DCRN_SDRAM0_CFGDATA 0x011
16 16
17#define SDRAM0_READ(offset) ({\
18 mtdcr(DCRN_SDRAM0_CFGADDR, offset); \
19 mfdcr(DCRN_SDRAM0_CFGDATA); })
20#define SDRAM0_WRITE(offset, data) ({\
21 mtdcr(DCRN_SDRAM0_CFGADDR, offset); \
22 mtdcr(DCRN_SDRAM0_CFGDATA, data); })
23
17#define SDRAM0_B0CR 0x40 24#define SDRAM0_B0CR 0x40
18#define SDRAM0_B1CR 0x44 25#define SDRAM0_B1CR 0x44
19#define SDRAM0_B2CR 0x48 26#define SDRAM0_B2CR 0x48
20#define SDRAM0_B3CR 0x4c 27#define SDRAM0_B3CR 0x4c
21 28
22static const unsigned long sdram_bxcr[] = { SDRAM0_B0CR, SDRAM0_B1CR, SDRAM0_B2CR, SDRAM0_B3CR }; 29static const unsigned long sdram_bxcr[] = { SDRAM0_B0CR, SDRAM0_B1CR,
30 SDRAM0_B2CR, SDRAM0_B3CR };
23 31
24#define SDRAM_CONFIG_BANK_ENABLE 0x00000001 32#define SDRAM_CONFIG_BANK_ENABLE 0x00000001
25#define SDRAM_CONFIG_SIZE_MASK 0x000e0000 33#define SDRAM_CONFIG_SIZE_MASK 0x000e0000
@@ -138,5 +146,54 @@ static const unsigned long sdram_bxcr[] = { SDRAM0_B0CR, SDRAM0_B1CR, SDRAM0_B2C
138#define DCRN_CPC0_PLLMR 0xb0 146#define DCRN_CPC0_PLLMR 0xb0
139#define DCRN_405_CPC0_CR0 0xb1 147#define DCRN_405_CPC0_CR0 0xb1
140#define DCRN_405_CPC0_CR1 0xb2 148#define DCRN_405_CPC0_CR1 0xb2
149#define DCRN_405_CPC0_PSR 0xb4
150
151/* 405EP Clocking/Power Management/Chip Control regs */
152#define DCRN_CPC0_PLLMR0 0xf0
153#define DCRN_CPC0_PLLMR1 0xf4
154#define DCRN_CPC0_UCR 0xf5
155
156/* 440GX Clock control etc */
157
158
159#define DCRN_CPR0_CLKUPD 0x020
160#define DCRN_CPR0_PLLC 0x040
161#define DCRN_CPR0_PLLD 0x060
162#define DCRN_CPR0_PRIMAD 0x080
163#define DCRN_CPR0_PRIMBD 0x0a0
164#define DCRN_CPR0_OPBD 0x0c0
165#define DCRN_CPR0_PERD 0x0e0
166#define DCRN_CPR0_MALD 0x100
167
168#define DCRN_SDR0_CONFIG_ADDR 0xe
169#define DCRN_SDR0_CONFIG_DATA 0xf
170
171/* SDR read/write helper macros */
172#define SDR0_READ(offset) ({\
173 mtdcr(DCRN_SDR0_CONFIG_ADDR, offset); \
174 mfdcr(DCRN_SDR0_CONFIG_DATA); })
175#define SDR0_WRITE(offset, data) ({\
176 mtdcr(DCRN_SDR0_CONFIG_ADDR, offset); \
177 mtdcr(DCRN_SDR0_CONFIG_DATA, data); })
178
179#define DCRN_SDR0_UART0 0x0120
180#define DCRN_SDR0_UART1 0x0121
181#define DCRN_SDR0_UART2 0x0122
182#define DCRN_SDR0_UART3 0x0123
183
184
185/* CPRs read/write helper macros - based off include/asm-ppc/ibm44x.h */
186
187#define DCRN_CPR0_CFGADDR 0xc
188#define DCRN_CPR0_CFGDATA 0xd
189
190#define CPR0_READ(offset) ({\
191 mtdcr(DCRN_CPR0_CFGADDR, offset); \
192 mfdcr(DCRN_CPR0_CFGDATA); })
193#define CPR0_WRITE(offset, data) ({\
194 mtdcr(DCRN_CPR0_CFGADDR, offset); \
195 mtdcr(DCRN_CPR0_CFGDATA, data); })
196
197
141 198
142#endif /* _PPC_BOOT_DCR_H_ */ 199#endif /* _PPC_BOOT_DCR_H_ */