From 7ea990553810905626415cb69c663b1411907f78 Mon Sep 17 00:00:00 2001 From: "he.he" Date: Fri, 25 Jan 2019 15:44:08 +0800 Subject: [PATCH] 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 --- drivers/amlogic/usb/dwc_otg/310/dwc_otg_driver.c | 6 ++++++ drivers/amlogic/usb/phy/phy-aml-new-usb2-v2.c | 6 ++++++ 2 files changed, 12 insertions(+) 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)) -- 2.7.4