diff options
| author | Jonathan Herman <hermanjl@cs.unc.edu> | 2013-01-22 10:38:37 -0500 |
|---|---|---|
| committer | Jonathan Herman <hermanjl@cs.unc.edu> | 2013-01-22 10:38:37 -0500 |
| commit | fcc9d2e5a6c89d22b8b773a64fb4ad21ac318446 (patch) | |
| tree | a57612d1888735a2ec7972891b68c1ac5ec8faea /drivers/staging/octeon | |
| parent | 8dea78da5cee153b8af9c07a2745f6c55057fe12 (diff) | |
Diffstat (limited to 'drivers/staging/octeon')
52 files changed, 21889 insertions, 0 deletions
diff --git a/drivers/staging/octeon/cvmx-address.h b/drivers/staging/octeon/cvmx-address.h new file mode 100644 index 00000000000..3c74d826e2e --- /dev/null +++ b/drivers/staging/octeon/cvmx-address.h | |||
| @@ -0,0 +1,274 @@ | |||
| 1 | /***********************license start*************** | ||
| 2 | * Author: Cavium Networks | ||
| 3 | * | ||
| 4 | * Contact: support@caviumnetworks.com | ||
| 5 | * This file is part of the OCTEON SDK | ||
| 6 | * | ||
| 7 | * Copyright (c) 2003-2009 Cavium Networks | ||
| 8 | * | ||
| 9 | * This file is free software; you can redistribute it and/or modify | ||
| 10 | * it under the terms of the GNU General Public License, Version 2, as | ||
| 11 | * published by the Free Software Foundation. | ||
| 12 | * | ||
| 13 | * This file is distributed in the hope that it will be useful, but | ||
| 14 | * AS-IS and WITHOUT ANY WARRANTY; without even the implied warranty | ||
| 15 | * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, TITLE, or | ||
| 16 | * NONINFRINGEMENT. See the GNU General Public License for more | ||
| 17 | * details. | ||
| 18 | * | ||
| 19 | * You should have received a copy of the GNU General Public License | ||
| 20 | * along with this file; if not, write to the Free Software | ||
| 21 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | ||
| 22 | * or visit http://www.gnu.org/licenses/. | ||
| 23 | * | ||
| 24 | * This file may also be available under a different license from Cavium. | ||
| 25 | * Contact Cavium Networks for more information | ||
| 26 | ***********************license end**************************************/ | ||
| 27 | |||
| 28 | /** | ||
| 29 | * Typedefs and defines for working with Octeon physical addresses. | ||
| 30 | * | ||
| 31 | */ | ||
| 32 | #ifndef __CVMX_ADDRESS_H__ | ||
| 33 | #define __CVMX_ADDRESS_H__ | ||
| 34 | |||
| 35 | #if 0 | ||
| 36 | typedef enum { | ||
| 37 | CVMX_MIPS_SPACE_XKSEG = 3LL, | ||
| 38 | CVMX_MIPS_SPACE_XKPHYS = 2LL, | ||
| 39 | CVMX_MIPS_SPACE_XSSEG = 1LL, | ||
| 40 | CVMX_MIPS_SPACE_XUSEG = 0LL | ||
| 41 | } cvmx_mips_space_t; | ||
| 42 | #endif | ||
| 43 | |||
| 44 | typedef enum { | ||
| 45 | CVMX_MIPS_XKSEG_SPACE_KSEG0 = 0LL, | ||
| 46 | CVMX_MIPS_XKSEG_SPACE_KSEG1 = 1LL, | ||
| 47 | CVMX_MIPS_XKSEG_SPACE_SSEG = 2LL, | ||
| 48 | CVMX_MIPS_XKSEG_SPACE_KSEG3 = 3LL | ||
| 49 | } cvmx_mips_xkseg_space_t; | ||
| 50 | |||
| 51 | /* decodes <14:13> of a kseg3 window address */ | ||
| 52 | typedef enum { | ||
| 53 | CVMX_ADD_WIN_SCR = 0L, | ||
| 54 | /* see cvmx_add_win_dma_dec_t for further decode */ | ||
| 55 | CVMX_ADD_WIN_DMA = 1L, | ||
| 56 | CVMX_ADD_WIN_UNUSED = 2L, | ||
| 57 | CVMX_ADD_WIN_UNUSED2 = 3L | ||
| 58 | } cvmx_add_win_dec_t; | ||
| 59 | |||
| 60 | /* decode within DMA space */ | ||
| 61 | typedef enum { | ||
| 62 | /* | ||
| 63 | * Add store data to the write buffer entry, allocating it if | ||
| 64 | * necessary. | ||
| 65 | */ | ||
| 66 | CVMX_ADD_WIN_DMA_ADD = 0L, | ||
| 67 | /* send out the write buffer entry to DRAM */ | ||
| 68 | CVMX_ADD_WIN_DMA_SENDMEM = 1L, | ||
| 69 | /* store data must be normal DRAM memory space address in this case */ | ||
| 70 | /* send out the write buffer entry as an IOBDMA command */ | ||
| 71 | CVMX_ADD_WIN_DMA_SENDDMA = 2L, | ||
| 72 | /* see CVMX_ADD_WIN_DMA_SEND_DEC for data contents */ | ||
| 73 | /* send out the write buffer entry as an IO write */ | ||
| 74 | CVMX_ADD_WIN_DMA_SENDIO = 3L, | ||
| 75 | /* store data must be normal IO space address in this case */ | ||
| 76 | /* send out a single-tick command on the NCB bus */ | ||
| 77 | CVMX_ADD_WIN_DMA_SENDSINGLE = 4L, | ||
| 78 | /* no write buffer data needed/used */ | ||
| 79 | } cvmx_add_win_dma_dec_t; | ||
| 80 | |||
| 81 | /* | ||
| 82 | * Physical Address Decode | ||
| 83 | * | ||
| 84 | * Octeon-I HW never interprets this X (<39:36> reserved | ||
| 85 | * for future expansion), software should set to 0. | ||
| 86 | * | ||
| 87 | * - 0x0 XXX0 0000 0000 to DRAM Cached | ||
| 88 | * - 0x0 XXX0 0FFF FFFF | ||
| 89 | * | ||
| 90 | * - 0x0 XXX0 1000 0000 to Boot Bus Uncached (Converted to 0x1 00X0 1000 0000 | ||
| 91 | * - 0x0 XXX0 1FFF FFFF + EJTAG to 0x1 00X0 1FFF FFFF) | ||
| 92 | * | ||
| 93 | * - 0x0 XXX0 2000 0000 to DRAM Cached | ||
| 94 | * - 0x0 XXXF FFFF FFFF | ||
| 95 | * | ||
| 96 | * - 0x1 00X0 0000 0000 to Boot Bus Uncached | ||
| 97 | * - 0x1 00XF FFFF FFFF | ||
| 98 | * | ||
| 99 | * - 0x1 01X0 0000 0000 to Other NCB Uncached | ||
| 100 | * - 0x1 FFXF FFFF FFFF devices | ||
| 101 | * | ||
| 102 | * Decode of all Octeon addresses | ||
| 103 | */ | ||
| 104 | typedef union { | ||
| 105 | |||
| 106 | uint64_t u64; | ||
| 107 | /* mapped or unmapped virtual address */ | ||
| 108 | struct { | ||
| 109 | uint64_t R:2; | ||
| 110 | uint64_t offset:62; | ||
| 111 | } sva; | ||
| 112 | |||
| 113 | /* mapped USEG virtual addresses (typically) */ | ||
| 114 | struct { | ||
| 115 | uint64_t zeroes:33; | ||
| 116 | uint64_t offset:31; | ||
| 117 | } suseg; | ||
| 118 | |||
| 119 | /* mapped or unmapped virtual address */ | ||
| 120 | struct { | ||
| 121 | uint64_t ones:33; | ||
| 122 | uint64_t sp:2; | ||
| 123 | uint64_t offset:29; | ||
| 124 | } sxkseg; | ||
| 125 | |||
| 126 | /* | ||
| 127 | * physical address accessed through xkphys unmapped virtual | ||
| 128 | * address. | ||
| 129 | */ | ||
| 130 | struct { | ||
| 131 | uint64_t R:2; /* CVMX_MIPS_SPACE_XKPHYS in this case */ | ||
