--- zzzz-none-000/linux-2.6.19.2/drivers/mtd/chips/cfi_probe.c 2007-01-10 19:10:37.000000000 +0000 +++ davinci-8020-5505/linux-2.6.19.2/drivers/mtd/chips/cfi_probe.c 2008-04-09 08:39:10.000000000 +0000 @@ -19,7 +19,7 @@ #include #include -//#define DEBUG_CFI +/*--- #define DEBUG_CFI ---*/ #ifdef DEBUG_CFI static void print_cfi_ident(struct cfi_ident *); @@ -45,16 +45,20 @@ #define xip_enable(base, map, cfi) \ do { \ - cfi_send_gen_cmd(0xF0, 0, base, map, cfi, cfi->device_type, NULL); \ +#ifdef CONFIG_MTD_CFI_INTELEXT cfi_send_gen_cmd(0xFF, 0, base, map, cfi, cfi->device_type, NULL); \ +#endif + cfi_send_gen_cmd(0xF0, 0, base, map, cfi, cfi->device_type, NULL); \ xip_allowed(base, map); \ } while (0) #define xip_disable_qry(base, map, cfi) \ do { \ xip_disable(); \ - cfi_send_gen_cmd(0xF0, 0, base, map, cfi, cfi->device_type, NULL); \ +#ifdef CONFIG_MTD_CFI_INTELEXT cfi_send_gen_cmd(0xFF, 0, base, map, cfi, cfi->device_type, NULL); \ +#endif + cfi_send_gen_cmd(0xF0, 0, base, map, cfi, cfi->device_type, NULL); \ cfi_send_gen_cmd(0x98, 0x55, base, map, cfi, cfi->device_type, NULL); \ } while (0) @@ -117,8 +121,10 @@ } xip_disable(); +#ifdef CONFIG_MTD_CFI_INTELEXT + cfi_send_gen_cmd(0xFF, 0, base, map, cfi, cfi->device_type, NULL); /*--- ST-Flash don`t like this ---*/ +#endif cfi_send_gen_cmd(0xF0, 0, base, map, cfi, cfi->device_type, NULL); - cfi_send_gen_cmd(0xFF, 0, base, map, cfi, cfi->device_type, NULL); cfi_send_gen_cmd(0x98, 0x55, base, map, cfi, cfi->device_type, NULL); if (!qry_present(map,base,cfi)) { @@ -145,8 +151,10 @@ if (qry_present(map, start, cfi)) { /* Eep. This chip also had the QRY marker. * Is it an alias for the new one? */ - cfi_send_gen_cmd(0xF0, 0, start, map, cfi, cfi->device_type, NULL); +#ifdef CONFIG_MTD_CFI_INTELEXT cfi_send_gen_cmd(0xFF, 0, start, map, cfi, cfi->device_type, NULL); +#endif + cfi_send_gen_cmd(0xF0, 0, start, map, cfi, cfi->device_type, NULL); /* If the QRY marker goes away, it's an alias */ if (!qry_present(map, start, cfi)) { @@ -159,8 +167,10 @@ * unfortunate. Stick the new chip in read mode * too and if it's the same, assume it's an alias. */ /* FIXME: Use other modes to do a proper check */ - cfi_send_gen_cmd(0xF0, 0, base, map, cfi, cfi->device_type, NULL); +#ifdef CONFIG_MTD_CFI_INTELEXT cfi_send_gen_cmd(0xFF, 0, start, map, cfi, cfi->device_type, NULL); +#endif + cfi_send_gen_cmd(0xF0, 0, base, map, cfi, cfi->device_type, NULL); if (qry_present(map, base, cfi)) { xip_allowed(base, map); @@ -177,8 +187,10 @@ cfi->numchips++; /* Put it back into Read Mode */ - cfi_send_gen_cmd(0xF0, 0, base, map, cfi, cfi->device_type, NULL); +#ifdef CONFIG_MTD_CFI_INTELEXT cfi_send_gen_cmd(0xFF, 0, base, map, cfi, cfi->device_type, NULL); +#endif + cfi_send_gen_cmd(0xF0, 0, base, map, cfi, cfi->device_type, NULL); xip_allowed(base, map); printk(KERN_INFO "%s: Found %d x%d devices at 0x%x in %d-bit bank\n", @@ -233,9 +245,11 @@ cfi->id = cfi_read_query16(map, base + ofs_factor); /* Put it back into Read Mode */ - cfi_send_gen_cmd(0xF0, 0, base, map, cfi, cfi->device_type, NULL); /* ... even if it's an Intel chip */ +#ifdef CONFIG_MTD_CFI_INTELEXT cfi_send_gen_cmd(0xFF, 0, base, map, cfi, cfi->device_type, NULL); +#endif + cfi_send_gen_cmd(0xF0, 0, base, map, cfi, cfi->device_type, NULL); xip_allowed(base, map); /* Do any necessary byteswapping */