[U-Boot-Users] [PATCH] M18 flash (Sibley) support (attempt 2)

Alexey Korolev
2007-09-28T15:47:24Z

Hi Wolfgang

>
> I'm a bit scared about your patch. Which tools do you use to create it?

Vasiliy used a "diff" tool.
> > @@ -184,8 +186,8 @@ flash_info_t flash_info[CFG_MAX_FLASH_BA
> > typedef unsigned long flash_sect_t;
> >
> > static void flash_add_byte (flash_info_t * info, cfiword_t * cword, uchar c);
> > -static void flash_make_cmd (flash_info_t * info, uchar cmd, void *cmdbuf);
> > -static void flash_write_cmd (flash_info_t * info, flash_sect_t sect, uint offset, uchar cmd);
> > +static void flash_make_cmd (flash_info_t * info, ulong cmd, void *cmdbuf);
> > +static void flash_write_cmd (flash_info_t * info, flash_sect_t sect, uint offset, ulong cmd);
> > static void flash_unlock_seq (flash_info_t * info, flash_sect_t sect);
> > static int flash_isequal (flash_info_t * info, flash_sect_t sect, uint offset, uchar cmd);
> > static int flash_isset (flash_info_t * info, flash_sect_t sect, uint offset, uchar cmd);
>
> I don't see any differences here. Why is this flagged as a change?
The difference is in type of "cmd" variable.
...
> This smells somewhat fishy. Do you have an explanation what's going on
> here?
Let me explain.
M18 flash is a flash with programming regions.
It writes data by pages using buffered write method. According to the
specification of buffered prog. for NOR chips. We should write CMD to
start data write, length of buffer in words, buffer, and write confirm
command.
Unlike other NOR chips M18 has large programming buffer. The buffer
size for M18 is 1024bytes i.e. 512 word.
In existing code we transfer commands and buffer length using
flash_write_cmd() and flash_make_cmd functions. The input type for cmd
variable is uchar in these functions. If we want to write more than
255 words we will have write error.
To avoid these issues we extended these two functions little bit to
deal with larger commands.

Kind regards,
Alexey