-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
iommu/mediatek: move the common struct into header file
Move the struct defines of mtk iommu into a new header files for common use. Signed-off-by: Honghui Zhang <honghui.zhang@mediatek.com> Signed-off-by: Joerg Roedel <jroedel@suse.de>
- Loading branch information
Honghui Zhang
authored and
Joerg Roedel
committed
Jun 21, 2016
1 parent
7e42626
commit 9ca340c
Showing
2 changed files
with
78 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
/* | ||
* Copyright (c) 2015-2016 MediaTek Inc. | ||
* Author: Honghui Zhang <honghui.zhang@mediatek.com> | ||
* | ||
* This program is free software; you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License version 2 as | ||
* published by the Free Software Foundation. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
*/ | ||
|
||
#ifndef _MTK_IOMMU_H_ | ||
#define _MTK_IOMMU_H_ | ||
|
||
#include <linux/clk.h> | ||
#include <linux/component.h> | ||
#include <linux/device.h> | ||
#include <linux/io.h> | ||
#include <linux/iommu.h> | ||
#include <linux/list.h> | ||
#include <linux/spinlock.h> | ||
#include <soc/mediatek/smi.h> | ||
|
||
#include "io-pgtable.h" | ||
|
||
struct mtk_iommu_suspend_reg { | ||
u32 standard_axi_mode; | ||
u32 dcm_dis; | ||
u32 ctrl_reg; | ||
u32 int_control0; | ||
u32 int_main_control; | ||
}; | ||
|
||
struct mtk_iommu_client_priv { | ||
struct list_head client; | ||
unsigned int mtk_m4u_id; | ||
struct device *m4udev; | ||
}; | ||
|
||
struct mtk_iommu_domain; | ||
|
||
struct mtk_iommu_data { | ||
void __iomem *base; | ||
int irq; | ||
struct device *dev; | ||
struct clk *bclk; | ||
phys_addr_t protect_base; /* protect memory base */ | ||
struct mtk_iommu_suspend_reg reg; | ||
struct mtk_iommu_domain *m4u_dom; | ||
struct iommu_group *m4u_group; | ||
struct mtk_smi_iommu smi_imu; /* SMI larb iommu info */ | ||
bool enable_4GB; | ||
}; | ||
|
||
static int compare_of(struct device *dev, void *data) | ||
{ | ||
return dev->of_node == data; | ||
} | ||
|
||
static int mtk_iommu_bind(struct device *dev) | ||
{ | ||
struct mtk_iommu_data *data = dev_get_drvdata(dev); | ||
|
||
return component_bind_all(dev, &data->smi_imu); | ||
} | ||
|
||
static void mtk_iommu_unbind(struct device *dev) | ||
{ | ||
struct mtk_iommu_data *data = dev_get_drvdata(dev); | ||
|
||
component_unbind_all(dev, &data->smi_imu); | ||
} | ||
|
||
#endif |