2 * Copyright 2012 Tilera Corporation. All Rights Reserved.
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation, version 2.
8 * This program is distributed in the hope that it will be useful, but
9 * WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or
11 * NON INFRINGEMENT. See the GNU General Public License for
15 /* This file is machine-generated; DO NOT EDIT! */
16 #include "gxio/iorpc_trio.h"
18 struct alloc_asids_param
{
24 int gxio_trio_alloc_asids(gxio_trio_context_t
* context
, unsigned int count
,
25 unsigned int first
, unsigned int flags
)
27 struct alloc_asids_param temp
;
28 struct alloc_asids_param
*params
= &temp
;
30 params
->count
= count
;
31 params
->first
= first
;
32 params
->flags
= flags
;
34 return hv_dev_pwrite(context
->fd
, 0, (HV_VirtAddr
) params
,
35 sizeof(*params
), GXIO_TRIO_OP_ALLOC_ASIDS
);
38 EXPORT_SYMBOL(gxio_trio_alloc_asids
);
41 struct alloc_memory_maps_param
{
47 int gxio_trio_alloc_memory_maps(gxio_trio_context_t
* context
,
48 unsigned int count
, unsigned int first
,
51 struct alloc_memory_maps_param temp
;
52 struct alloc_memory_maps_param
*params
= &temp
;
54 params
->count
= count
;
55 params
->first
= first
;
56 params
->flags
= flags
;
58 return hv_dev_pwrite(context
->fd
, 0, (HV_VirtAddr
) params
,
59 sizeof(*params
), GXIO_TRIO_OP_ALLOC_MEMORY_MAPS
);
62 EXPORT_SYMBOL(gxio_trio_alloc_memory_maps
);
65 struct alloc_pio_regions_param
{
71 int gxio_trio_alloc_pio_regions(gxio_trio_context_t
* context
,
72 unsigned int count
, unsigned int first
,
75 struct alloc_pio_regions_param temp
;
76 struct alloc_pio_regions_param
*params
= &temp
;
78 params
->count
= count
;
79 params
->first
= first
;
80 params
->flags
= flags
;
82 return hv_dev_pwrite(context
->fd
, 0, (HV_VirtAddr
) params
,
83 sizeof(*params
), GXIO_TRIO_OP_ALLOC_PIO_REGIONS
);
86 EXPORT_SYMBOL(gxio_trio_alloc_pio_regions
);
88 struct init_pio_region_aux_param
{
89 unsigned int pio_region
;
91 uint32_t bus_address_hi
;
95 int gxio_trio_init_pio_region_aux(gxio_trio_context_t
* context
,
96 unsigned int pio_region
, unsigned int mac
,
97 uint32_t bus_address_hi
, unsigned int flags
)
99 struct init_pio_region_aux_param temp
;
100 struct init_pio_region_aux_param
*params
= &temp
;
102 params
->pio_region
= pio_region
;
104 params
->bus_address_hi
= bus_address_hi
;
105 params
->flags
= flags
;
107 return hv_dev_pwrite(context
->fd
, 0, (HV_VirtAddr
) params
,
108 sizeof(*params
), GXIO_TRIO_OP_INIT_PIO_REGION_AUX
);
111 EXPORT_SYMBOL(gxio_trio_init_pio_region_aux
);
114 struct init_memory_map_mmu_aux_param
{
120 uint64_t bus_address
;
122 unsigned int order_mode
;
125 int gxio_trio_init_memory_map_mmu_aux(gxio_trio_context_t
* context
,
126 unsigned int map
, unsigned long va
,
127 uint64_t size
, unsigned int asid
,
128 unsigned int mac
, uint64_t bus_address
,
130 unsigned int order_mode
)
132 struct init_memory_map_mmu_aux_param temp
;
133 struct init_memory_map_mmu_aux_param
*params
= &temp
;
140 params
->bus_address
= bus_address
;
142 params
->order_mode
= order_mode
;
144 return hv_dev_pwrite(context
->fd
, 0, (HV_VirtAddr
) params
,
146 GXIO_TRIO_OP_INIT_MEMORY_MAP_MMU_AUX
);
149 EXPORT_SYMBOL(gxio_trio_init_memory_map_mmu_aux
);
151 struct get_port_property_param
{
152 struct pcie_trio_ports_property trio_ports
;
155 int gxio_trio_get_port_property(gxio_trio_context_t
* context
,
156 struct pcie_trio_ports_property
*trio_ports
)
159 struct get_port_property_param temp
;
160 struct get_port_property_param
*params
= &temp
;
163 hv_dev_pread(context
->fd
, 0, (HV_VirtAddr
) params
, sizeof(*params
),
164 GXIO_TRIO_OP_GET_PORT_PROPERTY
);
165 *trio_ports
= params
->trio_ports
;
170 EXPORT_SYMBOL(gxio_trio_get_port_property
);
172 struct config_legacy_intr_param
{
173 union iorpc_interrupt interrupt
;
178 int gxio_trio_config_legacy_intr(gxio_trio_context_t
* context
, int inter_x
,
179 int inter_y
, int inter_ipi
, int inter_event
,
180 unsigned int mac
, unsigned int intx
)
182 struct config_legacy_intr_param temp
;
183 struct config_legacy_intr_param
*params
= &temp
;
185 params
->interrupt
.kernel
.x
= inter_x
;
186 params
->interrupt
.kernel
.y
= inter_y
;
187 params
->interrupt
.kernel
.ipi
= inter_ipi
;
188 params
->interrupt
.kernel
.event
= inter_event
;
192 return hv_dev_pwrite(context
->fd
, 0, (HV_VirtAddr
) params
,
193 sizeof(*params
), GXIO_TRIO_OP_CONFIG_LEGACY_INTR
);
196 EXPORT_SYMBOL(gxio_trio_config_legacy_intr
);
198 struct config_msi_intr_param
{
199 union iorpc_interrupt interrupt
;
201 unsigned int mem_map
;
202 uint64_t mem_map_base
;
203 uint64_t mem_map_limit
;
207 int gxio_trio_config_msi_intr(gxio_trio_context_t
* context
, int inter_x
,
208 int inter_y
, int inter_ipi
, int inter_event
,
209 unsigned int mac
, unsigned int mem_map
,
210 uint64_t mem_map_base
, uint64_t mem_map_limit
,
213 struct config_msi_intr_param temp
;
214 struct config_msi_intr_param
*params
= &temp
;
216 params
->interrupt
.kernel
.x
= inter_x
;
217 params
->interrupt
.kernel
.y
= inter_y
;
218 params
->interrupt
.kernel
.ipi
= inter_ipi
;
219 params
->interrupt
.kernel
.event
= inter_event
;
221 params
->mem_map
= mem_map
;
222 params
->mem_map_base
= mem_map_base
;
223 params
->mem_map_limit
= mem_map_limit
;
226 return hv_dev_pwrite(context
->fd
, 0, (HV_VirtAddr
) params
,
227 sizeof(*params
), GXIO_TRIO_OP_CONFIG_MSI_INTR
);
230 EXPORT_SYMBOL(gxio_trio_config_msi_intr
);
233 struct set_mps_mrs_param
{
239 int gxio_trio_set_mps_mrs(gxio_trio_context_t
* context
, uint16_t mps
,
240 uint16_t mrs
, unsigned int mac
)
242 struct set_mps_mrs_param temp
;
243 struct set_mps_mrs_param
*params
= &temp
;
249 return hv_dev_pwrite(context
->fd
, 0, (HV_VirtAddr
) params
,
250 sizeof(*params
), GXIO_TRIO_OP_SET_MPS_MRS
);
253 EXPORT_SYMBOL(gxio_trio_set_mps_mrs
);
255 struct force_rc_link_up_param
{
259 int gxio_trio_force_rc_link_up(gxio_trio_context_t
* context
, unsigned int mac
)
261 struct force_rc_link_up_param temp
;
262 struct force_rc_link_up_param
*params
= &temp
;
266 return hv_dev_pwrite(context
->fd
, 0, (HV_VirtAddr
) params
,
267 sizeof(*params
), GXIO_TRIO_OP_FORCE_RC_LINK_UP
);
270 EXPORT_SYMBOL(gxio_trio_force_rc_link_up
);
272 struct force_ep_link_up_param
{
276 int gxio_trio_force_ep_link_up(gxio_trio_context_t
* context
, unsigned int mac
)
278 struct force_ep_link_up_param temp
;
279 struct force_ep_link_up_param
*params
= &temp
;
283 return hv_dev_pwrite(context
->fd
, 0, (HV_VirtAddr
) params
,
284 sizeof(*params
), GXIO_TRIO_OP_FORCE_EP_LINK_UP
);
287 EXPORT_SYMBOL(gxio_trio_force_ep_link_up
);
289 struct get_mmio_base_param
{
293 int gxio_trio_get_mmio_base(gxio_trio_context_t
* context
, HV_PTE
*base
)
296 struct get_mmio_base_param temp
;
297 struct get_mmio_base_param
*params
= &temp
;
300 hv_dev_pread(context
->fd
, 0, (HV_VirtAddr
) params
, sizeof(*params
),
301 GXIO_TRIO_OP_GET_MMIO_BASE
);
302 *base
= params
->base
;
307 EXPORT_SYMBOL(gxio_trio_get_mmio_base
);
309 struct check_mmio_offset_param
{
310 unsigned long offset
;
314 int gxio_trio_check_mmio_offset(gxio_trio_context_t
* context
,
315 unsigned long offset
, unsigned long size
)
317 struct check_mmio_offset_param temp
;
318 struct check_mmio_offset_param
*params
= &temp
;
320 params
->offset
= offset
;
323 return hv_dev_pwrite(context
->fd
, 0, (HV_VirtAddr
) params
,
324 sizeof(*params
), GXIO_TRIO_OP_CHECK_MMIO_OFFSET
);
327 EXPORT_SYMBOL(gxio_trio_check_mmio_offset
);