Skip to content
Snippets Groups Projects
Commit 1cc37bfd authored by Goran Ferenc's avatar Goran Ferenc Committed by Miodrag Dinic
Browse files

MIPS: Attach goldfish machine reset and power-off routines


If "reboot" or "reboot -p" are requested from the emulator, these
routines will be triggered which in return should reset or power-off the
machine.

This simple power management device is mapped at 0x1f007000 address.
It contains only one register, which holds commands to be performed.
    GORESET: 0x42 command for reboot
    GOPOWEROFF: 0x43 command for shutdown

Change-Id: I73654a7cc6e8ffbac4b3867561ba713892440328
Signed-off-by: default avatarGoran Ferenc <goran.ferenc@imgtec.com>
parent 9a98ffcb
No related branches found
No related tags found
No related merge requests found
...@@ -6,5 +6,6 @@ obj-y += goldfish-platform.o goldfish-interrupt.o ...@@ -6,5 +6,6 @@ obj-y += goldfish-platform.o goldfish-interrupt.o
obj-y += goldfish-time.o obj-y += goldfish-time.o
obj-y += pdev_bus.o obj-y += pdev_bus.o
obj-y += switch.o pm.o obj-y += switch.o pm.o
obj-y += goldfish-reset.o
#EXTRA_CFLAGS += -Werror #EXTRA_CFLAGS += -Werror
/* arch/mips/goldfish/goldfish-reset.c
*
* Goldfish Machine Reset Routines
*
* Copyright (C) 2007 Google, Inc.
*
* This software is licensed under the terms of the GNU General Public
* License version 2, as published by the Free Software Foundation, and
* may be copied, distributed, and modified under those terms.
*
* This program is distributed in the hope that 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.
*
*/
#include <linux/init.h>
#include <linux/pm.h>
#include <asm/io.h>
#include <asm/reboot.h>
#include <asm/mips-boards/generic.h>
#define GOLDFISH_RESET 0x1f007000
#define GOSHUTDOWN 0x43
unsigned int __iomem *softres_reg;
static void mips_machine_restart(char *command)
{
__raw_writel(GORESET, softres_reg);
}
static void mips_machine_halt(void)
{
__raw_writel(GOSHUTDOWN, softres_reg);
}
static int __init mips_reboot_setup(void)
{
softres_reg = ioremap(GOLDFISH_RESET, sizeof(unsigned int));
_machine_restart = mips_machine_restart;
_machine_halt = mips_machine_halt;
pm_power_off = mips_machine_halt;
return 0;
}
arch_initcall(mips_reboot_setup);
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment