oweals/u-boot.git
4 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

4 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

4 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>
4 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>
4 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>
4 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>
4 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>
4 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>
4 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>
4 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>
4 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>
4 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>
4 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>
4 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>
4 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>
4 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>
4 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>
4 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>
4 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>
4 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>
4 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>
4 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>
4 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>
4 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>
4 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>
4 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>
4 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>
4 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.

4 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.

4 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>
4 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>
4 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>
4 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>
4 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>
4 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>
4 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>
4 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>
4 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>
4 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>
4 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>
4 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>
4 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>
4 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>
4 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>
4 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>
4 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>
4 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>
4 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>
4 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>
4 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>
4 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>
4 years agoboard: stm32mp1: Fix warnings when compiling with W=1
Patrick Delaunay [Fri, 21 Jun 2019 13:26:40 +0000 (15:26 +0200)]
board: stm32mp1: Fix warnings when compiling with W=1

This patch solves the following warnings:

warning: no previous prototype for 'board_quiesce_devices' [-Wmissing-prototypes]
 void board_quiesce_devices(void)
      ^~~~~~~~~~~~~~~~~~~~~

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

This patch solves the following warnings:

arch/arm/mach-stm32mp/cpu.c:378:16: warning: comparison between signed
and unsigned integer expressions [-Wsign-compare]
   if (instance > ARRAY_SIZE(serial_addr))
                ^

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
4 years agoMAINTAINERS: Add git custodians for ARM STM STM32MP entry
Patrice Chotard [Thu, 20 Jun 2019 13:35:28 +0000 (15:35 +0200)]
MAINTAINERS: Add git custodians for ARM STM STM32MP entry

Add git custodians for STMicroelectronics STM32MP entry.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
4 years agostm32mp1: add SPI flash support in SPL
Patrick Delaunay [Thu, 11 Jul 2019 09:25:54 +0000 (11:25 +0200)]
stm32mp1: add SPI flash support in SPL

Allow boot from NOR with basic boot.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
4 years agostm32mp1: Add UBIFS boot capability
Patrick Delaunay [Fri, 21 Jun 2019 13:39:55 +0000 (15:39 +0200)]
stm32mp1: Add UBIFS boot capability

Add support for boot from NAND in generic ditribution command.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
4 years agostm32mp1: activate OF_BOARD_SETUP and FDT_FIXUP_PARTITIONS
Patrick Delaunay [Tue, 2 Jul 2019 11:26:07 +0000 (13:26 +0200)]
stm32mp1: activate OF_BOARD_SETUP and FDT_FIXUP_PARTITIONS

Update kernel MTD partition in device tree with U-Boot information.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
4 years agostm32mp1: add configuration op-tee
Patrick Delaunay [Tue, 2 Jul 2019 11:26:06 +0000 (13:26 +0200)]
stm32mp1: add configuration op-tee

Add support of Trusted boot chain with OP-TEE
- reserved 32MB at the end of the DDR for OP-TEE

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
4 years agostm32mp1: reorder some CONFIG in stm32mp1.h
Patrick Delaunay [Tue, 2 Jul 2019 11:26:05 +0000 (13:26 +0200)]
stm32mp1: reorder some CONFIG in stm32mp1.h

Change config not directly linked to CONFIG_DISTRO_DEFAULTS.
Allow to deactivate CONFIG_SYS_MTDPARTS_RUNTIME when
CONFIG_MTDPARTS_DEFAULT is defined in defconfig.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
4 years agopmic: stpmic1: add support for SYSRESET_POWER_OFF
Patrick Delaunay [Mon, 20 May 2019 07:47:07 +0000 (09:47 +0200)]
pmic: stpmic1: add support for SYSRESET_POWER_OFF

Adds support for SYSRESET_POWER_OFF = PMIC power off used by command
power off and introduced by commit 751fed426f87 ("sysreset: Add a way
to find the last reset").
The driver use SYSRESET_POWER for the PMIC-level power cycle, with restart.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
4 years agoARM: dts: stm32mp1: sync device tree with v5.2-rc4
Patrick Delaunay [Thu, 11 Jul 2019 09:15:28 +0000 (11:15 +0200)]
ARM: dts: stm32mp1: sync device tree with v5.2-rc4

Synchronize device tree with v5.2-rc4 label and
update the associated u-boot dtsi.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Tested-by: Pierre-Jean Texier <pjtexier@koncepto.io>
4 years agostm32mp1: force boot_net_usb_start
Patrick Delaunay [Fri, 5 Jul 2019 15:20:22 +0000 (17:20 +0200)]
stm32mp1: force boot_net_usb_start

Prevent USB enumeration and avoid unnecessary delay in bootcmd_pxe
as Ethernet device is not attached to USB.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
4 years agostm32mp1: add check for presence of environment in boot device
Patrick Delaunay [Fri, 5 Jul 2019 15:20:21 +0000 (17:20 +0200)]
stm32mp1: add check for presence of environment in boot device

For boot from flash, check presence of default environment to force
save env.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Tested-by: Pierre-Jean Texier <pjtexier@koncepto.io>
4 years agostm32mp1: configs: Add CONFIG_OF_SPL_REMOVE_PROPS
Patrick Delaunay [Fri, 5 Jul 2019 15:20:20 +0000 (17:20 +0200)]
stm32mp1: configs: Add CONFIG_OF_SPL_REMOVE_PROPS

Removes unused device tree property in SPL
to reduce the SPL size by 1kB

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
4 years agostm32mp1: cosmetic: remove unnecessary include
Patrick Delaunay [Fri, 5 Jul 2019 15:20:19 +0000 (17:20 +0200)]
stm32mp1: cosmetic: remove unnecessary include

Remove post.h include as it is used in spl.c

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
4 years agostm32mp1: update README
Patrick Delaunay [Fri, 5 Jul 2019 15:20:18 +0000 (17:20 +0200)]
stm32mp1: update README

Add latest information and correct some information.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
4 years agostm32mp1: key: add stm32key command
Patrick Delaunay [Fri, 5 Jul 2019 15:20:17 +0000 (17:20 +0200)]
stm32mp1: key: add stm32key command

Add dedicated command to register in fuse a public hash
key provided by keygen tool.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
4 years agostm32mp1: add stboard command
Patrick Delaunay [Fri, 5 Jul 2019 15:20:16 +0000 (17:20 +0200)]
stm32mp1: add stboard command

Allow to update board identification in OTP 59.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
4 years agostm32mp1: update device tree with ETZPC status
Patrick Delaunay [Fri, 5 Jul 2019 15:20:15 +0000 (17:20 +0200)]
stm32mp1: update device tree with ETZPC status

U-Boot should disable nodes in device tree if needed according
ETZPC status in ft_system_setup().

ETZPC itself use an array on addresses to do the match between the status
bits and the node.

Signed-off-by: Benjamin Gaignard <benjamin.gaignard@st.com>
Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
4 years agostm32mp1: update package information in device tree
Patrick Delaunay [Fri, 5 Jul 2019 15:20:14 +0000 (17:20 +0200)]
stm32mp1: update package information in device tree

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
4 years agostm32mp1: export get_cpu_package function
Patrick Delaunay [Fri, 5 Jul 2019 15:20:13 +0000 (17:20 +0200)]
stm32mp1: export get_cpu_package function

Prepare update of package information update
in Linux device tree.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
4 years agodt-bindings: pinctrl: stm32: add new entry for package information
Patrick Delaunay [Fri, 5 Jul 2019 15:20:12 +0000 (17:20 +0200)]
dt-bindings: pinctrl: stm32: add new entry for package information

Add "st,package" entry. Possibles values are:
-STM32MP_PKG_AA for LFBGA448 (18*18) package
-STM32MP_PKG_AB for LFBGA354 (16*16) package
-STM32MP_PKG_AC for TFBGA361 (12*12) package
-STM32MP_PKG_AD for TFBGA257 (10*10) package

see Linux commit 966d9b928f626a54a0c27c0fdae1e3dfe9bab416
for v5.2-rc1

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
4 years agostm32mp1: syscon: remove stgen
Patrick Delaunay [Fri, 5 Jul 2019 15:20:11 +0000 (17:20 +0200)]
stm32mp1: syscon: remove stgen

Reduce difference with kernel Linux device tree.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
4 years agostm32mp1: syscon: remove etzpc support
Patrick Delaunay [Fri, 5 Jul 2019 15:20:10 +0000 (17:20 +0200)]
stm32mp1: syscon: remove etzpc support

Support for ETZPC is removed as this device is not present
in Linux kernel device tree.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
4 years agostm32mp1: call regulators_enable_boot_on in board_init
Patrick Delaunay [Fri, 5 Jul 2019 15:20:09 +0000 (17:20 +0200)]
stm32mp1: call regulators_enable_boot_on in board_init

U-Boot activates regulators by reading the "regulator-boot-on"
property in DT; it is requested by M4 early Boot feature.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
4 years agostm32mp1: deactivate WATCHDOG in defconfig
Patrick Delaunay [Fri, 5 Jul 2019 15:20:08 +0000 (17:20 +0200)]
stm32mp1: deactivate WATCHDOG in defconfig

Deactivate WATCHDOG by default in u-boot to avoid issue to boot kernel
and rootfs without the needed daemon to reload it.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Tested-by: Pierre-Jean Texier <pjtexier@koncepto.io>
4 years agosysreset: syscon: add support for power off
Patrick Delaunay [Mon, 20 May 2019 08:58:39 +0000 (10:58 +0200)]
sysreset: syscon: add support for power off

The new type sysreset 'POWER_OFF', introduced by
commit 751fed426f87 ("sysreset: Add a way to find the last reset")
is only supported for "syscon-poweroff" compatible.

For details see Linux binding:
./Documentation/devicetree/bindings/power/reset/syscon-poweroff.txt

This patch removes the support of POWER_OFF for "syscon-reboot"
and keeps only the COLD reset (for command reset support)
and it introduces the compatible "syscon-poweroff"
for the POWER_OFF case.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
4 years agostm32mp1: move CONFIG_ENV in Kconfig
Patrick Delaunay [Fri, 14 Jun 2019 11:05:59 +0000 (13:05 +0200)]
stm32mp1: move CONFIG_ENV in Kconfig

Move 2 ENV configuration flags in board Kconfig
- CONFIG_ENV_SECT_SIZE
- CONFIG_ENV_OFFSET

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
4 years agoARM: dts: stm32: Add ipcc mailbox support on stm32mp1
Fabien Dessenne [Tue, 14 May 2019 09:20:37 +0000 (11:20 +0200)]
ARM: dts: stm32: Add ipcc mailbox support on stm32mp1

Add IPCC mailbox support on stm32mp157 eval and disco boards.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@st.com>
4 years agoconfigs: stm32mp15: enable IPCC mailbox
Fabien Dessenne [Tue, 14 May 2019 09:20:36 +0000 (11:20 +0200)]
configs: stm32mp15: enable IPCC mailbox

Activate the ipcc mailbox for stm32mp15 configs.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@st.com>
4 years agoMAINTAINERS: Add stm32 mailbox IPPC driver
Fabien Dessenne [Tue, 14 May 2019 09:20:35 +0000 (11:20 +0200)]
MAINTAINERS: Add stm32 mailbox IPPC driver

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@st.com>
4 years agomailbox: introduce stm32-ipcc driver
Fabien Dessenne [Tue, 14 May 2019 09:20:34 +0000 (11:20 +0200)]
mailbox: introduce stm32-ipcc driver

On STM32 family, the IPCC peripheral allows the communication
between 2 processors offering doorbells mechanism.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@st.com>
4 years agoMerge tag 'dm-pull-9jul19-take2' of https://gitlab.denx.de/u-boot/custodians/u-boot-dm
Tom Rini [Thu, 11 Jul 2019 22:10:11 +0000 (18:10 -0400)]
Merge tag 'dm-pull-9jul19-take2' of https://gitlab.denx.de/u-boot/custodians/u-boot-dm

- Sandbox improvements including .dts refactor
- Minor tracing and PCI improvements
- Various other minor fixes
- Conversion of patman, dtoc and binman to support Python 3

4 years agoMerge https://gitlab.denx.de/u-boot/custodians/u-boot-marvell
Tom Rini [Thu, 11 Jul 2019 22:09:38 +0000 (18:09 -0400)]
Merge https://gitlab.denx.de/u-boot/custodians/u-boot-marvell

- SPL SATA enhancements to allow booting from RAW SATA device
  needed for Clearfog (Baruch)
- Enable SATA booting on Clearfog (Baruch)
- Misc changes to Turris Omnia (Marek)
- Enable CMD_BOOTZ and increase SYS_BOOTM_LEN on crs305-1g-4s
  (Luka)
- Enable FIT support for db-xc3-24g4xg (Chris)
- Enable DM_SPI on Keymile Kirkwood board with necessary changes
  for this (Pascal)
- Set 38x and 39x AVS on lower frequency (Baruch)

4 years agoMerge tag 'uniphier-v2019.10' of https://gitlab.denx.de/u-boot/custodians/u-boot...
Tom Rini [Thu, 11 Jul 2019 22:08:44 +0000 (18:08 -0400)]
Merge tag 'uniphier-v2019.10' of https://gitlab.denx.de/u-boot/custodians/u-boot-uniphier

UniPhier SoC updates for v2019.10

- import DT updates from Linux

- add UniPhier SPI controller driver

- make U-Boot image for 64bit SoCs position independent

- tidy up various init code for next generation SoCs

- misc cleanups

4 years agoMerge branch '2019-07-11-master-imports'
Tom Rini [Thu, 11 Jul 2019 22:03:52 +0000 (18:03 -0400)]
Merge branch '2019-07-11-master-imports'

- spear platform improvements
- Android BCB support
- Cadence PCIe endpoint driver

4 years agogpio: pca953x: Add TI TCA9539 compatible string
Marek Vasut [Sat, 25 May 2019 20:52:20 +0000 (22:52 +0200)]
gpio: pca953x: Add TI TCA9539 compatible string

Add TI TCA9539 compatible string for yet another I2C GPIO expander.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Mario Six <mario.six@gdsys.cc>
Cc: Peng Fan <van.freenix@gmail.com>
Cc: Simon Glass <sjg@chromium.org>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
4 years agoarm: mach-omap2: am33xx: Init pinmux before clock
Marek Vasut [Sat, 25 May 2019 20:40:35 +0000 (22:40 +0200)]
arm: mach-omap2: am33xx: Init pinmux before clock

The board_early_init_f() inits clock before initing pinmux. However,
the clock configuration code might need to adjust PMIC settings of a
PMIC on I2C bus (e.g. board/ti/am335x/board.c does that). If the I2C
bus pin muxing is not configured before attempting to communicate
with the PMIC, the communication will silently fail and the prcm_init()
may configure fast enough CPU clock that the default voltage provided
by the PMIC would be insufficient and the platform would become
unstable.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Jean-Jacques Hiblot <jjhiblot@ti.com>
Cc: Tom Rini <trini@konsulko.com>
4 years agodoc: relocate/rename Android README and add BCB overview
Eugeniu Rosca [Thu, 23 May 2019 15:32:23 +0000 (17:32 +0200)]
doc: relocate/rename Android README and add BCB overview

Rename:
 - doc/{README.avb2 => android/avb2.txt}
 - doc/{README.android-fastboot => android/fastboot.txt}

Add a new file documenting the 'bcb' command:
 - doc/android/bcb.txt

The new directory structure has been reviewed by Simon in
https://patchwork.ozlabs.org/patch/1101107/#2176031 .

Signed-off-by: Eugeniu Rosca <erosca@de.adit-jv.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
4 years agocmd: Add 'bcb' command to read/modify/write BCB fields
Eugeniu Rosca [Thu, 23 May 2019 15:32:22 +0000 (17:32 +0200)]
cmd: Add 'bcb' command to read/modify/write BCB fields

'Bootloader Control Block' (BCB) is a well established term/acronym in
the Android namespace which refers to a location in a dedicated raw
(i.e. FS-unaware) flash (e.g. eMMC) partition, usually called "misc",
which is used as media for exchanging messages between Android userspace
(particularly recovery [1]) and an Android-capable bootloader.

On higher level, this allows implementing a subset of Android Bootloader
Requirements [2], amongst which is the Android-specific bootloader
flow [3]. Regardless how the latter is implemented in U-Boot ([3] being
the most memorable example), reading/writing/dumping the BCB fields in
the development process from inside the U-Boot is a convenient feature.
Hence, make it available to the users.

Some usage examples of the new command recorded on R-Car H3ULCB-KF
('>>>' is an overlay on top of the original console output):

=> bcb
bcb - Load/set/clear/test/dump/store Android BCB fields

Usage:
bcb load  <dev> <part>       - load  BCB from mmc <dev>:<part>
bcb set   <field> <val>      - set   BCB <field> to <val>
bcb clear [<field>]          - clear BCB <field> or all fields
bcb test  <field> <op> <val> - test  BCB <field> against <val>
bcb dump  <field>            - dump  BCB <field>
bcb store                    - store BCB back to mmc

Legend:
<dev>   - MMC device index containing the BCB partition
<part>  - MMC partition index or name containing the BCB
<field> - one of {command,status,recovery,stage,reserved}
<op>    - the binary operator used in 'bcb test':
          '=' returns true if <val> matches the string stored in <field>
          '~' returns true if <val> matches a subset of <field>'s string
<val>   - string/text provided as input to bcb {set,test}
          NOTE: any ':' character in <val> will be replaced by line feed
          during 'bcb set' and used as separator by upper layers

=> bcb dump command
Error: Please, load BCB first!
 >>> Users must specify mmc device and partition before any other call

=> bcb load 1 misc
=> bcb load 1 1
 >>> The two calls are equivalent (assuming "misc" has index 1)

=> bcb dump command
00000000: 62 6f 6f 74 6f 6e 63 65 2d 73 68 65 6c 6c 00 72    bootonce-shell.r
00000010: 79 00 72 00 00 00 00 00 00 00 00 00 00 00 00 00    y.r.............
 >>> The output is in binary/string format for convenience
 >>> The output size matches the size of inspected BCB field
 >>> (32 bytes in case of 'command')

=> bcb test command = bootonce-shell && echo true
true
=> bcb test command = bootonce-shell- && echo true
=> bcb test command = bootonce-shel && echo true
 >>> The '=' operator returns 'true' on perfect match

=> bcb test command ~ bootonce-shel && echo true
true
=> bcb test command ~ bootonce-shell && echo true
true
 >>> The '~' operator returns 'true' on substring match

=> bcb set command recovery
=> bcb dump command
00000000: 72 65 63 6f 76 65 72 79 00 73 68 65 6c 6c 00 72    recovery.shell.r
00000010: 79 00 72 00 00 00 00 00 00 00 00 00 00 00 00 00    y.r.............
 >>> The new value is NULL-terminated and stored in the BCB field

=> bcb set recovery "msg1:msg2:msg3"
=> bcb dump recovery
00000040: 6d 73 67 31 0a 6d 73 67 32 0a 6d 73 67 33 00 00    msg1.msg2.msg3..
00000050: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
00000060: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
 >>> --- snip ---
 >>> Every ':' is replaced by line-feed '\n' (0xA). The latter is used
 >>> as separator between individual commands by Android userspace

=> bcb store
 >>> Flush/store the BCB structure to MMC

[1] https://android.googlesource.com/platform/bootable/recovery
[2] https://source.android.com/devices/bootloader
[3] https://patchwork.ozlabs.org/patch/746835/
    ("[U-Boot,5/6] Initial support for the Android Bootloader flow")

Signed-off-by: Eugeniu Rosca <erosca@de.adit-jv.com>
4 years agoinclude: android_bootloader_message.h: Minimize the diff to AOSP
Eugeniu Rosca [Thu, 23 May 2019 15:32:21 +0000 (17:32 +0200)]
include: android_bootloader_message.h: Minimize the diff to AOSP

Perform the following updates:
 - Relocate the commit id from the file to the description of U-Boot
   commit. The AOSP commit is c784ce50e8c10eaf70e1f97e24e8324aef45faf5.
   This is done to avoid stale references in the file itself. The
   reasoning is in https://patchwork.ozlabs.org/patch/1098056/#2170209.
 - Minimize the diff to AOSP, to decrease the effort of the next AOSP
   backports. The background can be found in:
   https://patchwork.ozlabs.org/patch/1080394/#2168454.
 - Guard the static_assert() calls by #ifndef __UBOOT__ ... #endif,
   to avoid compilation failures of files including the header.

Signed-off-by: Eugeniu Rosca <erosca@de.adit-jv.com>
Reviewed-by: Sam Protsenko <semen.protsenko@linaro.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
4 years agoSPL: Default to disabling legacy image support when using FIT
Tom Rini [Thu, 23 May 2019 11:14:08 +0000 (07:14 -0400)]
SPL: Default to disabling legacy image support when using FIT

When we have a FIT image being used by SPL by default that means the
most common case is that we'll never run into a legacy image.  Disable
legacy image support by default in that case to reclaim space.

Signed-off-by: Tom Rini <trini@konsulko.com>
4 years agoconfigs: Rename CONFIG_IMAGE_FORMAT_LEGACY to CONFIG_LEGACY_IMAGE_FORMAT
Tom Rini [Thu, 23 May 2019 11:14:07 +0000 (07:14 -0400)]
configs: Rename CONFIG_IMAGE_FORMAT_LEGACY to CONFIG_LEGACY_IMAGE_FORMAT

The name CONFIG_LEGACY_IMAGE_FORMAT reads slightly better along with
allowing us to avoid a rather nasty Kbuild/Kconfig issue down the line
with CONFIG_IS_ENABLED(IMAGE_FORMAT_LEGACY).  In a few places outside of
cmd/ switch to using CONFIG_IS_ENABLED() to test what is set.

Signed-off-by: Tom Rini <trini@konsulko.com>
4 years agotpm: wait for valid status
Roman Kapl [Thu, 16 May 2019 16:32:48 +0000 (18:32 +0200)]
tpm: wait for valid status

The TPM specification says that the EXPECT_DATA bit is not valid until
the VALID bit is set. Wait for that bit to be set. Fixes problems with
Ifineon SPI TPM.

Signed-off-by: Roman Kapl <rka@sysgo.com>
4 years agoarm: spear: Return to BootROM if failing to boot from the main device
Miquel Raynal [Tue, 7 May 2019 12:18:54 +0000 (14:18 +0200)]
arm: spear: Return to BootROM if failing to boot from the main device

Overload the weak function board_boot_order() so that besides choosing
the main boot device, we can fallback on USB boot by returning in the
BootROM, eg. if the NOR flash is empty while it was the primary boot
medium.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Reviewed-by: Stefan Roese <sr@denx.de>
4 years agoarm: spear: Do not link the _main branch
Miquel Raynal [Tue, 7 May 2019 12:18:53 +0000 (14:18 +0200)]
arm: spear: Do not link the _main branch

The _main call is not supposed to return at all: don't link the
branch.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Reviewed-by: Stefan Roese <sr@denx.de>
4 years agoarm: spear: Support returning to BootROM
Miquel Raynal [Tue, 7 May 2019 12:18:52 +0000 (14:18 +0200)]
arm: spear: Support returning to BootROM

Implement the weak board_return_to_bootrom() function so that when
enabling the spl_bootrom.c driver, one can make use of usbboot on
spear platforms. All necessary information to return to the BootROM
are stored in the BootROM's stack. The SPL stack pointer is reset so
we save the BootROM's stack pointer into the SPL .data section.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Reviewed-by: Stefan Roese <sr@denx.de>
4 years agoarm: spear: Simplify start.S organization
Miquel Raynal [Tue, 7 May 2019 12:18:51 +0000 (14:18 +0200)]
arm: spear: Simplify start.S organization

There is no reason to do the few spear-related initialization, in a
different procedure than 'reset'. Spare one branching and get a linear
code flow by removing this indirection.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Reviewed-by: Stefan Roese <sr@denx.de>
4 years agoarm: spear: Reference the link register with LR instead of R14
Miquel Raynal [Tue, 7 May 2019 12:18:50 +0000 (14:18 +0200)]
arm: spear: Reference the link register with LR instead of R14

The link register is stored in R14. ARM assembly code allows to use
the 'lr' name to reference it instead of 'r14' which is not very
meaningful. Do the substitution to ease the reading.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Reviewed-by: Stefan Roese <sr@denx.de>
4 years agoarm: spear: Use PUSH/POP mnemonics when relevant
Miquel Raynal [Tue, 7 May 2019 12:18:49 +0000 (14:18 +0200)]
arm: spear: Use PUSH/POP mnemonics when relevant

Quoting ARM "RealView Compilation Tools Assembler Guide v4.0":

        PUSH and POP are synonyms for STMDB and LDM (or LDMIA), with
        the base register sp (r13), and the adjusted address written
        back to the base register.
PUSH and POP are the preferred mnemonic in these cases.

Let's follow this recommandation to ease the reading and substitute
LDMIA/STMDB operations with PUSH/POP mnemonics.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Reviewed-by: Stefan Roese <sr@denx.de>