From patchwork Tue May 12 13:38:27 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Griffin X-Patchwork-Id: 48375 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f69.google.com (mail-la0-f69.google.com [209.85.215.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id CF5822121F for ; Tue, 12 May 2015 13:38:43 +0000 (UTC) Received: by layy10 with SMTP id y10sf2129268lay.0 for ; Tue, 12 May 2015 06:38:42 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=GRaqDvYzt2eDLW1ouqFG3zZllzcTrD+2UWrs2zcwziA=; b=OoGPSb6JqCzLBOHbufM+QPDN2Mgq21Jn69QTpHvi0Tngip4yeLRrDLXisOeooD3xqn kkbkRlNMqjYf/HFQw7z2xAzJv2h4yvyTIun7LlHXzSnqbQAV6qjZxMDfHgTrZO97bYzW xcg0iRmw8p6cejwPVesnMNIfZXtnkUFDe/EHdEsl4kwx7+bx2nPbS4L3b7N2Vr3lobra 152+TS3an+KTfTDmh9spGHfFKIBTUQ6Qxb11FggXNse1X+grkjPVsuv5RxNbcu/L98VC rox77EQnJ9LNVgHLqKiDlFHq/vPSuOU1LPZKuCJG6+xq1Akq9nORx13HSd/Wj7hVaFCB QvfA== X-Gm-Message-State: ALoCoQnIvQ7RipXT5Bf0a7JiUcFWiypZxe3Zlvc9eoNjwsrlyvbbIDCds3BLQgC75OiS76Ptf0Iy X-Received: by 10.112.93.203 with SMTP id cw11mr10767708lbb.0.1431437922761; Tue, 12 May 2015 06:38:42 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.26.74 with SMTP id j10ls37436lag.7.gmail; Tue, 12 May 2015 06:38:42 -0700 (PDT) X-Received: by 10.112.161.66 with SMTP id xq2mr12296383lbb.31.1431437922628; Tue, 12 May 2015 06:38:42 -0700 (PDT) Received: from mail-lb0-f177.google.com (mail-lb0-f177.google.com. [209.85.217.177]) by mx.google.com with ESMTPS id u8si10391170laj.60.2015.05.12.06.38.42 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 12 May 2015 06:38:42 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.177 as permitted sender) client-ip=209.85.217.177; Received: by lbbuc2 with SMTP id uc2so6042355lbb.2 for ; Tue, 12 May 2015 06:38:42 -0700 (PDT) X-Received: by 10.152.37.228 with SMTP id b4mr3874711lak.117.1431437922547; Tue, 12 May 2015 06:38:42 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.112.108.230 with SMTP id hn6csp2098695lbb; Tue, 12 May 2015 06:38:41 -0700 (PDT) X-Received: by 10.180.38.70 with SMTP id e6mr5231440wik.91.1431437917812; Tue, 12 May 2015 06:38:37 -0700 (PDT) Received: from mail-wg0-f43.google.com (mail-wg0-f43.google.com. [74.125.82.43]) by mx.google.com with ESMTPS id n10si3193458wiy.56.2015.05.12.06.38.37 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 12 May 2015 06:38:37 -0700 (PDT) Received-SPF: pass (google.com: domain of peter.griffin@linaro.org designates 74.125.82.43 as permitted sender) client-ip=74.125.82.43; Received: by wggj6 with SMTP id j6so10183909wgg.3 for ; Tue, 12 May 2015 06:38:37 -0700 (PDT) X-Received: by 10.194.103.232 with SMTP id fz8mr29059261wjb.130.1431437917572; Tue, 12 May 2015 06:38:37 -0700 (PDT) Received: from localhost.localdomain (cpc14-aztw22-2-0-cust189.18-1.cable.virginm.net. [82.45.1.190]) by mx.google.com with ESMTPSA id ei8sm27810166wjd.32.2015.05.12.06.38.35 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 12 May 2015 06:38:36 -0700 (PDT) From: Peter Griffin To: u-boot@lists.denx.de, albert.u.boot@aribaud.net, trini@konsulko.com, panto@antoniou-consulting.com, marex@denx.de Cc: Peter Griffin Subject: [PATCH 1/6] usb: dwc2: Add support for v3 snpsid value Date: Tue, 12 May 2015 14:38:27 +0100 Message-Id: <1431437912-18988-2-git-send-email-peter.griffin@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1431437912-18988-1-git-send-email-peter.griffin@linaro.org> References: <1431437912-18988-1-git-send-email-peter.griffin@linaro.org> X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: peter.griffin@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.177 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , This has been tested to the extent that I can enumerate a asix usb networking adapter and boot a kernel over usb on the 96boards hikey u-boot port I'm currently doing. Signed-off-by: Peter Griffin --- drivers/usb/host/dwc2.c | 3 ++- drivers/usb/host/dwc2.h | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/usb/host/dwc2.c b/drivers/usb/host/dwc2.c index e8142ac..19a6007 100644 --- a/drivers/usb/host/dwc2.c +++ b/drivers/usb/host/dwc2.c @@ -1015,7 +1015,8 @@ int usb_lowlevel_init(int index, enum usb_init_type init, void **controller) snpsid = readl(®s->gsnpsid); printf("Core Release: %x.%03x\n", snpsid >> 12 & 0xf, snpsid & 0xfff); - if ((snpsid & DWC2_SNPSID_DEVID_MASK) != DWC2_SNPSID_DEVID_VER_2xx) { + if ((snpsid & DWC2_SNPSID_DEVID_MASK) != DWC2_SNPSID_DEVID_VER_2xx && + (snpsid & DWC2_SNPSID_DEVID_MASK) != DWC2_SNPSID_DEVID_VER_3xx) { printf("SNPSID invalid (not DWC2 OTG device): %08x\n", snpsid); return -ENODEV; } diff --git a/drivers/usb/host/dwc2.h b/drivers/usb/host/dwc2.h index ba08fd5..1e0f502 100644 --- a/drivers/usb/host/dwc2.h +++ b/drivers/usb/host/dwc2.h @@ -729,6 +729,7 @@ struct dwc2_core_regs { #define DWC2_PCGCCTL_DEEP_SLEEP (1 << 7) #define DWC2_PCGCCTL_DEEP_SLEEP_OFFSET 7 #define DWC2_SNPSID_DEVID_VER_2xx (0x4f542 << 12) +#define DWC2_SNPSID_DEVID_VER_3xx (0x4f543 << 12) #define DWC2_SNPSID_DEVID_MASK (0xfffff << 12) #define DWC2_SNPSID_DEVID_OFFSET 12