-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
phy: Add support for the Apple Type-C PHY
This is merely a dummy driver that makes sure the DWC3 XHCI driver finds its reset and PHY controllers. We rely on iBoot to set up the PHY for us. Signed-off-by: Mark Kettenis <kettenis@openbsd.org>
- Loading branch information
Showing
6 changed files
with
70 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
// SPDX-License-Identifier: GPL-2.0+ | ||
/* | ||
* Copyright (C) 2022 Mark Kettenis <kettenis@openbsd.org> | ||
*/ | ||
|
||
#include <common.h> | ||
#include <dm.h> | ||
#include <dm/device-internal.h> | ||
#include <generic-phy.h> | ||
#include <reset-uclass.h> | ||
|
||
static const struct phy_ops apple_atcphy_ops = { | ||
}; | ||
|
||
static struct driver apple_atcphy_driver = { | ||
.name = "apple-atcphy", | ||
.id = UCLASS_PHY, | ||
.ops = &apple_atcphy_ops, | ||
}; | ||
|
||
static int apple_atcphy_reset_of_xlate(struct reset_ctl *reset_ctl, | ||
struct ofnode_phandle_args *args) | ||
{ | ||
if (args->args_count != 0) | ||
return -EINVAL; | ||
|
||
return 0; | ||
} | ||
|
||
static const struct reset_ops apple_atcphy_reset_ops = { | ||
.of_xlate = apple_atcphy_reset_of_xlate, | ||
}; | ||
|
||
static int apple_atcphy_reset_probe(struct udevice *dev) | ||
{ | ||
struct udevice *child; | ||
|
||
device_bind(dev, &apple_atcphy_driver, "apple-atcphy", NULL, | ||
dev_ofnode(dev), &child); | ||
|
||
return 0; | ||
} | ||
|
||
static const struct udevice_id apple_atcphy_ids[] = { | ||
{ .compatible = "apple,t6000-atcphy" }, | ||
{ .compatible = "apple,t8103-atcphy" }, | ||
{ } | ||
}; | ||
|
||
U_BOOT_DRIVER(apple_atcphy_reset) = { | ||
.name = "apple-atcphy-reset", | ||
.id = UCLASS_RESET, | ||
.of_match = apple_atcphy_ids, | ||
.ops = &apple_atcphy_reset_ops, | ||
.probe = apple_atcphy_reset_probe, | ||
}; |