aboutsummaryrefslogtreecommitdiff
path: root/hw/sbe.c
blob: 8595816626be61a108c8c9615adb4776c3f2d638 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
// SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later

/*
 * SBE communication driver (common code)
 */

#define pr_fmt(fmt) "SBE: " fmt

#include <sbe.h>
#include <sbe-p8.h>
#include <sbe-p9.h>
#include <skiboot.h>
#include <stdbool.h>

bool sbe_has_timer = false;

void sbe_update_timer_expiry(uint64_t target)
{
	assert(sbe_timer_ok);

	if (proc_gen == proc_gen_p9 || proc_gen == proc_gen_p10)
		p9_sbe_update_timer_expiry(target);

#ifdef CONFIG_P8
	if (proc_gen == proc_gen_p8)
		p8_sbe_update_timer_expiry(target);
#endif
}

bool sbe_timer_ok(void)
{
	return sbe_has_timer;
}