[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: etrax100boot - cleanup + support for Amtel Flash (AT49BV1614T)

> a) Device id clash with incompatible device :-(

Yes, it's bad that we don't check both device and manufactorer id, but
e100boot has been heavily optimized (for size) and there are only a few
bytes left to play with. When you build it there's a message telling you
how many bytes there are left and if that goes below 300bytes you are in
big trouble because the stack will be more than 300bytes... the result
is just strange behaviour when flashing (it doesn't work of course).

> => use both manufacturer and device id to determine specific information
> [use the AT49BV1614AT if you have to choose!
>  Note the A - it is not only speed...]
> (note: FID macro might need to change to uniquely "hash" this values)

I'll see if there's room enough for this.

> b) it does not like 2AA and 555 as unlock addresses (it requires 2AAA and 
> 5555)
> => I changed this to AAAA and 5555 since unused highbits are ignored

I'm not sure it will work on all chips but it will be worth a try.
We have also tried chips that uses 2AAA and 5555 (really stupid that not
all chips can be put in CFI-mode using the same commands, but maybe AAAA
and 5555 works) but then we modified e100boot.

> c) it is not CFI compatible, and has strange layout (30 + 2 + 8)
> => Removed the special boot_sector handling, all is now sector_count & 
> sector_size
> d) while erasing you have to repeat the full command over and over...
> => implemented
> e) checking that erase for a sector is ready must be made on the same plane 
> (~= address) as you erased
> => implemented

I think that the flash part of e100boot will be rewritten sooner or
later (probably before the next release) and we'll consider your
solutions when doing that.

> unrelated bug(?):
> In CFI code ADDResses are shifted with offset_shift, but the Enter CFI mode 
> does not... bug or not? I do not know - If I only had a CFI device...
>  	/* Enter CFI mode */
> -	wide_cmd(flash, CMD_CFI_QUERY_DATA, ADDR_CFI_QUERY);
> +	wide_cmd(flash, CMD_CFI_QUERY_DATA, ADDR_CFI_QUERY << offset_shift);

That's because it's a command-write (there are other command-writes and
none of them uses offset_shift).

> cleanup:
> f) fixed some Warnings too...
> Result:
> - We can erase and flash our device => it boots! :-)
> - Probably this saves some bytes too :-)
>   Previously we allocated 8*sizeof(int) for the table + some other variables,
>   now I allocate 4*(1 + sizeof(int))
> - Erasing other (modern) devices will probably slow down since it can not
>   erase several sectors at once, but this can be handled too (in just a few
>   lines of code)
> I include a not working (write fails) version for patch of Linux kernels 
> amd_flash.c too..

I think the amd_flash driver will be replaced by the jedec_probe + the
CFI driver soon (and the 2AA vs 2AAA issue has been taken care of).

> Enjoy!

Thanks for you patches. We'll probably include some of them in future

Best regards