diff options
| author | Chris Metcalf <cmetcalf@tilera.com> | 2012-04-07 16:53:03 -0400 |
|---|---|---|
| committer | Chris Metcalf <cmetcalf@tilera.com> | 2012-07-11 16:04:58 -0400 |
| commit | bce5bbbb23f780a792be7e594af7cd4b4aae1cd4 (patch) | |
| tree | d140d8badb0ed24f4ccc2f89266772ae6836f0f3 /arch | |
| parent | 10104a1ad670889adc1ae3779df968db621b5dbd (diff) | |
arch/tile: provide kernel support for the tilegx TRIO shim
Provide kernel support for the tilegx "Transaction I/O" (TRIO) on-chip
hardware. This hardware implements the PCIe interface for tilegx;
the driver changes to use TRIO for PCIe are in a subsequent commit.
The change is layered on top of the tilegx GXIO IORPC subsystem.
Signed-off-by: Chris Metcalf <cmetcalf@tilera.com>
Diffstat (limited to 'arch')
| -rw-r--r-- | arch/tile/gxio/Kconfig | 6 | ||||
| -rw-r--r-- | arch/tile/gxio/Makefile | 1 | ||||
| -rw-r--r-- | arch/tile/gxio/iorpc_trio.c | 327 | ||||
| -rw-r--r-- | arch/tile/gxio/trio.c | 49 | ||||
| -rw-r--r-- | arch/tile/include/arch/trio.h | 72 | ||||
| -rw-r--r-- | arch/tile/include/arch/trio_constants.h | 36 | ||||
| -rw-r--r-- | arch/tile/include/arch/trio_def.h | 41 | ||||
| -rw-r--r-- | arch/tile/include/arch/trio_pcie_intfc.h | 229 | ||||
| -rw-r--r-- | arch/tile/include/arch/trio_pcie_intfc_def.h | 32 | ||||
| -rw-r--r-- | arch/tile/include/arch/trio_pcie_rc.h | 156 | ||||
| -rw-r--r-- | arch/tile/include/arch/trio_pcie_rc_def.h | 24 | ||||
| -rw-r--r-- | arch/tile/include/arch/trio_shm.h | 125 | ||||
| -rw-r--r-- | arch/tile/include/arch/trio_shm_def.h | 19 | ||||
| -rw-r--r-- | arch/tile/include/gxio/iorpc_trio.h | 97 | ||||
| -rw-r--r-- | arch/tile/include/gxio/trio.h | 298 | ||||
| -rw-r--r-- | arch/tile/include/hv/drv_trio_intf.h | 195 |
16 files changed, 1707 insertions, 0 deletions
diff --git a/arch/tile/gxio/Kconfig b/arch/tile/gxio/Kconfig index 8aeebb70a3df..68e1cca2cce5 100644 --- a/arch/tile/gxio/Kconfig +++ b/arch/tile/gxio/Kconfig | |||
| @@ -15,3 +15,9 @@ config TILE_GXIO_MPIPE | |||
| 15 | bool | 15 | bool |
| 16 | select TILE_GXIO | 16 | select TILE_GXIO |
| 17 | select TILE_GXIO_DMA | 17 | select TILE_GXIO_DMA |
| 18 | |||
| 19 | # Support direct access to the TILE-Gx TRIO hardware from kernel space. | ||
| 20 | config TILE_GXIO_TRIO | ||
| 21 | bool | ||
| 22 | select TILE_GXIO | ||
| 23 | select TILE_GXIO_DMA | ||
diff --git a/arch/tile/gxio/Makefile b/arch/tile/gxio/Makefile index 130eec48c152..2389ef307c73 100644 --- a/arch/tile/gxio/Makefile +++ b/arch/tile/gxio/Makefile | |||
| @@ -5,3 +5,4 @@ | |||
| 5 | obj-$(CONFIG_TILE_GXIO) += iorpc_globals.o kiorpc.o | 5 | obj-$(CONFIG_TILE_GXIO) += iorpc_globals.o kiorpc.o |
| 6 | obj-$(CONFIG_TILE_GXIO_DMA) += dma_queue.o | 6 | obj-$(CONFIG_TILE_GXIO_DMA) += dma_queue.o |
| 7 | obj-$(CONFIG_TILE_GXIO_MPIPE) += mpipe.o iorpc_mpipe.o iorpc_mpipe_info.o | 7 | obj-$(CONFIG_TILE_GXIO_MPIPE) += mpipe.o iorpc_mpipe.o iorpc_mpipe_info.o |
| 8 | obj-$(CONFIG_TILE_GXIO_TRIO) += trio.o iorpc_trio.o | ||
diff --git a/arch/tile/gxio/iorpc_trio.c b/arch/tile/gxio/iorpc_trio.c new file mode 100644 index 000000000000..cef4b2209cda --- /dev/null +++ b/arch/tile/gxio/iorpc_trio.c | |||
| @@ -0,0 +1,327 @@ | |||
| 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 | |||
| 18 | struct alloc_asids_param { | ||
| 19 | unsigned int count; | ||
| 20 | unsigned int first; | ||
| 21 | unsigned int flags; | ||
| 22 | }; | ||
| 23 | |||
| 24 | int 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 | |||
| 38 | EXPORT_SYMBOL(gxio_trio_alloc_asids); | ||
| 39 | |||
| 40 | |||
| 41 | struct alloc_memory_maps_param { | ||
| 42 | unsigned int count; | ||
| 43 | unsigned int first; | ||
| 44 | unsigned int flags; | ||
| 45 | }; | ||
| 46 | |||
| 47 | int 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 | |||
| 62 | EXPORT_SYMBOL(gxio_trio_alloc_memory_maps); | ||
| 63 | |||
| 64 | |||
| 65 | struct alloc_pio_regions_param { | ||
| 66 | unsigned int count; | ||
| 67 | unsigned int first; | ||
| 68 | unsigned int flags; | ||
| 69 | }; | ||
| 70 | |||
| 71 | int gxio_trio_alloc_pio_regions(gxio_trio_context_t * context, | ||
| 72 | unsigned int count, unsigned int first, | ||
| 73 | unsigned int flags) | ||
| 74 | { | ||
| 75 | struct alloc_pio_regions_param temp; | ||
| 76 | struct alloc_pio_regions_param *params = &temp; | ||
| 77 | |||
| 78 | params->count = count; | ||
| 79 | params->first = first; | ||
| 80 | params->flags = flags; | ||
| 81 | |||
| 82 | return hv_dev_pwrite(context->fd, 0, (HV_VirtAddr) params, | ||
| 83 | sizeof(*params), GXIO_TRIO_OP_ALLOC_PIO_REGIONS); | ||
| 84 | } | ||
| 85 | |||
| 86 | EXPORT_SYMBOL(gxio_trio_alloc_pio_regions); | ||
| 87 | |||
| 88 | struct init_pio_region_aux_param { | ||
| 89 | unsigned int pio_region; | ||
| 90 | unsigned int mac; | ||
| 91 | uint32_t bus_address_hi; | ||
| 92 | unsigned int flags; | ||
| 93 | }; | ||
| 94 | |||
| 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) | ||
| 98 | { | ||
| 99 | struct init_pio_region_aux_param temp; | ||
| 100 | struct init_pio_region_aux_param *params = &temp; | ||
| 101 | |||
| 102 | params->pio_region = pio_region; | ||
| 103 | params->mac = mac; | ||
| 104 | params->bus_address_hi = bus_address_hi; | ||
| 105 | params->flags = flags; | ||
| 106 | |||
| 107 | return hv_dev_pwrite(context->fd, 0, (HV_VirtAddr) params, | ||
| 108 | sizeof(*params), GXIO_TRIO_OP_INIT_PIO_REGION_AUX); | ||
| 109 | } | ||
| 110 | |||
| 111 | EXPORT_SYMBOL(gxio_trio_init_pio_region_aux); | ||
| 112 | |||
| 113 | |||
| 114 | struct init_memory_map_mmu_aux_param { | ||
| 115 | unsigned int map; | ||
| 116 | unsigned long va; | ||
| 117 | uint64_t size; | ||
| 118 | unsigned int asid; | ||
| 119 | unsigned int mac; | ||
| 120 | uint64_t bus_address; | ||
| 121 | unsigned int node; | ||
| 122 | unsigned int order_mode; | ||
| 123 | }; | ||
| 124 | |||
| 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, | ||
| 129 | unsigned int node, | ||
| 130 | unsigned int order_mode) | ||
| 131 | { | ||
| 132 | struct init_memory_map_mmu_aux_param temp; | ||
| 133 | struct init_memory_map_mmu_aux_param *params = &temp; | ||
| 134 | |||
| 135 | params->map = map; | ||
| 136 | params->va = va; | ||
| 137 | params->size = size; | ||
| 138 | params->asid = asid; | ||
| 139 | params->mac = mac; | ||
| 140 | params->bus_address = bus_address; | ||
| 141 | params->node = node; | ||
| 142 | params->order_mode = order_mode; | ||
| 143 | |||
| 144 | return hv_dev_pwrite(context->fd, 0, (HV_VirtAddr) params, | ||
| 145 | sizeof(*params), | ||
| 146 | GXIO_TRIO_OP_INIT_MEMORY_MAP_MMU_AUX); | ||
| 147 | } | ||
| 148 | |||
| 149 | EXPORT_SYMBOL(gxio_trio_init_memory_map_mmu_aux); | ||
| 150 | |||
