summaryrefslogtreecommitdiff
path: root/arch/arm/include/asm/arch-rockchip
AgeCommit message (Collapse)Author
2026-03-10clk: rockchip: Add support for RK3506Finley Xiao
Add clock driver for RK3506. Imported from vendor U-Boot linux-6.1-stan-rkr6 tag with minor adjustments and fixes for mainline. Signed-off-by: Finley Xiao <[email protected]> Signed-off-by: Jonas Karlman <[email protected]> Reviewed-by: Kever Yang <[email protected]>
2025-12-14rockchip: sdram: Add rockchip_sdram_type() helperJonas Karlman
Add a helper function based on rockchip_sdram_size() that return what DRAM type is used on current running board. Signed-off-by: Jonas Karlman <[email protected]> Reviewed-by: Kever Yang <[email protected]>
2025-11-02rockchip: spl: Add a read_brom_bootsource_id() helperJonas Karlman
The bootsource ids reported by BootROM of RK3528 and RK3576 for e.g. SPI NOR and USB differs slightly compared to prior SoCs: - Booting from sfc0 (ROCK 4D) report the normal bootsource id 0x3. - Booting from sfc1 M1 (NanoPi M5) report a new bootsource id 0x23. - Booting from sfc1 M0 has not been tested (no board using this config). - Booting from USB report a new bootsource id 0x81 on RK3528 and RK3576. Add a helper function to read the bootsource id. This helper function will be used to translate the new values to the common BROM_BOOTSOURCE enum values on RK3528 and RK3576. Signed-off-by: Jonas Karlman <[email protected]> Reviewed-by: Kever Yang <[email protected]>
2025-06-14arch: use lowercase hex prefix styleE Shattow
Use consistent lowercase hex prefix style in arch/* Signed-off-by: E Shattow <[email protected]>
2025-05-08rockchip: rk3288: grf: Unify speed/flowctrl fields for clarityChristoph Fritz
Update GMAC speed and flow control fields in GRF_SOC_CON1 to use RK3288_GMAC_* prefix, ensuring a consistent naming convention. It also shifts each mask/bit definition to match the actual hardware bits, which makes future usage easier. Signed-off-by: Christoph Fritz <[email protected]> Reviewed-by: Kever Yang <[email protected]>
2025-04-23reset: rockchip: implement rk3576 lookup tableElaine Zhang
The current DT bindings for the rk3576 clock use a different ID than the one that is supposed to be written to the hardware registers. Thus, we cannot use directly the id provided in the phandle, but rather use a lookup table to correctly setup the hardware. This follows the implementation done in the Linux-Kernel and also how the rk3588 does this both in the Linux-Kernel as well as U-Boot. Signed-off-by: Elaine Zhang <[email protected]> [adapted from mainline Linux code for u-boot] Signed-off-by: Heiko Stuebner <[email protected]> Reviewed-by: Jonas Karlman <[email protected]> Reviewed-by: Kever Yang <[email protected]>
2025-04-23clk: rockchip: Add rk3576 clk supportElaine Zhang
Add clock driver support for Rockchip RK3576 SoC. Signed-off-by: Elaine Zhang <[email protected]> [adapted to mainline u-boot] Signed-off-by: Heiko Stuebner <[email protected]> Reviewed-by: Jonas Karlman <[email protected]> Reviewed-by: Kever Yang <[email protected]>
2025-04-23clk: rockchip: Add support for RK3528Joseph Chen
Add clock driver for RK3528. Imported from vendor U-Boot linux-6.1-stan-rkr5 tag with minor adjustments and fixes for mainline. Signed-off-by: Joseph Chen <[email protected]> Signed-off-by: Finley Xiao <[email protected]> Signed-off-by: Jonas Karlman <[email protected]> Reviewed-by: Kever Yang <[email protected]>
2025-02-19rockchip: rk3399: grf: Fix enum typos for UART2Chen-Yu Tsai
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: a2c08df3813b ("pinctrl: add driver for rk3399") Fixes: fa72de10452c ("rockchip: arm64: rk3399: move grf register definitions to grf_rk3399.h") Signed-off-by: Chen-Yu Tsai <[email protected]> Reviewed-by: Quentin Schulz <[email protected]> Reviewed-by: Paul Kocialkowski <[email protected]> Reviewed-by: Kever Yang <[email protected]>
2025-01-10clk: rockchip: rk3588: fix mask define for aclk_vop_rootHeiko Stuebner
The mask for aclk_vop_root is 3-bit wide, not 2-bit wide according to the TRM, so set the mask accordingly. Signed-off-by: Heiko Stuebner <[email protected]> Reviewed-by: Quentin Schulz <[email protected]> Reviewed-by: Kever Yang <[email protected]>
2024-10-25rockchip: px30: clk: add UART0 clock getter/setterLukasz Czechowski
Add dedicated getter and setter for SCLK_UART0_PMU. This allows the driver to correctly handle UART0 clocks, and thus it fixes the issues with UART0 not working in case DEBUG_UART is disabled. Unlike other Rockchip SoCs, i.e. rk3399, in the PX30 the default clock source for UART is GPLL, instead of external oscillator. If the DEBUG_UART is enabled, the clock source is changed in board_debug_uart_init function to 24Mhz oscillator, which also matches the fallback value obtained from DT node. In case the DEBUG_UART is disabled, the UART clock source remains default, and the DM serial driver wrongly configures the baud rate, resulting in broken communication. By implementing the UART clock getter/setter, the serial driver can probe the actual configuration and corectly configure itself. The DEBUG_UART settings now should not affect it. The driver supports GPLL and 24M oscillator. NPLL and USBPHY480M sources, that are managed by CRU, are not yet handled, as likely they won't be used in real scenarios. Signed-off-by: Lukasz Czechowski <[email protected]> Reviewed-by: Quentin Schulz <[email protected]> Reviewed-by: Kever Yang <[email protected]>
2024-10-11arch: Use CONFIG_XPL_BUILD instead of CONFIG_SPL_BUILDSimon Glass
Use the new symbol to refer to any 'SPL' build, including TPL and VPL Signed-off-by: Simon Glass <[email protected]>
2024-08-23rockchip: Move the default timer init to a common fileSimon Glass
Rather than repeating the same code in two files (SPL and TPL), move it to a shared filed. Signed-off-by: Simon Glass <[email protected]> Reviewed-by: Dragan Simic <[email protected]> Reviewed-by: Quentin Schulz <[email protected]>
2024-07-18Merge tag 'u-boot-rockchip-20240718' of ↵Tom Rini
https://source.denx.de/u-boot/custodians/u-boot-rockchip - Add boards: rk3328: Radxa ROCK Pi E v3; rk3588s: FriendlyElec NanoPi R6C/S; - Remove board: Theobroma Systems RK3368 Lion; - Add rk3588 pcie support; - Misc updates for board and config; CI: https://source.denx.de/u-boot/custodians/u-boot-rockchip/-/pipelines/2163
2024-07-17rockchip: include cru_rk3588.h and define rockchip_cru for RK3588FUKAUMI Naoki
fix following error found by clang: CC arch/arm/mach-rockchip/cpu-info.o arch/arm/mach-rockchip/cpu-info.c:23:13: error: incomplete definition of type 'struct rockchip_cru' 23 | switch (cru->glb_rst_st) { | ~~~^ ./arch/arm/include/asm/arch-rockchip/clock.h:181:8: note: forward declaration of 'struct rockchip_cru' 181 | struct rockchip_cru; | ^ 1 error generated. Signed-off-by: FUKAUMI Naoki <[email protected]> Reviewed-by: Kever Yang <[email protected]>
2024-07-15arm: include: rockchip: Remove duplicate newlinesMarek Vasut
Drop all duplicate newlines. No functional change. Signed-off-by: Marek Vasut <[email protected]>
2024-06-04Merge tag 'v2024.07-rc4' into nextTom Rini
Prepare v2024.070-rc4
2024-05-24clk: rockchip: rk3588: Set SPLL frequency during SPL stageHeiko Stuebner
All parts expect the SPLL to run at 702MHz. In U-Boot it's the SPLL_HZ declaring this rate and in the kernel it's a fixed clock definition. While everything is expecting 702MHz, the SPLL is not running that frequency when coming from the bootrom though, instead it's running at 351MHz and the vendor-u-boot just sets it to the expected frequency. The SPLL itself is located inside the secure-BUSCRU and in theory accessible as an SCMI clock, though this requires an unknown amount of cooperation from trusted-firmware to set at a later stage, though during the SPL stage we can still access the relevant CRU directly. The SPLL is for example necessary for the DSI controllers to produce output. As the SPLL is "just" another rk3588 pll, just set the desired rate directly during the SPL stage. Tested on rk3588-rock5b and rk3588-tiger by reading back the PLL rate and also observing working DSI output with this change. Fixes: 6737771600d4 ("rockchip: rk3588: Add support for sdmmc clocks in SPL") Suggested-by: Andy Yan <[email protected]> Signed-off-by: Heiko Stuebner <[email protected]> Cc: Jonas Karlman <[email protected]> Cc: Quentin Schulz <[email protected]> Reviewed-by: Kever Yang <[email protected]>
2024-05-20Restore patch series "arm: dts: am62-beagleplay: Fix Beagleplay Ethernet"Tom Rini
As part of bringing the master branch back in to next, we need to allow for all of these changes to exist here. Reported-by: Jonas Karlman <[email protected]> Signed-off-by: Tom Rini <[email protected]>
2024-05-19Revert "Merge patch series "arm: dts: am62-beagleplay: Fix Beagleplay Ethernet""Tom Rini
When bringing in the series 'arm: dts: am62-beagleplay: Fix Beagleplay Ethernet"' I failed to notice that b4 noticed it was based on next and so took that as the base commit and merged that part of next to master. This reverts commit c8ffd1356d42223cbb8c86280a083cc3c93e6426, reversing changes made to 2ee6f3a5f7550de3599faef9704e166e5dcace35. Reported-by: Jonas Karlman <[email protected]> Signed-off-by: Tom Rini <[email protected]>
2024-05-07board: rockchip: Remove <common.h> and add needed includesTom Rini
Remove <common.h> from this board vendor directory and when needed add missing include files directly. Reviewed-by: Kever Yang <[email protected]> Signed-off-by: Tom Rini <[email protected]>
2024-05-06arm: rockchip: Remove <common.h> and add needed includesTom Rini
Remove <common.h> from all mach-rockchip and include/asm/arch-rockchip files and when needed add missing include files directly. Signed-off-by: Tom Rini <[email protected]>
2024-04-26rockchip: rk3308: Move cru and grf include files to arch-rockchipJonas Karlman
Move cru_rk3308.h and grf_rk3308.h to arch-rockchip to match path used for all other Rockchip SoCs. Signed-off-by: Jonas Karlman <[email protected]> Reviewed-by: Kever Yang <[email protected]>
2024-04-26rockchip: bootrom: Sync bootsource id enum from bootromJason Zhu
Add more bootsource id: 1. BROM_BOOTSOURCE_UNKNOWN 2. BROM_BOOTSOURCE_I2C 3. BROM_BOOTSOURCE_SPI Signed-off-by: Jason Zhu <[email protected]> [[email protected]: Update commit message] Signed-off-by: Jonas Karlman <[email protected]> Reviewed-by: Dragan Simic <[email protected]>
2024-04-21clk: rockchip: rk3328: Add VOP clk supportJagan Teki
VOP get and set clock would needed for VOP drivers. Add support for it. Signed-off-by: Jagan Teki <[email protected]>
2024-03-13rockchip: include asm/io.h directly in asm/arch-rockchip/hardware.hQuentin Schulz
The different macros use writel which is defined in asm/io.h, so let's include the header so users of hardware.h do not need to include asm/io.h as well. While at it, remove asm/io.h includes wherever asm/arch-rockchip/hardware.h is included already. Cc: Quentin Schulz <[email protected]> Reviewed-by: Kever Yang <[email protected]> Signed-off-by: Quentin Schulz <[email protected]>
2024-03-13rockchip: rk3588: add constants for some register address spacesQuentin Schulz
It's one thing to have the register mapped via a well-defined struct but it's another to be able to make use of it. For that to happen, one needs to cast the physical address memory of the beginning of the register address space with the struct. Since this cannot change, let's hardcode it in the include files so that users do not need to duplicate this line of code in their own implementation. Cc: Quentin Schulz <[email protected]> Reviewed-by: Kever Yang <[email protected]> Signed-off-by: Quentin Schulz <[email protected]>
2024-03-13rockchip: rk3588: disable force_jtag by defaultQuentin Schulz
Rockchip SoCs can automatically switch between jtag and sdmmc based on the following rules: - all the SDMMC pins including SDMMC_DET set as SDMMC function in GRF, - force_jtag bit in GRF is 1, - SDMMC_DET is low (no card detected), Note that the BootROM may mux all SDMMC pins in their SDMMC function or not, depending on the boot medium that were tried. Because SDMMC_DET pin is not guaranteed to be used as an SD card card detect pin, it could be low at boot or even switch at runtime, which would enable the jtag function and render the SD card unusable. This is the case for RK3588 Jaguar for example which has an SD card connector without an SD card card detect signal and has SDMMC_DET connected to ground. Because enabling JTAG at runtime could be a security issue and also to make sure that we have a consistent behavior on all boards by default, let's disable this force_jtag feature. However, let's make it easy to reenable it for debugging purposes by hiding it behind a Kconfig symbol. Note that soc_con[0] is reserved. But considering that it's way more user-friendly to access soc_con1 from the TRM with soc_con[1] than soc_con[0], and that soc_con0 would actually be located at 4 bytes before soc_con1, let's just make soc_con0 part of the soc_con array. Cc: Quentin Schulz <[email protected]> Signed-off-by: Quentin Schulz <[email protected]> Reviewed-by: Kever Yang <[email protected]>
2024-03-13rockchip: transform rockchip_capsule_update_board_setup into a weak function ↵Quentin Schulz
symbol There's only one user of rockchip_capsule_update_board_setup, which is in board.c, and only one board defines it, so instead of having a header only for one function symbol, let's just use a weak symbol instead. Cc: Quentin Schulz <[email protected]> Reviewed-by: Kever Yang <[email protected]> Reviewed-by: Dragan Simic <[email protected]> Reviewed-by: Peter Robinson <[email protected]> Signed-off-by: Quentin Schulz <[email protected]>
2024-03-13rockchip: merge misc.c into board.cQuentin Schulz
The functions aren't used anywhere else than in board.c, therefore, let's not expose them anymore at all. This merges misc.c and board.c together and removes the functions from the misc.h header file. Cc: Quentin Schulz <[email protected]> Reviewed-by: Kever Yang <[email protected]> Signed-off-by: Quentin Schulz <[email protected]>
2024-01-19rockchip: rk3588: Fix boot from SPI flashJonas Karlman
The commit fd6e425be243 ("rockchip: rk3588-rock-5b: Enable boot from SPI NOR flash") added a new BROM_BOOTSOURCE_SPINOR_RK3588 with value 6. At the time the reason for this new bootsource id value 6 was unknown. We now know that the BootRom on RK3588 use different bootsource id values depending on the iomux used by the flash spi controller, and not by the type of spi nor or spi nand flash used. Add the following enum values and use them for RK3588 boot_devices. - BROM_BOOTSOURCE_FSPI_M0 = 3 - BROM_BOOTSOURCE_FSPI_M1 = 4 - BROM_BOOTSOURCE_FSPI_M2 = 6 Fixes: fd6e425be243 ("rockchip: rk3588-rock-5b: Enable boot from SPI NOR flash") Signed-off-by: Jonas Karlman <[email protected]> Tested-by: Slawomir Stepien <[email protected]> Reviewed-by: Kever Yang <[email protected]>
2023-08-12clk: rockchip: rk3568: Fix mask for clk_cpll_div_25m_divJonas Karlman
The field for clk_cpll_div_25m_div in CRU_CLKSEL_CON81 is 6 bits wide, not 5 bits wide as currently defined in CPLL_25M_DIV_MASK. Fix this and the assert so that CPLL_25M can be assigned a 25 MHz rate. Fixes: 4a262feba3a5 ("rockchip: rk3568: add clock driver") Signed-off-by: Jonas Karlman <[email protected]> Reviewed-by: Kever Yang <[email protected]>
2023-08-12rockchip: cru: Enable cpu info support for rk3568Anton
Add cru structure definition in head file to support cpu_info driver. Series-version: 2 Series-changes: 2 Format the patch header, add commit message and signature. Signed-off-by: Anton <[email protected]> Signed-off-by: Kever Yang <[email protected]>
2023-05-19rockchip: rk3588-rock-5b: Enable boot from SPI NOR flashJonas Karlman
Add sfc and flash node to device tree and config options to enable support for booting from SPI NOR flash on Radxa ROCK 5 Model B. Similar to RK3568 the BootRom in RK3588 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. The FIT image is loaded from 0x60000. => sf probe SF: Detected mx25u12835f with page size 256 Bytes, erase size 4 KiB, total 16 MiB => load mmc 1:1 10000000 u-boot-rockchip-spi.bin 1492992 bytes read in 129 ms (11 MiB/s) => sf update $fileaddr 0 $filesize device 0 offset 0x0, size 0x16c800 1300480 bytes written, 192512 bytes skipped in 11.103s, speed 137694 B/s The BROM_BOOTSOURCE_ID value read back when booting from SPI flash does not match the expected value of 3 (SPINOR) used by other SoCs. Instead a value of 6 is read back, add a new enum value to handle this new bootsource id. Signed-off-by: Jonas Karlman <[email protected]> Reviewed-by: Kever Yang <[email protected]> Tested-by: Eugen Hristev <[email protected]> Reviewed-by: Eugen Hristev <[email protected]>
2023-05-17reset: rockchip: implement rk3588 lookup tableEugen Hristev
The current DT bindings for the rk3588 clock use a different ID than the one that is supposed to be written to the hardware registers. Thus, we cannot use directly the id provided in the phandle, but rather use a lookup table to correctly setup the hardware. This approach has been implemented already in Linux, by commit : f1c506d152ff ("clk: rockchip: add clock controller for the RK3588") Hence, implement a similar approach using the lookup table, and adapt the existing reset driver to work with SoCs using lookup table. The file rst-rk3588.c has been copied as much as possible from Linux. Adapt the clk rk3588 driver as well to bind the reset driver with the lookup table. Reviewed-by: Kever Yang <[email protected]> Signed-off-by: Eugen Hristev <[email protected]>
2023-04-21rockchip: rk3588: Add support for sdmmc clocks in SPLJonas Karlman
Booting from sdmmc on RK3588 currently works because of a workaround in the device tree, clocks are reordered so that the driver use ciu-sample instead of ciu, and the BootRom initializes sdmmc clocks before SPL is loaded into DRAM. The sdmmc clocks are normally controlled by TF-A using SCMI. However, there is a need to control these clocks in SPL, before TF-A has started. This adds a rk3588_scru driver to control the sdmmc clocks in SPL before TF-A has started, using scru regs. It also adds a small glue driver to bind the scmi clock node to the rk3588_scru driver in SPL. Fixes: 7a474df74023 ("clk: rockchip: Add rk3588 clk support") Signed-off-by: Jonas Karlman <[email protected]> Reviewed-by: Kever Yang <[email protected]>
2023-02-28arm: rockchip: Add ioc header for rk3588Jagan Teki
Add IOC unit header include for rk3588. Signed-off-by: Steven Liu <[email protected]> Signed-off-by: Joseph Chen <[email protected]> Signed-off-by: Jagan Teki <[email protected]> Reviewed-by: Kever Yang <[email protected]>
2023-02-28clk: rockchip: pll: Add pll_rk3588 type for rk3588Jagan Teki
Add RK3588 pll set and get rate clock support. Signed-off-by: Elaine Zhang <[email protected]> Signed-off-by: Jagan Teki <[email protected]> Reviewed-by: Kever Yang <[email protected]>
2023-02-28arm: rockchip: Add grf header for rk3588Jagan Teki
Add GRF header for Rockchip RK3588. Signed-off-by: Jagan Teki <[email protected]> Reviewed-by: Kever Yang <[email protected]>
2023-02-28arm: rockchip: Add cru header for rk3588Jagan Teki
Add clock and reset unit header include for rk3588. Signed-off-by: Elaine Zhang <[email protected]> Signed-off-by: Jagan Teki <[email protected]> Reviewed-by: Kever Yang <[email protected]>
2023-02-28rockchip: sdram: add basic support for sdram reg info version 3Jonas Karlman
Newer DRAM initialization blobs from vendor can encode sdram info in a new version 3 format. The new format makes use of more bits in sys_reg3 compared to the version 2 format. Add basic support for detecting the version 3 format and decoding the high bits used for ddrtype. This fixes decode of sdram size on my RK3568 boards that have LPDDR4X. Details on the new format was deciphered from vendor u-boot commit [1]. [1] https://github.com/rockchip-linux/u-boot/commit/c69667e0e2bf4290ab1f408fcde58b8806ac266b Signed-off-by: Jonas Karlman <[email protected]> Reviewed-by: Kever Yang <[email protected]>
2023-01-20global: Finish CONFIG -> CFG migrationTom Rini
At this point, the remaining places where we have a symbol that is defined as CONFIG_... are in fairly odd locations. While as much dead code has been removed as possible, some of these locations are simply less obvious at first. In other cases, this code is used, but was defined in such a way as to have been missed by earlier checks. Perform a rename of all such remaining symbols to be CFG_... rather than CONFIG_... Signed-off-by: Tom Rini <[email protected]> Reviewed-by: Simon Glass <[email protected]>
2023-01-16arm: rockchip: Add grf header for rv1126Jagan Teki
Add GRF header for Rockchip RV1126. Signed-off-by: Jagan Teki <[email protected]> Reviewed-by: Kever Yang <[email protected]>
2023-01-16arch: rockchip: Add cru header for rv1126Jagan Teki
Add clock and reset unit header include for rv1126. Signed-off-by: Jagan Teki <[email protected]> Reviewed-by: Kever Yang <[email protected]>
2023-01-16ram: rockchip: Add rv1126 ddr driver supportJagan Teki
Add DDR driver for Rockchip RV1126 SoC. Signed-off-by: YouMin Chen <[email protected]> Signed-off-by: Jagan Teki <[email protected]> Reviewed-by: Kever Yang <[email protected]>
2023-01-16ram: rockchip: Update ddr pctl regs for px30Jagan Teki
Add full ddr pctl registers and bit masks for px30. Signed-off-by: YouMin Chen <[email protected]> Signed-off-by: Jagan Teki <[email protected]> Reviewed-by: Kever Yang <[email protected]>
2023-01-16ram: rockchip: Compute ddr capacity based on grf splitJagan Teki
DDR chip capacity is computed based on GRF split in some Rockchip SoC's like PX30 and RV1126. Add split argument in ddr print info so-that the respective ddr driver will pass the grf split. Signed-off-by: YouMin Chen <[email protected]> Signed-off-by: Jagan Teki <[email protected]> Reviewed-by: Kever Yang <[email protected]>
2022-12-23global: Migrate CONFIG_IRAM_BASE to CFGTom Rini
Perform a simple rename of CONFIG_IRAM_BASE to CFG_IRAM_BASE Signed-off-by: Tom Rini <[email protected]>
2022-12-19rockpi4: board: Add firmware image information for capsule updatesSughosh Ganu
Add information that will be needed for enabling the UEFI capsule update feature on the RockPi4 boards. With the feature enabled, it would be possible to update the idbloader and u-boot.itb images on the RockPi4B and RockPi4C variants. Signed-off-by: Sughosh Ganu <[email protected]> Reviewed-by: Kever Yang <[email protected]>
2022-10-19rockchip: px30: support debug uart on UART0Quentin Schulz
UART0 can obviously also be used for debug uart in U-Boot, so let's add its support. Cc: Quentin Schulz <[email protected]> Signed-off-by: Quentin Schulz <[email protected]> Reviewed-by: Kever Yang <[email protected]>