blob: 376a4f771167ce9fec47c926da1938af2fd2ff88 [file] [log] [blame]
Chris Metcalfbce5bbb2012-04-07 16:53:03 -04001/*
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#ifndef __GXIO_TRIO_LINUX_RPC_H__
17#define __GXIO_TRIO_LINUX_RPC_H__
18
19#include <hv/iorpc.h>
20
21#include <hv/drv_trio_intf.h>
22#include <gxio/trio.h>
23#include <gxio/kiorpc.h>
24#include <linux/string.h>
25#include <linux/module.h>
26#include <asm/pgtable.h>
27
Chris Metcalfe70cf542012-09-24 14:57:58 -040028#define GXIO_TRIO_OP_DEALLOC_ASID IORPC_OPCODE(IORPC_FORMAT_NONE, 0x1400)
29#define GXIO_TRIO_OP_ALLOC_ASIDS IORPC_OPCODE(IORPC_FORMAT_NONE, 0x1401)
Chris Metcalfbce5bbb2012-04-07 16:53:03 -040030
Chris Metcalfe70cf542012-09-24 14:57:58 -040031#define GXIO_TRIO_OP_ALLOC_MEMORY_MAPS IORPC_OPCODE(IORPC_FORMAT_NONE, 0x1404)
Chris Metcalfbce5bbb2012-04-07 16:53:03 -040032
Chris Metcalf90d9dd62013-08-02 12:55:15 -040033#define GXIO_TRIO_OP_ALLOC_SCATTER_QUEUES IORPC_OPCODE(IORPC_FORMAT_NONE, 0x140e)
Chris Metcalfe70cf542012-09-24 14:57:58 -040034#define GXIO_TRIO_OP_ALLOC_PIO_REGIONS IORPC_OPCODE(IORPC_FORMAT_NONE, 0x1412)
Chris Metcalfbce5bbb2012-04-07 16:53:03 -040035
Chris Metcalfe70cf542012-09-24 14:57:58 -040036#define GXIO_TRIO_OP_INIT_PIO_REGION_AUX IORPC_OPCODE(IORPC_FORMAT_NONE, 0x1414)
Chris Metcalfbce5bbb2012-04-07 16:53:03 -040037
Chris Metcalfe70cf542012-09-24 14:57:58 -040038#define GXIO_TRIO_OP_INIT_MEMORY_MAP_MMU_AUX IORPC_OPCODE(IORPC_FORMAT_NONE_NOUSER, 0x141e)
39#define GXIO_TRIO_OP_GET_PORT_PROPERTY IORPC_OPCODE(IORPC_FORMAT_NONE_NOUSER, 0x141f)
40#define GXIO_TRIO_OP_CONFIG_LEGACY_INTR IORPC_OPCODE(IORPC_FORMAT_KERNEL_INTERRUPT, 0x1420)
41#define GXIO_TRIO_OP_CONFIG_MSI_INTR IORPC_OPCODE(IORPC_FORMAT_KERNEL_INTERRUPT, 0x1421)
42
43#define GXIO_TRIO_OP_SET_MPS_MRS IORPC_OPCODE(IORPC_FORMAT_NONE_NOUSER, 0x1423)
44#define GXIO_TRIO_OP_FORCE_RC_LINK_UP IORPC_OPCODE(IORPC_FORMAT_NONE_NOUSER, 0x1424)
45#define GXIO_TRIO_OP_FORCE_EP_LINK_UP IORPC_OPCODE(IORPC_FORMAT_NONE_NOUSER, 0x1425)
Chris Metcalfbce5bbb2012-04-07 16:53:03 -040046#define GXIO_TRIO_OP_GET_MMIO_BASE IORPC_OPCODE(IORPC_FORMAT_NONE_NOUSER, 0x8000)
47#define GXIO_TRIO_OP_CHECK_MMIO_OFFSET IORPC_OPCODE(IORPC_FORMAT_NONE_NOUSER, 0x8001)
48
Chris Metcalf126eb082013-09-16 13:52:45 -040049int gxio_trio_alloc_asids(gxio_trio_context_t *context, unsigned int count,
Chris Metcalfbce5bbb2012-04-07 16:53:03 -040050 unsigned int first, unsigned int flags);
51
52
Chris Metcalf126eb082013-09-16 13:52:45 -040053int gxio_trio_alloc_memory_maps(gxio_trio_context_t *context,
Chris Metcalfbce5bbb2012-04-07 16:53:03 -040054 unsigned int count, unsigned int first,
55 unsigned int flags);
56
57
Chris Metcalf126eb082013-09-16 13:52:45 -040058int gxio_trio_alloc_scatter_queues(gxio_trio_context_t *context,
Chris Metcalf90d9dd62013-08-02 12:55:15 -040059 unsigned int count, unsigned int first,
60 unsigned int flags);
61
Chris Metcalf126eb082013-09-16 13:52:45 -040062int gxio_trio_alloc_pio_regions(gxio_trio_context_t *context,
Chris Metcalfbce5bbb2012-04-07 16:53:03 -040063 unsigned int count, unsigned int first,
64 unsigned int flags);
65
Chris Metcalf126eb082013-09-16 13:52:45 -040066int gxio_trio_init_pio_region_aux(gxio_trio_context_t *context,
Chris Metcalfbce5bbb2012-04-07 16:53:03 -040067 unsigned int pio_region, unsigned int mac,
68 uint32_t bus_address_hi, unsigned int flags);
69
70
Chris Metcalf126eb082013-09-16 13:52:45 -040071int gxio_trio_init_memory_map_mmu_aux(gxio_trio_context_t *context,
Chris Metcalfbce5bbb2012-04-07 16:53:03 -040072 unsigned int map, unsigned long va,
73 uint64_t size, unsigned int asid,
74 unsigned int mac, uint64_t bus_address,
75 unsigned int node,
76 unsigned int order_mode);
77
Chris Metcalf126eb082013-09-16 13:52:45 -040078int gxio_trio_get_port_property(gxio_trio_context_t *context,
Chris Metcalfbce5bbb2012-04-07 16:53:03 -040079 struct pcie_trio_ports_property *trio_ports);
80
Chris Metcalf126eb082013-09-16 13:52:45 -040081int gxio_trio_config_legacy_intr(gxio_trio_context_t *context, int inter_x,
Chris Metcalfbce5bbb2012-04-07 16:53:03 -040082 int inter_y, int inter_ipi, int inter_event,
83 unsigned int mac, unsigned int intx);
84
Chris Metcalf126eb082013-09-16 13:52:45 -040085int gxio_trio_config_msi_intr(gxio_trio_context_t *context, int inter_x,
Chris Metcalfbce5bbb2012-04-07 16:53:03 -040086 int inter_y, int inter_ipi, int inter_event,
87 unsigned int mac, unsigned int mem_map,
88 uint64_t mem_map_base, uint64_t mem_map_limit,
89 unsigned int asid);
90
91
Chris Metcalf126eb082013-09-16 13:52:45 -040092int gxio_trio_set_mps_mrs(gxio_trio_context_t *context, uint16_t mps,
Chris Metcalfbce5bbb2012-04-07 16:53:03 -040093 uint16_t mrs, unsigned int mac);
94
Chris Metcalf126eb082013-09-16 13:52:45 -040095int gxio_trio_force_rc_link_up(gxio_trio_context_t *context, unsigned int mac);
Chris Metcalfbce5bbb2012-04-07 16:53:03 -040096
Chris Metcalf126eb082013-09-16 13:52:45 -040097int gxio_trio_force_ep_link_up(gxio_trio_context_t *context, unsigned int mac);
Chris Metcalfbce5bbb2012-04-07 16:53:03 -040098
Chris Metcalf126eb082013-09-16 13:52:45 -040099int gxio_trio_get_mmio_base(gxio_trio_context_t *context, HV_PTE *base);
Chris Metcalfbce5bbb2012-04-07 16:53:03 -0400100
Chris Metcalf126eb082013-09-16 13:52:45 -0400101int gxio_trio_check_mmio_offset(gxio_trio_context_t *context,
Chris Metcalfbce5bbb2012-04-07 16:53:03 -0400102 unsigned long offset, unsigned long size);
103
104#endif /* !__GXIO_TRIO_LINUX_RPC_H__ */