summaryrefslogtreecommitdiff
path: root/drivers/pinctrl/rockchip
AgeCommit message (Collapse)Author
2026-03-10pinctrl: rockchip: Add support for RK3506Ye Zhang
Add pinctrl driver for RK3506. Imported from vendor U-Boot linux-6.1-stan-rkr6 tag with adjustments to use regmap_update_bits(). Signed-off-by: Ye Zhang <[email protected]> Signed-off-by: Jonas Karlman <[email protected]> Tested-by: Aaron Griffith <[email protected]> Reviewed-by: Kever Yang <[email protected]>
2026-03-10pinctrl: rockchip: Use syscon_regmap_lookup_by_phandle()Jonas Karlman
Use syscon_regmap_lookup_by_phandle() to simplify the code. Signed-off-by: Jonas Karlman <[email protected]> Reviewed-by: Kever Yang <[email protected]> Reviewed-by: Quentin Schulz <[email protected]>
2025-05-06pinctrl: rockchip: constify rockchip_pin_ctrl for RV1108Quentin Schulz
There's no need to modify private data from the controller, so let's make that struct const. Signed-off-by: Quentin Schulz <[email protected]> Reviewed-by: Kever Yang <[email protected]>
2025-05-06pinctrl: rockchip: constify rockchip_pin_ctrl for RK3399Quentin Schulz
There's no need to modify private data from the controller, so let's make that struct const. Signed-off-by: Quentin Schulz <[email protected]> Reviewed-by: Kever Yang <[email protected]>
2025-05-06pinctrl: rockchip: constify rockchip_pin_ctrl for RK3368Quentin Schulz
There's no need to modify private data from the controller, so let's make that struct const. Signed-off-by: Quentin Schulz <[email protected]> Reviewed-by: Kever Yang <[email protected]>
2025-05-06pinctrl: rockchip: constify rockchip_pin_ctrl for RK3328Quentin Schulz
There's no need to modify private data from the controller, so let's make that struct const. Signed-off-by: Quentin Schulz <[email protected]> Reviewed-by: Kever Yang <[email protected]>
2025-05-06pinctrl: rockchip: constify rockchip_pin_ctrl for RK3308Quentin Schulz
There's no need to modify private data from the controller, so let's make that struct const. Signed-off-by: Quentin Schulz <[email protected]> Reviewed-by: Kever Yang <[email protected]>
2025-05-06pinctrl: rockchip: constify rockchip_pin_ctrl for RK3288Quentin Schulz
There's no need to modify private data from the controller, so let's make that struct const. Signed-off-by: Quentin Schulz <[email protected]> Reviewed-by: Kever Yang <[email protected]>
2025-05-06pinctrl: rockchip: constify rockchip_pin_ctrl for RK3228Quentin Schulz
There's no need to modify private data from the controller, so let's make that struct const. Signed-off-by: Quentin Schulz <[email protected]> Reviewed-by: Kever Yang <[email protected]>
2025-05-06pinctrl: rockchip: constify rockchip_pin_ctrl for RK3188Quentin Schulz
There's no need to modify private data from the controller, so let's make that struct const. Signed-off-by: Quentin Schulz <[email protected]> Reviewed-by: Kever Yang <[email protected]>
2025-05-06pinctrl: rockchip: constify rockchip_pin_ctrl for RK3128Quentin Schulz
There's no need to modify private data from the controller, so let's make that struct const. Signed-off-by: Quentin Schulz <[email protected]> Reviewed-by: Kever Yang <[email protected]>
2025-05-06pinctrl: rockchip: constify rockchip_pin_ctrl for RK3066Quentin Schulz
There's no need to modify private data from the controller, so let's make that struct const. Signed-off-by: Quentin Schulz <[email protected]> Reviewed-by: Kever Yang <[email protected]>
2025-05-06pinctrl: rockchip: constify rockchip_pin_ctrl for RK3036Quentin Schulz
There's no need to modify private data from the controller, so let's make that struct const. Signed-off-by: Quentin Schulz <[email protected]> Reviewed-by: Kever Yang <[email protected]>
2025-05-06pinctrl: rockchip: constify rockchip_pin_ctrl for PX30Quentin Schulz
There's no need to modify private data from the controller, so let's make that struct const. Signed-off-by: Quentin Schulz <[email protected]> Reviewed-by: Kever Yang <[email protected]>
2025-05-06pinctrl: rockchip: fix bank's pin_base computingQuentin Schulz
The logic in the core reads the nr_pins of the controller and uses it as the index of the first pin in the bank (pin_base) it currently parses. It then increments the number of pins in the controller before going to the next bank. This works "fine" for controllers where nr_pins isn't defined in their rockchip_pin_ctrl struct as it defaults to 0. However, when it is already set, it'll make the index pin of each bank offset by the number in nr_pins declared in the struct at initialization, and it'll keep growing while adding banks, which means the total number of pins in the controller will be misrepresented. Additionally, U-Boot proper may probe this driver twice (pre-reloc and true proper) and not reset nr_pins of the controller in-between meaning the second probe will have an offset of the actual correct nr_pins. Instead, let's just store locally the number of pins in the controller and make sure it's reset between probes. Finally, this stops modifying a const struct which will soon be triggering a CPU abort at runtime. Signed-off-by: Quentin Schulz <[email protected]> Reviewed-by: Kever Yang <[email protected]>
2025-04-23pinctrl: rockchip: support rk3576 pinctrlSteven Liu
Add support for the rk3576 variant of pinctrl. Signed-off-by: Steven Liu <[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-23pinctrl: rockchip: Add support for RK3528Steven Liu
Add pinctrl driver for RK3528. Imported from vendor U-Boot linux-6.1-stan-rkr5 tag with adjustments to use regmap_update_bits(). Signed-off-by: Steven Liu <[email protected]> Signed-off-by: Jonas Karlman <[email protected]> Reviewed-by: Kever Yang <[email protected]>
2025-02-19pinctrl: rockchip: rk3328: Fix pinmux for GPIO2-B and GPIO3-B pinsJonas Karlman
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 <[email protected]> Reviewed-by: Kever Yang <[email protected]>
2024-11-11pinctrl: rockchip: allow to build for TPLQuentin Schulz
A later commit will make use of the pinctrl driver in TPL so let's add the ability to build the Rockchip pinctrl driver in TPL. Reviewed-by: Paul Kocialkowski <[email protected]> Signed-off-by: Quentin Schulz <[email protected]> Reviewed-by: Kever Yang <[email protected]>
2024-06-24Merge tag 'v2024.07-rc5' into nextTom Rini
Prepare v2024.07-rc5
2024-06-14pinctrl: rockchip: rk3588: Fix support for rockchip_get_mux()Jonas Karlman
GPIO IOMUX control is located at PMU2_IOC or BUS_IOC offset on RK3588. Based on Linux commit fdc33eba11c5 ("pinctrl/rockchip: add rk3588 support"). Compared to the Linux commit, this include a fix so that the iomux of GPIO0_B4-D7 is reported correctly. Signed-off-by: Jonas Karlman <[email protected]> Reviewed-by: Kever Yang <[email protected]>
2024-06-14pinctrl: rockchip: rv1126: Fix support for IOMUX_L_SOURCE_PMU flagJonas Karlman
GPIO0_C0-C4 iomux is set using PMUGRF_GPIO0C_IOMUX_L reg on RV1126. This is indicated using the IOMUX_L_SOURCE_PMU flag. Fix reading current mux by fully adopting the IOMUX_L_SOURCE_PMU related code in Linux kernel. Based on Linux commit fd4ea48688c6 ("pinctrl: rockchip: Add RV1126 pinctrl support"). Signed-off-by: Jonas Karlman <[email protected]> Reviewed-by: Kever Yang <[email protected]>
2024-06-14pinctrl: rockchip: rk3188: Fix support for IOMUX_GPIO_ONLY flagJonas Karlman
GPIO0_A0-A7 on RK3188 is IOMUX_GPIO_ONLY, however, trying to set gpio mux return an -ENOTSUPP error code. Fix this by validating using the mux function type and not the iomux flag. Based on Linux commit c4a532dee6b6 ("pinctrl: rockchip: handle first half of rk3188-bank0 correctly"). Signed-off-by: Jonas Karlman <[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-07pinctrl: Remove <common.h> and add needed includesTom Rini
Remove <common.h> from this driver directory and when needed add missing include files directly. Reviewed-by: Peter Robinson <[email protected]> Signed-off-by: Tom Rini <[email protected]>
2023-08-14pinctrl: rockchip: Fix drive and input schmitt on RK3568Jonas Karlman
On RK3568 most pins have a configurable drive strength of level 0-5 and some pins level 0-11. When rk3568_set_drive is called with a strength value above 7 the drv value written to reg may overflow into the write enable bits, resulting in a bad configuration. This cause e.g. ethernet PHY on Radxa CM3-IO board not to work after drive is configured according to the device tree. Could not get PHY for ethernet@fe010000: addr 0 Level 6-11 can be configured using a second reg for some pins, however the drv value is reused resulting in lower 6 bits being written to reg. Input schmitt is configured in 2-bit fields on RK3568 compared to earlier generation and 2'b10 should be used to enable input schmitt. Change to use regmap_update_bits with a rmask to fix the overflow issue and closer match the linux driver. Bit shift the drv value used for the second reg to configure drive strength level 6-11. Also write correct values for input schmitt setting. Fixes: 1977d746aa54 ("rockchip: rk3568: add rk3568 pinctrl driver") Signed-off-by: Jonas Karlman <[email protected]> Reviewed-by: Simon Glass <[email protected]> Reviewed-by: Kever Yang <[email protected]>
2023-06-29pinctrl: rockchip: Fix Data Abort exception in SPLJonas Karlman
Using CONFIG_ARMV8_SPL_EXCEPTION_VECTORS=y and CONFIG_OF_LIVE=y triggers a Data Abort exception from unaligned memory access when the pinctrl driver iterate node properties, e.g. for UART2 on RK3568. setting mux of GPIO0-24 to 1 setting mux of GPIO0-24 to 1 "Synchronous Abort" handler, esr 0x96000021 elr: 000000000000e554 lr : 000000000000e54c x 0: 0000000000000a5c x 1: 0000000000000a5c x 2: 0000000000000007 x 3: 0000000000000065 x 4: 0000000000000007 x 5: 0000000000022d4e x 6: 0000000000000a7c x 7: 00000000000227a4 x 8: 0000000000021cf0 x 9: 0000000000000a7c x10: 0000000000021cf0 x11: 0000000000021cf0 x12: 00000000003fda1c x13: 0000000000000007 x14: 00000000003fd9ec x15: 000000000001c0ff x16: 0000000007000000 x17: 00000000fdccd028 x18: 00000000003fde20 x19: 0000000000000018 x20: 0000000000020670 x21: 0000000000000000 x22: 00000000003fdb00 x23: 00000000003fef90 x24: 0000000000020688 x25: 0000000000000000 x26: 0000000000000001 x27: 00000000003ffc50 x28: 0000000000000000 x29: 00000000003fda60 Code: b94083e1 97ffd508 93407c01 37f81260 (f9401038) Resetting CPU ... Fix this by replacing the loop to access node properties with use of ofnode_for_each_prop instead of the current ifdef. Also continue to next prop instead of aborting at first sign of an unknown property. This fixes the Data Abort exception and also pinconf of e.g. pull and drive in SPL, e.g. for UART2 on RK3568. setting mux of GPIO0-24 to 1 setting mux of GPIO0-24 to 1 setting pull of GPIO0-24 to 5 setting mux of GPIO0-25 to 1 setting mux of GPIO0-25 to 1 setting pull of GPIO0-25 to 5 Fixes: e7ae4cf27a6d ("pinctrl: rockchip: Add common rockchip pinctrl driver") Signed-off-by: Jonas Karlman <[email protected]> Reviewed-by: Kever Yang <[email protected]>
2023-04-21pinctrl: rockchip: Fix IO mux selection on RK3568Jonas Karlman
IO mux selection is not working correctly for all pins. Sync mux route data from linux to add any missing and update wrong trigger pins to fix this. Also apply the pull-up fix needed for GPIO0 D3-D6. Fixes: 1977d746aa54 ("rockchip: rk3568: add rk3568 pinctrl driver") Signed-off-by: Jonas Karlman <[email protected]>
2023-04-21pinctrl: rockchip: support rk3588 pinctrlJianqun Xu
Add support for Rockchip rk3588 variant of pinctrl. The driver is adapted from the Linux driver. Signed-off-by: Jianqun Xu <[email protected]> [[email protected]: port to latest U-boot, bring more changes from Linux use translated pull values table] Signed-off-by: Eugen Hristev <[email protected]> Reviewed-by: Kever Yang <[email protected]> Tested-by: Jonas Karlman <[email protected]> Reviewed-by: Jonas Karlman <[email protected]>
2023-02-28rockchip: rk3568: add rk3568 pinctrl driverJagan Teki
Add driver supporting pin multiplexing on rk3568 platform. Co-developed-by: Manoj Sai <[email protected]> Signed-off-by: Manoj Sai <[email protected]> Co-developed-by: Jianqun Xu <[email protected]> Signed-off-by: Jianqun Xu <[email protected]> Signed-off-by: Jagan Teki <[email protected]> Reviewed-by: Kever Yang <[email protected]>
2023-01-16pinctrl: rockchip: Add rv1126 supportJagan Teki
Add pinctrl driver for Rockchip RV1126. Signed-off-by: Jianqun Xu <[email protected]> Signed-off-by: Jagan Teki <[email protected]> Reviewed-by: Kever Yang <[email protected]>
2023-01-16pinctrl: rockchip: Add pinctrl route typesJagan Teki
Some pins in rockchip are routed via Top GRF and PMU GRF instead of direct regmap. Add support to handle all these routing paths so that the SoC pinctrl drivers will use them accordingly. Signed-off-by: Jianqun Xu <[email protected]> Signed-off-by: Jagan Teki <[email protected]> Reviewed-by: Kever Yang <[email protected]>
2022-04-18rockchip: rk3066: add rk3066 pinctrl driverPaweł Jarosz
Add driver supporting pin multiplexing on rk3066 platform. Signed-off-by: PaweÅ‚ Jarosz <[email protected]> Signed-off-by: Johan Jonker <[email protected]> Reviewed-by: Kever Yang <[email protected]>
2021-09-25treewide: Use OF_REAL instead of !OF_PLATDATASimon Glass
Now that we have a 'positive' Kconfig option, use this instead of the negative one, which is harder to understand. Signed-off-by: Simon Glass <[email protected]>
2021-02-02common: Drop asm/global_data.h from common headerSimon Glass
Move this out of the common header and include it only where needed. In a number of cases this requires adding "struct udevice;" to avoid adding another large header or in other cases replacing / adding missing header files that had been pulled in, very indirectly. Finally, we have a few cases where we did not need to include <asm/global_data.h> at all, so remove that include. Signed-off-by: Simon Glass <[email protected]> Signed-off-by: Tom Rini <[email protected]>
2020-12-13dm: treewide: Rename auto_alloc_size members to be shorterSimon Glass
This construct is quite long-winded. In earlier days it made some sense since auto-allocation was a strange concept. But with driver model now used pretty universally, we can shorten this to 'auto'. This reduces verbosity and makes it easier to read. Coincidentally it also ensures that every declaration is on one line, thus making dtoc's job easier. Signed-off-by: Simon Glass <[email protected]>
2020-07-09drivers: rename drivers to match compatible stringWalter Lozano
When using OF_PLATDATA, the bind process between devices and drivers is performed trying to match compatible string with driver names. However driver names are not strictly defined, and also there are different names used when declaring a driver with U_BOOT_DRIVER, the name of the symbol used in the linker list and the used in the struct driver_info. In order to make things a bit more clear, rename the drivers names. This will also help for further OF_PLATDATA improvements, such as checking for valid driver names. Signed-off-by: Walter Lozano <[email protected]> Reviewed-by: Simon Glass <[email protected]> Add a fix for sandbox of-platdata to avoid using an invalid ANSI colour: Signed-off-by: Simon Glass <[email protected]>
2020-05-18common: Drop linux/bitops.h from common headerSimon Glass
Move this uncommon header out of the common header. Signed-off-by: Simon Glass <[email protected]>
2020-05-18common: Drop log.h from common headerSimon Glass
Move this header out of the common header. Signed-off-by: Simon Glass <[email protected]>
2020-05-18common: Drop image.h from common headerSimon Glass
Move this uncommon header out of the common header. Signed-off-by: Simon Glass <[email protected]>
2019-12-06pinctrl: rockchip: Add pinctrl support for rk3308David Wu
An iomux register contains 8 pins, each of which is represented by 2 bits, but the register offset is 0x8. For example, GRF_GPIO0A_IOMUX offset is 0x0, but GRF_GPIO0B_IOMUX offset is 0x8, the offset 0x4 is reserved. So add a type IOMUX_8WIDTH_2BIT to calculate offset. Signed-off-by: David Wu <[email protected]> Reviewed-by: Kever Yang <[email protected]>
2019-11-17pinctrl: rockchip: add px30 pinctrl driverDavid Wu
Add the necessary glue code to allow pinctrl setting on px30 socs. Signed-off-by: David Wu <[email protected]> Signed-off-by: Heiko Stuebner <[email protected]> Reviewed-by: Kever Yang <[email protected]>
2019-05-08pinctrl: rockchip: Also move common set_schmitter func into per Soc fileDavid Wu
Only some Soc need Schmitter feature, so move the implementation into their own files. Signed-off-by: David Wu <[email protected]> Signed-off-by: Kever Yang <[email protected]>
2019-05-08pinctrl: rockchip: Clean the unused type and labelDavid Wu
As the mux/pull/drive feature implement at own file, the type and label are not necessary. Signed-off-by: David Wu <[email protected]> Signed-off-by: Kever Yang <[email protected]>
2019-05-08pinctrl: rockchip: Special treatment for RK3288 gpio0 pins' pullDavid Wu
RK3288 pmu_gpio0 pull setting have no higher 16 writing corresponding bits, need to read before write the register. Signed-off-by: David Wu <[email protected]> Signed-off-by: Kever Yang <[email protected]>
2019-05-08pinctrl: rockchip: Split the common set_pull() func into per SocDavid Wu
As the common set_mux func(), implement the feature at the own file for each Soc. Signed-off-by: David Wu <[email protected]> Signed-off-by: Kever Yang <[email protected]>
2019-05-08pinctrl: rockchip: Special treatment for RK3288 gpio0 pins' drive strengthDavid Wu
RK3288 pmu_gpio0 drive strength setting have no higher 16 writing corresponding bits, need to read before write the register. Signed-off-by: David Wu <[email protected]> Signed-off-by: Kever Yang <[email protected]>
2019-05-08pinctrl: rockchip: Split the common set_drive() func into per SocDavid Wu
As the common set_mux func(), implement the feature at the own file for each Soc. Signed-off-by: David Wu <[email protected]> Signed-off-by: Kever Yang <[email protected]>
2019-05-08pinctrl: rockchip: Special treatment for RK3288 gpio0 pins' iomuxDavid Wu
RK3288 pmu_gpio0 iomux setting have no higher 16 writing corresponding bits, need to read before write the register. Signed-off-by: David Wu <[email protected]> Signed-off-by: Kever Yang <[email protected]>