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

Christian Mauderer (@c-mauderer) gitlab at rtems.org
Mon Jun 16 18:58:58 UTC 2025




Christian Mauderer commented on a discussion on bsps/aarch64/raspberrypi/include/bsp/raspberrypi-pwm.h: https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/509#note_124733

 > +#define C_POLA1 BSP_BIT32( 4 )
 > +#define C_SBIT1 BSP_BIT32( 3 )
 > +#define C_RPTL1 BSP_BIT32( 2 )
 > +#define C_MODE1 BSP_BIT32( 1 )
 > +#define C_PWEN1 BSP_BIT32( 0 )
 > +
 > +/* Status register bit definitions */
 > +#define S_STA2 BSP_BIT32( 10 )
 > +#define S_STA1 BSP_BIT32( 9 )
 > +#define S_BERR BSP_BIT32( 8 )
 > +#define S_GAPO2 BSP_BIT32( 5 )
 > +#define S_GAPO1 BSP_BIT32( 4 )
 > +#define S_RERR1 BSP_BIT32( 3 )
 > +#define S_WERR1 BSP_BIT32( 2 )
 > +#define S_EMPT1 BSP_BIT32( 1 )
 > +#define S_FULL1 BSP_BIT32( 0 )

I checked the existing drivers in the BSP. The 64 Bit version of the Raspberry doesn't have a lot of drivers at the moment. And you can find a lot of different styles in these few drivers.

Some defines are in the `raspberrypi.h` like for the PM peripheral [here](https://gitlab.rtems.org/rtems/rtos/rtems/-/blob/7eb39e3e8d63c224224beb43136c78900c922cec/bsps/aarch64/raspberrypi/include/bsp/raspberrypi.h#L121). Others use a structure in a separate header like in the [SPI driver](https://gitlab.rtems.org/rtems/rtos/rtems/-/blob/7eb39e3e8d63c224224beb43136c78900c922cec/bsps/aarch64/raspberrypi/include/bsp/raspberrypi-spi.h#L42). And the GPIO defines the registers [in the C file](https://gitlab.rtems.org/rtems/rtos/rtems/-/blob/7eb39e3e8d63c224224beb43136c78900c922cec/bsps/aarch64/raspberrypi/include/bsp/raspberrypi-spi.h#L42).

All styles have their advantages and disadvantages. Usually my personal preference is the structure. But having all defines in the `raspberrypi.h` is a good solution too, and it would be closer to your other I2C pull request (!363). So most likely that one is the better solution here.

-- 
View it on GitLab: https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/509#note_124733
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/20250616/7d7f6a52/attachment.htm>


More information about the bugs mailing list