blob: db05c8917ffb44fe1a2f9ac933a969d1e1241917 [file] [log] [blame]
Tom Rini83d290c2018-05-06 17:58:06 -04001// SPDX-License-Identifier: GPL-2.0
Stephen Warrenbd3ee842016-09-13 10:45:57 -06002/*
3 * Copyright (c) 2016, NVIDIA CORPORATION.
Stephen Warrenbd3ee842016-09-13 10:45:57 -06004 */
5
6#include <common.h>
7#include <dm.h>
8#include <dm/lists.h>
9#include <dm/root.h>
10
11/**
12 * The CAR exposes multiple different services. We create a sub-device for
13 * each separate type of service, since each device must be of the appropriate
14 * UCLASS.
15 */
16static int tegra_car_bpmp_bind(struct udevice *dev)
17{
18 int ret;
19 struct udevice *child;
20
21 debug("%s(dev=%p)\n", __func__, dev);
22
23 ret = device_bind_driver_to_node(dev, "tegra_car_clk", "tegra_car_clk",
Simon Glass45a26862017-05-18 20:09:07 -060024 dev_ofnode(dev), &child);
Stephen Warrenbd3ee842016-09-13 10:45:57 -060025 if (ret)
26 return ret;
27
28 ret = device_bind_driver_to_node(dev, "tegra_car_reset",
Simon Glass45a26862017-05-18 20:09:07 -060029 "tegra_car_reset", dev_ofnode(dev),
Stephen Warrenbd3ee842016-09-13 10:45:57 -060030 &child);
31 if (ret)
32 return ret;
33
34 return 0;
35}
36
37static int tegra_car_bpmp_probe(struct udevice *dev)
38{
39 debug("%s(dev=%p)\n", __func__, dev);
40
41 return 0;
42}
43
44static int tegra_car_bpmp_remove(struct udevice *dev)
45{
46 debug("%s(dev=%p)\n", __func__, dev);
47
48 return 0;
49}
50
51static const struct udevice_id tegra_car_bpmp_ids[] = {
52 { .compatible = "nvidia,tegra20-car" },
53 { .compatible = "nvidia,tegra30-car" },
54 { .compatible = "nvidia,tegra114-car" },
55 { .compatible = "nvidia,tegra124-car" },
56 { .compatible = "nvidia,tegra210-car" },
57 { }
58};
59
60U_BOOT_DRIVER(tegra_car_bpmp) = {
61 .name = "tegra_car",
62 .id = UCLASS_MISC,
63 .of_match = tegra_car_bpmp_ids,
64 .bind = tegra_car_bpmp_bind,
65 .probe = tegra_car_bpmp_probe,
66 .remove = tegra_car_bpmp_remove,
67};