u-boot/drivers/pinctrl/rockchip
Jonas Karlman 63348d61a8 pinctrl: rockchip: Fix Data Abort exception in SPL
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: e7ae4cf27a ("pinctrl: rockchip: Add common rockchip pinctrl driver")
Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2023-06-29 18:42:58 +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 IO mux selection on RK3568 2023-04-21 15:16:01 +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