arch/risc-v/src/mpfs: Remove CONFIG_MPFS_COREPWMx_PWMCLK configs

These are always the same as FPGA peripheral clock, so use that directly

Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
This commit is contained in:
Jukka Laitinen
2023-05-12 10:23:31 +03:00
committed by Xiang Xiao
parent 5238c3bb25
commit 7e6e18697c
2 changed files with 3 additions and 18 deletions
-12
View File
@@ -578,12 +578,6 @@ config MPFS_COREPWM0_BASE
default 0x44000000
depends on MPFS_COREPWM0
config MPFS_COREPWM0_PWMCLK
int "Clock frequency of the CorePWM0 block (Hz)"
default 25000000
range 1000000 100000000
depends on MPFS_COREPWM0
config MPFS_COREPWM0_REGWIDTH
int "Width of the PWM register (8, 16 or 32 bits)"
default 32
@@ -607,12 +601,6 @@ config MPFS_COREPWM1_BASE
default 0x45000000
depends on MPFS_COREPWM1
config MPFS_COREPWM1_PWMCLK
int "Clock frequency of the CorePWM1 block (Hz)"
default 25000000
range 1000000 100000000
depends on MPFS_COREPWM1
config MPFS_COREPWM1_REGWIDTH
int "Width of the PWM register (8, 16 or 32 bits)"
default 32
+3 -6
View File
@@ -76,7 +76,6 @@ struct mpfs_pwmtimer_s
struct mpfs_pwmchan_s channels[MPFS_MAX_PWM_CHANNELS];
uint32_t frequency; /* Current frequency setting */
uintptr_t base; /* The base address of the pwm block */
uint32_t pwmclk; /* The frequency of the pwm clock */
};
/****************************************************************************
@@ -187,7 +186,6 @@ static struct mpfs_pwmtimer_s g_pwm0dev =
}
},
.base = CONFIG_MPFS_COREPWM0_BASE,
.pwmclk = CONFIG_MPFS_COREPWM0_PWMCLK,
};
#endif
@@ -249,7 +247,6 @@ static struct mpfs_pwmtimer_s g_pwm1dev =
}
},
.base = CONFIG_MPFS_COREPWM1_BASE,
.pwmclk = CONFIG_MPFS_COREPWM1_PWMCLK,
};
#endif
@@ -404,12 +401,12 @@ static int pwm_timer(struct mpfs_pwmtimer_s *priv,
* PERIOD = pwmclk / frequency = 25,000,000 / 50 = 500,000
*/
pwminfo("PWM%u frequency: %u PWMCLK: %u prescaler: %u\n",
priv->pwmid, info->frequency, priv->pwmclk, prescaler);
pwminfo("PWM%u frequency: %u PWMCLK: %lu prescaler: %u\n",
priv->pwmid, info->frequency, MPFS_FPGA_PERIPHERAL_CLK, prescaler);
/* Set the reload and prescaler values */
period = priv->pwmclk / info->frequency;
period = MPFS_FPGA_PERIPHERAL_CLK / info->frequency;
pwm_putreg(priv, MPFS_COREPWM_PERIOD_OFFSET, period);
pwm_putreg(priv, MPFS_COREPWM_PRESCALE_OFFSET, prescaler);