Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 187b4ac7 authored by Arnd Bergmann's avatar Arnd Bergmann
Browse files

Merge tag 'arm-soc/for-5.1/drivers' of https://github.com/Broadcom/stblinux into arm/drivers

This pull request contains Broadcom ARM/ARM64/MIPS based SoCs changes
for 5.1, please pull the following:

- Stefan updates the BCM2835 SoC driver with downstream properties and
  uses that to implement a reboot notifier to tell the VC4 firmware when
  Linux on the ARM CPU is rebooting

- Eric adds a proper power domain driver for the BCM283x SoCs and
  updates a bunch of drivers to have a better and clearer Device Tree
  definition to support power domains/breaking up of functionality. This
  requires converting the existing watchdog driver into a MFD and then
  breaking up the functionality into separate drivers and finally
  updating the DTS files to leverage the power domains information.

- Wei provides a fix for making a symbol static

* tag 'arm-soc/for-5.1/drivers' of https://github.com/Broadcom/stblinux

:
  ARM: bcm283x: Switch V3D over to using the PM driver instead of firmware.
  ARM: bcm283x: Extend the WDT DT node out to cover the whole PM block. (v4)
  soc: bcm: bcm2835-pm: Make local symbol static
  soc: bcm: Make PM driver default for BCM2835
  soc: bcm: bcm2835-pm: Add support for power domains under a new binding.
  bcm2835-pm: Move bcm2835-watchdog's DT probe to an MFD.
  dt-bindings: soc: Add a new binding for the BCM2835 PM node. (v4)
  firmware: raspberrypi: notify VC4 firmware of a reboot
  soc: bcm2835: sync firmware properties with downstream

Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
parents 405bcfff 50de6494
Loading
Loading
Loading
Loading
+46 −0
Original line number Diff line number Diff line
BCM2835 PM (Power domains, watchdog)

The PM block controls power domains and some reset lines, and includes
a watchdog timer.  This binding supersedes the brcm,bcm2835-pm-wdt
binding which covered some of PM's register range and functionality.

Required properties:

- compatible:		Should be "brcm,bcm2835-pm"
- reg:			Specifies base physical address and size of the two
			  register ranges ("PM" and "ASYNC_BRIDGE" in that
			  order)
- clocks:		a) v3d: The V3D clock from CPRMAN
			b) peri_image: The PERI_IMAGE clock from CPRMAN
			c) h264: The H264 clock from CPRMAN
			d) isp: The ISP clock from CPRMAN
- #reset-cells: 	Should be 1.  This property follows the reset controller
			  bindings[1].
- #power-domain-cells:	Should be 1.  This property follows the power domain
			  bindings[2].

Optional properties:

- timeout-sec:		Contains the watchdog timeout in seconds
- system-power-controller: Whether the watchdog is controlling the
    system power.  This node follows the power controller bindings[3].

[1] Documentation/devicetree/bindings/reset/reset.txt
[2] Documentation/devicetree/bindings/power/power_domain.txt
[3] Documentation/devicetree/bindings/power/power-controller.txt

Example:

pm {
	compatible = "brcm,bcm2835-pm", "brcm,bcm2835-pm-wdt";
	#power-domain-cells = <1>;
	#reset-cells = <1>;
	reg = <0x7e100000 0x114>,
	      <0x7e00a000 0x24>;
	clocks = <&clocks BCM2835_CLOCK_V3D>,
		 <&clocks BCM2835_CLOCK_PERI_IMAGE>,
		 <&clocks BCM2835_CLOCK_H264>,
		 <&clocks BCM2835_CLOCK_ISP>;
	clock-names = "v3d", "peri_image", "h264", "isp";
	system-power-controller;
};
+0 −4
Original line number Diff line number Diff line
@@ -87,10 +87,6 @@
	power-domains = <&power RPI_POWER_DOMAIN_USB>;
};

&v3d {
	power-domains = <&power RPI_POWER_DOMAIN_V3D>;
};

&hdmi {
	power-domains = <&power RPI_POWER_DOMAIN_HDMI>;
	status = "okay";
+14 −3
Original line number Diff line number Diff line
@@ -3,6 +3,7 @@
#include <dt-bindings/clock/bcm2835-aux.h>
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/interrupt-controller/irq.h>
#include <dt-bindings/soc/bcm2835-pm.h>

/* firmware-provided startup stubs live here, where the secondary CPUs are
 * spinning.
@@ -120,9 +121,18 @@
			#interrupt-cells = <2>;
		};

		watchdog@7e100000 {
			compatible = "brcm,bcm2835-pm-wdt";
			reg = <0x7e100000 0x28>;
		pm: watchdog@7e100000 {
			compatible = "brcm,bcm2835-pm", "brcm,bcm2835-pm-wdt";
			#power-domain-cells = <1>;
			#reset-cells = <1>;
			reg = <0x7e100000 0x114>,
			      <0x7e00a000 0x24>;
			clocks = <&clocks BCM2835_CLOCK_V3D>,
				 <&clocks BCM2835_CLOCK_PERI_IMAGE>,
				 <&clocks BCM2835_CLOCK_H264>,
				 <&clocks BCM2835_CLOCK_ISP>;
			clock-names = "v3d", "peri_image", "h264", "isp";
			system-power-controller;
		};

		clocks: cprman@7e101000 {
@@ -629,6 +639,7 @@
			compatible = "brcm,bcm2835-v3d";
			reg = <0x7ec00000 0x1000>;
			interrupts = <1 10>;
			power-domains = <&pm BCM2835_POWER_DOMAIN_GRAFX_V3D>;
		};

		vc4: gpu {
+1 −0
Original line number Diff line number Diff line
@@ -167,6 +167,7 @@ config ARCH_BCM2835
	select BCM2835_TIMER
	select PINCTRL
	select PINCTRL_BCM2835
	select MFD_CORE
	help
	  This enables support for the Broadcom BCM2835 and BCM2836 SoCs.
	  This SoC is used in the Raspberry Pi and Roku 2 devices.
+11 −0
Original line number Diff line number Diff line
@@ -238,6 +238,16 @@ static int rpi_firmware_probe(struct platform_device *pdev)
	return 0;
}

static void rpi_firmware_shutdown(struct platform_device *pdev)
{
	struct rpi_firmware *fw = platform_get_drvdata(pdev);

	if (!fw)
		return;

	rpi_firmware_property(fw, RPI_FIRMWARE_NOTIFY_REBOOT, NULL, 0);
}

static int rpi_firmware_remove(struct platform_device *pdev)
{
	struct rpi_firmware *fw = platform_get_drvdata(pdev);
@@ -278,6 +288,7 @@ static struct platform_driver rpi_firmware_driver = {
		.of_match_table = rpi_firmware_of_match,
	},
	.probe		= rpi_firmware_probe,
	.shutdown	= rpi_firmware_shutdown,
	.remove		= rpi_firmware_remove,
};
module_platform_driver(rpi_firmware_driver);
Loading