/[gxemul]/trunk/src/machines/machine_sgi.c
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /trunk/src/machines/machine_sgi.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 41 by dpavlin, Mon Oct 8 16:21:53 2007 UTC revision 42 by dpavlin, Mon Oct 8 16:22:32 2007 UTC
# Line 25  Line 25 
25   *  SUCH DAMAGE.   *  SUCH DAMAGE.
26   *     *  
27   *   *
28   *  $Id: machine_sgi.c,v 1.18 2007/03/24 06:40:16 debug Exp $   *  $Id: machine_sgi.c,v 1.22 2007/06/15 18:08:10 debug Exp $
29   *   *
30   *  Machine descriptions for Silicon Graphics' MIPS-based machines.   *  COMMENT: Silicon Graphics' MIPS-based machines
31   *   *
32   *  http://obsolete.majix.org/computers/sgi/iptable.shtml contains a   *  http://obsolete.majix.org/computers/sgi/iptable.shtml contains a
33   *  pretty detailed list of IP ("Inhouse Processor") model numbers.   *  pretty detailed list of IP ("Inhouse Processor") model numbers.
# Line 70  MACHINE_SETUP(sgi) Line 70  MACHINE_SETUP(sgi)
70    
71          struct pci_data *pci_data = NULL;          struct pci_data *pci_data = NULL;
72    
73          machine->machine_name = malloc(MACHINE_NAME_MAXBUF);          CHECK_ALLOCATION(machine->machine_name = malloc(MACHINE_NAME_MAXBUF));
         if (machine->machine_name == NULL) {  
                 fprintf(stderr, "out of memory\n");  
                 exit(1);  
         }  
74    
75          cpu->byte_order = EMUL_BIG_ENDIAN;          cpu->byte_order = EMUL_BIG_ENDIAN;
76          snprintf(machine->machine_name, MACHINE_NAME_MAXBUF,          snprintf(machine->machine_name, MACHINE_NAME_MAXBUF,
# Line 100  MACHINE_SETUP(sgi) Line 96  MACHINE_SETUP(sgi)
96          }          }
97    
98          net_generate_unique_mac(machine, macaddr);          net_generate_unique_mac(machine, macaddr);
99          eaddr_string = malloc(ETHERNET_STRING_MAXLEN);          CHECK_ALLOCATION(eaddr_string = malloc(ETHERNET_STRING_MAXLEN));
100    
101          switch (machine->machine_subtype) {          switch (machine->machine_subtype) {
102    
# Line 124  MACHINE_SETUP(sgi) Line 120  MACHINE_SETUP(sgi)
120                      " (Everest IP19)", MACHINE_NAME_MAXBUF);                      " (Everest IP19)", MACHINE_NAME_MAXBUF);
121                  machine->main_console_handle = (size_t)device_add(machine,                  machine->main_console_handle = (size_t)device_add(machine,
122                      "z8530 addr=0x1fbd9830 irq=0 addr_mult=4");                      "z8530 addr=0x1fbd9830 irq=0 addr_mult=4");
123                  dev_scc_init(machine, mem, 0x10086000, 0, machine->use_x11,                  dev_scc_init(machine, mem, 0x10086000, 0, machine->x11_md.in_use,
124                      0, 8);      /*  serial? irix?  */                      0, 8);      /*  serial? irix?  */
125    
126                  device_add(machine, "sgi_ip19 addr=0x18000000");                  device_add(machine, "sgi_ip19 addr=0x18000000");
# Line 187  abort(); Line 183  abort();
183                      "z8530 addr=0x1fb80d00 irq=0 addr_mult=4");                      "z8530 addr=0x1fb80d00 irq=0 addr_mult=4");
184    
185                  /*  WDSC SCSI controller:  */                  /*  WDSC SCSI controller:  */
186                  dev_wdsc_init(machine, mem, 0x1fb8011f, 0, 0);  /*              dev_wdsc_init(machine, mem, 0x1fb8011f, 0, 0);  */
187    
188                  /*  Return memory read errors so that hpc1                  /*  Return memory read errors so that hpc1
189                      and hpc2 are not detected:  */                      and hpc2 are not detected:  */
# Line 276  abort(); Line 272  abort();
272  fatal("TODO: legacy rewrite\n");  fatal("TODO: legacy rewrite\n");
273  abort();  abort();
274  //              j = dev_pckbc_init(machine, mem, 0x1fbd9840, PCKBC_8242,  //              j = dev_pckbc_init(machine, mem, 0x1fbd9840, PCKBC_8242,
275  //                  0, 0, machine->use_x11, 0);  /*  TODO: irq numbers  */  //                  0, 0, machine->x11_md.in_use, 0);  /*  TODO: irq numbers  */
276  j = 0;  j = 0;
277    
278                  if (machine->use_x11)                  if (machine->x11_md.in_use)
279                          machine->main_console_handle = j;                          machine->main_console_handle = j;
280    
281                  /*  sq0: Ethernet.  TODO:  This should have irq_nr = 8 + 3  */                  /*  sq0: Ethernet.  TODO:  This should have irq_nr = 8 + 3  */
282                  /*  dev_sq_init...  */                  /*  dev_sq_init...  */
283    
284                  /*  wdsc0: SCSI  */                  /*  wdsc0: SCSI  */
285                  dev_wdsc_init(machine, mem, 0x1fbc4000, 0, 8 + 1);  /*              dev_wdsc_init(machine, mem, 0x1fbc4000, 0, 8 + 1);  */
286    
287                  /*  wdsc1: SCSI  TODO: irq nr  */                  /*  wdsc1: SCSI  TODO: irq nr  */
288                  dev_wdsc_init(machine, mem, 0x1fbcc000, 1, 8 + 1);  /*              dev_wdsc_init(machine, mem, 0x1fbcc000, 1, 8 + 1);  */
289    
290                  /*  dsclock0: TODO:  possibly irq 8 + 33  */                  /*  dsclock0: TODO:  possibly irq 8 + 33  */
291    
# Line 313  j = 0; Line 309  j = 0;
309    
310                   /*  serial? irix?  */                   /*  serial? irix?  */
311                  dev_scc_init(machine, mem,                  dev_scc_init(machine, mem,
312                      0x400086000ULL, 0, machine->use_x11, 0, 8);                      0x400086000ULL, 0, machine->x11_md.in_use, 0, 8);
313    
314                  /*  NOTE: ip19! (perhaps not really the same  */                  /*  NOTE: ip19! (perhaps not really the same  */
315                  device_add(machine, "sgi_ip19 addr=0x18000000");                  device_add(machine, "sgi_ip19 addr=0x18000000");
# Line 398  abort(); Line 394  abort();
394    
395                  /*  TODO: irq!  */                  /*  TODO: irq!  */
396                  snprintf(tmpstr, sizeof(tmpstr), "ns16550 irq=0 addr="                  snprintf(tmpstr, sizeof(tmpstr), "ns16550 irq=0 addr="
397                      "0x1f620170 name2=tty0 in_use=%i", machine->use_x11? 0 : 1);                      "0x1f620170 name2=tty0 in_use=%i", machine->x11_md.in_use? 0 : 1);
398                  machine->main_console_handle = (size_t)device_add(machine,                  machine->main_console_handle = (size_t)device_add(machine,
399                      tmpstr);                      tmpstr);
400                  snprintf(tmpstr, sizeof(tmpstr), "ns16550 irq=0 addr="                  snprintf(tmpstr, sizeof(tmpstr), "ns16550 irq=0 addr="
# Line 412  abort(); Line 408  abort();
408    
409          case 32:          case 32:
410                  strlcat(machine->machine_name, " (O2)", MACHINE_NAME_MAXBUF);                  strlcat(machine->machine_name, " (O2)", MACHINE_NAME_MAXBUF);
                 machine->stable = 1;  
411    
412                  /*  TODO: Find out where the phys ram is actually located.  */                  /*  TODO: Find out where the phys ram is actually located.  */
413                  dev_ram_init(machine, 0x07ffff00ULL,           256,                  dev_ram_init(machine, 0x07ffff00ULL,           256,
# Line 434  abort(); Line 429  abort();
429                  snprintf(tmpstr, sizeof(tmpstr), "%s.cpu[%i].2",                  snprintf(tmpstr, sizeof(tmpstr), "%s.cpu[%i].2",
430                      machine->path, machine->bootstrap_cpu);                      machine->path, machine->bootstrap_cpu);
431                  dev_crime_init(machine, mem, 0x14000000, tmpstr,                  dev_crime_init(machine, mem, 0x14000000, tmpstr,
432                      machine->use_x11);                          /*  crime0  */                      machine->x11_md.in_use);                            /*  crime0  */
433                  dev_sgi_mte_init(mem, 0x15000000);              /*  mte ???  */                  dev_sgi_mte_init(mem, 0x15000000);              /*  mte ???  */
434                  dev_sgi_gbe_init(machine, mem, 0x16000000);     /*  gbe?  */                  dev_sgi_gbe_init(machine, mem, 0x16000000);     /*  gbe?  */
435    
# Line 478  abort(); Line 473  abort();
473                   *  intr 7 = MACE_PCI_BRIDGE                   *  intr 7 = MACE_PCI_BRIDGE
474                   */                   */
475    
                 if (eaddr_string == NULL) {  
                         fprintf(stderr, "out of memory\n");  
                         exit(1);  
                 }  
476                  snprintf(eaddr_string, ETHERNET_STRING_MAXLEN,                  snprintf(eaddr_string, ETHERNET_STRING_MAXLEN,
477                      "eaddr=%02x:%02x:%02x:%02x:%02x:%02x",                      "eaddr=%02x:%02x:%02x:%02x:%02x:%02x",
478                      macaddr[0], macaddr[1], macaddr[2],                      macaddr[0], macaddr[1], macaddr[2],
# Line 498  abort(); Line 489  abort();
489                      "ns16550 irq=%s.cpu[%i].2.crime.0x%x.mace.%i addr="                      "ns16550 irq=%s.cpu[%i].2.crime.0x%x.mace.%i addr="
490                      "0x1f390000 addr_mult=0x100 in_use=%i name2=tty0",                      "0x1f390000 addr_mult=0x100 in_use=%i name2=tty0",
491                      machine->path, machine->bootstrap_cpu,                      machine->path, machine->bootstrap_cpu,
492                      MACE_PERIPH_SERIAL, 20, machine->use_x11? 0 : 1);                      MACE_PERIPH_SERIAL, 20, machine->x11_md.in_use? 0 : 1);
493                  j = (size_t)device_add(machine, tmpstr);                  j = (size_t)device_add(machine, tmpstr);
494                  snprintf(tmpstr, sizeof(tmpstr),                  snprintf(tmpstr, sizeof(tmpstr),
495                      "ns16550 irq=%s.cpu[%i].2.crime.0x%x.mace.%i addr="                      "ns16550 irq=%s.cpu[%i].2.crime.0x%x.mace.%i addr="
# Line 514  abort(); Line 505  abort();
505  #if 0  #if 0
506  fatal("TODO: legacy SGI rewrite\n");  fatal("TODO: legacy SGI rewrite\n");
507  abort();  abort();
508                  if (machine->use_x11) {                  if (machine->x11_md.in_use) {
509                          i = dev_pckbc_init(machine, mem, 0x1f320000,                          i = dev_pckbc_init(machine, mem, 0x1f320000,
510                              PCKBC_8242, 0x200 + MACE_PERIPH_MISC,                              PCKBC_8242, 0x200 + MACE_PERIPH_MISC,
511                              0x800 + MACE_PERIPH_MISC, machine->use_x11, 0);                              0x800 + MACE_PERIPH_MISC, machine->x11_md.in_use, 0);
512                                  /*  keyb+mouse (mace irq numbers)  */                                  /*  keyb+mouse (mace irq numbers)  */
513                          machine->main_console_handle = i;                          machine->main_console_handle = i;
514                  }                  }

Legend:
Removed from v.41  
changed lines
  Added in v.42

  ViewVC Help
Powered by ViewVC 1.1.26