aboutsummaryrefslogtreecommitdiff
path: root/plat/allwinner/common
diff options
context:
space:
mode:
authorSamuel Holland <samuel@sholland.org>2020-12-13 22:34:10 -0600
committerSamuel Holland <samuel@sholland.org>2020-12-13 22:59:59 -0600
commit7060e0d891b9f9cccf46867de142e1808c61fd6d (patch)
tree11458baaac288bd5d4150913e00c6616a23c5d59 /plat/allwinner/common
parent4470298333d0e453d5ac2f9beb73b6a3787edcce (diff)
downloadtrusted-firmware-a-7060e0d891b9f9cccf46867de142e1808c61fd6d.tar.gz
allwinner: Use RSB for the PMIC connection on H6
RSB is faster and more efficient, and it has a simpler driver. As long as the PMIC is returned to I2C mode after use, the rich OS can later use either bus. Change-Id: I0c5f32e88a090c8c5cccb81bd24596b301ab9da7 Signed-off-by: Samuel Holland <samuel@sholland.org>
Diffstat (limited to 'plat/allwinner/common')
-rw-r--r--plat/allwinner/common/sunxi_common.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/plat/allwinner/common/sunxi_common.c b/plat/allwinner/common/sunxi_common.c
index 0ca18adc33..841fea81da 100644
--- a/plat/allwinner/common/sunxi_common.c
+++ b/plat/allwinner/common/sunxi_common.c
@@ -125,11 +125,9 @@ int sunxi_init_platform_r_twi(uint16_t socid, bool use_rsb)
device_bit = BIT(6);
break;
case SUNXI_SOC_H6:
- if (use_rsb)
- return -ENODEV;
- pin_func = 0x33;
+ pin_func = use_rsb ? 0x22 : 0x33;
device_bit = BIT(16);
- reset_offset = 0x19c;
+ reset_offset = use_rsb ? 0x1bc : 0x19c;
break;
case SUNXI_SOC_A64:
pin_func = use_rsb ? 0x22 : 0x33;
@@ -157,7 +155,7 @@ int sunxi_init_platform_r_twi(uint16_t socid, bool use_rsb)
if (socid != SUNXI_SOC_H6)
mmio_setbits_32(SUNXI_R_PRCM_BASE + 0x28, device_bit);
else
- mmio_setbits_32(SUNXI_R_PRCM_BASE + 0x19c, device_bit | BIT(0));
+ mmio_setbits_32(SUNXI_R_PRCM_BASE + reset_offset, BIT(0));
/* assert, then de-assert reset of I2C/RSB controller */
mmio_clrbits_32(SUNXI_R_PRCM_BASE + reset_offset, device_bit);