Hi!

I am using stm32mp157c-dk2 board. I added support for usb ethernet gadget
(the short patch is attached). Then, when I booted the board I see the
following output when running ping:

#######################################################
STM32MP> ping 10.0.0.1
using dwc2-udc, OUT ep2out-bulk IN ep1in-bulk STATUS ep3in-int
MAC f8:dc:7a:00:00:02
HOST MAC f8:dc:7a:00:00:01
RNDIS ready
high speed config #2: 2 mA, Ethernet Gadget, using RNDIS
USB RNDIS network up!
CACHE: Misaligned operation at range [ddcfbcc4, ddcfbd04]
Using usb_ether device
CACHE: Misaligned operation at range [dbc3c678, dbc3c6f8]
CACHE: Misaligned operation at range [dbc3c678, dbc3c6f8]
host 10.0.0.1 is alive
######################################################

Is there a way to get rid of the warning? Is the warning hides a real
problem?
I saw some discussions and patches regarding this issue so I am not sure if
the is some problem here.

Thanks!
Shlomi
From 1c2e523b753ca491e3b6cbbb90547969e404494d Mon Sep 17 00:00:00 2001
From: Shlomi Vaknin <[email protected]>
Date: Thu, 8 Oct 2020 12:03:39 +0300
Subject: [PATCH] stm32mp1: add support for usb ether gadget.

Add the dwc2-udc to available controllers and call
init function of ether gadget in stm32 board late init.

Signed-off-by: Shlomi Vaknin <[email protected]>
---
 board/st/stm32mp1/stm32mp1.c      | 4 ++++
 drivers/usb/gadget/gadget_chips.h | 8 ++++++++
 2 files changed, 12 insertions(+)

diff --git a/board/st/stm32mp1/stm32mp1.c b/board/st/stm32mp1/stm32mp1.c
index 3b677d339b..b46eec2e1c 100644
--- a/board/st/stm32mp1/stm32mp1.c
+++ b/board/st/stm32mp1/stm32mp1.c
@@ -699,6 +699,10 @@ int board_late_init(void)
 	/* for DK1/DK2 boards */
 	board_check_usb_power();
 
+#if defined(CONFIG_USB_ETHER)
+        usb_ether_init();
+#endif
+
 	return 0;
 }
 
diff --git a/drivers/usb/gadget/gadget_chips.h b/drivers/usb/gadget/gadget_chips.h
index 587204cfb7..270d3f0058 100644
--- a/drivers/usb/gadget/gadget_chips.h
+++ b/drivers/usb/gadget/gadget_chips.h
@@ -161,6 +161,12 @@
 #define gadget_is_max3420(g)        0
 #endif
 
+#ifdef CONFIG_USB_GADGET_DWC2_OTG
+#define gadget_is_dwc2(g)        (!strcmp("dwc2-udc", (g)->name))
+#else
+#define gadget_is_dwc2(g)        0
+#endif
+
 /**
  * usb_gadget_controller_number - support bcdDevice id convention
  * @gadget: the controller being driven
@@ -224,5 +230,7 @@ static inline int usb_gadget_controller_number(struct usb_gadget *gadget)
 		return 0x24;
 	else if (gadget_is_max3420(gadget))
 		return 0x25;
+	else if (gadget_is_dwc2(gadget))
+                return 0x26;
 	return -ENOENT;
 }
-- 
2.25.1

Reply via email to