]>
Commit | Line | Data |
---|---|---|
08592136 MK |
1 | /* |
2 | * Qualcomm APQ8016 reset controller driver | |
3 | * | |
4 | * (C) Copyright 2015 Mateusz Kulikowski <[email protected]> | |
5 | * | |
6 | * SPDX-License-Identifier: GPL-2.0+ | |
7 | */ | |
8 | ||
9 | #include <common.h> | |
10 | #include <dm.h> | |
11 | #include <errno.h> | |
11636258 | 12 | #include <sysreset.h> |
08592136 MK |
13 | #include <asm/io.h> |
14 | ||
15 | DECLARE_GLOBAL_DATA_PTR; | |
16 | ||
11636258 | 17 | static int msm_sysreset_request(struct udevice *dev, enum sysreset_t type) |
08592136 MK |
18 | { |
19 | phys_addr_t addr = dev_get_addr(dev); | |
20 | if (!addr) | |
21 | return -EINVAL; | |
22 | writel(0, addr); | |
23 | return -EINPROGRESS; | |
24 | } | |
25 | ||
11636258 SW |
26 | static struct sysreset_ops msm_sysreset_ops = { |
27 | .request = msm_sysreset_request, | |
08592136 MK |
28 | }; |
29 | ||
11636258 | 30 | static const struct udevice_id msm_sysreset_ids[] = { |
08592136 MK |
31 | { .compatible = "qcom,pshold" }, |
32 | { } | |
33 | }; | |
34 | ||
35 | U_BOOT_DRIVER(msm_reset) = { | |
11636258 SW |
36 | .name = "msm_sysreset", |
37 | .id = UCLASS_SYSRESET, | |
38 | .of_match = msm_sysreset_ids, | |
39 | .ops = &msm_sysreset_ops, | |
08592136 | 40 | }; |