platform/kernel/u-boot.git
3 years agoMerge https://gitlab.denx.de/u-boot/custodians/u-boot-spi into next
Tom Rini [Fri, 19 Jun 2020 20:25:50 +0000 (16:25 -0400)]
Merge https://gitlab.denx.de/u-boot/custodians/u-boot-spi into next

- Convert fsl_espi to driver model (Chuanhua)
- Enable am335x baltos to DM_SPI (Jagan)
- Drop few powerpc board which doesn't have DM enabled (Jagan)

3 years agoMerge tag 'video-next' of https://gitlab.denx.de/u-boot/custodians/u-boot-video into...
Tom Rini [Thu, 18 Jun 2020 20:59:16 +0000 (16:59 -0400)]
Merge tag 'video-next' of https://gitlab.denx.de/u-boot/custodians/u-boot-video into next

- migrate remaining imx5/imx6qd boards to DM_VIDEO
- use 'vidconsole' stdout in nitrogen6x upgrade script
- add option for selection of the vidconsole commands
  lcdputs and setcurs
- allow building ipuv3 driver with disabled CONFIG_PANEL
- make backlight and panel drivers optional
- remove useless code from ipuv3 driver
- extend existing DM_VIDEO work-around for console name
  to support 'vga'
- remove non-DM code in ipuv3

3 years agovideo: ipuv3: remove non-DM code
Anatolij Gustschin [Tue, 26 May 2020 07:38:17 +0000 (09:38 +0200)]
video: ipuv3: remove non-DM code

All ipuv3 users have been converted, drop obsolete code.

Signed-off-by: Anatolij Gustschin <agust@denx.de>
3 years agoimx: convert mx53loco board to DM_VIDEO
Anatolij Gustschin [Mon, 25 May 2020 23:41:37 +0000 (01:41 +0200)]
imx: convert mx53loco board to DM_VIDEO

Migration to DM_VIDEO driver is long overdue. Update defconfig
to enable usage of converted ipuv3 driver DM configuration.

Signed-off-by: Anatolij Gustschin <agust@denx.de>
Cc: Jason Liu <jason.hui.liu@nxp.com>
Acked-by: Jason Liu<jason.hui.liu@nxp.com>
3 years agoimx: convert mx51evk board to DM_VIDEO
Anatolij Gustschin [Mon, 25 May 2020 23:11:06 +0000 (01:11 +0200)]
imx: convert mx51evk board to DM_VIDEO

Migration to DM_VIDEO driver is long overdue. Update defconfig
to enable usage of converted ipuv3 driver DM configuration.

Signed-off-by: Anatolij Gustschin <agust@denx.de>
Cc: Stefano Babic <sbabic@denx.de>
3 years agoimx: convert gwventana board to DM_VIDEO
Anatolij Gustschin [Mon, 25 May 2020 22:58:17 +0000 (00:58 +0200)]
imx: convert gwventana board to DM_VIDEO

Migration to DM_VIDEO driver is long overdue. Update defconfigs
to enable usage of converted ipuv3 driver DM configuration.

Signed-off-by: Anatolij Gustschin <agust@denx.de>
Cc: Tim Harvey <tharvey@gateworks.com>
3 years agoimx: convert mx6cuboxi board to DM_VIDEO
Anatolij Gustschin [Mon, 25 May 2020 22:52:36 +0000 (00:52 +0200)]
imx: convert mx6cuboxi board to DM_VIDEO

Migration to DM_VIDEO driver is long overdue. Update defconfig
to enable usage of converted ipuv3 driver DM configuration.

Signed-off-by: Anatolij Gustschin <agust@denx.de>
Cc: Baruch Siach <baruch@tkos.co.il>
Cc: Fabio Estevam <fabio.estevam@nxp.com>
3 years agoimx: convert cgtqmx6eval board to DM_VIDEO
Anatolij Gustschin [Mon, 25 May 2020 22:47:56 +0000 (00:47 +0200)]
imx: convert cgtqmx6eval board to DM_VIDEO

Migration to DM_VIDEO driver is long overdue. Update defconfig
to enable usage of converted ipuv3 driver DM configuration.

Signed-off-by: Anatolij Gustschin <agust@denx.de>
Cc: Otavio Salvador <otavio@ossystems.com.br>
3 years agoimx: convert dms-ba16 boards to DM_VIDEO
Anatolij Gustschin [Mon, 25 May 2020 22:37:03 +0000 (00:37 +0200)]
imx: convert dms-ba16 boards to DM_VIDEO

Migration to DM_VIDEO driver is long overdue. Update defconfigs
to enable usage of converted ipuv3 driver DM configuration.

Signed-off-by: Anatolij Gustschin <agust@denx.de>
Cc: Akshay Bhat <akshaybhat@timesys.com>
Cc: Ken Lin <Ken.Lin@advantech.com.tw>
3 years agoimx: convert pico-imx6 to DM_VIDEO
Anatolij Gustschin [Mon, 25 May 2020 22:32:59 +0000 (00:32 +0200)]
imx: convert pico-imx6 to DM_VIDEO

Update defconfig to enable usage of converted ipuv3
driver DM configuration.

Signed-off-by: Anatolij Gustschin <agust@denx.de>
Cc: Fabio Estevam <festevam@gmail.com>
3 years agoimx: convert embest boards to DM_VIDEO
Anatolij Gustschin [Mon, 25 May 2020 22:14:09 +0000 (00:14 +0200)]
imx: convert embest boards to DM_VIDEO

Migration to DM_VIDEO driver is long overdue. Update defconfigs
to enable usage of converted ipuv3 driver DM configuration.

Signed-off-by: Anatolij Gustschin <agust@denx.de>
Cc: Eric Bénard <eric@eukrea.com>
3 years agotbs2910: migrate to DM_VIDEO
Anatolij Gustschin [Mon, 25 May 2020 11:12:51 +0000 (13:12 +0200)]
tbs2910: migrate to DM_VIDEO

Migration to DM_VIDEO driver is long overdue, configure it in
board config files. To enable the display set stdout like:

  setenv stdout serial,vidconsole

Signed-off-by: Anatolij Gustschin <agust@denx.de>
Tested-by: Soeren Moch <smoch@web.de>
3 years agovideo: extend stdout video console work-around for 'vga'
Anatolij Gustschin [Sat, 23 May 2020 15:11:20 +0000 (17:11 +0200)]
video: extend stdout video console work-around for 'vga'

cfb_console driver uses 'vga' console name and we still have board
environments defining this name. Re-use existing DM_VIDEO work-
around for console name to support 'vga' name in stdout environment.

Signed-off-by: Anatolij Gustschin <agust@denx.de>
Tested-by: Soeren Moch <smoch@web.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
3 years agovideo: ipuv3: remove some useless code to reduce binary size
Anatolij Gustschin [Mon, 25 May 2020 12:34:17 +0000 (14:34 +0200)]
video: ipuv3: remove some useless code to reduce binary size

To enable DM_VIDEO we must decrease binary size to fix build
breakage for some boards, so drop not needed code. Also add
!DM_VIDEO guards which can be later removed when last non DM
users will be converted.

Signed-off-by: Anatolij Gustschin <agust@denx.de>
3 years agovideo: make backlight and panel drivers optional
Anatolij Gustschin [Mon, 25 May 2020 22:20:49 +0000 (00:20 +0200)]
video: make backlight and panel drivers optional

Not all boards use these drivers, so allow to disable them to fix
building boards with U-Boot binary image size restrictions.

Signed-off-by: Anatolij Gustschin <agust@denx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
3 years agovideo: ipuv3: fix building with disabled panel driver
Anatolij Gustschin [Mon, 25 May 2020 22:09:22 +0000 (00:09 +0200)]
video: ipuv3: fix building with disabled panel driver

Panel code might be disabled for some boards, make this
driver code optional.

Signed-off-by: Anatolij Gustschin <agust@denx.de>
3 years agovideo: make vidconsole commands optional
Anatolij Gustschin [Mon, 25 May 2020 19:47:19 +0000 (21:47 +0200)]
video: make vidconsole commands optional

Converting some boards to DM_VIDEO results in build breakage due
to increased code size. Make video console specific commands
optional to reduce binary size.

Signed-off-by: Anatolij Gustschin <agust@denx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
3 years agonitrogen6x: update video console name
Anatolij Gustschin [Tue, 26 May 2020 10:03:21 +0000 (12:03 +0200)]
nitrogen6x: update video console name

After migration to DM 'vga' name is not longer supported,
Update the upgrade script to use 'vidconsole' instead.

Signed-off-by: Anatolij Gustschin <agust@denx.de>
Cc: Troy Kisky <troy.kisky@boundarydevices.com>
Acked-by: Troy Kisky <troy.kisky@boundarydevices.com>
3 years agoboard: nitrogen6x: migrate to CONFIG_DM_VIDEO
Troy Kisky [Fri, 22 May 2020 17:10:37 +0000 (10:10 -0700)]
board: nitrogen6x: migrate to CONFIG_DM_VIDEO

Enable driver model for Video to remove compiler warning.
To enable display, issue

setenv stdout serial,vidconsole;

Add CONFIG_DM_VIDEO to all defconfigs whose board is
nitrogen6x.
        mx6qsabrelite_defconfig
        nitrogen6dl2g_defconfig
        nitrogen6dl_defconfig
        nitrogen6q2g_defconfig
        nitrogen6q_defconfig
        nitrogen6s1g_defconfig
nitrogen6s_defconfig

Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com>
Tested-by: Anatolij Gustschin <agust@denx.de>
3 years agoam335x: baltos: Enable DM_SPI
Jagan Teki [Wed, 27 May 2020 12:56:17 +0000 (18:26 +0530)]
am335x: baltos: Enable DM_SPI

Enable DM_SPI for am355x baltos board.

Build is fine, but not tested.

Cc: Yegor Yefremov <yegorslists@googlemail.com>
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
Reviewed-by: Yegor Yefremov <yegorslists@googlemail.com>
3 years agodm: spi: Convert Freescale ESPI driver to driver model
Chuanhua Han [Thu, 4 Jun 2020 15:16:30 +0000 (23:16 +0800)]
dm: spi: Convert Freescale ESPI driver to driver model

Modify the Freescale ESPI driver to support the driver model.
Also resolved the following problems:

===================== WARNING ======================
This board does not use CONFIG_DM_SPI. Please update
the board before v2019.04 for no dm conversion
and v2019.07 for partially dm converted drivers.
Failure to update can lead to driver/board removal
See doc/driver-model/MIGRATION.txt for more info.
====================================================
===================== WARNING ======================
This board does not use CONFIG_DM_SPI_FLASH. Please update
the board to use CONFIG_SPI_FLASH before the v2019.07 release.
Failure to update by the deadline may result in board removal.
See doc/driver-model/MIGRATION.txt for more info.
====================================================

Signed-off-by: Chuanhua Han <chuanhua.han@nxp.com>
Signed-off-by: Xiaowei Bao <xiaowei.bao@nxp.com>
Signed-off-by: Hou Zhiqiang <Zhiqiang.Hou@nxp.com>
Reviewed-by: Jagan Teki <jagan@amarulasolutions.com>
3 years agopowerpc: Remove TWR-P1025_defconfig board
Jagan Teki [Sat, 13 Jun 2020 07:56:46 +0000 (13:26 +0530)]
powerpc: Remove TWR-P1025_defconfig board

DM_SPI and other driver model migration deadlines
are expired for this board.

Remove it.

Patch-cc: Xiaobo Xie <xiaobo.xie@nxp.com>
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
3 years agopowerpc: Remove T4160QDS_NAND_defconfig board
Jagan Teki [Sat, 13 Jun 2020 07:55:35 +0000 (13:25 +0530)]
powerpc: Remove T4160QDS_NAND_defconfig board

DM_SPI and other driver model migration deadlines
are expired for this board.

Remove it.

Patch-cc: Ruchika Gupta <ruchika.gupta@nxp.com>
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
3 years agopowerpc: Remove T1040QDS_DDR4_defconfig board
Jagan Teki [Sat, 13 Jun 2020 07:54:37 +0000 (13:24 +0530)]
powerpc: Remove T1040QDS_DDR4_defconfig board

DM_SPI and other driver model migration deadlines
are expired for this board.

Remove it.

Patch-cc: Poonam Aggrwal <poonam.aggrwal@nxp.com>
Patch-cc: Ruchika Gupta <ruchika.gupta@nxp.com>
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
3 years agopowerpc: Remove T1024QDS_DDR4_SECURE_BOOT_defconfig board
Jagan Teki [Sat, 13 Jun 2020 07:53:31 +0000 (13:23 +0530)]
powerpc: Remove T1024QDS_DDR4_SECURE_BOOT_defconfig board

DM_SPI and other driver model migration deadlines
are expired for this board.

Remove it.

Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
3 years agopowerpc: Remove P1022DS_36BIT_NAND_defconfig board
Jagan Teki [Sat, 13 Jun 2020 07:52:12 +0000 (13:22 +0530)]
powerpc: Remove P1022DS_36BIT_NAND_defconfig board

DM_SPI and other driver model migration deadlines
are expired for this board.

Remove it.

Patch-cc: Timur Tabi <timur@tabi.org>
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
3 years agopowerpc: Remove configs/MPC8536DS_36BIT_defconfig board
Jagan Teki [Sat, 13 Jun 2020 07:51:10 +0000 (13:21 +0530)]
powerpc: Remove configs/MPC8536DS_36BIT_defconfig board

DM_SPI and other driver model migration deadlines
are expired for this board.

Remove it.

Patch-cc: Priyanka Jain <priyanka.jain@nxp.com>
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
3 years agopowerpc: Remove configs/C29XPCIE_NAND_defconfig board
Jagan Teki [Sat, 13 Jun 2020 07:50:09 +0000 (13:20 +0530)]
powerpc: Remove configs/C29XPCIE_NAND_defconfig board

DM_SPI and other driver model migration deadlines
are expired for this board.

Remove it.

Patch-cc: Po Liu <po.liu@nxp.com>
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
3 years agopowerpc: Remove configs/BSC9132QDS_NAND_DDRCLK100_SECURE_defconfig board
Jagan Teki [Sat, 13 Jun 2020 07:49:14 +0000 (13:19 +0530)]
powerpc: Remove configs/BSC9132QDS_NAND_DDRCLK100_SECURE_defconfig board

DM_SPI and other driver model migration deadlines
are expired for this board.

Remove it.

Patch-cc: Naveen Burmi <naveen.burmi@nxp.com>
Patch-cc: Ruchika Gupta <ruchika.gupta@nxp.com>
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
3 years agopowerpc: Remove configs/BSC9131RDB_NAND_SYSCLK100_defconfig board
Jagan Teki [Sat, 13 Jun 2020 07:48:16 +0000 (13:18 +0530)]
powerpc: Remove configs/BSC9131RDB_NAND_SYSCLK100_defconfig board

DM_SPI and other driver model migration deadlines
are expired for this board.

Remove it.

Patch-cc: Poonam Aggrwal <poonam.aggrwal@nxp.com>
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
3 years agopowerpc: Remove configs/B4420QDS_NAND_defconfig board
Jagan Teki [Sat, 13 Jun 2020 07:46:01 +0000 (13:16 +0530)]
powerpc: Remove configs/B4420QDS_NAND_defconfig board

DM_SPI and other driver model migration deadlines
are expired for this board.

Remove it.

Patch-cc: Ashish Kumar <ashish.kumar@nxp.com>
Patch-cc: Ruchika Gupta <ruchika.gupta@nxp.com>
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
3 years agoMerge tag 'ti-v2020.10-next' of https://gitlab.denx.de/u-boot/custodians/u-boot-ti...
Tom Rini [Thu, 18 Jun 2020 14:07:49 +0000 (10:07 -0400)]
Merge tag 'ti-v2020.10-next' of https://gitlab.denx.de/u-boot/custodians/u-boot-ti into next

- DM conversion for OMAP4, OMAP5 platforms.
- Other minor fixes for Nokia RX51, am33, am57, am654.

3 years agocommon: hash: Remove a debug printf statement
Harald Seiler [Mon, 15 Jun 2020 07:47:04 +0000 (09:47 +0200)]
common: hash: Remove a debug printf statement

Remove a left-over debug printf that was introduced with SHA512 support.

Fixes: d16b38f42704 ("Add support for SHA384 and SHA512")
Signed-off-by: Harald Seiler <hws@denx.de>
3 years agoMerge tag 'u-boot-stm32-20200616' of https://gitlab.denx.de/u-boot/custodians/u-boot-stm
Tom Rini [Tue, 16 Jun 2020 13:18:56 +0000 (09:18 -0400)]
Merge tag 'u-boot-stm32-20200616' of https://gitlab.denx.de/u-boot/custodians/u-boot-stm

- fix boot with OP-TEE for stm32mp15 boards

3 years agoARM: da850-evm: Remove SPI from SPL when booting from NAND
Adam Ford [Fri, 12 Jun 2020 02:19:10 +0000 (21:19 -0500)]
ARM: da850-evm: Remove SPI from SPL when booting from NAND

The da850evm boots from SPI flash while the da850evm_nand_defconfig
boots from NAND and these are configs are mutually exclusive.

Since there isn't a need for SPI during SPL in the NAND configuration,
this patch removes the SPI drivers in SPL while making them still
available in U-Boot proper.  This should save some code space in SPL.

Signed-off-by: Adam Ford <aford173@gmail.com>
3 years agoomap5: uevm: convert to device model
Tero Kristo [Tue, 16 Jun 2020 08:03:10 +0000 (11:03 +0300)]
omap5: uevm: convert to device model

Convert omap5 uevm board to device model.

Signed-off-by: Tero Kristo <t-kristo@ti.com>
3 years agoomap5: Copy device tree from linux 5.7.y
Tero Kristo [Tue, 16 Jun 2020 08:03:09 +0000 (11:03 +0300)]
omap5: Copy device tree from linux 5.7.y

Copy all the device tree files required for omap5 uevm support from
mainline Linux.

Signed-off-by: Tero Kristo <t-kristo@ti.com>
3 years agoomap4: sdp: convert to device model
Peter Ujfalusi [Tue, 16 Jun 2020 08:03:08 +0000 (11:03 +0300)]
omap4: sdp: convert to device model

Convert omap4 sdp to device model.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Tero Kristo <t-kristo@ti.com>
3 years agoomap4: Copy device tree from Linux 5.7.y for SDP4430
Peter Ujfalusi [Tue, 16 Jun 2020 08:03:07 +0000 (11:03 +0300)]
omap4: Copy device tree from Linux 5.7.y for SDP4430

Copy all device tree files required for omap4 sdp4430 support from
mainline Linux.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Tero Kristo <t-kristo@ti.com>
3 years agoomap4: panda: convert to device model
Tero Kristo [Tue, 16 Jun 2020 08:03:06 +0000 (11:03 +0300)]
omap4: panda: convert to device model

Convert omap4 panda to device model.

Signed-off-by: Tero Kristo <t-kristo@ti.com>
3 years agoomap4: Copy device tree from Linux 5.7.y
Tero Kristo [Tue, 16 Jun 2020 08:03:05 +0000 (11:03 +0300)]
omap4: Copy device tree from Linux 5.7.y

Copy all device tree files required for omap4 panda support from
mainline Linux.

Signed-off-by: Tero Kristo <t-kristo@ti.com>
3 years agoboard: ti: am654: Disable SA2UL node for HS devices
Andrew F. Davis [Tue, 9 Jun 2020 19:14:22 +0000 (15:14 -0400)]
board: ti: am654: Disable SA2UL node for HS devices

On HS devices the access to SA2UL is restricted on the non-secure
ARM side, disable the node in DT to prevent firewall violations.
We used to only disable the TRNG but now that we have full SA2UL
support in Linux, in which TRNG is a sub-module, disable both
by disabling the parent SA2UL node.

Signed-off-by: Andrew F. Davis <afd@ti.com>
3 years agonet: cpsw: Add __maybe_unused to generated inlines
Tom Rini [Thu, 4 Jun 2020 20:05:32 +0000 (16:05 -0400)]
net: cpsw: Add __maybe_unused to generated inlines

We generate a number of helper inline functions to make accesses easier.
However not all permutations of each function will be used and clang
will warn about unused ones.  Decorate all of them with __maybe_unused
because of this.

Cc: Lokesh Vutla <lokeshvutla@ti.com>
Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Grygorii Strashko <grygorii.strashko@ti.com>
3 years agommc: omap_hsmmc: Add guards around omap_hsmmc_get_cfg()
Tom Rini [Thu, 4 Jun 2020 20:03:55 +0000 (16:03 -0400)]
mmc: omap_hsmmc: Add guards around omap_hsmmc_get_cfg()

We only call the function omap_hsmmc_get_cfg in the case of OMAP34XX or
when we have to iodelay recalibration.  Add guards for these checks as
clang will otherwise warn.

Cc: Peng Fan <peng.fan@nxp.com>
Cc: Lokesh Vutla <lokeshvutla@ti.com>
Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>
3 years agogpio: omap_gpio: Fix unused function warning in non-DM case
Tom Rini [Thu, 4 Jun 2020 20:01:39 +0000 (16:01 -0400)]
gpio: omap_gpio: Fix unused function warning in non-DM case

In the case of non-DM_GPIO the function get_gpio_index() will never be
called, and clang will warn about this.  Move this to be with the other
non-DM code for easier removal later.

Cc: Lokesh Vutla <lokeshvutla@ti.com>
Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>
3 years agoboard: ti: am335x_evm: Remove duplicate setting of bd_ram_ofs member
Tom Rini [Thu, 4 Jun 2020 20:01:29 +0000 (16:01 -0400)]
board: ti: am335x_evm: Remove duplicate setting of bd_ram_ofs member

With clang we get a report that we are setting this member twice.
Fortunately it is to the same value, so drop the hard-coded value line.

Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Grygorii Strashko <grygorii.strashko@ti.com>
3 years agoboard: ti: common: Fix pointer-bool-conversion warnings
Tom Rini [Thu, 4 Jun 2020 19:45:08 +0000 (15:45 -0400)]
board: ti: common: Fix pointer-bool-conversion warnings

When building this code with clang-10 a number of warnings will be
generated along the lines of:
warning: address of array 'ep->version' will always evaluate to 'true'

Convert these checks to checking the strlen of the part of the array we
care about.  As this array will be null terminated previously by us,
this is safe.

Cc: Lokesh Vutla <lokeshvutla@ti.com>
Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>
3 years agophy: omap-usb2-phy: disable phy charger detect
Bin Liu [Wed, 3 Jun 2020 11:46:22 +0000 (14:46 +0300)]
phy: omap-usb2-phy: disable phy charger detect

AM654x PG1.0 has a silicon bug that D+ is pulled high after POR, which
could cause enumeration failure with some USB hubs.  Disabling the
USB2_PHY Charger Detect function will put D+ into the normal state.

Using property "ti,dis-chg-det-quirk" in the DT usb2-phy node to
enable this workaround for AM654x PG1.0.

Signed-off-by: Bin Liu <b-liu@ti.com>
Signed-off-by: Vignesh Raghavendra <vigneshr@ti.com>
Signed-off-by: Roger Quadros <rogerq@ti.com>
3 years agodts: ARM: stm32mp15: add OP-TEE node in u-boot DTSI
Etienne Carriere [Fri, 5 Jun 2020 07:24:30 +0000 (09:24 +0200)]
dts: ARM: stm32mp15: add OP-TEE node in u-boot DTSI

Add OP-TEE firmware node in stm32mp15 U-Boot DTSI. This node is
needed since commit [1] that changed U-Boot/stm32mp15 to detect
OP-TEE availability by probing the resource instead of relying on
U-Boot configuration. The software sequence implemented by [1] is
fine but U-Boot DTS/DTSI files were not updated accordingly since,
hence OP-TEE presence is never detected by U-Boot, preventing Linux
kernel from using OP-TEE resources.

For consistency and to synchronize stm32mp15 DTSI files (excluding
U-Boot specific DTSI files) with the Linux kernel ones, this change
also moves the OP-TEE reserved memory nodes from board generic DTSI
files to U-Boot specific board DTSI files.

Link: [1] commit 43df0a159df6 ("stm32mp1: dynamically detect op-tee presence")
Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org>
Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@st.com>
3 years agoboard: stm32mp1: fix handling of DT OP-TEE reserved memory nodes
Etienne Carriere [Fri, 5 Jun 2020 07:24:29 +0000 (09:24 +0200)]
board: stm32mp1: fix handling of DT OP-TEE reserved memory nodes

Fix the sequence in stm32mp1 fdt.c that disables OP-TEE resources
defined in FDT when U-boot detects OP-TEE firmware is not present.

Before this change, helper function stm32_fdt_disable_optee()
set property status to "disabled" for the OP-TEE reserved memory
nodes but this has no impact since Linux kernel does not consider
the status property for reserved-memory subnodes. This change
make U-Boot to attempt to delete the node instead.

Fixes: 4a1b975dac02 ("board: stm32mp1: reserve memory for OP-TEE in device tree")
Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org>
Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@st.com>
3 years agoMerge tag 'efi-2020-07-rc5' of https://gitlab.denx.de/u-boot/custodians/u-boot-efi
Tom Rini [Mon, 15 Jun 2020 20:44:58 +0000 (16:44 -0400)]
Merge tag 'efi-2020-07-rc5' of https://gitlab.denx.de/u-boot/custodians/u-boot-efi

Pull request for UEFI sub-system for efi-2020-07-rc5

Use correct printf code in efi_image_parse().
Add random number generation to HTML documentation.

3 years agoregulator: fix: enable gpio when requested
Mark Kettenis [Mon, 27 Apr 2020 09:09:47 +0000 (11:09 +0200)]
regulator: fix: enable gpio when requested

The fix in commit b7adcdd073c0 has the side-effect that the regulator
will be disabled when requesting the relevant gpio in
regulator_common_ofdata_to_platdata() and enabled in
regulator_pre_probe() when the regulator was already enabled.
This leads to a short interruption in the 3.3V power to the PCIe
slot on the firefly-rk3399 which makes an ADATA SX8000NP NVMe SSD
unhappy.

Fix this by setting the GPIOD_IS_OUT_ACTIVE flag again when the
'regulator-boot-on' property is set, but check for this property
explicitly instead of relying on the "boot_on" member of
the uclass platdata.

Signed-off-by: Mark Kettenis <kettenis@openbsd.org>
Tested-by: Patrice Chotard <patrice.chotard@st.com>
3 years agoMerge branch '2020-06-15-misc-bugfixes'
Tom Rini [Mon, 15 Jun 2020 15:24:42 +0000 (11:24 -0400)]
Merge branch '2020-06-15-misc-bugfixes'

- Assorted bug fixes

3 years agoenv: Kconfig: cosmetics: update comment for SYS_RELOC_GD_ENV_ADDR
Patrick Delaunay [Wed, 10 Jun 2020 17:28:42 +0000 (19:28 +0200)]
env: Kconfig: cosmetics: update comment for SYS_RELOC_GD_ENV_ADDR

Update the comment for SYS_RELOC_GD_ENV_ADDR as gd->env_addr is updated
in board_r.c::initr_reloc_global_data() under the compilation flags
CONFIG_SYS_RELOC_GD_ENV_ADDR

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
3 years agoconfig: qemu: increase SYS_MALLOC_F_LEN
Heinrich Schuchardt [Sun, 7 Jun 2020 09:54:00 +0000 (11:54 +0200)]
config: qemu: increase SYS_MALLOC_F_LEN

Several configutation options require additional memory before relocation:

* CONSOLE_RECORD
* LOG
* RSA

The current default of 0x400 is too small to encompass them all. Increase
the value of SYS_MALLOC_F_LEN to 0x2000 for ARCH_QEMU.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
3 years agoRevert "lib: Improve _parse_integer_fixup_radix base 16 detection"
Sean Anderson [Sun, 7 Jun 2020 05:36:45 +0000 (01:36 -0400)]
Revert "lib: Improve _parse_integer_fixup_radix base 16 detection"

This reverts commit 0486497e2b5f4d36fa968a1a60fea358cbf70b65.

The strtoul has well-defined semantics. It is defined by the C standard and
POSIX. To quote the relevant section of the man pages,

> If base is zero or 16, the string may then include a "0x" prefix, and the
> number will be read in base 16; otherwise, a zero base is taken as 10
> (decimal) unless the next character is '0', in which case it is taken as
> 8 (octal).

Keeping these semantics is important for several reasons. First, it is very
surprising for standard library functions to behave differently than usual.
Every other implementation of strtoul has different semantics than the
implementation in U-Boot at the moment. Second, it can result in very
surprising results from small changes. For example, changing the string
"1f" to "20" causes the parsed value to *decrease*. Forcing use of the "0x"
prefix to specify hexidecimal numbers is a feature, not a bug. Lastly, this
is slightly less performant, since the entire number is parsed twice.

This fixes the str_simple_strtoul test failing with

test/str_ut.c:29, run_strtoul(): expect_val == val: Expected 0x44b (1099), got 0x1099ab (1087915)
test/str_ut.c:46, str_simple_strtoul(): 0 == run_strtoul(uts, str2, 0, 1099, 4): Expected 0x0 (0), got 0x1 (1)

Signed-off-by: Sean Anderson <seanga2@gmail.com>
CC: Michal Simek <michal.simek@xilinx.com>
CC: Shiril Tichkule <shirilt@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
3 years agotrivial: Fix booot occurences
Michal Simek [Fri, 5 Jun 2020 09:45:12 +0000 (11:45 +0200)]
trivial: Fix booot occurences

s/booot/boot/g

The first ase is booot instead of boot and second u-booot instead of
u-boot.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
3 years agooptee: fix copy of optee reserved-memory node
Etienne Carriere [Fri, 5 Jun 2020 07:22:11 +0000 (09:22 +0200)]
optee: fix copy of optee reserved-memory node

Fix the loop that parses FDT for a reserved memory node named "optee".

Before this change, if at least one subnode was found in the
reserved-memory node, the function endlessly looped since instruction
continue returned back in the loop without updating variable subnode.
This change fixes the issue by using a for loop.

Fixes: 6ccb05eae01b ("image: fdt: copy possible optee nodes to a loaded devicetree")
Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org>
Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
3 years agoMerge tag 'mmc-2020-6-15' of https://gitlab.denx.de/u-boot/custodians/u-boot-mmc
Tom Rini [Mon, 15 Jun 2020 14:20:35 +0000 (10:20 -0400)]
Merge tag 'mmc-2020-6-15' of https://gitlab.denx.de/u-boot/custodians/u-boot-mmc

- fsl_esdhc sdr104 and hs200 fix and error path fix
- fsl_esdhc workaround 3.3v io issue
- ca_dw_mmc cleanup
- presidio-asic emmc DT update.

3 years agommc: fsl_esdhc: Gracefully fail on unsupported voltage switch
Marek Vasut [Fri, 22 May 2020 16:28:33 +0000 (18:28 +0200)]
mmc: fsl_esdhc: Gracefully fail on unsupported voltage switch

Unsupported voltage on voltage switch is not an error, do not
print error message in such a case. This happens e.g. if the
eMMC is already in 1V8 mode or when testing 1V2 mode operation
on systems which only do 3V3/1V8 switching.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Fabio Estevam <fabio.estevam@nxp.com>
Cc: Jaehoon Chung <jh80.chung@samsung.com>
Cc: Peng Fan <peng.fan@nxp.com>
Cc: Stefano Babic <sbabic@denx.de>
Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
3 years agommc: fsl_esdhc: Fix SDR104 and HS200 support
Marek Vasut [Fri, 22 May 2020 16:19:08 +0000 (18:19 +0200)]
mmc: fsl_esdhc: Fix SDR104 and HS200 support

The 3V3/1V8 switching could never have worked on any of the iMXes
ever since 51313b49f2 ("mmc: fsl_esdhc: support SDR104 and HS200"),
because that commit uses priv->vqmmc_dev when switching voltages on
mode switch, while local vqmmc_dev in probe to store the regulator
pointer. Those are two different variables with the same name. So
the priv->vqmmc_dev was always NULL and thus voltage switch between
modes never really suceeded.

Fix this by assigning priv->vqmmc_dev with value of the vqmmc_dev
in probe.

Fixes: 51313b49f2 ("mmc: fsl_esdhc: support SDR104 and HS200")
Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Fabio Estevam <fabio.estevam@nxp.com>
Cc: Jaehoon Chung <jh80.chung@samsung.com>
Cc: Peng Fan <peng.fan@nxp.com>
Cc: Stefano Babic <sbabic@denx.de>
Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
3 years agoboard: presidio-asic: update eMMC DT information
Alex Nemirovsky [Fri, 22 May 2020 00:24:23 +0000 (17:24 -0700)]
board: presidio-asic: update eMMC DT information

Change DT compatibility name to match change in driver's name.
Remove unused io_ds and fifo_mode fields from DT.

Signed-off-by: Alex Nemirovsky <alex.nemirovsky@cortina-access.com>
CC: Peng Fan <peng.fan@nxp.com>
CC: Jaehoon Chung <jh80.chung@samsung.com>
CC: Tom Rini <trini@konsulko.com>
3 years agommc: ca_dw_mmc: Misc cleanup of driver
Arthur Li [Fri, 22 May 2020 00:24:22 +0000 (17:24 -0700)]
mmc: ca_dw_mmc: Misc cleanup of driver

- Rename DT compatible name
- Remove uneccessary if-statement to support 8-bit buswidth
- Remove redundant error msg
- Use symbolic constants in switch statement

Signed-off-by: Arthur Li <arthur.li@cortina-access.com>
Signed-off-by: Alex Nemirovsky <alex.nemirovsky@cortina-access.com>
CC: Peng Fan <peng.fan@nxp.com>
CC: Jaehoon Chung <jh80.chung@samsung.com>
CC: Tom Rini <trini@konsulko.com>
3 years agommc: fsl_esdhc: workaround for hardware 3.3v IO reliability issue
Yangbo Lu [Tue, 19 May 2020 03:06:44 +0000 (11:06 +0800)]
mmc: fsl_esdhc: workaround for hardware 3.3v IO reliability issue

When eSDHC operates at 3.3v, damage can accumulate in an internal
level shifter at a higher than expected rate. The faster the interface
runs, the more damage accumulates. This issue now is found on LX2160A
eSDHC1 for only SD card.

The hardware workaround is recommended to use an on-board level shifter
that is 1.8v on SoC side and 3.3v on SD card side.

For boards without hardware workaround, this option could be enabled,
ensuring 1.8v IO voltage and disabling eSDHC if no card.
This option assumes no hotplug, and u-boot has to make all the way to
to linux to use 1.8v UHS-I speed mode if has card.
If you do not want the workaround for better user experience, of course
you can choose to not select it running eSDHC in unsafe mode.

Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
Acked-by: Peng Fan <peng.fan@nxp.com>
3 years agommc: fsl_esdhc: read register once for card inserted status
Yangbo Lu [Tue, 19 May 2020 03:06:43 +0000 (11:06 +0800)]
mmc: fsl_esdhc: read register once for card inserted status

No need to poll register for card inserted status.

Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
Acked-by: Peng Fan <peng.fan@nxp.com>
3 years agoefi_loader: printf code in efi_image_parse()
Heinrich Schuchardt [Sat, 6 Jun 2020 11:17:48 +0000 (13:17 +0200)]
efi_loader: printf code in efi_image_parse()

For size_t we have to use %zu for printing not %lu.

Fixes: 4540dabdcaca ("efi_loader: image_loader: support image
authentication")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
3 years agodoc: random number generation
Heinrich Schuchardt [Sat, 13 Jun 2020 10:29:52 +0000 (12:29 +0200)]
doc: random number generation

Add random number generation APIs to the HTML documentation.
Fix style issues.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
3 years agoMerge https://gitlab.denx.de/u-boot/custodians/u-boot-usb
Tom Rini [Sun, 14 Jun 2020 16:01:14 +0000 (12:01 -0400)]
Merge https://gitlab.denx.de/u-boot/custodians/u-boot-usb

- eth/r8152: update the firmware

3 years agoMerge https://gitlab.denx.de/u-boot/custodians/u-boot-socfpga
Tom Rini [Sun, 14 Jun 2020 16:00:50 +0000 (12:00 -0400)]
Merge https://gitlab.denx.de/u-boot/custodians/u-boot-socfpga

- cyclone5 bugfix

3 years agoarm: dts: socfpga: cyclone5: Update i2c-scl-falling-time-ns
Ley Foon Tan [Wed, 10 Jun 2020 05:24:16 +0000 (13:24 +0800)]
arm: dts: socfpga: cyclone5: Update i2c-scl-falling-time-ns

Commit e71b6f6622d6 ("i2c: designware_i2c: Rewrite timing calculation")
change the hcnt and lcnt timing calculation. New timing calculation is
based on calculation from Designware i2c databook.

After this new timing calculation, hcnt will have negative value
with i2c-scl-falling-time-ns 5000 that set in socfpga_cyclone5_socdk.dts.

This patch overwrite i2c-scl-falling-time-ns to 300ns (default SCL fall
time used in Designware i2c driver) for Uboot.

Before the fix:
=> i2c dev 0
Setting bus to 0
Failure changing bus number (-22)

After the fix:
=> i2c dev 0
Setting bus to 0
=> i2c probe
Valid chip addresses: 17 51 55 5B 5C 5E 66 68 70

Signed-off-by: Ley Foon Tan <ley.foon.tan@intel.com>
3 years agoeth/r8152: update the firmware
Hayes Wang [Fri, 5 Jun 2020 07:23:40 +0000 (15:23 +0800)]
eth/r8152: update the firmware

Update the firmware to improve compatibility for none-intel USB
host controller. The more information is as following.

The device has auto-installed driver feature - via switch CD-ROM/NIC
mode. But in some corner cases, it would switch to CD-ROM unexpected.
This issue results in Lan Function Disabled.

While USB PHY transits to P3 from P0 due to the absent of transmitter
control, it would issues undefined signal to its link partner.
Some Down Stream Port misidentify the undefined signal as wakeup
signal. So the link state will not keep in suspend even the system
is idle.

Signed-off-by: Hayes Wang <hayeswang@realtek.com>
3 years agoNokia RX-51: Fix checking if serial console was enabled
Pali Rohár [Sun, 31 May 2020 22:29:10 +0000 (00:29 +0200)]
Nokia RX-51: Fix checking if serial console was enabled

There was incorrect logic for parsing OMAP_TAG_UART atag.

Signed-off-by: Pali Rohár <pali@kernel.org>
3 years agoNokia RX-51: Add link for u-boot-gen-combined script to README file
Pali Rohár [Sun, 31 May 2020 22:26:32 +0000 (00:26 +0200)]
Nokia RX-51: Add link for u-boot-gen-combined script to README file

This patch updates Nokia RX-51 README file.

Signed-off-by: Pali Rohár <pali@kernel.org>
3 years agotools: k3_gen_x509_cert: Set default early HS JTAG access to disabled
Andrew F. Davis [Wed, 27 May 2020 13:47:55 +0000 (09:47 -0400)]
tools: k3_gen_x509_cert: Set default early HS JTAG access to disabled

When authenticating the initial boot binary the ROM will check a debug
type value in the certificate and based on that open JTAG access to that
core. This only effects HS devices as non-HS device ROM allows JTAG
by default.

This can be useful for HS developers working in the early boot stage,
before SYSFW is loaded. After that point the JTAG access can be
changed based on board configurations passed to SYSFW.

This access can also be a large security problem as JTAG access on
HS devices can be used to circumvent the chain-of-trust controls.
Accidentally leaving this open defeats the security on HS, due to this
change the default to disabled.

This should only effect those working on early HS boot code, which
is a limited crowd who will already know how to re-enable this access
as needed.

Signed-off-by: Andrew F. Davis <afd@ti.com>
3 years agotools: k3_gen_x509_cert: Allow selecting early JTAG debug value
Andrew F. Davis [Wed, 27 May 2020 13:47:54 +0000 (09:47 -0400)]
tools: k3_gen_x509_cert: Allow selecting early JTAG debug value

When authenticating the initial boot binary the ROM will check a debug
type value in the certificate and based on that open JTAG access to that
core.

Make this selectable in the signing tool to allow it to be enabled or
disabled based on user command line input.

This does not change the default behavior.

Signed-off-by: Andrew F. Davis <afd@ti.com>
3 years agommc: davinci_mmc: Cleanup to use dt in U-boot and static platdata in SPL
Faiz Abbas [Fri, 22 May 2020 02:02:28 +0000 (07:32 +0530)]
mmc: davinci_mmc: Cleanup to use dt in U-boot and static platdata in SPL

Cleanup this driver to use dt in U-boot and static platdata in SPL.
This requires the following steps:

1. Move all platdata assignment from probe() to ofdata_to_platdata().
   This function is only called in U-boot.
2. Replicate all the platdata assignment being done in
   ofdata_to_platdata() in the omapl138 board file. This data is used in
   the SPL case where SPL_OF_CONTROL is not enabled.
3. Remove SPL_OF_CONTROL and related configs from omapl138_lcdk_defconfig

This cleanup effectively reverts 3ef94715cc ('mmc: davinci: fix mmc boot in SPL')

Signed-off-by: Faiz Abbas <faiz_abbas@ti.com>
Tested-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
3 years agoboard: ti: use positive logic to detect idk boards
Luca Ceresoli [Thu, 21 May 2020 13:06:25 +0000 (15:06 +0200)]
board: ti: use positive logic to detect idk boards

am57x_idk_lcd_detect() exits immediately if a known board not having
an LCD is found, i.e. a non-IDK board. This is annoying as we have to
remember to add an extra OR clause for every new non-IDK board.

Add a board_is_ti_idk() macro so that the logic becomes positive (detect
LCD on IDK boards instead of not-known-without-LCD boards). Even more
important, add the macro just below the board_is_*_idk() macros, so it is
easy to remember to update it when adding a new IDK.

Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net>
3 years agoboard: ti: am57xx: use GPIO_TO_PIN() to define GPIO number
Luca Ceresoli [Thu, 21 May 2020 13:06:24 +0000 (15:06 +0200)]
board: ti: am57xx: use GPIO_TO_PIN() to define GPIO number

Using the macro makes code readable without the need for a comment.

Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net>
3 years agoMerge tag 'dm-pull-12jun20' of git://git.denx.de/u-boot-dm into next
Tom Rini [Sat, 13 Jun 2020 13:01:01 +0000 (09:01 -0400)]
Merge tag 'dm-pull-12jun20' of git://git.denx.de/u-boot-dm into next

patman improvements to allow it to work with Zephyr
change to how sequence numbers are assigned to devices
minor fixes and improvements

3 years agoMerge https://gitlab.denx.de/u-boot/custodians/u-boot-spi
Tom Rini [Fri, 12 Jun 2020 21:20:35 +0000 (17:20 -0400)]
Merge https://gitlab.denx.de/u-boot/custodians/u-boot-spi

- Drop davinci, mxs spi nondm code
- Zap nondm soft_spi
- Switch few board to DM_SPI
- Drop omap3_pandora, pcm051 boards

3 years agoMerge branch '2020-06-12-next-net' into next
Tom Rini [Fri, 12 Jun 2020 18:58:12 +0000 (14:58 -0400)]
Merge branch '2020-06-12-next-net' into next

- Merge tbs2910 distro boot support and associated clean-ups and size
  reduction.
- Assorted networking corrections / bugfixes.
- Drop smc911x standalone API example as it was likely non-functional for a
  long time.
- Enhanced support for TI PHYs
- rtl8139 DM conversion

3 years agonet: move random_port() to dns
Baruch Siach [Wed, 20 May 2020 10:31:41 +0000 (13:31 +0300)]
net: move random_port() to dns

The random_port() routine is not used anywhere else. Make it local to
dns.c to reduce code clutter, and shrink generated code a little.

Signed-off-by: Baruch Siach <baruch@tkos.co.il>
3 years agonet: tftp: fix option validation as per RFCs
Ravik Hasija [Tue, 19 May 2020 04:35:43 +0000 (21:35 -0700)]
net: tftp: fix option validation as per RFCs

RFC2348, RFC2349:
- Option string is case in-sensitive.
- Client must generate ERR pkt in case option value mismatch in server OACK
- Fix debug print for options

Signed-off-by: Ravik Hasija <rahasij@linux.microsoft.com>
Reviewed-By: Ramon Fried <rfried.dev@gmail.com>
3 years agonet: rtl8139: Add DM support
Marek Vasut [Sat, 9 May 2020 20:34:44 +0000 (22:34 +0200)]
net: rtl8139: Add DM support

Add support for driver model to the driver.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Joe Hershberger <joe.hershberger@ni.com>
3 years agonet: rtl8139: Read HW address from EEPROM only on probe
Marek Vasut [Sat, 9 May 2020 20:34:43 +0000 (22:34 +0200)]
net: rtl8139: Read HW address from EEPROM only on probe

Do not re-read the HW address from the EEPROM on every start of
transfer, otherwise the user will not be able to adjust ethaddr
as needed. Read the address only once, when the card is detected.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Joe Hershberger <joe.hershberger@ni.com>
3 years agonet: rtl8139: Use PCI_DEVICE() to define PCI device compat list
Marek Vasut [Sat, 9 May 2020 20:34:42 +0000 (22:34 +0200)]
net: rtl8139: Use PCI_DEVICE() to define PCI device compat list

Use this macro to fully fill the PCI device ID table. This is mandatory
for the DM PCI support, which checks all the fields.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Joe Hershberger <joe.hershberger@ni.com>
3 years agonet: rtl8139: Split out common and non-DM functions
Marek Vasut [Sat, 9 May 2020 20:34:41 +0000 (22:34 +0200)]
net: rtl8139: Split out common and non-DM functions

Split the driver into common and non-DM functionality, so that the
DM support can later re-use the common code, while we retain the
non-DM code until all the platforms are converted.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Joe Hershberger <joe.hershberger@ni.com>
3 years agonet: rtl8139: Pass private data into rtl8139_eeprom_delay()
Marek Vasut [Sat, 9 May 2020 20:34:40 +0000 (22:34 +0200)]
net: rtl8139: Pass private data into rtl8139_eeprom_delay()

Instead of always calling rtl8139_eeprom_delay() with priv->ioaddr,
call it with priv and let the function access priv->ioaddr. This
reduces code duplication and has no impact, since the compiler will
inline this as needed anyway.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Joe Hershberger <joe.hershberger@ni.com>
3 years agonet: rtl8139: Introduce device private data
Marek Vasut [Sat, 9 May 2020 20:34:39 +0000 (22:34 +0200)]
net: rtl8139: Introduce device private data

Introduce rtl8139_pdata, which is a super-structure around eth_device
and tracks per-device state, here the device IO address, PCI BDF, RX
and TX ring position. Pass this structure around instead of the old
non-DM eth_device in preparation for DM conversion.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Joe Hershberger <joe.hershberger@ni.com>
3 years agonet: rtl8139: Clean up bus_to_phys()/phys_to_bus() macros
Marek Vasut [Sat, 9 May 2020 20:34:38 +0000 (22:34 +0200)]
net: rtl8139: Clean up bus_to_phys()/phys_to_bus() macros

These macros depended on the dev variable being declared wherever
they were used. This is wrong and will not work with DM anyway, so
pass only the PCI BFD into these macros, which fixes the dependency
and prepares them for DM support as well.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Joe Hershberger <joe.hershberger@ni.com>
3 years agonet: rtl8139: Use dev->iobase instead of custom ioaddr
Marek Vasut [Sat, 9 May 2020 20:34:37 +0000 (22:34 +0200)]
net: rtl8139: Use dev->iobase instead of custom ioaddr

Replace the use of custom static ioaddr variable with common dev->iobase,
no functional change.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Joe Hershberger <joe.hershberger@ni.com>
3 years agonet: rtl8139: Switch from malloc()+memset() to calloc()
Marek Vasut [Sat, 9 May 2020 20:34:36 +0000 (22:34 +0200)]
net: rtl8139: Switch from malloc()+memset() to calloc()

Replace malloc()+memset() combination with calloc(), no functional change.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Joe Hershberger <joe.hershberger@ni.com>
3 years agonet: rtl8139: Factor out device name assignment
Marek Vasut [Sat, 9 May 2020 20:34:35 +0000 (22:34 +0200)]
net: rtl8139: Factor out device name assignment

Pull the device name setting into a separate function, as this
will be shared between DM/non-DM variants.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Joe Hershberger <joe.hershberger@ni.com>
3 years agonet: tftp: fix progress marker for file transfer
Ravik Hasija [Thu, 7 May 2020 21:55:32 +0000 (14:55 -0700)]
net: tftp: fix progress marker for file transfer

During packet sequence number wraparound the show_block_marker() API was
not called, as a result the progress marker doesn't stay within column
boundary. Use position in file instead of sequence number to align the
marker.

Signed-off-by: Ravik Hasija <rahasij@linux.microsoft.com>
Reviewed-By: Ramon Fried <rfried.dev@gmail.com>
3 years agonet: phy: Add DP8382x phy registration to TI PHY init
Dan Murphy [Mon, 4 May 2020 21:14:40 +0000 (16:14 -0500)]
net: phy: Add DP8382x phy registration to TI PHY init

Add the DP8382X generic PHY registration to the TI PHY init file.

Acked-by: Michal Simek <michal.simek@xilinx.com>
Signed-off-by: Dan Murphy <dmurphy@ti.com>
3 years agonet: phy: Add support for TI PHY init
Dan Murphy [Mon, 4 May 2020 21:14:39 +0000 (16:14 -0500)]
net: phy: Add support for TI PHY init

ti_phy_init function was allocated to the DP83867 PHY.  This function
name is to generic for a specific PHY.  The function can be moved to a
TI specific file that can register all TI PHYs that are defined in the
defconfig.  The ti_phy_init file will contain all TI PHYs initialization
so that only phy_ti_init can be called from the framework.

In addition to the above the config flag for the DP83867 needs to be changed
in the Kconfig and dependent defconfig files. The config flag that was
used for the DP83867 was also generic in nature so a more specific
config flag for the DP83867 was created.

Acked-by: Michal Simek <michal.simek@xilinx.com>
Signed-off-by: Dan Murphy <dmurphy@ti.com>
3 years agonet: phy: Add helper routines to set and clear bits
Dan Murphy [Mon, 4 May 2020 21:14:38 +0000 (16:14 -0500)]
net: phy: Add helper routines to set and clear bits

Add phy_set/clear_bit helper routines so that ported drivers from the
kernel can use these functions.

Acked-by: Michal Simek <michal.simek@xilinx.com>
Signed-off-by: Dan Murphy <dmurphy@ti.com>
3 years agonet: phy: Fix kernel doc issues in phy.h
Dan Murphy [Mon, 4 May 2020 21:14:37 +0000 (16:14 -0500)]
net: phy: Fix kernel doc issues in phy.h

Fix kernel doc warnings in phy.h.  Mostly the warnings were due to the
return missing the semi-colon.

Acked-by: Michal Simek <michal.simek@xilinx.com>
Signed-off-by: Dan Murphy <dmurphy@ti.com>
3 years agonet: phy: Add missing kernel doc to phy functions
Dan Murphy [Mon, 4 May 2020 21:14:36 +0000 (16:14 -0500)]
net: phy: Add missing kernel doc to phy functions

Add kernel doc to the phy_read/write utility functions in phy.h

Acked-by: Michal Simek <michal.simek@xilinx.com>
Signed-off-by: Dan Murphy <dmurphy@ti.com>
3 years agonet: phy: add phyid search in vendor specific space
Florin Chiculita [Wed, 29 Apr 2020 11:25:48 +0000 (14:25 +0300)]
net: phy: add phyid search in vendor specific space

There are devices accesible through mdio clause-45, such as
retimers, that do not have PMA or PCS blocks.
This patch adds MDIO_MMD_VEND1 on the list of device addresses
where phyid is searched. Previous order of devices was kept.

Signed-off-by: Florin Chiculita <florinlaurentiu.chiculita@nxp.com>
Reviewed-by: Madalin Bucur <madalin.bucur@oss.nxp.com>