summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--aoc.c11
-rw-r--r--aoc_firmware.c26
-rw-r--r--aoc_firmware.h7
3 files changed, 17 insertions, 27 deletions
diff --git a/aoc.c b/aoc.c
index 8d024f1..8cba85f 100644
--- a/aoc.c
+++ b/aoc.c
@@ -310,7 +310,7 @@ static void aoc_fw_callback(const struct firmware *fw, void *ctx)
{
struct device *dev = ctx;
struct aoc_prvdata *prvdata = dev_get_drvdata(dev);
- const char *builddate;
+ const char *version;
u32 ipc_offset, bootloader_offset;
@@ -326,14 +326,13 @@ static void aoc_fw_callback(const struct firmware *fw, void *ctx)
goto free_fw;
}
- builddate = _aoc_fw_builddate(fw);
ipc_offset = _aoc_fw_ipc_offset(fw);
bootloader_offset = _aoc_fw_bootloader_offset(fw);
+ version = _aoc_fw_version(fw);
- pr_notice("successfully loaded firmware version %u type %s buildtime \'%s\'",
- _aoc_fw_version(fw),
- _aoc_fw_is_release(fw) ? "release" : "development",
- builddate ? builddate : "unknown");
+ pr_notice("successfully loaded firmware version %s type %s",
+ version ? version : "unknown",
+ _aoc_fw_is_release(fw) ? "release" : "development");
if (!_aoc_fw_is_compatible(fw)) {
dev_err(dev, "firmware and drivers are incompatible\n");
diff --git a/aoc_firmware.c b/aoc_firmware.c
index 9e5bcd7..9163b5c 100644
--- a/aoc_firmware.c
+++ b/aoc_firmware.c
@@ -22,7 +22,7 @@
struct aoc_superbin_header {
u32 magic;
u32 release_type;
- u32 firmware_version;
+ u32 _reserved0;
u32 image_size;
u32 bootloader_low;
u32 bootloader_high;
@@ -30,10 +30,13 @@ struct aoc_superbin_header {
u32 bootloader_size;
u32 uuid_table_offset;
u32 uuid_table_size;
- u8 date_time[20];
+ u8 version_prefix[8];
+ u8 version_string[64];
u32 section_table_offset;
u32 section_table_entry_size;
+ u32 section_table_entry_count;
u32 sram_offset;
+ u32 repo_info_offset;
u32 a32_data_offset;
u32 a32_data_size;
u32 ff1_data_offset;
@@ -133,25 +136,16 @@ u32 _aoc_fw_ipc_offset(const struct firmware *fw)
}
/* Returns firmware version, or 0 on error */
-u32 _aoc_fw_version(const struct firmware *fw)
+const char* _aoc_fw_version(const struct firmware *fw)
{
const struct aoc_superbin_header *header =
(const struct aoc_superbin_header *)fw->data;
- return le32_to_cpu(header->firmware_version);
-}
-
-/* Returns firmware build date, or NULL on error */
-const char *_aoc_fw_builddate(const struct firmware *fw)
-{
- const struct aoc_superbin_header *header =
- (const struct aoc_superbin_header *)fw->data;
- size_t field_size = sizeof(header->date_time);
- const char *date = &header->date_time[0];
+ size_t maxlen = sizeof(header->version_string);
- if (strnlen(date, field_size) < field_size)
- return date;
+ if (strnlen(header->version_string, maxlen) == maxlen)
+ return NULL;
- return NULL;
+ return (const char *)header->version_string;
}
bool _aoc_fw_commit(const struct firmware *fw, void *dest)
diff --git a/aoc_firmware.h b/aoc_firmware.h
index fcafacb..2f7a3b6 100644
--- a/aoc_firmware.h
+++ b/aoc_firmware.h
@@ -24,10 +24,7 @@ u32 _aoc_fw_bootloader_offset(const struct firmware *fw);
u32 _aoc_fw_ipc_offset(const struct firmware *fw);
-/* Returns firmware version, or 0 on error */
-u32 _aoc_fw_version(const struct firmware *fw);
-
-/* Returns firmware build date, or NULL on error */
-const char *_aoc_fw_builddate(const struct firmware *fw);
+/* Returns firmware version, or NULL on error */
+const char *_aoc_fw_version(const struct firmware *fw);
bool _aoc_fw_commit(const struct firmware *fw, void *dest);