[PATCH 1/2] mtd: Fix cfi_send_gen_cmd the handling of x16 devices in x8 mode

David Woodhouse dwmw2 at infradead.org
Sat Nov 1 06:43:02 EDT 2008


On Sat, 2008-11-01 at 03:29 -0700, Eric W. Biederman wrote:
> @@ -1808,9 +1808,7 @@ static inline u32 jedec_read_mfr(struct map_info *map, uint32_t base,
>          * several first banks can contain 0x7f instead of actual ID
>          */
>         do {
> -               uint32_t ofs = cfi_build_cmd_addr(0 + (bank << 8),
> -                                                 cfi_interleave(cfi),
> -                                                 cfi->device_type);
> +               uint32_t ofs = cfi_build_cmd_addr(0 + (bank << 8), map, cfi);
>                 mask = (1 << (cfi->device_type * 8)) - 1;
>                 result = map_read(map, base + ofs);
>                 bank++;

I think this one is still broken by your patch -- it's the exception to
your observation that we only ever use addresses ending in 00, 55 or aa.

> 
> +       /* Modify the unlock address if we are in compatiblity mode.
> +        * For 16bit devices on 8 bit busses
> +        * and 32bit devices on 16 bit busses
> +        * set the low bit of the alternating bit sequence of the address.
> +        */
> +       if (((type * interleave) > bankwidth) && (cmd_addr & 2))
> +               addr |= (type >> 1)*interleave;

Perhaps '&& ((cmd_addr & 0xff) == 0xaa)' is the answer?

-- 
David Woodhouse                            Open Source Technology Centre
David.Woodhouse at intel.com                              Intel Corporation




More information about the linux-mtd mailing list