Commit Graph

97822 Commits

Author SHA1 Message Date
Jonas Karlman
3e29a44f09 rockchip: rk3308: Drop unused rk_board_init()
Nothing is calling the function rk_board_init() and the io-domain driver
can handle the functions intended purpose based on information from DT.

Cleanup by removing the unused rk_board_init() function and re-sort
included headers.

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Quentin Schulz <quentin.schulz@cherry.de>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2025-05-26 16:20:26 +01:00
Simon Glass
b32adbc29f Subtree merge tag 'v6.14-dts' of dts repo [1] into dts/upstream
[1] https://git.kernel.org/pub/scm/linux/kernel/git/devicetree/devicetree-rebasing.git
2025-05-26 16:20:25 +01:00
Simon Glass
ac456bac3a Subtree merge tag 'v6.13-dts' of dts repo [1] into dts/upstream
[1] https://git.kernel.org/pub/scm/linux/kernel/git/devicetree/devicetree-rebasing.git
2025-05-26 16:17:34 +01:00
Simon Glass
86f1513363 Merge branch 'ci' into 'master'
Merge tag 'u-boot-rockchip-20250220'

See merge request u-boot/u-boot!83
2025-05-26 11:52:54 +00:00
Jonas Karlman
b2afe05af0 arm64: dts: rockchip: Fix sdmmc access on rk3308-rock-s0 v1.1 boards
BootROM leave GPIO4_D6 configured as SDMMC_PWREN function and DW MCI
driver set PRWEN high on MMC_POWER_UP and low on MMC_POWER_OFF.
Similarly U-Boot also set PRWEN high before accessing mmc.

However, HW revision prior to v1.2 must pull GPIO4_D6 low to access
sdmmc. For HW revision v1.2 the state of GPIO4_D6 has no impact.

Model an always-on active low fixed regulator using GPIO4_D6 to fix
use of sdmmc on older HW revisions of the board.

Fixes: adeb5d2a4ba4 ("arm64: dts: rockchip: Add Radxa ROCK S0")
Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Link: https://lore.kernel.org/r/20241119230838.4137130-1-jonas@kwiboo.se
Signed-off-by: Heiko Stuebner <heiko@sntech.de>

[ upstream commit: 26c100232b09ced0857306ac9831a4fa9c9aa231 ]

(cherry picked from commit ca8e0bedbc790b19b11efc223677d178b8eeb74e)
Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
2025-05-26 11:35:41 +01:00
Jonas Karlman
ee7a6b0ea3 net: dwc_eth_qos_rockchip: Fix disable of RX/TX delay for RK3588
When rgmii-rxid/txid/id phy-mode is used the MAC should not add RX
and/or TX delay. Currently RX/TX delay is configured as enabled using
zero as delay value for the rgmii-rxid/txid/id modes.

Change to disable RX and/or TX delay and using zero as delay value.

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2025-05-26 11:35:41 +01:00
Jonas Karlman
edb4c2905b net: dwc_eth_qos_rockchip: Fix disable of RX/TX delay for RK356x
When rgmii-rxid/txid/id phy-mode is used the MAC should not add RX
and/or TX delay. Currently RX/TX delay is configured as enabled using
zero as delay value for the rgmii-rxid/txid/id modes.

Change to disable RX and/or TX delay and using zero as delay value.

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Quentin Schulz <quentin.schulz@cherry.de>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2025-05-26 11:35:40 +01:00
Jonas Karlman
2f491552e8 pinctrl: rockchip: rk3328: Fix pinmux for GPIO2-B and GPIO3-B pins
The pinmux bits for GPIO2-B0 to GPIO2-B6 actually have 2 bits width,
correct the bank flag for GPIO2-B. The pinmux bits for GPIO2-B7 is
recalculated so it remain unchanged. Add missing GPIO3-B1 to GPIO3-B7
pinmux data to rk3328_mux_recalced_data as mux register offset for these
pins does not follow rockchip convention.

This matches changes in following Linux commits:
- e8448a6c817c ("pinctrl: rockchip: fix pinmux bits for RK3328 GPIO2-B pins")
- 5ef6914e0bf5 ("pinctrl: rockchip: fix pinmux bits for RK3328 GPIO3-B pins")
- 128f71fe014f ("pinctrl: rockchip: correct RK3328 iomux width flag for GPIO2-B pins")

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2025-05-26 11:35:38 +01:00
Jonas Karlman
5b6a799795 rockchip: rk3288: Use rk3288-cru.h from dts/upstream
clock/rk3288-cru.h in include/dt-bindings is almost identical to the
version in dts/upstream, remove the copy from include/dt-bindings to
only use the version from dts/upstream.

One clk, SCLK_MAC_PLL, is not part of the upstream bindings, this clk is
not used by upstream, in-tree or vendor DTs and can safely be dropped.

No functional change to board DTs is intended with this removal.

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2025-05-26 11:35:37 +01:00
Johan Jonker
16a966b576 rockchip: use OF_UPSTREAM for rk3036
The device tree for rk3036 combined is now
available in the /dts/upstream directory.
Use imply OF_UPSTREAM to migrate all rk3036 boards.

Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
Signed-off-by: Johan Jonker <jbx6244@gmail.com>
2025-05-26 11:35:36 +01:00
Jonas Karlman
fc64abeeb3 rockchip: sdram: Ensure ram_base is correct in SPL
Most Rockchip SoCs use 0x0 as DRAM base address, however some SoCs use
0x60000000 and RK3576 use 0x40000000 as DRAM base address.

CFG_SYS_SDRAM_BASE is defined with correct address for each SoC and
U-Boot proper use this to set correct gd->ram_base in setup_dest_addr().

SPL never assign any value to gd->ram_base and instead use the default,
0x0. Set correct gd->ram_base in dram_init() to ensure its correctness
in SPL.

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2025-05-26 11:35:35 +01:00
Jonas Karlman
a62dae9c19 rockchip: sdram: Limit usable ram_top to max 4G
U-Boot only works correctly when it uses RAM below the 4G address
boundary on Rockchip SoCs. Limit usable gd->ram_top to max 4G.

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2025-05-26 11:35:35 +01:00
Jonas Karlman
ab18df4559 rockchip: sdram: Allow the first bank to extend beyond 4 GiB
Allow the first bank to extend beyond 4 GiB when the blob of space for
peripheral is located before start of DRAM, e.g. when start of DRAM
is 0x40000000 and continue beyond the 4 GiB mark.

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2025-05-26 11:35:32 +01:00
Chen-Yu Tsai
d36b1ac6d3 rockchip: rk3399: grf: Fix enum typos for UART2
In the GRF header file, some instances of UART2 pinmux are prefixed with
"GRF_UART2DBG" while others have "GRF_UART2DGB".

Since UART2 is the default console UART and used for debugging, it is
more likely the name should be UART2DBG.

Fix the ones that are wrong.

Fixes: a2c08df381 ("pinctrl: add driver for rk3399")
Fixes: fa72de1045 ("rockchip: arm64: rk3399: move grf register definitions to grf_rk3399.h")
Signed-off-by: Chen-Yu Tsai <wens@csie.org>
Reviewed-by: Quentin Schulz <quentin.schulz@cherry.de>
Reviewed-by: Paul Kocialkowski <paulk@sys-base.io>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2025-05-26 11:33:39 +01:00
Jonas Karlman
90749d0ad3 rockchip: rk3399-gru: Enable TPL_GPIO for bob and kevin
The PP1500 and PP3000 power rails must be on very early for the U-Boot
TPL banner to be shown on debug UART.

Enable TPL_GPIO Kconfig option for bob and kevin to allow use of
spl_gpio.h functions in TPL.

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2025-05-26 11:31:59 +01:00
Simon Glass
a35a30e327 rockchip: Sync defconfigs
Sync the defconfig files for bob and kevin

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-05-26 11:28:34 +01:00
Simon Glass
d949f2a196 Merge branch 'ci' into 'master'
pinctrl: starfive: Correct driver declaration for starfive_gpio

See merge request u-boot/u-boot!82
2025-05-25 18:40:36 +00:00
Hal Feng
c2953ffbd6 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: 732f01aabf ("pinctrl: starfive: Add StarFive JH7110 driver")
Signed-off-by: Hal Feng <hal.feng@starfivetech.com>
Reviewed-by: Anand Moon <linux.amoon@gmail.com>
2025-05-25 19:01:51 +01:00
Simon Glass
0581b17809 Merge branch 'ci' into 'master'
booti: Remove the SYS_BOOTM_LEN limit for booti

See merge request u-boot/u-boot!81
2025-05-25 18:01:27 +00:00
Simon Glass
869fa318fe booti: Allow using 10x the uncompressed size with booti
The booti command does not use the CONFIG_SYS_BOOTM_LEN value and
instead sets a maximum decompression-buffer size of 10x the size of the
compressed data.

Add this as an option in bootm_load_os() so that booting without the
command-line works in the same way as the 'booti' command.

Link: https://lore.kernel.org/u-boot/2ad3b1c5-b6e7-47e2-b225-834b821cc5c4@kwiboo.se/

Signed-off-by: Simon Glass <sjg@chromium.org>
Reported-by: Jonas Karlman <jonas@kwiboo.se>
Fixes: b13408021d ("boot: pxe: Use bootm_...() functions where possible")
2025-05-25 06:26:00 +01:00
Simon Glass
48cd422a9c bootm: Add RISC-V support in booti_is_supported()
RISC-V uses a similar linux 'Image' format to ARM64, so add support for
it in bootm_load_os()

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
2025-05-25 06:26:00 +01:00
Simon Glass
2c32a8da46 boot: Add a function to check if a linux Image is supported
Move this logic into a function so we can give it a sensible name.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
2025-05-25 06:26:00 +01:00
Simon Glass
e3ced530e5 Merge branch 'ci' into 'master'
tpm: cr50: Support opening the TPM multiple times

See merge request u-boot/u-boot!80
2025-05-24 13:03:36 +00:00
Simon Glass
9a8cadbfab tpm: cr50: Support opening the TPM multiple times
The tpm_auto_start() function is used in tests and assumes that it can
open the TPM even if it is already open and a locality claimed. The cr50
driver does not use the common TPM2 TIS code so lacks a check for the
is_open field of struct tpm_chip and in fact it doesn't use that struct.

Add an equivalent check to cr50_i2c_open().

This fixes all init sequences on that TPM -- e.g 'tpm init && tpm init'
or 'tpm autostart && tpm init' used to hang

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2025-05-24 14:03:09 +01:00
Simon Glass
d0905b837a Merge branch 'ci' into 'master'
expo: Improve positioning for cedit

See merge request u-boot/u-boot!79
2025-05-24 08:24:32 +00:00
Simon Glass
e27b36c015 expo: Tidy up insets and improve tests
Insets are handled inconsistently at present, since menus use them to
offset the label text, whereas textlines don't. This is done because
menus need the margin to be visible when opened. However this causes an
alignment issue when menus and textlines appear in the same cedit.

Remove the offsets from menus and compensate by adjusting the bounding
boxes used for highlighting and the opened menu.

Line up menu items and textlines vertically and add a style option for
textlines to control how much padding is added.

Add a test to check the positions of objects in a cedit, since this is
more direct than the rendering tests. Add style information so that the
impact can be seen.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-05-24 08:19:02 +01:00
Simon Glass
502aa8bc31 expo: Honour the textline edit_id when building
There is no need to create a new ID and it makes it harder for tests to
locate objects. Use the ID provided in the file, if any.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-05-24 08:19:02 +01:00
Simon Glass
44ac51e503 expo: Separate requested bbox from actual
With fixed coordinates it is difficult to create scenes that can work on
any display size. Add a separate 'requested' bounding box for each
object and sync it when required.

With future work, this will allow scaling the nominal coordinates so
that an expo can be rendered correctly on a wider range of displays.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-05-24 08:19:02 +01:00
Simon Glass
729da41a4a expo: Drop space from object name in test
Two of the objects have a space in their name. Change it to a hyphen to
match the other objects.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-05-24 08:19:02 +01:00
Simon Glass
31b92f28cc expo: Allow the menu pointer to be wider
Rather than hard-coding the distance between the labels and the key,
measure the width of the pointer to determine the space needed.

Tweak a few tests according. It isn't possible to get the same result
when the font-size differs.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-05-24 08:19:01 +01:00
Simon Glass
a9a4c58b2c expo: Use a var to arrange horizonal positions in menu
At present the components of each menu item are set at fixed positions.
Use an 'x' variable instead, so that we can eventually move to taking
account of the actual dimensions of the items.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-05-24 08:19:01 +01:00
Simon Glass
ab474b3ead expo: Simplify scene_textline dimension calculation
The goal here is to obtain the dimensions of the edit field, which does
not change.

Since scene_arrange() now handles setting the bounding-box size based on
the dimensions there is no need to do it here.

Adjust the code to simply set up the dimensions.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-05-24 08:19:01 +01:00
Simon Glass
8441847f9f expo: Check dimensions before arranging a scene
It is possible that positions, styling or even text have changed since
the scene was initially arranged, so recalculate the dimensions of all
objects before arranging the scene.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-05-24 08:19:01 +01:00
Simon Glass
a6ec4daf24 expo: Move menu dims calculations into scene_menu_arrange()
A menu's dimensions are currently only used for positioning the
component parts of the menu, i.e. the label, key, description and
preview.

Move the logic for this entirely into the scene_menu file and drop the
logic at the top level.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-05-24 08:19:01 +01:00
Simon Glass
bd5e1e62e8 expo: Provide a few functions for working with dimensions
Allow expanding dimensions using the dimensions of an object or another
dimensions struct.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-05-24 08:19:01 +01:00
Simon Glass
4795e2b4bd expo: Arrange cedit after setting dimensions
Switch the order of these two calls since dims for each object should be
figured out before moving to arranging things.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-05-24 08:19:01 +01:00
Simon Glass
d854e1a777 expo: Record the pointer position in the menu item
Rather than drawing the poointer with a hard-coded position elsewhere in
the code, add a field to hold this value.

Move the check for the pointer position up so that the ordering of the
tests matches the order that the fields are dealt with in
scene_menu_arrange()

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-05-24 08:19:01 +01:00
Simon Glass
4c27026f1f expo: Add extra checks for rendering
Check the framebuffer immediately after the first render, to make sure
it doesn't change when the scene is arranged a second time.

Check that the logic around menu-item highlight is correct.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-05-24 08:19:01 +01:00
Simon Glass
04110615e0 expo: Separate out reading the theme from applying it
Rename the existing expo_apply_theme() to expo_setup_theme() and adjust
the former so that it applies a theme which has already been read into
the struct. This will make it easier for tests to check theme
adjustments, since they won't have to put them in a node.

Add the white-on-black property into the theme struct while we are.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-05-24 08:19:01 +01:00
Simon Glass
3434950961 expo: Drop the extra parameter to scene_calc_dims()
We always call this with false first, then true. Drop the parameter and
handle this within the function itself.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-05-24 08:19:01 +01:00
Simon Glass
817db7d12d expo: Avoid arranging the scene willy nilly
Moving from one scene to another should not result in the scene being
re-arranged. Drop this, so that tests can have more control of when
scenes are arranged.

Also drop the scene_arrange() call when applying a theme, for the same
reason.

Add the now-required scene_arrange() to cedit and bootmenu

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-05-24 08:19:01 +01:00
Simon Glass
f20a1818cf expo: Create a function to arrange the current scene
Provide a convenient function which arranges the current scene in an
expo. Make use of this in bootflow_menu

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-05-24 08:19:01 +01:00
Simon Glass
e57c6e3c58 expo: Use a different logo for the second menu-item
When testing menu items it is easier to check that the correct preview
is shown if the preview images are different. Make a copy of the image
and modify the palette for the second menu item, so this is obvious.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-05-24 08:19:01 +01:00
Simon Glass
baa389273a expo: Comment scene_obj fields which are for internal use
A few fields should not be changed by the controller code. Add a comment
so this is obvious.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-05-24 08:19:01 +01:00
Simon Glass
d0792b0848 Merge branch 'ci' into 'master'
patman: Support beter management of series

See merge request u-boot/u-boot!78
2025-05-24 05:03:58 +00:00
Simon Glass
cafd1d6e7e patman: Add basic documentation for new features
Describe the new subcommands and how they should be used in a normal
workflow.

Note that the naming of branches is very rigid, or 'opinionated' in
marketing terms. Patman can track a single branch for each version of a
series and they must all be named the same, except for the
version-number suffix. Version 1 series have no suffix.

This description is fairly bare-bones but should be enough for some
initial testing and comments.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-05-24 05:26:46 +01:00
Simon Glass
c927775609 patman: Add tests for Cseries
Add various tests for the Cseries functionality, including both direct
and via-cmdline variants.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-05-24 05:26:46 +01:00
Simon Glass
351721439f patman: Implement the upstream subcommand
Add a command to allow managing the upstream tree. This is very basic
so far, only allowing setting the name and URL. Further work may allow
checking whether series apply cleaning on the upstream tree, etc.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-05-24 05:26:46 +01:00
Simon Glass
31b3b588d6 patman: Implement the series subcommand
Add a command to support management of series. These are local branches
which may have been sent to the mailing list, so may appear on the
patchwork server.

The new functionality uses a database, stored in a local file.

Various operations are supported:
   - add a new series
   - send a series and automatically link it with patchwork
   - 'increment' the version, to prepare to send an updated series
   - gather review/test tags from patchwork
   - check on progress, i.e. patches which are received new tags or
     comments
   - show comments on patches and cover letters

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-05-24 05:26:46 +01:00
Simon Glass
af99fb769d patman: Update send function to return whether it sent
Indicate whether 'git send-email' was actually called, so that we don't
bother waiting for patchwork to receive our series if it wasn't.

The 'git send-email' seems to always return a code of 0 even if nothing
was sent, so we cannot use clues there. Ideally we would watch the
output to determine which patches were sent and which not, but that is
left for another day.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-05-24 05:26:46 +01:00