1/*	$NetBSD: init.h,v 1.3 2021/12/18 23:45:33 riastradh Exp $	*/
2
3/* SPDX-License-Identifier: MIT */
4#ifndef __NVBIOS_INIT_H__
5#define __NVBIOS_INIT_H__
6
7struct nvbios_init {
8	struct nvkm_subdev *subdev;
9	u32 offset;
10
11	struct dcb_output *outp;
12	int or;
13	int link;
14	int head;
15
16	/* internal state used during parsing */
17	u8 execute;
18	u32 nested;
19	u32 repeat;
20	u32 repend;
21	u32 ramcfg;
22};
23
24#define nvbios_init(s,o,ARGS...) ({                                            \
25	struct nvbios_init init = {                                            \
26		.subdev = (s),                                                 \
27		.offset = (o),                                                 \
28		.or = -1,                                                      \
29		.link = 0,                                                     \
30		.head = -1,                                                    \
31		.execute = 1,                                                  \
32	};                                                                     \
33	ARGS                                                                   \
34	nvbios_exec(&init);                                                    \
35})
36int nvbios_exec(struct nvbios_init *);
37
38int nvbios_post(struct nvkm_subdev *, bool execute);
39#endif
40