1 From 3ab001bd58d4578bf2beb293f93a91f81e3ad3b4 Mon Sep 17 00:00:00 2001
2 From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= <noralf@tronnes.org>
3 Date: Fri, 26 Jun 2015 14:25:01 +0200
4 Subject: [PATCH 047/381] firmware: bcm2835: Support ARCH_BCM270x
6 Content-Type: text/plain; charset=UTF-8
7 Content-Transfer-Encoding: 8bit
9 Support booting without Device Tree.
11 Load driver early because of lacking support for deferred probing
14 Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
16 drivers/firmware/raspberrypi.c | 41 +++++++++++++++++++++++++++++++++++++++--
17 1 file changed, 39 insertions(+), 2 deletions(-)
19 --- a/drivers/firmware/raspberrypi.c
20 +++ b/drivers/firmware/raspberrypi.c
21 @@ -28,6 +28,8 @@ struct rpi_firmware {
25 +static struct platform_device *g_pdev;
27 static DEFINE_MUTEX(transaction_lock);
29 static void response_callback(struct mbox_client *cl, void *msg)
30 @@ -183,6 +185,25 @@ rpi_firmware_print_firmware_revision(str
34 +static int raspberrypi_firmware_set_power(struct rpi_firmware *fw,
35 + u32 domain, bool on)
43 + packet.domain = domain;
45 + ret = rpi_firmware_property(fw, RPI_FIRMWARE_SET_POWER_STATE,
46 + &packet, sizeof(packet));
47 + if (!ret && packet.on != on)
53 static int rpi_firmware_probe(struct platform_device *pdev)
55 struct device *dev = &pdev->dev;
56 @@ -207,9 +228,13 @@ static int rpi_firmware_probe(struct pla
57 init_completion(&fw->c);
59 platform_set_drvdata(pdev, fw);
62 rpi_firmware_print_firmware_revision(fw);
64 + if (raspberrypi_firmware_set_power(fw, 3, true))
65 + dev_err(dev, "failed to turn on USB power\n");
70 @@ -218,6 +243,7 @@ static int rpi_firmware_remove(struct pl
71 struct rpi_firmware *fw = platform_get_drvdata(pdev);
73 mbox_free_channel(fw->chan);
78 @@ -230,7 +256,7 @@ static int rpi_firmware_remove(struct pl
80 struct rpi_firmware *rpi_firmware_get(struct device_node *firmware_node)
82 - struct platform_device *pdev = of_find_device_by_node(firmware_node);
83 + struct platform_device *pdev = g_pdev;
87 @@ -253,7 +279,18 @@ static struct platform_driver rpi_firmwa
88 .probe = rpi_firmware_probe,
89 .remove = rpi_firmware_remove,
91 -module_platform_driver(rpi_firmware_driver);
93 +static int __init rpi_firmware_init(void)
95 + return platform_driver_register(&rpi_firmware_driver);
97 +subsys_initcall(rpi_firmware_init);
99 +static void __init rpi_firmware_exit(void)
101 + platform_driver_unregister(&rpi_firmware_driver);
103 +module_exit(rpi_firmware_exit);
105 MODULE_AUTHOR("Eric Anholt <eric@anholt.net>");
106 MODULE_DESCRIPTION("Raspberry Pi firmware driver");