summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* env: Rename getenv_hex(), getenv_yesno(), getenv_ulong()Simon Glass2017-08-1625-59/+70
| | | | | | | | 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-16213-502/+531
| | | | | | | | | | | 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 eth_setenv_enetaddr() to eth_env_set_enetaddr()Simon Glass2017-08-1658-83/+83
| | | | | | Rename this function for consistency with env_set(). Signed-off-by: Simon Glass <sjg@chromium.org>
* env: Rename common functions related to setenv()Simon Glass2017-08-1637-63/+79
| | | | | | | | | 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-16156-454/+470
| | | | | | | | 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-159-15/+20
| | | | | | | | | 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>
* env: Drop env_relocate_spec() in favour of env_load()Simon Glass2017-08-159-14/+14
| | | | | | | | | This is a strange name for a function that loads the environment. There is now only one implementation of this function, so use the new env_load() function directly instead. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@konsulko.com>
* env: Drop env_get_char_spec()Simon Glass2017-08-153-24/+13
| | | | | | | | We only have a single implementation of this function now and it is called env_get_char(). Drop the old function and the weak version. Reviewed-by: Tom Rini <trini@konsulko.com> Signed-off-by: Simon Glass <sjg@chromium.org>
* env: Drop env_init_new()Simon Glass2017-08-151-5/+1
| | | | | | | | Now that env_init() is only defined once we can drop the env_init_new() name and just use env_init(). Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@konsulko.com>
* env: Drop unused env_ptr variablesSimon Glass2017-08-158-21/+0
| | | | | | | | | | | | | | This variable is declared as a global in most environment location drivers. But it is not used outside the drivers and most of the declarations are unnecessary. Also some drivers call free() on env_ptr which seems wrong since it is not in the heap. Drop the variable where possible, and all calls to free(). Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@konsulko.com>
* env: Drop the env_name_spec globalSimon Glass2017-08-1517-32/+32
| | | | | | | | Add a name to the driver and use that instead of the global variable declared by each driver. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@konsulko.com>
* env: Drop common init() functionsSimon Glass2017-08-1513-128/+12
| | | | | | | | | Most of the init() implementations just use the default environment. Adjust env_init_new() to do this automatically, and drop the redundant code. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@konsulko.com>
* env: Switch over to use environment location driversSimon Glass2017-08-1515-114/+128
| | | | | | | | Move over to use a the master implementation of the location drivers, with each method calling out to the appropriate driver. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@konsulko.com>
* env: Add a new implementation of environment accessSimon Glass2017-08-152-1/+146
| | | | | | | | We plan to move to a environment access via drivers for each location where the environment can be stored. Add an implementation for this. So far it is not used, but will be pressed into service in a future patch. Signed-off-by: Simon Glass <sjg@chromium.org>
* env: Convert CONFIG_ENV_IS_IN... to a choiceSimon Glass2017-08-1542-61/+57
| | | | | | | | | | | | | | | | | | At present we support multiple environment drivers but there is not way to select between them at run time. Also settings related to the position and size of the environment area are global (i.e. apply to all locations). Until these limitations are removed we cannot really support more than one environment location. Adjust the location to be a choice so that only one can be selected. By default the environment is 'nowhere', meaning that the environment exists only in memory and cannot be saved. Also expand the help for the 'nowhere' option and move it to the top since it is the default. Signed-off-by: Simon Glass <sjg@chromium.org> [trini: Move all of the imply logic to default X if Y so it works again] Signed-off-by: Tom Rini <trini@konsulko.com>
* env: Create a location driver for each locationSimon Glass2017-08-1515-7/+246
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Set up a location driver for each supported environment location. At present this just points to the global functions and is not used. A later patch will switch this over to use private functions in each driver. There are several special cases here in various drivers to handle peculiarities of certain boards: 1. Some boards define CONFIG_ENV_IS_IN_FAT and CONFIG_SPL_ENV_SUPPORT but do not actually load the environment in SPL. The env load code was optimised out before but with the driver, it is not. Therefore a special case is added to env/fat.c. The correct fix (depending on board testing might be to disable CONFIG_SPL_ENV_SUPPORT. 2. A similar situations happens with CONFIG_ENV_IS_IN_FLASH. Some boards do not actually load the environment in SPL, so to reduce code size we need to drop that code. A similar fix may be possible with these boards, or it may be possible to adjust the environment CONFIG settings. Added to the above is that the CONFIG_SPL_ENV_SUPPORT option does not apply when the environment is in flash. Obviously the above has been discovered through painful and time-consuming trial and error. Hopefully board maintainers can take a look and figure out what is actually needed. Signed-off-by: Simon Glass <sjg@chromium.org>
* env: Rename nand env_location to nand_env_locationSimon Glass2017-08-151-3/+3
| | | | | | | | We want to use this name for all environment drivers. Update the nand driver to use a more specific name. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@konsulko.com>
* env: Add an enum for environment stateSimon Glass2017-08-1528-83/+104
| | | | | | | | 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>
* env: common: Drop env_get_char_memory()Simon Glass2017-08-151-7/+0
| | | | | | | | | This function is the same as env_get_char_spec() apart from dropping the brackets. Drop the brackets from env_get_char_spec() and use that instead of env_get_char_memory(). Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@konsulko.com>
* env: common: Drop env_get_char_init()Simon Glass2017-08-151-6/+1
| | | | | | | | This function does nothing but call env_get_char_spec(). Drop it and adjust its only caller. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@konsulko.com>
* env: common: Factor out the common env_valid checkSimon Glass2017-08-151-11/+6
| | | | | | | | | The check for gd->env_valid is used in both the 'if' and 'else' part of env_get_char(). Move it into that function instead for simplicity. Drop that code from the two leaf functions. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@konsulko.com>
* env: common: Drop env_get_addr()Simon Glass2017-08-151-8/+3
| | | | | | | | This function is not used anywhere other than env_get_char(). Move the code into that function. Reviewed-by: Tom Rini <trini@konsulko.com> Signed-off-by: Simon Glass <sjg@chromium.org>
* env: common: Make env_get_addr/get_char_memory() staticSimon Glass2017-08-152-13/+9
| | | | | | | | These functions are not used outside this file. Make them static and order them to avoid forward declarations. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@konsulko.com>
* env: Use tabs in ENV_IS_IN_FATSimon Glass2017-08-151-4/+3
| | | | | | Tidy up the formatting of this option. Signed-off-by: Simon Glass <sjg@chromium.org>
* Move environment files from common/ to env/Simon Glass2017-08-1543-520/+532
| | | | | | | | | About a quarter of the files in common/ relate to the environment. It seems better to put these into their own subdirectory and remove the prefix. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@konsulko.com>
* Makefile: Rename 'env' target to 'environ'Simon Glass2017-08-151-2/+2
| | | | | | | | This target stops us using 'env' as a subdirectory. It is not mentioned in the help so seems to be an internal target. Rename it. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@konsulko.com>
* Prepare v2017.09-rc2v2017.09-rc2Tom Rini2017-08-141-1/+1
| | | | Signed-off-by: Tom Rini <trini@konsulko.com>
* configs: Resync with savedefconfigTom Rini2017-08-14897-1582/+1559
| | | | | | Rsync all defconfig files using moveconfig.py Signed-off-by: Tom Rini <trini@konsulko.com>
* Merge git://git.denx.de/u-boot-netTom Rini2017-08-1410-2/+1571
|\
| * driver: net: ldpaa: Update priv->phydev after free()Prabhakar Kushwaha2017-08-141-1/+3
| | | | | | | | | | | | | | | | | | | | Even after memory free of phydev, priv is still pointing to the obsolete address. So update priv->phydev as NULL after memory free. Signed-off-by: Prabhakar Kushwaha <prabhakar.kushwaha@nxp.com> Signed-off-by: Ashish Kumar <Ashish.Kumar@nxp.com> Acked-by: Joe Hershberger <joe.hershberger@ni.com>
| * usb: net: Add support for Microchip LAN75xx and LAN78xxYuiko Oshino2017-08-147-0/+1542
| | | | | | | | | | | | | | | | Add support for Microchip LAN7500, LAN7800 and LAN7850, USB to 10/100/1000 Ethernet Controllers. Signed-off-by: Yuiko Oshino <yuiko.oshino@microchip.com> Acked-by: Joe Hershberger <joe.hershberger@ni.com>
| * net: Add mii_resolve_flowctrl_fdx()Yuiko Oshino2017-08-141-0/+23
| | | | | | | | | | | | | | | | | | Add an mii helper function to resolve flow control status per IEEE 802.3-2005 table 28B-3. This function was taken from the Linux source tree. Signed-off-by: Yuiko Oshino <yuiko.oshino@microchip.com> Acked-by: Joe Hershberger <joe.hershberger@ni.com>
| * net: fman: add support RGMII_TXID to memacMadalin Bucur2017-08-141-1/+3
| | | | | | | | | | Signed-off-by: Madalin Bucur <madalin.bucur@nxp.com> Acked-by: Joe Hershberger <joe.hershberger@ni.com>
* | common: Move CONFIG_BOOTARGS to KconfigSam Protsenko2017-08-14418-544/+551
|/ | | | | | | | | Also introduce CONFIG_USE_BOOTARGS option so we can control if CONFIG_BOOTARGS defined at all. Signed-off-by: Sam Protsenko <semen.protsenko@linaro.org> [trini: Resync r8a779[56]_ulcb, various ls10xx targets] Signed-off-by: Tom Rini <trini@konsulko.com>
* ARM: rockchip: rock: Correct test to use CONFIG_IS_ENABLED not definedTom Rini2017-08-141-1/+1
| | | | | | | | | | While it is likely that this entire case is superfluous and can be removed, correct the test now to match what is in rockchip-common.h and makes sense based on context of the code. Otherwise we get a large number of warnings. Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com> Signed-off-by: Tom Rini <trini@konsulko.com>
* Merge branch 'master' of git://git.denx.de/u-boot-rockchipTom Rini2017-08-14203-860/+4234
|\
| * rockchip: clk: remove RATE_TO_DIVKever Yang2017-08-137-29/+20
| | | | | | | | | | | | | | | | | | | | Use DIV_ROUND_UP instead RATE_TO_DIV for all Rockchip SoC clock driver. Add or fix the div-field overflow check at the same time. Signed-off-by: Kever Yang <kever.yang@rock-chips.com> Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com> Acked-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
| * rockchip: clk: update dwmmc clock divKever Yang2017-08-136-19/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | dwmmc controller has default internal divider by 2, and we always provide double of the clock rate request by dwmmc controller. Sync code for all Rockchip SoC with: 4055b46 rockchip: clk: rk3288: fix mmc clock setting Signed-off-by: Kever Yang <kever.yang@rock-chips.com> Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com> Acked-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com> [fixup for 'missing DIV_ROUND_UP' conflict for clk_rk3288.c:] Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
| * rockchip: rk322x: update max-frequency for mmc nodeKever Yang2017-08-132-3/+2
| | | | | | | | | | | | | | | | | | | | | | mmc using 150000000 as max-frequency like what rk3288 sets. This can speed up the mmc read/write, the actual mmc clock is: Before this patch: 37.125M After this patch: 49.5M Signed-off-by: Kever Yang <kever.yang@rock-chips.com> Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com> Acked-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
| * rockchip: dts: rk322x: add sdmmc device nodeKever Yang2017-08-132-0/+74
| | | | | | | | | | | | | | | | add node for sdmmc in dts and rk3229-evb. Signed-off-by: Kever Yang <kever.yang@rock-chips.com> Acked-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com> Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
| * scripts: setlocalversion: safely extract variables from auto.conf using awkPhilipp Tomsich2017-08-131-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Moving SPL_LDSCRIPT to Kconfig triggered an unfortunate attempt of command substitution, as the sourced auto.conf may include $(ARCH) which tries to execute a command 'ARCH'. This showed up as a warning similar to the following: include/config/auto.conf: line 209: ARCH: command not found This change does no longer attempt to source auto.conf, but rather passes it through awk to retrieve the values for CONFIG_LOCALVERSION and CONFIG_LOCALVERSION_AUTO. This will also mitigate the risk of unintended command substitution. Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com> Reported-by: Andy Yan <andy.yan@rock-chips.com> Reviewed-by: Tom Rini <trini@konsulko.com> Reviewed-by: Klaus Goger <klaus.goger@theobroma-systems.com> Reviewed-by: Jakob Unterwurzacher <jakob.unterwurzacher@theobroma-systems.com>
| * rockchip: rk322x: set the DDR region as non-secure in SPLKever Yang2017-08-131-0/+4
| | | | | | | | | | | | | | | | | | | | | | Disable the ddr secure region setting in SPL and the ddr memory becomes non-secure, every one can access it. the trust firmware like OPTEE should have the correct setting for it after SPL if there is one. Signed-off-by: Kever Yang <kever.yang@rock-chips.com> Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com> Acked-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
| * rockchip: rk3288: fix EMMC_DIV_MASK definition in headerKever Yang2017-08-131-1/+1
| | | | | | | | | | | | | | | | | | | | It should be '<<' instead of '<' for _MASK definition, fix it. Signed-off-by: Ziyuan Xu <xzy.xu@rock-chips.com> Signed-off-by: Kever Yang <kever.yang@rock-chips.com> Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com> Acked-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com> Reviewed-by: Simon Glass <sjg@chromium.org>
| * rockchip: rk3368: spl: move SPL_LDSCRIPT to KconfigPhilipp Tomsich2017-08-132-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | With the new way of doing things (i.e. the hierarchical selection of SPL_LDSCRIPT via Kconfig) in place, this moves the SPL_LDSCRIPT setting for the RK3368 from defconfig back into Kconfig. With this done, there should be no lingering cases of SPL_LDSCRIPT outside of Kconfig files. Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com> Reviewed-by: Simon Glass <sjg@chromium.org>
| * spl: moveconfig: remove SPL_LDSCRIPT definitions for header-filesPhilipp Tomsich2017-08-1362-84/+0
| | | | | | | | | | | | | | | | | | With the hierarchical defaults set up, we remove these from the header files. To do so, I've run moveconfig on SPL_LDSCRIPT and this commits the changes. Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com> Reviewed-by: Simon Glass <sjg@chromium.org>
| * spl: add hierarchical defaults for SPL_LDSCRIPTPhilipp Tomsich2017-08-1313-0/+50
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | With SPL_LDSCRIPT moved to Kconfig (and this being a 'string' config node), all the lingering definitions in header files will cause warnings/errors due to the redefinition of the configuration item. As we don't want to pollute the defconfig files (and values should usually be identical for entire architectures), the defaults are moved into Kconfig. Kconfig will always pick the first default that matches, so please keep these values at the end of each file (to allow any board-specific Kconfig, which will be included earlier) to override with an unconditional default setting. Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com> Reviewed-by: Simon Glass <sjg@chromium.org>
| * rockchip: rk3188: rock: adjust for SPL/TPL splitPhilipp Tomsich2017-08-134-4/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | With the changes to split SPL/TPL for the RK3368, I apparently missed some needed adjustments to the RK3188 Kconfig and rock_defconfig. This fixes build-issues for the rock board after applying the RK3368 enablement (and SPL/TPL) set that resulted from TPL_SERIAL_SUPPORT, TPL_ROCKCHIP_BACK_TO_BROM and TPL_TINY_MEMSET being separate symbols now. Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com> Reviewed-by: Simon Glass <sjg@chromium.org>
| * rockchip: remove the hard coded uart iomux setting for px5 evbAndy Yan2017-08-131-24/+0
| | | | | | | | | | | | | | | | | | | | As the debug uart is marked as dm-pre-reloc, the pinctrl driver will handle the correct iomux setting. Signed-off-by: Andy Yan <andy.yan@rock-chips.com> Acked-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com> Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com> Reviewed-by: Simon Glass <sjg@chromium.org>
| * rockchip: set Pre-reloc malloc pool size to 4kb for rk3368 based boardsAndy Yan2017-08-133-0/+3
| | | | | | | | | | | | | | | | | | The default 1kb pre-reloc malloc pool is not enough for dm core to enable the dm-pre-reloc device drivers. Signed-off-by: Andy Yan <andy.yan@rock-chips.com> Acked-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com> Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
| * rockchip: add u-boot specific dts for rk3368 based boardsAndy Yan2017-08-133-0/+102
| | | | | | | | | | | | | | | | | | | | | | Device drivers like debug serial, dmc should be enabled before relocation, so add u-boot.dtsi files to contain devices that should be marked as dm-pre-reloc. Signed-off-by: Andy Yan <andy.yan@rock-chips.com> Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com> Acked-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com> Reviewed-by: Simon Glass <sjg@chromium.org>