]> git.sur5r.net Git - u-boot/blobdiff - drivers/fpga/ACEX1K.c
fpga: Remove relocation fixups
[u-boot] / drivers / fpga / ACEX1K.c
index 3f7967782bb3ff0b5e7fac59d40793b2d68d4cfe..06b4247d87e729ad657b7293f9f9f9d245e06962 100644 (file)
@@ -51,7 +51,6 @@
 static int ACEX1K_ps_load( Altera_desc *desc, void *buf, size_t bsize );
 static int ACEX1K_ps_dump( Altera_desc *desc, void *buf, size_t bsize );
 /* static int ACEX1K_ps_info( Altera_desc *desc ); */
-static int ACEX1K_ps_reloc( Altera_desc *desc, ulong reloc_offset );
 
 /* ------------------------------------------------------------------------- */
 /* ACEX1K Generic Implementation */
@@ -101,31 +100,6 @@ int ACEX1K_info( Altera_desc *desc )
 }
 
 
-int ACEX1K_reloc (Altera_desc * desc, ulong reloc_offset)
-{
-       int ret_val = FPGA_FAIL;        /* assume a failure */
-
-       if (desc->family != Altera_ACEX1K) {
-               printf ("%s: Unsupported family type, %d\n",
-                               __FUNCTION__, desc->family);
-               return FPGA_FAIL;
-       } else
-               switch (desc->iface) {
-               case passive_serial:
-                       ret_val = ACEX1K_ps_reloc (desc, reloc_offset);
-                       break;
-
-               /* Add new interface types here */
-
-               default:
-                       printf ("%s: Unsupported interface type, %d\n",
-                                       __FUNCTION__, desc->iface);
-               }
-
-       return ret_val;
-}
-
-
 /* ------------------------------------------------------------------------- */
 /* ACEX1K Passive Serial Generic Implementation                                  */
 
@@ -290,73 +264,3 @@ static int ACEX1K_ps_dump (Altera_desc * desc, void *buf, size_t bsize)
                        __FUNCTION__);
        return FPGA_FAIL;
 }
-
-static int ACEX1K_ps_reloc (Altera_desc * desc, ulong reloc_offset)
-{
-       int ret_val = FPGA_FAIL;        /* assume the worst */
-       Altera_ACEX1K_Passive_Serial_fns *fn_r, *fn =
-                       (Altera_ACEX1K_Passive_Serial_fns *) (desc->iface_fns);
-
-       if (fn) {
-               ulong addr;
-
-               /* Get the relocated table address */
-               addr = (ulong) fn + reloc_offset;
-               fn_r = (Altera_ACEX1K_Passive_Serial_fns *) addr;
-
-               if (!fn_r->relocated) {
-
-                       if (memcmp (fn_r, fn,
-                                               sizeof (Altera_ACEX1K_Passive_Serial_fns))
-                               == 0) {
-                               /* good copy of the table, fix the descriptor pointer */
-                               desc->iface_fns = fn_r;
-                       } else {
-                               PRINTF ("%s: Invalid function table at 0x%p\n",
-                                               __FUNCTION__, fn_r);
-                               return FPGA_FAIL;
-                       }
-
-                       PRINTF ("%s: Relocating descriptor at 0x%p\n", __FUNCTION__,
-                                       desc);
-
-                       addr = (ulong) (fn->pre) + reloc_offset;
-                       fn_r->pre = (Altera_pre_fn) addr;
-
-                       addr = (ulong) (fn->config) + reloc_offset;
-                       fn_r->config = (Altera_config_fn) addr;
-
-                       addr = (ulong) (fn->status) + reloc_offset;
-                       fn_r->status = (Altera_status_fn) addr;
-
-                       addr = (ulong) (fn->done) + reloc_offset;
-                       fn_r->done = (Altera_done_fn) addr;
-
-                       addr = (ulong) (fn->clk) + reloc_offset;
-                       fn_r->clk = (Altera_clk_fn) addr;
-
-                       addr = (ulong) (fn->data) + reloc_offset;
-                       fn_r->data = (Altera_data_fn) addr;
-
-                       addr = (ulong) (fn->abort) + reloc_offset;
-                       fn_r->abort = (Altera_abort_fn) addr;
-
-                       addr = (ulong) (fn->post) + reloc_offset;
-                       fn_r->post = (Altera_post_fn) addr;
-
-                       fn_r->relocated = TRUE;
-
-               } else {
-                       /* this table has already been moved */
-                       /* XXX - should check to see if the descriptor is correct */
-                       desc->iface_fns = fn_r;
-               }
-
-               ret_val = FPGA_SUCCESS;
-       } else {
-               printf ("%s: NULL Interface function table!\n", __FUNCTION__);
-       }
-
-       return ret_val;
-
-}