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
39static void cache_flush(void);
40
41#if defined(CONFIG_DISPLAY_CPUINFO)
42int print_cpuinfo (void)
43{
44 unsigned long id;
45 int speed = 0;
46
47 asm ("mrc p15, 0, %0, c0, c0, 0":"=r" (id));
48
49 puts("CPU: Intel IXP425 at ");
50 switch ((id & 0x000003f0) >> 4) {
51 case 0x1c:
52 speed = 533;
53 break;
54
55 case 0x1d:
56 speed = 400;
57 break;
58
59 case 0x1f:
60 speed = 266;
61 break;
62 }
63
64 if (speed)
65 printf("%d MHz\n", speed);
66 else
67 puts("unknown revision\n");
68
69 return 0;
70}
71#endif
72
73int cleanup_before_linux (void)
74{
75
76
77
78
79
80
81
82 disable_interrupts ();
83
84
85 icache_disable();
86 dcache_disable();
87
88
89 cache_flush();
90
91 return 0;
92}
93
94
95static void cache_flush (void)
96{
97 unsigned long i = 0;
98
99 asm ("mcr p15, 0, %0, c7, c5, 0": :"r" (i));
100}
101
102
103
104
105
106
107
108
109
110#ifdef CONFIG_BOOTCOUNT_LIMIT
111
112void bootcount_store (ulong a)
113{
114 volatile ulong *save_addr = (volatile ulong *)(CONFIG_SYS_BOOTCOUNT_ADDR);
115
116 save_addr[0] = a;
117 save_addr[1] = BOOTCOUNT_MAGIC;
118}
119
120ulong bootcount_load (void)
121{
122 volatile ulong *save_addr = (volatile ulong *)(CONFIG_SYS_BOOTCOUNT_ADDR);
123
124 if (save_addr[1] != BOOTCOUNT_MAGIC)
125 return 0;
126 else
127 return save_addr[0];
128}
129
130#endif
131
132int cpu_eth_init(bd_t *bis)
133{
134#ifdef CONFIG_IXP4XX_NPE
135 npe_initialize(bis);
136#endif
137 return 0;
138}
139