From patchwork Wed Aug 15 07:36:50 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Haojian Zhuang X-Patchwork-Id: 144274 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp512420ljj; Wed, 15 Aug 2018 00:37:07 -0700 (PDT) X-Google-Smtp-Source: AA+uWPyTMa5ZMwGmz4DQHVube/z1YBz0von3LNWtSqRxo0/N7ffY3o8M1GP8p9BLj5IyPYigLc3u X-Received: by 2002:a17:902:4a0c:: with SMTP id w12-v6mr23547790pld.289.1534318627442; Wed, 15 Aug 2018 00:37:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1534318627; cv=none; d=google.com; s=arc-20160816; b=qBO81eNRSdyAZS/yjospkxbD8h0JVsGLJxBmUMAXPn7BF/QOMwMOvx8B7UgnWxLECo d8T09W5fSptH4YuLDyFq5Ce7DqAZjVQ7UThqI1yOnD7Ac9XHja7aeSQpd6CqXmALoovO fPTaWDGo6GHlbo3bfn+H01acdc3dE4UgkFozqPAjnispkKaRIgzITpsCOoEFVic0gnYR LIg9PczqYifuRlCzId4+agGCcNnObARjdGMfQ2BEDF3cliy+/1ay1KENideCD2m5RFK+ 0Ngs1fg27nvr4ZAny6bbj/9wxpVfrpIz0s/BrvpEtNmmJZqgG3tMBttzmBfCmXqF/N8/ I8mQ== 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=FbVGElPgaH8uY3DcAXuL6y3IQAH0bgkSZUhJ0XjXnOE=; b=UKmcVCnIMec2CbjTXQdez/H9+VzlzXOVcZpz/gKkeEqSLv+iYK/NOQT5BfnweJj7ji /KgvptekDBEW4Nbf0kwaQQu0kO1ZDutWWgZggT2AvNWa+BFcuOwFFFtBVsx1z8/Apf+x XjxRbM2IM8IS6xDR4F7IcMmFTHParMSCnxeKV6nuZLaeo1dUNK6/CR2+1drytI8Ej9Ez /msKvWM5i8QzYUoTKTEICV3I/wDkBNmuwhIOPAHf9/Bfitg8mzTe0bjAjNJSs6xhd4Wi kuiirPRkfYahr95tbgUMhhqf/Ysn6JwXkCBkqZlBTYn/oqw/QYAR7VMdcAVwDwkVwUHP b65w== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=UML8LERB; spf=pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 198.145.21.10 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. [198.145.21.10]) by mx.google.com with ESMTPS id m13-v6si22675005pgh.360.2018.08.15.00.37.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 15 Aug 2018 00:37:07 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 198.145.21.10 as permitted sender) client-ip=198.145.21.10; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=UML8LERB; spf=pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 198.145.21.10 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 0DCD9210F2004; Wed, 15 Aug 2018 00:37:07 -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::544; helo=mail-pg1-x544.google.com; envelope-from=haojian.zhuang@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-pg1-x544.google.com (mail-pg1-x544.google.com [IPv6:2607:f8b0:4864:20::544]) (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 912B7210F2004 for ; Wed, 15 Aug 2018 00:37:05 -0700 (PDT) Received: by mail-pg1-x544.google.com with SMTP id k3-v6so199174pgq.5 for ; Wed, 15 Aug 2018 00:37:05 -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=XxfJqDcj6l7mWeF1WZj5np0GK8tqQ4QA/V+YPwhl7VE=; b=UML8LERB8/Y5Fgy3y++qFMl2Vv/7fye91F7RIG5SuWin9ODNty3MVqGu5f/akUywNS fJebJZrTrEqDQioRbldu+wWanHHSq0Hdvxn/RADdoYGxfetWPMHCWIDoeYB8Ea9fY8yJ lNnHQTMD4ozHfUYE1WejlHNtqnlYoih9mDjQs= 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=XxfJqDcj6l7mWeF1WZj5np0GK8tqQ4QA/V+YPwhl7VE=; b=Z2TtBqpyo1Y2EL7ez/na6IZebsI4Ow1bXzowN7Y650Zsesg/e21ILq8ulxDwz56go8 KZvl4qvDfDu7pgBaPARvgFscWfvbaSuz+FIR6DmDjeD+jvaHFBP6Gi5QauQgxlTIQRnW fNh0zlvmRo6koE6tOps9v47cd81cpfztshJiJEwZNi4QdMC2nvi2AM+5R0gxTthdIjOs vqoXjttZiNnjPdA8u27MubnvGzQo4RC8XcO4YtqHPpE9yZiLOYhYme7U1nddgA6oSEP7 csoWqjfB3KLqKmZ6P/Wxal4qhi6V4Ficn1qncH2fOPtCzTPxid9Dq2kcQ1FwKrQC2by1 7t1g== X-Gm-Message-State: AOUpUlFtqR7ZA2GQVNcYcOkxpqRKp+NL3ZkSmdI1KokXwIeqxIk5MN1x jLfv3cATpG+5emRrYVo10jFhWnEV6lVGPA== X-Received: by 2002:a63:e255:: with SMTP id y21-v6mr24019929pgj.160.1534318624997; Wed, 15 Aug 2018 00:37:04 -0700 (PDT) Received: from localhost.localdomain ([64.64.108.254]) by smtp.gmail.com with ESMTPSA id w2-v6sm22786177pge.44.2018.08.15.00.37.02 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 15 Aug 2018 00:37:04 -0700 (PDT) From: Haojian Zhuang To: edk2-devel@lists.01.org Date: Wed, 15 Aug 2018 15:36:50 +0800 Message-Id: <1534318611-11461-3-git-send-email-haojian.zhuang@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1534318611-11461-1-git-send-email-haojian.zhuang@linaro.org> References: <1534318611-11461-1-git-send-email-haojian.zhuang@linaro.org> Subject: [edk2] [PATCH v2 2/3] EmbeddedPkg: add PlatformDwMmc protocol X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.27 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" Add PlatformDwMmc protocol. It's used to set properties of DwMmc device in platform driver. Cc: Leif Lindholm Cc: Ard Biesheuvel Cc: Chris Co Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Haojian Zhuang --- EmbeddedPkg/Include/Protocol/PlatformDwMmc.h | 79 ++++++++++++++++++++ 1 file changed, 79 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/PlatformDwMmc.h b/EmbeddedPkg/Include/Protocol/PlatformDwMmc.h new file mode 100644 index 000000000000..54a44928a7e1 --- /dev/null +++ b/EmbeddedPkg/Include/Protocol/PlatformDwMmc.h @@ -0,0 +1,79 @@ +/** @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 __PLATFORM_DW_MMC_H__ +#define __PLATFORM_DW_MMC_H__ + +typedef enum { + RemovableSlot, + EmbeddedSlot, + SharedBusSlot, + UnknownSlot +} EFI_SD_MMC_SLOT_TYPE; + +typedef enum { + UnknownCardType, + SdCardType, + SdioCardType, + MmcCardType, + EmmcCardType +} SD_MMC_CARD_TYPE; + +typedef struct { + UINT32 DefaultSpeed:1; // bit 0 + UINT32 HighSpeed:1; // bit 1 + UINT32 Sdr12:1; // bit 2 + UINT32 Sdr25:1; // bit 3 + UINT32 Sdr50:1; // bit 4 + UINT32 Sdr104:1; // bit 5 + UINT32 Ddr50:1; // bit 6 + UINT32 SysBus64:1; // bit 7 + UINT32 BusWidth:4; // bit 11:8 + UINT32 SlotType:2; // bit 13:12 + UINT32 CardType:3; // bit 16:14 + UINT32 Voltage18:1; // bit 17 + UINT32 Voltage30:1; // bit 18 + UINT32 Voltage33:1; // bit 19 + UINT32 BaseClkFreq; + EFI_HANDLE Controller; +} DW_MMC_HC_SLOT_CAP; + +// +// Protocol interface structure +// +typedef struct _PLATFORM_DW_MMC_PROTOCOL PLATFORM_DW_MMC_PROTOCOL; + +typedef +EFI_STATUS +(EFIAPI *PLATFORM_DW_MMC_GET_CAPABILITY) ( + IN EFI_HANDLE Controller, + IN UINT8 Slot, + OUT DW_MMC_HC_SLOT_CAP *Capability + ); + +typedef +BOOLEAN +(EFIAPI *PLATFORM_DW_MMC_CARD_DETECT) ( + IN EFI_HANDLE Controller, + IN UINT8 Slot + ); + +struct _PLATFORM_DW_MMC_PROTOCOL { + PLATFORM_DW_MMC_GET_CAPABILITY GetCapability; + PLATFORM_DW_MMC_CARD_DETECT CardDetect; +}; + +extern EFI_GUID gPlatformDwMmcProtocolGuid; + +#endif /* __PLATFORM_DW_MMC_H__ */