blob: b30055409164534b7d59e0a0e5f139271d49d254 [file] [log] [blame]
wdenkc83bf6a2004-01-06 22:38:14 +00001#ifndef __EXPORTS_H__
2#define __EXPORTS_H__
wdenk27b207f2003-07-24 23:38:38 +00003
Simon Glassc30b7ad2019-11-14 12:57:41 -07004#include <irq_func.h>
Simon Glassc05ed002020-05-10 11:40:11 -06005#include <linux/delay.h>
Simon Glassc30b7ad2019-11-14 12:57:41 -07006
wdenk27b207f2003-07-24 23:38:38 +00007#ifndef __ASSEMBLY__
Prabhakar Kushwaha95279312015-06-28 11:03:59 +05308#ifdef CONFIG_PHY_AQUANTIA
Simon Glass9fb625c2019-08-01 09:46:51 -06009#include <env.h>
Joe Hershbergerf070b1a2018-07-17 15:02:30 -050010#include <phy_interface.h>
Prabhakar Kushwaha95279312015-06-28 11:03:59 +053011#endif
wdenk27b207f2003-07-24 23:38:38 +000012
Simon Glass36bf4462019-11-14 12:57:42 -070013#include <irq_func.h>
14
Simon Glass09140112020-05-10 11:40:03 -060015struct cmd_tbl;
Martin Dorwig49cad542015-01-26 15:22:54 -070016struct spi_slave;
17
Simon Glassa6f2aaf2019-12-28 10:44:46 -070018/* Set up the jump table for use by the API */
19void jumptable_init(void);
20
wdenk27b207f2003-07-24 23:38:38 +000021/* These are declarations of exported functions available in C code */
22unsigned long get_version(void);
23int getc(void);
24int tstc(void);
25void putc(const char);
26void puts(const char*);
Wolfgang Denkd9c27252010-06-20 17:14:14 +020027int printf(const char* fmt, ...);
Martin Dorwig49cad542015-01-26 15:22:54 -070028void install_hdlr(int, interrupt_handler_t, void*);
wdenk27b207f2003-07-24 23:38:38 +000029void free_hdlr(int);
30void *malloc(size_t);
Hans de Goede1eb0c032015-09-13 14:45:15 +020031#if !CONFIG_IS_ENABLED(SYS_MALLOC_SIMPLE)
wdenk27b207f2003-07-24 23:38:38 +000032void free(void*);
Simon Glass90594912015-03-03 08:03:01 -070033#endif
Ingo van Lil3eb90ba2009-11-24 14:09:21 +010034void __udelay(unsigned long);
wdenk27b207f2003-07-24 23:38:38 +000035unsigned long get_timer(unsigned long);
Wolfgang Denkd9c27252010-06-20 17:14:14 +020036int vprintf(const char *, va_list);
Martin Dorwig49cad542015-01-26 15:22:54 -070037unsigned long simple_strtoul(const char *cp, char **endp, unsigned int base);
Heiko Schochera7fd0d92011-05-02 21:33:49 +000038int strict_strtoul(const char *cp, unsigned int base, unsigned long *res);
Simon Glass00caae62017-08-03 12:22:12 -060039char *env_get(const char *name);
Simon Glass382bee52017-08-03 12:22:09 -060040int env_set(const char *varname, const char *value);
Martin Dorwig49cad542015-01-26 15:22:54 -070041long simple_strtol(const char *cp, char **endp, unsigned int base);
42int strcmp(const char *cs, const char *ct);
Lukasz Majewski3ec44112012-12-11 11:09:42 +010043unsigned long ustrtoul(const char *cp, char **endp, unsigned int base);
Piotr Wilczek7df54d32013-01-27 22:59:24 +000044unsigned long long ustrtoull(const char *cp, char **endp, unsigned int base);
Bartosz Golaszewskie3114822019-07-29 08:58:00 +020045#if defined(CONFIG_CMD_I2C) && !defined(CONFIG_DM_I2C)
wdenk4f7cb082003-09-11 23:06:34 +000046int i2c_write (uchar, uint, int , uchar* , int);
47int i2c_read (uchar, uint, int , uchar* , int);
Jon Loeliger068b60a2007-07-10 10:27:39 -050048#endif
Prabhakar Kushwaha95279312015-06-28 11:03:59 +053049#ifdef CONFIG_PHY_AQUANTIA
50struct mii_dev *mdio_get_current_dev(void);
51struct phy_device *phy_find_by_mask(struct mii_dev *bus, unsigned phy_mask,
52 phy_interface_t interface);
53struct phy_device *mdio_phydev_for_ethname(const char *ethname);
54int miiphy_set_current_dev(const char *devname);
55#endif
wdenk27b207f2003-07-24 23:38:38 +000056
Wolfgang Denk54841ab2010-06-28 22:00:46 +020057void app_startup(char * const *);
wdenk27b207f2003-07-24 23:38:38 +000058
59#endif /* ifndef __ASSEMBLY__ */
60
Martin Dorwig49cad542015-01-26 15:22:54 -070061struct jt_funcs {
62#define EXPORT_FUNC(impl, res, func, ...) res(*func)(__VA_ARGS__);
wdenk27b207f2003-07-24 23:38:38 +000063#include <_exports.h>
64#undef EXPORT_FUNC
wdenk27b207f2003-07-24 23:38:38 +000065};
66
Martin Dorwig49cad542015-01-26 15:22:54 -070067
Shaohui Xie9578c422016-09-07 17:56:07 +080068#define XF_VERSION 9
wdenk27b207f2003-07-24 23:38:38 +000069
Graeme Russfea25722011-04-13 19:43:28 +100070#if defined(CONFIG_X86)
wdenk77846742003-07-26 08:08:08 +000071extern gd_t *global_data;
72#endif
73
wdenkc83bf6a2004-01-06 22:38:14 +000074#endif /* __EXPORTS_H__ */