^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) /* SPDX-License-Identifier: GPL-2.0-or-later */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3) * (c) Copyright 2006 Benjamin Herrenschmidt, IBM Corp.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4) * <benh@kernel.crashing.org>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7) #ifndef _ASM_POWERPC_DCR_GENERIC_H
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8) #define _ASM_POWERPC_DCR_GENERIC_H
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9) #ifdef __KERNEL__
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10) #ifndef __ASSEMBLY__
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12) enum host_type_t {DCR_HOST_MMIO, DCR_HOST_NATIVE, DCR_HOST_INVALID};
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14) typedef struct {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) enum host_type_t type;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) union {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) dcr_host_mmio_t mmio;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) dcr_host_native_t native;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) } host;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) } dcr_host_t;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) extern bool dcr_map_ok_generic(dcr_host_t host);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) extern dcr_host_t dcr_map_generic(struct device_node *dev, unsigned int dcr_n,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) unsigned int dcr_c);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) extern void dcr_unmap_generic(dcr_host_t host, unsigned int dcr_c);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) extern u32 dcr_read_generic(dcr_host_t host, unsigned int dcr_n);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) extern void dcr_write_generic(dcr_host_t host, unsigned int dcr_n, u32 value);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32) #endif /* __ASSEMBLY__ */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33) #endif /* __KERNEL__ */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34) #endif /* _ASM_POWERPC_DCR_GENERIC_H */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36)