-
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.
Conflicts: arch/ia64/kernel/acpi.c
- Loading branch information
Showing
23 changed files
with
620 additions
and
13 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
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
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,59 @@ | ||
#include <linux/types.h> | ||
#include <linux/kernel.h> | ||
#include <linux/module.h> | ||
#include <linux/intel-iommu.h> | ||
|
||
void * | ||
vtd_alloc_coherent(struct device *dev, size_t size, dma_addr_t *dma_handle, | ||
gfp_t flags) | ||
{ | ||
return intel_alloc_coherent(dev, size, dma_handle, flags); | ||
} | ||
EXPORT_SYMBOL_GPL(vtd_alloc_coherent); | ||
|
||
void | ||
vtd_free_coherent(struct device *dev, size_t size, void *vaddr, | ||
dma_addr_t dma_handle) | ||
{ | ||
intel_free_coherent(dev, size, vaddr, dma_handle); | ||
} | ||
EXPORT_SYMBOL_GPL(vtd_free_coherent); | ||
|
||
dma_addr_t | ||
vtd_map_single_attrs(struct device *dev, void *addr, size_t size, | ||
int dir, struct dma_attrs *attrs) | ||
{ | ||
return intel_map_single(dev, (phys_addr_t)addr, size, dir); | ||
} | ||
EXPORT_SYMBOL_GPL(vtd_map_single_attrs); | ||
|
||
void | ||
vtd_unmap_single_attrs(struct device *dev, dma_addr_t iova, size_t size, | ||
int dir, struct dma_attrs *attrs) | ||
{ | ||
intel_unmap_single(dev, iova, size, dir); | ||
} | ||
EXPORT_SYMBOL_GPL(vtd_unmap_single_attrs); | ||
|
||
int | ||
vtd_map_sg_attrs(struct device *dev, struct scatterlist *sglist, int nents, | ||
int dir, struct dma_attrs *attrs) | ||
{ | ||
return intel_map_sg(dev, sglist, nents, dir); | ||
} | ||
EXPORT_SYMBOL_GPL(vtd_map_sg_attrs); | ||
|
||
void | ||
vtd_unmap_sg_attrs(struct device *dev, struct scatterlist *sglist, | ||
int nents, int dir, struct dma_attrs *attrs) | ||
{ | ||
intel_unmap_sg(dev, sglist, nents, dir); | ||
} | ||
EXPORT_SYMBOL_GPL(vtd_unmap_sg_attrs); | ||
|
||
int | ||
vtd_dma_mapping_error(struct device *dev, dma_addr_t dma_addr) | ||
{ | ||
return 0; | ||
} | ||
EXPORT_SYMBOL_GPL(vtd_dma_mapping_error); |
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,3 @@ | ||
#define MACHVEC_PLATFORM_NAME dig_vtd | ||
#define MACHVEC_PLATFORM_HEADER <asm/machvec_dig_vtd.h> | ||
#include <asm/machvec_init.h> |
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
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,16 @@ | ||
#ifndef _ASM_IA64_IOMMU_H | ||
#define _ASM_IA64_IOMMU_H 1 | ||
|
||
#define cpu_has_x2apic 0 | ||
/* 10 seconds */ | ||
#define DMAR_OPERATION_TIMEOUT (((cycles_t) local_cpu_data->itc_freq)*10) | ||
|
||
extern void pci_iommu_shutdown(void); | ||
extern void no_iommu_init(void); | ||
extern int force_iommu, no_iommu; | ||
extern int iommu_detected; | ||
extern void iommu_dma_init(void); | ||
extern void machvec_init(const char *name); | ||
extern int forbid_dac; | ||
|
||
#endif |
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,38 @@ | ||
#ifndef _ASM_IA64_MACHVEC_DIG_VTD_h | ||
#define _ASM_IA64_MACHVEC_DIG_VTD_h | ||
|
||
extern ia64_mv_setup_t dig_setup; | ||
extern ia64_mv_dma_alloc_coherent vtd_alloc_coherent; | ||
extern ia64_mv_dma_free_coherent vtd_free_coherent; | ||
extern ia64_mv_dma_map_single_attrs vtd_map_single_attrs; | ||
extern ia64_mv_dma_unmap_single_attrs vtd_unmap_single_attrs; | ||
extern ia64_mv_dma_map_sg_attrs vtd_map_sg_attrs; | ||
extern ia64_mv_dma_unmap_sg_attrs vtd_unmap_sg_attrs; | ||
extern ia64_mv_dma_supported iommu_dma_supported; | ||
extern ia64_mv_dma_mapping_error vtd_dma_mapping_error; | ||
extern ia64_mv_dma_init pci_iommu_alloc; | ||
|
||
/* | ||
* This stuff has dual use! | ||
* | ||
* For a generic kernel, the macros are used to initialize the | ||
* platform's machvec structure. When compiling a non-generic kernel, | ||
* the macros are used directly. | ||
*/ | ||
#define platform_name "dig_vtd" | ||
#define platform_setup dig_setup | ||
#define platform_dma_init pci_iommu_alloc | ||
#define platform_dma_alloc_coherent vtd_alloc_coherent | ||
#define platform_dma_free_coherent vtd_free_coherent | ||
#define platform_dma_map_single_attrs vtd_map_single_attrs | ||
#define platform_dma_unmap_single_attrs vtd_unmap_single_attrs | ||
#define platform_dma_map_sg_attrs vtd_map_sg_attrs | ||
#define platform_dma_unmap_sg_attrs vtd_unmap_sg_attrs | ||
#define platform_dma_sync_single_for_cpu machvec_dma_sync_single | ||
#define platform_dma_sync_sg_for_cpu machvec_dma_sync_sg | ||
#define platform_dma_sync_single_for_device machvec_dma_sync_single | ||
#define platform_dma_sync_sg_for_device machvec_dma_sync_sg | ||
#define platform_dma_supported iommu_dma_supported | ||
#define platform_dma_mapping_error vtd_dma_mapping_error | ||
|
||
#endif /* _ASM_IA64_MACHVEC_DIG_VTD_h */ |
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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
#include <asm/iommu.h> | ||
#include <asm/machvec.h> | ||
|
||
extern ia64_mv_send_ipi_t ia64_send_ipi; | ||
|
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,56 @@ | ||
#ifndef ASM_IA64__SWIOTLB_H | ||
#define ASM_IA64__SWIOTLB_H | ||
|
||
#include <linux/dma-mapping.h> | ||
|
||
/* SWIOTLB interface */ | ||
|
||
extern dma_addr_t swiotlb_map_single(struct device *hwdev, void *ptr, | ||
size_t size, int dir); | ||
extern void *swiotlb_alloc_coherent(struct device *hwdev, size_t size, | ||
dma_addr_t *dma_handle, gfp_t flags); | ||
extern void swiotlb_unmap_single(struct device *hwdev, dma_addr_t dev_addr, | ||
size_t size, int dir); | ||
extern void swiotlb_sync_single_for_cpu(struct device *hwdev, | ||
dma_addr_t dev_addr, | ||
size_t size, int dir); | ||
extern void swiotlb_sync_single_for_device(struct device *hwdev, | ||
dma_addr_t dev_addr, | ||
size_t size, int dir); | ||
extern void swiotlb_sync_single_range_for_cpu(struct device *hwdev, | ||
dma_addr_t dev_addr, | ||
unsigned long offset, | ||
size_t size, int dir); | ||
extern void swiotlb_sync_single_range_for_device(struct device *hwdev, | ||
dma_addr_t dev_addr, | ||
unsigned long offset, | ||
size_t size, int dir); | ||
extern void swiotlb_sync_sg_for_cpu(struct device *hwdev, | ||
struct scatterlist *sg, int nelems, | ||
int dir); | ||
extern void swiotlb_sync_sg_for_device(struct device *hwdev, | ||
struct scatterlist *sg, int nelems, | ||
int dir); | ||
extern int swiotlb_map_sg(struct device *hwdev, struct scatterlist *sg, | ||
int nents, int direction); | ||
extern void swiotlb_unmap_sg(struct device *hwdev, struct scatterlist *sg, | ||
int nents, int direction); | ||
extern int swiotlb_dma_mapping_error(struct device *hwdev, dma_addr_t dma_addr); | ||
extern void swiotlb_free_coherent(struct device *hwdev, size_t size, | ||
void *vaddr, dma_addr_t dma_handle); | ||
extern int swiotlb_dma_supported(struct device *hwdev, u64 mask); | ||
extern void swiotlb_init(void); | ||
|
||
extern int swiotlb_force; | ||
|
||
#ifdef CONFIG_SWIOTLB | ||
extern int swiotlb; | ||
extern void pci_swiotlb_init(void); | ||
#else | ||
#define swiotlb 0 | ||
static inline void pci_swiotlb_init(void) | ||
{ | ||
} | ||
#endif | ||
|
||
#endif /* ASM_IA64__SWIOTLB_H */ |
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
Oops, something went wrong.