mirror of
				https://github.com/Ysurac/openmptcprouter.git
				synced 2025-03-09 15:40:20 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			65 lines
		
	
	
	
		
			2.2 KiB
		
	
	
	
		
			Diff
		
	
	
	
	
	
			
		
		
	
	
			65 lines
		
	
	
	
		
			2.2 KiB
		
	
	
	
		
			Diff
		
	
	
	
	
	
| From 1926dba6155c235418b6ad800112815e16b81c56 Mon Sep 17 00:00:00 2001
 | |
| From: Dave Stevenson <dave.stevenson@raspberrypi.org>
 | |
| Date: Thu, 10 Jan 2019 18:48:54 +0000
 | |
| Subject: [PATCH 296/432] 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             | 17 +++++++++++++++++
 | |
|  include/soc/bcm2835/raspberrypi-firmware.h |  1 +
 | |
|  2 files changed, 18 insertions(+)
 | |
| 
 | |
| diff --git a/drivers/firmware/raspberrypi.c b/drivers/firmware/raspberrypi.c
 | |
| index f020855f315b..fcbfe5d0015e 100644
 | |
| --- a/drivers/firmware/raspberrypi.c
 | |
| +++ b/drivers/firmware/raspberrypi.c
 | |
| @@ -262,6 +262,22 @@ rpi_firmware_print_firmware_revision(struct rpi_firmware *fw)
 | |
|  		 tm.tm_min, 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
 | |
|  rpi_register_hwmon_driver(struct device *dev, struct rpi_firmware *fw)
 | |
|  {
 | |
| @@ -308,6 +324,7 @@ static int rpi_firmware_probe(struct platform_device *pdev)
 | |
|  	g_pdev = pdev;
 | |
|  
 | |
|  	rpi_firmware_print_firmware_revision(fw);
 | |
| +	rpi_firmware_print_firmware_hash(fw);
 | |
|  	rpi_register_hwmon_driver(dev, fw);
 | |
|  
 | |
|  	return 0;
 | |
| diff --git a/include/soc/bcm2835/raspberrypi-firmware.h b/include/soc/bcm2835/raspberrypi-firmware.h
 | |
| index 17f8fe3b5d2c..23b9d356537f 100644
 | |
| --- a/include/soc/bcm2835/raspberrypi-firmware.h
 | |
| +++ b/include/soc/bcm2835/raspberrypi-firmware.h
 | |
| @@ -42,6 +42,7 @@ enum rpi_firmware_property_tag {
 | |
|  	RPI_FIRMWARE_PROPERTY_END =                           0,
 | |
|  	RPI_FIRMWARE_GET_FIRMWARE_REVISION =                  0x00000001,
 | |
|  	RPI_FIRMWARE_GET_FIRMWARE_VARIANT =                   0x00000002,
 | |
| +	RPI_FIRMWARE_GET_FIRMWARE_HASH =                      0x00000003,
 | |
|  
 | |
|  	RPI_FIRMWARE_SET_CURSOR_INFO =                        0x00008010,
 | |
|  	RPI_FIRMWARE_SET_CURSOR_STATE =                       0x00008011,
 | |
| -- 
 | |
| 2.19.1
 | |
| 
 |