RTEMS | bsp/aarch64/raspberrypi4: Add PWM peripheral support (!509)
Kinsey Moore (@opticron)
gitlab at rtems.org
Thu Jun 19 02:43:16 UTC 2025
Kinsey Moore commented on a discussion on bsps/aarch64/raspberrypi/pwm/raspberrypi-pwm.c: https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/509#note_124916
> +#define BCM2711_CM_PWM(x) BCM2835_REG(BCM2711_CM_PWM_BASE + (x))
> +#define CM_PWM_CTL_ENABLE_OSC (CM_PWM_PASSWD | CM_PWM_CTL_ENAB | CM_PWM_CTL_SRC_OSC)
> +#define CM_PWM_CTL_DISABLE (CM_PWM_PASSWD | CM_PWM_CTL_SRC_OSC)
> +
> +static inline bool rpi_pwm_validate(raspberrypi_pwm_master master,
> + raspberrypi_pwm_channel channel)
> +{
> + return ((master == raspberrypi_pwm_master0) || (master == raspberrypi_pwm_master1)) &&
> + ((channel == raspberrypi_pwm0) || (channel == raspberrypi_pwm1));
> +}
> +
> +rtems_status_code rpi_pwm_set_clock(uint32_t divisor)
> +{
> + if (divisor == 0) {
> + return RTEMS_INVALID_NUMBER;
> + }
This is now less correct. Please review the comments provided in the header about the valid range of this parameter.
--
View it on GitLab: https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/509#note_124916
You're receiving this email because of your account on gitlab.rtems.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/bugs/attachments/20250619/369c9119/attachment-0001.htm>
More information about the bugs
mailing list