[SPARC64]: Use KERN_EMERG in dump_tl1_traplog() and sun4v TLB errors.
[GitHub/mt8127/android_kernel_alcatel_ttab.git] / arch / sparc64 / kernel / pci_sun4v_asm.S
CommitLineData
bade5622
DM
1/* pci_sun4v_asm: Hypervisor calls for PCI support.
2 *
3 * Copyright (C) 2006 David S. Miller <davem@davemloft.net>
4 */
5
6#include <asm/hypervisor.h>
7
bade5622
DM
8 /* %o0: devhandle
9 * %o1: tsbid
10 * %o2: num ttes
11 * %o3: io_attributes
12 * %o4: io_page_list phys address
13 *
14 * returns %o0: num ttes mapped
15 */
16 .globl pci_sun4v_iommu_map
17pci_sun4v_iommu_map:
18397944 18 mov HV_FAST_PCI_IOMMU_MAP, %o5
bade5622
DM
19 ta HV_FAST_TRAP
20 retl
21 mov %o1, %o0
22
23 /* %o0: devhandle
24 * %o1: tsbid
25 * %o2: num ttes
26 *
27 * returns %o0: num ttes demapped
28 */
29 .globl pci_sun4v_iommu_demap
30pci_sun4v_iommu_demap:
18397944 31 mov HV_FAST_PCI_IOMMU_DEMAP, %o5
bade5622
DM
32 ta HV_FAST_TRAP
33 retl
34 mov %o1, %o0
7eae642f 35
18397944
DM
36 /* %o0: devhandle
37 * %o1: tsbid
38 * %o2: &io_attributes
39 * %o3: &real_address
40 *
41 * returns %o0: status
42 */
43 .globl pci_sun4v_iommu_getmap
44pci_sun4v_iommu_getmap:
45 mov %o2, %o4
46 mov HV_FAST_PCI_IOMMU_GETMAP, %o5
47 ta HV_FAST_TRAP
48 stx %o1, [%o4]
49 stx %o2, [%o3]
50 retl
51 mov %o0, %o0
52
7eae642f
DM
53 /* %o0: devhandle
54 * %o1: pci_device
55 * %o2: pci_config_offset
56 * %o3: size
57 *
58 * returns %o0: data
59 *
60 * If there is an error, the data will be returned
61 * as all 1's.
62 */
63 .globl pci_sun4v_config_get
64pci_sun4v_config_get:
18397944 65 mov HV_FAST_PCI_CONFIG_GET, %o5
7eae642f
DM
66 ta HV_FAST_TRAP
67 brnz,a,pn %o1, 1f
68 mov -1, %o2
691: retl
70 mov %o2, %o0
71
72 /* %o0: devhandle
73 * %o1: pci_device
74 * %o2: pci_config_offset
75 * %o3: size
76 * %o4: data
77 *
78 * returns %o0: status
79 *
80 * status will be zero if the operation completed
81 * successfully, else -1 if not
82 */
83 .globl pci_sun4v_config_put
84pci_sun4v_config_put:
18397944 85 mov HV_FAST_PCI_CONFIG_PUT, %o5
7eae642f
DM
86 ta HV_FAST_TRAP
87 brnz,a,pn %o1, 1f
88 mov -1, %o1
891: retl
90 mov %o1, %o0