Commit d4b9c0d6 authored by Henrik Brix Andersen's avatar Henrik Brix Andersen Committed by Maureen Helm
Browse files

drivers: clock_control_mcux_sim: add support for clkout



Add support for CLKOUT source selection and divider as found on the
NXP Kinetis KE1xF SoC series.

Signed-off-by: default avatarHenrik Brix Andersen <hebad@vestas.com>
parent 56dfb62e
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -45,6 +45,15 @@ static int mcux_sim_get_subsys_rate(struct device *dev,

static int mcux_sim_init(struct device *dev)
{
#ifdef DT_SIM_CLKOUT_DIVIDER
	SIM->CHIPCTL = (SIM->CHIPCTL & ~SIM_CHIPCTL_CLKOUTDIV_MASK)
		| SIM_CHIPCTL_CLKOUTDIV(DT_SIM_CLKOUT_DIVIDER);
#endif
#ifdef DT_SIM_CLKOUT_SOURCE
	SIM->CHIPCTL = (SIM->CHIPCTL & ~SIM_CHIPCTL_CLKOUTSEL_MASK)
		| SIM_CHIPCTL_CLKOUTSEL(DT_SIM_CLKOUT_SOURCE);
#endif

	return 0;
}

+12 −0
Original line number Diff line number Diff line
@@ -30,6 +30,18 @@ properties:
      description: Human readable string describing the device (used by Zephyr for API name)
      generation: define

    clkout-source:
      type: int
      category: optional
      description: clkout clock source
      generation: define

    clkout-divider:
      type: int
      category: optional
      description: clkout divider
      generation: define

"#cells":
  - name
  - offset