1 /* SPDX-License-Identifier: GPL-2.0 */
2 /* pci_sun4v_asm: Hypervisor calls for PCI support.
4 * Copyright (C) 2006, 2008 David S. Miller <davem@davemloft.net>
7 #include <linux/linkage.h>
8 #include <asm/hypervisor.h>
14 * %o4: io_page_list phys address
16 * returns %o0: -status if status was non-zero, else
17 * %o0: num pages mapped
19 ENTRY(pci_sun4v_iommu_map)
21 mov HV_FAST_PCI_IOMMU_MAP, %o5
28 ENDPROC(pci_sun4v_iommu_map)
34 * returns %o0: num ttes demapped
36 ENTRY(pci_sun4v_iommu_demap)
37 mov HV_FAST_PCI_IOMMU_DEMAP, %o5
41 ENDPROC(pci_sun4v_iommu_demap)
50 ENTRY(pci_sun4v_iommu_getmap)
52 mov HV_FAST_PCI_IOMMU_GETMAP, %o5
58 ENDPROC(pci_sun4v_iommu_getmap)
62 * %o2: pci_config_offset
67 * If there is an error, the data will be returned
70 ENTRY(pci_sun4v_config_get)
71 mov HV_FAST_PCI_CONFIG_GET, %o5
77 ENDPROC(pci_sun4v_config_get)
81 * %o2: pci_config_offset
87 * status will be zero if the operation completed
88 * successfully, else -1 if not
90 ENTRY(pci_sun4v_config_put)
91 mov HV_FAST_PCI_CONFIG_PUT, %o5
97 ENDPROC(pci_sun4v_config_put)
101 * %o2: msiq phys address
104 * returns %o0: status
106 * status will be zero if the operation completed
107 * successfully, else -1 if not
109 ENTRY(pci_sun4v_msiq_conf)
110 mov HV_FAST_PCI_MSIQ_CONF, %o5
114 ENDPROC(pci_sun4v_msiq_conf)
118 * %o2: &msiq_phys_addr
119 * %o3: &msiq_num_entries
121 * returns %o0: status
123 ENTRY(pci_sun4v_msiq_info)
125 mov HV_FAST_PCI_MSIQ_INFO, %o5
131 ENDPROC(pci_sun4v_msiq_info)
137 * returns %o0: status
139 ENTRY(pci_sun4v_msiq_getvalid)
140 mov HV_FAST_PCI_MSIQ_GETVALID, %o5
145 ENDPROC(pci_sun4v_msiq_getvalid)
151 * returns %o0: status
153 ENTRY(pci_sun4v_msiq_setvalid)
154 mov HV_FAST_PCI_MSIQ_SETVALID, %o5
158 ENDPROC(pci_sun4v_msiq_setvalid)
164 * returns %o0: status
166 ENTRY(pci_sun4v_msiq_getstate)
167 mov HV_FAST_PCI_MSIQ_GETSTATE, %o5
172 ENDPROC(pci_sun4v_msiq_getstate)
178 * returns %o0: status
180 ENTRY(pci_sun4v_msiq_setstate)
181 mov HV_FAST_PCI_MSIQ_SETSTATE, %o5
185 ENDPROC(pci_sun4v_msiq_setstate)
191 * returns %o0: status
193 ENTRY(pci_sun4v_msiq_gethead)
194 mov HV_FAST_PCI_MSIQ_GETHEAD, %o5
199 ENDPROC(pci_sun4v_msiq_gethead)
205 * returns %o0: status
207 ENTRY(pci_sun4v_msiq_sethead)
208 mov HV_FAST_PCI_MSIQ_SETHEAD, %o5
212 ENDPROC(pci_sun4v_msiq_sethead)
218 * returns %o0: status
220 ENTRY(pci_sun4v_msiq_gettail)
221 mov HV_FAST_PCI_MSIQ_GETTAIL, %o5
226 ENDPROC(pci_sun4v_msiq_gettail)
232 * returns %o0: status
234 ENTRY(pci_sun4v_msi_getvalid)
235 mov HV_FAST_PCI_MSI_GETVALID, %o5
240 ENDPROC(pci_sun4v_msi_getvalid)
246 * returns %o0: status
248 ENTRY(pci_sun4v_msi_setvalid)
249 mov HV_FAST_PCI_MSI_SETVALID, %o5
253 ENDPROC(pci_sun4v_msi_setvalid)
259 * returns %o0: status
261 ENTRY(pci_sun4v_msi_getmsiq)
262 mov HV_FAST_PCI_MSI_GETMSIQ, %o5
267 ENDPROC(pci_sun4v_msi_getmsiq)
274 * returns %o0: status
276 ENTRY(pci_sun4v_msi_setmsiq)
277 mov HV_FAST_PCI_MSI_SETMSIQ, %o5
281 ENDPROC(pci_sun4v_msi_setmsiq)
287 * returns %o0: status
289 ENTRY(pci_sun4v_msi_getstate)
290 mov HV_FAST_PCI_MSI_GETSTATE, %o5
295 ENDPROC(pci_sun4v_msi_getstate)
301 * returns %o0: status
303 ENTRY(pci_sun4v_msi_setstate)
304 mov HV_FAST_PCI_MSI_SETSTATE, %o5
308 ENDPROC(pci_sun4v_msi_setstate)
314 * returns %o0: status
316 ENTRY(pci_sun4v_msg_getmsiq)
317 mov HV_FAST_PCI_MSG_GETMSIQ, %o5
322 ENDPROC(pci_sun4v_msg_getmsiq)
328 * returns %o0: status
330 ENTRY(pci_sun4v_msg_setmsiq)
331 mov HV_FAST_PCI_MSG_SETMSIQ, %o5
335 ENDPROC(pci_sun4v_msg_setmsiq)
341 * returns %o0: status
343 ENTRY(pci_sun4v_msg_getvalid)
344 mov HV_FAST_PCI_MSG_GETVALID, %o5
349 ENDPROC(pci_sun4v_msg_getvalid)
355 * returns %o0: status
357 ENTRY(pci_sun4v_msg_setvalid)
358 mov HV_FAST_PCI_MSG_SETVALID, %o5
362 ENDPROC(pci_sun4v_msg_setvalid)
370 * %o5: &iotsb_num/&iotsb_handle
372 * returns %o0: status
373 * %o1: iotsb_num/iotsb_handle
375 ENTRY(pci_sun4v_iotsb_conf)
377 mov HV_FAST_PCI_IOTSB_CONF, %o5
381 ENDPROC(pci_sun4v_iotsb_conf)
385 * %o1: iotsb_num/iotsb_handle
388 * returns %o0: status
390 ENTRY(pci_sun4v_iotsb_bind)
391 mov HV_FAST_PCI_IOTSB_BIND, %o5
395 ENDPROC(pci_sun4v_iotsb_bind)
399 * %o1: iotsb_num/iotsb_handle
401 * %o3: iotte_attributes
402 * %o4: io_page_list_p
405 * returns %o0: status
408 ENTRY(pci_sun4v_iotsb_map)
410 mov HV_FAST_PCI_IOTSB_MAP, %o5
414 ENDPROC(pci_sun4v_iotsb_map)
418 * %o1: iotsb_num/iotsb_handle
423 * returns %o0: status
426 ENTRY(pci_sun4v_iotsb_demap)
427 mov HV_FAST_PCI_IOTSB_DEMAP, %o5
431 ENDPROC(pci_sun4v_iotsb_demap)