fix OneNAND erase/write
[qemu] / hw / nseries.c
index 6dc457d..24f9e27 100644 (file)
@@ -164,12 +164,12 @@ static void n8x0_nand_setup(struct n800_s *s)
 {
     char *otp_region;
 
-    /* Either ec40xx or ec48xx are OK for the ID */
+    /* Either 0x40 or 0x48 are OK for the device ID */
+    s->nand = onenand_init(NAND_MFR_SAMSUNG, 0x48, 0, 1,
+                           omap2_gpio_in_get(s->cpu->gpif,N8X0_ONENAND_GPIO)[0],
+                           drives_table[drive_get_index(IF_MTD, 0, 0)].bdrv);
     omap_gpmc_attach(s->cpu->gpmc, N8X0_ONENAND_CS, 0, onenand_base_update,
-                    onenand_base_unmap,
-                    (s->nand = onenand_init(0xec4800, 1,
-                                            omap2_gpio_in_get(s->cpu->gpif,
-                                                    N8X0_ONENAND_GPIO)[0])),0);
+                     onenand_base_unmap, s->nand, 0);
     otp_region = onenand_raw_otp(s->nand);
 
     memcpy(otp_region + 0x000, n8x0_cal_wlan_mac, sizeof(n8x0_cal_wlan_mac));