blob: 67d2f18a8d0f598f27ca55bede96e7caeb0bbd1d [file] [log] [blame]
Jagan Teki249a2382022-12-14 23:21:05 +05301// SPDX-License-Identifier: GPL-2.0+
2/*
3 * (C) Copyright 2019 Rockchip Electronics Co., Ltd
4 * Copyright (c) 2022 Edgeble AI Technologies Pvt. Ltd.
5 */
6
Jagan Teki249a2382022-12-14 23:21:05 +05307#include <dm.h>
8#include <log.h>
9#include <syscon.h>
10#include <asm/arch-rockchip/clock.h>
11
12static const struct udevice_id rv1126_syscon_ids[] = {
13 { .compatible = "rockchip,rv1126-grf", .data = ROCKCHIP_SYSCON_GRF },
14 { .compatible = "rockchip,rv1126-pmugrf", .data = ROCKCHIP_SYSCON_PMUGRF },
15 { }
16};
17
18U_BOOT_DRIVER(syscon_rv1126) = {
19 .name = "rv1126_syscon",
20 .id = UCLASS_SYSCON,
21 .of_match = rv1126_syscon_ids,
22};
23
24#if CONFIG_IS_ENABLED(OF_PLATDATA)
25static int rv1126_syscon_bind_of_plat(struct udevice *dev)
26{
27 dev->driver_data = dev->driver->of_match->data;
28 debug("syscon: %s %d\n", dev->name, (uint)dev->driver_data);
29
30 return 0;
31}
32
33U_BOOT_DRIVER(rockchip_rv1126_pmu) = {
34 .name = "rockchip_rv1126_pmu",
35 .id = UCLASS_SYSCON,
36 .of_match = rv1126_syscon_ids,
37 .bind = rv1126_syscon_bind_of_plat,
38};
39
40U_BOOT_DRIVER(rockchip_rv1126_pmugrf) = {
41 .name = "rockchip_rv1126_pmugrf",
42 .id = UCLASS_SYSCON,
43 .of_match = rv1126_syscon_ids + 1,
44 .bind = rv1126_syscon_bind_of_plat,
45};
46#endif