[PATCH v3 6/8] usb: dwc2: Extract macro definitions to common header

Junhui Liu junhui.liu at pigmoral.tech
Tue Jan 7 13:52:40 CET 2025


Hi Mattijs,

Thank you for your review.

On 07/01/2025 10:55, Mattijs Korpershoek wrote:
> Hi Junhui,
> 
> Thank you for the patch.
> 
> On sam., janv. 04, 2025 at 11:37, Junhui Liu <junhui.liu at pigmoral.tech> wrote:
> 
>> From: Kongyang Liu <seashell11234455 at gmail.com>
>>
>> Some macros are shared between host and gadget code, causing duplicated
>> definitions. Move DWC2 macro definitions from host and gadget code into a
>> common header to reduce duplication.
>>
>> Signed-off-by: Kongyang Liu <seashell11234455 at gmail.com>
>> Reviewed-by: Marek Vasut <marex at denx.de>
>> Tested-by: Peter Robinson <pbrobinson at gmail.com>
>> Signed-off-by: Junhui Liu <junhui.liu at pigmoral.tech>
>> ---
>>  drivers/usb/common/dwc2_core.h         | 430 +++++++++++++++++++++++++++++++++
>>  drivers/usb/gadget/dwc2_udc_otg_regs.h | 160 +-----------
>>  drivers/usb/host/dwc2.h                | 291 ----------------------
>>  3 files changed, 431 insertions(+), 450 deletions(-)
> 
> [...]
> 
>>
>>  #endif /* __DWC2_CORE_H_ */
>> diff --git a/drivers/usb/gadget/dwc2_udc_otg_regs.h b/drivers/usb/gadget/dwc2_udc_otg_regs.h
>> index 6aec55970db682ef8a21fad0b47144a4a87a47ca..d27b2f6187ff35991bbbc05d97b6063117b082f0 100644
>> --- a/drivers/usb/gadget/dwc2_udc_otg_regs.h
>> +++ b/drivers/usb/gadget/dwc2_udc_otg_regs.h
>> @@ -10,65 +10,7 @@
>>  #ifndef __ASM_ARCH_REGS_USB_OTG_HS_H
>>  #define __ASM_ARCH_REGS_USB_OTG_HS_H
>>  
>> -#include <linux/bitops.h>
>> -
>> -struct dwc2_usbotg_phy {
>> -	u32 phypwr;
>> -	u32 phyclk;
>> -	u32 rstcon;
>> -};
> 
> This structure definition gets removed but is still used
> in drivers/usb/gadget/dwc2_udc_otg_phy.c. See otg_phy_init() for example.
> 
> Is that intentional ?

Sorry, it should be left here. Removing it will cause compile errors
when CONFIG_USB_GADGET_DWC2_OTG_PHY=y. I will fix it in the next version.

> 
>> -
>> -/*===================================================================== */
>> -/*definitions related to CSR setting */
>> -
> 
> [...]
> 
>>
>>

-- 
Best regards,
Junhui Liu


More information about the U-Boot mailing list