clk: baikal-t1: Add shared xGMAC ref/ptp clocks internal parent
authorSerge Semin <Sergey.Semin@baikalelectronics.ru>
Thu, 29 Sep 2022 22:53:57 +0000 (01:53 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 26 Oct 2022 10:35:19 +0000 (12:35 +0200)
commit35b766027580bf0f378fed99209ff51560a6c825
tree8752a103e60e8ba272730be515f4d4d6d04dc55e
parentb2db8b2c539128a1cb825ef9d200f2867797b428
clk: baikal-t1: Add shared xGMAC ref/ptp clocks internal parent

[ Upstream commit e2eef312762e0b5a5a70d29fe59a245c0a3cffa0 ]

Baikal-T1 CCU reference manual says that both xGMAC reference and xGMAC
PTP clocks are generated by two different wrappers with the same constant
divider thus each producing a 156.25 MHz signal. But for some reason both
of these clock sources are gated by a single switch-flag in the CCU
registers space - CCU_SYS_XGMAC_BASE.BIT(0). In order to make the clocks
handled independently we need to define a shared parental gate so the base
clock signal would be switched off only if both of the child-clocks are
disabled.

Note the ID is intentionally set to -2 since we are going to add a one
more internal clock identifier in the next commit.

Fixes: 353afa3a8d2e ("clk: Add Baikal-T1 CCU Dividers driver")
Signed-off-by: Serge Semin <Sergey.Semin@baikalelectronics.ru>
Link: https://lore.kernel.org/r/20220929225402.9696-4-Sergey.Semin@baikalelectronics.ru
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/clk/baikal-t1/ccu-div.c
drivers/clk/baikal-t1/ccu-div.h
drivers/clk/baikal-t1/clk-ccu-div.c