blob: 4387c18d3d420620673fb792d0c44e867af44bab [file] [log] [blame]
wdenk2d5b5612003-10-14 19:43:55 +00001/*
2 * (C) Copyright 2002
3 * Sysgo Real-Time Solutions, GmbH <www.elinos.com>
4 * Marius Groeger <mgroeger@sysgo.de>
5 *
6 * (C) Copyright 2002
7 * Sysgo Real-Time Solutions, GmbH <www.elinos.com>
8 * Alex Zuepke <azu@sysgo.de>
9 *
Wolfgang Denk1a459662013-07-08 09:37:19 +020010 * SPDX-License-Identifier: GPL-2.0+
wdenk2d5b5612003-10-14 19:43:55 +000011 */
12
13/*
14 * CPU specific code
15 */
16
17#include <common.h>
18#include <command.h>
Ben Warrencc940742008-09-05 01:55:22 -040019#include <netdev.h>
wdenk2d5b5612003-10-14 19:43:55 +000020#include <asm/arch/ixp425.h>
Jean-Christophe PLAGNIOL-VILLARD677e62f2009-04-05 13:02:43 +020021#include <asm/system.h>
wdenk2d5b5612003-10-14 19:43:55 +000022
Jean-Christophe PLAGNIOL-VILLARDb3acb6c2009-04-05 13:06:31 +020023static void cache_flush(void);
24
Wolfgang Denkba94a1b2006-05-30 15:56:48 +020025#if defined(CONFIG_DISPLAY_CPUINFO)
26int print_cpuinfo (void)
27{
28 unsigned long id;
29 int speed = 0;
30
31 asm ("mrc p15, 0, %0, c0, c0, 0":"=r" (id));
32
33 puts("CPU: Intel IXP425 at ");
34 switch ((id & 0x000003f0) >> 4) {
35 case 0x1c:
Wolfgang Denkba94a1b2006-05-30 15:56:48 +020036 speed = 533;
37 break;
38
39 case 0x1d:
Wolfgang Denkba94a1b2006-05-30 15:56:48 +020040 speed = 400;
41 break;
42
43 case 0x1f:
Wolfgang Denkba94a1b2006-05-30 15:56:48 +020044 speed = 266;
45 break;
46 }
47
48 if (speed)
49 printf("%d MHz\n", speed);
50 else
51 puts("unknown revision\n");
52
53 return 0;
54}
55#endif /* CONFIG_DISPLAY_CPUINFO */
56
wdenk2d5b5612003-10-14 19:43:55 +000057int cleanup_before_linux (void)
58{
59 /*
60 * this function is called just before we call linux
61 * it prepares the processor for linux
62 *
63 * just disable everything that can disturb booting linux
64 */
65
wdenk2d5b5612003-10-14 19:43:55 +000066 disable_interrupts ();
67
68 /* turn off I-cache */
Jean-Christophe PLAGNIOL-VILLARDb3acb6c2009-04-05 13:06:31 +020069 icache_disable();
70 dcache_disable();
wdenk2d5b5612003-10-14 19:43:55 +000071
72 /* flush I-cache */
Jean-Christophe PLAGNIOL-VILLARDb3acb6c2009-04-05 13:06:31 +020073 cache_flush();
wdenk2d5b5612003-10-14 19:43:55 +000074
Jean-Christophe PLAGNIOL-VILLARDb3acb6c2009-04-05 13:06:31 +020075 return 0;
wdenk2d5b5612003-10-14 19:43:55 +000076}
77
Jean-Christophe PLAGNIOL-VILLARDb3acb6c2009-04-05 13:06:31 +020078/* flush I/D-cache */
79static void cache_flush (void)
wdenk2d5b5612003-10-14 19:43:55 +000080{
Jean-Christophe PLAGNIOL-VILLARDb3acb6c2009-04-05 13:06:31 +020081 unsigned long i = 0;
wdenk2d5b5612003-10-14 19:43:55 +000082
Jean-Christophe PLAGNIOL-VILLARDb3acb6c2009-04-05 13:06:31 +020083 asm ("mcr p15, 0, %0, c7, c5, 0": :"r" (i));
wdenk2d5b5612003-10-14 19:43:55 +000084}
85
86/* FIXME */
wdenka1191902005-01-09 17:12:27 +000087/*
wdenk2d5b5612003-10-14 19:43:55 +000088void pci_init(void)
89{
90 return;
91}
wdenka1191902005-01-09 17:12:27 +000092*/
Wolfgang Denkba94a1b2006-05-30 15:56:48 +020093
Ben Warrencc940742008-09-05 01:55:22 -040094int cpu_eth_init(bd_t *bis)
95{
96#ifdef CONFIG_IXP4XX_NPE
97 npe_initialize(bis);
98#endif
99 return 0;
100}