forked from torvalds/linux
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge tag 'arm-soc/for-5.1/drivers' of https://github.com/Broadcom/st…
…blinux 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: Arnd Bergmann <[email protected]>
- Loading branch information
Showing
14 changed files
with
894 additions
and
24 deletions.
There are no files selected for viewing
46 changes: 46 additions & 0 deletions
46
Documentation/devicetree/bindings/soc/bcm/brcm,bcm2835-pm.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
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; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
// SPDX-License-Identifier: GPL-2.0+ | ||
/* | ||
* PM MFD driver for Broadcom BCM2835 | ||
* | ||
* This driver binds to the PM block and creates the MFD device for | ||
* the WDT and power drivers. | ||
*/ | ||
|
||
#include <linux/delay.h> | ||
#include <linux/io.h> | ||
#include <linux/mfd/bcm2835-pm.h> | ||
#include <linux/mfd/core.h> | ||
#include <linux/module.h> | ||
#include <linux/of_address.h> | ||
#include <linux/of_platform.h> | ||
#include <linux/platform_device.h> | ||
#include <linux/types.h> | ||
#include <linux/watchdog.h> | ||
|
||
static const struct mfd_cell bcm2835_pm_devs[] = { | ||
{ .name = "bcm2835-wdt" }, | ||
}; | ||
|
||
static const struct mfd_cell bcm2835_power_devs[] = { | ||
{ .name = "bcm2835-power" }, | ||
}; | ||
|
||
static int bcm2835_pm_probe(struct platform_device *pdev) | ||
{ | ||
struct resource *res; | ||
struct device *dev = &pdev->dev; | ||
struct bcm2835_pm *pm; | ||
int ret; | ||
|
||
pm = devm_kzalloc(dev, sizeof(*pm), GFP_KERNEL); | ||
if (!pm) | ||
return -ENOMEM; | ||
platform_set_drvdata(pdev, pm); | ||
|
||
pm->dev = dev; | ||
|
||
res = platform_get_resource(pdev, IORESOURCE_MEM, 0); | ||
pm->base = devm_ioremap_resource(dev, res); | ||
if (IS_ERR(pm->base)) | ||
return PTR_ERR(pm->base); | ||
|
||
ret = devm_mfd_add_devices(dev, -1, | ||
bcm2835_pm_devs, ARRAY_SIZE(bcm2835_pm_devs), | ||
NULL, 0, NULL); | ||
if (ret) | ||
return ret; | ||
|
||
/* We'll use the presence of the AXI ASB regs in the | ||
* bcm2835-pm binding as the key for whether we can reference | ||
* the full PM register range and support power domains. | ||
*/ | ||
res = platform_get_resource(pdev, IORESOURCE_MEM, 1); | ||
if (res) { | ||
pm->asb = devm_ioremap_resource(dev, res); | ||
if (IS_ERR(pm->asb)) | ||
return PTR_ERR(pm->asb); | ||
|
||
ret = devm_mfd_add_devices(dev, -1, | ||
bcm2835_power_devs, | ||
ARRAY_SIZE(bcm2835_power_devs), | ||
NULL, 0, NULL); | ||
if (ret) | ||
return ret; | ||
} | ||
|
||
return 0; | ||
} | ||
|
||
static const struct of_device_id bcm2835_pm_of_match[] = { | ||
{ .compatible = "brcm,bcm2835-pm-wdt", }, | ||
{ .compatible = "brcm,bcm2835-pm", }, | ||
{}, | ||
}; | ||
MODULE_DEVICE_TABLE(of, bcm2835_pm_of_match); | ||
|
||
static struct platform_driver bcm2835_pm_driver = { | ||
.probe = bcm2835_pm_probe, | ||
.driver = { | ||
.name = "bcm2835-pm", | ||
.of_match_table = bcm2835_pm_of_match, | ||
}, | ||
}; | ||
module_platform_driver(bcm2835_pm_driver); | ||
|
||
MODULE_AUTHOR("Eric Anholt <[email protected]>"); | ||
MODULE_DESCRIPTION("Driver for Broadcom BCM2835 PM MFD"); | ||
MODULE_LICENSE("GPL"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
obj-$(CONFIG_BCM2835_POWER) += bcm2835-power.o | ||
obj-$(CONFIG_RASPBERRYPI_POWER) += raspberrypi-power.o | ||
obj-$(CONFIG_SOC_BRCMSTB) += brcmstb/ |
Oops, something went wrong.