RTEMS | dev/serial: Refactor the pl011 driver to be extensible (!47)
Ning Yang (@yangn0)
gitlab at rtems.org
Tue Jun 25 12:46:09 UTC 2024
Ning Yang commented on a discussion on bsps/arm/raspberrypi/include/bsp/raspberrypi-pl011.h: https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/47#note_108038
> +#include <dev/serial/arm-pl011-regs.h>
> +#include <dev/serial/arm-pl011.h>
> +#include <rtems/termiostypes.h>
> +
> +typedef struct {
> + pl011_base PL011;
> + uint32_t reserved_4c[14];
> + uint32_t uartitcr;
> + uint32_t uartitip;
> + uint32_t uartitop;
> + uint32_t uarttdr;
> +} raspberrypi_uart;
> +
> +typedef struct {
> + arm_pl011_context pl011_ctx;
> +} raspberrypi_pl011_context;
Some PL011 has device-specific registers, which may require some device-specific context fields.
In order to be more unified, I created device-specific context structure to all BSPs with pl011.
The context of Versal UART driver has some unique fields. But I think the current PL011 driver can completely replace the Versal UART driver. I tested it on Versal Qemu, and it needs to be tested on the hardware.
(https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/47#note_107457)
If the test passes, I think device-specific context is unnecessary. Because all device-specific contexts have only one member.
--
View it on GitLab: https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/47#note_108038
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/20240625/2334b5d0/attachment-0001.htm>
More information about the bugs
mailing list