1 From ab759f3138e5ea798e93003e6ce0ffe66ac2970f 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 include/soc/bcm2835/raspberrypi-firmware.h | 2 ++
26 2 files changed, 41 insertions(+), 1 deletion(-)
28 --- a/drivers/firmware/raspberrypi.c
29 +++ b/drivers/firmware/raspberrypi.c
30 @@ -234,6 +234,15 @@ rpi_firmware_print_firmware_revision(str
32 time64_t date_and_time;
34 + static const char * const variant_strs[] = {
41 + const char *variant_str = "cmd unsupported";
43 int ret = rpi_firmware_property(fw,
44 RPI_FIRMWARE_GET_FIRMWARE_REVISION,
45 &packet, sizeof(packet));
46 @@ -243,7 +252,35 @@ rpi_firmware_print_firmware_revision(str
48 /* This is not compatible with y2038 */
49 date_and_time = packet;
50 - dev_info(fw->cl.dev, "Attached to firmware from %ptT\n", &date_and_time);
52 + ret = rpi_firmware_property(fw, RPI_FIRMWARE_GET_FIRMWARE_VARIANT,
53 + &variant, sizeof(variant));
56 + if (variant >= ARRAY_SIZE(variant_strs))
58 + variant_str = variant_strs[variant];
61 + dev_info(fw->cl.dev,
62 + "Attached to firmware from %ptT, variant %s\n",
63 + &date_and_time, variant_str);
67 +rpi_firmware_print_firmware_hash(struct rpi_firmware *fw)
70 + int ret = rpi_firmware_property(fw,
71 + RPI_FIRMWARE_GET_FIRMWARE_HASH,
72 + hash, sizeof(hash));
77 + dev_info(fw->cl.dev,
78 + "Firmware hash is %08x%08x%08x%08x%08x\n",
79 + hash[0], hash[1], hash[2], hash[3], hash[4]);
83 @@ -333,6 +370,7 @@ static int rpi_firmware_probe(struct pla
86 rpi_firmware_print_firmware_revision(fw);
87 + rpi_firmware_print_firmware_hash(fw);
88 rpi_register_hwmon_driver(dev, fw);
89 rpi_register_clk_driver(dev);
91 --- a/include/soc/bcm2835/raspberrypi-firmware.h
92 +++ b/include/soc/bcm2835/raspberrypi-firmware.h
93 @@ -38,6 +38,8 @@ struct rpi_firmware_property_tag_header
94 enum rpi_firmware_property_tag {
95 RPI_FIRMWARE_PROPERTY_END = 0,
96 RPI_FIRMWARE_GET_FIRMWARE_REVISION = 0x00000001,
97 + RPI_FIRMWARE_GET_FIRMWARE_VARIANT = 0x00000002,
98 + RPI_FIRMWARE_GET_FIRMWARE_HASH = 0x00000003,
100 RPI_FIRMWARE_SET_CURSOR_INFO = 0x00008010,
101 RPI_FIRMWARE_SET_CURSOR_STATE = 0x00008011,