summaryrefslogtreecommitdiff
path: root/include/asm-generic
Commit message (Collapse)AuthorAgeFilesLines
* common: Drop linux/bitops.h from common headerWIP/2020-05-18-reduce-size-of-common.hSimon Glass2020-05-181-0/+1
| | | | | | Move this uncommon header out of the common header. Signed-off-by: Simon Glass <sjg@chromium.org>
* common: Drop image.h from common headerSimon Glass2020-05-181-0/+1
| | | | | | Move this uncommon header out of the common header. Signed-off-by: Simon Glass <sjg@chromium.org>
* board: Add a gd flag for chain loadingSimon Glass2020-04-301-0/+1
| | | | | | | | | | | When U-Boot is run from another boot loader, much of the low-level init needs to be skipped. Add a flag for this and adjust ll_boot_init() to use it. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Peng Fan <peng.fan@nxp.com> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
* gpio: add ops to set dir flagsPatrick Delaunay2020-04-161-0/+16
| | | | | | | | | | | | | | | | | | | Add the ops for GPIO driver set_dir_flags() to set the dir flags. The user can update the direction and configuration of each GPIO with a only call to dm_gpio_set_dir_flags() or dm_gpio_set_dir() and respecting the configuration provided by device tree (saved in desc->flags). When these optional ops are absent, the gpio uclass use the mandatory ops (direction_output, direction_input, get_value) and desc->flags to manage only the main dir flags: - GPIOD_IS_IN - GPIOD_IS_OUT - GPIOD_IS_OUT_ACTIVE - GPIOD_ACTIVE_LOW Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* gpio: add ops to get dir flagsPatrick Delaunay2020-04-161-0/+15
| | | | | | | | | | | | | | | | | Add the ops for GPIO driver get_dir_flags(), allows to get dynamically the current gpio configuration; it is used by the API function dm_gpio_get_dir_flags(). When these optional ops are absent, the gpio uclass continues to use the mandatory ops (direction_output, direction_input, get_value) and value of desc->flags to manage only the main dir flags: - GPIOD_IS_IN - GPIOD_IS_OUT - GPIOD_IS_OUT_ACTIVE - GPIOD_ACTIVE_LOW Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* gpio: add support of new GPIO direction flagPatrick Delaunay2020-04-161-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | This commit manages the new dir flags that can be used in gpio specifiers to indicate the pull-up or pull-down resistor configuration for output gpio (GPIO_PULL_UP, GPIO_PULL_DOWN) or the Open Drain/Open Source configuration for input gpio (GPIO_OPEN_DRAIN, GPIO_OPEN_SOURCE). These flags are already supported in Linux kernel in gpio lib. This patch only parse and save the direction flags in GPIO descriptor (desc->flags), it prepares the introduction of new ops to manage them. The GPIO uclass supports new GPIO flags from device-tree (GPIO_XXX define in include/dt-bindings/gpio/gpio.h) and translate them in the dir flags (GPIOD_XXX): - GPIO_PULL_UP => GPIOD_PULL_UP - GPIO_PULL_DOWN => GPIOD_PULL_DOWN - GPIO_OPEN_DRAIN => GPIOD_OPEN_DRAIN - GPIO_OPEN_SOURCE => GPIOD_OPEN_SOURCE This patch also adds protection in the check_dir_flags function for new invalid configuration of the dir flags. Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* gpio: update dir_flags managementPatrick Delaunay2020-04-161-6/+16
| | | | | | | | | | | | | | Update the flag management in GPIO uclass: the desc->flags is always combined with the requested flags and the GPIO descriptor is updated for further call. Add a function dm_gpio_get_dir_flags to get dynamically the current dir_flags (configuration and value). This patch prepare introduction of the dir flags support with new ops. Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* gpio: add helper GPIOD_FLAGS_OUTPUTPatrick Delaunay2020-04-161-0/+6
| | | | | | | | Add a macro to provide the GPIO output value according the dir flags content. Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* gpio: remove the open_drain API and opsPatrick Delaunay2020-04-161-34/+0
| | | | | | | | | | | | | | This patch removes the ops get_open_drain/set_open_drain and the API dm_gpio_get_open_drain/dm_gpio_set_open_drain. The ops only provided in one driver (mpc8xxx gpio) and the associated API is never called in boards. This patch prepare a more generic set/get_dir_flags ops, including the open drain property. Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
* gpio: remove GPIOD_REQUESTEDPatrick Delaunay2020-04-161-5/+4
| | | | | | | | Remove the define GPIOD_REQUESTED as it is never used and use BIT() macro for other defines. Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* asm-generic/u-boot.h: make <asm-generic/u-boot.h> self-containedMasahiro Yamada2020-03-161-0/+2
| | | | | | | | This header uses 'phys_addr_t' and 'ulong'. Include the definitions. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> [trini: Move include to below __ASSEMBLY__ test] Signed-off-by: Tom Rini <trini@konsulko.com>
* global_data.h: make <asm-generic/global_data.h> self-containedMasahiro Yamada2020-03-161-1/+1
| | | | | | | | The compiler never knows what 'bd_t' is without including <asm/u-boot.h>. By changing it to (struct bd_info), the compiler learns it is struct. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
* gpio: Rename free() to rfree()Simon Glass2020-02-051-1/+1
| | | | | | | | This function name conflicts with our desire to #define free() to something else on sandbox. Since it deals with resources, rename it to rfree(). Signed-off-by: Simon Glass <sjg@chromium.org>
* global_data: remove unused mxc_i2c specific fieldBaruch Siach2020-01-271-3/+0
| | | | | | | | | The srdata field is unused since commit 71204e95ce13228 ("i2c: mxc: refactor i2c driver and support dm"). Cc: Peng Fan <peng.fan@nxp.com> Signed-off-by: Baruch Siach <baruch@tkos.co.il> Reviewed-by: Peng Fan <peng.fan@nxp.com>
* Include missing headers for asm-generic/sections.hSean Anderson2020-01-151-0/+2
| | | | | | | asm-generic/sections.h references ulong but does not include linux/types.h Signed-off-by: Sean Anderson <seanga2@gmail.com>
* global_data: Remove comment of reserved arch-specific GD flagsStefan Roese2019-08-181-1/+1
| | | | | | | | | | | | | | | | | | | With the removal of the x86 specific GD flags, there are no arch- specific GD flags any more. Let's remove the comment about reserving the upper 16 bits for arch-specific flags in the common header. This gives us more flexibility with the usage of the GD flags. As a matter of fact, we are already using more than 16 bits for common GD flags (with the addition of GD_FLG_WDT_READY). Signed-off-by: Stefan Roese <sr@denx.de> Cc: Bin Meng <bmeng.cn@gmail.com> Cc: Simon Glass <sjg@chromium.org> Cc: Tom Rini <trini@konsulko.com> Cc: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* Merge tag 'video-for-2019.10-rc1' of ↵WIP/30Jul2019Tom Rini2019-07-301-1/+1
|\ | | | | | | | | | | | | | | | | | | https://gitlab.denx.de/u-boot/custodians/u-boot-video - fix EDID mode filtering - extend mxc_ipuv3_fb to enable backlight/display - include fb_base in global_data for DM_VIDEO - show frame buffer address via board info as used to be with legacy VIDEO support
| * global_data: enable fb_base for DM_VIDEOHeiko Schocher2019-07-301-1/+1
| | | | | | | | | | | | | | | | with CONFIG_VIDEO we store fb base address in global data fb_base variable. Do this also in DM_VIDEO case. Signed-off-by: Heiko Schocher <hs@denx.de>
* | gpio: fixes for gpio-hog supportHeiko Schocher2019-07-291-5/+7
|/ | | | | | | | recently added gpio hog patch was "in discussion" state with Simon Glass. This patch now adds most of comments from Simon Glass. Signed-off-by: Heiko Schocher <hs@denx.de>
* Merge tag 'u-boot-imx-20190719' of ↵Tom Rini2019-07-271-1/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | https://gitlab.denx.de/u-boot/custodians/u-boot-imx u-boot-imx-20190719 - CCF for i.MX6 - nandbcb command to write SPL into NAND - Switch to DM (i.MX28) - Boards: Toradex, engicam, DH - Fixes for i.MX8 - Fixes for i.MX7ULP Travis: https://travis-ci.org/sbabic/u-boot-imx/builds/561147504
| * watchdog: Split WDT from SPL_WDTMarek Vasut2019-07-191-1/+1
| | | | | | | | | | | | | | | | | | | | | | Use CONFIG_IS_ENABLED(WDT) to permit use of WDT in SPL without DM, while the full U-Boot can use rich DM/DT WDT driver. Signed-off-by: Marek Vasut <marex@denx.de> Cc: Peng Fan <Peng.Fan@freescale.com> Cc: Stefano Babic <sbabic@denx.de> Tested-by: Heiko Schocher <hs@denx.de> Tested-by: Suniel Mahesh <sunil.m@techveda.org>
* | efi_loader: use predefined constants in crt0_*_efi.SHeinrich Schuchardt2019-07-161-0/+16
|/ | | | | | | | | | | We should use predefined constants instead of magic numbers. Move some constant definitions from include/pe.h to include/asm-generic/pe.h. Use these constants in crt0_*_efi.S. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
* gpio: add gpio-hog supportHeiko Schocher2019-07-131-0/+32
| | | | | | | | | | | | | add gpio-hog support. GPIO hogging is a mechanism providing automatic GPIO request and configuration as part of the gpio-controller's driver probe function. for more infos see: doc/device-tree-bindings/gpio/gpio.txt Signed-off-by: Heiko Schocher <hs@denx.de> Tested-by: Michal Simek <michal.simek@xilinx.com> (zcu102) Tested-by: Patrick Delaunay <patrick.delaunay@st.com>
* watchdog: Implement generic watchdog_reset() versionStefan Roese2019-04-261-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch tries to implement a generic watchdog_reset() function that can be used by all boards that want to service the watchdog device in U-Boot. This watchdog servicing is enabled via CONFIG_WATCHDOG. Without this approach, new boards or platforms needed to implement a board specific version of this functionality, mostly copy'ing the same code over and over again into their board or platforms code base. With this new generic function, the scattered other functions are now removed to be replaced by the generic one. The new version also enables the configuration of the watchdog timeout via the DT "timeout-sec" property (if enabled via CONFIG_OF_CONTROL). This patch also adds a new flag to the GD flags, to flag that the watchdog is ready to use and adds the pointer to the watchdog device to the GD. This enables us to remove the global "watchdog_dev" variable, which was prone to cause problems because of its potentially very early use in watchdog_reset(), even before the BSS is cleared. Signed-off-by: Stefan Roese <sr@denx.de> Cc: Heiko Schocher <hs@denx.de> Cc: Tom Rini <trini@konsulko.com> Cc: Michal Simek <michal.simek@xilinx.com> Cc: "Marek Behún" <marek.behun@nic.cz> Cc: Daniel Schwierzeck <daniel.schwierzeck@gmail.com> Cc: Maxim Sloyko <maxims@google.com> Cc: Erik van Luijk <evanluijk@interact.nl> Cc: Ryder Lee <ryder.lee@mediatek.com> Cc: Weijie Gao <weijie.gao@mediatek.com> Cc: Simon Glass <sjg@chromium.org> Cc: "Álvaro Fernández Rojas" <noltari@gmail.com> Cc: Philippe Reynes <philippe.reynes@softathome.com> Cc: Christophe Leroy <christophe.leroy@c-s.fr> Reviewed-by: Michal Simek <michal.simek@xilinx.com> Tested-by: Michal Simek <michal.simek@xilinx.com> (on zcu100)
* dm: core: Change platform specific translation-offset handlingStefan Roese2019-04-231-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | Testing has shown that the current DM implementation of a platform / board specific translation offset, as its needed for the SPL on MVEBU platforms is buggy. The translation offset is confingured too late, after the driver bind functions are run. This may result in incorrect address translations. With the current implementation its not possible to configure the offset earlier, as the DM code has not run at all. This patch now removed the set_/get_translation_offset() calls and moves the translation offset into the GD variable translation_offset. This variable will get used when CONFIG_TRANSLATION_OFFSET is enabled. This option is enabled only for MVEBU on ARM32 platforms, where its currenty needed and configured in the SPL. Signed-off-by: Stefan Roese <sr@denx.de> Cc: Pierre Bourdon <delroth@gmail.com> Cc: Baruch Siach <baruch@tkos.co.il> Cc: Simon Glass <sjg@chromium.org> Cc: Heiko Schocher <hs@denx.de> Cc: Tom Rini <trini@konsulko.com> Tested-by: Pierre Bourdon <delroth@gmail.com> Tested-by: Baruch Siach <baruch@tkos.co.il>
* lib: fdtdec: Add function re-setup the fdt more effecientlyJean-Jacques Hiblot2018-12-101-0/+4
| | | | | | | | | | | | | | | In some cases it may be useful to be able to change the fdt we have been using and use another one instead. For example, the TI platforms uses an EEPROM to store board information and, based on the type of board, different dtbs are used by the SPL. When DM_I2C is used, a first dtb must be used before the I2C is initialized and only then the final dtb can be selected. To speed up the process and reduce memory usage, introduce a new function fdtdec_setup_best_match() that re-use the DTBs loaded in memory by fdtdec_setup() to select the best match. Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com> Reviewed-by: Heiko Schocher <hs@denx.de>
* pe.h: Add characteristics definesBin Meng2018-12-021-0/+18
| | | | | | | | | | | This adds characteristics macros as defined by the Microsoft PE Format documentation [1]. [1] https://docs.microsoft.com/zh-cn/windows/desktop/Debug/pe-format Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
* spl: Add support for passing handoff info to U-Boot properSimon Glass2018-11-261-0/+3
| | | | | | | | | | | | | There is some basic informaton that SPL normally wants to pass through to U-Boot, such as the SDRAM size and bank information. Mkae use of the new bloblist structure for this. Add a new 'handoff' blob which is set up in SPL and passed to U-Boot proper. Also adda test for sandbox_spl that checks that this works correctly and a new 'sb' command to show the information passed from SPL. Reviewed-by: Tom Rini <trini@konsulko.com> Signed-off-by: Simon Glass <sjg@chromium.org>
* bloblist: Locate bloblist in U-BootSimon Glass2018-11-261-0/+4
| | | | | | | | Add support for locating a bloblist in U-Boot that has been set up by SPL. It is copied into RAM during relocation. Reviewed-by: Tom Rini <trini@konsulko.com> Signed-off-by: Simon Glass <sjg@chromium.org>
* Add include/asm-generic/atomic.hChris Packham2018-09-251-0/+150
| | | | | | | | | | The arm, xtensa and mips version of atomic.h were already very similar (the mips one was a copy of xtensa). Combine these implementations together to produce a generic atomic.h that can be included by these architectures (and any others that need it in future). Signed-off-by: Chris Packham <judge.packham@gmail.com> Reviewed-by: Tom Rini <trini@konsulko.com>
* arch: types.h: factor out fixed width typedefs to int-ll64.hMasahiro Yamada2018-09-102-0/+56
| | | | | | | | | | | | | All architectures have the same definition for s8/16/32/64 and u8/16/32/64. Factor out the duplicated code into <asm-generic/int-ll64.h>. BTW, Linux unified the kernel space definition into int-ll64.h a few years ago as you see in Linux commit 0c79a8e29b5f ("asm/types.h: Remove include/asm-generic/int-l64.h"). Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
* u-boot: remove driver lookup loop from env_save()Nicholas Faustini2018-07-301-1/+1
| | | | | | | | | | | | | | | | When called with ENVOP_SAVE, env_get_location() only returns the gd->env_load_location variable without actually checking for the environment location and priority. This behaviour causes env_save() to fall into an infinite loop when the low-level drv->save() call fails. The env_save() function should not loop through the environment location list but it should save the environment into the location stored in gd->env_load_location by the last env_load() call. Signed-off-by: Nicholas Faustini <nicholas.faustini@azcomtech.com> Reviewed-by: Simon Goldschmidt <sgoldschmidt@de.pepperl-fuchs.com>
* fdt: Add device tree memory bindingsMichael Pratt2018-07-091-0/+1
| | | | | | | | | | | | | | Support a default memory bank, specified in reg, as well as board-specific memory banks in subtree board-id nodes. This allows memory information to be provided in the device tree, rather than hard-coded in, which will make it simpler to handle similar devices with different memory banks, as the board-id values or masks can be used to match devices. Signed-off-by: Michael Pratt <mpratt@chromium.org> Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
* efi_loader: allow unaligned memory accessHeinrich Schuchardt2018-06-031-0/+3
| | | | | | | | | | | The UEFI spec mandates that unaligned memory access should be enabled if supported by the CPU architecture. This patch adds an empty weak function unaligned_access() that can be overridden by an architecture specific routine. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
* SPDX: Convert a few files that were missed beforeTom Rini2018-05-101-2/+1
| | | | | | | | | | | As part of the main conversion a few files were missed. These files had additional whitespace after the '*' and before the SPDX tag and my previous regex was too strict. This time I did a grep for all SPDX tags and then filtered out anything that matched the correct styles. Fixes: 83d290c56fab ("SPDX: Convert all of our single license tags to Linux Kernel style") Reported-by: Heinrich Schuchardt <xypron.debian@gmx.de> Signed-off-by: Tom Rini <trini@konsulko.com>
* SPDX: Convert all of our single license tags to Linux Kernel styleTom Rini2018-05-075-9/+5
| | | | | | | | | | | | | | | | | | | | 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>
* powerpc: mpc8xx: Change CONFIG_8xx to CONFIG_MPC8xxChristophe Leroy2018-04-061-1/+1
| | | | | | | | | CONFIG_8xx doesn't mean much outside of arch/powerpc/ This patch renames it CONFIG_MPC8xx just like CONFIG_MPC85xx etc ... It also renames 8xx_immap.h to immap_8xx.h to be consistent with other file names. Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
* env: Fix env_load_locationYork Sun2018-02-161-0/+1
| | | | | | | | | | | | | Commit 7d714a24d725 ("env: Support multiple environments") added static variable env_load_location. When saving environmental variables, this variable is presumed to have the value set before. In case the value was set before relocation and U-Boot runs from a NOR flash, this variable wasn't writable. This causes failure when saving the environment. To save this location, global data must be used instead. Signed-off-by: York Sun <york.sun@nxp.com> CC: Maxime Ripard <maxime.ripard@free-electrons.com>
* efi_loader: fix building crt0 on armHeinrich Schuchardt2018-02-101-0/+21
| | | | | | | | | | | | | | | | | | | | | | Before the patch an undefined constant EFI_SUBSYSTEM was used in the crt0 code. The current version of binutils does not swallow the error. https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=888403 The necessary constant IMAGE_SUBSYSTEM_EFI_APPLICATION is already defined in pe.h. So let's factor out asm-generic/pe.h for the image subsystem constants and use it in our assembler code. IMAGE_SUBSYSTEM_SAL_RUNTIME_DRIVER does not exist in the specification let's use IMAGE_SUBSYSTEM_EFI_ROM instead. The include pe.h is only used in code maintained by Alex so let him be the maintainer here too. Reported-by: Andre Przywara <andre.przywara@arm.com> Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Tested-by: Vagrant Cascadian <vagrant@debian.org> Signed-off-by: Alexander Graf <agraf@suse.de>
* log: Add control over log formattingSimon Glass2018-02-031-0/+1
| | | | | | | | | It is useful to be able to control the output format of log records on the console. As a starting point, add definitions for controlling which elements of the log record are displayed. Use function and message as the default, since these are the most useful fields. Signed-off-by: Simon Glass <sjg@chromium.org>
* atomic-long: Fix warnings on arm64Bradley Bolen2018-01-281-0/+2
| | | | | | | | | | | | | | | | | Several inline functions in this file reference undefined functions in U-Boot. For example: atomic-long.h:73:9: warning: implicit declaration of function 'atomic64_sub_and_test' atomic-long.h:80:9: warning: implicit declaration of function 'atomic64_dec_and_test' atomic-long.h:87:9: warning: implicit declaration of function 'atomic64_inc_and_test' Handle this the same as the 32 bit build by wrapping these functions in a __UBOOT__ check. Signed-off-by: Bradley Bolen <bradleybolen@gmail.com>
* env: Initialise all the environmentsMaxime Ripard2018-01-271-0/+1
| | | | | | | | | | | | Since we want to have multiple environments, we will need to initialise all the environments since we don't know at init time what drivers might fail when calling load. Let's init all of them, and only consider for further operations the ones that have not reported any errors at init time. Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
* log: Plumb logging into the init sequenceSimon Glass2017-12-071-0/+1
| | | | | | | Set up logging both before and after relocation. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
* log: Add an implementation of loggingSimon Glass2017-12-071-0/+5
| | | | | | | Add the logging header file and implementation with some configuration options to control it. Signed-off-by: Simon Glass <sjg@chromium.org>
* Drop the log bufferSimon Glass2017-12-071-1/+1
| | | | | | | | This does not appear to be used by any boards. Before introducing a new log system, remove this old one. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
* Provide a generic io.h & address mapping functionsPaul Burton2017-10-021-0/+110
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Most architectures currently supported by U-Boot use trivial implementations of map_to_physmem & virt_to_phys which simply cast a physical address to a pointer for use a virtual address & vice-versa. This results in a lot of duplicate implementations of these mapping functions. The set of functions provided by different architectures also differs, with some having implementations of phys_to_virt & others not. A later patch will make use of phys_to_virt in architecture-neutral code, and so requires that it be provided for all architectures. This patch introduces an asm-generic/io.h which provides generic implementations of address mapping functions, allowing the duplication of them between architectures to be removed. Once architectures are converted to make use of this generic header it will also ensure that all of phys_to_virt, virt_to_phys, map_physmem & unmap_physmem are provided. The 2 families of functions differ in that map_physmem may create dynamic mappings whilst phys_to_virt may not & therefore is more limited in scope but doesn't require information such as a length & flags. This patch doesn't convert any architectures to make use of this generic header - later patches in the series will do so. Signed-off-by: Paul Burton <paul.burton@imgtec.com> Cc: Albert Aribaud <albert.u.boot@aribaud.net> Cc: Alexey Brodkin <alexey.brodkin@synopsys.com> Cc: Angelo Dureghello <angelo@sysam.it> Cc: Bin Meng <bmeng.cn@gmail.com> Cc: Daniel Schwierzeck <daniel.schwierzeck@gmail.com> Cc: Macpaul Lin <macpaul@andestech.com> Cc: Michal Simek <monstr@monstr.eu> Cc: Nobuhiro Iwamatsu <iwamatsu@nigauri.org> Cc: Thomas Chou <thomas@wytron.com.tw> Cc: Wolfgang Denk <wd@denx.de> Acked-by: Angelo Dureghello <angelo@sysam.it> Tested-by: Angelo Dureghello <angelo@sysam.it> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
* efi_loader: rename __efi_hello_world_*Heinrich Schuchardt2017-09-181-2/+2
| | | | | | | | | | | | | | | | In scripts/Makefile.lib we build section including helloworld.efi. This allows to load the EFI binary with command 'bootefi hello'. scripts/Makefile.lib contains explicit references to strings containing helloworld and hello_world. This makes it impossible to generalize the coding to accomodate additional built in EFI binaries. Let us rename the variables __efi_hello_world_* to __efi_helloworld_*. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
* env: Rename getenv/_f() to env_get()Simon Glass2017-08-161-1/+1
| | | | | | | | | | | 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: Add an enum for environment stateSimon Glass2017-08-151-1/+1
| | | | | | | | At present we have three states for the environment, numbered 0, 1 and 2. Add an enum to record this to avoid open-coded values. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@konsulko.com>
* spl: make SPL and normal u-boot stage use independent SYS_MALLOC_F_LENAndy Yan2017-07-271-1/+1
| | | | | | | | | | | | | | | | | Some platforms have very limited SRAM to run SPL code, so there may not be the same amount space for a malloc pool before relocation in the SPL stage as the normal U-Boot stage. Make SPL and (the full) U-Boot stage use independent SYS_MALLOC_F_LEN, so the size of pre-relocation malloc pool can be configured memory space independently. Signed-off-by: Andy Yan <andy.yan@rock-chips.com> Reviewed-by: Tom Rini <trini@konsulko.com> Acked-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com> Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com> [fixed up commit-message:] Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>