Per dw_mmc databook, it's recommended to reset the host controller if
some data-related error occurred.
Implement a reset mechanism.
Signed-off-by: Ziyuan Xu <xzy.xu@rock-chips.com>
Co-developed-by: Jason Zhu <jason.zhu@rock-chips.com>
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
[eugen.hristev@collabora.com: modified a bit the variables initialization]
Signed-off-by: Eugen Hristev <eugen.hristev@collabora.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
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>
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>
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>
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>
Boards like Radxa ROCK 5 Model B and NanoPi R5C require PCI to be
initialized in order to discover their onboard network controllers.
During standard boot, PCI gets initialized after faster boot media have
been evaluated. However when an EFI bootflow is run from a fast boot
media, PCI initialization may not have happended and as a result no
network device is exposed to EFI.
Fix this by initializing PCI during EFI bootflow when no ethernet device
can be found.
This allows chainloading e.g. iPXE on ROCK 5B and NanoPi R5C without
having to enable PCI_INIT_R. Enabling of PCI_INIT_R has the side affect
of slowing down booting from faster boot media, by adding ~1 second off
boot delay for each unocupied M.2 slot.
Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Hardkernel ODROID-M1S is a single board computer with a RK3566 SoC,
a slightly modified version of the RK3566 SoC.
Features tested on a ODROID-M1S 8GB v1.0 2023-08-10:
- SD-card boot
- eMMC boot
- PCIe/NVMe
Signed-off-by: Dongjin Kim <tobetter@gmail.com>
Based on the ROCK 3 Model C / Pine64 Quartz64-B and Jianfeng Liu's kernel DT.
Tested with a OrangePi 3B 4GB v1.1:
- SD-card boot
- eMMC boot
- SPI Flash boot
- chip is XMC XM25QU128CWIQ, not W25Q256JWEIQ listed in schematics
- PCIe/NVMe
- USB is untested
Signed-off-by: Ricardo Pardini <ricardo@pardini.net>
This uses device tree for Pine64 Quartz64-B.
Device tree for Quartz64-B is not fully compatible with ROCK 3C, e.g.
one USB 2.0 host port will not work on ROCK 3C using this DT.
Tested with a ROCK 3C 8GB v1.31:
- SD-card boot
- eMMC boot
- SPI Flash boot
- PCIe/NVMe
- USB host
Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
The PineNote is an e-ink tablet by PINE64. It is built around a Rockchip
RK3566 SoC and has the following specifications:
- 4GB LPDDR4
- 128GB eMMC
- 10.3" 1404x1872 e-ink display
This board is very similar to other RK356x-based boards, with the
exception that its download-mode "key" (actually a Hall sensor) is on
ADC channel 0 instead of 1.
As such, this patch is heavily based on the evb_3568 board
implementation with the addition of a simple board setup code, meant to
account for the above difference.
Signed-off-by: Arnaud Ferraris <arnaud.ferraris@collabora.com>
Add support to reset to bootrom download mode on hang in U-Boot SPL and
proper. ROCKCHIP_HANG_TO_BROM can be used to enable this feature.
Example when SPL cannot load FIT:
U-Boot SPL 2024.04-rc1 (Feb 01 2024 - 23:01:12 +0000)
Trying to boot from MMC1
mmc_load_image_raw_sector: mmc block read error
Trying to boot from MMC2
Card did not respond to voltage select! : -110
spl: mmc init failed with error: -95
Trying to boot from MMC1
mmc_load_image_raw_sector: mmc block read error
SPL: failed to boot from all boot devices
### ERROR ### Please RESET the board ###
entering download mode ...
resetting ...
Procedure to start bootrom download mode:
- U-Boot SPL or proper write 0xEF08A53C to BOOT_MODE_REG and then reset
- Bootrom loads and run boot code (TPL) from e.g. SPI > eMMC > SD-card
- TPL check for 0xEF08A53C in BOOT_MODE_REG very early, i.e. Rockchip
TPL blobs check for this value directly at start
- TPL return to bootrom with a return value != 0
- Bootrom enter download mode
This also fixes an issue where the BOOT_MODE_REG is reset to 0 when
board is reset on RK35xx after TF-A has been loaded. To fix this the
SOC_CON1 reg value is reset prior to issuing a global reset.
The RK356x TF-A blobs will clear SOC_CON1 as part of a PSCI reset,
however the RK3588 TF-A blobs does not seem to clear SOC_CON1.
Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
---
- Is reset to bootrom download mode on hang a feature of intereset to
anyone else?
- How can we best handle the issue with BOOT_MODE_REG being reset?
- Should we instead enable SYSRESET_PSCI and relay on TF-A to properly
reset without loosing value in BOOT_MODE_REG? Currently works on
RK356x bl31 blobs but not on the RK3588 bl31 blobs.
Link to RFC: https://patchwork.ozlabs.org/patch/1894244/
Enable support for loading FIT from eMMC boot partition when
SUPPORT_EMMC_BOOT Kconfig option is enabled.
FIT is only loaded from boot partition when the boot partition is set to
boot0 (1) or boo1 (2) in the extcsd partition config. FIT is read from
sector 1024 (512 KiB) of the configured boot partition.
Following can be used to write U-Boot to boot partition 1 of eMMC:
# Load TPL+SPL from SD-card
=> load mmc 1:1 20000000 idbloader.img
=> mmc dev 0
# Access eMMC user partition
=> mmc partconf 0 0 0 0
# Write TPL+SPL to eMMC user partition (512 KiB @ 32 KiB)
=> mmc write 20000000 40 400
# Load FIT from SD-card
=> load mmc 1:1 20000000 u-boot.itb
=> mmc dev 0
# Access eMMC boot partition 1
=> mmc partconf 0 0 0 1
# Write FIT to eMMC boot partition 1 (2 MiB @ 512 KiB)
=> mmc write 20000000 400 1000
# Configure to use boot partition 1
=> mmc partconf 0 0 1 0
# Show partition config
=> mmc partconf 0
Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
---
- Is loading FIT from emmc boot partition a feature of intereset to
anyone else?
- I used a @ 512 KiB offset for FIT, should leave enough space for e.g.
TPL/SPL, vendor storage or environment before FIT.
- Is @ 512 KiB offset a good default option? Or would e.g. @ 0 or
@ 32KiB a more apropriate offset?
- This does not add kind of fallback to use the normal @ 8 MiB offset in
user partition. Is that something that would be needed?
Link to RFC: https://patchwork.ozlabs.org/patch/1894243/
Add a minimal generic RK3588S/RK3588 board that only have eMMC and SDMMC
enabled. This defconfig can be used to boot from eMMC or SD-card on most
RK3588S/RK3588 boards that follow reference board design.
Also fix the alphabetical order of RK3588 boards listed in Makefile and
documentation.
Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
---
Link to v1: https://patchwork.ozlabs.org/patch/1893667/
Add Kconfig options to enable support for booting from SPI NOR flash on
Orange Pi R1 Plus boards.
The generated bootable u-boot-rockchip-spi.bin that can be written to
0x0 of SPI NOR flash. The FIT image is loaded from 0x60000, same as on
RK35xx boards.
Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Tianling Shen <cnsztl@gmail.com>
Add Kconfig options to enable support for booting from SPI NOR flash on
Pine64 Rock64.
The generated bootable u-boot-rockchip-spi.bin that can be written to
0x0 of SPI NOR flash. The FIT image is loaded from 0x60000, same as on
RK35xx boards.
=> sf probe
SF: Detected gd25q128 with page size 256 Bytes, erase size 4 KiB, total 16 MiB
=> load mmc 1:1 10000000 u-boot-rockchip-spi.bin
1359872 bytes read in 65 ms (20 MiB/s)
=> sf update $fileaddr 0 $filesize
device 0 offset 0x0, size 0x14c000
1118208 bytes written, 241664 bytes skipped in 8.516s, speed 163516 B/s
Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Similar to RK35xx the BootRom in RK3328 can read all data and look for
idbloader at 0x8000, same as on SD and eMMC.
Use the rksd format and modify the mkimage offset to generate a bootable
u-boot-rockchip-spi.bin that can be written to 0x0 of SPI NOR flash.
Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
This reverts commit 3523c07867.
Booting from SPI was already allowed before this commit was first
introduced. A few lines further down the exact same code already existed
and still does.
Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Replace the rockchip,cryptov1-rng compatible with compatibles used in
the linux device tree for RK3288, RK3328 and RK3399 to ease sync of SoC
device tree from linux.
Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
The U-Boot driver try to base the gpio bank id on the gpio-ranges prop
and fall back to base the bank id on the node name. However, the linux
driver try to base the bank id on the gpio alias id and fall back on
node order.
This can cause issues when SoC DT is synced from linux and gpioX@ nodes
has been renamed to gpio@ and gpio-ranges or a SoC specific alias has
not been assigned.
Try to use the gpio alias id as first fallback when a gpio-ranges prop
is missing to ease sync of updated SoC DT. Keep the current fallback on
node name as a third fallback to not affect any existing unsynced DT.
Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
When RK3328 boards run SPL from eMMC and fail to load FIT from eMMC due
to it being missing or checksum validation fails there is a fallback to
read FIT from SD-card. However, without proper pinctrl configuration
reading FIT from SD-card will fail:
U-Boot SPL 2024.04-rc1 (Feb 05 2024 - 22:18:22 +0000)
Trying to boot from MMC1
mmc_load_image_raw_sector: mmc block read error
Trying to boot from MMC2
Card did not respond to voltage select! : -110
spl: mmc init failed with error: -95
Trying to boot from MMC1
mmc_load_image_raw_sector: mmc block read error
SPL: failed to boot from all boot devices
### ERROR ### Please RESET the board ###
Fix this by tagging related emmc and sdmmc pinctrl nodes with bootph
props. Also sort and move common nodes shared by all boards to the SoC
u-boot.dtsi.
Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Update defconfig for rk3328-orangepi-r1-plus boards with new defaults.
Remove the SPL_DRIVERS_MISC=y option, no misc driver is used in SPL.
Add CONFIG_SPL_FIT_SIGNATURE=y to let SPL verify an auto generated hash
of FIT images. This help indicate if there is an issue loading any of
the images to DRAM or SRAM. Also add LEGACY_IMAGE_FORMAT=y to keep
support for scripts.
Add ROCKCHIP_EFUSE=y and remove NET_RANDOM_ETHADDR=y, ethaddr and
eth1addr is set based on cpuid read from eFUSE.
Add SPL_DM_SEQ_ALIAS=y option to use alias sequence number in SPL.
Add DM_ETH_PHY=y, PHY_MOTORCOMM=y, PHY_REALTEK=y and remove &gmac2io to
support reset of onboard ethernet PHYs.
Add PHY_ROCKCHIP_INNO_USB2=y option to support the onboard USB PHY.
Add RNG_ROCKCHIP=y and DM_RNG=y options to support the onboard random
generator.
Also add missing device tree files to MAINTAINERS file.
Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Tianling Shen <cnsztl@gmail.com>
Update defconfig for rk3328-nanopi-r2* boards with new defaults.
Remove the SPL_DRIVERS_MISC=y option, no misc driver is used in SPL.
Add CONFIG_SPL_FIT_SIGNATURE=y to let SPL verify an auto generated hash
of FIT images. This help indicate if there is an issue loading any of
the images to DRAM or SRAM. Also add LEGACY_IMAGE_FORMAT=y to keep
support for scripts.
Add ROCKCHIP_EFUSE=y and remove NET_RANDOM_ETHADDR=y, ethaddr and
eth1addr is set based on cpuid read from eFUSE.
Add SPL_DM_SEQ_ALIAS=y option to use alias sequence number in SPL.
Add DM_ETH_PHY=y, PHY_MOTORCOMM=y, PHY_REALTEK=y and remove &gmac2io to
support reset of onboard ethernet PHYs.
Add RNG_ROCKCHIP=y and DM_RNG=y options to support the onboard random
generator.
Also add missing device tree files to MAINTAINERS file.
Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Update defconfig for rk3328-rock-pi-e with new defaults.
Remove the xPL_DRIVERS_MISC=y option, no misc driver is used in xPL.
Add CONFIG_SPL_FIT_SIGNATURE=y to let SPL verify an auto generated hash
of FIT images. This help indicate if there is an issue loading any of
the images to DRAM or SRAM. Also add LEGACY_IMAGE_FORMAT=y to keep
support for scripts.
Add ROCKCHIP_EFUSE=y and remove NET_RANDOM_ETHADDR=y, ethaddr and
eth1addr is set based on cpuid read from eFUSE.
Add SPL_DM_SEQ_ALIAS=y option to use alias sequence number in SPL.
Add RNG_ROCKCHIP=y and DM_RNG=y options to support the onboard random
generator.
Also add myself as a reviewer for this board.
Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Update defconfig for rk3328-roc-cc with new defaults.
Remove the SPL_DRIVERS_MISC=y option, no misc driver is used in SPL.
Add CONFIG_SPL_FIT_SIGNATURE=y to let SPL verify an auto generated hash
of FIT images. This help indicate if there is an issue loading any of
the images to DRAM or SRAM. Also add LEGACY_IMAGE_FORMAT=y to keep
support for scripts.
Add ROCKCHIP_EFUSE=y and remove NET_RANDOM_ETHADDR=y, ethaddr and
eth1addr is set based on cpuid read from eFUSE.
Add SPL_DM_SEQ_ALIAS=y option to use alias sequence number in SPL.
Add DM_ETH_PHY=y, PHY_MOTORCOMM=y and PHY_REALTEK=y to support common
ethernet PHYs.
Add RNG_ROCKCHIP=y and DM_RNG=y options to support the onboard random
generator.
Also add missing device tree file to MAINTAINERS and add myself as a
reviewer for this board.
Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Update defconfig for rk3328-rock64 with new defaults.
Remove the SPL_DRIVERS_MISC=y option, no misc driver is used in SPL.
Add CONFIG_SPL_FIT_SIGNATURE=y to let SPL verify an auto generated hash
of FIT images. This help indicate if there is an issue loading any of
the images to DRAM or SRAM. Also add LEGACY_IMAGE_FORMAT=y to keep
support for scripts.
Remove the NET_RANDOM_ETHADDR=y option, ethaddr and eth1addr is set
based on cpuid read from eFUSE.
Add SPL_DM_SEQ_ALIAS=y option to use alias sequence number in SPL.
Add DM_ETH_PHY=y and PHY_REALTEK=y to support onboard ethernet PHY.
Also add missing device tree file to MAINTAINERS and add myself as a
reviewer for this board.
Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Dragan Simic <dsimic@manjaro.org>
Update defconfig for rk3328-evb with new defaults.
Remove the xPL_DRIVERS_MISC=y option, no misc driver is used in xPL.
Add CONFIG_SPL_FIT_SIGNATURE=y to let SPL verify an auto generated hash
of FIT images. This help indicate if there is an issue loading any of
the images to DRAM or SRAM. Also add LEGACY_IMAGE_FORMAT=y to keep
support for scripts.
Add MISC_INIT_R=y, ROCKCHIP_EFUSE=y and remove NET_RANDOM_ETHADDR=y,
ethaddr and eth1addr is set based on cpuid read from eFUSE.
Remove pinctrl-0 and pinctrl-names from CONFIG_OF_SPL_REMOVE_PROPS,
SPL need to configure pinctrl for e.g. SD-card.
Add SPL_DM_SEQ_ALIAS=y option to use alias sequence number in SPL.
Add DM_ETH_PHY=y, PHY_MOTORCOMM=y and PHY_REALTEK=y to support common
ethernet PHYs.
Add RNG_ROCKCHIP=y and DM_RNG=y options to support the onboard random
generator.
Also add missing device tree files to MAINTAINERS and remove the
obsolete README file.
Signed-off-by: Jonas Karlman <jonas@kwiboo.se>