]> git.dujemihanovic.xyz Git - u-boot.git/commit
usb: gadget: UMS: support multiple sector sizes
authorCaleb Connolly <caleb.connolly@linaro.org>
Wed, 20 Mar 2024 14:30:50 +0000 (14:30 +0000)
committerMattijs Korpershoek <mkorpershoek@baylibre.com>
Fri, 22 Mar 2024 09:16:13 +0000 (10:16 +0100)
commit304fa0aa445384e5e681a54abf413850591cec10
tree5817de290bf955376c21b2eb081bbaa8e1142195
parent341a172ef7867e3bfa90d6951997e5e2f168e188
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 <mkorpershoek@baylibre.com>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
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 <mkorpershoek@baylibre.com>
cmd/usb_mass_storage.c
drivers/usb/gadget/f_mass_storage.c
drivers/usb/gadget/storage_common.c
include/usb_mass_storage.h