1 #include <linux/init.h>
2 #include <linux/reboot.h>
4 #include <asm/reboot.h>
7 static void adm8668_restart(char *cmd
)
11 /* stop eth0 and eth1 */
12 ADM8668_LAN_REG(NETCSR6
) = (1 << 13) | (1 << 1);
13 ADM8668_LAN_REG(NETCSR7
) = 0;
14 ADM8668_WAN_REG(NETCSR6
) = (1 << 13) | (1 << 1);
15 ADM8668_WAN_REG(NETCSR7
) = 0;
18 ADM8668_WAN_REG(NETCSR37
) = 0x20;
19 for (i
= 0; i
< 10000; i
++)
21 ADM8668_WAN_REG(NETCSR37
) = 0;
22 for (i
= 0; i
< 10000; i
++)
26 for (i
= 0; i
< 1000; i
++)
28 ADM8668_CONFIG_REG(ADM8668_CR1
) = 1;
31 void __init
plat_mem_setup(void)
33 _machine_restart
= adm8668_restart
;
36 const char *get_system_type(void)
38 unsigned long chipid
= ADM8668_CONFIG_REG(ADM8668_CR0
);
39 int adj
= (ADM8668_CONFIG_REG(ADM8668_CR3
) >> 11) & 0xf;
40 int product
, revision
, mhz
;
43 product
= chipid
>> 16;
44 revision
= chipid
& 0xffff;
45 mhz
= (SYS_CLOCK
/1000000) + (adj
* 5);
47 /* i getting fancy :\ */
48 snprintf(ret
, sizeof(ret
), "ADM%xr%x %dMHz", product
, revision
, mhz
);