platform/kernel/u-boot.git
7 years agoSPL: FIT: rework U-Boot image loading
Andre Przywara [Wed, 26 Apr 2017 00:32:34 +0000 (01:32 +0100)]
SPL: FIT: rework U-Boot image loading

Currently the SPL FIT loader always looks only for the first image in
the /images node a FIT tree, which it loads and later executes.

Generalize this by looking for a "firmware" property in the matched
configuration subnode, or, if that does not exist, for the first string
in the "loadables" property. Then using the string in that property,
load the image of that name from the /images node.
This still loads only one image at the moment, but refactors the code to
allow extending this in a following patch.
To simplify later re-usage, we also generalize the spl_fit_select_index()
function to not return the image location, but just the node offset.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Reviewed-by: Lokesh Vutla <lokeshvuta@ti.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Tested-by: Heiko Stuebner <heiko@sntech.de>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
Tested-by: Kever Yang <kever.yang@rock-chips.com>
Tested-by: Jagan Teki <jagan@openedev.com>
7 years agoSPL: FIT: refactor FDT loading
Andre Przywara [Wed, 26 Apr 2017 00:32:33 +0000 (01:32 +0100)]
SPL: FIT: refactor FDT loading

Currently the SPL FIT loader uses the spl_fit_select_fdt() function to
find the offset to the right DTB within the FIT image.
For this it iterates over all subnodes of the /configuration node in
the FIT tree and compares all "description" strings therein using a
board specific matching function.
If that finds a match, it uses the string in the "fdt" property of that
subnode to locate the matching subnode in the /images node, which points
to the DTB data.
Now this works very well, but is quite specific to cover this particular
use case. To open up the door for a more generic usage, let's split this
function into:
1) a function that just returns the node offset for the matching
   configuration node (spl_fit_find_config_node())
2) a function that returns the image data any given property in a given
   configuration node points to, additionally using a given index into
   a possbile list of strings (spl_fit_select_index())
This allows us to replace the specific function above by asking for the
image the _first string of the "fdt" property_ in the matching
configuration subnode points to.

This patch introduces no functional changes, it just refactors the code
to allow reusing it later.

(diff is overly clever here and produces a hard-to-read patch, so I
recommend to throw a look at the result instead).

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Reviewed-by: Lokesh Vutla <lokeshvuta@ti.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Tested-by: Heiko Stuebner <heiko@sntech.de>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
Tested-by: Kever Yang <kever.yang@rock-chips.com>
Tested-by: Jagan Teki <jagan@openedev.com>
7 years agoMerge branch 'master' of git://git.denx.de/u-boot-mmc
Tom Rini [Tue, 16 May 2017 00:17:56 +0000 (20:17 -0400)]
Merge branch 'master' of git://git.denx.de/u-boot-mmc

- Add #undef CONFIG_DM_MMC_OPS to omap3_logic in the SPL build case, to
  match other TI platforms in the same situation.

Signed-off-by: Tom Rini <trini@konsulko.com>
7 years agoMerge branch 'master' of git://git.denx.de/u-boot-video
Tom Rini [Tue, 16 May 2017 00:16:02 +0000 (20:16 -0400)]
Merge branch 'master' of git://git.denx.de/u-boot-video

7 years agommc: atmel_sdhci: Enable the quirk SDHCI_QUIRK_WAIT_SEND_CMD
Wenyou Yang [Thu, 11 May 2017 00:25:12 +0000 (08:25 +0800)]
mmc: atmel_sdhci: Enable the quirk SDHCI_QUIRK_WAIT_SEND_CMD

To fix the timeout of sending the write command, enable the quirk
SDHCI_QUIRK_WAIT_SEND_CMD.

Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
7 years agosunxi: Add clock support for TV encoder
Jernej Skrabec [Wed, 10 May 2017 16:46:29 +0000 (18:46 +0200)]
sunxi: Add clock support for TV encoder

This patch adds support for TV encoder clocks which will be used later.

Signed-off-by: Jernej Skrabec <jernej.skrabec@siol.net>
7 years agosunxi: video: Split out TVE code
Jernej Skrabec [Wed, 10 May 2017 16:46:28 +0000 (18:46 +0200)]
sunxi: video: Split out TVE code

Newer SoCs use same TV encoder unit. Split it out so it can be reused
with new DM video driver.

Signed-off-by: Jernej Skrabec <jernej.skrabec@siol.net>
Reviewed-by: Simon Glass <sjg@chromium.org>
7 years agovideo: bmp: rename CONFIG_BMP_24BMP to CONFIG_BMP_24BPP
Philipp Tomsich [Fri, 5 May 2017 19:48:30 +0000 (21:48 +0200)]
video: bmp: rename CONFIG_BMP_24BMP to CONFIG_BMP_24BPP

Due to a typo, the 24 bit-per-pixel configuration ends in 24BMP
instead of 24BPP. This change renames it throughout the source tree
for consistency and to make moving these options into Kconfig easier
and less error-prone.

Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Hannes Schmelzer <hannes.schmelzer@br-automation.com>
7 years agorockchip: video: introduce VIDEO_DW_HDMI and select for Rockchip HDMI
Philipp Tomsich [Fri, 5 May 2017 19:48:26 +0000 (21:48 +0200)]
rockchip: video: introduce VIDEO_DW_HDMI and select for Rockchip HDMI

Instead of having drivers/video/rockchip/Kconfig point outside of its
hierarchy for dw_hdmi.o, we should use a configuration-option to
include the Designware HDMI support.

This change introduces a new config option (not to be selected via
menuconfig, but to be selected from a dependent video driver's
configuration option) that enables dw_hdmi.o and selects it whenever
the HDMI support for Rockchip SoCs is selected.

Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
7 years agovideo: dw_hdmi: Select HDMI mode only if monitor supports it
Jernej Skrabec [Sat, 29 Apr 2017 12:43:37 +0000 (14:43 +0200)]
video: dw_hdmi: Select HDMI mode only if monitor supports it

Some DVI monitors don't work in HDMI mode. Set it only if edid data
explicitly states that it is supported.

Signed-off-by: Jernej Skrabec <jernej.skrabec@siol.net>
Reviewed-by: Simon Glass <sjg@chromium.org>
7 years agoedid: Add HDMI flag to timing info
Jernej Skrabec [Sat, 29 Apr 2017 12:43:36 +0000 (14:43 +0200)]
edid: Add HDMI flag to timing info

Some DVI monitors don't show anything in HDMI mode since audio stream
confuses them. To solve this situation, this commit adds HDMI flag in
timing data and sets it accordingly during edid parsing.

First existence of extension block is checked. If it exists and it is
CEA861 extension, then data blocks are checked for presence of HDMI
vendor specific data block. If it is present, HDMI flag is set.

Signed-off-by: Jernej Skrabec <jernej.skrabec@siol.net>
Reviewed-by: Simon Glass <sjg@chromium.org>
7 years agoedid: Set timings flags according to edid
Jernej Skrabec [Sat, 29 Apr 2017 12:43:35 +0000 (14:43 +0200)]
edid: Set timings flags according to edid

Timing flags are never set, so they may contain garbage. Since some
drivers check them, video output may be broken on those drivers.

Initialize them to 0 and check for few common flags.

Signed-off-by: Jernej Skrabec <jernej.skrabec@siol.net>
Reviewed-by: Simon Glass <sjg@chromium.org>
7 years agoMerge branch 'master' of git://git.denx.de/u-boot-i2c
Tom Rini [Mon, 15 May 2017 17:01:26 +0000 (13:01 -0400)]
Merge branch 'master' of git://git.denx.de/u-boot-i2c

7 years agokbuild: update DTC warning settings for bus and node/property name checks
Masahiro Yamada [Mon, 15 May 2017 07:07:33 +0000 (16:07 +0900)]
kbuild: update DTC warning settings for bus and node/property name checks

Recent commits of DTC introduced new warnings checking PCI and simple
buses, unit address formatting, and stricter node and property name
checking.  Disable the new DTC warnings by default.  As before,
warnings are enabled with W=*.  The strict node and property name
checks are a bit subjective, so they are only enabled for W=2.
(This policy reflects the commit 8654cb8d0371 of Linux.)

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
7 years agoomap3: omap3_logic: switch to using TI_COMMON_CMD_OPTION
Adam Ford [Sat, 13 May 2017 13:14:37 +0000 (08:14 -0500)]
omap3: omap3_logic: switch to using TI_COMMON_CMD_OPTION

Enable TI_COMMON_CMD_OPTIONS and remove similar options
from the defconfig. Updated with savedefconfig

CMD_USB isn't enabled yet.  I have some testing to do with
musb.

Signed-off-by: Adam Ford <aford173@gmail.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
7 years agopower: twl4030: Add imply CMD_POWEROFF when TWL4030 is enabled
Adam Ford [Sat, 13 May 2017 12:02:24 +0000 (07:02 -0500)]
power: twl4030: Add imply CMD_POWEROFF when TWL4030 is enabled

Now that CMD_POWEROFF can turn off the twl4030, let's imply that
just incase someone wants to disable it.

Signed-off-by: Adam Ford <aford173@gmail.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
7 years agoKconfig: OMAP: USB: Migrate CONFIG_USB_EHCI_OMAP to Kconfig
Tom Rini [Sat, 13 May 2017 02:33:30 +0000 (22:33 -0400)]
Kconfig: OMAP: USB: Migrate CONFIG_USB_EHCI_OMAP to Kconfig

Follow the exiting logic for the i.MX options when migrating this
option.

Cc: Marek Vasut <marex@denx.de>
Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Marek Vasut <marex@denx.de>
7 years agoKconfig: USB: Migrate existing USB_EHCI_xxx options
Tom Rini [Sat, 13 May 2017 02:33:29 +0000 (22:33 -0400)]
Kconfig: USB: Migrate existing USB_EHCI_xxx options

The following options are migrated over fully now:
- USB_EHCI_ATMEL
- USB_EHCI_MARVELL
- USB_EHCI_MX6
- USB_EHCI_MX7
- USB_EHCI_MSM
- USB_EHCI_ZYNQ
- USB_EHCI_GENERIC

This also requires fixing the depends on USB_EHCI_MARVELL as it's used
by Orion5X and Kirkwood as well.

Cc: Marek Vasut <marex@denx.de>
Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Marek Vasut <marex@denx.de>
7 years agoKconfig: USB: Migrate CONFIG_USB_EHCI_HCD users to Kconfig
Tom Rini [Sat, 13 May 2017 02:33:28 +0000 (22:33 -0400)]
Kconfig: USB: Migrate CONFIG_USB_EHCI_HCD users to Kconfig

Migrate the rest of the users of CONFIG_USB_EHCI_HCD over to Kconfig.
For a few SoCs, imply or default y this if USB is enabled.  In some
cases we had not already migrated to CONFIG_USB so do that as well.

Cc: Marek Vasut <marex@denx.de>
Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Marek Vasut <marex@denx.de>
7 years agoKconfig: USB: Migrate CONFIG_USB_EHCI to CONFIG_USB_EHCI_HCD
Tom Rini [Sat, 13 May 2017 02:33:27 +0000 (22:33 -0400)]
Kconfig: USB: Migrate CONFIG_USB_EHCI to CONFIG_USB_EHCI_HCD

In order to be able to migrate the various SoC EHCI CONFIG options we
first need to finish the switch from CONFIG_USB_EHCI to
CONFIG_USB_EHCI_HCD.

Cc: Marek Vasut <marex@denx.de>
Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Marek Vasut <marex@denx.de>
7 years agowhitelist: Drop more unused OMAP symbols
Tom Rini [Sat, 13 May 2017 02:33:26 +0000 (22:33 -0400)]
whitelist: Drop more unused OMAP symbols

The symbol CONFIG_OMAP3_LOGIC_USE_NEW_PRODUCT_ID was recently dropped
from usage and CONFIG_OMAP3_MICRON_DDR is unused in code.

Signed-off-by: Tom Rini <trini@konsulko.com>
7 years agoomap: Drop CONFIG_OMAP_VC_I2C_HS_MCODE
Tom Rini [Sat, 13 May 2017 02:33:25 +0000 (22:33 -0400)]
omap: Drop CONFIG_OMAP_VC_I2C_HS_MCODE

The symbol CONFIG_OMAP_VC_I2C_HS_MCODE always uses the default value.
Restructure the comment and code such that if a need arises later to use
another value we can address this then.

Signed-off-by: Tom Rini <trini@konsulko.com>
7 years agowatchdog: Migrate OMAP_WATCHDOG to Kconfig
Tom Rini [Sat, 13 May 2017 02:33:24 +0000 (22:33 -0400)]
watchdog: Migrate OMAP_WATCHDOG to Kconfig

Move this entry to Kconfig.  As it is a hardware watchdog, select
HW_WATCHDOG.  While we could default to enabling this for all platforms,
it is currently only enabled by default on AM33XX, so keep that logic
today.

Cc: Roger Meier <r.meier@siemens.com>
Signed-off-by: Tom Rini <trini@konsulko.com>
7 years agoomap: spi: Drop CONFIG_OMAP3_SPI_D0_D1_SWAPPED support
Tom Rini [Sat, 13 May 2017 02:33:23 +0000 (22:33 -0400)]
omap: spi: Drop CONFIG_OMAP3_SPI_D0_D1_SWAPPED support

This particular quirk is not enabled in any config files today.  It does
however exist and is handled correctly in device trees and via
CONFIG_DM_SPI.  So we drop the symbol now and add a comment to indicate
that any (new) boards that require this quirk need to enable DM_SPI
instead.

Signed-off-by: Tom Rini <trini@konsulko.com>
7 years agoomap3: Migrate CONFIG_OMAP3_GPIO_X to Kconfig
Tom Rini [Sat, 13 May 2017 02:33:22 +0000 (22:33 -0400)]
omap3: Migrate CONFIG_OMAP3_GPIO_X to Kconfig

The symbols CONFIG_OMAP3_GPIO_X control if we enable the clocks for a
given GPIO bank in U-Boot.  select the required banks for each target.
In some cases we need to also migrate from CONFIG_USB_EHCI (deprecated,
in include/configs/) to CONFIG_USB_EHCI_HCD as we only require the GPIO
bank to be enabled if USB is also enabled.

Signed-off-by: Tom Rini <trini@konsulko.com>
7 years agogpio: Move OMAP_GPIO to Kconfig
Tom Rini [Sat, 13 May 2017 02:33:21 +0000 (22:33 -0400)]
gpio: Move OMAP_GPIO to Kconfig

This driver is used often enough such that we want to have this enabled
by default on any ARCH_OMAP2PLUS board, and this only compiles on
ARCH_OMAP2PLUS due to required defines, so mark that as the depends.

Signed-off-by: Tom Rini <trini@konsulko.com>
7 years agoomap3: Drop unused CONFIG_OMAP3_xxx board defines
Tom Rini [Sat, 13 May 2017 02:33:20 +0000 (22:33 -0400)]
omap3: Drop unused CONFIG_OMAP3_xxx board defines

We no longer have a need for a per-board CONFIG_OMAP3_xxx define (we
have CONFIG_TARGET_xxx when this is required), so drop these unused
references.

Signed-off-by: Tom Rini <trini@konsulko.com>
7 years agoomap4: Drop redundant CONFIG_OMAP4430 symbol
Tom Rini [Sat, 13 May 2017 02:33:19 +0000 (22:33 -0400)]
omap4: Drop redundant CONFIG_OMAP4430 symbol

While there are a few different OMAP4 SoCs, today we always set
CONFIG_OMAP4430 and CONFIG_OMAP44XX.  Convert the few test of
CONFIG_OMAP4430 to CONFIG_OMAP44XX.

Cc: Marek Vasut <marex@denx.de>
Cc: Paul Kocialkowski <contact@paulk.fr>
Signed-off-by: Tom Rini <trini@konsulko.com>
7 years agoomap3: Drop CONFIG_OMAP3_EVM, switch to CONFIG_TARGET_OMAP3_EVM when needed
Tom Rini [Sat, 13 May 2017 02:33:18 +0000 (22:33 -0400)]
omap3: Drop CONFIG_OMAP3_EVM, switch to CONFIG_TARGET_OMAP3_EVM when needed

We make use of CONFIG_OMAP3_EVM today to know when to do a specific
tweak in MUSB.  This can be tested on via CONFIG_TARGET_OMAP3_EVM
instead, so switch there so we can drop the now unused symbol
CONFIG_OMAP3_EVM.  In investigating what to do about the symbol usage we
see that the cairo board defines the same function, but never called it
(as it does not define CONFIG_OMAP3_EVM) and was just returning anyhow,
so drop that function from that board.

Cc: "Albert ARIBAUD (3ADEV)" <albert.aribaud@3adev.fr>
Cc: Marek Vasut <marex@denx.de>
Signed-off-by: Tom Rini <trini@konsulko.com>
7 years agoomap5: Migrate CONFIG_OMAP_PLATFORM_RESET_TIME_MAX_USEC to Kconfig
Tom Rini [Sat, 13 May 2017 02:33:17 +0000 (22:33 -0400)]
omap5: Migrate CONFIG_OMAP_PLATFORM_RESET_TIME_MAX_USEC to Kconfig

While in theory this value could be used in places outside of "omap5"
(such as OMAP4), we only make use of it today in OMAP5, so place the
Kconfig entry there.  Given that Kconfig lets us provide a default, we
drop CONFIG_DEFAULT_OMAP_RESET_TIME_MAX_USEC entirely.  The contents of
doc/README.omap-reset-time make a good help entry, so adjust them
slightly and delete the file.  Move the comment about range to where we
use the value now, and have Kconfig enforce the upper bound.

Signed-off-by: Tom Rini <trini@konsulko.com>
7 years agoTI: Drop 'CONFIG_OMAP'
Tom Rini [Sat, 13 May 2017 02:33:16 +0000 (22:33 -0400)]
TI: Drop 'CONFIG_OMAP'

In the two cases in the code where we use CONFIG_OMAP as a useful test
currently we can make use of CONFIG_ARCH_OMAP2PLUS instead.  With that
changed we can drop all defines of CONFIG_OMAP.  While in here,
CONFIG_OMAP3430 is only defined and then never used, so drop.

Signed-off-by: Tom Rini <trini@konsulko.com>
7 years agoomap24xx_i2c.c: Drop references to CONFIG_OMAP243X
Tom Rini [Sat, 13 May 2017 02:33:15 +0000 (22:33 -0400)]
omap24xx_i2c.c: Drop references to CONFIG_OMAP243X

We have nothing defining CONFIG_OMAP243X since we dropped the omap243x
platforms, drop these tests.

Signed-off-by: Tom Rini <trini@konsulko.com>
Acked-by: Heiko Schocher <hs@denx.de>
7 years agoarch/arm/cpu/arm926ejs/omap: Remove
Tom Rini [Sat, 13 May 2017 02:33:14 +0000 (22:33 -0400)]
arch/arm/cpu/arm926ejs/omap: Remove

This code has been unused since the removal of the "omap2" platforms,
remove.

Signed-off-by: Tom Rini <trini@konsulko.com>
7 years agodavinci: omapl138_lcdk: drop custom prompt string
Sekhar Nori [Fri, 12 May 2017 10:14:40 +0000 (15:44 +0530)]
davinci: omapl138_lcdk: drop custom prompt string

Drop custom command prompt string in favor
of default used by U-Boot. This helps in
easier automation setup across boards.

Signed-off-by: Sekhar Nori <nsekhar@ti.com>
7 years agoboard_f: skip timer_init() on Coldfire archs
Angelo Dureghello [Wed, 10 May 2017 21:58:06 +0000 (23:58 +0200)]
board_f: skip timer_init() on Coldfire archs

Coldfire arch is not happy with timer_init since interrupt handlers
are still not set at that stage, and the boot hangs silently.

Signed-off-by: Angelo Dureghello <angelo@sysam.it>
7 years agospl: add support to booting with ATF
Kever Yang [Fri, 5 May 2017 03:47:45 +0000 (11:47 +0800)]
spl: add support to booting with ATF

ATF(ARM Trusted Firmware) is used by ARM arch64 SoCs, find more infomation
about ATF at: https://github.com/ARM-software/arm-trusted-firmware

SPL is considered as BL2 in ATF terminology, it needs to load other parts
of ATF binary like BL31, BL32, SCP-BL30, and BL33(U-Boot). And needs to
prepare the parameter for BL31 which including entry and image information
for all other images. Then the SPL handle PC to BL31 with the parameter,
the BL31 will do the rest of work and at last get into U-Boot(BL33).

This patch needs work with patches from Andre for SPL support multi
binary in FIT.

The entry point of bl31 and bl33 are still using hard code because we
still can not get them from the FIT image information.

Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
Tested-by: Heiko Stuebner <heiko@sntech.de>
Acked-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
7 years agoarmv8: minor fix to comment for enabling SMPEN bit
Dinh Nguyen [Thu, 27 Apr 2017 04:36:03 +0000 (23:36 -0500)]
armv8: minor fix to comment for enabling SMPEN bit

The SMPEN bit is located in the cpuectlr_el1 register and not the
cpuactlr_el1 register. Adjust the comment accordingly and also fix
a spelling error.

Signed-off-by: Dinh Nguyen <dinguyen@kernel.org>
CC: Mingkai Hu <mingkai.hu@nxp.com>
CC: Gong Qianyu <Qianyu.Gong@nxp.com>
CC: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
CC: Hou Zhiqiang <Zhiqiang.Hou@nxp.com>
CC: York Sun <york.sun@nxp.com>
CC: Albert Aribaud <albert.u.boot@aribaud.net>
CC: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: York Sun <york.sun@nxp.com>
7 years agommc: descend into drivers/mmc only when CONFIG_MMC is enabled
Masahiro Yamada [Tue, 9 May 2017 11:31:40 +0000 (20:31 +0900)]
mmc: descend into drivers/mmc only when CONFIG_MMC is enabled

This simplifies makefiles.  Also, arrange the order of objects in
drivers/mmc/Makefile so that the framework objects are listed before
drivers.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
7 years agommc: replace CONFIG_GENERIC_MMC with CONFIG_MMC
Masahiro Yamada [Tue, 9 May 2017 11:31:39 +0000 (20:31 +0900)]
mmc: replace CONFIG_GENERIC_MMC with CONFIG_MMC

Now CONFIG_GENERIC_MMC and CONFIG_MMC match for all defconfig.
We do not need two options for the same feature.  Deprecate the
former.

This commit was generated with the sed script 's/GENERIC_MMC/MMC/'
and manual fixup of drivers/mmc/Kconfig.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
7 years agoblanche_defconfig: enable CONFIG_MMC
Masahiro Yamada [Tue, 9 May 2017 11:31:38 +0000 (20:31 +0900)]
blanche_defconfig: enable CONFIG_MMC

As commit 54925327fa11 ("mmc: move CONFIG_GENERIC_MMC to Kconfig")
addressed, this is one of the last weird defconfigs that define
CONFIG_GENERIC_MMC without CONFIG_MMC.

Now I took a closer look at this.  Given that both CONFIG_CMD_MMC
and CONFIG_GENERIC_MMC are set for this defconfig, CONFIG_MMC should
be enabled.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
7 years agosandbox_noblk_defconfig: disable CONFIG_GENERIC_MMC
Masahiro Yamada [Tue, 9 May 2017 11:31:37 +0000 (20:31 +0900)]
sandbox_noblk_defconfig: disable CONFIG_GENERIC_MMC

As commit 54925327fa11 ("mmc: move CONFIG_GENERIC_MMC to Kconfig")
addressed, this is one of the last weird defconfigs that define
CONFIG_GENERIC_MMC without CONFIG_MMC.

Now I took a closer look at this.  Given that neither CONFIG_CMD_MMC
nor CONFIG_MMC is set for this defconfig, CONFIG_GENERIC_MMC
should be disabled.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
7 years agommc: sdhci-cadence: import updates from Linux 4.12
Masahiro Yamada [Tue, 9 May 2017 06:52:04 +0000 (15:52 +0900)]
mmc: sdhci-cadence: import updates from Linux 4.12

This driver is a counterpart of drivers/mmc/host/sdhci-cadence.c
from Linux.  Some updates for v4.12-rc1 can be imported to U-Boot.

 - Fix value of SDHCI_CDNS_HRS04_RDATA_SHIFT
 - Add polling for ACK bit to be sure that data are written to
   the PHY register
 - Retrieve PHY values from DT properties instead of fixed data

The following is the list of upstream commits:

 - Linux commit 4e03f628b464e0580abadf5161eaa38c61d20943
   mmc: sdhci-cadence: fix bit shift of read data from PHY port

 - Linux commit a0f8243229ed071c8da0ea7cedc1b7bf1b1515da
   mmc: sdhci-cadence: Fix writing PHY delay

 - Linux commit a89c472d8b55c5afc4c79e6e3d1338730034eb01
   mmc: sdhci-cadence: Update PHY delay configuration

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
7 years agommc: sdhci: Fix maximum clock for programmable clock mode
Wenyou Yang [Wed, 26 Apr 2017 01:32:30 +0000 (09:32 +0800)]
mmc: sdhci: Fix maximum clock for programmable clock mode

In the programmable clock mode, the SDCLK frequency is incorrectly
assigned when the maximum clock has been assigned during probe,
this causes the SDHCI not work well.

In the programmable clock mode, when calculating the SDCLK Frequency
Select, when the maximum clock has been assigned, it is the actual
value, should not be multiplied by host->clk_mul. Otherwise, the
maximum clock is multiplied host->clk_mul by the base clock achieved
from the BASECLKF field of the Capabilities 0 Register.

Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
7 years agodrivers: omap_hsmmc: move to DM_MMC_OPS
Jean-Jacques Hiblot [Fri, 14 Apr 2017 17:50:02 +0000 (19:50 +0200)]
drivers: omap_hsmmc: move to DM_MMC_OPS

Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
7 years agoinclude: config: am335x: disable DM_MMC_OPS if DM_MMC is disabled
Jean-Jacques Hiblot [Fri, 14 Apr 2017 17:50:01 +0000 (19:50 +0200)]
include: config: am335x: disable DM_MMC_OPS if DM_MMC is disabled

Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
7 years agoDrop use of CONFIG_I2C_SOFT
Simon Glass [Sat, 13 May 2017 03:10:00 +0000 (21:10 -0600)]
Drop use of CONFIG_I2C_SOFT

This option is not used in U-Boot. Drop it.

Signed-off-by: Simon Glass <sjg@chromium.org>
7 years agoDrop CONFIG_I2CFAST
Simon Glass [Sat, 13 May 2017 03:09:59 +0000 (21:09 -0600)]
Drop CONFIG_I2CFAST

This option is not used in U-Boot. Drop it.

Signed-off-by: Simon Glass <sjg@chromium.org>
7 years agoi2c: Drop CONFIG_SYS_I2C_BOARD_LATE_INIT
Simon Glass [Sat, 13 May 2017 03:09:58 +0000 (21:09 -0600)]
i2c: Drop CONFIG_SYS_I2C_BOARD_LATE_INIT

This option is not used by any boards. Drop it.

Signed-off-by: Simon Glass <sjg@chromium.org>
7 years agoi2c: README: Drop CONFIG_SYS_I2C_INIT_MPC5XXX
Simon Glass [Sat, 13 May 2017 03:09:57 +0000 (21:09 -0600)]
i2c: README: Drop CONFIG_SYS_I2C_INIT_MPC5XXX

This option is not used in U-Boot. Drop it.

Signed-off-by: Simon Glass <sjg@chromium.org>
7 years agoi2c: Finish dropping use of CONFIG_I2C_HARD
Simon Glass [Sat, 13 May 2017 03:09:56 +0000 (21:09 -0600)]
i2c: Finish dropping use of CONFIG_I2C_HARD

Drop use of this long-deprecated option.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
7 years agoi2c: omap: Modify code to work without CONFIG_I2C_HARD
Simon Glass [Sat, 13 May 2017 03:09:55 +0000 (21:09 -0600)]
i2c: omap: Modify code to work without CONFIG_I2C_HARD

Drop use of this long-deprecated option.

Signed-off-by: Simon Glass <sjg@chromium.org>
Suggested-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
7 years agoi2c: mxc_i2c: Drop use of CONFIG_I2C_HARD
Simon Glass [Sat, 13 May 2017 03:09:54 +0000 (21:09 -0600)]
i2c: mxc_i2c: Drop use of CONFIG_I2C_HARD

Drop use of this long-deprecated option.

Signed-off-by: Simon Glass <sjg@chromium.org>
7 years agoi2c: keymile: Drop use of CONFIG_I2C_HARD
Simon Glass [Sat, 13 May 2017 03:09:53 +0000 (21:09 -0600)]
i2c: keymile: Drop use of CONFIG_I2C_HARD

Drop use of this long-deprecated option.

Signed-off-by: Simon Glass <sjg@chromium.org>
7 years agoi2c: pdm360ng: Drop use of CONFIG_I2C_HARD
Simon Glass [Sat, 13 May 2017 03:09:52 +0000 (21:09 -0600)]
i2c: pdm360ng: Drop use of CONFIG_I2C_HARD

Drop use of this long-deprecated option.

Signed-off-by: Simon Glass <sjg@chromium.org>
7 years agoi2c: cm5200: Drop use of CONFIG_I2C_HARD
Simon Glass [Sat, 13 May 2017 03:09:51 +0000 (21:09 -0600)]
i2c: cm5200: Drop use of CONFIG_I2C_HARD

Drop use of this long-deprecated option.

Signed-off-by: Simon Glass <sjg@chromium.org>
7 years agoi2c: powerpc: Remove use of CONFIG_HARD_I2C
Simon Glass [Sat, 13 May 2017 03:09:50 +0000 (21:09 -0600)]
i2c: powerpc: Remove use of CONFIG_HARD_I2C

Drop use of this long-deprecated option for powerpc.

Signed-off-by: Simon Glass <sjg@chromium.org>
7 years agoi2c: Drop use of CONFIG_I2C_HARD
Simon Glass [Sat, 13 May 2017 03:09:49 +0000 (21:09 -0600)]
i2c: Drop use of CONFIG_I2C_HARD

This option is pretty old. It predates CONFIG_SYS_I2C which is itself
deprecated in favour of driver model. Disable it for all boards.

Also drop I2C options which depend on this.

Signed-off-by: Simon Glass <sjg@chromium.org>
7 years agoMerge branch 'master' of git://git.denx.de/u-boot-mips
Tom Rini [Sat, 13 May 2017 20:45:35 +0000 (16:45 -0400)]
Merge branch 'master' of git://git.denx.de/u-boot-mips

7 years agodavinci: omapl138_lcdk: switch to using TI_COMMON_CMD_OPTIONS
Sekhar Nori [Thu, 11 May 2017 14:44:22 +0000 (20:14 +0530)]
davinci: omapl138_lcdk: switch to using TI_COMMON_CMD_OPTIONS

Now that we support using TI_COMMON_CMD_OPTIONS,
we dont have to enable a number of commands explicitly
in the defconfig if we enable TI_COMMON_CMD_OPTIONS.

Enable TI_COMMON_CMD_OPTIONS and regenerate the defconfig
using "make savedefconfig".

CMD_GPIO has been kept disabled because there is no GPIO
support (yet) on OMAP-L138 LCDK.

Signed-off-by: Sekhar Nori <nsekhar@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
7 years agodavinci: omapl138_lcdk: add support for TI_COMMON_CMD_OPTIONS
Sekhar Nori [Thu, 11 May 2017 14:44:21 +0000 (20:14 +0530)]
davinci: omapl138_lcdk: add support for TI_COMMON_CMD_OPTIONS

OMAP-L138 LCDK board can benefit from using the commonly
used commands enabled by TI_COMMON_CMD_OPTIONS.

Source the relevant Kconfig file so TI_COMMON_CMD_OPTIONS
can be enabled for OMAP-L138 LCDK board in a future patch.

Signed-off-by: Sekhar Nori <nsekhar@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
7 years agonet: Disable the format-extra-args warning
Tom Rini [Wed, 10 May 2017 19:26:06 +0000 (15:26 -0400)]
net: Disable the format-extra-args warning

We will see warnings such as:
net/eth_common.c:57:61: warning: data argument not used by format string [-Wformat-extra-args]
        sprintf(enetvar, index ? "%s%daddr" : "%saddr", base_name, index);
                                              ~~~~~~~~             ^
With clang.  In this case we do not want to re-write our code to be less
compact as the above is intentional and readable.  Add a comment above
the disabling so that it's clear why we want that warning off.

Signed-off-by: Tom Rini <trini@konsulko.com>
7 years agotpm: Fix comparison of unsigned expression warning
Tom Rini [Wed, 10 May 2017 19:20:18 +0000 (15:20 -0400)]
tpm: Fix comparison of unsigned expression warning

The function tpm_xfer returns int so make 'err' be int rather than
uint32_t so that we can catch an error condition.  Reported by
clang-3.8.

Signed-off-by: Tom Rini <trini@konsulko.com>
7 years agogpio-uclass.c: Fix comparison of unsigned expression warning
Tom Rini [Wed, 10 May 2017 19:20:15 +0000 (15:20 -0400)]
gpio-uclass.c: Fix comparison of unsigned expression warning

We declare that gpio_base (which is the base for counting gpios, not an
address) is unsigned.  Therefore the comparison with >= 0 is always
true.  As the desire is to allow for this base number to be 0, we can
just drop this check.  Reported by clang-3.8.

Cc: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
7 years agocmd/led.c: Remove unnecessary check on 'cmd' value
Tom Rini [Wed, 10 May 2017 19:20:14 +0000 (15:20 -0400)]
cmd/led.c: Remove unnecessary check on 'cmd' value

We first check that if argc is less than 2 we return CMD_RET_USAGE.  We
then see if argc is greater than 2 and if so call get_led_cmd() to set
'cmd' and otherwise set it to LEDST_COUNT (which will always be positive
as it's an enum with 0 already assigned).  Therefore the test on if cmd
is less than 0 will always be false and simply be omitted.  Reported by
clang-3.8.

Signed-off-by: Tom Rini <trini@konsulko.com>
7 years agocmd/io.c: Fix comparison of unsigned expression warning
Tom Rini [Wed, 10 May 2017 19:20:13 +0000 (15:20 -0400)]
cmd/io.c: Fix comparison of unsigned expression warning

The function cmd_get_data_size() returns an int and not unsigned.  So we
should assign it to an int rather than unsigned so that we can later
compare the return value.  Reported by clang-3.8.

Signed-off-by: Tom Rini <trini@konsulko.com>
7 years agocmd/bdinfo.c: Fix unused function warning
Tom Rini [Wed, 10 May 2017 19:20:12 +0000 (15:20 -0400)]
cmd/bdinfo.c: Fix unused function warning

On most architectures we do not call print_std_bdinfo() so mark it with
__maybe_unused.  Reported by clang-3.8.

Signed-off-by: Tom Rini <trini@konsulko.com>
7 years agoKconfig: Drop CONFIG_EMAC_MDIO_PHY_NUM
Tom Rini [Wed, 10 May 2017 19:20:11 +0000 (15:20 -0400)]
Kconfig: Drop CONFIG_EMAC_MDIO_PHY_NUM

This particular macro hasn't been used in the code for some time, remove
these references that were missed.

Signed-off-by: Tom Rini <trini@konsulko.com>
7 years agotools/genboardscfg.py: Make 'Supported' as known status
Lokesh Vutla [Wed, 10 May 2017 10:49:52 +0000 (16:19 +0530)]
tools/genboardscfg.py: Make 'Supported' as known status

As per MAINTAINERS[1] file description, 'Supported' is
a valid status for a board. But buildman thinks 'Maintained'
is the only valid state and complains about boards with 'Supported'
status. Update buildman to accept 'Supported' as valid state.

[1] http://git.denx.de/?p=u-boot.git;a=blob;f=MAINTAINERS;h=0962b47bf9057b22e93624e070c0204b893790dc;hb=HEAD#l10

Reported-by: Sekhar Nori <nsekhar@ti.com>
Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
7 years agoasm-generic: global_data: change timebase_l/h to unsigned int
Peng Fan [Tue, 9 May 2017 02:32:03 +0000 (10:32 +0800)]
asm-generic: global_data: change timebase_l/h to unsigned int

Change type of timebase_l/h to unsigned int.
>From lib/time.c: ((uint64_t)gd->timebase_h << 32) | gd->timebase_l;
This piece code is based on that timebase_h and timebase_l are
32bits width, so change the type to unsigned int.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Cc: Eddie Cai <eddie.cai.linux@gmail.com>
Cc: Jagan Teki <jteki@openedev.com>
Cc: York Sun <york.sun@nxp.com>
Cc: "Robert P. J. Day" <rpjday@crashcourse.ca>
Cc: Michal Simek <michal.simek@xilinx.com>
Cc: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
7 years agoarm: change tbu/l type to unsigned int
Peng Fan [Tue, 9 May 2017 02:32:02 +0000 (10:32 +0800)]
arm: change tbu/l type to unsigned int

Change tbu/l type to unsigned int.
>From the timer file for arm,
"(((unsigned long long)gd->arch.tbu) << 32) | gd->arch.tbl;" is used,
This piece code is based on tbu/tbl is 32bits, so change the type to
unsigned int.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Cc: Simon Glass <sjg@chromium.org>
Cc: Tom Rini <trini@konsulko.com>
7 years agom5253demo: Fix static variable in non-static inline function warning
Tom Rini [Tue, 9 May 2017 02:14:35 +0000 (22:14 -0400)]
m5253demo: Fix static variable in non-static inline function warning

The function 'spin_wheel' is declared as inline, but not static and thus
we see warnings that 'w' and 'p' are declared static in a non-static
inline function.  Correct this by marking spin_wheel as static inline.

Cc: TsiChung Liew <Tsi-Chung.Liew@freescale.com>
Signed-off-by: Tom Rini <trini@konsulko.com>
7 years agocommon: Only build cli_readline.o for CMDLINE on non-SPL
Tom Rini [Tue, 9 May 2017 02:14:34 +0000 (22:14 -0400)]
common: Only build cli_readline.o for CMDLINE on non-SPL

With gcc-6 and later we may get a warning such as:
.../common/cli_readline.c:20:21: warning: ‘tab_seq’ defined but not used [-Wunused-const-variable=]
 static const char   tab_seq[] = "        "; /* used to expand TABs */
                     ^~~~~~~
.../common/cli_readline.c:19:19: warning: ‘erase_seq’ defined but not used [-Wunused-const-variable=]
 static const char erase_seq[] = "\b \b"; /* erase sequence */
                   ^~~~~~~~~

Because in SPL we're normally not doing interactive commands anyhow, so
lets just not compile this at all in SPL.  This also means that we need
to correct the logic (and comment) about what the drivers/ddr/fsl/ and
CONFIG_FSL_DDR_INTERACTIVE requires and this will be included in SPL
there.

Signed-off-by: Tom Rini <trini@konsulko.com>
7 years agonet: uli526x: Fix unknown storage size error
Tom Rini [Tue, 9 May 2017 02:14:33 +0000 (22:14 -0400)]
net: uli526x: Fix unknown storage size error

The variable netdev_ethtool_ops is not referenced, drop it.  However
with gcc-6 or later we fail to even compile as we do not have the
required struct definition in U-Boot.

Cc: Joe Hershberger <joe.hershberger@ni.com>
Signed-off-by: Tom Rini <trini@konsulko.com>
7 years agonet: phy: mv88e61xx: Fix uninitialized variable warning
Tom Rini [Tue, 9 May 2017 02:14:32 +0000 (22:14 -0400)]
net: phy: mv88e61xx: Fix uninitialized variable warning

The variable 'res' may be unused uninitialized if our call to
mv88e61xx_port_read (register read) fails and we goto the error
handling section.  In this case we set 'res' to -EIO to indicate why we
failed.

Cc: Joe Hershberger <joe.hershberger@ni.com>
Cc: Chris Packham <judge.packham@gmail.com>
Cc: Kevin Smith <kevin.smith@elecsyscorp.com>
Cc: Prafulla Wadaskar <prafulla@marvell.com>
Signed-off-by: Tom Rini <trini@konsulko.com>
7 years agonet: eepro100: Fix unused variable warning
Tom Rini [Tue, 9 May 2017 02:14:31 +0000 (22:14 -0400)]
net: eepro100: Fix unused variable warning

The variable i82557_config_cmd is never referenced, drop.

Cc: Joe Hershberger <joe.hershberger@ni.com>
Signed-off-by: Tom Rini <trini@konsulko.com>
7 years agovideo: ld9040: Fix unused variable warnings
Tom Rini [Tue, 9 May 2017 02:14:30 +0000 (22:14 -0400)]
video: ld9040: Fix unused variable warnings

The variables SEQ_SWRESET, SEQ_ELVSS_ON, SEQ_TEMP_SWIRE, SEQ_APON and
SEQ_SLPIN are unreferenced, drop.

Cc: Anatolij Gustschin <agust@denx.de>
Signed-off-by: Tom Rini <trini@konsulko.com>
7 years agocolibri_imx7: Fix unused variable warning
Tom Rini [Tue, 9 May 2017 02:14:29 +0000 (22:14 -0400)]
colibri_imx7: Fix unused variable warning

The variable usdhc3_emmc_pads is never referenced, drop.

Cc: Stefan Agner <stefan.agner@toradex.com>
Signed-off-by: Tom Rini <trini@konsulko.com>
7 years agoapalis_imx6: Fix unused variable warning
Tom Rini [Tue, 9 May 2017 02:14:28 +0000 (22:14 -0400)]
apalis_imx6: Fix unused variable warning

The variable vga_pads is never referenced, drop.

Cc: Max Krummenacher <max.krummenacher@toradex.com>
Signed-off-by: Tom Rini <trini@konsulko.com>
Acked-by: Max Krummenacher <max.krummenacher@toradex.com>
7 years agopcm058: Fix unused variable warnings
Tom Rini [Tue, 9 May 2017 02:14:27 +0000 (22:14 -0400)]
pcm058: Fix unused variable warnings

The variable nfc_pads is only referenced when CONFIG_CMD_NAND is set,
add a gaurd.  The variable gpio_pads is never referenced, drop it.  The
variable usdhc4_pads are only referenced when we do not have
CONFIG_CMD_NAND set and we are not doing an SPL build, modify the
existing guard.

Cc: Stefano Babic <sbabic@denx.de>
Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Stefano Babic <sbabic@denx.de>
7 years agogdsys: P1022: Fix unused variable warnings
Tom Rini [Tue, 9 May 2017 02:14:26 +0000 (22:14 -0400)]
gdsys: P1022: Fix unused variable warnings

The variables prg_stage2_prepare, prg_stage2_success and prg_stage_fail
are only referenced when CCDM_SECOND_STAGE is set, move these to be by
the existing guard.

Cc: Dirk Eibach <eibach@gdsys.de>
Signed-off-by: Tom Rini <trini@konsulko.com>
7 years agogw_ventana: Fix unused variable warnings
Tom Rini [Tue, 9 May 2017 02:14:25 +0000 (22:14 -0400)]
gw_ventana: Fix unused variable warnings

The variable nfc_pads is only referenced when CONFIG_CMD_NAND is set,
move the existing guard and drop a now redundant comment.  The variable
gwproto_gpio_pads is never referenced, remove it.

Cc: Tim Harvey <tharvey@gateworks.com>
Signed-off-by: Tom Rini <trini@konsulko.com>
7 years agomx6ul_14x14_evk: Fix unused variable warning
Tom Rini [Tue, 9 May 2017 02:14:24 +0000 (22:14 -0400)]
mx6ul_14x14_evk: Fix unused variable warning

The variable usdhc1_pads is only referenced during SPL builds, add a guard.

Cc: Stefano Babic <sbabic@denx.de>
Cc: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Stefano Babic <sbabic@denx.de>
7 years agomx6slevk: Fix unused variable warning
Tom Rini [Tue, 9 May 2017 02:14:23 +0000 (22:14 -0400)]
mx6slevk: Fix unused variable warning

The variable usdhc1_pads is only referenced during SPL builds, add a
guard.

Cc: Fabio Estevam <fabio.estevam@nxp.com>
Cc: Peng Fan <peng.fan@nxp.com>
Cc: Stefano Babic <sbabic@denx.de>
Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Stefano Babic <sbabic@denx.de>
7 years agocgtqmx6eval: Fix unused variable warning
Tom Rini [Tue, 9 May 2017 02:14:22 +0000 (22:14 -0400)]
cgtqmx6eval: Fix unused variable warning

The variable usdhc2_pads is only referenced during SPL builds, add a guard.

Cc: Otavio Salvador <otavio@ossystems.com.br>
Signed-off-by: Tom Rini <trini@konsulko.com>
7 years agoot1200: Fix unused variable warning
Tom Rini [Tue, 9 May 2017 02:14:21 +0000 (22:14 -0400)]
ot1200: Fix unused variable warning

The variable pwm_pad is never referenced, drop.

Cc: Christian Gmeiner <christian.gmeiner@gmail.com>
Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
7 years agork3036: Fix unused variable warning
Tom Rini [Tue, 9 May 2017 02:14:20 +0000 (22:14 -0400)]
rk3036: Fix unused variable warning

The variable grf is only referenced if EARLY_DEBUG is defined so move the
declaration to be under the existing guard.

Cc: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
7 years agosocrates: Fix a misleading indentation warning
Tom Rini [Tue, 9 May 2017 02:14:19 +0000 (22:14 -0400)]
socrates: Fix a misleading indentation warning

With gcc-6 and later we see a warning about the fact that we have a
construct of "if (test);\n\tstatement".  Upon reviewing the code, the
intention here is as the compiler suggests, we only want to execute the
indented statement if the test was true.

Cc: Sergei Poselenov <sposelenov@emcraft.com>
Signed-off-by: Tom Rini <trini@konsulko.com>
7 years agocommon: env: remove superfluous assignment
xypron.glpk@gmx.de [Mon, 8 May 2017 19:43:43 +0000 (21:43 +0200)]
common: env: remove superfluous assignment

The value assigned to variable 'value' is never used.

The problem was indicated by clang scan-build.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
7 years agotools: kwbimage fix build with OpenSSL 1.1.x
Jelle van der Waa [Mon, 8 May 2017 19:31:20 +0000 (21:31 +0200)]
tools: kwbimage fix build with OpenSSL 1.1.x

The rsa_st struct has been made opaque in 1.1.x, add forward compatible
code to access the n, e, d members of rsa_struct.

EVP_MD_CTX_cleanup has been removed in 1.1.x and EVP_MD_CTX_reset should be
called to reinitialise an already created structure.

Signed-off-by: Jelle van der Waa <jelle@vdwaa.nl>
7 years agorsa: Fix build with OpenSSL 1.1.x
Jelle van der Waa [Mon, 8 May 2017 19:31:19 +0000 (21:31 +0200)]
rsa: Fix build with OpenSSL 1.1.x

The rsa_st struct has been made opaque in 1.1.x, add forward compatible
code to access the n, e, d members of rsa_struct.

EVP_MD_CTX_cleanup has been removed in 1.1.x and EVP_MD_CTX_reset should be
called to reinitialise an already created structure.

7 years agonet/arp: remove superfluous assignments
xypron.glpk@gmx.de [Mon, 8 May 2017 19:24:28 +0000 (21:24 +0200)]
net/arp: remove superfluous assignments

The value of variable pkt is never used.

The problem was indicated by clang scan-build.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
7 years agolib/slre: remove superfluous assignment
xypron.glpk@gmx.de [Mon, 8 May 2017 19:13:43 +0000 (21:13 +0200)]
lib/slre: remove superfluous assignment

The value assigned to saved_offset is never used.

The problem was indicated by clang scan-build.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
7 years agopci: avoid memory leak
xypron.glpk@gmx.de [Mon, 8 May 2017 18:40:16 +0000 (20:40 +0200)]
pci: avoid memory leak

strdup uses malloc to allocate memory for str.
If we cannot bind to the generic driver we should release
the memory.

The problem was indicated by clang scan-build.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
7 years agoenv: avoid possible NULL pointer access
xypron.glpk@gmx.de [Mon, 8 May 2017 18:23:54 +0000 (20:23 +0200)]
env: avoid possible NULL pointer access

env_attr_lookup call env_attr_walk with
callback = regex_callback.

In env_attr_walk
attributes = strchr(entry_cpy, ENV_ATTR_SEP)
will return NULL if ENV_ATTR_SEP is not found.

In the aftermath regex_callback may call
strlen(attributes)
with a NULL value which will lead to a failure.

The problem was indicated by scan-clam.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
7 years agoenv: correct sign for error code
xypron.glpk@gmx.de [Mon, 8 May 2017 17:30:58 +0000 (19:30 +0200)]
env: correct sign for error code

Error codes should be negative.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
7 years agoarm: amx3xx: Add support for early debug
Lokesh Vutla [Fri, 5 May 2017 08:15:28 +0000 (13:45 +0530)]
arm: amx3xx: Add support for early debug

For early debug, the following configs needs to be enabled:

CONFIG_DEBUG_UART=y
CONFIG_DEBUG_UART_OMAP=y
CONFIG_DEBUG_UART_BASE=0x44e09000
CONFIG_DEBUG_UART_CLOCK=48000000
CONFIG_DEBUG_UART_SHIFT=2
CONFIG_DEBUG_UART_ANNOUNCE=y

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
7 years agoarm: omap5+: Add support for early debug
Lokesh Vutla [Fri, 5 May 2017 08:15:27 +0000 (13:45 +0530)]
arm: omap5+: Add support for early debug

For early debug, the following configs needs to be enabled:

CONFIG_DEBUG_UART=y
CONFIG_DEBUG_UART_OMAP=y
CONFIG_DEBUG_UART_CLOCK=48000000
CONFIG_DEBUG_UART_SHIFT=2
CONFIG_DEBUG_UART_ANNOUNCE=y

For DRA7xx:
CONFIG_DEBUG_UART_BASE=0x4806a000

For AM57xx:
CONFIG_DEBUG_UART_BASE=0x48020000

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
7 years agoarm: am33xx: Add support for mulitiple PLL input frequencies
Lokesh Vutla [Fri, 5 May 2017 07:29:10 +0000 (12:59 +0530)]
arm: am33xx: Add support for mulitiple PLL input frequencies

am335x supports various sysclk frequencies which can be determined
using sysboot pins. PLLs should be configures based on this
sysclk frequency. Add PLL configurations for all supported
frequencies.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
7 years agoboard: am335x: Introduce scale_vcores
Lokesh Vutla [Fri, 5 May 2017 07:29:09 +0000 (12:59 +0530)]
board: am335x: Introduce scale_vcores

Update voltages before programming plls.

Reviewed-by: Tom Rini <trini@konsulko.com>
Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
7 years agoarm: am33xx: Fix MPU opp selection
Lokesh Vutla [Fri, 5 May 2017 07:29:08 +0000 (12:59 +0530)]
arm: am33xx: Fix MPU opp selection

Update MPU frequencies and voltages as per the latest
DM[1] dated: OCT 2011 Revised APRIL 2016, Section 5.4.
Below is the consolidated data:

MPU values for PG 2.0 and later(Package ZCZ and ZCE):

 -------------------------------------------------------
| |   ZCZ |   ZCE |
|-------------------------------------------------------|
| | VDD[V]   | ARM [MHz] | VDD[V]   | ARM [MHz]  |
|-------|----------|------------|----------|------------|
| NITRO |  1.325   |   1000     |   NA     |    NA      |
|-------|----------|------------|----------|------------|
| TURBO |   1.26   |    800 |   NA     |    NA      |
|-------|----------|------------|----------|------------|
|OPP120 |   1.20   |    720     |   NA     |    NA      |
|-------|----------|------------|----------|------------|
|OPP100 |   1.10   |    600     |   1.10   |    600     |
|-------|----------|------------|----------|------------|
| OPP50 |   0.95   |    300     |   0.95   |    300     |
 -------------------------------------------------------

There is no eFuse blown on PG1.0 Silicons due to which there is
no way to detect the maximum frequencies supported. So default
to OPP100 for which both frequency and voltages are common on both
the packages.

[1] http://www.ti.com/lit/ds/symlink/am3356.pdf

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>