2019-09-19 14:43:19 +00:00
|
|
|
From 6f190ee10a1d3276450e6190bb6d75a03040dcef Mon Sep 17 00:00:00 2001
|
2019-07-09 18:32:28 +00:00
|
|
|
From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= <noralf@tronnes.org>
|
|
|
|
Date: Fri, 26 Jun 2015 14:25:01 +0200
|
2019-12-23 12:42:55 +00:00
|
|
|
Subject: [PATCH] firmware: bcm2835: Support ARCH_BCM270x
|
2019-07-09 18:32:28 +00:00
|
|
|
MIME-Version: 1.0
|
|
|
|
Content-Type: text/plain; charset=UTF-8
|
|
|
|
Content-Transfer-Encoding: 8bit
|
|
|
|
|
|
|
|
Support booting without Device Tree.
|
|
|
|
Turn on USB power.
|
|
|
|
Load driver early because of lacking support for deferred probing
|
|
|
|
in many drivers.
|
|
|
|
|
|
|
|
Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
|
|
|
|
|
|
|
|
firmware: bcm2835: Don't turn on USB power
|
|
|
|
|
|
|
|
The raspberrypi-power driver is now used to turn on USB power.
|
|
|
|
|
|
|
|
This partly reverts commit:
|
|
|
|
firmware: bcm2835: Support ARCH_BCM270x
|
|
|
|
|
|
|
|
Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
|
|
|
|
---
|
|
|
|
drivers/firmware/raspberrypi.c | 19 +++++++++++++++++--
|
|
|
|
1 file changed, 17 insertions(+), 2 deletions(-)
|
|
|
|
|
|
|
|
--- a/drivers/firmware/raspberrypi.c
|
|
|
|
+++ b/drivers/firmware/raspberrypi.c
|
2019-12-18 15:38:57 +00:00
|
|
|
@@ -31,6 +31,8 @@ struct rpi_firmware {
|
2019-07-09 18:32:28 +00:00
|
|
|
u32 enabled;
|
|
|
|
};
|
|
|
|
|
|
|
|
+static struct platform_device *g_pdev;
|
|
|
|
+
|
|
|
|
static DEFINE_MUTEX(transaction_lock);
|
|
|
|
|
|
|
|
static void response_callback(struct mbox_client *cl, void *msg)
|
2019-12-18 15:38:57 +00:00
|
|
|
@@ -230,6 +232,7 @@ static int rpi_firmware_probe(struct pla
|
2019-07-09 18:32:28 +00:00
|
|
|
init_completion(&fw->c);
|
|
|
|
|
|
|
|
platform_set_drvdata(pdev, fw);
|
|
|
|
+ g_pdev = pdev;
|
|
|
|
|
|
|
|
rpi_firmware_print_firmware_revision(fw);
|
|
|
|
rpi_register_hwmon_driver(dev, fw);
|
2019-12-18 15:38:57 +00:00
|
|
|
@@ -244,6 +247,7 @@ static int rpi_firmware_remove(struct pl
|
2019-07-09 18:32:28 +00:00
|
|
|
platform_device_unregister(rpi_hwmon);
|
|
|
|
rpi_hwmon = NULL;
|
|
|
|
mbox_free_channel(fw->chan);
|
|
|
|
+ g_pdev = NULL;
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
2019-12-18 15:38:57 +00:00
|
|
|
@@ -256,7 +260,7 @@ static int rpi_firmware_remove(struct pl
|
2019-07-09 18:32:28 +00:00
|
|
|
*/
|
|
|
|
struct rpi_firmware *rpi_firmware_get(struct device_node *firmware_node)
|
|
|
|
{
|
|
|
|
- struct platform_device *pdev = of_find_device_by_node(firmware_node);
|
|
|
|
+ struct platform_device *pdev = g_pdev;
|
|
|
|
|
|
|
|
if (!pdev)
|
|
|
|
return NULL;
|
2019-12-18 15:38:57 +00:00
|
|
|
@@ -279,7 +283,18 @@ static struct platform_driver rpi_firmwa
|
2019-07-09 18:32:28 +00:00
|
|
|
.probe = rpi_firmware_probe,
|
|
|
|
.remove = rpi_firmware_remove,
|
|
|
|
};
|
|
|
|
-module_platform_driver(rpi_firmware_driver);
|
|
|
|
+
|
|
|
|
+static int __init rpi_firmware_init(void)
|
|
|
|
+{
|
|
|
|
+ return platform_driver_register(&rpi_firmware_driver);
|
|
|
|
+}
|
|
|
|
+subsys_initcall(rpi_firmware_init);
|
|
|
|
+
|
|
|
|
+static void __init rpi_firmware_exit(void)
|
|
|
|
+{
|
|
|
|
+ platform_driver_unregister(&rpi_firmware_driver);
|
|
|
|
+}
|
|
|
|
+module_exit(rpi_firmware_exit);
|
|
|
|
|
|
|
|
MODULE_AUTHOR("Eric Anholt <eric@anholt.net>");
|
|
|
|
MODULE_DESCRIPTION("Raspberry Pi firmware driver");
|