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