RTEMS | bsps/xilinx-zynq: Add QSPI flash driver (!295)

Kinsey Moore (@opticron) gitlab at rtems.org
Thu Nov 7 14:58:40 UTC 2024



Merge request https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/295 was reviewed by Kinsey Moore

--
  
Kinsey Moore started a new discussion on bsps/arm/xilinx-zynq/dev/spi/zynq-qspi-flash-transfer.c: https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/295#note_114476

 > +}
 > +
 > +static void qspi_flash_rx(void) {

RTEMS style guide puts the opening brace of a function on its own line.
"Put the opening brace of a function definition one line after the closing parenthesis of its prototype."

--
  
Kinsey Moore started a new discussion on bsps/arm/xilinx-zynq/dev/spi/zynq-qspi-flash-transfer.c: https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/295#note_114477

 > +
 > +  /*
 > +   * Set the slave select.

Any reason not to use "chip select" instead? This should be adjusted elsewhere as well.

--
  
Kinsey Moore started a new discussion on bsps/arm/xilinx-zynq/dev/spi/zynq-qspi-flash-transfer.c: https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/295#note_114478

 > +   */
 > +  (transfer->tx_data) = (uint32_t*) transfer->buffer;
 > +  (transfer->rx_data) = (uint32_t*) transfer->buffer;

Unnecessary parens.

--
  
Kinsey Moore started a new discussion on bsps/arm/xilinx-zynq/dev/spi/zynq-qspi-flash-transfer.c: https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/295#note_114479

 > +        *(transfer->rx_data) = qspi_reg_read(ZQSPI_QSPI_REG_RX_DATA);
 > +        ++(transfer->rx_data);
 > +        if (transfer->rx_length > sizeof(uint32_t))

All conditionals need braces as the style guide does not mention their omission.
"Put braces on the same line as and one space after the conditional expression ends."

This needs to be applied elsewhere.

--
  
Kinsey Moore started a new discussion on bsps/arm/xilinx-zynq/dev/spi/zynq-qspi-flash-transfer.c: https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/295#note_114480

 > +  if (transfer->rx_length)
 > +  {
 > +    while (transfer->start && transfer->sending)

When performing rx-only, transfer->start never gets reset to 0. Is that intentional?

--
  
Kinsey Moore started a new discussion on bsps/arm/xilinx-zynq/dev/spi/zynq-qspi-flash-transfer.c: https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/295#note_114481

 > +
 > +__attribute__((weak)) void zqspi_write_lock(zqspiflash *driver) {
 > +}

I don't see these two functions used anywhere.


-- 
View it on GitLab: https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/295
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/20241107/fe101176/attachment-0001.htm>


More information about the bugs mailing list