Index: /trunk/src/host/qemu-neo1973/hw/neo1973.c
===================================================================
--- /trunk/src/host/qemu-neo1973/hw/neo1973.c	(revision 3624)
+++ /trunk/src/host/qemu-neo1973/hw/neo1973.c	(revision 3625)
@@ -88,4 +88,5 @@
     const char *kernel;
     struct sd_card_s *mmc;
+    uint32_t id;
 };
 
@@ -432,5 +433,5 @@
 static struct neo_board_s *neo1973_init_common(int ram_size, DisplayState *ds,
                 const char *kernel_filename, const char *cpu_model,
-                struct sd_card_s *mmc)
+                struct sd_card_s *mmc, uint32_t id)
 {
     struct neo_board_s *s = (struct neo_board_s *)
@@ -440,4 +441,5 @@
     s->kernel = kernel_filename;
     s->mmc = mmc;
+    s->id = id;
 
     /* Setup CPU & memory */
@@ -484,4 +486,32 @@
 }
 
+static uint32_t neo_machid_read(void *opaque, target_phys_addr_t addr)
+{
+    return 'Q';
+}
+
+static void neo_machid_write(void *opaque,
+                target_phys_addr_t addr, uint32_t val)
+{
+    struct neo_board_s *s = (struct neo_board_s *) opaque;
+
+    if ((val >> 4) == 'Q')
+        s->cpu->env->regs[val & 0xf] = s->id;
+}
+
+static void neo_machid_init(struct neo_board_s *s)
+{
+    static CPUReadMemoryFunc *readfn[] = {
+        neo_machid_read, neo_machid_read, neo_machid_read,
+    };
+    static CPUWriteMemoryFunc *writefn[] = {
+        neo_machid_write, neo_machid_write, neo_machid_write,
+    };
+    int iomemtype = cpu_register_io_memory(0, readfn, writefn, s);
+
+    /* SROM chipselect 5 base */
+    cpu_register_physical_memory(0x28000000, 1, iomemtype);
+}
+
 static void gta01_init(int ram_size, int vga_ram_size,
                 const char *boot_device, DisplayState *ds,
@@ -495,5 +525,6 @@
         sd = sd_init(drives_table[sd_idx].bdrv, 0);
 
-    neo1973_init_common(ram_size, ds, kernel_filename, cpu_model, sd);
+    neo1973_init_common(ram_size, ds,
+                    kernel_filename, cpu_model, sd, 1304);
 }
 
@@ -505,7 +536,9 @@
     struct neo_board_s *neo;
 
-    neo = neo1973_init_common(ram_size, ds, kernel_filename, cpu_model, 0);
+    neo = neo1973_init_common(ram_size, ds,
+                    kernel_filename, cpu_model, 0, 1555);
 
     neo_gps_setup(neo);
+    neo_machid_init(neo);
 }
 
