mirror of
https://source.denx.de/u-boot/u-boot.git
synced 2025-08-19 13:41:31 +02:00
Remove <common.h> from all mach-npcm files and when needed add missing include files directly. Signed-off-by: Tom Rini <trini@konsulko.com>
37 lines
618 B
C
37 lines
618 B
C
// SPDX-License-Identifier: GPL-2.0+
|
|
/*
|
|
* Copyright (c) 2022 Nuvoton Technology Corp.
|
|
*/
|
|
|
|
#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;
|
|
}
|