Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

store firmware version info into debugfs for logger usage #222

Merged
merged 3 commits into from
Nov 8, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions sound/soc/sof/intel/bdw.c
Original file line number Diff line number Diff line change
Expand Up @@ -519,6 +519,10 @@ static int bdw_fw_ready(struct snd_sof_dev *sdev, u32 msg_id)
" Firmware info: version %d:%d-%s build %d on %s:%s\n",
v->major, v->minor, v->tag, v->build, v->date, v->time);

/* only copy the fw_version into debugfs at first boot */
if (sdev->first_boot)
plbossart marked this conversation as resolved.
Show resolved Hide resolved
memcpy(&sdev->fw_version, v, sizeof(*v));

plbossart marked this conversation as resolved.
Show resolved Hide resolved
/* now check for extended data */
snd_sof_fw_parse_ext_data(sdev, MBOX_OFFSET +
sizeof(struct sof_ipc_fw_ready));
Expand Down
4 changes: 4 additions & 0 deletions sound/soc/sof/intel/byt.c
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,10 @@ static int byt_fw_ready(struct snd_sof_dev *sdev, u32 msg_id)
" Firmware info: version %d:%d-%s build %d on %s:%s\n",
v->major, v->minor, v->tag, v->build, v->date, v->time);

/* only copy the fw_version into debugfs at first boot */
if (sdev->first_boot)
memcpy(&sdev->fw_version, v, sizeof(*v));

/* now check for extended data */
snd_sof_fw_parse_ext_data(sdev, MBOX_OFFSET +
sizeof(struct sof_ipc_fw_ready));
Expand Down
4 changes: 4 additions & 0 deletions sound/soc/sof/intel/hda-ipc.c
Original file line number Diff line number Diff line change
Expand Up @@ -385,6 +385,10 @@ int hda_dsp_ipc_fw_ready(struct snd_sof_dev *sdev, u32 msg_id)
" Firmware info: version %d.%d-%s build %d on %s:%s\n",
v->major, v->minor, v->tag, v->build, v->date, v->time);

/* only copy the fw_version into debugfs at first boot */
if (sdev->first_boot)
memcpy(&sdev->fw_version, v, sizeof(*v));

/* now check for extended data */
snd_sof_fw_parse_ext_data(sdev, HDA_DSP_MBOX_UPLINK_OFFSET +
sizeof(struct sof_ipc_fw_ready));
Expand Down
4 changes: 4 additions & 0 deletions sound/soc/sof/intel/hsw.c
Original file line number Diff line number Diff line change
Expand Up @@ -521,6 +521,10 @@ static int hsw_fw_ready(struct snd_sof_dev *sdev, u32 msg_id)
" Firmware info: version %d:%d-%s build %d on %s:%s\n",
v->major, v->minor, v->tag, v->build, v->date, v->time);

/* only copy the fw_version into debugfs at first boot */
if (sdev->first_boot)
memcpy(&sdev->fw_version, v, sizeof(*v));

/* now check for extended data */
snd_sof_fw_parse_ext_data(sdev, MBOX_OFFSET +
sizeof(struct sof_ipc_fw_ready));
Expand Down
12 changes: 12 additions & 0 deletions sound/soc/sof/loader.c
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,18 @@ int snd_sof_run_firmware(struct snd_sof_dev *sdev)
init_waitqueue_head(&sdev->boot_wait);
sdev->boot_complete = false;

/* create fw_version debugfs to store boot version info */
if (sdev->first_boot) {
ret = snd_sof_debugfs_create_item(sdev, &sdev->fw_version,
sizeof(sdev->fw_version),
"fw_version");

if (ret < 0) {
dev_err(sdev->dev, "cannot create debugfs for fw_version\n");
return ret;
}
}

dev_dbg(sdev->dev, "booting DSP firmware\n");

/* boot the firmware on the DSP */
Expand Down
1 change: 1 addition & 0 deletions sound/soc/sof/sof-priv.h
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,7 @@ struct snd_sof_dev {
struct snd_dma_buffer dmab;
struct snd_dma_buffer dmab_bdl;
struct sof_ipc_fw_ready fw_ready;
struct sof_ipc_fw_version fw_version;

/* topology */
struct snd_soc_tplg_ops *tplg_ops;
Expand Down