platform/kernel/u-boot.git
5 years agoefi_loader: efi_set_virtual_address_map_runtime()
Heinrich Schuchardt [Fri, 12 Jul 2019 20:41:43 +0000 (22:41 +0200)]
efi_loader: efi_set_virtual_address_map_runtime()

efi_set_virtual_address_map_runtime() must be of type __efi_runtime.

Fixes: ee8ebaaaaedc ("efi_loader: split off detaching SetVirtualAddress()")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
5 years agoefi_selftest: do not call CloseEvent() after ExitBootServices()
Heinrich Schuchardt [Fri, 12 Jul 2019 10:55:32 +0000 (12:55 +0200)]
efi_selftest: do not call CloseEvent() after ExitBootServices()

Boot services are not available after calling ExitBootServices(). So we
should not try to close an event here.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>
5 years agoefi_loader: use predefined constants in crt0_*_efi.S
Heinrich Schuchardt [Thu, 11 Jul 2019 04:39:32 +0000 (06:39 +0200)]
efi_loader: use predefined constants in crt0_*_efi.S

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>
5 years agoefi_loader: duplicate IMAGE_SUBSYSTEM_EFI_APPLICATION
Heinrich Schuchardt [Thu, 11 Jul 2019 04:07:40 +0000 (06:07 +0200)]
efi_loader: duplicate IMAGE_SUBSYSTEM_EFI_APPLICATION

IMAGE_SUBSYSTEM_EFI_APPLICATION is already defined in
include/asm-generic/pe.h which is included in include/pe.h. We should
not define it twice.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
5 years agoMerge branch 'master' of git://git.denx.de/u-boot-net
Tom Rini [Mon, 15 Jul 2019 22:56:24 +0000 (18:56 -0400)]
Merge branch 'master' of git://git.denx.de/u-boot-net

5 years agonet: macb: Add support for 1000-baseX
Radu Pirea [Fri, 7 Jun 2019 11:18:36 +0000 (14:18 +0300)]
net: macb: Add support for 1000-baseX

Macb can be used with Xilinx PCS/PMA PHY in fpga which is a 1000-baseX
phy(lpa 0x41e0). This patch adds checks for LPA_1000XFULL and
LPA_1000XHALF bits.

Signed-off-by: Radu Pirea <radu_nicolae.pirea@upb.ro>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
5 years agonet: macb: Fixed reading MII_LPA register
Radu Pirea [Fri, 7 Jun 2019 11:18:35 +0000 (14:18 +0300)]
net: macb: Fixed reading MII_LPA register

If macb is gem and is gigabit capable, lpa value is not read from
the right register(MII_LPA) and is read from MII_STAT1000. This patch
fixes reading of the lpa value.

Signed-off-by: Radu Pirea <radu_nicolae.pirea@upb.ro>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
5 years agoconfigs: am65x_evm_a53: enable networking
Grygorii Strashko [Tue, 9 Jul 2019 05:00:37 +0000 (10:30 +0530)]
configs: am65x_evm_a53: enable networking

Enable TI K3 AM65x CPSW NUSS driver.

Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
Signed-off-by: Keerthy <j-keerthy@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>
5 years agoarm64: dts: k3-am654-base-board: add mcu cpsw nuss pinmux and phy defs
Grygorii Strashko [Tue, 9 Jul 2019 05:00:36 +0000 (10:30 +0530)]
arm64: dts: k3-am654-base-board: add mcu cpsw nuss pinmux and phy defs

Add mcu cpsw nuss pinmux and phy defs required by cpsw.

Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
Signed-off-by: Keerthy <j-keerthy@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
5 years agoarm64: dts: ti: k3-am65: add mcu cpsw node
Grygorii Strashko [Tue, 9 Jul 2019 05:00:35 +0000 (10:30 +0530)]
arm64: dts: ti: k3-am65: add mcu cpsw node

Add mcu cpsw and its components along with scm_conf node
to have ethernet functional.

Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
Signed-off-by: Keerthy <j-keerthy@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
5 years agonet: ethernet: ti: Introduce am654 gigabit eth switch subsystem driver
Keerthy [Tue, 9 Jul 2019 05:00:34 +0000 (10:30 +0530)]
net: ethernet: ti: Introduce am654 gigabit eth switch subsystem driver

Add new driver for the TI AM65x SoC Gigabit Ethernet Switch subsystem (CPSW
NUSS). It has two ports and provides Ethernet packet communication for the
device and can be configured as an Ethernet switch. CPSW NUSS features: the
Reduced Gigabit Media Independent Interface (RGMII), Reduced Media
Independent Interface (RMII), and the Management Data Input/Output (MDIO)
interface for physical layer device (PHY) management. The TI AM65x SoC has
integrated two-port Gigabit Ethernet Switch subsystem into device MCU
domain named MCU_CPSW0. One Ethernet port (port 1) with selectable RGMII
and RMII interfaces and an internal Communications Port Programming
Interface (CPPI) port (Host port 0).

Host Port 0 CPPI Packet Streaming Interface interface supports 8 TX
channels and on RX channels operating by TI am654 NAVSS Unified DMA
Peripheral Root Complex (UDMA-P) controller.

Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
Signed-off-by: Keerthy <j-keerthy@ti.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
5 years agodriver: net: ti: cpsw-mdio: use phys_addr_t for mdio_base addr
Keerthy [Tue, 9 Jul 2019 05:00:33 +0000 (10:30 +0530)]
driver: net: ti: cpsw-mdio: use phys_addr_t for mdio_base addr

Use phys_addr_t for mdio_base address to avoid build
warnings on arm64 and dra7. Cast it to uintprt_t before
assigning to regs.

Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
Signed-off-by: Keerthy <j-keerthy@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
5 years agonet: phy: cortina: Use block layer to read from mmc
Yinbo Zhu [Tue, 11 Jun 2019 06:29:03 +0000 (14:29 +0800)]
net: phy: cortina: Use block layer to read from mmc

This patch is to use block layer to read from mmc in cortina

Signed-off-by: Yinbo Zhu <yinbo.zhu@nxp.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
5 years agonet: mscc: refactor mscc_miim
Horatiu Vultur [Sun, 9 Jun 2019 13:27:29 +0000 (15:27 +0200)]
net: mscc: refactor mscc_miim

Because all MSCC SoC use the same MDIO bus, put the implementation in
one common file(mscc_miim) and make all the other MSCC network drivers to
use these functions.

Signed-off-by: Horatiu Vultur <horatiu.vultur@microchip.com>
Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
5 years agotest: dm: add MDIO test
Alex Marginean [Mon, 3 Jun 2019 16:12:28 +0000 (19:12 +0300)]
test: dm: add MDIO test

A very simple test for DM_MDIO, mimicks a register write/read through the
sandbox bus to a dummy PHY.

Signed-off-by: Alex Marginean <alexm.osslist@gmail.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tested-by: Bin Meng <bmeng.cn@gmail.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
5 years agonet: introduce MDIO DM class for MDIO devices
Alex Marginean [Mon, 3 Jun 2019 16:10:30 +0000 (19:10 +0300)]
net: introduce MDIO DM class for MDIO devices

Adds UCLASS_MDIO DM class supporting MDIO buses that are probed as
stand-alone devices.  Useful in particular for systems that support
DM_ETH and have a stand-alone MDIO hardware block shared by multiple
Ethernet interfaces.

Signed-off-by: Alex Marginean <alexm.osslist@gmail.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
5 years agonet: mscc: serval: Remove delay when serdes is configured
Horatiu Vultur [Thu, 23 May 2019 19:45:33 +0000 (21:45 +0200)]
net: mscc: serval: Remove delay when serdes is configured

When serdes configuration was written in hardware there was a delay
of 100ms to be sure that configuration was written. But the delay is not
needed because already the function serdes_write it is checking that the
operation finished.

Therefore remove the mdelay. This improves the speed of configuring the
network driver.

Signed-off-by: Horatiu Vultur <horatiu.vultur@microchip.com>
Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
5 years agonet: phy: ti: Fix clock output DT property
Trent Piepho [Fri, 10 May 2019 17:49:08 +0000 (17:49 +0000)]
net: phy: ti: Fix clock output DT property

The code block reading the DT property for the clock output control was
before the phy's DT node pointer was set, so it could never work.  Move
it after the node pointer is set.

Also store the unsigned 32-bit property into an unsigned value, not a
signed value, as the former will cause a problem if value overflows.
For instance, if one were to add 0xffffffff as a code to mean the clock
output should be turned off.

Cc: Joe Hershberger <joe.hershberger@ni.com>
Cc: Janine Hagemann <j.hagemann@phytec.de>
Cc: Grygorii Strashko <grygorii.strashko@ti.com>
Signed-off-by: Trent Piepho <tpiepho@impinj.com>
Reviewed-by: Grygorii Strashko <grygorii.strashko@ti.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
5 years agonet: phy: ti: Use default values for tx/rx delay and fifo size
Trent Piepho [Thu, 9 May 2019 19:41:51 +0000 (19:41 +0000)]
net: phy: ti: Use default values for tx/rx delay and fifo size

When not using DM_ETH, these PHY settings are programmed with default
values hardcoded into the driver.  When using DM_ETH, they should come
from the device tree.  However, if the device tree does not have the
properties, the driver will silent use -1.  Which is entirely out of
range, programs nonsense into the PHY's registers, and does not work.

Change this to use the same defaults as non-DM_ETH if the device tree is
lacking the properties.

As an alternative, the kernel driver for the phy will display an error
message and fail if the device tree is lacking.

Cc: Joe Hershberger <joe.hershberger@ni.com>
Cc: Janine Hagemann <j.hagemann@phytec.de>
Cc: Grygorii Strashko <grygorii.strashko@ti.com>
Signed-off-by: Trent Piepho <tpiepho@impinj.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
5 years agocmd: mii: Add the standard 1000BASE-T registers
Trent Piepho [Thu, 9 May 2019 19:23:47 +0000 (19:23 +0000)]
cmd: mii: Add the standard 1000BASE-T registers

These are standard across gigabit phys.  These mostly extend the
auto-negotiation information with gigabit fields.

Signed-off-by: Trent Piepho <tpiepho@impinj.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
5 years agocmd: mii: Refactor some of the MII reg dump code
Trent Piepho [Thu, 9 May 2019 19:23:39 +0000 (19:23 +0000)]
cmd: mii: Refactor some of the MII reg dump code

Share the code that prints out a register field with the function that
prints out the "special" fields.

There were two arrays the register dump list, one with reg number and
name, another with a pointer to the field table and the table size.
These two arrays had have each entry match what register is referred to.
Combine them into just one table.  Now they can't not match and there is
just one table.

Add some missing consts to pointers to string literals.

The dump code was ignoring the regno field in the description table and
assuming register 0 was at index 0, etc.  Have it use the field.

Change reg > max+1 into reg >= max, which doesn't fail if max+1 could
overflow, besides just making more sense.

Signed-off-by: Trent Piepho <tpiepho@impinj.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
5 years agoMerge tag 'mmc-2019-7-15' of https://gitlab.denx.de/u-boot/custodians/u-boot-mmc
Tom Rini [Mon, 15 Jul 2019 13:42:41 +0000 (09:42 -0400)]
Merge tag 'mmc-2019-7-15' of https://gitlab.denx.de/u-boot/custodians/u-boot-mmc

- mmc spi driver model support
- drop mmc_spi command
- enhanced Strobe mmc HS400 support
- minor mmc bug/fixes and optimization
- omap hsmmc and mvbeu update
- sdhci card detect support

5 years agommc: fsl_esdhc_imx: enlarge mmc timeout
Peng Fan [Wed, 10 Jul 2019 09:35:30 +0000 (09:35 +0000)]
mmc: fsl_esdhc_imx: enlarge mmc timeout

Flash system partition with fastboot will earse the partition firstly
The 600ms timeout will fail on some SD Card. Enlarge it to 5s to make
it works for most of sdcard

Cc: guoyin.chen <guoyin.chen@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
5 years agommc: fsl_esdhc_imx: add i.MX8QM compatible
Peng Fan [Wed, 10 Jul 2019 09:35:28 +0000 (09:35 +0000)]
mmc: fsl_esdhc_imx: add i.MX8QM compatible

Add i.MX8QM compatible and soc data, the soc data is following Linux
i.MX SDHC driver.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
5 years agommc: fsl_esdhc_imx: add HS400 Enhanced strobe support
Peng Fan [Wed, 10 Jul 2019 09:35:26 +0000 (09:35 +0000)]
mmc: fsl_esdhc_imx: add HS400 Enhanced strobe support

Implement set_enhanced_strobe hook for fsl_esdhc_imx,
,in esdhc_set_timing and esdhc_change_pinstate, also handle HS400_ES.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
5 years agommc: fsl_esdhc_imx: use mmc_of_parse to set host_caps
Peng Fan [Wed, 10 Jul 2019 09:35:24 +0000 (09:35 +0000)]
mmc: fsl_esdhc_imx: use mmc_of_parse to set host_caps

Use mmc_of_parse to set host_caps.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
5 years agommc: Parse no-1-8-v DT property
Peng Fan [Wed, 10 Jul 2019 09:35:20 +0000 (09:35 +0000)]
mmc: Parse no-1-8-v DT property

Parse no-1-8-v DT

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
Cc: Marek Vasut <marek.vasut+renesas@gmail.com>
5 years agommc: Parse HS400 Enhanced strobe DT properties
Peng Fan [Wed, 10 Jul 2019 09:35:18 +0000 (09:35 +0000)]
mmc: Parse HS400 Enhanced strobe DT properties

Add HS400 Enhanced strobe properties parsing support to mmc_of_parse().

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
Cc: Marek Vasut <marek.vasut+renesas@gmail.com>
5 years agommc: support hs400 enhanced strobe mode
Peng Fan [Wed, 10 Jul 2019 06:43:07 +0000 (14:43 +0800)]
mmc: support hs400 enhanced strobe mode

eMMC 5.1+ supports HS400 Enhances Strobe mode without the need for
tuning procedure.
The flow is as following:
 - set HS_TIMIMG (Highspeed)
 - Host change freq to <= 52Mhz
 - set the bus width to Enhanced strobe and DDR8Bit(CMD6),
   EXT_CSD[183] = 0x86 instead of 0x80
 - set HS_TIMING to 0x3 (HS400)
 - Host change freq to <= 200Mhz
 - Host select HS400 enhanced strobe complete

Signed-off-by: Peng Fan <peng.fan@nxp.com>
5 years agommc: fsl_esdhc_imx: fix config check issue when building in SPL
Ye Li [Thu, 11 Jul 2019 03:29:02 +0000 (03:29 +0000)]
mmc: fsl_esdhc_imx: fix config check issue when building in SPL

Should use CONFIG_IS_ENABLED not IS_ENABLED for clock and regulator drivers,
CONFIG_IS_ENABLED will check the CONFIG_SPL_CLK and CONFIG_SPL_DM_REGULATOR
when building SPL.

Signed-off-by: Ye Li <ye.li@nxp.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
5 years agocmd: Remove mmc_spi command
Anup Patel [Mon, 8 Jul 2019 04:10:55 +0000 (04:10 +0000)]
cmd: Remove mmc_spi command

The mmc_spi command was added to manually setup MMC over SPI bus
using command. This was required by the legacy non-DM MMC_SPI driver.

With DM based MMC_SPI driver in-place, we can now use all general
storge commands and mmc command for MMC over SPI bus hence we remove
the mmc_spi command all it's references.

Suggested-by: Bin Meng <bmeng.cn@gmail.com>
Signed-off-by: Anup Patel <anup.patel@wdc.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
5 years agommc: mmc_spi: Re-write driver using DM framework
Bhargav Shah [Mon, 8 Jul 2019 04:10:48 +0000 (04:10 +0000)]
mmc: mmc_spi: Re-write driver using DM framework

This patch rewrites MMC SPI driver using U-Boot DM
framework and get it's working on SiFive Unleashed
board.

Signed-off-by: Bhargav Shah <bhargavshah1988@gmail.com>
Signed-off-by: Anup Patel <anup.patel@wdc.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tested-by: Bin Meng <bmeng.cn@gmail.com>
5 years agommc: skip select_mode_and_width for MMC SPI host
Anup Patel [Mon, 8 Jul 2019 04:10:43 +0000 (04:10 +0000)]
mmc: skip select_mode_and_width for MMC SPI host

The MMC mode and width are fixed for MMC SPI host hence we skip
sd_select_mode_and_width() and mmc_select_mode_and_width() for
MMC SPI host.

Signed-off-by: Anup Patel <anup.patel@wdc.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tested-by: Bin Meng <bmeng.cn@gmail.com>
5 years agommc: retry a few times if a partition switch failed
Jean-Jacques Hiblot [Tue, 2 Jul 2019 08:53:58 +0000 (10:53 +0200)]
mmc: retry a few times if a partition switch failed

This operation may fail. Retry it a few times before giving up and report
a failure.

Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
5 years agommc: do not change mode when accessing a boot partition
Jean-Jacques Hiblot [Tue, 2 Jul 2019 08:53:57 +0000 (10:53 +0200)]
mmc: do not change mode when accessing a boot partition

Accessing the boot partition had been error prone with HS200 and HS400 and
was disabled. The driver first switched to a lesser mode and then switched
the partition access. It was mostly due to a bad handling of the switch and
has been fixed, so let's remove this 'feature'

Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
5 years agommc: During a switch, poll on dat0 if available and check the final status
Jean-Jacques Hiblot [Tue, 2 Jul 2019 08:53:56 +0000 (10:53 +0200)]
mmc: During a switch, poll on dat0 if available and check the final status

The switch operation can sometimes make the bus unreliable, in that case
the send_status parameter should be false to indicate not to poll using
CMD13. If polling on dat0 is possible, we should use it to detect the end
of the operation.
At the end of the operation it is safe to use CMD13 to get the status of
the card. It is important to do so because the operation may have failed.

Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
5 years agommc: When switching partition, use the timeout specified in the ext_csd
Jean-Jacques Hiblot [Tue, 2 Jul 2019 08:53:55 +0000 (10:53 +0200)]
mmc: When switching partition, use the timeout specified in the ext_csd

The e-MMC spec allows the e-MMC to specify a timeout for the partition
switch command. It can take up to 2550 ms. There is no lower limit to this
value in the spec, but do as the the linux driver does and force it to be
at least 300ms.

Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
5 years agommc: use the generic timeout for cmd6 (SWITCH) provided in the ext_csd
Jean-Jacques Hiblot [Tue, 2 Jul 2019 08:53:54 +0000 (10:53 +0200)]
mmc: use the generic timeout for cmd6 (SWITCH) provided in the ext_csd

Starting with rev 4.5, the eMMC can define a generic timeout for the
SWITCH command.

Following Linux Kernel code, the timeout also changed from 1000 -> 500

Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
5 years agommc: if possible, poll the busy state using DAT0
Jean-Jacques Hiblot [Tue, 2 Jul 2019 08:53:53 +0000 (10:53 +0200)]
mmc: if possible, poll the busy state using DAT0

Using the DAT0 line as a rdy/busy line is an alternative to reading the
status register of the card. It especially useful in situation where the
bus is not in a good shape, like when modes are switched.
This is also how the linux driver behaves.

Note of warning: As per the specification, while polling on DAT0 the CLK
must not turned off: "[...] Without a clock edge the Device (unless
previously disconnected by a deselect command (CMD7)) will force the DAT0
line down, forever. [...]"

Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
5 years agommc: add mmc_poll_for_busy() and change the purpose of mmc_send_status()
Jean-Jacques Hiblot [Tue, 2 Jul 2019 08:53:52 +0000 (10:53 +0200)]
mmc: add mmc_poll_for_busy() and change the purpose of mmc_send_status()

mmc_send_status() is currently used to poll the card until it is ready, not
actually returning the status of the card.
Make it return the status and add another function to poll the card.

Also remove the 'extern' declaration in the mmc-private.h header to comply
with the coding standard.

Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
5 years agommc: omap_hsmmc: provide wait_dat0 even if UHS modes are not supported
Jean-Jacques Hiblot [Tue, 2 Jul 2019 08:53:51 +0000 (10:53 +0200)]
mmc: omap_hsmmc: provide wait_dat0 even if UHS modes are not supported

This function can also be used for eMMC devices.

Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
5 years agoRevert "mmc: Add a new callback function to perform the 74 clocks cycle sequence"
Jean-Jacques Hiblot [Tue, 2 Jul 2019 08:53:50 +0000 (10:53 +0200)]
Revert "mmc: Add a new callback function to perform the 74 clocks cycle sequence"

This reverts commit 318a7a576bc49aa8b4207e694d3fbd48c663d6ac.

The last and only user of this callback had been the omap_hsmmc driver.
It is not used anymore. Removing the callback.

Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
5 years agommc: omap_hsmmc: don't fill the send_init_stream callback
Jean-Jacques Hiblot [Tue, 2 Jul 2019 08:53:49 +0000 (10:53 +0200)]
mmc: omap_hsmmc: don't fill the send_init_stream callback

This is not required. The MMC core sends CMD0 right after the
initialization and it serves the same purpose.

Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
5 years agommc: omap_hsmmc: reset FSM for DAT and CMD lines if needed before a new command
Jean-Jacques Hiblot [Tue, 2 Jul 2019 08:53:48 +0000 (10:53 +0200)]
mmc: omap_hsmmc: reset FSM for DAT and CMD lines if needed before a new command

It sometimes happen that the PSTATE register does not indicate that the
bus is ready when it really is. This usually happens after a mode switch.
In that case it makes sense to reset the FSM handling the CMD and DATA

Also reset the FSMs if the STATE register cannot be cleared. This also
sometimes happens after a mode switch.

Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
5 years agommc: rpmb: fix response type of CMD25
Akio Hirayama [Fri, 28 Jun 2019 12:16:25 +0000 (21:16 +0900)]
mmc: rpmb: fix response type of CMD25

The response type of CMD25 is R1 instead of R1b.

Signed-off-by: Akio Hirayama <hirayama.akio@socionext.com>
[masahiro: add log ]
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
5 years agommc: sdhci: Implement SDHCI card detect
T Karthik Reddy [Tue, 25 Jun 2019 11:39:04 +0000 (13:39 +0200)]
mmc: sdhci: Implement SDHCI card detect

Card detect function implemented for SDHCI framework.

Signed-off-by: T Karthik Reddy <t.karthik.reddy@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
5 years agommc: sdhci: Read cd-gpio from devicetree
T Karthik Reddy [Tue, 25 Jun 2019 11:39:03 +0000 (13:39 +0200)]
mmc: sdhci: Read cd-gpio from devicetree

This patch reads cd-gpio property from devicetree

Signed-off-by: T Karthik Reddy <t.karthik.reddy@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
5 years agommc: Read sd card detect properties from DT
T Karthik Reddy [Tue, 25 Jun 2019 11:39:02 +0000 (13:39 +0200)]
mmc: Read sd card detect properties from DT

This patch reads card detect properties from device tree &
added mmc capability macros in mmc.h.

Signed-off-by: T Karthik Reddy <t.karthik.reddy@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
5 years agommc: mvebu: Remove unused MMC_CAP.. macros
T Karthik Reddy [Tue, 25 Jun 2019 11:39:01 +0000 (13:39 +0200)]
mmc: mvebu: Remove unused MMC_CAP.. macros

Removed MMC_CAP_NONREMOVABLE, MMC_CAP_NEEDS_POLL macros from
mvebu_mmc.h to avoid redefining of these macros when compiled with
mvebu based configs.

Signed-off-by: T Karthik Reddy <t.karthik.reddy@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
5 years agoMerge tag 'u-boot-stm32-20190712' of https://gitlab.denx.de/u-boot/custodians/u-boot-stm
Tom Rini [Sun, 14 Jul 2019 13:09:49 +0000 (09:09 -0400)]
Merge tag 'u-boot-stm32-20190712' of https://gitlab.denx.de/u-boot/custodians/u-boot-stm

- syscon: add support for power off
- stm32mp1: add op-tee config
- stm32mp1: add specific commands: stboard and stm32key
- add stm32 mailbox driver
- solve many stm32 warnings when building with W=1
- update stm32 gpio driver

5 years agoMerge branch '2019-07-12-master-imports'
Tom Rini [Sun, 14 Jul 2019 13:05:20 +0000 (09:05 -0400)]
Merge branch '2019-07-12-master-imports'

- First round of TI Davinci updates
- Some OMAP3 DM updates
- Other misc updates

5 years agotest: Disable pci_ep test for now
Tom Rini [Sun, 14 Jul 2019 01:18:37 +0000 (21:18 -0400)]
test: Disable pci_ep test for now

This test is currently broken so disable it for now.

Cc: Ramon Fried <ramon.fried@gmail.com>
Cc: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>
5 years agoARM: dts: logicpd som-lvs and torpedos: Shrink SPL DTB
Adam Ford [Wed, 12 Jun 2019 20:26:26 +0000 (15:26 -0500)]
ARM: dts: logicpd som-lvs and torpedos: Shrink SPL DTB

Since we have limited resources in SPL, it is the best interest
to keep the SPL as small as possible and that includes the DTB.
There are a few items in the device tree that can be removed,
because these boards don't use them.

Signed-off-by: Adam Ford <aford173@gmail.com>
5 years agoregulator: Allow autosetting fixed regulators
Sven Schwermer [Wed, 12 Jun 2019 06:32:38 +0000 (08:32 +0200)]
regulator: Allow autosetting fixed regulators

Fixed regulators don't have a set_value method. Therefore, trying to
set their value will always return -ENOSYS.

Signed-off-by: Sven Schwermer <sven@svenschwermer.de>
Cc: Jaehoon Chung <jh80.chung@samsung.com>
Cc: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
5 years agogpio: add gpio-hog support
Heiko Schocher [Wed, 12 Jun 2019 04:11:46 +0000 (06:11 +0200)]
gpio: add gpio-hog support

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>
5 years agoARM: dts: logicpd-som-lv: Resync with Kernel 5.1.9
Adam Ford [Wed, 12 Jun 2019 01:40:42 +0000 (20:40 -0500)]
ARM: dts: logicpd-som-lv: Resync with Kernel 5.1.9

The MMC card-detect pin was incorrectly defined which was fixed.
This patch resync's the dts and removes the u-boot specific fix.

Signed-off-by: Adam Ford <aford173@gmail.com>
5 years agoARM: dts: da850: Resync with Linux 5.1.9
Adam Ford [Wed, 12 Jun 2019 01:28:44 +0000 (20:28 -0500)]
ARM: dts: da850: Resync with Linux 5.1.9

The da850.dtsi file had some changes.  This patch pulls in the
changes from Kernel 5.1.9

Signed-off-by: Adam Ford <aford173@gmail.com>
5 years agoARM: davinci: da850: Manual pinmux only when PINCTRL not available
Adam Ford [Mon, 10 Jun 2019 18:25:08 +0000 (13:25 -0500)]
ARM: davinci: da850: Manual pinmux only when PINCTRL not available

With a recent update to the pinctrl-single driver and the fact
that the da850evm has both DM and OF_CONTROL working in both SPL
and U-Boot, some of the manual pinmuxing can be setup to only
be activated when either the driver doesn't have DM for it, or
when CONFIG_PINMUX isn't available (only during SPL).  If the
code ever shrinks enough to support PINCTRL in SPL, a lot of this
can go away.  This also remove some manual pinmuxing not needed
by SPL to give SPL a little more breathing room.

Signed-off-by: Adam Ford <aford173@gmail.com>
5 years agopinctrl: pinctrl-single: Add 'pinctrl-single, bits' support
Adam Ford [Mon, 10 Jun 2019 18:15:55 +0000 (13:15 -0500)]
pinctrl: pinctrl-single: Add 'pinctrl-single, bits' support

The TI Davinci (da850/l138/am1808) use pinctrl-single,bits for
pinmuxing peripherals.  This patch allosw the pinctrl-single
driver to parse the pinctrl-single,bits options and correctly
setup devices.

Signed-off-by: Adam Ford <aford173@gmail.com>
5 years agoconfigs: Make USE_TINY_PRINTF depend on SPL||TPL and be default
Tom Rini [Sat, 8 Jun 2019 16:46:18 +0000 (12:46 -0400)]
configs: Make USE_TINY_PRINTF depend on SPL||TPL and be default

The USE_TINY_PRINTF symbol only changes things within SPL and TPL
builds, so make it depend on that support.  Next, make it default as
within these cases we should rarely have need of more advanced print
formats outside of the debug context.

To do this, in a few cases we need to correct our Kconfig dependencies
as we had cases of non-SPL targets select'ing this symbol.  Finally, in
the case of a few boards we really do need the full printf
functionality.

Signed-off-by: Tom Rini <trini@konsulko.com>
5 years agopower: regulator: Kconfig: Add SPL_DM_REGULATOR configs for palmas/lp873x/lp87565
Keerthy [Thu, 6 Jun 2019 10:36:56 +0000 (16:06 +0530)]
power: regulator: Kconfig: Add SPL_DM_REGULATOR configs for palmas/lp873x/lp87565

Add SPL_DM_REGULATOR configs for palmas/lp873x/lp87565. These were missing
and the Makefile already assumes them to be defined. Add the corresponding
SPL config options. This enables the regulator support in SPL.

Signed-off-by: Keerthy <j-keerthy@ti.com>
5 years agopower: pmic: Kconfig: Add SPL_PMIC configs for palmas/lp873x/lp87565
Keerthy [Thu, 6 Jun 2019 10:36:55 +0000 (16:06 +0530)]
power: pmic: Kconfig: Add SPL_PMIC configs for palmas/lp873x/lp87565

Add SPL_PMIC configs for palmas/lp873x/lp87565. These were missing
and the Makefile already assumes them to be defined. Add the corresponding
SPL config options. This enables the pmics in SPL.

Signed-off-by: Keerthy <j-keerthy@ti.com>
5 years agoARM: am335x: Add phyCORE AM335x R2 support
Niel Fourie [Mon, 3 Jun 2019 13:31:17 +0000 (15:31 +0200)]
ARM: am335x: Add phyCORE AM335x R2 support

Support for Phytech phyCORE AM335x R2 SOM (PCL060) on the Phytec
phyBOARD-Wega AM335x.

CPU  : AM335X-GP rev 2.1
Model: Phytec AM335x phyBOARD-WEGA
DRAM:  256 MiB
NAND:  256 MiB
MMC:   OMAP SD/MMC: 0
eth0: ethernet@4a100000

Working:
 - Eth0
 - i2C
 - MMC/SD
 - NAND
 - UART
 - USB (host)

Device trees were taken from Linux mainline:
commit 37624b58542f ("Linux 5.1-rc7")

Signed-off-by: Niel Fourie <lusus@denx.de>
Signed-off-by: Parthiban Nallathambi <pn@denx.de>
Reviewed-by: Heiko Schocher <hs@denx.de>
Reviewed-by: Tom Rini <trini@konsulko.com>
Tested-by: Marek Vasut <marex@denx.de>
5 years agoARM: legoev3: convert to driver model
David Lechner [Wed, 29 May 2019 01:56:42 +0000 (20:56 -0500)]
ARM: legoev3: convert to driver model

This converts LEGO MINDSTORMS EV3 to the driver model. MMC, SERIAL, SPI
and SPI_FLASH are converted.

The device tree contains only the minimal nodes required by U-Boot
since the size of U-Boot is limited to 256K on this device.

Signed-off-by: David Lechner <david@lechnology.com>
5 years agortc: add Microcrystal RV-8803 driver
Michael Walle [Tue, 28 May 2019 23:29:58 +0000 (01:29 +0200)]
rtc: add Microcrystal RV-8803 driver

Signed-off-by: Michael Walle <michael@walle.cc>
5 years agousb: musb-new: omap2430: Fix compilation warning with USB_MUSB_GADGET
Derald D. Woods [Tue, 28 May 2019 02:22:00 +0000 (21:22 -0500)]
usb: musb-new: omap2430: Fix compilation warning with USB_MUSB_GADGET

This commit addresses the following warning, when _NOT_ USB_MUSB_HOST:

[...]
  CC      drivers/usb/gadget/f_mass_storage.o
  CC      drivers/usb/musb-new/omap2430.o
  CC      drivers/usb/gadget/f_fastboot.o
  CC      env/common.o
  CC      env/env.o
/src/etinker/software/u-boot-master/drivers/usb/musb-new/omap2430.c: In function ‘omap2430_musb_probe’:
/src/etinker/software/u-boot-master/drivers/usb/musb-new/omap2430.c:239:6: warning: assignment to ‘int’ from ‘struct musb *’ makes integer from pointer without a cast [-Wint-conversion]
  ret = musb_register(&platdata->plat,
      ^
  LD      drivers/usb/host/built-in.o
  CC      drivers/usb/gadget/f_sdp.o
  CC      fs/ext4/ext4fs.o
[...]

Signed-off-by: Derald D. Woods <woods.technical@gmail.com>
5 years agoARM: omap3: evm: Enable DM_USB in defconfig
Derald D. Woods [Tue, 28 May 2019 02:20:50 +0000 (21:20 -0500)]
ARM: omap3: evm: Enable DM_USB in defconfig

This addresses the following warning message:

===================== WARNING ======================
This board does not use CONFIG_DM_USB. Please update
the board to use CONFIG_DM_USB before the v2019.07 release.
Failure to update by the deadline may result in board removal.
See doc/driver-model/MIGRATION.txt for more info.
====================================================

As USB support for older OMAP3 SoC's improves, OMAP3 EVM can be
readily adapted. There is some additional 'gpio-hog' support
needed to fully setup USB in a similar manner to Linux.

Signed-off-by: Derald D. Woods <woods.technical@gmail.com>
5 years agoARM: dts: omap3-evm: Sync dts(i) files from Linux 5.1.5
Derald D. Woods [Tue, 28 May 2019 02:19:38 +0000 (21:19 -0500)]
ARM: dts: omap3-evm: Sync dts(i) files from Linux 5.1.5

Signed-off-by: Derald D. Woods <woods.technical@gmail.com>
5 years agortc: ds1307: add support for m41t11
Heiko Schocher [Mon, 27 May 2019 06:13:41 +0000 (08:13 +0200)]
rtc: ds1307: add support for m41t11

add m41t11 support in ds1307 driver. changes:

- add compatible string for m41t11
- check if RTC clock is running, if not
  enable the clock

Signed-off-by: Heiko Schocher <hs@denx.de>
5 years agommc: Register only the first MMC device on MMC_TINY
Ezequiel Garcia [Sat, 25 May 2019 22:25:22 +0000 (19:25 -0300)]
mmc: Register only the first MMC device on MMC_TINY

When MMC_TINY is enabled, support for only one MMC device
is provided. Boards that register more than one device,
will just write over mmc_static keeping only the last one
registered.

This commit prevents this, keeping only the first MMC
device created. A debug warning message is added, if nothing
else, as a hint/documentation for developers.

Signed-off-by: Ezequiel Garcia <ezequiel@collabora.com>
5 years agospl: Move SPL_MMC_TINY option to appear under SPL menu
Ezequiel Garcia [Sat, 25 May 2019 22:25:21 +0000 (19:25 -0300)]
spl: Move SPL_MMC_TINY option to appear under SPL menu

The SPL_MMC_TINY implements feature-reduced MMC support
on SPL, and as such, it's more consistent and convenient
to find it as part of the SPL configuration.

Signed-off-by: Ezequiel Garcia <ezequiel@collabora.com>
5 years agocmd: nvedit: Add sub-command 'env info'
Leo Ruan [Fri, 24 May 2019 15:20:19 +0000 (17:20 +0200)]
cmd: nvedit: Add sub-command 'env info'

Add sub-command 'env info' to display environment information:
- env_valid : is environment valid
- env_ready : is environment imported into hash table
- env_use_default : is default environment using

This command can be optionally used for evaluation in scripts:
[-d] : evaluate whether default environment is used
[-p] : evaluate whether environment can be persisted
The result of multiple evaluations will be combined with AND.

Signed-off-by: Leo Ruan <tingquan.ruan@cn.bosch.com>
Signed-off-by: Mark Jonas <mark.jonas@de.bosch.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
[trini: Do not enable by default]
Signed-off-by: Tom Rini <trini@konsulko.com>
5 years agodrivers: core: use strcmp when find device by name
Peng Fan [Wed, 22 May 2019 07:08:14 +0000 (07:08 +0000)]
drivers: core: use strcmp when find device by name

`if (!strncmp(dev->name, name, strlen(name)))` might find out
the wrong device, it might find out `dram_pll_ref_sel`, when name is
`dram_pll`. So use strcmp to avoid such issue.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
5 years agotest: dm: usb: use the real device name
Peng Fan [Wed, 22 May 2019 07:08:12 +0000 (07:08 +0000)]
test: dm: usb: use the real device name

"keyb" is not the real device name, "keyb@3" is.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
5 years agotest: dm: adc: use the real device name
Peng Fan [Wed, 22 May 2019 07:08:09 +0000 (07:08 +0000)]
test: dm: adc: use the real device name

"adc" is not the real device name, "adc@0" is.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
5 years agopci: ensure enumeration of all devices in pci_init
Marek Behún [Tue, 21 May 2019 10:04:31 +0000 (12:04 +0200)]
pci: ensure enumeration of all devices in pci_init

Use the uclass_first_device_check and uclass_next_device_check functions
instead of uclass_first_device and uclass_next_device in pci_init. This
ensures that all PCI devices are tried to be probed. Currently if a
device fails to probe, the enumeration stops and the devices which come
after the failed device are not probed.

Signed-off-by: Marek Behún <marek.behun@nic.cz>
Cc: Stefan Roese <sr@denx.de>
Cc: Anton Schubert <anton.schubert@gmx.de>
Cc: Dirk Eibach <dirk.eibach@gdsys.cc>
Cc: Mario Six <mario.six@gdsys.cc>
Cc: Chris Packham <chris.packham@alliedtelesis.co.nz>
Cc: Phil Sutter <phil@nwl.cc>
Cc: VlaoMao <vlaomao@gmail.com>
Cc: Tom Rini <trini@konsulko.com>
Reviewed-by: Stefan Roese <sr@denx.de>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
5 years agoboard: pm9263: Convert to CONFIG_DM_USB and CONFIG_DM_VIDEO
Ilko Iliev [Mon, 11 Mar 2019 12:06:25 +0000 (13:06 +0100)]
board: pm9263: Convert to CONFIG_DM_USB and CONFIG_DM_VIDEO

Convert the board to support the USB and video driver model and remove
the unnecessary code.

5 years agoboard: pm9261: Convert to CONFIG_DM_USB and CONFIG_DM_VIDEO
Ilko Iliev [Mon, 11 Mar 2019 12:06:24 +0000 (13:06 +0100)]
board: pm9261: Convert to CONFIG_DM_USB and CONFIG_DM_VIDEO

Convert the board to support the USB and video driver model and remove
the unnecessary code.

5 years agoboard: st: add missing gpio_request() for stm32f429-discovery
Patrice Chotard [Wed, 26 Jun 2019 08:26:41 +0000 (10:26 +0200)]
board: st: add missing gpio_request() for stm32f429-discovery

This fixes the following error message:

U-Boot 2019.07-rc4-00103-g5eea874b5e (Jun 25 2019 - 15:09:31 +0200)

DRAM:  8 MiB
gpio@40021800: dir_output: error: gpio GPIOG14 not reserved
gpio@40021800: dir_output: error: gpio GPIOG13 not reserved
gpio@40021800: set_value: error: gpio GPIOG14 not reserved
Flash: 2 MiB
....

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
5 years agogpio: stm32: Remove .ofmatch callback
Patrice Chotard [Fri, 21 Jun 2019 13:39:25 +0000 (15:39 +0200)]
gpio: stm32: Remove .ofmatch callback

As compatible string "st,stm32-gpio" is no more used, .ofmatch
callback becomes useless, remove it.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Patrick Delaunay <patrick.delaunay@st.com>
5 years agoARM: dts: stm32: Remove useless "st, stm32-gpio" compatible string
Patrice Chotard [Fri, 21 Jun 2019 13:39:24 +0000 (15:39 +0200)]
ARM: dts: stm32: Remove useless "st, stm32-gpio" compatible string

Since pinctrl_stm32 driver update, each gpio bank is now binded
by pinctrl driver. The compatible string "st,stm32-gpio" becomes
useless, remove it.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Patrick Delaunay <patrick.delaunay@st.com>
5 years agopinctrl: stm32: update .bind callback
Patrice Chotard [Fri, 21 Jun 2019 13:39:23 +0000 (15:39 +0200)]
pinctrl: stm32: update .bind callback

Update .bind callback in order to bind all pinctrl subnodes
with "gpio-controller" property to gpio_stm32 driver.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Patrick Delaunay <patrick.delaunay@st.com>
5 years agogpio: stm32: Rename stm32f7_gpio to stm32_gpio
Patrice Chotard [Fri, 21 Jun 2019 13:39:22 +0000 (15:39 +0200)]
gpio: stm32: Rename stm32f7_gpio to stm32_gpio

As this driver is used on stm32f4/f7/h7 and stm32mp1
SoCs, rename it with a more generic name.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Patrick Delaunay <patrick.delaunay@st.com>
5 years agospi: stm32: Fix warnings when compiling with W=1
Patrick Delaunay [Fri, 21 Jun 2019 13:26:58 +0000 (15:26 +0200)]
spi: stm32: Fix warnings when compiling with W=1

This patch solves the following warnings:

drivers/spi/stm32_spi.c: In function 'stm32_spi_write_txfifo':
drivers/spi/stm32_spi.c:116:20: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   if (priv->tx_len >= sizeof(u32) &&
                    ^~
drivers/spi/stm32_spi.c:122:27: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   } else if (priv->tx_len >= sizeof(u16) &&
                           ^~
drivers/spi/stm32_spi.c: In function 'stm32_spi_read_rxfifo':
drivers/spi/stm32_spi.c:150:21: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
       (priv->rx_len >= sizeof(u32) || (sr & SPI_SR_RXWNE))) {
                     ^~
drivers/spi/stm32_spi.c:156:21: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
       (priv->rx_len >= sizeof(u16) ||
                     ^~
drivers/core/simple-bus.c:15:12: warning: no previous prototype for 'simple_bus_translate' [-Wmissing-prototypes]
 fdt_addr_t simple_bus_translate(struct udevice *dev, fdt_addr_t addr)
            ^~~~~~~~~~~~~~~~~~~~
drivers/spi/stm32_spi.c: In function 'stm32_spi_set_speed':
drivers/spi/stm32_spi.c:335:10: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
      div > STM32_MBR_DIV_MAX)
          ^
drivers/spi/stm32_spi.c:344:19: warning: comparison of unsigned expression < 0 is always false [-Wtype-limits]
  if ((mbrdiv - 1) < 0)
                   ^
drivers/spi/stm32_spi.c: In function 'stm32_spi_probe':
drivers/spi/stm32_spi.c:531:16: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  for (i = 0; i < ARRAY_SIZE(priv->cs_gpios); i++) {
                ^
Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
5 years agocmd: pinmux: Fix warnings when compiling with W=1
Patrick Delaunay [Fri, 21 Jun 2019 13:26:56 +0000 (15:26 +0200)]
cmd: pinmux: Fix warnings when compiling with W=1

This patch solves the following warnings:

cmd/pinmux.c: In function 'do_dev':
cmd/pinmux.c:26:6: warning: this statement may fall through [-Wimplicit-fallthrough=]
   if (ret) {
      ^
cmd/pinmux.c:30:2: note: here
  case 1:
  ^~~~

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
5 years agospi: stm32_qspi: avoid warnings when building with W=1 option
Patrick Delaunay [Fri, 21 Jun 2019 13:26:55 +0000 (15:26 +0200)]
spi: stm32_qspi: avoid warnings when building with W=1 option

This patch solves warnings detected by setting W=1 when building.

Warnings type detected:
 - [-Wtype-limits]
 - [-Wsign-compare]

Signed-off-by: Christophe Kerello <christophe.kerello@st.com>
Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
5 years agomtd: rawnand: stm32_fmc2: avoid warnings when building with W=1 option
Patrick Delaunay [Fri, 21 Jun 2019 13:26:54 +0000 (15:26 +0200)]
mtd: rawnand: stm32_fmc2: avoid warnings when building with W=1 option

This patch solves warnings detected by setting W=1 when building.

Warnings type detected:
 - [-Wsign-compare]
 - [-Wtype-limits]

Signed-off-by: Christophe Kerello <christophe.kerello@st.com>
Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
5 years agopower: stpmic1: Fix warnings when compiling with W=1
Patrick Delaunay [Fri, 21 Jun 2019 13:26:53 +0000 (15:26 +0200)]
power: stpmic1: Fix warnings when compiling with W=1

This patch solves the following warnings:
warning: this statement may fall through [-Wimplicit-fallthrough=]

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
5 years agopinctrl: pinctrl_stm32: Fix warnings when compiling with W=1
Patrick Delaunay [Fri, 21 Jun 2019 13:26:52 +0000 (15:26 +0200)]
pinctrl: pinctrl_stm32: Fix warnings when compiling with W=1

This patch solves the following warnings:

warning: comparison of unsigned expression < 0 is always false [-Wtype-limits]
    if (*idx < 0)
             ^
drivers/pinctrl/pinctrl_stm32.c: At top level:
warning: no previous prototype for 'stm32_pinctrl_probe' [-Wmissing-prototypes]
 int stm32_pinctrl_probe(struct udevice *dev)
     ^~~~~~~~~~~~~~~~~~~

Signed-off-by: Patrice CHOTARD <patrice.chotard@st.com>
Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
5 years agoram: stm32mp1_ram: Fix warnings when compiling with W=1
Patrick Delaunay [Fri, 21 Jun 2019 13:26:51 +0000 (15:26 +0200)]
ram: stm32mp1_ram: Fix warnings when compiling with W=1

This patch solves the following warnings:

drivers/ram/stm32mp1/stm32mp1_ram.c: In function 'stm32mp1_ddr_clk_enable':
warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  for (idx = 0; idx < ARRAY_SIZE(clkname); idx++) {
                    ^
drivers/ram/stm32mp1/stm32mp1_ram.c: In function 'stm32mp1_ddr_setup':
warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  for (idx = 0; idx < ARRAY_SIZE(param); idx++) {
                    ^
Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
5 years agomisc: stm32_fuse: Fix warnings when compiling with W=1
Patrick Delaunay [Fri, 21 Jun 2019 13:26:50 +0000 (15:26 +0200)]
misc: stm32_fuse: Fix warnings when compiling with W=1

This patch solves the following warnings:

warning: no previous prototype for 'fuse_read' [-Wmissing-prototypes]
 int fuse_read(u32 bank, u32 word, u32 *val)
     ^~~~~~~~~
  CC      cmd/sf.o
warning: no previous prototype for 'fuse_prog' [-Wmissing-prototypes]
 int fuse_prog(u32 bank, u32 word, u32 val)
     ^~~~~~~~~
warning: no previous prototype for 'fuse_sense' [-Wmissing-prototypes]
 int fuse_sense(u32 bank, u32 word, u32 *val)
     ^~~~~~~~~~
warning: no previous prototype for 'fuse_override' [-Wmissing-prototypes]
 int fuse_override(u32 bank, u32 word, u32 val)
     ^~~~~~~~~~~~~

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
5 years agopower: regulator: stm32: Fix warnings when compiling with W=1
Patrick Delaunay [Fri, 21 Jun 2019 13:26:49 +0000 (15:26 +0200)]
power: regulator: stm32: Fix warnings when compiling with W=1

This patch solves the following warnings:

drivers/power/regulator/stm32-vrefbuf.c: In function 'stm32_vrefbuf_set_value':
warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   if (uV == stm32_vrefbuf_voltages[i]) {
          ^~

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
5 years agoclk: clk_stm32mp1: Fix warnings when compiling with W=1
Patrick Delaunay [Fri, 21 Jun 2019 13:26:48 +0000 (15:26 +0200)]
clk: clk_stm32mp1: Fix warnings when compiling with W=1

This patch solves the following warnings:

drivers/clk/clk_stm32mp1.c: In function 'stm32mp1_clk_get_parent':
warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  for (i = 0; i < ARRAY_SIZE(stm32mp1_clks); i++)
                ^
Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
5 years agoi2c: stm32f7_i2c: Fix warnings when compiling with W=1
Patrick Delaunay [Fri, 21 Jun 2019 13:26:47 +0000 (15:26 +0200)]
i2c: stm32f7_i2c: Fix warnings when compiling with W=1

This patch solves the following warnings:

drivers/i2c/stm32f7_i2c.c: In function 'stm32_i2c_compute_solutions':
warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
    if (scldel < scldel_min)
               ^
warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     if (((sdadel >= sdadel_min) &&
                  ^~
warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
          (sdadel <= sdadel_max)) &&
                  ^~
drivers/i2c/stm32f7_i2c.c: In function 'stm32_i2c_choose_solution':
warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
      if (clk_error < clk_error_prev) {
                    ^
Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
5 years agogpio: stm32_gpio: Fix warnings when compiling with W=1
Patrick Delaunay [Fri, 21 Jun 2019 13:26:46 +0000 (15:26 +0200)]
gpio: stm32_gpio: Fix warnings when compiling with W=1

This patch solves the following warnings:

drivers/gpio/stm32_gpio.c: In function 'stm32_offset_to_index':
: comparison between signed and unsigned integer expressions [-Wsign-compare]
    if (idx == offset)
            ^~
Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
5 years agoadc: stm32: Fix warnings when compiling with W=1
Patrick Delaunay [Fri, 21 Jun 2019 13:26:45 +0000 (15:26 +0200)]
adc: stm32: Fix warnings when compiling with W=1

This patch solves the following warnings:

drivers/adc/stm32-adc-core.c: In function 'stm32h7_adc_clk_sel':
warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   for (i = 0; i < ARRAY_SIZE(stm32h7_adc_ckmodes_spec); i++) {
                 ^
warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  for (i = 0; i < ARRAY_SIZE(stm32h7_adc_ckmodes_spec); i++) {
                ^
Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Acked-by: Fabrice Gasnier <fabrice.gasnier@st.com>
5 years agoadc: stm32-adc: Fix warnings when compiling with W=1
Patrick Delaunay [Fri, 21 Jun 2019 13:26:44 +0000 (15:26 +0200)]
adc: stm32-adc: Fix warnings when compiling with W=1

This patch solves the following warnings:

drivers/adc/stm32-adc.c: In function 'stm32_adc_chan_of_init':
warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  if (num_channels > adc->cfg->max_channels) {
                   ^
Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Acked-by: Fabrice Gasnier <fabrice.gasnier@st.com>
5 years agostm32mp1: bsec: Fix warnings when compiling with W=1
Patrick Delaunay [Fri, 21 Jun 2019 13:26:43 +0000 (15:26 +0200)]
stm32mp1: bsec: Fix warnings when compiling with W=1

This patch solves the following warnings:

arch/arm/mach-stm32mp/bsec.c: In function 'stm32mp_bsec_read':
warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  if (offset >= STM32_BSEC_OTP_OFFSET) {
             ^~
arch/arm/mach-stm32mp/bsec.c: In function 'stm32mp_bsec_write':
warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  if (offset >= STM32_BSEC_OTP_OFFSET) {
             ^~
Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
5 years agommc: stm32_sdmmc2: avoid warnings when building with W=1 option
Patrick Delaunay [Fri, 21 Jun 2019 13:26:42 +0000 (15:26 +0200)]
mmc: stm32_sdmmc2: avoid warnings when building with W=1 option

This patch solves warnings detected by setting W=1 when building.

Warnings type detected:
 - [-Wmissing-prototypes]
 - [-Wimplicit-fallthrough=]

Signed-off-by: Christophe Kerello <christophe.kerello@st.com>
Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
5 years agoserial: stm32: Fix warnings when compiling with W=1
Patrick Delaunay [Fri, 21 Jun 2019 13:26:41 +0000 (15:26 +0200)]
serial: stm32: Fix warnings when compiling with W=1

This patch solves the following warnings:

drivers/serial/serial_stm32.c: In function 'stm32_serial_probe':
warning: comparison of unsigned expression < 0 is always false [-Wtype-limits]
  if (plat->clock_rate < 0) {
                       ^

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>