diff options
| author | fishsoupisgood <github@madingley.org> | 2019-04-29 01:17:54 +0100 | 
|---|---|---|
| committer | fishsoupisgood <github@madingley.org> | 2019-05-27 03:43:43 +0100 | 
| commit | 3f2546b2ef55b661fd8dd69682b38992225e86f6 (patch) | |
| tree | 65ca85f13617aee1dce474596800950f266a456c /roms/u-boot/arch/arm/cpu/arm1176/bcm2835/reset.c | |
| download | qemu-master.tar.gz qemu-master.tar.bz2 qemu-master.zip  | |
Diffstat (limited to 'roms/u-boot/arch/arm/cpu/arm1176/bcm2835/reset.c')
| -rw-r--r-- | roms/u-boot/arch/arm/cpu/arm1176/bcm2835/reset.c | 35 | 
1 files changed, 35 insertions, 0 deletions
diff --git a/roms/u-boot/arch/arm/cpu/arm1176/bcm2835/reset.c b/roms/u-boot/arch/arm/cpu/arm1176/bcm2835/reset.c new file mode 100644 index 00000000..8c37ad9f --- /dev/null +++ b/roms/u-boot/arch/arm/cpu/arm1176/bcm2835/reset.c @@ -0,0 +1,35 @@ +/* + * (C) Copyright 2012 Stephen Warren + * + * See file CREDITS for list of people who contributed to this + * project. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * version 2 as published by the Free Software Foundation. + * + * 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 <common.h> +#include <asm/io.h> +#include <asm/arch/wdog.h> + +#define RESET_TIMEOUT 10 + +void reset_cpu(ulong addr) +{ +	struct bcm2835_wdog_regs *regs = +		(struct bcm2835_wdog_regs *)BCM2835_WDOG_PHYSADDR; +	uint32_t rstc; + +	rstc = readl(®s->rstc); +	rstc &= ~BCM2835_WDOG_RSTC_WRCFG_MASK; +	rstc |= BCM2835_WDOG_RSTC_WRCFG_FULL_RESET; + +	writel(BCM2835_WDOG_PASSWORD | RESET_TIMEOUT, ®s->wdog); +	writel(BCM2835_WDOG_PASSWORD | rstc, ®s->rstc); +}  | 
