1 /* 2 * Copyright (c) 2020, The Linux Foundation. All rights reserved. 3 * 4 * Permission to use, copy, modify, and/or distribute this software for any 5 * purpose with or without fee is hereby granted, provided that the above 6 * copyright notice and this permission notice appear in all copies. 7 * 8 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 9 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 10 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 11 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 12 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 13 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 14 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 15 */ 16 17 #ifndef _REO_UNBLOCK_CACHE_STATUS_H_ 18 #define _REO_UNBLOCK_CACHE_STATUS_H_ 19 #if !defined(__ASSEMBLER__) 20 #endif 21 22 #include "uniform_reo_status_header.h" 23 24 // ################ START SUMMARY ################# 25 // 26 // Dword Fields 27 // 0-1 struct uniform_reo_status_header status_header; 28 // 2 error_detected[0], unblock_type[1], reserved_2a[31:2] 29 // 3 reserved_3a[31:0] 30 // 4 reserved_4a[31:0] 31 // 5 reserved_5a[31:0] 32 // 6 reserved_6a[31:0] 33 // 7 reserved_7a[31:0] 34 // 8 reserved_8a[31:0] 35 // 9 reserved_9a[31:0] 36 // 10 reserved_10a[31:0] 37 // 11 reserved_11a[31:0] 38 // 12 reserved_12a[31:0] 39 // 13 reserved_13a[31:0] 40 // 14 reserved_14a[31:0] 41 // 15 reserved_15a[31:0] 42 // 16 reserved_16a[31:0] 43 // 17 reserved_17a[31:0] 44 // 18 reserved_18a[31:0] 45 // 19 reserved_19a[31:0] 46 // 20 reserved_20a[31:0] 47 // 21 reserved_21a[31:0] 48 // 22 reserved_22a[31:0] 49 // 23 reserved_23a[31:0] 50 // 24 reserved_24a[27:0], looping_count[31:28] 51 // 52 // ################ END SUMMARY ################# 53 54 #define NUM_OF_DWORDS_REO_UNBLOCK_CACHE_STATUS 25 55 56 struct reo_unblock_cache_status { 57 struct uniform_reo_status_header status_header; 58 uint32_t error_detected : 1, //[0] 59 unblock_type : 1, //[1] 60 reserved_2a : 30; //[31:2] 61 uint32_t reserved_3a : 32; //[31:0] 62 uint32_t reserved_4a : 32; //[31:0] 63 uint32_t reserved_5a : 32; //[31:0] 64 uint32_t reserved_6a : 32; //[31:0] 65 uint32_t reserved_7a : 32; //[31:0] 66 uint32_t reserved_8a : 32; //[31:0] 67 uint32_t reserved_9a : 32; //[31:0] 68 uint32_t reserved_10a : 32; //[31:0] 69 uint32_t reserved_11a : 32; //[31:0] 70 uint32_t reserved_12a : 32; //[31:0] 71 uint32_t reserved_13a : 32; //[31:0] 72 uint32_t reserved_14a : 32; //[31:0] 73 uint32_t reserved_15a : 32; //[31:0] 74 uint32_t reserved_16a : 32; //[31:0] 75 uint32_t reserved_17a : 32; //[31:0] 76 uint32_t reserved_18a : 32; //[31:0] 77 uint32_t reserved_19a : 32; //[31:0] 78 uint32_t reserved_20a : 32; //[31:0] 79 uint32_t reserved_21a : 32; //[31:0] 80 uint32_t reserved_22a : 32; //[31:0] 81 uint32_t reserved_23a : 32; //[31:0] 82 uint32_t reserved_24a : 28, //[27:0] 83 looping_count : 4; //[31:28] 84 }; 85 86 /* 87 88 struct uniform_reo_status_header status_header 89 90 Consumer: SW 91 92 Producer: REO 93 94 95 96 Details that can link this status with the original 97 command. It also contains info on how long REO took to 98 execute this command. 99 100 error_detected 101 102 Status for blocking resource handling 103 104 105 106 0: No error has been detected while executing this 107 command 108 109 1: The blocking resource was not in use, and therefor it 110 could not be 'unblocked' 111 112 unblock_type 113 114 Reference to the type of Unblock command type... 115 116 117 118 <enum 0 unblock_resource_index> Unblock a blocking 119 resource 120 121 122 123 <enum 1 unblock_cache> The entire cache usage is 124 unblock. 125 126 127 128 <legal all> 129 130 reserved_2a 131 132 <legal 0> 133 134 reserved_3a 135 136 <legal 0> 137 138 reserved_4a 139 140 <legal 0> 141 142 reserved_5a 143 144 <legal 0> 145 146 reserved_6a 147 148 <legal 0> 149 150 reserved_7a 151 152 <legal 0> 153 154 reserved_8a 155 156 <legal 0> 157 158 reserved_9a 159 160 <legal 0> 161 162 reserved_10a 163 164 <legal 0> 165 166 reserved_11a 167 168 <legal 0> 169 170 reserved_12a 171 172 <legal 0> 173 174 reserved_13a 175 176 <legal 0> 177 178 reserved_14a 179 180 <legal 0> 181 182 reserved_15a 183 184 <legal 0> 185 186 reserved_16a 187 188 <legal 0> 189 190 reserved_17a 191 192 <legal 0> 193 194 reserved_18a 195 196 <legal 0> 197 198 reserved_19a 199 200 <legal 0> 201 202 reserved_20a 203 204 <legal 0> 205 206 reserved_21a 207 208 <legal 0> 209 210 reserved_22a 211 212 <legal 0> 213 214 reserved_23a 215 216 <legal 0> 217 218 reserved_24a 219 220 <legal 0> 221 222 looping_count 223 224 A count value that indicates the number of times the 225 producer of entries into this Ring has looped around the 226 ring. 227 228 At initialization time, this value is set to 0. On the 229 first loop, this value is set to 1. After the max value is 230 reached allowed by the number of bits for this field, the 231 count value continues with 0 again. 232 233 234 235 In case SW is the consumer of the ring entries, it can 236 use this field to figure out up to where the producer of 237 entries has created new entries. This eliminates the need to 238 check where the head pointer' of the ring is located once 239 the SW starts processing an interrupt indicating that new 240 entries have been put into this ring... 241 242 243 244 Also note that SW if it wants only needs to look at the 245 LSB bit of this count value. 246 247 <legal all> 248 */ 249 250 251 /* EXTERNAL REFERENCE : struct uniform_reo_status_header status_header */ 252 253 254 /* Description REO_UNBLOCK_CACHE_STATUS_0_STATUS_HEADER_REO_STATUS_NUMBER 255 256 Consumer: SW , DEBUG 257 258 Producer: REO 259 260 261 262 The value in this field is equal to value of the 263 'REO_CMD_Number' field the REO command 264 265 266 267 This field helps to correlate the statuses with the REO 268 commands. 269 270 271 272 <legal all> 273 */ 274 #define REO_UNBLOCK_CACHE_STATUS_0_STATUS_HEADER_REO_STATUS_NUMBER_OFFSET 0x00000000 275 #define REO_UNBLOCK_CACHE_STATUS_0_STATUS_HEADER_REO_STATUS_NUMBER_LSB 0 276 #define REO_UNBLOCK_CACHE_STATUS_0_STATUS_HEADER_REO_STATUS_NUMBER_MASK 0x0000ffff 277 278 /* Description REO_UNBLOCK_CACHE_STATUS_0_STATUS_HEADER_CMD_EXECUTION_TIME 279 280 Consumer: DEBUG 281 282 Producer: REO 283 284 285 286 The amount of time REO took to excecute the command. 287 Note that this time does not include the duration of the 288 command waiting in the command ring, before the execution 289 started. 290 291 292 293 In us. 294 295 296 297 <legal all> 298 */ 299 #define REO_UNBLOCK_CACHE_STATUS_0_STATUS_HEADER_CMD_EXECUTION_TIME_OFFSET 0x00000000 300 #define REO_UNBLOCK_CACHE_STATUS_0_STATUS_HEADER_CMD_EXECUTION_TIME_LSB 16 301 #define REO_UNBLOCK_CACHE_STATUS_0_STATUS_HEADER_CMD_EXECUTION_TIME_MASK 0x03ff0000 302 303 /* Description REO_UNBLOCK_CACHE_STATUS_0_STATUS_HEADER_REO_CMD_EXECUTION_STATUS 304 305 Consumer: DEBUG 306 307 Producer: REO 308 309 310 311 Execution status of the command. 312 313 314 315 <enum 0 reo_successful_execution> Command has 316 successfully be executed 317 318 <enum 1 reo_blocked_execution> Command could not be 319 executed as the queue or cache was blocked 320 321 <enum 2 reo_failed_execution> Command has encountered 322 problems when executing, like the queue descriptor not being 323 valid. None of the status fields in the entire STATUS TLV 324 are valid. 325 326 <enum 3 reo_resource_blocked> Command is NOT executed 327 because one or more descriptors were blocked. This is SW 328 programming mistake. 329 330 None of the status fields in the entire STATUS TLV are 331 valid. 332 333 334 335 <legal 0-3> 336 */ 337 #define REO_UNBLOCK_CACHE_STATUS_0_STATUS_HEADER_REO_CMD_EXECUTION_STATUS_OFFSET 0x00000000 338 #define REO_UNBLOCK_CACHE_STATUS_0_STATUS_HEADER_REO_CMD_EXECUTION_STATUS_LSB 26 339 #define REO_UNBLOCK_CACHE_STATUS_0_STATUS_HEADER_REO_CMD_EXECUTION_STATUS_MASK 0x0c000000 340 341 /* Description REO_UNBLOCK_CACHE_STATUS_0_STATUS_HEADER_RESERVED_0A 342 343 <legal 0> 344 */ 345 #define REO_UNBLOCK_CACHE_STATUS_0_STATUS_HEADER_RESERVED_0A_OFFSET 0x00000000 346 #define REO_UNBLOCK_CACHE_STATUS_0_STATUS_HEADER_RESERVED_0A_LSB 28 347 #define REO_UNBLOCK_CACHE_STATUS_0_STATUS_HEADER_RESERVED_0A_MASK 0xf0000000 348 349 /* Description REO_UNBLOCK_CACHE_STATUS_1_STATUS_HEADER_TIMESTAMP 350 351 Timestamp at the moment that this status report is 352 written. 353 354 355 356 <legal all> 357 */ 358 #define REO_UNBLOCK_CACHE_STATUS_1_STATUS_HEADER_TIMESTAMP_OFFSET 0x00000004 359 #define REO_UNBLOCK_CACHE_STATUS_1_STATUS_HEADER_TIMESTAMP_LSB 0 360 #define REO_UNBLOCK_CACHE_STATUS_1_STATUS_HEADER_TIMESTAMP_MASK 0xffffffff 361 362 /* Description REO_UNBLOCK_CACHE_STATUS_2_ERROR_DETECTED 363 364 Status for blocking resource handling 365 366 367 368 0: No error has been detected while executing this 369 command 370 371 1: The blocking resource was not in use, and therefor it 372 could not be 'unblocked' 373 */ 374 #define REO_UNBLOCK_CACHE_STATUS_2_ERROR_DETECTED_OFFSET 0x00000008 375 #define REO_UNBLOCK_CACHE_STATUS_2_ERROR_DETECTED_LSB 0 376 #define REO_UNBLOCK_CACHE_STATUS_2_ERROR_DETECTED_MASK 0x00000001 377 378 /* Description REO_UNBLOCK_CACHE_STATUS_2_UNBLOCK_TYPE 379 380 Reference to the type of Unblock command type... 381 382 383 384 <enum 0 unblock_resource_index> Unblock a blocking 385 resource 386 387 388 389 <enum 1 unblock_cache> The entire cache usage is 390 unblock. 391 392 393 394 <legal all> 395 */ 396 #define REO_UNBLOCK_CACHE_STATUS_2_UNBLOCK_TYPE_OFFSET 0x00000008 397 #define REO_UNBLOCK_CACHE_STATUS_2_UNBLOCK_TYPE_LSB 1 398 #define REO_UNBLOCK_CACHE_STATUS_2_UNBLOCK_TYPE_MASK 0x00000002 399 400 /* Description REO_UNBLOCK_CACHE_STATUS_2_RESERVED_2A 401 402 <legal 0> 403 */ 404 #define REO_UNBLOCK_CACHE_STATUS_2_RESERVED_2A_OFFSET 0x00000008 405 #define REO_UNBLOCK_CACHE_STATUS_2_RESERVED_2A_LSB 2 406 #define REO_UNBLOCK_CACHE_STATUS_2_RESERVED_2A_MASK 0xfffffffc 407 408 /* Description REO_UNBLOCK_CACHE_STATUS_3_RESERVED_3A 409 410 <legal 0> 411 */ 412 #define REO_UNBLOCK_CACHE_STATUS_3_RESERVED_3A_OFFSET 0x0000000c 413 #define REO_UNBLOCK_CACHE_STATUS_3_RESERVED_3A_LSB 0 414 #define REO_UNBLOCK_CACHE_STATUS_3_RESERVED_3A_MASK 0xffffffff 415 416 /* Description REO_UNBLOCK_CACHE_STATUS_4_RESERVED_4A 417 418 <legal 0> 419 */ 420 #define REO_UNBLOCK_CACHE_STATUS_4_RESERVED_4A_OFFSET 0x00000010 421 #define REO_UNBLOCK_CACHE_STATUS_4_RESERVED_4A_LSB 0 422 #define REO_UNBLOCK_CACHE_STATUS_4_RESERVED_4A_MASK 0xffffffff 423 424 /* Description REO_UNBLOCK_CACHE_STATUS_5_RESERVED_5A 425 426 <legal 0> 427 */ 428 #define REO_UNBLOCK_CACHE_STATUS_5_RESERVED_5A_OFFSET 0x00000014 429 #define REO_UNBLOCK_CACHE_STATUS_5_RESERVED_5A_LSB 0 430 #define REO_UNBLOCK_CACHE_STATUS_5_RESERVED_5A_MASK 0xffffffff 431 432 /* Description REO_UNBLOCK_CACHE_STATUS_6_RESERVED_6A 433 434 <legal 0> 435 */ 436 #define REO_UNBLOCK_CACHE_STATUS_6_RESERVED_6A_OFFSET 0x00000018 437 #define REO_UNBLOCK_CACHE_STATUS_6_RESERVED_6A_LSB 0 438 #define REO_UNBLOCK_CACHE_STATUS_6_RESERVED_6A_MASK 0xffffffff 439 440 /* Description REO_UNBLOCK_CACHE_STATUS_7_RESERVED_7A 441 442 <legal 0> 443 */ 444 #define REO_UNBLOCK_CACHE_STATUS_7_RESERVED_7A_OFFSET 0x0000001c 445 #define REO_UNBLOCK_CACHE_STATUS_7_RESERVED_7A_LSB 0 446 #define REO_UNBLOCK_CACHE_STATUS_7_RESERVED_7A_MASK 0xffffffff 447 448 /* Description REO_UNBLOCK_CACHE_STATUS_8_RESERVED_8A 449 450 <legal 0> 451 */ 452 #define REO_UNBLOCK_CACHE_STATUS_8_RESERVED_8A_OFFSET 0x00000020 453 #define REO_UNBLOCK_CACHE_STATUS_8_RESERVED_8A_LSB 0 454 #define REO_UNBLOCK_CACHE_STATUS_8_RESERVED_8A_MASK 0xffffffff 455 456 /* Description REO_UNBLOCK_CACHE_STATUS_9_RESERVED_9A 457 458 <legal 0> 459 */ 460 #define REO_UNBLOCK_CACHE_STATUS_9_RESERVED_9A_OFFSET 0x00000024 461 #define REO_UNBLOCK_CACHE_STATUS_9_RESERVED_9A_LSB 0 462 #define REO_UNBLOCK_CACHE_STATUS_9_RESERVED_9A_MASK 0xffffffff 463 464 /* Description REO_UNBLOCK_CACHE_STATUS_10_RESERVED_10A 465 466 <legal 0> 467 */ 468 #define REO_UNBLOCK_CACHE_STATUS_10_RESERVED_10A_OFFSET 0x00000028 469 #define REO_UNBLOCK_CACHE_STATUS_10_RESERVED_10A_LSB 0 470 #define REO_UNBLOCK_CACHE_STATUS_10_RESERVED_10A_MASK 0xffffffff 471 472 /* Description REO_UNBLOCK_CACHE_STATUS_11_RESERVED_11A 473 474 <legal 0> 475 */ 476 #define REO_UNBLOCK_CACHE_STATUS_11_RESERVED_11A_OFFSET 0x0000002c 477 #define REO_UNBLOCK_CACHE_STATUS_11_RESERVED_11A_LSB 0 478 #define REO_UNBLOCK_CACHE_STATUS_11_RESERVED_11A_MASK 0xffffffff 479 480 /* Description REO_UNBLOCK_CACHE_STATUS_12_RESERVED_12A 481 482 <legal 0> 483 */ 484 #define REO_UNBLOCK_CACHE_STATUS_12_RESERVED_12A_OFFSET 0x00000030 485 #define REO_UNBLOCK_CACHE_STATUS_12_RESERVED_12A_LSB 0 486 #define REO_UNBLOCK_CACHE_STATUS_12_RESERVED_12A_MASK 0xffffffff 487 488 /* Description REO_UNBLOCK_CACHE_STATUS_13_RESERVED_13A 489 490 <legal 0> 491 */ 492 #define REO_UNBLOCK_CACHE_STATUS_13_RESERVED_13A_OFFSET 0x00000034 493 #define REO_UNBLOCK_CACHE_STATUS_13_RESERVED_13A_LSB 0 494 #define REO_UNBLOCK_CACHE_STATUS_13_RESERVED_13A_MASK 0xffffffff 495 496 /* Description REO_UNBLOCK_CACHE_STATUS_14_RESERVED_14A 497 498 <legal 0> 499 */ 500 #define REO_UNBLOCK_CACHE_STATUS_14_RESERVED_14A_OFFSET 0x00000038 501 #define REO_UNBLOCK_CACHE_STATUS_14_RESERVED_14A_LSB 0 502 #define REO_UNBLOCK_CACHE_STATUS_14_RESERVED_14A_MASK 0xffffffff 503 504 /* Description REO_UNBLOCK_CACHE_STATUS_15_RESERVED_15A 505 506 <legal 0> 507 */ 508 #define REO_UNBLOCK_CACHE_STATUS_15_RESERVED_15A_OFFSET 0x0000003c 509 #define REO_UNBLOCK_CACHE_STATUS_15_RESERVED_15A_LSB 0 510 #define REO_UNBLOCK_CACHE_STATUS_15_RESERVED_15A_MASK 0xffffffff 511 512 /* Description REO_UNBLOCK_CACHE_STATUS_16_RESERVED_16A 513 514 <legal 0> 515 */ 516 #define REO_UNBLOCK_CACHE_STATUS_16_RESERVED_16A_OFFSET 0x00000040 517 #define REO_UNBLOCK_CACHE_STATUS_16_RESERVED_16A_LSB 0 518 #define REO_UNBLOCK_CACHE_STATUS_16_RESERVED_16A_MASK 0xffffffff 519 520 /* Description REO_UNBLOCK_CACHE_STATUS_17_RESERVED_17A 521 522 <legal 0> 523 */ 524 #define REO_UNBLOCK_CACHE_STATUS_17_RESERVED_17A_OFFSET 0x00000044 525 #define REO_UNBLOCK_CACHE_STATUS_17_RESERVED_17A_LSB 0 526 #define REO_UNBLOCK_CACHE_STATUS_17_RESERVED_17A_MASK 0xffffffff 527 528 /* Description REO_UNBLOCK_CACHE_STATUS_18_RESERVED_18A 529 530 <legal 0> 531 */ 532 #define REO_UNBLOCK_CACHE_STATUS_18_RESERVED_18A_OFFSET 0x00000048 533 #define REO_UNBLOCK_CACHE_STATUS_18_RESERVED_18A_LSB 0 534 #define REO_UNBLOCK_CACHE_STATUS_18_RESERVED_18A_MASK 0xffffffff 535 536 /* Description REO_UNBLOCK_CACHE_STATUS_19_RESERVED_19A 537 538 <legal 0> 539 */ 540 #define REO_UNBLOCK_CACHE_STATUS_19_RESERVED_19A_OFFSET 0x0000004c 541 #define REO_UNBLOCK_CACHE_STATUS_19_RESERVED_19A_LSB 0 542 #define REO_UNBLOCK_CACHE_STATUS_19_RESERVED_19A_MASK 0xffffffff 543 544 /* Description REO_UNBLOCK_CACHE_STATUS_20_RESERVED_20A 545 546 <legal 0> 547 */ 548 #define REO_UNBLOCK_CACHE_STATUS_20_RESERVED_20A_OFFSET 0x00000050 549 #define REO_UNBLOCK_CACHE_STATUS_20_RESERVED_20A_LSB 0 550 #define REO_UNBLOCK_CACHE_STATUS_20_RESERVED_20A_MASK 0xffffffff 551 552 /* Description REO_UNBLOCK_CACHE_STATUS_21_RESERVED_21A 553 554 <legal 0> 555 */ 556 #define REO_UNBLOCK_CACHE_STATUS_21_RESERVED_21A_OFFSET 0x00000054 557 #define REO_UNBLOCK_CACHE_STATUS_21_RESERVED_21A_LSB 0 558 #define REO_UNBLOCK_CACHE_STATUS_21_RESERVED_21A_MASK 0xffffffff 559 560 /* Description REO_UNBLOCK_CACHE_STATUS_22_RESERVED_22A 561 562 <legal 0> 563 */ 564 #define REO_UNBLOCK_CACHE_STATUS_22_RESERVED_22A_OFFSET 0x00000058 565 #define REO_UNBLOCK_CACHE_STATUS_22_RESERVED_22A_LSB 0 566 #define REO_UNBLOCK_CACHE_STATUS_22_RESERVED_22A_MASK 0xffffffff 567 568 /* Description REO_UNBLOCK_CACHE_STATUS_23_RESERVED_23A 569 570 <legal 0> 571 */ 572 #define REO_UNBLOCK_CACHE_STATUS_23_RESERVED_23A_OFFSET 0x0000005c 573 #define REO_UNBLOCK_CACHE_STATUS_23_RESERVED_23A_LSB 0 574 #define REO_UNBLOCK_CACHE_STATUS_23_RESERVED_23A_MASK 0xffffffff 575 576 /* Description REO_UNBLOCK_CACHE_STATUS_24_RESERVED_24A 577 578 <legal 0> 579 */ 580 #define REO_UNBLOCK_CACHE_STATUS_24_RESERVED_24A_OFFSET 0x00000060 581 #define REO_UNBLOCK_CACHE_STATUS_24_RESERVED_24A_LSB 0 582 #define REO_UNBLOCK_CACHE_STATUS_24_RESERVED_24A_MASK 0x0fffffff 583 584 /* Description REO_UNBLOCK_CACHE_STATUS_24_LOOPING_COUNT 585 586 A count value that indicates the number of times the 587 producer of entries into this Ring has looped around the 588 ring. 589 590 At initialization time, this value is set to 0. On the 591 first loop, this value is set to 1. After the max value is 592 reached allowed by the number of bits for this field, the 593 count value continues with 0 again. 594 595 596 597 In case SW is the consumer of the ring entries, it can 598 use this field to figure out up to where the producer of 599 entries has created new entries. This eliminates the need to 600 check where the head pointer' of the ring is located once 601 the SW starts processing an interrupt indicating that new 602 entries have been put into this ring... 603 604 605 606 Also note that SW if it wants only needs to look at the 607 LSB bit of this count value. 608 609 <legal all> 610 */ 611 #define REO_UNBLOCK_CACHE_STATUS_24_LOOPING_COUNT_OFFSET 0x00000060 612 #define REO_UNBLOCK_CACHE_STATUS_24_LOOPING_COUNT_LSB 28 613 #define REO_UNBLOCK_CACHE_STATUS_24_LOOPING_COUNT_MASK 0xf0000000 614 615 616 #endif // _REO_UNBLOCK_CACHE_STATUS_H_ 617