2003-07-25 07:38:38 +08:00
|
|
|
#include <common.h>
|
|
|
|
#include <exports.h>
|
|
|
|
|
2006-04-01 00:32:53 +08:00
|
|
|
DECLARE_GLOBAL_DATA_PTR;
|
|
|
|
|
2003-07-25 07:38:38 +08:00
|
|
|
static void dummy(void)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
unsigned long get_version(void)
|
|
|
|
{
|
|
|
|
return XF_VERSION;
|
|
|
|
}
|
|
|
|
|
|
|
|
void jumptable_init (void)
|
|
|
|
{
|
|
|
|
int i;
|
|
|
|
|
|
|
|
gd->jt = (void **) malloc (XF_MAX * sizeof (void *));
|
|
|
|
for (i = 0; i < XF_MAX; i++)
|
|
|
|
gd->jt[i] = (void *) dummy;
|
|
|
|
|
|
|
|
gd->jt[XF_get_version] = (void *) get_version;
|
|
|
|
gd->jt[XF_malloc] = (void *) malloc;
|
|
|
|
gd->jt[XF_free] = (void *) free;
|
2006-09-01 21:00:02 +08:00
|
|
|
gd->jt[XF_getenv] = (void *) getenv;
|
|
|
|
gd->jt[XF_setenv] = (void *) setenv;
|
|
|
|
gd->jt[XF_get_timer] = (void *) get_timer;
|
|
|
|
gd->jt[XF_simple_strtoul] = (void *) simple_strtoul;
|
|
|
|
gd->jt[XF_udelay] = (void *) udelay;
|
2006-12-12 21:26:01 +08:00
|
|
|
gd->jt[XF_simple_strtol] = (void *) simple_strtol;
|
|
|
|
gd->jt[XF_strcmp] = (void *) strcmp;
|
2003-07-25 07:38:38 +08:00
|
|
|
#if defined(CONFIG_I386) || defined(CONFIG_PPC)
|
|
|
|
gd->jt[XF_install_hdlr] = (void *) irq_install_handler;
|
|
|
|
gd->jt[XF_free_hdlr] = (void *) irq_free_handler;
|
2003-09-12 07:06:34 +08:00
|
|
|
#endif /* I386 || PPC */
|
2007-07-09 07:10:08 +08:00
|
|
|
#if defined(CONFIG_CMD_I2C)
|
2003-09-12 07:06:34 +08:00
|
|
|
gd->jt[XF_i2c_write] = (void *) i2c_write;
|
|
|
|
gd->jt[XF_i2c_read] = (void *) i2c_read;
|
2007-07-09 07:10:08 +08:00
|
|
|
#endif
|
2009-07-24 04:37:48 +08:00
|
|
|
#ifdef CONFIG_CMD_SPI
|
|
|
|
gd->jt[XF_spi_init] = (void *) spi_init;
|
|
|
|
gd->jt[XF_spi_setup_slave] = (void *) spi_setup_slave;
|
|
|
|
gd->jt[XF_spi_free_slave] = (void *) spi_free_slave;
|
|
|
|
gd->jt[XF_spi_claim_bus] = (void *) spi_claim_bus;
|
|
|
|
gd->jt[XF_spi_release_bus] = (void *) spi_release_bus;
|
|
|
|
gd->jt[XF_spi_xfer] = (void *) spi_xfer;
|
|
|
|
#endif
|
2003-07-25 07:38:38 +08:00
|
|
|
}
|