3 * Sysgo Real-Time Solutions, GmbH <www.elinos.com>
4 * Marius Groeger <mgroeger@sysgo.de>
7 * Sysgo Real-Time Solutions, GmbH <www.elinos.com>
8 * Alex Zuepke <azu@sysgo.de>
10 * See file CREDITS for list of people who contributed to this
13 * This program is free software; you can redistribute it and/or
14 * modify it under the terms of the GNU General Public License as
15 * published by the Free Software Foundation; either version 2 of
16 * the License, or (at your option) any later version.
18 * This program is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU General Public License for more details.
23 * You should have received a copy of the GNU General Public License
24 * along with this program; if not, write to the Free Software
25 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
36 #include <asm/arch/ixp425.h>
38 ulong loops_per_jiffy;
41 DECLARE_GLOBAL_DATA_PTR;
44 #if defined(CONFIG_DISPLAY_CPUINFO)
45 int print_cpuinfo (void)
50 asm ("mrc p15, 0, %0, c0, c0, 0":"=r" (id));
52 puts("CPU: Intel IXP425 at ");
53 switch ((id & 0x000003f0) >> 4) {
55 loops_per_jiffy = 887467;
60 loops_per_jiffy = 666016;
65 loops_per_jiffy = 442901;
71 printf("%d MHz\n", speed);
73 puts("unknown revision\n");
77 #endif /* CONFIG_DISPLAY_CPUINFO */
82 * setup up stacks if necessary
85 IRQ_STACK_START = _armboot_start - CONFIG_SYS_MALLOC_LEN - CONFIG_SYS_GBL_DATA_SIZE - 4;
86 FIQ_STACK_START = IRQ_STACK_START - CONFIG_STACKSIZE_IRQ;
89 #if defined(CONFIG_CMD_PCI) || defined (CONFIG_PCI)
95 int cleanup_before_linux (void)
98 * this function is called just before we call linux
99 * it prepares the processor for linux
101 * just disable everything that can disturb booting linux
106 disable_interrupts ();
108 /* turn off I-cache */
109 asm ("mrc p15, 0, %0, c1, c0, 0":"=r" (i));
111 asm ("mcr p15, 0, %0, c1, c0, 0": :"r" (i));
114 asm ("mcr p15, 0, %0, c7, c5, 0": :"r" (i));
119 int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
121 printf ("resetting ...\n");
123 udelay (50000); /* wait 50 ms */
124 disable_interrupts ();
131 /* taken from blob */
132 void icache_enable (void)
136 /* read control register */
137 asm ("mrc p15, 0, %0, c1, c0, 0":"=r" (i));
142 /* write back to control register */
143 asm ("mcr p15, 0, %0, c1, c0, 0": :"r" (i));
146 void icache_disable (void)
150 /* read control register */
151 asm ("mrc p15, 0, %0, c1, c0, 0":"=r" (i));
156 /* write back to control register */
157 asm ("mcr p15, 0, %0, c1, c0, 0": :"r" (i));
160 asm ("mcr p15, 0, %0, c7, c5, 0": :"r" (i));
163 int icache_status (void)
167 /* read control register */
168 asm ("mrc p15, 0, %0, c1, c0, 0":"=r" (i));
174 /* we will never enable dcache, because we have to setup MMU first */
175 void dcache_enable (void)
180 void dcache_disable (void)
185 int dcache_status (void)
187 return 0; /* always off */
198 #ifdef CONFIG_BOOTCOUNT_LIMIT
200 void bootcount_store (ulong a)
202 volatile ulong *save_addr = (volatile ulong *)(CONFIG_SYS_BOOTCOUNT_ADDR);
205 save_addr[1] = BOOTCOUNT_MAGIC;
208 ulong bootcount_load (void)
210 volatile ulong *save_addr = (volatile ulong *)(CONFIG_SYS_BOOTCOUNT_ADDR);
212 if (save_addr[1] != BOOTCOUNT_MAGIC)
218 #endif /* CONFIG_BOOTCOUNT_LIMIT */
220 int cpu_eth_init(bd_t *bis)
222 #ifdef CONFIG_IXP4XX_NPE