From patchwork Tue Aug 18 09:04:51 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Haojian Zhuang X-Patchwork-Id: 52490 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f199.google.com (mail-wi0-f199.google.com [209.85.212.199]) by patches.linaro.org (Postfix) with ESMTPS id 59BA422DB1 for ; Tue, 18 Aug 2015 09:05:13 +0000 (UTC) Received: by wijp15 with SMTP id p15sf33535018wij.3 for ; Tue, 18 Aug 2015 02:05:12 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:date:message-id:subject :precedence:list-id:list-unsubscribe:list-archive:list-post :list-help:list-subscribe:mime-version:content-type :content-transfer-encoding:errors-to:x-original-sender :x-original-authentication-results:mailing-list; bh=h4tfLq1Q1dzKE1Lg+5+RnxSpM3rgz0o4lYMdVvGyMJ0=; b=ZVf/GOaoMcY3XQReXcPiJRmbQCRDqU/oPTeRMnCcsYLmbBmtZD8SF9K6shZUK89i2f wdHxQ1+iyOwAwed/lbqeAp9PF/c4L4hwHy6Adv1uapghboSKQELHI3bbpRzU3Qn2rRb9 HtI2kYEglPl7EfTi3q5YfgP/2x4SqNvroQcHywHFP6iDUnIsB0jfQZ+i23gI0GBVRj2s dgw4IkilWOrMr4F9hvjx9pdKi/xGWj6bGSUqtoMSKofubUH8IrO6YRwYOrbjNVuJXUsa JAi2uV7oioLo7ToacEWJfOTNZ4sjtjm0TLd/DXSQXdCbR8F0ZnKloyngqr5xIQMkkKtT p23A== X-Gm-Message-State: ALoCoQlyv0SmBTxSngAtoEdqyprYu/oXw+VlghiEBDLest+z+tpLvj6EdzZhhlwVLC3+npfOaTPe X-Received: by 10.112.90.225 with SMTP id bz1mr1516003lbb.12.1439888712654; Tue, 18 Aug 2015 02:05:12 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.5.105 with SMTP id r9ls701572lar.15.gmail; Tue, 18 Aug 2015 02:05:12 -0700 (PDT) X-Received: by 10.152.29.200 with SMTP id m8mr5290869lah.44.1439888712390; Tue, 18 Aug 2015 02:05:12 -0700 (PDT) Received: from mail-la0-f50.google.com (mail-la0-f50.google.com. [209.85.215.50]) by mx.google.com with ESMTPS id 4si13627475laz.170.2015.08.18.02.05.11 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 18 Aug 2015 02:05:11 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.50 as permitted sender) client-ip=209.85.215.50; Received: by lahi9 with SMTP id i9so94732783lah.2 for ; Tue, 18 Aug 2015 02:05:11 -0700 (PDT) X-Received: by 10.112.67.65 with SMTP id l1mr5329656lbt.86.1439888711780; Tue, 18 Aug 2015 02:05:11 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.162.200 with SMTP id yc8csp347936lbb; Tue, 18 Aug 2015 02:05:10 -0700 (PDT) X-Received: by 10.107.154.199 with SMTP id c190mr5758433ioe.154.1439888710119; Tue, 18 Aug 2015 02:05:10 -0700 (PDT) Received: from lists.sourceforge.net (lists.sourceforge.net. [216.34.181.88]) by mx.google.com with ESMTPS id jc9si6686998igb.70.2015.08.18.02.05.09 (version=TLSv1 cipher=RC4-SHA bits=128/128); Tue, 18 Aug 2015 02:05:10 -0700 (PDT) Received-SPF: pass (google.com: domain of edk2-devel-bounces@lists.sourceforge.net designates 216.34.181.88 as permitted sender) client-ip=216.34.181.88; Received: from localhost ([127.0.0.1] helo=sfs-ml-3.v29.ch3.sourceforge.com) by sfs-ml-3.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1ZRcpG-000543-Az; Tue, 18 Aug 2015 09:04:58 +0000 Received: from sog-mx-2.v43.ch3.sourceforge.com ([172.29.43.192] helo=mx.sourceforge.net) by sfs-ml-3.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1ZRcp9-00053C-9a for edk2-devel@lists.sourceforge.net; Tue, 18 Aug 2015 09:04:51 +0000 Received-SPF: pass (sog-mx-2.v43.ch3.sourceforge.com: domain of linaro.org designates 209.85.192.169 as permitted sender) client-ip=209.85.192.169; envelope-from=haojian.zhuang@linaro.org; helo=mail-pd0-f169.google.com; Received: from mail-pd0-f169.google.com ([209.85.192.169]) by sog-mx-2.v43.ch3.sourceforge.com with esmtps (TLSv1:RC4-SHA:128) (Exim 4.76) id 1ZRcp7-0002nP-HB for edk2-devel@lists.sourceforge.net; Tue, 18 Aug 2015 09:04:51 +0000 Received: by pdbfa8 with SMTP id fa8so65907494pdb.1 for ; Tue, 18 Aug 2015 02:04:44 -0700 (PDT) X-Received: by 10.70.130.5 with SMTP id oa5mr11397681pdb.55.1439888683918; Tue, 18 Aug 2015 02:04:43 -0700 (PDT) Received: from debian.mars ([199.101.119.141]) by smtp.gmail.com with ESMTPSA id jr12sm17266725pbb.91.2015.08.18.02.04.41 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 18 Aug 2015 02:04:43 -0700 (PDT) From: Haojian Zhuang To: ard.biesheuvel@linaro.org, edk2-devel@lists.sourceforge.net, ryan.harkin@linaro.org, leif.lindholm@linaro.org, edk2-devel@lists.01.org Date: Tue, 18 Aug 2015 17:04:51 +0800 Message-Id: <1439888692-2304-1-git-send-email-haojian.zhuang@linaro.org> X-Mailer: git-send-email 2.1.4 X-Spam-Score: 1.0 (+) X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. See http://spamassassin.org/tag/ for more details. -1.5 SPF_CHECK_PASS SPF reports sender host as permitted sender for sender-domain -0.0 SPF_PASS SPF: sender matches SPF record 2.5 SUSPICIOUS_RECIPS Similar addresses in recipient list X-Headers-End: 1ZRcp7-0002nP-HB Subject: [edk2] [PATCH 2/3] EmbeddedPkg: enhance for multiple gpio controllers X-BeenThere: edk2-devel@lists.sourceforge.net X-Mailman-Version: 2.1.9 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , MIME-Version: 1.0 Errors-To: edk2-devel-bounces@lists.sourceforge.net X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: haojian.zhuang@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.215.50 as permitted sender) smtp.mailfrom=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 EmbeddedGpio only supports one gpio controller in one platform. Now create PLATFORM_GPIO_CONTROLLER to support multiple gpio controllers in one platform. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Haojian Zhuang --- EmbeddedPkg/EmbeddedPkg.dec | 1 + EmbeddedPkg/Include/Protocol/EmbeddedGpio.h | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+) diff --git a/EmbeddedPkg/EmbeddedPkg.dec b/EmbeddedPkg/EmbeddedPkg.dec index 4bac580..bd3e301 100644 --- a/EmbeddedPkg/EmbeddedPkg.dec +++ b/EmbeddedPkg/EmbeddedPkg.dec @@ -65,6 +65,7 @@ gAndroidFastbootTransportProtocolGuid = { 0x74bd9fe0, 0x8902, 0x11e3, {0xb9, 0xd3, 0xf7, 0x22, 0x38, 0xfc, 0x9a, 0x31}} gAndroidFastbootPlatformProtocolGuid = { 0x524685a0, 0x89a0, 0x11e3, {0x9d, 0x4d, 0xbf, 0xa9, 0xf6, 0xa4, 0x03, 0x08}} gUsbDeviceProtocolGuid = { 0x021bd2ca, 0x51d2, 0x11e3, {0x8e, 0x56, 0xb7, 0x54, 0x17, 0xc7, 0x0b, 0x44 }} + gPlatformGpioProtocolGuid = { 0x52ce9845, 0x5af4, 0x43e2, {0xba, 0xfd, 0x23, 0x08, 0x12, 0x54, 0x7a, 0xc2 }} [PcdsFeatureFlag.common] gEmbeddedTokenSpaceGuid.PcdEmbeddedMacBoot|FALSE|BOOLEAN|0x00000001 diff --git a/EmbeddedPkg/Include/Protocol/EmbeddedGpio.h b/EmbeddedPkg/Include/Protocol/EmbeddedGpio.h index 4e7c8db..c1a86c1 100644 --- a/EmbeddedPkg/Include/Protocol/EmbeddedGpio.h +++ b/EmbeddedPkg/Include/Protocol/EmbeddedGpio.h @@ -164,4 +164,22 @@ struct _EMBEDDED_GPIO { extern EFI_GUID gEmbeddedGpioProtocolGuid; +typedef struct _GPIO_CONTROLLER GPIO_CONTROLLER; +typedef struct _PLATFORM_GPIO_CONTROLLER PLATFORM_GPIO_CONTROLLER; + +struct _GPIO_CONTROLLER { + UINTN RegisterBase; + UINTN GpioIndex; + UINTN InternalGpioCount; +}; + +struct _PLATFORM_GPIO_CONTROLLER { + UINTN GpioCount; + UINTN GpioControllerCount; + UINTN GpioControllerSize; + GPIO_CONTROLLER *GpioController; +}; + +extern EFI_GUID gPlatformGpioProtocolGuid; + #endif