From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: mx.groups.io; dkim=pass header.i=@semihalf-com.20150623.gappssmtp.com header.s=20150623 header.b=qW82wmCi; spf=none, err=SPF record not found (domain: semihalf.com, ip: 209.85.167.68, mailfrom: mw@semihalf.com) Received: from mail-lf1-f68.google.com (mail-lf1-f68.google.com [209.85.167.68]) by groups.io with SMTP; Thu, 09 May 2019 02:53:59 -0700 Received: by mail-lf1-f68.google.com with SMTP id n22so1070625lfe.12 for ; Thu, 09 May 2019 02:53:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=semihalf-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=L14jOc661ce+2n/GCBw5mdFhHPpKoElb9rLhOSq26Fk=; b=qW82wmCilKjL6TSkG5+P/Lu+vN6srZ7P4O1TIKpInwLjL+8QPUYi8pzns3mxLIY1LM zd9eut0pyhm/x9mba+fcOvpXQ0CpKuuP1TbIyg5eY62qqO9WNUPZLMF9gziESyPO1q0m USwP/RsF6CAYka5c1XgWxvxsw5flPh5K5DD1l8/L3sQe4tm/0ZsdWfUmG7uiRjJDwyFD UOgLO8fiRao6Q0YjA0jqZme802I3uFbBG3pvFJ7qm3m0fX0DYVrS8y53Cz58LzoyNwt+ ykoj/9Cj7Qv/1RJuDWIoP2R6BG+qeNQjH5m08q0hc6uMBG5TEdMqMuOqN2Qx5Mbl5g/b 4qUw== 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=L14jOc661ce+2n/GCBw5mdFhHPpKoElb9rLhOSq26Fk=; b=ryruw04cFrLAiolRBmVJdQx95IQzSpBfoTdnRt0Ryubafmlbyr0vLKbzm7PT1A0k3U EBYsvlEFlARvPqShaQJcAOQQ41AQi7ytD/UaEO1TsNI13gTMY/w0mprqWrY4PBzHM27u O89ARJapmrjsgg5LWOSxphZ9gHJym1QSaMKCZy/LRNA19+nfUP59vmJnipkP5cvLu++O GGPfX0Kj9lU7PzRIh4BqMCe+NnVy5XUFoZCeRn+uOYvLzQjfWKzx04OoH64z0QQiNlh/ mgmsaRAs0w4Fw8l5tiMhZh276J1L1r785uh6VSuEtxWWuHooiNQ/wITxNbIcusYf54DL mKZw== X-Gm-Message-State: APjAAAXs1z6uX0H3rmiJl/E+blGR/Ag3XARsY8orFkngxfxvcfFFNYOB KFlsMkhdQLSv5nWz90fHgRJ1ZmjHo30= X-Google-Smtp-Source: APXvYqwyEot2ioJLiYZBYd4tgH4XrbgCnQwWGEkxr1UeJ54kr9QV89gSiNsh0XbkmTnE6WVzw0Husg== X-Received: by 2002:ac2:538a:: with SMTP id g10mr1982349lfh.141.1557395636874; Thu, 09 May 2019 02:53:56 -0700 (PDT) Return-Path: Received: from gilgamesh.semihalf.com (31-172-191-173.noc.fibertech.net.pl. [31.172.191.173]) by smtp.gmail.com with ESMTPSA id l25sm276668lfk.57.2019.05.09.02.53.55 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 09 May 2019 02:53:56 -0700 (PDT) From: "Marcin Wojtas" To: devel@edk2.groups.io Cc: leif.lindholm@linaro.org, ard.biesheuvel@linaro.org, mw@semihalf.com, jsd@semihalf.com, jaz@semihalf.com, kostap@marvell.com, Jici.Gao@arm.com, rebecca@bluestop.org, kettenis@jive.eu Subject: [edk2-platforms: PATCH 01/14] Marvell/Library: MvGpioLib: Extend GPIO pin description Date: Thu, 9 May 2019 11:53:29 +0200 Message-Id: <1557395622-32425-2-git-send-email-mw@semihalf.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1557395622-32425-1-git-send-email-mw@semihalf.com> References: <1557395622-32425-1-git-send-email-mw@semihalf.com> In order to avoid hardcoding the controller type when using MV_GPIO_PIN, extend this structure with new according field. This patch is required to properly handle PCIE slot reset with the GPIO pin. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Marcin Wojtas --- Silicon/Marvell/Include/Library/MvGpioLib.h | 1 + Platform/Marvell/Armada70x0Db/NonDiscoverableInitLib/NonDiscoverableInitLib.c | 4 ++++ Platform/Marvell/Armada80x0Db/NonDiscoverableInitLib/NonDiscoverableInitLib.c | 6 ++++++ Platform/SolidRun/Armada80x0McBin/NonDiscoverableInitLib/NonDiscoverableInitLib.c | 1 + 4 files changed, 12 insertions(+) diff --git a/Silicon/Marvell/Include/Library/MvGpioLib.h b/Silicon/Marvell/Include/Library/MvGpioLib.h index a14acdf..2d5fa94 100644 --- a/Silicon/Marvell/Include/Library/MvGpioLib.h +++ b/Silicon/Marvell/Include/Library/MvGpioLib.h @@ -53,6 +53,7 @@ typedef struct { } MV_GPIO_DEVICE_PATH; typedef struct { + MV_GPIO_DRIVER_TYPE ControllerType; UINTN ControllerId; UINTN PinNumber; BOOLEAN ActiveHigh; diff --git a/Platform/Marvell/Armada70x0Db/NonDiscoverableInitLib/NonDiscoverableInitLib.c b/Platform/Marvell/Armada70x0Db/NonDiscoverableInitLib/NonDiscoverableInitLib.c index d8dba6e..62a57f7 100644 --- a/Platform/Marvell/Armada70x0Db/NonDiscoverableInitLib/NonDiscoverableInitLib.c +++ b/Platform/Marvell/Armada70x0Db/NonDiscoverableInitLib/NonDiscoverableInitLib.c @@ -29,21 +29,25 @@ STATIC CONST MV_GPIO_PIN mXhciVbusPins[] = { { + MV_GPIO_DRIVER_TYPE_PCA95XX, ARMADA_70x0_DB_IO_EXPANDER0, ARMADA_70x0_DB_VBUS0_PIN, TRUE, }, { + MV_GPIO_DRIVER_TYPE_PCA95XX, ARMADA_70x0_DB_IO_EXPANDER0, ARMADA_70x0_DB_VBUS0_LIMIT_PIN, TRUE, }, { + MV_GPIO_DRIVER_TYPE_PCA95XX, ARMADA_70x0_DB_IO_EXPANDER0, ARMADA_70x0_DB_VBUS1_PIN, TRUE, }, { + MV_GPIO_DRIVER_TYPE_PCA95XX, ARMADA_70x0_DB_IO_EXPANDER0, ARMADA_70x0_DB_VBUS1_LIMIT_PIN, TRUE, diff --git a/Platform/Marvell/Armada80x0Db/NonDiscoverableInitLib/NonDiscoverableInitLib.c b/Platform/Marvell/Armada80x0Db/NonDiscoverableInitLib/NonDiscoverableInitLib.c index e7a1d1e..1220163 100644 --- a/Platform/Marvell/Armada80x0Db/NonDiscoverableInitLib/NonDiscoverableInitLib.c +++ b/Platform/Marvell/Armada80x0Db/NonDiscoverableInitLib/NonDiscoverableInitLib.c @@ -29,31 +29,37 @@ STATIC CONST MV_GPIO_PIN mXhciVbusPins[] = { { + MV_GPIO_DRIVER_TYPE_PCA95XX, ARMADA_80x0_DB_IO_EXPANDER0, ARMADA_80x0_DB_VBUS0_PIN, TRUE, }, { + MV_GPIO_DRIVER_TYPE_PCA95XX, ARMADA_80x0_DB_IO_EXPANDER0, ARMADA_80x0_DB_VBUS0_LIMIT_PIN, TRUE, }, { + MV_GPIO_DRIVER_TYPE_PCA95XX, ARMADA_80x0_DB_IO_EXPANDER0, ARMADA_80x0_DB_VBUS1_PIN, TRUE, }, { + MV_GPIO_DRIVER_TYPE_PCA95XX, ARMADA_80x0_DB_IO_EXPANDER0, ARMADA_80x0_DB_VBUS1_LIMIT_PIN, TRUE, }, { + MV_GPIO_DRIVER_TYPE_PCA95XX, ARMADA_80x0_DB_IO_EXPANDER1, ARMADA_80x0_DB_VBUS2_PIN, TRUE, }, { + MV_GPIO_DRIVER_TYPE_PCA95XX, ARMADA_80x0_DB_IO_EXPANDER1, ARMADA_80x0_DB_VBUS2_LIMIT_PIN, TRUE, diff --git a/Platform/SolidRun/Armada80x0McBin/NonDiscoverableInitLib/NonDiscoverableInitLib.c b/Platform/SolidRun/Armada80x0McBin/NonDiscoverableInitLib/NonDiscoverableInitLib.c index d1055cb..08c383f 100644 --- a/Platform/SolidRun/Armada80x0McBin/NonDiscoverableInitLib/NonDiscoverableInitLib.c +++ b/Platform/SolidRun/Armada80x0McBin/NonDiscoverableInitLib/NonDiscoverableInitLib.c @@ -28,6 +28,7 @@ #include "NonDiscoverableInitLib.h" STATIC CONST MV_GPIO_PIN mXhciVbusPin = { + MV_GPIO_DRIVER_TYPE_SOC_CONTROLLER, MV_GPIO_CP0_CONTROLLER1, ARMADA_80x0_MCBIN_VBUS0_PIN, TRUE, -- 2.7.4