You've already forked linux-apfs
mirror of
https://github.com/linux-apfs/linux-apfs.git
synced 2026-05-01 15:00:59 -07:00
[SPARC64]: First cut at SUN4V PCI IOMMU handling.
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
@@ -562,9 +562,9 @@ static int pci_4u_map_sg(struct pci_dev *pdev, struct scatterlist *sglist, int n
|
||||
/* Fast path single entry scatterlists. */
|
||||
if (nelems == 1) {
|
||||
sglist->dma_address =
|
||||
pci_map_single(pdev,
|
||||
(page_address(sglist->page) + sglist->offset),
|
||||
sglist->length, direction);
|
||||
pci_4u_map_single(pdev,
|
||||
(page_address(sglist->page) + sglist->offset),
|
||||
sglist->length, direction);
|
||||
if (unlikely(sglist->dma_address == PCI_DMA_ERROR_CODE))
|
||||
return 0;
|
||||
sglist->dma_length = sglist->length;
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -16,6 +16,10 @@ extern unsigned long pci_sun4v_iommu_map(unsigned long devhandle,
|
||||
extern unsigned long pci_sun4v_iommu_demap(unsigned long devhandle,
|
||||
unsigned long tsbid,
|
||||
unsigned long num_ttes);
|
||||
extern unsigned long pci_sun4v_iommu_getmap(unsigned long devhandle,
|
||||
unsigned long tsbid,
|
||||
unsigned long *io_attributes,
|
||||
unsigned long *real_address);
|
||||
extern unsigned long pci_sun4v_config_get(unsigned long devhandle,
|
||||
unsigned long pci_device,
|
||||
unsigned long config_offset,
|
||||
|
||||
@@ -12,9 +12,7 @@
|
||||
*/
|
||||
.globl pci_sun4v_devino_to_sysino
|
||||
pci_sun4v_devino_to_sysino:
|
||||
mov %o1, %o2
|
||||
mov %o0, %o1
|
||||
mov HV_FAST_INTR_DEVINO2SYSINO, %o0
|
||||
mov HV_FAST_INTR_DEVINO2SYSINO, %o5
|
||||
ta HV_FAST_TRAP
|
||||
retl
|
||||
mov %o1, %o0
|
||||
@@ -29,12 +27,7 @@ pci_sun4v_devino_to_sysino:
|
||||
*/
|
||||
.globl pci_sun4v_iommu_map
|
||||
pci_sun4v_iommu_map:
|
||||
mov %o4, %o5
|
||||
mov %o3, %o4
|
||||
mov %o2, %o3
|
||||
mov %o1, %o2
|
||||
mov %o0, %o1
|
||||
mov HV_FAST_PCI_IOMMU_MAP, %o0
|
||||
mov HV_FAST_PCI_IOMMU_MAP, %o5
|
||||
ta HV_FAST_TRAP
|
||||
retl
|
||||
mov %o1, %o0
|
||||
@@ -47,14 +40,28 @@ pci_sun4v_iommu_map:
|
||||
*/
|
||||
.globl pci_sun4v_iommu_demap
|
||||
pci_sun4v_iommu_demap:
|
||||
mov %o2, %o3
|
||||
mov %o1, %o2
|
||||
mov %o0, %o1
|
||||
mov HV_FAST_PCI_IOMMU_DEMAP, %o0
|
||||
mov HV_FAST_PCI_IOMMU_DEMAP, %o5
|
||||
ta HV_FAST_TRAP
|
||||
retl
|
||||
mov %o1, %o0
|
||||
|
||||
/* %o0: devhandle
|
||||
* %o1: tsbid
|
||||
* %o2: &io_attributes
|
||||
* %o3: &real_address
|
||||
*
|
||||
* returns %o0: status
|
||||
*/
|
||||
.globl pci_sun4v_iommu_getmap
|
||||
pci_sun4v_iommu_getmap:
|
||||
mov %o2, %o4
|
||||
mov HV_FAST_PCI_IOMMU_GETMAP, %o5
|
||||
ta HV_FAST_TRAP
|
||||
stx %o1, [%o4]
|
||||
stx %o2, [%o3]
|
||||
retl
|
||||
mov %o0, %o0
|
||||
|
||||
/* %o0: devhandle
|
||||
* %o1: pci_device
|
||||
* %o2: pci_config_offset
|
||||
@@ -67,11 +74,7 @@ pci_sun4v_iommu_demap:
|
||||
*/
|
||||
.globl pci_sun4v_config_get
|
||||
pci_sun4v_config_get:
|
||||
mov %o3, %o4
|
||||
mov %o2, %o3
|
||||
mov %o1, %o2
|
||||
mov %o0, %o1
|
||||
mov HV_FAST_PCI_CONFIG_GET, %o0
|
||||
mov HV_FAST_PCI_CONFIG_GET, %o5
|
||||
ta HV_FAST_TRAP
|
||||
brnz,a,pn %o1, 1f
|
||||
mov -1, %o2
|
||||
@@ -91,14 +94,9 @@ pci_sun4v_config_get:
|
||||
*/
|
||||
.globl pci_sun4v_config_put
|
||||
pci_sun4v_config_put:
|
||||
mov %o3, %o4
|
||||
mov %o2, %o3
|
||||
mov %o1, %o2
|
||||
mov %o0, %o1
|
||||
mov HV_FAST_PCI_CONFIG_PUT, %o0
|
||||
mov HV_FAST_PCI_CONFIG_PUT, %o5
|
||||
ta HV_FAST_TRAP
|
||||
brnz,a,pn %o1, 1f
|
||||
mov -1, %o1
|
||||
1: retl
|
||||
mov %o1, %o0
|
||||
|
||||
|
||||
Reference in New Issue
Block a user