1
0
mirror of https://xff.cz/git/u-boot/ synced 2025-08-31 16:22:36 +02:00
Commit Graph

94767 Commits

Author SHA1 Message Date
Ondrej Jirman
29bbe99dc1 config: pinephone-pro: Enable video out and boot menu
Also remove unused features.

Signed-off-by: Ondrej Jirman <megi@xff.cz>
2024-10-08 15:41:09 +02:00
Ondrej Jirman
ae2ac21eac config: pinebook-pro: Personal optimizations
Just personal stuff, if you don't like it, make your own build.

Signed-of-by: Ondrej Jirman <megi@xff.cz>
2024-10-08 15:41:09 +02:00
Ondrej Jirman
5f76c4d847 config: rockpro64: Personal optimizations
Just personal stuff, if you don't like it, make your own build.

Signed-of-by: Ondrej Jirman <megi@xff.cz>
2024-10-08 15:41:09 +02:00
Ondrej Jirman
7af998a66e config: pinetab2: Personal optimizations
Just personal stuff, if you don't like it, make your own build.

Signed-off-by: Ondrej Jirman <megi@xff.cz>
2024-10-08 15:41:09 +02:00
Ondrej Jirman
a26e1dca4d config: quartzpro64: Personal optimizations
Just personal stuff, if you don't like it, make your own build.

Signed-off-by: Ondrej Jirman <megi@xff.cz>
2024-10-08 15:41:09 +02:00
Ondrej Jirman
af2aa78e3e config: orange-pi-5-plus: Personal optimizations
Just personal stuff, if you don't like it, make your own build.

Signed-off-by: Ondrej Jirman <megi@xff.cz>
2024-10-08 15:41:09 +02:00
Ondrej Jirman
426e0b1e97 board: Add support for EBAZ4205
This is without the SD controller support, because I have a broken
uSD slot on my board. Until that's fixed, it needs to be disabled.

Signed-off-by: Ondrej Jirman <megi@xff.cz>
2024-10-08 15:41:09 +02:00
Ondrej Jirman
65a277af09 spl: Try loading bitstream first, before falling back to fpga_load
There's no other way to load bitstream file to Zynq 7000 via SPL
otherwise, and SPL just reports:

  zynq_validate_bitstream: Bitstream is not validated yet (diff 6c)
  spl_fit_upload_fpga: Cannot load the image to the FPGA

This is similar to code in boot/image-board.c

Signed-off-by: Ondrej Jirman <megi@xff.cz>
2024-10-08 15:41:09 +02:00
Ondrej Jirman
d579b68a85 rockchip: rk3399: DTS video output/menu support on Pinephone Pro
See comments in the DT.

Signed-off-by: Ondrej Jirman <megi@xff.cz>
2024-10-08 15:41:09 +02:00
Ondrej Jirman
f796623e63 board: pine64: Configure PMIC charger on Pinephone Pro
Charger chip needs some sane defaults.

Signed-off-by: Ondrej Jirman <megi@xff.cz>
2024-10-08 15:41:09 +02:00
Ondrej Jirman
3da1a938a3 board: pine64: Configure PMIC on Pinephone Pro for touchscreen
Touchscreen needs 3V on LDO2.

Signed-off-by: Ondrej Jirman <megi@xff.cz>
2024-10-08 15:41:09 +02:00
Ondrej Jirman
071ae8375f board: pine64: Enable DMC on Pinephone Pro
Automatically enable DMC node in the kernel when using rkbin blobs
that support DMC.

Signed-off-by: Ondrej Jirman <megi@xff.cz>
2024-10-08 15:41:09 +02:00
Ondrej Jirman
105fcca4d8 board: pine64: Enable DMC on RockPro64
Automatically enable DMC node in the kernel when using rkbin blobs
that support DMC.

Signed-off-by: Ondrej Jirman <megi@xff.cz>
2024-10-08 15:41:09 +02:00
Ondrej Jirman
292a4b9ec7 board: pine64: Enable DMC on Pinebook Pro
Automatically enable DMC node in the kernel when using rkbin blobs
that support DMC.

Signed-off-by: Ondrej Jirman <megi@xff.cz>
2024-10-08 15:41:09 +02:00
Ondrej Jirman
40677dba71 clk: rockchip: Static clock settings for VOPs on Pinephone Pro
cpll in U-Boot runs at 384 MHz, set various VOP related clocks to produce
roughly 400 and 100 MHz just like in Linux.

Signed-off-by: Ondrej Jirman <megi@xff.cz>
2024-10-08 15:41:09 +02:00
Ondrej Jirman
0087761618 clk: rockchip: Add clocks used by VOP and mipi-dsi on rk3399
These need to be handled for VOP/MIPI-DSI support.

Signed-off-by: Ondrej Jirman <megi@xff.cz>
2024-10-08 15:41:09 +02:00
Ondrej Jirman
bdb40f1567 video: rockchip: rk3399-vop: Don't enable hardcoded regulator 2024-10-08 15:41:09 +02:00
Ondrej Jirman
a259c15d4d video: rockchip: Add video bridge support to VOP driver
This is used for video output using video bridge implementation of
MIPI-DSI, like with the recently added dw_mipi_dsi_rockchip.c
driver.

The original code path when the UCLASS_DISPLAY device is found is
untouched. The video bridge branch is taken only when the
UCLASS_VIDEO_BRIDGE device is found at the remote endpoint's parent.

This was tested to work on Pinephone Pro.

Signed-off-by: Ondrej Jirman <megi@xff.cz>
Cc: Anatolij Gustschin <agust@denx.de>
Cc: Simon Glass <sjg@chromium.org>
Cc: Philipp Tomsich <philipp.tomsich@vrull.eu>
Cc: Kever Yang <kever.yang@rock-chips.com>
Cc: Chris Morgan <macromorgan@hotmail.com>
2024-10-08 15:41:09 +02:00
Ondrej Jirman
c3f80d9366 video: rockchip: dw_mipi_dsi: Proceed when external PHY is not defined
In this case the DM returns ENOENT, not ENODATA.

Signed-off-by: Ondrej Jirman <megi@xff.cz>
2024-10-08 15:41:09 +02:00
Ondrej Jirman
40aac3f818 video: rockchip: dw_mipi_dsi: Improve pixel clock calculations
Calculate burst mode overhead in one place for both internal
and external PHY use case and exit if out of range, instead
of ignoring the wrong value.

Signed-off-by: Ondrej Jirman <megi@xff.cz>
2024-10-08 15:41:09 +02:00
Ondrej Jirman
0a5fae5474 video: dw_mipi_dsi: Sync driver with Linux
Just a simple update of code from Linux driver, where this driver was
copied from originally.

Signed-off-by: Ondrej Jirman <megi@xff.cz>
2024-10-08 15:41:09 +02:00
Ondrej Jirman
0b529584d1 mtd: spi-nor: Add support for as25f1128mq
Signed-off-by: Ondrej Jirman <megi@xff.cz>
2024-10-08 15:41:09 +02:00
Ondrej Jirman
bed6ca3f56 mtd: spi-nor: Add device info for gd25lq128e
This is used on Pinephone Pro.

Signed-off-by: Ondrej Jirman <megi@xff.cz>
2024-10-08 15:41:09 +02:00
Ondrej Jirman
45334a0ff7 mtd: spi-nor: Print jedec id of unrecognized flashes
Hell to debug otherwise.

Signed-off-by: Ondrej Jirman <megi@xff.cz>
2024-10-08 15:41:09 +02:00
Ondrej Jirman
863c279a25 cmd: tmenu: Add tmenu command for touch menu user interface
Shows a menu of items that can be controlled using touch panel.
This is useful for touch based devices like tablets to select
alternative boot options (multi-boot).

Signed-off-by: Ondrej Jirman <megous@megous.com>
2024-10-08 15:41:09 +02:00
Ondrej Jirman
715fd626ee input: goodix: Add support for Goodix touchscreens
As the title says. :)

Signed-off-by: Ondrej Jirman <megi@xff.cz>
2024-10-08 15:41:09 +02:00
Ondrej Jirman
f935f98a83 input: edt-ft5x06: Add support for edt,edt-ft5x06 touchpanel controller
This is a direct port of the Linux driver from Linux v4.18.

Signed-off-by: Ondrej Jirman <megous@megous.com>
2024-10-08 15:41:09 +02:00
Ondrej Jirman
2c6e073fb3 cmd: Add 'touch' command to enumerate touchpanel devices
This command can be used to list and access devices with uclass
UCLASS_TOUCHPANEL.

Signed-off-by: Ondrej Jirman <megous@megous.com>
2024-10-08 15:41:09 +02:00
Ondrej Jirman
88e72e2d24 input: Implemented touchpanel uclass for touchpanel devices
Touchapnel devices are useful in u-boot for implementation of boot
menu user interfaces on tablets and other touch based devices.

This uclass implements start, stop and get_touches interface methods.

Signed-off-by: Ondrej Jirman <megous@megous.com>
2024-10-08 15:41:09 +02:00
Jonas Karlman
320e366321 mmc: rockchip_sdhci: Use bounce buffer in SPL to fix read performance
The commit 3b804b370d ("mmc: rockchip_sdhci: Disable DMA mode using a
device tree property") and commit 2cc6cde647 ("mmc: rockchip_sdhci:
Limit number of blocks read in a single command") implemented a
workaround to fix loading a part of TF-A into SRAM from eMMC in SPL.

This has resulted in very slow read performance of FIT from eMMC in SPL
on RK3588.

Change to make use of a bounce buffer to significantly improve the read
performance when malloc_limit is large enough and use PIO mode as fall
back.

Also update the size of align_buffer to use SDHCI_DEFAULT_BOUNDARY_SIZE
instead of a hardcoded 512 * 1024.

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Link: https://patchwork.ozlabs.org/patch/1895377/
2024-10-08 15:41:09 +02:00
Jonas Karlman
85316c807e rockchip: rk3588: Skip serial pinctrl at pre-reloc phase
UART pinctrl for serial is typically applied multiple times:
- in external TPL
- in SPL for DEBUG_UART in board_debug_uart_init()
- in SPL using pinctrl from DT
- in pre-reloc phase using pinctrl from DT
- after relocation using pinctrl from DT

Skip including UART pinctrl for the the pre-reloc phase to save time
during boot. On a Radxa ROCK 5B this reduce boot time by ~150 ms.

After this a warning may be shown with LOGLEVEL=5 (or higher), it is
safe to ignore this warning as device probe is successful even when
pinctrl cannot be applied:

  ns16550_serial serial@feb50000: pinctrl_select_state_full: uclass_get_device_by_phandle_id: err=-19

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
2024-10-08 15:41:09 +02:00
Jonas Karlman
3c7402dedb rockchip: rk356x: Skip serial pinctrl at pre-reloc phase
UART pinctrl for serial is typically applied multiple times:
- in external TPL
- in SPL for DEBUG_UART in board_debug_uart_init()
- in SPL using pinctrl from DT
- in pre-reloc phase using pinctrl from DT
- after relocation using pinctrl from DT

Skip including UART pinctrl for the the pre-reloc phase to save time
during boot. On a Radxa ZERO 3W this reduce boot time by ~120 ms.

After this a warning may be shown with LOGLEVEL=5 (or higher), it is
safe to ignore this warning as device probe is successful even when
pinctrl cannot be applied:

  ns16550_serial serial@fe660000: pinctrl_select_state_full: uclass_get_device_by_phandle_id: err=-19

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
2024-10-08 15:41:09 +02:00
Jonas Karlman
ca29538c9f rockchip: rk3308: Skip serial pinctrl at pre-reloc phase
UART pinctrl for serial is typically applied multiple times:
- in external TPL
- in SPL using pinctrl from DT
- in pre-reloc phase using pinctrl from DT
- after relocation using pinctrl from DT

Skip including UART pinctrl for the the pre-reloc phase to save time
during boot. On a Radxa ROCK Pi S this reduce boot time by ~80 ms.

After this a warning may be shown with LOGLEVEL=5 (or higher), it is
safe to ignore this warning as device probe is successful even when
pinctrl cannot be applied:

  ns16550_serial serial@ff0a0000: pinctrl_select_state_full: uclass_get_device_by_phandle_id: err=-19

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
2024-10-08 15:41:09 +02:00
Jonas Karlman
65fd8e2421 serial: ns16550: Try get serial clock rate from DT before CLK
Initializing a clock driver to read a known static clock rate can take
some time at U-Boot proper pre-reloc phase.

Change to first try and read clock rate from DT to speed up boot time,
fall back to getting the clock rate from clock driver.

This help reduce boot time by around:
- ~35ms on a Radxa ROCK Pi 4 (RK3399)
- ~15ms on a Radxa ZERO 3W (RK3566)
Time that is wasted getting a static rate known at compile time.

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
2024-10-08 15:41:09 +02:00
Jonas Karlman
bdda80d592 WIP: rockchip: rk3399-pinephone-pro: Simplify SPI flash node in u-boot dtsi 2024-10-08 15:41:09 +02:00
Peter Robinson
fb905971dc arm64: dts: rockchip: Enable SPI flash on PinePhone Pro
The PinePhone Pro as SPI flash on board so enable the SPI
interface and the flash.

Signed-off-by: Peter Robinson <pbrobinson@gmail.com>
Link: https://lore.kernel.org/r/20240623204616.1344806-1-pbrobinson@gmail.com
Signed-off-by: Heiko Stuebner <heiko@sntech.de>

[ upstream commit: c7f024956d9f35d8b305fe90fe33d7f15055ef25 ]

(cherry picked from commit 60f8d7de9cf9454ce73b7383459007a0fc29a6e9)
Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
2024-10-08 15:41:09 +02:00
Jonas Karlman
e1cbe2d316 rockchip: gpio: Add missing gpio aliases
Add aliases for gpio controllers to soc u-boot dtsi files that are
missing aliases in soc dtsi files to ensure dev_seq() return the
expected number when a gpio controller is included in SPL.

Also drop the aliases from rk3288-u-boot.dtsi, they are already part of
rk3288.dtsi.

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
2024-10-08 15:41:09 +02:00
Jonas Karlman
0b5a9ff733 rockchip: gpio: Add gpio-ranges props
Add gpio-ranges props to supported SoCs based on the following Linux
patches:

ARM: dts: rockchip: add gpio-ranges property to gpio nodes
https://lore.kernel.org/all/26007385-81dc-9961-05d5-8b9a0969d0b6@gmail.com/

arm64: dts: rockchip: add gpio-ranges property to gpio nodes
https://lore.kernel.org/all/18c8c89a-9962-40f0-814f-81e2c420c957@gmail.com/

For RK3066 and RK3288 the gpio-ranges props is adjusted to match
https://lore.kernel.org/all/541b7633-af3b-4392-ac29-7ee1f2c6f943@kwiboo.se/

Re-enable gpio6 on RK3066 now that the pinctrl pin offset is used with
get_gpio_mux().

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2024-10-08 15:41:09 +02:00
Jonas Karlman
f12bb5fd0a gpio: rockchip: Add request() ops
Add a request() ops that call pinctrl_gpio_request() when the required
gpio-ranges prop has been defined to signal pinctrl driver to use gpio
pinmux.

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
2024-10-08 15:41:09 +02:00
Jonas Karlman
412b9cd5ee gpio: rockchip: Use pinctrl pin offset to get_gpio_mux()
Use the pinctrl pin offset to get_gpio_mux() to remove the bank num
dependency and instead only use the bank num to assign a bank name.

Most Rockchip SoCs use all 32 pins of each gpio controller, meaning the
pinctrl pin offset typically is aligned to 32.

However, for gpio0 on RK3288 only 24 pins are used meaning the pinctrl
pin offset start at pin 24 for gpio1. Use DIV_ROUND_UP to get the 32 pin
aligned bank num.

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2024-10-08 15:41:09 +02:00
Jonas Karlman
9748ca044b gpio: rockchip: Get pinctrl device from gpio-ranges prop
Get pinctrl device from gpio-ranges phandle when the property exists,
fallback to get the first pinctrl device.

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2024-10-08 15:41:09 +02:00
Jonas Karlman
283f6df7d4 pinctrl: rockchip: Add gpio_request_enable() ops
Implement gpio_request_enable() ops so that the gpio request() ops can
be implemented and a gpio requested pin automatically is pinmuxed for
gpio use, similar to Linux kernel.

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
2024-10-08 15:41:09 +02:00
Jonas Karlman
d4d6dfd8ae pinctrl: rockchip: Add pinmux status related ops
Add get_pins_count(), get_pin_name() and get_pin_muxing() ops to support
the pinmux status cmd.

  => pinmux dev pinctrl
  dev: pinctrl
  => pinmux status
  GPIO0_A0  : gpio
  GPIO0_A1  : func-1
  GPIO0_A2  : gpio
  GPIO0_A3  : gpio
  GPIO0_A4  : func-1
  GPIO0_A5  : gpio
  GPIO0_A6  : gpio
  GPIO0_A7  : func-1
  GPIO0_B0  : gpio
  GPIO0_B1  : func-1
  GPIO0_B2  : func-1
  GPIO0_B3  : gpio
  [...]

The change to use ENOENT for unrouted pins also help hide a "Error -22"
message for unrouted pins using the gpio status -a cmd.

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2024-10-08 15:41:09 +02:00
Jonas Karlman
f6c146e6eb pinctrl: rockchip: Update get_gpio_mux() ops
Add a way to get_gpio_mux() based on the pinctrl pin offset, use -1 as
banknum to use the pinctrl pin offset mode instead of bank pin offset.

This mode will be used by the gpio driver to ensure a pin used by gpio
request() and get_function() ops always refer to the same pinctrl pin.

Also add verify_config() of banknum and index to avoid an out of range
access of the pin_banks array, i.e. with gpio6 on rk3066a.

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2024-10-08 15:41:09 +02:00
Jonas Karlman
f1515d498e pinctrl: rockchip: Add a pin_to_bank() helper
Add a pin_to_bank() helper that can locate a pin bank based on the pin
offset, to be used in get_gpio_mux() and gpio_request_enable() ops.

Reset ctrl->nr_pins to 0 so that pin_to_bank() can locate a bank after
the second probe in U-Boot proper.

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
2024-10-08 15:41:09 +02:00
Jonas Karlman
f308fc9ab0 pinctrl: rockchip: Use syscon_regmap_lookup_by_phandle()
Use syscon_regmap_lookup_by_phandle() to simplify the code.

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2024-10-08 15:41:09 +02:00
Jonas Karlman
eb84ee977d mmc: Remove alignment hole for cmdidx in struct mmc_cmd
The alignment hole caused by cmdidx in struct mmc_cmd cause strange
issues together with the peephole2 optimization on Amlogic SoCs.
Following was observed while working on SPL support for Amlogic SoCs.

sd_get_capabilities() normally issue a CMD55 followed by a CMD51.
However, on at least Amlogic S905 (Cortex-A53) and S905X3 (Cortex-A55),
CMD55 was instead followed by CMD8 (and a few reties) in SPL.

Code from the call site:

  cmd.cmdidx = SD_CMD_APP_SEND_SCR; // 51
  ...
  data.blocksize = 8;
  ...
  err = mmc_send_cmd_retry(mmc, &cmd, &data, 3);

Running the code with MMC_TRACE enabled shows:

CMD_SEND:55
                ARG                      0x50480000
                MMC_RSP_R1,5,6,7         0x00000920
CMD_SEND:8
                ARG                      0x00000000
                RET                      -110

Removing the alignment hole by changing cmdidx from ushort to uint or
building with -fno-peephole2 flag seem to resolve this issue.

CMD_SEND:55
                ARG                      0x50480000
                MMC_RSP_R1,5,6,7         0x00000920
CMD_SEND:51
                ARG                      0x00000000
                MMC_RSP_R1,5,6,7         0x00000920

Same issue was observed building U-Boot with gcc 8 - 13.

Remove this alignment hole by changing cmdidx from ushort to uint.

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
2024-10-08 15:41:08 +02:00
Jonas Karlman
641799f1b8 usb: dwc3-of-simple: Remove Amlogic and Rockchip compatible
Remove the rockchip,rk3399-dwc3 compatible from the dwc3-of-simple
driver now that all boards have changed to use the dwc3-generic driver.

Also remove the amlogic,meson-gxl-dwc3 compatible, it is no longer in
use by any device tree in mainline linux or U-Boot.

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Marek Vasut <marex@denx.de>
2024-10-08 15:41:08 +02:00
Jonas Karlman
628c973554 power: regulator: Consistently return -ENOSYS when ops is unimplemented
dev_get_driver_ops() may return NULL when the udevice is invalid.

Move the ops check to top of functions to consistently return -ENOSYS
when ops is unimplemented and prevent trying to access uclass plat data,
also add missing NULL checks to suspend ops.

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
(cherry picked from commit 4386ab9118)
2024-10-08 15:41:08 +02:00
Jonas Karlman
120c050512 power: regulator: Do not call set_suspend_value with -ENODATA
On some boards a PMIC regulator is flagged with regulator-on-in-suspend
and does not define any suspend or max microvolt, e.g. on Radxa ROCK 3A:

  vcc_ddr: DCDC_REG3 {
	regulator-name = "vcc_ddr";
	regulator-always-on;
	regulator-boot-on;
	regulator-initial-mode = <0x2>;

	regulator-state-mem {
		regulator-on-in-suspend;
	};
  };

This result in suspend_uV having the value -ENODATA after probe.

This negative voltage, -ENODATA, gets missinterpreted and result in an
unexpected voltage being set by autoset.

E.g. on Radxa ROCK 3A the vcc_ddr regulator by default have a normal and
suspend voltage value of 0.5v. However, due to this missinterpretation
the suspend voltage end up beind set to 0.5625v instead.

Fix this by skip calling regulator_set_suspend_value() in autoset and
also protect calling set value ops when input value is -ENODATA.

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
(cherry picked from commit f417c14d88)
2024-10-08 15:41:08 +02:00