2 #include <linux/init.h>
3 #include <linux/kernel.h>
6 #include <linux/ioport.h>
7 #include <asm/reboot.h>
8 #include <asm/system.h>
10 #include <ifxmips_cgu.h>
12 #define SYSTEM_DANUBE "Danube"
13 #define SYSTEM_DANUBE_CHIPID1 0x00129083
14 #define SYSTEM_DANUBE_CHIPID2 0x0012B083
16 #define SYSTEM_TWINPASS "Twinpass"
17 #define SYSTEM_TWINPASS_CHIPID 0x0012D083
19 static unsigned int chiprev
= 0;
20 unsigned char ifxmips_sys_type
[IFXMIPS_SYS_TYPE_LEN
];
23 ifxmips_get_cpu_ver(void)
25 return (ifxmips_r32(IFXMIPS_MPS_CHIPID
) & 0xF0000000) >> 28;
27 EXPORT_SYMBOL(ifxmips_get_cpu_ver
);
32 return ifxmips_sys_type
;
36 ifxmips_machine_restart(char *command
)
38 printk(KERN_NOTICE
"System restart\n");
40 ifxmips_w32(ifxmips_r32(IFXMIPS_RCU_RST
) | IFXMIPS_RCU_RST_ALL
,
46 ifxmips_machine_halt(void)
48 printk(KERN_NOTICE
"System halted.\n");
54 ifxmips_machine_power_off(void)
56 printk(KERN_NOTICE
"Please turn off the power now.\n");
62 ifxmips_soc_setup(void)
64 char *name
= SYSTEM_DANUBE
;
65 ioport_resource
.start
= IOPORT_RESOURCE_START
;
66 ioport_resource
.end
= IOPORT_RESOURCE_END
;
67 iomem_resource
.start
= IOMEM_RESOURCE_START
;
68 iomem_resource
.end
= IOMEM_RESOURCE_END
;
70 _machine_restart
= ifxmips_machine_restart
;
71 _machine_halt
= ifxmips_machine_halt
;
72 pm_power_off
= ifxmips_machine_power_off
;
74 chiprev
= (ifxmips_r32(IFXMIPS_MPS_CHIPID
) & 0x0FFFFFFF);
78 case SYSTEM_DANUBE_CHIPID1
:
79 case SYSTEM_DANUBE_CHIPID2
:
83 case SYSTEM_TWINPASS_CHIPID
:
84 name
= SYSTEM_TWINPASS
;
88 printk(KERN_ERR
"This is not a danube chiprev : 0x%08X\n", chiprev
);
92 snprintf(ifxmips_sys_type
, IFXMIPS_SYS_TYPE_LEN
- 1, "%s rev1.%d %dMhz",
93 name
, ifxmips_get_cpu_ver(),
94 ifxmips_get_cpu_hz() / 1000000);
95 ifxmips_sys_type
[IFXMIPS_SYS_TYPE_LEN
- 1] = '\0';