From: he.he Date: Fri, 25 Jan 2019 07:44:08 +0000 (+0800) Subject: usb: check SoC rev [1/2] X-Git-Tag: hardkernel-4.9.236-104~1777 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7ea990553810905626415cb69c663b1411907f78;p=platform%2Fkernel%2Flinux-amlogic.git usb: check SoC rev [1/2] PD#SWPL-4582 Problem: Need to check Soc rev to distinguish G12B revB. Solution: Check Soc rev set version and phy-interface for g12b revB. Test: make w400 bootimage Verify: pass on W400 Change-Id: I338d7f0eed7bb61660625343404f756f0edf0d54 Signed-off-by: he.he --- diff --git a/drivers/amlogic/usb/dwc_otg/310/dwc_otg_driver.c b/drivers/amlogic/usb/dwc_otg/310/dwc_otg_driver.c index d4ea816..3ce109b 100644 --- a/drivers/amlogic/usb/dwc_otg/310/dwc_otg_driver.c +++ b/drivers/amlogic/usb/dwc_otg/310/dwc_otg_driver.c @@ -71,6 +71,7 @@ #include #include #include +#include #ifdef CONFIG_AMLOGIC_LEGACY_EARLY_SUSPEND #include #endif @@ -1058,6 +1059,11 @@ static int dwc_otg_driver_probe(struct platform_device *pdev) if (prop) phy_interface = of_read_ulong(prop, 1); + if (is_meson_g12b_cpu()) { + if (!is_meson_rev_a()) + phy_interface = 2; + } + dwc_otg_module_params.host_rx_fifo_size = dwc_otg_module_params.data_fifo_size / 2; DWC_PRINTF("dwc_otg: %s: type: %d speed: %d, ", s_clock_name, port_type, port_speed); diff --git a/drivers/amlogic/usb/phy/phy-aml-new-usb2-v2.c b/drivers/amlogic/usb/phy/phy-aml-new-usb2-v2.c index 82fc567..787da97 100644 --- a/drivers/amlogic/usb/phy/phy-aml-new-usb2-v2.c +++ b/drivers/amlogic/usb/phy/phy-aml-new-usb2-v2.c @@ -27,6 +27,7 @@ #include #include #include +#include #include "phy-aml-new-usb-v2.h" struct amlogic_usb_v2 *g_phy2_v2; @@ -243,6 +244,11 @@ static int amlogic_new_usb2_probe(struct platform_device *pdev) else phy_version = 0; + if (is_meson_g12b_cpu()) { + if (!is_meson_rev_a()) + phy_version = 1; + } + phy_mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); phy_base = devm_ioremap_resource(dev, phy_mem); if (IS_ERR(phy_base))