1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33#include <common.h>
34#include <command.h>
35#include <netdev.h>
36#include <asm/arch/ixp425.h>
37#include <asm/system.h>
38
39ulong loops_per_jiffy;
40
41static void cache_flush(void);
42
43#if defined(CONFIG_DISPLAY_CPUINFO)
44int print_cpuinfo (void)
45{
46 unsigned long id;
47 int speed = 0;
48
49 asm ("mrc p15, 0, %0, c0, c0, 0":"=r" (id));
50
51 puts("CPU: Intel IXP425 at ");
52 switch ((id & 0x000003f0) >> 4) {
53 case 0x1c:
54 loops_per_jiffy = 887467;
55 speed = 533;
56 break;
57
58 case 0x1d:
59 loops_per_jiffy = 666016;
60 speed = 400;
61 break;
62
63 case 0x1f:
64 loops_per_jiffy = 442901;
65 speed = 266;
66 break;
67 }
68
69 if (speed)
70 printf("%d MHz\n", speed);
71 else
72 puts("unknown revision\n");
73
74 return 0;
75}
76#endif
77
78int cleanup_before_linux (void)
79{
80
81
82
83
84
85
86
87 disable_interrupts ();
88
89
90 icache_disable();
91 dcache_disable();
92
93
94 cache_flush();
95
96 return 0;
97}
98
99
100static void cache_flush (void)
101{
102 unsigned long i = 0;
103
104 asm ("mcr p15, 0, %0, c7, c5, 0": :"r" (i));
105}
106
107
108
109
110
111
112
113
114
115#ifdef CONFIG_BOOTCOUNT_LIMIT
116
117void bootcount_store (ulong a)
118{
119 volatile ulong *save_addr = (volatile ulong *)(CONFIG_SYS_BOOTCOUNT_ADDR);
120
121 save_addr[0] = a;
122 save_addr[1] = BOOTCOUNT_MAGIC;
123}
124
125ulong bootcount_load (void)
126{
127 volatile ulong *save_addr = (volatile ulong *)(CONFIG_SYS_BOOTCOUNT_ADDR);
128
129 if (save_addr[1] != BOOTCOUNT_MAGIC)
130 return 0;
131 else
132 return save_addr[0];
133}
134
135#endif
136
137int cpu_eth_init(bd_t *bis)
138{
139#ifdef CONFIG_IXP4XX_NPE
140 npe_initialize(bis);
141#endif
142 return 0;
143}
144