public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Marcin Wojtas" <mw@semihalf.com>
To: edk2-devel-groups-io <devel@edk2.groups.io>
Cc: Leif Lindholm <leif.lindholm@linaro.org>,
	Ard Biesheuvel <ard.biesheuvel@linaro.org>,
	 "jsd@semihalf.com" <jsd@semihalf.com>,
	Grzegorz Jaszczyk <jaz@semihalf.com>,
	 Kostya Porotchkin <kostap@marvell.com>,
	Jici Gao <Jici.Gao@arm.com>,  Rebecca Cran <rebecca@bluestop.org>,
	Mark Kettenis <kettenis@jive.eu>
Subject: Re: [edk2-platforms: PATCH 04/14] Marvell/Armada7k8k: Extend board description libraries with PCIE
Date: Thu, 9 May 2019 12:16:26 +0200	[thread overview]
Message-ID: <CAPv3WKegsmqO8Bf1GCjF658FU3hX=RyU=PaPsoCSFvq2-HUuhA@mail.gmail.com> (raw)
In-Reply-To: <1557395622-32425-5-git-send-email-mw@semihalf.com>

czw., 9 maj 2019 o 11:53 Marcin Wojtas <mw@semihalf.com> napisał(a):
>
> 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 <mw@semihalf.com>
> ---
>  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 },

Just after pushing the patches I noticed my mistake. The reset GPIO on
MacchiatoBin must be set and above fields should look like this:

-    .HaveResetGpio         = FALSE,
-    .PcieResetGpio         = { 0 },
+    .HaveResetGpio         = TRUE,
+    .PcieResetGpio         =
+     {
+       MV_GPIO_DRIVER_TYPE_SOC_CONTROLLER,
+       MV_GPIO_CP0_CONTROLLER1,
+       20,
+       FALSE
+     },

This will be sent in v2, however the binary pointed in the cover
letter is updated and performs the reset properly.

Best regards,
Marcin

> +    .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
>

  reply	other threads:[~2019-05-09 10:16 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-09  9:53 [edk2-platforms: PATCH 00/14] Armada7k8k PCIE support Marcin Wojtas
2019-05-09  9:53 ` [edk2-platforms: PATCH 01/14] Marvell/Library: MvGpioLib: Extend GPIO pin description Marcin Wojtas
2019-05-09  9:53 ` [edk2-platforms: PATCH 02/14] Marvell/Library: ArmadaSoCDescLib: Add PCIE information Marcin Wojtas
2019-05-10 14:59   ` Leif Lindholm
2019-05-10 15:03     ` Marcin Wojtas
2019-05-09  9:53 ` [edk2-platforms: PATCH 03/14] Marvell/Library: ArmadaBoardDescLib: " Marcin Wojtas
2019-05-16 13:57   ` Ard Biesheuvel
2019-05-09  9:53 ` [edk2-platforms: PATCH 04/14] Marvell/Armada7k8k: Extend board description libraries with PCIE Marcin Wojtas
2019-05-09 10:16   ` Marcin Wojtas [this message]
2019-05-09  9:53 ` [edk2-platforms: PATCH 05/14] Marvell/Armada7k8k: MvBoardDesc: Extend protocol with PCIE support Marcin Wojtas
2019-05-16 13:53   ` Ard Biesheuvel
2019-05-09  9:53 ` [edk2-platforms: PATCH 06/14] Marvell/Armada7k8k: Add PciExpressLib implementation Marcin Wojtas
2019-05-10 15:25   ` Leif Lindholm
2019-05-10 15:29     ` Marcin Wojtas
2019-05-16 14:02   ` Ard Biesheuvel
2019-05-16 14:26     ` Marcin Wojtas
2019-05-09  9:53 ` [edk2-platforms: PATCH 07/14] Marvell/Armada7k8k: Implement PciHostBridgeLib Marcin Wojtas
2019-05-10 15:50   ` Leif Lindholm
2019-05-12 11:41     ` Marcin Wojtas
2019-05-16 14:14   ` Ard Biesheuvel
2019-05-09  9:53 ` [edk2-platforms: PATCH 08/14] Marvell/Armada7k8k: Enable PCIE support Marcin Wojtas
2019-05-16 14:16   ` Ard Biesheuvel
2019-05-16 14:22     ` Marcin Wojtas
2019-05-16 14:25       ` Ard Biesheuvel
2019-05-16 14:32         ` Leif Lindholm
2019-05-09  9:53 ` [edk2-platforms: PATCH 09/14] Marvell/Armada80x0McBin: Enable ACPI " Marcin Wojtas
2019-05-10 15:54   ` Leif Lindholm
2019-05-16 14:23   ` Ard Biesheuvel
2019-05-09  9:53 ` [edk2-platforms: PATCH 10/14] Marvell/Armada80x0Db: " Marcin Wojtas
2019-05-16 14:25   ` [edk2-devel] " Ard Biesheuvel
2019-05-09  9:53 ` [edk2-platforms: PATCH 11/14] Marvell/Armada70x0Db: " Marcin Wojtas
2019-05-16 14:26   ` [edk2-devel] " Ard Biesheuvel
2019-05-09  9:53 ` [edk2-platforms: PATCH 12/14] Marvell/Armada80x0McBin: DeviceTree: Use pci-host-generic driver Marcin Wojtas
2019-05-09  9:53 ` [edk2-platforms: PATCH 13/14] Marvell/Armada7k8k: Remove duplication in .dsc files Marcin Wojtas
2019-05-09  9:53 ` [edk2-platforms: PATCH 14/14] Marvell/Armada7k8: Add 'acpiview' shell command to build Marcin Wojtas
2019-05-10 15:58 ` [edk2-platforms: PATCH 00/14] Armada7k8k PCIE support Leif Lindholm

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAPv3WKegsmqO8Bf1GCjF658FU3hX=RyU=PaPsoCSFvq2-HUuhA@mail.gmail.com' \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox