1 From 127e0899869365f5dc078e1ed84429ce81df90dc 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 295/703] 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 drivers/firmware/raspberrypi.c | 32 +++++++++++++++++-----
18 include/soc/bcm2835/raspberrypi-firmware.h | 1 +
19 2 files changed, 26 insertions(+), 7 deletions(-)
21 --- a/drivers/firmware/raspberrypi.c
22 +++ b/drivers/firmware/raspberrypi.c
23 @@ -227,21 +227,39 @@ static const struct attribute_group rpi_
25 rpi_firmware_print_firmware_revision(struct rpi_firmware *fw)
27 + static const char * const variant_strs[] = {
34 + const char *variant_str = "cmd unsupported";
38 int ret = rpi_firmware_property(fw,
39 RPI_FIRMWARE_GET_FIRMWARE_REVISION,
40 &packet, sizeof(packet));
47 - time64_to_tm(packet, 0, &tm);
48 + ret = rpi_firmware_property(fw, RPI_FIRMWARE_GET_FIRMWARE_VARIANT,
49 + &variant, sizeof(variant));
51 - dev_info(fw->cl.dev,
52 - "Attached to firmware from %04ld-%02d-%02d %02d:%02d\n",
53 - tm.tm_year + 1900, tm.tm_mon + 1, tm.tm_mday,
54 - tm.tm_hour, tm.tm_min);
56 + if (variant >= ARRAY_SIZE(variant_strs))
58 + variant_str = variant_strs[variant];
61 + time64_to_tm(packet, 0, &tm);
63 + dev_info(fw->cl.dev,
64 + "Attached to firmware from %04ld-%02d-%02d %02d:%02d, variant %s\n",
65 + tm.tm_year + 1900, tm.tm_mon + 1, tm.tm_mday, tm.tm_hour,
66 + tm.tm_min, variant_str);
70 --- a/include/soc/bcm2835/raspberrypi-firmware.h
71 +++ b/include/soc/bcm2835/raspberrypi-firmware.h
72 @@ -41,6 +41,7 @@ struct rpi_firmware_property_tag_header
73 enum rpi_firmware_property_tag {
74 RPI_FIRMWARE_PROPERTY_END = 0,
75 RPI_FIRMWARE_GET_FIRMWARE_REVISION = 0x00000001,
76 + RPI_FIRMWARE_GET_FIRMWARE_VARIANT = 0x00000002,
78 RPI_FIRMWARE_SET_CURSOR_INFO = 0x00008010,
79 RPI_FIRMWARE_SET_CURSOR_STATE = 0x00008011,