1 From 311b5d4d00862995b7cf916139384defdb6e2d85 Mon Sep 17 00:00:00 2001
2 From: Dave Stevenson <dave.stevenson@raspberrypi.org>
3 Date: Thu, 10 Jan 2019 17:58:06 +0000
4 Subject: [PATCH] firmware: raspberrypi: Report the fw variant during
7 The driver already reported the firmware build date during probe.
8 The mailbox calls have been extended to also report the variant
10 2 = start_x.elf (includes camera stack)
11 3 = start_db.elf (includes assert logging)
12 4 = start_cd.elf (cutdown version for smallest memory footprint).
13 Log the variant during probe.
15 Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
17 firmware: raspberrypi: Report the fw git hash during probe
19 The firmware can now report the git hash from which it was built
20 via the mailbox, so report it during probe.
22 Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
24 drivers/firmware/raspberrypi.c | 40 +++++++++++++++++++++++++++++++++-
25 1 file changed, 39 insertions(+), 1 deletion(-)
27 --- a/drivers/firmware/raspberrypi.c
28 +++ b/drivers/firmware/raspberrypi.c
29 @@ -233,6 +233,15 @@ rpi_firmware_print_firmware_revision(str
31 time64_t date_and_time;
33 + static const char * const variant_strs[] = {
40 + const char *variant_str = "cmd unsupported";
42 int ret = rpi_firmware_property(fw,
43 RPI_FIRMWARE_GET_FIRMWARE_REVISION,
44 &packet, sizeof(packet));
45 @@ -242,7 +251,35 @@ rpi_firmware_print_firmware_revision(str
47 /* This is not compatible with y2038 */
48 date_and_time = packet;
49 - dev_info(fw->cl.dev, "Attached to firmware from %ptT\n", &date_and_time);
51 + ret = rpi_firmware_property(fw, RPI_FIRMWARE_GET_FIRMWARE_VARIANT,
52 + &variant, sizeof(variant));
55 + if (variant >= ARRAY_SIZE(variant_strs))
57 + variant_str = variant_strs[variant];
60 + dev_info(fw->cl.dev,
61 + "Attached to firmware from %ptT, variant %s\n",
62 + &date_and_time, variant_str);
66 +rpi_firmware_print_firmware_hash(struct rpi_firmware *fw)
69 + int ret = rpi_firmware_property(fw,
70 + RPI_FIRMWARE_GET_FIRMWARE_HASH,
71 + hash, sizeof(hash));
76 + dev_info(fw->cl.dev,
77 + "Firmware hash is %08x%08x%08x%08x%08x\n",
78 + hash[0], hash[1], hash[2], hash[3], hash[4]);
82 @@ -339,6 +376,7 @@ static int rpi_firmware_probe(struct pla
85 rpi_firmware_print_firmware_revision(fw);
86 + rpi_firmware_print_firmware_hash(fw);
87 rpi_register_hwmon_driver(dev, fw);
88 rpi_register_clk_driver(dev);