1/* 2 * This program is free software; you can redistribute it and/or modify it 3 * under the terms of the GNU General Public License as published by the 4 * Free Software Foundation; either version 2 of the License, or (at your 5 * option) any later version. 6 * 7 * Copyright (C) 1997, 2001 Ralf Baechle 8 * Copyright 2001 MontaVista Software Inc. 9 * Author: jsun@mvista.com or jsun@junsun.net 10 */ 11#include <linux/sched.h> 12#include <linux/mm.h> 13#include <asm/io.h> 14#include <asm/pgtable.h> 15#include <asm/processor.h> 16#include <asm/reboot.h> 17#include <asm/system.h> 18 19void nec_osprey_restart(char *command) 20{ 21 set_c0_status(ST0_ERL); 22 change_c0_config(CONF_CM_CMASK, CONF_CM_UNCACHED); 23 flush_cache_all(); 24 write_c0_wired(0); 25 __asm__ __volatile__("jr\t%0"::"r"(0xbfc00000)); 26} 27 28void nec_osprey_halt(void) 29{ 30 printk(KERN_NOTICE "\n** You can safely turn off the power\n"); 31 while (1) 32 __asm__(".set\tmips3\n\t" 33 "wait\n\t" 34 ".set\tmips0"); 35} 36 37void nec_osprey_power_off(void) 38{ 39 nec_osprey_halt(); 40} 41