[U-Boot-Users] Re: [PPCBoot-users] Re: about flash_port_width
Kyle Harris
kharris at nexus-tech.net
Tue Mar 4 14:38:19 CET 2003
On Sunday 02 March 2003 08:01 pm, okisoftxman wrote:
>> But I find a another example for 28F640J3A chips
> "/board/nx823/flash.c",I think there is one flash chips .Something like
> this:
> #define FLASH_PORT_WIDTH ulong
> #define FLASH_PORT_WIDTHV vu_long
> #define FPW FLASH_PORT_WIDTH
> #define FPWV FLASH_PORT_WIDTHV
>
> " case (FPW)INTEL_ID_28F640J3A:
> info->flash_id += FLASH_28F640J3A;
> info->sector_count = 64;
> info->size = 0x00800000;
> break; /* => 8 MB */ "
>
> static int write_data (flash_info_t *info, ulong dest, FPW data)
> {
> ..............................................
> *addr = (FPW)0x00400040; /* write setup */
> *addr = data;
> ...............................................
> return (0);
> }
>
> Since there is one chip,I think it must perform 16bit data operations.But
> the variable "data" type is ulong(I think it is 32bits),it seems that it
> still performs 32bit operation.Why???
>
You are not correct. FPW is defined to be a short. Please include all of the
relevent code when you reference it, not just bits and pieces. See below.
/* Board support for 1 or 2 flash devices */
#undef FLASH_PORT_WIDTH32
#define FLASH_PORT_WIDTH16
#ifdef FLASH_PORT_WIDTH16
#define FLASH_PORT_WIDTH ushort
#define FLASH_PORT_WIDTHV vu_short
#else
#define FLASH_PORT_WIDTH ulong
#define FLASH_PORT_WIDTHV vu_long
#endif
#define FPW FLASH_PORT_WIDTH
#define FPWV FLASH_PORT_WIDTHV
More information about the U-Boot
mailing list