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=Z3WY9u/J; 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; Fri, 24 May 2019 08:59:35 -0700 Received: by mail-lf1-f68.google.com with SMTP id v18so7549446lfi.1 for ; Fri, 24 May 2019 08:59:34 -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=QFP2qsKD/PUEUtbLgAQdRK4+lhuJNCjkTvvfP7O6/l0=; b=Z3WY9u/JYkeQUvIeoYnqCnFz6EchEgRQbWCeU4M+kS4pFAyPOttl7Cjywn23CAyODH TCg9CgA421002sBHWzui9cnBMoQWpv4IfT9l7MceyEzQ1lr9WiLf2xWIJ2eW32xXPQAc ekykc3tOtociDEjT1AGUwaC3ePwijrKFL53IzkC6C90TspqzuqtrCEwEJ0+Rx8H8w/+p VvX1Q4yuzmhYFPG5MS4BZobCgElwD3dfA/StRh/HKLUAA5yFuSYzwUNUfF4hwTZSz3B2 4r5MIcVz3QtHQdhmlB8oCQyRDGN6C5XTendupczICrngmoOLmgABj9gcnVGSUMUrUj/V rZYA== 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=QFP2qsKD/PUEUtbLgAQdRK4+lhuJNCjkTvvfP7O6/l0=; b=H/bJda46Bo0QbDmNYgAbMAdJ2T4iQclD/JZLGZgXPXuMjx9n7rzz4dbhU8V/Exqg7u jGz3cuD/3B6oO+Xz68GGb0NZPtgYm2Q8SOJTJA1wjk4kHpiw7LqjMX9cCVXu6phbmmzI aVrGD0f0igjdhOTHSgRJpYYXg7n37ssauHdcOEzmjnkFLokPu2Z1s4lojrRFDRHmC2AQ kfplEKVLFLf5WcNnWvOadlrNYMiP+WTSJpDIPE8GyOOQOAovHITnfSrKZQPgCX26NuP1 f906oqv04oNBLjLc4UvhLsi3RBnvceX5Cobh8iZNL8xJbwcZxYe6LoIgBOAlLO2hIIo7 z96g== X-Gm-Message-State: APjAAAUJfSaplorPEpb6hZYV51TofGz8rc4v6VhCaDypD27yB1i5sAG7 EZ0fDKNcpVuDIbX+egd2h/Y/5ilJCyJUPw== X-Google-Smtp-Source: APXvYqy6cE1DgINzVRduyZsug1ycZtfJCYF9ERYQBcKAbLvhl/rGueA6HSy7v5qn3LvgHuRk7IStuQ== X-Received: by 2002:a19:7d05:: with SMTP id y5mr17153553lfc.40.1558713572751; Fri, 24 May 2019 08:59:32 -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 d18sm685280lfl.95.2019.05.24.08.59.31 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 24 May 2019 08:59:32 -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 v3 04/14] Marvell/Armada7k8k: Extend board description libraries with PCIE Date: Fri, 24 May 2019 17:59:01 +0200 Message-Id: <1558713551-25363-5-git-send-email-mw@semihalf.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1558713551-25363-1-git-send-email-mw@semihalf.com> References: <1558713551-25363-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 | 54 ++++++++++++++++++++ 3 files changed, 150 insertions(+) diff --git a/Platform/Marvell/Armada70x0Db/Armada70x0DbBoardDescLib/Armada70x0DbBoardDescLib.c b/Platform/Marvell/Armada70x0Db/Armada70x0DbBoardDescLib/Armada70x0DbBoardDescLib.c index dbd434f..ae13e0a 100644 --- a/Platform/Marvell/Armada70x0Db/Armada70x0DbBoardDescLib/Armada70x0DbBoardDescLib.c +++ b/Platform/Marvell/Armada70x0Db/Armada70x0DbBoardDescLib/Armada70x0DbBoardDescLib.c @@ -40,6 +40,54 @@ ArmadaBoardGpioExpanderGet ( } // +// PCIE +// +STATIC +MV_PCIE_CONTROLLER mPcieController[] = { + { /* PCIE2 @0xF2640000 */ + .PcieDbiAddress = 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 CONST **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 f083c94..144009c 100644 --- a/Platform/Marvell/Armada80x0Db/Armada80x0DbBoardDescLib/Armada80x0DbBoardDescLib.c +++ b/Platform/Marvell/Armada80x0Db/Armada80x0DbBoardDescLib/Armada80x0DbBoardDescLib.c @@ -46,6 +46,54 @@ ArmadaBoardGpioExpanderGet ( } // +// PCIE +// +STATIC +MV_PCIE_CONTROLLER mPcieController[] = { + { /* PCIE0 @0xF2600000 */ + .PcieDbiAddress = 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 CONST **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 3b69074..ebe7386 100644 --- a/Platform/SolidRun/Armada80x0McBin/Armada80x0McBinBoardDescLib/Armada80x0McBinBoardDescLib.c +++ b/Platform/SolidRun/Armada80x0McBin/Armada80x0McBinBoardDescLib/Armada80x0McBinBoardDescLib.c @@ -33,6 +33,60 @@ ArmadaBoardGpioExpanderGet ( } // +// PCIE +// +STATIC +MV_PCIE_CONTROLLER mPcieController[] = { + { /* PCIE0 @0xF2600000 */ + .PcieDbiAddress = 0xF2600000, + .ConfigSpaceAddress = 0xE0000000, + .HaveResetGpio = TRUE, + .PcieResetGpio = + { + MV_GPIO_DRIVER_TYPE_SOC_CONTROLLER, + MV_GPIO_CP0_CONTROLLER1, + 20, + FALSE + }, + .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 CONST **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