PCI: rockchip: dw: Remove useless apis
The PCIe dbi base is accessible in userspace by mmap, then the elbi_data and bar0 physical address is visible from dbi base mmap space. Change-Id: I5abd5921d2c7fd361e098ded568a470ff1b67ad2 Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
This commit is contained in:
@@ -970,27 +970,12 @@ static int pcie_ep_release(struct inode *inode, struct file *file)
|
||||
static long pcie_ep_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
|
||||
{
|
||||
struct rockchip_pcie *rockchip = (struct rockchip_pcie *)file->private_data;
|
||||
struct pcie_ep_user_data msg;
|
||||
struct pcie_ep_dma_cache_cfg cfg;
|
||||
void __user *uarg = (void __user *)arg;
|
||||
int i, ret;
|
||||
enum pcie_ep_mmap_resource mmap_res;
|
||||
|
||||
switch (cmd) {
|
||||
case PCIE_DMA_GET_ELBI_DATA:
|
||||
for (i = 4; i <= 6; i++)
|
||||
msg.elbi_app_user[i - 4] = dw_pcie_readl_dbi(&rockchip->pci,
|
||||
PCIE_ELBI_LOCAL_BASE + i * 4);
|
||||
for (i = 8; i <= 15; i++)
|
||||
msg.elbi_app_user[i - 5] = dw_pcie_readl_dbi(&rockchip->pci,
|
||||
PCIE_ELBI_LOCAL_BASE + i * 4);
|
||||
|
||||
ret = copy_to_user(uarg, &msg, sizeof(msg));
|
||||
if (ret) {
|
||||
dev_err(rockchip->pci.dev, "failed to get elbi data\n");
|
||||
return -EFAULT;
|
||||
}
|
||||
break;
|
||||
case PCIE_DMA_CACHE_INVALIDE:
|
||||
ret = copy_from_user(&cfg, uarg, sizeof(cfg));
|
||||
if (ret) {
|
||||
@@ -1017,15 +1002,6 @@ static long pcie_ep_ioctl(struct file *file, unsigned int cmd, unsigned long arg
|
||||
rockchip->obj_info->irq_type_rc = OBJ_IRQ_USER;
|
||||
rockchip_pcie_raise_msi_irq(rockchip, PCIe_CLIENT_MSI_OBJ_IRQ);
|
||||
break;
|
||||
case PCIE_EP_GET_USER_INFO:
|
||||
msg.bar0_phys_addr = rockchip->ib_target_address[0];
|
||||
|
||||
ret = copy_to_user(uarg, &msg, sizeof(msg));
|
||||
if (ret) {
|
||||
dev_err(rockchip->pci.dev, "failed to get elbi data\n");
|
||||
return -EFAULT;
|
||||
}
|
||||
break;
|
||||
case PCIE_EP_SET_MMAP_RESOURCE:
|
||||
ret = copy_from_user(&mmap_res, uarg, sizeof(mmap_res));
|
||||
if (ret) {
|
||||
|
||||
@@ -24,14 +24,6 @@
|
||||
/* Application status*/
|
||||
#define RKEP_SMODE_APPRDY 0x20
|
||||
|
||||
/*
|
||||
* rockchip pcie driver elbi ioctrl output data
|
||||
*/
|
||||
struct pcie_ep_user_data {
|
||||
__u64 bar0_phys_addr;
|
||||
__u32 elbi_app_user[11];
|
||||
};
|
||||
|
||||
/*
|
||||
* rockchip driver cache ioctrl input param
|
||||
*/
|
||||
@@ -101,12 +93,10 @@ struct pcie_ep_obj_info {
|
||||
};
|
||||
|
||||
#define PCIE_BASE 'P'
|
||||
#define PCIE_DMA_GET_ELBI_DATA _IOR(PCIE_BASE, 0, struct pcie_ep_user_data)
|
||||
#define PCIE_DMA_CACHE_INVALIDE _IOW(PCIE_BASE, 1, struct pcie_ep_dma_cache_cfg)
|
||||
#define PCIE_DMA_CACHE_FLUSH _IOW(PCIE_BASE, 2, struct pcie_ep_dma_cache_cfg)
|
||||
#define PCIE_DMA_IRQ_MASK_ALL _IOW(PCIE_BASE, 3, int)
|
||||
#define PCIE_DMA_RAISE_MSI_OBJ_IRQ_USER _IOW(PCIE_BASE, 4, int)
|
||||
#define PCIE_EP_GET_USER_INFO _IOR(PCIE_BASE, 5, struct pcie_ep_user_data)
|
||||
#define PCIE_EP_SET_MMAP_RESOURCE _IOW(PCIE_BASE, 6, int)
|
||||
#define PCIE_EP_RAISE_ELBI _IOW(PCIE_BASE, 7, int)
|
||||
#define PCIE_EP_REQUEST_VIRTUAL_ID _IOR(PCIE_BASE, 16, int)
|
||||
|
||||
Reference in New Issue
Block a user