summaryrefslogtreecommitdiff
path: root/zephyr/include/emul/emul_amd_fp6.h
blob: 04dcd5dd3196abe3e7ab846724cbf18a0a19f446 (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
34
35
36
37
38
39
40
41
/* Copyright 2023 The ChromiumOS Authors
 * Use of this source code is governed by a BSD-style license that can be
 * found in the LICENSE file.
 */

#ifndef EMUL_AMD_FP6_USB_MUX_H
#define EMUL_AMD_FP6_USB_MUX_H

#include <zephyr/drivers/emul.h>

/**
 * Reset the emulator's registers to their power-on value.
 *
 * @param emul - AMD FP6 emulator data
 */
void amd_fp6_emul_reset_regs(const struct emul *emul);

/**
 * Set whether the crossbar is ready to process commands.  On a real
 * system, it is typically not ready for some time after powering on to S0.
 *
 * @param emul - AMD FP6 emulator data
 * @param ready - whether the xbar should report it's ready
 *		 (emulator init default is on)
 */
void amd_fp6_emul_set_xbar(const struct emul *emul, bool ready);

/**
 * Set how long a command will take to complete.  On a real system this can be
 * anywhere from 50-100ms and the datasheet defines it can take up to 250ms.
 *
 * Getting timing to sync consistently in unit testing is difficult, so use the
 * number of reads to wait instead.
 *
 * @param emul - AMD FP6 emulator data
 * @param delay_reads - how long after a mux set to wait before reporting the
 *		     status of the set as complete (in number of reads)
 */
void amd_fp6_emul_set_delay(const struct emul *emul, int delay_reads);

#endif