blob: b3b6e1f9c6abfa2c978159eaa89f9da14e9cafc0 [file] [log] [blame]
wdenk27b207f2003-07-24 23:38:38 +00001#include <common.h>
2#include <exports.h>
3
Wolfgang Denkd87080b2006-03-31 18:32:53 +02004DECLARE_GLOBAL_DATA_PTR;
5
wdenk27b207f2003-07-24 23:38:38 +00006static void dummy(void)
7{
8}
9
10unsigned long get_version(void)
11{
12 return XF_VERSION;
13}
14
15void jumptable_init (void)
16{
wdenk27b207f2003-07-24 23:38:38 +000017 int i;
18
19 gd->jt = (void **) malloc (XF_MAX * sizeof (void *));
20 for (i = 0; i < XF_MAX; i++)
21 gd->jt[i] = (void *) dummy;
22
23 gd->jt[XF_get_version] = (void *) get_version;
24 gd->jt[XF_malloc] = (void *) malloc;
25 gd->jt[XF_free] = (void *) free;
Detlev Zundeld7c2a022006-09-01 15:00:02 +020026 gd->jt[XF_getenv] = (void *) getenv;
27 gd->jt[XF_setenv] = (void *) setenv;
28 gd->jt[XF_get_timer] = (void *) get_timer;
29 gd->jt[XF_simple_strtoul] = (void *) simple_strtoul;
30 gd->jt[XF_udelay] = (void *) udelay;
Martin Krause8092fef2006-12-12 14:26:01 +010031 gd->jt[XF_simple_strtol] = (void *) simple_strtol;
32 gd->jt[XF_strcmp] = (void *) strcmp;
wdenk27b207f2003-07-24 23:38:38 +000033#if defined(CONFIG_I386) || defined(CONFIG_PPC)
34 gd->jt[XF_install_hdlr] = (void *) irq_install_handler;
35 gd->jt[XF_free_hdlr] = (void *) irq_free_handler;
wdenk4f7cb082003-09-11 23:06:34 +000036#endif /* I386 || PPC */
Jon Loeligerc3517f92007-07-08 18:10:08 -050037#if defined(CONFIG_CMD_I2C)
wdenk4f7cb082003-09-11 23:06:34 +000038 gd->jt[XF_i2c_write] = (void *) i2c_write;
39 gd->jt[XF_i2c_read] = (void *) i2c_read;
Jon Loeligerc3517f92007-07-08 18:10:08 -050040#endif
Mike Frysingerbedd8402009-07-23 16:37:48 -040041#ifdef CONFIG_CMD_SPI
42 gd->jt[XF_spi_init] = (void *) spi_init;
43 gd->jt[XF_spi_setup_slave] = (void *) spi_setup_slave;
44 gd->jt[XF_spi_free_slave] = (void *) spi_free_slave;
45 gd->jt[XF_spi_claim_bus] = (void *) spi_claim_bus;
46 gd->jt[XF_spi_release_bus] = (void *) spi_release_bus;
47 gd->jt[XF_spi_xfer] = (void *) spi_xfer;
48#endif
wdenk27b207f2003-07-24 23:38:38 +000049}