Loading drivers/soc/qcom/peripheral-loader.c +21 −7 Original line number Diff line number Diff line Loading @@ -53,9 +53,20 @@ #define MAX_LEN 96 #define NUM_OF_ENCRYPTED_KEY 3 #define pil_log(msg, desc) \ do { \ if (pil_ipc_log) \ pil_ipc("[%s]: %s", desc->name, msg); \ else \ trace_pil_event(msg, desc); \ } while (0) static void __iomem *pil_info_base; static struct md_global_toc *g_md_toc; void *pil_ipc_log; /** * proxy_timeout - Override for proxy vote timeouts * -1: Use driver-specified timeout Loading Loading @@ -1245,7 +1256,7 @@ int pil_boot(struct pil_desc *desc) goto release_fw; } trace_pil_event("before_init_image", desc); pil_log("before_init_image", desc); if (desc->ops->init_image) ret = desc->ops->init_image(desc, fw->data, fw->size); if (ret) { Loading @@ -1253,7 +1264,7 @@ int pil_boot(struct pil_desc *desc) goto err_boot; } trace_pil_event("before_mem_setup", desc); pil_log("before_mem_setup", desc); if (desc->ops->mem_setup) ret = desc->ops->mem_setup(desc, priv->region_start, priv->region_end - priv->region_start); Loading @@ -1269,7 +1280,7 @@ int pil_boot(struct pil_desc *desc) * Also for secure boot devices, modem memory has to be released * after MBA is booted */ trace_pil_event("before_assign_mem", desc); pil_log("before_assign_mem", desc); if (desc->modem_ssr) { ret = pil_assign_mem_to_linux(desc, priv->region_start, (priv->region_end - priv->region_start)); Loading @@ -1288,7 +1299,7 @@ int pil_boot(struct pil_desc *desc) hyp_assign = true; } trace_pil_event("before_load_seg", desc); pil_log("before_load_seg", desc); /** * Fallback to serial loading of blobs if the Loading @@ -1307,7 +1318,7 @@ int pil_boot(struct pil_desc *desc) } if (desc->subsys_vmid > 0) { trace_pil_event("before_reclaim_mem", desc); pil_log("before_reclaim_mem", desc); ret = pil_reclaim_mem(desc, priv->region_start, (priv->region_end - priv->region_start), desc->subsys_vmid); Loading @@ -1319,14 +1330,14 @@ int pil_boot(struct pil_desc *desc) hyp_assign = false; } trace_pil_event("before_auth_reset", desc); pil_log("before_auth_reset", desc); notify_before_auth_and_reset(desc->dev); ret = desc->ops->auth_and_reset(desc); if (ret) { pil_err(desc, "Failed to bring out of reset(rc:%d)\n", ret); goto err_auth_and_reset; } trace_pil_event("reset_done", desc); pil_log("reset_done", desc); pil_info(desc, "Brought out of reset\n"); desc->modem_ssr = false; err_auth_and_reset: Loading Loading @@ -1651,6 +1662,9 @@ static int __init msm_pil_init(void) if (!pil_wq) pr_warn("pil: Defaulting to sequential firmware loading.\n"); pil_ipc_log = ipc_log_context_create(2, "PIL-IPC", 0); if (!pil_ipc_log) pr_warn("Failed to setup PIL ipc logging\n"); out: return register_pm_notifier(&pil_pm_notifier); } Loading drivers/soc/qcom/peripheral-loader.h +9 −0 Original line number Diff line number Diff line Loading @@ -8,11 +8,20 @@ #include <linux/mailbox_client.h> #include <linux/mailbox/qmp.h> #include "minidump_private.h" #include <linux/ipc_logging.h> struct device; struct module; struct pil_priv; extern void *pil_ipc_log; #define pil_ipc(__msg, ...) \ do { \ if (pil_ipc_log) \ ipc_log_string(pil_ipc_log, \ "[%s]: "__msg, __func__, ##__VA_ARGS__); \ } while (0) /** * struct pil_desc - PIL descriptor * @name: string used for pil_get() Loading drivers/soc/qcom/subsystem_restart.c +6 −1 Original line number Diff line number Diff line Loading @@ -274,6 +274,8 @@ static ssize_t restart_level_store(struct device *dev, for (i = 0; i < ARRAY_SIZE(restart_levels); i++) if (!strncasecmp(buf, restart_levels[i], count)) { pil_ipc("[%s]: change restart level to %d\n", subsys->desc->name, i); subsys->restart_level = i; return orig_count; } Loading Loading @@ -849,7 +851,7 @@ static int subsys_start(struct subsys_device *subsys) subsys_set_state(subsys, SUBSYS_ONLINE); return 0; } pil_ipc("[%s]: before wait_for_err_ready\n", subsys->desc->name); ret = wait_for_err_ready(subsys); if (ret) { /* pil-boot succeeded but we need to shutdown Loading @@ -865,6 +867,7 @@ static int subsys_start(struct subsys_device *subsys) notify_each_subsys_device(&subsys, 1, SUBSYS_AFTER_POWERUP, NULL); pil_ipc("[%s]: exit\n", subsys->desc->name); return ret; } Loading @@ -872,6 +875,7 @@ static void subsys_stop(struct subsys_device *subsys) { const char *name = subsys->desc->name; pil_ipc("[%s]: entry\n", subsys->desc->name); notify_each_subsys_device(&subsys, 1, SUBSYS_BEFORE_SHUTDOWN, NULL); reinit_completion(&subsys->shutdown_ack); if (!of_property_read_bool(subsys->desc->dev->of_node, Loading @@ -890,6 +894,7 @@ static void subsys_stop(struct subsys_device *subsys) subsys_set_state(subsys, SUBSYS_OFFLINE); disable_all_irqs(subsys); notify_each_subsys_device(&subsys, 1, SUBSYS_AFTER_SHUTDOWN, NULL); pil_ipc("[%s]: exit\n", subsys->desc->name); } int subsystem_set_fwname(const char *name, const char *fw_name) Loading Loading
drivers/soc/qcom/peripheral-loader.c +21 −7 Original line number Diff line number Diff line Loading @@ -53,9 +53,20 @@ #define MAX_LEN 96 #define NUM_OF_ENCRYPTED_KEY 3 #define pil_log(msg, desc) \ do { \ if (pil_ipc_log) \ pil_ipc("[%s]: %s", desc->name, msg); \ else \ trace_pil_event(msg, desc); \ } while (0) static void __iomem *pil_info_base; static struct md_global_toc *g_md_toc; void *pil_ipc_log; /** * proxy_timeout - Override for proxy vote timeouts * -1: Use driver-specified timeout Loading Loading @@ -1245,7 +1256,7 @@ int pil_boot(struct pil_desc *desc) goto release_fw; } trace_pil_event("before_init_image", desc); pil_log("before_init_image", desc); if (desc->ops->init_image) ret = desc->ops->init_image(desc, fw->data, fw->size); if (ret) { Loading @@ -1253,7 +1264,7 @@ int pil_boot(struct pil_desc *desc) goto err_boot; } trace_pil_event("before_mem_setup", desc); pil_log("before_mem_setup", desc); if (desc->ops->mem_setup) ret = desc->ops->mem_setup(desc, priv->region_start, priv->region_end - priv->region_start); Loading @@ -1269,7 +1280,7 @@ int pil_boot(struct pil_desc *desc) * Also for secure boot devices, modem memory has to be released * after MBA is booted */ trace_pil_event("before_assign_mem", desc); pil_log("before_assign_mem", desc); if (desc->modem_ssr) { ret = pil_assign_mem_to_linux(desc, priv->region_start, (priv->region_end - priv->region_start)); Loading @@ -1288,7 +1299,7 @@ int pil_boot(struct pil_desc *desc) hyp_assign = true; } trace_pil_event("before_load_seg", desc); pil_log("before_load_seg", desc); /** * Fallback to serial loading of blobs if the Loading @@ -1307,7 +1318,7 @@ int pil_boot(struct pil_desc *desc) } if (desc->subsys_vmid > 0) { trace_pil_event("before_reclaim_mem", desc); pil_log("before_reclaim_mem", desc); ret = pil_reclaim_mem(desc, priv->region_start, (priv->region_end - priv->region_start), desc->subsys_vmid); Loading @@ -1319,14 +1330,14 @@ int pil_boot(struct pil_desc *desc) hyp_assign = false; } trace_pil_event("before_auth_reset", desc); pil_log("before_auth_reset", desc); notify_before_auth_and_reset(desc->dev); ret = desc->ops->auth_and_reset(desc); if (ret) { pil_err(desc, "Failed to bring out of reset(rc:%d)\n", ret); goto err_auth_and_reset; } trace_pil_event("reset_done", desc); pil_log("reset_done", desc); pil_info(desc, "Brought out of reset\n"); desc->modem_ssr = false; err_auth_and_reset: Loading Loading @@ -1651,6 +1662,9 @@ static int __init msm_pil_init(void) if (!pil_wq) pr_warn("pil: Defaulting to sequential firmware loading.\n"); pil_ipc_log = ipc_log_context_create(2, "PIL-IPC", 0); if (!pil_ipc_log) pr_warn("Failed to setup PIL ipc logging\n"); out: return register_pm_notifier(&pil_pm_notifier); } Loading
drivers/soc/qcom/peripheral-loader.h +9 −0 Original line number Diff line number Diff line Loading @@ -8,11 +8,20 @@ #include <linux/mailbox_client.h> #include <linux/mailbox/qmp.h> #include "minidump_private.h" #include <linux/ipc_logging.h> struct device; struct module; struct pil_priv; extern void *pil_ipc_log; #define pil_ipc(__msg, ...) \ do { \ if (pil_ipc_log) \ ipc_log_string(pil_ipc_log, \ "[%s]: "__msg, __func__, ##__VA_ARGS__); \ } while (0) /** * struct pil_desc - PIL descriptor * @name: string used for pil_get() Loading
drivers/soc/qcom/subsystem_restart.c +6 −1 Original line number Diff line number Diff line Loading @@ -274,6 +274,8 @@ static ssize_t restart_level_store(struct device *dev, for (i = 0; i < ARRAY_SIZE(restart_levels); i++) if (!strncasecmp(buf, restart_levels[i], count)) { pil_ipc("[%s]: change restart level to %d\n", subsys->desc->name, i); subsys->restart_level = i; return orig_count; } Loading Loading @@ -849,7 +851,7 @@ static int subsys_start(struct subsys_device *subsys) subsys_set_state(subsys, SUBSYS_ONLINE); return 0; } pil_ipc("[%s]: before wait_for_err_ready\n", subsys->desc->name); ret = wait_for_err_ready(subsys); if (ret) { /* pil-boot succeeded but we need to shutdown Loading @@ -865,6 +867,7 @@ static int subsys_start(struct subsys_device *subsys) notify_each_subsys_device(&subsys, 1, SUBSYS_AFTER_POWERUP, NULL); pil_ipc("[%s]: exit\n", subsys->desc->name); return ret; } Loading @@ -872,6 +875,7 @@ static void subsys_stop(struct subsys_device *subsys) { const char *name = subsys->desc->name; pil_ipc("[%s]: entry\n", subsys->desc->name); notify_each_subsys_device(&subsys, 1, SUBSYS_BEFORE_SHUTDOWN, NULL); reinit_completion(&subsys->shutdown_ack); if (!of_property_read_bool(subsys->desc->dev->of_node, Loading @@ -890,6 +894,7 @@ static void subsys_stop(struct subsys_device *subsys) subsys_set_state(subsys, SUBSYS_OFFLINE); disable_all_irqs(subsys); notify_each_subsys_device(&subsys, 1, SUBSYS_AFTER_SHUTDOWN, NULL); pil_ipc("[%s]: exit\n", subsys->desc->name); } int subsystem_set_fwname(const char *name, const char *fw_name) Loading