Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

MIPS: Octeon: Turn hardware bitfields and structures inside out.

Although the proper way to do this for bitfields would be to use
the macro that Ralf has provided, this is a little easier to
understand as a diff.

Signed-off-by: Paul Martin <paul.martin@codethink.co.uk>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/9628/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>

authored by

Paul Martin and committed by
Ralf Baechle
11db04c8 0a1cd2c5

+499
+45
arch/mips/cavium-octeon/executive/cvmx-l2c.c
··· 519 519 union __cvmx_l2c_tag { 520 520 uint64_t u64; 521 521 struct cvmx_l2c_tag_cn50xx { 522 + #ifdef __BIG_ENDIAN_BITFIELD 522 523 uint64_t reserved:40; 523 524 uint64_t V:1; /* Line valid */ 524 525 uint64_t D:1; /* Line dirty */ 525 526 uint64_t L:1; /* Line locked */ 526 527 uint64_t U:1; /* Use, LRU eviction */ 527 528 uint64_t addr:20; /* Phys mem addr (33..14) */ 529 + #else 530 + uint64_t addr:20; /* Phys mem addr (33..14) */ 531 + uint64_t U:1; /* Use, LRU eviction */ 532 + uint64_t L:1; /* Line locked */ 533 + uint64_t D:1; /* Line dirty */ 534 + uint64_t V:1; /* Line valid */ 535 + uint64_t reserved:40; 536 + #endif 528 537 } cn50xx; 529 538 struct cvmx_l2c_tag_cn30xx { 539 + #ifdef __BIG_ENDIAN_BITFIELD 530 540 uint64_t reserved:41; 531 541 uint64_t V:1; /* Line valid */ 532 542 uint64_t D:1; /* Line dirty */ 533 543 uint64_t L:1; /* Line locked */ 534 544 uint64_t U:1; /* Use, LRU eviction */ 535 545 uint64_t addr:19; /* Phys mem addr (33..15) */ 546 + #else 547 + uint64_t addr:19; /* Phys mem addr (33..15) */ 548 + uint64_t U:1; /* Use, LRU eviction */ 549 + uint64_t L:1; /* Line locked */ 550 + uint64_t D:1; /* Line dirty */ 551 + uint64_t V:1; /* Line valid */ 552 + uint64_t reserved:41; 553 + #endif 536 554 } cn30xx; 537 555 struct cvmx_l2c_tag_cn31xx { 556 + #ifdef __BIG_ENDIAN_BITFIELD 538 557 uint64_t reserved:42; 539 558 uint64_t V:1; /* Line valid */ 540 559 uint64_t D:1; /* Line dirty */ 541 560 uint64_t L:1; /* Line locked */ 542 561 uint64_t U:1; /* Use, LRU eviction */ 543 562 uint64_t addr:18; /* Phys mem addr (33..16) */ 563 + #else 564 + uint64_t addr:18; /* Phys mem addr (33..16) */ 565 + uint64_t U:1; /* Use, LRU eviction */ 566 + uint64_t L:1; /* Line locked */ 567 + uint64_t D:1; /* Line dirty */ 568 + uint64_t V:1; /* Line valid */ 569 + uint64_t reserved:42; 570 + #endif 544 571 } cn31xx; 545 572 struct cvmx_l2c_tag_cn38xx { 573 + #ifdef __BIG_ENDIAN_BITFIELD 546 574 uint64_t reserved:43; 547 575 uint64_t V:1; /* Line valid */ 548 576 uint64_t D:1; /* Line dirty */ 549 577 uint64_t L:1; /* Line locked */ 550 578 uint64_t U:1; /* Use, LRU eviction */ 551 579 uint64_t addr:17; /* Phys mem addr (33..17) */ 580 + #else 581 + uint64_t addr:17; /* Phys mem addr (33..17) */ 582 + uint64_t U:1; /* Use, LRU eviction */ 583 + uint64_t L:1; /* Line locked */ 584 + uint64_t D:1; /* Line dirty */ 585 + uint64_t V:1; /* Line valid */ 586 + uint64_t reserved:43; 587 + #endif 552 588 } cn38xx; 553 589 struct cvmx_l2c_tag_cn58xx { 590 + #ifdef __BIG_ENDIAN_BITFIELD 554 591 uint64_t reserved:44; 555 592 uint64_t V:1; /* Line valid */ 556 593 uint64_t D:1; /* Line dirty */ 557 594 uint64_t L:1; /* Line locked */ 558 595 uint64_t U:1; /* Use, LRU eviction */ 559 596 uint64_t addr:16; /* Phys mem addr (33..18) */ 597 + #else 598 + uint64_t addr:16; /* Phys mem addr (33..18) */ 599 + uint64_t U:1; /* Use, LRU eviction */ 600 + uint64_t L:1; /* Line locked */ 601 + uint64_t D:1; /* Line dirty */ 602 + uint64_t V:1; /* Line valid */ 603 + uint64_t reserved:44; 604 + #endif 560 605 } cn58xx; 561 606 struct cvmx_l2c_tag_cn58xx cn56xx; /* 2048 sets */ 562 607 struct cvmx_l2c_tag_cn31xx cn52xx; /* 512 sets */
+67
arch/mips/include/asm/octeon/cvmx-address.h
··· 104 104 typedef union { 105 105 106 106 uint64_t u64; 107 + #ifdef __BIG_ENDIAN_BITFIELD 107 108 /* mapped or unmapped virtual address */ 108 109 struct { 109 110 uint64_t R:2; ··· 203 202 uint64_t didspace:24; 204 203 uint64_t unused:40; 205 204 } sfilldidspace; 205 + #else 206 + struct { 207 + uint64_t offset:62; 208 + uint64_t R:2; 209 + } sva; 210 + 211 + struct { 212 + uint64_t offset:31; 213 + uint64_t zeroes:33; 214 + } suseg; 215 + 216 + struct { 217 + uint64_t offset:29; 218 + uint64_t sp:2; 219 + uint64_t ones:33; 220 + } sxkseg; 221 + 222 + struct { 223 + uint64_t pa:49; 224 + uint64_t mbz:10; 225 + uint64_t cca:3; 226 + uint64_t R:2; 227 + } sxkphys; 228 + 229 + struct { 230 + uint64_t offset:36; 231 + uint64_t unaddr:4; 232 + uint64_t did:8; 233 + uint64_t is_io:1; 234 + uint64_t mbz:15; 235 + } sphys; 236 + 237 + struct { 238 + uint64_t offset:36; 239 + uint64_t unaddr:4; 240 + uint64_t zeroes:24; 241 + } smem; 242 + 243 + struct { 244 + uint64_t offset:36; 245 + uint64_t unaddr:4; 246 + uint64_t did:8; 247 + uint64_t is_io:1; 248 + uint64_t mbz:13; 249 + uint64_t mem_region:2; 250 + } sio; 251 + 252 + struct { 253 + uint64_t addr:13; 254 + cvmx_add_win_dec_t csrdec:2; 255 + uint64_t ones:49; 256 + } sscr; 257 + 258 + struct { 259 + uint64_t addr:7; 260 + uint64_t type:3; 261 + uint64_t unused2:3; 262 + uint64_t csrdec:2; 263 + uint64_t ones:49; 264 + } sdma; 265 + 266 + struct { 267 + uint64_t unused:40; 268 + uint64_t didspace:24; 269 + } sfilldidspace; 270 + #endif 206 271 207 272 } cvmx_addr_t; 208 273
+14
arch/mips/include/asm/octeon/cvmx-bootmem.h
··· 95 95 * positions for backwards compatibility. 96 96 */ 97 97 struct cvmx_bootmem_desc { 98 + #if defined(__BIG_ENDIAN_BITFIELD) || defined(CVMX_BUILD_FOR_LINUX_HOST) 98 99 /* spinlock to control access to list */ 99 100 uint32_t lock; 100 101 /* flags for indicating various conditions */ ··· 121 120 uint32_t named_block_name_len; 122 121 /* address of named memory block descriptors */ 123 122 uint64_t named_block_array_addr; 123 + #else /* __LITTLE_ENDIAN */ 124 + uint32_t flags; 125 + uint32_t lock; 126 + uint64_t head_addr; 124 127 128 + uint32_t minor_version; 129 + uint32_t major_version; 130 + uint64_t app_data_addr; 131 + uint64_t app_data_size; 132 + 133 + uint32_t named_block_name_len; 134 + uint32_t named_block_num_blocks; 135 + uint64_t named_block_array_addr; 136 + #endif 125 137 }; 126 138 127 139 /**
+7
arch/mips/include/asm/octeon/cvmx-fpa.h
··· 49 49 typedef union { 50 50 uint64_t u64; 51 51 struct { 52 + #ifdef __BIG_ENDIAN_BITFIELD 52 53 /* 53 54 * the (64-bit word) location in scratchpad to write 54 55 * to (if len != 0) ··· 64 63 * the NCB bus. 65 64 */ 66 65 uint64_t addr:40; 66 + #else 67 + uint64_t addr:40; 68 + uint64_t did:8; 69 + uint64_t len:8; 70 + uint64_t scraddr:8; 71 + #endif 67 72 } s; 68 73 } cvmx_fpa_iobdma_data_t; 69 74
+9
arch/mips/include/asm/octeon/cvmx-l2c.h
··· 53 53 union cvmx_l2c_tag { 54 54 uint64_t u64; 55 55 struct { 56 + #ifdef __BIG_ENDIAN_BITFIELD 56 57 uint64_t reserved:28; 57 58 uint64_t V:1; /* Line valid */ 58 59 uint64_t D:1; /* Line dirty */ 59 60 uint64_t L:1; /* Line locked */ 60 61 uint64_t U:1; /* Use, LRU eviction */ 61 62 uint64_t addr:32; /* Phys mem (not all bits valid) */ 63 + #else 64 + uint64_t addr:32; /* Phys mem (not all bits valid) */ 65 + uint64_t U:1; /* Use, LRU eviction */ 66 + uint64_t L:1; /* Line locked */ 67 + uint64_t D:1; /* Line dirty */ 68 + uint64_t V:1; /* Line valid */ 69 + uint64_t reserved:28; 70 + #endif 62 71 } s; 63 72 }; 64 73
+8
arch/mips/include/asm/octeon/cvmx-packet.h
··· 39 39 void *ptr; 40 40 uint64_t u64; 41 41 struct { 42 + #ifdef __BIG_ENDIAN_BITFIELD 42 43 /* if set, invert the "free" pick of the overall 43 44 * packet. HW always sets this bit to 0 on inbound 44 45 * packet */ ··· 56 55 uint64_t size:16; 57 56 /* Pointer to the first byte of the data, NOT buffer */ 58 57 uint64_t addr:40; 58 + #else 59 + uint64_t addr:40; 60 + uint64_t size:16; 61 + uint64_t pool:3; 62 + uint64_t back:4; 63 + uint64_t i:1; 64 + #endif 59 65 } s; 60 66 }; 61 67
+31
arch/mips/include/asm/octeon/cvmx-pko.h
··· 127 127 typedef union { 128 128 uint64_t u64; 129 129 struct { 130 + #ifdef __BIG_ENDIAN_BITFIELD 130 131 /* Must CVMX_IO_SEG */ 131 132 uint64_t mem_space:2; 132 133 /* Must be zero */ ··· 152 151 uint64_t queue:9; 153 152 /* Must be zero */ 154 153 uint64_t reserved4:3; 154 + #else 155 + uint64_t reserved4:3; 156 + uint64_t queue:9; 157 + uint64_t port:9; 158 + uint64_t reserved3:15; 159 + uint64_t reserved2:4; 160 + uint64_t did:8; 161 + uint64_t is_io:1; 162 + uint64_t reserved:13; 163 + uint64_t mem_space:2; 164 + #endif 155 165 } s; 156 166 } cvmx_pko_doorbell_address_t; 157 167 ··· 172 160 typedef union { 173 161 uint64_t u64; 174 162 struct { 163 + #ifdef __BIG_ENDIAN_BITFIELD 175 164 /* 176 165 * The size of the reg1 operation - could be 8, 16, 177 166 * 32, or 64 bits. ··· 242 229 uint64_t segs:6; 243 230 /* Including L2, but no trailing CRC */ 244 231 uint64_t total_bytes:16; 232 + #else 233 + uint64_t total_bytes:16; 234 + uint64_t segs:6; 235 + uint64_t dontfree:1; 236 + uint64_t ignore_i:1; 237 + uint64_t ipoffp1:7; 238 + uint64_t gather:1; 239 + uint64_t rsp:1; 240 + uint64_t wqp:1; 241 + uint64_t n2:1; 242 + uint64_t le:1; 243 + uint64_t reg0:11; 244 + uint64_t subone0:1; 245 + uint64_t reg1:11; 246 + uint64_t subone1:1; 247 + uint64_t size0:2; 248 + uint64_t size1:2; 249 + #endif 245 250 } s; 246 251 } cvmx_pko_command_word0_t; 247 252
+247
arch/mips/include/asm/octeon/cvmx-pow.h
··· 178 178 typedef union { 179 179 uint64_t u64; 180 180 struct { 181 + #ifdef __BIG_ENDIAN_BITFIELD 181 182 /* 182 183 * Don't reschedule this entry. no_sched is used for 183 184 * CVMX_POW_TAG_OP_SWTAG_DESCH and ··· 218 217 * CVMX_POW_TAG_OP_*_NSCHED 219 218 */ 220 219 uint64_t tag:32; 220 + #else 221 + uint64_t tag:32; 222 + uint64_t type:3; 223 + uint64_t grp:4; 224 + uint64_t qos:3; 225 + uint64_t unused2:2; 226 + cvmx_pow_tag_op_t op:4; 227 + uint64_t index:13; 228 + uint64_t unused:2; 229 + uint64_t no_sched:1; 230 + #endif 221 231 } s; 222 232 } cvmx_pow_tag_req_t; 223 233 ··· 242 230 * Address for new work request loads (did<2:0> == 0) 243 231 */ 244 232 struct { 233 + #ifdef __BIG_ENDIAN_BITFIELD 245 234 /* Mips64 address region. Should be CVMX_IO_SEG */ 246 235 uint64_t mem_region:2; 247 236 /* Must be zero */ ··· 260 247 uint64_t wait:1; 261 248 /* Must be zero */ 262 249 uint64_t reserved_0_2:3; 250 + #else 251 + uint64_t reserved_0_2:3; 252 + uint64_t wait:1; 253 + uint64_t reserved_4_39:36; 254 + uint64_t did:8; 255 + uint64_t is_io:1; 256 + uint64_t reserved_49_61:13; 257 + uint64_t mem_region:2; 258 + #endif 263 259 } swork; 264 260 265 261 /** 266 262 * Address for loads to get POW internal status 267 263 */ 268 264 struct { 265 + #ifdef __BIG_ENDIAN_BITFIELD 269 266 /* Mips64 address region. Should be CVMX_IO_SEG */ 270 267 uint64_t mem_region:2; 271 268 /* Must be zero */ ··· 305 282 uint64_t get_wqp:1; 306 283 /* Must be zero */ 307 284 uint64_t reserved_0_2:3; 285 + #else 286 + uint64_t reserved_0_2:3; 287 + uint64_t get_wqp:1; 288 + uint64_t get_cur:1; 289 + uint64_t get_rev:1; 290 + uint64_t coreid:4; 291 + uint64_t reserved_10_39:30; 292 + uint64_t did:8; 293 + uint64_t is_io:1; 294 + uint64_t reserved_49_61:13; 295 + uint64_t mem_region:2; 296 + #endif 308 297 } sstatus; 309 298 310 299 /** 311 300 * Address for memory loads to get POW internal state 312 301 */ 313 302 struct { 303 + #ifdef __BIG_ENDIAN_BITFIELD 314 304 /* Mips64 address region. Should be CVMX_IO_SEG */ 315 305 uint64_t mem_region:2; 316 306 /* Must be zero */ ··· 350 314 uint64_t get_wqp:1; 351 315 /* Must be zero */ 352 316 uint64_t reserved_0_2:3; 317 + #else 318 + uint64_t reserved_0_2:3; 319 + uint64_t get_wqp:1; 320 + uint64_t get_des:1; 321 + uint64_t index:11; 322 + uint64_t reserved_16_39:24; 323 + uint64_t did:8; 324 + uint64_t is_io:1; 325 + uint64_t reserved_49_61:13; 326 + uint64_t mem_region:2; 327 + #endif 353 328 } smemload; 354 329 355 330 /** 356 331 * Address for index/pointer loads 357 332 */ 358 333 struct { 334 + #ifdef __BIG_ENDIAN_BITFIELD 359 335 /* Mips64 address region. Should be CVMX_IO_SEG */ 360 336 uint64_t mem_region:2; 361 337 /* Must be zero */ ··· 414 366 uint64_t get_rmt:1; 415 367 /* Must be zero */ 416 368 uint64_t reserved_0_2:3; 369 + #else 370 + uint64_t reserved_0_2:3; 371 + uint64_t get_rmt:1; 372 + uint64_t get_des_get_tail:1; 373 + uint64_t qosgrp:4; 374 + uint64_t reserved_9_39:31; 375 + uint64_t did:8; 376 + uint64_t is_io:1; 377 + uint64_t reserved_49_61:13; 378 + uint64_t mem_region:2; 379 + #endif 417 380 } sindexload; 418 381 419 382 /** ··· 436 377 * available.) 437 378 */ 438 379 struct { 380 + #ifdef __BIG_ENDIAN_BITFIELD 439 381 /* Mips64 address region. Should be CVMX_IO_SEG */ 440 382 uint64_t mem_region:2; 441 383 /* Must be zero */ ··· 447 387 uint64_t did:8; 448 388 /* Must be zero */ 449 389 uint64_t reserved_0_39:40; 390 + #else 391 + uint64_t reserved_0_39:40; 392 + uint64_t did:8; 393 + uint64_t is_io:1; 394 + uint64_t reserved_49_61:13; 395 + uint64_t mem_region:2; 396 + #endif 450 397 } snull_rd; 451 398 } cvmx_pow_load_addr_t; 452 399 ··· 468 401 * Response to new work request loads 469 402 */ 470 403 struct { 404 + #ifdef __BIG_ENDIAN_BITFIELD 471 405 /* 472 406 * Set when no new work queue entry was returned. * 473 407 * If there was de-scheduled work, the HW will ··· 487 419 uint64_t reserved_40_62:23; 488 420 /* 36 in O1 -- the work queue pointer */ 489 421 uint64_t addr:40; 422 + #else 423 + uint64_t addr:40; 424 + uint64_t reserved_40_62:23; 425 + uint64_t no_work:1; 426 + #endif 490 427 } s_work; 491 428 492 429 /** 493 430 * Result for a POW Status Load (when get_cur==0 and get_wqp==0) 494 431 */ 495 432 struct { 433 + #ifdef __BIG_ENDIAN_BITFIELD 496 434 uint64_t reserved_62_63:2; 497 435 /* Set when there is a pending non-NULL SWTAG or 498 436 * SWTAG_FULL, and the POW entry has not left the list ··· 550 476 * AND pend_desched_switch) are set. 551 477 */ 552 478 uint64_t pend_tag:32; 479 + #else 480 + uint64_t pend_tag:32; 481 + uint64_t pend_type:2; 482 + uint64_t reserved_34_35:2; 483 + uint64_t pend_grp:4; 484 + uint64_t pend_index:11; 485 + uint64_t reserved_51:1; 486 + uint64_t pend_nosched_clr:1; 487 + uint64_t pend_null_rd:1; 488 + uint64_t pend_new_work_wait:1; 489 + uint64_t pend_new_work:1; 490 + uint64_t pend_nosched:1; 491 + uint64_t pend_desched_switch:1; 492 + uint64_t pend_desched:1; 493 + uint64_t pend_switch_null:1; 494 + uint64_t pend_switch_full:1; 495 + uint64_t pend_switch:1; 496 + uint64_t reserved_62_63:2; 497 + #endif 553 498 } s_sstatus0; 554 499 555 500 /** 556 501 * Result for a POW Status Load (when get_cur==0 and get_wqp==1) 557 502 */ 558 503 struct { 504 + #ifdef __BIG_ENDIAN_BITFIELD 559 505 uint64_t reserved_62_63:2; 560 506 /* 561 507 * Set when there is a pending non-NULL SWTAG or ··· 623 529 uint64_t pend_grp:4; 624 530 /* This is the wqp when pend_nosched_clr is set. */ 625 531 uint64_t pend_wqp:36; 532 + #else 533 + uint64_t pend_wqp:36; 534 + uint64_t pend_grp:4; 535 + uint64_t pend_index:11; 536 + uint64_t reserved_51:1; 537 + uint64_t pend_nosched_clr:1; 538 + uint64_t pend_null_rd:1; 539 + uint64_t pend_new_work_wait:1; 540 + uint64_t pend_new_work:1; 541 + uint64_t pend_nosched:1; 542 + uint64_t pend_desched_switch:1; 543 + uint64_t pend_desched:1; 544 + uint64_t pend_switch_null:1; 545 + uint64_t pend_switch_full:1; 546 + uint64_t pend_switch:1; 547 + uint64_t reserved_62_63:2; 548 + #endif 626 549 } s_sstatus1; 627 550 628 551 /** ··· 647 536 * get_rev==0) 648 537 */ 649 538 struct { 539 + #ifdef __BIG_ENDIAN_BITFIELD 650 540 uint64_t reserved_62_63:2; 651 541 /* 652 542 * Points to the next POW entry in the tag list when ··· 685 573 * SWTAG_DESCHED). 686 574 */ 687 575 uint64_t tag:32; 576 + #else 577 + uint64_t tag:32; 578 + uint64_t tag_type:2; 579 + uint64_t tail:1; 580 + uint64_t head:1; 581 + uint64_t grp:4; 582 + uint64_t index:11; 583 + uint64_t link_index:11; 584 + uint64_t reserved_62_63:2; 585 + #endif 688 586 } s_sstatus2; 689 587 690 588 /** 691 589 * Result for a POW Status Load (when get_cur==1, get_wqp==0, and get_rev==1) 692 590 */ 693 591 struct { 592 + #ifdef __BIG_ENDIAN_BITFIELD 694 593 uint64_t reserved_62_63:2; 695 594 /* 696 595 * Points to the prior POW entry in the tag list when ··· 740 617 * SWTAG_DESCHED). 741 618 */ 742 619 uint64_t tag:32; 620 + #else 621 + uint64_t tag:32; 622 + uint64_t tag_type:2; 623 + uint64_t tail:1; 624 + uint64_t head:1; 625 + uint64_t grp:4; 626 + uint64_t index:11; 627 + uint64_t revlink_index:11; 628 + uint64_t reserved_62_63:2; 629 + #endif 743 630 } s_sstatus3; 744 631 745 632 /** ··· 757 624 * get_rev==0) 758 625 */ 759 626 struct { 627 + #ifdef __BIG_ENDIAN_BITFIELD 760 628 uint64_t reserved_62_63:2; 761 629 /* 762 630 * Points to the next POW entry in the tag list when ··· 776 642 * list entered on SWTAG_FULL). 777 643 */ 778 644 uint64_t wqp:36; 645 + #else 646 + uint64_t wqp:36; 647 + uint64_t grp:4; 648 + uint64_t index:11; 649 + uint64_t link_index:11; 650 + uint64_t reserved_62_63:2; 651 + #endif 779 652 } s_sstatus4; 780 653 781 654 /** ··· 790 649 * get_rev==1) 791 650 */ 792 651 struct { 652 + #ifdef __BIG_ENDIAN_BITFIELD 793 653 uint64_t reserved_62_63:2; 794 654 /* 795 655 * Points to the prior POW entry in the tag list when ··· 811 669 * list entered on SWTAG_FULL). 812 670 */ 813 671 uint64_t wqp:36; 672 + #else 673 + uint64_t wqp:36; 674 + uint64_t grp:4; 675 + uint64_t index:11; 676 + uint64_t revlink_index:11; 677 + uint64_t reserved_62_63:2; 678 + #endif 814 679 } s_sstatus5; 815 680 816 681 /** 817 682 * Result For POW Memory Load (get_des == 0 and get_wqp == 0) 818 683 */ 819 684 struct { 685 + #ifdef __BIG_ENDIAN_BITFIELD 820 686 uint64_t reserved_51_63:13; 821 687 /* 822 688 * The next entry in the input, free, descheduled_head ··· 845 695 uint64_t tag_type:2; 846 696 /* The tag of the POW entry. */ 847 697 uint64_t tag:32; 698 + #else 699 + uint64_t tag:32; 700 + uint64_t tag_type:2; 701 + uint64_t tail:1; 702 + uint64_t reserved_35:1; 703 + uint64_t grp:4; 704 + uint64_t next_index:11; 705 + uint64_t reserved_51_63:13; 706 + #endif 848 707 } s_smemload0; 849 708 850 709 /** 851 710 * Result For POW Memory Load (get_des == 0 and get_wqp == 1) 852 711 */ 853 712 struct { 713 + #ifdef __BIG_ENDIAN_BITFIELD 854 714 uint64_t reserved_51_63:13; 855 715 /* 856 716 * The next entry in the input, free, descheduled_head ··· 872 712 uint64_t grp:4; 873 713 /* The WQP held in the POW entry. */ 874 714 uint64_t wqp:36; 715 + #else 716 + uint64_t wqp:36; 717 + uint64_t grp:4; 718 + uint64_t next_index:11; 719 + uint64_t reserved_51_63:13; 720 + #endif 875 721 } s_smemload1; 876 722 877 723 /** 878 724 * Result For POW Memory Load (get_des == 1) 879 725 */ 880 726 struct { 727 + #ifdef __BIG_ENDIAN_BITFIELD 881 728 uint64_t reserved_51_63:13; 882 729 /* 883 730 * The next entry in the tag list connected to the ··· 907 740 * is set. 908 741 */ 909 742 uint64_t pend_tag:32; 743 + #else 744 + uint64_t pend_tag:32; 745 + uint64_t pend_type:2; 746 + uint64_t pend_switch:1; 747 + uint64_t nosched:1; 748 + uint64_t grp:4; 749 + uint64_t fwd_index:11; 750 + uint64_t reserved_51_63:13; 751 + #endif 910 752 } s_smemload2; 911 753 912 754 /** 913 755 * Result For POW Index/Pointer Load (get_rmt == 0/get_des_get_tail == 0) 914 756 */ 915 757 struct { 758 + #ifdef __BIG_ENDIAN_BITFIELD 916 759 uint64_t reserved_52_63:12; 917 760 /* 918 761 * set when there is one or more POW entries on the ··· 968 791 * the input Q list selected by qosgrp. 969 792 */ 970 793 uint64_t loc_tail:11; 794 + #else 795 + uint64_t loc_tail:11; 796 + uint64_t reserved_11:1; 797 + uint64_t loc_head:11; 798 + uint64_t reserved_23:1; 799 + uint64_t loc_one:1; 800 + uint64_t loc_val:1; 801 + uint64_t free_tail:11; 802 + uint64_t reserved_37:1; 803 + uint64_t free_head:11; 804 + uint64_t reserved_49:1; 805 + uint64_t free_one:1; 806 + uint64_t free_val:1; 807 + uint64_t reserved_52_63:12; 808 + #endif 971 809 } sindexload0; 972 810 973 811 /** 974 812 * Result For POW Index/Pointer Load (get_rmt == 0/get_des_get_tail == 1) 975 813 */ 976 814 struct { 815 + #ifdef __BIG_ENDIAN_BITFIELD 977 816 uint64_t reserved_52_63:12; 978 817 /* 979 818 * set when there is one or more POW entries on the ··· 1036 843 * head on the descheduled list selected by qosgrp. 1037 844 */ 1038 845 uint64_t des_tail:11; 846 + #else 847 + uint64_t des_tail:11; 848 + uint64_t reserved_11:1; 849 + uint64_t des_head:11; 850 + uint64_t reserved_23:1; 851 + uint64_t des_one:1; 852 + uint64_t des_val:1; 853 + uint64_t nosched_tail:11; 854 + uint64_t reserved_37:1; 855 + uint64_t nosched_head:11; 856 + uint64_t reserved_49:1; 857 + uint64_t nosched_one:1; 858 + uint64_t nosched_val:1; 859 + uint64_t reserved_52_63:12; 860 + #endif 1039 861 } sindexload1; 1040 862 1041 863 /** 1042 864 * Result For POW Index/Pointer Load (get_rmt == 1/get_des_get_tail == 0) 1043 865 */ 1044 866 struct { 867 + #ifdef __BIG_ENDIAN_BITFIELD 1045 868 uint64_t reserved_39_63:25; 1046 869 /* 1047 870 * Set when this DRAM list is the current head ··· 1086 877 * qosgrp. 1087 878 */ 1088 879 uint64_t rmt_head:36; 880 + #else 881 + uint64_t rmt_head:36; 882 + uint64_t rmt_one:1; 883 + uint64_t rmt_val:1; 884 + uint64_t rmt_is_head:1; 885 + uint64_t reserved_39_63:25; 886 + #endif 1089 887 } sindexload2; 1090 888 1091 889 /** ··· 1100 884 * 1/get_des_get_tail == 1) 1101 885 */ 1102 886 struct { 887 + #ifdef __BIG_ENDIAN_BITFIELD 1103 888 uint64_t reserved_39_63:25; 1104 889 /* 1105 890 * set when this DRAM list is the current head ··· 1129 912 * qosgrp. 1130 913 */ 1131 914 uint64_t rmt_tail:36; 915 + #else 916 + uint64_t rmt_tail:36; 917 + uint64_t rmt_one:1; 918 + uint64_t rmt_val:1; 919 + uint64_t rmt_is_head:1; 920 + uint64_t reserved_39_63:25; 921 + #endif 1132 922 } sindexload3; 1133 923 1134 924 /** 1135 925 * Response to NULL_RD request loads 1136 926 */ 1137 927 struct { 928 + #ifdef __BIG_ENDIAN_BITFIELD 1138 929 uint64_t unused:62; 1139 930 /* of type cvmx_pow_tag_type_t. state is one of the 1140 931 * following: ··· 1153 928 * - CVMX_POW_TAG_TYPE_NULL_NULL 1154 929 */ 1155 930 uint64_t state:2; 931 + #else 932 + uint64_t state:2; 933 + uint64_t unused:62; 934 + #endif 1156 935 } s_null_rd; 1157 936 1158 937 } cvmx_pow_tag_load_resp_t; ··· 1191 962 uint64_t u64; 1192 963 1193 964 struct { 965 + #ifdef __BIG_ENDIAN_BITFIELD 1194 966 /* Memory region. Should be CVMX_IO_SEG in most cases */ 1195 967 uint64_t mem_reg:2; 1196 968 uint64_t reserved_49_61:13; /* Must be zero */ ··· 1201 971 uint64_t reserved_36_39:4; /* Must be zero */ 1202 972 /* Address field. addr<2:0> must be zero */ 1203 973 uint64_t addr:36; 974 + #else 975 + uint64_t addr:36; 976 + uint64_t reserved_36_39:4; 977 + uint64_t did:8; 978 + uint64_t is_io:1; 979 + uint64_t reserved_49_61:13; 980 + uint64_t mem_reg:2; 981 + #endif 1204 982 } stag; 1205 983 } cvmx_pow_tag_store_addr_t; 1206 984 ··· 1219 981 uint64_t u64; 1220 982 1221 983 struct { 984 + #ifdef __BIG_ENDIAN_BITFIELD 1222 985 /* 1223 986 * the (64-bit word) location in scratchpad to write 1224 987 * to (if len != 0) ··· 1233 994 /* if set, don't return load response until work is available */ 1234 995 uint64_t wait:1; 1235 996 uint64_t unused2:3; 997 + #else 998 + uint64_t unused2:3; 999 + uint64_t wait:1; 1000 + uint64_t unused:36; 1001 + uint64_t did:8; 1002 + uint64_t len:8; 1003 + uint64_t scraddr:8; 1004 + #endif 1236 1005 } s; 1237 1006 1238 1007 } cvmx_pow_iobdma_store_t;
+71
arch/mips/include/asm/octeon/cvmx-wqe.h
··· 57 57 58 58 /* Use this struct if the hardware determines that the packet is IP */ 59 59 struct { 60 + #ifdef __BIG_ENDIAN_BITFIELD 60 61 /* HW sets this to the number of buffers used by this packet */ 61 62 uint64_t bufs:8; 62 63 /* HW sets to the number of L2 bytes prior to the IP */ ··· 167 166 * the slow path */ 168 167 /* type is cvmx_pip_err_t */ 169 168 uint64_t err_code:8; 169 + #else 170 + uint64_t err_code:8; 171 + uint64_t rcv_error:1; 172 + uint64_t not_IP:1; 173 + uint64_t is_mcast:1; 174 + uint64_t is_bcast:1; 175 + uint64_t IP_exc:1; 176 + uint64_t is_frag:1; 177 + uint64_t L4_error:1; 178 + uint64_t software:1; 179 + uint64_t is_v6:1; 180 + uint64_t dec_ipsec:1; 181 + uint64_t tcp_or_udp:1; 182 + uint64_t dec_ipcomp:1; 183 + uint64_t unassigned2:4; 184 + uint64_t unassigned2a:4; 185 + uint64_t pr:4; 186 + uint64_t vlan_id:12; 187 + uint64_t vlan_cfi:1; 188 + uint64_t unassigned:1; 189 + uint64_t vlan_stacked:1; 190 + uint64_t vlan_valid:1; 191 + uint64_t ip_offset:8; 192 + uint64_t bufs:8; 193 + #endif 170 194 } s; 171 195 172 196 /* use this to get at the 16 vlan bits */ 173 197 struct { 198 + #ifdef __BIG_ENDIAN_BITFIELD 174 199 uint64_t unused1:16; 175 200 uint64_t vlan:16; 176 201 uint64_t unused2:32; 202 + #else 203 + uint64_t unused2:32; 204 + uint64_t vlan:16; 205 + uint64_t unused1:16; 206 + 207 + #endif 177 208 } svlan; 178 209 179 210 /* ··· 213 180 * the packet is ip. 214 181 */ 215 182 struct { 183 + #ifdef __BIG_ENDIAN_BITFIELD 216 184 /* 217 185 * HW sets this to the number of buffers used by this 218 186 * packet. ··· 330 296 */ 331 297 /* type is cvmx_pip_err_t (union, so can't use directly */ 332 298 uint64_t err_code:8; 299 + #else 300 + uint64_t err_code:8; 301 + uint64_t rcv_error:1; 302 + uint64_t not_IP:1; 303 + uint64_t is_mcast:1; 304 + uint64_t is_bcast:1; 305 + uint64_t is_arp:1; 306 + uint64_t is_rarp:1; 307 + uint64_t unassigned3:1; 308 + uint64_t software:1; 309 + uint64_t unassigned2:4; 310 + uint64_t unassigned2a:8; 311 + uint64_t pr:4; 312 + uint64_t vlan_id:12; 313 + uint64_t vlan_cfi:1; 314 + uint64_t unassigned:1; 315 + uint64_t vlan_stacked:1; 316 + uint64_t vlan_valid:1; 317 + uint64_t unused:8; 318 + uint64_t bufs:8; 319 + #endif 333 320 } snoip; 334 321 335 322 } cvmx_pip_wqe_word2; ··· 367 312 * HW WRITE: the following 64 bits are filled by HW when a packet arrives 368 313 */ 369 314 315 + #ifdef __BIG_ENDIAN_BITFIELD 370 316 /** 371 317 * raw chksum result generated by the HW 372 318 */ ··· 383 327 * (Only 36 bits used in Octeon 1) 384 328 */ 385 329 uint64_t next_ptr:40; 330 + #else 331 + uint64_t next_ptr:40; 332 + uint8_t unused; 333 + uint16_t hw_chksum; 334 + #endif 386 335 387 336 /***************************************************************** 388 337 * WORD 1 389 338 * HW WRITE: the following 64 bits are filled by HW when a packet arrives 390 339 */ 391 340 341 + #ifdef __BIG_ENDIAN_BITFIELD 392 342 /** 393 343 * HW sets to the total number of bytes in the packet 394 344 */ ··· 421 359 * the synchronization/ordering tag 422 360 */ 423 361 uint64_t tag:32; 362 + #else 363 + uint64_t tag:32; 364 + uint64_t tag_type:2; 365 + uint64_t zero_2:1; 366 + uint64_t grp:4; 367 + uint64_t qos:3; 368 + uint64_t ipprt:6; 369 + uint64_t len:16; 370 + #endif 424 371 425 372 /** 426 373 * WORD 2 HW WRITE: the following 64-bits are filled in by