| 1 | /* |
| 2 | * ========== Copyright Header Begin ========================================== |
| 3 | * |
| 4 | * OpenSPARC T2 Processor File: ncu_tcu_nack.s |
| 5 | * Copyright (C) 1995-2007 Sun Microsystems, Inc. All Rights Reserved |
| 6 | * 4150 Network Circle, Santa Clara, California 95054, U.S.A. |
| 7 | * |
| 8 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
| 9 | * |
| 10 | * This program is free software; you can redistribute it and/or modify |
| 11 | * it under the terms of the GNU General Public License as published by |
| 12 | * the Free Software Foundation; version 2 of the License. |
| 13 | * |
| 14 | * This program is distributed in the hope that it will be useful, |
| 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 17 | * GNU General Public License for more details. |
| 18 | * |
| 19 | * You should have received a copy of the GNU General Public License |
| 20 | * along with this program; if not, write to the Free Software |
| 21 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
| 22 | * |
| 23 | * For the avoidance of doubt, and except that if any non-GPL license |
| 24 | * choice is available it will apply instead, Sun elects to use only |
| 25 | * the General Public License version 2 (GPLv2) at this time for any |
| 26 | * software where a choice of GPL license versions is made |
| 27 | * available with the language indicating that GPLv2 or any later version |
| 28 | * may be used, or where a choice of which version of the GPL is applied is |
| 29 | * otherwise unspecified. |
| 30 | * |
| 31 | * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, |
| 32 | * CA 95054 USA or visit www.sun.com if you need additional information or |
| 33 | * have any questions. |
| 34 | * |
| 35 | * |
| 36 | * ========== Copyright Header End ============================================ |
| 37 | */ |
| 38 | #define H_HT0_Data_access_error_0x32 My_Precise_data_access_error_trap |
| 39 | |
| 40 | #define MAIN_PAGE_NUCLEUS_ALSO |
| 41 | #define MAIN_PAGE_HV_ALSO |
| 42 | |
| 43 | |
| 44 | #define FFLP_CONFIG 0x00100 |
| 45 | #define FZC_FFLP_BASE_OFFSET 0x020000 |
| 46 | #define FZC_FFLP_BASE_ADDRESS 0x380000 |
| 47 | |
| 48 | #include "hboot.s" |
| 49 | !#include "asi_s.h" |
| 50 | !#include "err_defines.h" |
| 51 | |
| 52 | .text |
| 53 | .global main |
| 54 | .global My_Precise_data_access_error_trap |
| 55 | |
| 56 | |
| 57 | |
| 58 | main: |
| 59 | ta T_CHANGE_HPRIV |
| 60 | |
| 61 | get_th_id: |
| 62 | ta %icc, T_RD_THID |
| 63 | |
| 64 | |
| 65 | cmp %o1, 0 |
| 66 | be thread_0 |
| 67 | nop |
| 68 | |
| 69 | cmp %o1, 1 |
| 70 | be thread_1 |
| 71 | nop |
| 72 | |
| 73 | cmp %o1, 2 |
| 74 | be thread_2 |
| 75 | nop |
| 76 | |
| 77 | cmp %o1, 3 |
| 78 | be thread_3 |
| 79 | nop |
| 80 | |
| 81 | cmp %o1, 4 |
| 82 | be thread_4 |
| 83 | nop |
| 84 | |
| 85 | cmp %o1, 5 |
| 86 | be thread_5 |
| 87 | nop |
| 88 | |
| 89 | cmp %o1, 6 |
| 90 | be thread_6 |
| 91 | nop |
| 92 | |
| 93 | cmp %o1, 7 |
| 94 | be thread_7 |
| 95 | nop |
| 96 | |
| 97 | cmp %o1, 8 |
| 98 | be thread_8 |
| 99 | nop |
| 100 | |
| 101 | cmp %o1, 9 |
| 102 | be thread_9 |
| 103 | nop |
| 104 | |
| 105 | cmp %o1, 10 |
| 106 | be thread_10 |
| 107 | nop |
| 108 | |
| 109 | cmp %o1, 11 |
| 110 | be thread_11 |
| 111 | nop |
| 112 | |
| 113 | cmp %o1, 12 |
| 114 | be thread_12 |
| 115 | nop |
| 116 | |
| 117 | cmp %o1, 13 |
| 118 | be thread_13 |
| 119 | nop |
| 120 | |
| 121 | cmp %o1, 14 |
| 122 | be thread_14 |
| 123 | nop |
| 124 | |
| 125 | cmp %o1, 15 |
| 126 | be thread_15 |
| 127 | nop |
| 128 | |
| 129 | cmp %o1, 16 |
| 130 | be thread_16 |
| 131 | nop |
| 132 | |
| 133 | cmp %o1, 17 |
| 134 | be thread_17 |
| 135 | nop |
| 136 | |
| 137 | cmp %o1, 18 |
| 138 | be thread_18 |
| 139 | nop |
| 140 | |
| 141 | cmp %o1, 19 |
| 142 | be thread_19 |
| 143 | nop |
| 144 | |
| 145 | cmp %o1, 20 |
| 146 | be thread_20 |
| 147 | nop |
| 148 | |
| 149 | cmp %o1, 21 |
| 150 | be thread_21 |
| 151 | nop |
| 152 | |
| 153 | cmp %o1, 22 |
| 154 | be thread_22 |
| 155 | nop |
| 156 | |
| 157 | cmp %o1, 23 |
| 158 | be thread_23 |
| 159 | nop |
| 160 | |
| 161 | cmp %o1, 24 |
| 162 | be thread_24 |
| 163 | nop |
| 164 | |
| 165 | cmp %o1, 25 |
| 166 | be thread_25 |
| 167 | nop |
| 168 | |
| 169 | cmp %o1, 26 |
| 170 | be thread_26 |
| 171 | nop |
| 172 | |
| 173 | cmp %o1, 27 |
| 174 | be thread_27 |
| 175 | nop |
| 176 | |
| 177 | cmp %o1, 28 |
| 178 | be thread_28 |
| 179 | nop |
| 180 | |
| 181 | cmp %o1, 29 |
| 182 | be thread_29 |
| 183 | nop |
| 184 | |
| 185 | cmp %o1, 30 |
| 186 | be thread_30 |
| 187 | nop |
| 188 | |
| 189 | cmp %o1, 31 |
| 190 | be thread_31 |
| 191 | nop |
| 192 | |
| 193 | cmp %o1, 32 |
| 194 | be thread_32 |
| 195 | nop |
| 196 | |
| 197 | cmp %o1, 33 |
| 198 | be thread_33 |
| 199 | nop |
| 200 | |
| 201 | cmp %o1, 34 |
| 202 | be thread_34 |
| 203 | nop |
| 204 | |
| 205 | cmp %o1, 35 |
| 206 | be thread_35 |
| 207 | nop |
| 208 | |
| 209 | cmp %o1, 36 |
| 210 | be thread_36 |
| 211 | nop |
| 212 | |
| 213 | cmp %o1, 37 |
| 214 | be thread_37 |
| 215 | nop |
| 216 | |
| 217 | cmp %o1, 38 |
| 218 | be thread_38 |
| 219 | nop |
| 220 | |
| 221 | cmp %o1, 39 |
| 222 | be thread_39 |
| 223 | nop |
| 224 | |
| 225 | cmp %o1, 40 |
| 226 | be thread_40 |
| 227 | nop |
| 228 | |
| 229 | cmp %o1, 41 |
| 230 | be thread_41 |
| 231 | nop |
| 232 | |
| 233 | cmp %o1, 42 |
| 234 | be thread_42 |
| 235 | nop |
| 236 | |
| 237 | cmp %o1, 43 |
| 238 | be thread_43 |
| 239 | nop |
| 240 | |
| 241 | cmp %o1, 44 |
| 242 | be thread_44 |
| 243 | nop |
| 244 | |
| 245 | cmp %o1, 45 |
| 246 | be thread_45 |
| 247 | nop |
| 248 | |
| 249 | cmp %o1, 46 |
| 250 | be thread_46 |
| 251 | nop |
| 252 | |
| 253 | cmp %o1, 47 |
| 254 | be thread_47 |
| 255 | nop |
| 256 | |
| 257 | cmp %o1, 48 |
| 258 | be thread_48 |
| 259 | nop |
| 260 | |
| 261 | cmp %o1, 49 |
| 262 | be thread_49 |
| 263 | nop |
| 264 | |
| 265 | cmp %o1, 50 |
| 266 | be thread_50 |
| 267 | nop |
| 268 | |
| 269 | cmp %o1, 51 |
| 270 | be thread_51 |
| 271 | nop |
| 272 | |
| 273 | cmp %o1, 52 |
| 274 | be thread_52 |
| 275 | nop |
| 276 | |
| 277 | cmp %o1, 53 |
| 278 | be thread_53 |
| 279 | nop |
| 280 | |
| 281 | cmp %o1, 54 |
| 282 | be thread_54 |
| 283 | nop |
| 284 | |
| 285 | cmp %o1, 55 |
| 286 | be thread_55 |
| 287 | nop |
| 288 | |
| 289 | cmp %o1, 56 |
| 290 | be thread_56 |
| 291 | nop |
| 292 | |
| 293 | cmp %o1, 57 |
| 294 | be thread_57 |
| 295 | nop |
| 296 | |
| 297 | cmp %o1, 58 |
| 298 | be thread_58 |
| 299 | nop |
| 300 | |
| 301 | cmp %o1, 59 |
| 302 | be thread_59 |
| 303 | nop |
| 304 | |
| 305 | cmp %o1, 60 |
| 306 | be thread_60 |
| 307 | nop |
| 308 | |
| 309 | cmp %o1, 61 |
| 310 | be thread_61 |
| 311 | nop |
| 312 | |
| 313 | cmp %o1, 62 |
| 314 | be thread_62 |
| 315 | nop |
| 316 | |
| 317 | cmp %o1, 63 |
| 318 | be thread_63 |
| 319 | nop |
| 320 | |
| 321 | |
| 322 | thread_63: |
| 323 | call sleep |
| 324 | nop |
| 325 | |
| 326 | thread_62: |
| 327 | call sleep |
| 328 | nop |
| 329 | |
| 330 | thread_61: |
| 331 | call sleep |
| 332 | nop |
| 333 | |
| 334 | thread_60: |
| 335 | call sleep |
| 336 | nop |
| 337 | |
| 338 | thread_59: |
| 339 | call sleep |
| 340 | nop |
| 341 | |
| 342 | thread_58: |
| 343 | call sleep |
| 344 | nop |
| 345 | |
| 346 | thread_57: |
| 347 | call sleep |
| 348 | nop |
| 349 | |
| 350 | thread_56: |
| 351 | call sleep |
| 352 | nop |
| 353 | |
| 354 | thread_55: |
| 355 | call sleep |
| 356 | nop |
| 357 | |
| 358 | thread_54: |
| 359 | call sleep |
| 360 | nop |
| 361 | |
| 362 | thread_53: |
| 363 | call sleep |
| 364 | nop |
| 365 | |
| 366 | thread_52: |
| 367 | call sleep |
| 368 | nop |
| 369 | |
| 370 | thread_51: |
| 371 | call sleep |
| 372 | nop |
| 373 | |
| 374 | thread_50: |
| 375 | call sleep |
| 376 | nop |
| 377 | |
| 378 | thread_49: |
| 379 | call sleep |
| 380 | nop |
| 381 | |
| 382 | thread_48: |
| 383 | call sleep |
| 384 | nop |
| 385 | |
| 386 | thread_47: |
| 387 | call sleep |
| 388 | nop |
| 389 | |
| 390 | thread_46: |
| 391 | call sleep |
| 392 | nop |
| 393 | |
| 394 | thread_45: |
| 395 | call sleep |
| 396 | nop |
| 397 | |
| 398 | thread_44: |
| 399 | call sleep |
| 400 | nop |
| 401 | |
| 402 | thread_43: |
| 403 | call sleep |
| 404 | nop |
| 405 | |
| 406 | thread_42: |
| 407 | call sleep |
| 408 | nop |
| 409 | |
| 410 | thread_41: |
| 411 | call sleep |
| 412 | nop |
| 413 | |
| 414 | thread_40: |
| 415 | call sleep |
| 416 | nop |
| 417 | |
| 418 | thread_39: |
| 419 | call sleep |
| 420 | nop |
| 421 | |
| 422 | thread_38: |
| 423 | call sleep |
| 424 | nop |
| 425 | |
| 426 | thread_37: |
| 427 | call sleep |
| 428 | nop |
| 429 | |
| 430 | thread_36: |
| 431 | call sleep |
| 432 | nop |
| 433 | |
| 434 | thread_35: |
| 435 | call sleep |
| 436 | nop |
| 437 | |
| 438 | thread_34: |
| 439 | call sleep |
| 440 | nop |
| 441 | |
| 442 | thread_33: |
| 443 | call sleep |
| 444 | nop |
| 445 | |
| 446 | thread_32: |
| 447 | call sleep |
| 448 | nop |
| 449 | |
| 450 | thread_31: |
| 451 | call sleep |
| 452 | nop |
| 453 | |
| 454 | thread_30: |
| 455 | call sleep |
| 456 | nop |
| 457 | |
| 458 | thread_29: |
| 459 | call sleep |
| 460 | nop |
| 461 | |
| 462 | thread_28: |
| 463 | call sleep |
| 464 | nop |
| 465 | |
| 466 | thread_27: |
| 467 | call sleep |
| 468 | nop |
| 469 | |
| 470 | thread_26: |
| 471 | call sleep |
| 472 | nop |
| 473 | |
| 474 | thread_25: |
| 475 | call sleep |
| 476 | nop |
| 477 | |
| 478 | thread_24: |
| 479 | call sleep |
| 480 | nop |
| 481 | |
| 482 | thread_23: |
| 483 | call sleep |
| 484 | nop |
| 485 | |
| 486 | thread_22: |
| 487 | call sleep |
| 488 | nop |
| 489 | |
| 490 | thread_21: |
| 491 | call sleep |
| 492 | nop |
| 493 | |
| 494 | thread_20: |
| 495 | call sleep |
| 496 | nop |
| 497 | |
| 498 | thread_19: |
| 499 | call sleep |
| 500 | nop |
| 501 | |
| 502 | thread_18: |
| 503 | call sleep |
| 504 | nop |
| 505 | |
| 506 | thread_17: |
| 507 | call sleep |
| 508 | nop |
| 509 | |
| 510 | thread_16: |
| 511 | call sleep |
| 512 | nop |
| 513 | |
| 514 | thread_15: |
| 515 | call sleep |
| 516 | nop |
| 517 | |
| 518 | thread_14: |
| 519 | call sleep |
| 520 | nop |
| 521 | |
| 522 | thread_13: |
| 523 | call sleep |
| 524 | nop |
| 525 | |
| 526 | thread_12: |
| 527 | call sleep |
| 528 | nop |
| 529 | |
| 530 | thread_11: |
| 531 | call sleep |
| 532 | nop |
| 533 | |
| 534 | thread_10: |
| 535 | call sleep |
| 536 | nop |
| 537 | |
| 538 | thread_9: |
| 539 | call sleep |
| 540 | nop |
| 541 | |
| 542 | thread_8: |
| 543 | call sleep |
| 544 | nop |
| 545 | |
| 546 | thread_7: |
| 547 | call sleep |
| 548 | nop |
| 549 | |
| 550 | thread_6: |
| 551 | call sleep |
| 552 | nop |
| 553 | |
| 554 | thread_5: |
| 555 | call sleep |
| 556 | nop |
| 557 | |
| 558 | |
| 559 | thread_4: |
| 560 | call sleep |
| 561 | nop |
| 562 | |
| 563 | thread_3: |
| 564 | call sleep |
| 565 | nop |
| 566 | |
| 567 | thread_2: |
| 568 | call sleep |
| 569 | nop |
| 570 | |
| 571 | thread_1: |
| 572 | call sleep |
| 573 | nop |
| 574 | |
| 575 | |
| 576 | thread_0: |
| 577 | tcu_ack: |
| 578 | setx 0x8500000000, %g7,%g1 |
| 579 | setx debug_cnt_en,%g7,%g2 |
| 580 | |
| 581 | ldx [%g2],%g4 |
| 582 | stx %g4,[%g1] |
| 583 | |
| 584 | ldx [%g1], %g5 |
| 585 | cmp %g4, %g5 |
| 586 | |
| 587 | bne %xcc, test_fail |
| 588 | nop |
| 589 | |
| 590 | call sleep |
| 591 | nop |
| 592 | tcu_nack: |
| 593 | !Write then read data of DEBUG counter enbalbe REG of TCU block |
| 594 | setx 0x85f0000000, %g7,%g1 |
| 595 | setx 0,%g7,%o5 |
| 596 | ldx [%g1],%g4 |
| 597 | cmp %g0, %o5 |
| 598 | be %xcc, test_fail |
| 599 | nop |
| 600 | |
| 601 | call sleep |
| 602 | nop |
| 603 | |
| 604 | tcu_ack1: |
| 605 | setx 0x8500000000, %g7,%g1 |
| 606 | setx debug_cnt_en,%g7,%g2 |
| 607 | |
| 608 | ldx [%g2],%g4 |
| 609 | stx %g4,[%g1] |
| 610 | |
| 611 | ldx [%g1], %g5 |
| 612 | cmp %g4, %g5 |
| 613 | |
| 614 | bne %xcc, test_fail |
| 615 | nop |
| 616 | |
| 617 | ba test_pass |
| 618 | nop |
| 619 | |
| 620 | My_Precise_data_access_error_trap: |
| 621 | ! Signal trap taken |
| 622 | setx EXECUTED, %l0, %o5 |
| 623 | ! save trap type value |
| 624 | rdpr %tt, %o1 |
| 625 | done |
| 626 | nop |
| 627 | |
| 628 | |
| 629 | sleep: |
| 630 | setx 0x0000008000000a00,%l1,%l2 |
| 631 | set 1,%l3 |
| 632 | set 0, %l0 |
| 633 | |
| 634 | |
| 635 | sleep_loop: |
| 636 | ldx [%l2],%l4 |
| 637 | sub %l3,1,%l3 |
| 638 | cmp %l3,%l0 |
| 639 | bne sleep_loop |
| 640 | nop |
| 641 | retl |
| 642 | nop |
| 643 | |
| 644 | |
| 645 | |
| 646 | |
| 647 | ****************************************************** |
| 648 | * Exit code |
| 649 | *******************************************************/ |
| 650 | |
| 651 | test_pass: |
| 652 | EXIT_GOOD |
| 653 | |
| 654 | test_fail: |
| 655 | EXIT_BAD |
| 656 | |
| 657 | |
| 658 | .data |
| 659 | .align 0x100 |
| 660 | int_vec_data: |
| 661 | .xword 0x000000000000002a |
| 662 | .xword 0x000000000000003f |
| 663 | .xword 0x0000000000000015 |
| 664 | .xword 0x0000000000000001 |
| 665 | .xword 0x0000000000000002 |
| 666 | .xword 0x0000000000000004 |
| 667 | .xword 0x0000000000000008 |
| 668 | .xword 0x0000000000000010 |
| 669 | .xword 0x0000000000000020 |
| 670 | |
| 671 | |
| 672 | .align 0x100 |
| 673 | reset_fee: |
| 674 | .xword 0x000000000000ff00 |
| 675 | .xword 0x000000000000aa00 |
| 676 | .xword 0x0000000000005500 |
| 677 | .xword 0x0000000000000000 |
| 678 | .xword 0x0000000000008800 |
| 679 | .xword 0x0000000000002200 |
| 680 | |
| 681 | .align 0x100 |
| 682 | mcu_cfg_data: |
| 683 | .xword 0x000000000000ff00 |
| 684 | .xword 0x000000000000aa00 |
| 685 | .xword 0x0000000000005500 |
| 686 | .xword 0x0000000000000000 |
| 687 | .xword 0x0000000000000000 |
| 688 | .xword 0x0000000000000000 |
| 689 | |
| 690 | .align 0x100 |
| 691 | ssi_timeout: |
| 692 | .xword 0x0000000000ffffff |
| 693 | .xword 0x0000000000aaaaaa |
| 694 | .xword 0x0000000000555555 |
| 695 | .xword 0x000000000056789a |
| 696 | .xword 0x0000000000df0123 |
| 697 | .xword 0x0000000000789abc |
| 698 | |
| 699 | .align 0x100 |
| 700 | pll_ctl_data: |
| 701 | .xword 0x0000001fffffffff |
| 702 | .xword 0x0000001aaaaaaaaa |
| 703 | .xword 0x0000000555555555 |
| 704 | .xword 0x000000123456789a |
| 705 | .xword 0x0000000bcedf0123 |
| 706 | .xword 0x0000001456789abc |
| 707 | |
| 708 | .align 0x100 |
| 709 | int_en_data: |
| 710 | .xword 0x0000000000000fff |
| 711 | .xword 0x0000000000000aaa |
| 712 | .xword 0x0000000000000555 |
| 713 | .xword 0x000000000000089a |
| 714 | .xword 0x0000000000000123 |
| 715 | .xword 0x0000000000000abc |
| 716 | |
| 717 | .align 0x100 |
| 718 | config_data: |
| 719 | .xword 0x0000000000ffffff |
| 720 | .xword 0x0000000000aaaaaa |
| 721 | .xword 0x0000000000555555 |
| 722 | .xword 0x000000000056789a |
| 723 | .xword 0x0000000000df0123 |
| 724 | .xword 0x0000000000789abc |
| 725 | |
| 726 | |
| 727 | .align 0x100 |
| 728 | wdata: |
| 729 | .xword 0xffffffffffffffff |
| 730 | .xword 0xaaaaaaaaaaaaaaaa |
| 731 | .xword 0x0000000000000000 |
| 732 | .xword 0x5555555555555555 |
| 733 | .xword 0x0123456789abcdef |
| 734 | |
| 735 | .align 0x100 |
| 736 | dbg1_cfg: |
| 737 | .xword 0x00000000000000ff |
| 738 | .xword 0x00000000000000aa |
| 739 | .xword 0x0000000000000000 |
| 740 | .xword 0x0000000000000055 |
| 741 | |
| 742 | .align 0x100 |
| 743 | debug_cnt_en: |
| 744 | .xword 0x000000000000000f |
| 745 | .xword 0x0000000000000000 |
| 746 | .xword 0x000000000000000a |
| 747 | .xword 0x0000000000000005 |
| 748 | .xword 0x0000000000000002 |
| 749 | .xword 0x0000000000000004 |
| 750 | .align 0x100 |
| 751 | bit_1_data: |
| 752 | .xword 0x0000000000000001 |
| 753 | .xword 0x0000000000000000 |
| 754 | .xword 0x0000000000000001 |
| 755 | .xword 0x0000000000000000 |
| 756 | |
| 757 | busy_data: |
| 758 | .xword 0x0000000000000040 |
| 759 | .xword 0x0000000000000000 |
| 760 | .xword 0x0000000000000040 |
| 761 | .xword 0x0000000000000000 |
| 762 | |
| 763 | .align 0x100 |
| 764 | data_xword: |
| 765 | .xword 0x000000faaa000000 |
| 766 | .xword 0x000000fcad000000 |
| 767 | .xword 0x000000f555000000 |
| 768 | .xword 0x000000fabc000000 |
| 769 | |
| 770 | .end |
| 771 | |