rockchip: rv1126: init the i2c0 iomux

Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
Change-Id: I0d9854f3d22eaa42fb3a196cc58d429339532f1e
This commit is contained in:
Jason Zhu 2020-09-28 11:26:52 +08:00 committed by Jianhong Chen
parent c90ee5c73d
commit a0c4f82828
1 changed files with 11 additions and 0 deletions

View File

@ -102,6 +102,9 @@ DECLARE_GLOBAL_DATA_PTR;
#define OTP_S_BASE 0xFF5D0000
#define OTP_NVM_TRWH 0x28
#define PMU_GRF_BASE 0xFE020000
#define PMUGRF_GPIO0B_IOMUX_H 0xc
enum {
GPIO1A7_SHIFT = 12,
GPIO1A7_MASK = GENMASK(14, 12),
@ -672,6 +675,14 @@ int arch_cpu_init(void)
/* enable dynamic priority */
writel(0x1, ISP_PRIORITY_EX_REG);
/*
* Init the i2c0 iomux and use it to control electronic voltmeter
* to detect voltage.
*/
#if defined(CONFIG_SPL_KERNEL_BOOT) && defined(CONFIG_SPL_DM_FUEL_GAUGE)
writel(0x00770011, PMU_GRF_BASE + PMUGRF_GPIO0B_IOMUX_H);
#endif
#elif defined(CONFIG_SUPPORT_USBPLUG)
/* Just set region 0 to unsecure */
writel(0, FIREWALL_APB_BASE + FW_DDR_CON_REG);