summaryrefslogtreecommitdiffstats
path: root/include/common.h
Commit message (Collapse)AuthorAgeFilesLines
* Drop CONFIG_INIT_CRITICALBin Meng2018-11-261-5/+0
| | | | | | | This is now deprecated and no board is using it. Drop it. Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Signed-off-by: Lukas Auer <lukas.auer@aisec.fraunhofer.de>
* Use _AC and UL macros from linux/const.hBaruch Siach2018-11-201-9/+0
| | | | | | | | | | | | | | | Drop the _AC and UL macros from common.h. Linux headers is the original source of this macro, so keep its definition in the same header. Update existing users of these macros to include const.h directly. Cc: Daniel Schwierzeck <daniel.schwierzeck@gmail.com> Cc: Rick Chen <rick@andestech.com> Reviewed-by: Tom Rini <trini@konsulko.com> Reviewed-by: Rick Chen <rick@andestech.com> Signed-off-by: Baruch Siach <baruch@tkos.co.il> Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com> Signed-off-by: Stefan Roese <sr@denx.de>
* bootcount: Make bootcount magic configurableMarek Vasut2018-10-191-1/+0
| | | | | | | | | Add new Kconfig option, SYS_BOOTCOUNT_MAGIC, to select the boot counter magic word. This can be useful ie. in case the entire boot counter register is not usable. Signed-off-by: Marek Vasut <marex@denx.de> Cc: Tom Rini <trini@konsulko.com>
* Remove <inttypes.h> includes and PRI* usages in printf() entirelyMasahiro Yamada2018-09-101-3/+0
| | | | | | | | | | | | | | | | In int-ll64.h, we always use the following typedefs: typedef unsigned int u32; typedef unsigned long uintptr_t; typedef unsigned long long u64; This does not need to match to the compiler's <inttypes.h>. Do not include it. The use of PRI* makes the code super-ugly. You can simply use "l" for printing uintptr_t, "ll" for u64, and no modifier for u32. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
* sandbox: Add serial testPatrice Chotard2018-09-101-0/+1
| | | | | Signed-off-by: Patrice Chotard <patrice.chotard@st.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* common: Fix cpu nr type which is always unsigned typeMichal Simek2018-06-191-4/+4
| | | | | | | | | | | | cpu_cmd() is reading cpu number via simple_strtoul() which is always unsigned type. Platform code implementations are not expecting that nr can be negative and there is not checking in the code for that too. This patch is using u32 type for cpu number to make sure that platform code get proper value range. Signed-off-by: Michal Simek <michal.simek@xilinx.com>
* SPDX: Convert all of our single license tags to Linux Kernel styleTom Rini2018-05-071-2/+1
| | | | | | | | | | | | | | | | | | | | When U-Boot started using SPDX tags we were among the early adopters and there weren't a lot of other examples to borrow from. So we picked the area of the file that usually had a full license text and replaced it with an appropriate SPDX-License-Identifier: entry. Since then, the Linux Kernel has adopted SPDX tags and they place it as the very first line in a file (except where shebangs are used, then it's second line) and with slightly different comment styles than us. In part due to community overlap, in part due to better tag visibility and in part for other minor reasons, switch over to that style. This commit changes all instances where we have a single declared license in the tag as both the before and after are identical in tag contents. There's also a few places where I found we did not have a tag and have introduced one. Signed-off-by: Tom Rini <trini@konsulko.com>
* Convert CONFIG_SPI to KconfigAdam Ford2018-04-271-10/+2
| | | | | | | | | | | | | | This converts the following to Kconfig: CONFIG_SPI This partly involves updating code that assumes that CONFIG_SPI implies things that are specific to the MPC8xx SPI driver. For now, just update the CONFIG tests. This also involves reworking the default for CONFIG_SYS_DEF_EEPROM_ADDR so that we don't set it when we cannot make a reasonable default, as it does not cause any compile failures. Signed-off-by: Adam Ford <aford173@gmail.com> Signed-off-by: Tom Rini <trini@konsulko.com>
* common: move board_info.c prototypes in init.hPatrick Delaunay2018-03-161-2/+1
| | | | | | | Move function prototype for common/init/board_init.c from common.h to init.h Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
* common: move board_r.c prototypes in init.hPatrick Delaunay2018-03-161-16/+3
| | | | | | | Move function prototypes used in common/board_r.c from common.h to init.h Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
* common: move board_init.c prototypes in init.hPatrick Delaunay2018-03-161-37/+1
| | | | | | | Move function prototypes for common/init/board_init.c from common.h to init.h Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
* common: move board_f.c prototypes in init.hPatrick Delaunay2018-03-161-67/+4
| | | | | | | | | Move prototypes for function used in common/board_f.c from common.h to init.h Remove weak for arch_reserve_stacks in prototype (checkpatch issue) Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
* post: remove reference to power functionsPatrick Delaunay2018-03-161-1/+0
| | | | | | | | | The 2 functions board_power_mode and board_poweroff are no more existing in U-Boot code (check with grep) This patch updates the documentation and removes the unnecessary prototypes. Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
* common: remove unused prototypesPatrick Delaunay2018-03-161-10/+0
| | | | | | | | | | | Remove the prototypes for 4 functions no more existing in U-Boot code (checked by grep): - checkflash - checkdram - mdm_init - setup_board_extra Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
* common: add a prototype for mach_cpu_init()Patrick Delaunay2018-03-161-10/+3
| | | | | | | | | | | | | Add a new file init.h with the prototype for arch_cpu_init Add a prototype for mach_cpu_init() to avoid a warning: no previous prototype for ‘mach_cpu_init’ It is a first step to move all the functions prototype used during U-Boot initialization (board_f.c / board_r.c) from common.h to init.h Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com> Reviewed-by: Masahiro Yamada <yamada.masahiro@socionext.com>
* common: board_f: vid: Add VID specific API to adjust core voltageRajesh Bhagat2018-01-231-0/+3
| | | | | | | | | | | | Adds a VID specific API in init_sequence_f and spl code flow namely init_func_vid which is required to adjust core voltage. VID specific code is required in spl, hence moving flag CONFIG_VID out of spl flags. Signed-off-by: Ashish Kumar <Ashish.Kumar@nxp.com> Signed-off-by: Rajesh Bhagat <rajesh.bhagat@nxp.com> Reviewed-by: York Sun <york.sun@nxp.com>
* Move debug and logging support to a separate headerSimon Glass2017-12-071-45/+1
| | | | | | | | Before adding new features, move these definitions to a separate header to avoid further cluttering common.h. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
* spl: make CONFIG_OF_EMBED pass dts through fdtgrepGoldschmidt Simon2017-11-291-0/+1
| | | | | | | | | | | | | | | | Building spl with CONFIG_OF_EMBED enabled results in an error message on my board: "SPL image too big". This is because the fdtgrep build step is only executed for CONFIG_OF_SEPARATE. Fix this by moving the fdtgrep build step ('cmd_fdtgreo') from scripts/Makefile.spl to dts/Makefile so that the reduced dtb is available for all kinds of spl builds. The resulting variable name for the embedded device tree blob changes, too, which is why common.h and fdtdec.c have tiny changes. Signed-off-by: Simon Goldschmidt <sgoldschmidt@de.pepperl-fuchs.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* common: Add a prototype for s_init()Diego Dorta2017-10-161-0/+2
| | | | | | | | | | When compiling with W=1 the following warning is observed: arch/arm/mach-imx/mx6/soc.c:590:6: warning: no previous prototype for ‘s_init’ [-Wmissing-prototypes] void s_init(void) Remove this warning by adding the function prototype into include/common.h file. Signed-off-by: Diego Dorta <diego.dorta@nxp.com>
* gzip: add a function to parse the headerJean-Jacques Hiblot2017-10-051-0/+1
| | | | | | Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com> Reviewed-by: Tom Rini <trini@konsulko.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* bug.h: move runtime BUG/WARN macros into <linux/bug.h>Masahiro Yamada2017-10-041-8/+1
| | | | | | | Collect runtime BUG/WARN into a self-contained header <linux/bug.h> to make these macros easier to use. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
* common.h: remove error()Masahiro Yamada2017-10-041-5/+0
| | | | | | | | | | This macro prevents us from using compiletime_error/assert defined in <linux/compiler.h>. Now we can remove it, then we will be able to import more BUILD_BUG macros from Linux. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
* printk: collect printk stuff into <linux/printk.h> with loglevel supportMasahiro Yamada2017-10-041-5/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When we import code from Linux, with regular re-sync planned, we want to use printk() and pr_*(). U-Boot does not support them in a clean way. So, people end up with local macros, or compat headers here and there, then we occasionally see build errors of definition conflicts. We have include/linux/compat.h, but putting all sorts of unrelated things into a single header is just a temporal workaround. Hence this patch, to find the best home for all printk variants. If you want to use printk() and friends, please include <linux/printk.h>. This header is self-contained, and pulls in only a few headers. When I was testing this clean-up, I noticed the image size exceeded its platform limit on some boards. This is because all pr_*() that were previously defined as no-op in include/linux/mtd/mtd.h (unless CONFIG_MTD_DEBUG is set), are now enabled. To make such boards happy, this commit also implements CONFIG_LOGLEVEL. The concept is similar to the kernel parameter "loglevel". (Actually, the Kconfig help message was taken from kernel-paremeter.txt of Linux) Messages with a loglevel smaller than console loglevel will be printed. The difference is the loglevel is build-time determined. To save the image size, lower priority pr_*() are compiled out. I set the default of CONFIG_LOGLEVEL to 6, i.e. pr_notice and higher priority messages are compiled in. I adjusted CONFIG_LOGLEVEL to avoid build error for some boards. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> [trini: Add in SPL_LOGLEVEL that is the same as LOGLEVEL] Signed-off-by: Tom Rini <trini@konsulko.com>
* stdio.h: move printf() stuff from <common.h> to <stdio.h>Masahiro Yamada2017-10-041-40/+1
| | | | | | | | | | <common.h> pulls in a lot of headers. Including it from every .c file is a bad idea. We need to remove contents until it contains nothing. Move printf() and friends to <stdio.h>. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
* env: Rename some other getenv()-related functionsSimon Glass2017-08-161-1/+1
| | | | | | | | | | | | | | We are now using an env_ prefix for environment functions. Rename these other functions as well, for consistency: getenv_vlan() getenv_bootm_size() getenv_bootm_low() getenv_bootm_mapsize() env_get_default() Suggested-by: Wolfgang Denk <wd@denx.de> Signed-off-by: Simon Glass <sjg@chromium.org>
* env: Rename getenv_hex(), getenv_yesno(), getenv_ulong()Simon Glass2017-08-161-4/+15
| | | | | | | | We are now using an env_ prefix for environment functions. Rename these for consistency. Also add function comments in common.h. Suggested-by: Wolfgang Denk <wd@denx.de> Signed-off-by: Simon Glass <sjg@chromium.org>
* env: Rename getenv/_f() to env_get()Simon Glass2017-08-161-7/+25
| | | | | | | | | | | 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 <wd@denx.de> Signed-off-by: Simon Glass <sjg@chromium.org>
* env: Rename common functions related to setenv()Simon Glass2017-08-161-5/+21
| | | | | | | | | We are now using an env_ prefix for environment functions. Rename these commonly used functions, for consistency. Also add function comments in common.h. Suggested-by: Wolfgang Denk <wd@denx.de> Signed-off-by: Simon Glass <sjg@chromium.org>
* env: Rename setenv() to env_set()Simon Glass2017-08-161-1/+13
| | | | | | | | 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 <wd@denx.de> Signed-off-by: Simon Glass <sjg@chromium.org>
* env: Drop saveenv() in favour of env_save()Simon Glass2017-08-151-1/+0
| | | | | | | | | Use the env_save() function directly now that there is only one implementation of saveenv(). Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Wolfgang Denk <wd@denx.de> Reviewed-by: Tom Rini <trini@konsulko.com>
* common: board_f: Make reserve_mmu a weak functionSiva Durga Prasad Paladugu2017-08-021-0/+1
| | | | | | | | | Make reserve_mmu a weak so that it provides an option to customize this routine as per platform need Signed-off-by: Siva Durga Prasad Paladugu <sivadur@xilinx.com> Signed-off-by: Michal Simek <michal.simek@xilinx.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* board_f: Add new function to allow runtime DTB selectionCooper Jr., Franklin2017-07-101-0/+4
| | | | | | | | | | | | Runtime U-boot dtb selection is generally a two step process. First step is to simply use an initial generic dtb. The second step is to select the dtb and perhaps execute additional code ones U-boot knows what board it is running on. Embedded_dtb_select handles the second step by allowing board specific code to run and perform what ever necessary configuration that is needed. Signed-off-by: Franklin S Cooper Jr <fcooper@ti.com> Reviewed-by: Tom Rini <trini@konsulko.com>
* serial: make serial_stub_* to static functionsMasahiro Yamada2017-07-061-5/+0
| | | | | | | | | | Add missing static to serial_stub_puts(). Unexport serial_stub_{getc,tstc} because they are used locally. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* common: microblaze: Drop arch-specific declarationsSimon Glass2017-06-051-5/+0
| | | | | | These are not needed and should not be in common.h. Drop them. Signed-off-by: Simon Glass <sjg@chromium.org>
* common: arm: freescale: layerscape: Move header files out of common.hSimon Glass2017-06-051-7/+0
| | | | | | | We should not have an arch-specific header file in common.h. Adjust the board files a little so it is not needed, and drop it. Signed-off-by: Simon Glass <sjg@chromium.org>
* common: arm: davinci: Move header file out of commonSimon Glass2017-06-051-3/+0
| | | | | | | | | We should not have an arch-specific header file in common.h. Instead, use the asm/hardware.h header to provide the required declarations, and drop the common.h changes. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@konsulko.com>
* common: ep93xx: Move arch-specific declarations out of commonSimon Glass2017-06-051-10/+0
| | | | | | | These declarations should not be in common. Remove those that are not needed and move the others to an arch-specific location. Signed-off-by: Simon Glass <sjg@chromium.org>
* common: freescale: Move arch-specific imx code to arch-imxSimon Glass2017-06-051-9/+0
| | | | | | | These declarations should not be in common.h. Move them to an arch-specific header. Signed-off-by: Simon Glass <sjg@chromium.org>
* common: freescale: Move arch-specific declarationsSimon Glass2017-06-051-95/+1
| | | | | | | | | The declarations should not be in common.h. Move them to the arch-specific headers. Signed-off-by: Simon Glass <sjg@chromium.org> [trini: Fixup thinko defined(FSL_LSCH3) -> defined(CONFIG_FSL_LSCH3)] Signed-off-by: Tom Rini <trini@konsulko.com>
* common: powerpc: Move arch-specific headersSimon Glass2017-06-051-43/+1
| | | | | | | | Set up a new asm/ppc.h header file to hold this arch-specific stuff. It should not be in common.h. It probably should be refactored to use asm/arch instead, but that is a job for the maintainer. Signed-off-by: Simon Glass <sjg@chromium.org>
* common: Move PPC4xx_SYS_INFO() et al to arch-specific headerSimon Glass2017-06-051-6/+0
| | | | | | | These definitions should not be in common.h. Move them to an arch-specific header file. Signed-off-by: Simon Glass <sjg@chromium.org>
* common: Drop determine_sysper() and determine_pci_clock_per()Simon Glass2017-06-051-6/+0
| | | | | | These arch-specific declarations should not be in common.h. Drop them. Signed-off-by: Simon Glass <sjg@chromium.org>
* common: Drop cpu_init_f() declarationsSimon Glass2017-06-051-11/+0
| | | | | | These arch-specific functions are not needed here. Signed-off-by: Simon Glass <sjg@chromium.org>
* arm: Remove include files from common.hSimon Glass2017-06-051-6/+0
| | | | | | | With a small tweak we can avoid including these files for all boards. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@konsulko.com>
* nds32: Remove include files from common.hSimon Glass2017-06-051-5/+0
| | | | | | | With a few tweaks we can avoid including these files, which are only needed by two C files. Signed-off-by: Simon Glass <sjg@chromium.org>
* x86: Don't include asm/u-boot.h in commonSimon Glass2017-06-051-3/+0
| | | | | | | With a small fixup to u-boot-x86.h, this is not actually needed anywhere, so drop it. Signed-off-by: Simon Glass <sjg@chromium.org>
* sandbox: Don't include asm/u-boot.h in commonSimon Glass2017-06-051-3/+0
| | | | | | This is not actually needed anywhere, so drop it. Signed-off-by: Simon Glass <sjg@chromium.org>
* mips: Don't include asm/u-boot.h in commonSimon Glass2017-06-051-3/+0
| | | | | | | This is not actually needed anywhere, so drop it. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
* arc: Don't include asm/u-boot.h in commonSimon Glass2017-06-051-3/+0
| | | | | | This is not actually needed anywhere, so drop it. Signed-off-by: Simon Glass <sjg@chromium.org>
* nds32: Make u-boot-nds32.h a private headerSimon Glass2017-06-051-1/+1
| | | | | | | Rather than including this arch-specific header file in common.h, include it from within nds32's u-boot.h header. Signed-off-by: Simon Glass <sjg@chromium.org>