1 /*----------------------------------------------------------------------------+
3 | This source code has been made available to you by IBM on an AS-IS
4 | basis. Anyone receiving this source is licensed under IBM
5 | copyrights to use it in any way he or she deems fit, including
6 | copying it, modifying it, compiling it, and redistributing it either
7 | with or without modifications. No license under IBM patents or
8 | patent applications is to be implied by the copyright license.
10 | Any user of this software should understand that IBM cannot provide
11 | technical support for this software and will not be responsible for
12 | any consequences resulting from the use of this software.
14 | Any person who transfers this source code or any derivative work
15 | must include the IBM copyright notice, this paragraph, and the
16 | preceding two paragraphs in the transferred software.
18 | COPYRIGHT I B M CORPORATION 1999
19 | LICENSED MATERIAL - PROGRAM PROPERTY OF I B M
20 +----------------------------------------------------------------------------*/
26 * Configure which SDRAM/DDR/DDR2 controller is equipped
28 #if defined(CONFIG_405GP) || defined(CONFIG_405CR) || defined(CONFIG_405EP) || \
29 defined(CONFIG_AP1000) || defined(CONFIG_ML2)
30 #define CONFIG_SDRAM_PPC4xx_IBM_SDRAM /* IBM SDRAM controller */
33 #if defined(CONFIG_440GP) || defined(CONFIG_440GX) || \
34 defined(CONFIG_440EP) || defined(CONFIG_440GR)
35 #define CONFIG_SDRAM_PPC4xx_IBM_DDR /* IBM DDR controller */
38 #if defined(CONFIG_440EPX) || defined(CONFIG_440GRX)
39 #define CONFIG_SDRAM_PPC4xx_DENALI_DDR2 /* Denali DDR(2) controller */
42 #if defined(CONFIG_405EX) || \
43 defined(CONFIG_440SP) || defined(CONFIG_440SPE) || \
44 defined(CONFIG_460EX) || defined(CONFIG_460GT) || \
46 #define CONFIG_SDRAM_PPC4xx_IBM_DDR2 /* IBM DDR(2) controller */
49 #if defined(CONFIG_440)
51 * Enable long long (%ll ...) printf format on 440 PPC's since most of
52 * them support 36bit physical addressing
54 #define CFG_64BIT_VSPRINTF
55 #define CFG_64BIT_STRTOUL
61 #include <asm/ppc4xx-sdram.h>
62 #include <asm/ppc4xx-ebc.h>
63 #if !defined(CONFIG_XILINX_440)
64 #include <asm/ppc4xx-uic.h>
68 * Macro for generating register field mnemonics
70 #define PPC_REG_BITS 32
71 #define PPC_REG_VAL(bit, value) ((value) << ((PPC_REG_BITS - 1) - (bit)))
74 * Elide casts when assembling register mnemonics
77 #define static_cast(type, val) (type)(val)
79 #define static_cast(type, val) (val)
83 * Common stuff for 4xx (405 and 440)
86 #define EXC_OFF_SYS_RESET 0x0100 /* System reset */
87 #define _START_OFFSET (EXC_OFF_SYS_RESET + 0x2000)
89 #define RESET_VECTOR 0xfffffffc
90 #define CACHELINE_MASK (CFG_CACHELINE_SIZE - 1) /* Address mask for cache
93 #define CPR0_DCR_BASE 0x0C
94 #define cprcfga (CPR0_DCR_BASE+0x0)
95 #define cprcfgd (CPR0_DCR_BASE+0x1)
97 #define SDR_DCR_BASE 0x0E
98 #define sdrcfga (SDR_DCR_BASE+0x0)
99 #define sdrcfgd (SDR_DCR_BASE+0x1)
101 #define SDRAM_DCR_BASE 0x10
102 #define memcfga (SDRAM_DCR_BASE+0x0)
103 #define memcfgd (SDRAM_DCR_BASE+0x1)
105 #define EBC_DCR_BASE 0x12
106 #define ebccfga (EBC_DCR_BASE+0x0)
107 #define ebccfgd (EBC_DCR_BASE+0x1)
110 * Macros for indirect DCR access
112 #define mtcpr(reg, d) do { mtdcr(cprcfga,reg);mtdcr(cprcfgd,d); } while (0)
113 #define mfcpr(reg, d) do { mtdcr(cprcfga,reg);d = mfdcr(cprcfgd); } while (0)
115 #define mtebc(reg, d) do { mtdcr(ebccfga,reg);mtdcr(ebccfgd,d); } while (0)
116 #define mfebc(reg, d) do { mtdcr(ebccfga,reg);d = mfdcr(ebccfgd); } while (0)
118 #define mtsdram(reg, d) do { mtdcr(memcfga,reg);mtdcr(memcfgd,d); } while (0)
119 #define mfsdram(reg, d) do { mtdcr(memcfga,reg);d = mfdcr(memcfgd); } while (0)
121 #define mtsdr(reg, d) do { mtdcr(sdrcfga,reg);mtdcr(sdrcfgd,d); } while (0)
122 #define mfsdr(reg, d) do { mtdcr(sdrcfga,reg);d = mfdcr(sdrcfgd); } while (0)
128 unsigned long freqDDR;
129 unsigned long freqEBC;
130 unsigned long freqOPB;
131 unsigned long freqPCI;
132 unsigned long freqPLB;
133 unsigned long freqTmrClk;
134 unsigned long freqUART;
135 unsigned long freqProcessor;
136 unsigned long freqVCOHz;
137 unsigned long freqVCOMhz; /* in MHz */
138 unsigned long pciClkSync; /* PCI clock is synchronous */
139 unsigned long pciIntArbEn; /* Internal PCI arbiter is enabled */
140 unsigned long pllExtBusDiv;
141 unsigned long pllFbkDiv;
142 unsigned long pllFwdDiv;
143 unsigned long pllFwdDivA;
144 unsigned long pllFwdDivB;
145 unsigned long pllOpbDiv;
146 unsigned long pllPciDiv;
147 unsigned long pllPlbDiv;
150 #endif /* __ASSEMBLY__ */
152 #endif /* __PPC4XX_H__ */