This is the mail archive of the ecos-patches@sourceware.org mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Patch AMD Flash Driver Problem with CYGNUM_FLASH_16AS8


Attached is a patch that accomplishes this.

Jay

-----Original Message-----
From: Jay Foster [mailto:jay@systech.com]
Sent: Wednesday, December 07, 2005 2:38 PM
To: ecos-discuss@ecos.sourceware.org
Subject: RE: [ECOS] AMD Flash Driver Problem with CYGNUM_FLASH_16AS8


I'm putting forward the following solution for comment.

Add a new member to the flash_dev_info_t structure to indicate
which address set to use.  There are currently two such address
sets defined (CYNUM_FLASH_16AS8=0 and CYGNUM_FLASH_16AS8=1).

The default value will be 0, so only those flash definitions in
the flash_am29xxxxx_parts.inl file that need the CYGNUM_FLASH_16AS8=1
will get an added parameter.  The following flash devices
would use address set 1:

	CYGHWR_DEVS_FLASH_AMD_AM29LV160		(CYGNUM_FLASH_WIDTH==8)
	CYGHWR_DEVS_FLASH_AMD_AM29DL324D	(CYGNUM_FLASH_WIDTH==8)
	CYGHWR_DEVS_FLASH_AMD_AM29LV320D	(CYGNUM_FLASH_WIDTH==8)
	CYGHWR_DEVS_FLASH_AMD_AM29F800		(CYGNUM_FLASH_WIDTH==8)
	CYGHWR_DEVS_FLASH_AMD_AM29LV800		(CYGNUM_FLASH_WIDTH==8)

Add an array of address sets to the flash_am29xxxxx.inl file to define
the two defined address sets:

	set 0:
		FLASH_Setup_Addr1              (0x555)
		FLASH_Setup_Addr2              (0x2AA)
		FLASH_VendorID_Addr            (0)
		FLASH_DeviceID_Addr            (1)
		FLASH_DeviceID_Addr2           (0x0e)
		FLASH_DeviceID_Addr3           (0x0f)
		FLASH_WP_Addr                  (2)

	set 1:
		FLASH_Setup_Addr1              (0xAAA)
		FLASH_Setup_Addr2              (0x555)
		FLASH_VendorID_Addr            (0)
		FLASH_DeviceID_Addr            (2)
		FLASH_DeviceID_Addr2           (0x1c)
		FLASH_DeviceID_Addr3           (0x1e)
		FLASH_WP_Addr                  (4)


The flash_query() function will need to be modified.  The following
algorithm is suggested:

	For each address set (ASET=0,1)
		if any of the configured flash devices use address set ASET
			Read the flash data values for each of the ID
addresses.
			Enter auto-select mode
			Read the flash ID values
			Reset flash data mode
			If the flash ID values != flash data values
				success, done

flash_query() can be written so that if CYGNUM_FLASH_16AS8 is defined,
then it will only use the indicated address set (ASET=CYGNUM_FLASH_16AS8),
instead of trying each address set.  This can provide a way for the address
set
value defined in the flash_am29xxxxx_parts.inl file to be overridden,
and can provide some backwards compatibility protection if I get one
of the definitions wrong.

Or CYNUM_FLASH_16AS8 can just be deprecated.

Jay

-----Original Message-----
From: Jay Foster [mailto:jay@systech.com]
Sent: Tuesday, December 06, 2005 2:11 PM
To: ecos-discuss@ecos.sourceware.org
Cc: Jay Foster
Subject: [ECOS] AMD Flash Driver Problem with CYGNUM_FLASH_16AS8


I have several targets using the AMD flash driver with the following devices
enabled:

	AM29LV081B, AM29LV017D, and AM29LV033C (S29AL032D).

I want to add the AMD AM29LV160 (S29AL0160D) part, but ran into the
following problem.

Each of these flash devices is used in the 8-bit mode.  For the existing
parts, CYGNUM_FLASH_16AS8 needs to be defined as 0 (or left undefined).  For
the new part, CYGNUM_FLASH_16AS8 needs to be defined as 1.  Obviously,
CYGNUM_FLASH_16AS8 cannot be defined as two different values at the same
time.

It seems that this should also be parameterized in the flash parts table
entries, so that these parts can be supported simultaneously.  Has anyone
else encountered this problem?

Jay


-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

Attachment: flash.pat
Description: Binary data


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]