summaryrefslogtreecommitdiff
path: root/include/_exports.h
AgeCommit message (Collapse)Author
2025-09-26_exports.h: export standard memory/string handling functionsRasmus Villemoes
The current list of exported functions lacks quite a few bog-standard C library functions that we might as well expose, since U-Boot certainly has them implemented anyway. There's no reason a standalone application should have its own strlen() implementation or link in a copy from some tiny libc. For a customer's standalone app, this means it goes from 95K to 10K. More importantly, we can ditch the custom toolchain including a newlibc used to build the standalone app and just use the same toolchain as used to build u-boot itself. Signed-off-by: Rasmus Villemoes <[email protected]> Reviewed-by: Tom Rini <[email protected]>
2025-09-26_exports.h: reorganize a bitRasmus Villemoes
The current list of exported functions is somewhat of a mess. Reorganize them so that related functionality is kept together: - console I/O: move vprintf next to printf and the getc/putc functions - integer parsing: move the *strto* functions together - standard string.h stuff: move memset() and strcpy() next to strcmp() - time: move mdelay() next to udelay() and get_timer() Signed-off-by: Rasmus Villemoes <[email protected]> Reviewed-by: Tom Rini <[email protected]>
2025-09-26_exports.h: drop the last dummy entriesRasmus Villemoes
Signed-off-by: Rasmus Villemoes <[email protected]> Reviewed-by: Tom Rini <[email protected]>
2025-09-26_exports.h: simplify condition for including spi functionsRasmus Villemoes
As for the i2c functions, drop the dummy entries that, if ever used, would just have the standalone app get some random content in the return register. While deprecated, the spi_{setup,free}_slave functions do exist even with CONFIG_DM_SPI - and a standalone app can't really do anything but refer to a spi device via a (bus, cs) pair. Eventually, one should probably export some function that could allow a standalone app to get a struct udevice* corresponding to either a full DT path, an alias, or perhaps a label (provided one builds with -@), and then export functions that can operate on that. Signed-off-by: Rasmus Villemoes <[email protected]> Reviewed-by: Tom Rini <[email protected]>
2025-09-26_exports.h: drop creating dummy i2c entries and fixup config dependencyRasmus Villemoes
There's really no good reason to create stub entries that would call a function that doesn't even return anything sensible. The existence of these two i2c_* functions depends on CONFIG_IS_ENABLED(SYS_I2C_LEGACY), which does depend on !DM_I2C, but is not equivalent to it. They are probably rather hard to use unless CMD_I2C and something in U-Boot has called "i2c dev foo" to set the current i2c bus before calling the standalone app, so keep that dependency. Signed-off-by: Rasmus Villemoes <[email protected]> Reviewed-by: Tom Rini <[email protected]>
2022-09-24console: Implement flush() functionPali Rohár
On certain places it is required to flush output print buffers to ensure that text strings were sent to console or serial devices. For example when printing message that U-Boot is going to boot kernel or when U-Boot is going to change baudrate of terminal device. Therefore introduce a new flush() and fflush() functions into console code. These functions will call .flush callback of associated stdio_dev device. As this function may increase U-Boot side, allow to compile U-Boot without this function. For this purpose there is a new config CONSOLE_FLUSH_SUPPORT which is enabled by default and can be disabled. It is a good idea to have this option enabled for all boards which have enough space for it. When option is disabled when U-Boot defines just empty static inline function fflush() to avoid ifdefs in other code. Signed-off-by: Pali Rohár <[email protected]> Reviewed-by: Simon Glass <[email protected]>
2022-04-10net: phy: don't require PHY interface mode during PHY creationMarek Behún
Currently we require PHY interface mode to be known when finding/creating the PHY - the functions * phy_connect_phy_id() * phy_device_create() * create_phy_by_mask() * search_for_existing_phy() * get_phy_device_by_mask() * phy_find_by_mask() all require the interface parameter, but the only thing done with it is that it is assigned to phydev->interface. This makes it impossible to find a PHY device without overwriting the set mode. Since the interface mode is not used during .probe() and should be used at first in .config(), drop the interface parameter from these functions. Make the default value of phydev->interface (in phy_device_create()) to be PHY_INTERFACE_MODE_NA. Move the interface parameter to phy_connect_dev(), where it should be. Change all occurrences treewide. In occurrences where we don't call phy_connect_dev() for some reason (they only configure the PHY without connecting it to an ethernet controller), set phydev->interface = value from phy_find_by_mask call. Signed-off-by: Marek Behún <[email protected]> Reviewed-by: Ramon Fried <[email protected]> Reviewed-by: Vladimir Oltean <[email protected]>
2021-02-21dm: i2c: use CONFIG_IS_ENABLED macro for DM_I2C/DM_I2C_GPIOIgor Opaniuk
Use CONFIG_IS_ENABLED() macro, which provides more convenient way to check $(SPL)DM_I2C/$(SPL)DM_I2C_GPIO configs for both SPL and U-Boot proper. CONFIG_IS_ENABLED(DM_I2C) expands to: - 1 if CONFIG_SPL_BUILD is undefined and CONFIG_DM_I2C is set to 'y', - 1 if CONFIG_SPL_BUILD is defined and CONFIG_SPL_DM_I2C is set to 'y', - 0 otherwise. All occurences were replaced automatically using these bash cmds: $ find . -type f -exec sed -i 's/ifndef CONFIG_DM_I2C/if !CONFIG_IS_ENABLED(DM_I2C)/g' {} + $ find . -type f -exec sed -i 's/ifdef CONFIG_DM_I2C/if CONFIG_IS_ENABLED(DM_I2C)/g' {} + $ find . -type f -exec sed -i 's/defined(CONFIG_DM_I2C)/CONFIG_IS_ENABLED(DM_I2C)/g' {} + $ find . -type f -exec sed -i 's/ifndef CONFIG_DM_I2C_GPIO/if !CONFIG_IS_ENABLED(DM_I2C_GPIO)/g' {} + $ find . -type f -exec sed -i 's/ifdef CONFIG_DM_I2C_GPIO/if CONFIG_IS_ENABLED(DM_I2C_GPIO)/g' {} + $ find . -type f -exec sed -i 's/defined(CONFIG_DM_I2C_GPIO)/CONFIG_IS_ENABLED(DM_I2C_GPIO)/g' {} + Reviewed-by: Heiko Schocher <[email protected]> Reviewed-by: Simon Glass <[email protected]> Signed-off-by: Igor Opaniuk <[email protected]> Reviewed-by: Tom Rini <[email protected]> Reviewed-by: Priyanka Jain <[email protected]>
2020-10-22common: rename getc() to getchar()Heinrich Schuchardt
The sandbox is built with the SDL2 library with invokes the X11 library which in turn calls getc(). But getc() in glibc is defined as int getc(FILE *) This does not match our definition. int getc(void) The sandbox crashes when called with parameter -l. Rename our library symbol getc() to getchar(). Signed-off-by: Heinrich Schuchardt <[email protected]> Reviewed-by: Tom Rini <[email protected]> Reviewed-by: Simon Glass <[email protected]>
2020-05-18command: Remove the cmd_tbl_t typedefSimon Glass
We should not use typedefs in U-Boot. They cannot be used as forward declarations which means that header files must include the full header to access them. Drop the typedef and rename the struct to remove the _s suffix which is now not useful. This requires quite a few header-file additions. Signed-off-by: Simon Glass <[email protected]>
2019-07-29i2c: remove i2c driver-model compatibility layerBartosz Golaszewski
There are no more users of the compatibility layer for i2c. Remove the driver and all references to it. Signed-off-by: Bartosz Golaszewski <[email protected]> Acked-by: Heiko Schocher <[email protected]>
2018-11-27spi: Remove used spi_initJagan Teki
spi_init used in some areas in tree, but the respective drivers will remove in future patches. So remove the same instances. Signed-off-by: Jagan Teki <[email protected]>
2017-08-16env: Rename getenv/_f() to env_get()Simon Glass
We are now using an env_ prefix for environment functions. Rename these two functions for consistency. Also add function comments in common.h. Quite a few places use getenv() in a condition context, provoking a warning from checkpatch. These are fixed up in this patch also. Suggested-by: Wolfgang Denk <[email protected]> Signed-off-by: Simon Glass <[email protected]>
2017-08-16env: Rename setenv() to env_set()Simon Glass
We are now using an env_ prefix for environment functions. Rename setenv() for consistency. Also add function comments in common.h. Suggested-by: Wolfgang Denk <[email protected]> Signed-off-by: Simon Glass <[email protected]>
2016-10-11x86: Don't export interrupt handlers with x86_64Simon Glass
We don't have a way of adjusting these at present so it is best to refuse to export these functions. This can be implemented later if the API is required. Signed-off-by: Simon Glass <[email protected]> Reviewed-by: Bin Meng <[email protected]>
2016-09-14Export memset for standalone AQ FW load appsShaohui Xie
The 'commit 95279315076c ("board/ls2085rdb: Export functions for standalone AQ FW load apps")' mentioned memset was exported but it was not, this patch exports the memset. Signed-off-by: Shaohui Xie <[email protected]> Signed-off-by: Gong Qianyu <[email protected]> Reviewed-by: York Sun <[email protected]>
2015-10-20malloc_simple: Add Kconfig option for using only malloc_simple in the SPLHans de Goede
common/dlmalloc.c is quite big, both in .text and .data usage, therefor on some boards the SPL is build to use only malloc_simple.c and not the dlmalloc.c code. This is done in various include/configs/foo.h with the following construct: #ifdef CONFIG_SPL_BUILD #define CONFIG_SYS_MALLOC_SIMPLE #endif This commit introduces a SPL_MALLOC_SIMPLE Kconfig bool which allows selecting this functionality through Kconfig instead. Signed-off-by: Hans de Goede <[email protected]> Acked-by: Simon Glass <[email protected]>
2015-07-20board/ls2085rdb: Export functions for standalone AQ FW load appsPrabhakar Kushwaha
Export functions required by Aquntia PHY firmware load application. functions are memset, strcpy, mdelay, mdio_get_current_dev, phy_find_by_mask, mdio_phydev_for_ethname and miiphy_set_current_dev Signed-off-by: Prabhakar Kushwaha <[email protected]> Reviewed-by: York Sun <[email protected]>
2015-03-04Make export interface support CONFIG_SYS_MALLOC_SIMPLESimon Glass
When CONFIG_SYS_MALLOC_SIMPLE is defined, free() is a static inline. Make sure that the export interface still builds in this case. Signed-off-by: Simon Glass <[email protected]>
2015-01-29Export redesignMartin Dorwig
this is an atempt to make the export of functions typesafe. I replaced the jumptable void ** by a struct (jt_funcs) with function pointers. The EXPORT_FUNC macro now has 3 fixed parameters and one variadic parameter The first is the name of the exported function, the rest of the parameters are used to format a functionpointer in the jumptable, the EXPORT_FUNC macros are expanded three times, 1. to declare the members of the struct 2. to initialize the structmember pointers 3. to call the functions in stubs.c Signed-off-by: Martin Dorwig <[email protected]> Acked-by: Simon Glass <[email protected]> Signed-off-by: Simon Glass <[email protected]> (resending to the list since my tweaks are not quite trivial)
2011-05-12lib, vsprintf: introduce strict_strtoulHeiko Schocher
as checkpatch proposes to use strict_strtoul instead of simple_strtoul, introduce it. Ported this function from Linux 2.6.38 commit ID: 521cb40b0c44418a4fd36dc633f575813d59a43d Signed-off-by: Heiko Schocher <[email protected]> cc: Wolfgang Denk <[email protected]> cc: Detlev Zundel <[email protected]> cc: Valentin Longchamp <[email protected]> cc: Holger Brunck <[email protected]> Signed-off-by: Valentin Longchamp <[email protected]>
2010-09-19Remove support for CONFIG_HAS_UID and "forceenv" commandWolfgang Denk
This (undocumented) concept was only in use for the MVSMR and davinci_schmoogie Sergey Kubushyn <[email protected]> boards. Drop it for now. If really needed, it should be reimplemented later in the context of the new environment command set. Signed-off-by: Wolfgang Denk <[email protected]> Cc: Andre Schwarz <[email protected]> Cc: Sergey Kubushyn <[email protected]> Acked-by: Sergey Kubushyn <[email protected]>
2009-08-09export SPI functions to standalone appsMike Frysinger
While we're here, fix the broken #ifdef handling in _exports.h. Signed-off-by: Mike Frysinger <[email protected]>
2007-08-10[ARM] TI DaVinci support, hopefully finalSergey Kubushyn
Add support for the following DaVinci boards: - DV_EVM - SCHMOOGIE - SONATA Changes: - Split into separate board directories - Removed changes to MTD_DEBUG (or whatever it's called) - New CONFIG_CMD party line followed - Some cosmetic fixes, cleanup etc. - Patches against the latest U-Boot tree as of now. - Fixed CONFIG_CMD_NET in net files. - Fixed CONFIG_CMD_EEPROM for schmoogie. - Made sure it compiles and works (forceenv() link problem) on SCHMOOGIE and DV_EVM. Can't check if it works on SONATA, don't have a board any more, but it at least compiles. Here is an excerpt from session log on SCHMOOGIE... U-Boot 1.2.0-g6c33c785-dirty (Aug 7 2007 - 13:07:17) DRAM: 128 MB NAND: 128 MiB In: serial Out: serial Err: serial ARM Clock : 297MHz DDR Clock : 162MHz ETH PHY : DP83848 @ 0x01 U-Boot > iprobe Valid chip addresses: 1B 38 3A 3D 3F 50 5D 6F U-Boot > ping 192.168.253.10 host 192.168.253.10 is alive U-Boot > Signed-off-by: Sergey Kubushyn <[email protected]> Acked-by: Dirk Behme <[email protected]> Acked-by: Zach Sadecki <[email protected]> Acked-by: Stefan Roese <[email protected]>
2007-08-06Add functions to list of exported functionsMartin Krause
Additionally export the following fuctions (to make trab_config build again): - simple_strtol() - strcmp() Also bump the ABI version to reflect this change Signed-off-by: Martin Krause <[email protected]>
2007-07-10cpu/ rtc/ include/: Remove lingering references to CFG_CMD_* symbols.Jon Loeliger
Signed-off-by: Jon Loeliger <[email protected]>
2007-07-09include/: Remove obsolete references to CONFIG_COMMANDSJon Loeliger
Mostly removed from comments here. Signed-off-by: Jon Loeliger <[email protected]>
2007-07-04include/ non-config: Augment CONFIG_COMMANDS tests with defined(CONFIG_CMD_*).Jon Loeliger
This is a compatibility step that allows both the older form and the new form to co-exist for a while until the older can be removed entirely. All transformations are of the form: Before: #if (CONFIG_COMMANDS & CFG_CMD_AUTOSCRIPT) After: #if (CONFIG_COMMANDS & CFG_CMD_AUTOSCRIPT) || defined(CONFIG_CMD_AUTOSCRIPT) Signed-off-by: Jon Loeliger <[email protected]>
2006-09-01Added simple_strtoul(), getenv() and setenv() to the exported functions.Detlev Zundel
Also bumped up ABI version to reflect this change.
2003-09-12Move TRAB burn-in tests to TRAB board directoryLABEL_2003_09_12_1745wdenk
2003-09-11* Patch by Martin Krause, 11 Sep 2003:LABEL_2003_09_12_0110wdenk
add burn-in tests for TRAB board * Enable instruction cache on MPC5200 board
2003-07-24* Implement new mechanism to export U-Boot's functions to standalonewdenk
applications: instead of using (PPC-specific) system calls we now use a jump table; please see doc/README.standalone for details * Patch by Dave Westwood, 24 Jul 2003: added support for Unity OS (a proprietary OS)