1 /* SPDX-License-Identifier: (GPL-2.0+ OR BSD-3-Clause) */ 2 /* 3 * Copyright 2013-2016 Freescale Semiconductor Inc. 4 * Copyright 2016,2019-2020 NXP 5 */ 6 7 #ifndef VFIO_FSL_MC_PRIVATE_H 8 #define VFIO_FSL_MC_PRIVATE_H 9 10 #define VFIO_FSL_MC_OFFSET_SHIFT 40 11 #define VFIO_FSL_MC_OFFSET_MASK (((u64)(1) << VFIO_FSL_MC_OFFSET_SHIFT) - 1) 12 13 #define VFIO_FSL_MC_OFFSET_TO_INDEX(off) ((off) >> VFIO_FSL_MC_OFFSET_SHIFT) 14 15 #define VFIO_FSL_MC_INDEX_TO_OFFSET(index) \ 16 ((u64)(index) << VFIO_FSL_MC_OFFSET_SHIFT) 17 18 struct vfio_fsl_mc_region { 19 u32 flags; 20 u32 type; 21 u64 addr; 22 resource_size_t size; 23 }; 24 25 struct vfio_fsl_mc_device { 26 struct fsl_mc_device *mc_dev; 27 struct notifier_block nb; 28 int refcnt; 29 struct vfio_fsl_mc_region *regions; 30 struct mutex driver_lock; 31 }; 32 33 #endif /* VFIO_FSL_MC_PRIVATE_H */ 34