From patchwork Mon Aug 20 10:31:24 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Haojian Zhuang X-Patchwork-Id: 144562 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp3796753ljj; Mon, 20 Aug 2018 03:31:43 -0700 (PDT) X-Google-Smtp-Source: AA+uWPxLImivqCnoWYl3Dz9RZ5Mnf1BgD3TxqKtbPW1ILhjErxvyV/iKAzXN7v2euqo6XkpQEfET X-Received: by 2002:ac8:3872:: with SMTP id r47-v6mr43498212qtb.69.1534761103371; Mon, 20 Aug 2018 03:31:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1534761103; cv=none; d=google.com; s=arc-20160816; b=rUeAadDblLbnHwMUhOD1LhRSW3cVFeghT+x5xRTLbWfBMiNs70PA3bpMckzVShjRso 9xxAOKaQ+5ltgljxvzpGmzyU7A9HnkKvtOfIznqWhUWgKu8R7cV6dXNN6qejT5/p4556 RPvo0fWNcI7gB8mzh2klzIyXrn9RR26ayNqaNraRfTA0uhNyQKmHqhI4NmVnsanry8mT LjmykgXkcAzIHW4RwwIRB/Dy99NMcpH767z/IRgEJv1o5ceAIkBDCtti1YFzHnxtrVoP BJnU/f2kFw991ktZ34wvpZ7pUiCBjBhy943/R39VNTxKVssGSLP6Y6R9KFgNlGQIY0jY 5R2g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:references:in-reply-to:message-id:date :to:from:dkim-signature:delivered-to:arc-authentication-results; bh=LU5rTAcLD+mBMZ9XUOKpfanYYh5RrGubqTsckSIOWSQ=; b=Moo1A6CLcAVNyIY+YJiIGTD1Dp6EcZ5xnSHyJ92PCVi2ekqznB53lV6CJLG8/mpNLF U8kUTNFY4uXt9VHCPpiVopXfzcKvN89498iSY0ChzQZ1y3MSy4yAWyaw78+rQVYZfYLP 6dXfvTWd1fi5eBIMVVBlsA8nwzqjPZdmHEdqxWi9pag/izz87wtq+Yma7ofgkuY5ipmB qjOBhlEbS2GY/N2N4Lq5Wnsasb5Y7kH4Lm7RU6J/ce809YxN/xGoFn6MsgFqCC1+2Mbh hFGQ9bHlYYmKUrHc37yOnCF0GNrBFj/jOIZ0tsFRL/B1d/hvvH3woQNvvq1iSOwXJsDE wSEA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=MggwGIiw; spf=pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 2001:19d0:306:5::1 as permitted sender) smtp.mailfrom=edk2-devel-bounces@lists.01.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from ml01.01.org (ml01.01.org. [2001:19d0:306:5::1]) by mx.google.com with ESMTPS id w17-v6si1219141qtk.68.2018.08.20.03.31.42 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 20 Aug 2018 03:31:43 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 2001:19d0:306:5::1 as permitted sender) client-ip=2001:19d0:306:5::1; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=MggwGIiw; spf=pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 2001:19d0:306:5::1 as permitted sender) smtp.mailfrom=edk2-devel-bounces@lists.01.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 0984B210F624B; Mon, 20 Aug 2018 03:31:42 -0700 (PDT) X-Original-To: edk2-devel@lists.01.org Delivered-To: edk2-devel@lists.01.org Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2607:f8b0:4864:20::444; helo=mail-pf1-x444.google.com; envelope-from=haojian.zhuang@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-pf1-x444.google.com (mail-pf1-x444.google.com [IPv6:2607:f8b0:4864:20::444]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id A098C210F4BDA for ; Mon, 20 Aug 2018 03:31:40 -0700 (PDT) Received: by mail-pf1-x444.google.com with SMTP id u24-v6so6537352pfn.13 for ; Mon, 20 Aug 2018 03:31:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=HtRTc6K3YHre9Kf3JwwMHj9MOF4XLmspDqfrKFB92yk=; b=MggwGIiwxvoHgEB5i+p1WObAWSVTyj9RvUsoBKzHVuw0mk72QUqfnHeHjb8B/dGFlc KiV4QEG/uKF0PRqtcTEyLL0/tNuTZI7jGRrO0H5q5aFkk/zwDvrAWepp7YTF1bzQBTQ2 Bxpj2RAybDsop76y1pZaJ5eVXFVd/ODjMqguI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=HtRTc6K3YHre9Kf3JwwMHj9MOF4XLmspDqfrKFB92yk=; b=tgWSUFe2/wERRKzV9Jd6Yoyvo6F0VY4l/Oz4YOQ1cnamar1XfXV5BFWDSRGYQrVW1e vBqyMBJPRKtrQRF1tddsSI4SmZyVXyfyDwTHcHx7juPGEkwoWYIT7pIGbwE9QU5EQBRQ bQCkMYJtb1Xe9aCs0Ygs0MzuNq3pwjLdn1sLOqO9F3cDzcI0Uzow3LVjwHanZ7OP2uLz XckVd51YljmJhZOlP0HppD6eGBzxOZlTvnXJTuR4dsBx/vnLRGL34sV3eRxOlX/8VoVk Kcb3OWqw1CnWA3wR0qmkTEyW3ikv5lUGJtmVTT/Xv9BT8AtG5a3eJ1cg+zJ52AE0/C6P Phdw== X-Gm-Message-State: AOUpUlGtoEGqq4DJDDr2YtvTKgU+SMOInQca7+1No9P8sN2fZ1+S3ah5 ko4PVK45sBo8+FJoPmsysEBf6rQF4URSbw== X-Received: by 2002:a62:67c2:: with SMTP id t63-v6mr47765603pfj.204.1534761099917; Mon, 20 Aug 2018 03:31:39 -0700 (PDT) Received: from localhost.localdomain ([64.64.108.180]) by smtp.gmail.com with ESMTPSA id e73-v6sm17581027pfb.153.2018.08.20.03.31.37 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 20 Aug 2018 03:31:39 -0700 (PDT) From: Haojian Zhuang To: edk2-devel@lists.01.org Date: Mon, 20 Aug 2018 18:31:24 +0800 Message-Id: <1534761085-26972-2-git-send-email-haojian.zhuang@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1534761085-26972-1-git-send-email-haojian.zhuang@linaro.org> References: <1534761085-26972-1-git-send-email-haojian.zhuang@linaro.org> Subject: [edk2] [PATCH v1 1/2] EmbeddedPkg: add DwUsb protocol X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" The protocol defines the callbacks that could be implemented in platform driver. DwUsb device driver needs these callbacks to implement USB device functionality. Cc: Leif Lindholm Cc: Ard Biesheuvel Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Haojian Zhuang --- EmbeddedPkg/Include/Protocol/DwUsb.h | 81 ++++++++++++++++++++ 1 file changed, 81 insertions(+) -- 2.7.4 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel diff --git a/EmbeddedPkg/Include/Protocol/DwUsb.h b/EmbeddedPkg/Include/Protocol/DwUsb.h new file mode 100644 index 000000000000..b9fb776f9258 --- /dev/null +++ b/EmbeddedPkg/Include/Protocol/DwUsb.h @@ -0,0 +1,81 @@ +/** @file + + Copyright (c) 2018, Linaro. All rights reserved. + + This program and the accompanying materials are licensed and made available + under the terms and conditions of the BSD License which accompanies this + distribution. The full text of the license may be found at + http://opensource.org/licenses/bsd-license.php + + THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, + WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. + +**/ + +#ifndef __DW_USB_H__ +#define __DW_USB_H__ + +// +// Protocol GUID +// +#define DW_USB_PROTOCOL_GUID { 0x109fa264, 0x7811, 0x4862, { 0xa9, 0x73, 0x4a, 0xb2, 0xef, 0x2e, 0xe2, 0xff }} + +// +// Protocol interface structure +// +typedef struct _DW_USB_PROTOCOL DW_USB_PROTOCOL; + +#define USB_HOST_MODE 0 +#define USB_DEVICE_MODE 1 +#define USB_CABLE_NOT_ATTACHED 2 + +#define LANG_LENGTH 8 +#define MANU_FACTURER_STRING_LENGTH 32 +#define PRODUCT_STRING_LENGTH 32 +#define SERIAL_STRING_LENGTH 17 + +typedef +EFI_STATUS +(EFIAPI *DW_USB_GET_LANG) ( + OUT CHAR16 *Lang, + OUT UINT8 *Length + ); + +typedef +EFI_STATUS +(EFIAPI *DW_USB_GET_MANU_FACTURER) ( + OUT CHAR16 *ManuFacturer, + OUT UINT8 *Length + ); + +typedef +EFI_STATUS +(EFIAPI *DW_USB_GET_PRODUCT) ( + OUT CHAR16 *Product, + OUT UINT8 *Length + ); + +typedef +EFI_STATUS +(EFIAPI *DW_USB_GET_SERIAL_NO) ( + OUT CHAR16 *SerialNo, + OUT UINT8 *Length + ); + +typedef +EFI_STATUS +(EFIAPI *DW_USB_PHY_INIT) ( + IN UINT8 Mode + ); + +struct _DW_USB_PROTOCOL { + DW_USB_GET_LANG GetLang; + DW_USB_GET_MANU_FACTURER GetManuFacturer; + DW_USB_GET_PRODUCT GetProduct; + DW_USB_GET_SERIAL_NO GetSerialNo; + DW_USB_PHY_INIT PhyInit; +}; + +extern EFI_GUID gDwUsbProtocolGuid; + +#endif /* __DW_USB_H__ */