Re: [RFC v2 16/18] ARM: OMAP2+: AM33XX: Basic suspend resume support

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



>>>>> "V" == Vaibhav Bedia <vaibhav.bedia@xxxxxx> writes:

Hi,

 V> +static void am33xx_pm_firmware_cb(const struct firmware *fw, void *context)
 V> +{
 V> +	struct wkup_m3_context *wkup_m3_context = context;
 V> +	struct platform_device *pdev = to_platform_device(wkup_m3_context->dev);
 V> +	int ret = 0;
 V> +
 V> +	/* no firmware found */
 V> +	if (!fw) {
 V> +		dev_err(wkup_m3_context->dev, "request_firmware failed\n");
 V> +		goto err;
 V> +	}
 V> +
 V> +	memcpy((void *)wkup_m3_context->code, fw->data, fw->size);

A size check would be good. I don't know much about the finer details
about the m3 and how it is connected, but don't you need to ensure data
is flushed before resetting the m3?



 V> +	pr_info("Copied the M3 firmware to UMEM\n");
 V> +
 V> +	wkup_m3->state = M3_STATE_RESET;
 V> +
 V> +	ret = omap_device_deassert_hardreset(pdev, "wkup_m3");
 V> +	if (ret) {
 V> +		pr_err("Could not deassert the reset for WKUP_M3\n");
 V> +		goto err;
 V> +	} else {
 V> +#ifdef CONFIG_SUSPEND
 V> +		suspend_set_ops(&am33xx_pm_ops);
 V> +		/*
 V> +		 * Physical resume address to be used by ROM code
 V> +		 */
 V> +		wkup_m3->ipc_data.resume_addr = (AM33XX_OCMC_END -
 V> +				am33xx_do_wfi_sz + am33xx_resume_offset + 0x4);
 V> +#endif
 V> +		return;
 V> +	}
 V> +
 V> +err:
 V> +	mailbox_put(wkup_m3_context->mbox, &wkup_mbox_notifier);
 V> +}

-- 
Bye, Peter Korsgaard
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Arm (vger)]     [ARM Kernel]     [ARM MSM]     [Linux Tegra]     [Linux WPAN Networking]     [Linux Wireless Networking]     [Maemo Users]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux