oweals/u-boot.git
3 years agodm: ppc: p1010: add i2c DM support
Biwen Li [Fri, 1 May 2020 12:04:13 +0000 (20:04 +0800)]
dm: ppc: p1010: add i2c DM support

This supports i2c DM for SoC P1010

Signed-off-by: Biwen Li <biwen.li@nxp.com>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
3 years agoconfigs: T1024RDB: enable DM_I2C and DM_RTC
Biwen Li [Fri, 1 May 2020 12:04:12 +0000 (20:04 +0800)]
configs: T1024RDB: enable DM_I2C and DM_RTC

This enables DM_I2C and DM_RTC in T1024RDB defconfigs,
except T1024RDB SECURE_BOOT defconfig

Signed-off-by: Biwen Li <biwen.li@nxp.com>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
3 years agodm: powerpc: T1023/T1024: add i2c DM support
Biwen Li [Fri, 1 May 2020 12:04:11 +0000 (20:04 +0800)]
dm: powerpc: T1023/T1024: add i2c DM support

This supports i2c DM for SoC T1023/T1024

Signed-off-by: Biwen Li <biwen.li@nxp.com>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
3 years agoconfigs: P4080DS: enable DM_I2C
Biwen Li [Fri, 1 May 2020 12:04:10 +0000 (20:04 +0800)]
configs: P4080DS: enable DM_I2C

This enables DM_I2C in P4080DS defconfigs,
except P4080DS SRIO_PCIE_BOOT and SECURE_BOOT defconfigs

Signed-off-by: Biwen Li <biwen.li@nxp.com>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
3 years agopowerpc: dts: P4080: add i2c node
Biwen Li [Fri, 1 May 2020 12:04:09 +0000 (20:04 +0800)]
powerpc: dts: P4080: add i2c node

This adds i2c node for SoC P4080

Signed-off-by: Biwen Li <biwen.li@nxp.com>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
3 years agoconfigs: P3041DS: enable DM_I2C
Biwen Li [Fri, 1 May 2020 12:04:08 +0000 (20:04 +0800)]
configs: P3041DS: enable DM_I2C

This enables DM_I2C in P3041DS defconfigs,
except P3041DS SECURE_BOOT and SRIO_PCIE_BOOT defconfig

Signed-off-by: Biwen Li <biwen.li@nxp.com>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
3 years agopowerpc: dts: P3041: add i2c node
Biwen Li [Fri, 1 May 2020 12:04:07 +0000 (20:04 +0800)]
powerpc: dts: P3041: add i2c node

This adds i2c node for SoC P3041

Signed-off-by: Biwen Li <biwen.li@nxp.com>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
3 years agoconfig: P2041RDB: enable DM_I2C
Biwen Li [Fri, 1 May 2020 12:04:06 +0000 (20:04 +0800)]
config: P2041RDB: enable DM_I2C

This enables DM_I2C in P2041RDB defconfig,
except P2041RDB SRIO_PCIE_BOOT and SECURE_BOOT defconfigs

Signed-off-by: Biwen Li <biwen.li@nxp.com>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
3 years agodm: powerpc: P2041RDB: add i2c DM support
Biwen Li [Fri, 1 May 2020 12:04:05 +0000 (20:04 +0800)]
dm: powerpc: P2041RDB: add i2c DM support

This supports i2c DM for board P2041RDB

Signed-off-by: Biwen Li <biwen.li@nxp.com>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
3 years agoconfigs: P2020RDB: enable DM_I2C and DM_RTC
Biwen Li [Fri, 1 May 2020 12:04:04 +0000 (20:04 +0800)]
configs: P2020RDB: enable DM_I2C and DM_RTC

This enables DM_I2C and DM_RTC in P2020RDB defconfigs

Signed-off-by: Biwen Li <biwen.li@nxp.com>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
3 years agodts: powerpc: P2020RDB: add i2c node
Biwen Li [Fri, 1 May 2020 12:04:03 +0000 (20:04 +0800)]
dts: powerpc: P2020RDB: add i2c node

This adds i2c node for board P2020RDB

Signed-off-by: Biwen Li <biwen.li@nxp.com>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
3 years agoconfigs: P1020RDB: enable DM_I2C and DM_RTC
Biwen Li [Fri, 1 May 2020 12:04:02 +0000 (20:04 +0800)]
configs: P1020RDB: enable DM_I2C and DM_RTC

This enables DM_I2C and DM_RTC in P1020RDB defconfigs

Signed-off-by: Biwen Li <biwen.li@nxp.com>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
3 years agodm: powerpc: P1020: add i2c DM support
Biwen Li [Fri, 1 May 2020 12:04:01 +0000 (20:04 +0800)]
dm: powerpc: P1020: add i2c DM support

This supports i2c DM for SoC P1020

Signed-off-by: Biwen Li <biwen.li@nxp.com>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
3 years agoconfigs: P5040DS: enable DM_I2C
Biwen Li [Fri, 1 May 2020 12:04:00 +0000 (20:04 +0800)]
configs: P5040DS: enable DM_I2C

This enable DM_I2C in P5040DS defconfigs,
except P5040DS SECURE_BOOT defconfigs

Signed-off-by: Biwen Li <biwen.li@nxp.com>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
3 years agodm: powerpc: P5040DS: add i2c DM support
Biwen Li [Fri, 1 May 2020 12:03:59 +0000 (20:03 +0800)]
dm: powerpc: P5040DS: add i2c DM support

This supports i2c DM for board P5040DS

Signed-off-by: Biwen Li <biwen.li@nxp.com>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
3 years agopowerpc: create dts component of i2c to build up an SoC
Biwen Li [Fri, 1 May 2020 12:03:58 +0000 (20:03 +0800)]
powerpc: create dts component of i2c to build up an SoC

Provide a common i2c components that we can utilize to
build up the various device tree.

Signed-off-by: Biwen Li <biwen.li@nxp.com>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
3 years agortc: pt7c4338: Add driver model support
Biwen Li [Fri, 1 May 2020 12:03:57 +0000 (20:03 +0800)]
rtc: pt7c4338: Add driver model support

Add support of driver model of pt7c4338

Signed-off-by: Biwen Li <biwen.li@nxp.com>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
3 years agortc: ds1337: Add driver model support
Biwen Li [Fri, 1 May 2020 12:03:56 +0000 (20:03 +0800)]
rtc: ds1337: Add driver model support

Add support of driver model of ds1337

Signed-off-by: Biwen Li <biwen.li@nxp.com>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
3 years agocpu: imx8: show RevC instead of Rev? at boot log
Frank Li [Sun, 3 May 2020 13:58:55 +0000 (21:58 +0800)]
cpu: imx8: show RevC instead of Rev? at boot log

Add REVC informaiton.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Frank Li <Frank.Li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
3 years agocpu: imx_cpu: Print the CPU temperature for iMX8QM A72
Ye Li [Sun, 3 May 2020 13:58:54 +0000 (21:58 +0800)]
cpu: imx_cpu: Print the CPU temperature for iMX8QM A72

iMX8QM registers two thermal devices for CPUs, get the temperature
from "cpu-thermal1" device for A72

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
3 years agocpu: imx8: fix get core name and rate
Peng Fan [Sun, 3 May 2020 13:58:53 +0000 (21:58 +0800)]
cpu: imx8: fix get core name and rate

When current cpu is A53, using is_cortex_a53 could not detect A72
information, so check cpu device compatible property to get
the correct information.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
3 years agocpu: imx8: support a72 as boot cpu
Peng Fan [Sun, 3 May 2020 13:58:52 +0000 (21:58 +0800)]
cpu: imx8: support a72 as boot cpu

Support booting i.MX8QM with A72 as boot cpu

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
3 years agocpu: imx8: reimplement get cpu count
Peng Fan [Sun, 3 May 2020 13:58:51 +0000 (21:58 +0800)]
cpu: imx8: reimplement get cpu count

Return 4 is not correct on i.MX8DX/DXL/8QM and etc. we need to count
available cpu node with device_type "cpu".

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
3 years agocommon: board_f: Use cpu_get_current_dev in print_cpuinfo
Ye Li [Sun, 3 May 2020 13:58:50 +0000 (21:58 +0800)]
common: board_f: Use cpu_get_current_dev in print_cpuinfo

Current print_cpuinfo gets the first udevice in CPU class to return
the cpu info. This has problem if the boot CPU is not fixed.

Changing to use new API cpu_get_current_dev to fix the issue.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
3 years agotest: cpu: test current cpu
Peng Fan [Sun, 3 May 2020 13:58:49 +0000 (21:58 +0800)]
test: cpu: test current cpu

Add test whether the CPU is U-Boot is running from.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
3 years agocpu: sandbox: support is_current
Peng Fan [Sun, 3 May 2020 13:58:48 +0000 (21:58 +0800)]
cpu: sandbox: support is_current

Support querying whether U-Boot is running on current cpu

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
3 years agouclass: cpu: Add new API to get udevice for current CPU
Peng Fan [Sun, 3 May 2020 13:58:47 +0000 (21:58 +0800)]
uclass: cpu: Add new API to get udevice for current CPU

When running on SoC with multiple clusters, the boot CPU may
not be fixed, saying booting from cluster A or cluster B.
Add a API that can return the udevice for current boot CPU.
Cpu driver needs to implement is_current_cpu interface for this
feature, otherwise the API only returns the first udevice in
cpu uclass.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
3 years agospl: sdp: Add DM gadget support for sdp
Sherry Sun [Wed, 29 Apr 2020 02:35:14 +0000 (10:35 +0800)]
spl: sdp: Add DM gadget support for sdp

When enable CONFG_SPL_DM_USB_GADGET, sdp should use
usb_gadget_initialize() and usb_gadget_release() to
support DM gadget driver.

Signed-off-by: Sherry Sun <sherry.sun@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
3 years agospl: sdp: Add a callback to clean up USB driver
Ye Li [Wed, 29 Apr 2020 02:35:13 +0000 (10:35 +0800)]
spl: sdp: Add a callback to clean up USB driver

Because SDP directly jumps to next level boot image, we'd better
clean up the USB driver before it. Implement a weak callback function,
that spl sdp can use it to clean up USB driver.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
3 years agospl: sdp: Add CONFIG_SPL_SDP_USB_DEV for USB device
Ye Li [Wed, 29 Apr 2020 02:35:12 +0000 (10:35 +0800)]
spl: sdp: Add CONFIG_SPL_SDP_USB_DEV for USB device

Add a new configuration CONFIG_SPL_SDP_USB_DEV to specify the
usb index for spl sdp driver, so that we change use different device.
The default value is 0.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
3 years agousb: gadget: sdp: use CONFIG_SDP_LOADADDR as default load address
Frank Li [Wed, 29 Apr 2020 02:35:11 +0000 (10:35 +0800)]
usb: gadget: sdp: use CONFIG_SDP_LOADADDR as default load address

If SDP_WRITE and SDP_JUMP addr is zero, use CONFIG_SDP_LOADADDR
as default address

Signed-off-by: Frank Li <Frank.Li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
3 years agospl: sdp: call board_usb_init at spl_sdp_load_image
Frank Li [Wed, 29 Apr 2020 02:35:10 +0000 (10:35 +0800)]
spl: sdp: call board_usb_init at spl_sdp_load_image

Need initialize UDC before run sdp download

Signed-off-by: Frank Li <Frank.Li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
3 years agoMAINTAINERS: MediaTek: add USB related files
Chunfeng Yun [Sat, 2 May 2020 09:35:22 +0000 (11:35 +0200)]
MAINTAINERS: MediaTek: add USB related files

Add dt-binding files of xhci-mtk and phys, C files of
phys.

Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
Signed-off-by: Frank Wunderlich <frank-w@public-files.de>
Reviewed-by: Weijie Gao <weijie.gao@mediatek.com>
3 years agodt-bindings: usb: mtk-xhci: Add binding for MediaTek xHCI host controller
Chunfeng Yun [Sat, 2 May 2020 09:35:21 +0000 (11:35 +0200)]
dt-bindings: usb: mtk-xhci: Add binding for MediaTek xHCI host controller

Add dt-binding for MediaTek xHCI host controller

Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
Signed-off-by: Frank Wunderlich <frank-w@public-files.de>
Reviewed-by: Weijie Gao <weijie.gao@mediatek.com>
3 years agodt-bindings: phy-mtk-tphy: add properties of address mapping and clocks
Chunfeng Yun [Sat, 2 May 2020 09:35:20 +0000 (11:35 +0200)]
dt-bindings: phy-mtk-tphy: add properties of address mapping and clocks

1. add the address mapping related properties;
2. make "ref" clock optional, and add optional clock "da_ref";
3. add the banks layout of TPHY V1 and V2;

Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
Signed-off-by: Frank Wunderlich <frank-w@public-files.de>
Reviewed-by: Weijie Gao <weijie.gao@mediatek.com>
3 years agoarm: dts: mt7629: add usb related nodes
Chunfeng Yun [Sat, 2 May 2020 09:35:19 +0000 (11:35 +0200)]
arm: dts: mt7629: add usb related nodes

Add usb, phy and clock nodes

Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
Signed-off-by: Frank Wunderlich <frank-w@public-files.de>
Reviewed-by: Weijie Gao <weijie.gao@mediatek.com>
3 years agoxhci: mediatek: Add support for MTK xHCI host controller
Chunfeng Yun [Sat, 2 May 2020 09:35:18 +0000 (11:35 +0200)]
xhci: mediatek: Add support for MTK xHCI host controller

This patch is used to support the on-chip xHCI controller on
MediaTek SoCs, currently control/bulk/interrupt transfers are
supported.

Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
Signed-off-by: Frank Wunderlich <frank-w@public-files.de>
Reviewed-by: Weijie Gao <weijie.gao@mediatek.com>
Reviewed-by: Jagan Teki <jagan@amarulasolutions.com>
3 years agophy: phy-mtk-tphy: add a new reference clock
Chunfeng Yun [Sat, 2 May 2020 09:35:17 +0000 (11:35 +0200)]
phy: phy-mtk-tphy: add a new reference clock

Usually the digital and analog phys use the same reference clock,
but some platforms have two separate reference clocks for each of
them, so add another optional clock to support them.
In order to keep the clock names consistent with PHY IP's, change
the da_ref for analog phy and ref clock for digital phy.

Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
Signed-off-by: Frank Wunderlich <frank-w@public-files.de>
Reviewed-by: Weijie Gao <weijie.gao@mediatek.com>
3 years agophy: phy-mtk-tphy: add support new version
Chunfeng Yun [Sat, 2 May 2020 09:35:16 +0000 (11:35 +0200)]
phy: phy-mtk-tphy: add support new version

The new version removes all shared banks between multi-phys

Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
Signed-off-by: Frank Wunderlich <frank-w@public-files.de>
Reviewed-by: Weijie Gao <weijie.gao@mediatek.com>
3 years agophy: phy-mtk-tphy: add support USB phys
Chunfeng Yun [Sat, 2 May 2020 09:35:15 +0000 (11:35 +0200)]
phy: phy-mtk-tphy: add support USB phys

Support USB2 and USB3 PHY with shared banks when support multi-phys

Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
Signed-off-by: Frank Wunderlich <frank-w@public-files.de>
Reviewed-by: Weijie Gao <weijie.gao@mediatek.com>
3 years agousb: dwc2_udc_otg: use the phy bulk API to get phys
Chunfeng Yun [Sat, 2 May 2020 09:35:14 +0000 (11:35 +0200)]
usb: dwc2_udc_otg: use the phy bulk API to get phys

Use the phy bulk API to get a group of phys

Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
Signed-off-by: Frank Wunderlich <frank-w@public-files.de>
Reviewed-by: Weijie Gao <weijie.gao@mediatek.com>
3 years agousb: dwc3: use the phy bulk API to get phys
Chunfeng Yun [Sat, 2 May 2020 09:35:13 +0000 (11:35 +0200)]
usb: dwc3: use the phy bulk API to get phys

Get a group of phys by the phy bulk API

Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
Signed-off-by: Frank Wunderlich <frank-w@public-files.de>
Reviewed-by: Weijie Gao <weijie.gao@mediatek.com>
3 years agotest: dm: phy: add a test item for the phy_bulk API
Chunfeng Yun [Sat, 2 May 2020 09:35:12 +0000 (11:35 +0200)]
test: dm: phy: add a test item for the phy_bulk API

Add a test item for the phy_bulk API

Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
Signed-off-by: Frank Wunderlich <frank-w@public-files.de>
Reviewed-by: Weijie Gao <weijie.gao@mediatek.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Jagan Teki <jagan@amarulasolutions.com>
3 years agophy: Add API for a bulk of phys
Chunfeng Yun [Sat, 2 May 2020 09:35:11 +0000 (11:35 +0200)]
phy: Add API for a bulk of phys

This patch adds a "bulk" API to the phy API in order to
get/init/exit/power on/off a group of phys associated
with a device.

The bulk API will avoid adding a copy of the same code to
manage a group of phys in drivers.

Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
Signed-off-by: Frank Wunderlich <frank-w@public-files.de>
Reviewed-by: Weijie Gao <weijie.gao@mediatek.com>
Reviewed-by: Jagan Teki <jagan@amarulasolutions.com>
3 years agotest: dm: add test item for ofnode_get_child_count()
Chunfeng Yun [Sat, 2 May 2020 09:35:10 +0000 (11:35 +0200)]
test: dm: add test item for ofnode_get_child_count()

Add a test item for ofnode_get_child_count()

Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
Signed-off-by: Frank Wunderlich <frank-w@public-files.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Weijie Gao <weijie.gao@mediatek.com>
3 years agodm: core: Add function to get child count of ofnode or device
Chunfeng Yun [Sat, 2 May 2020 09:35:09 +0000 (11:35 +0200)]
dm: core: Add function to get child count of ofnode or device

This patch add function used to get the child count of
a ofnode or a device

Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
Signed-off-by: Frank Wunderlich <frank-w@public-files.de>
Reviewed-by: Weijie Gao <weijie.gao@mediatek.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
3 years agoMerge branch '2020-05-01-master-imports'
Tom Rini [Fri, 1 May 2020 20:43:15 +0000 (16:43 -0400)]
Merge branch '2020-05-01-master-imports'

- Assorted bug fixes
- Framework for enabling D-CACHE in SPL on ARM

3 years ago.readthedocs.yml: fix type docs/
Heinrich Schuchardt [Fri, 1 May 2020 20:06:17 +0000 (22:06 +0200)]
.readthedocs.yml: fix type docs/

Out documentation directory is doc/ and not docs/.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
3 years agoactions: Fix syntax for enabling SYS_RELOC_GD_ENV_ADDR
Tom Rini [Fri, 1 May 2020 14:52:11 +0000 (10:52 -0400)]
actions: Fix syntax for enabling SYS_RELOC_GD_ENV_ADDR

The correct syntax is 'select SYS_...' and not 'select CONFIG_SYS...'

Fixes: d5c819b885c2 ("actions: Move defconfig options to Kconfig")
Signed-off-by: Tom Rini <trini@konsulko.com>
3 years agoclk: imx: clk-imxrt1050: fix lcdif clock gate
Giulio Benetti [Mon, 27 Apr 2020 15:53:06 +0000 (17:53 +0200)]
clk: imx: clk-imxrt1050: fix lcdif clock gate

LCDIF clock gate was wrong so set it according to RM.

Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
Reviewed-by: Anatolij Gustschin <agust@denx.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>
3 years agovideo: mxsfb: add clk_enable()
Giulio Benetti [Mon, 27 Apr 2020 15:53:05 +0000 (17:53 +0200)]
video: mxsfb: add clk_enable()

BROM doesn't enable lcdif by default so add clk_enable() after
clk_set_rate().

Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
Reviewed-by: Anatolij Gustschin <agust@denx.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>
3 years agoimxrt1020-evk: README: change dd command destination
Giulio Benetti [Mon, 27 Apr 2020 15:53:04 +0000 (17:53 +0200)]
imxrt1020-evk: README: change dd command destination

Set dd "of=" to "of=/dev/sdX" to be generic and prevent host hard drive
damage.

Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
3 years agoimxrt1050-evk: README: change dd command destination
Giulio Benetti [Mon, 27 Apr 2020 15:53:03 +0000 (17:53 +0200)]
imxrt1050-evk: README: change dd command destination

Set dd "of=" to "of=/dev/sdX" to be generic and prevent host hard drive
damage.

Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
3 years agoimx: spl: Fix use of removed SPL_FAT_SUPPORT config
Harald Seiler [Thu, 23 Apr 2020 11:07:53 +0000 (13:07 +0200)]
imx: spl: Fix use of removed SPL_FAT_SUPPORT config

CONFIG_SPL_FAT_SUPPORT was removed in commit 0c3a9ed409a5
("spl: Kconfig: Replace CONFIG_SPL_FAT_SUPPORT with CONFIG_SPL_FS_FAT").
Fixup a leftover use of the symbol.

Fixes: 9d86dbd9cf9d ("imx: spl: implement spl_boot_mode for i.MX7/8/8M")
Signed-off-by: Harald Seiler <hws@denx.de>
3 years agoimx: spl: Remove ifdefs in spl_mmc_boot_mode()
Harald Seiler [Thu, 23 Apr 2020 11:07:52 +0000 (13:07 +0200)]
imx: spl: Remove ifdefs in spl_mmc_boot_mode()

It is hard to read code which contains nested ifdef blocks.  Replace
them with normal if-blocks and the IS_ENABLED() macro.  This is not only
more readable but also helps as both arms are validated by the compiler
in all cases.

Signed-off-by: Harald Seiler <hws@denx.de>
3 years agoRevert "imx: defconfig: Enable CONFIG_SPL_FORCE_MMC_BOOT"
Harald Seiler [Thu, 23 Apr 2020 11:07:51 +0000 (13:07 +0200)]
Revert "imx: defconfig: Enable CONFIG_SPL_FORCE_MMC_BOOT"

CONFIG_SPL_FORCE_MMC_BOOT was removed in a previous patch as its
behavior is the correct one in all cases.  Remove all uses of it from
defconfigs.

This reverts commit 3201e5b444ae3a13aa31e8b5101ad38d7ff0640d and removes
CONFIG_SPL_FORCE_MMC_BOOT from the imx28_xea defconfig.

Signed-off-by: Harald Seiler <hws@denx.de>
3 years agoRevert "imx: Introduce CONFIG_SPL_FORCE_MMC_BOOT to force MMC boot on falcon mode"
Harald Seiler [Thu, 23 Apr 2020 11:07:50 +0000 (13:07 +0200)]
Revert "imx: Introduce CONFIG_SPL_FORCE_MMC_BOOT to force MMC boot on falcon mode"

The CONFIG_SPL_FORCE_MMC_BOOT config flag is not needed as its behavior
is the correct one in all cases;  using spl_boot_device() instead of the
boot_device parameter will lead to inconsistency issues, for example,
when a board_boot_order() is defined.  In fact, this is the reason the
parameter was introduced in the first place, in commit 2b1cdafa9fdd
("common: Pass the boot device into spl_boot_mode()").

This reverts commit 772b55723bcbe8ebe84f579d9cdc831d8e18579d.

Link: https://lists.denx.de/pipermail/u-boot/2020-April/405979.html
Signed-off-by: Harald Seiler <hws@denx.de>
3 years agoimx: spl: return boot mode for asked MMC device in spl_mmc_boot_mode()
Anatolij Gustschin [Thu, 23 Apr 2020 11:07:49 +0000 (13:07 +0200)]
imx: spl: return boot mode for asked MMC device in spl_mmc_boot_mode()

Boards may extend or re-define the boot list in their board_boot_order()
function by modifying spl_boot_list. E.g. a board might boot SPL from a
slow SPI NOR flash and then load the U-Boot from an eMMC or SD-card.
Or it might use additional MMC boot device in spl_boot_list for cases
when the image in SPI NOR flash is not found, so it could fall back to
eMMC, SD-card or another boot device.

Getting the MMC boot mode in spl_mmc will fail when we are trying to
boot from an MMC device in the spl_boot_list and the original board
boot mode (as returned by spl_boot_device()) is not an MMC boot mode.
Fix it by checking the asked MMC boot device from the spl_mmc_boot_mode()
argument.

Signed-off-by: Anatolij Gustschin <agust@denx.de>
3 years agocommon/board_r: Drop initr_bedbug wrapper
Ovidiu Panait [Mon, 20 Apr 2020 07:31:46 +0000 (10:31 +0300)]
common/board_r: Drop initr_bedbug wrapper

Drop initr_bedbug wrapper and call bedbug_init directly during the init
sequence.

Signed-off-by: Ovidiu Panait <ovpanait@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
3 years agocmd/bedbug.c: Make bedbug_init have a return value
Ovidiu Panait [Mon, 20 Apr 2020 07:31:45 +0000 (10:31 +0300)]
cmd/bedbug.c: Make bedbug_init have a return value

Do this as a preparation for removing initr_bedbug wrapper from
common/board_r.c.

Signed-off-by: Ovidiu Panait <ovpanait@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
3 years agocommon/board_r: arm: Merge initr_enable_interrupts into interrupts_init
Ovidiu Panait [Mon, 20 Apr 2020 07:31:44 +0000 (10:31 +0300)]
common/board_r: arm: Merge initr_enable_interrupts into interrupts_init

initr_enable_interrupts() is an ARM-specific wrapper over
enable_interrupts(), which is run during the common init sequence. It can
be eliminated by moving the enable_interrupts() call to the end of
interrupt_init() function, in arch/arm/lib/interrupts*.c.

Signed-off-by: Ovidiu Panait <ovpanait@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
3 years agomalloc: dlmalloc: add an ability for the malloc to be re-init/init multiple times
Marek Bykowski [Wed, 29 Apr 2020 16:23:07 +0000 (18:23 +0200)]
malloc: dlmalloc: add an ability for the malloc to be re-init/init multiple times

Malloc gets initialized with a call to mem_malloc_init() with the address
the allocation starts to and its size. Currently it is not possible to
move the malloc from one memory area to another as the malloc would eventually
fail.

This patch adds in the ability to re-init the malloc with the updated
start address and the size.

One of the use cases of this feature is SPL U-Boot running from within
the static memory and calling to malloc init from within board_init_f():

arch/arm/cpu/armv8/start.S:reset vector
arch/arm/cpu/armv8/start.S:main()
arch/arm/lib/crt0_64.S:board_init_f()
board/<my_board>/common/spl.c:board_init_f()
        board/<my_board>/common/spl.c:mem_malloc_init((ulong)CONFIG_SYS_SPL_MALLOC_START,
                        CONFIG_SYS_SPL_MALLOC_SIZE);

Shortly after the DDR (main) memory is init and ready we call to malloc init
again but this time with the start address in the DDR memory and a much greater
size for moving the allocation off the static to the DDR memory:

board/<my_board>/common/spl.c:mem_malloc_init((ulong)CONFIG_SPL_MALLOC_OFFSET,
CONFIG_SPL_MALLOC_SIZE);

Where CONFIG_SYS_SPL_MALLOC_START and CONFIG_SPL_MALLOC_OFFSET are the start
addresses of the malloc in the static and DDR memories respectively and
CONFIG_SYS_SPL_MALLOC_SIZE=SZ_16K and CONFIG_SPL_MALLOC_SIZE=SZ_2M are
the sizes of the mallocs in these memories. Note, now we have a much greater
memory, enlarging from 16K to 2M, available for allocation.

There is an alternative approach already existing in U-Boot with the use of
an early (simplified) malloc and the proper (dlamalloc) malloc however
necessitating managing the two mallocs whereas this approach proposes using
a single dlmalloc.

Signed-off-by: Marek Bykowski <marek.bykowski@gmail.com>
3 years agorsa: sig: fix config signature check for fit with padding
Philippe Reynes [Wed, 29 Apr 2020 13:26:17 +0000 (15:26 +0200)]
rsa: sig: fix config signature check for fit with padding

The signature check on config node is broken on fit with padding.
To compute the signature for config node, U-Boot compute the
signature on all properties of requested node for this config,
except for the property "data". But, when padding is used for
binary in a fit, there isn't a property "data" but two properties:
"data-offset" and "data-size". So to fix the check of signature,
we also don't use the properties "data-offset" and "data-size"
when checking the signature on config node.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
3 years agotest/py: vboot: add a test to check fit signature on fit with padding
Philippe Reynes [Wed, 29 Apr 2020 13:26:16 +0000 (15:26 +0200)]
test/py: vboot: add a test to check fit signature on fit with padding

The pytest vboot does all his tests on fit without padding.
We add the same tests on fit with padding.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
3 years agohush: avoid NULL check before free()
Heinrich Schuchardt [Tue, 28 Apr 2020 19:56:10 +0000 (21:56 +0200)]
hush: avoid NULL check before free()

free() checks if its argument is NULL. Don't duplicate this in the calling
code.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
3 years agofs: ext4: avoid NULL check before free()
Heinrich Schuchardt [Tue, 28 Apr 2020 19:50:02 +0000 (21:50 +0200)]
fs: ext4: avoid NULL check before free()

free() checks if its argument is NULL. Don't duplicate this in the calling
code.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
3 years agocmd/gpt: avoid NULL check before free()
Heinrich Schuchardt [Tue, 28 Apr 2020 19:40:13 +0000 (21:40 +0200)]
cmd/gpt: avoid NULL check before free()

free() checks if its argument is NULL. Do not duplicate this in the calling
code.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Tom Rini <trini@konsulko.com>
3 years agotools/fit-image: print a warning when cmd-line for dtc might be truncated
Sven Roederer [Mon, 27 Apr 2020 00:08:39 +0000 (02:08 +0200)]
tools/fit-image: print a warning when cmd-line for dtc might be truncated

Signed-off-by: Sven Roederer <devel-sven@geroedel.de>
3 years agotools/mkimage: fix handling long filenames
Sven Roederer [Mon, 27 Apr 2020 00:08:38 +0000 (02:08 +0200)]
tools/mkimage: fix handling long filenames

The cmdline for calling the dtc was cut-off when using long filenames (e.g.
245 bytes) for output-file and datafile of "-f" parameter.
For FIT-images cmd[MKIMAGE_MAX_DTC_CMDLINE_LEN] is declared (hardcoded 512 bytes),
and contains some static values, the path of a tmpfile and a datafile. tmpfile is
max MKIMAGE_MAX_TMPFILE_LEN (256) and datafile might be also this size. Having two
very long pathname results in a truncation os the executed shell command, as the
truncated datafile path will not be found.
Redefine MKIMAGE_MAX_DTC_CMDLINE_LEN to "2 * MKIMAGE_MAX_TMPFILE_LEN + 35 for the
parameters.
This likely applies to the "-d" parameter, too.

Signed-off-by: Sven Roederer <devel-sven@geroedel.de>
3 years agoarm: enable distro boot for bananapi-r2
Matthias Brugger [Sat, 25 Apr 2020 23:17:46 +0000 (01:17 +0200)]
arm: enable distro boot for bananapi-r2

This patch enables distro boot for the bananapi-r2, based on
a MediaTek mt7623n.

Signed-off-by: Matthias Brugger <mbrugger@suse.com>
3 years agowatchdog MediaTek add upstream compatible
Matthias Brugger [Sat, 25 Apr 2020 23:17:45 +0000 (01:17 +0200)]
watchdog MediaTek add upstream compatible

The upstream compatible is called mt6589-wdt.
Add this compatible to the driver.

Signed-off-by: Matthias Brugger <mbrugger@suse.com>
3 years agotimer MediaTek use upstream compatible
Matthias Brugger [Sat, 25 Apr 2020 23:17:44 +0000 (01:17 +0200)]
timer MediaTek use upstream compatible

The timers compatible string in upstream is called
mt6577-timer. Add this compatible to the driver.

Signed-off-by: Matthias Brugger <mbrugger@suse.com>
3 years agodoc: describe the analysis of crash dumps
Heinrich Schuchardt [Fri, 24 Apr 2020 21:31:20 +0000 (23:31 +0200)]
doc: describe the analysis of crash dumps

Provide an overview of the analysis of U-Boot crash dumps.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
3 years agortc: pcf2127: don't add/subtract 1 to tm_mon
Rasmus Villemoes [Fri, 1 May 2020 13:24:50 +0000 (15:24 +0200)]
rtc: pcf2127: don't add/subtract 1 to tm_mon

As noted in rtc_def.h, the tm_mon field in struct rtc_time is 1-12,
unlike in struct tm where it is 0-11. Currently, running "date" prints
the wrong

Date: 2020-04-01 (Friday)    Time: 13:05:30

and setting the RTC via the date command is also broken.

Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
3 years agoarm: caches: manage phys_addr_t overflow in mmu_set_region_dcache_behaviour
Patrick Delaunay [Fri, 24 Apr 2020 18:20:17 +0000 (20:20 +0200)]
arm: caches: manage phys_addr_t overflow in mmu_set_region_dcache_behaviour

Solved the overflow on phys_addr_t type for start + size in
mmu_set_region_dcache_behaviour() function.

This overflow is avoided by dividing start and end by 2 before addition,
and we only expecting that start and size are even.

This patch doesn't change the current function behavior if the
parameters (start or size) are not aligned on MMU_SECTION_SIZE.

For example, this overflow occurs on ARM32 with:
start = 0xC0000000 and size = 0x40000000
then start + size = 0x100000000 and end = 0x0.

For information the function behavior change with risk of regression,
if we just shift start and size before the addition.
Example with 2MB section size:
  MMU_SECTION_SIZE 0x200000 and MMU_SECTION_SHIFT = 21
  with start = 0x1000000, size = 0x1000000,
  - with the proposed patch, start = 0 and end = 0x1 as previously
  - with the more simple patch:
    end = (start >> MMU_SECTION_SHIFT) + (size >> MMU_SECTION_SHIFT)
    the value of end change:
    start >> 21 = 0, size >> 21 = 0 and end = 0x0 !!!

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
3 years agoarm: caches: add DCACHE_DEFAULT_OPTION
Patrick Delaunay [Fri, 24 Apr 2020 18:20:16 +0000 (20:20 +0200)]
arm: caches: add DCACHE_DEFAULT_OPTION

Add the new flags DCACHE_DEFAULT_OPTION to define the default
option to use according the compilation flags
CONFIG_SYS_ARM_CACHE_*.

This new compilation flag allows to simplify dram_bank_mmu_setup()
and can be used as third parameter (option=dcache option to select)
of mmu_set_region_dcache_behaviour function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
3 years agoarm: caches: protect dram_bank_mmu_setup access to bi_dram
Patrick Delaunay [Fri, 24 Apr 2020 18:20:15 +0000 (20:20 +0200)]
arm: caches: protect dram_bank_mmu_setup access to bi_dram

Add protection in dram_bank_mmu_setup() to avoid access to bd->bi_dram
before relocation.

This patch allow to use the generic weak function dram_bank_mmu_setup
to activate the MMU and the data cache in SPL or in U-Boot before
relocation, when bd->bi_dram is not yet initialized.

In this cases, the MMU must be initialized explicitly with
mmu_set_region_dcache_behaviour function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
3 years agoconfigs: migrate CONFIG_SYS_ARM_CACHE_* in Kconfig
Patrick Delaunay [Fri, 10 Apr 2020 14:02:02 +0000 (16:02 +0200)]
configs: migrate CONFIG_SYS_ARM_CACHE_* in Kconfig

Move CONFIG_SYS_ARM_CACHE_WRITETHROUGH and
CONFIG_SYS_ARM_CACHE_WRITEALLOC into Kconfig done by moveconfig.py.

Kconfig uses a choice between the 3 values supported in U-Boot,
including the new configuration CONFIG_SYS_ARM_CACHE_WRITEBACK
(the default configuration).

The patch also avoids to select simultaneously 2 configurations.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
3 years agotiny-printf: Support %i
Marek Vasut [Fri, 10 Apr 2020 18:54:49 +0000 (20:54 +0200)]
tiny-printf: Support %i

The most basic printf("%i", value) formating string was missing,
add it for the sake of convenience.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Simon Glass <sjg@chromium.org>
Cc: Stefan Roese <sr@denx.de>
3 years agonet: smc911x: Add DM support
Marek Vasut [Sun, 15 Mar 2020 16:39:01 +0000 (17:39 +0100)]
net: smc911x: Add DM support

Add support for U-Boot DM and DT probing. Furthermore, build the
SMC911x standalone EEPROM example only for the non-DM case, as it
is not converted yet.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Joe Hershberger <joe.hershberger@ni.com>
Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
3 years agoarm: imx: Add support for Google's Coral Dev Board
Alifer Moraes [Fri, 6 Mar 2020 10:46:33 +0000 (07:46 -0300)]
arm: imx: Add support for Google's Coral Dev Board

Add initial support for Google's Coral Dev Board based on i.MX8MQ.

https://coral.ai/products/dev-board

The Phanbell naming has been used here to match the naming convention
used in Google's U-Boot source tree:

https://coral.googlesource.com/uboot-imx/

Co-developed-by: Fabio Estevam <festevam@gmail.com>
Signed-off-by: Alifer Moraes <alifer.wsdm@gmail.com>
Tested-by: Marco Franchi <marcofrk@gmail.com>
3 years agoARM: imx8m: Fix reset in SPL on Toradex iMX8MM Verdin
Marek Vasut [Wed, 29 Apr 2020 13:04:27 +0000 (15:04 +0200)]
ARM: imx8m: Fix reset in SPL on Toradex iMX8MM Verdin

Board files should not re-implement do_reset() to work around this
function not being defined in for specific configurations. Rather,
the fix is to compile in drivers which implement this properly.
This patch enables sysreset and watchdog drivers in SPL and ties
them together to implement the same as the do_reset() hack in the
board file, except correctly in the DM/DT framework.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Fabio Estevam <festevam@gmail.com>
Cc: Flavio Suligoi <f.suligoi@asem.it>
Cc: Harald Seiler <hws@denx.de>
Cc: Igor Opaniuk <igor.opaniuk@toradex.com>
Cc: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Cc: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>
Cc: Peng Fan <peng.fan@nxp.com>
Cc: Stefano Babic <sbabic@denx.de>
Reviewed-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>
Acked-by: Igor Opaniuk <igor.opaniuk@toradex.com>
Acked-by: Igor Opaniuk <igor.opaniuk@toradex.com>
3 years agoARM: imx8m: Fix reset in SPL on NXP iMX8MP EVK
Marek Vasut [Wed, 29 Apr 2020 13:04:26 +0000 (15:04 +0200)]
ARM: imx8m: Fix reset in SPL on NXP iMX8MP EVK

Board files should not re-implement do_reset() to work around this
function not being defined in for specific configurations. Rather,
the fix is to compile in drivers which implement this properly.
This patch enables sysreset and watchdog drivers in SPL and ties
them together to implement the same as the do_reset() hack in the
board file, except correctly in the DM/DT framework.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Fabio Estevam <festevam@gmail.com>
Cc: Flavio Suligoi <f.suligoi@asem.it>
Cc: Harald Seiler <hws@denx.de>
Cc: Igor Opaniuk <igor.opaniuk@toradex.com>
Cc: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Cc: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>
Cc: Peng Fan <peng.fan@nxp.com>
Cc: Stefano Babic <sbabic@denx.de>
3 years agoARM: imx8m: Fix reset in SPL on NXP iMX8MN EVK
Marek Vasut [Wed, 29 Apr 2020 13:04:25 +0000 (15:04 +0200)]
ARM: imx8m: Fix reset in SPL on NXP iMX8MN EVK

Board files should not re-implement do_reset() to work around this
function not being defined in for specific configurations. Rather,
the fix is to compile in drivers which implement this properly.
This patch enables sysreset and watchdog drivers in SPL and ties
them together to implement the same as the do_reset() hack in the
board file, except correctly in the DM/DT framework.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Fabio Estevam <festevam@gmail.com>
Cc: Flavio Suligoi <f.suligoi@asem.it>
Cc: Harald Seiler <hws@denx.de>
Cc: Igor Opaniuk <igor.opaniuk@toradex.com>
Cc: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Cc: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>
Cc: Peng Fan <peng.fan@nxp.com>
Cc: Stefano Babic <sbabic@denx.de>
3 years agoARM: imx8m: Fix reset in SPL on NXP iMX8MM EVK
Marek Vasut [Wed, 29 Apr 2020 13:04:24 +0000 (15:04 +0200)]
ARM: imx8m: Fix reset in SPL on NXP iMX8MM EVK

Board files should not re-implement do_reset() to work around this
function not being defined in for specific configurations. Rather,
the fix is to compile in drivers which implement this properly.
This patch enables sysreset and watchdog drivers in SPL and ties
them together to implement the same as the do_reset() hack in the
board file, except correctly in the DM/DT framework.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Fabio Estevam <festevam@gmail.com>
Cc: Flavio Suligoi <f.suligoi@asem.it>
Cc: Harald Seiler <hws@denx.de>
Cc: Igor Opaniuk <igor.opaniuk@toradex.com>
Cc: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Cc: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>
Cc: Peng Fan <peng.fan@nxp.com>
Cc: Stefano Babic <sbabic@denx.de>
3 years agoARM: imx8m: Don't use the addr parameter of reset_cpu()
Claudius Heine [Wed, 29 Apr 2020 13:04:23 +0000 (15:04 +0200)]
ARM: imx8m: Don't use the addr parameter of reset_cpu()

imx8m has the only implementation of reset_cpu() which does not ignore
the addr parameter and instead gives it some meaning as the base address
of watchdog registers.  This breaks convention with the rest of U-Boot
where the parameter is ignored and callers are passing in 0.

Fixes: d2041725e84b ("imx8m: restrict reset_cpu")
Co-developed-by: Harald Seiler <hws@denx.de>
Signed-off-by: Harald Seiler <hws@denx.de>
Signed-off-by: Claudius Heine <ch@denx.de>
3 years agoARM: imx8m: Fix indentation of reset_cpu() function
Harald Seiler [Wed, 29 Apr 2020 13:04:22 +0000 (15:04 +0200)]
ARM: imx8m: Fix indentation of reset_cpu() function

Use proper code-style, tabs instead of spaces for indentation.

Signed-off-by: Harald Seiler <hws@denx.de>
3 years agoARM: imx8m: Do not define do_reset() if sysreset is enabled
Marek Vasut [Wed, 29 Apr 2020 13:04:21 +0000 (15:04 +0200)]
ARM: imx8m: Do not define do_reset() if sysreset is enabled

The SPL can also be compiled with sysreset drivers just fine, so
update the condition to cater for that option.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Fabio Estevam <festevam@gmail.com>
Cc: Flavio Suligoi <f.suligoi@asem.it>
Cc: Harald Seiler <hws@denx.de>
Cc: Igor Opaniuk <igor.opaniuk@toradex.com>
Cc: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Cc: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>
Cc: Peng Fan <peng.fan@nxp.com>
Cc: Stefano Babic <sbabic@denx.de>
3 years agodt-bindings: pinctrl: imxrt1020: remove useless comment
Giulio Benetti [Mon, 20 Apr 2020 15:48:12 +0000 (17:48 +0200)]
dt-bindings: pinctrl: imxrt1020: remove useless comment

A comment note has been left after completing pinctrl listing, so let's
remove it since it's useless.

Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
3 years agoARM: imx: imx8m: Do not warn about cpu-idle-states if missing
Marek Vasut [Fri, 24 Apr 2020 19:37:33 +0000 (21:37 +0200)]
ARM: imx: imx8m: Do not warn about cpu-idle-states if missing

If the cpu-idle-states is missing from the DT in the first place, do
not fail on removing in. Just move on and do not even print an error,
since not being able to remove something which is not there in the
first place is not an error and surely does not justify failing to
boot.

Turn the surrounding prints into debugs to reduce the useless noise.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Frieder Schrempf <frieder.schrempf@kontron.de>
Cc: Fabio Estevam <festevam@gmail.com>
Cc: Peng Fan <peng.fan@nxp.com>
Cc: Stefano Babic <sbabic@denx.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>
3 years agoarm: dts: imx8mm: sync dts from Linux Kernel 5.6.7
Adam Ford [Mon, 27 Apr 2020 12:11:19 +0000 (07:11 -0500)]
arm: dts: imx8mm: sync dts from Linux Kernel 5.6.7

This patch synchronizes the device tree with that from 5.6.7.

This also adds nodes for crypto and ddrc, which makes keeping
the device tree files from individual boards in sync with the
Linux kernel.  This is helpful when boads reference those nodes.

Signed-off-by: Adam Ford <aford173@gmail.com>
3 years agotreewide: Remove unused FSL QSPI config options for IMX platforms
Kuldeep Singh [Thu, 20 Feb 2020 17:27:54 +0000 (22:57 +0530)]
treewide: Remove unused FSL QSPI config options for IMX platforms

Some of these options are not used by the driver anymore and some of them
are obsolete as the information is gathered from the dt.
So, remove the unused config options now.

Signed-off-by: Frieder Schrempf <frieder.schrempf@kontron.de>
Signed-off-by: Ashish Kumar <Ashish.Kumar@nxp.com>
Signed-off-by: Kuldeep Singh <kuldeep.singh@nxp.com>
3 years agoimx8qxp_mek: Run with caches enabled
Fabio Estevam [Mon, 20 Apr 2020 18:55:29 +0000 (15:55 -0300)]
imx8qxp_mek: Run with caches enabled

There is no need to run with caches disabled.

Signed-off-by: Fabio Estevam <festevam@gmail.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
3 years agoimx8qxp_mek: Remove SPL watchdog option
Fabio Estevam [Mon, 20 Apr 2020 12:55:47 +0000 (09:55 -0300)]
imx8qxp_mek: Remove SPL watchdog option

Currently the following watchdog error is seen in SPL:

U-Boot SPL 2020.04-00407-g8d5d3bcf3c (Apr 20 2020 - 09:48:09 -0300)
Normal Boot
WDT:   Not found!
...

There is no watchdog driver for i.MX8 at the moment, nor code for
configuring the watchdog in SPL, so remove the CONFIG_SPL_WATCHDOG_SUPPORT
option for now.

Signed-off-by: Fabio Estevam <festevam@gmail.com>
Reviewed-by: Stefano Babic <sbabic@denx.de>
3 years agoimx8: Run SPL with caches enabled
Fabio Estevam [Tue, 21 Apr 2020 15:02:45 +0000 (12:02 -0300)]
imx8: Run SPL with caches enabled

It is safe to run SPL with caches enabled on i.MX8, so
remove such restriction.

Signed-off-by: Fabio Estevam <festevam@gmail.com>
Acked-by: Peng Fan <peng.fan@nxp.com>
Acked-by: Oliver Graute <oliver.graute@kococonnector.com>
Acked-by: Anatolij Gustschin <agust@denx.de>
Tested-by: Igor Opaniuk <igor.opaniuk@toradex.com>
Acked-by: Igor Opaniuk <igor.opaniuk@toradex.com>
3 years agoconfig: apalis-imx8: Enable FEC TXC delay
Philippe Schenker [Wed, 11 Mar 2020 10:52:59 +0000 (11:52 +0100)]
config: apalis-imx8: Enable FEC TXC delay

define FEC_ENET_ENABLE_TXC_DELAY to enable the delay on TXC line on
the MAC. This has to be done in order to meet RGMII specs.
According to RGMII specs the clock should get delayed so the edges of
the clock are preferrably in the middle of the edges of data-lines so
they can be sampled properly.
Our PHY expects the MAC to delay TXC line, as it is also written
in the spec. This patch makes sure the TXC delay on the FEC is enabled

Signed-off-by: Philippe Schenker <philippe.schenker@toradex.com>
Reviewed-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>
3 years agonet: fec: Add possibility to enable TXC delay
Philippe Schenker [Wed, 11 Mar 2020 10:52:58 +0000 (11:52 +0100)]
net: fec: Add possibility to enable TXC delay

This patch enables the possibility to set FEC_ENET_ENABLE_TXC_DELAY or
FEC_ENET_ENABLE_RXC_DELAY so one can via a define enable the RXC or TXC
delay in the MAC.

Signed-off-by: Philippe Schenker <philippe.schenker@toradex.com>
Reviewed-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>
3 years agoboard: apalis_imx6: Add KSZ9131 phy skew settings
Philippe Schenker [Wed, 11 Mar 2020 10:59:26 +0000 (11:59 +0100)]
board: apalis_imx6: Add KSZ9131 phy skew settings

This patch adds skew register settings for KSZ9131. It checks first
which phy is on the board and then applies the correct skew settings.

Skew settings calculation for the KSZ9131:
The i.MX6 SoC has an output skew tolerance of -100ps to 900ps. All
PCB traces where routed exactly the same length so we can calculate
the skew settings without taking the length into consideration. The
traces are all length matched.

RXC skew (PHY to MAC):
- We use the 2ns DLL controlled delay on the PHY
- We do not use the skew registers

This results in the following values:

RXC
PHY fixed Delay 2000ps
PHY Added Delay 0ps
T_setup_R min 2.00ns
T_setup_R typ 2.00ns
T_setup_R max 2.00ns
T_hold_R min 1.60ns
T_hold_R typ 2.00ns
T_hold_R max 2.40ns

That means we are well within RGMII specs.

TXC skew (MAC to PHY):
- We use the 2ns DLL controlled delay on the PHY
- We then subtract ~0.6ns with TXD[0:3] and TXC clock pad skew
  register in a resulting ~1.4ns delay.

This results in the following values under consideration of the
tolerances:

TXC min TXC typ TXC max
MAC min -100ps -100ps -100ps
MAC max 900ps 900ps 900ps
PHY fixed Delay 2000ps 2000ps 2000ps
PHY added Delay -340ps -600ps -859ps
T_setup_T min 1.56ns 1.30ns 1.04ns
T_setup_T typ 2.06ns 1.80ns 1.54ns
T_setup_T max 2.56ns 2.30ns 2.04ns
T_hold_T min 1.04ns 1.30ns 1.56ns
T_hold_T typ 1.94ns 2.20ns 2.46ns
T_hold_T max 2.84ns 3.10ns 3.36ns

This shows that T_hold_T min and T_setup_T min times are out of spec
for RGMII timing. However the KSZ9131 has a minimal value for this time
of 0.8ns which is met under all circumstances.

Signed-off-by: Philippe Schenker <philippe.schenker@toradex.com>
3 years agoboard: verdin-imx8mm: Add KSZ9131 phy skew settings
Philippe Schenker [Wed, 11 Mar 2020 10:59:25 +0000 (11:59 +0100)]
board: verdin-imx8mm: Add KSZ9131 phy skew settings

This patch determines which phy is placed on the board with the PHY ID
then it sets the same settings for KSZ9031 as before but for KSZ9131
it enables both RXC and TXC delay lines in the PHY.
This will compensate the missing delay from the MAC. Other skew
settings are not needed as the traces on board are routed exactly the
same length

Signed-off-by: Philippe Schenker <philippe.schenker@toradex.com>
Tested-by: Igor Opaniuk <igor.opaniuk@toradex.com>
Acked-by: Igor Opaniuk <igor.opaniuk@toradex.com>
3 years agoverdin-imx8mm: Change board phy skew values for our ksz9031
Philippe Schenker [Wed, 11 Mar 2020 10:59:24 +0000 (11:59 +0100)]
verdin-imx8mm: Change board phy skew values for our ksz9031

This patches uses the existing functions for interacting with the
KSZ9031 and uses the values appropriate for our board.

Signed-off-by: Philippe Schenker <philippe.schenker@toradex.com>
Tested-by: Igor Opaniuk <igor.opaniuk@toradex.com>
Acked-by: Igor Opaniuk <igor.opaniuk@toradex.com>