/[gxemul]/trunk/src/machines/machine_prep.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_prep.c

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

revision 24 by dpavlin, Mon Oct 8 16:19:56 2007 UTC revision 42 by dpavlin, Mon Oct 8 16:22:32 2007 UTC
# Line 1  Line 1 
1  /*  /*
2   *  Copyright (C) 2005-2006  Anders Gavare.  All rights reserved.   *  Copyright (C) 2005-2007  Anders Gavare.  All rights reserved.
3   *   *
4   *  Redistribution and use in source and binary forms, with or without   *  Redistribution and use in source and binary forms, with or without
5   *  modification, are permitted provided that the following conditions are met:   *  modification, are permitted provided that the following conditions are met:
# Line 25  Line 25 
25   *  SUCH DAMAGE.   *  SUCH DAMAGE.
26   *     *  
27   *   *
28   *  $Id: machine_prep.c,v 1.6 2006/06/24 06:53:04 debug Exp $   *  $Id: machine_prep.c,v 1.20 2007/06/15 18:08:10 debug Exp $
29   *   *
30   *  Machines conforming to the PowerPC Reference Platform specs.   *  COMMENT: Machines conforming to the PowerPC Reference Platform specs
31   */   */
32    
33  #include <stdio.h>  #include <stdio.h>
# Line 40  Line 40 
40  #include "device.h"  #include "device.h"
41  #include "devices.h"  #include "devices.h"
42  #include "machine.h"  #include "machine.h"
 #include "machine_interrupts.h"  
43  #include "memory.h"  #include "memory.h"
44  #include "misc.h"  #include "misc.h"
45    
# Line 48  Line 47 
47    
48  MACHINE_SETUP(prep)  MACHINE_SETUP(prep)
49  {  {
50            char tmpstr[300];
51    
52          struct pci_data *pci_data;          struct pci_data *pci_data;
53          char *model_name = "";          char *model_name = "";
54    
# Line 56  MACHINE_SETUP(prep) Line 57  MACHINE_SETUP(prep)
57          case MACHINE_PREP_IBM6050:          case MACHINE_PREP_IBM6050:
58                  machine->machine_name =                  machine->machine_name =
59                      "PowerPC Reference Platform, IBM 6050/6070";                      "PowerPC Reference Platform, IBM 6050/6070";
                 machine->stable = 1;  
60                  model_name = "IBM PPS Model 6050/6070 (E)";                  model_name = "IBM PPS Model 6050/6070 (E)";
61    
62                  if (machine->emulated_hz == 0)                  if (machine->emulated_hz == 0)
63                          machine->emulated_hz = 20000000;                          machine->emulated_hz = 20000000;
64    
65                  machine->md_int.prep_data = device_add(machine, "prep");                  snprintf(tmpstr, sizeof(tmpstr), "prep irq=%s.cpu[%i]",
66                  machine->isa_pic_data.native_irq = 1;   /*  Semi-bogus  */                      machine->path, machine->bootstrap_cpu);
67                  machine->md_interrupt = isa32_interrupt;                  device_add(machine, tmpstr);
68    
69                  pci_data = dev_eagle_init(machine, machine->memory,                  snprintf(tmpstr, sizeof(tmpstr), "eagle irq=%s.cpu[%i]",
70                      32 /*  isa irq base */, 0 /*  pci irq: TODO */);                      machine->path, machine->bootstrap_cpu);
71                    pci_data = device_add(machine, tmpstr);
                 bus_isa_init(machine, BUS_ISA_IDE0 | BUS_ISA_IDE1,  
                     0x80000000, 0xc0000000, 32, 48);  
72    
73                  bus_pci_add(machine, pci_data, machine->memory,                  bus_pci_add(machine, pci_data, machine->memory,
74                      0, 13, 0, "dec21143");                      0, 13, 0, "dec21143");
75    
76                  if (machine->use_x11) {                  if (machine->x11_md.in_use) {
77                          bus_pci_add(machine, pci_data, machine->memory,                          bus_pci_add(machine, pci_data, machine->memory,
78                              0, 14, 0, "s3_virge");                              0, 14, 0, "s3_virge");
79                  }                  }
# Line 87  MACHINE_SETUP(prep) Line 85  MACHINE_SETUP(prep)
85                  /*  TODO: _EXACT_ model name for mvme2400?  */                  /*  TODO: _EXACT_ model name for mvme2400?  */
86                  model_name = "MOT MVME2400";                  model_name = "MOT MVME2400";
87    
88                  machine->md_int.prep_data = device_add(machine, "prep");                  snprintf(tmpstr, sizeof(tmpstr), "prep irq=%s.cpu[%i]",
89                  machine->isa_pic_data.native_irq = 1;   /*  Semi-bogus  */                      machine->path, machine->bootstrap_cpu);
90                  machine->md_interrupt = isa32_interrupt;                  device_add(machine, tmpstr);
91    
92                  pci_data = dev_eagle_init(machine, machine->memory,                  snprintf(tmpstr, sizeof(tmpstr), "eagle irq=%s.cpu[%i]",
93                      32 /*  isa irq base */, 0 /*  pci irq: TODO */);                      machine->path, machine->bootstrap_cpu);
94                    pci_data = device_add(machine, tmpstr);
                 bus_isa_init(machine, BUS_ISA_IDE0 | BUS_ISA_IDE1,  
                     0x80000000, 0xc0000000, 32, 48);  
95    
96                  break;                  break;
97    
# Line 136  MACHINE_SETUP(prep) Line 132  MACHINE_SETUP(prep)
132          /*  type: console  */          /*  type: console  */
133          store_32bit_word(cpu, cpu->cd.ppc.gpr[6]+12, 20);          store_32bit_word(cpu, cpu->cd.ppc.gpr[6]+12, 20);
134          store_32bit_word(cpu, cpu->cd.ppc.gpr[6]+16, 1);          store_32bit_word(cpu, cpu->cd.ppc.gpr[6]+16, 1);
135          store_buf(cpu, cpu->cd.ppc.gpr[6]+20, machine->use_x11? "vga":"com", 4);          store_buf(cpu, cpu->cd.ppc.gpr[6]+20,
136                machine->x11_md.in_use? "vga":"com", 4);
137          store_32bit_word(cpu, cpu->cd.ppc.gpr[6]+24, 0x3f8);/*  addr  */          store_32bit_word(cpu, cpu->cd.ppc.gpr[6]+24, 0x3f8);/*  addr  */
138          store_32bit_word(cpu, cpu->cd.ppc.gpr[6]+28, 9600);/*  speed  */          store_32bit_word(cpu, cpu->cd.ppc.gpr[6]+28, 9600);/*  speed  */
139    
# Line 181  MACHINE_DEFAULT_RAM(prep) Line 178  MACHINE_DEFAULT_RAM(prep)
178    
179  MACHINE_REGISTER(prep)  MACHINE_REGISTER(prep)
180  {  {
181          MR_DEFAULT(prep, "PowerPC Reference Platform", ARCH_PPC,          MR_DEFAULT(prep, "PowerPC Reference Platform", ARCH_PPC, MACHINE_PREP);
             MACHINE_PREP, 1, 2);  
   
         me->aliases[0] = "prep";  
   
         me->subtype[0] = machine_entry_subtype_new(  
             "IBM 6050/6070", MACHINE_PREP_IBM6050, 2);  
         me->subtype[0]->aliases[0] = "ibm6050";  
         me->subtype[0]->aliases[1] = "ibm6070";  
   
         me->subtype[1] = machine_entry_subtype_new(  
             "MVME2400", MACHINE_PREP_MVME2400, 1);  
         me->subtype[1]->aliases[0] = "mvme2400";  
182    
183            machine_entry_add_alias(me, "prep");
184          me->set_default_ram = machine_default_ram_prep;          me->set_default_ram = machine_default_ram_prep;
185    
186          machine_entry_add(me, ARCH_PPC);          machine_entry_add_subtype(me, "IBM 6050/6070", MACHINE_PREP_IBM6050,
187                "ibm6050", "ibm6070", NULL);
188    
189            machine_entry_add_subtype(me, "MVME2400", MACHINE_PREP_MVME2400,
190                "mvme2400", NULL);
191  }  }
192    

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

  ViewVC Help
Powered by ViewVC 1.1.26