Loading arch/arm64/configs/vendor/lahaina_GKI.config +3 −0 Original line number Diff line number Diff line Loading @@ -80,6 +80,9 @@ CONFIG_QRTR_MHI=m CONFIG_QSEE_IPC_IRQ_BRIDGE=m CONFIG_SENSORS_SSC=m CONFIG_POWER_RESET_MSM=m CONFIG_POWER_RESET_QCOM_DOWNLOAD_MODE=m CONFIG_POWER_RESET_QCOM_DOWNLOAD_MODE_DEFAULT=y CONFIG_POWER_RESET_QCOM_REBOOT_REASON=m CONFIG_QCOM_FORCE_WDOG_BITE_ON_PANIC=y CONFIG_MSM_SUBSYSTEM_RESTART=m CONFIG_SETUP_SSR_NOTIF_TIMEOUTS=y Loading drivers/firmware/qcom_scm-smc.c +13 −0 Original line number Diff line number Diff line Loading @@ -1919,6 +1919,19 @@ int __qcom_scm_tsens_reinit(struct device *dev, int *tsens_ret) return ret; } int __qcom_scm_reboot(struct device *dev) { struct qcom_scm_desc desc = { .svc = QCOM_SCM_SVC_OEM_POWER, .cmd = QCOM_SCM_OEM_POWER_REBOOT, .owner = ARM_SMCCC_OWNER_OEM, }; desc.arginfo = QCOM_SCM_ARGS(0); return qcom_scm_call_atomic(dev, &desc); } int __qcom_scm_ice_restore_cfg(struct device *dev) { struct qcom_scm_desc desc = { Loading drivers/firmware/qcom_scm.c +24 −0 Original line number Diff line number Diff line Loading @@ -13,6 +13,7 @@ #include <linux/of.h> #include <linux/of_address.h> #include <linux/of_platform.h> #include <linux/reboot.h> #include <linux/clk.h> #include <linux/reset-controller.h> #include <soc/qcom/qseecom_scm.h> Loading @@ -30,6 +31,7 @@ struct qcom_scm { struct clk *iface_clk; struct clk *bus_clk; struct reset_controller_dev reset; struct notifier_block restart_nb; u64 dload_mode_addr; }; Loading Loading @@ -992,6 +994,17 @@ bool qcom_scm_is_available(void) } EXPORT_SYMBOL(qcom_scm_is_available); static int qcom_scm_do_restart(struct notifier_block *this, unsigned long event, void *ptr) { struct qcom_scm *scm = container_of(this, struct qcom_scm, restart_nb); if (reboot_mode == REBOOT_WARM) __qcom_scm_reboot(scm->dev); return NOTIFY_OK; } static int qcom_scm_find_dload_address(struct device *dev, u64 *addr) { struct device_node *tcsr; Loading Loading @@ -1085,6 +1098,10 @@ static int qcom_scm_probe(struct platform_device *pdev) if (ret) return ret; scm->restart_nb.notifier_call = qcom_scm_do_restart; scm->restart_nb.priority = 130; register_restart_handler(&scm->restart_nb); __scm = scm; __scm->dev = &pdev->dev; Loading @@ -1097,6 +1114,12 @@ static int qcom_scm_probe(struct platform_device *pdev) return 0; } static void qcom_scm_shutdown(struct platform_device *pdev) { qcom_scm_disable_sdi(); qcom_scm_halt_spmi_pmic_arbiter(); } static const struct of_device_id qcom_scm_dt_match[] = { { .compatible = "qcom,scm-apq8064", /* FIXME: This should have .data = (void *) SCM_HAS_CORE_CLK */ Loading Loading @@ -1127,6 +1150,7 @@ static struct platform_driver qcom_scm_driver = { .of_match_table = qcom_scm_dt_match, }, .probe = qcom_scm_probe, .shutdown = qcom_scm_shutdown, }; static int __init qcom_scm_init(void) Loading drivers/firmware/qcom_scm.h +5 −0 Original line number Diff line number Diff line Loading @@ -235,6 +235,11 @@ extern int __qcom_scm_qseecom_do(struct device *dev, u32 cmd_id, #define QCOM_SCM_TSENS_INIT_ID 0x5 extern int __qcom_scm_tsens_reinit(struct device *dev, int *tsens_ret); // OEM Services and Function IDs #define QCOM_SCM_SVC_OEM_POWER 0x09 #define QCOM_SCM_OEM_POWER_REBOOT 0x22 extern int __qcom_scm_reboot(struct device *dev); // TOS Services and Function IDs #define QCOM_SCM_SVC_QSEELOG 0x01 #define QCOM_SCM_QSEELOG_REGISTER 0x06 Loading drivers/power/reset/Kconfig +28 −0 Original line number Diff line number Diff line Loading @@ -105,6 +105,25 @@ config POWER_RESET_MSM help Power off and restart support for Qualcomm boards. config POWER_RESET_QCOM_DOWNLOAD_MODE tristate "MSM download mode driver" depends on ARCH_QCOM help MSM boards support booting to special download modes after a restart. These modes could be a normal restart, restarting into a ramdump collection mode (CrashDump), or restarting into "emergency download mode". config POWER_RESET_QCOM_DOWNLOAD_MODE_DEFAULT bool "MSM download mode enabled by default" help A device with "download mode" enabled will upon an unexpected warm-restart enter a special debug mode that allows the user to "download" memory content over USB for offline postmortem analysis. The feature can be enabled/disabled on the kernel command line. Say Y here to enable "download mode" by default. config POWER_RESET_QCOM_PON tristate "Qualcomm power-on driver" depends on ARCH_QCOM Loading @@ -116,6 +135,15 @@ config POWER_RESET_QCOM_PON power-on and reboot reason, Say Y. If unsure, Say N. config POWER_RESET_QCOM_REBOOT_REASON tristate "MSM reboot mode driver" depends on ARCH_QCOM help Support for setting reboot reason on MSM boards. This feature supports commands such as "reboot bootloader" to boot the MSM board to fastboot mode. If unsure, say Y. config POWER_RESET_OCELOT_RESET bool "Microsemi Ocelot reset driver" depends on MSCC_OCELOT || COMPILE_TEST Loading Loading
arch/arm64/configs/vendor/lahaina_GKI.config +3 −0 Original line number Diff line number Diff line Loading @@ -80,6 +80,9 @@ CONFIG_QRTR_MHI=m CONFIG_QSEE_IPC_IRQ_BRIDGE=m CONFIG_SENSORS_SSC=m CONFIG_POWER_RESET_MSM=m CONFIG_POWER_RESET_QCOM_DOWNLOAD_MODE=m CONFIG_POWER_RESET_QCOM_DOWNLOAD_MODE_DEFAULT=y CONFIG_POWER_RESET_QCOM_REBOOT_REASON=m CONFIG_QCOM_FORCE_WDOG_BITE_ON_PANIC=y CONFIG_MSM_SUBSYSTEM_RESTART=m CONFIG_SETUP_SSR_NOTIF_TIMEOUTS=y Loading
drivers/firmware/qcom_scm-smc.c +13 −0 Original line number Diff line number Diff line Loading @@ -1919,6 +1919,19 @@ int __qcom_scm_tsens_reinit(struct device *dev, int *tsens_ret) return ret; } int __qcom_scm_reboot(struct device *dev) { struct qcom_scm_desc desc = { .svc = QCOM_SCM_SVC_OEM_POWER, .cmd = QCOM_SCM_OEM_POWER_REBOOT, .owner = ARM_SMCCC_OWNER_OEM, }; desc.arginfo = QCOM_SCM_ARGS(0); return qcom_scm_call_atomic(dev, &desc); } int __qcom_scm_ice_restore_cfg(struct device *dev) { struct qcom_scm_desc desc = { Loading
drivers/firmware/qcom_scm.c +24 −0 Original line number Diff line number Diff line Loading @@ -13,6 +13,7 @@ #include <linux/of.h> #include <linux/of_address.h> #include <linux/of_platform.h> #include <linux/reboot.h> #include <linux/clk.h> #include <linux/reset-controller.h> #include <soc/qcom/qseecom_scm.h> Loading @@ -30,6 +31,7 @@ struct qcom_scm { struct clk *iface_clk; struct clk *bus_clk; struct reset_controller_dev reset; struct notifier_block restart_nb; u64 dload_mode_addr; }; Loading Loading @@ -992,6 +994,17 @@ bool qcom_scm_is_available(void) } EXPORT_SYMBOL(qcom_scm_is_available); static int qcom_scm_do_restart(struct notifier_block *this, unsigned long event, void *ptr) { struct qcom_scm *scm = container_of(this, struct qcom_scm, restart_nb); if (reboot_mode == REBOOT_WARM) __qcom_scm_reboot(scm->dev); return NOTIFY_OK; } static int qcom_scm_find_dload_address(struct device *dev, u64 *addr) { struct device_node *tcsr; Loading Loading @@ -1085,6 +1098,10 @@ static int qcom_scm_probe(struct platform_device *pdev) if (ret) return ret; scm->restart_nb.notifier_call = qcom_scm_do_restart; scm->restart_nb.priority = 130; register_restart_handler(&scm->restart_nb); __scm = scm; __scm->dev = &pdev->dev; Loading @@ -1097,6 +1114,12 @@ static int qcom_scm_probe(struct platform_device *pdev) return 0; } static void qcom_scm_shutdown(struct platform_device *pdev) { qcom_scm_disable_sdi(); qcom_scm_halt_spmi_pmic_arbiter(); } static const struct of_device_id qcom_scm_dt_match[] = { { .compatible = "qcom,scm-apq8064", /* FIXME: This should have .data = (void *) SCM_HAS_CORE_CLK */ Loading Loading @@ -1127,6 +1150,7 @@ static struct platform_driver qcom_scm_driver = { .of_match_table = qcom_scm_dt_match, }, .probe = qcom_scm_probe, .shutdown = qcom_scm_shutdown, }; static int __init qcom_scm_init(void) Loading
drivers/firmware/qcom_scm.h +5 −0 Original line number Diff line number Diff line Loading @@ -235,6 +235,11 @@ extern int __qcom_scm_qseecom_do(struct device *dev, u32 cmd_id, #define QCOM_SCM_TSENS_INIT_ID 0x5 extern int __qcom_scm_tsens_reinit(struct device *dev, int *tsens_ret); // OEM Services and Function IDs #define QCOM_SCM_SVC_OEM_POWER 0x09 #define QCOM_SCM_OEM_POWER_REBOOT 0x22 extern int __qcom_scm_reboot(struct device *dev); // TOS Services and Function IDs #define QCOM_SCM_SVC_QSEELOG 0x01 #define QCOM_SCM_QSEELOG_REGISTER 0x06 Loading
drivers/power/reset/Kconfig +28 −0 Original line number Diff line number Diff line Loading @@ -105,6 +105,25 @@ config POWER_RESET_MSM help Power off and restart support for Qualcomm boards. config POWER_RESET_QCOM_DOWNLOAD_MODE tristate "MSM download mode driver" depends on ARCH_QCOM help MSM boards support booting to special download modes after a restart. These modes could be a normal restart, restarting into a ramdump collection mode (CrashDump), or restarting into "emergency download mode". config POWER_RESET_QCOM_DOWNLOAD_MODE_DEFAULT bool "MSM download mode enabled by default" help A device with "download mode" enabled will upon an unexpected warm-restart enter a special debug mode that allows the user to "download" memory content over USB for offline postmortem analysis. The feature can be enabled/disabled on the kernel command line. Say Y here to enable "download mode" by default. config POWER_RESET_QCOM_PON tristate "Qualcomm power-on driver" depends on ARCH_QCOM Loading @@ -116,6 +135,15 @@ config POWER_RESET_QCOM_PON power-on and reboot reason, Say Y. If unsure, Say N. config POWER_RESET_QCOM_REBOOT_REASON tristate "MSM reboot mode driver" depends on ARCH_QCOM help Support for setting reboot reason on MSM boards. This feature supports commands such as "reboot bootloader" to boot the MSM board to fastboot mode. If unsure, say Y. config POWER_RESET_OCELOT_RESET bool "Microsemi Ocelot reset driver" depends on MSCC_OCELOT || COMPILE_TEST Loading