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

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

revision 34 by dpavlin, Mon Oct 8 16:21:17 2007 UTC revision 44 by dpavlin, Mon Oct 8 16:22:56 2007 UTC
# Line 25  Line 25 
25   *  SUCH DAMAGE.   *  SUCH DAMAGE.
26   *     *  
27   *   *
28   *  $Id: machine_evbmips.c,v 1.19 2007/01/28 00:41:17 debug Exp $   *  $Id: machine_evbmips.c,v 1.30 2007/06/17 02:17:45 debug Exp $
29     *
30     *  COMMENT: MIPS evaluation boards (e.g. Malta)
31   */   */
32    
33  #include <stdio.h>  #include <stdio.h>
# Line 50  MACHINE_SETUP(evbmips) Line 52  MACHINE_SETUP(evbmips)
52          struct pci_data *pci_data;          struct pci_data *pci_data;
53          int i;          int i;
54    
55          /*  See http://www.netbsd.org/Ports/evbmips/ for more info.  */          /*  See http://www.netbsd.org/ports/evbmips/ for more info.  */
56    
57          switch (machine->machine_subtype) {          switch (machine->machine_subtype) {
58    
59          case MACHINE_EVBMIPS_MALTA:          case MACHINE_EVBMIPS_MALTA:
60          case MACHINE_EVBMIPS_MALTA_BE:          case MACHINE_EVBMIPS_MALTA_BE:
61                  if (machine->emulated_hz == 0)                  if (machine->emulated_hz == 0)
62                          machine->emulated_hz = 33000000;                          machine->emulated_hz = 33000000;
63                  cpu->byte_order = EMUL_LITTLE_ENDIAN;                  cpu->byte_order = EMUL_LITTLE_ENDIAN;
64                  machine->machine_name = "MALTA (evbmips, little endian)";                  machine->machine_name = "MALTA (evbmips, little endian)";
                 machine->stable = 1;  
65    
66                  if (machine->machine_subtype == MACHINE_EVBMIPS_MALTA_BE) {                  if (machine->machine_subtype == MACHINE_EVBMIPS_MALTA_BE) {
67                          machine->machine_name = "MALTA (evbmips, big endian)";                          machine->machine_name = "MALTA (evbmips, big endian)";
# Line 84  MACHINE_SETUP(evbmips) Line 86  MACHINE_SETUP(evbmips)
86                  pci_data = dev_gt_init(machine, machine->memory, 0x1be00000,                  pci_data = dev_gt_init(machine, machine->memory, 0x1be00000,
87                      tmpstr, tmpstr2, 120);                      tmpstr, tmpstr2, 120);
88    
89                  if (machine->use_x11) {                  if (machine->x11_md.in_use) {
90                          if (strlen(machine->boot_string_argument) < 3) {                          if (strlen(machine->boot_string_argument) < 3) {
91                                  fatal("WARNING: remember to use  -o 'console="                                  fatal("WARNING: remember to use  -o 'console="
92                                      "tty0'  if you are emulating Linux. (Not"                                      "tty0'  if you are emulating Linux. (Not"
# Line 106  MACHINE_SETUP(evbmips) Line 108  MACHINE_SETUP(evbmips)
108                  device_add(machine, "malta_lcd addr=0x1f000400");                  device_add(machine, "malta_lcd addr=0x1f000400");
109                  break;                  break;
110    
         case MACHINE_EVBMIPS_MESHCUBE:  
                 machine->machine_name = "Meshcube";  
   
                 /*  See: http://mail-index.netbsd.org/port-evbmips/2006/  
                     02/23/0000.html  */  
   
                 if (machine->physical_ram_in_mb != 64)  
                         fprintf(stderr, "WARNING! MeshCubes are supposed to "  
                             "have exactly 64 MB RAM. Continuing anyway.\n");  
                 if (machine->use_x11)  
                         fprintf(stderr, "WARNING! MeshCube with -X is "  
                             "meaningless. Continuing anyway.\n");  
   
                 /*  First of all, the MeshCube has an Au1500 in it:  */  
                 device_add(machine, "au1x00");  
   
                 /*  
                  *  TODO:  Which non-Au1500 devices, and at what addresses?  
                  *  
                  *  "4G Systems MTX-1 Board" at ?  
                  *      1017fffc, 14005004, 11700000, 11700008, 11900014,  
                  *      1190002c, 11900100, 11900108, 1190010c,  
                  *      10400040 - 10400074,  
                  *      14001000 (possibly LCD?)  
                  *      11100028 (possibly ttySx?)  
                  *  
                  *  "usb_ohci=base:0x10100000,len:0x100000,irq:26"  
                  */  
   
                 /*  Linux reads this during startup...  */  
                 device_add(machine, "random addr=0x1017fffc len=4");  
   
                 break;  
   
         case MACHINE_EVBMIPS_PB1000:  
                 machine->machine_name = "PB1000 (evbmips)";  
                 cpu->byte_order = EMUL_BIG_ENDIAN;  
   
                 device_add(machine, "au1x00");  
   
                 /*  TODO  */  
                 break;  
   
111          default:fatal("Unimplemented EVBMIPS model.\n");          default:fatal("Unimplemented EVBMIPS model.\n");
112                  exit(1);                  exit(1);
113          }          }
# Line 182  MACHINE_SETUP(evbmips) Line 141  MACHINE_SETUP(evbmips)
141          cpu->cd.mips.gpr[MIPS_GPR_A3] = machine->physical_ram_in_mb * 1048576;          cpu->cd.mips.gpr[MIPS_GPR_A3] = machine->physical_ram_in_mb * 1048576;
142          /*  Hm. Linux ignores a3.  */          /*  Hm. Linux ignores a3.  */
143    
144          /*          /*  Set the Core ID. See maltareg.h for more info.  */
          *  TODO:  
          *      Core ID numbers.  
          *      How much of this is not valid for PBxxxx?  
          *  
          *  See maltareg.h for more info.  
          */  
145          store_32bit_word(cpu, (int32_t)(0x80000000 + MALTA_REVISION),          store_32bit_word(cpu, (int32_t)(0x80000000 + MALTA_REVISION),
146              (1 << 10) + 0x26);              (1 << 10) + 0x26);
147    
# Line 207  MACHINE_SETUP(evbmips) Line 160  MACHINE_SETUP(evbmips)
160  MACHINE_DEFAULT_CPU(evbmips)  MACHINE_DEFAULT_CPU(evbmips)
161  {  {
162          switch (machine->machine_subtype) {          switch (machine->machine_subtype) {
163    
164          case MACHINE_EVBMIPS_MALTA:          case MACHINE_EVBMIPS_MALTA:
165          case MACHINE_EVBMIPS_MALTA_BE:          case MACHINE_EVBMIPS_MALTA_BE:
166                    /*  5Kc = MIPS64 rev 1, 5KE = MIPS64 rev 2  */
167                  machine->cpu_name = strdup("5Kc");                  machine->cpu_name = strdup("5Kc");
168                  break;                  break;
169          case MACHINE_EVBMIPS_MESHCUBE:  
                 machine->cpu_name = strdup("AU1500");  
                 break;  
         case MACHINE_EVBMIPS_PB1000:  
                 machine->cpu_name = strdup("AU1000");  
                 break;  
170          default:fatal("Unimplemented evbmips subtype.\n");          default:fatal("Unimplemented evbmips subtype.\n");
171                  exit(1);                  exit(1);
172          }          }
# Line 225  MACHINE_DEFAULT_CPU(evbmips) Line 175  MACHINE_DEFAULT_CPU(evbmips)
175    
176  MACHINE_DEFAULT_RAM(evbmips)  MACHINE_DEFAULT_RAM(evbmips)
177  {  {
178          /*  MeshCube is always (?) 64 MB, and the others work fine          machine->physical_ram_in_mb = 128;
             with 64 MB too.  */  
         machine->physical_ram_in_mb = 64;  
179  }  }
180    
181    
# Line 244  MACHINE_REGISTER(evbmips) Line 192  MACHINE_REGISTER(evbmips)
192          machine_entry_add_subtype(me, "Malta (Big-Endian)",          machine_entry_add_subtype(me, "Malta (Big-Endian)",
193              MACHINE_EVBMIPS_MALTA_BE, "maltabe", NULL);              MACHINE_EVBMIPS_MALTA_BE, "maltabe", NULL);
194    
         machine_entry_add_subtype(me, "MeshCube", MACHINE_EVBMIPS_MESHCUBE,  
             "meshcube", NULL);  
   
         machine_entry_add_subtype(me, "PB1000", MACHINE_EVBMIPS_PB1000,  
             "pb1000", NULL);  
   
195          me->set_default_ram = machine_default_ram_evbmips;          me->set_default_ram = machine_default_ram_evbmips;
196  }  }
197    

Legend:
Removed from v.34  
changed lines
  Added in v.44

  ViewVC Help
Powered by ViewVC 1.1.26