Skip to content

Refactor sof_fw_ready #1107

@dbaluta

Description

@dbaluta

@dbaluta can you add '/* mandatory */' comment as @plbossart mentioned please?

I can imagine that we should change sof_fw_ready() to be like this in the future:

/* check for ABI compatibility and create memory windows on first boot */
- int sof_fw_ready(struct snd_sof_dev *sdev, u32 msg_id)
+ int sof_fw_ready(struct snd_sof_dev *sdev, u32 offset)
{
	struct sof_ipc_fw_ready *fw_ready = &sdev->fw_ready;
-	int offset;
	int bar;
	int ret;

+      if (offset) {
-	/* mailbox must be on 4k boundary */
-	offset = snd_sof_dsp_get_mailbox_offset(sdev);
-	if (offset < 0) {
-		dev_err(sdev->dev, "error: have no mailbox offset\n");
-		return offset;
-	}
+              /* no valid offset from fw_ready message, use the default one */
+	        offset = snd_sof_dsp_get_mailbox_offset(sdev);
+	        if (offset < 0) {
+		        dev_err(sdev->dev, "error: have no mailbox offset\n");
+		        return offset;
+	        }
+        } else {
+                /* mailbox must be on 4k boundary */
+                offset <= 12;
+        }

Originally posted by @keyonjie in #1103

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestgsocLabels issues, enhancements that can be worked on by gsoc applicants

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions