mirror of
https://github.com/openwrt/openwrt.git
synced 2024-12-22 06:57:57 +00:00
8c405cdccc
The patches were generated from the RPi repo with the following command: git format-patch v6.6.34..rpi-6.1.y Some patches needed rebasing and, as usual, the applied and reverted, wireless drivers, Github workflows, READMEs and defconfigs patches were removed. Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
90 lines
2.6 KiB
Diff
90 lines
2.6 KiB
Diff
From 196e8003463bb10daf3b763b6c1ca877cd148c70 Mon Sep 17 00:00:00 2001
|
|
From: Dave Stevenson <dave.stevenson@raspberrypi.org>
|
|
Date: Thu, 10 Jan 2019 17:58:06 +0000
|
|
Subject: [PATCH 0132/1085] firmware: raspberrypi: Report the fw variant during
|
|
probe
|
|
|
|
The driver already reported the firmware build date during probe.
|
|
The mailbox calls have been extended to also report the variant
|
|
1 = standard start.elf
|
|
2 = start_x.elf (includes camera stack)
|
|
3 = start_db.elf (includes assert logging)
|
|
4 = start_cd.elf (cutdown version for smallest memory footprint).
|
|
Log the variant during probe.
|
|
|
|
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
|
|
|
|
firmware: raspberrypi: Report the fw git hash during probe
|
|
|
|
The firmware can now report the git hash from which it was built
|
|
via the mailbox, so report it during probe.
|
|
|
|
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
|
|
---
|
|
drivers/firmware/raspberrypi.c | 40 +++++++++++++++++++++++++++++++++-
|
|
1 file changed, 39 insertions(+), 1 deletion(-)
|
|
|
|
--- a/drivers/firmware/raspberrypi.c
|
|
+++ b/drivers/firmware/raspberrypi.c
|
|
@@ -235,6 +235,15 @@ rpi_firmware_print_firmware_revision(str
|
|
{
|
|
time64_t date_and_time;
|
|
u32 packet;
|
|
+ static const char * const variant_strs[] = {
|
|
+ "unknown",
|
|
+ "start",
|
|
+ "start_x",
|
|
+ "start_db",
|
|
+ "start_cd",
|
|
+ };
|
|
+ const char *variant_str = "cmd unsupported";
|
|
+ u32 variant;
|
|
int ret = rpi_firmware_property(fw,
|
|
RPI_FIRMWARE_GET_FIRMWARE_REVISION,
|
|
&packet, sizeof(packet));
|
|
@@ -244,7 +253,35 @@ rpi_firmware_print_firmware_revision(str
|
|
|
|
/* This is not compatible with y2038 */
|
|
date_and_time = packet;
|
|
- dev_info(fw->cl.dev, "Attached to firmware from %ptT\n", &date_and_time);
|
|
+
|
|
+ ret = rpi_firmware_property(fw, RPI_FIRMWARE_GET_FIRMWARE_VARIANT,
|
|
+ &variant, sizeof(variant));
|
|
+
|
|
+ if (!ret) {
|
|
+ if (variant >= ARRAY_SIZE(variant_strs))
|
|
+ variant = 0;
|
|
+ variant_str = variant_strs[variant];
|
|
+ }
|
|
+
|
|
+ dev_info(fw->cl.dev,
|
|
+ "Attached to firmware from %ptT, variant %s\n",
|
|
+ &date_and_time, variant_str);
|
|
+}
|
|
+
|
|
+static void
|
|
+rpi_firmware_print_firmware_hash(struct rpi_firmware *fw)
|
|
+{
|
|
+ u32 hash[5];
|
|
+ int ret = rpi_firmware_property(fw,
|
|
+ RPI_FIRMWARE_GET_FIRMWARE_HASH,
|
|
+ hash, sizeof(hash));
|
|
+
|
|
+ if (ret)
|
|
+ return;
|
|
+
|
|
+ dev_info(fw->cl.dev,
|
|
+ "Firmware hash is %08x%08x%08x%08x%08x\n",
|
|
+ hash[0], hash[1], hash[2], hash[3], hash[4]);
|
|
}
|
|
|
|
static void
|
|
@@ -359,6 +396,7 @@ static int rpi_firmware_probe(struct pla
|
|
g_pdev = pdev;
|
|
|
|
rpi_firmware_print_firmware_revision(fw);
|
|
+ rpi_firmware_print_firmware_hash(fw);
|
|
rpi_register_hwmon_driver(dev, fw);
|
|
rpi_register_clk_driver(dev);
|
|
|