Loading core/pld/inc/pld_common.h +4 −0 Original line number Original line Diff line number Diff line Loading @@ -557,7 +557,11 @@ int pld_athdiag_read(struct device *dev, uint32_t offset, uint32_t memtype, uint32_t datalen, uint8_t *output); uint32_t datalen, uint8_t *output); int pld_athdiag_write(struct device *dev, uint32_t offset, uint32_t memtype, int pld_athdiag_write(struct device *dev, uint32_t offset, uint32_t memtype, uint32_t datalen, uint8_t *input); uint32_t datalen, uint8_t *input); #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 19, 0)) void *pld_smmu_get_domain(struct device *dev); #else void *pld_smmu_get_mapping(struct device *dev); void *pld_smmu_get_mapping(struct device *dev); #endif int pld_smmu_map(struct device *dev, phys_addr_t paddr, int pld_smmu_map(struct device *dev, phys_addr_t paddr, uint32_t *iova_addr, size_t size); uint32_t *iova_addr, size_t size); int pld_get_user_msi_assignment(struct device *dev, char *user_name, int pld_get_user_msi_assignment(struct device *dev, char *user_name, Loading core/pld/src/pld_common.c +25 −0 Original line number Original line Diff line number Diff line Loading @@ -1253,6 +1253,30 @@ int pld_athdiag_write(struct device *dev, uint32_t offset, return ret; return ret; } } /** * pld_smmu_get_domain() - Get SMMU domain * @dev: device * * Return: Pointer to the domain */ #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 19, 0)) void *pld_smmu_get_domain(struct device *dev) { void *ptr = NULL; enum pld_bus_type type = pld_get_bus_type(dev); switch (type) { case PLD_BUS_TYPE_SNOC: ptr = pld_snoc_smmu_get_domain(dev); break; default: pr_err("Invalid device type %d\n", type); break; } return ptr; } #else /** /** * pld_smmu_get_mapping() - Get SMMU mapping context * pld_smmu_get_mapping() - Get SMMU mapping context * @dev: device * @dev: device Loading @@ -1278,6 +1302,7 @@ void *pld_smmu_get_mapping(struct device *dev) return ptr; return ptr; } } #endif /** /** * pld_smmu_map() - Map SMMU * pld_smmu_map() - Map SMMU Loading core/pld/src/pld_snoc.h +20 −0 Original line number Original line Diff line number Diff line Loading @@ -95,10 +95,20 @@ static inline int pld_snoc_athdiag_write(struct device *dev, uint32_t offset, { { return 0; return 0; } } #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 19, 0)) static inline void *pld_snoc_smmu_get_domain(struct device *dev) { return NULL; } #else static inline void *pld_snoc_smmu_get_mapping(struct device *dev) static inline void *pld_snoc_smmu_get_mapping(struct device *dev) { { return NULL; return NULL; } } #endif static inline int pld_snoc_smmu_map(struct device *dev, phys_addr_t paddr, static inline int pld_snoc_smmu_map(struct device *dev, phys_addr_t paddr, uint32_t *iova_addr, size_t size) uint32_t *iova_addr, size_t size) { { Loading Loading @@ -218,10 +228,20 @@ static inline int pld_snoc_athdiag_write(struct device *dev, uint32_t offset, { { return icnss_athdiag_write(dev, offset, memtype, datalen, input); return icnss_athdiag_write(dev, offset, memtype, datalen, input); } } #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 19, 0)) static inline void *pld_snoc_smmu_get_domain(struct device *dev) { return icnss_smmu_get_domain(dev); } #else static inline void *pld_snoc_smmu_get_mapping(struct device *dev) static inline void *pld_snoc_smmu_get_mapping(struct device *dev) { { return icnss_smmu_get_mapping(dev); return icnss_smmu_get_mapping(dev); } } #endif static inline int pld_snoc_smmu_map(struct device *dev, phys_addr_t paddr, static inline int pld_snoc_smmu_map(struct device *dev, phys_addr_t paddr, uint32_t *iova_addr, size_t size) uint32_t *iova_addr, size_t size) { { Loading Loading
core/pld/inc/pld_common.h +4 −0 Original line number Original line Diff line number Diff line Loading @@ -557,7 +557,11 @@ int pld_athdiag_read(struct device *dev, uint32_t offset, uint32_t memtype, uint32_t datalen, uint8_t *output); uint32_t datalen, uint8_t *output); int pld_athdiag_write(struct device *dev, uint32_t offset, uint32_t memtype, int pld_athdiag_write(struct device *dev, uint32_t offset, uint32_t memtype, uint32_t datalen, uint8_t *input); uint32_t datalen, uint8_t *input); #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 19, 0)) void *pld_smmu_get_domain(struct device *dev); #else void *pld_smmu_get_mapping(struct device *dev); void *pld_smmu_get_mapping(struct device *dev); #endif int pld_smmu_map(struct device *dev, phys_addr_t paddr, int pld_smmu_map(struct device *dev, phys_addr_t paddr, uint32_t *iova_addr, size_t size); uint32_t *iova_addr, size_t size); int pld_get_user_msi_assignment(struct device *dev, char *user_name, int pld_get_user_msi_assignment(struct device *dev, char *user_name, Loading
core/pld/src/pld_common.c +25 −0 Original line number Original line Diff line number Diff line Loading @@ -1253,6 +1253,30 @@ int pld_athdiag_write(struct device *dev, uint32_t offset, return ret; return ret; } } /** * pld_smmu_get_domain() - Get SMMU domain * @dev: device * * Return: Pointer to the domain */ #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 19, 0)) void *pld_smmu_get_domain(struct device *dev) { void *ptr = NULL; enum pld_bus_type type = pld_get_bus_type(dev); switch (type) { case PLD_BUS_TYPE_SNOC: ptr = pld_snoc_smmu_get_domain(dev); break; default: pr_err("Invalid device type %d\n", type); break; } return ptr; } #else /** /** * pld_smmu_get_mapping() - Get SMMU mapping context * pld_smmu_get_mapping() - Get SMMU mapping context * @dev: device * @dev: device Loading @@ -1278,6 +1302,7 @@ void *pld_smmu_get_mapping(struct device *dev) return ptr; return ptr; } } #endif /** /** * pld_smmu_map() - Map SMMU * pld_smmu_map() - Map SMMU Loading
core/pld/src/pld_snoc.h +20 −0 Original line number Original line Diff line number Diff line Loading @@ -95,10 +95,20 @@ static inline int pld_snoc_athdiag_write(struct device *dev, uint32_t offset, { { return 0; return 0; } } #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 19, 0)) static inline void *pld_snoc_smmu_get_domain(struct device *dev) { return NULL; } #else static inline void *pld_snoc_smmu_get_mapping(struct device *dev) static inline void *pld_snoc_smmu_get_mapping(struct device *dev) { { return NULL; return NULL; } } #endif static inline int pld_snoc_smmu_map(struct device *dev, phys_addr_t paddr, static inline int pld_snoc_smmu_map(struct device *dev, phys_addr_t paddr, uint32_t *iova_addr, size_t size) uint32_t *iova_addr, size_t size) { { Loading Loading @@ -218,10 +228,20 @@ static inline int pld_snoc_athdiag_write(struct device *dev, uint32_t offset, { { return icnss_athdiag_write(dev, offset, memtype, datalen, input); return icnss_athdiag_write(dev, offset, memtype, datalen, input); } } #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 19, 0)) static inline void *pld_snoc_smmu_get_domain(struct device *dev) { return icnss_smmu_get_domain(dev); } #else static inline void *pld_snoc_smmu_get_mapping(struct device *dev) static inline void *pld_snoc_smmu_get_mapping(struct device *dev) { { return icnss_smmu_get_mapping(dev); return icnss_smmu_get_mapping(dev); } } #endif static inline int pld_snoc_smmu_map(struct device *dev, phys_addr_t paddr, static inline int pld_snoc_smmu_map(struct device *dev, phys_addr_t paddr, uint32_t *iova_addr, size_t size) uint32_t *iova_addr, size_t size) { { Loading