blob: 6f8c9cf4517e1497952086a9d683f879eafc5f39 [file] [log] [blame]
wdenk87249ba2004-01-06 22:38:14 +00001#ifndef __EXPORTS_H__
2#define __EXPORTS_H__
wdenk874ac262003-07-24 23:38:38 +00003
Simon Glass9b61c7c2019-11-14 12:57:41 -07004#include <irq_func.h>
Simon Glass3ba929a2020-10-30 21:38:53 -06005#include <asm/global_data.h>
Simon Glassdbd79542020-05-10 11:40:11 -06006#include <linux/delay.h>
Simon Glass9b61c7c2019-11-14 12:57:41 -07007
wdenk874ac262003-07-24 23:38:38 +00008#ifndef __ASSEMBLY__
Prabhakar Kushwaha7b3a6bc2015-06-28 11:03:59 +05309#ifdef CONFIG_PHY_AQUANTIA
Simon Glass5e6201b2019-08-01 09:46:51 -060010#include <env.h>
Joe Hershbergerf5581fb2018-07-17 15:02:30 -050011#include <phy_interface.h>
Prabhakar Kushwaha7b3a6bc2015-06-28 11:03:59 +053012#endif
wdenk874ac262003-07-24 23:38:38 +000013
Simon Glass8f3f7612019-11-14 12:57:42 -070014#include <irq_func.h>
15
Simon Glassed38aef2020-05-10 11:40:03 -060016struct cmd_tbl;
Martin Dorwigcb2c2862015-01-26 15:22:54 -070017struct spi_slave;
18
Ovidiu Panait036f0f12020-11-28 10:43:15 +020019/**
20 * jumptable_init() - Set up the jump table for use by the API
21 *
22 * It is called during the generic post-relocation init sequence.
23 *
24 * Return: 0 if OK
25 */
26int jumptable_init(void);
Simon Glass6ba03922019-12-28 10:44:46 -070027
wdenk874ac262003-07-24 23:38:38 +000028/* These are declarations of exported functions available in C code */
29unsigned long get_version(void);
30int getc(void);
31int tstc(void);
32void putc(const char);
33void puts(const char*);
Wolfgang Denk318ef5c2010-06-20 17:14:14 +020034int printf(const char* fmt, ...);
Martin Dorwigcb2c2862015-01-26 15:22:54 -070035void install_hdlr(int, interrupt_handler_t, void*);
wdenk874ac262003-07-24 23:38:38 +000036void free_hdlr(int);
37void *malloc(size_t);
Hans de Goede9f9df6f2015-09-13 14:45:15 +020038#if !CONFIG_IS_ENABLED(SYS_MALLOC_SIMPLE)
wdenk874ac262003-07-24 23:38:38 +000039void free(void*);
Simon Glassf5f2b0e2015-03-03 08:03:01 -070040#endif
Ingo van Lilf0f778a2009-11-24 14:09:21 +010041void __udelay(unsigned long);
wdenk874ac262003-07-24 23:38:38 +000042unsigned long get_timer(unsigned long);
Wolfgang Denk318ef5c2010-06-20 17:14:14 +020043int vprintf(const char *, va_list);
Martin Dorwigcb2c2862015-01-26 15:22:54 -070044unsigned long simple_strtoul(const char *cp, char **endp, unsigned int base);
Heiko Schocher8d4f35a2011-05-02 21:33:49 +000045int strict_strtoul(const char *cp, unsigned int base, unsigned long *res);
Simon Glass64b723f2017-08-03 12:22:12 -060046char *env_get(const char *name);
Simon Glass6a38e412017-08-03 12:22:09 -060047int env_set(const char *varname, const char *value);
Martin Dorwigcb2c2862015-01-26 15:22:54 -070048long simple_strtol(const char *cp, char **endp, unsigned int base);
49int strcmp(const char *cs, const char *ct);
Lukasz Majewski99180d62012-12-11 11:09:42 +010050unsigned long ustrtoul(const char *cp, char **endp, unsigned int base);
Piotr Wilczek219ad3c2013-01-27 22:59:24 +000051unsigned long long ustrtoull(const char *cp, char **endp, unsigned int base);
Igor Opaniukf7c91762021-02-09 13:52:45 +020052#if defined(CONFIG_CMD_I2C) && !CONFIG_IS_ENABLED(DM_I2C)
wdenk4cc02a82003-09-11 23:06:34 +000053int i2c_write (uchar, uint, int , uchar* , int);
54int i2c_read (uchar, uint, int , uchar* , int);
Jon Loeliger07efe2a2007-07-10 10:27:39 -050055#endif
Prabhakar Kushwaha7b3a6bc2015-06-28 11:03:59 +053056#ifdef CONFIG_PHY_AQUANTIA
57struct mii_dev *mdio_get_current_dev(void);
Marek BehĂșn3927efb2022-04-07 00:33:08 +020058struct phy_device *phy_find_by_mask(struct mii_dev *bus, unsigned phy_mask);
Prabhakar Kushwaha7b3a6bc2015-06-28 11:03:59 +053059struct phy_device *mdio_phydev_for_ethname(const char *ethname);
60int miiphy_set_current_dev(const char *devname);
61#endif
wdenk874ac262003-07-24 23:38:38 +000062
Wolfgang Denk6262d0212010-06-28 22:00:46 +020063void app_startup(char * const *);
wdenk874ac262003-07-24 23:38:38 +000064
65#endif /* ifndef __ASSEMBLY__ */
66
Martin Dorwigcb2c2862015-01-26 15:22:54 -070067struct jt_funcs {
68#define EXPORT_FUNC(impl, res, func, ...) res(*func)(__VA_ARGS__);
wdenk874ac262003-07-24 23:38:38 +000069#include <_exports.h>
70#undef EXPORT_FUNC
wdenk874ac262003-07-24 23:38:38 +000071};
72
Martin Dorwigcb2c2862015-01-26 15:22:54 -070073
Shaohui Xiefd4d7bb2016-09-07 17:56:07 +080074#define XF_VERSION 9
wdenk874ac262003-07-24 23:38:38 +000075
Graeme Russcbfce1d2011-04-13 19:43:28 +100076#if defined(CONFIG_X86)
wdenkb8463562003-07-26 08:08:08 +000077extern gd_t *global_data;
78#endif
79
wdenk87249ba2004-01-06 22:38:14 +000080#endif /* __EXPORTS_H__ */