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