diff options
author | Becky Bruce <beckyb@kernel.crashing.org> | 2009-02-02 16:34:51 -0600 |
---|---|---|
committer | Stefan Roese <sr@denx.de> | 2009-02-05 11:20:05 +0100 |
commit | 09ce9921a7d8b1ce764656b14b42217bbf4faa38 (patch) | |
tree | c8d83aa2012342e0a790a046bc6a8fa3bba2c5a5 /include | |
parent | 9d8811c5bd2b7dd6307742cf22fbdb7953b6f816 (diff) | |
download | u-boot-imx-09ce9921a7d8b1ce764656b14b42217bbf4faa38.zip u-boot-imx-09ce9921a7d8b1ce764656b14b42217bbf4faa38.tar.gz u-boot-imx-09ce9921a7d8b1ce764656b14b42217bbf4faa38.tar.bz2 |
flash/cfi_flash: Use virtual sector start address, not phys
include/flash.h was commented to say that the address in
flash_info->start was a physical address. However, from u-boot's
point of view, and looking at most flash code, it makes more
sense for this to be a virtual address. So I corrected the
comment to indicate that this was a virtual address.
The only flash driver that was actually treating the address
as physical was the mtd/cfi_flash driver. However, this code
was using it inconsistently as it actually directly dereferenced
the "start" element, while it used map_physmem to get a
virtual address in other places. I changed this driver so
that the code which initializes the info->start field calls
map_physmem to get a virtual address, eliminating the need for
further map_physmem calls. The code is now consistent.
The *only* place a physical address should be used is when defining the
flash banks list that is used to initialize the flash_info struct,
usually found in the board config file.
Signed-off-by: Becky Bruce <beckyb@kernel.crashing.org>
Signed-off-by: Stefan Roese <sr@denx.de>
Diffstat (limited to 'include')
-rw-r--r-- | include/flash.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/include/flash.h b/include/flash.h index 6e2981c..02c6a04 100644 --- a/include/flash.h +++ b/include/flash.h @@ -33,7 +33,7 @@ typedef struct { ulong size; /* total bank size in bytes */ ushort sector_count; /* number of erase units */ ulong flash_id; /* combined device & manufacturer code */ - ulong start[CONFIG_SYS_MAX_FLASH_SECT]; /* physical sector start addresses */ + ulong start[CONFIG_SYS_MAX_FLASH_SECT]; /* virtual sector start address */ uchar protect[CONFIG_SYS_MAX_FLASH_SECT]; /* sector protection status */ #ifdef CONFIG_SYS_FLASH_CFI uchar portwidth; /* the width of the port */ |