]> git.dujemihanovic.xyz Git - u-boot.git/log
u-boot.git
5 years agoMerge tag 'u-boot-imx-20190719' of https://gitlab.denx.de/u-boot/custodians/u-boot-imx
Tom Rini [Sat, 27 Jul 2019 13:35:05 +0000 (09:35 -0400)]
Merge tag 'u-boot-imx-20190719' of https://gitlab.denx.de/u-boot/custodians/u-boot-imx

u-boot-imx-20190719

- CCF for i.MX6
- nandbcb command to write SPL into NAND
- Switch to DM (i.MX28)
- Boards: Toradex, engicam, DH
- Fixes for i.MX8
- Fixes for i.MX7ULP

Travis: https://travis-ci.org/sbabic/u-boot-imx/builds/561147504

5 years agoMerge branch 'master' of https://gitlab.denx.de/u-boot/custodians/u-boot-spi
Tom Rini [Sat, 27 Jul 2019 13:34:07 +0000 (09:34 -0400)]
Merge branch 'master' of https://gitlab.denx.de/u-boot/custodians/u-boot-spi

- fix for fsl_qspi read timeout (Thomas)
- spi-mem read data size fix (Ye Li)
- SiFive SPI driver, mmc_spi flags (Bhargav, Anup)
- Micron spi-nor parts (Ashish)
- MT7629 spi-mem driver(Weijie)

5 years agoMerge https://gitlab.denx.de/u-boot/custodians/u-boot-net
Tom Rini [Thu, 25 Jul 2019 19:02:36 +0000 (15:02 -0400)]
Merge https://gitlab.denx.de/u-boot/custodians/u-boot-net

- DaVinci emac DM work
- NXP driver work
- macb updates for RISC-V

5 years agonet: sun8i_emac: Test the correct phy
Emmanuel Vadot [Fri, 19 Jul 2019 20:26:38 +0000 (22:26 +0200)]
net: sun8i_emac: Test the correct phy

H3/H5 can either use the internal phy or an external one.
Before getting clock and resets for the internal phy,
test that we are using it because otherwise it break emac
when using an external phy.

Tested-on: OrangePi PC2 (H5)
Fixes: 2348453c41 (net: sun8i_emac: Add EPHY CLK and RESET support)
Signed-off-by: Emmanuel Vadot <manu@freebsd.org>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
5 years agonet: davinci_emac: convert to using the driver model
Bartosz Golaszewski [Wed, 24 Jul 2019 08:12:07 +0000 (10:12 +0200)]
net: davinci_emac: convert to using the driver model

Now that we removed all legacy boards selecting TI_EMAC we can
completely convert the driver code to using the driver model.
This patch also updates all remaining users of davinci_emac.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
Tested-by: Adam Ford <aford173@gmail.com> #am3517-evm & da850-evm
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
5 years agoriscv: sifive: fu540: Sync-up config header with RISC-V QEMU support
Anup Patel [Wed, 24 Jul 2019 04:09:44 +0000 (04:09 +0000)]
riscv: sifive: fu540: Sync-up config header with RISC-V QEMU support

We typically use same set of distro images (yocto, debian, fedora, etc.)
on both QEMU RISC-V virt machine and SiFive Unleashed board.

With growing kernel and ramdisk images, we need to re-adjust default
U-Boot environment variables. The config header for QEMU RISC-V virt
machine has been already updated to handle bigger kernel and ramdisk
images hence this patch updates SiFive FU540 config header accordingly.

Signed-off-by: Anup Patel <anup.patel@wdc.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Joe Hershberger <joe.hershberger@ni.com>
Reviewed-by: David Abdurachmanov <david.abdurachmanov@sifive.com>
Tested-by: David Abdurachmanov <david.abdurachmanov@sifive.com>
5 years agonet: macb: Fix check for little-endian system in gmac_configure_dma()
Anup Patel [Wed, 24 Jul 2019 04:09:37 +0000 (04:09 +0000)]
net: macb: Fix check for little-endian system in gmac_configure_dma()

Instead of depending on CONFIG_SYS_LITTLE_ENDIAN, we check at runtime
whether underlying system is little-endian or big-endian. This way
we are not dependent on any U-Boot specific OR compiler specific macro
to check system endianness.

Signed-off-by: Anup Patel <anup.patel@wdc.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
5 years agonet: macb: Extend MACB driver for SiFive Unleashed board
Anup Patel [Wed, 24 Jul 2019 04:09:32 +0000 (04:09 +0000)]
net: macb: Extend MACB driver for SiFive Unleashed board

The SiFive MACB ethernet has a custom TX_CLK_SEL register to select
different TX clock for 1000mbps vs 10/100mbps.

This patch adds SiFive MACB compatible string and extends the MACB
ethernet driver to change TX clock using TX_CLK_SEL register for
SiFive MACB.

Signed-off-by: Anup Patel <anup.patel@wdc.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
5 years agoAdd support for the NXP LS1021A-TSN board
Jianchao Wang [Thu, 18 Jul 2019 21:30:01 +0000 (00:30 +0300)]
Add support for the NXP LS1021A-TSN board

The LS1021A-TSN is a development board built by VVDN/Argonboards in
partnership with NXP.

It features the LS1021A SoC and the first-generation SJA1105T Ethernet
switch for prototyping implementations of a subset of IEEE 802.1 TSN
standards.

Supported boot media: microSD card (via SPL), QSPI flash.

Rev. A of the board uses a Spansion S25FL512S_256K serial flash, which
is 64 MB in size and has an erase sector size of 256KB (therefore,
flashing the RCW would erase part of U-Boot).

Rev. B and C of the board use a Spansion S25FL256S1 serial flash, which
is only 32 MB in size but has an erase sector size of 64KB (therefore
the RCW image can be flashed without erasing U-Boot).

To avoid the problems above, the U-Boot base address has been selected
at 0x100000 (the start of the 5th 256KB erase sector), which works for
all board revisions. Actually 0x40000 would have been enough, but
0x100000 is common for all Layerscape devices.

eTSEC3 is connecting directly to SJA1105 via an RGMII fixed-link, but
SJA1105 is currently not supported by uboot. Therefore, eTSEC3 is
disabled.

Signed-off-by: Xiaoliang Yang <xiaoliang.yang_1@nxp.com>
Signed-off-by: Mingkai Hu <mingkai.hu@nxp.com>
Signed-off-by: Jianchao Wang <jianchao.wang@nxp.com>
Signed-off-by: Changming Huang <jerry.huang@nxp.com>
Signed-off-by: Vladimir Oltean <olteanv@gmail.com>
[Vladimir] Code taken from https://github.com/openil/u-boot (which
itself is mostly copied from ls1021a-iot) and adapted with the following
changes:

- Add a008850 errata workaround
- Converted eTSEC, MMC to DM to avoid all build warnings
- Plugged in distro boot feature, including support for extlinux.conf
- Added defconfig for QSPI boot
- Added the board/freescale/ls1021atsn/README.rst for initial setup
- Increased CONFIG_SYS_MONITOR_LEN so that the SPL malloc pool does not
  get overwritten during copying of the u-boot.bin payload from MMC to
  DDR.
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
5 years agoconfigs: ls1021atwr: Fix distro_bootcmd for QSPI boot
Vladimir Oltean [Thu, 18 Jul 2019 21:30:00 +0000 (00:30 +0300)]
configs: ls1021atwr: Fix distro_bootcmd for QSPI boot

Due to a typo, "run qspi_bootcmd" and "env exists secureboot" got
concatenated instead of being separated by a semicolon.

Signed-off-by: Vladimir Oltean <olteanv@gmail.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
5 years agoarm: ls1021atwr: Convert to use driver model TSEC driver
Bin Meng [Thu, 18 Jul 2019 21:29:59 +0000 (00:29 +0300)]
arm: ls1021atwr: Convert to use driver model TSEC driver

Now that we have added driver model support to the TSEC driver,
convert ls1021atwr board to use it.

This depends on previous DM series for ls1021atwr:
http://patchwork.ozlabs.org/patch/561855/

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Signed-off-by: Vladimir Oltean <olteanv@gmail.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
[Vladimir] Made the following changes:
- Added 'status = "disabled";' for all Ethernet ports in ls1021a.dtsi
- Fixed the confusion between the SGMII/TBI PCS for enet0 and enet1 -
  a mistake ported over from Linux. Each SGMII PCS lies on the private
  MDIO bus of the interface (and the RGMII enet2 has no SGMII PCS).
- Added CONFIG_DM_ETH to all ls1021atwr_* defconfigs
- Completely removed non-DM_ETH support from ls1021atwr
- Changed "compatible" string from "fsl,tsec-mdio" to "fsl,etsec2-mdio"
  and from "fsl,tsec" to "fsl,etsec2" to match Linux

5 years agonet: tsec: Change compatible strings to match Linux
Vladimir Oltean [Thu, 18 Jul 2019 21:29:58 +0000 (00:29 +0300)]
net: tsec: Change compatible strings to match Linux

In the case of the tsec network driver, so far there has been no
mainline user of DM_ETH where the DT bindings get used.

In the case of the mdio bus, it looks like the "fsl,tsec-mdio" string
was made up for the documentation, but there is no mainline code that
parses the "compatible" property anyway.

In both cases, there are no DT blobs that contain the old strings.

So change the documentation to "fsl,etsec2" for the Ethernet ports and
"fsl,etsec2-mdio" for the MDIO buses, which are strings that Linux also
uses, at least for LS1021A.  More compatible strings can be added once
other (PowerPC) SoCs are migrated to DM_ETH.

The current ls1021a.dtsi doesn't match what was documented for the MDIO
buses anyway (the "compatible" is "gianfar" currently). This will be
fixed in the next patch.

Fixes: 69a00875e3db ("doc: dt-bindings: Describe Freescale TSEC ethernet controller")
Signed-off-by: Vladimir Oltean <olteanv@gmail.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
5 years agonet: tsec: Common handling of MAC station address for DM_ETH
Vladimir Oltean [Thu, 18 Jul 2019 21:29:57 +0000 (00:29 +0300)]
net: tsec: Common handling of MAC station address for DM_ETH

In tsec_init, the MAC address is retrieved from 2 different structures
depending on whether DM_ETH is enabled or not.

But since the field name is the same inside both structures, we can
conditionally define the structure of the correct type and simplify the
assignments.

Signed-off-by: Vladimir Oltean <olteanv@gmail.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
5 years agonet: tsec: Make errors visible
Vladimir Oltean [Thu, 18 Jul 2019 21:29:56 +0000 (00:29 +0300)]
net: tsec: Make errors visible

This replaces debug() calls with printf() so that it is immediately
obvious from the console that something is wrong.

Signed-off-by: Vladimir Oltean <olteanv@gmail.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
5 years agonet: tsec: Reverse Christmas tree notation
Vladimir Oltean [Thu, 18 Jul 2019 21:29:55 +0000 (00:29 +0300)]
net: tsec: Reverse Christmas tree notation

This is a cosmetic patch that reorders variable definitions in the
inverse order of their line length, where possible.

Signed-off-by: Vladimir Oltean <olteanv@gmail.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
5 years agonet: tsec: Fix offset of MDIO registers for DM_ETH
Vladimir Oltean [Thu, 18 Jul 2019 21:29:54 +0000 (00:29 +0300)]
net: tsec: Fix offset of MDIO registers for DM_ETH

By convention, the eTSEC MDIO controller nodes are defined in DT at
0x2d24000 and 0x2d50000, but actually U-Boot does not touch the
interrupt portion of the register map (MDIO_IEVENTM, MDIO_IMASKM,
MDIO_EMAPM).

That leaves only the MDIO bus registers (MDIO_MIIMCFG, MDIO_MIIMCOM,
MDIO_MIIMADD, MDIO_MIIMADD, MDIO_MIIMCON, MDIO_MIIMSTAT) which start at
the 0x520 offset.

So shift the DT-defined register map by the offset of MDIO_MIIMCFG when
mapping the MDIO bus registers.

Signed-off-by: Vladimir Oltean <olteanv@gmail.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
5 years agonet: tsec: Refactor the readout of the tbi-handle property
Vladimir Oltean [Thu, 18 Jul 2019 21:29:53 +0000 (00:29 +0300)]
net: tsec: Refactor the readout of the tbi-handle property

The point of this patch is to eliminate the use of the locally-defined
"reg" variable (which interferes with next patch) and simplify the
fallback to the default CONFIG_SYS_TBIPA_VALUE in case "tbi-handle" is
missing.

Signed-off-by: Vladimir Oltean <olteanv@gmail.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
5 years agonet/macb: increase RX buffer size for GEM
Ramon Fried [Sun, 14 Jul 2019 15:25:14 +0000 (18:25 +0300)]
net/macb: increase RX buffer size for GEM

Macb Ethernet controller requires a RX buffer of 128 bytes. It is
highly sub-optimal for Gigabit-capable GEM that is able to use
a bigger DMA buffer. Change this constant and associated macros
with data stored in the private structure.
RX DMA buffer size has to be multiple of 64 bytes as indicated in
DMA Configuration Register specification.

Signed-off-by: Ramon Fried <rfried.dev@gmail.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
5 years agonet: macb: apply sane DMA configuration
Ramon Fried [Tue, 16 Jul 2019 19:04:36 +0000 (22:04 +0300)]
net: macb: apply sane DMA configuration

DMA configuration was heavily dependent on the HW
defaults, add function to properly set the required
fields, including the new dma_burst_length.

Signed-off-by: Ramon Fried <rfried.dev@gmail.com>
Reviewed-by: Anup Patel <anup.patel@wdc.com>
Tested-by: Anup Patel <anup.patel@wdc.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
5 years agonet: macb: add dma_burst_length config
Ramon Fried [Tue, 16 Jul 2019 19:04:35 +0000 (22:04 +0300)]
net: macb: add dma_burst_length config

GEM support higher DMA burst writes/reads than the default (4).
add configuration structure with dma burst length so it could be
applied later to DMA configuration.

Signed-off-by: Ramon Fried <rfried.dev@gmail.com>
Reviewed-by: Anup Patel <anup.patel@wdc.com>
Tested-by: Anup Patel <anup.patel@wdc.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
5 years agonet: macb: add support for SGMII phy interface
Ramon Fried [Tue, 16 Jul 2019 19:04:34 +0000 (22:04 +0300)]
net: macb: add support for SGMII phy interface

This patch adds support for the sgmii phy interface,
available only to DM users, dictated by current driver
design.

Signed-off-by: Ramon Fried <rfried.dev@gmail.com>
Reviewed-by: Anup Patel <anup.patel@wdc.com>
Tested-by: Anup Patel <anup.patel@wdc.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
5 years agonet: macb: use bit access macro from header file
Ramon Fried [Tue, 16 Jul 2019 19:04:33 +0000 (22:04 +0300)]
net: macb: use bit access macro from header file

macb.h provides macros for reading/setting bitfields,
in macb registers and descriptors. use that instead
of redefining them in the source file.

Signed-off-by: Ramon Fried <rfried.dev@gmail.com>
Reviewed-by: Anup Patel <anup.patel@wdc.com>
Tested-by: Anup Patel <anup.patel@wdc.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
5 years agonet: macb: add support for faster clk rates
Ramon Fried [Tue, 16 Jul 2019 19:04:32 +0000 (22:04 +0300)]
net: macb: add support for faster clk rates

add support for clock rates higher than 2.4Mhz

Signed-off-by: Ramon Fried <rfried.dev@gmail.com>
Reviewed-by: Anup Patel <anup.patel@wdc.com>
Tested-by: Anup Patel <anup.patel@wdc.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
5 years agonet: macb: sync header definitions as taken from Linux
Ramon Fried [Tue, 16 Jul 2019 19:03:00 +0000 (22:03 +0300)]
net: macb: sync header definitions as taken from Linux

Few registers and bits were added by Cadence and
they were not updated in the headers.
Take the latest definitions as defined in Linux
header (5.1) that also includes some comments
about existing registers.

One register was improperly named (UR), fix that.

Signed-off-by: Ramon Fried <rfried.dev@gmail.com>
Reviewed-by: Anup Patel <anup.patel@wdc.com>
Tested-by: Anup Patel <anup.patel@wdc.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
5 years agodoc: bindings: Add binding for register driven MDIO muxes
Alex Marginean [Tue, 16 Jul 2019 08:21:18 +0000 (11:21 +0300)]
doc: bindings: Add binding for register driven MDIO muxes

This binding documents two properties that describe the registers used to
perform MUX selection.

Signed-off-by: Alex Marginean <alexm.osslist@gmail.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
5 years agodrivers: net: driver for MDIO muxes controlled over I2C
Alex Marginean [Tue, 16 Jul 2019 08:21:17 +0000 (11:21 +0300)]
drivers: net: driver for MDIO muxes controlled over I2C

This driver is used for MDIO muxes driven over I2C.  This is currently
used on Freescale LS1028A QDS board, on which the physical MDIO MUX is
controlled by an on-board FPGA which in turn is configured through I2C.

Signed-off-by: Alex Marginean <alexm.osslist@gmail.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
5 years agonet: designware: use 'phy_connect' instead of open coded
Simon Goldschmidt [Mon, 15 Jul 2019 19:53:05 +0000 (21:53 +0200)]
net: designware: use 'phy_connect' instead of open coded

Using 'phy_connect' instead of 'phy_find_by_mask' and 'phy_connect_dev'
both deduplicates code and adds support for 'fixed-link'.

Signed-off-by: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
5 years agodrivers: net: fsl_enetc: add support for SGMII 2500
Alex Marginean [Mon, 15 Jul 2019 08:48:47 +0000 (11:48 +0300)]
drivers: net: fsl_enetc: add support for SGMII 2500

SGMII 2500 as supported on NXP SoCs requires AN to be disabled, handle
this case in the enetc sgmii init code.

Signed-off-by: Alex Marginean <alexm.osslist@gmail.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
5 years agoconfigs: ls1028a: enable networking options in rdb, qds defconfig
Alex Marginean [Wed, 3 Jul 2019 09:11:44 +0000 (12:11 +0300)]
configs: ls1028a: enable networking options in rdb, qds defconfig

Enables ethernet, MDIO, PHY drivers for LS1028A RDB and QDS.

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 agoarm: dts: ls1028a updates for network interfaces
Alex Marginean [Wed, 3 Jul 2019 09:11:43 +0000 (12:11 +0300)]
arm: dts: ls1028a updates for network interfaces

Defines LS1028A RDB SGMII port, QDS RGMII port.

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 agodrivers: net: apply serdes configuration for ENETC Ethernet interfaces
Alex Marginean [Wed, 3 Jul 2019 09:11:42 +0000 (12:11 +0300)]
drivers: net: apply serdes configuration for ENETC Ethernet interfaces

Ethernet interfaces using serial protocols go through the serdes block
integrated in the SoC.  This is accessed over dedicated internal MDIOs
which are part of the Ethernet PCI functions.  Set up serdes at _start,
along with other protocol specific port/MAC configuration.
MDIO code is shared with enetc_mdio, read/write functions are exported
from fsl_enetc_mdio for this reason.

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 agodrivers: net: add NXP ENETC MDIO driver
Alex Marginean [Wed, 3 Jul 2019 09:11:41 +0000 (12:11 +0300)]
drivers: net: add NXP ENETC MDIO driver

Adds a driver for the MDIO interface currently integrated in LS1028A SoC.
This MDIO interface is shared by multiple ethernet interfaces and is
presented as a stand-alone PCI function on the SoC ECAM.
Ethernet has a functional dependency on MDIO, for simplicity there is a
single config option for both.

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 agodrivers: net: add NXP ENETC ethernet driver
Alex Marginean [Wed, 3 Jul 2019 09:11:40 +0000 (12:11 +0300)]
drivers: net: add NXP ENETC ethernet driver

Adds a driver for NXP ENETC ethernet controller currently integrated in
LS1028A.  ENETC is a fairly straight-forward BD ring device and interfaces
are presented as PCI EPs on the SoC ECAM.

Signed-off-by: Catalin Horghidan <catalin.horghidan@nxp.com>
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 agoinclude: configs: ls1028a: set SYS_RX_ETH_BUFFER to 8
Alex Marginean [Wed, 3 Jul 2019 09:11:39 +0000 (12:11 +0300)]
include: configs: ls1028a: set SYS_RX_ETH_BUFFER to 8

LS1028A ethernet interfaces work with at least 8 BDs, set number of buffers
to match that.

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 agospi: Drop obsolete mtk_qspi driver references
Weijie Gao [Mon, 22 Jul 2019 11:39:42 +0000 (17:09 +0530)]
spi: Drop obsolete mtk_qspi driver references

Since u-boot has added the spi-mem framework and replaced
the spi-nor framework, the mtk_qspi is no longer compatible
with the new spi-nor driver.

Remove this driver along with replacing config item
with new mtk spi-nor driver.

Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
[jagan: squash related changes and update commit message]
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
Reviewed-by: Jagan Teki <jagan@amarulasolutions.com>
5 years agospi: add spi-mem driver for MediaTek MT7629 SoC
Weijie Gao [Mon, 22 Jul 2019 11:39:01 +0000 (17:09 +0530)]
spi: add spi-mem driver for MediaTek MT7629 SoC

This patch adds spi-mem driver for MediaTek MT7629 SoC
to access SPI-NOR and SPI-NAND flashes.

Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
[jagan: squash MAINTAINERS file]
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
Reviewed-by: Jagan Teki <jagan@amarulasolutions.com>
5 years agogitlab-ci: Update Docker image to xenial-20190720-24Jul2019 tag
Tom Rini [Wed, 24 Jul 2019 15:29:47 +0000 (11:29 -0400)]
gitlab-ci: Update Docker image to xenial-20190720-24Jul2019 tag

- Add in lzma-alone for current binman tests
- Update to Ubuntu's xenial-20190720 tag (latest).

Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
5 years agogitlab-ci: Add pyelftools to the binman testsuite section
Tom Rini [Wed, 24 Jul 2019 17:14:56 +0000 (13:14 -0400)]
gitlab-ci: Add pyelftools to the binman testsuite section

We need pyelftools here to run rather than skip some tests.

Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
5 years agoMerge tag 'dm-pull-24jul19-take3' of https://gitlab.denx.de/u-boot/custodians/u-boot-dm
Tom Rini [Wed, 24 Jul 2019 20:24:50 +0000 (16:24 -0400)]
Merge tag 'dm-pull-24jul19-take3' of https://gitlab.denx.de/u-boot/custodians/u-boot-dm

Minor driver-model fixes and tweaks
A few device-tree fixes
Binman support for extracting files from an image

5 years agodm: device: make power domain calls optional
Anatolij Gustschin [Sun, 14 Jul 2019 19:11:01 +0000 (21:11 +0200)]
dm: device: make power domain calls optional

Reduce power domain calls when CONFIG_POWER_DOMAIN is disabled.
With gcc v8.2, this change saves 104 bytes.

Signed-off-by: Anatolij Gustschin <agust@denx.de>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
5 years agobuildman: fix invocation examples typos
Baruch Siach [Thu, 11 Jul 2019 09:57:41 +0000 (12:57 +0300)]
buildman: fix invocation examples typos

Also, make command line example indentation consistent.

Signed-off-by: Baruch Siach <baruch@tkos.co.il>
5 years agoclk: initialize clk->data when using default xlate
Sekhar Nori [Thu, 11 Jul 2019 09:00:24 +0000 (14:30 +0530)]
clk: initialize clk->data when using default xlate

Right now when using clk_of_xlate_default(), clk->data
remains un-initialized because clk_get_bulk() does not
initialize memory on allocation of clock structure.

This can cause problems when data is used to match if
two clocks pointers are exactly the same underlying
clocks, for example.

Fix it by initializing clk->data to 0.

Suggested-by: Lokesh Vutla <lokeshvutla@ti.com>
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
5 years agodm: uclass: fix comment copy/paste error
Baruch Siach [Thu, 11 Jul 2019 08:23:44 +0000 (11:23 +0300)]
dm: uclass: fix comment copy/paste error

The uclass_next_device() routine continues a previously started device
iteration. Change the description that is copied from
uclass_first_device().

Signed-off-by: Baruch Siach <baruch@tkos.co.il>
Reviewed-by: Simon Glass <sjg@chromium.org>
5 years agocommon: fdt_support: Add missing cpu_to_fdt32() to fdt_pci_dma_ranges()
Marek Vasut [Tue, 9 Jul 2019 00:49:29 +0000 (02:49 +0200)]
common: fdt_support: Add missing cpu_to_fdt32() to fdt_pci_dma_ranges()

The fdt_pci_dma_ranges() cannot work on e.g. ARM, since the DT entries
endianness is not adjusted at all. Fix this.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Tom Rini <trini@konsulko.com>
5 years agodm: Fix parameter description of dev_read_name()
Bin Meng [Fri, 5 Jul 2019 16:23:18 +0000 (09:23 -0700)]
dm: Fix parameter description of dev_read_name()

The comments of dev_read_name() wrongly describe "node" as its
parameter.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
5 years agodm: core: Set correct "status" value for a node
Bin Meng [Fri, 5 Jul 2019 16:23:17 +0000 (09:23 -0700)]
dm: core: Set correct "status" value for a node

Per device tree spec, "status" property can have a value of "okay",
or "disabled", but not "disable".

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
5 years agodm: core: Call clk_set_defaults() during probe() only for a valid ofnode
Bin Meng [Fri, 5 Jul 2019 16:23:16 +0000 (09:23 -0700)]
dm: core: Call clk_set_defaults() during probe() only for a valid ofnode

Without a valid ofnode, it's meaningless to call clk_set_defaults()
to process various properties.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
5 years agodm: timer: Skip device that does not have a valid ofnode in pre_probe()
Bin Meng [Fri, 5 Jul 2019 16:23:15 +0000 (09:23 -0700)]
dm: timer: Skip device that does not have a valid ofnode in pre_probe()

It is possible that a timer device has a null ofnode, hence there is
no need to further parse DT for the clock rate.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
5 years agofdt: make fdt_get_base_address() return OF_BAD_ADDR when "reg" not found
Masahiro Yamada [Thu, 27 Jun 2019 07:39:57 +0000 (16:39 +0900)]
fdt: make fdt_get_base_address() return OF_BAD_ADDR when "reg" not found

Currently, fdt_get_base_address() returns 0 if the "reg" property is
missing. Since 0 is a valid value, it is not suitable for the error
handling. Return OF_BAD_ADDR instead.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
5 years agobinman: Add a test for nested and aligned sections
Simon Glass [Mon, 8 Jul 2019 20:25:53 +0000 (14:25 -0600)]
binman: Add a test for nested and aligned sections

Current test coverage is likely sufficient for the logic used to place
sections in the image. However it seems useful to add a test specifically
for nested sections, since these could have some unusual interactions.

Add a new test for this and aligned sections. This test failed before the
refactor to drop the bsection.py file (Section class), but passes now.

Signed-off-by: Simon Glass <sjg@chromium.org>
5 years agobinman: Add an 'extract' command
Simon Glass [Mon, 8 Jul 2019 20:25:52 +0000 (14:25 -0600)]
binman: Add an 'extract' command

It is useful to be able to extract all binaries from the image, or a
subset of them. Add a new 'extract' command to handle this.

Signed-off-by: Simon Glass <sjg@chromium.org>
5 years agobinman: Support reading from CBFS entries
Simon Glass [Mon, 8 Jul 2019 20:25:51 +0000 (14:25 -0600)]
binman: Support reading from CBFS entries

CBFS is a bit like a section but with a custom format. Provide the list of
entries and the compression type to binman so that it can extract the data
from the CBFS, just like any other part of the image.

Signed-off-by: Simon Glass <sjg@chromium.org>
5 years agobinman: Allow reading an entry from an image
Simon Glass [Mon, 8 Jul 2019 20:25:50 +0000 (14:25 -0600)]
binman: Allow reading an entry from an image

It is useful to be able to extract entry contents from an image to see
what is inside. Add a simple function to read the contents of an entry,
decompressing it by default.

Signed-off-by: Simon Glass <sjg@chromium.org>
5 years agobinman: Allow for logging information to be displayed
Simon Glass [Mon, 8 Jul 2019 20:25:49 +0000 (14:25 -0600)]
binman: Allow for logging information to be displayed

Binman generally operates silently but in some cases it is useful to see
what Binman is actually doing at each step. Enable some logging output
with different logging levels selectable via the -v flag.

Signed-off-by: Simon Glass <sjg@chromium.org>
5 years agobinman: Support listing an image
Simon Glass [Mon, 8 Jul 2019 20:25:48 +0000 (14:25 -0600)]
binman: Support listing an image

Add support for listing the entries in an image. This relies on the image
having an FDT map.

Signed-off-by: Simon Glass <sjg@chromium.org>
5 years agobinman: Convert Image to a subclass of Entry
Simon Glass [Mon, 8 Jul 2019 20:25:47 +0000 (14:25 -0600)]
binman: Convert Image to a subclass of Entry

When support for sections (and thus hierarchical images) was added to
binman, the decision was made to create a new Section class which could
be used by both Image and an Entry_section class. The decision between
using inheritance and composition was tricky to make, but in the end it
was decided that Image was different enough from Entry that it made sense
to put the implementation of sections in an entirely separate class. It
also has the advantage that core Image code does have to rely on an entry
class in the etype directory.

This work was mostly completed in commit:

   8f1da50ccc "binman: Refactor much of the image code into 'section'

As a result of this, the Section class has its own version of things like
offset and size and these must be kept in sync with the parent
Entry_section class in some cases.

In the last year it has become apparent that the cost of keeping things in
sync is larger than expected, since more and more code wants to access
these properties.

An alternative approach, previously considered and rejected, now seems
better.

Adjust Image to be a subclass of Entry_section. Move the code from Section
(in bsection.py) to Entry_section and delete Section. Update all tests
accordingly.

This requires substantial changes to Image. Overall the changes reduce
code size by about 240 lines. While much of that is just boilerplate from
Section, there are quite a few functions in Entry_section which now do not
need to be overiden from Entry. This suggests the change is beneficial
even without further functionality being added.

A side benefit is that the properties of sections are now consistent with
other entries. This fixes a problem in testListCmd() where some properties
are missing for sections.

Unfortunately this is a very large commit since it is not feasible to do
the migration piecemeal. Given the substantial tests available and the
100% code coverage of binman, we should be able to do this safely.

Signed-off-by: Simon Glass <sjg@chromium.org>
5 years agobinman: Support reading an image into an Image object
Simon Glass [Mon, 8 Jul 2019 20:25:46 +0000 (14:25 -0600)]
binman: Support reading an image into an Image object

It is possible to read an Image, locate its FDT map and then read it into
the binman data structures. This allows full access to the entries that
were written to the image. Add support for this.

Signed-off-by: Simon Glass <sjg@chromium.org>
5 years agobinman: Support locating an image header
Simon Glass [Mon, 8 Jul 2019 20:25:45 +0000 (14:25 -0600)]
binman: Support locating an image header

Add support for locating an image header in an image.

Signed-off-by: Simon Glass <sjg@chromium.org>
5 years agobinman: Support locating an FDT map
Simon Glass [Mon, 8 Jul 2019 20:25:44 +0000 (14:25 -0600)]
binman: Support locating an FDT map

Add support for locating an image's Fdt map which is used to determine
the contents and structure of the image.

Signed-off-by: Simon Glass <sjg@chromium.org>
5 years agobinman: Allow listing the entries in an image
Simon Glass [Mon, 8 Jul 2019 20:25:43 +0000 (14:25 -0600)]
binman: Allow listing the entries in an image

It is useful to be able to summarise all the entries in an image, e.g. to
display this to this user. Add a new ListEntries() method to Entry, and
set up a way to call it through the Image class.

Signed-off-by: Simon Glass <sjg@chromium.org>
5 years agobinman: Detect bad CBFS file types
Simon Glass [Mon, 8 Jul 2019 20:25:42 +0000 (14:25 -0600)]
binman: Detect bad CBFS file types

Detect when an unknown or unsupported file type is specified and report
an error.

Signed-off-by: Simon Glass <sjg@chromium.org>
5 years agobinman: Support FDT update for CBFS
Simon Glass [Mon, 8 Jul 2019 20:25:41 +0000 (14:25 -0600)]
binman: Support FDT update for CBFS

It is useful to add the CBFS file information (offset, size, etc.) into
the FDT so that the layout is complete. Add support for this.

Signed-off-by: Simon Glass <sjg@chromium.org>
5 years agobinman: Use the cbfs memlen field only for uncompressed length
Simon Glass [Mon, 8 Jul 2019 20:25:40 +0000 (14:25 -0600)]
binman: Use the cbfs memlen field only for uncompressed length

The purpose of this badly named field is a bit ambiguous. Adjust the code
to use it only to store the uncompressed length of a file, leaving it set
to None if there is no compression used. This makes it easy to see if the
value in this field is relevant / useful.

Also set data_len for compressed fields, since it should be the length of
the compressed data, not the uncompressed data.

Signed-off-by: Simon Glass <sjg@chromium.org>
5 years agobinman: Provide the actual data address for cbfs files
Simon Glass [Mon, 8 Jul 2019 20:25:39 +0000 (14:25 -0600)]
binman: Provide the actual data address for cbfs files

At present a file with no explicit CBFS offset is placed in the next
available location but there is no way to find out where it ended up.
Update and rename the get_data() function to provide this information.

Signed-off-by: Simon Glass <sjg@chromium.org>
5 years agobinman: Allow device-tree entries to be compressed
Simon Glass [Mon, 8 Jul 2019 20:25:38 +0000 (14:25 -0600)]
binman: Allow device-tree entries to be compressed

At present the logic skips the blob class' handling of compression, so
this is not supported with device tree entries. Fix this.

Signed-off-by: Simon Glass <sjg@chromium.org>
5 years agobinman: Allow entries to expand after packing
Simon Glass [Mon, 8 Jul 2019 20:25:37 +0000 (14:25 -0600)]
binman: Allow entries to expand after packing

Add support for detecting entries that change size after they have already
been packed, and re-running packing when it happens.

This removes the limitation that entry size cannot change after
PackEntries() is called.

Signed-off-by: Simon Glass <sjg@chromium.org>
5 years agobinman: Add a control for post-pack entry expansion
Simon Glass [Mon, 8 Jul 2019 20:25:36 +0000 (14:25 -0600)]
binman: Add a control for post-pack entry expansion

We plan to support changing the size of entries after they have been
packed. For now it will always be enabled. But to aid testing of both
cases (in the event that we want to add a command-line flag, for example),
add a setting to control it.

Signed-off-by: Simon Glass <sjg@chromium.org>
5 years agobinman: Add a return value to ProcessContentsUpdate()
Simon Glass [Mon, 8 Jul 2019 20:25:35 +0000 (14:25 -0600)]
binman: Add a return value to ProcessContentsUpdate()

At present if this function tries to update the contents such that the
size changes, it raises an error. We plan to add the ability to change
the size of entries after packing is completed, since in some cases it is
not possible to determine the size in advance.

An example of this is with a compressed device tree, where the values
of the device tree change in SetCalculatedProperties() or
ProcessEntryContents(). While the device tree itself does not change size,
since placeholders for any new properties have already bee added by
AddMissingProperties(), we cannot predict the size of the device tree
after compression. If a value changes from 0 to 0x1234 (say), then the
compressed device tree may expand.

As a first step towards supporting this, make ProcessContentsUpdate()
return a value indicating whether the content size is OK. For now this is
always True (since otherwise binman raises an error), but later patches
will adjust this.

Signed-off-by: Simon Glass <sjg@chromium.org>
5 years agobinman: Call ProcessUpdateContents() consistently
Simon Glass [Mon, 8 Jul 2019 20:25:34 +0000 (14:25 -0600)]
binman: Call ProcessUpdateContents() consistently

SetContents() should only be called to set the contents of an entry from
within the ObtainContents() call, since it has no guard against increasing
the size of the contents, thus triggering incorrect operation.

Change all such calls to use ProcessUpdateContents() instead.

Signed-off-by: Simon Glass <sjg@chromium.org>
5 years agobinman: Fix up ProcessUpdateContents error and comments
Simon Glass [Mon, 8 Jul 2019 20:25:33 +0000 (14:25 -0600)]
binman: Fix up ProcessUpdateContents error and comments

This function raises an exception with its arguments around the wrong way
so the message is incorrect. Fix this as well as a few minor comment
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>
5 years agobinman: Allow easy importing of entry modules
Simon Glass [Mon, 8 Jul 2019 20:25:32 +0000 (14:25 -0600)]
binman: Allow easy importing of entry modules

At present entry modules can only be accessed using Entry.Lookup() or
Entry.Create(). Most of the time this is fine, but sometimes a module
needs to provide constants or helper functions useful to other modules.
It is easier in this case to use 'import'.

Add an __init__ file to permit this.

Signed-off-by: Simon Glass <sjg@chromium.org>
5 years agobinman: Drop an unused arg in Entry.Lookup()
Simon Glass [Mon, 8 Jul 2019 20:25:31 +0000 (14:25 -0600)]
binman: Drop an unused arg in Entry.Lookup()

The first argument is not used. Remove it.

Signed-off-by: Simon Glass <sjg@chromium.org>
5 years agobinman: Move compression into the Entry base class
Simon Glass [Mon, 8 Jul 2019 20:25:30 +0000 (14:25 -0600)]
binman: Move compression into the Entry base class

Compression is currently available only with blobs. However we want to
report the compression algorithm and uncompressed size for all entries,
so that other entry types can support compression. This will help with
the forthcoming 'list' feature which lists entries in the image.

Move the compression properties into the base class. Also fix up the docs
which had the wrong property name.

Signed-off-by: Simon Glass <sjg@chromium.org>
5 years agobinman: Convert to use ArgumentParser
Simon Glass [Mon, 8 Jul 2019 20:25:29 +0000 (14:25 -0600)]
binman: Convert to use ArgumentParser

This class is the new way to handle arguments in Python. Convert binman
over to use it. At the same time, introduce commands so that we can
separate out the different parts of binman functionality.

Signed-off-by: Simon Glass <sjg@chromium.org>
5 years agobinman: Add an image header
Simon Glass [Mon, 8 Jul 2019 20:25:28 +0000 (14:25 -0600)]
binman: Add an image header

It is useful to be able to quickly locate the FDT map in the image. An
easy way to do this is with a pointer at the start or end of the image.

Add an 'image header' entry, which places a magic number followed by a
pointer to the FDT map. This can be located at the start or end of the
image, or at a chosen location.

As part of this, update GetSiblingImagePos() to detect missing siblings.

Signed-off-by: Simon Glass <sjg@chromium.org>
5 years agobinman: Add an FDT map
Simon Glass [Mon, 8 Jul 2019 20:25:27 +0000 (14:25 -0600)]
binman: Add an FDT map

An FDT map is an entry which holds a full description of the image
entries, in FDT format. It can be discovered using the magic string at
its start. Tools can locate and read this entry to find out what entries
are in the image and where each entry is located.

Signed-off-by: Simon Glass <sjg@chromium.org>
5 years agobinman: Add a convenience functions for real-DTB tests
Simon Glass [Mon, 8 Jul 2019 20:25:26 +0000 (14:25 -0600)]
binman: Add a convenience functions for real-DTB tests

Quite a few tests will use a real device tree and need it updated with the
binman metadata. Add a helper function for this.

Signed-off-by: Simon Glass <sjg@chromium.org>
5 years agobinman: Update help for new features
Simon Glass [Mon, 8 Jul 2019 20:25:25 +0000 (14:25 -0600)]
binman: Update help for new features

A few new features have been added. This has rendered part of the README
obsolete. Update it.

Signed-off-by: Simon Glass <sjg@chromium.org>
5 years agobinman: Update future features
Simon Glass [Mon, 8 Jul 2019 20:25:24 +0000 (14:25 -0600)]
binman: Update future features

A few features have been completed and a few items are added.

Signed-off-by: Simon Glass <sjg@chromium.org>
5 years agobinman: Simplify the entry test
Simon Glass [Mon, 8 Jul 2019 20:25:23 +0000 (14:25 -0600)]
binman: Simplify the entry test

The current test for the 'entry' module is a bit convoluted since it has
to import the module multiple times. It also relies on ordering, in that
test1EntryNoImportLib() must run before test2EntryImportLib() if they are
running in the same Python process.

This is unreliable since neither the ordering of tests nor the process
that they run in is defined.

Fix this by always reloading the entry in these two tests. Also add a
check that the expected value of have_importlib is obtained.

This corrects a code-coverage problem in the 'entry' module on some
systems.

Signed-off-by: Simon Glass <sjg@chromium.org>
5 years agobinman: Add support for fixed-offset files in CBFS
Simon Glass [Mon, 8 Jul 2019 19:18:56 +0000 (13:18 -0600)]
binman: Add support for fixed-offset files in CBFS

A feature of CBFS is that it allows files to be positioned at particular
offset (as with binman in general). This is useful to support
execute-in-place (XIP) code, since this may not be relocatable.

Add a new cbfs-offset property to control this.

Signed-off-by: Simon Glass <sjg@chromium.org>
5 years agobinman: Pad empty areas of the CBFS with files
Simon Glass [Mon, 8 Jul 2019 19:18:55 +0000 (13:18 -0600)]
binman: Pad empty areas of the CBFS with files

When there is lots of open space in a CBFS it is normally padded with
'empty' files so that sequentially scanning the CBFS can skip from one to
the next without a break.

Add support for this.

Signed-off-by: Simon Glass <sjg@chromium.org>
5 years agobinman: Add support for Intel IFWI entries
Simon Glass [Mon, 8 Jul 2019 19:18:54 +0000 (13:18 -0600)]
binman: Add support for Intel IFWI entries

An Integrated Firmware Image is used to hold various binaries used for
booting with Apollolake and some later devices. Add support for this.

Signed-off-by: Simon Glass <sjg@chromium.org>
5 years agobinman: Add support for CBFS entries
Simon Glass [Mon, 8 Jul 2019 19:18:53 +0000 (13:18 -0600)]
binman: Add support for CBFS entries

Add support for putting CBFSs (Coreboot Filesystems) in an image. This
allows binman to produce firmware images used by coreboot to boot.

Signed-off-by: Simon Glass <sjg@chromium.org>
5 years agobinman: Add a utility library for coreboot CBFS
Simon Glass [Mon, 8 Jul 2019 19:18:52 +0000 (13:18 -0600)]
binman: Add a utility library for coreboot CBFS

Coreboot uses a simple flash-based filesystem called Coreboot Filesystem
(CBFS) to organise files used during boot. This allows files to be named
and their position in the flash to be set. It has special features for
dealing with x86 devices which typically memory-map their SPI flash to the
top of 32-bit address space and need a 'boot block' ending there.

Create a library to help create and read CBFS files. This includes a
writer class, a reader class and associated other helpers. Only a subset
of features are currently supported.

Signed-off-by: Simon Glass <sjg@chromium.org>
5 years agopatman: Add a function to write ifwitool
Simon Glass [Mon, 8 Jul 2019 19:18:51 +0000 (13:18 -0600)]
patman: Add a function to write ifwitool

This tool has quite a few arguments and options, so put the functionality
in a function so that we call it from one place and hopefully get it
right.

Signed-off-by: Simon Glass <sjg@chromium.org>
5 years agobinman: Pass the toolpath to tests
Simon Glass [Mon, 8 Jul 2019 19:18:50 +0000 (13:18 -0600)]
binman: Pass the toolpath to tests

Tools like ifwitool may not be available in the PATH, but are available in
the build. These tools may be needed by tests, so allow tests to use the
--toolpath flag.

Also use this flag with travis.

Signed-off-by: Simon Glass <sjg@chromium.org>
5 years agoMerge branch '2019-07-24-master-imports'
Tom Rini [Wed, 24 Jul 2019 18:15:51 +0000 (14:15 -0400)]
Merge branch '2019-07-24-master-imports'

- Various Android related changes including A/B update and BCB updates
- Assorted minor fixes

5 years agopsci: Fix warnings when compiling with W=1
Patrick Delaunay [Mon, 22 Jul 2019 12:19:20 +0000 (14:19 +0200)]
psci: Fix warnings when compiling with W=1

This patch solves the following warnings:
arch/arm/mach-stm32mp/psci.c:

warning: no previous prototype for ‘psci_set_state’ [-Wmissing-prototypes]
warning: no previous prototype for ‘psci_arch_cpu_entry’ [-Wmissing-prototypes]
warning: no previous prototype for ‘psci_features’ [-Wmissing-prototypes]
warning: no previous prototype for ‘psci_version’ [-Wmissing-prototypes]
warning: no previous prototype for ‘psci_affinity_info’ [-Wmissing-prototypes]
warning: no previous prototype for ‘psci_migrate_info_type’ [-Wmissing-prototypes]
warning: no previous prototype for ‘psci_cpu_on’ [-Wmissing-prototypes]
warning: no previous prototype for ‘psci_cpu_off’ [-Wmissing-prototypes]
warning: no previous prototype for ‘psci_system_reset’ [-Wmissing-prototypes]
warning: no previous prototype for ‘psci_system_off’ [-Wmissing-prototypes]

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
5 years agodistro_bootcmd: refactor virtio to support PCI block devices
David Abdurachmanov [Mon, 22 Jul 2019 08:38:11 +0000 (11:38 +0300)]
distro_bootcmd: refactor virtio to support PCI block devices

Starting libvirt v5.3.0 with QEMU 4.0.0 use of PCI is automatic
and thus storage is connected via PCI, which is not visible to
U-Boot out-of-the-box.

Refactor to do "pci enum" followed by "virtio scan" to see PCI
connected storage, and allow bootloader to load kernel and
initramfs images.

Tested with Fedora/RISCV using releases: libvirt 5.4.0 & 5.5.0,
QEMU 4.0.0 and U-Boot 2019.07 RC4.

Signed-off-by: David Abdurachmanov <david.abdurachmanov@sifive.com>
5 years agoremoteproc: Fix potential build issues with SPL remoteproc
Suman Anna [Fri, 19 Jul 2019 15:27:56 +0000 (10:27 -0500)]
remoteproc: Fix potential build issues with SPL remoteproc

The rproc uclass driver can either be built with SPL_REMOTEPROC
or REMOTEPROC, but the function prototypes in remoteproc.h are
defined only when CONFIG_REMOTEPROC is defined. This can cause
build issues in SPL if CONFIG_REMOTEPROC is not selected.

Fix this by replacing the existing precompiler macro usage with
CONFIG_IS_ENABLED.

Fixes: ddf56bc7e3ef ("drivers: Introduce a simplified remoteproc framework")
Signed-off-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>
5 years agodoc: fitImage: Cosmetics break lines
Mickaël Tansorier [Wed, 17 Jul 2019 15:57:29 +0000 (17:57 +0200)]
doc: fitImage: Cosmetics break lines

Add missing newline before title and subtitle.

Signed-off-by: Mickaël Tansorier <mickael.tansorier@smile.fr>
5 years agodoc: fitImage: Fix conf number incrementation
Mickaël Tansorier [Wed, 17 Jul 2019 15:57:16 +0000 (17:57 +0200)]
doc: fitImage: Fix conf number incrementation

Increment conf id to avoid to have two same conf name
into one configuration description.

Signed-off-by: Mickaël Tansorier <mickael.tansorier@smile.fr>
5 years agodoc: Add the U-Boot logo to the html doc
Bin Meng [Tue, 16 Jul 2019 16:39:20 +0000 (09:39 -0700)]
doc: Add the U-Boot logo to the html doc

Now we have a logo for U-Boot, we can include it in the Sphinx
html doc.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
5 years agodoc: Add .gitignore for the Sphinx build output directory
Bin Meng [Tue, 16 Jul 2019 16:39:19 +0000 (09:39 -0700)]
doc: Add .gitignore for the Sphinx build output directory

With Sphinx documentation moving from Documentation directory
to doc directory, we missed updating .gitignore for the Sphinx
build output directory.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
5 years agospl: sata: support U-Boot load from raw sata disk
Baruch Siach [Sun, 14 Jul 2019 14:54:21 +0000 (17:54 +0300)]
spl: sata: support U-Boot load from raw sata disk

Support load of the U-Boot image from raw SATA disk sector. This is
equivalent to load from MMC raw sector.

Signed-off-by: Baruch Siach <baruch@tkos.co.il>
5 years agoscripts/kernel-doc: fix parsing of function pointers
Heinrich Schuchardt [Sun, 14 Jul 2019 09:30:23 +0000 (11:30 +0200)]
scripts/kernel-doc: fix parsing of function pointers

kernel-doc fails to parse function definitions like the one below

efi_status_t efi_create_event(uint32_t type, efi_uintn_t notify_tpl,
      void (EFIAPI *notify_function) (
struct efi_event *event,
void *context),
      void *notify_context, efi_guid_t *group,
      struct efi_event **event)
{

due to the "EFIAPI" attribute preceding the function name.

cf. https://lkml.org/lkml/2018/9/3/1185

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
5 years agoscripts/kernel-doc: update script from Linux 5.2
Heinrich Schuchardt [Sun, 14 Jul 2019 09:30:22 +0000 (11:30 +0200)]
scripts/kernel-doc: update script from Linux 5.2

Update the script from Linux 5.2 to avoid some warnings.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
5 years agodoc: Cope with Sphinx logging deprecations
Jonathan Corbet [Sun, 14 Jul 2019 08:35:45 +0000 (10:35 +0200)]
doc: Cope with Sphinx logging deprecations

Recent versions of sphinx will emit messages like:

  doc/sphinx/kerneldoc.py:103:
     RemovedInSphinx20Warning: app.warning() is now deprecated.
     Use sphinx.util.logging instead.

Switch to sphinx.util.logging to make this unsightly message go away.
Alas, that interface was only added in version 1.6, so we have to add a
version check to keep things working with older sphinxes.

Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Rebased for U-Boot
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
5 years agoenv: am57xx: Implement A/B boot process
Ruslan Trofymenko [Fri, 5 Jul 2019 12:37:36 +0000 (15:37 +0300)]
env: am57xx: Implement A/B boot process

Add support for A/B boot process on AM57xx based boards:

  1. Define 'slot_suffix' variable (using 'ab_select' command)
  2. Extend 'emmc_android_boot' boot command (add commands for A/B boot
     process)

'ab_select' command is used to decide which slot should be used for
booting up. A/B metadata resides in 'misc' partition.

To activate the A/B boot process, the following config options must be
set:

    CONFIG_ANDROID_AB=y
    CONFIG_CMD_AB_SELECT=y

For successful A/B boot, the corresponding A/B infrastructure must be
involved on Android side [1] (including mounting system as root), and
disk must be partitioned accordingly.

When A/B boot is enabled, there are some known limitations currently
exist (not related to A/B patches, need to be implemented later):

  1. The 'Verified Boot' sequence is not supported
  2. dev path to system partition (system_a or system_b) is passed via
     'bootargs' as 'root=' argument like 'root=/dev/mmcblk1p12', but
     further we'll need to rework it with respect to dm-verity
     requirements [2]

In case when A/B partitions are not present in system (and A/B boot is
enabled), boot up process will be terminated and next message will be
shown:

    "boot_a(b) partition not found"

[1] https://source.android.com/devices/tech/ota/ab
[2] https://source.android.com/devices/tech/ota/ab/ab_implement#kernel

Signed-off-by: Ruslan Trofymenko <ruslan.trofymenko@linaro.org>
Signed-off-by: Igor Opaniuk <igor.opaniuk@gmail.com>
Signed-off-by: Sam Protsenko <semen.protsenko@linaro.org>
Reviewed-by: Alistair Strachan <astrachan@google.com>
Reviewed-by: Sam Protsenko <semen.protsenko@linaro.org>
Reviewed-by: Simon Glass <sjg@chromium.org>