All of lore.kernel.org
 help / color / mirror / Atom feed
From: Qais Yousef <qais.yousef@imgtec.com>
To: <alsa-devel@alsa-project.org>
Cc: Qais Yousef <qais.yousef@imgtec.com>,
	Liam Girdwood <lgirdwood@gmail.com>,
	Mark Brown <broonie@kernel.org>, Jaroslav Kysela <perex@perex.cz>,
	"Takashi Iwai" <tiwai@suse.com>, <linux-kernel@vger.kernel.org>
Subject: [PATCH 04/10] ALSA: axd: add fw binary header manipulation files
Date: Mon, 24 Aug 2015 13:39:13 +0100	[thread overview]
Message-ID: <1440419959-14315-5-git-send-email-qais.yousef@imgtec.com> (raw)
In-Reply-To: <1440419959-14315-1-git-send-email-qais.yousef@imgtec.com>

These files provide functions to get information from the fw binary
header.

Signed-off-by: Qais Yousef <qais.yousef@imgtec.com>
Cc: Liam Girdwood <lgirdwood@gmail.com>
Cc: Mark Brown <broonie@kernel.org>
Cc: Jaroslav Kysela <perex@perex.cz>
Cc: Takashi Iwai <tiwai@suse.com>
Cc: linux-kernel@vger.kernel.org
---
 sound/soc/img/axd/axd_hdr.c | 64 +++++++++++++++++++++++++++++++++++++++++++++
 sound/soc/img/axd/axd_hdr.h | 24 +++++++++++++++++
 2 files changed, 88 insertions(+)
 create mode 100644 sound/soc/img/axd/axd_hdr.c
 create mode 100644 sound/soc/img/axd/axd_hdr.h

diff --git a/sound/soc/img/axd/axd_hdr.c b/sound/soc/img/axd/axd_hdr.c
new file mode 100644
index 000000000000..7be3d11df120
--- /dev/null
+++ b/sound/soc/img/axd/axd_hdr.c
@@ -0,0 +1,64 @@
+/*
+ * Copyright (C) 2011-2015 Imagination Technologies Ltd.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License version
+ * 2 as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * Helper functions to parse AXD Header in the firmware binary.
+ */
+#include <linux/kernel.h>
+
+#include "axd_api.h"
+#include "axd_hdr.h"
+
+static struct axd_hdr *hdr;
+
+static void dump_hdr(void)
+{
+	unsigned int offset = 0;
+	unsigned long address = (unsigned long)hdr;
+
+	pr_debug("header <0x%08lX>:\n", address);
+	while (offset <= sizeof(*hdr)) {
+		pr_debug("0x%08X\t", *(unsigned int *)(address+offset));
+		offset += 4;
+		if ((offset % (4*4)) == 0)
+			pr_debug("\n");
+	}
+	pr_debug("\n");
+}
+
+void axd_hdr_init(unsigned long address)
+{
+	hdr = (struct axd_hdr *)address;
+	dump_hdr();
+}
+
+unsigned long axd_hdr_get_pc(unsigned int thread)
+{
+	if (thread >= THREAD_COUNT)
+		return -1;
+	return hdr->thread_pc[thread];
+}
+
+unsigned long axd_hdr_get_cmdblock_offset(void)
+{
+	pr_debug("cmdblock_offset = 0x%08X\n", hdr->cmd_block_offset);
+	return hdr->cmd_block_offset;
+}
+
+char *axd_hdr_get_build_str(void)
+{
+	return hdr->build_str;
+}
+
+unsigned long axd_hdr_get_log_offset(void)
+{
+	return hdr->log_offset;
+}
diff --git a/sound/soc/img/axd/axd_hdr.h b/sound/soc/img/axd/axd_hdr.h
new file mode 100644
index 000000000000..dc0b1e3be5a2
--- /dev/null
+++ b/sound/soc/img/axd/axd_hdr.h
@@ -0,0 +1,24 @@
+/*
+ * Copyright (C) 2011-2015 Imagination Technologies Ltd.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License version
+ * 2 as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * Helper functions to parse AXD Header in the firmware binary
+ */
+#ifndef AXD_HDR_H_
+#define AXD_HDR_H_
+
+void axd_hdr_init(unsigned long address);
+unsigned long axd_hdr_get_pc(unsigned int thread);
+unsigned long axd_hdr_get_cmdblock_offset(void);
+char *axd_hdr_get_build_str(void);
+unsigned long axd_hdr_get_log_offset(void);
+
+#endif /* AXD_HDR_H_ */
-- 
2.1.0


WARNING: multiple messages have this Message-ID (diff)
From: Qais Yousef <qais.yousef@imgtec.com>
To: alsa-devel@alsa-project.org
Cc: Qais Yousef <qais.yousef@imgtec.com>,
	Liam Girdwood <lgirdwood@gmail.com>,
	Mark Brown <broonie@kernel.org>, Jaroslav Kysela <perex@perex.cz>,
	Takashi Iwai <tiwai@suse.com>,
	linux-kernel@vger.kernel.org
Subject: [PATCH 04/10] ALSA: axd: add fw binary header manipulation files
Date: Mon, 24 Aug 2015 13:39:13 +0100	[thread overview]
Message-ID: <1440419959-14315-5-git-send-email-qais.yousef@imgtec.com> (raw)
In-Reply-To: <1440419959-14315-1-git-send-email-qais.yousef@imgtec.com>

These files provide functions to get information from the fw binary
header.

Signed-off-by: Qais Yousef <qais.yousef@imgtec.com>
Cc: Liam Girdwood <lgirdwood@gmail.com>
Cc: Mark Brown <broonie@kernel.org>
Cc: Jaroslav Kysela <perex@perex.cz>
Cc: Takashi Iwai <tiwai@suse.com>
Cc: linux-kernel@vger.kernel.org
---
 sound/soc/img/axd/axd_hdr.c | 64 +++++++++++++++++++++++++++++++++++++++++++++
 sound/soc/img/axd/axd_hdr.h | 24 +++++++++++++++++
 2 files changed, 88 insertions(+)
 create mode 100644 sound/soc/img/axd/axd_hdr.c
 create mode 100644 sound/soc/img/axd/axd_hdr.h

diff --git a/sound/soc/img/axd/axd_hdr.c b/sound/soc/img/axd/axd_hdr.c
new file mode 100644
index 000000000000..7be3d11df120
--- /dev/null
+++ b/sound/soc/img/axd/axd_hdr.c
@@ -0,0 +1,64 @@
+/*
+ * Copyright (C) 2011-2015 Imagination Technologies Ltd.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License version
+ * 2 as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * Helper functions to parse AXD Header in the firmware binary.
+ */
+#include <linux/kernel.h>
+
+#include "axd_api.h"
+#include "axd_hdr.h"
+
+static struct axd_hdr *hdr;
+
+static void dump_hdr(void)
+{
+	unsigned int offset = 0;
+	unsigned long address = (unsigned long)hdr;
+
+	pr_debug("header <0x%08lX>:\n", address);
+	while (offset <= sizeof(*hdr)) {
+		pr_debug("0x%08X\t", *(unsigned int *)(address+offset));
+		offset += 4;
+		if ((offset % (4*4)) == 0)
+			pr_debug("\n");
+	}
+	pr_debug("\n");
+}
+
+void axd_hdr_init(unsigned long address)
+{
+	hdr = (struct axd_hdr *)address;
+	dump_hdr();
+}
+
+unsigned long axd_hdr_get_pc(unsigned int thread)
+{
+	if (thread >= THREAD_COUNT)
+		return -1;
+	return hdr->thread_pc[thread];
+}
+
+unsigned long axd_hdr_get_cmdblock_offset(void)
+{
+	pr_debug("cmdblock_offset = 0x%08X\n", hdr->cmd_block_offset);
+	return hdr->cmd_block_offset;
+}
+
+char *axd_hdr_get_build_str(void)
+{
+	return hdr->build_str;
+}
+
+unsigned long axd_hdr_get_log_offset(void)
+{
+	return hdr->log_offset;
+}
diff --git a/sound/soc/img/axd/axd_hdr.h b/sound/soc/img/axd/axd_hdr.h
new file mode 100644
index 000000000000..dc0b1e3be5a2
--- /dev/null
+++ b/sound/soc/img/axd/axd_hdr.h
@@ -0,0 +1,24 @@
+/*
+ * Copyright (C) 2011-2015 Imagination Technologies Ltd.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License version
+ * 2 as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * Helper functions to parse AXD Header in the firmware binary
+ */
+#ifndef AXD_HDR_H_
+#define AXD_HDR_H_
+
+void axd_hdr_init(unsigned long address);
+unsigned long axd_hdr_get_pc(unsigned int thread);
+unsigned long axd_hdr_get_cmdblock_offset(void);
+char *axd_hdr_get_build_str(void);
+unsigned long axd_hdr_get_log_offset(void);
+
+#endif /* AXD_HDR_H_ */
-- 
2.1.0

  parent reply	other threads:[~2015-08-24 12:39 UTC|newest]

Thread overview: 94+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-24 12:39 [PATCH 00/10] Add support for img AXD audio hardware decoder Qais Yousef
2015-08-24 12:39 ` Qais Yousef
2015-08-24 12:39 ` Qais Yousef
2015-08-24 12:39 ` [PATCH 01/10] irqchip: irq-mips-gic: export gic_send_ipi Qais Yousef
2015-08-24 12:39   ` Qais Yousef
2015-08-24 12:49   ` Thomas Gleixner
2015-08-24 12:49     ` Thomas Gleixner
2015-08-24 13:02     ` Qais Yousef
2015-08-24 13:02       ` Qais Yousef
2015-08-24 13:02       ` Qais Yousef
2015-08-24 13:32       ` Marc Zyngier
2015-08-24 14:27         ` Qais Yousef
2015-08-24 14:27           ` Qais Yousef
2015-08-24 15:07           ` Thomas Gleixner
2015-08-24 16:39             ` Qais Yousef
2015-08-24 17:17               ` Marc Zyngier
2015-08-26 11:23                 ` Qais Yousef
2015-08-26 13:19                   ` Thomas Gleixner
2015-08-26 14:57                     ` Qais Yousef
2015-08-26 15:08                       ` Thomas Gleixner
2015-08-26 15:41                         ` Qais Yousef
2015-08-26 15:41                           ` Qais Yousef
2015-08-26 21:40                           ` Thomas Gleixner
2015-08-27  2:22                             ` Jiang Liu
2015-08-27  2:22                               ` Jiang Liu
2015-08-28 10:38                             ` Qais Yousef
2015-08-28 14:22                               ` Thomas Gleixner
2015-08-28 15:12                                 ` Qais Yousef
2015-09-02  9:33                                 ` Qais Yousef
2015-09-02  9:55                                   ` Marc Zyngier
2015-09-02 10:48                                     ` Qais Yousef
2015-09-02 10:48                                       ` Qais Yousef
2015-09-02 11:53                                       ` Marc Zyngier
2015-09-02 13:25                                         ` Qais Yousef
2015-09-02 14:14                                           ` Marc Zyngier
2015-09-02 12:12                                     ` Jason Cooper
2015-09-02 12:12                                       ` Jason Cooper
2015-08-24 14:55       ` Thomas Gleixner
2015-08-24 14:55         ` Thomas Gleixner
2015-08-24 15:11         ` Qais Yousef
2015-08-24 15:11           ` Qais Yousef
2015-08-24 12:39 ` [PATCH 02/10] dt: add img,axd.txt device tree binding document Qais Yousef
2015-08-24 12:39   ` Qais Yousef
2015-08-24 13:26   ` Mark Rutland
2015-08-24 13:26     ` Mark Rutland
2015-08-24 13:49     ` Qais Yousef
2015-08-24 13:49       ` Qais Yousef
2015-08-24 12:39 ` [PATCH 03/10] ALSA: add AXD Audio Processing IP alsa driver Qais Yousef
2015-08-24 12:39   ` Qais Yousef
2015-08-26 18:37   ` Mark Brown
2015-08-27 12:15     ` Qais Yousef
2015-08-27 12:15       ` Qais Yousef
2015-08-27 15:32       ` Mark Brown
2015-08-28  9:22         ` Qais Yousef
2015-08-28  9:22           ` Qais Yousef
2015-09-03 12:46           ` Mark Brown
2015-09-03 12:46             ` Mark Brown
2015-08-24 12:39 ` Qais Yousef [this message]
2015-08-24 12:39   ` [PATCH 04/10] ALSA: axd: add fw binary header manipulation files Qais Yousef
2015-08-24 12:39 ` [PATCH 05/10] ALSA: axd: add buffers " Qais Yousef
2015-08-24 12:39   ` Qais Yousef
2015-08-26 18:43   ` Mark Brown
2015-08-27 14:21     ` Qais Yousef
2015-08-27 14:21       ` Qais Yousef
2015-08-29  9:47       ` Mark Brown
2015-09-01 10:00         ` Qais Yousef
2015-09-01 10:00           ` Qais Yousef
2015-09-03 12:32           ` Mark Brown
2015-09-14  9:11             ` Qais Yousef
2015-09-14  9:11               ` Qais Yousef
2015-09-14 18:50               ` Mark Brown
2015-08-24 12:39 ` [PATCH 06/10] ALSA: axd: add basic files for sending/receiving axd cmds Qais Yousef
2015-08-24 12:39   ` Qais Yousef
2015-08-26 19:16   ` Mark Brown
2015-08-26 19:16     ` Mark Brown
2015-08-27 15:40     ` Qais Yousef
2015-08-27 15:40       ` Qais Yousef
2015-08-29 10:18       ` Mark Brown
2015-08-29 10:18         ` Mark Brown
2015-09-01 10:46         ` Qais Yousef
2015-09-01 10:46           ` Qais Yousef
2015-09-03 12:40           ` Mark Brown
2015-08-24 12:39 ` [PATCH 07/10] ALSA: axd: add cmd interface helper functions Qais Yousef
2015-08-24 12:39   ` Qais Yousef
2015-08-24 12:39 ` [PATCH 08/10] ALSA: axd: add low level AXD platform setup files Qais Yousef
2015-08-24 12:39   ` Qais Yousef
2015-08-24 12:39 ` [PATCH 09/10] ALSA: axd: add alsa compress offload operations Qais Yousef
2015-08-24 12:39   ` Qais Yousef
2015-08-24 12:39 ` [PATCH 10/10] ALSA: axd: add Makefile Qais Yousef
2015-08-24 12:39   ` Qais Yousef
2015-08-26 18:04 ` [PATCH 00/10] Add support for img AXD audio hardware decoder Mark Brown
2015-08-26 18:04   ` Mark Brown
2015-08-27  9:07   ` Qais Yousef
2015-08-27  9:07     ` Qais Yousef

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1440419959-14315-5-git-send-email-qais.yousef@imgtec.com \
    --to=qais.yousef@imgtec.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=perex@perex.cz \
    --cc=tiwai@suse.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.