blob: a598f6400de345f81308e640548fcd3e03e8f840 [file] [log] [blame]
Johan Jonkera289fc72022-04-16 17:09:47 +02001// SPDX-License-Identifier: GPL-2.0+
2/*
3 * Copyright (C) 2015 Google, Inc
4 * Written by Simon Glass <sjg@chromium.org>
5 */
6
7#include <common.h>
8#include <dm.h>
9#include <log.h>
10#include <syscon.h>
11#include <asm/arch-rockchip/clock.h>
12
13static const struct udevice_id rk3066_syscon_ids[] = {
14 { .compatible = "rockchip,rk3066-noc", .data = ROCKCHIP_SYSCON_NOC },
15 { .compatible = "rockchip,rk3066-grf", .data = ROCKCHIP_SYSCON_GRF },
16 { .compatible = "rockchip,rk3066-pmu", .data = ROCKCHIP_SYSCON_PMU },
17 { }
18};
19
20U_BOOT_DRIVER(syscon_rk3066) = {
21 .name = "rk3066_syscon",
22 .id = UCLASS_SYSCON,
23 .of_match = rk3066_syscon_ids,
24};
25
26#if CONFIG_IS_ENABLED(OF_PLATDATA)
27static int rk3066_syscon_bind_of_plat(struct udevice *dev)
28{
29 dev->driver_data = dev->driver->of_match->data;
30 debug("syscon: %s %d\n", dev->name, (uint)dev->driver_data);
31
32 return 0;
33}
34
35U_BOOT_DRIVER(rockchip_rk3066_noc) = {
36 .name = "rockchip_rk3066_noc",
37 .id = UCLASS_SYSCON,
38 .of_match = rk3066_syscon_ids,
39 .bind = rk3066_syscon_bind_of_plat,
40};
41
42U_BOOT_DRIVER(rockchip_rk3066_grf) = {
43 .name = "rockchip_rk3066_grf",
44 .id = UCLASS_SYSCON,
45 .of_match = rk3066_syscon_ids + 1,
46 .bind = rk3066_syscon_bind_of_plat,
47};
48
49U_BOOT_DRIVER(rockchip_rk3066_pmu) = {
50 .name = "rockchip_rk3066_pmu",
51 .id = UCLASS_SYSCON,
52 .of_match = rk3066_syscon_ids + 2,
53 .bind = rk3066_syscon_bind_of_plat,
54};
55#endif