platform/kernel/u-boot.git
22 months agoefi_loader: fix get_package_list_handle() status
Vincent Stehlé [Tue, 13 Dec 2022 21:39:09 +0000 (22:39 +0100)]
efi_loader: fix get_package_list_handle() status

When the HII protocol function get_package_list_handle() is called with an
invalid package list handle, it returns EFI_NOT_FOUND but this is not in
its list of possible status codes as per the EFI specification.
Return EFI_INVALID_PARAMETER instead to fix conformance.

Signed-off-by: Vincent Stehlé <vincent.stehle@arm.com>
Cc: Heinrich Schuchardt <xypron.glpk@gmx.de>
Cc: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
22 months agodoc: improve wget man-page
Heinrich Schuchardt [Thu, 22 Dec 2022 10:32:03 +0000 (11:32 +0100)]
doc: improve wget man-page

* correct formatting of synopsis
* improve description of TCP SACK configuration

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
22 months agodoc: Use "changesets" not "csets" in statistics pages
Tom Rini [Wed, 21 Dec 2022 23:04:10 +0000 (18:04 -0500)]
doc: Use "changesets" not "csets" in statistics pages

To make things more human readable, say "changesets from" rather than
"csets from" in all our historical pages here. Moving forward this has
been changed in our gitdm with b034e399e31a ("gitdm: fix typo csets").

Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
22 months agodoc: add texinfodocs and infodocs targets
Maxim Cournoyer [Mon, 19 Dec 2022 02:48:08 +0000 (21:48 -0500)]
doc: add texinfodocs and infodocs targets

Sphinx supports generating Texinfo sources and Info documentation,
which can be navigated easily and is convenient to search (via the
indexed nodes or anchors, for example).  This is basically the same as
1f050e904dd6f2955eecbd22031d912ccb2e7683, which was recently applied
to the Linux kernel.

Signed-off-by: Maxim Cournoyer <maxim.cournoyer@savoirfairelinux.com>
Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
22 months agodoc: board: qemu-ppce500: Update supported and unsupported
Pali Rohár [Tue, 20 Dec 2022 20:06:26 +0000 (21:06 +0100)]
doc: board: qemu-ppce500: Update supported and unsupported

qemu can emulate also e500v1 core but cannot emulate CPUs from Freescale
PowerPC QorIQ T and P series.

Signed-off-by: Pali Rohár <pali@kernel.org>
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
22 months agodoc: ti: add the K3 generation page
Bryan Brattlof [Mon, 19 Dec 2022 20:29:50 +0000 (14:29 -0600)]
doc: ti: add the K3 generation page

Texas Instrument's entire K3 generation of SoCs use much of the same
frameworks and boot flow, especially at the uboot level. Though there
are small differences introduced as each new K3 based SoC is developed
and as the K3 generation matures that will also need to be documented.

Rather than copying the same documentation, with the small differences
applicable to that specific SoC to a new page, introduce a new K3
page that can describe the general boot flow and design decisions for
the entire K3 generation of chips, leaving the specifics for that
particular SoC to a unique sub-page below this one.

Signed-off-by: Bryan Brattlof <bb@ti.com>
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
22 months agodoc: ti: reorganize existing ti docs
Bryan Brattlof [Mon, 19 Dec 2022 20:29:49 +0000 (14:29 -0600)]
doc: ti: reorganize existing ti docs

Texas Instruments produces quite a lot of SoCs based upon a common
architecture 'generation'. (eg: OMAP, K3) TI's existing documentation
layout makes noticing this generation jump rather difficult.

To make navigation easier, split the existing documentation into
individual SoC families so we may begin grouping them according to their
generational (eg: OMAP, K3) families.

Signed-off-by: Bryan Brattlof <bb@ti.com>
Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
22 months agoMerge https://source.denx.de/u-boot/custodians/u-boot-pmic
Tom Rini [Tue, 27 Dec 2022 02:00:20 +0000 (21:00 -0500)]
Merge https://source.denx.de/u-boot/custodians/u-boot-pmic

- power: regulator: Add support for NPCM8xx

22 months agopower: regulator: Add support for NPCM8xx
Jim Liu [Mon, 7 Nov 2022 02:48:27 +0000 (10:48 +0800)]
power: regulator: Add support for NPCM8xx

Add support for setting nuvoton BMC NPCM845 voltage supply.

Signed-off-by: Jim Liu <JJLIU0@nuvoton.com>
22 months agoMerge tag 'tpm-23122022' of https://source.denx.de/u-boot/custodians/u-boot-tpm
Tom Rini [Fri, 23 Dec 2022 12:46:41 +0000 (07:46 -0500)]
Merge tag 'tpm-23122022' of https://source.denx.de/u-boot/custodians/u-boot-tpm

OP-TEE autodiscovery

22 months agoMerge branch '2022-12-22-assorted-important-fixes'
Tom Rini [Fri, 23 Dec 2022 12:44:30 +0000 (07:44 -0500)]
Merge branch '2022-12-22-assorted-important-fixes'

- Split up the aarch64 Azure CI job more, to avoid time limits, nuvoton
  network fix, SPL_OPTEE_IMAGE dependency fix, some fixes to the IPv6
  code, PowerPC build flag fixes, silence pylibfdt version warning.

22 months agotee: optee: discover services dependent on tee-supplicant
Etienne Carriere [Wed, 7 Dec 2022 15:30:00 +0000 (16:30 +0100)]
tee: optee: discover services dependent on tee-supplicant

Makes OP-TEE to enumerate also services depending on tee-supplicant
support in U-Boot. This change allows OP-TEE services like fTPM TA
to be discovered and get a TPM device registered in U-Boot.

Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
22 months agotee: optee: don't fail probe because of optee-rng
Etienne Carriere [Wed, 7 Dec 2022 15:29:59 +0000 (16:29 +0100)]
tee: optee: don't fail probe because of optee-rng

Fixes optee-rng driver bind sequence in optee driver to print a warning
message but not report an error status when a optee-rng service driver
fails to be bound as the optee driver itself is still fully functional.

Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
22 months agopylibfdt: Fix version normalization warning
Marek Vasut [Thu, 15 Dec 2022 22:37:59 +0000 (23:37 +0100)]
pylibfdt: Fix version normalization warning

Fix the following version normalization warning:
"
/usr/lib/python3/dist-packages/setuptools/dist.py:530: UserWarning: Normalizing '2023.01' to '2023.1'
"

Using suggestion from Richard Jones:
https://github.com/pypa/setuptools/issues/308#issuecomment-405817468

Signed-off-by: Marek Vasut <marex@denx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
22 months agonet: nuvoton: fix build broken for use phy_get_interface_by_name
Jim Liu [Tue, 13 Sep 2022 06:25:21 +0000 (14:25 +0800)]
net: nuvoton: fix build broken for use phy_get_interface_by_name

The original patch is use phy_get_interface_by_name to set interface.
The new patch is use dev_read_phy_mode to replace it.

Signed-off-by: Jim Liu <JJLIU0@nuvoton.com>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
22 months agopowerpc/mpc85xx: Disable AltiVec and VSX instructions
Pali Rohár [Mon, 19 Dec 2022 21:46:22 +0000 (22:46 +0100)]
powerpc/mpc85xx: Disable AltiVec and VSX instructions

All vector instructions on powerpc mpc85xx must not be used because U-Boot
does not enable them. Usage cause random crashes. SPE vector instructions
are already disabled by compiler flags, so disable also AltiVec and VSX
vector instructions.

Linux kernel disables AltiVec and VSX instructions too.

Signed-off-by: Pali Rohár <pali@kernel.org>
22 months agopowerpc/mpc85xx: Improve disabling of SPE instructions
Pali Rohár [Sun, 11 Dec 2022 14:14:59 +0000 (15:14 +0100)]
powerpc/mpc85xx: Improve disabling of SPE instructions

Specifying -mspe=no also disables usage of SPE instructions. It is
documented in "[PATCH,rs6000] make -mno-spe work as expected" email:
http://gcc.gnu.org/ml/gcc-patches/2008-04/msg00311.html

So replace -mspe=yes by -mspe=no, so make it clear that u-boot has to be
compiled without SPE instructions.

Linux kernel contains following Makefile code to achieve it:

    # No SPE instruction when building kernel
    # (We use all available options to help semi-broken compilers)
    KBUILD_CFLAGS += $(call cc-option,-mno-spe)
    KBUILD_CFLAGS += $(call cc-option,-mspe=no)

Do same for U-Boot.

Signed-off-by: Pali Rohár <pali@kernel.org>
22 months agopowerpc/mpc85xx: Pass correct cpu compiler flags
Pali Rohár [Mon, 19 Dec 2022 21:41:52 +0000 (22:41 +0100)]
powerpc/mpc85xx: Pass correct cpu compiler flags

When gcc's default cpu (selected by --with-cpu= during gcc's configure
phase) does not match target U-Boot board cpu then U-Boot binary does not
have to be compiled correctly. Lot of distributions sets gcc's default cpu
to generic powerpc variant which works fine.

U-Boot already pass -Wa,-me500 flag to gcc which instructs GNU AS to accept
e500 specific instructions when processing assembler source files (.S).

This affects also assembly files generated by gcc from C source files. And
because gcc for generic powerpc cpu puts '.machine ppc' at the beginning of
the generated assembly file, it basically overwrites -me500 flag by which
was GNU AS invoked (from U-boot build system).

It started to be an issue since binutils 2.38 which does not keep enabled
extra functional units selected by previous cpu. Hence issuing directive
'.machine ppc' (generated by gcc for generic powerpc) after '.machine e500'
(specifying at command line) disables usage of e500 specific instructions.

And compiling arch/powerpc/cpu/mpc85xx/tlb.c code throws following
assembler errors:

    {standard input}: Assembler messages:
    {standard input}:127: Error: unrecognized opcode: `tlbre'
    {standard input}:418: Error: unrecognized opcode: `tlbre'
    {standard input}:821: Error: unrecognized opcode: `msync'
    {standard input}:821: Error: unrecognized opcode: `tlbwe'
    {standard input}:884: Error: unrecognized opcode: `tlbsx'

This issue was already hit by Debian people and is reported in bug tracker:
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1003490

Calling gcc with -mcpu=8540 flag fixes this issue because -mcpu=8540 tells
gcc to compile code for e500 core/cpu (overwriting gcc's default cpu) and
does not put '.machine ppc' directive into assembly anymore.

Also if gcc is invoked with -mcpu=8540 then it pass -me500 flag to GNU AS.
So it is unnecessary to manually specify -Wa,-me500 flag because it is
implicitly added.

Fix this issue properly by specifying correct -mcpu compiler flag for all
supported powerpc cores in U-Boot mpc85xx platform, which are: e500v1,
e500v2, e500mc, e5500 and e6500. For specifying e500v1 and e500v2 cores,
gcc has unintuitive -mcpu=8540 and -mcpu=8548 flag names, for other cores
-mcpu matches core name.

The only difference between gcc's -mcpu=8540 and -mcpu=8548 flags is
support for double precision floating point SPE instructions. As U-Boot
does not use floating point, it is fine to use -mcpu=8540 for both e500v1
and e500v2 cores. Moreover gcc 9 completely removed e500 floating point
support, so since gcc 9 -mcpu=8548 is just alias to -mcpu=8540.

Note that U-Boot's CONFIG_E500 option is set also for other cpus, not only
for e500v1 and e500v2. So do not check for CONFIG_E500 and rather set e500
as last fallback value when no other mpc85xx cpu matches.

Signed-off-by: Pali Rohár <pali@kernel.org>
22 months agonet: don't memcpy to NULL
Heinrich Schuchardt [Wed, 7 Dec 2022 10:53:29 +0000 (11:53 +0100)]
net: don't memcpy to NULL

In ndisc_receive() 7 bytes are copied from a buffer of size 6 to NULL.

net_nd_packet_mac is a pointer. If it is NULL, we should set it to the
address of the buffer with the MAC address.

Addresses-Coverity-ID: 430974 ("Out-of-bounds access")
Fixes: c6610e1d90ea ("net: ipv6: Add Neighbor Discovery Protocol (NDP)")
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Viacheslav Mitrofanov <v.v.mitrofanov@yadro.com>
22 months agonet: ipv6: Add missing break into IPv6 protocol handler
Viacheslav Mitrofanov [Tue, 6 Dec 2022 07:08:16 +0000 (10:08 +0300)]
net: ipv6: Add missing break into IPv6 protocol handler

IPv6 protocol handler is not terminated with a break statment.
It can lead to running unexpected code.

Signed-off-by: Viacheslav Mitrofanov <v.v.mitrofanov@yadro.com>
Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
22 months agospl: Kconfig: Fix SPL_OPTEE_IMAGE dependency
Jagan Teki [Thu, 3 Nov 2022 06:19:47 +0000 (11:49 +0530)]
spl: Kconfig: Fix SPL_OPTEE_IMAGE dependency

fdt_addr will build as part of SPL_LOAD_FIT or SPL_LOAD_FIT_FULL
which is indeed required to build optee image support in SPL.

common/spl/spl.c: In function ‘jump_to_image_optee’:
common/spl/spl.c:220:46: error: ‘struct spl_image_info’ has no member named ‘fdt_addr’
  220 |         spl_optee_entry(NULL, NULL, spl_image->fdt_addr,

Fix the dependency support.

Signed-off-by: Jagan Teki <jagan@edgeble.ai>
22 months agoCI: Reduce aarch64 catchall job matches
Tom Rini [Wed, 7 Dec 2022 14:16:18 +0000 (09:16 -0500)]
CI: Reduce aarch64 catchall job matches

The aarch64 catch-all job is getting close to the hard time limit in
Azure for the free tier. Move i.MX9 boards to the i.MX8 job and move
amlogic entirely to its own job. This brings us down from 85 boards to
51 boards and so should be safe for a while.

Signed-off-by: Tom Rini <trini@konsulko.com>
22 months agoMerge tag 'efi-2023-01-rc5' of https://source.denx.de/u-boot/custodians/u-boot-efi
Tom Rini [Tue, 20 Dec 2022 17:50:38 +0000 (12:50 -0500)]
Merge tag 'efi-2023-01-rc5' of https://source.denx.de/u-boot/custodians/u-boot-efi

Pull request for efi-2023-01-rc5

UEFI:

* Improve parameter checking in efi_get_next_variable_name_mem()
* Fix a bugs in management of security database via the eficonfig command

Other:

* Allow sound command to play multiple sounds

22 months agoMerge tag 'tpm-20122022' of https://source.denx.de/u-boot/custodians/u-boot-tpm
Tom Rini [Tue, 20 Dec 2022 17:50:24 +0000 (12:50 -0500)]
Merge tag 'tpm-20122022' of https://source.denx.de/u-boot/custodians/u-boot-tpm

fTPM privileged login

22 months agoeficonfig: EFI_VARIABLE_APPEND_WRITE is not set for null key
Masahisa Kojima [Tue, 20 Dec 2022 10:38:52 +0000 (19:38 +0900)]
eficonfig: EFI_VARIABLE_APPEND_WRITE is not set for null key

The signed null key with authenticated header is used to clear
the PK, KEK, db and dbx. When CONFIG_EFI_MM_COMM_TEE is enabled
(StMM and OP-TEE based RPMB storage is used as the EFI variable
storage), clearing KEK, db and dbx by enrolling a signed null
key does not work as expected if EFI_VARIABLE_APPEND_WRITE
attritube is set.

This commit checks the selected file is null key, then
EFI_VARIABLE_APPEND_WRITE attibute will not be used for the null key.

Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
22 months agoefi_selftest: conformance test for GetNextVariableName
Heinrich Schuchardt [Sun, 18 Dec 2022 06:08:58 +0000 (06:08 +0000)]
efi_selftest: conformance test for GetNextVariableName

Test that GetNextVariableName() checks the parameters.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
22 months agoefi_loader: fix efi_get_next_variable_name_mem()
Heinrich Schuchardt [Sun, 18 Dec 2022 06:08:57 +0000 (06:08 +0000)]
efi_loader: fix efi_get_next_variable_name_mem()

The VariableNameSize parameter is in bytes but u16_strnlen() counts u16.

Fix the parameter check for null termination.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
22 months agoeficonfig: avoid SetVariable between GetNextVariableName calls
Masahisa Kojima [Mon, 19 Dec 2022 02:33:13 +0000 (11:33 +0900)]
eficonfig: avoid SetVariable between GetNextVariableName calls

The current code calls efi_set_variable_int() to delete the
invalid boot option between calls to efi_get_next_variable_name_int(),
it may produce unpredictable results.

This commit moves removal of the invalid boot option outside
of the efi_get_next_variable_name_int() calls.
EFI_NOT_FOUND returned from efi_get_next_variable_name_int()
indicates we retrieved all EFI variables, it should be treated
as EFI_SUCEESS.

To address the checkpatch warning of too many leading tabs,
combine two if statement into one.

Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
22 months agoeficonfig: carve out efi_get_next_variable_name_int calls
Masahisa Kojima [Mon, 19 Dec 2022 02:33:12 +0000 (11:33 +0900)]
eficonfig: carve out efi_get_next_variable_name_int calls

To retrieve the EFI variable name by efi_get_next_variable_name_int(),
the sequence of alloc -> efi_get_next_variable_name_int ->
realloc -> efi_get_next_variable_name_int is required.
In current code, this sequence repeatedly appears in
the several functions. It should be curved out a common function.

This commit also fixes the missing free() of var_name16
in eficonfig_delete_invalid_boot_option().

Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
22 months agotest: add unit test for u16_strnlen()
Heinrich Schuchardt [Sun, 18 Dec 2022 05:32:14 +0000 (05:32 +0000)]
test: add unit test for u16_strnlen()

Add the missing unit test. It can be executed with:

    ut unicode u16_strnlen

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
22 months agodoc: correct heading level in printenv man-page
Heinrich Schuchardt [Sun, 18 Dec 2022 04:00:52 +0000 (04:00 +0000)]
doc: correct heading level in printenv man-page

The 'Configuration' heading should be on level 2, not on level 1.

Fixes: eaa268589e9c ("doc: man-page for the printenv command")
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
22 months agocmd: allow sound command to play multiple sounds
Heinrich Schuchardt [Fri, 16 Dec 2022 00:50:39 +0000 (16:50 -0800)]
cmd: allow sound command to play multiple sounds

Currently the sound command accepts only one value each for duration and
frequency. Allowing more duration and frequency arguments enables playing a
tune.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
22 months agotpm2: ftpm: open session with privileged ree login
Etienne Carriere [Wed, 7 Dec 2022 15:25:33 +0000 (16:25 +0100)]
tpm2: ftpm: open session with privileged ree login

Opens the fTPM session with TEE_LOGIN_REE_KERNEL as fTPM may restrict
access to that login when Linux based OS is running as applications are
expected to got through the Linux TPMv2 driver.

Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
23 months agoPrepare v2023.01-rc4
Tom Rini [Mon, 19 Dec 2022 13:45:26 +0000 (08:45 -0500)]
Prepare v2023.01-rc4

Signed-off-by: Tom Rini <trini@konsulko.com>
23 months agoMerge tag 'u-boot-rockchip-20221219' of https://source.denx.de/u-boot/custodians...
Tom Rini [Mon, 19 Dec 2022 13:33:24 +0000 (08:33 -0500)]
Merge tag 'u-boot-rockchip-20221219' of https://source.denx.de/u-boot/custodians/u-boot-rockchip

- Only call binman when TPL available;
- rk3128 DTS fix;
- Fix GPT table corruption for rk3399 puma ;
- Fix i2c for rk3399 Pinebookpro;
- Enable UEFI capsule update for RockPi4;

23 months agorockpi4: capsule: Enable UEFI capsule update on RockPi4 boards
Sughosh Ganu [Thu, 10 Nov 2022 09:19:17 +0000 (14:49 +0530)]
rockpi4: capsule: Enable UEFI capsule update on RockPi4 boards

Enable the UEFI capsule update functionality on the RockPi4B and
RockPi4C boards. Support is being enabled for updating the idbloader
and u-boot firmware images residing on GPT partitioned uSD card
storage device.

Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
23 months agorockpi4: board: Add firmware image information for capsule updates
Sughosh Ganu [Thu, 10 Nov 2022 09:19:16 +0000 (14:49 +0530)]
rockpi4: board: Add firmware image information for capsule updates

Add information that will be needed for enabling the UEFI capsule
update feature on the RockPi4 boards. With the feature enabled, it
would be possible to update the idbloader and u-boot.itb images on the
RockPi4B and RockPi4C variants.

Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
23 months agorockchip: capsule: Add functions for supporting capsule updates
Sughosh Ganu [Thu, 10 Nov 2022 09:19:15 +0000 (14:49 +0530)]
rockchip: capsule: Add functions for supporting capsule updates

Add functions needed to support the UEFI capsule update feature on
rockchip boards. Currently, the feature is being enabled on the
RockPi4 boards with firmware images residing on GPT partitioned
storage media.

Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
23 months agophy: rockchip: handle clock without enable function
John Keeping [Tue, 6 Dec 2022 12:48:55 +0000 (12:48 +0000)]
phy: rockchip: handle clock without enable function

If a clock doesn't supply the enable hook, clk_enable() will return
-ENOSYS.  In this case the clock is always enabled so there is no error
and the phy initialisation should continue.

Signed-off-by: John Keeping <john@metanate.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
23 months agorockchip: Pinebook Pro: Do not initialize i2c before relocation
Michal Suchanek [Sat, 3 Dec 2022 12:31:29 +0000 (13:31 +0100)]
rockchip: Pinebook Pro: Do not initialize i2c before relocation

The i2c locks up when initialized before relocation, and it stays broken
in Linux as well breaking the ability to boot Linux.

The i2c bus and pmic was not actually used in pre-reloc before
commit ad607512f575 ("power: pmic: rk8xx: Support sysreset shutdown method")

The cause is not known.

This is board-specific, other boards that do not add the option to
include the i2c bus in pre-reloc DT are not affected.

Signed-off-by: Michal Suchanek <msuchanek@suse.de>
Reviewed-by: Peter Robinson <pbrobinson@gmail.com>
Tested-by: Peter Robinson <pbrobinson@gmail.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
23 months agorockchip: puma: fix GPT table corruption when saving U-Boot environment
Quentin Schulz [Tue, 25 Oct 2022 10:58:02 +0000 (12:58 +0200)]
rockchip: puma: fix GPT table corruption when saving U-Boot environment

The GPT table is taking the first 34 sectors, which amounts to 0x4400
bytes. Saving the environment below this address in storage will corrupt
the GPT table.

While technically the table ends at 0x4400, some tools (e.g. bmaptool)
are rounding everything to the logical block size (0x1000), so it is
safer to make it point to 0x5000 so that the environment could still
persist when flashing a sparse image with bmaptool or similar tools.

Obviously, the default 0x4000 environment size does not work anymore, so
let's set it to 0x3000 so it does fill the gap between the GPT table
(rounded to 0x1000) and the start of the idbloader.img.

Fixes: 56f580d3eb8d ("rockchip: dts: rk3399-puma: put environment (in MMC/SD configurations) before SPL")
Cc: Quentin Schulz <foss+uboot@0leil.net>
Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
23 months agoarm: dts: rockchip: enable ums/rockusb command for ROCK Pi 4
FUKAUMI Naoki [Wed, 19 Oct 2022 07:12:52 +0000 (07:12 +0000)]
arm: dts: rockchip: enable ums/rockusb command for ROCK Pi 4

this patch add USB mass storage function and Rockusb function for
Radxa ROCK Pi 4 series.

Signed-off-by: FUKAUMI Naoki <naoki@radxa.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
23 months agoconfigs:rockchip:roc-rk3399-pc:Enable more configs
Manoj Sai [Thu, 15 Sep 2022 07:23:19 +0000 (12:53 +0530)]
configs:rockchip:roc-rk3399-pc:Enable more configs

This patch enables the following:

1) use preboot configuration to enable usb devices.

2) Enable USB configs so keyboards and other USB devices work,
   update the number of ports of the usb root hub.

   - with this addition the updated USB device Tree:

1  Hub (12 Mb/s, 0mA)
U-Boot Root Hub
1  Hub (12 Mb/s, 0mA)
|   U-Boot Root Hub
|
+-2  Hub (12 Mb/s, 100mA)
USB 2.0 Hub [MTT]

1  Hub (5 Gb/s, 0mA)
U-Boot XHCI Host Controller

3) enable crypto RNG support.

4) Change SPI speed and frequency:
    - increase the maximum SPI slave device speed,
      SPI flash max frequency for the environment from 10Mhz to 30MHz.

    - performance stats for speed update from 10MHz to 30MHz:

     with 10Mhz speed update:
      => sf update 0x300000 0x800000 0x400000
         4194304 bytes written, 0 bytes skipped in 36.819s, speed 119837 B/s

        with 30Mhz speed update:
      => sf update 0x300000 0x800000 0x400000
         4194304 bytes written, 0 bytes skipped in 20.319s, speed 220752 B/s

Signed-off-by: Manoj Sai <abbaraju.manojsai@amarulasolutions.com>
Signed-off-by: Da Xue <da.xue@libretech.co>
Signed-off-by: dsx724 <da@lessconfused.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
23 months agoarm: dts: rockchip: rk3128: fix clocks, compatible and phys
Johan Jonker [Fri, 9 Sep 2022 20:20:07 +0000 (22:20 +0200)]
arm: dts: rockchip: rk3128: fix clocks, compatible and phys

Fix rk3128 clocks, compatible and phys, so that they match the bindings.

Signed-off-by: Johan Jonker <jbx6244@gmail.com>
23 months agoarm: dts: rockchip: rk3128: fix DT node names
Johan Jonker [Fri, 9 Sep 2022 20:19:24 +0000 (22:19 +0200)]
arm: dts: rockchip: rk3128: fix DT node names

The rk3128 DT node names should be generic.
Rename them to the pattern defined in the DT bindings.

Signed-off-by: Johan Jonker <jbx6244@gmail.com>
23 months agoarm: dts: rockchip: move all rk3128 u-boot specific properties in separate dtsi files
Johan Jonker [Fri, 9 Sep 2022 20:19:06 +0000 (22:19 +0200)]
arm: dts: rockchip: move all rk3128 u-boot specific properties in separate dtsi files

Move all rk3128 u-boot specific properties in separate dtsi files.
Sort emmc node.

Signed-off-by: Johan Jonker <jbx6244@gmail.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
23 months agoarm: dts: rockchip: rk3128: bulk convert gpios to their constant counterparts
Johan Jonker [Fri, 9 Sep 2022 20:18:55 +0000 (22:18 +0200)]
arm: dts: rockchip: rk3128: bulk convert gpios to their constant counterparts

Bulk convert rk3128 DT gpios to their constant counterparts.

sed -i -f script.sed rk3128.dtsi
sed -i -f script.sed rk3128-evb.dts

================================

/rockchip,pins *=/bcheck
b # to end of script
:append-next-line
N
:check
/^[^;]*$/bappend-next-line
s/<RK_GPIO\([0-9]\) /<\1 /g
s/<\([^ ][^ ]*  *\)0 /<\1RK_PA0 /g
s/<\([^ ][^ ]*  *\)1 /<\1RK_PA1 /g
s/<\([^ ][^ ]*  *\)2 /<\1RK_PA2 /g
s/<\([^ ][^ ]*  *\)3 /<\1RK_PA3 /g
s/<\([^ ][^ ]*  *\)4 /<\1RK_PA4 /g
s/<\([^ ][^ ]*  *\)5 /<\1RK_PA5 /g
s/<\([^ ][^ ]*  *\)6 /<\1RK_PA6 /g
s/<\([^ ][^ ]*  *\)7 /<\1RK_PA7 /g
s/<\([^ ][^ ]*  *\)8 /<\1RK_PB0 /g
s/<\([^ ][^ ]*  *\)9 /<\1RK_PB1 /g
s/<\([^ ][^ ]*  *\)10 /<\1RK_PB2 /g
s/<\([^ ][^ ]*  *\)11 /<\1RK_PB3 /g
s/<\([^ ][^ ]*  *\)12 /<\1RK_PB4 /g
s/<\([^ ][^ ]*  *\)13 /<\1RK_PB5 /g
s/<\([^ ][^ ]*  *\)14 /<\1RK_PB6 /g
s/<\([^ ][^ ]*  *\)15 /<\1RK_PB7 /g
s/<\([^ ][^ ]*  *\)16 /<\1RK_PC0 /g
s/<\([^ ][^ ]*  *\)17 /<\1RK_PC1 /g
s/<\([^ ][^ ]*  *\)18 /<\1RK_PC2 /g
s/<\([^ ][^ ]*  *\)19 /<\1RK_PC3 /g
s/<\([^ ][^ ]*  *\)20 /<\1RK_PC4 /g
s/<\([^ ][^ ]*  *\)21 /<\1RK_PC5 /g
s/<\([^ ][^ ]*  *\)22 /<\1RK_PC6 /g
s/<\([^ ][^ ]*  *\)23 /<\1RK_PC7 /g
s/<\([^ ][^ ]*  *\)24 /<\1RK_PD0 /g
s/<\([^ ][^ ]*  *\)25 /<\1RK_PD1 /g
s/<\([^ ][^ ]*  *\)26 /<\1RK_PD2 /g
s/<\([^ ][^ ]*  *\)27 /<\1RK_PD3 /g
s/<\([^ ][^ ]*  *\)28 /<\1RK_PD4 /g
s/<\([^ ][^ ]*  *\)29 /<\1RK_PD5 /g
s/<\([^ ][^ ]*  *\)30 /<\1RK_PD6 /g
s/<\([^ ][^ ]*  *\)31 /<\1RK_PD7 /g
s/<\([^ ][^ ]*  *[^ ][^ ]*  *\)0 /<\1RK_FUNC_GPIO /g
s/<\([^ ][^ ]*  *[^ ][^ ]*  *\)RK_FUNC_\([1-9]\) /<\1\2 /g

Signed-off-by: Johan Jonker <jbx6244@gmail.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
23 months agorockchip: rk3128-cru: sync the clock dt-binding header from Linux
Johan Jonker [Fri, 9 Sep 2022 20:18:45 +0000 (22:18 +0200)]
rockchip: rk3128-cru: sync the clock dt-binding header from Linux

In order to update the DT for rk3128
sync the clock dt-binding header.
This is the state as of v6.0 in Linux.

Signed-off-by: Johan Jonker <jbx6244@gmail.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
23 months agorockchip: enable fdt overlays for ROCK Pi 4 series
FUKAUMI Naoki [Sat, 10 Sep 2022 01:47:24 +0000 (01:47 +0000)]
rockchip: enable fdt overlays for ROCK Pi 4 series

add CONFIG_OF_LIBFDT_OVERLAY=y to support fdt overlays.

Signed-off-by: FUKAUMI Naoki <naoki@radxa.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
23 months agorockchip: Only call binman when TPL available
Kever Yang [Sun, 18 Dec 2022 12:43:38 +0000 (20:43 +0800)]
rockchip: Only call binman when TPL available

Rockchip platform use TPL to do the DRAM initialize for all the SoCs,
if TPL is not available, means no available DRAM init program, and the
u-boot-rockchip.bin is not functionable.

Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
Change-Id: I2299f1eddce5aa7d5fb1a3fb4d8aeaa995b397fa

23 months agoMakefile: With BINMAN_ALLOW_MISSING=1 don't error on missing
Tom Rini [Tue, 6 Dec 2022 02:03:36 +0000 (21:03 -0500)]
Makefile: With BINMAN_ALLOW_MISSING=1 don't error on missing

When the user builds with BINMAN_ALLOW_MISSING=1 they're explicitly
setting the flag to allow for additional binaries to be missing and so
have acknowledged the output might not work. In this case we want to
default to not passing a non-zero exit code.

Cc: Simon Glass <sjg@chromium.org>
Reported-by: Peter Robinson <pbrobinson@gmail.com>
Signed-off-by: Tom Rini <trini@konsulko.com>
23 months agoMerge tag 'efi-2023-01-rc4' of https://source.denx.de/u-boot/custodians/u-boot-efi
Tom Rini [Sun, 18 Dec 2022 13:10:09 +0000 (08:10 -0500)]
Merge tag 'efi-2023-01-rc4' of https://source.denx.de/u-boot/custodians/u-boot-efi

Pull request for efi-2023-01-rc4

Documentation:

* Fix htmldoc build dependency

UEFI:

* Adjust EBBR version for compatibility table

23 months agoMerge branch 'master' of https://source.denx.de/u-boot/custodians/u-boot-sunxi
Tom Rini [Sun, 18 Dec 2022 13:08:55 +0000 (08:08 -0500)]
Merge branch 'master' of https://source.denx.de/u-boot/custodians/u-boot-sunxi

This cleans up each board's defconfig, and fixes the serial console on
some Olimex board. Also we lose another legacy config variable.
The rest are minor cleanups, that actually shouldn't change anything
in the build.

Passed the gitlab CI, plus briefly tested on Pine64-LTS, LicheePi Nano,
and BananaPi M1.

23 months agodoc: update Sphinx requirements for certifi
Heinrich Schuchardt [Fri, 9 Dec 2022 14:33:52 +0000 (15:33 +0100)]
doc: update Sphinx requirements for certifi

Upgrade to version 2022.12.7.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
23 months agoefi: adjust ebbr to v2.1 in conformance profile
Vincent Stehlé [Fri, 16 Dec 2022 16:55:04 +0000 (17:55 +0100)]
efi: adjust ebbr to v2.1 in conformance profile

The EFI Conformance Profile Table entry for EBBR appears in v2.1.0 of the
EBBR specification[1]. Update naming accordingly.

While at it, update the EBBR version referenced in the documentation.

[1]: https://github.com/ARM-software/ebbr/releases/tag/v2.1.0

Signed-off-by: Vincent Stehlé <vincent.stehle@arm.com>
Cc: Heinrich Schuchardt <xypron.glpk@gmx.de>
Cc: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
23 months agodoc: fix typos
Maxim Cournoyer [Sat, 17 Dec 2022 02:09:40 +0000 (21:09 -0500)]
doc: fix typos

Fix a few typos spot during a first read of the contribution process.

Signed-off-by: Maxim Cournoyer <maxim.cournoyer@savoirfairelinux.com>
Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
23 months agoMerge https://source.denx.de/u-boot/custodians/u-boot-x86
Tom Rini [Thu, 15 Dec 2022 18:06:00 +0000 (13:06 -0500)]
Merge https://source.denx.de/u-boot/custodians/u-boot-x86

- Adjust CONFIG_TEXT_BASE for BayTrail based platforms
- 2 cosmetic issue fixes

23 months agosunxi: board: annotate #endif lines
Andre Przywara [Mon, 28 Nov 2022 00:02:56 +0000 (00:02 +0000)]
sunxi: board: annotate #endif lines

The legacy Allwinner code is cluttered with #ifdef's, some of them even
nested, which makes the code hard to read and error prone.
Eventually we will get rid of most of them, but for now let's at least
annotate the #endif lines with the corresponding symbol the bracket
started with.

Reviewed-by: Samuel Holland <samuel@sholland.org>
Tested-by: Samuel Holland <samuel@sholland.org>
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
23 months agosunxi: remove bogus mmc_pinmux_setup() prototype
Andre Przywara [Mon, 28 Nov 2022 00:55:20 +0000 (00:55 +0000)]
sunxi: remove bogus mmc_pinmux_setup() prototype

Since all callers of mmc_pinmux_setup() are located after the definition
of that function, there is no need for a forward declaration (anymore?).

Remove the prototype along with its #ifdef guards.

Reviewed-by: Samuel Holland <samuel@sholland.org>
Tested-by: Samuel Holland <samuel@sholland.org>
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
23 months agosunxi: remove unused CONFIG_MMC_SUNXI_SLOT
Andre Przywara [Mon, 28 Nov 2022 00:03:53 +0000 (00:03 +0000)]
sunxi: remove unused CONFIG_MMC_SUNXI_SLOT

There is a CONFIG_MMC_SUNXI_SLOT definition in our sunxi_common.h config
header, which was used to note the first MMC controller to initialise.
The definition in that header was always set to 0, with no easy way of
overriding this, and certainly none of the existing boards made any use
of that (non-)feature.
Remove that definition and replace it with a constant 0 in the only
user, in board.c. It turns out that this is safe, as this is only used
in the SPL, and the BROM also unconditionally initialises MMC0.
This also removes the last legacy config symbol with SUN*I in it from
the whitelist.

Reviewed-by: Samuel Holland <samuel@sholland.org>
Tested-by: Samuel Holland <samuel@sholland.org>
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
23 months agox86: cosmetic: Fix a typo in the reserve_arch() comments
Bin Meng [Thu, 24 Nov 2022 03:39:23 +0000 (11:39 +0800)]
x86: cosmetic: Fix a typo in the reserve_arch() comments

It should be fsp_continue().

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
23 months agox86: som-db5800-som-6867: Adjust CONFIG_TEXT_BASE
Bin Meng [Thu, 24 Nov 2022 08:19:54 +0000 (16:19 +0800)]
x86: som-db5800-som-6867: Adjust CONFIG_TEXT_BASE

At present U-Boot no longer builds as a complete rom for som-db5800-som-6867.

    BINMAN  .binman_stamp
  Wrote map file './rom.map' to show errors
  binman: Section '/binman/rom': contents size 0x80302c (8400940) exceeds section size 0x800000 (8388608)

Checking rom.map we see 'intel-vga' section is overlapped with
other sections:

  <none>     fff00000  0009f7c8  u-boot-with-ucode-ptr
  <none>     fff90000  00010000  intel-vga
  <none>     fff9f7c8  00001aae  u-boot-dtb-with-ucode

Let's adjust CONFIG_TEXT_BASE to allow more space for U-Boot codes.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
23 months agox86: dfi-bt700: Adjust CONFIG_TEXT_BASE
Bin Meng [Thu, 24 Nov 2022 07:58:17 +0000 (15:58 +0800)]
x86: dfi-bt700: Adjust CONFIG_TEXT_BASE

At present U-Boot no longer builds as a complete rom for all the
configs of dfi-bt700.

    BINMAN  .binman_stamp
  Wrote map file './rom.map' to show errors
  binman: Section '/binman/rom': contents size 0x80e836 (8448054) exceeds section size 0x800000 (8388608)

Checking rom.map we see 'intel-vga' section is overlapped with
other sections:

  <none>     fff00000  000aac90  u-boot-with-ucode-ptr
  <none>     fffa0000  00010000  intel-vga
  <none>     fffaac90  00001df0  u-boot-dtb-with-ucode
  <none>     fffaca80  00019800  u-boot-ucode

Let's adjust CONFIG_TEXT_BASE to allow more space for U-Boot codes.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Stefan Roese <sr@denx.de>
23 months agox86: conga-qeval20-qa3-e3845: Adjust CONFIG_TEXT_BASE
Bin Meng [Thu, 24 Nov 2022 07:33:09 +0000 (15:33 +0800)]
x86: conga-qeval20-qa3-e3845: Adjust CONFIG_TEXT_BASE

At present U-Boot no longer builds as a complete rom for all the
configs of conga-qeval20-qa3-e3845.

    BINMAN  .binman_stamp
  Wrote map file './rom.map' to show errors
  binman: Section '/binman/rom': contents size 0x80b680 (8435328) exceeds section size 0x800000 (8388608)

Checking rom.map we see 'intel-vga' section is overlapped with
other sections:

  <none>     fff00000  000a7cb0  u-boot-with-ucode-ptr
  <none>     fffa0000  00010000  intel-vga
  <none>     fffa7cb0  00001c1a  u-boot-dtb-with-ucode
  <none>     fffa98d0  00019800  u-boot-ucode

Let's adjust CONFIG_TEXT_BASE to allow more space for U-Boot codes.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
23 months agox86: minnowmax: Adjust CONFIG_TEXT_BASE
Bin Meng [Thu, 24 Nov 2022 03:07:13 +0000 (11:07 +0800)]
x86: minnowmax: Adjust CONFIG_TEXT_BASE

At present U-Boot no longer builds as a complete rom for minnowmax.

    BINMAN  .binman_stamp
  Wrote map file './rom.map' to show errors
  binman: Section '/binman/rom': contents size 0x803146 (8401222) exceeds section size 0x800000 (8388608)

Checking rom.map we see 'fdtmap' section is overlapped with
'intel-vga' section:

  <none>     fffa1390  00019800  u-boot-ucode
  <none>     fffb0000  00010000  intel-vga
  <none>     fffbab90  00000539  fdtmap

Let's adjust CONFIG_TEXT_BASE to allow more space for U-Boot codes.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
23 months agox86: bayleybay: Adjust CONFIG_TEXT_BASE
Bin Meng [Thu, 24 Nov 2022 03:24:37 +0000 (11:24 +0800)]
x86: bayleybay: Adjust CONFIG_TEXT_BASE

At present U-Boot no longer builds as a complete rom for bayleybay.

    BINMAN  .binman_stamp
  Wrote map file './rom.map' to show errors
  binman: Section '/binman/rom': contents size 0x814706 (8472326) exceeds section size 0x800000 (8388608)

Checking rom.map we see 'fdtmap' section is overlapped with
'intel-vga' and 'intel-fsp' sections:

  <none>     fffa2150  0002a000  u-boot-ucode
  <none>     fffb0000  00010000  intel-vga
  <none>     fffc0000  00038000  intel-fsp
  <none>     fffcc150  00000539  fdtmap

Let's adjust CONFIG_TEXT_BASE to allow more space for U-Boot codes.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
23 months agox86: Fix i8259 ifdef include guard
Alistair Delva [Mon, 26 Sep 2022 22:23:26 +0000 (22:23 +0000)]
x86: Fix i8259 ifdef include guard

When building U-Boot with clang, it notices that the i8259.h include
guard does not work correctly due to a typo. Fix it.

Signed-off-by: Alistair Delva <adelva@google.com>
Cc: Simon Glass <sjg@chromium.org>
Cc: Bin Meng <bmeng.cn@gmail.com>
Cc: Nick Desaulniers <ndesaulniers@google.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
23 months agosunxi: Fix serial console for A10s-OLinuXino-MICRO
Mark Kettenis [Sun, 11 Dec 2022 22:00:54 +0000 (23:00 +0100)]
sunxi: Fix serial console for A10s-OLinuXino-MICRO

On this board CONFIG_CONS_INDEX needs to be 1 unlike other sun5i
boards.  Since this is the default, remove to bogus setting.

Fixes: 7095f8641863 ("sunxi: Convert CONS_INDEX to Kconfig")
Signed-off-by: Mark Kettenis <kettenis@openbsd.org>
Reviewed-by: Andre Przywara <andre.przywara@arm.com>
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
23 months agopinctrl: sunxi: Add P2WI and RSB pinmuxes
Samuel Holland [Fri, 18 Nov 2022 04:22:27 +0000 (22:22 -0600)]
pinctrl: sunxi: Add P2WI and RSB pinmuxes

P2WI and RSB are used to communicate with a PMIC. Most SoCs have only
one possible pinmux. F1C100s has two possibilities, with different mux
values, so omit it until some board needs one of them.

Signed-off-by: Samuel Holland <samuel@sholland.org>
Reviewed-by: Andre Przywara <andre.przywara@arm.com>
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
23 months agosunxi: define SYS_MONITOR_LEN in Kconfig, not _defconfig
Andre Przywara [Sat, 19 Nov 2022 16:10:59 +0000 (16:10 +0000)]
sunxi: define SYS_MONITOR_LEN in Kconfig, not _defconfig

Commit 08574ed339fb ("Convert CONFIG_SYS_MONITOR_LEN to Kconfig") moved
the definition of said config variable from the common sunxi header to
*every board's* defconfig.
This is a platform choice, not board specific, so remove the variable
from there, instead set the one value for all Allwinner boards in
Kconfig.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Acked-by: Jernej Skrabec <jernej.skrabec@gmail.com>
23 months agoRevert "cmd: pxe_utils: Check fdtcontroladdr in label_boot"
Tom Rini [Tue, 13 Dec 2022 14:26:25 +0000 (09:26 -0500)]
Revert "cmd: pxe_utils: Check fdtcontroladdr in label_boot"

With the change here, all extlinux.conf files with only "KERNEL
/fitImage" don't work anymore. One common example of this would be those
files generated by thee Poky/OE WIC bootimg-partition bootloader
partition generator.

This reverts commit d5ba6188dfbf6bb68354bec86e483623f1f6dae2.

Reported-by: Neil Armstrong <neil.armstrong@linaro.org>
Reported-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
Signed-off-by: Tom Rini <trini@konsulko.com>
23 months agoMerge https://source.denx.de/u-boot/custodians/u-boot-marvell
Tom Rini [Mon, 12 Dec 2022 14:00:58 +0000 (09:00 -0500)]
Merge https://source.denx.de/u-boot/custodians/u-boot-marvell

- mvebu: Espressobin: Fix default env variables (Derek)

23 months agoMerge tag 'u-boot-stm32-20221212' of https://source.denx.de/u-boot/custodians/u-boot-stm
Tom Rini [Mon, 12 Dec 2022 13:59:13 +0000 (08:59 -0500)]
Merge tag 'u-boot-stm32-20221212' of https://source.denx.de/u-boot/custodians/u-boot-stm

phy: usbphyc: use regulator_set_enable_if_allowed for disabling vbus supply
dm: pmic: ignore disabled node in pmic_bind_children

23 months agodm: pmic: ignore disabled node in pmic_bind_children
Patrick Delaunay [Wed, 26 Oct 2022 13:05:10 +0000 (15:05 +0200)]
dm: pmic: ignore disabled node in pmic_bind_children

Ignore the disabled children node in pmic_bind_children() so the
disabled regulators in device tree are not registered.

This patch is based on the dm_scan_fdt_node() code - only the
activated nodes are bound -  and it solves possible issue when a
deactivated regulator is bound, error for duplicated regulator name
for example.

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
23 months agophy: usbphyc: use regulator_set_enable_if_allowed for disabling vbus supply
Patrick Delaunay [Tue, 20 Sep 2022 11:39:56 +0000 (13:39 +0200)]
phy: usbphyc: use regulator_set_enable_if_allowed for disabling vbus supply

Use regulator_set_enable_if_allowed() api instead of regulator_set_enable()
while disabling vbus supply. This way the driver doesn't see an error
when it disable an always-on regulator for VBUS.

This patch is needed for STM32MP157C-DK2 board when the regulator
v3v3: buck4 used as the phy vbus supply in kernel device tree
is always on with the next hack for low power use-case:

&usbphyc_port0 {
        ...
/*
 * Hack to keep hub active until all connected devices are suspended
 * otherwise the hub will be powered off as soon as the v3v3 is disabled
 * and it can disturb connected devices.
 */
connector {
compatible = "usb-a-connector";
vbus-supply = <&v3v3>;
};
};

Without this patch and the previous update in DT the command
"usb stop" failed and the next command "usb start" cause a crash.

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
Reviewed-by: Marek Vasut <marex@denx.de>
23 months agoarm: mvebu: Espressobin: Fix default env variables
Derek LaHousse [Mon, 12 Dec 2022 06:34:17 +0000 (07:34 +0100)]
arm: mvebu: Espressobin: Fix default env variables

Default env variables on Espressobin boards are broken since commit c4df0f6f315c
("arm: mvebu: Espressobin: Set default value for $fdtfile env variable") as well
as the 'env default -a' command.

The algorithm to find free space in the default_environment[] array returns
after the first env variable instead of the correct position of the last
variable, where there is allocated free space.

This causes that U-Boot board_late_init() function to overwrite a portion of the
default environment with $ethXaddr and $fdtfile variables immediately after the
first env variable and so it is overwriting other variables.

This patch also adds an additional null byte to terminate the environment array.

But U-Boot board_late_init() function do not fill this nul byte explicitly. And
because of that, U-Boot is later trying to interpret remaining buffer as a
continuation of variable list. Normally buffer should be empty but due to the
above issue, it contains garbage from remaining env variables.

For example 'env default -a' command results in damaging variable names. It was
observed that scritaddr variable name was changed to criptaddr (without leading
's').

This bug was reported and discussed on the Armbian forum:
https://forum.armbian.com/topic/19564-making-espressobin-v7-work-in-2022/?do=findComment&comment=138136

Fix these issues in two steps:

1) Change code which finds free space for dynamic env variables in
default_environment[] array by jumping to the end of the variable list instead
of jumping after the first defined variable. [By Derek]

2) Add code which appends terminating nul byte as indication of the end of the
env list, after the last nul term env string. [By Pali]

Fixes: c4df0f6f315c ("arm: mvebu: Espressobin: Set default value for $fdtfile env variable")
Signed-off-by: Derek LaHousse <derek@seaofdirac.org>
Signed-off-by: Pali Rohár <pali@kernel.org>
Signed-off-by: Stefan Roese <sr@denx.de>
23 months agoMerge tag 'u-boot-nand-20221211' of https://source.denx.de/u-boot/custodians/u-boot...
Tom Rini [Sun, 11 Dec 2022 14:40:25 +0000 (09:40 -0500)]
Merge tag 'u-boot-nand-20221211' of https://source.denx.de/u-boot/custodians/u-boot-nand-flash

Merge tag 'u-boot-nand-20221211' of https://source.denx.de/u-boot/custodians/u-boot-nand-flash

- cmd: nand: Extend nand info to print ecc information
- rawnand: omap_gpmc: driver model support (the first patches of the series)
- mtd: nand: make Samsung SLC NAND usable again
- cmd: mtd: check if a block has to be skipped or erased
- spl: spl_legacy: fix invalid offset in SPL_COPY_PAYLOAD_ONLY

23 months agospl: spl_legacy: fix invalid offset in SPL_COPY_PAYLOAD_ONLY
Dai Okamura [Fri, 9 Dec 2022 11:40:21 +0000 (20:40 +0900)]
spl: spl_legacy: fix invalid offset in SPL_COPY_PAYLOAD_ONLY

This fixes the header offset calculation.

This issue was found on uniphier v7 SoCs with SPL.

Fixes: 06377c5a1f ("spl: spl_legacy: Fix NAND boot on OMAP3 BeagleBoard")
Signed-off-by: Dai Okamura <okamura.dai@socionext.com>
Reviewed-By: Michael Trimarchi <michael@amarulasolutions.com>
Acked-by: Michael Trimarchi <michael@amarulasolutions.com>
Link: https://lore.kernel.org/all/20221209114021.3074978-1-okamura.dai@socionext.com
Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
23 months agomtd: nand: mxs_nand_spl: don't read useless pages
Dario Binacchi [Sun, 20 Nov 2022 09:57:04 +0000 (10:57 +0100)]
mtd: nand: mxs_nand_spl: don't read useless pages

The patch prevents pages beyond the last from being unnecessarily read.
This occurs when the last page to be read is not the last page of the
last block. Before this change we would have read all the pages up to
the end of the last block.

Suggested-by: Michael Trimarchi <michael@amarulasolutions.com>
Co-developed-by: Michael Trimarchi <michael@amarulasolutions.com>
Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com>
Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
Acked-by: Michael Trimarchi <michael@amarulasolutions.com>
Link: https://lore.kernel.org/all/20221120095705.3019295-1-dario.binacchi@amarulasolutions.com
23 months agomtd: nand: drop EXPORT_SYMBOL_GPL for nanddev_erase()
Dario Binacchi [Tue, 8 Nov 2022 09:07:19 +0000 (10:07 +0100)]
mtd: nand: drop EXPORT_SYMBOL_GPL for nanddev_erase()

This function is only used within this module, so it is no longer
necessary to use EXPORT_SYMBOL_GPL().

This patch parallels the work done in the following patch:
https://lore.kernel.org/linux-mtd/20221018170205.1733958-1-dario.binacchi@amarulasolutions.com

Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
Reviewed-By: Michael Trimarchi <michael@amarulasolutions.com>
Link: https://lore.kernel.org/all/20221108090719.3631621-1-dario.binacchi@amarulasolutions.com
23 months agocmd: mtd: check if a block has to be skipped or erased
Dario Binacchi [Sun, 30 Oct 2022 14:14:13 +0000 (15:14 +0100)]
cmd: mtd: check if a block has to be skipped or erased

As reported by patch [1], the `mtd erase' command should not erase bad
blocks.
To force bad block erasing you have to use the `mtd erase.dontskipbad'
command.

This patch tries to fix the same issue without modifying code taken
from the linux kernel, in order to make further upgrades easier.

[1] https://lore.kernel.org/all/20221006031501.110290-2-mikhail.kshevetskiy@iopsys.eu/
Suggested-by: Michael Trimarchi <michael@amarulasolutions.com>
Co-developed-by: Michael Trimarchi <michael@amarulasolutions.com>
Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com>
Co-developed-by: Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu>
Signed-off-by: Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu>
Tested-by: Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu>
Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
23 months agomtd: nand: make Samsung SLC NAND usable again
Michael Trimarchi [Fri, 21 Oct 2022 06:05:36 +0000 (08:05 +0200)]
mtd: nand: make Samsung SLC NAND usable again

Upstream linux commit 69fc01296c9281

commit a1286a1fc416 ("mtd: nand: Move Samsung specific init/detection
logic in nand_samsung.c") introduced a regression for Samsung SLC NAND
chips. Prior to this commit chip->bits_per_cell was initialized by calling
nand_get_bits_per_cell() before using nand_is_slc().
With the offending commit this call is skipped, leaving
chip->bits_per_cell cleared to zero when the manufacturer specific
'.detect' function calls nand_is_slc() which in turn interprets
bits_per_cell != 1 as indication for an MLC chip.
The effect is that e.g. a K9F1G08U0F NAND chip is falsely detected as
MLC NAND with 4KiB page size rather than SLC with 2KiB page size.

Add a call to nand_get_bits_per_cell() before calling the .detect hook
function in nand_manufacturer_detect(), so that the nand_is_slc()
calls in the manufacturer specific code will return correct results.

Reported-by: Marcin Gołaś <marcingol30@gmail.com>
Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com>
Reviewed-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
Link: https://lore.kernel.org/all/20221021060536.11747-1-michael@amarulasolutions.com
Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
23 months agomtd: rawnand: omap_gpmc: Reduce .bss usage
Roger Quadros [Tue, 11 Oct 2022 11:50:06 +0000 (14:50 +0300)]
mtd: rawnand: omap_gpmc: Reduce .bss usage

Allocate omap_ecclayout on the heap as we have
limited .bss space on AM64 R5 SPL configuration.

Reduces .bss usage by 2984 bytes.

Signed-off-by: Roger Quadros <rogerq@kernel.org>
Reviewed-By: Michael Trimarchi <michael@amarulasolutions.com>
Link: https://lore.kernel.org/all/20221011115012.6181-9-rogerq@kernel.org
Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
23 months agomtd: rawnand: nand_spl_loaders: Fix cast type build warning
Roger Quadros [Tue, 11 Oct 2022 11:50:05 +0000 (14:50 +0300)]
mtd: rawnand: nand_spl_loaders: Fix cast type build warning

Fixes the below build warning on 64-bit platforms.

drivers/mtd/nand/raw/nand_spl_loaders.c:26:21: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
      dst = (void *)((int)dst - page_offset);

Signed-off-by: Roger Quadros <rogerq@kernel.org>
Reviewed-by: Michael Trimarchi <michael@amarulasolutions.com>
Link: https://lore.kernel.org/all/20221011115012.6181-8-rogerq@kernel.org
Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
23 months agomtd: rawnand: omap_gpmc: Optimize NAND reads
Roger Quadros [Tue, 11 Oct 2022 11:50:02 +0000 (14:50 +0300)]
mtd: rawnand: omap_gpmc: Optimize NAND reads

Rename omap_nand_read() to omap_nand_read_buf() to reflect
actual behaviour.

Use FIFO read address instead of raw read address for reads.

The GPMC automatically converts 32-bit/16-bit reads to NAND
device specific reads (8/16 bit). Use the largest possible
read granularity size for more efficient reads.

Signed-off-by: Roger Quadros <rogerq@kernel.org>
Reviewed-by: Michael Trimarchi <michael@amarulasolutions.com>
Link: https://lore.kernel.org/all/20221011115012.6181-5-rogerq@kernel.org
Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
23 months agomtd: rawnand: omap_gpmc: Fix build warning on 64-bit platforms
Roger Quadros [Tue, 11 Oct 2022 11:50:01 +0000 (14:50 +0300)]
mtd: rawnand: omap_gpmc: Fix build warning on 64-bit platforms

Pointer size cannot be assumed to be 32-bit, so use
use uintptr_t instead of uint32_t.

Fixes the below build warning on 64-bit builds.

drivers/mtd/nand/raw/omap_gpmc.c:439:10: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
  head = ((uint32_t) buf) % 4;

Signed-off-by: Roger Quadros <rogerq@kernel.org>
Reviewed-by: Michael Trimarchi <michael@amarulasolutions.com>
Link: https://lore.kernel.org/all/20221011115012.6181-4-rogerq@kernel.org
Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
23 months agomtd: rawnand: omap_gpmc: Enable build for K2/K3 platforms
Roger Quadros [Tue, 11 Oct 2022 11:50:00 +0000 (14:50 +0300)]
mtd: rawnand: omap_gpmc: Enable build for K2/K3 platforms

The GPMC module is present on some K2 and K3 SoCs.
Enable building GPMC NAND driver for K2/K3 platforms.

Signed-off-by: Roger Quadros <rogerq@kernel.org>
Reviewed-By: Michael Trimarchi <michael@amarulasolutions.com>
Link: https://lore.kernel.org/all/20221011115012.6181-3-rogerq@kernel.org
Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
23 months agomtd: rawnand: omap_gpmc: Deprecate asm/arch/mem.h
Roger Quadros [Tue, 11 Oct 2022 11:49:59 +0000 (14:49 +0300)]
mtd: rawnand: omap_gpmc: Deprecate asm/arch/mem.h

We want to get rid of <asm/arch/mem.h> so don't
enforce it for new platforms.

This also means GPMC_MAX CS doesn't have to be defined
by platform code.

Define it locally here for now.

Signed-off-by: Roger Quadros <rogerq@kernel.org>
Reviewed-by: Michael Trimarchi <michael@amarulasolutions.com>
Link: https://lore.kernel.org/all/20221011115012.6181-2-rogerq@kernel.org
Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
23 months agocmd: nand: Extend nand info to print ecc information
Michael Trimarchi [Thu, 22 Sep 2022 13:39:37 +0000 (15:39 +0200)]
cmd: nand: Extend nand info to print ecc information

Extract the information about ecc strength and ecc step size
from mtd controller. This information is usefull to check if
what we think as ecc is what we really configured.

Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com>
Reviewed-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
Link: https://lore.kernel.org/all/20220922133937.277463-1-michael@amarulasolutions.com
Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
23 months agoMerge tag 'u-boot-stm32-20221207' of https://source.denx.de/u-boot/custodians/u-boot-stm
Tom Rini [Thu, 8 Dec 2022 16:25:08 +0000 (11:25 -0500)]
Merge tag 'u-boot-stm32-20221207' of https://source.denx.de/u-boot/custodians/u-boot-stm

- Drop MMCI interrupt-names in STM32H743, STM32MP15 and STM322MP13 DT

DHSOM:
  - Enable assorted ST specific commands
  - Add version variable
  - Add boot counter
STM32MP13:
  - Add sdmmc cd-gpios for STM32MP135F-DK
  - Add clock & reset support
STM32 ADC:
  - Split channel init into several routines
  - Add support of generic channels binding

23 months agoMerge https://source.denx.de/u-boot/custodians/u-boot-usb
Tom Rini [Thu, 8 Dec 2022 16:24:50 +0000 (11:24 -0500)]
Merge https://source.denx.de/u-boot/custodians/u-boot-usb

- DFU and RNDIS fixes

23 months agousb: gadget: rndis: Prevent InformationBufferOffset manipulation
Szymon Heidrich [Mon, 5 Dec 2022 09:28:23 +0000 (10:28 +0100)]
usb: gadget: rndis: Prevent InformationBufferOffset manipulation

Prevent access to arbitrary memory locations in gen_ndis_set_resp
via manipulation of buf->InformationBufferOffset. Original
implementation permits manipulation of InformationBufferOffset to
exploit OID_GEN_CURRENT_PACKET_FILTER to set arbitrary memory contents
within a 32byte offset as the devices packet filter. The packet filter
value may be next retrieved using gen_ndis_query_resp so it is possible
to extract specific memory regions two bytes a time.

The rndis_query_response was not modified as neither the buffer offset
nor length passed to gen_ndis_query_resp is used.

Signed-off-by: Szymon Heidrich <szymon.heidrich@gmail.com>
23 months agodfu: Make DFU virtual backend SPL friendly
Patrick Delaunay [Wed, 30 Nov 2022 10:42:02 +0000 (11:42 +0100)]
dfu: Make DFU virtual backend SPL friendly

Define stub for dfu_*_virt function in SPL, because
CONFIG_SPL_DFU_VIRT is not defined.

This patch avoids compilation issue in dfu_fill_entity() when
CONFIG_SPL_DFU is activated because the dfu_fill_entity_virt()
function is not available.

Fixes: ec44cace4b8d2 ("dfu: add DFU virtual backend")
Reported-by: Marek Vasut <marex@denx.de>
Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Reviewed-by: Marek Vasut <marex@denx.de>
Tested-by: Marek Vasut <marex@denx.de>
23 months agousb: gadget: dfu: Fix check of transfer direction
Hugo SIMELIERE [Wed, 30 Nov 2022 08:29:16 +0000 (09:29 +0100)]
usb: gadget: dfu: Fix check of transfer direction

Commit fbce985e28eaca3af82afecc11961aadaf971a7e to fix CVE-2022-2347
blocks DFU usb requests.
The verification of the transfer direction was done by an equality
but it is a bit mask.

Signed-off-by: Hugo SIMELIERE <hsimeliere.opensource@witekio.com>
Reviewed-by: Fabio Estevam <festevam@denx.de>
Reviewed-by: Sultan Qasim Khan <sultan.qasimkhan@nccgroup.com>
Reviewed-by: Marek Vasut <marex@denx.de>
Tested-by: Marek Vasut <marex@denx.de>
23 months agoMerge https://source.denx.de/u-boot/custodians/u-boot-riscv
Tom Rini [Thu, 8 Dec 2022 13:28:14 +0000 (08:28 -0500)]
Merge https://source.denx.de/u-boot/custodians/u-boot-riscv

- Kautuk's semihosting patch:
  move semihosting library from arm directory to common place and add
  RISC-V support
- Zong's Kconfig patch:
  use "imply" instead of "select" to allow user to decide if
  SPL_SEPARATE_BSS should be selected

23 months agoMerge tag 'u-boot-at91-fixes-2023.01-b' of https://source.denx.de/u-boot/custodians...
Tom Rini [Thu, 8 Dec 2022 13:27:50 +0000 (08:27 -0500)]
Merge tag 'u-boot-at91-fixes-2023.01-b' of https://source.denx.de/u-boot/custodians/u-boot-at91

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

This is a single tiny fix that allows the correct name for one pin on
sama7g5 device. People with DT coming from Linux will have build errors
without this if they add NAND device.

23 months agoriscv: use imply instead of select for SPL_SEPARATE_BSS
Zong Li [Wed, 16 Nov 2022 07:08:39 +0000 (07:08 +0000)]
riscv: use imply instead of select for SPL_SEPARATE_BSS

Use imply instead of select, then it can still be disabled by
board-specific defconfig, or be set to n manually.

Signed-off-by: Zong Li <zong.li@sifive.com>
Reviewed-by: Rick Chen <rick@andestech.com>
Reviewed-by: Bin Meng <bmeng@tinylab.org>
23 months agocommon/spl/Kconfig: add dependency on SPL_SEMIHOSTING for SPL payload
Kautuk Consul [Wed, 7 Dec 2022 11:42:36 +0000 (17:12 +0530)]
common/spl/Kconfig: add dependency on SPL_SEMIHOSTING for SPL payload

When we enable CONFIG_SPL and CONFIG_SPL_SEMIHOSTING then the code
in common/spl/spl_semihosting.c tries to use the
CONFIG_SPL_FS_LOAD_PAYLOAD_NAME string which remains undeclared
unless SPL_FS_EXT4 || SPL_FS_FAT || SPL_FS_SQUASHFS are configured.

Add a dependency of SPL_SEMIHOSTING in the depends for
SPL_FS_LOAD_PAYLOAD_NAME so that the code compiles fine.

Signed-off-by: Kautuk Consul <kconsul@ventanamicro.com>
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
23 months agoarch/riscv: add semihosting support for RISC-V
Kautuk Consul [Wed, 7 Dec 2022 11:42:35 +0000 (17:12 +0530)]
arch/riscv: add semihosting support for RISC-V

We add RISC-V semihosting based serial console for JTAG based early
debugging.

The RISC-V semihosting specification is available at:
https://github.com/riscv/riscv-semihosting-spec/blob/main/riscv-semihosting-spec.adoc

Signed-off-by: Anup Patel <apatel@ventanamicro.com>
Signed-off-by: Kautuk Consul <kconsul@ventanamicro.com>
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
23 months agolib: Add common semihosting library
Kautuk Consul [Wed, 7 Dec 2022 11:42:34 +0000 (17:12 +0530)]
lib: Add common semihosting library

We factor out the arch-independent parts of the ARM semihosting
implementation as a common library so that it can be shared
with RISC-V.

Signed-off-by: Kautuk Consul <kconsul@ventanamicro.com>
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>