mirror of
https://github.com/smaeul/u-boot.git
synced 2025-10-30 19:48:19 +00:00
When bringing in the series 'arm: dts: am62-beagleplay: Fix Beagleplay Ethernet"' I failed to notice that b4 noticed it was based on next and so took that as the base commit and merged that part of next to master. This reverts commit c8ffd1356d42223cbb8c86280a083cc3c93e6426, reversing changes made to 2ee6f3a5f7550de3599faef9704e166e5dcace35. Reported-by: Jonas Karlman <jonas@kwiboo.se> Signed-off-by: Tom Rini <trini@konsulko.com>
79 lines
1.7 KiB
C
79 lines
1.7 KiB
C
// SPDX-License-Identifier: GPL-2.0
|
|
/*
|
|
* Copyright (c) 2021, Xilinx. Inc.
|
|
*/
|
|
|
|
#include <common.h>
|
|
#include <dm.h>
|
|
#include <dm/device_compat.h>
|
|
#include <log.h>
|
|
#include <malloc.h>
|
|
#include <misc.h>
|
|
#include <power-domain-uclass.h>
|
|
#include <linux/bitops.h>
|
|
|
|
#include <zynqmp_firmware.h>
|
|
|
|
static int zynqmp_pm_request_node(const u32 node, const u32 capabilities,
|
|
const u32 qos, const enum zynqmp_pm_request_ack ack)
|
|
{
|
|
return xilinx_pm_request(PM_REQUEST_NODE, node, capabilities,
|
|
qos, ack, NULL);
|
|
}
|
|
|
|
static int zynqmp_power_domain_request(struct power_domain *power_domain)
|
|
{
|
|
int ret = 0;
|
|
|
|
dev_dbg(power_domain->dev, "Request for id: %ld\n", power_domain->id);
|
|
|
|
if (IS_ENABLED(CONFIG_ARCH_ZYNQMP)) {
|
|
ret = zynqmp_pmufw_node(power_domain->id);
|
|
if (ret == -ENODEV)
|
|
ret = 0;
|
|
}
|
|
|
|
return ret;
|
|
}
|
|
|
|
static int zynqmp_power_domain_free(struct power_domain *power_domain)
|
|
{
|
|
/* nop now */
|
|
return 0;
|
|
}
|
|
|
|
static int zynqmp_power_domain_on(struct power_domain *power_domain)
|
|
{
|
|
dev_dbg(power_domain->dev, "Domain ON for id: %ld\n", power_domain->id);
|
|
|
|
return zynqmp_pm_request_node(power_domain->id,
|
|
ZYNQMP_PM_CAPABILITY_ACCESS,
|
|
ZYNQMP_PM_MAX_QOS,
|
|
ZYNQMP_PM_REQUEST_ACK_BLOCKING);
|
|
}
|
|
|
|
static int zynqmp_power_domain_off(struct power_domain *power_domain)
|
|
{
|
|
/* nop now */
|
|
return 0;
|
|
}
|
|
|
|
struct power_domain_ops zynqmp_power_domain_ops = {
|
|
.request = zynqmp_power_domain_request,
|
|
.rfree = zynqmp_power_domain_free,
|
|
.on = zynqmp_power_domain_on,
|
|
.off = zynqmp_power_domain_off,
|
|
};
|
|
|
|
static int zynqmp_power_domain_probe(struct udevice *dev)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
U_BOOT_DRIVER(zynqmp_power_domain) = {
|
|
.name = "zynqmp_power_domain",
|
|
.id = UCLASS_POWER_DOMAIN,
|
|
.probe = zynqmp_power_domain_probe,
|
|
.ops = &zynqmp_power_domain_ops,
|
|
};
|