[PATCH 1/2] usb: musb-new: sunxi: only perform SRAM initialization when necessary
Sam Edwards
cfsworks at gmail.com
Thu Jun 8 01:16:43 CEST 2023
Only the older (ca. A10, A20) sunxis need this poke for the MUSB to
function. Mimic the Linux kernel and add a `has_sram` flag to the config
structure that is only set for the specific compatibles that require
this initialization.
Signed-off-by: Sam Edwards <CFSworks at gmail.com>
---
drivers/usb/musb-new/sunxi.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/drivers/usb/musb-new/sunxi.c b/drivers/usb/musb-new/sunxi.c
index ab55d68620..c05c0d5561 100644
--- a/drivers/usb/musb-new/sunxi.c
+++ b/drivers/usb/musb-new/sunxi.c
@@ -85,6 +85,7 @@
struct sunxi_musb_config {
struct musb_hdrc_config *config;
+ bool has_sram;
};
struct sunxi_glue {
@@ -313,7 +314,10 @@ static int sunxi_musb_init(struct musb *musb)
musb->isr = sunxi_musb_interrupt;
- USBC_ConfigFIFO_Base();
+ if (glue->cfg->has_sram) {
+ USBC_ConfigFIFO_Base();
+ }
+
USBC_EnableDpDmPullUp(musb->mregs);
USBC_EnableIdPullUp(musb->mregs);
@@ -525,6 +529,7 @@ static int musb_usb_remove(struct udevice *dev)
static const struct sunxi_musb_config sun4i_a10_cfg = {
.config = &musb_config,
+ .has_sram = true,
};
static const struct sunxi_musb_config sun6i_a31_cfg = {
--
2.39.2
More information about the U-Boot
mailing list