1 /* linux/arch/arm/mach-vt8500/restart.c
3 * Copyright (C) 2012 Tony Prisk <linux@prisktech.co.nz>
5 * This software is licensed under the terms of the GNU General Public
6 * License version 2, as published by the Free Software Foundation, and
7 * may be copied, distributed, and modified under those terms.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
17 #include <linux/of_address.h>
19 #define LEGACY_PMC_BASE 0xD8130000
20 #define WMT_PRIZM_PMSR_REG 0x60
22 static void __iomem
*pmc_base
;
24 void wmt_setup_restart(void)
26 struct device_node
*np
;
29 * Check if Power Mgmt Controller node is present in device tree. If no
30 * device tree node, use the legacy PMSR value (valid for all current
33 np
= of_find_compatible_node(NULL
, NULL
, "wmt,prizm-pmc");
35 pmc_base
= of_iomap(np
, 0);
38 pr_err("%s:of_iomap(pmc) failed\n", __func__
);
42 pmc_base
= ioremap(LEGACY_PMC_BASE
, 0x1000);
44 pr_err("%s:ioremap(rstc) failed\n", __func__
);
50 void wmt_restart(char mode
, const char *cmd
)
53 writel(1, pmc_base
+ WMT_PRIZM_PMSR_REG
);