From: Sam Edwards <cfsworks@gmail.com>
To: u-boot@lists.denx.de
Cc: Andre Przywara <andre.przywara@arm.com>,
Jagan Teki <jagan@amarulasolutions.com>,
Marek Vasut <marex@denx.de>, Sam Edwards <CFSworks@gmail.com>
Subject: [PATCH 1/2] usb: musb-new: sunxi: only perform SRAM initialization when necessary
Date: Wed, 7 Jun 2023 17:16:43 -0600 [thread overview]
Message-ID: <20230607231644.28203-2-CFSworks@gmail.com> (raw)
In-Reply-To: <20230607231644.28203-1-CFSworks@gmail.com>
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@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
next prev parent reply other threads:[~2023-06-07 23:17 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-07 23:16 [PATCH 0/2] sunxi, usb: Clean up SRAM initialization code Sam Edwards
2023-06-07 23:16 ` Sam Edwards [this message]
2023-06-08 12:03 ` [PATCH 1/2] usb: musb-new: sunxi: only perform SRAM initialization when necessary Andre Przywara
2023-06-09 10:00 ` Andre Przywara
2023-06-07 23:16 ` [PATCH 2/2] usb: musb-new: sunxi: clarify the purpose of SRAM initialization Sam Edwards
2023-06-09 10:13 ` Andre Przywara
2023-06-09 19:16 ` Sam Edwards
2023-06-09 19:40 ` Andre Przywara
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230607231644.28203-2-CFSworks@gmail.com \
--to=cfsworks@gmail.com \
--cc=andre.przywara@arm.com \
--cc=jagan@amarulasolutions.com \
--cc=marex@denx.de \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.