oweals/u-boot.git
4 years agoMerge tag 'ti-v2020.07-rc1' of https://gitlab.denx.de/u-boot/custodians/u-boot-ti
Tom Rini [Mon, 20 Apr 2020 15:14:22 +0000 (11:14 -0400)]
Merge tag 'ti-v2020.07-rc1' of https://gitlab.denx.de/u-boot/custodians/u-boot-ti

- Fix boot on am335x guardian board
- Increase OPSI speed on AM65x and J721E devices
- Use JTAD register for identifying K3 devices.
- Update TI entry in MAINTAINERS file.

4 years agoMerge branch 'master' of https://gitlab.denx.de/u-boot/custodians/u-boot-imx
Tom Rini [Mon, 20 Apr 2020 12:45:27 +0000 (08:45 -0400)]
Merge branch 'master' of https://gitlab.denx.de/u-boot/custodians/u-boot-imx

4 years agoarm: mach-k3: Use JTAD_ID register for device identification
Lokesh Vutla [Fri, 17 Apr 2020 08:13:53 +0000 (13:43 +0530)]
arm: mach-k3: Use JTAD_ID register for device identification

JTAG ID register is defined by IEEE 1149.1 for device identification.
Use this JTAG ID register for identifying AM65x[0] and J721E[1] devices
instead of using SoC specific registers.

[0] http://www.ti.com/lit/ug/spruid7e/spruid7e.pdf
[1] http://www.ti.com/lit/ug/spruil1a/spruil1a.pdf

Reported-by: Grygorii Strashko <grygorii.strashko@ti.com>
Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
4 years agoAdd support for i.MXRT1020-EVK board
Giulio Benetti [Tue, 18 Feb 2020 19:02:55 +0000 (20:02 +0100)]
Add support for i.MXRT1020-EVK board

Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
Reviewed-by: Lukasz Majewski <lukma@denx.de>
4 years agodt-bindings: pinctrl: add i.MXRT1020 pins definition
Giulio Benetti [Tue, 18 Feb 2020 19:02:54 +0000 (20:02 +0100)]
dt-bindings: pinctrl: add i.MXRT1020 pins definition

Add i.MXRT1020 pins definition.

Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
4 years agoARM: dts: imxrt1020: add dtsi file
Giulio Benetti [Tue, 18 Feb 2020 19:02:53 +0000 (20:02 +0100)]
ARM: dts: imxrt1020: add dtsi file

Add dtsi file for i.MXRT1020.

Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
Reviewed-by: Lukasz Majewski <lukma@denx.de>
4 years agoAdd i.MXRT1020 support
Giulio Benetti [Tue, 18 Feb 2020 19:02:52 +0000 (20:02 +0100)]
Add i.MXRT1020 support

Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
Reviewed-by: Lukasz Majewski <lukma@denx.de>
4 years agoclk: imx: add i.IMXRT1020 clk driver
Giulio Benetti [Tue, 18 Feb 2020 19:02:51 +0000 (20:02 +0100)]
clk: imx: add i.IMXRT1020 clk driver

Add i.MXRT1020 clk driver support.

Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
Reviewed-by: Lukasz Majewski <lukma@denx.de>
4 years agoimx: pmic: Set proper pmic name for iMX53 HSC|DDC boards
Lukasz Majewski [Wed, 26 Feb 2020 11:37:02 +0000 (12:37 +0100)]
imx: pmic: Set proper pmic name for iMX53 HSC|DDC boards

After the
commit 4213609cc7fb ("drivers: core: use strcmp when find device by name")
the exact DTS node name for PMIC device must be provided.

This patch fixes this issue by providing full DTS node name ('mc34708@8').

Signed-off-by: Lukasz Majewski <lukma@denx.de>
Reviewed-by: Jaehoon Chug <jh80.chung@samsung.com>
4 years agoconfig: imx: Enable CONFIG_PHY_FIXED on HSC and DDC i.MX53 boards
Lukasz Majewski [Wed, 26 Feb 2020 11:37:01 +0000 (12:37 +0100)]
config: imx: Enable CONFIG_PHY_FIXED on HSC and DDC i.MX53 boards

The CONFIG_PHY_FIXED is necessary to allow DSA switch work in U-Boot after
the
commit 3bf135b6c367 ("drivers: net: phy: Ignore PHY ID 0 during PHY probing").

This particular device - LAN9303 - returns phy_id == 0. With
CONFIG_PHY_FIXED enabled HSC and DDC boards work again with the same U-Boot
binary.

Signed-off-by: Lukasz Majewski <lukma@denx.de>
4 years agodts: imx: Add fixed-link property to HSC and DDC (imx53) devices
Lukasz Majewski [Wed, 26 Feb 2020 11:37:00 +0000 (12:37 +0100)]
dts: imx: Add fixed-link property to HSC and DDC (imx53) devices

Those two boards are supposed to be run with a single u-boot binary.
There are notable differences though - HSC uses DSA switch (which
phy_id == 0x0) and DCC (DP83848C).

After the commit 3bf135b6c367
("drivers: net: phy: Ignore PHY ID 0 during PHY probing") the PHY devices
with phy_id == 0 are not created in U-Boot anymore. This caused regression
on HSC.

To fix this problem - the fec's 'fixed-link' node has been introduced and
the phy_id is not assessed anymore. This approach works on both boards.

Signed-off-by: Lukasz Majewski <lukma@denx.de>
4 years agoARM: imx6: DHCOM i.MX6 PDK: Fix usb-otg VBUS regulator
Harald Seiler [Thu, 16 Apr 2020 08:52:19 +0000 (10:52 +0200)]
ARM: imx6: DHCOM i.MX6 PDK: Fix usb-otg VBUS regulator

During the conversion of this board to DM_REGULATOR, usb-mass-storage
was broken and started failing with the following error:

        => ums 0 mmc 2
        UMS: LUN 0, dev 2, hwpart 0, sector 0x0, count 0xe90000
        Error enabling VBUS supply
        g_dnl_register: failed!, error: -38
        g_dnl_register failed

Fix this by adding the relevant GPIO to the regulator node.

Fixes: 4ca99fe81aea ("ARM: imx: dh-imx6: Enable DM regulator")
Signed-off-by: Harald Seiler <hws@denx.de>
4 years agoARM: imx6: DHCOM i.MX6 PDK: Convert to DM_ETH
Harald Seiler [Wed, 15 Apr 2020 18:04:53 +0000 (20:04 +0200)]
ARM: imx6: DHCOM i.MX6 PDK: Convert to DM_ETH

Use DM_ETH instead of legacy networking.  Add VIO as a fixed regulator
to the relevant device-trees and augment the FEC node with properties
for the reset GPIO.

It should be noted that the relevant properties for the reset GPIO
already exist in the PHY node (reset-gpios, reset-delay-us,
reset-post-delay-us) but U-Boot currently ignores those and only
supports the bus-level reset properties in the FEC node
(phy-reset-gpios, phy-reset-duration, phy-reset-post-delay).

Signed-off-by: Harald Seiler <hws@denx.de>
4 years agowandboard: Print the board version in board_late_init()
Fabio Estevam [Fri, 17 Apr 2020 12:27:13 +0000 (09:27 -0300)]
wandboard: Print the board version in board_late_init()

Since CONFIG_DISPLAY_BOARDINFO_LATE is no longer used,  the checkboard()
function is no longer called.

As it is useful to print the board revision, print it inside
board_late_init() instead.

Also, to avoid GPIO errors related to using a GPIO without requesting it,
move the gpio_request(REV_DETECTION, "REV_DETECT") call prior to its
usage.

Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Heiko Schocher <hs@denx.de>
4 years agowandboard: Remove CONFIG_DISPLAY_BOARDINFO_LATE
Fabio Estevam [Fri, 17 Apr 2020 12:27:12 +0000 (09:27 -0300)]
wandboard: Remove CONFIG_DISPLAY_BOARDINFO_LATE

Since we are using revD1 device tree for all board revisions, the
following can be seen on a revB1 board:

Model: Wandboard i.MX6 Quad Board revD1
Board: Wandboard rev B1

To avoid such confusing messages, disable CONFIG_DISPLAY_BOARDINFO_LATE.

Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Heiko Schocher <hs@denx.de>
4 years agowandboard: Do not print error when PMIC is not present
Fabio Estevam [Fri, 17 Apr 2020 12:27:11 +0000 (09:27 -0300)]
wandboard: Do not print error when PMIC is not present

On wandboard variants prior to revD1, there is no PMIC populated, so
do not print an error when the reading of the device ID register fails.

Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Heiko Schocher <hs@denx.de>
4 years agopmic: pfuze100: Change error message level to debug
Fabio Estevam [Fri, 17 Apr 2020 12:27:10 +0000 (09:27 -0300)]
pmic: pfuze100: Change error message level to debug

In some cases U-Boot runs the same binary on different board versions.

In wandboard, for example, there are versions with the PFUZE100 PMIC
populated and others without it.

When the PMIC is not present, it is not really useful to get PMIC error,
so change the error message level to debug instead.

Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Heiko Schocher <hs@denx.de>
4 years agowandboard: Fix version detection for mx6q/mx6dl revD1
Fabio Estevam [Fri, 17 Apr 2020 12:27:09 +0000 (09:27 -0300)]
wandboard: Fix version detection for mx6q/mx6dl revD1

The detection of the revD1 version is based on the presence of the PMIC.

Currently revb1 device trees are used for mx6q/mx6dl variants, which
do not have the PMIC nodes.

This causes revD1 boards to be incorrectly be detected as revB1.

Fix this issue by using the revd1 device trees, so that the PMIC node can be
found and then the PMIC can be detected by reading its register ID.

Imported the revd1 device trees from mainline kernel version 5.7-rc1.

Reported-by: Heiko Schocher <hs@denx.de>
Reported-by: Derek Atkins <derek@ihtfp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Derek Atkins <derek@ihtfp.com>
Tested-by: Heiko Schocher <hs@denx.de>
Tested-by: Peter Robinson <pbrobinson@gmail.com>
4 years agoconfigs: imxrt1050-evk: temporary disable DCACHE
Giulio Benetti [Wed, 8 Apr 2020 15:11:08 +0000 (17:11 +0200)]
configs: imxrt1050-evk: temporary disable DCACHE

mxsfb needs a dcache function not implemented in cortex-M7, so for the
moment let's keep dcache not enabled.

Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
Reviewed-by: Anatolij Gustschin <agust@denx.de>
4 years agoconfigs: imxrt1050-evk: enable video support/console
Giulio Benetti [Wed, 8 Apr 2020 15:11:07 +0000 (17:11 +0200)]
configs: imxrt1050-evk: enable video support/console

Enable DM_VIDEO subsystem and its BACKLIGHT_GPIO. Then enable
SYS_WHITE_ON_BLACK to have classic black background on display. Need
also to enable CONFIG_SYS_CONSOLE_ENV_OVERWRITE to retrieve
stdin/stdout/stderr from CONFIG_EXTRA_ENV_SETTINGS.

Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
Reviewed-by: Anatolij Gustschin <agust@denx.de>
4 years agoarch: arm: dts: imxrt1050-evk: add lcdif node
Giulio Benetti [Wed, 8 Apr 2020 15:11:06 +0000 (17:11 +0200)]
arch: arm: dts: imxrt1050-evk: add lcdif node

Add lcdif node and its pinctrl.

Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
Reviewed-by: Anatolij Gustschin <agust@denx.de>
4 years agoARM: dts: imxrt1050: allow this dtsi file to be compiled in Linux
Giulio Benetti [Wed, 8 Apr 2020 15:11:05 +0000 (17:11 +0200)]
ARM: dts: imxrt1050: allow this dtsi file to be compiled in Linux

Linux doesn't provide skeleton.dtsi file so let's remove its include and
provide #address-cells/size-cells = <1> that were defined in
skeleton.dtsi before.

Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
Reviewed-by: Anatolij Gustschin <agust@denx.de>
4 years agoARM: dts: i.mxrt1050: add lcdif node
Giulio Benetti [Wed, 8 Apr 2020 15:10:21 +0000 (17:10 +0200)]
ARM: dts: i.mxrt1050: add lcdif node

Add lcdif node to SoC.

Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
Reviewed-by: Anatolij Gustschin <agust@denx.de>
4 years agoimxrt1050_evk: add 16bpp video support if video layer enabled
Giulio Benetti [Wed, 8 Apr 2020 15:10:20 +0000 (17:10 +0200)]
imxrt1050_evk: add 16bpp video support if video layer enabled

i.MXRT1050 provides mxsfb compatible lcd controller, so let's enable
video mxsfb driver with 16bpp depth if CONFIG_DM_VIDEO is selected since
board has 16bpp only connection.

Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
Reviewed-by: Anatolij Gustschin <agust@denx.de>
4 years agovideo: mxsfb: enable setting ENABLE negative polarity
Giulio Benetti [Wed, 8 Apr 2020 15:10:19 +0000 (17:10 +0200)]
video: mxsfb: enable setting ENABLE negative polarity

ENABLE signal can now be flipped by writing its bitmask on vdctrl0
register.

Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
Reviewed-by: Anatolij Gustschin <agust@denx.de>
4 years agovideo: mxsfb: enable setting PIXDATA on negative edge
Giulio Benetti [Wed, 8 Apr 2020 15:10:18 +0000 (17:10 +0200)]
video: mxsfb: enable setting PIXDATA on negative edge

DOTCLK signal can now be flipped by writing its bitmask on vdctrl0
register.

Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
Reviewed-by: Anatolij Gustschin <agust@denx.de>
4 years agovideo: mxsfb: enable setting VSYNC negative polarity
Giulio Benetti [Wed, 8 Apr 2020 15:10:17 +0000 (17:10 +0200)]
video: mxsfb: enable setting VSYNC negative polarity

VSYNC signal can now be flipped by writing its bitmask on vdctrl0
register.

Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
Reviewed-by: Anatolij Gustschin <agust@denx.de>
4 years agovideo: mxsfb: enable setting HSYNC negative polarity
Giulio Benetti [Wed, 8 Apr 2020 15:10:16 +0000 (17:10 +0200)]
video: mxsfb: enable setting HSYNC negative polarity

HSYNC signal can now be flipped according to display_flags bitmaks by
writing its bitmask on vdctrl0 register.

Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
Reviewed-by: Anatolij Gustschin <agust@denx.de>
4 years agovideo: mxsfb: refactor for using display_timings
Giulio Benetti [Wed, 8 Apr 2020 15:10:15 +0000 (17:10 +0200)]
video: mxsfb: refactor for using display_timings

struct display_timings provides more informations such clock and DE
polarity, so let's refactor the code to use struct display_timings
instead of struct ctfb_res_modes, so we'll become able to get clock and
DE polarity settings and set register according to them in the next patch.

Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
Reviewed-by: Anatolij Gustschin <agust@denx.de>
4 years agovideo: mxsfb: add support for i.MXRT
Giulio Benetti [Wed, 8 Apr 2020 15:10:14 +0000 (17:10 +0200)]
video: mxsfb: add support for i.MXRT

Add support for i.MXRT by adding CONFIG_IMXRT in register structure and
adding .compatible = "fsl,imxrt-lcdif".

Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
Reviewed-by: Anatolij Gustschin <agust@denx.de>
4 years agovideo: mxsfb: add support for DM CLK
Giulio Benetti [Wed, 8 Apr 2020 15:10:13 +0000 (17:10 +0200)]
video: mxsfb: add support for DM CLK

Allow using DM CLK instead of mxs_set_lcdclk() so we can avoid to
implement a special function to set lcd clock on i.MXRT.

Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
Reviewed-by: Anatolij Gustschin <agust@denx.de>
4 years agosunxi: display: use common video_ctfb_mode_to_display_timing()
Giulio Benetti [Wed, 8 Apr 2020 15:10:12 +0000 (17:10 +0200)]
sunxi: display: use common video_ctfb_mode_to_display_timing()

Since video_ctfb_mode_to_display_timing() has been implemented by moving
sunxi_ctfb_mode_to_display_timing() to video_modes.c and it's meant to be
used by other video subsystem, let's use it instead of local
sunxi_ctfb_mode_to_display_timing().

Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
Reviewed-by: Anatolij Gustschin <agust@denx.de>
4 years agovideomodes: add helper function to convert from ctfb to display_timing
Giulio Benetti [Wed, 8 Apr 2020 15:10:11 +0000 (17:10 +0200)]
videomodes: add helper function to convert from ctfb to display_timing

This function converts from "struct ctf_res_modes" to
"struct display_timing".

Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
Reviewed-by: Anatolij Gustschin <agust@denx.de>
4 years agoclk: imx: clk-imxrt1050: add set_parent() callback
Giulio Benetti [Wed, 8 Apr 2020 15:10:10 +0000 (17:10 +0200)]
clk: imx: clk-imxrt1050: add set_parent() callback

Need to add set_parent() callback to allow dts assigned-clock-parents to
work so let's add it accordingly.

Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
4 years agoclk: imx: clk-imxrt1050: setup PLL5 for video in non-SPL
Giulio Benetti [Wed, 8 Apr 2020 15:10:09 +0000 (17:10 +0200)]
clk: imx: clk-imxrt1050: setup PLL5 for video in non-SPL

mxsfb needs PLL5 as source, so let's setup it at its default frequency
specified in RM(650Mhz).

Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
Reviewed-by: Lukasz Majewski <lukma@denx.de>
4 years agoclk: imx: clk-imxrt1050: fix typo in clock name "video:"
Giulio Benetti [Wed, 8 Apr 2020 15:10:08 +0000 (17:10 +0200)]
clk: imx: clk-imxrt1050: fix typo in clock name "video:"

"video:" must be "video", ":" is a typo.

Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
Reviewed-by: Lukasz Majewski <lukma@denx.de>
4 years agoclk: imx: pllv3: add enable_bit
Giulio Benetti [Wed, 8 Apr 2020 15:10:07 +0000 (17:10 +0200)]
clk: imx: pllv3: add enable_bit

pllv3 PLLs have powerdown/up bits but enable bits too. Specifically
"enable bit" enable the pll output, so when dis/enabling pll by
setting/clearing power_bit we must also set/clear enable_bit.

Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
Reviewed-by: Lukasz Majewski <lukma@denx.de>
4 years agocolibri_imx6: enable relocation of fdt and initrd
Igor Opaniuk [Fri, 27 Mar 2020 10:28:25 +0000 (12:28 +0200)]
colibri_imx6: enable relocation of fdt and initrd

Remove 'fdt_high' and 'initrd_high' environment variables (set to 0xFFFFFFFF)
from default environment which prevents relocation of FDT and initrd.
Rely on 'bootm_size' value instead to safely relocate kernel, device tree and
initrd.

Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
Reviewed-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>
4 years agocolibri-imx6ull: enable relocation of fdt and initrd
Igor Opaniuk [Fri, 27 Mar 2020 10:28:24 +0000 (12:28 +0200)]
colibri-imx6ull: enable relocation of fdt and initrd

Remove 'fdt_high' and 'initrd_high' environment variables (set to 0xFFFFFFFF)
from default environment which prevents relocation of FDT and initrd.
Rely on 'bootm_size' value instead to safely relocate kernel, device tree and
initrd.

Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
Reviewed-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>
4 years agoapalis_imx6: enable relocation of fdt and initrd
Igor Opaniuk [Fri, 27 Mar 2020 10:28:23 +0000 (12:28 +0200)]
apalis_imx6: enable relocation of fdt and initrd

Remove 'fdt_high' and 'initrd_high' environment variables (set to 0xFFFFFFFF)
from default environment which prevents relocation of FDT and initrd.
Rely on 'bootm_size' value instead to safely relocate kernel, device tree and
initrd.

Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
Reviewed-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>
4 years agocolibri_imx7: enable relocation of fdt and initrd
Igor Opaniuk [Fri, 27 Mar 2020 10:28:22 +0000 (12:28 +0200)]
colibri_imx7: enable relocation of fdt and initrd

Remove 'fdt_high' and 'initrd_high' environment variables (set to 0xFFFFFFFF)
from default environment which prevents relocation of FDT and initrd.
Rely on 'bootm_size' value instead to safely relocate kernel, device tree and
initrd.

Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
Reviewed-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>
4 years agocolibri_vf: enable relocation of fdt and initrd
Igor Opaniuk [Fri, 27 Mar 2020 10:28:21 +0000 (12:28 +0200)]
colibri_vf: enable relocation of fdt and initrd

Remove 'fdt_high' and 'initrd_high' environment variables (set to 0xFFFFFFFF)
from default environment which prevents relocation of FDT and initrd.
Rely on 'bootm_size' value instead to safely relocate kernel, device tree and
initrd.

Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
Reviewed-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>
4 years agoverdin-imx8mm: add nfsboot wrapper to env
Igor Opaniuk [Fri, 27 Mar 2020 10:28:20 +0000 (12:28 +0200)]
verdin-imx8mm: add nfsboot wrapper to env

Add nfsboot wrapper to env to boot Linux kernel from TFTP/NFS.

Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
Reviewed-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>
4 years agoimx8mm_evk: adjust dram size in case bl32 is used
Igor Opaniuk [Fri, 27 Mar 2020 10:28:19 +0000 (12:28 +0200)]
imx8mm_evk: adjust dram size in case bl32 is used

Adjust DRAM size in case BL32 secure payload is loaded (OP-TEE/Trusty),
so during MMU initialization U-Boot won't touch this mem area.

BL32 is loaded to the end of DRAM, bl32 payload size is read from
rom_pointer[1]. This relates to the issue described in
59efa6b52b("imx8m: Fix MMU table issue for OPTEE memory").

Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
4 years agoverdin-imx8mm: adjust dram size in case bl32 is used
Igor Opaniuk [Fri, 27 Mar 2020 10:28:18 +0000 (12:28 +0200)]
verdin-imx8mm: adjust dram size in case bl32 is used

Adjust DRAM size in case BL32 secure payload is loaded (OP-TEE/Trusty),
so during MMU initialization U-Boot won't touch this mem area.

BL32 is loaded to the end of DRAM, bl32 payload size is read from
rom_pointer[1]. This relates to the issue described in
59efa6b52b("imx8m: Fix MMU table issue for OPTEE memory").

Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
4 years agoimx8qxp_mek: Start with USDHC2 unpowered
Fabio Estevam [Wed, 15 Apr 2020 18:01:34 +0000 (15:01 -0300)]
imx8qxp_mek: Start with USDHC2 unpowered

After triggering a "reboot" command in Linux the following
hang in SPL is observed:

U-Boot SPL 2020.04 (Apr 15 2020 - 10:49:29 -0300)
Normal Boot
WDT:   Not found!
Trying to boot from MMC2_2
spl: mmc init failed with error: -70
SPL: failed to boot from all boot devices
### ERROR ### Please RESET the board ###

This error happens because the CMD_ERR bit is set in the IRQ status
register after booting from Linux.

To ensure a fresh start, force the VMMC supply to get unpowered first.

Signed-off-by: Fabio Estevam <festevam@gmail.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
4 years agoboard: tqc: tqma6_mba6: switch to device model
Michael Krummsdorf [Thu, 9 Apr 2020 13:21:42 +0000 (15:21 +0200)]
board: tqc: tqma6_mba6: switch to device model

Ethernet, usdhc2 and i2c1 interfaces are probed by dm drivers.
Therefor init functions in board file are not necessary.

Signed-off-by: Michael Krummsdorf <michael.krummsdorf@ew.tq-group.com>
4 years agoboard: tqc: tqma6: hw init code disabled for device model
Michael Krummsdorf [Thu, 9 Apr 2020 13:21:41 +0000 (15:21 +0200)]
board: tqc: tqma6: hw init code disabled for device model

Keep code for non-dm configuration of baseboard WRU4.
It cannot be upgraded to device model as
we have no suitable device tree for it.
These changes were not run-tested on WRU4,
only compile-tested.

Signed-off-by: Michael Krummsdorf <michael.krummsdorf@ew.tq-group.com>
4 years agoconfigs: tqma6x_mba6x: update default configs for device model
Michael Krummsdorf [Thu, 9 Apr 2020 13:21:40 +0000 (15:21 +0200)]
configs: tqma6x_mba6x: update default configs for device model

Fixes compilation for WRU4 board.

Signed-off-by: Michael Krummsdorf <michael.krummsdorf@ew.tq-group.com>
4 years agoboard: tqc: tqma6: mba6: apply default Kconfig for device model
Michael Krummsdorf [Thu, 9 Apr 2020 13:21:39 +0000 (15:21 +0200)]
board: tqc: tqma6: mba6: apply default Kconfig for device model

Signed-off-by: Michael Krummsdorf <michael.krummsdorf@ew.tq-group.com>
4 years agoarch: arm: tqma6: apply default Kconfig for device model
Michael Krummsdorf [Thu, 9 Apr 2020 13:21:38 +0000 (15:21 +0200)]
arch: arm: tqma6: apply default Kconfig for device model

Signed-off-by: Michael Krummsdorf <michael.krummsdorf@ew.tq-group.com>
4 years agoarm: dt: imx6qdl: add tqma6[qdl] som on mba6 mainboard
Michael Krummsdorf [Thu, 9 Apr 2020 13:21:37 +0000 (15:21 +0200)]
arm: dt: imx6qdl: add tqma6[qdl] som on mba6 mainboard

The device trees for TQMa6x SOM support variations in
- CPU type: imx6dl- or imx6q-
- MBa6 I2C bus access: -mba6a (i2c1) or -mba6b (i2c3)
  (plus the respective common/module include trees)

- USBH1 is directly connected to a hub
- USBOTG is connected to a separate connector
  and can act as host/device or full OTG port.

Signed-off-by: Michael Krummsdorf <michael.krummsdorf@ew.tq-group.com>
4 years agotqma6: resurrect support by supplying correct SYS_TEXT_BASE
Markus Niebel [Thu, 9 Apr 2020 13:21:36 +0000 (15:21 +0200)]
tqma6: resurrect support by supplying correct SYS_TEXT_BASE

reason: SYS_TEXT_BASE was moved to Kconfig. Give reasonable defaults
in board specific Kconfig.

Signed-off-by: Markus Niebel <Markus.Niebel@tq-group.com>
Signed-off-by: Michael Krummsdorf <michael.krummsdorf@ew.tq-group.com>
4 years agoarm: imx6: configure NoC on i.MX6DQP
Bernhard Messerklinger [Mon, 9 Mar 2020 09:55:34 +0000 (10:55 +0100)]
arm: imx6: configure NoC on i.MX6DQP

The i.MX6DP and i.MX6QP incorporate NoC interconnect logic
which needs to be configured in order to use external DDR memory.

This patch enables the SPL to configure the necessary registers
in accordance with the NXP engineering bulletin EB828.

Co-developed-by: Filip Brozović <fbrozovic@gmail.com>
Signed-off-by: Bernhard Messerklinger <bernhard.messerklinger@br-automation.com>
Signed-off-by: Filip Brozovic <fbrozovic@gmail.com>
4 years agomx6ulz_14x14_evk: Disable CONFIG_NET
Fabio Estevam [Mon, 3 Feb 2020 17:46:22 +0000 (14:46 -0300)]
mx6ulz_14x14_evk: Disable CONFIG_NET

Currently the following build warning is seen:

===================== WARNING ======================
This board does not use CONFIG_DM_ETH (Driver Model
for Ethernet drivers). Please update the board to use
CONFIG_DM_ETH before the v2020.07 release. Failure to
update by the deadline may result in board removal.
See doc/driver-model/migration.rst for more info.
===================================================

Since the mx6ulz-evk board does not have networking support, explicitly
disable networking to avoid the board removal.

Signed-off-by: Fabio Estevam <festevam@gmail.com>
4 years agomx6ullevk: Enable Ethernet support
Fabio Estevam [Mon, 3 Feb 2020 17:23:58 +0000 (14:23 -0300)]
mx6ullevk: Enable Ethernet support

Add Ethernet support using DM_ETH.

Signed-off-by: Fabio Estevam <festevam@gmail.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
4 years agomx6ul_evk: Remove FEC related board code
Fabio Estevam [Mon, 3 Feb 2020 16:09:23 +0000 (13:09 -0300)]
mx6ul_evk: Remove FEC related board code

mx6ul_evk uses DM_ETH, so there is no need to have board code
to setup the FEC IOMUX and to register the network ports via the
old board_eth_init() method.

Remove these FEC related pieces of code.

Signed-off-by: Fabio Estevam <festevam@gmail.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
4 years agomx6ul_evk: Move CONFIG_FEC_MXC to defconfig
Fabio Estevam [Mon, 3 Feb 2020 16:09:22 +0000 (13:09 -0300)]
mx6ul_evk: Move CONFIG_FEC_MXC to defconfig

CONFIG_FEC_MXC is supported in Kconfig, so it is preferred to
move it to defconfig file.

Signed-off-by: Fabio Estevam <festevam@gmail.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
4 years agomx7ulp: Only enable LDO if it is not already enabled
Fabio Estevam [Mon, 3 Feb 2020 12:01:09 +0000 (09:01 -0300)]
mx7ulp: Only enable LDO if it is not already enabled

LDO mode may be already enabled by the ROM and enabling it again
can cause U-Boot to hang.

Avoid this problem by only enabling LDO mode if it is initially disabled.

Reported-by: Jorge Ramirez-Ortiz <jorge@foundries.io>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Jorge Ramirez-Ortiz <jorge@foundries.io>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
4 years agomx7ulp: Remove duplicated definitions
Fabio Estevam [Mon, 3 Feb 2020 12:01:08 +0000 (09:01 -0300)]
mx7ulp: Remove duplicated definitions

These PMC0 definitions are already defined in the beginning
of the file, so remove the duplication.

Reported-by: Stefano Babic <sbabic@denx.de>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
4 years agoMerge branch '2020-04-16-master-imports'
Tom Rini [Fri, 17 Apr 2020 15:08:08 +0000 (11:08 -0400)]
Merge branch '2020-04-16-master-imports'

- DM GPIO improvements
- BTRFS fixes
- Corrections around gd->new_bootstage alignment
- Start documentation improvements to support 'make refcheckdocs'

4 years agoboard_f.c: Ensure 16 alignment of start_addr_sp and reserved memory
Patrick Delaunay [Tue, 10 Mar 2020 09:15:05 +0000 (10:15 +0100)]
board_f.c: Ensure 16 alignment of start_addr_sp and reserved memory

Add a function reserve_stack_aligned() to reserved memory with 16 bits
alignment after the stack pointer (gd->start_addr_sp) and use this new
function in board_f.c to reserve all the memory area (malloc, board, gd,
fdt, bootstage, stacks).

This 16 byte alignment is needed for cast on struct pointer
for the reserved memory, for example:
+ x86_64 ABI: https://reviews.llvm.org/D30049: 16 bytes
+ ARMv8 Instruction Set Overview: quad word, 16 bytes

An other alignment value could be needed for other architecture.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Acked-by: Stephen Warren <swarren@nvidia.com>
4 years agoarm: set the relocated gd with gd->new_gd
Patrick Delaunay [Tue, 10 Mar 2020 09:15:04 +0000 (10:15 +0100)]
arm: set the relocated gd with gd->new_gd

Simplify the arm relocation behavior and get gd directly form new_gd,
as it is already done in crt0_64.S:

ldr x18, [x18, #GD_NEW_GD] /* x18 <- gd->new_gd */

This patch avoid assumption on new GD location (new GD is below bd -
with #GD_SIZE offset).

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
4 years agoRevert "stm32mp1: remove the imply BOOTSTAGE"
Patrick Delaunay [Tue, 10 Mar 2020 09:15:03 +0000 (10:15 +0100)]
Revert "stm32mp1: remove the imply BOOTSTAGE"

This reverts the workaround introduced by the
commit 16fec9b0bc1a ("stm32mp1: remove the imply BOOTSTAGE")
As the bootstage alignment issue is now solved.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
4 years agoboard_f.c: Ensure gd->new_bootstage alignment
Patrice Chotard [Tue, 10 Mar 2020 09:15:02 +0000 (10:15 +0100)]
board_f.c: Ensure gd->new_bootstage alignment

In reserve_bootstage(), in case size is odd, gd->new_bootstage
is not aligned. In bootstage_relocate(), the platform hangs when
getting access to data->record[i].name.
To avoid this issue, make gd->new_bootstage 16 byte aligned.

To ensure that new_bootstage is 16 byte aligned (at least needed for
x86_64 and ARMv8) and new_bootstage starts down to get enough space,
ALIGN_DOWN macro is used.

Fixes: ac9cd4805c8b ("bootstage: Correct relocation algorithm")

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Vikas MANOCHA <vikas.manocha@st.com>
Reviewed-by: Patrick Delaunay <patrick.delaunay@st.com>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>
Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
4 years agoarm: imx: update reference to README.mxc_hab
Patrick Delaunay [Fri, 28 Feb 2020 14:18:16 +0000 (15:18 +0100)]
arm: imx: update reference to README.mxc_hab

Update reference in files detected by
scripts/documentation-file-ref-check

doc/README.mxc_hab  => doc/imx/habv4/*

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
4 years agodoc: device-tree-bindings: update reference to binding directory
Patrick Delaunay [Fri, 28 Feb 2020 14:18:15 +0000 (15:18 +0100)]
doc: device-tree-bindings: update reference to binding directory

Update reference in files detected by
scripts/documentation-file-ref-check

doc/devicetree/device-tree-bindings/  => doc/device-tree-bindings/

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
4 years agodoc: update reference to README.board
Patrick Delaunay [Fri, 28 Feb 2020 14:18:14 +0000 (15:18 +0100)]
doc: update reference to README.board

Update reference in files detected by
scripts/documentation-file-ref-check

doc/README.<board>  => board/<board>/README

Files moved in board directory in
commit 702e6014f15b ("doc: cleanup - move board
READMEs into respective board directories")'

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
4 years agodoc: update reference to README.imx8image
Patrick Delaunay [Fri, 28 Feb 2020 14:18:13 +0000 (15:18 +0100)]
doc: update reference to README.imx8image

Update reference in many files detected by
scripts/documentation-file-ref-check

README.imx8image  => imx/mkimage/imx8image.txt

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
4 years agodoc: update reference to README.imximage
Patrick Delaunay [Fri, 28 Feb 2020 14:18:12 +0000 (15:18 +0100)]
doc: update reference to README.imximage

Update reference in many files detected by
scripts/documentation-file-ref-check

README.imximage => imx/mkimage/imximage.txt

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
4 years agoKconfig: update reference to README.x86
Patrick Delaunay [Fri, 28 Feb 2020 14:18:11 +0000 (15:18 +0100)]
Kconfig: update reference to README.x86

Update reference in Kconfig detected by
scripts/documentation-file-ref-check

README.x86 => doc/arch/x86.rst

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
4 years agoREADME: update reference to *.README
Patrick Delaunay [Fri, 28 Feb 2020 14:18:10 +0000 (15:18 +0100)]
README: update reference to *.README

Update some reference in README file detected by
scripts/documentation-file-ref-check

*.README => README.*

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
4 years agotest: pinmux: add pincontrol-gpio for pin configuration
Patrick Delaunay [Mon, 13 Jan 2020 10:35:15 +0000 (11:35 +0100)]
test: pinmux: add pincontrol-gpio for pin configuration

Add a simple pincontrol associated to the sandbox gpio driver,
that allows to check pin configuration with the command pinmux.

The pinmux test is also updated to test behavior with 2 pincontrols.

Example to check LED pin configuration:

=> pinmux list
| Device                        | Driver                        | Parent
| pinctrl-gpio                  | sandbox_pinctrl_gpio          | root_driver
| pinctrl                       | sandbox_pinctrl               | root_driver

=> pinmux dev pinctrl-gpio

=> pinmux status

a0        : gpio input .
a1        : gpio input .
a2        : gpio input .
a3        : gpio input .
a4        : gpio input .
a5        : gpio output .
a6        : gpio output .
...

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
4 years agotest: dm: update test for pins configuration in gpio
Patrick Delaunay [Mon, 13 Jan 2020 10:35:14 +0000 (11:35 +0100)]
test: dm: update test for pins configuration in gpio

Add tests for new API set_dir_flags and set_dir_flags and associated
code in gpio uclass.

Test support for new flags GPIO_OPEN_DRAIN, GPIO_OPEN_SOURCE
GPIO_PULL_UP and GPIO_PULL_DOWN.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
4 years agogpio: sandbox: cleanup binding support
Patrick Delaunay [Mon, 13 Jan 2020 10:35:13 +0000 (11:35 +0100)]
gpio: sandbox: cleanup binding support

Cleanup binding support, use the generic binding by default
(test u-class gpio_xlate_offs_flags function) and add
specific binding for added value.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
4 years agotest: dm: update test for pins configuration in pinctrl node
Patrick Delaunay [Mon, 13 Jan 2020 10:35:12 +0000 (11:35 +0100)]
test: dm: update test for pins configuration in pinctrl node

Add test for "pins" configuration in gpio uclass with set_state() ops
and test for generic parsing of pinconf_param array).

set_state() is called by:
- pinctrl_generic_set_state
 |- pinctrl_generic_set_state_subnode

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
4 years agopinctrl: sandbox: Add mux information in get_pin_muxing
Patrick Delaunay [Mon, 13 Jan 2020 10:35:11 +0000 (11:35 +0100)]
pinctrl: sandbox: Add mux information in get_pin_muxing

Add param information in pin information output.
This update prepare unitary test for pin configuration
in pinctrl node.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
4 years agodt-bindings: gpio: alignment with kernel v5.3
Patrick Delaunay [Mon, 13 Jan 2020 10:35:10 +0000 (11:35 +0100)]
dt-bindings: gpio: alignment with kernel v5.3

Update the binding file for gpio, it is just an alignment
with kernel v5.3.
The U-Boot code example for gpio-hog (not directly linked
to binding) is moved in a new file doc/README.gpio.
[commit 21676b706e99 ("gpio: fixes for gpio-hog support")
& 'commit 4762a9988ede ("gpio: add gpio-hog support")']

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
4 years agogpio: add ops to set dir flags
Patrick Delaunay [Mon, 13 Jan 2020 10:35:09 +0000 (11:35 +0100)]
gpio: add ops to set dir flags

Add the ops for GPIO driver set_dir_flags() to set the dir flags.
The user can update the direction and configuration
of each GPIO with a only call to dm_gpio_set_dir_flags() or
dm_gpio_set_dir() and respecting the configuration provided by
device tree (saved in desc->flags).

When these optional ops are absent, the gpio uclass use the mandatory
ops (direction_output, direction_input, get_value) and desc->flags
to manage only the main dir flags:
- GPIOD_IS_IN
- GPIOD_IS_OUT
- GPIOD_IS_OUT_ACTIVE
- GPIOD_ACTIVE_LOW

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
4 years agogpio: add ops to get dir flags
Patrick Delaunay [Mon, 13 Jan 2020 10:35:08 +0000 (11:35 +0100)]
gpio: add ops to get dir flags

Add the ops for GPIO driver get_dir_flags(), allows to get dynamically
the current gpio configuration; it is used by the API function
dm_gpio_get_dir_flags().

When these optional ops are absent, the gpio uclass continues to use
the mandatory ops (direction_output, direction_input, get_value) and
value of desc->flags to manage only the main dir flags:
- GPIOD_IS_IN
- GPIOD_IS_OUT
- GPIOD_IS_OUT_ACTIVE
- GPIOD_ACTIVE_LOW

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
4 years agogpio: add support of new GPIO direction flag
Patrick Delaunay [Mon, 13 Jan 2020 10:35:07 +0000 (11:35 +0100)]
gpio: add support of new GPIO direction flag

This commit manages the new dir flags that can be used in gpio
specifiers to indicate the pull-up or pull-down resistor
configuration for output gpio (GPIO_PULL_UP, GPIO_PULL_DOWN)
or the Open Drain/Open Source configuration for input gpio
(GPIO_OPEN_DRAIN, GPIO_OPEN_SOURCE).

These flags are already supported in Linux kernel in gpio lib.

This patch only parse and save the direction flags in GPIO
descriptor (desc->flags), it prepares the introduction of new ops
to manage them.
The GPIO uclass supports new GPIO flags from device-tree
(GPIO_XXX define in include/dt-bindings/gpio/gpio.h)
and translate them in the dir flags (GPIOD_XXX):
- GPIO_PULL_UP     => GPIOD_PULL_UP
- GPIO_PULL_DOWN   => GPIOD_PULL_DOWN
- GPIO_OPEN_DRAIN  => GPIOD_OPEN_DRAIN
- GPIO_OPEN_SOURCE => GPIOD_OPEN_SOURCE

This patch also adds protection in the check_dir_flags function for
new invalid configuration of the dir flags.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
4 years agogpio: update dir_flags management
Patrick Delaunay [Mon, 13 Jan 2020 10:35:06 +0000 (11:35 +0100)]
gpio: update dir_flags management

Update the flag management in GPIO uclass: the desc->flags is always
combined with the requested flags and the GPIO descriptor is updated
for further call.

Add a function dm_gpio_get_dir_flags to get dynamically
the current dir_flags (configuration and value).

This patch prepare introduction of the dir flags support with new ops.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
4 years agogpio: add helper GPIOD_FLAGS_OUTPUT
Patrick Delaunay [Mon, 13 Jan 2020 10:35:05 +0000 (11:35 +0100)]
gpio: add helper GPIOD_FLAGS_OUTPUT

Add a macro to provide the GPIO output value according
the dir flags content.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
4 years agogpio: add function check_dir_flags
Patrick Delaunay [Mon, 13 Jan 2020 10:35:04 +0000 (11:35 +0100)]
gpio: add function check_dir_flags

Add a dir flags validity check with a new function
check_dir_flags.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
4 years agogpio: add function _dm_gpio_set_dir_flags
Patrick Delaunay [Mon, 13 Jan 2020 10:35:03 +0000 (11:35 +0100)]
gpio: add function _dm_gpio_set_dir_flags

Introduce the function _dm_gpio_set_dir_flags to set dir flags
without check if the GPIO is reserved.

Separate the reserved check for "set_dir" and "set_dir_flags".

This patch is a preliminary step to add new ops.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
4 years agogpio: add function _gpio_get_value
Patrick Delaunay [Mon, 13 Jan 2020 10:35:02 +0000 (11:35 +0100)]
gpio: add function _gpio_get_value

Introduce the function _gpio_get_value to get the GPIO value
without check if it is reserved.
This patch prepare new ops introduction.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
4 years agogpio: add gpio descriptor initialization helper
Patrick Delaunay [Mon, 13 Jan 2020 10:35:01 +0000 (11:35 +0100)]
gpio: add gpio descriptor initialization helper

Add a helper function gpio_desc_init() to initialize the gpio descriptor;
with this function the flags will be always set to 0.

It wasn't the case before this patch in dm_gpio_lookup_name.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
4 years agogpio: remove the open_drain API and ops
Patrick Delaunay [Mon, 13 Jan 2020 10:35:00 +0000 (11:35 +0100)]
gpio: remove the open_drain API and ops

This patch removes the ops get_open_drain/set_open_drain
and the API dm_gpio_get_open_drain/dm_gpio_set_open_drain.

The ops only provided in one driver (mpc8xxx gpio) and the
associated API is never called in boards.

This patch prepare a more generic set/get_dir_flags ops,
including the open drain property.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
4 years agogpio: remove GPIOD_REQUESTED
Patrick Delaunay [Mon, 13 Jan 2020 10:34:59 +0000 (11:34 +0100)]
gpio: remove GPIOD_REQUESTED

Remove the define GPIOD_REQUESTED as it is never used
and use BIT() macro for other defines.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
4 years agodt-bindings: gpio: document the new pull-up/pull-down flags
Patrick Delaunay [Mon, 13 Jan 2020 10:34:58 +0000 (11:34 +0100)]
dt-bindings: gpio: document the new pull-up/pull-down flags

This commit extends the flags that can be used in GPIO specifiers to
indicate if a pull-up resistor or pull-down resistor should be
enabled.

It is the backport of linux commit ede033e1e863c ('dt-bindings:
gpio: document the new pull-up/pull-down flags')
from Thomas Petazzoni <thomas.petazzoni@bootlin.com>
and integrated in v5.1-rc1
https://github.com/torvalds/linux/commit/ede033e1e863c

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
4 years agodm: pinctrl: migrate pinctrl-generic to livetree
Patrick Delaunay [Mon, 13 Jan 2020 10:34:57 +0000 (11:34 +0100)]
dm: pinctrl: migrate pinctrl-generic to livetree

Migrate pinctrl-generic to livetree:
- dev_for_each_property
- dev_read_prop_by_prop
- dev_read_string_count
- dev_read_string_index
and get rid of DECLARE_GLOBAL_DATA_PTR.

This patch solves the parsing issue during sandbox tests for pin
configuration (OF_LIVE is activated in sandbox_defconfig
and sub node are not correctly parsed in
pinctrl_generic_set_state_subnode with fdt lib API).

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
4 years agodm: core: add ofnode and dev function to iterate on node property
Patrick Delaunay [Mon, 13 Jan 2020 10:34:56 +0000 (11:34 +0100)]
dm: core: add ofnode and dev function to iterate on node property

Add functions to iterate on all property with livetree
- dev_read_first_prop
- dev_read_next_prop
- dev_read_prop_by_prop
and
- ofnode_get_first_property
- ofnode_get_next_property
- ofnode_get_property_by_prop

And helper: dev_for_each_property

For example:
struct ofprop property;

dev_for_each_property(property, config) {
value = dev_read_prop_by_prop(&property, &propname, &len);

or:

for (res = ofnode_get_first_property(node, &property);
     !res;
     res = ofnode_get_next_property(&property))
{
     value = ofnode_get_property_by_prop(&property, &propname, &len);
....
}

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
4 years agodm: pinctrl: convert pinctrl-single to livetree
Patrick Delaunay [Mon, 13 Jan 2020 10:34:55 +0000 (11:34 +0100)]
dm: pinctrl: convert pinctrl-single to livetree

Convert 'pinctrl-single' using livetree functions
- dev_read_prop
- dev_read_u32_default
- dev_read_u32_array
- dev_read_bool
- dev_read_addr
and get rid of DECLARE_GLOBAL_DATA_PTR.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
4 years agoREADME: remove requirement for CHANGELOG entry
Karl Palsson [Mon, 6 Apr 2020 15:58:02 +0000 (15:58 +0000)]
README: remove requirement for CHANGELOG entry

As indicated elsewhere in the README, the standalone CHANGELOG file was
removed in 2010.  Drop the instructions for creating patches on creating
a standalone CHANGELOG entry.

Signed-off-by: Karl Palsson <karlp@tweak.net.au>
4 years agofs: btrfs: Fix LZO false decompression error caused by pending zero
Qu Wenruo [Thu, 26 Mar 2020 05:35:56 +0000 (13:35 +0800)]
fs: btrfs: Fix LZO false decompression error caused by pending zero

For certain btrfs files with compressed file extent, uboot will fail to
load it:

  btrfs_read_extent_reg: disk_bytenr=14229504 disk_len=73728 offset=0 nr_bytes=131
  072
  decompress_lzo: tot_len=70770
  decompress_lzo: in_len=1389
  decompress_lzo: in_len=2400
  decompress_lzo: in_len=3002
  decompress_lzo: in_len=1379
  decompress_lzo: in_len=88539136
  decompress_lzo: header error, in_len=88539136 clen=65534 tot_len=62580

NOTE: except the last line, all other lines are debug output.

Btrfs lzo compression uses its own format to record compressed size
(segment header, LE32).

However to make decompression easier, we never put such segment header
across page boundary.

In above case, the xxd dump of the lzo compressed data looks like this:

00001fe0: 4cdc 02fc 0bfd 02c0 dc02 0d13 0100 0001  L...............
00001ff0: 0000 0008 0300 0000 0000 0011 0000|0000  ................
00002000: 4705 0000 0001 cc02 0000 0000 0000 1e01  G...............

'|' is the "expected" segment header start position.

But in that page, there are only 2 bytes left, can't contain the 4 bytes
segment header.

So btrfs compression will skip that 2 bytes, put the segment header in
next page directly.

Uboot doesn't have such check, and read the header with 2 bytes offset,
result 0x05470000 (88539136), other than the expected result
0x00000547 (1351), resulting above error.

Follow the btrfs-progs restore implementation, by introducing tot_in to
record total processed bytes (including headers), and do proper page
boundary skip to fix it.

Please note that, current code base doesn't parse fs_info thus we can't
grab sector size easily, so it uses PAGE_SIZE, and relying on fs open
time check to exclude unsupported sector size.

Signed-off-by: Qu Wenruo <wqu@suse.com>
Cc: Marek Behun <marek.behun@nic.cz>
Reviewed-by: Marek Behún <marek.behun@nic.cz>
4 years agofs: btrfs: Reject fs with sector size other than PAGE_SIZE
Qu Wenruo [Thu, 26 Mar 2020 05:35:55 +0000 (13:35 +0800)]
fs: btrfs: Reject fs with sector size other than PAGE_SIZE

Although in theory u-boot fs driver could easily support more sector
sizes, current code base doesn't have good enough way to grab sector
size yet.

This would cause problem for later LZO fixes which rely on sector size.

And considering that most u-boot boards are using 4K page size, which is
also the most common sector size for btrfs, rejecting fs with
non-page-sized sector size shouldn't cause much problem.

This should only be a quick fix before we implement better sector size
support.

Signed-off-by: Qu Wenruo <wqu@suse.com>
Cc: Marek Behun <marek.behun@nic.cz>
Reviewed-by: Marek Behún <marek.behun@nic.cz>
4 years agofs: btrfs: Use LZO_LEN to replace immediate number
Qu Wenruo [Thu, 26 Mar 2020 05:35:54 +0000 (13:35 +0800)]
fs: btrfs: Use LZO_LEN to replace immediate number

Just a cleanup. These immediate numbers make my eyes hurt.

Signed-off-by: Qu Wenruo <wqu@suse.com>
Cc: Marek Behun <marek.behun@nic.cz>
Reviewed-by: Marek Behún <marek.behun@nic.cz>
4 years agoMerge tag 'arc-fixes-for-2020.07-rc1' of https://gitlab.denx.de/u-boot/custodians...
Tom Rini [Thu, 16 Apr 2020 21:14:44 +0000 (17:14 -0400)]
Merge tag 'arc-fixes-for-2020.07-rc1' of https://gitlab.denx.de/u-boot/custodians/u-boot-arc

This is pretty minor set of changes mostly touching HSDK board:

 * Enable on-chip reset controller on HSDK
 * Add possibility to turn-on & off L2$ on more
   recent ARC HS processors.
 * AXI tunnel clock calculation on HSDK

4 years agoMerge tag 'efi-2020-07-rc1' of https://gitlab.denx.de/u-boot/custodians/u-boot-efi
Tom Rini [Thu, 16 Apr 2020 20:41:40 +0000 (16:41 -0400)]
Merge tag 'efi-2020-07-rc1' of https://gitlab.denx.de/u-boot/custodians/u-boot-efi

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

This pull request

* provides an implementation of UEFI secure booting
* fixes a problem with the rsa_mod_exp driver which stops some boards
  from booting when CONFIG_RSA is enabled which is needed for UEFI
  secure booting
* enables the EFI_RNG_PROTOCOL if DM_RNG is enabled
* fixes some function comments

4 years agoARC: HSDK: CGU: fix tunnel clock calculation
Eugeniy Paltsev [Thu, 16 Apr 2020 19:35:11 +0000 (22:35 +0300)]
ARC: HSDK: CGU: fix tunnel clock calculation

We set wrong tunnel PLL frequency when we request 125MHz tunnel clock.
Fix that.

Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>