mirror of
https://github.com/u-boot/u-boot.git
synced 2025-04-24 06:24:17 +00:00
Merge tag 'u-boot-dfu-20240516' of https://source.denx.de/u-boot/custodians/u-boot-dfu
u-boot-dfu-20240516 - Fix cdns3 low power hang via fast access bit - Multiple dwc3 gadget fixes, mainly for USB support on TI AM6232 - Consistent USB_GADGET_MANUFACTURER for PHYTEC boards - MAINTAINERS file update for u-boot-dfu
This commit is contained in:
commit
ad7dce5abd
9 changed files with 59 additions and 8 deletions
|
@ -1017,8 +1017,11 @@ F: common/update.c
|
|||
F: doc/api/dfu.rst
|
||||
F: doc/usage/dfu.rst
|
||||
F: drivers/dfu/
|
||||
F: drivers/usb/*/*gadget*
|
||||
F: drivers/usb/gadget/
|
||||
F: include/dfu.h
|
||||
F: include/linux/usb/ch9.h
|
||||
F: include/linux/usb/gadget.h
|
||||
|
||||
DRIVER MODEL
|
||||
M: Simon Glass <sjg@chromium.org>
|
||||
|
@ -1118,6 +1121,7 @@ F: test/py/tests/test_event_dump.py
|
|||
FASTBOOT
|
||||
M: Mattijs Korpershoek <mkorpershoek@baylibre.com>
|
||||
S: Maintained
|
||||
T: git https://source.denx.de/u-boot/custodians/u-boot-dfu.git
|
||||
F: cmd/fastboot.c
|
||||
F: doc/android/fastboot*.rst
|
||||
F: include/fastboot.h
|
||||
|
|
|
@ -147,7 +147,7 @@ CONFIG_USB_DWC3=y
|
|||
CONFIG_USB_DWC3_GENERIC=y
|
||||
CONFIG_USB_STORAGE=y
|
||||
CONFIG_USB_GADGET=y
|
||||
CONFIG_USB_GADGET_MANUFACTURER="FSL"
|
||||
CONFIG_USB_GADGET_MANUFACTURER="PHYTEC"
|
||||
CONFIG_USB_GADGET_VENDOR_NUM=0x0525
|
||||
CONFIG_USB_GADGET_PRODUCT_NUM=0xa4a5
|
||||
CONFIG_IMX_WATCHDOG=y
|
||||
|
|
|
@ -160,7 +160,7 @@ CONFIG_USB_CDNS3=y
|
|||
CONFIG_USB_CDNS3_GADGET=y
|
||||
CONFIG_USB_CDNS3_HOST=y
|
||||
CONFIG_USB_GADGET=y
|
||||
CONFIG_USB_GADGET_MANUFACTURER="Texas Instruments"
|
||||
CONFIG_USB_GADGET_MANUFACTURER="PHYTEC"
|
||||
CONFIG_USB_GADGET_VENDOR_NUM=0x0451
|
||||
CONFIG_USB_GADGET_PRODUCT_NUM=0x6165
|
||||
CONFIG_USB_GADGET_DOWNLOAD=y
|
||||
|
|
|
@ -171,7 +171,7 @@ CONFIG_USB_STORAGE=y
|
|||
CONFIG_SPL_USB_STORAGE=y
|
||||
CONFIG_USB_GADGET=y
|
||||
CONFIG_SPL_USB_GADGET=y
|
||||
CONFIG_USB_GADGET_MANUFACTURER="Texas Instruments"
|
||||
CONFIG_USB_GADGET_MANUFACTURER="PHYTEC"
|
||||
CONFIG_USB_GADGET_VENDOR_NUM=0x0451
|
||||
CONFIG_USB_GADGET_PRODUCT_NUM=0x6165
|
||||
CONFIG_USB_GADGET_DOWNLOAD=y
|
||||
|
|
|
@ -62,7 +62,7 @@ CONFIG_IMX_THERMAL=y
|
|||
CONFIG_USB=y
|
||||
CONFIG_SPL_USB_HOST=y
|
||||
CONFIG_USB_GADGET=y
|
||||
CONFIG_USB_GADGET_MANUFACTURER="Phytec"
|
||||
CONFIG_USB_GADGET_MANUFACTURER="PHYTEC"
|
||||
CONFIG_USB_GADGET_VENDOR_NUM=0x1b67
|
||||
CONFIG_USB_GADGET_PRODUCT_NUM=0x4fff
|
||||
CONFIG_CI_UDC=y
|
||||
|
|
|
@ -53,7 +53,7 @@ CONFIG_IMX_THERMAL=y
|
|||
CONFIG_USB=y
|
||||
CONFIG_SPL_USB_HOST=y
|
||||
CONFIG_USB_GADGET=y
|
||||
CONFIG_USB_GADGET_MANUFACTURER="Phytec"
|
||||
CONFIG_USB_GADGET_MANUFACTURER="PHYTEC"
|
||||
CONFIG_USB_GADGET_VENDOR_NUM=0x1b67
|
||||
CONFIG_USB_GADGET_PRODUCT_NUM=0x4fff
|
||||
CONFIG_CI_UDC=y
|
||||
|
|
|
@ -2325,6 +2325,9 @@ static void cdns3_gadget_config(struct cdns3_device *priv_dev)
|
|||
writel(USB_IEN_INIT, ®s->usb_ien);
|
||||
writel(USB_CONF_CLK2OFFDS | USB_CONF_L1DS, ®s->usb_conf);
|
||||
|
||||
/* Set the Fast access bit */
|
||||
writel(PUSB_PWR_FST_REG_ACCESS, &priv_dev->regs->usb_pwr);
|
||||
|
||||
cdns3_configure_dmult(priv_dev, NULL);
|
||||
|
||||
cdns3_gadget_pullup(&priv_dev->gadget, 1);
|
||||
|
@ -2383,6 +2386,7 @@ static int cdns3_gadget_udc_stop(struct usb_gadget *gadget)
|
|||
|
||||
/* disable interrupt for device */
|
||||
writel(0, &priv_dev->regs->usb_ien);
|
||||
writel(0, &priv_dev->regs->usb_pwr);
|
||||
writel(USB_CONF_DEVDS, &priv_dev->regs->usb_conf);
|
||||
|
||||
return ret;
|
||||
|
|
|
@ -405,6 +405,8 @@
|
|||
#define DWC3_DEPCMD_SETTRANSFRESOURCE (0x02 << 0)
|
||||
#define DWC3_DEPCMD_SETEPCONFIG (0x01 << 0)
|
||||
|
||||
#define DWC3_DEPCMD_CMD(x) ((x) & 0xf)
|
||||
|
||||
/* The EP number goes 0..31 so ep0 is always out and ep1 is always in */
|
||||
#define DWC3_DALEPENA_EP(n) (1 << n)
|
||||
|
||||
|
|
|
@ -300,8 +300,38 @@ int dwc3_send_gadget_ep_cmd(struct dwc3 *dwc, unsigned ep,
|
|||
unsigned cmd, struct dwc3_gadget_ep_cmd_params *params)
|
||||
{
|
||||
u32 timeout = 500;
|
||||
u32 saved_config = 0;
|
||||
u32 reg;
|
||||
|
||||
int ret = -EINVAL;
|
||||
|
||||
/*
|
||||
* When operating in USB 2.0 speeds (HS/FS), if GUSB2PHYCFG.ENBLSLPM or
|
||||
* GUSB2PHYCFG.SUSPHY is set, it must be cleared before issuing an
|
||||
* endpoint command.
|
||||
*
|
||||
* Save and clear both GUSB2PHYCFG.ENBLSLPM and GUSB2PHYCFG.SUSPHY
|
||||
* settings. Restore them after the command is completed.
|
||||
*
|
||||
* DWC_usb3 3.30a and DWC_usb31 1.90a programming guide section 3.2.2
|
||||
*/
|
||||
if (dwc->gadget.speed <= USB_SPEED_HIGH ||
|
||||
DWC3_DEPCMD_CMD(cmd) == DWC3_DEPCMD_ENDTRANSFER) {
|
||||
reg = dwc3_readl(dwc->regs, DWC3_GUSB2PHYCFG(0));
|
||||
if (unlikely(reg & DWC3_GUSB2PHYCFG_SUSPHY)) {
|
||||
saved_config |= DWC3_GUSB2PHYCFG_SUSPHY;
|
||||
reg &= ~DWC3_GUSB2PHYCFG_SUSPHY;
|
||||
}
|
||||
|
||||
if (reg & DWC3_GUSB2PHYCFG_ENBLSLPM) {
|
||||
saved_config |= DWC3_GUSB2PHYCFG_ENBLSLPM;
|
||||
reg &= ~DWC3_GUSB2PHYCFG_ENBLSLPM;
|
||||
}
|
||||
|
||||
if (saved_config)
|
||||
dwc3_writel(dwc->regs, DWC3_GUSB2PHYCFG(0), reg);
|
||||
}
|
||||
|
||||
dwc3_writel(dwc->regs, DWC3_DEPCMDPAR0(ep), params->param0);
|
||||
dwc3_writel(dwc->regs, DWC3_DEPCMDPAR1(ep), params->param1);
|
||||
dwc3_writel(dwc->regs, DWC3_DEPCMDPAR2(ep), params->param2);
|
||||
|
@ -312,7 +342,8 @@ int dwc3_send_gadget_ep_cmd(struct dwc3 *dwc, unsigned ep,
|
|||
if (!(reg & DWC3_DEPCMD_CMDACT)) {
|
||||
dev_vdbg(dwc->dev, "Command Complete --> %d\n",
|
||||
DWC3_DEPCMD_STATUS(reg));
|
||||
return 0;
|
||||
ret = 0;
|
||||
break;
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -320,11 +351,21 @@ int dwc3_send_gadget_ep_cmd(struct dwc3 *dwc, unsigned ep,
|
|||
* interrupt context.
|
||||
*/
|
||||
timeout--;
|
||||
if (!timeout)
|
||||
return -ETIMEDOUT;
|
||||
if (!timeout) {
|
||||
ret = -ETIMEDOUT;
|
||||
break;
|
||||
}
|
||||
|
||||
udelay(1);
|
||||
} while (1);
|
||||
|
||||
if (saved_config) {
|
||||
reg = dwc3_readl(dwc->regs, DWC3_GUSB2PHYCFG(0));
|
||||
reg |= saved_config;
|
||||
dwc3_writel(dwc->regs, DWC3_GUSB2PHYCFG(0), reg);
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static dma_addr_t dwc3_trb_dma_offset(struct dwc3_ep *dep,
|
||||
|
|
Loading…
Add table
Reference in a new issue