Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0-or-later */
0002 /*
0003  * (c) Copyright 2006 Benjamin Herrenschmidt, IBM Corp.
0004  *                    <benh@kernel.crashing.org>
0005  */
0006 
0007 #ifndef _ASM_POWERPC_DCR_GENERIC_H
0008 #define _ASM_POWERPC_DCR_GENERIC_H
0009 #ifdef __KERNEL__
0010 #ifndef __ASSEMBLY__
0011 
0012 enum host_type_t {DCR_HOST_MMIO, DCR_HOST_NATIVE, DCR_HOST_INVALID};
0013 
0014 typedef struct {
0015     enum host_type_t type;
0016     union {
0017         dcr_host_mmio_t mmio;
0018         dcr_host_native_t native;
0019     } host;
0020 } dcr_host_t;
0021 
0022 extern bool dcr_map_ok_generic(dcr_host_t host);
0023 
0024 extern dcr_host_t dcr_map_generic(struct device_node *dev, unsigned int dcr_n,
0025               unsigned int dcr_c);
0026 extern void dcr_unmap_generic(dcr_host_t host, unsigned int dcr_c);
0027 
0028 extern u32 dcr_read_generic(dcr_host_t host, unsigned int dcr_n);
0029 
0030 extern void dcr_write_generic(dcr_host_t host, unsigned int dcr_n, u32 value);
0031 
0032 #endif /* __ASSEMBLY__ */
0033 #endif /* __KERNEL__ */
0034 #endif /* _ASM_POWERPC_DCR_GENERIC_H */
0035 
0036