/*.
 *
 * ########################################################################
 *
 *  This program is free software; you can distribute it and/or modify it
 *  under the terms of the GNU General Public License (Version 2) as
 *  published by the Free Software Foundation.
 *
 *  This program is distributed in the hope it will be useful, but WITHOUT
 *  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 *  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
 *  for more details.
 *
 *  You should have received a copy of the GNU General Public License along
 *  with this program; if not, write to the Free Software Foundation, Inc.,
 *  59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
 *
 * ########################################################################
 *
 * Reset the PNX833X board.
 *
 */

#include <linux/slab.h>
#include <linux/timedoctor.h>
#include <asm/reboot.h>
#include <pnx833x.h>

void pnx833x_machine_restart(char *command)
{
	printk("\n\nRestarting ...\n\n");

#if defined(CONFIG_TIME_DOCTOR)
	timeDoctor_Info(TDI_COMMAND(TDI_GENERIC, TDI_STOP), CHAR_ARRAY_TO_U32("Mrst"), 0);
#endif

	PNX833X_RESET_CONTROL_2 = 0;
	PNX833X_RESET_CONTROL = 0;
}

void pnx833x_machine_halt(void)
{
	printk("\n\nSystem halted.\n\n");

#if defined(CONFIG_TIME_DOCTOR)
	timeDoctor_Info(TDI_COMMAND(TDI_GENERIC, TDI_STOP), CHAR_ARRAY_TO_U32("Mhlt"), 0);
#endif

	while (1) {
		__asm__ __volatile__ ("wait");
	}
}

void pnx833x_machine_power_off(void)
{
	printk("\n\nPower off not implemented.");
	pnx833x_machine_halt();
}
