summaryrefslogtreecommitdiff
path: root/drivers/firmware/raspberrypi.c
AgeCommit message (Collapse)AuthorFilesLines
2019-01-09firmware: raspberrypi: notify VC4 firmware of a rebootStefan Wahren1-0/+11
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>
2018-11-21firmware: raspberrypi: Switch to SPDX identifierStefan Wahren1-4/+1
Adopt the SPDX license identifier headers to ease license compliance management. Cc: Eric Anholt <eric@anholt.net> Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com> Reviewed-by: Eric Anholt <eric@anholt.net>
2018-11-18firmware: raspberrypi: Fix firmware calls with large buffersJames Hughes1-17/+18
Commit a1547e0bca51 ("firmware: raspberrypi: Remove VLA usage") moved away from VLA's to a fixed maximum size for mailbox data. However, some mailbox calls use larger data buffers than the maximum allowed in that change. This fix therefor moves from using fixed buffers to kmalloc to ensure all sizes are catered for. There is some documentation, which is somewhat out of date, on the mailbox calls here : https://github.com/raspberrypi/firmware/wiki/Mailbox-property-interface Fixes: a1547e0bca51 ("firmware: raspberrypi: Remove VLA usage") Signed-off-by: James Hughes <james.hughes@raspberrypi.org> Reviewed-by: Eric Anholt <eric@anholt.net> Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
2018-11-14firmware: raspberrypi: Define timeout for transactionsStefan Wahren1-2/+6
We should never assume to get a reply from the firmware otherwise the call could block forever and the user don't get informed. So define a timeout of 1 sec and print a stacktrace once in the unlikely case the timeout expired. Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com> Reviewed-by: Eric Anholt <eric@anholt.net>
2018-07-09firmware: raspberrypi: Remove VLA usageKees Cook1-2/+8
In the quest to remove all stack VLA usage from the kernel[1], this removes the VLA in favor of a maximum size and adds a sanity check. Existing callers of the firmware interface never need more than 24 bytes (struct gpio_set_config). This chooses 32 just to stay ahead of future growth. v2: Fix the length passed to rpi_firmware_property_list (by anholt, acked by Kees). [1] https://lkml.kernel.org/r/CA+55aFzCG-zNmZwX4A2FQpadafLfEzK6CC=qPXydAacU1RqZWA@mail.gmail.com Signed-off-by: Kees Cook <keescook@chromium.org> Signed-off-by: Eric Anholt <eric@anholt.net> Reviewed-by: Eric Anholt <eric@anholt.net>
2018-07-09firmware: raspberrypi: Register hwmon driverStefan Wahren1-0/+19
Since the raspberrypi-hwmon driver is tied to the VC4 firmware instead of particular hardware its registration should be in the firmware driver. Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com> Signed-off-by: Eric Anholt <eric@anholt.net>
2017-11-29firmware: raspberrypi: print time using time64_tArnd Bergmann1-1/+1
The firmware timestamp is an unsigned 32-bit value, but we copy it into a signed 32-bit variable, so we can theoretically get an overflow in the calculation when the timestamp is between 2038 and 2106. This changes the temporary variable to time64_t and changes the deprecated time_to_tm() over to time64_to_tm() accordingly. There is still an overflow in y2106, but that is a limitation of the firmware interface, not a kernel problem. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Eric Anholt <eric@anholt.net> Reviewed-by: Eric Anholt <eric@anholt.net>
2015-10-15ARM: bcm2835: Add the Raspberry Pi firmware driverEric Anholt1-0/+260
This gives us a function for making mailbox property channel requests of the firmware, which is most notable in that it will let us get and set clock rates. Signed-off-by: Eric Anholt <eric@anholt.net> Acked-by: Stephen Warren <swarren@wwwdotorg.org>