mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-11-11 23:47:24 +00:00
83d290c56f
When U-Boot started using SPDX tags we were among the early adopters and there weren't a lot of other examples to borrow from. So we picked the area of the file that usually had a full license text and replaced it with an appropriate SPDX-License-Identifier: entry. Since then, the Linux Kernel has adopted SPDX tags and they place it as the very first line in a file (except where shebangs are used, then it's second line) and with slightly different comment styles than us. In part due to community overlap, in part due to better tag visibility and in part for other minor reasons, switch over to that style. This commit changes all instances where we have a single declared license in the tag as both the before and after are identical in tag contents. There's also a few places where I found we did not have a tag and have introduced one. Signed-off-by: Tom Rini <trini@konsulko.com>
80 lines
1.8 KiB
C
80 lines
1.8 KiB
C
// SPDX-License-Identifier: GPL-2.0
|
|
/*
|
|
* Copyright (c) 2016, NVIDIA CORPORATION.
|
|
*/
|
|
|
|
#include <common.h>
|
|
#include <dm.h>
|
|
#include <misc.h>
|
|
#include <reset-uclass.h>
|
|
#include <asm/arch-tegra/bpmp_abi.h>
|
|
|
|
static int tegra186_reset_request(struct reset_ctl *reset_ctl)
|
|
{
|
|
debug("%s(reset_ctl=%p) (dev=%p, id=%lu)\n", __func__, reset_ctl,
|
|
reset_ctl->dev, reset_ctl->id);
|
|
|
|
return 0;
|
|
}
|
|
|
|
static int tegra186_reset_free(struct reset_ctl *reset_ctl)
|
|
{
|
|
debug("%s(reset_ctl=%p) (dev=%p, id=%lu)\n", __func__, reset_ctl,
|
|
reset_ctl->dev, reset_ctl->id);
|
|
|
|
return 0;
|
|
}
|
|
|
|
static int tegra186_reset_common(struct reset_ctl *reset_ctl,
|
|
enum mrq_reset_commands cmd)
|
|
{
|
|
struct mrq_reset_request req;
|
|
int ret;
|
|
|
|
req.cmd = cmd;
|
|
req.reset_id = reset_ctl->id;
|
|
|
|
ret = misc_call(reset_ctl->dev->parent, MRQ_RESET, &req, sizeof(req),
|
|
NULL, 0);
|
|
if (ret < 0)
|
|
return ret;
|
|
|
|
return 0;
|
|
}
|
|
|
|
static int tegra186_reset_assert(struct reset_ctl *reset_ctl)
|
|
{
|
|
debug("%s(reset_ctl=%p) (dev=%p, id=%lu)\n", __func__, reset_ctl,
|
|
reset_ctl->dev, reset_ctl->id);
|
|
|
|
return tegra186_reset_common(reset_ctl, CMD_RESET_ASSERT);
|
|
}
|
|
|
|
static int tegra186_reset_deassert(struct reset_ctl *reset_ctl)
|
|
{
|
|
debug("%s(reset_ctl=%p) (dev=%p, id=%lu)\n", __func__, reset_ctl,
|
|
reset_ctl->dev, reset_ctl->id);
|
|
|
|
return tegra186_reset_common(reset_ctl, CMD_RESET_DEASSERT);
|
|
}
|
|
|
|
struct reset_ops tegra186_reset_ops = {
|
|
.request = tegra186_reset_request,
|
|
.free = tegra186_reset_free,
|
|
.rst_assert = tegra186_reset_assert,
|
|
.rst_deassert = tegra186_reset_deassert,
|
|
};
|
|
|
|
static int tegra186_reset_probe(struct udevice *dev)
|
|
{
|
|
debug("%s(dev=%p)\n", __func__, dev);
|
|
|
|
return 0;
|
|
}
|
|
|
|
U_BOOT_DRIVER(tegra186_reset) = {
|
|
.name = "tegra186_reset",
|
|
.id = UCLASS_RESET,
|
|
.probe = tegra186_reset_probe,
|
|
.ops = &tegra186_reset_ops,
|
|
};
|