Commit 83addecd authored by Marek Szyprowski's avatar Marek Szyprowski Committed by Joerg Roedel

iommu/exynos: Refactor init config code

This patch rewrites sysmmu_init_config function to make it easier to read
and understand.
Signed-off-by: default avatarMarek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: default avatarJoerg Roedel <jroedel@suse.de>
parent d093fc7e
...@@ -383,24 +383,17 @@ static bool __sysmmu_disable(struct sysmmu_drvdata *data) ...@@ -383,24 +383,17 @@ static bool __sysmmu_disable(struct sysmmu_drvdata *data)
static void __sysmmu_init_config(struct sysmmu_drvdata *data) static void __sysmmu_init_config(struct sysmmu_drvdata *data)
{ {
unsigned int cfg = CFG_LRU | CFG_QOS(15); unsigned int cfg;
unsigned int ver;
data->version = MMU_RAW_VER(__raw_readl(data->sfrbase + REG_MMU_VERSION));
ver = MMU_RAW_VER(__raw_readl(data->sfrbase + REG_MMU_VERSION)); if (data->version <= MAKE_MMU_VER(3, 1))
if (MMU_MAJ_VER(ver) == 3) { cfg = CFG_LRU | CFG_QOS(15);
if (MMU_MIN_VER(ver) >= 2) { else if (data->version <= MAKE_MMU_VER(3, 2))
cfg |= CFG_FLPDCACHE; cfg = CFG_LRU | CFG_QOS(15) | CFG_FLPDCACHE | CFG_SYSSEL;
if (MMU_MIN_VER(ver) == 3) { else
cfg |= CFG_ACGEN; cfg = CFG_QOS(15) | CFG_FLPDCACHE | CFG_ACGEN;
cfg &= ~CFG_LRU;
} else {
cfg |= CFG_SYSSEL;
}
}
}
__raw_writel(cfg, data->sfrbase + REG_MMU_CFG); __raw_writel(cfg, data->sfrbase + REG_MMU_CFG);
data->version = ver;
} }
static void __sysmmu_enable_nocount(struct sysmmu_drvdata *data) static void __sysmmu_enable_nocount(struct sysmmu_drvdata *data)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment