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=1ISKGSy+; spf=none, err=SPF record not found (domain: semihalf.com, ip: 209.85.167.65, mailfrom: mw@semihalf.com) Received: from mail-lf1-f65.google.com (mail-lf1-f65.google.com [209.85.167.65]) by groups.io with SMTP; Thu, 09 May 2019 02:54:03 -0700 Received: by mail-lf1-f65.google.com with SMTP id y19so1098947lfy.5 for ; Thu, 09 May 2019 02:54:02 -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=2aj8isfVDRHicsf2O3FbnatEb3H5yxobkowC1Kt2hV0=; b=1ISKGSy+AQ/VhtRZTEPdady0Z4knEhwLxy0u4iXmNpJE6bW3kRBhRya8srPirJ+cEV 3PwLGUVKT9FgQRGAO86Qqj6hiFppOcAEcHnKuyLOz6BItJXMdCcCIXR7dFj7s4F2fk71 uH1s1uaucIkaF5P7yrTGPIL73q7ANMHaSN2RPQIZUzpE/pVdnQez5wagzXgiwZAKu/DJ MxKfNYARCKh7cDRdDp5Dgc8egksQ5EwEm8kMeX/H93mOnFPj9DnGkysnr+CM60kDhHQi w4qvk2GvYCC0qDdWkdV0fOhn8LlqkbscoAmVPaAD6dylNyoANNlENQSjhbSsWyUGsCb3 6ieg== 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=2aj8isfVDRHicsf2O3FbnatEb3H5yxobkowC1Kt2hV0=; b=h863nEBZO51r2QF4xfZ6EcOuzqWmdnPUkR3jvr/XWBtDF7Vc75VfGgs7eZqkLIYh8p vLOB5vme+hA9+GDZGDyL7F9g/LbiKiEGybI0BvRJlr0YUhRf7Wxd5FJvFyAw3inlUOTG q4bz8aAyYQxexAcxJkWFRt9xdaESMexqawPt8pAW4SCqRT5MI7NboyxFrVDhEVMQUXV+ hq7yMeIYr+3+NyklFdiXWmbI4Z+wHmjkGH/c5SgZPYnOzME/eH3gA4+d319FOZ97S8R5 ICSuPYZGfCi9U0pUyW37Q6Qs1IW+2tfK9wXaWYq62ETgJCRklhRIZzfcLdM6sQ+cH11t DtwQ== X-Gm-Message-State: APjAAAVRDuuJwNHf09+dFh7+FCRQKd0uTT6JvzVkrPpIc+Zd/mWh0sOO htmTouZ6EIo7//CG9/LMnVy83RoQunM= X-Google-Smtp-Source: APXvYqxYMmt8o4WnaSl0OkWSI+7EpE18m0QiVOmZr1BOX0g8roAT9iTe+75JfKJBYs6o9VGTBm16ig== X-Received: by 2002:a19:c194:: with SMTP id r142mr1987093lff.41.1557395640550; Thu, 09 May 2019 02:54:00 -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.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 09 May 2019 02:53:59 -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 04/14] Marvell/Armada7k8k: Extend board description libraries with PCIE Date: Thu, 9 May 2019 11:53:32 +0200 Message-Id: <1557395622-32425-5-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> This patch extends ArmadaBoardDescLib libraries for all existing Armada7k8k-based platforms with PCIE. It introduces ArmadaBoardPcieControllerGet routine with per-board PCIE controllers description. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Marcin Wojtas --- Platform/Marvell/Armada70x0Db/Armada70x0DbBoardDescLib/Armada70x0DbBoardDescLib.c | 48 ++++++++++++++++++++ Platform/Marvell/Armada80x0Db/Armada80x0DbBoardDescLib/Armada80x0DbBoardDescLib.c | 48 ++++++++++++++++++++ Platform/SolidRun/Armada80x0McBin/Armada80x0McBinBoardDescLib/Armada80x0McBinBoardDescLib.c | 48 ++++++++++++++++++++ 3 files changed, 144 insertions(+) diff --git a/Platform/Marvell/Armada70x0Db/Armada70x0DbBoardDescLib/Armada70x0DbBoardDescLib.c b/Platform/Marvell/Armada70x0Db/Armada70x0DbBoardDescLib/Armada70x0DbBoardDescLib.c index f0133ec..cbd23cc 100644 --- a/Platform/Marvell/Armada70x0Db/Armada70x0DbBoardDescLib/Armada70x0DbBoardDescLib.c +++ b/Platform/Marvell/Armada70x0Db/Armada70x0DbBoardDescLib/Armada70x0DbBoardDescLib.c @@ -46,6 +46,54 @@ ArmadaBoardGpioExpanderGet ( } // +// PCIE +// +STATIC +MV_PCIE_CONTROLLER mPcieController[] = { + { /* PCIE2 @0xF2640000 */ + .PcieBaseAddress = 0xF2640000, + .ConfigSpaceAddress = 0xE0000000, + .HaveResetGpio = FALSE, + .PcieResetGpio = { 0 }, + .PcieBusMin = 0, + .PcieBusMax = 0xFE, + .PcieIoTranslation = 0xEFF00000, + .PcieIoWinBase = 0x0, + .PcieIoWinSize = 0x10000, + .PcieMmio32Translation = 0, + .PcieMmio32WinBase = 0xC0000000, + .PcieMmio32WinSize = 0x20000000, + .PcieMmio64Translation = 0, + .PcieMmio64WinBase = 0x800000000, + .PcieMmio64WinSize = 0x100000000, + } +}; + +/** + Return the number and description of PCIE controllers used on the platform. + + @param[in out] **PcieControllers Array containing PCIE controllers' + description. + @param[in out] *PcieControllerCount Amount of used PCIE controllers. + + @retval EFI_SUCCESS The data were obtained successfully. + @retval other Return error status. + +**/ +EFI_STATUS +EFIAPI +ArmadaBoardPcieControllerGet ( + IN OUT MV_PCIE_CONTROLLER **PcieControllers, + IN OUT UINTN *PcieControllerCount + ) +{ + *PcieControllers = mPcieController; + *PcieControllerCount = ARRAY_SIZE (mPcieController); + + return EFI_SUCCESS; +} + +// // Order of devices in SdMmcDescTemplate has to be in par with ArmadaSoCDescLib // STATIC diff --git a/Platform/Marvell/Armada80x0Db/Armada80x0DbBoardDescLib/Armada80x0DbBoardDescLib.c b/Platform/Marvell/Armada80x0Db/Armada80x0DbBoardDescLib/Armada80x0DbBoardDescLib.c index 61b6202..5781756 100644 --- a/Platform/Marvell/Armada80x0Db/Armada80x0DbBoardDescLib/Armada80x0DbBoardDescLib.c +++ b/Platform/Marvell/Armada80x0Db/Armada80x0DbBoardDescLib/Armada80x0DbBoardDescLib.c @@ -52,6 +52,54 @@ ArmadaBoardGpioExpanderGet ( } // +// PCIE +// +STATIC +MV_PCIE_CONTROLLER mPcieController[] = { + { /* PCIE0 @0xF2600000 */ + .PcieBaseAddress = 0xF2600000, + .ConfigSpaceAddress = 0xE0000000, + .HaveResetGpio = FALSE, + .PcieResetGpio = { 0 }, + .PcieBusMin = 0, + .PcieBusMax = 0xFE, + .PcieIoTranslation = 0xEFF00000, + .PcieIoWinBase = 0x0, + .PcieIoWinSize = 0x10000, + .PcieMmio32Translation = 0, + .PcieMmio32WinBase = 0xC0000000, + .PcieMmio32WinSize = 0x20000000, + .PcieMmio64Translation = 0, + .PcieMmio64WinBase = 0x800000000, + .PcieMmio64WinSize = 0x100000000, + } +}; + +/** + Return the number and description of PCIE controllers used on the platform. + + @param[in out] **PcieControllers Array containing PCIE controllers' + description. + @param[in out] *PcieControllerCount Amount of used PCIE controllers. + + @retval EFI_SUCCESS The data were obtained successfully. + @retval other Return error status. + +**/ +EFI_STATUS +EFIAPI +ArmadaBoardPcieControllerGet ( + IN OUT MV_PCIE_CONTROLLER **PcieControllers, + IN OUT UINTN *PcieControllerCount + ) +{ + *PcieControllers = mPcieController; + *PcieControllerCount = ARRAY_SIZE (mPcieController); + + return EFI_SUCCESS; +} + +// // Order of devices in SdMmcDescTemplate has to be in par with ArmadaSoCDescLib // STATIC diff --git a/Platform/SolidRun/Armada80x0McBin/Armada80x0McBinBoardDescLib/Armada80x0McBinBoardDescLib.c b/Platform/SolidRun/Armada80x0McBin/Armada80x0McBinBoardDescLib/Armada80x0McBinBoardDescLib.c index 32596ad..11a889b 100644 --- a/Platform/SolidRun/Armada80x0McBin/Armada80x0McBinBoardDescLib/Armada80x0McBinBoardDescLib.c +++ b/Platform/SolidRun/Armada80x0McBin/Armada80x0McBinBoardDescLib/Armada80x0McBinBoardDescLib.c @@ -39,6 +39,54 @@ ArmadaBoardGpioExpanderGet ( } // +// PCIE +// +STATIC +MV_PCIE_CONTROLLER mPcieController[] = { + { /* PCIE0 @0xF2600000 */ + .PcieBaseAddress = 0xF2600000, + .ConfigSpaceAddress = 0xE0000000, + .HaveResetGpio = FALSE, + .PcieResetGpio = { 0 }, + .PcieBusMin = 0, + .PcieBusMax = 0xFE, + .PcieIoTranslation = 0xEFF00000, + .PcieIoWinBase = 0x0, + .PcieIoWinSize = 0x10000, + .PcieMmio32Translation = 0, + .PcieMmio32WinBase = 0xC0000000, + .PcieMmio32WinSize = 0x20000000, + .PcieMmio64Translation = 0, + .PcieMmio64WinBase = 0x800000000, + .PcieMmio64WinSize = 0x100000000, + } +}; + +/** + Return the number and description of PCIE controllers used on the platform. + + @param[in out] **PcieControllers Array containing PCIE controllers' + description. + @param[in out] *PcieControllerCount Amount of used PCIE controllers. + + @retval EFI_SUCCESS The data were obtained successfully. + @retval other Return error status. + +**/ +EFI_STATUS +EFIAPI +ArmadaBoardPcieControllerGet ( + IN OUT MV_PCIE_CONTROLLER **PcieControllers, + IN OUT UINTN *PcieControllerCount + ) +{ + *PcieControllers = mPcieController; + *PcieControllerCount = ARRAY_SIZE (mPcieController); + + return EFI_SUCCESS; +} + +// // Order of devices in SdMmcDescTemplate has to be in par with ArmadaSoCDescLib // STATIC -- 2.7.4