1 /****^  ***********************************************************
  2         *                                                         *
  3         * Copyright, (C) Honeywell Bull Inc., 1987                *
  4         *                                                         *
  5         * Copyright, (C) Honeywell Information Systems Inc., 1982 *
  6         *                                                         *
  7         * Copyright (c) 1972 by Massachusetts Institute of        *
  8         * Technology and Honeywell Information Systems, Inc.      *
  9         *                                                         *
 10         *********************************************************** */
 11 
 12 
 13 /* SCAS_INIT - Initialize the System Controller Addressing Segment.
 14    7/24/69 - Noel I. Morris
 15    Modified for follow-on 8/72 by C. L. Jensen & N. I. Morris
 16    Modified 2/76 by Noel I. Morris for 4MW SCU and new reconfig
 17    Modified 2/79 by Bernard S. Greenberg for port expanders/8 cpus.
 18    Modified 6/79 by Mike Grady to improve mem/port config checks
 19    Modified 12/79 by Mike Grady to fix bugs in above change
 20    Modified 9/08/80 by J. A. Bush for the DPS8/70M CPU
 21    Modified 01/04/81, W. Olin Sibert, to convert to new config cards and for
 22    scs$scas_page_table.
 23    Modified January 1981 by C. Hornig to enable ports.
 24    Modified by J. Bongiovanni April 1981 for anti-hog switch setting
 25    Modified April 1982 by J. Bongiovanni to check CPU data switches
 26    Modified 7/82 BIM merge in the Sibert changes.
 27    Modified 10/82 BIM to not set the mask instructions to rmcm/smcm
 28    until AFTER setting the port enable bits.
 29    Modified 8/83 K. Loepere for bootload Multics toehold
 30    Modified 9/83 E. N. Kittlitz to not enable scu port for an OFF IOM.
 31    Modified 4/84 K. Loepere to be less fussy when initializing for bce.
 32    Modified 8/84 K. Loepere to keep cpu ports on bootload scu enabled
 33    after crash.
 34 */
 35 
 36 
 37 /****^  HISTORY COMMENTS:
 38   1) change(88-07-27,Farley), approve(88-10-05,MCR7968),
 39      audit(88-10-10,Beattie), install(88-10-14,MR12.2-1166):
 40      Added check for new rcerr_addscu_memoverlap error code.
 41                                                    END HISTORY COMMENTS */
 42 
 43 %page;
 44 
 45 /* format: style4,delnl,insnl,tree,ifthenstmt,indnoniterend */
 46 scas_init:
 47      procedure;
 48 
 49 dcl  (i, j) fixed bin,                                      /* iteration variables */
 50      found bit (1) aligned,                                 /* useful indicator bit */
 51      dps8 bit (1) aligned,                                  /*  dps8 indicaor used for checking mem tags */
 52      n_cpus fixed bin,                                      /* count of CPU config cards */
 53      n_mems fixed bin,                                      /* count of MEM config cards */
 54      cport fixed bin (3),                                   /* port index of SCU port of CPU being configured */
 55      masks_found (4) bit (1) unal,                          /* used in interrupt cpu assignment */
 56      exp_port fixed bin (2),                                /* port expander subport index */
 57      tag fixed bin (3),                                     /* tag from CPU or MEM card */
 58      errtag fixed bin (3),                                  /* tag of CPU or mask in error */
 59      enabled bit (1) aligned,                               /* port enabled bit */
 60      base fixed bin (17),                                   /* system controller base address */
 61      size fixed bin (17),                                   /* system controller size */
 62      interlace fixed bin (3),                               /* memory interlace type */
 63      expected_base fixed bin (17),                          /* expected base by config deck */
 64      code fixed bin (35),                                   /* error code */
 65      cpu_low_port fixed bin,                                /* low-order cpu port                             */
 66      cpu_high_port fixed bin,                               /* high-order cpu port                            */
 67      cpu_ports bit (36) aligned,                            /* mask for cpu ports                             */
 68      iom_low_port fixed bin,                                /* low-order iom port                             */
 69      iom_high_port fixed bin,                               /* high-order iom port                            */
 70      iom_ports bit (36) aligned,                            /* mask for iom ports                             */
 71      toehold_abs fixed bin (24),                            /* absolute address of toehold */
 72      severity fixed bin;                                    /* for syserr calls (implies whether we try to fix up errors) */
 73 
 74 declare  1 sdwi aligned like sdw_info;
 75 declare  tsdw fixed bin (71);
 76 
 77 dcl  tag_letter (0:7) char (1) aligned static init ("A", "B", "C", "D", "E", "F", "G", "H");
 78                                                             /* for message */
 79 dcl  (
 80      ALL_ONES bit (36) aligned init ("777777777777"b3),
 81      MAX_CYCLE_GROUP fixed bin init (5),
 82      XED_INHIB bit (18) init ("717200"b3)
 83      ) int static options (constant);
 84 
 85 dcl  1 cdata like scs$controller_data based (cdp) aligned,  /* single element of array */
 86      cdp ptr,                                               /* pointer to the above */
 87      1 pdata like scs$processor_data based (pdp) aligned,   /* single element of array */
 88      pdp ptr;                                               /* pointer to the above */
 89 
 90 dcl  scas$ ext,
 91      toehold$ ext;
 92 
 93 dcl  privileged_mode_ut$swap_sdw entry (ptr, ptr),
 94      absadr entry (ptr, fixed bin (35)) returns (fixed bin (24)),
 95      init_scu entry (fixed bin (3), fixed bin (3), fixed bin (35)),
 96      rsw_util$port_info entry (fixed bin (3), bit (1) aligned, fixed bin (17), fixed bin (17), fixed bin (3)),
 97      rsw_util$set_rsw_mask entry (fixed bin (3), bit (1) aligned),
 98      rsw_util$init_rsw_mask entry (fixed bin (3), bit (1) aligned),
 99      scr_util$set_port_enable_bit entry (fixed bin (3), bit (1)),
100      scr_util$set_port_enable entry (fixed bin (3), bit (1)),
101      scr_util$set_cfg entry (fixed bin (3)),
102      sdw_util_$construct entry (ptr, ptr),
103      mask_instruction$smcm entry returns (bit (36) aligned),
104      mask_instruction$rmcm entry returns (bit (36) aligned),
105      config_$find entry (char (4) aligned, ptr),
106      syserr entry options (variable);
107 
108 dcl  (addr, binary, bin, bit, divide, hbound, null, rel, string, substr, unspec) builtin;
109 %page;
110           if ((sys_info$collection_1_phase = EARLY_INITIALIZATION) | (sys_info$collection_1_phase = BOOT_INITIALIZATION)
111                | (sys_info$collection_1_phase = SERVICE_INITIALIZATION))
112           then severity = CRASH;
113           else severity = ANNOUNCE;
114 
115 /* Initialize SCAS to contain 32 SDW's with DF3. */
116 
117           unspec (scs$scas_page_table) = ""b;               /* Clear it out first */
118           do i = 0 to 31;                                   /* Go through the page table. */
119                addr (scs$scas_page_table (i)) -> l68_ptw.df_no = "11"b;
120                                                             /* DF3 */
121           end;                                              /* cause signalled crawlout on touching bad page */
122 
123           unspec (sdwi) = ""b;                              /* Construct the SCAS SDW */
124           sdwi.address = absadr (addr (scs$scas_page_table), code);
125           if code ^= 0 then call syserr (CRASH, "scas_init: Error from absadr setting up SCAS.");
126           sdwi.read = "1"b;                                 /* RW access */
127           sdwi.write = "1"b;
128           sdwi.paged = "1"b;                                /* SCAS is a "paged" segment */
129           sdwi.size = 32 * 1024;                            /* 32 pages */
130 
131           call sdw_util_$construct (addr (tsdw), addr (sdwi));
132                                                             /* Do it */
133 
134           call privileged_mode_ut$swap_sdw (addr (scas$), addr (tsdw));
135                                                             /* Pop it in */
136 
137 /* Require port enable bits for all unused processor ports to be set correctly. */
138 
139           do tag = 0 to 7;
140                call rsw_util$set_rsw_mask (tag, "1"b);
141           end;
142 
143 
144 /* Fill in processor switch template info by copying rsw data read in scs_and_clock_init. */
145 
146           scs$processor_switch_template = scs$processor_switch_data;
147 
148 /* Compute the proper value for the CPU data switches. Print a warning if
149    they're not set to this. */
150 
151           toehold_abs = absadr (addr (toehold$), code);
152           scs$processor_data_switch_value = bit (bin (toehold_abs, 18), 18) || XED_INHIB;
153           if sys_info$collection_1_phase = EARLY_INITIALIZATION | sys_info$collection_1_phase = BOOT_INITIALIZATION
154                | sys_info$collection_1_phase = SERVICE_INITIALIZATION
155           then if scs$processor_switch_data (0) ^= scs$processor_data_switch_value
156                then call syserr (ANNOUNCE, "scas_init: CPU data switches are ^w, should be ^w",
157                          scs$processor_switch_data (0), scs$processor_data_switch_value);
158 
159 
160 /* Set up for computation of cycle port template */
161 
162           iom_low_port, cpu_low_port = 36;
163           iom_high_port, cpu_high_port = -1;
164           iom_ports, cpu_ports = "0"b;
165 %page;
166 /* Get info about each configured CPU. */
167 
168           n_cpus = 0;                                       /* Initialize count of CPU's. */
169           found = "0"b;                                     /* Clear bootload CPU found indicator. */
170           dps8 = "0"b;                                      /* clear dps8 indicator flag */
171 
172           do i = 0 to 7;                                    /* Mark all potential CPU's as halted. */
173                scs$processor_data (i).halted_cpu = "1"b;
174           end;
175 
176           cpu_cardp = null ();                              /* Initialize config deck pointer. */
177 cpu_loop:
178           call config_$find (CPU_CARD_WORD, cpu_cardp);     /* Look for CPU card. */
179           if cpu_cardp = null () then go to cpu_loop_end;   /* If null pointer, no more CPU cards. */
180           n_cpus = n_cpus + 1;                              /* Count a CPU. */
181 
182           tag = cpu_card.tag - 1;                           /* Get expected CPU tag. */
183           if (tag < 0) | (tag > 7)
184           then                                              /* Make sure tag is legit. */
185                call syserr (CRASH, "scas_init: Illegal tag on ^a config card.", CPU_CARD_WORD);
186 
187           pdp = addr (scs$processor_data (tag));            /* Get pointer to data block for this CPU. */
188           if pdata.offline
189           then                                              /* If we already saw config card for this CPU ... */
190                call syserr (CRASH, "scas_init: ^a ^a appears twice in config deck.", CPU_CARD_WORD, tag_letter (tag));
191 
192           if tag = scs$bos_processor_tag then do;           /* If this is CPU running ... */
193                found = "1"b;                                /* Indicate bootload CPU found. */
194                if cpu_card.state ^= "on  " then do;         /* Config card should not lie. */
195                     call syserr (severity, "scas_init: Config card for bootload ^a ^a is ^a, must be on.", CPU_CARD_WORD,
196                          tag_letter (tag), cpu_card.state);
197                     cpu_card.state = "on";                  /* Try to fix */
198                     end;
199                rswp = addr (scs$processor_switch_data (2)); /* get ptr to rsw (2) data */
200                if dps8_rsw_2.cpu_type > 0 then dps8 = "1"b; /* set flag for checking memories */
201                end;
202           else if cpu_card.type = "dps8" then dps8 = "1"b;  /*  set switch for checking memory tags */
203 
204           cport = cpu_card.port;                            /* Get controller port. */
205 
206           if cport < cpu_low_port then cpu_low_port = cport;
207           if cport > cpu_high_port then cpu_high_port = cport;
208 
209           if cpu_card.expander_port ^= -1 then do;          /* Expander port */
210                exp_port = cpu_card.expander_port - 1;       /* Get the subport #. */
211                if (exp_port < 0 | exp_port > 3)
212                then call syserr (CRASH, "scas_init: Illegal expander subport tag on CPU ^a config card.",
213                          tag_letter (tag));
214                if tag = scs$bos_processor_tag
215                then call syserr (CRASH, "scas_init: Bootload CPU may not be on an expander port.");
216                do i = 0 to 7;                               /* Search for duplication. */
217                     if scs$processor_data (i).offline then do;
218                                                             /* Already filled ? */
219                          if scs$processor_data (i).controller_port = cport then do;
220                               if ^scs$expanded_ports (cport)
221                               then call syserr (CRASH,
222                                         "scas_init: SCU port ^d configured as both expanded and non-expanded.", cport);
223                               if scs$processor_data (i).expander_port = exp_port
224                               then call syserr (CRASH,
225                                         "scas_init: CPU ^a and CPU ^a both configured for port ^d subport ^a.",
226                                         tag_letter (tag), tag_letter (i), cport, tag_letter (cport));
227                               end;
228                          end;
229                end;
230                scs$cow (tag).expander_port = exp_port;      /*  Set necessary flags */
231                scs$cow (tag).expanded_port = "1"b;
232                scs$cow (tag).expander_command = "0"b3;      /* Set connect command */
233                pdata.expanded_port = "1"b;
234                scs$expanded_ports (cport) = "1"b;
235                pdata.expander_port = exp_port;
236                end;
237           else if scs$expanded_ports (cport)
238                then call syserr (CRASH, "scas_init: SCU port ^d configured as both expanded and non-expanded port.",
239                          cport);
240           pdata.controller_port = cport;                    /* Get it in the processor data. */
241           scs$cow (tag).controller_port = cport;
242           scs$cow_ptrs (tag).rel_cow_ptr = rel (addr (scs$cow (tag).cow));
243                                                             /* Set up indexable ptrs. */
244           scs$cow_ptrs (tag).tag = "00"b3;                  /* No indirection. */
245           pdata.offline = "1"b;                             /* Set offline state. */
246 
247           if sys_info$collection_1_phase = CRASH_INITIALIZATION
248                                                             /* keep all on cpu's enabled on bootload scu */
249           then if cpu_card.state = "on  " then call scr_util$set_port_enable_bit (cport, "1"b);
250           go to cpu_loop;                                   /* Look for next CPU card. */
251 
252 cpu_loop_end:
253           if n_cpus < 1
254           then                                              /* Must be at least one card. */
255                call syserr (CRASH, "scas_init: No ^a config card.", CPU_CARD_WORD);
256 
257           if ^found then call syserr (CRASH, "scas_init: No config card for bootload ^a.", CPU_CARD_WORD);
258 %page;
259 /* Get info about each configured System Controller. */
260 
261           n_mems = 0;                                       /* Initialize number of controllers. */
262           found = "0"b;                                     /* Initialize switch. */
263           expected_base = 0;                                /* Count config deck size */
264 
265           mem_cardp = null ();                              /* Initialize config card pointer. */
266 mem_loop:
267           call config_$find ("mem ", mem_cardp);            /* Look for a MEM card. */
268           if mem_cardp = null () then go to mem_loop_end;   /* Exit loop when no more MEM cards. */
269           n_mems = n_mems + 1;                              /* Increment number of system controllers. */
270 
271           tag = mem_card.tag - 1;                           /* Get CPU port of controller. */
272           if (tag < 0) | (tag > 7)
273           then                                              /* Make sure tag is legitimate. */
274                call syserr (CRASH, "scas_init: Illegal tag on ^a config card.", MEM_CARD_WORD);
275 
276           if dps8
277           then                                              /* if  a dps8 cpu in config deck... */
278                if tag > 3
279                then call syserr (CRASH,                     /* only  MEM tags A, B, C, and D are allowed */
280                          "scas_init: ^a ^a. Tags greater than ""D"" not supported by DPS8 CPUs", MEM_CARD_WORD,
281                          tag_letter (tag));
282 
283           cdp = addr (scs$controller_data (tag));           /* Get pointer to correct element of array. */
284           if cdata.online | cdata.offline
285           then                                              /* See if controller already found. */
286                call syserr (CRASH, "scas_init: ^a ^a appears twice in config deck.", MEM_CARD_WORD, tag_letter (tag));
287 
288           if mem_card.state = "on  "
289           then                                              /* See if controller is online. */
290                cdata.online = "1"b;                         /* Controller is online. */
291           else if mem_card.state = "off "
292                then                                         /* See if it's offline. */
293                     cdata.offline = "1"b;                   /* Indicate controller offline. */
294                else                                         /* If neither on nor off ... */
295                     call syserr (CRASH, "scas_init: Config card for ^a ^a is neither on nor off.", MEM_CARD_WORD,
296                          tag_letter (tag));
297 
298           call rsw_util$port_info (tag, enabled, base, size, interlace);
299                                                             /* Get info from processor switches. */
300 
301           if base = 0 then do;                              /* Test for low-order controller. */
302                if found
303                then                                         /* If more than one low-order system controller ... */
304                     call syserr (CRASH, "scas_init: More than one low-order MEM.");
305                else do;
306                     found = "1"b;                           /* Set the switch. */
307                     if cdata.offline then do;               /* Must not be offline. */
308                          call syserr (severity, "scas_init: Config card for bootload ^a indicates unit is offline.",
309                               MEM_CARD_WORD);
310                          mem_card.state = "on";
311                          cdata.offline = "0"b;              /* Try to fix */
312                          cdata.online = "1"b;
313                          end;
314                     end;
315                end;
316 
317           if cdata.online & ^enabled then do;               /* If controller is online but not enabled ... */
318                call syserr (severity, "scas_init: MEM ^a is not enabled.", tag_letter (tag));
319                mem_card.state = "off";                      /* Try to fix */
320                cdata.online = "0"b;
321                cdata.offline = "1"b;
322                end;
323           call rsw_util$init_rsw_mask (tag, (cdata.online));/* Set mask for checking processor switches. */
324 
325           cdata.size = size;                                /* Set size of memory. */
326           cdata.base = base;                                /* Set base of memory. */
327           if sys_info$collection_1_phase > SERVICE_INITIALIZATION
328           then scs$controller_config_size (tag) = 512;      /* Officially recognize only 512k during crash */
329           else scs$controller_config_size (tag) = mem_card.size;
330                                                             /* Save for init_sst. */
331 
332           if base < expected_base
333           then call syserr (CRASH, "scas_init: MEM ^a address assignment disagrees with config deck.", tag_letter (tag));
334           if mem_card.size > size
335           then                                              /* More specified than is possible */
336                call syserr (CRASH, "scas_init: Size too large on config card for MEM ^a.", tag_letter (tag));
337 
338           expected_base = base + size;                      /* Set up for next controller */
339 
340           cdata.ext_interlaced = (interlace ^= 0);          /* Indicate if memory is interlaced with another. */
341           cdata.four_word = (interlace = 4);                /* Indicate if two or four word interlace. */
342 
343           if cdata.online then do;                          /* If controller is available now ... */
344                call init_scu (tag, errtag, code);           /* Initialize it. */
345                if code ^= 0
346                then                                         /* Check for error. */
347                     if /* case */ code = rcerr_addscu_size
348                     then call syserr (CRASH, "scas_init: MEM ^a has more memory than indicated by CPU switches.",
349                               tag_letter (tag));
350                     else if code = rcerr_addscu_dup_mask
351                     then call syserr (CRASH, "scas_init: MEM ^a has duplicate mask assignments to CPU ^a.",
352                               tag_letter (tag), tag_letter (errtag));
353                     else if code = rcerr_addscu_no_mask
354                     then call syserr (CRASH, "scas_init: MEM ^a has no mask assigned to CPU ^a.", tag_letter (tag),
355                               tag_letter (errtag));
356                     else if code = rcerr_addscu_bad_mask
357                     then call syserr (CRASH, "scas_init: MEM ^a has mask ^a assigned to non-processor port.",
358                               tag_letter (tag), tag_letter (errtag));
359                     else if code = rcerr_addscu_manual
360                     then call syserr (CRASH, "scas_init: MEM ^a is not in PROGRAM mode.", tag_letter (tag));
361                     else if code = rcerr_addscu_oldexpand
362                     then call syserr (CRASH, "scas_init: MEM ^a is an old SCU with port expander", tag_letter (tag));
363                     else if code = rcerr_addscu_bigconfig
364                     then                                    /* Config more than real mem, die */
365                          call syserr (CRASH, "scas_init: Size too large on config card for MEM ^a.", tag_letter (tag));
366                     else if code = rcerr_addscu_memoverlap
367                     then                                    /* Mem store size or switches wrong */
368                          call syserr (CRASH, "scas_init: Possible memory address overlap in MEM ^a.", tag_letter (tag));
369 
370 
371                end;
372           if sys_info$collection_1_phase > SERVICE_INITIALIZATION then go to mem_loop_end;
373                                                             /* only low 512k memory officially counts during crash */
374           go to mem_loop;                                   /* Iterate for next MEM card. */
375 
376 mem_loop_end:
377           if n_mems < 1
378           then                                              /* Must be at least one card. */
379                call syserr (CRASH, "scas_init: No ^a config card.", MEM_CARD_WORD);
380 
381           if ^found then call syserr (CRASH, "scas_init: No config card for bootload ^a.", MEM_CARD_WORD);
382 %page;
383 /* Check to make sure that bootload CPU port is correct. */
384 
385           scrp = addr (scs$cfg_data (scs$interrupt_controller));
386                                                             /* Get pointer to RSCR CFG data for bootload controller. */
387           if bin (scr_cfg1.port_no, 4) ^= scs$processor_data (scs$bos_processor_tag).controller_port
388           then call syserr (CRASH, "scas_init: CPU config card specifies wrong controller port number.");
389 
390 /* Make sure that no unconfigured port is enabled. */
391 /* Unless we are in early initialization, when this is normal. */
392 
393           if ^(sys_info$collection_1_phase = EARLY_INITIALIZATION | sys_info$collection_1_phase > SERVICE_INITIALIZATION)
394           then do tag = 0 to 7;                             /* Test all ports. */
395                if ^scs$controller_data (tag).offline & ^scs$controller_data (tag).online then do;
396                     call rsw_util$port_info (tag, enabled, base, size, interlace);
397                     if enabled
398                     then                                    /* If unused port is enabled ... */
399                          call syserr (severity,
400                               "scas_init: MEM ^a is not in the configuration, but is enabled by the CPU switches.",
401                               tag_letter (tag));
402                     end;
403           end;
404 %page;
405 /* enable all the IOM's */
406 
407           iom_data_ptr = addr (iom_data$);
408           do tag = 0 to 7;
409                if scs$port_data (tag).assigned = IOM_PORT then do;
410                     if iom_data.per_iom (scs$port_data (tag).iom_number).flags.on_line
411                     then                                    /* someday this will be an scs flag */
412                          call scr_util$set_port_enable_bit (tag, "1"b);
413                     if tag < iom_low_port then iom_low_port = tag;
414                     if tag > iom_high_port then iom_high_port = tag;
415                     end;
416           end;
417 
418 /* and the BOS processor */
419 
420           call scr_util$set_port_enable (binary (scs$processor_data (scs$bos_processor_tag).controller_port, 3), "1"b);
421 
422 %page;
423 /* Determine which CPU's have assigned masks. */
424 
425           cdp = addr (scs$controller_data (scs$interrupt_controller));
426                                                             /* Get pointer to info for bootload controller. */
427 
428           string (masks_found) = "0000"b;                   /* Found no masks. */
429           do i = 0 to 7;                                    /* Look at all CPU's. */
430                pdp = addr (scs$processor_data (i));         /* Get pointer to correct array element. */
431                if pdata.offline then do;
432                     do j = 1 to 4;                          /* If CPU is to be used, look at masks. */
433                          if cdata.eima_data (j).mask_assigned & ^masks_found (j)
434                          then if cdata.eima_data (j).mask_assignment = pdata.controller_port then do;
435                                    masks_found (j) = "1"b;
436                                    pdata.interrupt_cpu = "1"b;
437                                    scs$set_mask (i) = mask_instruction$smcm ();
438                                    scs$read_mask (i) = mask_instruction$rmcm ();
439                                    scs$mask_ptr (i) = addr (scs$port_addressing_word (scs$interrupt_controller));
440                                    end;
441                     end;
442                     end;
443           end;
444 
445 
446 /* Check to make sure that bootload CPU has mask assigned to it. */
447 
448           if ^scs$processor_data (scs$bos_processor_tag).interrupt_cpu
449           then call syserr (CRASH, "scas_init: Bootload CPU has no system controller mask assigned.");
450 %page;
451 
452 
453 
454 /* Setup to set cyclic port priority switches (anti-hog).  The strategy
455    is to put all IOMs on a cyclic priority group, all bulk stores on
456    a cyclic priority group, and all CPUs on a cyclic priority group.
457    This can only be done if the ranges of ports within each group
458    do not overlap.  The following checks for overlap.  */
459 
460 
461           substr (iom_ports, iom_low_port + 1, iom_high_port - iom_low_port + 1) =
462                substr (ALL_ONES, 1, iom_high_port - iom_low_port + 1);
463           substr (cpu_ports, cpu_low_port + 1, cpu_high_port - cpu_low_port + 1) =
464                substr (ALL_ONES, 1, cpu_high_port - cpu_low_port + 1);
465 
466           if (iom_ports & cpu_ports) = ""b                  /* no overlap                                     */
467           then do;
468                call set_cycle_group (iom_low_port, iom_high_port);
469                call set_cycle_group (cpu_low_port, cpu_high_port);
470                scs$set_cycle_switches = "1"b;
471                do i = 0 to hbound (scs$controller_data, 1); /* set switches on all active SCUs                */
472                     if scs$controller_data (i).online then call scr_util$set_cfg (bin (i));
473                end;
474                end;
475           else do;                                          /* cannot set switches                            */
476                scs$set_cycle_switches = "0"b;
477                call syserr (ANNOUNCE,
478                     "scs_init: CPU/IOM port range overlap. Using manual settings for cycle port priority.");
479                end;
480 
481           return;
482 %page;
483 /* SET_CYCLE_GROUP - internal procedure to setup cfg bits for a cycle (anti-hog)
484    group                                                                                                      */
485 
486 set_cycle_group:
487      proc (low_port, high_port);
488 
489 dcl  low_port fixed bin;
490 dcl  high_port fixed bin;
491 
492 dcl  middle_port fixed bin;
493 
494 
495           if high_port <= low_port then return;
496           if high_port - low_port > MAX_CYCLE_GROUP then do;/* too many for one group                         */
497                middle_port = low_port + divide (high_port - low_port - 1, 2, 17);
498                                                             /* split evenly, with larger group higher */
499                call set_cycle_group (low_port, middle_port);
500                call set_cycle_group (middle_port + 1, high_port);
501                end;
502           else substr (scs$cycle_priority_template, low_port + 1, high_port - low_port) =
503                     substr (ALL_ONES, 1, high_port - low_port);
504 
505      end set_cycle_group;
506 %page;
507 %include collection_1_phases;
508 %page;
509 %include config_mem_card;
510 %page;
511 %include config_cpu_card;
512 %page;
513 %include iom_data;
514 %page;
515 dcl  ptp pointer;
516 %include "ptw.l68";
517 %page;
518 %include rcerr;
519 %page;
520 %include rsw;
521 %page;
522 %include scr;
523 %page;
524 %include scs;
525 %page;
526 %include sdw_info;
527 %page;
528 %include syserr_constants;
529 %page;
530 /* BEGIN MESSAGE DOCUMENTATION
531 
532    Message:
533    scas_init: Illegal tag on CPU config card.
534 
535    S:     $crash
536 
537    T:     $init
538 
539    M:     One or more CPU cards is incorrect. Tag must be one of A, B, C, D, E, F, G, H.
540 
541    A:     Correct the configuration or the configuration deck, and reboot.
542 
543 
544    Message:
545    scas_init: CPU X appears twice in config deck.
546 
547    S:     $crash
548 
549    T:     $init
550 
551    M:     The configuration deck is incorrect.
552 
553    A:     Correct the the configuration deck and reboot.
554 
555 
556    Message:
557    scas_init: Config card for bootload CPU indicates unit is offline.
558 
559    S:     $crash
560 
561    T:     $init
562 
563    M:     The configuration deck is incorrect.
564 
565    A:     Correct the configuration or the configuration deck, and reboot.
566 
567 
568    Message:
569    scas_init: Config card for CPU X is neither on nor off.
570 
571    S:     $crash
572 
573    T:     $init
574 
575    M:     The configuration deck is incorrect.
576 
577    A:     Correct the the configuration deck and reboot.
578 
579 
580    Message:
581    scas_init: No CPU config card.
582 
583    S:     $crash
584 
585    T:     $init
586 
587    M:     The configuration deck is incorrect.
588 
589    A:     Correct the the configuration deck and reboot.
590 
591 
592    Message:
593    scas_init: No config card for bootload CPU.
594 
595    S:     $crash
596 
597    T:     $init
598 
599    M:     The configuration deck is incorrect.
600 
601    A:     Correct the configuration or the configuration deck, and reboot.
602 
603 
604    Message:
605    scas_init: Illegal tag on MEM config card.
606 
607    S:     $crash
608 
609    T:     $init
610 
611    M:     The configuration deck is incorrect. Tag must be one of A, B, C, D, E, F, G, H.
612 
613    A:     Correct the the configuration deck and reboot.
614 
615    Message:
616    "scas_init:  MEM Y. Tags greater than "D" not supported by DPS8 CPUs",
617 
618    S:     $crash
619 
620    T:     $init
621 
622    M:     The physical configuration or the configuration deck is incorrect. DPS8 CPUs
623    have only 4 memory ports, therefore Multics systems comprised of DPS8 cpus or
624    mixed systems of DPS, L68 and DPS8 cpus can only have 4 memories configured.
625    (i.e. Memory tags A, B, C, and D).
626 
627    A:     Correct the physical configuration and/or the configuration deck and reboot.
628 
629 
630    Message:
631    scas_init: MEM Y appears twice in config deck.
632 
633    S:     $crash
634 
635    T:     $init
636 
637    M:     The configuration deck is incorrect.
638 
639    A:     Correct the the configuration deck and reboot.
640 
641 
642    Message:
643    scas_init: Config card for MEM Y is neither on nor off.
644 
645    S:     $crash
646 
647    T:     $init
648 
649    M:     The configuration deck is incorrect.
650 
651    A:     Correct the the configuration deck and reboot.
652 
653 
654    Message:
655    scas_init: More than one low-order MEM.
656 
657    S:     $crash
658 
659    T:     $init
660 
661    M:     The configuration deck is incorrect.
662 
663    A:     Correct the the configuration deck and reboot.
664 
665 
666    Message:
667    scas_init: Config card for bootload MEM indicates unit is offline.
668 
669    S:     $crash
670 
671    T:     $init
672 
673    M:     The configuration deck is incorrect.
674 
675    A:     Correct the the configuration deck and reboot.
676 
677 
678    Message:
679    scas_init: MEM X is not enabled.
680 
681    S:     $crash
682 
683    T:     $init
684 
685    M:     The bootload CPU does not have MEM X enabled.
686 
687    A:     Correct the configuration or the configuration deck, and reboot.
688 
689 
690    Message:
691    scas_init: Size too large on config card for MEM Y.
692 
693    S:     $crash
694 
695    T:     $init
696 
697    M:     Either the PORT SIZE plug on the free edge of the PQ board
698    of the bootload CPU does not agree with the configuration deck, or the
699    actual amount of memory present in MEM Y does not agree with the
700    config deck.
701 
702 
703    A:     Correct the configuration or the configuration deck, and reboot.
704 
705 
706    Message:
707    scas_init: MEM Y has more memory than indicated by CPU switches.
708 
709    S:     $crash
710 
711    T:     $init
712 
713    M:     The PORT SIZE plug on the free edge of the PQ board
714    of the bootload CPU does not agree with the STORE SIZE switch on MEM Y.
715 
716    A:     Correct the configuration and reboot.
717 
718 
719    Message:
720    scas_init: MEM Y has duplicate mask assignments to CPU X.
721 
722    S:     $crash
723 
724    T:     $init
725 
726    M:     The EXECUTE INTERRUPT MASK ASSIGNMENT
727    or MASK/PORT ASSIGNMENT on memory Y is incorrect.
728 
729    A:     Correct the configuration and reboot.
730 
731 
732    Message:
733    scas_init: MEM Y has no mask assigned to CPU X.
734 
735    S:     $crash
736 
737    T:     $init
738 
739    M:     The EXECUTE INTERRUPT MASK ASSIGNMENT
740    or MASK/PORT ASSIGNMENT on memory Y is incorrect.
741 
742    A:     Correct the configuration and reboot.
743 
744 
745    Message:
746    scas_init: MEM Y address assignment disagrees with config deck.
747 
748    S:     $crash
749 
750    T:     $init
751 
752    M:     The address assignment of memory Y, as read from the
753    address assignment switches on the maintenance panel of the bootload CPU,
754    disagrees with the address assignment
755    of this memory as indicated by the relative position of its MEM card in
756    the configuration deck.
757 
758    A:     If the configuration deck is wrong, correct it and reboot. If the
759    configuration deck is correct, check all address assignment
760    switches on processors, IOMs, and the Bulk Store Controller, correct them,
761    reboot bce, and reboot.
762 
763    Message:
764    scas_init: MEM Y has mask Z assigned to non-processor port.
765 
766    S:     $crash
767 
768    T:     $init
769 
770    M:     The EXECUTE INTERRUPT MASK ASSIGNMENT
771    or MASK/PORT ASSIGNMENT on memory Y is incorrect.
772 
773    A:     Correct the configuration and reboot.
774 
775 
776    Message:
777    scas_init: MEM Y is not in PROGRAM mode.
778 
779    S:     $crash
780 
781    T:     $init
782 
783    M:     The MODE switch for memory Y is incorrect.
784 
785    A:     Correct the configuration and reboot.
786 
787 
788    Message:
789    scas_init: No MEM config card.
790 
791    S:     $crash
792 
793    T:     $init
794 
795    M:     The configuration deck is incorrect.
796 
797    A:     Correct the the configuration deck and reboot.
798 
799 
800    Message:
801    scas_init: No config card for bootload MEM
802 
803    S:     $crash
804 
805    T:     $init
806 
807    M:     The configuration deck is incorrect.
808 
809    A:     Correct the the configuration deck and reboot.
810 
811 
812    Message:
813    scas_init: Possible memory address overlap in MEM Y.
814 
815    S:     $crash
816 
817    T:     $init
818 
819    M:     This indicates that the lower store size does not agree with
820    the actual memory available in the store unit.  A possible example
821    of this is when the lower store is actually in two store units
822    (A and A1) and the secondary unit (A1) is not enabled.
823 
824    A:     Correct the configuration and reboot.
825 
826 
827    Message:
828    scas_init: CPU config card specifies wrong controller port number.
829 
830    S:     $crash
831 
832    T:     $init
833 
834    M:     The configuration deck is incorrect.
835 
836    A:     Correct the configuration or the configuration deck, and reboot.
837 
838 
839    Message:
840    scas_init: Bootload CPU has no system controller mask assigned.
841 
842    S:     $crash
843 
844    T:     $init
845 
846    M:     No memory assigns a mask register to the bootload CPU.
847 
848    A:     Correct the configuration and reboot.
849 
850 
851    Message:
852    scas_init: MEM Y is not in the configuration, but is enabled by the CPU switches.
853 
854    S:     $crash
855 
856    T:     $init
857 
858    M:     The bootload CPU enables memory Y.
859    But there is no MEM card for this memory.
860 
861    A:     Correct the configuration or the configuration deck, and reboot.
862 
863 
864    Message:
865    scas_init: Illegal expander subport tag on CPU X config card.
866 
867    S:     $crash
868 
869    T:     $init
870 
871    M:     A CPU config card, for CPU X, specifies an illegal value
872    for a port-expander subport.  The only legal values for
873    expander subports are A, B, C, and D.
874 
875    A:     Correct the config deck and reboot.
876 
877 
878    Message:
879    scas_init: Bootload CPU may not be on an expander port.
880 
881    S:     $crash
882 
883    T:     $init
884 
885    M:     The CPU config card for the bootload CPU indicates
886    that the bootload CPU is on an expanded port.  This is not
887    permitted.
888 
889    A:     Correct the configuration or the configuration deck, and reboot.
890 
891    Message:
892    scas_init: SCU port P configured as both expanded and non-expanded.
893 
894    S:     $crash
895 
896    T:     $init
897 
898    M:     CPU configuration cards imply that Port P on SCU's
899    (P is the port number, from 0 to 7) is both an expander port
900    (by being named as the CPU port in a CPU card with an
901    expander_port field), and not an expander port (by being named
902    in one that has none).
903 
904    A:     Correct the configuratin deck and reboot.
905 
906    Message:
907    scas_init: CPU X and CPU Y both configured for port P subport S
908 
909    S:     $crash
910 
911    T:     $init
912 
913    M:     The CPU CONFIG cards for CPU's X and Y both indicate that
914    they are connected to subport S of expanded SCU port P.
915    This is clearly impossible.
916 
917    A:     Correct the configuration deck and reboot.
918 
919    Message:
920    scas_init: MEM X is an old SCU with port expander
921 
922    S:     $crash
923 
924    T:     $init
925 
926    M:     System controller X is an old-style SCU, but configuration cards
927    indicate that it has at least one expanded port, because there is
928    a CPU on an expanded port in the system.  Old-style system controllers
929    may not have expanded ports.
930 
931    A:     The configuration deck is in error. Fix it and reboot.
932 
933    Message:
934    scs_init: CPU/IOM port range overlap. Using manual settings for cycle port priority.
935 
936    S:     $info
937 
938    T:     $init
939 
940    M:     The cycle port priority on the SCUs cannot be set optimally because
941    the range of port numbers for CPUs and IOMs overlap.  The
942    manual settings of the cycle port priority switches on the SCUs will
943    be used instead.  The system may experience problems as a result, with
944    the typical symptom being op-not-complete faults at random times
945    by CPUs with higher port numbers (lower SCU port priority).
946 
947    A:     Continue to operate the system normally, but consult with
948    Field Engineering personnel.  If possible, the system should be
949    reconfigured so that the range of port numbers of IOMs
950    and CPU do not overlap.  Further, CPU should be on higher-numbered
951    ports than IOMs and Bulk Stores.
952 
953    Message:
954    scas_init: CPU data switches are XXXXXXXXXXXX, should be YYYYYYYYYYYY
955 
956    S:     $info
957 
958    T:     $init
959 
960    M:     The CPU data switches are not set properly. The proper values are
961    displayed.
962 
963    A:     The incorrect value will prevent returning to bce on that CPU
964    by means of EXECUTE SWITCHES. Certain incorrect values will activate
965    software debugging traps. The switches should be corrected. This
966    can be done while the CPU is running.
967 
968 
969    END MESSAGE DOCUMENTATION */
970 
971      end scas_init;