RTEMS | bsp/aarch64/raspberrypi4: Add PWM peripheral support (!509)

Kinsey Moore (@opticron) gitlab at rtems.org
Wed Jun 18 19:18:36 UTC 2025




Kinsey Moore started a new discussion on bsps/aarch64/raspberrypi/pwm/raspberrypi-pwm.c: https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/509#note_124897

 > +#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 does not verify that the input is not within the upper bound.

-- 
View it on GitLab: https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/509#note_124897
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/20250618/73e0f64e/attachment-0001.htm>


More information about the bugs mailing list