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

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

revision 16 by dpavlin, Mon Oct 8 16:19:01 2007 UTC revision 18 by dpavlin, Mon Oct 8 16:19:11 2007 UTC
# Line 25  Line 25 
25   *  SUCH DAMAGE.   *  SUCH DAMAGE.
26   *   *
27   *   *
28   *  $Id: machine.c,v 1.569 2005/10/11 03:31:27 debug Exp $   *  $Id: machine.c,v 1.577 2005/10/27 14:01:12 debug Exp $
29   *   *
30   *  Emulation of specific machines.   *  Emulation of specific machines.
31   *   *
# Line 1528  void machine_setup(struct machine *machi Line 1528  void machine_setup(struct machine *machi
1528                  struct btinfo_symtab c;                  struct btinfo_symtab c;
1529          } xx;          } xx;
1530          struct hpc_bootinfo hpc_bootinfo;          struct hpc_bootinfo hpc_bootinfo;
1531          uint64_t hpcmips_fb_addr = 0;          int hpc_platid_flags = 0, hpc_platid_cpu_submodel = 0,
1532          int hpcmips_fb_bits = 0, hpcmips_fb_encoding = 0;              hpc_platid_cpu_model = 0, hpc_platid_cpu_series = 0,
1533          int hpcmips_fb_xsize = 0;              hpc_platid_cpu_arch = 0,
1534          int hpcmips_fb_ysize = 0;              hpc_platid_submodel = 0, hpc_platid_model = 0,
1535          int hpcmips_fb_xsize_mem = 0;              hpc_platid_series = 0, hpc_platid_vendor = 0;
1536          int hpcmips_fb_ysize_mem = 0;          uint64_t hpc_fb_addr = 0;
1537            int hpc_fb_bits = 0, hpc_fb_encoding = 0;
1538            int hpc_fb_xsize = 0;
1539            int hpc_fb_ysize = 0;
1540            int hpc_fb_xsize_mem = 0;
1541            int hpc_fb_ysize_mem = 0;
1542    
1543          /*  ARCBIOS stuff:  */          /*  ARCBIOS stuff:  */
1544          uint64_t sgi_ram_offset = 0;          uint64_t sgi_ram_offset = 0;
# Line 2121  void machine_setup(struct machine *machi Line 2126  void machine_setup(struct machine *machi
2126    
2127                  /*                  /*
2128                   *  Most OSes on DECstation use physical addresses below                   *  Most OSes on DECstation use physical addresses below
2129                   *  0x20000000, but OSF/1 seems to use 0xbe...... as if it was                   *  0x20000000, but both OSF/1 and Sprite use 0xbe...... as if
2130                   *  0x1e......, so we need this hack:                   *  it was 0x1e......, so we need this hack:
2131                   */                   */
2132                  dev_ram_init(mem, 0xa0000000, 0x20000000, DEV_RAM_MIRROR, 0x0);                  dev_ram_init(machine, 0xa0000000, 0x20000000,
2133                        DEV_RAM_MIRROR | DEV_RAM_MIGHT_POINT_TO_DEVICES, 0x0);
2134    
2135                  if (machine->prom_emulation) {                  if (machine->prom_emulation) {
2136                          /*  DECstation PROM stuff:  (TODO: endianness)  */                          /*  DECstation PROM stuff:  (TODO: endianness)  */
# Line 2407  void machine_setup(struct machine *machi Line 2413  void machine_setup(struct machine *machi
2413          case MACHINE_HPCMIPS:          case MACHINE_HPCMIPS:
2414                  cpu->byte_order = EMUL_LITTLE_ENDIAN;                  cpu->byte_order = EMUL_LITTLE_ENDIAN;
2415                  memset(&hpc_bootinfo, 0, sizeof(hpc_bootinfo));                  memset(&hpc_bootinfo, 0, sizeof(hpc_bootinfo));
                 /*  TODO:  set platid from netbsd/usr/src/sys/arch/hpc/include/platid*  */  
                 /*  
                 #define PLATID_FLAGS_SHIFT              0  
                 #define PLATID_CPU_SUBMODEL_SHIFT       8  
                 #define PLATID_CPU_MODEL_SHIFT          14  
                 #define PLATID_CPU_SERIES_SHIFT         20  
                 #define PLATID_CPU_ARCH_SHIFT           26  
   
                 #define PLATID_SUBMODEL_SHIFT           0  
                 #define PLATID_MODEL_SHIFT              8  
                 #define PLATID_SERIES_SHIFT             16  
                 #define PLATID_VENDOR_SHIFT             22  
                 */  
   
2416                  /*                  /*
2417                  NOTE: See http://forums.projectmayo.com/viewtopic.php?topic=2743&forum=23                  NOTE: See http://forums.projectmayo.com/viewtopic.php?topic=2743&forum=23
2418                  for info on framebuffer addresses.                  for info on framebuffer addresses.
# Line 2430  void machine_setup(struct machine *machi Line 2422  void machine_setup(struct machine *machi
2422                  case MACHINE_HPCMIPS_CASIO_BE300:                  case MACHINE_HPCMIPS_CASIO_BE300:
2423                          /*  166MHz VR4131  */                          /*  166MHz VR4131  */
2424                          machine->machine_name = "Casio Cassiopeia BE-300";                          machine->machine_name = "Casio Cassiopeia BE-300";
2425                          hpcmips_fb_addr = 0x0a200000;                          hpc_fb_addr = 0x0a200000;
2426                          hpcmips_fb_xsize = 240;                          hpc_fb_xsize = 240;
2427                          hpcmips_fb_ysize = 320;                          hpc_fb_ysize = 320;
2428                          hpcmips_fb_xsize_mem = 256;                          hpc_fb_xsize_mem = 256;
2429                          hpcmips_fb_ysize_mem = 320;                          hpc_fb_ysize_mem = 320;
2430                          hpcmips_fb_bits = 15;                          hpc_fb_bits = 15;
2431                          hpcmips_fb_encoding = BIFB_D16_0000;                          hpc_fb_encoding = BIFB_D16_0000;
2432    
2433                          /*  TODO: irq?  */                          /*  TODO: irq?  */
2434                          snprintf(tmpstr, sizeof(tmpstr), "ns16550 irq=0 addr=0x0a008680 addr_mult=4 in_use=%i", machine->use_x11? 0 : 1);                          snprintf(tmpstr, sizeof(tmpstr), "ns16550 irq=0 addr=0x0a008680 addr_mult=4 in_use=%i", machine->use_x11? 0 : 1);
# Line 2445  void machine_setup(struct machine *machi Line 2437  void machine_setup(struct machine *machi
2437                          machine->md_int.vr41xx_data = dev_vr41xx_init(machine, mem, 4131);                          machine->md_int.vr41xx_data = dev_vr41xx_init(machine, mem, 4131);
2438                          machine->md_interrupt = vr41xx_interrupt;                          machine->md_interrupt = vr41xx_interrupt;
2439    
2440                          store_32bit_word_in_host(cpu, (unsigned char *)&hpc_bootinfo.platid_cpu,                          hpc_platid_cpu_arch = 1;        /*  MIPS  */
2441                                (1 << 26)         /*  1 = MIPS  */                          hpc_platid_cpu_series = 1;      /*  VR  */
2442                              + (1 << 20)         /*  1 = VR  */                          hpc_platid_cpu_model = 1;       /*  VR41XX  */
2443                              + (1 << 14)         /*  1 = VR41XX  */                          hpc_platid_cpu_submodel = 6;    /*  VR4131  */
2444                              + (6 <<  8)         /*  6 = VR4131  */                          hpc_platid_vendor = 3;          /*  Casio  */
2445                              );                          hpc_platid_series = 1;          /*  CASSIOPEIAE  */
2446                          store_32bit_word_in_host(cpu, (unsigned char *)&hpc_bootinfo.platid_machine,                          hpc_platid_model = 2;           /*  EXXX  */
2447                                (3 << 22)         /*  22: vendor  3=casio */                          hpc_platid_submodel = 3;        /*  E500  */
                             + (1 << 16)         /*  16: series  1=CASSIOPEIAE*/  
                             + (2 <<  8)         /*   8: model   2=EXXX*/  
                             + (3)               /*   0: submodel 3=E500 */  
                             );  
2448                          /*  TODO: Don't use model number for E500, it's a BE300!  */                          /*  TODO: Don't use model number for E500, it's a BE300!  */
2449                          break;                          break;
2450                  case MACHINE_HPCMIPS_CASIO_E105:                  case MACHINE_HPCMIPS_CASIO_E105:
2451                          /*  131MHz VR4121  */                          /*  131MHz VR4121  */
2452                          machine->machine_name = "Casio Cassiopeia E-105";                          machine->machine_name = "Casio Cassiopeia E-105";
2453                          hpcmips_fb_addr = 0x0a200000;   /*  TODO?  */                          hpc_fb_addr = 0x0a200000;       /*  TODO?  */
2454                          hpcmips_fb_xsize = 240;                          hpc_fb_xsize = 240;
2455                          hpcmips_fb_ysize = 320;                          hpc_fb_ysize = 320;
2456                          hpcmips_fb_xsize_mem = 256;                          hpc_fb_xsize_mem = 256;
2457                          hpcmips_fb_ysize_mem = 320;                          hpc_fb_ysize_mem = 320;
2458                          hpcmips_fb_bits = 16;                          hpc_fb_bits = 16;
2459                          hpcmips_fb_encoding = BIFB_D16_0000;                          hpc_fb_encoding = BIFB_D16_0000;
2460    
2461                          /*  TODO: irq?  */                          /*  TODO: irq?  */
2462                          snprintf(tmpstr, sizeof(tmpstr), "ns16550 irq=0 addr=0x0a008680 addr_mult=4 in_use=%i", machine->use_x11? 0 : 1);                          snprintf(tmpstr, sizeof(tmpstr), "ns16550 irq=0 addr=0x0a008680 addr_mult=4 in_use=%i", machine->use_x11? 0 : 1);
# Line 2477  void machine_setup(struct machine *machi Line 2465  void machine_setup(struct machine *machi
2465                          machine->md_int.vr41xx_data = dev_vr41xx_init(machine, mem, 4121);                          machine->md_int.vr41xx_data = dev_vr41xx_init(machine, mem, 4121);
2466                          machine->md_interrupt = vr41xx_interrupt;                          machine->md_interrupt = vr41xx_interrupt;
2467    
2468                          store_32bit_word_in_host(cpu, (unsigned char *)&hpc_bootinfo.platid_cpu,                          hpc_platid_cpu_arch = 1;        /*  MIPS  */
2469                                (1 << 26)         /*  1 = MIPS  */                          hpc_platid_cpu_series = 1;      /*  VR  */
2470                              + (1 << 20)         /*  1 = VR  */                          hpc_platid_cpu_model = 1;       /*  VR41XX  */
2471                              + (1 << 14)         /*  1 = VR41XX  */                          hpc_platid_cpu_submodel = 3;    /*  VR4121  */
2472                              + (3 <<  8)         /*  3 = VR4121  */                          hpc_platid_vendor = 3;          /*  Casio  */
2473                              );                          hpc_platid_series = 1;          /*  CASSIOPEIAE  */
2474                          store_32bit_word_in_host(cpu, (unsigned char *)&hpc_bootinfo.platid_machine,                          hpc_platid_model = 2;           /*  EXXX  */
2475                                (3 << 22)         /*  22: vendor  3=casio */                          hpc_platid_submodel = 2;        /*  E105  */
                             + (1 << 16)         /*  16: series  1=CASSIOPEIAE*/  
                             + (2 <<  8)         /*   8: model   2=EXXX*/  
                             + (2)               /*   0: submodel 2=E105  */  
                             );  
2476                          break;                          break;
2477                  case MACHINE_HPCMIPS_NEC_MOBILEPRO_770:                  case MACHINE_HPCMIPS_NEC_MOBILEPRO_770:
2478                          /*  131 MHz VR4121  */                          /*  131 MHz VR4121  */
2479                          machine->machine_name = "NEC MobilePro 770";                          machine->machine_name = "NEC MobilePro 770";
2480                          /*  TODO:  */                          hpc_fb_addr = 0xa000000;
2481                          hpcmips_fb_addr = 0xa000000;                          hpc_fb_xsize = 640;
2482                          hpcmips_fb_xsize = 640;                          hpc_fb_ysize = 240;
2483                          hpcmips_fb_ysize = 240;                          hpc_fb_xsize_mem = 800;
2484                          hpcmips_fb_xsize_mem = 800;                          hpc_fb_ysize_mem = 240;
2485                          hpcmips_fb_ysize_mem = 240;                          hpc_fb_bits = 16;
2486                          hpcmips_fb_bits = 16;                          hpc_fb_encoding = BIFB_D16_0000;
                         hpcmips_fb_encoding = BIFB_D16_0000;  
2487    
2488                          machine->md_int.vr41xx_data = dev_vr41xx_init(machine, mem, 4121);                          machine->md_int.vr41xx_data = dev_vr41xx_init(machine, mem, 4121);
2489                          machine->md_interrupt = vr41xx_interrupt;                          machine->md_interrupt = vr41xx_interrupt;
2490    
2491                          store_32bit_word_in_host(cpu, (unsigned char *)&hpc_bootinfo.platid_cpu,                          hpc_platid_cpu_arch = 1;        /*  MIPS  */
2492                                (1 << 26)         /*  1 = MIPS  */                          hpc_platid_cpu_series = 1;      /*  VR  */
2493                              + (1 << 20)         /*  1 = VR  */                          hpc_platid_cpu_model = 1;       /*  VR41XX  */
2494                              + (1 << 14)         /*  1 = VR41XX  */                          hpc_platid_cpu_submodel = 3;    /*  VR4121  */
2495                              + (3 <<  8)         /*  3 = VR4121  */                          hpc_platid_vendor = 1;          /*  NEC  */
2496                              );                          hpc_platid_series = 2;          /*  NEC MCR  */
2497                          store_32bit_word_in_host(cpu, (unsigned char *)&hpc_bootinfo.platid_machine,                          hpc_platid_model = 2;           /*  MCR 5XX  */
2498                                (1 << 22)         /*  22: vendor  1=NEC  */                          hpc_platid_submodel = 4;        /*  MCR 520A  */
                             + (2 << 16)         /*  16: series  2="NEC MCR" */  
                             + (2 <<  8)         /*   8: model   2="MCR 5XX" */  
                             + (4)               /*   0: submodel 4="MCR 520A" */  
                             );  
2499                          break;                          break;
2500                  case MACHINE_HPCMIPS_NEC_MOBILEPRO_780:                  case MACHINE_HPCMIPS_NEC_MOBILEPRO_780:
2501                          /*  166 (or 168) MHz VR4121  */                          /*  166 (or 168) MHz VR4121  */
2502                          machine->machine_name = "NEC MobilePro 780";                          machine->machine_name = "NEC MobilePro 780";
2503                          /*  TODO:  */                          hpc_fb_addr = 0xa180100;
2504                          hpcmips_fb_addr = 0xa180100;                          hpc_fb_xsize = 640;
2505                          hpcmips_fb_xsize = 640;                          hpc_fb_ysize = 240;
2506                          hpcmips_fb_ysize = 240;                          hpc_fb_xsize_mem = 640;
2507                          hpcmips_fb_xsize_mem = 640;                          hpc_fb_ysize_mem = 240;
2508                          hpcmips_fb_ysize_mem = 240;                          hpc_fb_bits = 16;
2509                          hpcmips_fb_bits = 16;                          hpc_fb_encoding = BIFB_D16_0000;
                         hpcmips_fb_encoding = BIFB_D16_0000;  
2510    
2511                          machine->md_int.vr41xx_data = dev_vr41xx_init(machine, mem, 4121);                          machine->md_int.vr41xx_data = dev_vr41xx_init(machine, mem, 4121);
2512                          machine->md_interrupt = vr41xx_interrupt;                          machine->md_interrupt = vr41xx_interrupt;
2513    
2514                          store_32bit_word_in_host(cpu, (unsigned char *)&hpc_bootinfo.platid_cpu,                          hpc_platid_cpu_arch = 1;        /*  MIPS  */
2515                                (1 << 26)         /*  1 = MIPS  */                          hpc_platid_cpu_series = 1;      /*  VR  */
2516                              + (1 << 20)         /*  1 = VR  */                          hpc_platid_cpu_model = 1;       /*  VR41XX  */
2517                              + (1 << 14)         /*  1 = VR41XX  */                          hpc_platid_cpu_submodel = 3;    /*  VR4121  */
2518                              + (3 <<  8)         /*  3 = VR4121  */                          hpc_platid_vendor = 1;          /*  NEC  */
2519                              );                          hpc_platid_series = 2;          /*  NEC MCR  */
2520                          store_32bit_word_in_host(cpu, (unsigned char *)&hpc_bootinfo.platid_machine,                          hpc_platid_model = 2;           /*  MCR 5XX  */
2521                                (1 << 22)         /*  22: vendor  1=NEC  */                          hpc_platid_submodel = 8;        /*  MCR 530A  */
                             + (2 << 16)         /*  16: series  2="NEC MCR" */  
                             + (2 <<  8)         /*   8: model   2="MCR 5XX" */  
                             + (8)               /*   0: submodel 8="MCR 530A" */  
                             );  
2522                          break;                          break;
2523                  case MACHINE_HPCMIPS_NEC_MOBILEPRO_800:                  case MACHINE_HPCMIPS_NEC_MOBILEPRO_800:
2524                          /*  131 MHz VR4121  */                          /*  131 MHz VR4121  */
2525                          machine->machine_name = "NEC MobilePro 800";                          machine->machine_name = "NEC MobilePro 800";
2526                          /*  TODO:  */                          hpc_fb_addr = 0xa000000;
2527                          hpcmips_fb_addr = 0xa000000;                          hpc_fb_xsize = 800;
2528                          hpcmips_fb_xsize = 800;                          hpc_fb_ysize = 600;
2529                          hpcmips_fb_ysize = 600;                          hpc_fb_xsize_mem = 800;
2530                          hpcmips_fb_xsize_mem = 800;                          hpc_fb_ysize_mem = 600;
2531                          hpcmips_fb_ysize_mem = 600;                          hpc_fb_bits = 16;
2532                          hpcmips_fb_bits = 16;                          hpc_fb_encoding = BIFB_D16_0000;
                         hpcmips_fb_encoding = BIFB_D16_0000;  
2533    
2534                          machine->md_int.vr41xx_data = dev_vr41xx_init(machine, mem, 4121);                          machine->md_int.vr41xx_data = dev_vr41xx_init(machine, mem, 4121);
2535                          machine->md_interrupt = vr41xx_interrupt;                          machine->md_interrupt = vr41xx_interrupt;
2536    
2537                          store_32bit_word_in_host(cpu, (unsigned char *)&hpc_bootinfo.platid_cpu,                          hpc_platid_cpu_arch = 1;        /*  MIPS  */
2538                                (1 << 26)         /*  1 = MIPS  */                          hpc_platid_cpu_series = 1;      /*  VR  */
2539                              + (1 << 20)         /*  1 = VR  */                          hpc_platid_cpu_model = 1;       /*  VR41XX  */
2540                              + (1 << 14)         /*  1 = VR41XX  */                          hpc_platid_cpu_submodel = 3;    /*  VR4121  */
2541                              + (3 <<  8)         /*  3 = VR4121  */                          hpc_platid_vendor = 1;          /*  NEC  */
2542                              );                          hpc_platid_series = 2;          /*  NEC MCR  */
2543                          store_32bit_word_in_host(cpu, (unsigned char *)&hpc_bootinfo.platid_machine,                          hpc_platid_model = 3;           /*  MCR 7XX  */
2544                                (1 << 22)         /*  22: vendor  1=NEC  */                          hpc_platid_submodel = 2;        /*  MCR 700A  */
                             + (2 << 16)         /*  16: series  2="NEC MCR" */  
                             + (3 <<  8)         /*   8: model   3="MCR 7XX" */  
                             + (2)               /*   0: submodel 2="MCR 700A" */  
                             );  
2545                          break;                          break;
2546                  case MACHINE_HPCMIPS_NEC_MOBILEPRO_880:                  case MACHINE_HPCMIPS_NEC_MOBILEPRO_880:
2547                          /*  168 MHz VR4121  */                          /*  168 MHz VR4121  */
2548                          machine->machine_name = "NEC MobilePro 880";                          machine->machine_name = "NEC MobilePro 880";
2549                          /*  TODO:  */                          hpc_fb_addr = 0xa0ea600;
2550                          hpcmips_fb_addr = 0xa0ea600;                          hpc_fb_xsize = 800;
2551                          hpcmips_fb_xsize = 800;                          hpc_fb_ysize = 600;
2552                          hpcmips_fb_ysize = 600;                          hpc_fb_xsize_mem = 800;
2553                          hpcmips_fb_xsize_mem = 800;                          hpc_fb_ysize_mem = 600;
2554                          hpcmips_fb_ysize_mem = 600;                          hpc_fb_bits = 16;
2555                          hpcmips_fb_bits = 16;                          hpc_fb_encoding = BIFB_D16_0000;
                         hpcmips_fb_encoding = BIFB_D16_0000;  
2556    
2557                          machine->md_int.vr41xx_data = dev_vr41xx_init(machine, mem, 4121);                          machine->md_int.vr41xx_data = dev_vr41xx_init(machine, mem, 4121);
2558                          machine->md_interrupt = vr41xx_interrupt;                          machine->md_interrupt = vr41xx_interrupt;
2559    
2560                          store_32bit_word_in_host(cpu, (unsigned char *)&hpc_bootinfo.platid_cpu,                          hpc_platid_cpu_arch = 1;        /*  MIPS  */
2561                                (1 << 26)         /*  1 = MIPS  */                          hpc_platid_cpu_series = 1;      /*  VR  */
2562                              + (1 << 20)         /*  1 = VR  */                          hpc_platid_cpu_model = 1;       /*  VR41XX  */
2563                              + (1 << 14)         /*  1 = VR41XX  */                          hpc_platid_cpu_submodel = 3;    /*  VR4121  */
2564                              + (3 <<  8)         /*  3 = VR4121  */                          hpc_platid_vendor = 1;          /*  NEC  */
2565                              );                          hpc_platid_series = 2;          /*  NEC MCR  */
2566                          store_32bit_word_in_host(cpu, (unsigned char *)&hpc_bootinfo.platid_machine,                          hpc_platid_model = 3;           /*  MCR 7XX  */
2567                                (1 << 22)         /*  22: vendor  1=NEC  */                          hpc_platid_submodel = 4;        /*  MCR 730A  */
                             + (2 << 16)         /*  16: series  2="NEC MCR" */  
                             + (3 <<  8)         /*   8: model   3="MCR 7XX" */  
                             + (4)               /*   0: submodel 4="MCR 730A" */  
                             );  
2568                          break;                          break;
2569                  case MACHINE_HPCMIPS_AGENDA_VR3:                  case MACHINE_HPCMIPS_AGENDA_VR3:
2570                          /*  66 MHz VR4181  */                          /*  66 MHz VR4181  */
2571                          machine->machine_name = "Agenda VR3";                          machine->machine_name = "Agenda VR3";
2572                          /*  TODO:  */                          /*  TODO:  */
2573                          hpcmips_fb_addr = 0x1000;                          hpc_fb_addr = 0x1000;
2574                          hpcmips_fb_xsize = 160;                          hpc_fb_xsize = 160;
2575                          hpcmips_fb_ysize = 240;                          hpc_fb_ysize = 240;
2576                          hpcmips_fb_xsize_mem = 160;                          hpc_fb_xsize_mem = 160;
2577                          hpcmips_fb_ysize_mem = 240;                          hpc_fb_ysize_mem = 240;
2578                          hpcmips_fb_bits = 4;                          hpc_fb_bits = 4;
2579                          hpcmips_fb_encoding = BIFB_D4_M2L_F;                          hpc_fb_encoding = BIFB_D4_M2L_F;
2580    
2581                          machine->md_int.vr41xx_data = dev_vr41xx_init(machine, mem, 4181);                          machine->md_int.vr41xx_data = dev_vr41xx_init(machine, mem, 4181);
2582                          machine->md_interrupt = vr41xx_interrupt;                          machine->md_interrupt = vr41xx_interrupt;
# Line 2628  void machine_setup(struct machine *machi Line 2592  void machine_setup(struct machine *machi
2592                                          machine->main_console_handle = x;                                          machine->main_console_handle = x;
2593                          }                          }
2594    
2595                          store_32bit_word_in_host(cpu, (unsigned char *)&hpc_bootinfo.platid_cpu,                          hpc_platid_cpu_arch = 1;        /*  MIPS  */
2596                                (1 << 26)         /*  1 = MIPS  */                          hpc_platid_cpu_series = 1;      /*  VR  */
2597                              + (1 << 20)         /*  1 = VR  */                          hpc_platid_cpu_model = 1;       /*  VR41XX  */
2598                              + (1 << 14)         /*  1 = VR41XX  */                          hpc_platid_cpu_submodel = 4;    /*  VR4181  */
2599                              + (4 <<  8)         /*  4 = VR4181  */                          hpc_platid_vendor = 15;         /*  Agenda  */
2600                              );                          hpc_platid_series = 1;          /*  VR  */
2601                          store_32bit_word_in_host(cpu, (unsigned char *)&hpc_bootinfo.platid_machine,                          hpc_platid_model = 1;           /*  VR3  */
2602                                (15 << 22)        /*  22: vendor  15=Agenda  */                          hpc_platid_submodel = 0;        /*  -  */
                             + (1 << 16)         /*  16: series  2=VR */  
                             + (1 <<  8)         /*   8: model   1=VR3  */  
                             + (0)               /*   0: submodel 0="VR3" */  
                             );  
2603    
2604                          dev_ram_init(mem, 0x0f000000, 0x01000000, DEV_RAM_MIRROR, 0x0);                          dev_ram_init(machine, 0x0f000000, 0x01000000,
2605                                DEV_RAM_MIRROR | DEV_RAM_MIGHT_POINT_TO_DEVICES, 0x0);
2606                          break;                          break;
2607                  case MACHINE_HPCMIPS_IBM_WORKPAD_Z50:                  case MACHINE_HPCMIPS_IBM_WORKPAD_Z50:
2608                          /*  131 MHz VR4121  */                          /*  131 MHz VR4121  */
2609                          machine->machine_name = "IBM Workpad Z50";                          machine->machine_name = "IBM Workpad Z50";
2610                          /*  TODO:  */                          /*  TODO:  */
2611                          hpcmips_fb_addr = 0xa000000;                          hpc_fb_addr = 0xa000000;
2612                          hpcmips_fb_xsize = 640;                          hpc_fb_xsize = 640;
2613                          hpcmips_fb_ysize = 480;                          hpc_fb_ysize = 480;
2614                          hpcmips_fb_xsize_mem = 640;                          hpc_fb_xsize_mem = 640;
2615                          hpcmips_fb_ysize_mem = 480;                          hpc_fb_ysize_mem = 480;
2616                          hpcmips_fb_bits = 16;                          hpc_fb_bits = 16;
2617                          hpcmips_fb_encoding = BIFB_D16_0000;                          hpc_fb_encoding = BIFB_D16_0000;
2618    
2619                          machine->md_int.vr41xx_data = dev_vr41xx_init(machine, mem, 4121);                          machine->md_int.vr41xx_data = dev_vr41xx_init(machine, mem, 4121);
2620                          machine->md_interrupt = vr41xx_interrupt;                          machine->md_interrupt = vr41xx_interrupt;
2621    
2622                          store_32bit_word_in_host(cpu, (unsigned char *)&hpc_bootinfo.platid_cpu,                          hpc_platid_cpu_arch = 1;        /*  MIPS  */
2623                                (1 << 26)         /*  1 = MIPS  */                          hpc_platid_cpu_series = 1;      /*  VR  */
2624                              + (1 << 20)         /*  1 = VR  */                          hpc_platid_cpu_model = 1;       /*  VR41XX  */
2625                              + (1 << 14)         /*  1 = VR41XX  */                          hpc_platid_cpu_submodel = 3;    /*  VR4121  */
2626                              + (3 <<  8)         /*  3 = VR4121  */                          hpc_platid_vendor = 9;          /*  IBM  */
2627                              );                          hpc_platid_series = 1;          /*  WorkPad  */
2628                          store_32bit_word_in_host(cpu, (unsigned char *)&hpc_bootinfo.platid_machine,                          hpc_platid_model = 1;           /*  Z50  */
2629                                (9 << 22)         /*  22: vendor  9=IBM  */                          hpc_platid_submodel = 0;        /*  0  */
                             + (1 << 16)         /*  16: series  1=WorkPad */  
                             + (1 <<  8)         /*   8: model   1=Z50  */  
                             + (0)               /*   0: submodel 0 */  
                             );  
2630                          break;                          break;
2631                  default:                  default:
2632                          printf("Unimplemented hpcmips machine number.\n");                          printf("Unimplemented hpcmips machine number.\n");
2633                          exit(1);                          exit(1);
2634                  }                  }
2635    
2636                    store_32bit_word_in_host(cpu, (unsigned char *)&hpc_bootinfo.platid_cpu,
2637                          (hpc_platid_cpu_arch << 26) + (hpc_platid_cpu_series << 20)
2638                        + (hpc_platid_cpu_model << 14) + (hpc_platid_cpu_submodel <<  8)
2639                        + hpc_platid_flags);
2640                    store_32bit_word_in_host(cpu, (unsigned char *)&hpc_bootinfo.platid_machine,
2641                          (hpc_platid_vendor << 22) + (hpc_platid_series << 16)
2642                        + (hpc_platid_model <<  8) + hpc_platid_submodel);
2643    
2644                  if (machine->use_x11)                  if (machine->use_x11)
2645                          machine->main_console_handle =                          machine->main_console_handle =
2646                              machine->md_int.vr41xx_data->kiu_console_handle;                              machine->md_int.vr41xx_data->kiu_console_handle;
# Line 2734  void machine_setup(struct machine *machi Line 2699  void machine_setup(struct machine *machi
2699    
2700                          store_16bit_word_in_host(cpu, (unsigned char *)&hpc_bootinfo.length, sizeof(hpc_bootinfo));                          store_16bit_word_in_host(cpu, (unsigned char *)&hpc_bootinfo.length, sizeof(hpc_bootinfo));
2701                          store_32bit_word_in_host(cpu, (unsigned char *)&hpc_bootinfo.magic, HPC_BOOTINFO_MAGIC);                          store_32bit_word_in_host(cpu, (unsigned char *)&hpc_bootinfo.magic, HPC_BOOTINFO_MAGIC);
2702                          store_32bit_word_in_host(cpu, (unsigned char *)&hpc_bootinfo.fb_addr, 0x80000000 + hpcmips_fb_addr);                          store_32bit_word_in_host(cpu, (unsigned char *)&hpc_bootinfo.fb_addr, 0x80000000 + hpc_fb_addr);
2703                          store_16bit_word_in_host(cpu, (unsigned char *)&hpc_bootinfo.fb_line_bytes, hpcmips_fb_xsize_mem * (((hpcmips_fb_bits-1)|7)+1) / 8);                          store_16bit_word_in_host(cpu, (unsigned char *)&hpc_bootinfo.fb_line_bytes, hpc_fb_xsize_mem * (((hpc_fb_bits-1)|7)+1) / 8);
2704                          store_16bit_word_in_host(cpu, (unsigned char *)&hpc_bootinfo.fb_width, hpcmips_fb_xsize);                          store_16bit_word_in_host(cpu, (unsigned char *)&hpc_bootinfo.fb_width, hpc_fb_xsize);
2705                          store_16bit_word_in_host(cpu, (unsigned char *)&hpc_bootinfo.fb_height, hpcmips_fb_ysize);                          store_16bit_word_in_host(cpu, (unsigned char *)&hpc_bootinfo.fb_height, hpc_fb_ysize);
2706                          store_16bit_word_in_host(cpu, (unsigned char *)&hpc_bootinfo.fb_type, hpcmips_fb_encoding);                          store_16bit_word_in_host(cpu, (unsigned char *)&hpc_bootinfo.fb_type, hpc_fb_encoding);
2707                          store_16bit_word_in_host(cpu, (unsigned char *)&hpc_bootinfo.bi_cnuse, BI_CNUSE_BUILTIN);  /*  _BUILTIN or _SERIAL  */                          store_16bit_word_in_host(cpu, (unsigned char *)&hpc_bootinfo.bi_cnuse, BI_CNUSE_BUILTIN);  /*  _BUILTIN or _SERIAL  */
2708    
2709                          /*  printf("hpc_bootinfo.platid_cpu     = 0x%08x\n", hpc_bootinfo.platid_cpu);                          /*  printf("hpc_bootinfo.platid_cpu     = 0x%08x\n", hpc_bootinfo.platid_cpu);
# Line 2747  void machine_setup(struct machine *machi Line 2712  void machine_setup(struct machine *machi
2712                          store_buf(cpu, 0x80000000 + machine->physical_ram_in_mb * 1048576 - 256, (char *)&hpc_bootinfo, sizeof(hpc_bootinfo));                          store_buf(cpu, 0x80000000 + machine->physical_ram_in_mb * 1048576 - 256, (char *)&hpc_bootinfo, sizeof(hpc_bootinfo));
2713                  }                  }
2714    
2715                  if (hpcmips_fb_addr != 0) {                  if (hpc_fb_addr != 0) {
2716                          dev_fb_init(machine, mem, hpcmips_fb_addr, VFB_HPCMIPS,                          dev_fb_init(machine, mem, hpc_fb_addr, VFB_HPC,
2717                              hpcmips_fb_xsize, hpcmips_fb_ysize,                              hpc_fb_xsize, hpc_fb_ysize,
2718                              hpcmips_fb_xsize_mem, hpcmips_fb_ysize_mem,                              hpc_fb_xsize_mem, hpc_fb_ysize_mem,
2719                              hpcmips_fb_bits, "HPCmips");                              hpc_fb_bits, machine->machine_name);
2720    
2721                          /*  NetBSD/hpcmips uses framebuffer at physical                          /*  NetBSD/hpcmips uses framebuffer at physical
2722                              address 0x8.......:  */                              address 0x8.......:  */
2723                          dev_ram_init(mem, 0x80000000, 0x20000000,                          dev_ram_init(machine, 0x80000000, 0x20000000,
2724                              DEV_RAM_MIRROR, 0x0);                              DEV_RAM_MIRROR | DEV_RAM_MIGHT_POINT_TO_DEVICES, 0x0);
2725                  }                  }
2726    
2727                  break;                  break;
# Line 2784  void machine_setup(struct machine *machi Line 2749  void machine_setup(struct machine *machi
2749                  machine->md_int.ps2_data = dev_ps2_stuff_init(machine, mem, 0x10000000);                  machine->md_int.ps2_data = dev_ps2_stuff_init(machine, mem, 0x10000000);
2750                  device_add(machine, "ps2_gs addr=0x12000000");                  device_add(machine, "ps2_gs addr=0x12000000");
2751                  device_add(machine, "ps2_ether addr=0x14001000");                  device_add(machine, "ps2_ether addr=0x14001000");
2752                  dev_ram_init(mem, 0x1c000000, 4 * 1048576, DEV_RAM_RAM, 0);     /*  TODO: how much?  */                  dev_ram_init(machine, 0x1c000000, 4 * 1048576, DEV_RAM_RAM, 0); /*  TODO: how much?  */
2753                  /*  irq = 8 + 32 + 1 (SBUS/USB)  */                  /*  irq = 8 + 32 + 1 (SBUS/USB)  */
2754                  device_add(machine, "ohci addr=0x1f801600 irq=41");                  device_add(machine, "ohci addr=0x1f801600 irq=41");
2755    
# Line 2871  void machine_setup(struct machine *machi Line 2836  void machine_setup(struct machine *machi
2836                          /*  Special cases for IP20,22,24,26 memory offset:  */                          /*  Special cases for IP20,22,24,26 memory offset:  */
2837                          if (machine->machine_subtype == 20 || machine->machine_subtype == 22 ||                          if (machine->machine_subtype == 20 || machine->machine_subtype == 22 ||
2838                              machine->machine_subtype == 24 || machine->machine_subtype == 26) {                              machine->machine_subtype == 24 || machine->machine_subtype == 26) {
2839                                  dev_ram_init(mem, 0x00000000, 0x10000, DEV_RAM_MIRROR, sgi_ram_offset);                                  dev_ram_init(machine, 0x00000000, 0x10000, DEV_RAM_MIRROR
2840                                  dev_ram_init(mem, 0x00050000, sgi_ram_offset-0x50000, DEV_RAM_MIRROR, sgi_ram_offset + 0x50000);                                      | DEV_RAM_MIGHT_POINT_TO_DEVICES, sgi_ram_offset);
2841                                    dev_ram_init(machine, 0x00050000, sgi_ram_offset-0x50000,
2842                                        DEV_RAM_MIRROR | DEV_RAM_MIGHT_POINT_TO_DEVICES, sgi_ram_offset + 0x50000);
2843                          }                          }
2844    
2845                          /*  Special cases for IP28,30 memory offset:  */                          /*  Special cases for IP28,30 memory offset:  */
2846                          if (machine->machine_subtype == 28 || machine->machine_subtype == 30) {                          if (machine->machine_subtype == 28 || machine->machine_subtype == 30) {
2847                                  /*  TODO: length below should maybe not be 128MB?  */                                  /*  TODO: length below should maybe not be 128MB?  */
2848                                  dev_ram_init(mem, 0x00000000, 128*1048576, DEV_RAM_MIRROR, sgi_ram_offset);                                  dev_ram_init(machine, 0x00000000, 128*1048576, DEV_RAM_MIRROR | DEV_RAM_MIGHT_POINT_TO_DEVICES, sgi_ram_offset);
2849                          }                          }
2850                  } else {                  } else {
2851                          cpu->byte_order = EMUL_LITTLE_ENDIAN;                          cpu->byte_order = EMUL_LITTLE_ENDIAN;
# Line 2889  void machine_setup(struct machine *machi Line 2856  void machine_setup(struct machine *machi
2856                  if (machine->machine_type == MACHINE_SGI) {                  if (machine->machine_type == MACHINE_SGI) {
2857                          /*  TODO:  Other SGI machine types?  */                          /*  TODO:  Other SGI machine types?  */
2858                          switch (machine->machine_subtype) {                          switch (machine->machine_subtype) {
2859                            case 10:
2860                                    strlcat(machine->machine_name, " (4D/25)", MACHINE_NAME_MAXBUF);
2861                                    /*  TODO  */
2862                                    break;
2863                          case 12:                          case 12:
2864                                  strlcat(machine->machine_name,                                  strlcat(machine->machine_name,
2865                                      " (Iris Indigo IP12)", MACHINE_NAME_MAXBUF);                                      " (Iris Indigo IP12)", MACHINE_NAME_MAXBUF);
# Line 2990  void machine_setup(struct machine *machi Line 2961  void machine_setup(struct machine *machi
2961    
2962  /*  /*
2963  Why is this here? TODO  Why is this here? TODO
2964                                  dev_ram_init(mem, 0x88000000ULL,                                  dev_ram_init(machine, 0x88000000ULL,
2965                                      128 * 1048576, DEV_RAM_MIRROR, 0x08000000);                                      128 * 1048576, DEV_RAM_MIRROR, 0x08000000);
2966  */  */
2967                                  machine->md_interrupt = sgi_ip22_interrupt;                                  machine->md_interrupt = sgi_ip22_interrupt;
# Line 3117  Why is this here? TODO Line 3088  Why is this here? TODO
3088                                  machine->md_int.sgi_ip30_data = dev_sgi_ip30_init(machine, mem, 0x0ff00000);                                  machine->md_int.sgi_ip30_data = dev_sgi_ip30_init(machine, mem, 0x0ff00000);
3089                                  machine->md_interrupt = sgi_ip30_interrupt;                                  machine->md_interrupt = sgi_ip30_interrupt;
3090    
3091                                  dev_ram_init(mem,    0xa0000000ULL,                                  dev_ram_init(machine,    0xa0000000ULL,
3092                                      128 * 1048576, DEV_RAM_MIRROR, 0x00000000);                                      128 * 1048576, DEV_RAM_MIRROR
3093                                        | DEV_RAM_MIGHT_POINT_TO_DEVICES,
3094                                        0x00000000);
3095    
3096                                  dev_ram_init(mem,    0x80000000ULL,                                  dev_ram_init(machine,    0x80000000ULL,
3097                                      32 * 1048576, DEV_RAM_RAM, 0x00000000);                                      32 * 1048576, DEV_RAM_RAM, 0x00000000);
3098    
3099                                  /*                                  /*
# Line 3152  Why is this here? TODO Line 3125  Why is this here? TODO
3125                                      " (O2)", MACHINE_NAME_MAXBUF);                                      " (O2)", MACHINE_NAME_MAXBUF);
3126    
3127                                  /*  TODO:  Find out where the physical ram is actually located.  */                                  /*  TODO:  Find out where the physical ram is actually located.  */
3128                                  dev_ram_init(mem, 0x07ffff00ULL,           256, DEV_RAM_MIRROR, 0x03ffff00);                                  dev_ram_init(machine, 0x07ffff00ULL,           256, DEV_RAM_MIRROR, 0x03ffff00);
3129                                  dev_ram_init(mem, 0x10000000ULL,           256, DEV_RAM_MIRROR, 0x00000000);                                  dev_ram_init(machine, 0x10000000ULL,           256, DEV_RAM_MIRROR, 0x00000000);
3130                                  dev_ram_init(mem, 0x11ffff00ULL,           256, DEV_RAM_MIRROR, 0x01ffff00);                                  dev_ram_init(machine, 0x11ffff00ULL,           256, DEV_RAM_MIRROR, 0x01ffff00);
3131                                  dev_ram_init(mem, 0x12000000ULL,           256, DEV_RAM_MIRROR, 0x02000000);                                  dev_ram_init(machine, 0x12000000ULL,           256, DEV_RAM_MIRROR, 0x02000000);
3132                                  dev_ram_init(mem, 0x17ffff00ULL,           256, DEV_RAM_MIRROR, 0x03ffff00);                                  dev_ram_init(machine, 0x17ffff00ULL,           256, DEV_RAM_MIRROR, 0x03ffff00);
3133                                  dev_ram_init(mem, 0x20000000ULL, 128 * 1048576, DEV_RAM_MIRROR, 0x00000000);                                  dev_ram_init(machine, 0x20000000ULL, 128 * 1048576, DEV_RAM_MIRROR, 0x00000000);
3134                                  dev_ram_init(mem, 0x40000000ULL, 128 * 1048576, DEV_RAM_MIRROR, 0x10000000);                                  dev_ram_init(machine, 0x40000000ULL, 128 * 1048576, DEV_RAM_MIRROR, 0x10000000);
3135    
3136                                  machine->md_int.ip32.crime_data = dev_crime_init(machine, mem, 0x14000000, 2, machine->use_x11);        /*  crime0  */                                  machine->md_int.ip32.crime_data = dev_crime_init(machine, mem, 0x14000000, 2, machine->use_x11);        /*  crime0  */
3137                                  dev_sgi_mte_init(mem, 0x15000000);                      /*  mte ??? memory thing  */                                  dev_sgi_mte_init(mem, 0x15000000);                      /*  mte ??? memory thing  */
# Line 3469  Why is this here? TODO Line 3442  Why is this here? TODO
3442                                          break;                                          break;
3443                                  case MACHINE_ARC_JAZZ_MAGNUM:                                  case MACHINE_ARC_JAZZ_MAGNUM:
3444                                          /*  PROM mirror?  */                                          /*  PROM mirror?  */
3445                                          dev_ram_init(mem, 0xfff00000, 0x100000,                                          dev_ram_init(machine, 0xfff00000, 0x100000,
3446                                              DEV_RAM_MIRROR, 0x1fc00000);                                              DEV_RAM_MIRROR | DEV_RAM_MIGHT_POINT_TO_DEVICES, 0x1fc00000);
3447    
3448                                          /*  VXL. TODO  */                                          /*  VXL. TODO  */
3449                                          /*  control at 0x60100000?  */                                          /*  control at 0x60100000?  */
# Line 4042  Not yet. Line 4015  Not yet.
4015                              "------------------------------------------\n");                              "------------------------------------------\n");
4016    
4017                  /*  480 x 272 pixels framebuffer (512 bytes per line)  */                  /*  480 x 272 pixels framebuffer (512 bytes per line)  */
4018                  fb = dev_fb_init(machine, mem, 0x04000000, VFB_HPCMIPS,                  fb = dev_fb_init(machine, mem, 0x04000000, VFB_HPC,
4019                      480,272, 512,1088, -15, "Playstation Portable");                      480,272, 512,1088, -15, "Playstation Portable");
4020    
4021                  /*                  /*
# Line 4260  Not yet. Line 4233  Not yet.
4233                           *  r5 = OpenFirmware entry point.  NOTE: See                           *  r5 = OpenFirmware entry point.  NOTE: See
4234                           *  cpu_ppc.c for the rest of this semi-ugly hack.                           *  cpu_ppc.c for the rest of this semi-ugly hack.
4235                           */                           */
4236                          dev_ram_init(cpu->mem, cpu->cd.ppc.of_emul_addr,                          dev_ram_init(machine, cpu->cd.ppc.of_emul_addr,
4237                              0x1000, DEV_RAM_RAM, 0x0);                              0x1000, DEV_RAM_RAM, 0x0);
4238                          store_32bit_word(cpu, cpu->cd.ppc.of_emul_addr,                          store_32bit_word(cpu, cpu->cd.ppc.of_emul_addr,
4239                              0x44ee0002);                              0x44ee0002);
# Line 4590  Not yet. Line 4563  Not yet.
4563                  machine->md_interrupt = footbridge_interrupt;                  machine->md_interrupt = footbridge_interrupt;
4564    
4565                  /*  NetBSD and OpenBSD clean their caches here:  */                  /*  NetBSD and OpenBSD clean their caches here:  */
4566                  dev_ram_init(mem, 0x50000000, 0x4000, DEV_RAM_RAM, 0);                  dev_ram_init(machine, 0x50000000, 0x4000, DEV_RAM_RAM, 0);
4567    
4568                  /*  Interrupt ack space?  */                  /*  Interrupt ack space?  */
4569                  dev_ram_init(mem, 0x80000000, 0x1000, DEV_RAM_RAM, 0);                  dev_ram_init(machine, 0x80000000, 0x1000, DEV_RAM_RAM, 0);
4570    
4571                  snprintf(tmpstr, sizeof(tmpstr), "8259 irq=64 addr=0x7c000020");                  snprintf(tmpstr, sizeof(tmpstr), "8259 irq=64 addr=0x7c000020");
4572                  machine->isa_pic_data.pic1 = device_add(machine, tmpstr);                  machine->isa_pic_data.pic1 = device_add(machine, tmpstr);
# Line 4667  Not yet. Line 4640  Not yet.
4640                  break;                  break;
4641    
4642          case MACHINE_HPCARM:          case MACHINE_HPCARM:
4643                  machine->machine_name = "HPCarm";                  cpu->byte_order = EMUL_LITTLE_ENDIAN;
4644                  dev_ram_init(mem, 0xc0000000, 0x10000000, DEV_RAM_MIRROR, 0x0);                  memset(&hpc_bootinfo, 0, sizeof(hpc_bootinfo));
4645                    switch (machine->machine_subtype) {
4646                    case MACHINE_HPCARM_IPAQ:
4647                            /*  SA-1110 206MHz  */
4648                            machine->machine_name = "Compaq iPAQ H3600";
4649                            hpc_fb_addr = 0x48200000;       /*  TODO  */
4650                            hpc_fb_xsize = 240;
4651                            hpc_fb_ysize = 320;
4652                            hpc_fb_xsize_mem = 256;
4653                            hpc_fb_ysize_mem = 320;
4654                            hpc_fb_bits = 15;
4655                            hpc_fb_encoding = BIFB_D16_0000;
4656                            hpc_platid_cpu_arch = 3;        /*  ARM  */
4657                            hpc_platid_cpu_series = 1;      /*  StrongARM  */
4658                            hpc_platid_cpu_model = 2;       /*  SA-1110  */
4659                            hpc_platid_cpu_submodel = 0;
4660                            hpc_platid_vendor = 7;          /*  Compaq  */
4661                            hpc_platid_series = 4;          /*  IPAQ  */
4662                            hpc_platid_model = 2;           /*  H36xx  */
4663                            hpc_platid_submodel = 1;        /*  H3600  */
4664                            break;
4665                    case MACHINE_HPCARM_JORNADA720:
4666                            /*  SA-1110 206MHz  */
4667                            machine->machine_name = "Jornada 720";
4668                            hpc_fb_addr = 0x48200000;
4669                            hpc_fb_xsize = 640;
4670                            hpc_fb_ysize = 240;
4671                            hpc_fb_xsize_mem = 640;
4672                            hpc_fb_ysize_mem = 240;
4673                            hpc_fb_bits = 16;
4674                            hpc_fb_encoding = BIFB_D16_0000;
4675                            hpc_platid_cpu_arch = 3;        /*  ARM  */
4676                            hpc_platid_cpu_series = 1;      /*  StrongARM  */
4677                            hpc_platid_cpu_model = 2;       /*  SA-1110  */
4678                            hpc_platid_cpu_submodel = 0;
4679                            hpc_platid_vendor = 11;         /*  HP  */
4680                            hpc_platid_series = 2;          /*  Jornada  */
4681                            hpc_platid_model = 2;           /*  7xx  */
4682                            hpc_platid_submodel = 1;        /*  720  */
4683                            break;
4684                    default:
4685                            printf("Unimplemented hpcarm machine number.\n");
4686                            exit(1);
4687                    }
4688    
4689                  /*  TODO: Different models  */                  store_32bit_word_in_host(cpu, (unsigned char *)&hpc_bootinfo.platid_cpu,
4690                          (hpc_platid_cpu_arch << 26) + (hpc_platid_cpu_series << 20)
4691                        + (hpc_platid_cpu_model << 14) + (hpc_platid_cpu_submodel <<  8)
4692                        + hpc_platid_flags);
4693                    store_32bit_word_in_host(cpu, (unsigned char *)&hpc_bootinfo.platid_machine,
4694                          (hpc_platid_vendor << 22) + (hpc_platid_series << 16)
4695                        + (hpc_platid_model <<  8) + hpc_platid_submodel);
4696    
4697                  if (machine->prom_emulation) {                  if (machine->prom_emulation) {
4698                          cpu->cd.arm.r[0] = 1;                          /*  NetBSD/hpcarm and possibly others expects the following:  */
4699                          cpu->cd.arm.r[ARM_SP] = 0xc000c000;  
4700                            cpu->cd.arm.r[0] = 1;   /*  argc  */
4701                            cpu->cd.arm.r[1] = machine->physical_ram_in_mb * 1048576 - 512; /*  argv  */
4702                            cpu->cd.arm.r[2] = machine->physical_ram_in_mb * 1048576 - 256; /*  ptr to hpc_bootinfo  */
4703    
4704                            bootstr = machine->boot_kernel_filename;
4705                            store_32bit_word(cpu, machine->physical_ram_in_mb * 1048576 - 512,
4706                                machine->physical_ram_in_mb * 1048576 - 512 + 16);
4707                            store_32bit_word(cpu, machine->physical_ram_in_mb * 1048576 - 512 + 4, 0);
4708                            store_string(cpu, machine->physical_ram_in_mb * 1048576 - 512 + 16, bootstr);
4709    
4710                            if (machine->boot_string_argument[0]) {
4711                                    cpu->cd.arm.r[0] ++;    /*  argc  */
4712    
4713                                    store_32bit_word(cpu, machine->physical_ram_in_mb * 1048576 - 512 + 4, machine->physical_ram_in_mb * 1048576 - 512 + 64);
4714                                    store_32bit_word(cpu, machine->physical_ram_in_mb * 1048576 - 512 + 8, 0);
4715    
4716                                    store_string(cpu, machine->physical_ram_in_mb * 1048576 - 512 + 64,
4717                                        machine->boot_string_argument);
4718    
4719                                    bootarg = machine->boot_string_argument;
4720                            }
4721    
4722                            store_16bit_word_in_host(cpu, (unsigned char *)&hpc_bootinfo.length, sizeof(hpc_bootinfo));
4723                            store_32bit_word_in_host(cpu, (unsigned char *)&hpc_bootinfo.magic, HPC_BOOTINFO_MAGIC);
4724                            store_32bit_word_in_host(cpu, (unsigned char *)&hpc_bootinfo.fb_addr, hpc_fb_addr);
4725                            store_16bit_word_in_host(cpu, (unsigned char *)&hpc_bootinfo.fb_line_bytes, hpc_fb_xsize_mem * (((hpc_fb_bits-1)|7)+1) / 8);
4726                            store_16bit_word_in_host(cpu, (unsigned char *)&hpc_bootinfo.fb_width, hpc_fb_xsize);
4727                            store_16bit_word_in_host(cpu, (unsigned char *)&hpc_bootinfo.fb_height, hpc_fb_ysize);
4728                            store_16bit_word_in_host(cpu, (unsigned char *)&hpc_bootinfo.fb_type, hpc_fb_encoding);
4729                            store_16bit_word_in_host(cpu, (unsigned char *)&hpc_bootinfo.bi_cnuse,
4730                                machine->use_x11? BI_CNUSE_BUILTIN : BI_CNUSE_SERIAL);
4731    
4732                            store_32bit_word_in_host(cpu, (unsigned char *)&hpc_bootinfo.timezone, 0);
4733                            store_buf(cpu, machine->physical_ram_in_mb * 1048576 - 256, (char *)&hpc_bootinfo, sizeof(hpc_bootinfo));
4734    
4735                            /*
4736                             *  TODO: ugly hack, only works with small NetBSD
4737                             *        kernels!
4738                             */
4739                            cpu->cd.arm.r[ARM_SP] = 0xc02c0000;
4740                    }
4741    
4742                    /*  Physical RAM at 0xc0000000:  */
4743                    dev_ram_init(machine, 0xc0000000, 0x20000000,
4744                        DEV_RAM_MIRROR, 0x0);
4745    
4746                    /*  Cache flush region:  */
4747                    dev_ram_init(machine, 0xe0000000, 0x10000, DEV_RAM_RAM, 0x0);
4748    
4749                    if (hpc_fb_addr != 0) {
4750                            dev_fb_init(machine, mem, hpc_fb_addr, VFB_HPC,
4751                                hpc_fb_xsize, hpc_fb_ysize,
4752                                hpc_fb_xsize_mem, hpc_fb_ysize_mem,
4753                                hpc_fb_bits, machine->machine_name);
4754                  }                  }
4755                  break;                  break;
4756    
4757          case MACHINE_ZAURUS:          case MACHINE_ZAURUS:
4758                  machine->machine_name = "Zaurus";                  machine->machine_name = "Zaurus";
4759                  dev_ram_init(mem, 0xa0000000, 0x20000000, DEV_RAM_MIRROR, 0x0);                  dev_ram_init(machine, 0xa0000000, 0x20000000,
4760                        DEV_RAM_MIRROR, 0x0);
4761                  device_add(machine, "ns16550 irq=0 addr=0x40100000 addr_mult=4");                  device_add(machine, "ns16550 irq=0 addr=0x40100000 addr_mult=4");
4762                  /*  TODO  */                  /*  TODO  */
4763                  if (machine->prom_emulation) {                  if (machine->prom_emulation) {
# Line 4744  Not yet. Line 4821  Not yet.
4821                  cpu->cd.arm.coproc[6] = arm_coproc_i80321;                  cpu->cd.arm.coproc[6] = arm_coproc_i80321;
4822                  cpu->cd.arm.coproc[14] = arm_coproc_i80321_14;                  cpu->cd.arm.coproc[14] = arm_coproc_i80321_14;
4823                  device_add(machine, "ns16550 irq=0 addr=0xfe800000");                  device_add(machine, "ns16550 irq=0 addr=0xfe800000");
4824                  dev_ram_init(mem, 0xa0000000, 0x20000000, DEV_RAM_MIRROR, 0x0);  
4825                  dev_ram_init(mem, 0xc0000000, 0x20000000, DEV_RAM_MIRROR, 0x0);                  /*  0xa0000000 = physical ram, 0xc0000000 = uncached  */
4826                    dev_ram_init(machine, 0xa0000000, 0x20000000,
4827                        DEV_RAM_MIRROR, 0x0);
4828                    dev_ram_init(machine, 0xc0000000, 0x20000000,
4829                        DEV_RAM_MIRROR, 0x0);
4830    
4831                    /*  0xe0000000 and 0xff000000 = cache flush regions  */
4832                    dev_ram_init(machine, 0xe0000000, 0x100000, DEV_RAM_RAM, 0x0);
4833                    dev_ram_init(machine, 0xff000000, 0x100000, DEV_RAM_RAM, 0x0);
4834    
4835                    device_add(machine, "i80321 addr=0xffffe000");
4836    
4837                  if (machine->prom_emulation) {                  if (machine->prom_emulation) {
4838                          arm_setup_initial_translation_table(cpu, 0x8000);                          arm_setup_initial_translation_table(cpu, 0x4000);
4839                            arm_translation_table_set_l1(cpu, 0xa0000000, 0xa0000000);
4840                            arm_translation_table_set_l1(cpu, 0xc0000000, 0xa0000000);
4841                            arm_translation_table_set_l1(cpu, 0xe0000000, 0xe0000000);
4842                            arm_translation_table_set_l1(cpu, 0xf0000000, 0xf0000000);
4843                  }                  }
4844                  break;                  break;
4845    
# Line 4755  Not yet. Line 4847  Not yet.
4847                  machine->machine_name = "Iyonix";                  machine->machine_name = "Iyonix";
4848                  cpu->cd.arm.coproc[6] = arm_coproc_i80321;                  cpu->cd.arm.coproc[6] = arm_coproc_i80321;
4849                  cpu->cd.arm.coproc[14] = arm_coproc_i80321_14;                  cpu->cd.arm.coproc[14] = arm_coproc_i80321_14;
4850    
4851                    device_add(machine, "ns16550 irq=0 addr=0xfe800000");
4852    
4853                    /*  0xa0000000 = physical ram, 0xc0000000 = uncached  */
4854                    dev_ram_init(machine, 0xa0000000, 0x20000000,
4855                        DEV_RAM_MIRROR, 0x0);
4856                    dev_ram_init(machine, 0xc0000000, 0x20000000,
4857                        DEV_RAM_MIRROR, 0x0);
4858    
4859                    device_add(machine, "i80321 addr=0xffffe000");
4860    
4861                  if (machine->prom_emulation) {                  if (machine->prom_emulation) {
4862                          arm_setup_initial_translation_table(cpu,                          arm_setup_initial_translation_table(cpu,
4863                              machine->physical_ram_in_mb * 1048576 - 65536);                              machine->physical_ram_in_mb * 1048576 - 65536);
4864                            arm_translation_table_set_l1(cpu, 0xa0000000, 0xa0000000);
4865                            arm_translation_table_set_l1(cpu, 0xc0000000, 0xa0000000);
4866                            arm_translation_table_set_l1_b(cpu, 0xff000000, 0xff000000);
4867                  }                  }
4868                  break;                  break;
4869  #endif  /*  ENABLE_ARM  */  #endif  /*  ENABLE_ARM  */

Legend:
Removed from v.16  
changed lines
  Added in v.18

  ViewVC Help
Powered by ViewVC 1.1.26