acassis commented on code in PR #19815:
URL: https://github.com/apache/nuttx/pull/19815#discussion_r3767432922


##########
arch/arm64/src/bcm2711/hardware/bcm2711_dma.h:
##########
@@ -27,56 +27,45 @@
  * Included Files
  ****************************************************************************/
 
-#include "bcm2711_memmap.h"
 #include <arch/types.h>
 
+#include <nuttx/compiler.h>
+
+#include "bcm2711_memmap.h"
+
 /****************************************************************************
  * Pre-processor Definitions
  ****************************************************************************/
 
-/* DMA channel offsets */
-
-#define BCM_DMA_CH0_OFFSET 0x000
-#define BCM_DMA_CH1_OFFSET 0x100
-#define BCM_DMA_CH2_OFFSET 0x200
-#define BCM_DMA_CH3_OFFSET 0x300
-#define BCM_DMA_CH4_OFFSET 0x400
-#define BCM_DMA_CH5_OFFSET 0x500
-#define BCM_DMA_CH6_OFFSET 0x600
-#define BCM_DMA_CH7_OFFSET 0x700
-#define BCM_DMA_CH8_OFFSET 0x800
-#define BCM_DMA_CH9_OFFSET 0x900
-#define BCM_DMA_CH10_OFFSET 0xa00
-#define BCM_DMA_CH11_OFFSET 0xb00
-#define BCM_DMA_CH12_OFFSET 0xc00
-#define BCM_DMA_CH13_OFFSET 0xd00
-#define BCM_DMA_CH14_OFFSET 0xe00
-#define BCM_DMA_CH15_OFFSET 0x000
-
-/* DMA channel addresses */
-
-#define BCM_DMA0 (BCM_DMA0_BASE + BCM_DMA_CH0_OFFSET)
-#define BCM_DMA1 (BCM_DMA0_BASE + BCM_DMA_CH1_OFFSET)
-#define BCM_DMA2 (BCM_DMA0_BASE + BCM_DMA_CH2_OFFSET)
-#define BCM_DMA3 (BCM_DMA0_BASE + BCM_DMA_CH3_OFFSET)
-#define BCM_DMA4 (BCM_DMA0_BASE + BCM_DMA_CH4_OFFSET)
-#define BCM_DMA5 (BCM_DMA0_BASE + BCM_DMA_CH5_OFFSET)
-#define BCM_DMA6 (BCM_DMA0_BASE + BCM_DMA_CH6_OFFSET)
-#define BCM_DMA7 (BCM_DMA0_BASE + BCM_DMA_CH7_OFFSET)   /* Lite */
-#define BCM_DMA8 (BCM_DMA0_BASE + BCM_DMA_CH8_OFFSET)   /* Lite */
-#define BCM_DMA9 (BCM_DMA0_BASE + BCM_DMA_CH9_OFFSET)   /* Lite */
-#define BCM_DMA10 (BCM_DMA0_BASE + BCM_DMA_CH10_OFFSET) /* Lite */
-#define BCM_DMA11 (BCM_DMA0_BASE + BCM_DMA_CH11_OFFSET) /* DMA4 */
-#define BCM_DMA12 (BCM_DMA0_BASE + BCM_DMA_CH12_OFFSET) /* DMA4 */
-#define BCM_DMA13 (BCM_DMA0_BASE + BCM_DMA_CH13_OFFSET) /* DMA4 */
-#define BCM_DMA14 (BCM_DMA0_BASE + BCM_DMA_CH14_OFFSET) /* DMA4 */
-#define BCM_DMA15 (BCM_DMA15_BASE + BCM_DMA_CH15_OFFSET)
+#define BCM_DMA_CHANNUM (16) /* Number of DMA channels */
+
+/* DMA channel addresses
+ *
+ * NOTE:
+ *
+ * DMA 7-10 are DMA Lite channels.
+ * DMA 11-14 are DMA4 channels.
+ *
+ * DMA15 has its own unique base address and cannot be looked up with the
+ * BCM_DMA(n) macro. It is exclusively used by the VPU.
+ *
+ * DMA11 can access the PCIe interface.
+ *
+ * DMA0 and DMA15 have an external 128-bit 8-word read FIFO.
+ */
+
+#define BCM_DMA(n) (BCM_DMA0_BASE + 0x100 * (n))
+#define BCM_DMA15 (BCM_DMA15_BASE)

Review Comment:
   @linguini1 why to create a separated BCM_DMA15? Can't BCM_DMA(15) be used?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to