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