wdenk | 27b207f | 2003-07-24 23:38:38 +0000 | [diff] [blame] | 1 | #include <common.h> |
| 2 | #include <exports.h> |
Simon Glass | 80729a5 | 2011-12-06 19:31:32 +0000 | [diff] [blame] | 3 | #include <spi.h> |
wdenk | 27b207f | 2003-07-24 23:38:38 +0000 | [diff] [blame] | 4 | |
Wolfgang Denk | d87080b | 2006-03-31 18:32:53 +0200 | [diff] [blame] | 5 | DECLARE_GLOBAL_DATA_PTR; |
| 6 | |
Wolfgang Denk | c0c1537 | 2010-06-20 23:33:02 +0200 | [diff] [blame] | 7 | __attribute__((unused)) static void dummy(void) |
wdenk | 27b207f | 2003-07-24 23:38:38 +0000 | [diff] [blame] | 8 | { |
| 9 | } |
| 10 | |
| 11 | unsigned long get_version(void) |
| 12 | { |
| 13 | return XF_VERSION; |
| 14 | } |
| 15 | |
Mike Frysinger | bf44f3f | 2009-11-04 16:34:42 -0500 | [diff] [blame] | 16 | /* Reuse _exports.h with a little trickery to avoid bitrot */ |
| 17 | #define EXPORT_FUNC(sym) gd->jt[XF_##sym] = (void *)sym; |
| 18 | |
Graeme Russ | fea2572 | 2011-04-13 19:43:28 +1000 | [diff] [blame] | 19 | #if !defined(CONFIG_X86) && !defined(CONFIG_PPC) |
Mike Frysinger | bf44f3f | 2009-11-04 16:34:42 -0500 | [diff] [blame] | 20 | # define install_hdlr dummy |
| 21 | # define free_hdlr dummy |
| 22 | #else /* kludge for non-standard function naming */ |
| 23 | # define install_hdlr irq_install_handler |
| 24 | # define free_hdlr irq_free_handler |
| 25 | #endif |
| 26 | #ifndef CONFIG_CMD_I2C |
| 27 | # define i2c_write dummy |
| 28 | # define i2c_read dummy |
| 29 | #endif |
Simon Glass | d7af6a4 | 2014-10-13 23:41:52 -0600 | [diff] [blame] | 30 | #if !defined(CONFIG_CMD_SPI) || defined(CONFIG_DM_SPI) |
Mike Frysinger | bf44f3f | 2009-11-04 16:34:42 -0500 | [diff] [blame] | 31 | # define spi_init dummy |
| 32 | # define spi_setup_slave dummy |
| 33 | # define spi_free_slave dummy |
Simon Glass | d7af6a4 | 2014-10-13 23:41:52 -0600 | [diff] [blame] | 34 | #endif |
| 35 | #ifndef CONFIG_CMD_SPI |
Mike Frysinger | bf44f3f | 2009-11-04 16:34:42 -0500 | [diff] [blame] | 36 | # define spi_claim_bus dummy |
| 37 | # define spi_release_bus dummy |
| 38 | # define spi_xfer dummy |
| 39 | #endif |
Mike Frysinger | bf44f3f | 2009-11-04 16:34:42 -0500 | [diff] [blame] | 40 | |
| 41 | void jumptable_init(void) |
wdenk | 27b207f | 2003-07-24 23:38:38 +0000 | [diff] [blame] | 42 | { |
Mike Frysinger | bf44f3f | 2009-11-04 16:34:42 -0500 | [diff] [blame] | 43 | gd->jt = malloc(XF_MAX * sizeof(void *)); |
| 44 | #include <_exports.h> |
wdenk | 27b207f | 2003-07-24 23:38:38 +0000 | [diff] [blame] | 45 | } |