Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Open sidebar
Eric Kuzmenko
uboot-imx
Commits
307bd2d8
Commit
307bd2d8
authored
Nov 19, 2018
by
Angus Ainslie (Purism)
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
imx8m_som.c : board_usb_init needs to be avaialble in the SPL and in u-boot
parent
5958b7cb
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
0 additions
and
98 deletions
+0
-98
board/emcraft/imx8m_som/imx8m_som.c
board/emcraft/imx8m_som/imx8m_som.c
+0
-4
board/emcraft/imx8m_som/spl.c
board/emcraft/imx8m_som/spl.c
+0
-94
No files found.
board/emcraft/imx8m_som/imx8m_som.c
View file @
307bd2d8
...
...
@@ -145,7 +145,6 @@ int board_phy_config(struct phy_device *phydev)
#endif
#ifdef CONFIG_USB_DWC3
#if 0
#define USB_PHY_CTRL0 0xF0040
#define USB_PHY_CTRL0_REF_SSP_EN BIT(2)
...
...
@@ -190,7 +189,6 @@ static void dwc3_nxp_usb_phy_init(struct dwc3_device *dwc3)
writel
(
RegData
,
dwc3
->
base
+
USB_PHY_CTRL1
);
}
#endif
#endif
int
usb_gadget_handle_interrupts
(
void
)
{
...
...
@@ -198,7 +196,6 @@ int usb_gadget_handle_interrupts(void)
return
0
;
}
#if 0
#ifdef CONFIG_USB_TCPC
struct
tcpc_port
port
;
struct
tcpc_port_config
port_config
=
{
...
...
@@ -280,7 +277,6 @@ int board_usb_cleanup(int index, enum usb_init_type init)
return
ret
;
}
#endif
#endif
int
board_init
(
void
)
...
...
board/emcraft/imx8m_som/spl.c
View file @
307bd2d8
...
...
@@ -368,100 +368,6 @@ static int setup_typec(void)
}
#endif
#ifdef CONFIG_SPL_USB_GADGET_SUPPORT
static
struct
dwc3_device
dwc3_device_data
=
{
.
maximum_speed
=
USB_SPEED_SUPER
,
.
base
=
USB1_BASE_ADDR
,
.
dr_mode
=
USB_DR_MODE_PERIPHERAL
,
.
index
=
0
,
.
power_down_scale
=
2
,
};
#define USB_PHY_CTRL0 0xF0040
#define USB_PHY_CTRL0_REF_SSP_EN BIT(2)
#define USB_PHY_CTRL1 0xF0044
#define USB_PHY_CTRL1_RESET BIT(0)
#define USB_PHY_CTRL1_COMMONONN BIT(1)
#define USB_PHY_CTRL1_ATERESET BIT(3)
#define USB_PHY_CTRL1_VDATSRCENB0 BIT(19)
#define USB_PHY_CTRL1_VDATDETENB0 BIT(20)
#define USB_PHY_CTRL2 0xF0048
#define USB_PHY_CTRL2_TXENABLEN0 BIT(8)
#if 0
int g_dnl_bind_fixup(struct usb_device_descriptor *dev, const char *name)
{
put_unaligned(CONFIG_G_DNL_PRODUCT_NUM + 0xfff, &dev->idProduct);
return 0;
}
#endif
static
void
dwc3_nxp_usb_phy_init
(
struct
dwc3_device
*
dwc3
)
{
u32
RegData
;
RegData
=
readl
(
dwc3
->
base
+
USB_PHY_CTRL1
);
RegData
&=
~
(
USB_PHY_CTRL1_VDATSRCENB0
|
USB_PHY_CTRL1_VDATDETENB0
|
USB_PHY_CTRL1_COMMONONN
);
RegData
|=
USB_PHY_CTRL1_RESET
|
USB_PHY_CTRL1_ATERESET
;
writel
(
RegData
,
dwc3
->
base
+
USB_PHY_CTRL1
);
RegData
=
readl
(
dwc3
->
base
+
USB_PHY_CTRL0
);
RegData
|=
USB_PHY_CTRL0_REF_SSP_EN
;
writel
(
RegData
,
dwc3
->
base
+
USB_PHY_CTRL0
);
RegData
=
readl
(
dwc3
->
base
+
USB_PHY_CTRL2
);
RegData
|=
USB_PHY_CTRL2_TXENABLEN0
;
writel
(
RegData
,
dwc3
->
base
+
USB_PHY_CTRL2
);
RegData
=
readl
(
dwc3
->
base
+
USB_PHY_CTRL1
);
RegData
&=
~
(
USB_PHY_CTRL1_RESET
|
USB_PHY_CTRL1_ATERESET
);
writel
(
RegData
,
dwc3
->
base
+
USB_PHY_CTRL1
);
}
#if defined(CONFIG_USB_DWC3) || defined(CONFIG_USB_XHCI_IMX8M)
int
board_usb_init
(
int
index
,
enum
usb_init_type
init
)
{
int
ret
=
0
;
imx8m_usb_power
(
index
,
true
);
if
(
index
==
0
&&
init
==
USB_INIT_DEVICE
)
{
#ifdef CONFIG_USB_TCPC
ret
=
tcpc_setup_ufp_mode
(
&
port
);
#endif
dwc3_nxp_usb_phy_init
(
&
dwc3_device_data
);
return
dwc3_uboot_init
(
&
dwc3_device_data
);
}
else
if
(
index
==
0
&&
init
==
USB_INIT_HOST
)
{
#ifdef CONFIG_USB_TCPC
ret
=
tcpc_setup_dfp_mode
(
&
port
);
#endif
return
ret
;
}
return
0
;
}
int
board_usb_cleanup
(
int
index
,
enum
usb_init_type
init
)
{
int
ret
=
0
;
if
(
index
==
0
&&
init
==
USB_INIT_DEVICE
)
{
dwc3_uboot_exit
(
index
);
}
else
if
(
index
==
0
&&
init
==
USB_INIT_HOST
)
{
#ifdef CONFIG_USB_TCPC
ret
=
tcpc_disable_src_vbus
(
&
port
);
#endif
}
imx8m_usb_power
(
index
,
false
);
return
ret
;
}
#endif
#endif
void
board_init_f
(
ulong
dummy
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment