* [PATCH v5 1/4] ASoC: intel: atom: Add debug information related to FW version
2016-12-05 8:18 [PATCH v5 0/4] ASoC: intel: atom: Add FW version information Sebastien Guiriec
@ 2016-12-05 8:18 ` Sebastien Guiriec
2016-12-05 10:31 ` Mark Brown
2016-12-05 8:18 ` [PATCH v5 2/4] ASoC: Intel: atom: save " Sebastien Guiriec
` (2 subsequent siblings)
3 siblings, 1 reply; 7+ messages in thread
From: Sebastien Guiriec @ 2016-12-05 8:18 UTC (permalink / raw)
To: alsa-devel, vinod.koul, pierre-louis.bossart, liam.r.girdwood,
broonie
Cc: Sebastien Guiriec
This patch is adding debug information related to SST FW version.
Signed-off-by: Sebastien Guiriec <sebastien.guiriec@intel.com>
Acked-by: Vinod Koul <vinod.koul@intel.com>
---
sound/soc/intel/atom/sst/sst_ipc.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/sound/soc/intel/atom/sst/sst_ipc.c b/sound/soc/intel/atom/sst/sst_ipc.c
index bfc8899..5d035d9 100644
--- a/sound/soc/intel/atom/sst/sst_ipc.c
+++ b/sound/soc/intel/atom/sst/sst_ipc.c
@@ -236,6 +236,9 @@ static void process_fw_init(struct intel_sst_drv *sst_drv_ctx,
retval = init->result;
goto ret;
}
+ dev_info(sst_drv_ctx->dev, "FW Version %02x.%02x.%02x.%02x\n",
+ init->fw_version.type, init->fw_version.major,
+ init->fw_version.minor, init->fw_version.build);
ret:
sst_wake_up_block(sst_drv_ctx, retval, FW_DWNL_ID, 0 , NULL, 0);
--
2.9.3
---------------------------------------------------------------------
Intel Corporation SAS (French simplified joint stock company)
Registered headquarters: "Les Montalets"- 2, rue de Paris,
92196 Meudon Cedex, France
Registration Number: 302 456 199 R.C.S. NANTERRE
Capital: 4,572,000 Euros
This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.
^ permalink raw reply related [flat|nested] 7+ messages in thread* Re: [PATCH v5 1/4] ASoC: intel: atom: Add debug information related to FW version
2016-12-05 8:18 ` [PATCH v5 1/4] ASoC: intel: atom: Add debug information related to FW version Sebastien Guiriec
@ 2016-12-05 10:31 ` Mark Brown
0 siblings, 0 replies; 7+ messages in thread
From: Mark Brown @ 2016-12-05 10:31 UTC (permalink / raw)
To: Sebastien Guiriec
Cc: vinod.koul, liam.r.girdwood, alsa-devel, pierre-louis.bossart
[-- Attachment #1.1: Type: text/plain, Size: 202 bytes --]
On Mon, Dec 05, 2016 at 09:18:38AM +0100, Sebastien Guiriec wrote:
> This patch is adding debug information related to SST FW version.
This doesn't apply against current code, please check and resend.
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
[-- Attachment #2: Type: text/plain, Size: 0 bytes --]
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH v5 2/4] ASoC: Intel: atom: save FW version
2016-12-05 8:18 [PATCH v5 0/4] ASoC: intel: atom: Add FW version information Sebastien Guiriec
2016-12-05 8:18 ` [PATCH v5 1/4] ASoC: intel: atom: Add debug information related to FW version Sebastien Guiriec
@ 2016-12-05 8:18 ` Sebastien Guiriec
2016-12-05 8:18 ` [PATCH v5 3/4] ASoC: Intel: atom: Add sysfs entry in order to store " Sebastien Guiriec
2016-12-05 8:18 ` [PATCH v5 4/4] Documentation: ABI: Add ASoC Intel SST Atom sysfs description Sebastien Guiriec
3 siblings, 0 replies; 7+ messages in thread
From: Sebastien Guiriec @ 2016-12-05 8:18 UTC (permalink / raw)
To: alsa-devel, vinod.koul, pierre-louis.bossart, liam.r.girdwood,
broonie
Cc: Sebastien Guiriec
After the boot of the SST FW the firmware version is send back
to the driver. This patch is saving the FW version inside the
driver.
Signed-off-by: Sebastien Guiriec <sebastien.guiriec@intel.com>
Acked-by: Vinod Koul <vinod.koul@intel.com>
---
sound/soc/intel/atom/sst/sst.h | 1 +
sound/soc/intel/atom/sst/sst_ipc.c | 5 +++++
2 files changed, 6 insertions(+)
diff --git a/sound/soc/intel/atom/sst/sst.h b/sound/soc/intel/atom/sst/sst.h
index 3f49386..5c9a51cc 100644
--- a/sound/soc/intel/atom/sst/sst.h
+++ b/sound/soc/intel/atom/sst/sst.h
@@ -436,6 +436,7 @@ struct intel_sst_drv {
*/
char firmware_name[FW_NAME_SIZE];
+ struct snd_sst_fw_version fw_version;
struct sst_fw_save *fw_save;
};
diff --git a/sound/soc/intel/atom/sst/sst_ipc.c b/sound/soc/intel/atom/sst/sst_ipc.c
index 5d035d9..98505e4 100644
--- a/sound/soc/intel/atom/sst/sst_ipc.c
+++ b/sound/soc/intel/atom/sst/sst_ipc.c
@@ -240,6 +240,11 @@ static void process_fw_init(struct intel_sst_drv *sst_drv_ctx,
init->fw_version.type, init->fw_version.major,
init->fw_version.minor, init->fw_version.build);
+ /* Save FW version */
+ sst_drv_ctx->fw_version.type = init->fw_version.type;
+ sst_drv_ctx->fw_version.major = init->fw_version.major;
+ sst_drv_ctx->fw_version.minor = init->fw_version.minor;
+ sst_drv_ctx->fw_version.build = init->fw_version.build;
ret:
sst_wake_up_block(sst_drv_ctx, retval, FW_DWNL_ID, 0 , NULL, 0);
}
--
2.9.3
---------------------------------------------------------------------
Intel Corporation SAS (French simplified joint stock company)
Registered headquarters: "Les Montalets"- 2, rue de Paris,
92196 Meudon Cedex, France
Registration Number: 302 456 199 R.C.S. NANTERRE
Capital: 4,572,000 Euros
This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.
^ permalink raw reply related [flat|nested] 7+ messages in thread* [PATCH v5 3/4] ASoC: Intel: atom: Add sysfs entry in order to store FW version
2016-12-05 8:18 [PATCH v5 0/4] ASoC: intel: atom: Add FW version information Sebastien Guiriec
2016-12-05 8:18 ` [PATCH v5 1/4] ASoC: intel: atom: Add debug information related to FW version Sebastien Guiriec
2016-12-05 8:18 ` [PATCH v5 2/4] ASoC: Intel: atom: save " Sebastien Guiriec
@ 2016-12-05 8:18 ` Sebastien Guiriec
2016-12-05 8:18 ` [PATCH v5 4/4] Documentation: ABI: Add ASoC Intel SST Atom sysfs description Sebastien Guiriec
3 siblings, 0 replies; 7+ messages in thread
From: Sebastien Guiriec @ 2016-12-05 8:18 UTC (permalink / raw)
To: alsa-devel, vinod.koul, pierre-louis.bossart, liam.r.girdwood,
broonie
Cc: Sebastien Guiriec
This patch is adding a sysfs entry in order to be able to get
access to SST FW version.
Signed-off-by: Sebastien Guiriec <sebastien.guiriec@intel.com>
Acked-by: Vinod Koul <vinod.koul@intel.com>
---
sound/soc/intel/atom/sst/sst.c | 39 +++++++++++++++++++++++++++++++++++++++
1 file changed, 39 insertions(+)
diff --git a/sound/soc/intel/atom/sst/sst.c b/sound/soc/intel/atom/sst/sst.c
index 9b6e273..f9ba713 100644
--- a/sound/soc/intel/atom/sst/sst.c
+++ b/sound/soc/intel/atom/sst/sst.c
@@ -27,6 +27,7 @@
#include <linux/pm_qos.h>
#include <linux/async.h>
#include <linux/acpi.h>
+#include <linux/sysfs.h>
#include <sound/core.h>
#include <sound/soc.h>
#include <asm/platform_sst_audio.h>
@@ -242,6 +243,32 @@ int sst_alloc_drv_context(struct intel_sst_drv **ctx,
}
EXPORT_SYMBOL_GPL(sst_alloc_drv_context);
+static ssize_t firmware_version_show(struct device *dev,
+ struct device_attribute *attr, char *buf)
+{
+ struct intel_sst_drv *ctx = dev_get_drvdata(dev);
+
+ if (ctx->fw_version.type == 0 && ctx->fw_version.major == 0 &&
+ ctx->fw_version.minor == 0 && ctx->fw_version.build == 0)
+ return sprintf(buf, "FW not yet loaded\n");
+ else
+ return sprintf(buf, "v%02x.%02x.%02x.%02x\n",
+ ctx->fw_version.type, ctx->fw_version.major,
+ ctx->fw_version.minor, ctx->fw_version.build);
+
+}
+
+DEVICE_ATTR_RO(firmware_version);
+
+static const struct attribute *sst_fw_version_attrs[] = {
+ &dev_attr_firmware_version.attr,
+ NULL,
+};
+
+static const struct attribute_group sst_fw_version_attr_group = {
+ .attrs = (struct attribute **)sst_fw_version_attrs,
+};
+
int sst_context_init(struct intel_sst_drv *ctx)
{
int ret = 0, i;
@@ -315,8 +342,19 @@ int sst_context_init(struct intel_sst_drv *ctx)
dev_err(ctx->dev, "Firmware download failed:%d\n", ret);
goto do_free_mem;
}
+
+ ret = sysfs_create_group(&ctx->dev->kobj,
+ &sst_fw_version_attr_group);
+ if (ret) {
+ dev_err(ctx->dev,
+ "Unable to create sysfs\n");
+ goto err_sysfs;
+ }
+
sst_register(ctx->dev);
return 0;
+err_sysfs:
+ sysfs_remove_group(&ctx->dev->kobj, &sst_fw_version_attr_group);
do_free_mem:
destroy_workqueue(ctx->post_msg_wq);
@@ -330,6 +368,7 @@ void sst_context_cleanup(struct intel_sst_drv *ctx)
pm_runtime_disable(ctx->dev);
sst_unregister(ctx->dev);
sst_set_fw_state_locked(ctx, SST_SHUTDOWN);
+ sysfs_remove_group(&ctx->dev->kobj, &sst_fw_version_attr_group);
flush_scheduled_work();
destroy_workqueue(ctx->post_msg_wq);
pm_qos_remove_request(ctx->qos);
--
2.9.3
---------------------------------------------------------------------
Intel Corporation SAS (French simplified joint stock company)
Registered headquarters: "Les Montalets"- 2, rue de Paris,
92196 Meudon Cedex, France
Registration Number: 302 456 199 R.C.S. NANTERRE
Capital: 4,572,000 Euros
This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.
^ permalink raw reply related [flat|nested] 7+ messages in thread* [PATCH v5 4/4] Documentation: ABI: Add ASoC Intel SST Atom sysfs description
2016-12-05 8:18 [PATCH v5 0/4] ASoC: intel: atom: Add FW version information Sebastien Guiriec
` (2 preceding siblings ...)
2016-12-05 8:18 ` [PATCH v5 3/4] ASoC: Intel: atom: Add sysfs entry in order to store " Sebastien Guiriec
@ 2016-12-05 8:18 ` Sebastien Guiriec
2016-12-05 17:23 ` Applied "ASoC: Intel: Add ASoC Intel SST Atom sysfs description" to the asoc tree Mark Brown
3 siblings, 1 reply; 7+ messages in thread
From: Sebastien Guiriec @ 2016-12-05 8:18 UTC (permalink / raw)
To: alsa-devel, vinod.koul, pierre-louis.bossart, liam.r.girdwood,
broonie
Cc: Sebastien Guiriec
For ASoC Intel SST Atom based devices a sysfs entry is created
in order to track FW version. The FW version is useful in order to
check the different Version of LPE DSP FW across Intel SoCs.
Signed-off-by: Sebastien Guiriec <sebastien.guiriec@intel.com>
Acked-by: Vinod Koul <vinod.koul@intel.com>
---
Documentation/ABI/testing/sysfs-platform-sst-atom | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
create mode 100644 Documentation/ABI/testing/sysfs-platform-sst-atom
diff --git a/Documentation/ABI/testing/sysfs-platform-sst-atom b/Documentation/ABI/testing/sysfs-platform-sst-atom
new file mode 100644
index 0000000..0d07c03
--- /dev/null
+++ b/Documentation/ABI/testing/sysfs-platform-sst-atom
@@ -0,0 +1,17 @@
+What: /sys/devices/platform/8086%x:00/firmware_version
+Date: November 2016
+KernelVersion: 4.10
+Contact: "Sebastien Guiriec" <sebastien.guiriec@intel.com>
+Description:
+ LPE Firmware version for SST driver on all atom
+ plaforms (BYT/CHT/Merrifield/BSW).
+ If the FW has never been loaded it will display:
+ "FW not yet loaded"
+ If FW has been loaded it will display:
+ "v01.aa.bb.cc"
+ aa: Major version is reflecting SoC version:
+ 0d: BYT FW
+ 0b: BSW FW
+ 07: Merrifield FW
+ bb: Minor version
+ cc: Build version
--
2.9.3
---------------------------------------------------------------------
Intel Corporation SAS (French simplified joint stock company)
Registered headquarters: "Les Montalets"- 2, rue de Paris,
92196 Meudon Cedex, France
Registration Number: 302 456 199 R.C.S. NANTERRE
Capital: 4,572,000 Euros
This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.
^ permalink raw reply related [flat|nested] 7+ messages in thread* Applied "ASoC: Intel: Add ASoC Intel SST Atom sysfs description" to the asoc tree
2016-12-05 8:18 ` [PATCH v5 4/4] Documentation: ABI: Add ASoC Intel SST Atom sysfs description Sebastien Guiriec
@ 2016-12-05 17:23 ` Mark Brown
0 siblings, 0 replies; 7+ messages in thread
From: Mark Brown @ 2016-12-05 17:23 UTC (permalink / raw)
To: Sebastien Guiriec
Cc: vinod.koul, liam.r.girdwood, alsa-devel, broonie,
pierre-louis.bossart
The patch
ASoC: Intel: Add ASoC Intel SST Atom sysfs description
has been applied to the asoc tree at
git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git
All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying
to this mail.
Thanks,
Mark
>From da91723ce0c5e0bbd5dc91d66447ba165241c257 Mon Sep 17 00:00:00 2001
From: Sebastien Guiriec <sebastien.guiriec@intel.com>
Date: Mon, 5 Dec 2016 17:45:03 +0100
Subject: [PATCH] ASoC: Intel: Add ASoC Intel SST Atom sysfs description
For ASoC Intel SST Atom based devices a sysfs entry is created
in order to track FW version. The FW version is useful in order to
check the different Version of LPE DSP FW across Intel SoCs.
Signed-off-by: Sebastien Guiriec <sebastien.guiriec@intel.com>
Acked-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
---
Documentation/ABI/testing/sysfs-platform-sst-atom | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
create mode 100644 Documentation/ABI/testing/sysfs-platform-sst-atom
diff --git a/Documentation/ABI/testing/sysfs-platform-sst-atom b/Documentation/ABI/testing/sysfs-platform-sst-atom
new file mode 100644
index 000000000000..0d07c0395660
--- /dev/null
+++ b/Documentation/ABI/testing/sysfs-platform-sst-atom
@@ -0,0 +1,17 @@
+What: /sys/devices/platform/8086%x:00/firmware_version
+Date: November 2016
+KernelVersion: 4.10
+Contact: "Sebastien Guiriec" <sebastien.guiriec@intel.com>
+Description:
+ LPE Firmware version for SST driver on all atom
+ plaforms (BYT/CHT/Merrifield/BSW).
+ If the FW has never been loaded it will display:
+ "FW not yet loaded"
+ If FW has been loaded it will display:
+ "v01.aa.bb.cc"
+ aa: Major version is reflecting SoC version:
+ 0d: BYT FW
+ 0b: BSW FW
+ 07: Merrifield FW
+ bb: Minor version
+ cc: Build version
--
2.10.2
^ permalink raw reply related [flat|nested] 7+ messages in thread