1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55struct SYM_FWA_SCR {
56 u32 start [ 14];
57 u32 getjob_begin [ 4];
58 u32 getjob_end [ 4];
59#ifdef SYM_CONF_TARGET_ROLE_SUPPORT
60 u32 select [ 6];
61#else
62 u32 select [ 4];
63#endif
64#if SYM_CONF_DMA_ADDRESSING_MODE == 2
65 u32 is_dmap_dirty [ 4];
66#endif
67 u32 wf_sel_done [ 2];
68 u32 sel_done [ 2];
69 u32 send_ident [ 2];
70#ifdef SYM_CONF_IARB_SUPPORT
71 u32 select2 [ 8];
72#else
73 u32 select2 [ 2];
74#endif
75 u32 command [ 2];
76 u32 dispatch [ 28];
77 u32 sel_no_cmd [ 10];
78 u32 init [ 6];
79 u32 clrack [ 4];
80 u32 datai_done [ 10];
81 u32 datai_done_wsr [ 20];
82 u32 datao_done [ 10];
83 u32 datao_done_wss [ 6];
84 u32 datai_phase [ 4];
85 u32 datao_phase [ 6];
86 u32 msg_in [ 2];
87 u32 msg_in2 [ 10];
88#ifdef SYM_CONF_IARB_SUPPORT
89 u32 status [ 14];
90#else
91 u32 status [ 10];
92#endif
93 u32 complete [ 6];
94 u32 complete2 [ 12];
95 u32 done [ 14];
96 u32 done_end [ 2];
97 u32 complete_error [ 4];
98 u32 save_dp [ 12];
99 u32 restore_dp [ 8];
100 u32 disconnect [ 12];
101#ifdef SYM_CONF_IARB_SUPPORT
102 u32 idle [ 4];
103#else
104 u32 idle [ 2];
105#endif
106#ifdef SYM_CONF_IARB_SUPPORT
107 u32 ungetjob [ 6];
108#else
109 u32 ungetjob [ 4];
110#endif
111#ifdef SYM_CONF_TARGET_ROLE_SUPPORT
112 u32 reselect [ 4];
113#else
114 u32 reselect [ 2];
115#endif
116 u32 reselected [ 22];
117 u32 resel_scntl4 [ 20];
118 u32 resel_lun0 [ 6];
119#if SYM_CONF_MAX_TASK*4 > 512
120 u32 resel_tag [ 26];
121#elif SYM_CONF_MAX_TASK*4 > 256
122 u32 resel_tag [ 20];
123#else
124 u32 resel_tag [ 16];
125#endif
126 u32 resel_dsa [ 2];
127 u32 resel_dsa1 [ 4];
128 u32 resel_no_tag [ 6];
129 u32 data_in [SYM_CONF_MAX_SG * 2];
130 u32 data_in2 [ 4];
131 u32 data_out [SYM_CONF_MAX_SG * 2];
132 u32 data_out2 [ 4];
133 u32 pm0_data [ 12];
134 u32 pm0_data_out [ 6];
135 u32 pm0_data_end [ 6];
136 u32 pm1_data [ 12];
137 u32 pm1_data_out [ 6];
138 u32 pm1_data_end [ 6];
139};
140
141
142
143
144
145struct SYM_FWB_SCR {
146 u32 start64 [ 2];
147 u32 no_data [ 2];
148#ifdef SYM_CONF_TARGET_ROLE_SUPPORT
149 u32 sel_for_abort [ 18];
150#else
151 u32 sel_for_abort [ 16];
152#endif
153 u32 sel_for_abort_1 [ 2];
154 u32 msg_in_etc [ 12];
155 u32 msg_received [ 4];
156 u32 msg_weird_seen [ 4];
157 u32 msg_extended [ 20];
158 u32 msg_bad [ 6];
159 u32 msg_weird [ 4];
160 u32 msg_weird1 [ 8];
161
162 u32 wdtr_resp [ 6];
163 u32 send_wdtr [ 4];
164 u32 sdtr_resp [ 6];
165 u32 send_sdtr [ 4];
166 u32 ppr_resp [ 6];
167 u32 send_ppr [ 4];
168 u32 nego_bad_phase [ 4];
169 u32 msg_out [ 4];
170 u32 msg_out_done [ 4];
171 u32 data_ovrun [ 2];
172 u32 data_ovrun1 [ 22];
173 u32 data_ovrun2 [ 8];
174 u32 abort_resel [ 16];
175 u32 resend_ident [ 4];
176 u32 ident_break [ 4];
177 u32 ident_break_atn [ 4];
178 u32 sdata_in [ 6];
179 u32 resel_bad_lun [ 4];
180 u32 bad_i_t_l [ 4];
181 u32 bad_i_t_l_q [ 4];
182 u32 bad_status [ 6];
183 u32 pm_handle [ 20];
184 u32 pm_handle1 [ 4];
185 u32 pm_save [ 4];
186 u32 pm0_save [ 12];
187 u32 pm_save_end [ 4];
188 u32 pm1_save [ 14];
189
190
191 u32 pm_wsr_handle [ 38];
192 u32 wsr_ma_helper [ 4];
193
194
195 u32 zero [ 1];
196 u32 scratch [ 1];
197 u32 pm0_data_addr [ 1];
198 u32 pm1_data_addr [ 1];
199 u32 done_pos [ 1];
200 u32 startpos [ 1];
201 u32 targtbl [ 1];
202};
203
204
205
206
207
208struct SYM_FWZ_SCR {
209 u32 snooptest [ 6];
210 u32 snoopend [ 2];
211};
212
213static struct SYM_FWA_SCR SYM_FWA_SCR = {
214 {
215
216
217
218
219
220 SCR_REG_REG (gpreg, SCR_AND, 0xfe),
221 0,
222
223
224
225 SCR_FROM_REG (ctest2),
226 0,
227
228
229
230
231
232 SCR_FROM_REG (istat),
233 0,
234
235
236
237
238
239 SCR_LOAD_ABS (scratcha, 4),
240 PADDR_B (startpos),
241 SCR_INT ^ IFTRUE (MASK (SEM, SEM)),
242 SIR_SCRIPT_STOPPED,
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257 SCR_LOAD_ABS (dsa, 4),
258 PADDR_B (startpos),
259 SCR_LOAD_REL (temp, 4),
260 4,
261},{
262 SCR_STORE_ABS (temp, 4),
263 PADDR_B (startpos),
264 SCR_LOAD_REL (dsa, 4),
265 0,
266},{
267 SCR_LOAD_REL (temp, 4),
268 0,
269 SCR_RETURN,
270 0,
271},{
272
273
274
275
276
277
278
279
280
281
282
283#ifdef SYM_CONF_TARGET_ROLE_SUPPORT
284 SCR_CLR (SCR_TRG),
285 0,
286#endif
287
288
289
290 SCR_SEL_TBL_ATN ^ offsetof (struct sym_dsb, select),
291 PADDR_A (ungetjob),
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317 SCR_LOAD_REL (scr0, 4),
318 offsetof (struct sym_ccb, phys.head.status),
319
320
321
322
323
324
325#if SYM_CONF_DMA_ADDRESSING_MODE == 2
326},{
327 SCR_FROM_REG (HX_REG),
328 0,
329 SCR_INT ^ IFTRUE (MASK (HX_DMAP_DIRTY, HX_DMAP_DIRTY)),
330 SIR_DMAP_DIRTY,
331#endif
332},{
333 SCR_INT ^ IFFALSE (WHEN (SCR_MSG_OUT)),
334 SIR_SEL_ATN_NO_MSG_OUT,
335},{
336
337
338
339
340
341
342
343 SCR_LOAD_REL (scntl3, 1),
344 offsetof(struct sym_dsb, select.sel_scntl3),
345},{
346
347
348
349
350
351 SCR_MOVE_TBL ^ SCR_MSG_OUT,
352 offsetof (struct sym_dsb, smsg),
353},{
354#ifdef SYM_CONF_IARB_SUPPORT
355
356
357
358
359 SCR_FROM_REG (HF_REG),
360 0,
361 SCR_JUMPR ^ IFFALSE (MASK (HF_HINT_IARB, HF_HINT_IARB)),
362 8,
363 SCR_REG_REG (scntl1, SCR_OR, IARB),
364 0,
365#endif
366
367
368
369
370 SCR_JUMP ^ IFFALSE (WHEN (SCR_COMMAND)),
371 PADDR_A (sel_no_cmd),
372},{
373
374
375
376 SCR_MOVE_TBL ^ SCR_COMMAND,
377 offsetof (struct sym_dsb, cmd),
378},{
379
380
381
382
383
384 SCR_JUMP ^ IFTRUE (WHEN (SCR_MSG_IN)),
385 PADDR_A (msg_in),
386 SCR_JUMP ^ IFTRUE (IF (SCR_DATA_OUT)),
387 PADDR_A (datao_phase),
388 SCR_JUMP ^ IFTRUE (IF (SCR_DATA_IN)),
389 PADDR_A (datai_phase),
390 SCR_JUMP ^ IFTRUE (IF (SCR_STATUS)),
391 PADDR_A (status),
392 SCR_JUMP ^ IFTRUE (IF (SCR_COMMAND)),
393 PADDR_A (command),
394 SCR_JUMP ^ IFTRUE (IF (SCR_MSG_OUT)),
395 PADDR_B (msg_out),
396
397
398
399
400 SCR_JUMPR ^ IFFALSE (WHEN (SCR_ILG_OUT)),
401 16,
402 SCR_MOVE_ABS (1) ^ SCR_ILG_OUT,
403 HADDR_1 (scratch),
404 SCR_JUMPR ^ IFTRUE (WHEN (SCR_ILG_OUT)),
405 -16,
406 SCR_JUMPR ^ IFFALSE (WHEN (SCR_ILG_IN)),
407 16,
408 SCR_MOVE_ABS (1) ^ SCR_ILG_IN,
409 HADDR_1 (scratch),
410 SCR_JUMPR ^ IFTRUE (WHEN (SCR_ILG_IN)),
411 -16,
412 SCR_INT,
413 SIR_BAD_PHASE,
414 SCR_JUMP,
415 PADDR_A (dispatch),
416},{
417
418
419
420
421
422
423
424 SCR_JUMP ^ IFTRUE (WHEN (SCR_MSG_OUT)),
425 PADDR_B (resend_ident),
426
427
428
429
430
431 SCR_JUMP ^ IFTRUE (WHEN (SCR_MSG_IN)),
432 PADDR_A (dispatch),
433 SCR_FROM_REG (HS_REG),
434 0,
435 SCR_INT ^ IFTRUE (DATA (HS_NEGOTIATE)),
436 SIR_NEGO_FAILED,
437
438
439
440 SCR_JUMP,
441 PADDR_A (dispatch),
442},{
443
444
445
446
447
448
449 SCR_FROM_REG (sstat0),
450 0,
451 SCR_JUMPR ^ IFTRUE (MASK (IRST, IRST)),
452 -16,
453 SCR_JUMP,
454 PADDR_A (start),
455},{
456
457
458
459 SCR_CLR (SCR_ACK),
460 0,
461 SCR_JUMP,
462 PADDR_A (dispatch),
463},{
464
465
466
467 SCR_STORE_REL (temp, 4),
468 offsetof (struct sym_ccb, phys.head.lastp),
469
470
471
472
473 SCR_FROM_REG (scntl2),
474 0,
475 SCR_JUMP ^ IFTRUE (MASK (WSR, WSR)),
476 PADDR_A (datai_done_wsr),
477 SCR_JUMP ^ IFTRUE (WHEN (SCR_STATUS)),
478 PADDR_A (status),
479 SCR_JUMP,
480 PADDR_A (dispatch),
481},{
482
483
484
485
486 SCR_REG_REG (scntl2, SCR_OR, WSR),
487 0,
488
489
490
491
492
493 SCR_INT ^ IFFALSE (WHEN (SCR_MSG_IN)),
494 SIR_SWIDE_OVERRUN,
495 SCR_JUMP ^ IFFALSE (WHEN (SCR_MSG_IN)),
496 PADDR_A (dispatch),
497
498
499
500
501
502
503
504 SCR_MOVE_ABS (1) ^ SCR_MSG_IN,
505 HADDR_1 (msgin[0]),
506 SCR_INT ^ IFFALSE (DATA (M_IGN_RESIDUE)),
507 SIR_SWIDE_OVERRUN,
508 SCR_JUMP ^ IFFALSE (DATA (M_IGN_RESIDUE)),
509 PADDR_A (msg_in2),
510
511
512
513
514 SCR_CLR (SCR_ACK),
515 0,
516 SCR_MOVE_ABS (1) ^ SCR_MSG_IN,
517 HADDR_1 (msgin[1]),
518 SCR_CLR (SCR_ACK),
519 0,
520 SCR_JUMP,
521 PADDR_A (dispatch),
522},{
523
524
525
526 SCR_STORE_REL (temp, 4),
527 offsetof (struct sym_ccb, phys.head.lastp),
528
529
530
531
532 SCR_FROM_REG (scntl2),
533 0,
534 SCR_JUMP ^ IFTRUE (MASK (WSS, WSS)),
535 PADDR_A (datao_done_wss),
536 SCR_JUMP ^ IFTRUE (WHEN (SCR_STATUS)),
537 PADDR_A (status),
538 SCR_JUMP,
539 PADDR_A (dispatch),
540},{
541
542
543
544 SCR_REG_REG (scntl2, SCR_OR, WSS),
545 0,
546
547
548
549
550 SCR_INT,
551 SIR_SODL_UNDERRUN,
552 SCR_JUMP,
553 PADDR_A (dispatch),
554},{
555
556
557
558 SCR_LOAD_REL (temp, 4),
559 offsetof (struct sym_ccb, phys.head.lastp),
560 SCR_RETURN,
561 0,
562},{
563
564
565
566
567
568
569 SCR_REG_REG (scntl4, SCR_OR, (XCLKH_DT|XCLKH_ST)),
570 0,
571
572
573
574 SCR_LOAD_REL (temp, 4),
575 offsetof (struct sym_ccb, phys.head.lastp),
576 SCR_RETURN,
577 0,
578},{
579
580
581
582
583
584
585 SCR_MOVE_ABS (1) ^ SCR_MSG_IN,
586 HADDR_1 (msgin[0]),
587},{
588
589
590
591
592 SCR_JUMP ^ IFTRUE (DATA (M_COMPLETE)),
593 PADDR_A (complete),
594 SCR_JUMP ^ IFTRUE (DATA (M_DISCONNECT)),
595 PADDR_A (disconnect),
596 SCR_JUMP ^ IFTRUE (DATA (M_SAVE_DP)),
597 PADDR_A (save_dp),
598 SCR_JUMP ^ IFTRUE (DATA (M_RESTORE_DP)),
599 PADDR_A (restore_dp),
600
601
602
603
604
605 SCR_JUMP,
606 PADDR_B (msg_in_etc),
607},{
608
609
610
611 SCR_MOVE_ABS (1) ^ SCR_STATUS,
612 HADDR_1 (scratch),
613#ifdef SYM_CONF_IARB_SUPPORT
614
615
616
617
618
619 SCR_JUMPR ^ IFTRUE (DATA (S_GOOD)),
620 8,
621 SCR_REG_REG (scntl1, SCR_AND, ~IARB),
622 0,
623#endif
624
625
626
627
628 SCR_TO_REG (SS_REG),
629 0,
630 SCR_LOAD_REG (HS_REG, HS_COMPLETE),
631 0,
632
633
634
635
636 SCR_JUMP ^ IFTRUE (WHEN (SCR_MSG_IN)),
637 PADDR_A (msg_in),
638 SCR_JUMP,
639 PADDR_A (dispatch),
640},{
641
642
643
644
645
646
647
648
649
650 SCR_REG_REG (scntl2, SCR_AND, 0x7f),
651 0,
652
653
654
655 SCR_CLR (SCR_ACK|SCR_ATN),
656 0,
657
658
659
660 SCR_WAIT_DISC,
661 0,
662},{
663
664
665
666 SCR_STORE_REL (scr0, 4),
667 offsetof (struct sym_ccb, phys.head.status),
668
669
670
671
672
673
674
675
676 SCR_LOAD_REL (scr0, 4),
677 offsetof (struct sym_ccb, phys.head.status),
678
679
680
681
682
683 SCR_FROM_REG (SS_REG),
684 0,
685 SCR_CALL ^ IFFALSE (DATA (S_GOOD)),
686 PADDR_B (bad_status),
687
688
689
690
691
692 SCR_FROM_REG (HF_REG),
693 0,
694 SCR_JUMP ^ IFFALSE (MASK (0 ,(HF_SENSE|HF_EXT_ERR))),
695 PADDR_A (complete_error),
696},{
697
698
699
700
701
702
703
704 SCR_STORE_ABS (dsa, 4),
705 PADDR_B (scratch),
706 SCR_LOAD_ABS (dsa, 4),
707 PADDR_B (done_pos),
708 SCR_LOAD_ABS (scratcha, 4),
709 PADDR_B (scratch),
710 SCR_STORE_REL (scratcha, 4),
711 0,
712
713
714
715
716
717
718
719 SCR_LOAD_REL (scratcha, 4),
720 4,
721 SCR_INT_FLY,
722 0,
723 SCR_STORE_ABS (scratcha, 4),
724 PADDR_B (done_pos),
725},{
726 SCR_JUMP,
727 PADDR_A (start),
728},{
729 SCR_LOAD_ABS (scratcha, 4),
730 PADDR_B (startpos),
731 SCR_INT,
732 SIR_COMPLETE_ERROR,
733},{
734
735
736
737
738 SCR_CLR (SCR_ACK),
739 0,
740
741
742
743
744
745
746 SCR_REG_REG (HF_REG, SCR_OR, HF_DP_SAVED),
747 0,
748
749
750
751
752 SCR_LOAD_REL (scratcha, 4),
753 offsetof (struct sym_ccb, phys.head.lastp),
754 SCR_STORE_REL (scratcha, 4),
755 offsetof (struct sym_ccb, phys.head.savep),
756
757
758
759
760 SCR_JUMP ^ IFTRUE (WHEN (SCR_MSG_IN)),
761 PADDR_A (msg_in),
762 SCR_JUMP,
763 PADDR_A (dispatch),
764},{
765
766
767
768
769 SCR_CLR (SCR_ACK),
770 0,
771
772
773
774 SCR_LOAD_REL (scratcha, 4),
775 offsetof (struct sym_ccb, phys.head.savep),
776 SCR_STORE_REL (scratcha, 4),
777 offsetof (struct sym_ccb, phys.head.lastp),
778 SCR_JUMP,
779 PADDR_A (dispatch),
780},{
781
782
783
784
785
786
787 SCR_REG_REG (scntl2, SCR_AND, 0x7f),
788 0,
789 SCR_CLR (SCR_ACK|SCR_ATN),
790 0,
791
792
793
794 SCR_WAIT_DISC,
795 0,
796
797
798
799 SCR_LOAD_REG (HS_REG, HS_DISCONNECT),
800 0,
801
802
803
804 SCR_STORE_REL (scr0, 4),
805 offsetof (struct sym_ccb, phys.head.status),
806 SCR_JUMP,
807 PADDR_A (start),
808},{
809
810
811
812
813
814
815 SCR_REG_REG (gpreg, SCR_OR, 0x01),
816 0,
817#ifdef SYM_CONF_IARB_SUPPORT
818 SCR_JUMPR,
819 8,
820#endif
821},{
822#ifdef SYM_CONF_IARB_SUPPORT
823
824
825
826
827
828 SCR_REG_REG (scntl1, SCR_OR, IARB),
829 0,
830#endif
831
832
833
834
835
836
837 SCR_LOAD_REG (dsa, 0xff),
838 0,
839 SCR_STORE_ABS (scratcha, 4),
840 PADDR_B (startpos),
841},{
842#ifdef SYM_CONF_TARGET_ROLE_SUPPORT
843
844
845
846 SCR_CLR (SCR_TRG),
847 0,
848#endif
849
850
851
852 SCR_WAIT_RESEL,
853 PADDR_A(start),
854},{
855
856
857
858
859
860 SCR_REG_REG (gpreg, SCR_AND, 0xfe),
861 0,
862
863
864
865 SCR_REG_SFBR (ssid, SCR_AND, 0x8F),
866 0,
867 SCR_TO_REG (sdid),
868 0,
869
870
871
872 SCR_LOAD_ABS (dsa, 4),
873 PADDR_B (targtbl),
874 SCR_SFBR_REG (dsa, SCR_SHL, 0),
875 0,
876 SCR_REG_REG (dsa, SCR_SHL, 0),
877 0,
878 SCR_REG_REG (dsa, SCR_AND, 0x3c),
879 0,
880 SCR_LOAD_REL (dsa, 4),
881 0,
882
883
884
885
886 SCR_INT ^ IFFALSE (WHEN (SCR_MSG_IN)),
887 SIR_RESEL_NO_MSG_IN,
888
889
890
891 SCR_LOAD_REL (scntl3, 1),
892 offsetof(struct sym_tcb, head.wval),
893 SCR_LOAD_REL (sxfer, 1),
894 offsetof(struct sym_tcb, head.sval),
895},{
896
897
898
899
900 SCR_LOAD_REL (scntl4, 1),
901 offsetof(struct sym_tcb, head.uval),
902
903
904
905 SCR_MOVE_ABS (1) ^ SCR_MSG_IN,
906 HADDR_1 (msgin),
907
908
909
910
911 SCR_JUMP ^ IFTRUE (MASK (0x80, 0xbf)),
912 PADDR_A (resel_lun0),
913
914
915
916
917 SCR_INT ^ IFFALSE (MASK (0x80, 0x80)),
918 SIR_RESEL_NO_IDENTIFY,
919
920
921
922
923 SCR_LOAD_REL (dsa, 4),
924 offsetof(struct sym_tcb, head.luntbl_sa),
925 SCR_SFBR_REG (dsa, SCR_SHL, 0),
926 0,
927 SCR_REG_REG (dsa, SCR_SHL, 0),
928 0,
929 SCR_REG_REG (dsa, SCR_AND, 0xfc),
930 0,
931 SCR_LOAD_REL (dsa, 4),
932 0,
933 SCR_JUMPR,
934 8,
935},{
936
937
938
939 SCR_LOAD_REL (dsa, 4),
940 offsetof(struct sym_tcb, head.lun0_sa),
941
942
943
944 SCR_LOAD_REL (temp, 4),
945 offsetof(struct sym_lcb, head.resel_sa),
946 SCR_RETURN,
947 0,
948
949},{
950
951
952
953 SCR_CLR (SCR_ACK),
954 0,
955
956
957
958
959
960
961 SCR_MOVE_ABS (2) ^ SCR_MSG_IN,
962 HADDR_1 (msgin),
963
964
965
966
967 SCR_LOAD_REL (dsa, 4),
968 offsetof(struct sym_lcb, head.itlq_tbl_sa),
969
970
971
972
973 SCR_REG_SFBR (sidl, SCR_SHL, 0),
974 0,
975#if SYM_CONF_MAX_TASK*4 > 512
976 SCR_JUMPR ^ IFFALSE (CARRYSET),
977 8,
978 SCR_REG_REG (dsa1, SCR_OR, 2),
979 0,
980 SCR_REG_REG (sfbr, SCR_SHL, 0),
981 0,
982 SCR_JUMPR ^ IFFALSE (CARRYSET),
983 8,
984 SCR_REG_REG (dsa1, SCR_OR, 1),
985 0,
986#elif SYM_CONF_MAX_TASK*4 > 256
987 SCR_JUMPR ^ IFFALSE (CARRYSET),
988 8,
989 SCR_REG_REG (dsa1, SCR_OR, 1),
990 0,
991#endif
992
993
994
995
996 SCR_SFBR_REG (dsa, SCR_AND, 0xfc),
997 0,
998 SCR_LOAD_REL (dsa, 4),
999 0,
1000 SCR_LOAD_REL (temp, 4),
1001 offsetof(struct sym_ccb, phys.head.go.restart),
1002 SCR_RETURN,
1003 0,
1004
1005},{
1006
1007
1008
1009 SCR_CLR (SCR_ACK),
1010 0,
1011},{
1012
1013
1014
1015 SCR_LOAD_REL (scr0, 4),
1016 offsetof (struct sym_ccb, phys.head.status),
1017
1018
1019
1020 SCR_JUMP,
1021 PADDR_A (dispatch),
1022},{
1023
1024
1025
1026 SCR_LOAD_REL (dsa, 4),
1027 offsetof(struct sym_lcb, head.itl_task_sa),
1028
1029
1030
1031 SCR_LOAD_REL (temp, 4),
1032 offsetof(struct sym_ccb, phys.head.go.restart),
1033 SCR_RETURN,
1034 0,
1035
1036},{
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
10470
1048},{
1049 SCR_CALL,
1050 PADDR_A (datai_done),
1051 SCR_JUMP,
1052 PADDR_B (data_ovrun),
1053},{
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
10640
1065},{
1066 SCR_CALL,
1067 PADDR_A (datao_done),
1068 SCR_JUMP,
1069 PADDR_B (data_ovrun),
1070},{
1071
1072
1073
1074
1075 SCR_FROM_REG (HF_REG),
1076 0,
1077
1078
1079
1080 SCR_JUMP ^ IFFALSE (WHEN (SCR_DATA_IN)),
1081 PADDR_A (pm0_data_out),
1082
1083
1084
1085
1086 SCR_JUMP ^ IFFALSE (MASK (HF_DATA_IN, HF_DATA_IN)),
1087 PADDR_B (data_ovrun),
1088
1089
1090
1091
1092 SCR_REG_REG (HF_REG, SCR_OR, HF_IN_PM0),
1093 0,
1094
1095
1096
1097 SCR_CHMOV_TBL ^ SCR_DATA_IN,
1098 offsetof (struct sym_ccb, phys.pm0.sg),
1099 SCR_JUMP,
1100 PADDR_A (pm0_data_end),
1101},{
1102
1103
1104
1105
1106 SCR_JUMP ^ IFTRUE (MASK (HF_DATA_IN, HF_DATA_IN)),
1107 PADDR_B (data_ovrun),
1108
1109
1110
1111
1112 SCR_REG_REG (HF_REG, SCR_OR, HF_IN_PM0),
1113 0,
1114
1115
1116
1117 SCR_CHMOV_TBL ^ SCR_DATA_OUT,
1118 offsetof (struct sym_ccb, phys.pm0.sg),
1119},{
1120
1121
1122
1123
1124 SCR_REG_REG (HF_REG, SCR_AND, (~HF_IN_PM0)),
1125 0,
1126
1127
1128
1129
1130
1131 SCR_LOAD_REL (temp, 4),
1132 offsetof (struct sym_ccb, phys.pm0.ret),
1133 SCR_RETURN,
1134 0,
1135},{
1136
1137
1138
1139
1140 SCR_FROM_REG (HF_REG),
1141 0,
1142
1143
1144
1145 SCR_JUMP ^ IFFALSE (WHEN (SCR_DATA_IN)),
1146 PADDR_A (pm1_data_out),
1147
1148
1149
1150
1151 SCR_JUMP ^ IFFALSE (MASK (HF_DATA_IN, HF_DATA_IN)),
1152 PADDR_B (data_ovrun),
1153
1154
1155
1156
1157 SCR_REG_REG (HF_REG, SCR_OR, HF_IN_PM1),
1158 0,
1159
1160
1161
1162 SCR_CHMOV_TBL ^ SCR_DATA_IN,
1163 offsetof (struct sym_ccb, phys.pm1.sg),
1164 SCR_JUMP,
1165 PADDR_A (pm1_data_end),
1166},{
1167
1168
1169
1170
1171 SCR_JUMP ^ IFTRUE (MASK (HF_DATA_IN, HF_DATA_IN)),
1172 PADDR_B (data_ovrun),
1173
1174
1175
1176
1177 SCR_REG_REG (HF_REG, SCR_OR, HF_IN_PM1),
1178 0,
1179
1180
1181
1182 SCR_CHMOV_TBL ^ SCR_DATA_OUT,
1183 offsetof (struct sym_ccb, phys.pm1.sg),
1184},{
1185
1186
1187
1188
1189 SCR_REG_REG (HF_REG, SCR_AND, (~HF_IN_PM1)),
1190 0,
1191
1192
1193
1194
1195
1196 SCR_LOAD_REL (temp, 4),
1197 offsetof (struct sym_ccb, phys.pm1.ret),
1198 SCR_RETURN,
1199 0,
1200}
1201};
1202
1203static struct SYM_FWB_SCR SYM_FWB_SCR = {
1204 {
1205
1206
1207
1208
1209
1210 SCR_JUMP,
1211 PADDR_A (init),
1212},{
1213 SCR_JUMP,
1214 PADDR_B (data_ovrun),
1215},{
1216
1217
1218
1219
1220
1221
1222
1223#ifdef SYM_CONF_TARGET_ROLE_SUPPORT
1224
1225
1226
1227 SCR_CLR (SCR_TRG),
1228 0,
1229#endif
1230
1231
1232
1233 SCR_SEL_TBL_ATN ^ offsetof (struct sym_hcb, abrt_sel),
1234 PADDR_A (reselect),
1235
1236
1237
1238
1239 SCR_JUMPR ^ IFFALSE (WHEN (SCR_MSG_OUT)),
1240 -8,
1241
1242
1243
1244 SCR_INT,
1245 SIR_TARGET_SELECTED,
1246
1247
1248
1249
1250
1251
1252 SCR_REG_REG (scntl2, SCR_AND, 0x7f),
1253 0,
1254 SCR_MOVE_TBL ^ SCR_MSG_OUT,
1255 offsetof (struct sym_hcb, abrt_tbl),
1256 SCR_CLR (SCR_ACK|SCR_ATN),
1257 0,
1258 SCR_WAIT_DISC,
1259 0,
1260
1261
1262
1263 SCR_INT,
1264 SIR_ABORT_SENT,
1265},{
1266
1267
1268
1269 SCR_JUMP,
1270 PADDR_A (start),
1271},{
1272
1273
1274
1275
1276 SCR_JUMP ^ IFTRUE (DATA (M_EXTENDED)),
1277 PADDR_B (msg_extended),
1278
1279
1280
1281
1282 SCR_JUMP ^ IFTRUE (MASK (0x00, 0xf0)),
1283 PADDR_B (msg_received),
1284 SCR_JUMP ^ IFTRUE (MASK (0x10, 0xf0)),
1285 PADDR_B (msg_received),
1286
1287
1288
1289
1290 SCR_JUMP ^ IFFALSE (MASK (0x20, 0xf0)),
1291 PADDR_B (msg_weird_seen),
1292 SCR_CLR (SCR_ACK),
1293 0,
1294 SCR_MOVE_ABS (1) ^ SCR_MSG_IN,
1295 HADDR_1 (msgin[1]),
1296},{
1297 SCR_LOAD_REL (scratcha, 4),
1298 0,
1299 SCR_INT,
1300 SIR_MSG_RECEIVED,
1301},{
1302 SCR_LOAD_REL (scratcha, 4),
1303 0,
1304 SCR_INT,
1305 SIR_MSG_WEIRD,
1306},{
1307
1308
1309
1310
1311 SCR_CLR (SCR_ACK),
1312 0,
1313 SCR_MOVE_ABS (1) ^ SCR_MSG_IN,
1314 HADDR_1 (msgin[1]),
1315
1316
1317
1318
1319 SCR_JUMP ^ IFTRUE (DATA (0)),
1320 PADDR_B (msg_weird_seen),
1321 SCR_TO_REG (scratcha),
1322 0,
1323 SCR_REG_REG (sfbr, SCR_ADD, (256-8)),
1324 0,
1325 SCR_JUMP ^ IFTRUE (CARRYSET),
1326 PADDR_B (msg_weird_seen),
1327
1328
1329
1330
1331
1332 SCR_STORE_REL (scratcha, 1),
1333 offsetof (struct sym_dsb, smsg_ext.size),
1334 SCR_CLR (SCR_ACK),
1335 0,
1336 SCR_MOVE_TBL ^ SCR_MSG_IN,
1337 offsetof (struct sym_dsb, smsg_ext),
1338 SCR_JUMP,
1339 PADDR_B (msg_received),
1340},{
1341
1342
1343
1344 SCR_INT,
1345 SIR_REJECT_TO_SEND,
1346 SCR_SET (SCR_ATN),
1347 0,
1348 SCR_JUMP,
1349 PADDR_A (clrack),
1350},{
1351
1352
1353
1354
1355 SCR_INT,
1356 SIR_REJECT_TO_SEND,
1357 SCR_SET (SCR_ATN),
1358 0,
1359},{
1360 SCR_CLR (SCR_ACK),
1361 0,
1362 SCR_JUMP ^ IFFALSE (WHEN (SCR_MSG_IN)),
1363 PADDR_A (dispatch),
1364 SCR_MOVE_ABS (1) ^ SCR_MSG_IN,
1365 HADDR_1 (scratch),
1366 SCR_JUMP,
1367 PADDR_B (msg_weird1),
1368},{
1369
1370
1371
1372 SCR_SET (SCR_ATN),
1373 0,
1374 SCR_CLR (SCR_ACK),
1375 0,
1376 SCR_JUMP ^ IFFALSE (WHEN (SCR_MSG_OUT)),
1377 PADDR_B (nego_bad_phase),
1378},{
1379
1380
1381
1382 SCR_MOVE_ABS (4) ^ SCR_MSG_OUT,
1383 HADDR_1 (msgout),
1384 SCR_JUMP,
1385 PADDR_B (msg_out_done),
1386},{
1387
1388
1389
1390 SCR_SET (SCR_ATN),
1391 0,
1392 SCR_CLR (SCR_ACK),
1393 0,
1394 SCR_JUMP ^ IFFALSE (WHEN (SCR_MSG_OUT)),
1395 PADDR_B (nego_bad_phase),
1396},{
1397
1398
1399
1400 SCR_MOVE_ABS (5) ^ SCR_MSG_OUT,
1401 HADDR_1 (msgout),
1402 SCR_JUMP,
1403 PADDR_B (msg_out_done),
1404},{
1405
1406
1407
1408 SCR_SET (SCR_ATN),
1409 0,
1410 SCR_CLR (SCR_ACK),
1411 0,
1412 SCR_JUMP ^ IFFALSE (WHEN (SCR_MSG_OUT)),
1413 PADDR_B (nego_bad_phase),
1414},{
1415
1416
1417
1418 SCR_MOVE_ABS (8) ^ SCR_MSG_OUT,
1419 HADDR_1 (msgout),
1420 SCR_JUMP,
1421 PADDR_B (msg_out_done),
1422},{
1423 SCR_INT,
1424 SIR_NEGO_PROTO,
1425 SCR_JUMP,
1426 PADDR_A (dispatch),
1427},{
1428
1429
1430
1431
1432
1433 SCR_MOVE_ABS (1) ^ SCR_MSG_OUT,
1434 HADDR_1 (msgout),
1435
1436
1437
1438
1439 SCR_JUMP ^ IFTRUE (WHEN (SCR_MSG_OUT)),
1440 PADDR_B (msg_out),
1441},{
1442
1443
1444
1445
1446 SCR_INT,
1447 SIR_MSG_OUT_DONE,
1448
1449
1450
1451 SCR_JUMP,
1452 PADDR_A (dispatch),
1453},{
1454
1455
1456
1457 SCR_LOAD_ABS (scratcha, 4),
1458 PADDR_B (zero),
1459},{
1460
1461
1462
1463
1464
1465 SCR_JUMPR ^ IFFALSE (WHEN (SCR_DATA_OUT)),
1466 16,
1467 SCR_CHMOV_ABS (1) ^ SCR_DATA_OUT,
1468 HADDR_1 (scratch),
1469 SCR_JUMP,
1470 PADDR_B (data_ovrun2),
1471
1472
1473
1474
1475 SCR_FROM_REG (scntl2),
1476 0,
1477 SCR_JUMPR ^ IFFALSE (MASK (WSR, WSR)),
1478 16,
1479 SCR_REG_REG (scntl2, SCR_OR, WSR),
1480 0,
1481 SCR_JUMP,
1482 PADDR_B (data_ovrun2),
1483
1484
1485
1486
1487
1488
1489 SCR_JUMPR ^ IFTRUE (WHEN (SCR_DATA_IN)),
1490 16,
1491 SCR_INT,
1492 SIR_DATA_OVERRUN,
1493 SCR_JUMP,
1494 PADDR_A (dispatch),
1495 SCR_CHMOV_ABS (1) ^ SCR_DATA_IN,
1496 HADDR_1 (scratch),
1497},{
1498
1499
1500
1501
1502
1503 SCR_REG_REG (scratcha, SCR_ADD, 0x01),
1504 0,
1505 SCR_REG_REG (scratcha1, SCR_ADDC, 0),
1506 0,
1507 SCR_REG_REG (scratcha2, SCR_ADDC, 0),
1508 0,
1509
1510
1511
1512 SCR_JUMP,
1513 PADDR_B (data_ovrun1),
1514},{
1515 SCR_SET (SCR_ATN),
1516 0,
1517 SCR_CLR (SCR_ACK),
1518 0,
1519
1520
1521
1522
1523 SCR_REG_REG (scntl2, SCR_AND, 0x7f),
1524 0,
1525 SCR_MOVE_ABS (1) ^ SCR_MSG_OUT,
1526 HADDR_1 (msgout),
1527 SCR_CLR (SCR_ACK|SCR_ATN),
1528 0,
1529 SCR_WAIT_DISC,
1530 0,
1531 SCR_INT,
1532 SIR_RESEL_ABORTED,
1533 SCR_JUMP,
1534 PADDR_A (start),
1535},{
1536
1537
1538
1539
1540
1541
1542 SCR_SET (SCR_ATN),
1543 0,
1544 SCR_JUMP,
1545 PADDR_A (send_ident),
1546},{
1547 SCR_CLR (SCR_ATN),
1548 0,
1549 SCR_JUMP,
1550 PADDR_A (select2),
1551},{
1552 SCR_SET (SCR_ATN),
1553 0,
1554 SCR_JUMP,
1555 PADDR_A (select2),
1556},{
1557 SCR_CHMOV_TBL ^ SCR_DATA_IN,
1558 offsetof (struct sym_dsb, sense),
1559 SCR_CALL,
1560 PADDR_A (datai_done),
1561 SCR_JUMP,
1562 PADDR_B (data_ovrun),
1563},{
1564
1565
1566
1567
1568
1569 SCR_INT,
1570 SIR_RESEL_BAD_LUN,
1571 SCR_JUMP,
1572 PADDR_B (abort_resel),
1573},{
1574
1575
1576
1577
1578
1579 SCR_INT,
1580 SIR_RESEL_BAD_I_T_L,
1581 SCR_JUMP,
1582 PADDR_B (abort_resel),
1583},{
1584
1585
1586
1587
1588
1589 SCR_INT,
1590 SIR_RESEL_BAD_I_T_L_Q,
1591 SCR_JUMP,
1592 PADDR_B (abort_resel),
1593},{
1594
1595
1596
1597
1598
1599
1600 SCR_LOAD_ABS (scratcha, 4),
1601 PADDR_B (startpos),
1602 SCR_INT ^ IFFALSE (DATA (S_COND_MET)),
1603 SIR_BAD_SCSI_STATUS,
1604 SCR_RETURN,
1605 0,
1606},{
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618 SCR_FROM_REG (HF_REG),
1619 0,
1620
1621
1622
1623
1624
1625 SCR_JUMP ^ IFTRUE (MASK (0, (HF_IN_PM0 | HF_IN_PM1 | HF_DP_SAVED))),
1626 PADDR_B (pm_handle1),
1627
1628
1629
1630
1631
1632 SCR_JUMPR ^ IFFALSE (MASK (HF_DP_SAVED, HF_DP_SAVED)),
1633 8,
1634 SCR_REG_REG (sfbr, SCR_XOR, HF_ACT_PM),
1635 0,
1636
1637
1638
1639
1640
1641
1642
1643 SCR_JUMP ^ IFTRUE (MASK (0, (HF_IN_PM0 | HF_IN_PM1))),
1644 PADDR_B (pm_handle1),
1645 SCR_JUMPR ^ IFFALSE (MASK (HF_IN_PM0, HF_IN_PM0)),
1646 16,
1647 SCR_LOAD_REL (ia, 4),
1648 offsetof(struct sym_ccb, phys.pm0.ret),
1649 SCR_JUMP,
1650 PADDR_B (pm_save),
1651 SCR_LOAD_REL (ia, 4),
1652 offsetof(struct sym_ccb, phys.pm1.ret),
1653 SCR_JUMP,
1654 PADDR_B (pm_save),
1655},{
1656
1657
1658
1659
1660
1661 SCR_REG_REG (ia, SCR_ADD, 8),
1662 0,
1663 SCR_REG_REG (ia1, SCR_ADDC, 0),
1664 0,
1665},{
1666
1667
1668
1669
1670
1671 SCR_SFBR_REG (HF_REG, SCR_AND, (~(HF_IN_PM0|HF_IN_PM1|HF_DP_SAVED))),
1672 0,
1673
1674
1675
1676 SCR_JUMP ^ IFTRUE (MASK (HF_ACT_PM, HF_ACT_PM)),
1677 PADDR_B (pm1_save),
1678},{
1679 SCR_STORE_REL (ia, 4),
1680 offsetof(struct sym_ccb, phys.pm0.ret),
1681
1682
1683
1684
1685
1686 SCR_FROM_REG (scntl2),
1687 0,
1688 SCR_CALL ^ IFTRUE (MASK (WSR, WSR)),
1689 PADDR_B (pm_wsr_handle),
1690
1691
1692
1693
1694 SCR_STORE_REL (rbc, 4),
1695 offsetof(struct sym_ccb, phys.pm0.sg.size),
1696 SCR_STORE_REL (ua, 4),
1697 offsetof(struct sym_ccb, phys.pm0.sg.addr),
1698
1699
1700
1701 SCR_LOAD_ABS (ia, 4),
1702 PADDR_B (pm0_data_addr),
1703},{
1704 SCR_STORE_REL (ia, 4),
1705 offsetof(struct sym_ccb, phys.head.lastp),
1706 SCR_JUMP,
1707 PADDR_A (dispatch),
1708},{
1709 SCR_STORE_REL (ia, 4),
1710 offsetof(struct sym_ccb, phys.pm1.ret),
1711
1712
1713
1714
1715
1716 SCR_FROM_REG (scntl2),
1717 0,
1718 SCR_CALL ^ IFTRUE (MASK (WSR, WSR)),
1719 PADDR_B (pm_wsr_handle),
1720
1721
1722
1723
1724 SCR_STORE_REL (rbc, 4),
1725 offsetof(struct sym_ccb, phys.pm1.sg.size),
1726 SCR_STORE_REL (ua, 4),
1727 offsetof(struct sym_ccb, phys.pm1.sg.addr),
1728
1729
1730
1731 SCR_LOAD_ABS (ia, 4),
1732 PADDR_B (pm1_data_addr),
1733 SCR_JUMP,
1734 PADDR_B (pm_save_end),
1735},{
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748 SCR_STORE_REL (ua, 4),
1749 offsetof (struct sym_ccb, phys.wresid.addr),
1750
1751
1752
1753 SCR_REG_REG (ua, SCR_ADD, 1),
1754 0,
1755 SCR_REG_REG (ua1, SCR_ADDC, 0),
1756 0,
1757 SCR_REG_REG (ua2, SCR_ADDC, 0),
1758 0,
1759 SCR_REG_REG (ua3, SCR_ADDC, 0),
1760 0,
1761
1762
1763
1764
1765
1766 SCR_LOAD_ABS (scratcha, 4),
1767 PADDR_B (zero),
1768 SCR_REG_REG (scratcha, SCR_OR, 1),
1769 0,
1770 SCR_FROM_REG (rbc3),
1771 0,
1772 SCR_TO_REG (scratcha3),
1773 0,
1774
1775
1776
1777 SCR_STORE_REL (scratcha, 4),
1778 offsetof (struct sym_ccb, phys.wresid.size),
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788 SCR_JUMPR ^ IFFALSE (WHEN (SCR_DATA_IN)),
1789 0,
1790
1791
1792
1793 SCR_CHMOV_TBL ^ SCR_DATA_IN,
1794 offsetof (struct sym_ccb, phys.wresid),
1795
1796
1797
1798
1799
1800 SCR_FROM_REG (rbc),
1801 0,
1802 SCR_RETURN ^ IFFALSE (DATA (0)),
1803 0,
1804 SCR_FROM_REG (rbc1),
1805 0,
1806 SCR_RETURN ^ IFFALSE (DATA (0)),
1807 0,
1808 SCR_FROM_REG (rbc2),
1809 0,
1810 SCR_RETURN ^ IFFALSE (DATA (0)),
1811 0,
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822 SCR_JUMP,
1823 PADDR_B (pm_save_end),
1824},{
1825
1826
1827
1828
1829 SCR_CHMOV_TBL ^ SCR_DATA_IN,
1830 offsetof (struct sym_ccb, phys.wresid),
1831 SCR_JUMP,
1832 PADDR_A (dispatch),
1833
1834},{
1835 SCR_DATA_ZERO,
1836},{
1837 SCR_DATA_ZERO,
1838},{
1839 SCR_DATA_ZERO,
1840},{
1841 SCR_DATA_ZERO,
1842},{
1843 SCR_DATA_ZERO,
1844},{
1845 SCR_DATA_ZERO,
1846},{
1847 SCR_DATA_ZERO,
1848}
1849};
1850
1851static struct SYM_FWZ_SCR SYM_FWZ_SCR = {
1852 {
1853
1854
1855
1856 SCR_LOAD_REL (scratcha, 4),
1857 offsetof(struct sym_hcb, scratch),
1858
1859
1860
1861 SCR_STORE_REL (temp, 4),
1862 offsetof(struct sym_hcb, scratch),
1863
1864
1865
1866 SCR_LOAD_REL (temp, 4),
1867 offsetof(struct sym_hcb, scratch),
1868},{
1869
1870
1871
1872 SCR_INT,
1873 99,
1874}
1875};
1876