// SPDX-License-Identifier: GPL-2.01/*2* linux/arch/mips/sni/process.c3*4* Reset a SNI machine.5*/6#include <linux/delay.h>78#include <asm/io.h>9#include <asm/reboot.h>10#include <asm/sni.h>1112/*13* This routine reboots the machine by asking the keyboard14* controller to pulse the reset-line low. We try that for a while,15* and if it doesn't work, we do some other stupid things.16*/17static inline void kb_wait(void)18{19int i;2021for (i = 0; i < 0x10000; i++)22if ((inb_p(0x64) & 0x02) == 0)23break;24}2526/* XXX This ends up at the ARC firmware prompt ... */27void sni_machine_restart(char *command)28{29int i;3031/* This does a normal via the keyboard controller like a PC.32We can do that easier ... */33local_irq_disable();34for (;;) {35for (i = 0; i < 100; i++) {36kb_wait();37udelay(50);38outb_p(0xfe, 0x64); /* pulse reset low */39udelay(50);40}41}42}4344void sni_machine_power_off(void)45{46*(volatile unsigned char *)PCIMT_CSWCSM = 0xfd;47}484950