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=hlYb+5JS; spf=none, err=SPF record not found (domain: semihalf.com, ip: 209.85.208.193, mailfrom: mw@semihalf.com) Received: from mail-lj1-f193.google.com (mail-lj1-f193.google.com [209.85.208.193]) by groups.io with SMTP; Mon, 20 May 2019 08:27:52 -0700 Received: by mail-lj1-f193.google.com with SMTP id r76so12833168lja.12 for ; Mon, 20 May 2019 08:27:52 -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=yBZT8x0Vw/kYuvLfH3huBn0pQYjBGE7mOdrDpw10vTs=; b=hlYb+5JSG3JRkha44gNe+FN/c5GTKCl2TT1zYNORMnhi55ixgkzC/+VQZjOPi6EiIP mPlhB7hsThoYGMLu8jNIknUCp2qGddpo2jTsUiNqKPkE0O4fCkBD8Y6HvuKINjteDrZo 1LCui8MVF1k48Vmqitwecp3PA3o33VmH/x2zM+WIu8ToDtWyknjkRYSMOs4b9zZ6nocT dSwYkW2x3SL7aGQxSzZakxNIQewZ3zoNwjNWlzku4tQtIPWp4OsM838URFmMStRabsUG eplTXrQTyXMGSNomnqXgb/HoTepiUvaMnwsBxqUUT5zOe75oyoN0m0bW2LI8AMIHrGmt hz8A== 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=yBZT8x0Vw/kYuvLfH3huBn0pQYjBGE7mOdrDpw10vTs=; b=swPFM9/43XkniI6ABweE4P0Tsa/vxbYjUNK6Q4nOfc1uvsW7Mm51hgsA5HoYROHn/G U9okN4bQ/lbGV9mcaR/XmGUz8j5P6WBRhgd85rOh432s2/8u1+SwMwZ3+uFVWaiRk1fT F2wDxWOYEGBWou9PG4IX1/6uliYgvhMHXSKKtpeY6z4zrde3Or7+eMuehYUpj3L9pTwz 9D9NQmUWMWBex0Twr+vSjCyfntowa2DciyQPqIgVNOmcJgf6/Lzow1jTLw73tTdN4Qo9 ntoWUIAISmnu1JnU8viIWXakUcLLcWQwkr4Wehv0IOWzOFQZaNQJJvCHoPP2IcyrjjcX aAKg== X-Gm-Message-State: APjAAAU6imWlfA1NNjYK8U0Pm9dhtdB9a210exu7k3/TAXsvIsNOyW2+ EgPsmyHQrbZNmCHyOhIJ11mLsCSrQ7A= X-Google-Smtp-Source: APXvYqyG82IBLYjnjAdwd/07ik96WQVABlcRlIKbZoSz3a8sDqrM3Ue3ZSwd65EajiZAxJwxYeMRIA== X-Received: by 2002:a2e:9b0b:: with SMTP id u11mr23582074lji.57.1558366070314; Mon, 20 May 2019 08:27:50 -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 d5sm3906205lji.85.2019.05.20.08.27.48 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 20 May 2019 08:27:49 -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 v2 01/14] Marvell/Library: MvGpioLib: Extend GPIO pin description Date: Mon, 20 May 2019 17:27:14 +0200 Message-Id: <1558366047-15994-2-git-send-email-mw@semihalf.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1558366047-15994-1-git-send-email-mw@semihalf.com> References: <1558366047-15994-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 6ca9e79..35d979d 100644 --- a/Silicon/Marvell/Include/Library/MvGpioLib.h +++ b/Silicon/Marvell/Include/Library/MvGpioLib.h @@ -47,6 +47,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 554155e..92a14bb 100644 --- a/Platform/Marvell/Armada70x0Db/NonDiscoverableInitLib/NonDiscoverableInitLib.c +++ b/Platform/Marvell/Armada70x0Db/NonDiscoverableInitLib/NonDiscoverableInitLib.c @@ -23,21 +23,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 804339f..cde73dd 100644 --- a/Platform/Marvell/Armada80x0Db/NonDiscoverableInitLib/NonDiscoverableInitLib.c +++ b/Platform/Marvell/Armada80x0Db/NonDiscoverableInitLib/NonDiscoverableInitLib.c @@ -23,31 +23,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 c9e8872..f4e7246 100644 --- a/Platform/SolidRun/Armada80x0McBin/NonDiscoverableInitLib/NonDiscoverableInitLib.c +++ b/Platform/SolidRun/Armada80x0McBin/NonDiscoverableInitLib/NonDiscoverableInitLib.c @@ -22,6 +22,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