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

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

revision 26 by dpavlin, Mon Oct 8 16:20:10 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_macppc.c,v 1.5 2006/06/24 10:19:19 debug Exp $   *  $Id: machine_macppc.c,v 1.16 2007/06/15 18:08:10 debug Exp $
29   *   *
30   *  NOTE: Currently, these are skeletons for generic PowerMac G3, G4, and G5   *  COMMENT: Generic PowerPC-based Macintosh machines
31   *        systems. They do not model real PowerMacs, but should be enough to   *
32   *        begin experimenting with NetBSD/macppc and OpenBSD/macppc.   *  See also:
33     *
34     *      NetBSD/macppc (http://www.netbsd.org/ports/macppc/)
35     *      OpenBSD/macppc (http://www.openbsd.org/macppc.html)
36     *
37     *  Currently, these are skeletons for generic PowerMac G3, G4, and G5 systems.
38     *  They do not model real PowerMacs, but should be enough to begin
39     *  experimenting with running NetBSD/macppc and OpenBSD/macppc.
40   */   */
41    
42  #include <stdio.h>  #include <stdio.h>
43    #include <stdlib.h>
44  #include <string.h>  #include <string.h>
45    
46    #include "bus_pci.h"
47  #include "cpu.h"  #include "cpu.h"
48  #include "device.h"  #include "device.h"
49  #include "devices.h"  #include "devices.h"
50  #include "machine.h"  #include "machine.h"
 #include "machine_interrupts.h"  
51  #include "memory.h"  #include "memory.h"
52  #include "misc.h"  #include "misc.h"
53  #include "of.h"  #include "of.h"
# Line 47  Line 55 
55    
56  MACHINE_SETUP(macppc)  MACHINE_SETUP(macppc)
57  {  {
58            char tmpstr[300];
59          struct pci_data *pci_data;          struct pci_data *pci_data;
60          struct vfb_data *fb;          struct vfb_data *fb;
61          uint64_t b, a;          uint64_t b, a;
62          int i;          int i;
63    
         /*  
          *  NetBSD/macppc (http://www.netbsd.org/Ports/macppc/)  
          *  OpenBSD/macppc (http://www.openbsd.org/macppc.html)  
          */  
64          machine->machine_name = "Macintosh (PPC)";          machine->machine_name = "Macintosh (PPC)";
65          if (machine->emulated_hz == 0)          if (machine->emulated_hz == 0)
66                  machine->emulated_hz = 40000000;                  machine->emulated_hz = 40000000;
67    
68          machine->md_int.gc_data = dev_gc_init(machine, machine->memory,          device_add(machine, "gc addr=0xf3000000");
             0xf3000000, 64);  
         machine->md_interrupt = gc_interrupt;  
69    
70          pci_data = dev_uninorth_init(machine, machine->memory, 0xe2000000,          pci_data = dev_uninorth_init(machine, machine->memory, 0xe2000000,
71              64 /*  isa irq base */, 0 /*  pci irq: TODO */);              64 /*  isa irq base */, 0 /*  pci irq: TODO */);
72    
73          bus_pci_add(machine, pci_data, machine->memory, 0, 12, 0, "dec21143");          /*  bus_pci_add(
74                machine, pci_data, machine->memory, 0, 12, 0, "dec21143");  */
75          bus_pci_add(machine, pci_data, machine->memory, 0, 15, 0, "gc_obio");          bus_pci_add(machine, pci_data, machine->memory, 0, 15, 0, "gc_obio");
76    
77          if (machine->use_x11)          if (machine->x11_md.in_use)
78                  bus_pci_add(machine, pci_data, machine->memory, 0, 16, 0,                  bus_pci_add(machine, pci_data, machine->memory, 0, 16, 0,
79                      "ati_radeon_9200_2");                      "ati_radeon_9200_2");
80    
81          machine->main_console_handle = (size_t)device_add(machine,          snprintf(tmpstr, sizeof(tmpstr), "z8530 addr=0xf3013000 irq="
82              "z8530 addr=0xf3013000 irq=23 dma_irq=8 addr_mult=0x10");              "%s.cpu[%i].gc.lo.23 addr_mult=0x10",
83                machine->path, machine->bootstrap_cpu);
84            machine->main_console_handle = (size_t)device_add(machine, tmpstr);
85    
86          fb = dev_fb_init(machine, machine->memory, 0xf1000000,          fb = dev_fb_init(machine, machine->memory, 0xf1000000,
87              VFB_GENERIC | VFB_REVERSE_START, 1024,768, 1024,768, 8, "ofb");              VFB_GENERIC | VFB_REVERSE_START, 1024,768, 1024,768, 8, "ofb");
88    
89          device_add(machine, "hammerhead addr=0xf2800000");          device_add(machine, "hammerhead addr=0xf2800000");
90    
91          device_add(machine, "adb addr=0xf3016000 irq=1");          snprintf(tmpstr, sizeof(tmpstr), "adb addr=0xf3016000 irq="
92                "%s.cpu[%i].gc.lo.1", machine->path, machine->bootstrap_cpu);
93            device_add(machine, tmpstr);
94    
95          if (!machine->prom_emulation)          if (!machine->prom_emulation)
96                  return;                  return;
# Line 93  MACHINE_SETUP(macppc) Line 101  MACHINE_SETUP(macppc)
101          of_emul_init(machine, fb, 0xf1000000, 1024, 768);          of_emul_init(machine, fb, 0xf1000000, 1024, 768);
102          of_emul_init_uninorth(machine);          of_emul_init_uninorth(machine);
103    
104          if (machine->use_x11)          if (machine->x11_md.in_use)
105                  of_emul_init_adb(machine);                  of_emul_init_adb(machine);
106          else          else
107                  of_emul_init_zs(machine);                  of_emul_init_zs(machine);

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

  ViewVC Help
Powered by ViewVC 1.1.26