mirror of
https://github.com/smaeul/u-boot.git
synced 2025-11-01 04:28:36 +00:00
When bringing in the series 'arm: dts: am62-beagleplay: Fix Beagleplay Ethernet"' I failed to notice that b4 noticed it was based on next and so took that as the base commit and merged that part of next to master. This reverts commit c8ffd1356d42223cbb8c86280a083cc3c93e6426, reversing changes made to 2ee6f3a5f7550de3599faef9704e166e5dcace35. Reported-by: Jonas Karlman <jonas@kwiboo.se> Signed-off-by: Tom Rini <trini@konsulko.com>
38 lines
638 B
C
38 lines
638 B
C
// SPDX-License-Identifier: GPL-2.0+
|
|
/*
|
|
* Copyright (c) 2022 Nuvoton Technology Corp.
|
|
*/
|
|
|
|
#include <common.h>
|
|
#include <asm/io.h>
|
|
#include <asm/arch/gcr.h>
|
|
#include <asm/arch/rst.h>
|
|
|
|
void reset_cpu(void)
|
|
{
|
|
/* Generate a watchdog0 reset */
|
|
writel(WTCR_WTR | WTCR_WTRE | WTCR_WTE, WTCR0_REG);
|
|
|
|
while (1)
|
|
;
|
|
}
|
|
|
|
void reset_misc(void)
|
|
{
|
|
struct npcm_gcr *gcr = (struct npcm_gcr *)NPCM_GCR_BA;
|
|
|
|
clrbits_le32(&gcr->intcr2, INTCR2_WDC);
|
|
}
|
|
|
|
int npcm_get_reset_status(void)
|
|
{
|
|
struct npcm_gcr *gcr = (struct npcm_gcr *)NPCM_GCR_BA;
|
|
u32 val;
|
|
|
|
val = readl(&gcr->ressr);
|
|
if (!val)
|
|
val = readl(&gcr->intcr2);
|
|
|
|
return val & RST_STS_MASK;
|
|
}
|