From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2a00:1450:400c:c09::243; helo=mail-wm0-x243.google.com; envelope-from=leif.lindholm@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-wm0-x243.google.com (mail-wm0-x243.google.com [IPv6:2a00:1450:400c:c09::243]) (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 00DF520957B1E for ; Wed, 2 May 2018 08:24:04 -0700 (PDT) Received: by mail-wm0-x243.google.com with SMTP id n10so25040549wmc.1 for ; Wed, 02 May 2018 08:24:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=bdXSk3euKhWt7+xvEZ7MghDZbV+ecMvqP9wu0aqLqEU=; b=JZIboVC6O7fTSlcBPWT4tffRuM//Uo5PRAGWl85aIJTD/u1t/ju0Ogh2sq1HS+Cxgc 1a7TQl4sD6qmICV2MN4/pRQy1PRLo27jwa+/D0+PJAHTpX0BrD9LNPjC9Ic7IKsGEnmA xm6xzTocOO1cjMeShzzFOin/XV9ViLuF3+J8I= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=bdXSk3euKhWt7+xvEZ7MghDZbV+ecMvqP9wu0aqLqEU=; b=imM4G0/D+3A2Whcoo9fRRuAD7KaUmw2LgrLRzapQDzmjOOK+f/Qps+VAIcsSsA773Y TVbPcYqPDxdjfeAEqIfO2W2j88xGfssujDcdctpxAxZNsOBrST/j2HKcjzz7Cp5hGmqX 6tNwaat5r3Wn87tUq0ft+FOLzCqS+JTr4FT6C0Ap1MNwdzMvMati8jGAIFfDEVrEse+m q7GW+7i1M9sXF9dIUJclI57H+36p5tT5SDajsAeMmb4o31zI7tSOi69R89lg/lwe1fgo Cjc0prz9id7tivnl1OMWQBU3bDFb1UqMR/8TpBUo3VjGbh/+fvRmWyNF4AorfBTV8TaA DtRQ== X-Gm-Message-State: ALQs6tD8uIdIqepFuQi6SpRlRm+0fca5WvH2xfA8LpJjw3fZegXZ3nOm MQgapUYEhIFxAthOEGqM0HpPmA== X-Google-Smtp-Source: AB8JxZobeZVizIOsq8zL31SWl+5htwt6lWYgRGJkuPdBsqBQ57Vy9ItiFh6DzzuD9BmmYf0a1xgX4w== X-Received: by 10.28.52.73 with SMTP id b70mr9838774wma.42.1525274643337; Wed, 02 May 2018 08:24:03 -0700 (PDT) Received: from bivouac.eciton.net (bivouac.eciton.net. [2a00:1098:0:86:1000:23:0:2]) by smtp.gmail.com with ESMTPSA id q81sm14723357wmg.8.2018.05.02.08.24.01 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 02 May 2018 08:24:02 -0700 (PDT) Date: Wed, 2 May 2018 16:24:00 +0100 From: Leif Lindholm To: Haojian Zhuang Cc: edk2-devel@lists.01.org, Ard Biesheuvel Message-ID: <20180502152400.ccccjsglj4jodj5d@bivouac.eciton.net> References: <1520515828-29629-1-git-send-email-haojian.zhuang@linaro.org> MIME-Version: 1.0 In-Reply-To: <1520515828-29629-1-git-send-email-haojian.zhuang@linaro.org> User-Agent: NeoMutt/20170113 (1.7.2) Subject: Re: [PATCH v2 edk-platforms 3/4] Platform/Hisilicon/HiKey: add gpio platform driver X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 May 2018 15:24:05 -0000 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline (Reviewing near-identical patches out of order.) On Thu, Mar 08, 2018 at 09:30:28PM +0800, Haojian Zhuang wrote: > Add gpio platform driver to enable GPIO in HiKey platform. > > Cc: Leif Lindholm > Cc: Ard Biesheuvel > Contributed-under: TianoCore Contribution Agreement 1.1 > Signed-off-by: Haojian Zhuang > --- > Platform/Hisilicon/HiKey/HiKeyGpioDxe/HiKeyGpioDxe.inf | 36 +++++++++++ > Platform/Hisilicon/HiKey/HiKeyGpioDxe/HiKeyGpioDxe.c | 68 ++++++++++++++++++++ > 2 files changed, 104 insertions(+) > > diff --git a/Platform/Hisilicon/HiKey/HiKeyGpioDxe/HiKeyGpioDxe.inf b/Platform/Hisilicon/HiKey/HiKeyGpioDxe/HiKeyGpioDxe.inf > new file mode 100644 > index 000000000000..272ed1c0cea2 > --- /dev/null > +++ b/Platform/Hisilicon/HiKey/HiKeyGpioDxe/HiKeyGpioDxe.inf > @@ -0,0 +1,36 @@ > +# > +# 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. > +# > + > +[Defines] > + INF_VERSION = 0x00010019 0x0001001a? > + BASE_NAME = HiKeyGpio > + FILE_GUID = b51a851c-7bf7-463f-b261-cfb158b7f699 > + MODULE_TYPE = DXE_DRIVER > + VERSION_STRING = 1.0 > + ENTRY_POINT = HiKeyGpioEntryPoint > + > +[Sources.common] > + HiKeyGpioDxe.c > + > +[Packages] > + EmbeddedPkg/EmbeddedPkg.dec > + MdePkg/MdePkg.dec > + > +[LibraryClasses] > + DebugLib > + UefiDriverEntryPoint > + > +[Protocols] > + gPlatformGpioProtocolGuid > + > +[Depex] > + TRUE > diff --git a/Platform/Hisilicon/HiKey/HiKeyGpioDxe/HiKeyGpioDxe.c b/Platform/Hisilicon/HiKey/HiKeyGpioDxe/HiKeyGpioDxe.c > new file mode 100644 > index 000000000000..543f65d7b12d > --- /dev/null > +++ b/Platform/Hisilicon/HiKey/HiKeyGpioDxe/HiKeyGpioDxe.c > @@ -0,0 +1,68 @@ > +/** @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. > +* > +**/ > + > +#include > + > +#include > + Add similar comment as I asked for in 1/4? > +GPIO_CONTROLLER gGpioDevice[]= { Missing space before '='. > + { 0xf8011000, 0, 8 }, // GPIO0 > + { 0xf8012000, 8, 8 }, // GPIO1 > + { 0xf8013000, 16, 8 }, // GPIO2 > + { 0xf8014000, 24, 8 }, // GPIO3 > + { 0xf7020000, 32, 8 }, // GPIO4 > + { 0xf7021000, 40, 8 }, // GPIO5 > + { 0xf7022000, 48, 8 }, // GPIO6 > + { 0xf7023000, 56, 8 }, // GPIO7 > + { 0xf7024000, 64, 8 }, // GPIO8 > + { 0xf7025000, 72, 8 }, // GPIO9 > + { 0xf7026000, 80, 8 }, // GPIO10 > + { 0xf7027000, 88, 8 }, // GPIO11 > + { 0xf7028000, 96, 8 }, // GPIO12 > + { 0xf7029000, 104, 8 }, // GPIO13 > + { 0xf702a000, 112, 8 }, // GPIO14 > + { 0xf702b000, 120, 8 }, // GPIO15 > + { 0xf702c000, 128, 8 }, // GPIO16 > + { 0xf702d000, 136, 8 }, // GPIO17 > + { 0xf702e000, 144, 8 }, // GPIO18 > + { 0xf702f000, 152, 8 } // GPIO19 > +}; > + Add similar comment as I asked for in 1/4? > +PLATFORM_GPIO_CONTROLLER gPlatformGpioDevice = { > + 160, 20, gGpioDevice > +}; > + > +EFI_STATUS > +EFIAPI > +HiKeyGpioEntryPoint ( > + IN EFI_HANDLE ImageHandle, > + IN EFI_SYSTEM_TABLE *SystemTable > + ) > +{ > + EFI_STATUS Status; > + EFI_HANDLE Handle; > + > + // Install the Embedded Platform GPIO Protocol onto a new handle > + Handle = NULL; > + Status = gBS->InstallMultipleProtocolInterfaces( > + &Handle, > + &gPlatformGpioProtocolGuid, &gPlatformGpioDevice, > + NULL > + ); > + if (EFI_ERROR(Status)) { > + Status = EFI_OUT_OF_RESOURCES; So, I didn't comment on this for 1/4, but ... Why modify Status? / Leif > + } > + > + return Status; > +} > -- > 2.7.4 >