/*1* linux/arch/mips/sni/process.c2*3* Reset a SNI machine.4*/5#include <asm/io.h>6#include <asm/reboot.h>7#include <asm/system.h>8#include <asm/sni.h>910/*11* This routine reboots the machine by asking the keyboard12* controller to pulse the reset-line low. We try that for a while,13* and if it doesn't work, we do some other stupid things.14*/15static inline void kb_wait(void)16{17int i;1819for (i = 0; i < 0x10000; i++)20if ((inb_p(0x64) & 0x02) == 0)21break;22}2324/* XXX This ends up at the ARC firmware prompt ... */25void sni_machine_restart(char *command)26{27int i, j;2829/* This does a normal via the keyboard controller like a PC.30We can do that easier ... */31local_irq_disable();32for (;;) {33for (i = 0; i < 100; i++) {34kb_wait();35for (j = 0; j < 100000 ; j++)36/* nothing */;37outb_p(0xfe, 0x64); /* pulse reset low */38}39}40}4142void sni_machine_power_off(void)43{44*(volatile unsigned char *)PCIMT_CSWCSM = 0xfd;45}464748