diff --git a/xen/arch/arm/platforms/sunxi.c b/xen/arch/arm/platforms/sunxi.c index fb12801..7b728a4 100644 --- a/xen/arch/arm/platforms/sunxi.c +++ b/xen/arch/arm/platforms/sunxi.c @@ -16,7 +16,31 @@ * GNU General Public License for more details. */ +#include +#include +#include #include +#include + +static void sunxi_reset(void) +{ + void __iomem *wdt; + + wdt = ioremap_nocache(SUNXI_WDT_BASE & PAGE_MASK, PAGE_SIZE); + if ( !wdt ) + { + dprintk(XENLOG_ERR, "Unable to map watchdog!\n"); + return; + } + + writel(SUNXI_WDT_MODE_EN | SUNXI_WDT_MODE_RST_EN, wdt + ((SUNXI_WDT_BASE + SUNXI_WDT_MODE) & ~PAGE_MASK)); + iounmap(wdt); + + for (;;) + { + __asm("wfi"); + } +} static const char * const sunxi_dt_compat[] __initconst = { @@ -37,6 +61,7 @@ static const struct dt_device_match sunxi_blacklist_dev[] __initconst = PLATFORM_START(sunxi, "Allwinner A20") .compatible = sunxi_dt_compat, .blacklist_dev = sunxi_blacklist_dev, + .reset = sunxi_reset, .dom0_gnttab_start = 0x01d00000, .dom0_gnttab_size = 0x20000,