coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
reset.c
Go to the documentation of this file.
1
/* SPDX-License-Identifier: GPL-2.0-only */
2
3
#include <
console/console.h
>
4
#include <
device/mmio.h
>
5
#include <soc/iomap.h>
6
#include <reset.h>
7
8
/* Watchdog bite time set to default reset value */
9
#define RESET_WDT_BITE_TIME 0x31F3
10
11
/* Watchdog bark time value is kept larger than the watchdog timeout
12
* of 0x31F3, effectively disabling the watchdog bark interrupt
13
*/
14
#define RESET_WDT_BARK_TIME (5 * RESET_WDT_BITE_TIME)
15
16
static
void
wdog_reset
(
void
)
17
{
18
printk
(
BIOS_DEBUG
,
"\nResetting with watchdog!\n"
);
19
20
write32
(
APCS_WDT0_EN
, 0);
21
write32
(
APCS_WDT0_RST
, 1);
22
write32
(
APCS_WDT0_BARK_TIME
,
RESET_WDT_BARK_TIME
);
23
write32
(
APCS_WDT0_BITE_TIME
,
RESET_WDT_BITE_TIME
);
24
write32
(
APCS_WDT0_EN
, 1);
25
write32
(
APCS_WDT0_CPU0_WDOG_EXPIRED_ENABLE
, 1);
26
}
27
28
void
do_board_reset
(
void
)
29
{
30
wdog_reset
();
31
}
write32
static void write32(void *addr, uint32_t val)
Definition:
mmio.h:40
printk
#define printk(level,...)
Definition:
stdlib.h:16
console.h
mmio.h
BIOS_DEBUG
#define BIOS_DEBUG
BIOS_DEBUG - Verbose output.
Definition:
loglevel.h:128
do_board_reset
void do_board_reset(void)
Definition:
reset.c:8
wdog_reset
static void wdog_reset(void)
Definition:
reset.c:16
RESET_WDT_BARK_TIME
#define RESET_WDT_BARK_TIME
Definition:
reset.c:14
RESET_WDT_BITE_TIME
#define RESET_WDT_BITE_TIME
Definition:
reset.c:9
APCS_WDT0_EN
#define APCS_WDT0_EN
Definition:
iomap.h:28
APCS_WDT0_CPU0_WDOG_EXPIRED_ENABLE
#define APCS_WDT0_CPU0_WDOG_EXPIRED_ENABLE
Definition:
iomap.h:33
APCS_WDT0_BARK_TIME
#define APCS_WDT0_BARK_TIME
Definition:
iomap.h:30
APCS_WDT0_BITE_TIME
#define APCS_WDT0_BITE_TIME
Definition:
iomap.h:31
APCS_WDT0_RST
#define APCS_WDT0_RST
Definition:
iomap.h:29
src
mainboard
google
storm
reset.c
Generated by
1.9.1