/[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 22 by dpavlin, Mon Oct 8 16:19:37 2007 UTC revision 32 by dpavlin, Mon Oct 8 16:20:58 2007 UTC
# Line 25  Line 25 
25   *  SUCH DAMAGE.   *  SUCH DAMAGE.
26   *     *  
27   *   *
28   *  $Id: machine_evbmips.c,v 1.2 2006/01/08 11:05:03 debug Exp $   *  $Id: machine_evbmips.c,v 1.11 2006/09/23 03:52:10 debug Exp $
29   */   */
30    
31  #include <stdio.h>  #include <stdio.h>
# Line 48  Line 48 
48  MACHINE_SETUP(evbmips)  MACHINE_SETUP(evbmips)
49  {  {
50          char tmpstr[1000];          char tmpstr[1000];
         char tmps[50];  
         uint64_t env, tmpptr;  
51          struct pci_data *pci_data;          struct pci_data *pci_data;
52          int i;          int i;
53    
# Line 58  MACHINE_SETUP(evbmips) Line 56  MACHINE_SETUP(evbmips)
56          switch (machine->machine_subtype) {          switch (machine->machine_subtype) {
57          case MACHINE_EVBMIPS_MALTA:          case MACHINE_EVBMIPS_MALTA:
58          case MACHINE_EVBMIPS_MALTA_BE:          case MACHINE_EVBMIPS_MALTA_BE:
59                    if (machine->emulated_hz == 0)
60                            machine->emulated_hz = 33000000;
61                  cpu->byte_order = EMUL_LITTLE_ENDIAN;                  cpu->byte_order = EMUL_LITTLE_ENDIAN;
62                  machine->machine_name = "MALTA (evbmips, little endian)";                  machine->machine_name = "MALTA (evbmips, little endian)";
63                  machine->stable = 1;                  machine->stable = 1;
# Line 94  MACHINE_SETUP(evbmips) Line 94  MACHINE_SETUP(evbmips)
94                  bus_pci_add(machine, pci_data, machine->memory,                  bus_pci_add(machine, pci_data, machine->memory,
95                      0, 9, 1, "piix4_ide");                      0, 9, 1, "piix4_ide");
96    
97                    /*  pcn: Not yet, since it is just a bogus device, so far.  */
98                    /*  bus_pci_add(machine, pci_data, machine->memory,
99                        0, 11, 0, "pcn");  */
100    
101                  device_add(machine, "malta_lcd addr=0x1f000400");                  device_add(machine, "malta_lcd addr=0x1f000400");
102                  break;                  break;
103    
104            case MACHINE_EVBMIPS_MESHCUBE:
105                    machine->machine_name = "Meshcube";
106    
107                    /*  See: http://mail-index.netbsd.org/port-evbmips/2006/
108                        02/23/0000.html  */
109    
110                    if (machine->physical_ram_in_mb != 64)
111                            fprintf(stderr, "WARNING! MeshCubes are supposed to "
112                                "have exactly 64 MB RAM. Continuing anyway.\n");
113                    if (machine->use_x11)
114                            fprintf(stderr, "WARNING! MeshCube with -X is "
115                                "meaningless. Continuing anyway.\n");
116    
117                    /*  First of all, the MeshCube has an Au1500 in it:  */
118                    machine->md_interrupt = au1x00_interrupt;
119                    machine->md_int.au1x00_ic_data = dev_au1x00_init(machine,
120                        machine->memory);
121    
122                    /*
123                     *  TODO:  Which non-Au1500 devices, and at what addresses?
124                     *
125                     *  "4G Systems MTX-1 Board" at ?
126                     *      1017fffc, 14005004, 11700000, 11700008, 11900014,
127                     *      1190002c, 11900100, 11900108, 1190010c,
128                     *      10400040 - 10400074,
129                     *      14001000 (possibly LCD?)
130                     *      11100028 (possibly ttySx?)
131                     *
132                     *  "usb_ohci=base:0x10100000,len:0x100000,irq:26"
133                     */
134    
135                    /*  Linux reads this during startup...  */
136                    device_add(machine, "random addr=0x1017fffc len=4");
137    
138                    break;
139    
140          case MACHINE_EVBMIPS_PB1000:          case MACHINE_EVBMIPS_PB1000:
141                  machine->machine_name = "PB1000 (evbmips)";                  machine->machine_name = "PB1000 (evbmips)";
142                  cpu->byte_order = EMUL_BIG_ENDIAN;                  cpu->byte_order = EMUL_BIG_ENDIAN;
# Line 134  MACHINE_SETUP(evbmips) Line 174  MACHINE_SETUP(evbmips)
174          /*  a2 = (yamon_env_var *)envp  */          /*  a2 = (yamon_env_var *)envp  */
175          cpu->cd.mips.gpr[MIPS_GPR_A2] = (int32_t)0x9fc01800;          cpu->cd.mips.gpr[MIPS_GPR_A2] = (int32_t)0x9fc01800;
176    
177          env = cpu->cd.mips.gpr[MIPS_GPR_A2];          yamon_machine_setup(machine, cpu->cd.mips.gpr[MIPS_GPR_A2]);
         tmpptr = 0xffffffff9fc01c00ULL;  
   
         snprintf(tmps, sizeof(tmps), "0x%08x", machine->physical_ram_in_mb<<20);  
         add_environment_string_dual(cpu, &env, &tmpptr, "memsize", tmps);  
   
         add_environment_string_dual(cpu, &env, &tmpptr, "yamonrev", "02.06");  
   
         /*  End of env:  */  
         tmpptr = 0;  
         add_environment_string_dual(cpu,  
                     &env, &tmpptr, NULL, NULL);  
178    
179          /*  a3 = memsize  */          /*  a3 = memsize  */
180          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;
# Line 165  MACHINE_SETUP(evbmips) Line 194  MACHINE_SETUP(evbmips)
194          for (i=0; i<0x100; i+=4)          for (i=0; i<0x100; i+=4)
195                  store_32bit_word(cpu, (int64_t)(int32_t)0x9fc00500 + i,                  store_32bit_word(cpu, (int64_t)(int32_t)0x9fc00500 + i,
196                      (int64_t)(int32_t)0x9fc00800 + i);                      (int64_t)(int32_t)0x9fc00800 + i);
197    
198            /*  "Magic trap" PROM instructions at 0x9fc008xx:  */
199            for (i=0; i<0x100; i+=4)
200                    store_32bit_word(cpu, (int64_t)(int32_t)0x9fc00800 + i,
201                        0x00c0de0c);
202  }  }
203    
204    
# Line 175  MACHINE_DEFAULT_CPU(evbmips) Line 209  MACHINE_DEFAULT_CPU(evbmips)
209          case MACHINE_EVBMIPS_MALTA_BE:          case MACHINE_EVBMIPS_MALTA_BE:
210                  machine->cpu_name = strdup("5Kc");                  machine->cpu_name = strdup("5Kc");
211                  break;                  break;
212            case MACHINE_EVBMIPS_MESHCUBE:
213                    machine->cpu_name = strdup("AU1500");
214                    break;
215          case MACHINE_EVBMIPS_PB1000:          case MACHINE_EVBMIPS_PB1000:
216                  machine->cpu_name = strdup("AU1000");                  machine->cpu_name = strdup("AU1000");
217                  break;                  break;
# Line 186  MACHINE_DEFAULT_CPU(evbmips) Line 223  MACHINE_DEFAULT_CPU(evbmips)
223    
224  MACHINE_DEFAULT_RAM(evbmips)  MACHINE_DEFAULT_RAM(evbmips)
225  {  {
226            /*  MeshCube is always (?) 64 MB, and the others work fine
227                with 64 MB too.  */
228          machine->physical_ram_in_mb = 64;          machine->physical_ram_in_mb = 64;
229  }  }
230    
231    
232  MACHINE_REGISTER(evbmips)  MACHINE_REGISTER(evbmips)
233  {  {
234          MR_DEFAULT(evbmips, "MIPS evaluation boards (evbmips)", ARCH_MIPS,          MR_DEFAULT(evbmips, "MIPS evaluation boards (evbmips)",
235              MACHINE_EVBMIPS, 1, 3);              ARCH_MIPS, MACHINE_EVBMIPS);
236          me->aliases[0] = "evbmips";  
237          me->subtype[0] = machine_entry_subtype_new("Malta",          machine_entry_add_alias(me, "evbmips");
238              MACHINE_EVBMIPS_MALTA, 1);  
239          me->subtype[0]->aliases[0] = "malta";          machine_entry_add_subtype(me, "Malta", MACHINE_EVBMIPS_MALTA,
240          me->subtype[1] = machine_entry_subtype_new("Malta (Big-Endian)",              "malta", NULL);
241              MACHINE_EVBMIPS_MALTA_BE, 1);  
242          me->subtype[1]->aliases[0] = "maltabe";          machine_entry_add_subtype(me, "Malta (Big-Endian)",
243          me->subtype[2] = machine_entry_subtype_new("PB1000",              MACHINE_EVBMIPS_MALTA_BE, "maltabe", NULL);
244              MACHINE_EVBMIPS_PB1000, 1);  
245          me->subtype[2]->aliases[0] = "pb1000";          machine_entry_add_subtype(me, "MeshCube", MACHINE_EVBMIPS_MESHCUBE,
246          machine_entry_add(me, ARCH_MIPS);              "meshcube", NULL);
247    
248            machine_entry_add_subtype(me, "PB1000", MACHINE_EVBMIPS_PB1000,
249                "pb1000", NULL);
250    
251          me->set_default_ram = machine_default_ram_evbmips;          me->set_default_ram = machine_default_ram_evbmips;
         machine_entry_add(me, ARCH_ARM);  
252  }  }
253    

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

  ViewVC Help
Powered by ViewVC 1.1.26