2 * Copyright 2004 Freescale Semiconductor.
3 * (C) Copyright 2002, 2003 Motorola Inc.
4 * Xianghua Xiao (X.Xiao@motorola.com)
7 * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
9 * See file CREDITS for list of people who contributed to this
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License as
14 * published by the Free Software Foundation; either version 2 of
15 * the License, or (at your option) any later version.
17 * This program is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU General Public License for more details.
22 * You should have received a copy of the GNU General Public License
23 * along with this program; if not, write to the Free Software
24 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
31 #include <asm/cache.h>
33 /* ------------------------------------------------------------------------- */
38 uint lcrr; /* local bus clock ratio register */
39 uint clkdiv; /* clock divider portion of lcrr */
44 puts("Freescale PowerPC\n");
53 case PVR_VER(PVR_85xx):
60 printf(", Version: %d.%d, (0x%08x)\n", major, minor, pvr);
85 printf(", Version: %d.%d, (0x%08x)\n", major, minor, svr);
87 get_sys_info(&sysinfo);
90 printf("CPU:%4lu MHz, ", sysinfo.freqProcessor / 1000000);
91 printf("CCB:%4lu MHz, ", sysinfo.freqSystemBus / 1000000);
92 printf("DDR:%4lu MHz, ", sysinfo.freqSystemBus / 2000000);
94 #if defined(CFG_LBC_LCRR)
98 volatile immap_t *immap = (immap_t *)CFG_IMMR;
99 volatile ccsr_lbc_t *lbc= &immap->im_lbc;
104 clkdiv = lcrr & 0x0f;
105 if (clkdiv == 2 || clkdiv == 4 || clkdiv == 8) {
106 printf("LBC:%4lu MHz\n",
107 sysinfo.freqSystemBus / 1000000 / clkdiv);
109 printf(" LBC: unknown (lcrr: 0x%08x)\n", lcrr);
112 if (ver == SVR_8560) {
113 printf(" CPM: %lu Mhz\n",
114 sysinfo.freqSystemBus / 1000000);
117 puts(" L1 D-cache 32KB, L1 I-cache 32KB enabled.\n");
123 /* ------------------------------------------------------------------------- */
125 int do_reset (cmd_tbl_t *cmdtp, bd_t *bd, int flag, int argc, char *argv[])
128 * Initiate hard reset in debug control register DBCR0
129 * Make sure MSR[DE] = 1
142 * Get timebase clock frequency
144 unsigned long get_tbclk (void)
149 get_sys_info(&sys_info);
150 return ((sys_info.freqSystemBus + 3L) / 4L);
154 #if defined(CONFIG_WATCHDOG)
158 int re_enable = disable_interrupts();
159 reset_85xx_watchdog();
160 if (re_enable) enable_interrupts();
164 reset_85xx_watchdog(void)
167 * Clear TSR(WIS) bit by writing 1
174 #endif /* CONFIG_WATCHDOG */
176 #if defined(CONFIG_DDR_ECC)
177 void dma_init(void) {
178 volatile immap_t *immap = (immap_t *)CFG_IMMR;
179 volatile ccsr_dma_t *dma = &immap->im_dma;
181 dma->satr0 = 0x02c40000;
182 dma->datr0 = 0x02c40000;
183 asm("sync; isync; msync");
187 uint dma_check(void) {
188 volatile immap_t *immap = (immap_t *)CFG_IMMR;
189 volatile ccsr_dma_t *dma = &immap->im_dma;
190 volatile uint status = dma->sr0;
192 /* While the channel is busy, spin */
193 while((status & 4) == 4) {
198 printf ("DMA Error: status = %x\n", status);
203 int dma_xfer(void *dest, uint count, void *src) {
204 volatile immap_t *immap = (immap_t *)CFG_IMMR;
205 volatile ccsr_dma_t *dma = &immap->im_dma;
207 dma->dar0 = (uint) dest;
208 dma->sar0 = (uint) src;
210 dma->mr0 = 0xf000004;
211 asm("sync;isync;msync");
212 dma->mr0 = 0xf000005;
213 asm("sync;isync;msync");