Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

usb: dwc3: exynos: Add support for Exynos5433 variant with all clocks

DWC3 variant found in Exynos5433 SoCs requires keeping all DRD30/UHOST30
clocks enabled all the time the driver does any access to DWC3 registers,
otherwise external abort happens. So far DWC3 hardware module worked with
samsung,exynos5250-dwusb3 compatible only by luck when built into kernel:
all DRD30 clocks were left enabled by bootloader and later kept enabled
by the DRD PHY driver. However, if one tried to use Exnos DWC3 driver as
a module or performed system suspend/resume cycle, external abort
happened. This patch finally fixes this issue.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>

authored by

Marek Szyprowski and committed by
Felipe Balbi
4c19cc14 9f216836

+12
+1
Documentation/devicetree/bindings/usb/dwc3.txt
··· 19 19 "cavium,octeon-7130-usb-uctl" 20 20 "qcom,dwc3" 21 21 "samsung,exynos5250-dwusb3" 22 + "samsung,exynos5433-dwusb3" 22 23 "samsung,exynos7-dwusb3" 23 24 "sprd,sc9860-dwc3" 24 25 "st,stih407-dwc3"
+2
Documentation/devicetree/bindings/usb/exynos-usb.txt
··· 83 83 - compatible: should be one of the following - 84 84 "samsung,exynos5250-dwusb3": for USB 3.0 DWC3 controller on 85 85 Exynos5250/5420. 86 + "samsung,exynos5433-dwusb3": for USB 3.0 DWC3 controller on 87 + Exynos5433. 86 88 "samsung,exynos7-dwusb3": for USB 3.0 DWC3 controller on Exynos7. 87 89 - #address-cells, #size-cells : should be '1' if the device has sub-nodes 88 90 with 'reg' property.
+9
drivers/usb/dwc3/dwc3-exynos.c
··· 162 162 .suspend_clk_idx = -1, 163 163 }; 164 164 165 + static const struct dwc3_exynos_driverdata exynos5433_drvdata = { 166 + .clk_names = { "aclk", "susp_clk", "pipe_pclk", "phyclk" }, 167 + .num_clks = 4, 168 + .suspend_clk_idx = 1, 169 + }; 170 + 165 171 static const struct dwc3_exynos_driverdata exynos7_drvdata = { 166 172 .clk_names = { "usbdrd30", "usbdrd30_susp_clk", "usbdrd30_axius_clk" }, 167 173 .num_clks = 3, ··· 178 172 { 179 173 .compatible = "samsung,exynos5250-dwusb3", 180 174 .data = &exynos5250_drvdata, 175 + }, { 176 + .compatible = "samsung,exynos5433-dwusb3", 177 + .data = &exynos5433_drvdata, 181 178 }, { 182 179 .compatible = "samsung,exynos7-dwusb3", 183 180 .data = &exynos7_drvdata,