From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tolunay Orkun Date: Wed, 06 Dec 2006 10:57:10 -0600 Subject: [U-Boot-Users] [PATCH] use CFI-Flash and board depended driver together In-Reply-To: <8496f91a0612051454h2da226c6w5f0f438a6f0a25c8@mail.gmail.com> References: <3DBBCC5C2604704D9351456CFE118AC105923F95@msilexch01.marvell.com> <8496f91a0612051454h2da226c6w5f0f438a6f0a25c8@mail.gmail.com> Message-ID: <4576F666.6030405@orkun.us> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Matvejchikov Ilya wrote: > Hi all, > > While I try to examine cfi_flash.c file I have found that > flash_detect_cfi() function used uninitialized value of > info->cmd_reset: > > flash_get_size() > { > .... > if (flash_detect_cfi(info)) { > .... > switch (info->vendor) { > .... > info->cmd_reset = x_CMD_RESET; > .... > } > } > } > > flash_detect_cfi(info) > { > .... > flash_write_cmd (info, 0, 0, info->cmd_reset); > .... > } > > Am I right? Or may be - 'Is it true?' :) Good obvervation... It is true but mostly harmless (if the garbage in cmd_reset does not happen to be a valid command). The reset command is issued if the attempt to put flash in CFI mode has failed. The line could be removed and it would still work. When I designed my last patch flash_read_jedec_ids(), I've specifically avoided the info->cmd_reset for this reason. Actually, AMD_CMD_RESET should be applicable to most Intel parts as well per CFI spec documents. I think the Linux MTD driver choose to send the Intel sequence followed by AMD sequence back to back during the probe. BTW, Were you able to read my proposals to extend the CFI flash driver to handle non-cfi chips. I've only received one comment so far. I am waiting to get more comments before I go ahead with coding effort.... Best regards, Tolunay