blob: f542368f48d77bfa06b85d3fd4f6573c64ac1c94 [file] [log] [blame]
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001/* Copyright (c) 2011, Code Aurora Forum. All rights reserved.
2 *
3 * This program is free software; you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License version 2 and
5 * only version 2 as published by the Free Software Foundation.
6 *
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 * GNU General Public License for more details.
11 *
12 */
13
14#include <linux/module.h>
15#include <linux/moduleparam.h>
16#include <linux/kernel.h>
17#include <linux/init.h>
18#include <linux/reboot.h>
19#include <linux/io.h>
20#include <linux/delay.h>
21#include <mach/gpio.h>
22
23#define FEMTO_GPIO_PS_HOLD 161
24
25void arch_reset(char mode, const char *cmd)
26{
27 pr_notice("Going down for restart now\n");
28 msleep(3000);
29
30 /* Configure FEMTO_GPIO_PS_HOLD as a general purpose output */
31 if (gpio_tlmm_config(GPIO_CFG(FEMTO_GPIO_PS_HOLD, 0,
32 GPIO_CFG_OUTPUT, GPIO_CFG_NO_PULL,
33 GPIO_CFG_2MA), GPIO_CFG_ENABLE))
34 pr_err("%s: gpio_tlmm_config (gpio=%d) failed\n",
35 __func__, FEMTO_GPIO_PS_HOLD);
36
37 /* Now set it low to power cycle the entire board */
38 gpio_set_value(FEMTO_GPIO_PS_HOLD, 0);
39
40 msleep(10000);
41 pr_err("Restarting has failed\n");
42}