linux/arch/tile/gxio/iorpc_trio.c
<<
>>
Prefs
   1/*
   2 * Copyright 2012 Tilera Corporation. All Rights Reserved.
   3 *
   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.
   7 *
   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
  12 *   more details.
  13 */
  14
  15/* This file is machine-generated; DO NOT EDIT! */
  16#include "gxio/iorpc_trio.h"
  17
  18struct alloc_asids_param {
  19        unsigned int count;
  20        unsigned int first;
  21        unsigned int flags;
  22};
  23
  24int gxio_trio_alloc_asids(gxio_trio_context_t *context, unsigned int count,
  25                          unsigned int first, unsigned int flags)
  26{
  27        struct alloc_asids_param temp;
  28        struct alloc_asids_param *params = &temp;
  29
  30        params->count = count;
  31        params->first = first;
  32        params->flags = flags;
  33
  34        return hv_dev_pwrite(context->fd, 0, (HV_VirtAddr) params,
  35                             sizeof(*params), GXIO_TRIO_OP_ALLOC_ASIDS);
  36}
  37
  38EXPORT_SYMBOL(gxio_trio_alloc_asids);
  39
  40
  41struct alloc_memory_maps_param {
  42        unsigned int count;
  43        unsigned int first;
  44        unsigned int flags;
  45};
  46
  47int gxio_trio_alloc_memory_maps(gxio_trio_context_t *context,
  48                                unsigned int count, unsigned int first,
  49                                unsigned int flags)
  50{
  51        struct alloc_memory_maps_param temp;
  52        struct alloc_memory_maps_param *params = &temp;
  53
  54        params->count = count;
  55        params->first = first;
  56        params->flags = flags;
  57
  58        return hv_dev_pwrite(context->fd, 0, (HV_VirtAddr) params,
  59                             sizeof(*params), GXIO_TRIO_OP_ALLOC_MEMORY_MAPS);
  60}
  61
  62EXPORT_SYMBOL(gxio_trio_alloc_memory_maps);
  63
  64struct alloc_scatter_queues_param {
  65        unsigned int count;
  66        unsigned int first;
  67        unsigned int flags;
  68};
  69
  70int gxio_trio_alloc_scatter_queues(gxio_trio_context_t *context,
  71                                   unsigned int count, unsigned int first,
  72                                   unsigned int flags)
  73{
  74        struct alloc_scatter_queues_param temp;
  75        struct alloc_scatter_queues_param *params = &temp;
  76
  77        params->count = count;
  78        params->first = first;
  79        params->flags = flags;
  80
  81        return hv_dev_pwrite(context->fd, 0, (HV_VirtAddr) params,
  82                             sizeof(*params),
  83                             GXIO_TRIO_OP_ALLOC_SCATTER_QUEUES);
  84}
  85
  86EXPORT_SYMBOL(gxio_trio_alloc_scatter_queues);
  87
  88struct alloc_pio_regions_param {
  89        unsigned int count;
  90        unsigned int first;
  91        unsigned int flags;
  92};
  93
  94int gxio_trio_alloc_pio_regions(gxio_trio_context_t *context,
  95                                unsigned int count, unsigned int first,
  96                                unsigned int flags)
  97{
  98        struct alloc_pio_regions_param temp;
  99        struct alloc_pio_regions_param *params = &temp;
 100
 101        params->count = count;
 102        params->first = first;
 103        params->flags = flags;
 104
 105        return hv_dev_pwrite(context->fd, 0, (HV_VirtAddr) params,
 106                             sizeof(*params), GXIO_TRIO_OP_ALLOC_PIO_REGIONS);
 107}
 108
 109EXPORT_SYMBOL(gxio_trio_alloc_pio_regions);
 110
 111struct init_pio_region_aux_param {
 112        unsigned int pio_region;
 113        unsigned int mac;
 114        uint32_t bus_address_hi;
 115        unsigned int flags;
 116};
 117
 118int gxio_trio_init_pio_region_aux(gxio_trio_context_t *context,
 119                                  unsigned int pio_region, unsigned int mac,
 120                                  uint32_t bus_address_hi, unsigned int flags)
 121{
 122        struct init_pio_region_aux_param temp;
 123        struct init_pio_region_aux_param *params = &temp;
 124
 125        params->pio_region = pio_region;
 126        params->mac = mac;
 127        params->bus_address_hi = bus_address_hi;
 128        params->flags = flags;
 129
 130        return hv_dev_pwrite(context->fd, 0, (HV_VirtAddr) params,
 131                             sizeof(*params), GXIO_TRIO_OP_INIT_PIO_REGION_AUX);
 132}
 133
 134EXPORT_SYMBOL(gxio_trio_init_pio_region_aux);
 135
 136
 137struct init_memory_map_mmu_aux_param {
 138        unsigned int map;
 139        unsigned long va;
 140        uint64_t size;
 141        unsigned int asid;
 142        unsigned int mac;
 143        uint64_t bus_address;
 144        unsigned int node;
 145        unsigned int order_mode;
 146};
 147
 148int gxio_trio_init_memory_map_mmu_aux(gxio_trio_context_t *context,
 149                                      unsigned int map, unsigned long va,
 150                                      uint64_t size, unsigned int asid,
 151                                      unsigned int mac, uint64_t bus_address,
 152                                      unsigned int node,
 153                                      unsigned int order_mode)
 154{
 155        struct init_memory_map_mmu_aux_param temp;
 156        struct init_memory_map_mmu_aux_param *params = &temp;
 157
 158        params->map = map;
 159        params->va = va;
 160        params->size = size;
 161        params->asid = asid;
 162        params->mac = mac;
 163        params->bus_address = bus_address;
 164        params->node = node;
 165        params->order_mode = order_mode;
 166
 167        return hv_dev_pwrite(context->fd, 0, (HV_VirtAddr) params,
 168                             sizeof(*params),
 169                             GXIO_TRIO_OP_INIT_MEMORY_MAP_MMU_AUX);
 170}
 171
 172EXPORT_SYMBOL(gxio_trio_init_memory_map_mmu_aux);
 173
 174struct get_port_property_param {
 175        struct pcie_trio_ports_property trio_ports;
 176};
 177
 178int gxio_trio_get_port_property(gxio_trio_context_t *context,
 179                                struct pcie_trio_ports_property *trio_ports)
 180{
 181        int __result;
 182        struct get_port_property_param temp;
 183        struct get_port_property_param *params = &temp;
 184
 185        __result =
 186            hv_dev_pread(context->fd, 0, (HV_VirtAddr) params, sizeof(*params),
 187                         GXIO_TRIO_OP_GET_PORT_PROPERTY);
 188        *trio_ports = params->trio_ports;
 189
 190        return __result;
 191}
 192
 193EXPORT_SYMBOL(gxio_trio_get_port_property);
 194
 195struct config_legacy_intr_param {
 196        union iorpc_interrupt interrupt;
 197        unsigned int mac;
 198        unsigned int intx;
 199};
 200
 201int gxio_trio_config_legacy_intr(gxio_trio_context_t *context, int inter_x,
 202                                 int inter_y, int inter_ipi, int inter_event,
 203                                 unsigned int mac, unsigned int intx)
 204{
 205        struct config_legacy_intr_param temp;
 206        struct config_legacy_intr_param *params = &temp;
 207
 208        params->interrupt.kernel.x = inter_x;
 209        params->interrupt.kernel.y = inter_y;
 210        params->interrupt.kernel.ipi = inter_ipi;
 211        params->interrupt.kernel.event = inter_event;
 212        params->mac = mac;
 213        params->intx = intx;
 214
 215        return hv_dev_pwrite(context->fd, 0, (HV_VirtAddr) params,
 216                             sizeof(*params), GXIO_TRIO_OP_CONFIG_LEGACY_INTR);
 217}
 218
 219EXPORT_SYMBOL(gxio_trio_config_legacy_intr);
 220
 221struct config_msi_intr_param {
 222        union iorpc_interrupt interrupt;
 223        unsigned int mac;
 224        unsigned int mem_map;
 225        uint64_t mem_map_base;
 226        uint64_t mem_map_limit;
 227        unsigned int asid;
 228};
 229
 230int gxio_trio_config_msi_intr(gxio_trio_context_t *context, int inter_x,
 231                              int inter_y, int inter_ipi, int inter_event,
 232                              unsigned int mac, unsigned int mem_map,
 233                              uint64_t mem_map_base, uint64_t mem_map_limit,
 234                              unsigned int asid)
 235{
 236        struct config_msi_intr_param temp;
 237        struct config_msi_intr_param *params = &temp;
 238
 239        params->interrupt.kernel.x = inter_x;
 240        params->interrupt.kernel.y = inter_y;
 241        params->interrupt.kernel.ipi = inter_ipi;
 242        params->interrupt.kernel.event = inter_event;
 243        params->mac = mac;
 244        params->mem_map = mem_map;
 245        params->mem_map_base = mem_map_base;
 246        params->mem_map_limit = mem_map_limit;
 247        params->asid = asid;
 248
 249        return hv_dev_pwrite(context->fd, 0, (HV_VirtAddr) params,
 250                             sizeof(*params), GXIO_TRIO_OP_CONFIG_MSI_INTR);
 251}
 252
 253EXPORT_SYMBOL(gxio_trio_config_msi_intr);
 254
 255
 256struct set_mps_mrs_param {
 257        uint16_t mps;
 258        uint16_t mrs;
 259        unsigned int mac;
 260};
 261
 262int gxio_trio_set_mps_mrs(gxio_trio_context_t *context, uint16_t mps,
 263                          uint16_t mrs, unsigned int mac)
 264{
 265        struct set_mps_mrs_param temp;
 266        struct set_mps_mrs_param *params = &temp;
 267
 268        params->mps = mps;
 269        params->mrs = mrs;
 270        params->mac = mac;
 271
 272        return hv_dev_pwrite(context->fd, 0, (HV_VirtAddr) params,
 273                             sizeof(*params), GXIO_TRIO_OP_SET_MPS_MRS);
 274}
 275
 276EXPORT_SYMBOL(gxio_trio_set_mps_mrs);
 277
 278struct force_rc_link_up_param {
 279        unsigned int mac;
 280};
 281
 282int gxio_trio_force_rc_link_up(gxio_trio_context_t *context, unsigned int mac)
 283{
 284        struct force_rc_link_up_param temp;
 285        struct force_rc_link_up_param *params = &temp;
 286
 287        params->mac = mac;
 288
 289        return hv_dev_pwrite(context->fd, 0, (HV_VirtAddr) params,
 290                             sizeof(*params), GXIO_TRIO_OP_FORCE_RC_LINK_UP);
 291}
 292
 293EXPORT_SYMBOL(gxio_trio_force_rc_link_up);
 294
 295struct force_ep_link_up_param {
 296        unsigned int mac;
 297};
 298
 299int gxio_trio_force_ep_link_up(gxio_trio_context_t *context, unsigned int mac)
 300{
 301        struct force_ep_link_up_param temp;
 302        struct force_ep_link_up_param *params = &temp;
 303
 304        params->mac = mac;
 305
 306        return hv_dev_pwrite(context->fd, 0, (HV_VirtAddr) params,
 307                             sizeof(*params), GXIO_TRIO_OP_FORCE_EP_LINK_UP);
 308}
 309
 310EXPORT_SYMBOL(gxio_trio_force_ep_link_up);
 311
 312struct get_mmio_base_param {
 313        HV_PTE base;
 314};
 315
 316int gxio_trio_get_mmio_base(gxio_trio_context_t *context, HV_PTE *base)
 317{
 318        int __result;
 319        struct get_mmio_base_param temp;
 320        struct get_mmio_base_param *params = &temp;
 321
 322        __result =
 323            hv_dev_pread(context->fd, 0, (HV_VirtAddr) params, sizeof(*params),
 324                         GXIO_TRIO_OP_GET_MMIO_BASE);
 325        *base = params->base;
 326
 327        return __result;
 328}
 329
 330EXPORT_SYMBOL(gxio_trio_get_mmio_base);
 331
 332struct check_mmio_offset_param {
 333        unsigned long offset;
 334        unsigned long size;
 335};
 336
 337int gxio_trio_check_mmio_offset(gxio_trio_context_t *context,
 338                                unsigned long offset, unsigned long size)
 339{
 340        struct check_mmio_offset_param temp;
 341        struct check_mmio_offset_param *params = &temp;
 342
 343        params->offset = offset;
 344        params->size = size;
 345
 346        return hv_dev_pwrite(context->fd, 0, (HV_VirtAddr) params,
 347                             sizeof(*params), GXIO_TRIO_OP_CHECK_MMIO_OFFSET);
 348}
 349
 350EXPORT_SYMBOL(gxio_trio_check_mmio_offset);
 351