Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

firmware: raspberrypi: notify VC4 firmware of a reboot

The firmware-owned GPIO expander on RPi 3 B+ must be in same state
after a reboot as initial power on. Otherwise this would cause a
network boot failure of the BOOTROM. So inform the VC4 firmware to restore
the expander before doing a reboot.

Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
Tested-by: Phil Elwell <phil@raspberrypi.org>
Reviewed-by: Eric Anholt <eric@anholt.net>

+11
+11
drivers/firmware/raspberrypi.c
··· 238 238 return 0; 239 239 } 240 240 241 + static void rpi_firmware_shutdown(struct platform_device *pdev) 242 + { 243 + struct rpi_firmware *fw = platform_get_drvdata(pdev); 244 + 245 + if (!fw) 246 + return; 247 + 248 + rpi_firmware_property(fw, RPI_FIRMWARE_NOTIFY_REBOOT, NULL, 0); 249 + } 250 + 241 251 static int rpi_firmware_remove(struct platform_device *pdev) 242 252 { 243 253 struct rpi_firmware *fw = platform_get_drvdata(pdev); ··· 288 278 .of_match_table = rpi_firmware_of_match, 289 279 }, 290 280 .probe = rpi_firmware_probe, 281 + .shutdown = rpi_firmware_shutdown, 291 282 .remove = rpi_firmware_remove, 292 283 }; 293 284 module_platform_driver(rpi_firmware_driver);