[U-Boot] What is CONFIG_HAS_DATAFLASH?

Timur Tabi timur at freescale.com
Fri Mar 5 20:23:11 CET 2010


Wolfgang Denk wrote:
> Dear Timur Tabi,
> 
> In message <ed82fe3e1003050915r6e677102mb47a448293e62067 at mail.gmail.com> you wrote:
>> Can someone tell me what CONFIG_HAS_DATAFLASH does?
> 
> I know this sounds like an act of darin, but how about having a look
> at the README ?
> 
> [And I really wonder why you did not find the documentation there.]

	CONFIG_HAS_DATAFLASH

	Defining this option enables DataFlash features and
	allows to read/write in Dataflash via the standard
	commands cp, md...

This doesn't tell me anything.

>> The reason I ask is that I'm trying to use
>> CONFIG_CFI_FLASH_USE_WEAK_ACCESSORS, but I noticed that the "md"
> 
> Why would you want to do that? This is only needed in very special
> situations which involve a state of hardware that can be best
> described as broken.

You're right.  The board I need to support is broken, IMHO.  Fortunately, CONFIG_CFI_FLASH_USE_WEAK_ACCESSORS provides a reasonably elegant fix.

>> command does not use the flash_readX primitives when I ask it to
>> display memory from a flash address.  In examining do_mem_md(), I
>> noticed CONFIG_HAS_DATAFLASH.
> 
> Did you? I don't see any CONFIG_HAS_DATAFLASH anywhere in cmd_mem.c

int do_mem_md ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
{
	ulong	addr, length;
#if defined(CONFIG_HAS_DATAFLASH)
	ulong	nbytes, linebytes;
#endif

I'm not imagining things.


> And this is expected - the "md" command is, as the name suggests,
> intended for Memory Dumps. "Memory" is defined as something that can
> be read by just putting the address on the address bus and reading
> the corresponding data from the data bus, without need for any
> additional code or access protocols. On hardware where
> CONFIG_CFI_FLASH_USE_WEAK_ACCESSORS is needed, you cannot really
> apply the term "memory" to such a flash device - it is a storage
> device, but not more.

Fair enough, but I was hoping there'd be an easy way to get md to work.

-- 
Timur Tabi
Linux kernel developer at Freescale


More information about the U-Boot mailing list