Add PowerPC power-management state check callback.
[qemu] / hw / spitz.c
index 171dba2..aca244e 100644 (file)
@@ -78,6 +78,18 @@ static uint32_t sl_readb(void *opaque, target_phys_addr_t addr)
     return 0;
 }
 
+static uint32_t sl_readl(void *opaque, target_phys_addr_t addr)
+{
+    struct sl_nand_s *s = (struct sl_nand_s *) opaque;
+    addr -= s->target_base;
+
+    if (addr == FLASH_FLASHIO)
+        return ecc_digest(&s->ecc, nand_getio(s->nand)) |
+                (ecc_digest(&s->ecc, nand_getio(s->nand)) << 16);
+
+    return sl_readb(opaque, addr);
+}
+
 static void sl_writeb(void *opaque, target_phys_addr_t addr,
                 uint32_t value)
 {
@@ -139,7 +151,7 @@ static void sl_flash_register(struct pxa2xx_state_s *cpu, int size)
     CPUReadMemoryFunc *sl_readfn[] = {
         sl_readb,
         sl_readb,
-        sl_readb,
+        sl_readl,
     };
     CPUWriteMemoryFunc *sl_writefn[] = {
         sl_writeb,
@@ -182,8 +194,8 @@ static int spitz_keymap[SPITZ_KEY_SENSE_NUM + 1][SPITZ_KEY_STROBE_NUM] = {
     { 0x0f, 0x10, 0x12, 0x14, 0x22, 0x16, 0x24, 0x25,  -1 ,  -1 ,  -1  },
     { 0x3c, 0x11, 0x1f, 0x21, 0x2f, 0x23, 0x32, 0x26,  -1 , 0x36,  -1  },
     { 0x3b, 0x1e, 0x20, 0x2e, 0x30, 0x31, 0x34,  -1 , 0x1c, 0x2a,  -1  },
-    { 0x44, 0x2c, 0x2d, 0x0c, 0x39, 0x33,  -1 , 0x48,  -1 ,  -1 , 0x3d },
-    { 0x37, 0x38,  -1 , 0x45, 0x57, 0x58, 0x4b, 0x50, 0x4d,  -1 ,  -1  },
+    { 0x44, 0x2c, 0x2d, 0x0c, 0x39, 0x33,  -1 , 0x48,  -1 ,  -1 , 0x38 },
+    { 0x37, 0x3d,  -1 , 0x45, 0x57, 0x58, 0x4b, 0x50, 0x4d,  -1 ,  -1  },
     { 0x52, 0x43, 0x01, 0x47, 0x49,  -1 ,  -1 ,  -1 ,  -1 ,  -1 ,  -1  },
 };
 
@@ -403,13 +415,17 @@ static void spitz_keyboard_pre_map(struct spitz_keyboard_s *s)
     s->pre_map[0x0d | SHIFT    ] = 0x13 | FN;          /* plus */
     s->pre_map[0x1a            ] = 0x14 | FN;          /* bracketleft */
     s->pre_map[0x1b            ] = 0x15 | FN;          /* bracketright */
+    s->pre_map[0x1a | SHIFT    ] = 0x16 | FN;          /* braceleft */
+    s->pre_map[0x1b | SHIFT    ] = 0x17 | FN;          /* braceright */
     s->pre_map[0x27            ] = 0x22 | FN;          /* semicolon */
     s->pre_map[0x27 | SHIFT    ] = 0x23 | FN;          /* colon */
     s->pre_map[0x09 | SHIFT    ] = 0x24 | FN;          /* asterisk */
     s->pre_map[0x2b            ] = 0x25 | FN;          /* backslash */
     s->pre_map[0x2b | SHIFT    ] = 0x26 | FN;          /* bar */
     s->pre_map[0x0c | SHIFT    ] = 0x30 | FN;          /* underscore */
+    s->pre_map[0x33 | SHIFT    ] = 0x33 | FN;          /* less */
     s->pre_map[0x35            ] = 0x33 | SHIFT;       /* slash */
+    s->pre_map[0x34 | SHIFT    ] = 0x34 | FN;          /* greater */
     s->pre_map[0x35 | SHIFT    ] = 0x34 | SHIFT;       /* question */
     s->pre_map[0x49            ] = 0x48 | FN;          /* Page_Up */
     s->pre_map[0x51            ] = 0x50 | FN;          /* Page_Down */
@@ -705,7 +721,7 @@ static struct scoop_info_s *spitz_scoop_init(struct pxa2xx_state_s *cpu,
 
     iomemtype = cpu_register_io_memory(0, scoop_readfn,
                     scoop_writefn, &s[0]);
-    cpu_register_physical_memory(s[0].target_base, 0xfff, iomemtype);
+    cpu_register_physical_memory(s[0].target_base, 0x1000, iomemtype);
     register_savevm("scoop", 0, 0, scoop_save, scoop_load, &s[0]);
 
     if (count < 2)
@@ -713,7 +729,7 @@ static struct scoop_info_s *spitz_scoop_init(struct pxa2xx_state_s *cpu,
 
     iomemtype = cpu_register_io_memory(0, scoop_readfn,
                     scoop_writefn, &s[1]);
-    cpu_register_physical_memory(s[1].target_base, 0xfff, iomemtype);
+    cpu_register_physical_memory(s[1].target_base, 0x1000, iomemtype);
     register_savevm("scoop", 1, 0, scoop_save, scoop_load, &s[1]);
 
     return s;
@@ -912,15 +928,15 @@ static void spitz_microdrive_attach(struct pxa2xx_state_s *cpu)
 
     if (bs && bdrv_is_inserted(bs) && !bdrv_is_removable(bs)) {
         md = dscm1xxxx_init(bs);
-        pxa2xx_pcmcia_attach(cpu->pcmcia[0], md);
+        pxa2xx_pcmcia_attach(cpu->pcmcia[1], md);
     }
 }
 
 /* Wm8750 and Max7310 on I2C */
 
 #define AKITA_MAX_ADDR 0x18
-#define SPITZ_WM_ADDRL 0x1a
-#define SPITZ_WM_ADDRH 0x1b
+#define SPITZ_WM_ADDRL 0x1b
+#define SPITZ_WM_ADDRH 0x1a
 
 #define SPITZ_GPIO_WM  5
 
@@ -1198,10 +1214,10 @@ static void spitz_common_init(int ram_size, int vga_ram_size,
         spitz_akita_i2c_setup(cpu);
 
     if (model == terrier)
-        /* A 6.0 GB microdrive is permanently sitting in CF slot 0.  */
+        /* A 6.0 GB microdrive is permanently sitting in CF slot 1.  */
         spitz_microdrive_attach(cpu);
     else if (model != akita)
-        /* A 4.0 GB microdrive is permanently sitting in CF slot 0.  */
+        /* A 4.0 GB microdrive is permanently sitting in CF slot 1.  */
         spitz_microdrive_attach(cpu);
 
     /* Setup initial (reset) machine state */