mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-09 13:49:24 -04:00
Merge "soc: qcom: Check rmb status register for spss bootup status"
This commit is contained in:
commit
fae69cd80b
1 changed files with 25 additions and 13 deletions
|
|
@ -113,6 +113,7 @@ struct pil_tz_data {
|
|||
void __iomem *irq_mask;
|
||||
void __iomem *err_status;
|
||||
void __iomem *err_status_spare;
|
||||
void __iomem *rmb_gp_reg;
|
||||
u32 bits_arr[2];
|
||||
int err_fatal_irq;
|
||||
int err_ready_irq;
|
||||
|
|
@ -1304,7 +1305,7 @@ static int pil_tz_generic_probe(struct platform_device *pdev)
|
|||
{
|
||||
struct pil_tz_data *d;
|
||||
struct resource *res;
|
||||
u32 proxy_timeout;
|
||||
u32 proxy_timeout, rmb_gp_reg_val;
|
||||
int len, rc;
|
||||
char md_node[20];
|
||||
|
||||
|
|
@ -1326,9 +1327,6 @@ static int pil_tz_generic_probe(struct platform_device *pdev)
|
|||
if (of_property_read_bool(pdev->dev.of_node, "qcom,pil-no-auth"))
|
||||
d->subsys_desc.no_auth = true;
|
||||
|
||||
if (of_property_read_bool(pdev->dev.of_node, "qcom,boot-enabled"))
|
||||
d->boot_enabled = true;
|
||||
|
||||
d->keep_proxy_regs_on = of_property_read_bool(pdev->dev.of_node,
|
||||
"qcom,keep-proxy-regs-on");
|
||||
|
||||
|
|
@ -1398,21 +1396,35 @@ static int pil_tz_generic_probe(struct platform_device *pdev)
|
|||
d->subsys_desc.dev = &pdev->dev;
|
||||
d->subsys_desc.shutdown = subsys_shutdown;
|
||||
d->subsys_desc.powerup = subsys_powerup;
|
||||
|
||||
/*
|
||||
* If subsystem is already bought out reset during the bootloader stage,
|
||||
* instead of doing regular power need to check subsystem status.
|
||||
* So override power up function to check subsystem crash status.
|
||||
*/
|
||||
if (d->boot_enabled)
|
||||
d->subsys_desc.powerup = subsys_powerup_boot_enabled;
|
||||
|
||||
d->subsys_desc.ramdump = subsys_ramdump;
|
||||
d->subsys_desc.free_memory = subsys_free_memory;
|
||||
d->subsys_desc.crash_shutdown = subsys_crash_shutdown;
|
||||
|
||||
if (of_property_read_bool(pdev->dev.of_node,
|
||||
"qcom,pil-generic-irq-handler")) {
|
||||
|
||||
res = platform_get_resource_byname(pdev, IORESOURCE_MEM,
|
||||
"rmb_general_purpose");
|
||||
d->rmb_gp_reg = devm_ioremap_resource(&pdev->dev, res);
|
||||
if (IS_ERR(d->rmb_gp_reg)) {
|
||||
dev_err(&pdev->dev, "Invalid resource for rmb_gp_reg\n");
|
||||
rc = PTR_ERR(d->rmb_gp_reg);
|
||||
goto err_ramdump;
|
||||
}
|
||||
|
||||
rmb_gp_reg_val = __raw_readl(d->rmb_gp_reg);
|
||||
/*
|
||||
* If subsystem is already bought out reset during the
|
||||
* bootloader stage, need to check subsystem status instead
|
||||
* of doing regular power. So override power up function
|
||||
* to check subsystem crash status.
|
||||
*/
|
||||
if (!(rmb_gp_reg_val & BIT(0))) {
|
||||
d->boot_enabled = true;
|
||||
pr_info("spss is brought out of reset by UEFI\n");
|
||||
d->subsys_desc.powerup = subsys_powerup_boot_enabled;
|
||||
}
|
||||
|
||||
res = platform_get_resource_byname(pdev, IORESOURCE_MEM,
|
||||
"sp2soc_irq_status");
|
||||
d->irq_status = devm_ioremap_resource(&pdev->dev, res);
|
||||
|
|
|
|||
Loading…
Reference in a new issue