From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stefan Roese Date: Wed, 21 Feb 2007 21:07:59 +0100 Subject: [U-Boot-Users] [PATCH] Fix relocation problem with "new" get_dev() function In-Reply-To: <528646bc0702210901t5d72be93t893a6954250fbbde@mail.gmail.com> References: <200702201331.23496.sr@denx.de> <528646bc0702210901t5d72be93t893a6954250fbbde@mail.gmail.com> Message-ID: <200702212107.59792.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 21 February 2007 18:01, Grant Likely wrote: > On 2/20/07, Stefan Roese wrote: > > This patch enables the "new" get_dev() function for block devices > > introduced by Grant Likely to be used on systems that still suffer > > from the relocation problems (manual relocation neede because of > > problems with linker script). > > > > Hopefully we can resolve this relocation issue soon for all platform > > so we don't need this additional code anymore. > > > > Signed-off-by: Stefan Roese > > > > --- > > +#ifndef CFG_FIXUP_RELOCATION > > + block_dev_desc_t* (*reloc_get_dev)(int dev); > > + > > + reloc_get_dev = drvr->get_dev + gd->reloc_off; > > + if (strncmp(ifname, drvr->name, strlen(drvr->name)) == 0) > > + return reloc_get_dev(dev); > > +#else > > if (strncmp(ifname, drvr->name, strlen(drvr->name)) == 0) > > return drvr->get_dev(dev); > > +#endif > > The changes look good, but I would drop the CFG_FIXUP_RELOCATION > macros for now. Just fix it up unconditionally and let the patch that > actually fixes relocation add them back in. Yes, that does make more sense for now. I'll update my version. > I know it doesn't hurt anything to have them in now; but I think the > current relocation patch takes the wrong approach. That patch assumes > that relocation is busted unless the board config says it isn't. > Since this is something that we want to fix correctly; I think it is > better to add a '#define CONFIG_RELOCATION_BROKEN' to all board > configs files now; and steadly remove them as different ports are > fixed. > > At first glance this looks like a bad idea because it means every > board config file must be touched; but every config file needs to be > touched regardless. Either: > a) touch every config file now (by adding the "IT'S BROKEN" define; or > b) touch every config file later (by removing the "IT'S FIXED" define > when all board ports are working and the hooks are no longer needed). > > Thoughts? I like this approach, since it seems to be the "right way" to fix this problem. Any other ideas on this? Please speak up, since it's quite a big change. Best regards, Stefan ===================================================================== DENX Software Engineering GmbH, HRB 165235 Munich, CEO: Wolfgang Denk Office: Kirchenstr. 5, D-82194 Groebenzell, Germany =====================================================================