[BACK]Return to reset.c CVS log [TXT][DIR] Up to [Development] / linux-2.4-xfs / arch / mips / pmc-sierra / stretch

File: [Development] / linux-2.4-xfs / arch / mips / pmc-sierra / stretch / reset.c (download)

Revision 1.1, Thu Jan 20 13:59:19 2005 UTC (12 years, 8 months ago) by nathans.longdrop.melbourne.sgi.com
Branch: MAIN
CVS Tags: HEAD

Merge up to 2.4.29.
Merge of 2.4.x-xfs-melb:linux:21231a by kenmcd.

/*
 * Copyright PMC-Sierra Inc. 
 * Author : Manish Lachwani (lachwani@pmc-sierra.com)
 *
 * This program is free software; you can redistribute  it and/or modify it
 * under  the terms of  the GNU General  Public License as published by the
 * Free Software Foundation;  either version 2 of the  License, or (at your
 * option) any later version.
 *
 */
#include <asm/io.h>
#include <asm/reboot.h>
#include <asm/system.h>
#include <linux/delay.h>
#include "setup.h"

void pmc_stretch_restart(char *command)
{
	/* base address of timekeeper portion of part */
	void *nvram = (void *)PMC_STRETCH_NVRAM_BASE;

 	/* Ask the NVRAM/RTC/watchdog chip to assert reset in 1/16 second */
	writeb(0x84, nvram + 0xff7);

	/* wait for the watchdog to go off */
	mdelay(100+(1000/16));

	/* if the watchdog fails for some reason, let people know */
	printk(KERN_NOTICE "Watchdog reset failed\n");
}

void pmc_stretch_halt(void)
{
	printk(KERN_NOTICE "\n** You can safely turn off the power\n");
	while (1)
		__asm__(".set\tmips3\n\t"
	                "wait\n\t"
			".set\tmips0");
}

void pmc_stretch_power_off(void)
{
	pmc_stretch_halt();
}