]> git.dujemihanovic.xyz Git - u-boot.git/log
u-boot.git
22 months agoARM: meson: Add support for Odroid-N2L
Neil Armstrong [Thu, 26 Jan 2023 09:48:21 +0000 (10:48 +0100)]
ARM: meson: Add support for Odroid-N2L

ODROID-N2L is a variant SBC in small form factor and some peripherals
are removed from ODROID-N2PLUS based on S922X SoC.

- On-board ethernet is removed
- On-board RTC is removed
- USB 3.0 hub is removed, so one USB 2.0 and one USB 3.0 host ports
  are available
- Huge heatsink is replaced with 40x40mm heatsink, 5V active heatsink
  is recommended or a tall passive sink is optional
- 3.5mm earjack is removed
- IR remote receiver is removed
- MIPI DSI port is added

It doesn't use the odroid-n2 board support since ADC revision
collides with Odroid-N2+ and since it doesn't have on-board ethernet
no need to load the MAC address from eFuses.

Link: https://lore.kernel.org/r/20230126-u-boot-odroid-n2l-v1-2-c60f695e0f6c@linaro.org
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
22 months agoARM: dts: Import Odroid-N2L support
Neil Armstrong [Thu, 26 Jan 2023 09:48:20 +0000 (10:48 +0100)]
ARM: dts: Import Odroid-N2L support

Import Odroid-N2L support posted at [1] and merged for Linux v6.3-rc1.

[1] https://lore.kernel.org/all/20230122-topic-odroid-n2l-upstream-initial-v2-0-8d3fea6d403d@linaro.org/

Link: https://lore.kernel.org/r/20230126-u-boot-odroid-n2l-v1-1-c60f695e0f6c@linaro.org
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
23 months agoARM: meson: add support for Odroid Go Ultra
Neil Armstrong [Thu, 19 Jan 2023 13:44:18 +0000 (14:44 +0100)]
ARM: meson: add support for Odroid Go Ultra

This adds initial support for the Hardkernel Odroid Go Ultra.

The Odroid Go Ultra is a portable gaming device with the following
characteristics:
- Amlogic S922X SoC
- RK817 & RK818 PMICs
- 2GiB LPDDR4
- On board 16GiB eMMC
- Micro SD Card slot
- 5inch 854×480 MIPI-DSI TFT LCD
- Earphone stereo jack, 0.5Watt 8Ω Mono speaker
- Li-Polymer 3.7V/4000mAh Battery
- USB-A 2.0 Host Connector
- x16 GPIO Input Buttons
- 2x ADC Analog Joysticks
- USB-C Port for USB2 Device and Charging

The following are not yet handled:
- Battery RK818 Gauge and Charging
- 5inch 854×480 MIPI-DSI TFT LCD

Link: https://lore.kernel.org/r/20230119-u-boot-odroid-go-ultra-v1-2-f96bab9db396@linaro.org
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
23 months agoARM: dts: sync Amlogic ARM64 DT from v6.2-rc1
Neil Armstrong [Thu, 19 Jan 2023 13:44:17 +0000 (14:44 +0100)]
ARM: dts: sync Amlogic ARM64 DT from v6.2-rc1

This syncs the Amlogic G12A, G12B & SM1 base DT + the
Odroid Go Ultra DT from Linux v6.2-rc1 from commmit [1].

[1] 1b929c02afd3 ("Linux 6.2-rc1")

Link: https://lore.kernel.org/r/20230119-u-boot-odroid-go-ultra-v1-1-f96bab9db396@linaro.org
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
23 months agoARM: meson: switch AXG & GX dwc2 otg to DM
Neil Armstrong [Tue, 17 Jan 2023 09:11:46 +0000 (10:11 +0100)]
ARM: meson: switch AXG & GX dwc2 otg to DM

With CONFIG_DM_USB_GADGET=y, we no longer need any board_usb_*() logic
because:
* the dwc2 driver is DM compatible, and handles its own clock enabling
* the dwc3-meson-gxl glue drivers handles "force mode switching"

Remove all mach-meson gx & axg usb code and enable CONFIG_DM_USB_GADGET.

Note: Only configs having both CONFIG_USB_DWC3_MESON_GXL=y *and*
      USB_GADGET_DWC2_OTG=y have been updated.

Thanks for the original work from Mattijs at [1]

[1] https://lore.kernel.org/all/20221024-meson-dm-usb-v1-2-2ab077a503b9@baylibre.com/

Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Link: https://lore.kernel.org/r/20230117-u-boot-usb-gxl-otg-dm-v1-2-2853f6d75b06@linaro.org
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
23 months agousb: dwc3-meson-gxl: force mode on child add/removal
Neil Armstrong [Tue, 17 Jan 2023 09:11:45 +0000 (10:11 +0100)]
usb: dwc3-meson-gxl: force mode on child add/removal

arch/mach-meson has some custom usb logic, in particular:
* on board_usb_init(), we force USB_DR_MODE_PERIPHERAL
* on board_usb_cleanup(), we force USB_DR_MODE_HOST

With DM_USB_GADGET=y, board_usb_init/cleanup() are no
longer used when we call usb_gadget_initialize().
Instead, the generic (from udc-uclass) initialization/release is
called, which itself calls the controller driver's probe()/remove().

Therefore, enabling DM_USB_GADGET=y will mean that this mode
switching will break.

To prepare for enabling DM_USB_GADGET, perform the mode switching
when the "amlogic,meson-g12a-usb" (dwc2) driver is
probed()/removed() instead.

This is achieved via the glue driver, which gets notified each time one
of its children is probed()/removed.

Note: this change should be harmless without DM_USB_GADGET=y
because the amlogic-g12a-usb driver is not probed via driver model.

Thanks for Mattijs for the original work at [1].

[1] https://lore.kernel.org/all/20221024-meson-dm-usb-v1-1-2ab077a503b9@baylibre.com/

Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Reviewed-by: Marek Vasut <marex@denx.de>
Link: https://lore.kernel.org/r/20230117-u-boot-usb-gxl-otg-dm-v1-1-2853f6d75b06@linaro.org
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
23 months agoARM: meson: g12a: switch dwc2 otg to DM
Mattijs Korpershoek [Wed, 23 Nov 2022 15:42:50 +0000 (16:42 +0100)]
ARM: meson: g12a: switch dwc2 otg to DM

With CONFIG_DM_USB_GADGET=y, we no longer need any board_usb_*() logic
because:
* the dwc2 driver is DM compatible, and handles its own clock enabling
* the dwc3-meson-g12a glue drivers handles "force mode switching"

Remove all mach-meson/g12a usb code and enable CONFIG_DM_USB_GADGET.

Note: Only configs having both CONFIG_USB_DWC3_MESON_G12A=y *and*
      USB_GADGET_DWC2_OTG=y have been updated.

Signed-off-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Link: https://lore.kernel.org/r/20221024-meson-dm-usb-v1-2-2ab077a503b9@baylibre.com
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
23 months agousb: dwc3-meson-g12a: force mode on child add/removal
Mattijs Korpershoek [Wed, 23 Nov 2022 15:42:49 +0000 (16:42 +0100)]
usb: dwc3-meson-g12a: force mode on child add/removal

arch/mach-meson has some custom usb logic, in particular:
* on board_usb_init(), we force USB_DR_MODE_PERIPHERAL
* on board_usb_cleanup(), we force USB_DR_MODE_HOST

With DM_USB_GADGET=y, board_usb_init/cleanup() are no
longer used when we call usb_gadget_initialize().
Instead, the generic (from udc-uclass) initialization/release is
called, which itself calls the controller driver's probe()/remove().

Therefore, enabling DM_USB_GADGET=y will mean that this mode
switching will break.

To prepare for enabling DM_USB_GADGET, perform the mode switching
when the "amlogic,meson-g12a-usb" (dwc2) driver is
probed()/removed() instead.

This is achieved via the glue driver, which gets notified each time one
of its children is probed()/removed.

Note: this change should be harmless without DM_USB_GADGET=y
because the amlogic-g12a-usb driver is not probed via driver model.

Signed-off-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Link: https://lore.kernel.org/r/20221024-meson-dm-usb-v1-1-2ab077a503b9@baylibre.com
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
23 months agodoc/usage: cmd: sm: documentation efusedump cmd
Alexey Romanov [Tue, 10 Jan 2023 10:56:50 +0000 (13:56 +0300)]
doc/usage: cmd: sm: documentation efusedump cmd

Added docs about sm efusedump command, that reads bytes
from efuse memory bank and print them to the console.

Signed-off-by: Alexey Romanov <avromanov@sberdevices.ru>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Link: https://lore.kernel.org/r/20230110105650.54580-6-avromanov@sberdevices.ru
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
23 months agocmd/arm: meson: sm: introduce efusedump command
Alexey Romanov [Tue, 10 Jan 2023 10:56:49 +0000 (13:56 +0300)]
cmd/arm: meson: sm: introduce efusedump command

Using this command user can print efuse memory:

$ sm efusedump 0 10
  00000000: ff 00 31 00 00 ff 66 00 00 00      ..1...f...

Signed-off-by: Alexey Romanov <avromanov@sberdevices.ru>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Link: https://lore.kernel.org/r/20230110105650.54580-5-avromanov@sberdevices.ru
[narmstrong: added display_options.h include for print_buffer()]
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
23 months agodoc/usage: cmd: documentation for meson/sm command
Alexey Romanov [Tue, 10 Jan 2023 10:56:48 +0000 (13:56 +0300)]
doc/usage: cmd: documentation for meson/sm command

Added docs for Meson Security Monitor command.

Signed-off-by: Alexey Romanov <avromanov@sberdevices.ru>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Link: https://lore.kernel.org/r/20230110105650.54580-4-avromanov@sberdevices.ru
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
23 months agoarm/mach-meson: move smc commands in cmd/meson
Alexey Romanov [Tue, 10 Jan 2023 10:56:47 +0000 (13:56 +0300)]
arm/mach-meson: move smc commands in cmd/meson

It is incorrect to keep commands in the arch/ folder.

Signed-off-by: Alexey Romanov <avromanov@sberdevices.ru>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Link: https://lore.kernel.org/r/20230110105650.54580-3-avromanov@sberdevices.ru
[narmstrong: moved after cmd/sound in index.rst]
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
23 months agoasm/arch-meson: add missing meson_sm_write_efuse signature
Alexey Romanov [Tue, 10 Jan 2023 10:56:46 +0000 (13:56 +0300)]
asm/arch-meson: add missing meson_sm_write_efuse signature

This function can be used by other modules. Also add comments.

Signed-off-by: Alexey Romanov <avromanov@sberdevices.ru>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Link: https://lore.kernel.org/r/20230110105650.54580-2-avromanov@sberdevices.ru
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
23 months agoboard: amlogic: jethub j100: add rescue boot from microSD
Viacheslav Bocharov [Thu, 22 Dec 2022 09:33:58 +0000 (12:33 +0300)]
board: amlogic: jethub j100: add rescue boot from microSD

The new JetHub D1+ has a microSD slot. Add rescue boot from microSD

Signed-off-by: Viacheslav Bocharov <adeep@lexina.in>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Link: https://lore.kernel.org/r/20221222093358.204520-1-adeep@lexina.in
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
23 months agons16650: Correct CONFIG_SYS_NS16550_MEM32 platforms
Tom Rini [Fri, 6 Jan 2023 03:47:44 +0000 (22:47 -0500)]
ns16650: Correct CONFIG_SYS_NS16550_MEM32 platforms

There are currently no platform that are both CONFIG_SYS_NS16550_MEM32
and not (per how the logic was prior to being broken in 0478dac62a9a
("kbuild: Remove uncmd_spl logic")) enabled in CONFIG_DM_SERIAL. We drop
this line out now so that platforms which do use
CONFIG_SYS_NS16550_MEM32 and depending on stage may or may not have
DM_SERIAL set.

Fixes: 0478dac62a9a ("kbuild: Remove uncmd_spl logic")
Reported-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
Signed-off-by: Tom Rini <trini@konsulko.com>
Tested-by: Quentin Schulz <quentin.schulz@theobroma-systems.com> #on Ringneck PX30, Puma RK3399
23 months agoMerge branch 'next'
Tom Rini [Mon, 9 Jan 2023 16:30:08 +0000 (11:30 -0500)]
Merge branch 'next'

Signed-off-by: Tom Rini <trini@konsulko.com>
23 months agoPrepare v2023.01
Tom Rini [Mon, 9 Jan 2023 16:07:33 +0000 (11:07 -0500)]
Prepare v2023.01

Signed-off-by: Tom Rini <trini@konsulko.com>
23 months agoboard: rockchip: Fix binman_init failure on EVB-RK3568
Jagan Teki [Sun, 8 Jan 2023 16:17:34 +0000 (21:47 +0530)]
board: rockchip: Fix binman_init failure on EVB-RK3568

For some newer SoCs like RK3568, the Rockchip has not released
any DDR drivers yet so idbloader needs to create manually using
DDR binaries offered by rkbin. This indeed no requirement to
enable TPL in the U-Boot source code.

If we mark TPL disabled and mark BINMAN enabled by default then
there would be an issue of binman_init failure during board
relocation. This is true as binman failed to find the top-level
node like u-boot-tpl here.

Here is the boot issue observed in Radxa-CM3 RK3566 board,

 U-Boot 2023.01-rc4-00057-gac2505d463-dirty (Jan 04 2023 - 23:44:18 +0530)

 Model: Radxa Compute Module 3(CM3) IO Board
 DRAM:  2 GiB
 binman_init failed:-2
 initcall sequence 000000007ffd2008 failed at call 0000000000a18cac (err=-2)
 ### ERROR ### Please RESET the board ###

This might be fixed via binman node in rockchip-u-boot.dtsi however
disable BINMAN_FDT for evb-rk3568 defconfig for now as we are at the
end of the release cycle.

Fixes: 05713d570762 ("rockchip: generate u-boot-rockchip.bin with binman
for ARM64 boards")
Cc: Quentin Schulz <quentin.schulz@theobroma-systems.com>
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
23 months agoMerge tag 'u-boot-nand-20230108' of https://source.denx.de/u-boot/custodians/u-boot...
Tom Rini [Sun, 8 Jan 2023 18:12:42 +0000 (13:12 -0500)]
Merge tag 'u-boot-nand-20230108' of https://source.denx.de/u-boot/custodians/u-boot-nand-flash into next

Pull request for u-boot-nand-20230108

- rawnand: omap_gpmc: driver model support

23 months agodistro_bootcmd: Fix copy-paste error
Marek Vasut [Thu, 5 Jan 2023 01:26:03 +0000 (02:26 +0100)]
distro_bootcmd: Fix copy-paste error

The "SCRIPT FAILED" string is copied from scan_dev_for_scripts script,
update it so it prints "EXTLINUX FAILED" instead in scan_dev_for_extlinux
script.

Signed-off-by: Marek Vasut <marex@denx.de>
23 months agomtd: rawnand: omap_elm: u-boot driver model support
Roger Quadros [Tue, 20 Dec 2022 10:22:03 +0000 (12:22 +0200)]
mtd: rawnand: omap_elm: u-boot driver model support

Support u-boot driver model. We still retain
support legacy way of doing things if ELM_BASE
is defined in <asm/arch/hardware.h>

We could completely get rid of that if all
platforms defining ELM_BASE get rid of that definition
and enable CONFIG_SYS_NAND_SELF_INIT and are verified
to work.

Signed-off-by: Roger Quadros <rogerq@kernel.org>
Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com>
Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Link: https://lore.kernel.org/all/20221220102203.52398-9-rogerq@kernel.org
Link: https://lore.kernel.org/all/CABGWkvrvKiVA_yaDnHJcHEKwc+pEuLdz=i6HQEY0oJQvohCUsw@mail.gmail.com
23 months agodt-bindings: mtd: Add ti, elm DT binding documentation
Roger Quadros [Tue, 20 Dec 2022 10:22:02 +0000 (12:22 +0200)]
dt-bindings: mtd: Add ti, elm DT binding documentation

Adds DT binding documentation for the TI Error Location Module.
This is picked up from the Linux Kernel.

Signed-off-by: Roger Quadros <rogerq@kernel.org>
Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com>
Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
Link: https://lore.kernel.org/all/20221220102203.52398-8-rogerq@kernel.org
23 months agomtd: rawnand: omap_gpmc: Enable SYS_NAND_PAGE_COUNT for OMAP_GPMC
Roger Quadros [Tue, 20 Dec 2022 10:22:01 +0000 (12:22 +0200)]
mtd: rawnand: omap_gpmc: Enable SYS_NAND_PAGE_COUNT for OMAP_GPMC

The symbol is required for NAND support in SPL when using
OMAP_GPMC driver.

Signed-off-by: Roger Quadros <rogerq@kernel.org>
Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com>
Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
Link: https://lore.kernel.org/all/20221220102203.52398-7-rogerq@kernel.org
23 months agomtd: rawnand: omap_gpmc: Add SPL NAND support
Roger Quadros [Tue, 20 Dec 2022 10:22:00 +0000 (12:22 +0200)]
mtd: rawnand: omap_gpmc: Add SPL NAND support

Enables SPL NAND support for ARCH_K3 by enabling
SPL_NAND_INIT and SPL_SYS_NAND_SELF_INIT.

Legacy OMAP2plus platforms still rely on SPL_NAND_AM33XX_BCH
instead.

Signed-off-by: Roger Quadros <rogerq@kernel.org>
Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com>
Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
Link: https://lore.kernel.org/all/20221220102203.52398-6-rogerq@kernel.org
23 months agomtd: rawnand: omap_gpmc: support u-boot driver model
Roger Quadros [Tue, 20 Dec 2022 10:21:59 +0000 (12:21 +0200)]
mtd: rawnand: omap_gpmc: support u-boot driver model

Adds driver model support.

We need to be able to self initialize the NAND controller/chip
at probe and so enable CONFIG_SYS_NAND_SELF_INIT.

Doing so requires nand_register() API which is provided by nand.c
and needs to be enabled during SPL build via CONFIG_SPL_NAND_INIT.
But nand.c also provides nand_init() so we need to get rid of nand_init()
in omap_gpmc driver if CONFIG_SPL_NAND_INIT is set.

Signed-off-by: Roger Quadros <rogerq@kernel.org>
Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com>
Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
Link: https://lore.kernel.org/all/20221220102203.52398-5-rogerq@kernel.org
23 months agodt-bindings: mtd: Add ti, gpmc-nand DT binding documentation
Roger Quadros [Tue, 20 Dec 2022 10:21:58 +0000 (12:21 +0200)]
dt-bindings: mtd: Add ti, gpmc-nand DT binding documentation

Add DT binding documentation for the TI GPMC NAND controller.
This is picked up from the Linux Kernel.

Signed-off-by: Roger Quadros <rogerq@kernel.org>
Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com>
Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
Link: https://lore.kernel.org/all/20221220102203.52398-4-rogerq@kernel.org
23 months agomtd: rawnand: nand_base: Allow base driver to be used in SPL without nand_bbt
Roger Quadros [Tue, 20 Dec 2022 10:21:57 +0000 (12:21 +0200)]
mtd: rawnand: nand_base: Allow base driver to be used in SPL without nand_bbt

nand_bbt.c is not being built with the nand_base driver during SPL
build. This results in build failures if we try to access any nand_bbt
related functions.

Don't use any nand_bbt functions for SPL build.

Signed-off-by: Roger Quadros <rogerq@kernel.org>
Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com>
Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
Link: https://lore.kernel.org/all/20221220102203.52398-3-rogerq@kernel.org
23 months agomtd: rawnand: omap_gpmc: Fix BCH6/16 HW based correction
Roger Quadros [Tue, 20 Dec 2022 10:21:56 +0000 (12:21 +0200)]
mtd: rawnand: omap_gpmc: Fix BCH6/16 HW based correction

The BCH detection hardware can generate ECC bytes for multiple
sectors in one go. Use that feature.

correct() only corrects one sector at a time so we need to call it
repeatedly for each sector.

Signed-off-by: Roger Quadros <rogerq@kernel.org>
Reviewed-by: Michael Trimarchi <michael@amarulasolutions.com>
Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com>
Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
Link: https://lore.kernel.org/all/20221220102203.52398-2-rogerq@kernel.org
23 months agopylibfdt: Allow version normalization to fail
Tom Rini [Sat, 7 Jan 2023 23:02:26 +0000 (18:02 -0500)]
pylibfdt: Allow version normalization to fail

In some cases, we might not have the sic portion of setuputils
available. Make our import and use of this be done in try/except blocks
as this is done to suppress a run-time warning that is otherwise
non-fatal.

Reported-by: Pali Rohár <pali@kernel.org>
Fixes: 141659187667 ("pylibfdt: Fix disable version normalization")
Signed-off-by: Tom Rini <trini@konsulko.com>
23 months agocommon/memsize.c: Check for overflow in get_effective_memsize() only for mpc85xx
Pali Rohár [Sat, 7 Jan 2023 21:55:26 +0000 (22:55 +0100)]
common/memsize.c: Check for overflow in get_effective_memsize() only for mpc85xx

This reverts commit 777aaaa706bc ("common/memsize.c: Fix
get_effective_memsize() to check for overflow") for non-mpc85xx platforms.

The changes to this generic function, which is intended to help with
32bit platforms with large amounts of memory has unintended side effects
(which in turn lead to boot failures) on other platforms which were
previously functional.

For now do overflow check only for powerpc mpc85xx platform. It is needed
to prevent crashing of P1/P2 boards with 4GB DDR module in 32-bit mode.

Fixes: 777aaaa706bc ("common/memsize.c: Fix get_effective_memsize() to check for overflow")
Signed-off-by: Pali Rohár <pali@kernel.org>
23 months agoMerge tag 'efi-2023-01-rc5-4' of https://source.denx.de/u-boot/custodians/u-boot-efi
Tom Rini [Sat, 7 Jan 2023 17:32:42 +0000 (12:32 -0500)]
Merge tag 'efi-2023-01-rc5-4' of https://source.denx.de/u-boot/custodians/u-boot-efi

Pull request efi-2023-01-rc5-4

UEFI:

* correct the vexpress loaddr which collides with memory used by EFI
* consider the EFI memory map for LMB memory reservation
* avoid RWX section warnings for .data section of *_efi.so files

23 months agoefi_loader: make .data section of *_efi.so files RW
Heinrich Schuchardt [Wed, 4 Jan 2023 22:43:08 +0000 (23:43 +0100)]
efi_loader: make .data section of *_efi.so files RW

When building with binutils 2.39 warnings

    *_efi.so has a LOAD segment with RWX permissions

occur.

Use SHF_WRITE | SHF_ALLOC as section flags for the .data section.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
23 months agolmb: consider EFI memory map
Heinrich Schuchardt [Wed, 4 Jan 2023 00:36:14 +0000 (01:36 +0100)]
lmb: consider EFI memory map

Add reservations for all EFI memory areas that are not
EFI_CONVENTIONAL_MEMORY.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
23 months agoefi_loader: carve out efi_get_memory_map_alloc()
Heinrich Schuchardt [Thu, 5 Jan 2023 17:26:01 +0000 (18:26 +0100)]
efi_loader: carve out efi_get_memory_map_alloc()

Carve out code from efidebug command used to read the memory map.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
23 months agovexpress: adjust loadaddr
Heinrich Schuchardt [Wed, 4 Jan 2023 02:17:15 +0000 (03:17 +0100)]
vexpress: adjust loadaddr

On the vexpress_ca9x4 $loadaddr points to a memory area used by the EFI
sub-system. Use the same value as $kernel_addr_r which is safe.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
23 months agoMerge tag 'u-boot-at91-2023.04-a' of https://source.denx.de/u-boot/custodians/u-boot...
Tom Rini [Fri, 6 Jan 2023 16:53:26 +0000 (11:53 -0500)]
Merge tag 'u-boot-at91-2023.04-a' of https://source.denx.de/u-boot/custodians/u-boot-at91 into next

First set of u-boot-at91 features for the 2023.04 cycle:

This feature set includes the new DM-based NAND flash driver (old non-DM
driver is still kept for backwards compatibility), and the move to DM
NAND flash driver for sam9x60ek board. Feature set also includes
devicetree alignment for sama7g5 with Linux, devicetree alignment on USB
with Linux for all boards (sama5, sam9x60), chip id for sama7g5, minor
configs and tweaks.

23 months agoMerge tag 'u-boot-stm32-20230106' of https://gitlab.denx.de/u-boot/custodians/u-boot-stm
Tom Rini [Fri, 6 Jan 2023 13:16:15 +0000 (08:16 -0500)]
Merge tag 'u-boot-stm32-20230106' of https://gitlab.denx.de/u-boot/custodians/u-boot-stm

- stm32mp: Fix board_get_usable_ram_top(): workaround to avoid issue after the
  commit 777aaaa706b ("common/memsize.c: Fix get_effective_memsize() to check
  for overflow") because the effective DDR effective size is reduce by 4KiB
  and sometime the board hang on boot

23 months agoMerge branch '2023-01-06-further-regression-fixes'
Tom Rini [Fri, 6 Jan 2023 13:14:28 +0000 (08:14 -0500)]
Merge branch '2023-01-06-further-regression-fixes'

- Bring in a number of important regression fixes for among others,
  uniphier, PXE booting, socrates, imx7d-pico, rockchip video and
  rzg2_beacon as well as making the python version warning fix more
  portable.

23 months agoarm: rmobile: rzg2_beacon: Enable alternative Ethernet PHY
Adam Ford [Wed, 4 Jan 2023 18:05:43 +0000 (12:05 -0600)]
arm: rmobile: rzg2_beacon: Enable alternative Ethernet PHY

Due to the part shortage, the AR8031 PHY was replaced with a
Micrel KSZ9131. Enabling both config options keeps backward
compatibility with either platform, and both appear to be
auto-detected.

Signed-off-by: Adam Ford <aford173@gmail.com>
Reviewed-by: Marek Vasut <marek.vasut+renesas@gmail.com>
23 months agoarm: dts: rz-g2-beacon-u-boot: Fix QSPI Regression
Adam Ford [Wed, 4 Jan 2023 15:53:09 +0000 (09:53 -0600)]
arm: dts: rz-g2-beacon-u-boot: Fix QSPI Regression

The QSPI is accessed via the RPC-IF, but the compatible flags
previously used a different name.  This compatibel name was changed
which broke the ability to access the QSPI.  Fix this by removing
the custom naming reference.

Fixes: 68083b897b57 ("renesas: Fix RPC-IF compatible values")
Signed-off-by: Adam Ford <aford173@gmail.com>
Reviewed-by: Marek Vasut <marek.vasut+renesas@gmail.com>
23 months agopylibfdt: Fix disable version normalization
Philippe Schenker [Wed, 4 Jan 2023 14:43:33 +0000 (15:43 +0100)]
pylibfdt: Fix disable version normalization

On Arch Linux based systems python setuptools does not contain
"setuptools.extern" hence it is failing with the following
error-message:
"
ModuleNotFoundError: No module named 'setuptools.extern'
"

According to a eschwartz `setuptools.extern` is not a public API and
shall not be assumed to be present in the setuptools package. He
mentions that the setuptools project anyway wants to drop this. [1]

Use the correct solution introduced by python setuptools developers to
disable normalization. [2]

[1] https://bbs.archlinux.org/viewtopic.php?id=259608
[2] https://github.com/pypa/setuptools/pull/2026
Fixes: 440098c42e73 ("pylibfdt: Fix version normalization warning")
Signed-off-by: Philippe Schenker <philippe.schenker@toradex.com>
Reviewed-by: Marek Vasut <marex@denx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
23 months agocmd: pxe_utils: Limit fdtcontroladdr usage to non-fitImage
Marek Vasut [Wed, 14 Dec 2022 06:45:18 +0000 (07:45 +0100)]
cmd: pxe_utils: Limit fdtcontroladdr usage to non-fitImage

Commit d5ba6188dfb ("cmd: pxe_utils: Check fdtcontroladdr in label_boot")
forces '$fdtcontroladdr' DT address as a third parameter of bootm command
even if the PXE transfer pulls in a fitImage which contains configuration
node with its own DT that is preferrable to be passed to Linux. Limit the
$fdtcontroladdr fallback utilization to non-fitImages, since it is highly
likely a fitImage would come with its own DT, while single-file images do
need a separate DT.

Fixes: d5ba6188dfb ("cmd: pxe_utils: Check fdtcontroladdr in label_boot")
Signed-off-by: Marek Vasut <marex@denx.de>
Reviewed-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
Tested-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Peter Hoyes <peter.hoyes@arm.com>
Tested-by: Peter Hoyes <peter.hoyes@arm.com>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
23 months agoRevert "Revert "cmd: pxe_utils: Check fdtcontroladdr in label_boot""
Marek Vasut [Sat, 17 Dec 2022 17:41:13 +0000 (18:41 +0100)]
Revert "Revert "cmd: pxe_utils: Check fdtcontroladdr in label_boot""

This reverts commit ed6251187afabf811a5fd49a44ebd61c53c7b378.

Superseded by "cmd: pxe_utils: Limit fdtcontroladdr usage to non-fitImage"
which is less heavy-handed approach and retains part of the original
behavior for non-fitImage.

Signed-off-by: Marek Vasut <marex@denx.de>
Acked-by: Neil Armstrong <neil.armstrong@linaro.org>
23 months agorockchip: Fix the broken Video out for rk3288 boards
Jagan Teki [Mon, 2 Jan 2023 18:23:45 +0000 (23:53 +0530)]
rockchip: Fix the broken Video out for rk3288 boards

Video out on RK3288 boards has been broken since from few
releases due to the adding of reset support on vop but
missed enabling DM_RESET on associated boards.

This patch fixes those RK3288 boards.

Cc: Simon Glass <sjg@chromium.org>
Cc: Lin Huang <hl@rock-chips.com>
Cc: Jernej Skrabec <jernej.skrabec@gmail.com>
Cc: Michael Trimarchi <michael@amarulasolutions.com>
Cc: Arnaud Patard (Rtp) <arnaud.patard@rtp-net.org>
Fixes: <9749d2ea29e1> ("rockchip: video: vop: Add reset support")
Reported-by: Manoj Sai <abbaraju.manojsai@amarulasolutions.com>
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
23 months agoi2c: uniphier-f: correct error recovery
Dai Okamura [Fri, 9 Dec 2022 11:38:27 +0000 (20:38 +0900)]
i2c: uniphier-f: correct error recovery

The uniphier i2c block can recognize some handshake errors.
But driver handles all error detections as no error if no timeout.
So this makes unrecoverable state.

This replaces the return values with the right ones to tell the i2c
framework the errors:
- EDEADLK for arbitration lost error
- ENODATA for no answer error

Signed-off-by: Dai Okamura <okamura.dai@socionext.com>
Acked-by: Kunihiko Hayashi <hayashi.kunihiko@socionext.com>
Reviewed-by: Heiko Schocher <hs@denx.de>
23 months agoimx7d-pico: Fix the name of the u-boot.dtsi file
Fabio Estevam [Sat, 31 Dec 2022 16:25:14 +0000 (13:25 -0300)]
imx7d-pico: Fix the name of the u-boot.dtsi file

Since commit 2f96d4dd95f8 ("imx7s/d: synchronise device trees with linux")
the imx7d-pico board no longer boots.

The reason is that prior to the above commit there was an explicit
inclusion of arch/arm/dts/imx7d-pico-u-boot.dtsi inside imx7d-pico.dtsi.

After the syncing with the Linux upstream dtsi, this u-boot.dtsi inclusion
is gone and the board fails to boot.

U-Boot uses the imx7d-pico-pi.dtb file, so rename the u-boot.dtsi to
imx7d-pico-pi-u-boot.dtsi which gets included automatically by U-Boot
standard make logic and makes the board boot again.

Signed-off-by: Fabio Estevam <festevam@denx.de>
23 months agopowerpc/mpc85xx: socrates: Re-enable building u-boot-socrates.bin
Pali Rohár [Wed, 28 Dec 2022 18:18:39 +0000 (19:18 +0100)]
powerpc/mpc85xx: socrates: Re-enable building u-boot-socrates.bin

U-Boot build system builds final U-Boot binary for socrates board in custom
file u-boot-socrates.bin (instead of standard u-boot.bin). Output target
file u-boot-socrates.bin is generated by binman as defined in board binman
config file arch/powerpc/dts/socrates-u-boot.dtsi.

But binman was disabled in commit 5af42eafd7e1 ("Makefile: Reduce usage of
custom mpc85xx u-boot.bin target") for all mpc85xx boards which do not use
standard powerpc binman config file arch/powerpc/dts/u-boot.dtsi and boards
which do not require binman at all.

The only such mpc85xx board is socrates. So since that commit, U-Boot does
not final binary for socrates board anymore.

Fix this issue by re-enabling binman for socrates board. And build process
starts again producing u-boot-socrates.bin binary.

Note that build process for this socrates board always produce u-boot.bin
binary which is broken and not usable for socrates board. Long term
solution should be to disable building broken binary u-boot.bin and then
renaming u-boot-socrates.bin to u-boot.bin, or switching to use common
powerpc binman config file arch/powerpc/dts/socrates-u-boot.dtsi (if it is
possible).

Fixes: 5af42eafd7e1 ("Makefile: Reduce usage of custom mpc85xx u-boot.bin target")
Signed-off-by: Pali Rohár <pali@kernel.org>
Tested-by: Heiko Schocher <hs@denx.de>
23 months agoarm: stm32mp: Fix board_get_usable_ram_top() again
Marek Vasut [Thu, 5 Jan 2023 01:22:22 +0000 (02:22 +0100)]
arm: stm32mp: Fix board_get_usable_ram_top() again

Do not access gd->ram_size and assume this is actual valid RAM size. Since commit
777aaaa706b ("common/memsize.c: Fix get_effective_memsize() to check for overflow")
the RAM size may be less than gd->ram_size , call get_effective_memsize() to get
the limited value instead.

The aforementioned commit makes STM32MP15xx boards with 1 GiB of DRAM
at 0xc0000000 hang on boot, which is a grave defect.

Signed-off-by: Marek Vasut <marex@denx.de>
Reviewed-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
23 months agoMerge tag 'dm-next-5jan23' of https://source.denx.de/u-boot/custodians/u-boot-dm...
Tom Rini [Fri, 6 Jan 2023 03:54:26 +0000 (22:54 -0500)]
Merge tag 'dm-next-5jan23' of https://source.denx.de/u-boot/custodians/u-boot-dm into next

patman enhancements and fixes

23 months agopatman: add '--get-maintainer-script' argument
Maxim Cournoyer [Tue, 20 Dec 2022 05:28:46 +0000 (00:28 -0500)]
patman: add '--get-maintainer-script' argument

This makes it possible to configure a project to use some other
location or script than the default scripts/get_maintainer.pl one used
in the U-Boot and Linux projects. It can be configured via a .patman
configuration file and accepts arguments, as documented.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Maxim Cournoyer <maxim.cournoyer@savoirfairelinux.com>
23 months agopatman: additionally honor a local .patman config file
Maxim Cournoyer [Tue, 20 Dec 2022 05:38:41 +0000 (00:38 -0500)]
patman: additionally honor a local .patman config file

This enables versioning a project specific patman configuration file.
It also makes it possible to declare the project name, which is not a
useful thing to do in $HOME/.patman.  A new test is added, along
updated documentation.

Signed-off-by: Maxim Cournoyer <maxim.cournoyer@savoirfairelinux.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
23 months agopatman: fail early in Setup when provided config file does not exist
Maxim Cournoyer [Tue, 20 Dec 2022 05:38:40 +0000 (00:38 -0500)]
patman: fail early in Setup when provided config file does not exist

Rationale: if the user explicitly provide this argument, they probably
intend for it to be used.

Signed-off-by: Maxim Cournoyer <maxim.cournoyer@savoirfairelinux.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
23 months agopatman: set the default config_fname argument value to None
Maxim Cournoyer [Tue, 20 Dec 2022 05:38:39 +0000 (00:38 -0500)]
patman: set the default config_fname argument value to None

This better matches Python conventions, allowing to easily test
whether the optional argument is provided.

Signed-off-by: Maxim Cournoyer <maxim.cournoyer@savoirfairelinux.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
23 months agopatman: import gitutil module where it is needed
Maxim Cournoyer [Tue, 20 Dec 2022 05:38:38 +0000 (00:38 -0500)]
patman: import gitutil module where it is needed

Instead of propagating it from the module entry point (main script).

Signed-off-by: Maxim Cournoyer <maxim.cournoyer@savoirfairelinux.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
23 months agopatman: replace deprecated SafeConfigParser with ConfigParser
Maxim Cournoyer [Tue, 20 Dec 2022 05:38:37 +0000 (00:38 -0500)]
patman: replace deprecated SafeConfigParser with ConfigParser

The SafeConfigParser class has been renamed in Python 3.2 to
ConfigParser, and the old alias has been deprecated since.

Signed-off-by: Maxim Cournoyer <maxim.cournoyer@savoirfairelinux.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
23 months agopatman: fix pep8 warnings in settings module
Maxim Cournoyer [Tue, 20 Dec 2022 05:38:36 +0000 (00:38 -0500)]
patman: fix pep8 warnings in settings module

Remove extraneous imports, variables and comply to PEP 8 maximum line
width, among other PEP 8 changes suggested by Pyflake.

Signed-off-by: Maxim Cournoyer <maxim.cournoyer@savoirfairelinux.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
23 months agopatman: document default 'send' command
Maxim Cournoyer [Mon, 19 Dec 2022 22:32:45 +0000 (17:32 -0500)]
patman: document default 'send' command

Document that this command is the default and what it's intended for.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Maxim Cournoyer <maxim.cournoyer@savoirfairelinux.com>
23 months agopatman: document how to run test suite via pytest
Maxim Cournoyer [Mon, 19 Dec 2022 22:32:44 +0000 (17:32 -0500)]
patman: document how to run test suite via pytest

Pytest offers useful features such as selecting tests by means of a
regular expression, or running the pdb debugger upon encountering a
test failure.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Maxim Cournoyer <maxim.cournoyer@savoirfairelinux.com>
23 months agopatman: hide the 'test' command unless test data is available
Maxim Cournoyer [Mon, 19 Dec 2022 22:32:43 +0000 (17:32 -0500)]
patman: hide the 'test' command unless test data is available

Some tests would fail when the test data is not available, so it
doesn't make much sense to expose the action when patman is running
outside of the u-boot git checkout.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Maxim Cournoyer <maxim.cournoyer@savoirfairelinux.com>
23 months agopatman: add pytest configuration file
Maxim Cournoyer [Mon, 19 Dec 2022 22:32:42 +0000 (17:32 -0500)]
patman: add pytest configuration file

With this change, a user can run the patman test suite using Pytest
the same as when using 'patman test':

    $ cd tools/patman && pytest
    [...]
    44 passed, 8 warnings in 8.87s

    $ ./patman test
    Ran 44 tests in 8.460s

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Maxim Cournoyer <maxim.cournoyer@savoirfairelinux.com>
23 months agopatman: rename main script to __main__.py
Maxim Cournoyer [Mon, 19 Dec 2022 22:32:41 +0000 (17:32 -0500)]
patman: rename main script to __main__.py

This allows running the package as a Python module, like e.g.:

    $ python -m patman

It also prevents Pytest from attempting to parse main.py, which
would cause errors.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Maxim Cournoyer <maxim.cournoyer@savoirfairelinux.com>
Fix up main.py in __init__.py:
Signed-off-by: Simon Glass <sjg@chromium.org>
23 months agopatman: invoke the checkpatch.pl script with '--u-boot' and '--strict'
Maxim Cournoyer [Mon, 19 Dec 2022 22:32:40 +0000 (17:32 -0500)]
patman: invoke the checkpatch.pl script with '--u-boot' and '--strict'

This resolves 10 out of 11 test failures seen when running './patman
test' from the 'tools/patman' subdirectory. This was caused by the
.checkpatch.conf configuration file at the root of the project not
being picked up. Make the test suite of patman independent from it by
always invoking the checkpatch.pl script with the minimally required
arguments for the test suite to pass.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Maxim Cournoyer <maxim.cournoyer@savoirfairelinux.com>
23 months agopatman: locate test data files via __file__ and pathlib
Maxim Cournoyer [Mon, 19 Dec 2022 22:32:39 +0000 (17:32 -0500)]
patman: locate test data files via __file__ and pathlib

Previously it would rely on the executing script location, which could
break for example when running the tests via 'pytest'.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Maxim Cournoyer <maxim.cournoyer@savoirfairelinux.com>
23 months agopatman: cosmetic: Fix PEP 8 warnings for the gitutil module.
Maxim Cournoyer [Mon, 19 Dec 2022 22:32:38 +0000 (17:32 -0500)]
patman: cosmetic: Fix PEP 8 warnings for the gitutil module.

This patch fixes all the PEP 8 warnings reported by Pyflake for the
gitutil module.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Maxim Cournoyer <maxim.cournoyer@savoirfairelinux.com>
23 months agopatman: locate README.rst via importlib
Maxim Cournoyer [Sat, 17 Dec 2022 01:45:29 +0000 (20:45 -0500)]
patman: locate README.rst via importlib

Rationale: this is more robust than assumptions about the file
hierarchy layout of the installation of patman, for example on non
file-hierarchy standard (FHS) systems such as Guix System or Nix OS.

Signed-off-by: Maxim Cournoyer <maxim.cournoyer@savoirfairelinux.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
23 months agopatman: fix installation of README.rst data file
Maxim Cournoyer [Sat, 17 Dec 2022 01:45:28 +0000 (20:45 -0500)]
patman: fix installation of README.rst data file

This fixes a regression introduced in commit 74df491051d6 ("buildman:
Convert documentation to rST").

Signed-off-by: Maxim Cournoyer <maxim.cournoyer@savoirfairelinux.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
23 months agopatman: remove extraneous imports
Maxim Cournoyer [Sat, 17 Dec 2022 01:45:27 +0000 (20:45 -0500)]
patman: remove extraneous imports

* tools/patman/main.py: Remove extraneous imports and fix indentation.

Signed-off-by: Maxim Cournoyer <maxim.cournoyer@savoirfairelinux.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
23 months agotest:dm:fix typo
Yuepeng Xing [Fri, 2 Dec 2022 06:23:07 +0000 (14:23 +0800)]
test:dm:fix typo

Fix typos in the 'test/dm' directory.

Signed-off-by: Yuepeng Xing <xingyuepeng@eswincomputing.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
23 months agopatman: Switch to setuptools
Sean Anderson [Sun, 27 Nov 2022 21:55:02 +0000 (16:55 -0500)]
patman: Switch to setuptools

distutils is about to meet its demise [1]. Switch to setuptools.

[1] https://peps.python.org/pep-0632/

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
23 months agoreset: at91: Add reset driver for basic assert/deassert operations
Sergiu Moga [Wed, 4 Jan 2023 14:03:18 +0000 (16:03 +0200)]
reset: at91: Add reset driver for basic assert/deassert operations

Add support for at91 reset controller's basic assert/deassert
operations. Since this driver conflicts with the
SYSRESET driver because they both bind to the same RSTC node,
implement a custom bind hook that would manually bind the
sysreset driver, if enabled, to the same RSTC DT node.
Furthermore, delete the no longer needed compatibles from the
SYSRESET driver and rename it to make sure than any possible
conflicts are avoided.

Signed-off-by: Sergiu Moga <sergiu.moga@microchip.com>
Tested-by: Mihai Sain <mihai.sain@microchip.com>
Reviewed-by: Claudiu Beznea <claudiu.beznea@microchip.com>
23 months agoARM: at91: add sama7 SFR definitions
Cristian Birsan [Wed, 4 Jan 2023 14:03:17 +0000 (16:03 +0200)]
ARM: at91: add sama7 SFR definitions

Special Function Registers(SFR) definitions for SAMA7 product family.

Signed-off-by: Cristian Birsan <cristian.birsan@microchip.com>
Signed-off-by: Sergiu Moga <sergiu.moga@microchip.com>
23 months agoARM: dts: sama5d27_wlsom1_ek: Add pinctrl nodes for USB DT nodes
Sergiu Moga [Wed, 4 Jan 2023 14:04:18 +0000 (16:04 +0200)]
ARM: dts: sama5d27_wlsom1_ek: Add pinctrl nodes for USB DT nodes

Add the pinctrl nodes required by the USB related DT nodes.

Signed-off-by: Sergiu Moga <sergiu.moga@microchip.com>
23 months agoARM: dts: sama5d2_icp: Add pinctrl nodes for USB related DT nodes
Sergiu Moga [Wed, 4 Jan 2023 14:04:17 +0000 (16:04 +0200)]
ARM: dts: sama5d2_icp: Add pinctrl nodes for USB related DT nodes

Add the pinctrl subnodes required by the USB related DT nodes.

Signed-off-by: Sergiu Moga <sergiu.moga@microchip.com>
23 months agoARM: dts: sama7g5ek: Add pinctrl, gpio and phy properties for USB
Sergiu Moga [Wed, 4 Jan 2023 14:04:16 +0000 (16:04 +0200)]
ARM: dts: sama7g5ek: Add pinctrl, gpio and phy properties for USB

Add the required pinctrl, gpio and phy properties required by the
USB DT nodes of the sama7g5ek boards. Since these have not yet been
defined in upstream Linux, place them in the U-Boot specific DT file.

Signed-off-by: Sergiu Moga <sergiu.moga@microchip.com>
23 months agoARM: dts: sama7g5: Add USB and UTMI DT nodes
Sergiu Moga [Wed, 4 Jan 2023 14:04:15 +0000 (16:04 +0200)]
ARM: dts: sama7g5: Add USB and UTMI DT nodes

Define the USB and UTMI DT nodes for the sama7g5 SoC's. Since these have
not yet been defined in upstream Linux, place them in the U-Boot specific
DT file.

Signed-off-by: Sergiu Moga <sergiu.moga@microchip.com>
Reviewed-by: Marek Vasut <marex@denx.de>
23 months agodt-bindings: clk: at91: Define additional UTMI related clocks
Sergiu Moga [Wed, 4 Jan 2023 14:04:14 +0000 (16:04 +0200)]
dt-bindings: clk: at91: Define additional UTMI related clocks

Add definitions for an additional main UTMI clock as well as its
respective subclocks.

Signed-off-by: Sergiu Moga <sergiu.moga@microchip.com>
23 months agodt-bindings: reset: add sama7g5 definitions
Sergiu Moga [Wed, 4 Jan 2023 14:04:13 +0000 (16:04 +0200)]
dt-bindings: reset: add sama7g5 definitions

Upstream linux commit 5994f58977e0.

Add reset bindings for SAMA7G5. At the moment only USB PHYs are
included.

The three reset USB phy's have their ID's mapped from 4 to 6. There are
no USB phy's with ID's numbered from 0 to 3.

Signed-off-by: Sergiu Moga <sergiu.moga@microchip.com>
23 months agoARM: dts: sam9x60ek: Add pinctrl and gpio properties for USB
Sergiu Moga [Wed, 4 Jan 2023 14:04:12 +0000 (16:04 +0200)]
ARM: dts: sam9x60ek: Add pinctrl and gpio properties for USB

Add the required pinctrl and gpio properties required by the USB DT
nodes of the sam9x60ek boards.

Signed-off-by: Sergiu Moga <sergiu.moga@microchip.com>
23 months agoARM: dts: sam9x60_curiosity: Add pinctrl and gpio properties for USB
Sergiu Moga [Wed, 4 Jan 2023 14:04:11 +0000 (16:04 +0200)]
ARM: dts: sam9x60_curiosity: Add pinctrl and gpio properties for USB

Add the required pinctrl and gpio properties needed by the USB DT nodes
of the sam9x60_curiosity boards.

Signed-off-by: Sergiu Moga <sergiu.moga@microchip.com>
23 months agoARM: dts: sam9x60: Add OHCI and EHCI DT nodes
Sergiu Moga [Wed, 4 Jan 2023 14:04:10 +0000 (16:04 +0200)]
ARM: dts: sam9x60: Add OHCI and EHCI DT nodes

Add the OHCI and EHCI DT nodes for the sam9x60 SoC's.

Signed-off-by: Sergiu Moga <sergiu.moga@microchip.com>
Reviewed-by: Marek Vasut <marex@denx.de>
23 months agoMerge tag 'efi-2023-01-rc5-3' of https://source.denx.de/u-boot/custodians/u-boot-efi
Tom Rini [Wed, 4 Jan 2023 13:50:24 +0000 (08:50 -0500)]
Merge tag 'efi-2023-01-rc5-3' of https://source.denx.de/u-boot/custodians/u-boot-efi

Pull request for efi-2023-01-rc5-3

Documentation:

* Describe building documentation

UEFI:

* Add .data section to aarch64 EFI binaries and correct section flags
* Correct sorting of capsules when updating
* Populate console handles in system table

Other:

* Fix description of eth_env_[gs]et_enetaddr() return value
* Avoid endless loop in sound play command

23 months agoefi_loader: populate console handles in system table
Heinrich Schuchardt [Wed, 4 Jan 2023 04:56:09 +0000 (05:56 +0100)]
efi_loader: populate console handles in system table

The fields ConsoleInHandle, ConsoleOutHandle, ConsoleErrHandle must point
to the handles with the respective console protocols. Failure to do so
leads to an error in the EFI Shell:

    No SimpleTextInputEx was found. CTRL-based features are not usable.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
23 months agoefi_loader: adjust sorting of capsules
Heinrich Schuchardt [Thu, 29 Dec 2022 13:44:05 +0000 (14:44 +0100)]
efi_loader: adjust sorting of capsules

Up to now we only compared the first letter of the capsule name to sort
them alphabetically. Properly sort by the Unicode alphabet.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
23 months agotest: unit test for u16_strcasecmp()
Heinrich Schuchardt [Thu, 29 Dec 2022 13:44:04 +0000 (14:44 +0100)]
test: unit test for u16_strcasecmp()

Provide a unit test for u16_strcasecmp().

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
23 months agolib: add function u16_strcasecmp()
Heinrich Schuchardt [Thu, 29 Dec 2022 13:44:03 +0000 (14:44 +0100)]
lib: add function u16_strcasecmp()

Provide a function for comparing UTF-16 strings in a case insensitive
manner.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
23 months agoefi_loader: fix building aarch64 EFI binaries
Heinrich Schuchardt [Sat, 31 Dec 2022 10:58:54 +0000 (11:58 +0100)]
efi_loader: fix building aarch64 EFI binaries

While our EFI binaries execute without problems on EDK II they crash on
a Lenovo X13s. Let our binaries look more like what EDK II produces:

* move all writable data to a .data section
* align sections to 4 KiB boundaries (matching EFI page size)
* remove IMAGE_SCN_LNK_NRELOC_OVFL from .reloc section flags

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
23 months agoefi_loader: defines for PE-COFF section flags
Heinrich Schuchardt [Wed, 4 Jan 2023 11:18:54 +0000 (12:18 +0100)]
efi_loader: defines for PE-COFF section flags

Provide constants for the section flags used by binaries.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
23 months agodoc: Fix eth_env_[gs]et_enetaddr() return value
Marek Vasut [Sun, 18 Dec 2022 07:05:02 +0000 (08:05 +0100)]
doc: Fix eth_env_[gs]et_enetaddr() return value

Per env/common.c, eth_env_get_enetaddr() returns the same return
values as is_valid_ethaddr(), i.e. true if valid, false otherwise.
Per env/common.c, eth_env_set_enetaddr() may return -EEXIST is the
ethaddr is already set. Fix both.

Signed-off-by: Marek Vasut <marex@denx.de>
Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
23 months agodoc: building documentation
Heinrich Schuchardt [Fri, 30 Dec 2022 04:05:31 +0000 (05:05 +0100)]
doc: building documentation

Provide a man-page describing how to build the U-Boot documentation.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
23 months agocmd: avoid endless loop in sound play command
Heinrich Schuchardt [Fri, 30 Dec 2022 23:49:10 +0000 (00:49 +0100)]
cmd: avoid endless loop in sound play command

A parameter starting with a hyphen leads to an endless loop in the sound
play command.

Leave it to dectoul() to handle the hyphen. It will return 0 for a negative
number.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
23 months agoconfigs: sam9x60: add mmc config for sdmmc1
Mihai Sain [Fri, 23 Dec 2022 06:43:53 +0000 (08:43 +0200)]
configs: sam9x60: add mmc config for sdmmc1

Add new config for storing environment from SDMMC1.

Signed-off-by: Mihai Sain <mihai.sain@microchip.com>
23 months agoboard: at91: sam9x60: set blue led on at boot time
Mihai Sain [Fri, 23 Dec 2022 06:39:36 +0000 (08:39 +0200)]
board: at91: sam9x60: set blue led on at boot time

Set blue led on at boot time in order to highlight that u-boot is loaded.
This is done for all sam9x60 based boards which contain an RGB led.

Signed-off-by: Mihai Sain <mihai.sain@microchip.com>
23 months agoARM: dts: at91: sam9x60: add sdhci1 node and pinctrl
Mihai Sain [Fri, 23 Dec 2022 06:47:17 +0000 (08:47 +0200)]
ARM: dts: at91: sam9x60: add sdhci1 node and pinctrl

Add node for sdhci1 controller and its pinctrl.

Signed-off-by: Mihai Sain <mihai.sain@microchip.com>
23 months agoMerge branch '2023-01-02-platform-updates' into next
Tom Rini [Mon, 2 Jan 2023 23:07:41 +0000 (18:07 -0500)]
Merge branch '2023-01-02-platform-updates' into next

- Synquacer updates / fixes, PowerPC keymile platform dts fix, assorted
  TI platform updates, ht1380 RTC driver, serial driver cleanups,
  pg_wcom defconfig updates, s5p4418 DM_SERIAL (and legacy code removal).

23 months agoarm: s5p4418: dm_serial: remove old code / add DEBUG_UART
Stefan Bosch [Sun, 18 Dec 2022 12:26:47 +0000 (12:26 +0000)]
arm: s5p4418: dm_serial: remove old code / add DEBUG_UART

Remove init of UART-clock and UART-reset in arch_cpu_init(). Add DEBUG_UART
to s5p4418_nanopi2_defconfig.

Signed-off-by: Stefan Bosch <stefan_b@posteo.net>
23 months agoarm: s5p4418: dm_serial: switch to DM_SERIAL
Stefan Bosch [Sun, 18 Dec 2022 12:25:33 +0000 (12:25 +0000)]
arm: s5p4418: dm_serial: switch to DM_SERIAL

Switch the S5P4418-SOC and therefore the s5p4418_nanopi2 board to
DM_SERIAL.

Signed-off-by: Stefan Bosch <stefan_b@posteo.net>
23 months agoarm: s5p4418: dm_serial: add uarts to dts
Stefan Bosch [Sun, 18 Dec 2022 12:24:33 +0000 (12:24 +0000)]
arm: s5p4418: dm_serial: add uarts to dts

Add S5P4418 UARTs and appropriate pinctrl to dts. Add UART to
s5p4418-nanopi2.dts.

Signed-off-by: Stefan Bosch <stefan_b@posteo.net>
23 months agoarm: s5p4418: dm_serial: add driver source code
Stefan Bosch [Sun, 18 Dec 2022 12:20:49 +0000 (12:20 +0000)]
arm: s5p4418: dm_serial: add driver source code

Add dm_serial driver source code for S5P4418 SOC. Extend the "arm,pl011"
driver by init of UART-clock and UART-reset.

Signed-off-by: Stefan Bosch <stefan_b@posteo.net>
23 months agoboard/pg_wcom: rework defconfig
Holger Brunck [Wed, 14 Dec 2022 10:30:07 +0000 (11:30 +0100)]
board/pg_wcom: rework defconfig

Switch off SCSI related config options to get rid of the board
removal warning. We don't use this interface. Also disable UBIFS
to decrease the image size, as this is also not used.

Signed-off-by: Holger Brunck <holger.brunck@hitachienergy.com>
23 months agoboard: ti: common: board_detect: Fix EEPROM read quirk for 2-byte
Neha Malcom Francis [Tue, 13 Dec 2022 06:27:34 +0000 (11:57 +0530)]
board: ti: common: board_detect: Fix EEPROM read quirk for 2-byte

EEPROM detection logic in ti_i2c_eeprom_get() involves figuring out
whether addressing is 1-byte or 2-byte. There are currently different
behaviours seen across boards as documented in commit bf6376642fe8
("board: ti: common: board_detect: Fix EEPROM read quirk"). Adding to
the list, we see that there are 2-byte EEPROMs that read properly
with 1-byte addressing with no offset.

For ti_i2c_eeprom_am6_get where eeprom parse operation is dynamic, the
earlier commit d2ab2a2bafd5 ("board: ti: common: board_detect: Fix
EEPROM read quirk for AM6 style data") tried to resolve this by running
ti_i2c_eeprom_get() twice. However this commit along with its former
commit fails on J7 platforms where EEPROM successfully return back the
header on 1-byte addressing and continues to do so until an offset is
introduced. So the second read incorrectly determines the EEPROM as
1-byte addressing.

A more generic solution is introduced here to solve
this issue: 1-byte read without offset and 1-byte read with offset. If
both passes, it follows 1-byte addressing else we proceed with 2-byte
addressing check.

Tested on J721E, J7200, DRA7xx, AM64x

Signed-off-by: Neha Malcom Francis <n-francis@ti.com>
Fixes: d2ab2a2bafd5 (board: ti: common: board_detect: Fix EEPROM read quirk for AM6 style data)
Fixes: bf6376642fe8 (board: ti: common: board_detect: Fix EEPROM read quirk)
Tested-By: Matwey V. Kornilov <matwey.kornilov@gmail.com>