Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion arch/arm/mach-sc5xx/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,16 @@ config SC846
select GICV3_SUPPORT_GIC600
select GIC_600_CLEAR_RDPD
select MMC_SDHCI_ADMA_FORCE_32BIT
select FIXED_CGU1_INPUT_CLOCK
select NOP_PHY if PHY
endchoice

config FIXED_CGU1_INPUT_CLOCK
bool
help
The CDU has no CLKINSEL register, so the CGU1 input clock is
fixed to SYS_CLKIN0 and cannot be selected.

if SC57X

config TARGET_SC573_EZLITE
Expand Down Expand Up @@ -572,7 +579,7 @@ config CGU1_DIV_S1SELEX
SCLK1 = ((CLKIN / (1 + DF)) * VCO_MULT) / DIV_S1SELEX

config CDU0_CGU1_CLKIN
int "CDU0 CGU1 CLKINn Select"
int "CDU0 CGU1 CLKINn Select" if !FIXED_CGU1_INPUT_CLOCK
default 0
range 0 1
help
Expand Down
8 changes: 7 additions & 1 deletion arch/arm/mach-sc5xx/init/clkinit.c
Original file line number Diff line number Diff line change
Expand Up @@ -524,7 +524,13 @@ void cdu_init(void)
{
while (readl(REG_CDU0_STAT) & 0xffff)
;
writel((CONFIG_CDU0_CGU1_CLKIN & 0x1), REG_CDU0_CLKINSEL);

/*
* Some parts (e.g. SC846) have no CLKINSEL register; CGU1 is
* fixed to SYS_CLKIN0 there.
*/
if (!IS_ENABLED(CONFIG_FIXED_CGU1_INPUT_CLOCK))
writel((CONFIG_CDU0_CGU1_CLKIN & 0x1), REG_CDU0_CLKINSEL);

CONFIGURE_CDU0(CONFIG_CDU0_CLKO0, REG_CDU0_CFG0, 0);
CONFIGURE_CDU0(CONFIG_CDU0_CLKO1, REG_CDU0_CFG1, 1);
Expand Down
Loading