Andrew Goodbody [Wed, 5 Feb 2025 13:04:26 +0000 (13:04 +0000)]
test/py: usb: Fix format string for fstype command
USB tests on ext partitions can fail with the following output
test/py/tests/test_usb.py:245: in test_usb_part
'fstype usb %d:%d' % i, part_id
E TypeError: not enough arguments for format string
So add brackets around the format string arguments to prevent the
error.
Fixes:
a730947974e3 ("test/py: usb: Distinguish b/w ext2/ext4 partitions")
Signed-off-by: Andrew Goodbody <andrew.goodbody@linaro.org>
Reviewed-by: Marek Vasut <marex@denx.de>
Reviewed-by: Love Kumar <love.kumar@amd.com>
Marek Vasut [Wed, 5 Feb 2025 14:34:28 +0000 (15:34 +0100)]
tools: mkenvimage: List -V parameter in help text
The -V version parameter is missing in the optional list of parameters
in help text. Add it.
Signed-off-by: Marek Vasut <marex@denx.de>
Weijie Gao [Thu, 6 Feb 2025 00:41:28 +0000 (08:41 +0800)]
mediatek: mt7986: rename pinctrl to pio in mt7986-u-boot.dtsi
The change from pinctrl to pio was missing in mt7986-u-boot.dtsi and will
cause build failure. Now fix it.
Fixes:
f1775996ba9 (mediatek: mt7986: move gpio-controller up and rename pinctrl to pio)
Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
Weijie Gao [Thu, 6 Feb 2025 02:19:06 +0000 (10:19 +0800)]
pinctrl: mediatek: support reading register base address by name
This patch add support to read register base address by name if
provided.
Also devfdt_get_addr_* is changed to dev_read_addr_* to support DT
live tree.
Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
Weijie Gao [Thu, 6 Feb 2025 02:18:57 +0000 (10:18 +0800)]
pinctrl: mediatek: mt7988: remove _base from reg-names
The reg-names in mt7988.dtsi have no _base suffix. Remove the suffix
will also make it match upstream linux format.
Fixes:
8c2cb748ef5 (pinctrl: mediatek: mt7988: rename reg-names to upstream linux format)
Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
Tom Rini [Fri, 7 Feb 2025 19:12:50 +0000 (13:12 -0600)]
Azure: Add missing "set -e" to docs job
Without setting the shell flag to exit immediately when a command exists
with a non-zero status we can have the situation where the htmldocs
target fails with an error but the job will succeed due to infodocs
passing and being the last build target.
Signed-off-by: Tom Rini <trini@konsulko.com>
Tom Rini [Mon, 10 Feb 2025 14:45:04 +0000 (08:45 -0600)]
Merge https://source.denx.de/u-boot/custodians/u-boot-samsung
- e850-96 platform updates
Tom Rini [Fri, 7 Feb 2025 19:35:32 +0000 (13:35 -0600)]
Merge patch series "cmd/setexpr: support concatenation of direct strings"
Heinrich Schuchardt <heinrich.schuchardt@canonical.com> says:
The setexpr.s command allows to concatenate two strings.
According to the description in doc/usage/cmd/setexpr.rst the parameters
value1 and value2 can be either direct values or pointers to a
memory location holding the values.
Unfortunately `setexpr.s <value1> + <value2>` fails if any of the values
is a direct value. $? is set to false.
* Add support for direct values in setexpr.s.
* Correct the unit test for "setexpr.s fred 0".
* Add a new unit test for "setexpr.s fred '1' + '3'" giving '13'.
* Remove invalid memory leak tests
Link: https://lore.kernel.org/r/20250203151029.60265-1-heinrich.schuchardt@canonical.com
Heinrich Schuchardt [Mon, 3 Feb 2025 15:10:29 +0000 (16:10 +0100)]
cmd/setexpr: support concatenation of direct strings
The setexpr.s command allows to concatenate two strings.
According to the description in doc/usage/cmd/setexpr.rst the parameters
value1 and value2 can be either direct values or pointers to a
memory location holding the values.
Unfortunately `setexpr.s <value1> + <value2>` fails if any of the values
is a direct value. $? is set to false.
* Add support for direct values in setexpr.s.
* Correct the unit test for "setexpr.s fred 0".
* Add a new unit test for "setexpr.s fred '1' + '3'" giving '13'.
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Heinrich Schuchardt [Mon, 3 Feb 2025 15:10:28 +0000 (16:10 +0100)]
test: remove available memory check in setexpr_test_str_oper()
env_set() frees the previous value after allocating the new value.
As the free() may merge memory chunks the available memory is not
expected to stay constant.
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Heinrich Schuchardt [Mon, 3 Feb 2025 15:10:27 +0000 (16:10 +0100)]
test: remove available memory check in setexpr_test_str()
env_set() frees the previous value after allocating the new value.
As the free() may merge memory chunks the available memory is not
expected to stay constant.
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Heinrich Schuchardt [Mon, 3 Feb 2025 15:10:26 +0000 (16:10 +0100)]
test: clean up setexpr_test_str()
Assign variable buf in the sub-test where it is used.
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Tom Rini [Fri, 7 Feb 2025 16:53:43 +0000 (10:53 -0600)]
Merge patch series "led: add function naming option from linux"
Heiko Schocher <hs@denx.de> says:
In linux we have the option to create the name of a led
optionally through the following properties:
- function
- color
- function-enumerator
This series adds support for parsing this properties if there
is no label property.
Link: https://lore.kernel.org/r/20250128135246.74838-1-hs@denx.de
[trini: Document name parameter in led.h]
Heiko Schocher [Tue, 28 Jan 2025 13:52:46 +0000 (14:52 +0100)]
led: add function naming option from linux
in linux we have the option to create the name of a led
optionally through the following properties:
- function
- color
- function-enumerator
This patch adds support for parsing this properties if there
is no label property.
The led name is created in led_post_bind() and we need some
storage place for it. Currently this patch prevents to use
malloc() instead it stores the name in new member :
char name[LED_MAX_NAME_SIZE];
of struct led_uc_plat. While at it append led tests for the
new feature.
Signed-off-by: Heiko Schocher <hs@denx.de>
Reviewed-by: Tom Rini <trini@konsulko.com>
Heiko Schocher [Tue, 28 Jan 2025 13:52:45 +0000 (14:52 +0100)]
doc: remove redundant leds bindings
remove file doc/device-tree-bindings/leds/common.txt
as we have this now already in
dts/upstream/include/dt-bindings/leds/common.h
which is imported from linux.
Signed-off-by: Heiko Schocher <hs@denx.de>
Reviewed-by: Tom Rini <trini@konsulko.com>
Tom Rini [Thu, 6 Feb 2025 14:09:54 +0000 (08:09 -0600)]
Merge tag 'xilinx-for-v2025.04-rc2' of https://source.denx.de/u-boot/custodians/u-boot-microblaze
AMD/Xilinx changes for v2025.04-rc2
fpga:
- Cleanup help
- Show xilinx only options on Xilinx devices
ospi-versal:
- Fix alignment issue
- Fix cadence_qspi_flash_reset() prototype
zynqmp:
- Define usb_pgood_delay
- Fix bootseq number
versal:
- Fix mini_ospi configuration
versal2:
- Enable OPTEE
xilinx:
- Enable some flashes
- Clean up SYS_MALLOC_F_LEN Kconfig
- Some binman fixes
- DT updates
- Enable mkfwumdata compilation
- Enable meminfo command
- Switch to LWIP and enable HTTPS
Aashvij Shenai [Wed, 29 Jan 2025 10:56:09 +0000 (16:26 +0530)]
arm64: configs: Remove SYS_BOOTM_LEN for TI devices
AM62x BOOTM_LEN is too small to contain OS images. Removing this sets the
size to a default 0x4000000 (for all arm64 devices).
It is unnecessary to specifically call the default size for the other
configs.
Signed-off-by: Kamlesh Gurudasani <kamlesh@ti.com>
Signed-off-by: Aashvij Shenai <a-shenai@ti.com>
Liya Huang [Tue, 28 Jan 2025 13:31:49 +0000 (21:31 +0800)]
arm: Correct dependency for STATIC_MACH_TYPE
Kconfig should not display the STATIC_MACH_TYPE option when
SUPPORT_PASSING_ATAGS is not selected. For example, when using most
platforms with menuconfig, it shows the STATIC_MACH_TYPE option causing
confusion. As we know, this should not occur when SUPPORT_PASSING_ATAGS
is not selected
[trini: Reword commit message]
Signed-off-by: Liya Huang <1425075683@qq.com>
Liya Huang [Tue, 28 Jan 2025 13:22:15 +0000 (21:22 +0800)]
armv7m: kconfig adds the NVIC option and masks the GIC option when NVIC is selected
ARMv7-M architecture uses NVIC instead of GIC.
NVIC is an interrupt controller specially designed for
ARM Cortex-M series processors.
Signed-off-by: Liya Huang <1425075683@qq.com>
Tom Rini [Wed, 5 Feb 2025 18:38:50 +0000 (12:38 -0600)]
Merge branch 'master' of https://source.denx.de/u-boot/custodians/u-boot-sh
Benjamin Szőke [Tue, 4 Feb 2025 20:56:17 +0000 (21:56 +0100)]
zynqmp: Save "bootseq" environment variable in decimal format
In U-Boot, most of mmc releated commands uses decimal value in arguments, like
"mmc dev ${bootseq}" or "bootargs=root=/dev/mmcblk${bootseq}p2". In order to
improve compatibilities, export "bootseq" number to environment variable in
decimal format instead of hex.
Signed-off-by: Benjamin Szőke <egyszeregy@freemail.hu>
Link: https://lore.kernel.org/r/20250204205617.1238-1-egyszeregy@freemail.hu
Signed-off-by: Michal Simek <michal.simek@amd.com>
Michal Simek [Tue, 4 Feb 2025 08:53:41 +0000 (09:53 +0100)]
arm64: zynqmp: Describe images without TF-A
U-Boot can run out of EL3, NS-EL2 and NS-EL1. Currently default
configuration is NS-EL2 with TF-A but when TF-A is not passed and
configured images can still boot just fine. That's why support this
configuration and describe it via binman.
Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/9b3dad80138e97005df3d033b4611c9d7e05a177.1738659214.git.michal.simek@amd.com
Michal Simek [Tue, 4 Feb 2025 08:53:40 +0000 (09:53 +0100)]
arm64: zynqmp: Use DTB address base from .config
CONFIG_XILINX_OF_BOARD_DTB_ADDR holds DTB address which U-Boot is checking.
Currently address in binman match default value but macro can be used
directly.
Also sync node name (s/hash-1/hash/) and sync location to have the same
order load/hash/image.
All binman DTSes are compiled that's why also guard
CONFIG_XILINX_OF_BOARD_DTB_ADDR which depends on OF_BOARD || OF_SEPARATE
which is a problem for mini configurations which are using OF_EMBED.
Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/a22c9671b965b222bfd419f5bfaee012929f3d88.1738659214.git.michal.simek@amd.com
Michal Simek [Tue, 4 Feb 2025 08:53:39 +0000 (09:53 +0100)]
arm64: zynqmp: Fix TEE loading address and add hash
There is incorrect loading address listed for TEE.
CONFIG_BL32_LOAD_ADDR should be used.
Also there is missing hash for this entry which is present for other nodes.
Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/4e7e3a7110acc050ea7c06ac661e5b5be46e8602.1738659214.git.michal.simek@amd.com
Michal Simek [Mon, 3 Feb 2025 09:28:15 +0000 (10:28 +0100)]
fpga: Make do_fpga_loads() static
do_fpga_loads() is not called from anywhere else that's why make it static.
Reviewed-by: Alexander Dahl <ada@thorsis.com>
Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/cbe93e4eb33752aaddc943b15fd04731d4f75b68.1738574893.git.michal.simek@amd.com
Padmarao Begari [Mon, 3 Feb 2025 09:04:09 +0000 (14:34 +0530)]
configs: versal: update initial stack pointer
The mini u-boot is hanging because of an initial stack
pointer address is used at half of the memory, when mini
u-boot is called reloc_fdt() function and doing memcpy()
for the fdt before relocation, and there is no sufficient
memory for the stack pointer. To fix, set an initial stack
pointer address to near the top of memory. The new stack
pointer address is assigned before calling the relocate
of u-boot based on the stack relocate calculation and
this new stack pointer is used while executing u-boot
from the relocated memory.
Signed-off-by: Padmarao Begari <padmarao.begari@amd.com>
Link: https://lore.kernel.org/r/20250203090409.844403-1-padmarao.begari@amd.com
Signed-off-by: Michal Simek <michal.simek@amd.com>
Michal Simek [Wed, 29 Jan 2025 15:31:25 +0000 (16:31 +0100)]
xilinx: Enable MBEDTLS/LWIP/WGET and WGET_HTTPS
Enable lwip and https on our platforms to be able to use it in a boot.
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/cb05adaf0758c2c4f1361f8665169897493638e7.1738164681.git.michal.simek@amd.com
Michal Simek [Mon, 27 Jan 2025 11:11:38 +0000 (12:11 +0100)]
xilinx: Enable meminfo command with mapping
Enable meminfo command to be able to see where things are mapped.
Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/b7f9f5e18e16a945277d4b8cfde5a7f057e77676.1737976295.git.michal.simek@amd.com
Michal Simek [Fri, 24 Jan 2025 13:04:07 +0000 (14:04 +0100)]
xilinx: Enable mkfwumdata tool for a/b update
Build mkfwumdata tool by default for building ab mdata structure.
Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/6d82c9a2db30e12ea17fa125c68a555d7f070851.1737723845.git.michal.simek@amd.com
Ibai Erkiaga [Tue, 21 Jan 2025 13:01:34 +0000 (13:01 +0000)]
fpga: add new symbol for fpga_loadb
Adding new symbol for the fpga loadb command which is exclusive to
Xilinx. Default value is y for backward compatibility.
Clarify the type of file used for fpga programming commands
Signed-off-by: Ibai Erkiaga <ibai.erkiaga-elorza@amd.com>
Link: https://lore.kernel.org/r/20250121130138.1999916-6-ibai.erkiaga-elorza@amd.com
Signed-off-by: Michal Simek <michal.simek@amd.com>
Ibai Erkiaga [Tue, 21 Jan 2025 13:01:33 +0000 (13:01 +0000)]
fpga: xilinx exclusive commands
Ensure all Xilinx exclusive fpga commands have a KConfig symbol and
dependency to FPGA_XILINX listed. Remove (Xilinx only) text from the
help command.
Signed-off-by: Ibai Erkiaga <ibai.erkiaga-elorza@amd.com>
Link: https://lore.kernel.org/r/20250121130138.1999916-5-ibai.erkiaga-elorza@amd.com
Signed-off-by: Michal Simek <michal.simek@amd.com>
Ibai Erkiaga [Tue, 21 Jan 2025 13:01:32 +0000 (13:01 +0000)]
fpga: resort fpga commands
Resort the fpga commands both in the Kconfig and in the source code to
list
Signed-off-by: Ibai Erkiaga <ibai.erkiaga-elorza@amd.com>
Link: https://lore.kernel.org/r/20250121130138.1999916-4-ibai.erkiaga-elorza@amd.com
Signed-off-by: Michal Simek <michal.simek@amd.com>
Ibai Erkiaga [Tue, 21 Jan 2025 13:01:31 +0000 (13:01 +0000)]
fpga: improve loads usage information
Current usage information for loads command is too verbose and long for
a command usage prompt. This flag simplifies the text for readability
purposes.
Signed-off-by: Ibai Erkiaga <ibai.erkiaga-elorza@amd.com>
Link: https://lore.kernel.org/r/20250121130138.1999916-3-ibai.erkiaga-elorza@amd.com
Signed-off-by: Michal Simek <michal.simek@amd.com>
Ibai Erkiaga [Tue, 21 Jan 2025 13:01:30 +0000 (13:01 +0000)]
fpga: fix alignment on fpga cmd usage info
The current implementation generates some alignment issues as well as
some overlapping when all the fpga command options are enabled. The fix
is intended to improve readability of the usage info.
Signed-off-by: Ibai Erkiaga <ibai.erkiaga-elorza@amd.com>
Acked-by: Alexander Dahl <ada@thorsis.com>
Link: https://lore.kernel.org/r/20250121130138.1999916-2-ibai.erkiaga-elorza@amd.com
Signed-off-by: Michal Simek <michal.simek@amd.com>
Alexander Dahl [Tue, 21 Jan 2025 16:22:12 +0000 (17:22 +0100)]
fpga: Avoid ignored-qualifiers warning
Fixes annoying warnings of the following type when built with W=1 (for
each file including fpga.h):
CC drivers/fpga/fpga.o
In file included from /mnt/data/adahl/src/u-boot/include/xilinx.h:7,
from /mnt/data/adahl/src/u-boot/drivers/fpga/fpga.c:10:
/mnt/data/adahl/src/u-boot/include/fpga.h:61:1: warning: type qualifiers ignored on function return type [-Wignored-qualifiers]
61 | const fpga_desc *const fpga_get_desc(int devnum);
| ^~~~~
/mnt/data/adahl/src/u-boot/include/fpga.h:81:1: warning: type qualifiers ignored on function return type [-Wignored-qualifiers]
81 | const fpga_desc *const fpga_validate(int devnum, const void *buf,
| ^~~~~
/mnt/data/adahl/src/u-boot/drivers/fpga/fpga.c:36:1: warning: type qualifiers ignored on function return type [-Wignored-qualifiers]
36 | const fpga_desc *const fpga_get_desc(int devnum)
| ^~~~~
/mnt/data/adahl/src/u-boot/drivers/fpga/fpga.c:53:1: warning: type qualifiers ignored on function return type [-Wignored-qualifiers]
53 | const fpga_desc *const fpga_validate(int devnum, const void *buf,
| ^~~~~
Do some type and cast cleanup on that fpga_desc type while at it.
Link: https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wignored-qualifiers
Signed-off-by: Alexander Dahl <ada@thorsis.com>
Link: https://lore.kernel.org/r/20250121162213.1477506-1-ada@thorsis.com
Signed-off-by: Michal Simek <michal.simek@amd.com>
Michal Simek [Tue, 21 Jan 2025 13:41:49 +0000 (14:41 +0100)]
arm64: zynqmp: Describe ethernet controllers via aliases on SOM
Add ethernet aliases to CC (Carrier card) description to create a
connection which is used by fdt_fixup_ethernet() for updating
local-mac-address in DT.
On Kria SOM MAC address is read from i2c eeprom at start and based on it
environment variables are created. Without creating aliases U-Boot is not
able to inject local-mac-address DT property and OS won't get the same MAC
address unless another i2c read is happening in OS.
Also aliases are using string not phandle that's why full path has to be
provided but that shouldn't be a big issue because location of ethernet
controller is fixed.
Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/6d360e71a0530d201578e27a6997dbd472772e39.1737466907.git.michal.simek@amd.com
Prasad Kummari [Tue, 21 Jan 2025 12:24:59 +0000 (13:24 +0100)]
arm64: zynqmp: enable u-boot itb generation via binman if SPL is enabled
Output images are generated via Binman only if SPL is enabled, as
there is no consumer for them otherwise. An #ifdef check ensures that
when SPL is enabled, Binman generates the U-Boot ITB. If SPL is disabled,
ITB generation is skipped since the ITB format is supported only by SPL.
Without SPL, generating such an image is unnecessary, as it would not be
used
The second reason is that when a DTB is passed, the current logic cannot
handle it without an additional step in U-Boot to parse an appended FIT
image and enable board-specific code to select the correct DTB config.
The MULTI_DTB_FIT configuration should be used if support for multiple
DTBs is required, but SPL is not being used.
Signed-off-by: Prasad Kummari <prasad.kummari@amd.com>
Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/7cba738ae36dacf7d1b0cfbaf13e0c9b3a0df225.1737462296.git.michal.simek@amd.com
Michal Simek [Mon, 20 Jan 2025 13:33:47 +0000 (14:33 +0100)]
xilinx: Remove SYS_MALLOC_F_LEN setup via board Kconfig
The commit
e05689242238 ("Kconfig: Change SYS_MALLOC_F_LEN default to
0x2000") already setup default values from board Kconfigs that's why no
reason to duplicate it again.
Fixes:
e05689242238 ("Kconfig: Change SYS_MALLOC_F_LEN default to 0x2000")
Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/c3edd75b7a19d5cc205c9d5c37c2d86189ca3de6.1737380025.git.michal.simek@amd.com
Prasad Kummari [Tue, 7 Jan 2025 12:29:15 +0000 (17:59 +0530)]
configs: zynqmp: Add usb_pgood_delay for SOM boards
Add usb_pgood_delay to ensure proper detection of USB devices.
Increase the USB power good delay on the SOM boards, as this
is required for certain USB sticks otherwise, they may not
be detected.
Signed-off-by: Prasad Kummari <prasad.kummari@amd.com>
Link: https://lore.kernel.org/r/20250107122915.1378284-1-prasad.kummari@amd.com
Signed-off-by: Michal Simek <michal.simek@amd.com>
Venkatesh Yadav Abbarapu [Wed, 22 Jan 2025 13:53:34 +0000 (19:23 +0530)]
spi: cadence_qspi: Add missing prototype for cadence_qspi_flash_reset
Add missing prototype to fix the sparse warning,
warning: no previous prototype for 'cadence_qspi_flash_reset'
[-Wmissing-prototypes].
Fixes:
6d234a79e9 ("cadence_qspi: Refactor the flash reset functionality")
Signed-off-by: Venkatesh Yadav Abbarapu <venkatesh.abbarapu@amd.com>
Link: https://lore.kernel.org/r/20250122135334.1201562-1-venkatesh.abbarapu@amd.com
Signed-off-by: Michal Simek <michal.simek@amd.com>
Padmarao Begari [Mon, 6 Jan 2025 09:51:20 +0000 (15:21 +0530)]
spi: cadence_qspi: Fix OSPI DDR mode alignment issue
If the least significant bit of the address is set to one when
using the DDR protocol for data transfer then the results are
indeterminate for few flash devices. To fix this the least
significant bit of the address is set to zero.
Signed-off-by: Padmarao Begari <padmarao.begari@amd.com>
Link: https://lore.kernel.org/r/20250106095120.800753-1-padmarao.begari@amd.com
Signed-off-by: Michal Simek <michal.simek@amd.com>
Venkatesh Yadav Abbarapu [Fri, 17 Jan 2025 06:45:56 +0000 (12:15 +0530)]
arm64: versal2: Enable the OPTEE command
Enable the command OPTEE which runs the basic 'hello world ta'.
Signed-off-by: Venkatesh Yadav Abbarapu <venkatesh.abbarapu@amd.com>
Link: https://lore.kernel.org/r/20250117064556.673369-1-venkatesh.abbarapu@amd.com
Signed-off-by: Michal Simek <michal.simek@amd.com>
Venkatesh Yadav Abbarapu [Thu, 16 Jan 2025 05:18:57 +0000 (10:48 +0530)]
xilinx: Enable support for Infineon Octal flashes
Added support for Infineon Octal flash components on the
Versal and Versal Net platforms.
Signed-off-by: Tejas Bhumkar <tejas.arvind.bhumkar@amd.com>
Signed-off-by: Venkatesh Yadav Abbarapu <venkatesh.abbarapu@amd.com>
Link: https://lore.kernel.org/r/20250116051857.346921-1-venkatesh.abbarapu@amd.com
Signed-off-by: Michal Simek <michal.simek@amd.com>
Sam Protsenko [Thu, 16 Jan 2025 23:01:30 +0000 (17:01 -0600)]
board: samsung: e850-96: Provide bootstd default env
Add default environment variables needed for Standard Boot enablement as
described in [1]. Also rework the eMMC partition table for Linux boot so
it only has two partitions:
1. EFI System Partition (EFI vars, GRUB efi app, firmware files)
2. rootfs partition (Debian rootfs, /boot, extlinux.conf, boot.scr)
Both partitions are made bootable so that 'bootflow' command can detect
all loader files (rootfs might contain extlinux.conf and boot.scr).
'ldfw' partition is removed too, as ldfw.bin can be loaded from ESP now
(from /EFI/firmware/ldfw.bin).
Android partitons will be added later, once Android boot is actually
enabled for E850-96.
Notes:
- $kernel_comp_addr_r uses the same address (0x88000000) as LDFW
buffer (in board/samsung/e850-96/fw.c), but that's fine, as LDFW
will be copied to another RAM location (Secure World) by SMC
command, so it's only used temporarily on startup
- addition assignment (+=) operation is used for $partitions to avoid
spaces added by newlines, so that $partitions can be used in the
shell with no quotes
Now it's possible to successfully automatically boot Debian rootfs:
=> env default -f -a
=> env save
=> gpt write mmc 0 $partitions
=> reset
[1] doc/develop/bootstd/overview.rst
Signed-off-by: Sam Protsenko <semen.protsenko@linaro.org>
Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
Sam Protsenko [Thu, 16 Jan 2025 23:01:29 +0000 (17:01 -0600)]
board: samsung: e850-96: Report LDFW loading failures
LDFW firmware loading can fail, e.g. in case if user forgot to upload
the binary to the appropriate location (/EFI/firmware/ldfw.bin on ESP
partition). Report such errors explicitly, so that the user can notice
it early and take necessary actions. But don't return error code from
board_init() in this case, as LDFW firmware is not mandatory for board
operation and is only required for some features like TRNG.
Signed-off-by: Sam Protsenko <semen.protsenko@linaro.org>
Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
Sam Protsenko [Thu, 16 Jan 2025 23:01:28 +0000 (17:01 -0600)]
board: samsung: e850-96: Load LDFW from EFI partition
In case when EFI System Partition is present it can be used to store
firmware binaries, instead of keeping those on separate dedicated
partitions. That simplifies the partition table and makes it more
standard. Rework the firmware loader code to look for LDFW binary at
/EFI/firmware/ldfw.bin on ESP first, and if either the partition or the
file doesn't exist -- fallback to reading it from 'ldfw' partition. This
way backward compatibility can be kept, and Android partition tables
without ESP partition can be handled too.
Signed-off-by: Sam Protsenko <semen.protsenko@linaro.org>
Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
Sam Protsenko [Thu, 16 Jan 2025 23:01:27 +0000 (17:01 -0600)]
configs: e850-96: Enable Standard Boot
Enable Standard Boot on E850-96 as documented in [1]. Along with
corresponding changes in the default environment and properly prepared
eMMC partitions (ESP and rootfs), it makes it possible to boot Debian
rootfs automatically. All boot methods were tested: efi_mgr, efi,
syslinux and script. The preferred boot method is efi_mgr, which relies
on the configured EFI variables (stored in /ubootefi.var file on ESP
partition), which boots either GRUB from /EFI/debian/grubaa64.efi, or
systemd-boot from /EFI/BOOT/BOOTAA64.EFI. Currently used boot sequence:
U-Boot -> bootcmd -> 'bootflow scan -lb' -> efi_mgr -> GRUB -> Debian
[1] doc/develop/bootstd/overview.rst
Signed-off-by: Sam Protsenko <semen.protsenko@linaro.org>
Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
Sam Protsenko [Thu, 16 Jan 2025 23:01:26 +0000 (17:01 -0600)]
configs: e850-96: Enable more EFI features
The basic EFI support is already enabled by EFI_LOADER. Follow
SystemReady IR recommendations [1,2] for U-Boot and enable support for
more EFI features. That includes:
- CONFIG_CMD_BOOTEFI_SELFTEST: support for "bootefi selftest" command
- CONFIG_CMD_NVEDIT_EFI: support for "env -e" to explore EFI vars
- CONFIG_CMD_EFIDEBUG: support for "efidebug" command
Also enable RTC support:
- CONFIG_EFI_SET_TIME
- CONFIG_CMD_RTC
- CONFIG_DM_RTC
- CONFIG_RTC_EMULATION
[1] https://developer.arm.com/documentation/DUI1101/1-1/Configure-U-Boot-for-SystemReady
[2] https://developer.arm.com/documentation/DUI1101/1-1/Test-SystemReady-IR
Signed-off-by: Sam Protsenko <semen.protsenko@linaro.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
Sam Protsenko [Thu, 16 Jan 2025 23:01:25 +0000 (17:01 -0600)]
configs: e850-96: Enable U-Boot environment on eMMC
Store U-Boot environment in BOOT2 HW area of eMMC (/dev/mmcblk0boot1),
as it's currently unused. BOOT1 area will be probably used for storing
low-level bootloaders further, so let's not touch it.
Both primary and redundant environments work fine:
=> env default -f -a
## Resetting to default environment
=> env save
Saving Environment to MMC... Writing to redundant MMC(0)... OK
Signed-off-by: Sam Protsenko <semen.protsenko@linaro.org>
Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
Sam Protsenko [Thu, 16 Jan 2025 23:01:24 +0000 (17:01 -0600)]
configs: e850-96: Enable options for updated env
The E850-96 default environment is going to be updated soon, requiring
next config options to be enabled:
- CONFIG_DEFAULT_FDT_FILE: $fdtfile will use this value
- CONFIG_PARTITION_TYPE_GUID: $partitions will rely on "type" feature
Signed-off-by: Sam Protsenko <semen.protsenko@linaro.org>
Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
Marek Vasut [Sat, 25 Jan 2025 12:28:30 +0000 (13:28 +0100)]
net: miiphybb: Update debug() print
Update the debug() print, use __func__ to always print matching
function name, and also print bus name in case there are multiple
busses.
Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Paul Barker <paul.barker.ct@bp.renesas.com>
Marek Vasut [Sat, 18 Jan 2025 06:16:17 +0000 (07:16 +0100)]
net: miiphybb: Convert ifdef DEBUG to debug()
Replace ifdeffery with plain debug() function call. No functional change.
Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Paul Barker <paul.barker.ct@bp.renesas.com>
Marek Vasut [Fri, 31 Jan 2025 01:19:57 +0000 (02:19 +0100)]
arm64: renesas: Add R-Car S4 Starter Kit support
Add support for the R-Car S4 Starter Kit with R8A779F4 SoC support.
This implementation natively uses OF_UPSTREAM to pull in most recent
DT. The defconfig is derived from S4 Spider, with reduced UART baud
rate to 921600 Bdps. The DT alias to rswitch is removed as the alias
should point to rswitch ports, not to rswitch itself, see [1].
[1] https://lore.kernel.org/linux-arm-kernel/
20250118111344.361617-5-marek.vasut+renesas@mailbox.org/
Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Marek Vasut [Wed, 29 Jan 2025 21:54:50 +0000 (22:54 +0100)]
remoteproc: renesas: Synchronize caches across cores
Explicitly flush icache on the CR52 core before jumping to the next
stage software to make sure it does not contain any invalid content.
Explicitly flash and invalidate dcache on the CA76 core both over the
trampoline buffer and over the CR52 firmware, and then trigger full
system synchronization, to make sure the data surely land in DRAM,
from where the CR52 can surely pick them up.
Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Tom Rini [Wed, 29 Jan 2025 20:47:12 +0000 (14:47 -0600)]
Gitlab: Add results.xml to the list of artifacts as well.
Whereas with Azure the JUnit results file is available for download,
Gitlab doesn't default to including it as an artifact to download and
only makes it available via its own JUnit parser. Fix this by listing it
as an artifact to save as well.
Signed-off-by: Tom Rini <trini@konsulko.com>
Tom Rini [Tue, 28 Jan 2025 23:29:48 +0000 (17:29 -0600)]
GitLab: Run sandbox on fast amd64 and fast arm64 hosts
Now that we can run sandbox on arm64 hosts, have these jobs run on both
the fast arm64 and amd64 hosts to catch any issues.
Signed-off-by: Tom Rini <trini@konsulko.com>
Liya Huang [Tue, 28 Jan 2025 01:13:16 +0000 (09:13 +0800)]
examples: fix building on arm32
Refer to the commit
a3c101a61348 ("examples: fix building on arm64")
fix for arm32. crt0.S does not even build with:
operating system and architecture:
5.15.0-130-generic x86_64
installed version of gcc and binutils:
gcc version 9.4.0 (Ubuntu 9.4.0-1ubuntu1~20.04.3)
GNU ld (GNU Binutils for Ubuntu) 2.34
used defconfig:
stm32h750-art-pi_defconfig
used commands for building:
export CROSS_COMPILE=arm-none-eabi- ARCH=arm
make stm32h750-art-pi_defconfig
make menuconfig # to add
make
examples/api/crt0.S: Assembler messages:
examples/api/crt0.S:32: Error: lo register required -- `ldr ip,=search_hint'
examples/api/crt0.S:33: Error: lo register required -- `str sp,[ip]'
examples/api/crt0.S:39: Error: lo register required -- `ldr ip,=syscall_ptr'
examples/api/crt0.S:40: Error: lo register required -- `ldr pc,[ip]'
make[2]: *** [scripts/Makefile.build:292:examples/api/crt0.o] Error 1
Use valid register names and instructions.
Signed-off-by: Liya Huang <1425075683@qq.com>
Liya Huang [Mon, 27 Jan 2025 09:38:11 +0000 (17:38 +0800)]
API: system info adds FLASH and clk fetches
Refer to api/api platform-powerpc.c implementation
Signed-off-by: Liya Huang <1425075683@qq.com>
Heinrich Schuchardt [Mon, 27 Jan 2025 07:18:46 +0000 (08:18 +0100)]
examples: eliminate CONFIG_STANDALONE_LOAD_ADDR
CONFIG_STANDALONE_LOAD_ADDR has been used for examples/standalone
but not for examples/api.
The suitability of an address to load an ELF binary and run it does
not only depend on the architecture but also on the memory layout of
the board which is not reflected in the default value of
CONFIG_STANDALONE_LOAD_ADDR.
Commit
32b7e39db4d3 ("Convert CONFIG_STANDALONE_LOAD_ADDR to Kconfig")
set the default on RISC-V to 0x0 though most boards used 0x80200000
before the patch.
On most boards we can assume 8 MiB of memory available above $loadaddr.
So we can safely use $loadaddr + 4 MiB as load address for the standalone
example and eliminate CONFIG_STANDALONE_LOAD_ADDR altogether.
Fixes:
32b7e39db4d3 ("Convert CONFIG_STANDALONE_LOAD_ADDR to Kconfig")
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Heinrich Schuchardt [Mon, 27 Jan 2025 06:49:36 +0000 (07:49 +0100)]
examples/api: improve determination of LOAD_ADDR
The current load address for the 'demo' binary does not work for
qemu_arm_defconfig.
The suitability of an address to load an ELF binary and run it does
not only depend on the architecture but also on the memory layout of
the board.
On most boards we can assume that 8 MiB of memory is available above
$loadaddr. So $loadaddr + 0x400000 should work there.
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Quentin Schulz [Wed, 22 Jan 2025 15:53:15 +0000 (16:53 +0100)]
image: apply FDTOs on FDT image node without a load property
A FIT image which is NOT using -E when created by mkimage - that is with
image data within the FIT - will fail to apply FDTO if the base FDT
image node does not specify a load property (which points to an address
in DRAM). This is because we check that the FDT address we want to apply
overlay to (i.e. modify and likely increase in size) is not inside the
FIT and give up otherwise. This is assumed necessary because we may then
overwrite other data when applying in-place.
However, we can do better than giving up: relocating the FDT in another
place in DRAM where it's safe to increase its size and apply FDTOs.
While at it, do not discriminate anymore on whether the data is within
the FIT data address space - that is FIT images created with mkimage -E
- as that still may be susceptible to unintended data overwrites as
mkimage -E simply concatenates all blobs after the FIT. If the FDT blob
isn't the last, it'll result in overwriting later blobs when resizing.
The side effect is that the load property in the FIT is only
temporarily used to load the FDT but then relocated right before we
start applying overlays.
Suggested-by: Marek Vasut <marex@denx.de>
Reviewed-by: Marek Vasut <marex@denx.de>
Signed-off-by: Quentin Schulz <quentin.schulz@cherry.de>
Tom Rini [Tue, 4 Feb 2025 16:23:02 +0000 (10:23 -0600)]
Merge patch series "mediatek: final preparation for OF_UPSTREAM support"
Christian Marangi <ansuelsmth@gmail.com> says:
This is the last batch of part to push actual support of
OF_UPSTREAM for the mediatek SoC.
The plan is to make the current downstream DTS on part with
upstream implementation so we can permit a gradual transition to
it while we don't cause any regression to any user.
This is to have the same node downstream and upstream.
Mediatek is working hard upstream to also push all the remaining
nodes.
All patch are the final changes after the pinctrl patch
merged previously.
All patch pass CI tests
Link: https://github.com/u-boot/u-boot/pull/731
Link: https://lore.kernel.org/r/20250127134046.26345-1-ansuelsmth@gmail.com
Christian Marangi [Mon, 27 Jan 2025 13:40:45 +0000 (14:40 +0100)]
arm: dts: mediatek: add PCIe node for MT7981
Add PCIe node for MT7981 with all the required properties to make PCIe
work.
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
Reviewed-by: Weijie Gao <weijie.gao@mediatek.com>
Tested-by: Weijie Gao <weijie.gao@mediatek.com>
John Crispin [Mon, 27 Jan 2025 13:40:44 +0000 (14:40 +0100)]
arm: dts: mediatek: add USB nodes for MT7981
Add USB PHY nodes for MT7981. These are needed for USB support and also
for PCIe support as the u3 PHY can also be used for PHY.
Signed-off-by: John Crispin <john@phrozen.org>
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
Reviewed-by: Weijie Gao <weijie.gao@mediatek.com>
Tested-by: Weijie Gao <weijie.gao@mediatek.com>
Christian Marangi [Mon, 27 Jan 2025 13:40:43 +0000 (14:40 +0100)]
mediatek: mt7981: move gpio-controller up and rename pinctrl to pio
Move gpio-controller up to pinctrl node and rename label to "pio" to
match the label used in upstream kernel linux.
Update any DTS that reference the pinctrl to follow the new naming and
structure.
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
Reviewed-by: Weijie Gao <weijie.gao@mediatek.com>
Tested-by: Weijie Gao <weijie.gao@mediatek.com>
Christian Marangi [Mon, 27 Jan 2025 13:40:42 +0000 (14:40 +0100)]
mediatek: mt7988: move gpio-controller up and rename pinctrl to pio
Move gpio-controller up to pinctrl node and rename label to "pio" to
match the label used in upstream kernel linux.
Update any DTS that reference the pinctrl to follow the new naming and
structure.
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
Reviewed-by: Weijie Gao <weijie.gao@mediatek.com>
Tested-by: Weijie Gao <weijie.gao@mediatek.com>
Christian Marangi [Mon, 27 Jan 2025 13:40:41 +0000 (14:40 +0100)]
pinctrl: mediatek: mt7988: rename reg-names to upstream linux format
Rename reg-names to upstream linux format. Upstream linux drop the
"_base". To make use of upstream DTSI, align to the upstream naming.
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
Reviewed-by: Weijie Gao <weijie.gao@mediatek.com>
Tested-by: Weijie Gao <weijie.gao@mediatek.com>
Christian Marangi [Mon, 27 Jan 2025 13:40:40 +0000 (14:40 +0100)]
mediatek: mt7986: move gpio-controller up and rename pinctrl to pio
Move gpio-controller up to pinctrl node and rename label to "pio" to
match the label used in upstream kernel linux.
Update any DTS that reference the pinctrl to follow the new naming and
structure.
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
Reviewed-by: Weijie Gao <weijie.gao@mediatek.com>
Tested-by: Weijie Gao <weijie.gao@mediatek.com>
Christian Marangi [Mon, 27 Jan 2025 13:40:39 +0000 (14:40 +0100)]
pinctrl: mediatek: mt7986: rename reg-names to upstream linux format
Rename reg-names to upstream linux format. Upstream linux drop the
"_base". To make use of upstream DTSI, align to the upstream naming.
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
Reviewed-by: Weijie Gao <weijie.gao@mediatek.com>
Tested-by: Weijie Gao <weijie.gao@mediatek.com>
Christian Marangi [Mon, 27 Jan 2025 13:40:38 +0000 (14:40 +0100)]
pinctrl: mediatek: mt7981: rename reg-names to upstream linux format
Rename reg-names to upstream linux format. Upstream linux drop the
"_base". To make use of upstream DTSI, align to the upstream naming.
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
Reviewed-by: Weijie Gao <weijie.gao@mediatek.com>
Tested-by: Weijie Gao <weijie.gao@mediatek.com>
Tom Rini [Mon, 3 Feb 2025 22:01:44 +0000 (16:01 -0600)]
Merge patch series "vbe: Series part G"
Simon Glass <sjg@chromium.org> says:
This includes the VBE ABrec (A/B/recovery) implementation as well as a
number of patches needed to make it work:
- marking some code as used by SPL_RELOC
- selection of images from a FIT based on the boot phase
- removal of unwanted hash code which increases code-size too much
- a few Kconfig-related additions for VPL
Note: The goal for the next series (part H) is to enable VBE on
rk3399-generic, i.e. able to boot on multiple rk3399-based boards with
only the TPL phase being different for each board.
Link: https://lore.kernel.org/r/20250126184333.4058848-1-sjg@chromium.org/
Simon Glass [Sun, 26 Jan 2025 18:43:29 +0000 (11:43 -0700)]
vbe: Add an implementation of VBE-ABrec
So far only VBE-simple is implemented in U-Boot. This supports a single
image which can be updated in situ.
It is often necessary to support two images (A and B) so that the board
is not bricked if the update is interrupted or is bad.
In some cases, a non-updatable recovery image is desirable, so that the
board can be returned to a known-good state in the event of a serious
failure.
Introduce ABrec which provides these features. It supports three
independent images and the logic to select the desired one on boot.
While we are here, fix a debug message to indicate the function it
called. Provide a maintainers entry for VBE.
Note that fwupdated only supports VBE-simple so far, but supports for
ABrec will appear in time.
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Sun, 26 Jan 2025 18:43:28 +0000 (11:43 -0700)]
vbe: Allow VBE to disable adding loadables to the FDT
When VBE operates within VPL it does not want the FDT to be changed.
Provide a way to disable this feature.
Move the FIT_IMAGE_TINY condition out of spl_fit_record_loadable() so
that both conditions are together. This makes the code easier to
understand.
Replace the existing fit_loaded member, which is no-longer used.
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Sun, 26 Jan 2025 18:43:27 +0000 (11:43 -0700)]
vbe: Tidy up a few comments
Join the comment block for the fit_image_load() call back to where it
should be. Also fix a debug statement.
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Sun, 26 Jan 2025 18:43:26 +0000 (11:43 -0700)]
vbe: Provide VPL binman-symbols for the next phase
Add support for moving from TPL->VPL->SPL so that the VPL build can fit
properly into the boot flow.
Use #ifdefs to avoid creating unwanted symbols which Binman would then
try (and perhaps fail) to provide.
Add debugging to indicate the next phase.
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Sun, 26 Jan 2025 18:43:25 +0000 (11:43 -0700)]
vbe: Support providing a linker script
Allow a linker script to be provided for VPL as it is for other U-Boot
phases.
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Sun, 26 Jan 2025 18:43:24 +0000 (11:43 -0700)]
lib: Mark gunzip as relocation code
Mark the gunzip code as needed by relocation. This is used to decompress
the next-phase image.
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Sun, 26 Jan 2025 18:43:23 +0000 (11:43 -0700)]
lib: Mark memcpy() and memmove() as relocation code
Mark these functions as needed by relocation. These functions are used
to copy data while relocating the next-phase image.
Drop the 'safe' versions from SPL as they are not needed. Change the
static array to a local one, to avoid link errors when trying to access
the data.
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Sun, 26 Jan 2025 18:43:22 +0000 (11:43 -0700)]
lib: Mark lz4 as relocation code
Mark the lz4 decompression code as needed by relocation. This is used to
decompress the next-phase image.
Drop the 'safe' versions from SPL as they are not needed. Change the
static array to a local one, to avoid a crash errors when trying to
access the data from relocated code. Make this conditional to avoid a
code-size increase when SPL_RELOC is not used/
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Sun, 26 Jan 2025 18:43:21 +0000 (11:43 -0700)]
lib: Mark crc8 as relocation code
Mark the crc8 code as needed by relocation. This is used as a simple
check against corruption of the code when copying.
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Sun, 26 Jan 2025 18:43:20 +0000 (11:43 -0700)]
spl: Provide a way to mark code needed for relocation
Add a linker symbol which can be used to mark relocation code, so it can
be collected by the linker and copied into a suitable place and executed
when needed.
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Sun, 26 Jan 2025 18:43:19 +0000 (11:43 -0700)]
spl: Allow spl_load() to be controlled in any xPL phase
Some phases may wish to use full FIT-loading and others not, so allow
this to be controlled.
Add some debugging while we are here.
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Sun, 26 Jan 2025 18:43:18 +0000 (11:43 -0700)]
vbe: Support selecting images based on phase in FIT
With SPL we want to specify the phase of the image to be loaded. Add
support for this.
This is the implementation of a FIT feature added to the spec a few
years ago and entails a small code-size increase, about 70 bytes on
Thumb2.
Signed-off-by: Simon Glass <sjg@chromium.org>
Link: https://docs.u-boot.org/en/latest/usage/fit/index.html
Simon Glass [Sun, 26 Jan 2025 18:43:17 +0000 (11:43 -0700)]
spl: Support selecting images based on phase in simple FIT
At present the simple FIT-loader always loads images, ignoring whether
they are intended for the next phase or not.
VBE packages up several images in the same FIT, some destined for VPL
and some for SPL. Add logic to check the phase before loading the
image. Return -EPERM in that case and handle it gracefully.
Fix a unnecessary re-computation of read_offset while here.
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Sun, 26 Jan 2025 18:43:16 +0000 (11:43 -0700)]
spl: Avoid including hash algorithms which are not wanted
Update the build rule so that hash algorithms are only included in an
SPL build if they are requested. This helps to reduce code size.
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
Simon Glass [Sun, 26 Jan 2025 18:43:15 +0000 (11:43 -0700)]
spl: Adjust debugging and xPL symbols
The size of some malloc() fields has reduced on 64-bit machines, but
the spl_reloc code was not updated. Fix this to avoid a compiler
warning.
Also update for the new xPL naming.
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
Simon Glass [Sun, 26 Jan 2025 18:43:14 +0000 (11:43 -0700)]
lib: Allow crc16 code to be dropped
This code is not necessarily needed in VPL, even if SPL uses it, so
adjust the rules to allow it to be dropped.
Do the same for the hash API.
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
Simon Glass [Sun, 26 Jan 2025 18:43:13 +0000 (11:43 -0700)]
mmc: Allow controlling DM_MMC for VPL builds
VPL may want to use driver model for MMC even if TPL does not. Update
the rule in this driver to support that.
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
Simon Glass [Sun, 26 Jan 2025 18:43:12 +0000 (11:43 -0700)]
sandbox: Update sandbox_vpl to select sha1 and sha256
These algorithms are used in VPL, so enable them.
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Sun, 26 Jan 2025 18:43:11 +0000 (11:43 -0700)]
mbedtls: Add SHA symbols for VPL
Add some symbols for supporting SHA1 etc. for VPL.
Signed-off-by: Simon Glass <sjg@chromium.org>
Tom Rini [Mon, 3 Feb 2025 14:24:49 +0000 (08:24 -0600)]
Merge branch 'master' of https://source.denx.de/u-boot/custodians/u-boot-riscv
CI: https://source.denx.de/u-boot/custodians/u-boot-riscv/-/pipelines/24428
- RISC-V: Add some fixes
- RISC-V: Integrate OP-TEE into the RISC-V boot flow
- RISC-V: Unify implementation of cleanup_before_linux() for RISC-V
ports
- RISC-V: cmd: Add bhyve SBI implementation ID
- Board: K1: Probe dram size during boot phase
Yao Zi [Thu, 23 Jan 2025 09:11:35 +0000 (09:11 +0000)]
riscv: cpu: jh7110: fallback to generic cleanup_before_linux()
JH7110 SoC requires no specific handling before entering Linux kernel.
Let's drop the specific implementation to avoid duplication.
Signed-off-by: Yao Zi <ziyao@disroot.org>
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
Yao Zi [Thu, 23 Jan 2025 09:11:34 +0000 (09:11 +0000)]
riscv: cpu: generic: fallback to generic cleanup_before_linux()
The current implementation is equivalent to the fallback one, so
this shouldn't change any behaviour but cleans the code up only.
Signed-off-by: Yao Zi <ziyao@disroot.org>
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
Yao Zi [Thu, 23 Jan 2025 09:11:33 +0000 (09:11 +0000)]
riscv: add a generic implementation for cleanup_before_linux()
Most RISC-V SoCs have similar cleanup_before_linux() functions. Let's
provide a weak symbol as fallback to reduce duplicated code.
Signed-off-by: Yao Zi <ziyao@disroot.org>
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
Yu-Chien Peter Lin [Sat, 11 Jan 2025 01:55:27 +0000 (09:55 +0800)]
riscv: dts: binman.dtsi: Include OP-TEE OS image
The following diagram illustrates the boot flow for OP-TEE OS
initialization on RISC-V.
(1)-----------+
| U-Boot SPL |
+------------+
|
v
(2)-------------------------------------------------------------+
| OpenSBI (fw_dynamic.bin) |
| (4)------------------------+ |
| | optee dispatcher driver | |
+-----------------+-------^---------|-------+------------------+
M-mode | | |
---------+--[trusted domain]---+----.----+--[untrusted domain]-------
S-mode | (coldboot domain) | | |
v | | v
(3)---------------------------+ |(5)----------------------------+
| OP-TEE OS (tee.bin) | | | U-Boot (u-boot-nodtb.bin) |
+----------------------------+ | +-----------------------------+
| |
| v
|(6)----------------------------+
| | Linux |
| +-----------------------------+
This patch enables the inclusion of the OP-TEE binary within the
U-Boot ITB, allowing it to be loaded to a platform defined address
by U-Boot SPL.
Signed-off-by: Yu-Chien Peter Lin <peter.lin@sifive.com>
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
Yu-Chien Peter Lin [Sat, 11 Jan 2025 01:55:26 +0000 (09:55 +0800)]
riscv: Add CONFIG_SPL_OPTEE_LOAD_ADDR
Allow specifying load address of OP-TEE binary. It is
recommended that the specified address aligns with the
base address of an PMP-protected NAPOT region and matches
the CFG_TDDRAM_START configuration in OP-TEE.
Signed-off-by: Yu-Chien Peter Lin <peter.lin@sifive.com>
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
Heinrich Schuchardt [Fri, 24 Jan 2025 16:00:14 +0000 (17:00 +0100)]
cmd: sbi: add bhyve SBI implementation ID
Bhyve is the hypervisor used by FreeBSD.
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
Heinrich Schuchardt [Thu, 23 Jan 2025 02:21:40 +0000 (03:21 +0100)]
riscv: AVAILABLE_HARTS is not compatible with XIP
If CONFIG_AVAILABLE_HARTS=y, variable available_harts_lock is created in
the data section which will not be writable while executing from flash.
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
Huan Zhou [Mon, 20 Jan 2025 04:29:20 +0000 (12:29 +0800)]
riscv: spacemit: k1: probe dram size during boot phase.
Implement functionality to probe and calculate the DRAM size
during the boot phase for the RISC-V spacemit K1 platform.
Tested-by: Marcel Ziswiler <marcel@ziswiler.com> # BPI-F3 16G
Signed-off-by: Huan Zhou <me@per1cycle.org>
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
Hal Feng [Thu, 16 Jan 2025 03:45:34 +0000 (11:45 +0800)]
pinctrl: starfive: Correct driver declaration for starfive_gpio
Use the driver macros so that the driver appears in the
linker list.
Reported-by: Simon Glass <sjg@chromium.org>
Fixes:
732f01aabf53 ("pinctrl: starfive: Add StarFive JH7110 driver")
Signed-off-by: Hal Feng <hal.feng@starfivetech.com>
Reviewed-by: Anand Moon <linux.amoon@gmail.com>