]> git.baikalelectronics.ru Git - uboot.git/log
uboot.git
21 months agotools: kwboot: Fix sending very small images
Pali Rohár [Thu, 23 Mar 2023 19:57:54 +0000 (20:57 +0100)]
tools: kwboot: Fix sending very small images

Sending of very small images (smaller than 128 bytes = xmodem block size)
cause out-of-bound memory read access. Fix this issue by ensuring that
hdrsz when sending image is not larger than total size of the image.
Issue was introduced in commit 20a6585838ca ("tools: kwboot: Fix sending
Kirkwood v0 images"). Special case when total image is smaller than header
size aligned to multiply of xmodem size is already handled since that
commit.

Fixes: 20a6585838ca ("tools: kwboot: Fix sending Kirkwood v0 images")
Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Stefan Roese <sr@denx.de>
21 months agotools: kwboot: Fix inserting UART data checksum without -B option
Pali Rohár [Thu, 23 Mar 2023 19:57:53 +0000 (20:57 +0100)]
tools: kwboot: Fix inserting UART data checksum without -B option

Commit 83a1a335bc84 ("tools: kwboot: Fix parsing UART image without data
checksum") added fixup code to insert place for data checksum if UART image
does not have it. Together with option -B (change baudrate), kwboot
calculates this checksum. Without option -B, it inserts only place for
checksum but does not calculate it.

This commit fix above logic and calculate data checksum also when kwboot is
used without -B option.

Fixes: 83a1a335bc84 ("tools: kwboot: Fix parsing UART image without data checksum")
Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Stefan Roese <sr@denx.de>
21 months agotools: kwboot: Fix invalid UART kwbimage v1 headersz
Pali Rohár [Thu, 23 Mar 2023 19:57:52 +0000 (20:57 +0100)]
tools: kwboot: Fix invalid UART kwbimage v1 headersz

Ensure that UART aligned header size is always stored into kwbimage v1
header. It is needed for proper UART booting. Calculation of headersz field
was broken in commit a075a68b1344 ("tools: kwboot: Calculate real used
space in kwbimage header when calling kwboot_img_grow_hdr()") which
introduced optimization of kwboot_img_grow_hdr() function.

Fixes: a075a68b1344 ("tools: kwboot: Calculate real used space in kwbimage header when calling kwboot_img_grow_hdr()")
Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Stefan Roese <sr@denx.de>
21 months agotools: kwbimage: Fix invalid UART kwbimage v1 headersz
Pali Rohár [Thu, 23 Mar 2023 19:57:51 +0000 (20:57 +0100)]
tools: kwbimage: Fix invalid UART kwbimage v1 headersz

Armada 385 BootROM ignores low 7 bits of headersz when parsing kwbimage
header of UART type, which effectively means that headersz is rounded down
to multiply of 128 bytes. For all other image types BootROM reads and use
all bits of headersz. Therefore fill into UART type of kwbimage v1 headersz
aligned to 128 bytes.

Fixes: bb79e11f257d ("tools: kwbimage: Fill the real header size into the main header")
Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Stefan Roese <sr@denx.de>
21 months agoddr: marvell: a38x: Remove unused file seq_exec.h
Pali Rohár [Sat, 4 Mar 2023 12:26:46 +0000 (13:26 +0100)]
ddr: marvell: a38x: Remove unused file seq_exec.h

DDR code does not use seq_exec.h, so remove it.

Signed-off-by: Pali Rohár <pali@kernel.org>
21 months agoarm: kirkwood: Enable Debug UART for Zyxel NSA310S
Tony Dinh [Mon, 13 Mar 2023 03:35:51 +0000 (20:35 -0700)]
arm: kirkwood: Enable Debug UART for Zyxel NSA310S

It's useful to enable Debug UART for future DM Serial regression tests
for Kirkwood boards.

Also, see background discussion in this thread:
https://lists.denx.de/pipermail/u-boot/2023-March/512010.html

Signed-off-by: Tony Dinh <mibodhi@gmail.com>
Reviewed-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Stefan Roese <sr@denx.de>
21 months agoarm: kirkwood: Move internal registers in arch_very_early_init() function
Pali Rohár [Sat, 11 Mar 2023 10:57:01 +0000 (11:57 +0100)]
arm: kirkwood: Move internal registers in arch_very_early_init() function

Same change as was done for mvebu in commit bae797b56e7b ("arm: mvebu: Move
internal registers in arch_very_early_init() function") but for kirkwood.

Signed-off-by: Pali Rohár <pali@kernel.org>
Tested-by: Tony Dinh <mibodhi@gmail.com>
Reviewed-by: Stefan Roese <sr@denx.de>
21 months agodoc/kwboot.1: Update Armada 38x BootROM bug description
Pali Rohár [Sat, 11 Mar 2023 10:42:16 +0000 (11:42 +0100)]
doc/kwboot.1: Update Armada 38x BootROM bug description

Replace SPI-NOR by default boot source location as bug is not SPI-NOR related.

Signed-off-by: Pali Rohár <pali@kernel.org>
21 months agoarm: mvebu: Set common SPI flash default speed and mode
Tony Dinh [Fri, 3 Mar 2023 03:27:29 +0000 (19:27 -0800)]
arm: mvebu: Set common SPI flash default speed and mode

CONFIG_SF_DEFAULT_SPEED is used in SPL SPI to configure and probe the
flash device during DM SPI uclass probing process, if the
spi-max-frequency is not available in the DTB. Currently the max
frequency is not available, because of the probing mechanism in SPI
uclass has not been fully updated to DM.

The CONFIG_SF_DEFAULT_SPEED is set to 1Mhz if a board defconfig
does not specify it. This speed is too slow and result in a few
seconds delay while the u-boot image is loaded from flash. Based on a
survey of the device tree specifications for MVEBU boards, a sane default
value should be 10Mhz. The default of 10Mhz enables an almost
instantaneously loading of the u-boot image.

Note that this patch depends on this patch series (has been merged to
u-boot-marvell/next):
https://lists.denx.de/pipermail/u-boot/2023-March/511038.html

- RESEND: correct spelling of SF_DEFAULT_MODE

Signed-off-by: Tony Dinh <mibodhi@gmail.com>
Reviewed-by: Stefan Roese <sr@denx.de>
21 months agoarm: mvebu: Enable NAND flash for Thecus N2350 board
Tony Dinh [Sat, 25 Feb 2023 03:23:23 +0000 (19:23 -0800)]
arm: mvebu: Enable NAND flash for Thecus N2350 board

Enable 512MB PXA3XX NAND flash when u-boot is running.

Signed-off-by: Tony Dinh <mibodhi@gmail.com>
Acked-by: Pali Rohár
21 months agoMerge branch '2023-03-22-assorted-minor-code-cleanups' into next
Tom Rini [Thu, 23 Mar 2023 00:57:39 +0000 (20:57 -0400)]
Merge branch '2023-03-22-assorted-minor-code-cleanups' into next

- Minor code cleanups based on problems found by clang or enabling LTO.

21 months agopurism: librem5: Fix a function declaration in spl.c
Tom Rini [Thu, 9 Mar 2023 16:22:11 +0000 (11:22 -0500)]
purism: librem5: Fix a function declaration in spl.c

Here we implement usb_gadget_handle_interrupts() but did not include
<linux/usb/gadget.h> so did not have the declaration correct. Fix this
and add the missing include.

Signed-off-by: Tom Rini <trini@konsulko.com>
21 months agoexamples: Don't use LTO for hello_world
Tom Rini [Thu, 9 Mar 2023 16:22:09 +0000 (11:22 -0500)]
examples: Don't use LTO for hello_world

If we're building U-Boot with LTO, we don't want to use that for
examples as it's more work than required.

Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
21 months agospl: Add function prototype for spl_mmc_get_uboot_raw_sector
Tom Rini [Thu, 9 Mar 2023 16:22:08 +0000 (11:22 -0500)]
spl: Add function prototype for spl_mmc_get_uboot_raw_sector

We did not add a prototype for spl_mmc_get_uboot_raw_sector to
include/spl.h before, so add and document one now. Correct the incorrect
prototype in board/advantech/imx8mp_rsb3720a1/imx8mp_rsb3720a1.c and
ensure that we have spl.h where we define a non-weak
spl_mmc_get_uboot_raw_sector as well.

Signed-off-by: Tom Rini <trini@konsulko.com>
21 months agoarm: Correct cpu_reset function prototype on some platforms
Tom Rini [Thu, 9 Mar 2023 16:22:07 +0000 (11:22 -0500)]
arm: Correct cpu_reset function prototype on some platforms

Some platforms were not including <cpu_func.h> which sets the prototype
for reset_cpu, and in turn had it set wrong. Correct these cases.

Signed-off-by: Tom Rini <trini@konsulko.com>
21 months agoproftool: Remove unused variables in make_flame_tree
Tom Rini [Mon, 27 Feb 2023 22:08:38 +0000 (17:08 -0500)]
proftool: Remove unused variables in make_flame_tree

With clang-15 we now get reported that in the make_flame_tree function,
neither the missing_count nor depth variables are used, only
incremenete/decremented. Remove these.

Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
21 months agoimx8image: Remove unused cont_img_count variable
Tom Rini [Mon, 27 Feb 2023 22:08:37 +0000 (17:08 -0500)]
imx8image: Remove unused cont_img_count variable

With clang-15, it is now reported that cont_img_count is unused. This is
true as the code will increment / reset this counter, but never
functionally use it. Remove it.

Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Fabio Estevam <festevam@denx.de>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
21 months agozlib: trees.c: Fix a warning with clang-15
Tom Rini [Mon, 27 Feb 2023 22:08:36 +0000 (17:08 -0500)]
zlib: trees.c: Fix a warning with clang-15

With clang-15 we now will get warnings such as:

warning: a function declaration without a prototype is deprecated in all
versions of C [-Wstrict-prototypes]

And it is easy enough to address this warning here, even if we would
like to stay in sync more with upstream as it's a single location.

Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
21 months agolibavb: Fix a warning with clang-15
Tom Rini [Mon, 27 Feb 2023 22:08:35 +0000 (17:08 -0500)]
libavb: Fix a warning with clang-15

With clang-15 we now will get warnings such as:

warning: a function declaration without a prototype is deprecated in all
versions of C [-Wstrict-prototypes]

And it is easy enough to address this warning here, as we aren't
concerned with re-syncing with an upstream.

Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
21 months agodlmalloc: Fix a warning with clang-15
Tom Rini [Mon, 27 Feb 2023 22:08:34 +0000 (17:08 -0500)]
dlmalloc: Fix a warning with clang-15

With clang-15 we now will get warnings such as:

warning: a function declaration without a prototype is deprecated in all
versions of C [-Wstrict-prototypes]

And it is easy enough to address this warning here, as we aren't
concerned with re-syncing with an upstream.

Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
21 months agoglobal: Disable deprecated-non-prototype warning with clang
Tom Rini [Mon, 27 Feb 2023 22:08:33 +0000 (17:08 -0500)]
global: Disable deprecated-non-prototype warning with clang

We have a number of places in the code which use the following syntax:

void func(a, b, c)
    int a; /* Does a */
    something_t *b; /* Pointer to b */
    int c; /* Does c */
{
...
}

Which while not what we document as our coding style, this is also code
which we have imported from other projects, and would like to re-sync
with in the future. While the biggest example of this is the zlib code,
there are other places as well. For now, we will silence this warning.

Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
21 months agoMerge branch '2023-03-22-assorted-fixes'
Tom Rini [Wed, 22 Mar 2023 18:01:01 +0000 (14:01 -0400)]
Merge branch '2023-03-22-assorted-fixes'

- Assorted TI platform fixes, correct location of NXP boot format git
  repository, don't try and mount partitions that are too small to be
  ext4 as ext4, handle .bin files in .gitattributes, flush out panic
  messages for sure, and correct console location on Arm total_compute.

21 months agodma: ti: k3-udma: Fix channel hang on teardown
Vignesh Raghavendra [Wed, 8 Mar 2023 04:12:57 +0000 (09:42 +0530)]
dma: ti: k3-udma: Fix channel hang on teardown

Setting RX flow error handling will stall the channel until descriptors
are available to move RX data. Setting this bit causes issues when
tearing down ethernet DMA channel at the end of TFTP transfer as
unrelated network packets can cause teardown to stall indefinitely waiting
for driver to queue add more desc leading to channel hang with error
logs:
udma_stop_dev2mem TIMEOUT !
udma_stop_dev2mem: peer not stopped TIMEOUT !
udma_stop_dev2mem TIMEOUT !

Fix this by clearing rx_error_handling similar to how its done for UDMA
as part of udma_alloc_rchan_sci_req()

This fixes occasional TFTP Failures seen when downloading multiple files
one after the other on AM64/AM62 SoCs.

Fixes: 1dfb71468d59 ("dma: ti: k3-udma: Add BCDMA and PKTDMA support")
Reported-by: Nishanth Menon <nm@ti.com>
Signed-off-by: Vignesh Raghavendra <vigneshr@ti.com>
21 months agofs: ext4: check the minimal partition size to mount
Patrick Delaunay [Wed, 8 Mar 2023 08:49:54 +0000 (09:49 +0100)]
fs: ext4: check the minimal partition size to mount

No need to mount a too small partition to handle a EXT4 file system.

This patch add a test on partition size before to read the
SUPERBLOCK_SIZE buffer and avoid error latter in fs_devread() function.

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
21 months agogitattributes: Treat .bin files as binary.
Sebastian Andrzej Siewior [Fri, 10 Mar 2023 13:52:30 +0000 (14:52 +0100)]
gitattributes: Treat .bin files as binary.

Binary files, which are committed to a private fork of this repository,
will be subject to line feed substitution unless marked as binary.

Mark .bin files as binary.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
21 months agoconfigs: am62x_evm_a53_defconfig: Fix SF_DEFAULT_MODE
Nikhil M Jain [Sat, 11 Mar 2023 15:54:23 +0000 (21:24 +0530)]
configs: am62x_evm_a53_defconfig: Fix SF_DEFAULT_MODE

Setting sf default mode to 0x3 breaks sf update when we do SF read
through u-boot console.

This issue arises when we do a splash image through OSPI flash media,
to fix this set the default mode to 0x0.

Fixes: fff4e278712d ("configs: enable OSPI related configs in AM62x")
Signed-off-by: Nikhil M Jain <n-jain1@ti.com>
21 months agoarm: total_compute: Remap console logs
annsai01 [Mon, 13 Mar 2023 08:57:15 +0000 (14:27 +0530)]
arm: total_compute: Remap console logs

Remapping console logs from soc uart2 (s1 terminal)
to css non-secure (uart_ap terminal)

Signed-off-by: Annam Sai Manisha <annam.saimanisha@arm.com>
21 months agoconfigs: am62: move stack and heap to HSM RAM
Kamlesh Gurudasani [Thu, 2 Mar 2023 14:10:47 +0000 (19:40 +0530)]
configs: am62: move stack and heap to HSM RAM

On high security devices, ROM enables firewalls to protect the OCSRAM
region access during bootup. Only after TIFS has started (and had
time to disable the OCSRAM firewall region) will we have write access to
the region.

This means we will need to move the stack & heap from OCSRAM to HSM RAM
and reduce the size of BSS and the SPL to allow it to fit properly.

To protect us from overflowing our ~256k of HSM SRAM, add limits and
check during the wakeup SPL build.

Signed-off-by: Kamlesh Gurudasani <kamlesh@ti.com>
21 months agoarm: mach-k3: am62: move scratch board area to HSM RAM
Kamlesh Gurudasani [Thu, 2 Mar 2023 14:10:46 +0000 (19:40 +0530)]
arm: mach-k3: am62: move scratch board area to HSM RAM

On high security devices, ROM enables firewalls to protect the OCSRAM
region access during bootup. Only after TIFS has started (and had
time to disable the OCSRAM firewall region) will we have write access to
the region.

So, move scratch board area to HSM RAM.

Signed-off-by: Kamlesh Gurudasani <kamlesh@ti.com>
21 months agoconsole: Use flush() before panic and reset
Tony Dinh [Wed, 15 Mar 2023 00:24:26 +0000 (17:24 -0700)]
console: Use flush() before panic and reset

To make sure the panic and the reset messages will go out, console flush() should be used.
Sleep periods do not work in early u-boot phase when timer driver is not initialized yet.

Reference: https://lists.denx.de/pipermail/u-boot/2023-March/512233.html

Signed-off-by: Tony Dinh <mibodhi@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Stefan Roese <sr@denx.de>
21 months agoREADME.mpc85xx-sd-spi-boot: Suggest the NXP boot format github repo
Fabio Estevam [Fri, 13 Jan 2023 01:04:46 +0000 (22:04 -0300)]
README.mpc85xx-sd-spi-boot: Suggest the NXP boot format github repo

As explained in the text at the bottom of the page
https://source.codeaurora.org/external/qoriq/qoriq-yocto-sdk/boot-format:

"QUIC repositories on this site will not receive any updates after
March 31, 2022, and will be deleted on March 31, 2023."

Point to the NXP boot format github repo instead.

Signed-off-by: Fabio Estevam <festevam@denx.de>
Reviewed-by: Pali Rohár <pali@kernel.org>
21 months agoMerge branch '2023-03-21-assorted-CI-updates' into next
Tom Rini [Wed, 22 Mar 2023 14:35:58 +0000 (10:35 -0400)]
Merge branch '2023-03-21-assorted-CI-updates' into next

- Assorted improvements to our GitLab and Azure infrastructure.

21 months agoMerge tag 'u-boot-amlogic-20230322' of https://source.denx.de/u-boot/custodians/u...
Tom Rini [Wed, 22 Mar 2023 13:21:41 +0000 (09:21 -0400)]
Merge tag 'u-boot-amlogic-20230322' of https://source.denx.de/u-boot/custodians/u-boot-amlogic

- odroid-go-ultra: setup PMIC regulators at board init

21 months agoCI: Allow a mirror to be specified for Docker Hub
Peter Hoyes [Fri, 10 Mar 2023 09:53:03 +0000 (09:53 +0000)]
CI: Allow a mirror to be specified for Docker Hub

To conserve bandwidth and potentially avoid rate limits, allow a local
mirror of Docker Hub to be specified globally. The default value is
unchanged.

Signed-off-by: Peter Hoyes <Peter.Hoyes@arm.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
21 months agoCI: Allow job tag to be optionally set globally
Peter Hoyes [Fri, 10 Mar 2023 09:53:02 +0000 (09:53 +0000)]
CI: Allow job tag to be optionally set globally

The default behavior of Gitlab runners is to only run jobs which match
the configured tag, although there is an option to run untagged jobs
[1].

To support running the CI in more complex environments where different
types of runners may be present that support different tags, allow the
DEFAULT_TAG for all jobs in the pipeline to be set globally using an
environment variable. An empty default value is provided to retain
support for untagged runners.

[1] https://docs.gitlab.com/ee/ci/runners/configure_runners.html#use-tags-to-control-which-jobs-a-runner-can-run

Signed-off-by: Peter Hoyes <Peter.Hoyes@arm.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
21 months agoCI: gitlab: Collect pytest artifacts
Marek Vasut [Fri, 3 Mar 2023 01:22:25 +0000 (02:22 +0100)]
CI: gitlab: Collect pytest artifacts

Copy build artifacts for all test.py tests, so they show up in
artifacts storage for later inspection. The test.py tests output
in CI is basically useless, but it is far more useful in the html
output for analysis and debugging.

Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
Suggested-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
21 months agoAzure CI: Be explicit about pytest cache directory
Tom Rini [Tue, 28 Feb 2023 20:28:49 +0000 (15:28 -0500)]
Azure CI: Be explicit about pytest cache directory

The default pytest cache directory is in a read-only directory in Azure,
which results in a warning on the build page. Use the pytest command
line option to set the cache dir to somewhere writable.

Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
21 months agoAzure CI: Save pytest output automatically
Tom Rini [Tue, 28 Feb 2023 20:28:48 +0000 (15:28 -0500)]
Azure CI: Save pytest output automatically

Enable use of the python-azurepipelines package which provides automatic
formatting and uploading of the pytest output.

Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
21 months agoDockerfile: Update to latest "Jammy" tag
Tom Rini [Tue, 21 Mar 2023 19:31:19 +0000 (15:31 -0400)]
Dockerfile: Update to latest "Jammy" tag

Update to using the latest "Jammy" tag as our base.

Signed-off-by: Tom Rini <trini@konsulko.com>
21 months agoDockerfile: Add m68k-softmmu to qemu
Tom Rini [Tue, 21 Mar 2023 19:28:00 +0000 (15:28 -0400)]
Dockerfile: Add m68k-softmmu to qemu

Given efforts to add an m68k target to CI, build qemu for it.

Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
21 months agoMerge branch 'master' of https://source.denx.de/u-boot/custodians/u-boot-sh
Tom Rini [Tue, 21 Mar 2023 15:52:55 +0000 (11:52 -0400)]
Merge branch 'master' of https://source.denx.de/u-boot/custodians/u-boot-sh

A single reset controller driver (part of the clock driver) fix
for v2023.04 release.

22 months agoMerge tag 'u-boot-rockchip-20230319' of https://source.denx.de/u-boot/custodians...
Tom Rini [Mon, 20 Mar 2023 21:52:42 +0000 (17:52 -0400)]
Merge tag 'u-boot-rockchip-20230319' of https://source.denx.de/u-boot/custodians/u-boot-rockchip

- Fix for rockchip timer driver;
- Fix for rk3568 and rk3588 boot device and clock driver;
- Fix for rk3568 reset handler;
- Fix for rk3568 sdhci DLL at 52MHz;

22 months agoMerge branch 'next' of https://source.denx.de/u-boot/custodians/u-boot-sh into next
Tom Rini [Mon, 20 Mar 2023 21:51:10 +0000 (17:51 -0400)]
Merge branch 'next' of https://source.denx.de/u-boot/custodians/u-boot-sh into next

22 months agoMerge branch '2023-03-17-improve-read-command-add-write-command' into next
Tom Rini [Mon, 20 Mar 2023 20:31:52 +0000 (16:31 -0400)]
Merge branch '2023-03-17-improve-read-command-add-write-command' into next

To quote the author:
The first patch simplies do_read somewhat by making use of an existing
helper instead of parsing the dev_part string manually. As a bonus
(and my actual motivation), it now understands dev#partname syntax -
hard-coded partition numbers are so last decade.

I also need the symmetrical operation, being able to write to a named
raw partition, and fortunately it doesn't require that many lines of
code to implement that.

There's a very minor change in the error reporting due to using
cmdtp->name to generate the new messages, but I don't think "Error
reading blocks" offers much that "read error" doesn't.

New in v2: the last three patches add documentation, ensure CMD_WRITE
is set for sandbox and adds some basic test cases for the various ways
of accessing the partitions (by number, name, or as raw offset within
the whole disk).

v3: Add Simon's R-b to patches 2, 4, 5, fixup whitespace in patch 5.

I don't want to duplicate the documentation, but I can see the value
in 'write' having its own entry in the TOC, so I added a stub
write.rst that just refers to the read.rst, which then explicitly
documents both.

22 months agoclk: renesas: Pack reset identifier before look up
Marek Vasut [Sat, 18 Mar 2023 11:30:53 +0000 (12:30 +0100)]
clk: renesas: Pack reset identifier before look up

The reset identifier must be processed via MOD_CLK_PACK() before it is
used to look up register and bit within reset_regs or reset_clear_regs
arrays, otherwise completely bogus register and bit is picked from the
arrays, one which may even be out of range.

Fixes: 97c9d810b50 ("clk: renesas: Add and enable CPG reset driver")
Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
22 months agoarm: dts: rockchip: rk3188-radxarock-u-boot: remove timer compatible replacement
Johan Jonker [Tue, 7 Mar 2023 15:32:00 +0000 (16:32 +0100)]
arm: dts: rockchip: rk3188-radxarock-u-boot: remove timer compatible replacement

The Rockchip timer driver has been renamed after the fall back compatible.
There's no need to replace the timer compatible in rk3188-radxarock-u-boot.dtsi
anymore, so remove.

Signed-off-by: Johan Jonker <jbx6244@gmail.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
22 months agorockchip: timer: rockchip_timer: fix compatible and driver name
Johan Jonker [Tue, 7 Mar 2023 15:30:58 +0000 (16:30 +0100)]
rockchip: timer: rockchip_timer: fix compatible and driver name

In the binding for the Rockchip timer the compatible string
consists of a SoC orientated string and a fall back string
"rockchip,rk3288-timer", so remove all unneeded ones and
fix driver name.

Signed-off-by: Johan Jonker <jbx6244@gmail.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
22 months agorockchip: sdhci: rk3568: bypass DLL when clk <= 52 MHz
Vasily Khoruzhick [Thu, 9 Mar 2023 01:28:30 +0000 (17:28 -0800)]
rockchip: sdhci: rk3568: bypass DLL when clk <= 52 MHz

For Rockchip platform, DLL bypass bit and start bit need to be set if
DLL is not locked.

With this change applied eMMC in my NanoPi R5S can run at 52 MHz.

Based on linux commit b75a52b0dda3 ("mmc: sdhci-of-dwcmshc: Update DLL
and pre-change delay for rockchip platform")

Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
22 months agoRevert "arm64: dts: rk356x-u-boot: Drop combphy1 assigned-clocks/rates"
Vasily Khoruzhick [Tue, 7 Mar 2023 22:08:27 +0000 (14:08 -0800)]
Revert "arm64: dts: rk356x-u-boot: Drop combphy1 assigned-clocks/rates"

This reverts commit 5bec4b0de7851a254fb4447b3599a60f95550141.

Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
22 months agoclk: rockchip: rk3568: add stubs for CLK_PCIEPHY_REF clocks
Vasily Khoruzhick [Wed, 8 Mar 2023 05:16:10 +0000 (21:16 -0800)]
clk: rockchip: rk3568: add stubs for CLK_PCIEPHY_REF clocks

Device tree contains assigned-clock-rates property for these,
but default value will work just fine

Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com>
22 months agorockchip: include: configs: Remove unused SDRAM_BANK_SIZE
Jonas Karlman [Tue, 14 Mar 2023 00:38:37 +0000 (00:38 +0000)]
rockchip: include: configs: Remove unused SDRAM_BANK_SIZE

Remove unused SDRAM_BANK_SIZE define.

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
22 months agorockchip: include: configs: Remove dangling comments
Jonas Karlman [Tue, 14 Mar 2023 00:38:34 +0000 (00:38 +0000)]
rockchip: include: configs: Remove dangling comments

This removes dangling comments that no longer serve a purpose and has
been left after conversion of defines to Kconfig option.

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
22 months agommc: rockchip_dw_mmc: Fix get_mmc_clk return value
Jonas Karlman [Tue, 14 Mar 2023 00:38:32 +0000 (00:38 +0000)]
mmc: rockchip_dw_mmc: Fix get_mmc_clk return value

The get_mmc_clk ops is expected to set a clock rate and return the
configured rate as an unsigned value. However, if clk_set_rate fails,
e.g. using a fixed rate clock, a negative error value is returned.

The mmc core will treat this as a valid unsigned rate and tries to
configure a divider based on this bogus clock rate.

Use 0 as the return value when setting clock rate fails, the mmc core
will configure to use bypass mode instead of using a bogus divider.

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
22 months agorockchip: tinker-rk3288: Use common BOOT_TARGET_DEVICES
Jonas Karlman [Tue, 14 Mar 2023 00:38:31 +0000 (00:38 +0000)]
rockchip: tinker-rk3288: Use common BOOT_TARGET_DEVICES

Building U-Boot for Tinker Board with USB or NET Kconfig option disabled
result in the following build error:

  In file included from include/configs/rk3288_common.h:29,
                   from include/configs/tinker_rk3288.h:14,
                   from include/config.h:3,
                   from include/common.h:16,
                   from env/common.c:10:
  include/config_distro_bootcmd.h:302:9: error: expected '}' before 'BOOT_TARGET_DEVICES_references_USB_without_CONFIG_CMD_USB'
    302 |         BOOT_TARGET_DEVICES_references_USB_without_CONFIG_CMD_USB
        |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  include/config_distro_bootcmd.h:302:9: note: in definition of macro 'BOOTENV_DEV_NAME_USB'
    302 |         BOOT_TARGET_DEVICES_references_USB_without_CONFIG_CMD_USB
        |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  include/configs/tinker_rk3288.h:21:9: note: in expansion of macro 'BOOTENV_DEV_NAME'
     21 |         func(USB, usb, 0) \
        |         ^~~~
  include/config_distro_bootcmd.h:454:25: note: in expansion of macro 'BOOT_TARGET_DEVICES'
    454 |         "boot_targets=" BOOT_TARGET_DEVICES(BOOTENV_DEV_NAME) "\0"
        |                         ^~~~~~~~~~~~~~~~~~~
  include/config_distro_bootcmd.h:474:9: note: in expansion of macro 'BOOTENV_BOOT_TARGETS'
    474 |         BOOTENV_BOOT_TARGETS \
        |         ^~~~~~~~~~~~~~~~~~~~
  include/configs/rk3288_common.h:40:9: note: in expansion of macro 'BOOTENV'
     40 |         BOOTENV
        |         ^~~~~~~
  include/env_default.h:122:9: note: in expansion of macro 'CFG_EXTRA_ENV_SETTINGS'
    122 |         CFG_EXTRA_ENV_SETTINGS
        |         ^~~~~~~~~~~~~~~~~~~~~~
  In file included from env/common.c:32:
  include/env_default.h:29:36: note: to match this '{'
     29 | const char default_environment[] = {
        |                                    ^
  make[2]: *** [scripts/Makefile.build:256: env/common.o] Error 1

The BOOT_TARGET_DEVICES defined in rockchip-common.h include the same
devices as defined in tinker_rk3288.h, remove the board specific one to
fix building with USB or NET option disabled.

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
22 months agorockchip: rk3588: Add boot device detection
Jonas Karlman [Tue, 14 Mar 2023 00:38:30 +0000 (00:38 +0000)]
rockchip: rk3588: Add boot device detection

Enable SPL on RK3588 to detect which device it was booted from.
Fixes use of same-as-spl in u-boot,spl-boot-order prop.

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
22 months agoclk: rockchip: rk3588: Fix clk_aux16m in clock driver
Jonas Karlman [Tue, 14 Mar 2023 00:38:27 +0000 (00:38 +0000)]
clk: rockchip: rk3588: Fix clk_aux16m in clock driver

The rate and error value is not returned for aux16m clocks, fix this.

Fixes: 9101bccc6bee ("clk: rockchip: Add rk3588 clk support")
Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
22 months agoclk: rockchip: rk3568: Fix reset handler
Peter Geis [Tue, 14 Mar 2023 00:38:26 +0000 (00:38 +0000)]
clk: rockchip: rk3568: Fix reset handler

The reset handler for rk3568 is missing its private data. This leads to
an abort when a reset is triggered.

  => reset
  resetting ...
  "Synchronous Abort" handler, esr 0x96000045
  elr: 0000000000a2bc04 lr : 0000000000a2bbd4 (reloc)
  elr: 00000000eff9bc04 lr : 00000000eff9bbd4
  x0 : 00000000fdd20000 x1 : 0000000014000001
  x2 : 000000000000fdb9 x3 : 00000000edf77e88
  x4 : 00000000edf50e78 x5 : 00000000edf77530
  x6 : 000000000000001d x7 : 00000000edf8a1d0
  x8 : 00000000ffffffd8 x9 : 0000000000000008
  x10: 000000000000000d x11: 0000000000000006
  x12: 000000000001869f x13: 0000000086c290c5
  x14: 000000009118e878 x15: 0000000000000000
  x16: 00000000eff9bbb8 x17: 0000000012f8c119
  x18: 00000000edf50dc0 x19: 0000000000000000
  x20: 0000000000000001 x21: 0000000000000000
  x22: 00000000edf85900 x23: 0000000000000001
  x24: 00000000effe8bbc x25: 0000000000000000
  x26: 00000000edf85940 x27: 0000000000000000
  x28: 0000000000000000 x29: 00000000edf3c8e0

  Code: d65f03c0 d5033fbf b9400661 529d9502 (b8216802)
  Resetting CPU ...

Add the missing dev_set_priv to the rk3568 clk driver to fix this.

Fixes: 8efd0358e439 ("rockchip: rk3568: add clock driver")
Signed-off-by: Peter Geis <pgwipeout@gmail.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
Reviewed-by: Jagan Teki <jagan@amarulasolutions.com>
Tested-by: Jagan Teki <jagan@amarulasolutions.com> # radxa-cm3
Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
22 months agorockchip: rk3568-rock-3a: Sync device tree from linux
Jonas Karlman [Tue, 14 Mar 2023 00:38:24 +0000 (00:38 +0000)]
rockchip: rk3568-rock-3a: Sync device tree from linux

Running U-Boot from eMMC on a ROCK 3 Model A result in the following:

  U-Boot SPL 2023.04-rc3 (Mar 11 2023 - 17:24:48 +0000)
  Trying to boot from MMC1
  Card did not respond to voltage select! : -110
  spl: mmc init failed with error: -95
  SPL: failed to boot from all boot devices
  ### ERROR ### Please RESET the board ###

The sdhci node is missing in board device tree, sync device tree from
linux v6.3-rc1 to fix booting from eMMC. Also disable sdmmc2 and uart1
nodes related to using a WiFi and BT module in the M2 slot.

Fixes: 7f3b3e354b3a ("arm64: dts: rockchip: rk3568: Add Radxa ROCK 3 Model A board support")
Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
22 months agorockchip: rk3568: Fix boot device detection
Jonas Karlman [Tue, 14 Mar 2023 00:38:23 +0000 (00:38 +0000)]
rockchip: rk3568: Fix boot device detection

The boot source node path for emmc is using the old sdhci name.
Replace with correct mmc name and also add same-as-spl to boot order.

Fixes: cd916751f784 ("rockchip: rk3568: add boot device detection")
Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
22 months agorockchip: Fix early use of bootph props
Jonas Karlman [Tue, 14 Mar 2023 00:38:21 +0000 (00:38 +0000)]
rockchip: Fix early use of bootph props

Running U-Boot on a ROCK 3 Model A result in the following:

  No serial driver found
  resetting ...
  no sysreset
  ### ERROR ### Please RESET the board ###

Replace bootph- props with u-boot,dm- props to fix this.

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
22 months agoserial: sh: Make indent consistent
Marek Vasut [Tue, 28 Feb 2023 21:19:30 +0000 (22:19 +0100)]
serial: sh: Make indent consistent

Make the indent of these macro elements consistent with the
rest of this table. No functional change.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
22 months agoserial: sh: Add DEBUG_UART support
Marek Vasut [Tue, 28 Feb 2023 21:17:22 +0000 (22:17 +0100)]
serial: sh: Add DEBUG_UART support

Add support for debug output very early during boot using the DEBUG_UART
mechanism. This uses a static fixed UART port configuration selected via
Kconfig options and dedicated print functions from debug_uart.h. This is
useful e.g. when debugging problems so early during boot, that not even
the DM is initialized at that point, and thus DM_SERIAL is not available
either.

This functionality is disabled by default. To activate it, define the
following Kconfig options and select SCIF type using CFG_SCI/CFG_SCIF_A/
CFG_HSCIF/<nothing for regular SCIF>:

CONFIG_DEBUG_UART=y
CONFIG_DEBUG_UART_SCIF=y
CONFIG_DEBUG_UART_BASE=0xe6540000
CONFIG_DEBUG_UART_CLOCK=24000000

The later two options define the SCIF physical base address and SCIF
input clock in Hz. Optionally, to validate DEBUG_UART works, enable
the following as well to get early serial output message by default:

CONFIG_DEBUG_UART_ANNOUNCE=y

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
22 months agoserial: sh: Rename CONFIG_SCI and CONFIG_SCIF_USE_EXT_CLK to CFG_ variants
Marek Vasut [Tue, 28 Feb 2023 21:17:21 +0000 (22:17 +0100)]
serial: sh: Rename CONFIG_SCI and CONFIG_SCIF_USE_EXT_CLK to CFG_ variants

Both CONFIG_SCI and CONFIG_SCIF_USE_EXT_CLK options do not have a
matching Kconfig entry because they are internal to the SCIF driver.
Change their prefix to CFG_, i.e. CFG_SCIF_USE_EXT_CLK and CFG_SCI,
to reflect that and avoid interferring with Kconfig symbols. Since
neither of those options are defined elsewhere, no functional change.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
22 months agopinctrl: renesas: Replace ifdeffery with IS_ENABLED()
Marek Vasut [Tue, 28 Feb 2023 06:25:52 +0000 (07:25 +0100)]
pinctrl: renesas: Replace ifdeffery with IS_ENABLED()

Switch ifdef in sh_gpio_get_value() to IS_ENABLED() macro.
The CONFIG_RCAR_GEN3 will never have SPL counterpart, so
the IS_ENABLED() macro is the right one here. No functional
change, except for improved build test coverage.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
22 months agonet: ravb: Support fixed PHY in R-Car
Mikhail Lappo [Mon, 27 Feb 2023 23:04:11 +0000 (00:04 +0100)]
net: ravb: Support fixed PHY in R-Car

Calling old U-Boot API doesn't allow to use fixed PHY.
Searching by mask is the part of new function, after
scanning FDT for a fixed PHY definition

Fixes: 53f6244f2a1 ("net: ravb: Detect PHY correctly")
Reviewed-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Signed-off-by: Mikhail Lappo <mikhail.lappo@esrlabs.com>
Signed-off-by: Hai Pham <hai.pham.ud@renesas.com>
[Hai Pham: Drop phy_connect_dev since it's called in phy_connect]
Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
[Marek: Use mask -1 instead of 0 to reinstate the search behavior
        over all PHY addresses. Add Fixes tag, sort the tag list.]

22 months agoi2c: rcar_i2c: Sort Kconfig depends list ascending
Marek Vasut [Mon, 27 Feb 2023 23:03:46 +0000 (00:03 +0100)]
i2c: rcar_i2c: Sort Kconfig depends list ascending

Sort the list of "depends" symbols in ascending order.
No functional change.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Heiko Schocher <hs@denx.de>
22 months agoi2c: rcar_iic: Sort Kconfig depends list ascending
Marek Vasut [Mon, 27 Feb 2023 23:03:45 +0000 (00:03 +0100)]
i2c: rcar_iic: Sort Kconfig depends list ascending

Sort the list of "depends" symbols in ascending order.
No functional change.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Heiko Schocher <hs@denx.de>
22 months agoclk: renesas: rcar-gen3: Replace SSCG caching with MDSEL/PE caching
Marek Vasut [Tue, 28 Feb 2023 06:25:11 +0000 (07:25 +0100)]
clk: renesas: rcar-gen3: Replace SSCG caching with MDSEL/PE caching

Do not cache the single CPG MODE register bit 12, instead cache the
entire register value, and only pick the matching bit from the cached
value when core clock of type MDSEL or PE are used. Both MDSEL and PE
clock type currently define .offset field as 12 on Gen3, which means
this code will use bit 12 on Gen3 again, however there are additional
clock on Gen4 which use different bits, and having this flexibility
in place now will be useful when adding Gen4.

No functional change.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
22 months agoARM: rmobile: Split R-Car Gen3 into separate Kconfig from common 64bit options
Marek Vasut [Tue, 28 Feb 2023 06:28:57 +0000 (07:28 +0100)]
ARM: rmobile: Split R-Car Gen3 into separate Kconfig from common 64bit options

There are multiple shared Kconfig options between R-Car Gen3 and Gen4.
Keep the common options in Kconfig.64 and move the R-Car Gen3 specific
options into separate Kconfig.rcar3 . The Kconfig.rcar3 contains SoC
and board list, which is limited to R-Car Gen3.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
22 months agoARM: rmobile: Introduce CONFIG_RCAR_64 symbol
Marek Vasut [Tue, 28 Feb 2023 06:28:56 +0000 (07:28 +0100)]
ARM: rmobile: Introduce CONFIG_RCAR_64 symbol

Introduce common Kconfig symbol for 64bit R-Car platforms and move
common configuration options into it. This is preparatory patch to
prevent duplication of Kconfig lists later on, when Gen4 is added.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
22 months agoARM: rmobile: Factor out SYS_SOC Kconfig option
Marek Vasut [Tue, 28 Feb 2023 06:28:55 +0000 (07:28 +0100)]
ARM: rmobile: Factor out SYS_SOC Kconfig option

Pull the SYS_SOC Kconfig option to avoid duplication of this option
in Kconfig.{32,64,rza1} . The default value is the same, so just set
it in one location.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
22 months agoARM: rmobile: Sort R-Car Gen3 Kconfig lists
Marek Vasut [Tue, 28 Feb 2023 06:28:54 +0000 (07:28 +0100)]
ARM: rmobile: Sort R-Car Gen3 Kconfig lists

Sort the 'imply' and 'select' lists in R-Car Gen3 Kconfig options.
No functional change.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
22 months agoARM: rmobile: Convert ifdef in rmobile_get_prr() to IS_ENABLED()
Marek Vasut [Tue, 28 Feb 2023 06:27:51 +0000 (07:27 +0100)]
ARM: rmobile: Convert ifdef in rmobile_get_prr() to IS_ENABLED()

Switch ifdef in rmobile_get_prr() to IS_ENABLED() macro.
The CONFIG_RCAR_GEN3 will never have SPL counterpart, so
the IS_ENABLED() macro is the right one here. No functional
change, except for improved build test coverage.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
22 months agoARM: renesas: falcon: Enable RWDT reset for V3U Falcon
Hai Pham [Mon, 27 Feb 2023 23:02:19 +0000 (00:02 +0100)]
ARM: renesas: falcon: Enable RWDT reset for V3U Falcon

Enable RWDT reset on Reset Controller so that it can be used as
reset trigger source for V3U Falcon.

Reviewed-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Signed-off-by: Hai Pham <hai.pham.ud@renesas.com>
Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org> # Use one current_el() in board_init
22 months agoARM: renesas: falcon: Initialize ARM generic timer and GICv3 if EL3
Hai Pham [Mon, 27 Feb 2023 23:02:18 +0000 (00:02 +0100)]
ARM: renesas: falcon: Initialize ARM generic timer and GICv3 if EL3

U-Boot executes at EL3 is required to initalize those settings.
In other cases, they will be done by prior-stage firmware instead.

This fixes crash when U-Boot is at non-secure exception level.

Reviewed-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Signed-off-by: Hai Pham <hai.pham.ud@renesas.com>
Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
22 months agoARM: renesas: Enable DTO support by default on R-Car Gen3
Marek Vasut [Mon, 27 Feb 2023 23:00:19 +0000 (00:00 +0100)]
ARM: renesas: Enable DTO support by default on R-Car Gen3

All R-Car Gen3 defconfigs present in U-Boot do enable DTO support,
enable it for all of R-Car Gen3 by default in Kconfig instead, so
that no new boards would miss this functionality.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
22 months agoARM: renesas: Demote overlap memory nodes message to debug on Gen3
Hai Pham [Mon, 27 Feb 2023 23:00:01 +0000 (00:00 +0100)]
ARM: renesas: Demote overlap memory nodes message to debug on Gen3

The R-Car DTs might contains multiple /memory@* nodes from various
sources, i.e. prior firmware, u-boot itself or the OS

The duplicates are likely to happen so the messages are not meaningful
in the default setting since we have already handled that.

Reduce the message to debug level.

Reviewed-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Signed-off-by: Hai Pham <hai.pham.ud@renesas.com>
Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
22 months agoARM: renesas: Remove defines for USB on Eagle/Condor
Hai Pham [Mon, 27 Feb 2023 22:59:32 +0000 (23:59 +0100)]
ARM: renesas: Remove defines for USB on Eagle/Condor

The Eagle board based on R-Car V3M, which does not support any USB
interfaces. The same applies for the Condor board based on R-Car V3H.

Remove the defines.

Reviewed-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Signed-off-by: Hai Pham <hai.pham.ud@renesas.com>
Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
22 months agotest: add tests of 'read' and 'write' shell commands
Rasmus Villemoes [Thu, 2 Mar 2023 08:12:25 +0000 (09:12 +0100)]
test: add tests of 'read' and 'write' shell commands

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
22 months agosandbox: enable CMD_WRITE
Rasmus Villemoes [Thu, 2 Mar 2023 08:12:24 +0000 (09:12 +0100)]
sandbox: enable CMD_WRITE

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
22 months agodoc: document read/write commands
Rasmus Villemoes [Thu, 2 Mar 2023 08:12:23 +0000 (09:12 +0100)]
doc: document read/write commands

The read and write commands are, deliberately, implemented in the same
file, so that they stay feature-compatible (e.g. if someone implements
support for "read the full partition, however large that is", that
same syntax should also work for write). In order to ensure the
documentation for both are similarly kept in sync, and to avoid
duplication, document them both in read.rst, and add a stub write.rst
referring to read.rst.

Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
Reviewed-by: Simon Glass <sjg@chromium.org>
22 months agocmd: introduce 'write' command
Rasmus Villemoes [Thu, 2 Mar 2023 08:12:22 +0000 (09:12 +0100)]
cmd: introduce 'write' command

It's almost no extra code to hook up a buddy to the 'read' command. In
fact, since the command is passed its own 'struct cmd_tbl', we can use
the exact same callback, and let it figure out for itself whether it
was invoked as "read" or "write".

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
22 months agocmd: read: use part_get_info_by_dev_and_name_or_num() instead of open-coded dev_part...
Rasmus Villemoes [Thu, 2 Mar 2023 08:12:21 +0000 (09:12 +0100)]
cmd: read: use part_get_info_by_dev_and_name_or_num() instead of open-coded dev_part parsing

Use the helper part_get_info_by_dev_and_name_or_num() for parsing a
dev[:part] string and obtaining the partition info in one go, instead
of open-coding all that.

As a bonus, this will automatically allow using the dev#partname
syntax as well, for accessing raw partitions by name.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
22 months agoMerge tag 'xilinx-for-v2023.07-rc1' of https://source.denx.de/u-boot/custodians/u...
Tom Rini [Thu, 16 Mar 2023 16:18:30 +0000 (12:18 -0400)]
Merge tag 'xilinx-for-v2023.07-rc1' of https://source.denx.de/u-boot/custodians/u-boot-microblaze into next

Xilinx changes for v2023.07-rc1

cmd:
- Print results in hex instead of dec in smc command

firmware:
- Cover missing ZYNQMP_FIRMWARE dependencies

fpga:
- fix loads for unencrypted use case

relocation
- Add support for BE systems

spi:
- Fix xilinx_spi init reset sequence

arasan nand:
- Remove hardcoded bbt option
- Set ofnode value

xilinx:
- Enable SMC command
- Fix some sparse issues

zynqmp:
- Remove cdns,zynq-gem compatible string
- Add optee node
- Some DT cleanups

zynq:
- Some DT cleanups

microblaze
- Remove MANUAL_RELOC option

22 months agoMerge tag 'fsl-qoriq-next-2023-3-14' of https://source.denx.de/u-boot/custodians...
Tom Rini [Thu, 16 Mar 2023 16:17:48 +0000 (12:17 -0400)]
Merge tag 'fsl-qoriq-next-2023-3-14' of https://source.denx.de/u-boot/custodians/u-boot-fsl-qoriq into next

Enable DM_SERIAL for freescale ls2080a
Drop non DM_ETH code for freescale:
  lx2160a/ls2080rdb/ls2080aqds/ls1088a

22 months agoRevert 78baeeaee165 ("video: Remove duplicate cursor-positioning function")
Tom Rini [Wed, 15 Mar 2023 15:58:58 +0000 (11:58 -0400)]
Revert 78baeeaee165 ("video: Remove duplicate cursor-positioning function")

This reverts commit 78baeeaee165bcf26965bda8e0ee1ccdef143404.

The changes here aren't quite right, and on platforms such as Raspberry
Pi where we can have both serial and video output, the change above
causes output to change. This can be seen as the hush tests we have now
fail.

Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
22 months agoMerge tag 'dm-next-12mar23a' of git://git.denx.de/u-boot-dm into next
Tom Rini [Thu, 16 Mar 2023 16:16:14 +0000 (12:16 -0400)]
Merge tag 'dm-next-12mar23a' of git://git.denx.de/u-boot-dm into next

More tests and fixes for fdt command
binman signing feature
fix buildman -A bug introduced recently

Signed-off-by: Tom Rini <trini@konsulko.com>
22 months agoMerge branch 'master' of https://source.denx.de/u-boot/custodians/u-boot-coldfire
Tom Rini [Wed, 15 Mar 2023 16:03:17 +0000 (12:03 -0400)]
Merge branch 'master' of https://source.denx.de/u-boot/custodians/u-boot-coldfire

22 months agoMerge branch 'master' of https://source.denx.de/u-boot/custodians/u-boot-sunxi
Tom Rini [Wed, 15 Mar 2023 16:01:55 +0000 (12:01 -0400)]
Merge branch 'master' of https://source.denx.de/u-boot/custodians/u-boot-sunxi

Per Andre:

[T]hese two patches containing just devicetree updates for
Allwinner boards.
I was still hoping for a review, since we cannot import the files from
the Linux tree verbatim, but managed to write some filter script that
convinced me that the changes are fine.
The files are from Linux v6.2-rc2, but are identical to the v6.2
release.

22 months agoboard: m5253demo: remove floating point flash size calculation
Angelo Dureghello [Tue, 14 Mar 2023 23:43:07 +0000 (00:43 +0100)]
board: m5253demo: remove floating point flash size calculation

This board is using floating point arithmetic to display
the SST39VF6401B flash size.

This actually generates errors with toolchains without
appropriate sw fp math functions available.

SST39VF6401B is the only flash for wich the size is displayed,
it's size is 8192KB and floating point calculation seems not
needed. Removing it.

Signed-off-by: Angelo Dureghello <angelo@kernel-space.org>
22 months agom68k: add private libgcc ashrdi3
Angelo Dureghello [Tue, 14 Mar 2023 09:06:58 +0000 (10:06 +0100)]
m68k: add private libgcc ashrdi3

Add ashrdi3.c to private libgcc.

Signed-off-by: Angelo Dureghello <angelo@kernel-space.org>
22 months agoboard: amcore: fix config options namespace
Angelo Dureghello [Sat, 25 Feb 2023 23:16:39 +0000 (00:16 +0100)]
board: amcore: fix config options namespace

Remove CONFIG_ namespace options from .h, moving them to
defconfig, while changing non-defconfig options to CFG_ namespace.

Signed-off-by: Angelo Durgehello <angelo@kernel-space.org>
22 months agom68k: rename CONFIG_MCFTMR to CFG_MCFTMR
Angelo Dureghello [Sat, 25 Feb 2023 22:25:26 +0000 (23:25 +0100)]
m68k: rename CONFIG_MCFTMR to CFG_MCFTMR

This is not a Kconfig option so changing to _CFG.

Signed-off-by: Angelo Durgehello <angelo@kernel-space.org>
22 months agom68k: dts: stmark2: set correct compatible field for spi nor
Angelo Dureghello [Wed, 15 Feb 2023 22:54:18 +0000 (23:54 +0100)]
m68k: dts: stmark2: set correct compatible field for spi nor

Fix error:

Invalid chip select 0:1 (err=-19)

update spi nor "compatible" property with "jedec,spi-nor"
to have spi nor properly bound as a child device.

Signed-off-by: Angelo Durgehello <angelo@kernel-space.org>
22 months agoarch: enable private libgcc for m68k
Angelo Dureghello [Tue, 7 Feb 2023 22:45:03 +0000 (23:45 +0100)]
arch: enable private libgcc for m68k

This patch fixes u-boot hanging on the first printf("%x", val).

Some toolchains built without multilib enabled may produce
u-boot freezing on first u64 shift operation, as in
lib/vsprintf.c number() function.
Using our private libgcc solves the issue.

Setting private libgcc enabled at architecture level to avoid
similar issues, it should not harm.

Signed-off-by: Angelo Durgehello <angelo@kernel-space.org>
22 months agoboard: stmark2: fix clock value
Angelo Dureghello [Mon, 6 Feb 2023 21:54:37 +0000 (22:54 +0100)]
board: stmark2: fix clock value

Fix totally blank console at boot, clock value must be decimal,
as for the 30Mhz external crystal.

Fixes: 37cef91cfcc7 ("stmark2: Migrate CONFIG_SYS_EXTRA_OPTIONS to Kconfig")
Signed-off-by: Angelo Dureghello <angelo@kernel-space.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
22 months agom68k: add global variable sdhc_per_clk for m68k
Angelo Dureghello [Tue, 7 Feb 2023 20:28:00 +0000 (21:28 +0100)]
m68k: add global variable sdhc_per_clk for m68k

The FSL eSDHC controller supports two reference clocks. They are
platform clock and periperhal clock. The global variable sdhc_clk
has already been used for platform clock.
ColdFire also uses eSHDC controller, as in arm and powerpc,
so adding sdhc_per_clk to arch_global_data.

Signed-off-by: Angelo Durgehello <angelo@kernel-space.org>
22 months agom68k: use longword-based jumps
Angelo Dureghello [Fri, 24 Feb 2023 00:43:19 +0000 (01:43 +0100)]
m68k: use longword-based jumps

Increasing of binary size requires longword-based jumps.

Signed-off-by: Angelo Durgehello <angelo.dureghello@timesys.com>
22 months agoboard: amcore: fix u-boot mtd partition
Angelo Dureghello [Fri, 24 Feb 2023 00:42:39 +0000 (01:42 +0100)]
board: amcore: fix u-boot mtd partition

Signed-off-by: Angelo Dureghello <angelo@kernel-space.org>
22 months agobuildman: Fix CROSS_COMPILE output for sandbox
Simon Glass [Fri, 10 Mar 2023 20:48:51 +0000 (12:48 -0800)]
buildman: Fix CROSS_COMPILE output for sandbox

The previous attempt at fixing this broke the normal usage of the -A
flag.

At present, 'buildman -A sandbox' adds the path containing the
toolchain. We can assume that this is in the path and we don't want to
set CROSS_COMPILE=/bin/

Change this to align with what MakeEnvironment() does, but only for
sandbox boards.

Signed-off-by: Simon Glass <sjg@chromium.org>