aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeng Fan <peng.fan@nxp.com>2023-01-31 16:42:22 +0800
committerStefano Babic <sbabic@denx.de>2023-03-29 20:15:42 +0200
commit90e43bc136facb5ea965c40c878997d823f36257 (patch)
tree2e1433fa2021339acf24839dd475c9d7553b090b
parent4e08a510d23e2e23c8a776ccea582d0acd75fd4d (diff)
imx: imx8ulp: upower: replace magic number with macro
The swton indicates the logic switch, magic number 0xfff80 is hard to understand, so use macro. Some board design may not have MIPI_CSI voltage input connected per data sheet. In that case, the upower power on API may dead loop mu to wait response, however there is no response. So remove MIPI_CSI here, let linux power domain driver to runtime enable the power domain. Reviewed-by: Ye Li <ye.li@nxp.com> Signed-off-by: Peng Fan <peng.fan@nxp.com>
-rw-r--r--arch/arm/mach-imx/imx8ulp/upower/upower_hal.c22
1 files changed, 21 insertions, 1 deletions
diff --git a/arch/arm/mach-imx/imx8ulp/upower/upower_hal.c b/arch/arm/mach-imx/imx8ulp/upower/upower_hal.c
index b6811d56c9..370685e9e1 100644
--- a/arch/arm/mach-imx/imx8ulp/upower/upower_hal.c
+++ b/arch/arm/mach-imx/imx8ulp/upower/upower_hal.c
@@ -11,6 +11,25 @@
#include "upower_api.h"
#define UPOWER_AP_MU1_ADDR 0x29280000
+
+#define PS_RTD BIT(0)
+#define PS_DSP BIT(1)
+#define PS_A35_0 BIT(2)
+#define PS_A35_1 BIT(3)
+#define PS_L2 BIT(4)
+#define PS_FAST_NIC BIT(5)
+#define PS_APD_PERIPH BIT(6)
+#define PS_GPU3D BIT(7)
+#define PS_HIFI4 BIT(8)
+#define PS_DDR GENMASK(12, 9)
+#define PS_PXP_EPDC BIT(13)
+#define PS_MIPI_DSI BIT(14)
+#define PS_MIPI_CSI BIT(15)
+#define PS_NIC_LPAV BIT(16)
+#define PS_FUSION_AO BIT(17)
+#define PS_FUSE BIT(18)
+#define PS_UPOWER BIT(19)
+
static struct mu_type *muptr = (struct mu_type *)UPOWER_AP_MU1_ADDR;
void upower_wait_resp(void)
@@ -140,7 +159,8 @@ int upower_init(void)
}
} while (0);
- swton = 0xfff80;
+ swton = PS_UPOWER | PS_FUSE | PS_FUSION_AO | PS_NIC_LPAV | PS_PXP_EPDC | PS_DDR |
+ PS_HIFI4 | PS_GPU3D | PS_MIPI_DSI;
ret = upwr_pwm_power_on(&swton, NULL, NULL);
if (ret)
printf("Turn on switches fail %d\n", ret);