aboutsummaryrefslogtreecommitdiff
path: root/include/soc/bcm2835
AgeCommit message (Collapse)AuthorFilesLines
2023-01-10firmware: raspberrypi: Fix type assignmentMaxime Ripard1-1/+1
We silently cast an unsigned int into a __le32 which makes sparse complain. Moreover, we never actually convert endianness between the CPU's and the expected little-endian value. Fix both at once by calling cpu_to_le32(). Fixes: 40c31955e4e9 ("firmware: raspberrypi: Provide a helper to query a clock max rate") Reported-by: kernel test robot <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Maxime Ripard <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Florian Fainelli <[email protected]>
2022-10-28firmware: raspberrypi: Provide a helper to query a clock max rateMaxime Ripard1-0/+26
The firmware allows to query for its clocks the operating range of a given clock. We'll need this for some drivers (KMS, in particular) to infer the state of some configuration options, so let's create a function to do so. Acked-by: Stephen Boyd <[email protected]> Reviewed-by: Florian Fainelli <[email protected]> Acked-by: Florian Fainelli <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Maxime Ripard <[email protected]>
2022-10-28firmware: raspberrypi: Move the clock IDs to the firmware headerMaxime Ripard1-0/+19
We'll need the clock IDs in more drivers than just the clock driver from now on, so let's move them in the firmware header. Reviewed-by: Florian Fainelli <[email protected]> Acked-by: Stephen Boyd <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Maxime Ripard <[email protected]>
2022-10-28firmware: raspberrypi: Introduce rpi_firmware_find_node()Maxime Ripard1-0/+7
A significant number of RaspberryPi drivers using the firmware don't have a phandle to it, so end up scanning the device tree to find a node with the firmware compatible. That code is duplicated everywhere, so let's introduce a helper instead. Acked-by: Florian Fainelli <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Maxime Ripard <[email protected]>
2022-01-11firmware: raspberrypi: Add RPI_FIRMWARE_NOTIFY_DISPLAY_DONEMaxime Ripard1-0/+1
The RPI_FIRMWARE_NOTIFY_DISPLAY_DONE firmware call allows to tell the firmware the kernel is in charge of the display now and the firmware can free whatever resources it was using. Acked-by: Nicolas Saenz Julienne <[email protected]> Signed-off-by: Maxime Ripard <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2021-03-22firmware: raspberrypi: Introduce devm_rpi_firmware_get()Nicolas Saenz Julienne1-0/+8
It'll simplify the firmware handling for most consumers. Suggested-by: Bartosz Golaszewski <[email protected]> Signed-off-by: Nicolas Saenz Julienne <[email protected]> Reviewed-by: Florian Fainelli <[email protected]> Reviewed-by: Bartosz Golaszewski <[email protected]>
2021-03-22firmware: raspberrypi: Keep count of all consumersNicolas Saenz Julienne1-0/+2
When unbinding the firmware device we need to make sure it has no consumers left. Otherwise we'd leave them with a firmware handle pointing at freed memory. Keep a reference count of all consumers and introduce rpi_firmware_put() which will permit automatically decrease the reference count upon unbinding consumer drivers. Suggested-by: Uwe Kleine-König <[email protected]> Signed-off-by: Nicolas Saenz Julienne <[email protected]> Reviewed-by: Florian Fainelli <[email protected]> Reviewed-by: Stephen Boyd <[email protected]> Reviewed-by: Bartosz Golaszewski <[email protected]>
2020-08-18Revert "firmware: raspberrypi: Introduce vl805 init routine"Nicolas Saenz Julienne1-7/+0
This reverts commit fbbc5ff3f7f9f4cad562e530ae2cf5d8964fe6d3. The vl805 init routine has moved into drivers/reset/reset-raspberrypi.c Reviewed-by: Florian Fainelli <[email protected]> Signed-off-by: Nicolas Saenz Julienne <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
2020-05-13firmware: raspberrypi: Introduce vl805 init routineNicolas Saenz Julienne1-0/+7
The Raspberry Pi 4 gets its USB functionality from VL805, a PCIe chip that implements xHCI. After a PCI reset, VL805's firmware may either be loaded directly from an EEPROM or, if not present, by the SoC's co-processor, VideoCore. RPi4's VideoCore OS contains both the non public firmware load logic and the VL805 firmware blob. The function this patch introduces triggers the aforementioned process. Link: https://lore.kernel.org/r/[email protected] Tested-by: Stefan Wahren <[email protected]> Tested-by: Stefan Wahren <[email protected]> Signed-off-by: Nicolas Saenz Julienne <[email protected]> Signed-off-by: Lorenzo Pieralisi <[email protected]> Reviewed-by: Rob Herring <[email protected]>
2020-05-13soc: bcm2835: Add notify xHCI reset propertyNicolas Saenz Julienne1-1/+1
The property is needed in order to trigger VL805's firmware load. Note that gap between the property introduced and the previous one is due to the properties not being defined. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Nicolas Saenz Julienne <[email protected]> Signed-off-by: Lorenzo Pieralisi <[email protected]> Reviewed-by: Florian Fainelli <[email protected]> Reviewed-by: Rob Herring <[email protected]>
2019-01-09soc: bcm2835: sync firmware properties with downstreamStefan Wahren1-0/+4
Add latest firmware property tags from the latest Raspberry Pi downstream kernel. This is needed to use the reboot notify in the following commit. Signed-off-by: Stefan Wahren <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
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 <[email protected]> Signed-off-by: Stefan Wahren <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
2018-06-21ARM: bcm2835: Add GET_THROTTLED firmware propertyStefan Wahren1-0/+1
Recent Raspberry Pi firmware provides a mailbox property to detect under-voltage conditions. Here is the current definition. The u32 value returned by the firmware is divided into 2 parts: - lower 16-bits are the live value - upper 16-bits are the history or sticky value Bits: 0: undervoltage 1: arm frequency capped 2: currently throttled 16: undervoltage has occurred 17: arm frequency capped has occurred 18: throttling has occurred Signed-off-by: Stefan Wahren <[email protected]> Signed-off-by: Eric Anholt <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
2018-04-16soc: bcm2835: Make !RASPBERRYPI_FIRMWARE dummies return failureGeert Uytterhoeven1-2/+2
If CONFIG_RASPBERRYPI_FIRMWARE=n: drivers/gpio/gpio-raspberrypi-exp.c: In function ‘rpi_exp_gpio_get_polarity’: drivers/gpio/gpio-raspberrypi-exp.c:71: warning: ‘get.polarity’ is used uninitialized in this function drivers/gpio/gpio-raspberrypi-exp.c: In function ‘rpi_exp_gpio_get_direction’: drivers/gpio/gpio-raspberrypi-exp.c:150: warning: ‘get.direction’ is used uninitialized in this function The dummy firmware interface functions return 0, which means success, causing subsequent code to make use of the never initialized output parameter. Fix this by making the dummy functions return an error code (-ENOSYS) instead. Note that this assumes the firmware always fills in the requested data in the CONFIG_RASPBERRYPI_FIRMWARE=y case. Fixes: d45f1a563b92dac7 ("staging: vc04_services: fix up rpi firmware functions") Signed-off-by: Geert Uytterhoeven <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Signed-off-by: Florian Fainelli <[email protected]>
2018-02-22soc: bcm2835: sync firmware properties with downstreamBaruch Siach1-0/+18
Add latest firmware property tags from the latest Raspberry Pi downstream kernel. This is needed for the GPIO tags, so we can control the GPIO multiplexor lines. Acked-by: Stefan Wahren <[email protected]> Signed-off-by: Baruch Siach <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2016-10-16staging: vc04_services: fix up rpi firmware functionsGreg Kroah-Hartman1-0/+19
The raspberrypi-firmware.h file should provide empty functions if we aren't building in that option. This makes it easier to test-build code, and not have odd warnings about unused variables if you just try to #define away the functions. Cc: Daniel Stone <[email protected]> Cc: "Noralf Trønnes" <[email protected]> Cc: Pranith Kumar <[email protected]> Cc: popcornmix <[email protected]> Cc: Eric Anholt <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2016-10-16ARM: bcm2835: Add #define for VCHIQ property message.Eric Anholt1-0/+2
This comes from the downstream tree and is needed for the new VCHIQ driver in staging. Signed-off-by: Eric Anholt <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2015-12-21ARM: bcm2835: Define two new packets from the latest firmware.Eric Anholt1-0/+2
These packets give us direct access to the firmware's power management code, as opposed to GET/SET_POWER_STATE packets that only had a couple of domains implemented. Signed-off-by: Eric Anholt <[email protected]> Reviewed-by: Kevin Hilman <[email protected]>
2015-10-24ARM: bcm2835: add mutual inclusion protectionAlexander Aring1-0/+5
This patch adds mutual inclusion protection for the rpi firmware header. Cc: Eric Anholt <[email protected]> Cc: Stephen Warren <[email protected]> Signed-off-by: Alexander Aring <[email protected]> Signed-off-by: Florian Fainelli <[email protected]>
2015-10-14ARM: bcm2835: Add the Raspberry Pi firmware driverEric Anholt1-0/+115
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 <[email protected]> Acked-by: Stephen Warren <[email protected]>