clk: spacemit: k1: spawn reset device from per-syscon clock drivers
The K1 reset driver in drivers/reset/spacemit/ binds by name (no DT of_match), so the per-syscon clock drivers must spawn it. Add a .bind hook to k1_mpmu_clk, k1_apbc_clk and k1_apmu_clk that calls spacemit_k1_reset_bind() to instantiate a UCLASS_RESET sibling on the same ofnode. Also introduce k1_apbc2_clk here. Its kernel DT node has #reset-cells but no #clock-cells, so the driver exists only as the binding hook for the apbc2 reset spawn. With this in place, references such as resets = <&syscon_apbc RESET_TWSI0>; in the kernel-mainline DT resolve correctly. Signed-off-by: Guodong Xu <guodong@riscstar.com>
This commit is contained in:
@@ -13,6 +13,7 @@
|
||||
#include <dm/lists.h>
|
||||
#include <regmap.h>
|
||||
#include <linux/clk-provider.h>
|
||||
#include <soc/spacemit/k1-reset.h>
|
||||
#include <soc/spacemit/k1-syscon.h>
|
||||
|
||||
#include "clk_common.h"
|
||||
@@ -1661,6 +1662,26 @@ U_BOOT_DRIVER(k1_pll_clk) = {
|
||||
.flags = DM_FLAG_PRE_RELOC,
|
||||
};
|
||||
|
||||
static int k1_mpmu_clk_bind(struct udevice *dev)
|
||||
{
|
||||
return spacemit_k1_reset_bind(dev, SPACEMIT_K1_RESET_MPMU);
|
||||
}
|
||||
|
||||
static int k1_apbc_clk_bind(struct udevice *dev)
|
||||
{
|
||||
return spacemit_k1_reset_bind(dev, SPACEMIT_K1_RESET_APBC);
|
||||
}
|
||||
|
||||
static int k1_apmu_clk_bind(struct udevice *dev)
|
||||
{
|
||||
return spacemit_k1_reset_bind(dev, SPACEMIT_K1_RESET_APMU);
|
||||
}
|
||||
|
||||
static int k1_apbc2_clk_bind(struct udevice *dev)
|
||||
{
|
||||
return spacemit_k1_reset_bind(dev, SPACEMIT_K1_RESET_APBC2);
|
||||
}
|
||||
|
||||
static const struct udevice_id k1_mpmu_clk_match[] = {
|
||||
{ .compatible = "spacemit,k1-syscon-mpmu",
|
||||
.data = (ulong)&k1_ccu_mpmu_data },
|
||||
@@ -1673,6 +1694,7 @@ U_BOOT_DRIVER(k1_mpmu_clk) = {
|
||||
.name = "k1_mpmu_clk",
|
||||
.id = UCLASS_CLK,
|
||||
.of_match = k1_mpmu_clk_match,
|
||||
.bind = k1_mpmu_clk_bind,
|
||||
.probe = k1_mpmu_clk_probe,
|
||||
.ops = &k1_mpmu_clk_ops,
|
||||
.flags = DM_FLAG_PRE_RELOC,
|
||||
@@ -1690,6 +1712,7 @@ U_BOOT_DRIVER(k1_apbc_clk) = {
|
||||
.name = "k1_apbc_clk",
|
||||
.id = UCLASS_CLK,
|
||||
.of_match = k1_apbc_clk_match,
|
||||
.bind = k1_apbc_clk_bind,
|
||||
.probe = k1_apbc_clk_probe,
|
||||
.ops = &k1_apbc_clk_ops,
|
||||
.flags = DM_FLAG_PRE_RELOC,
|
||||
@@ -1707,7 +1730,21 @@ U_BOOT_DRIVER(k1_apmu_clk) = {
|
||||
.name = "k1_apmu_clk",
|
||||
.id = UCLASS_CLK,
|
||||
.of_match = k1_apmu_clk_match,
|
||||
.bind = k1_apmu_clk_bind,
|
||||
.probe = k1_apmu_clk_probe,
|
||||
.ops = &k1_apmu_clk_ops,
|
||||
.flags = DM_FLAG_PRE_RELOC,
|
||||
};
|
||||
|
||||
static const struct udevice_id k1_apbc2_clk_match[] = {
|
||||
{ .compatible = "spacemit,k1-syscon-apbc2" },
|
||||
{ /* sentinel */ },
|
||||
};
|
||||
|
||||
U_BOOT_DRIVER(k1_apbc2_clk) = {
|
||||
.name = "k1_apbc2_clk",
|
||||
.id = UCLASS_CLK,
|
||||
.of_match = k1_apbc2_clk_match,
|
||||
.bind = k1_apbc2_clk_bind,
|
||||
.flags = DM_FLAG_PRE_RELOC,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user