oweals/u-boot.git
3 years agomx6cuboxi: enable MMC and eMMC in DT for SPL
Walter Lozano [Tue, 19 May 2020 18:24:21 +0000 (15:24 -0300)]
mx6cuboxi: enable MMC and eMMC in DT for SPL

Signed-off-by: Walter Lozano <walter.lozano@collabora.com>
3 years agomx6ull_14x14_evk_plugin: Convert to DM_ETH
Fabio Estevam [Tue, 9 Jun 2020 13:44:00 +0000 (10:44 -0300)]
mx6ull_14x14_evk_plugin: Convert to DM_ETH

Convert to DM_ETH to avoid board removal from the project.

Signed-off-by: Fabio Estevam <festevam@gmail.com>
3 years agomx6slevk_spl: Convert to DM_ETH
Fabio Estevam [Tue, 9 Jun 2020 13:43:59 +0000 (10:43 -0300)]
mx6slevk_spl: Convert to DM_ETH

Convert to DM_ETH to avoid board removal from the project.

Signed-off-by: Fabio Estevam <festevam@gmail.com>
3 years agomx6slevk_spinor: Convert to DM_ETH
Fabio Estevam [Tue, 9 Jun 2020 13:43:58 +0000 (10:43 -0300)]
mx6slevk_spinor: Convert to DM_ETH

Convert to DM_ETH to avoid board removal from the project.

Signed-off-by: Fabio Estevam <festevam@gmail.com>
3 years agoarm: dts: imx: fsl-imx8qm.dtsi: fix gpio aliases
Ye Li [Wed, 10 Jun 2020 03:28:03 +0000 (20:28 -0700)]
arm: dts: imx: fsl-imx8qm.dtsi: fix gpio aliases

Current aliases missed gpio0 node, and this node shoud be
aliased to gpio index 0 to align with i.MX8QXP. Otherwise, we
will get below message when running "gpio status" command, and
see the reason by "dm uclass".

=> gpio status
Device 'gpio@5d090000': seq 0 is in use by 'gpio@5d080000'
Device 'gpio@5d0a0000': seq 1 is in use by 'gpio@5d090000'
Device 'gpio@5d0b0000': seq 2 is in use by 'gpio@5d0a0000'

=> dm uclass
uclass 36: gpio
0   * gpio@5d080000 @ fbaefb90, seq 0, (req -1)
1   * gpio@5d090000 @ fbaefc70, seq 1, (req 0)
2   * gpio@5d0a0000 @ fbaefd50, seq 2, (req 1)
3   * gpio@5d0b0000 @ fbaefe30, seq 5, (req 2)
4   * gpio@5d0c0000 @ fbaeff10, seq 3, (req 3)
5   * gpio@5d0d0000 @ fbaefff0, seq 4, (req 4)
6   * gpio@5d0e0000 @ fbaf00d0, seq 6, (req 5)
7   * gpio@5d0f0000 @ fbaf01b0, seq 7, (req 6)

Signed-off-by: Ye Li <ye.li@nxp.com>
3 years agogpio: mxc_gpio: change gpio index for i.MX8
Ye Li [Wed, 10 Jun 2020 03:28:02 +0000 (20:28 -0700)]
gpio: mxc_gpio: change gpio index for i.MX8

Since the i.MX8 GPIO banks are indexed from 0 not 1 on other i.MX
platforms, so we have to adjust the index accordingly.

Signed-off-by: Adrian Alonso <adrian.alonso@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
3 years agomx6ul_14x14_evk: Avoid overlap of environment over U-Boot proper
Otavio Salvador [Tue, 9 Jun 2020 16:22:50 +0000 (13:22 -0300)]
mx6ul_14x14_evk: Avoid overlap of environment over U-Boot proper

We need to change the environment offset to avoid corrupting the U-Boot
binary when saving it.

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
Reviewed-by: Fabio Estevam <festevam@gmail.com>
3 years agomx6ul_14x14_evk: Enable SPL USB and SDP support
Otavio Salvador [Tue, 9 Jun 2020 16:22:49 +0000 (13:22 -0300)]
mx6ul_14x14_evk: Enable SPL USB and SDP support

This fixes the boot from USB loader, which is critical to easy the
manufacture process.

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
Reviewed-by: Fabio Estevam <festevam@gmail.com>
3 years agoARM: imx: soc: Select default TEXT_BASE for MX7
Marek Vasut [Thu, 21 May 2020 23:13:54 +0000 (01:13 +0200)]
ARM: imx: soc: Select default TEXT_BASE for MX7

Select default U-Boot and SPL text base for the MX7 SoC. The U-Boot
text base is picked as the one used by various MX7 boards. The SPL
text base however is different.

The SPL text base is set to 0x912000 instead of the usual 0x911000,
that is because the 0x911000 value cannot work. Using 0x911000 as a
SPL text base will result in the DCD header being placed below the
0x911000 address, which is a reserved SRAM area which must not be
used. This will actually trigger eMMC boot failure on MX7D at least.
Hence the increment.

Update all boards affected by this SPL problem to the new SPL_TEXT_BASE.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Fabio Estevam <festevam@gmail.com>
Cc: NXP i.MX U-Boot Team <uboot-imx@nxp.com>
Cc: Peng Fan <peng.fan@nxp.com>
Cc: Stefano Babic <sbabic@denx.de>
3 years agoARM: imx: soc: Switch BOARD_EARLY_INIT_F to imply on MX7
Marek Vasut [Thu, 21 May 2020 23:13:00 +0000 (01:13 +0200)]
ARM: imx: soc: Switch BOARD_EARLY_INIT_F to imply on MX7

There are systems where board_early_init_f() is plain empty. Switch
the config option from "select" to "imply", to permit user to unset
the BOARD_EARLY_INIT_F if it were to be empty.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Fabio Estevam <festevam@gmail.com>
Cc: NXP i.MX U-Boot Team <uboot-imx@nxp.com>
Cc: Peng Fan <peng.fan@nxp.com>
Cc: Stefano Babic <sbabic@denx.de>
3 years agoARM: imx: ddr: Fill in missing DDRC ZQCTLx on i.MX7
Marek Vasut [Thu, 21 May 2020 23:12:39 +0000 (01:12 +0200)]
ARM: imx: ddr: Fill in missing DDRC ZQCTLx on i.MX7

The iMX7 defines further DDRC ZQCTLx registers, however those were
thus far missing from the list of registers and not programmed. On
systems with LPDDR2 or DDR3, those registers must be programmed with
correct values, otherwise the DRAM may not work. However, existing
systems which worked without programming these registers before are
now setting those registers to 0, which is the default value, so no
functional change there.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Fabio Estevam <festevam@gmail.com>
Cc: NXP i.MX U-Boot Team <uboot-imx@nxp.com>
Cc: Peng Fan <peng.fan@nxp.com>
Cc: Stefano Babic <sbabic@denx.de>
3 years agoimx: imx8qm_rom7720_a1: update README
Oliver Graute [Wed, 20 May 2020 11:47:06 +0000 (13:47 +0200)]
imx: imx8qm_rom7720_a1: update README

Update README to extract firmware from scripts

Signed-off-by: Oliver Graute <oliver.graute@kococonnector.com>
3 years agoARM: imx6: Fetch MAC address in board_init_late() on DH iMX6 PDK2
Marek Vasut [Thu, 14 May 2020 16:49:10 +0000 (18:49 +0200)]
ARM: imx6: Fetch MAC address in board_init_late() on DH iMX6 PDK2

This is needed to obtain the MAC from EEPROM/OTP only after the final
env is populated, otherwise the ethaddr might be overriden.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Claudius Heine <ch@denx.de>
Cc: Harald Seiler <hws@denx.de>
Cc: Ludwig Zenz <lzenz@dh-electronics.com>
Cc: Stefano Babic <sbabic@denx.de>
3 years agoarm: wandboard: move CONFIG_MXC_UART to defconfig
Heinrich Schuchardt [Sun, 7 Jun 2020 23:43:47 +0000 (01:43 +0200)]
arm: wandboard: move CONFIG_MXC_UART to defconfig

For using a debug UART on the Wandboard CONFIG_MXC_UART=y must be set in
the .config file.

To avoid duplicate definitions move the setting from
include/configs/wandboard.h to configs/wandboard_defconfig.

Document the debug UART settings in the README.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>
3 years agoFix MMC access on Sabrelite
Martyn Welch [Thu, 11 Jun 2020 17:53:50 +0000 (18:53 +0100)]
Fix MMC access on Sabrelite

It appears that MMC access on the Sabrelite has been broken since
cdcaee9518:

Loading Environment from MMC... Card did not respond to voltage select!
*** Warning - No block device, using default environment

Remove the board_mmc_init() and related entries now that we should be
using DM_MMC, add PINCTRL so that things work as expected.

Signed-off-by: Martyn Welch <martyn.welch@collabora.com>
Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
Reviewed-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Troy Kisky <troy.kisky@boundarydevices.com>
Acked-by: Troy Kisky <troy.kisky@boundarydevices.com>
3 years agocolibri_imx6: boot env configuration updates
Igor Opaniuk [Tue, 16 Jun 2020 19:20:11 +0000 (22:20 +0300)]
colibri_imx6: boot env configuration updates

1. Drop legacy emmcboot wrapper from env.
2. Change the "boot try" order. Default one is: SD -> eMMC -> USB -> DHCP
3. Drop DFU defines

Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
3 years agocolibri_imx7: boot env configuration updates
Igor Opaniuk [Tue, 16 Jun 2020 19:20:10 +0000 (22:20 +0300)]
colibri_imx7: boot env configuration updates

1. Drop legacy emmcboot wrapper from env.
2. Change the "boot try" order. Default one is: SD -> eMMC -> USB -> DHCP
3. Drop DFU defines

Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
3 years agoapalis_imx6: boot env configuration updates
Igor Opaniuk [Tue, 16 Jun 2020 19:20:09 +0000 (22:20 +0300)]
apalis_imx6: boot env configuration updates

1. Drop legacy emmcboot wrapper from env.
2. Change the "boot try" order. Default one is: SD -> eMMC -> USB -> DHCP
3. Drop DFU defines

Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
3 years agotoradex: imx: enable BOOTCOUNT feature
Igor Opaniuk [Tue, 16 Jun 2020 19:20:08 +0000 (22:20 +0300)]
toradex: imx: enable BOOTCOUNT feature

This introduces automatic boot counter that increases after every
reset.After a power-on reset, it will be initialized with 1,
and each reboot will increment the value by 1. By default it's
disabled if bootlimit isn't set.

To enable this feature you have set bootcount limit ("bootlimit"),
alternate boot action ("altbootcmd") that will be performed if
the new value of bootcount exceeds the value of bootlimit, and
"upgrade_available" to let U-Boot automatically increase and save
the counter value after every reset:

> setenv bootlimit 5
> setenv upgrade_available 1
> setenv altbootcmd "bootm ..."

In case the bootlimit exceeds, the message will be shown and
albootcmd executed:
Warning: Bootlimit (5) exceeded. Using altbootcmd.

To reset bootcount run:
> bootcount reset

Print current value:
> bootcount print

Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
3 years agoapalis-tk1: fix setting fdtfile value
Igor Opaniuk [Tue, 16 Jun 2020 19:20:07 +0000 (22:20 +0300)]
apalis-tk1: fix setting fdtfile value

s/fdt-module/fdt_module/g, as we don't use dash in fdt_file anymore.

Fixes: 4c63a601("apalis-tk1: support v1.2 hardware revision")
Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
3 years agoapalis-tk1: enable distroboot
Igor Opaniuk [Tue, 16 Jun 2020 19:20:06 +0000 (22:20 +0300)]
apalis-tk1: enable distroboot

1. Use distro_bootcmd as default boot command instead of
legacy emmcboot wrapper.
2. Drop emmcboot and sdboot wrappers.
3. Provide proper boot order for Distro Boot.

Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
3 years agoconfigs/colibri_vf.h: drop sdboot in favour of distro_bootcmd
Max Krummenacher [Tue, 16 Jun 2020 19:20:05 +0000 (22:20 +0300)]
configs/colibri_vf.h: drop sdboot in favour of distro_bootcmd

The distro bootscript uses kernel_image to get the file name of
the kernel, so change that variable name.
UBI boot has precedence in the default boot command. If one wants
to boot from SD with a working NAND installation stop in U-Boot
and enter:

setenv fdtfile ${soc}-colibri-${fdt_board}.dtb && run distro_bootcmd

Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
3 years agocolibri_vf_defconfig: enable part cmd
Max Krummenacher [Tue, 16 Jun 2020 19:20:04 +0000 (22:20 +0300)]
colibri_vf_defconfig: enable part cmd

This allows to boot from SD/USB with passing the rootfs partition via UUID.

Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
3 years agocolibri-imx6ull/imx7: define bootubipart for distro boot
Stefan Agner [Tue, 16 Jun 2020 19:20:03 +0000 (22:20 +0300)]
colibri-imx6ull/imx7: define bootubipart for distro boot

When using distro boot to boot from UBI volumes the boot partition
has been hardcoded to "UBI" (capital letters). However, our default
MTD layout uses "ubi" (lower case letter). Define "ubi" as the
default UBI partition for distro boot for Toradex. This allows to
use distro boot without having to redefine the MTD partition layout
which is useful for TorizonCore.

Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
3 years agocolibri_imx7: add addresses required for distro boot
Stefan Agner [Tue, 16 Jun 2020 19:20:02 +0000 (22:20 +0300)]
colibri_imx7: add addresses required for distro boot

Define addresses required for full distro boot support.

Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
3 years agocolibri-imx8x: declare consoleargs
Oleksandr Suvorov [Tue, 16 Jun 2020 19:20:01 +0000 (22:20 +0300)]
colibri-imx8x: declare consoleargs

Store all console-related kernel parameters
in dedicated variable.

Signed-off-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>
3 years agoapalis/colibri-imx8: re-enable CONFIG_IMX_SCU_THERMAL
Max Krummenacher [Tue, 16 Jun 2020 19:20:00 +0000 (22:20 +0300)]
apalis/colibri-imx8: re-enable CONFIG_IMX_SCU_THERMAL

This got dropped by a global 'make savedefconfig' resync as
required patches are still in flight.

Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
3 years agoapalis-imx8: enable of_system_setup
Marcel Ziswiler [Tue, 16 Jun 2020 19:19:59 +0000 (22:19 +0300)]
apalis-imx8: enable of_system_setup

Enable CONFIG_OF_SYSTEM_DEFAULT for Apalis iMX8.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
3 years agoARM: dts: imx6qdl-sabresd: Fix AR8031 phy-mode
Fabio Estevam [Wed, 17 Jun 2020 17:33:16 +0000 (14:33 -0300)]
ARM: dts: imx6qdl-sabresd: Fix AR8031 phy-mode

As per kernel commit 0672d22a1924 ("ARM: dts: imx: Fix the AR803X phy-mode)
the correct phy-mode should be "rgmii-id", so fix it accordingly
to fix the Ethernet regression.

This problem has been exposed by commit:

commit 13114f38e2ccea9386726d8b9831dfc310589548
Author: Vladimir Oltean <vladimir.oltean@nxp.com>
Date:   Thu May 7 00:11:51 2020 +0200

    phy: atheros: Explicitly disable RGMII delays

    To eliminate any doubts about the out-of-reset value of the PHY, that
    the driver previously relied on.

    If bisecting shows that this commit breaks your board you probably have
    a wrong PHY interface mode. You probably want the
    PHY_INTERFACE_MODE_RGMII_RXID or PHY_INTERFACE_MODE_RGMII_ID mode.

Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
3 years agoARM: dts: imx6qdl-sabreauto: Fix AR8031 phy-mode
Fabio Estevam [Fri, 19 Jun 2020 01:14:42 +0000 (22:14 -0300)]
ARM: dts: imx6qdl-sabreauto: Fix AR8031 phy-mode

As per kernel commit 0672d22a1924 ("ARM: dts: imx: Fix the AR803X phy-mode)
the correct phy-mode should be "rgmii-id", so fix it accordingly
to fix the Ethernet regression.

This problem has been exposed by commit:

commit 13114f38e2ccea9386726d8b9831dfc310589548
Author: Vladimir Oltean <vladimir.oltean@nxp.com>
Date:   Thu May 7 00:11:51 2020 +0200

    phy: atheros: Explicitly disable RGMII delays

    To eliminate any doubts about the out-of-reset value of the PHY, that
    the driver previously relied on.

    If bisecting shows that this commit breaks your board you probably have
    a wrong PHY interface mode. You probably want the
    PHY_INTERFACE_MODE_RGMII_RXID or PHY_INTERFACE_MODE_RGMII_ID mode.

Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
Fix the phy-mode accordingly to fix the regression.

Signed-off-by: Fabio Estevam <festevam@gmail.com>
3 years agomx6cuboxi: Convert to DM_ETH
Fabio Estevam [Thu, 18 Jun 2020 23:21:20 +0000 (20:21 -0300)]
mx6cuboxi: Convert to DM_ETH

Migration to DM_ETH is mandatory, so convert mx6cuboxi to Ethernet
Driver Model.

This also brings the benefit of restoring Ethernet functionality.

Reported-by: Tom Rini <trini@konsulko.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Tom Rini <trini@konsulko.com>
3 years agoARM: dts: imx6qdl-sr-som: Sync with kernel 5.8-rc1
Fabio Estevam [Thu, 18 Jun 2020 23:21:19 +0000 (20:21 -0300)]
ARM: dts: imx6qdl-sr-som: Sync with kernel 5.8-rc1

Sync the device tree with 5.8-rc1.

It basically contains the following extra kernel commit:

commit 86b08bd5b99480b79a25343f24c1b8c4ddcb5c09
Author: Russell King <rmk+kernel@armlinux.org.uk>
Date:   Wed Apr 15 16:44:17 2020 +0100

    ARM: dts: imx6-sr-som: add ethernet PHY configuration

    Add ethernet PHY configuration ahead of removing the quirk that
    configures the clocking mode for the PHY.  The RGMII delay is
    already set correctly.

Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
Reviewed-by: Fabio Estevam <festevam@gmail.com>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
, which passes the 'qca,clk-out-frequency' property and it is important
to specify the correct frequency generated by the AR8035.

Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Tom Rini <trini@konsulko.com>
3 years agonet: fec: Allow the PHY node to be retrieved
Fabio Estevam [Thu, 18 Jun 2020 23:21:18 +0000 (20:21 -0300)]
net: fec: Allow the PHY node to be retrieved

As we move towards driver model, it is required to let the FEC driver
know how to properly deal with an Ethernet PHY subnode in the device tree.

For example:

 &fec {
  pinctrl-names = "default";
  pinctrl-0 = <&pinctrl_microsom_enet_ar8035>;
phy-handle = <&phy>;
  phy-mode = "rgmii-id";
  phy-reset-duration = <2>;
  phy-reset-gpios = <&gpio4 15 GPIO_ACTIVE_LOW>;
  status = "okay";

mdio {
#address-cells = <1>;
#size-cells = <0>;

phy: ethernet-phy@0 {
reg = <0>;
qca,clk-out-frequency = <125000000>;
};
};
 };

Currently the PHY node pointer is incorrectly associated with the
Ethernel controller instead of the PHY node itself.

This causes the PHY properties, such as "qca,clk-out-frequency" in
the example above to not get parsed.

Fix this problem by populating the phy_of_node node.

Suggested-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Tom Rini <trini@konsulko.com>
3 years agophy: atheros: ar8035: Fix clock output calculation
Fabio Estevam [Thu, 18 Jun 2020 23:21:17 +0000 (20:21 -0300)]
phy: atheros: ar8035: Fix clock output calculation

The clock ouput frequency is calculated incorrectly for AR8035 due to
wrong masking of priv->clk_25m_reg and priv->clk_25m_mask.

This same issue has been already fixed in the kernel by:

commit b1f4c209d84057b6d40b939b6e4404854271d797
Author: Oleksij Rempel <o.rempel@pengutronix.de>
Date:   Wed Apr 1 11:57:32 2020 +0200

    net: phy: at803x: fix clock sink configuration on ATH8030 and ATH8035

    The masks in priv->clk_25m_reg and priv->clk_25m_mask are one-bits-set
    for the values that comprise the fields, not zero-bits-set.

    This patch fixes the clock frequency configuration for ATH8030 and
    ATH8035 Atheros PHYs by removing the erroneous "~".

    To reproduce this bug, configure the PHY  with the device tree binding
    "qca,clk-out-frequency" and remove the machine specific PHY fixups.

    Fixes: 2f664823a47021 ("net: phy: at803x: add device tree binding")
Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
Reported-by: Russell King <rmk+kernel@armlinux.org.uk>
Reviewed-by: Russell King <rmk+kernel@armlinux.org.uk>
Tested-by: Russell King <rmk+kernel@armlinux.org.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
Apply the same fix in the U-Boot driver.

Tested on a i.MX6 Hummingboard.

Signed-off-by: Fabio Estevam <festevam@gmail.com>
Reviewed-by: Michael Walle <michael@walle.cc>
Tested-by: Tom Rini <trini@konsulko.com>
3 years agoMerge branch 'net' of https://gitlab.denx.de/u-boot/custodians/u-boot-sh into next
Tom Rini [Sat, 20 Jun 2020 22:52:51 +0000 (18:52 -0400)]
Merge branch 'net' of https://gitlab.denx.de/u-boot/custodians/u-boot-sh into next

- Convert pcnet and eepro100 ethernet drivers to DM

3 years agoMerge https://gitlab.denx.de/u-boot/custodians/u-boot-sh
Tom Rini [Sat, 20 Jun 2020 22:51:50 +0000 (18:51 -0400)]
Merge https://gitlab.denx.de/u-boot/custodians/u-boot-sh

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 'efi-2020-07-rc5-2' of https://gitlab.denx.de/u-boot/custodians/u-boot-efi
Tom Rini [Fri, 19 Jun 2020 18:22:23 +0000 (14:22 -0400)]
Merge tag 'efi-2020-07-rc5-2' of https://gitlab.denx.de/u-boot/custodians/u-boot-efi

Pull request for UEFI sub-system for efi-2020-07-rc5 (2)

Fix memory reservations: do not use random bytes from the stack.

3 years agoMerge tag 'u-boot-stm32-20200619' of https://gitlab.denx.de/u-boot/custodians/u-boot-stm
Tom Rini [Fri, 19 Jun 2020 16:41:24 +0000 (12:41 -0400)]
Merge tag 'u-boot-stm32-20200619' of https://gitlab.denx.de/u-boot/custodians/u-boot-stm

- fix SD card cart detect on DHCOM and ST boards

3 years agoMerge https://gitlab.denx.de/u-boot/custodians/u-boot-tegra
Tom Rini [Fri, 19 Jun 2020 16:41:05 +0000 (12:41 -0400)]
Merge https://gitlab.denx.de/u-boot/custodians/u-boot-tegra

3 years agoARM: dts: stm32: Reinstate card detect behavior on ST boards
Patrick Delaunay [Fri, 19 Jun 2020 09:19:45 +0000 (11:19 +0200)]
ARM: dts: stm32: Reinstate card detect behavior on ST boards

The cd-gpios with (GPIO_ACTIVE_LOW | GPIO_PULL_UP) gpio is thus far
unsupported, reinstate the old cd-gpios behavior until this handling
is fully implemented. This avoid potential issue for SDCard boot:
the card detect fails with floating gpio.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@st.com>
3 years agoARM: dts: stm32: Reinstate card detect behavior on DHSOM
Marek Vasut [Thu, 18 Jun 2020 18:35:17 +0000 (20:35 +0200)]
ARM: dts: stm32: Reinstate card detect behavior on DHSOM

The cd-gpios with (GPIO_ACTIVE_LOW | GPIO_PULL_UP) gpio is thus far
unsupported, reinstate the old cd-gpios behavior until this handling
is fully implemented. This permits the DHSOM to boot from SD again,
without this patch the card detect fails.

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>
3 years agocmd: bootefi: Honor the address & size cells properties correctly
Atish Patra [Fri, 19 Jun 2020 01:51:50 +0000 (18:51 -0700)]
cmd: bootefi: Honor the address & size cells properties correctly

fdtdec_get_addr_size reads the uses a fixed value for address & size
cell properties which may not be correct always.

Use the auto variant of the function which automatically reads
 #address-cells & #size-cells from parent and uses to read the "reg"
property.

Signed-off-by: Atish Patra <atish.patra@wdc.com>
On 32 bit systems fdt_addr_t may be 4 bytes long but size is defined as
u64. Avoid filling the upper 4 bytes of the sizep parameter of
fdtdec_get_addr_size_auto_parent() with random bytes from the stack by
defining a separate variable fdt_size.

Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
3 years agot210: Nano: Add NVME support
Tom Warren [Mon, 11 May 2020 23:38:58 +0000 (16:38 -0700)]
t210: Nano: Add NVME support

This allows Nano to use the key M.2 on the CVB to connect and use a M.2
NVMe SSD stick. Works on my Nano B00, WD SN750 NVMe SSD shows up
w/'nvme' commands. Will add booting from NVMe via distro cmds in a future
patch.

Signed-off-by: Tom Warren <twarren@nvidia.com>
3 years agoMerge tag 'fixes-for-v2020.07-rc4' of https://gitlab.denx.de/u-boot/custodians/u...
Tom Rini [Thu, 18 Jun 2020 22:00:05 +0000 (18:00 -0400)]
Merge tag 'fixes-for-v2020.07-rc4' of https://gitlab.denx.de/u-boot/custodians/u-boot-video

- fix stdout in default environment for apalis_imx6, colibri_imx6
  and cm_fx6 boards

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 agocolibri_t20: change maintainer
Igor Opaniuk [Mon, 13 Apr 2020 15:11:42 +0000 (18:11 +0300)]
colibri_t20: change maintainer

Take over maintainership for Colibri T20 module.

Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
Acked-by: Lucas Stach <dev@lynxeye.de>
3 years agoARM: tegra: Enable PSCI support for Tegra210 and Tegra186
Jon Hunter [Thu, 18 Jun 2020 11:54:39 +0000 (12:54 +0100)]
ARM: tegra: Enable PSCI support for Tegra210 and Tegra186

The PSCI nodes are currently not populated for the Tegra210 and Tegra186
devices. This prevents the PSCI driver from being able to identify the
PSCI method used by these devices and causes the probe of the PSCI
driver to fail.

Since commit 81ea00838c68 ("efi_loader: PSCI reset and shutdown") was
added, which moves the PSCI EFI system reset handler into the PSCI
driver, this has prevented the EFI system reset from working for
Tegra210 and Tegra186. Therefore, populating these nodes is necessary
to fix the EFI system reset for Tegra210 and Tegra186.

Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Tested-by: Peter Robinson <pbrobinson@gmail.com>
3 years agofirmware: PSCI: Fix PSCI support for OF live trees
Jon Hunter [Thu, 18 Jun 2020 11:54:38 +0000 (12:54 +0100)]
firmware: PSCI: Fix PSCI support for OF live trees

When CONFIG_OF_LIVE is enabled, dev_of_offset() cannot be used and
if used returns an invalid offset. This causes the call to
fdt_stringlist_get() in the psci_probe() to fail to read the 'method'
property from the PSCI node for the device and hence prevents PSCI
from working. Fix this by using the ofnode_read_string() API instead
of the fdt_stringlist_get() because this will handle reading the
property both when CONFIG_OF_LIVE is enabled or disabled.

Due to the above problem and since commit 81ea00838c68 ("efi_loader:
PSCI reset and shutdown") was added, the EFI system reset has been
broken for Tegra210 and Tegra196 platforms. This also fixes the EFI
system reset for these Tegra platforms.

Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Tested-by: Peter Robinson <pbrobinson@gmail.com>
3 years agoAzure/GitLab: Move to latest Docker image
Tom Rini [Thu, 18 Jun 2020 17:51:39 +0000 (13:51 -0400)]
Azure/GitLab: Move to latest Docker image

- Add guestfstools, efitools
- Latest Ubuntu/bionic snapshot

Signed-off-by: Tom Rini <trini@konsulko.com>
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 agoARM: rmobile: Increase PHY auto-negotiation timeout to 20s
Marek Vasut [Sun, 14 Jun 2020 12:41:07 +0000 (14:41 +0200)]
ARM: rmobile: Increase PHY auto-negotiation timeout to 20s

The ethernet PHY on all known Gen3 boards takes a while to come out
of reset, increase the auto-negotiation timeout to prevent it from
timing out in case the ethernet is used right after the board was
reset.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
3 years agonet: pcnet: Add Kconfig entries
Marek Vasut [Sun, 17 May 2020 16:14:17 +0000 (18:14 +0200)]
net: pcnet: Add Kconfig entries

Add Kconfig entries for the pcnet driver and convert MIPS malta
to use those.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Cc: Joe Hershberger <joe.hershberger@ni.com>
3 years agonet: pcnet: Add DM support
Marek Vasut [Sun, 17 May 2020 15:43:22 +0000 (17:43 +0200)]
net: pcnet: Add DM support

With all the changes in place, add support for DM into the
pcnet driver.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Cc: Joe Hershberger <joe.hershberger@ni.com>
3 years agonet: pcnet: Split common and non-DM functions
Marek Vasut [Sun, 17 May 2020 15:28:31 +0000 (17:28 +0200)]
net: pcnet: Split common and non-DM functions

Pull the common parts of functions out so they can be reused by both
DM and non-DM code paths. The recv() function had to be reworked to
fit into this scheme and this means it now only receives one packet
at a time instead of spinning in an endless loop.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Cc: Joe Hershberger <joe.hershberger@ni.com>
3 years agonet: pcnet: Wrap name and enetaddr into private data
Marek Vasut [Sun, 17 May 2020 15:04:19 +0000 (17:04 +0200)]
net: pcnet: Wrap name and enetaddr into private data

Instead of using the non-DM-only name and enetaddr in struct eth_device,
add pointers into the private data which can either point to that non-DM
name or a DM one later on.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Cc: Joe Hershberger <joe.hershberger@ni.com>
3 years agonet: pcnet: Wrap iobase into private data
Marek Vasut [Sun, 17 May 2020 15:00:42 +0000 (17:00 +0200)]
net: pcnet: Wrap iobase into private data

Instead of using the non-DM-only iobase in struct eth_device, add
one into the private data to make DM and non-DM operation possible.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Cc: Joe Hershberger <joe.hershberger@ni.com>
3 years agonet: pcnet: Pass private data through dev->priv
Marek Vasut [Sun, 17 May 2020 14:47:07 +0000 (16:47 +0200)]
net: pcnet: Pass private data through dev->priv

Get rid of the global point to private data, and rather pass it
thought dev->priv. Also remove the unnecessary check for lp being
non-NULL, since it is always NULL at this point.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Cc: Joe Hershberger <joe.hershberger@ni.com>
3 years agonet: pcnet: Wrap devbusfn into private data
Marek Vasut [Sun, 17 May 2020 14:31:04 +0000 (16:31 +0200)]
net: pcnet: Wrap devbusfn into private data

Instead of using eth_device priv for this PCI devbusfn, free it
so it could be used for driver private data, and wrap devbusfn
into those driver private data.

Note that using the name dev for the variable is a trick left for
later, when DM support is in place, so dm_pci_virt_to_mem() can be
used with minimal ifdeffery.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Cc: Joe Hershberger <joe.hershberger@ni.com>
3 years agonet: pcnet: Drop useless forward declarations
Marek Vasut [Sun, 17 May 2020 14:28:41 +0000 (16:28 +0200)]
net: pcnet: Drop useless forward declarations

Remove those as they are not needed anymore.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Cc: Joe Hershberger <joe.hershberger@ni.com>
3 years agonet: pcnet: Move initialize function at the end
Marek Vasut [Sun, 17 May 2020 14:31:41 +0000 (16:31 +0200)]
net: pcnet: Move initialize function at the end

Move the function at the end of the driver, so we could drop
various forward declarations later. No functional change.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Cc: Joe Hershberger <joe.hershberger@ni.com>
3 years agonet: pcnet: Move private data allocation to initialize
Marek Vasut [Sun, 17 May 2020 14:26:00 +0000 (16:26 +0200)]
net: pcnet: Move private data allocation to initialize

The private data allocation does not have to be done every time the
NIC is initialized at run time, move the allocation to initialize
function, which means it will be done only once when the driver
starts.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Cc: Joe Hershberger <joe.hershberger@ni.com>
3 years agonet: pcnet: Replace memset+malloc with calloc
Marek Vasut [Sun, 17 May 2020 14:26:57 +0000 (16:26 +0200)]
net: pcnet: Replace memset+malloc with calloc

This combination of functions can be replaced with calloc(),
make it so.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Cc: Joe Hershberger <joe.hershberger@ni.com>
3 years agonet: pcnet: Simplify private data allocation
Marek Vasut [Sun, 17 May 2020 14:16:45 +0000 (16:16 +0200)]
net: pcnet: Simplify private data allocation

The current code is horribly complex. Both the RX and TX buffer
descriptors are 16 bytes in size, the init block is 32 bytes in
size, so simplify the code such that the entire private data of
the driver are allocated cache aligned and the RX and TX buffer
descriptors are part of the private data.

This removes multiple malloc calls and cache flushes.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Cc: Joe Hershberger <joe.hershberger@ni.com>
3 years agonet: pcnet: Use PCI_DEVICE() to define PCI device compat list
Marek Vasut [Sun, 17 May 2020 15:33:17 +0000 (17:33 +0200)]
net: pcnet: 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: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Cc: Joe Hershberger <joe.hershberger@ni.com>
3 years agonet: pcnet: Drop PCNET_HAS_PROM
Marek Vasut [Sun, 17 May 2020 16:12:19 +0000 (18:12 +0200)]
net: pcnet: Drop PCNET_HAS_PROM

All of one PCNET users has this option set, make this default
and drop this config option.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Cc: Joe Hershberger <joe.hershberger@ni.com>
3 years agonet: pcnet: Drop typedef struct pcnet_priv_t
Marek Vasut [Sun, 17 May 2020 13:10:41 +0000 (15:10 +0200)]
net: pcnet: Drop typedef struct pcnet_priv_t

Use struct pcnet_priv all over the place instead.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Cc: Joe Hershberger <joe.hershberger@ni.com>
3 years agonet: eepro100: Add Kconfig entries
Marek Vasut [Sat, 23 May 2020 16:07:53 +0000 (18:07 +0200)]
net: eepro100: Add Kconfig entries

Add Kconfig entries for the eepro100 driver and convert various boards.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
3 years agonet: eepro100: Add DM support
Marek Vasut [Sat, 23 May 2020 14:26:20 +0000 (16:26 +0200)]
net: eepro100: Add DM support

Add support for driver model to the driver.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
3 years agonet: eepro100: Split common parts of non-DM functions out
Marek Vasut [Sat, 23 May 2020 15:28:20 +0000 (17:28 +0200)]
net: eepro100: Split common parts of non-DM functions out

Split the common code from the non-DM code, so it can be reused by
the DM code later. As always, the recv() function had to be split
into the actual receiving part and free_pkt part to fit with the
DM.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
3 years agonet: eepro100: Drop bd_t pointer from read_hw_addr()
Marek Vasut [Sat, 23 May 2020 15:20:39 +0000 (17:20 +0200)]
net: eepro100: Drop bd_t pointer from read_hw_addr()

The pointer is unused, so drop it. Rename the function to start
with the eepro100_ prefix.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
3 years agonet: eepro100: Add RX/TX rings into the private data
Marek Vasut [Sat, 23 May 2020 15:13:26 +0000 (17:13 +0200)]
net: eepro100: Add RX/TX rings into the private data

The RX/TX DMA descriptor rings are per-device-instance private data,
so move them into the private data.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
3 years agonet: eepro100: Pass device private data into mdiobus
Marek Vasut [Sat, 23 May 2020 15:55:50 +0000 (17:55 +0200)]
net: eepro100: Pass device private data into mdiobus

Instead of doing ethernet device lookup by name every time there
is an MDIO access, pass the driver private data via mdiobus priv
to the MDIO bus accessors.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
3 years agonet: eepro100: Pass device private data around
Marek Vasut [Sat, 23 May 2020 15:10:03 +0000 (17:10 +0200)]
net: eepro100: Pass device private data around

This patch replaces the various uses of struct eth_device for accessing
device private data with struct eepro100_priv, which is compatible both
with DM and non-DM operation.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
3 years agonet: eepro100: Introduce device private data
Marek Vasut [Sat, 23 May 2020 14:49:07 +0000 (16:49 +0200)]
net: eepro100: Introduce device private data

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
3 years agonet: eepro100: Pass PCI BDF into bus_to_phys()/phys_to_bus()
Marek Vasut [Sat, 23 May 2020 14:38:41 +0000 (16:38 +0200)]
net: eepro100: Pass PCI BDF into bus_to_phys()/phys_to_bus()

This is a trick in preparation for adding DM support. By passing in
the PCI BDF into the bus_to_phys()/phys_to_bus() macros and calling
that dev, we can substitute dev with udevice when DM support lands
and do minor adjustment to the macros to support both DM and non-DM
operation. No functional change.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
3 years agonet: eepro100: Drop inline keyword
Marek Vasut [Sat, 23 May 2020 14:27:37 +0000 (16:27 +0200)]
net: eepro100: Drop inline keyword

Drop the inline keyword from the static functions, the compiler has a
much better overview and can decide how to inline those functions much
better.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
3 years agonet: eepro100: Fix EE_*_CMD macros
Marek Vasut [Sat, 23 May 2020 14:23:28 +0000 (16:23 +0200)]
net: eepro100: Fix EE_*_CMD macros

Those macros depended on specific variable names to be declared
at their usage sites, fix this by adding an argument to those
macros and also protect the argument with braces.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
3 years agonet: eepro100: Factor out MII registration
Marek Vasut [Sat, 23 May 2020 14:20:25 +0000 (16:20 +0200)]
net: eepro100: Factor out MII registration

Pull the MII registration code into a separate function. Moreover,
properly free memory in case any of the registration or allocation
functions fail, so this fixes an existing memleak.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
3 years agonet: eepro100: Switch from malloc()+memset() to calloc()
Marek Vasut [Sat, 23 May 2020 14:13:30 +0000 (16:13 +0200)]
net: eepro100: 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>
3 years agonet: eepro100: Use PCI_DEVICE() to define PCI device compat list
Marek Vasut [Sat, 23 May 2020 13:11:30 +0000 (15:11 +0200)]
net: eepro100: 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>
3 years agonet: eepro100: Reorder functions in the driver
Marek Vasut [Sat, 23 May 2020 13:07:30 +0000 (15:07 +0200)]
net: eepro100: Reorder functions in the driver

Move the functions around in the driver to prepare it for DM conversion.
Drop forward declarations which are not necessary anymore. No functional
change.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
3 years agonet: eepro100: Remove volatile misuse
Marek Vasut [Sat, 23 May 2020 13:02:47 +0000 (15:02 +0200)]
net: eepro100: Remove volatile misuse

Remove all the remaining use of the 'volatile' keyword, as this is
no longer required. All the accesses which might have needed this
use of 'volatile' have been repaired properly.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
3 years agonet: eepro100: Add cache management
Marek Vasut [Sat, 23 May 2020 12:55:26 +0000 (14:55 +0200)]
net: eepro100: Add cache management

Add cache invalidation and flushes wherever the DMA descriptors are
written or read, otherwise this driver cannot work reliably on any
systems where caches are enabled.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
3 years agonet: eepro100: Factor out tx_ring command issuing
Marek Vasut [Sat, 23 May 2020 12:30:31 +0000 (14:30 +0200)]
net: eepro100: Factor out tx_ring command issuing

This code is replicated in the driver thrice almost verbatim, factor
it out into a separate function and clean it up. No functional change.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
3 years agonet: eepro100: Replace purge_tx_ring() with memset()
Marek Vasut [Sat, 23 May 2020 12:26:16 +0000 (14:26 +0200)]
net: eepro100: Replace purge_tx_ring() with memset()

This function zeroes-out all the descriptors in the TX ring,
use memset() instead.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
3 years agonet: eepro100: Use standard I/O accessors
Marek Vasut [Sat, 23 May 2020 12:14:45 +0000 (14:14 +0200)]
net: eepro100: Use standard I/O accessors

The current eepro100 driver accesses its memory mapped registers directly
instead of using the standard I/O accessors. This can cause problems on
some systems as the accesses can get out of order. So convert the direct
volatile dereferences to use the normal in/out macros.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
3 years agonet: eepro100: Fix camelcase
Marek Vasut [Sat, 23 May 2020 11:52:50 +0000 (13:52 +0200)]
net: eepro100: Fix camelcase

This is automated cleanup via checkpatch, no functional change.
./scripts/checkpatch.pl --show-types -f drivers/net/eepro100.c
./scripts/checkpatch.pl --types INDENTED_LABEL -f --fix --fix-inplace drivers/net/eepro100.c

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
3 years agonet: eepro100: Fix remaining checkpatch issues
Marek Vasut [Sat, 23 May 2020 11:45:41 +0000 (13:45 +0200)]
net: eepro100: Fix remaining checkpatch issues

This is automated cleanup via checkpatch, no functional change.
./scripts/checkpatch.pl --show-types -f drivers/net/eepro100.c
./scripts/checkpatch.pl -f --fix --fix-inplace drivers/net/eepro100.c

This fixes all the remaining errors except a couple of comments which
are longer than 80 characters, all the volatile misuse and all the
camelcase, that needs a separate patch.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
3 years agonet: eepro100: Fix indented label
Marek Vasut [Sat, 23 May 2020 11:26:50 +0000 (13:26 +0200)]
net: eepro100: Fix indented label

This is automated cleanup via checkpatch, no functional change.
./scripts/checkpatch.pl --show-types -f drivers/net/eepro100.c
./scripts/checkpatch.pl --types INDENTED_LABEL -f --fix --fix-inplace drivers/net/eepro100.c

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
3 years agonet: eepro100: Fix pointer location
Marek Vasut [Sat, 23 May 2020 11:23:13 +0000 (13:23 +0200)]
net: eepro100: Fix pointer location

This is automated cleanup via checkpatch, no functional change.
./scripts/checkpatch.pl --show-types -f drivers/net/eepro100.c
./scripts/checkpatch.pl --types POINTER_LOCATION -f --fix --fix-inplace drivers/net/eepro100.c

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
3 years agonet: eepro100: Fix parenthesis alignment
Marek Vasut [Sat, 23 May 2020 11:21:43 +0000 (13:21 +0200)]
net: eepro100: Fix parenthesis alignment

This is automated cleanup via checkpatch, no functional change.
./scripts/checkpatch.pl --show-types -f drivers/net/eepro100.c
./scripts/checkpatch.pl --types PARENTHESIS_ALIGNMENT -f --fix --fix-inplace drivers/net/eepro100.c

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>