blob: 2627eec1815423ca1418b974bb0f4fcdab8b6c39 [file] [log] [blame]
Mateusz Kulikowski08592132016-03-31 23:12:32 +02001/*
2 * Qualcomm APQ8016 reset controller driver
3 *
4 * (C) Copyright 2015 Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
5 *
6 * SPDX-License-Identifier: GPL-2.0+
7 */
8
9#include <common.h>
10#include <dm.h>
11#include <errno.h>
12#include <reset.h>
13#include <asm/io.h>
14
15DECLARE_GLOBAL_DATA_PTR;
16
17static int msm_reset_request(struct udevice *dev, enum reset_t type)
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
26static struct reset_ops msm_reset_ops = {
27 .request = msm_reset_request,
28};
29
30static const struct udevice_id msm_reset_ids[] = {
31 { .compatible = "qcom,pshold" },
32 { }
33};
34
35U_BOOT_DRIVER(msm_reset) = {
36 .name = "msm_reset",
37 .id = UCLASS_RESET,
38 .of_match = msm_reset_ids,
39 .ops = &msm_reset_ops,
40};