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

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

revision 22 by dpavlin, Mon Oct 8 16:19:37 2007 UTC revision 28 by dpavlin, Mon Oct 8 16:20:26 2007 UTC
# Line 25  Line 25 
25   *  SUCH DAMAGE.   *  SUCH DAMAGE.
26   *     *  
27   *   *
28   *  $Id: machine_arc.c,v 1.2 2006/02/03 17:25:14 debug Exp $   *  $Id: machine_arc.c,v 1.5 2006/06/30 20:22:54 debug Exp $
29   */   */
30    
31  #include <stdio.h>  #include <stdio.h>
# Line 42  Line 42 
42  #include "memory.h"  #include "memory.h"
43  #include "misc.h"  #include "misc.h"
44    
45    #define MACHINE_NAME_MAXBUF     100
46    
47    
48  MACHINE_SETUP(arc)  MACHINE_SETUP(arc)
49  {  {
# Line 59  MACHINE_SETUP(arc) Line 61  MACHINE_SETUP(arc)
61          }          }
62    
63          cpu->byte_order = EMUL_LITTLE_ENDIAN;          cpu->byte_order = EMUL_LITTLE_ENDIAN;
64          snprintf(machine->machine_name,          snprintf(machine->machine_name, MACHINE_NAME_MAXBUF, "ARC");
             MACHINE_NAME_MAXBUF, "ARC");  
65    
66          switch (machine->machine_subtype) {          switch (machine->machine_subtype) {
67    
# Line 83  MACHINE_SETUP(arc) Line 84  MACHINE_SETUP(arc)
84                              MACHINE_NAME_MAXBUF);                              MACHINE_NAME_MAXBUF);
85                          break;                          break;
86                  case MACHINE_ARC_NEC_R94:                  case MACHINE_ARC_NEC_R94:
87                          strlcat(machine->machine_name, " (NEC-R94; NEC RISCstation 2200)",                          strlcat(machine->machine_name,
88                                " (NEC-R94; NEC RISCstation 2200)",
89                              MACHINE_NAME_MAXBUF);                              MACHINE_NAME_MAXBUF);
90                          break;                          break;
91                  case MACHINE_ARC_NEC_R96:                  case MACHINE_ARC_NEC_R96:
92                          strlcat(machine->machine_name, " (NEC-R96; NEC Express RISCserver)",                          strlcat(machine->machine_name,
93                                " (NEC-R96; NEC Express RISCserver)",
94                              MACHINE_NAME_MAXBUF);                              MACHINE_NAME_MAXBUF);
95                          break;                          break;
96                  }                  }
# Line 143  MACHINE_SETUP(arc) Line 146  MACHINE_SETUP(arc)
146                   *  According to http://mail-index.netbsd.org/port-arc/                   *  According to http://mail-index.netbsd.org/port-arc/
147                   *      2004/02/01/0001.html:                   *      2004/02/01/0001.html:
148                   *                   *
149                   *  Network adapter at "start: 0x 0 18600000, length: 0x1000, level: 4, vector: 9"                   *  Network adapter at "start: 0x 0 18600000, length:
150                   *  Disk at "start: 0x 0 18c103f0, length: 0x1000, level: 5, vector: 6"                   *      0x1000, level: 4, vector: 9"
151                   *  Keyboard at "start: 0x 0 18c20060, length: 0x1000, level: 5, vector: 3"                   *  Disk at "start: 0x 0 18c103f0, length: 0x1000, level:
152                   *  Serial at "start: 0x 0 18c103f8, length: 0x1000, level: 5, vector: 4"                   *      5, vector: 6"
153                   *  Serial at "start: 0x 0 18c102f8, length: 0x1000, level: 5, vector: 4"                   *  Keyboard at "start: 0x 0 18c20060, length: 0x1000,
154                   *  Parallel at "start: 0x 0 18c10278, length: 0x1000, level: 5, vector: 5"                   *      level: 5, vector: 3"
155                     *  Serial at "start: 0x 0 18c103f8, length: 0x1000,
156                     *      level: 5, vector: 4"
157                     *  Serial at "start: 0x 0 18c102f8, length: 0x1000,
158                     *      level: 5, vector: 4"
159                     *  Parallel at "start: 0x 0 18c10278, length: 0x1000,
160                     *      level: 5, vector: 5"
161                   */                   */
162    
163                  strlcat(machine->machine_name,                  strlcat(machine->machine_name,
# Line 181  MACHINE_SETUP(arc) Line 190  MACHINE_SETUP(arc)
190                   *  asc0 at jazzio0 addr 0xe0002000 intr 5: NCR53C94, target 0                   *  asc0 at jazzio0 addr 0xe0002000 intr 5: NCR53C94, target 0
191                   *  pckbd at jazzio0 addr 0xe0005000 intr 6 not configured                   *  pckbd at jazzio0 addr 0xe0005000 intr 6 not configured
192                   *  pms at jazzio0 addr 0xe0005000 intr 7 not configured                   *  pms at jazzio0 addr 0xe0005000 intr 7 not configured
193                   *  com0 at jazzio0 addr 0xe0006000 intr 8: ns16550a, working fifo                   *  com0 at jazzio0 addr 0xe0006000 intr 8: ns16550a,
194                     *      working fifo
195                   *  com at jazzio0 addr 0xe0007000 intr 9 not configured                   *  com at jazzio0 addr 0xe0007000 intr 9 not configured
196                   *  jazzisabr0 at mainbus0                   *  jazzisabr0 at mainbus0
197                   *  isa0 at jazzisabr0 isa_io_base 0xe2000000 isa_mem_base 0xe3000000                   *  isa0 at jazzisabr0 isa_io_base 0xe2000000 isa_mem_base
198                     *      0xe3000000
199                   *                   *
200                   *  "Microsoft-Jazz", "MIPS Magnum"                   *  "Microsoft-Jazz", "MIPS Magnum"
201                   *                   *
# Line 200  MACHINE_SETUP(arc) Line 211  MACHINE_SETUP(arc)
211                   *  scsibus0 at asc0: 8 targets, 8 luns per target                   *  scsibus0 at asc0: 8 targets, 8 luns per target
212                   *  pckbd at jazzio0 addr 0xe0005000 intr 6 not configured                   *  pckbd at jazzio0 addr 0xe0005000 intr 6 not configured
213                   *  pms at jazzio0 addr 0xe0005000 intr 7 not configured                   *  pms at jazzio0 addr 0xe0005000 intr 7 not configured
214                   *  com0 at jazzio0 addr 0xe0006000 intr 8: ns16550a, working fifo                   *  com0 at jazzio0 addr 0xe0006000 intr 8: ns16550a,
215                     *      working fifo
216                   *  com at jazzio0 addr 0xe0007000 intr 9 not configured                   *  com at jazzio0 addr 0xe0007000 intr 9 not configured
217                   *  jazzisabr0 at mainbus0                   *  jazzisabr0 at mainbus0
218                   *  isa0 at jazzisabr0 isa_io_base 0xe2000000 isa_mem_base 0xe3000000                   *  isa0 at jazzisabr0 isa_io_base 0xe2000000 isa_mem_base
219                     *      0xe3000000
220                   */                   */
221    
222                  switch (machine->machine_subtype) {                  switch (machine->machine_subtype) {
223                  case MACHINE_ARC_JAZZ_PICA:                  case MACHINE_ARC_JAZZ_PICA:
224                          strlcat(machine->machine_name, " (Microsoft Jazz, Acer PICA-61)",                          strlcat(machine->machine_name,
225                                " (Microsoft Jazz, Acer PICA-61)",
226                              MACHINE_NAME_MAXBUF);                              MACHINE_NAME_MAXBUF);
227                          machine->stable = 1;                          machine->stable = 1;
228                          break;                          break;
229                  case MACHINE_ARC_JAZZ_MAGNUM:                  case MACHINE_ARC_JAZZ_MAGNUM:
230                          strlcat(machine->machine_name, " (Microsoft Jazz, MIPS Magnum)",                          strlcat(machine->machine_name,
231                                " (Microsoft Jazz, MIPS Magnum)",
232                              MACHINE_NAME_MAXBUF);                              MACHINE_NAME_MAXBUF);
233                          break;                          break;
234                  default:                  default:
# Line 221  MACHINE_SETUP(arc) Line 236  MACHINE_SETUP(arc)
236                          exit(1);                          exit(1);
237                  }                  }
238    
239                                  machine->md_int.jazz_data = device_add(machine,                  machine->md_int.jazz_data = device_add(machine,
240                                      "jazz addr=0x80000000");                      "jazz addr=0x80000000");
241                                  machine->md_interrupt = jazz_interrupt;                  machine->md_interrupt = jazz_interrupt;
242    
243                                  i = dev_pckbc_init(machine, mem, 0x80005000ULL,                  i = dev_pckbc_init(machine, mem, 0x80005000ULL,
244                                      PCKBC_JAZZ, 8 + 6, 8 + 7, machine->use_x11, 0);                      PCKBC_JAZZ, 8 + 6, 8 + 7,
245                        machine->use_x11, 0);
                                 snprintf(tmpstr, sizeof(tmpstr), "ns16550 irq=16 addr=0x80006000 in_use=%i name2=tty0", machine->use_x11? 0 : 1);  
                                 j = (size_t)device_add(machine, tmpstr);  
                                 snprintf(tmpstr, sizeof(tmpstr), "ns16550 irq=17 addr=0x80007000 in_use=%i name2=tty1", 0);  
                                 device_add(machine, tmpstr);  
   
                                 if (machine->use_x11)  
                                         machine->main_console_handle = i;  
                                 else  
                                         machine->main_console_handle = j;  
   
                                 switch (machine->machine_subtype) {  
                                 case MACHINE_ARC_JAZZ_PICA:  
                                         if (machine->use_x11) {  
                                                 dev_vga_init(machine, mem,  
                                                     0x400a0000ULL, 0x600003c0ULL,  
                                                     machine->machine_name);  
                                                 arcbios_console_init(machine,  
                                                     0x400b8000ULL, 0x600003c0ULL);  
                                         }  
                                         break;  
                                 case MACHINE_ARC_JAZZ_MAGNUM:  
                                         /*  PROM mirror?  */  
                                         dev_ram_init(machine, 0xfff00000, 0x100000,  
                                             DEV_RAM_MIRROR | DEV_RAM_MIGHT_POINT_TO_DEVICES, 0x1fc00000);  
   
                                         /*  VXL. TODO  */  
                                         /*  control at 0x60100000?  */  
                                         dev_fb_init(machine, mem, 0x60200000ULL,  
                                             VFB_GENERIC, 1024,768, 1024,768,  
                                             8, "VXL");  
                                         break;  
                                 }  
   
                                 /*  irq 8 + 4  */  
                                 device_add(machine, "sn addr=0x80001000 irq=12");  
   
                                 dev_asc_init(machine, mem,  
                                     0x80002000ULL, 8 + 5, NULL, DEV_ASC_PICA,  
                                     dev_jazz_dma_controller,  
                                     machine->md_int.jazz_data);  
246    
247                                  device_add(machine, "fdc addr=0x80003000, irq=0");                  snprintf(tmpstr, sizeof(tmpstr),
248                        "ns16550 irq=16 addr=0x80006000 in_use=%i"
249                        " name2=tty0", machine->use_x11? 0 : 1);
250                    j = (size_t)device_add(machine, tmpstr);
251                    snprintf(tmpstr, sizeof(tmpstr),
252                        "ns16550 irq=17 addr=0x80007000 in_use=%i"
253                        " name2=tty1", 0);
254                    device_add(machine, tmpstr);
255    
256                                  dev_mc146818_init(machine, mem,                  if (machine->use_x11)
257                                      0x80004000ULL, 2, MC146818_ARC_JAZZ, 1);                          machine->main_console_handle = i;
258                    else
259                            machine->main_console_handle = j;
260    
261                    switch (machine->machine_subtype) {
262                    case MACHINE_ARC_JAZZ_PICA:
263                            if (machine->use_x11) {
264                                    dev_vga_init(machine, mem, 0x400a0000ULL,
265                                        0x600003c0ULL, machine->machine_name);
266                                    arcbios_console_init(machine,
267                                        0x400b8000ULL, 0x600003c0ULL);
268                            }
269                            break;
270                    case MACHINE_ARC_JAZZ_MAGNUM:
271                            /*  PROM mirror?  */
272                            dev_ram_init(machine, 0xfff00000, 0x100000,
273                                DEV_RAM_MIRROR | DEV_RAM_MIGHT_POINT_TO_DEVICES,
274                                0x1fc00000);
275    
276                            /*  VXL. TODO  */
277                            /*  control at 0x60100000?  */
278                            dev_fb_init(machine, mem, 0x60200000ULL,
279                                VFB_GENERIC, 1024,768, 1024,768, 8, "VXL");
280                            break;
281                    }
282    
283                    /*  irq 8 + 4  */
284                    device_add(machine, "sn addr=0x80001000 irq=12");
285    
286                    dev_asc_init(machine, mem, 0x80002000ULL, 8 + 5, NULL,
287                        DEV_ASC_PICA, dev_jazz_dma_controller,
288                        machine->md_int.jazz_data);
289    
290                    device_add(machine, "fdc addr=0x80003000, irq=0");
291    
292                    dev_mc146818_init(machine, mem,
293                        0x80004000ULL, 2, MC146818_ARC_JAZZ, 1);
294    
295  #if 0  #if 0
296  Not yet.  Not yet.
297                                  /*  irq = 8+16 + 14  */                  /*  irq = 8+16 + 14  */
298                                  device_add(machine, "wdc addr=0x900001f0, irq=38");                  device_add(machine, "wdc addr=0x900001f0, irq=38");
299  #endif  #endif
300    
301                                  break;                  break;
302    
303                          case MACHINE_ARC_JAZZ_M700:          case MACHINE_ARC_JAZZ_M700:
304                                  /*                  /*
305                                   *  "Microsoft-Jazz", "Olivetti M700"                   *  "Microsoft-Jazz", "Olivetti M700"
306                                   *                   *
307                                   *  Different enough from Pica and Magnum to be                   *  Different enough from Pica and Magnum to be
308                                   *  separate here.                   *  separate here.
309                                   *                   *
310                                   *  See http://mail-index.netbsd.org/port-arc/2000/10/18/0001.html.                   *  http://mail-index.netbsd.org/port-arc/2000/10/18/0001.html
311                                   */                   */
312    
313                                  strlcat(machine->machine_name, " (Microsoft Jazz, Olivetti M700)",                  strlcat(machine->machine_name, " (Microsoft Jazz, "
314                                      MACHINE_NAME_MAXBUF);                      "Olivetti M700)", MACHINE_NAME_MAXBUF);
   
                                 machine->md_int.jazz_data = device_add(machine,  
                                     "jazz addr=0x80000000");  
                                 machine->md_interrupt = jazz_interrupt;  
315    
316                                  dev_mc146818_init(machine, mem,                  machine->md_int.jazz_data = device_add(machine,
317                                      0x80004000ULL, 2, MC146818_ARC_JAZZ, 1);                      "jazz addr=0x80000000");
318                    machine->md_interrupt = jazz_interrupt;
319    
320                                  i = 0;          /*  TODO: Yuck!  */                  dev_mc146818_init(machine, mem,
321                        0x80004000ULL, 2, MC146818_ARC_JAZZ, 1);
322    
323                    i = 0;          /*  TODO: Yuck!  */
324  #if 0  #if 0
325                                  i = dev_pckbc_init(machine, mem, 0x80005000ULL,                  i = dev_pckbc_init(machine, mem, 0x80005000ULL,
326                                      PCKBC_JAZZ, 8 + 6, 8 + 7, machine->use_x11, 0);                      PCKBC_JAZZ, 8 + 6, 8 + 7, machine->use_x11, 0);
327  #endif  #endif
328    
329                                  snprintf(tmpstr, sizeof(tmpstr), "ns16550 irq=16 addr=0x80006000 in_use=%i name2=tty0", machine->use_x11? 0 : 1);                  snprintf(tmpstr, sizeof(tmpstr), "ns16550 irq=16 addr="
330                                  j = (size_t)device_add(machine, tmpstr);                      "0x80006000 in_use=%i name2=tty0", machine->use_x11? 0 : 1);
331                                  snprintf(tmpstr, sizeof(tmpstr), "ns16550 irq=17 addr=0x80007000 in_use=%i name2=tty1", 0);                  j = (size_t)device_add(machine, tmpstr);
332                                  device_add(machine, tmpstr);                  snprintf(tmpstr, sizeof(tmpstr), "ns16550 irq=17 addr="
333                        "0x80007000 in_use=%i name2=tty1", 0);
334                                  if (machine->use_x11)                  device_add(machine, tmpstr);
335                                          machine->main_console_handle = i;  
336                                  else                  if (machine->use_x11)
337                                          machine->main_console_handle = j;                          machine->main_console_handle = i;
338                    else
339                                  dev_m700_fb_init(machine, mem,                          machine->main_console_handle = j;
340                                      0x180080000ULL, 0x100000000ULL);  
341                    dev_m700_fb_init(machine, mem, 0x180080000ULL, 0x100000000ULL);
342                                  break;  
343                    break;
344                          case MACHINE_ARC_DESKTECH_TYNE:  
345                                  /*          case MACHINE_ARC_DESKTECH_TYNE:
346                                   *  "Deskstation Tyne" (?)                  /*
347                                   *                   *  "Deskstation Tyne" (?)
348                                   *  TODO                   *
349                                   *  http://mail-index.netbsd.org/port-arc/2000/10/14/0000.html                   *  TODO
350                                   */                   *  http://mail-index.netbsd.org/port-arc/2000/10/14/0000.html
351                     */
352    
353                  strlcat(machine->machine_name, " (Deskstation Tyne)",                  strlcat(machine->machine_name, " (Deskstation Tyne)",
354                      MACHINE_NAME_MAXBUF);                      MACHINE_NAME_MAXBUF);
# Line 338  Not yet. Line 357  Not yet.
357                  bus_isa_init(machine, 0, 0x900000000ULL,                  bus_isa_init(machine, 0, 0x900000000ULL,
358                      0x100000000ULL, 8, 24);                      0x100000000ULL, 8, 24);
359  #if 0  #if 0
360                  snprintf(tmpstr, sizeof(tmpstr), "ns16550 irq=0 addr=0x9000003f8 in_use=%i name2=tty0", machine->use_x11? 0 : 1);                  snprintf(tmpstr, sizeof(tmpstr), "ns16550 irq=0 addr="
361                        "0x9000003f8 in_use=%i name2=tty0", machine->use_x11? 0:1);
362                  i = (size_t)device_add(machine, tmpstr);                  i = (size_t)device_add(machine, tmpstr);
363                  device_add(machine, "ns16550 irq=0 addr=0x9000002f8 in_use=0 name2=tty1");                  device_add(machine, "ns16550 irq=0 addr=0x9000002f8 in_use=0"
364                        " name2=tty1");
365  #endif  #endif
366                  device_add(machine, "ns16550 irq=0 addr=0x9000003e8 in_use=0 name2=tty2");                  device_add(machine, "ns16550 irq=0 addr=0x9000003e8 "
367                  device_add(machine, "ns16550 irq=0 addr=0x9000002e8 in_use=0 name2=tty3");                      "in_use=0 name2=tty2");
368                    device_add(machine, "ns16550 irq=0 addr=0x9000002e8 "
369                        "in_use=0 name2=tty3");
370  #if 0  #if 0
371                  dev_mc146818_init(machine, mem,                  dev_mc146818_init(machine, mem,
372                      0x900000070ULL, 2, MC146818_PC_CMOS, 1);                      0x900000070ULL, 2, MC146818_PC_CMOS, 1);
# Line 406  MACHINE_DEFAULT_RAM(arc) Line 429  MACHINE_DEFAULT_RAM(arc)
429    
430  MACHINE_REGISTER(arc)  MACHINE_REGISTER(arc)
431  {  {
432          MR_DEFAULT(arc, "ARC", ARCH_MIPS, MACHINE_ARC, 1, 8);          MR_DEFAULT(arc, "ARC", ARCH_MIPS, MACHINE_ARC);
433    
434          me->set_default_ram = machine_default_ram_arc;          me->set_default_ram = machine_default_ram_arc;
435    
436          me->aliases[0] = "arc";          machine_entry_add_alias(me, "arc");
437    
438            machine_entry_add_subtype(me, "Acer PICA-61", MACHINE_ARC_JAZZ_PICA,
439                "pica-61", "acer pica", "pica", NULL);
440    
441            machine_entry_add_subtype(me, "Deskstation Tyne",
442                MACHINE_ARC_DESKTECH_TYNE,
443                "deskstation tyne", "desktech", "tyne", NULL);
444    
445            machine_entry_add_subtype(me, "Jazz Magnum", MACHINE_ARC_JAZZ_MAGNUM,
446                "magnum", "jazz magnum", NULL);
447    
448            machine_entry_add_subtype(me, "NEC-R94", MACHINE_ARC_NEC_R94,
449                "nec-r94", "r94", NULL);
450    
451            machine_entry_add_subtype(me, "NEC-RD94", MACHINE_ARC_NEC_RD94,
452                "nec-rd94", "rd94", NULL);
453    
454            machine_entry_add_subtype(me, "NEC-R96", MACHINE_ARC_NEC_R96,
455                "nec-r96", "r96", NULL);
456    
457          me->subtype[0] = machine_entry_subtype_new(          machine_entry_add_subtype(me, "NEC-R98", MACHINE_ARC_NEC_R98,
458              "Acer PICA-61", MACHINE_ARC_JAZZ_PICA, 3);              "nec-r98", "r98", NULL);
         me->subtype[0]->aliases[0] = "pica-61";  
         me->subtype[0]->aliases[1] = "acer pica";  
         me->subtype[0]->aliases[2] = "pica";  
   
         me->subtype[1] = machine_entry_subtype_new(  
             "Deskstation Tyne", MACHINE_ARC_DESKTECH_TYNE, 3);  
         me->subtype[1]->aliases[0] = "deskstation tyne";  
         me->subtype[1]->aliases[1] = "desktech";  
         me->subtype[1]->aliases[2] = "tyne";  
   
         me->subtype[2] = machine_entry_subtype_new(  
             "Jazz Magnum", MACHINE_ARC_JAZZ_MAGNUM, 2);  
         me->subtype[2]->aliases[0] = "magnum";  
         me->subtype[2]->aliases[1] = "jazz magnum";  
   
         me->subtype[3] = machine_entry_subtype_new(  
             "NEC-R94", MACHINE_ARC_NEC_R94, 2);  
         me->subtype[3]->aliases[0] = "nec-r94";  
         me->subtype[3]->aliases[1] = "r94";  
   
         me->subtype[4] = machine_entry_subtype_new(  
             "NEC-RD94", MACHINE_ARC_NEC_RD94, 2);  
         me->subtype[4]->aliases[0] = "nec-rd94";  
         me->subtype[4]->aliases[1] = "rd94";  
   
         me->subtype[5] = machine_entry_subtype_new(  
             "NEC-R96", MACHINE_ARC_NEC_R96, 2);  
         me->subtype[5]->aliases[0] = "nec-r96";  
         me->subtype[5]->aliases[1] = "r96";  
   
         me->subtype[6] = machine_entry_subtype_new(  
             "NEC-R98", MACHINE_ARC_NEC_R98, 2);  
         me->subtype[6]->aliases[0] = "nec-r98";  
         me->subtype[6]->aliases[1] = "r98";  
   
         me->subtype[7] = machine_entry_subtype_new(  
             "Olivetti M700", MACHINE_ARC_JAZZ_M700, 2);  
         me->subtype[7]->aliases[0] = "olivetti";  
         me->subtype[7]->aliases[1] = "m700";  
459    
460          machine_entry_add(me, ARCH_MIPS);          machine_entry_add_subtype(me, "Olivetti M700", MACHINE_ARC_JAZZ_M700,
461                "olivetti", "m700", NULL);
462  }  }
463    

Legend:
Removed from v.22  
changed lines
  Added in v.28

  ViewVC Help
Powered by ViewVC 1.1.26