u-boot/drivers/pinctrl/rockchip
Jonas Karlman d7009faa09 pinctrl: rockchip: Fix drive and input schmitt on RK3568
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: 1977d746aa ("rockchip: rk3568: add rk3568 pinctrl driver")
Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2023-08-14 11:07:27 +08:00
..
Kconfig pinctrl: rockchip: Add common rockchip pinctrl driver 2019-02-01 16:59:11 +01:00
Makefile pinctrl: rockchip: support rk3588 pinctrl 2023-04-21 15:16:00 +08:00
pinctrl-px30.c pinctrl: rockchip: Add pinctrl route types 2023-01-16 18:01:11 +08:00
pinctrl-rk322x.c pinctrl: rockchip: Add pinctrl route types 2023-01-16 18:01:11 +08:00
pinctrl-rk3036.c treewide: Use OF_REAL instead of !OF_PLATDATA 2021-09-25 09:46:15 -06:00
pinctrl-rk3066.c rockchip: rk3066: add rk3066 pinctrl driver 2022-04-18 11:25:13 +08:00
pinctrl-rk3128.c pinctrl: rockchip: Add pinctrl route types 2023-01-16 18:01:11 +08:00
pinctrl-rk3188.c treewide: Use OF_REAL instead of !OF_PLATDATA 2021-09-25 09:46:15 -06:00
pinctrl-rk3288.c pinctrl: rockchip: Add pinctrl route types 2023-01-16 18:01:11 +08:00
pinctrl-rk3308.c pinctrl: rockchip: Add pinctrl route types 2023-01-16 18:01:11 +08:00
pinctrl-rk3328.c pinctrl: rockchip: Add pinctrl route types 2023-01-16 18:01:11 +08:00
pinctrl-rk3368.c treewide: Use OF_REAL instead of !OF_PLATDATA 2021-09-25 09:46:15 -06:00
pinctrl-rk3399.c pinctrl: rockchip: Add pinctrl route types 2023-01-16 18:01:11 +08:00
pinctrl-rk3568.c pinctrl: rockchip: Fix drive and input schmitt on RK3568 2023-08-14 11:07:27 +08:00
pinctrl-rk3588.c pinctrl: rockchip: support rk3588 pinctrl 2023-04-21 15:16:00 +08:00
pinctrl-rockchip-core.c pinctrl: rockchip: Fix Data Abort exception in SPL 2023-06-29 18:42:58 +08:00
pinctrl-rockchip.h pinctrl: rockchip: support rk3588 pinctrl 2023-04-21 15:16:00 +08:00
pinctrl-rv1108.c treewide: Use OF_REAL instead of !OF_PLATDATA 2021-09-25 09:46:15 -06:00
pinctrl-rv1126.c pinctrl: rockchip: Add rv1126 support 2023-01-16 18:01:11 +08:00