diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2013-03-02 10:44:16 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-03-02 10:44:16 -0500 |
commit | aebb2afd5420c860b7fbc3882a323ef1247fbf16 (patch) | |
tree | 05ee0efcebca5ec421de44de7a6d6271088c64a8 /arch/mips/include/asm/octeon | |
parent | 8eae508b7c6ff502a71d0293b69e97c5505d5840 (diff) | |
parent | edb15d83a875a1f4b1576188844db5c330c3267d (diff) |
Merge branch 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus
Pull MIPS updates from Ralf Baechle:
o Add basic support for the Mediatek/Ralink Wireless SoC family.
o The Qualcomm Atheros platform is extended by support for the new
QCA955X SoC series as well as a bunch of patches that get the code
ready for OF support.
o Lantiq and BCM47XX platform have a few improvements and bug fixes.
o MIPS has sent a few patches that get the kernel ready for the
upcoming microMIPS support.
o The rest of the series is made up of small bug fixes and cleanups
that relate to various parts of the MIPS code. The biggy in there is
a whitespace cleanup. After I was sent another set of whitespace
cleanup patches I decided it was the time to clean the whitespace
"issues" for once and and that touches many files below arch/mips/.
Fix up silly conflicts, mostly due to whitespace cleanups.
* 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus: (105 commits)
MIPS: Quit exporting kernel internel break codes to uapi/asm/break.h
MIPS: remove broken conditional inside vpe loader code
MIPS: SMTC: fix implicit declaration of set_vi_handler
MIPS: early_printk: drop __init annotations
MIPS: Probe for and report hardware virtualization support.
MIPS: ath79: add support for the Qualcomm Atheros AP136-010 board
MIPS: ath79: add USB controller registration code for the QCA955X SoCs
MIPS: ath79: add PCI controller registration code for the QCA955X SoCs
MIPS: ath79: add WMAC registration code for the QCA955X SoCs
MIPS: ath79: register UART for the QCA955X SoCs
MIPS: ath79: add QCA955X specific glue to ath79_device_reset_{set, clear}
MIPS: ath79: add GPIO setup code for the QCA955X SoCs
MIPS: ath79: add IRQ handling code for the QCA955X SoCs
MIPS: ath79: add clock setup code for the QCA955X SoCs
MIPS: ath79: add SoC detection code for the QCA955X SoCs
MIPS: ath79: add early printk support for the QCA955X SoCs
MIPS: ath79: fix WMAC IRQ resource assignment
mips: reserve elfcorehdr
mips: Make sure kernel memory is in iomem
MIPS: ath79: use dynamically allocated USB platform devices
...
Diffstat (limited to 'arch/mips/include/asm/octeon')
30 files changed, 775 insertions, 775 deletions
diff --git a/arch/mips/include/asm/octeon/cvmx-address.h b/arch/mips/include/asm/octeon/cvmx-address.h index 3c74d826e2e6..e2d874e681f6 100644 --- a/arch/mips/include/asm/octeon/cvmx-address.h +++ b/arch/mips/include/asm/octeon/cvmx-address.h | |||
@@ -84,20 +84,20 @@ typedef enum { | |||
84 | * Octeon-I HW never interprets this X (<39:36> reserved | 84 | * Octeon-I HW never interprets this X (<39:36> reserved |
85 | * for future expansion), software should set to 0. | 85 | * for future expansion), software should set to 0. |
86 | * | 86 | * |
87 | * - 0x0 XXX0 0000 0000 to DRAM Cached | 87 | * - 0x0 XXX0 0000 0000 to DRAM Cached |
88 | * - 0x0 XXX0 0FFF FFFF | 88 | * - 0x0 XXX0 0FFF FFFF |
89 | * | 89 | * |
90 | * - 0x0 XXX0 1000 0000 to Boot Bus Uncached (Converted to 0x1 00X0 1000 0000 | 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) | 91 | * - 0x0 XXX0 1FFF FFFF + EJTAG to 0x1 00X0 1FFF FFFF) |
92 | * | 92 | * |
93 | * - 0x0 XXX0 2000 0000 to DRAM Cached | 93 | * - 0x0 XXX0 2000 0000 to DRAM Cached |
94 | * - 0x0 XXXF FFFF FFFF | 94 | * - 0x0 XXXF FFFF FFFF |
95 | * | 95 | * |
96 | * - 0x1 00X0 0000 0000 to Boot Bus Uncached | 96 | * - 0x1 00X0 0000 0000 to Boot Bus Uncached |
97 | * - 0x1 00XF FFFF FFFF | 97 | * - 0x1 00XF FFFF FFFF |
98 | * | 98 | * |
99 | * - 0x1 01X0 0000 0000 to Other NCB Uncached | 99 | * - 0x1 01X0 0000 0000 to Other NCB Uncached |
100 | * - 0x1 FFXF FFFF FFFF devices | 100 | * - 0x1 FFXF FFFF FFFF devices |
101 | * | 101 | * |
102 | * Decode of all Octeon addresses | 102 | * Decode of all Octeon addresses |
103 | */ | 103 | */ |
@@ -129,9 +129,9 @@ typedef union { | |||
129 | */ | 129 | */ |
130 | struct { | 130 | struct { |
131 | uint64_t R:2; /* CVMX_MIPS_SPACE_XKPHYS in this case */ | 131 | uint64_t R:2; /* CVMX_MIPS_SPACE_XKPHYS in this case */ |
132 | uint64_t cca:3; /* ignored by octeon */ | 132 | uint64_t cca:3; /* ignored by octeon */ |
133 | uint64_t mbz:10; | 133 | uint64_t mbz:10; |
134 | uint64_t pa:49; /* physical address */ | 134 | uint64_t pa:49; /* physical address */ |
135 | } sxkphys; | 135 | } sxkphys; |
136 | 136 | ||
137 | /* physical address */ | 137 | /* physical address */ |
@@ -253,22 +253,22 @@ typedef union { | |||
253 | #define CVMX_OCT_DID_ASX1 23ULL | 253 | #define CVMX_OCT_DID_ASX1 23ULL |
254 | #define CVMX_OCT_DID_IOB 30ULL | 254 | #define CVMX_OCT_DID_IOB 30ULL |
255 | 255 | ||
256 | #define CVMX_OCT_DID_PKT_SEND CVMX_FULL_DID(CVMX_OCT_DID_PKT, 2ULL) | 256 | #define CVMX_OCT_DID_PKT_SEND CVMX_FULL_DID(CVMX_OCT_DID_PKT, 2ULL) |
257 | #define CVMX_OCT_DID_TAG_SWTAG CVMX_FULL_DID(CVMX_OCT_DID_TAG, 0ULL) | 257 | #define CVMX_OCT_DID_TAG_SWTAG CVMX_FULL_DID(CVMX_OCT_DID_TAG, 0ULL) |
258 | #define CVMX_OCT_DID_TAG_TAG1 CVMX_FULL_DID(CVMX_OCT_DID_TAG, 1ULL) | 258 | #define CVMX_OCT_DID_TAG_TAG1 CVMX_FULL_DID(CVMX_OCT_DID_TAG, 1ULL) |
259 | #define CVMX_OCT_DID_TAG_TAG2 CVMX_FULL_DID(CVMX_OCT_DID_TAG, 2ULL) | 259 | #define CVMX_OCT_DID_TAG_TAG2 CVMX_FULL_DID(CVMX_OCT_DID_TAG, 2ULL) |
260 | #define CVMX_OCT_DID_TAG_TAG3 CVMX_FULL_DID(CVMX_OCT_DID_TAG, 3ULL) | 260 | #define CVMX_OCT_DID_TAG_TAG3 CVMX_FULL_DID(CVMX_OCT_DID_TAG, 3ULL) |
261 | #define CVMX_OCT_DID_TAG_NULL_RD CVMX_FULL_DID(CVMX_OCT_DID_TAG, 4ULL) | 261 | #define CVMX_OCT_DID_TAG_NULL_RD CVMX_FULL_DID(CVMX_OCT_DID_TAG, 4ULL) |
262 | #define CVMX_OCT_DID_TAG_CSR CVMX_FULL_DID(CVMX_OCT_DID_TAG, 7ULL) | 262 | #define CVMX_OCT_DID_TAG_CSR CVMX_FULL_DID(CVMX_OCT_DID_TAG, 7ULL) |
263 | #define CVMX_OCT_DID_FAU_FAI CVMX_FULL_DID(CVMX_OCT_DID_IOB, 0ULL) | 263 | #define CVMX_OCT_DID_FAU_FAI CVMX_FULL_DID(CVMX_OCT_DID_IOB, 0ULL) |
264 | #define CVMX_OCT_DID_TIM_CSR CVMX_FULL_DID(CVMX_OCT_DID_TIM, 0ULL) | 264 | #define CVMX_OCT_DID_TIM_CSR CVMX_FULL_DID(CVMX_OCT_DID_TIM, 0ULL) |
265 | #define CVMX_OCT_DID_KEY_RW CVMX_FULL_DID(CVMX_OCT_DID_KEY, 0ULL) | 265 | #define CVMX_OCT_DID_KEY_RW CVMX_FULL_DID(CVMX_OCT_DID_KEY, 0ULL) |
266 | #define CVMX_OCT_DID_PCI_6 CVMX_FULL_DID(CVMX_OCT_DID_PCI, 6ULL) | 266 | #define CVMX_OCT_DID_PCI_6 CVMX_FULL_DID(CVMX_OCT_DID_PCI, 6ULL) |
267 | #define CVMX_OCT_DID_MIS_BOO CVMX_FULL_DID(CVMX_OCT_DID_MIS, 0ULL) | 267 | #define CVMX_OCT_DID_MIS_BOO CVMX_FULL_DID(CVMX_OCT_DID_MIS, 0ULL) |
268 | #define CVMX_OCT_DID_PCI_RML CVMX_FULL_DID(CVMX_OCT_DID_PCI, 0ULL) | 268 | #define CVMX_OCT_DID_PCI_RML CVMX_FULL_DID(CVMX_OCT_DID_PCI, 0ULL) |
269 | #define CVMX_OCT_DID_IPD_CSR CVMX_FULL_DID(CVMX_OCT_DID_IPD, 7ULL) | 269 | #define CVMX_OCT_DID_IPD_CSR CVMX_FULL_DID(CVMX_OCT_DID_IPD, 7ULL) |
270 | #define CVMX_OCT_DID_DFA_CSR CVMX_FULL_DID(CVMX_OCT_DID_DFA, 7ULL) | 270 | #define CVMX_OCT_DID_DFA_CSR CVMX_FULL_DID(CVMX_OCT_DID_DFA, 7ULL) |
271 | #define CVMX_OCT_DID_MIS_CSR CVMX_FULL_DID(CVMX_OCT_DID_MIS, 7ULL) | 271 | #define CVMX_OCT_DID_MIS_CSR CVMX_FULL_DID(CVMX_OCT_DID_MIS, 7ULL) |
272 | #define CVMX_OCT_DID_ZIP_CSR CVMX_FULL_DID(CVMX_OCT_DID_ZIP, 0ULL) | 272 | #define CVMX_OCT_DID_ZIP_CSR CVMX_FULL_DID(CVMX_OCT_DID_ZIP, 0ULL) |
273 | 273 | ||
274 | #endif /* __CVMX_ADDRESS_H__ */ | 274 | #endif /* __CVMX_ADDRESS_H__ */ |
diff --git a/arch/mips/include/asm/octeon/cvmx-bootinfo.h b/arch/mips/include/asm/octeon/cvmx-bootinfo.h index 1db1dc2724cb..284fa8d773ba 100644 --- a/arch/mips/include/asm/octeon/cvmx-bootinfo.h +++ b/arch/mips/include/asm/octeon/cvmx-bootinfo.h | |||
@@ -91,11 +91,11 @@ struct cvmx_bootinfo { | |||
91 | #if (CVMX_BOOTINFO_MIN_VER >= 1) | 91 | #if (CVMX_BOOTINFO_MIN_VER >= 1) |
92 | /* | 92 | /* |
93 | * Several boards support compact flash on the Octeon boot | 93 | * Several boards support compact flash on the Octeon boot |
94 | * bus. The CF memory spaces may be mapped to different | 94 | * bus. The CF memory spaces may be mapped to different |
95 | * addresses on different boards. These are the physical | 95 | * addresses on different boards. These are the physical |
96 | * addresses, so care must be taken to use the correct | 96 | * addresses, so care must be taken to use the correct |
97 | * XKPHYS/KSEG0 addressing depending on the application's | 97 | * XKPHYS/KSEG0 addressing depending on the application's |
98 | * ABI. These values will be 0 if CF is not present. | 98 | * ABI. These values will be 0 if CF is not present. |
99 | */ | 99 | */ |
100 | uint64_t compact_flash_common_base_addr; | 100 | uint64_t compact_flash_common_base_addr; |
101 | uint64_t compact_flash_attribute_base_addr; | 101 | uint64_t compact_flash_attribute_base_addr; |
@@ -131,7 +131,7 @@ struct cvmx_bootinfo { | |||
131 | #define CVMX_BOOTINFO_CFG_FLAG_NO_MAGIC (1ull << 3) | 131 | #define CVMX_BOOTINFO_CFG_FLAG_NO_MAGIC (1ull << 3) |
132 | /* This flag is set if the TLB mappings are not contained in the | 132 | /* This flag is set if the TLB mappings are not contained in the |
133 | * 0x10000000 - 0x20000000 boot bus region. */ | 133 | * 0x10000000 - 0x20000000 boot bus region. */ |
134 | #define CVMX_BOOTINFO_CFG_FLAG_OVERSIZE_TLB_MAPPING (1ull << 4) | 134 | #define CVMX_BOOTINFO_CFG_FLAG_OVERSIZE_TLB_MAPPING (1ull << 4) |
135 | #define CVMX_BOOTINFO_CFG_FLAG_BREAK (1ull << 5) | 135 | #define CVMX_BOOTINFO_CFG_FLAG_BREAK (1ull << 5) |
136 | 136 | ||
137 | #endif /* (CVMX_BOOTINFO_MAJ_VER == 1) */ | 137 | #endif /* (CVMX_BOOTINFO_MAJ_VER == 1) */ |
@@ -164,9 +164,9 @@ enum cvmx_board_types_enum { | |||
164 | CVMX_BOARD_TYPE_EBT5600 = 22, | 164 | CVMX_BOARD_TYPE_EBT5600 = 22, |
165 | CVMX_BOARD_TYPE_EBH5201 = 23, | 165 | CVMX_BOARD_TYPE_EBH5201 = 23, |
166 | CVMX_BOARD_TYPE_EBT5200 = 24, | 166 | CVMX_BOARD_TYPE_EBT5200 = 24, |
167 | CVMX_BOARD_TYPE_CB5600 = 25, | 167 | CVMX_BOARD_TYPE_CB5600 = 25, |
168 | CVMX_BOARD_TYPE_CB5601 = 26, | 168 | CVMX_BOARD_TYPE_CB5601 = 26, |
169 | CVMX_BOARD_TYPE_CB5200 = 27, | 169 | CVMX_BOARD_TYPE_CB5200 = 27, |
170 | /* Special 'generic' board type, supports many boards */ | 170 | /* Special 'generic' board type, supports many boards */ |
171 | CVMX_BOARD_TYPE_GENERIC = 28, | 171 | CVMX_BOARD_TYPE_GENERIC = 28, |
172 | CVMX_BOARD_TYPE_EBH5610 = 29, | 172 | CVMX_BOARD_TYPE_EBH5610 = 29, |
@@ -223,7 +223,7 @@ enum cvmx_board_types_enum { | |||
223 | CVMX_BOARD_TYPE_CUST_DEFINED_MAX = 20000, | 223 | CVMX_BOARD_TYPE_CUST_DEFINED_MAX = 20000, |
224 | 224 | ||
225 | /* | 225 | /* |
226 | * Set aside a range for customer private use. The SDK won't | 226 | * Set aside a range for customer private use. The SDK won't |
227 | * use any numbers in this range. | 227 | * use any numbers in this range. |
228 | */ | 228 | */ |
229 | CVMX_BOARD_TYPE_CUST_PRIVATE_MIN = 20001, | 229 | CVMX_BOARD_TYPE_CUST_PRIVATE_MIN = 20001, |
diff --git a/arch/mips/include/asm/octeon/cvmx-bootmem.h b/arch/mips/include/asm/octeon/cvmx-bootmem.h index 42db2be663f1..352f1dc2508b 100644 --- a/arch/mips/include/asm/octeon/cvmx-bootmem.h +++ b/arch/mips/include/asm/octeon/cvmx-bootmem.h | |||
@@ -39,7 +39,7 @@ | |||
39 | #define CVMX_BOOTMEM_NUM_NAMED_BLOCKS 64 | 39 | #define CVMX_BOOTMEM_NUM_NAMED_BLOCKS 64 |
40 | 40 | ||
41 | /* minimum alignment of bootmem alloced blocks */ | 41 | /* minimum alignment of bootmem alloced blocks */ |
42 | #define CVMX_BOOTMEM_ALIGNMENT_SIZE (16ull) | 42 | #define CVMX_BOOTMEM_ALIGNMENT_SIZE (16ull) |
43 | 43 | ||
44 | /* Flags for cvmx_bootmem_phy_mem* functions */ | 44 | /* Flags for cvmx_bootmem_phy_mem* functions */ |
45 | /* Allocate from end of block instead of beginning */ | 45 | /* Allocate from end of block instead of beginning */ |
@@ -151,8 +151,8 @@ extern void *cvmx_bootmem_alloc(uint64_t size, uint64_t alignment); | |||
151 | * memory cannot be allocated at the specified address. | 151 | * memory cannot be allocated at the specified address. |
152 | * | 152 | * |
153 | * @size: Size in bytes of block to allocate | 153 | * @size: Size in bytes of block to allocate |
154 | * @address: Physical address to allocate memory at. If this memory is not | 154 | * @address: Physical address to allocate memory at. If this memory is not |
155 | * available, the allocation fails. | 155 | * available, the allocation fails. |
156 | * @alignment: Alignment required - must be power of 2 | 156 | * @alignment: Alignment required - must be power of 2 |
157 | * Returns pointer to block of memory, NULL on error | 157 | * Returns pointer to block of memory, NULL on error |
158 | */ | 158 | */ |
@@ -181,7 +181,7 @@ extern void *cvmx_bootmem_alloc_range(uint64_t size, uint64_t alignment, | |||
181 | * @name: name of block to free | 181 | * @name: name of block to free |
182 | * | 182 | * |
183 | * Returns 0 on failure, | 183 | * Returns 0 on failure, |
184 | * !0 on success | 184 | * !0 on success |
185 | */ | 185 | */ |
186 | 186 | ||
187 | 187 | ||
@@ -210,9 +210,9 @@ extern void *cvmx_bootmem_alloc_named(uint64_t size, uint64_t alignment, | |||
210 | * | 210 | * |
211 | * @size: Size in bytes of block to allocate | 211 | * @size: Size in bytes of block to allocate |
212 | * @address: Physical address to allocate memory at. If this | 212 | * @address: Physical address to allocate memory at. If this |
213 | * memory is not available, the allocation fails. | 213 | * memory is not available, the allocation fails. |
214 | * @name: name of block - must be less than CVMX_BOOTMEM_NAME_LEN | 214 | * @name: name of block - must be less than CVMX_BOOTMEM_NAME_LEN |
215 | * bytes | 215 | * bytes |
216 | * | 216 | * |
217 | * Returns a pointer to block of memory, NULL on error | 217 | * Returns a pointer to block of memory, NULL on error |
218 | */ | 218 | */ |
@@ -249,7 +249,7 @@ extern int cvmx_bootmem_free_named(char *name); | |||
249 | * @name: name of block to free | 249 | * @name: name of block to free |
250 | * | 250 | * |
251 | * Returns pointer to named block descriptor on success | 251 | * Returns pointer to named block descriptor on success |
252 | * 0 on failure | 252 | * 0 on failure |
253 | */ | 253 | */ |
254 | struct cvmx_bootmem_named_block_desc *cvmx_bootmem_find_named_block(char *name); | 254 | struct cvmx_bootmem_named_block_desc *cvmx_bootmem_find_named_block(char *name); |
255 | 255 | ||
@@ -258,20 +258,20 @@ struct cvmx_bootmem_named_block_desc *cvmx_bootmem_find_named_block(char *name); | |||
258 | * (optional) requested address and alignment. | 258 | * (optional) requested address and alignment. |
259 | * | 259 | * |
260 | * @req_size: size of region to allocate. All requests are rounded up | 260 | * @req_size: size of region to allocate. All requests are rounded up |
261 | * to be a multiple CVMX_BOOTMEM_ALIGNMENT_SIZE bytes size | 261 | * to be a multiple CVMX_BOOTMEM_ALIGNMENT_SIZE bytes size |
262 | * | 262 | * |
263 | * @address_min: Minimum address that block can occupy. | 263 | * @address_min: Minimum address that block can occupy. |
264 | * | 264 | * |
265 | * @address_max: Specifies the maximum address_min (inclusive) that | 265 | * @address_max: Specifies the maximum address_min (inclusive) that |
266 | * the allocation can use. | 266 | * the allocation can use. |
267 | * | 267 | * |
268 | * @alignment: Requested alignment of the block. If this alignment | 268 | * @alignment: Requested alignment of the block. If this alignment |
269 | * cannot be met, the allocation fails. This must be a | 269 | * cannot be met, the allocation fails. This must be a |
270 | * power of 2. (Note: Alignment of | 270 | * power of 2. (Note: Alignment of |
271 | * CVMX_BOOTMEM_ALIGNMENT_SIZE bytes is required, and | 271 | * CVMX_BOOTMEM_ALIGNMENT_SIZE bytes is required, and |
272 | * internally enforced. Requested alignments of less than | 272 | * internally enforced. Requested alignments of less than |
273 | * CVMX_BOOTMEM_ALIGNMENT_SIZE are set to | 273 | * CVMX_BOOTMEM_ALIGNMENT_SIZE are set to |
274 | * CVMX_BOOTMEM_ALIGNMENT_SIZE.) | 274 | * CVMX_BOOTMEM_ALIGNMENT_SIZE.) |
275 | * | 275 | * |
276 | * @flags: Flags to control options for the allocation. | 276 | * @flags: Flags to control options for the allocation. |
277 | * | 277 | * |
@@ -285,21 +285,21 @@ int64_t cvmx_bootmem_phy_alloc(uint64_t req_size, uint64_t address_min, | |||
285 | * Allocates a named block of physical memory from the free list, at | 285 | * Allocates a named block of physical memory from the free list, at |
286 | * (optional) requested address and alignment. | 286 | * (optional) requested address and alignment. |
287 | * | 287 | * |
288 | * @param size size of region to allocate. All requests are rounded | 288 | * @param size size of region to allocate. All requests are rounded |
289 | * up to be a multiple CVMX_BOOTMEM_ALIGNMENT_SIZE | 289 | * up to be a multiple CVMX_BOOTMEM_ALIGNMENT_SIZE |
290 | * bytes size | 290 | * bytes size |
291 | * @param min_addr Minimum address that block can occupy. | 291 | * @param min_addr Minimum address that block can occupy. |
292 | * @param max_addr Specifies the maximum address_min (inclusive) that | 292 | * @param max_addr Specifies the maximum address_min (inclusive) that |
293 | * the allocation can use. | 293 | * the allocation can use. |
294 | * @param alignment Requested alignment of the block. If this | 294 | * @param alignment Requested alignment of the block. If this |
295 | * alignment cannot be met, the allocation fails. | 295 | * alignment cannot be met, the allocation fails. |
296 | * This must be a power of 2. (Note: Alignment of | 296 | * This must be a power of 2. (Note: Alignment of |
297 | * CVMX_BOOTMEM_ALIGNMENT_SIZE bytes is required, and | 297 | * CVMX_BOOTMEM_ALIGNMENT_SIZE bytes is required, and |
298 | * internally enforced. Requested alignments of less | 298 | * internally enforced. Requested alignments of less |
299 | * than CVMX_BOOTMEM_ALIGNMENT_SIZE are set to | 299 | * than CVMX_BOOTMEM_ALIGNMENT_SIZE are set to |
300 | * CVMX_BOOTMEM_ALIGNMENT_SIZE.) | 300 | * CVMX_BOOTMEM_ALIGNMENT_SIZE.) |
301 | * @param name name to assign to named block | 301 | * @param name name to assign to named block |
302 | * @param flags Flags to control options for the allocation. | 302 | * @param flags Flags to control options for the allocation. |
303 | * | 303 | * |
304 | * @return physical address of block allocated, or -1 on failure | 304 | * @return physical address of block allocated, or -1 on failure |
305 | */ | 305 | */ |
@@ -312,14 +312,14 @@ int64_t cvmx_bootmem_phy_named_block_alloc(uint64_t size, uint64_t min_addr, | |||
312 | * Finds a named memory block by name. | 312 | * Finds a named memory block by name. |
313 | * Also used for finding an unused entry in the named block table. | 313 | * Also used for finding an unused entry in the named block table. |
314 | * | 314 | * |
315 | * @name: Name of memory block to find. If NULL pointer given, then | 315 | * @name: Name of memory block to find. If NULL pointer given, then |
316 | * finds unused descriptor, if available. | 316 | * finds unused descriptor, if available. |
317 | * | 317 | * |
318 | * @flags: Flags to control options for the allocation. | 318 | * @flags: Flags to control options for the allocation. |
319 | * | 319 | * |
320 | * Returns Pointer to memory block descriptor, NULL if not found. | 320 | * Returns Pointer to memory block descriptor, NULL if not found. |
321 | * If NULL returned when name parameter is NULL, then no memory | 321 | * If NULL returned when name parameter is NULL, then no memory |
322 | * block descriptors are available. | 322 | * block descriptors are available. |
323 | */ | 323 | */ |
324 | struct cvmx_bootmem_named_block_desc * | 324 | struct cvmx_bootmem_named_block_desc * |
325 | cvmx_bootmem_phy_named_block_find(char *name, uint32_t flags); | 325 | cvmx_bootmem_phy_named_block_find(char *name, uint32_t flags); |
@@ -331,31 +331,31 @@ cvmx_bootmem_phy_named_block_find(char *name, uint32_t flags); | |||
331 | * @flags: flags for passing options | 331 | * @flags: flags for passing options |
332 | * | 332 | * |
333 | * Returns 0 on failure | 333 | * Returns 0 on failure |
334 | * 1 on success | 334 | * 1 on success |
335 | */ | 335 | */ |
336 | int cvmx_bootmem_phy_named_block_free(char *name, uint32_t flags); | 336 | int cvmx_bootmem_phy_named_block_free(char *name, uint32_t flags); |
337 | 337 | ||
338 | /** | 338 | /** |
339 | * Frees a block to the bootmem allocator list. This must | 339 | * Frees a block to the bootmem allocator list. This must |
340 | * be used with care, as the size provided must match the size | 340 | * be used with care, as the size provided must match the size |
341 | * of the block that was allocated, or the list will become | 341 | * of the block that was allocated, or the list will become |
342 | * corrupted. | 342 | * corrupted. |
343 | * | 343 | * |
344 | * IMPORTANT: This is only intended to be used as part of named block | 344 | * IMPORTANT: This is only intended to be used as part of named block |
345 | * frees and initial population of the free memory list. | 345 | * frees and initial population of the free memory list. |
346 | * * | 346 | * * |
347 | * | 347 | * |
348 | * @phy_addr: physical address of block | 348 | * @phy_addr: physical address of block |
349 | * @size: size of block in bytes. | 349 | * @size: size of block in bytes. |
350 | * @flags: flags for passing options | 350 | * @flags: flags for passing options |
351 | * | 351 | * |
352 | * Returns 1 on success, | 352 | * Returns 1 on success, |
353 | * 0 on failure | 353 | * 0 on failure |
354 | */ | 354 | */ |
355 | int __cvmx_bootmem_phy_free(uint64_t phy_addr, uint64_t size, uint32_t flags); | 355 | int __cvmx_bootmem_phy_free(uint64_t phy_addr, uint64_t size, uint32_t flags); |
356 | 356 | ||
357 | /** | 357 | /** |
358 | * Locks the bootmem allocator. This is useful in certain situations | 358 | * Locks the bootmem allocator. This is useful in certain situations |
359 | * where multiple allocations must be made without being interrupted. | 359 | * where multiple allocations must be made without being interrupted. |
360 | * This should be used with the CVMX_BOOTMEM_FLAG_NO_LOCKING flag. | 360 | * This should be used with the CVMX_BOOTMEM_FLAG_NO_LOCKING flag. |
361 | * | 361 | * |
diff --git a/arch/mips/include/asm/octeon/cvmx-cmd-queue.h b/arch/mips/include/asm/octeon/cvmx-cmd-queue.h index fed91125317f..024a71b2bff9 100644 --- a/arch/mips/include/asm/octeon/cvmx-cmd-queue.h +++ b/arch/mips/include/asm/octeon/cvmx-cmd-queue.h | |||
@@ -244,33 +244,33 @@ static inline void __cvmx_cmd_queue_lock(cvmx_cmd_queue_id_t queue_id, | |||
244 | ".set noreorder\n" | 244 | ".set noreorder\n" |
245 | "1:\n" | 245 | "1:\n" |
246 | /* Atomic add one to ticket_ptr */ | 246 | /* Atomic add one to ticket_ptr */ |
247 | "ll %[my_ticket], %[ticket_ptr]\n" | 247 | "ll %[my_ticket], %[ticket_ptr]\n" |
248 | /* and store the original value */ | 248 | /* and store the original value */ |
249 | "li %[ticket], 1\n" | 249 | "li %[ticket], 1\n" |
250 | /* in my_ticket */ | 250 | /* in my_ticket */ |
251 | "baddu %[ticket], %[my_ticket]\n" | 251 | "baddu %[ticket], %[my_ticket]\n" |
252 | "sc %[ticket], %[ticket_ptr]\n" | 252 | "sc %[ticket], %[ticket_ptr]\n" |
253 | "beqz %[ticket], 1b\n" | 253 | "beqz %[ticket], 1b\n" |
254 | " nop\n" | 254 | " nop\n" |
255 | /* Load the current now_serving ticket */ | 255 | /* Load the current now_serving ticket */ |
256 | "lbu %[ticket], %[now_serving]\n" | 256 | "lbu %[ticket], %[now_serving]\n" |
257 | "2:\n" | 257 | "2:\n" |
258 | /* Jump out if now_serving == my_ticket */ | 258 | /* Jump out if now_serving == my_ticket */ |
259 | "beq %[ticket], %[my_ticket], 4f\n" | 259 | "beq %[ticket], %[my_ticket], 4f\n" |
260 | /* Find out how many tickets are in front of me */ | 260 | /* Find out how many tickets are in front of me */ |
261 | " subu %[ticket], %[my_ticket], %[ticket]\n" | 261 | " subu %[ticket], %[my_ticket], %[ticket]\n" |
262 | /* Use tickets in front of me minus one to delay */ | 262 | /* Use tickets in front of me minus one to delay */ |
263 | "subu %[ticket], 1\n" | 263 | "subu %[ticket], 1\n" |
264 | /* Delay will be ((tickets in front)-1)*32 loops */ | 264 | /* Delay will be ((tickets in front)-1)*32 loops */ |
265 | "cins %[ticket], %[ticket], 5, 7\n" | 265 | "cins %[ticket], %[ticket], 5, 7\n" |
266 | "3:\n" | 266 | "3:\n" |
267 | /* Loop here until our ticket might be up */ | 267 | /* Loop here until our ticket might be up */ |
268 | "bnez %[ticket], 3b\n" | 268 | "bnez %[ticket], 3b\n" |
269 | " subu %[ticket], 1\n" | 269 | " subu %[ticket], 1\n" |
270 | /* Jump back up to check out ticket again */ | 270 | /* Jump back up to check out ticket again */ |
271 | "b 2b\n" | 271 | "b 2b\n" |
272 | /* Load the current now_serving ticket */ | 272 | /* Load the current now_serving ticket */ |
273 | " lbu %[ticket], %[now_serving]\n" | 273 | " lbu %[ticket], %[now_serving]\n" |
274 | "4:\n" | 274 | "4:\n" |
275 | ".set pop\n" : | 275 | ".set pop\n" : |
276 | [ticket_ptr] "=m"(__cvmx_cmd_queue_state_ptr->ticket[__cvmx_cmd_queue_get_index(queue_id)]), | 276 | [ticket_ptr] "=m"(__cvmx_cmd_queue_state_ptr->ticket[__cvmx_cmd_queue_get_index(queue_id)]), |
@@ -313,9 +313,9 @@ static inline __cvmx_cmd_queue_state_t | |||
313 | * | 313 | * |
314 | * @queue_id: Hardware command queue to write to | 314 | * @queue_id: Hardware command queue to write to |
315 | * @use_locking: | 315 | * @use_locking: |
316 | * Use internal locking to ensure exclusive access for queue | 316 | * Use internal locking to ensure exclusive access for queue |
317 | * updates. If you don't use this locking you must ensure | 317 | * updates. If you don't use this locking you must ensure |
318 | * exclusivity some other way. Locking is strongly recommended. | 318 | * exclusivity some other way. Locking is strongly recommended. |
319 | * @cmd_count: Number of command words to write | 319 | * @cmd_count: Number of command words to write |
320 | * @cmds: Array of commands to write | 320 | * @cmds: Array of commands to write |
321 | * | 321 | * |
@@ -411,9 +411,9 @@ static inline cvmx_cmd_queue_result_t cvmx_cmd_queue_write(cvmx_cmd_queue_id_t | |||
411 | * | 411 | * |
412 | * @queue_id: Hardware command queue to write to | 412 | * @queue_id: Hardware command queue to write to |
413 | * @use_locking: | 413 | * @use_locking: |
414 | * Use internal locking to ensure exclusive access for queue | 414 | * Use internal locking to ensure exclusive access for queue |
415 | * updates. If you don't use this locking you must ensure | 415 | * updates. If you don't use this locking you must ensure |
416 | * exclusivity some other way. Locking is strongly recommended. | 416 | * exclusivity some other way. Locking is strongly recommended. |
417 | * @cmd1: Command | 417 | * @cmd1: Command |
418 | * @cmd2: Command | 418 | * @cmd2: Command |
419 | * | 419 | * |
@@ -510,9 +510,9 @@ static inline cvmx_cmd_queue_result_t cvmx_cmd_queue_write2(cvmx_cmd_queue_id_t | |||
510 | * | 510 | * |
511 | * @queue_id: Hardware command queue to write to | 511 | * @queue_id: Hardware command queue to write to |
512 | * @use_locking: | 512 | * @use_locking: |
513 | * Use internal locking to ensure exclusive access for queue | 513 | * Use internal locking to ensure exclusive access for queue |
514 | * updates. If you don't use this locking you must ensure | 514 | * updates. If you don't use this locking you must ensure |
515 | * exclusivity some other way. Locking is strongly recommended. | 515 | * exclusivity some other way. Locking is strongly recommended. |
516 | * @cmd1: Command | 516 | * @cmd1: Command |
517 | * @cmd2: Command | 517 | * @cmd2: Command |
518 | * @cmd3: Command | 518 | * @cmd3: Command |
diff --git a/arch/mips/include/asm/octeon/cvmx-config.h b/arch/mips/include/asm/octeon/cvmx-config.h index 26835d1b43b8..f7dd17d0dc22 100644 --- a/arch/mips/include/asm/octeon/cvmx-config.h +++ b/arch/mips/include/asm/octeon/cvmx-config.h | |||
@@ -31,13 +31,13 @@ | |||
31 | 31 | ||
32 | /* Pools in use */ | 32 | /* Pools in use */ |
33 | /* Packet buffers */ | 33 | /* Packet buffers */ |
34 | #define CVMX_FPA_PACKET_POOL (0) | 34 | #define CVMX_FPA_PACKET_POOL (0) |
35 | #define CVMX_FPA_PACKET_POOL_SIZE CVMX_FPA_POOL_0_SIZE | 35 | #define CVMX_FPA_PACKET_POOL_SIZE CVMX_FPA_POOL_0_SIZE |
36 | /* Work queue entrys */ | 36 | /* Work queue entrys */ |
37 | #define CVMX_FPA_WQE_POOL (1) | 37 | #define CVMX_FPA_WQE_POOL (1) |
38 | #define CVMX_FPA_WQE_POOL_SIZE CVMX_FPA_POOL_1_SIZE | 38 | #define CVMX_FPA_WQE_POOL_SIZE CVMX_FPA_POOL_1_SIZE |
39 | /* PKO queue command buffers */ | 39 | /* PKO queue command buffers */ |
40 | #define CVMX_FPA_OUTPUT_BUFFER_POOL (2) | 40 | #define CVMX_FPA_OUTPUT_BUFFER_POOL (2) |
41 | #define CVMX_FPA_OUTPUT_BUFFER_POOL_SIZE CVMX_FPA_POOL_2_SIZE | 41 | #define CVMX_FPA_OUTPUT_BUFFER_POOL_SIZE CVMX_FPA_POOL_2_SIZE |
42 | 42 | ||
43 | /************************* FAU allocation ********************************/ | 43 | /************************* FAU allocation ********************************/ |
@@ -45,7 +45,7 @@ | |||
45 | * in order of descending size so that all alignment constraints are | 45 | * in order of descending size so that all alignment constraints are |
46 | * automatically met. The enums are linked so that the following enum | 46 | * automatically met. The enums are linked so that the following enum |
47 | * continues allocating where the previous one left off, so the | 47 | * continues allocating where the previous one left off, so the |
48 | * numbering within each enum always starts with zero. The macros | 48 | * numbering within each enum always starts with zero. The macros |
49 | * take care of the address increment size, so the values entered | 49 | * take care of the address increment size, so the values entered |
50 | * always increase by 1. FAU registers are accessed with byte | 50 | * always increase by 1. FAU registers are accessed with byte |
51 | * addresses. | 51 | * addresses. |
@@ -90,9 +90,9 @@ typedef enum { | |||
90 | * be taken into account. | 90 | * be taken into account. |
91 | */ | 91 | */ |
92 | /* Generic scratch iobdma area */ | 92 | /* Generic scratch iobdma area */ |
93 | #define CVMX_SCR_SCRATCH (0) | 93 | #define CVMX_SCR_SCRATCH (0) |
94 | /* First location available after cvmx-config.h allocated region. */ | 94 | /* First location available after cvmx-config.h allocated region. */ |
95 | #define CVMX_SCR_REG_AVAIL_BASE (8) | 95 | #define CVMX_SCR_REG_AVAIL_BASE (8) |
96 | 96 | ||
97 | /* | 97 | /* |
98 | * CVMX_HELPER_FIRST_MBUFF_SKIP is the number of bytes to reserve | 98 | * CVMX_HELPER_FIRST_MBUFF_SKIP is the number of bytes to reserve |
@@ -145,14 +145,14 @@ typedef enum { | |||
145 | * 1: include | 145 | * 1: include |
146 | */ | 146 | */ |
147 | #define CVMX_HELPER_INPUT_TAG_IPV6_SRC_IP 0 | 147 | #define CVMX_HELPER_INPUT_TAG_IPV6_SRC_IP 0 |
148 | #define CVMX_HELPER_INPUT_TAG_IPV6_DST_IP 0 | 148 | #define CVMX_HELPER_INPUT_TAG_IPV6_DST_IP 0 |
149 | #define CVMX_HELPER_INPUT_TAG_IPV6_SRC_PORT 0 | 149 | #define CVMX_HELPER_INPUT_TAG_IPV6_SRC_PORT 0 |
150 | #define CVMX_HELPER_INPUT_TAG_IPV6_DST_PORT 0 | 150 | #define CVMX_HELPER_INPUT_TAG_IPV6_DST_PORT 0 |
151 | #define CVMX_HELPER_INPUT_TAG_IPV6_NEXT_HEADER 0 | 151 | #define CVMX_HELPER_INPUT_TAG_IPV6_NEXT_HEADER 0 |
152 | #define CVMX_HELPER_INPUT_TAG_IPV4_SRC_IP 0 | 152 | #define CVMX_HELPER_INPUT_TAG_IPV4_SRC_IP 0 |
153 | #define CVMX_HELPER_INPUT_TAG_IPV4_DST_IP 0 | 153 | #define CVMX_HELPER_INPUT_TAG_IPV4_DST_IP 0 |
154 | #define CVMX_HELPER_INPUT_TAG_IPV4_SRC_PORT 0 | 154 | #define CVMX_HELPER_INPUT_TAG_IPV4_SRC_PORT 0 |
155 | #define CVMX_HELPER_INPUT_TAG_IPV4_DST_PORT 0 | 155 | #define CVMX_HELPER_INPUT_TAG_IPV4_DST_PORT 0 |
156 | #define CVMX_HELPER_INPUT_TAG_IPV4_PROTOCOL 0 | 156 | #define CVMX_HELPER_INPUT_TAG_IPV4_PROTOCOL 0 |
157 | #define CVMX_HELPER_INPUT_TAG_INPUT_PORT 1 | 157 | #define CVMX_HELPER_INPUT_TAG_INPUT_PORT 1 |
158 | 158 | ||
diff --git a/arch/mips/include/asm/octeon/cvmx-fau.h b/arch/mips/include/asm/octeon/cvmx-fau.h index a6939fc8ba18..ef98f7fc102f 100644 --- a/arch/mips/include/asm/octeon/cvmx-fau.h +++ b/arch/mips/include/asm/octeon/cvmx-fau.h | |||
@@ -37,13 +37,13 @@ | |||
37 | */ | 37 | */ |
38 | 38 | ||
39 | #define CVMX_FAU_LOAD_IO_ADDRESS cvmx_build_io_address(0x1e, 0) | 39 | #define CVMX_FAU_LOAD_IO_ADDRESS cvmx_build_io_address(0x1e, 0) |
40 | #define CVMX_FAU_BITS_SCRADDR 63, 56 | 40 | #define CVMX_FAU_BITS_SCRADDR 63, 56 |
41 | #define CVMX_FAU_BITS_LEN 55, 48 | 41 | #define CVMX_FAU_BITS_LEN 55, 48 |
42 | #define CVMX_FAU_BITS_INEVAL 35, 14 | 42 | #define CVMX_FAU_BITS_INEVAL 35, 14 |
43 | #define CVMX_FAU_BITS_TAGWAIT 13, 13 | 43 | #define CVMX_FAU_BITS_TAGWAIT 13, 13 |
44 | #define CVMX_FAU_BITS_NOADD 13, 13 | 44 | #define CVMX_FAU_BITS_NOADD 13, 13 |
45 | #define CVMX_FAU_BITS_SIZE 12, 11 | 45 | #define CVMX_FAU_BITS_SIZE 12, 11 |
46 | #define CVMX_FAU_BITS_REGISTER 10, 0 | 46 | #define CVMX_FAU_BITS_REGISTER 10, 0 |
47 | 47 | ||
48 | typedef enum { | 48 | typedef enum { |
49 | CVMX_FAU_OP_SIZE_8 = 0, | 49 | CVMX_FAU_OP_SIZE_8 = 0, |
@@ -109,11 +109,11 @@ typedef union { | |||
109 | * Builds a store I/O address for writing to the FAU | 109 | * Builds a store I/O address for writing to the FAU |
110 | * | 110 | * |
111 | * @noadd: 0 = Store value is atomically added to the current value | 111 | * @noadd: 0 = Store value is atomically added to the current value |
112 | * 1 = Store value is atomically written over the current value | 112 | * 1 = Store value is atomically written over the current value |
113 | * @reg: FAU atomic register to access. 0 <= reg < 2048. | 113 | * @reg: FAU atomic register to access. 0 <= reg < 2048. |
114 | * - Step by 2 for 16 bit access. | 114 | * - Step by 2 for 16 bit access. |
115 | * - Step by 4 for 32 bit access. | 115 | * - Step by 4 for 32 bit access. |
116 | * - Step by 8 for 64 bit access. | 116 | * - Step by 8 for 64 bit access. |
117 | * Returns Address to store for atomic update | 117 | * Returns Address to store for atomic update |
118 | */ | 118 | */ |
119 | static inline uint64_t __cvmx_fau_store_address(uint64_t noadd, uint64_t reg) | 119 | static inline uint64_t __cvmx_fau_store_address(uint64_t noadd, uint64_t reg) |
@@ -127,16 +127,16 @@ static inline uint64_t __cvmx_fau_store_address(uint64_t noadd, uint64_t reg) | |||
127 | * Builds a I/O address for accessing the FAU | 127 | * Builds a I/O address for accessing the FAU |
128 | * | 128 | * |
129 | * @tagwait: Should the atomic add wait for the current tag switch | 129 | * @tagwait: Should the atomic add wait for the current tag switch |
130 | * operation to complete. | 130 | * operation to complete. |
131 | * - 0 = Don't wait | 131 | * - 0 = Don't wait |
132 | * - 1 = Wait for tag switch to complete | 132 | * - 1 = Wait for tag switch to complete |
133 | * @reg: FAU atomic register to access. 0 <= reg < 2048. | 133 | * @reg: FAU atomic register to access. 0 <= reg < 2048. |
134 | * - Step by 2 for 16 bit access. | 134 | * - Step by 2 for 16 bit access. |
135 | * - Step by 4 for 32 bit access. | 135 | * - Step by 4 for 32 bit access. |
136 | * - Step by 8 for 64 bit access. | 136 | * - Step by 8 for 64 bit access. |
137 | * @value: Signed value to add. | 137 | * @value: Signed value to add. |
138 | * Note: When performing 32 and 64 bit access, only the low | 138 | * Note: When performing 32 and 64 bit access, only the low |
139 | * 22 bits are available. | 139 | * 22 bits are available. |
140 | * Returns Address to read from for atomic update | 140 | * Returns Address to read from for atomic update |
141 | */ | 141 | */ |
142 | static inline uint64_t __cvmx_fau_atomic_address(uint64_t tagwait, uint64_t reg, | 142 | static inline uint64_t __cvmx_fau_atomic_address(uint64_t tagwait, uint64_t reg, |
@@ -152,9 +152,9 @@ static inline uint64_t __cvmx_fau_atomic_address(uint64_t tagwait, uint64_t reg, | |||
152 | * Perform an atomic 64 bit add | 152 | * Perform an atomic 64 bit add |
153 | * | 153 | * |
154 | * @reg: FAU atomic register to access. 0 <= reg < 2048. | 154 | * @reg: FAU atomic register to access. 0 <= reg < 2048. |
155 | * - Step by 8 for 64 bit access. | 155 | * - Step by 8 for 64 bit access. |
156 | * @value: Signed value to add. | 156 | * @value: Signed value to add. |
157 | * Note: Only the low 22 bits are available. | 157 | * Note: Only the low 22 bits are available. |
158 | * Returns Value of the register before the update | 158 | * Returns Value of the register before the update |
159 | */ | 159 | */ |
160 | static inline int64_t cvmx_fau_fetch_and_add64(cvmx_fau_reg_64_t reg, | 160 | static inline int64_t cvmx_fau_fetch_and_add64(cvmx_fau_reg_64_t reg, |
@@ -167,9 +167,9 @@ static inline int64_t cvmx_fau_fetch_and_add64(cvmx_fau_reg_64_t reg, | |||
167 | * Perform an atomic 32 bit add | 167 | * Perform an atomic 32 bit add |
168 | * | 168 | * |
169 | * @reg: FAU atomic register to access. 0 <= reg < 2048. | 169 | * @reg: FAU atomic register to access. 0 <= reg < 2048. |
170 | * - Step by 4 for 32 bit access. | 170 | * - Step by 4 for 32 bit access. |
171 | * @value: Signed value to add. | 171 | * @value: Signed value to add. |
172 | * Note: Only the low 22 bits are available. | 172 | * Note: Only the low 22 bits are available. |
173 | * Returns Value of the register before the update | 173 | * Returns Value of the register before the update |
174 | */ | 174 | */ |
175 | static inline int32_t cvmx_fau_fetch_and_add32(cvmx_fau_reg_32_t reg, | 175 | static inline int32_t cvmx_fau_fetch_and_add32(cvmx_fau_reg_32_t reg, |
@@ -182,7 +182,7 @@ static inline int32_t cvmx_fau_fetch_and_add32(cvmx_fau_reg_32_t reg, | |||
182 | * Perform an atomic 16 bit add | 182 | * Perform an atomic 16 bit add |
183 | * | 183 | * |
184 | * @reg: FAU atomic register to access. 0 <= reg < 2048. | 184 | * @reg: FAU atomic register to access. 0 <= reg < 2048. |
185 | * - Step by 2 for 16 bit access. | 185 | * - Step by 2 for 16 bit access. |
186 | * @value: Signed value to add. | 186 | * @value: Signed value to add. |
187 | * Returns Value of the register before the update | 187 | * Returns Value of the register before the update |
188 | */ | 188 | */ |
@@ -209,12 +209,12 @@ static inline int8_t cvmx_fau_fetch_and_add8(cvmx_fau_reg_8_t reg, int8_t value) | |||
209 | * completes | 209 | * completes |
210 | * | 210 | * |
211 | * @reg: FAU atomic register to access. 0 <= reg < 2048. | 211 | * @reg: FAU atomic register to access. 0 <= reg < 2048. |
212 | * - Step by 8 for 64 bit access. | 212 | * - Step by 8 for 64 bit access. |
213 | * @value: Signed value to add. | 213 | * @value: Signed value to add. |
214 | * Note: Only the low 22 bits are available. | 214 | * Note: Only the low 22 bits are available. |
215 | * Returns If a timeout occurs, the error bit will be set. Otherwise | 215 | * Returns If a timeout occurs, the error bit will be set. Otherwise |
216 | * the value of the register before the update will be | 216 | * the value of the register before the update will be |
217 | * returned | 217 | * returned |
218 | */ | 218 | */ |
219 | static inline cvmx_fau_tagwait64_t | 219 | static inline cvmx_fau_tagwait64_t |
220 | cvmx_fau_tagwait_fetch_and_add64(cvmx_fau_reg_64_t reg, int64_t value) | 220 | cvmx_fau_tagwait_fetch_and_add64(cvmx_fau_reg_64_t reg, int64_t value) |
@@ -233,12 +233,12 @@ cvmx_fau_tagwait_fetch_and_add64(cvmx_fau_reg_64_t reg, int64_t value) | |||
233 | * completes | 233 | * completes |
234 | * | 234 | * |
235 | * @reg: FAU atomic register to access. 0 <= reg < 2048. | 235 | * @reg: FAU atomic register to access. 0 <= reg < 2048. |
236 | * - Step by 4 for 32 bit access. | 236 | * - Step by 4 for 32 bit access. |
237 | * @value: Signed value to add. | 237 | * @value: Signed value to add. |
238 | * Note: Only the low 22 bits are available. | 238 | * Note: Only the low 22 bits are available. |
239 | * Returns If a timeout occurs, the error bit will be set. Otherwise | 239 | * Returns If a timeout occurs, the error bit will be set. Otherwise |
240 | * the value of the register before the update will be | 240 | * the value of the register before the update will be |
241 | * returned | 241 | * returned |
242 | */ | 242 | */ |
243 | static inline cvmx_fau_tagwait32_t | 243 | static inline cvmx_fau_tagwait32_t |
244 | cvmx_fau_tagwait_fetch_and_add32(cvmx_fau_reg_32_t reg, int32_t value) | 244 | cvmx_fau_tagwait_fetch_and_add32(cvmx_fau_reg_32_t reg, int32_t value) |
@@ -257,11 +257,11 @@ cvmx_fau_tagwait_fetch_and_add32(cvmx_fau_reg_32_t reg, int32_t value) | |||
257 | * completes | 257 | * completes |
258 | * | 258 | * |
259 | * @reg: FAU atomic register to access. 0 <= reg < 2048. | 259 | * @reg: FAU atomic register to access. 0 <= reg < 2048. |
260 | * - Step by 2 for 16 bit access. | 260 | * - Step by 2 for 16 bit access. |
261 | * @value: Signed value to add. | 261 | * @value: Signed value to add. |
262 | * Returns If a timeout occurs, the error bit will be set. Otherwise | 262 | * Returns If a timeout occurs, the error bit will be set. Otherwise |
263 | * the value of the register before the update will be | 263 | * the value of the register before the update will be |
264 | * returned | 264 | * returned |
265 | */ | 265 | */ |
266 | static inline cvmx_fau_tagwait16_t | 266 | static inline cvmx_fau_tagwait16_t |
267 | cvmx_fau_tagwait_fetch_and_add16(cvmx_fau_reg_16_t reg, int16_t value) | 267 | cvmx_fau_tagwait_fetch_and_add16(cvmx_fau_reg_16_t reg, int16_t value) |
@@ -282,8 +282,8 @@ cvmx_fau_tagwait_fetch_and_add16(cvmx_fau_reg_16_t reg, int16_t value) | |||
282 | * @reg: FAU atomic register to access. 0 <= reg < 2048. | 282 | * @reg: FAU atomic register to access. 0 <= reg < 2048. |
283 | * @value: Signed value to add. | 283 | * @value: Signed value to add. |
284 | * Returns If a timeout occurs, the error bit will be set. Otherwise | 284 | * Returns If a timeout occurs, the error bit will be set. Otherwise |
285 | * the value of the register before the update will be | 285 | * the value of the register before the update will be |
286 | * returned | 286 | * returned |
287 | */ | 287 | */ |
288 | static inline cvmx_fau_tagwait8_t | 288 | static inline cvmx_fau_tagwait8_t |
289 | cvmx_fau_tagwait_fetch_and_add8(cvmx_fau_reg_8_t reg, int8_t value) | 289 | cvmx_fau_tagwait_fetch_and_add8(cvmx_fau_reg_8_t reg, int8_t value) |
@@ -301,21 +301,21 @@ cvmx_fau_tagwait_fetch_and_add8(cvmx_fau_reg_8_t reg, int8_t value) | |||
301 | * | 301 | * |
302 | * @scraddr: Scratch pad byte address to write to. Must be 8 byte aligned | 302 | * @scraddr: Scratch pad byte address to write to. Must be 8 byte aligned |
303 | * @value: Signed value to add. | 303 | * @value: Signed value to add. |
304 | * Note: When performing 32 and 64 bit access, only the low | 304 | * Note: When performing 32 and 64 bit access, only the low |
305 | * 22 bits are available. | 305 | * 22 bits are available. |
306 | * @tagwait: Should the atomic add wait for the current tag switch | 306 | * @tagwait: Should the atomic add wait for the current tag switch |
307 | * operation to complete. | 307 | * operation to complete. |
308 | * - 0 = Don't wait | 308 | * - 0 = Don't wait |
309 | * - 1 = Wait for tag switch to complete | 309 | * - 1 = Wait for tag switch to complete |
310 | * @size: The size of the operation: | 310 | * @size: The size of the operation: |
311 | * - CVMX_FAU_OP_SIZE_8 (0) = 8 bits | 311 | * - CVMX_FAU_OP_SIZE_8 (0) = 8 bits |
312 | * - CVMX_FAU_OP_SIZE_16 (1) = 16 bits | 312 | * - CVMX_FAU_OP_SIZE_16 (1) = 16 bits |
313 | * - CVMX_FAU_OP_SIZE_32 (2) = 32 bits | 313 | * - CVMX_FAU_OP_SIZE_32 (2) = 32 bits |
314 | * - CVMX_FAU_OP_SIZE_64 (3) = 64 bits | 314 | * - CVMX_FAU_OP_SIZE_64 (3) = 64 bits |
315 | * @reg: FAU atomic register to access. 0 <= reg < 2048. | 315 | * @reg: FAU atomic register to access. 0 <= reg < 2048. |
316 | * - Step by 2 for 16 bit access. | 316 | * - Step by 2 for 16 bit access. |
317 | * - Step by 4 for 32 bit access. | 317 | * - Step by 4 for 32 bit access. |
318 | * - Step by 8 for 64 bit access. | 318 | * - Step by 8 for 64 bit access. |
319 | * Returns Data to write using cvmx_send_single | 319 | * Returns Data to write using cvmx_send_single |
320 | */ | 320 | */ |
321 | static inline uint64_t __cvmx_fau_iobdma_data(uint64_t scraddr, int64_t value, | 321 | static inline uint64_t __cvmx_fau_iobdma_data(uint64_t scraddr, int64_t value, |
@@ -337,11 +337,11 @@ static inline uint64_t __cvmx_fau_iobdma_data(uint64_t scraddr, int64_t value, | |||
337 | * placed in the scratch memory at byte address scraddr. | 337 | * placed in the scratch memory at byte address scraddr. |
338 | * | 338 | * |
339 | * @scraddr: Scratch memory byte address to put response in. | 339 | * @scraddr: Scratch memory byte address to put response in. |
340 | * Must be 8 byte aligned. | 340 | * Must be 8 byte aligned. |
341 | * @reg: FAU atomic register to access. 0 <= reg < 2048. | 341 | * @reg: FAU atomic register to access. 0 <= reg < 2048. |
342 | * - Step by 8 for 64 bit access. | 342 | * - Step by 8 for 64 bit access. |
343 | * @value: Signed value to add. | 343 | * @value: Signed value to add. |
344 | * Note: Only the low 22 bits are available. | 344 | * Note: Only the low 22 bits are available. |
345 | * Returns Placed in the scratch pad register | 345 | * Returns Placed in the scratch pad register |
346 | */ | 346 | */ |
347 | static inline void cvmx_fau_async_fetch_and_add64(uint64_t scraddr, | 347 | static inline void cvmx_fau_async_fetch_and_add64(uint64_t scraddr, |
@@ -357,11 +357,11 @@ static inline void cvmx_fau_async_fetch_and_add64(uint64_t scraddr, | |||
357 | * placed in the scratch memory at byte address scraddr. | 357 | * placed in the scratch memory at byte address scraddr. |
358 | * | 358 | * |
359 | * @scraddr: Scratch memory byte address to put response in. | 359 | * @scraddr: Scratch memory byte address to put response in. |
360 | * Must be 8 byte aligned. | 360 | * Must be 8 byte aligned. |
361 | * @reg: FAU atomic register to access. 0 <= reg < 2048. | 361 | * @reg: FAU atomic register to access. 0 <= reg < 2048. |
362 | * - Step by 4 for 32 bit access. | 362 | * - Step by 4 for 32 bit access. |
363 | * @value: Signed value to add. | 363 | * @value: Signed value to add. |
364 | * Note: Only the low 22 bits are available. | 364 | * Note: Only the low 22 bits are available. |
365 | * Returns Placed in the scratch pad register | 365 | * Returns Placed in the scratch pad register |
366 | */ | 366 | */ |
367 | static inline void cvmx_fau_async_fetch_and_add32(uint64_t scraddr, | 367 | static inline void cvmx_fau_async_fetch_and_add32(uint64_t scraddr, |
@@ -377,9 +377,9 @@ static inline void cvmx_fau_async_fetch_and_add32(uint64_t scraddr, | |||
377 | * placed in the scratch memory at byte address scraddr. | 377 | * placed in the scratch memory at byte address scraddr. |
378 | * | 378 | * |
379 | * @scraddr: Scratch memory byte address to put response in. | 379 | * @scraddr: Scratch memory byte address to put response in. |
380 | * Must be 8 byte aligned. | 380 | * Must be 8 byte aligned. |
381 | * @reg: FAU atomic register to access. 0 <= reg < 2048. | 381 | * @reg: FAU atomic register to access. 0 <= reg < 2048. |
382 | * - Step by 2 for 16 bit access. | 382 | * - Step by 2 for 16 bit access. |
383 | * @value: Signed value to add. | 383 | * @value: Signed value to add. |
384 | * Returns Placed in the scratch pad register | 384 | * Returns Placed in the scratch pad register |
385 | */ | 385 | */ |
@@ -396,7 +396,7 @@ static inline void cvmx_fau_async_fetch_and_add16(uint64_t scraddr, | |||
396 | * placed in the scratch memory at byte address scraddr. | 396 | * placed in the scratch memory at byte address scraddr. |
397 | * | 397 | * |
398 | * @scraddr: Scratch memory byte address to put response in. | 398 | * @scraddr: Scratch memory byte address to put response in. |
399 | * Must be 8 byte aligned. | 399 | * Must be 8 byte aligned. |
400 | * @reg: FAU atomic register to access. 0 <= reg < 2048. | 400 | * @reg: FAU atomic register to access. 0 <= reg < 2048. |
401 | * @value: Signed value to add. | 401 | * @value: Signed value to add. |
402 | * Returns Placed in the scratch pad register | 402 | * Returns Placed in the scratch pad register |
@@ -414,14 +414,14 @@ static inline void cvmx_fau_async_fetch_and_add8(uint64_t scraddr, | |||
414 | * switch completes. | 414 | * switch completes. |
415 | * | 415 | * |
416 | * @scraddr: Scratch memory byte address to put response in. Must be | 416 | * @scraddr: Scratch memory byte address to put response in. Must be |
417 | * 8 byte aligned. If a timeout occurs, the error bit (63) | 417 | * 8 byte aligned. If a timeout occurs, the error bit (63) |
418 | * will be set. Otherwise the value of the register before | 418 | * will be set. Otherwise the value of the register before |
419 | * the update will be returned | 419 | * the update will be returned |
420 | * | 420 | * |
421 | * @reg: FAU atomic register to access. 0 <= reg < 2048. | 421 | * @reg: FAU atomic register to access. 0 <= reg < 2048. |
422 | * - Step by 8 for 64 bit access. | 422 | * - Step by 8 for 64 bit access. |
423 | * @value: Signed value to add. | 423 | * @value: Signed value to add. |
424 | * Note: Only the low 22 bits are available. | 424 | * Note: Only the low 22 bits are available. |
425 | * Returns Placed in the scratch pad register | 425 | * Returns Placed in the scratch pad register |
426 | */ | 426 | */ |
427 | static inline void cvmx_fau_async_tagwait_fetch_and_add64(uint64_t scraddr, | 427 | static inline void cvmx_fau_async_tagwait_fetch_and_add64(uint64_t scraddr, |
@@ -437,14 +437,14 @@ static inline void cvmx_fau_async_tagwait_fetch_and_add64(uint64_t scraddr, | |||
437 | * switch completes. | 437 | * switch completes. |
438 | * | 438 | * |
439 | * @scraddr: Scratch memory byte address to put response in. Must be | 439 | * @scraddr: Scratch memory byte address to put response in. Must be |
440 | * 8 byte aligned. If a timeout occurs, the error bit (63) | 440 | * 8 byte aligned. If a timeout occurs, the error bit (63) |
441 | * will be set. Otherwise the value of the register before | 441 | * will be set. Otherwise the value of the register before |
442 | * the update will be returned | 442 | * the update will be returned |
443 | * | 443 | * |
444 | * @reg: FAU atomic register to access. 0 <= reg < 2048. | 444 | * @reg: FAU atomic register to access. 0 <= reg < 2048. |
445 | * - Step by 4 for 32 bit access. | 445 | * - Step by 4 for 32 bit access. |
446 | * @value: Signed value to add. | 446 | * @value: Signed value to add. |
447 | * Note: Only the low 22 bits are available. | 447 | * Note: Only the low 22 bits are available. |
448 | * Returns Placed in the scratch pad register | 448 | * Returns Placed in the scratch pad register |
449 | */ | 449 | */ |
450 | static inline void cvmx_fau_async_tagwait_fetch_and_add32(uint64_t scraddr, | 450 | static inline void cvmx_fau_async_tagwait_fetch_and_add32(uint64_t scraddr, |
@@ -460,12 +460,12 @@ static inline void cvmx_fau_async_tagwait_fetch_and_add32(uint64_t scraddr, | |||
460 | * switch completes. | 460 | * switch completes. |
461 | * | 461 | * |
462 | * @scraddr: Scratch memory byte address to put response in. Must be | 462 | * @scraddr: Scratch memory byte address to put response in. Must be |
463 | * 8 byte aligned. If a timeout occurs, the error bit (63) | 463 | * 8 byte aligned. If a timeout occurs, the error bit (63) |
464 | * will be set. Otherwise the value of the register before | 464 | * will be set. Otherwise the value of the register before |
465 | * the update will be returned | 465 | * the update will be returned |
466 | * | 466 | * |
467 | * @reg: FAU atomic register to access. 0 <= reg < 2048. | 467 | * @reg: FAU atomic register to access. 0 <= reg < 2048. |
468 | * - Step by 2 for 16 bit access. | 468 | * - Step by 2 for 16 bit access. |
469 | * @value: Signed value to add. | 469 | * @value: Signed value to add. |
470 | * | 470 | * |
471 | * Returns Placed in the scratch pad register | 471 | * Returns Placed in the scratch pad register |
@@ -483,9 +483,9 @@ static inline void cvmx_fau_async_tagwait_fetch_and_add16(uint64_t scraddr, | |||
483 | * switch completes. | 483 | * switch completes. |
484 | * | 484 | * |
485 | * @scraddr: Scratch memory byte address to put response in. Must be | 485 | * @scraddr: Scratch memory byte address to put response in. Must be |
486 | * 8 byte aligned. If a timeout occurs, the error bit (63) | 486 | * 8 byte aligned. If a timeout occurs, the error bit (63) |
487 | * will be set. Otherwise the value of the register before | 487 | * will be set. Otherwise the value of the register before |
488 | * the update will be returned | 488 | * the update will be returned |
489 | * | 489 | * |
490 | * @reg: FAU atomic register to access. 0 <= reg < 2048. | 490 | * @reg: FAU atomic register to access. 0 <= reg < 2048. |
491 | * @value: Signed value to add. | 491 | * @value: Signed value to add. |
@@ -504,7 +504,7 @@ static inline void cvmx_fau_async_tagwait_fetch_and_add8(uint64_t scraddr, | |||
504 | * Perform an atomic 64 bit add | 504 | * Perform an atomic 64 bit add |
505 | * | 505 | * |
506 | * @reg: FAU atomic register to access. 0 <= reg < 2048. | 506 | * @reg: FAU atomic register to access. 0 <= reg < 2048. |
507 | * - Step by 8 for 64 bit access. | 507 | * - Step by 8 for 64 bit access. |
508 | * @value: Signed value to add. | 508 | * @value: Signed value to add. |
509 | */ | 509 | */ |
510 | static inline void cvmx_fau_atomic_add64(cvmx_fau_reg_64_t reg, int64_t value) | 510 | static inline void cvmx_fau_atomic_add64(cvmx_fau_reg_64_t reg, int64_t value) |
@@ -516,7 +516,7 @@ static inline void cvmx_fau_atomic_add64(cvmx_fau_reg_64_t reg, int64_t value) | |||
516 | * Perform an atomic 32 bit add | 516 | * Perform an atomic 32 bit add |
517 | * | 517 | * |
518 | * @reg: FAU atomic register to access. 0 <= reg < 2048. | 518 | * @reg: FAU atomic register to access. 0 <= reg < 2048. |
519 | * - Step by 4 for 32 bit access. | 519 | * - Step by 4 for 32 bit access. |
520 | * @value: Signed value to add. | 520 | * @value: Signed value to add. |
521 | */ | 521 | */ |
522 | static inline void cvmx_fau_atomic_add32(cvmx_fau_reg_32_t reg, int32_t value) | 522 | static inline void cvmx_fau_atomic_add32(cvmx_fau_reg_32_t reg, int32_t value) |
@@ -528,7 +528,7 @@ static inline void cvmx_fau_atomic_add32(cvmx_fau_reg_32_t reg, int32_t value) | |||
528 | * Perform an atomic 16 bit add | 528 | * Perform an atomic 16 bit add |
529 | * | 529 | * |
530 | * @reg: FAU atomic register to access. 0 <= reg < 2048. | 530 | * @reg: FAU atomic register to access. 0 <= reg < 2048. |
531 | * - Step by 2 for 16 bit access. | 531 | * - Step by 2 for 16 bit access. |
532 | * @value: Signed value to add. | 532 | * @value: Signed value to add. |
533 | */ | 533 | */ |
534 | static inline void cvmx_fau_atomic_add16(cvmx_fau_reg_16_t reg, int16_t value) | 534 | static inline void cvmx_fau_atomic_add16(cvmx_fau_reg_16_t reg, int16_t value) |
@@ -551,7 +551,7 @@ static inline void cvmx_fau_atomic_add8(cvmx_fau_reg_8_t reg, int8_t value) | |||
551 | * Perform an atomic 64 bit write | 551 | * Perform an atomic 64 bit write |
552 | * | 552 | * |
553 | * @reg: FAU atomic register to access. 0 <= reg < 2048. | 553 | * @reg: FAU atomic register to access. 0 <= reg < 2048. |
554 | * - Step by 8 for 64 bit access. | 554 | * - Step by 8 for 64 bit access. |
555 | * @value: Signed value to write. | 555 | * @value: Signed value to write. |
556 | */ | 556 | */ |
557 | static inline void cvmx_fau_atomic_write64(cvmx_fau_reg_64_t reg, int64_t value) | 557 | static inline void cvmx_fau_atomic_write64(cvmx_fau_reg_64_t reg, int64_t value) |
@@ -563,7 +563,7 @@ static inline void cvmx_fau_atomic_write64(cvmx_fau_reg_64_t reg, int64_t value) | |||
563 | * Perform an atomic 32 bit write | 563 | * Perform an atomic 32 bit write |
564 | * | 564 | * |
565 | * @reg: FAU atomic register to access. 0 <= reg < 2048. | 565 | * @reg: FAU atomic register to access. 0 <= reg < 2048. |
566 | * - Step by 4 for 32 bit access. | 566 | * - Step by 4 for 32 bit access. |
567 | * @value: Signed value to write. | 567 | * @value: Signed value to write. |
568 | */ | 568 | */ |
569 | static inline void cvmx_fau_atomic_write32(cvmx_fau_reg_32_t reg, int32_t value) | 569 | static inline void cvmx_fau_atomic_write32(cvmx_fau_reg_32_t reg, int32_t value) |
@@ -575,7 +575,7 @@ static inline void cvmx_fau_atomic_write32(cvmx_fau_reg_32_t reg, int32_t value) | |||
575 | * Perform an atomic 16 bit write | 575 | * Perform an atomic 16 bit write |
576 | * | 576 | * |
577 | * @reg: FAU atomic register to access. 0 <= reg < 2048. | 577 | * @reg: FAU atomic register to access. 0 <= reg < 2048. |
578 | * - Step by 2 for 16 bit access. | 578 | * - Step by 2 for 16 bit access. |
579 | * @value: Signed value to write. | 579 | * @value: Signed value to write. |
580 | */ | 580 | */ |
581 | static inline void cvmx_fau_atomic_write16(cvmx_fau_reg_16_t reg, int16_t value) | 581 | static inline void cvmx_fau_atomic_write16(cvmx_fau_reg_16_t reg, int16_t value) |
diff --git a/arch/mips/include/asm/octeon/cvmx-fpa.h b/arch/mips/include/asm/octeon/cvmx-fpa.h index 541a1ae02b6f..aa26a2ce5a0e 100644 --- a/arch/mips/include/asm/octeon/cvmx-fpa.h +++ b/arch/mips/include/asm/octeon/cvmx-fpa.h | |||
@@ -39,9 +39,9 @@ | |||
39 | #include <asm/octeon/cvmx-address.h> | 39 | #include <asm/octeon/cvmx-address.h> |
40 | #include <asm/octeon/cvmx-fpa-defs.h> | 40 | #include <asm/octeon/cvmx-fpa-defs.h> |
41 | 41 | ||
42 | #define CVMX_FPA_NUM_POOLS 8 | 42 | #define CVMX_FPA_NUM_POOLS 8 |
43 | #define CVMX_FPA_MIN_BLOCK_SIZE 128 | 43 | #define CVMX_FPA_MIN_BLOCK_SIZE 128 |
44 | #define CVMX_FPA_ALIGNMENT 128 | 44 | #define CVMX_FPA_ALIGNMENT 128 |
45 | 45 | ||
46 | /** | 46 | /** |
47 | * Structure describing the data format used for stores to the FPA. | 47 | * Structure describing the data format used for stores to the FPA. |
@@ -186,8 +186,8 @@ static inline void *cvmx_fpa_alloc(uint64_t pool) | |||
186 | /** | 186 | /** |
187 | * Asynchronously get a new block from the FPA | 187 | * Asynchronously get a new block from the FPA |
188 | * | 188 | * |
189 | * @scr_addr: Local scratch address to put response in. This is a byte address, | 189 | * @scr_addr: Local scratch address to put response in. This is a byte address, |
190 | * but must be 8 byte aligned. | 190 | * but must be 8 byte aligned. |
191 | * @pool: Pool to get the block from | 191 | * @pool: Pool to get the block from |
192 | */ | 192 | */ |
193 | static inline void cvmx_fpa_async_alloc(uint64_t scr_addr, uint64_t pool) | 193 | static inline void cvmx_fpa_async_alloc(uint64_t scr_addr, uint64_t pool) |
@@ -212,7 +212,7 @@ static inline void cvmx_fpa_async_alloc(uint64_t scr_addr, uint64_t pool) | |||
212 | * @ptr: Block to free | 212 | * @ptr: Block to free |
213 | * @pool: Pool to put it in | 213 | * @pool: Pool to put it in |
214 | * @num_cache_lines: | 214 | * @num_cache_lines: |
215 | * Cache lines to invalidate | 215 | * Cache lines to invalidate |
216 | */ | 216 | */ |
217 | static inline void cvmx_fpa_free_nosync(void *ptr, uint64_t pool, | 217 | static inline void cvmx_fpa_free_nosync(void *ptr, uint64_t pool, |
218 | uint64_t num_cache_lines) | 218 | uint64_t num_cache_lines) |
@@ -234,7 +234,7 @@ static inline void cvmx_fpa_free_nosync(void *ptr, uint64_t pool, | |||
234 | * @ptr: Block to free | 234 | * @ptr: Block to free |
235 | * @pool: Pool to put it in | 235 | * @pool: Pool to put it in |
236 | * @num_cache_lines: | 236 | * @num_cache_lines: |
237 | * Cache lines to invalidate | 237 | * Cache lines to invalidate |
238 | */ | 238 | */ |
239 | static inline void cvmx_fpa_free(void *ptr, uint64_t pool, | 239 | static inline void cvmx_fpa_free(void *ptr, uint64_t pool, |
240 | uint64_t num_cache_lines) | 240 | uint64_t num_cache_lines) |
@@ -245,7 +245,7 @@ static inline void cvmx_fpa_free(void *ptr, uint64_t pool, | |||
245 | CVMX_ADDR_DIDSPACE(CVMX_FULL_DID(CVMX_OCT_DID_FPA, pool)); | 245 | CVMX_ADDR_DIDSPACE(CVMX_FULL_DID(CVMX_OCT_DID_FPA, pool)); |
246 | /* | 246 | /* |
247 | * Make sure that any previous writes to memory go out before | 247 | * Make sure that any previous writes to memory go out before |
248 | * we free this buffer. This also serves as a barrier to | 248 | * we free this buffer. This also serves as a barrier to |
249 | * prevent GCC from reordering operations to after the | 249 | * prevent GCC from reordering operations to after the |
250 | * free. | 250 | * free. |
251 | */ | 251 | */ |
@@ -259,17 +259,17 @@ static inline void cvmx_fpa_free(void *ptr, uint64_t pool, | |||
259 | * This can only be called once per pool. Make sure proper | 259 | * This can only be called once per pool. Make sure proper |
260 | * locking enforces this. | 260 | * locking enforces this. |
261 | * | 261 | * |
262 | * @pool: Pool to initialize | 262 | * @pool: Pool to initialize |
263 | * 0 <= pool < 8 | 263 | * 0 <= pool < 8 |
264 | * @name: Constant character string to name this pool. | 264 | * @name: Constant character string to name this pool. |
265 | * String is not copied. | 265 | * String is not copied. |
266 | * @buffer: Pointer to the block of memory to use. This must be | 266 | * @buffer: Pointer to the block of memory to use. This must be |
267 | * accessible by all processors and external hardware. | 267 | * accessible by all processors and external hardware. |
268 | * @block_size: Size for each block controlled by the FPA | 268 | * @block_size: Size for each block controlled by the FPA |
269 | * @num_blocks: Number of blocks | 269 | * @num_blocks: Number of blocks |
270 | * | 270 | * |
271 | * Returns 0 on Success, | 271 | * Returns 0 on Success, |
272 | * -1 on failure | 272 | * -1 on failure |
273 | */ | 273 | */ |
274 | extern int cvmx_fpa_setup_pool(uint64_t pool, const char *name, void *buffer, | 274 | extern int cvmx_fpa_setup_pool(uint64_t pool, const char *name, void *buffer, |
275 | uint64_t block_size, uint64_t num_blocks); | 275 | uint64_t block_size, uint64_t num_blocks); |
@@ -282,8 +282,8 @@ extern int cvmx_fpa_setup_pool(uint64_t pool, const char *name, void *buffer, | |||
282 | * | 282 | * |
283 | * @pool: Pool to shutdown | 283 | * @pool: Pool to shutdown |
284 | * Returns Zero on success | 284 | * Returns Zero on success |
285 | * - Positive is count of missing buffers | 285 | * - Positive is count of missing buffers |
286 | * - Negative is too many buffers or corrupted pointers | 286 | * - Negative is too many buffers or corrupted pointers |
287 | */ | 287 | */ |
288 | extern uint64_t cvmx_fpa_shutdown_pool(uint64_t pool); | 288 | extern uint64_t cvmx_fpa_shutdown_pool(uint64_t pool); |
289 | 289 | ||
diff --git a/arch/mips/include/asm/octeon/cvmx-helper-board.h b/arch/mips/include/asm/octeon/cvmx-helper-board.h index 442f508eaac9..41785dd0ddd0 100644 --- a/arch/mips/include/asm/octeon/cvmx-helper-board.h +++ b/arch/mips/include/asm/octeon/cvmx-helper-board.h | |||
@@ -48,7 +48,7 @@ typedef enum { | |||
48 | * Fake IPD port, the RGMII/MII interface may use different PHY, use | 48 | * Fake IPD port, the RGMII/MII interface may use different PHY, use |
49 | * this macro to return appropriate MIX address to read the PHY. | 49 | * this macro to return appropriate MIX address to read the PHY. |
50 | */ | 50 | */ |
51 | #define CVMX_HELPER_BOARD_MGMT_IPD_PORT -10 | 51 | #define CVMX_HELPER_BOARD_MGMT_IPD_PORT -10 |
52 | 52 | ||
53 | /** | 53 | /** |
54 | * cvmx_override_board_link_get(int ipd_port) is a function | 54 | * cvmx_override_board_link_get(int ipd_port) is a function |
@@ -86,10 +86,10 @@ extern int cvmx_helper_board_get_mii_address(int ipd_port); | |||
86 | * | 86 | * |
87 | * @phy_addr: The address of the PHY to program | 87 | * @phy_addr: The address of the PHY to program |
88 | * @link_flags: | 88 | * @link_flags: |
89 | * Flags to control autonegotiation. Bit 0 is autonegotiation | 89 | * Flags to control autonegotiation. Bit 0 is autonegotiation |
90 | * enable/disable to maintain backware compatibility. | 90 | * enable/disable to maintain backware compatibility. |
91 | * @link_info: Link speed to program. If the speed is zero and autonegotiation | 91 | * @link_info: Link speed to program. If the speed is zero and autonegotiation |
92 | * is enabled, all possible negotiation speeds are advertised. | 92 | * is enabled, all possible negotiation speeds are advertised. |
93 | * | 93 | * |
94 | * Returns Zero on success, negative on failure | 94 | * Returns Zero on success, negative on failure |
95 | */ | 95 | */ |
@@ -111,10 +111,10 @@ int cvmx_helper_board_link_set_phy(int phy_addr, | |||
111 | * enumeration from the bootloader. | 111 | * enumeration from the bootloader. |
112 | * | 112 | * |
113 | * @ipd_port: IPD input port associated with the port we want to get link | 113 | * @ipd_port: IPD input port associated with the port we want to get link |
114 | * status for. | 114 | * status for. |
115 | * | 115 | * |
116 | * Returns The ports link status. If the link isn't fully resolved, this must | 116 | * Returns The ports link status. If the link isn't fully resolved, this must |
117 | * return zero. | 117 | * return zero. |
118 | */ | 118 | */ |
119 | extern cvmx_helper_link_info_t __cvmx_helper_board_link_get(int ipd_port); | 119 | extern cvmx_helper_link_info_t __cvmx_helper_board_link_get(int ipd_port); |
120 | 120 | ||
@@ -134,10 +134,10 @@ extern cvmx_helper_link_info_t __cvmx_helper_board_link_get(int ipd_port); | |||
134 | * | 134 | * |
135 | * @interface: Interface to probe | 135 | * @interface: Interface to probe |
136 | * @supported_ports: | 136 | * @supported_ports: |
137 | * Number of ports Octeon supports. | 137 | * Number of ports Octeon supports. |
138 | * | 138 | * |
139 | * Returns Number of ports the actual board supports. Many times this will | 139 | * Returns Number of ports the actual board supports. Many times this will |
140 | * simple be "support_ports". | 140 | * simple be "support_ports". |
141 | */ | 141 | */ |
142 | extern int __cvmx_helper_board_interface_probe(int interface, | 142 | extern int __cvmx_helper_board_interface_probe(int interface, |
143 | int supported_ports); | 143 | int supported_ports); |
diff --git a/arch/mips/include/asm/octeon/cvmx-helper-rgmii.h b/arch/mips/include/asm/octeon/cvmx-helper-rgmii.h index 78295ba0050f..4d7a3db3a9f6 100644 --- a/arch/mips/include/asm/octeon/cvmx-helper-rgmii.h +++ b/arch/mips/include/asm/octeon/cvmx-helper-rgmii.h | |||
@@ -98,9 +98,9 @@ extern int __cvmx_helper_rgmii_link_set(int ipd_port, | |||
98 | * | 98 | * |
99 | * @ipd_port: IPD/PKO port to loopback. | 99 | * @ipd_port: IPD/PKO port to loopback. |
100 | * @enable_internal: | 100 | * @enable_internal: |
101 | * Non zero if you want internal loopback | 101 | * Non zero if you want internal loopback |
102 | * @enable_external: | 102 | * @enable_external: |
103 | * Non zero if you want external loopback | 103 | * Non zero if you want external loopback |
104 | * | 104 | * |
105 | * Returns Zero on success, negative on failure. | 105 | * Returns Zero on success, negative on failure. |
106 | */ | 106 | */ |
diff --git a/arch/mips/include/asm/octeon/cvmx-helper-sgmii.h b/arch/mips/include/asm/octeon/cvmx-helper-sgmii.h index 9a9b6c103ede..4debb1c5153d 100644 --- a/arch/mips/include/asm/octeon/cvmx-helper-sgmii.h +++ b/arch/mips/include/asm/octeon/cvmx-helper-sgmii.h | |||
@@ -92,9 +92,9 @@ extern int __cvmx_helper_sgmii_link_set(int ipd_port, | |||
92 | * | 92 | * |
93 | * @ipd_port: IPD/PKO port to loopback. | 93 | * @ipd_port: IPD/PKO port to loopback. |
94 | * @enable_internal: | 94 | * @enable_internal: |
95 | * Non zero if you want internal loopback | 95 | * Non zero if you want internal loopback |
96 | * @enable_external: | 96 | * @enable_external: |
97 | * Non zero if you want external loopback | 97 | * Non zero if you want external loopback |
98 | * | 98 | * |
99 | * Returns Zero on success, negative on failure. | 99 | * Returns Zero on success, negative on failure. |
100 | */ | 100 | */ |
diff --git a/arch/mips/include/asm/octeon/cvmx-helper-util.h b/arch/mips/include/asm/octeon/cvmx-helper-util.h index 01c8ddd84ff8..f446f212bbd4 100644 --- a/arch/mips/include/asm/octeon/cvmx-helper-util.h +++ b/arch/mips/include/asm/octeon/cvmx-helper-util.h | |||
@@ -57,11 +57,11 @@ extern int cvmx_helper_dump_packet(cvmx_wqe_t *work); | |||
57 | * | 57 | * |
58 | * @queue: Input queue to setup RED on (0-7) | 58 | * @queue: Input queue to setup RED on (0-7) |
59 | * @pass_thresh: | 59 | * @pass_thresh: |
60 | * Packets will begin slowly dropping when there are less than | 60 | * Packets will begin slowly dropping when there are less than |
61 | * this many packet buffers free in FPA 0. | 61 | * this many packet buffers free in FPA 0. |
62 | * @drop_thresh: | 62 | * @drop_thresh: |
63 | * All incoming packets will be dropped when there are less | 63 | * All incoming packets will be dropped when there are less |
64 | * than this many free packet buffers in FPA 0. | 64 | * than this many free packet buffers in FPA 0. |
65 | * Returns Zero on success. Negative on failure | 65 | * Returns Zero on success. Negative on failure |
66 | */ | 66 | */ |
67 | extern int cvmx_helper_setup_red_queue(int queue, int pass_thresh, | 67 | extern int cvmx_helper_setup_red_queue(int queue, int pass_thresh, |
@@ -71,11 +71,11 @@ extern int cvmx_helper_setup_red_queue(int queue, int pass_thresh, | |||
71 | * Setup Random Early Drop to automatically begin dropping packets. | 71 | * Setup Random Early Drop to automatically begin dropping packets. |
72 | * | 72 | * |
73 | * @pass_thresh: | 73 | * @pass_thresh: |
74 | * Packets will begin slowly dropping when there are less than | 74 | * Packets will begin slowly dropping when there are less than |
75 | * this many packet buffers free in FPA 0. | 75 | * this many packet buffers free in FPA 0. |
76 | * @drop_thresh: | 76 | * @drop_thresh: |
77 | * All incoming packets will be dropped when there are less | 77 | * All incoming packets will be dropped when there are less |
78 | * than this many free packet buffers in FPA 0. | 78 | * than this many free packet buffers in FPA 0. |
79 | * Returns Zero on success. Negative on failure | 79 | * Returns Zero on success. Negative on failure |
80 | */ | 80 | */ |
81 | extern int cvmx_helper_setup_red(int pass_thresh, int drop_thresh); | 81 | extern int cvmx_helper_setup_red(int pass_thresh, int drop_thresh); |
@@ -84,7 +84,7 @@ extern int cvmx_helper_setup_red(int pass_thresh, int drop_thresh); | |||
84 | * Get the version of the CVMX libraries. | 84 | * Get the version of the CVMX libraries. |
85 | * | 85 | * |
86 | * Returns Version string. Note this buffer is allocated statically | 86 | * Returns Version string. Note this buffer is allocated statically |
87 | * and will be shared by all callers. | 87 | * and will be shared by all callers. |
88 | */ | 88 | */ |
89 | extern const char *cvmx_helper_get_version(void); | 89 | extern const char *cvmx_helper_get_version(void); |
90 | 90 | ||
diff --git a/arch/mips/include/asm/octeon/cvmx-helper-xaui.h b/arch/mips/include/asm/octeon/cvmx-helper-xaui.h index f6fbc4f45b56..5e89ed703eaa 100644 --- a/arch/mips/include/asm/octeon/cvmx-helper-xaui.h +++ b/arch/mips/include/asm/octeon/cvmx-helper-xaui.h | |||
@@ -92,9 +92,9 @@ extern int __cvmx_helper_xaui_link_set(int ipd_port, | |||
92 | * | 92 | * |
93 | * @ipd_port: IPD/PKO port to loopback. | 93 | * @ipd_port: IPD/PKO port to loopback. |
94 | * @enable_internal: | 94 | * @enable_internal: |
95 | * Non zero if you want internal loopback | 95 | * Non zero if you want internal loopback |
96 | * @enable_external: | 96 | * @enable_external: |
97 | * Non zero if you want external loopback | 97 | * Non zero if you want external loopback |
98 | * | 98 | * |
99 | * Returns Zero on success, negative on failure. | 99 | * Returns Zero on success, negative on failure. |
100 | */ | 100 | */ |
diff --git a/arch/mips/include/asm/octeon/cvmx-helper.h b/arch/mips/include/asm/octeon/cvmx-helper.h index 691c8142cd4f..5a3090dc6f2f 100644 --- a/arch/mips/include/asm/octeon/cvmx-helper.h +++ b/arch/mips/include/asm/octeon/cvmx-helper.h | |||
@@ -93,12 +93,12 @@ extern void (*cvmx_override_ipd_port_setup) (int ipd_port); | |||
93 | /** | 93 | /** |
94 | * This function enables the IPD and also enables the packet interfaces. | 94 | * This function enables the IPD and also enables the packet interfaces. |
95 | * The packet interfaces (RGMII and SPI) must be enabled after the | 95 | * The packet interfaces (RGMII and SPI) must be enabled after the |
96 | * IPD. This should be called by the user program after any additional | 96 | * IPD. This should be called by the user program after any additional |
97 | * IPD configuration changes are made if CVMX_HELPER_ENABLE_IPD | 97 | * IPD configuration changes are made if CVMX_HELPER_ENABLE_IPD |
98 | * is not set in the executive-config.h file. | 98 | * is not set in the executive-config.h file. |
99 | * | 99 | * |
100 | * Returns 0 on success | 100 | * Returns 0 on success |
101 | * -1 on failure | 101 | * -1 on failure |
102 | */ | 102 | */ |
103 | extern int cvmx_helper_ipd_and_packet_input_enable(void); | 103 | extern int cvmx_helper_ipd_and_packet_input_enable(void); |
104 | 104 | ||
@@ -128,7 +128,7 @@ extern int cvmx_helper_initialize_packet_io_local(void); | |||
128 | * @interface: Which interface to return port count for. | 128 | * @interface: Which interface to return port count for. |
129 | * | 129 | * |
130 | * Returns Port count for interface | 130 | * Returns Port count for interface |
131 | * -1 for uninitialized interface | 131 | * -1 for uninitialized interface |
132 | */ | 132 | */ |
133 | extern int cvmx_helper_ports_on_interface(int interface); | 133 | extern int cvmx_helper_ports_on_interface(int interface); |
134 | 134 | ||
@@ -150,7 +150,7 @@ extern int cvmx_helper_get_number_of_interfaces(void); | |||
150 | * @interface: Interface to probe | 150 | * @interface: Interface to probe |
151 | * | 151 | * |
152 | * Returns Mode of the interface. Unknown or unsupported interfaces return | 152 | * Returns Mode of the interface. Unknown or unsupported interfaces return |
153 | * DISABLED. | 153 | * DISABLED. |
154 | */ | 154 | */ |
155 | extern cvmx_helper_interface_mode_t cvmx_helper_interface_get_mode(int | 155 | extern cvmx_helper_interface_mode_t cvmx_helper_interface_get_mode(int |
156 | interface); | 156 | interface); |
@@ -214,9 +214,9 @@ extern int cvmx_helper_interface_enumerate(int interface); | |||
214 | * | 214 | * |
215 | * @ipd_port: IPD/PKO port to loopback. | 215 | * @ipd_port: IPD/PKO port to loopback. |
216 | * @enable_internal: | 216 | * @enable_internal: |
217 | * Non zero if you want internal loopback | 217 | * Non zero if you want internal loopback |
218 | * @enable_external: | 218 | * @enable_external: |
219 | * Non zero if you want external loopback | 219 | * Non zero if you want external loopback |
220 | * | 220 | * |
221 | * Returns Zero on success, negative on failure. | 221 | * Returns Zero on success, negative on failure. |
222 | */ | 222 | */ |
diff --git a/arch/mips/include/asm/octeon/cvmx-ipd.h b/arch/mips/include/asm/octeon/cvmx-ipd.h index 115a552c5c7f..e13490ebbb27 100644 --- a/arch/mips/include/asm/octeon/cvmx-ipd.h +++ b/arch/mips/include/asm/octeon/cvmx-ipd.h | |||
@@ -38,8 +38,8 @@ | |||
38 | #include <asm/octeon/cvmx-ipd-defs.h> | 38 | #include <asm/octeon/cvmx-ipd-defs.h> |
39 | 39 | ||
40 | enum cvmx_ipd_mode { | 40 | enum cvmx_ipd_mode { |
41 | CVMX_IPD_OPC_MODE_STT = 0LL, /* All blocks DRAM, not cached in L2 */ | 41 | CVMX_IPD_OPC_MODE_STT = 0LL, /* All blocks DRAM, not cached in L2 */ |
42 | CVMX_IPD_OPC_MODE_STF = 1LL, /* All bloccks into L2 */ | 42 | CVMX_IPD_OPC_MODE_STF = 1LL, /* All bloccks into L2 */ |
43 | CVMX_IPD_OPC_MODE_STF1_STT = 2LL, /* 1st block L2, rest DRAM */ | 43 | CVMX_IPD_OPC_MODE_STF1_STT = 2LL, /* 1st block L2, rest DRAM */ |
44 | CVMX_IPD_OPC_MODE_STF2_STT = 3LL /* 1st, 2nd blocks L2, rest DRAM */ | 44 | CVMX_IPD_OPC_MODE_STF2_STT = 3LL /* 1st, 2nd blocks L2, rest DRAM */ |
45 | }; | 45 | }; |
@@ -60,17 +60,17 @@ typedef cvmx_ipd_first_next_ptr_back_t cvmx_ipd_second_next_ptr_back_t; | |||
60 | * | 60 | * |
61 | * @mbuff_size: Packets buffer size in 8 byte words | 61 | * @mbuff_size: Packets buffer size in 8 byte words |
62 | * @first_mbuff_skip: | 62 | * @first_mbuff_skip: |
63 | * Number of 8 byte words to skip in the first buffer | 63 | * Number of 8 byte words to skip in the first buffer |
64 | * @not_first_mbuff_skip: | 64 | * @not_first_mbuff_skip: |
65 | * Number of 8 byte words to skip in each following buffer | 65 | * Number of 8 byte words to skip in each following buffer |
66 | * @first_back: Must be same as first_mbuff_skip / 128 | 66 | * @first_back: Must be same as first_mbuff_skip / 128 |
67 | * @second_back: | 67 | * @second_back: |
68 | * Must be same as not_first_mbuff_skip / 128 | 68 | * Must be same as not_first_mbuff_skip / 128 |
69 | * @wqe_fpa_pool: | 69 | * @wqe_fpa_pool: |
70 | * FPA pool to get work entries from | 70 | * FPA pool to get work entries from |
71 | * @cache_mode: | 71 | * @cache_mode: |
72 | * @back_pres_enable_flag: | 72 | * @back_pres_enable_flag: |
73 | * Enable or disable port back pressure | 73 | * Enable or disable port back pressure |
74 | */ | 74 | */ |
75 | static inline void cvmx_ipd_config(uint64_t mbuff_size, | 75 | static inline void cvmx_ipd_config(uint64_t mbuff_size, |
76 | uint64_t first_mbuff_skip, | 76 | uint64_t first_mbuff_skip, |
diff --git a/arch/mips/include/asm/octeon/cvmx-l2c.h b/arch/mips/include/asm/octeon/cvmx-l2c.h index 2c8ff9e33ec3..11c0a8fa8eb5 100644 --- a/arch/mips/include/asm/octeon/cvmx-l2c.h +++ b/arch/mips/include/asm/octeon/cvmx-l2c.h | |||
@@ -33,13 +33,13 @@ | |||
33 | #ifndef __CVMX_L2C_H__ | 33 | #ifndef __CVMX_L2C_H__ |
34 | #define __CVMX_L2C_H__ | 34 | #define __CVMX_L2C_H__ |
35 | 35 | ||
36 | #define CVMX_L2_ASSOC cvmx_l2c_get_num_assoc() /* Deprecated macro, use function */ | 36 | #define CVMX_L2_ASSOC cvmx_l2c_get_num_assoc() /* Deprecated macro, use function */ |
37 | #define CVMX_L2_SET_BITS cvmx_l2c_get_set_bits() /* Deprecated macro, use function */ | 37 | #define CVMX_L2_SET_BITS cvmx_l2c_get_set_bits() /* Deprecated macro, use function */ |
38 | #define CVMX_L2_SETS cvmx_l2c_get_num_sets() /* Deprecated macro, use function */ | 38 | #define CVMX_L2_SETS cvmx_l2c_get_num_sets() /* Deprecated macro, use function */ |
39 | 39 | ||
40 | 40 | ||
41 | #define CVMX_L2C_IDX_ADDR_SHIFT 7 /* based on 128 byte cache line size */ | 41 | #define CVMX_L2C_IDX_ADDR_SHIFT 7 /* based on 128 byte cache line size */ |
42 | #define CVMX_L2C_IDX_MASK (cvmx_l2c_get_num_sets() - 1) | 42 | #define CVMX_L2C_IDX_MASK (cvmx_l2c_get_num_sets() - 1) |
43 | 43 | ||
44 | /* Defines for index aliasing computations */ | 44 | /* Defines for index aliasing computations */ |
45 | #define CVMX_L2C_TAG_ADDR_ALIAS_SHIFT (CVMX_L2C_IDX_ADDR_SHIFT + cvmx_l2c_get_set_bits()) | 45 | #define CVMX_L2C_TAG_ADDR_ALIAS_SHIFT (CVMX_L2C_IDX_ADDR_SHIFT + cvmx_l2c_get_set_bits()) |
@@ -67,91 +67,91 @@ union cvmx_l2c_tag { | |||
67 | 67 | ||
68 | /* L2C Performance Counter events. */ | 68 | /* L2C Performance Counter events. */ |
69 | enum cvmx_l2c_event { | 69 | enum cvmx_l2c_event { |
70 | CVMX_L2C_EVENT_CYCLES = 0, | 70 | CVMX_L2C_EVENT_CYCLES = 0, |
71 | CVMX_L2C_EVENT_INSTRUCTION_MISS = 1, | 71 | CVMX_L2C_EVENT_INSTRUCTION_MISS = 1, |
72 | CVMX_L2C_EVENT_INSTRUCTION_HIT = 2, | 72 | CVMX_L2C_EVENT_INSTRUCTION_HIT = 2, |
73 | CVMX_L2C_EVENT_DATA_MISS = 3, | 73 | CVMX_L2C_EVENT_DATA_MISS = 3, |
74 | CVMX_L2C_EVENT_DATA_HIT = 4, | 74 | CVMX_L2C_EVENT_DATA_HIT = 4, |
75 | CVMX_L2C_EVENT_MISS = 5, | 75 | CVMX_L2C_EVENT_MISS = 5, |
76 | CVMX_L2C_EVENT_HIT = 6, | 76 | CVMX_L2C_EVENT_HIT = 6, |
77 | CVMX_L2C_EVENT_VICTIM_HIT = 7, | 77 | CVMX_L2C_EVENT_VICTIM_HIT = 7, |
78 | CVMX_L2C_EVENT_INDEX_CONFLICT = 8, | 78 | CVMX_L2C_EVENT_INDEX_CONFLICT = 8, |
79 | CVMX_L2C_EVENT_TAG_PROBE = 9, | 79 | CVMX_L2C_EVENT_TAG_PROBE = 9, |
80 | CVMX_L2C_EVENT_TAG_UPDATE = 10, | 80 | CVMX_L2C_EVENT_TAG_UPDATE = 10, |
81 | CVMX_L2C_EVENT_TAG_COMPLETE = 11, | 81 | CVMX_L2C_EVENT_TAG_COMPLETE = 11, |
82 | CVMX_L2C_EVENT_TAG_DIRTY = 12, | 82 | CVMX_L2C_EVENT_TAG_DIRTY = 12, |
83 | CVMX_L2C_EVENT_DATA_STORE_NOP = 13, | 83 | CVMX_L2C_EVENT_DATA_STORE_NOP = 13, |
84 | CVMX_L2C_EVENT_DATA_STORE_READ = 14, | 84 | CVMX_L2C_EVENT_DATA_STORE_READ = 14, |
85 | CVMX_L2C_EVENT_DATA_STORE_WRITE = 15, | 85 | CVMX_L2C_EVENT_DATA_STORE_WRITE = 15, |
86 | CVMX_L2C_EVENT_FILL_DATA_VALID = 16, | 86 | CVMX_L2C_EVENT_FILL_DATA_VALID = 16, |
87 | CVMX_L2C_EVENT_WRITE_REQUEST = 17, | 87 | CVMX_L2C_EVENT_WRITE_REQUEST = 17, |
88 | CVMX_L2C_EVENT_READ_REQUEST = 18, | 88 | CVMX_L2C_EVENT_READ_REQUEST = 18, |
89 | CVMX_L2C_EVENT_WRITE_DATA_VALID = 19, | 89 | CVMX_L2C_EVENT_WRITE_DATA_VALID = 19, |
90 | CVMX_L2C_EVENT_XMC_NOP = 20, | 90 | CVMX_L2C_EVENT_XMC_NOP = 20, |
91 | CVMX_L2C_EVENT_XMC_LDT = 21, | 91 | CVMX_L2C_EVENT_XMC_LDT = 21, |
92 | CVMX_L2C_EVENT_XMC_LDI = 22, | 92 | CVMX_L2C_EVENT_XMC_LDI = 22, |
93 | CVMX_L2C_EVENT_XMC_LDD = 23, | 93 | CVMX_L2C_EVENT_XMC_LDD = 23, |
94 | CVMX_L2C_EVENT_XMC_STF = 24, | 94 | CVMX_L2C_EVENT_XMC_STF = 24, |
95 | CVMX_L2C_EVENT_XMC_STT = 25, | 95 | CVMX_L2C_EVENT_XMC_STT = 25, |
96 | CVMX_L2C_EVENT_XMC_STP = 26, | 96 | CVMX_L2C_EVENT_XMC_STP = 26, |
97 | CVMX_L2C_EVENT_XMC_STC = 27, | 97 | CVMX_L2C_EVENT_XMC_STC = 27, |
98 | CVMX_L2C_EVENT_XMC_DWB = 28, | 98 | CVMX_L2C_EVENT_XMC_DWB = 28, |
99 | CVMX_L2C_EVENT_XMC_PL2 = 29, | 99 | CVMX_L2C_EVENT_XMC_PL2 = 29, |
100 | CVMX_L2C_EVENT_XMC_PSL1 = 30, | 100 | CVMX_L2C_EVENT_XMC_PSL1 = 30, |
101 | CVMX_L2C_EVENT_XMC_IOBLD = 31, | 101 | CVMX_L2C_EVENT_XMC_IOBLD = 31, |
102 | CVMX_L2C_EVENT_XMC_IOBST = 32, | 102 | CVMX_L2C_EVENT_XMC_IOBST = 32, |
103 | CVMX_L2C_EVENT_XMC_IOBDMA = 33, | 103 | CVMX_L2C_EVENT_XMC_IOBDMA = 33, |
104 | CVMX_L2C_EVENT_XMC_IOBRSP = 34, | 104 | CVMX_L2C_EVENT_XMC_IOBRSP = 34, |
105 | CVMX_L2C_EVENT_XMC_BUS_VALID = 35, | 105 | CVMX_L2C_EVENT_XMC_BUS_VALID = 35, |
106 | CVMX_L2C_EVENT_XMC_MEM_DATA = 36, | 106 | CVMX_L2C_EVENT_XMC_MEM_DATA = 36, |
107 | CVMX_L2C_EVENT_XMC_REFL_DATA = 37, | 107 | CVMX_L2C_EVENT_XMC_REFL_DATA = 37, |
108 | CVMX_L2C_EVENT_XMC_IOBRSP_DATA = 38, | 108 | CVMX_L2C_EVENT_XMC_IOBRSP_DATA = 38, |
109 | CVMX_L2C_EVENT_RSC_NOP = 39, | 109 | CVMX_L2C_EVENT_RSC_NOP = 39, |
110 | CVMX_L2C_EVENT_RSC_STDN = 40, | 110 | CVMX_L2C_EVENT_RSC_STDN = 40, |
111 | CVMX_L2C_EVENT_RSC_FILL = 41, | 111 | CVMX_L2C_EVENT_RSC_FILL = 41, |
112 | CVMX_L2C_EVENT_RSC_REFL = 42, | 112 | CVMX_L2C_EVENT_RSC_REFL = 42, |
113 | CVMX_L2C_EVENT_RSC_STIN = 43, | 113 | CVMX_L2C_EVENT_RSC_STIN = 43, |
114 | CVMX_L2C_EVENT_RSC_SCIN = 44, | 114 | CVMX_L2C_EVENT_RSC_SCIN = 44, |
115 | CVMX_L2C_EVENT_RSC_SCFL = 45, | 115 | CVMX_L2C_EVENT_RSC_SCFL = 45, |
116 | CVMX_L2C_EVENT_RSC_SCDN = 46, | 116 | CVMX_L2C_EVENT_RSC_SCDN = 46, |
117 | CVMX_L2C_EVENT_RSC_DATA_VALID = 47, | 117 | CVMX_L2C_EVENT_RSC_DATA_VALID = 47, |
118 | CVMX_L2C_EVENT_RSC_VALID_FILL = 48, | 118 | CVMX_L2C_EVENT_RSC_VALID_FILL = 48, |
119 | CVMX_L2C_EVENT_RSC_VALID_STRSP = 49, | 119 | CVMX_L2C_EVENT_RSC_VALID_STRSP = 49, |
120 | CVMX_L2C_EVENT_RSC_VALID_REFL = 50, | 120 | CVMX_L2C_EVENT_RSC_VALID_REFL = 50, |
121 | CVMX_L2C_EVENT_LRF_REQ = 51, | 121 | CVMX_L2C_EVENT_LRF_REQ = 51, |
122 | CVMX_L2C_EVENT_DT_RD_ALLOC = 52, | 122 | CVMX_L2C_EVENT_DT_RD_ALLOC = 52, |
123 | CVMX_L2C_EVENT_DT_WR_INVAL = 53, | 123 | CVMX_L2C_EVENT_DT_WR_INVAL = 53, |
124 | CVMX_L2C_EVENT_MAX | 124 | CVMX_L2C_EVENT_MAX |
125 | }; | 125 | }; |
126 | 126 | ||
127 | /* L2C Performance Counter events for Octeon2. */ | 127 | /* L2C Performance Counter events for Octeon2. */ |
128 | enum cvmx_l2c_tad_event { | 128 | enum cvmx_l2c_tad_event { |
129 | CVMX_L2C_TAD_EVENT_NONE = 0, | 129 | CVMX_L2C_TAD_EVENT_NONE = 0, |
130 | CVMX_L2C_TAD_EVENT_TAG_HIT = 1, | 130 | CVMX_L2C_TAD_EVENT_TAG_HIT = 1, |
131 | CVMX_L2C_TAD_EVENT_TAG_MISS = 2, | 131 | CVMX_L2C_TAD_EVENT_TAG_MISS = 2, |
132 | CVMX_L2C_TAD_EVENT_TAG_NOALLOC = 3, | 132 | CVMX_L2C_TAD_EVENT_TAG_NOALLOC = 3, |
133 | CVMX_L2C_TAD_EVENT_TAG_VICTIM = 4, | 133 | CVMX_L2C_TAD_EVENT_TAG_VICTIM = 4, |
134 | CVMX_L2C_TAD_EVENT_SC_FAIL = 5, | 134 | CVMX_L2C_TAD_EVENT_SC_FAIL = 5, |
135 | CVMX_L2C_TAD_EVENT_SC_PASS = 6, | 135 | CVMX_L2C_TAD_EVENT_SC_PASS = 6, |
136 | CVMX_L2C_TAD_EVENT_LFB_VALID = 7, | 136 | CVMX_L2C_TAD_EVENT_LFB_VALID = 7, |
137 | CVMX_L2C_TAD_EVENT_LFB_WAIT_LFB = 8, | 137 | CVMX_L2C_TAD_EVENT_LFB_WAIT_LFB = 8, |
138 | CVMX_L2C_TAD_EVENT_LFB_WAIT_VAB = 9, | 138 | CVMX_L2C_TAD_EVENT_LFB_WAIT_VAB = 9, |
139 | CVMX_L2C_TAD_EVENT_QUAD0_INDEX = 128, | 139 | CVMX_L2C_TAD_EVENT_QUAD0_INDEX = 128, |
140 | CVMX_L2C_TAD_EVENT_QUAD0_READ = 129, | 140 | CVMX_L2C_TAD_EVENT_QUAD0_READ = 129, |
141 | CVMX_L2C_TAD_EVENT_QUAD0_BANK = 130, | 141 | CVMX_L2C_TAD_EVENT_QUAD0_BANK = 130, |
142 | CVMX_L2C_TAD_EVENT_QUAD0_WDAT = 131, | 142 | CVMX_L2C_TAD_EVENT_QUAD0_WDAT = 131, |
143 | CVMX_L2C_TAD_EVENT_QUAD1_INDEX = 144, | 143 | CVMX_L2C_TAD_EVENT_QUAD1_INDEX = 144, |
144 | CVMX_L2C_TAD_EVENT_QUAD1_READ = 145, | 144 | CVMX_L2C_TAD_EVENT_QUAD1_READ = 145, |
145 | CVMX_L2C_TAD_EVENT_QUAD1_BANK = 146, | 145 | CVMX_L2C_TAD_EVENT_QUAD1_BANK = 146, |
146 | CVMX_L2C_TAD_EVENT_QUAD1_WDAT = 147, | 146 | CVMX_L2C_TAD_EVENT_QUAD1_WDAT = 147, |
147 | CVMX_L2C_TAD_EVENT_QUAD2_INDEX = 160, | 147 | CVMX_L2C_TAD_EVENT_QUAD2_INDEX = 160, |
148 | CVMX_L2C_TAD_EVENT_QUAD2_READ = 161, | 148 | CVMX_L2C_TAD_EVENT_QUAD2_READ = 161, |
149 | CVMX_L2C_TAD_EVENT_QUAD2_BANK = 162, | 149 | CVMX_L2C_TAD_EVENT_QUAD2_BANK = 162, |
150 | CVMX_L2C_TAD_EVENT_QUAD2_WDAT = 163, | 150 | CVMX_L2C_TAD_EVENT_QUAD2_WDAT = 163, |
151 | CVMX_L2C_TAD_EVENT_QUAD3_INDEX = 176, | 151 | CVMX_L2C_TAD_EVENT_QUAD3_INDEX = 176, |
152 | CVMX_L2C_TAD_EVENT_QUAD3_READ = 177, | 152 | CVMX_L2C_TAD_EVENT_QUAD3_READ = 177, |
153 | CVMX_L2C_TAD_EVENT_QUAD3_BANK = 178, | 153 | CVMX_L2C_TAD_EVENT_QUAD3_BANK = 178, |
154 | CVMX_L2C_TAD_EVENT_QUAD3_WDAT = 179, | 154 | CVMX_L2C_TAD_EVENT_QUAD3_WDAT = 179, |
155 | CVMX_L2C_TAD_EVENT_MAX | 155 | CVMX_L2C_TAD_EVENT_MAX |
156 | }; | 156 | }; |
157 | 157 | ||
@@ -159,10 +159,10 @@ enum cvmx_l2c_tad_event { | |||
159 | * Configure one of the four L2 Cache performance counters to capture event | 159 | * Configure one of the four L2 Cache performance counters to capture event |
160 | * occurrences. | 160 | * occurrences. |
161 | * | 161 | * |
162 | * @counter: The counter to configure. Range 0..3. | 162 | * @counter: The counter to configure. Range 0..3. |
163 | * @event: The type of L2 Cache event occurrence to count. | 163 | * @event: The type of L2 Cache event occurrence to count. |
164 | * @clear_on_read: When asserted, any read of the performance counter | 164 | * @clear_on_read: When asserted, any read of the performance counter |
165 | * clears the counter. | 165 | * clears the counter. |
166 | * | 166 | * |
167 | * @note The routine does not clear the counter. | 167 | * @note The routine does not clear the counter. |
168 | */ | 168 | */ |
@@ -184,8 +184,8 @@ uint64_t cvmx_l2c_read_perf(uint32_t counter); | |||
184 | * @core: The core processor of interest. | 184 | * @core: The core processor of interest. |
185 | * | 185 | * |
186 | * Returns The mask specifying the partitioning. 0 bits in mask indicates | 186 | * Returns The mask specifying the partitioning. 0 bits in mask indicates |
187 | * the cache 'ways' that a core can evict from. | 187 | * the cache 'ways' that a core can evict from. |
188 | * -1 on error | 188 | * -1 on error |
189 | */ | 189 | */ |
190 | int cvmx_l2c_get_core_way_partition(uint32_t core); | 190 | int cvmx_l2c_get_core_way_partition(uint32_t core); |
191 | 191 | ||
@@ -194,16 +194,16 @@ int cvmx_l2c_get_core_way_partition(uint32_t core); | |||
194 | * | 194 | * |
195 | * @core: The core that the partitioning applies to. | 195 | * @core: The core that the partitioning applies to. |
196 | * @mask: The partitioning of the ways expressed as a binary | 196 | * @mask: The partitioning of the ways expressed as a binary |
197 | * mask. A 0 bit allows the core to evict cache lines from | 197 | * mask. A 0 bit allows the core to evict cache lines from |
198 | * a way, while a 1 bit blocks the core from evicting any | 198 | * a way, while a 1 bit blocks the core from evicting any |
199 | * lines from that way. There must be at least one allowed | 199 | * lines from that way. There must be at least one allowed |
200 | * way (0 bit) in the mask. | 200 | * way (0 bit) in the mask. |
201 | * | 201 | * |
202 | 202 | ||
203 | * @note If any ways are blocked for all cores and the HW blocks, then | 203 | * @note If any ways are blocked for all cores and the HW blocks, then |
204 | * those ways will never have any cache lines evicted from them. | 204 | * those ways will never have any cache lines evicted from them. |
205 | * All cores and the hardware blocks are free to read from all | 205 | * All cores and the hardware blocks are free to read from all |
206 | * ways regardless of the partitioning. | 206 | * ways regardless of the partitioning. |
207 | */ | 207 | */ |
208 | int cvmx_l2c_set_core_way_partition(uint32_t core, uint32_t mask); | 208 | int cvmx_l2c_set_core_way_partition(uint32_t core, uint32_t mask); |
209 | 209 | ||
@@ -211,8 +211,8 @@ int cvmx_l2c_set_core_way_partition(uint32_t core, uint32_t mask); | |||
211 | * Return the L2 Cache way partitioning for the hw blocks. | 211 | * Return the L2 Cache way partitioning for the hw blocks. |
212 | * | 212 | * |
213 | * Returns The mask specifying the reserved way. 0 bits in mask indicates | 213 | * Returns The mask specifying the reserved way. 0 bits in mask indicates |
214 | * the cache 'ways' that a core can evict from. | 214 | * the cache 'ways' that a core can evict from. |
215 | * -1 on error | 215 | * -1 on error |
216 | */ | 216 | */ |
217 | int cvmx_l2c_get_hw_way_partition(void); | 217 | int cvmx_l2c_get_hw_way_partition(void); |
218 | 218 | ||
@@ -220,16 +220,16 @@ int cvmx_l2c_get_hw_way_partition(void); | |||
220 | * Partitions the L2 cache for the hardware blocks. | 220 | * Partitions the L2 cache for the hardware blocks. |
221 | * | 221 | * |
222 | * @mask: The partitioning of the ways expressed as a binary | 222 | * @mask: The partitioning of the ways expressed as a binary |
223 | * mask. A 0 bit allows the core to evict cache lines from | 223 | * mask. A 0 bit allows the core to evict cache lines from |
224 | * a way, while a 1 bit blocks the core from evicting any | 224 | * a way, while a 1 bit blocks the core from evicting any |
225 | * lines from that way. There must be at least one allowed | 225 | * lines from that way. There must be at least one allowed |
226 | * way (0 bit) in the mask. | 226 | * way (0 bit) in the mask. |
227 | * | 227 | * |
228 | 228 | ||
229 | * @note If any ways are blocked for all cores and the HW blocks, then | 229 | * @note If any ways are blocked for all cores and the HW blocks, then |
230 | * those ways will never have any cache lines evicted from them. | 230 | * those ways will never have any cache lines evicted from them. |
231 | * All cores and the hardware blocks are free to read from all | 231 | * All cores and the hardware blocks are free to read from all |
232 | * ways regardless of the partitioning. | 232 | * ways regardless of the partitioning. |
233 | */ | 233 | */ |
234 | int cvmx_l2c_set_hw_way_partition(uint32_t mask); | 234 | int cvmx_l2c_set_hw_way_partition(uint32_t mask); |
235 | 235 | ||
@@ -240,7 +240,7 @@ int cvmx_l2c_set_hw_way_partition(uint32_t mask); | |||
240 | * @addr: physical address of line to lock | 240 | * @addr: physical address of line to lock |
241 | * | 241 | * |
242 | * Returns 0 on success, | 242 | * Returns 0 on success, |
243 | * 1 if line not locked. | 243 | * 1 if line not locked. |
244 | */ | 244 | */ |
245 | int cvmx_l2c_lock_line(uint64_t addr); | 245 | int cvmx_l2c_lock_line(uint64_t addr); |
246 | 246 | ||
@@ -258,7 +258,7 @@ int cvmx_l2c_lock_line(uint64_t addr); | |||
258 | * @len: Length (in bytes) of region to lock | 258 | * @len: Length (in bytes) of region to lock |
259 | * | 259 | * |
260 | * Returns Number of requested lines that where not locked. | 260 | * Returns Number of requested lines that where not locked. |
261 | * 0 on success (all locked) | 261 | * 0 on success (all locked) |
262 | */ | 262 | */ |
263 | int cvmx_l2c_lock_mem_region(uint64_t start, uint64_t len); | 263 | int cvmx_l2c_lock_mem_region(uint64_t start, uint64_t len); |
264 | 264 | ||
@@ -272,7 +272,7 @@ int cvmx_l2c_lock_mem_region(uint64_t start, uint64_t len); | |||
272 | * @address: Physical address to unlock | 272 | * @address: Physical address to unlock |
273 | * | 273 | * |
274 | * Returns 0: line not unlocked | 274 | * Returns 0: line not unlocked |
275 | * 1: line unlocked | 275 | * 1: line unlocked |
276 | */ | 276 | */ |
277 | int cvmx_l2c_unlock_line(uint64_t address); | 277 | int cvmx_l2c_unlock_line(uint64_t address); |
278 | 278 | ||
@@ -290,7 +290,7 @@ int cvmx_l2c_unlock_mem_region(uint64_t start, uint64_t len); | |||
290 | * Read the L2 controller tag for a given location in L2 | 290 | * Read the L2 controller tag for a given location in L2 |
291 | * | 291 | * |
292 | * @association: | 292 | * @association: |
293 | * Which association to read line from | 293 | * Which association to read line from |
294 | * @index: Which way to read from. | 294 | * @index: Which way to read from. |
295 | * | 295 | * |
296 | * Returns l2c tag structure for line requested. | 296 | * Returns l2c tag structure for line requested. |
diff --git a/arch/mips/include/asm/octeon/cvmx-mdio.h b/arch/mips/include/asm/octeon/cvmx-mdio.h index 6f0cd182cec8..9f6a4f32a83c 100644 --- a/arch/mips/include/asm/octeon/cvmx-mdio.h +++ b/arch/mips/include/asm/octeon/cvmx-mdio.h | |||
@@ -246,21 +246,21 @@ typedef union { | |||
246 | } cvmx_mdio_phy_reg_mmd_address_data_t; | 246 | } cvmx_mdio_phy_reg_mmd_address_data_t; |
247 | 247 | ||
248 | /* Operating request encodings. */ | 248 | /* Operating request encodings. */ |
249 | #define MDIO_CLAUSE_22_WRITE 0 | 249 | #define MDIO_CLAUSE_22_WRITE 0 |
250 | #define MDIO_CLAUSE_22_READ 1 | 250 | #define MDIO_CLAUSE_22_READ 1 |
251 | 251 | ||
252 | #define MDIO_CLAUSE_45_ADDRESS 0 | 252 | #define MDIO_CLAUSE_45_ADDRESS 0 |
253 | #define MDIO_CLAUSE_45_WRITE 1 | 253 | #define MDIO_CLAUSE_45_WRITE 1 |
254 | #define MDIO_CLAUSE_45_READ_INC 2 | 254 | #define MDIO_CLAUSE_45_READ_INC 2 |
255 | #define MDIO_CLAUSE_45_READ 3 | 255 | #define MDIO_CLAUSE_45_READ 3 |
256 | 256 | ||
257 | /* MMD identifiers, mostly for accessing devices within XENPAK modules. */ | 257 | /* MMD identifiers, mostly for accessing devices within XENPAK modules. */ |
258 | #define CVMX_MMD_DEVICE_PMA_PMD 1 | 258 | #define CVMX_MMD_DEVICE_PMA_PMD 1 |
259 | #define CVMX_MMD_DEVICE_WIS 2 | 259 | #define CVMX_MMD_DEVICE_WIS 2 |
260 | #define CVMX_MMD_DEVICE_PCS 3 | 260 | #define CVMX_MMD_DEVICE_PCS 3 |
261 | #define CVMX_MMD_DEVICE_PHY_XS 4 | 261 | #define CVMX_MMD_DEVICE_PHY_XS 4 |
262 | #define CVMX_MMD_DEVICE_DTS_XS 5 | 262 | #define CVMX_MMD_DEVICE_DTS_XS 5 |
263 | #define CVMX_MMD_DEVICE_TC 6 | 263 | #define CVMX_MMD_DEVICE_TC 6 |
264 | #define CVMX_MMD_DEVICE_CL22_EXT 29 | 264 | #define CVMX_MMD_DEVICE_CL22_EXT 29 |
265 | #define CVMX_MMD_DEVICE_VENDOR_1 30 | 265 | #define CVMX_MMD_DEVICE_VENDOR_1 30 |
266 | #define CVMX_MMD_DEVICE_VENDOR_2 31 | 266 | #define CVMX_MMD_DEVICE_VENDOR_2 31 |
@@ -291,7 +291,7 @@ static inline void __cvmx_mdio_set_clause22_mode(int bus_id) | |||
291 | * registers controlling auto negotiation. | 291 | * registers controlling auto negotiation. |
292 | * | 292 | * |
293 | * @bus_id: MDIO bus number. Zero on most chips, but some chips (ex CN56XX) | 293 | * @bus_id: MDIO bus number. Zero on most chips, but some chips (ex CN56XX) |
294 | * support multiple busses. | 294 | * support multiple busses. |
295 | * @phy_id: The MII phy id | 295 | * @phy_id: The MII phy id |
296 | * @location: Register location to read | 296 | * @location: Register location to read |
297 | * | 297 | * |
@@ -328,13 +328,13 @@ static inline int cvmx_mdio_read(int bus_id, int phy_id, int location) | |||
328 | * registers controlling auto negotiation. | 328 | * registers controlling auto negotiation. |
329 | * | 329 | * |
330 | * @bus_id: MDIO bus number. Zero on most chips, but some chips (ex CN56XX) | 330 | * @bus_id: MDIO bus number. Zero on most chips, but some chips (ex CN56XX) |
331 | * support multiple busses. | 331 | * support multiple busses. |
332 | * @phy_id: The MII phy id | 332 | * @phy_id: The MII phy id |
333 | * @location: Register location to write | 333 | * @location: Register location to write |
334 | * @val: Value to write | 334 | * @val: Value to write |
335 | * | 335 | * |
336 | * Returns -1 on error | 336 | * Returns -1 on error |
337 | * 0 on success | 337 | * 0 on success |
338 | */ | 338 | */ |
339 | static inline int cvmx_mdio_write(int bus_id, int phy_id, int location, int val) | 339 | static inline int cvmx_mdio_write(int bus_id, int phy_id, int location, int val) |
340 | { | 340 | { |
@@ -370,7 +370,7 @@ static inline int cvmx_mdio_write(int bus_id, int phy_id, int location, int val) | |||
370 | * read PHY registers controlling auto negotiation. | 370 | * read PHY registers controlling auto negotiation. |
371 | * | 371 | * |
372 | * @bus_id: MDIO bus number. Zero on most chips, but some chips (ex CN56XX) | 372 | * @bus_id: MDIO bus number. Zero on most chips, but some chips (ex CN56XX) |
373 | * support multiple busses. | 373 | * support multiple busses. |
374 | * @phy_id: The MII phy id | 374 | * @phy_id: The MII phy id |
375 | * @device: MDIO Managable Device (MMD) id | 375 | * @device: MDIO Managable Device (MMD) id |
376 | * @location: Register location to read | 376 | * @location: Register location to read |
@@ -407,7 +407,7 @@ static inline int cvmx_mdio_45_read(int bus_id, int phy_id, int device, | |||
407 | } while (smi_wr.s.pending && --timeout); | 407 | } while (smi_wr.s.pending && --timeout); |
408 | if (timeout <= 0) { | 408 | if (timeout <= 0) { |
409 | cvmx_dprintf("cvmx_mdio_45_read: bus_id %d phy_id %2d " | 409 | cvmx_dprintf("cvmx_mdio_45_read: bus_id %d phy_id %2d " |
410 | "device %2d register %2d TIME OUT(address)\n", | 410 | "device %2d register %2d TIME OUT(address)\n", |
411 | bus_id, phy_id, device, location); | 411 | bus_id, phy_id, device, location); |
412 | return -1; | 412 | return -1; |
413 | } | 413 | } |
@@ -425,7 +425,7 @@ static inline int cvmx_mdio_45_read(int bus_id, int phy_id, int device, | |||
425 | 425 | ||
426 | if (timeout <= 0) { | 426 | if (timeout <= 0) { |
427 | cvmx_dprintf("cvmx_mdio_45_read: bus_id %d phy_id %2d " | 427 | cvmx_dprintf("cvmx_mdio_45_read: bus_id %d phy_id %2d " |
428 | "device %2d register %2d TIME OUT(data)\n", | 428 | "device %2d register %2d TIME OUT(data)\n", |
429 | bus_id, phy_id, device, location); | 429 | bus_id, phy_id, device, location); |
430 | return -1; | 430 | return -1; |
431 | } | 431 | } |
@@ -434,7 +434,7 @@ static inline int cvmx_mdio_45_read(int bus_id, int phy_id, int device, | |||
434 | return smi_rd.s.dat; | 434 | return smi_rd.s.dat; |
435 | else { | 435 | else { |
436 | cvmx_dprintf("cvmx_mdio_45_read: bus_id %d phy_id %2d " | 436 | cvmx_dprintf("cvmx_mdio_45_read: bus_id %d phy_id %2d " |
437 | "device %2d register %2d INVALID READ\n", | 437 | "device %2d register %2d INVALID READ\n", |
438 | bus_id, phy_id, device, location); | 438 | bus_id, phy_id, device, location); |
439 | return -1; | 439 | return -1; |
440 | } | 440 | } |
@@ -445,14 +445,14 @@ static inline int cvmx_mdio_45_read(int bus_id, int phy_id, int device, | |||
445 | * write PHY registers controlling auto negotiation. | 445 | * write PHY registers controlling auto negotiation. |
446 | * | 446 | * |
447 | * @bus_id: MDIO bus number. Zero on most chips, but some chips (ex CN56XX) | 447 | * @bus_id: MDIO bus number. Zero on most chips, but some chips (ex CN56XX) |
448 | * support multiple busses. | 448 | * support multiple busses. |
449 | * @phy_id: The MII phy id | 449 | * @phy_id: The MII phy id |
450 | * @device: MDIO Managable Device (MMD) id | 450 | * @device: MDIO Managable Device (MMD) id |
451 | * @location: Register location to write | 451 | * @location: Register location to write |
452 | * @val: Value to write | 452 | * @val: Value to write |
453 | * | 453 | * |
454 | * Returns -1 on error | 454 | * Returns -1 on error |
455 | * 0 on success | 455 | * 0 on success |
456 | */ | 456 | */ |
457 | static inline int cvmx_mdio_45_write(int bus_id, int phy_id, int device, | 457 | static inline int cvmx_mdio_45_write(int bus_id, int phy_id, int device, |
458 | int location, int val) | 458 | int location, int val) |
diff --git a/arch/mips/include/asm/octeon/cvmx-pip-defs.h b/arch/mips/include/asm/octeon/cvmx-pip-defs.h index 05a917d6ebe5..e975c7d2e485 100644 --- a/arch/mips/include/asm/octeon/cvmx-pip-defs.h +++ b/arch/mips/include/asm/octeon/cvmx-pip-defs.h | |||
@@ -44,7 +44,7 @@ enum cvmx_pip_port_parse_mode { | |||
44 | */ | 44 | */ |
45 | CVMX_PIP_PORT_CFG_MODE_SKIPL2 = 1ull, | 45 | CVMX_PIP_PORT_CFG_MODE_SKIPL2 = 1ull, |
46 | /* | 46 | /* |
47 | * Input packets are assumed to be IP. Results from non IP | 47 | * Input packets are assumed to be IP. Results from non IP |
48 | * packets is undefined. Pointers reference the beginning of | 48 | * packets is undefined. Pointers reference the beginning of |
49 | * the IP header. | 49 | * the IP header. |
50 | */ | 50 | */ |
diff --git a/arch/mips/include/asm/octeon/cvmx-pip.h b/arch/mips/include/asm/octeon/cvmx-pip.h index 9e739a640855..a76fe5a57a9f 100644 --- a/arch/mips/include/asm/octeon/cvmx-pip.h +++ b/arch/mips/include/asm/octeon/cvmx-pip.h | |||
@@ -37,8 +37,8 @@ | |||
37 | #include <asm/octeon/cvmx-fpa.h> | 37 | #include <asm/octeon/cvmx-fpa.h> |
38 | #include <asm/octeon/cvmx-pip-defs.h> | 38 | #include <asm/octeon/cvmx-pip-defs.h> |
39 | 39 | ||
40 | #define CVMX_PIP_NUM_INPUT_PORTS 40 | 40 | #define CVMX_PIP_NUM_INPUT_PORTS 40 |
41 | #define CVMX_PIP_NUM_WATCHERS 4 | 41 | #define CVMX_PIP_NUM_WATCHERS 4 |
42 | 42 | ||
43 | /* | 43 | /* |
44 | * Encodes the different error and exception codes | 44 | * Encodes the different error and exception codes |
@@ -92,10 +92,10 @@ typedef enum { | |||
92 | 92 | ||
93 | /** | 93 | /** |
94 | * NOTES | 94 | * NOTES |
95 | * late collision (data received before collision) | 95 | * late collision (data received before collision) |
96 | * late collisions cannot be detected by the receiver | 96 | * late collisions cannot be detected by the receiver |
97 | * they would appear as JAM bits which would appear as bad FCS | 97 | * they would appear as JAM bits which would appear as bad FCS |
98 | * or carrier extend error which is CVMX_PIP_EXTEND_ERR | 98 | * or carrier extend error which is CVMX_PIP_EXTEND_ERR |
99 | */ | 99 | */ |
100 | typedef enum { | 100 | typedef enum { |
101 | /* No error */ | 101 | /* No error */ |
@@ -122,11 +122,11 @@ typedef enum { | |||
122 | * error) | 122 | * error) |
123 | */ | 123 | */ |
124 | CVMX_PIP_UNDER_FCS_ERR = 6ull, | 124 | CVMX_PIP_UNDER_FCS_ERR = 6ull, |
125 | /* RGM 7 = FCS error */ | 125 | /* RGM 7 = FCS error */ |
126 | CVMX_PIP_GMX_FCS_ERR = 7ull, | 126 | CVMX_PIP_GMX_FCS_ERR = 7ull, |
127 | /* RGM+SPI 8 = min frame error (pkt len < min frame len) */ | 127 | /* RGM+SPI 8 = min frame error (pkt len < min frame len) */ |
128 | CVMX_PIP_UNDER_ERR = 8ull, | 128 | CVMX_PIP_UNDER_ERR = 8ull, |
129 | /* RGM 9 = Frame carrier extend error */ | 129 | /* RGM 9 = Frame carrier extend error */ |
130 | CVMX_PIP_EXTEND_ERR = 9ull, | 130 | CVMX_PIP_EXTEND_ERR = 9ull, |
131 | /* | 131 | /* |
132 | * RGM 10 = length mismatch (len did not match len in L2 | 132 | * RGM 10 = length mismatch (len did not match len in L2 |
@@ -161,10 +161,10 @@ typedef enum { | |||
161 | CVMX_PIP_PIP_L2_MAL_HDR = 18L | 161 | CVMX_PIP_PIP_L2_MAL_HDR = 18L |
162 | /* | 162 | /* |
163 | * NOTES: xx = late collision (data received before collision) | 163 | * NOTES: xx = late collision (data received before collision) |
164 | * late collisions cannot be detected by the receiver | 164 | * late collisions cannot be detected by the receiver |
165 | * they would appear as JAM bits which would appear as | 165 | * they would appear as JAM bits which would appear as |
166 | * bad FCS or carrier extend error which is | 166 | * bad FCS or carrier extend error which is |
167 | * CVMX_PIP_EXTEND_ERR | 167 | * CVMX_PIP_EXTEND_ERR |
168 | */ | 168 | */ |
169 | } cvmx_pip_rcv_err_t; | 169 | } cvmx_pip_rcv_err_t; |
170 | 170 | ||
@@ -192,13 +192,13 @@ typedef struct { | |||
192 | /* Number of packets processed by PIP */ | 192 | /* Number of packets processed by PIP */ |
193 | uint32_t packets; | 193 | uint32_t packets; |
194 | /* | 194 | /* |
195 | * Number of indentified L2 multicast packets. Does not | 195 | * Number of indentified L2 multicast packets. Does not |
196 | * include broadcast packets. Only includes packets whose | 196 | * include broadcast packets. Only includes packets whose |
197 | * parse mode is SKIP_TO_L2 | 197 | * parse mode is SKIP_TO_L2 |
198 | */ | 198 | */ |
199 | uint32_t multicast_packets; | 199 | uint32_t multicast_packets; |
200 | /* | 200 | /* |
201 | * Number of indentified L2 broadcast packets. Does not | 201 | * Number of indentified L2 broadcast packets. Does not |
202 | * include multicast packets. Only includes packets whose | 202 | * include multicast packets. Only includes packets whose |
203 | * parse mode is SKIP_TO_L2 | 203 | * parse mode is SKIP_TO_L2 |
204 | */ | 204 | */ |
@@ -287,7 +287,7 @@ typedef union { | |||
287 | * @port_num: Port number to configure | 287 | * @port_num: Port number to configure |
288 | * @port_cfg: Port hardware configuration | 288 | * @port_cfg: Port hardware configuration |
289 | * @port_tag_cfg: | 289 | * @port_tag_cfg: |
290 | * Port POW tagging configuration | 290 | * Port POW tagging configuration |
291 | */ | 291 | */ |
292 | static inline void cvmx_pip_config_port(uint64_t port_num, | 292 | static inline void cvmx_pip_config_port(uint64_t port_num, |
293 | union cvmx_pip_prt_cfgx port_cfg, | 293 | union cvmx_pip_prt_cfgx port_cfg, |
@@ -298,20 +298,20 @@ static inline void cvmx_pip_config_port(uint64_t port_num, | |||
298 | } | 298 | } |
299 | #if 0 | 299 | #if 0 |
300 | /** | 300 | /** |
301 | * @deprecated This function is a thin wrapper around the Pass1 version | 301 | * @deprecated This function is a thin wrapper around the Pass1 version |
302 | * of the CVMX_PIP_QOS_WATCHX CSR; Pass2 has added a field for | 302 | * of the CVMX_PIP_QOS_WATCHX CSR; Pass2 has added a field for |
303 | * setting the group that is incompatible with this function, | 303 | * setting the group that is incompatible with this function, |
304 | * the preferred upgrade path is to use the CSR directly. | 304 | * the preferred upgrade path is to use the CSR directly. |
305 | * | 305 | * |
306 | * Configure the global QoS packet watchers. Each watcher is | 306 | * Configure the global QoS packet watchers. Each watcher is |
307 | * capable of matching a field in a packet to determine the | 307 | * capable of matching a field in a packet to determine the |
308 | * QoS queue for scheduling. | 308 | * QoS queue for scheduling. |
309 | * | 309 | * |
310 | * @watcher: Watcher number to configure (0 - 3). | 310 | * @watcher: Watcher number to configure (0 - 3). |
311 | * @match_type: Watcher match type | 311 | * @match_type: Watcher match type |
312 | * @match_value: | 312 | * @match_value: |
313 | * Value the watcher will match against | 313 | * Value the watcher will match against |
314 | * @qos: QoS queue for packets matching this watcher | 314 | * @qos: QoS queue for packets matching this watcher |
315 | */ | 315 | */ |
316 | static inline void cvmx_pip_config_watcher(uint64_t watcher, | 316 | static inline void cvmx_pip_config_watcher(uint64_t watcher, |
317 | cvmx_pip_qos_watch_types match_type, | 317 | cvmx_pip_qos_watch_types match_type, |
@@ -331,7 +331,7 @@ static inline void cvmx_pip_config_watcher(uint64_t watcher, | |||
331 | * Configure the VLAN priority to QoS queue mapping. | 331 | * Configure the VLAN priority to QoS queue mapping. |
332 | * | 332 | * |
333 | * @vlan_priority: | 333 | * @vlan_priority: |
334 | * VLAN priority (0-7) | 334 | * VLAN priority (0-7) |
335 | * @qos: QoS queue for packets matching this watcher | 335 | * @qos: QoS queue for packets matching this watcher |
336 | */ | 336 | */ |
337 | static inline void cvmx_pip_config_vlan_qos(uint64_t vlan_priority, | 337 | static inline void cvmx_pip_config_vlan_qos(uint64_t vlan_priority, |
@@ -451,10 +451,10 @@ static inline void cvmx_pip_get_port_status(uint64_t port_num, uint64_t clear, | |||
451 | * | 451 | * |
452 | * @interface: Interface to configure (0 or 1) | 452 | * @interface: Interface to configure (0 or 1) |
453 | * @invert_result: | 453 | * @invert_result: |
454 | * Invert the result of the CRC | 454 | * Invert the result of the CRC |
455 | * @reflect: Reflect | 455 | * @reflect: Reflect |
456 | * @initialization_vector: | 456 | * @initialization_vector: |
457 | * CRC initialization vector | 457 | * CRC initialization vector |
458 | */ | 458 | */ |
459 | static inline void cvmx_pip_config_crc(uint64_t interface, | 459 | static inline void cvmx_pip_config_crc(uint64_t interface, |
460 | uint64_t invert_result, uint64_t reflect, | 460 | uint64_t invert_result, uint64_t reflect, |
@@ -500,13 +500,13 @@ static inline void cvmx_pip_tag_mask_clear(uint64_t mask_index) | |||
500 | * | 500 | * |
501 | * @mask_index: Which tag mask to modify (0..3) | 501 | * @mask_index: Which tag mask to modify (0..3) |
502 | * @offset: Offset into the bitmask to set bits at. Use the GCC macro | 502 | * @offset: Offset into the bitmask to set bits at. Use the GCC macro |
503 | * offsetof() to determine the offsets into packet headers. | 503 | * offsetof() to determine the offsets into packet headers. |
504 | * For example, offsetof(ethhdr, protocol) returns the offset | 504 | * For example, offsetof(ethhdr, protocol) returns the offset |
505 | * of the ethernet protocol field. The bitmask selects which | 505 | * of the ethernet protocol field. The bitmask selects which |
506 | * bytes to include the the tag, with bit offset X selecting | 506 | * bytes to include the the tag, with bit offset X selecting |
507 | * byte at offset X from the beginning of the packet data. | 507 | * byte at offset X from the beginning of the packet data. |
508 | * @len: Number of bytes to include. Usually this is the sizeof() | 508 | * @len: Number of bytes to include. Usually this is the sizeof() |
509 | * the field. | 509 | * the field. |
510 | */ | 510 | */ |
511 | static inline void cvmx_pip_tag_mask_set(uint64_t mask_index, uint64_t offset, | 511 | static inline void cvmx_pip_tag_mask_set(uint64_t mask_index, uint64_t offset, |
512 | uint64_t len) | 512 | uint64_t len) |
diff --git a/arch/mips/include/asm/octeon/cvmx-pko.h b/arch/mips/include/asm/octeon/cvmx-pko.h index c6daeedf1f81..f7d2a6718849 100644 --- a/arch/mips/include/asm/octeon/cvmx-pko.h +++ b/arch/mips/include/asm/octeon/cvmx-pko.h | |||
@@ -69,16 +69,16 @@ | |||
69 | #define CVMX_PKO_COMMAND_BUFFER_SIZE_ADJUST (1) | 69 | #define CVMX_PKO_COMMAND_BUFFER_SIZE_ADJUST (1) |
70 | 70 | ||
71 | #define CVMX_PKO_MAX_OUTPUT_QUEUES_STATIC 256 | 71 | #define CVMX_PKO_MAX_OUTPUT_QUEUES_STATIC 256 |
72 | #define CVMX_PKO_MAX_OUTPUT_QUEUES ((OCTEON_IS_MODEL(OCTEON_CN31XX) || \ | 72 | #define CVMX_PKO_MAX_OUTPUT_QUEUES ((OCTEON_IS_MODEL(OCTEON_CN31XX) || \ |
73 | OCTEON_IS_MODEL(OCTEON_CN3010) || OCTEON_IS_MODEL(OCTEON_CN3005) || \ | 73 | OCTEON_IS_MODEL(OCTEON_CN3010) || OCTEON_IS_MODEL(OCTEON_CN3005) || \ |
74 | OCTEON_IS_MODEL(OCTEON_CN50XX)) ? 32 : \ | 74 | OCTEON_IS_MODEL(OCTEON_CN50XX)) ? 32 : \ |
75 | (OCTEON_IS_MODEL(OCTEON_CN58XX) || \ | 75 | (OCTEON_IS_MODEL(OCTEON_CN58XX) || \ |
76 | OCTEON_IS_MODEL(OCTEON_CN56XX)) ? 256 : 128) | 76 | OCTEON_IS_MODEL(OCTEON_CN56XX)) ? 256 : 128) |
77 | #define CVMX_PKO_NUM_OUTPUT_PORTS 40 | 77 | #define CVMX_PKO_NUM_OUTPUT_PORTS 40 |
78 | /* use this for queues that are not used */ | 78 | /* use this for queues that are not used */ |
79 | #define CVMX_PKO_MEM_QUEUE_PTRS_ILLEGAL_PID 63 | 79 | #define CVMX_PKO_MEM_QUEUE_PTRS_ILLEGAL_PID 63 |
80 | #define CVMX_PKO_QUEUE_STATIC_PRIORITY 9 | 80 | #define CVMX_PKO_QUEUE_STATIC_PRIORITY 9 |
81 | #define CVMX_PKO_ILLEGAL_QUEUE 0xFFFF | 81 | #define CVMX_PKO_ILLEGAL_QUEUE 0xFFFF |
82 | #define CVMX_PKO_MAX_QUEUE_DEPTH 0 | 82 | #define CVMX_PKO_MAX_QUEUE_DEPTH 0 |
83 | 83 | ||
84 | typedef enum { | 84 | typedef enum { |
@@ -269,13 +269,13 @@ extern void cvmx_pko_shutdown(void); | |||
269 | /** | 269 | /** |
270 | * Configure a output port and the associated queues for use. | 270 | * Configure a output port and the associated queues for use. |
271 | * | 271 | * |
272 | * @port: Port to configure. | 272 | * @port: Port to configure. |
273 | * @base_queue: First queue number to associate with this port. | 273 | * @base_queue: First queue number to associate with this port. |
274 | * @num_queues: Number of queues t oassociate with this port | 274 | * @num_queues: Number of queues t oassociate with this port |
275 | * @priority: Array of priority levels for each queue. Values are | 275 | * @priority: Array of priority levels for each queue. Values are |
276 | * allowed to be 1-8. A value of 8 get 8 times the traffic | 276 | * allowed to be 1-8. A value of 8 get 8 times the traffic |
277 | * of a value of 1. There must be num_queues elements in the | 277 | * of a value of 1. There must be num_queues elements in the |
278 | * array. | 278 | * array. |
279 | */ | 279 | */ |
280 | extern cvmx_pko_status_t cvmx_pko_config_port(uint64_t port, | 280 | extern cvmx_pko_status_t cvmx_pko_config_port(uint64_t port, |
281 | uint64_t base_queue, | 281 | uint64_t base_queue, |
@@ -285,7 +285,7 @@ extern cvmx_pko_status_t cvmx_pko_config_port(uint64_t port, | |||
285 | /** | 285 | /** |
286 | * Ring the packet output doorbell. This tells the packet | 286 | * Ring the packet output doorbell. This tells the packet |
287 | * output hardware that "len" command words have been added | 287 | * output hardware that "len" command words have been added |
288 | * to its pending list. This command includes the required | 288 | * to its pending list. This command includes the required |
289 | * CVMX_SYNCWS before the doorbell ring. | 289 | * CVMX_SYNCWS before the doorbell ring. |
290 | * | 290 | * |
291 | * @port: Port the packet is for | 291 | * @port: Port the packet is for |
@@ -322,18 +322,18 @@ static inline void cvmx_pko_doorbell(uint64_t port, uint64_t queue, | |||
322 | * The use_locking parameter allows the caller to use three | 322 | * The use_locking parameter allows the caller to use three |
323 | * possible locking modes. | 323 | * possible locking modes. |
324 | * - CVMX_PKO_LOCK_NONE | 324 | * - CVMX_PKO_LOCK_NONE |
325 | * - PKO doesn't do any locking. It is the responsibility | 325 | * - PKO doesn't do any locking. It is the responsibility |
326 | * of the application to make sure that no other core | 326 | * of the application to make sure that no other core |
327 | * is accessing the same queue at the same time. | 327 | * is accessing the same queue at the same time. |
328 | * - CVMX_PKO_LOCK_ATOMIC_TAG | 328 | * - CVMX_PKO_LOCK_ATOMIC_TAG |
329 | * - PKO performs an atomic tagswitch to insure exclusive | 329 | * - PKO performs an atomic tagswitch to insure exclusive |
330 | * access to the output queue. This will maintain | 330 | * access to the output queue. This will maintain |
331 | * packet ordering on output. | 331 | * packet ordering on output. |
332 | * - CVMX_PKO_LOCK_CMD_QUEUE | 332 | * - CVMX_PKO_LOCK_CMD_QUEUE |
333 | * - PKO uses the common command queue locks to insure | 333 | * - PKO uses the common command queue locks to insure |
334 | * exclusive access to the output queue. This is a | 334 | * exclusive access to the output queue. This is a |
335 | * memory based ll/sc. This is the most portable | 335 | * memory based ll/sc. This is the most portable |
336 | * locking mechanism. | 336 | * locking mechanism. |
337 | * | 337 | * |
338 | * NOTE: If atomic locking is used, the POW entry CANNOT be | 338 | * NOTE: If atomic locking is used, the POW entry CANNOT be |
339 | * descheduled, as it does not contain a valid WQE pointer. | 339 | * descheduled, as it does not contain a valid WQE pointer. |
@@ -341,7 +341,7 @@ static inline void cvmx_pko_doorbell(uint64_t port, uint64_t queue, | |||
341 | * @port: Port to send it on | 341 | * @port: Port to send it on |
342 | * @queue: Queue to use | 342 | * @queue: Queue to use |
343 | * @use_locking: CVMX_PKO_LOCK_NONE, CVMX_PKO_LOCK_ATOMIC_TAG, or | 343 | * @use_locking: CVMX_PKO_LOCK_NONE, CVMX_PKO_LOCK_ATOMIC_TAG, or |
344 | * CVMX_PKO_LOCK_CMD_QUEUE | 344 | * CVMX_PKO_LOCK_CMD_QUEUE |
345 | */ | 345 | */ |
346 | 346 | ||
347 | static inline void cvmx_pko_send_packet_prepare(uint64_t port, uint64_t queue, | 347 | static inline void cvmx_pko_send_packet_prepare(uint64_t port, uint64_t queue, |
@@ -351,11 +351,11 @@ static inline void cvmx_pko_send_packet_prepare(uint64_t port, uint64_t queue, | |||
351 | /* | 351 | /* |
352 | * Must do a full switch here to handle all cases. We | 352 | * Must do a full switch here to handle all cases. We |
353 | * use a fake WQE pointer, as the POW does not access | 353 | * use a fake WQE pointer, as the POW does not access |
354 | * this memory. The WQE pointer and group are only | 354 | * this memory. The WQE pointer and group are only |
355 | * used if this work is descheduled, which is not | 355 | * used if this work is descheduled, which is not |
356 | * supported by the | 356 | * supported by the |
357 | * cvmx_pko_send_packet_prepare/cvmx_pko_send_packet_finish | 357 | * cvmx_pko_send_packet_prepare/cvmx_pko_send_packet_finish |
358 | * combination. Note that this is a special case in | 358 | * combination. Note that this is a special case in |
359 | * which these fake values can be used - this is not a | 359 | * which these fake values can be used - this is not a |
360 | * general technique. | 360 | * general technique. |
361 | */ | 361 | */ |
@@ -377,10 +377,10 @@ static inline void cvmx_pko_send_packet_prepare(uint64_t port, uint64_t queue, | |||
377 | * @port: Port to send it on | 377 | * @port: Port to send it on |
378 | * @queue: Queue to use | 378 | * @queue: Queue to use |
379 | * @pko_command: | 379 | * @pko_command: |
380 | * PKO HW command word | 380 | * PKO HW command word |
381 | * @packet: Packet to send | 381 | * @packet: Packet to send |
382 | * @use_locking: CVMX_PKO_LOCK_NONE, CVMX_PKO_LOCK_ATOMIC_TAG, or | 382 | * @use_locking: CVMX_PKO_LOCK_NONE, CVMX_PKO_LOCK_ATOMIC_TAG, or |
383 | * CVMX_PKO_LOCK_CMD_QUEUE | 383 | * CVMX_PKO_LOCK_CMD_QUEUE |
384 | * | 384 | * |
385 | * Returns returns CVMX_PKO_SUCCESS on success, or error code on | 385 | * Returns returns CVMX_PKO_SUCCESS on success, or error code on |
386 | * failure of output | 386 | * failure of output |
@@ -418,12 +418,12 @@ static inline cvmx_pko_status_t cvmx_pko_send_packet_finish( | |||
418 | * @port: Port to send it on | 418 | * @port: Port to send it on |
419 | * @queue: Queue to use | 419 | * @queue: Queue to use |
420 | * @pko_command: | 420 | * @pko_command: |
421 | * PKO HW command word | 421 | * PKO HW command word |
422 | * @packet: Packet to send | 422 | * @packet: Packet to send |
423 | * @addr: Plysical address of a work queue entry or physical address | 423 | * @addr: Plysical address of a work queue entry or physical address |
424 | * to zero on complete. | 424 | * to zero on complete. |
425 | * @use_locking: CVMX_PKO_LOCK_NONE, CVMX_PKO_LOCK_ATOMIC_TAG, or | 425 | * @use_locking: CVMX_PKO_LOCK_NONE, CVMX_PKO_LOCK_ATOMIC_TAG, or |
426 | * CVMX_PKO_LOCK_CMD_QUEUE | 426 | * CVMX_PKO_LOCK_CMD_QUEUE |
427 | * | 427 | * |
428 | * Returns returns CVMX_PKO_SUCCESS on success, or error code on | 428 | * Returns returns CVMX_PKO_SUCCESS on success, or error code on |
429 | * failure of output | 429 | * failure of output |
@@ -588,7 +588,7 @@ static inline void cvmx_pko_get_port_status(uint64_t port_num, uint64_t clear, | |||
588 | * @port: Port to rate limit | 588 | * @port: Port to rate limit |
589 | * @packets_s: Maximum packet/sec | 589 | * @packets_s: Maximum packet/sec |
590 | * @burst: Maximum number of packets to burst in a row before rate | 590 | * @burst: Maximum number of packets to burst in a row before rate |
591 | * limiting cuts in. | 591 | * limiting cuts in. |
592 | * | 592 | * |
593 | * Returns Zero on success, negative on failure | 593 | * Returns Zero on success, negative on failure |
594 | */ | 594 | */ |
@@ -601,7 +601,7 @@ extern int cvmx_pko_rate_limit_packets(int port, int packets_s, int burst); | |||
601 | * @port: Port to rate limit | 601 | * @port: Port to rate limit |
602 | * @bits_s: PKO rate limit in bits/sec | 602 | * @bits_s: PKO rate limit in bits/sec |
603 | * @burst: Maximum number of bits to burst before rate | 603 | * @burst: Maximum number of bits to burst before rate |
604 | * limiting cuts in. | 604 | * limiting cuts in. |
605 | * | 605 | * |
606 | * Returns Zero on success, negative on failure | 606 | * Returns Zero on success, negative on failure |
607 | */ | 607 | */ |
diff --git a/arch/mips/include/asm/octeon/cvmx-pow.h b/arch/mips/include/asm/octeon/cvmx-pow.h index 92742b241a51..4b4d0ecfd9eb 100644 --- a/arch/mips/include/asm/octeon/cvmx-pow.h +++ b/arch/mips/include/asm/octeon/cvmx-pow.h | |||
@@ -70,7 +70,7 @@ enum cvmx_pow_tag_type { | |||
70 | * The work queue entry from the order - NEVER tag switch from | 70 | * The work queue entry from the order - NEVER tag switch from |
71 | * NULL to NULL | 71 | * NULL to NULL |
72 | */ | 72 | */ |
73 | CVMX_POW_TAG_TYPE_NULL = 2L, | 73 | CVMX_POW_TAG_TYPE_NULL = 2L, |
74 | /* A tag switch to NULL, and there is no space reserved in POW | 74 | /* A tag switch to NULL, and there is no space reserved in POW |
75 | * - NEVER tag switch to NULL_NULL | 75 | * - NEVER tag switch to NULL_NULL |
76 | * - NEVER tag switch from NULL_NULL | 76 | * - NEVER tag switch from NULL_NULL |
@@ -90,7 +90,7 @@ typedef enum { | |||
90 | } cvmx_pow_wait_t; | 90 | } cvmx_pow_wait_t; |
91 | 91 | ||
92 | /** | 92 | /** |
93 | * POW tag operations. These are used in the data stored to the POW. | 93 | * POW tag operations. These are used in the data stored to the POW. |
94 | */ | 94 | */ |
95 | typedef enum { | 95 | typedef enum { |
96 | /* | 96 | /* |
@@ -341,14 +341,14 @@ typedef union { | |||
341 | * lists. The two memory-input queue lists associated | 341 | * lists. The two memory-input queue lists associated |
342 | * with each QOS level are: | 342 | * with each QOS level are: |
343 | * | 343 | * |
344 | * - qosgrp = 0, qosgrp = 8: QOS0 | 344 | * - qosgrp = 0, qosgrp = 8: QOS0 |
345 | * - qosgrp = 1, qosgrp = 9: QOS1 | 345 | * - qosgrp = 1, qosgrp = 9: QOS1 |
346 | * - qosgrp = 2, qosgrp = 10: QOS2 | 346 | * - qosgrp = 2, qosgrp = 10: QOS2 |
347 | * - qosgrp = 3, qosgrp = 11: QOS3 | 347 | * - qosgrp = 3, qosgrp = 11: QOS3 |
348 | * - qosgrp = 4, qosgrp = 12: QOS4 | 348 | * - qosgrp = 4, qosgrp = 12: QOS4 |
349 | * - qosgrp = 5, qosgrp = 13: QOS5 | 349 | * - qosgrp = 5, qosgrp = 13: QOS5 |
350 | * - qosgrp = 6, qosgrp = 14: QOS6 | 350 | * - qosgrp = 6, qosgrp = 14: QOS6 |
351 | * - qosgrp = 7, qosgrp = 15: QOS7 | 351 | * - qosgrp = 7, qosgrp = 15: QOS7 |
352 | */ | 352 | */ |
353 | uint64_t qosgrp:4; | 353 | uint64_t qosgrp:4; |
354 | /* | 354 | /* |
@@ -942,11 +942,11 @@ typedef union { | |||
942 | * operations. | 942 | * operations. |
943 | * | 943 | * |
944 | * NOTE: The following is the behavior of the pending switch bit at the PP | 944 | * NOTE: The following is the behavior of the pending switch bit at the PP |
945 | * for POW stores (i.e. when did<7:3> == 0xc) | 945 | * for POW stores (i.e. when did<7:3> == 0xc) |
946 | * - did<2:0> == 0 => pending switch bit is set | 946 | * - did<2:0> == 0 => pending switch bit is set |
947 | * - did<2:0> == 1 => no affect on the pending switch bit | 947 | * - did<2:0> == 1 => no affect on the pending switch bit |
948 | * - did<2:0> == 3 => pending switch bit is cleared | 948 | * - did<2:0> == 3 => pending switch bit is cleared |
949 | * - did<2:0> == 7 => no affect on the pending switch bit | 949 | * - did<2:0> == 7 => no affect on the pending switch bit |
950 | * - did<2:0> == others => must not be used | 950 | * - did<2:0> == others => must not be used |
951 | * - No other loads/stores have an affect on the pending switch bit | 951 | * - No other loads/stores have an affect on the pending switch bit |
952 | * - The switch bus from POW can clear the pending switch bit | 952 | * - The switch bus from POW can clear the pending switch bit |
@@ -1053,7 +1053,7 @@ static inline cvmx_wqe_t *cvmx_pow_get_current_wqp(void) | |||
1053 | } | 1053 | } |
1054 | 1054 | ||
1055 | #ifndef CVMX_MF_CHORD | 1055 | #ifndef CVMX_MF_CHORD |
1056 | #define CVMX_MF_CHORD(dest) CVMX_RDHWR(dest, 30) | 1056 | #define CVMX_MF_CHORD(dest) CVMX_RDHWR(dest, 30) |
1057 | #endif | 1057 | #endif |
1058 | 1058 | ||
1059 | /** | 1059 | /** |
@@ -1097,7 +1097,7 @@ static inline void cvmx_pow_tag_sw_wait(void) | |||
1097 | * so the caller must ensure that there is not a pending tag switch. | 1097 | * so the caller must ensure that there is not a pending tag switch. |
1098 | * | 1098 | * |
1099 | * @wait: When set, call stalls until work becomes avaiable, or times out. | 1099 | * @wait: When set, call stalls until work becomes avaiable, or times out. |
1100 | * If not set, returns immediately. | 1100 | * If not set, returns immediately. |
1101 | * | 1101 | * |
1102 | * Returns Returns the WQE pointer from POW. Returns NULL if no work | 1102 | * Returns Returns the WQE pointer from POW. Returns NULL if no work |
1103 | * was available. | 1103 | * was available. |
@@ -1131,7 +1131,7 @@ static inline cvmx_wqe_t *cvmx_pow_work_request_sync_nocheck(cvmx_pow_wait_t | |||
1131 | * requesting the new work. | 1131 | * requesting the new work. |
1132 | * | 1132 | * |
1133 | * @wait: When set, call stalls until work becomes avaiable, or times out. | 1133 | * @wait: When set, call stalls until work becomes avaiable, or times out. |
1134 | * If not set, returns immediately. | 1134 | * If not set, returns immediately. |
1135 | * | 1135 | * |
1136 | * Returns Returns the WQE pointer from POW. Returns NULL if no work | 1136 | * Returns Returns the WQE pointer from POW. Returns NULL if no work |
1137 | * was available. | 1137 | * was available. |
@@ -1148,7 +1148,7 @@ static inline cvmx_wqe_t *cvmx_pow_work_request_sync(cvmx_pow_wait_t wait) | |||
1148 | } | 1148 | } |
1149 | 1149 | ||
1150 | /** | 1150 | /** |
1151 | * Synchronous null_rd request. Requests a switch out of NULL_NULL POW state. | 1151 | * Synchronous null_rd request. Requests a switch out of NULL_NULL POW state. |
1152 | * This function waits for any previous tag switch to complete before | 1152 | * This function waits for any previous tag switch to complete before |
1153 | * requesting the null_rd. | 1153 | * requesting the null_rd. |
1154 | * | 1154 | * |
@@ -1183,11 +1183,11 @@ static inline enum cvmx_pow_tag_type cvmx_pow_work_request_null_rd(void) | |||
1183 | * there is not a pending tag switch. | 1183 | * there is not a pending tag switch. |
1184 | * | 1184 | * |
1185 | * @scr_addr: Scratch memory address that response will be returned | 1185 | * @scr_addr: Scratch memory address that response will be returned |
1186 | * to, which is either a valid WQE, or a response with the | 1186 | * to, which is either a valid WQE, or a response with the |
1187 | * invalid bit set. Byte address, must be 8 byte aligned. | 1187 | * invalid bit set. Byte address, must be 8 byte aligned. |
1188 | * | 1188 | * |
1189 | * @wait: 1 to cause response to wait for work to become available (or | 1189 | * @wait: 1 to cause response to wait for work to become available (or |
1190 | * timeout), 0 to cause response to return immediately | 1190 | * timeout), 0 to cause response to return immediately |
1191 | */ | 1191 | */ |
1192 | static inline void cvmx_pow_work_request_async_nocheck(int scr_addr, | 1192 | static inline void cvmx_pow_work_request_async_nocheck(int scr_addr, |
1193 | cvmx_pow_wait_t wait) | 1193 | cvmx_pow_wait_t wait) |
@@ -1212,11 +1212,11 @@ static inline void cvmx_pow_work_request_async_nocheck(int scr_addr, | |||
1212 | * tag switch to complete before requesting the new work. | 1212 | * tag switch to complete before requesting the new work. |
1213 | * | 1213 | * |
1214 | * @scr_addr: Scratch memory address that response will be returned | 1214 | * @scr_addr: Scratch memory address that response will be returned |
1215 | * to, which is either a valid WQE, or a response with the | 1215 | * to, which is either a valid WQE, or a response with the |
1216 | * invalid bit set. Byte address, must be 8 byte aligned. | 1216 | * invalid bit set. Byte address, must be 8 byte aligned. |
1217 | * | 1217 | * |
1218 | * @wait: 1 to cause response to wait for work to become available (or | 1218 | * @wait: 1 to cause response to wait for work to become available (or |
1219 | * timeout), 0 to cause response to return immediately | 1219 | * timeout), 0 to cause response to return immediately |
1220 | */ | 1220 | */ |
1221 | static inline void cvmx_pow_work_request_async(int scr_addr, | 1221 | static inline void cvmx_pow_work_request_async(int scr_addr, |
1222 | cvmx_pow_wait_t wait) | 1222 | cvmx_pow_wait_t wait) |
@@ -1234,7 +1234,7 @@ static inline void cvmx_pow_work_request_async(int scr_addr, | |||
1234 | * to wait for the response. | 1234 | * to wait for the response. |
1235 | * | 1235 | * |
1236 | * @scr_addr: Scratch memory address to get result from Byte address, | 1236 | * @scr_addr: Scratch memory address to get result from Byte address, |
1237 | * must be 8 byte aligned. | 1237 | * must be 8 byte aligned. |
1238 | * | 1238 | * |
1239 | * Returns Returns the WQE from the scratch register, or NULL if no | 1239 | * Returns Returns the WQE from the scratch register, or NULL if no |
1240 | * work was available. | 1240 | * work was available. |
@@ -1260,7 +1260,7 @@ static inline cvmx_wqe_t *cvmx_pow_work_response_async(int scr_addr) | |||
1260 | * @wqe_ptr: pointer to a work queue entry returned by the POW | 1260 | * @wqe_ptr: pointer to a work queue entry returned by the POW |
1261 | * | 1261 | * |
1262 | * Returns 0 if pointer is valid | 1262 | * Returns 0 if pointer is valid |
1263 | * 1 if invalid (no work was returned) | 1263 | * 1 if invalid (no work was returned) |
1264 | */ | 1264 | */ |
1265 | static inline uint64_t cvmx_pow_work_invalid(cvmx_wqe_t *wqe_ptr) | 1265 | static inline uint64_t cvmx_pow_work_invalid(cvmx_wqe_t *wqe_ptr) |
1266 | { | 1266 | { |
@@ -1314,7 +1314,7 @@ static inline void cvmx_pow_tag_sw_nocheck(uint32_t tag, | |||
1314 | /* | 1314 | /* |
1315 | * Note that WQE in DRAM is not updated here, as the POW does | 1315 | * Note that WQE in DRAM is not updated here, as the POW does |
1316 | * not read from DRAM once the WQE is in flight. See hardware | 1316 | * not read from DRAM once the WQE is in flight. See hardware |
1317 | * manual for complete details. It is the application's | 1317 | * manual for complete details. It is the application's |
1318 | * responsibility to keep track of the current tag value if | 1318 | * responsibility to keep track of the current tag value if |
1319 | * that is important. | 1319 | * that is important. |
1320 | */ | 1320 | */ |
@@ -1361,7 +1361,7 @@ static inline void cvmx_pow_tag_sw(uint32_t tag, | |||
1361 | /* | 1361 | /* |
1362 | * Note that WQE in DRAM is not updated here, as the POW does | 1362 | * Note that WQE in DRAM is not updated here, as the POW does |
1363 | * not read from DRAM once the WQE is in flight. See hardware | 1363 | * not read from DRAM once the WQE is in flight. See hardware |
1364 | * manual for complete details. It is the application's | 1364 | * manual for complete details. It is the application's |
1365 | * responsibility to keep track of the current tag value if | 1365 | * responsibility to keep track of the current tag value if |
1366 | * that is important. | 1366 | * that is important. |
1367 | */ | 1367 | */ |
@@ -1390,7 +1390,7 @@ static inline void cvmx_pow_tag_sw(uint32_t tag, | |||
1390 | * previous tag switch has completed. | 1390 | * previous tag switch has completed. |
1391 | * | 1391 | * |
1392 | * @wqp: pointer to work queue entry to submit. This entry is | 1392 | * @wqp: pointer to work queue entry to submit. This entry is |
1393 | * updated to match the other parameters | 1393 | * updated to match the other parameters |
1394 | * @tag: tag value to be assigned to work queue entry | 1394 | * @tag: tag value to be assigned to work queue entry |
1395 | * @tag_type: type of tag | 1395 | * @tag_type: type of tag |
1396 | * @group: group value for the work queue entry. | 1396 | * @group: group value for the work queue entry. |
@@ -1429,7 +1429,7 @@ static inline void cvmx_pow_tag_sw_full_nocheck(cvmx_wqe_t *wqp, uint32_t tag, | |||
1429 | /* | 1429 | /* |
1430 | * Note that WQE in DRAM is not updated here, as the POW does | 1430 | * Note that WQE in DRAM is not updated here, as the POW does |
1431 | * not read from DRAM once the WQE is in flight. See hardware | 1431 | * not read from DRAM once the WQE is in flight. See hardware |
1432 | * manual for complete details. It is the application's | 1432 | * manual for complete details. It is the application's |
1433 | * responsibility to keep track of the current tag value if | 1433 | * responsibility to keep track of the current tag value if |
1434 | * that is important. | 1434 | * that is important. |
1435 | */ | 1435 | */ |
@@ -1468,10 +1468,10 @@ static inline void cvmx_pow_tag_sw_full_nocheck(cvmx_wqe_t *wqp, uint32_t tag, | |||
1468 | * before requesting the tag switch. | 1468 | * before requesting the tag switch. |
1469 | * | 1469 | * |
1470 | * @wqp: pointer to work queue entry to submit. This entry is updated | 1470 | * @wqp: pointer to work queue entry to submit. This entry is updated |
1471 | * to match the other parameters | 1471 | * to match the other parameters |
1472 | * @tag: tag value to be assigned to work queue entry | 1472 | * @tag: tag value to be assigned to work queue entry |
1473 | * @tag_type: type of tag | 1473 | * @tag_type: type of tag |
1474 | * @group: group value for the work queue entry. | 1474 | * @group: group value for the work queue entry. |
1475 | */ | 1475 | */ |
1476 | static inline void cvmx_pow_tag_sw_full(cvmx_wqe_t *wqp, uint32_t tag, | 1476 | static inline void cvmx_pow_tag_sw_full(cvmx_wqe_t *wqp, uint32_t tag, |
1477 | enum cvmx_pow_tag_type tag_type, | 1477 | enum cvmx_pow_tag_type tag_type, |
@@ -1560,7 +1560,7 @@ static inline void cvmx_pow_tag_sw_null(void) | |||
1560 | * unrelated to the tag that the core currently holds. | 1560 | * unrelated to the tag that the core currently holds. |
1561 | * | 1561 | * |
1562 | * @wqp: pointer to work queue entry to submit. This entry is | 1562 | * @wqp: pointer to work queue entry to submit. This entry is |
1563 | * updated to match the other parameters | 1563 | * updated to match the other parameters |
1564 | * @tag: tag value to be assigned to work queue entry | 1564 | * @tag: tag value to be assigned to work queue entry |
1565 | * @tag_type: type of tag | 1565 | * @tag_type: type of tag |
1566 | * @qos: Input queue to add to. | 1566 | * @qos: Input queue to add to. |
@@ -1592,7 +1592,7 @@ static inline void cvmx_pow_work_submit(cvmx_wqe_t *wqp, uint32_t tag, | |||
1592 | ptr.sio.offset = cvmx_ptr_to_phys(wqp); | 1592 | ptr.sio.offset = cvmx_ptr_to_phys(wqp); |
1593 | 1593 | ||
1594 | /* | 1594 | /* |
1595 | * SYNC write to memory before the work submit. This is | 1595 | * SYNC write to memory before the work submit. This is |
1596 | * necessary as POW may read values from DRAM at this time. | 1596 | * necessary as POW may read values from DRAM at this time. |
1597 | */ | 1597 | */ |
1598 | CVMX_SYNCWS; | 1598 | CVMX_SYNCWS; |
@@ -1604,11 +1604,11 @@ static inline void cvmx_pow_work_submit(cvmx_wqe_t *wqp, uint32_t tag, | |||
1604 | * indicates which groups each core will accept work from. There are | 1604 | * indicates which groups each core will accept work from. There are |
1605 | * 16 groups. | 1605 | * 16 groups. |
1606 | * | 1606 | * |
1607 | * @core_num: core to apply mask to | 1607 | * @core_num: core to apply mask to |
1608 | * @mask: Group mask. There are 16 groups, so only bits 0-15 are valid, | 1608 | * @mask: Group mask. There are 16 groups, so only bits 0-15 are valid, |
1609 | * representing groups 0-15. | 1609 | * representing groups 0-15. |
1610 | * Each 1 bit in the mask enables the core to accept work from | 1610 | * Each 1 bit in the mask enables the core to accept work from |
1611 | * the corresponding group. | 1611 | * the corresponding group. |
1612 | */ | 1612 | */ |
1613 | static inline void cvmx_pow_set_group_mask(uint64_t core_num, uint64_t mask) | 1613 | static inline void cvmx_pow_set_group_mask(uint64_t core_num, uint64_t mask) |
1614 | { | 1614 | { |
@@ -1623,14 +1623,14 @@ static inline void cvmx_pow_set_group_mask(uint64_t core_num, uint64_t mask) | |||
1623 | * This function sets POW static priorities for a core. Each input queue has | 1623 | * This function sets POW static priorities for a core. Each input queue has |
1624 | * an associated priority value. | 1624 | * an associated priority value. |
1625 | * | 1625 | * |
1626 | * @core_num: core to apply priorities to | 1626 | * @core_num: core to apply priorities to |
1627 | * @priority: Vector of 8 priorities, one per POW Input Queue (0-7). | 1627 | * @priority: Vector of 8 priorities, one per POW Input Queue (0-7). |
1628 | * Highest priority is 0 and lowest is 7. A priority value | 1628 | * Highest priority is 0 and lowest is 7. A priority value |
1629 | * of 0xF instructs POW to skip the Input Queue when | 1629 | * of 0xF instructs POW to skip the Input Queue when |
1630 | * scheduling to this specific core. | 1630 | * scheduling to this specific core. |
1631 | * NOTE: priorities should not have gaps in values, meaning | 1631 | * NOTE: priorities should not have gaps in values, meaning |
1632 | * {0,1,1,1,1,1,1,1} is a valid configuration while | 1632 | * {0,1,1,1,1,1,1,1} is a valid configuration while |
1633 | * {0,2,2,2,2,2,2,2} is not. | 1633 | * {0,2,2,2,2,2,2,2} is not. |
1634 | */ | 1634 | */ |
1635 | static inline void cvmx_pow_set_priority(uint64_t core_num, | 1635 | static inline void cvmx_pow_set_priority(uint64_t core_num, |
1636 | const uint8_t priority[]) | 1636 | const uint8_t priority[]) |
@@ -1708,8 +1708,8 @@ static inline void cvmx_pow_set_priority(uint64_t core_num, | |||
1708 | * @tag_type: New tag type | 1708 | * @tag_type: New tag type |
1709 | * @group: New group value | 1709 | * @group: New group value |
1710 | * @no_sched: Control whether this work queue entry will be rescheduled. | 1710 | * @no_sched: Control whether this work queue entry will be rescheduled. |
1711 | * - 1 : don't schedule this work | 1711 | * - 1 : don't schedule this work |
1712 | * - 0 : allow this work to be scheduled. | 1712 | * - 0 : allow this work to be scheduled. |
1713 | */ | 1713 | */ |
1714 | static inline void cvmx_pow_tag_sw_desched_nocheck( | 1714 | static inline void cvmx_pow_tag_sw_desched_nocheck( |
1715 | uint32_t tag, | 1715 | uint32_t tag, |
@@ -1794,8 +1794,8 @@ static inline void cvmx_pow_tag_sw_desched_nocheck( | |||
1794 | * @tag_type: New tag type | 1794 | * @tag_type: New tag type |
1795 | * @group: New group value | 1795 | * @group: New group value |
1796 | * @no_sched: Control whether this work queue entry will be rescheduled. | 1796 | * @no_sched: Control whether this work queue entry will be rescheduled. |
1797 | * - 1 : don't schedule this work | 1797 | * - 1 : don't schedule this work |
1798 | * - 0 : allow this work to be scheduled. | 1798 | * - 0 : allow this work to be scheduled. |
1799 | */ | 1799 | */ |
1800 | static inline void cvmx_pow_tag_sw_desched(uint32_t tag, | 1800 | static inline void cvmx_pow_tag_sw_desched(uint32_t tag, |
1801 | enum cvmx_pow_tag_type tag_type, | 1801 | enum cvmx_pow_tag_type tag_type, |
@@ -1819,8 +1819,8 @@ static inline void cvmx_pow_tag_sw_desched(uint32_t tag, | |||
1819 | * Descchedules the current work queue entry. | 1819 | * Descchedules the current work queue entry. |
1820 | * | 1820 | * |
1821 | * @no_sched: no schedule flag value to be set on the work queue | 1821 | * @no_sched: no schedule flag value to be set on the work queue |
1822 | * entry. If this is set the entry will not be | 1822 | * entry. If this is set the entry will not be |
1823 | * rescheduled. | 1823 | * rescheduled. |
1824 | */ | 1824 | */ |
1825 | static inline void cvmx_pow_desched(uint64_t no_sched) | 1825 | static inline void cvmx_pow_desched(uint64_t no_sched) |
1826 | { | 1826 | { |
@@ -1863,7 +1863,7 @@ static inline void cvmx_pow_desched(uint64_t no_sched) | |||
1863 | *****************************************************/ | 1863 | *****************************************************/ |
1864 | 1864 | ||
1865 | /* | 1865 | /* |
1866 | * Number of bits of the tag used by software. The SW bits are always | 1866 | * Number of bits of the tag used by software. The SW bits are always |
1867 | * a contiguous block of the high starting at bit 31. The hardware | 1867 | * a contiguous block of the high starting at bit 31. The hardware |
1868 | * bits are always the low bits. By default, the top 8 bits of the | 1868 | * bits are always the low bits. By default, the top 8 bits of the |
1869 | * tag are reserved for software, and the low 24 are set by the IPD | 1869 | * tag are reserved for software, and the low 24 are set by the IPD |
@@ -1890,7 +1890,7 @@ static inline void cvmx_pow_desched(uint64_t no_sched) | |||
1890 | * are defined here. | 1890 | * are defined here. |
1891 | */ | 1891 | */ |
1892 | /* Mask for the value portion of the tag */ | 1892 | /* Mask for the value portion of the tag */ |
1893 | #define CVMX_TAG_SUBGROUP_MASK 0xFFFF | 1893 | #define CVMX_TAG_SUBGROUP_MASK 0xFFFF |
1894 | #define CVMX_TAG_SUBGROUP_SHIFT 16 | 1894 | #define CVMX_TAG_SUBGROUP_SHIFT 16 |
1895 | #define CVMX_TAG_SUBGROUP_PKO 0x1 | 1895 | #define CVMX_TAG_SUBGROUP_PKO 0x1 |
1896 | 1896 | ||
@@ -1905,12 +1905,12 @@ static inline void cvmx_pow_desched(uint64_t no_sched) | |||
1905 | * This function creates a 32 bit tag value from the two values provided. | 1905 | * This function creates a 32 bit tag value from the two values provided. |
1906 | * | 1906 | * |
1907 | * @sw_bits: The upper bits (number depends on configuration) are set | 1907 | * @sw_bits: The upper bits (number depends on configuration) are set |
1908 | * to this value. The remainder of bits are set by the | 1908 | * to this value. The remainder of bits are set by the |
1909 | * hw_bits parameter. | 1909 | * hw_bits parameter. |
1910 | * | 1910 | * |
1911 | * @hw_bits: The lower bits (number depends on configuration) are set | 1911 | * @hw_bits: The lower bits (number depends on configuration) are set |
1912 | * to this value. The remainder of bits are set by the | 1912 | * to this value. The remainder of bits are set by the |
1913 | * sw_bits parameter. | 1913 | * sw_bits parameter. |
1914 | * | 1914 | * |
1915 | * Returns 32 bit value of the combined hw and sw bits. | 1915 | * Returns 32 bit value of the combined hw and sw bits. |
1916 | */ | 1916 | */ |
@@ -1957,7 +1957,7 @@ static inline uint32_t cvmx_pow_tag_get_hw_bits(uint64_t tag) | |||
1957 | * | 1957 | * |
1958 | * @buffer: Buffer to store capture into | 1958 | * @buffer: Buffer to store capture into |
1959 | * @buffer_size: | 1959 | * @buffer_size: |
1960 | * The size of the supplied buffer | 1960 | * The size of the supplied buffer |
1961 | * | 1961 | * |
1962 | * Returns Zero on success, negative on failure | 1962 | * Returns Zero on success, negative on failure |
1963 | */ | 1963 | */ |
@@ -1968,7 +1968,7 @@ extern int cvmx_pow_capture(void *buffer, int buffer_size); | |||
1968 | * | 1968 | * |
1969 | * @buffer: POW capture from cvmx_pow_capture() | 1969 | * @buffer: POW capture from cvmx_pow_capture() |
1970 | * @buffer_size: | 1970 | * @buffer_size: |
1971 | * Size of the buffer | 1971 | * Size of the buffer |
1972 | */ | 1972 | */ |
1973 | extern void cvmx_pow_display(void *buffer, int buffer_size); | 1973 | extern void cvmx_pow_display(void *buffer, int buffer_size); |
1974 | 1974 | ||
diff --git a/arch/mips/include/asm/octeon/cvmx-scratch.h b/arch/mips/include/asm/octeon/cvmx-scratch.h index 96b70cfd6245..8d21cc5e4e40 100644 --- a/arch/mips/include/asm/octeon/cvmx-scratch.h +++ b/arch/mips/include/asm/octeon/cvmx-scratch.h | |||
@@ -39,7 +39,7 @@ | |||
39 | * Note: This define must be a long, not a long long in order to | 39 | * Note: This define must be a long, not a long long in order to |
40 | * compile without warnings for both 32bit and 64bit. | 40 | * compile without warnings for both 32bit and 64bit. |
41 | */ | 41 | */ |
42 | #define CVMX_SCRATCH_BASE (-32768l) /* 0xffffffffffff8000 */ | 42 | #define CVMX_SCRATCH_BASE (-32768l) /* 0xffffffffffff8000 */ |
43 | 43 | ||
44 | /** | 44 | /** |
45 | * Reads an 8 bit value from the processor local scratchpad memory. | 45 | * Reads an 8 bit value from the processor local scratchpad memory. |
diff --git a/arch/mips/include/asm/octeon/cvmx-spi.h b/arch/mips/include/asm/octeon/cvmx-spi.h index 3bf53b537bcf..d5038cc4b475 100644 --- a/arch/mips/include/asm/octeon/cvmx-spi.h +++ b/arch/mips/include/asm/octeon/cvmx-spi.h | |||
@@ -84,11 +84,11 @@ static inline int cvmx_spi_is_spi_interface(int interface) | |||
84 | * Initialize and start the SPI interface. | 84 | * Initialize and start the SPI interface. |
85 | * | 85 | * |
86 | * @interface: The identifier of the packet interface to configure and | 86 | * @interface: The identifier of the packet interface to configure and |
87 | * use as a SPI interface. | 87 | * use as a SPI interface. |
88 | * @mode: The operating mode for the SPI interface. The interface | 88 | * @mode: The operating mode for the SPI interface. The interface |
89 | * can operate as a full duplex (both Tx and Rx data paths | 89 | * can operate as a full duplex (both Tx and Rx data paths |
90 | * active) or as a halfplex (either the Tx data path is | 90 | * active) or as a halfplex (either the Tx data path is |
91 | * active or the Rx data path is active, but not both). | 91 | * active or the Rx data path is active, but not both). |
92 | * @timeout: Timeout to wait for clock synchronization in seconds | 92 | * @timeout: Timeout to wait for clock synchronization in seconds |
93 | * @num_ports: Number of SPI ports to configure | 93 | * @num_ports: Number of SPI ports to configure |
94 | * | 94 | * |
@@ -102,11 +102,11 @@ extern int cvmx_spi_start_interface(int interface, cvmx_spi_mode_t mode, | |||
102 | * with its corespondant system. | 102 | * with its corespondant system. |
103 | * | 103 | * |
104 | * @interface: The identifier of the packet interface to configure and | 104 | * @interface: The identifier of the packet interface to configure and |
105 | * use as a SPI interface. | 105 | * use as a SPI interface. |
106 | * @mode: The operating mode for the SPI interface. The interface | 106 | * @mode: The operating mode for the SPI interface. The interface |
107 | * can operate as a full duplex (both Tx and Rx data paths | 107 | * can operate as a full duplex (both Tx and Rx data paths |
108 | * active) or as a halfplex (either the Tx data path is | 108 | * active) or as a halfplex (either the Tx data path is |
109 | * active or the Rx data path is active, but not both). | 109 | * active or the Rx data path is active, but not both). |
110 | * @timeout: Timeout to wait for clock synchronization in seconds | 110 | * @timeout: Timeout to wait for clock synchronization in seconds |
111 | * Returns Zero on success, negative of failure. | 111 | * Returns Zero on success, negative of failure. |
112 | */ | 112 | */ |
@@ -154,7 +154,7 @@ static inline union cvmx_gmxx_rxx_rx_inbnd cvmx_spi4000_check_speed( | |||
154 | /** | 154 | /** |
155 | * Get current SPI4 initialization callbacks | 155 | * Get current SPI4 initialization callbacks |
156 | * | 156 | * |
157 | * @callbacks: Pointer to the callbacks structure.to fill | 157 | * @callbacks: Pointer to the callbacks structure.to fill |
158 | * | 158 | * |
159 | * Returns Pointer to cvmx_spi_callbacks_t structure. | 159 | * Returns Pointer to cvmx_spi_callbacks_t structure. |
160 | */ | 160 | */ |
@@ -171,11 +171,11 @@ extern void cvmx_spi_set_callbacks(cvmx_spi_callbacks_t *new_callbacks); | |||
171 | * Callback to perform SPI4 reset | 171 | * Callback to perform SPI4 reset |
172 | * | 172 | * |
173 | * @interface: The identifier of the packet interface to configure and | 173 | * @interface: The identifier of the packet interface to configure and |
174 | * use as a SPI interface. | 174 | * use as a SPI interface. |
175 | * @mode: The operating mode for the SPI interface. The interface | 175 | * @mode: The operating mode for the SPI interface. The interface |
176 | * can operate as a full duplex (both Tx and Rx data paths | 176 | * can operate as a full duplex (both Tx and Rx data paths |
177 | * active) or as a halfplex (either the Tx data path is | 177 | * active) or as a halfplex (either the Tx data path is |
178 | * active or the Rx data path is active, but not both). | 178 | * active or the Rx data path is active, but not both). |
179 | * | 179 | * |
180 | * Returns Zero on success, non-zero error code on failure (will cause | 180 | * Returns Zero on success, non-zero error code on failure (will cause |
181 | * SPI initialization to abort) | 181 | * SPI initialization to abort) |
@@ -187,11 +187,11 @@ extern int cvmx_spi_reset_cb(int interface, cvmx_spi_mode_t mode); | |||
187 | * detection | 187 | * detection |
188 | * | 188 | * |
189 | * @interface: The identifier of the packet interface to configure and | 189 | * @interface: The identifier of the packet interface to configure and |
190 | * use as a SPI interface. | 190 | * use as a SPI interface. |
191 | * @mode: The operating mode for the SPI interface. The interface | 191 | * @mode: The operating mode for the SPI interface. The interface |
192 | * can operate as a full duplex (both Tx and Rx data paths | 192 | * can operate as a full duplex (both Tx and Rx data paths |
193 | * active) or as a halfplex (either the Tx data path is | 193 | * active) or as a halfplex (either the Tx data path is |
194 | * active or the Rx data path is active, but not both). | 194 | * active or the Rx data path is active, but not both). |
195 | * @num_ports: Number of ports to configure on SPI | 195 | * @num_ports: Number of ports to configure on SPI |
196 | * | 196 | * |
197 | * Returns Zero on success, non-zero error code on failure (will cause | 197 | * Returns Zero on success, non-zero error code on failure (will cause |
@@ -204,11 +204,11 @@ extern int cvmx_spi_calendar_setup_cb(int interface, cvmx_spi_mode_t mode, | |||
204 | * Callback to perform clock detection | 204 | * Callback to perform clock detection |
205 | * | 205 | * |
206 | * @interface: The identifier of the packet interface to configure and | 206 | * @interface: The identifier of the packet interface to configure and |
207 | * use as a SPI interface. | 207 | * use as a SPI interface. |
208 | * @mode: The operating mode for the SPI interface. The interface | 208 | * @mode: The operating mode for the SPI interface. The interface |
209 | * can operate as a full duplex (both Tx and Rx data paths | 209 | * can operate as a full duplex (both Tx and Rx data paths |
210 | * active) or as a halfplex (either the Tx data path is | 210 | * active) or as a halfplex (either the Tx data path is |
211 | * active or the Rx data path is active, but not both). | 211 | * active or the Rx data path is active, but not both). |
212 | * @timeout: Timeout to wait for clock synchronization in seconds | 212 | * @timeout: Timeout to wait for clock synchronization in seconds |
213 | * | 213 | * |
214 | * Returns Zero on success, non-zero error code on failure (will cause | 214 | * Returns Zero on success, non-zero error code on failure (will cause |
@@ -221,11 +221,11 @@ extern int cvmx_spi_clock_detect_cb(int interface, cvmx_spi_mode_t mode, | |||
221 | * Callback to perform link training | 221 | * Callback to perform link training |
222 | * | 222 | * |
223 | * @interface: The identifier of the packet interface to configure and | 223 | * @interface: The identifier of the packet interface to configure and |
224 | * use as a SPI interface. | 224 | * use as a SPI interface. |
225 | * @mode: The operating mode for the SPI interface. The interface | 225 | * @mode: The operating mode for the SPI interface. The interface |
226 | * can operate as a full duplex (both Tx and Rx data paths | 226 | * can operate as a full duplex (both Tx and Rx data paths |
227 | * active) or as a halfplex (either the Tx data path is | 227 | * active) or as a halfplex (either the Tx data path is |
228 | * active or the Rx data path is active, but not both). | 228 | * active or the Rx data path is active, but not both). |
229 | * @timeout: Timeout to wait for link to be trained (in seconds) | 229 | * @timeout: Timeout to wait for link to be trained (in seconds) |
230 | * | 230 | * |
231 | * Returns Zero on success, non-zero error code on failure (will cause | 231 | * Returns Zero on success, non-zero error code on failure (will cause |
@@ -238,11 +238,11 @@ extern int cvmx_spi_training_cb(int interface, cvmx_spi_mode_t mode, | |||
238 | * Callback to perform calendar data synchronization | 238 | * Callback to perform calendar data synchronization |
239 | * | 239 | * |
240 | * @interface: The identifier of the packet interface to configure and | 240 | * @interface: The identifier of the packet interface to configure and |
241 | * use as a SPI interface. | 241 | * use as a SPI interface. |
242 | * @mode: The operating mode for the SPI interface. The interface | 242 | * @mode: The operating mode for the SPI interface. The interface |
243 | * can operate as a full duplex (both Tx and Rx data paths | 243 | * can operate as a full duplex (both Tx and Rx data paths |
244 | * active) or as a halfplex (either the Tx data path is | 244 | * active) or as a halfplex (either the Tx data path is |
245 | * active or the Rx data path is active, but not both). | 245 | * active or the Rx data path is active, but not both). |
246 | * @timeout: Timeout to wait for calendar data in seconds | 246 | * @timeout: Timeout to wait for calendar data in seconds |
247 | * | 247 | * |
248 | * Returns Zero on success, non-zero error code on failure (will cause | 248 | * Returns Zero on success, non-zero error code on failure (will cause |
@@ -255,11 +255,11 @@ extern int cvmx_spi_calendar_sync_cb(int interface, cvmx_spi_mode_t mode, | |||
255 | * Callback to handle interface up | 255 | * Callback to handle interface up |
256 | * | 256 | * |
257 | * @interface: The identifier of the packet interface to configure and | 257 | * @interface: The identifier of the packet interface to configure and |
258 | * use as a SPI interface. | 258 | * use as a SPI interface. |
259 | * @mode: The operating mode for the SPI interface. The interface | 259 | * @mode: The operating mode for the SPI interface. The interface |
260 | * can operate as a full duplex (both Tx and Rx data paths | 260 | * can operate as a full duplex (both Tx and Rx data paths |
261 | * active) or as a halfplex (either the Tx data path is | 261 | * active) or as a halfplex (either the Tx data path is |
262 | * active or the Rx data path is active, but not both). | 262 | * active or the Rx data path is active, but not both). |
263 | * | 263 | * |
264 | * Returns Zero on success, non-zero error code on failure (will cause | 264 | * Returns Zero on success, non-zero error code on failure (will cause |
265 | * SPI initialization to abort) | 265 | * SPI initialization to abort) |
diff --git a/arch/mips/include/asm/octeon/cvmx-spinlock.h b/arch/mips/include/asm/octeon/cvmx-spinlock.h index a672abb1bc4f..4f09cff8b8c0 100644 --- a/arch/mips/include/asm/octeon/cvmx-spinlock.h +++ b/arch/mips/include/asm/octeon/cvmx-spinlock.h | |||
@@ -26,7 +26,7 @@ | |||
26 | ***********************license end**************************************/ | 26 | ***********************license end**************************************/ |
27 | 27 | ||
28 | /** | 28 | /** |
29 | * Implementation of spinlocks for Octeon CVMX. Although similar in | 29 | * Implementation of spinlocks for Octeon CVMX. Although similar in |
30 | * function to Linux kernel spinlocks, they are not compatible. | 30 | * function to Linux kernel spinlocks, they are not compatible. |
31 | * Octeon CVMX spinlocks are only used to synchronize with the boot | 31 | * Octeon CVMX spinlocks are only used to synchronize with the boot |
32 | * monitor and other non-Linux programs running in the system. | 32 | * monitor and other non-Linux programs running in the system. |
@@ -50,8 +50,8 @@ typedef struct { | |||
50 | } cvmx_spinlock_t; | 50 | } cvmx_spinlock_t; |
51 | 51 | ||
52 | /* note - macros not expanded in inline ASM, so values hardcoded */ | 52 | /* note - macros not expanded in inline ASM, so values hardcoded */ |
53 | #define CVMX_SPINLOCK_UNLOCKED_VAL 0 | 53 | #define CVMX_SPINLOCK_UNLOCKED_VAL 0 |
54 | #define CVMX_SPINLOCK_LOCKED_VAL 1 | 54 | #define CVMX_SPINLOCK_LOCKED_VAL 1 |
55 | 55 | ||
56 | #define CVMX_SPINLOCK_UNLOCKED_INITIALIZER {CVMX_SPINLOCK_UNLOCKED_VAL} | 56 | #define CVMX_SPINLOCK_UNLOCKED_INITIALIZER {CVMX_SPINLOCK_UNLOCKED_VAL} |
57 | 57 | ||
@@ -96,7 +96,7 @@ static inline void cvmx_spinlock_unlock(cvmx_spinlock_t *lock) | |||
96 | * @lock: pointer to lock structure | 96 | * @lock: pointer to lock structure |
97 | * | 97 | * |
98 | * Returns 0: lock successfully taken | 98 | * Returns 0: lock successfully taken |
99 | * 1: lock not taken, held by someone else | 99 | * 1: lock not taken, held by someone else |
100 | * These return values match the Linux semantics. | 100 | * These return values match the Linux semantics. |
101 | */ | 101 | */ |
102 | 102 | ||
@@ -104,16 +104,16 @@ static inline unsigned int cvmx_spinlock_trylock(cvmx_spinlock_t *lock) | |||
104 | { | 104 | { |
105 | unsigned int tmp; | 105 | unsigned int tmp; |
106 | 106 | ||
107 | __asm__ __volatile__(".set noreorder \n" | 107 | __asm__ __volatile__(".set noreorder \n" |
108 | "1: ll %[tmp], %[val] \n" | 108 | "1: ll %[tmp], %[val] \n" |
109 | /* if lock held, fail immediately */ | 109 | /* if lock held, fail immediately */ |
110 | " bnez %[tmp], 2f \n" | 110 | " bnez %[tmp], 2f \n" |
111 | " li %[tmp], 1 \n" | 111 | " li %[tmp], 1 \n" |
112 | " sc %[tmp], %[val] \n" | 112 | " sc %[tmp], %[val] \n" |
113 | " beqz %[tmp], 1b \n" | 113 | " beqz %[tmp], 1b \n" |
114 | " li %[tmp], 0 \n" | 114 | " li %[tmp], 0 \n" |
115 | "2: \n" | 115 | "2: \n" |
116 | ".set reorder \n" : | 116 | ".set reorder \n" : |
117 | [val] "+m"(lock->value), [tmp] "=&r"(tmp) | 117 | [val] "+m"(lock->value), [tmp] "=&r"(tmp) |
118 | : : "memory"); | 118 | : : "memory"); |
119 | 119 | ||
@@ -129,14 +129,14 @@ static inline void cvmx_spinlock_lock(cvmx_spinlock_t *lock) | |||
129 | { | 129 | { |
130 | unsigned int tmp; | 130 | unsigned int tmp; |
131 | 131 | ||
132 | __asm__ __volatile__(".set noreorder \n" | 132 | __asm__ __volatile__(".set noreorder \n" |
133 | "1: ll %[tmp], %[val] \n" | 133 | "1: ll %[tmp], %[val] \n" |
134 | " bnez %[tmp], 1b \n" | 134 | " bnez %[tmp], 1b \n" |
135 | " li %[tmp], 1 \n" | 135 | " li %[tmp], 1 \n" |
136 | " sc %[tmp], %[val] \n" | 136 | " sc %[tmp], %[val] \n" |
137 | " beqz %[tmp], 1b \n" | 137 | " beqz %[tmp], 1b \n" |
138 | " nop \n" | 138 | " nop \n" |
139 | ".set reorder \n" : | 139 | ".set reorder \n" : |
140 | [val] "+m"(lock->value), [tmp] "=&r"(tmp) | 140 | [val] "+m"(lock->value), [tmp] "=&r"(tmp) |
141 | : : "memory"); | 141 | : : "memory"); |
142 | 142 | ||
@@ -163,17 +163,17 @@ static inline void cvmx_spinlock_bit_lock(uint32_t *word) | |||
163 | unsigned int tmp; | 163 | unsigned int tmp; |
164 | unsigned int sav; | 164 | unsigned int sav; |
165 | 165 | ||
166 | __asm__ __volatile__(".set noreorder \n" | 166 | __asm__ __volatile__(".set noreorder \n" |
167 | ".set noat \n" | 167 | ".set noat \n" |
168 | "1: ll %[tmp], %[val] \n" | 168 | "1: ll %[tmp], %[val] \n" |
169 | " bbit1 %[tmp], 31, 1b \n" | 169 | " bbit1 %[tmp], 31, 1b \n" |
170 | " li $at, 1 \n" | 170 | " li $at, 1 \n" |
171 | " ins %[tmp], $at, 31, 1 \n" | 171 | " ins %[tmp], $at, 31, 1 \n" |
172 | " sc %[tmp], %[val] \n" | 172 | " sc %[tmp], %[val] \n" |
173 | " beqz %[tmp], 1b \n" | 173 | " beqz %[tmp], 1b \n" |
174 | " nop \n" | 174 | " nop \n" |
175 | ".set at \n" | 175 | ".set at \n" |
176 | ".set reorder \n" : | 176 | ".set reorder \n" : |
177 | [val] "+m"(*word), [tmp] "=&r"(tmp), [sav] "=&r"(sav) | 177 | [val] "+m"(*word), [tmp] "=&r"(tmp), [sav] "=&r"(sav) |
178 | : : "memory"); | 178 | : : "memory"); |
179 | 179 | ||
@@ -187,7 +187,7 @@ static inline void cvmx_spinlock_bit_lock(uint32_t *word) | |||
187 | * | 187 | * |
188 | * @word: word to lock bit 31 of | 188 | * @word: word to lock bit 31 of |
189 | * Returns 0: lock successfully taken | 189 | * Returns 0: lock successfully taken |
190 | * 1: lock not taken, held by someone else | 190 | * 1: lock not taken, held by someone else |
191 | * These return values match the Linux semantics. | 191 | * These return values match the Linux semantics. |
192 | */ | 192 | */ |
193 | static inline unsigned int cvmx_spinlock_bit_trylock(uint32_t *word) | 193 | static inline unsigned int cvmx_spinlock_bit_trylock(uint32_t *word) |
@@ -198,15 +198,15 @@ static inline unsigned int cvmx_spinlock_bit_trylock(uint32_t *word) | |||
198 | ".set noat\n" | 198 | ".set noat\n" |
199 | "1: ll %[tmp], %[val] \n" | 199 | "1: ll %[tmp], %[val] \n" |
200 | /* if lock held, fail immediately */ | 200 | /* if lock held, fail immediately */ |
201 | " bbit1 %[tmp], 31, 2f \n" | 201 | " bbit1 %[tmp], 31, 2f \n" |
202 | " li $at, 1 \n" | 202 | " li $at, 1 \n" |
203 | " ins %[tmp], $at, 31, 1 \n" | 203 | " ins %[tmp], $at, 31, 1 \n" |
204 | " sc %[tmp], %[val] \n" | 204 | " sc %[tmp], %[val] \n" |
205 | " beqz %[tmp], 1b \n" | 205 | " beqz %[tmp], 1b \n" |
206 | " li %[tmp], 0 \n" | 206 | " li %[tmp], 0 \n" |
207 | "2: \n" | 207 | "2: \n" |
208 | ".set at \n" | 208 | ".set at \n" |
209 | ".set reorder \n" : | 209 | ".set reorder \n" : |
210 | [val] "+m"(*word), [tmp] "=&r"(tmp) | 210 | [val] "+m"(*word), [tmp] "=&r"(tmp) |
211 | : : "memory"); | 211 | : : "memory"); |
212 | 212 | ||
diff --git a/arch/mips/include/asm/octeon/cvmx-sysinfo.h b/arch/mips/include/asm/octeon/cvmx-sysinfo.h index 61dd5741afe4..2131197422e5 100644 --- a/arch/mips/include/asm/octeon/cvmx-sysinfo.h +++ b/arch/mips/include/asm/octeon/cvmx-sysinfo.h | |||
@@ -85,7 +85,7 @@ struct cvmx_sysinfo { | |||
85 | char board_serial_number[OCTEON_SERIAL_LEN]; | 85 | char board_serial_number[OCTEON_SERIAL_LEN]; |
86 | /* | 86 | /* |
87 | * Several boards support compact flash on the Octeon boot | 87 | * Several boards support compact flash on the Octeon boot |
88 | * bus. The CF memory spaces may be mapped to different | 88 | * bus. The CF memory spaces may be mapped to different |
89 | * addresses on different boards. These values will be 0 if | 89 | * addresses on different boards. These values will be 0 if |
90 | * CF is not present. Note that these addresses are physical | 90 | * CF is not present. Note that these addresses are physical |
91 | * addresses, and it is up to the application to use the | 91 | * addresses, and it is up to the application to use the |
@@ -123,25 +123,25 @@ extern struct cvmx_sysinfo *cvmx_sysinfo_get(void); | |||
123 | 123 | ||
124 | /** | 124 | /** |
125 | * This function is used in non-simple executive environments (such as | 125 | * This function is used in non-simple executive environments (such as |
126 | * Linux kernel, u-boot, etc.) to configure the minimal fields that | 126 | * Linux kernel, u-boot, etc.) to configure the minimal fields that |
127 | * are required to use simple executive files directly. | 127 | * are required to use simple executive files directly. |
128 | * | 128 | * |
129 | * Locking (if required) must be handled outside of this | 129 | * Locking (if required) must be handled outside of this |
130 | * function | 130 | * function |
131 | * | 131 | * |
132 | * @phy_mem_desc_ptr: Pointer to global physical memory descriptor | 132 | * @phy_mem_desc_ptr: Pointer to global physical memory descriptor |
133 | * (bootmem descriptor) @board_type: Octeon board | 133 | * (bootmem descriptor) @board_type: Octeon board |
134 | * type enumeration | 134 | * type enumeration |
135 | * | 135 | * |
136 | * @board_rev_major: | 136 | * @board_rev_major: |
137 | * Board major revision | 137 | * Board major revision |
138 | * @board_rev_minor: | 138 | * @board_rev_minor: |
139 | * Board minor revision | 139 | * Board minor revision |
140 | * @cpu_clock_hz: | 140 | * @cpu_clock_hz: |
141 | * CPU clock freqency in hertz | 141 | * CPU clock freqency in hertz |
142 | * | 142 | * |
143 | * Returns 0: Failure | 143 | * Returns 0: Failure |
144 | * 1: success | 144 | * 1: success |
145 | */ | 145 | */ |
146 | extern int cvmx_sysinfo_minimal_initialize(void *phy_mem_desc_ptr, | 146 | extern int cvmx_sysinfo_minimal_initialize(void *phy_mem_desc_ptr, |
147 | uint16_t board_type, | 147 | uint16_t board_type, |
diff --git a/arch/mips/include/asm/octeon/cvmx-wqe.h b/arch/mips/include/asm/octeon/cvmx-wqe.h index df762389e271..aa0d3d0de75c 100644 --- a/arch/mips/include/asm/octeon/cvmx-wqe.h +++ b/arch/mips/include/asm/octeon/cvmx-wqe.h | |||
@@ -101,23 +101,23 @@ typedef union { | |||
101 | * - 1 = Malformed L4 | 101 | * - 1 = Malformed L4 |
102 | * - 2 = L4 Checksum Error: the L4 checksum value is | 102 | * - 2 = L4 Checksum Error: the L4 checksum value is |
103 | * - 3 = UDP Length Error: The UDP length field would | 103 | * - 3 = UDP Length Error: The UDP length field would |
104 | * make the UDP data longer than what remains in | 104 | * make the UDP data longer than what remains in |
105 | * the IP packet (as defined by the IP header | 105 | * the IP packet (as defined by the IP header |
106 | * length field). | 106 | * length field). |
107 | * - 4 = Bad L4 Port: either the source or destination | 107 | * - 4 = Bad L4 Port: either the source or destination |
108 | * TCP/UDP port is 0. | 108 | * TCP/UDP port is 0. |
109 | * - 8 = TCP FIN Only: the packet is TCP and only the | 109 | * - 8 = TCP FIN Only: the packet is TCP and only the |
110 | * FIN flag set. | 110 | * FIN flag set. |
111 | * - 9 = TCP No Flags: the packet is TCP and no flags | 111 | * - 9 = TCP No Flags: the packet is TCP and no flags |
112 | * are set. | 112 | * are set. |
113 | * - 10 = TCP FIN RST: the packet is TCP and both FIN | 113 | * - 10 = TCP FIN RST: the packet is TCP and both FIN |
114 | * and RST are set. | 114 | * and RST are set. |
115 | * - 11 = TCP SYN URG: the packet is TCP and both SYN | 115 | * - 11 = TCP SYN URG: the packet is TCP and both SYN |
116 | * and URG are set. | 116 | * and URG are set. |
117 | * - 12 = TCP SYN RST: the packet is TCP and both SYN | 117 | * - 12 = TCP SYN RST: the packet is TCP and both SYN |
118 | * and RST are set. | 118 | * and RST are set. |
119 | * - 13 = TCP SYN FIN: the packet is TCP and both SYN | 119 | * - 13 = TCP SYN FIN: the packet is TCP and both SYN |
120 | * and FIN are set. | 120 | * and FIN are set. |
121 | */ | 121 | */ |
122 | uint64_t L4_error:1; | 122 | uint64_t L4_error:1; |
123 | /* set if the packet is a fragment */ | 123 | /* set if the packet is a fragment */ |
@@ -127,16 +127,16 @@ typedef union { | |||
127 | * failure indicated in err_code below, decode: | 127 | * failure indicated in err_code below, decode: |
128 | * | 128 | * |
129 | * - 1 = Not IP: the IP version field is neither 4 nor | 129 | * - 1 = Not IP: the IP version field is neither 4 nor |
130 | * 6. | 130 | * 6. |
131 | * - 2 = IPv4 Header Checksum Error: the IPv4 header | 131 | * - 2 = IPv4 Header Checksum Error: the IPv4 header |
132 | * has a checksum violation. | 132 | * has a checksum violation. |
133 | * - 3 = IP Malformed Header: the packet is not long | 133 | * - 3 = IP Malformed Header: the packet is not long |
134 | * enough to contain the IP header. | 134 | * enough to contain the IP header. |
135 | * - 4 = IP Malformed: the packet is not long enough | 135 | * - 4 = IP Malformed: the packet is not long enough |
136 | * to contain the bytes indicated by the IP | 136 | * to contain the bytes indicated by the IP |
137 | * header. Pad is allowed. | 137 | * header. Pad is allowed. |
138 | * - 5 = IP TTL Hop: the IPv4 TTL field or the IPv6 | 138 | * - 5 = IP TTL Hop: the IPv4 TTL field or the IPv6 |
139 | * Hop Count field are zero. | 139 | * Hop Count field are zero. |
140 | * - 6 = IP Options | 140 | * - 6 = IP Options |
141 | */ | 141 | */ |
142 | uint64_t IP_exc:1; | 142 | uint64_t IP_exc:1; |
@@ -243,46 +243,46 @@ typedef union { | |||
243 | * decode: | 243 | * decode: |
244 | * | 244 | * |
245 | * - 1 = partial error: a packet was partially | 245 | * - 1 = partial error: a packet was partially |
246 | * received, but internal buffering / bandwidth | 246 | * received, but internal buffering / bandwidth |
247 | * was not adequate to receive the entire | 247 | * was not adequate to receive the entire |
248 | * packet. | 248 | * packet. |
249 | * - 2 = jabber error: the RGMII packet was too large | 249 | * - 2 = jabber error: the RGMII packet was too large |
250 | * and is truncated. | 250 | * and is truncated. |
251 | * - 3 = overrun error: the RGMII packet is longer | 251 | * - 3 = overrun error: the RGMII packet is longer |
252 | * than allowed and had an FCS error. | 252 | * than allowed and had an FCS error. |
253 | * - 4 = oversize error: the RGMII packet is longer | 253 | * - 4 = oversize error: the RGMII packet is longer |
254 | * than allowed. | 254 | * than allowed. |
255 | * - 5 = alignment error: the RGMII packet is not an | 255 | * - 5 = alignment error: the RGMII packet is not an |
256 | * integer number of bytes | 256 | * integer number of bytes |
257 | * and had an FCS error (100M and 10M only). | 257 | * and had an FCS error (100M and 10M only). |
258 | * - 6 = fragment error: the RGMII packet is shorter | 258 | * - 6 = fragment error: the RGMII packet is shorter |
259 | * than allowed and had an FCS error. | 259 | * than allowed and had an FCS error. |
260 | * - 7 = GMX FCS error: the RGMII packet had an FCS | 260 | * - 7 = GMX FCS error: the RGMII packet had an FCS |
261 | * error. | 261 | * error. |
262 | * - 8 = undersize error: the RGMII packet is shorter | 262 | * - 8 = undersize error: the RGMII packet is shorter |
263 | * than allowed. | 263 | * than allowed. |
264 | * - 9 = extend error: the RGMII packet had an extend | 264 | * - 9 = extend error: the RGMII packet had an extend |
265 | * error. | 265 | * error. |
266 | * - 10 = length mismatch error: the RGMII packet had | 266 | * - 10 = length mismatch error: the RGMII packet had |
267 | * a length that did not match the length field | 267 | * a length that did not match the length field |
268 | * in the L2 HDR. | 268 | * in the L2 HDR. |
269 | * - 11 = RGMII RX error/SPI4 DIP4 Error: the RGMII | 269 | * - 11 = RGMII RX error/SPI4 DIP4 Error: the RGMII |
270 | * packet had one or more data reception errors | 270 | * packet had one or more data reception errors |
271 | * (RXERR) or the SPI4 packet had one or more | 271 | * (RXERR) or the SPI4 packet had one or more |
272 | * DIP4 errors. | 272 | * DIP4 errors. |
273 | * - 12 = RGMII skip error/SPI4 Abort Error: the RGMII | 273 | * - 12 = RGMII skip error/SPI4 Abort Error: the RGMII |
274 | * packet was not large enough to cover the | 274 | * packet was not large enough to cover the |
275 | * skipped bytes or the SPI4 packet was | 275 | * skipped bytes or the SPI4 packet was |
276 | * terminated with an About EOPS. | 276 | * terminated with an About EOPS. |
277 | * - 13 = RGMII nibble error/SPI4 Port NXA Error: the | 277 | * - 13 = RGMII nibble error/SPI4 Port NXA Error: the |
278 | * RGMII packet had a studder error (data not | 278 | * RGMII packet had a studder error (data not |
279 | * repeated - 10/100M only) or the SPI4 packet | 279 | * repeated - 10/100M only) or the SPI4 packet |
280 | * was sent to an NXA. | 280 | * was sent to an NXA. |
281 | * - 16 = FCS error: a SPI4.2 packet had an FCS error. | 281 | * - 16 = FCS error: a SPI4.2 packet had an FCS error. |
282 | * - 17 = Skip error: a packet was not large enough to | 282 | * - 17 = Skip error: a packet was not large enough to |
283 | * cover the skipped bytes. | 283 | * cover the skipped bytes. |
284 | * - 18 = L2 header malformed: the packet is not long | 284 | * - 18 = L2 header malformed: the packet is not long |
285 | * enough to contain the L2. | 285 | * enough to contain the L2. |
286 | */ | 286 | */ |
287 | 287 | ||
288 | uint64_t rcv_error:1; | 288 | uint64_t rcv_error:1; |
@@ -309,7 +309,7 @@ typedef struct { | |||
309 | 309 | ||
310 | /***************************************************************** | 310 | /***************************************************************** |
311 | * WORD 0 | 311 | * WORD 0 |
312 | * HW WRITE: the following 64 bits are filled by HW when a packet arrives | 312 | * HW WRITE: the following 64 bits are filled by HW when a packet arrives |
313 | */ | 313 | */ |
314 | 314 | ||
315 | /** | 315 | /** |
@@ -323,14 +323,14 @@ typedef struct { | |||
323 | /** | 323 | /** |
324 | * Next pointer used by hardware for list maintenance. | 324 | * Next pointer used by hardware for list maintenance. |
325 | * May be written/read by HW before the work queue | 325 | * May be written/read by HW before the work queue |
326 | * entry is scheduled to a PP | 326 | * entry is scheduled to a PP |
327 | * (Only 36 bits used in Octeon 1) | 327 | * (Only 36 bits used in Octeon 1) |
328 | */ | 328 | */ |
329 | uint64_t next_ptr:40; | 329 | uint64_t next_ptr:40; |
330 | 330 | ||
331 | /***************************************************************** | 331 | /***************************************************************** |
332 | * WORD 1 | 332 | * WORD 1 |
333 | * HW WRITE: the following 64 bits are filled by HW when a packet arrives | 333 | * HW WRITE: the following 64 bits are filled by HW when a packet arrives |
334 | */ | 334 | */ |
335 | 335 | ||
336 | /** | 336 | /** |
@@ -362,8 +362,8 @@ typedef struct { | |||
362 | 362 | ||
363 | /** | 363 | /** |
364 | * WORD 2 HW WRITE: the following 64-bits are filled in by | 364 | * WORD 2 HW WRITE: the following 64-bits are filled in by |
365 | * hardware when a packet arrives This indicates a variety of | 365 | * hardware when a packet arrives This indicates a variety of |
366 | * status and error conditions. | 366 | * status and error conditions. |
367 | */ | 367 | */ |
368 | cvmx_pip_wqe_word2 word2; | 368 | cvmx_pip_wqe_word2 word2; |
369 | 369 | ||
@@ -373,15 +373,15 @@ typedef struct { | |||
373 | union cvmx_buf_ptr packet_ptr; | 373 | union cvmx_buf_ptr packet_ptr; |
374 | 374 | ||
375 | /** | 375 | /** |
376 | * HW WRITE: octeon will fill in a programmable amount from the | 376 | * HW WRITE: octeon will fill in a programmable amount from the |
377 | * packet, up to (at most, but perhaps less) the amount | 377 | * packet, up to (at most, but perhaps less) the amount |
378 | * needed to fill the work queue entry to 128 bytes | 378 | * needed to fill the work queue entry to 128 bytes |
379 | * | 379 | * |
380 | * If the packet is recognized to be IP, the hardware starts | 380 | * If the packet is recognized to be IP, the hardware starts |
381 | * (except that the IPv4 header is padded for appropriate | 381 | * (except that the IPv4 header is padded for appropriate |
382 | * alignment) writing here where the IP header starts. If the | 382 | * alignment) writing here where the IP header starts. If the |
383 | * packet is not recognized to be IP, the hardware starts | 383 | * packet is not recognized to be IP, the hardware starts |
384 | * writing the beginning of the packet here. | 384 | * writing the beginning of the packet here. |
385 | */ | 385 | */ |
386 | uint8_t packet_data[96]; | 386 | uint8_t packet_data[96]; |
387 | 387 | ||
diff --git a/arch/mips/include/asm/octeon/cvmx.h b/arch/mips/include/asm/octeon/cvmx.h index db58beab6cb2..f991e7701d3d 100644 --- a/arch/mips/include/asm/octeon/cvmx.h +++ b/arch/mips/include/asm/octeon/cvmx.h | |||
@@ -76,14 +76,14 @@ enum cvmx_mips_space { | |||
76 | #endif | 76 | #endif |
77 | 77 | ||
78 | #if CVMX_ENABLE_DEBUG_PRINTS | 78 | #if CVMX_ENABLE_DEBUG_PRINTS |
79 | #define cvmx_dprintf printk | 79 | #define cvmx_dprintf printk |
80 | #else | 80 | #else |
81 | #define cvmx_dprintf(...) {} | 81 | #define cvmx_dprintf(...) {} |
82 | #endif | 82 | #endif |
83 | 83 | ||
84 | #define CVMX_MAX_CORES (16) | 84 | #define CVMX_MAX_CORES (16) |
85 | #define CVMX_CACHE_LINE_SIZE (128) /* In bytes */ | 85 | #define CVMX_CACHE_LINE_SIZE (128) /* In bytes */ |
86 | #define CVMX_CACHE_LINE_MASK (CVMX_CACHE_LINE_SIZE - 1) /* In bytes */ | 86 | #define CVMX_CACHE_LINE_MASK (CVMX_CACHE_LINE_SIZE - 1) /* In bytes */ |
87 | #define CVMX_CACHE_LINE_ALIGNED __attribute__ ((aligned(CVMX_CACHE_LINE_SIZE))) | 87 | #define CVMX_CACHE_LINE_ALIGNED __attribute__ ((aligned(CVMX_CACHE_LINE_SIZE))) |
88 | #define CAST64(v) ((long long)(long)(v)) | 88 | #define CAST64(v) ((long long)(long)(v)) |
89 | #define CASTPTR(type, v) ((type *)(long)(v)) | 89 | #define CASTPTR(type, v) ((type *)(long)(v)) |
@@ -133,8 +133,8 @@ static inline uint64_t cvmx_build_io_address(uint64_t major_did, | |||
133 | * | 133 | * |
134 | * Example: cvmx_build_bits(39,24,value) | 134 | * Example: cvmx_build_bits(39,24,value) |
135 | * <pre> | 135 | * <pre> |
136 | * 6 5 4 3 3 2 1 | 136 | * 6 5 4 3 3 2 1 |
137 | * 3 5 7 9 1 3 5 7 0 | 137 | * 3 5 7 9 1 3 5 7 0 |
138 | * +-------+-------+-------+-------+-------+-------+-------+------+ | 138 | * +-------+-------+-------+-------+-------+-------+-------+------+ |
139 | * 000000000000000000000000___________value000000000000000000000000 | 139 | * 000000000000000000000000___________value000000000000000000000000 |
140 | * </pre> | 140 | * </pre> |
@@ -183,7 +183,7 @@ static inline uint64_t cvmx_ptr_to_phys(void *ptr) | |||
183 | * memory pointer (void *). | 183 | * memory pointer (void *). |
184 | * | 184 | * |
185 | * @physical_address: | 185 | * @physical_address: |
186 | * Hardware physical address to memory | 186 | * Hardware physical address to memory |
187 | * Returns Pointer to memory | 187 | * Returns Pointer to memory |
188 | */ | 188 | */ |
189 | static inline void *cvmx_phys_to_ptr(uint64_t physical_address) | 189 | static inline void *cvmx_phys_to_ptr(uint64_t physical_address) |
@@ -207,10 +207,10 @@ static inline void *cvmx_phys_to_ptr(uint64_t physical_address) | |||
207 | 207 | ||
208 | /* We have a full 64bit ABI. Writing to a 64bit address can be done with | 208 | /* We have a full 64bit ABI. Writing to a 64bit address can be done with |
209 | a simple volatile pointer */ | 209 | a simple volatile pointer */ |
210 | #define CVMX_BUILD_WRITE64(TYPE, ST) \ | 210 | #define CVMX_BUILD_WRITE64(TYPE, ST) \ |
211 | static inline void cvmx_write64_##TYPE(uint64_t addr, TYPE##_t val) \ | 211 | static inline void cvmx_write64_##TYPE(uint64_t addr, TYPE##_t val) \ |
212 | { \ | 212 | { \ |
213 | *CASTPTR(volatile TYPE##_t, addr) = val; \ | 213 | *CASTPTR(volatile TYPE##_t, addr) = val; \ |
214 | } | 214 | } |
215 | 215 | ||
216 | 216 | ||
@@ -221,19 +221,19 @@ static inline void cvmx_write64_##TYPE(uint64_t addr, TYPE##_t val) \ | |||
221 | 221 | ||
222 | /* We have a full 64bit ABI. Writing to a 64bit address can be done with | 222 | /* We have a full 64bit ABI. Writing to a 64bit address can be done with |
223 | a simple volatile pointer */ | 223 | a simple volatile pointer */ |
224 | #define CVMX_BUILD_READ64(TYPE, LT) \ | 224 | #define CVMX_BUILD_READ64(TYPE, LT) \ |
225 | static inline TYPE##_t cvmx_read64_##TYPE(uint64_t addr) \ | 225 | static inline TYPE##_t cvmx_read64_##TYPE(uint64_t addr) \ |
226 | { \ | 226 | { \ |
227 | return *CASTPTR(volatile TYPE##_t, addr); \ | 227 | return *CASTPTR(volatile TYPE##_t, addr); \ |
228 | } | 228 | } |
229 | 229 | ||
230 | 230 | ||
231 | /* The following defines 8 functions for writing to a 64bit address. Each | 231 | /* The following defines 8 functions for writing to a 64bit address. Each |
232 | takes two arguments, the address and the value to write. | 232 | takes two arguments, the address and the value to write. |
233 | cvmx_write64_int64 cvmx_write64_uint64 | 233 | cvmx_write64_int64 cvmx_write64_uint64 |
234 | cvmx_write64_int32 cvmx_write64_uint32 | 234 | cvmx_write64_int32 cvmx_write64_uint32 |
235 | cvmx_write64_int16 cvmx_write64_uint16 | 235 | cvmx_write64_int16 cvmx_write64_uint16 |
236 | cvmx_write64_int8 cvmx_write64_uint8 */ | 236 | cvmx_write64_int8 cvmx_write64_uint8 */ |
237 | CVMX_BUILD_WRITE64(int64, "sd"); | 237 | CVMX_BUILD_WRITE64(int64, "sd"); |
238 | CVMX_BUILD_WRITE64(int32, "sw"); | 238 | CVMX_BUILD_WRITE64(int32, "sw"); |
239 | CVMX_BUILD_WRITE64(int16, "sh"); | 239 | CVMX_BUILD_WRITE64(int16, "sh"); |
@@ -246,10 +246,10 @@ CVMX_BUILD_WRITE64(uint8, "sb"); | |||
246 | 246 | ||
247 | /* The following defines 8 functions for reading from a 64bit address. Each | 247 | /* The following defines 8 functions for reading from a 64bit address. Each |
248 | takes the address as the only argument | 248 | takes the address as the only argument |
249 | cvmx_read64_int64 cvmx_read64_uint64 | 249 | cvmx_read64_int64 cvmx_read64_uint64 |
250 | cvmx_read64_int32 cvmx_read64_uint32 | 250 | cvmx_read64_int32 cvmx_read64_uint32 |
251 | cvmx_read64_int16 cvmx_read64_uint16 | 251 | cvmx_read64_int16 cvmx_read64_uint16 |
252 | cvmx_read64_int8 cvmx_read64_uint8 */ | 252 | cvmx_read64_int8 cvmx_read64_uint8 */ |
253 | CVMX_BUILD_READ64(int64, "ld"); | 253 | CVMX_BUILD_READ64(int64, "ld"); |
254 | CVMX_BUILD_READ64(int32, "lw"); | 254 | CVMX_BUILD_READ64(int32, "lw"); |
255 | CVMX_BUILD_READ64(int16, "lh"); | 255 | CVMX_BUILD_READ64(int16, "lh"); |
@@ -389,7 +389,7 @@ static inline void cvmx_wait(uint64_t cycles) | |||
389 | 389 | ||
390 | /** | 390 | /** |
391 | * Reads a chip global cycle counter. This counts CPU cycles since | 391 | * Reads a chip global cycle counter. This counts CPU cycles since |
392 | * chip reset. The counter is 64 bit. | 392 | * chip reset. The counter is 64 bit. |
393 | * This register does not exist on CN38XX pass 1 silicion | 393 | * This register does not exist on CN38XX pass 1 silicion |
394 | * | 394 | * |
395 | * Returns Global chip cycle count since chip reset. | 395 | * Returns Global chip cycle count since chip reset. |
@@ -453,7 +453,7 @@ static inline uint32_t cvmx_octeon_num_cores(void) | |||
453 | 453 | ||
454 | /** | 454 | /** |
455 | * Read a byte of fuse data | 455 | * Read a byte of fuse data |
456 | * @byte_addr: address to read | 456 | * @byte_addr: address to read |
457 | * | 457 | * |
458 | * Returns fuse value: 0 or 1 | 458 | * Returns fuse value: 0 or 1 |
459 | */ | 459 | */ |
diff --git a/arch/mips/include/asm/octeon/octeon-feature.h b/arch/mips/include/asm/octeon/octeon-feature.h index 8008da2f8779..90e05a8d4b15 100644 --- a/arch/mips/include/asm/octeon/octeon-feature.h +++ b/arch/mips/include/asm/octeon/octeon-feature.h | |||
@@ -35,7 +35,7 @@ | |||
35 | #include <asm/octeon/cvmx-rnm-defs.h> | 35 | #include <asm/octeon/cvmx-rnm-defs.h> |
36 | 36 | ||
37 | enum octeon_feature { | 37 | enum octeon_feature { |
38 | /* CN68XX uses port kinds for packet interface */ | 38 | /* CN68XX uses port kinds for packet interface */ |
39 | OCTEON_FEATURE_PKND, | 39 | OCTEON_FEATURE_PKND, |
40 | /* CN68XX has different fields in word0 - word2 */ | 40 | /* CN68XX has different fields in word0 - word2 */ |
41 | OCTEON_FEATURE_CN68XX_WQE, | 41 | OCTEON_FEATURE_CN68XX_WQE, |
@@ -51,7 +51,7 @@ enum octeon_feature { | |||
51 | OCTEON_FEATURE_DORM_CRYPTO, | 51 | OCTEON_FEATURE_DORM_CRYPTO, |
52 | /* Does this Octeon support PCI express? */ | 52 | /* Does this Octeon support PCI express? */ |
53 | OCTEON_FEATURE_PCIE, | 53 | OCTEON_FEATURE_PCIE, |
54 | /* Does this Octeon support SRIOs */ | 54 | /* Does this Octeon support SRIOs */ |
55 | OCTEON_FEATURE_SRIO, | 55 | OCTEON_FEATURE_SRIO, |
56 | /* Does this Octeon support Interlaken */ | 56 | /* Does this Octeon support Interlaken */ |
57 | OCTEON_FEATURE_ILK, | 57 | OCTEON_FEATURE_ILK, |
@@ -75,7 +75,7 @@ enum octeon_feature { | |||
75 | /* Octeon MDIO block supports clause 45 transactions for 10 | 75 | /* Octeon MDIO block supports clause 45 transactions for 10 |
76 | * Gig support */ | 76 | * Gig support */ |
77 | OCTEON_FEATURE_MDIO_CLAUSE_45, | 77 | OCTEON_FEATURE_MDIO_CLAUSE_45, |
78 | /* | 78 | /* |
79 | * CN52XX and CN56XX used a block named NPEI for PCIe | 79 | * CN52XX and CN56XX used a block named NPEI for PCIe |
80 | * access. Newer chips replaced this with SLI+DPI. | 80 | * access. Newer chips replaced this with SLI+DPI. |
81 | */ | 81 | */ |
@@ -94,10 +94,10 @@ static inline int cvmx_fuse_read(int fuse); | |||
94 | * be kept out of fast path code. | 94 | * be kept out of fast path code. |
95 | * | 95 | * |
96 | * @feature: Feature to check for. This should always be a constant so the | 96 | * @feature: Feature to check for. This should always be a constant so the |
97 | * compiler can remove the switch statement through optimization. | 97 | * compiler can remove the switch statement through optimization. |
98 | * | 98 | * |
99 | * Returns Non zero if the feature exists. Zero if the feature does not | 99 | * Returns Non zero if the feature exists. Zero if the feature does not |
100 | * exist. | 100 | * exist. |
101 | */ | 101 | */ |
102 | static inline int octeon_has_feature(enum octeon_feature feature) | 102 | static inline int octeon_has_feature(enum octeon_feature feature) |
103 | { | 103 | { |
diff --git a/arch/mips/include/asm/octeon/octeon-model.h b/arch/mips/include/asm/octeon/octeon-model.h index 349bb2ba840c..e2c122c6a657 100644 --- a/arch/mips/include/asm/octeon/octeon-model.h +++ b/arch/mips/include/asm/octeon/octeon-model.h | |||
@@ -29,7 +29,7 @@ | |||
29 | 29 | ||
30 | /* | 30 | /* |
31 | * The defines below should be used with the OCTEON_IS_MODEL() macro | 31 | * The defines below should be used with the OCTEON_IS_MODEL() macro |
32 | * to determine what model of chip the software is running on. Models | 32 | * to determine what model of chip the software is running on. Models |
33 | * ending in 'XX' match multiple models (families), while specific | 33 | * ending in 'XX' match multiple models (families), while specific |
34 | * models match only that model. If a pass (revision) is specified, | 34 | * models match only that model. If a pass (revision) is specified, |
35 | * then only that revision will be matched. Care should be taken when | 35 | * then only that revision will be matched. Care should be taken when |
@@ -40,183 +40,183 @@ | |||
40 | * subject to change at anytime without notice. | 40 | * subject to change at anytime without notice. |
41 | * | 41 | * |
42 | * NOTE: only the OCTEON_IS_MODEL() macro/function and the OCTEON_CN* | 42 | * NOTE: only the OCTEON_IS_MODEL() macro/function and the OCTEON_CN* |
43 | * macros should be used outside of this file. All other macros are | 43 | * macros should be used outside of this file. All other macros are |
44 | * for internal use only, and may change without notice. | 44 | * for internal use only, and may change without notice. |
45 | */ | 45 | */ |
46 | 46 | ||
47 | #define OCTEON_FAMILY_MASK 0x00ffff00 | 47 | #define OCTEON_FAMILY_MASK 0x00ffff00 |
48 | 48 | ||
49 | /* Flag bits in top byte */ | 49 | /* Flag bits in top byte */ |
50 | /* Ignores revision in model checks */ | 50 | /* Ignores revision in model checks */ |
51 | #define OM_IGNORE_REVISION 0x01000000 | 51 | #define OM_IGNORE_REVISION 0x01000000 |
52 | /* Check submodels */ | 52 | /* Check submodels */ |
53 | #define OM_CHECK_SUBMODEL 0x02000000 | 53 | #define OM_CHECK_SUBMODEL 0x02000000 |
54 | /* Match all models previous than the one specified */ | 54 | /* Match all models previous than the one specified */ |
55 | #define OM_MATCH_PREVIOUS_MODELS 0x04000000 | 55 | #define OM_MATCH_PREVIOUS_MODELS 0x04000000 |
56 | /* Ignores the minor revison on newer parts */ | 56 | /* Ignores the minor revison on newer parts */ |
57 | #define OM_IGNORE_MINOR_REVISION 0x08000000 | 57 | #define OM_IGNORE_MINOR_REVISION 0x08000000 |
58 | #define OM_FLAG_MASK 0xff000000 | 58 | #define OM_FLAG_MASK 0xff000000 |
59 | 59 | ||
60 | /* Match all cn5XXX Octeon models. */ | 60 | /* Match all cn5XXX Octeon models. */ |
61 | #define OM_MATCH_5XXX_FAMILY_MODELS 0x20000000 | 61 | #define OM_MATCH_5XXX_FAMILY_MODELS 0x20000000 |
62 | /* Match all cn6XXX Octeon models. */ | 62 | /* Match all cn6XXX Octeon models. */ |
63 | #define OM_MATCH_6XXX_FAMILY_MODELS 0x40000000 | 63 | #define OM_MATCH_6XXX_FAMILY_MODELS 0x40000000 |
64 | /* Match all cnf7XXX Octeon models. */ | 64 | /* Match all cnf7XXX Octeon models. */ |
65 | #define OM_MATCH_F7XXX_FAMILY_MODELS 0x80000000 | 65 | #define OM_MATCH_F7XXX_FAMILY_MODELS 0x80000000 |
66 | 66 | ||
67 | /* | 67 | /* |
68 | * CNF7XXX models with new revision encoding | 68 | * CNF7XXX models with new revision encoding |
69 | */ | 69 | */ |
70 | #define OCTEON_CNF71XX_PASS1_0 0x000d9400 | 70 | #define OCTEON_CNF71XX_PASS1_0 0x000d9400 |
71 | 71 | ||
72 | #define OCTEON_CNF71XX (OCTEON_CNF71XX_PASS1_0 | OM_IGNORE_REVISION) | 72 | #define OCTEON_CNF71XX (OCTEON_CNF71XX_PASS1_0 | OM_IGNORE_REVISION) |
73 | #define OCTEON_CNF71XX_PASS1_X (OCTEON_CNF71XX_PASS1_0 | OM_IGNORE_MINOR_REVISION) | 73 | #define OCTEON_CNF71XX_PASS1_X (OCTEON_CNF71XX_PASS1_0 | OM_IGNORE_MINOR_REVISION) |
74 | 74 | ||
75 | /* | 75 | /* |
76 | * CN6XXX models with new revision encoding | 76 | * CN6XXX models with new revision encoding |
77 | */ | 77 | */ |
78 | #define OCTEON_CN68XX_PASS1_0 0x000d9100 | 78 | #define OCTEON_CN68XX_PASS1_0 0x000d9100 |
79 | #define OCTEON_CN68XX_PASS1_1 0x000d9101 | 79 | #define OCTEON_CN68XX_PASS1_1 0x000d9101 |
80 | #define OCTEON_CN68XX_PASS1_2 0x000d9102 | 80 | #define OCTEON_CN68XX_PASS1_2 0x000d9102 |
81 | #define OCTEON_CN68XX_PASS2_0 0x000d9108 | 81 | #define OCTEON_CN68XX_PASS2_0 0x000d9108 |
82 | 82 | ||
83 | #define OCTEON_CN68XX (OCTEON_CN68XX_PASS2_0 | OM_IGNORE_REVISION) | 83 | #define OCTEON_CN68XX (OCTEON_CN68XX_PASS2_0 | OM_IGNORE_REVISION) |
84 | #define OCTEON_CN68XX_PASS1_X (OCTEON_CN68XX_PASS1_0 | OM_IGNORE_MINOR_REVISION) | 84 | #define OCTEON_CN68XX_PASS1_X (OCTEON_CN68XX_PASS1_0 | OM_IGNORE_MINOR_REVISION) |
85 | #define OCTEON_CN68XX_PASS2_X (OCTEON_CN68XX_PASS2_0 | OM_IGNORE_MINOR_REVISION) | 85 | #define OCTEON_CN68XX_PASS2_X (OCTEON_CN68XX_PASS2_0 | OM_IGNORE_MINOR_REVISION) |
86 | 86 | ||
87 | #define OCTEON_CN68XX_PASS1 OCTEON_CN68XX_PASS1_X | 87 | #define OCTEON_CN68XX_PASS1 OCTEON_CN68XX_PASS1_X |
88 | #define OCTEON_CN68XX_PASS2 OCTEON_CN68XX_PASS2_X | 88 | #define OCTEON_CN68XX_PASS2 OCTEON_CN68XX_PASS2_X |
89 | 89 | ||
90 | #define OCTEON_CN66XX_PASS1_0 0x000d9200 | 90 | #define OCTEON_CN66XX_PASS1_0 0x000d9200 |
91 | #define OCTEON_CN66XX_PASS1_2 0x000d9202 | 91 | #define OCTEON_CN66XX_PASS1_2 0x000d9202 |
92 | 92 | ||
93 | #define OCTEON_CN66XX (OCTEON_CN66XX_PASS1_0 | OM_IGNORE_REVISION) | 93 | #define OCTEON_CN66XX (OCTEON_CN66XX_PASS1_0 | OM_IGNORE_REVISION) |
94 | #define OCTEON_CN66XX_PASS1_X (OCTEON_CN66XX_PASS1_0 | OM_IGNORE_MINOR_REVISION) | 94 | #define OCTEON_CN66XX_PASS1_X (OCTEON_CN66XX_PASS1_0 | OM_IGNORE_MINOR_REVISION) |
95 | 95 | ||
96 | #define OCTEON_CN63XX_PASS1_0 0x000d9000 | 96 | #define OCTEON_CN63XX_PASS1_0 0x000d9000 |
97 | #define OCTEON_CN63XX_PASS1_1 0x000d9001 | 97 | #define OCTEON_CN63XX_PASS1_1 0x000d9001 |
98 | #define OCTEON_CN63XX_PASS1_2 0x000d9002 | 98 | #define OCTEON_CN63XX_PASS1_2 0x000d9002 |
99 | #define OCTEON_CN63XX_PASS2_0 0x000d9008 | 99 | #define OCTEON_CN63XX_PASS2_0 0x000d9008 |
100 | #define OCTEON_CN63XX_PASS2_1 0x000d9009 | 100 | #define OCTEON_CN63XX_PASS2_1 0x000d9009 |
101 | #define OCTEON_CN63XX_PASS2_2 0x000d900a | 101 | #define OCTEON_CN63XX_PASS2_2 0x000d900a |
102 | 102 | ||
103 | #define OCTEON_CN63XX (OCTEON_CN63XX_PASS2_0 | OM_IGNORE_REVISION) | 103 | #define OCTEON_CN63XX (OCTEON_CN63XX_PASS2_0 | OM_IGNORE_REVISION) |
104 | #define OCTEON_CN63XX_PASS1_X (OCTEON_CN63XX_PASS1_0 | OM_IGNORE_MINOR_REVISION) | 104 | #define OCTEON_CN63XX_PASS1_X (OCTEON_CN63XX_PASS1_0 | OM_IGNORE_MINOR_REVISION) |
105 | #define OCTEON_CN63XX_PASS2_X (OCTEON_CN63XX_PASS2_0 | OM_IGNORE_MINOR_REVISION) | 105 | #define OCTEON_CN63XX_PASS2_X (OCTEON_CN63XX_PASS2_0 | OM_IGNORE_MINOR_REVISION) |
106 | 106 | ||
107 | #define OCTEON_CN61XX_PASS1_0 0x000d9300 | 107 | #define OCTEON_CN61XX_PASS1_0 0x000d9300 |
108 | 108 | ||
109 | #define OCTEON_CN61XX (OCTEON_CN61XX_PASS1_0 | OM_IGNORE_REVISION) | 109 | #define OCTEON_CN61XX (OCTEON_CN61XX_PASS1_0 | OM_IGNORE_REVISION) |
110 | #define OCTEON_CN61XX_PASS1_X (OCTEON_CN61XX_PASS1_0 | OM_IGNORE_MINOR_REVISION) | 110 | #define OCTEON_CN61XX_PASS1_X (OCTEON_CN61XX_PASS1_0 | OM_IGNORE_MINOR_REVISION) |
111 | 111 | ||
112 | /* | 112 | /* |
113 | * CN5XXX models with new revision encoding | 113 | * CN5XXX models with new revision encoding |
114 | */ | 114 | */ |
115 | #define OCTEON_CN58XX_PASS1_0 0x000d0300 | 115 | #define OCTEON_CN58XX_PASS1_0 0x000d0300 |
116 | #define OCTEON_CN58XX_PASS1_1 0x000d0301 | 116 | #define OCTEON_CN58XX_PASS1_1 0x000d0301 |
117 | #define OCTEON_CN58XX_PASS1_2 0x000d0303 | 117 | #define OCTEON_CN58XX_PASS1_2 0x000d0303 |
118 | #define OCTEON_CN58XX_PASS2_0 0x000d0308 | 118 | #define OCTEON_CN58XX_PASS2_0 0x000d0308 |
119 | #define OCTEON_CN58XX_PASS2_1 0x000d0309 | 119 | #define OCTEON_CN58XX_PASS2_1 0x000d0309 |
120 | #define OCTEON_CN58XX_PASS2_2 0x000d030a | 120 | #define OCTEON_CN58XX_PASS2_2 0x000d030a |
121 | #define OCTEON_CN58XX_PASS2_3 0x000d030b | 121 | #define OCTEON_CN58XX_PASS2_3 0x000d030b |
122 | 122 | ||
123 | #define OCTEON_CN58XX (OCTEON_CN58XX_PASS1_0 | OM_IGNORE_REVISION) | 123 | #define OCTEON_CN58XX (OCTEON_CN58XX_PASS1_0 | OM_IGNORE_REVISION) |
124 | #define OCTEON_CN58XX_PASS1_X (OCTEON_CN58XX_PASS1_0 | OM_IGNORE_MINOR_REVISION) | 124 | #define OCTEON_CN58XX_PASS1_X (OCTEON_CN58XX_PASS1_0 | OM_IGNORE_MINOR_REVISION) |
125 | #define OCTEON_CN58XX_PASS2_X (OCTEON_CN58XX_PASS2_0 | OM_IGNORE_MINOR_REVISION) | 125 | #define OCTEON_CN58XX_PASS2_X (OCTEON_CN58XX_PASS2_0 | OM_IGNORE_MINOR_REVISION) |
126 | #define OCTEON_CN58XX_PASS1 OCTEON_CN58XX_PASS1_X | 126 | #define OCTEON_CN58XX_PASS1 OCTEON_CN58XX_PASS1_X |
127 | #define OCTEON_CN58XX_PASS2 OCTEON_CN58XX_PASS2_X | 127 | #define OCTEON_CN58XX_PASS2 OCTEON_CN58XX_PASS2_X |
128 | 128 | ||
129 | #define OCTEON_CN56XX_PASS1_0 0x000d0400 | 129 | #define OCTEON_CN56XX_PASS1_0 0x000d0400 |
130 | #define OCTEON_CN56XX_PASS1_1 0x000d0401 | 130 | #define OCTEON_CN56XX_PASS1_1 0x000d0401 |
131 | #define OCTEON_CN56XX_PASS2_0 0x000d0408 | 131 | #define OCTEON_CN56XX_PASS2_0 0x000d0408 |
132 | #define OCTEON_CN56XX_PASS2_1 0x000d0409 | 132 | #define OCTEON_CN56XX_PASS2_1 0x000d0409 |
133 | 133 | ||
134 | #define OCTEON_CN56XX (OCTEON_CN56XX_PASS2_0 | OM_IGNORE_REVISION) | 134 | #define OCTEON_CN56XX (OCTEON_CN56XX_PASS2_0 | OM_IGNORE_REVISION) |
135 | #define OCTEON_CN56XX_PASS1_X (OCTEON_CN56XX_PASS1_0 | OM_IGNORE_MINOR_REVISION) | 135 | #define OCTEON_CN56XX_PASS1_X (OCTEON_CN56XX_PASS1_0 | OM_IGNORE_MINOR_REVISION) |
136 | #define OCTEON_CN56XX_PASS2_X (OCTEON_CN56XX_PASS2_0 | OM_IGNORE_MINOR_REVISION) | 136 | #define OCTEON_CN56XX_PASS2_X (OCTEON_CN56XX_PASS2_0 | OM_IGNORE_MINOR_REVISION) |
137 | #define OCTEON_CN56XX_PASS1 OCTEON_CN56XX_PASS1_X | 137 | #define OCTEON_CN56XX_PASS1 OCTEON_CN56XX_PASS1_X |
138 | #define OCTEON_CN56XX_PASS2 OCTEON_CN56XX_PASS2_X | 138 | #define OCTEON_CN56XX_PASS2 OCTEON_CN56XX_PASS2_X |
139 | 139 | ||
140 | #define OCTEON_CN57XX OCTEON_CN56XX | 140 | #define OCTEON_CN57XX OCTEON_CN56XX |
141 | #define OCTEON_CN57XX_PASS1 OCTEON_CN56XX_PASS1 | 141 | #define OCTEON_CN57XX_PASS1 OCTEON_CN56XX_PASS1 |
142 | #define OCTEON_CN57XX_PASS2 OCTEON_CN56XX_PASS2 | 142 | #define OCTEON_CN57XX_PASS2 OCTEON_CN56XX_PASS2 |
143 | 143 | ||
144 | #define OCTEON_CN55XX OCTEON_CN56XX | 144 | #define OCTEON_CN55XX OCTEON_CN56XX |
145 | #define OCTEON_CN55XX_PASS1 OCTEON_CN56XX_PASS1 | 145 | #define OCTEON_CN55XX_PASS1 OCTEON_CN56XX_PASS1 |
146 | #define OCTEON_CN55XX_PASS2 OCTEON_CN56XX_PASS2 | 146 | #define OCTEON_CN55XX_PASS2 OCTEON_CN56XX_PASS2 |
147 | 147 | ||
148 | #define OCTEON_CN54XX OCTEON_CN56XX | 148 | #define OCTEON_CN54XX OCTEON_CN56XX |
149 | #define OCTEON_CN54XX_PASS1 OCTEON_CN56XX_PASS1 | 149 | #define OCTEON_CN54XX_PASS1 OCTEON_CN56XX_PASS1 |
150 | #define OCTEON_CN54XX_PASS2 OCTEON_CN56XX_PASS2 | 150 | #define OCTEON_CN54XX_PASS2 OCTEON_CN56XX_PASS2 |
151 | 151 | ||
152 | #define OCTEON_CN50XX_PASS1_0 0x000d0600 | 152 | #define OCTEON_CN50XX_PASS1_0 0x000d0600 |
153 | 153 | ||
154 | #define OCTEON_CN50XX (OCTEON_CN50XX_PASS1_0 | OM_IGNORE_REVISION) | 154 | #define OCTEON_CN50XX (OCTEON_CN50XX_PASS1_0 | OM_IGNORE_REVISION) |
155 | #define OCTEON_CN50XX_PASS1_X (OCTEON_CN50XX_PASS1_0 | OM_IGNORE_MINOR_REVISION) | 155 | #define OCTEON_CN50XX_PASS1_X (OCTEON_CN50XX_PASS1_0 | OM_IGNORE_MINOR_REVISION) |
156 | #define OCTEON_CN50XX_PASS1 OCTEON_CN50XX_PASS1_X | 156 | #define OCTEON_CN50XX_PASS1 OCTEON_CN50XX_PASS1_X |
157 | 157 | ||
158 | /* | 158 | /* |
159 | * NOTE: Octeon CN5000F model is not identifiable using the | 159 | * NOTE: Octeon CN5000F model is not identifiable using the |
160 | * OCTEON_IS_MODEL() functions, but are treated as CN50XX. | 160 | * OCTEON_IS_MODEL() functions, but are treated as CN50XX. |
161 | */ | 161 | */ |
162 | 162 | ||
163 | #define OCTEON_CN52XX_PASS1_0 0x000d0700 | 163 | #define OCTEON_CN52XX_PASS1_0 0x000d0700 |
164 | #define OCTEON_CN52XX_PASS2_0 0x000d0708 | 164 | #define OCTEON_CN52XX_PASS2_0 0x000d0708 |
165 | 165 | ||
166 | #define OCTEON_CN52XX (OCTEON_CN52XX_PASS2_0 | OM_IGNORE_REVISION) | 166 | #define OCTEON_CN52XX (OCTEON_CN52XX_PASS2_0 | OM_IGNORE_REVISION) |
167 | #define OCTEON_CN52XX_PASS1_X (OCTEON_CN52XX_PASS1_0 | OM_IGNORE_MINOR_REVISION) | 167 | #define OCTEON_CN52XX_PASS1_X (OCTEON_CN52XX_PASS1_0 | OM_IGNORE_MINOR_REVISION) |
168 | #define OCTEON_CN52XX_PASS2_X (OCTEON_CN52XX_PASS2_0 | OM_IGNORE_MINOR_REVISION) | 168 | #define OCTEON_CN52XX_PASS2_X (OCTEON_CN52XX_PASS2_0 | OM_IGNORE_MINOR_REVISION) |
169 | #define OCTEON_CN52XX_PASS1 OCTEON_CN52XX_PASS1_X | 169 | #define OCTEON_CN52XX_PASS1 OCTEON_CN52XX_PASS1_X |
170 | #define OCTEON_CN52XX_PASS2 OCTEON_CN52XX_PASS2_X | 170 | #define OCTEON_CN52XX_PASS2 OCTEON_CN52XX_PASS2_X |
171 | 171 | ||
172 | /* | 172 | /* |
173 | * CN3XXX models with old revision enconding | 173 | * CN3XXX models with old revision enconding |
174 | */ | 174 | */ |
175 | #define OCTEON_CN38XX_PASS1 0x000d0000 | 175 | #define OCTEON_CN38XX_PASS1 0x000d0000 |
176 | #define OCTEON_CN38XX_PASS2 0x000d0001 | 176 | #define OCTEON_CN38XX_PASS2 0x000d0001 |
177 | #define OCTEON_CN38XX_PASS3 0x000d0003 | 177 | #define OCTEON_CN38XX_PASS3 0x000d0003 |
178 | #define OCTEON_CN38XX (OCTEON_CN38XX_PASS3 | OM_IGNORE_REVISION) | 178 | #define OCTEON_CN38XX (OCTEON_CN38XX_PASS3 | OM_IGNORE_REVISION) |
179 | 179 | ||
180 | #define OCTEON_CN36XX OCTEON_CN38XX | 180 | #define OCTEON_CN36XX OCTEON_CN38XX |
181 | #define OCTEON_CN36XX_PASS2 OCTEON_CN38XX_PASS2 | 181 | #define OCTEON_CN36XX_PASS2 OCTEON_CN38XX_PASS2 |
182 | #define OCTEON_CN36XX_PASS3 OCTEON_CN38XX_PASS3 | 182 | #define OCTEON_CN36XX_PASS3 OCTEON_CN38XX_PASS3 |
183 | 183 | ||
184 | /* The OCTEON_CN31XX matches CN31XX models and the CN3020 */ | 184 | /* The OCTEON_CN31XX matches CN31XX models and the CN3020 */ |
185 | #define OCTEON_CN31XX_PASS1 0x000d0100 | 185 | #define OCTEON_CN31XX_PASS1 0x000d0100 |
186 | #define OCTEON_CN31XX_PASS1_1 0x000d0102 | 186 | #define OCTEON_CN31XX_PASS1_1 0x000d0102 |
187 | #define OCTEON_CN31XX (OCTEON_CN31XX_PASS1 | OM_IGNORE_REVISION) | 187 | #define OCTEON_CN31XX (OCTEON_CN31XX_PASS1 | OM_IGNORE_REVISION) |
188 | 188 | ||
189 | /* | 189 | /* |
190 | * This model is only used for internal checks, it is not a valid | 190 | * This model is only used for internal checks, it is not a valid |
191 | * model for the OCTEON_MODEL environment variable. This matches the | 191 | * model for the OCTEON_MODEL environment variable. This matches the |
192 | * CN3010 and CN3005 but NOT the CN3020. | 192 | * CN3010 and CN3005 but NOT the CN3020. |
193 | */ | 193 | */ |
194 | #define OCTEON_CN30XX_PASS1 0x000d0200 | 194 | #define OCTEON_CN30XX_PASS1 0x000d0200 |
195 | #define OCTEON_CN30XX_PASS1_1 0x000d0202 | 195 | #define OCTEON_CN30XX_PASS1_1 0x000d0202 |
196 | #define OCTEON_CN30XX (OCTEON_CN30XX_PASS1 | OM_IGNORE_REVISION) | 196 | #define OCTEON_CN30XX (OCTEON_CN30XX_PASS1 | OM_IGNORE_REVISION) |
197 | 197 | ||
198 | #define OCTEON_CN3005_PASS1 (0x000d0210 | OM_CHECK_SUBMODEL) | 198 | #define OCTEON_CN3005_PASS1 (0x000d0210 | OM_CHECK_SUBMODEL) |
199 | #define OCTEON_CN3005_PASS1_0 (0x000d0210 | OM_CHECK_SUBMODEL) | 199 | #define OCTEON_CN3005_PASS1_0 (0x000d0210 | OM_CHECK_SUBMODEL) |
200 | #define OCTEON_CN3005_PASS1_1 (0x000d0212 | OM_CHECK_SUBMODEL) | 200 | #define OCTEON_CN3005_PASS1_1 (0x000d0212 | OM_CHECK_SUBMODEL) |
201 | #define OCTEON_CN3005 (OCTEON_CN3005_PASS1 | OM_IGNORE_REVISION | OM_CHECK_SUBMODEL) | 201 | #define OCTEON_CN3005 (OCTEON_CN3005_PASS1 | OM_IGNORE_REVISION | OM_CHECK_SUBMODEL) |
202 | 202 | ||
203 | #define OCTEON_CN3010_PASS1 (0x000d0200 | OM_CHECK_SUBMODEL) | 203 | #define OCTEON_CN3010_PASS1 (0x000d0200 | OM_CHECK_SUBMODEL) |
204 | #define OCTEON_CN3010_PASS1_0 (0x000d0200 | OM_CHECK_SUBMODEL) | 204 | #define OCTEON_CN3010_PASS1_0 (0x000d0200 | OM_CHECK_SUBMODEL) |
205 | #define OCTEON_CN3010_PASS1_1 (0x000d0202 | OM_CHECK_SUBMODEL) | 205 | #define OCTEON_CN3010_PASS1_1 (0x000d0202 | OM_CHECK_SUBMODEL) |
206 | #define OCTEON_CN3010 (OCTEON_CN3010_PASS1 | OM_IGNORE_REVISION | OM_CHECK_SUBMODEL) | 206 | #define OCTEON_CN3010 (OCTEON_CN3010_PASS1 | OM_IGNORE_REVISION | OM_CHECK_SUBMODEL) |
207 | 207 | ||
208 | #define OCTEON_CN3020_PASS1 (0x000d0110 | OM_CHECK_SUBMODEL) | 208 | #define OCTEON_CN3020_PASS1 (0x000d0110 | OM_CHECK_SUBMODEL) |
209 | #define OCTEON_CN3020_PASS1_0 (0x000d0110 | OM_CHECK_SUBMODEL) | 209 | #define OCTEON_CN3020_PASS1_0 (0x000d0110 | OM_CHECK_SUBMODEL) |
210 | #define OCTEON_CN3020_PASS1_1 (0x000d0112 | OM_CHECK_SUBMODEL) | 210 | #define OCTEON_CN3020_PASS1_1 (0x000d0112 | OM_CHECK_SUBMODEL) |
211 | #define OCTEON_CN3020 (OCTEON_CN3020_PASS1 | OM_IGNORE_REVISION | OM_CHECK_SUBMODEL) | 211 | #define OCTEON_CN3020 (OCTEON_CN3020_PASS1 | OM_IGNORE_REVISION | OM_CHECK_SUBMODEL) |
212 | 212 | ||
213 | /* | 213 | /* |
214 | * This matches the complete family of CN3xxx CPUs, and not subsequent | 214 | * This matches the complete family of CN3xxx CPUs, and not subsequent |
215 | * models | 215 | * models |
216 | */ | 216 | */ |
217 | #define OCTEON_CN3XXX (OCTEON_CN58XX_PASS1_0 | OM_MATCH_PREVIOUS_MODELS | OM_IGNORE_REVISION) | 217 | #define OCTEON_CN3XXX (OCTEON_CN58XX_PASS1_0 | OM_MATCH_PREVIOUS_MODELS | OM_IGNORE_REVISION) |
218 | #define OCTEON_CN5XXX (OCTEON_CN58XX_PASS1_0 | OM_MATCH_5XXX_FAMILY_MODELS) | 218 | #define OCTEON_CN5XXX (OCTEON_CN58XX_PASS1_0 | OM_MATCH_5XXX_FAMILY_MODELS) |
219 | #define OCTEON_CN6XXX (OCTEON_CN63XX_PASS1_0 | OM_MATCH_6XXX_FAMILY_MODELS) | 219 | #define OCTEON_CN6XXX (OCTEON_CN63XX_PASS1_0 | OM_MATCH_6XXX_FAMILY_MODELS) |
220 | 220 | ||
221 | /* These are used to cover entire families of OCTEON processors */ | 221 | /* These are used to cover entire families of OCTEON processors */ |
222 | #define OCTEON_FAM_1 (OCTEON_CN3XXX) | 222 | #define OCTEON_FAM_1 (OCTEON_CN3XXX) |
@@ -243,18 +243,18 @@ | |||
243 | */ | 243 | */ |
244 | 244 | ||
245 | /* Masks used for the various types of model/family/revision matching */ | 245 | /* Masks used for the various types of model/family/revision matching */ |
246 | #define OCTEON_38XX_FAMILY_MASK 0x00ffff00 | 246 | #define OCTEON_38XX_FAMILY_MASK 0x00ffff00 |
247 | #define OCTEON_38XX_FAMILY_REV_MASK 0x00ffff0f | 247 | #define OCTEON_38XX_FAMILY_REV_MASK 0x00ffff0f |
248 | #define OCTEON_38XX_MODEL_MASK 0x00ffff10 | 248 | #define OCTEON_38XX_MODEL_MASK 0x00ffff10 |
249 | #define OCTEON_38XX_MODEL_REV_MASK (OCTEON_38XX_FAMILY_REV_MASK | OCTEON_38XX_MODEL_MASK) | 249 | #define OCTEON_38XX_MODEL_REV_MASK (OCTEON_38XX_FAMILY_REV_MASK | OCTEON_38XX_MODEL_MASK) |
250 | 250 | ||
251 | /* CN5XXX and later use different layout of bits in the revision ID field */ | 251 | /* CN5XXX and later use different layout of bits in the revision ID field */ |
252 | #define OCTEON_58XX_FAMILY_MASK OCTEON_38XX_FAMILY_MASK | 252 | #define OCTEON_58XX_FAMILY_MASK OCTEON_38XX_FAMILY_MASK |
253 | #define OCTEON_58XX_FAMILY_REV_MASK 0x00ffff3f | 253 | #define OCTEON_58XX_FAMILY_REV_MASK 0x00ffff3f |
254 | #define OCTEON_58XX_MODEL_MASK 0x00ffffc0 | 254 | #define OCTEON_58XX_MODEL_MASK 0x00ffffc0 |
255 | #define OCTEON_58XX_MODEL_REV_MASK (OCTEON_58XX_FAMILY_REV_MASK | OCTEON_58XX_MODEL_MASK) | 255 | #define OCTEON_58XX_MODEL_REV_MASK (OCTEON_58XX_FAMILY_REV_MASK | OCTEON_58XX_MODEL_MASK) |
256 | #define OCTEON_58XX_MODEL_MINOR_REV_MASK (OCTEON_58XX_MODEL_REV_MASK & 0x00fffff8) | 256 | #define OCTEON_58XX_MODEL_MINOR_REV_MASK (OCTEON_58XX_MODEL_REV_MASK & 0x00fffff8) |
257 | #define OCTEON_5XXX_MODEL_MASK 0x00ff0fc0 | 257 | #define OCTEON_5XXX_MODEL_MASK 0x00ff0fc0 |
258 | 258 | ||
259 | /* forward declarations */ | 259 | /* forward declarations */ |
260 | static inline uint32_t cvmx_get_proc_id(void) __attribute__ ((pure)); | 260 | static inline uint32_t cvmx_get_proc_id(void) __attribute__ ((pure)); |
@@ -264,7 +264,7 @@ static inline uint64_t cvmx_read_csr(uint64_t csr_addr); | |||
264 | 264 | ||
265 | /* NOTE: This for internal use only! */ | 265 | /* NOTE: This for internal use only! */ |
266 | #define __OCTEON_IS_MODEL_COMPILE__(arg_model, chip_model) \ | 266 | #define __OCTEON_IS_MODEL_COMPILE__(arg_model, chip_model) \ |
267 | ((((arg_model & OCTEON_38XX_FAMILY_MASK) < OCTEON_CN58XX_PASS1_0) && ( \ | 267 | ((((arg_model & OCTEON_38XX_FAMILY_MASK) < OCTEON_CN58XX_PASS1_0) && ( \ |
268 | ((((arg_model) & (OM_FLAG_MASK)) == (OM_IGNORE_REVISION | OM_CHECK_SUBMODEL)) \ | 268 | ((((arg_model) & (OM_FLAG_MASK)) == (OM_IGNORE_REVISION | OM_CHECK_SUBMODEL)) \ |
269 | && __OCTEON_MATCH_MASK__((chip_model), (arg_model), OCTEON_38XX_MODEL_MASK)) || \ | 269 | && __OCTEON_MATCH_MASK__((chip_model), (arg_model), OCTEON_38XX_MODEL_MASK)) || \ |
270 | ((((arg_model) & (OM_FLAG_MASK)) == 0) \ | 270 | ((((arg_model) & (OM_FLAG_MASK)) == 0) \ |
@@ -276,7 +276,7 @@ static inline uint64_t cvmx_read_csr(uint64_t csr_addr); | |||
276 | ((((arg_model) & (OM_MATCH_PREVIOUS_MODELS)) == OM_MATCH_PREVIOUS_MODELS) \ | 276 | ((((arg_model) & (OM_MATCH_PREVIOUS_MODELS)) == OM_MATCH_PREVIOUS_MODELS) \ |
277 | && (((chip_model) & OCTEON_38XX_MODEL_MASK) < ((arg_model) & OCTEON_38XX_MODEL_MASK))) \ | 277 | && (((chip_model) & OCTEON_38XX_MODEL_MASK) < ((arg_model) & OCTEON_38XX_MODEL_MASK))) \ |
278 | )) || \ | 278 | )) || \ |
279 | (((arg_model & OCTEON_38XX_FAMILY_MASK) >= OCTEON_CN58XX_PASS1_0) && ( \ | 279 | (((arg_model & OCTEON_38XX_FAMILY_MASK) >= OCTEON_CN58XX_PASS1_0) && ( \ |
280 | ((((arg_model) & (OM_FLAG_MASK)) == (OM_IGNORE_REVISION | OM_CHECK_SUBMODEL)) \ | 280 | ((((arg_model) & (OM_FLAG_MASK)) == (OM_IGNORE_REVISION | OM_CHECK_SUBMODEL)) \ |
281 | && __OCTEON_MATCH_MASK__((chip_model), (arg_model), OCTEON_58XX_MODEL_MASK)) || \ | 281 | && __OCTEON_MATCH_MASK__((chip_model), (arg_model), OCTEON_58XX_MODEL_MASK)) || \ |
282 | ((((arg_model) & (OM_FLAG_MASK)) == 0) \ | 282 | ((((arg_model) & (OM_FLAG_MASK)) == 0) \ |
@@ -320,7 +320,7 @@ static inline int __octeon_is_model_runtime__(uint32_t model) | |||
320 | * Use of the macro in preprocessor directives ( #if OCTEON_IS_MODEL(...) ) | 320 | * Use of the macro in preprocessor directives ( #if OCTEON_IS_MODEL(...) ) |
321 | * is NOT SUPPORTED, and should be replaced with CVMX_COMPILED_FOR() | 321 | * is NOT SUPPORTED, and should be replaced with CVMX_COMPILED_FOR() |
322 | * I.e.: | 322 | * I.e.: |
323 | * #if OCTEON_IS_MODEL(OCTEON_CN56XX) -> #if CVMX_COMPILED_FOR(OCTEON_CN56XX) | 323 | * #if OCTEON_IS_MODEL(OCTEON_CN56XX) -> #if CVMX_COMPILED_FOR(OCTEON_CN56XX) |
324 | */ | 324 | */ |
325 | #define OCTEON_IS_MODEL(x) __octeon_is_model_runtime__(x) | 325 | #define OCTEON_IS_MODEL(x) __octeon_is_model_runtime__(x) |
326 | #define OCTEON_IS_COMMON_BINARY() 1 | 326 | #define OCTEON_IS_COMMON_BINARY() 1 |
diff --git a/arch/mips/include/asm/octeon/octeon.h b/arch/mips/include/asm/octeon/octeon.h index 254e9954ed71..a2eed23c49a9 100644 --- a/arch/mips/include/asm/octeon/octeon.h +++ b/arch/mips/include/asm/octeon/octeon.h | |||
@@ -75,15 +75,15 @@ struct octeon_boot_descriptor { | |||
75 | uint32_t argc; | 75 | uint32_t argc; |
76 | uint32_t argv[OCTEON_ARGV_MAX_ARGS]; | 76 | uint32_t argv[OCTEON_ARGV_MAX_ARGS]; |
77 | 77 | ||
78 | #define BOOT_FLAG_INIT_CORE (1 << 0) | 78 | #define BOOT_FLAG_INIT_CORE (1 << 0) |
79 | #define OCTEON_BL_FLAG_DEBUG (1 << 1) | 79 | #define OCTEON_BL_FLAG_DEBUG (1 << 1) |
80 | #define OCTEON_BL_FLAG_NO_MAGIC (1 << 2) | 80 | #define OCTEON_BL_FLAG_NO_MAGIC (1 << 2) |
81 | /* If set, use uart1 for console */ | 81 | /* If set, use uart1 for console */ |
82 | #define OCTEON_BL_FLAG_CONSOLE_UART1 (1 << 3) | 82 | #define OCTEON_BL_FLAG_CONSOLE_UART1 (1 << 3) |
83 | /* If set, use PCI console */ | 83 | /* If set, use PCI console */ |
84 | #define OCTEON_BL_FLAG_CONSOLE_PCI (1 << 4) | 84 | #define OCTEON_BL_FLAG_CONSOLE_PCI (1 << 4) |
85 | /* Call exit on break on serial port */ | 85 | /* Call exit on break on serial port */ |
86 | #define OCTEON_BL_FLAG_BREAK (1 << 5) | 86 | #define OCTEON_BL_FLAG_BREAK (1 << 5) |
87 | 87 | ||
88 | uint32_t flags; | 88 | uint32_t flags; |
89 | uint32_t core_mask; | 89 | uint32_t core_mask; |
diff --git a/arch/mips/include/asm/octeon/pci-octeon.h b/arch/mips/include/asm/octeon/pci-octeon.h index c66734bd3382..64ba56a02843 100644 --- a/arch/mips/include/asm/octeon/pci-octeon.h +++ b/arch/mips/include/asm/octeon/pci-octeon.h | |||
@@ -22,7 +22,7 @@ | |||
22 | #define CVMX_PCIE_BAR1_PHYS_SIZE (1ull << 28) | 22 | #define CVMX_PCIE_BAR1_PHYS_SIZE (1ull << 28) |
23 | 23 | ||
24 | /* | 24 | /* |
25 | * The RC base of BAR1. gen1 has a 39-bit BAR2, gen2 has 41-bit BAR2, | 25 | * The RC base of BAR1. gen1 has a 39-bit BAR2, gen2 has 41-bit BAR2, |
26 | * place BAR1 so it is the same for both. | 26 | * place BAR1 so it is the same for both. |
27 | */ | 27 | */ |
28 | #define CVMX_PCIE_BAR1_RC_BASE (1ull << 41) | 28 | #define CVMX_PCIE_BAR1_RC_BASE (1ull << 41) |