blob: ff269b53b542434fef78452a46f96c08f7320b93 [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
Johan Jonkera289fc72022-04-16 17:09:47 +02007#include <dm.h>
8#include <log.h>
9#include <syscon.h>
10#include <asm/arch-rockchip/clock.h>
11
12static const struct udevice_id rk3066_syscon_ids[] = {
13 { .compatible = "rockchip,rk3066-noc", .data = ROCKCHIP_SYSCON_NOC },
14 { .compatible = "rockchip,rk3066-grf", .data = ROCKCHIP_SYSCON_GRF },
15 { .compatible = "rockchip,rk3066-pmu", .data = ROCKCHIP_SYSCON_PMU },
16 { }
17};
18
19U_BOOT_DRIVER(syscon_rk3066) = {
20 .name = "rk3066_syscon",
21 .id = UCLASS_SYSCON,
22 .of_match = rk3066_syscon_ids,
23};
24
25#if CONFIG_IS_ENABLED(OF_PLATDATA)
26static int rk3066_syscon_bind_of_plat(struct udevice *dev)
27{
28 dev->driver_data = dev->driver->of_match->data;
29 debug("syscon: %s %d\n", dev->name, (uint)dev->driver_data);
30
31 return 0;
32}
33
34U_BOOT_DRIVER(rockchip_rk3066_noc) = {
35 .name = "rockchip_rk3066_noc",
36 .id = UCLASS_SYSCON,
37 .of_match = rk3066_syscon_ids,
38 .bind = rk3066_syscon_bind_of_plat,
39};
40
41U_BOOT_DRIVER(rockchip_rk3066_grf) = {
42 .name = "rockchip_rk3066_grf",
43 .id = UCLASS_SYSCON,
44 .of_match = rk3066_syscon_ids + 1,
45 .bind = rk3066_syscon_bind_of_plat,
46};
47
48U_BOOT_DRIVER(rockchip_rk3066_pmu) = {
49 .name = "rockchip_rk3066_pmu",
50 .id = UCLASS_SYSCON,
51 .of_match = rk3066_syscon_ids + 2,
52 .bind = rk3066_syscon_bind_of_plat,
53};
54#endif