xref: /openbsd/sys/arch/riscv64/include/fdt.h (revision baed8f06)
1 /*
2  * Copyright (c) 2016 Patrick Wildt <patrick@blueri.se>
3  *
4  * Permission to use, copy, modify, and distribute this software for any
5  * purpose with or without fee is hereby granted, provided that the above
6  * copyright notice and this permission notice appear in all copies.
7  *
8  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10  * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11  * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15  */
16 
17 #ifndef __RISCV_FDT_H__
18 #define __RISCV_FDT_H__
19 
20 #define _RISCV64_BUS_DMA_PRIVATE
21 #include <machine/bus.h>
22 
23 struct fdt_attach_args {
24 	const char		*fa_name;
25 	int			 fa_node;
26 	bus_space_tag_t		 fa_iot;
27 	bus_dma_tag_t		 fa_dmat;
28 	struct fdt_reg		*fa_reg;
29 	int			 fa_nreg;
30 	uint32_t		*fa_intr;
31 	int			 fa_nintr;
32 	int			 fa_acells;
33 	int			 fa_scells;
34 };
35 
36 extern int stdout_node;
37 extern int stdout_speed;
38 extern bus_space_tag_t fdt_cons_bs_tag;
39 
40 void *fdt_find_cons(const char *);
41 
42 #define fdt_intr_enable riscv_intr_enable
43 #define fdt_intr_establish riscv_intr_establish_fdt
44 #define fdt_intr_establish_idx riscv_intr_establish_fdt_idx
45 #define fdt_intr_establish_imap riscv_intr_establish_fdt_imap
46 #define fdt_intr_establish_msi riscv_intr_establish_fdt_msi
47 #define fdt_intr_disable riscv_intr_disable
48 #define fdt_intr_disestablish riscv_intr_disestablish_fdt
49 #define fdt_intr_get_parent riscv_intr_get_parent
50 #define fdt_intr_parent_establish riscv_intr_parent_establish_fdt
51 #define fdt_intr_parent_disestablish riscv_intr_parent_disestablish_fdt
52 #define fdt_intr_register riscv_intr_register_fdt
53 
54 #endif /* __RISCV_FDT_H__ */
55