summaryrefslogtreecommitdiff
path: root/drivers/clk
diff options
context:
space:
mode:
authorTom Rini <[email protected]>2025-04-22 15:13:21 -0600
committerTom Rini <[email protected]>2025-04-22 15:13:21 -0600
commit20fcb6305eef553a94eeed6efb1a60ee3ccd9db7 (patch)
tree6e9b463232e44565a6495161d6db3178741f348e /drivers/clk
parentbf2db18116137bb2f82165206be3f16baf314feb (diff)
parentbaf4bdcdeda78874efa8e2e7875ab4a91f5aa502 (diff)
Merge patch series "MIPS: Boston: Various enhancements"
Jiaxun Yang <[email protected]> says: This is a huge series which promoted MIPS/Boston target into a usable state, with fixes to drivers and general framework issues I found in this process. I also converted the target to OF_UPSTREAM. This target is covered by QEMU, to test on QEMU: ``` make boston64r6el_defconfig make qemu-system-mips64el -M boston -cpu I6500 -bios ./u-boot.bin -nographic ``` Link: https://lore.kernel.org/r/[email protected]
Diffstat (limited to 'drivers/clk')
-rw-r--r--drivers/clk/clk_boston.c19
1 files changed, 12 insertions, 7 deletions
diff --git a/drivers/clk/clk_boston.c b/drivers/clk/clk_boston.c
index 030ff7cc58e..71e030f463e 100644
--- a/drivers/clk/clk_boston.c
+++ b/drivers/clk/clk_boston.c
@@ -58,17 +58,21 @@ const struct clk_ops clk_boston_ops = {
.get_rate = clk_boston_get_rate,
};
-static int clk_boston_of_to_plat(struct udevice *dev)
+static int clk_boston_probe(struct udevice *dev)
{
struct clk_boston *state = dev_get_plat(dev);
struct udevice *syscon;
int err;
- err = uclass_get_device_by_phandle(UCLASS_SYSCON, dev,
- "regmap", &syscon);
- if (err) {
- pr_err("unable to find syscon device\n");
- return err;
+ if (dev->parent && device_get_uclass_id(dev->parent) == UCLASS_SYSCON) {
+ syscon = dev->parent;
+ } else {
+ err = uclass_get_device_by_phandle(UCLASS_SYSCON, dev,
+ "regmap", &syscon);
+ if (err) {
+ pr_err("unable to find syscon device\n");
+ return err;
+ }
}
state->regmap = syscon_get_regmap(syscon);
@@ -91,7 +95,8 @@ U_BOOT_DRIVER(clk_boston) = {
.name = "boston_clock",
.id = UCLASS_CLK,
.of_match = clk_boston_match,
- .of_to_plat = clk_boston_of_to_plat,
+ .probe = clk_boston_probe,
.plat_auto = sizeof(struct clk_boston),
.ops = &clk_boston_ops,
+ .flags = DM_FLAG_PRE_RELOC,
};