From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stefan Roese Date: Wed, 14 Jan 2009 13:12:32 +0100 Subject: [U-Boot] [PATCH 07/11] flash/cfi_flash: Use virtual sector start address, not phys In-Reply-To: <1F69C652-1D8B-4C67-B1FA-155E3E06C87A@kernel.crashing.org> References: <1228367087-27268-1-git-send-email-beckyb@kernel.crashing.org> <1228367087-27268-8-git-send-email-beckyb@kernel.crashing.org> <1F69C652-1D8B-4C67-B1FA-155E3E06C87A@kernel.crashing.org> Message-ID: <200901141312.33030.sr@denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Wednesday 14 January 2009, Kumar Gala wrote: > On Dec 3, 2008, at 11:04 PM, Becky Bruce wrote: > > 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. I > > have fixed the one platform that was impacted by this change > > (MPC8641D). > > > > Signed-off-by: Becky Bruce > > --- > > drivers/mtd/cfi_flash.c | 53 +++++++++++++++++ > > +---------------------- > > include/configs/MPC8641HPCN.h | 2 +- > > include/flash.h | 2 +- > > 3 files changed, 26 insertions(+), 31 deletions(-) > > Stefan, > > Have you reviewed this. No, I must have forgotten about it. Thanks for reminding me. I'll have a closer look at it hopefully by tomorrow. BTW: This patch needs to be split up in the CFI part and the MPC8641HPCN part. Best regards, Stefan ===================================================================== DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: +49-8142-66989-0 Fax: +49-8142-66989-80 Email: office at denx.de =====================================================================