Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions arch/arm64/boot/dts/broadcom/bcm2712-rpi-5-b.dts
Original file line number Diff line number Diff line change
Expand Up @@ -426,6 +426,7 @@ dpi_16bit_gpio2: &rp1_dpi_16bit_gpio2 { };
vmmc-supply = <&wl_on_reg>;
sd-uhs-ddr50;
non-removable;
cap-power-off-card;
status = "okay";
#address-cells = <1>;
#size-cells = <0>;
Expand Down
1 change: 1 addition & 0 deletions arch/arm64/boot/dts/broadcom/bcm2712-rpi-cm5.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -411,6 +411,7 @@ dpi_16bit_gpio2: &rp1_dpi_16bit_gpio2 { };
vmmc-supply = <&wl_on_reg>;
sd-uhs-ddr50;
non-removable;
cap-power-off-card;
status = "okay";
#address-cells = <1>;
#size-cells = <0>;
Expand Down
2 changes: 1 addition & 1 deletion arch/arm64/configs/bcm2712_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ CONFIG_CP15_BARRIER_EMULATION=y
CONFIG_SETEND_EMULATION=y
CONFIG_RANDOMIZE_BASE=y
CONFIG_CMDLINE="console=ttyAMA0,115200 kgdboc=ttyAMA0,115200 root=/dev/mmcblk0p2 rootfstype=ext4 rootwait"
# CONFIG_SUSPEND is not set
CONFIG_SUSPEND=y
CONFIG_PM=y
CONFIG_PM_DEBUG=y
CONFIG_CPU_IDLE=y
Expand Down
20 changes: 20 additions & 0 deletions drivers/mailbox/bcm2835-mailbox.c
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,25 @@ static int bcm2835_mbox_probe(struct platform_device *pdev)
return ret;
}

static int bcm2835_mbox_resume_noirq(struct device *dev)
{
struct bcm2835_mbox *mbox = dev_get_drvdata(dev);

/*
* MAIL0_CNF is reset while the SoC is powered down in suspend-to-RAM.
* Re-enable the receive interrupt before any driver resumes, otherwise
* the replies are never signalled and every firmware transaction times
* out.
*/
writel(ARM_MC_IHAVEDATAIRQEN, mbox->regs + MAIL0_CNF);

return 0;
}

static const struct dev_pm_ops bcm2835_mbox_pm_ops = {
NOIRQ_SYSTEM_SLEEP_PM_OPS(NULL, bcm2835_mbox_resume_noirq)
};

static const struct of_device_id bcm2835_mbox_of_match[] = {
{ .compatible = "brcm,bcm2835-mbox", },
{},
Expand All @@ -193,6 +212,7 @@ static struct platform_driver bcm2835_mbox_driver = {
.driver = {
.name = "bcm2835-mbox",
.of_match_table = bcm2835_mbox_of_match,
.pm = pm_sleep_ptr(&bcm2835_mbox_pm_ops),
},
.probe = bcm2835_mbox_probe,
};
Expand Down
20 changes: 20 additions & 0 deletions drivers/watchdog/bcm2835_wdt.c
Original file line number Diff line number Diff line change
Expand Up @@ -232,11 +232,31 @@ static void bcm2835_wdt_remove(struct platform_device *pdev)
pm_power_off = NULL;
}

static int bcm2835_wdt_suspend(struct device *dev)
{
if (watchdog_active(&bcm2835_wdt_wdd) || watchdog_hw_running(&bcm2835_wdt_wdd))
bcm2835_wdt_stop(&bcm2835_wdt_wdd);

return 0;
}

static int bcm2835_wdt_resume(struct device *dev)
{
if (watchdog_active(&bcm2835_wdt_wdd) || watchdog_hw_running(&bcm2835_wdt_wdd))
bcm2835_wdt_start(&bcm2835_wdt_wdd);

return 0;
}

static DEFINE_SIMPLE_DEV_PM_OPS(bcm2835_wdt_pm_ops,
bcm2835_wdt_suspend, bcm2835_wdt_resume);

static struct platform_driver bcm2835_wdt_driver = {
.probe = bcm2835_wdt_probe,
.remove = bcm2835_wdt_remove,
.driver = {
.name = "bcm2835-wdt",
.pm = pm_sleep_ptr(&bcm2835_wdt_pm_ops),
},
};
module_platform_driver(bcm2835_wdt_driver);
Expand Down
3 changes: 2 additions & 1 deletion include/linux/acpi.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#include <linux/resource_ext.h>
#include <linux/device.h>
#include <linux/mod_devicetable.h>
#include <linux/of.h>
#include <linux/property.h>
#include <linux/uuid.h>
#include <linux/node.h>
Expand Down Expand Up @@ -1182,7 +1183,7 @@ static inline int acpi_dev_pm_attach(struct device *dev, bool power_on)
}
static inline bool acpi_storage_d3(struct device *dev)
{
return false;
return of_machine_is_compatible("brcm,bcm2712");
}
static inline bool acpi_dev_state_d0(struct device *dev)
{
Expand Down
Loading