Commit 9962b62f authored by John Youn's avatar John Youn Committed by Felipe Balbi

usb: dwc2: Deprecate g-use-dma binding

This is not needed as the gadget now fully supports DMA and it can
autodetect it. This was initially added because gadget DMA mode was only
partially implemented so could not be automatically enabled.
Signed-off-by: default avatarJohn Youn <johnyoun@synopsys.com>
Signed-off-by: default avatarFelipe Balbi <felipe.balbi@linux.intel.com>
parent 5fb6fdaf
...@@ -25,11 +25,13 @@ Optional properties: ...@@ -25,11 +25,13 @@ Optional properties:
Refer to phy/phy-bindings.txt for generic phy consumer properties Refer to phy/phy-bindings.txt for generic phy consumer properties
- dr_mode: shall be one of "host", "peripheral" and "otg" - dr_mode: shall be one of "host", "peripheral" and "otg"
Refer to usb/generic.txt Refer to usb/generic.txt
- g-use-dma: enable dma usage in gadget driver.
- g-rx-fifo-size: size of rx fifo size in gadget mode. - g-rx-fifo-size: size of rx fifo size in gadget mode.
- g-np-tx-fifo-size: size of non-periodic tx fifo size in gadget mode. - g-np-tx-fifo-size: size of non-periodic tx fifo size in gadget mode.
- g-tx-fifo-size: size of periodic tx fifo per endpoint (except ep0) in gadget mode. - g-tx-fifo-size: size of periodic tx fifo per endpoint (except ep0) in gadget mode.
Deprecated properties:
- g-use-dma: gadget DMA mode is automatically detected
Example: Example:
usb@101c0000 { usb@101c0000 {
......
...@@ -204,7 +204,6 @@ usb_otg: usb@10180000 { ...@@ -204,7 +204,6 @@ usb_otg: usb@10180000 {
g-np-tx-fifo-size = <16>; g-np-tx-fifo-size = <16>;
g-rx-fifo-size = <275>; g-rx-fifo-size = <275>;
g-tx-fifo-size = <256 128 128 64 64 32>; g-tx-fifo-size = <256 128 128 64 64 32>;
g-use-dma;
status = "disabled"; status = "disabled";
}; };
......
...@@ -596,7 +596,6 @@ usb_otg: usb@ff580000 { ...@@ -596,7 +596,6 @@ usb_otg: usb@ff580000 {
g-np-tx-fifo-size = <16>; g-np-tx-fifo-size = <16>;
g-rx-fifo-size = <275>; g-rx-fifo-size = <275>;
g-tx-fifo-size = <256 128 128 64 64 32>; g-tx-fifo-size = <256 128 128 64 64 32>;
g-use-dma;
phys = <&usbphy0>; phys = <&usbphy0>;
phy-names = "usb2-phy"; phy-names = "usb2-phy";
status = "disabled"; status = "disabled";
......
...@@ -181,7 +181,6 @@ usb_otg: usb@10180000 { ...@@ -181,7 +181,6 @@ usb_otg: usb@10180000 {
g-np-tx-fifo-size = <16>; g-np-tx-fifo-size = <16>;
g-rx-fifo-size = <275>; g-rx-fifo-size = <275>;
g-tx-fifo-size = <256 128 128 64 64 32>; g-tx-fifo-size = <256 128 128 64 64 32>;
g-use-dma;
phys = <&usbphy0>; phys = <&usbphy0>;
phy-names = "usb2-phy"; phy-names = "usb2-phy";
status = "disabled"; status = "disabled";
......
...@@ -747,7 +747,6 @@ usb: usb@f72c0000 { ...@@ -747,7 +747,6 @@ usb: usb@f72c0000 {
clocks = <&sys_ctrl HI6220_USBOTG_HCLK>; clocks = <&sys_ctrl HI6220_USBOTG_HCLK>;
clock-names = "otg"; clock-names = "otg";
dr_mode = "otg"; dr_mode = "otg";
g-use-dma;
g-rx-fifo-size = <512>; g-rx-fifo-size = <512>;
g-np-tx-fifo-size = <128>; g-np-tx-fifo-size = <128>;
g-tx-fifo-size = <128 128 128 128 128 128>; g-tx-fifo-size = <128 128 128 128 128 128>;
......
...@@ -537,7 +537,6 @@ usb_otg: usb@ff580000 { ...@@ -537,7 +537,6 @@ usb_otg: usb@ff580000 {
g-np-tx-fifo-size = <16>; g-np-tx-fifo-size = <16>;
g-rx-fifo-size = <275>; g-rx-fifo-size = <275>;
g-tx-fifo-size = <256 128 128 64 64 32>; g-tx-fifo-size = <256 128 128 64 64 32>;
g-use-dma;
status = "disabled"; status = "disabled";
}; };
......
...@@ -418,9 +418,7 @@ enum dwc2_ep0_state { ...@@ -418,9 +418,7 @@ enum dwc2_ep0_state {
* needed. * needed.
* 0 - No (default) * 0 - No (default)
* 1 - Yes * 1 - Yes
* @g_dma: If true, enables dma usage on the device. This * @g_dma: Enables gadget dma usage (default: autodetect).
* setting is not auto-detected. It must be
* explicitly enabled (default: false).
* @g_rx_fifo_size: The periodic rx fifo size for the device, in * @g_rx_fifo_size: The periodic rx fifo size for the device, in
* DWORDS from 16-32768 (default: 2048 if * DWORDS from 16-32768 (default: 2048 if
* possible, otherwise autodetect). * possible, otherwise autodetect).
......
...@@ -1086,6 +1086,19 @@ static void dwc2_set_param_tx_fifo_sizes(struct dwc2_hsotg *hsotg) ...@@ -1086,6 +1086,19 @@ static void dwc2_set_param_tx_fifo_sizes(struct dwc2_hsotg *hsotg)
} }
} }
static void dwc2_set_gadget_dma(struct dwc2_hsotg *hsotg)
{
struct dwc2_hw_params *hw = &hsotg->hw_params;
struct dwc2_core_params *p = &hsotg->params;
bool dma_capable = !(hw->arch == GHWCFG2_SLAVE_ONLY_ARCH);
/* Buffer DMA */
dwc2_set_param_bool(hsotg, &p->g_dma,
false, "gadget-dma",
true, false,
dma_capable);
}
/** /**
* dwc2_set_parameters() - Set all core parameters. * dwc2_set_parameters() - Set all core parameters.
* *
...@@ -1161,9 +1174,7 @@ static void dwc2_set_parameters(struct dwc2_hsotg *hsotg, ...@@ -1161,9 +1174,7 @@ static void dwc2_set_parameters(struct dwc2_hsotg *hsotg,
(hsotg->dr_mode == USB_DR_MODE_OTG)) { (hsotg->dr_mode == USB_DR_MODE_OTG)) {
dev_dbg(hsotg->dev, "Setting peripheral device properties\n"); dev_dbg(hsotg->dev, "Setting peripheral device properties\n");
dwc2_set_param_bool(hsotg, &p->g_dma, true, "g-use-dma", dwc2_set_gadget_dma(hsotg);
false, false,
dma_capable);
/* /*
* The values for g_rx_fifo_size (2048) and * The values for g_rx_fifo_size (2048) and
......
...@@ -67,7 +67,6 @@ static int dwc2_pci_quirks(struct pci_dev *pdev, struct platform_device *dwc2) ...@@ -67,7 +67,6 @@ static int dwc2_pci_quirks(struct pci_dev *pdev, struct platform_device *dwc2)
if (pdev->vendor == PCI_VENDOR_ID_SYNOPSYS && if (pdev->vendor == PCI_VENDOR_ID_SYNOPSYS &&
pdev->device == PCI_PRODUCT_ID_HAPS_HSOTG) { pdev->device == PCI_PRODUCT_ID_HAPS_HSOTG) {
struct property_entry properties[] = { struct property_entry properties[] = {
PROPERTY_ENTRY_BOOL("g-use-dma"),
{ }, { },
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment