From 304fa0aa445384e5e681a54abf413850591cec10 Mon Sep 17 00:00:00 2001 From: Caleb Connolly Date: Wed, 20 Mar 2024 14:30:50 +0000 Subject: usb: gadget: UMS: support multiple sector sizes UFS storage often uses a 4096-byte sector size, add support for dynamic sector sizes based loosely on the Linux implementation. Support for dynamic sector sizes changes the types used in some divisions, resulting in the compiler attempting to use libgcc helpers (__aeabi_ldivmod). Replace these divisions with calls to lldiv() to handle this correctly. Reviewed-by: Mattijs Korpershoek Reviewed-by: Neil Armstrong Signed-off-by: Caleb Connolly Link: https://lore.kernel.org/r/20240320-b4-qcom-usb-v4-4-41be480172e1@linaro.org [mkorpershoek: squashed the lldiv() fix from caleb] Signed-off-by: Mattijs Korpershoek --- include/usb_mass_storage.h | 1 - 1 file changed, 1 deletion(-) (limited to 'include') diff --git a/include/usb_mass_storage.h b/include/usb_mass_storage.h index 83ab93b530d..6d83d93cad7 100644 --- a/include/usb_mass_storage.h +++ b/include/usb_mass_storage.h @@ -7,7 +7,6 @@ #ifndef __USB_MASS_STORAGE_H__ #define __USB_MASS_STORAGE_H__ -#define SECTOR_SIZE 0x200 #include #include -- cgit v1.2.3 From 4d158980897085a5b0255ab910208d8afc8522dc Mon Sep 17 00:00:00 2001 From: Marek Vasut Date: Sun, 17 Mar 2024 05:42:52 +0100 Subject: usb: udc: dwc3: Fold board dm_usb_gadget_handle_interrupts() into DWC3 gadget The dm_usb_gadget_handle_interrupts() has no place in board code. Move this into DWC3 driver. The OMAP implementation is special, add new weak dwc3_uboot_interrupt_status() function to decide whether DWC3 interrupt handling should be called, and override it in OMAP DWC3 code, to repair the special OMAP interrupt handling code until OMAP gets switched over to DM UDC proper. Signed-off-by: Marek Vasut Reviewed-by: Caleb Connolly Reviewed-by: Mattijs Korpershoek Tested-by: Mattijs Korpershoek # vim3 Tested-by: Caleb Connolly # qcom sdm845 Link: https://lore.kernel.org/r/20240317044357.547037-1-marek.vasut+renesas@mailbox.org Signed-off-by: Mattijs Korpershoek --- include/dwc3-omap-uboot.h | 1 - include/dwc3-uboot.h | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/dwc3-omap-uboot.h b/include/dwc3-omap-uboot.h index ed92bfc5a97..f220705ef7b 100644 --- a/include/dwc3-omap-uboot.h +++ b/include/dwc3-omap-uboot.h @@ -27,5 +27,4 @@ struct dwc3_omap_device { int dwc3_omap_uboot_init(struct dwc3_omap_device *dev); void dwc3_omap_uboot_exit(int index); -int dwc3_omap_uboot_interrupt_status(struct udevice *dev); #endif /* __DWC3_OMAP_UBOOT_H_ */ diff --git a/include/dwc3-uboot.h b/include/dwc3-uboot.h index 35cfbb93b29..5f13f5bcf40 100644 --- a/include/dwc3-uboot.h +++ b/include/dwc3-uboot.h @@ -44,6 +44,7 @@ struct dwc3_device { int dwc3_uboot_init(struct dwc3_device *dev); void dwc3_uboot_exit(int index); +int dwc3_uboot_interrupt_status(struct udevice *dev); void dwc3_uboot_handle_interrupt(struct udevice *dev); struct phy; -- cgit v1.2.3 From 12ac51cdb788b9f8e50cbc4fa3681102882ade33 Mon Sep 17 00:00:00 2001 From: Marek Vasut Date: Sun, 17 Mar 2024 05:42:53 +0100 Subject: usb: udc: dwc3: Fold dwc3_uboot_handle_interrupt into dm_usb_gadget_handle_interrupts The only call site of dwc3_uboot_handle_interrupt() is the dm_usb_gadget_handle_interrupts(), fold the former into the later. This makes dwc3_uboot_handle_interrupt() unavailable to be called from board code as well. Signed-off-by: Marek Vasut Reviewed-by: Mattijs Korpershoek Tested-by: Mattijs Korpershoek # vim3 Link: https://lore.kernel.org/r/20240317044357.547037-2-marek.vasut+renesas@mailbox.org Signed-off-by: Mattijs Korpershoek --- include/dwc3-uboot.h | 1 - 1 file changed, 1 deletion(-) (limited to 'include') diff --git a/include/dwc3-uboot.h b/include/dwc3-uboot.h index 5f13f5bcf40..3689d60ae7f 100644 --- a/include/dwc3-uboot.h +++ b/include/dwc3-uboot.h @@ -45,7 +45,6 @@ struct dwc3_device { int dwc3_uboot_init(struct dwc3_device *dev); void dwc3_uboot_exit(int index); int dwc3_uboot_interrupt_status(struct udevice *dev); -void dwc3_uboot_handle_interrupt(struct udevice *dev); struct phy; #if CONFIG_IS_ENABLED(PHY) && CONFIG_IS_ENABLED(DM_USB) -- cgit v1.2.3