platform/kernel/u-boot.git
4 years agoMakefile: mrproper shall delete doc/output/
Heinrich Schuchardt [Sat, 5 Sep 2020 09:08:06 +0000 (11:08 +0200)]
Makefile: mrproper shall delete doc/output/

HTML documentation is generated in doc/output/. This directory shall be
deleted by 'make mrproper'

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
4 years agodoc: describe building with GCC
Heinrich Schuchardt [Sat, 5 Sep 2020 08:58:53 +0000 (10:58 +0200)]
doc: describe building with GCC

Provide a description of the U-Boot build process with GCC in the HTML
documentation.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
4 years agodoc: describe source repository
Heinrich Schuchardt [Sat, 5 Sep 2020 08:58:52 +0000 (10:58 +0200)]
doc: describe source repository

Add a chapter to the HTML documentation describing how to retrieve the
U-Boot sources.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
4 years agoARM: MediaTek: amend IC description for MediaTek MT8512
Mingming Lee [Fri, 4 Sep 2020 05:35:22 +0000 (13:35 +0800)]
ARM: MediaTek: amend IC description for MediaTek MT8512

The description for MT8512  has some mistake, so correct it.

Signed-off-by: Mingming Lee <Mingming.Lee@mediatek.com>
4 years agoFix data abort caused by mis-aligning FIT data
Reuben Dowle [Tue, 1 Sep 2020 21:32:01 +0000 (21:32 +0000)]
Fix data abort caused by mis-aligning FIT data

Attempting to place device tree immediately after an image in memory can lead
to mis-aligned data accesses if that image size is not divisible by the
alignment requirements of the architecture.

Data aborts caused by this were observed on a custom Marvel A388 based system,
where the image was a uboot FIT file. The total size varies depending on the
uboot device tree size, which does not always lead to correct alignment.

The minimum alignment specified for ARM [1] and ARM64 [2] linux booting has been
used

[1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/arm/booting.rst#n126
[2] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/arm64/booting.rst#n45

Signed-off-by: Reuben Dowle <reuben.dowle@4rf.com>
4 years agomtd: nand: Fix nand write error with bad block addresses above 32-bit
T Karthik Reddy [Mon, 31 Aug 2020 12:27:37 +0000 (14:27 +0200)]
mtd: nand: Fix nand write error with bad block addresses above 32-bit

Nand writes should skip the bad blocks with "nand write" command.
In case of bad blocks with above 32-bit address, nand_block_isbad()
returns false due to truncated bad block address.

In below code segment,

if (nand_block_isbad(mtd, offset & ~(mtd->erasesize - 1)))

offset is 64-bit and mtd->erasesize is 32-bit, hence the truncation is
happening. Cast 'mtd->erasesize' with loff_t to fix this issue.

Signed-off-by: T Karthik Reddy <t.karthik.reddy@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
4 years agoenv: Crash in 'env import' when using checksum and a specific size
Pedro Aguilar [Mon, 31 Aug 2020 09:01:41 +0000 (11:01 +0200)]
env: Crash in 'env import' when using checksum and a specific size

This patch adds a sanity check that avoids 'size' to overflow and crash when
importing an environment that contains a checksum. Example with the wrong size
that causes the crash:

=> env import -c 0x4100000 3 v1

This assumes that v1 has already been successfully exported with
'env export -c -s 0x100 0x4100000 v1'

Signed-off-by: Pedro Aguilar <pedro.aguilar@vimar.com>
4 years agobootm: update image OS image size when decompressing
Heinrich Schuchardt [Sun, 30 Aug 2020 09:34:12 +0000 (11:34 +0200)]
bootm: update image OS image size when decompressing

In bootm_load_os() the OS image is decompressed. In later stages of the
boot process we need the decompressed size of the image.

Update images->os.image_len after decompression.

Passing the correct size is necessary if we want to check loaded EFI
binararies for file truncation by comparing the loaded size to the header
field SizeOfImage.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
4 years agocommon: Kconfig: Add dependency for default variables strings
Michal Simek [Thu, 27 Aug 2020 16:01:28 +0000 (18:01 +0200)]
common: Kconfig: Add dependency for default variables strings

Kconfig provides several config options for setting up default variables
but these are unused when variables are passed to U-Boot via file.
That's why cover this dependency in Kconfig.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
4 years agoPCI: mediatek: Release the resource when PCIe enable port fail
Chuanjia Liu [Mon, 31 Aug 2020 07:53:12 +0000 (15:53 +0800)]
PCI: mediatek: Release the resource when PCIe enable port fail

On the mt7623 platform, if one port enable fail and other port
enable succeed. It will hang on when using pci enum
because the resource was not released correctly.

Signed-off-by: Chuanjia Liu <Chuanjia.Liu@mediatek.com>
Tested-by: Frank Wunderlich <frank-w@public-files.de>
4 years agoMerge tag 'u-boot-amlogic-20200910' of https://gitlab.denx.de/u-boot/custodians/u...
Tom Rini [Thu, 10 Sep 2020 13:04:02 +0000 (09:04 -0400)]
Merge tag 'u-boot-amlogic-20200910' of https://gitlab.denx.de/u-boot/custodians/u-boot-amlogic

- enables HDMI output & USB keyboard for Odroid-N2
- setups HDMI output background & enables USB keyboard

4 years agoconfigs: odroid-c4: update for HDMI output background & USB keyboard
Anand Moon [Fri, 14 Aug 2020 06:25:15 +0000 (06:25 +0000)]
configs: odroid-c4: update for HDMI output background & USB keyboard

Enable options SYS_WHITE_ON_BLACK to permit HDMI background
screen from white to back, also enable USB_KEYBOARD.

Signed-off-by: Anand Moon <linux.amoon@gmail.com>
Acked-by: Neil Armstrong <narmstrong@baylibre.com>
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
4 years agoconfigs: odroid-n2: update for HDMI output & USB keyboard
Anand Moon [Fri, 14 Aug 2020 06:25:14 +0000 (06:25 +0000)]
configs: odroid-n2: update for HDMI output & USB keyboard

Enable options to permit HDMI output on Odroid-N2 G12B boards.
Enable VPU Power Domain.
Enable USB_KEYBOARD.

Signed-off-by: Anand Moon <linux.amoon@gmail.com>
Acked-by: Neil Armstrong <narmstrong@baylibre.com>
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
4 years agoMerge tag 'u-boot-stm32-20200909' of https://gitlab.denx.de/u-boot/custodians/u-boot-stm
Tom Rini [Wed, 9 Sep 2020 16:59:02 +0000 (12:59 -0400)]
Merge tag 'u-boot-stm32-20200909' of https://gitlab.denx.de/u-boot/custodians/u-boot-stm

- fixes on AV96 board: pull up on UART4 RX and adjust PLL4

4 years agoARM: dts: stm32: Adjust PLL4 settings on AV96 again
Marek Vasut [Sat, 22 Aug 2020 20:45:25 +0000 (22:45 +0200)]
ARM: dts: stm32: Adjust PLL4 settings on AV96 again

PLL4Q is supplying both FDCAN and LTDC. In case HDMI is in use, the
50 MHz generated from PLL4Q cannot be divided well enough to produce
accurate clock for HDMI pixel clock. Adjust it to generate 74.25 MHz
instead. The PLL4P/PLL4R are generating 99 MHz instead of 100 MHz,
which is in tolerance for the SDMMC.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Gerald Baeza <gerald.baeza@st.com>
Cc: Patrick Delaunay <patrick.delaunay@st.com>
Cc: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Patrick Delaunay <patrick.delaunay@st.com>
4 years agoARM: dts: stm32: Pull UART4 RX high on AV96
Marek Vasut [Sat, 22 Aug 2020 20:45:36 +0000 (22:45 +0200)]
ARM: dts: stm32: Pull UART4 RX high on AV96

There is no dedicated pull resistor on the AV96 UART4 (console UART)
pin. In case there is no UART adapter installed on the AV96, the line
is floating and can trigger reception of garbage characters, which in
turn can abort U-Boot autoboot. Add default pull up to mitigate this
problem.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Patrick Delaunay <patrick.delaunay@st.com>
Cc: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Patrick Delaunay <patrick.delaunay@st.com>
4 years agoarm: stm32mp: cleanup test on eth_env_set_enetaddr result
Patrick Delaunay [Tue, 7 Apr 2020 14:07:46 +0000 (16:07 +0200)]
arm: stm32mp: cleanup test on eth_env_set_enetaddr result

Remove the unnecessary inversion on the eth_env_set_enetaddr() result which
only make complex the code of setup_mac_address() and display an invalid
value in the associated pr_err.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Marek Vasut <marex@denx.de>
4 years agoMerge tag 'rpi-next-2020.10.2' of https://gitlab.denx.de/u-boot/custodians/u-boot...
Tom Rini [Wed, 9 Sep 2020 12:17:53 +0000 (08:17 -0400)]
Merge tag 'rpi-next-2020.10.2' of https://gitlab.denx.de/u-boot/custodians/u-boot-raspberrypi

- fixes for bcmgenet
- enable USB keyboard for RPi4 32 bit

4 years agoconfig: Enable USB Keyboard suuport on RPi4 32 bit
Matthias Brugger [Sun, 12 Jul 2020 17:40:28 +0000 (19:40 +0200)]
config: Enable USB Keyboard suuport on RPi4 32 bit

Supporting USB keyboards out of the box is both handy for development
and production. Notably if u-boot is used to boot into GRUB. This patch
adds USB keyboard support for 32 bit RPi4 config.

Signed-off-by: Matthias Brugger <mbrugger@suse.com>
4 years agobcmgenet: Add support for rgmii-rxid
Jason Wessel [Fri, 17 Jul 2020 13:32:00 +0000 (06:32 -0700)]
bcmgenet: Add support for rgmii-rxid

The commit 57805f2270c4 ("net: bcmgenet: Don't set ID_MODE_DIS when
not using RGMII") needed to be extended for the case of using the
rgmii-rxid.  The latest version of the Rasbperry Pi4 dtb files for the
5.4 now specify the rgmii-rxid.

Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
Tested-by: Petr Tesarik <ptesarik@suse.com>
Signed-off-by: Matthias Brugger <mbrugger@suse.com>
4 years agobcmgenet: fix DMA buffer management
Jason Wessel [Fri, 17 Jul 2020 13:31:59 +0000 (06:31 -0700)]
bcmgenet: fix DMA buffer management

This commit fixes a serious issue occurring when several network
commands are run on a raspberry pi 4 board: for instance a "dhcp"
command and then one or several "tftp" commands. In this case,
packet recv callbacks were called several times on the same packets,
and send function was failing most of the time.

note: if the boot procedure is made of a single network
command, the issue is not visible.

The issue is related to management of the packet ring buffers
(producer / consumer) and DMA.
Each time a packet is received, the ethernet device stores it
in the buffer and increments an index called RDMA_PROD_INDEX.
Each time the driver outputs a received packet, it increments
another index called RDMA_CONS_INDEX.

Between each pair of network commands, as part of the driver
'start' function, previous code tried to reset both RDMA_CONS_INDEX
and RDMA_PROD_INDEX to 0. But RDMA_PROD_INDEX cannot be written from
driver side, thus its value was actually not updated, and only
RDMA_CONS_INDEX was reset to 0. This was resulting in a major
synchronization issue between the driver and the device. Most
visible behavior was that the driver seemed to receive again the
packets from the previous commands (e.g. DHCP response packets
"received" again when performing the first TFTP command).

This fix consists in setting RDMA_CONS_INDEX to the same
value as RDMA_PROD_INDEX, when resetting the driver.

The same kind of fix was needed on the TX side, and a few variables
had to be reset accordingly (c_index, tx_index, rx_index).

The rx_index and tx_index have only 256 entries so the bottom 8 bits
must be masked off.

Originated-by: Etienne Dublé <etienne.duble@imag.fr>
Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
Tested-by: Petr Tesarik <ptesarik@suse.com>
Signed-off-by: Matthias Brugger <mbrugger@suse.com>
4 years agoPrepare v2020.10-rc4
Tom Rini [Mon, 7 Sep 2020 18:17:33 +0000 (14:17 -0400)]
Prepare v2020.10-rc4

Signed-off-by: Tom Rini <trini@konsulko.com>
4 years agoconfigs: Resync with savedefconfig
Tom Rini [Mon, 7 Sep 2020 18:05:55 +0000 (14:05 -0400)]
configs: Resync with savedefconfig

Rsync all defconfig files using moveconfig.py

Signed-off-by: Tom Rini <trini@konsulko.com>
4 years agoMerge tag 'efi-2020-10-rc4' of https://gitlab.denx.de/u-boot/custodians/u-boot-efi
Tom Rini [Mon, 7 Sep 2020 12:49:50 +0000 (08:49 -0400)]
Merge tag 'efi-2020-10-rc4' of https://gitlab.denx.de/u-boot/custodians/u-boot-efi

Pull request for UEFI sub-system for efi-2020-10-rc4

Bug fixes are provided in the following areas:

* convert file system debug and print messages go log messages
* convert UEFI booting messages to log messages
* UEFI related code clean up and simplification

4 years agoefi_selftest: simplify Makefile
Heinrich Schuchardt [Fri, 28 Aug 2020 06:15:37 +0000 (08:15 +0200)]
efi_selftest: simplify Makefile

CONFIG_EFI_LOADER cannot be selected for ARMv7-M CPUs. So don't check it in
the Makefile.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
4 years agoefi_loader: remove duplicate image size check
Heinrich Schuchardt [Thu, 27 Aug 2020 15:54:53 +0000 (17:54 +0200)]
efi_loader: remove duplicate image size check

The image size is checked in efi_load_pe(). Avoid checking it twice.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
4 years agoefi: clean up efi command
Heinrich Schuchardt [Thu, 27 Aug 2020 10:39:03 +0000 (12:39 +0200)]
efi: clean up efi command

* Eliminate superfluous enum value EFI_TABLE_END.
* Use correct variable type for the memory type.
* Check validity of memory type.
* Make efi_build_mem_table static.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
4 years agoefi_loader: error message if image not authenticated
Heinrich Schuchardt [Thu, 27 Aug 2020 15:51:32 +0000 (17:51 +0200)]
efi_loader: error message if image not authenticated

Currently if the bootefi command fails due to missing authentication, the
user gets no feedback.

Write a log message 'Image not authenticated' if LoadImage() fails due to
missing authentication.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
4 years agoefi_loader: log function in image loader
Heinrich Schuchardt [Tue, 25 Aug 2020 17:51:20 +0000 (17:51 +0000)]
efi_loader: log function in image loader

Use log_err() for error messages.
Replace debug() by EFI_PRINT().

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
4 years agoefi_loader: log messages for bootefi command
Heinrich Schuchardt [Tue, 25 Aug 2020 17:54:05 +0000 (17:54 +0000)]
efi_loader: log messages for bootefi command

Write log messages when booting via the bootefi command to allow tracking
on the syslog server. Example messages are

    Booting /snp.efi

or

    Booting /MemoryMapped(0x0,0x4fe00000,0x35a40)
    Loading image failed

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
4 years agofs: convert error and debug messages to log
Heinrich Schuchardt [Tue, 25 Aug 2020 17:49:16 +0000 (17:49 +0000)]
fs: convert error and debug messages to log

Use log functions for error and debug messages of the file-system.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
4 years agoMerge https://gitlab.denx.de/u-boot/custodians/u-boot-marvell
Tom Rini [Fri, 4 Sep 2020 14:09:14 +0000 (10:09 -0400)]
Merge https://gitlab.denx.de/u-boot/custodians/u-boot-marvell

- Fix SATA issue on Armada 3720
- Enable more SPI NOR chips in espressobin defconfig

4 years agodefconfig: espressobin: Add support for ISSI SPI flashes
Konstantin Porotchkin [Mon, 31 Aug 2020 06:48:05 +0000 (08:48 +0200)]
defconfig: espressobin: Add support for ISSI SPI flashes

Enable support of ISSI SPI flashes found on EspressoBIN boards

Change-Id: I6de61c48f108fb4f410f321b9db45887d23212e5
Signed-off-by: Konstantin Porotchkin <kostap@marvell.com>
Reviewed-on: http://vgitil04.il.marvell.com:8080/61455
Tested-by: iSoC Platform CI <ykjenk@marvell.com>
Reviewed-by: Grzegorz Jaszczyk <jaz@semihalf.com>
Reviewed-by: Stefan Chulski <stefanc@marvell.com>
Reviewed-by: Stefan Roese <sr@denx.de>
4 years agodefconfig: espressobin: Include support for Gigadevice SPI
Konstantin Porotchkin [Mon, 31 Aug 2020 06:48:04 +0000 (08:48 +0200)]
defconfig: espressobin: Include support for Gigadevice SPI

Include support for CONFIG_SPI_FLASH_GIGADEVICE for supporting
newly produces EspressoBin boards (v7)

Change-Id: I5d4b972cbe2ee5a9d52ce9908794ad4e1b59ee3b
Signed-off-by: Konstantin Porotchkin <kostap@marvell.com>
Reviewed-on: http://vgitil04.il.marvell.com:8080/61236
Tested-by: iSoC Platform CI <ykjenk@marvell.com>
Reviewed-by: Igal Liberman <igall@marvell.com>
Reviewed-by: Stefan Roese <sr@denx.de>
4 years agophy: marvell: a3700: add sata comphy on lane 2 with invert option
zachary [Fri, 28 Aug 2020 14:56:29 +0000 (16:56 +0200)]
phy: marvell: a3700: add sata comphy on lane 2 with invert option

- This patch moves sata phy powerup from dedicate phy to compphy
  and adds invert option for sata powerup routine.

Change-Id: I1b4e8753e2b2c14c6efa97bca2ffc7d2553d8a90
Signed-off-by: zachary <zhangzg@marvell.com>
Signed-off-by: Ken Ma <make@marvell.com>
Reviewed-on: http://vgitil04.il.marvell.com:8080/53601
Reviewed-by: Igal Liberman <igall@marvell.com>
Tested-by: Igal Liberman <igall@marvell.com>
[a.heider: adapt to mainline]
Signed-off-by: Andre Heider <a.heider@gmail.com>
Tested-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Stefan Roese <sr@denx.de>
4 years agoMerge branch 'master' of git://git.denx.de/u-boot-usb
Tom Rini [Thu, 3 Sep 2020 13:48:28 +0000 (09:48 -0400)]
Merge branch 'master' of git://git.denx.de/u-boot-usb

- Mostly DFU fixes and r8152 fixes

4 years agoMerge branch 'master' of git://git.denx.de/u-boot-sh
Tom Rini [Thu, 3 Sep 2020 13:00:35 +0000 (09:00 -0400)]
Merge branch 'master' of git://git.denx.de/u-boot-sh

- SH serial bugfix

4 years agoMerge branch 'for-tom' of https://github.com/lftan/u-boot
Tom Rini [Thu, 3 Sep 2020 12:59:16 +0000 (08:59 -0400)]
Merge branch 'for-tom' of https://github.com/lftan/u-boot

- SoCFPGA bugfix

4 years agoarm: socfpga: soc64: Check FPGA Config status register before bridge reset
Chee Hong Ang [Thu, 6 Aug 2020 03:56:29 +0000 (11:56 +0800)]
arm: socfpga: soc64: Check FPGA Config status register before bridge reset

Instead of querying SDM for FPGA configuration status through mailbox
messages, U-Boot now checks System Manager's FPGA Config status register
for FPGA configuration status before resetting bridge.

Signed-off-by: Chee Hong Ang <chee.hong.ang@intel.com>
Reviewed-by: Ley Foon Tan <ley.foon.tan@intel.com>
4 years agoAzure/GitLab: Update to latest Docker container
Tom Rini [Wed, 2 Sep 2020 13:22:29 +0000 (09:22 -0400)]
Azure/GitLab: Update to latest Docker container

- New base snapshot
- Fix for high UID/GID numbers on a toolchain

Signed-off-by: Tom Rini <trini@konsulko.com>
4 years agoMerge https://gitlab.denx.de/u-boot/custodians/u-boot-x86
Tom Rini [Tue, 1 Sep 2020 15:02:54 +0000 (11:02 -0400)]
Merge https://gitlab.denx.de/u-boot/custodians/u-boot-x86

- Fix parsing of "mtrr list" command
- Introduce USE_EARLY_BOARD_INIT option and remove dead codes for most
  x86 boards

4 years agofastboot: getvar: fix partition-size return value
Gary Bisson [Thu, 27 Aug 2020 08:51:14 +0000 (10:51 +0200)]
fastboot: getvar: fix partition-size return value

The size returned by 'getvar partition-size' should be in bytes, not in
blocks as fastboot uses that value to generate empty partition when
running format [1].

Note that the function was already returning the proper size in bytes
for NAND devices (see struct part_info details).

[1]
https://android.googlesource.com/platform/system/core/+/refs/heads/android10-release/fastboot/fastboot.cpp#1500

Signed-off-by: Gary Bisson <gary.bisson@boundarydevices.com>
4 years agofastboot: Fix fastboot reboot fail by changing functions order
yurii.pidhornyi [Thu, 20 Aug 2020 15:41:18 +0000 (18:41 +0300)]
fastboot: Fix fastboot reboot fail by changing functions order

It was revealed that when the fastboot_tx_write_str function is called
without the previously initialized fastboot_func->in_req->complete field,
a copy of in_req will be sent to the I/O requests queue without
an initialized field.

Moving a piece of code with the initializing of the
fastboot_func->in_req->complete field above transmit_tx allows to solve
this problem.

Fixes: 65c96757fe9 "usb: fastboot: Convert USB f_fastboot to shared fastboot"
Signed-off-by: yurii.pidhornyi <yurii.pidhornyi@globallogic.com>
4 years agof_sdp: Change bInterval of interrupt endpoint to 3
Sherry Sun [Tue, 18 Aug 2020 10:16:49 +0000 (18:16 +0800)]
f_sdp: Change bInterval of interrupt endpoint to 3

Since the USB HID limits the maximum bandwidth(3072) for interrupt
endpoint transfers, when the bInterval set to 1, we can only support 3
boards to run sdp at the same time. In order to support more boards,
change the bInterval of interrupt endpoint to 3, which will not affect
the transmission speed.

Reviewed-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Sherry Sun <sherry.sun@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
4 years agof_sdp: Add EP1_OUT as default data receive pipe in sdp
Sherry Sun [Tue, 18 Aug 2020 10:16:48 +0000 (18:16 +0800)]
f_sdp: Add EP1_OUT as default data receive pipe in sdp

EP0 has been used to transfer file data in sdp before, but the max
packetsize of ep0 is 64 bytes. So in order to improve the file transfer
speed, here add the EP1_OUT interrupt endpoint which max packetsize is
set to 1024 byte.

After testing, it turns out that using ep1out is twice as fast as using
ep0 while receiving data in sdp.

Signed-off-by: Sherry Sun <sherry.sun@nxp.com>
Reviewed-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
4 years agospl: add g_dnl_get_board_bcd_device_number
Peng Fan [Tue, 18 Aug 2020 10:16:47 +0000 (18:16 +0800)]
spl: add g_dnl_get_board_bcd_device_number

Add g_dnl_get_board_bcd_device_number, the new BCD value is used by uuu to distinguish
if the SPL supports the SDPV.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Lukasz Majewski <lukma@denx.de>
4 years agof_sdp: Support searching and loading FIT or container image
Peng Fan [Tue, 18 Aug 2020 10:16:46 +0000 (18:16 +0800)]
f_sdp: Support searching and loading FIT or container image

Add support to f_sdp to search and load iMX8 container image or iMX8M
FIT image by new UUU command SDPV.

When using the SDPV, the uuu will continue to send out data after first
level boot loader used by ROM. This means uuu won't skip to the offset
of the second boot loader, and the padding data before second boot loader
will be sent out. So we have to search the FIT header or container header
in the buffer that SDP received.

Also change to more common method to exit f_sdp handler not depending on
SPL_FIT_FOUND flag because container loader won't set this.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
4 years agof_sdp: Fix wrong usb request size
Ye Li [Tue, 18 Aug 2020 10:16:45 +0000 (18:16 +0800)]
f_sdp: Fix wrong usb request size

Because the buffer length of sdp usb request is 65, we have to allocate
65 bytes not 64 bytes. Otherwise there is potential buffer overflow.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Lukasz Majewski <lukma@denx.de>
4 years agof_sdp: Add high speed endpoint descriptor
Ye Li [Tue, 18 Aug 2020 10:16:44 +0000 (18:16 +0800)]
f_sdp: Add high speed endpoint descriptor

Add HS endpoint descriptor for SDP. So that we can use high speed endpoint,
and the SDP device can send packet with 512 byte size.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Lukasz Majewski <lukma@denx.de>
4 years agosdp: call board_usb_init at spl_sdp_load_image
Frank Li [Tue, 18 Aug 2020 10:16:43 +0000 (18:16 +0800)]
sdp: call board_usb_init at spl_sdp_load_image

Need initialize UDC before run sdp download

Signed-off-by: Frank Li <Frank.Li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
4 years agousb: max3420: add the gadget driver
Jassi Brar [Thu, 30 Jul 2020 01:51:27 +0000 (20:51 -0500)]
usb: max3420: add the gadget driver

MAX3420 implements FullSpeed USB Device over SPI.
Another version MAX3421, also implements USB Host mode.
This driver should be good for the device mode of max3421 as well.

Signed-off-by: Jassi Brar <jaswinder.singh@linaro.org>
4 years agofastboot: Add default fastboot_set_reboot_flag implementation
Roman Kovalivskyi [Tue, 28 Jul 2020 20:35:34 +0000 (23:35 +0300)]
fastboot: Add default fastboot_set_reboot_flag implementation

Default implementation of fastboot_set_reboot_flag function that depends
on "bcb" commands could be used in general case if there are no need to
make any platform-specific implementation, otherwise it could be
disabled via Kconfig option FASTBOOT_USE_BCB_SET_REBOOT_FLAG.

Please note that FASTBOOT_USE_BCB_SET_REBOOT_FLAG is mutually exclusive
with some platforms which already have their own implementation of this
function.

Signed-off-by: Roman Kovalivskyi <roman.kovalivskyi@globallogic.com>
4 years agofastboot: Add support for 'reboot fastboot' command
Roman Kovalivskyi [Tue, 28 Jul 2020 20:35:33 +0000 (23:35 +0300)]
fastboot: Add support for 'reboot fastboot' command

Android 10 adds support for dynamic partitions and in order to support
this userspace fastboot must be used[1]. New tool fastbootd is
included into recovery.

Userspace fastboot works from recovery and is launched if:
1) - Dynamic partitioning is enabled
2) - Boot control block has 'boot-fastboot' value into command field
The bootloader is expected to load and boot into the recovery image
upon seeing boot-fastboot in the BCB command. Recovery then parses the
BCB message and switches to fastbootd mode[2].

Please note that boot script is expected to handle 'boot-fastboot'
command in BCB and load into recovery mode.

Bootloader must support 'reboot fastboot' command which should reboot
device into userspace fastboot to accomodate those changes[3].

Another command that bootloader must support[3] is 'reboot recovery'. This
command should simply reboot device into recovery mode.

[1] - https://source.android.com/devices/bootloader/fastbootd
[2] - https://source.android.com/devices/bootloader/fastbootd#unified_fastboot_and_recovery
[3] - https://source.android.com/devices/bootloader/fastbootd#modifications_to_the_bootloader

Signed-off-by: Roman Kovalivskyi <roman.kovalivskyi@globallogic.com>
Signed-off-by: Roman Stratiienko <r.stratiienko@gmail.com>
Change-Id: I9d2bdc9a6f6f31ea98572fe155e1cc8341e9af76

4 years agofastboot: Extend fastboot_set_reboot_flag with reboot reason
Roman Kovalivskyi [Tue, 28 Jul 2020 20:35:32 +0000 (23:35 +0300)]
fastboot: Extend fastboot_set_reboot_flag with reboot reason

Extend fastboot_set_reboot_flag arguments with reboot reason so that
it could handle different reboot cases in future.

Signed-off-by: Roman Kovalivskyi <roman.kovalivskyi@globallogic.com>
4 years agodfu: fix dfu tftp on sandbox
Heinrich Schuchardt [Wed, 22 Jul 2020 15:46:02 +0000 (17:46 +0200)]
dfu: fix dfu tftp on sandbox

The environment variable loadaddr is in the virtual address space of the
sandbox. To get the actual memory address where the FIT image has been
loaded we have to convert this address according to the memory mapping of
the sandbox.

Equally the addresses in the *.its file have to be converted when used in
the dfu_ram driver.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
4 years agoconfigs: qemu: enable dfu testing
Heinrich Schuchardt [Tue, 21 Jul 2020 18:07:48 +0000 (20:07 +0200)]
configs: qemu: enable dfu testing

For testing automated updates via dfu and mtd we need the dfu and mtd
commands as well as preboot support.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
4 years agodfu: DFU_MTD depends on CMD_MTDPARTS
Heinrich Schuchardt [Tue, 21 Jul 2020 18:06:31 +0000 (20:06 +0200)]
dfu: DFU_MTD depends on CMD_MTDPARTS

Function mtdparts_init() is needed for the DFU MTD driver.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
4 years agodfu: fix typo parameteres
Heinrich Schuchardt [Fri, 17 Jul 2020 17:55:54 +0000 (19:55 +0200)]
dfu: fix typo parameteres

%s/parameteres/parameters/g

Even if a line exceeds 80 characters we should not split output strings
to make debugging easier.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
4 years agofastboot: Support defining raw partitions without a partition table
Filip Brozovic [Mon, 29 Jun 2020 11:14:37 +0000 (13:14 +0200)]
fastboot: Support defining raw partitions without a partition table

Add support for defining raw fastboot partitions in eMMC by specifying
the offset and size in an environment variable. Optionally, the eMMC
hardware partition number may also be specified.

This makes it possible to e.g. update only part of the eMMC boot
partition, instead of having to write the entire partition.

Signed-off-by: Filip Brozovic <fbrozovic@gmail.com>
4 years agousb: ci_udc: Add function to remove usb device
Ye Li [Mon, 29 Jun 2020 02:12:59 +0000 (10:12 +0800)]
usb: ci_udc: Add function to remove usb device

When unregister gadget driver in ci_udc, the usb device is not
removed or stop. This causes next "usb start" fails to work.

Add a new interface "usb_remove_ehci_gadget" in usb-uclass to
remove the usb device for DM driver. Using "usb_lowlevel_stop" for
non-DM driver.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
4 years agousb: gadget: Fix controller index in UMS
Ye Li [Mon, 29 Jun 2020 02:12:26 +0000 (10:12 +0800)]
usb: gadget: Fix controller index in UMS

The usb mass storage (f_mass_storage.c) uses fixed usb index 0,
this causes problem while CDNS3 USB controller index is 1.
Modify the API of fsg to pass the controller index.

Reviewed-by: Jun Li <jun.li@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
4 years agoeth/r8152: support RTL8153B/RTL8154B
Hayes Wang [Tue, 16 Jun 2020 09:09:47 +0000 (17:09 +0800)]
eth/r8152: support RTL8153B/RTL8154B

This is used to support RTL8153B and RTL8154B.

Signed-off-by: Hayes Wang <hayeswang@realtek.com>
4 years agoeth/r8152: modify rtl_clear_bp function
Hayes Wang [Tue, 16 Jun 2020 09:09:46 +0000 (17:09 +0800)]
eth/r8152: modify rtl_clear_bp function

The original rtl_clear_bp() is used to clear the firmware of both
PLA and USB MCU. The new one could clear the firmware of PLA or
USB independently. It is unnecessary to clear firmware, if there
is no one to be updated.

Besides, clear the firmware by writing the relative registers in
bulk.

Signed-off-by: Hayes Wang <hayeswang@realtek.com>
4 years agoeth/r8152: reset PHY after setting it
Hayes Wang [Tue, 16 Jun 2020 09:09:45 +0000 (17:09 +0800)]
eth/r8152: reset PHY after setting it

Some settings of PHY have to work after resetting PHY.

Signed-off-by: Hayes Wang <hayeswang@realtek.com>
4 years agoeth/r8152: reset bmu after disabling Tx/Rx
Hayes Wang [Tue, 16 Jun 2020 09:09:44 +0000 (17:09 +0800)]
eth/r8152: reset bmu after disabling Tx/Rx

Reset bmu after disabling Tx/Rx. This is used to clear the FIFO of
Tx/Rx. The remained data may be transferred after Tx/Rx is re-enabled.
And it results in garbage data.

Signed-off-by: Hayes Wang <hayeswang@realtek.com>
4 years agoserial: sh: Improve FIFO empty check on RX
Marek Vasut [Sat, 9 May 2020 20:30:05 +0000 (22:30 +0200)]
serial: sh: Improve FIFO empty check on RX

If the SCIF is receiving data quickly enough, it may happen that the
SCxSR_RDxF flag is cleared in sh_serial_getc_generic(), while the
FIFO still contains data. If that happens, the serial_getc_check()
reports no data in the FIFO as the flag is no longer set. Add one
more check, if the SCxSR_RDxF is not set, read out the FIFO level
and if there are still characters in the FIFO, permit reading them
out.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
4 years agox86: Drop nhlt_serialise()
Simon Glass [Sat, 29 Aug 2020 21:23:07 +0000 (15:23 -0600)]
x86: Drop nhlt_serialise()

This function is not actually used in U-Boot. Drop it.

Suggested-by: Bin Meng <bmeng.cn@gmail.com>
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
4 years agox86: pinctrl: Fix 'relatove' typo
Simon Glass [Sat, 29 Aug 2020 21:23:06 +0000 (15:23 -0600)]
x86: pinctrl: Fix 'relatove' typo

Fix this typo in the Kconfig help.

Suggested-by: Wolfgang Wallner <wolfgang.wallner@br-automation.com>
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
4 years agox86: qemu: Remove dead code
Andy Shevchenko [Tue, 1 Sep 2020 08:33:52 +0000 (11:33 +0300)]
x86: qemu: Remove dead code

start.S does nothing and can be safely removed. Makefile is still being used
by the build system, so simply replace the rule in it. We use stub C-file
like it's done for other boards.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
4 years agox86: intel: slimbootloader: Remove dead code
Andy Shevchenko [Thu, 20 Aug 2020 10:02:33 +0000 (13:02 +0300)]
x86: intel: slimbootloader: Remove dead code

start.S does nothing and can be safely removed. Makefile is still being used
by the build system, so simply drop the rule from it.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Aiden Park <aiden.park@intel.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
4 years agox86: intel: minnowmax: Remove dead code
Andy Shevchenko [Thu, 20 Aug 2020 10:02:32 +0000 (13:02 +0300)]
x86: intel: minnowmax: Remove dead code

start.S does nothing and can be safely removed. Makefile is still being used
by the build system, so simply drop the rule from it.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
4 years agox86: intel: galileo: Remove dead code
Andy Shevchenko [Thu, 20 Aug 2020 10:02:31 +0000 (13:02 +0300)]
x86: intel: galileo: Remove dead code

start.S does nothing and can be safely removed. Makefile is still being used
by the build system, so simply drop the rule from it.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
4 years agox86: intel: edison: Remove dead code
Andy Shevchenko [Thu, 20 Aug 2020 10:02:30 +0000 (13:02 +0300)]
x86: intel: edison: Remove dead code

start.S does nothing and can be safely removed. Makefile is still being used
by the build system, so simply drop the rule from it.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
4 years agox86: intel: crownbay: Remove dead code
Andy Shevchenko [Thu, 20 Aug 2020 10:02:29 +0000 (13:02 +0300)]
x86: intel: crownbay: Remove dead code

start.S does nothing and can be safely removed. Makefile is still being used
by the build system, so simply drop the rule from it.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
4 years agox86: intel: cougarcanyon2: Remove dead code
Andy Shevchenko [Thu, 20 Aug 2020 10:02:28 +0000 (13:02 +0300)]
x86: intel: cougarcanyon2: Remove dead code

start.S does nothing and can be safely removed. Makefile is still being used
by the build system, so simply drop the rule from it.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
4 years agox86: intel: cherryhill: Remove dead code
Andy Shevchenko [Thu, 20 Aug 2020 10:02:27 +0000 (13:02 +0300)]
x86: intel: cherryhill: Remove dead code

start.S does nothing and can be safely removed. Makefile is still being used
by the build system, so simply drop the rule from it.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
4 years agox86: intel: bayleybay: Remove dead code
Andy Shevchenko [Thu, 20 Aug 2020 10:02:26 +0000 (13:02 +0300)]
x86: intel: bayleybay: Remove dead code

start.S does nothing and can be safely removed. Makefile is still being used
by the build system, so simply drop the rule from it.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
4 years agox86: efi: efi-x86_payload: Remove dead code
Andy Shevchenko [Thu, 20 Aug 2020 10:02:25 +0000 (13:02 +0300)]
x86: efi: efi-x86_payload: Remove dead code

start.S does nothing and can be safely removed. Makefile is still being used
by the build system, so simply drop the rule from it.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
4 years agox86: dfi: dfi-bt700: Remove dead code
Andy Shevchenko [Thu, 20 Aug 2020 10:02:24 +0000 (13:02 +0300)]
x86: dfi: dfi-bt700: Remove dead code

start.S does nothing and can be safely removed. Makefile is still being used
by the build system, so simply drop the rule from it.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Stefan Roese <sr@denx.de>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
4 years agox86: coreboot: Remove dead code
Andy Shevchenko [Thu, 20 Aug 2020 10:02:23 +0000 (13:02 +0300)]
x86: coreboot: Remove dead code

start.S does nothing and can be safely removed. Makefile is still being used
by the build system, so simply drop the rule from it.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
4 years agox86: congatec: conga-qeval20-qa3-e3845: Remove dead code
Andy Shevchenko [Thu, 20 Aug 2020 10:02:22 +0000 (13:02 +0300)]
x86: congatec: conga-qeval20-qa3-e3845: Remove dead code

start.S does nothing and can be safely removed. Makefile is still being used
by the build system, so simply drop the rule from it.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Stefan Roese <sr@denx.de>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
4 years agox86: advantech: som-db5800-som-6867: Remove dead code
Andy Shevchenko [Thu, 20 Aug 2020 10:02:21 +0000 (13:02 +0300)]
x86: advantech: som-db5800-som-6867: Remove dead code

start.S does nothing and can be safely removed. Makefile is still being used
by the build system, so simply drop the rule from it.

Cc: George McCollister <george.mccollister@gmail.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
4 years agox86: Introduce USE_EARLY_BOARD_INIT option
Andy Shevchenko [Thu, 20 Aug 2020 10:02:20 +0000 (13:02 +0300)]
x86: Introduce USE_EARLY_BOARD_INIT option

Introduce USE_EARLY_BOARD_INIT option and select it by the actual users.

Cc: George McCollister <george.mccollister@gmail.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Stefan Roese <sr@denx.de>
Reviewed-by: Aiden Park <aiden.park@intel.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
4 years agox86: mtrr: Fix parsing of "mtrr list" command
Wolfgang Wallner [Fri, 14 Aug 2020 07:55:24 +0000 (09:55 +0200)]
x86: mtrr: Fix parsing of "mtrr list" command

The command 'mtrr' does not recognize the 'list' subcommand any more
since the code restructuring in commit b2a76b3fe75a ("x86: mtrr:
Restructure so command execution is in one place").

The if-else parsing the command arguments does not take 'list' into
account: the if-branch is intended for no subcommands, the else-branch
is intended for the non-list subcommands (which all expect additional
arguments). Calling the 'mtrr list' subcommand leads to a "return
CMD_RET_USAGE" in the else-branch.

Fix this by changing the else-branch to explicitly checking for
if (cmd != 'l').

Fixes: b2a76b3fe75a ("x86: mtrr: Restructure so command execution is in one place")
Signed-off-by: Wolfgang Wallner <wolfgang.wallner@br-automation.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tested-by: Bin Meng <bmeng.cn@gmail.com>
4 years agoMAINTAINERS: step down as maintainer of UniPhier SoCs
Masahiro Yamada [Mon, 31 Aug 2020 14:52:03 +0000 (23:52 +0900)]
MAINTAINERS: step down as maintainer of UniPhier SoCs

I am leaving Socionext. Orphan the UniPhier platform until somebody
takes the role.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
4 years agoMerge tag 'ti-v2020.10-rc4' of https://gitlab.denx.de/u-boot/custodians/u-boot-ti
Tom Rini [Mon, 31 Aug 2020 17:06:26 +0000 (13:06 -0400)]
Merge tag 'ti-v2020.10-rc4' of https://gitlab.denx.de/u-boot/custodians/u-boot-ti

- Update to ABI 3.0
- Fix i2c write in eeprom driver

4 years agoMerge https://gitlab.denx.de/u-boot/custodians/u-boot-marvell
Tom Rini [Mon, 31 Aug 2020 13:43:13 +0000 (09:43 -0400)]
Merge https://gitlab.denx.de/u-boot/custodians/u-boot-marvell

- MVEBU Espressobin fixes and enhancements (fix switch security
  issue, enable MVNETA, enable SD-card, fix COMPHY nodes, default
  env variables, etc)
- MMC Xenon: Set signal voltage and max base clock
- a37xx PCI driver: Depend on DM_GPIO and remove #ifdef's

4 years agoarm: mvebu: Espressobin: Update README.marvell file
Pali Rohár [Thu, 27 Aug 2020 13:01:28 +0000 (15:01 +0200)]
arm: mvebu: Espressobin: Update README.marvell file

Include information about permanent ethernet MAC address and add link how
to build ATF as U-Boot on Espressobin cannot be flashed without ATF.

Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Stefan Roese <sr@denx.de>
4 years agoarm: mvebu: Espressobin: Define fdt_addr and kernel_addr env aliases
Pali Rohár [Thu, 27 Aug 2020 13:01:27 +0000 (15:01 +0200)]
arm: mvebu: Espressobin: Define fdt_addr and kernel_addr env aliases

Boot scripts for existing Espressobin Linux distributions, like OpenWRT,
expect that U-Boot set fdt_addr and kernel_addr envs. So add env aliases
from fdt_addr_r and kernel_addr_r values.

Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Stefan Roese <sr@denx.de>
Tested-by: Andre Heider <a.heider@gmail.com>
4 years agoarm: mvebu: Espressobin: Change default loadaddr
Pali Rohár [Thu, 27 Aug 2020 13:01:26 +0000 (15:01 +0200)]
arm: mvebu: Espressobin: Change default loadaddr

Current loadaddr is not writable on Espressobin and 'loadb' command cause
rebooting board. Marvell's U-Boot already set default loadaddr to value
0x06000000 [1] and after this change 'loadb' is working fine.

[1] - https://github.com/MarvellEmbeddedProcessors/u-boot-marvell/commit/0a5b159806baa0746b6449920e450498bc269ba7

Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Stefan Roese <sr@denx.de>
Tested-by: Andre Heider <a.heider@gmail.com>
4 years agoarm: mvebu: Espressobin: Move env load addresses
Pali Rohár [Thu, 27 Aug 2020 13:01:25 +0000 (15:01 +0200)]
arm: mvebu: Espressobin: Move env load addresses

According to Marvell's U-Boot description [1] current env load addresses
overlaps with ATF RT services region and TEE. Because the ATF RT service
and TEE region is going to be marked as secure and can't be overwritten,
use different different addresses for envs.

[1] - https://github.com/MarvellEmbeddedProcessors/u-boot-marvell/commit/0a5b159806baa0746b6449920e450498bc269ba7

Signed-off-by: Pali Rohár <pali@kernel.org>
Tested-by: Andre Heider <a.heider@gmail.com>
Reviewed-by: Stefan Roese <sr@denx.de>
4 years agoarm64: a37xx: pci: Depends on DM_GPIO
Pali Rohár [Tue, 25 Aug 2020 08:45:04 +0000 (10:45 +0200)]
arm64: a37xx: pci: Depends on DM_GPIO

For proper initialization of aardvark pci driver it is required to
de-assert reset GPIO. So depeneds on DM_GPIO option.

Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Stefan Roese <sr@denx.de>
Tested-by: Andre Heider <a.heider@gmail.com>
4 years agoarm: mvebu: Espressobin: Setup MTD partitions when booting kernel
Pali Rohár [Wed, 19 Aug 2020 14:24:17 +0000 (16:24 +0200)]
arm: mvebu: Espressobin: Setup MTD partitions when booting kernel

Due to different partition layouts in different U-Boot versions, DTS for
Espressobin in Linux does not contain any definition of MTD partitions.
See commit https://git.kernel.org/stable/c/00954566464a4 for more details.

This patch via ft_board_setup() hook fills current partition layout used by
U-Boot, so booted kernel would see correct MTD partitions layout.

U-Boot env partition is calculated from CONFIG_ENV_OFFSET option.

First partition contains secure firmware, ARM trusted firmware and U-Boot
with checksums. So it is not possible to replace just one image (e.g.
U-Boot) without updating other parts where is stored checksum of U-Boot.
Therefore there is no extra partition defined for U-Boot and first
partition is called just 'firmware'.

Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Konstantin Porotchkin <kostap@marvell.com>
Tested-by: Andre Heider <a.heider@gmail.com>
4 years agoarm: mvebu: Espressobin: Make SPI env offset compatible with Marvell's U-Boot
Pali Rohár [Wed, 19 Aug 2020 14:24:16 +0000 (16:24 +0200)]
arm: mvebu: Espressobin: Make SPI env offset compatible with Marvell's U-Boot

Espressobin board comes with Marvell's U-Boot version where U-Boot env is
stored in SPI at offset 0x3F0000. This patch changes env offset in
Espressobin defconfig file to match Marvell's U-Boot version.

Users who want to use previous or different env offset can still change it
in .config file when compiling U-Boot.

Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Konstantin Porotchkin <kostap@marvell.com>
Reviewed-by: Stefan Roese <sr@denx.de>
Tested-by: Andre Heider <a.heider@gmail.com>
4 years agoarm: dts: a37x0: enable sd card support on espressobin
Wilson Ding [Wed, 19 Aug 2020 14:19:40 +0000 (16:19 +0200)]
arm: dts: a37x0: enable sd card support on espressobin

Enabled SDIO slot 0 (south bridge) for SD card on
Espressobin board.

Change-Id: I51a2debf9fba276b9c4a2bc6da91328d47f443e3
Signed-off-by: Wilson Ding <dingwei@marvell.com>
Signed-off-by: Konstantin Porotchkin <kostap@marvell.com>
Reviewed-on: http://vgitil04.il.marvell.com:8080/60945
Tested-by: iSoC Platform CI <ykjenk@marvell.com>
Reviewed-by: Igal Liberman <igall@marvell.com>
[pali: Define cd-gpios and enable CONFIG_DM_REGULATOR_GPIO]
Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Konstantin Porotchkin <kostap@marvell.com>
Reviewed-by: Stefan Roese <sr@denx.de>
Tested-by: Andre Heider <a.heider@gmail.com>
4 years agommc: xenon: set signal voltage and max base clock
Evan Wang [Wed, 19 Aug 2020 14:19:39 +0000 (16:19 +0200)]
mmc: xenon: set signal voltage and max base clock

- The SDIO signal voltage and max base clock frequency
  setting are missing in driver, which causes SDIO
  not working.
- The patch adds SDIO signal voltage switch support,
  which is based on regulator-gpio of vqmmc-supply, and
  sets the max base clock frequency.
- Fix the zero clock value in call to sdhci_setup_cfg()
  function.

Change-Id: I79c8860c65b8db166f4f70db56ede4097f71f1fa
Signed-off-by: Evan Wang <xswang@marvell.com>
Reviewed-on: http://vgitil04.il.marvell.com:8080/53589
Reviewed-by: Hua Jing <jinghua@marvell.com>
Tested-by: Hua Jing <jinghua@marvell.com>
[pali: Amended fixup patch]
Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Konstantin Porotchkin <kostap@marvell.com>
Reviewed-by: Stefan Roese <sr@denx.de>
Tested-by: Andre Heider <a.heider@gmail.com>
4 years agoarm64: a37xx: pci: Assert PERST# signal when unloading driver
Pali Rohár [Wed, 19 Aug 2020 13:57:07 +0000 (15:57 +0200)]
arm64: a37xx: pci: Assert PERST# signal when unloading driver

This change ensures that PCIe card is put into reset state when U-Boot
stops using it.

DM_FLAG_OS_PREPARE ensures that U-Boot executes driver's remove callback
prior booting Linux kernel.

Linux kernel pci-aardvark driver needs to reset PCIe card via PERST# signal
prior initializing it. If it does not issue reset then some PCIe cards
(specially Compex WiFi cards) are not detected at all.

Putting PCIe card into reset state prior booting Linux kernel would ensure
that card would be properly reset at time when Linux kernel starts
initializing pci-aardvark driver.

Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Konstantin Porotchkin <kostap@marvell.com>
Tested-by: Andre Heider <a.heider@gmail.com>
4 years agoarm64: a37xx: pci: Make PCIe Reset GPIO DT compatible with Linux kernel DT
Pali Rohár [Wed, 19 Aug 2020 13:57:06 +0000 (15:57 +0200)]
arm64: a37xx: pci: Make PCIe Reset GPIO DT compatible with Linux kernel DT

Change active-high to active-low and change DT property name from
reset-gpio to reset-gpios. This format of gpio reset is used by
pci-aardvark driver in Linux kernel.

Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Stefan Roese <sr@denx.de>
Reviewed-by: Konstantin Porotchkin <kostap@marvell.com>
Tested-by: Andre Heider <a.heider@gmail.com>
4 years agoarm64: dts: armada-3720-espressobin: fix COMPHY nodes
Marek Behún [Wed, 19 Aug 2020 09:57:25 +0000 (11:57 +0200)]
arm64: dts: armada-3720-espressobin: fix COMPHY nodes

This commit fixes initialization of COMPHY on EspressoBin.

Commit 22f418935be4 ("phy: marvell: a3700: Use comphy_mux on Armada
37xx.") introduced usage of comphy_mux on Armada 37xx comphy driver.
The lanes are defined in comphy_a3700.c as described in functional
specification, that is:
  lane 0 is SGMII1 or USB3
  lane 1 is PCIe or SGMII0
  lane 2 is SATA or USB3

But the DTS for EspressoBin configures PCIe on lane 0 and USB3 on
lane 1, which is wrong in the sense of the specification and doesn't
work with the comphy_mux code, which is 2 years now (the aardvark driver
causes synchronous abort in U-Boot).

It worked till the above mentioned commit, because the code for powering
up PCIe PHY doesn't work with lane number at all, and the code for
powering up USB3 PHY works differently only if USB3 is on lane 2, ie.
the check goes like:
  if (lane == 2)
    something
  else
    something else
so it does not differentiate between lanes 0 and 1.

In the future I shall post patches that remove the comphy_a3700 driver
and add comphy driver which uses calls to ATF, like Linux' driver does.
This will have the advantage of same DTS bindings as Linux', but till
this is done, we need this patch.

Signed-off-by: Marek Behún <marek.behun@nic.cz>
Tested-by: Pali Rohár <pali@kernel.org>
Cc: Stefan Roese <sr@denx.de>
Reviewed-by: Stefan Roese <sr@denx.de>
Tested-by: Andre Heider <a.heider@gmail.com>
4 years agoarm: mvebu: Espressobin: Enable CONFIG_MVNETA
Pali Rohár [Mon, 17 Aug 2020 15:13:19 +0000 (17:13 +0200)]
arm: mvebu: Espressobin: Enable CONFIG_MVNETA

Espressobin uses mvneta ethernet driver.

Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Stefan Roese <sr@denx.de>
Tested-by: Andre Heider <a.heider@gmail.com>