summaryrefslogtreecommitdiff
path: root/disk
diff options
context:
space:
mode:
authorStefan Roese <sr@denx.de>2007-02-20 13:21:57 +0100
committerStefan Roese <sr@denx.de>2007-02-20 13:21:57 +0100
commit751bb57107d78978ae08e697c3deba816f5be091 (patch)
tree07d9ef94782dadb04203d8f46dd08da5d08a2aa7 /disk
parentd93e2212f962668b3dce091ff5edc33f2347fe37 (diff)
downloadu-boot-751bb57107d78978ae08e697c3deba816f5be091.tar.gz
u-boot-751bb57107d78978ae08e697c3deba816f5be091.tar.bz2
u-boot-751bb57107d78978ae08e697c3deba816f5be091.zip
[PATCH] Fix relocation problem with "new" get_dev() function
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 <sr@denx.de>
Diffstat (limited to 'disk')
-rw-r--r--disk/part.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/disk/part.c b/disk/part.c
index f1026c5ef2..37bba77dd3 100644
--- a/disk/part.c
+++ b/disk/part.c
@@ -64,13 +64,25 @@ static const struct block_drvr block_drvr[] = {
{ },
};
+#ifndef CFG_FIXUP_RELOCATION
+DECLARE_GLOBAL_DATA_PTR;
+#endif
+
block_dev_desc_t *get_dev(char* ifname, int dev)
{
const struct block_drvr *drvr = block_drvr;
while (drvr->name) {
+#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
drvr++;
}
return NULL;