mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-12-24 02:11:47 +07:00
ebf7cda0f9
Use runtime PM functionality interfaced with hwmod enable/idle functions, to replace direct clock operations and sysconfig handling. Due to reset sequence, pm_runtime_[get|put]_sync must be used, to avoid possible operations with the module under reset. Because of this and given that the driver uses spin_locks to protect their critical sections, we must use pm_runtime_irq_safe in order for the runtime ops to be happy, otherwise might_sleep_if checks in runtime framework will complain. The remaining pm_runtime out of iommu_enable and iommu_disable corresponds to paths that can be accessed through debugfs, some of them doesn't work if the module is not enabled first, but in future if the mmu is idled withouth freeing, these are needed to debug. Signed-off-by: Omar Ramirez Luna <omar.luna@linaro.org> Tested-by: Ohad Ben-Cohen <ohad@wizery.com> Acked-by: Tony Lindgren <tony@atomide.com> Signed-off-by: Joerg Roedel <joro@8bytes.org>
55 lines
1.5 KiB
C
55 lines
1.5 KiB
C
/*
|
|
* omap iommu: main structures
|
|
*
|
|
* Copyright (C) 2008-2009 Nokia Corporation
|
|
*
|
|
* Written by Hiroshi DOYU <Hiroshi.DOYU@nokia.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.
|
|
*/
|
|
|
|
#include <linux/platform_device.h>
|
|
|
|
#define MMU_REG_SIZE 256
|
|
|
|
/**
|
|
* struct iommu_arch_data - omap iommu private data
|
|
* @name: name of the iommu device
|
|
* @iommu_dev: handle of the iommu device
|
|
*
|
|
* This is an omap iommu private data object, which binds an iommu user
|
|
* to its iommu device. This object should be placed at the iommu user's
|
|
* dev_archdata so generic IOMMU API can be used without having to
|
|
* utilize omap-specific plumbing anymore.
|
|
*/
|
|
struct omap_iommu_arch_data {
|
|
const char *name;
|
|
struct omap_iommu *iommu_dev;
|
|
};
|
|
|
|
/**
|
|
* struct omap_mmu_dev_attr - OMAP mmu device attributes for omap_hwmod
|
|
* @da_start: device address where the va space starts.
|
|
* @da_end: device address where the va space ends.
|
|
* @nr_tlb_entries: number of entries supported by the translation
|
|
* look-aside buffer (TLB).
|
|
*/
|
|
struct omap_mmu_dev_attr {
|
|
u32 da_start;
|
|
u32 da_end;
|
|
int nr_tlb_entries;
|
|
};
|
|
|
|
struct iommu_platform_data {
|
|
const char *name;
|
|
const char *reset_name;
|
|
int nr_tlb_entries;
|
|
u32 da_start;
|
|
u32 da_end;
|
|
|
|
int (*assert_reset)(struct platform_device *pdev, const char *name);
|
|
int (*deassert_reset)(struct platform_device *pdev, const char *name);
|
|
};
|