platform/kernel/u-boot.git
20 months agoboard: imx8mp: Add Engicam i.Core MX8M Plus EDIMM2.2 Starter Kit
Manoj Sai [Fri, 26 Aug 2022 12:33:37 +0000 (18:03 +0530)]
board: imx8mp: Add Engicam i.Core MX8M Plus EDIMM2.2 Starter Kit

i.Core MX8M Plus is an EDIMM SoM based on NXP i.MX8M Plus from Engicam.

i.Core MX8M Plus needs to mount on top of this Evaluation board for
creating complete i.Core MX8M Plus EDIMM2.2 Starter Kit.

Add support for it.

Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
Signed-off-by: Manoj Sai <abbaraju.manojsai@amarulasolutions.com>
20 months agoarm64: dts: imx8mp: Add Engicam i.Core MX8M Plus EDIMM2.2 Starter Kit
Manoj Sai [Fri, 26 Aug 2022 12:33:36 +0000 (18:03 +0530)]
arm64: dts: imx8mp: Add Engicam i.Core MX8M Plus EDIMM2.2 Starter Kit

Genaral features:
- LCD 7" C.Touch
- microSD slot
- Ethernet 1Gb
- Wifi/BT
- 2x LVDS Full HD interfaces
- 3x USB 2.0
- 1x USB 3.0
- HDMI Out
- Plus PCIe
- MIPI CSI
- 2x CAN
- Audio Out

i.Core MX8M Plus is an EDIMM SoM based on NXP i.MX8M Plus from Engicam.

i.Core MX8M Plus needs to mount on top of this Evaluation board for
creating complete i.Core MX8M Plus EDIMM2.2 Starter Kit.

Add support for it.

Sync the i.Core MX8M Plus is an EDIMM SoM based on NXP
devicetree file from linux-next tree.
commit <aec8ad34f7f24> (arm64: dts: imx8mp: Add Engicam i.Core MX8M Plus EDIMM2.2 Starter Kit)

Signed-off-by: Manoj Sai <abbaraju.manojsai@amarulasolutions.com>
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
20 months agoarm64: dts: imx8mp: Add Engicam i.Core MX8M Plus SoM
Manoj Sai [Fri, 26 Aug 2022 12:33:35 +0000 (18:03 +0530)]
arm64: dts: imx8mp: Add Engicam i.Core MX8M Plus SoM

i.Core MX8M Plus is an EDIMM SoM based on NXP i.MX8M Plus
from Engicam.

General features:
- NXP i.MX8M Plus
- Up to 4GB LDDR4
- 8 eMMC
- Gigabit Ethernet
- USB 3.0, 2.0 Host/OTG
- PCIe 3.0 interface
- I2S
- LVDS
- rest of i.MX8M Plus features

i.Core MX8M Plus needs to mount on top of Engicam baseboards
for creating complete platform solutions.

Add support for it.

Sync the i.Core MX8M Plus is an EDIMM SoM based on NXP i.MX8M Plus
from Engicam devicetree file from linux-next tree.
commit <eefe06b295087> (arm64: dts: imx8mp: Add Engicam i.Core MX8M Plus SoM)

Signed-off-by: Manoj Sai <abbaraju.manojsai@amarulasolutions.com>
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
20 months agoboard: gateworks: venice: add GW7903 PMIC
Tim Harvey [Thu, 11 Aug 2022 18:57:04 +0000 (11:57 -0700)]
board: gateworks: venice: add GW7903 PMIC

The GW7903 has a BD71847 PMIC on I2C1. Adjust the model compare strings
to add it.

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
Reviewed-by: Fabio Estevam <festevam@denx.de>
Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
20 months agowatchdog: ulp_wdog: add driver model for ulp watchdog driver
Alice Guo [Fri, 21 Oct 2022 08:41:18 +0000 (16:41 +0800)]
watchdog: ulp_wdog: add driver model for ulp watchdog driver

Enable driver model for ulp watchdog timer. When CONFIG_WDT=y and the
status of device node is "okay", initr_watchdog will be called and
finally calls ulp_wdt_probe() and ulp_wdt_start().

Signed-off-by: Alice Guo <alice.guo@nxp.com>
Reviewed-by: Ye Li <ye.li@nxp.com>
Reviewed-by: Stefan Roese <sr@denx.de>
20 months agowatchdog: ulp_wdog: enable watchdog interrupt on imx93
Alice Guo [Fri, 21 Oct 2022 08:41:17 +0000 (16:41 +0800)]
watchdog: ulp_wdog: enable watchdog interrupt on imx93

The reset source of the external PMIC on i.MX93 is WDOG_ANY PAD and the
source of WDOG_ANY PAD is interrupt. Therefore, using PMIC to reset
needs to enable the watchdog interrupt.

Signed-off-by: Alice Guo <alice.guo@nxp.com>
Reviewed-by: Stefan Roese <sr@denx.de>
20 months agowatchdog: ulp_wdog: Update watchdog driver for imx93
Alice Guo [Fri, 21 Oct 2022 08:41:16 +0000 (16:41 +0800)]
watchdog: ulp_wdog: Update watchdog driver for imx93

The WDOG clocks are sourced from the fixed 32KHz (lpo_clk).When the
timeout period exceeds 2 seconds, the value written to the TOVAL
register is larger than 16-bit can represent. Enabling watchdog
prescaler to solve this problem.

Signed-off-by: Alice Guo <alice.guo@nxp.com>
Reviewed-by: Stefan Roese <sr@denx.de>
20 months agoulp_wdog: Update ulp wdog driver for 32bits command
Ye Li [Fri, 21 Oct 2022 08:41:15 +0000 (16:41 +0800)]
ulp_wdog: Update ulp wdog driver for 32bits command

To use 32bits refresh and unlock command as default, check the CMD32EN
bit to select the corresponding commands.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Alice Guo <alice.guo@nxp.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Stefan Roese <sr@denx.de>
20 months agocyclic: Don't disable cylic function upon exceeding CPU time
Stefan Roese [Mon, 17 Oct 2022 07:00:58 +0000 (09:00 +0200)]
cyclic: Don't disable cylic function upon exceeding CPU time

With the migration of the watchdog infrastructure to cyclic functions
it's been noticed, that at least one watchdog driver is broken now. As
the execution time of it's watchdog reset function is quite long.

In general it's not really necessary (right now) to disable the cyclic
function upon exceeding CPU time usage. So instead of disabling the
cylic function in this case, let's just print a warning once to show
this potential problem to the user.

Signed-off-by: Stefan Roese <sr@denx.de>
Suggested-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
Cc: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
Cc: Tom Rini <trini@konsulko.com>
Cc: Pali Rohár <pali@kernel.org>
20 months agosandbox.dtsi: add a sandbox,alarm-wdt instance
Rasmus Villemoes [Tue, 27 Sep 2022 09:54:05 +0000 (11:54 +0200)]
sandbox.dtsi: add a sandbox,alarm-wdt instance

In order to test that we properly handle watchdog(s) during the "wait
for the user to interrupt autoboot" phase, we need a watchdog device
to be watching us.

Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
20 months agosandbox: add SIGALRM-based watchdog device
Rasmus Villemoes [Tue, 27 Sep 2022 09:54:04 +0000 (11:54 +0200)]
sandbox: add SIGALRM-based watchdog device

In order to test that U-Boot actually maintains the watchdog device(s)
during long-running busy-loops, such as those where we wait for the
user to stop autoboot, we need a watchdog device that actually does
something during those loops; we cannot test that behaviour via the DM
test framework.

So introduce a relatively simple watchdog device which is simply based
on calling the host OS' alarm() function; that has the nice property
that a new call to alarm() simply sets a new deadline, and alarm(0)
cancels any existing alarm. These properties are precisely what we
need to implement start/reset/stop. We install our own handler so that
we get a known message printed if and when the watchdog fires, and by
just invoking that handler directly, we get expire_now for free.

The actual calls to the various OS functions (alarm, signal, raise)
need to be done in os.c, and since the driver code cannot get access
to the values of SIGALRM or SIG_DFL (that would require including a
host header, and that's only os.c which can do that), we cannot simply
do trivial wrappers for signal() and raise(), but instead create
specialized functions just for use by this driver.

Apart from enabling this driver for sandbox{,64}_defconfig, also
enable the wdt command which was useful for hand-testing this new
driver (especially with running u-boot under strace).

Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
20 months agowatchdog: introduce a u-boot,autostart property
Rasmus Villemoes [Tue, 27 Sep 2022 09:54:03 +0000 (11:54 +0200)]
watchdog: introduce a u-boot,autostart property

This is a companion to u-boot,noautostart. If one has a single
watchdog device that one does want to have auto-started, but several
others that one doesn't, the only way currently is to set the
CONFIG_WATCHDOG_AUTOSTART and then use the opt-out for the majority.

The main motivation for this is to add an autostarted watchdog device
to the sandbox (to test a fix) without having to set AUTOSTART in
sandbox_defconfig and add the noautostart property to the existing
devices. But it's also nice for symmetry, and the logic in
init_watchdog_dev() becomes simpler to read because we avoid all the
negations.

Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
20 months agowdt: nuvoton: add expire function for generic reset
Jim Liu [Tue, 13 Sep 2022 06:19:24 +0000 (14:19 +0800)]
wdt: nuvoton: add expire function for generic reset

Add expire_now function for generic sysreset request

Signed-off-by: Jim Liu <JJLIU0@nuvoton.com>
20 months agommc: Fix static checker warnings
Venkatesh Yadav Abbarapu [Thu, 29 Sep 2022 04:52:49 +0000 (10:22 +0530)]
mmc: Fix static checker warnings

Correct pointer dereferencing check to be more consistent.

Eliminate the below smatch warning:
drivers/mmc/mmc.c:3118 mmc_init_device()
warn: variable dereferenced before check 'm' (see line 3116)

Signed-off-by: Venkatesh Yadav Abbarapu <venkatesh.abbarapu@amd.com>
Reviewed-by: Michal Simek <michal.simek@amd.com>
Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
20 months agommc: dwmmc: only clear handled interrupts
John Keeping [Thu, 15 Sep 2022 17:56:56 +0000 (18:56 +0100)]
mmc: dwmmc: only clear handled interrupts

Unconditionally clearing DTO when RXDR is set leads to spurious timeouts
in FIFO mode transfers if events occur in the following order:

mask = dwmci_readl(host, DWMCI_RINTSTS);

// Hardware asserts DWMCI_INTMSK_DTO here

dwmci_writel(host, DWMCI_RINTSTS, DWMCI_INTMSK_DTO);

if (mask & DWMCI_INTMSK_DTO) {
// Unreachable as DTO is cleared without being handled!
return 0;
}

Only clear interrupts that we have seen and are handling so that DTO is
not missed.

Signed-off-by: John Keeping <john@metanate.com>
Tested-by: Jerome Forissier <jerome.forissier@linaro.org> (Rock PI 4B)
Tested-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
20 months agommc: stm32_sdmmc2: manage vqmmc
Yann Gautier [Tue, 13 Sep 2022 11:23:46 +0000 (13:23 +0200)]
mmc: stm32_sdmmc2: manage vqmmc

The SDMMC IOs can be in an IO domain, that has to be enabled.
This is done by enabling vqmmc in the driver.
This has no impact on configurations not using an IO domain, the check
can then be executed on all platforms managing regulator, and the vqmmc
regulator enabled on all platforms having it in their DT.

Signed-off-by: Yann Gautier <yann.gautier@foss.st.com>
Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
20 months agommc: stm32_sdmmc2: protect against unsupported modes
Yann Gautier [Tue, 13 Sep 2022 11:23:45 +0000 (13:23 +0200)]
mmc: stm32_sdmmc2: protect against unsupported modes

The UHS modes for SD, HS200 and HS400 modes for eMMC are not supported
by the stm32_sdmmc2 driver.
Make it clear by removing the corresponding caps after parsing the DT.

Signed-off-by: Yann Gautier <yann.gautier@foss.st.com>
Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
20 months agommc: stm32_sdmmc2: add dual data rate support
Yann Gautier [Tue, 13 Sep 2022 11:23:44 +0000 (13:23 +0200)]
mmc: stm32_sdmmc2: add dual data rate support

To support dual data rate with STM32 sdmmc2 driver, the dedicated bit
(DDR - BIT(18)) needs to be set in the CLKRC register. Clock bypass
(no divider) is not allowed in this case. This is required for the
eMMC DDR modes.

Signed-off-by: Yann Gautier <yann.gautier@foss.st.com>
Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
20 months agommc: f_sdh30: Add support for F_SDH30_E51
Kunihiko Hayashi [Fri, 9 Sep 2022 07:23:33 +0000 (16:23 +0900)]
mmc: f_sdh30: Add support for F_SDH30_E51

Add Socionext F_SDH30_E51 IP support. The features of this IP includes
CMD/DAT line delay and force card insertion mode for non-removable cards.
And the IP needs to add some quirks.

Signed-off-by: Kunihiko Hayashi <hayashi.kunihiko@socionext.com>
20 months agommc: sdhci: Add new quirks for SUPPORT_SINGLE
Kunihiko Hayashi [Fri, 9 Sep 2022 07:23:32 +0000 (16:23 +0900)]
mmc: sdhci: Add new quirks for SUPPORT_SINGLE

This patch defines a quirk to disable the block count
for single block transactions.

This is similar to Linux kernel commit d3fc5d71ac4d
("mmc: sdhci: add a quirk for single block transactions").

Signed-off-by: Kunihiko Hayashi <hayashi.kunihiko@socionext.com>
Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
20 months agommc: ftsdc010: make command timeout 250 ms as in the comment
Sergei Antonov [Fri, 2 Sep 2022 07:40:10 +0000 (10:40 +0300)]
mmc: ftsdc010: make command timeout 250 ms as in the comment

Get rid of discrepancy beween comment /* 250 ms */ and code
which shifts by 4 thus dividing by 16.
So change code to shift by 2 and make the timeout value 250 ms.

Signed-off-by: Sergei Antonov <saproj@gmail.com>
Reviewed-by: Rick Chen <rick@andestech.com>
Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
20 months agomtd: spi-nor-core: Fix index value for SCCR dwords
Takahiro Kuwano [Mon, 12 Sep 2022 05:25:40 +0000 (14:25 +0900)]
mtd: spi-nor-core: Fix index value for SCCR dwords

Array index for SCCR 22th DWORD should be 21.

Fixes: bebdc237507c ("mtd: spi-nor: Parse SFDP SCCR Map")
Signed-off-by: Takahiro Kuwano <Takahiro.Kuwano@infineon.com>
Reviewed-by: Jagan Teki <jagan@amarulasolutions.com>
20 months agomtd: spi-nor-core: Rework s25hx_t_post_bfpt_fixup() for flash's internal address...
Takahiro Kuwano [Thu, 1 Sep 2022 06:05:33 +0000 (15:05 +0900)]
mtd: spi-nor-core: Rework s25hx_t_post_bfpt_fixup() for flash's internal address mode

The flash's internal address mode is tracked by nor->add_mode_nbytes and
it is set to 3 in BFPT parse. SEMPER multi-die package parts (>1Gb) are
3- or 4-byte address mode by default, depending on model number. We need
to make sure that 4-byte address mode is used for multi-die package parts.

For single-die package parts (<=1Gb), registers can be accessed by 3-byte
address. Read, program, and erase use the 4B opcodes that always take
4-byte address regardless of flash's internal address mode.

Signed-off-by: Takahiro Kuwano <Takahiro.Kuwano@infineon.com>
Reviewed-by: Jagan Teki <jagan@amarulasolutions.com>
20 months agomtd: spi-nor-core: Rework spansion_read/write_any_reg() to use addr_mode_nbytes
Takahiro Kuwano [Thu, 1 Sep 2022 06:05:32 +0000 (15:05 +0900)]
mtd: spi-nor-core: Rework spansion_read/write_any_reg() to use addr_mode_nbytes

Read/Write Any Register commands take 3- or 4- byte address depending on
flash's internal address mode. The nor->addr_width tracks number of
address bytes used in read/program/erase ops that can be 4
(with 4B opcodes) regardless of flash's internal address mode. The
nor->addr_mode_nbytes tracks flash's internal address mode so replace
nor->addr_width by that.

Signed-off-by: Takahiro Kuwano <Takahiro.Kuwano@infineon.com>
Reviewed-by: Jagan Teki <jagan@amarulasolutions.com>
20 months agomtd: spi-nor-core: Track flash's internal address mode
Takahiro Kuwano [Thu, 1 Sep 2022 06:05:31 +0000 (15:05 +0900)]
mtd: spi-nor-core: Track flash's internal address mode

The nor->addr_width tracks number of address bytes used in
read/program/erase ops and eventually set to 4 for >16MB chips, regardless
of flash's internal address mode. For Infineon SEMPER flash's, we use
Read/Write Any Register commands for configuration and status check.
These commands take 3- or 4-byte address depending on flash's internal
address mode.

Signed-off-by: Takahiro Kuwano <Takahiro.Kuwano@infineon.com>
Reviewed-by: Jagan Teki <jagan@amarulasolutions.com>
20 months agomtd: spi-nor-core: Default to addr_width of 3 for configurable widths
Takahiro Kuwano [Thu, 1 Sep 2022 06:05:30 +0000 (15:05 +0900)]
mtd: spi-nor-core: Default to addr_width of 3 for configurable widths

JESD216D-01 mentions that "defaults to 3-Byte mode; enters 4-Byte mode on
command."

Signed-off-by: Takahiro Kuwano <Takahiro.Kuwano@infineon.com>
Reviewed-by: Jagan Teki <jagan@amarulasolutions.com>
20 months agomtd: spi-nor-ids: Add s28hl512t, s28hl01gt, and s28hs01gt IDs
Takahiro Kuwano [Thu, 25 Aug 2022 07:48:48 +0000 (16:48 +0900)]
mtd: spi-nor-ids: Add s28hl512t, s28hl01gt, and s28hs01gt IDs

Add flash info table entries for s28hl512gt, s28hl01gt, and s28hs01gt.
These devices have the same functionality as s28hs512t.

In spi-nor-core, use device ID byte to detect S28 family instead of
device name.

Signed-off-by: Takahiro Kuwano <Takahiro.Kuwano@infineon.com>
Reviewed-by: Jagan Teki <jagan@amarulasolutions.com>
20 months agomtd: spi-nor-core: Rename configuration macro for S28 support
Takahiro Kuwano [Thu, 25 Aug 2022 07:48:47 +0000 (16:48 +0900)]
mtd: spi-nor-core: Rename configuration macro for S28 support

Change configuration macro name to support all other devices in SEMPER S28
family.

Signed-off-by: Takahiro Kuwano <Takahiro.Kuwano@infineon.com>
Reviewed-by: Jagan Teki <jagan@amarulasolutions.com>
20 months agomtd: spi-nor-core: Rename s28hs512t prefix
Takahiro Kuwano [Thu, 25 Aug 2022 07:48:46 +0000 (16:48 +0900)]
mtd: spi-nor-core: Rename s28hs512t prefix

Change prefix to support all other devices in SEMPER S28 family.

Signed-off-by: Takahiro Kuwano <Takahiro.Kuwano@infineon.com>
Reviewed-by: Jagan Teki <jagan@amarulasolutions.com>
20 months agoMerge branch '2022-10-21-assorted-fixes-and-updates'
Tom Rini [Sat, 22 Oct 2022 15:19:31 +0000 (11:19 -0400)]
Merge branch '2022-10-21-assorted-fixes-and-updates'

- NC-SI handling support and enable on evb-ast2[56]00, gpio driver for
  ADP5585, improve qfw support, print more sysresets info, gw_ventana
  and gcc-12 bugfix, improve BCB support, fix a few typos and remove an
  unused keymile CONFIG symbol.

20 months agoboard/km: drop CONFIG_KM_ROOTFSSIZE
Holger Brunck [Mon, 17 Oct 2022 09:45:21 +0000 (11:45 +0200)]
board/km: drop CONFIG_KM_ROOTFSSIZE

This unused nowadays and can be dropped.

Signed-off-by: Holger Brunck <holger.brunck@hitachienergy.com>
20 months agoblk: fix a couple of trivial documentation typos
Mattijs Korpershoek [Mon, 17 Oct 2022 07:35:04 +0000 (09:35 +0200)]
blk: fix a couple of trivial documentation typos

In some cases, the param variable is wrong, and in other cases we have
undocumented arguments.

Fix the docs.

Signed-off-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
20 months agotest: Fix typo in test name
Michal Suchanek [Sat, 15 Oct 2022 09:30:37 +0000 (11:30 +0200)]
test: Fix typo in test name

For other sandbox tests the printed test name corresponds to the
configuration except for this one.

Signed-off-by: Michal Suchanek <msuchanek@suse.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
20 months agocmd: bcb: select user(0) hwpart in __bcb_load()
Mattijs Korpershoek [Thu, 13 Oct 2022 12:25:59 +0000 (14:25 +0200)]
cmd: bcb: select user(0) hwpart in __bcb_load()

For some blk operations, it's possible that a different hw partition
gets selected via blk_dselect_hwpart().
In that case, only the region of the device covered by that partition
is accessible.

This breaks "bcb load" which attempts to read the gpt and assumes it's
on the user(0) hw partition:

=> bcb load 2 misc
GUID Partition Table Header signature is wrong: 0xDE7B17AD07D9E5D6 != 0x5452415020494645
find_valid_gpt: *** ERROR: Invalid GPT ***
GUID Partition Table Header signature is wrong: 0x0 != 0x5452415020494645
find_valid_gpt: *** ERROR: Invalid Backup GPT ***
Error: mmc 2:misc read failed (-2)

Add a fail-safe in __bcb_load() to ensure we will always read from the
user(0) hwpartition.

This fixes the following fastboot sequence:

$ fastboot erase mmc2boot1    # switch to hwpart1
$ fastboot reboot bootloader  # switch to hwpart0, then reads GPT

Signed-off-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Reviewed-by: Sean Anderson <sean.anderson@seco.com>
20 months agoboard: gateworks: gw_ventana: fix building with GCC 12.2
Heinrich Schuchardt [Wed, 12 Oct 2022 16:59:27 +0000 (18:59 +0200)]
board: gateworks: gw_ventana: fix building with GCC 12.2

Building with GCC 12.2 results in an error

    board/gateworks/gw_ventana/gw_ventana.c:636:68: error: the comparison
    will always evaluate as 'true' for the address of 'pwm_padmux' will
    never be NULL [-Werror=address]
      636 |                 } else if (hwconfig_subarg_cmp(arg, "mode", "pwm") &&
          |                                                                    ^~

Remove the superfluous check.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-By: Tim Harvey <tharvey@gateworks.com>
Reviewed-by: Fabio Estevam <festevam@denx.de>
20 months agocommon: board_f: Print information for all sysresets
Michal Suchanek [Mon, 10 Oct 2022 18:29:40 +0000 (20:29 +0200)]
common: board_f: Print information for all sysresets

Boards can have multiple sysresets, iterate all when printing sysreset
info.

Fixes: 23471aed5c ("board_f: Add reset status printing")
Signed-off-by: Michal Suchanek <msuchanek@suse.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
20 months agosandbox: Initialize sysreset before relocation
Michal Suchanek [Mon, 10 Oct 2022 18:29:39 +0000 (20:29 +0200)]
sandbox: Initialize sysreset before relocation

Without this the early sysreset code cannot be tested.

Signed-off-by: Michal Suchanek <msuchanek@suse.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
20 months agoqemu: Try to automatically boot from the QEMU firmware device (qfw)
Andre Przywara [Mon, 10 Oct 2022 17:01:22 +0000 (18:01 +0100)]
qemu: Try to automatically boot from the QEMU firmware device (qfw)

At the moment the QEMU boot sequence tries various (storage) devices
when trying to find a payload to boot.
To simplify starting a specific kernel and initrd, there is also the qfw
command, which can use the files specified on the QEMU command line, via
the -kernel and -initrd options.
Add this command to the list of boot options to try. Since users
specifying those options on the command line probably explicitly want
to run them, let's place the new command first. Without those options,
the qfw command will just gracefully fail, and we continue with the
existing order.

This allows auto-booting of specific kernels in QEMU, for instance in CI
systems.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
20 months agoqfw: return failure when no kernel could be loaded
Andre Przywara [Mon, 10 Oct 2022 17:01:21 +0000 (18:01 +0100)]
qfw: return failure when no kernel could be loaded

When we try to load a kernel via the QEMU firmware device, we currently
"return -1;" if no kernel was specified on the QEMU command line. This
leads to the usage output, which is confusing (since nothing on the
command line was really wrong), but also somewhat hides the actual error
message.

Return CMD_RET_FAILURE (1), as it's a proper error, and make the message
more clear that this is not only a "warning".

This helps to call this command in boot scripts, and to gracefully
continue if this doesn't work.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
20 months agoqfw: store loaded file size in environment variable
Andre Przywara [Mon, 10 Oct 2022 17:01:20 +0000 (18:01 +0100)]
qfw: store loaded file size in environment variable

At the moment the QEMU firmware command just prints the size of the
loaded binaries on the console.
To go with all the other load methods, and many boot scripts'
expectations, also store the size of the file loaded last in the
environment variable "filesize".
We first put the kernel size in there, but overwrite this with the
initrd size, should we have one, because this is probably the more
prominent user of $filesize (in the booti or bootz command).

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
20 months agogpio: adp5585: add gpio driver for ADP5585 I/O Expander Controller
Alice Guo [Sun, 9 Oct 2022 03:19:22 +0000 (11:19 +0800)]
gpio: adp5585: add gpio driver for ADP5585 I/O Expander Controller

Add gpio driver for ADP5585 I/O Expander Controller. The ADP5585 is a 10
input/output port expander and can be used to increase the number of
I/Os available to a processor.

Signed-off-by: Alice Guo <alice.guo@nxp.com>
20 months agoconfig/aspeed: Enable NC-SI support
Joel Stanley [Mon, 8 Aug 2022 12:16:06 +0000 (21:46 +0930)]
config/aspeed: Enable NC-SI support

Aspeed BMCs are commonly used with NC-SI. A system indicates the driver
should configure the link over NC-SI using the device tree.

Add it to the defconfig so we get compile coverage of the driver, even
if the EVBs do not normally use it.

Signed-off-by: Joel Stanley <joel@jms.id.au>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
Reviewed-by: Cédric Le Goater <clg@kaod.org>
20 months agonet/ftgmac100: Add NC-SI mode support
Samuel Mendoza-Jonas [Mon, 8 Aug 2022 12:16:05 +0000 (21:46 +0930)]
net/ftgmac100: Add NC-SI mode support

Update the ftgmac100 driver to support NC-SI instead of an mdio phy
where available. This is a common setup for Aspeed AST2x00 platforms.

NC-SI mode is determined from the device-tree if either phy-mode sets it
or the use-ncsi property exists. If set then normal mdio setup is
skipped in favour of the NC-SI phy.

Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
Signed-off-by: Joel Stanley <joel@jms.id.au>
Reviewed-by: Cédric Le Goater <clg@kaod.org>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
20 months agocmd: Add ncsi command
Samuel Mendoza-Jonas [Mon, 8 Aug 2022 12:16:04 +0000 (21:46 +0930)]
cmd: Add ncsi command

Adds an "ncsi" command to manually start NC-SI configuration.

Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
Signed-off-by: Joel Stanley <joel@jms.id.au>
Reviewed-by: Cédric Le Goater <clg@kaod.org>
20 months agonet: NC-SI setup and handling
Samuel Mendoza-Jonas [Mon, 8 Aug 2022 12:16:03 +0000 (21:46 +0930)]
net: NC-SI setup and handling

Add the handling of NC-SI ethernet frames, and add a check at the start
of net_loop() to configure NC-SI before starting other network commands.

Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
Signed-off-by: Joel Stanley <joel@jms.id.au>
Reviewed-by: Cédric Le Goater <clg@kaod.org>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
20 months agoMerge branch '2022-10-21-enforce-some-DM-migrations'
Tom Rini [Fri, 21 Oct 2022 19:32:45 +0000 (15:32 -0400)]
Merge branch '2022-10-21-enforce-some-DM-migrations'

- Enforce CONFIG_DM being enabled (which has been the case for all
  boards for a bit now) and remove non-DM_KEYBOARD options as they're also
  unused for some time now.

20 months agoconfigs: Resync with savedefconfig
Tom Rini [Fri, 21 Oct 2022 17:28:36 +0000 (13:28 -0400)]
configs: Resync with savedefconfig

Rsync all defconfig files using moveconfig.py

Signed-off-by: Tom Rini <trini@konsulko.com>
20 months agoinput: Remove legacy KEYBOARD option
Tom Rini [Fri, 14 Oct 2022 11:50:20 +0000 (07:50 -0400)]
input: Remove legacy KEYBOARD option

There are no platforms that have not migrated to using DM_KEYBOARD,
remove the legacy option.

Cc: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
20 months agocore: Enable DM by default
Tom Rini [Fri, 14 Oct 2022 11:50:19 +0000 (07:50 -0400)]
core: Enable DM by default

There are no longer any platforms which do not enable DM, move this to a
def_bool y and remove the check in the Makefile.

Cc: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
20 months agoMerge tag 'u-boot-at91-fixes-2023.01-a' of https://source.denx.de/u-boot/custodians...
Tom Rini [Fri, 21 Oct 2022 12:33:48 +0000 (08:33 -0400)]
Merge tag 'u-boot-at91-fixes-2023.01-a' of https://source.denx.de/u-boot/custodians/u-boot-at91

First set of u-boot-at91 fixes for the 2023.01 cycle:

This small fixes set includes an indentation fix for sam9x60 DT and one
name for one pin for sama7g5.

20 months agoimx8mn-venice-u-boot: Fix broken boot
Fabio Estevam [Mon, 3 Oct 2022 13:59:24 +0000 (10:59 -0300)]
imx8mn-venice-u-boot: Fix broken boot

When the imx8mm.dtsi file was pulled in from Linux, the UARTs
were moved into an spba sub-node which wasn't being included
in the SPL device tree.  This meant the references to the UART
weren't being handled properly and when booting the system would
constantly reboot.  Fix this by adding the spba node to the spl
device tree to restore normal booting.

Based on the patch from Adam Ford for the imx8mn-beacon-kit-u-boot
board.

Fixes: 4e5114daf9eb ("imx8mn: synchronise device tree with linux")
Signed-off-by: Fabio Estevam <festevam@denx.de>
Reviewed-by: Michael Trimarchi <michael@amarulasolutions.com>
20 months agoimx8mn-ddr4-evk-u-boot: Fix broken boot
Fabio Estevam [Mon, 3 Oct 2022 13:39:21 +0000 (10:39 -0300)]
imx8mn-ddr4-evk-u-boot: Fix broken boot

When the imx8mm.dtsi file was pulled in from Linux, the UARTs
were moved into an spba sub-node which wasn't being included
in the SPL device tree.  This meant the references to the UART
weren't being handled properly and when booting the system would
constantly reboot.  Fix this by adding the spba node to the spl
device tree to restore normal booting.

Based on the patch from Adam Ford for the imx8mn-beacon-kit-u-boot
board.

Fixes: 4e5114daf9eb ("imx8mn: synchronise device tree with linux")
Signed-off-by: Fabio Estevam <festevam@denx.de>
Reviewed-by: Michael Trimarchi <michael@amarulasolutions.com>
20 months agoboard: gateworks: gw_ventana: fix mmc env dev
Tim Harvey [Wed, 28 Sep 2022 21:00:35 +0000 (14:00 -0700)]
board: gateworks: gw_ventana: fix mmc env dev

Fix the MMC env device for boards with eMMC by adding a
board_mmc_get_env_dev override to return the boot device as the
MMC env device.

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
20 months agoARM: imx6: dh-imx6: Use sf update instead of sf erase and write
Marek Vasut [Wed, 28 Sep 2022 16:45:18 +0000 (18:45 +0200)]
ARM: imx6: dh-imx6: Use sf update instead of sf erase and write

With sf update fixed to support unaligned start offset, use plain
sf update to update the bootloader in SPI NOR. This also helps
avoid the case where not enough SPI NOR has been erased and the
bootloader has been written to unerased area, and thus corrupted.

Signed-off-by: Marek Vasut <marex@denx.de>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
20 months agoARM: imx: Enable btrfs support on DHSOM
Marek Vasut [Wed, 28 Sep 2022 15:40:11 +0000 (17:40 +0200)]
ARM: imx: Enable btrfs support on DHSOM

The btrfs filesystem provides advanced functionality like copy-on-write
and snapshots, as well as metadata and data duplication and checksumming.
Enable btrfs in U-Boot to permit even the primary partition to be btrfs
and let system boot from it.

Signed-off-by: Marek Vasut <marex@denx.de>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
20 months agocrypto/fsl: fsl_rsa: Fix dcache issue in the driver
Ye Li [Wed, 28 Sep 2022 10:19:02 +0000 (15:49 +0530)]
crypto/fsl: fsl_rsa: Fix dcache issue in the driver

issue:
CAAM fails with key error when perform Modular Exponentiation
using PKHA Block in CAAM

Fix:
add flush and invalidate dcache for keys, signature
and output decrypted data processed by CAAM.

Fixes: 34276478f7 (DM: crypto/fsl - Add Freescale rsa DM driver)
Signed-off-by: Ye Li <ye.li@nxp.com>
Reviewed-by: Gaurav Jain <gaurav.jain@nxp.com>
Acked-by: Peng Fan <peng.fan@nxp.com>
20 months agoapalis/colibri_imx6/-imx6ull/_imx7: update env memory layout
Marcel Ziswiler [Tue, 27 Sep 2022 15:50:52 +0000 (17:50 +0200)]
apalis/colibri_imx6/-imx6ull/_imx7: update env memory layout

Update the distro config env memory layout for the Apalis iMX6,
Colibri iMX6, Colibri iMX6ULL and Colibri iMX7:

- loadaddr=0x84200000 (resp. 0x14200000 on them i.MX 6) allows for 64MB
  area for uncompressing (ie FIT images)
- fdt_addr_r = loadaddr + 64MB : allows for 64MB kernel
- scriptaddr = fdt_addr_r + 512KB : allows for 512KB fdt
- pxefile_addr_r = scriptaddr + 512KB : allows for 512KB script
- ramdisk_addr_r = pxefile_addr_r + 512KB : allows for 1MB extlinux.conf

Memory layout analogous to 64-bit one from commit fd5c7173ade4
("imx8m{m,n}_venice: update env memory layout") but left pxefile_addr_r
updated according to doc/develop/distro.rst.

This fixes a potential issue caused by the compressed kernel being
relocated on top of the ramdisk causing its corruption.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
20 months agonitrogen6x: Remove extra quotes in fdtfile
Ariel D'Alessandro [Tue, 27 Sep 2022 14:24:53 +0000 (11:24 -0300)]
nitrogen6x: Remove extra quotes in fdtfile

After commit 395110284b56 ("nitrogen6x: Populate FDTFILE at build-time
for all platforms") iMX.6Q Sabrelite fails to boot due to a bad fdtfile
string:

  Retrieving file: /dtbs/5.18.0-0.deb11.4-armmp/"imx6q-sabrelite".dtb
  ** File not found /dtbs/5.18.0-0.deb11.4-armmp/"imx6q-sabrelite".dtb **

CONFIG_DEFAULT_DEVICE_TREE option is string typed, so __stringify() is
adding extra quotes. Remove this.

Signed-off-by: Ariel D'Alessandro <ariel.dalessandro@collabora.com>
Reviewed-by: Fabio Estevam <festevam@denx.de>
Acked-by: Troy Kisky <troy.kisky@boundarydevices.com>
20 months agoclk-imx8mm: Only build QSPI clocks when CONFIG_NXP_FSPI=y
Fabio Estevam [Mon, 26 Sep 2022 16:40:11 +0000 (13:40 -0300)]
clk-imx8mm: Only build QSPI clocks when CONFIG_NXP_FSPI=y

The QSPI clocks are only used when CONFIG_NXP_FSPI=y, so only build the
QSPI clocks in this case to reduce the final SPL binary size.

Signed-off-by: Fabio Estevam <festevam@denx.de>
20 months agoclk-imx8mm: Only build ecspi clocks when CONFIG_DM_SPI=y
Fabio Estevam [Mon, 26 Sep 2022 16:40:10 +0000 (13:40 -0300)]
clk-imx8mm: Only build ecspi clocks when CONFIG_DM_SPI=y

The ecspi clocks are only used when CONFIG_DM_SPI=y, so only build the
ecspi clocks in this case to reduce the final SPL binary size.

Signed-off-by: Fabio Estevam <festevam@denx.de>
20 months agoclk-imx8mm: Move CLK_ENET_AXI to the non-SPL section
Fabio Estevam [Mon, 26 Sep 2022 16:40:09 +0000 (13:40 -0300)]
clk-imx8mm: Move CLK_ENET_AXI to the non-SPL section

Ethernet is not used inside SPL, so move the IMX8MM_CLK_ENET_AXI clock
inside the non-SPL block to reduce the final SPL binary size.

Signed-off-by: Fabio Estevam <festevam@denx.de>
20 months agoclk-imx8mm: Only build PWM clocks in non-SPL code
Fabio Estevam [Mon, 26 Sep 2022 16:40:08 +0000 (13:40 -0300)]
clk-imx8mm: Only build PWM clocks in non-SPL code

PWM is not used inside SPL, so do not define the PWM clocks inside
SPL to reduce the final SPL binary size.

Signed-off-by: Fabio Estevam <festevam@denx.de>
20 months agommc: fsl_esdhc: fix problem when using clk driver
Ye Li [Fri, 23 Sep 2022 22:29:33 +0000 (00:29 +0200)]
mmc: fsl_esdhc: fix problem when using clk driver

Move init_clk_usdhc to non-clk driver case, since assigned-clocks properties
will initialize the clocks by clk driver.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Marek Vasut <marex@denx.de>
Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
20 months agoverdin-imx8mm: verdin-imx8mp: drop obsolete net/phy configs
Marcel Ziswiler [Wed, 21 Sep 2022 11:34:19 +0000 (13:34 +0200)]
verdin-imx8mm: verdin-imx8mp: drop obsolete net/phy configs

Drop obsolete networking/PHY related configuration defines.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Fabio Estevam <festevam@denx.de>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
20 months agoboard: tbs2910: Add serial rx buffer in defconfig
Soeren Moch [Tue, 20 Sep 2022 16:05:41 +0000 (18:05 +0200)]
board: tbs2910: Add serial rx buffer in defconfig

... to avoid loosing characters when pasting text into the serial console.
This allows to remove the workaround to disable the vidconsole output
when no HDMI device is detected. This workaround only was there to speed-up
serial console processing.

Signed-off-by: Soeren Moch <smoch@web.de>
Reviewed-by: Fabio Estevam <festevam@denx.de>
20 months agoboard: tbs2910: Set all board dts files as maintained
Soeren Moch [Tue, 20 Sep 2022 16:05:40 +0000 (18:05 +0200)]
board: tbs2910: Set all board dts files as maintained

This also includes the imx6q-tbs2910-u-boot.dtsi file now.

Signed-off-by: Soeren Moch <smoch@web.de>
Reviewed-by: Fabio Estevam <festevam@denx.de>
20 months agoimx8mm_evk: Add Serial Download Protocol support
Fabio Estevam [Tue, 20 Sep 2022 00:20:14 +0000 (21:20 -0300)]
imx8mm_evk: Add Serial Download Protocol support

Add Serial Download Protocol support as it is a useful method to
load flash.bin to RAM and run it via 'uuu'.

With this patch, it is possible to start both U-Boot SPL and U-Boot
proper using the following 'uuu'command:

$ uuu -brun spl flash.bin

Based on a patch from Marek Vasut for the imx8mm-mx8menlo board.

Also, to fit the SPL binary into the internal RAM, select CONFIG_LTO
to reduce its size.

Signed-off-by: Fabio Estevam <festevam@denx.de>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
20 months agoimx8mm_evk: Add an entry for USB boot
Fabio Estevam [Tue, 20 Sep 2022 00:20:13 +0000 (21:20 -0300)]
imx8mm_evk: Add an entry for USB boot

Add an entry for USB boot so that U-Boot could be loaded via
the Serial Download Protocol.

Signed-off-by: Fabio Estevam <festevam@denx.de>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
20 months agoARM: dts: imx8m: imx8mm-mx8menlo: Enable SPL SDP support
Marek Vasut [Mon, 19 Sep 2022 19:41:18 +0000 (21:41 +0200)]
ARM: dts: imx8m: imx8mm-mx8menlo: Enable SPL SDP support

Enable DM USB, DM PHY and USB gadget support in imx8mm-mx8menlo SPL
to let the board continue SDP loading of second stage after the first
stage was loaded by BootROM SDP implementation. It is not possible to
jump back into BootROM v1 and let the BootROM implementation continue
the SDP loading, all this has to be performed by the U-Boot CI HDRC
controller driver and SDP protocol implementation, both of which fit
into the SPL just barely.

With this patch, it is possible to start both U-Boot SPL and U-Boot
using e.g. uuu on this board as follows:

$ uuu -brun spl flash.bin

Signed-off-by: Marek Vasut <marex@denx.de>
Reviewed-by: Fabio Estevam <festevam@denx.de>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
20 months agoARM: imx8m: verdin-imx8mm: Drop bogus content from spl_board_init()
Marek Vasut [Mon, 19 Sep 2022 19:41:17 +0000 (21:41 +0200)]
ARM: imx8m: verdin-imx8mm: Drop bogus content from spl_board_init()

The current implementation of spl_board_init() USB boot handling is
not correct, the MX8MM BootROM v1 does not support SDP load when
re-entered from U-Boot SPL, it is up to U-Boot to perform the next
stage load using its own internal CI gadget driver and SDP protocol
implementation. Drop the spl_board_init() to let SPL continue with
normal load in case the SDP support is enabled.

Signed-off-by: Marek Vasut <marex@denx.de>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
20 months agoARM: imx8m: phycore_imx8mm: Drop bogus spl_board_init()
Marek Vasut [Mon, 19 Sep 2022 19:41:16 +0000 (21:41 +0200)]
ARM: imx8m: phycore_imx8mm: Drop bogus spl_board_init()

The current implementation of spl_board_init() is not correct,
the MX8MM BootROM v1 does not support SDP load when re-entered
from U-Boot SPL, it is up to U-Boot to perform the next stage
load using its own internal CI gadget driver and SDP protocol
implementation. Drop the spl_board_init() to let SPL continue
with normal load in case the SDP support is enabled.

Signed-off-by: Marek Vasut <marex@denx.de>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
20 months agoARM: imx8m: Deduplicate CAAM init with arch_misc_init() call
Marek Vasut [Mon, 19 Sep 2022 19:41:15 +0000 (21:41 +0200)]
ARM: imx8m: Deduplicate CAAM init with arch_misc_init() call

Instead of duplicating code implemented by i.MX8M version of arch_misc_init()
in every board, enable CONFIG_ARCH_MISC_INIT and call arch_misc_init() from
spl_board_init(). This removes the duplication. No functional change.

Signed-off-by: Marek Vasut <marex@denx.de>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
20 months agoARM: dts: at91: sama7g5: fix signal name of pin PB2
Mihai Sain [Mon, 17 Oct 2022 08:37:11 +0000 (11:37 +0300)]
ARM: dts: at91: sama7g5: fix signal name of pin PB2

The signal name of pin PB2 with function F is FLEXCOM11_IO1
as it is defined in the datasheet.

Fixes: 558378a4cd ("ARM: mach-at91: add support for new SoC sama7g5")
Signed-off-by: Mihai Sain <mihai.sain@microchip.com>
20 months agoARM: dts: at91: sam9x60ek: fix indentation for pinctrl sub-nodes
Dario Binacchi [Tue, 20 Sep 2022 08:32:47 +0000 (10:32 +0200)]
ARM: dts: at91: sam9x60ek: fix indentation for pinctrl sub-nodes

The indentation went far on the right due to an extra tab for
each pinctrl sub-nodes.

Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
Reviewed-by: Michael Trimarchi <michael@amarulasolutions.com>
20 months agoMerge tag 'u-boot-rockchip-20221020' of https://source.denx.de/u-boot/custodians...
Tom Rini [Fri, 21 Oct 2022 02:32:38 +0000 (22:32 -0400)]
Merge tag 'u-boot-rockchip-20221020' of https://source.denx.de/u-boot/custodians/u-boot-rockchip

- dts update and sync for rk356x, rk3288, rk3399 from Linux;
- Add rk3399 EAIDK-610 board support;
- Update for puma-rk3399 board;
- some fix and typo fix in different drivers;

20 months agoARM: dts: imx8mm: Swap i.MX8M Mini Menlo board UARTs back
Marek Vasut [Mon, 19 Sep 2022 19:35:56 +0000 (21:35 +0200)]
ARM: dts: imx8mm: Swap i.MX8M Mini Menlo board UARTs back

The first production revision of the MX8M Mini Menlo board implements
a hardware change which swaps console UART and another UART connector.
Implement the swap, which maps the console UART back to the way Verdin
console is mapped.

Signed-off-by: Marek Vasut <marex@denx.de>
20 months agoarm: dts: imx8mm-venice-gw7903: add dig1_ctl and dig2_ctl gpios
Tim Harvey [Fri, 9 Sep 2022 22:58:42 +0000 (15:58 -0700)]
arm: dts: imx8mm-venice-gw7903: add dig1_ctl and dig2_ctl gpios

The GW7903 revision B adds two additional GPIO's to control the
direction of the 2 isolated digital I/O circuits.

Define them as:
 - dig1_ctl
 - dig2_ctl

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
20 months agoboard: gateworks: venice: update GW74xx PMIC config
Tim Harvey [Thu, 8 Sep 2022 21:41:09 +0000 (14:41 -0700)]
board: gateworks: venice: update GW74xx PMIC config

Update the GW74xx PMIC configuration:
 - increase VDD_SOC DVS1 to 0.85V per datasheet
 - increase VDD_SOC DVS0 to 0.95V before first DRAM access
 - increase VDD_ARM DVS0 to 0.95V to support kernel overdrive voltage (OD)
 - remove unnecessary changes to VDD_DRAM as we don't use 3GHz DRAM
 - remove unnecessary change to LDO2 as it is unused

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
v2: update commit log with more detail

20 months agoarm: dts: imx8mp-venice-gw74xx: update M2 gpio hogs
Tim Harvey [Thu, 8 Sep 2022 20:42:01 +0000 (13:42 -0700)]
arm: dts: imx8mp-venice-gw74xx: update M2 gpio hogs

Update the M2 socket gpio hogs such that they are not active on boot by
flagging them as GPIO_ACTIVE_HIGH so that 'output-high' drives high.

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
20 months agoarm: dts: imx8mp-venice-gw74xx: fix uart configuration gpio hogs
Tim Harvey [Thu, 8 Sep 2022 20:41:08 +0000 (13:41 -0700)]
arm: dts: imx8mp-venice-gw74xx: fix uart configuration gpio hogs

Update the UART config gpio hogs such that it is configured for RS232
by default on boot. Additionally rename them to match the names used
on the reset of the venice boards.

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
20 months agoARM: imx8mp: verdin-imx8mp: Add memory size detection
Francesco Dolcini [Wed, 7 Sep 2022 09:51:05 +0000 (11:51 +0200)]
ARM: imx8mp: verdin-imx8mp: Add memory size detection

Add RAM auto-sizing, without this change memory size for all SKU is set
to 8GB and the system will crash on SKU with less memory as soon as the
non existent memory addresses are accessed.

Fixes: 2bc2f817cea7 ("board: toradex: add verdin imx8m plus support")
Signed-off-by: Francesco Dolcini <francesco.dolcini@toradex.com>
Acked-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
20 months agoboard: verdin-imx8mp: add call to ft_common_board_setup
Philippe Schenker [Mon, 29 Aug 2022 17:59:53 +0000 (19:59 +0200)]
board: verdin-imx8mp: add call to ft_common_board_setup

With this call the following attributes get set to the device-tree
and are then accessible from linux in /proc/device-tree/

serial-number: The serial number that is stored in config-block
toradex,board-rev: The version of the module (e.g. V1.1A)
toradex,product-id: The SKU number of the module runnin

Fixes: commit 2bc2f817cea7 ("board: toradex: add verdin imx8m plus support")
Signed-off-by: Philippe Schenker <philippe.schenker@toradex.com>
Acked-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
20 months agoboard: verdin-imx8mm: add call to ft_common_board_setup
Philippe Schenker [Mon, 29 Aug 2022 17:59:52 +0000 (19:59 +0200)]
board: verdin-imx8mm: add call to ft_common_board_setup

With this call the following attributes get set to the device-tree
and are then accessible from linux in /proc/device-tree/

serial-number: The serial number that is stored in config-block
toradex,board-rev: The version of the module (e.g. V1.1A)
toradex,product-id: The SKU number of the module running

Fixes: commit 14d5aeff776b ("board: toradex: Add Verdin iMX8M Mini support")
Signed-off-by: Philippe Schenker <philippe.schenker@toradex.com>
Acked-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
20 months agoimx: kontron-sl-mx8mm: Prepare for I2C display detection in environment script
Frieder Schrempf [Wed, 24 Aug 2022 13:59:20 +0000 (15:59 +0200)]
imx: kontron-sl-mx8mm: Prepare for I2C display detection in environment script

Enable the I2C bus and set a env variable for the reset GPIO of the touch
controller. This allows us to probe the panel in a script.

Signed-off-by: Frieder Schrempf <frieder.schrempf@kontron.de>
Reviewed-by: Fabio Estevam <festevam@denx.de>
20 months agoimx: kontron-sl-mx8mm: Add support for Kontron Electronics SoM SL i.MX8MM OSM-S
Frieder Schrempf [Wed, 24 Aug 2022 13:59:19 +0000 (15:59 +0200)]
imx: kontron-sl-mx8mm: Add support for Kontron Electronics SoM SL i.MX8MM OSM-S

This adds support for the Kontron Electronics SoM SL i.MX8MM OSM-S
and the matching baseboard BL i.MX8MM OSM-S.

The SoM hardware complies to the Open Standard Module (OSM) 1.0
specification, size S (https://sget.org/standards/osm).

The existing board configuration for the non-OSM SoM is reused and
allows to detect the SoM variant at runtime.

Signed-off-by: Frieder Schrempf <frieder.schrempf@kontron.de>
Reviewed-by: Fabio Estevam <festevam@denx.de>
20 months agoimx: kontron-sl-mx8mm: Simplify code in spl.c
Frieder Schrempf [Wed, 24 Aug 2022 13:59:18 +0000 (15:59 +0200)]
imx: kontron-sl-mx8mm: Simplify code in spl.c

Refactor the code a bit without any functional changes.

Signed-off-by: Frieder Schrempf <frieder.schrempf@kontron.de>
Reviewed-by: Fabio Estevam <festevam@denx.de>
20 months agoimx: kontron-sl-mx8mm: Use voltage rail names from schematic for PMIC regulator-names
Frieder Schrempf [Wed, 24 Aug 2022 13:59:17 +0000 (15:59 +0200)]
imx: kontron-sl-mx8mm: Use voltage rail names from schematic for PMIC regulator-names

Improve the naming of the regulators to contain the voltage rail
names from the schematic.

Suggested-by: Heiko Thiery <heiko.thiery@gmail.com>
Signed-off-by: Frieder Schrempf <frieder.schrempf@kontron.de>
Reviewed-by: Fabio Estevam <festevam@denx.de>
20 months agoimx: kontron-sl-mx8mm: Use the VSELECT signal to switch SD card IO voltage
Frieder Schrempf [Wed, 24 Aug 2022 13:59:16 +0000 (15:59 +0200)]
imx: kontron-sl-mx8mm: Use the VSELECT signal to switch SD card IO voltage

It turns out that it is not necessary to declare the VSELECT signal as
GPIO and let the PMIC driver set it to a fixed high level. This switches
the voltage between 3.3V and 1.8V by setting the PMIC register for LDO5
accordingly.

Instead we can do it like other boards already do and simply mux the
VSELECT signal of the USDHC interface to the pin. This makes sure that
the correct voltage is selected by setting the PMIC's SD_VSEL input
to high or low accordingly.

Reported-by: Heiko Thiery <heiko.thiery@gmail.com>
Signed-off-by: Frieder Schrempf <frieder.schrempf@kontron.de>
Reviewed-by: Heiko Thiery <heiko.thiery@gmail.com>
Reviewed-by: Fabio Estevam <festevam@denx.de>
20 months agoimx: kontron-sl-mx8mm: Adjust devicetree names, compatibles and model strings
Frieder Schrempf [Wed, 24 Aug 2022 13:59:15 +0000 (15:59 +0200)]
imx: kontron-sl-mx8mm: Adjust devicetree names, compatibles and model strings

This adjusts the names of the boards and SoMs to the official naming
used by Kontron marketing. These changes also affect devicetree
names and compatibles. The same changes have been submitted to the
Linux kernel.

Signed-off-by: Frieder Schrempf <frieder.schrempf@kontron.de>
Reviewed-by: Fabio Estevam <festevam@denx.de>
20 months agoimx: kontron-sl-mx8mm: Prepare for other i.MX8MM SoM types
Frieder Schrempf [Wed, 24 Aug 2022 13:59:14 +0000 (15:59 +0200)]
imx: kontron-sl-mx8mm: Prepare for other i.MX8MM SoM types

This sets an env variable 'som_type' from the board code. It can
later be used by environment scripts, e. g. to select the proper
devicetree for the board.

Signed-off-by: Frieder Schrempf <frieder.schrempf@kontron.de>
Reviewed-by: Fabio Estevam <festevam@denx.de>
20 months agoimx: kontron-sl-mx8mm: Use new LPDDR4 config parameters
Frieder Schrempf [Wed, 24 Aug 2022 13:59:13 +0000 (15:59 +0200)]
imx: kontron-sl-mx8mm: Use new LPDDR4 config parameters

These parameters are needed for stable performance on new hardware
with Nanya LPDDR4 chips.

Signed-off-by: Frieder Schrempf <frieder.schrempf@kontron.de>
Reviewed-by: Fabio Estevam <festevam@denx.de>
20 months agoimx: kontron-sl-mx8mm: Remove 100mt DDR setpoint
Frieder Schrempf [Wed, 24 Aug 2022 13:59:12 +0000 (15:59 +0200)]
imx: kontron-sl-mx8mm: Remove 100mt DDR setpoint

The new stable configuration is missing the 100mt setpoint, remove
it before updating the config to make sure the changes are separated
cleanly.

Signed-off-by: Frieder Schrempf <frieder.schrempf@kontron.de>
Reviewed-by: Fabio Estevam <festevam@denx.de>
20 months agoimx: kontron-sl-mx8mm: lpddr4_timing.c: Add spaces for proper alignment
Frieder Schrempf [Wed, 24 Aug 2022 13:59:11 +0000 (15:59 +0200)]
imx: kontron-sl-mx8mm: lpddr4_timing.c: Add spaces for proper alignment

Fix the spaces and alignment for easier tracking of changes and comparing
with configs generated by the tools.

Signed-off-by: Frieder Schrempf <frieder.schrempf@kontron.de>
Reviewed-by: Fabio Estevam <festevam@denx.de>
20 months agoimx: kontron-sl-mx8mm: Enable bootaux command
Frieder Schrempf [Wed, 24 Aug 2022 13:59:10 +0000 (15:59 +0200)]
imx: kontron-sl-mx8mm: Enable bootaux command

Enable the bootaux command in order to be able to load a
binary into the M4 core when needed.

Signed-off-by: Frieder Schrempf <frieder.schrempf@kontron.de>
Reviewed-by: Fabio Estevam <festevam@denx.de>
20 months agoimx: kontron-sl-mx8mm: Migrate to use CONFIG_EXTRA_ENV_TEXT
Frieder Schrempf [Wed, 24 Aug 2022 13:59:09 +0000 (15:59 +0200)]
imx: kontron-sl-mx8mm: Migrate to use CONFIG_EXTRA_ENV_TEXT

Move the environment from the board header to a separate text file
and also drop those variables that are already set in env_default.h
from the Kconfig options.

Signed-off-by: Frieder Schrempf <frieder.schrempf@kontron.de>
Reviewed-by: Fabio Estevam <festevam@denx.de>
20 months agoimx: kontron-sl-mx8mm: Enable environment in MMC
Frieder Schrempf [Wed, 24 Aug 2022 13:59:08 +0000 (15:59 +0200)]
imx: kontron-sl-mx8mm: Enable environment in MMC

In case we boot from SD card or eMMC, we also want to load
the environment from the according boot device.

Signed-off-by: Frieder Schrempf <frieder.schrempf@kontron.de>
Reviewed-by: Fabio Estevam <festevam@denx.de>
20 months agoimx: kontron-sl-mx8mm: Add redundant environment and SPI NOR partitions
Frieder Schrempf [Wed, 24 Aug 2022 13:59:07 +0000 (15:59 +0200)]
imx: kontron-sl-mx8mm: Add redundant environment and SPI NOR partitions

Enable the redundant environment feature to allow falling back in case of
storage corruption. The partition layout for the SPI NOR device is added
to the devicetree.

Signed-off-by: Frieder Schrempf <frieder.schrempf@kontron.de>
Reviewed-by: Fabio Estevam <festevam@denx.de>
20 months agoimx: kontron-sl-mx8mm: Enable MTD command
Frieder Schrempf [Wed, 24 Aug 2022 13:59:06 +0000 (15:59 +0200)]
imx: kontron-sl-mx8mm: Enable MTD command

Enable the MTD command to be used for the SPI NOR on the SoM.

Signed-off-by: Frieder Schrempf <frieder.schrempf@kontron.de>
Reviewed-by: Fabio Estevam <festevam@denx.de>
20 months agoimx: kontron-sl-mx8mm: Increase CONFIG_SYS_CBSIZE to 2K
Frieder Schrempf [Wed, 24 Aug 2022 13:59:05 +0000 (15:59 +0200)]
imx: kontron-sl-mx8mm: Increase CONFIG_SYS_CBSIZE to 2K

This allows using the command line with longer lines like
large scripts in env variables.

Signed-off-by: Frieder Schrempf <frieder.schrempf@kontron.de>
Reviewed-by: Fabio Estevam <festevam@denx.de>
20 months agoimx: kontron-sl-mx8mm: Remove custom board_boot_order() workaround
Frieder Schrempf [Wed, 24 Aug 2022 13:59:04 +0000 (15:59 +0200)]
imx: kontron-sl-mx8mm: Remove custom board_boot_order() workaround

Nowadays detecting the SPI NOR as boot device from the ROMAPI is
fixed and works even if the SPI NOR is used as fallback boot device.

Therefore we don't need this workaround anymore.

Signed-off-by: Frieder Schrempf <frieder.schrempf@kontron.de>
Reviewed-by: Fabio Estevam <festevam@denx.de>