oweals/u-boot.git
6 years agoARM: mach-omap2: omap3/am335x: Enable ACR::IBE on Cortex-A8 SoCs for CVE-2017-5715
Nishanth Menon [Tue, 12 Jun 2018 20:24:11 +0000 (15:24 -0500)]
ARM: mach-omap2: omap3/am335x: Enable ACR::IBE on Cortex-A8 SoCs for CVE-2017-5715

Enable CVE-2017-5715 option to set the IBE bit. This enables kernel
workarounds necessary for the said CVE.

With this enabled, Linux reports:
CPU0: Spectre v2: using BPIALL workaround

This workaround may need to be re-applied in OS environment around low
power transition resume states where context of ACR would be lost (off-mode
etc).

Signed-off-by: Nishanth Menon <nm@ti.com>
6 years agoARM: mach-omap2: omap5/dra7: Enable ACTLR[0] (Enable invalidates of BTB) to facilitat...
Nishanth Menon [Tue, 12 Jun 2018 20:24:10 +0000 (15:24 -0500)]
ARM: mach-omap2: omap5/dra7: Enable ACTLR[0] (Enable invalidates of BTB) to facilitate CVE_2017-5715 WA in OS

Enable CVE_2017_5715 and since we have our own v7_arch_cp15_set_acr
function to setup the bits, we are able to override the settings.

Without this enabled, Linux kernel reports:
CPU0: Spectre v2: firmware did not set auxiliary control register IBE bit, system vulnerable

With this enabled, Linux kernel reports:
CPU0: Spectre v2: using ICIALLU workaround

NOTE: This by itself does not enable the workaround for CPU1 (on
OMAP5 and DRA72/AM572 SoCs) and may require additional kernel patches.

Signed-off-by: Nishanth Menon <nm@ti.com>
6 years agoARM: Introduce ability to enable invalidate of BTB with ICIALLU on Cortex-A15 for...
Nishanth Menon [Tue, 12 Jun 2018 20:24:09 +0000 (15:24 -0500)]
ARM: Introduce ability to enable invalidate of BTB with ICIALLU on Cortex-A15 for CVE-2017-5715

As recommended by Arm in [1], ACTLR[0] (Enable invalidates of BTB)
needs to be set[2] for BTB to be invalidated on ICIALLU. This needs to
be done unconditionally for Cortex-A15 processors. Provide a config
option for platforms to enable this option based on impact analysis
for products.

NOTE: This patch in itself is NOT the final solution, this requires:
a) Implementation of v7_arch_cp15_set_acr on SoCs which may not
   provide direct access to ACR register.
b) Operating Systems such as Linux to provide adequate workaround in the
   right locations.
c) This workaround applies to only the boot processor. It is important
   to apply workaround as necessary (context-save-restore) around low
   power context loss OR additional processors as necessary in either
   firmware support OR elsewhere in OS.

[1] https://developer.arm.com/support/security-update
[2] http://infocenter.arm.com/help/topic/com.arm.doc.ddi0438c/BABGHIBG.html

Cc: Marc Zyngier <marc.zyngier@arm.com>
Cc: Russell King <linux@arm.linux.org.uk>
Cc: Tony Lindgren <tony@atomide.com>
Cc: Robin Murphy <robin.murphy@arm.com>
Cc: Florian Fainelli <f.fainelli@gmail.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Will Deacon <will.deacon@arm.com>
Cc: Christoffer Dall <christoffer.dall@linaro.org>
Cc: Andre Przywara <Andre.Przywara@arm.com>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Tom Rini <trini@konsulko.com>
Cc: Michael Nazzareno Trimarchi <michael@amarulasolutions.com>
Signed-off-by: Nishanth Menon <nm@ti.com>
Tested-by: Fabio Estevam <fabio.estevam@nxp.com>
6 years agoARM: Introduce ability to enable ACR::IBE on Cortex-A8 for CVE-2017-5715
Nishanth Menon [Tue, 12 Jun 2018 20:24:08 +0000 (15:24 -0500)]
ARM: Introduce ability to enable ACR::IBE on Cortex-A8 for CVE-2017-5715

As recommended by Arm in [1], IBE[2] has to be enabled unconditionally
for BPIALL to be functional on Cortex-A8 processors. Provide a config
option for platforms to enable this option based on impact analysis
for products.

NOTE: This patch in itself is NOT the final solution, this requires:
a) Implementation of v7_arch_cp15_set_acr on SoCs which may not
   provide direct access to ACR register.
b) Operating Systems such as Linux to provide adequate workaround in the right
   locations.
c) This workaround applies to only the boot processor. It is important
   to apply workaround as necessary (context-save-restore) around low
   power context loss OR additional processors as necessary in either
   firmware support OR elsewhere in OS.

[1] https://developer.arm.com/support/security-update
[2] http://infocenter.arm.com/help/topic/com.arm.doc.ddi0344k/Bgbffjhh.html

Cc: Marc Zyngier <marc.zyngier@arm.com>
Cc: Russell King <linux@arm.linux.org.uk>
Cc: Tony Lindgren <tony@atomide.com>
Cc: Robin Murphy <robin.murphy@arm.com>
Cc: Florian Fainelli <f.fainelli@gmail.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Will Deacon <will.deacon@arm.com>
Cc: Christoffer Dall <christoffer.dall@linaro.org>
Cc: Andre Przywara <Andre.Przywara@arm.com>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Tom Rini <trini@konsulko.com>
Cc: Michael Nazzareno Trimarchi <michael@amarulasolutions.com>
Signed-off-by: Nishanth Menon <nm@ti.com>
Tested-by: Fabio Estevam <fabio.estevam@nxp.com>
6 years agoMerge branch 'master' of git://git.denx.de/u-boot-spi
Tom Rini [Thu, 28 Jun 2018 13:04:41 +0000 (09:04 -0400)]
Merge branch 'master' of git://git.denx.de/u-boot-spi

6 years agodwc2 USB controller hangs with lan78xx
Andrew Thomas [Mon, 18 Jun 2018 18:56:06 +0000 (11:56 -0700)]
dwc2 USB controller hangs with lan78xx

This bug is the combination of dwc2 USB controller and lan78xx
USB ethernet controller, which is the combination in use on
the Raspberry Pi Model 3 B+.

When the host attempts to receive a packet, but a packet has not
arrived, the lan78xx controller responds by setting BIR
(Bulk-In Empty Response) to NAK. Unfortunately, this hangs
the USB controller and requires the USB controller to
be reset.

The fix proposed is to have the lan78xx controller respond
by setting BIR to ZLP.

Signed-off-by: Andrew Thomas <andrew.thomas@oracle.com>
Tested-by: Peter Robinson <pbrobinson@gmail.com>
Reviewed-by: Alexander Graf <agraf@suse.de>
6 years agoMerge git://git.denx.de/u-boot-imx
Tom Rini [Wed, 27 Jun 2018 17:09:55 +0000 (13:09 -0400)]
Merge git://git.denx.de/u-boot-imx

6 years agofw_printenv: Don't bail out directly after one env read error
Joe Hershberger [Tue, 26 Jun 2018 09:37:59 +0000 (12:37 +0300)]
fw_printenv: Don't bail out directly after one env read error

When using a redundant environment a read error should simply mean to
not use that copy instead of giving up completely. The other copy may
be just fine.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Signed-off-by: Ioan-Adrian Ratiu <adrian.ratiu@ni.com>
6 years agoimx: bx50v3: fix Maintainers
Stefano Babic [Wed, 27 Jun 2018 11:02:36 +0000 (13:02 +0200)]
imx: bx50v3: fix Maintainers

This fixes the warnings:

WARNING: no status info for 'ge_bx50v3'
WARNING: no maintainers for 'ge_bx50v3

Signed-off-by: Stefano Babic <sbabic@denx.de>
6 years agomtd: nand: mxs_nand_spl: add mxs_flash_full_ident
Jörg Krause [Sun, 14 Jan 2018 18:26:40 +0000 (19:26 +0100)]
mtd: nand: mxs_nand_spl: add mxs_flash_full_ident

For now, the existing SPL MXS NAND driver only supports to identify
ONFi-compliant NAND chips. In order to allow identifying
non-ONFi-compliant chips add `mxs_flash_full_ident()` which uses the
`nand_get_flash_type()` functionality from `nand_base.c` to lookup
for supported NAND chips in the chip ID list.

For compatibility reason the full identification support is only
available if the config option `CONFIG_SPL_NAND_IDENT` is enabled.

The lookup was tested on a custom i.MX6ULL board with a Toshiba
TC58NVG1S3HTAI0 NAND chip.

Signed-off-by: Jörg Krause <joerg.krause@embedded.rocks>
6 years agomtd: nand: mxs_nand_spl: refactor mxs_flash_ident
Jörg Krause [Sun, 14 Jan 2018 18:26:39 +0000 (19:26 +0100)]
mtd: nand: mxs_nand_spl: refactor mxs_flash_ident

The existing `mxs_flash_ident()` is limited to identify ONFi compliant
NAND chips only. In order to support non-ONFi NAND chips refactor the
function and rename it to `mxs_flash_onfi_ident()`.

A follow-up patch will add `mxs_flash_full_ident()` which allows to use
the chip ID list to lookup for supported NAND flashs.

Signed-off-by: Jörg Krause <joerg.krause@embedded.rocks>
6 years agospl, nand: add option CONFIG_SPL_NAND_IDENT to lookup for supported NAND chips
Jörg Krause [Sun, 14 Jan 2018 18:26:38 +0000 (19:26 +0100)]
spl, nand: add option CONFIG_SPL_NAND_IDENT to lookup for supported NAND chips

Add the config option `CONFIG_SPL_NAND_IDENT` for using the NAND chip ID list
to identify the NAND flash in SPL.

Signed-off-by: Jörg Krause <joerg.krause@embedded.rocks>
6 years agomtd: nand: export nand_get_flash_type function
Jörg Krause [Sun, 14 Jan 2018 18:26:37 +0000 (19:26 +0100)]
mtd: nand: export nand_get_flash_type function

`nand_get_flash_type()` allows identification of supported NAND flashs.
The function is useful in SPL (like mxs_nand_spl.c) to lookup for a NAND
flash (which does not support ONFi) instead of using nand_simple.c and
hard-coding all required NAND parameters.

Signed-off-by: Jörg Krause <joerg.krause@embedded.rocks>
6 years agocl-som-imx7: Remove CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_SECTOR=y
Fabio Estevam [Mon, 18 Jun 2018 15:57:35 +0000 (12:57 -0300)]
cl-som-imx7: Remove CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_SECTOR=y

Since commit 1da1938d57b3 ("spl: Add default values for ARCH_MX7")
CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_SECTOR is selected by default on
i.MX7 platforms, so remove it from the board defconfig.

Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>
6 years agoimx6ul: geam: Fix fdt_file mismatch
Jagan Teki [Mon, 18 Jun 2018 05:42:19 +0000 (11:12 +0530)]
imx6ul: geam: Fix fdt_file mismatch

fdt_file is looking for imx6ul-geam-kit.dtb but Linux
has imx6ul-geam.dtb, since Linux skipped -kit on file name
by below commit.
"ARM: dts: imx6ul-geam: Skip suffix -kit from dts name"
(sha1: 182de5ebce71e469cfa686fcdf08c9cbe11ece97)

So, due to this mismatch U-Boot failed to pick the
proper dtb which eventually break the Linux boot.

This patch fixed this mismatch by
- renaming dts files
- update config option to use new dtb file
- update fdt_file to new dtb file name

Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
Reviewed-by: Fabio Estevam <fabio.estevam@nxp.com>
6 years agopower: pmic: Let PFUZE3000 see all 256 registers
Trent Piepho [Wed, 25 Apr 2018 17:06:00 +0000 (10:06 -0700)]
power: pmic: Let PFUZE3000 see all 256 registers

The PFUZE3000 uses registers addresses up to 0xff.

The DM pfuze100 driver supports both pfuze100 and pfuze3000.  Allow it
to use the device type to return the correct number of registers.

Also rename the too generic PMIC_NUM_OF_REGS enumeration value for
pfuze3000 to match the other "PFUZE3000_" prefixed enumerations and the
pfuze100 enumeration value PFUZE100_NUM_OF_REGS.

Cc: Peng Fan <Peng.Fan@freescale.com>
Cc: Jaehoon Chung <jh80.chung@samsung.com>
Cc: Stefano Babic <sbabic@denx.de>
Cc: Fabio Estevam <fabio.estevam@nxp.com>
Signed-off-by: Trent Piepho <tpiepho@impinj.com>
Reviewed-by: Fabio Estevam <fabio.estevam@nxp.com>
6 years agoarm: dts: imx7: colibri: add raw NAND support
Stefan Agner [Fri, 22 Jun 2018 16:06:20 +0000 (18:06 +0200)]
arm: dts: imx7: colibri: add raw NAND support

Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
6 years agoarm: dts: imx7: sync with Linux
Stefan Agner [Fri, 22 Jun 2018 16:06:19 +0000 (18:06 +0200)]
arm: dts: imx7: sync with Linux

Sync with Linux commit 60cc43fc8884 ("Linux 4.17-rc1").

Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
6 years agomtd: nand: mxs_nand: add support for specific ECC strength
Stefan Agner [Fri, 22 Jun 2018 16:06:18 +0000 (18:06 +0200)]
mtd: nand: mxs_nand: add support for specific ECC strength

Add support for specified ECC strength/size using device tree
properties nand-ecc-strength/nand-ecc-step-size.

This aligns behavior with the mainline driver, such that:
- If fsl,use-minimal-ecc is requested it will use data from
  data sheet/ONFI. If this is not available the driver will fail.
- If nand-ecc-strength/nand-ecc-step-size are specified those
  value will be used.
- By default maximum possible ECC strength is used

Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
6 years agomtd: nand: mxs_nand: add device tree support
Stefan Agner [Fri, 22 Jun 2018 16:06:17 +0000 (18:06 +0200)]
mtd: nand: mxs_nand: add device tree support

Support driver data from device tree. Also support fsl,use-minimal-ecc
similar to Linux' GPMI NAND driver.

Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
6 years agomtd: nand: mxs_nand: move structs into header file
Stefan Agner [Fri, 22 Jun 2018 16:06:16 +0000 (18:06 +0200)]
mtd: nand: mxs_nand: move structs into header file

Move structs into header file so we can use a separate compile
unit for device tree support.

Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
6 years agomtd: nand: mxs_nand: add use_minimum_ecc to struct
Stefan Agner [Fri, 22 Jun 2018 16:06:15 +0000 (18:06 +0200)]
mtd: nand: mxs_nand: add use_minimum_ecc to struct

Add use_minimum_ecc as struct mxs_nand_info field in preparation
for device tree support.

Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
6 years agomtd: nand: mxs_nand: separate board/controller init
Stefan Agner [Fri, 22 Jun 2018 16:06:14 +0000 (18:06 +0200)]
mtd: nand: mxs_nand: separate board/controller init

In preparation for device tree support separate board init
from controller init similar to other raw NAND drivers.

Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
6 years agomtd: nand: mxs_nand: use more precise function name
Stefan Agner [Fri, 22 Jun 2018 16:06:13 +0000 (18:06 +0200)]
mtd: nand: mxs_nand: use more precise function name

This function initializes DMA descriptors so mxs_nand_init_dma is
more precise. It also frees up the rather generic name mxs_nand_init.

Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
6 years agomtd: nand: mxs_nand: move register structs to driver data
Stefan Agner [Fri, 22 Jun 2018 16:06:12 +0000 (18:06 +0200)]
mtd: nand: mxs_nand: move register structs to driver data

Move GPMI and BCH register structs to the driver struct mxs_nand_info
in prepartion for device tree support.

Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
6 years agomtd: nand: mxs_nand: add minimal ECC support
Stefan Agner [Fri, 22 Jun 2018 15:19:51 +0000 (17:19 +0200)]
mtd: nand: mxs_nand: add minimal ECC support

Add support for minimum ECC strength supported by the NAND chip.
This aligns with the behavior when using the fsl,use-minimum-ecc
device tree property in Linux.

Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
6 years agomtd: nand: mxs_nand: report correct ECC parameters
Stefan Agner [Fri, 22 Jun 2018 15:19:50 +0000 (17:19 +0200)]
mtd: nand: mxs_nand: report correct ECC parameters

Report correct ECC parameters back to the stack. Do not report
bytes as we have it not immeaditly available and the Linux version
also does not report it. It seems to have no aversive effect.

Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
6 years agomtd: nand: mxs_nand: use structure for BCH geometry
Stefan Agner [Fri, 22 Jun 2018 15:19:49 +0000 (17:19 +0200)]
mtd: nand: mxs_nand: use structure for BCH geometry

Calculate BCH geometry at start and store the information in
a structure. This avoids recalculation on every page access
and allows to calculate ECC relevant information in one place.
This patch does not change ECC layout or driver behavior in
any way.

The patch aligns the driver somewhat with the Linux GPMI NAND
driver which drives the same IP.

Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
6 years agomtd: nand: mxs_nand: allow to enable BBT support
Stefan Agner [Fri, 22 Jun 2018 15:19:48 +0000 (17:19 +0200)]
mtd: nand: mxs_nand: allow to enable BBT support

Add config option which allows to enable on flash bad block table
support. This has the same effect as when using the device tree
property "nand-on-flash-bbt" in Linux.

Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
6 years agomtd: nand: mxs_nand: use self init
Stefan Agner [Fri, 22 Jun 2018 15:19:47 +0000 (17:19 +0200)]
mtd: nand: mxs_nand: use self init

Instead of completing initialization via scan_bbt callback use
NAND self init to initialize the GPMI (MXS) NAND controller.

Suggested-by: Scott Wood <oss@buserror.net>
Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
6 years agomtd: nand: mxs_nand: introduce SPL specific init
Stefan Agner [Fri, 22 Jun 2018 15:19:46 +0000 (17:19 +0200)]
mtd: nand: mxs_nand: introduce SPL specific init

In preparation to convert the driver to use NAND self init
provide a new minimal init for SPL builds. As a side effect
this also reduces size of SPL by about 4KiB.

Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
6 years agoMerge git://git.denx.de/u-boot-dm
Tom Rini [Mon, 25 Jun 2018 14:57:07 +0000 (10:57 -0400)]
Merge git://git.denx.de/u-boot-dm

6 years agomtd: spi: Correct parameters for s25fs512s flash
Ashish Kumar [Mon, 25 Jun 2018 10:15:11 +0000 (15:45 +0530)]
mtd: spi: Correct parameters for s25fs512s flash

Change sector size to 256KiB in table spi_flash_ids.

Signed-off-by: Ashish Kumar <Ashish.Kumar@nxp.com>
Reviewed-by: Jagan Teki <jagan@openedev.com>
6 years agospi: omap3: fix set_speed and set_mode dm callbacks
Hannes Schmelzer [Sat, 2 Jun 2018 06:06:48 +0000 (08:06 +0200)]
spi: omap3: fix set_speed and set_mode dm callbacks

commit 84807922874e03895bbf15c4472a2dcee8fbbd03
("spi: omap3: Skip set_mode, set_speed from claim") did break SPI
support on my AM335x board.

The named commit:

- ignored the responsible arguments (speed, mode)
The set speed/mode function must use the supplied function arguments to
work properly. With this commit we take those arguments and transfer
them to the priv-data.

- used wrong udevice pointer for getting priv data
the udevice-pointer within function argument is already the spi-bus
device, so it is wrong looking here for some parent (ocp-bus in this
case) and getting priv-pointer from there.

Signed-off-by: Hannes Schmelzer <oe5hpm@oevsv.at>
Reviewed-by: Jagan Teki <jagan@openedev.com>
6 years agospi: omap3: pre-initialize bus-speed with max. slave-speed
Hannes Schmelzer [Sat, 2 Jun 2018 06:06:47 +0000 (08:06 +0200)]
spi: omap3: pre-initialize bus-speed with max. slave-speed

Otherwise the frequency is zero and the clock divider cannot be setup by
'omap3_spi_set_speed' function.

Signed-off-by: Hannes Schmelzer <oe5hpm@oevsv.at>
Reviewed-by: Jagan Teki <jagan@openedev.com>
6 years agospi: mxc_spi: Fix chipselect on DM_SPI driver uclass
Michael Trimarchi [Wed, 20 Jun 2018 20:51:18 +0000 (22:51 +0200)]
spi: mxc_spi: Fix chipselect on DM_SPI driver uclass

CS GPIO activation low/high is determinated by the device tree
so we don't need to take in accoung in cs_activate and cs_deactivate

Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Jagan Teki <jagan@openedev.com>
6 years agospi: mxc: Fix compilation problem of DM_SPI class driver
Michael Trimarchi [Wed, 20 Jun 2018 20:51:17 +0000 (22:51 +0200)]
spi: mxc: Fix compilation problem of DM_SPI class driver

drivers/spi/mxc_spi.c:507: undefined reference to `dev_get_addr'
linux-ld.bfd: BFD (GNU Binutils) 2.29.1 assertion fail elf32-arm.c:9509

Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com>
Reviewed-by: Fabio Estevam <fabio.estevam@nxp.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Jagan Teki <jagan@openedev.com>
6 years agospi: zynq_qspi: Fixed incorrect return value error
Vipul Kumar [Mon, 25 Jun 2018 08:43:57 +0000 (14:13 +0530)]
spi: zynq_qspi: Fixed incorrect return value error

This patch replaced "return 0" with "return status" to fix the
incorrect return value error reported by the coverity.

Reviewed-by: Michal Simek <michal.simek@xilinx.com>
Signed-off-by: Vipul Kumar <vipul.kumar@xilinx.com>
[jagan: rebased on master]
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
6 years agoMerge git://git.denx.de/u-boot-x86
Tom Rini [Sun, 24 Jun 2018 01:47:39 +0000 (21:47 -0400)]
Merge git://git.denx.de/u-boot-x86

6 years agocmd: efi: Fix wrong memory descriptor end address
Bin Meng [Fri, 22 Jun 2018 08:38:31 +0000 (01:38 -0700)]
cmd: efi: Fix wrong memory descriptor end address

Each entry of the EFI memory descriptors occupies map->desc_size,
not sizeof(struct efi_mem_desc).

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
6 years agox86: efi: payload: Count in conventional memory above 4GB in DRAM bank
Bin Meng [Fri, 22 Jun 2018 08:38:30 +0000 (01:38 -0700)]
x86: efi: payload: Count in conventional memory above 4GB in DRAM bank

At present in dram_init_banksize() it ignores conventional memory
above 4GB. This leads to wrong DRAM size is printed during boot.
Remove such limitation.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
6 years agox86: efi-x86_payload: Enable PRE_CONSOLE_BUFFER
Bin Meng [Fri, 22 Jun 2018 08:38:29 +0000 (01:38 -0700)]
x86: efi-x86_payload: Enable PRE_CONSOLE_BUFFER

Enable PRE_CONSOLE_BUFFER so that the full boot output can be viewed
on the video console for the EFI payload.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
6 years agoefi: stub: Move the use_uart assignment immediately after exit_boot_services() call
Bin Meng [Fri, 22 Jun 2018 08:38:28 +0000 (01:38 -0700)]
efi: stub: Move the use_uart assignment immediately after exit_boot_services() call

The use_uart assignment should follow immediately after the call to
exit_boot_services(), in case we want some debug output after that.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
6 years agox86: Change __kernel_size_t conditionals to use compiler provided defines
Bin Meng [Fri, 22 Jun 2018 08:38:27 +0000 (01:38 -0700)]
x86: Change __kernel_size_t conditionals to use compiler provided defines

Since commit bb0bb91cf0aa ("efi_stub: Use efi_uintn_t"), EFI x86
64-bit payload does not work anymore. The call to GetMemoryMap()
in efi_stub.c fails with return code EFI_INVALID_PARAMETER. Since
the payload itself is still 32-bit U-Boot, efi_uintn_t gets wrongly
interpreted as int, but it should actually be long in a 64-bit EFI
environment.

This changes the x86 __kernel_size_t conditionals to use compiler
provided defines instead. That way we always adhere to the build
environment we're in and the definitions adjust automatically.

Fixes: bb0bb91cf0aa ("efi_stub: Use efi_uintn_t")
Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
6 years agoefi.h: Do not use config options
Alexander Graf [Fri, 22 Jun 2018 08:38:26 +0000 (01:38 -0700)]
efi.h: Do not use config options

Currently efi.h determines a few bits of its environment according to
config options. This falls apart with the efi stub support which may
result in efi.h getting pulled into the stub as well as real U-Boot
code. In that case, one may be 32bit while the other one is 64bit.

This patch changes the conditionals to use compiler provided defines
instead. That way we always adhere to the build environment we're in
and the definitions adjust automatically.

Signed-off-by: Alexander Graf <agraf@suse.de>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tested-by: Bin Meng <bmeng.cn@gmail.com>
[bmeng: added some comments to describe the __x86_64__ check]
Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
6 years agox86: efi-x86_payload: Enable usb keyboard during boot
Bin Meng [Sun, 17 Jun 2018 12:57:53 +0000 (05:57 -0700)]
x86: efi-x86_payload: Enable usb keyboard during boot

For boards that don't route serial port pins out, it's quite common
to attach a USB keyboard as the input device, along with a monitor.
However USB is not automatically started in the generic efi payload
codes. This uses a payload specific last_stage_init() to start the
USB bus, so that a USB keyboard can be used on the U-Boot shell.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
6 years agox86: efi-x86_payload: Enumerate PCI bus during early boot
Bin Meng [Sun, 17 Jun 2018 12:57:52 +0000 (05:57 -0700)]
x86: efi-x86_payload: Enumerate PCI bus during early boot

The generic efi payload currently does not enumerate the PCI bus,
which means peripherals on the PCI bus are not discovered by their
drivers. This uses board_early_init_r() to do the PCI enumeration.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
6 years agoboard_r: Do not initialize IDE when DM BLK is on
Bin Meng [Sun, 17 Jun 2018 12:57:50 +0000 (05:57 -0700)]
board_r: Do not initialize IDE when DM BLK is on

With driver model philosophy, we should avoid explicitly calling
driver initialization routine during boot. This updates the ram
init sequence table to exclude the IDE initialization for DM BLK.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
6 years agox86: qemu: Change default vesa mode to 1024x768x32
Bin Meng [Sun, 17 Jun 2018 12:57:49 +0000 (05:57 -0700)]
x86: qemu: Change default vesa mode to 1024x768x32

The default vesa mode was changed since commit 55b4e1b7d999
("x86: Change default FRAMEBUFFER_VESA_MODE of some boards") for
better VxWorks compatibility but with the changes QEMU video console
no longer works. This is because QEMU's vgabios implements the VESA
mode 8:8:8 as 24bpp without an alpha channel, which U-Boot's video
console driver currently does not support yet.

We need change to real 32bpp in order to make it work again. QEMU
vgabios implements the custom 32bpp VESA mode starting from 0x140
(320x200x32) to 0x147 (1600x1200x32). Set it to 0x144 (1024x768x32).

Fixes: 55b4e1b7d999 ("x86: Change default FRAMEBUFFER_VESA_MODE of some boards")
Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
6 years agox86: Add 64-bit setjmp/longjmp implementation
Ivan Gorinov [Tue, 19 Jun 2018 18:40:42 +0000 (11:40 -0700)]
x86: Add 64-bit setjmp/longjmp implementation

Add setjmp/longjmp functions for x86_64.

Signed-off-by: Ivan Gorinov <ivan.gorinov@intel.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
6 years agox86: qemu: do not build car.o with start64.o
Heinrich Schuchardt [Tue, 19 Jun 2018 17:12:15 +0000 (19:12 +0200)]
x86: qemu: do not build car.o with start64.o

car.o can only be used with start.o, not with start64.o.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
6 years agox86: efi-x86_app: Update MAINTAINERS
Bin Meng [Tue, 19 Jun 2018 01:43:17 +0000 (18:43 -0700)]
x86: efi-x86_app: Update MAINTAINERS

Previous rename of efi-x86 target missed the MAINTAINERS update,
which caused the buildman warnings:

  WARNING: no status info for 'efi-x86_app'
  WARNING: no maintainers for 'efi-x86_app'

This updates the board MAINTAINERS to reflect the up-to-date info.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
6 years agopatman: Support using a particular SMTP server
Simon Glass [Tue, 19 Jun 2018 15:56:07 +0000 (09:56 -0600)]
patman: Support using a particular SMTP server

Some environments require providing the '--smtp-server' argument to
'git send-email'. Add support for this.

Signed-off-by: Simon Glass <sjg@chromium.org>
6 years agopatman: add test for SPDX license
Chris Packham [Thu, 7 Jun 2018 08:45:07 +0000 (20:45 +1200)]
patman: add test for SPDX license

Add a test to exercise the check for a valid SPDX license.

Signed-off-by: Chris Packham <judge.packham@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
6 years agopatman: add option for limiting the Cc list
Chris Packham [Thu, 7 Jun 2018 08:45:06 +0000 (20:45 +1200)]
patman: add option for limiting the Cc list

Many mailing-lists consider a long Cc list a sign of spam and will
either drop the message or mark it for moderation. Because patman
automatically invokes get_maintainer.pl the Cc list can expand
unexpectedly. Allow the user to specify a limit for the Cc list.

This limit is applied after removing any known bouncing addresses. By
default no limit is applied.

Signed-off-by: Chris Packham <judge.packham@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
6 years agoMerge branch 'master' of git://git.denx.de/u-boot-uniphier
Tom Rini [Fri, 22 Jun 2018 17:12:53 +0000 (13:12 -0400)]
Merge branch 'master' of git://git.denx.de/u-boot-uniphier

6 years agoARM: dts: uniphier: enable SD card for PXs3 reference board
Masahiro Yamada [Tue, 19 Jun 2018 07:11:47 +0000 (16:11 +0900)]
ARM: dts: uniphier: enable SD card for PXs3 reference board

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
6 years agoARM: dts: uniphier: sync DT with Linux 4.18-rc1
Masahiro Yamada [Tue, 19 Jun 2018 07:11:46 +0000 (16:11 +0900)]
ARM: dts: uniphier: sync DT with Linux 4.18-rc1

Now that the clock-frequency information has been moved to the
driver, more DT sync is possible.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
6 years agoserial: uniphier: set clock rate without clock-frequency property
Masahiro Yamada [Tue, 19 Jun 2018 07:11:45 +0000 (16:11 +0900)]
serial: uniphier: set clock rate without clock-frequency property

In Linux, the clock rate of the UART is given by the clock driver.

If you try to follow that in U-Boot, you would end up with adding
more u-boot,dm-pre-reloc properties, and also the clock driver would
be too big for SPL, which is used for UniPhier ARMv7 platform.

The current solution is to add 'clock-frequency' property to the
UART nodes, but it does not exist in the DT files in Linux.  I do
not want to let DT diverge for U-Boot.

Check the SoC compatible and set the clock rate according to it.
This will be helpful to sync DT between Linux and U-Boot.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
6 years agoserial: uniphier: rename struct uniphier_serial_private_data
Masahiro Yamada [Tue, 19 Jun 2018 07:11:44 +0000 (16:11 +0900)]
serial: uniphier: rename struct uniphier_serial_private_data

Just for making it shorter.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
6 years agoreset: uniphier: sync reset data with Linux 4.18-rc1
Masahiro Yamada [Tue, 19 Jun 2018 07:11:43 +0000 (16:11 +0900)]
reset: uniphier: sync reset data with Linux 4.18-rc1

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
6 years agoARM: uniphier: enable CONFIG_SNI_AVE and disable CONFIG_SMC911X
Masahiro Yamada [Tue, 19 Jun 2018 07:11:42 +0000 (16:11 +0900)]
ARM: uniphier: enable CONFIG_SNI_AVE and disable CONFIG_SMC911X

Enable the on-chip ethernet driver for uniphier_{v7,v8}_defconfig.
Disable the on-board SMC911x because it has not migrated to the
driver model yet - it is not possible to enable DM and non-DM
drivers at the same time.

The CONFIG_SMC911X for uniphier_ld4_sld8_defconfig is still kept
because the on-chip ethernet driver for LD4, sLD8 is not supported
yet.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
6 years agoMerge tag 'signed-efi-2018.07' of git://github.com/agraf/u-boot
Tom Rini [Fri, 22 Jun 2018 12:14:49 +0000 (08:14 -0400)]
Merge tag 'signed-efi-2018.07' of git://github.com/agraf/u-boot

Patch queue for efi - 2018-06-21

A single urgent fix to make sure green and red are not swapped
in OSs that make use of EFI GOP frame buffers to display pictures
(such as efifb in Linux).

6 years agoefi_loader: Fix GOP 32bpp exposure
Alexander Graf [Tue, 19 Jun 2018 11:34:54 +0000 (13:34 +0200)]
efi_loader: Fix GOP 32bpp exposure

We store pixels as BGRA in memory, as can be seen from struct efi_gop_pixel.
So we need to expose the same format to UEFI payloads to actually have them
use the correct colors.

Reported-by: Fabian Vogt <fvogt@suse.com>
Tested-by: Peter Robinson <pbrobinson@gmail.com>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
6 years agoMerge branch 'master' of git://git.denx.de/u-boot-sh
Tom Rini [Thu, 21 Jun 2018 13:02:35 +0000 (09:02 -0400)]
Merge branch 'master' of git://git.denx.de/u-boot-sh

6 years agoMerge tag 'arc-updates-for-2018.07-rc3' of git://git.denx.de/u-boot-arc
Tom Rini [Thu, 21 Jun 2018 13:01:29 +0000 (09:01 -0400)]
Merge tag 'arc-updates-for-2018.07-rc3' of git://git.denx.de/u-boot-arc

Here we only add readme file for EMDK board
support of which was added in this release cycle.

6 years agoMakefile: Ensure we build with -std=gnu11
Tom Rini [Wed, 20 Jun 2018 03:53:54 +0000 (23:53 -0400)]
Makefile: Ensure we build with -std=gnu11

As many targets are now commonly built with gcc-6 or later (which
defaults to a newer C standard than older compilers), certain C
constructs are now being used as they produce more readable code.  And
while all compilers that we support building with support the C11
standard (and GNU11) they do not default to that standard.  Ensure that
we pass along -std=gnu11 when building.

Signed-off-by: Tom Rini <trini@konsulko.com>
6 years agoARC: EMDK: Add readme
Alexey Brodkin [Fri, 15 Jun 2018 15:20:59 +0000 (18:20 +0300)]
ARC: EMDK: Add readme

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
6 years agoPrepare v2018.07-rc2 v2018.07-rc2
Tom Rini [Tue, 19 Jun 2018 23:39:44 +0000 (19:39 -0400)]
Prepare v2018.07-rc2

Signed-off-by: Tom Rini <trini@konsulko.com>
6 years agotest_avb: Add pymark.buildconfigspec information for the AVB tests
Tom Rini [Mon, 18 Jun 2018 23:04:25 +0000 (19:04 -0400)]
test_avb: Add pymark.buildconfigspec information for the AVB tests

Signed-off-by: Tom Rini <trini@konsulko.com>
6 years agolibavb: Update SPDX tag style
Tom Rini [Tue, 19 Jun 2018 15:21:44 +0000 (11:21 -0400)]
libavb: Update SPDX tag style

Signed-off-by: Tom Rini <trini@konsulko.com>
6 years agoconfigs: Update Meson GX configs
Neil Armstrong [Thu, 14 Jun 2018 11:43:41 +0000 (13:43 +0200)]
configs: Update Meson GX configs

Enable USB on all Amlogic Meson GXL based board.
Enable Regulator support on all boards.
Enable ADC support on the LibreTech-CC board.

Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
6 years agomeson: use the clock driver
Beniamino Galvani [Thu, 14 Jun 2018 11:43:40 +0000 (13:43 +0200)]
meson: use the clock driver

Use the clk framework to initialize clocks from drivers that need them
instead of having hardcoded frequencies and initializations from board
code.

Signed-off-by: Beniamino Galvani <b.galvani@gmail.com>
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
6 years agoclk: add Amlogic meson clock driver
Beniamino Galvani [Thu, 14 Jun 2018 11:43:39 +0000 (13:43 +0200)]
clk: add Amlogic meson clock driver

Introduce a basic clock driver for Amlogic Meson SoCs which supports
enabling/disabling clock gates and getting their frequency.

Signed-off-by: Beniamino Galvani <b.galvani@gmail.com>
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
6 years agoconfig: meson-gx-common: Enable USB boot
Neil Armstrong [Thu, 14 Jun 2018 11:43:38 +0000 (13:43 +0200)]
config: meson-gx-common: Enable USB boot

Add USB as boot target depending on the configuration.

Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
6 years agoadc: meson-saradc: fix regmap_init_mem call
Neil Armstrong [Thu, 14 Jun 2018 11:43:37 +0000 (13:43 +0200)]
adc: meson-saradc: fix regmap_init_mem call

The SARADC driver was merged after the following commit :
commit d35812368a59 ("regmap: change regmap_init_mem() to take ofnode instead udevice")
Thus breaking build, this patch fixes the regmap_init_mem accordingly.

Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
6 years agoconfigs: dragonboard410c: remove env partition offset
Ramon Fried [Thu, 14 Jun 2018 04:04:41 +0000 (07:04 +0300)]
configs: dragonboard410c: remove env partition offset

BOOT2 is not partitioned, no need for partition offset.

Signed-off-by: Ramon Fried <ramon.fried@gmail.com>
6 years agoconfigs: db410c: Set eMMC env partition to BOOT2
Ramon Fried [Thu, 14 Jun 2018 04:04:40 +0000 (07:04 +0300)]
configs: db410c: Set eMMC env partition to BOOT2

BOOT2 partition is empty and free for using to store the environment.
Use that instead of the default user partition.

Signed-off-by: Ramon Fried <ramon.fried@gmail.com>
6 years agocommon: Fix cpu nr type which is always unsigned type
Michal Simek [Wed, 13 Jun 2018 06:56:31 +0000 (08:56 +0200)]
common: Fix cpu nr type which is always unsigned type

cpu_cmd() is reading cpu number via simple_strtoul() which is always
unsigned type.
Platform code implementations are not expecting that nr can be negative
and there is not checking in the code for that too.

This patch is using u32 type for cpu number to make sure that platform
code get proper value range.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
6 years agobootm: Handle kernel_noload on arm64
Marek Vasut [Wed, 13 Jun 2018 04:13:33 +0000 (06:13 +0200)]
bootm: Handle kernel_noload on arm64

The ARM64 has 2 MiB alignment requirement for the kernel. When using
fitImage, this requirement may by violated, the kernel will thus be
executed from unaligned address and fail to boot. Do what booti does
and run booti_setup() for kernel_noload images on arm64 to obtain a
suitable aligned address to which the image shall be relocated.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Bin Chen <bin.chen@linaro.org>
Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Cc: Tom Rini <trini@konsulko.com>
6 years agoARM: image: Add option for ignoring ep bit 3
Marek Vasut [Wed, 13 Jun 2018 04:13:32 +0000 (06:13 +0200)]
ARM: image: Add option for ignoring ep bit 3

Add option to the booti_setup() which indicates to it that the caller
requires the image to be relocated to the beginning of the RAM and
that the information whether the image can be located anywhere in RAM
at 2 MiB aligned boundary or not is to be ignored. This is useful ie.
in case the Image is wrapped in another envelope, ie. fitImage and not
relocating it but moving it would corrupt the envelope.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Bin Chen <bin.chen@linaro.org>
Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Cc: Tom Rini <trini@konsulko.com>
Reviewed-By: Bin Chen <bin.chen@linaro.org>
6 years agosandbox: swap_case: Increase number of base address regs
Simon Glass [Tue, 12 Jun 2018 06:05:02 +0000 (00:05 -0600)]
sandbox: swap_case: Increase number of base address regs

At present the code overruns the bar[] array. Fix this.

At the same time, drop the leading / from the "/spl" path so that we can
run U-Boot SPL with:

   spl/u-boot-spl

rather than requiring:

   /path/to/spl/u-boot-spl

Reported-by: Coverity (CID: 131199)
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
6 years agospi: sandbox: Fix memory leak in sandbox_sf_bind_emul()
Simon Glass [Tue, 12 Jun 2018 06:05:01 +0000 (00:05 -0600)]
spi: sandbox: Fix memory leak in sandbox_sf_bind_emul()

Move the strdup() call so that it is only done when we know we will bind
the device.

Reported-by: Coverity (CID: 131216)
Signed-off-by: Simon Glass <sjg@chromium.org>
6 years agorsa: Fix missing memory leak on error in fdt_add_bignum()
Simon Glass [Tue, 12 Jun 2018 06:05:00 +0000 (00:05 -0600)]
rsa: Fix missing memory leak on error in fdt_add_bignum()

Thsi function can fail without freeing all its memory. Fix it.

Reported-by: Coverity (CID: 131217)
Signed-off-by: Simon Glass <sjg@chromium.org>
6 years agofdtgrep: Separate out checking of two allocations
Simon Glass [Tue, 12 Jun 2018 06:04:59 +0000 (00:04 -0600)]
fdtgrep: Separate out checking of two allocations

The current code might succeed on the first allocation and fail on the
second. Separate the checks to avoid this problem.

Of course, free() will never fail and the chances that (when allocating
two small areas) one will succeed and one will fail are just as remote.
But this keeps coverity happy.

Reported-by: Coverity (CID: 131226)
Signed-off-by: Simon Glass <sjg@chromium.org>
6 years agofdtgrep: Fix logic of free() in do_fdtgrep()
Simon Glass [Tue, 12 Jun 2018 06:04:58 +0000 (00:04 -0600)]
fdtgrep: Fix logic of free() in do_fdtgrep()

This loop never actually exits, but the way the code is written this is
not obvious. Add an explicit error check.

Reported-by: Coverity (CID: 131280)
Signed-off-by: Simon Glass <sjg@chromium.org>
[trini: Add explicit init of region to NULL per LLVM warning]
Signed-off-by: Tom Rini <trini@konsulko.com>
6 years agoARM: dts: rmobile: Add HS200 support to E3 Ebisu
Marek Vasut [Mon, 18 Jun 2018 04:03:57 +0000 (06:03 +0200)]
ARM: dts: rmobile: Add HS200 support to E3 Ebisu

Add regulator nodes and pinmux settings to the SDHI3 on E3 Ebisu
and enable HS200 mode on it.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
6 years agoARM: dts: rmobile: Move the PHY reset GPIOs into PHY nodes
Marek Vasut [Mon, 18 Jun 2018 02:09:10 +0000 (04:09 +0200)]
ARM: dts: rmobile: Move the PHY reset GPIOs into PHY nodes

Both the RAVB and SH ether driver now support parsing the PHY reset
GPIOs from both the PHY nodes and the MAC nodes, move the reset GPIOs
back into the PHY nodes to minimize DT difference between U-Boot and
Linux.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
6 years agonet: sh_eth: Support reset GPIO both in mac and phy node
Marek Vasut [Mon, 18 Jun 2018 02:03:01 +0000 (04:03 +0200)]
net: sh_eth: Support reset GPIO both in mac and phy node

The recent DTs have the PHY reset GPIO in the PHY node rather than
the ethernet MAC node, support extracting the PHY reset GPIO info
from both the PHY node and ethernet MAC node.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
Cc: Joe Hershberger <joe.hershberger@ni.com>
6 years agonet: ravb: Support reset GPIO both in mac and phy node
Marek Vasut [Mon, 18 Jun 2018 02:02:15 +0000 (04:02 +0200)]
net: ravb: Support reset GPIO both in mac and phy node

The recent DTs have the PHY reset GPIO in the PHY node rather than
the ethernet MAC node, support extracting the PHY reset GPIO info
from both the PHY node and ethernet MAC node.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
Cc: Joe Hershberger <joe.hershberger@ni.com>
6 years agonet: ravb: Filter out supported PHY features
Marek Vasut [Mon, 18 Jun 2018 03:44:53 +0000 (05:44 +0200)]
net: ravb: Filter out supported PHY features

The RAVB only supports 100Full and 1000Full operation, it does not support
10Full or any Half-duplex modes. The PHY could still advertise those features
though, so filter out the PHY features accordingly.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
Cc: Joe Hershberger <joe.hershberger@ni.com>
6 years agonet: ravb: Do not shut down clock in start callback
Marek Vasut [Mon, 18 Jun 2018 07:35:45 +0000 (09:35 +0200)]
net: ravb: Do not shut down clock in start callback

Do not stop the clock in the start callback in case of failure, keep
them running to also keep the PHY running. The failure could be ie.
PHY failing to negotiate link and if the clock get shut down, another
attempt at bringing the link up would fail. The clock right now are
started in probe function and stopped in remove function, which is
the correct behavior.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
Cc: Joe Hershberger <joe.hershberger@ni.com>
6 years agoARM: dts: rmobile: Move the PHY reset GPIO back
Marek Vasut [Sun, 17 Jun 2018 05:38:50 +0000 (07:38 +0200)]
ARM: dts: rmobile: Move the PHY reset GPIO back

The current state of RAVB driver expects the PHY reset GPIO in the
RAVB mode, move it back from the PHY node to avoid breakage.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
6 years agoARM: rmobile: Adjust text base on V3M Eagle
Marek Vasut [Sun, 17 Jun 2018 04:40:13 +0000 (06:40 +0200)]
ARM: rmobile: Adjust text base on V3M Eagle

The latest ATF puts the U-Boot at 0x50000000, just like on all the other
boards. Adjust the text base to reflect that change.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
6 years agopinctrl: renesas: Fix register usage in sh_pfc_{read,write}
Marek Vasut [Tue, 19 Jun 2018 04:13:42 +0000 (06:13 +0200)]
pinctrl: renesas: Fix register usage in sh_pfc_{read,write}

The sh_pfc_{read,write}() must operate on the register address directly
rather than on an offset, fix this to prevent illegal access.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
6 years agoconsole: Fix handling of NULL global_data
Simon Glass [Tue, 12 Jun 2018 06:04:56 +0000 (00:04 -0600)]
console: Fix handling of NULL global_data

Both putc() and puts() can be called before global_data is set up. Some of
the code paths don't handle this correctly. Add an explicit test before
any member is accessed.

Reported-by: Coverity (CID: 169030)
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
6 years agolog: Fix incorect range check in log_get_cat_name()
Simon Glass [Tue, 12 Jun 2018 06:04:55 +0000 (00:04 -0600)]
log: Fix incorect range check in log_get_cat_name()

This allows access to an element after the end of the array. Fix it.

Reported-by: Coverity (CID: 173279)
Signed-off-by: Simon Glass <sjg@chromium.org>
6 years agogpio: omap_gpio: Name GPIO's by bank and index with DM_GPIO
Adam Ford [Tue, 12 Jun 2018 01:05:38 +0000 (20:05 -0500)]
gpio: omap_gpio: Name GPIO's by bank and index with DM_GPIO

There are multiple GPIO banks with up to 32 pins / bank. When
using 'gpio status -a' to read the pins, this patch displays
both GPIO<bank>_<index> similar to how the device trees
display in addition to displaying  gpio_#

Signed-off-by: Adam Ford <aford173@gmail.com>
6 years agoarm: mach-omap2/omap3/clock.c: Enable all GPIO with CMD_GPIO
Adam Ford [Tue, 12 Jun 2018 00:56:49 +0000 (19:56 -0500)]
arm: mach-omap2/omap3/clock.c: Enable all GPIO with CMD_GPIO

When CMD_GPIO is enabled the command 'gpio status -a' can cause
a hang or reboot if GPIO banks are not enabled, because it scans
all banks.  This patch enables all GPIO banks so 'gpio status -a'
can fully execute.

Signed-off-by: Adam Ford <aford173@gmail.com>
6 years agoblock: Add SPL_BLOCK_CACHE and default n
Adam Ford [Mon, 11 Jun 2018 22:17:48 +0000 (17:17 -0500)]
block: Add SPL_BLOCK_CACHE and default n

When enabling BLOCK_CACHE on devices with limited RAM during SPL,
some devices may not boot.  This creates an option to enable
block caching in SPL by defaults off.  It is dependent on SPL_BLK

Fixes: 46960ad6d09b ("block: Have BLOCK_CACHE default to y in some cases")

Signed-off-by: Adam Ford <aford173@gmail.com>