]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
net: rtl8169: Fix DMA minimal aligned compile warning in RISC-V
authorMinda Chen <minda.chen@starfivetech.com>
Thu, 20 Jul 2023 11:37:27 +0000 (19:37 +0800)
committerLeo Yu-Chi Liang <ycliang@andestech.com>
Wed, 2 Aug 2023 03:02:32 +0000 (11:02 +0800)
For RISC-V architeture, hardware maintain the dcache coherency.
Software do not flush the cache. So even cache-line size larger
than descriptor size, driver can work.

Signed-off-by: Minda Chen <minda.chen@starfivetech.com>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
drivers/net/rtl8169.c

index dcba51590d1158c4dad71e37da0cec4859529617..34e4cff1e9c9760d884e5fd7241560160b35cbc8 100644 (file)
@@ -311,10 +311,12 @@ static unsigned char rxdata[RX_BUF_LEN];
  *
  * This can be fixed by defining CONFIG_SYS_NONCACHED_MEMORY which will cause
  * the driver to allocate descriptors from a pool of non-cached memory.
+ *
+ * Hardware maintain D-cache coherency in RISC-V architecture.
  */
 #if RTL8169_DESC_SIZE < ARCH_DMA_MINALIGN
 #if !defined(CONFIG_SYS_NONCACHED_MEMORY) && \
-       !CONFIG_IS_ENABLED(SYS_DCACHE_OFF) && !defined(CONFIG_X86)
+       !CONFIG_IS_ENABLED(SYS_DCACHE_OFF) && !defined(CONFIG_X86) && !defined(CONFIG_RISCV)
 #warning cache-line size is larger than descriptor size
 #endif
 #endif