blob: 7c516ed9af15c6290a6fa81e0f6f8bc10d71e8fb [file] [log] [blame]
David Brazdil0f672f62019-12-10 10:32:29 +00001// SPDX-License-Identifier: GPL-2.0-only
Andrew Scullb4b6d4a2019-01-02 15:54:55 +00002/*
3 * Thomas Horsten <thh@lasat.com>
4 * Copyright (C) 2000 LASAT Networks A/S.
5 *
Andrew Scullb4b6d4a2019-01-02 15:54:55 +00006 * Reset the LASAT board.
7 */
8#include <linux/kernel.h>
9#include <linux/pm.h>
10
11#include <asm/reboot.h>
12#include <asm/lasat/lasat.h>
13
14#include "picvue.h"
15#include "prom.h"
16
17static void lasat_machine_restart(char *command);
18static void lasat_machine_halt(void);
19
20/* Used to set machine to boot in service mode via /proc interface */
21int lasat_boot_to_service;
22
23static void lasat_machine_restart(char *command)
24{
25 local_irq_disable();
26
27 if (lasat_boot_to_service) {
28 *(volatile unsigned int *)0xa0000024 = 0xdeadbeef;
29 *(volatile unsigned int *)0xa00000fc = 0xfedeabba;
30 }
31 *lasat_misc->reset_reg = 0xbedead;
32 for (;;) ;
33}
34
35static void lasat_machine_halt(void)
36{
37 local_irq_disable();
38
39 prom_monitor();
40 for (;;) ;
41}
42
43void lasat_reboot_setup(void)
44{
45 _machine_restart = lasat_machine_restart;
46 _machine_halt = lasat_machine_halt;
47 pm_power_off = lasat_machine_halt;
48}