Hi Dmitry,

I was checking another patch regarding GD SPI NOR
http://openocd.zylin.com/#/c/3029/1
and I noticed something strange in your patch already merged.

On Tue, Feb 24, 2015 at 10:49 PM, OpenOCD-Gerrit
<[email protected]> wrote:
> This is an automated email from the git hooks/post-receive script. It was
> generated because a ref change was pushed to the repository containing
> the project "Main OpenOCD repository".
>
> The branch, master has been updated
>        via  73867c260ab39a8208232499d2f960021612e116 (commit)
>       from  40d6e8826872906651fabffc9a6463e7e074fc8c (commit)
>
> Those revisions listed above that are new to this repository have
> not appeared on any other notification email; so we list those
> revisions in full, below.
>
> - Log -----------------------------------------------------------------
> commit 73867c260ab39a8208232499d2f960021612e116
> Author: dmitry pervushin <[email protected]>
> Date:   Wed Feb 4 11:26:14 2015 +0100
>
>     flash/nor/spi: add GigaDevice SPI flash
>
>     Signed-off-by: dmitry pervushin <[email protected]>
>     Change-Id: I5a239dc67754ef4be1d9ec36186f434b09aa1e25
>     Reviewed-on: http://openocd.zylin.com/2530
>     Tested-by: jenkins
>     Reviewed-by: Paul Fertser <[email protected]>
>
> diff --git a/src/flash/nor/spi.c b/src/flash/nor/spi.c
> index 32c00b8..5bb322c 100644
> --- a/src/flash/nor/spi.c
> +++ b/src/flash/nor/spi.c
> @@ -74,5 +74,6 @@ const struct flash_device flash_devices[] = {
>         FLASH_ID("win w25q32fv",   0xd8, 0xc7, 0x001640ef, 0x100, 0x10000, 
> 0x400000),
>         FLASH_ID("win w25q32dw",   0xd8, 0xc7, 0x001660ef, 0x100, 0x10000, 
> 0x400000),
>         FLASH_ID("win w25q64cv",   0xd8, 0xc7, 0x001740ef, 0x100, 0x10000, 
> 0x800000),
> +       FLASH_ID("gd gd25q20",     0x20, 0xc7, 0x00c84012, 0x100, 0x1000, 
> 0x80000),

1) You use command 0x20, that is sector erase (4K), instead of 0xd8
for 64K block erase.
Following size of erase is 0x1000 aligned with the command you choose.
I do not have the device to run further check; I believe you have
tested it and it works properly. Maybe the choice makes sense due to
small size of the device.

2) the ID has the bytes reversed. It should be 0x001240c8. Compare it
with the new patch #3029 and with the other devices in the table. The
least significant byte is the Vendor ID, 0xc8 for GD.
Are you sure it works with your CPU? Which CPU are you using?
Maybe the driver for your CPU reverts the bytes, but in this case the
driver is inconsistent with the framework and it would require a fix.

3) the flash size is 256k, so the value 0x80000 is incorrect; should be 0x40000.
GD provides a single datasheet for two devices, 256k and 512k. Maybe
this cause the error while copying values.

Regards,
Antonio

>         FLASH_ID(NULL,             0,    0,        0,          0,     0,      
>  0)
>  };
>
> -----------------------------------------------------------------------
>
> Summary of changes:
>  src/flash/nor/spi.c |    1 +
>  1 files changed, 1 insertions(+), 0 deletions(-)
>
>
> hooks/post-receive

------------------------------------------------------------------------------
_______________________________________________
OpenOCD-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openocd-devel

Reply via email to