From b8a05116ed2a87a9689c4f9be6218a4bce88034a Mon Sep 17 00:00:00 2001 From: Shelley Chen Date: Fri, 1 Oct 2021 18:34:07 -0700 Subject: [PATCH] feat(plat/qti/sc7280): add support for pmk7325 The qti sc7280 platform uses the pmk7325 PMIC, which has the same functionality as the pm8998 driver, with the exception of the LC PON register offsets, which are defined as: Since it is nearly identical to the pm8998 driver, moving the above register offset definitions to platform_def.h for the respective SoC and reusing the rest of the functions defined in the pm8998 driver. Renaming pm8998 driver to pm_ps_hold to make it more generic. Change-Id: I0dda3a54579e0bbdd42c247405362a86d0607478 Signed-off-by: Shelley Chen --- plat/qti/common/src/{pm8998.c => pm_ps_hold.c} | 2 -- plat/qti/sc7180/inc/platform_def.h | 5 +++++ plat/qti/sc7180/platform.mk | 2 +- plat/qti/sc7280/inc/platform_def.h | 5 +++++ plat/qti/sc7280/platform.mk | 2 +- 5 files changed, 12 insertions(+), 4 deletions(-) rename plat/qti/common/src/{pm8998.c => pm_ps_hold.c} (92%) diff --git a/plat/qti/common/src/pm8998.c b/plat/qti/common/src/pm_ps_hold.c similarity index 92% rename from plat/qti/common/src/pm8998.c rename to plat/qti/common/src/pm_ps_hold.c index b189a8b86..208345cc1 100644 --- a/plat/qti/common/src/pm8998.c +++ b/plat/qti/common/src/pm_ps_hold.c @@ -14,11 +14,9 @@ * include other part numbers like PM6150. */ -#define PON_PS_HOLD_RESET_CTL 0x85a #define RESET_TYPE_WARM_RESET 1 #define RESET_TYPE_SHUTDOWN 4 -#define PON_PS_HOLD_RESET_CTL2 0x85b #define S2_RESET_EN BIT(7) static void configure_ps_hold(uint32_t reset_type) diff --git a/plat/qti/sc7180/inc/platform_def.h b/plat/qti/sc7180/inc/platform_def.h index b0798a63f..e3dc81108 100644 --- a/plat/qti/sc7180/inc/platform_def.h +++ b/plat/qti/sc7180/inc/platform_def.h @@ -190,5 +190,10 @@ #define QTI_SOC_REVISION_REG 0x1FC8000 #define QTI_SOC_REVISION_MASK U(0xFFFF) /*----------------------------------------------------------------------------*/ +/* LC PON register offsets */ +/*----------------------------------------------------------------------------*/ +#define PON_PS_HOLD_RESET_CTL 0x85a +#define PON_PS_HOLD_RESET_CTL2 0x85b +/*----------------------------------------------------------------------------*/ #endif /* PLATFORM_DEF_H */ diff --git a/plat/qti/sc7180/platform.mk b/plat/qti/sc7180/platform.mk index ec560d036..141e2c39f 100644 --- a/plat/qti/sc7180/platform.mk +++ b/plat/qti/sc7180/platform.mk @@ -51,7 +51,7 @@ QTI_BL31_SOURCES := $(QTI_PLAT_PATH)/common/src/$(ARCH)/qti_helpers.S \ $(QTI_PLAT_PATH)/common/src/$(ARCH)/qti_kryo4_silver.S \ $(QTI_PLAT_PATH)/common/src/$(ARCH)/qti_kryo4_gold.S \ $(QTI_PLAT_PATH)/common/src/$(ARCH)/qti_uart_console.S \ - $(QTI_PLAT_PATH)/common/src/pm8998.c \ + $(QTI_PLAT_PATH)/common/src/pm_ps_hold.c \ $(QTI_PLAT_PATH)/common/src/qti_stack_protector.c \ $(QTI_PLAT_PATH)/common/src/qti_common.c \ $(QTI_PLAT_PATH)/common/src/qti_bl31_setup.c \ diff --git a/plat/qti/sc7280/inc/platform_def.h b/plat/qti/sc7280/inc/platform_def.h index 660cb33a7..da7eddc7a 100644 --- a/plat/qti/sc7280/inc/platform_def.h +++ b/plat/qti/sc7280/inc/platform_def.h @@ -190,5 +190,10 @@ #define QTI_SOC_REVISION_REG 0x1FC8000 #define QTI_SOC_REVISION_MASK U(0xFFFF) /*----------------------------------------------------------------------------*/ +/* LC PON register offsets */ +/*----------------------------------------------------------------------------*/ +#define PON_PS_HOLD_RESET_CTL 0x852 +#define PON_PS_HOLD_RESET_CTL2 0x853 +/*----------------------------------------------------------------------------*/ #endif /* PLATFORM_DEF_H */ diff --git a/plat/qti/sc7280/platform.mk b/plat/qti/sc7280/platform.mk index 6e267816a..bc2c2210c 100644 --- a/plat/qti/sc7280/platform.mk +++ b/plat/qti/sc7280/platform.mk @@ -51,7 +51,7 @@ QTI_BL31_SOURCES := $(QTI_PLAT_PATH)/common/src/$(ARCH)/qti_helpers.S \ $(QTI_PLAT_PATH)/common/src/$(ARCH)/qti_kryo6_silver.S \ $(QTI_PLAT_PATH)/common/src/$(ARCH)/qti_kryo6_gold.S \ $(QTI_PLAT_PATH)/common/src/$(ARCH)/qti_uart_console.S \ - $(QTI_PLAT_PATH)/common/src/pm8998.c \ + $(QTI_PLAT_PATH)/common/src/pm_ps_hold.c \ $(QTI_PLAT_PATH)/common/src/qti_stack_protector.c \ $(QTI_PLAT_PATH)/common/src/qti_common.c \ $(QTI_PLAT_PATH)/common/src/qti_bl31_setup.c \